diff --git a/CocosDenshion/CDAudioManager.h b/CocosDenshion/CDAudioManager.h new file mode 100644 index 0000000..bb282f7 --- /dev/null +++ b/CocosDenshion/CDAudioManager.h @@ -0,0 +1,243 @@ +/* + Copyright (c) 2010 Steve Oldmeadow + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + + $Id$ + */ + +#import "CocosDenshion.h" +#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 30000 + #import +#else + #import "CDXMacOSXSupport.h" +#endif + +/** Different modes of the engine */ +typedef enum { + kAMM_FxOnly, //!Other apps will be able to play audio + kAMM_FxPlusMusic, //!Only this app will play audio + kAMM_FxPlusMusicIfNoOtherAudio, //!If another app is playing audio at start up then allow it to continue and don't play music + kAMM_MediaPlayback, //!This app takes over audio e.g music player app + kAMM_PlayAndRecord //!App takes over audio and has input and output +} tAudioManagerMode; + +/** Possible states of the engine */ +typedef enum { + kAMStateUninitialised, //!Audio manager has not been initialised - do not use + kAMStateInitialising, //!Audio manager is in the process of initialising - do not use + kAMStateInitialised //!Audio manager is initialised - safe to use +} tAudioManagerState; + +typedef enum { + kAMRBDoNothing, //Audio manager will not do anything on resign or becoming active + kAMRBStopPlay, //Background music is stopped on resign and resumed on become active + kAMRBStop //Background music is stopped on resign but not resumed - maybe because you want to do this from within your game +} tAudioManagerResignBehavior; + +/** Notifications */ +extern NSString * const kCDN_AudioManagerInitialised; + +@interface CDAsynchInitialiser : NSOperation {} +@end + +/** CDAudioManager supports two long audio source channels called left and right*/ +typedef enum { + kASC_Left = 0, + kASC_Right = 1 +} tAudioSourceChannel; + +typedef enum { + kLAS_Init, + kLAS_Loaded, + kLAS_Playing, + kLAS_Paused, + kLAS_Stopped, +} tLongAudioSourceState; + +@class CDLongAudioSource; +@protocol CDLongAudioSourceDelegate +@optional +/** The audio source completed playing */ +- (void) cdAudioSourceDidFinishPlaying:(CDLongAudioSource *) audioSource; +/** The file used to load the audio source has changed */ +- (void) cdAudioSourceFileDidChange:(CDLongAudioSource *) audioSource; +@end + +/** + CDLongAudioSource represents an audio source that has a long duration which makes + it costly to load into memory for playback as an effect using CDSoundEngine. Examples + include background music and narration tracks. The audio file may or may not be compressed. + Bear in mind that current iDevices can only use hardware to decode a single compressed + audio file at a time and playing multiple compressed files will result in a performance drop + as software decompression will take place. + @since v0.99 + */ +@interface CDLongAudioSource : NSObject { + AVAudioPlayer *audioSourcePlayer; + NSString *audioSourceFilePath; + NSInteger numberOfLoops; + float volume; + id delegate; + BOOL mute; + BOOL enabled_; + BOOL backgroundMusic; +@public + BOOL systemPaused;//Used for auto resign handling + NSTimeInterval systemPauseLocation;//Used for auto resign handling +@protected + tLongAudioSourceState state; +} +@property (readonly) AVAudioPlayer *audioSourcePlayer; +@property (readonly) NSString *audioSourceFilePath; +@property (readwrite, nonatomic) NSInteger numberOfLoops; +@property (readwrite, nonatomic) float volume; +@property (assign) id delegate; +/* This long audio source functions as background music */ +@property (readwrite, nonatomic) BOOL backgroundMusic; + +/** Loads the file into the audio source */ +-(void) load:(NSString*) filePath; +/** Plays the audio source */ +-(void) play; +/** Stops playing the audio soruce */ +-(void) stop; +/** Pauses the audio source */ +-(void) pause; +/** Rewinds the audio source */ +-(void) rewind; +/** Resumes playing the audio source if it was paused */ +-(void) resume; +/** Returns whether or not the audio source is playing */ +-(BOOL) isPlaying; + +@end + +/** + CDAudioManager manages audio requirements for a game. It provides access to a CDSoundEngine object + for playing sound effects. It provides access to two CDLongAudioSource object (left and right channel) + for playing long duration audio such as background music and narration tracks. Additionally it manages + the audio session to take care of things like audio session interruption and interacting with the audio + of other apps that are running on the device. + + Requirements: + - Firmware: OS 2.2 or greater + - Files: CDAudioManager.*, CocosDenshion.* + - Frameworks: OpenAL, AudioToolbox, AVFoundation + @since v0.8 + */ +@interface CDAudioManager : NSObject { + CDSoundEngine *soundEngine; + CDLongAudioSource *backgroundMusic; + NSMutableArray *audioSourceChannels; + NSString* _audioSessionCategory; + BOOL _audioWasPlayingAtStartup; + tAudioManagerMode _mode; + SEL backgroundMusicCompletionSelector; + id backgroundMusicCompletionListener; + BOOL willPlayBackgroundMusic; + BOOL _mute; + BOOL _resigned; + BOOL _interrupted; + BOOL _audioSessionActive; + BOOL enabled_; + + //For handling resign/become active + BOOL _isObservingAppEvents; + tAudioManagerResignBehavior _resignBehavior; +} + +@property (readonly) CDSoundEngine *soundEngine; +@property (readonly) CDLongAudioSource *backgroundMusic; +@property (readonly) BOOL willPlayBackgroundMusic; + +/** Returns the shared singleton */ ++ (CDAudioManager *) sharedManager; ++ (tAudioManagerState) sharedManagerState; +/** Configures the shared singleton with a mode*/ ++ (void) configure: (tAudioManagerMode) mode; +/** Initializes the engine asynchronously with a mode */ ++ (void) initAsynchronously: (tAudioManagerMode) mode; +/** Initializes the engine synchronously with a mode, channel definition and a total number of channels */ +- (id) init: (tAudioManagerMode) mode; +-(void) audioSessionInterrupted; +-(void) audioSessionResumed; +-(void) setResignBehavior:(tAudioManagerResignBehavior) resignBehavior autoHandle:(BOOL) autoHandle; +/** Returns true is audio is muted at a hardware level e.g user has ringer switch set to off */ +-(BOOL) isDeviceMuted; +/** Returns true if another app is playing audio such as the iPod music player */ +-(BOOL) isOtherAudioPlaying; +/** Sets the way the audio manager interacts with the operating system such as whether it shares output with other apps or obeys the mute switch */ +-(void) setMode:(tAudioManagerMode) mode; +/** Shuts down the shared audio manager instance so that it can be reinitialised */ ++(void) end; + +/** Call if you want to use built in resign behavior but need to do some additional audio processing on resign active. */ +- (void) applicationWillResignActive; +/** Call if you want to use built in resign behavior but need to do some additional audio processing on become active. */ +- (void) applicationDidBecomeActive; + +//New AVAudioPlayer API +/** Loads the data from the specified file path to the channel's audio source */ +-(CDLongAudioSource*) audioSourceLoad:(NSString*) filePath channel:(tAudioSourceChannel) channel; +/** Retrieves the audio source for the specified channel */ +-(CDLongAudioSource*) audioSourceForChannel:(tAudioSourceChannel) channel; + +//Legacy AVAudioPlayer API +/** Plays music in background. The music can be looped or not + It is recommended to use .aac files as background music since they are decoded by the device (hardware). + */ +-(void) playBackgroundMusic:(NSString*) filePath loop:(BOOL) loop; +/** Preloads a background music */ +-(void) preloadBackgroundMusic:(NSString*) filePath; +/** Stops playing the background music */ +-(void) stopBackgroundMusic; +/** Pauses the background music */ +-(void) pauseBackgroundMusic; +/** Rewinds the background music */ +-(void) rewindBackgroundMusic; +/** Resumes playing the background music */ +-(void) resumeBackgroundMusic; +/** Returns whether or not the background music is playing */ +-(BOOL) isBackgroundMusicPlaying; + +-(void) setBackgroundMusicCompletionListener:(id) listener selector:(SEL) selector; + +@end + +/** Fader for long audio source objects */ +@interface CDLongAudioSourceFader : CDPropertyModifier{} +@end + +static const int kCDNoBuffer = -1; + +/** Allows buffers to be associated with file names */ +@interface CDBufferManager:NSObject{ + NSMutableDictionary* loadedBuffers; + NSMutableArray *freedBuffers; + CDSoundEngine *soundEngine; + int nextBufferId; +} + +-(id) initWithEngine:(CDSoundEngine *) theSoundEngine; +-(int) bufferForFile:(NSString*) filePath create:(BOOL) create; +-(void) releaseBufferForFile:(NSString *) filePath; + +@end + diff --git a/src/CocosDenshion/CDAudioManager.m b/CocosDenshion/CDAudioManager.m similarity index 99% rename from src/CocosDenshion/CDAudioManager.m rename to CocosDenshion/CDAudioManager.m index b6ceea1..fe5ec6c 100644 --- a/src/CocosDenshion/CDAudioManager.m +++ b/CocosDenshion/CDAudioManager.m @@ -86,7 +86,7 @@ -(void) load:(NSString*) filePath { [self pause]; [self rewind]; } - audioSourcePlayer.volume = volume; + audioSourcePlayer.volume = mute ? 0.0f : volume; audioSourcePlayer.numberOfLoops = numberOfLoops; state = kLAS_Loaded; } diff --git a/CocosDenshion/CDConfig.h b/CocosDenshion/CDConfig.h new file mode 100644 index 0000000..b258a1f --- /dev/null +++ b/CocosDenshion/CDConfig.h @@ -0,0 +1,60 @@ +/* + Copyright (c) 2010 Steve Oldmeadow + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + + $Id$ + */ +#define COCOSDENSHION_VERSION "Aphex.rc" + + +/** + If enabled code useful for debugging such as parameter check assertions will be performed. + If you experience any problems you should enable this and test your code with a debug build. + */ +//#define CD_DEBUG 1 + +/** + The total number of sounds/buffers that can be loaded assuming memory is sufficient + */ +//Number of buffers slots that will be initially created +#define CD_BUFFERS_START 64 +//Number of buffers that will be added +#define CD_BUFFERS_INCREMENT 16 + +/** + If enabled, OpenAL code will use static buffers. When static buffers are used the audio + data is managed outside of OpenAL, this eliminates a memcpy operation which leads to + higher performance when loading sounds. + + However, the downside is that when the audio data is freed you must + be certain that it is no longer being accessed otherwise your app will crash. Testing on OS 2.2.1 + and 3.1.2 has shown that this may occur if a buffer is being used by a source with state = AL_PLAYING + when the buffer is deleted. If the data is freed too quickly after the source is stopped then + a crash will occur. The implemented workaround is that when static buffers are used the unloadBuffer code will wait for + any playing sources to finish playing before the associated buffer and data are deleted, however, this delay may negate any + performance gains that are achieved during loading. + + Performance tests on a 1st gen iPod running OS 2.2.1 loading the CocosDenshionDemo sounds were ~0.14 seconds without + static buffers and ~0.12 seconds when using static buffers. + + */ +//#define CD_USE_STATIC_BUFFERS 1 + + diff --git a/CocosDenshion/CDOpenALSupport.h b/CocosDenshion/CDOpenALSupport.h new file mode 100644 index 0000000..a7f21b1 --- /dev/null +++ b/CocosDenshion/CDOpenALSupport.h @@ -0,0 +1,77 @@ +/* + + Disclaimer: IMPORTANT: This Apple software is supplied to you by + Apple Inc. ("Apple") in consideration of your agreement to the + following terms, and your use, installation, modification or + redistribution of this Apple software constitutes acceptance of these + terms. If you do not agree with these terms, please do not use, + install, modify or redistribute this Apple software. + + In consideration of your agreement to abide by the following terms, and + subject to these terms, Apple grants you a personal, non-exclusive + license, under Apple's copyrights in this original Apple software (the + "Apple Software"), to use, reproduce, modify and redistribute the Apple + Software, with or without modifications, in source and/or binary forms; + provided that if you redistribute the Apple Software in its entirety and + without modifications, you must retain this notice and the following + text and disclaimers in all such redistributions of the Apple Software. + Neither the name, trademarks, service marks or logos of Apple Inc. + may be used to endorse or promote products derived from the Apple + Software without specific prior written permission from Apple. Except + as expressly stated in this notice, no other rights or licenses, express + or implied, are granted by Apple herein, including but not limited to + any patent rights that may be infringed by your derivative works or by + other works in which the Apple Software may be incorporated. + + The Apple Software is provided by Apple on an "AS IS" basis. APPLE + MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION + THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS + FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND + OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS. + + IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, + MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED + AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE), + STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + + Copyright (C) 2009 Apple Inc. All Rights Reserved. + + $Id$ + */ + +/* + This file contains code from version 1.1 and 1.4 of MyOpenALSupport.h taken from Apple's oalTouch version. + The 1.4 version code is used for loading IMA4 files, however, this code causes very noticeable clicking + when used to load wave files that are looped so the 1.1 version code is used specifically for loading + wav files. + */ + +#ifndef __CD_OPENAL_H +#define __CD_OPENAL_H + +#ifdef __cplusplus +extern "C" { +#endif + + +#import +#import +#import + + +//Taken from oalTouch MyOpenALSupport 1.1 +void* CDloadWaveAudioData(CFURLRef inFileURL, ALsizei *outDataSize, ALenum *outDataFormat, ALsizei* outSampleRate); +void* CDloadCafAudioData(CFURLRef inFileURL, ALsizei *outDataSize, ALenum *outDataFormat, ALsizei* outSampleRate); +void* CDGetOpenALAudioData(CFURLRef inFileURL, ALsizei *outDataSize, ALenum *outDataFormat, ALsizei* outSampleRate); + +#ifdef __cplusplus +} +#endif + +#endif + + diff --git a/src/CocosDenshion/CDOpenALSupport.m b/CocosDenshion/CDOpenALSupport.m similarity index 100% rename from src/CocosDenshion/CDOpenALSupport.m rename to CocosDenshion/CDOpenALSupport.m diff --git a/include/CocosDenshionExtras/CDXMacOSXSupport.h b/CocosDenshion/CDXMacOSXSupport.h similarity index 100% rename from include/CocosDenshionExtras/CDXMacOSXSupport.h rename to CocosDenshion/CDXMacOSXSupport.h diff --git a/src/CocosDenshionExtras/CDXMacOSXSupport.m b/CocosDenshion/CDXMacOSXSupport.m similarity index 99% rename from src/CocosDenshionExtras/CDXMacOSXSupport.m rename to CocosDenshion/CDXMacOSXSupport.m index 8384de7..9997215 100644 --- a/src/CocosDenshionExtras/CDXMacOSXSupport.m +++ b/CocosDenshion/CDXMacOSXSupport.m @@ -71,13 +71,13 @@ - (id)initWithData:(NSData *)theData error:(NSError **)outError { -(void) dealloc { [_player release]; [super dealloc]; -} +} - (void)sound:(NSSound *)sound didFinishPlaying:(BOOL)finished { if (self.delegate && [self.delegate respondsToSelector:@selector(audioPlayerDidFinishPlaying:successfully:)]) { [self.delegate audioPlayerDidFinishPlaying:self successfully:finished]; - } -} + } +} - (BOOL)play { BOOL result; @@ -172,4 +172,4 @@ - (BOOL)setPreferredHardwareSampleRate:(double)sampleRate error:(NSError**)outEr - (BOOL)setPreferredIOBufferDuration:(NSTimeInterval)duration error:(NSError**)outError {return YES;} @end -#endif \ No newline at end of file +#endif diff --git a/include/CocosDenshionExtras/CDXPropertyModifierAction.h b/CocosDenshion/CDXPropertyModifierAction.h similarity index 100% rename from include/CocosDenshionExtras/CDXPropertyModifierAction.h rename to CocosDenshion/CDXPropertyModifierAction.h diff --git a/src/CocosDenshionExtras/CDXPropertyModifierAction.m b/CocosDenshion/CDXPropertyModifierAction.m similarity index 96% rename from src/CocosDenshionExtras/CDXPropertyModifierAction.m rename to CocosDenshion/CDXPropertyModifierAction.m index 66f7160..ec2adff 100644 --- a/src/CocosDenshionExtras/CDXPropertyModifierAction.m +++ b/CocosDenshion/CDXPropertyModifierAction.m @@ -26,12 +26,12 @@ of this software and associated documentation files (the "Software"), to deal @implementation CDXPropertyModifierAction -+(id) actionWithDuration:(ccTime)t modifier:(CDPropertyModifier*) aModifier; ++(id) actionWithDuration:(ccTime)t modifier:(CDPropertyModifier*) aModifier { return [[[self alloc] initWithDuration:t modifier:aModifier] autorelease]; } --(id) initWithDuration:(ccTime)t modifier:(CDPropertyModifier*) aModifier; +-(id) initWithDuration:(ccTime)t modifier:(CDPropertyModifier*) aModifier { if( (self=[super initWithDuration: t]) ) { //Release the previous modifier @@ -65,6 +65,8 @@ -(id) copyWithZone: (NSZone*) zone return copy; } +#pragma clang diagnostic push COCOS2D +#pragma clang diagnostic ignored "-Wfloat-equal" -(void) update: (ccTime) t { //Check if modified property has been externally modified and if so bail out @@ -76,6 +78,7 @@ -(void) update: (ccTime) t [modifier modify:t]; lastSetValue = [modifier _getTargetProperty]; } +#pragma clang diagnostic pop COCOS2D +(void) fadeSoundEffects:(ccTime)t finalVolume:(float)endVol curveType:(tCDInterpolationType)curve shouldStop:(BOOL) stop { CDSoundEngine* se = [CDAudioManager sharedManager].soundEngine; diff --git a/CocosDenshion/CocosDenshion-Prefix.pch b/CocosDenshion/CocosDenshion-Prefix.pch new file mode 100644 index 0000000..eb2007e --- /dev/null +++ b/CocosDenshion/CocosDenshion-Prefix.pch @@ -0,0 +1,9 @@ +// +// Prefix header +// +// The contents of this file are implicitly included at the beginning of every source file. +// + +#ifdef __OBJC__ + #import +#endif diff --git a/CocosDenshion/CocosDenshion.h b/CocosDenshion/CocosDenshion.h new file mode 100644 index 0000000..47400f7 --- /dev/null +++ b/CocosDenshion/CocosDenshion.h @@ -0,0 +1,13 @@ +// +// CocosDenshion.h +// CocosDenshion +// +// Created by Goffredo Marocchi on 10/20/13. +// +// + +#import + +@interface CocosDenshion : NSObject + +@end diff --git a/CocosDenshion/CocosDenshion.m b/CocosDenshion/CocosDenshion.m new file mode 100644 index 0000000..cf73cea --- /dev/null +++ b/CocosDenshion/CocosDenshion.m @@ -0,0 +1,13 @@ +// +// CocosDenshion.m +// CocosDenshion +// +// Created by Goffredo Marocchi on 10/20/13. +// +// + +#import "CocosDenshion.h" + +@implementation CocosDenshion + +@end diff --git a/CocosDenshion/README.md b/CocosDenshion/README.md new file mode 100644 index 0000000..829f7fb --- /dev/null +++ b/CocosDenshion/README.md @@ -0,0 +1,5 @@ +CocosDenshion +============= + +Official CocosDenshion repository: + http://github.com/steveoldmeadow/cocos2d-iphone diff --git a/CocosDenshion/SimpleAudioEngine.h b/CocosDenshion/SimpleAudioEngine.h new file mode 100644 index 0000000..470e7b5 --- /dev/null +++ b/CocosDenshion/SimpleAudioEngine.h @@ -0,0 +1,90 @@ +/* + Copyright (c) 2010 Steve Oldmeadow + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + + $Id$ + */ + + +#import "CDAudioManager.h" + +/** + A wrapper to the CDAudioManager object. + This is recommended for basic audio requirements. If you just want to play some sound fx + and some background music and have no interest in learning the lower level workings then + this is the interface to use. + + Requirements: + - Firmware: OS 2.2 or greater + - Files: SimpleAudioEngine.*, CocosDenshion.* + - Frameworks: OpenAL, AudioToolbox, AVFoundation + @since v0.8 + */ +@interface SimpleAudioEngine : NSObject { + + BOOL mute_; + BOOL enabled_; +} + +/** Background music volume. Range is 0.0f to 1.0f. This will only have an effect if willPlayBackgroundMusic returns YES */ +@property (readwrite) float backgroundMusicVolume; +/** Effects volume. Range is 0.0f to 1.0f */ +@property (readwrite) float effectsVolume; +/** If NO it indicates background music will not be played either because no background music is loaded or the audio session does not permit it.*/ +@property (readonly) BOOL willPlayBackgroundMusic; + +/** returns the shared instance of the SimpleAudioEngine object */ ++ (SimpleAudioEngine*) sharedEngine; + +/** Preloads a music file so it will be ready to play as background music */ +-(void) preloadBackgroundMusic:(NSString*) filePath; + +/** plays background music in a loop*/ +-(void) playBackgroundMusic:(NSString*) filePath; +/** plays background music, if loop is true the music will repeat otherwise it will be played once */ +-(void) playBackgroundMusic:(NSString*) filePath loop:(BOOL) loop; +/** stops playing background music */ +-(void) stopBackgroundMusic; +/** pauses the background music */ +-(void) pauseBackgroundMusic; +/** resume background music that has been paused */ +-(void) resumeBackgroundMusic; +/** rewind the background music */ +-(void) rewindBackgroundMusic; +/** returns whether or not the background music is playing */ +-(BOOL) isBackgroundMusicPlaying; + +/** plays an audio effect with a file path*/ +-(ALuint) playEffect:(NSString*) filePath; +/** stop a sound that is playing, note you must pass in the soundId that is returned when you started playing the sound with playEffect */ +-(void) stopEffect:(ALuint) soundId; +/** plays an audio effect with a file path, pitch, pan and gain */ +-(ALuint) playEffect:(NSString*) filePath pitch:(Float32) pitch pan:(Float32) pan gain:(Float32) gain; +/** preloads an audio effect */ +-(void) preloadEffect:(NSString*) filePath; +/** unloads an audio effect from memory */ +-(void) unloadEffect:(NSString*) filePath; +/** Gets a CDSoundSource object set up to play the specified file. */ +-(CDSoundSource *) soundSourceForFile:(NSString*) filePath; + +/** Shuts down the shared audio engine instance so that it can be reinitialised */ ++(void) end; + +@end diff --git a/src/CocosDenshion/SimpleAudioEngine.m b/CocosDenshion/SimpleAudioEngine.m similarity index 100% rename from src/CocosDenshion/SimpleAudioEngine.m rename to CocosDenshion/SimpleAudioEngine.m diff --git a/CocosLib.xcodeproj/project.pbxproj b/CocosLib.xcodeproj/project.pbxproj index 219169d..3a16d77 100644 --- a/CocosLib.xcodeproj/project.pbxproj +++ b/CocosLib.xcodeproj/project.pbxproj @@ -7,1046 +7,613 @@ objects = { /* Begin PBXBuildFile section */ - E61037FD15DD169B00819640 /* b2BroadPhase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E610368015DD169B00819640 /* b2BroadPhase.cpp */; }; - E61037FE15DD169B00819640 /* b2CollideCircle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E610368115DD169B00819640 /* b2CollideCircle.cpp */; }; - E61037FF15DD169B00819640 /* b2CollideEdge.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E610368215DD169B00819640 /* b2CollideEdge.cpp */; }; - E610380015DD169B00819640 /* b2CollidePolygon.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E610368315DD169B00819640 /* b2CollidePolygon.cpp */; }; - E610380115DD169B00819640 /* b2Collision.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E610368415DD169B00819640 /* b2Collision.cpp */; }; - E610380215DD169B00819640 /* b2Distance.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E610368515DD169B00819640 /* b2Distance.cpp */; }; - E610380315DD169B00819640 /* b2DynamicTree.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E610368615DD169B00819640 /* b2DynamicTree.cpp */; }; - E610380415DD169B00819640 /* b2TimeOfImpact.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E610368715DD169B00819640 /* b2TimeOfImpact.cpp */; }; - E610380515DD169B00819640 /* b2ChainShape.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E610368915DD169B00819640 /* b2ChainShape.cpp */; }; - E610380615DD169B00819640 /* b2CircleShape.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E610368A15DD169B00819640 /* b2CircleShape.cpp */; }; - E610380715DD169B00819640 /* b2EdgeShape.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E610368B15DD169B00819640 /* b2EdgeShape.cpp */; }; - E610380815DD169B00819640 /* b2PolygonShape.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E610368C15DD169B00819640 /* b2PolygonShape.cpp */; }; - E610380915DD169B00819640 /* b2BlockAllocator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E610368E15DD169B00819640 /* b2BlockAllocator.cpp */; }; - E610380A15DD169B00819640 /* b2Draw.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E610368F15DD169B00819640 /* b2Draw.cpp */; }; - E610380B15DD169B00819640 /* b2Math.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E610369015DD169B00819640 /* b2Math.cpp */; }; - E610380C15DD169B00819640 /* b2Settings.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E610369115DD169B00819640 /* b2Settings.cpp */; }; - E610380D15DD169B00819640 /* b2StackAllocator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E610369215DD169B00819640 /* b2StackAllocator.cpp */; }; - E610380E15DD169B00819640 /* b2Timer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E610369315DD169B00819640 /* b2Timer.cpp */; }; - E610380F15DD169B00819640 /* b2Body.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E610369515DD169B00819640 /* b2Body.cpp */; }; - E610381015DD169B00819640 /* b2ContactManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E610369615DD169B00819640 /* b2ContactManager.cpp */; }; - E610381115DD169B00819640 /* b2Fixture.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E610369715DD169B00819640 /* b2Fixture.cpp */; }; - E610381215DD169B00819640 /* b2Island.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E610369815DD169B00819640 /* b2Island.cpp */; }; - E610381315DD169B00819640 /* b2World.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E610369915DD169B00819640 /* b2World.cpp */; }; - E610381415DD169B00819640 /* b2WorldCallbacks.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E610369A15DD169B00819640 /* b2WorldCallbacks.cpp */; }; - E610381515DD169B00819640 /* b2ChainAndCircleContact.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E610369C15DD169B00819640 /* b2ChainAndCircleContact.cpp */; }; - E610381615DD169B00819640 /* b2ChainAndPolygonContact.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E610369D15DD169B00819640 /* b2ChainAndPolygonContact.cpp */; }; - E610381715DD169B00819640 /* b2CircleContact.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E610369E15DD169B00819640 /* b2CircleContact.cpp */; }; - E610381815DD169B00819640 /* b2Contact.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E610369F15DD169B00819640 /* b2Contact.cpp */; }; - E610381915DD169B00819640 /* b2ContactSolver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E61036A015DD169B00819640 /* b2ContactSolver.cpp */; }; - E610381A15DD169B00819640 /* b2EdgeAndCircleContact.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E61036A115DD169B00819640 /* b2EdgeAndCircleContact.cpp */; }; - E610381B15DD169B00819640 /* b2EdgeAndPolygonContact.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E61036A215DD169B00819640 /* b2EdgeAndPolygonContact.cpp */; }; - E610381C15DD169B00819640 /* b2PolygonAndCircleContact.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E61036A315DD169B00819640 /* b2PolygonAndCircleContact.cpp */; }; - E610381D15DD169B00819640 /* b2PolygonContact.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E61036A415DD169B00819640 /* b2PolygonContact.cpp */; }; - E610381E15DD169B00819640 /* b2DistanceJoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E61036A615DD169B00819640 /* b2DistanceJoint.cpp */; }; - E610381F15DD169B00819640 /* b2FrictionJoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E61036A715DD169B00819640 /* b2FrictionJoint.cpp */; }; - E610382015DD169B00819640 /* b2GearJoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E61036A815DD169B00819640 /* b2GearJoint.cpp */; }; - E610382115DD169B00819640 /* b2Joint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E61036A915DD169B00819640 /* b2Joint.cpp */; }; - E610382215DD169B00819640 /* b2MotorJoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E61036AA15DD169B00819640 /* b2MotorJoint.cpp */; }; - E610382315DD169B00819640 /* b2MouseJoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E61036AB15DD169B00819640 /* b2MouseJoint.cpp */; }; - E610382415DD169B00819640 /* b2PrismaticJoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E61036AC15DD169B00819640 /* b2PrismaticJoint.cpp */; }; - E610382515DD169B00819640 /* b2PulleyJoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E61036AD15DD169B00819640 /* b2PulleyJoint.cpp */; }; - E610382615DD169B00819640 /* b2RevoluteJoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E61036AE15DD169B00819640 /* b2RevoluteJoint.cpp */; }; - E610382715DD169B00819640 /* b2RopeJoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E61036AF15DD169B00819640 /* b2RopeJoint.cpp */; }; - E610382815DD169B00819640 /* b2WeldJoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E61036B015DD169B00819640 /* b2WeldJoint.cpp */; }; - E610382915DD169B00819640 /* b2WheelJoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E61036B115DD169B00819640 /* b2WheelJoint.cpp */; }; - E610382A15DD169B00819640 /* b2Rope.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E61036B315DD169B00819640 /* b2Rope.cpp */; }; - E610382B15DD169B00819640 /* CCAction.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036B515DD169B00819640 /* CCAction.m */; }; - E610382C15DD169B00819640 /* CCActionCamera.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036B615DD169B00819640 /* CCActionCamera.m */; }; - E610382D15DD169B00819640 /* CCActionCatmullRom.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036B715DD169B00819640 /* CCActionCatmullRom.m */; }; - E610382E15DD169B00819640 /* CCActionEase.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036B815DD169B00819640 /* CCActionEase.m */; }; - E610382F15DD169B00819640 /* CCActionGrid.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036B915DD169B00819640 /* CCActionGrid.m */; }; - E610383015DD169B00819640 /* CCActionGrid3D.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036BA15DD169B00819640 /* CCActionGrid3D.m */; }; - E610383115DD169B00819640 /* CCActionInstant.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036BB15DD169B00819640 /* CCActionInstant.m */; }; - E610383215DD169B00819640 /* CCActionInterval.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036BC15DD169B00819640 /* CCActionInterval.m */; }; - E610383315DD169B00819640 /* CCActionManager.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036BD15DD169B00819640 /* CCActionManager.m */; }; - E610383415DD169B00819640 /* CCActionPageTurn3D.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036BE15DD169B00819640 /* CCActionPageTurn3D.m */; }; - E610383515DD169B00819640 /* CCActionProgressTimer.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036BF15DD169B00819640 /* CCActionProgressTimer.m */; }; - E610383615DD169B00819640 /* CCActionTiledGrid.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036C015DD169B00819640 /* CCActionTiledGrid.m */; }; - E610383715DD169B00819640 /* CCActionTween.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036C115DD169B00819640 /* CCActionTween.m */; }; - E610383815DD169B00819640 /* CCAnimation.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036C215DD169B00819640 /* CCAnimation.m */; }; - E610383915DD169B00819640 /* CCAnimationCache.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036C315DD169B00819640 /* CCAnimationCache.m */; }; - E610383A15DD169B00819640 /* CCAtlasNode.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036C415DD169B00819640 /* CCAtlasNode.m */; }; - E610383B15DD169B00819640 /* CCCamera.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036C515DD169B00819640 /* CCCamera.m */; }; - E610383C15DD169B00819640 /* CCConfiguration.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036C615DD169B00819640 /* CCConfiguration.m */; }; - E610383D15DD169B00819640 /* ccDeprecated.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036C715DD169B00819640 /* ccDeprecated.m */; }; - E610383E15DD169B00819640 /* CCDirector.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036C815DD169B00819640 /* CCDirector.m */; }; - E610383F15DD169B00819640 /* CCDrawingPrimitives.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036C915DD169B00819640 /* CCDrawingPrimitives.m */; }; - E610384015DD169B00819640 /* CCGLProgram.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036CA15DD169B00819640 /* CCGLProgram.m */; }; - E610384115DD169B00819640 /* ccGLStateCache.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036CB15DD169B00819640 /* ccGLStateCache.m */; }; - E610384215DD169B00819640 /* CCGrabber.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036CC15DD169B00819640 /* CCGrabber.m */; }; - E610384315DD169B00819640 /* CCGrid.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036CD15DD169B00819640 /* CCGrid.m */; }; - E610384415DD169B00819640 /* CCLabelAtlas.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036CE15DD169B00819640 /* CCLabelAtlas.m */; }; - E610384515DD169B00819640 /* CCLabelBMFont.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036CF15DD169B00819640 /* CCLabelBMFont.m */; }; - E610384615DD169B00819640 /* CCLabelTTF.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036D015DD169B00819640 /* CCLabelTTF.m */; }; - E610384715DD169B00819640 /* CCLayer.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036D115DD169B00819640 /* CCLayer.m */; }; - E610384815DD169B00819640 /* CCMenu.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036D215DD169B00819640 /* CCMenu.m */; }; - E610384915DD169B00819640 /* CCMenuItem.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036D315DD169B00819640 /* CCMenuItem.m */; }; - E610384A15DD169B00819640 /* CCMotionStreak.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036D415DD169B00819640 /* CCMotionStreak.m */; }; - E610384B15DD169B00819640 /* CCNode+Debug.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036D515DD169B00819640 /* CCNode+Debug.m */; }; - E610384C15DD169B00819640 /* CCNode.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036D615DD169B00819640 /* CCNode.m */; }; - E610384D15DD169B00819640 /* CCParallaxNode.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036D715DD169B00819640 /* CCParallaxNode.m */; }; - E610384E15DD169B00819640 /* CCParticleBatchNode.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036D815DD169B00819640 /* CCParticleBatchNode.m */; }; - E610384F15DD169B00819640 /* CCParticleSystem.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036D915DD169B00819640 /* CCParticleSystem.m */; }; - E610385015DD169B00819640 /* CCParticleSystemQuad.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036DA15DD169B00819640 /* CCParticleSystemQuad.m */; }; - E610385115DD169B00819640 /* CCProgressTimer.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036DB15DD169B00819640 /* CCProgressTimer.m */; }; - E610385215DD169B00819640 /* CCRenderTexture.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036DC15DD169B00819640 /* CCRenderTexture.m */; }; - E610385315DD169B00819640 /* CCScene.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036DD15DD169B00819640 /* CCScene.m */; }; - E610385415DD169B00819640 /* CCScheduler.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036DE15DD169B00819640 /* CCScheduler.m */; }; - E610385515DD169B00819640 /* CCShaderCache.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036DF15DD169B00819640 /* CCShaderCache.m */; }; - E610385615DD169B00819640 /* ccShaders.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036E015DD169B00819640 /* ccShaders.m */; }; - E610385715DD169B00819640 /* CCSprite.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036E115DD169B00819640 /* CCSprite.m */; }; - E610385815DD169B00819640 /* CCSpriteBatchNode.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036E215DD169B00819640 /* CCSpriteBatchNode.m */; }; - E610385915DD169B00819640 /* CCSpriteFrame.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036E315DD169B00819640 /* CCSpriteFrame.m */; }; - E610385A15DD169B00819640 /* CCSpriteFrameCache.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036E415DD169B00819640 /* CCSpriteFrameCache.m */; }; - E610385B15DD169B00819640 /* CCTexture2D.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036E515DD169B00819640 /* CCTexture2D.m */; }; - E610385C15DD169B00819640 /* CCTextureAtlas.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036E615DD169B00819640 /* CCTextureAtlas.m */; }; - E610385D15DD169B00819640 /* CCTextureCache.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036E715DD169B00819640 /* CCTextureCache.m */; }; - E610385E15DD169B00819640 /* CCTexturePVR.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036E815DD169B00819640 /* CCTexturePVR.m */; }; - E610385F15DD169B00819640 /* CCTileMapAtlas.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036E915DD169B00819640 /* CCTileMapAtlas.m */; }; - E610386015DD169B00819640 /* CCTMXLayer.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036EA15DD169B00819640 /* CCTMXLayer.m */; }; - E610386115DD169B00819640 /* CCTMXObjectGroup.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036EB15DD169B00819640 /* CCTMXObjectGroup.m */; }; - E610386215DD169B00819640 /* CCTMXTiledMap.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036EC15DD169B00819640 /* CCTMXTiledMap.m */; }; - E610386315DD169B00819640 /* CCTMXXMLParser.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036ED15DD169B00819640 /* CCTMXXMLParser.m */; }; - E610386415DD169B00819640 /* CCTransition.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036EE15DD169B00819640 /* CCTransition.m */; }; - E610386515DD169B00819640 /* CCTransitionPageTurn.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036EF15DD169B00819640 /* CCTransitionPageTurn.m */; }; - E610386615DD169B00819640 /* CCTransitionProgress.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036F015DD169B00819640 /* CCTransitionProgress.m */; }; - E610386715DD169B00819640 /* cocos2d.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036F115DD169B00819640 /* cocos2d.m */; }; - E610386815DD169B00819640 /* CCDirectorIOS.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036F415DD169B00819640 /* CCDirectorIOS.m */; }; - E610386915DD169B00819640 /* CCES2Renderer.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036F515DD169B00819640 /* CCES2Renderer.m */; }; - E610386A15DD169B00819640 /* CCGLView.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036F615DD169B00819640 /* CCGLView.m */; }; - E610386B15DD169B00819640 /* CCTouchDispatcher.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036F715DD169B00819640 /* CCTouchDispatcher.m */; }; - E610386C15DD169B00819640 /* CCTouchHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036F815DD169B00819640 /* CCTouchHandler.m */; }; - E610386D15DD169B00819640 /* CCDirectorMac.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036FA15DD169B00819640 /* CCDirectorMac.m */; }; - E610386E15DD169B00819640 /* CCEventDispatcher.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036FB15DD169B00819640 /* CCEventDispatcher.m */; }; - E610386F15DD169B00819640 /* CCGLView.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036FC15DD169B00819640 /* CCGLView.m */; }; - E610387015DD169B00819640 /* CCWindow.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036FD15DD169B00819640 /* CCWindow.m */; }; - E610387115DD169B00819640 /* base64.c in Sources */ = {isa = PBXBuildFile; fileRef = E61036FF15DD169B00819640 /* base64.c */; }; - E610387215DD169B00819640 /* CCArray.m in Sources */ = {isa = PBXBuildFile; fileRef = E610370015DD169B00819640 /* CCArray.m */; }; - E610387315DD169B00819640 /* ccCArray.m in Sources */ = {isa = PBXBuildFile; fileRef = E610370115DD169B00819640 /* ccCArray.m */; }; - E610387415DD169B00819640 /* CCFileUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = E610370215DD169B00819640 /* CCFileUtils.m */; }; - E610387515DD169B00819640 /* CCProfiling.m in Sources */ = {isa = PBXBuildFile; fileRef = E610370315DD169B00819640 /* CCProfiling.m */; }; - E610387615DD169B00819640 /* ccUtils.c in Sources */ = {isa = PBXBuildFile; fileRef = E610370415DD169B00819640 /* ccUtils.c */; }; - E610387715DD169B00819640 /* CCVertex.m in Sources */ = {isa = PBXBuildFile; fileRef = E610370515DD169B00819640 /* CCVertex.m */; }; - E610387815DD169B00819640 /* CGPointExtension.m in Sources */ = {isa = PBXBuildFile; fileRef = E610370615DD169B00819640 /* CGPointExtension.m */; }; - E610387915DD169B00819640 /* NSThread+performBlock.m in Sources */ = {isa = PBXBuildFile; fileRef = E610370715DD169B00819640 /* NSThread+performBlock.m */; }; - E610387A15DD169B00819640 /* TGAlib.m in Sources */ = {isa = PBXBuildFile; fileRef = E610370815DD169B00819640 /* TGAlib.m */; }; - E610387B15DD169B00819640 /* TransformUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = E610370915DD169B00819640 /* TransformUtils.m */; }; - E610387C15DD169B00819640 /* ZipUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = E610370A15DD169B00819640 /* ZipUtils.m */; }; - E610387D15DD169B00819640 /* CDAudioManager.m in Sources */ = {isa = PBXBuildFile; fileRef = E610370C15DD169B00819640 /* CDAudioManager.m */; }; - E610387E15DD169B00819640 /* CDOpenALSupport.m in Sources */ = {isa = PBXBuildFile; fileRef = E610370D15DD169B00819640 /* CDOpenALSupport.m */; }; - E610387F15DD169B00819640 /* CocosDenshion.m in Sources */ = {isa = PBXBuildFile; fileRef = E610370E15DD169B00819640 /* CocosDenshion.m */; }; - E610388015DD169B00819640 /* SimpleAudioEngine.m in Sources */ = {isa = PBXBuildFile; fileRef = E610370F15DD169B00819640 /* SimpleAudioEngine.m */; }; - E610388115DD169B00819640 /* CDXMacOSXSupport.m in Sources */ = {isa = PBXBuildFile; fileRef = E610371115DD169B00819640 /* CDXMacOSXSupport.m */; }; - E610388215DD169B00819640 /* CDXPropertyModifierAction.m in Sources */ = {isa = PBXBuildFile; fileRef = E610371215DD169B00819640 /* CDXPropertyModifierAction.m */; }; - E610388315DD169B00819640 /* aabb.c in Sources */ = {isa = PBXBuildFile; fileRef = E610371415DD169B00819640 /* aabb.c */; }; - E610388415DD169B00819640 /* mat4stack.c in Sources */ = {isa = PBXBuildFile; fileRef = E610371715DD169B00819640 /* mat4stack.c */; }; - E610388515DD169B00819640 /* matrix.c in Sources */ = {isa = PBXBuildFile; fileRef = E610371815DD169B00819640 /* matrix.c */; }; - E610388615DD169B00819640 /* mat3.c in Sources */ = {isa = PBXBuildFile; fileRef = E610371915DD169B00819640 /* mat3.c */; }; - E610388715DD169B00819640 /* mat4.c in Sources */ = {isa = PBXBuildFile; fileRef = E610371A15DD169B00819640 /* mat4.c */; }; - E610388815DD169B00819640 /* neon_matrix_impl.c in Sources */ = {isa = PBXBuildFile; fileRef = E610371B15DD169B00819640 /* neon_matrix_impl.c */; }; - E610388915DD169B00819640 /* plane.c in Sources */ = {isa = PBXBuildFile; fileRef = E610371C15DD169B00819640 /* plane.c */; }; - E610388A15DD169B00819640 /* quaternion.c in Sources */ = {isa = PBXBuildFile; fileRef = E610371D15DD169B00819640 /* quaternion.c */; }; - E610388B15DD169B00819640 /* ray2.c in Sources */ = {isa = PBXBuildFile; fileRef = E610371E15DD169B00819640 /* ray2.c */; }; - E610388C15DD169B00819640 /* utility.c in Sources */ = {isa = PBXBuildFile; fileRef = E610371F15DD169B00819640 /* utility.c */; }; - E610388D15DD169B00819640 /* vec2.c in Sources */ = {isa = PBXBuildFile; fileRef = E610372015DD169B00819640 /* vec2.c */; }; - E610388E15DD169B00819640 /* vec3.c in Sources */ = {isa = PBXBuildFile; fileRef = E610372115DD169B00819640 /* vec3.c */; }; - E610388F15DD169B00819640 /* vec4.c in Sources */ = {isa = PBXBuildFile; fileRef = E610372215DD169B00819640 /* vec4.c */; }; - E610389015DD169B00819640 /* png.c in Sources */ = {isa = PBXBuildFile; fileRef = E610372415DD169B00819640 /* png.c */; }; - E610389115DD169B00819640 /* pngerror.c in Sources */ = {isa = PBXBuildFile; fileRef = E610372515DD169B00819640 /* pngerror.c */; }; - E610389215DD169B00819640 /* pnggccrd.c in Sources */ = {isa = PBXBuildFile; fileRef = E610372615DD169B00819640 /* pnggccrd.c */; }; - E610389315DD169B00819640 /* pngget.c in Sources */ = {isa = PBXBuildFile; fileRef = E610372715DD169B00819640 /* pngget.c */; }; - E610389415DD169B00819640 /* pngmem.c in Sources */ = {isa = PBXBuildFile; fileRef = E610372815DD169B00819640 /* pngmem.c */; }; - E610389515DD169B00819640 /* pngpread.c in Sources */ = {isa = PBXBuildFile; fileRef = E610372A15DD169B00819640 /* pngpread.c */; }; - E610389615DD169B00819640 /* pngread.c in Sources */ = {isa = PBXBuildFile; fileRef = E610372B15DD169B00819640 /* pngread.c */; }; - E610389715DD169B00819640 /* pngrio.c in Sources */ = {isa = PBXBuildFile; fileRef = E610372C15DD169B00819640 /* pngrio.c */; }; - E610389815DD169B00819640 /* pngrtran.c in Sources */ = {isa = PBXBuildFile; fileRef = E610372D15DD169B00819640 /* pngrtran.c */; }; - E610389915DD169B00819640 /* pngrutil.c in Sources */ = {isa = PBXBuildFile; fileRef = E610372E15DD169B00819640 /* pngrutil.c */; }; - E610389A15DD169B00819640 /* pngset.c in Sources */ = {isa = PBXBuildFile; fileRef = E610372F15DD169B00819640 /* pngset.c */; }; - E610389B15DD169B00819640 /* pngtrans.c in Sources */ = {isa = PBXBuildFile; fileRef = E610373015DD169B00819640 /* pngtrans.c */; }; - E610389C15DD169B00819640 /* pngvcrd.c in Sources */ = {isa = PBXBuildFile; fileRef = E610373115DD169B00819640 /* pngvcrd.c */; }; - E610389D15DD169B00819640 /* pngwio.c in Sources */ = {isa = PBXBuildFile; fileRef = E610373215DD169B00819640 /* pngwio.c */; }; - E610389E15DD169B00819640 /* pngwrite.c in Sources */ = {isa = PBXBuildFile; fileRef = E610373315DD169B00819640 /* pngwrite.c */; }; - E610389F15DD169B00819640 /* pngwtran.c in Sources */ = {isa = PBXBuildFile; fileRef = E610373415DD169B00819640 /* pngwtran.c */; }; - E61038A015DD169B00819640 /* pngwutil.c in Sources */ = {isa = PBXBuildFile; fileRef = E610373515DD169B00819640 /* pngwutil.c */; }; - E61038A115DD169B00819640 /* Box2D.h in Headers */ = {isa = PBXBuildFile; fileRef = E610373B15DD169B00819640 /* Box2D.h */; }; - E61038A215DD169B00819640 /* b2BroadPhase.h in Headers */ = {isa = PBXBuildFile; fileRef = E610373D15DD169B00819640 /* b2BroadPhase.h */; }; - E61038A315DD169B00819640 /* b2Collision.h in Headers */ = {isa = PBXBuildFile; fileRef = E610373E15DD169B00819640 /* b2Collision.h */; }; - E61038A415DD169B00819640 /* b2Distance.h in Headers */ = {isa = PBXBuildFile; fileRef = E610373F15DD169B00819640 /* b2Distance.h */; }; - E61038A515DD169B00819640 /* b2DynamicTree.h in Headers */ = {isa = PBXBuildFile; fileRef = E610374015DD169B00819640 /* b2DynamicTree.h */; }; - E61038A615DD169B00819640 /* b2TimeOfImpact.h in Headers */ = {isa = PBXBuildFile; fileRef = E610374115DD169B00819640 /* b2TimeOfImpact.h */; }; - E61038A715DD169B00819640 /* b2ChainShape.h in Headers */ = {isa = PBXBuildFile; fileRef = E610374315DD169B00819640 /* b2ChainShape.h */; }; - E61038A815DD169B00819640 /* b2CircleShape.h in Headers */ = {isa = PBXBuildFile; fileRef = E610374415DD169B00819640 /* b2CircleShape.h */; }; - E61038A915DD169B00819640 /* b2EdgeShape.h in Headers */ = {isa = PBXBuildFile; fileRef = E610374515DD169B00819640 /* b2EdgeShape.h */; }; - E61038AA15DD169B00819640 /* b2PolygonShape.h in Headers */ = {isa = PBXBuildFile; fileRef = E610374615DD169B00819640 /* b2PolygonShape.h */; }; - E61038AB15DD169B00819640 /* b2Shape.h in Headers */ = {isa = PBXBuildFile; fileRef = E610374715DD169B00819640 /* b2Shape.h */; }; - E61038AC15DD169B00819640 /* b2BlockAllocator.h in Headers */ = {isa = PBXBuildFile; fileRef = E610374915DD169B00819640 /* b2BlockAllocator.h */; }; - E61038AD15DD169B00819640 /* b2Draw.h in Headers */ = {isa = PBXBuildFile; fileRef = E610374A15DD169B00819640 /* b2Draw.h */; }; - E61038AE15DD169B00819640 /* b2GrowableStack.h in Headers */ = {isa = PBXBuildFile; fileRef = E610374B15DD169B00819640 /* b2GrowableStack.h */; }; - E61038AF15DD169B00819640 /* b2Math.h in Headers */ = {isa = PBXBuildFile; fileRef = E610374C15DD169B00819640 /* b2Math.h */; }; - E61038B015DD169B00819640 /* b2Settings.h in Headers */ = {isa = PBXBuildFile; fileRef = E610374D15DD169B00819640 /* b2Settings.h */; }; - E61038B115DD169B00819640 /* b2StackAllocator.h in Headers */ = {isa = PBXBuildFile; fileRef = E610374E15DD169B00819640 /* b2StackAllocator.h */; }; - E61038B215DD169B00819640 /* b2Timer.h in Headers */ = {isa = PBXBuildFile; fileRef = E610374F15DD169B00819640 /* b2Timer.h */; }; - E61038B315DD169B00819640 /* b2Body.h in Headers */ = {isa = PBXBuildFile; fileRef = E610375115DD169B00819640 /* b2Body.h */; }; - E61038B415DD169B00819640 /* b2ContactManager.h in Headers */ = {isa = PBXBuildFile; fileRef = E610375215DD169B00819640 /* b2ContactManager.h */; }; - E61038B515DD169B00819640 /* b2Fixture.h in Headers */ = {isa = PBXBuildFile; fileRef = E610375315DD169B00819640 /* b2Fixture.h */; }; - E61038B615DD169B00819640 /* b2Island.h in Headers */ = {isa = PBXBuildFile; fileRef = E610375415DD169B00819640 /* b2Island.h */; }; - E61038B715DD169B00819640 /* b2TimeStep.h in Headers */ = {isa = PBXBuildFile; fileRef = E610375515DD169B00819640 /* b2TimeStep.h */; }; - E61038B815DD169B00819640 /* b2World.h in Headers */ = {isa = PBXBuildFile; fileRef = E610375615DD169B00819640 /* b2World.h */; }; - E61038B915DD169B00819640 /* b2WorldCallbacks.h in Headers */ = {isa = PBXBuildFile; fileRef = E610375715DD169B00819640 /* b2WorldCallbacks.h */; }; - E61038BA15DD169B00819640 /* b2ChainAndCircleContact.h in Headers */ = {isa = PBXBuildFile; fileRef = E610375915DD169B00819640 /* b2ChainAndCircleContact.h */; }; - E61038BB15DD169B00819640 /* b2ChainAndPolygonContact.h in Headers */ = {isa = PBXBuildFile; fileRef = E610375A15DD169B00819640 /* b2ChainAndPolygonContact.h */; }; - E61038BC15DD169B00819640 /* b2CircleContact.h in Headers */ = {isa = PBXBuildFile; fileRef = E610375B15DD169B00819640 /* b2CircleContact.h */; }; - E61038BD15DD169B00819640 /* b2Contact.h in Headers */ = {isa = PBXBuildFile; fileRef = E610375C15DD169B00819640 /* b2Contact.h */; }; - E61038BE15DD169B00819640 /* b2ContactSolver.h in Headers */ = {isa = PBXBuildFile; fileRef = E610375D15DD169B00819640 /* b2ContactSolver.h */; }; - E61038BF15DD169B00819640 /* b2EdgeAndCircleContact.h in Headers */ = {isa = PBXBuildFile; fileRef = E610375E15DD169B00819640 /* b2EdgeAndCircleContact.h */; }; - E61038C015DD169B00819640 /* b2EdgeAndPolygonContact.h in Headers */ = {isa = PBXBuildFile; fileRef = E610375F15DD169B00819640 /* b2EdgeAndPolygonContact.h */; }; - E61038C115DD169B00819640 /* b2PolygonAndCircleContact.h in Headers */ = {isa = PBXBuildFile; fileRef = E610376015DD169B00819640 /* b2PolygonAndCircleContact.h */; }; - E61038C215DD169B00819640 /* b2PolygonContact.h in Headers */ = {isa = PBXBuildFile; fileRef = E610376115DD169B00819640 /* b2PolygonContact.h */; }; - E61038C315DD169B00819640 /* b2DistanceJoint.h in Headers */ = {isa = PBXBuildFile; fileRef = E610376315DD169B00819640 /* b2DistanceJoint.h */; }; - E61038C415DD169B00819640 /* b2FrictionJoint.h in Headers */ = {isa = PBXBuildFile; fileRef = E610376415DD169B00819640 /* b2FrictionJoint.h */; }; - E61038C515DD169B00819640 /* b2GearJoint.h in Headers */ = {isa = PBXBuildFile; fileRef = E610376515DD169B00819640 /* b2GearJoint.h */; }; - E61038C615DD169B00819640 /* b2Joint.h in Headers */ = {isa = PBXBuildFile; fileRef = E610376615DD169B00819640 /* b2Joint.h */; }; - E61038C715DD169B00819640 /* b2MotorJoint.h in Headers */ = {isa = PBXBuildFile; fileRef = E610376715DD169B00819640 /* b2MotorJoint.h */; }; - E61038C815DD169B00819640 /* b2MouseJoint.h in Headers */ = {isa = PBXBuildFile; fileRef = E610376815DD169B00819640 /* b2MouseJoint.h */; }; - E61038C915DD169B00819640 /* b2PrismaticJoint.h in Headers */ = {isa = PBXBuildFile; fileRef = E610376915DD169B00819640 /* b2PrismaticJoint.h */; }; - E61038CA15DD169B00819640 /* b2PulleyJoint.h in Headers */ = {isa = PBXBuildFile; fileRef = E610376A15DD169B00819640 /* b2PulleyJoint.h */; }; - E61038CB15DD169B00819640 /* b2RevoluteJoint.h in Headers */ = {isa = PBXBuildFile; fileRef = E610376B15DD169B00819640 /* b2RevoluteJoint.h */; }; - E61038CC15DD169B00819640 /* b2RopeJoint.h in Headers */ = {isa = PBXBuildFile; fileRef = E610376C15DD169B00819640 /* b2RopeJoint.h */; }; - E61038CD15DD169B00819640 /* b2WeldJoint.h in Headers */ = {isa = PBXBuildFile; fileRef = E610376D15DD169B00819640 /* b2WeldJoint.h */; }; - E61038CE15DD169B00819640 /* b2WheelJoint.h in Headers */ = {isa = PBXBuildFile; fileRef = E610376E15DD169B00819640 /* b2WheelJoint.h */; }; - E61038CF15DD169B00819640 /* b2Rope.h in Headers */ = {isa = PBXBuildFile; fileRef = E610377015DD169B00819640 /* b2Rope.h */; }; - E61038D015DD169B00819640 /* CCAction.h in Headers */ = {isa = PBXBuildFile; fileRef = E610377215DD169B00819640 /* CCAction.h */; }; - E61038D115DD169B00819640 /* CCActionCamera.h in Headers */ = {isa = PBXBuildFile; fileRef = E610377315DD169B00819640 /* CCActionCamera.h */; }; - E61038D215DD169B00819640 /* CCActionCatmullRom.h in Headers */ = {isa = PBXBuildFile; fileRef = E610377415DD169B00819640 /* CCActionCatmullRom.h */; }; - E61038D315DD169B00819640 /* CCActionEase.h in Headers */ = {isa = PBXBuildFile; fileRef = E610377515DD169B00819640 /* CCActionEase.h */; }; - E61038D415DD169B00819640 /* CCActionGrid.h in Headers */ = {isa = PBXBuildFile; fileRef = E610377615DD169B00819640 /* CCActionGrid.h */; }; - E61038D515DD169B00819640 /* CCActionGrid3D.h in Headers */ = {isa = PBXBuildFile; fileRef = E610377715DD169B00819640 /* CCActionGrid3D.h */; }; - E61038D615DD169B00819640 /* CCActionInstant.h in Headers */ = {isa = PBXBuildFile; fileRef = E610377815DD169B00819640 /* CCActionInstant.h */; }; - E61038D715DD169B00819640 /* CCActionInterval.h in Headers */ = {isa = PBXBuildFile; fileRef = E610377915DD169B00819640 /* CCActionInterval.h */; }; - E61038D815DD169B00819640 /* CCActionManager.h in Headers */ = {isa = PBXBuildFile; fileRef = E610377A15DD169B00819640 /* CCActionManager.h */; }; - E61038D915DD169B00819640 /* CCActionPageTurn3D.h in Headers */ = {isa = PBXBuildFile; fileRef = E610377B15DD169B00819640 /* CCActionPageTurn3D.h */; }; - E61038DA15DD169B00819640 /* CCActionProgressTimer.h in Headers */ = {isa = PBXBuildFile; fileRef = E610377C15DD169B00819640 /* CCActionProgressTimer.h */; }; - E61038DB15DD169B00819640 /* CCActionTiledGrid.h in Headers */ = {isa = PBXBuildFile; fileRef = E610377D15DD169B00819640 /* CCActionTiledGrid.h */; }; - E61038DC15DD169B00819640 /* CCActionTween.h in Headers */ = {isa = PBXBuildFile; fileRef = E610377E15DD169B00819640 /* CCActionTween.h */; }; - E61038DD15DD169B00819640 /* CCAnimation.h in Headers */ = {isa = PBXBuildFile; fileRef = E610377F15DD169B00819640 /* CCAnimation.h */; }; - E61038DE15DD169B00819640 /* CCAnimationCache.h in Headers */ = {isa = PBXBuildFile; fileRef = E610378015DD169B00819640 /* CCAnimationCache.h */; }; - E61038DF15DD169B00819640 /* CCAtlasNode.h in Headers */ = {isa = PBXBuildFile; fileRef = E610378115DD169B00819640 /* CCAtlasNode.h */; }; - E61038E015DD169B00819640 /* CCCamera.h in Headers */ = {isa = PBXBuildFile; fileRef = E610378215DD169B00819640 /* CCCamera.h */; }; - E61038E115DD169B00819640 /* ccConfig.h in Headers */ = {isa = PBXBuildFile; fileRef = E610378315DD169B00819640 /* ccConfig.h */; }; - E61038E215DD169B00819640 /* CCConfiguration.h in Headers */ = {isa = PBXBuildFile; fileRef = E610378415DD169B00819640 /* CCConfiguration.h */; }; - E61038E315DD169B00819640 /* ccDeprecated.h in Headers */ = {isa = PBXBuildFile; fileRef = E610378515DD169B00819640 /* ccDeprecated.h */; }; - E61038E415DD169B00819640 /* CCDirector.h in Headers */ = {isa = PBXBuildFile; fileRef = E610378615DD169B00819640 /* CCDirector.h */; }; - E61038E515DD169B00819640 /* CCDrawingPrimitives.h in Headers */ = {isa = PBXBuildFile; fileRef = E610378715DD169B00819640 /* CCDrawingPrimitives.h */; }; - E61038E615DD169B00819640 /* CCGLProgram.h in Headers */ = {isa = PBXBuildFile; fileRef = E610378815DD169B00819640 /* CCGLProgram.h */; }; - E61038E715DD169B00819640 /* ccGLStateCache.h in Headers */ = {isa = PBXBuildFile; fileRef = E610378915DD169B00819640 /* ccGLStateCache.h */; }; - E61038E815DD169B00819640 /* CCGrabber.h in Headers */ = {isa = PBXBuildFile; fileRef = E610378A15DD169B00819640 /* CCGrabber.h */; }; - E61038E915DD169B00819640 /* CCGrid.h in Headers */ = {isa = PBXBuildFile; fileRef = E610378B15DD169B00819640 /* CCGrid.h */; }; - E61038EA15DD169B00819640 /* CCLabelAtlas.h in Headers */ = {isa = PBXBuildFile; fileRef = E610378C15DD169B00819640 /* CCLabelAtlas.h */; }; - E61038EB15DD169B00819640 /* CCLabelBMFont.h in Headers */ = {isa = PBXBuildFile; fileRef = E610378D15DD169B00819640 /* CCLabelBMFont.h */; }; - E61038EC15DD169B00819640 /* CCLabelTTF.h in Headers */ = {isa = PBXBuildFile; fileRef = E610378E15DD169B00819640 /* CCLabelTTF.h */; }; - E61038ED15DD169B00819640 /* CCLayer.h in Headers */ = {isa = PBXBuildFile; fileRef = E610378F15DD169B00819640 /* CCLayer.h */; }; - E61038EE15DD169B00819640 /* ccMacros.h in Headers */ = {isa = PBXBuildFile; fileRef = E610379015DD169B00819640 /* ccMacros.h */; }; - E61038EF15DD169B00819640 /* CCMenu.h in Headers */ = {isa = PBXBuildFile; fileRef = E610379115DD169B00819640 /* CCMenu.h */; }; - E61038F015DD169B00819640 /* CCMenuItem.h in Headers */ = {isa = PBXBuildFile; fileRef = E610379215DD169B00819640 /* CCMenuItem.h */; }; - E61038F115DD169B00819640 /* CCMotionStreak.h in Headers */ = {isa = PBXBuildFile; fileRef = E610379315DD169B00819640 /* CCMotionStreak.h */; }; - E61038F215DD169B00819640 /* CCNode+Debug.h in Headers */ = {isa = PBXBuildFile; fileRef = E610379415DD169B00819640 /* CCNode+Debug.h */; }; - E61038F315DD169B00819640 /* CCNode.h in Headers */ = {isa = PBXBuildFile; fileRef = E610379515DD169B00819640 /* CCNode.h */; }; - E61038F415DD169B00819640 /* CCParallaxNode.h in Headers */ = {isa = PBXBuildFile; fileRef = E610379615DD169B00819640 /* CCParallaxNode.h */; }; - E61038F515DD169B00819640 /* CCParticleBatchNode.h in Headers */ = {isa = PBXBuildFile; fileRef = E610379715DD169B00819640 /* CCParticleBatchNode.h */; }; - E61038F615DD169B00819640 /* CCParticleSystem.h in Headers */ = {isa = PBXBuildFile; fileRef = E610379815DD169B00819640 /* CCParticleSystem.h */; }; - E61038F715DD169B00819640 /* CCParticleSystemQuad.h in Headers */ = {isa = PBXBuildFile; fileRef = E610379915DD169B00819640 /* CCParticleSystemQuad.h */; }; - E61038F815DD169B00819640 /* CCProgressTimer.h in Headers */ = {isa = PBXBuildFile; fileRef = E610379A15DD169B00819640 /* CCProgressTimer.h */; }; - E61038F915DD169B00819640 /* CCProtocols.h in Headers */ = {isa = PBXBuildFile; fileRef = E610379B15DD169B00819640 /* CCProtocols.h */; }; - E61038FA15DD169B00819640 /* CCRenderTexture.h in Headers */ = {isa = PBXBuildFile; fileRef = E610379C15DD169B00819640 /* CCRenderTexture.h */; }; - E61038FB15DD169B00819640 /* CCScene.h in Headers */ = {isa = PBXBuildFile; fileRef = E610379D15DD169B00819640 /* CCScene.h */; }; - E61038FC15DD169B00819640 /* CCScheduler.h in Headers */ = {isa = PBXBuildFile; fileRef = E610379E15DD169B00819640 /* CCScheduler.h */; }; - E61038FD15DD169B00819640 /* ccShader_Position_uColor_frag.h in Headers */ = {isa = PBXBuildFile; fileRef = E610379F15DD169B00819640 /* ccShader_Position_uColor_frag.h */; }; - E61038FE15DD169B00819640 /* ccShader_Position_uColor_vert.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037A015DD169B00819640 /* ccShader_Position_uColor_vert.h */; }; - E61038FF15DD169B00819640 /* ccShader_PositionColor_frag.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037A115DD169B00819640 /* ccShader_PositionColor_frag.h */; }; - E610390015DD169B00819640 /* ccShader_PositionColor_vert.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037A215DD169B00819640 /* ccShader_PositionColor_vert.h */; }; - E610390115DD169B00819640 /* ccShader_PositionTexture_frag.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037A315DD169B00819640 /* ccShader_PositionTexture_frag.h */; }; - E610390215DD169B00819640 /* ccShader_PositionTexture_uColor_frag.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037A415DD169B00819640 /* ccShader_PositionTexture_uColor_frag.h */; }; - E610390315DD169B00819640 /* ccShader_PositionTexture_uColor_vert.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037A515DD169B00819640 /* ccShader_PositionTexture_uColor_vert.h */; }; - E610390415DD169B00819640 /* ccShader_PositionTexture_vert.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037A615DD169B00819640 /* ccShader_PositionTexture_vert.h */; }; - E610390515DD169B00819640 /* ccShader_PositionTextureA8Color_frag.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037A715DD169B00819640 /* ccShader_PositionTextureA8Color_frag.h */; }; - E610390615DD169B00819640 /* ccShader_PositionTextureA8Color_vert.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037A815DD169B00819640 /* ccShader_PositionTextureA8Color_vert.h */; }; - E610390715DD169B00819640 /* ccShader_PositionTextureColor_frag.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037A915DD169B00819640 /* ccShader_PositionTextureColor_frag.h */; }; - E610390815DD169B00819640 /* ccShader_PositionTextureColor_vert.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037AA15DD169B00819640 /* ccShader_PositionTextureColor_vert.h */; }; - E610390915DD169B00819640 /* ccShader_PositionTextureColorAlphaTest_frag.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037AB15DD169B00819640 /* ccShader_PositionTextureColorAlphaTest_frag.h */; }; - E610390A15DD169B00819640 /* CCShaderCache.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037AC15DD169B00819640 /* CCShaderCache.h */; }; - E610390B15DD169B00819640 /* ccShaders.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037AD15DD169B00819640 /* ccShaders.h */; }; - E610390C15DD169B00819640 /* CCSprite.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037AE15DD169B00819640 /* CCSprite.h */; }; - E610390D15DD169B00819640 /* CCSpriteBatchNode.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037AF15DD169B00819640 /* CCSpriteBatchNode.h */; }; - E610390E15DD169B00819640 /* CCSpriteFrame.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037B015DD169B00819640 /* CCSpriteFrame.h */; }; - E610390F15DD169B00819640 /* CCSpriteFrameCache.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037B115DD169B00819640 /* CCSpriteFrameCache.h */; }; - E610391015DD169B00819640 /* CCTexture2D.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037B215DD169B00819640 /* CCTexture2D.h */; }; - E610391115DD169B00819640 /* CCTextureAtlas.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037B315DD169B00819640 /* CCTextureAtlas.h */; }; - E610391215DD169B00819640 /* CCTextureCache.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037B415DD169B00819640 /* CCTextureCache.h */; }; - E610391315DD169B00819640 /* CCTexturePVR.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037B515DD169B00819640 /* CCTexturePVR.h */; }; - E610391415DD169B00819640 /* CCTileMapAtlas.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037B615DD169B00819640 /* CCTileMapAtlas.h */; }; - E610391515DD169B00819640 /* CCTMXLayer.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037B715DD169B00819640 /* CCTMXLayer.h */; }; - E610391615DD169B00819640 /* CCTMXObjectGroup.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037B815DD169B00819640 /* CCTMXObjectGroup.h */; }; - E610391715DD169B00819640 /* CCTMXTiledMap.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037B915DD169B00819640 /* CCTMXTiledMap.h */; }; - E610391815DD169B00819640 /* CCTMXXMLParser.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037BA15DD169B00819640 /* CCTMXXMLParser.h */; }; - E610391915DD169B00819640 /* CCTransition.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037BB15DD169B00819640 /* CCTransition.h */; }; - E610391A15DD169B00819640 /* CCTransitionOrientationType.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037BC15DD169B00819640 /* CCTransitionOrientationType.h */; }; - E610391B15DD169B00819640 /* CCTransitionPageTurn.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037BD15DD169B00819640 /* CCTransitionPageTurn.h */; }; - E610391C15DD169B00819640 /* CCTransitionProgress.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037BE15DD169B00819640 /* CCTransitionProgress.h */; }; - E610391D15DD169B00819640 /* ccTypes.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037BF15DD169B00819640 /* ccTypes.h */; }; - E610391E15DD169B00819640 /* cocos2d.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037C015DD169B00819640 /* cocos2d.h */; }; - E610391F15DD169B00819640 /* CCGL.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037C215DD169B00819640 /* CCGL.h */; }; - E610392015DD169B00819640 /* CCNS.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037C315DD169B00819640 /* CCNS.h */; }; - E610392115DD169B00819640 /* CCDirectorIOS.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037C515DD169B00819640 /* CCDirectorIOS.h */; }; - E610392215DD169B00819640 /* CCES2Renderer.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037C615DD169B00819640 /* CCES2Renderer.h */; }; - E610392315DD169B00819640 /* CCESRenderer.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037C715DD169B00819640 /* CCESRenderer.h */; }; - E610392415DD169B00819640 /* CCGLView.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037C815DD169B00819640 /* CCGLView.h */; }; - E610392515DD169B00819640 /* CCTouchDelegateProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037C915DD169B00819640 /* CCTouchDelegateProtocol.h */; }; - E610392615DD169B00819640 /* CCTouchDispatcher.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037CA15DD169B00819640 /* CCTouchDispatcher.h */; }; - E610392715DD169B00819640 /* CCTouchHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037CB15DD169B00819640 /* CCTouchHandler.h */; }; - E610392815DD169B00819640 /* CCDirectorMac.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037CD15DD169B00819640 /* CCDirectorMac.h */; }; - E610392915DD169B00819640 /* CCEventDispatcher.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037CE15DD169B00819640 /* CCEventDispatcher.h */; }; - E610392A15DD169B00819640 /* CCGLView.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037CF15DD169B00819640 /* CCGLView.h */; }; - E610392B15DD169B00819640 /* CCWindow.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037D015DD169B00819640 /* CCWindow.h */; }; - E610392C15DD169B00819640 /* base64.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037D215DD169B00819640 /* base64.h */; }; - E610392D15DD169B00819640 /* CCArray.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037D315DD169B00819640 /* CCArray.h */; }; - E610392E15DD169B00819640 /* ccCArray.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037D415DD169B00819640 /* ccCArray.h */; }; - E610392F15DD169B00819640 /* CCFileUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037D515DD169B00819640 /* CCFileUtils.h */; }; - E610393015DD169B00819640 /* CCProfiling.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037D615DD169B00819640 /* CCProfiling.h */; }; - E610393115DD169B00819640 /* ccUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037D715DD169B00819640 /* ccUtils.h */; }; - E610393215DD169B00819640 /* CCVertex.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037D815DD169B00819640 /* CCVertex.h */; }; - E610393315DD169B00819640 /* CGPointExtension.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037D915DD169B00819640 /* CGPointExtension.h */; }; - E610393415DD169B00819640 /* NSThread+performBlock.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037DA15DD169B00819640 /* NSThread+performBlock.h */; }; - E610393515DD169B00819640 /* OpenGL_Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037DB15DD169B00819640 /* OpenGL_Internal.h */; }; - E610393615DD169B00819640 /* TGAlib.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037DC15DD169B00819640 /* TGAlib.h */; }; - E610393715DD169B00819640 /* TransformUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037DD15DD169B00819640 /* TransformUtils.h */; }; - E610393815DD169B00819640 /* uthash.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037DE15DD169B00819640 /* uthash.h */; }; - E610393915DD169B00819640 /* utlist.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037DF15DD169B00819640 /* utlist.h */; }; - E610393A15DD169B00819640 /* ZipUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037E015DD169B00819640 /* ZipUtils.h */; }; - E610393B15DD169B00819640 /* CDAudioManager.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037E215DD169B00819640 /* CDAudioManager.h */; }; - E610393C15DD169B00819640 /* CDConfig.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037E315DD169B00819640 /* CDConfig.h */; }; - E610393D15DD169B00819640 /* CDOpenALSupport.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037E415DD169B00819640 /* CDOpenALSupport.h */; }; - E610393E15DD169B00819640 /* CocosDenshion.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037E515DD169B00819640 /* CocosDenshion.h */; }; - E610393F15DD169B00819640 /* SimpleAudioEngine.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037E615DD169B00819640 /* SimpleAudioEngine.h */; }; - E610394015DD169B00819640 /* CDXMacOSXSupport.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037E815DD169B00819640 /* CDXMacOSXSupport.h */; }; - E610394115DD169B00819640 /* CDXPropertyModifierAction.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037E915DD169B00819640 /* CDXPropertyModifierAction.h */; }; - E610394215DD169B00819640 /* aabb.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037EB15DD169B00819640 /* aabb.h */; }; - E610394315DD169B00819640 /* mat4stack.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037ED15DD169B00819640 /* mat4stack.h */; }; - E610394415DD169B00819640 /* matrix.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037EE15DD169B00819640 /* matrix.h */; }; - E610394515DD169B00819640 /* kazmath.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037EF15DD169B00819640 /* kazmath.h */; }; - E610394615DD169B00819640 /* mat3.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037F015DD169B00819640 /* mat3.h */; }; - E610394715DD169B00819640 /* mat4.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037F115DD169B00819640 /* mat4.h */; }; - E610394815DD169B00819640 /* neon_matrix_impl.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037F215DD169B00819640 /* neon_matrix_impl.h */; }; - E610394915DD169B00819640 /* plane.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037F315DD169B00819640 /* plane.h */; }; - E610394A15DD169B00819640 /* quaternion.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037F415DD169B00819640 /* quaternion.h */; }; - E610394B15DD169B00819640 /* ray2.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037F515DD169B00819640 /* ray2.h */; }; - E610394C15DD169B00819640 /* utility.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037F615DD169B00819640 /* utility.h */; }; - E610394D15DD169B00819640 /* vec2.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037F715DD169B00819640 /* vec2.h */; }; - E610394E15DD169B00819640 /* vec3.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037F815DD169B00819640 /* vec3.h */; }; - E610394F15DD169B00819640 /* vec4.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037F915DD169B00819640 /* vec4.h */; }; - E610395015DD169B00819640 /* png.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037FB15DD169B00819640 /* png.h */; }; - E610395115DD169B00819640 /* pngconf.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037FC15DD169B00819640 /* pngconf.h */; }; - E61D8BF515E2771F00F768B0 /* CCRenderTargetNode.h in Headers */ = {isa = PBXBuildFile; fileRef = E61D8BF415E2771F00F768B0 /* CCRenderTargetNode.h */; }; - E61D8BF715E2772C00F768B0 /* CCRenderTargetNode.m in Sources */ = {isa = PBXBuildFile; fileRef = E61D8BF615E2772C00F768B0 /* CCRenderTargetNode.m */; }; - E69291E7161ECB7D00DB1EAA /* b2BroadPhase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E610368015DD169B00819640 /* b2BroadPhase.cpp */; }; - E69291E8161ECB7D00DB1EAA /* b2CollideCircle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E610368115DD169B00819640 /* b2CollideCircle.cpp */; }; - E69291E9161ECB7D00DB1EAA /* b2CollideEdge.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E610368215DD169B00819640 /* b2CollideEdge.cpp */; }; - E69291EA161ECB7D00DB1EAA /* b2CollidePolygon.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E610368315DD169B00819640 /* b2CollidePolygon.cpp */; }; - E69291EB161ECB7E00DB1EAA /* b2Collision.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E610368415DD169B00819640 /* b2Collision.cpp */; }; - E69291EC161ECB7E00DB1EAA /* b2Distance.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E610368515DD169B00819640 /* b2Distance.cpp */; }; - E69291ED161ECB7E00DB1EAA /* b2DynamicTree.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E610368615DD169B00819640 /* b2DynamicTree.cpp */; }; - E69291EE161ECB7E00DB1EAA /* b2TimeOfImpact.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E610368715DD169B00819640 /* b2TimeOfImpact.cpp */; }; - E69291EF161ECB7E00DB1EAA /* b2ChainShape.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E610368915DD169B00819640 /* b2ChainShape.cpp */; }; - E69291F0161ECB7E00DB1EAA /* b2CircleShape.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E610368A15DD169B00819640 /* b2CircleShape.cpp */; }; - E69291F1161ECB7E00DB1EAA /* b2EdgeShape.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E610368B15DD169B00819640 /* b2EdgeShape.cpp */; }; - E69291F2161ECB7E00DB1EAA /* b2PolygonShape.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E610368C15DD169B00819640 /* b2PolygonShape.cpp */; }; - E69291F3161ECB7E00DB1EAA /* b2BlockAllocator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E610368E15DD169B00819640 /* b2BlockAllocator.cpp */; }; - E69291F4161ECB7E00DB1EAA /* b2Draw.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E610368F15DD169B00819640 /* b2Draw.cpp */; }; - E69291F5161ECB7E00DB1EAA /* b2Math.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E610369015DD169B00819640 /* b2Math.cpp */; }; - E69291F6161ECB7E00DB1EAA /* b2Settings.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E610369115DD169B00819640 /* b2Settings.cpp */; }; - E69291F7161ECB7E00DB1EAA /* b2StackAllocator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E610369215DD169B00819640 /* b2StackAllocator.cpp */; }; - E69291F8161ECB7E00DB1EAA /* b2Timer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E610369315DD169B00819640 /* b2Timer.cpp */; }; - E69291F9161ECB7E00DB1EAA /* b2Body.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E610369515DD169B00819640 /* b2Body.cpp */; }; - E69291FA161ECB7E00DB1EAA /* b2ContactManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E610369615DD169B00819640 /* b2ContactManager.cpp */; }; - E69291FB161ECB7E00DB1EAA /* b2Fixture.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E610369715DD169B00819640 /* b2Fixture.cpp */; }; - E69291FC161ECB7E00DB1EAA /* b2Island.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E610369815DD169B00819640 /* b2Island.cpp */; }; - E69291FD161ECB7E00DB1EAA /* b2World.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E610369915DD169B00819640 /* b2World.cpp */; }; - E69291FE161ECB7E00DB1EAA /* b2WorldCallbacks.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E610369A15DD169B00819640 /* b2WorldCallbacks.cpp */; }; - E69291FF161ECB7E00DB1EAA /* b2ChainAndCircleContact.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E610369C15DD169B00819640 /* b2ChainAndCircleContact.cpp */; }; - E6929200161ECB7E00DB1EAA /* b2ChainAndPolygonContact.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E610369D15DD169B00819640 /* b2ChainAndPolygonContact.cpp */; }; - E6929201161ECB7E00DB1EAA /* b2CircleContact.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E610369E15DD169B00819640 /* b2CircleContact.cpp */; }; - E6929202161ECB7E00DB1EAA /* b2Contact.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E610369F15DD169B00819640 /* b2Contact.cpp */; }; - E6929203161ECB7E00DB1EAA /* b2ContactSolver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E61036A015DD169B00819640 /* b2ContactSolver.cpp */; }; - E6929204161ECB7E00DB1EAA /* b2EdgeAndCircleContact.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E61036A115DD169B00819640 /* b2EdgeAndCircleContact.cpp */; }; - E6929205161ECB7E00DB1EAA /* b2EdgeAndPolygonContact.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E61036A215DD169B00819640 /* b2EdgeAndPolygonContact.cpp */; }; - E6929206161ECB7E00DB1EAA /* b2PolygonAndCircleContact.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E61036A315DD169B00819640 /* b2PolygonAndCircleContact.cpp */; }; - E6929207161ECB7E00DB1EAA /* b2PolygonContact.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E61036A415DD169B00819640 /* b2PolygonContact.cpp */; }; - E6929208161ECB7E00DB1EAA /* b2DistanceJoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E61036A615DD169B00819640 /* b2DistanceJoint.cpp */; }; - E6929209161ECB7E00DB1EAA /* b2FrictionJoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E61036A715DD169B00819640 /* b2FrictionJoint.cpp */; }; - E692920A161ECB7E00DB1EAA /* b2GearJoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E61036A815DD169B00819640 /* b2GearJoint.cpp */; }; - E692920B161ECB7E00DB1EAA /* b2Joint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E61036A915DD169B00819640 /* b2Joint.cpp */; }; - E692920C161ECB7E00DB1EAA /* b2MotorJoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E61036AA15DD169B00819640 /* b2MotorJoint.cpp */; }; - E692920D161ECB7E00DB1EAA /* b2MouseJoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E61036AB15DD169B00819640 /* b2MouseJoint.cpp */; }; - E692920E161ECB7E00DB1EAA /* b2PrismaticJoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E61036AC15DD169B00819640 /* b2PrismaticJoint.cpp */; }; - E692920F161ECB7E00DB1EAA /* b2PulleyJoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E61036AD15DD169B00819640 /* b2PulleyJoint.cpp */; }; - E6929210161ECB7E00DB1EAA /* b2RevoluteJoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E61036AE15DD169B00819640 /* b2RevoluteJoint.cpp */; }; - E6929211161ECB7E00DB1EAA /* b2RopeJoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E61036AF15DD169B00819640 /* b2RopeJoint.cpp */; }; - E6929212161ECB7E00DB1EAA /* b2WeldJoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E61036B015DD169B00819640 /* b2WeldJoint.cpp */; }; - E6929213161ECB7E00DB1EAA /* b2WheelJoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E61036B115DD169B00819640 /* b2WheelJoint.cpp */; }; - E6929214161ECB7E00DB1EAA /* b2Rope.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E61036B315DD169B00819640 /* b2Rope.cpp */; }; - E6929215161ECB7E00DB1EAA /* CCRenderTargetNode.m in Sources */ = {isa = PBXBuildFile; fileRef = E61D8BF615E2772C00F768B0 /* CCRenderTargetNode.m */; }; - E6929216161ECB7E00DB1EAA /* CCAction.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036B515DD169B00819640 /* CCAction.m */; }; - E6929217161ECB7E00DB1EAA /* CCActionCamera.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036B615DD169B00819640 /* CCActionCamera.m */; }; - E6929218161ECB7E00DB1EAA /* CCActionCatmullRom.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036B715DD169B00819640 /* CCActionCatmullRom.m */; }; - E6929219161ECB7E00DB1EAA /* CCActionEase.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036B815DD169B00819640 /* CCActionEase.m */; }; - E692921A161ECB7E00DB1EAA /* CCActionGrid.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036B915DD169B00819640 /* CCActionGrid.m */; }; - E692921B161ECB7E00DB1EAA /* CCActionGrid3D.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036BA15DD169B00819640 /* CCActionGrid3D.m */; }; - E692921C161ECB7E00DB1EAA /* CCActionInstant.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036BB15DD169B00819640 /* CCActionInstant.m */; }; - E692921D161ECB7E00DB1EAA /* CCActionInterval.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036BC15DD169B00819640 /* CCActionInterval.m */; }; - E692921E161ECB7E00DB1EAA /* CCActionManager.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036BD15DD169B00819640 /* CCActionManager.m */; }; - E692921F161ECB7E00DB1EAA /* CCActionPageTurn3D.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036BE15DD169B00819640 /* CCActionPageTurn3D.m */; }; - E6929220161ECB7E00DB1EAA /* CCActionProgressTimer.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036BF15DD169B00819640 /* CCActionProgressTimer.m */; }; - E6929221161ECB7E00DB1EAA /* CCActionTiledGrid.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036C015DD169B00819640 /* CCActionTiledGrid.m */; }; - E6929222161ECB7E00DB1EAA /* CCActionTween.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036C115DD169B00819640 /* CCActionTween.m */; }; - E6929223161ECB7E00DB1EAA /* CCAnimation.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036C215DD169B00819640 /* CCAnimation.m */; }; - E6929224161ECB7E00DB1EAA /* CCAnimationCache.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036C315DD169B00819640 /* CCAnimationCache.m */; }; - E6929225161ECB7E00DB1EAA /* CCAtlasNode.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036C415DD169B00819640 /* CCAtlasNode.m */; }; - E6929226161ECB7E00DB1EAA /* CCCamera.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036C515DD169B00819640 /* CCCamera.m */; }; - E6929227161ECB7E00DB1EAA /* CCConfiguration.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036C615DD169B00819640 /* CCConfiguration.m */; }; - E6929228161ECB7E00DB1EAA /* ccDeprecated.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036C715DD169B00819640 /* ccDeprecated.m */; }; - E6929229161ECB7E00DB1EAA /* CCDirector.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036C815DD169B00819640 /* CCDirector.m */; }; - E692922A161ECB7E00DB1EAA /* CCDrawingPrimitives.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036C915DD169B00819640 /* CCDrawingPrimitives.m */; }; - E692922B161ECB7E00DB1EAA /* CCGLProgram.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036CA15DD169B00819640 /* CCGLProgram.m */; }; - E692922C161ECB7E00DB1EAA /* ccGLStateCache.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036CB15DD169B00819640 /* ccGLStateCache.m */; }; - E692922D161ECB7E00DB1EAA /* CCGrabber.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036CC15DD169B00819640 /* CCGrabber.m */; }; - E692922E161ECB7E00DB1EAA /* CCGrid.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036CD15DD169B00819640 /* CCGrid.m */; }; - E692922F161ECB7E00DB1EAA /* CCLabelAtlas.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036CE15DD169B00819640 /* CCLabelAtlas.m */; }; - E6929230161ECB7E00DB1EAA /* CCLabelBMFont.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036CF15DD169B00819640 /* CCLabelBMFont.m */; }; - E6929231161ECB7E00DB1EAA /* CCLabelTTF.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036D015DD169B00819640 /* CCLabelTTF.m */; }; - E6929232161ECB7E00DB1EAA /* CCLayer.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036D115DD169B00819640 /* CCLayer.m */; }; - E6929233161ECB7E00DB1EAA /* CCMenu.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036D215DD169B00819640 /* CCMenu.m */; }; - E6929234161ECB7E00DB1EAA /* CCMenuItem.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036D315DD169B00819640 /* CCMenuItem.m */; }; - E6929235161ECB7E00DB1EAA /* CCMotionStreak.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036D415DD169B00819640 /* CCMotionStreak.m */; }; - E6929236161ECB7E00DB1EAA /* CCNode+Debug.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036D515DD169B00819640 /* CCNode+Debug.m */; }; - E6929237161ECB7E00DB1EAA /* CCNode.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036D615DD169B00819640 /* CCNode.m */; }; - E6929238161ECB7E00DB1EAA /* CCParallaxNode.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036D715DD169B00819640 /* CCParallaxNode.m */; }; - E6929239161ECB7E00DB1EAA /* CCParticleBatchNode.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036D815DD169B00819640 /* CCParticleBatchNode.m */; }; - E692923A161ECB7E00DB1EAA /* CCParticleSystem.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036D915DD169B00819640 /* CCParticleSystem.m */; }; - E692923B161ECB7E00DB1EAA /* CCParticleSystemQuad.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036DA15DD169B00819640 /* CCParticleSystemQuad.m */; }; - E692923C161ECB7E00DB1EAA /* CCProgressTimer.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036DB15DD169B00819640 /* CCProgressTimer.m */; }; - E692923D161ECB7E00DB1EAA /* CCRenderTexture.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036DC15DD169B00819640 /* CCRenderTexture.m */; }; - E692923E161ECB7E00DB1EAA /* CCScene.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036DD15DD169B00819640 /* CCScene.m */; }; - E692923F161ECB7E00DB1EAA /* CCScheduler.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036DE15DD169B00819640 /* CCScheduler.m */; }; - E6929240161ECB7E00DB1EAA /* CCShaderCache.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036DF15DD169B00819640 /* CCShaderCache.m */; }; - E6929241161ECB7E00DB1EAA /* ccShaders.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036E015DD169B00819640 /* ccShaders.m */; }; - E6929242161ECB7E00DB1EAA /* CCSprite.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036E115DD169B00819640 /* CCSprite.m */; }; - E6929243161ECB7E00DB1EAA /* CCSpriteBatchNode.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036E215DD169B00819640 /* CCSpriteBatchNode.m */; }; - E6929244161ECB7E00DB1EAA /* CCSpriteFrame.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036E315DD169B00819640 /* CCSpriteFrame.m */; }; - E6929245161ECB7E00DB1EAA /* CCSpriteFrameCache.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036E415DD169B00819640 /* CCSpriteFrameCache.m */; }; - E6929246161ECB7E00DB1EAA /* CCTexture2D.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036E515DD169B00819640 /* CCTexture2D.m */; }; - E6929247161ECB7E00DB1EAA /* CCTextureAtlas.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036E615DD169B00819640 /* CCTextureAtlas.m */; }; - E6929248161ECB7E00DB1EAA /* CCTextureCache.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036E715DD169B00819640 /* CCTextureCache.m */; }; - E6929249161ECB7E00DB1EAA /* CCTexturePVR.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036E815DD169B00819640 /* CCTexturePVR.m */; }; - E692924A161ECB7E00DB1EAA /* CCTileMapAtlas.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036E915DD169B00819640 /* CCTileMapAtlas.m */; }; - E692924B161ECB7E00DB1EAA /* CCTMXLayer.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036EA15DD169B00819640 /* CCTMXLayer.m */; }; - E692924C161ECB7E00DB1EAA /* CCTMXObjectGroup.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036EB15DD169B00819640 /* CCTMXObjectGroup.m */; }; - E692924D161ECB7E00DB1EAA /* CCTMXTiledMap.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036EC15DD169B00819640 /* CCTMXTiledMap.m */; }; - E692924E161ECB7E00DB1EAA /* CCTMXXMLParser.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036ED15DD169B00819640 /* CCTMXXMLParser.m */; }; - E692924F161ECB7E00DB1EAA /* CCTransition.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036EE15DD169B00819640 /* CCTransition.m */; }; - E6929250161ECB7E00DB1EAA /* CCTransitionPageTurn.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036EF15DD169B00819640 /* CCTransitionPageTurn.m */; }; - E6929251161ECB7E00DB1EAA /* CCTransitionProgress.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036F015DD169B00819640 /* CCTransitionProgress.m */; }; - E6929252161ECB7E00DB1EAA /* cocos2d.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036F115DD169B00819640 /* cocos2d.m */; }; - E6929253161ECB7E00DB1EAA /* CCDirectorIOS.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036F415DD169B00819640 /* CCDirectorIOS.m */; }; - E6929254161ECB7E00DB1EAA /* CCES2Renderer.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036F515DD169B00819640 /* CCES2Renderer.m */; }; - E6929255161ECB7E00DB1EAA /* CCGLView.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036F615DD169B00819640 /* CCGLView.m */; }; - E6929256161ECB7E00DB1EAA /* CCTouchDispatcher.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036F715DD169B00819640 /* CCTouchDispatcher.m */; }; - E6929257161ECB7E00DB1EAA /* CCTouchHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036F815DD169B00819640 /* CCTouchHandler.m */; }; - E6929258161ECB7E00DB1EAA /* CCDirectorMac.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036FA15DD169B00819640 /* CCDirectorMac.m */; }; - E6929259161ECB7E00DB1EAA /* CCEventDispatcher.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036FB15DD169B00819640 /* CCEventDispatcher.m */; }; - E692925A161ECB7E00DB1EAA /* CCGLView.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036FC15DD169B00819640 /* CCGLView.m */; }; - E692925B161ECB7E00DB1EAA /* CCWindow.m in Sources */ = {isa = PBXBuildFile; fileRef = E61036FD15DD169B00819640 /* CCWindow.m */; }; - E692925C161ECB7E00DB1EAA /* base64.c in Sources */ = {isa = PBXBuildFile; fileRef = E61036FF15DD169B00819640 /* base64.c */; }; - E692925D161ECB7E00DB1EAA /* CCArray.m in Sources */ = {isa = PBXBuildFile; fileRef = E610370015DD169B00819640 /* CCArray.m */; }; - E692925E161ECB7E00DB1EAA /* ccCArray.m in Sources */ = {isa = PBXBuildFile; fileRef = E610370115DD169B00819640 /* ccCArray.m */; }; - E692925F161ECB7E00DB1EAA /* CCFileUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = E610370215DD169B00819640 /* CCFileUtils.m */; }; - E6929260161ECB7E00DB1EAA /* CCProfiling.m in Sources */ = {isa = PBXBuildFile; fileRef = E610370315DD169B00819640 /* CCProfiling.m */; }; - E6929261161ECB7E00DB1EAA /* ccUtils.c in Sources */ = {isa = PBXBuildFile; fileRef = E610370415DD169B00819640 /* ccUtils.c */; }; - E6929262161ECB7E00DB1EAA /* CCVertex.m in Sources */ = {isa = PBXBuildFile; fileRef = E610370515DD169B00819640 /* CCVertex.m */; }; - E6929263161ECB7E00DB1EAA /* CGPointExtension.m in Sources */ = {isa = PBXBuildFile; fileRef = E610370615DD169B00819640 /* CGPointExtension.m */; }; - E6929264161ECB7E00DB1EAA /* NSThread+performBlock.m in Sources */ = {isa = PBXBuildFile; fileRef = E610370715DD169B00819640 /* NSThread+performBlock.m */; }; - E6929265161ECB7E00DB1EAA /* TGAlib.m in Sources */ = {isa = PBXBuildFile; fileRef = E610370815DD169B00819640 /* TGAlib.m */; }; - E6929266161ECB7E00DB1EAA /* TransformUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = E610370915DD169B00819640 /* TransformUtils.m */; }; - E6929267161ECB7E00DB1EAA /* ZipUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = E610370A15DD169B00819640 /* ZipUtils.m */; }; - E6929268161ECB7E00DB1EAA /* CDAudioManager.m in Sources */ = {isa = PBXBuildFile; fileRef = E610370C15DD169B00819640 /* CDAudioManager.m */; }; - E6929269161ECB7E00DB1EAA /* CDOpenALSupport.m in Sources */ = {isa = PBXBuildFile; fileRef = E610370D15DD169B00819640 /* CDOpenALSupport.m */; }; - E692926A161ECB7E00DB1EAA /* CocosDenshion.m in Sources */ = {isa = PBXBuildFile; fileRef = E610370E15DD169B00819640 /* CocosDenshion.m */; }; - E692926B161ECB7E00DB1EAA /* SimpleAudioEngine.m in Sources */ = {isa = PBXBuildFile; fileRef = E610370F15DD169B00819640 /* SimpleAudioEngine.m */; }; - E692926C161ECB7E00DB1EAA /* CDXMacOSXSupport.m in Sources */ = {isa = PBXBuildFile; fileRef = E610371115DD169B00819640 /* CDXMacOSXSupport.m */; }; - E692926D161ECB7E00DB1EAA /* CDXPropertyModifierAction.m in Sources */ = {isa = PBXBuildFile; fileRef = E610371215DD169B00819640 /* CDXPropertyModifierAction.m */; }; - E692926E161ECB7E00DB1EAA /* aabb.c in Sources */ = {isa = PBXBuildFile; fileRef = E610371415DD169B00819640 /* aabb.c */; }; - E6929270161ECB7E00DB1EAA /* mat4stack.c in Sources */ = {isa = PBXBuildFile; fileRef = E610371715DD169B00819640 /* mat4stack.c */; }; - E6929271161ECB7E00DB1EAA /* matrix.c in Sources */ = {isa = PBXBuildFile; fileRef = E610371815DD169B00819640 /* matrix.c */; }; - E6929272161ECB7E00DB1EAA /* mat3.c in Sources */ = {isa = PBXBuildFile; fileRef = E610371915DD169B00819640 /* mat3.c */; }; - E6929273161ECB7E00DB1EAA /* mat4.c in Sources */ = {isa = PBXBuildFile; fileRef = E610371A15DD169B00819640 /* mat4.c */; }; - E6929274161ECB7E00DB1EAA /* neon_matrix_impl.c in Sources */ = {isa = PBXBuildFile; fileRef = E610371B15DD169B00819640 /* neon_matrix_impl.c */; }; - E6929275161ECB7E00DB1EAA /* plane.c in Sources */ = {isa = PBXBuildFile; fileRef = E610371C15DD169B00819640 /* plane.c */; }; - E6929276161ECB7E00DB1EAA /* quaternion.c in Sources */ = {isa = PBXBuildFile; fileRef = E610371D15DD169B00819640 /* quaternion.c */; }; - E6929277161ECB7E00DB1EAA /* ray2.c in Sources */ = {isa = PBXBuildFile; fileRef = E610371E15DD169B00819640 /* ray2.c */; }; - E6929278161ECB7E00DB1EAA /* utility.c in Sources */ = {isa = PBXBuildFile; fileRef = E610371F15DD169B00819640 /* utility.c */; }; - E6929279161ECB7E00DB1EAA /* vec2.c in Sources */ = {isa = PBXBuildFile; fileRef = E610372015DD169B00819640 /* vec2.c */; }; - E692927A161ECB7E00DB1EAA /* vec3.c in Sources */ = {isa = PBXBuildFile; fileRef = E610372115DD169B00819640 /* vec3.c */; }; - E692927B161ECB7E00DB1EAA /* vec4.c in Sources */ = {isa = PBXBuildFile; fileRef = E610372215DD169B00819640 /* vec4.c */; }; - E692927C161ECB7E00DB1EAA /* png.c in Sources */ = {isa = PBXBuildFile; fileRef = E610372415DD169B00819640 /* png.c */; }; - E692927D161ECB7E00DB1EAA /* pngerror.c in Sources */ = {isa = PBXBuildFile; fileRef = E610372515DD169B00819640 /* pngerror.c */; }; - E692927E161ECB7E00DB1EAA /* pnggccrd.c in Sources */ = {isa = PBXBuildFile; fileRef = E610372615DD169B00819640 /* pnggccrd.c */; }; - E692927F161ECB7E00DB1EAA /* pngget.c in Sources */ = {isa = PBXBuildFile; fileRef = E610372715DD169B00819640 /* pngget.c */; }; - E6929280161ECB7E00DB1EAA /* pngmem.c in Sources */ = {isa = PBXBuildFile; fileRef = E610372815DD169B00819640 /* pngmem.c */; }; - E6929282161ECB7E00DB1EAA /* pngpread.c in Sources */ = {isa = PBXBuildFile; fileRef = E610372A15DD169B00819640 /* pngpread.c */; }; - E6929283161ECB7E00DB1EAA /* pngread.c in Sources */ = {isa = PBXBuildFile; fileRef = E610372B15DD169B00819640 /* pngread.c */; }; - E6929284161ECB7E00DB1EAA /* pngrio.c in Sources */ = {isa = PBXBuildFile; fileRef = E610372C15DD169B00819640 /* pngrio.c */; }; - E6929285161ECB7E00DB1EAA /* pngrtran.c in Sources */ = {isa = PBXBuildFile; fileRef = E610372D15DD169B00819640 /* pngrtran.c */; }; - E6929286161ECB7E00DB1EAA /* pngrutil.c in Sources */ = {isa = PBXBuildFile; fileRef = E610372E15DD169B00819640 /* pngrutil.c */; }; - E6929287161ECB7E00DB1EAA /* pngset.c in Sources */ = {isa = PBXBuildFile; fileRef = E610372F15DD169B00819640 /* pngset.c */; }; - E6929288161ECB7E00DB1EAA /* pngtrans.c in Sources */ = {isa = PBXBuildFile; fileRef = E610373015DD169B00819640 /* pngtrans.c */; }; - E6929289161ECB7E00DB1EAA /* pngvcrd.c in Sources */ = {isa = PBXBuildFile; fileRef = E610373115DD169B00819640 /* pngvcrd.c */; }; - E692928A161ECB7E00DB1EAA /* pngwio.c in Sources */ = {isa = PBXBuildFile; fileRef = E610373215DD169B00819640 /* pngwio.c */; }; - E692928B161ECB7E00DB1EAA /* pngwrite.c in Sources */ = {isa = PBXBuildFile; fileRef = E610373315DD169B00819640 /* pngwrite.c */; }; - E692928C161ECB7E00DB1EAA /* pngwtran.c in Sources */ = {isa = PBXBuildFile; fileRef = E610373415DD169B00819640 /* pngwtran.c */; }; - E692928D161ECB7E00DB1EAA /* pngwutil.c in Sources */ = {isa = PBXBuildFile; fileRef = E610373515DD169B00819640 /* pngwutil.c */; }; - E692928E161ECBAC00DB1EAA /* Box2D.h in Headers */ = {isa = PBXBuildFile; fileRef = E610373B15DD169B00819640 /* Box2D.h */; }; - E692928F161ECBAC00DB1EAA /* b2BroadPhase.h in Headers */ = {isa = PBXBuildFile; fileRef = E610373D15DD169B00819640 /* b2BroadPhase.h */; }; - E6929290161ECBAC00DB1EAA /* b2Collision.h in Headers */ = {isa = PBXBuildFile; fileRef = E610373E15DD169B00819640 /* b2Collision.h */; }; - E6929291161ECBAC00DB1EAA /* b2Distance.h in Headers */ = {isa = PBXBuildFile; fileRef = E610373F15DD169B00819640 /* b2Distance.h */; }; - E6929292161ECBAC00DB1EAA /* b2DynamicTree.h in Headers */ = {isa = PBXBuildFile; fileRef = E610374015DD169B00819640 /* b2DynamicTree.h */; }; - E6929293161ECBAC00DB1EAA /* b2TimeOfImpact.h in Headers */ = {isa = PBXBuildFile; fileRef = E610374115DD169B00819640 /* b2TimeOfImpact.h */; }; - E6929294161ECBAC00DB1EAA /* b2ChainShape.h in Headers */ = {isa = PBXBuildFile; fileRef = E610374315DD169B00819640 /* b2ChainShape.h */; }; - E6929295161ECBAC00DB1EAA /* b2CircleShape.h in Headers */ = {isa = PBXBuildFile; fileRef = E610374415DD169B00819640 /* b2CircleShape.h */; }; - E6929296161ECBAC00DB1EAA /* b2EdgeShape.h in Headers */ = {isa = PBXBuildFile; fileRef = E610374515DD169B00819640 /* b2EdgeShape.h */; }; - E6929297161ECBAC00DB1EAA /* b2PolygonShape.h in Headers */ = {isa = PBXBuildFile; fileRef = E610374615DD169B00819640 /* b2PolygonShape.h */; }; - E6929298161ECBAC00DB1EAA /* b2Shape.h in Headers */ = {isa = PBXBuildFile; fileRef = E610374715DD169B00819640 /* b2Shape.h */; }; - E6929299161ECBAC00DB1EAA /* b2BlockAllocator.h in Headers */ = {isa = PBXBuildFile; fileRef = E610374915DD169B00819640 /* b2BlockAllocator.h */; }; - E692929A161ECBAC00DB1EAA /* b2Draw.h in Headers */ = {isa = PBXBuildFile; fileRef = E610374A15DD169B00819640 /* b2Draw.h */; }; - E692929B161ECBAC00DB1EAA /* b2GrowableStack.h in Headers */ = {isa = PBXBuildFile; fileRef = E610374B15DD169B00819640 /* b2GrowableStack.h */; }; - E692929C161ECBAC00DB1EAA /* b2Math.h in Headers */ = {isa = PBXBuildFile; fileRef = E610374C15DD169B00819640 /* b2Math.h */; }; - E692929D161ECBAC00DB1EAA /* b2Settings.h in Headers */ = {isa = PBXBuildFile; fileRef = E610374D15DD169B00819640 /* b2Settings.h */; }; - E692929E161ECBAC00DB1EAA /* b2StackAllocator.h in Headers */ = {isa = PBXBuildFile; fileRef = E610374E15DD169B00819640 /* b2StackAllocator.h */; }; - E692929F161ECBAC00DB1EAA /* b2Timer.h in Headers */ = {isa = PBXBuildFile; fileRef = E610374F15DD169B00819640 /* b2Timer.h */; }; - E69292A0161ECBAC00DB1EAA /* b2Body.h in Headers */ = {isa = PBXBuildFile; fileRef = E610375115DD169B00819640 /* b2Body.h */; }; - E69292A1161ECBAC00DB1EAA /* b2ContactManager.h in Headers */ = {isa = PBXBuildFile; fileRef = E610375215DD169B00819640 /* b2ContactManager.h */; }; - E69292A2161ECBAC00DB1EAA /* b2Fixture.h in Headers */ = {isa = PBXBuildFile; fileRef = E610375315DD169B00819640 /* b2Fixture.h */; }; - E69292A3161ECBAC00DB1EAA /* b2Island.h in Headers */ = {isa = PBXBuildFile; fileRef = E610375415DD169B00819640 /* b2Island.h */; }; - E69292A4161ECBAC00DB1EAA /* b2TimeStep.h in Headers */ = {isa = PBXBuildFile; fileRef = E610375515DD169B00819640 /* b2TimeStep.h */; }; - E69292A5161ECBAC00DB1EAA /* b2World.h in Headers */ = {isa = PBXBuildFile; fileRef = E610375615DD169B00819640 /* b2World.h */; }; - E69292A6161ECBAC00DB1EAA /* b2WorldCallbacks.h in Headers */ = {isa = PBXBuildFile; fileRef = E610375715DD169B00819640 /* b2WorldCallbacks.h */; }; - E69292A7161ECBAC00DB1EAA /* b2ChainAndCircleContact.h in Headers */ = {isa = PBXBuildFile; fileRef = E610375915DD169B00819640 /* b2ChainAndCircleContact.h */; }; - E69292A8161ECBAC00DB1EAA /* b2ChainAndPolygonContact.h in Headers */ = {isa = PBXBuildFile; fileRef = E610375A15DD169B00819640 /* b2ChainAndPolygonContact.h */; }; - E69292A9161ECBAC00DB1EAA /* b2CircleContact.h in Headers */ = {isa = PBXBuildFile; fileRef = E610375B15DD169B00819640 /* b2CircleContact.h */; }; - E69292AA161ECBAC00DB1EAA /* b2Contact.h in Headers */ = {isa = PBXBuildFile; fileRef = E610375C15DD169B00819640 /* b2Contact.h */; }; - E69292AB161ECBAC00DB1EAA /* b2ContactSolver.h in Headers */ = {isa = PBXBuildFile; fileRef = E610375D15DD169B00819640 /* b2ContactSolver.h */; }; - E69292AC161ECBAC00DB1EAA /* b2EdgeAndCircleContact.h in Headers */ = {isa = PBXBuildFile; fileRef = E610375E15DD169B00819640 /* b2EdgeAndCircleContact.h */; }; - E69292AD161ECBAC00DB1EAA /* b2EdgeAndPolygonContact.h in Headers */ = {isa = PBXBuildFile; fileRef = E610375F15DD169B00819640 /* b2EdgeAndPolygonContact.h */; }; - E69292AE161ECBAC00DB1EAA /* b2PolygonAndCircleContact.h in Headers */ = {isa = PBXBuildFile; fileRef = E610376015DD169B00819640 /* b2PolygonAndCircleContact.h */; }; - E69292AF161ECBAC00DB1EAA /* b2PolygonContact.h in Headers */ = {isa = PBXBuildFile; fileRef = E610376115DD169B00819640 /* b2PolygonContact.h */; }; - E69292B0161ECBAC00DB1EAA /* b2DistanceJoint.h in Headers */ = {isa = PBXBuildFile; fileRef = E610376315DD169B00819640 /* b2DistanceJoint.h */; }; - E69292B1161ECBAC00DB1EAA /* b2FrictionJoint.h in Headers */ = {isa = PBXBuildFile; fileRef = E610376415DD169B00819640 /* b2FrictionJoint.h */; }; - E69292B2161ECBAC00DB1EAA /* b2GearJoint.h in Headers */ = {isa = PBXBuildFile; fileRef = E610376515DD169B00819640 /* b2GearJoint.h */; }; - E69292B3161ECBAC00DB1EAA /* b2Joint.h in Headers */ = {isa = PBXBuildFile; fileRef = E610376615DD169B00819640 /* b2Joint.h */; }; - E69292B4161ECBAC00DB1EAA /* b2MotorJoint.h in Headers */ = {isa = PBXBuildFile; fileRef = E610376715DD169B00819640 /* b2MotorJoint.h */; }; - E69292B5161ECBAC00DB1EAA /* b2MouseJoint.h in Headers */ = {isa = PBXBuildFile; fileRef = E610376815DD169B00819640 /* b2MouseJoint.h */; }; - E69292B6161ECBAC00DB1EAA /* b2PrismaticJoint.h in Headers */ = {isa = PBXBuildFile; fileRef = E610376915DD169B00819640 /* b2PrismaticJoint.h */; }; - E69292B7161ECBAC00DB1EAA /* b2PulleyJoint.h in Headers */ = {isa = PBXBuildFile; fileRef = E610376A15DD169B00819640 /* b2PulleyJoint.h */; }; - E69292B8161ECBAC00DB1EAA /* b2RevoluteJoint.h in Headers */ = {isa = PBXBuildFile; fileRef = E610376B15DD169B00819640 /* b2RevoluteJoint.h */; }; - E69292B9161ECBAC00DB1EAA /* b2RopeJoint.h in Headers */ = {isa = PBXBuildFile; fileRef = E610376C15DD169B00819640 /* b2RopeJoint.h */; }; - E69292BA161ECBAC00DB1EAA /* b2WeldJoint.h in Headers */ = {isa = PBXBuildFile; fileRef = E610376D15DD169B00819640 /* b2WeldJoint.h */; }; - E69292BB161ECBAC00DB1EAA /* b2WheelJoint.h in Headers */ = {isa = PBXBuildFile; fileRef = E610376E15DD169B00819640 /* b2WheelJoint.h */; }; - E69292BC161ECBAC00DB1EAA /* b2Rope.h in Headers */ = {isa = PBXBuildFile; fileRef = E610377015DD169B00819640 /* b2Rope.h */; }; - E69292BD161ECBAC00DB1EAA /* CCRenderTargetNode.h in Headers */ = {isa = PBXBuildFile; fileRef = E61D8BF415E2771F00F768B0 /* CCRenderTargetNode.h */; }; - E69292BE161ECBAC00DB1EAA /* CCAction.h in Headers */ = {isa = PBXBuildFile; fileRef = E610377215DD169B00819640 /* CCAction.h */; }; - E69292BF161ECBAC00DB1EAA /* CCActionCamera.h in Headers */ = {isa = PBXBuildFile; fileRef = E610377315DD169B00819640 /* CCActionCamera.h */; }; - E69292C0161ECBAC00DB1EAA /* CCActionCatmullRom.h in Headers */ = {isa = PBXBuildFile; fileRef = E610377415DD169B00819640 /* CCActionCatmullRom.h */; }; - E69292C1161ECBAC00DB1EAA /* CCActionEase.h in Headers */ = {isa = PBXBuildFile; fileRef = E610377515DD169B00819640 /* CCActionEase.h */; }; - E69292C2161ECBAC00DB1EAA /* CCActionGrid.h in Headers */ = {isa = PBXBuildFile; fileRef = E610377615DD169B00819640 /* CCActionGrid.h */; }; - E69292C3161ECBAC00DB1EAA /* CCActionGrid3D.h in Headers */ = {isa = PBXBuildFile; fileRef = E610377715DD169B00819640 /* CCActionGrid3D.h */; }; - E69292C4161ECBAC00DB1EAA /* CCActionInstant.h in Headers */ = {isa = PBXBuildFile; fileRef = E610377815DD169B00819640 /* CCActionInstant.h */; }; - E69292C5161ECBAC00DB1EAA /* CCActionInterval.h in Headers */ = {isa = PBXBuildFile; fileRef = E610377915DD169B00819640 /* CCActionInterval.h */; }; - E69292C6161ECBAC00DB1EAA /* CCActionManager.h in Headers */ = {isa = PBXBuildFile; fileRef = E610377A15DD169B00819640 /* CCActionManager.h */; }; - E69292C7161ECBAC00DB1EAA /* CCActionPageTurn3D.h in Headers */ = {isa = PBXBuildFile; fileRef = E610377B15DD169B00819640 /* CCActionPageTurn3D.h */; }; - E69292C8161ECBAC00DB1EAA /* CCActionProgressTimer.h in Headers */ = {isa = PBXBuildFile; fileRef = E610377C15DD169B00819640 /* CCActionProgressTimer.h */; }; - E69292C9161ECBAC00DB1EAA /* CCActionTiledGrid.h in Headers */ = {isa = PBXBuildFile; fileRef = E610377D15DD169B00819640 /* CCActionTiledGrid.h */; }; - E69292CA161ECBAC00DB1EAA /* CCActionTween.h in Headers */ = {isa = PBXBuildFile; fileRef = E610377E15DD169B00819640 /* CCActionTween.h */; }; - E69292CB161ECBAC00DB1EAA /* CCAnimation.h in Headers */ = {isa = PBXBuildFile; fileRef = E610377F15DD169B00819640 /* CCAnimation.h */; }; - E69292CC161ECBAC00DB1EAA /* CCAnimationCache.h in Headers */ = {isa = PBXBuildFile; fileRef = E610378015DD169B00819640 /* CCAnimationCache.h */; }; - E69292CD161ECBAC00DB1EAA /* CCAtlasNode.h in Headers */ = {isa = PBXBuildFile; fileRef = E610378115DD169B00819640 /* CCAtlasNode.h */; }; - E69292CE161ECBAD00DB1EAA /* CCCamera.h in Headers */ = {isa = PBXBuildFile; fileRef = E610378215DD169B00819640 /* CCCamera.h */; }; - E69292CF161ECBAD00DB1EAA /* ccConfig.h in Headers */ = {isa = PBXBuildFile; fileRef = E610378315DD169B00819640 /* ccConfig.h */; }; - E69292D0161ECBAD00DB1EAA /* CCConfiguration.h in Headers */ = {isa = PBXBuildFile; fileRef = E610378415DD169B00819640 /* CCConfiguration.h */; }; - E69292D1161ECBAD00DB1EAA /* ccDeprecated.h in Headers */ = {isa = PBXBuildFile; fileRef = E610378515DD169B00819640 /* ccDeprecated.h */; }; - E69292D2161ECBAD00DB1EAA /* CCDirector.h in Headers */ = {isa = PBXBuildFile; fileRef = E610378615DD169B00819640 /* CCDirector.h */; }; - E69292D3161ECBAD00DB1EAA /* CCDrawingPrimitives.h in Headers */ = {isa = PBXBuildFile; fileRef = E610378715DD169B00819640 /* CCDrawingPrimitives.h */; }; - E69292D4161ECBAD00DB1EAA /* CCGLProgram.h in Headers */ = {isa = PBXBuildFile; fileRef = E610378815DD169B00819640 /* CCGLProgram.h */; }; - E69292D5161ECBAD00DB1EAA /* ccGLStateCache.h in Headers */ = {isa = PBXBuildFile; fileRef = E610378915DD169B00819640 /* ccGLStateCache.h */; }; - E69292D6161ECBAD00DB1EAA /* CCGrabber.h in Headers */ = {isa = PBXBuildFile; fileRef = E610378A15DD169B00819640 /* CCGrabber.h */; }; - E69292D7161ECBAD00DB1EAA /* CCGrid.h in Headers */ = {isa = PBXBuildFile; fileRef = E610378B15DD169B00819640 /* CCGrid.h */; }; - E69292D8161ECBAD00DB1EAA /* CCLabelAtlas.h in Headers */ = {isa = PBXBuildFile; fileRef = E610378C15DD169B00819640 /* CCLabelAtlas.h */; }; - E69292D9161ECBAD00DB1EAA /* CCLabelBMFont.h in Headers */ = {isa = PBXBuildFile; fileRef = E610378D15DD169B00819640 /* CCLabelBMFont.h */; }; - E69292DA161ECBAD00DB1EAA /* CCLabelTTF.h in Headers */ = {isa = PBXBuildFile; fileRef = E610378E15DD169B00819640 /* CCLabelTTF.h */; }; - E69292DB161ECBAD00DB1EAA /* CCLayer.h in Headers */ = {isa = PBXBuildFile; fileRef = E610378F15DD169B00819640 /* CCLayer.h */; }; - E69292DC161ECBAD00DB1EAA /* ccMacros.h in Headers */ = {isa = PBXBuildFile; fileRef = E610379015DD169B00819640 /* ccMacros.h */; }; - E69292DD161ECBAD00DB1EAA /* CCMenu.h in Headers */ = {isa = PBXBuildFile; fileRef = E610379115DD169B00819640 /* CCMenu.h */; }; - E69292DE161ECBAD00DB1EAA /* CCMenuItem.h in Headers */ = {isa = PBXBuildFile; fileRef = E610379215DD169B00819640 /* CCMenuItem.h */; }; - E69292DF161ECBAD00DB1EAA /* CCMotionStreak.h in Headers */ = {isa = PBXBuildFile; fileRef = E610379315DD169B00819640 /* CCMotionStreak.h */; }; - E69292E0161ECBAD00DB1EAA /* CCNode+Debug.h in Headers */ = {isa = PBXBuildFile; fileRef = E610379415DD169B00819640 /* CCNode+Debug.h */; }; - E69292E1161ECBAD00DB1EAA /* CCNode.h in Headers */ = {isa = PBXBuildFile; fileRef = E610379515DD169B00819640 /* CCNode.h */; }; - E69292E2161ECBAD00DB1EAA /* CCParallaxNode.h in Headers */ = {isa = PBXBuildFile; fileRef = E610379615DD169B00819640 /* CCParallaxNode.h */; }; - E69292E3161ECBAD00DB1EAA /* CCParticleBatchNode.h in Headers */ = {isa = PBXBuildFile; fileRef = E610379715DD169B00819640 /* CCParticleBatchNode.h */; }; - E69292E4161ECBAD00DB1EAA /* CCParticleSystem.h in Headers */ = {isa = PBXBuildFile; fileRef = E610379815DD169B00819640 /* CCParticleSystem.h */; }; - E69292E5161ECBAD00DB1EAA /* CCParticleSystemQuad.h in Headers */ = {isa = PBXBuildFile; fileRef = E610379915DD169B00819640 /* CCParticleSystemQuad.h */; }; - E69292E6161ECBAD00DB1EAA /* CCProgressTimer.h in Headers */ = {isa = PBXBuildFile; fileRef = E610379A15DD169B00819640 /* CCProgressTimer.h */; }; - E69292E7161ECBAD00DB1EAA /* CCProtocols.h in Headers */ = {isa = PBXBuildFile; fileRef = E610379B15DD169B00819640 /* CCProtocols.h */; }; - E69292E8161ECBAD00DB1EAA /* CCRenderTexture.h in Headers */ = {isa = PBXBuildFile; fileRef = E610379C15DD169B00819640 /* CCRenderTexture.h */; }; - E69292E9161ECBAD00DB1EAA /* CCScene.h in Headers */ = {isa = PBXBuildFile; fileRef = E610379D15DD169B00819640 /* CCScene.h */; }; - E69292EA161ECBAD00DB1EAA /* CCScheduler.h in Headers */ = {isa = PBXBuildFile; fileRef = E610379E15DD169B00819640 /* CCScheduler.h */; }; - E69292EB161ECBAD00DB1EAA /* ccShader_Position_uColor_frag.h in Headers */ = {isa = PBXBuildFile; fileRef = E610379F15DD169B00819640 /* ccShader_Position_uColor_frag.h */; }; - E69292EC161ECBAD00DB1EAA /* ccShader_Position_uColor_vert.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037A015DD169B00819640 /* ccShader_Position_uColor_vert.h */; }; - E69292ED161ECBAD00DB1EAA /* ccShader_PositionColor_frag.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037A115DD169B00819640 /* ccShader_PositionColor_frag.h */; }; - E69292EE161ECBAD00DB1EAA /* ccShader_PositionColor_vert.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037A215DD169B00819640 /* ccShader_PositionColor_vert.h */; }; - E69292EF161ECBAD00DB1EAA /* ccShader_PositionTexture_frag.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037A315DD169B00819640 /* ccShader_PositionTexture_frag.h */; }; - E69292F0161ECBAD00DB1EAA /* ccShader_PositionTexture_uColor_frag.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037A415DD169B00819640 /* ccShader_PositionTexture_uColor_frag.h */; }; - E69292F1161ECBAD00DB1EAA /* ccShader_PositionTexture_uColor_vert.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037A515DD169B00819640 /* ccShader_PositionTexture_uColor_vert.h */; }; - E69292F2161ECBAD00DB1EAA /* ccShader_PositionTexture_vert.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037A615DD169B00819640 /* ccShader_PositionTexture_vert.h */; }; - E69292F3161ECBAD00DB1EAA /* ccShader_PositionTextureA8Color_frag.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037A715DD169B00819640 /* ccShader_PositionTextureA8Color_frag.h */; }; - E69292F4161ECBAD00DB1EAA /* ccShader_PositionTextureA8Color_vert.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037A815DD169B00819640 /* ccShader_PositionTextureA8Color_vert.h */; }; - E69292F5161ECBAD00DB1EAA /* ccShader_PositionTextureColor_frag.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037A915DD169B00819640 /* ccShader_PositionTextureColor_frag.h */; }; - E69292F6161ECBAD00DB1EAA /* ccShader_PositionTextureColor_vert.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037AA15DD169B00819640 /* ccShader_PositionTextureColor_vert.h */; }; - E69292F7161ECBAD00DB1EAA /* ccShader_PositionTextureColorAlphaTest_frag.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037AB15DD169B00819640 /* ccShader_PositionTextureColorAlphaTest_frag.h */; }; - E69292F8161ECBAD00DB1EAA /* CCShaderCache.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037AC15DD169B00819640 /* CCShaderCache.h */; }; - E69292F9161ECBAD00DB1EAA /* ccShaders.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037AD15DD169B00819640 /* ccShaders.h */; }; - E69292FA161ECBAD00DB1EAA /* CCSprite.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037AE15DD169B00819640 /* CCSprite.h */; }; - E69292FB161ECBAD00DB1EAA /* CCSpriteBatchNode.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037AF15DD169B00819640 /* CCSpriteBatchNode.h */; }; - E69292FC161ECBAD00DB1EAA /* CCSpriteFrame.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037B015DD169B00819640 /* CCSpriteFrame.h */; }; - E69292FD161ECBAD00DB1EAA /* CCSpriteFrameCache.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037B115DD169B00819640 /* CCSpriteFrameCache.h */; }; - E69292FE161ECBAD00DB1EAA /* CCTexture2D.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037B215DD169B00819640 /* CCTexture2D.h */; }; - E69292FF161ECBAD00DB1EAA /* CCTextureAtlas.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037B315DD169B00819640 /* CCTextureAtlas.h */; }; - E6929300161ECBAD00DB1EAA /* CCTextureCache.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037B415DD169B00819640 /* CCTextureCache.h */; }; - E6929301161ECBAD00DB1EAA /* CCTexturePVR.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037B515DD169B00819640 /* CCTexturePVR.h */; }; - E6929302161ECBAD00DB1EAA /* CCTileMapAtlas.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037B615DD169B00819640 /* CCTileMapAtlas.h */; }; - E6929303161ECBAD00DB1EAA /* CCTMXLayer.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037B715DD169B00819640 /* CCTMXLayer.h */; }; - E6929304161ECBAD00DB1EAA /* CCTMXObjectGroup.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037B815DD169B00819640 /* CCTMXObjectGroup.h */; }; - E6929305161ECBAD00DB1EAA /* CCTMXTiledMap.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037B915DD169B00819640 /* CCTMXTiledMap.h */; }; - E6929306161ECBAD00DB1EAA /* CCTMXXMLParser.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037BA15DD169B00819640 /* CCTMXXMLParser.h */; }; - E6929307161ECBAD00DB1EAA /* CCTransition.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037BB15DD169B00819640 /* CCTransition.h */; }; - E6929308161ECBAD00DB1EAA /* CCTransitionOrientationType.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037BC15DD169B00819640 /* CCTransitionOrientationType.h */; }; - E6929309161ECBAD00DB1EAA /* CCTransitionPageTurn.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037BD15DD169B00819640 /* CCTransitionPageTurn.h */; }; - E692930A161ECBAD00DB1EAA /* CCTransitionProgress.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037BE15DD169B00819640 /* CCTransitionProgress.h */; }; - E692930B161ECBAD00DB1EAA /* ccTypes.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037BF15DD169B00819640 /* ccTypes.h */; }; - E692930C161ECBAD00DB1EAA /* cocos2d.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037C015DD169B00819640 /* cocos2d.h */; }; - E692930D161ECBAD00DB1EAA /* CCGL.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037C215DD169B00819640 /* CCGL.h */; }; - E692930E161ECBAD00DB1EAA /* CCNS.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037C315DD169B00819640 /* CCNS.h */; }; - E692930F161ECBAD00DB1EAA /* CCDirectorIOS.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037C515DD169B00819640 /* CCDirectorIOS.h */; }; - E6929310161ECBAD00DB1EAA /* CCES2Renderer.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037C615DD169B00819640 /* CCES2Renderer.h */; }; - E6929311161ECBAD00DB1EAA /* CCESRenderer.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037C715DD169B00819640 /* CCESRenderer.h */; }; - E6929312161ECBAD00DB1EAA /* CCGLView.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037C815DD169B00819640 /* CCGLView.h */; }; - E6929313161ECBAD00DB1EAA /* CCTouchDelegateProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037C915DD169B00819640 /* CCTouchDelegateProtocol.h */; }; - E6929314161ECBAD00DB1EAA /* CCTouchDispatcher.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037CA15DD169B00819640 /* CCTouchDispatcher.h */; }; - E6929315161ECBAD00DB1EAA /* CCTouchHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037CB15DD169B00819640 /* CCTouchHandler.h */; }; - E6929316161ECBAD00DB1EAA /* CCDirectorMac.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037CD15DD169B00819640 /* CCDirectorMac.h */; }; - E6929317161ECBAD00DB1EAA /* CCEventDispatcher.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037CE15DD169B00819640 /* CCEventDispatcher.h */; }; - E6929318161ECBAD00DB1EAA /* CCGLView.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037CF15DD169B00819640 /* CCGLView.h */; }; - E6929319161ECBAD00DB1EAA /* CCWindow.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037D015DD169B00819640 /* CCWindow.h */; }; - E692931A161ECBAD00DB1EAA /* base64.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037D215DD169B00819640 /* base64.h */; }; - E692931B161ECBAD00DB1EAA /* CCArray.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037D315DD169B00819640 /* CCArray.h */; }; - E692931C161ECBAD00DB1EAA /* ccCArray.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037D415DD169B00819640 /* ccCArray.h */; }; - E692931D161ECBAD00DB1EAA /* CCFileUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037D515DD169B00819640 /* CCFileUtils.h */; }; - E692931E161ECBAD00DB1EAA /* CCProfiling.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037D615DD169B00819640 /* CCProfiling.h */; }; - E692931F161ECBAD00DB1EAA /* ccUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037D715DD169B00819640 /* ccUtils.h */; }; - E6929320161ECBAD00DB1EAA /* CCVertex.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037D815DD169B00819640 /* CCVertex.h */; }; - E6929321161ECBAD00DB1EAA /* CGPointExtension.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037D915DD169B00819640 /* CGPointExtension.h */; }; - E6929322161ECBAD00DB1EAA /* NSThread+performBlock.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037DA15DD169B00819640 /* NSThread+performBlock.h */; }; - E6929323161ECBAD00DB1EAA /* OpenGL_Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037DB15DD169B00819640 /* OpenGL_Internal.h */; }; - E6929324161ECBAD00DB1EAA /* TGAlib.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037DC15DD169B00819640 /* TGAlib.h */; }; - E6929325161ECBAD00DB1EAA /* TransformUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037DD15DD169B00819640 /* TransformUtils.h */; }; - E6929326161ECBAD00DB1EAA /* uthash.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037DE15DD169B00819640 /* uthash.h */; }; - E6929327161ECBAD00DB1EAA /* utlist.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037DF15DD169B00819640 /* utlist.h */; }; - E6929328161ECBAD00DB1EAA /* ZipUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037E015DD169B00819640 /* ZipUtils.h */; }; - E6929329161ECBAD00DB1EAA /* CDAudioManager.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037E215DD169B00819640 /* CDAudioManager.h */; }; - E692932A161ECBAD00DB1EAA /* CDConfig.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037E315DD169B00819640 /* CDConfig.h */; }; - E692932B161ECBAD00DB1EAA /* CDOpenALSupport.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037E415DD169B00819640 /* CDOpenALSupport.h */; }; - E692932C161ECBAD00DB1EAA /* CocosDenshion.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037E515DD169B00819640 /* CocosDenshion.h */; }; - E692932D161ECBAD00DB1EAA /* SimpleAudioEngine.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037E615DD169B00819640 /* SimpleAudioEngine.h */; }; - E692932E161ECBAD00DB1EAA /* CDXMacOSXSupport.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037E815DD169B00819640 /* CDXMacOSXSupport.h */; }; - E692932F161ECBAD00DB1EAA /* CDXPropertyModifierAction.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037E915DD169B00819640 /* CDXPropertyModifierAction.h */; }; - E6929330161ECBAD00DB1EAA /* aabb.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037EB15DD169B00819640 /* aabb.h */; }; - E6929331161ECBAD00DB1EAA /* mat4stack.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037ED15DD169B00819640 /* mat4stack.h */; }; - E6929332161ECBAD00DB1EAA /* matrix.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037EE15DD169B00819640 /* matrix.h */; }; - E6929333161ECBAD00DB1EAA /* kazmath.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037EF15DD169B00819640 /* kazmath.h */; }; - E6929334161ECBAD00DB1EAA /* mat3.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037F015DD169B00819640 /* mat3.h */; }; - E6929335161ECBAD00DB1EAA /* mat4.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037F115DD169B00819640 /* mat4.h */; }; - E6929336161ECBAD00DB1EAA /* neon_matrix_impl.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037F215DD169B00819640 /* neon_matrix_impl.h */; }; - E6929337161ECBAD00DB1EAA /* plane.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037F315DD169B00819640 /* plane.h */; }; - E6929338161ECBAD00DB1EAA /* quaternion.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037F415DD169B00819640 /* quaternion.h */; }; - E6929339161ECBAD00DB1EAA /* ray2.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037F515DD169B00819640 /* ray2.h */; }; - E692933A161ECBAD00DB1EAA /* utility.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037F615DD169B00819640 /* utility.h */; }; - E692933B161ECBAD00DB1EAA /* vec2.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037F715DD169B00819640 /* vec2.h */; }; - E692933C161ECBAD00DB1EAA /* vec3.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037F815DD169B00819640 /* vec3.h */; }; - E692933D161ECBAD00DB1EAA /* vec4.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037F915DD169B00819640 /* vec4.h */; }; - E692933E161ECBAD00DB1EAA /* png.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037FB15DD169B00819640 /* png.h */; }; - E692933F161ECBAD00DB1EAA /* pngconf.h in Headers */ = {isa = PBXBuildFile; fileRef = E61037FC15DD169B00819640 /* pngconf.h */; }; - E6929361161ECD1F00DB1EAA /* CocosLibMac-Prefix.pch in Headers */ = {isa = PBXBuildFile; fileRef = E692935F161ECCDB00DB1EAA /* CocosLibMac-Prefix.pch */; }; - E6AA4C0B13B156F800C9F08C /* CocosLib_Prefix.pch in Headers */ = {isa = PBXBuildFile; fileRef = E6AA4C0A13B156F800C9F08C /* CocosLib_Prefix.pch */; }; + E6E9ADCC181456C100E3C1A2 /* CCAction.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AC96181456C100E3C1A2 /* CCAction.h */; }; + E6E9ADCD181456C100E3C1A2 /* CCAction.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AC96181456C100E3C1A2 /* CCAction.h */; }; + E6E9ADCE181456C100E3C1A2 /* CCAction.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9AC97181456C100E3C1A2 /* CCAction.m */; }; + E6E9ADCF181456C100E3C1A2 /* CCAction.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9AC97181456C100E3C1A2 /* CCAction.m */; }; + E6E9ADD0181456C100E3C1A2 /* CCActionCatmullRom.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AC98181456C100E3C1A2 /* CCActionCatmullRom.h */; }; + E6E9ADD1181456C100E3C1A2 /* CCActionCatmullRom.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AC98181456C100E3C1A2 /* CCActionCatmullRom.h */; }; + E6E9ADD2181456C100E3C1A2 /* CCActionCatmullRom.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9AC99181456C100E3C1A2 /* CCActionCatmullRom.m */; }; + E6E9ADD3181456C100E3C1A2 /* CCActionCatmullRom.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9AC99181456C100E3C1A2 /* CCActionCatmullRom.m */; }; + E6E9ADD4181456C100E3C1A2 /* CCActionEase.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AC9A181456C100E3C1A2 /* CCActionEase.h */; }; + E6E9ADD5181456C100E3C1A2 /* CCActionEase.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AC9A181456C100E3C1A2 /* CCActionEase.h */; }; + E6E9ADD6181456C100E3C1A2 /* CCActionEase.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9AC9B181456C100E3C1A2 /* CCActionEase.m */; }; + E6E9ADD7181456C100E3C1A2 /* CCActionEase.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9AC9B181456C100E3C1A2 /* CCActionEase.m */; }; + E6E9ADD8181456C100E3C1A2 /* CCActionGrid.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AC9C181456C100E3C1A2 /* CCActionGrid.h */; }; + E6E9ADD9181456C100E3C1A2 /* CCActionGrid.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AC9C181456C100E3C1A2 /* CCActionGrid.h */; }; + E6E9ADDA181456C100E3C1A2 /* CCActionGrid.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9AC9D181456C100E3C1A2 /* CCActionGrid.m */; }; + E6E9ADDB181456C100E3C1A2 /* CCActionGrid.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9AC9D181456C100E3C1A2 /* CCActionGrid.m */; }; + E6E9ADDC181456C100E3C1A2 /* CCActionGrid3D.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AC9E181456C100E3C1A2 /* CCActionGrid3D.h */; }; + E6E9ADDD181456C100E3C1A2 /* CCActionGrid3D.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AC9E181456C100E3C1A2 /* CCActionGrid3D.h */; }; + E6E9ADDE181456C100E3C1A2 /* CCActionGrid3D.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9AC9F181456C100E3C1A2 /* CCActionGrid3D.m */; }; + E6E9ADDF181456C100E3C1A2 /* CCActionGrid3D.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9AC9F181456C100E3C1A2 /* CCActionGrid3D.m */; }; + E6E9ADE0181456C100E3C1A2 /* CCActionInstant.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9ACA0181456C100E3C1A2 /* CCActionInstant.h */; }; + E6E9ADE1181456C100E3C1A2 /* CCActionInstant.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9ACA0181456C100E3C1A2 /* CCActionInstant.h */; }; + E6E9ADE2181456C100E3C1A2 /* CCActionInstant.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9ACA1181456C100E3C1A2 /* CCActionInstant.m */; }; + E6E9ADE3181456C100E3C1A2 /* CCActionInstant.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9ACA1181456C100E3C1A2 /* CCActionInstant.m */; }; + E6E9ADE4181456C100E3C1A2 /* CCActionInterval.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9ACA2181456C100E3C1A2 /* CCActionInterval.h */; }; + E6E9ADE5181456C100E3C1A2 /* CCActionInterval.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9ACA2181456C100E3C1A2 /* CCActionInterval.h */; }; + E6E9ADE6181456C100E3C1A2 /* CCActionInterval.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9ACA3181456C100E3C1A2 /* CCActionInterval.m */; }; + E6E9ADE7181456C100E3C1A2 /* CCActionInterval.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9ACA3181456C100E3C1A2 /* CCActionInterval.m */; }; + E6E9ADE8181456C100E3C1A2 /* CCActionManager.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9ACA4181456C100E3C1A2 /* CCActionManager.h */; }; + E6E9ADE9181456C100E3C1A2 /* CCActionManager.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9ACA4181456C100E3C1A2 /* CCActionManager.h */; }; + E6E9ADEA181456C100E3C1A2 /* CCActionManager.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9ACA5181456C100E3C1A2 /* CCActionManager.m */; }; + E6E9ADEB181456C100E3C1A2 /* CCActionManager.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9ACA5181456C100E3C1A2 /* CCActionManager.m */; }; + E6E9ADEC181456C100E3C1A2 /* CCActionPageTurn3D.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9ACA6181456C100E3C1A2 /* CCActionPageTurn3D.h */; }; + E6E9ADED181456C100E3C1A2 /* CCActionPageTurn3D.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9ACA6181456C100E3C1A2 /* CCActionPageTurn3D.h */; }; + E6E9ADEE181456C100E3C1A2 /* CCActionPageTurn3D.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9ACA7181456C100E3C1A2 /* CCActionPageTurn3D.m */; }; + E6E9ADEF181456C100E3C1A2 /* CCActionPageTurn3D.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9ACA7181456C100E3C1A2 /* CCActionPageTurn3D.m */; }; + E6E9ADF0181456C100E3C1A2 /* CCActionProgressTimer.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9ACA8181456C100E3C1A2 /* CCActionProgressTimer.h */; }; + E6E9ADF1181456C100E3C1A2 /* CCActionProgressTimer.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9ACA8181456C100E3C1A2 /* CCActionProgressTimer.h */; }; + E6E9ADF2181456C100E3C1A2 /* CCActionProgressTimer.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9ACA9181456C100E3C1A2 /* CCActionProgressTimer.m */; }; + E6E9ADF3181456C100E3C1A2 /* CCActionProgressTimer.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9ACA9181456C100E3C1A2 /* CCActionProgressTimer.m */; }; + E6E9ADF4181456C100E3C1A2 /* CCActionTiledGrid.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9ACAA181456C100E3C1A2 /* CCActionTiledGrid.h */; }; + E6E9ADF5181456C100E3C1A2 /* CCActionTiledGrid.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9ACAA181456C100E3C1A2 /* CCActionTiledGrid.h */; }; + E6E9ADF6181456C100E3C1A2 /* CCActionTiledGrid.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9ACAB181456C100E3C1A2 /* CCActionTiledGrid.m */; }; + E6E9ADF7181456C100E3C1A2 /* CCActionTiledGrid.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9ACAB181456C100E3C1A2 /* CCActionTiledGrid.m */; }; + E6E9ADF8181456C100E3C1A2 /* CCActionTween.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9ACAC181456C100E3C1A2 /* CCActionTween.h */; }; + E6E9ADF9181456C100E3C1A2 /* CCActionTween.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9ACAC181456C100E3C1A2 /* CCActionTween.h */; }; + E6E9ADFA181456C100E3C1A2 /* CCActionTween.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9ACAD181456C100E3C1A2 /* CCActionTween.m */; }; + E6E9ADFB181456C100E3C1A2 /* CCActionTween.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9ACAD181456C100E3C1A2 /* CCActionTween.m */; }; + E6E9ADFC181456C100E3C1A2 /* CCAnimation.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9ACAE181456C100E3C1A2 /* CCAnimation.h */; }; + E6E9ADFD181456C100E3C1A2 /* CCAnimation.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9ACAE181456C100E3C1A2 /* CCAnimation.h */; }; + E6E9ADFE181456C100E3C1A2 /* CCAnimation.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9ACAF181456C100E3C1A2 /* CCAnimation.m */; }; + E6E9ADFF181456C100E3C1A2 /* CCAnimation.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9ACAF181456C100E3C1A2 /* CCAnimation.m */; }; + E6E9AE00181456C100E3C1A2 /* CCAnimationCache.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9ACB0181456C100E3C1A2 /* CCAnimationCache.h */; }; + E6E9AE01181456C100E3C1A2 /* CCAnimationCache.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9ACB0181456C100E3C1A2 /* CCAnimationCache.h */; }; + E6E9AE02181456C100E3C1A2 /* CCAnimationCache.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9ACB1181456C100E3C1A2 /* CCAnimationCache.m */; }; + E6E9AE03181456C100E3C1A2 /* CCAnimationCache.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9ACB1181456C100E3C1A2 /* CCAnimationCache.m */; }; + E6E9AE04181456C100E3C1A2 /* CCAtlasNode.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9ACB2181456C100E3C1A2 /* CCAtlasNode.h */; }; + E6E9AE05181456C100E3C1A2 /* CCAtlasNode.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9ACB2181456C100E3C1A2 /* CCAtlasNode.h */; }; + E6E9AE06181456C100E3C1A2 /* CCAtlasNode.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9ACB3181456C100E3C1A2 /* CCAtlasNode.m */; }; + E6E9AE07181456C100E3C1A2 /* CCAtlasNode.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9ACB3181456C100E3C1A2 /* CCAtlasNode.m */; }; + E6E9AE08181456C100E3C1A2 /* CCCamera.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9ACB4181456C100E3C1A2 /* CCCamera.h */; }; + E6E9AE09181456C100E3C1A2 /* CCCamera.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9ACB4181456C100E3C1A2 /* CCCamera.h */; }; + E6E9AE0A181456C100E3C1A2 /* CCClippingNode.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9ACB5181456C100E3C1A2 /* CCClippingNode.h */; }; + E6E9AE0B181456C100E3C1A2 /* CCClippingNode.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9ACB5181456C100E3C1A2 /* CCClippingNode.h */; }; + E6E9AE0C181456C100E3C1A2 /* CCClippingNode.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9ACB6181456C100E3C1A2 /* CCClippingNode.m */; }; + E6E9AE0D181456C100E3C1A2 /* CCClippingNode.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9ACB6181456C100E3C1A2 /* CCClippingNode.m */; }; + E6E9AE0E181456C100E3C1A2 /* ccConfig.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9ACB7181456C100E3C1A2 /* ccConfig.h */; }; + E6E9AE0F181456C100E3C1A2 /* ccConfig.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9ACB7181456C100E3C1A2 /* ccConfig.h */; }; + E6E9AE10181456C100E3C1A2 /* CCConfiguration.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9ACB8181456C100E3C1A2 /* CCConfiguration.h */; }; + E6E9AE11181456C100E3C1A2 /* CCConfiguration.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9ACB8181456C100E3C1A2 /* CCConfiguration.h */; }; + E6E9AE12181456C100E3C1A2 /* CCConfiguration.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9ACB9181456C100E3C1A2 /* CCConfiguration.m */; }; + E6E9AE13181456C100E3C1A2 /* CCConfiguration.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9ACB9181456C100E3C1A2 /* CCConfiguration.m */; }; + E6E9AE14181456C100E3C1A2 /* ccDeprecated.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9ACBA181456C100E3C1A2 /* ccDeprecated.h */; }; + E6E9AE15181456C100E3C1A2 /* ccDeprecated.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9ACBA181456C100E3C1A2 /* ccDeprecated.h */; }; + E6E9AE16181456C100E3C1A2 /* ccDeprecated.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9ACBB181456C100E3C1A2 /* ccDeprecated.m */; }; + E6E9AE17181456C100E3C1A2 /* ccDeprecated.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9ACBB181456C100E3C1A2 /* ccDeprecated.m */; }; + E6E9AE18181456C100E3C1A2 /* CCDirector.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9ACBC181456C100E3C1A2 /* CCDirector.h */; }; + E6E9AE19181456C100E3C1A2 /* CCDirector.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9ACBC181456C100E3C1A2 /* CCDirector.h */; }; + E6E9AE1A181456C100E3C1A2 /* CCDirector.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9ACBD181456C100E3C1A2 /* CCDirector.m */; }; + E6E9AE1B181456C100E3C1A2 /* CCDirector.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9ACBD181456C100E3C1A2 /* CCDirector.m */; }; + E6E9AE1C181456C100E3C1A2 /* CCDrawingPrimitives.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9ACBE181456C100E3C1A2 /* CCDrawingPrimitives.h */; }; + E6E9AE1D181456C100E3C1A2 /* CCDrawingPrimitives.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9ACBE181456C100E3C1A2 /* CCDrawingPrimitives.h */; }; + E6E9AE1E181456C100E3C1A2 /* CCDrawingPrimitives.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9ACBF181456C100E3C1A2 /* CCDrawingPrimitives.m */; }; + E6E9AE1F181456C100E3C1A2 /* CCDrawingPrimitives.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9ACBF181456C100E3C1A2 /* CCDrawingPrimitives.m */; }; + E6E9AE20181456C100E3C1A2 /* CCDrawNode.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9ACC0181456C100E3C1A2 /* CCDrawNode.h */; }; + E6E9AE21181456C100E3C1A2 /* CCDrawNode.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9ACC0181456C100E3C1A2 /* CCDrawNode.h */; }; + E6E9AE22181456C100E3C1A2 /* CCDrawNode.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9ACC1181456C100E3C1A2 /* CCDrawNode.m */; }; + E6E9AE23181456C100E3C1A2 /* CCDrawNode.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9ACC1181456C100E3C1A2 /* CCDrawNode.m */; }; + E6E9AE24181456C100E3C1A2 /* ccFPSImages.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9ACC2181456C100E3C1A2 /* ccFPSImages.h */; }; + E6E9AE25181456C100E3C1A2 /* ccFPSImages.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9ACC2181456C100E3C1A2 /* ccFPSImages.h */; }; + E6E9AE26181456C100E3C1A2 /* ccFPSImages.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9ACC3181456C100E3C1A2 /* ccFPSImages.m */; }; + E6E9AE27181456C100E3C1A2 /* ccFPSImages.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9ACC3181456C100E3C1A2 /* ccFPSImages.m */; }; + E6E9AE28181456C100E3C1A2 /* CCGLProgram.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9ACC4181456C100E3C1A2 /* CCGLProgram.h */; }; + E6E9AE29181456C100E3C1A2 /* CCGLProgram.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9ACC4181456C100E3C1A2 /* CCGLProgram.h */; }; + E6E9AE2A181456C100E3C1A2 /* CCGLProgram.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9ACC5181456C100E3C1A2 /* CCGLProgram.m */; }; + E6E9AE2B181456C100E3C1A2 /* CCGLProgram.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9ACC5181456C100E3C1A2 /* CCGLProgram.m */; }; + E6E9AE2C181456C100E3C1A2 /* ccGLStateCache.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9ACC6181456C100E3C1A2 /* ccGLStateCache.h */; }; + E6E9AE2D181456C100E3C1A2 /* ccGLStateCache.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9ACC6181456C100E3C1A2 /* ccGLStateCache.h */; }; + E6E9AE2E181456C100E3C1A2 /* ccGLStateCache.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9ACC7181456C100E3C1A2 /* ccGLStateCache.m */; }; + E6E9AE2F181456C100E3C1A2 /* ccGLStateCache.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9ACC7181456C100E3C1A2 /* ccGLStateCache.m */; }; + E6E9AE30181456C100E3C1A2 /* CCGrabber.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9ACC8181456C100E3C1A2 /* CCGrabber.h */; }; + E6E9AE31181456C100E3C1A2 /* CCGrabber.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9ACC8181456C100E3C1A2 /* CCGrabber.h */; }; + E6E9AE32181456C100E3C1A2 /* CCGrabber.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9ACC9181456C100E3C1A2 /* CCGrabber.m */; }; + E6E9AE33181456C100E3C1A2 /* CCGrabber.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9ACC9181456C100E3C1A2 /* CCGrabber.m */; }; + E6E9AE34181456C100E3C1A2 /* CCGrid.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9ACCA181456C100E3C1A2 /* CCGrid.h */; }; + E6E9AE35181456C100E3C1A2 /* CCGrid.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9ACCA181456C100E3C1A2 /* CCGrid.h */; }; + E6E9AE36181456C100E3C1A2 /* CCGrid.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9ACCB181456C100E3C1A2 /* CCGrid.m */; }; + E6E9AE37181456C100E3C1A2 /* CCGrid.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9ACCB181456C100E3C1A2 /* CCGrid.m */; }; + E6E9AE38181456C100E3C1A2 /* CCLabelAtlas.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9ACCC181456C100E3C1A2 /* CCLabelAtlas.h */; }; + E6E9AE39181456C100E3C1A2 /* CCLabelAtlas.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9ACCC181456C100E3C1A2 /* CCLabelAtlas.h */; }; + E6E9AE3A181456C100E3C1A2 /* CCLabelAtlas.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9ACCD181456C100E3C1A2 /* CCLabelAtlas.m */; }; + E6E9AE3B181456C100E3C1A2 /* CCLabelAtlas.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9ACCD181456C100E3C1A2 /* CCLabelAtlas.m */; }; + E6E9AE3C181456C100E3C1A2 /* CCLabelBMFont.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9ACCE181456C100E3C1A2 /* CCLabelBMFont.h */; }; + E6E9AE3D181456C100E3C1A2 /* CCLabelBMFont.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9ACCE181456C100E3C1A2 /* CCLabelBMFont.h */; }; + E6E9AE3E181456C100E3C1A2 /* CCLabelBMFont.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9ACCF181456C100E3C1A2 /* CCLabelBMFont.m */; }; + E6E9AE3F181456C100E3C1A2 /* CCLabelBMFont.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9ACCF181456C100E3C1A2 /* CCLabelBMFont.m */; }; + E6E9AE40181456C100E3C1A2 /* CCLabelTTF.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9ACD0181456C100E3C1A2 /* CCLabelTTF.h */; }; + E6E9AE41181456C100E3C1A2 /* CCLabelTTF.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9ACD0181456C100E3C1A2 /* CCLabelTTF.h */; }; + E6E9AE42181456C100E3C1A2 /* CCLabelTTF.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9ACD1181456C100E3C1A2 /* CCLabelTTF.m */; }; + E6E9AE43181456C100E3C1A2 /* CCLabelTTF.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9ACD1181456C100E3C1A2 /* CCLabelTTF.m */; }; + E6E9AE44181456C100E3C1A2 /* CCLayer.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9ACD2181456C100E3C1A2 /* CCLayer.h */; }; + E6E9AE45181456C100E3C1A2 /* CCLayer.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9ACD2181456C100E3C1A2 /* CCLayer.h */; }; + E6E9AE46181456C100E3C1A2 /* CCLayer.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9ACD3181456C100E3C1A2 /* CCLayer.m */; }; + E6E9AE47181456C100E3C1A2 /* CCLayer.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9ACD3181456C100E3C1A2 /* CCLayer.m */; }; + E6E9AE48181456C100E3C1A2 /* ccMacros.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9ACD4181456C100E3C1A2 /* ccMacros.h */; }; + E6E9AE49181456C100E3C1A2 /* ccMacros.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9ACD4181456C100E3C1A2 /* ccMacros.h */; }; + E6E9AE4A181456C100E3C1A2 /* CCMenu.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9ACD5181456C100E3C1A2 /* CCMenu.h */; }; + E6E9AE4B181456C100E3C1A2 /* CCMenu.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9ACD5181456C100E3C1A2 /* CCMenu.h */; }; + E6E9AE4C181456C100E3C1A2 /* CCMenu.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9ACD6181456C100E3C1A2 /* CCMenu.m */; }; + E6E9AE4D181456C100E3C1A2 /* CCMenu.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9ACD6181456C100E3C1A2 /* CCMenu.m */; }; + E6E9AE4E181456C100E3C1A2 /* CCMenuItem.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9ACD7181456C100E3C1A2 /* CCMenuItem.h */; }; + E6E9AE4F181456C100E3C1A2 /* CCMenuItem.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9ACD7181456C100E3C1A2 /* CCMenuItem.h */; }; + E6E9AE50181456C100E3C1A2 /* CCMenuItem.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9ACD8181456C100E3C1A2 /* CCMenuItem.m */; }; + E6E9AE51181456C100E3C1A2 /* CCMenuItem.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9ACD8181456C100E3C1A2 /* CCMenuItem.m */; }; + E6E9AE52181456C100E3C1A2 /* CCMotionStreak.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9ACD9181456C100E3C1A2 /* CCMotionStreak.h */; }; + E6E9AE53181456C100E3C1A2 /* CCMotionStreak.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9ACD9181456C100E3C1A2 /* CCMotionStreak.h */; }; + E6E9AE54181456C100E3C1A2 /* CCMotionStreak.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9ACDA181456C100E3C1A2 /* CCMotionStreak.m */; }; + E6E9AE55181456C100E3C1A2 /* CCMotionStreak.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9ACDA181456C100E3C1A2 /* CCMotionStreak.m */; }; + E6E9AE56181456C100E3C1A2 /* CCNode+Debug.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9ACDB181456C100E3C1A2 /* CCNode+Debug.h */; }; + E6E9AE57181456C100E3C1A2 /* CCNode+Debug.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9ACDB181456C100E3C1A2 /* CCNode+Debug.h */; }; + E6E9AE58181456C100E3C1A2 /* CCNode+Debug.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9ACDC181456C100E3C1A2 /* CCNode+Debug.m */; }; + E6E9AE59181456C100E3C1A2 /* CCNode+Debug.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9ACDC181456C100E3C1A2 /* CCNode+Debug.m */; }; + E6E9AE5A181456C100E3C1A2 /* CCNode.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9ACDD181456C100E3C1A2 /* CCNode.h */; }; + E6E9AE5B181456C100E3C1A2 /* CCNode.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9ACDD181456C100E3C1A2 /* CCNode.h */; }; + E6E9AE5C181456C100E3C1A2 /* CCNode.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9ACDE181456C100E3C1A2 /* CCNode.m */; }; + E6E9AE5D181456C100E3C1A2 /* CCNode.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9ACDE181456C100E3C1A2 /* CCNode.m */; }; + E6E9AE5E181456C100E3C1A2 /* CCParallaxNode.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9ACDF181456C100E3C1A2 /* CCParallaxNode.h */; }; + E6E9AE5F181456C100E3C1A2 /* CCParallaxNode.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9ACDF181456C100E3C1A2 /* CCParallaxNode.h */; }; + E6E9AE60181456C100E3C1A2 /* CCParallaxNode.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9ACE0181456C100E3C1A2 /* CCParallaxNode.m */; }; + E6E9AE61181456C100E3C1A2 /* CCParallaxNode.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9ACE0181456C100E3C1A2 /* CCParallaxNode.m */; }; + E6E9AE62181456C100E3C1A2 /* CCParticleBatchNode.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9ACE1181456C100E3C1A2 /* CCParticleBatchNode.h */; }; + E6E9AE63181456C100E3C1A2 /* CCParticleBatchNode.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9ACE1181456C100E3C1A2 /* CCParticleBatchNode.h */; }; + E6E9AE64181456C100E3C1A2 /* CCParticleBatchNode.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9ACE2181456C100E3C1A2 /* CCParticleBatchNode.m */; }; + E6E9AE65181456C100E3C1A2 /* CCParticleBatchNode.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9ACE2181456C100E3C1A2 /* CCParticleBatchNode.m */; }; + E6E9AE66181456C100E3C1A2 /* CCParticleExamples.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9ACE3181456C100E3C1A2 /* CCParticleExamples.h */; }; + E6E9AE67181456C100E3C1A2 /* CCParticleExamples.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9ACE3181456C100E3C1A2 /* CCParticleExamples.h */; }; + E6E9AE68181456C100E3C1A2 /* CCParticleExamples.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9ACE4181456C100E3C1A2 /* CCParticleExamples.m */; }; + E6E9AE69181456C100E3C1A2 /* CCParticleExamples.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9ACE4181456C100E3C1A2 /* CCParticleExamples.m */; }; + E6E9AE6A181456C100E3C1A2 /* CCParticleSystem.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9ACE5181456C100E3C1A2 /* CCParticleSystem.h */; }; + E6E9AE6B181456C100E3C1A2 /* CCParticleSystem.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9ACE5181456C100E3C1A2 /* CCParticleSystem.h */; }; + E6E9AE6C181456C100E3C1A2 /* CCParticleSystem.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9ACE6181456C100E3C1A2 /* CCParticleSystem.m */; }; + E6E9AE6D181456C100E3C1A2 /* CCParticleSystem.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9ACE6181456C100E3C1A2 /* CCParticleSystem.m */; }; + E6E9AE6E181456C100E3C1A2 /* CCParticleSystemQuad.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9ACE7181456C100E3C1A2 /* CCParticleSystemQuad.h */; }; + E6E9AE6F181456C100E3C1A2 /* CCParticleSystemQuad.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9ACE7181456C100E3C1A2 /* CCParticleSystemQuad.h */; }; + E6E9AE70181456C100E3C1A2 /* CCParticleSystemQuad.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9ACE8181456C100E3C1A2 /* CCParticleSystemQuad.m */; }; + E6E9AE71181456C100E3C1A2 /* CCParticleSystemQuad.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9ACE8181456C100E3C1A2 /* CCParticleSystemQuad.m */; }; + E6E9AE72181456C100E3C1A2 /* CCPhysics+ObjectiveChipmunk.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9ACE9181456C100E3C1A2 /* CCPhysics+ObjectiveChipmunk.h */; }; + E6E9AE73181456C100E3C1A2 /* CCPhysics+ObjectiveChipmunk.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9ACE9181456C100E3C1A2 /* CCPhysics+ObjectiveChipmunk.h */; }; + E6E9AE74181456C100E3C1A2 /* CCPhysicsbody.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9ACEA181456C100E3C1A2 /* CCPhysicsbody.h */; }; + E6E9AE75181456C100E3C1A2 /* CCPhysicsbody.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9ACEA181456C100E3C1A2 /* CCPhysicsbody.h */; }; + E6E9AE76181456C100E3C1A2 /* CCPhysicsBody.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9ACEB181456C100E3C1A2 /* CCPhysicsBody.m */; }; + E6E9AE77181456C100E3C1A2 /* CCPhysicsBody.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9ACEB181456C100E3C1A2 /* CCPhysicsBody.m */; }; + E6E9AE78181456C100E3C1A2 /* CCPhysicsJoint.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9ACEC181456C100E3C1A2 /* CCPhysicsJoint.h */; }; + E6E9AE79181456C100E3C1A2 /* CCPhysicsJoint.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9ACEC181456C100E3C1A2 /* CCPhysicsJoint.h */; }; + E6E9AE7A181456C100E3C1A2 /* CCPhysicsJoint.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9ACED181456C100E3C1A2 /* CCPhysicsJoint.m */; }; + E6E9AE7B181456C100E3C1A2 /* CCPhysicsJoint.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9ACED181456C100E3C1A2 /* CCPhysicsJoint.m */; }; + E6E9AE7C181456C100E3C1A2 /* CCPhysicsNode.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9ACEE181456C100E3C1A2 /* CCPhysicsNode.h */; }; + E6E9AE7D181456C100E3C1A2 /* CCPhysicsNode.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9ACEE181456C100E3C1A2 /* CCPhysicsNode.h */; }; + E6E9AE7E181456C100E3C1A2 /* CCPhysicsNode.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9ACEF181456C100E3C1A2 /* CCPhysicsNode.m */; }; + E6E9AE7F181456C100E3C1A2 /* CCPhysicsNode.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9ACEF181456C100E3C1A2 /* CCPhysicsNode.m */; }; + E6E9AE80181456C100E3C1A2 /* CCProgressTimer.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9ACF0181456C100E3C1A2 /* CCProgressTimer.h */; }; + E6E9AE81181456C100E3C1A2 /* CCProgressTimer.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9ACF0181456C100E3C1A2 /* CCProgressTimer.h */; }; + E6E9AE82181456C100E3C1A2 /* CCProgressTimer.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9ACF1181456C100E3C1A2 /* CCProgressTimer.m */; }; + E6E9AE83181456C100E3C1A2 /* CCProgressTimer.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9ACF1181456C100E3C1A2 /* CCProgressTimer.m */; }; + E6E9AE84181456C100E3C1A2 /* CCProtocols.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9ACF2181456C100E3C1A2 /* CCProtocols.h */; }; + E6E9AE85181456C100E3C1A2 /* CCProtocols.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9ACF2181456C100E3C1A2 /* CCProtocols.h */; }; + E6E9AE86181456C100E3C1A2 /* CCRenderTexture.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9ACF3181456C100E3C1A2 /* CCRenderTexture.h */; }; + E6E9AE87181456C100E3C1A2 /* CCRenderTexture.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9ACF3181456C100E3C1A2 /* CCRenderTexture.h */; }; + E6E9AE88181456C100E3C1A2 /* CCRenderTexture.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9ACF4181456C100E3C1A2 /* CCRenderTexture.m */; }; + E6E9AE89181456C100E3C1A2 /* CCRenderTexture.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9ACF4181456C100E3C1A2 /* CCRenderTexture.m */; }; + E6E9AE8A181456C100E3C1A2 /* CCResponder.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9ACF5181456C100E3C1A2 /* CCResponder.h */; }; + E6E9AE8B181456C100E3C1A2 /* CCResponder.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9ACF5181456C100E3C1A2 /* CCResponder.h */; }; + E6E9AE8C181456C100E3C1A2 /* CCResponder.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9ACF6181456C100E3C1A2 /* CCResponder.m */; }; + E6E9AE8D181456C100E3C1A2 /* CCResponder.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9ACF6181456C100E3C1A2 /* CCResponder.m */; }; + E6E9AE8E181456C100E3C1A2 /* CCResponderManager.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9ACF7181456C100E3C1A2 /* CCResponderManager.h */; }; + E6E9AE8F181456C100E3C1A2 /* CCResponderManager.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9ACF7181456C100E3C1A2 /* CCResponderManager.h */; }; + E6E9AE90181456C100E3C1A2 /* CCResponderManager.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9ACF8181456C100E3C1A2 /* CCResponderManager.m */; }; + E6E9AE91181456C100E3C1A2 /* CCResponderManager.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9ACF8181456C100E3C1A2 /* CCResponderManager.m */; }; + E6E9AE92181456C100E3C1A2 /* CCScene.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9ACF9181456C100E3C1A2 /* CCScene.h */; }; + E6E9AE93181456C100E3C1A2 /* CCScene.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9ACF9181456C100E3C1A2 /* CCScene.h */; }; + E6E9AE94181456C100E3C1A2 /* CCScene.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9ACFA181456C100E3C1A2 /* CCScene.m */; }; + E6E9AE95181456C100E3C1A2 /* CCScene.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9ACFA181456C100E3C1A2 /* CCScene.m */; }; + E6E9AE96181456C100E3C1A2 /* CCScheduler.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9ACFB181456C100E3C1A2 /* CCScheduler.h */; }; + E6E9AE97181456C100E3C1A2 /* CCScheduler.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9ACFB181456C100E3C1A2 /* CCScheduler.h */; }; + E6E9AE98181456C100E3C1A2 /* CCScheduler.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9ACFC181456C100E3C1A2 /* CCScheduler.m */; }; + E6E9AE99181456C100E3C1A2 /* CCScheduler.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9ACFC181456C100E3C1A2 /* CCScheduler.m */; }; + E6E9AE9A181456C100E3C1A2 /* ccShader_Position_uColor_frag.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9ACFD181456C100E3C1A2 /* ccShader_Position_uColor_frag.h */; }; + E6E9AE9B181456C100E3C1A2 /* ccShader_Position_uColor_frag.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9ACFD181456C100E3C1A2 /* ccShader_Position_uColor_frag.h */; }; + E6E9AE9C181456C100E3C1A2 /* ccShader_Position_uColor_vert.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9ACFE181456C100E3C1A2 /* ccShader_Position_uColor_vert.h */; }; + E6E9AE9D181456C100E3C1A2 /* ccShader_Position_uColor_vert.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9ACFE181456C100E3C1A2 /* ccShader_Position_uColor_vert.h */; }; + E6E9AE9E181456C100E3C1A2 /* ccShader_PositionColor_frag.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9ACFF181456C100E3C1A2 /* ccShader_PositionColor_frag.h */; }; + E6E9AE9F181456C100E3C1A2 /* ccShader_PositionColor_frag.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9ACFF181456C100E3C1A2 /* ccShader_PositionColor_frag.h */; }; + E6E9AEA0181456C100E3C1A2 /* ccShader_PositionColor_vert.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD00181456C100E3C1A2 /* ccShader_PositionColor_vert.h */; }; + E6E9AEA1181456C100E3C1A2 /* ccShader_PositionColor_vert.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD00181456C100E3C1A2 /* ccShader_PositionColor_vert.h */; }; + E6E9AEA2181456C100E3C1A2 /* ccShader_PositionColorLengthTexture_frag.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD01181456C100E3C1A2 /* ccShader_PositionColorLengthTexture_frag.h */; }; + E6E9AEA3181456C100E3C1A2 /* ccShader_PositionColorLengthTexture_frag.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD01181456C100E3C1A2 /* ccShader_PositionColorLengthTexture_frag.h */; }; + E6E9AEA4181456C100E3C1A2 /* ccShader_PositionColorLengthTexture_vert.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD02181456C100E3C1A2 /* ccShader_PositionColorLengthTexture_vert.h */; }; + E6E9AEA5181456C100E3C1A2 /* ccShader_PositionColorLengthTexture_vert.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD02181456C100E3C1A2 /* ccShader_PositionColorLengthTexture_vert.h */; }; + E6E9AEA6181456C100E3C1A2 /* ccShader_PositionTexture_frag.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD03181456C100E3C1A2 /* ccShader_PositionTexture_frag.h */; }; + E6E9AEA7181456C100E3C1A2 /* ccShader_PositionTexture_frag.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD03181456C100E3C1A2 /* ccShader_PositionTexture_frag.h */; }; + E6E9AEA8181456C100E3C1A2 /* ccShader_PositionTexture_uColor_frag.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD04181456C100E3C1A2 /* ccShader_PositionTexture_uColor_frag.h */; }; + E6E9AEA9181456C100E3C1A2 /* ccShader_PositionTexture_uColor_frag.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD04181456C100E3C1A2 /* ccShader_PositionTexture_uColor_frag.h */; }; + E6E9AEAA181456C100E3C1A2 /* ccShader_PositionTexture_uColor_vert.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD05181456C100E3C1A2 /* ccShader_PositionTexture_uColor_vert.h */; }; + E6E9AEAB181456C100E3C1A2 /* ccShader_PositionTexture_uColor_vert.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD05181456C100E3C1A2 /* ccShader_PositionTexture_uColor_vert.h */; }; + E6E9AEAC181456C100E3C1A2 /* ccShader_PositionTexture_vert.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD06181456C100E3C1A2 /* ccShader_PositionTexture_vert.h */; }; + E6E9AEAD181456C100E3C1A2 /* ccShader_PositionTexture_vert.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD06181456C100E3C1A2 /* ccShader_PositionTexture_vert.h */; }; + E6E9AEAE181456C100E3C1A2 /* ccShader_PositionTextureA8Color_frag.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD07181456C100E3C1A2 /* ccShader_PositionTextureA8Color_frag.h */; }; + E6E9AEAF181456C100E3C1A2 /* ccShader_PositionTextureA8Color_frag.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD07181456C100E3C1A2 /* ccShader_PositionTextureA8Color_frag.h */; }; + E6E9AEB0181456C100E3C1A2 /* ccShader_PositionTextureA8Color_vert.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD08181456C100E3C1A2 /* ccShader_PositionTextureA8Color_vert.h */; }; + E6E9AEB1181456C100E3C1A2 /* ccShader_PositionTextureA8Color_vert.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD08181456C100E3C1A2 /* ccShader_PositionTextureA8Color_vert.h */; }; + E6E9AEB2181456C100E3C1A2 /* ccShader_PositionTextureColor_frag.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD09181456C100E3C1A2 /* ccShader_PositionTextureColor_frag.h */; }; + E6E9AEB3181456C100E3C1A2 /* ccShader_PositionTextureColor_frag.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD09181456C100E3C1A2 /* ccShader_PositionTextureColor_frag.h */; }; + E6E9AEB4181456C100E3C1A2 /* ccShader_PositionTextureColor_vert.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD0A181456C100E3C1A2 /* ccShader_PositionTextureColor_vert.h */; }; + E6E9AEB5181456C100E3C1A2 /* ccShader_PositionTextureColor_vert.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD0A181456C100E3C1A2 /* ccShader_PositionTextureColor_vert.h */; }; + E6E9AEB6181456C100E3C1A2 /* ccShader_PositionTextureColorAlphaTest_frag.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD0B181456C100E3C1A2 /* ccShader_PositionTextureColorAlphaTest_frag.h */; }; + E6E9AEB7181456C100E3C1A2 /* ccShader_PositionTextureColorAlphaTest_frag.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD0B181456C100E3C1A2 /* ccShader_PositionTextureColorAlphaTest_frag.h */; }; + E6E9AEB8181456C100E3C1A2 /* CCShaderCache.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD0C181456C100E3C1A2 /* CCShaderCache.h */; }; + E6E9AEB9181456C100E3C1A2 /* CCShaderCache.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD0C181456C100E3C1A2 /* CCShaderCache.h */; }; + E6E9AEBA181456C100E3C1A2 /* CCShaderCache.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9AD0D181456C100E3C1A2 /* CCShaderCache.m */; }; + E6E9AEBB181456C100E3C1A2 /* CCShaderCache.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9AD0D181456C100E3C1A2 /* CCShaderCache.m */; }; + E6E9AEBC181456C100E3C1A2 /* ccShaders.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD0E181456C100E3C1A2 /* ccShaders.h */; }; + E6E9AEBD181456C100E3C1A2 /* ccShaders.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD0E181456C100E3C1A2 /* ccShaders.h */; }; + E6E9AEBE181456C100E3C1A2 /* ccShaders.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9AD0F181456C100E3C1A2 /* ccShaders.m */; }; + E6E9AEBF181456C100E3C1A2 /* ccShaders.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9AD0F181456C100E3C1A2 /* ccShaders.m */; }; + E6E9AEC0181456C100E3C1A2 /* CCSprite.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD10181456C100E3C1A2 /* CCSprite.h */; }; + E6E9AEC1181456C100E3C1A2 /* CCSprite.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD10181456C100E3C1A2 /* CCSprite.h */; }; + E6E9AEC2181456C100E3C1A2 /* CCSprite.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9AD11181456C100E3C1A2 /* CCSprite.m */; }; + E6E9AEC3181456C100E3C1A2 /* CCSprite.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9AD11181456C100E3C1A2 /* CCSprite.m */; }; + E6E9AEC4181456C100E3C1A2 /* CCSprite9Slice.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD12181456C100E3C1A2 /* CCSprite9Slice.h */; }; + E6E9AEC5181456C100E3C1A2 /* CCSprite9Slice.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD12181456C100E3C1A2 /* CCSprite9Slice.h */; }; + E6E9AEC6181456C100E3C1A2 /* CCSprite9Slice.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9AD13181456C100E3C1A2 /* CCSprite9Slice.m */; }; + E6E9AEC7181456C100E3C1A2 /* CCSprite9Slice.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9AD13181456C100E3C1A2 /* CCSprite9Slice.m */; }; + E6E9AEC8181456C100E3C1A2 /* CCSpriteBatchNode.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD14181456C100E3C1A2 /* CCSpriteBatchNode.h */; }; + E6E9AEC9181456C100E3C1A2 /* CCSpriteBatchNode.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD14181456C100E3C1A2 /* CCSpriteBatchNode.h */; }; + E6E9AECA181456C100E3C1A2 /* CCSpriteBatchNode.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9AD15181456C100E3C1A2 /* CCSpriteBatchNode.m */; }; + E6E9AECB181456C100E3C1A2 /* CCSpriteBatchNode.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9AD15181456C100E3C1A2 /* CCSpriteBatchNode.m */; }; + E6E9AECC181456C100E3C1A2 /* CCSpriteFrame.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD16181456C100E3C1A2 /* CCSpriteFrame.h */; }; + E6E9AECD181456C100E3C1A2 /* CCSpriteFrame.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD16181456C100E3C1A2 /* CCSpriteFrame.h */; }; + E6E9AECE181456C100E3C1A2 /* CCSpriteFrame.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9AD17181456C100E3C1A2 /* CCSpriteFrame.m */; }; + E6E9AECF181456C100E3C1A2 /* CCSpriteFrame.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9AD17181456C100E3C1A2 /* CCSpriteFrame.m */; }; + E6E9AED0181456C100E3C1A2 /* CCSpriteFrameCache.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD18181456C100E3C1A2 /* CCSpriteFrameCache.h */; }; + E6E9AED1181456C100E3C1A2 /* CCSpriteFrameCache.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD18181456C100E3C1A2 /* CCSpriteFrameCache.h */; }; + E6E9AED2181456C100E3C1A2 /* CCSpriteFrameCache.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9AD19181456C100E3C1A2 /* CCSpriteFrameCache.m */; }; + E6E9AED3181456C100E3C1A2 /* CCSpriteFrameCache.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9AD19181456C100E3C1A2 /* CCSpriteFrameCache.m */; }; + E6E9AED4181456C100E3C1A2 /* CCTexture2D.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD1A181456C100E3C1A2 /* CCTexture2D.h */; }; + E6E9AED5181456C100E3C1A2 /* CCTexture2D.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD1A181456C100E3C1A2 /* CCTexture2D.h */; }; + E6E9AED6181456C100E3C1A2 /* CCTexture2D.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9AD1B181456C100E3C1A2 /* CCTexture2D.m */; }; + E6E9AED7181456C100E3C1A2 /* CCTexture2D.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9AD1B181456C100E3C1A2 /* CCTexture2D.m */; }; + E6E9AED8181456C100E3C1A2 /* CCTextureAtlas.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD1C181456C100E3C1A2 /* CCTextureAtlas.h */; }; + E6E9AED9181456C100E3C1A2 /* CCTextureAtlas.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD1C181456C100E3C1A2 /* CCTextureAtlas.h */; }; + E6E9AEDA181456C100E3C1A2 /* CCTextureAtlas.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9AD1D181456C100E3C1A2 /* CCTextureAtlas.m */; }; + E6E9AEDB181456C100E3C1A2 /* CCTextureAtlas.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9AD1D181456C100E3C1A2 /* CCTextureAtlas.m */; }; + E6E9AEDC181456C100E3C1A2 /* CCTextureCache.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD1E181456C100E3C1A2 /* CCTextureCache.h */; }; + E6E9AEDD181456C100E3C1A2 /* CCTextureCache.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD1E181456C100E3C1A2 /* CCTextureCache.h */; }; + E6E9AEDE181456C100E3C1A2 /* CCTextureCache.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9AD1F181456C100E3C1A2 /* CCTextureCache.m */; }; + E6E9AEDF181456C100E3C1A2 /* CCTextureCache.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9AD1F181456C100E3C1A2 /* CCTextureCache.m */; }; + E6E9AEE0181456C100E3C1A2 /* CCTexturePVR.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD20181456C100E3C1A2 /* CCTexturePVR.h */; }; + E6E9AEE1181456C100E3C1A2 /* CCTexturePVR.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD20181456C100E3C1A2 /* CCTexturePVR.h */; }; + E6E9AEE2181456C100E3C1A2 /* CCTexturePVR.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9AD21181456C100E3C1A2 /* CCTexturePVR.m */; }; + E6E9AEE3181456C100E3C1A2 /* CCTexturePVR.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9AD21181456C100E3C1A2 /* CCTexturePVR.m */; }; + E6E9AEE4181456C100E3C1A2 /* CCTileMapAtlas.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD22181456C100E3C1A2 /* CCTileMapAtlas.h */; }; + E6E9AEE5181456C100E3C1A2 /* CCTileMapAtlas.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD22181456C100E3C1A2 /* CCTileMapAtlas.h */; }; + E6E9AEE6181456C100E3C1A2 /* CCTileMapAtlas.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9AD23181456C100E3C1A2 /* CCTileMapAtlas.m */; }; + E6E9AEE7181456C100E3C1A2 /* CCTileMapAtlas.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9AD23181456C100E3C1A2 /* CCTileMapAtlas.m */; }; + E6E9AEE8181456C100E3C1A2 /* CCTMXLayer.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD24181456C100E3C1A2 /* CCTMXLayer.h */; }; + E6E9AEE9181456C100E3C1A2 /* CCTMXLayer.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD24181456C100E3C1A2 /* CCTMXLayer.h */; }; + E6E9AEEA181456C100E3C1A2 /* CCTMXLayer.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9AD25181456C100E3C1A2 /* CCTMXLayer.m */; }; + E6E9AEEB181456C100E3C1A2 /* CCTMXLayer.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9AD25181456C100E3C1A2 /* CCTMXLayer.m */; }; + E6E9AEEC181456C100E3C1A2 /* CCTMXObjectGroup.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD26181456C100E3C1A2 /* CCTMXObjectGroup.h */; }; + E6E9AEED181456C100E3C1A2 /* CCTMXObjectGroup.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD26181456C100E3C1A2 /* CCTMXObjectGroup.h */; }; + E6E9AEEE181456C100E3C1A2 /* CCTMXObjectGroup.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9AD27181456C100E3C1A2 /* CCTMXObjectGroup.m */; }; + E6E9AEEF181456C100E3C1A2 /* CCTMXObjectGroup.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9AD27181456C100E3C1A2 /* CCTMXObjectGroup.m */; }; + E6E9AEF0181456C100E3C1A2 /* CCTMXTiledMap.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD28181456C100E3C1A2 /* CCTMXTiledMap.h */; }; + E6E9AEF1181456C100E3C1A2 /* CCTMXTiledMap.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD28181456C100E3C1A2 /* CCTMXTiledMap.h */; }; + E6E9AEF2181456C100E3C1A2 /* CCTMXTiledMap.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9AD29181456C100E3C1A2 /* CCTMXTiledMap.m */; }; + E6E9AEF3181456C100E3C1A2 /* CCTMXTiledMap.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9AD29181456C100E3C1A2 /* CCTMXTiledMap.m */; }; + E6E9AEF4181456C100E3C1A2 /* CCTMXXMLParser.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD2A181456C100E3C1A2 /* CCTMXXMLParser.h */; }; + E6E9AEF5181456C100E3C1A2 /* CCTMXXMLParser.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD2A181456C100E3C1A2 /* CCTMXXMLParser.h */; }; + E6E9AEF6181456C100E3C1A2 /* CCTMXXMLParser.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9AD2B181456C100E3C1A2 /* CCTMXXMLParser.m */; }; + E6E9AEF7181456C100E3C1A2 /* CCTMXXMLParser.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9AD2B181456C100E3C1A2 /* CCTMXXMLParser.m */; }; + E6E9AEF8181456C100E3C1A2 /* CCTransition.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD2C181456C100E3C1A2 /* CCTransition.h */; }; + E6E9AEF9181456C100E3C1A2 /* CCTransition.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD2C181456C100E3C1A2 /* CCTransition.h */; }; + E6E9AEFA181456C100E3C1A2 /* CCTransition.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9AD2D181456C100E3C1A2 /* CCTransition.m */; }; + E6E9AEFB181456C100E3C1A2 /* CCTransition.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9AD2D181456C100E3C1A2 /* CCTransition.m */; }; + E6E9AEFC181456C100E3C1A2 /* ccTypes.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD2E181456C100E3C1A2 /* ccTypes.h */; }; + E6E9AEFD181456C100E3C1A2 /* ccTypes.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD2E181456C100E3C1A2 /* ccTypes.h */; }; + E6E9AEFE181456C100E3C1A2 /* cocos2d.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD2F181456C100E3C1A2 /* cocos2d.h */; }; + E6E9AEFF181456C100E3C1A2 /* cocos2d.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD2F181456C100E3C1A2 /* cocos2d.h */; }; + E6E9AF00181456C100E3C1A2 /* cocos2d.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9AD30181456C100E3C1A2 /* cocos2d.m */; }; + E6E9AF01181456C100E3C1A2 /* cocos2d.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9AD30181456C100E3C1A2 /* cocos2d.m */; }; + E6E9AF02181456C100E3C1A2 /* CCGL.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD32181456C100E3C1A2 /* CCGL.h */; }; + E6E9AF03181456C100E3C1A2 /* CCGL.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD32181456C100E3C1A2 /* CCGL.h */; }; + E6E9AF04181456C100E3C1A2 /* CCNS.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD33181456C100E3C1A2 /* CCNS.h */; }; + E6E9AF05181456C100E3C1A2 /* CCNS.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD33181456C100E3C1A2 /* CCNS.h */; }; + E6E9AF06181456C100E3C1A2 /* CCDirectorIOS.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD35181456C100E3C1A2 /* CCDirectorIOS.h */; }; + E6E9AF07181456C100E3C1A2 /* CCDirectorIOS.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD35181456C100E3C1A2 /* CCDirectorIOS.h */; }; + E6E9AF08181456C100E3C1A2 /* CCDirectorIOS.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9AD36181456C100E3C1A2 /* CCDirectorIOS.m */; }; + E6E9AF09181456C100E3C1A2 /* CCDirectorIOS.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9AD36181456C100E3C1A2 /* CCDirectorIOS.m */; }; + E6E9AF0A181456C100E3C1A2 /* CCES2Renderer.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD37181456C100E3C1A2 /* CCES2Renderer.h */; }; + E6E9AF0B181456C100E3C1A2 /* CCES2Renderer.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD37181456C100E3C1A2 /* CCES2Renderer.h */; }; + E6E9AF0C181456C100E3C1A2 /* CCES2Renderer.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9AD38181456C100E3C1A2 /* CCES2Renderer.m */; }; + E6E9AF0D181456C100E3C1A2 /* CCES2Renderer.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9AD38181456C100E3C1A2 /* CCES2Renderer.m */; }; + E6E9AF0E181456C100E3C1A2 /* CCESRenderer.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD39181456C100E3C1A2 /* CCESRenderer.h */; }; + E6E9AF0F181456C100E3C1A2 /* CCESRenderer.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD39181456C100E3C1A2 /* CCESRenderer.h */; }; + E6E9AF10181456C100E3C1A2 /* CCGLView.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD3A181456C100E3C1A2 /* CCGLView.h */; }; + E6E9AF11181456C100E3C1A2 /* CCGLView.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD3A181456C100E3C1A2 /* CCGLView.h */; }; + E6E9AF12181456C100E3C1A2 /* CCGLView.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9AD3B181456C100E3C1A2 /* CCGLView.m */; }; + E6E9AF13181456C100E3C1A2 /* CCGLView.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9AD3B181456C100E3C1A2 /* CCGLView.m */; }; + E6E9AF14181456C100E3C1A2 /* CCResponder.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD3C181456C100E3C1A2 /* CCResponder.h */; }; + E6E9AF15181456C100E3C1A2 /* CCResponder.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD3C181456C100E3C1A2 /* CCResponder.h */; }; + E6E9AF16181456C100E3C1A2 /* CCResponder.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9AD3D181456C100E3C1A2 /* CCResponder.m */; }; + E6E9AF17181456C100E3C1A2 /* CCResponder.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9AD3D181456C100E3C1A2 /* CCResponder.m */; }; + E6E9AF18181456C100E3C1A2 /* CCResponderManager.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD3E181456C100E3C1A2 /* CCResponderManager.h */; }; + E6E9AF19181456C100E3C1A2 /* CCResponderManager.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD3E181456C100E3C1A2 /* CCResponderManager.h */; }; + E6E9AF1A181456C100E3C1A2 /* CCResponderManager.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9AD3F181456C100E3C1A2 /* CCResponderManager.m */; }; + E6E9AF1B181456C100E3C1A2 /* CCResponderManager.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9AD3F181456C100E3C1A2 /* CCResponderManager.m */; }; + E6E9AF1C181456C100E3C1A2 /* UITouch+CC.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD40181456C100E3C1A2 /* UITouch+CC.h */; }; + E6E9AF1D181456C100E3C1A2 /* UITouch+CC.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD40181456C100E3C1A2 /* UITouch+CC.h */; }; + E6E9AF1E181456C100E3C1A2 /* UITouch+CC.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9AD41181456C100E3C1A2 /* UITouch+CC.m */; }; + E6E9AF1F181456C100E3C1A2 /* UITouch+CC.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9AD41181456C100E3C1A2 /* UITouch+CC.m */; }; + E6E9AF20181456C100E3C1A2 /* CCDirectorMac.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD43181456C100E3C1A2 /* CCDirectorMac.h */; }; + E6E9AF21181456C100E3C1A2 /* CCDirectorMac.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD43181456C100E3C1A2 /* CCDirectorMac.h */; }; + E6E9AF22181456C100E3C1A2 /* CCDirectorMac.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9AD44181456C100E3C1A2 /* CCDirectorMac.m */; }; + E6E9AF23181456C100E3C1A2 /* CCDirectorMac.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9AD44181456C100E3C1A2 /* CCDirectorMac.m */; }; + E6E9AF24181456C100E3C1A2 /* CCGLView.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD45181456C100E3C1A2 /* CCGLView.h */; }; + E6E9AF25181456C100E3C1A2 /* CCGLView.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD45181456C100E3C1A2 /* CCGLView.h */; }; + E6E9AF26181456C100E3C1A2 /* CCGLView.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9AD46181456C100E3C1A2 /* CCGLView.m */; }; + E6E9AF27181456C100E3C1A2 /* CCGLView.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9AD46181456C100E3C1A2 /* CCGLView.m */; }; + E6E9AF28181456C100E3C1A2 /* CCWindow.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD47181456C100E3C1A2 /* CCWindow.h */; }; + E6E9AF29181456C200E3C1A2 /* CCWindow.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD47181456C100E3C1A2 /* CCWindow.h */; }; + E6E9AF2A181456C200E3C1A2 /* CCWindow.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9AD48181456C100E3C1A2 /* CCWindow.m */; }; + E6E9AF2B181456C200E3C1A2 /* CCWindow.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9AD48181456C100E3C1A2 /* CCWindow.m */; }; + E6E9AF2C181456C200E3C1A2 /* NSEvent+CC.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD49181456C100E3C1A2 /* NSEvent+CC.h */; }; + E6E9AF2D181456C200E3C1A2 /* NSEvent+CC.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD49181456C100E3C1A2 /* NSEvent+CC.h */; }; + E6E9AF2E181456C200E3C1A2 /* NSEvent+CC.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9AD4A181456C100E3C1A2 /* NSEvent+CC.m */; }; + E6E9AF2F181456C200E3C1A2 /* NSEvent+CC.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9AD4A181456C100E3C1A2 /* NSEvent+CC.m */; }; + E6E9AF30181456C200E3C1A2 /* base64.c in Sources */ = {isa = PBXBuildFile; fileRef = E6E9AD4C181456C100E3C1A2 /* base64.c */; }; + E6E9AF31181456C200E3C1A2 /* base64.c in Sources */ = {isa = PBXBuildFile; fileRef = E6E9AD4C181456C100E3C1A2 /* base64.c */; }; + E6E9AF32181456C200E3C1A2 /* base64.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD4D181456C100E3C1A2 /* base64.h */; }; + E6E9AF33181456C200E3C1A2 /* base64.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD4D181456C100E3C1A2 /* base64.h */; }; + E6E9AF34181456C200E3C1A2 /* CCFileUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD4E181456C100E3C1A2 /* CCFileUtils.h */; }; + E6E9AF35181456C200E3C1A2 /* CCFileUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD4E181456C100E3C1A2 /* CCFileUtils.h */; }; + E6E9AF36181456C200E3C1A2 /* CCFileUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9AD4F181456C100E3C1A2 /* CCFileUtils.m */; }; + E6E9AF37181456C200E3C1A2 /* CCFileUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9AD4F181456C100E3C1A2 /* CCFileUtils.m */; }; + E6E9AF38181456C200E3C1A2 /* CCProfiling.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD50181456C100E3C1A2 /* CCProfiling.h */; }; + E6E9AF39181456C200E3C1A2 /* CCProfiling.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD50181456C100E3C1A2 /* CCProfiling.h */; }; + E6E9AF3A181456C200E3C1A2 /* CCProfiling.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9AD51181456C100E3C1A2 /* CCProfiling.m */; }; + E6E9AF3B181456C200E3C1A2 /* CCProfiling.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9AD51181456C100E3C1A2 /* CCProfiling.m */; }; + E6E9AF3C181456C200E3C1A2 /* ccUtils.c in Sources */ = {isa = PBXBuildFile; fileRef = E6E9AD52181456C100E3C1A2 /* ccUtils.c */; }; + E6E9AF3D181456C200E3C1A2 /* ccUtils.c in Sources */ = {isa = PBXBuildFile; fileRef = E6E9AD52181456C100E3C1A2 /* ccUtils.c */; }; + E6E9AF3E181456C200E3C1A2 /* ccUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD53181456C100E3C1A2 /* ccUtils.h */; }; + E6E9AF3F181456C200E3C1A2 /* ccUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD53181456C100E3C1A2 /* ccUtils.h */; }; + E6E9AF40181456C200E3C1A2 /* CCVertex.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD54181456C100E3C1A2 /* CCVertex.h */; }; + E6E9AF41181456C200E3C1A2 /* CCVertex.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD54181456C100E3C1A2 /* CCVertex.h */; }; + E6E9AF42181456C200E3C1A2 /* CCVertex.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9AD55181456C100E3C1A2 /* CCVertex.m */; }; + E6E9AF43181456C200E3C1A2 /* CCVertex.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9AD55181456C100E3C1A2 /* CCVertex.m */; }; + E6E9AF44181456C200E3C1A2 /* CGPointExtension.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD56181456C100E3C1A2 /* CGPointExtension.h */; }; + E6E9AF45181456C200E3C1A2 /* CGPointExtension.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD56181456C100E3C1A2 /* CGPointExtension.h */; }; + E6E9AF46181456C200E3C1A2 /* CGPointExtension.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9AD57181456C100E3C1A2 /* CGPointExtension.m */; }; + E6E9AF47181456C200E3C1A2 /* CGPointExtension.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9AD57181456C100E3C1A2 /* CGPointExtension.m */; }; + E6E9AF48181456C200E3C1A2 /* NSAttributedString+CCAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD58181456C100E3C1A2 /* NSAttributedString+CCAdditions.h */; }; + E6E9AF49181456C200E3C1A2 /* NSAttributedString+CCAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD58181456C100E3C1A2 /* NSAttributedString+CCAdditions.h */; }; + E6E9AF4A181456C200E3C1A2 /* NSAttributedString+CCAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9AD59181456C100E3C1A2 /* NSAttributedString+CCAdditions.m */; }; + E6E9AF4B181456C200E3C1A2 /* NSAttributedString+CCAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9AD59181456C100E3C1A2 /* NSAttributedString+CCAdditions.m */; }; + E6E9AF4C181456C200E3C1A2 /* NSThread+performBlock.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD5A181456C100E3C1A2 /* NSThread+performBlock.h */; }; + E6E9AF4D181456C200E3C1A2 /* NSThread+performBlock.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD5A181456C100E3C1A2 /* NSThread+performBlock.h */; }; + E6E9AF4E181456C200E3C1A2 /* NSThread+performBlock.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9AD5B181456C100E3C1A2 /* NSThread+performBlock.m */; }; + E6E9AF4F181456C200E3C1A2 /* NSThread+performBlock.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9AD5B181456C100E3C1A2 /* NSThread+performBlock.m */; }; + E6E9AF50181456C200E3C1A2 /* OpenGL_Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD5C181456C100E3C1A2 /* OpenGL_Internal.h */; }; + E6E9AF51181456C200E3C1A2 /* OpenGL_Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD5C181456C100E3C1A2 /* OpenGL_Internal.h */; }; + E6E9AF52181456C200E3C1A2 /* TGAlib.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD5D181456C100E3C1A2 /* TGAlib.h */; }; + E6E9AF53181456C200E3C1A2 /* TGAlib.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD5D181456C100E3C1A2 /* TGAlib.h */; }; + E6E9AF54181456C200E3C1A2 /* TGAlib.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9AD5E181456C100E3C1A2 /* TGAlib.m */; }; + E6E9AF55181456C200E3C1A2 /* TGAlib.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9AD5E181456C100E3C1A2 /* TGAlib.m */; }; + E6E9AF56181456C200E3C1A2 /* TransformUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD5F181456C100E3C1A2 /* TransformUtils.h */; }; + E6E9AF57181456C200E3C1A2 /* TransformUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD5F181456C100E3C1A2 /* TransformUtils.h */; }; + E6E9AF58181456C200E3C1A2 /* TransformUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9AD60181456C100E3C1A2 /* TransformUtils.m */; }; + E6E9AF59181456C200E3C1A2 /* TransformUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9AD60181456C100E3C1A2 /* TransformUtils.m */; }; + E6E9AF5A181456C200E3C1A2 /* uthash.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD61181456C100E3C1A2 /* uthash.h */; }; + E6E9AF5B181456C200E3C1A2 /* uthash.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD61181456C100E3C1A2 /* uthash.h */; }; + E6E9AF5C181456C200E3C1A2 /* utlist.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD62181456C100E3C1A2 /* utlist.h */; }; + E6E9AF5D181456C200E3C1A2 /* utlist.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD62181456C100E3C1A2 /* utlist.h */; }; + E6E9AF5E181456C200E3C1A2 /* ZipUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD63181456C100E3C1A2 /* ZipUtils.h */; }; + E6E9AF5F181456C200E3C1A2 /* ZipUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD63181456C100E3C1A2 /* ZipUtils.h */; }; + E6E9AF60181456C200E3C1A2 /* ZipUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9AD64181456C100E3C1A2 /* ZipUtils.m */; }; + E6E9AF61181456C200E3C1A2 /* ZipUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9AD64181456C100E3C1A2 /* ZipUtils.m */; }; + E6E9AF62181456C200E3C1A2 /* CCButton.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD66181456C100E3C1A2 /* CCButton.h */; }; + E6E9AF63181456C200E3C1A2 /* CCButton.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD66181456C100E3C1A2 /* CCButton.h */; }; + E6E9AF64181456C200E3C1A2 /* CCButton.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9AD67181456C100E3C1A2 /* CCButton.m */; }; + E6E9AF65181456C200E3C1A2 /* CCButton.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9AD67181456C100E3C1A2 /* CCButton.m */; }; + E6E9AF66181456C200E3C1A2 /* CCControl.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD68181456C100E3C1A2 /* CCControl.h */; }; + E6E9AF67181456C200E3C1A2 /* CCControl.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD68181456C100E3C1A2 /* CCControl.h */; }; + E6E9AF68181456C200E3C1A2 /* CCControl.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9AD69181456C100E3C1A2 /* CCControl.m */; }; + E6E9AF69181456C200E3C1A2 /* CCControl.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9AD69181456C100E3C1A2 /* CCControl.m */; }; + E6E9AF6A181456C200E3C1A2 /* CCControlSubclass.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD6A181456C100E3C1A2 /* CCControlSubclass.h */; }; + E6E9AF6B181456C200E3C1A2 /* CCControlSubclass.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD6A181456C100E3C1A2 /* CCControlSubclass.h */; }; + E6E9AF6C181456C200E3C1A2 /* CCControlTextureFactory.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD6B181456C100E3C1A2 /* CCControlTextureFactory.h */; }; + E6E9AF6D181456C200E3C1A2 /* CCControlTextureFactory.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD6B181456C100E3C1A2 /* CCControlTextureFactory.h */; }; + E6E9AF6E181456C200E3C1A2 /* CCControlTextureFactory.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9AD6C181456C100E3C1A2 /* CCControlTextureFactory.m */; }; + E6E9AF6F181456C200E3C1A2 /* CCControlTextureFactory.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9AD6C181456C100E3C1A2 /* CCControlTextureFactory.m */; }; + E6E9AF70181456C200E3C1A2 /* CCScrollView.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD6D181456C100E3C1A2 /* CCScrollView.h */; }; + E6E9AF71181456C200E3C1A2 /* CCScrollView.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD6D181456C100E3C1A2 /* CCScrollView.h */; }; + E6E9AF72181456C200E3C1A2 /* CCScrollView.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9AD6E181456C100E3C1A2 /* CCScrollView.m */; }; + E6E9AF73181456C200E3C1A2 /* CCScrollView.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9AD6E181456C100E3C1A2 /* CCScrollView.m */; }; + E6E9AF74181456C200E3C1A2 /* CCTableView.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD6F181456C100E3C1A2 /* CCTableView.h */; }; + E6E9AF75181456C200E3C1A2 /* CCTableView.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD6F181456C100E3C1A2 /* CCTableView.h */; }; + E6E9AF76181456C200E3C1A2 /* CCTableView.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9AD70181456C100E3C1A2 /* CCTableView.m */; }; + E6E9AF77181456C200E3C1A2 /* CCTableView.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9AD70181456C100E3C1A2 /* CCTableView.m */; }; + E6E9AF78181456C200E3C1A2 /* cocos2d-ui.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD71181456C100E3C1A2 /* cocos2d-ui.h */; }; + E6E9AF79181456C200E3C1A2 /* cocos2d-ui.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD71181456C100E3C1A2 /* cocos2d-ui.h */; }; + E6E9AF94181456C200E3C1A2 /* aabb.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD84181456C100E3C1A2 /* aabb.h */; }; + E6E9AF95181456C200E3C1A2 /* aabb.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD84181456C100E3C1A2 /* aabb.h */; }; + E6E9AF96181456C200E3C1A2 /* mat4stack.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD86181456C100E3C1A2 /* mat4stack.h */; }; + E6E9AF97181456C200E3C1A2 /* mat4stack.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD86181456C100E3C1A2 /* mat4stack.h */; }; + E6E9AF98181456C200E3C1A2 /* matrix.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD87181456C100E3C1A2 /* matrix.h */; }; + E6E9AF99181456C200E3C1A2 /* matrix.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD87181456C100E3C1A2 /* matrix.h */; }; + E6E9AF9A181456C200E3C1A2 /* kazmath.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD88181456C100E3C1A2 /* kazmath.h */; }; + E6E9AF9B181456C200E3C1A2 /* kazmath.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD88181456C100E3C1A2 /* kazmath.h */; }; + E6E9AF9C181456C200E3C1A2 /* mat3.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD89181456C100E3C1A2 /* mat3.h */; }; + E6E9AF9D181456C200E3C1A2 /* mat3.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD89181456C100E3C1A2 /* mat3.h */; }; + E6E9AF9E181456C200E3C1A2 /* mat4.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD8A181456C100E3C1A2 /* mat4.h */; }; + E6E9AF9F181456C200E3C1A2 /* mat4.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD8A181456C100E3C1A2 /* mat4.h */; }; + E6E9AFA0181456C200E3C1A2 /* neon_matrix_impl.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD8B181456C100E3C1A2 /* neon_matrix_impl.h */; }; + E6E9AFA1181456C200E3C1A2 /* neon_matrix_impl.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD8B181456C100E3C1A2 /* neon_matrix_impl.h */; }; + E6E9AFA2181456C200E3C1A2 /* plane.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD8C181456C100E3C1A2 /* plane.h */; }; + E6E9AFA3181456C200E3C1A2 /* plane.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD8C181456C100E3C1A2 /* plane.h */; }; + E6E9AFA4181456C200E3C1A2 /* quaternion.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD8D181456C100E3C1A2 /* quaternion.h */; }; + E6E9AFA5181456C200E3C1A2 /* quaternion.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD8D181456C100E3C1A2 /* quaternion.h */; }; + E6E9AFA6181456C200E3C1A2 /* ray2.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD8E181456C100E3C1A2 /* ray2.h */; }; + E6E9AFA7181456C200E3C1A2 /* ray2.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD8E181456C100E3C1A2 /* ray2.h */; }; + E6E9AFA8181456C200E3C1A2 /* utility.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD8F181456C100E3C1A2 /* utility.h */; }; + E6E9AFA9181456C200E3C1A2 /* utility.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD8F181456C100E3C1A2 /* utility.h */; }; + E6E9AFAA181456C200E3C1A2 /* vec2.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD90181456C100E3C1A2 /* vec2.h */; }; + E6E9AFAB181456C200E3C1A2 /* vec2.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD90181456C100E3C1A2 /* vec2.h */; }; + E6E9AFAC181456C200E3C1A2 /* vec3.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD91181456C100E3C1A2 /* vec3.h */; }; + E6E9AFAD181456C200E3C1A2 /* vec3.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD91181456C100E3C1A2 /* vec3.h */; }; + E6E9AFAE181456C200E3C1A2 /* vec4.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD92181456C100E3C1A2 /* vec4.h */; }; + E6E9AFAF181456C200E3C1A2 /* vec4.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9AD92181456C100E3C1A2 /* vec4.h */; }; + E6E9AFB0181456C200E3C1A2 /* aabb.c in Sources */ = {isa = PBXBuildFile; fileRef = E6E9AD94181456C100E3C1A2 /* aabb.c */; }; + E6E9AFB1181456C200E3C1A2 /* aabb.c in Sources */ = {isa = PBXBuildFile; fileRef = E6E9AD94181456C100E3C1A2 /* aabb.c */; }; + E6E9AFB2181456C200E3C1A2 /* mat4stack.c in Sources */ = {isa = PBXBuildFile; fileRef = E6E9AD98181456C100E3C1A2 /* mat4stack.c */; }; + E6E9AFB3181456C200E3C1A2 /* mat4stack.c in Sources */ = {isa = PBXBuildFile; fileRef = E6E9AD98181456C100E3C1A2 /* mat4stack.c */; }; + E6E9AFB4181456C200E3C1A2 /* matrix.c in Sources */ = {isa = PBXBuildFile; fileRef = E6E9AD99181456C100E3C1A2 /* matrix.c */; }; + E6E9AFB5181456C200E3C1A2 /* matrix.c in Sources */ = {isa = PBXBuildFile; fileRef = E6E9AD99181456C100E3C1A2 /* matrix.c */; }; + E6E9AFB6181456C200E3C1A2 /* mat3.c in Sources */ = {isa = PBXBuildFile; fileRef = E6E9AD9A181456C100E3C1A2 /* mat3.c */; }; + E6E9AFB7181456C200E3C1A2 /* mat3.c in Sources */ = {isa = PBXBuildFile; fileRef = E6E9AD9A181456C100E3C1A2 /* mat3.c */; }; + E6E9AFB8181456C200E3C1A2 /* mat4.c in Sources */ = {isa = PBXBuildFile; fileRef = E6E9AD9B181456C100E3C1A2 /* mat4.c */; }; + E6E9AFB9181456C200E3C1A2 /* mat4.c in Sources */ = {isa = PBXBuildFile; fileRef = E6E9AD9B181456C100E3C1A2 /* mat4.c */; }; + E6E9AFBA181456C200E3C1A2 /* neon_matrix_impl.c in Sources */ = {isa = PBXBuildFile; fileRef = E6E9AD9C181456C100E3C1A2 /* neon_matrix_impl.c */; }; + E6E9AFBB181456C200E3C1A2 /* neon_matrix_impl.c in Sources */ = {isa = PBXBuildFile; fileRef = E6E9AD9C181456C100E3C1A2 /* neon_matrix_impl.c */; }; + E6E9AFBC181456C200E3C1A2 /* plane.c in Sources */ = {isa = PBXBuildFile; fileRef = E6E9AD9D181456C100E3C1A2 /* plane.c */; }; + E6E9AFBD181456C200E3C1A2 /* plane.c in Sources */ = {isa = PBXBuildFile; fileRef = E6E9AD9D181456C100E3C1A2 /* plane.c */; }; + E6E9AFBE181456C200E3C1A2 /* quaternion.c in Sources */ = {isa = PBXBuildFile; fileRef = E6E9AD9E181456C100E3C1A2 /* quaternion.c */; }; + E6E9AFBF181456C200E3C1A2 /* quaternion.c in Sources */ = {isa = PBXBuildFile; fileRef = E6E9AD9E181456C100E3C1A2 /* quaternion.c */; }; + E6E9AFC0181456C200E3C1A2 /* ray2.c in Sources */ = {isa = PBXBuildFile; fileRef = E6E9AD9F181456C100E3C1A2 /* ray2.c */; }; + E6E9AFC1181456C200E3C1A2 /* ray2.c in Sources */ = {isa = PBXBuildFile; fileRef = E6E9AD9F181456C100E3C1A2 /* ray2.c */; }; + E6E9AFC2181456C200E3C1A2 /* utility.c in Sources */ = {isa = PBXBuildFile; fileRef = E6E9ADA0181456C100E3C1A2 /* utility.c */; }; + E6E9AFC3181456C200E3C1A2 /* utility.c in Sources */ = {isa = PBXBuildFile; fileRef = E6E9ADA0181456C100E3C1A2 /* utility.c */; }; + E6E9AFC4181456C200E3C1A2 /* vec2.c in Sources */ = {isa = PBXBuildFile; fileRef = E6E9ADA1181456C100E3C1A2 /* vec2.c */; }; + E6E9AFC5181456C200E3C1A2 /* vec2.c in Sources */ = {isa = PBXBuildFile; fileRef = E6E9ADA1181456C100E3C1A2 /* vec2.c */; }; + E6E9AFC6181456C200E3C1A2 /* vec3.c in Sources */ = {isa = PBXBuildFile; fileRef = E6E9ADA2181456C100E3C1A2 /* vec3.c */; }; + E6E9AFC7181456C200E3C1A2 /* vec3.c in Sources */ = {isa = PBXBuildFile; fileRef = E6E9ADA2181456C100E3C1A2 /* vec3.c */; }; + E6E9AFC8181456C200E3C1A2 /* vec4.c in Sources */ = {isa = PBXBuildFile; fileRef = E6E9ADA3181456C100E3C1A2 /* vec4.c */; }; + E6E9AFC9181456C200E3C1A2 /* vec4.c in Sources */ = {isa = PBXBuildFile; fileRef = E6E9ADA3181456C100E3C1A2 /* vec4.c */; }; + E6E9AFCA181456C200E3C1A2 /* example.c in Sources */ = {isa = PBXBuildFile; fileRef = E6E9ADA9181456C100E3C1A2 /* example.c */; }; + E6E9AFCB181456C200E3C1A2 /* example.c in Sources */ = {isa = PBXBuildFile; fileRef = E6E9ADA9181456C100E3C1A2 /* example.c */; }; + E6E9AFCC181456C200E3C1A2 /* png.c in Sources */ = {isa = PBXBuildFile; fileRef = E6E9ADB1181456C100E3C1A2 /* png.c */; }; + E6E9AFCD181456C200E3C1A2 /* png.c in Sources */ = {isa = PBXBuildFile; fileRef = E6E9ADB1181456C100E3C1A2 /* png.c */; }; + E6E9AFCE181456C200E3C1A2 /* png.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9ADB2181456C100E3C1A2 /* png.h */; }; + E6E9AFCF181456C200E3C1A2 /* png.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9ADB2181456C100E3C1A2 /* png.h */; }; + E6E9AFD0181456C200E3C1A2 /* pngconf.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9ADB5181456C100E3C1A2 /* pngconf.h */; }; + E6E9AFD1181456C200E3C1A2 /* pngconf.h in Headers */ = {isa = PBXBuildFile; fileRef = E6E9ADB5181456C100E3C1A2 /* pngconf.h */; }; + E6E9AFD2181456C200E3C1A2 /* pngerror.c in Sources */ = {isa = PBXBuildFile; fileRef = E6E9ADB6181456C100E3C1A2 /* pngerror.c */; }; + E6E9AFD3181456C200E3C1A2 /* pngerror.c in Sources */ = {isa = PBXBuildFile; fileRef = E6E9ADB6181456C100E3C1A2 /* pngerror.c */; }; + E6E9AFD4181456C200E3C1A2 /* pnggccrd.c in Sources */ = {isa = PBXBuildFile; fileRef = E6E9ADB7181456C100E3C1A2 /* pnggccrd.c */; }; + E6E9AFD5181456C200E3C1A2 /* pnggccrd.c in Sources */ = {isa = PBXBuildFile; fileRef = E6E9ADB7181456C100E3C1A2 /* pnggccrd.c */; }; + E6E9AFD6181456C200E3C1A2 /* pngget.c in Sources */ = {isa = PBXBuildFile; fileRef = E6E9ADB8181456C100E3C1A2 /* pngget.c */; }; + E6E9AFD7181456C200E3C1A2 /* pngget.c in Sources */ = {isa = PBXBuildFile; fileRef = E6E9ADB8181456C100E3C1A2 /* pngget.c */; }; + E6E9AFD8181456C200E3C1A2 /* pngmem.c in Sources */ = {isa = PBXBuildFile; fileRef = E6E9ADB9181456C100E3C1A2 /* pngmem.c */; }; + E6E9AFD9181456C200E3C1A2 /* pngmem.c in Sources */ = {isa = PBXBuildFile; fileRef = E6E9ADB9181456C100E3C1A2 /* pngmem.c */; }; + E6E9AFDA181456C200E3C1A2 /* pngpread.c in Sources */ = {isa = PBXBuildFile; fileRef = E6E9ADBB181456C100E3C1A2 /* pngpread.c */; }; + E6E9AFDB181456C200E3C1A2 /* pngpread.c in Sources */ = {isa = PBXBuildFile; fileRef = E6E9ADBB181456C100E3C1A2 /* pngpread.c */; }; + E6E9AFDC181456C200E3C1A2 /* pngread.c in Sources */ = {isa = PBXBuildFile; fileRef = E6E9ADBC181456C100E3C1A2 /* pngread.c */; }; + E6E9AFDD181456C200E3C1A2 /* pngread.c in Sources */ = {isa = PBXBuildFile; fileRef = E6E9ADBC181456C100E3C1A2 /* pngread.c */; }; + E6E9AFDE181456C200E3C1A2 /* pngrio.c in Sources */ = {isa = PBXBuildFile; fileRef = E6E9ADBD181456C100E3C1A2 /* pngrio.c */; }; + E6E9AFDF181456C200E3C1A2 /* pngrio.c in Sources */ = {isa = PBXBuildFile; fileRef = E6E9ADBD181456C100E3C1A2 /* pngrio.c */; }; + E6E9AFE0181456C200E3C1A2 /* pngrtran.c in Sources */ = {isa = PBXBuildFile; fileRef = E6E9ADBE181456C100E3C1A2 /* pngrtran.c */; }; + E6E9AFE1181456C200E3C1A2 /* pngrtran.c in Sources */ = {isa = PBXBuildFile; fileRef = E6E9ADBE181456C100E3C1A2 /* pngrtran.c */; }; + E6E9AFE2181456C200E3C1A2 /* pngrutil.c in Sources */ = {isa = PBXBuildFile; fileRef = E6E9ADBF181456C100E3C1A2 /* pngrutil.c */; }; + E6E9AFE3181456C200E3C1A2 /* pngrutil.c in Sources */ = {isa = PBXBuildFile; fileRef = E6E9ADBF181456C100E3C1A2 /* pngrutil.c */; }; + E6E9AFE4181456C200E3C1A2 /* pngset.c in Sources */ = {isa = PBXBuildFile; fileRef = E6E9ADC0181456C100E3C1A2 /* pngset.c */; }; + E6E9AFE5181456C200E3C1A2 /* pngset.c in Sources */ = {isa = PBXBuildFile; fileRef = E6E9ADC0181456C100E3C1A2 /* pngset.c */; }; + E6E9AFE6181456C200E3C1A2 /* pngtest.c in Sources */ = {isa = PBXBuildFile; fileRef = E6E9ADC1181456C100E3C1A2 /* pngtest.c */; }; + E6E9AFE7181456C200E3C1A2 /* pngtest.c in Sources */ = {isa = PBXBuildFile; fileRef = E6E9ADC1181456C100E3C1A2 /* pngtest.c */; }; + E6E9AFE8181456C200E3C1A2 /* pngtrans.c in Sources */ = {isa = PBXBuildFile; fileRef = E6E9ADC3181456C100E3C1A2 /* pngtrans.c */; }; + E6E9AFE9181456C200E3C1A2 /* pngtrans.c in Sources */ = {isa = PBXBuildFile; fileRef = E6E9ADC3181456C100E3C1A2 /* pngtrans.c */; }; + E6E9AFEA181456C200E3C1A2 /* pngvcrd.c in Sources */ = {isa = PBXBuildFile; fileRef = E6E9ADC4181456C100E3C1A2 /* pngvcrd.c */; }; + E6E9AFEB181456C200E3C1A2 /* pngvcrd.c in Sources */ = {isa = PBXBuildFile; fileRef = E6E9ADC4181456C100E3C1A2 /* pngvcrd.c */; }; + E6E9AFEC181456C200E3C1A2 /* pngwio.c in Sources */ = {isa = PBXBuildFile; fileRef = E6E9ADC5181456C100E3C1A2 /* pngwio.c */; }; + E6E9AFED181456C200E3C1A2 /* pngwio.c in Sources */ = {isa = PBXBuildFile; fileRef = E6E9ADC5181456C100E3C1A2 /* pngwio.c */; }; + E6E9AFEE181456C200E3C1A2 /* pngwrite.c in Sources */ = {isa = PBXBuildFile; fileRef = E6E9ADC6181456C100E3C1A2 /* pngwrite.c */; }; + E6E9AFEF181456C200E3C1A2 /* pngwrite.c in Sources */ = {isa = PBXBuildFile; fileRef = E6E9ADC6181456C100E3C1A2 /* pngwrite.c */; }; + E6E9AFF0181456C200E3C1A2 /* pngwtran.c in Sources */ = {isa = PBXBuildFile; fileRef = E6E9ADC7181456C100E3C1A2 /* pngwtran.c */; }; + E6E9AFF1181456C200E3C1A2 /* pngwtran.c in Sources */ = {isa = PBXBuildFile; fileRef = E6E9ADC7181456C100E3C1A2 /* pngwtran.c */; }; + E6E9AFF2181456C200E3C1A2 /* pngwutil.c in Sources */ = {isa = PBXBuildFile; fileRef = E6E9ADC8181456C100E3C1A2 /* pngwutil.c */; }; + E6E9AFF3181456C200E3C1A2 /* pngwutil.c in Sources */ = {isa = PBXBuildFile; fileRef = E6E9ADC8181456C100E3C1A2 /* pngwutil.c */; }; + E6E9B00C1814573700E3C1A2 /* libObjectiveChipmunk.a in Frameworks */ = {isa = PBXBuildFile; fileRef = E6E9B006181456D800E3C1A2 /* libObjectiveChipmunk.a */; }; + E6E9B028181459C700E3C1A2 /* CocosLibMac.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9B0241814599D00E3C1A2 /* CocosLibMac.m */; }; + E6E9B02A181459D600E3C1A2 /* CocosLib.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9B0211814599300E3C1A2 /* CocosLib.m */; }; + E6E9B03018145B0000E3C1A2 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AACBBE490F95108600F1A2B1 /* Foundation.framework */; }; + E6E9B03518145B0000E3C1A2 /* CocosDenshion.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = E6E9B03418145B0000E3C1A2 /* CocosDenshion.h */; }; + E6E9B03718145B0000E3C1A2 /* CocosDenshion.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9B03618145B0000E3C1A2 /* CocosDenshion.m */; }; + E6E9B06318145B2900E3C1A2 /* CDAudioManager.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9B05518145B2900E3C1A2 /* CDAudioManager.m */; }; + E6E9B06418145B2900E3C1A2 /* CDOpenALSupport.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9B05818145B2900E3C1A2 /* CDOpenALSupport.m */; }; + E6E9B06518145B2900E3C1A2 /* CDXMacOSXSupport.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9B05A18145B2900E3C1A2 /* CDXMacOSXSupport.m */; }; + E6E9B06618145B2900E3C1A2 /* CDXPropertyModifierAction.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9B05C18145B2900E3C1A2 /* CDXPropertyModifierAction.m */; }; + E6E9B06718145B2900E3C1A2 /* CocosDenshion.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9B05F18145B2900E3C1A2 /* CocosDenshion.m */; }; + E6E9B06818145B2900E3C1A2 /* SimpleAudioEngine.m in Sources */ = {isa = PBXBuildFile; fileRef = E6E9B06218145B2900E3C1A2 /* SimpleAudioEngine.m */; }; /* End PBXBuildFile section */ +/* Begin PBXContainerItemProxy section */ + E6E9AFFD181456D800E3C1A2 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = E6E9AFF4181456D700E3C1A2 /* Chipmunk7.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = D3E5F0490AA32FDE004E361B; + remoteInfo = ChipmunkDemo; + }; + E6E9AFFF181456D800E3C1A2 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = E6E9AFF4181456D700E3C1A2 /* Chipmunk7.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = D34963BB0B56CAA300CAD239; + remoteInfo = ChipmunkStatic; + }; + E6E9B001181456D800E3C1A2 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = E6E9AFF4181456D700E3C1A2 /* Chipmunk7.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = D3C3787A11063B1B003EF1D9; + remoteInfo = "ChipmunkStatic-iPhone"; + }; + E6E9B003181456D800E3C1A2 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = E6E9AFF4181456D700E3C1A2 /* Chipmunk7.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = D39ECD8617ED70D900319DBA; + remoteInfo = "Benchmark iPhone"; + }; + E6E9B005181456D800E3C1A2 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = E6E9AFF4181456D700E3C1A2 /* Chipmunk7.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = D309B21317EFE2EF00AA52C8; + remoteInfo = ObjectiveChipmunk; + }; + E6E9B007181456D800E3C1A2 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = E6E9AFF4181456D700E3C1A2 /* Chipmunk7.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = D309B22017EFE2EF00AA52C8; + remoteInfo = ObjectiveChipmunkTests; + }; + E6E9B0091814570D00E3C1A2 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = E6E9AFF4181456D700E3C1A2 /* Chipmunk7.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = D309B21217EFE2EF00AA52C8; + remoteInfo = ObjectiveChipmunk; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXCopyFilesBuildPhase section */ + E6E9B02D18145B0000E3C1A2 /* CopyFiles */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "include/$(PRODUCT_NAME)"; + dstSubfolderSpec = 16; + files = ( + E6E9B03518145B0000E3C1A2 /* CocosDenshion.h in CopyFiles */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + /* Begin PBXFileReference section */ AACBBE490F95108600F1A2B1 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; - E610368015DD169B00819640 /* b2BroadPhase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = b2BroadPhase.cpp; sourceTree = ""; }; - E610368115DD169B00819640 /* b2CollideCircle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = b2CollideCircle.cpp; sourceTree = ""; }; - E610368215DD169B00819640 /* b2CollideEdge.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = b2CollideEdge.cpp; sourceTree = ""; }; - E610368315DD169B00819640 /* b2CollidePolygon.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = b2CollidePolygon.cpp; sourceTree = ""; }; - E610368415DD169B00819640 /* b2Collision.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = b2Collision.cpp; sourceTree = ""; }; - E610368515DD169B00819640 /* b2Distance.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = b2Distance.cpp; sourceTree = ""; }; - E610368615DD169B00819640 /* b2DynamicTree.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = b2DynamicTree.cpp; sourceTree = ""; }; - E610368715DD169B00819640 /* b2TimeOfImpact.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = b2TimeOfImpact.cpp; sourceTree = ""; }; - E610368915DD169B00819640 /* b2ChainShape.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = b2ChainShape.cpp; sourceTree = ""; }; - E610368A15DD169B00819640 /* b2CircleShape.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = b2CircleShape.cpp; sourceTree = ""; }; - E610368B15DD169B00819640 /* b2EdgeShape.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = b2EdgeShape.cpp; sourceTree = ""; }; - E610368C15DD169B00819640 /* b2PolygonShape.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = b2PolygonShape.cpp; sourceTree = ""; }; - E610368E15DD169B00819640 /* b2BlockAllocator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = b2BlockAllocator.cpp; sourceTree = ""; }; - E610368F15DD169B00819640 /* b2Draw.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = b2Draw.cpp; sourceTree = ""; }; - E610369015DD169B00819640 /* b2Math.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = b2Math.cpp; sourceTree = ""; }; - E610369115DD169B00819640 /* b2Settings.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = b2Settings.cpp; sourceTree = ""; }; - E610369215DD169B00819640 /* b2StackAllocator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = b2StackAllocator.cpp; sourceTree = ""; }; - E610369315DD169B00819640 /* b2Timer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = b2Timer.cpp; sourceTree = ""; }; - E610369515DD169B00819640 /* b2Body.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = b2Body.cpp; sourceTree = ""; }; - E610369615DD169B00819640 /* b2ContactManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = b2ContactManager.cpp; sourceTree = ""; }; - E610369715DD169B00819640 /* b2Fixture.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = b2Fixture.cpp; sourceTree = ""; }; - E610369815DD169B00819640 /* b2Island.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = b2Island.cpp; sourceTree = ""; }; - E610369915DD169B00819640 /* b2World.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = b2World.cpp; sourceTree = ""; }; - E610369A15DD169B00819640 /* b2WorldCallbacks.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = b2WorldCallbacks.cpp; sourceTree = ""; }; - E610369C15DD169B00819640 /* b2ChainAndCircleContact.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = b2ChainAndCircleContact.cpp; sourceTree = ""; }; - E610369D15DD169B00819640 /* b2ChainAndPolygonContact.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = b2ChainAndPolygonContact.cpp; sourceTree = ""; }; - E610369E15DD169B00819640 /* b2CircleContact.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = b2CircleContact.cpp; sourceTree = ""; }; - E610369F15DD169B00819640 /* b2Contact.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = b2Contact.cpp; sourceTree = ""; }; - E61036A015DD169B00819640 /* b2ContactSolver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = b2ContactSolver.cpp; sourceTree = ""; }; - E61036A115DD169B00819640 /* b2EdgeAndCircleContact.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = b2EdgeAndCircleContact.cpp; sourceTree = ""; }; - E61036A215DD169B00819640 /* b2EdgeAndPolygonContact.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = b2EdgeAndPolygonContact.cpp; sourceTree = ""; }; - E61036A315DD169B00819640 /* b2PolygonAndCircleContact.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = b2PolygonAndCircleContact.cpp; sourceTree = ""; }; - E61036A415DD169B00819640 /* b2PolygonContact.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = b2PolygonContact.cpp; sourceTree = ""; }; - E61036A615DD169B00819640 /* b2DistanceJoint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = b2DistanceJoint.cpp; sourceTree = ""; }; - E61036A715DD169B00819640 /* b2FrictionJoint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = b2FrictionJoint.cpp; sourceTree = ""; }; - E61036A815DD169B00819640 /* b2GearJoint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = b2GearJoint.cpp; sourceTree = ""; }; - E61036A915DD169B00819640 /* b2Joint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = b2Joint.cpp; sourceTree = ""; }; - E61036AA15DD169B00819640 /* b2MotorJoint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = b2MotorJoint.cpp; sourceTree = ""; }; - E61036AB15DD169B00819640 /* b2MouseJoint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = b2MouseJoint.cpp; sourceTree = ""; }; - E61036AC15DD169B00819640 /* b2PrismaticJoint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = b2PrismaticJoint.cpp; sourceTree = ""; }; - E61036AD15DD169B00819640 /* b2PulleyJoint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = b2PulleyJoint.cpp; sourceTree = ""; }; - E61036AE15DD169B00819640 /* b2RevoluteJoint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = b2RevoluteJoint.cpp; sourceTree = ""; }; - E61036AF15DD169B00819640 /* b2RopeJoint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = b2RopeJoint.cpp; sourceTree = ""; }; - E61036B015DD169B00819640 /* b2WeldJoint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = b2WeldJoint.cpp; sourceTree = ""; }; - E61036B115DD169B00819640 /* b2WheelJoint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = b2WheelJoint.cpp; sourceTree = ""; }; - E61036B315DD169B00819640 /* b2Rope.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = b2Rope.cpp; sourceTree = ""; }; - E61036B515DD169B00819640 /* CCAction.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCAction.m; sourceTree = ""; }; - E61036B615DD169B00819640 /* CCActionCamera.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCActionCamera.m; sourceTree = ""; }; - E61036B715DD169B00819640 /* CCActionCatmullRom.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCActionCatmullRom.m; sourceTree = ""; }; - E61036B815DD169B00819640 /* CCActionEase.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCActionEase.m; sourceTree = ""; }; - E61036B915DD169B00819640 /* CCActionGrid.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCActionGrid.m; sourceTree = ""; }; - E61036BA15DD169B00819640 /* CCActionGrid3D.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCActionGrid3D.m; sourceTree = ""; }; - E61036BB15DD169B00819640 /* CCActionInstant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCActionInstant.m; sourceTree = ""; }; - E61036BC15DD169B00819640 /* CCActionInterval.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCActionInterval.m; sourceTree = ""; }; - E61036BD15DD169B00819640 /* CCActionManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCActionManager.m; sourceTree = ""; }; - E61036BE15DD169B00819640 /* CCActionPageTurn3D.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCActionPageTurn3D.m; sourceTree = ""; }; - E61036BF15DD169B00819640 /* CCActionProgressTimer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCActionProgressTimer.m; sourceTree = ""; }; - E61036C015DD169B00819640 /* CCActionTiledGrid.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCActionTiledGrid.m; sourceTree = ""; }; - E61036C115DD169B00819640 /* CCActionTween.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCActionTween.m; sourceTree = ""; }; - E61036C215DD169B00819640 /* CCAnimation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCAnimation.m; sourceTree = ""; }; - E61036C315DD169B00819640 /* CCAnimationCache.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCAnimationCache.m; sourceTree = ""; }; - E61036C415DD169B00819640 /* CCAtlasNode.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCAtlasNode.m; sourceTree = ""; }; - E61036C515DD169B00819640 /* CCCamera.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCCamera.m; sourceTree = ""; }; - E61036C615DD169B00819640 /* CCConfiguration.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCConfiguration.m; sourceTree = ""; }; - E61036C715DD169B00819640 /* ccDeprecated.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ccDeprecated.m; sourceTree = ""; }; - E61036C815DD169B00819640 /* CCDirector.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCDirector.m; sourceTree = ""; }; - E61036C915DD169B00819640 /* CCDrawingPrimitives.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCDrawingPrimitives.m; sourceTree = ""; }; - E61036CA15DD169B00819640 /* CCGLProgram.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCGLProgram.m; sourceTree = ""; }; - E61036CB15DD169B00819640 /* ccGLStateCache.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ccGLStateCache.m; sourceTree = ""; }; - E61036CC15DD169B00819640 /* CCGrabber.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCGrabber.m; sourceTree = ""; }; - E61036CD15DD169B00819640 /* CCGrid.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCGrid.m; sourceTree = ""; }; - E61036CE15DD169B00819640 /* CCLabelAtlas.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCLabelAtlas.m; sourceTree = ""; }; - E61036CF15DD169B00819640 /* CCLabelBMFont.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCLabelBMFont.m; sourceTree = ""; }; - E61036D015DD169B00819640 /* CCLabelTTF.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCLabelTTF.m; sourceTree = ""; }; - E61036D115DD169B00819640 /* CCLayer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCLayer.m; sourceTree = ""; }; - E61036D215DD169B00819640 /* CCMenu.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCMenu.m; sourceTree = ""; }; - E61036D315DD169B00819640 /* CCMenuItem.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCMenuItem.m; sourceTree = ""; }; - E61036D415DD169B00819640 /* CCMotionStreak.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCMotionStreak.m; sourceTree = ""; }; - E61036D515DD169B00819640 /* CCNode+Debug.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "CCNode+Debug.m"; sourceTree = ""; }; - E61036D615DD169B00819640 /* CCNode.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCNode.m; sourceTree = ""; }; - E61036D715DD169B00819640 /* CCParallaxNode.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCParallaxNode.m; sourceTree = ""; }; - E61036D815DD169B00819640 /* CCParticleBatchNode.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCParticleBatchNode.m; sourceTree = ""; }; - E61036D915DD169B00819640 /* CCParticleSystem.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCParticleSystem.m; sourceTree = ""; }; - E61036DA15DD169B00819640 /* CCParticleSystemQuad.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCParticleSystemQuad.m; sourceTree = ""; }; - E61036DB15DD169B00819640 /* CCProgressTimer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCProgressTimer.m; sourceTree = ""; }; - E61036DC15DD169B00819640 /* CCRenderTexture.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCRenderTexture.m; sourceTree = ""; }; - E61036DD15DD169B00819640 /* CCScene.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCScene.m; sourceTree = ""; }; - E61036DE15DD169B00819640 /* CCScheduler.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCScheduler.m; sourceTree = ""; }; - E61036DF15DD169B00819640 /* CCShaderCache.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCShaderCache.m; sourceTree = ""; }; - E61036E015DD169B00819640 /* ccShaders.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ccShaders.m; sourceTree = ""; }; - E61036E115DD169B00819640 /* CCSprite.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCSprite.m; sourceTree = ""; }; - E61036E215DD169B00819640 /* CCSpriteBatchNode.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCSpriteBatchNode.m; sourceTree = ""; }; - E61036E315DD169B00819640 /* CCSpriteFrame.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCSpriteFrame.m; sourceTree = ""; }; - E61036E415DD169B00819640 /* CCSpriteFrameCache.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCSpriteFrameCache.m; sourceTree = ""; }; - E61036E515DD169B00819640 /* CCTexture2D.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCTexture2D.m; sourceTree = ""; }; - E61036E615DD169B00819640 /* CCTextureAtlas.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCTextureAtlas.m; sourceTree = ""; }; - E61036E715DD169B00819640 /* CCTextureCache.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCTextureCache.m; sourceTree = ""; }; - E61036E815DD169B00819640 /* CCTexturePVR.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCTexturePVR.m; sourceTree = ""; }; - E61036E915DD169B00819640 /* CCTileMapAtlas.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCTileMapAtlas.m; sourceTree = ""; }; - E61036EA15DD169B00819640 /* CCTMXLayer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCTMXLayer.m; sourceTree = ""; }; - E61036EB15DD169B00819640 /* CCTMXObjectGroup.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCTMXObjectGroup.m; sourceTree = ""; }; - E61036EC15DD169B00819640 /* CCTMXTiledMap.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCTMXTiledMap.m; sourceTree = ""; }; - E61036ED15DD169B00819640 /* CCTMXXMLParser.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCTMXXMLParser.m; sourceTree = ""; }; - E61036EE15DD169B00819640 /* CCTransition.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCTransition.m; sourceTree = ""; }; - E61036EF15DD169B00819640 /* CCTransitionPageTurn.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCTransitionPageTurn.m; sourceTree = ""; }; - E61036F015DD169B00819640 /* CCTransitionProgress.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCTransitionProgress.m; sourceTree = ""; }; - E61036F115DD169B00819640 /* cocos2d.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = cocos2d.m; sourceTree = ""; }; - E61036F415DD169B00819640 /* CCDirectorIOS.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCDirectorIOS.m; sourceTree = ""; }; - E61036F515DD169B00819640 /* CCES2Renderer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCES2Renderer.m; sourceTree = ""; }; - E61036F615DD169B00819640 /* CCGLView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCGLView.m; sourceTree = ""; }; - E61036F715DD169B00819640 /* CCTouchDispatcher.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCTouchDispatcher.m; sourceTree = ""; }; - E61036F815DD169B00819640 /* CCTouchHandler.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCTouchHandler.m; sourceTree = ""; }; - E61036FA15DD169B00819640 /* CCDirectorMac.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCDirectorMac.m; sourceTree = ""; }; - E61036FB15DD169B00819640 /* CCEventDispatcher.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCEventDispatcher.m; sourceTree = ""; }; - E61036FC15DD169B00819640 /* CCGLView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCGLView.m; sourceTree = ""; }; - E61036FD15DD169B00819640 /* CCWindow.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCWindow.m; sourceTree = ""; }; - E61036FF15DD169B00819640 /* base64.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = base64.c; sourceTree = ""; }; - E610370015DD169B00819640 /* CCArray.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCArray.m; sourceTree = ""; }; - E610370115DD169B00819640 /* ccCArray.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ccCArray.m; sourceTree = ""; }; - E610370215DD169B00819640 /* CCFileUtils.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCFileUtils.m; sourceTree = ""; }; - E610370315DD169B00819640 /* CCProfiling.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCProfiling.m; sourceTree = ""; }; - E610370415DD169B00819640 /* ccUtils.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ccUtils.c; sourceTree = ""; }; - E610370515DD169B00819640 /* CCVertex.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCVertex.m; sourceTree = ""; }; - E610370615DD169B00819640 /* CGPointExtension.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CGPointExtension.m; sourceTree = ""; }; - E610370715DD169B00819640 /* NSThread+performBlock.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSThread+performBlock.m"; sourceTree = ""; }; - E610370815DD169B00819640 /* TGAlib.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TGAlib.m; sourceTree = ""; }; - E610370915DD169B00819640 /* TransformUtils.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TransformUtils.m; sourceTree = ""; }; - E610370A15DD169B00819640 /* ZipUtils.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ZipUtils.m; sourceTree = ""; }; - E610370C15DD169B00819640 /* CDAudioManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDAudioManager.m; sourceTree = ""; }; - E610370D15DD169B00819640 /* CDOpenALSupport.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDOpenALSupport.m; sourceTree = ""; }; - E610370E15DD169B00819640 /* CocosDenshion.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CocosDenshion.m; sourceTree = ""; }; - E610370F15DD169B00819640 /* SimpleAudioEngine.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SimpleAudioEngine.m; sourceTree = ""; }; - E610371115DD169B00819640 /* CDXMacOSXSupport.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDXMacOSXSupport.m; sourceTree = ""; }; - E610371215DD169B00819640 /* CDXPropertyModifierAction.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDXPropertyModifierAction.m; sourceTree = ""; }; - E610371415DD169B00819640 /* aabb.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = aabb.c; sourceTree = ""; }; - E610371515DD169B00819640 /* ChangeLog */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ChangeLog; sourceTree = ""; }; - E610371715DD169B00819640 /* mat4stack.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = mat4stack.c; sourceTree = ""; }; - E610371815DD169B00819640 /* matrix.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = matrix.c; sourceTree = ""; }; - E610371915DD169B00819640 /* mat3.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = mat3.c; sourceTree = ""; }; - E610371A15DD169B00819640 /* mat4.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = mat4.c; sourceTree = ""; }; - E610371B15DD169B00819640 /* neon_matrix_impl.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = neon_matrix_impl.c; sourceTree = ""; }; - E610371C15DD169B00819640 /* plane.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = plane.c; sourceTree = ""; }; - E610371D15DD169B00819640 /* quaternion.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = quaternion.c; sourceTree = ""; }; - E610371E15DD169B00819640 /* ray2.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ray2.c; sourceTree = ""; }; - E610371F15DD169B00819640 /* utility.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = utility.c; sourceTree = ""; }; - E610372015DD169B00819640 /* vec2.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = vec2.c; sourceTree = ""; }; - E610372115DD169B00819640 /* vec3.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = vec3.c; sourceTree = ""; }; - E610372215DD169B00819640 /* vec4.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = vec4.c; sourceTree = ""; }; - E610372415DD169B00819640 /* png.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = png.c; sourceTree = ""; }; - E610372515DD169B00819640 /* pngerror.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = pngerror.c; sourceTree = ""; }; - E610372615DD169B00819640 /* pnggccrd.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = pnggccrd.c; sourceTree = ""; }; - E610372715DD169B00819640 /* pngget.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = pngget.c; sourceTree = ""; }; - E610372815DD169B00819640 /* pngmem.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = pngmem.c; sourceTree = ""; }; - E610372915DD169B00819640 /* pngnow.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = pngnow.png; sourceTree = ""; }; - E610372A15DD169B00819640 /* pngpread.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = pngpread.c; sourceTree = ""; }; - E610372B15DD169B00819640 /* pngread.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = pngread.c; sourceTree = ""; }; - E610372C15DD169B00819640 /* pngrio.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = pngrio.c; sourceTree = ""; }; - E610372D15DD169B00819640 /* pngrtran.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = pngrtran.c; sourceTree = ""; }; - E610372E15DD169B00819640 /* pngrutil.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = pngrutil.c; sourceTree = ""; }; - E610372F15DD169B00819640 /* pngset.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = pngset.c; sourceTree = ""; }; - E610373015DD169B00819640 /* pngtrans.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = pngtrans.c; sourceTree = ""; }; - E610373115DD169B00819640 /* pngvcrd.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = pngvcrd.c; sourceTree = ""; }; - E610373215DD169B00819640 /* pngwio.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = pngwio.c; sourceTree = ""; }; - E610373315DD169B00819640 /* pngwrite.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = pngwrite.c; sourceTree = ""; }; - E610373415DD169B00819640 /* pngwtran.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = pngwtran.c; sourceTree = ""; }; - E610373515DD169B00819640 /* pngwutil.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = pngwutil.c; sourceTree = ""; }; - E610373615DD169B00819640 /* README */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = README; sourceTree = ""; }; - E610373715DD169B00819640 /* TODO */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = TODO; sourceTree = ""; }; - E610373815DD169B00819640 /* Y2KINFO */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Y2KINFO; sourceTree = ""; }; - E610373B15DD169B00819640 /* Box2D.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Box2D.h; sourceTree = ""; }; - E610373D15DD169B00819640 /* b2BroadPhase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2BroadPhase.h; sourceTree = ""; }; - E610373E15DD169B00819640 /* b2Collision.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2Collision.h; sourceTree = ""; }; - E610373F15DD169B00819640 /* b2Distance.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2Distance.h; sourceTree = ""; }; - E610374015DD169B00819640 /* b2DynamicTree.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2DynamicTree.h; sourceTree = ""; }; - E610374115DD169B00819640 /* b2TimeOfImpact.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2TimeOfImpact.h; sourceTree = ""; }; - E610374315DD169B00819640 /* b2ChainShape.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2ChainShape.h; sourceTree = ""; }; - E610374415DD169B00819640 /* b2CircleShape.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2CircleShape.h; sourceTree = ""; }; - E610374515DD169B00819640 /* b2EdgeShape.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2EdgeShape.h; sourceTree = ""; }; - E610374615DD169B00819640 /* b2PolygonShape.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2PolygonShape.h; sourceTree = ""; }; - E610374715DD169B00819640 /* b2Shape.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2Shape.h; sourceTree = ""; }; - E610374915DD169B00819640 /* b2BlockAllocator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2BlockAllocator.h; sourceTree = ""; }; - E610374A15DD169B00819640 /* b2Draw.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2Draw.h; sourceTree = ""; }; - E610374B15DD169B00819640 /* b2GrowableStack.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2GrowableStack.h; sourceTree = ""; }; - E610374C15DD169B00819640 /* b2Math.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2Math.h; sourceTree = ""; }; - E610374D15DD169B00819640 /* b2Settings.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2Settings.h; sourceTree = ""; }; - E610374E15DD169B00819640 /* b2StackAllocator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2StackAllocator.h; sourceTree = ""; }; - E610374F15DD169B00819640 /* b2Timer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2Timer.h; sourceTree = ""; }; - E610375115DD169B00819640 /* b2Body.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2Body.h; sourceTree = ""; }; - E610375215DD169B00819640 /* b2ContactManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2ContactManager.h; sourceTree = ""; }; - E610375315DD169B00819640 /* b2Fixture.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2Fixture.h; sourceTree = ""; }; - E610375415DD169B00819640 /* b2Island.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2Island.h; sourceTree = ""; }; - E610375515DD169B00819640 /* b2TimeStep.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2TimeStep.h; sourceTree = ""; }; - E610375615DD169B00819640 /* b2World.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2World.h; sourceTree = ""; }; - E610375715DD169B00819640 /* b2WorldCallbacks.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2WorldCallbacks.h; sourceTree = ""; }; - E610375915DD169B00819640 /* b2ChainAndCircleContact.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2ChainAndCircleContact.h; sourceTree = ""; }; - E610375A15DD169B00819640 /* b2ChainAndPolygonContact.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2ChainAndPolygonContact.h; sourceTree = ""; }; - E610375B15DD169B00819640 /* b2CircleContact.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2CircleContact.h; sourceTree = ""; }; - E610375C15DD169B00819640 /* b2Contact.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2Contact.h; sourceTree = ""; }; - E610375D15DD169B00819640 /* b2ContactSolver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2ContactSolver.h; sourceTree = ""; }; - E610375E15DD169B00819640 /* b2EdgeAndCircleContact.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2EdgeAndCircleContact.h; sourceTree = ""; }; - E610375F15DD169B00819640 /* b2EdgeAndPolygonContact.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2EdgeAndPolygonContact.h; sourceTree = ""; }; - E610376015DD169B00819640 /* b2PolygonAndCircleContact.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2PolygonAndCircleContact.h; sourceTree = ""; }; - E610376115DD169B00819640 /* b2PolygonContact.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2PolygonContact.h; sourceTree = ""; }; - E610376315DD169B00819640 /* b2DistanceJoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2DistanceJoint.h; sourceTree = ""; }; - E610376415DD169B00819640 /* b2FrictionJoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2FrictionJoint.h; sourceTree = ""; }; - E610376515DD169B00819640 /* b2GearJoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2GearJoint.h; sourceTree = ""; }; - E610376615DD169B00819640 /* b2Joint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2Joint.h; sourceTree = ""; }; - E610376715DD169B00819640 /* b2MotorJoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2MotorJoint.h; sourceTree = ""; }; - E610376815DD169B00819640 /* b2MouseJoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2MouseJoint.h; sourceTree = ""; }; - E610376915DD169B00819640 /* b2PrismaticJoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2PrismaticJoint.h; sourceTree = ""; }; - E610376A15DD169B00819640 /* b2PulleyJoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2PulleyJoint.h; sourceTree = ""; }; - E610376B15DD169B00819640 /* b2RevoluteJoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2RevoluteJoint.h; sourceTree = ""; }; - E610376C15DD169B00819640 /* b2RopeJoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2RopeJoint.h; sourceTree = ""; }; - E610376D15DD169B00819640 /* b2WeldJoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2WeldJoint.h; sourceTree = ""; }; - E610376E15DD169B00819640 /* b2WheelJoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2WheelJoint.h; sourceTree = ""; }; - E610377015DD169B00819640 /* b2Rope.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = b2Rope.h; sourceTree = ""; }; - E610377215DD169B00819640 /* CCAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCAction.h; sourceTree = ""; }; - E610377315DD169B00819640 /* CCActionCamera.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCActionCamera.h; sourceTree = ""; }; - E610377415DD169B00819640 /* CCActionCatmullRom.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCActionCatmullRom.h; sourceTree = ""; }; - E610377515DD169B00819640 /* CCActionEase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCActionEase.h; sourceTree = ""; }; - E610377615DD169B00819640 /* CCActionGrid.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCActionGrid.h; sourceTree = ""; }; - E610377715DD169B00819640 /* CCActionGrid3D.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCActionGrid3D.h; sourceTree = ""; }; - E610377815DD169B00819640 /* CCActionInstant.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCActionInstant.h; sourceTree = ""; }; - E610377915DD169B00819640 /* CCActionInterval.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCActionInterval.h; sourceTree = ""; }; - E610377A15DD169B00819640 /* CCActionManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCActionManager.h; sourceTree = ""; }; - E610377B15DD169B00819640 /* CCActionPageTurn3D.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCActionPageTurn3D.h; sourceTree = ""; }; - E610377C15DD169B00819640 /* CCActionProgressTimer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCActionProgressTimer.h; sourceTree = ""; }; - E610377D15DD169B00819640 /* CCActionTiledGrid.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCActionTiledGrid.h; sourceTree = ""; }; - E610377E15DD169B00819640 /* CCActionTween.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCActionTween.h; sourceTree = ""; }; - E610377F15DD169B00819640 /* CCAnimation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCAnimation.h; sourceTree = ""; }; - E610378015DD169B00819640 /* CCAnimationCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCAnimationCache.h; sourceTree = ""; }; - E610378115DD169B00819640 /* CCAtlasNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCAtlasNode.h; sourceTree = ""; }; - E610378215DD169B00819640 /* CCCamera.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCCamera.h; sourceTree = ""; }; - E610378315DD169B00819640 /* ccConfig.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ccConfig.h; sourceTree = ""; }; - E610378415DD169B00819640 /* CCConfiguration.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCConfiguration.h; sourceTree = ""; }; - E610378515DD169B00819640 /* ccDeprecated.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ccDeprecated.h; sourceTree = ""; }; - E610378615DD169B00819640 /* CCDirector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCDirector.h; sourceTree = ""; }; - E610378715DD169B00819640 /* CCDrawingPrimitives.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCDrawingPrimitives.h; sourceTree = ""; }; - E610378815DD169B00819640 /* CCGLProgram.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCGLProgram.h; sourceTree = ""; }; - E610378915DD169B00819640 /* ccGLStateCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ccGLStateCache.h; sourceTree = ""; }; - E610378A15DD169B00819640 /* CCGrabber.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCGrabber.h; sourceTree = ""; }; - E610378B15DD169B00819640 /* CCGrid.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCGrid.h; sourceTree = ""; }; - E610378C15DD169B00819640 /* CCLabelAtlas.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCLabelAtlas.h; sourceTree = ""; }; - E610378D15DD169B00819640 /* CCLabelBMFont.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCLabelBMFont.h; sourceTree = ""; }; - E610378E15DD169B00819640 /* CCLabelTTF.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCLabelTTF.h; sourceTree = ""; }; - E610378F15DD169B00819640 /* CCLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCLayer.h; sourceTree = ""; }; - E610379015DD169B00819640 /* ccMacros.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ccMacros.h; sourceTree = ""; }; - E610379115DD169B00819640 /* CCMenu.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCMenu.h; sourceTree = ""; }; - E610379215DD169B00819640 /* CCMenuItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCMenuItem.h; sourceTree = ""; }; - E610379315DD169B00819640 /* CCMotionStreak.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCMotionStreak.h; sourceTree = ""; }; - E610379415DD169B00819640 /* CCNode+Debug.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "CCNode+Debug.h"; sourceTree = ""; }; - E610379515DD169B00819640 /* CCNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCNode.h; sourceTree = ""; }; - E610379615DD169B00819640 /* CCParallaxNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCParallaxNode.h; sourceTree = ""; }; - E610379715DD169B00819640 /* CCParticleBatchNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCParticleBatchNode.h; sourceTree = ""; }; - E610379815DD169B00819640 /* CCParticleSystem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCParticleSystem.h; sourceTree = ""; }; - E610379915DD169B00819640 /* CCParticleSystemQuad.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCParticleSystemQuad.h; sourceTree = ""; }; - E610379A15DD169B00819640 /* CCProgressTimer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCProgressTimer.h; sourceTree = ""; }; - E610379B15DD169B00819640 /* CCProtocols.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCProtocols.h; sourceTree = ""; }; - E610379C15DD169B00819640 /* CCRenderTexture.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCRenderTexture.h; sourceTree = ""; }; - E610379D15DD169B00819640 /* CCScene.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCScene.h; sourceTree = ""; }; - E610379E15DD169B00819640 /* CCScheduler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCScheduler.h; sourceTree = ""; }; - E610379F15DD169B00819640 /* ccShader_Position_uColor_frag.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ccShader_Position_uColor_frag.h; sourceTree = ""; }; - E61037A015DD169B00819640 /* ccShader_Position_uColor_vert.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ccShader_Position_uColor_vert.h; sourceTree = ""; }; - E61037A115DD169B00819640 /* ccShader_PositionColor_frag.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ccShader_PositionColor_frag.h; sourceTree = ""; }; - E61037A215DD169B00819640 /* ccShader_PositionColor_vert.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ccShader_PositionColor_vert.h; sourceTree = ""; }; - E61037A315DD169B00819640 /* ccShader_PositionTexture_frag.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ccShader_PositionTexture_frag.h; sourceTree = ""; }; - E61037A415DD169B00819640 /* ccShader_PositionTexture_uColor_frag.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ccShader_PositionTexture_uColor_frag.h; sourceTree = ""; }; - E61037A515DD169B00819640 /* ccShader_PositionTexture_uColor_vert.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ccShader_PositionTexture_uColor_vert.h; sourceTree = ""; }; - E61037A615DD169B00819640 /* ccShader_PositionTexture_vert.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ccShader_PositionTexture_vert.h; sourceTree = ""; }; - E61037A715DD169B00819640 /* ccShader_PositionTextureA8Color_frag.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ccShader_PositionTextureA8Color_frag.h; sourceTree = ""; }; - E61037A815DD169B00819640 /* ccShader_PositionTextureA8Color_vert.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ccShader_PositionTextureA8Color_vert.h; sourceTree = ""; }; - E61037A915DD169B00819640 /* ccShader_PositionTextureColor_frag.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ccShader_PositionTextureColor_frag.h; sourceTree = ""; }; - E61037AA15DD169B00819640 /* ccShader_PositionTextureColor_vert.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ccShader_PositionTextureColor_vert.h; sourceTree = ""; }; - E61037AB15DD169B00819640 /* ccShader_PositionTextureColorAlphaTest_frag.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ccShader_PositionTextureColorAlphaTest_frag.h; sourceTree = ""; }; - E61037AC15DD169B00819640 /* CCShaderCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCShaderCache.h; sourceTree = ""; }; - E61037AD15DD169B00819640 /* ccShaders.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ccShaders.h; sourceTree = ""; }; - E61037AE15DD169B00819640 /* CCSprite.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCSprite.h; sourceTree = ""; }; - E61037AF15DD169B00819640 /* CCSpriteBatchNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCSpriteBatchNode.h; sourceTree = ""; }; - E61037B015DD169B00819640 /* CCSpriteFrame.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCSpriteFrame.h; sourceTree = ""; }; - E61037B115DD169B00819640 /* CCSpriteFrameCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCSpriteFrameCache.h; sourceTree = ""; }; - E61037B215DD169B00819640 /* CCTexture2D.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCTexture2D.h; sourceTree = ""; }; - E61037B315DD169B00819640 /* CCTextureAtlas.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCTextureAtlas.h; sourceTree = ""; }; - E61037B415DD169B00819640 /* CCTextureCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCTextureCache.h; sourceTree = ""; }; - E61037B515DD169B00819640 /* CCTexturePVR.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCTexturePVR.h; sourceTree = ""; }; - E61037B615DD169B00819640 /* CCTileMapAtlas.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCTileMapAtlas.h; sourceTree = ""; }; - E61037B715DD169B00819640 /* CCTMXLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCTMXLayer.h; sourceTree = ""; }; - E61037B815DD169B00819640 /* CCTMXObjectGroup.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCTMXObjectGroup.h; sourceTree = ""; }; - E61037B915DD169B00819640 /* CCTMXTiledMap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCTMXTiledMap.h; sourceTree = ""; }; - E61037BA15DD169B00819640 /* CCTMXXMLParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCTMXXMLParser.h; sourceTree = ""; }; - E61037BB15DD169B00819640 /* CCTransition.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCTransition.h; sourceTree = ""; }; - E61037BC15DD169B00819640 /* CCTransitionOrientationType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCTransitionOrientationType.h; sourceTree = ""; }; - E61037BD15DD169B00819640 /* CCTransitionPageTurn.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCTransitionPageTurn.h; sourceTree = ""; }; - E61037BE15DD169B00819640 /* CCTransitionProgress.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCTransitionProgress.h; sourceTree = ""; }; - E61037BF15DD169B00819640 /* ccTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ccTypes.h; sourceTree = ""; }; - E61037C015DD169B00819640 /* cocos2d.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cocos2d.h; sourceTree = ""; }; - E61037C215DD169B00819640 /* CCGL.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCGL.h; sourceTree = ""; }; - E61037C315DD169B00819640 /* CCNS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCNS.h; sourceTree = ""; }; - E61037C515DD169B00819640 /* CCDirectorIOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCDirectorIOS.h; sourceTree = ""; }; - E61037C615DD169B00819640 /* CCES2Renderer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCES2Renderer.h; sourceTree = ""; }; - E61037C715DD169B00819640 /* CCESRenderer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCESRenderer.h; sourceTree = ""; }; - E61037C815DD169B00819640 /* CCGLView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCGLView.h; sourceTree = ""; }; - E61037C915DD169B00819640 /* CCTouchDelegateProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCTouchDelegateProtocol.h; sourceTree = ""; }; - E61037CA15DD169B00819640 /* CCTouchDispatcher.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCTouchDispatcher.h; sourceTree = ""; }; - E61037CB15DD169B00819640 /* CCTouchHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCTouchHandler.h; sourceTree = ""; }; - E61037CD15DD169B00819640 /* CCDirectorMac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCDirectorMac.h; sourceTree = ""; }; - E61037CE15DD169B00819640 /* CCEventDispatcher.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCEventDispatcher.h; sourceTree = ""; }; - E61037CF15DD169B00819640 /* CCGLView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCGLView.h; sourceTree = ""; }; - E61037D015DD169B00819640 /* CCWindow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCWindow.h; sourceTree = ""; }; - E61037D215DD169B00819640 /* base64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = base64.h; sourceTree = ""; }; - E61037D315DD169B00819640 /* CCArray.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCArray.h; sourceTree = ""; }; - E61037D415DD169B00819640 /* ccCArray.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ccCArray.h; sourceTree = ""; }; - E61037D515DD169B00819640 /* CCFileUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCFileUtils.h; sourceTree = ""; }; - E61037D615DD169B00819640 /* CCProfiling.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCProfiling.h; sourceTree = ""; }; - E61037D715DD169B00819640 /* ccUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ccUtils.h; sourceTree = ""; }; - E61037D815DD169B00819640 /* CCVertex.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCVertex.h; sourceTree = ""; }; - E61037D915DD169B00819640 /* CGPointExtension.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CGPointExtension.h; sourceTree = ""; }; - E61037DA15DD169B00819640 /* NSThread+performBlock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSThread+performBlock.h"; sourceTree = ""; }; - E61037DB15DD169B00819640 /* OpenGL_Internal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OpenGL_Internal.h; sourceTree = ""; }; - E61037DC15DD169B00819640 /* TGAlib.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TGAlib.h; sourceTree = ""; }; - E61037DD15DD169B00819640 /* TransformUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TransformUtils.h; sourceTree = ""; }; - E61037DE15DD169B00819640 /* uthash.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = uthash.h; sourceTree = ""; }; - E61037DF15DD169B00819640 /* utlist.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = utlist.h; sourceTree = ""; }; - E61037E015DD169B00819640 /* ZipUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ZipUtils.h; sourceTree = ""; }; - E61037E215DD169B00819640 /* CDAudioManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDAudioManager.h; sourceTree = ""; }; - E61037E315DD169B00819640 /* CDConfig.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDConfig.h; sourceTree = ""; }; - E61037E415DD169B00819640 /* CDOpenALSupport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDOpenALSupport.h; sourceTree = ""; }; - E61037E515DD169B00819640 /* CocosDenshion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CocosDenshion.h; sourceTree = ""; }; - E61037E615DD169B00819640 /* SimpleAudioEngine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SimpleAudioEngine.h; sourceTree = ""; }; - E61037E815DD169B00819640 /* CDXMacOSXSupport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDXMacOSXSupport.h; sourceTree = ""; }; - E61037E915DD169B00819640 /* CDXPropertyModifierAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDXPropertyModifierAction.h; sourceTree = ""; }; - E61037EB15DD169B00819640 /* aabb.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = aabb.h; sourceTree = ""; }; - E61037ED15DD169B00819640 /* mat4stack.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mat4stack.h; sourceTree = ""; }; - E61037EE15DD169B00819640 /* matrix.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = matrix.h; sourceTree = ""; }; - E61037EF15DD169B00819640 /* kazmath.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = kazmath.h; sourceTree = ""; }; - E61037F015DD169B00819640 /* mat3.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mat3.h; sourceTree = ""; }; - E61037F115DD169B00819640 /* mat4.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mat4.h; sourceTree = ""; }; - E61037F215DD169B00819640 /* neon_matrix_impl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = neon_matrix_impl.h; sourceTree = ""; }; - E61037F315DD169B00819640 /* plane.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = plane.h; sourceTree = ""; }; - E61037F415DD169B00819640 /* quaternion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = quaternion.h; sourceTree = ""; }; - E61037F515DD169B00819640 /* ray2.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ray2.h; sourceTree = ""; }; - E61037F615DD169B00819640 /* utility.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = utility.h; sourceTree = ""; }; - E61037F715DD169B00819640 /* vec2.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vec2.h; sourceTree = ""; }; - E61037F815DD169B00819640 /* vec3.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vec3.h; sourceTree = ""; }; - E61037F915DD169B00819640 /* vec4.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vec4.h; sourceTree = ""; }; - E61037FB15DD169B00819640 /* png.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = png.h; sourceTree = ""; }; - E61037FC15DD169B00819640 /* pngconf.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pngconf.h; sourceTree = ""; }; - E61D8BF415E2771F00F768B0 /* CCRenderTargetNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCRenderTargetNode.h; sourceTree = ""; }; - E61D8BF615E2772C00F768B0 /* CCRenderTargetNode.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCRenderTargetNode.m; sourceTree = ""; }; E64FA07213E75380001A90C1 /* LICENSE_artwork.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = LICENSE_artwork.txt; sourceTree = ""; }; E64FA07313E75380001A90C1 /* LICENSE_Box2D.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = LICENSE_Box2D.txt; sourceTree = ""; }; E64FA07513E75380001A90C1 /* LICENSE_cocos2d.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = LICENSE_cocos2d.txt; sourceTree = ""; }; @@ -1075,10 +642,10 @@ E6929351161ECC4F00DB1EAA /* OpenGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGL.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/OpenGL.framework; sourceTree = DEVELOPER_DIR; }; E6929352161ECC4F00DB1EAA /* Quartz.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Quartz.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/Quartz.framework; sourceTree = DEVELOPER_DIR; }; E6929353161ECC4F00DB1EAA /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/QuartzCore.framework; sourceTree = DEVELOPER_DIR; }; - E692935F161ECCDB00DB1EAA /* CocosLibMac-Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "CocosLibMac-Prefix.pch"; sourceTree = ""; }; E6929367161ED0A400DB1EAA /* libCocosLibMac_script.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libCocosLibMac_script.a; sourceTree = BUILT_PRODUCTS_DIR; }; E6AA4AA413B156A600C9F08C /* zip_exclude.lst */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = zip_exclude.lst; sourceTree = ""; }; - E6AA4C0A13B156F800C9F08C /* CocosLib_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CocosLib_Prefix.pch; sourceTree = ""; }; + E6BD02011792F571009C2A22 /* LICENSE */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = LICENSE; sourceTree = ""; }; + E6BD02021792F571009C2A22 /* LICENSE_Kazmath.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = LICENSE_Kazmath.txt; sourceTree = ""; }; E6E142C913B3EC990052ED3D /* libCocosLib_script.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libCocosLib_script.a; sourceTree = BUILT_PRODUCTS_DIR; }; E6E2A63212CE48E000923828 /* libCocos.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libCocos.a; sourceTree = BUILT_PRODUCTS_DIR; }; E6E2A63612CE492600923828 /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; }; @@ -1087,8 +654,336 @@ E6E2A63C12CE492600923828 /* CoreMotion.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreMotion.framework; path = System/Library/Frameworks/CoreMotion.framework; sourceTree = SDKROOT; }; E6E2A63F12CE492600923828 /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = System/Library/Frameworks/OpenGLES.framework; sourceTree = SDKROOT; }; E6E2A64112CE492600923828 /* libz.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.dylib; path = usr/lib/libz.dylib; sourceTree = SDKROOT; }; + E6E9AC96181456C100E3C1A2 /* CCAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCAction.h; sourceTree = ""; }; + E6E9AC97181456C100E3C1A2 /* CCAction.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCAction.m; sourceTree = ""; }; + E6E9AC98181456C100E3C1A2 /* CCActionCatmullRom.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCActionCatmullRom.h; sourceTree = ""; }; + E6E9AC99181456C100E3C1A2 /* CCActionCatmullRom.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCActionCatmullRom.m; sourceTree = ""; }; + E6E9AC9A181456C100E3C1A2 /* CCActionEase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCActionEase.h; sourceTree = ""; }; + E6E9AC9B181456C100E3C1A2 /* CCActionEase.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCActionEase.m; sourceTree = ""; }; + E6E9AC9C181456C100E3C1A2 /* CCActionGrid.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCActionGrid.h; sourceTree = ""; }; + E6E9AC9D181456C100E3C1A2 /* CCActionGrid.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCActionGrid.m; sourceTree = ""; }; + E6E9AC9E181456C100E3C1A2 /* CCActionGrid3D.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCActionGrid3D.h; sourceTree = ""; }; + E6E9AC9F181456C100E3C1A2 /* CCActionGrid3D.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCActionGrid3D.m; sourceTree = ""; }; + E6E9ACA0181456C100E3C1A2 /* CCActionInstant.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCActionInstant.h; sourceTree = ""; }; + E6E9ACA1181456C100E3C1A2 /* CCActionInstant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCActionInstant.m; sourceTree = ""; }; + E6E9ACA2181456C100E3C1A2 /* CCActionInterval.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCActionInterval.h; sourceTree = ""; }; + E6E9ACA3181456C100E3C1A2 /* CCActionInterval.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCActionInterval.m; sourceTree = ""; }; + E6E9ACA4181456C100E3C1A2 /* CCActionManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCActionManager.h; sourceTree = ""; }; + E6E9ACA5181456C100E3C1A2 /* CCActionManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCActionManager.m; sourceTree = ""; }; + E6E9ACA6181456C100E3C1A2 /* CCActionPageTurn3D.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCActionPageTurn3D.h; sourceTree = ""; }; + E6E9ACA7181456C100E3C1A2 /* CCActionPageTurn3D.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCActionPageTurn3D.m; sourceTree = ""; }; + E6E9ACA8181456C100E3C1A2 /* CCActionProgressTimer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCActionProgressTimer.h; sourceTree = ""; }; + E6E9ACA9181456C100E3C1A2 /* CCActionProgressTimer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCActionProgressTimer.m; sourceTree = ""; }; + E6E9ACAA181456C100E3C1A2 /* CCActionTiledGrid.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCActionTiledGrid.h; sourceTree = ""; }; + E6E9ACAB181456C100E3C1A2 /* CCActionTiledGrid.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCActionTiledGrid.m; sourceTree = ""; }; + E6E9ACAC181456C100E3C1A2 /* CCActionTween.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCActionTween.h; sourceTree = ""; }; + E6E9ACAD181456C100E3C1A2 /* CCActionTween.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCActionTween.m; sourceTree = ""; }; + E6E9ACAE181456C100E3C1A2 /* CCAnimation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCAnimation.h; sourceTree = ""; }; + E6E9ACAF181456C100E3C1A2 /* CCAnimation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCAnimation.m; sourceTree = ""; }; + E6E9ACB0181456C100E3C1A2 /* CCAnimationCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCAnimationCache.h; sourceTree = ""; }; + E6E9ACB1181456C100E3C1A2 /* CCAnimationCache.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCAnimationCache.m; sourceTree = ""; }; + E6E9ACB2181456C100E3C1A2 /* CCAtlasNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCAtlasNode.h; sourceTree = ""; }; + E6E9ACB3181456C100E3C1A2 /* CCAtlasNode.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCAtlasNode.m; sourceTree = ""; }; + E6E9ACB4181456C100E3C1A2 /* CCCamera.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCCamera.h; sourceTree = ""; }; + E6E9ACB5181456C100E3C1A2 /* CCClippingNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCClippingNode.h; sourceTree = ""; }; + E6E9ACB6181456C100E3C1A2 /* CCClippingNode.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCClippingNode.m; sourceTree = ""; }; + E6E9ACB7181456C100E3C1A2 /* ccConfig.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ccConfig.h; sourceTree = ""; }; + E6E9ACB8181456C100E3C1A2 /* CCConfiguration.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCConfiguration.h; sourceTree = ""; }; + E6E9ACB9181456C100E3C1A2 /* CCConfiguration.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCConfiguration.m; sourceTree = ""; }; + E6E9ACBA181456C100E3C1A2 /* ccDeprecated.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ccDeprecated.h; sourceTree = ""; }; + E6E9ACBB181456C100E3C1A2 /* ccDeprecated.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ccDeprecated.m; sourceTree = ""; }; + E6E9ACBC181456C100E3C1A2 /* CCDirector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCDirector.h; sourceTree = ""; }; + E6E9ACBD181456C100E3C1A2 /* CCDirector.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCDirector.m; sourceTree = ""; }; + E6E9ACBE181456C100E3C1A2 /* CCDrawingPrimitives.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCDrawingPrimitives.h; sourceTree = ""; }; + E6E9ACBF181456C100E3C1A2 /* CCDrawingPrimitives.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCDrawingPrimitives.m; sourceTree = ""; }; + E6E9ACC0181456C100E3C1A2 /* CCDrawNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCDrawNode.h; sourceTree = ""; }; + E6E9ACC1181456C100E3C1A2 /* CCDrawNode.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCDrawNode.m; sourceTree = ""; }; + E6E9ACC2181456C100E3C1A2 /* ccFPSImages.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ccFPSImages.h; sourceTree = ""; }; + E6E9ACC3181456C100E3C1A2 /* ccFPSImages.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ccFPSImages.m; sourceTree = ""; }; + E6E9ACC4181456C100E3C1A2 /* CCGLProgram.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCGLProgram.h; sourceTree = ""; }; + E6E9ACC5181456C100E3C1A2 /* CCGLProgram.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCGLProgram.m; sourceTree = ""; }; + E6E9ACC6181456C100E3C1A2 /* ccGLStateCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ccGLStateCache.h; sourceTree = ""; }; + E6E9ACC7181456C100E3C1A2 /* ccGLStateCache.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ccGLStateCache.m; sourceTree = ""; }; + E6E9ACC8181456C100E3C1A2 /* CCGrabber.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCGrabber.h; sourceTree = ""; }; + E6E9ACC9181456C100E3C1A2 /* CCGrabber.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCGrabber.m; sourceTree = ""; }; + E6E9ACCA181456C100E3C1A2 /* CCGrid.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCGrid.h; sourceTree = ""; }; + E6E9ACCB181456C100E3C1A2 /* CCGrid.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCGrid.m; sourceTree = ""; }; + E6E9ACCC181456C100E3C1A2 /* CCLabelAtlas.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCLabelAtlas.h; sourceTree = ""; }; + E6E9ACCD181456C100E3C1A2 /* CCLabelAtlas.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCLabelAtlas.m; sourceTree = ""; }; + E6E9ACCE181456C100E3C1A2 /* CCLabelBMFont.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCLabelBMFont.h; sourceTree = ""; }; + E6E9ACCF181456C100E3C1A2 /* CCLabelBMFont.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCLabelBMFont.m; sourceTree = ""; }; + E6E9ACD0181456C100E3C1A2 /* CCLabelTTF.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCLabelTTF.h; sourceTree = ""; }; + E6E9ACD1181456C100E3C1A2 /* CCLabelTTF.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCLabelTTF.m; sourceTree = ""; }; + E6E9ACD2181456C100E3C1A2 /* CCLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCLayer.h; sourceTree = ""; }; + E6E9ACD3181456C100E3C1A2 /* CCLayer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCLayer.m; sourceTree = ""; }; + E6E9ACD4181456C100E3C1A2 /* ccMacros.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ccMacros.h; sourceTree = ""; }; + E6E9ACD5181456C100E3C1A2 /* CCMenu.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCMenu.h; sourceTree = ""; }; + E6E9ACD6181456C100E3C1A2 /* CCMenu.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCMenu.m; sourceTree = ""; }; + E6E9ACD7181456C100E3C1A2 /* CCMenuItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCMenuItem.h; sourceTree = ""; }; + E6E9ACD8181456C100E3C1A2 /* CCMenuItem.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCMenuItem.m; sourceTree = ""; }; + E6E9ACD9181456C100E3C1A2 /* CCMotionStreak.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCMotionStreak.h; sourceTree = ""; }; + E6E9ACDA181456C100E3C1A2 /* CCMotionStreak.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCMotionStreak.m; sourceTree = ""; }; + E6E9ACDB181456C100E3C1A2 /* CCNode+Debug.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "CCNode+Debug.h"; sourceTree = ""; }; + E6E9ACDC181456C100E3C1A2 /* CCNode+Debug.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "CCNode+Debug.m"; sourceTree = ""; }; + E6E9ACDD181456C100E3C1A2 /* CCNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCNode.h; sourceTree = ""; }; + E6E9ACDE181456C100E3C1A2 /* CCNode.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCNode.m; sourceTree = ""; }; + E6E9ACDF181456C100E3C1A2 /* CCParallaxNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCParallaxNode.h; sourceTree = ""; }; + E6E9ACE0181456C100E3C1A2 /* CCParallaxNode.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCParallaxNode.m; sourceTree = ""; }; + E6E9ACE1181456C100E3C1A2 /* CCParticleBatchNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCParticleBatchNode.h; sourceTree = ""; }; + E6E9ACE2181456C100E3C1A2 /* CCParticleBatchNode.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCParticleBatchNode.m; sourceTree = ""; }; + E6E9ACE3181456C100E3C1A2 /* CCParticleExamples.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCParticleExamples.h; sourceTree = ""; }; + E6E9ACE4181456C100E3C1A2 /* CCParticleExamples.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCParticleExamples.m; sourceTree = ""; }; + E6E9ACE5181456C100E3C1A2 /* CCParticleSystem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCParticleSystem.h; sourceTree = ""; }; + E6E9ACE6181456C100E3C1A2 /* CCParticleSystem.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCParticleSystem.m; sourceTree = ""; }; + E6E9ACE7181456C100E3C1A2 /* CCParticleSystemQuad.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCParticleSystemQuad.h; sourceTree = ""; }; + E6E9ACE8181456C100E3C1A2 /* CCParticleSystemQuad.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCParticleSystemQuad.m; sourceTree = ""; }; + E6E9ACE9181456C100E3C1A2 /* CCPhysics+ObjectiveChipmunk.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "CCPhysics+ObjectiveChipmunk.h"; sourceTree = ""; }; + E6E9ACEA181456C100E3C1A2 /* CCPhysicsbody.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCPhysicsbody.h; sourceTree = ""; }; + E6E9ACEB181456C100E3C1A2 /* CCPhysicsBody.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCPhysicsBody.m; sourceTree = ""; }; + E6E9ACEC181456C100E3C1A2 /* CCPhysicsJoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCPhysicsJoint.h; sourceTree = ""; }; + E6E9ACED181456C100E3C1A2 /* CCPhysicsJoint.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCPhysicsJoint.m; sourceTree = ""; }; + E6E9ACEE181456C100E3C1A2 /* CCPhysicsNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCPhysicsNode.h; sourceTree = ""; }; + E6E9ACEF181456C100E3C1A2 /* CCPhysicsNode.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCPhysicsNode.m; sourceTree = ""; }; + E6E9ACF0181456C100E3C1A2 /* CCProgressTimer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCProgressTimer.h; sourceTree = ""; }; + E6E9ACF1181456C100E3C1A2 /* CCProgressTimer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCProgressTimer.m; sourceTree = ""; }; + E6E9ACF2181456C100E3C1A2 /* CCProtocols.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCProtocols.h; sourceTree = ""; }; + E6E9ACF3181456C100E3C1A2 /* CCRenderTexture.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCRenderTexture.h; sourceTree = ""; }; + E6E9ACF4181456C100E3C1A2 /* CCRenderTexture.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCRenderTexture.m; sourceTree = ""; }; + E6E9ACF5181456C100E3C1A2 /* CCResponder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCResponder.h; sourceTree = ""; }; + E6E9ACF6181456C100E3C1A2 /* CCResponder.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCResponder.m; sourceTree = ""; }; + E6E9ACF7181456C100E3C1A2 /* CCResponderManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCResponderManager.h; sourceTree = ""; }; + E6E9ACF8181456C100E3C1A2 /* CCResponderManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCResponderManager.m; sourceTree = ""; }; + E6E9ACF9181456C100E3C1A2 /* CCScene.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCScene.h; sourceTree = ""; }; + E6E9ACFA181456C100E3C1A2 /* CCScene.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCScene.m; sourceTree = ""; }; + E6E9ACFB181456C100E3C1A2 /* CCScheduler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCScheduler.h; sourceTree = ""; }; + E6E9ACFC181456C100E3C1A2 /* CCScheduler.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCScheduler.m; sourceTree = ""; }; + E6E9ACFD181456C100E3C1A2 /* ccShader_Position_uColor_frag.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ccShader_Position_uColor_frag.h; sourceTree = ""; }; + E6E9ACFE181456C100E3C1A2 /* ccShader_Position_uColor_vert.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ccShader_Position_uColor_vert.h; sourceTree = ""; }; + E6E9ACFF181456C100E3C1A2 /* ccShader_PositionColor_frag.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ccShader_PositionColor_frag.h; sourceTree = ""; }; + E6E9AD00181456C100E3C1A2 /* ccShader_PositionColor_vert.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ccShader_PositionColor_vert.h; sourceTree = ""; }; + E6E9AD01181456C100E3C1A2 /* ccShader_PositionColorLengthTexture_frag.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ccShader_PositionColorLengthTexture_frag.h; sourceTree = ""; }; + E6E9AD02181456C100E3C1A2 /* ccShader_PositionColorLengthTexture_vert.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ccShader_PositionColorLengthTexture_vert.h; sourceTree = ""; }; + E6E9AD03181456C100E3C1A2 /* ccShader_PositionTexture_frag.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ccShader_PositionTexture_frag.h; sourceTree = ""; }; + E6E9AD04181456C100E3C1A2 /* ccShader_PositionTexture_uColor_frag.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ccShader_PositionTexture_uColor_frag.h; sourceTree = ""; }; + E6E9AD05181456C100E3C1A2 /* ccShader_PositionTexture_uColor_vert.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ccShader_PositionTexture_uColor_vert.h; sourceTree = ""; }; + E6E9AD06181456C100E3C1A2 /* ccShader_PositionTexture_vert.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ccShader_PositionTexture_vert.h; sourceTree = ""; }; + E6E9AD07181456C100E3C1A2 /* ccShader_PositionTextureA8Color_frag.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ccShader_PositionTextureA8Color_frag.h; sourceTree = ""; }; + E6E9AD08181456C100E3C1A2 /* ccShader_PositionTextureA8Color_vert.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ccShader_PositionTextureA8Color_vert.h; sourceTree = ""; }; + E6E9AD09181456C100E3C1A2 /* ccShader_PositionTextureColor_frag.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ccShader_PositionTextureColor_frag.h; sourceTree = ""; }; + E6E9AD0A181456C100E3C1A2 /* ccShader_PositionTextureColor_vert.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ccShader_PositionTextureColor_vert.h; sourceTree = ""; }; + E6E9AD0B181456C100E3C1A2 /* ccShader_PositionTextureColorAlphaTest_frag.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ccShader_PositionTextureColorAlphaTest_frag.h; sourceTree = ""; }; + E6E9AD0C181456C100E3C1A2 /* CCShaderCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCShaderCache.h; sourceTree = ""; }; + E6E9AD0D181456C100E3C1A2 /* CCShaderCache.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCShaderCache.m; sourceTree = ""; }; + E6E9AD0E181456C100E3C1A2 /* ccShaders.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ccShaders.h; sourceTree = ""; }; + E6E9AD0F181456C100E3C1A2 /* ccShaders.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ccShaders.m; sourceTree = ""; }; + E6E9AD10181456C100E3C1A2 /* CCSprite.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCSprite.h; sourceTree = ""; }; + E6E9AD11181456C100E3C1A2 /* CCSprite.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCSprite.m; sourceTree = ""; }; + E6E9AD12181456C100E3C1A2 /* CCSprite9Slice.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCSprite9Slice.h; sourceTree = ""; }; + E6E9AD13181456C100E3C1A2 /* CCSprite9Slice.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCSprite9Slice.m; sourceTree = ""; }; + E6E9AD14181456C100E3C1A2 /* CCSpriteBatchNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCSpriteBatchNode.h; sourceTree = ""; }; + E6E9AD15181456C100E3C1A2 /* CCSpriteBatchNode.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCSpriteBatchNode.m; sourceTree = ""; }; + E6E9AD16181456C100E3C1A2 /* CCSpriteFrame.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCSpriteFrame.h; sourceTree = ""; }; + E6E9AD17181456C100E3C1A2 /* CCSpriteFrame.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCSpriteFrame.m; sourceTree = ""; }; + E6E9AD18181456C100E3C1A2 /* CCSpriteFrameCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCSpriteFrameCache.h; sourceTree = ""; }; + E6E9AD19181456C100E3C1A2 /* CCSpriteFrameCache.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCSpriteFrameCache.m; sourceTree = ""; }; + E6E9AD1A181456C100E3C1A2 /* CCTexture2D.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCTexture2D.h; sourceTree = ""; }; + E6E9AD1B181456C100E3C1A2 /* CCTexture2D.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCTexture2D.m; sourceTree = ""; }; + E6E9AD1C181456C100E3C1A2 /* CCTextureAtlas.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCTextureAtlas.h; sourceTree = ""; }; + E6E9AD1D181456C100E3C1A2 /* CCTextureAtlas.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCTextureAtlas.m; sourceTree = ""; }; + E6E9AD1E181456C100E3C1A2 /* CCTextureCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCTextureCache.h; sourceTree = ""; }; + E6E9AD1F181456C100E3C1A2 /* CCTextureCache.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCTextureCache.m; sourceTree = ""; }; + E6E9AD20181456C100E3C1A2 /* CCTexturePVR.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCTexturePVR.h; sourceTree = ""; }; + E6E9AD21181456C100E3C1A2 /* CCTexturePVR.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCTexturePVR.m; sourceTree = ""; }; + E6E9AD22181456C100E3C1A2 /* CCTileMapAtlas.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCTileMapAtlas.h; sourceTree = ""; }; + E6E9AD23181456C100E3C1A2 /* CCTileMapAtlas.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCTileMapAtlas.m; sourceTree = ""; }; + E6E9AD24181456C100E3C1A2 /* CCTMXLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCTMXLayer.h; sourceTree = ""; }; + E6E9AD25181456C100E3C1A2 /* CCTMXLayer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCTMXLayer.m; sourceTree = ""; }; + E6E9AD26181456C100E3C1A2 /* CCTMXObjectGroup.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCTMXObjectGroup.h; sourceTree = ""; }; + E6E9AD27181456C100E3C1A2 /* CCTMXObjectGroup.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCTMXObjectGroup.m; sourceTree = ""; }; + E6E9AD28181456C100E3C1A2 /* CCTMXTiledMap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCTMXTiledMap.h; sourceTree = ""; }; + E6E9AD29181456C100E3C1A2 /* CCTMXTiledMap.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCTMXTiledMap.m; sourceTree = ""; }; + E6E9AD2A181456C100E3C1A2 /* CCTMXXMLParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCTMXXMLParser.h; sourceTree = ""; }; + E6E9AD2B181456C100E3C1A2 /* CCTMXXMLParser.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCTMXXMLParser.m; sourceTree = ""; }; + E6E9AD2C181456C100E3C1A2 /* CCTransition.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCTransition.h; sourceTree = ""; }; + E6E9AD2D181456C100E3C1A2 /* CCTransition.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCTransition.m; sourceTree = ""; }; + E6E9AD2E181456C100E3C1A2 /* ccTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ccTypes.h; sourceTree = ""; }; + E6E9AD2F181456C100E3C1A2 /* cocos2d.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cocos2d.h; sourceTree = ""; }; + E6E9AD30181456C100E3C1A2 /* cocos2d.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = cocos2d.m; sourceTree = ""; }; + E6E9AD32181456C100E3C1A2 /* CCGL.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCGL.h; sourceTree = ""; }; + E6E9AD33181456C100E3C1A2 /* CCNS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCNS.h; sourceTree = ""; }; + E6E9AD35181456C100E3C1A2 /* CCDirectorIOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCDirectorIOS.h; sourceTree = ""; }; + E6E9AD36181456C100E3C1A2 /* CCDirectorIOS.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCDirectorIOS.m; sourceTree = ""; }; + E6E9AD37181456C100E3C1A2 /* CCES2Renderer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCES2Renderer.h; sourceTree = ""; }; + E6E9AD38181456C100E3C1A2 /* CCES2Renderer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCES2Renderer.m; sourceTree = ""; }; + E6E9AD39181456C100E3C1A2 /* CCESRenderer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCESRenderer.h; sourceTree = ""; }; + E6E9AD3A181456C100E3C1A2 /* CCGLView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCGLView.h; sourceTree = ""; }; + E6E9AD3B181456C100E3C1A2 /* CCGLView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCGLView.m; sourceTree = ""; }; + E6E9AD3C181456C100E3C1A2 /* CCResponder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCResponder.h; sourceTree = ""; }; + E6E9AD3D181456C100E3C1A2 /* CCResponder.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCResponder.m; sourceTree = ""; }; + E6E9AD3E181456C100E3C1A2 /* CCResponderManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCResponderManager.h; sourceTree = ""; }; + E6E9AD3F181456C100E3C1A2 /* CCResponderManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCResponderManager.m; sourceTree = ""; }; + E6E9AD40181456C100E3C1A2 /* UITouch+CC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UITouch+CC.h"; sourceTree = ""; }; + E6E9AD41181456C100E3C1A2 /* UITouch+CC.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UITouch+CC.m"; sourceTree = ""; }; + E6E9AD43181456C100E3C1A2 /* CCDirectorMac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCDirectorMac.h; sourceTree = ""; }; + E6E9AD44181456C100E3C1A2 /* CCDirectorMac.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCDirectorMac.m; sourceTree = ""; }; + E6E9AD45181456C100E3C1A2 /* CCGLView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCGLView.h; sourceTree = ""; }; + E6E9AD46181456C100E3C1A2 /* CCGLView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCGLView.m; sourceTree = ""; }; + E6E9AD47181456C100E3C1A2 /* CCWindow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCWindow.h; sourceTree = ""; }; + E6E9AD48181456C100E3C1A2 /* CCWindow.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCWindow.m; sourceTree = ""; }; + E6E9AD49181456C100E3C1A2 /* NSEvent+CC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSEvent+CC.h"; sourceTree = ""; }; + E6E9AD4A181456C100E3C1A2 /* NSEvent+CC.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSEvent+CC.m"; sourceTree = ""; }; + E6E9AD4C181456C100E3C1A2 /* base64.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = base64.c; sourceTree = ""; }; + E6E9AD4D181456C100E3C1A2 /* base64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = base64.h; sourceTree = ""; }; + E6E9AD4E181456C100E3C1A2 /* CCFileUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCFileUtils.h; sourceTree = ""; }; + E6E9AD4F181456C100E3C1A2 /* CCFileUtils.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCFileUtils.m; sourceTree = ""; }; + E6E9AD50181456C100E3C1A2 /* CCProfiling.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCProfiling.h; sourceTree = ""; }; + E6E9AD51181456C100E3C1A2 /* CCProfiling.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCProfiling.m; sourceTree = ""; }; + E6E9AD52181456C100E3C1A2 /* ccUtils.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ccUtils.c; sourceTree = ""; }; + E6E9AD53181456C100E3C1A2 /* ccUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ccUtils.h; sourceTree = ""; }; + E6E9AD54181456C100E3C1A2 /* CCVertex.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCVertex.h; sourceTree = ""; }; + E6E9AD55181456C100E3C1A2 /* CCVertex.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCVertex.m; sourceTree = ""; }; + E6E9AD56181456C100E3C1A2 /* CGPointExtension.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CGPointExtension.h; sourceTree = ""; }; + E6E9AD57181456C100E3C1A2 /* CGPointExtension.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CGPointExtension.m; sourceTree = ""; }; + E6E9AD58181456C100E3C1A2 /* NSAttributedString+CCAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSAttributedString+CCAdditions.h"; sourceTree = ""; }; + E6E9AD59181456C100E3C1A2 /* NSAttributedString+CCAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSAttributedString+CCAdditions.m"; sourceTree = ""; }; + E6E9AD5A181456C100E3C1A2 /* NSThread+performBlock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSThread+performBlock.h"; sourceTree = ""; }; + E6E9AD5B181456C100E3C1A2 /* NSThread+performBlock.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSThread+performBlock.m"; sourceTree = ""; }; + E6E9AD5C181456C100E3C1A2 /* OpenGL_Internal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OpenGL_Internal.h; sourceTree = ""; }; + E6E9AD5D181456C100E3C1A2 /* TGAlib.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TGAlib.h; sourceTree = ""; }; + E6E9AD5E181456C100E3C1A2 /* TGAlib.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TGAlib.m; sourceTree = ""; }; + E6E9AD5F181456C100E3C1A2 /* TransformUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TransformUtils.h; sourceTree = ""; }; + E6E9AD60181456C100E3C1A2 /* TransformUtils.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TransformUtils.m; sourceTree = ""; }; + E6E9AD61181456C100E3C1A2 /* uthash.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = uthash.h; sourceTree = ""; }; + E6E9AD62181456C100E3C1A2 /* utlist.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = utlist.h; sourceTree = ""; }; + E6E9AD63181456C100E3C1A2 /* ZipUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ZipUtils.h; sourceTree = ""; }; + E6E9AD64181456C100E3C1A2 /* ZipUtils.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ZipUtils.m; sourceTree = ""; }; + E6E9AD66181456C100E3C1A2 /* CCButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCButton.h; sourceTree = ""; }; + E6E9AD67181456C100E3C1A2 /* CCButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCButton.m; sourceTree = ""; }; + E6E9AD68181456C100E3C1A2 /* CCControl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCControl.h; sourceTree = ""; }; + E6E9AD69181456C100E3C1A2 /* CCControl.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCControl.m; sourceTree = ""; }; + E6E9AD6A181456C100E3C1A2 /* CCControlSubclass.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCControlSubclass.h; sourceTree = ""; }; + E6E9AD6B181456C100E3C1A2 /* CCControlTextureFactory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCControlTextureFactory.h; sourceTree = ""; }; + E6E9AD6C181456C100E3C1A2 /* CCControlTextureFactory.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCControlTextureFactory.m; sourceTree = ""; }; + E6E9AD6D181456C100E3C1A2 /* CCScrollView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCScrollView.h; sourceTree = ""; }; + E6E9AD6E181456C100E3C1A2 /* CCScrollView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCScrollView.m; sourceTree = ""; }; + E6E9AD6F181456C100E3C1A2 /* CCTableView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCTableView.h; sourceTree = ""; }; + E6E9AD70181456C100E3C1A2 /* CCTableView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCTableView.m; sourceTree = ""; }; + E6E9AD71181456C100E3C1A2 /* cocos2d-ui.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "cocos2d-ui.h"; sourceTree = ""; }; + E6E9AD84181456C100E3C1A2 /* aabb.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = aabb.h; sourceTree = ""; }; + E6E9AD86181456C100E3C1A2 /* mat4stack.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mat4stack.h; sourceTree = ""; }; + E6E9AD87181456C100E3C1A2 /* matrix.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = matrix.h; sourceTree = ""; }; + E6E9AD88181456C100E3C1A2 /* kazmath.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = kazmath.h; sourceTree = ""; }; + E6E9AD89181456C100E3C1A2 /* mat3.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mat3.h; sourceTree = ""; }; + E6E9AD8A181456C100E3C1A2 /* mat4.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mat4.h; sourceTree = ""; }; + E6E9AD8B181456C100E3C1A2 /* neon_matrix_impl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = neon_matrix_impl.h; sourceTree = ""; }; + E6E9AD8C181456C100E3C1A2 /* plane.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = plane.h; sourceTree = ""; }; + E6E9AD8D181456C100E3C1A2 /* quaternion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = quaternion.h; sourceTree = ""; }; + E6E9AD8E181456C100E3C1A2 /* ray2.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ray2.h; sourceTree = ""; }; + E6E9AD8F181456C100E3C1A2 /* utility.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = utility.h; sourceTree = ""; }; + E6E9AD90181456C100E3C1A2 /* vec2.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vec2.h; sourceTree = ""; }; + E6E9AD91181456C100E3C1A2 /* vec3.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vec3.h; sourceTree = ""; }; + E6E9AD92181456C100E3C1A2 /* vec4.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vec4.h; sourceTree = ""; }; + E6E9AD94181456C100E3C1A2 /* aabb.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = aabb.c; sourceTree = ""; }; + E6E9AD95181456C100E3C1A2 /* ChangeLog */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ChangeLog; sourceTree = ""; }; + E6E9AD96181456C100E3C1A2 /* CMakeLists.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CMakeLists.txt; sourceTree = ""; }; + E6E9AD98181456C100E3C1A2 /* mat4stack.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = mat4stack.c; sourceTree = ""; }; + E6E9AD99181456C100E3C1A2 /* matrix.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = matrix.c; sourceTree = ""; }; + E6E9AD9A181456C100E3C1A2 /* mat3.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = mat3.c; sourceTree = ""; }; + E6E9AD9B181456C100E3C1A2 /* mat4.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = mat4.c; sourceTree = ""; }; + E6E9AD9C181456C100E3C1A2 /* neon_matrix_impl.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = neon_matrix_impl.c; sourceTree = ""; }; + E6E9AD9D181456C100E3C1A2 /* plane.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = plane.c; sourceTree = ""; }; + E6E9AD9E181456C100E3C1A2 /* quaternion.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = quaternion.c; sourceTree = ""; }; + E6E9AD9F181456C100E3C1A2 /* ray2.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ray2.c; sourceTree = ""; }; + E6E9ADA0181456C100E3C1A2 /* utility.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = utility.c; sourceTree = ""; }; + E6E9ADA1181456C100E3C1A2 /* vec2.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = vec2.c; sourceTree = ""; }; + E6E9ADA2181456C100E3C1A2 /* vec3.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = vec3.c; sourceTree = ""; }; + E6E9ADA3181456C100E3C1A2 /* vec4.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = vec4.c; sourceTree = ""; }; + E6E9ADA5181456C100E3C1A2 /* ANNOUNCE */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ANNOUNCE; sourceTree = ""; }; + E6E9ADA6181456C100E3C1A2 /* CHANGES */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CHANGES; sourceTree = ""; }; + E6E9ADA7181456C100E3C1A2 /* CMakeLists.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CMakeLists.txt; sourceTree = ""; }; + E6E9ADA8181456C100E3C1A2 /* configure */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = configure; sourceTree = ""; }; + E6E9ADA9181456C100E3C1A2 /* example.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = example.c; sourceTree = ""; }; + E6E9ADAA181456C100E3C1A2 /* INSTALL */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = INSTALL; sourceTree = ""; }; + E6E9ADAB181456C100E3C1A2 /* KNOWNBUG */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = KNOWNBUG; sourceTree = ""; }; + E6E9ADAC181456C100E3C1A2 /* libpng-1.2.49.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "libpng-1.2.49.txt"; sourceTree = ""; }; + E6E9ADAD181456C100E3C1A2 /* libpng.3 */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = libpng.3; sourceTree = ""; }; + E6E9ADAE181456C100E3C1A2 /* libpngpf.3 */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = libpngpf.3; sourceTree = ""; }; + E6E9ADAF181456C100E3C1A2 /* LICENSE */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = LICENSE; sourceTree = ""; }; + E6E9ADB0181456C100E3C1A2 /* png.5 */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = png.5; sourceTree = ""; }; + E6E9ADB1181456C100E3C1A2 /* png.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = png.c; sourceTree = ""; }; + E6E9ADB2181456C100E3C1A2 /* png.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = png.h; sourceTree = ""; }; + E6E9ADB3181456C100E3C1A2 /* pngbar.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = pngbar.jpg; sourceTree = ""; }; + E6E9ADB4181456C100E3C1A2 /* pngbar.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = pngbar.png; sourceTree = ""; }; + E6E9ADB5181456C100E3C1A2 /* pngconf.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pngconf.h; sourceTree = ""; }; + E6E9ADB6181456C100E3C1A2 /* pngerror.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = pngerror.c; sourceTree = ""; }; + E6E9ADB7181456C100E3C1A2 /* pnggccrd.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = pnggccrd.c; sourceTree = ""; }; + E6E9ADB8181456C100E3C1A2 /* pngget.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = pngget.c; sourceTree = ""; }; + E6E9ADB9181456C100E3C1A2 /* pngmem.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = pngmem.c; sourceTree = ""; }; + E6E9ADBA181456C100E3C1A2 /* pngnow.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = pngnow.png; sourceTree = ""; }; + E6E9ADBB181456C100E3C1A2 /* pngpread.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = pngpread.c; sourceTree = ""; }; + E6E9ADBC181456C100E3C1A2 /* pngread.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = pngread.c; sourceTree = ""; }; + E6E9ADBD181456C100E3C1A2 /* pngrio.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = pngrio.c; sourceTree = ""; }; + E6E9ADBE181456C100E3C1A2 /* pngrtran.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = pngrtran.c; sourceTree = ""; }; + E6E9ADBF181456C100E3C1A2 /* pngrutil.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = pngrutil.c; sourceTree = ""; }; + E6E9ADC0181456C100E3C1A2 /* pngset.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = pngset.c; sourceTree = ""; }; + E6E9ADC1181456C100E3C1A2 /* pngtest.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = pngtest.c; sourceTree = ""; }; + E6E9ADC2181456C100E3C1A2 /* pngtest.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = pngtest.png; sourceTree = ""; }; + E6E9ADC3181456C100E3C1A2 /* pngtrans.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = pngtrans.c; sourceTree = ""; }; + E6E9ADC4181456C100E3C1A2 /* pngvcrd.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = pngvcrd.c; sourceTree = ""; }; + E6E9ADC5181456C100E3C1A2 /* pngwio.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = pngwio.c; sourceTree = ""; }; + E6E9ADC6181456C100E3C1A2 /* pngwrite.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = pngwrite.c; sourceTree = ""; }; + E6E9ADC7181456C100E3C1A2 /* pngwtran.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = pngwtran.c; sourceTree = ""; }; + E6E9ADC8181456C100E3C1A2 /* pngwutil.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = pngwutil.c; sourceTree = ""; }; + E6E9ADC9181456C100E3C1A2 /* README */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = README; sourceTree = ""; }; + E6E9ADCA181456C100E3C1A2 /* TODO */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = TODO; sourceTree = ""; }; + E6E9ADCB181456C100E3C1A2 /* Y2KINFO */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Y2KINFO; sourceTree = ""; }; + E6E9AFF4181456D700E3C1A2 /* Chipmunk7.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = Chipmunk7.xcodeproj; path = external/Chipmunk/xcode/Chipmunk7.xcodeproj; sourceTree = ""; }; + E6E9B0201814599300E3C1A2 /* CocosLib.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CocosLib.h; sourceTree = ""; }; + E6E9B0211814599300E3C1A2 /* CocosLib.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CocosLib.m; sourceTree = ""; }; + E6E9B0231814599D00E3C1A2 /* CocosLibMac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CocosLibMac.h; sourceTree = ""; }; + E6E9B0241814599D00E3C1A2 /* CocosLibMac.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CocosLibMac.m; sourceTree = ""; }; + E6E9B02F18145B0000E3C1A2 /* libCocosDenshion.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libCocosDenshion.a; sourceTree = BUILT_PRODUCTS_DIR; }; + E6E9B03318145B0000E3C1A2 /* CocosDenshion-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "CocosDenshion-Prefix.pch"; sourceTree = ""; }; + E6E9B03418145B0000E3C1A2 /* CocosDenshion.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CocosDenshion.h; sourceTree = ""; }; + E6E9B03618145B0000E3C1A2 /* CocosDenshion.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CocosDenshion.m; sourceTree = ""; }; + E6E9B03D18145B0000E3C1A2 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; + E6E9B04018145B0000E3C1A2 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = Library/Frameworks/UIKit.framework; sourceTree = DEVELOPER_DIR; }; + E6E9B05418145B2900E3C1A2 /* CDAudioManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDAudioManager.h; sourceTree = ""; }; + E6E9B05518145B2900E3C1A2 /* CDAudioManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDAudioManager.m; sourceTree = ""; }; + E6E9B05618145B2900E3C1A2 /* CDConfig.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDConfig.h; sourceTree = ""; }; + E6E9B05718145B2900E3C1A2 /* CDOpenALSupport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDOpenALSupport.h; sourceTree = ""; }; + E6E9B05818145B2900E3C1A2 /* CDOpenALSupport.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDOpenALSupport.m; sourceTree = ""; }; + E6E9B05918145B2900E3C1A2 /* CDXMacOSXSupport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDXMacOSXSupport.h; sourceTree = ""; }; + E6E9B05A18145B2900E3C1A2 /* CDXMacOSXSupport.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDXMacOSXSupport.m; sourceTree = ""; }; + E6E9B05B18145B2900E3C1A2 /* CDXPropertyModifierAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDXPropertyModifierAction.h; sourceTree = ""; }; + E6E9B05C18145B2900E3C1A2 /* CDXPropertyModifierAction.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDXPropertyModifierAction.m; sourceTree = ""; }; + E6E9B05D18145B2900E3C1A2 /* CocosDenshion-Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "CocosDenshion-Prefix.pch"; sourceTree = ""; }; + E6E9B05E18145B2900E3C1A2 /* CocosDenshion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CocosDenshion.h; sourceTree = ""; }; + E6E9B05F18145B2900E3C1A2 /* CocosDenshion.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CocosDenshion.m; sourceTree = ""; }; + E6E9B06018145B2900E3C1A2 /* README.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = README.md; sourceTree = ""; }; + E6E9B06118145B2900E3C1A2 /* SimpleAudioEngine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SimpleAudioEngine.h; sourceTree = ""; }; + E6E9B06218145B2900E3C1A2 /* SimpleAudioEngine.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SimpleAudioEngine.m; sourceTree = ""; }; /* End PBXFileReference section */ +/* Begin PBXFrameworksBuildPhase section */ + E6E9B00B1814572C00E3C1A2 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + E6E9B00C1814573700E3C1A2 /* libObjectiveChipmunk.a in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + E6E9B02C18145B0000E3C1A2 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + E6E9B03018145B0000E3C1A2 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + /* Begin PBXGroup section */ 034768DFFF38A50411DB9C8B /* Products */ = { isa = PBXGroup; @@ -1097,6 +992,7 @@ E6E142C913B3EC990052ED3D /* libCocosLib_script.a */, E69291D7161ECA2F00DB1EAA /* libCocosMac.a */, E6929367161ED0A400DB1EAA /* libCocosLibMac_script.a */, + E6E9B02F18145B0000E3C1A2 /* libCocosDenshion.a */, ); name = Products; sourceTree = ""; @@ -1104,36 +1000,40 @@ 0867D691FE84028FC02AAC07 /* CocosLib */ = { isa = PBXGroup; children = ( + E6929345161ECC0200DB1EAA /* AVFoundation.framework */, + E6E2A63612CE492600923828 /* AVFoundation.framework */, + E6E9AFF4181456D700E3C1A2 /* Chipmunk7.xcodeproj */, + E6929343161ECBF700DB1EAA /* Cocoa.framework */, + E6E9AC95181456C100E3C1A2 /* cocos2d */, + E6E9AD65181456C100E3C1A2 /* cocos2d-ui */, + E6E9B01F1814599300E3C1A2 /* CocosLib */, + E6E9B0221814599D00E3C1A2 /* CocosLibMac */, + E6929347161ECC0900DB1EAA /* CoreFoundation.framework */, + E6E2A63812CE492600923828 /* CoreFoundation.framework */, E6929349161ECC4F00DB1EAA /* CoreGraphics.framework */, + E6E2A63A12CE492600923828 /* CoreGraphics.framework */, E692934A161ECC4F00DB1EAA /* CoreMedia.framework */, E692934B161ECC4F00DB1EAA /* CoreMIDI.framework */, + E6E2A63C12CE492600923828 /* CoreMotion.framework */, E692934C161ECC4F00DB1EAA /* CoreText.framework */, E692934D161ECC4F00DB1EAA /* CoreVideo.framework */, + E6E9B03118145B0000E3C1A2 /* CocosDenshion */, + 0867D69AFE84028FC02AAC07 /* Frameworks */, E692934E161ECC4F00DB1EAA /* GLKit.framework */, E692934F161ECC4F00DB1EAA /* GLUT.framework */, + E6E9AD81181456C100E3C1A2 /* kazmath */, + E6E9ADA4181456C100E3C1A2 /* libpng */, + E6929341161ECBF000DB1EAA /* libz.dylib */, + E6E2A64112CE492600923828 /* libz.dylib */, E6929350161ECC4F00DB1EAA /* OpenAL.framework */, E6929351161ECC4F00DB1EAA /* OpenGL.framework */, + E6E2A63F12CE492600923828 /* OpenGLES.framework */, + 034768DFFF38A50411DB9C8B /* Products */, E6929352161ECC4F00DB1EAA /* Quartz.framework */, E6929353161ECC4F00DB1EAA /* QuartzCore.framework */, - E6929347161ECC0900DB1EAA /* CoreFoundation.framework */, - E6929345161ECC0200DB1EAA /* AVFoundation.framework */, - E6929343161ECBF700DB1EAA /* Cocoa.framework */, - E6929341161ECBF000DB1EAA /* libz.dylib */, E66F10C915FE2A2300FB8F3F /* README.md */, - E610373915DD169B00819640 /* include */, - E610367D15DD169B00819640 /* src */, E6AA4DA213B1574400C9F08C /* resources */, - E6AA4C0A13B156F800C9F08C /* CocosLib_Prefix.pch */, - E692935F161ECCDB00DB1EAA /* CocosLibMac-Prefix.pch */, E6AA4AA413B156A600C9F08C /* zip_exclude.lst */, - 0867D69AFE84028FC02AAC07 /* Frameworks */, - 034768DFFF38A50411DB9C8B /* Products */, - E6E2A63612CE492600923828 /* AVFoundation.framework */, - E6E2A63812CE492600923828 /* CoreFoundation.framework */, - E6E2A63A12CE492600923828 /* CoreGraphics.framework */, - E6E2A63C12CE492600923828 /* CoreMotion.framework */, - E6E2A63F12CE492600923828 /* OpenGLES.framework */, - E6E2A64112CE492600923828 /* libz.dylib */, ); name = CocosLib; sourceTree = ""; @@ -1143,683 +1043,494 @@ children = ( AACBBE490F95108600F1A2B1 /* Foundation.framework */, E69291D8161ECA2F00DB1EAA /* Cocoa.framework */, + E6E9B03D18145B0000E3C1A2 /* XCTest.framework */, + E6E9B04018145B0000E3C1A2 /* UIKit.framework */, E69291DA161ECA2F00DB1EAA /* Other Frameworks */, ); name = Frameworks; sourceTree = ""; }; - E610367D15DD169B00819640 /* src */ = { - isa = PBXGroup; - children = ( - E610367E15DD169B00819640 /* Box2D */, - E61036B415DD169B00819640 /* cocos2d */, - E610370B15DD169B00819640 /* CocosDenshion */, - E610371015DD169B00819640 /* CocosDenshionExtras */, - E610371315DD169B00819640 /* kazmath */, - E610372315DD169B00819640 /* libpng */, - ); - path = src; - sourceTree = ""; - }; - E610367E15DD169B00819640 /* Box2D */ = { - isa = PBXGroup; - children = ( - E610367F15DD169B00819640 /* Collision */, - E610368D15DD169B00819640 /* Common */, - E610369415DD169B00819640 /* Dynamics */, - E61036B215DD169B00819640 /* Rope */, - ); - path = Box2D; - sourceTree = ""; - }; - E610367F15DD169B00819640 /* Collision */ = { - isa = PBXGroup; - children = ( - E610368015DD169B00819640 /* b2BroadPhase.cpp */, - E610368115DD169B00819640 /* b2CollideCircle.cpp */, - E610368215DD169B00819640 /* b2CollideEdge.cpp */, - E610368315DD169B00819640 /* b2CollidePolygon.cpp */, - E610368415DD169B00819640 /* b2Collision.cpp */, - E610368515DD169B00819640 /* b2Distance.cpp */, - E610368615DD169B00819640 /* b2DynamicTree.cpp */, - E610368715DD169B00819640 /* b2TimeOfImpact.cpp */, - E610368815DD169B00819640 /* Shapes */, - ); - path = Collision; - sourceTree = ""; - }; - E610368815DD169B00819640 /* Shapes */ = { + E69291DA161ECA2F00DB1EAA /* Other Frameworks */ = { isa = PBXGroup; children = ( - E610368915DD169B00819640 /* b2ChainShape.cpp */, - E610368A15DD169B00819640 /* b2CircleShape.cpp */, - E610368B15DD169B00819640 /* b2EdgeShape.cpp */, - E610368C15DD169B00819640 /* b2PolygonShape.cpp */, + E69291DB161ECA2F00DB1EAA /* AppKit.framework */, + E69291DC161ECA2F00DB1EAA /* CoreData.framework */, + E69291DD161ECA2F00DB1EAA /* Foundation.framework */, ); - path = Shapes; - sourceTree = ""; - }; - E610368D15DD169B00819640 /* Common */ = { - isa = PBXGroup; - children = ( - E610368E15DD169B00819640 /* b2BlockAllocator.cpp */, - E610368F15DD169B00819640 /* b2Draw.cpp */, - E610369015DD169B00819640 /* b2Math.cpp */, - E610369115DD169B00819640 /* b2Settings.cpp */, - E610369215DD169B00819640 /* b2StackAllocator.cpp */, - E610369315DD169B00819640 /* b2Timer.cpp */, - ); - path = Common; - sourceTree = ""; - }; - E610369415DD169B00819640 /* Dynamics */ = { - isa = PBXGroup; - children = ( - E610369515DD169B00819640 /* b2Body.cpp */, - E610369615DD169B00819640 /* b2ContactManager.cpp */, - E610369715DD169B00819640 /* b2Fixture.cpp */, - E610369815DD169B00819640 /* b2Island.cpp */, - E610369915DD169B00819640 /* b2World.cpp */, - E610369A15DD169B00819640 /* b2WorldCallbacks.cpp */, - E610369B15DD169B00819640 /* Contacts */, - E61036A515DD169B00819640 /* Joints */, - ); - path = Dynamics; - sourceTree = ""; - }; - E610369B15DD169B00819640 /* Contacts */ = { - isa = PBXGroup; - children = ( - E610369C15DD169B00819640 /* b2ChainAndCircleContact.cpp */, - E610369D15DD169B00819640 /* b2ChainAndPolygonContact.cpp */, - E610369E15DD169B00819640 /* b2CircleContact.cpp */, - E610369F15DD169B00819640 /* b2Contact.cpp */, - E61036A015DD169B00819640 /* b2ContactSolver.cpp */, - E61036A115DD169B00819640 /* b2EdgeAndCircleContact.cpp */, - E61036A215DD169B00819640 /* b2EdgeAndPolygonContact.cpp */, - E61036A315DD169B00819640 /* b2PolygonAndCircleContact.cpp */, - E61036A415DD169B00819640 /* b2PolygonContact.cpp */, - ); - path = Contacts; - sourceTree = ""; - }; - E61036A515DD169B00819640 /* Joints */ = { - isa = PBXGroup; - children = ( - E61036A615DD169B00819640 /* b2DistanceJoint.cpp */, - E61036A715DD169B00819640 /* b2FrictionJoint.cpp */, - E61036A815DD169B00819640 /* b2GearJoint.cpp */, - E61036A915DD169B00819640 /* b2Joint.cpp */, - E61036AA15DD169B00819640 /* b2MotorJoint.cpp */, - E61036AB15DD169B00819640 /* b2MouseJoint.cpp */, - E61036AC15DD169B00819640 /* b2PrismaticJoint.cpp */, - E61036AD15DD169B00819640 /* b2PulleyJoint.cpp */, - E61036AE15DD169B00819640 /* b2RevoluteJoint.cpp */, - E61036AF15DD169B00819640 /* b2RopeJoint.cpp */, - E61036B015DD169B00819640 /* b2WeldJoint.cpp */, - E61036B115DD169B00819640 /* b2WheelJoint.cpp */, - ); - path = Joints; + name = "Other Frameworks"; sourceTree = ""; }; - E61036B215DD169B00819640 /* Rope */ = { + E6AA4DA213B1574400C9F08C /* resources */ = { isa = PBXGroup; children = ( - E61036B315DD169B00819640 /* b2Rope.cpp */, + E6BD02011792F571009C2A22 /* LICENSE */, + E6BD02021792F571009C2A22 /* LICENSE_Kazmath.txt */, + E64FA07213E75380001A90C1 /* LICENSE_artwork.txt */, + E64FA07313E75380001A90C1 /* LICENSE_Box2D.txt */, + E64FA07513E75380001A90C1 /* LICENSE_cocos2d.txt */, + E64FA07613E75380001A90C1 /* LICENSE_cocosdenshion.txt */, + E64FA07813E75380001A90C1 /* LICENSE_libpng.txt */, + E64FA07A13E75380001A90C1 /* LICENSE.cocos2d */, + E64FA07B13E75380001A90C1 /* LICENSE.cocosdenshion */, ); - path = Rope; + path = resources; sourceTree = ""; }; - E61036B415DD169B00819640 /* cocos2d */ = { + E6E9AC95181456C100E3C1A2 /* cocos2d */ = { isa = PBXGroup; children = ( - E61D8BF615E2772C00F768B0 /* CCRenderTargetNode.m */, - E61036B515DD169B00819640 /* CCAction.m */, - E61036B615DD169B00819640 /* CCActionCamera.m */, - E61036B715DD169B00819640 /* CCActionCatmullRom.m */, - E61036B815DD169B00819640 /* CCActionEase.m */, - E61036B915DD169B00819640 /* CCActionGrid.m */, - E61036BA15DD169B00819640 /* CCActionGrid3D.m */, - E61036BB15DD169B00819640 /* CCActionInstant.m */, - E61036BC15DD169B00819640 /* CCActionInterval.m */, - E61036BD15DD169B00819640 /* CCActionManager.m */, - E61036BE15DD169B00819640 /* CCActionPageTurn3D.m */, - E61036BF15DD169B00819640 /* CCActionProgressTimer.m */, - E61036C015DD169B00819640 /* CCActionTiledGrid.m */, - E61036C115DD169B00819640 /* CCActionTween.m */, - E61036C215DD169B00819640 /* CCAnimation.m */, - E61036C315DD169B00819640 /* CCAnimationCache.m */, - E61036C415DD169B00819640 /* CCAtlasNode.m */, - E61036C515DD169B00819640 /* CCCamera.m */, - E61036C615DD169B00819640 /* CCConfiguration.m */, - E61036C715DD169B00819640 /* ccDeprecated.m */, - E61036C815DD169B00819640 /* CCDirector.m */, - E61036C915DD169B00819640 /* CCDrawingPrimitives.m */, - E61036CA15DD169B00819640 /* CCGLProgram.m */, - E61036CB15DD169B00819640 /* ccGLStateCache.m */, - E61036CC15DD169B00819640 /* CCGrabber.m */, - E61036CD15DD169B00819640 /* CCGrid.m */, - E61036CE15DD169B00819640 /* CCLabelAtlas.m */, - E61036CF15DD169B00819640 /* CCLabelBMFont.m */, - E61036D015DD169B00819640 /* CCLabelTTF.m */, - E61036D115DD169B00819640 /* CCLayer.m */, - E61036D215DD169B00819640 /* CCMenu.m */, - E61036D315DD169B00819640 /* CCMenuItem.m */, - E61036D415DD169B00819640 /* CCMotionStreak.m */, - E61036D515DD169B00819640 /* CCNode+Debug.m */, - E61036D615DD169B00819640 /* CCNode.m */, - E61036D715DD169B00819640 /* CCParallaxNode.m */, - E61036D815DD169B00819640 /* CCParticleBatchNode.m */, - E61036D915DD169B00819640 /* CCParticleSystem.m */, - E61036DA15DD169B00819640 /* CCParticleSystemQuad.m */, - E61036DB15DD169B00819640 /* CCProgressTimer.m */, - E61036DC15DD169B00819640 /* CCRenderTexture.m */, - E61036DD15DD169B00819640 /* CCScene.m */, - E61036DE15DD169B00819640 /* CCScheduler.m */, - E61036DF15DD169B00819640 /* CCShaderCache.m */, - E61036E015DD169B00819640 /* ccShaders.m */, - E61036E115DD169B00819640 /* CCSprite.m */, - E61036E215DD169B00819640 /* CCSpriteBatchNode.m */, - E61036E315DD169B00819640 /* CCSpriteFrame.m */, - E61036E415DD169B00819640 /* CCSpriteFrameCache.m */, - E61036E515DD169B00819640 /* CCTexture2D.m */, - E61036E615DD169B00819640 /* CCTextureAtlas.m */, - E61036E715DD169B00819640 /* CCTextureCache.m */, - E61036E815DD169B00819640 /* CCTexturePVR.m */, - E61036E915DD169B00819640 /* CCTileMapAtlas.m */, - E61036EA15DD169B00819640 /* CCTMXLayer.m */, - E61036EB15DD169B00819640 /* CCTMXObjectGroup.m */, - E61036EC15DD169B00819640 /* CCTMXTiledMap.m */, - E61036ED15DD169B00819640 /* CCTMXXMLParser.m */, - E61036EE15DD169B00819640 /* CCTransition.m */, - E61036EF15DD169B00819640 /* CCTransitionPageTurn.m */, - E61036F015DD169B00819640 /* CCTransitionProgress.m */, - E61036F115DD169B00819640 /* cocos2d.m */, - E61036F215DD169B00819640 /* Platforms */, - E61036FE15DD169B00819640 /* Support */, + E6E9AC96181456C100E3C1A2 /* CCAction.h */, + E6E9AC97181456C100E3C1A2 /* CCAction.m */, + E6E9AC98181456C100E3C1A2 /* CCActionCatmullRom.h */, + E6E9AC99181456C100E3C1A2 /* CCActionCatmullRom.m */, + E6E9AC9A181456C100E3C1A2 /* CCActionEase.h */, + E6E9AC9B181456C100E3C1A2 /* CCActionEase.m */, + E6E9AC9C181456C100E3C1A2 /* CCActionGrid.h */, + E6E9AC9D181456C100E3C1A2 /* CCActionGrid.m */, + E6E9AC9E181456C100E3C1A2 /* CCActionGrid3D.h */, + E6E9AC9F181456C100E3C1A2 /* CCActionGrid3D.m */, + E6E9ACA0181456C100E3C1A2 /* CCActionInstant.h */, + E6E9ACA1181456C100E3C1A2 /* CCActionInstant.m */, + E6E9ACA2181456C100E3C1A2 /* CCActionInterval.h */, + E6E9ACA3181456C100E3C1A2 /* CCActionInterval.m */, + E6E9ACA4181456C100E3C1A2 /* CCActionManager.h */, + E6E9ACA5181456C100E3C1A2 /* CCActionManager.m */, + E6E9ACA6181456C100E3C1A2 /* CCActionPageTurn3D.h */, + E6E9ACA7181456C100E3C1A2 /* CCActionPageTurn3D.m */, + E6E9ACA8181456C100E3C1A2 /* CCActionProgressTimer.h */, + E6E9ACA9181456C100E3C1A2 /* CCActionProgressTimer.m */, + E6E9ACAA181456C100E3C1A2 /* CCActionTiledGrid.h */, + E6E9ACAB181456C100E3C1A2 /* CCActionTiledGrid.m */, + E6E9ACAC181456C100E3C1A2 /* CCActionTween.h */, + E6E9ACAD181456C100E3C1A2 /* CCActionTween.m */, + E6E9ACAE181456C100E3C1A2 /* CCAnimation.h */, + E6E9ACAF181456C100E3C1A2 /* CCAnimation.m */, + E6E9ACB0181456C100E3C1A2 /* CCAnimationCache.h */, + E6E9ACB1181456C100E3C1A2 /* CCAnimationCache.m */, + E6E9ACB2181456C100E3C1A2 /* CCAtlasNode.h */, + E6E9ACB3181456C100E3C1A2 /* CCAtlasNode.m */, + E6E9ACB4181456C100E3C1A2 /* CCCamera.h */, + E6E9ACB5181456C100E3C1A2 /* CCClippingNode.h */, + E6E9ACB6181456C100E3C1A2 /* CCClippingNode.m */, + E6E9ACB7181456C100E3C1A2 /* ccConfig.h */, + E6E9ACB8181456C100E3C1A2 /* CCConfiguration.h */, + E6E9ACB9181456C100E3C1A2 /* CCConfiguration.m */, + E6E9ACBA181456C100E3C1A2 /* ccDeprecated.h */, + E6E9ACBB181456C100E3C1A2 /* ccDeprecated.m */, + E6E9ACBC181456C100E3C1A2 /* CCDirector.h */, + E6E9ACBD181456C100E3C1A2 /* CCDirector.m */, + E6E9ACBE181456C100E3C1A2 /* CCDrawingPrimitives.h */, + E6E9ACBF181456C100E3C1A2 /* CCDrawingPrimitives.m */, + E6E9ACC0181456C100E3C1A2 /* CCDrawNode.h */, + E6E9ACC1181456C100E3C1A2 /* CCDrawNode.m */, + E6E9ACC2181456C100E3C1A2 /* ccFPSImages.h */, + E6E9ACC3181456C100E3C1A2 /* ccFPSImages.m */, + E6E9ACC4181456C100E3C1A2 /* CCGLProgram.h */, + E6E9ACC5181456C100E3C1A2 /* CCGLProgram.m */, + E6E9ACC6181456C100E3C1A2 /* ccGLStateCache.h */, + E6E9ACC7181456C100E3C1A2 /* ccGLStateCache.m */, + E6E9ACC8181456C100E3C1A2 /* CCGrabber.h */, + E6E9ACC9181456C100E3C1A2 /* CCGrabber.m */, + E6E9ACCA181456C100E3C1A2 /* CCGrid.h */, + E6E9ACCB181456C100E3C1A2 /* CCGrid.m */, + E6E9ACCC181456C100E3C1A2 /* CCLabelAtlas.h */, + E6E9ACCD181456C100E3C1A2 /* CCLabelAtlas.m */, + E6E9ACCE181456C100E3C1A2 /* CCLabelBMFont.h */, + E6E9ACCF181456C100E3C1A2 /* CCLabelBMFont.m */, + E6E9ACD0181456C100E3C1A2 /* CCLabelTTF.h */, + E6E9ACD1181456C100E3C1A2 /* CCLabelTTF.m */, + E6E9ACD2181456C100E3C1A2 /* CCLayer.h */, + E6E9ACD3181456C100E3C1A2 /* CCLayer.m */, + E6E9ACD4181456C100E3C1A2 /* ccMacros.h */, + E6E9ACD5181456C100E3C1A2 /* CCMenu.h */, + E6E9ACD6181456C100E3C1A2 /* CCMenu.m */, + E6E9ACD7181456C100E3C1A2 /* CCMenuItem.h */, + E6E9ACD8181456C100E3C1A2 /* CCMenuItem.m */, + E6E9ACD9181456C100E3C1A2 /* CCMotionStreak.h */, + E6E9ACDA181456C100E3C1A2 /* CCMotionStreak.m */, + E6E9ACDB181456C100E3C1A2 /* CCNode+Debug.h */, + E6E9ACDC181456C100E3C1A2 /* CCNode+Debug.m */, + E6E9ACDD181456C100E3C1A2 /* CCNode.h */, + E6E9ACDE181456C100E3C1A2 /* CCNode.m */, + E6E9ACDF181456C100E3C1A2 /* CCParallaxNode.h */, + E6E9ACE0181456C100E3C1A2 /* CCParallaxNode.m */, + E6E9ACE1181456C100E3C1A2 /* CCParticleBatchNode.h */, + E6E9ACE2181456C100E3C1A2 /* CCParticleBatchNode.m */, + E6E9ACE3181456C100E3C1A2 /* CCParticleExamples.h */, + E6E9ACE4181456C100E3C1A2 /* CCParticleExamples.m */, + E6E9ACE5181456C100E3C1A2 /* CCParticleSystem.h */, + E6E9ACE6181456C100E3C1A2 /* CCParticleSystem.m */, + E6E9ACE7181456C100E3C1A2 /* CCParticleSystemQuad.h */, + E6E9ACE8181456C100E3C1A2 /* CCParticleSystemQuad.m */, + E6E9ACE9181456C100E3C1A2 /* CCPhysics+ObjectiveChipmunk.h */, + E6E9ACEA181456C100E3C1A2 /* CCPhysicsbody.h */, + E6E9ACEB181456C100E3C1A2 /* CCPhysicsBody.m */, + E6E9ACEC181456C100E3C1A2 /* CCPhysicsJoint.h */, + E6E9ACED181456C100E3C1A2 /* CCPhysicsJoint.m */, + E6E9ACEE181456C100E3C1A2 /* CCPhysicsNode.h */, + E6E9ACEF181456C100E3C1A2 /* CCPhysicsNode.m */, + E6E9ACF0181456C100E3C1A2 /* CCProgressTimer.h */, + E6E9ACF1181456C100E3C1A2 /* CCProgressTimer.m */, + E6E9ACF2181456C100E3C1A2 /* CCProtocols.h */, + E6E9ACF3181456C100E3C1A2 /* CCRenderTexture.h */, + E6E9ACF4181456C100E3C1A2 /* CCRenderTexture.m */, + E6E9ACF5181456C100E3C1A2 /* CCResponder.h */, + E6E9ACF6181456C100E3C1A2 /* CCResponder.m */, + E6E9ACF7181456C100E3C1A2 /* CCResponderManager.h */, + E6E9ACF8181456C100E3C1A2 /* CCResponderManager.m */, + E6E9ACF9181456C100E3C1A2 /* CCScene.h */, + E6E9ACFA181456C100E3C1A2 /* CCScene.m */, + E6E9ACFB181456C100E3C1A2 /* CCScheduler.h */, + E6E9ACFC181456C100E3C1A2 /* CCScheduler.m */, + E6E9ACFD181456C100E3C1A2 /* ccShader_Position_uColor_frag.h */, + E6E9ACFE181456C100E3C1A2 /* ccShader_Position_uColor_vert.h */, + E6E9ACFF181456C100E3C1A2 /* ccShader_PositionColor_frag.h */, + E6E9AD00181456C100E3C1A2 /* ccShader_PositionColor_vert.h */, + E6E9AD01181456C100E3C1A2 /* ccShader_PositionColorLengthTexture_frag.h */, + E6E9AD02181456C100E3C1A2 /* ccShader_PositionColorLengthTexture_vert.h */, + E6E9AD03181456C100E3C1A2 /* ccShader_PositionTexture_frag.h */, + E6E9AD04181456C100E3C1A2 /* ccShader_PositionTexture_uColor_frag.h */, + E6E9AD05181456C100E3C1A2 /* ccShader_PositionTexture_uColor_vert.h */, + E6E9AD06181456C100E3C1A2 /* ccShader_PositionTexture_vert.h */, + E6E9AD07181456C100E3C1A2 /* ccShader_PositionTextureA8Color_frag.h */, + E6E9AD08181456C100E3C1A2 /* ccShader_PositionTextureA8Color_vert.h */, + E6E9AD09181456C100E3C1A2 /* ccShader_PositionTextureColor_frag.h */, + E6E9AD0A181456C100E3C1A2 /* ccShader_PositionTextureColor_vert.h */, + E6E9AD0B181456C100E3C1A2 /* ccShader_PositionTextureColorAlphaTest_frag.h */, + E6E9AD0C181456C100E3C1A2 /* CCShaderCache.h */, + E6E9AD0D181456C100E3C1A2 /* CCShaderCache.m */, + E6E9AD0E181456C100E3C1A2 /* ccShaders.h */, + E6E9AD0F181456C100E3C1A2 /* ccShaders.m */, + E6E9AD10181456C100E3C1A2 /* CCSprite.h */, + E6E9AD11181456C100E3C1A2 /* CCSprite.m */, + E6E9AD12181456C100E3C1A2 /* CCSprite9Slice.h */, + E6E9AD13181456C100E3C1A2 /* CCSprite9Slice.m */, + E6E9AD14181456C100E3C1A2 /* CCSpriteBatchNode.h */, + E6E9AD15181456C100E3C1A2 /* CCSpriteBatchNode.m */, + E6E9AD16181456C100E3C1A2 /* CCSpriteFrame.h */, + E6E9AD17181456C100E3C1A2 /* CCSpriteFrame.m */, + E6E9AD18181456C100E3C1A2 /* CCSpriteFrameCache.h */, + E6E9AD19181456C100E3C1A2 /* CCSpriteFrameCache.m */, + E6E9AD1A181456C100E3C1A2 /* CCTexture2D.h */, + E6E9AD1B181456C100E3C1A2 /* CCTexture2D.m */, + E6E9AD1C181456C100E3C1A2 /* CCTextureAtlas.h */, + E6E9AD1D181456C100E3C1A2 /* CCTextureAtlas.m */, + E6E9AD1E181456C100E3C1A2 /* CCTextureCache.h */, + E6E9AD1F181456C100E3C1A2 /* CCTextureCache.m */, + E6E9AD20181456C100E3C1A2 /* CCTexturePVR.h */, + E6E9AD21181456C100E3C1A2 /* CCTexturePVR.m */, + E6E9AD22181456C100E3C1A2 /* CCTileMapAtlas.h */, + E6E9AD23181456C100E3C1A2 /* CCTileMapAtlas.m */, + E6E9AD24181456C100E3C1A2 /* CCTMXLayer.h */, + E6E9AD25181456C100E3C1A2 /* CCTMXLayer.m */, + E6E9AD26181456C100E3C1A2 /* CCTMXObjectGroup.h */, + E6E9AD27181456C100E3C1A2 /* CCTMXObjectGroup.m */, + E6E9AD28181456C100E3C1A2 /* CCTMXTiledMap.h */, + E6E9AD29181456C100E3C1A2 /* CCTMXTiledMap.m */, + E6E9AD2A181456C100E3C1A2 /* CCTMXXMLParser.h */, + E6E9AD2B181456C100E3C1A2 /* CCTMXXMLParser.m */, + E6E9AD2C181456C100E3C1A2 /* CCTransition.h */, + E6E9AD2D181456C100E3C1A2 /* CCTransition.m */, + E6E9AD2E181456C100E3C1A2 /* ccTypes.h */, + E6E9AD2F181456C100E3C1A2 /* cocos2d.h */, + E6E9AD30181456C100E3C1A2 /* cocos2d.m */, + E6E9AD31181456C100E3C1A2 /* Platforms */, + E6E9AD4B181456C100E3C1A2 /* Support */, ); path = cocos2d; sourceTree = ""; }; - E61036F215DD169B00819640 /* Platforms */ = { + E6E9AD31181456C100E3C1A2 /* Platforms */ = { isa = PBXGroup; children = ( - E61036F315DD169B00819640 /* iOS */, - E61036F915DD169B00819640 /* Mac */, + E6E9AD32181456C100E3C1A2 /* CCGL.h */, + E6E9AD33181456C100E3C1A2 /* CCNS.h */, + E6E9AD34181456C100E3C1A2 /* iOS */, + E6E9AD42181456C100E3C1A2 /* Mac */, ); path = Platforms; sourceTree = ""; }; - E61036F315DD169B00819640 /* iOS */ = { + E6E9AD34181456C100E3C1A2 /* iOS */ = { isa = PBXGroup; children = ( - E61036F415DD169B00819640 /* CCDirectorIOS.m */, - E61036F515DD169B00819640 /* CCES2Renderer.m */, - E61036F615DD169B00819640 /* CCGLView.m */, - E61036F715DD169B00819640 /* CCTouchDispatcher.m */, - E61036F815DD169B00819640 /* CCTouchHandler.m */, + E6E9AD35181456C100E3C1A2 /* CCDirectorIOS.h */, + E6E9AD36181456C100E3C1A2 /* CCDirectorIOS.m */, + E6E9AD37181456C100E3C1A2 /* CCES2Renderer.h */, + E6E9AD38181456C100E3C1A2 /* CCES2Renderer.m */, + E6E9AD39181456C100E3C1A2 /* CCESRenderer.h */, + E6E9AD3A181456C100E3C1A2 /* CCGLView.h */, + E6E9AD3B181456C100E3C1A2 /* CCGLView.m */, + E6E9AD3C181456C100E3C1A2 /* CCResponder.h */, + E6E9AD3D181456C100E3C1A2 /* CCResponder.m */, + E6E9AD3E181456C100E3C1A2 /* CCResponderManager.h */, + E6E9AD3F181456C100E3C1A2 /* CCResponderManager.m */, + E6E9AD40181456C100E3C1A2 /* UITouch+CC.h */, + E6E9AD41181456C100E3C1A2 /* UITouch+CC.m */, ); path = iOS; sourceTree = ""; }; - E61036F915DD169B00819640 /* Mac */ = { + E6E9AD42181456C100E3C1A2 /* Mac */ = { isa = PBXGroup; children = ( - E61036FA15DD169B00819640 /* CCDirectorMac.m */, - E61036FB15DD169B00819640 /* CCEventDispatcher.m */, - E61036FC15DD169B00819640 /* CCGLView.m */, - E61036FD15DD169B00819640 /* CCWindow.m */, + E6E9AD43181456C100E3C1A2 /* CCDirectorMac.h */, + E6E9AD44181456C100E3C1A2 /* CCDirectorMac.m */, + E6E9AD45181456C100E3C1A2 /* CCGLView.h */, + E6E9AD46181456C100E3C1A2 /* CCGLView.m */, + E6E9AD47181456C100E3C1A2 /* CCWindow.h */, + E6E9AD48181456C100E3C1A2 /* CCWindow.m */, + E6E9AD49181456C100E3C1A2 /* NSEvent+CC.h */, + E6E9AD4A181456C100E3C1A2 /* NSEvent+CC.m */, ); path = Mac; sourceTree = ""; }; - E61036FE15DD169B00819640 /* Support */ = { + E6E9AD4B181456C100E3C1A2 /* Support */ = { isa = PBXGroup; children = ( - E61036FF15DD169B00819640 /* base64.c */, - E610370015DD169B00819640 /* CCArray.m */, - E610370115DD169B00819640 /* ccCArray.m */, - E610370215DD169B00819640 /* CCFileUtils.m */, - E610370315DD169B00819640 /* CCProfiling.m */, - E610370415DD169B00819640 /* ccUtils.c */, - E610370515DD169B00819640 /* CCVertex.m */, - E610370615DD169B00819640 /* CGPointExtension.m */, - E610370715DD169B00819640 /* NSThread+performBlock.m */, - E610370815DD169B00819640 /* TGAlib.m */, - E610370915DD169B00819640 /* TransformUtils.m */, - E610370A15DD169B00819640 /* ZipUtils.m */, + E6E9AD4C181456C100E3C1A2 /* base64.c */, + E6E9AD4D181456C100E3C1A2 /* base64.h */, + E6E9AD4E181456C100E3C1A2 /* CCFileUtils.h */, + E6E9AD4F181456C100E3C1A2 /* CCFileUtils.m */, + E6E9AD50181456C100E3C1A2 /* CCProfiling.h */, + E6E9AD51181456C100E3C1A2 /* CCProfiling.m */, + E6E9AD52181456C100E3C1A2 /* ccUtils.c */, + E6E9AD53181456C100E3C1A2 /* ccUtils.h */, + E6E9AD54181456C100E3C1A2 /* CCVertex.h */, + E6E9AD55181456C100E3C1A2 /* CCVertex.m */, + E6E9AD56181456C100E3C1A2 /* CGPointExtension.h */, + E6E9AD57181456C100E3C1A2 /* CGPointExtension.m */, + E6E9AD58181456C100E3C1A2 /* NSAttributedString+CCAdditions.h */, + E6E9AD59181456C100E3C1A2 /* NSAttributedString+CCAdditions.m */, + E6E9AD5A181456C100E3C1A2 /* NSThread+performBlock.h */, + E6E9AD5B181456C100E3C1A2 /* NSThread+performBlock.m */, + E6E9AD5C181456C100E3C1A2 /* OpenGL_Internal.h */, + E6E9AD5D181456C100E3C1A2 /* TGAlib.h */, + E6E9AD5E181456C100E3C1A2 /* TGAlib.m */, + E6E9AD5F181456C100E3C1A2 /* TransformUtils.h */, + E6E9AD60181456C100E3C1A2 /* TransformUtils.m */, + E6E9AD61181456C100E3C1A2 /* uthash.h */, + E6E9AD62181456C100E3C1A2 /* utlist.h */, + E6E9AD63181456C100E3C1A2 /* ZipUtils.h */, + E6E9AD64181456C100E3C1A2 /* ZipUtils.m */, ); path = Support; sourceTree = ""; }; - E610370B15DD169B00819640 /* CocosDenshion */ = { + E6E9AD65181456C100E3C1A2 /* cocos2d-ui */ = { isa = PBXGroup; children = ( - E610370C15DD169B00819640 /* CDAudioManager.m */, - E610370D15DD169B00819640 /* CDOpenALSupport.m */, - E610370E15DD169B00819640 /* CocosDenshion.m */, - E610370F15DD169B00819640 /* SimpleAudioEngine.m */, - ); - path = CocosDenshion; + E6E9AD66181456C100E3C1A2 /* CCButton.h */, + E6E9AD67181456C100E3C1A2 /* CCButton.m */, + E6E9AD68181456C100E3C1A2 /* CCControl.h */, + E6E9AD69181456C100E3C1A2 /* CCControl.m */, + E6E9AD6A181456C100E3C1A2 /* CCControlSubclass.h */, + E6E9AD6B181456C100E3C1A2 /* CCControlTextureFactory.h */, + E6E9AD6C181456C100E3C1A2 /* CCControlTextureFactory.m */, + E6E9AD6D181456C100E3C1A2 /* CCScrollView.h */, + E6E9AD6E181456C100E3C1A2 /* CCScrollView.m */, + E6E9AD6F181456C100E3C1A2 /* CCTableView.h */, + E6E9AD70181456C100E3C1A2 /* CCTableView.m */, + E6E9AD71181456C100E3C1A2 /* cocos2d-ui.h */, + ); + path = "cocos2d-ui"; sourceTree = ""; }; - E610371015DD169B00819640 /* CocosDenshionExtras */ = { + E6E9AD81181456C100E3C1A2 /* kazmath */ = { isa = PBXGroup; children = ( - E610371115DD169B00819640 /* CDXMacOSXSupport.m */, - E610371215DD169B00819640 /* CDXPropertyModifierAction.m */, + E6E9AD82181456C100E3C1A2 /* include */, + E6E9AD93181456C100E3C1A2 /* src */, ); - path = CocosDenshionExtras; + name = kazmath; + path = external/kazmath; sourceTree = ""; }; - E610371315DD169B00819640 /* kazmath */ = { + E6E9AD82181456C100E3C1A2 /* include */ = { isa = PBXGroup; children = ( - E610371415DD169B00819640 /* aabb.c */, - E610371515DD169B00819640 /* ChangeLog */, - E610371615DD169B00819640 /* GL */, - E610371915DD169B00819640 /* mat3.c */, - E610371A15DD169B00819640 /* mat4.c */, - E610371B15DD169B00819640 /* neon_matrix_impl.c */, - E610371C15DD169B00819640 /* plane.c */, - E610371D15DD169B00819640 /* quaternion.c */, - E610371E15DD169B00819640 /* ray2.c */, - E610371F15DD169B00819640 /* utility.c */, - E610372015DD169B00819640 /* vec2.c */, - E610372115DD169B00819640 /* vec3.c */, - E610372215DD169B00819640 /* vec4.c */, - ); - path = kazmath; - sourceTree = ""; - }; - E610371615DD169B00819640 /* GL */ = { - isa = PBXGroup; - children = ( - E610371715DD169B00819640 /* mat4stack.c */, - E610371815DD169B00819640 /* matrix.c */, - ); - path = GL; - sourceTree = ""; - }; - E610372315DD169B00819640 /* libpng */ = { - isa = PBXGroup; - children = ( - E610372415DD169B00819640 /* png.c */, - E610372515DD169B00819640 /* pngerror.c */, - E610372615DD169B00819640 /* pnggccrd.c */, - E610372715DD169B00819640 /* pngget.c */, - E610372815DD169B00819640 /* pngmem.c */, - E610372915DD169B00819640 /* pngnow.png */, - E610372A15DD169B00819640 /* pngpread.c */, - E610372B15DD169B00819640 /* pngread.c */, - E610372C15DD169B00819640 /* pngrio.c */, - E610372D15DD169B00819640 /* pngrtran.c */, - E610372E15DD169B00819640 /* pngrutil.c */, - E610372F15DD169B00819640 /* pngset.c */, - E610373015DD169B00819640 /* pngtrans.c */, - E610373115DD169B00819640 /* pngvcrd.c */, - E610373215DD169B00819640 /* pngwio.c */, - E610373315DD169B00819640 /* pngwrite.c */, - E610373415DD169B00819640 /* pngwtran.c */, - E610373515DD169B00819640 /* pngwutil.c */, - E610373615DD169B00819640 /* README */, - E610373715DD169B00819640 /* TODO */, - E610373815DD169B00819640 /* Y2KINFO */, - ); - path = libpng; - sourceTree = ""; - }; - E610373915DD169B00819640 /* include */ = { - isa = PBXGroup; - children = ( - E610373A15DD169B00819640 /* Box2D */, - E610377115DD169B00819640 /* cocos2d */, - E61037E115DD169B00819640 /* CocosDenshion */, - E61037E715DD169B00819640 /* CocosDenshionExtras */, - E61037EA15DD169B00819640 /* kazmath */, - E61037FA15DD169B00819640 /* libpng */, + E6E9AD83181456C100E3C1A2 /* kazmath */, ); path = include; sourceTree = ""; }; - E610373A15DD169B00819640 /* Box2D */ = { + E6E9AD83181456C100E3C1A2 /* kazmath */ = { isa = PBXGroup; children = ( - E610373B15DD169B00819640 /* Box2D.h */, - E610373C15DD169B00819640 /* Collision */, - E610374815DD169B00819640 /* Common */, - E610375015DD169B00819640 /* Dynamics */, - E610376F15DD169B00819640 /* Rope */, + E6E9AD84181456C100E3C1A2 /* aabb.h */, + E6E9AD85181456C100E3C1A2 /* GL */, + E6E9AD88181456C100E3C1A2 /* kazmath.h */, + E6E9AD89181456C100E3C1A2 /* mat3.h */, + E6E9AD8A181456C100E3C1A2 /* mat4.h */, + E6E9AD8B181456C100E3C1A2 /* neon_matrix_impl.h */, + E6E9AD8C181456C100E3C1A2 /* plane.h */, + E6E9AD8D181456C100E3C1A2 /* quaternion.h */, + E6E9AD8E181456C100E3C1A2 /* ray2.h */, + E6E9AD8F181456C100E3C1A2 /* utility.h */, + E6E9AD90181456C100E3C1A2 /* vec2.h */, + E6E9AD91181456C100E3C1A2 /* vec3.h */, + E6E9AD92181456C100E3C1A2 /* vec4.h */, ); - path = Box2D; - sourceTree = ""; - }; - E610373C15DD169B00819640 /* Collision */ = { - isa = PBXGroup; - children = ( - E610373D15DD169B00819640 /* b2BroadPhase.h */, - E610373E15DD169B00819640 /* b2Collision.h */, - E610373F15DD169B00819640 /* b2Distance.h */, - E610374015DD169B00819640 /* b2DynamicTree.h */, - E610374115DD169B00819640 /* b2TimeOfImpact.h */, - E610374215DD169B00819640 /* Shapes */, - ); - path = Collision; + path = kazmath; sourceTree = ""; }; - E610374215DD169B00819640 /* Shapes */ = { + E6E9AD85181456C100E3C1A2 /* GL */ = { isa = PBXGroup; children = ( - E610374315DD169B00819640 /* b2ChainShape.h */, - E610374415DD169B00819640 /* b2CircleShape.h */, - E610374515DD169B00819640 /* b2EdgeShape.h */, - E610374615DD169B00819640 /* b2PolygonShape.h */, - E610374715DD169B00819640 /* b2Shape.h */, + E6E9AD86181456C100E3C1A2 /* mat4stack.h */, + E6E9AD87181456C100E3C1A2 /* matrix.h */, ); - path = Shapes; - sourceTree = ""; - }; - E610374815DD169B00819640 /* Common */ = { - isa = PBXGroup; - children = ( - E610374915DD169B00819640 /* b2BlockAllocator.h */, - E610374A15DD169B00819640 /* b2Draw.h */, - E610374B15DD169B00819640 /* b2GrowableStack.h */, - E610374C15DD169B00819640 /* b2Math.h */, - E610374D15DD169B00819640 /* b2Settings.h */, - E610374E15DD169B00819640 /* b2StackAllocator.h */, - E610374F15DD169B00819640 /* b2Timer.h */, - ); - path = Common; - sourceTree = ""; - }; - E610375015DD169B00819640 /* Dynamics */ = { - isa = PBXGroup; - children = ( - E610375115DD169B00819640 /* b2Body.h */, - E610375215DD169B00819640 /* b2ContactManager.h */, - E610375315DD169B00819640 /* b2Fixture.h */, - E610375415DD169B00819640 /* b2Island.h */, - E610375515DD169B00819640 /* b2TimeStep.h */, - E610375615DD169B00819640 /* b2World.h */, - E610375715DD169B00819640 /* b2WorldCallbacks.h */, - E610375815DD169B00819640 /* Contacts */, - E610376215DD169B00819640 /* Joints */, - ); - path = Dynamics; - sourceTree = ""; - }; - E610375815DD169B00819640 /* Contacts */ = { - isa = PBXGroup; - children = ( - E610375915DD169B00819640 /* b2ChainAndCircleContact.h */, - E610375A15DD169B00819640 /* b2ChainAndPolygonContact.h */, - E610375B15DD169B00819640 /* b2CircleContact.h */, - E610375C15DD169B00819640 /* b2Contact.h */, - E610375D15DD169B00819640 /* b2ContactSolver.h */, - E610375E15DD169B00819640 /* b2EdgeAndCircleContact.h */, - E610375F15DD169B00819640 /* b2EdgeAndPolygonContact.h */, - E610376015DD169B00819640 /* b2PolygonAndCircleContact.h */, - E610376115DD169B00819640 /* b2PolygonContact.h */, - ); - path = Contacts; - sourceTree = ""; - }; - E610376215DD169B00819640 /* Joints */ = { - isa = PBXGroup; - children = ( - E610376315DD169B00819640 /* b2DistanceJoint.h */, - E610376415DD169B00819640 /* b2FrictionJoint.h */, - E610376515DD169B00819640 /* b2GearJoint.h */, - E610376615DD169B00819640 /* b2Joint.h */, - E610376715DD169B00819640 /* b2MotorJoint.h */, - E610376815DD169B00819640 /* b2MouseJoint.h */, - E610376915DD169B00819640 /* b2PrismaticJoint.h */, - E610376A15DD169B00819640 /* b2PulleyJoint.h */, - E610376B15DD169B00819640 /* b2RevoluteJoint.h */, - E610376C15DD169B00819640 /* b2RopeJoint.h */, - E610376D15DD169B00819640 /* b2WeldJoint.h */, - E610376E15DD169B00819640 /* b2WheelJoint.h */, - ); - path = Joints; + path = GL; sourceTree = ""; }; - E610376F15DD169B00819640 /* Rope */ = { + E6E9AD93181456C100E3C1A2 /* src */ = { isa = PBXGroup; children = ( - E610377015DD169B00819640 /* b2Rope.h */, + E6E9AD94181456C100E3C1A2 /* aabb.c */, + E6E9AD95181456C100E3C1A2 /* ChangeLog */, + E6E9AD96181456C100E3C1A2 /* CMakeLists.txt */, + E6E9AD97181456C100E3C1A2 /* GL */, + E6E9AD9A181456C100E3C1A2 /* mat3.c */, + E6E9AD9B181456C100E3C1A2 /* mat4.c */, + E6E9AD9C181456C100E3C1A2 /* neon_matrix_impl.c */, + E6E9AD9D181456C100E3C1A2 /* plane.c */, + E6E9AD9E181456C100E3C1A2 /* quaternion.c */, + E6E9AD9F181456C100E3C1A2 /* ray2.c */, + E6E9ADA0181456C100E3C1A2 /* utility.c */, + E6E9ADA1181456C100E3C1A2 /* vec2.c */, + E6E9ADA2181456C100E3C1A2 /* vec3.c */, + E6E9ADA3181456C100E3C1A2 /* vec4.c */, ); - path = Rope; + path = src; sourceTree = ""; }; - E610377115DD169B00819640 /* cocos2d */ = { + E6E9AD97181456C100E3C1A2 /* GL */ = { isa = PBXGroup; children = ( - E61D8BF415E2771F00F768B0 /* CCRenderTargetNode.h */, - E610377215DD169B00819640 /* CCAction.h */, - E610377315DD169B00819640 /* CCActionCamera.h */, - E610377415DD169B00819640 /* CCActionCatmullRom.h */, - E610377515DD169B00819640 /* CCActionEase.h */, - E610377615DD169B00819640 /* CCActionGrid.h */, - E610377715DD169B00819640 /* CCActionGrid3D.h */, - E610377815DD169B00819640 /* CCActionInstant.h */, - E610377915DD169B00819640 /* CCActionInterval.h */, - E610377A15DD169B00819640 /* CCActionManager.h */, - E610377B15DD169B00819640 /* CCActionPageTurn3D.h */, - E610377C15DD169B00819640 /* CCActionProgressTimer.h */, - E610377D15DD169B00819640 /* CCActionTiledGrid.h */, - E610377E15DD169B00819640 /* CCActionTween.h */, - E610377F15DD169B00819640 /* CCAnimation.h */, - E610378015DD169B00819640 /* CCAnimationCache.h */, - E610378115DD169B00819640 /* CCAtlasNode.h */, - E610378215DD169B00819640 /* CCCamera.h */, - E610378315DD169B00819640 /* ccConfig.h */, - E610378415DD169B00819640 /* CCConfiguration.h */, - E610378515DD169B00819640 /* ccDeprecated.h */, - E610378615DD169B00819640 /* CCDirector.h */, - E610378715DD169B00819640 /* CCDrawingPrimitives.h */, - E610378815DD169B00819640 /* CCGLProgram.h */, - E610378915DD169B00819640 /* ccGLStateCache.h */, - E610378A15DD169B00819640 /* CCGrabber.h */, - E610378B15DD169B00819640 /* CCGrid.h */, - E610378C15DD169B00819640 /* CCLabelAtlas.h */, - E610378D15DD169B00819640 /* CCLabelBMFont.h */, - E610378E15DD169B00819640 /* CCLabelTTF.h */, - E610378F15DD169B00819640 /* CCLayer.h */, - E610379015DD169B00819640 /* ccMacros.h */, - E610379115DD169B00819640 /* CCMenu.h */, - E610379215DD169B00819640 /* CCMenuItem.h */, - E610379315DD169B00819640 /* CCMotionStreak.h */, - E610379415DD169B00819640 /* CCNode+Debug.h */, - E610379515DD169B00819640 /* CCNode.h */, - E610379615DD169B00819640 /* CCParallaxNode.h */, - E610379715DD169B00819640 /* CCParticleBatchNode.h */, - E610379815DD169B00819640 /* CCParticleSystem.h */, - E610379915DD169B00819640 /* CCParticleSystemQuad.h */, - E610379A15DD169B00819640 /* CCProgressTimer.h */, - E610379B15DD169B00819640 /* CCProtocols.h */, - E610379C15DD169B00819640 /* CCRenderTexture.h */, - E610379D15DD169B00819640 /* CCScene.h */, - E610379E15DD169B00819640 /* CCScheduler.h */, - E610379F15DD169B00819640 /* ccShader_Position_uColor_frag.h */, - E61037A015DD169B00819640 /* ccShader_Position_uColor_vert.h */, - E61037A115DD169B00819640 /* ccShader_PositionColor_frag.h */, - E61037A215DD169B00819640 /* ccShader_PositionColor_vert.h */, - E61037A315DD169B00819640 /* ccShader_PositionTexture_frag.h */, - E61037A415DD169B00819640 /* ccShader_PositionTexture_uColor_frag.h */, - E61037A515DD169B00819640 /* ccShader_PositionTexture_uColor_vert.h */, - E61037A615DD169B00819640 /* ccShader_PositionTexture_vert.h */, - E61037A715DD169B00819640 /* ccShader_PositionTextureA8Color_frag.h */, - E61037A815DD169B00819640 /* ccShader_PositionTextureA8Color_vert.h */, - E61037A915DD169B00819640 /* ccShader_PositionTextureColor_frag.h */, - E61037AA15DD169B00819640 /* ccShader_PositionTextureColor_vert.h */, - E61037AB15DD169B00819640 /* ccShader_PositionTextureColorAlphaTest_frag.h */, - E61037AC15DD169B00819640 /* CCShaderCache.h */, - E61037AD15DD169B00819640 /* ccShaders.h */, - E61037AE15DD169B00819640 /* CCSprite.h */, - E61037AF15DD169B00819640 /* CCSpriteBatchNode.h */, - E61037B015DD169B00819640 /* CCSpriteFrame.h */, - E61037B115DD169B00819640 /* CCSpriteFrameCache.h */, - E61037B215DD169B00819640 /* CCTexture2D.h */, - E61037B315DD169B00819640 /* CCTextureAtlas.h */, - E61037B415DD169B00819640 /* CCTextureCache.h */, - E61037B515DD169B00819640 /* CCTexturePVR.h */, - E61037B615DD169B00819640 /* CCTileMapAtlas.h */, - E61037B715DD169B00819640 /* CCTMXLayer.h */, - E61037B815DD169B00819640 /* CCTMXObjectGroup.h */, - E61037B915DD169B00819640 /* CCTMXTiledMap.h */, - E61037BA15DD169B00819640 /* CCTMXXMLParser.h */, - E61037BB15DD169B00819640 /* CCTransition.h */, - E61037BC15DD169B00819640 /* CCTransitionOrientationType.h */, - E61037BD15DD169B00819640 /* CCTransitionPageTurn.h */, - E61037BE15DD169B00819640 /* CCTransitionProgress.h */, - E61037BF15DD169B00819640 /* ccTypes.h */, - E61037C015DD169B00819640 /* cocos2d.h */, - E61037C115DD169B00819640 /* Platforms */, - E61037D115DD169B00819640 /* Support */, + E6E9AD98181456C100E3C1A2 /* mat4stack.c */, + E6E9AD99181456C100E3C1A2 /* matrix.c */, ); - path = cocos2d; + path = GL; sourceTree = ""; }; - E61037C115DD169B00819640 /* Platforms */ = { + E6E9ADA4181456C100E3C1A2 /* libpng */ = { isa = PBXGroup; children = ( - E61037C215DD169B00819640 /* CCGL.h */, - E61037C315DD169B00819640 /* CCNS.h */, - E61037C415DD169B00819640 /* iOS */, - E61037CC15DD169B00819640 /* Mac */, - ); - path = Platforms; + E6E9ADA5181456C100E3C1A2 /* ANNOUNCE */, + E6E9ADA6181456C100E3C1A2 /* CHANGES */, + E6E9ADA7181456C100E3C1A2 /* CMakeLists.txt */, + E6E9ADA8181456C100E3C1A2 /* configure */, + E6E9ADA9181456C100E3C1A2 /* example.c */, + E6E9ADAA181456C100E3C1A2 /* INSTALL */, + E6E9ADAB181456C100E3C1A2 /* KNOWNBUG */, + E6E9ADAC181456C100E3C1A2 /* libpng-1.2.49.txt */, + E6E9ADAD181456C100E3C1A2 /* libpng.3 */, + E6E9ADAE181456C100E3C1A2 /* libpngpf.3 */, + E6E9ADAF181456C100E3C1A2 /* LICENSE */, + E6E9ADB0181456C100E3C1A2 /* png.5 */, + E6E9ADB1181456C100E3C1A2 /* png.c */, + E6E9ADB2181456C100E3C1A2 /* png.h */, + E6E9ADB3181456C100E3C1A2 /* pngbar.jpg */, + E6E9ADB4181456C100E3C1A2 /* pngbar.png */, + E6E9ADB5181456C100E3C1A2 /* pngconf.h */, + E6E9ADB6181456C100E3C1A2 /* pngerror.c */, + E6E9ADB7181456C100E3C1A2 /* pnggccrd.c */, + E6E9ADB8181456C100E3C1A2 /* pngget.c */, + E6E9ADB9181456C100E3C1A2 /* pngmem.c */, + E6E9ADBA181456C100E3C1A2 /* pngnow.png */, + E6E9ADBB181456C100E3C1A2 /* pngpread.c */, + E6E9ADBC181456C100E3C1A2 /* pngread.c */, + E6E9ADBD181456C100E3C1A2 /* pngrio.c */, + E6E9ADBE181456C100E3C1A2 /* pngrtran.c */, + E6E9ADBF181456C100E3C1A2 /* pngrutil.c */, + E6E9ADC0181456C100E3C1A2 /* pngset.c */, + E6E9ADC1181456C100E3C1A2 /* pngtest.c */, + E6E9ADC2181456C100E3C1A2 /* pngtest.png */, + E6E9ADC3181456C100E3C1A2 /* pngtrans.c */, + E6E9ADC4181456C100E3C1A2 /* pngvcrd.c */, + E6E9ADC5181456C100E3C1A2 /* pngwio.c */, + E6E9ADC6181456C100E3C1A2 /* pngwrite.c */, + E6E9ADC7181456C100E3C1A2 /* pngwtran.c */, + E6E9ADC8181456C100E3C1A2 /* pngwutil.c */, + E6E9ADC9181456C100E3C1A2 /* README */, + E6E9ADCA181456C100E3C1A2 /* TODO */, + E6E9ADCB181456C100E3C1A2 /* Y2KINFO */, + ); + name = libpng; + path = external/libpng; sourceTree = ""; }; - E61037C415DD169B00819640 /* iOS */ = { + E6E9AFF5181456D700E3C1A2 /* Products */ = { isa = PBXGroup; children = ( - E61037C515DD169B00819640 /* CCDirectorIOS.h */, - E61037C615DD169B00819640 /* CCES2Renderer.h */, - E61037C715DD169B00819640 /* CCESRenderer.h */, - E61037C815DD169B00819640 /* CCGLView.h */, - E61037C915DD169B00819640 /* CCTouchDelegateProtocol.h */, - E61037CA15DD169B00819640 /* CCTouchDispatcher.h */, - E61037CB15DD169B00819640 /* CCTouchHandler.h */, + E6E9AFFE181456D800E3C1A2 /* ChipmunkDemo.app */, + E6E9B000181456D800E3C1A2 /* libChipmunk.a */, + E6E9B002181456D800E3C1A2 /* libChipmunk-iPhone.a */, + E6E9B004181456D800E3C1A2 /* Benchmark iPhone.app */, + E6E9B006181456D800E3C1A2 /* libObjectiveChipmunk.a */, + E6E9B008181456D800E3C1A2 /* ObjectiveChipmunkTests.xctest */, ); - path = iOS; + name = Products; sourceTree = ""; }; - E61037CC15DD169B00819640 /* Mac */ = { + E6E9B01F1814599300E3C1A2 /* CocosLib */ = { isa = PBXGroup; children = ( - E61037CD15DD169B00819640 /* CCDirectorMac.h */, - E61037CE15DD169B00819640 /* CCEventDispatcher.h */, - E61037CF15DD169B00819640 /* CCGLView.h */, - E61037D015DD169B00819640 /* CCWindow.h */, + E6E9B0201814599300E3C1A2 /* CocosLib.h */, + E6E9B0211814599300E3C1A2 /* CocosLib.m */, ); - path = Mac; + path = CocosLib; sourceTree = ""; }; - E61037D115DD169B00819640 /* Support */ = { + E6E9B0221814599D00E3C1A2 /* CocosLibMac */ = { isa = PBXGroup; children = ( - E61037D215DD169B00819640 /* base64.h */, - E61037D315DD169B00819640 /* CCArray.h */, - E61037D415DD169B00819640 /* ccCArray.h */, - E61037D515DD169B00819640 /* CCFileUtils.h */, - E61037D615DD169B00819640 /* CCProfiling.h */, - E61037D715DD169B00819640 /* ccUtils.h */, - E61037D815DD169B00819640 /* CCVertex.h */, - E61037D915DD169B00819640 /* CGPointExtension.h */, - E61037DA15DD169B00819640 /* NSThread+performBlock.h */, - E61037DB15DD169B00819640 /* OpenGL_Internal.h */, - E61037DC15DD169B00819640 /* TGAlib.h */, - E61037DD15DD169B00819640 /* TransformUtils.h */, - E61037DE15DD169B00819640 /* uthash.h */, - E61037DF15DD169B00819640 /* utlist.h */, - E61037E015DD169B00819640 /* ZipUtils.h */, + E6E9B0231814599D00E3C1A2 /* CocosLibMac.h */, + E6E9B0241814599D00E3C1A2 /* CocosLibMac.m */, ); - path = Support; + path = CocosLibMac; sourceTree = ""; }; - E61037E115DD169B00819640 /* CocosDenshion */ = { + E6E9B03118145B0000E3C1A2 /* CocosDenshion */ = { isa = PBXGroup; children = ( - E61037E215DD169B00819640 /* CDAudioManager.h */, - E61037E315DD169B00819640 /* CDConfig.h */, - E61037E415DD169B00819640 /* CDOpenALSupport.h */, - E61037E515DD169B00819640 /* CocosDenshion.h */, - E61037E615DD169B00819640 /* SimpleAudioEngine.h */, + E6E9B05318145B2900E3C1A2 /* CocosDenshion */, + E6E9B03418145B0000E3C1A2 /* CocosDenshion.h */, + E6E9B03618145B0000E3C1A2 /* CocosDenshion.m */, + E6E9B03218145B0000E3C1A2 /* Supporting Files */, ); path = CocosDenshion; sourceTree = ""; }; - E61037E715DD169B00819640 /* CocosDenshionExtras */ = { - isa = PBXGroup; - children = ( - E61037E815DD169B00819640 /* CDXMacOSXSupport.h */, - E61037E915DD169B00819640 /* CDXPropertyModifierAction.h */, - ); - path = CocosDenshionExtras; - sourceTree = ""; - }; - E61037EA15DD169B00819640 /* kazmath */ = { - isa = PBXGroup; - children = ( - E61037EB15DD169B00819640 /* aabb.h */, - E61037EC15DD169B00819640 /* GL */, - E61037EF15DD169B00819640 /* kazmath.h */, - E61037F015DD169B00819640 /* mat3.h */, - E61037F115DD169B00819640 /* mat4.h */, - E61037F215DD169B00819640 /* neon_matrix_impl.h */, - E61037F315DD169B00819640 /* plane.h */, - E61037F415DD169B00819640 /* quaternion.h */, - E61037F515DD169B00819640 /* ray2.h */, - E61037F615DD169B00819640 /* utility.h */, - E61037F715DD169B00819640 /* vec2.h */, - E61037F815DD169B00819640 /* vec3.h */, - E61037F915DD169B00819640 /* vec4.h */, - ); - path = kazmath; - sourceTree = ""; - }; - E61037EC15DD169B00819640 /* GL */ = { + E6E9B03218145B0000E3C1A2 /* Supporting Files */ = { isa = PBXGroup; children = ( - E61037ED15DD169B00819640 /* mat4stack.h */, - E61037EE15DD169B00819640 /* matrix.h */, + E6E9B03318145B0000E3C1A2 /* CocosDenshion-Prefix.pch */, ); - path = GL; + name = "Supporting Files"; sourceTree = ""; }; - E61037FA15DD169B00819640 /* libpng */ = { + E6E9B05318145B2900E3C1A2 /* CocosDenshion */ = { isa = PBXGroup; children = ( - E61037FB15DD169B00819640 /* png.h */, - E61037FC15DD169B00819640 /* pngconf.h */, - ); - path = libpng; - sourceTree = ""; - }; - E69291DA161ECA2F00DB1EAA /* Other Frameworks */ = { - isa = PBXGroup; - children = ( - E69291DB161ECA2F00DB1EAA /* AppKit.framework */, - E69291DC161ECA2F00DB1EAA /* CoreData.framework */, - E69291DD161ECA2F00DB1EAA /* Foundation.framework */, - ); - name = "Other Frameworks"; - sourceTree = ""; - }; - E6AA4DA213B1574400C9F08C /* resources */ = { - isa = PBXGroup; - children = ( - E64FA07213E75380001A90C1 /* LICENSE_artwork.txt */, - E64FA07313E75380001A90C1 /* LICENSE_Box2D.txt */, - E64FA07513E75380001A90C1 /* LICENSE_cocos2d.txt */, - E64FA07613E75380001A90C1 /* LICENSE_cocosdenshion.txt */, - E64FA07813E75380001A90C1 /* LICENSE_libpng.txt */, - E64FA07A13E75380001A90C1 /* LICENSE.cocos2d */, - E64FA07B13E75380001A90C1 /* LICENSE.cocosdenshion */, - ); - path = resources; + E6E9B05418145B2900E3C1A2 /* CDAudioManager.h */, + E6E9B05518145B2900E3C1A2 /* CDAudioManager.m */, + E6E9B05618145B2900E3C1A2 /* CDConfig.h */, + E6E9B05718145B2900E3C1A2 /* CDOpenALSupport.h */, + E6E9B05818145B2900E3C1A2 /* CDOpenALSupport.m */, + E6E9B05918145B2900E3C1A2 /* CDXMacOSXSupport.h */, + E6E9B05A18145B2900E3C1A2 /* CDXMacOSXSupport.m */, + E6E9B05B18145B2900E3C1A2 /* CDXPropertyModifierAction.h */, + E6E9B05C18145B2900E3C1A2 /* CDXPropertyModifierAction.m */, + E6E9B05D18145B2900E3C1A2 /* CocosDenshion-Prefix.pch */, + E6E9B05E18145B2900E3C1A2 /* CocosDenshion.h */, + E6E9B05F18145B2900E3C1A2 /* CocosDenshion.m */, + E6E9B06018145B2900E3C1A2 /* README.md */, + E6E9B06118145B2900E3C1A2 /* SimpleAudioEngine.h */, + E6E9B06218145B2900E3C1A2 /* SimpleAudioEngine.m */, + ); + name = CocosDenshion; sourceTree = ""; }; /* End PBXGroup section */ @@ -1829,185 +1540,144 @@ isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( - E6929361161ECD1F00DB1EAA /* CocosLibMac-Prefix.pch in Headers */, - E692928E161ECBAC00DB1EAA /* Box2D.h in Headers */, - E692928F161ECBAC00DB1EAA /* b2BroadPhase.h in Headers */, - E6929290161ECBAC00DB1EAA /* b2Collision.h in Headers */, - E6929291161ECBAC00DB1EAA /* b2Distance.h in Headers */, - E6929292161ECBAC00DB1EAA /* b2DynamicTree.h in Headers */, - E6929293161ECBAC00DB1EAA /* b2TimeOfImpact.h in Headers */, - E6929294161ECBAC00DB1EAA /* b2ChainShape.h in Headers */, - E6929295161ECBAC00DB1EAA /* b2CircleShape.h in Headers */, - E6929296161ECBAC00DB1EAA /* b2EdgeShape.h in Headers */, - E6929297161ECBAC00DB1EAA /* b2PolygonShape.h in Headers */, - E6929298161ECBAC00DB1EAA /* b2Shape.h in Headers */, - E6929299161ECBAC00DB1EAA /* b2BlockAllocator.h in Headers */, - E692929A161ECBAC00DB1EAA /* b2Draw.h in Headers */, - E692929B161ECBAC00DB1EAA /* b2GrowableStack.h in Headers */, - E692929C161ECBAC00DB1EAA /* b2Math.h in Headers */, - E692929D161ECBAC00DB1EAA /* b2Settings.h in Headers */, - E692929E161ECBAC00DB1EAA /* b2StackAllocator.h in Headers */, - E692929F161ECBAC00DB1EAA /* b2Timer.h in Headers */, - E69292A0161ECBAC00DB1EAA /* b2Body.h in Headers */, - E69292A1161ECBAC00DB1EAA /* b2ContactManager.h in Headers */, - E69292A2161ECBAC00DB1EAA /* b2Fixture.h in Headers */, - E69292A3161ECBAC00DB1EAA /* b2Island.h in Headers */, - E69292A4161ECBAC00DB1EAA /* b2TimeStep.h in Headers */, - E69292A5161ECBAC00DB1EAA /* b2World.h in Headers */, - E69292A6161ECBAC00DB1EAA /* b2WorldCallbacks.h in Headers */, - E69292A7161ECBAC00DB1EAA /* b2ChainAndCircleContact.h in Headers */, - E69292A8161ECBAC00DB1EAA /* b2ChainAndPolygonContact.h in Headers */, - E69292A9161ECBAC00DB1EAA /* b2CircleContact.h in Headers */, - E69292AA161ECBAC00DB1EAA /* b2Contact.h in Headers */, - E69292AB161ECBAC00DB1EAA /* b2ContactSolver.h in Headers */, - E69292AC161ECBAC00DB1EAA /* b2EdgeAndCircleContact.h in Headers */, - E69292AD161ECBAC00DB1EAA /* b2EdgeAndPolygonContact.h in Headers */, - E69292AE161ECBAC00DB1EAA /* b2PolygonAndCircleContact.h in Headers */, - E69292AF161ECBAC00DB1EAA /* b2PolygonContact.h in Headers */, - E69292B0161ECBAC00DB1EAA /* b2DistanceJoint.h in Headers */, - E69292B1161ECBAC00DB1EAA /* b2FrictionJoint.h in Headers */, - E69292B2161ECBAC00DB1EAA /* b2GearJoint.h in Headers */, - E69292B3161ECBAC00DB1EAA /* b2Joint.h in Headers */, - E69292B4161ECBAC00DB1EAA /* b2MotorJoint.h in Headers */, - E69292B5161ECBAC00DB1EAA /* b2MouseJoint.h in Headers */, - E69292B6161ECBAC00DB1EAA /* b2PrismaticJoint.h in Headers */, - E69292B7161ECBAC00DB1EAA /* b2PulleyJoint.h in Headers */, - E69292B8161ECBAC00DB1EAA /* b2RevoluteJoint.h in Headers */, - E69292B9161ECBAC00DB1EAA /* b2RopeJoint.h in Headers */, - E69292BA161ECBAC00DB1EAA /* b2WeldJoint.h in Headers */, - E69292BB161ECBAC00DB1EAA /* b2WheelJoint.h in Headers */, - E69292BC161ECBAC00DB1EAA /* b2Rope.h in Headers */, - E69292BD161ECBAC00DB1EAA /* CCRenderTargetNode.h in Headers */, - E69292BE161ECBAC00DB1EAA /* CCAction.h in Headers */, - E69292BF161ECBAC00DB1EAA /* CCActionCamera.h in Headers */, - E69292C0161ECBAC00DB1EAA /* CCActionCatmullRom.h in Headers */, - E69292C1161ECBAC00DB1EAA /* CCActionEase.h in Headers */, - E69292C2161ECBAC00DB1EAA /* CCActionGrid.h in Headers */, - E69292C3161ECBAC00DB1EAA /* CCActionGrid3D.h in Headers */, - E69292C4161ECBAC00DB1EAA /* CCActionInstant.h in Headers */, - E69292C5161ECBAC00DB1EAA /* CCActionInterval.h in Headers */, - E69292C6161ECBAC00DB1EAA /* CCActionManager.h in Headers */, - E69292C7161ECBAC00DB1EAA /* CCActionPageTurn3D.h in Headers */, - E69292C8161ECBAC00DB1EAA /* CCActionProgressTimer.h in Headers */, - E69292C9161ECBAC00DB1EAA /* CCActionTiledGrid.h in Headers */, - E69292CA161ECBAC00DB1EAA /* CCActionTween.h in Headers */, - E69292CB161ECBAC00DB1EAA /* CCAnimation.h in Headers */, - E69292CC161ECBAC00DB1EAA /* CCAnimationCache.h in Headers */, - E69292CD161ECBAC00DB1EAA /* CCAtlasNode.h in Headers */, - E69292CE161ECBAD00DB1EAA /* CCCamera.h in Headers */, - E69292CF161ECBAD00DB1EAA /* ccConfig.h in Headers */, - E69292D0161ECBAD00DB1EAA /* CCConfiguration.h in Headers */, - E69292D1161ECBAD00DB1EAA /* ccDeprecated.h in Headers */, - E69292D2161ECBAD00DB1EAA /* CCDirector.h in Headers */, - E69292D3161ECBAD00DB1EAA /* CCDrawingPrimitives.h in Headers */, - E69292D4161ECBAD00DB1EAA /* CCGLProgram.h in Headers */, - E69292D5161ECBAD00DB1EAA /* ccGLStateCache.h in Headers */, - E69292D6161ECBAD00DB1EAA /* CCGrabber.h in Headers */, - E69292D7161ECBAD00DB1EAA /* CCGrid.h in Headers */, - E69292D8161ECBAD00DB1EAA /* CCLabelAtlas.h in Headers */, - E69292D9161ECBAD00DB1EAA /* CCLabelBMFont.h in Headers */, - E69292DA161ECBAD00DB1EAA /* CCLabelTTF.h in Headers */, - E69292DB161ECBAD00DB1EAA /* CCLayer.h in Headers */, - E69292DC161ECBAD00DB1EAA /* ccMacros.h in Headers */, - E69292DD161ECBAD00DB1EAA /* CCMenu.h in Headers */, - E69292DE161ECBAD00DB1EAA /* CCMenuItem.h in Headers */, - E69292DF161ECBAD00DB1EAA /* CCMotionStreak.h in Headers */, - E69292E0161ECBAD00DB1EAA /* CCNode+Debug.h in Headers */, - E69292E1161ECBAD00DB1EAA /* CCNode.h in Headers */, - E69292E2161ECBAD00DB1EAA /* CCParallaxNode.h in Headers */, - E69292E3161ECBAD00DB1EAA /* CCParticleBatchNode.h in Headers */, - E69292E4161ECBAD00DB1EAA /* CCParticleSystem.h in Headers */, - E69292E5161ECBAD00DB1EAA /* CCParticleSystemQuad.h in Headers */, - E69292E6161ECBAD00DB1EAA /* CCProgressTimer.h in Headers */, - E69292E7161ECBAD00DB1EAA /* CCProtocols.h in Headers */, - E69292E8161ECBAD00DB1EAA /* CCRenderTexture.h in Headers */, - E69292E9161ECBAD00DB1EAA /* CCScene.h in Headers */, - E69292EA161ECBAD00DB1EAA /* CCScheduler.h in Headers */, - E69292EB161ECBAD00DB1EAA /* ccShader_Position_uColor_frag.h in Headers */, - E69292EC161ECBAD00DB1EAA /* ccShader_Position_uColor_vert.h in Headers */, - E69292ED161ECBAD00DB1EAA /* ccShader_PositionColor_frag.h in Headers */, - E69292EE161ECBAD00DB1EAA /* ccShader_PositionColor_vert.h in Headers */, - E69292EF161ECBAD00DB1EAA /* ccShader_PositionTexture_frag.h in Headers */, - E69292F0161ECBAD00DB1EAA /* ccShader_PositionTexture_uColor_frag.h in Headers */, - E69292F1161ECBAD00DB1EAA /* ccShader_PositionTexture_uColor_vert.h in Headers */, - E69292F2161ECBAD00DB1EAA /* ccShader_PositionTexture_vert.h in Headers */, - E69292F3161ECBAD00DB1EAA /* ccShader_PositionTextureA8Color_frag.h in Headers */, - E69292F4161ECBAD00DB1EAA /* ccShader_PositionTextureA8Color_vert.h in Headers */, - E69292F5161ECBAD00DB1EAA /* ccShader_PositionTextureColor_frag.h in Headers */, - E69292F6161ECBAD00DB1EAA /* ccShader_PositionTextureColor_vert.h in Headers */, - E69292F7161ECBAD00DB1EAA /* ccShader_PositionTextureColorAlphaTest_frag.h in Headers */, - E69292F8161ECBAD00DB1EAA /* CCShaderCache.h in Headers */, - E69292F9161ECBAD00DB1EAA /* ccShaders.h in Headers */, - E69292FA161ECBAD00DB1EAA /* CCSprite.h in Headers */, - E69292FB161ECBAD00DB1EAA /* CCSpriteBatchNode.h in Headers */, - E69292FC161ECBAD00DB1EAA /* CCSpriteFrame.h in Headers */, - E69292FD161ECBAD00DB1EAA /* CCSpriteFrameCache.h in Headers */, - E69292FE161ECBAD00DB1EAA /* CCTexture2D.h in Headers */, - E69292FF161ECBAD00DB1EAA /* CCTextureAtlas.h in Headers */, - E6929300161ECBAD00DB1EAA /* CCTextureCache.h in Headers */, - E6929301161ECBAD00DB1EAA /* CCTexturePVR.h in Headers */, - E6929302161ECBAD00DB1EAA /* CCTileMapAtlas.h in Headers */, - E6929303161ECBAD00DB1EAA /* CCTMXLayer.h in Headers */, - E6929304161ECBAD00DB1EAA /* CCTMXObjectGroup.h in Headers */, - E6929305161ECBAD00DB1EAA /* CCTMXTiledMap.h in Headers */, - E6929306161ECBAD00DB1EAA /* CCTMXXMLParser.h in Headers */, - E6929307161ECBAD00DB1EAA /* CCTransition.h in Headers */, - E6929308161ECBAD00DB1EAA /* CCTransitionOrientationType.h in Headers */, - E6929309161ECBAD00DB1EAA /* CCTransitionPageTurn.h in Headers */, - E692930A161ECBAD00DB1EAA /* CCTransitionProgress.h in Headers */, - E692930B161ECBAD00DB1EAA /* ccTypes.h in Headers */, - E692930C161ECBAD00DB1EAA /* cocos2d.h in Headers */, - E692930D161ECBAD00DB1EAA /* CCGL.h in Headers */, - E692930E161ECBAD00DB1EAA /* CCNS.h in Headers */, - E692930F161ECBAD00DB1EAA /* CCDirectorIOS.h in Headers */, - E6929310161ECBAD00DB1EAA /* CCES2Renderer.h in Headers */, - E6929311161ECBAD00DB1EAA /* CCESRenderer.h in Headers */, - E6929312161ECBAD00DB1EAA /* CCGLView.h in Headers */, - E6929313161ECBAD00DB1EAA /* CCTouchDelegateProtocol.h in Headers */, - E6929314161ECBAD00DB1EAA /* CCTouchDispatcher.h in Headers */, - E6929315161ECBAD00DB1EAA /* CCTouchHandler.h in Headers */, - E6929316161ECBAD00DB1EAA /* CCDirectorMac.h in Headers */, - E6929317161ECBAD00DB1EAA /* CCEventDispatcher.h in Headers */, - E6929318161ECBAD00DB1EAA /* CCGLView.h in Headers */, - E6929319161ECBAD00DB1EAA /* CCWindow.h in Headers */, - E692931A161ECBAD00DB1EAA /* base64.h in Headers */, - E692931B161ECBAD00DB1EAA /* CCArray.h in Headers */, - E692931C161ECBAD00DB1EAA /* ccCArray.h in Headers */, - E692931D161ECBAD00DB1EAA /* CCFileUtils.h in Headers */, - E692931E161ECBAD00DB1EAA /* CCProfiling.h in Headers */, - E692931F161ECBAD00DB1EAA /* ccUtils.h in Headers */, - E6929320161ECBAD00DB1EAA /* CCVertex.h in Headers */, - E6929321161ECBAD00DB1EAA /* CGPointExtension.h in Headers */, - E6929322161ECBAD00DB1EAA /* NSThread+performBlock.h in Headers */, - E6929323161ECBAD00DB1EAA /* OpenGL_Internal.h in Headers */, - E6929324161ECBAD00DB1EAA /* TGAlib.h in Headers */, - E6929325161ECBAD00DB1EAA /* TransformUtils.h in Headers */, - E6929326161ECBAD00DB1EAA /* uthash.h in Headers */, - E6929327161ECBAD00DB1EAA /* utlist.h in Headers */, - E6929328161ECBAD00DB1EAA /* ZipUtils.h in Headers */, - E6929329161ECBAD00DB1EAA /* CDAudioManager.h in Headers */, - E692932A161ECBAD00DB1EAA /* CDConfig.h in Headers */, - E692932B161ECBAD00DB1EAA /* CDOpenALSupport.h in Headers */, - E692932C161ECBAD00DB1EAA /* CocosDenshion.h in Headers */, - E692932D161ECBAD00DB1EAA /* SimpleAudioEngine.h in Headers */, - E692932E161ECBAD00DB1EAA /* CDXMacOSXSupport.h in Headers */, - E692932F161ECBAD00DB1EAA /* CDXPropertyModifierAction.h in Headers */, - E6929330161ECBAD00DB1EAA /* aabb.h in Headers */, - E6929331161ECBAD00DB1EAA /* mat4stack.h in Headers */, - E6929332161ECBAD00DB1EAA /* matrix.h in Headers */, - E6929333161ECBAD00DB1EAA /* kazmath.h in Headers */, - E6929334161ECBAD00DB1EAA /* mat3.h in Headers */, - E6929335161ECBAD00DB1EAA /* mat4.h in Headers */, - E6929336161ECBAD00DB1EAA /* neon_matrix_impl.h in Headers */, - E6929337161ECBAD00DB1EAA /* plane.h in Headers */, - E6929338161ECBAD00DB1EAA /* quaternion.h in Headers */, - E6929339161ECBAD00DB1EAA /* ray2.h in Headers */, - E692933A161ECBAD00DB1EAA /* utility.h in Headers */, - E692933B161ECBAD00DB1EAA /* vec2.h in Headers */, - E692933C161ECBAD00DB1EAA /* vec3.h in Headers */, - E692933D161ECBAD00DB1EAA /* vec4.h in Headers */, - E692933E161ECBAD00DB1EAA /* png.h in Headers */, - E692933F161ECBAD00DB1EAA /* pngconf.h in Headers */, + E6E9AF95181456C200E3C1A2 /* aabb.h in Headers */, + E6E9AEB1181456C100E3C1A2 /* ccShader_PositionTextureA8Color_vert.h in Headers */, + E6E9AE67181456C100E3C1A2 /* CCParticleExamples.h in Headers */, + E6E9AF99181456C200E3C1A2 /* matrix.h in Headers */, + E6E9AEB9181456C100E3C1A2 /* CCShaderCache.h in Headers */, + E6E9AF57181456C200E3C1A2 /* TransformUtils.h in Headers */, + E6E9AEFD181456C100E3C1A2 /* ccTypes.h in Headers */, + E6E9AF9B181456C200E3C1A2 /* kazmath.h in Headers */, + E6E9AF2D181456C200E3C1A2 /* NSEvent+CC.h in Headers */, + E6E9AE4F181456C100E3C1A2 /* CCMenuItem.h in Headers */, + E6E9AE19181456C100E3C1A2 /* CCDirector.h in Headers */, + E6E9AE9F181456C100E3C1A2 /* ccShader_PositionColor_frag.h in Headers */, + E6E9AF49181456C200E3C1A2 /* NSAttributedString+CCAdditions.h in Headers */, + E6E9AEAB181456C100E3C1A2 /* ccShader_PositionTexture_uColor_vert.h in Headers */, + E6E9AEA9181456C100E3C1A2 /* ccShader_PositionTexture_uColor_frag.h in Headers */, + E6E9AF6B181456C200E3C1A2 /* CCControlSubclass.h in Headers */, + E6E9AEBD181456C100E3C1A2 /* ccShaders.h in Headers */, + E6E9AE81181456C100E3C1A2 /* CCProgressTimer.h in Headers */, + E6E9AF15181456C100E3C1A2 /* CCResponder.h in Headers */, + E6E9AFAD181456C200E3C1A2 /* vec3.h in Headers */, + E6E9AE49181456C100E3C1A2 /* ccMacros.h in Headers */, + E6E9AE0F181456C100E3C1A2 /* ccConfig.h in Headers */, + E6E9AEF5181456C100E3C1A2 /* CCTMXXMLParser.h in Headers */, + E6E9AE4B181456C100E3C1A2 /* CCMenu.h in Headers */, + E6E9AF79181456C200E3C1A2 /* cocos2d-ui.h in Headers */, + E6E9AE63181456C100E3C1A2 /* CCParticleBatchNode.h in Headers */, + E6E9AE7D181456C100E3C1A2 /* CCPhysicsNode.h in Headers */, + E6E9AF4D181456C200E3C1A2 /* NSThread+performBlock.h in Headers */, + E6E9AE8F181456C100E3C1A2 /* CCResponderManager.h in Headers */, + E6E9AE45181456C100E3C1A2 /* CCLayer.h in Headers */, + E6E9AEB5181456C100E3C1A2 /* ccShader_PositionTextureColor_vert.h in Headers */, + E6E9AEFF181456C100E3C1A2 /* cocos2d.h in Headers */, + E6E9AF33181456C200E3C1A2 /* base64.h in Headers */, + E6E9AF75181456C200E3C1A2 /* CCTableView.h in Headers */, + E6E9AE5B181456C100E3C1A2 /* CCNode.h in Headers */, + E6E9AF67181456C200E3C1A2 /* CCControl.h in Headers */, + E6E9AF0F181456C100E3C1A2 /* CCESRenderer.h in Headers */, + E6E9AEE1181456C100E3C1A2 /* CCTexturePVR.h in Headers */, + E6E9AEF1181456C100E3C1A2 /* CCTMXTiledMap.h in Headers */, + E6E9ADF9181456C100E3C1A2 /* CCActionTween.h in Headers */, + E6E9AF5B181456C200E3C1A2 /* uthash.h in Headers */, + E6E9AE5F181456C100E3C1A2 /* CCParallaxNode.h in Headers */, + E6E9AE85181456C100E3C1A2 /* CCProtocols.h in Headers */, + E6E9AF07181456C100E3C1A2 /* CCDirectorIOS.h in Headers */, + E6E9AE1D181456C100E3C1A2 /* CCDrawingPrimitives.h in Headers */, + E6E9AE53181456C100E3C1A2 /* CCMotionStreak.h in Headers */, + E6E9AE73181456C100E3C1A2 /* CCPhysics+ObjectiveChipmunk.h in Headers */, + E6E9AEA5181456C100E3C1A2 /* ccShader_PositionColorLengthTexture_vert.h in Headers */, + E6E9AEA7181456C100E3C1A2 /* ccShader_PositionTexture_frag.h in Headers */, + E6E9AEAD181456C100E3C1A2 /* ccShader_PositionTexture_vert.h in Headers */, + E6E9AE6F181456C100E3C1A2 /* CCParticleSystemQuad.h in Headers */, + E6E9ADED181456C100E3C1A2 /* CCActionPageTurn3D.h in Headers */, + E6E9AED1181456C100E3C1A2 /* CCSpriteFrameCache.h in Headers */, + E6E9AE05181456C100E3C1A2 /* CCAtlasNode.h in Headers */, + E6E9AF03181456C100E3C1A2 /* CCGL.h in Headers */, + E6E9AE8B181456C100E3C1A2 /* CCResponder.h in Headers */, + E6E9AEDD181456C100E3C1A2 /* CCTextureCache.h in Headers */, + E6E9AF1D181456C100E3C1A2 /* UITouch+CC.h in Headers */, + E6E9ADFD181456C100E3C1A2 /* CCAnimation.h in Headers */, + E6E9ADE5181456C100E3C1A2 /* CCActionInterval.h in Headers */, + E6E9AF3F181456C200E3C1A2 /* ccUtils.h in Headers */, + E6E9AFD1181456C200E3C1A2 /* pngconf.h in Headers */, + E6E9AEA1181456C100E3C1A2 /* ccShader_PositionColor_vert.h in Headers */, + E6E9AE97181456C100E3C1A2 /* CCScheduler.h in Headers */, + E6E9AECD181456C100E3C1A2 /* CCSpriteFrame.h in Headers */, + E6E9AEC9181456C100E3C1A2 /* CCSpriteBatchNode.h in Headers */, + E6E9AE25181456C100E3C1A2 /* ccFPSImages.h in Headers */, + E6E9AFA5181456C200E3C1A2 /* quaternion.h in Headers */, + E6E9AEC1181456C100E3C1A2 /* CCSprite.h in Headers */, + E6E9AE93181456C100E3C1A2 /* CCScene.h in Headers */, + E6E9AE39181456C100E3C1A2 /* CCLabelAtlas.h in Headers */, + E6E9AEA3181456C100E3C1A2 /* ccShader_PositionColorLengthTexture_frag.h in Headers */, + E6E9AF0B181456C100E3C1A2 /* CCES2Renderer.h in Headers */, + E6E9AF35181456C200E3C1A2 /* CCFileUtils.h in Headers */, + E6E9AFA7181456C200E3C1A2 /* ray2.h in Headers */, + E6E9AF53181456C200E3C1A2 /* TGAlib.h in Headers */, + E6E9AFA9181456C200E3C1A2 /* utility.h in Headers */, + E6E9AEE5181456C100E3C1A2 /* CCTileMapAtlas.h in Headers */, + E6E9AFAB181456C200E3C1A2 /* vec2.h in Headers */, + E6E9ADD1181456C100E3C1A2 /* CCActionCatmullRom.h in Headers */, + E6E9ADDD181456C100E3C1A2 /* CCActionGrid3D.h in Headers */, + E6E9AE6B181456C100E3C1A2 /* CCParticleSystem.h in Headers */, + E6E9ADE1181456C100E3C1A2 /* CCActionInstant.h in Headers */, + E6E9AE29181456C100E3C1A2 /* CCGLProgram.h in Headers */, + E6E9AE21181456C100E3C1A2 /* CCDrawNode.h in Headers */, + E6E9AE31181456C100E3C1A2 /* CCGrabber.h in Headers */, + E6E9ADCD181456C100E3C1A2 /* CCAction.h in Headers */, + E6E9AEB7181456C100E3C1A2 /* ccShader_PositionTextureColorAlphaTest_frag.h in Headers */, + E6E9ADD9181456C100E3C1A2 /* CCActionGrid.h in Headers */, + E6E9AEF9181456C100E3C1A2 /* CCTransition.h in Headers */, + E6E9AEAF181456C100E3C1A2 /* ccShader_PositionTextureA8Color_frag.h in Headers */, + E6E9AEC5181456C100E3C1A2 /* CCSprite9Slice.h in Headers */, + E6E9AE9B181456C100E3C1A2 /* ccShader_Position_uColor_frag.h in Headers */, + E6E9AF9F181456C200E3C1A2 /* mat4.h in Headers */, + E6E9AFCF181456C200E3C1A2 /* png.h in Headers */, + E6E9AED5181456C100E3C1A2 /* CCTexture2D.h in Headers */, + E6E9AF6D181456C200E3C1A2 /* CCControlTextureFactory.h in Headers */, + E6E9AF21181456C100E3C1A2 /* CCDirectorMac.h in Headers */, + E6E9AED9181456C100E3C1A2 /* CCTextureAtlas.h in Headers */, + E6E9AF29181456C200E3C1A2 /* CCWindow.h in Headers */, + E6E9ADF1181456C100E3C1A2 /* CCActionProgressTimer.h in Headers */, + E6E9AE01181456C100E3C1A2 /* CCAnimationCache.h in Headers */, + E6E9AEE9181456C100E3C1A2 /* CCTMXLayer.h in Headers */, + E6E9ADE9181456C100E3C1A2 /* CCActionManager.h in Headers */, + E6E9ADF5181456C100E3C1A2 /* CCActionTiledGrid.h in Headers */, + E6E9AF41181456C200E3C1A2 /* CCVertex.h in Headers */, + E6E9AF5F181456C200E3C1A2 /* ZipUtils.h in Headers */, + E6E9AE2D181456C100E3C1A2 /* ccGLStateCache.h in Headers */, + E6E9AE15181456C100E3C1A2 /* ccDeprecated.h in Headers */, + E6E9AF05181456C100E3C1A2 /* CCNS.h in Headers */, + E6E9AEED181456C100E3C1A2 /* CCTMXObjectGroup.h in Headers */, + E6E9ADD5181456C100E3C1A2 /* CCActionEase.h in Headers */, + E6E9AF97181456C200E3C1A2 /* mat4stack.h in Headers */, + E6E9AE41181456C100E3C1A2 /* CCLabelTTF.h in Headers */, + E6E9AF9D181456C200E3C1A2 /* mat3.h in Headers */, + E6E9AF71181456C200E3C1A2 /* CCScrollView.h in Headers */, + E6E9AFAF181456C200E3C1A2 /* vec4.h in Headers */, + E6E9AF11181456C100E3C1A2 /* CCGLView.h in Headers */, + E6E9AE3D181456C100E3C1A2 /* CCLabelBMFont.h in Headers */, + E6E9AEB3181456C100E3C1A2 /* ccShader_PositionTextureColor_frag.h in Headers */, + E6E9AE87181456C100E3C1A2 /* CCRenderTexture.h in Headers */, + E6E9AF45181456C200E3C1A2 /* CGPointExtension.h in Headers */, + E6E9AF63181456C200E3C1A2 /* CCButton.h in Headers */, + E6E9AE09181456C100E3C1A2 /* CCCamera.h in Headers */, + E6E9AFA3181456C200E3C1A2 /* plane.h in Headers */, + E6E9AE9D181456C100E3C1A2 /* ccShader_Position_uColor_vert.h in Headers */, + E6E9AE57181456C100E3C1A2 /* CCNode+Debug.h in Headers */, + E6E9AE0B181456C100E3C1A2 /* CCClippingNode.h in Headers */, + E6E9AE35181456C100E3C1A2 /* CCGrid.h in Headers */, + E6E9AFA1181456C200E3C1A2 /* neon_matrix_impl.h in Headers */, + E6E9AE11181456C100E3C1A2 /* CCConfiguration.h in Headers */, + E6E9AF5D181456C200E3C1A2 /* utlist.h in Headers */, + E6E9AF51181456C200E3C1A2 /* OpenGL_Internal.h in Headers */, + E6E9AF39181456C200E3C1A2 /* CCProfiling.h in Headers */, + E6E9AF19181456C100E3C1A2 /* CCResponderManager.h in Headers */, + E6E9AF25181456C100E3C1A2 /* CCGLView.h in Headers */, + E6E9AE75181456C100E3C1A2 /* CCPhysicsbody.h in Headers */, + E6E9AE79181456C100E3C1A2 /* CCPhysicsJoint.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -2015,185 +1685,144 @@ isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( - E6AA4C0B13B156F800C9F08C /* CocosLib_Prefix.pch in Headers */, - E61038A115DD169B00819640 /* Box2D.h in Headers */, - E61038A215DD169B00819640 /* b2BroadPhase.h in Headers */, - E61038A315DD169B00819640 /* b2Collision.h in Headers */, - E61038A415DD169B00819640 /* b2Distance.h in Headers */, - E61038A515DD169B00819640 /* b2DynamicTree.h in Headers */, - E61038A615DD169B00819640 /* b2TimeOfImpact.h in Headers */, - E61038A715DD169B00819640 /* b2ChainShape.h in Headers */, - E61038A815DD169B00819640 /* b2CircleShape.h in Headers */, - E61038A915DD169B00819640 /* b2EdgeShape.h in Headers */, - E61038AA15DD169B00819640 /* b2PolygonShape.h in Headers */, - E61038AB15DD169B00819640 /* b2Shape.h in Headers */, - E61038AC15DD169B00819640 /* b2BlockAllocator.h in Headers */, - E61038AD15DD169B00819640 /* b2Draw.h in Headers */, - E61038AE15DD169B00819640 /* b2GrowableStack.h in Headers */, - E61038AF15DD169B00819640 /* b2Math.h in Headers */, - E61038B015DD169B00819640 /* b2Settings.h in Headers */, - E61038B115DD169B00819640 /* b2StackAllocator.h in Headers */, - E61038B215DD169B00819640 /* b2Timer.h in Headers */, - E61038B315DD169B00819640 /* b2Body.h in Headers */, - E61038B415DD169B00819640 /* b2ContactManager.h in Headers */, - E61038B515DD169B00819640 /* b2Fixture.h in Headers */, - E61038B615DD169B00819640 /* b2Island.h in Headers */, - E61038B715DD169B00819640 /* b2TimeStep.h in Headers */, - E61038B815DD169B00819640 /* b2World.h in Headers */, - E61038B915DD169B00819640 /* b2WorldCallbacks.h in Headers */, - E61038BA15DD169B00819640 /* b2ChainAndCircleContact.h in Headers */, - E61038BB15DD169B00819640 /* b2ChainAndPolygonContact.h in Headers */, - E61038BC15DD169B00819640 /* b2CircleContact.h in Headers */, - E61038BD15DD169B00819640 /* b2Contact.h in Headers */, - E61038BE15DD169B00819640 /* b2ContactSolver.h in Headers */, - E61038BF15DD169B00819640 /* b2EdgeAndCircleContact.h in Headers */, - E61038C015DD169B00819640 /* b2EdgeAndPolygonContact.h in Headers */, - E61038C115DD169B00819640 /* b2PolygonAndCircleContact.h in Headers */, - E61038C215DD169B00819640 /* b2PolygonContact.h in Headers */, - E61038C315DD169B00819640 /* b2DistanceJoint.h in Headers */, - E61038C415DD169B00819640 /* b2FrictionJoint.h in Headers */, - E61038C515DD169B00819640 /* b2GearJoint.h in Headers */, - E61038C615DD169B00819640 /* b2Joint.h in Headers */, - E61038C715DD169B00819640 /* b2MotorJoint.h in Headers */, - E61038C815DD169B00819640 /* b2MouseJoint.h in Headers */, - E61038C915DD169B00819640 /* b2PrismaticJoint.h in Headers */, - E61038CA15DD169B00819640 /* b2PulleyJoint.h in Headers */, - E61038CB15DD169B00819640 /* b2RevoluteJoint.h in Headers */, - E61038CC15DD169B00819640 /* b2RopeJoint.h in Headers */, - E61038CD15DD169B00819640 /* b2WeldJoint.h in Headers */, - E61038CE15DD169B00819640 /* b2WheelJoint.h in Headers */, - E61038CF15DD169B00819640 /* b2Rope.h in Headers */, - E61038D015DD169B00819640 /* CCAction.h in Headers */, - E61038D115DD169B00819640 /* CCActionCamera.h in Headers */, - E61038D215DD169B00819640 /* CCActionCatmullRom.h in Headers */, - E61038D315DD169B00819640 /* CCActionEase.h in Headers */, - E61038D415DD169B00819640 /* CCActionGrid.h in Headers */, - E61038D515DD169B00819640 /* CCActionGrid3D.h in Headers */, - E61038D615DD169B00819640 /* CCActionInstant.h in Headers */, - E61038D715DD169B00819640 /* CCActionInterval.h in Headers */, - E61038D815DD169B00819640 /* CCActionManager.h in Headers */, - E61038D915DD169B00819640 /* CCActionPageTurn3D.h in Headers */, - E61038DA15DD169B00819640 /* CCActionProgressTimer.h in Headers */, - E61038DB15DD169B00819640 /* CCActionTiledGrid.h in Headers */, - E61038DC15DD169B00819640 /* CCActionTween.h in Headers */, - E61038DD15DD169B00819640 /* CCAnimation.h in Headers */, - E61038DE15DD169B00819640 /* CCAnimationCache.h in Headers */, - E61038DF15DD169B00819640 /* CCAtlasNode.h in Headers */, - E61038E015DD169B00819640 /* CCCamera.h in Headers */, - E61038E115DD169B00819640 /* ccConfig.h in Headers */, - E61038E215DD169B00819640 /* CCConfiguration.h in Headers */, - E61038E315DD169B00819640 /* ccDeprecated.h in Headers */, - E61038E415DD169B00819640 /* CCDirector.h in Headers */, - E61038E515DD169B00819640 /* CCDrawingPrimitives.h in Headers */, - E61038E615DD169B00819640 /* CCGLProgram.h in Headers */, - E61038E715DD169B00819640 /* ccGLStateCache.h in Headers */, - E61038E815DD169B00819640 /* CCGrabber.h in Headers */, - E61038E915DD169B00819640 /* CCGrid.h in Headers */, - E61038EA15DD169B00819640 /* CCLabelAtlas.h in Headers */, - E61038EB15DD169B00819640 /* CCLabelBMFont.h in Headers */, - E61038EC15DD169B00819640 /* CCLabelTTF.h in Headers */, - E61038ED15DD169B00819640 /* CCLayer.h in Headers */, - E61038EE15DD169B00819640 /* ccMacros.h in Headers */, - E61038EF15DD169B00819640 /* CCMenu.h in Headers */, - E61038F015DD169B00819640 /* CCMenuItem.h in Headers */, - E61038F115DD169B00819640 /* CCMotionStreak.h in Headers */, - E61038F215DD169B00819640 /* CCNode+Debug.h in Headers */, - E61038F315DD169B00819640 /* CCNode.h in Headers */, - E61038F415DD169B00819640 /* CCParallaxNode.h in Headers */, - E61038F515DD169B00819640 /* CCParticleBatchNode.h in Headers */, - E61038F615DD169B00819640 /* CCParticleSystem.h in Headers */, - E61038F715DD169B00819640 /* CCParticleSystemQuad.h in Headers */, - E61038F815DD169B00819640 /* CCProgressTimer.h in Headers */, - E61038F915DD169B00819640 /* CCProtocols.h in Headers */, - E61038FA15DD169B00819640 /* CCRenderTexture.h in Headers */, - E61038FB15DD169B00819640 /* CCScene.h in Headers */, - E61038FC15DD169B00819640 /* CCScheduler.h in Headers */, - E61038FD15DD169B00819640 /* ccShader_Position_uColor_frag.h in Headers */, - E61038FE15DD169B00819640 /* ccShader_Position_uColor_vert.h in Headers */, - E61038FF15DD169B00819640 /* ccShader_PositionColor_frag.h in Headers */, - E610390015DD169B00819640 /* ccShader_PositionColor_vert.h in Headers */, - E610390115DD169B00819640 /* ccShader_PositionTexture_frag.h in Headers */, - E610390215DD169B00819640 /* ccShader_PositionTexture_uColor_frag.h in Headers */, - E610390315DD169B00819640 /* ccShader_PositionTexture_uColor_vert.h in Headers */, - E610390415DD169B00819640 /* ccShader_PositionTexture_vert.h in Headers */, - E610390515DD169B00819640 /* ccShader_PositionTextureA8Color_frag.h in Headers */, - E610390615DD169B00819640 /* ccShader_PositionTextureA8Color_vert.h in Headers */, - E610390715DD169B00819640 /* ccShader_PositionTextureColor_frag.h in Headers */, - E610390815DD169B00819640 /* ccShader_PositionTextureColor_vert.h in Headers */, - E610390915DD169B00819640 /* ccShader_PositionTextureColorAlphaTest_frag.h in Headers */, - E610390A15DD169B00819640 /* CCShaderCache.h in Headers */, - E610390B15DD169B00819640 /* ccShaders.h in Headers */, - E610390C15DD169B00819640 /* CCSprite.h in Headers */, - E610390D15DD169B00819640 /* CCSpriteBatchNode.h in Headers */, - E610390E15DD169B00819640 /* CCSpriteFrame.h in Headers */, - E610390F15DD169B00819640 /* CCSpriteFrameCache.h in Headers */, - E610391015DD169B00819640 /* CCTexture2D.h in Headers */, - E610391115DD169B00819640 /* CCTextureAtlas.h in Headers */, - E610391215DD169B00819640 /* CCTextureCache.h in Headers */, - E610391315DD169B00819640 /* CCTexturePVR.h in Headers */, - E610391415DD169B00819640 /* CCTileMapAtlas.h in Headers */, - E610391515DD169B00819640 /* CCTMXLayer.h in Headers */, - E610391615DD169B00819640 /* CCTMXObjectGroup.h in Headers */, - E610391715DD169B00819640 /* CCTMXTiledMap.h in Headers */, - E610391815DD169B00819640 /* CCTMXXMLParser.h in Headers */, - E610391915DD169B00819640 /* CCTransition.h in Headers */, - E610391A15DD169B00819640 /* CCTransitionOrientationType.h in Headers */, - E610391B15DD169B00819640 /* CCTransitionPageTurn.h in Headers */, - E610391C15DD169B00819640 /* CCTransitionProgress.h in Headers */, - E610391D15DD169B00819640 /* ccTypes.h in Headers */, - E610391E15DD169B00819640 /* cocos2d.h in Headers */, - E610391F15DD169B00819640 /* CCGL.h in Headers */, - E610392015DD169B00819640 /* CCNS.h in Headers */, - E610392115DD169B00819640 /* CCDirectorIOS.h in Headers */, - E610392215DD169B00819640 /* CCES2Renderer.h in Headers */, - E610392315DD169B00819640 /* CCESRenderer.h in Headers */, - E610392415DD169B00819640 /* CCGLView.h in Headers */, - E610392515DD169B00819640 /* CCTouchDelegateProtocol.h in Headers */, - E610392615DD169B00819640 /* CCTouchDispatcher.h in Headers */, - E610392715DD169B00819640 /* CCTouchHandler.h in Headers */, - E610392815DD169B00819640 /* CCDirectorMac.h in Headers */, - E610392915DD169B00819640 /* CCEventDispatcher.h in Headers */, - E610392A15DD169B00819640 /* CCGLView.h in Headers */, - E610392B15DD169B00819640 /* CCWindow.h in Headers */, - E610392C15DD169B00819640 /* base64.h in Headers */, - E610392D15DD169B00819640 /* CCArray.h in Headers */, - E610392E15DD169B00819640 /* ccCArray.h in Headers */, - E610392F15DD169B00819640 /* CCFileUtils.h in Headers */, - E610393015DD169B00819640 /* CCProfiling.h in Headers */, - E610393115DD169B00819640 /* ccUtils.h in Headers */, - E610393215DD169B00819640 /* CCVertex.h in Headers */, - E610393315DD169B00819640 /* CGPointExtension.h in Headers */, - E610393415DD169B00819640 /* NSThread+performBlock.h in Headers */, - E610393515DD169B00819640 /* OpenGL_Internal.h in Headers */, - E610393615DD169B00819640 /* TGAlib.h in Headers */, - E610393715DD169B00819640 /* TransformUtils.h in Headers */, - E610393815DD169B00819640 /* uthash.h in Headers */, - E610393915DD169B00819640 /* utlist.h in Headers */, - E610393A15DD169B00819640 /* ZipUtils.h in Headers */, - E610393B15DD169B00819640 /* CDAudioManager.h in Headers */, - E610393C15DD169B00819640 /* CDConfig.h in Headers */, - E610393D15DD169B00819640 /* CDOpenALSupport.h in Headers */, - E610393E15DD169B00819640 /* CocosDenshion.h in Headers */, - E610393F15DD169B00819640 /* SimpleAudioEngine.h in Headers */, - E610394015DD169B00819640 /* CDXMacOSXSupport.h in Headers */, - E610394115DD169B00819640 /* CDXPropertyModifierAction.h in Headers */, - E610394215DD169B00819640 /* aabb.h in Headers */, - E610394315DD169B00819640 /* mat4stack.h in Headers */, - E610394415DD169B00819640 /* matrix.h in Headers */, - E610394515DD169B00819640 /* kazmath.h in Headers */, - E610394615DD169B00819640 /* mat3.h in Headers */, - E610394715DD169B00819640 /* mat4.h in Headers */, - E610394815DD169B00819640 /* neon_matrix_impl.h in Headers */, - E610394915DD169B00819640 /* plane.h in Headers */, - E610394A15DD169B00819640 /* quaternion.h in Headers */, - E610394B15DD169B00819640 /* ray2.h in Headers */, - E610394C15DD169B00819640 /* utility.h in Headers */, - E610394D15DD169B00819640 /* vec2.h in Headers */, - E610394E15DD169B00819640 /* vec3.h in Headers */, - E610394F15DD169B00819640 /* vec4.h in Headers */, - E610395015DD169B00819640 /* png.h in Headers */, - E610395115DD169B00819640 /* pngconf.h in Headers */, - E61D8BF515E2771F00F768B0 /* CCRenderTargetNode.h in Headers */, + E6E9AF94181456C200E3C1A2 /* aabb.h in Headers */, + E6E9AEB0181456C100E3C1A2 /* ccShader_PositionTextureA8Color_vert.h in Headers */, + E6E9AE66181456C100E3C1A2 /* CCParticleExamples.h in Headers */, + E6E9AF98181456C200E3C1A2 /* matrix.h in Headers */, + E6E9AEB8181456C100E3C1A2 /* CCShaderCache.h in Headers */, + E6E9AF56181456C200E3C1A2 /* TransformUtils.h in Headers */, + E6E9AEFC181456C100E3C1A2 /* ccTypes.h in Headers */, + E6E9AF9A181456C200E3C1A2 /* kazmath.h in Headers */, + E6E9AF2C181456C200E3C1A2 /* NSEvent+CC.h in Headers */, + E6E9AE4E181456C100E3C1A2 /* CCMenuItem.h in Headers */, + E6E9AE18181456C100E3C1A2 /* CCDirector.h in Headers */, + E6E9AE9E181456C100E3C1A2 /* ccShader_PositionColor_frag.h in Headers */, + E6E9AF48181456C200E3C1A2 /* NSAttributedString+CCAdditions.h in Headers */, + E6E9AEAA181456C100E3C1A2 /* ccShader_PositionTexture_uColor_vert.h in Headers */, + E6E9AEA8181456C100E3C1A2 /* ccShader_PositionTexture_uColor_frag.h in Headers */, + E6E9AF6A181456C200E3C1A2 /* CCControlSubclass.h in Headers */, + E6E9AEBC181456C100E3C1A2 /* ccShaders.h in Headers */, + E6E9AE80181456C100E3C1A2 /* CCProgressTimer.h in Headers */, + E6E9AF14181456C100E3C1A2 /* CCResponder.h in Headers */, + E6E9AFAC181456C200E3C1A2 /* vec3.h in Headers */, + E6E9AE48181456C100E3C1A2 /* ccMacros.h in Headers */, + E6E9AE0E181456C100E3C1A2 /* ccConfig.h in Headers */, + E6E9AEF4181456C100E3C1A2 /* CCTMXXMLParser.h in Headers */, + E6E9AE4A181456C100E3C1A2 /* CCMenu.h in Headers */, + E6E9AF78181456C200E3C1A2 /* cocos2d-ui.h in Headers */, + E6E9AE62181456C100E3C1A2 /* CCParticleBatchNode.h in Headers */, + E6E9AE7C181456C100E3C1A2 /* CCPhysicsNode.h in Headers */, + E6E9AF4C181456C200E3C1A2 /* NSThread+performBlock.h in Headers */, + E6E9AE8E181456C100E3C1A2 /* CCResponderManager.h in Headers */, + E6E9AE44181456C100E3C1A2 /* CCLayer.h in Headers */, + E6E9AEB4181456C100E3C1A2 /* ccShader_PositionTextureColor_vert.h in Headers */, + E6E9AEFE181456C100E3C1A2 /* cocos2d.h in Headers */, + E6E9AF32181456C200E3C1A2 /* base64.h in Headers */, + E6E9AF74181456C200E3C1A2 /* CCTableView.h in Headers */, + E6E9AE5A181456C100E3C1A2 /* CCNode.h in Headers */, + E6E9AF66181456C200E3C1A2 /* CCControl.h in Headers */, + E6E9AF0E181456C100E3C1A2 /* CCESRenderer.h in Headers */, + E6E9AEE0181456C100E3C1A2 /* CCTexturePVR.h in Headers */, + E6E9AEF0181456C100E3C1A2 /* CCTMXTiledMap.h in Headers */, + E6E9ADF8181456C100E3C1A2 /* CCActionTween.h in Headers */, + E6E9AF5A181456C200E3C1A2 /* uthash.h in Headers */, + E6E9AE5E181456C100E3C1A2 /* CCParallaxNode.h in Headers */, + E6E9AE84181456C100E3C1A2 /* CCProtocols.h in Headers */, + E6E9AF06181456C100E3C1A2 /* CCDirectorIOS.h in Headers */, + E6E9AE1C181456C100E3C1A2 /* CCDrawingPrimitives.h in Headers */, + E6E9AE52181456C100E3C1A2 /* CCMotionStreak.h in Headers */, + E6E9AE72181456C100E3C1A2 /* CCPhysics+ObjectiveChipmunk.h in Headers */, + E6E9AEA4181456C100E3C1A2 /* ccShader_PositionColorLengthTexture_vert.h in Headers */, + E6E9AEA6181456C100E3C1A2 /* ccShader_PositionTexture_frag.h in Headers */, + E6E9AEAC181456C100E3C1A2 /* ccShader_PositionTexture_vert.h in Headers */, + E6E9AE6E181456C100E3C1A2 /* CCParticleSystemQuad.h in Headers */, + E6E9ADEC181456C100E3C1A2 /* CCActionPageTurn3D.h in Headers */, + E6E9AED0181456C100E3C1A2 /* CCSpriteFrameCache.h in Headers */, + E6E9AE04181456C100E3C1A2 /* CCAtlasNode.h in Headers */, + E6E9AF02181456C100E3C1A2 /* CCGL.h in Headers */, + E6E9AE8A181456C100E3C1A2 /* CCResponder.h in Headers */, + E6E9AEDC181456C100E3C1A2 /* CCTextureCache.h in Headers */, + E6E9AF1C181456C100E3C1A2 /* UITouch+CC.h in Headers */, + E6E9ADFC181456C100E3C1A2 /* CCAnimation.h in Headers */, + E6E9ADE4181456C100E3C1A2 /* CCActionInterval.h in Headers */, + E6E9AF3E181456C200E3C1A2 /* ccUtils.h in Headers */, + E6E9AFD0181456C200E3C1A2 /* pngconf.h in Headers */, + E6E9AEA0181456C100E3C1A2 /* ccShader_PositionColor_vert.h in Headers */, + E6E9AE96181456C100E3C1A2 /* CCScheduler.h in Headers */, + E6E9AECC181456C100E3C1A2 /* CCSpriteFrame.h in Headers */, + E6E9AEC8181456C100E3C1A2 /* CCSpriteBatchNode.h in Headers */, + E6E9AE24181456C100E3C1A2 /* ccFPSImages.h in Headers */, + E6E9AFA4181456C200E3C1A2 /* quaternion.h in Headers */, + E6E9AEC0181456C100E3C1A2 /* CCSprite.h in Headers */, + E6E9AE92181456C100E3C1A2 /* CCScene.h in Headers */, + E6E9AE38181456C100E3C1A2 /* CCLabelAtlas.h in Headers */, + E6E9AEA2181456C100E3C1A2 /* ccShader_PositionColorLengthTexture_frag.h in Headers */, + E6E9AF0A181456C100E3C1A2 /* CCES2Renderer.h in Headers */, + E6E9AF34181456C200E3C1A2 /* CCFileUtils.h in Headers */, + E6E9AFA6181456C200E3C1A2 /* ray2.h in Headers */, + E6E9AF52181456C200E3C1A2 /* TGAlib.h in Headers */, + E6E9AFA8181456C200E3C1A2 /* utility.h in Headers */, + E6E9AEE4181456C100E3C1A2 /* CCTileMapAtlas.h in Headers */, + E6E9AFAA181456C200E3C1A2 /* vec2.h in Headers */, + E6E9ADD0181456C100E3C1A2 /* CCActionCatmullRom.h in Headers */, + E6E9ADDC181456C100E3C1A2 /* CCActionGrid3D.h in Headers */, + E6E9AE6A181456C100E3C1A2 /* CCParticleSystem.h in Headers */, + E6E9ADE0181456C100E3C1A2 /* CCActionInstant.h in Headers */, + E6E9AE28181456C100E3C1A2 /* CCGLProgram.h in Headers */, + E6E9AE20181456C100E3C1A2 /* CCDrawNode.h in Headers */, + E6E9AE30181456C100E3C1A2 /* CCGrabber.h in Headers */, + E6E9ADCC181456C100E3C1A2 /* CCAction.h in Headers */, + E6E9AEB6181456C100E3C1A2 /* ccShader_PositionTextureColorAlphaTest_frag.h in Headers */, + E6E9ADD8181456C100E3C1A2 /* CCActionGrid.h in Headers */, + E6E9AEF8181456C100E3C1A2 /* CCTransition.h in Headers */, + E6E9AEAE181456C100E3C1A2 /* ccShader_PositionTextureA8Color_frag.h in Headers */, + E6E9AEC4181456C100E3C1A2 /* CCSprite9Slice.h in Headers */, + E6E9AE9A181456C100E3C1A2 /* ccShader_Position_uColor_frag.h in Headers */, + E6E9AF9E181456C200E3C1A2 /* mat4.h in Headers */, + E6E9AFCE181456C200E3C1A2 /* png.h in Headers */, + E6E9AED4181456C100E3C1A2 /* CCTexture2D.h in Headers */, + E6E9AF6C181456C200E3C1A2 /* CCControlTextureFactory.h in Headers */, + E6E9AF20181456C100E3C1A2 /* CCDirectorMac.h in Headers */, + E6E9AED8181456C100E3C1A2 /* CCTextureAtlas.h in Headers */, + E6E9AF28181456C100E3C1A2 /* CCWindow.h in Headers */, + E6E9ADF0181456C100E3C1A2 /* CCActionProgressTimer.h in Headers */, + E6E9AE00181456C100E3C1A2 /* CCAnimationCache.h in Headers */, + E6E9AEE8181456C100E3C1A2 /* CCTMXLayer.h in Headers */, + E6E9ADE8181456C100E3C1A2 /* CCActionManager.h in Headers */, + E6E9ADF4181456C100E3C1A2 /* CCActionTiledGrid.h in Headers */, + E6E9AF40181456C200E3C1A2 /* CCVertex.h in Headers */, + E6E9AF5E181456C200E3C1A2 /* ZipUtils.h in Headers */, + E6E9AE2C181456C100E3C1A2 /* ccGLStateCache.h in Headers */, + E6E9AE14181456C100E3C1A2 /* ccDeprecated.h in Headers */, + E6E9AF04181456C100E3C1A2 /* CCNS.h in Headers */, + E6E9AEEC181456C100E3C1A2 /* CCTMXObjectGroup.h in Headers */, + E6E9ADD4181456C100E3C1A2 /* CCActionEase.h in Headers */, + E6E9AF96181456C200E3C1A2 /* mat4stack.h in Headers */, + E6E9AE40181456C100E3C1A2 /* CCLabelTTF.h in Headers */, + E6E9AF9C181456C200E3C1A2 /* mat3.h in Headers */, + E6E9AF70181456C200E3C1A2 /* CCScrollView.h in Headers */, + E6E9AFAE181456C200E3C1A2 /* vec4.h in Headers */, + E6E9AF10181456C100E3C1A2 /* CCGLView.h in Headers */, + E6E9AE3C181456C100E3C1A2 /* CCLabelBMFont.h in Headers */, + E6E9AEB2181456C100E3C1A2 /* ccShader_PositionTextureColor_frag.h in Headers */, + E6E9AE86181456C100E3C1A2 /* CCRenderTexture.h in Headers */, + E6E9AF44181456C200E3C1A2 /* CGPointExtension.h in Headers */, + E6E9AF62181456C200E3C1A2 /* CCButton.h in Headers */, + E6E9AE08181456C100E3C1A2 /* CCCamera.h in Headers */, + E6E9AFA2181456C200E3C1A2 /* plane.h in Headers */, + E6E9AE9C181456C100E3C1A2 /* ccShader_Position_uColor_vert.h in Headers */, + E6E9AE56181456C100E3C1A2 /* CCNode+Debug.h in Headers */, + E6E9AE0A181456C100E3C1A2 /* CCClippingNode.h in Headers */, + E6E9AE34181456C100E3C1A2 /* CCGrid.h in Headers */, + E6E9AFA0181456C200E3C1A2 /* neon_matrix_impl.h in Headers */, + E6E9AE10181456C100E3C1A2 /* CCConfiguration.h in Headers */, + E6E9AF5C181456C200E3C1A2 /* utlist.h in Headers */, + E6E9AF50181456C200E3C1A2 /* OpenGL_Internal.h in Headers */, + E6E9AF38181456C200E3C1A2 /* CCProfiling.h in Headers */, + E6E9AF18181456C100E3C1A2 /* CCResponderManager.h in Headers */, + E6E9AF24181456C100E3C1A2 /* CCGLView.h in Headers */, + E6E9AE74181456C100E3C1A2 /* CCPhysicsbody.h in Headers */, + E6E9AE78181456C100E3C1A2 /* CCPhysicsJoint.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -2221,6 +1850,7 @@ buildConfigurationList = E692936F161ED0A400DB1EAA /* Build configuration list for PBXNativeTarget "CocosLibMac_script" */; buildPhases = ( E6929372161ED1B800DB1EAA /* ShellScript */, + E6E9B026181459BB00E3C1A2 /* Sources */, ); buildRules = ( ); @@ -2235,7 +1865,8 @@ isa = PBXNativeTarget; buildConfigurationList = E6DDF2F912D8F8ED009031A5 /* Build configuration list for PBXNativeTarget "CocosLib_script" */; buildPhases = ( - E6DDF2F812D8F8ED009031A5 /* ShellScript */, + E6DDF2F812D8F8ED009031A5 /* Run Script */, + E6E9B025181459B300E3C1A2 /* Sources */, ); buildRules = ( ); @@ -2252,16 +1883,35 @@ buildPhases = ( E6E2A62E12CE48E000923828 /* Headers */, E6E2A62F12CE48E000923828 /* Sources */, + E6E9B00B1814572C00E3C1A2 /* Frameworks */, ); buildRules = ( ); dependencies = ( + E6E9B00A1814570D00E3C1A2 /* PBXTargetDependency */, ); name = Cocos; productName = Cocos; productReference = E6E2A63212CE48E000923828 /* libCocos.a */; productType = "com.apple.product-type.library.static"; }; + E6E9B02E18145B0000E3C1A2 /* CocosDenshion */ = { + isa = PBXNativeTarget; + buildConfigurationList = E6E9B04D18145B0000E3C1A2 /* Build configuration list for PBXNativeTarget "CocosDenshion" */; + buildPhases = ( + E6E9B02B18145B0000E3C1A2 /* Sources */, + E6E9B02C18145B0000E3C1A2 /* Frameworks */, + E6E9B02D18145B0000E3C1A2 /* CopyFiles */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = CocosDenshion; + productName = CocosDenshion; + productReference = E6E9B02F18145B0000E3C1A2 /* libCocosDenshion.a */; + productType = "com.apple.product-type.library.static"; + }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ @@ -2279,20 +1929,73 @@ Japanese, French, German, + en, ); mainGroup = 0867D691FE84028FC02AAC07 /* CocosLib */; productRefGroup = 034768DFFF38A50411DB9C8B /* Products */; projectDirPath = ""; + projectReferences = ( + { + ProductGroup = E6E9AFF5181456D700E3C1A2 /* Products */; + ProjectRef = E6E9AFF4181456D700E3C1A2 /* Chipmunk7.xcodeproj */; + }, + ); projectRoot = ""; targets = ( E6E2A63112CE48E000923828 /* Cocos */, E6DDF2F612D8F8ED009031A5 /* CocosLib_script */, E69291D6161ECA2F00DB1EAA /* CocosMac */, E6929366161ED0A400DB1EAA /* CocosLibMac_script */, + E6E9B02E18145B0000E3C1A2 /* CocosDenshion */, ); }; /* End PBXProject section */ +/* Begin PBXReferenceProxy section */ + E6E9AFFE181456D800E3C1A2 /* ChipmunkDemo.app */ = { + isa = PBXReferenceProxy; + fileType = wrapper.application; + path = ChipmunkDemo.app; + remoteRef = E6E9AFFD181456D800E3C1A2 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + E6E9B000181456D800E3C1A2 /* libChipmunk.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libChipmunk.a; + remoteRef = E6E9AFFF181456D800E3C1A2 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + E6E9B002181456D800E3C1A2 /* libChipmunk-iPhone.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = "libChipmunk-iPhone.a"; + remoteRef = E6E9B001181456D800E3C1A2 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + E6E9B004181456D800E3C1A2 /* Benchmark iPhone.app */ = { + isa = PBXReferenceProxy; + fileType = wrapper.application; + path = "Benchmark iPhone.app"; + remoteRef = E6E9B003181456D800E3C1A2 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + E6E9B006181456D800E3C1A2 /* libObjectiveChipmunk.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libObjectiveChipmunk.a; + remoteRef = E6E9B005181456D800E3C1A2 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + E6E9B008181456D800E3C1A2 /* ObjectiveChipmunkTests.xctest */ = { + isa = PBXReferenceProxy; + fileType = wrapper.cfbundle; + path = ObjectiveChipmunkTests.xctest; + remoteRef = E6E9B007181456D800E3C1A2 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; +/* End PBXReferenceProxy section */ + /* Begin PBXShellScriptBuildPhase section */ E6929372161ED1B800DB1EAA /* ShellScript */ = { isa = PBXShellScriptBuildPhase; @@ -2305,20 +2008,21 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "#!/bin/sh\n\nTARGET=\"CocosMac\"\n#undefine the following line if you want to move and properly unpack the .zip files into the destination folder specified with DEST_DIR\nSCRIPT_OPTIONS=\"MOVE_FILE\"\n#DEST_DIR=\"${PROJECT_DIR}/../SharedLibs\"\nDEST_DIR=~/Programming/SharedLibsMac\n\nmkdir -p ~/Programming\nmkdir -p ~/Programming/SharedLibsMac\n\nGIT_REVISION=$(git describe --tags `git rev-list --tags --max-count=1`)\nif [ ! -z $GIT_REVISION ]; then\nLIB_VERSION=\"-Tag-$GIT_REVISION\"\nelse\nLIB_VERSION=\"-unversioned\"\nfi\n\nLIBRARY_NAME=\"lib$TARGET.a\"\nLIBRARY_OUT_NAME_RELATIVE=\"lib$TARGET${LIB_VERSION}.a\"\nLIBRARY_OUT_NAME=\"lib/$LIBRARY_OUT_NAME_RELATIVE\"\nLATEST_SDK=$(xcodebuild -showsdks | grep macosx | awk 'BEGIN{FS=\"\\t\";}{print $3}' | cut -d ' ' -f 2 | tail -n 1)\n\n# remove existing build dir\nrm -rf ${PROJECT_DIR}/build\nmkdir -p ${PROJECT_DIR}/build\nlocal_build_root=\"${PROJECT_DIR}/build\"\nbuild_styles=\"Debug Release\"\n\nfor current_style in $build_styles; do\nLIBRARY_ARCHIVE=\"$TARGET${LIB_VERSION}-${current_style}.zip\"\n\nif [ $current_style = \"Debug\" ]; then\nLIBRARY_ARCHIVE=\"$TARGET-${current_style}.zip\"\nelse\nLIBRARY_ARCHIVE=\"$TARGET.zip\"\nfi\n\n# remove existing output file\nrm -rf ${PROJECT_DIR}/lib\nmkdir -p ${PROJECT_DIR}/lib\n\n# Build library for MacOS X\nxcodebuild clean -target $TARGET -configuration $current_style -sdk $LATEST_SDK\nxcodebuild -target $TARGET -configuration $current_style -sdk $LATEST_SDK build\n\n# Glue together libraries\nlipo \"${local_build_root}/${current_style}/$LIBRARY_NAME\" -create -output \"${PROJECT_DIR}/$LIBRARY_OUT_NAME\"\n\n# Create symlink\ncd lib\nln -s \"$LIBRARY_OUT_NAME_RELATIVE\" \"$LIBRARY_NAME\"\ncd ..\n\nif [ $? -eq 0 ]; then\nzip -R -y \"${PROJECT_DIR}/$LIBRARY_ARCHIVE\" \"lib/*.a\"\nzip -r -y \"${PROJECT_DIR}/$LIBRARY_ARCHIVE\" \"resources\" \"include\" -x@zip_exclude.lst\n#zip \"${PROJECT_DIR}/$LIBRARY_ARCHIVE\" .packageid\nfi\n\nif [ $SCRIPT_OPTIONS = \"MOVE_FILE\" ]; then\nBUILT_ZIP=\"${PROJECT_DIR}/$LIBRARY_ARCHIVE\"\nNEW_ZIP=\"$DEST_DIR/$LIBRARY_ARCHIVE\"\n\nif [ $current_style = \"Debug\" ]; then\nOLD_FOLDER=\"$DEST_DIR/$TARGET-${current_style}\"\nelse\nOLD_FOLDER=\"$DEST_DIR/$TARGET\"\nfi\nrm -rf $OLD_FOLDER\nmv $BUILT_ZIP \"$DEST_DIR/\"\nunzip -o $NEW_ZIP -d $OLD_FOLDER/\nrm -f $NEW_ZIP\nfi\n\ndone"; + shellScript = "#!/bin/sh\n\nset -e\n\nTARGET=\"CocosMac\"\n#undefine the following line if you want to move and properly unpack the .zip files into the destination folder specified with DEST_DIR\n#SCRIPT_OPTIONS=\"MOVE_FILE\"\nDEST_DIR=~/Programming/SharedLibsMac\n\nmkdir -p ~/Programming\nmkdir -p ~/Programming/SharedLibsMac\n\nGIT_REVISION=$(git describe --always)\nif [ ! -z $GIT_REVISION ]; then\nLIB_VERSION=\"-Tag-$GIT_REVISION\"\nelse\nLIB_VERSION=\"-unversioned\"\nfi\n\nLIBRARY_NAME=\"lib$TARGET.a\"\nLIBRARY_OUT_NAME_RELATIVE=\"lib$TARGET${LIB_VERSION}.a\"\nLIBRARY_OUT_NAME=\"lib/$LIBRARY_OUT_NAME_RELATIVE\"\nLATEST_SDK=$(xcodebuild -showsdks | grep macosx | awk 'BEGIN{FS=\"\\t\";}{print $3}' | cut -d ' ' -f 2 | tail -n 1)\n\n# remove existing build dir\nrm -rf ${PROJECT_DIR}/build\nmkdir -p ${PROJECT_DIR}/build\n\n# remove existing include dir\nrm -rf ${PROJECT_DIR}/include\nmkdir -p ${PROJECT_DIR}/include\n\nlocal_build_root=\"${PROJECT_DIR}/build\"\nbuild_styles=\"Debug Release\"\n\n# Copy headers\n# Copy headers - Cocos2D\nrsync -rt --delay-updates --modify-window=1 --include='*.h' --exclude='*.*' ${PROJECT_DIR}/cocos2d ${PROJECT_DIR}/include/\n\n# Copy headers - Cocos2D-UI\nrsync -rt --delay-updates --modify-window=1 --include='*.h' --exclude='*.*' ${PROJECT_DIR}/cocos2d-ui ${PROJECT_DIR}/include/\n\n# Copy headers - CocosDenshion\nrsync -rt --delay-updates --modify-window=1 --include='*.h' --exclude='*.*' ${PROJECT_DIR}/CocosDenshion ${PROJECT_DIR}/include/\n\n# Copy headers - Box2D\nrsync -rt --delay-updates --modify-window=1 --include='*.h' --exclude='*.*' ${PROJECT_DIR}/external/Box2D/Box2D ${PROJECT_DIR}/include/\n\n# Copy headers - libpng\nrsync -rt --delay-updates --modify-window=1 --include='*.h' --exclude='*.*' ${PROJECT_DIR}/external/libpng ${PROJECT_DIR}/include/\n\n# Copy headers - kazmath\nrsync -rt --delay-updates --modify-window=1 --include='*.h' --exclude='*.*' ${PROJECT_DIR}/external/kazmath/include/kazmath ${PROJECT_DIR}/include/\n\n# Copy headers - Chipmunk\nrsync -rt --delay-updates --modify-window=1 --include='*.h' --exclude='*.*' ${PROJECT_DIR}/external/Chipmunk/objectivec/include/ObjectiveChipmunk ${PROJECT_DIR}/include/Chipmunk/\n\nrsync -rt --delay-updates --modify-window=1 --include='*.h' --exclude='*.*' ${PROJECT_DIR}/external/Chipmunk/include/chipmunk ${PROJECT_DIR}/include/Chipmunk/\n\n# Build libraries\nfor current_style in $build_styles; do\nLIBRARY_ARCHIVE=\"$TARGET${LIB_VERSION}-${current_style}.zip\"\n\nif [ $current_style = \"Debug\" ]; then\nLIBRARY_ARCHIVE=\"$TARGET-${current_style}.zip\"\nelse\nLIBRARY_ARCHIVE=\"$TARGET.zip\"\nfi\n\n# remove existing library zip files\nrm -f \"${PROJECT_DIR}/$LIBRARY_ARCHIVE\"\n\n# remove existing output file\nrm -rf ${PROJECT_DIR}/lib\nmkdir -p ${PROJECT_DIR}/lib\n\n# Build library for MacOS X\nxcodebuild clean -target $TARGET -project CocosLib.xcodeproj -configuration $current_style -sdk $LATEST_SDK\nxcodebuild -target $TARGET -project CocosLib.xcodeproj -configuration $current_style -sdk $LATEST_SDK build\n\n# Glue together libraries\nlipo \"${local_build_root}/${current_style}/$LIBRARY_NAME\" -create -output \"${PROJECT_DIR}/$LIBRARY_OUT_NAME\"\n\n# Create symlink\ncd lib\nln -s \"$LIBRARY_OUT_NAME_RELATIVE\" \"$LIBRARY_NAME\"\ncd ..\n\n#TODO: deal with either Chipmunk or Box2D\n#unless they are not going to be packaged with this library any longer\n\nif [ $? -eq 0 ]; then\nfind \"${PROJECT_DIR}/external/Chipmunk\" -name \"*.a\" -exec rm -f \"{}\" \\;\nzip -R -y \"${PROJECT_DIR}/$LIBRARY_ARCHIVE\" \"lib/*.a\"\nzip -r -y \"${PROJECT_DIR}/$LIBRARY_ARCHIVE\" \"resources\" \"include\" -x@zip_exclude.lst\n#zip \"${PROJECT_DIR}/$LIBRARY_ARCHIVE\" .packageid\nfi\n\nif [ $SCRIPT_OPTIONS = \"MOVE_FILE\" ]; then\nBUILT_ZIP=\"${PROJECT_DIR}/$LIBRARY_ARCHIVE\"\nNEW_ZIP=\"$DEST_DIR/$LIBRARY_ARCHIVE\"\n\nif [ $current_style = \"Debug\" ]; then\nOLD_FOLDER=\"$DEST_DIR/$TARGET-${current_style}\"\nelse\nOLD_FOLDER=\"$DEST_DIR/$TARGET\"\nfi\nrm -rf $OLD_FOLDER\nmv $BUILT_ZIP \"$DEST_DIR/\"\nunzip -o $NEW_ZIP -d $OLD_FOLDER/\nrm -f $NEW_ZIP\nfi\ndone\n\nrm -rf ${PROJECT_DIR}/include\nrm -rf ${PROJECT_DIR}/build\nrm -rf ${PROJECT_DIR}/lib\n\n# restore the modified submodule to its unmodified state\ncd ${PROJECT_DIR}/external/Chipmunk\ngit reset --hard\ncd ${PROJECT_DIR}\n"; }; - E6DDF2F812D8F8ED009031A5 /* ShellScript */ = { + E6DDF2F812D8F8ED009031A5 /* Run Script */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( ); + name = "Run Script"; outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "#!/bin/sh\n\nTARGET=\"Cocos\"\n#undefine the following line if you want to move and properly unpack the .zip files into the destination folder specified with DEST_DIR\nSCRIPT_OPTIONS=\"MOVE_FILE\"\n#DEST_DIR=\"${PROJECT_DIR}/../SharedLibs\"\nDEST_DIR=~/Programming/SharedLibs\n\nmkdir -p ~/Programming\nmkdir -p ~/Programming/SharedLibs\n\nGIT_REVISION=$(git describe --tags `git rev-list --tags --max-count=1`)\nif [ ! -z $GIT_REVISION ]; then\nLIB_VERSION=\"-Tag-$GIT_REVISION\"\nelse\nLIB_VERSION=\"-unversioned\"\nfi\n\nLIBRARY_NAME=\"lib$TARGET.a\"\nLIBRARY_OUT_NAME_RELATIVE=\"lib$TARGET${LIB_VERSION}.a\"\nLIBRARY_OUT_NAME=\"lib/$LIBRARY_OUT_NAME_RELATIVE\"\nLATEST_SDK_DEVICE=$(xcodebuild -showsdks | grep iphoneos | awk 'BEGIN{FS=\"\\t\";}{print $3}' | cut -d ' ' -f 2 | tail -n 1)\nLATEST_SDK_SIMULATOR=$(xcodebuild -showsdks | grep iphonesimulator | awk 'BEGIN{FS=\"\\t\";}{print $3}' | cut -d ' ' -f 2 | tail -n 1)\n\n# remove existing build dir\nrm -rf ${PROJECT_DIR}/build\nmkdir -p ${PROJECT_DIR}/build\nlocal_build_root=\"${PROJECT_DIR}/build\"\nbuild_styles=\"Debug Release\"\n\nfor current_style in $build_styles; do\nLIBRARY_ARCHIVE=\"$TARGET${LIB_VERSION}-${current_style}.zip\"\n\nif [ $current_style = \"Debug\" ]; then\nLIBRARY_ARCHIVE=\"$TARGET-${current_style}.zip\"\nelse\nLIBRARY_ARCHIVE=\"$TARGET.zip\"\nfi\n\n# remove existing output file\nrm -rf ${PROJECT_DIR}/lib\nmkdir -p ${PROJECT_DIR}/lib\n\n# Build library for simulator\nxcodebuild clean -target $TARGET -configuration $current_style -sdk $LATEST_SDK_SIMULATOR\nxcodebuild -target $TARGET -configuration $current_style -sdk $LATEST_SDK_SIMULATOR build\n\n# Build library for device\nxcodebuild clean -target $TARGET -configuration $current_style -sdk $LATEST_SDK_DEVICE\nxcodebuild -target $TARGET -configuration $current_style -sdk $LATEST_SDK_DEVICE build\n\n# Glue together libraries\nlipo \"${local_build_root}/${current_style}-iphoneos/$LIBRARY_NAME\" -arch i386 \"${local_build_root}/${current_style}-iphonesimulator/$LIBRARY_NAME\" -create -output \"${PROJECT_DIR}/$LIBRARY_OUT_NAME\"\n\n# Create symlink\ncd lib\nln -s \"$LIBRARY_OUT_NAME_RELATIVE\" \"$LIBRARY_NAME\"\ncd ..\n\nif [ $? -eq 0 ]; then\nzip -R -y \"${PROJECT_DIR}/$LIBRARY_ARCHIVE\" \"lib/*.a\"\nzip -r -y \"${PROJECT_DIR}/$LIBRARY_ARCHIVE\" \"resources\" \"include\" -x@zip_exclude.lst\n#zip \"${PROJECT_DIR}/$LIBRARY_ARCHIVE\" .packageid\nfi\n\nif [ $SCRIPT_OPTIONS = \"MOVE_FILE\" ]; then\nBUILT_ZIP=\"${PROJECT_DIR}/$LIBRARY_ARCHIVE\"\nNEW_ZIP=\"$DEST_DIR/$LIBRARY_ARCHIVE\"\n\nif [ $current_style = \"Debug\" ]; then\nOLD_FOLDER=\"$DEST_DIR/$TARGET-${current_style}\"\nelse\nOLD_FOLDER=\"$DEST_DIR/$TARGET\"\nfi\nrm -rf $OLD_FOLDER\nmv $BUILT_ZIP \"$DEST_DIR/\"\nunzip -o $NEW_ZIP -d $OLD_FOLDER/\nrm -f $NEW_ZIP\nfi\n\ndone"; + shellScript = "#!/bin/sh\n\nset -e\n\nTARGET=\"Cocos\"\n#undefine the following line if you want to move and properly unpack the .zip files into the destination folder specified with DEST_DIR\n#SCRIPT_OPTIONS=\"MOVE_FILE\"\nDEST_DIR=~/Programming/SharedLibs\n\nmkdir -p ~/Programming\nmkdir -p ~/Programming/SharedLibs\n\nGIT_REVISION=$(git describe --always)\nif [ ! -z $GIT_REVISION ]; then\nLIB_VERSION=\"-Tag-$GIT_REVISION\"\nelse\nLIB_VERSION=\"-unversioned\"\nfi\n\nLIBRARY_NAME=\"lib$TARGET.a\"\nLIBRARY_OUT_NAME_RELATIVE=\"lib$TARGET${LIB_VERSION}.a\"\nLIBRARY_OUT_NAME=\"lib/$LIBRARY_OUT_NAME_RELATIVE\"\nLATEST_SDK_DEVICE=$(xcodebuild -showsdks | grep iphoneos | awk 'BEGIN{FS=\"\\t\";}{print $3}' | cut -d ' ' -f 2 | tail -n 1)\nLATEST_SDK_SIMULATOR=$(xcodebuild -showsdks | grep iphonesimulator | awk 'BEGIN{FS=\"\\t\";}{print $3}' | cut -d ' ' -f 2 | tail -n 1)\n\n# remove existing build dir\nrm -rf ${PROJECT_DIR}/build\nmkdir -p ${PROJECT_DIR}/build\n\n# remove existing include dir\nrm -rf ${PROJECT_DIR}/include\nmkdir -p ${PROJECT_DIR}/include\n\nlocal_build_root=\"${PROJECT_DIR}/build\"\nbuild_styles=\"Debug Release\"\n\n# Copy headers\n# Copy headers - Cocos2D\nrsync -rt --delay-updates --modify-window=1 --include='*.h' --exclude='*.*' ${PROJECT_DIR}/cocos2d ${PROJECT_DIR}/include/\n\n# Copy headers - Cocos2D-UI\nrsync -rt --delay-updates --modify-window=1 --include='*.h' --exclude='*.*' ${PROJECT_DIR}/cocos2d-ui ${PROJECT_DIR}/include/\n\n# Copy headers - CocosDenshion\nrsync -rt --delay-updates --modify-window=1 --include='*.h' --exclude='*.*' ${PROJECT_DIR}/CocosDenshion ${PROJECT_DIR}/include/\n\n# Copy headers - Box2D\nrsync -rt --delay-updates --modify-window=1 --include='*.h' --exclude='*.*' ${PROJECT_DIR}/external/Box2D/Box2D ${PROJECT_DIR}/include/\n\n# Copy headers - libpng\nrsync -rt --delay-updates --modify-window=1 --include='*.h' --exclude='*.*' ${PROJECT_DIR}/external/libpng ${PROJECT_DIR}/include/\n\n# Copy headers - kazmath\nrsync -rt --delay-updates --modify-window=1 --include='*.h' --exclude='*.*' ${PROJECT_DIR}/external/kazmath/include/kazmath ${PROJECT_DIR}/include/\n\n# Copy headers - Chipmunk\nrsync -rt --delay-updates --modify-window=1 --include='*.h' --exclude='*.*' ${PROJECT_DIR}/external/Chipmunk/objectivec/include/ObjectiveChipmunk ${PROJECT_DIR}/include/Chipmunk/\n\nrsync -rt --delay-updates --modify-window=1 --include='*.h' --exclude='*.*' ${PROJECT_DIR}/external/Chipmunk/include/chipmunk ${PROJECT_DIR}/include/Chipmunk/\n\n# Build libraries\nfor current_style in $build_styles; do\nLIBRARY_ARCHIVE=\"$TARGET${LIB_VERSION}-${current_style}.zip\"\n\nif [ $current_style = \"Debug\" ]; then\nLIBRARY_ARCHIVE=\"$TARGET-${current_style}.zip\"\nelse\nLIBRARY_ARCHIVE=\"$TARGET.zip\"\nfi\n\n# remove existing library zip files\nrm -f \"${PROJECT_DIR}/$LIBRARY_ARCHIVE\"\n\n# remove existing output file\nrm -rf ${PROJECT_DIR}/lib\nmkdir -p ${PROJECT_DIR}/lib\n\n# Build library for simulator\nxcodebuild clean -target $TARGET -project CocosLib.xcodeproj -configuration $current_style -sdk $LATEST_SDK_SIMULATOR\nxcodebuild -target $TARGET -project CocosLib.xcodeproj -configuration $current_style -sdk $LATEST_SDK_SIMULATOR build\n\n# Build library for device\nxcodebuild clean -target $TARGET -project CocosLib.xcodeproj -configuration $current_style -sdk $LATEST_SDK_DEVICE\nxcodebuild -target $TARGET -project CocosLib.xcodeproj -configuration $current_style -sdk $LATEST_SDK_DEVICE build\n\n# Glue together libraries\nlipo \"${local_build_root}/${current_style}-iphoneos/$LIBRARY_NAME\" -arch i386 \"${local_build_root}/${current_style}-iphonesimulator/$LIBRARY_NAME\" -create -output \"${PROJECT_DIR}/$LIBRARY_OUT_NAME\"\n\n# Create symlink\ncd lib\nln -s \"$LIBRARY_OUT_NAME_RELATIVE\" \"$LIBRARY_NAME\"\ncd ..\n\nif [ $? -eq 0 ]; then\nfind \"${PROJECT_DIR}/external/Chipmunk\" -name \"*.a\" -exec rm -f \"{}\" \\;\nzip -R -y \"${PROJECT_DIR}/$LIBRARY_ARCHIVE\" \"lib/*.a\"\nzip -r -y \"${PROJECT_DIR}/$LIBRARY_ARCHIVE\" \"resources\" \"include\" -x@zip_exclude.lst\n#zip \"${PROJECT_DIR}/$LIBRARY_ARCHIVE\" .packageid\nfi\n\nif [ $SCRIPT_OPTIONS = \"MOVE_FILE\" ]; then\nBUILT_ZIP=\"${PROJECT_DIR}/$LIBRARY_ARCHIVE\"\nNEW_ZIP=\"$DEST_DIR/$LIBRARY_ARCHIVE\"\n\nif [ $current_style = \"Debug\" ]; then\nOLD_FOLDER=\"$DEST_DIR/$TARGET-${current_style}\"\nelse\nOLD_FOLDER=\"$DEST_DIR/$TARGET\"\nfi\nrm -rf $OLD_FOLDER\nmv $BUILT_ZIP \"$DEST_DIR/\"\nunzip -o $NEW_ZIP -d $OLD_FOLDER/\nrm -f $NEW_ZIP\nfi\ndone\n\nrm -rf ${PROJECT_DIR}/include\nrm -rf ${PROJECT_DIR}/build\nrm -rf ${PROJECT_DIR}/lib\n\n# restore the modified submodule to its unmodified state\ncd ${PROJECT_DIR}/external/Chipmunk\ngit reset --hard\ncd ${PROJECT_DIR}\n"; }; /* End PBXShellScriptBuildPhase section */ @@ -2327,171 +2031,131 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - E69291E7161ECB7D00DB1EAA /* b2BroadPhase.cpp in Sources */, - E69291E8161ECB7D00DB1EAA /* b2CollideCircle.cpp in Sources */, - E69291E9161ECB7D00DB1EAA /* b2CollideEdge.cpp in Sources */, - E69291EA161ECB7D00DB1EAA /* b2CollidePolygon.cpp in Sources */, - E69291EB161ECB7E00DB1EAA /* b2Collision.cpp in Sources */, - E69291EC161ECB7E00DB1EAA /* b2Distance.cpp in Sources */, - E69291ED161ECB7E00DB1EAA /* b2DynamicTree.cpp in Sources */, - E69291EE161ECB7E00DB1EAA /* b2TimeOfImpact.cpp in Sources */, - E69291EF161ECB7E00DB1EAA /* b2ChainShape.cpp in Sources */, - E69291F0161ECB7E00DB1EAA /* b2CircleShape.cpp in Sources */, - E69291F1161ECB7E00DB1EAA /* b2EdgeShape.cpp in Sources */, - E69291F2161ECB7E00DB1EAA /* b2PolygonShape.cpp in Sources */, - E69291F3161ECB7E00DB1EAA /* b2BlockAllocator.cpp in Sources */, - E69291F4161ECB7E00DB1EAA /* b2Draw.cpp in Sources */, - E69291F5161ECB7E00DB1EAA /* b2Math.cpp in Sources */, - E69291F6161ECB7E00DB1EAA /* b2Settings.cpp in Sources */, - E69291F7161ECB7E00DB1EAA /* b2StackAllocator.cpp in Sources */, - E69291F8161ECB7E00DB1EAA /* b2Timer.cpp in Sources */, - E69291F9161ECB7E00DB1EAA /* b2Body.cpp in Sources */, - E69291FA161ECB7E00DB1EAA /* b2ContactManager.cpp in Sources */, - E69291FB161ECB7E00DB1EAA /* b2Fixture.cpp in Sources */, - E69291FC161ECB7E00DB1EAA /* b2Island.cpp in Sources */, - E69291FD161ECB7E00DB1EAA /* b2World.cpp in Sources */, - E69291FE161ECB7E00DB1EAA /* b2WorldCallbacks.cpp in Sources */, - E69291FF161ECB7E00DB1EAA /* b2ChainAndCircleContact.cpp in Sources */, - E6929200161ECB7E00DB1EAA /* b2ChainAndPolygonContact.cpp in Sources */, - E6929201161ECB7E00DB1EAA /* b2CircleContact.cpp in Sources */, - E6929202161ECB7E00DB1EAA /* b2Contact.cpp in Sources */, - E6929203161ECB7E00DB1EAA /* b2ContactSolver.cpp in Sources */, - E6929204161ECB7E00DB1EAA /* b2EdgeAndCircleContact.cpp in Sources */, - E6929205161ECB7E00DB1EAA /* b2EdgeAndPolygonContact.cpp in Sources */, - E6929206161ECB7E00DB1EAA /* b2PolygonAndCircleContact.cpp in Sources */, - E6929207161ECB7E00DB1EAA /* b2PolygonContact.cpp in Sources */, - E6929208161ECB7E00DB1EAA /* b2DistanceJoint.cpp in Sources */, - E6929209161ECB7E00DB1EAA /* b2FrictionJoint.cpp in Sources */, - E692920A161ECB7E00DB1EAA /* b2GearJoint.cpp in Sources */, - E692920B161ECB7E00DB1EAA /* b2Joint.cpp in Sources */, - E692920C161ECB7E00DB1EAA /* b2MotorJoint.cpp in Sources */, - E692920D161ECB7E00DB1EAA /* b2MouseJoint.cpp in Sources */, - E692920E161ECB7E00DB1EAA /* b2PrismaticJoint.cpp in Sources */, - E692920F161ECB7E00DB1EAA /* b2PulleyJoint.cpp in Sources */, - E6929210161ECB7E00DB1EAA /* b2RevoluteJoint.cpp in Sources */, - E6929211161ECB7E00DB1EAA /* b2RopeJoint.cpp in Sources */, - E6929212161ECB7E00DB1EAA /* b2WeldJoint.cpp in Sources */, - E6929213161ECB7E00DB1EAA /* b2WheelJoint.cpp in Sources */, - E6929214161ECB7E00DB1EAA /* b2Rope.cpp in Sources */, - E6929215161ECB7E00DB1EAA /* CCRenderTargetNode.m in Sources */, - E6929216161ECB7E00DB1EAA /* CCAction.m in Sources */, - E6929217161ECB7E00DB1EAA /* CCActionCamera.m in Sources */, - E6929218161ECB7E00DB1EAA /* CCActionCatmullRom.m in Sources */, - E6929219161ECB7E00DB1EAA /* CCActionEase.m in Sources */, - E692921A161ECB7E00DB1EAA /* CCActionGrid.m in Sources */, - E692921B161ECB7E00DB1EAA /* CCActionGrid3D.m in Sources */, - E692921C161ECB7E00DB1EAA /* CCActionInstant.m in Sources */, - E692921D161ECB7E00DB1EAA /* CCActionInterval.m in Sources */, - E692921E161ECB7E00DB1EAA /* CCActionManager.m in Sources */, - E692921F161ECB7E00DB1EAA /* CCActionPageTurn3D.m in Sources */, - E6929220161ECB7E00DB1EAA /* CCActionProgressTimer.m in Sources */, - E6929221161ECB7E00DB1EAA /* CCActionTiledGrid.m in Sources */, - E6929222161ECB7E00DB1EAA /* CCActionTween.m in Sources */, - E6929223161ECB7E00DB1EAA /* CCAnimation.m in Sources */, - E6929224161ECB7E00DB1EAA /* CCAnimationCache.m in Sources */, - E6929225161ECB7E00DB1EAA /* CCAtlasNode.m in Sources */, - E6929226161ECB7E00DB1EAA /* CCCamera.m in Sources */, - E6929227161ECB7E00DB1EAA /* CCConfiguration.m in Sources */, - E6929228161ECB7E00DB1EAA /* ccDeprecated.m in Sources */, - E6929229161ECB7E00DB1EAA /* CCDirector.m in Sources */, - E692922A161ECB7E00DB1EAA /* CCDrawingPrimitives.m in Sources */, - E692922B161ECB7E00DB1EAA /* CCGLProgram.m in Sources */, - E692922C161ECB7E00DB1EAA /* ccGLStateCache.m in Sources */, - E692922D161ECB7E00DB1EAA /* CCGrabber.m in Sources */, - E692922E161ECB7E00DB1EAA /* CCGrid.m in Sources */, - E692922F161ECB7E00DB1EAA /* CCLabelAtlas.m in Sources */, - E6929230161ECB7E00DB1EAA /* CCLabelBMFont.m in Sources */, - E6929231161ECB7E00DB1EAA /* CCLabelTTF.m in Sources */, - E6929232161ECB7E00DB1EAA /* CCLayer.m in Sources */, - E6929233161ECB7E00DB1EAA /* CCMenu.m in Sources */, - E6929234161ECB7E00DB1EAA /* CCMenuItem.m in Sources */, - E6929235161ECB7E00DB1EAA /* CCMotionStreak.m in Sources */, - E6929236161ECB7E00DB1EAA /* CCNode+Debug.m in Sources */, - E6929237161ECB7E00DB1EAA /* CCNode.m in Sources */, - E6929238161ECB7E00DB1EAA /* CCParallaxNode.m in Sources */, - E6929239161ECB7E00DB1EAA /* CCParticleBatchNode.m in Sources */, - E692923A161ECB7E00DB1EAA /* CCParticleSystem.m in Sources */, - E692923B161ECB7E00DB1EAA /* CCParticleSystemQuad.m in Sources */, - E692923C161ECB7E00DB1EAA /* CCProgressTimer.m in Sources */, - E692923D161ECB7E00DB1EAA /* CCRenderTexture.m in Sources */, - E692923E161ECB7E00DB1EAA /* CCScene.m in Sources */, - E692923F161ECB7E00DB1EAA /* CCScheduler.m in Sources */, - E6929240161ECB7E00DB1EAA /* CCShaderCache.m in Sources */, - E6929241161ECB7E00DB1EAA /* ccShaders.m in Sources */, - E6929242161ECB7E00DB1EAA /* CCSprite.m in Sources */, - E6929243161ECB7E00DB1EAA /* CCSpriteBatchNode.m in Sources */, - E6929244161ECB7E00DB1EAA /* CCSpriteFrame.m in Sources */, - E6929245161ECB7E00DB1EAA /* CCSpriteFrameCache.m in Sources */, - E6929246161ECB7E00DB1EAA /* CCTexture2D.m in Sources */, - E6929247161ECB7E00DB1EAA /* CCTextureAtlas.m in Sources */, - E6929248161ECB7E00DB1EAA /* CCTextureCache.m in Sources */, - E6929249161ECB7E00DB1EAA /* CCTexturePVR.m in Sources */, - E692924A161ECB7E00DB1EAA /* CCTileMapAtlas.m in Sources */, - E692924B161ECB7E00DB1EAA /* CCTMXLayer.m in Sources */, - E692924C161ECB7E00DB1EAA /* CCTMXObjectGroup.m in Sources */, - E692924D161ECB7E00DB1EAA /* CCTMXTiledMap.m in Sources */, - E692924E161ECB7E00DB1EAA /* CCTMXXMLParser.m in Sources */, - E692924F161ECB7E00DB1EAA /* CCTransition.m in Sources */, - E6929250161ECB7E00DB1EAA /* CCTransitionPageTurn.m in Sources */, - E6929251161ECB7E00DB1EAA /* CCTransitionProgress.m in Sources */, - E6929252161ECB7E00DB1EAA /* cocos2d.m in Sources */, - E6929253161ECB7E00DB1EAA /* CCDirectorIOS.m in Sources */, - E6929254161ECB7E00DB1EAA /* CCES2Renderer.m in Sources */, - E6929255161ECB7E00DB1EAA /* CCGLView.m in Sources */, - E6929256161ECB7E00DB1EAA /* CCTouchDispatcher.m in Sources */, - E6929257161ECB7E00DB1EAA /* CCTouchHandler.m in Sources */, - E6929258161ECB7E00DB1EAA /* CCDirectorMac.m in Sources */, - E6929259161ECB7E00DB1EAA /* CCEventDispatcher.m in Sources */, - E692925A161ECB7E00DB1EAA /* CCGLView.m in Sources */, - E692925B161ECB7E00DB1EAA /* CCWindow.m in Sources */, - E692925C161ECB7E00DB1EAA /* base64.c in Sources */, - E692925D161ECB7E00DB1EAA /* CCArray.m in Sources */, - E692925E161ECB7E00DB1EAA /* ccCArray.m in Sources */, - E692925F161ECB7E00DB1EAA /* CCFileUtils.m in Sources */, - E6929260161ECB7E00DB1EAA /* CCProfiling.m in Sources */, - E6929261161ECB7E00DB1EAA /* ccUtils.c in Sources */, - E6929262161ECB7E00DB1EAA /* CCVertex.m in Sources */, - E6929263161ECB7E00DB1EAA /* CGPointExtension.m in Sources */, - E6929264161ECB7E00DB1EAA /* NSThread+performBlock.m in Sources */, - E6929265161ECB7E00DB1EAA /* TGAlib.m in Sources */, - E6929266161ECB7E00DB1EAA /* TransformUtils.m in Sources */, - E6929267161ECB7E00DB1EAA /* ZipUtils.m in Sources */, - E6929268161ECB7E00DB1EAA /* CDAudioManager.m in Sources */, - E6929269161ECB7E00DB1EAA /* CDOpenALSupport.m in Sources */, - E692926A161ECB7E00DB1EAA /* CocosDenshion.m in Sources */, - E692926B161ECB7E00DB1EAA /* SimpleAudioEngine.m in Sources */, - E692926C161ECB7E00DB1EAA /* CDXMacOSXSupport.m in Sources */, - E692926D161ECB7E00DB1EAA /* CDXPropertyModifierAction.m in Sources */, - E692926E161ECB7E00DB1EAA /* aabb.c in Sources */, - E6929270161ECB7E00DB1EAA /* mat4stack.c in Sources */, - E6929271161ECB7E00DB1EAA /* matrix.c in Sources */, - E6929272161ECB7E00DB1EAA /* mat3.c in Sources */, - E6929273161ECB7E00DB1EAA /* mat4.c in Sources */, - E6929274161ECB7E00DB1EAA /* neon_matrix_impl.c in Sources */, - E6929275161ECB7E00DB1EAA /* plane.c in Sources */, - E6929276161ECB7E00DB1EAA /* quaternion.c in Sources */, - E6929277161ECB7E00DB1EAA /* ray2.c in Sources */, - E6929278161ECB7E00DB1EAA /* utility.c in Sources */, - E6929279161ECB7E00DB1EAA /* vec2.c in Sources */, - E692927A161ECB7E00DB1EAA /* vec3.c in Sources */, - E692927B161ECB7E00DB1EAA /* vec4.c in Sources */, - E692927C161ECB7E00DB1EAA /* png.c in Sources */, - E692927D161ECB7E00DB1EAA /* pngerror.c in Sources */, - E692927E161ECB7E00DB1EAA /* pnggccrd.c in Sources */, - E692927F161ECB7E00DB1EAA /* pngget.c in Sources */, - E6929280161ECB7E00DB1EAA /* pngmem.c in Sources */, - E6929282161ECB7E00DB1EAA /* pngpread.c in Sources */, - E6929283161ECB7E00DB1EAA /* pngread.c in Sources */, - E6929284161ECB7E00DB1EAA /* pngrio.c in Sources */, - E6929285161ECB7E00DB1EAA /* pngrtran.c in Sources */, - E6929286161ECB7E00DB1EAA /* pngrutil.c in Sources */, - E6929287161ECB7E00DB1EAA /* pngset.c in Sources */, - E6929288161ECB7E00DB1EAA /* pngtrans.c in Sources */, - E6929289161ECB7E00DB1EAA /* pngvcrd.c in Sources */, - E692928A161ECB7E00DB1EAA /* pngwio.c in Sources */, - E692928B161ECB7E00DB1EAA /* pngwrite.c in Sources */, - E692928C161ECB7E00DB1EAA /* pngwtran.c in Sources */, - E692928D161ECB7E00DB1EAA /* pngwutil.c in Sources */, + E6E9AEFB181456C100E3C1A2 /* CCTransition.m in Sources */, + E6E9AE61181456C100E3C1A2 /* CCParallaxNode.m in Sources */, + E6E9AFCD181456C200E3C1A2 /* png.c in Sources */, + E6E9ADF7181456C100E3C1A2 /* CCActionTiledGrid.m in Sources */, + E6E9AF2B181456C200E3C1A2 /* CCWindow.m in Sources */, + E6E9AEF7181456C100E3C1A2 /* CCTMXXMLParser.m in Sources */, + E6E9AE2F181456C100E3C1A2 /* ccGLStateCache.m in Sources */, + E6E9AF23181456C100E3C1A2 /* CCDirectorMac.m in Sources */, + E6E9AE1B181456C100E3C1A2 /* CCDirector.m in Sources */, + E6E9AFC9181456C200E3C1A2 /* vec4.c in Sources */, + E6E9AFDD181456C200E3C1A2 /* pngread.c in Sources */, + E6E9AE1F181456C100E3C1A2 /* CCDrawingPrimitives.m in Sources */, + E6E9AFBD181456C200E3C1A2 /* plane.c in Sources */, + E6E9ADD7181456C100E3C1A2 /* CCActionEase.m in Sources */, + E6E9AF77181456C200E3C1A2 /* CCTableView.m in Sources */, + E6E9AF31181456C200E3C1A2 /* base64.c in Sources */, + E6E9AFB9181456C200E3C1A2 /* mat4.c in Sources */, + E6E9AE59181456C100E3C1A2 /* CCNode+Debug.m in Sources */, + E6E9AF65181456C200E3C1A2 /* CCButton.m in Sources */, + E6E9AFC1181456C200E3C1A2 /* ray2.c in Sources */, + E6E9AFC3181456C200E3C1A2 /* utility.c in Sources */, + E6E9AE89181456C100E3C1A2 /* CCRenderTexture.m in Sources */, + E6E9AF59181456C200E3C1A2 /* TransformUtils.m in Sources */, + E6E9AE23181456C100E3C1A2 /* CCDrawNode.m in Sources */, + E6E9AF37181456C200E3C1A2 /* CCFileUtils.m in Sources */, + E6E9AE07181456C100E3C1A2 /* CCAtlasNode.m in Sources */, + E6E9AE8D181456C100E3C1A2 /* CCResponder.m in Sources */, + E6E9AEE7181456C100E3C1A2 /* CCTileMapAtlas.m in Sources */, + E6E9AFBF181456C200E3C1A2 /* quaternion.c in Sources */, + E6E9AEDB181456C100E3C1A2 /* CCTextureAtlas.m in Sources */, + E6E9ADDF181456C100E3C1A2 /* CCActionGrid3D.m in Sources */, + E6E9ADF3181456C100E3C1A2 /* CCActionProgressTimer.m in Sources */, + E6E9AECB181456C100E3C1A2 /* CCSpriteBatchNode.m in Sources */, + E6E9AFBB181456C200E3C1A2 /* neon_matrix_impl.c in Sources */, + E6E9AFB5181456C200E3C1A2 /* matrix.c in Sources */, + E6E9ADFF181456C100E3C1A2 /* CCAnimation.m in Sources */, + E6E9AE83181456C100E3C1A2 /* CCProgressTimer.m in Sources */, + E6E9AF3B181456C200E3C1A2 /* CCProfiling.m in Sources */, + E6E9AFD7181456C200E3C1A2 /* pngget.c in Sources */, + E6E9AF47181456C200E3C1A2 /* CGPointExtension.m in Sources */, + E6E9AED7181456C100E3C1A2 /* CCTexture2D.m in Sources */, + E6E9AEEF181456C100E3C1A2 /* CCTMXObjectGroup.m in Sources */, + E6E9AF3D181456C200E3C1A2 /* ccUtils.c in Sources */, + E6E9AF69181456C200E3C1A2 /* CCControl.m in Sources */, + E6E9AFED181456C200E3C1A2 /* pngwio.c in Sources */, + E6E9AFE7181456C200E3C1A2 /* pngtest.c in Sources */, + E6E9AF1F181456C100E3C1A2 /* UITouch+CC.m in Sources */, + E6E9AF0D181456C100E3C1A2 /* CCES2Renderer.m in Sources */, + E6E9AE17181456C100E3C1A2 /* ccDeprecated.m in Sources */, + E6E9AF61181456C200E3C1A2 /* ZipUtils.m in Sources */, + E6E9AFD3181456C200E3C1A2 /* pngerror.c in Sources */, + E6E9AE91181456C100E3C1A2 /* CCResponderManager.m in Sources */, + E6E9AF13181456C100E3C1A2 /* CCGLView.m in Sources */, + E6E9AEBB181456C100E3C1A2 /* CCShaderCache.m in Sources */, + E6E9AEC3181456C100E3C1A2 /* CCSprite.m in Sources */, + E6E9ADCF181456C100E3C1A2 /* CCAction.m in Sources */, + E6E9AFB1181456C200E3C1A2 /* aabb.c in Sources */, + E6E9AFB7181456C200E3C1A2 /* mat3.c in Sources */, + E6E9AE27181456C100E3C1A2 /* ccFPSImages.m in Sources */, + E6E9AFC5181456C200E3C1A2 /* vec2.c in Sources */, + E6E9AEE3181456C100E3C1A2 /* CCTexturePVR.m in Sources */, + E6E9AE5D181456C100E3C1A2 /* CCNode.m in Sources */, + E6E9AE4D181456C100E3C1A2 /* CCMenu.m in Sources */, + E6E9ADEB181456C100E3C1A2 /* CCActionManager.m in Sources */, + E6E9AE13181456C100E3C1A2 /* CCConfiguration.m in Sources */, + E6E9AF01181456C100E3C1A2 /* cocos2d.m in Sources */, + E6E9AE71181456C100E3C1A2 /* CCParticleSystemQuad.m in Sources */, + E6E9AF6F181456C200E3C1A2 /* CCControlTextureFactory.m in Sources */, + E6E9AE95181456C100E3C1A2 /* CCScene.m in Sources */, + E6E9AF27181456C100E3C1A2 /* CCGLView.m in Sources */, + E6E9AE47181456C100E3C1A2 /* CCLayer.m in Sources */, + E6E9AE51181456C100E3C1A2 /* CCMenuItem.m in Sources */, + E6E9AEC7181456C100E3C1A2 /* CCSprite9Slice.m in Sources */, + E6E9ADE7181456C100E3C1A2 /* CCActionInterval.m in Sources */, + E6E9AE77181456C100E3C1A2 /* CCPhysicsBody.m in Sources */, + E6E9AFD5181456C200E3C1A2 /* pnggccrd.c in Sources */, + E6E9ADD3181456C100E3C1A2 /* CCActionCatmullRom.m in Sources */, + E6E9AFEF181456C200E3C1A2 /* pngwrite.c in Sources */, + E6E9ADDB181456C100E3C1A2 /* CCActionGrid.m in Sources */, + E6E9AED3181456C100E3C1A2 /* CCSpriteFrameCache.m in Sources */, + E6E9AE55181456C100E3C1A2 /* CCMotionStreak.m in Sources */, + E6E9ADFB181456C100E3C1A2 /* CCActionTween.m in Sources */, + E6E9AE7B181456C100E3C1A2 /* CCPhysicsJoint.m in Sources */, + E6E9AF55181456C200E3C1A2 /* TGAlib.m in Sources */, + E6E9AE43181456C100E3C1A2 /* CCLabelTTF.m in Sources */, + E6E9AE2B181456C100E3C1A2 /* CCGLProgram.m in Sources */, + E6E9AFC7181456C200E3C1A2 /* vec3.c in Sources */, + E6E9AFD9181456C200E3C1A2 /* pngmem.c in Sources */, + E6E9AE69181456C100E3C1A2 /* CCParticleExamples.m in Sources */, + E6E9AECF181456C100E3C1A2 /* CCSpriteFrame.m in Sources */, + E6E9AEEB181456C100E3C1A2 /* CCTMXLayer.m in Sources */, + E6E9AFF3181456C200E3C1A2 /* pngwutil.c in Sources */, + E6E9AF73181456C200E3C1A2 /* CCScrollView.m in Sources */, + E6E9AE33181456C100E3C1A2 /* CCGrabber.m in Sources */, + E6E9AFDF181456C200E3C1A2 /* pngrio.c in Sources */, + E6E9AEDF181456C100E3C1A2 /* CCTextureCache.m in Sources */, + E6E9AE37181456C100E3C1A2 /* CCGrid.m in Sources */, + E6E9AFE3181456C200E3C1A2 /* pngrutil.c in Sources */, + E6E9AFE1181456C200E3C1A2 /* pngrtran.c in Sources */, + E6E9AF4B181456C200E3C1A2 /* NSAttributedString+CCAdditions.m in Sources */, + E6E9AFE5181456C200E3C1A2 /* pngset.c in Sources */, + E6E9AE3F181456C100E3C1A2 /* CCLabelBMFont.m in Sources */, + E6E9AF1B181456C100E3C1A2 /* CCResponderManager.m in Sources */, + E6E9AFF1181456C200E3C1A2 /* pngwtran.c in Sources */, + E6E9AEBF181456C100E3C1A2 /* ccShaders.m in Sources */, + E6E9AFDB181456C200E3C1A2 /* pngpread.c in Sources */, + E6E9AFE9181456C200E3C1A2 /* pngtrans.c in Sources */, + E6E9AE3B181456C100E3C1A2 /* CCLabelAtlas.m in Sources */, + E6E9AF43181456C200E3C1A2 /* CCVertex.m in Sources */, + E6E9ADEF181456C100E3C1A2 /* CCActionPageTurn3D.m in Sources */, + E6E9AE6D181456C100E3C1A2 /* CCParticleSystem.m in Sources */, + E6E9AEF3181456C100E3C1A2 /* CCTMXTiledMap.m in Sources */, + E6E9AE99181456C100E3C1A2 /* CCScheduler.m in Sources */, + E6E9AF17181456C100E3C1A2 /* CCResponder.m in Sources */, + E6E9AFB3181456C200E3C1A2 /* mat4stack.c in Sources */, + E6E9AE0D181456C100E3C1A2 /* CCClippingNode.m in Sources */, + E6E9ADE3181456C100E3C1A2 /* CCActionInstant.m in Sources */, + E6E9AE7F181456C100E3C1A2 /* CCPhysicsNode.m in Sources */, + E6E9AE65181456C100E3C1A2 /* CCParticleBatchNode.m in Sources */, + E6E9AFCB181456C200E3C1A2 /* example.c in Sources */, + E6E9AF4F181456C200E3C1A2 /* NSThread+performBlock.m in Sources */, + E6E9AF2F181456C200E3C1A2 /* NSEvent+CC.m in Sources */, + E6E9AE03181456C100E3C1A2 /* CCAnimationCache.m in Sources */, + E6E9AFEB181456C200E3C1A2 /* pngvcrd.c in Sources */, + E6E9AF09181456C100E3C1A2 /* CCDirectorIOS.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -2499,181 +2163,180 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - E61037FD15DD169B00819640 /* b2BroadPhase.cpp in Sources */, - E61037FE15DD169B00819640 /* b2CollideCircle.cpp in Sources */, - E61037FF15DD169B00819640 /* b2CollideEdge.cpp in Sources */, - E610380015DD169B00819640 /* b2CollidePolygon.cpp in Sources */, - E610380115DD169B00819640 /* b2Collision.cpp in Sources */, - E610380215DD169B00819640 /* b2Distance.cpp in Sources */, - E610380315DD169B00819640 /* b2DynamicTree.cpp in Sources */, - E610380415DD169B00819640 /* b2TimeOfImpact.cpp in Sources */, - E610380515DD169B00819640 /* b2ChainShape.cpp in Sources */, - E610380615DD169B00819640 /* b2CircleShape.cpp in Sources */, - E610380715DD169B00819640 /* b2EdgeShape.cpp in Sources */, - E610380815DD169B00819640 /* b2PolygonShape.cpp in Sources */, - E610380915DD169B00819640 /* b2BlockAllocator.cpp in Sources */, - E610380A15DD169B00819640 /* b2Draw.cpp in Sources */, - E610380B15DD169B00819640 /* b2Math.cpp in Sources */, - E610380C15DD169B00819640 /* b2Settings.cpp in Sources */, - E610380D15DD169B00819640 /* b2StackAllocator.cpp in Sources */, - E610380E15DD169B00819640 /* b2Timer.cpp in Sources */, - E610380F15DD169B00819640 /* b2Body.cpp in Sources */, - E610381015DD169B00819640 /* b2ContactManager.cpp in Sources */, - E610381115DD169B00819640 /* b2Fixture.cpp in Sources */, - E610381215DD169B00819640 /* b2Island.cpp in Sources */, - E610381315DD169B00819640 /* b2World.cpp in Sources */, - E610381415DD169B00819640 /* b2WorldCallbacks.cpp in Sources */, - E610381515DD169B00819640 /* b2ChainAndCircleContact.cpp in Sources */, - E610381615DD169B00819640 /* b2ChainAndPolygonContact.cpp in Sources */, - E610381715DD169B00819640 /* b2CircleContact.cpp in Sources */, - E610381815DD169B00819640 /* b2Contact.cpp in Sources */, - E610381915DD169B00819640 /* b2ContactSolver.cpp in Sources */, - E610381A15DD169B00819640 /* b2EdgeAndCircleContact.cpp in Sources */, - E610381B15DD169B00819640 /* b2EdgeAndPolygonContact.cpp in Sources */, - E610381C15DD169B00819640 /* b2PolygonAndCircleContact.cpp in Sources */, - E610381D15DD169B00819640 /* b2PolygonContact.cpp in Sources */, - E610381E15DD169B00819640 /* b2DistanceJoint.cpp in Sources */, - E610381F15DD169B00819640 /* b2FrictionJoint.cpp in Sources */, - E610382015DD169B00819640 /* b2GearJoint.cpp in Sources */, - E610382115DD169B00819640 /* b2Joint.cpp in Sources */, - E610382215DD169B00819640 /* b2MotorJoint.cpp in Sources */, - E610382315DD169B00819640 /* b2MouseJoint.cpp in Sources */, - E610382415DD169B00819640 /* b2PrismaticJoint.cpp in Sources */, - E610382515DD169B00819640 /* b2PulleyJoint.cpp in Sources */, - E610382615DD169B00819640 /* b2RevoluteJoint.cpp in Sources */, - E610382715DD169B00819640 /* b2RopeJoint.cpp in Sources */, - E610382815DD169B00819640 /* b2WeldJoint.cpp in Sources */, - E610382915DD169B00819640 /* b2WheelJoint.cpp in Sources */, - E610382A15DD169B00819640 /* b2Rope.cpp in Sources */, - E610382B15DD169B00819640 /* CCAction.m in Sources */, - E610382C15DD169B00819640 /* CCActionCamera.m in Sources */, - E610382D15DD169B00819640 /* CCActionCatmullRom.m in Sources */, - E610382E15DD169B00819640 /* CCActionEase.m in Sources */, - E610382F15DD169B00819640 /* CCActionGrid.m in Sources */, - E610383015DD169B00819640 /* CCActionGrid3D.m in Sources */, - E610383115DD169B00819640 /* CCActionInstant.m in Sources */, - E610383215DD169B00819640 /* CCActionInterval.m in Sources */, - E610383315DD169B00819640 /* CCActionManager.m in Sources */, - E610383415DD169B00819640 /* CCActionPageTurn3D.m in Sources */, - E610383515DD169B00819640 /* CCActionProgressTimer.m in Sources */, - E610383615DD169B00819640 /* CCActionTiledGrid.m in Sources */, - E610383715DD169B00819640 /* CCActionTween.m in Sources */, - E610383815DD169B00819640 /* CCAnimation.m in Sources */, - E610383915DD169B00819640 /* CCAnimationCache.m in Sources */, - E610383A15DD169B00819640 /* CCAtlasNode.m in Sources */, - E610383B15DD169B00819640 /* CCCamera.m in Sources */, - E610383C15DD169B00819640 /* CCConfiguration.m in Sources */, - E610383D15DD169B00819640 /* ccDeprecated.m in Sources */, - E610383E15DD169B00819640 /* CCDirector.m in Sources */, - E610383F15DD169B00819640 /* CCDrawingPrimitives.m in Sources */, - E610384015DD169B00819640 /* CCGLProgram.m in Sources */, - E610384115DD169B00819640 /* ccGLStateCache.m in Sources */, - E610384215DD169B00819640 /* CCGrabber.m in Sources */, - E610384315DD169B00819640 /* CCGrid.m in Sources */, - E610384415DD169B00819640 /* CCLabelAtlas.m in Sources */, - E610384515DD169B00819640 /* CCLabelBMFont.m in Sources */, - E610384615DD169B00819640 /* CCLabelTTF.m in Sources */, - E610384715DD169B00819640 /* CCLayer.m in Sources */, - E610384815DD169B00819640 /* CCMenu.m in Sources */, - E610384915DD169B00819640 /* CCMenuItem.m in Sources */, - E610384A15DD169B00819640 /* CCMotionStreak.m in Sources */, - E610384B15DD169B00819640 /* CCNode+Debug.m in Sources */, - E610384C15DD169B00819640 /* CCNode.m in Sources */, - E610384D15DD169B00819640 /* CCParallaxNode.m in Sources */, - E610384E15DD169B00819640 /* CCParticleBatchNode.m in Sources */, - E610384F15DD169B00819640 /* CCParticleSystem.m in Sources */, - E610385015DD169B00819640 /* CCParticleSystemQuad.m in Sources */, - E610385115DD169B00819640 /* CCProgressTimer.m in Sources */, - E610385215DD169B00819640 /* CCRenderTexture.m in Sources */, - E610385315DD169B00819640 /* CCScene.m in Sources */, - E610385415DD169B00819640 /* CCScheduler.m in Sources */, - E610385515DD169B00819640 /* CCShaderCache.m in Sources */, - E610385615DD169B00819640 /* ccShaders.m in Sources */, - E610385715DD169B00819640 /* CCSprite.m in Sources */, - E610385815DD169B00819640 /* CCSpriteBatchNode.m in Sources */, - E610385915DD169B00819640 /* CCSpriteFrame.m in Sources */, - E610385A15DD169B00819640 /* CCSpriteFrameCache.m in Sources */, - E610385B15DD169B00819640 /* CCTexture2D.m in Sources */, - E610385C15DD169B00819640 /* CCTextureAtlas.m in Sources */, - E610385D15DD169B00819640 /* CCTextureCache.m in Sources */, - E610385E15DD169B00819640 /* CCTexturePVR.m in Sources */, - E610385F15DD169B00819640 /* CCTileMapAtlas.m in Sources */, - E610386015DD169B00819640 /* CCTMXLayer.m in Sources */, - E610386115DD169B00819640 /* CCTMXObjectGroup.m in Sources */, - E610386215DD169B00819640 /* CCTMXTiledMap.m in Sources */, - E610386315DD169B00819640 /* CCTMXXMLParser.m in Sources */, - E610386415DD169B00819640 /* CCTransition.m in Sources */, - E610386515DD169B00819640 /* CCTransitionPageTurn.m in Sources */, - E610386615DD169B00819640 /* CCTransitionProgress.m in Sources */, - E610386715DD169B00819640 /* cocos2d.m in Sources */, - E610386815DD169B00819640 /* CCDirectorIOS.m in Sources */, - E610386915DD169B00819640 /* CCES2Renderer.m in Sources */, - E610386A15DD169B00819640 /* CCGLView.m in Sources */, - E610386B15DD169B00819640 /* CCTouchDispatcher.m in Sources */, - E610386C15DD169B00819640 /* CCTouchHandler.m in Sources */, - E610386D15DD169B00819640 /* CCDirectorMac.m in Sources */, - E610386E15DD169B00819640 /* CCEventDispatcher.m in Sources */, - E610386F15DD169B00819640 /* CCGLView.m in Sources */, - E610387015DD169B00819640 /* CCWindow.m in Sources */, - E610387115DD169B00819640 /* base64.c in Sources */, - E610387215DD169B00819640 /* CCArray.m in Sources */, - E610387315DD169B00819640 /* ccCArray.m in Sources */, - E610387415DD169B00819640 /* CCFileUtils.m in Sources */, - E610387515DD169B00819640 /* CCProfiling.m in Sources */, - E610387615DD169B00819640 /* ccUtils.c in Sources */, - E610387715DD169B00819640 /* CCVertex.m in Sources */, - E610387815DD169B00819640 /* CGPointExtension.m in Sources */, - E610387915DD169B00819640 /* NSThread+performBlock.m in Sources */, - E610387A15DD169B00819640 /* TGAlib.m in Sources */, - E610387B15DD169B00819640 /* TransformUtils.m in Sources */, - E610387C15DD169B00819640 /* ZipUtils.m in Sources */, - E610387D15DD169B00819640 /* CDAudioManager.m in Sources */, - E610387E15DD169B00819640 /* CDOpenALSupport.m in Sources */, - E610387F15DD169B00819640 /* CocosDenshion.m in Sources */, - E610388015DD169B00819640 /* SimpleAudioEngine.m in Sources */, - E610388115DD169B00819640 /* CDXMacOSXSupport.m in Sources */, - E610388215DD169B00819640 /* CDXPropertyModifierAction.m in Sources */, - E610388315DD169B00819640 /* aabb.c in Sources */, - E610388415DD169B00819640 /* mat4stack.c in Sources */, - E610388515DD169B00819640 /* matrix.c in Sources */, - E610388615DD169B00819640 /* mat3.c in Sources */, - E610388715DD169B00819640 /* mat4.c in Sources */, - E610388815DD169B00819640 /* neon_matrix_impl.c in Sources */, - E610388915DD169B00819640 /* plane.c in Sources */, - E610388A15DD169B00819640 /* quaternion.c in Sources */, - E610388B15DD169B00819640 /* ray2.c in Sources */, - E610388C15DD169B00819640 /* utility.c in Sources */, - E610388D15DD169B00819640 /* vec2.c in Sources */, - E610388E15DD169B00819640 /* vec3.c in Sources */, - E610388F15DD169B00819640 /* vec4.c in Sources */, - E610389015DD169B00819640 /* png.c in Sources */, - E610389115DD169B00819640 /* pngerror.c in Sources */, - E610389215DD169B00819640 /* pnggccrd.c in Sources */, - E610389315DD169B00819640 /* pngget.c in Sources */, - E610389415DD169B00819640 /* pngmem.c in Sources */, - E610389515DD169B00819640 /* pngpread.c in Sources */, - E610389615DD169B00819640 /* pngread.c in Sources */, - E610389715DD169B00819640 /* pngrio.c in Sources */, - E610389815DD169B00819640 /* pngrtran.c in Sources */, - E610389915DD169B00819640 /* pngrutil.c in Sources */, - E610389A15DD169B00819640 /* pngset.c in Sources */, - E610389B15DD169B00819640 /* pngtrans.c in Sources */, - E610389C15DD169B00819640 /* pngvcrd.c in Sources */, - E610389D15DD169B00819640 /* pngwio.c in Sources */, - E610389E15DD169B00819640 /* pngwrite.c in Sources */, - E610389F15DD169B00819640 /* pngwtran.c in Sources */, - E61038A015DD169B00819640 /* pngwutil.c in Sources */, - E61D8BF715E2772C00F768B0 /* CCRenderTargetNode.m in Sources */, + E6E9AEFA181456C100E3C1A2 /* CCTransition.m in Sources */, + E6E9AE60181456C100E3C1A2 /* CCParallaxNode.m in Sources */, + E6E9AFCC181456C200E3C1A2 /* png.c in Sources */, + E6E9ADF6181456C100E3C1A2 /* CCActionTiledGrid.m in Sources */, + E6E9AF2A181456C200E3C1A2 /* CCWindow.m in Sources */, + E6E9AEF6181456C100E3C1A2 /* CCTMXXMLParser.m in Sources */, + E6E9AE2E181456C100E3C1A2 /* ccGLStateCache.m in Sources */, + E6E9AF22181456C100E3C1A2 /* CCDirectorMac.m in Sources */, + E6E9AE1A181456C100E3C1A2 /* CCDirector.m in Sources */, + E6E9AFC8181456C200E3C1A2 /* vec4.c in Sources */, + E6E9AFDC181456C200E3C1A2 /* pngread.c in Sources */, + E6E9AE1E181456C100E3C1A2 /* CCDrawingPrimitives.m in Sources */, + E6E9AFBC181456C200E3C1A2 /* plane.c in Sources */, + E6E9ADD6181456C100E3C1A2 /* CCActionEase.m in Sources */, + E6E9AF76181456C200E3C1A2 /* CCTableView.m in Sources */, + E6E9AF30181456C200E3C1A2 /* base64.c in Sources */, + E6E9AFB8181456C200E3C1A2 /* mat4.c in Sources */, + E6E9AE58181456C100E3C1A2 /* CCNode+Debug.m in Sources */, + E6E9AF64181456C200E3C1A2 /* CCButton.m in Sources */, + E6E9AFC0181456C200E3C1A2 /* ray2.c in Sources */, + E6E9AFC2181456C200E3C1A2 /* utility.c in Sources */, + E6E9AE88181456C100E3C1A2 /* CCRenderTexture.m in Sources */, + E6E9AF58181456C200E3C1A2 /* TransformUtils.m in Sources */, + E6E9AE22181456C100E3C1A2 /* CCDrawNode.m in Sources */, + E6E9AF36181456C200E3C1A2 /* CCFileUtils.m in Sources */, + E6E9AE06181456C100E3C1A2 /* CCAtlasNode.m in Sources */, + E6E9AE8C181456C100E3C1A2 /* CCResponder.m in Sources */, + E6E9AEE6181456C100E3C1A2 /* CCTileMapAtlas.m in Sources */, + E6E9AFBE181456C200E3C1A2 /* quaternion.c in Sources */, + E6E9AEDA181456C100E3C1A2 /* CCTextureAtlas.m in Sources */, + E6E9ADDE181456C100E3C1A2 /* CCActionGrid3D.m in Sources */, + E6E9ADF2181456C100E3C1A2 /* CCActionProgressTimer.m in Sources */, + E6E9AECA181456C100E3C1A2 /* CCSpriteBatchNode.m in Sources */, + E6E9AFBA181456C200E3C1A2 /* neon_matrix_impl.c in Sources */, + E6E9AFB4181456C200E3C1A2 /* matrix.c in Sources */, + E6E9ADFE181456C100E3C1A2 /* CCAnimation.m in Sources */, + E6E9AE82181456C100E3C1A2 /* CCProgressTimer.m in Sources */, + E6E9AF3A181456C200E3C1A2 /* CCProfiling.m in Sources */, + E6E9AFD6181456C200E3C1A2 /* pngget.c in Sources */, + E6E9AF46181456C200E3C1A2 /* CGPointExtension.m in Sources */, + E6E9AED6181456C100E3C1A2 /* CCTexture2D.m in Sources */, + E6E9AEEE181456C100E3C1A2 /* CCTMXObjectGroup.m in Sources */, + E6E9AF3C181456C200E3C1A2 /* ccUtils.c in Sources */, + E6E9AF68181456C200E3C1A2 /* CCControl.m in Sources */, + E6E9AFEC181456C200E3C1A2 /* pngwio.c in Sources */, + E6E9AFE6181456C200E3C1A2 /* pngtest.c in Sources */, + E6E9AF1E181456C100E3C1A2 /* UITouch+CC.m in Sources */, + E6E9AF0C181456C100E3C1A2 /* CCES2Renderer.m in Sources */, + E6E9AE16181456C100E3C1A2 /* ccDeprecated.m in Sources */, + E6E9AF60181456C200E3C1A2 /* ZipUtils.m in Sources */, + E6E9AFD2181456C200E3C1A2 /* pngerror.c in Sources */, + E6E9AE90181456C100E3C1A2 /* CCResponderManager.m in Sources */, + E6E9AF12181456C100E3C1A2 /* CCGLView.m in Sources */, + E6E9AEBA181456C100E3C1A2 /* CCShaderCache.m in Sources */, + E6E9AEC2181456C100E3C1A2 /* CCSprite.m in Sources */, + E6E9ADCE181456C100E3C1A2 /* CCAction.m in Sources */, + E6E9AFB0181456C200E3C1A2 /* aabb.c in Sources */, + E6E9AFB6181456C200E3C1A2 /* mat3.c in Sources */, + E6E9AE26181456C100E3C1A2 /* ccFPSImages.m in Sources */, + E6E9AFC4181456C200E3C1A2 /* vec2.c in Sources */, + E6E9AEE2181456C100E3C1A2 /* CCTexturePVR.m in Sources */, + E6E9AE5C181456C100E3C1A2 /* CCNode.m in Sources */, + E6E9AE4C181456C100E3C1A2 /* CCMenu.m in Sources */, + E6E9ADEA181456C100E3C1A2 /* CCActionManager.m in Sources */, + E6E9AE12181456C100E3C1A2 /* CCConfiguration.m in Sources */, + E6E9AF00181456C100E3C1A2 /* cocos2d.m in Sources */, + E6E9AE70181456C100E3C1A2 /* CCParticleSystemQuad.m in Sources */, + E6E9AF6E181456C200E3C1A2 /* CCControlTextureFactory.m in Sources */, + E6E9AE94181456C100E3C1A2 /* CCScene.m in Sources */, + E6E9AF26181456C100E3C1A2 /* CCGLView.m in Sources */, + E6E9AE46181456C100E3C1A2 /* CCLayer.m in Sources */, + E6E9AE50181456C100E3C1A2 /* CCMenuItem.m in Sources */, + E6E9AEC6181456C100E3C1A2 /* CCSprite9Slice.m in Sources */, + E6E9ADE6181456C100E3C1A2 /* CCActionInterval.m in Sources */, + E6E9AE76181456C100E3C1A2 /* CCPhysicsBody.m in Sources */, + E6E9AFD4181456C200E3C1A2 /* pnggccrd.c in Sources */, + E6E9ADD2181456C100E3C1A2 /* CCActionCatmullRom.m in Sources */, + E6E9AFEE181456C200E3C1A2 /* pngwrite.c in Sources */, + E6E9ADDA181456C100E3C1A2 /* CCActionGrid.m in Sources */, + E6E9AED2181456C100E3C1A2 /* CCSpriteFrameCache.m in Sources */, + E6E9AE54181456C100E3C1A2 /* CCMotionStreak.m in Sources */, + E6E9ADFA181456C100E3C1A2 /* CCActionTween.m in Sources */, + E6E9AE7A181456C100E3C1A2 /* CCPhysicsJoint.m in Sources */, + E6E9AF54181456C200E3C1A2 /* TGAlib.m in Sources */, + E6E9AE42181456C100E3C1A2 /* CCLabelTTF.m in Sources */, + E6E9AE2A181456C100E3C1A2 /* CCGLProgram.m in Sources */, + E6E9AFC6181456C200E3C1A2 /* vec3.c in Sources */, + E6E9AFD8181456C200E3C1A2 /* pngmem.c in Sources */, + E6E9AE68181456C100E3C1A2 /* CCParticleExamples.m in Sources */, + E6E9AECE181456C100E3C1A2 /* CCSpriteFrame.m in Sources */, + E6E9AEEA181456C100E3C1A2 /* CCTMXLayer.m in Sources */, + E6E9AFF2181456C200E3C1A2 /* pngwutil.c in Sources */, + E6E9AF72181456C200E3C1A2 /* CCScrollView.m in Sources */, + E6E9AE32181456C100E3C1A2 /* CCGrabber.m in Sources */, + E6E9AFDE181456C200E3C1A2 /* pngrio.c in Sources */, + E6E9AEDE181456C100E3C1A2 /* CCTextureCache.m in Sources */, + E6E9AE36181456C100E3C1A2 /* CCGrid.m in Sources */, + E6E9AFE2181456C200E3C1A2 /* pngrutil.c in Sources */, + E6E9AFE0181456C200E3C1A2 /* pngrtran.c in Sources */, + E6E9AF4A181456C200E3C1A2 /* NSAttributedString+CCAdditions.m in Sources */, + E6E9AFE4181456C200E3C1A2 /* pngset.c in Sources */, + E6E9AE3E181456C100E3C1A2 /* CCLabelBMFont.m in Sources */, + E6E9AF1A181456C100E3C1A2 /* CCResponderManager.m in Sources */, + E6E9AFF0181456C200E3C1A2 /* pngwtran.c in Sources */, + E6E9AEBE181456C100E3C1A2 /* ccShaders.m in Sources */, + E6E9AFDA181456C200E3C1A2 /* pngpread.c in Sources */, + E6E9AFE8181456C200E3C1A2 /* pngtrans.c in Sources */, + E6E9AE3A181456C100E3C1A2 /* CCLabelAtlas.m in Sources */, + E6E9AF42181456C200E3C1A2 /* CCVertex.m in Sources */, + E6E9ADEE181456C100E3C1A2 /* CCActionPageTurn3D.m in Sources */, + E6E9AE6C181456C100E3C1A2 /* CCParticleSystem.m in Sources */, + E6E9AEF2181456C100E3C1A2 /* CCTMXTiledMap.m in Sources */, + E6E9AE98181456C100E3C1A2 /* CCScheduler.m in Sources */, + E6E9AF16181456C100E3C1A2 /* CCResponder.m in Sources */, + E6E9AFB2181456C200E3C1A2 /* mat4stack.c in Sources */, + E6E9AE0C181456C100E3C1A2 /* CCClippingNode.m in Sources */, + E6E9ADE2181456C100E3C1A2 /* CCActionInstant.m in Sources */, + E6E9AE7E181456C100E3C1A2 /* CCPhysicsNode.m in Sources */, + E6E9AE64181456C100E3C1A2 /* CCParticleBatchNode.m in Sources */, + E6E9AFCA181456C200E3C1A2 /* example.c in Sources */, + E6E9AF4E181456C200E3C1A2 /* NSThread+performBlock.m in Sources */, + E6E9AF2E181456C200E3C1A2 /* NSEvent+CC.m in Sources */, + E6E9AE02181456C100E3C1A2 /* CCAnimationCache.m in Sources */, + E6E9AFEA181456C200E3C1A2 /* pngvcrd.c in Sources */, + E6E9AF08181456C100E3C1A2 /* CCDirectorIOS.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + E6E9B025181459B300E3C1A2 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + E6E9B02A181459D600E3C1A2 /* CocosLib.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + E6E9B026181459BB00E3C1A2 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + E6E9B028181459C700E3C1A2 /* CocosLibMac.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + E6E9B02B18145B0000E3C1A2 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + E6E9B06518145B2900E3C1A2 /* CDXMacOSXSupport.m in Sources */, + E6E9B06718145B2900E3C1A2 /* CocosDenshion.m in Sources */, + E6E9B06618145B2900E3C1A2 /* CDXPropertyModifierAction.m in Sources */, + E6E9B06818145B2900E3C1A2 /* SimpleAudioEngine.m in Sources */, + E6E9B03718145B0000E3C1A2 /* CocosDenshion.m in Sources */, + E6E9B06318145B2900E3C1A2 /* CDAudioManager.m in Sources */, + E6E9B06418145B2900E3C1A2 /* CDOpenALSupport.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ +/* Begin PBXTargetDependency section */ + E6E9B00A1814570D00E3C1A2 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = ObjectiveChipmunk; + targetProxy = E6E9B0091814570D00E3C1A2 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + /* Begin XCBuildConfiguration section */ 1DEB922408733DC00010E9CD /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ARCHS = "$(ARCHS_UNIVERSAL_IPHONE_OS)"; + CLANG_ENABLE_OBJC_ARC = YES; GCC_C_LANGUAGE_STANDARD = c99; GCC_OPTIMIZATION_LEVEL = 3; GCC_VERSION = com.apple.compilers.llvm.clang.1_0; @@ -2682,46 +2345,26 @@ GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 3.2; OTHER_CFLAGS = ( - "-mthumb", - "-mfpu=neon", - "-ffast-math", - "-ftree-vectorize", - "-mfloat-abi=softfp", - "-fsingle-precision-constant", - "-DNS_BLOCK_ASSERTIONS=1", - "-DRELEASE_VERSION", - ); - "OTHER_CFLAGS[arch=*]" = "-DRELEASE_VERSION"; - "OTHER_CFLAGS[sdk=iphoneos*][arch=armv7]" = ( - "-mthumb", - "-mfpu=neon", - "-ffast-math", - "-ftree-vectorize", - "-mfloat-abi=softfp", - "-fsingle-precision-constant", - "-DNS_BLOCK_ASSERTIONS=1", - "-DRELEASE_VERSION", + "-Weverything", + "-Wno-objc-missing-property-synthesis", + "-Wno-pedantic", + "-Wno-documentation", + "-Wno-objc-interface-ivars", + "-Wno-direct-ivar-access", + "-Wno-vla", + "-Wno-implicit-atomic-properties", + "-Wno-padded", ); OTHER_CPLUSPLUSFLAGS = ( - "-mthumb", - "-mfpu=neon", - "-ffast-math", - "-ftree-vectorize", - "-mfloat-abi=softfp", - "-fsingle-precision-constant", - "-DNS_BLOCK_ASSERTIONS=1", - "-DRELEASE_VERSION", - ); - "OTHER_CPLUSPLUSFLAGS[arch=*]" = "-DRELEASE_VERSION"; - "OTHER_CPLUSPLUSFLAGS[sdk=iphoneos*][arch=armv7]" = ( - "-mthumb", - "-mfpu=neon", - "-ffast-math", - "-ftree-vectorize", - "-mfloat-abi=softfp", - "-fsingle-precision-constant", - "-DNS_BLOCK_ASSERTIONS=1", - "-DRELEASE_VERSION", + "-Weverything", + "-Wno-objc-missing-property-synthesis", + "-Wno-pedantic", + "-Wno-documentation", + "-Wno-objc-interface-ivars", + "-Wno-direct-ivar-access", + "-Wno-vla", + "-Wno-implicit-atomic-properties", + "-Wno-padded", ); OTHER_LDFLAGS = "-ObjC"; SDKROOT = iphoneos; @@ -2749,6 +2392,7 @@ GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", "COCOS2D_DEBUG=1", + "CC_ENABLE_GL_STATE_CACHE=1", ); GCC_SYMBOLS_PRIVATE_EXTERN = NO; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; @@ -2762,6 +2406,7 @@ "OTHER_CPLUSPLUSFLAGS[sdk=iphoneos*][arch=armv7]" = ""; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = macosx; + USER_HEADER_SEARCH_PATHS = "include/cocos2d/** include include/Box2D/** include/chipmunk/**"; VALID_ARCHS = x86_64; }; name = Debug; @@ -2783,7 +2428,7 @@ GCC_OPTIMIZATION_LEVEL = s; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "CocosLibMac-Prefix.pch"; - GCC_PREPROCESSOR_DEFINITIONS = "DEBUG=0"; + GCC_PREPROCESSOR_DEFINITIONS = "CC_ENABLE_GL_STATE_CACHE=1"; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES; MACOSX_DEPLOYMENT_TARGET = 10.6; @@ -2801,6 +2446,7 @@ "OTHER_CPLUSPLUSFLAGS[sdk=iphoneos*][arch=armv7]" = ""; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = macosx; + USER_HEADER_SEARCH_PATHS = "include/cocos2d/** include include/Box2D/** include/chipmunk/**"; VALID_ARCHS = x86_64; }; name = Release; @@ -2895,56 +2541,19 @@ E6E2A63412CE48E000923828 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = "$(ARCHS_STANDARD_32_BIT)"; + ARCHS = "$(ARCHS_STANDARD)"; COPY_PHASE_STRIP = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; GCC_OPTIMIZATION_LEVEL = s; - GCC_PREPROCESSOR_DEFINITIONS = "DEBUG=0"; + GCC_PREPROCESSOR_DEFINITIONS = "CC_ENABLE_GL_STATE_CACHE=1"; GCC_UNROLL_LOOPS = YES; GCC_VERSION = com.apple.compilers.llvm.clang.1_0; - IPHONEOS_DEPLOYMENT_TARGET = 4.3; + IPHONEOS_DEPLOYMENT_TARGET = 6.0; LD_NO_PIE = NO; - OTHER_CFLAGS = ( - "-mthumb", - "-mfpu=neon", - "-ffast-math", - "-ftree-vectorize", - "-mfloat-abi=softfp", - "-fsingle-precision-constant", - "-DNS_BLOCK_ASSERTIONS=1", - "-DRELEASE_VERSION", - ); - "OTHER_CFLAGS[arch=armv6]" = ( - "-DRELEASE_VERSION", - "-mno-thumb", - ); - "OTHER_CFLAGS[sdk=iphoneos*][arch=armv7]" = ( - "-mthumb", - "-mfpu=neon", - "-ffast-math", - "-ftree-vectorize", - "-mfloat-abi=softfp", - "-fsingle-precision-constant", - "-DNS_BLOCK_ASSERTIONS=1", - "-DRELEASE_VERSION", - ); - "OTHER_CPLUSPLUSFLAGS[arch=armv6]" = ( - "-DRELEASE_VERSION", - "-mno-thumb", - ); - "OTHER_CPLUSPLUSFLAGS[sdk=iphoneos*][arch=armv7]" = ( - "-mthumb", - "-mfpu=neon", - "-ffast-math", - "-ftree-vectorize", - "-mfloat-abi=softfp", - "-fsingle-precision-constant", - "-DNS_BLOCK_ASSERTIONS=1", - "-DRELEASE_VERSION", - ); PRODUCT_NAME = Cocos; STRIP_INSTALLED_PRODUCT = YES; TARGETED_DEVICE_FAMILY = "1,2"; + USER_HEADER_SEARCH_PATHS = "include/cocos2d/** include include/Box2D/** include/chipmunk/**"; ZERO_LINK = NO; }; name = Release; @@ -2953,6 +2562,7 @@ isa = XCBuildConfiguration; buildSettings = { ARCHS = "$(ARCHS_UNIVERSAL_IPHONE_OS)"; + CLANG_ENABLE_OBJC_ARC = YES; COPY_PHASE_STRIP = NO; GCC_C_LANGUAGE_STANDARD = c99; GCC_DEBUGGING_SYMBOLS = full; @@ -2962,46 +2572,26 @@ GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 3.2; OTHER_CFLAGS = ( - "-mthumb", - "-mfpu=neon", - "-ffast-math", - "-ftree-vectorize", - "-mfloat-abi=softfp", - "-fsingle-precision-constant", - "-DNS_BLOCK_ASSERTIONS=1", - "-DRELEASE_VERSION", - ); - "OTHER_CFLAGS[arch=*]" = "-DRELEASE_VERSION"; - "OTHER_CFLAGS[sdk=iphoneos*][arch=armv7]" = ( - "-mthumb", - "-mfpu=neon", - "-ffast-math", - "-ftree-vectorize", - "-mfloat-abi=softfp", - "-fsingle-precision-constant", - "-DNS_BLOCK_ASSERTIONS=1", - "-DRELEASE_VERSION", + "-Weverything", + "-Wno-objc-missing-property-synthesis", + "-Wno-pedantic", + "-Wno-documentation", + "-Wno-objc-interface-ivars", + "-Wno-direct-ivar-access", + "-Wno-vla", + "-Wno-implicit-atomic-properties", + "-Wno-padded", ); OTHER_CPLUSPLUSFLAGS = ( - "-mthumb", - "-mfpu=neon", - "-ffast-math", - "-ftree-vectorize", - "-mfloat-abi=softfp", - "-fsingle-precision-constant", - "-DNS_BLOCK_ASSERTIONS=1", - "-DRELEASE_VERSION", - ); - "OTHER_CPLUSPLUSFLAGS[arch=*]" = "-DRELEASE_VERSION"; - "OTHER_CPLUSPLUSFLAGS[sdk=iphoneos*][arch=armv7]" = ( - "-mthumb", - "-mfpu=neon", - "-ffast-math", - "-ftree-vectorize", - "-mfloat-abi=softfp", - "-fsingle-precision-constant", - "-DNS_BLOCK_ASSERTIONS=1", - "-DRELEASE_VERSION", + "-Weverything", + "-Wno-objc-missing-property-synthesis", + "-Wno-pedantic", + "-Wno-documentation", + "-Wno-objc-interface-ivars", + "-Wno-direct-ivar-access", + "-Wno-vla", + "-Wno-implicit-atomic-properties", + "-Wno-padded", ); OTHER_LDFLAGS = "-ObjC"; SDKROOT = iphoneos; @@ -3013,31 +2603,107 @@ E6E2A9A812CE52DE00923828 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = "$(ARCHS_STANDARD_32_BIT)"; + ARCHS = "$(ARCHS_STANDARD)"; COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", "COCOS2D_DEBUG=1", + "CC_ENABLE_GL_STATE_CACHE=1", ); GCC_VERSION = com.apple.compilers.llvm.clang.1_0; - IPHONEOS_DEPLOYMENT_TARGET = 4.3; + IPHONEOS_DEPLOYMENT_TARGET = 6.0; LD_NO_PIE = NO; - "OTHER_CFLAGS[arch=armv6]" = ( - "-DRELEASE_VERSION", - "-mno-thumb", - ); - "OTHER_CPLUSPLUSFLAGS[arch=armv6]" = ( - "-DRELEASE_VERSION", - "-mno-thumb", - ); PRODUCT_NAME = Cocos; TARGETED_DEVICE_FAMILY = "1,2"; + USER_HEADER_SEARCH_PATHS = "include/cocos2d/** include include/Box2D/** include/chipmunk/**"; ZERO_LINK = NO; }; name = Debug; }; + E6E9B04E18145B0000E3C1A2 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = NO; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + DSTROOT = /tmp/CocosDenshion.dst; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "CocosDenshion/CocosDenshion-Prefix.pch"; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "COCOS2D_DEBUG=1", + ); + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + ONLY_ACTIVE_ARCH = YES; + OTHER_CFLAGS = ""; + "OTHER_CPLUSPLUSFLAGS[sdk=iphoneos*][arch=armv7]" = ""; + OTHER_LDFLAGS = "-ObjC"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + }; + name = Debug; + }; + E6E9B04F18145B0000E3C1A2 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = NO; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = YES; + DSTROOT = /tmp/CocosDenshion.dst; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "CocosDenshion/CocosDenshion-Prefix.pch"; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + OTHER_CFLAGS = ""; + "OTHER_CPLUSPLUSFLAGS[arch=*]" = ""; + "OTHER_CPLUSPLUSFLAGS[sdk=iphoneos*][arch=armv7]" = ""; + OTHER_LDFLAGS = "-ObjC"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ @@ -3086,6 +2752,15 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; + E6E9B04D18145B0000E3C1A2 /* Build configuration list for PBXNativeTarget "CocosDenshion" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + E6E9B04E18145B0000E3C1A2 /* Debug */, + E6E9B04F18145B0000E3C1A2 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; /* End XCConfigurationList section */ }; rootObject = 0867D690FE84028FC02AAC07 /* Project object */; diff --git a/CocosLib/CocosLib.h b/CocosLib/CocosLib.h new file mode 100644 index 0000000..82358a3 --- /dev/null +++ b/CocosLib/CocosLib.h @@ -0,0 +1,13 @@ +// +// CocosLib.h +// cocos2d-ios +// +// Created by Goffredo Marocchi on 9/22/13. +// +// + +#import + +@interface CocosLib : NSObject + +@end diff --git a/CocosLib/CocosLib.m b/CocosLib/CocosLib.m new file mode 100644 index 0000000..b1607a2 --- /dev/null +++ b/CocosLib/CocosLib.m @@ -0,0 +1,13 @@ +// +// CocosLib.m +// cocos2d-ios +// +// Created by Goffredo Marocchi on 9/22/13. +// +// + +#import "CocosLib.h" + +@implementation CocosLib + +@end diff --git a/CocosLibMac-Prefix.pch b/CocosLibMac-Prefix.pch deleted file mode 100644 index 60060fe..0000000 --- a/CocosLibMac-Prefix.pch +++ /dev/null @@ -1,7 +0,0 @@ -// -// Prefix header for all source files of the 'CocosLibMac' target in the 'CocosLibMac' project -// - -#ifdef __OBJC__ - #import -#endif diff --git a/CocosLibMac/CocosLibMac.h b/CocosLibMac/CocosLibMac.h new file mode 100644 index 0000000..1b7864e --- /dev/null +++ b/CocosLibMac/CocosLibMac.h @@ -0,0 +1,13 @@ +// +// CocosLibMac.h +// cocos2d-osx +// +// Created by Goffredo Marocchi on 9/22/13. +// +// + +#import + +@interface CocosLibMac : NSObject + +@end diff --git a/CocosLibMac/CocosLibMac.m b/CocosLibMac/CocosLibMac.m new file mode 100644 index 0000000..8f31011 --- /dev/null +++ b/CocosLibMac/CocosLibMac.m @@ -0,0 +1,13 @@ +// +// CocosLibMac.m +// cocos2d-osx +// +// Created by Goffredo Marocchi on 9/22/13. +// +// + +#import "CocosLibMac.h" + +@implementation CocosLibMac + +@end diff --git a/CocosLib_Prefix.pch b/CocosLib_Prefix.pch deleted file mode 100644 index 6173502..0000000 --- a/CocosLib_Prefix.pch +++ /dev/null @@ -1,8 +0,0 @@ -// -// Prefix header for all source files of the 'CocoaTouchStaticLibrary' target in the 'CocoaTouchStaticLibrary' project. -// - -#ifdef __OBJC__ - #import - -#endif diff --git a/README.md b/README.md index 7c670f3..998dcb2 100644 --- a/README.md +++ b/README.md @@ -8,41 +8,22 @@ General Notes Current patches applied and changes from Cocos2D's master-v2 branch (20120820). -1.) PVRv3 format support from develop-v2. - -2.) Removed some font related forward declarations (merged in develop-v2 check if this has already been brought in master-v2)… tFontDefHashElement and KerningHashElement… - -https://github.com/cocos2d/cocos2d-iphone/commit/89244ec00d85245dcc074d8aade573c610fbab47 - -3.) Support for animated transitions when pushing or popping scenes: +1.) Support for animated transitions when pushing or popping scenes: https://github.com/cocos2d/cocos2d-iphone/pull/230 -4.) Optimisation - eliminated costly [NSNumber floatValue] calls -https://github.com/cocos2d/cocos2d-iphone/pull/232 - -5.) CCGLProgram guards, fixes and debugging info -https://github.com/cocos2d/cocos2d-iphone/pull/212 +//MAYBE NOT... USE the new feature in Cocos2D // 5.) Rendering Target Node - Rendering to texture made simpler. +//https://github.com/cocos2d/cocos2d-iphone/pull/231 - Added some further fixes: - https://github.com/iomac/cocos2d-iphone/commit/c3f1ffb2a47402acf351da6fff33e8cf83fe0258#commitcomment-1737403 - https://github.com/Panajev/CocosLib/commit/f978aa38b5b4a50797cc856a1a67f391589b9cf3 - -6.) Rendering Target Node - Rendering to texture made simpler. -https://github.com/cocos2d/cocos2d-iphone/pull/231 - -7.) Fix for issue #1398: Double firing of CCCallBlock in CCSequence. +2.) Fix for issue #1398: Double firing of CCCallBlock in CCSequence. https://github.com/cocos2d/cocos2d-iphone/pull/233 -8.) Fixed CCSprite's displayFrame function not returning the correct frame in Retina mode (taken from develop-v2). +3.) Fixed CCSprite's displayFrame function not returning the correct frame in Retina mode (taken from develop-v2). https://github.com/cocos2d/cocos2d-iphone/commit/ec7cc1c7437dc4a590de7b8103504d4aa00b4503 -9.) Added the ability to turn off debug drawing for a CCSprite node or any of its subclasses at runtime. +4.) Added the ability to turn off debug drawing for a CCSprite node or any of its subclasses at runtime. https://github.com/cocos2d/cocos2d-iphone/pull/234 -10.) Fixed issue with CCRenderTexture causing the wrong viewport and view matrix to be restored when used inside a custom draw/visit method. - https://github.com/cocos2d/cocos2d-iphone/pull/238 - -11.) Fixed an issue with the results of the ccpAngle method (slightly slower perhaps, but this should be more accurate): +5.) Fixed an issue with the results of the ccpAngle method (slightly slower perhaps, but this should be more accurate): https://github.com/cocos2d/cocos2d-iphone/pull/213 HOWTO Install diff --git a/cocos2d-ui/CCButton.h b/cocos2d-ui/CCButton.h new file mode 100644 index 0000000..b9da4d1 --- /dev/null +++ b/cocos2d-ui/CCButton.h @@ -0,0 +1,109 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2013 Apportable Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#import "CCControl.h" + +@class CCSprite9Slice; +@class CCLabelTTF; +@class CCSpriteFrame; + +/** + The CCButton represents a button on the screen. The button is presented with a stretchable background image and/or a title label. Different images, colors and opacity can be set for each of the buttons different states. + + Methods for setting callbacks for the button is inherited from CCControl through the setTarget:selector: method or the block property. + */ +@interface CCButton : CCControl +{ + NSMutableDictionary* _backgroundSpriteFrames; + NSMutableDictionary* _backgroundColors; + NSMutableDictionary* _backgroundOpacities; + NSMutableDictionary* _labelColors; + NSMutableDictionary* _labelOpacities; + float _originalScaleX; + float _originalScaleY; +} + +@property (nonatomic,readonly) CCSprite9Slice* background; +@property (nonatomic,readonly) CCLabelTTF* label; +@property (nonatomic,assign) BOOL zoomWhenHighlighted; +@property (nonatomic,assign) float horizontalPadding; +@property (nonatomic,assign) float verticalPadding; +@property (nonatomic,strong) NSString* title; + +/// ----------------------------------------------------------------------- +/// @name Creating Buttons +/// ----------------------------------------------------------------------- + +/** + * Creates a new button with a title and no background. Uses default font and font size. + * + * @param title The title text of the button. + * + * @return A new button. + */ ++ (id) buttonWithTitle:(NSString*) title; + +/** + * Creates a new button with a title and no background. + * + * @param title The title text of the button. + * @param fontName Name of the TTF font to use for the title label. + * @param size Font size for the title label. + * + * @return A new button. + */ ++ (id) buttonWithTitle:(NSString*) title fontName:(NSString*)fontName fontSize:(float)size; + +/** + * Creates a new button with the specified title for the label and sprite frame for its background. + * + * @param title The title text of the button. + * @param spriteFrame Stretchable background image. + * + * @return A new button. + */ ++ (id) buttonWithTitle:(NSString*) title spriteFrame:(CCSpriteFrame*) spriteFrame; ++ (id) buttonWithTitle:(NSString*) title spriteFrame:(CCSpriteFrame*) spriteFrame highlightedSpriteFrame:(CCSpriteFrame*) highlighted disabledSpriteFrame:(CCSpriteFrame*) disabled; + +- (id) initWithTitle:(NSString*) title; +- (id) initWithTitle:(NSString *)title fontName:(NSString*)fontName fontSize:(float)size; +- (id) initWithTitle:(NSString*) title spriteFrame:(CCSpriteFrame*) spriteFrame; +- (id) initWithTitle:(NSString*) title spriteFrame:(CCSpriteFrame*) spriteFrame highlightedSpriteFrame:(CCSpriteFrame*) highlighted disabledSpriteFrame:(CCSpriteFrame*) disabled; + +- (void) setBackgroundColor:(ccColor3B) color forState:(CCControlState) state; +- (void) setBackgroundOpacity:(GLubyte) opacity forState:(CCControlState) state; + +- (void) setLabelColor:(ccColor3B) color forState:(CCControlState) state; +- (void) setLabelOpacity:(GLubyte) opacity forState:(CCControlState) state; + +- (ccColor3B) backgroundColorForState:(CCControlState)state; +- (GLubyte) backgroundOpacityForState:(CCControlState)state; + +- (ccColor3B) labelColorForState:(CCControlState) state; +- (GLubyte) labelOpacityForState:(CCControlState) state; + +- (void) setBackgroundSpriteFrame:(CCSpriteFrame*)spriteFrame forState:(CCControlState)state; +- (CCSpriteFrame*) backgroundSpriteFrameForState:(CCControlState)state; + +@end diff --git a/cocos2d-ui/CCButton.m b/cocos2d-ui/CCButton.m new file mode 100644 index 0000000..c8f3a69 --- /dev/null +++ b/cocos2d-ui/CCButton.m @@ -0,0 +1,494 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2013 Apportable Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#import "CCButton.h" +#import "CCControlSubclass.h" + +#import "cocos2d.h" +#import + +@implementation CCButton + +- (id) init +{ + return [self initWithTitle:@"" spriteFrame:NULL]; +} + ++ (id) buttonWithTitle:(NSString*) title +{ + return [[self alloc] initWithTitle:title]; +} + ++ (id) buttonWithTitle:(NSString*) title fontName:(NSString*)fontName fontSize:(float)size +{ + return [[self alloc] initWithTitle:title fontName:fontName fontSize:size]; +} + ++ (id) buttonWithTitle:(NSString*) title spriteFrame:(CCSpriteFrame*) spriteFrame +{ + return [[self alloc] initWithTitle:title spriteFrame:spriteFrame]; +} + ++ (id) buttonWithTitle:(NSString*) title spriteFrame:(CCSpriteFrame*) spriteFrame highlightedSpriteFrame:(CCSpriteFrame*) highlighted disabledSpriteFrame:(CCSpriteFrame*) disabled +{ + return [[self alloc] initWithTitle:title spriteFrame:spriteFrame highlightedSpriteFrame: highlighted disabledSpriteFrame:disabled]; +} + +- (id) initWithTitle:(NSString *)title +{ + self = [self initWithTitle:title spriteFrame:NULL highlightedSpriteFrame:NULL disabledSpriteFrame:NULL]; + + // Default properties for labels with only a title + self.zoomWhenHighlighted = YES; + + return self; +} + +- (id) initWithTitle:(NSString *)title fontName:(NSString*)fontName fontSize:(float)size +{ + self = [self initWithTitle:title]; + self.label.fontName = fontName; + self.label.fontSize = size; + + return self; +} + +- (id) initWithTitle:(NSString*) title spriteFrame:(CCSpriteFrame*) spriteFrame +{ + self = [self initWithTitle:title spriteFrame:spriteFrame highlightedSpriteFrame:NULL disabledSpriteFrame:NULL]; + + // Setup default colors for when only one frame is used + [self setBackgroundColor:ccc3(190, 190, 190) forState:CCControlStateHighlighted]; + [self setLabelColor:ccc3(190, 190, 190) forState:CCControlStateHighlighted]; + + [self setBackgroundOpacity:127 forState:CCControlStateDisabled]; + [self setLabelOpacity:127 forState:CCControlStateDisabled]; + + return self; +} + +- (id) initWithTitle:(NSString*) title spriteFrame:(CCSpriteFrame*) spriteFrame highlightedSpriteFrame:(CCSpriteFrame*) highlighted disabledSpriteFrame:(CCSpriteFrame*) disabled +{ + self = [super init]; + if (!self) return NULL; + + self.anchorPoint = ccp(0.5f, 0.5f); + + if (!title) title = @""; + + // Setup holders for properties + _backgroundColors = [NSMutableDictionary dictionary]; + _backgroundOpacities = [NSMutableDictionary dictionary]; + _backgroundSpriteFrames = [NSMutableDictionary dictionary]; + + _labelColors = [NSMutableDictionary dictionary]; + _labelOpacities = [NSMutableDictionary dictionary]; + + // Setup background image + if (spriteFrame) + { + _background = [CCSprite9Slice spriteWithSpriteFrame:spriteFrame]; + [self setBackgroundSpriteFrame:spriteFrame forState:CCControlStateNormal]; + self.preferredSize = spriteFrame.originalSize; + } + else + { + _background = [[CCSprite9Slice alloc] init]; + } + + [self addChild:_background z:0]; + + // Setup label + _label = [CCLabelTTF labelWithString:title fontName:@"Helvetica" fontSize:14]; + _label.adjustsFontSizeToFit = YES; + _label.horizontalAlignment = kCCTextAlignmentCenter; + _label.verticalAlignment = kCCVerticalTextAlignmentCenter; + + [self addChild:_label z:1]; + + // Setup original scale + _originalScaleX = _originalScaleY = 1; + + [self needsLayout]; + [self stateChanged]; + + return self; +} + +- (void) layout +{ + _label.dimensions = CGSizeZero; + CGSize originalLabelSize = _label.contentSize; + CGSize paddedLabelSize = originalLabelSize; + paddedLabelSize.width += _horizontalPadding * 2; + paddedLabelSize.height += _verticalPadding * 2; + + CGSize size = paddedLabelSize; + + BOOL shrunkSize = NO; + size = [self convertContentSizeToPoints: self.preferredSize type:self.contentSizeType]; + + CGSize maxSize = [self convertContentSizeToPoints:self.maxSize type:self.contentSizeType]; + + if (size.width < paddedLabelSize.width) size.width = paddedLabelSize.width; + if (size.height < paddedLabelSize.height) size.height = paddedLabelSize.height; + + if (maxSize.width > 0 && maxSize.width < size.width) + { + size.width = maxSize.width; + shrunkSize = YES; + } + if (maxSize.height > 0 && maxSize.height < size.height) + { + size.height = maxSize.height; + shrunkSize = YES; + } + + if (shrunkSize) + { + CGSize labelSize = CGSizeMake(clampf(size.width - _horizontalPadding * 2, 0, originalLabelSize.width), + clampf(size.height - _verticalPadding * 2, 0, originalLabelSize.height)); + _label.dimensions = labelSize; + } + + _background.contentSize = size; + _background.anchorPoint = ccp(0,0); + _background.position = ccp(0,0); + + _label.positionType = kCCPositionTypeNormalized; + _label.position = ccp(0.5f, 0.5f); + + self.contentSize = [self convertContentSizeFromPoints: size type:self.contentSizeType]; + + [super layout]; +} +#ifdef __CC_PLATFORM_IOS + +- (void) touchEntered:(UITouch *)touch withEvent:(UIEvent *)event +{ + self.highlighted = YES; +} + +- (void) touchExited:(UITouch *)touch withEvent:(UIEvent *)event +{ + self.highlighted = NO; +} + +- (void) touchUpInside:(UITouch *)touch withEvent:(UIEvent *)event +{ + [self triggerAction]; + self.highlighted = NO; +} + +- (void) touchUpOutside:(UITouch *)touch withEvent:(UIEvent *)event +{ + self.highlighted = NO; +} + +#elif __CC_PLATFORM_MAC + +- (void) mouseDownEntered:(NSEvent *)event +{ + self.highlighted = YES; +} + +- (void) mouseDownExited:(NSEvent *)event +{ + self.highlighted = NO; +} + +- (void) mouseUpInside:(NSEvent *)event +{ + [self triggerAction]; + self.highlighted = NO; +} + +- (void) mouseUpOutside:(NSEvent *)event +{ + self.highlighted = NO; +} + +#endif + +- (void) updatePropertiesForState:(CCControlState)state +{ + // Update background + _background.color = [self backgroundColorForState:state]; + _background.opacity = [self backgroundOpacityForState:state]; + + CCSpriteFrame* spriteFrame = [self backgroundSpriteFrameForState:state]; + if (!spriteFrame) spriteFrame = [self backgroundSpriteFrameForState:CCControlStateNormal]; + _background.spriteFrame = spriteFrame; + + // Update label + _label.color = [self labelColorForState:state]; + _label.opacity = [self labelOpacityForState:state]; + + [self needsLayout]; +} + +- (void) stateChanged +{ + if (self.enabled) + { + // Button is enabled + if (self.highlighted) + { + [self updatePropertiesForState:CCControlStateHighlighted]; + + if (_zoomWhenHighlighted) + { + [_label runAction:[CCScaleTo actionWithDuration:0.1 scaleX:_originalScaleX*1.2 scaleY:_originalScaleY*1.2]]; + } + } + else + { + [self updatePropertiesForState:CCControlStateNormal]; + + [_label stopAllActions]; + if (_zoomWhenHighlighted) + { + _label.scaleX = _originalScaleX; + _label.scaleY = _originalScaleY; + } + } + } + else + { + // Button is disabled + [self updatePropertiesForState:CCControlStateDisabled]; + } +} + +#pragma mark Properties + +- (void) setScale:(float)scale +{ + _originalScaleX = _originalScaleY = scale; + [super setScale:scale]; +} + +- (void) setScaleX:(float)scaleX +{ + _originalScaleX = scaleX; + [super setScaleX:scaleX]; +} + +- (void) setScaleY:(float)scaleY +{ + _originalScaleY = scaleY; + [super setScaleY:scaleY]; +} + +- (void) setLabelColor:(ccColor3B)color forState:(CCControlState)state +{ + [_labelColors setObject:[NSValue value:&color withObjCType:@encode(ccColor3B)] forKey:@(state)]; + [self stateChanged]; +} + +- (ccColor3B) labelColorForState:(CCControlState)state +{ + NSValue* val = [_labelColors objectForKey:@(state)]; + if (!val) return ccc3(255, 255, 255); + ccColor3B color; + [val getValue:&color]; + return color; +} + +- (void) setLabelOpacity:(GLubyte)opacity forState:(CCControlState)state +{ + [_labelOpacities setObject:[NSNumber numberWithInt:opacity] forKey:@(state)]; + [self stateChanged]; +} + +- (GLubyte) labelOpacityForState:(CCControlState)state +{ + NSNumber* val = [_labelOpacities objectForKey:@(state)]; + if (!val) return 255; + return [val intValue]; +} + +- (void) setBackgroundColor:(ccColor3B)color forState:(CCControlState)state +{ + [_backgroundColors setObject:[NSValue value:&color withObjCType:@encode(ccColor3B)] forKey:@(state)]; + [self stateChanged]; +} + +- (ccColor3B) backgroundColorForState:(CCControlState)state +{ + NSValue* val = [_backgroundColors objectForKey:@(state)]; + if (!val) return ccc3(255, 255, 255); + ccColor3B color; + [val getValue:&color]; + return color; +} + +- (void) setBackgroundOpacity:(GLubyte)opacity forState:(CCControlState)state +{ + [_backgroundOpacities setObject:[NSNumber numberWithInt:opacity] forKey:@(state)]; + [self stateChanged]; +} + +- (GLubyte) backgroundOpacityForState:(CCControlState)state +{ + NSNumber* val = _backgroundOpacities [@(state)]; + if (!val) return 255; + return [val intValue]; +} + +- (void) setBackgroundSpriteFrame:(CCSpriteFrame*)spriteFrame forState:(CCControlState)state +{ + if (spriteFrame) + { + [_backgroundSpriteFrames setObject:spriteFrame forKey:@(state)]; + } + else + { + [_backgroundSpriteFrames removeObjectForKey:@(state)]; + } + [self stateChanged]; +} + +- (CCSpriteFrame*) backgroundSpriteFrameForState:(CCControlState)state +{ + return _backgroundSpriteFrames[@(state)]; +} + +- (void) setTitle:(NSString *)title +{ + _label.string = title; + [self needsLayout]; +} + +- (NSString*) title +{ + return _label.string; +} + +- (void) setHorizontalPadding:(float)horizontalPadding +{ + _horizontalPadding = horizontalPadding; + [self needsLayout]; +} + +- (void) setVerticalPadding:(float)verticalPadding +{ + _verticalPadding = verticalPadding; + [self needsLayout]; +} + +- (NSArray*) keysForwardedToLabel +{ + return [NSArray arrayWithObjects: + @"fontName", + @"fontSize", + @"opacity", + @"color", + @"fontColor", + @"outlineColor", + @"outlineWidth", + @"shadowColor", + @"shadowBlurRadius", + @"shadowOffset", + @"shadowOffsetType", + nil]; +} + +- (void) setValue:(id)value forKey:(NSString *)key +{ + if ([[self keysForwardedToLabel] containsObject:key]) + { + [_label setValue:value forKey:key]; + [self needsLayout]; + return; + } + [super setValue:value forKey:key]; +} + +- (id) valueForKey:(NSString *)key +{ + if ([[self keysForwardedToLabel] containsObject:key]) + { + return [_label valueForKey:key]; + } + return [super valueForKey:key]; +} + +- (void) setValue:(id)value forKey:(NSString *)key state:(CCControlState)state +{ + if ([key isEqualToString:@"labelOpacity"]) + { + [self setLabelOpacity:[value intValue] forState:state]; + } + else if ([key isEqualToString:@"labelColor"]) + { + ccColor3B c; + [value getValue:&c]; + [self setLabelColor:c forState:state]; + } + else if ([key isEqualToString:@"backgroundOpacity"]) + { + [self setBackgroundOpacity:[value intValue] forState:state]; + } + else if ([key isEqualToString:@"backgroundColor"]) + { + ccColor3B c; + [value getValue:&c]; + [self setBackgroundColor:c forState:state]; + } + else if ([key isEqualToString:@"backgroundSpriteFrame"]) + { + [self setBackgroundSpriteFrame:value forState:state]; + } +} + +- (id) valueForKey:(NSString *)key state:(CCControlState)state +{ + if ([key isEqualToString:@"labelOpacity"]) + { + return [NSNumber numberWithUnsignedChar:[self labelOpacityForState:state]]; + } + else if ([key isEqualToString:@"labelColor"]) + { + ccColor3B c = [self labelColorForState:state]; + return [NSValue value:&c withObjCType:@encode(ccColor3B)]; + } + else if ([key isEqualToString:@"backgroundOpacity"]) + { + return [NSNumber numberWithUnsignedChar:[self backgroundOpacityForState:state]]; + } + else if ([key isEqualToString:@"backgroundColor"]) + { + ccColor3B c = [self backgroundColorForState:state]; + return [NSValue value:&c withObjCType:@encode(ccColor3B)]; + } + else if ([key isEqualToString:@"backgroundSpriteFrame"]) + { + return [self backgroundSpriteFrameForState:state]; + } + + return NULL; +} + +@end diff --git a/cocos2d-ui/CCControl.h b/cocos2d-ui/CCControl.h new file mode 100644 index 0000000..7032ca4 --- /dev/null +++ b/cocos2d-ui/CCControl.h @@ -0,0 +1,118 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2013 Apportable Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#import "CCNode.h" + +/** + The possible states for a CCControl. + */ +typedef NS_ENUM(NSUInteger, CCControlState) +{ + /** The normal, or default state of a control — that is, enabled but neither selected nor highlighted. */ + CCControlStateNormal = 1 << 0, + + /** Highlighted state of a control. A control enters this state when a touch down, drag inside or drag enter is performed. You can retrieve and set this value through the highlighted property. */ + CCControlStateHighlighted = 1 << 1, + + /** Disabled state of a control. This state indicates that the control is currently disabled. You can retrieve and set this value through the enabled property. */ + CCControlStateDisabled = 1 << 2, + + /** Selected state of a control. This state indicates that the control is currently selected. You can retrieve and set this value through the selected property. */ + CCControlStateSelected = 1 << 3 +}; + + +/** + CCControl is the abstract base class of the Cocos2d components that handles touches or mouse events. You cannot instantiate it directly, instead use one of its sub-classes, such as CCButton. If you need to create a new sort of component you should make a sub-class of this class. + + The control class handles events and its sub-classes will use child nodes to draw itself in the node heirarchy. + + *Important:* If you are sub-classing CCControl you will need to include the CCControlSubclass.h file as it includes methods that are otherwise not exposed. + */ +@interface CCControl : CCNode +{ + /** Needs layout is set to true if the control has changed and needs to re-layout itself. */ + BOOL _needsLayout; +} + + +/// ----------------------------------------------------------------------- +/// @name Controlling Content Size +/// ----------------------------------------------------------------------- + +/** The preferred (and minimum) size that the component will attempt to layout to. If its contents are larger it may have a larger size. */ +@property (nonatomic,assign) CGSize preferredSize; + +/** The content size type that the preferredSize is using. Please refer to the CCNode documentation on how to use content size types. */ +@property (nonatomic,assign) CCContentSizeType preferredSizeType; + +/** The maximum size that the component will layout to, the component will not be larger than this size and will instead shrink its content if needed. */ +@property (nonatomic,assign) CGSize maxSize; + +/** The content size type that the preferredSize is using. Please refer to the CCNode documentation on how to use content size types. */ +@property (nonatomic,assign) CCContentSizeType maxSizeType; + + +/// ----------------------------------------------------------------------- +/// @name Setting and Getting Control Attributes +/// ----------------------------------------------------------------------- + +/** Sets or retrieves the current state of the control. It's often easier to use the enabled, highlighted and selected properties to indirectly set or read this property. This property is stored as a bit-mask. */ +@property (nonatomic,assign) CCControlState state; + +/** Determines if the control is currently enabled. */ +@property (nonatomic,assign) BOOL enabled; + +/** Determines if the control is currently selected. E.g. this is used by toggle buttons to handle the on state. */ +@property (nonatomic,assign) BOOL selected; + +/** Determines if the control is currently highlighted. E.g. this corresponds to the down state of a button */ +@property (nonatomic,assign) BOOL highlighted; + +/** True if the control continously should generate events when it's value is changed. E.g. this can be used by slider controls. */ +@property (nonatomic,assign) BOOL continuous; + +/** True if the control is currently tracking touches or mouse events. That is, if the user has touched down in the component but not lifted his finger (the actual touch may be outside the component). */ +@property (nonatomic,readonly) BOOL tracking; + +/** True if the control currently has a touch or a mouse event within its bounds. */ +@property (nonatomic,readonly) BOOL touchInside; + + +/// ----------------------------------------------------------------------- +/// @name Receiving Action Callbacks +/// ----------------------------------------------------------------------- + +/** A block that handles action callbacks sent by the control. Use either the block property or the setTarget:selector: method to receive actions from controls. */ +@property (nonatomic,copy) void(^block)(id sender); + +/** + * Sets a target and selector that should be called when an action is triggered by the control. Actions are generated when buttons are clicked, sliders are dragged etc. You can also set the action callback using the block property. + * + * @param target The target object. + * @param selector Selector to call on the target object. + */ +-(void) setTarget:(id)target selector:(SEL)selector; + +@end diff --git a/cocos2d-ui/CCControl.m b/cocos2d-ui/CCControl.m new file mode 100644 index 0000000..82ed029 --- /dev/null +++ b/cocos2d-ui/CCControl.m @@ -0,0 +1,417 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2013 Apportable Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#import "CCControl.h" +#import "CCControlSubclass.h" +#import +#import + +#ifdef __CC_PLATFORM_IOS + +// iOS headers +#import "UITouch+CC.h" + +#elif defined (__CC_PLATFORM_MAC) + +// Mac headers +#import "NSEvent+CC.h" + +#endif + + +@implementation CCControl + +#pragma mark Initializers + +- (id) init +{ + self = [super init]; + if (!self) return NULL; + + self.userInteractionEnabled = YES; + + return self; +} + +#pragma mark Action handling + +- (void) setTarget:(id)target selector:(SEL)selector +{ + __unsafe_unretained id weakTarget = target; // avoid retain cycle + [self setBlock:^(id sender) { + objc_msgSend(weakTarget, selector, sender); + }]; +} + +- (void) triggerAction +{ + if (self.enabled && _block) + { + _block(self); + } +} + +#pragma mark Touch handling + +#ifdef __CC_PLATFORM_IOS + +- (void) touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event +{ + UITouch* touch = [touches anyObject]; + + _tracking = YES; + _touchInside = YES; + + [self touchEntered:touch withEvent:event]; +} + +- (void) touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event +{ + UITouch* touch = [touches anyObject]; + + if ([self hitTestWithWorldPos:[touch locationInWorld]]) + { + if (!_touchInside) + { + [self touchEntered:touch withEvent:event]; + _touchInside = YES; + } + } + else + { + if (_touchInside) + { + [self touchExited:touch withEvent:event]; + _touchInside = NO; + } + } +} + +- (void) touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event +{ + UITouch* touch = [touches anyObject]; + + if (_touchInside) + { + [self touchUpInside:touch withEvent:event]; + } + else + { + [self touchUpOutside:touch withEvent:event]; + } + + _touchInside = NO; + _tracking = NO; +} + +- (void) touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event +{ + UITouch* touch = [touches anyObject]; + + if (_touchInside) + { + [self touchExited:touch withEvent:event]; + } + + _touchInside = NO; + _tracking = NO; +} + +- (void) touchEntered:(UITouch*) touch withEvent:(UIEvent*)event +{} + +- (void) touchExited:(UITouch*) touch withEvent:(UIEvent*) event +{} + +- (void) touchUpInside:(UITouch*) touch withEvent:(UIEvent*) event +{} + +- (void) touchUpOutside:(UITouch*) touch withEvent:(UIEvent*) event +{} + +#elif defined (__CC_PLATFORM_MAC) + +- (void) mouseDown:(NSEvent *)event +{ + _tracking = YES; + _touchInside = YES; + + [self mouseDownEntered:event]; +} + +- (void) mouseDragged:(NSEvent *)event +{ + if ([self hitTestWithWorldPos:[event locationInWorld]]) + { + if (!_touchInside) + { + [self mouseDownEntered:event]; + _touchInside = YES; + } + } + else + { + if (_touchInside) + { + [self mouseDownExited:event]; + _touchInside = NO; + } + } +} + +- (void) mouseUp:(NSEvent *)event +{ + if (_touchInside) + { + [self mouseUpInside:event]; + } + else + { + [self mouseUpOutside:event]; + } + + _touchInside = NO; + _tracking = NO; +} + +- (void) mouseDownEntered:(NSEvent*) event +{} + +- (void) mouseDownExited:(NSEvent*) event +{} + +- (void) mouseUpInside:(NSEvent*) event +{} + +- (void) mouseUpOutside:(NSEvent*) event +{} + +#endif + + +#pragma mark State properties + +- (BOOL) enabled +{ + if (!(_state & CCControlStateDisabled)) return YES; + else return NO; +} + +- (void) setEnabled:(BOOL)enabled +{ + if (self.enabled == enabled) return; + + BOOL disabled = !enabled; + + if (disabled) + { + _state |= CCControlStateDisabled; + } + else + { + _state = (CCControlState)(_state & (~CCControlStateDisabled)); + } + + [self stateChanged]; +} + +- (BOOL) selected +{ + if (_state & CCControlStateSelected) return YES; + else return NO; +} + +- (void) setSelected:(BOOL)selected +{ + if (self.selected == selected) return; + + if (selected) + { + _state |= CCControlStateSelected; + } + else + { + _state = (CCControlState)(_state & (~CCControlStateSelected)); + } + + [self stateChanged]; +} + +- (BOOL) highlighted +{ + if (_state & CCControlStateHighlighted) return YES; + else return NO; +} + +- (void) setHighlighted:(BOOL)highlighted +{ + if (self.highlighted == highlighted) return; + + if (highlighted) + { + _state |= CCControlStateHighlighted; + } + else + { + _state = (CCControlState)(_state & (~CCControlStateHighlighted)); + } + + [self stateChanged]; +} + +#pragma mark Layout and state changes + +- (void) stateChanged +{ + [self needsLayout]; +} + +- (void) needsLayout +{ + _needsLayout = YES; +} + +- (void) layout +{ + _needsLayout = NO; +} + +- (void) visit +{ + if (_needsLayout) [self layout]; + [super visit]; +} + +- (CGSize) contentSize +{ + if (_needsLayout) [self layout]; + return [super contentSize]; +} + +- (void) onEnter +{ + [self needsLayout]; + [super onEnter]; +} + +- (void) setContentSizeType:(CCContentSizeType)contentSizeType +{ + [super setContentSizeType:contentSizeType]; + [self needsLayout]; +} + +- (void) setPreferredSize:(CGSize)preferredSize +{ + _preferredSize = preferredSize; + [self needsLayout]; +} + +- (void) setMaxSize:(CGSize)maxSize +{ + _maxSize = maxSize; + [self needsLayout]; +} + +- (void) setPreferredSizeType:(CCContentSizeType)preferredSizeType +{ + self.contentSizeType = preferredSizeType; +} + +- (CCContentSizeType) preferredSizeType +{ + return self.contentSizeType; +} + +- (void) setMaxSizeType:(CCContentSizeType)maxSizeType +{ + self.contentSizeType = maxSizeType; +} + +- (CCContentSizeType) maxSizeType +{ + return self.contentSizeType; +} + + +#pragma mark Setting properties for control states by name + +- (CCControlState) controlStateFromString:(NSString*)stateName +{ + CCControlState state = CCControlStateNormal; + + if ([stateName isEqualToString:@"Normal"]) state = CCControlStateNormal; + else if ([stateName isEqualToString:@"Highlighted"]) state = CCControlStateHighlighted; + else if ([stateName isEqualToString:@"Disabled"]) state = CCControlStateDisabled; + else if ([stateName isEqualToString:@"Selected"]) state = CCControlStateSelected; + + return state; +} + +- (void) setValue:(id)value forKey:(NSString *)key state:(CCControlState) state +{ +} + +- (id) valueForKey:(NSString *)key state:(CCControlState)state +{ + return NULL; +} + +- (void) setValue:(id)value forKey:(NSString *)key +{ + NSRange separatorRange = [key rangeOfString:@"|"]; + NSUInteger separatorLoc = separatorRange.location; + + if (separatorLoc == NSNotFound) + { + [super setValue:value forKey:key]; + return; + } + + NSString* propName = [key substringToIndex:separatorLoc]; + NSString* stateName = [key substringFromIndex:separatorLoc+1]; + + CCControlState state = [self controlStateFromString:stateName]; + + [self setValue:value forKey:propName state:state]; +} + +- (id) valueForKey:(NSString *)key +{ + NSRange separatorRange = [key rangeOfString:@"|"]; + NSUInteger separatorLoc = separatorRange.location; + + if (separatorLoc == NSNotFound) + { + return [super valueForKey:key]; + } + + NSString* propName = [key substringToIndex:separatorLoc]; + NSString* stateName = [key substringFromIndex:separatorLoc+1]; + + CCControlState state = [self controlStateFromString:stateName]; + + return [self valueForKey:propName state:state]; +} + +@end diff --git a/cocos2d-ui/CCControlSubclass.h b/cocos2d-ui/CCControlSubclass.h new file mode 100644 index 0000000..697419e --- /dev/null +++ b/cocos2d-ui/CCControlSubclass.h @@ -0,0 +1,140 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2013 Apportable Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#import "CCControl.h" + +/// ----------------------------------------------------------------------- +/// @name Methods Used by Sub-Classes +/// ----------------------------------------------------------------------- + +@interface CCControl () + +/** + * Used by sub-classes. This method is called to trigger an action callback. E.g. CCButton calls this method when the button is tapped. + */ +- (void) triggerAction; + +/** + * Used by sub-classes. This method is called every time the control's state changes, it's default behavior is to call the needsLayout method. + */ +- (void) stateChanged; + +/** + * Used by sub-classes. This method should be called whenever the control needs to update its layout. It will force a call to the layout method at the beginning of the next draw cycle. + */ +- (void) needsLayout; + +/** + * Used by sub classes. Override this method to do any layout needed by the component. This can include setting positions or sizes of child labels or sprites as well as the compontents contentSize. + */ +- (void) layout; + +/** + * Used by sub-classes. Override this method if you are using custom properties and need to set them by name using the setValue:forKey method. This is needed for integration with editors such as SpriteBuilder. When overriding this method, make sure to call its super method if you cannot handle the key. + * + * @param value The value to set. + * @param key The key to set the value for. + * @param state The state to set the value for. + */ +- (void) setValue:(id)value forKey:(NSString *)key state:(CCControlState) state; + +/** + * Used by sub-classes. Override this method to return values of custom properties that are set by state. + * @see setValue:forKey:state: + * + * @param key The key to retrieve the value for. + * @param state The state to retrieve the value for. + * + * @return The value for the specified key and value or `NULL` if no such value exist. + */ +- (id) valueForKey:(NSString *)key state:(CCControlState)state; + +#ifdef __CC_PLATFORM_IOS + +/** + * Used by sub-classes. Called when a touch enters the component. By default this happes if the touch down is within the control, if the claimsUserEvents property is set to false this will also happen if the touch starts outside of the control. + * + * @param touch Touch that entered the component. + * @param event Event associated with the touch. + */ +- (void) touchEntered:(UITouch*) touch withEvent:(UIEvent*)event; + +/** + * Used by sub-classes. Called when a touch exits the component. + * + * @param touch Touch that exited the component + * @param event Event associated with the touch. + */ +- (void) touchExited:(UITouch*) touch withEvent:(UIEvent*) event; + +/** + * Used by sub-classes. Called when a touch that started inside the component is ended inside the component. E.g. for CCButton, this triggers the buttons callback action. + * + * @param touch Touch that is released inside the component. + * @param event Event associated with the touch. + */ +- (void) touchUpInside:(UITouch*) touch withEvent:(UIEvent*) event; + +/** + * Used by sub-classes. Called when a touch that started inside the component is ended outside the component. E.g. for CCButton, this doesn't trigger any callback action. + * + * @param touch Touch that is release outside of the component. + * @param event Event associated with the touch. + */ +- (void) touchUpOutside:(UITouch*) touch withEvent:(UIEvent*) event; + +#elif defined (__CC_PLATFORM_MAC) + +/** + * Used by sub-classes. Called when a mouse down enters the component. By default this happes if the mouse down is within the control, if the claimsUserEvents property is set to false this will also happen if the mouse down starts outside of the control. + * + * @param event Event associated with the mouse down. + */ +- (void) mouseDownEntered:(NSEvent*) event; + +/** + * Used by sub-classes. Called when a mouse down exits the component. + * + * @param event Event associated with the mouse down. + */ +- (void) mouseDownExited:(NSEvent*) event; + +/** + * Used by sub-classes. Called when a mouse down that started inside the component is ended inside the component. E.g. for CCButton, this triggers the buttons callback action. + * + * @param event Event associated with the mouse up. + */ +- (void) mouseUpInside:(NSEvent*) event; + +/** + * Used by sub-classes. Called when a mouse down that started inside the component is ended outside the component. E.g. for CCButton, this doesn't trigger any callback action. + * + * @param event Event associated with the mouse up. + */ +- (void) mouseUpOutside:(NSEvent*) event; + + +#endif + +@end diff --git a/cocos2d-ui/CCControlTextureFactory.h b/cocos2d-ui/CCControlTextureFactory.h new file mode 100644 index 0000000..daec620 --- /dev/null +++ b/cocos2d-ui/CCControlTextureFactory.h @@ -0,0 +1,13 @@ +// +// CCControlTextureFactory.h +// cocos2d-ui +// +// Created by Viktor on 9/5/13. +// Copyright (c) 2013 Apportable. All rights reserved. +// + +#import + +@interface CCControlTextureFactory : NSObject + +@end diff --git a/cocos2d-ui/CCControlTextureFactory.m b/cocos2d-ui/CCControlTextureFactory.m new file mode 100644 index 0000000..291e39b --- /dev/null +++ b/cocos2d-ui/CCControlTextureFactory.m @@ -0,0 +1,13 @@ +// +// CCControlTextureFactory.m +// cocos2d-ui +// +// Created by Viktor on 9/5/13. +// Copyright (c) 2013 Apportable. All rights reserved. +// + +#import "CCControlTextureFactory.h" + +@implementation CCControlTextureFactory + +@end diff --git a/cocos2d-ui/CCScrollView.h b/cocos2d-ui/CCScrollView.h new file mode 100644 index 0000000..0936e56 --- /dev/null +++ b/cocos2d-ui/CCScrollView.h @@ -0,0 +1,83 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2013 Apportable Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#import "CCNode.h" + +@class CCTapDownGestureRecognizer; + +#ifdef __CC_PLATFORM_IOS + +// Class definition for iOS +@interface CCScrollView : CCNode + +#elif defined(__CC_PLATFORM_MAC) + +// Class definition for Mac +@interface CCScrollView : CCNode + +#endif + +{ +#ifdef __CC_PLATFORM_IOS + UIPanGestureRecognizer* _panRecognizer; + CCTapDownGestureRecognizer* _tapRecognizer; +#endif + + CGPoint _rawTranslationStart; + CGPoint _startScrollPos; + BOOL _isPanning; + BOOL _animatingX; + BOOL _animatingY; + CGPoint _velocity; +} + +@property (nonatomic,strong) CCNode* contentNode; + +@property (nonatomic,assign) BOOL flipYCoordinates; + +@property (nonatomic,assign) BOOL horizontalScrollEnabled; +@property (nonatomic,assign) BOOL verticalScrollEnabled; + +@property (nonatomic,assign) CGPoint scrollPosition; + +@property (nonatomic,assign) BOOL pagingEnabled; +@property (nonatomic,assign) int horizontalPage; +@property (nonatomic,assign) int verticalPage; +@property (nonatomic,readonly) int numVerticalPages; +@property (nonatomic,readonly) int numHorizontalPages; + +@property (nonatomic,readonly) float minScrollX; +@property (nonatomic,readonly) float maxScrollX; +@property (nonatomic,readonly) float minScrollY; +@property (nonatomic,readonly) float maxScrollY; + +@property (nonatomic,assign) BOOL bounces; + +- (id) initWithContentNode:(CCNode*)contentNode; + +- (void) setScrollPosition:(CGPoint)newPos animated:(BOOL)animated; + +- (void) setHorizontalPage:(int)horizontalPage animated:(BOOL)animated; +- (void) setVerticalPage:(int)verticalPage animated:(BOOL)animated; +@end diff --git a/cocos2d-ui/CCScrollView.m b/cocos2d-ui/CCScrollView.m new file mode 100644 index 0000000..0f0eda2 --- /dev/null +++ b/cocos2d-ui/CCScrollView.m @@ -0,0 +1,837 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2013 Apportable Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#import "CCScrollView.h" +#import "CCDirector.h" +#import "CGPointExtension.h" +#import "CCActionInterval.h" +#import "CCActionEase.h" +#import "CCActionInstant.h" +#import "CCResponderManager.h" + +#ifdef __CC_PLATFORM_IOS + +// Includes for iOS +#import "UITouch+CC.h" +#import + +// Includes for Mac +#elif defined(__CC_PLATFORM_MAC) + +#endif + +#pragma mark Constants + +#pragma clang diagnostic push COCOS2D +#pragma clang diagnostic ignored "-Wunused-macros" + +#define kCCScrollViewBoundsSlowDown 0.5 +#define kCCScrollViewDeacceleration 0.95 +#define kCCScrollViewVelocityLowerCap 20.0 +#define kCCScrollViewAllowInteractionBelowVelocity 50.0 +#define kCCScrollViewSnapDuration 0.4 +#define kCCScrollViewSnapDurationFallOff 100.0 +#define kCCScrollViewAutoPageSpeed 500.0 +#define kCCScrollViewMaxOuterDistBeforeBounceBack 50.0 +#define kCCScrollViewMinVelocityBeforeBounceBack 100.0 + +#define kCCScrollViewActionXTag 8080 +#define kCCScrollViewActionYTag 8081 + +#pragma clang diagnostic pop COCOS2D + +#pragma mark - +#pragma mark Helper classes + + +#ifdef __CC_PLATFORM_IOS +@interface CCTapDownGestureRecognizer : UIGestureRecognizer +@end + +@implementation CCTapDownGestureRecognizer + +-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event +{ + if (self.state == UIGestureRecognizerStatePossible) + { + self.state = UIGestureRecognizerStateRecognized; + } +} + +-(void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event +{ + self.state = UIGestureRecognizerStateFailed; +} + +-(void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event +{ + self.state = UIGestureRecognizerStateFailed; +} +@end +#endif + + +@interface CCMoveToX : CCActionInterval +{ + float _endPosition; + float _startPos; +} +@end + +@implementation CCMoveToX + +-(id) initWithDuration: (ccTime) t positionX: (float) p +{ + if( (self=[super initWithDuration: t]) ) + _endPosition = p; + return self; +} + + +-(void) startWithTarget:(id)target +{ + CCNode *targetNode = (CCNode *)target; + [super startWithTarget:targetNode]; + _startPos = targetNode.position.x; +} + +-(void) update: (ccTime) t +{ + CCNode *node = (CCNode*)_target; + + float positionDelta = _endPosition - _startPos; + float x = _startPos + positionDelta * t; + float y = node.position.y; + + node.position = ccp(x,y); +} +@end + + +@interface CCMoveToY : CCActionInterval +{ + float _endPosition; + float _startPos; +} +@end + +@implementation CCMoveToY + +-(id) initWithDuration: (ccTime) t positionY: (float) p +{ + if( (self=[super initWithDuration: t]) ) + _endPosition = p; + return self; +} + + +-(void) startWithTarget:(id)target +{ + CCNode *targetNode = (CCNode *)target; + [super startWithTarget:targetNode]; + _startPos = targetNode.position.y; +} + +-(void) update: (ccTime) t +{ + CCNode *node = (CCNode*)_target; + + float positionDelta = _endPosition - _startPos; + float y = _startPos + positionDelta * t; + float x = node.position.x; + + node.position = ccp(x,y); +} +@end + + +#pragma mark - +#pragma mark CCScrollView + +@implementation CCScrollView + +#pragma mark Initializers + +- (id) init +{ + self = [self initWithContentNode:[CCNode node]]; + self.contentSizeType = kCCContentSizeTypeNormalized; + return self; +} + +- (id) initWithContentNode:(CCNode*)contentNode +{ + self = [super init]; + if (!self) return NULL; + + _flipYCoordinates = YES; + + // Setup content node + self.contentSize = CGSizeMake(1, 1); + self.contentSizeType = kCCContentSizeTypeNormalized; + self.contentNode = contentNode; + + // Default properties + _horizontalScrollEnabled = YES; + _verticalScrollEnabled = YES; + _bounces = YES; + +#ifdef __CC_PLATFORM_IOS + + // Create gesture recognizers + _panRecognizer = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(handlePan:)]; + _tapRecognizer = [[CCTapDownGestureRecognizer alloc] initWithTarget:self action:@selector(handleTap:)]; + + _panRecognizer.delegate = self; + _tapRecognizer.delegate = self; + +#elif defined(__CC_PLATFORM_MAC) + + // Use scroll wheel + self.userInteractionEnabled = YES; + +#endif + + [self scheduleUpdate]; + self.userInteractionEnabled = YES; + + return self; +} + +#pragma mark Setting content node +- (void) setContentNode:(CCNode *)contentNode +{ + if (_contentNode == contentNode) return; + + // Replace content node + if (_contentNode) [self removeChild:_contentNode]; + _contentNode = contentNode; + if (contentNode) + { + [self addChild:contentNode]; + + // Update coordinate flipping + self.flipYCoordinates = self.flipYCoordinates; + } +} + +- (void) setFlipYCoordinates:(BOOL)flipYCoordinates +{ + if (flipYCoordinates) + { + _contentNode.positionType = CCPositionTypeMake(kCCPositionUnitPoints, kCCPositionUnitPoints, kCCPositionReferenceCornerTopLeft); + _contentNode.anchorPoint = ccp(0,1); + } + else + { + _contentNode.positionType = CCPositionTypeMake(kCCPositionUnitPoints, kCCPositionUnitPoints, kCCPositionReferenceCornerBottomLeft); + _contentNode.anchorPoint = ccp(0,0); + } + + _flipYCoordinates = flipYCoordinates; +} + +#pragma mark Min/Max size + +- (float) minScrollX +{ + return 0; +} + +- (float) maxScrollX +{ + if (!_contentNode) return 0; + + float maxScroll = _contentNode.contentSizeInPoints.width - self.contentSizeInPoints.width; + if (maxScroll < 0) maxScroll = 0; + + return maxScroll; +} + +- (float) minScrollY +{ + return 0; +} + +- (float) maxScrollY +{ + if (!_contentNode) return 0; + + float maxScroll = _contentNode.contentSizeInPoints.height - self.contentSizeInPoints.height; + if (maxScroll < 0) maxScroll = 0; + + return maxScroll; +} + +#pragma mark Paging + +- (void) setHorizontalPage:(int)horizontalPage +{ + [self setHorizontalPage:horizontalPage animated:NO]; +} + +- (void) setHorizontalPage:(int)horizontalPage animated:(BOOL)animated +{ + NSAssert(horizontalPage >= 0 && horizontalPage < self.numHorizontalPages, @"Setting invalid horizontal page"); + + CGPoint pos = self.scrollPosition; + pos.x = horizontalPage * self.contentSizeInPoints.width; + + [self setScrollPosition:pos animated:animated]; + _horizontalPage = horizontalPage; +} + +- (void) setVerticalPage:(int)verticalPage +{ + [self setVerticalPage:verticalPage animated:NO]; +} + +- (void) setVerticalPage:(int)verticalPage animated:(BOOL)animated +{ + NSAssert(verticalPage >= 0 && verticalPage < self.numVerticalPages, @"Setting invalid vertical page"); + + CGPoint pos = self.scrollPosition; + pos.y = verticalPage * self.contentSizeInPoints.height; + + [self setScrollPosition:pos animated:animated]; + _verticalPage = verticalPage; +} + +- (int) numHorizontalPages +{ + if (!_pagingEnabled) return 0; + if (!self.contentSizeInPoints.width || !_contentNode.contentSizeInPoints.width) return 0; + + return _contentNode.contentSizeInPoints.width / self.contentSizeInPoints.width; +} + +- (int) numVerticalPages +{ + if (!_pagingEnabled) return 0; + if (!self.contentSizeInPoints.height || !_contentNode.contentSizeInPoints.height) return 0; + + return _contentNode.contentSizeInPoints.height / self.contentSizeInPoints.height; +} + +#pragma mark Panning and setting position + +- (void) setScrollPosition:(CGPoint)newPos +{ + [self setScrollPosition:newPos animated:NO]; +} + +- (void) setScrollPosition:(CGPoint)newPos animated:(BOOL)animated +{ +#pragma clang diagnostic push COCOS2D +#pragma clang diagnostic ignored "-Wfloat-equal" + BOOL xMoved = (newPos.x != self.scrollPosition.x); + BOOL yMoved = (newPos.y != self.scrollPosition.y); +#pragma clang diagnostic pop COCOS2D + + // Check bounds + if (newPos.x > self.maxScrollX) + { + newPos.x = self.maxScrollX; + xMoved = YES; + } + if (newPos.x < self.minScrollX) + { + newPos.x = self.minScrollX; + xMoved = YES; + } + if (newPos.y > self.maxScrollY) + { + newPos.y = self.maxScrollY; + yMoved = YES; + } + if (newPos.y < self.minScrollY) + { + newPos.y = self.minScrollY; + yMoved = YES; + } + + if (animated) + { + CGPoint oldPos = self.scrollPosition; + float dist = ccpDistance(newPos, oldPos); + + float duration = clampf(dist / kCCScrollViewSnapDurationFallOff, 0, kCCScrollViewSnapDuration); + + if (xMoved) + { + // Animate horizontally + + _velocity.x = 0; + _animatingX = YES; + + // Create animation action + CCActionInterval* action = [CCEaseOut actionWithAction:[[CCMoveToX alloc] initWithDuration:duration positionX:-newPos.x] rate:2]; + CCCallFunc* callFunc = [CCCallFunc actionWithTarget:self selector:@selector(xAnimationDone)]; + action = [CCSequence actions:action, callFunc, nil]; + action.tag = kCCScrollViewActionXTag; + [_contentNode runAction:action]; + } + if (yMoved) + { + // Animate vertically + + _velocity.y = 0; + _animatingY = YES; + + // Create animation action + CCActionInterval* action = [CCEaseOut actionWithAction:[[CCMoveToY alloc] initWithDuration:duration positionY:-newPos.y] rate:2]; + CCCallFunc* callFunc = [CCCallFunc actionWithTarget:self selector:@selector(yAnimationDone)]; + action = [CCSequence actions:action, callFunc, nil]; + action.tag = kCCScrollViewActionYTag; + [_contentNode runAction:action]; + + } + } + else + { + [_contentNode stopActionByTag:kCCScrollViewActionXTag]; + [_contentNode stopActionByTag:kCCScrollViewActionYTag]; + _contentNode.position = ccpMult(newPos, -1); + } +} + +- (void) xAnimationDone +{ + _animatingX = NO; +} + +- (void) yAnimationDone +{ + _animatingY = NO; +} + +- (CGPoint) scrollPosition +{ + return ccpMult(_contentNode.position, -1); +} + +- (void) panLayerToTarget:(CGPoint) newPos +{ + if (_bounces) + { + // Scroll at half speed outside of bounds + if (newPos.x > self.maxScrollX) + { + float diff = newPos.x - self.maxScrollX; + newPos.x = self.maxScrollX + diff * kCCScrollViewBoundsSlowDown; + } + if (newPos.x < self.minScrollX) + { + float diff = self.minScrollX - newPos.x; + newPos.x = self.minScrollX - diff * kCCScrollViewBoundsSlowDown; + } + if (newPos.y > self.maxScrollY) + { + float diff = newPos.y - self.maxScrollY; + newPos.y = self.maxScrollY + diff * kCCScrollViewBoundsSlowDown; + } + if (newPos.y < self.minScrollY) + { + float diff = self.minScrollY - newPos.y; + newPos.y = self.minScrollY - diff * kCCScrollViewBoundsSlowDown; + } + } + else + { + if (newPos.x > self.maxScrollX) newPos.x = self.maxScrollX; + if (newPos.x < self.minScrollX) newPos.x = self.minScrollX; + if (newPos.y > self.maxScrollY) newPos.y = self.maxScrollY; + if (newPos.y < self.minScrollY) newPos.y = self.minScrollY; + } + + _contentNode.position = ccpMult(newPos, -1); +} + +- (void) update:(ccTime)df +{ + float fps = 1.0/df; + float p = 60/fps; + + if (!_isPanning) + { +#pragma clang diagnostic push COCOS2D +#pragma clang diagnostic ignored "-Wfloat-equal" + if (_velocity.x != 0 || _velocity.y != 0) + { +#pragma clang diagnostic pop COCOS2D + CGPoint delta = ccpMult(_velocity, df); + + _contentNode.position = ccpAdd(_contentNode.position, delta); + + // Deaccelerate layer + float deaccelerationX = kCCScrollViewDeacceleration; + float deaccelerationY = kCCScrollViewDeacceleration; + + // Adjust for frame rate + deaccelerationX = powf(deaccelerationX, p); + + // Update velocity + _velocity.x *= deaccelerationX; + _velocity.y *= deaccelerationY; + + // If velocity is low make it 0 + if (fabs(_velocity.x) < kCCScrollViewVelocityLowerCap) _velocity.x = 0; + if (fabs(_velocity.y) < kCCScrollViewVelocityLowerCap) _velocity.y = 0; + } + + if (_bounces) + { + // Bounce back to edge if layer is too far outside of the scroll area or if it is outside and moving slowly + BOOL bounceToEdge = NO; + CGPoint posTarget = self.scrollPosition; + + if (!_animatingX && !_pagingEnabled) + { + if ((posTarget.x < self.minScrollX && fabs(_velocity.x) < kCCScrollViewMinVelocityBeforeBounceBack) || + (posTarget.x < self.minScrollX - kCCScrollViewMaxOuterDistBeforeBounceBack)) + { + bounceToEdge = YES; + } + + if ((posTarget.x > self.maxScrollX && fabs(_velocity.x) < kCCScrollViewMinVelocityBeforeBounceBack) || + (posTarget.x > self.maxScrollX + kCCScrollViewMaxOuterDistBeforeBounceBack)) + { + bounceToEdge = YES; + } + } + if (!_animatingY && !_pagingEnabled) + { + if ((posTarget.y < self.minScrollY && fabs(_velocity.y) < kCCScrollViewMinVelocityBeforeBounceBack) || + (posTarget.y < self.minScrollY - kCCScrollViewMaxOuterDistBeforeBounceBack)) + { + bounceToEdge = YES; + } + + if ((posTarget.y > self.maxScrollY && fabs(_velocity.y) < kCCScrollViewMinVelocityBeforeBounceBack) || + (posTarget.y > self.maxScrollY + kCCScrollViewMaxOuterDistBeforeBounceBack)) + { + bounceToEdge = YES; + } + } + + if (bounceToEdge) + { + // Setting the scroll position to the current position will force it to be in bounds + [self setScrollPosition:posTarget animated:YES]; + } + } + else + { + if (!_pagingEnabled) + { + // Make sure we are within bounds + [self setScrollPosition:self.scrollPosition animated:NO]; + } + } + } +} + +#pragma mark Gesture recognizer + +#ifdef __CC_PLATFORM_IOS + +- (void)handlePan:(UIGestureRecognizer *)gestureRecognizer +{ + CCDirector* dir = [CCDirector sharedDirector]; + UIPanGestureRecognizer* pgr = (UIPanGestureRecognizer*)gestureRecognizer; + + CGPoint rawTranslation = [pgr translationInView:dir.view]; + rawTranslation = [dir convertToGL:rawTranslation]; + rawTranslation = [self convertToNodeSpace:rawTranslation]; + + if (pgr.state == UIGestureRecognizerStateBegan) + { + _animatingX = NO; + _animatingY = NO; + _rawTranslationStart = rawTranslation; + _startScrollPos = self.scrollPosition; + + _isPanning = YES; + [_contentNode stopActionByTag:kCCScrollViewActionXTag]; + [_contentNode stopActionByTag:kCCScrollViewActionYTag]; + } + else if (pgr.state == UIGestureRecognizerStateChanged) + { + // Calculate the translation in node space + CGPoint translation = ccpSub(_rawTranslationStart, rawTranslation); + + // Check if scroll directions has been disabled + if (!_horizontalScrollEnabled) translation.x = 0; + if (!_verticalScrollEnabled) translation.y = 0; + + if (_flipYCoordinates) translation.y = -translation.y; + + // Check bounds + CGPoint newPos = ccpAdd(_startScrollPos, translation); + + // Update position + [self panLayerToTarget:newPos]; + } + else if (pgr.state == UIGestureRecognizerStateEnded) + { + // Calculate the velocity in node space + CGPoint ref = [dir convertToGL:CGPointZero]; + ref = [self convertToNodeSpace:ref]; + + CGPoint velocityRaw = [pgr velocityInView:dir.view]; + velocityRaw = [dir convertToGL:velocityRaw]; + velocityRaw = [self convertToNodeSpace:velocityRaw]; + + _velocity = ccpSub(velocityRaw, ref); + if (_flipYCoordinates) _velocity.y = -_velocity.y; + + // Check if scroll directions has been disabled + if (!_horizontalScrollEnabled) _velocity.x = 0; + if (!_verticalScrollEnabled) _velocity.y = 0; + + // Setup a target if paging is enabled + if (_pagingEnabled) + { + CGPoint posTarget = CGPointZero; + + // Calculate new horizontal page + int pageX = roundf(self.scrollPosition.x/self.contentSizeInPoints.width); + + if (fabs(_velocity.x) >= kCCScrollViewAutoPageSpeed && _horizontalPage == pageX) + { + if (_velocity.x < 0) pageX += 1; + else pageX -= 1; + } + + pageX = clampf(pageX, 0, self.numHorizontalPages -1); + _horizontalPage = pageX; + + posTarget.x = pageX * self.contentSizeInPoints.width; + + // Calculate new vertical page + int pageY = roundf(self.scrollPosition.y/self.contentSizeInPoints.height); + + if (fabs(_velocity.y) >= kCCScrollViewAutoPageSpeed && _verticalPage == pageY) + { + if (_velocity.y < 0) pageY += 1; + else pageY -= 1; + } + + pageY = clampf(pageY, 0, self.numVerticalPages -1); + _verticalPage = pageY; + + posTarget.y = pageY * self.contentSizeInPoints.height; + + [self setScrollPosition:posTarget animated:YES]; + + _velocity = CGPointZero; + } + + _isPanning = NO; + } + else if (pgr.state == UIGestureRecognizerStateCancelled) + { + _isPanning = NO; + _velocity = CGPointZero; + _animatingX = NO; + _animatingY = NO; + + [self setScrollPosition:self.scrollPosition animated:NO]; + } +} + +- (void) handleTap:(UIGestureRecognizer *)gestureRecognizer +{ + // Stop layer from moving + _velocity = CGPointZero; + + // Snap to a whole position + CGPoint pos = _contentNode.position; + pos.x = roundf(pos.x); + pos.y = roundf(pos.y); + _contentNode.position = pos; +} + +- (BOOL) isAncestor:(CCNode*) ancestor toNode:(CCNode*)node +{ + for (CCNode* child in node.children) + { + if (child == ancestor) return YES; + if ([self isAncestor:ancestor toNode:child]) return YES; + } + return NO; +} + +- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch +{ + if (!_contentNode) return NO; + if (!self.visible) return NO; + if (!self.userInteractionEnabled) return NO; + + // Check for responders above this scroll view (and not within it). If there are responders above touch should go to them instead. + CGPoint touchWorldPos = [touch locationInWorld]; + + NSArray* responders = [[CCDirector sharedDirector].responderManager nodesAtPoint:touchWorldPos]; + BOOL foundSelf = NO; + for (int i = responders.count - 1; i >= 0; i--) + { + CCNode* responder = [responders objectAtIndex:i]; + if (foundSelf) + { + if (![self isAncestor:responder toNode:self]) + { + return NO; + } + } + else if (responder == self) + { + foundSelf = YES; + } + } + + // Allow touches to children if view is moving slowly + BOOL slowMove = (fabs(_velocity.x) < kCCScrollViewAllowInteractionBelowVelocity && + fabs(_velocity.y) < kCCScrollViewAllowInteractionBelowVelocity); + + if (gestureRecognizer == _tapRecognizer && (slowMove || _isPanning)) + { + return NO; + } + + // Check that the gesture is in the scroll view + return [self hitTestWithWorldPos:[touch locationInWorld]]; +} + +- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer +{ + return (otherGestureRecognizer == _panRecognizer || otherGestureRecognizer == _tapRecognizer); +} + +- (void) onEnterTransitionDidFinish +{ + // Add recognizers to view + UIView* view = [CCDirector sharedDirector].view; + + NSMutableArray* recognizers = [view.gestureRecognizers mutableCopy]; + if (!recognizers) recognizers = [NSMutableArray arrayWithCapacity:2]; + [recognizers insertObject:_panRecognizer atIndex:0]; + [recognizers insertObject:_tapRecognizer atIndex:0]; + + view.gestureRecognizers = recognizers; +} + +- (void) onExitTransitionDidStart +{ + // Remove recognizers from view + UIView* view = [CCDirector sharedDirector].view; + + NSMutableArray* recognizers = [view.gestureRecognizers mutableCopy]; + [recognizers removeObject:_panRecognizer]; + [recognizers removeObject:_tapRecognizer]; + + view.gestureRecognizers = recognizers; +} + +#elif defined(__CC_PLATFORM_MAC) + +#define kCCScrollViewMinPagingDelta 7 + +- (void)scrollWheel:(NSEvent *)theEvent +{ + CCDirector* dir = [CCDirector sharedDirector]; + + float deltaX = theEvent.deltaX; + float deltaY = theEvent.deltaY; + + // Calculate the delta in node space + CGPoint ref = [dir convertToGL:CGPointZero]; + ref = [self convertToNodeSpace:ref]; + + CGPoint deltaRaw = ccp(deltaX, deltaY); + deltaRaw = [dir convertToGL:deltaRaw]; + + deltaRaw = [self convertToNodeSpace:deltaRaw]; + + CGPoint delta = ccpSub(deltaRaw, ref); + + // Flip coordinates + if (_flipYCoordinates) delta.y = -delta.y; + delta.x = -delta.x; + + // Handle disabled x/y axis + if (!_horizontalScrollEnabled) delta.x = 0; + if (!_verticalScrollEnabled) delta.y = 0; + + if (_pagingEnabled) + { + if (!_animatingX && _horizontalScrollEnabled) + { + // Update horizontal page + int xPage = self.horizontalPage; + int xOldPage = xPage; + + if (fabs(delta.x) >= kCCScrollViewMinPagingDelta) + { + if (delta.x > 0) xPage += 1; + else xPage -= 1; + } + xPage = clampf(xPage, 0, self.numHorizontalPages - 1); + + if (xPage != xOldPage) + { + [self setHorizontalPage:xPage animated:YES]; + } + } + + if (!_animatingY && _verticalScrollEnabled) + { + // Update horizontal page + int yPage = self.verticalPage; + int yOldPage = yPage; + + if (fabs(delta.y) >= kCCScrollViewMinPagingDelta) + { + if (delta.y > 0) yPage += 1; + else yPage -= 1; + } + yPage = clampf(yPage, 0, self.numVerticalPages - 1); + + if (yPage != yOldPage) + { + [self setVerticalPage:yPage animated:YES]; + } + } + } + else + { + // Update scroll position + CGPoint scrollPos = self.scrollPosition; + scrollPos = ccpAdd(delta, scrollPos); + self.scrollPosition = scrollPos; + } +} + +#endif + +@end diff --git a/cocos2d-ui/CCTableView.h b/cocos2d-ui/CCTableView.h new file mode 100644 index 0000000..72285c0 --- /dev/null +++ b/cocos2d-ui/CCTableView.h @@ -0,0 +1,79 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2013 Apportable Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#import "CCScrollView.h" + +@class CCButton; +@class CCTableView; + +#pragma mark CCTableViewCell + +@interface CCTableViewCell : CCNode +{ + NSUInteger _index; +} + +@property (nonatomic,readonly) CCButton* button; + +@end + +#pragma mark CCTableViewDataSource + +@protocol CCTableViewDataSource + +- (CCTableViewCell*) tableView:(CCTableView*)tableView nodeForRowAtIndex:(NSUInteger) index; +- (NSUInteger) tableViewNumberOfRows:(CCTableView*) tableView; + +@optional + +- (float) tableView:(CCTableView*)tableView heightForRowAtIndex:(NSUInteger) index; + +@end + + +#pragma mark CCTableView + +@interface CCTableView : CCScrollView +{ + BOOL _visibleRowsDirty; + NSMutableArray* _rows; + NSRange _currentlyVisibleRange; + struct { + int heightForRowAtIndex:1; + // reserved for future dataSource delegation + } _dataSourceFlags; +} + +@property (nonatomic,strong) id dataSource; +@property (nonatomic,assign) CGFloat rowHeight; +@property (nonatomic,assign) CCContentSizeUnit rowHeightUnit; +@property (nonatomic,readonly) CGFloat rowHeightInPoints; +@property (nonatomic,assign) NSUInteger selectedRow; + +@property (nonatomic,copy) void(^block)(id sender); +-(void) setTarget:(id)target selector:(SEL)selector; + +- (void) reloadData; + +@end diff --git a/cocos2d-ui/CCTableView.m b/cocos2d-ui/CCTableView.m new file mode 100644 index 0000000..69856d6 --- /dev/null +++ b/cocos2d-ui/CCTableView.m @@ -0,0 +1,408 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2013 Apportable Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#import "CCTableView.h" +#import "CCButton.h" +#import "CCDirector.h" +#import "CGPointExtension.h" +#import + +#pragma mark Helper classes + +@interface CCTableView (Helper) +- (void) updateVisibleRows; +- (void) markVisibleRowsDirty; +- (void) selectedRow:(NSUInteger) row; +@end + +@interface CCTableViewCellHolder : NSObject + +@property (nonatomic,strong) CCTableViewCell* cell; + +@end + +@implementation CCTableViewCellHolder +@end + + +@interface CCTableViewContentNode : CCNode +@end + +@implementation CCTableViewContentNode + +- (void) setPosition:(CGPoint)position +{ + [super setPosition:position]; + + CCTableView* tableView = (CCTableView*)self.parent; + [tableView markVisibleRowsDirty]; + [tableView updateVisibleRows]; +} + +@end + + +#pragma mark CCTableViewCell + +@interface CCTableViewCell (Helper) + +@property (nonatomic,assign) NSUInteger index; + +@end + +@implementation CCTableViewCell + +- (id) init +{ + self = [super init]; + if (!self) return NULL; + + _button = [CCButton buttonWithTitle:NULL]; + _button.contentSizeType = kCCContentSizeTypeNormalized; + _button.preferredSize = CGSizeMake(1, 1); + _button.anchorPoint = ccp(0, 0); + [_button setTarget:self selector:@selector(pressedCell:)]; + [self addChild:_button z:-1]; + + return self; +} + +- (void) pressedCell:(id)sender +{ + [(CCTableView*)(self.parent.parent) selectedRow:self.index]; +} + +- (void) setIndex:(NSUInteger)index +{ + _index = index; +} + +- (NSUInteger) index +{ + return _index; +} + +@end + + +#pragma mark CCTableView + +@implementation CCTableView + +- (id) init +{ + self = [super init]; + if (!self) return self; + + self.contentNode = [CCTableViewContentNode node]; + + self.contentNode.contentSizeType = CCContentSizeTypeMake(kCCContentSizeUnitNormalized, kCCContentSizeUnitPoints); + + _rowHeightUnit = kCCContentSizeUnitPoints; + _rowHeight = 32; + self.horizontalScrollEnabled = NO; + + _visibleRowsDirty = YES; + + return self; +} + +/* +- (id) initWithContentNode:(CCNode *)contentNode +{ + NSAssert(NO, @"Constructor is not supported in CCTableView"); + return NULL; +}*/ + +- (NSRange) visibleRangeForScrollPosition:(CGFloat) scrollPosition +{ + CGFloat positionScale = [CCDirector sharedDirector].positionScaleFactor; + + if ([_dataSource respondsToSelector:@selector(tableView:heightForRowAtIndex:)]) + { + // Rows may have different heights + + NSUInteger startRow = 0; + CGFloat currentRowPos = 0; + + NSUInteger numRows = [_dataSource tableViewNumberOfRows:self]; + + // Find start row + for (NSUInteger currentRow = 0; currentRow < numRows; currentRow++) + { + // Increase row position + CGFloat rowHeight = [_dataSource tableView:self heightForRowAtIndex:currentRow]; + if (_rowHeightUnit == kCCContentSizeUnitScaled) rowHeight *= positionScale; + currentRowPos += rowHeight; + + // Check if we are within visible range + if (currentRowPos >= scrollPosition) + { + startRow = currentRow; + break; + } + } + + // Find end row + NSUInteger numVisibleRows = 1; + CGFloat tableHeight = self.contentSizeInPoints.height; + for (NSUInteger currentRow = startRow; currentRow < numRows; currentRow++) + { + // Check if we are out of visible range + if (currentRowPos > scrollPosition + tableHeight) + { + break; + } + + // Increase row position + CGFloat rowHeight = [_dataSource tableView:self heightForRowAtIndex:currentRow + 1]; + if (_rowHeightUnit == kCCContentSizeUnitScaled) rowHeight *= positionScale; + currentRowPos += rowHeight; + + numVisibleRows ++; + } + + // Handle potential edge case + if ((startRow + numVisibleRows) > numRows) numVisibleRows -= 1; + + return NSMakeRange(startRow, numVisibleRows); + } + else + { + // All rows have the same height + NSUInteger totalNumRows = [_dataSource tableViewNumberOfRows:self]; + + NSUInteger startRow = clampf(floorf(scrollPosition/self.rowHeightInPoints), 0, totalNumRows -1); + NSUInteger numVisibleRows = floorf( self.contentSizeInPoints.height / self.rowHeightInPoints) + 2; + + // Make sure we are in range + if (startRow + numVisibleRows >= totalNumRows) + { + numVisibleRows = totalNumRows - startRow; + } + + return NSMakeRange(startRow, numVisibleRows); + } +} + +- (CGFloat) locationForCellWithIndex:(NSUInteger)idx +{ + if (!_dataSource) return 0; + + CGFloat location = 0; + + if ([_dataSource respondsToSelector:@selector(tableView:heightForRowAtIndex:)]) + { + for (NSUInteger i = 0; i < idx; i++) + { + location += [_dataSource tableView:self heightForRowAtIndex:i]; + } + } + else + { + location = idx * _rowHeight; + } + + if (_rowHeightUnit == kCCContentSizeUnitScaled) + { + location *= [CCDirector sharedDirector].positionScaleFactor; + } + + return location; +} + +- (void) showRowsForRange:(NSRange)range +{ + if (NSEqualRanges(range, _currentlyVisibleRange)) return; + + for (NSUInteger oldIdx = _currentlyVisibleRange.location; oldIdx < NSMaxRange(_currentlyVisibleRange); oldIdx++) + { + if (!NSLocationInRange(oldIdx, range)) + { + CCTableViewCellHolder* holder = [_rows objectAtIndex:oldIdx]; + if (holder) + { + [self.contentNode removeChild:holder.cell cleanup:YES]; + holder.cell = NULL; + } + } + } + + for (NSUInteger newIdx = range.location; newIdx < NSMaxRange(range); newIdx++) + { + if (!NSLocationInRange(newIdx, _currentlyVisibleRange)) + { + CCTableViewCellHolder* holder = [_rows objectAtIndex:newIdx]; + if (!holder.cell) + { + holder.cell = [_dataSource tableView:self nodeForRowAtIndex:newIdx]; + holder.cell.index = newIdx; + holder.cell.position = CGPointMake(0, [self locationForCellWithIndex:newIdx]); + holder.cell.positionType = CCPositionTypeMake(kCCPositionUnitPoints, kCCPositionUnitPoints, kCCPositionReferenceCornerTopLeft); + holder.cell.anchorPoint = CGPointMake(0, 1); + } + + if (holder.cell) + { + [self.contentNode addChild:holder.cell]; + } + } + } + + _currentlyVisibleRange = range; +} + +- (void) markVisibleRowsDirty +{ + _visibleRowsDirty = YES; +} + +- (void) updateVisibleRows +{ + if (_visibleRowsDirty) + { + [self showRowsForRange:[self visibleRangeForScrollPosition:-self.contentNode.position.y]]; + _visibleRowsDirty = NO; + } +} + +- (void) reloadData +{ + [self.contentNode removeAllChildrenWithCleanup:YES]; + + if (!_dataSource) return; + + // Resize the content node + NSUInteger numRows = [_dataSource tableViewNumberOfRows:self]; + CGFloat layerHeight = 0; + + if (_dataSourceFlags.heightForRowAtIndex) + { + for (NSUInteger i = 0; i < numRows; i++) + { + layerHeight += [_dataSource tableView:self heightForRowAtIndex:i]; + } + } + else + { + layerHeight = numRows * _rowHeight; + } + + self.contentNode.contentSize = CGSizeMake(1, layerHeight); + self.contentNode.contentSizeType = CCContentSizeTypeMake(kCCContentSizeUnitNormalized, _rowHeightUnit); + + // Create empty placeholders for all rows + _rows = [NSMutableArray arrayWithCapacity:numRows]; + for (NSUInteger i = 0; i < numRows; i++) + { + [_rows addObject:[[CCTableViewCellHolder alloc] init]]; + } + + // Update scroll position + self.scrollPosition = self.scrollPosition; + + [self markVisibleRowsDirty]; + [self updateVisibleRows]; +} + +- (void) setDataSource:(id)dataSource +{ + if (_dataSource != dataSource) + { + _dataSourceFlags.heightForRowAtIndex = [dataSource respondsToSelector:@selector(tableView:heightForRowAtIndex:)]; + _dataSource = dataSource; + [self reloadData]; + } +} + +- (CGFloat) rowHeightInPoints +{ + if (_rowHeightUnit == kCCContentSizeUnitPoints) return _rowHeight; + else if (_rowHeightUnit == kCCContentSizeUnitScaled) + return _rowHeight * [CCDirector sharedDirector].positionScaleFactor; + else + { + NSAssert(NO, @"Only point and scaled units are supported for row height"); + return 0; + } +} + +- (void) visit +{ + [self updateVisibleRows]; + [super visit]; +} + +- (void) setRowHeight:(CGFloat)rowHeight +{ + if ((int)_rowHeight != (int)rowHeight) + { + _rowHeight = rowHeight; + [self reloadData]; + } +} + +- (void) setContentSize:(CGSize)contentSize +{ + [super setContentSize:contentSize]; + [self markVisibleRowsDirty]; +} + +- (void) setContentSizeType:(CCContentSizeType)contentSizeType +{ + [super setContentSizeType:contentSizeType]; + [self markVisibleRowsDirty]; +} + +- (void) onEnter +{ + [super onEnter]; + [self markVisibleRowsDirty]; +} + +#pragma mark Action handling + +- (void) setTarget:(id)target selector:(SEL)selector +{ + __unsafe_unretained id weakTarget = target; // avoid retain cycle + [self setBlock:^(id sender) { + objc_msgSend(weakTarget, selector, sender); + }]; +} + +- (void) selectedRow:(NSUInteger) row +{ + self.selectedRow = row; + [self triggerAction]; +} + +- (void) triggerAction +{ + if (self.userInteractionEnabled && _block) + { + _block(self); + } +} + +@end diff --git a/cocos2d-ui/cocos2d-ui.h b/cocos2d-ui/cocos2d-ui.h new file mode 100644 index 0000000..aa01df2 --- /dev/null +++ b/cocos2d-ui/cocos2d-ui.h @@ -0,0 +1,29 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2013 Apportable Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +// Cocos2d-UI +#import "CCControl.h" +#import "CCButton.h" +#import "CCScrollView.h" +#import "CCTableView.h" diff --git a/cocos2d/CCAction.h b/cocos2d/CCAction.h new file mode 100644 index 0000000..01abda2 --- /dev/null +++ b/cocos2d/CCAction.h @@ -0,0 +1,195 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2008-2010 Ricardo Quesada + * Copyright (c) 2011 Zynga Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + */ + + +#include +#import + +#import "ccTypes.h" + +enum { + //! Default tag + kCCActionTagInvalid = -1, +}; + +/** Base class for CCAction objects. + */ +@interface CCAction : NSObject +{ + id __unsafe_unretained _originalTarget; + id __unsafe_unretained _target; + NSInteger _tag; +} + +/** The "target". The action will modify the target properties. + The target will be set with the 'startWithTarget' method. + When the 'stop' method is called, target will be set to nil. + The target is 'assigned', it is not 'retained'. + */ +@property (nonatomic,readonly) id target; + +/** The original target, since target can be nil. + Is the target that were used to run the action. Unless you are doing something complex, like CCActionManager, you should NOT call this method. + @since v0.8.2 +*/ +@property (nonatomic,readonly) id originalTarget; + + +/** The action tag. An identifier of the action */ +@property (nonatomic,readwrite,assign) NSInteger tag; + +/** Allocates and initializes the action */ ++(id) action; + +/** Initializes the action */ +-(id) init; + +-(id) copyWithZone: (NSZone*) zone; + +//! return YES if the action has finished +-(BOOL) isDone; +//! called before the action start. It will also set the target. +-(void) startWithTarget:(id)target; +//! called after the action has finished. It will set the 'target' to nil. +//! IMPORTANT: You should never call "[action stop]" manually. Instead, use: "[target stopAction:action];" +-(void) stop; +//! called every frame with its delta time. DON'T override unless you know what you are doing. +-(void) step: (ccTime) dt; +//! called once per frame. time a value between 0 and 1 +//! For example: +//! * 0 means that the action just started +//! * 0.5 means that the action is in the middle +//! * 1 means that the action is over +-(void) update: (ccTime) time; + +@end + +/** Base class actions that do have a finite time duration. + Possible actions: + - An action with a duration of 0 seconds + - An action with a duration of 35.5 seconds + Infinite time actions are valid + */ +@interface CCFiniteTimeAction : CCAction +{ + //! duration in seconds + ccTime _duration; +} +//! duration in seconds of the action +@property (nonatomic,readwrite) ccTime duration; + +/** returns a reversed action */ +- (CCFiniteTimeAction*) reverse; +@end + + +@class CCActionInterval; +/** Repeats an action for ever. + To repeat the an action for a limited number of times use the Repeat action. + @warning This action can't be Sequence-able because it is not an IntervalAction + */ +@interface CCRepeatForever : CCAction +{ + CCActionInterval *_innerAction; +} +/** Inner action */ +@property (nonatomic, readwrite, strong) CCActionInterval *innerAction; + +/** creates the action */ ++(id) actionWithAction: (CCActionInterval*) action; +/** initializes the action */ +-(id) initWithAction: (CCActionInterval*) action; +@end + +/** Changes the speed of an action, making it take longer (speed<1) + or less (speed>1) time. + Useful to simulate 'slow motion' or 'fast forward' effect. + @warning This action can't be Sequence-able because it is not an CCIntervalAction + */ +@interface CCSpeed : CCAction +{ + CCActionInterval *_innerAction; + CGFloat _speed; +} +/** alter the speed of the inner function in runtime */ +@property (nonatomic,readwrite) CGFloat speed; +/** Inner action of CCSpeed */ +@property (nonatomic, readwrite, strong) CCActionInterval *innerAction; + +/** creates the action */ ++(id) actionWithAction: (CCActionInterval*) action speed:(CGFloat)value; +/** initializes the action */ +-(id) initWithAction: (CCActionInterval*) action speed:(CGFloat)value; +@end + +@class CCNode; +/** CCFollow is an action that "follows" a node. + + Eg: + [layer runAction: [CCFollow actionWithTarget:hero]]; + + Instead of using CCCamera as a "follower", use this action instead. + @since v0.99.2 + */ +@interface CCFollow : CCAction +{ + /* node to follow */ + CCNode *_followedNode; + + /* whether camera should be limited to certain area */ + BOOL _boundarySet; + + /* if screen-size is bigger than the boundary - update not needed */ + BOOL _boundaryFullyCovered; + + /* fast access to the screen dimensions */ + CGPoint _halfScreenSize; + CGPoint _fullScreenSize; + + /* world boundaries */ + float _leftBoundary; + float _rightBoundary; + float _topBoundary; + float _bottomBoundary; +} + +/** alter behavior - turn on/off boundary */ +@property (nonatomic,readwrite) BOOL boundarySet; + +/** creates the action with no boundary set */ ++(id) actionWithTarget:(CCNode *)followedNode; + +/** creates the action with a set boundary */ ++(id) actionWithTarget:(CCNode *)followedNode worldBoundary:(CGRect)rect; + +/** initializes the action */ +-(id) initWithTarget:(CCNode *)followedNode; + +/** initializes the action with a set boundary */ +-(id) initWithTarget:(CCNode *)followedNode worldBoundary:(CGRect)rect; + +@end + diff --git a/src/cocos2d/CCAction.m b/cocos2d/CCAction.m similarity index 59% rename from src/cocos2d/CCAction.m rename to cocos2d/CCAction.m index 7202e3c..0cb4d46 100644 --- a/src/cocos2d/CCAction.m +++ b/cocos2d/CCAction.m @@ -38,18 +38,18 @@ #pragma mark Action @implementation CCAction -@synthesize tag = tag_, target = target_, originalTarget = originalTarget_; +@synthesize tag = _tag, target = _target, originalTarget = _originalTarget; +(id) action { - return [[[self alloc] init] autorelease]; + return [[self alloc] init]; } -(id) init { if( (self=[super init]) ) { - originalTarget_ = target_ = nil; - tag_ = kCCActionTagInvalid; + _originalTarget = _target = nil; + _tag = kCCActionTagInvalid; } return self; } @@ -57,29 +57,28 @@ -(id) init -(void) dealloc { CCLOGINFO(@"cocos2d: deallocing %@", self); - [super dealloc]; } -(NSString*) description { - return [NSString stringWithFormat:@"<%@ = %p | Tag = %ld>", [self class], self, (long)tag_]; + return [NSString stringWithFormat:@"<%@ = %p | Tag = %ld>", [self class], self, (long)_tag]; } -(id) copyWithZone: (NSZone*) zone { CCAction *copy = [[[self class] allocWithZone: zone] init]; - copy.tag = tag_; + copy.tag = _tag; return copy; } -(void) startWithTarget:(id)aTarget { - originalTarget_ = target_ = aTarget; + _originalTarget = _target = aTarget; } -(void) stop { - target_ = nil; + _target = nil; } -(BOOL) isDone @@ -104,7 +103,7 @@ -(void) update: (ccTime) time #pragma mark - #pragma mark FiniteTimeAction @implementation CCFiniteTimeAction -@synthesize duration = duration_; +@synthesize duration = _duration; - (CCFiniteTimeAction*) reverse { @@ -120,10 +119,10 @@ - (CCFiniteTimeAction*) reverse #pragma mark - #pragma mark RepeatForever @implementation CCRepeatForever -@synthesize innerAction=innerAction_; +@synthesize innerAction=_innerAction; +(id) actionWithAction: (CCActionInterval*) action { - return [[[self alloc] initWithAction: action] autorelease]; + return [[self alloc] initWithAction: action]; } -(id) initWithAction: (CCActionInterval*) action @@ -136,32 +135,27 @@ -(id) initWithAction: (CCActionInterval*) action -(id) copyWithZone: (NSZone*) zone { - CCAction *copy = [[[self class] allocWithZone: zone] initWithAction:[[innerAction_ copy] autorelease] ]; + CCAction *copy = [[[self class] allocWithZone: zone] initWithAction:[_innerAction copy] ]; return copy; } --(void) dealloc -{ - [innerAction_ release]; - [super dealloc]; -} -(void) startWithTarget:(id)aTarget { [super startWithTarget:aTarget]; - [innerAction_ startWithTarget:target_]; + [_innerAction startWithTarget:_target]; } -(void) step:(ccTime) dt { - [innerAction_ step: dt]; - if( [innerAction_ isDone] ) { - ccTime diff = innerAction_.elapsed - innerAction_.duration; - [innerAction_ startWithTarget:target_]; + [_innerAction step: dt]; + if( [_innerAction isDone] ) { + ccTime diff = _innerAction.elapsed - _innerAction.duration; + [_innerAction startWithTarget:_target]; // to prevent jerk. issue #390, 1247 - [innerAction_ step: 0.0f]; - [innerAction_ step: diff]; + [_innerAction step: 0.0f]; + [_innerAction step: diff]; } } @@ -173,7 +167,7 @@ -(BOOL) isDone - (CCActionInterval *) reverse { - return [CCRepeatForever actionWithAction:[innerAction_ reverse]]; + return [CCRepeatForever actionWithAction:[_innerAction reverse]]; } @end @@ -183,60 +177,55 @@ - (CCActionInterval *) reverse #pragma mark - #pragma mark Speed @implementation CCSpeed -@synthesize speed=speed_; -@synthesize innerAction=innerAction_; +@synthesize speed=_speed; +@synthesize innerAction=_innerAction; -+(id) actionWithAction: (CCActionInterval*) action speed:(float)value ++(id) actionWithAction: (CCActionInterval*) action speed:(CGFloat)value { - return [[[self alloc] initWithAction: action speed:value] autorelease]; + return [[self alloc] initWithAction: action speed:value]; } --(id) initWithAction: (CCActionInterval*) action speed:(float)value +-(id) initWithAction: (CCActionInterval*) action speed:(CGFloat)value { if( (self=[super init]) ) { self.innerAction = action; - speed_ = value; + _speed = value; } return self; } -(id) copyWithZone: (NSZone*) zone { - CCAction *copy = [[[self class] allocWithZone: zone] initWithAction:[[innerAction_ copy] autorelease] speed:speed_]; + CCAction *copy = [[[self class] allocWithZone: zone] initWithAction:[_innerAction copy] speed:_speed]; return copy; } --(void) dealloc -{ - [innerAction_ release]; - [super dealloc]; -} -(void) startWithTarget:(id)aTarget { [super startWithTarget:aTarget]; - [innerAction_ startWithTarget:target_]; + [_innerAction startWithTarget:_target]; } -(void) stop { - [innerAction_ stop]; + [_innerAction stop]; [super stop]; } -(void) step:(ccTime) dt { - [innerAction_ step: dt * speed_]; + [_innerAction step: dt * _speed]; } -(BOOL) isDone { - return [innerAction_ isDone]; + return [_innerAction isDone]; } - (CCActionInterval *) reverse { - return [CCSpeed actionWithAction:[innerAction_ reverse] speed:speed_]; + return [CCSpeed actionWithAction:[_innerAction reverse] speed:_speed]; } @end @@ -247,110 +236,108 @@ - (CCActionInterval *) reverse #pragma mark Follow @implementation CCFollow -@synthesize boundarySet; +@synthesize boundarySet = _boundarySet; +(id) actionWithTarget:(CCNode *) fNode { - return [[[self alloc] initWithTarget:fNode] autorelease]; + return [[self alloc] initWithTarget:fNode]; } +(id) actionWithTarget:(CCNode *) fNode worldBoundary:(CGRect)rect { - return [[[self alloc] initWithTarget:fNode worldBoundary:rect] autorelease]; + return [[self alloc] initWithTarget:fNode worldBoundary:rect]; } -(id) initWithTarget:(CCNode *)fNode { if( (self=[super init]) ) { - followedNode_ = [fNode retain]; - boundarySet = FALSE; - boundaryFullyCovered = FALSE; + _followedNode = fNode; + _boundarySet = FALSE; + _boundaryFullyCovered = FALSE; CGSize s = [[CCDirector sharedDirector] winSize]; - fullScreenSize = CGPointMake(s.width, s.height); - halfScreenSize = ccpMult(fullScreenSize, .5f); + _fullScreenSize = CGPointMake(s.width, s.height); + _halfScreenSize = ccpMult(_fullScreenSize, .5f); } return self; } +#pragma clang diagnostic push COCOS2D +#pragma clang diagnostic ignored "-Wfloat-equal" -(id) initWithTarget:(CCNode *)fNode worldBoundary:(CGRect)rect { if( (self=[super init]) ) { - followedNode_ = [fNode retain]; - boundarySet = TRUE; - boundaryFullyCovered = FALSE; + _followedNode = fNode; + _boundarySet = TRUE; + _boundaryFullyCovered = FALSE; CGSize winSize = [[CCDirector sharedDirector] winSize]; - fullScreenSize = CGPointMake(winSize.width, winSize.height); - halfScreenSize = ccpMult(fullScreenSize, .5f); + _fullScreenSize = CGPointMake(winSize.width, winSize.height); + _halfScreenSize = ccpMult(_fullScreenSize, .5f); - leftBoundary = -((rect.origin.x+rect.size.width) - fullScreenSize.x); - rightBoundary = -rect.origin.x ; - topBoundary = -rect.origin.y; - bottomBoundary = -((rect.origin.y+rect.size.height) - fullScreenSize.y); + _leftBoundary = -((rect.origin.x+rect.size.width) - _fullScreenSize.x); + _rightBoundary = -rect.origin.x ; + _topBoundary = -rect.origin.y; + _bottomBoundary = -((rect.origin.y+rect.size.height) - _fullScreenSize.y); - if(rightBoundary < leftBoundary) + if(_rightBoundary < _leftBoundary) { // screen width is larger than world's boundary width //set both in the middle of the world - rightBoundary = leftBoundary = (leftBoundary + rightBoundary) / 2; + _rightBoundary = _leftBoundary = (_leftBoundary + _rightBoundary) / 2; } - if(topBoundary < bottomBoundary) + if(_topBoundary < _bottomBoundary) { // screen width is larger than world's boundary width //set both in the middle of the world - topBoundary = bottomBoundary = (topBoundary + bottomBoundary) / 2; + _topBoundary = _bottomBoundary = (_topBoundary + _bottomBoundary) / 2; } - if( (topBoundary == bottomBoundary) && (leftBoundary == rightBoundary) ) - boundaryFullyCovered = TRUE; + if( (_topBoundary == _bottomBoundary) && (_leftBoundary == _rightBoundary) ) + _boundaryFullyCovered = TRUE; } return self; } +#pragma clang diagnostic pop COCOS2D -(id) copyWithZone: (NSZone*) zone { CCAction *copy = [[[self class] allocWithZone: zone] init]; - copy.tag = tag_; + copy.tag = _tag; return copy; } -(void) step:(ccTime) dt { - if(boundarySet) + if(_boundarySet) { // whole map fits inside a single screen, no need to modify the position - unless map boundaries are increased - if(boundaryFullyCovered) + if(_boundaryFullyCovered) return; - CGPoint tempPos = ccpSub( halfScreenSize, followedNode_.position); - [target_ setPosition:ccp(clampf(tempPos.x,leftBoundary,rightBoundary), clampf(tempPos.y,bottomBoundary,topBoundary))]; + CGPoint tempPos = ccpSub( _halfScreenSize, _followedNode.position); + [_target setPosition:ccp(clampf(tempPos.x, _leftBoundary, _rightBoundary), clampf(tempPos.y, _bottomBoundary, _topBoundary))]; } else - [target_ setPosition:ccpSub( halfScreenSize, followedNode_.position )]; + [_target setPosition:ccpSub( _halfScreenSize, _followedNode.position )]; } -(BOOL) isDone { - return !followedNode_.isRunning; + return !_followedNode.isRunning; } -(void) stop { - target_ = nil; + _target = nil; [super stop]; } --(void) dealloc -{ - [followedNode_ release]; - [super dealloc]; -} @end diff --git a/cocos2d/CCActionCatmullRom.h b/cocos2d/CCActionCatmullRom.h new file mode 100644 index 0000000..76c86d4 --- /dev/null +++ b/cocos2d/CCActionCatmullRom.h @@ -0,0 +1,151 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2008 Radu Gruian + * + * Copyright (c) 2011 Vit Valentin + * + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * + * Orignal code by Radu Gruian: http://www.codeproject.com/Articles/30838/Overhauser-Catmull-Rom-Splines-for-Camera-Animatio.So + * + * Adapted to cocos2d-x by Vit Valentin + * + * Adapted from cocos2d-x to cocos2d-iphone by Ricardo Quesada + */ + + +#import "CCActionInterval.h" + +/** An Array that contain control points. + Used by CCCardinalSplineTo and (By) and CCCatmullRomTo (and By) actions. + */ +@interface CCPointArray : NSObject +{ + NSMutableArray *_controlPoints; +} + +/** Array that contains the control points */ +@property (nonatomic,readwrite,strong) NSMutableArray *controlPoints; + +/** creates and initializes a Points array with capacity */ + +(id) arrayWithCapacity:(NSUInteger)capacity; + +/** initializes a Catmull Rom config with a capacity hint */ +-(id) initWithCapacity:(NSUInteger)capacity; + +/** appends a control point */ +-(void) addControlPoint:(CGPoint)controlPoint; + +/** inserts a controlPoint at index */ +-(void) insertControlPoint:(CGPoint)controlPoint atIndex:(NSUInteger)index; + +/** replaces an existing controlPoint at index */ +-(void) replaceControlPoint:(CGPoint)controlPoint atIndex:(NSUInteger)index; + +/** get the value of a controlPoint at a given index */ +-(CGPoint) getControlPointAtIndex:(NSUInteger)index; + +/** deletes a control point at a given index */ +-(void) removeControlPointAtIndex:(NSUInteger)index; + +/** returns the number of objects of the control point array */ +-(NSUInteger) count; + +/** returns a new copy of the array reversed. User is responsible for releasing this copy */ +-(CCPointArray*) reverse; + +/** reverse the current control point array inline, without generating a new one */ +-(void) reverseInline; +@end + +/** Cardinal Spline path. + http://en.wikipedia.org/wiki/Cubic_Hermite_spline#Cardinal_spline + */ +@interface CCCardinalSplineTo : CCActionInterval +{ + CCPointArray *_points; + CGFloat _deltaT; + CGFloat _tension; + CGPoint _previousPosition; + CGPoint _accumulatedDiff; +} + +/** Array of control points */ + @property (nonatomic,readwrite,strong) CCPointArray *points; + +/** creates an action with a Cardinal Spline array of points and tension */ ++(id) actionWithDuration:(ccTime)duration points:(CCPointArray*)points tension:(CGFloat)tension; + +/** initializes the action with a duration and an array of points */ +-(id) initWithDuration:(ccTime)duration points:(CCPointArray*)points tension:(CGFloat)tension; + +@end + +/** Cardinal Spline path. + http://en.wikipedia.org/wiki/Cubic_Hermite_spline#Cardinal_spline + */ +@interface CCCardinalSplineBy : CCCardinalSplineTo +{ + CGPoint _startPosition; +} +// XXX: To make BridgeSupport happy +-(void) startWithTarget:(id)target; +@end + +/** An action that moves the target with a CatmullRom curve to a destination point. + A Catmull Rom is a Cardinal Spline with a tension of 0.5. + http://en.wikipedia.org/wiki/Cubic_Hermite_spline#Catmull.E2.80.93Rom_spline + */ +@interface CCCatmullRomTo : CCCardinalSplineTo +{ +} +/** creates an action with a Cardinal Spline array of points and tension */ ++(id) actionWithDuration:(ccTime)dt points:(CCPointArray*)points; + +/** initializes the action with a duration and an array of points */ +-(id) initWithDuration:(ccTime)dt points:(CCPointArray*)points; +@end + +/** An action that moves the target with a CatmullRom curve by a certain distance. + A Catmull Rom is a Cardinal Spline with a tension of 0.5. + http://en.wikipedia.org/wiki/Cubic_Hermite_spline#Catmull.E2.80.93Rom_spline + */ +@interface CCCatmullRomBy : CCCardinalSplineBy +{ +} +/** creates an action with a Cardinal Spline array of points and tension */ ++(id) actionWithDuration:(ccTime)dt points:(CCPointArray*)points; + +/** initializes the action with a duration and an array of points */ +-(id) initWithDuration:(ccTime)dt points:(CCPointArray*)points; +@end + +#ifdef __cplusplus +extern "C" { +#endif + +/** Returns the Cardinal Spline position for a given set of control points, tension and time */ +CGPoint ccCardinalSplineAt( CGPoint p0, CGPoint p1, CGPoint p2, CGPoint p3, CGFloat tension, ccTime t ); + +#ifdef __cplusplus +} +#endif diff --git a/src/cocos2d/CCActionCatmullRom.m b/cocos2d/CCActionCatmullRom.m similarity index 71% rename from src/cocos2d/CCActionCatmullRom.m rename to cocos2d/CCActionCatmullRom.m index 6f0fe25..cff590b 100644 --- a/src/cocos2d/CCActionCatmullRom.m +++ b/cocos2d/CCActionCatmullRom.m @@ -1,363 +1,373 @@ -/* - * cocos2d for iPhone: http://www.cocos2d-iphone.org - * - * Copyright (c) 2008 Radu Gruian - * - * Copyright (c) 2011 Vit Valentin - * - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - * - * - * Orignal code by Radu Gruian: http://www.codeproject.com/Articles/30838/Overhauser-Catmull-Rom-Splines-for-Camera-Animatio.So - * - * Adapted to cocos2d-x by Vit Valentin - * - * Adapted from cocos2d-x to cocos2d-iphone by Ricardo Quesada - */ - - -#import "ccMacros.h" -#import "Support/CGPointExtension.h" -#import "CCActionCatmullRom.h" - -#pragma mark - CCPointArray - -@implementation CCPointArray - -@synthesize controlPoints = controlPoints_; - -+(id) arrayWithCapacity:(NSUInteger)capacity -{ - return [[[self alloc] initWithCapacity:capacity] autorelease]; -} - --(id) init -{ - return [self initWithCapacity:50]; -} - -// designated initializer --(id) initWithCapacity:(NSUInteger)capacity -{ - if( (self=[super init])) { - controlPoints_ = [[NSMutableArray alloc] initWithCapacity:capacity]; - } - - return self; -} - --(id) copyWithZone:(NSZone *)zone -{ - NSMutableArray *newArray = [controlPoints_ mutableCopy]; - CCPointArray *points = [[[self class] allocWithZone:zone] initWithCapacity:10]; - points.controlPoints = newArray; - [newArray release]; - - return points; -} - --(void) dealloc -{ - [controlPoints_ release]; - - [super dealloc]; -} - --(void) addControlPoint:(CGPoint)controlPoint -{ -#ifdef __CC_PLATFORM_MAC - NSValue *value = [NSValue valueWithPoint:NSPointFromCGPoint(controlPoint)]; -#elif defined(__CC_PLATFORM_IOS) - NSValue *value = [NSValue valueWithCGPoint:controlPoint]; -#endif - - [controlPoints_ addObject:value]; -} - --(void) insertControlPoint:(CGPoint)controlPoint atIndex:(NSUInteger)index -{ -#ifdef __CC_PLATFORM_MAC - NSValue *value = [NSValue valueWithPoint:NSPointFromCGPoint(controlPoint)]; -#elif defined(__CC_PLATFORM_IOS) - NSValue *value = [NSValue valueWithCGPoint:controlPoint]; -#endif - - [controlPoints_ insertObject:value atIndex:index]; - -} - --(CGPoint) getControlPointAtIndex:(NSInteger)index -{ - index = MIN([controlPoints_ count]-1, MAX(index, 0)); - - NSValue *value = [controlPoints_ objectAtIndex:index]; - -#ifdef __CC_PLATFORM_MAC - CGPoint point = NSPointToCGPoint([value pointValue]); -#elif defined(__CC_PLATFORM_IOS) - CGPoint point = [value CGPointValue]; -#endif - - return point; -} - --(void) replaceControlPoint:(CGPoint)controlPoint atIndex:(NSUInteger)index -{ -#ifdef __CC_PLATFORM_MAC - NSValue *value = [NSValue valueWithPoint:NSPointFromCGPoint(controlPoint)]; -#elif defined(__CC_PLATFORM_IOS) - NSValue *value = [NSValue valueWithCGPoint:controlPoint]; -#endif - - [controlPoints_ replaceObjectAtIndex:index withObject:value]; -} - --(void) removeControlPointAtIndex:(NSUInteger)index -{ - [controlPoints_ removeObjectAtIndex:index]; -} - --(NSUInteger) count -{ - return [controlPoints_ count]; -} - --(CCPointArray*) reverse -{ - NSMutableArray *newArray = [[NSMutableArray alloc] initWithCapacity:[controlPoints_ count]]; - NSEnumerator *enumerator = [controlPoints_ reverseObjectEnumerator]; - for (id element in enumerator) - [newArray addObject:element]; - - CCPointArray *config = [[[self class] alloc] initWithCapacity:0]; - config.controlPoints = newArray; - - [newArray release]; - - return [config autorelease]; -} - --(void) reverseInline -{ - NSUInteger l = [controlPoints_ count]; - for( NSUInteger i=0; i 0, @"Invalid configuration. It must at least have one control point"); - - if( (self=[super initWithDuration:duration]) ) - { - self.points = points; - tension_ = tension; - } - - return self; -} - -- (void)dealloc -{ - [points_ release]; - [super dealloc]; -} - --(void) startWithTarget:(id)target -{ - [super startWithTarget:target]; - - deltaT_ = (CGFloat) 1 / [points_ count]; -} - --(id) copyWithZone: (NSZone*) zone -{ - CCAction *copy = [[[self class] allocWithZone: zone] initWithDuration:[self duration] points:points_ tension:tension_]; - return copy; -} - --(void) update:(ccTime) dt -{ - NSUInteger p; - CGFloat lt; - - // border - if( dt == 1 ) { - p = [points_ count] - 1; - lt = 1; - } else { - p = dt / deltaT_; - lt = (dt - deltaT_ * (CGFloat)p) / deltaT_; - } - - // Interpolate - CGPoint pp0 = [points_ getControlPointAtIndex:p-1]; - CGPoint pp1 = [points_ getControlPointAtIndex:p+0]; - CGPoint pp2 = [points_ getControlPointAtIndex:p+1]; - CGPoint pp3 = [points_ getControlPointAtIndex:p+2]; - - CGPoint newPos = ccCardinalSplineAt( pp0, pp1, pp2, pp3, tension_, lt ); - - [self updatePosition:newPos]; -} - --(void) updatePosition:(CGPoint)newPos -{ - [target_ setPosition:newPos]; -} - --(CCActionInterval*) reverse -{ - CCPointArray *reverse = [points_ reverse]; - - return [[self class] actionWithDuration:duration_ points:reverse tension:tension_]; -} -@end - -#pragma mark - CCCardinalSplineBy - -@implementation CCCardinalSplineBy - --(void) startWithTarget:(id)target -{ - [super startWithTarget:target]; - - startPosition_ = [(CCNode*)target position]; -} - --(void) updatePosition:(CGPoint)newPos -{ - [target_ setPosition:ccpAdd(newPos, startPosition_)]; -} - --(CCActionInterval*) reverse -{ - CCPointArray *copyConfig = [points_ copy]; - - // - // convert "absolutes" to "diffs" - // - CGPoint p = [copyConfig getControlPointAtIndex:0]; - for( NSUInteger i=1; i < [copyConfig count];i++ ) { - - CGPoint current = [copyConfig getControlPointAtIndex:i]; - CGPoint diff = ccpSub(current,p); - [copyConfig replaceControlPoint:diff atIndex:i]; - - p = current; - } - - - // convert to "diffs" to "reverse absolute" - - CCPointArray *reverse = [copyConfig reverse]; - [copyConfig release]; - - // 1st element (which should be 0,0) should be here too - p = [reverse getControlPointAtIndex: [reverse count]-1]; - [reverse removeControlPointAtIndex:[reverse count]-1]; - - p = ccpNeg(p); - [reverse insertControlPoint:p atIndex:0]; - - for( NSUInteger i=1; i < [reverse count];i++ ) { - - CGPoint current = [reverse getControlPointAtIndex:i]; - current = ccpNeg(current); - CGPoint abs = ccpAdd( current, p); - [reverse replaceControlPoint:abs atIndex:i]; - - p = abs; - } - - return [[self class] actionWithDuration:duration_ points:reverse tension:tension_]; -} -@end - -@implementation CCCatmullRomTo -+(id) actionWithDuration:(ccTime)dt points:(CCPointArray *)points -{ - return [[[self alloc] initWithDuration:dt points:points] autorelease]; -} - --(id) initWithDuration:(ccTime)dt points:(CCPointArray *)points -{ - if( (self=[super initWithDuration:dt points:points tension:0.5f]) ) { - - } - - return self; -} -@end - -@implementation CCCatmullRomBy -+(id) actionWithDuration:(ccTime)dt points:(CCPointArray *)points -{ - return [[[self alloc] initWithDuration:dt points:points] autorelease]; -} - --(id) initWithDuration:(ccTime)dt points:(CCPointArray *)points -{ - if( (self=[super initWithDuration:dt points:points tension:0.5f]) ) { - - } - - return self; -} -@end +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2008 Radu Gruian + * + * Copyright (c) 2011 Vit Valentin + * + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * + * Orignal code by Radu Gruian: http://www.codeproject.com/Articles/30838/Overhauser-Catmull-Rom-Splines-for-Camera-Animatio.So + * + * Adapted to cocos2d-x by Vit Valentin + * + * Adapted from cocos2d-x to cocos2d-iphone by Ricardo Quesada + */ + + +#import "ccMacros.h" +#import "Support/CGPointExtension.h" +#import "CCActionCatmullRom.h" + +#pragma mark - CCPointArray + +@implementation CCPointArray + +@synthesize controlPoints = _controlPoints; + ++(id) arrayWithCapacity:(NSUInteger)capacity +{ + return [[self alloc] initWithCapacity:capacity]; +} + +-(id) init +{ + return [self initWithCapacity:50]; +} + +// designated initializer +-(id) initWithCapacity:(NSUInteger)capacity +{ + if( (self=[super init])) { + _controlPoints = [[NSMutableArray alloc] initWithCapacity:capacity]; + } + + return self; +} + +-(id) copyWithZone:(NSZone *)zone +{ + NSMutableArray *newArray = [_controlPoints mutableCopy]; + CCPointArray *points = [[[self class] allocWithZone:zone] initWithCapacity:10]; + points.controlPoints = newArray; + + return points; +} + + +-(void) addControlPoint:(CGPoint)controlPoint +{ +#ifdef __CC_PLATFORM_MAC + NSValue *value = [NSValue valueWithPoint:NSPointFromCGPoint(controlPoint)]; +#elif defined(__CC_PLATFORM_IOS) + NSValue *value = [NSValue valueWithCGPoint:controlPoint]; +#endif + + [_controlPoints addObject:value]; +} + +-(void) insertControlPoint:(CGPoint)controlPoint atIndex:(NSUInteger)index +{ +#ifdef __CC_PLATFORM_MAC + NSValue *value = [NSValue valueWithPoint:NSPointFromCGPoint(controlPoint)]; +#elif defined(__CC_PLATFORM_IOS) + NSValue *value = [NSValue valueWithCGPoint:controlPoint]; +#endif + + [_controlPoints insertObject:value atIndex:index]; + +} + +-(CGPoint) getControlPointAtIndex:(NSUInteger)index +{ + index = MIN([_controlPoints count]-1, MAX(index, (NSUInteger)0)); + + NSValue *value = [_controlPoints objectAtIndex:index]; + +#ifdef __CC_PLATFORM_MAC + CGPoint point = NSPointToCGPoint([value pointValue]); +#elif defined(__CC_PLATFORM_IOS) + CGPoint point = [value CGPointValue]; +#endif + + return point; +} + +-(void) replaceControlPoint:(CGPoint)controlPoint atIndex:(NSUInteger)index +{ +#ifdef __CC_PLATFORM_MAC + NSValue *value = [NSValue valueWithPoint:NSPointFromCGPoint(controlPoint)]; +#elif defined(__CC_PLATFORM_IOS) + NSValue *value = [NSValue valueWithCGPoint:controlPoint]; +#endif + + [_controlPoints replaceObjectAtIndex:index withObject:value]; +} + +-(void) removeControlPointAtIndex:(NSUInteger)index +{ + [_controlPoints removeObjectAtIndex:index]; +} + +-(NSUInteger) count +{ + return [_controlPoints count]; +} + +-(CCPointArray*) reverse +{ + NSMutableArray *newArray = [[NSMutableArray alloc] initWithCapacity:[_controlPoints count]]; + NSEnumerator *enumerator = [_controlPoints reverseObjectEnumerator]; + for (id element in enumerator) + [newArray addObject:element]; + + CCPointArray *config = [[[self class] alloc] initWithCapacity:0]; + config.controlPoints = newArray; + + + return config; +} + +-(void) reverseInline +{ + NSUInteger l = [_controlPoints count]; + for( NSUInteger i=0; i 0, @"Invalid configuration. It must at least have one control point"); + + if( (self=[super initWithDuration:duration]) ) + { + self.points = points; + _tension = tension; + } + + return self; +} + + +-(void) startWithTarget:(id)target +{ + [super startWithTarget:target]; + +// _deltaT = (CGFloat) 1 / [_points count]; + + // Issue #1441 + _deltaT = (CGFloat) 1 / ([_points count]-1); + + _previousPosition = [(CCNode*)target position]; + _accumulatedDiff = CGPointZero; +} + +-(id) copyWithZone: (NSZone*) zone +{ + CCAction *copy = [[[self class] allocWithZone: zone] initWithDuration:[self duration] points:_points tension:_tension]; + return copy; +} + +#pragma clang diagnostic push COCOS2D +#pragma clang diagnostic ignored "-Wfloat-equal" +-(void) update:(ccTime)dt +{ + NSUInteger p; + CGFloat lt; + + // eg. + // p..p..p..p..p..p..p + // 1..2..3..4..5..6..7 + // want p to be 1, 2, 3, 4, 5, 6 + if (dt == 1) { + p = [_points count] - 1; + lt = 1; + } else { + p = dt / _deltaT; + lt = (dt - _deltaT * (CGFloat)p) / _deltaT; + } + + // Interpolate + CGPoint pp0 = [_points getControlPointAtIndex:p-1]; + CGPoint pp1 = [_points getControlPointAtIndex:p+0]; + CGPoint pp2 = [_points getControlPointAtIndex:p+1]; + CGPoint pp3 = [_points getControlPointAtIndex:p+2]; + + CGPoint newPos = ccCardinalSplineAt( pp0, pp1, pp2, pp3, _tension, lt ); + +#if CC_ENABLE_STACKABLE_ACTIONS + CCNode *node = (CCNode*)_target; + CGPoint diff = ccpSub( node.position, _previousPosition); + if( diff.x !=0 || diff.y != 0 ) { + _accumulatedDiff = ccpAdd( _accumulatedDiff, diff); + newPos = ccpAdd( newPos, _accumulatedDiff); + } +#endif + + [self updatePosition:newPos]; +} +#pragma clang diagnostic pop COCOS2D + +-(void) updatePosition:(CGPoint)newPos +{ + [_target setPosition:newPos]; + _previousPosition = newPos; +} + +-(CCActionInterval*) reverse +{ + CCPointArray *reverse = [_points reverse]; + + return [[self class] actionWithDuration:_duration points:reverse tension:_tension]; +} +@end + +#pragma mark - CCCardinalSplineBy + +@implementation CCCardinalSplineBy + +-(void) startWithTarget:(id)target +{ + [super startWithTarget:target]; + + _startPosition = [(CCNode*)target position]; +} + +-(void) updatePosition:(CGPoint)newPos +{ + CGPoint p = ccpAdd(newPos, _startPosition); + [_target setPosition:p]; + _previousPosition = p; +} + +-(CCActionInterval*) reverse +{ + CCPointArray *copyConfig = [_points copy]; + + // + // convert "absolutes" to "diffs" + // + CGPoint p = [copyConfig getControlPointAtIndex:0]; + for( NSUInteger i=1; i < [copyConfig count];i++ ) { + + CGPoint current = [copyConfig getControlPointAtIndex:i]; + CGPoint diff = ccpSub(current,p); + [copyConfig replaceControlPoint:diff atIndex:i]; + + p = current; + } + + + // convert to "diffs" to "reverse absolute" + + CCPointArray *reverse = [copyConfig reverse]; + + // 1st element (which should be 0,0) should be here too + p = [reverse getControlPointAtIndex: [reverse count]-1]; + [reverse removeControlPointAtIndex:[reverse count]-1]; + + p = ccpNeg(p); + [reverse insertControlPoint:p atIndex:0]; + + for( NSUInteger i=1; i < [reverse count];i++ ) { + + CGPoint current = [reverse getControlPointAtIndex:i]; + current = ccpNeg(current); + CGPoint abs = ccpAdd( current, p); + [reverse replaceControlPoint:abs atIndex:i]; + + p = abs; + } + + return [[self class] actionWithDuration:_duration points:reverse tension:_tension]; +} +@end + +@implementation CCCatmullRomTo ++(id) actionWithDuration:(ccTime)dt points:(CCPointArray *)points +{ + return [[self alloc] initWithDuration:dt points:points]; +} + +-(id) initWithDuration:(ccTime)dt points:(CCPointArray *)points +{ + if( (self=[super initWithDuration:dt points:points tension:0.5f]) ) { + + } + + return self; +} +@end + +@implementation CCCatmullRomBy ++(id) actionWithDuration:(ccTime)dt points:(CCPointArray *)points +{ + return [[self alloc] initWithDuration:dt points:points]; +} + +-(id) initWithDuration:(ccTime)dt points:(CCPointArray *)points +{ + if( (self=[super initWithDuration:dt points:points tension:0.5f]) ) { + + } + + return self; +} +@end diff --git a/cocos2d/CCActionEase.h b/cocos2d/CCActionEase.h new file mode 100644 index 0000000..7719b3e --- /dev/null +++ b/cocos2d/CCActionEase.h @@ -0,0 +1,292 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2008-2009 Jason Booth + * Copyright (c) 2013 Nader Eloshaiker + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + */ + + +#import "CCActionInterval.h" + +/** Base class for Easing actions + */ +@interface CCActionEase : CCActionInterval +{ + CCActionInterval *_inner; +} +/** The inner action */ +@property (nonatomic, readonly) CCActionInterval *inner; + +/** creates the action */ ++(id) actionWithAction: (CCActionInterval*) action; +/** initializes the action */ +-(id) initWithAction: (CCActionInterval*) action; +@end + +/** Base class for Easing actions with rate parameters + */ +@interface CCEaseRateAction : CCActionEase +{ + float _rate; +} +/** rate value for the actions */ +@property (nonatomic,readwrite,assign) float rate; +/** Creates the action with the inner action and the rate parameter */ ++(id) actionWithAction: (CCActionInterval*) action rate:(float)rate; +/** Initializes the action with the inner action and the rate parameter */ +-(id) initWithAction: (CCActionInterval*) action rate:(float)rate; +@end + +/** CCEaseIn action with a rate + */ +@interface CCEaseIn : CCEaseRateAction +{} +// Needed for BridgeSupport +-(void) update: (ccTime) t; +@end + +/** CCEaseOut action with a rate + */ +@interface CCEaseOut : CCEaseRateAction +{} +// Needed for BridgeSupport +-(void) update: (ccTime) t; +@end + +/** CCEaseInOut action with a rate + */ +@interface CCEaseInOut : CCEaseRateAction +{} +// Needed for BridgeSupport +-(void) update: (ccTime) t; +@end + +/** CCEase Exponential In + */ +@interface CCEaseExponentialIn : CCActionEase +{} +// Needed for BridgeSupport +-(void) update: (ccTime) t; +@end + +/** Ease Exponential Out + */ +@interface CCEaseExponentialOut : CCActionEase +{} +// Needed for BridgeSupport +-(void) update: (ccTime) t; +@end + +/** Ease Exponential InOut + */ +@interface CCEaseExponentialInOut : CCActionEase +{} +// Needed for BridgeSupport +-(void) update: (ccTime) t; +@end + +/** CCEase Polynomial abstract class + @since v2.1 + */ +@interface CCEasePolynomial : CCActionEase { +@protected + NSUInteger _polynomialOrder; + CGFloat _intersetValue; //Used for InOut mid point time calculation + BOOL _hasInflection; //odd numbered polynomial orders will display a point of inflection where the curve will invert +} +/** Used to determine the steepness of the timing curve. + As the value increases, so does the steepness/rate of the curve. + Default value is 6, gives a similar curve to EaseExponential. + Values less than 6, produces a softer ease action. + Values greater than 6, produces a more pronounced action. + @warning Value must be greater than 1 + */ +@property (nonatomic, readwrite, assign) NSUInteger polynomialOrder; +@end + +/** CCEase Polynomial In + @since v2.1 + */ +@interface CCEasePolynomialIn : CCEasePolynomial +{} +// Needed for BridgeSupport +-(void) update: (ccTime) t; +@end + +/** Ease Polynomial Out + @since v2.1 + */ +@interface CCEasePolynomialOut : CCEasePolynomial +{} +// Needed for BridgeSupport +-(void) update: (ccTime) t; +@end + +/** Ease Polynomial InOut + @since v2.1 + */ +@interface CCEasePolynomialInOut : CCEasePolynomial +{} +// Needed for BridgeSupport +-(void) update: (ccTime) t; +@end + +/** Ease Sine In + */ +@interface CCEaseSineIn : CCActionEase +{} +// Needed for BridgeSupport +-(void) update: (ccTime) t; +@end + +/** Ease Sine Out + */ +@interface CCEaseSineOut : CCActionEase +{} +// Needed for BridgeSupport +-(void) update: (ccTime) t; +@end + +/** Ease Sine InOut + */ +@interface CCEaseSineInOut : CCActionEase +{} +// Needed for BridgeSupport +-(void) update: (ccTime) t; +@end + +/** Ease Elastic abstract class + @since v0.8.2 + */ +@interface CCEaseElastic : CCActionEase +{ + float _period; +} + +/** period of the wave in radians. default is 0.3 */ +@property (nonatomic,readwrite) float period; + +/** Creates the action with the inner action and the period in radians (default is 0.3) */ ++(id) actionWithAction: (CCActionInterval*) action period:(float)period; +/** Initializes the action with the inner action and the period in radians (default is 0.3) */ +-(id) initWithAction: (CCActionInterval*) action period:(float)period; +@end + +/** Ease Elastic In action. + @warning This action doesn't use a bijective function. Actions like Sequence might have an unexpected result when used with this action. + @since v0.8.2 + */ +@interface CCEaseElasticIn : CCEaseElastic +{} +// Needed for BridgeSupport +-(void) update: (ccTime) t; +@end + +/** Ease Elastic Out action. + @warning This action doesn't use a bijective function. Actions like Sequence might have an unexpected result when used with this action. + @since v0.8.2 + */ +@interface CCEaseElasticOut : CCEaseElastic +{} +// Needed for BridgeSupport +-(void) update: (ccTime) t; +@end + +/** Ease Elastic InOut action. + @warning This action doesn't use a bijective function. Actions like Sequence might have an unexpected result when used with this action. + @since v0.8.2 + */ +@interface CCEaseElasticInOut : CCEaseElastic +{} +// Needed for BridgeSupport +-(void) update: (ccTime) t; +@end + +/** CCEaseBounce abstract class. + @since v0.8.2 +*/ +@interface CCEaseBounce : CCActionEase +{} +// Needed for BridgeSupport +-(ccTime) bounceTime:(ccTime) t; +@end + +/** CCEaseBounceIn action. + @warning This action doesn't use a bijective function. Actions like Sequence might have an unexpected result when used with this action. + @since v0.8.2 +*/ +@interface CCEaseBounceIn : CCEaseBounce +{} +// Needed for BridgeSupport +-(void) update: (ccTime) t; +@end + +/** EaseBounceOut action. + @warning This action doesn't use a bijective function. Actions like Sequence might have an unexpected result when used with this action. + @since v0.8.2 + */ +@interface CCEaseBounceOut : CCEaseBounce +{} +// Needed for BridgeSupport +-(void) update: (ccTime) t; +@end + +/** CCEaseBounceInOut action. + @warning This action doesn't use a bijective function. Actions like Sequence might have an unexpected result when used with this action. + @since v0.8.2 + */ +@interface CCEaseBounceInOut : CCEaseBounce +{} +// Needed for BridgeSupport +-(void) update: (ccTime) t; +@end + +/** CCEaseBackIn action. + @warning This action doesn't use a bijective function. Actions like Sequence might have an unexpected result when used with this action. + @since v0.8.2 + */ +@interface CCEaseBackIn : CCActionEase +{} +// Needed for BridgeSupport +-(void) update: (ccTime) t; +@end + +/** CCEaseBackOut action. + @warning This action doesn't use a bijective function. Actions like Sequence might have an unexpected result when used with this action. + @since v0.8.2 + */ +@interface CCEaseBackOut : CCActionEase +{} +// Needed for BridgeSupport +-(void) update: (ccTime) t; +@end + +/** CCEaseBackInOut action. + @warning This action doesn't use a bijective function. Actions like Sequence might have an unexpected result when used with this action. + @since v0.8.2 + */ +@interface CCEaseBackInOut : CCActionEase +{} +// Needed for BridgeSupport +-(void) update: (ccTime) t; +@end + diff --git a/src/cocos2d/CCActionEase.m b/cocos2d/CCActionEase.m similarity index 52% rename from src/cocos2d/CCActionEase.m rename to cocos2d/CCActionEase.m index 25b1cf0..118baf5 100644 --- a/src/cocos2d/CCActionEase.m +++ b/cocos2d/CCActionEase.m @@ -2,6 +2,7 @@ * cocos2d for iPhone: http://www.cocos2d-iphone.org * * Copyright (c) 2008-2009 Jason Booth + * Copyright (c) 2013 Nader Eloshaiker * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -44,9 +45,11 @@ // @implementation CCActionEase +@synthesize inner=_inner; + +(id) actionWithAction: (CCActionInterval*) action { - return [[[self alloc] initWithAction: action] autorelease ]; + return [[self alloc] initWithAction: action]; } -(id) initWithAction: (CCActionInterval*) action @@ -54,43 +57,38 @@ -(id) initWithAction: (CCActionInterval*) action NSAssert( action!=nil, @"Ease: arguments must be non-nil"); if( (self=[super initWithDuration: action.duration]) ) - other = [action retain]; + _inner = action; return self; } -(id) copyWithZone: (NSZone*) zone { - CCAction *copy = [[[self class] allocWithZone:zone] initWithAction:[[other copy] autorelease]]; + CCAction *copy = [[[self class] allocWithZone:zone] initWithAction:[_inner copy]]; return copy; } --(void) dealloc -{ - [other release]; - [super dealloc]; -} -(void) startWithTarget:(id)aTarget { [super startWithTarget:aTarget]; - [other startWithTarget:target_]; + [_inner startWithTarget:_target]; } -(void) stop { - [other stop]; + [_inner stop]; [super stop]; } -(void) update: (ccTime) t { - [other update: t]; + [_inner update: t]; } -(CCActionInterval*) reverse { - return [[self class] actionWithAction: [other reverse]]; + return [[self class] actionWithAction: [_inner reverse]]; } @end @@ -102,34 +100,30 @@ -(CCActionInterval*) reverse // EaseRateAction // @implementation CCEaseRateAction -@synthesize rate; -+(id) actionWithAction: (CCActionInterval*) action rate:(float)aRate +@synthesize rate=_rate; ++(id) actionWithAction: (CCActionInterval*) action rate:(float)rate { - return [[[self alloc] initWithAction: action rate:aRate] autorelease ]; + return [[self alloc] initWithAction: action rate:rate]; } --(id) initWithAction: (CCActionInterval*) action rate:(float)aRate +-(id) initWithAction: (CCActionInterval*) action rate:(float)rate { if( (self=[super initWithAction:action ]) ) - self.rate = aRate; + self.rate = rate; return self; } -(id) copyWithZone: (NSZone*) zone { - CCAction *copy = [[[self class] allocWithZone:zone] initWithAction:[[other copy] autorelease] rate:rate]; + CCAction *copy = [[[self class] allocWithZone:zone] initWithAction:[_inner copy] rate:_rate]; return copy; } --(void) dealloc -{ - [super dealloc]; -} -(CCActionInterval*) reverse { - return [[self class] actionWithAction: [other reverse] rate:1/rate]; + return [[self class] actionWithAction: [_inner reverse] rate:1/_rate]; } @end @@ -139,7 +133,7 @@ -(CCActionInterval*) reverse @implementation CCEaseIn -(void) update: (ccTime) t { - [other update: powf(t,rate)]; + [_inner update: powf(t,_rate)]; } @end @@ -149,7 +143,7 @@ -(void) update: (ccTime) t @implementation CCEaseOut -(void) update: (ccTime) t { - [other update: powf(t,1/rate)]; + [_inner update: powf(t,1/_rate)]; } @end @@ -161,17 +155,17 @@ -(void) update: (ccTime) t { t *= 2; if (t < 1) { - [other update: 0.5f * powf (t, rate)]; + [_inner update: 0.5f * powf (t, _rate)]; } else { - [other update: 1.0f - 0.5f * powf(2-t, rate)]; + [_inner update: 1.0f - 0.5f * powf(2-t, _rate)]; } } // InOut and OutIn are symmetrical -(CCActionInterval*) reverse { - return [[self class] actionWithAction: [other reverse] rate:rate]; + return [[self class] actionWithAction: [_inner reverse] rate:_rate]; } @end @@ -179,18 +173,20 @@ -(CCActionInterval*) reverse #pragma mark - #pragma mark EaseExponential +#pragma clang diagnostic push COCOS2D +#pragma clang diagnostic ignored "-Wfloat-equal" // // EaseExponentialIn // @implementation CCEaseExponentialIn -(void) update: (ccTime) t { - [other update: (t==0) ? 0 : powf(2, 10 * (t/1 - 1)) - 1 * 0.001f]; + [_inner update: (t==0) ? 0 : powf(2, 10 * (t/1 - 1)) /* - 1 * 0.001f */]; } - (CCActionInterval*) reverse { - return [CCEaseExponentialOut actionWithAction: [other reverse]]; + return [CCEaseExponentialOut actionWithAction: [_inner reverse]]; } @end @@ -200,12 +196,12 @@ - (CCActionInterval*) reverse @implementation CCEaseExponentialOut -(void) update: (ccTime) t { - [other update: (t==1) ? 1 : (-powf(2, -10 * t/1) + 1)]; + [_inner update: (t==1) ? 1 : (-powf(2, -10 * t/1) + 1)]; } - (CCActionInterval*) reverse { - return [CCEaseExponentialIn actionWithAction: [other reverse]]; + return [CCEaseExponentialIn actionWithAction: [_inner reverse]]; } @end @@ -215,17 +211,127 @@ - (CCActionInterval*) reverse @implementation CCEaseExponentialInOut -(void) update: (ccTime) t { - t /= 0.5f; - if (t < 1) - t = 0.5f * powf(2, 10 * (t - 1)); - else - t = 0.5f * (-powf(2, -10 * (t -1) ) + 2); + // prevents rouding errors + if( t != 1 && t != 0 ) { + t *= 2; + if (t < 1) + t = 0.5f * powf(2, 10 * (t - 1)); + else + t = 0.5f * (-powf(2, -10 * (t -1) ) + 2); + } - [other update:t]; + [_inner update:t]; } @end +#pragma mark - +#pragma mark EasePolynomial + +// +// EasePolynomial +// +#define kDefaultPolynomial 6 +@implementation CCEasePolynomial + +@dynamic polynomialOrder; + ++(id) actionWithAction: (CCActionInterval*) action +{ + return [[self alloc] initWithAction: action]; +} + +-(id) initWithAction: (CCActionInterval*) action +{ + NSAssert( action!=nil, @"Ease: arguments must be non-nil"); + + if ((self = [super initWithAction: action])) { + _polynomialOrder = kDefaultPolynomial; + _hasInflection = FALSE; + _intersetValue = 1.78179743628068f; + } + + return self; +} + +-(void)setPolynomialOrder:(NSUInteger)val { + NSAssert(val>1, @"Polynomial order must be greater than 1"); + _polynomialOrder = val; + _hasInflection = (val % 2 > 0); + _intersetValue = powf(0.5f, 1.0f / val) / 0.5f; +} + +-(NSUInteger)polynomialOrder { + return _polynomialOrder; +} +@end + +// +// EasePolynomialIn +// +@implementation CCEasePolynomialIn +-(void) update: (ccTime) t +{ + [_inner update: powf(t, _polynomialOrder)]; +} + +- (CCActionInterval*) reverse +{ + CCEasePolynomialOut *action = [CCEasePolynomialOut actionWithAction: [_inner reverse]]; + if (_polynomialOrder != kDefaultPolynomial) { + action.polynomialOrder = _polynomialOrder; + } + + return action; +} +@end + +// +// EasePolynomialOut +// +@implementation CCEasePolynomialOut +-(void) update: (ccTime) t +{ + if (_hasInflection) { + t = powf(t-1.0f, _polynomialOrder) + 1.0f; + } else { + t = -powf(t-1.0f, _polynomialOrder) + 1.0f; + } + + [_inner update:t]; +} + +- (CCActionInterval*) reverse +{ + CCEasePolynomialIn *action = [CCEasePolynomialIn actionWithAction: [_inner reverse]]; + if (_polynomialOrder != kDefaultPolynomial) { + action.polynomialOrder = _polynomialOrder; + } + + return action; +} +@end + +// +// EasePolynomialInOut +// +@implementation CCEasePolynomialInOut +-(void) update: (ccTime) t +{ + if (t < 0.5f) { + t = powf(t*_intersetValue, _polynomialOrder); + } else { + if (_hasInflection) { + t = powf((t - 1.0f)*_intersetValue, _polynomialOrder) + 1.0f; + } else { + t = -powf((t - 1.0f)*_intersetValue, _polynomialOrder) + 1.0f; + } + } + + [_inner update:t]; +} +@end + #pragma mark - #pragma mark EaseSin actions @@ -235,12 +341,12 @@ -(void) update: (ccTime) t @implementation CCEaseSineIn -(void) update: (ccTime) t { - [other update:-1*cosf(t * (float)M_PI_2) +1]; + [_inner update:-1*cosf(t * (float)M_PI_2) +1]; } - (CCActionInterval*) reverse { - return [CCEaseSineOut actionWithAction: [other reverse]]; + return [CCEaseSineOut actionWithAction: [_inner reverse]]; } @end @@ -250,12 +356,12 @@ - (CCActionInterval*) reverse @implementation CCEaseSineOut -(void) update: (ccTime) t { - [other update:sinf(t * (float)M_PI_2)]; + [_inner update:sinf(t * (float)M_PI_2)]; } - (CCActionInterval*) reverse { - return [CCEaseSineIn actionWithAction: [other reverse]]; + return [CCEaseSineIn actionWithAction: [_inner reverse]]; } @end @@ -265,7 +371,7 @@ - (CCActionInterval*) reverse @implementation CCEaseSineInOut -(void) update: (ccTime) t { - [other update:-0.5f*(cosf( (float)M_PI*t) - 1)]; + [_inner update:-0.5f*(cosf( (float)M_PI*t) - 1)]; } @end @@ -277,16 +383,16 @@ -(void) update: (ccTime) t // @implementation CCEaseElastic -@synthesize period = period_; +@synthesize period = _period; +(id) actionWithAction: (CCActionInterval*) action { - return [[[self alloc] initWithAction:action period:0.3f] autorelease]; + return [[self alloc] initWithAction:action period:0.3f]; } +(id) actionWithAction: (CCActionInterval*) action period:(float)period { - return [[[self alloc] initWithAction:action period:period] autorelease]; + return [[self alloc] initWithAction:action period:period]; } -(id) initWithAction: (CCActionInterval*) action @@ -297,14 +403,14 @@ -(id) initWithAction: (CCActionInterval*) action -(id) initWithAction: (CCActionInterval*) action period:(float)period { if( (self=[super initWithAction:action]) ) - period_ = period; + _period = period; return self; } -(id) copyWithZone: (NSZone*) zone { - CCAction *copy = [[[self class] allocWithZone:zone] initWithAction:[[other copy] autorelease] period:period_]; + CCAction *copy = [[[self class] allocWithZone:zone] initWithAction:[_inner copy] period:_period]; return copy; } @@ -328,16 +434,16 @@ -(void) update: (ccTime) t newT = t; else { - float s = period_ / 4; + float s = _period / 4; t = t - 1; - newT = -powf(2, 10 * t) * sinf( (t-s) *M_PI_X_2 / period_); + newT = -powf(2, 10 * t) * sinf( (t-s) *M_PI_X_2 / _period); } - [other update:newT]; + [_inner update:newT]; } - (CCActionInterval*) reverse { - return [CCEaseElasticOut actionWithAction: [other reverse] period:period_]; + return [CCEaseElasticOut actionWithAction: [_inner reverse] period:_period]; } @end @@ -354,15 +460,15 @@ -(void) update: (ccTime) t newT = t; } else { - float s = period_ / 4; - newT = powf(2, -10 * t) * sinf( (t-s) *M_PI_X_2 / period_) + 1; + float s = _period / 4; + newT = powf(2, -10 * t) * sinf( (t-s) *M_PI_X_2 / _period) + 1; } - [other update:newT]; + [_inner update:newT]; } - (CCActionInterval*) reverse { - return [CCEaseElasticIn actionWithAction: [other reverse] period:period_]; + return [CCEaseElasticIn actionWithAction: [_inner reverse] period:_period]; } @end @@ -379,22 +485,22 @@ -(void) update: (ccTime) t newT = t; else { t = t * 2; - if(! period_ ) - period_ = 0.3f * 1.5f; - ccTime s = period_ / 4; + if(! _period ) + _period = 0.3f * 1.5f; + ccTime s = _period / 4; t = t -1; if( t < 0 ) - newT = -0.5f * powf(2, 10 * t) * sinf((t - s) * M_PI_X_2 / period_); + newT = -0.5f * powf(2, 10 * t) * sinf((t - s) * M_PI_X_2 / _period); else - newT = powf(2, -10 * t) * sinf((t - s) * M_PI_X_2 / period_) * 0.5f + 1; + newT = powf(2, -10 * t) * sinf((t - s) * M_PI_X_2 / _period) * 0.5f + 1; } - [other update:newT]; + [_inner update:newT]; } - (CCActionInterval*) reverse { - return [CCEaseElasticInOut actionWithAction: [other reverse] period:period_]; + return [CCEaseElasticInOut actionWithAction: [_inner reverse] period:_period]; } @end @@ -433,13 +539,17 @@ @implementation CCEaseBounceIn -(void) update: (ccTime) t { - ccTime newT = 1 - [self bounceTime:1-t]; - [other update:newT]; + ccTime newT = t; + // prevents rounding errors + if( t !=0 && t!=1) + newT = 1 - [self bounceTime:1-t]; + + [_inner update:newT]; } - (CCActionInterval*) reverse { - return [CCEaseBounceOut actionWithAction: [other reverse]]; + return [CCEaseBounceOut actionWithAction: [_inner reverse]]; } @end @@ -448,13 +558,17 @@ @implementation CCEaseBounceOut -(void) update: (ccTime) t { - ccTime newT = [self bounceTime:t]; - [other update:newT]; + ccTime newT = t; + // prevents rounding errors + if( t !=0 && t!=1) + newT = [self bounceTime:t]; + + [_inner update:newT]; } - (CCActionInterval*) reverse { - return [CCEaseBounceIn actionWithAction: [other reverse]]; + return [CCEaseBounceIn actionWithAction: [_inner reverse]]; } @end @@ -463,16 +577,20 @@ @implementation CCEaseBounceInOut -(void) update: (ccTime) t { - ccTime newT = 0; - if (t < 0.5) { + ccTime newT; + // prevents possible rounding errors + if( t ==0 || t==1) + newT = t; + else if (t < 0.5) { t = t * 2; newT = (1 - [self bounceTime:1-t] ) * 0.5f; } else newT = [self bounceTime:t * 2 - 1] * 0.5f + 0.5f; - [other update:newT]; + [_inner update:newT]; } @end +#pragma clang diagnostic pop COCOS2D #pragma mark - #pragma mark Ease Back actions @@ -485,12 +603,12 @@ @implementation CCEaseBackIn -(void) update: (ccTime) t { ccTime overshoot = 1.70158f; - [other update: t * t * ((overshoot + 1) * t - overshoot)]; + [_inner update: t * t * ((overshoot + 1) * t - overshoot)]; } - (CCActionInterval*) reverse { - return [CCEaseBackOut actionWithAction: [other reverse]]; + return [CCEaseBackOut actionWithAction: [_inner reverse]]; } @end @@ -503,12 +621,12 @@ -(void) update: (ccTime) t ccTime overshoot = 1.70158f; t = t - 1; - [other update: t * t * ((overshoot + 1) * t + overshoot) + 1]; + [_inner update: t * t * ((overshoot + 1) * t + overshoot) + 1]; } - (CCActionInterval*) reverse { - return [CCEaseBackIn actionWithAction: [other reverse]]; + return [CCEaseBackIn actionWithAction: [_inner reverse]]; } @end @@ -523,10 +641,10 @@ -(void) update: (ccTime) t t = t * 2; if (t < 1) - [other update: (t * t * ((overshoot + 1) * t - overshoot)) / 2]; + [_inner update: (t * t * ((overshoot + 1) * t - overshoot)) / 2]; else { t = t - 2; - [other update: (t * t * ((overshoot + 1) * t + overshoot)) / 2 + 1]; + [_inner update: (t * t * ((overshoot + 1) * t + overshoot)) / 2 + 1]; } } @end diff --git a/cocos2d/CCActionGrid.h b/cocos2d/CCActionGrid.h new file mode 100644 index 0000000..53fd1cc --- /dev/null +++ b/cocos2d/CCActionGrid.h @@ -0,0 +1,167 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2009 On-Core + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + */ + + +#import "CCActionInterval.h" +#import "CCActionInstant.h" +#import "CCGrid.h" + +@class CCGridBase; + +/** Base class for Grid actions */ +@interface CCGridAction : CCActionInterval +{ + CGSize _gridSize; +} + +/** size of the grid */ +@property (nonatomic,readwrite) CGSize gridSize; + +/** creates the action with size and duration */ ++(id) actionWithDuration:(ccTime)duration size:(CGSize)gridSize; +/** initializes the action with size and duration */ +-(id) initWithDuration:(ccTime)duration size:(CGSize)gridSize; +/** returns the grid */ +-(CCGridBase *)grid; + +@end + +//////////////////////////////////////////////////////////// + +/** Base class for CCGrid3D actions. + Grid3D actions can modify a non-tiled grid. + */ +@interface CCGrid3DAction : CCGridAction +{ +} + +/** returns the vertex than belongs to certain position in the grid */ +-(ccVertex3F)vertex:(CGPoint)position; +/** returns the non-transformed vertex than belongs to certain position in the grid */ +-(ccVertex3F)originalVertex:(CGPoint)position; +/** sets a new vertex to a certain position of the grid */ +-(void)setVertex:(CGPoint)position vertex:(ccVertex3F)vertex; + +@end + +//////////////////////////////////////////////////////////// + +/** Base class for CCTiledGrid3D actions */ +@interface CCTiledGrid3DAction : CCGridAction +{ +} + +/** returns the tile that belongs to a certain position of the grid */ +-(ccQuad3)tile:(CGPoint)position; +/** returns the non-transformed tile that belongs to a certain position of the grid */ +-(ccQuad3)originalTile:(CGPoint)position; +/** sets a new tile to a certain position of the grid */ +-(void)setTile:(CGPoint)position coords:(ccQuad3)coords; + +@end + +//////////////////////////////////////////////////////////// + +/** CCAccelDeccelAmplitude action */ +@interface CCAccelDeccelAmplitude : CCActionInterval +{ + float _rate; + CCActionInterval *_other; +} + +/** amplitude rate */ +@property (nonatomic,readwrite) float rate; + +/** creates the action with an inner action that has the amplitude property, and a duration time */ ++(id)actionWithAction:(CCAction*)action duration:(ccTime)d; +/** initializes the action with an inner action that has the amplitude property, and a duration time */ +-(id)initWithAction:(CCAction*)action duration:(ccTime)d; + +@end + +//////////////////////////////////////////////////////////// + +/** CCAccelAmplitude action */ +@interface CCAccelAmplitude : CCActionInterval +{ + float _rate; + CCActionInterval *_other; +} + +/** amplitude rate */ +@property (nonatomic,readwrite) float rate; + +/** creates the action with an inner action that has the amplitude property, and a duration time */ ++(id)actionWithAction:(CCAction*)action duration:(ccTime)d; +/** initializes the action with an inner action that has the amplitude property, and a duration time */ +-(id)initWithAction:(CCAction*)action duration:(ccTime)d; + +@end + +//////////////////////////////////////////////////////////// + +/** CCDeccelAmplitude action */ +@interface CCDeccelAmplitude : CCActionInterval +{ + float _rate; + CCActionInterval *_other; +} + +/** amplitude rate */ +@property (nonatomic,readwrite) float rate; + +/** creates the action with an inner action that has the amplitude property, and a duration time */ ++(id)actionWithAction:(CCAction*)action duration:(ccTime)d; +/** initializes the action with an inner action that has the amplitude property, and a duration time */ +-(id)initWithAction:(CCAction*)action duration:(ccTime)d; + +@end + +//////////////////////////////////////////////////////////// + +/** CCStopGrid action. + Don't call this action if another grid action is active. + Call if you want to remove the the grid effect. Example: + [Sequence actions:[Lens ...], [StopGrid action], nil]; + */ +@interface CCStopGrid : CCActionInstant +{ +} +// to make BridgeSupport happy +-(void)startWithTarget:(id)aTarget; +@end + +//////////////////////////////////////////////////////////// + +/** CCReuseGrid action */ +@interface CCReuseGrid : CCActionInstant +{ + int _times; +} +/** creates an action with the number of times that the current grid will be reused */ ++(id) actionWithTimes: (int) times; +/** initializes an action with the number of times that the current grid will be reused */ +-(id) initWithTimes: (int) times; +@end diff --git a/src/cocos2d/CCActionGrid.m b/cocos2d/CCActionGrid.m similarity index 69% rename from src/cocos2d/CCActionGrid.m rename to cocos2d/CCActionGrid.m index fd87ac8..71d9f69 100644 --- a/src/cocos2d/CCActionGrid.m +++ b/cocos2d/CCActionGrid.m @@ -32,23 +32,25 @@ @implementation CCGridAction -@synthesize gridSize = gridSize_; +@synthesize gridSize = _gridSize; -+(id) actionWithSize:(ccGridSize)size duration:(ccTime)d ++(id) actionWithDuration:(ccTime)duration size:(CGSize)gridSize { - return [[[self alloc] initWithSize:size duration:d ] autorelease]; + return [[self alloc] initWithDuration:duration size:gridSize]; } --(id) initWithSize:(ccGridSize)gSize duration:(ccTime)d +-(id) initWithDuration:(ccTime)duration size:(CGSize)gridSize { - if ( (self = [super initWithDuration:d]) ) + if ( (self = [super initWithDuration:duration]) ) { - gridSize_ = gSize; + _gridSize = gridSize; } return self; } +#pragma clang diagnostic push COCOS2D +#pragma clang diagnostic ignored "-Wfloat-equal" -(void)startWithTarget:(id)target { [super startWithTarget:target]; @@ -60,7 +62,7 @@ -(void)startWithTarget:(id)target if ( targetGrid && targetGrid.reuseGrid > 0 ) { - if ( targetGrid.active && targetGrid.gridSize.x == gridSize_.x && targetGrid.gridSize.y == gridSize_.y && [targetGrid isKindOfClass:[newgrid class]] ) + if ( targetGrid.active && targetGrid.gridSize.width == _gridSize.width && targetGrid.gridSize.height == _gridSize.height && [targetGrid isKindOfClass:[newgrid class]] ) [targetGrid reuse]; else [NSException raise:@"GridBase" format:@"Cannot reuse grid"]; @@ -74,6 +76,7 @@ -(void)startWithTarget:(id)target t.grid.active = YES; } } +#pragma clang diagnostic pop COCOS2D -(CCGridBase *)grid { @@ -88,7 +91,7 @@ - (CCActionInterval*) reverse -(id) copyWithZone: (NSZone*) zone { - CCGridAction *copy = [[[self class] allocWithZone:zone] initWithSize:gridSize_ duration:duration_]; + CCGridAction *copy = [[[self class] allocWithZone:zone] initWithDuration:_duration size:_gridSize]; return copy; } @end @@ -102,24 +105,24 @@ @implementation CCGrid3DAction -(CCGridBase *)grid { - return [CCGrid3D gridWithSize:gridSize_]; + return [CCGrid3D gridWithSize:_gridSize]; } --(ccVertex3F)vertex:(ccGridSize)pos +-(ccVertex3F)vertex:(CGPoint)pos { - CCGrid3D *g = (CCGrid3D *)[target_ grid]; + CCGrid3D *g = (CCGrid3D *)[_target grid]; return [g vertex:pos]; } --(ccVertex3F)originalVertex:(ccGridSize)pos +-(ccVertex3F)originalVertex:(CGPoint)pos { - CCGrid3D *g = (CCGrid3D *)[target_ grid]; + CCGrid3D *g = (CCGrid3D *)[_target grid]; return [g originalVertex:pos]; } --(void)setVertex:(ccGridSize)pos vertex:(ccVertex3F)vertex +-(void)setVertex:(CGPoint)pos vertex:(ccVertex3F)vertex { - CCGrid3D *g = (CCGrid3D *)[target_ grid]; + CCGrid3D *g = (CCGrid3D *)[_target grid]; [g setVertex:pos vertex:vertex]; } @end @@ -133,24 +136,24 @@ @implementation CCTiledGrid3DAction -(CCGridBase *)grid { - return [CCTiledGrid3D gridWithSize:gridSize_]; + return [CCTiledGrid3D gridWithSize:_gridSize]; } --(ccQuad3)tile:(ccGridSize)pos +-(ccQuad3)tile:(CGPoint)pos { - CCTiledGrid3D *g = (CCTiledGrid3D *)[target_ grid]; + CCTiledGrid3D *g = (CCTiledGrid3D *)[_target grid]; return [g tile:pos]; } --(ccQuad3)originalTile:(ccGridSize)pos +-(ccQuad3)originalTile:(CGPoint)pos { - CCTiledGrid3D *g = (CCTiledGrid3D *)[target_ grid]; + CCTiledGrid3D *g = (CCTiledGrid3D *)[_target grid]; return [g originalTile:pos]; } --(void)setTile:(ccGridSize)pos coords:(ccQuad3)coords +-(void)setTile:(CGPoint)pos coords:(ccQuad3)coords { - CCTiledGrid3D *g = (CCTiledGrid3D *)[target_ grid]; + CCTiledGrid3D *g = (CCTiledGrid3D *)[_target grid]; [g setTile:pos coords:coords]; } @@ -183,34 +186,29 @@ -(CGFloat)getAmplitudeRate @implementation CCAccelDeccelAmplitude -@synthesize rate=rate_; +@synthesize rate=_rate; +(id)actionWithAction:(CCAction*)action duration:(ccTime)d { - return [[[self alloc] initWithAction:action duration:d ] autorelease]; + return [[self alloc] initWithAction:action duration:d ]; } -(id)initWithAction:(CCAction *)action duration:(ccTime)d { if ( (self = [super initWithDuration:d]) ) { - rate_ = 1.0f; - other_ = (CCActionInterval*)[action retain]; + _rate = 1.0f; + _other = (CCActionInterval*)action; } return self; } --(void)dealloc -{ - [other_ release]; - [super dealloc]; -} -(void)startWithTarget:(id)aTarget { [super startWithTarget:aTarget]; - [other_ startWithTarget:target_]; + [_other startWithTarget:_target]; } -(void) update: (ccTime) time @@ -223,13 +221,13 @@ -(void) update: (ccTime) time f = 1 - f; } - [other_ setAmplitudeRate:powf(f, rate_)]; - [other_ update:time]; + [_other setAmplitudeRate:powf(f, _rate)]; + [_other update:time]; } - (CCActionInterval*) reverse { - return [CCAccelDeccelAmplitude actionWithAction:[other_ reverse] duration:duration_]; + return [CCAccelDeccelAmplitude actionWithAction:[_other reverse] duration:_duration]; } @end @@ -241,45 +239,40 @@ - (CCActionInterval*) reverse @implementation CCAccelAmplitude -@synthesize rate=rate_; +@synthesize rate=_rate; +(id)actionWithAction:(CCAction*)action duration:(ccTime)d { - return [[[self alloc] initWithAction:action duration:d ] autorelease]; + return [[self alloc] initWithAction:action duration:d ]; } -(id)initWithAction:(CCAction *)action duration:(ccTime)d { if ( (self = [super initWithDuration:d]) ) { - rate_ = 1.0f; - other_ = (CCActionInterval*)[action retain]; + _rate = 1.0f; + _other = (CCActionInterval*)action; } return self; } --(void)dealloc -{ - [other_ release]; - [super dealloc]; -} -(void)startWithTarget:(id)aTarget { [super startWithTarget:aTarget]; - [other_ startWithTarget:target_]; + [_other startWithTarget:_target]; } -(void) update: (ccTime) time { - [other_ setAmplitudeRate:powf(time, rate_)]; - [other_ update:time]; + [_other setAmplitudeRate:powf(time, _rate)]; + [_other update:time]; } - (CCActionInterval*) reverse { - return [CCAccelAmplitude actionWithAction:[other_ reverse] duration:self.duration]; + return [CCAccelAmplitude actionWithAction:[_other reverse] duration:self.duration]; } @end @@ -291,45 +284,40 @@ - (CCActionInterval*) reverse @implementation CCDeccelAmplitude -@synthesize rate=rate_; +@synthesize rate=_rate; +(id)actionWithAction:(CCAction*)action duration:(ccTime)d { - return [[[self alloc] initWithAction:action duration:d ] autorelease]; + return [[self alloc] initWithAction:action duration:d ]; } -(id)initWithAction:(CCAction *)action duration:(ccTime)d { if ( (self = [super initWithDuration:d]) ) { - rate_ = 1.0f; - other_ = (CCActionInterval*)[action retain]; + _rate = 1.0f; + _other = (CCActionInterval*)action; } return self; } --(void)dealloc -{ - [other_ release]; - [super dealloc]; -} -(void)startWithTarget:(id)aTarget { [super startWithTarget:aTarget]; - [other_ startWithTarget:target_]; + [_other startWithTarget:_target]; } -(void) update: (ccTime) time { - [other_ setAmplitudeRate:powf((1-time), rate_)]; - [other_ update:time]; + [_other setAmplitudeRate:powf((1-time), _rate)]; + [_other update:time]; } - (CCActionInterval*) reverse { - return [CCDeccelAmplitude actionWithAction:[other_ reverse] duration:self.duration]; + return [CCDeccelAmplitude actionWithAction:[_other reverse] duration:self.duration]; } @end @@ -363,13 +351,13 @@ @implementation CCReuseGrid +(id)actionWithTimes:(int)times { - return [[[self alloc] initWithTimes:times ] autorelease]; + return [[self alloc] initWithTimes:times ]; } -(id)initWithTimes:(int)times { if ( (self = [super init]) ) - t_ = times; + _times = times; return self; } @@ -380,7 +368,7 @@ -(void)startWithTarget:(id)aTarget CCNode *myTarget = (CCNode*) [self target]; if ( myTarget.grid && myTarget.grid.active ) - myTarget.grid.reuseGrid += t_; + myTarget.grid.reuseGrid += _times; } @end diff --git a/cocos2d/CCActionGrid3D.h b/cocos2d/CCActionGrid3D.h new file mode 100644 index 0000000..6c34512 --- /dev/null +++ b/cocos2d/CCActionGrid3D.h @@ -0,0 +1,208 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2009 On-Core + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + */ + + +#import "CCActionGrid.h" + +/** CCWaves3D action */ +@interface CCWaves3D : CCGrid3DAction +{ + NSUInteger _waves; + float _amplitude; + float _amplitudeRate; +} + +/** amplitude of the wave */ +@property (nonatomic,readwrite) float amplitude; +/** amplitude rate of the wave */ +@property (nonatomic,readwrite) float amplitudeRate; + +/** creates an action with duration, grid size, waves and amplitud */ ++(id)actionWithDuration:(ccTime)duration size:(CGSize)gridSize waves:(NSUInteger)wav amplitude:(float)amp; +/** initializeds an action with duration, grid size, waves and amplitud */ +-(id)initWithDuration:(ccTime)duration size:(CGSize)gridSize waves:(NSUInteger)wav amplitude:(float)amp; + +@end + +//////////////////////////////////////////////////////////// + +/** CCFlipX3D action */ +@interface CCFlipX3D : CCGrid3DAction +{ +} + +/** creates the action with duration */ ++(id) actionWithDuration:(ccTime)d; +/** initializes the action with duration */ +-(id) initWithDuration:(ccTime)d; + +@end + +//////////////////////////////////////////////////////////// + +/** CCFlipY3D action */ +@interface CCFlipY3D : CCFlipX3D +{ +} +// Needed for bridge support +-(void)update:(ccTime)time; +@end + +//////////////////////////////////////////////////////////// + +/** CCLens3D action */ +@interface CCLens3D : CCGrid3DAction +{ + CGPoint _position; + float _radius; + float _lensEffect; + BOOL _dirty; +} + +/** lens effect. Defaults to 0.7 - 0 means no effect, 1 is very strong effect */ +@property (nonatomic,readwrite) float lensEffect; +/** lens center position in Points */ +@property (nonatomic,readwrite) CGPoint position; + +/** creates the action with center position in Points, radius, a grid size and duration */ ++(id)actionWithDuration:(ccTime)duration size:(CGSize)gridSize position:(CGPoint)pos radius:(float)radius; +/** initializes the action with center position in Points, radius, a grid size and duration */ +-(id)initWithDuration:(ccTime)duration size:(CGSize)gridSize position:(CGPoint)pos radius:(float)radius; + +@end + +//////////////////////////////////////////////////////////// + +/** CCRipple3D action */ +@interface CCRipple3D : CCGrid3DAction +{ + CGPoint _position; + float _radius; + NSUInteger _waves; + float _amplitude; + float _amplitudeRate; +} + +/** center position in Points */ +@property (nonatomic,readwrite) CGPoint position; +/** amplitude */ +@property (nonatomic,readwrite) float amplitude; +/** amplitude rate */ +@property (nonatomic,readwrite) float amplitudeRate; + +/** creates the action with a position in points, radius, number of waves, amplitude, a grid size and duration */ ++(id)actionWithDuration:(ccTime)d size:(CGSize)gridSize position:(CGPoint)pos radius:(float)r waves:(NSInteger)wav amplitude:(float)amp; +/** initializes the action with a position in points, radius, number of waves, amplitude, a grid size and duration */ +-(id)initWithDuration:(ccTime)d size:(CGSize)gridSize position:(CGPoint)pos radius:(float)r waves:(NSInteger)wav amplitude:(float)amp; + +@end + +//////////////////////////////////////////////////////////// + +/** CCShaky3D action */ +@interface CCShaky3D : CCGrid3DAction +{ + int _randrange; + BOOL _shakeZ; +} + +/** creates the action with a range, shake Z vertices, a grid and duration */ ++(id)actionWithDuration:(ccTime)duration size:(CGSize)gridSize range:(int)range shakeZ:(BOOL)shakeZ; +/** initializes the action with a range, shake Z vertices, a grid and duration */ +-(id)initWithDuration:(ccTime)duration size:(CGSize)gridSize range:(int)range shakeZ:(BOOL)shakeZ; + +@end + +//////////////////////////////////////////////////////////// + +/** CCLiquid action */ +@interface CCLiquid : CCGrid3DAction +{ + NSUInteger _waves; + float _amplitude; + float _amplitudeRate; + +} + +/** amplitude */ +@property (nonatomic,readwrite) float amplitude; +/** amplitude rate */ +@property (nonatomic,readwrite) float amplitudeRate; + +/** creates the action with amplitude, a grid and duration */ ++(id)actionWithDuration:(ccTime)duration size:(CGSize)gridSize waves:(NSUInteger)wav amplitude:(float)amp; +/** initializes the action with amplitude, a grid and duration */ +-(id)initWithDuration:(ccTime)duration size:(CGSize)gridSize waves:(NSUInteger)wav amplitude:(float)amp; + +@end + +//////////////////////////////////////////////////////////// + +/** CCWaves action */ +@interface CCWaves : CCGrid3DAction +{ + NSUInteger _waves; + float _amplitude; + float _amplitudeRate; + BOOL _vertical; + BOOL _horizontal; +} + +/** amplitude */ +@property (nonatomic,readwrite) float amplitude; +/** amplitude rate */ +@property (nonatomic,readwrite) float amplitudeRate; + +/** initializes the action with amplitude, horizontal sin, vertical sin, a grid and duration */ ++(id)actionWithDuration:(ccTime)duration size:(CGSize)gridSize waves:(NSUInteger)wav amplitude:(float)amp horizontal:(BOOL)h vertical:(BOOL)v; +/** creates the action with amplitude, horizontal sin, vertical sin, a grid and duration */ +-(id)initWithDuration:(ccTime)duration size:(CGSize)gridSize waves:(NSUInteger)wav amplitude:(float)amp horizontal:(BOOL)h vertical:(BOOL)v; + +@end + +//////////////////////////////////////////////////////////// + +/** CCTwirl action */ +@interface CCTwirl : CCGrid3DAction +{ + CGPoint _position; + NSUInteger _twirls; + float _amplitude; + float _amplitudeRate; +} + +/** twirl center */ +@property (nonatomic,readwrite) CGPoint position; +/** amplitude */ +@property (nonatomic,readwrite) float amplitude; +/** amplitude rate */ +@property (nonatomic,readwrite) float amplitudeRate; + +/** creates the action with center position, number of twirls, amplitude, a grid size and duration */ ++(id)actionWithDuration:(ccTime)duration size:(CGSize)gridSize position:(CGPoint)pos twirls:(NSUInteger)t amplitude:(float)amp; +/** initializes the action with center position, number of twirls, amplitude, a grid size and duration */ +-(id)initWithDuration:(ccTime)duration size:(CGSize)gridSize position:(CGPoint)pos twirls:(NSUInteger)t amplitude:(float)amp; + +@end diff --git a/cocos2d/CCActionGrid3D.m b/cocos2d/CCActionGrid3D.m new file mode 100644 index 0000000..1417b33 --- /dev/null +++ b/cocos2d/CCActionGrid3D.m @@ -0,0 +1,648 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2009 On-Core + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + */ + + +#import "CCActionGrid3D.h" +#import "ccMacros.h" +#import "Support/CGPointExtension.h" + +#pragma mark - +#pragma mark Waves3D + +@implementation CCWaves3D + +@synthesize amplitude=_amplitude; +@synthesize amplitudeRate=_amplitudeRate; + ++(id)actionWithDuration:(ccTime)duration size:(CGSize)gridSize waves:(NSUInteger)wav amplitude:(float)amp +{ + return [[self alloc] initWithDuration:duration size:gridSize waves:wav amplitude:amp]; +} + +-(id)initWithDuration:(ccTime)duration size:(CGSize)gridSize waves:(NSUInteger)wav amplitude:(float)amp +{ + if ( (self = [super initWithDuration:duration size:gridSize]) ) + { + _waves = wav; + _amplitude = amp; + _amplitudeRate = 1.0f; + } + + return self; +} + +-(id) copyWithZone: (NSZone*) zone +{ + return [[[self class] allocWithZone:zone] initWithDuration:_duration size:_gridSize waves:_waves amplitude:_amplitude]; +} + + +-(void)update:(ccTime)time +{ + int i, j; + + for( i = 0; i < (_gridSize.width+1); i++ ) + { + for( j = 0; j < (_gridSize.height+1); j++ ) + { + ccVertex3F v = [self originalVertex:ccp(i,j)]; + v.z += (sinf((CGFloat)M_PI*time*_waves*2 + (v.y+v.x) * .01f) * _amplitude * _amplitudeRate); + [self setVertex:ccp(i,j) vertex:v]; + } + } +} +@end + +//////////////////////////////////////////////////////////// + +#pragma mark - +#pragma mark FlipX3D + +@implementation CCFlipX3D + ++(id) actionWithDuration:(ccTime)d +{ + return [[self alloc] initWithDuration:d size:CGSizeMake(1,1)]; +} + +-(id) initWithDuration:(ccTime)d +{ + return [super initWithDuration:d size:CGSizeMake(1,1)]; +} + +#pragma clang diagnostic push COCOS2D +#pragma clang diagnostic ignored "-Wfloat-equal" +-(id)initWithSize:(CGSize)gSize duration:(ccTime)d +{ + if ( gSize.width != 1 || gSize.height != 1 ) + { + [NSException raise:@"FlipX3D" format:@"Grid size must be (1,1)"]; + } + + return [super initWithDuration:d size:gSize]; +} +#pragma clang diagnostic pop COCOS2D + +-(id) copyWithZone: (NSZone*) zone +{ + CCGridAction *copy = [[[self class] allocWithZone:zone] initWithSize:_gridSize duration:_duration]; + return copy; +} + + +-(void)update:(ccTime)time +{ + CGFloat angle = (CGFloat)M_PI * time; // 180 degrees + CGFloat mz = sinf( angle ); + angle = angle / 2.0f; // x calculates degrees from 0 to 90 + CGFloat mx = cosf( angle ); + + ccVertex3F v0, v1, v, diff; + + v0 = [self originalVertex:ccp(1,1)]; + v1 = [self originalVertex:ccp(0,0)]; + + CGFloat x0 = v0.x; + CGFloat x1 = v1.x; + CGFloat x; + CGPoint a, b, c, d; + + if ( x0 > x1 ) + { + // Normal Grid + a = ccp(0,0); + b = ccp(0,1); + c = ccp(1,0); + d = ccp(1,1); + x = x0; + } + else + { + // Reversed Grid + c = ccp(0,0); + d = ccp(0,1); + a = ccp(1,0); + b = ccp(1,1); + x = x1; + } + + diff.x = ( x - x * mx ); + diff.z = fabsf( floorf( (x * mz) / 4.0f ) ); + +// bottom-left + v = [self originalVertex:a]; + v.x = diff.x; + v.z += diff.z; + [self setVertex:a vertex:v]; + +// upper-left + v = [self originalVertex:b]; + v.x = diff.x; + v.z += diff.z; + [self setVertex:b vertex:v]; + +// bottom-right + v = [self originalVertex:c]; + v.x -= diff.x; + v.z -= diff.z; + [self setVertex:c vertex:v]; + +// upper-right + v = [self originalVertex:d]; + v.x -= diff.x; + v.z -= diff.z; + [self setVertex:d vertex:v]; +} + +@end + +//////////////////////////////////////////////////////////// + +#pragma mark - +#pragma mark FlipY3D + +@implementation CCFlipY3D + +-(void)update:(ccTime)time +{ + CGFloat angle = (CGFloat)M_PI * time; // 180 degrees + CGFloat mz = sinf( angle ); + angle = angle / 2.0f; // x calculates degrees from 0 to 90 + CGFloat my = cosf( angle ); + + ccVertex3F v0, v1, v, diff; + + v0 = [self originalVertex:ccp(1,1)]; + v1 = [self originalVertex:ccp(0,0)]; + + CGFloat y0 = v0.y; + CGFloat y1 = v1.y; + CGFloat y; + CGPoint a, b, c, d; + + if ( y0 > y1 ) + { + // Normal Grid + a = ccp(0,0); + b = ccp(0,1); + c = ccp(1,0); + d = ccp(1,1); + y = y0; + } + else + { + // Reversed Grid + b = ccp(0,0); + a = ccp(0,1); + d = ccp(1,0); + c = ccp(1,1); + y = y1; + } + + diff.y = y - y * my; + diff.z = fabsf( floorf( (y * mz) / 4.0f ) ); + + // bottom-left + v = [self originalVertex:a]; + v.y = diff.y; + v.z += diff.z; + [self setVertex:a vertex:v]; + + // upper-left + v = [self originalVertex:b]; + v.y -= diff.y; + v.z -= diff.z; + [self setVertex:b vertex:v]; + + // bottom-right + v = [self originalVertex:c]; + v.y = diff.y; + v.z += diff.z; + [self setVertex:c vertex:v]; + + // upper-right + v = [self originalVertex:d]; + v.y -= diff.y; + v.z -= diff.z; + [self setVertex:d vertex:v]; +} + +@end + +//////////////////////////////////////////////////////////// + +#pragma mark - +#pragma mark Lens3D + +@implementation CCLens3D + +@synthesize lensEffect=_lensEffect; + ++(id)actionWithDuration:(ccTime)duration size:(CGSize)gridSize position:(CGPoint)pos radius:(float)radius +{ + return [[self alloc] initWithDuration:duration size:gridSize position:pos radius:radius]; +} + +-(id)initWithDuration:(ccTime)duration size:(CGSize)gridSize position:(CGPoint)pos radius:(float)radius +{ + if ( (self = [super initWithDuration:duration size:gridSize]) ) + { + _position = ccp(-1,-1); + self.position = pos; + _radius = radius; + _lensEffect = 0.7f; + _dirty = YES; + } + + return self; +} + +-(id) copyWithZone: (NSZone*) zone +{ + CCGridAction *copy = [[[self class] allocWithZone:zone] initWithDuration:_duration size:_gridSize position:_position radius:_radius]; + return copy; +} + +-(void) setPosition:(CGPoint)pos +{ + if( ! CGPointEqualToPoint(pos, _position) ) { + _position = pos; + _dirty = YES; + } +} + +-(CGPoint) position +{ + return _position; +} + +#pragma clang diagnostic push COCOS2D +#pragma clang diagnostic ignored "-Wfloat-equal" +-(void)update:(ccTime)time +{ + if ( _dirty ) + { + int i, j; + + for( i = 0; i < _gridSize.width+1; i++ ) + { + for( j = 0; j < _gridSize.height+1; j++ ) + { + ccVertex3F v = [self originalVertex:ccp(i,j)]; + CGPoint vect = ccpSub(_position, ccp(v.x,v.y)); + CGFloat r = ccpLength(vect); + + if ( r < _radius ) + { + r = _radius - r; + CGFloat pre_log = r / _radius; + if ( pre_log == 0 ) pre_log = 0.001f; + float l = logf(pre_log) * _lensEffect; + float new_r = expf( l ) * _radius; + + if ( ccpLength(vect) > 0 ) + { + vect = ccpNormalize(vect); + CGPoint new_vect = ccpMult(vect, new_r); + v.z += ccpLength(new_vect) * _lensEffect; + } + } + + [self setVertex:ccp(i,j) vertex:v]; + } + } + + _dirty = NO; + } +} +#pragma clang diagnostic pop COCOS2D + +@end + +//////////////////////////////////////////////////////////// + +#pragma mark - +#pragma mark Ripple3D + +@implementation CCRipple3D + +@synthesize amplitude = _amplitude; +@synthesize amplitudeRate = _amplitudeRate; + + ++(id)actionWithDuration:(ccTime)d size:(CGSize)gridSize position:(CGPoint)pos radius:(float)r waves:(NSInteger)wav amplitude:(float)amp +{ + return [[self alloc] initWithDuration:d size:gridSize position:pos radius:r waves:wav amplitude:amp]; +} + +-(id)initWithDuration:(ccTime)d size:(CGSize)gridSize position:(CGPoint)pos radius:(float)r waves:(NSInteger)wav amplitude:(float)amp +{ + if ( (self = [super initWithDuration:d size:gridSize]) ) + { + self.position = pos; + _radius = r; + _waves = wav; + _amplitude = amp; + _amplitudeRate = 1.0f; + } + + return self; +} + +-(CGPoint) position +{ + return _position; +} + +-(void) setPosition:(CGPoint)pos +{ + _position = pos; +} + +-(id) copyWithZone: (NSZone*) zone +{ + return [[[self class] allocWithZone:zone] initWithDuration:_duration size:_gridSize position:_position radius:_radius waves:_waves amplitude:_amplitude]; +} + +-(void)update:(ccTime)time +{ + int i, j; + + for( i = 0; i < (_gridSize.width+1); i++ ) + { + for( j = 0; j < (_gridSize.height+1); j++ ) + { + ccVertex3F v = [self originalVertex:ccp(i,j)]; + CGPoint vect = ccpSub(_position, ccp(v.x,v.y)); + CGFloat r = ccpLength(vect); + + if ( r < _radius ) + { + r = _radius - r; + CGFloat rate = powf( r / _radius, 2); + v.z += (sinf( time*(CGFloat)M_PI*_waves*2 + r * 0.1f) * _amplitude * _amplitudeRate * rate ); + } + + [self setVertex:ccp(i,j) vertex:v]; + } + } +} + +@end + +//////////////////////////////////////////////////////////// + +#pragma mark - +#pragma mark Shaky3D + +@implementation CCShaky3D + ++(id)actionWithDuration:(ccTime)duration size:(CGSize)gridSize range:(int)range shakeZ:(BOOL)shakeZ +{ + return [[self alloc] initWithDuration:duration size:gridSize range:range shakeZ:shakeZ]; +} + +-(id)initWithDuration:(ccTime)duration size:(CGSize)gridSize range:(int)range shakeZ:(BOOL)shakeZ +{ + if ( (self = [super initWithDuration:duration size:gridSize]) ) + { + _randrange = range; + _shakeZ = shakeZ; + } + + return self; +} + +-(id) copyWithZone: (NSZone*) zone +{ + return [[[self class] allocWithZone:zone] initWithDuration:_duration size:_gridSize range:_randrange shakeZ:_shakeZ]; +} + +-(void)update:(ccTime)time +{ + int i, j; + + for( i = 0; i < (_gridSize.width+1); i++ ) + { + for( j = 0; j < (_gridSize.height+1); j++ ) + { + ccVertex3F v = [self originalVertex:ccp(i,j)]; + v.x += ( rand() % (_randrange*2) ) - _randrange; + v.y += ( rand() % (_randrange*2) ) - _randrange; + if( _shakeZ ) + v.z += ( rand() % (_randrange*2) ) - _randrange; + + [self setVertex:ccp(i,j) vertex:v]; + } + } +} + +@end + +//////////////////////////////////////////////////////////// + +#pragma mark - +#pragma mark Liquid + +@implementation CCLiquid + +@synthesize amplitude=_amplitude; +@synthesize amplitudeRate=_amplitudeRate; + ++(id)actionWithDuration:(ccTime)duration size:(CGSize)gridSize waves:(NSUInteger)wav amplitude:(float)amp +{ + return [[self alloc] initWithDuration:duration size:gridSize waves:wav amplitude:amp]; +} + +-(id)initWithDuration:(ccTime)duration size:(CGSize)gridSize waves:(NSUInteger)wav amplitude:(float)amp +{ + if ( (self = [super initWithDuration:duration size:gridSize]) ) + { + _waves = wav; + _amplitude = amp; + _amplitudeRate = 1.0f; + } + + return self; +} + +-(void)update:(ccTime)time +{ + int i, j; + + for( i = 1; i < _gridSize.width; i++ ) + { + for( j = 1; j < _gridSize.height; j++ ) + { + ccVertex3F v = [self originalVertex:ccp(i,j)]; + v.x = (v.x + (sinf(time*(CGFloat)M_PI*_waves*2 + v.x * .01f) * _amplitude * _amplitudeRate)); + v.y = (v.y + (sinf(time*(CGFloat)M_PI*_waves*2 + v.y * .01f) * _amplitude * _amplitudeRate)); + [self setVertex:ccp(i,j) vertex:v]; + } + } +} + +-(id) copyWithZone: (NSZone*) zone +{ + return [[[self class] allocWithZone:zone] initWithDuration:_duration size:_gridSize waves:_waves amplitude:_amplitude]; +} + +@end + +//////////////////////////////////////////////////////////// + +#pragma mark - +#pragma mark Waves + +@implementation CCWaves + +@synthesize amplitude=_amplitude; +@synthesize amplitudeRate=_amplitudeRate; + ++(id)actionWithDuration:(ccTime)duration size:(CGSize)gridSize waves:(NSUInteger)wav amplitude:(float)amp horizontal:(BOOL)h vertical:(BOOL)v +{ + return [[self alloc] initWithDuration:duration size:gridSize waves:wav amplitude:amp horizontal:h vertical:v]; +} + +-(id)initWithDuration:(ccTime)duration size:(CGSize)gridSize waves:(NSUInteger)wav amplitude:(float)amp horizontal:(BOOL)h vertical:(BOOL)v +{ + if ( (self = [super initWithDuration:duration size:gridSize]) ) + { + _waves = wav; + _amplitude = amp; + _amplitudeRate = 1.0f; + _horizontal = h; + _vertical = v; + } + + return self; +} + +-(void)update:(ccTime)time +{ + int i, j; + + for( i = 0; i < (_gridSize.width+1); i++ ) + { + for( j = 0; j < (_gridSize.height+1); j++ ) + { + ccVertex3F v = [self originalVertex:ccp(i,j)]; + + if ( _vertical ) + v.x = (v.x + (sinf(time*(CGFloat)M_PI*_waves*2 + v.y * .01f) * _amplitude * _amplitudeRate)); + + if ( _horizontal ) + v.y = (v.y + (sinf(time*(CGFloat)M_PI*_waves*2 + v.x * .01f) * _amplitude * _amplitudeRate)); + + [self setVertex:ccp(i,j) vertex:v]; + } + } +} + +-(id) copyWithZone: (NSZone*) zone +{ + return [[[self class] allocWithZone:zone] initWithDuration:_duration size:_gridSize waves:_waves amplitude:_amplitude horizontal:_horizontal vertical:_vertical]; +} + +@end + +//////////////////////////////////////////////////////////// + +#pragma mark - +#pragma mark Twirl + +@implementation CCTwirl + +@synthesize amplitude = _amplitude; +@synthesize amplitudeRate = _amplitudeRate; + ++(id)actionWithDuration:(ccTime)duration size:(CGSize)gridSize position:(CGPoint)pos twirls:(NSUInteger)t amplitude:(float)amp +{ + return [[self alloc] initWithDuration:duration size:gridSize position:pos twirls:t amplitude:amp]; +} + +-(id)initWithDuration:(ccTime)duration size:(CGSize)gridSize position:(CGPoint)pos twirls:(NSUInteger)t amplitude:(float)amp +{ + if ( (self = [super initWithDuration:duration size:gridSize]) ) + { + self.position = pos; + _twirls = t; + _amplitude = amp; + _amplitudeRate = 1.0f; + } + + return self; +} + +-(void) setPosition:(CGPoint)pos +{ + _position = pos; +} + +-(CGPoint) position +{ + return _position; +} + +-(void)update:(ccTime)time +{ + int i, j; + CGPoint c = _position; + + for( i = 0; i < (_gridSize.width+1); i++ ) + { + for( j = 0; j < (_gridSize.height+1); j++ ) + { + ccVertex3F v = [self originalVertex:ccp(i,j)]; + + CGPoint avg = ccp(i-(_gridSize.width/2.0f), j-(_gridSize.height/2.0f)); + CGFloat r = ccpLength( avg ); + + CGFloat amp = 0.1f * _amplitude * _amplitudeRate; + CGFloat a = r * cosf( (CGFloat)M_PI/2.0f + time * (CGFloat)M_PI * _twirls * 2 ) * amp; + + float cosA = cosf(a); + float sinA = sinf(a); + + CGPoint d = { + sinA * (v.y-c.y) + cosA * (v.x-c.x), + cosA * (v.y-c.y) - sinA * (v.x-c.x) + }; + + v.x = c.x + d.x; + v.y = c.y + d.y; + + [self setVertex:ccp(i,j) vertex:v]; + } + } +} + +-(id) copyWithZone: (NSZone*) zone +{ + return [[[self class] allocWithZone:zone] initWithDuration:_duration size:_gridSize position:_position twirls:_twirls amplitude:_amplitude]; +} + + +@end diff --git a/cocos2d/CCActionInstant.h b/cocos2d/CCActionInstant.h new file mode 100644 index 0000000..e296a5e --- /dev/null +++ b/cocos2d/CCActionInstant.h @@ -0,0 +1,235 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2008-2010 Ricardo Quesada + * Copyright (c) 2011 Zynga Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + */ + + +#import "CCAction.h" + +/** Instant actions are immediate actions. They don't have a duration like + the CCIntervalAction actions. +*/ +@interface CCActionInstant : CCFiniteTimeAction +{ +} +// XXX Needed for BridgeSupport +-(id) init; +@end + +/** Show the node + */ + @interface CCShow : CCActionInstant +{ +} +// XXX Needed for BridgeSupport +-(void) update:(ccTime)time; +@end + +/** Hide the node + */ +@interface CCHide : CCActionInstant +{ +} +-(void) update:(ccTime)time; +@end + +/** Toggles the visibility of a node + */ +@interface CCToggleVisibility : CCActionInstant +{ +} +-(void) update:(ccTime)time; +@end + +/** Flips the sprite horizontally + @since v0.99.0 + */ +@interface CCFlipX : CCActionInstant +{ + BOOL _flipX; +} ++(id) actionWithFlipX:(BOOL)x; +-(id) initWithFlipX:(BOOL)x; +@end + +/** Flips the sprite vertically + @since v0.99.0 + */ +@interface CCFlipY : CCActionInstant +{ + BOOL _flipY; +} ++(id) actionWithFlipY:(BOOL)y; +-(id) initWithFlipY:(BOOL)y; +@end + +/** Places the node in a certain position + */ +@interface CCPlace : CCActionInstant +{ + CGPoint _position; +} +/** creates a Place action with a position */ ++(id) actionWithPosition: (CGPoint) pos; +/** Initializes a Place action with a position */ +-(id) initWithPosition: (CGPoint) pos; +@end + +/** Calls a 'callback' + */ +@interface CCCallFunc : CCActionInstant +{ + id _targetCallback; + SEL _selector; +} + +/** Target that will be called */ +@property (nonatomic, readwrite, strong) id targetCallback; + +/** creates the action with the callback */ ++(id) actionWithTarget: (id) t selector:(SEL) s; +/** initializes the action with the callback */ +-(id) initWithTarget: (id) t selector:(SEL) s; +/** executes the callback */ +-(void) execute; +@end + +/** Calls a 'callback' with the node as the first argument. + N means Node + */ +@interface CCCallFuncN : CCCallFunc +{ +} +// XXX: Needed for BridgeSupport +-(void) execute; +@end + +typedef void (*CC_CALLBACK_ND)(id, SEL, id, void *); +/** Calls a 'callback' with the node as the first argument and the 2nd argument is data. + * ND means: Node and Data. Data is void *, so it could be anything. + */ +@interface CCCallFuncND : CCCallFuncN +{ + void *_data; + CC_CALLBACK_ND _callbackMethod; +} + +/** Invocation object that has the target#selector and the parameters */ +@property (nonatomic,readwrite) CC_CALLBACK_ND callbackMethod; + +/** creates the action with the callback and the data to pass as an argument */ ++(id) actionWithTarget: (id) t selector:(SEL) s data:(void*)d; +/** initializes the action with the callback and the data to pass as an argument */ +-(id) initWithTarget:(id) t selector:(SEL) s data:(void*) d; +@end + +/** Calls a 'callback' with an object as the first argument. + O means Object. + @since v0.99.5 + */ +@interface CCCallFuncO : CCCallFunc +{ + id _object; +} +/** object to be passed as argument */ +@property (nonatomic, readwrite, strong) id object; + +/** creates the action with the callback and the object to pass as an argument */ ++(id) actionWithTarget: (id) t selector:(SEL) s object:(id)object; +/** initializes the action with the callback and the object to pass as an argument */ +-(id) initWithTarget:(id) t selector:(SEL) s object:(id)object; + +@end + +#pragma mark Blocks Support + +/** Executes a callback using a block. + */ +@interface CCCallBlock : CCActionInstant +{ + void (^_block)(); +} + +/** creates the action with the specified block, to be used as a callback. + The block will be "copied". + */ ++(id) actionWithBlock:(void(^)())block; + +/** initialized the action with the specified block, to be used as a callback. + The block will be "copied". + */ +-(id) initWithBlock:(void(^)())block; + +/** executes the callback */ +-(void) execute; +@end + +@class CCNode; + +/** Executes a callback using a block with a single CCNode parameter. + */ +@interface CCCallBlockN : CCActionInstant +{ + void (^_block)(CCNode *); +} + +/** creates the action with the specified block, to be used as a callback. + The block will be "copied". + */ ++(id) actionWithBlock:(void(^)(CCNode *node))block; + +/** initialized the action with the specified block, to be used as a callback. + The block will be "copied". + */ +-(id) initWithBlock:(void(^)(CCNode *node))block; + +/** executes the callback */ +-(void) execute; +@end + +/** Executes a callback using a block with a single NSObject parameter. + @since v2.0 + */ +@interface CCCallBlockO : CCActionInstant +{ + void (^_block)(id object); + id _object; +} + +/** object to be passed to the block */ +@property (nonatomic,strong) id object; + +/** creates the action with the specified block, to be used as a callback. + The block will be "copied". + */ ++(id) actionWithBlock:(void(^)(id object))block object:(id)object; + +/** initialized the action with the specified block, to be used as a callback. + The block will be "copied". + */ +-(id) initWithBlock:(void(^)(id object))block object:(id)object; + +/** executes the callback */ +-(void) execute; +@end diff --git a/src/cocos2d/CCActionInstant.m b/cocos2d/CCActionInstant.m similarity index 72% rename from src/cocos2d/CCActionInstant.m rename to cocos2d/CCActionInstant.m index 9fbda59..2241adc 100644 --- a/src/cocos2d/CCActionInstant.m +++ b/cocos2d/CCActionInstant.m @@ -28,6 +28,7 @@ #import "CCActionInstant.h" #import "CCNode.h" #import "CCSprite.h" +#import // @@ -40,7 +41,7 @@ @implementation CCActionInstant -(id) init { if( (self=[super init]) ) - duration_ = 0; + _duration = 0; return self; } @@ -68,7 +69,7 @@ -(void) update: (ccTime) t -(CCFiniteTimeAction*) reverse { - return [[self copy] autorelease]; + return [self copy]; } @end @@ -80,7 +81,7 @@ -(CCFiniteTimeAction*) reverse @implementation CCShow -(void) update:(ccTime)time { - ((CCNode *)target_).visible = YES; + ((CCNode *)_target).visible = YES; } -(CCFiniteTimeAction*) reverse @@ -97,7 +98,7 @@ -(CCFiniteTimeAction*) reverse @implementation CCHide -(void) update:(ccTime)time { - ((CCNode *)target_).visible = NO; + ((CCNode *)_target).visible = NO; } -(CCFiniteTimeAction*) reverse @@ -114,7 +115,7 @@ -(CCFiniteTimeAction*) reverse @implementation CCToggleVisibility -(void) update:(ccTime)time { - ((CCNode *)target_).visible = !((CCNode *)target_).visible; + ((CCNode *)_target).visible = !((CCNode *)_target).visible; } @end @@ -126,30 +127,30 @@ -(void) update:(ccTime)time @implementation CCFlipX +(id) actionWithFlipX:(BOOL)x { - return [[[self alloc] initWithFlipX:x] autorelease]; + return [[self alloc] initWithFlipX:x]; } -(id) initWithFlipX:(BOOL)x { if(( self=[super init])) - flipX = x; + _flipX = x; return self; } -(void) update:(ccTime)time { - [(CCSprite*)target_ setFlipX:flipX]; + [(CCSprite*)_target setFlipX:_flipX]; } -(CCFiniteTimeAction*) reverse { - return [CCFlipX actionWithFlipX:!flipX]; + return [CCFlipX actionWithFlipX:!_flipX]; } -(id) copyWithZone: (NSZone*) zone { - CCActionInstant *copy = [[[self class] allocWithZone: zone] initWithFlipX:flipX]; + CCActionInstant *copy = [[[self class] allocWithZone: zone] initWithFlipX:_flipX]; return copy; } @end @@ -162,30 +163,30 @@ -(id) copyWithZone: (NSZone*) zone @implementation CCFlipY +(id) actionWithFlipY:(BOOL)y { - return [[[self alloc] initWithFlipY:y] autorelease]; + return [[self alloc] initWithFlipY:y]; } -(id) initWithFlipY:(BOOL)y { if(( self=[super init])) - flipY = y; + _flipY = y; return self; } -(void) update:(ccTime)time { - [(CCSprite*)target_ setFlipY:flipY]; + [(CCSprite*)_target setFlipY:_flipY]; } -(CCFiniteTimeAction*) reverse { - return [CCFlipY actionWithFlipY:!flipY]; + return [CCFlipY actionWithFlipY:!_flipY]; } -(id) copyWithZone: (NSZone*) zone { - CCActionInstant *copy = [[[self class] allocWithZone: zone] initWithFlipY:flipY]; + CCActionInstant *copy = [[[self class] allocWithZone: zone] initWithFlipY:_flipY]; return copy; } @end @@ -199,26 +200,26 @@ -(id) copyWithZone: (NSZone*) zone @implementation CCPlace +(id) actionWithPosition: (CGPoint) pos { - return [[[self alloc]initWithPosition:pos]autorelease]; + return [[self alloc]initWithPosition:pos]; } -(id) initWithPosition: (CGPoint) pos { if( (self=[super init]) ) - position = pos; + _position = pos; return self; } -(id) copyWithZone: (NSZone*) zone { - CCActionInstant *copy = [[[self class] allocWithZone: zone] initWithPosition: position]; + CCActionInstant *copy = [[[self class] allocWithZone: zone] initWithPosition: _position]; return copy; } -(void) update:(ccTime)time { - ((CCNode *)target_).position = position; + ((CCNode *)_target).position = _position; } @end @@ -230,18 +231,18 @@ -(void) update:(ccTime)time @implementation CCCallFunc -@synthesize targetCallback = targetCallback_; +@synthesize targetCallback = _targetCallback; +(id) actionWithTarget: (id) t selector:(SEL) s { - return [[[self alloc] initWithTarget: t selector: s] autorelease]; + return [[self alloc] initWithTarget: t selector: s]; } -(id) initWithTarget: (id) t selector:(SEL) s { if( (self=[super init]) ) { self.targetCallback = t; - selector_ = s; + _selector = s; } return self; } @@ -251,20 +252,15 @@ -(NSString*) description return [NSString stringWithFormat:@"<%@ = %p | Tag = %ld | selector = %@>", [self class], self, - (long)tag_, - NSStringFromSelector(selector_) + (long)_tag, + NSStringFromSelector(_selector) ]; } --(void) dealloc -{ - [targetCallback_ release]; - [super dealloc]; -} -(id) copyWithZone: (NSZone*) zone { - CCActionInstant *copy = [[[self class] allocWithZone: zone] initWithTarget:targetCallback_ selector:selector_]; + CCActionInstant *copy = [[[self class] allocWithZone: zone] initWithTarget:_targetCallback selector:_selector]; return copy; } @@ -275,7 +271,7 @@ -(void) update:(ccTime)time -(void) execute { - [targetCallback_ performSelector:selector_]; + objc_msgSend(_targetCallback, _selector); } @end @@ -288,7 +284,7 @@ @implementation CCCallFuncN -(void) execute { - [targetCallback_ performSelector:selector_ withObject:target_]; + objc_msgSend(_targetCallback, _selector, _target); } @end @@ -299,51 +295,46 @@ -(void) execute @implementation CCCallFuncND -@synthesize callbackMethod = callbackMethod_; +@synthesize callbackMethod = _callbackMethod; +(id) actionWithTarget:(id)t selector:(SEL)s data:(void*)d { - return [[[self alloc] initWithTarget:t selector:s data:d] autorelease]; + return [[self alloc] initWithTarget:t selector:s data:d]; } -(id) initWithTarget:(id)t selector:(SEL)s data:(void*)d { if( (self=[super initWithTarget:t selector:s]) ) { - data_ = d; + _data = d; #if COCOS2D_DEBUG NSMethodSignature * sig = [t methodSignatureForSelector:s]; // added NSAssert(sig !=0 , @"Signature not found for selector - does it have the following form? -(void)name:(id)sender data:(void*)data"); #endif - callbackMethod_ = (CC_CALLBACK_ND) [t methodForSelector:s]; + _callbackMethod = (CC_CALLBACK_ND) [t methodForSelector:s]; } return self; } -(id) copyWithZone: (NSZone*) zone { - CCActionInstant *copy = [[[self class] allocWithZone: zone] initWithTarget:targetCallback_ selector:selector_ data:data_]; + CCActionInstant *copy = [[[self class] allocWithZone: zone] initWithTarget:_targetCallback selector:_selector data:_data]; return copy; } --(void) dealloc -{ - // nothing to dealloc really. Everything is dealloc on super (CCCallFuncN) - [super dealloc]; -} -(void) execute { - callbackMethod_(targetCallback_,selector_,target_, data_); + _callbackMethod(_targetCallback,_selector,_target, _data); } @end @implementation CCCallFuncO -@synthesize object = object_; +@synthesize object = _object; +(id) actionWithTarget: (id) t selector:(SEL) s object:(id)object { - return [[[self alloc] initWithTarget:t selector:s object:object] autorelease]; + return [[self alloc] initWithTarget:t selector:s object:object]; } -(id) initWithTarget:(id) t selector:(SEL) s object:(id)object @@ -354,22 +345,17 @@ -(id) initWithTarget:(id) t selector:(SEL) s object:(id)object return self; } -- (void) dealloc -{ - [object_ release]; - [super dealloc]; -} -(id) copyWithZone: (NSZone*) zone { - CCActionInstant *copy = [[[self class] allocWithZone: zone] initWithTarget:targetCallback_ selector:selector_ object:object_]; + CCActionInstant *copy = [[[self class] allocWithZone: zone] initWithTarget:_targetCallback selector:_selector object:_object]; return copy; } -(void) execute { - [targetCallback_ performSelector:selector_ withObject:object_]; + objc_msgSend(_targetCallback, _selector, _object); } @end @@ -384,20 +370,20 @@ @implementation CCCallBlock +(id) actionWithBlock:(void(^)())block { - return [[[self alloc] initWithBlock:block] autorelease]; + return [[self alloc] initWithBlock:block]; } -(id) initWithBlock:(void(^)())block { if ((self = [super init])) - block_ = [block copy]; + _block = [block copy]; return self; } -(id) copyWithZone: (NSZone*) zone { - CCActionInstant *copy = [[[self class] allocWithZone: zone] initWithBlock:block_]; + CCActionInstant *copy = [[[self class] allocWithZone: zone] initWithBlock:_block]; return copy; } @@ -408,14 +394,9 @@ -(void) update:(ccTime)time -(void) execute { - block_(); + _block(); } --(void) dealloc -{ - [block_ release]; - [super dealloc]; -} @end @@ -425,20 +406,20 @@ @implementation CCCallBlockN +(id) actionWithBlock:(void(^)(CCNode *node))block { - return [[[self alloc] initWithBlock:block] autorelease]; + return [[self alloc] initWithBlock:block]; } -(id) initWithBlock:(void(^)(CCNode *node))block { if ((self = [super init])) - block_ = [block copy]; + _block = [block copy]; return self; } -(id) copyWithZone: (NSZone*) zone { - CCActionInstant *copy = [[[self class] allocWithZone: zone] initWithBlock:block_]; + CCActionInstant *copy = [[[self class] allocWithZone: zone] initWithBlock:_block]; return copy; } @@ -449,14 +430,9 @@ -(void) update:(ccTime)time -(void) execute { - block_(target_); + _block(_target); } --(void) dealloc -{ - [block_ release]; - [super dealloc]; -} @end @@ -464,18 +440,18 @@ -(void) dealloc @implementation CCCallBlockO -@synthesize object=object_; +@synthesize object=_object; +(id) actionWithBlock:(void(^)(id object))block object:(id)object { - return [[[self alloc] initWithBlock:block object:object] autorelease]; + return [[self alloc] initWithBlock:block object:object]; } -(id) initWithBlock:(void(^)(id object))block object:(id)object { if ((self = [super init])) { - block_ = [block copy]; - object_ = [object retain]; + _block = [block copy]; + _object = object; } return self; @@ -483,7 +459,7 @@ -(id) initWithBlock:(void(^)(id object))block object:(id)object -(id) copyWithZone: (NSZone*) zone { - CCActionInstant *copy = [[[self class] allocWithZone: zone] initWithBlock:block_]; + CCActionInstant *copy = [[[self class] allocWithZone: zone] initWithBlock:_block]; return copy; } @@ -494,16 +470,9 @@ -(void) update:(ccTime)time -(void) execute { - block_(object_); + _block(_object); } --(void) dealloc -{ - [object_ release]; - [block_ release]; - - [super dealloc]; -} @end diff --git a/cocos2d/CCActionInterval.h b/cocos2d/CCActionInterval.h new file mode 100644 index 0000000..564d89f --- /dev/null +++ b/cocos2d/CCActionInterval.h @@ -0,0 +1,473 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2008-2011 Ricardo Quesada + * Copyright (c) 2011 Zynga Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + */ + + +#import "CCNode.h" +#import "CCAction.h" +#import "CCProtocols.h" + +#include + +/** An interval action is an action that takes place within a certain period of time. +It has an start time, and a finish time. The finish time is the parameter +duration plus the start time. + +These CCActionInterval actions have some interesting properties, like: + - They can run normally (default) + - They can run reversed with the reverse method + - They can run with the time altered with the Accelerate, AccelDeccel and Speed actions. + +For example, you can simulate a Ping Pong effect running the action normally and +then running it again in Reverse mode. + +Example: + + CCAction * pingPongAction = [CCSequence actions: action, [action reverse], nil]; +*/ +@interface CCActionInterval: CCFiniteTimeAction +{ + ccTime _elapsed; + BOOL _firstTick; +} + +/** how many seconds had elapsed since the actions started to run. */ +@property (nonatomic,readonly) ccTime elapsed; + +/** creates the action */ ++(id) actionWithDuration: (ccTime) d; +/** initializes the action */ +-(id) initWithDuration: (ccTime) d; +/** returns YES if the action has finished */ +-(BOOL) isDone; +/** returns a reversed action */ +- (CCActionInterval*) reverse; +@end + +/** Runs actions sequentially, one after another + */ +@interface CCSequence : CCActionInterval +{ + CCFiniteTimeAction *_actions[2]; + ccTime _split; + int _last; +} +/** helper constructor to create an array of sequence-able actions */ ++(id) actions: (CCFiniteTimeAction*) action1, ... NS_REQUIRES_NIL_TERMINATION; +/** helper constructor to create an array of sequence-able actions */ ++(id) actions: (CCFiniteTimeAction*) action1 vaList:(va_list) args; +/** helper constructor to create an array of sequence-able actions given an array */ ++(id) actionWithArray: (NSArray*) arrayOfActions; +/** creates the action */ ++(id) actionOne:(CCFiniteTimeAction*)actionOne two:(CCFiniteTimeAction*)actionTwo; +/** initializes the action */ +-(id) initOne:(CCFiniteTimeAction*)actionOne two:(CCFiniteTimeAction*)actionTwo; +@end + + +/** Repeats an action a number of times. + * To repeat an action forever use the CCRepeatForever action. + */ +@interface CCRepeat : CCActionInterval +{ + NSUInteger _times; + NSUInteger _total; + ccTime _nextDt; + BOOL _isActionInstant; + CCFiniteTimeAction *_innerAction; +} + +/** Inner action */ +@property (nonatomic,readwrite,strong) CCFiniteTimeAction *innerAction; + +/** creates a CCRepeat action. Times is an unsigned integer between 1 and MAX_UINT. + */ ++(id) actionWithAction:(CCFiniteTimeAction*)action times: (NSUInteger)times; +/** initializes a CCRepeat action. Times is an unsigned integer between 1 and MAX_UINT */ +-(id) initWithAction:(CCFiniteTimeAction*)action times: (NSUInteger)times; +@end + +/** Spawn a new action immediately + */ +@interface CCSpawn : CCActionInterval +{ + CCFiniteTimeAction *_one; + CCFiniteTimeAction *_two; +} +/** helper constructor to create an array of spawned actions */ ++(id) actions: (CCFiniteTimeAction*) action1, ... NS_REQUIRES_NIL_TERMINATION; +/** helper constructor to create an array of spawned actions */ ++(id) actions: (CCFiniteTimeAction*) action1 vaList:(va_list)args; +/** helper constructor to create an array of spawned actions given an array */ ++(id) actionWithArray: (NSArray*) arrayOfActions; +/** creates the Spawn action */ ++(id) actionOne: (CCFiniteTimeAction*) one two:(CCFiniteTimeAction*) two; +/** initializes the Spawn action with the 2 actions to spawn */ +-(id) initOne: (CCFiniteTimeAction*) one two:(CCFiniteTimeAction*) two; +@end + +/** Rotates a CCNode object to a certain angle by modifying it's + rotation attribute. + The direction will be decided by the shortest angle. +*/ +@interface CCRotateTo : CCActionInterval +{ + float _dstAngleX; + float _startAngleX; + float _diffAngleX; + + float _dstAngleY; + float _startAngleY; + float _diffAngleY; +} +/** creates the action */ ++(id) actionWithDuration:(ccTime)duration angle:(float)angle; +/** initializes the action */ +-(id) initWithDuration:(ccTime)duration angle:(float)angle; + +/** creates the action with separate rotation angles */ ++(id) actionWithDuration: (ccTime) t angleX:(float) aX angleY:(float) aY; +-(id) initWithDuration: (ccTime) t angleX:(float) aX angleY:(float) aY; +@end + +/** Rotates a CCNode object clockwise a number of degrees by modifying its rotation attribute. +*/ +@interface CCRotateBy : CCActionInterval +{ + float _angleX; + float _startAngleX; + float _angleY; + float _startAngleY; +} +/** creates the action */ ++(id) actionWithDuration:(ccTime)duration angle:(float)deltaAngle; +/** initializes the action */ +-(id) initWithDuration:(ccTime)duration angle:(float)deltaAngle; + +/** creates the action with separate rotation angles */ ++(id) actionWithDuration: (ccTime) t angleX:(float) aX angleY:(float) aY; +-(id) initWithDuration: (ccTime) t angleX:(float) aX angleY:(float) aY; +@end + +/** Moves a CCNode object x,y pixels by modifying it's position attribute. + x and y are relative to the position of the object. + Several CCMoveBy actions can be concurrently called, and the resulting + movement will be the sum of individual movements. + @since v2.1beta2-custom + */ +@interface CCMoveBy : CCActionInterval +{ + CGPoint _positionDelta; + CGPoint _startPos; + CGPoint _previousPos; +} +/** creates the action */ ++(id) actionWithDuration: (ccTime)duration position:(CGPoint)deltaPosition; +/** initializes the action */ +-(id) initWithDuration: (ccTime)duration position:(CGPoint)deltaPosition; +@end + +/** Moves a CCNode object to the position x,y. x and y are absolute coordinates by modifying it's position attribute. + Several CCMoveTo actions can be concurrently called, and the resulting + movement will be the sum of individual movements. + @since v2.1beta2-custom + */ +@interface CCMoveTo : CCMoveBy +{ + CGPoint _endPosition; +} +/** creates the action */ ++(id) actionWithDuration:(ccTime)duration position:(CGPoint)position; +/** initializes the action */ +-(id) initWithDuration:(ccTime)duration position:(CGPoint)position; +@end + +/** Skews a CCNode object to given angles by modifying its skewX and skewY attributes + @since v1.0 + */ +@interface CCSkewTo : CCActionInterval +{ + float _skewX; + float _skewY; + float _startSkewX; + float _startSkewY; + float _endSkewX; + float _endSkewY; + float _deltaX; + float _deltaY; +} +/** creates the action */ ++(id) actionWithDuration:(ccTime)t skewX:(float)sx skewY:(float)sy; +/** initializes the action with duration, skew X and skew Y */ +-(id) initWithDuration:(ccTime)t skewX:(float)sx skewY:(float)sy; +@end + +/** Skews a CCNode object by skewX and skewY degrees + @since v1.0 + */ +@interface CCSkewBy : CCSkewTo +{ +} +/** initializes the action with duration, skew X and skew Y */ +-(id) initWithDuration:(ccTime)t skewX:(float)sx skewY:(float)sy; +@end + +/** Moves a CCNode object simulating a parabolic jump movement by modifying its position attribute. +*/ +@interface CCJumpBy : CCActionInterval +{ + CGPoint _startPosition; + CGPoint _delta; + ccTime _height; + NSUInteger _jumps; + CGPoint _previousPos; +} +/** creates the action */ ++(id) actionWithDuration: (ccTime)duration position:(CGPoint)position height:(ccTime)height jumps:(NSUInteger)jumps; +/** initializes the action */ +-(id) initWithDuration: (ccTime)duration position:(CGPoint)position height:(ccTime)height jumps:(NSUInteger)jumps; +@end + +/** Moves a CCNode object to a parabolic position simulating a jump movement by modifying its position attribute. +*/ +@interface CCJumpTo : CCJumpBy +{ +} +// XXX: Added to prevent bug on BridgeSupport +-(void) startWithTarget:(id)aTarget; +@end + +/** bezier configuration structure + */ +typedef struct _ccBezierConfig { + //! end position of the bezier + CGPoint endPosition; + //! Bezier control point 1 + CGPoint controlPoint_1; + //! Bezier control point 2 + CGPoint controlPoint_2; +} ccBezierConfig; + +/** An action that moves the target with a cubic Bezier curve by a certain distance. + */ +@interface CCBezierBy : CCActionInterval +{ + ccBezierConfig _config; + CGPoint _startPosition; + CGPoint _previousPosition; +} + +/** creates the action with a duration and a bezier configuration */ ++(id) actionWithDuration: (ccTime) t bezier:(ccBezierConfig) c; + +/** initializes the action with a duration and a bezier configuration */ +-(id) initWithDuration: (ccTime) t bezier:(ccBezierConfig) c; +@end + +/** An action that moves the target with a cubic Bezier curve to a destination point. + @since v0.8.2 + */ +@interface CCBezierTo : CCBezierBy +{ + ccBezierConfig _toConfig; +} +// XXX: Added to prevent bug on BridgeSupport +-(void) startWithTarget:(id)aTarget; +@end + +/** Scales a CCNode object to a zoom factor by modifying its scale attribute. + @warning This action doesn't support "reverse" + */ +@interface CCScaleTo : CCActionInterval +{ + float _scaleX; + float _scaleY; + float _startScaleX; + float _startScaleY; + float _endScaleX; + float _endScaleY; + float _deltaX; + float _deltaY; +} +/** creates the action with the same scale factor for X and Y */ ++(id) actionWithDuration: (ccTime)duration scale:(float) s; +/** initializes the action with the same scale factor for X and Y */ +-(id) initWithDuration: (ccTime)duration scale:(float) s; +/** creates the action with and X factor and a Y factor */ ++(id) actionWithDuration: (ccTime)duration scaleX:(float) sx scaleY:(float)sy; +/** initializes the action with and X factor and a Y factor */ +-(id) initWithDuration: (ccTime)duration scaleX:(float) sx scaleY:(float)sy; +@end + +/** Scales a CCNode object a zoom factor by modifying its scale attribute. +*/ +@interface CCScaleBy : CCScaleTo +{ +} +// XXX: Added to prevent bug on BridgeSupport +-(void) startWithTarget:(id)aTarget; +@end + +/** Blinks a CCNode object by modifying its visible attribute +*/ +@interface CCBlink : CCActionInterval +{ + NSUInteger _times; + BOOL _originalState; +} +/** creates the action */ ++(id) actionWithDuration: (ccTime)duration blinks:(NSUInteger)blinks; +/** initializes the action */ +-(id) initWithDuration: (ccTime)duration blinks:(NSUInteger)blinks; +@end + +/** Fades In an object that implements the CCRGBAProtocol protocol. It modifies the opacity from 0 to 255. + The "reverse" of this action is FadeOut + */ +@interface CCFadeIn : CCActionInterval +{ +} +// XXX: Added to prevent bug on BridgeSupport +-(void) update:(ccTime)dt; +@end + +/** Fades Out an object that implements the CCRGBAProtocol protocol. It modifies the opacity from 255 to 0. + The "reverse" of this action is FadeIn +*/ +@interface CCFadeOut : CCActionInterval +{ +} +// XXX: Added to prevent bug on BridgeSupport +-(void) update:(ccTime)dt; +@end + +/** Fades an object that implements the CCRGBAProtocol protocol. It modifies the opacity from the current value to a custom one. + @warning This action doesn't support "reverse" + */ +@interface CCFadeTo : CCActionInterval +{ + GLubyte _toOpacity; + GLubyte _fromOpacity; +} +/** creates an action with duration and opacity */ ++(id) actionWithDuration:(ccTime)duration opacity:(GLubyte)opactiy; +/** initializes the action with duration and opacity */ +-(id) initWithDuration:(ccTime)duration opacity:(GLubyte)opacity; +@end + +/** Tints a CCNode that implements the CCNodeRGB protocol from current tint to a custom one. + @warning This action doesn't support "reverse" + @since v0.7.2 +*/ +@interface CCTintTo : CCActionInterval +{ + ccColor3B _to; + ccColor3B _from; +} +/** creates an action with duration and color */ ++(id) actionWithDuration:(ccTime)duration red:(GLubyte)red green:(GLubyte)green blue:(GLubyte)blue; +/** initializes the action with duration and color */ +-(id) initWithDuration:(ccTime)duration red:(GLubyte)red green:(GLubyte)green blue:(GLubyte)blue; +@end + +/** Tints a CCNode that implements the CCNodeRGB protocol from current tint to a custom one. + @since v0.7.2 + */ +@interface CCTintBy : CCActionInterval +{ + GLshort _deltaR, _deltaG, _deltaB; + GLshort _fromR, _fromG, _fromB; +} +/** creates an action with duration and color */ ++(id) actionWithDuration:(ccTime)duration red:(GLshort)deltaRed green:(GLshort)deltaGreen blue:(GLshort)deltaBlue; +/** initializes the action with duration and color */ +-(id) initWithDuration:(ccTime)duration red:(GLshort)deltaRed green:(GLshort)deltaGreen blue:(GLshort)deltaBlue; +@end + +/** Delays the action a certain amount of seconds +*/ +@interface CCDelayTime : CCActionInterval +{ +} +// XXX: Added to prevent bug on BridgeSupport +-(void) update:(ccTime)dt; +@end + +/** Executes an action in reverse order, from time=duration to time=0 + + @warning Use this action carefully. This action is not + sequence-able. Use it as the default "reversed" method + of your own actions, but using it outside the "reversed" + scope is not recommended. +*/ +@interface CCReverseTime : CCActionInterval +{ + CCFiniteTimeAction * _other; +} +/** creates the action */ ++(id) actionWithAction: (CCFiniteTimeAction*) action; +/** initializes the action */ +-(id) initWithAction: (CCFiniteTimeAction*) action; +@end + + +@class CCAnimation; +@class CCTexture2D; +/** Animates a sprite given the name of an Animation */ +@interface CCAnimate : CCActionInterval +{ + NSMutableArray *_splitTimes; + NSInteger _nextFrame; + CCAnimation *_animation; + id _origFrame; + NSUInteger _executedLoops; +} +/** animation used for the image */ +@property (readwrite,nonatomic,strong) CCAnimation * animation; + +/** creates the action with an Animation and will restore the original frame when the animation is over */ ++(id) actionWithAnimation:(CCAnimation*)animation; +/** initializes the action with an Animation and will restore the original frame when the animation is over */ +-(id) initWithAnimation:(CCAnimation*)animation; +@end + +/** Overrides the target of an action so that it always runs on the target + * specified at action creation rather than the one specified by runAction. + */ +@interface CCTargetedAction : CCActionInterval +{ + id _forcedTarget; + CCFiniteTimeAction* _action; +} +/** This is the target that the action will be forced to run with */ +@property(readwrite,nonatomic,strong) id forcedTarget; + +/** Create an action with the specified action and forced target */ ++ (id) actionWithTarget:(id) target action:(CCFiniteTimeAction*) action; + +/** Init an action with the specified action and forced target */ +- (id) initWithTarget:(id) target action:(CCFiniteTimeAction*) action; + +@end diff --git a/src/cocos2d/CCActionInterval.m b/cocos2d/CCActionInterval.m similarity index 51% rename from src/cocos2d/CCActionInterval.m rename to cocos2d/CCActionInterval.m index 82fc95a..614455d 100644 --- a/src/cocos2d/CCActionInterval.m +++ b/cocos2d/CCActionInterval.m @@ -40,35 +40,37 @@ #pragma mark - CCIntervalAction @implementation CCActionInterval -@synthesize elapsed = elapsed_; +@synthesize elapsed = _elapsed; -(id) init { NSAssert(NO, @"IntervalActionInit: Init not supported. Use InitWithDuration"); - [self release]; return nil; } +(id) actionWithDuration: (ccTime) d { - return [[[self alloc] initWithDuration:d ] autorelease]; + return [[self alloc] initWithDuration:d ]; } +#pragma clang diagnostic push COCOS2D +#pragma clang diagnostic ignored "-Wfloat-equal" -(id) initWithDuration: (ccTime) d { if( (self=[super init]) ) { - duration_ = d; + _duration = d; // prevent division by 0 // This comparison could be in step:, but it might decrease the performance // by 3% in heavy based action games. - if( duration_ == 0 ) - duration_ = FLT_EPSILON; - elapsed_ = 0; - firstTick_ = YES; + if( _duration == 0 ) + _duration = FLT_EPSILON; + _elapsed = 0; + _firstTick = YES; } return self; } +#pragma clang diagnostic pop COCOS2D -(id) copyWithZone: (NSZone*) zone { @@ -78,21 +80,21 @@ -(id) copyWithZone: (NSZone*) zone - (BOOL) isDone { - return (elapsed_ >= duration_); + return (_elapsed >= _duration); } -(void) step: (ccTime) dt { - if( firstTick_ ) { - firstTick_ = NO; - elapsed_ = 0; + if( _firstTick ) { + _firstTick = NO; + _elapsed = 0; } else - elapsed_ += dt; + _elapsed += dt; [self update: MAX(0, // needed for rewind. elapsed could be negative - MIN(1, elapsed_/ - MAX(duration_,FLT_EPSILON) // division by 0 + MIN(1, _elapsed/ + MAX(_duration,FLT_EPSILON) // division by 0 ) ) ]; @@ -101,8 +103,8 @@ -(void) step: (ccTime) dt -(void) startWithTarget:(id)aTarget { [super startWithTarget:aTarget]; - elapsed_ = 0.0f; - firstTick_ = YES; + _elapsed = 0.0f; + _firstTick = YES; } - (CCActionInterval*) reverse @@ -119,23 +121,33 @@ - (CCActionInterval*) reverse @implementation CCSequence +(id) actions: (CCFiniteTimeAction*) action1, ... { - va_list params; - va_start(params,action1); - + va_list args; + va_start(args, action1); + + id ret = [self actions:action1 vaList:args]; + + va_end(args); + + return ret; +} + ++(id) actions: (CCFiniteTimeAction*) action1 vaList:(va_list)args +{ CCFiniteTimeAction *now; CCFiniteTimeAction *prev = action1; while( action1 ) { - now = va_arg(params,CCFiniteTimeAction*); + now = va_arg(args,CCFiniteTimeAction*); if ( now ) prev = [self actionOne: prev two: now]; else break; } - va_end(params); + return prev; } + +(id) actionWithArray: (NSArray*) actions { CCFiniteTimeAction *prev = [actions objectAtIndex:0]; @@ -148,25 +160,23 @@ +(id) actionWithArray: (NSArray*) actions +(id) actionOne: (CCFiniteTimeAction*) one two: (CCFiniteTimeAction*) two { - return [[[self alloc] initOne:one two:two ] autorelease]; + return [[self alloc] initOne:one two:two ]; } -(id) initOne: (CCFiniteTimeAction*) one two: (CCFiniteTimeAction*) two { NSAssert( one!=nil && two!=nil, @"Sequence: arguments must be non-nil"); - NSAssert( one!=actions_[0] && one!=actions_[1], @"Sequence: re-init using the same parameters is not supported"); - NSAssert( two!=actions_[1] && two!=actions_[0], @"Sequence: re-init using the same parameters is not supported"); + NSAssert( one!=_actions[0] && one!=_actions[1], @"Sequence: re-init using the same parameters is not supported"); + NSAssert( two!=_actions[1] && two!=_actions[0], @"Sequence: re-init using the same parameters is not supported"); ccTime d = [one duration] + [two duration]; if( (self=[super initWithDuration: d]) ) { - // XXX: Supports re-init without leaking. Fails if one==one_ || two==two_ - [actions_[0] release]; - [actions_[1] release]; + // XXX: Supports re-init without leaking. Fails if one==_one || two==_two - actions_[0] = [one retain]; - actions_[1] = [two retain]; + _actions[0] = one; + _actions[1] = two; } return self; @@ -174,87 +184,94 @@ -(id) initOne: (CCFiniteTimeAction*) one two: (CCFiniteTimeAction*) two -(id) copyWithZone: (NSZone*) zone { - CCAction *copy = [[[self class] allocWithZone:zone] initOne:[[actions_[0] copy] autorelease] two:[[actions_[1] copy] autorelease] ]; + CCAction *copy = [[[self class] allocWithZone:zone] initOne:[_actions[0] copy] two:[_actions[1] copy] ]; return copy; } --(void) dealloc -{ - [actions_[0] release]; - [actions_[1] release]; - [super dealloc]; -} -(void) startWithTarget:(id)aTarget { [super startWithTarget:aTarget]; - split_ = [actions_[0] duration] / MAX(duration_, FLT_EPSILON); - last_ = -1; + _split = [_actions[0] duration] / MAX(_duration, FLT_EPSILON); + _last = -1; } -(void) stop { // Issue #1305 - if( last_ != - 1) - [actions_[last_] stop]; + if( _last != - 1) + [_actions[_last] stop]; [super stop]; } +#pragma clang diagnostic push COCOS2D +#pragma clang diagnostic ignored "-Wfloat-equal" -(void) update: (ccTime) t { + int found = 0; ccTime new_t = 0.0f; - if( t < split_ ) { + if( t < _split ) { // action[0] found = 0; - if( split_ != 0 ) - new_t = t / split_; + if( _split != 0 ) + new_t = t / _split; else new_t = 1; } else { // action[1] found = 1; - if ( split_ == 1 ) + if ( _split == 1 ) new_t = 1; else - new_t = (t-split_) / (1 - split_ ); + new_t = (t-_split) / (1 - _split ); } if ( found==1 ) { - if( last_ == -1 ) { + if( _last == -1 ) { // action[0] was skipped, execute it. - [actions_[0] startWithTarget:target_]; - [actions_[0] update:1.0f]; - [actions_[0] stop]; + [_actions[0] startWithTarget:_target]; + [_actions[0] update:1.0f]; + [_actions[0] stop]; } - else if( last_ == 0 ) + else if( _last == 0 ) { // switching to action 1. stop action 0. - [actions_[0] update: 1.0f]; - [actions_[0] stop]; + [_actions[0] update: 1.0f]; + [_actions[0] stop]; } } - - // Last action found and it is done. - if( found == last_ && [actions_[found] isDone] ) { - return; - } + else if(found==0 && _last==1 ) + { + // Reverse mode ? + // XXX: Bug. this case doesn't contemplate when _last==-1, found=0 and in "reverse mode" + // since it will require a hack to know if an action is on reverse mode or not. + // "step" should be overriden, and the "reverseMode" value propagated to inner Sequences. + [_actions[1] update:0]; + [_actions[1] stop]; + } + // Last action found and it is done. + if( found == _last && [_actions[found] isDone] ) { + return; + } + // New action. Start it. - if( found != last_ ) - [actions_[found] startWithTarget:target_]; + if( found != _last ) + [_actions[found] startWithTarget:_target]; - [actions_[found] update: new_t]; - last_ = found; + [_actions[found] update: new_t]; + _last = found; } +#pragma clang diagnostic pop COCOS2D - (CCActionInterval *) reverse { - return [[self class] actionOne: [actions_[1] reverse] two: [actions_[0] reverse ] ]; + return [[self class] actionOne: [_actions[1] reverse] two: [_actions[0] reverse ] ]; } @end @@ -263,11 +280,11 @@ - (CCActionInterval *) reverse // #pragma mark - CCRepeat @implementation CCRepeat -@synthesize innerAction=innerAction_; +@synthesize innerAction=_innerAction; +(id) actionWithAction:(CCFiniteTimeAction*)action times:(NSUInteger)times { - return [[[self alloc] initWithAction:action times:times] autorelease]; + return [[self alloc] initWithAction:action times:times]; } -(id) initWithAction:(CCFiniteTimeAction*)action times:(NSUInteger)times @@ -275,40 +292,35 @@ -(id) initWithAction:(CCFiniteTimeAction*)action times:(NSUInteger)times ccTime d = [action duration] * times; if( (self=[super initWithDuration: d ]) ) { - times_ = times; + _times = times; self.innerAction = action; - isActionInstant_ = ([action isKindOfClass:[CCActionInstant class]]) ? YES : NO; + _isActionInstant = ([action isKindOfClass:[CCActionInstant class]]) ? YES : NO; //a instant action needs to be executed one time less in the update method since it uses startWithTarget to execute the action - if (isActionInstant_) times_ -=1; - total_ = 0; + if (_isActionInstant) _times -=1; + _total = 0; } return self; } -(id) copyWithZone: (NSZone*) zone { - CCAction *copy = [[[self class] allocWithZone:zone] initWithAction:[[innerAction_ copy] autorelease] times:times_]; + CCAction *copy = [[[self class] allocWithZone:zone] initWithAction:[_innerAction copy] times:_times]; return copy; } --(void) dealloc -{ - [innerAction_ release]; - [super dealloc]; -} -(void) startWithTarget:(id)aTarget { - total_ = 0; - nextDt_ = [innerAction_ duration]/duration_; + _total = 0; + _nextDt = [_innerAction duration]/_duration; [super startWithTarget:aTarget]; - [innerAction_ startWithTarget:aTarget]; + [_innerAction startWithTarget:aTarget]; } -(void) stop { - [innerAction_ stop]; + [_innerAction stop]; [super stop]; } @@ -317,54 +329,54 @@ -(void) stop // container action like CCRepeat, CCSequence, CCEase, etc.. -(void) update:(ccTime) dt { - if (dt >= nextDt_) + if (dt >= _nextDt) { - while (dt > nextDt_ && total_ < times_) + while (dt > _nextDt && _total < _times) { - [innerAction_ update:1.0f]; - total_++; + [_innerAction update:1.0f]; + _total++; - [innerAction_ stop]; - [innerAction_ startWithTarget:target_]; - nextDt_ += [innerAction_ duration]/duration_; + [_innerAction stop]; + [_innerAction startWithTarget:_target]; + _nextDt += [_innerAction duration]/_duration; } // fix for issue #1288, incorrect end value of repeat - if(dt >= 1.0f && total_ < times_) + if(dt >= 1.0f && _total < _times) { - total_++; + _total++; } // don't set a instantaction back or update it, it has no use because it has no duration - if (!isActionInstant_) + if (!_isActionInstant) { - if (total_ == times_) + if (_total == _times) { - [innerAction_ update:1]; - [innerAction_ stop]; + [_innerAction update:1]; + [_innerAction stop]; } else { // issue #390 prevent jerk, use right update - [innerAction_ update:dt - (nextDt_ - innerAction_.duration/duration_)]; + [_innerAction update:dt - (_nextDt - _innerAction.duration/_duration)]; } } } else { - [innerAction_ update:fmodf(dt * times_,1.0f)]; + [_innerAction update:fmodf(dt * _times,1.0f)]; } } -(BOOL) isDone { - return ( total_ == times_ ); + return ( _total == _times ); } - (CCActionInterval *) reverse { - return [[self class] actionWithAction:[innerAction_ reverse] times:times_]; + return [[self class] actionWithAction:[_innerAction reverse] times:_times]; } @end @@ -376,23 +388,32 @@ - (CCActionInterval *) reverse @implementation CCSpawn +(id) actions: (CCFiniteTimeAction*) action1, ... { - va_list params; - va_start(params,action1); + va_list args; + va_start(args, action1); + + id ret = [self actions:action1 vaList:args]; + va_end(args); + return ret; +} + ++(id) actions: (CCFiniteTimeAction*) action1 vaList:(va_list)args +{ CCFiniteTimeAction *now; CCFiniteTimeAction *prev = action1; - + while( action1 ) { - now = va_arg(params,CCFiniteTimeAction*); + now = va_arg(args,CCFiniteTimeAction*); if ( now ) prev = [self actionOne: prev two: now]; else break; } - va_end(params); + return prev; } + +(id) actionWithArray: (NSArray*) actions { CCFiniteTimeAction *prev = [actions objectAtIndex:0]; @@ -405,74 +426,64 @@ +(id) actionWithArray: (NSArray*) actions +(id) actionOne: (CCFiniteTimeAction*) one two: (CCFiniteTimeAction*) two { - return [[[self alloc] initOne:one two:two ] autorelease]; + return [[self alloc] initOne:one two:two ]; } -(id) initOne: (CCFiniteTimeAction*) one two: (CCFiniteTimeAction*) two { NSAssert( one!=nil && two!=nil, @"Spawn: arguments must be non-nil"); - NSAssert( one!=one_ && one!=two_, @"Spawn: reinit using same parameters is not supported"); - NSAssert( two!=two_ && two!=one_, @"Spawn: reinit using same parameters is not supported"); + NSAssert( one!=_one && one!=_two, @"Spawn: reinit using same parameters is not supported"); + NSAssert( two!=_two && two!=_one, @"Spawn: reinit using same parameters is not supported"); ccTime d1 = [one duration]; ccTime d2 = [two duration]; if( (self=[super initWithDuration: MAX(d1,d2)] ) ) { - // XXX: Supports re-init without leaking. Fails if one==one_ || two==two_ - [one_ release]; - [two_ release]; + // XXX: Supports re-init without leaking. Fails if one==_one || two==_two - one_ = one; - two_ = two; + _one = one; + _two = two; if( d1 > d2 ) - two_ = [CCSequence actionOne:two two:[CCDelayTime actionWithDuration: (d1-d2)] ]; + _two = [CCSequence actionOne:two two:[CCDelayTime actionWithDuration: (d1-d2)] ]; else if( d1 < d2) - one_ = [CCSequence actionOne:one two: [CCDelayTime actionWithDuration: (d2-d1)] ]; + _one = [CCSequence actionOne:one two: [CCDelayTime actionWithDuration: (d2-d1)] ]; - [one_ retain]; - [two_ retain]; } return self; } -(id) copyWithZone: (NSZone*) zone { - CCAction *copy = [[[self class] allocWithZone: zone] initOne: [[one_ copy] autorelease] two: [[two_ copy] autorelease] ]; + CCAction *copy = [[[self class] allocWithZone: zone] initOne: [_one copy] two: [_two copy] ]; return copy; } --(void) dealloc -{ - [one_ release]; - [two_ release]; - [super dealloc]; -} -(void) startWithTarget:(id)aTarget { [super startWithTarget:aTarget]; - [one_ startWithTarget:target_]; - [two_ startWithTarget:target_]; + [_one startWithTarget:_target]; + [_two startWithTarget:_target]; } -(void) stop { - [one_ stop]; - [two_ stop]; + [_one stop]; + [_two stop]; [super stop]; } -(void) update: (ccTime) t { - [one_ update:t]; - [two_ update:t]; + [_one update:t]; + [_two update:t]; } - (CCActionInterval *) reverse { - return [[self class] actionOne: [one_ reverse] two: [two_ reverse ] ]; + return [[self class] actionOne: [_one reverse] two: [_two reverse ] ]; } @end @@ -484,42 +495,72 @@ - (CCActionInterval *) reverse @implementation CCRotateTo +(id) actionWithDuration: (ccTime) t angle:(float) a { - return [[[self alloc] initWithDuration:t angle:a ] autorelease]; + return [[self alloc] initWithDuration:t angle:a ]; } -(id) initWithDuration: (ccTime) t angle:(float) a { if( (self=[super initWithDuration: t]) ) - dstAngle_ = a; + _dstAngleX = _dstAngleY = a; + + return self; +} + ++(id) actionWithDuration: (ccTime) t angleX:(float) aX angleY:(float) aY +{ + return [[self alloc] initWithDuration:t angleX:aX angleY:aY ]; +} +-(id) initWithDuration: (ccTime) t angleX:(float) aX angleY:(float) aY +{ + if( (self=[super initWithDuration: t]) ){ + _dstAngleX = aX; + _dstAngleY = aY; + } return self; } -(id) copyWithZone: (NSZone*) zone { - CCAction *copy = [[[self class] allocWithZone: zone] initWithDuration:[self duration] angle:dstAngle_]; + CCAction *copy = [[[self class] allocWithZone: zone] initWithDuration:[self duration] angleX:_dstAngleX angleY:_dstAngleY]; return copy; } --(void) startWithTarget:(CCNode *)aTarget +-(void) startWithTarget:(id)aTarget { [super startWithTarget:aTarget]; - startAngle_ = [target_ rotation]; - if (startAngle_ > 0) - startAngle_ = fmodf(startAngle_, 360.0f); + //Calculate X + _startAngleX = [_target rotationalSkewX]; + if (_startAngleX > 0) + _startAngleX = fmodf(_startAngleX, 360.0f); else - startAngle_ = fmodf(startAngle_, -360.0f); - - diffAngle_ =dstAngle_ - startAngle_; - if (diffAngle_ > 180) - diffAngle_ -= 360; - if (diffAngle_ < -180) - diffAngle_ += 360; + _startAngleX = fmodf(_startAngleX, -360.0f); + + _diffAngleX = _dstAngleX - _startAngleX; + if (_diffAngleX > 180) + _diffAngleX -= 360; + if (_diffAngleX < -180) + _diffAngleX += 360; + + + //Calculate Y: It's duplicated from calculating X since the rotation wrap should be the same + _startAngleY = [_target rotationalSkewY]; + if (_startAngleY > 0) + _startAngleY = fmodf(_startAngleY, 360.0f); + else + _startAngleY = fmodf(_startAngleY, -360.0f); + + _diffAngleY = _dstAngleY - _startAngleY; + if (_diffAngleY > 180) + _diffAngleY -= 360; + if (_diffAngleY < -180) + _diffAngleY += 360; } -(void) update: (ccTime) t { - [target_ setRotation: startAngle_ + diffAngle_ * t]; + [_target setRotationalSkewX: _startAngleX + _diffAngleX * t]; + [_target setRotationalSkewY: _startAngleY + _diffAngleY * t]; } @end @@ -527,124 +568,151 @@ -(void) update: (ccTime) t // // RotateBy // -#pragma mark - CCRotateBy +#pragma mark - RotateBy @implementation CCRotateBy +(id) actionWithDuration: (ccTime) t angle:(float) a { - return [[[self alloc] initWithDuration:t angle:a ] autorelease]; + return [[self alloc] initWithDuration:t angle:a ]; } -(id) initWithDuration: (ccTime) t angle:(float) a { if( (self=[super initWithDuration: t]) ) - angle_ = a; + _angleX = _angleY = a; + + return self; +} ++(id) actionWithDuration: (ccTime) t angleX:(float) aX angleY:(float) aY +{ + return [[self alloc] initWithDuration:t angleX:aX angleY:aY ]; +} + +-(id) initWithDuration: (ccTime) t angleX:(float) aX angleY:(float) aY +{ + if( (self=[super initWithDuration: t]) ){ + _angleX = aX; + _angleY = aY; + } return self; } -(id) copyWithZone: (NSZone*) zone { - CCAction *copy = [[[self class] allocWithZone: zone] initWithDuration: [self duration] angle: angle_]; + CCAction *copy = [[[self class] allocWithZone: zone] initWithDuration: [self duration] angleX: _angleX angleY:_angleY]; return copy; } -(void) startWithTarget:(id)aTarget { [super startWithTarget:aTarget]; - startAngle_ = [target_ rotation]; + _startAngleX = [_target rotationalSkewX]; + _startAngleY = [_target rotationalSkewY]; } -(void) update: (ccTime) t { // XXX: shall I add % 360 - [target_ setRotation: (startAngle_ +angle_ * t )]; + [_target setRotationalSkewX: (_startAngleX + _angleX * t )]; + [_target setRotationalSkewY: (_startAngleY + _angleY * t )]; } -(CCActionInterval*) reverse { - return [[self class] actionWithDuration:duration_ angle:-angle_]; + return [[self class] actionWithDuration:_duration angleX:-_angleX angleY:-_angleY]; } @end // -// MoveTo +// MoveBy // -#pragma mark - CCMoveTo +#pragma mark - MoveBy -@implementation CCMoveTo +@implementation CCMoveBy +(id) actionWithDuration: (ccTime) t position: (CGPoint) p { - return [[[self alloc] initWithDuration:t position:p ] autorelease]; + return [[self alloc] initWithDuration:t position:p ]; } -(id) initWithDuration: (ccTime) t position: (CGPoint) p { if( (self=[super initWithDuration: t]) ) - endPosition_ = p; - + _positionDelta = p; return self; } -(id) copyWithZone: (NSZone*) zone { - CCAction *copy = [[[self class] allocWithZone: zone] initWithDuration: [self duration] position: endPosition_]; - return copy; + return [[[self class] allocWithZone: zone] initWithDuration:[self duration] position:_positionDelta]; } --(void) startWithTarget:(CCNode *)aTarget +-(void) startWithTarget:(id)target { - [super startWithTarget:aTarget]; - startPosition_ = [(CCNode*)target_ position]; - delta_ = ccpSub( endPosition_, startPosition_ ); + CCNode *targetNode = (CCNode *)target; + [super startWithTarget:targetNode]; + _previousPos = _startPos = targetNode.position; +} + +-(CCActionInterval*) reverse +{ + return [[self class] actionWithDuration:_duration position:ccp( -_positionDelta.x, -_positionDelta.y)]; } -(void) update: (ccTime) t { - [target_ setPosition: ccp( (startPosition_.x + delta_.x * t ), (startPosition_.y + delta_.y * t ) )]; + + CCNode *node = (CCNode*)_target; + +#if CC_ENABLE_STACKABLE_ACTIONS + CGPoint currentPos = [node position]; + CGPoint diff = ccpSub(currentPos, _previousPos); + _startPos = ccpAdd( _startPos, diff); + CGPoint newPos = ccpAdd( _startPos, ccpMult(_positionDelta, t) ); + [_target setPosition: newPos]; + _previousPos = newPos; +#else + [node setPosition: ccpAdd( _startPos, ccpMult(_positionDelta, t))]; +#endif // CC_ENABLE_STACKABLE_ACTIONS } @end // -// MoveBy +// MoveTo // -#pragma mark - CCMoveBy +#pragma mark - +#pragma mark MoveTo -@implementation CCMoveBy +@implementation CCMoveTo +(id) actionWithDuration: (ccTime) t position: (CGPoint) p { - return [[[self alloc] initWithDuration:t position:p ] autorelease]; + return [[self alloc] initWithDuration:t position:p ]; } -(id) initWithDuration: (ccTime) t position: (CGPoint) p { - if( (self=[super initWithDuration: t]) ) - delta_ = p; + if( (self=[super initWithDuration: t]) ) { + _endPosition = p; + } return self; } -(id) copyWithZone: (NSZone*) zone { - CCAction *copy = [[[self class] allocWithZone: zone] initWithDuration: [self duration] position: delta_]; + CCAction *copy = [[[self class] allocWithZone: zone] initWithDuration: [self duration] position: _endPosition]; return copy; } --(void) startWithTarget:(CCNode *)aTarget +-(void) startWithTarget:(id)aTarget { - CGPoint dTmp = delta_; [super startWithTarget:aTarget]; - delta_ = dTmp; + _positionDelta = ccpSub( _endPosition, [(CCNode*)_target position] ); } --(CCActionInterval*) reverse -{ - return [[self class] actionWithDuration:duration_ position:ccp( -delta_.x, -delta_.y)]; -} @end - // // SkewTo // @@ -653,65 +721,65 @@ -(CCActionInterval*) reverse @implementation CCSkewTo +(id) actionWithDuration:(ccTime)t skewX:(float)sx skewY:(float)sy { - return [[[self alloc] initWithDuration: t skewX:sx skewY:sy] autorelease]; + return [[self alloc] initWithDuration: t skewX:sx skewY:sy]; } -(id) initWithDuration:(ccTime)t skewX:(float)sx skewY:(float)sy { if( (self=[super initWithDuration:t]) ) { - endSkewX_ = sx; - endSkewY_ = sy; + _endSkewX = sx; + _endSkewY = sy; } return self; } -(id) copyWithZone: (NSZone*) zone { - CCAction *copy = [[[self class] allocWithZone: zone] initWithDuration:[self duration] skewX:endSkewX_ skewY:endSkewY_]; + CCAction *copy = [[[self class] allocWithZone: zone] initWithDuration:[self duration] skewX:_endSkewX skewY:_endSkewY]; return copy; } --(void) startWithTarget:(CCNode *)aTarget +-(void) startWithTarget:(id)aTarget { [super startWithTarget:aTarget]; - startSkewX_ = [target_ skewX]; + _startSkewX = [_target skewX]; - if (startSkewX_ > 0) - startSkewX_ = fmodf(startSkewX_, 180.0f); + if (_startSkewX > 0) + _startSkewX = fmodf(_startSkewX, 180.0f); else - startSkewX_ = fmodf(startSkewX_, -180.0f); + _startSkewX = fmodf(_startSkewX, -180.0f); - deltaX_ = endSkewX_ - startSkewX_; + _deltaX = _endSkewX - _startSkewX; - if ( deltaX_ > 180 ) { - deltaX_ -= 360; + if ( _deltaX > 180 ) { + _deltaX -= 360; } - if ( deltaX_ < -180 ) { - deltaX_ += 360; + if ( _deltaX < -180 ) { + _deltaX += 360; } - startSkewY_ = [target_ skewY]; + _startSkewY = [_target skewY]; - if (startSkewY_ > 0) - startSkewY_ = fmodf(startSkewY_, 360.0f); + if (_startSkewY > 0) + _startSkewY = fmodf(_startSkewY, 360.0f); else - startSkewY_ = fmodf(startSkewY_, -360.0f); + _startSkewY = fmodf(_startSkewY, -360.0f); - deltaY_ = endSkewY_ - startSkewY_; + _deltaY = _endSkewY - _startSkewY; - if ( deltaY_ > 180 ) { - deltaY_ -= 360; + if ( _deltaY > 180 ) { + _deltaY -= 360; } - if ( deltaY_ < -180 ) { - deltaY_ += 360; + if ( _deltaY < -180 ) { + _deltaY += 360; } } -(void) update: (ccTime) t { - [target_ setSkewX: (startSkewX_ + deltaX_ * t ) ]; - [target_ setSkewY: (startSkewY_ + deltaY_ * t ) ]; + [_target setSkewX: (_startSkewX + _deltaX * t ) ]; + [_target setSkewY: (_startSkewY + _deltaY * t ) ]; } @end @@ -726,24 +794,24 @@ @implementation CCSkewBy -(id) initWithDuration:(ccTime)t skewX:(float)deltaSkewX skewY:(float)deltaSkewY { if( (self=[super initWithDuration:t skewX:deltaSkewX skewY:deltaSkewY]) ) { - skewX_ = deltaSkewX; - skewY_ = deltaSkewY; + _skewX = deltaSkewX; + _skewY = deltaSkewY; } return self; } --(void) startWithTarget:(CCNode *)aTarget +-(void) startWithTarget:(id)aTarget { [super startWithTarget:aTarget]; - deltaX_ = skewX_; - deltaY_ = skewY_; - endSkewX_ = startSkewX_ + deltaX_; - endSkewY_ = startSkewY_ + deltaY_; + _deltaX = _skewX; + _deltaY = _skewY; + _endSkewX = _startSkewX + _deltaX; + _endSkewY = _startSkewY + _deltaY; } -(CCActionInterval*) reverse { - return [[self class] actionWithDuration:duration_ skewX:-skewX_ skewY:-skewY_]; + return [[self class] actionWithDuration:_duration skewX:-_skewX skewY:-_skewY]; } @end @@ -756,51 +824,64 @@ -(CCActionInterval*) reverse @implementation CCJumpBy +(id) actionWithDuration: (ccTime) t position: (CGPoint) pos height: (ccTime) h jumps:(NSUInteger)j { - return [[[self alloc] initWithDuration: t position: pos height: h jumps:j] autorelease]; + return [[self alloc] initWithDuration: t position: pos height: h jumps:j]; } -(id) initWithDuration: (ccTime) t position: (CGPoint) pos height: (ccTime) h jumps:(NSUInteger)j { if( (self=[super initWithDuration:t]) ) { - delta_ = pos; - height_ = h; - jumps_ = j; + _delta = pos; + _height = h; + _jumps = j; } return self; } -(id) copyWithZone: (NSZone*) zone { - CCAction *copy = [[[self class] allocWithZone: zone] initWithDuration:[self duration] position:delta_ height:height_ jumps:jumps_]; + CCAction *copy = [[[self class] allocWithZone: zone] initWithDuration:[self duration] position:_delta height:_height jumps:_jumps]; return copy; } --(void) startWithTarget:(id)aTarget +-(void) startWithTarget:(id)target { - [super startWithTarget:aTarget]; - startPosition_ = [(CCNode*)target_ position]; + [super startWithTarget:target]; + _previousPos = _startPosition = [(CCNode*)_target position]; } -(void) update: (ccTime) t { // Sin jump. Less realistic -// ccTime y = height * fabsf( sinf(t * (CGFloat)M_PI * jumps ) ); -// y += delta.y * t; -// ccTime x = delta.x * t; -// [target setPosition: ccp( startPosition.x + x, startPosition.y + y )]; +// ccTime y = _height * fabsf( sinf(t * (CGFloat)M_PI * _jumps ) ); +// y += _delta.y * dt; + +// // parabolic jump (since v0.8.2) + CGFloat frac = fmodf( t * _jumps, 1.0f ); + CGFloat y = _height * 4 * frac * (1 - frac); + y += _delta.y * t; - // parabolic jump (since v0.8.2) - ccTime frac = fmodf( t * jumps_, 1.0f ); - ccTime y = height_ * 4 * frac * (1 - frac); - y += delta_.y * t; - ccTime x = delta_.x * t; - [target_ setPosition: ccp( startPosition_.x + x, startPosition_.y + y )]; + CGFloat x = _delta.x * t; + + CCNode *node = (CCNode*)_target; +#if CC_ENABLE_STACKABLE_ACTIONS + CGPoint currentPos = [node position]; + + CGPoint diff = ccpSub( currentPos, _previousPos ); + _startPosition = ccpAdd( diff, _startPosition); + + CGPoint newPos = ccpAdd( _startPosition, ccp(x,y)); + [node setPosition:newPos]; + + _previousPos = newPos; +#else + [node setPosition: ccpAdd( _startPosition, ccp(x,y))]; +#endif // !CC_ENABLE_STACKABLE_ACTIONS } -(CCActionInterval*) reverse { - return [[self class] actionWithDuration:duration_ position: ccp(-delta_.x,-delta_.y) height:height_ jumps:jumps_]; + return [[self class] actionWithDuration:_duration position: ccp(-_delta.x,-_delta.y) height:_height jumps:_jumps]; } @end @@ -810,10 +891,10 @@ -(CCActionInterval*) reverse #pragma mark - CCJumpTo @implementation CCJumpTo --(void) startWithTarget:(CCNode *)aTarget +-(void) startWithTarget:(id)aTarget { [super startWithTarget:aTarget]; - delta_ = ccp( delta_.x - startPosition_.x, delta_.y - startPosition_.y ); + _delta = ccp( _delta.x - _startPosition.x, _delta.y - _startPosition.y ); } @end @@ -838,53 +919,66 @@ static inline CGFloat bezierat( float a, float b, float c, float d, ccTime t ) @implementation CCBezierBy +(id) actionWithDuration: (ccTime) t bezier:(ccBezierConfig) c { - return [[[self alloc] initWithDuration:t bezier:c ] autorelease]; + return [[self alloc] initWithDuration:t bezier:c ]; } -(id) initWithDuration: (ccTime) t bezier:(ccBezierConfig) c { if( (self=[super initWithDuration: t]) ) { - config_ = c; + _config = c; } return self; } -(id) copyWithZone: (NSZone*) zone { - CCAction *copy = [[[self class] allocWithZone: zone] initWithDuration:[self duration] bezier:config_]; - return copy; + return [[[self class] allocWithZone: zone] initWithDuration:[self duration] bezier:_config]; } -(void) startWithTarget:(id)aTarget { [super startWithTarget:aTarget]; - startPosition_ = [(CCNode*)target_ position]; + _previousPosition = _startPosition = [(CCNode*)_target position]; } -(void) update: (ccTime) t { CGFloat xa = 0; - CGFloat xb = config_.controlPoint_1.x; - CGFloat xc = config_.controlPoint_2.x; - CGFloat xd = config_.endPosition.x; + CGFloat xb = _config.controlPoint_1.x; + CGFloat xc = _config.controlPoint_2.x; + CGFloat xd = _config.endPosition.x; CGFloat ya = 0; - CGFloat yb = config_.controlPoint_1.y; - CGFloat yc = config_.controlPoint_2.y; - CGFloat yd = config_.endPosition.y; + CGFloat yb = _config.controlPoint_1.y; + CGFloat yc = _config.controlPoint_2.y; + CGFloat yd = _config.endPosition.y; CGFloat x = bezierat(xa, xb, xc, xd, t); CGFloat y = bezierat(ya, yb, yc, yd, t); - [target_ setPosition: ccpAdd( startPosition_, ccp(x,y))]; + + CCNode *node = (CCNode*)_target; + +#if CC_ENABLE_STACKABLE_ACTIONS + CGPoint currentPos = [node position]; + CGPoint diff = ccpSub(currentPos, _previousPosition); + _startPosition = ccpAdd( _startPosition, diff); + + CGPoint newPos = ccpAdd( _startPosition, ccp(x,y)); + [node setPosition: newPos]; + + _previousPosition = newPos; +#else + [node setPosition: ccpAdd( _startPosition, ccp(x,y))]; +#endif // !CC_ENABLE_STACKABLE_ACTIONS } - (CCActionInterval*) reverse { ccBezierConfig r; - r.endPosition = ccpNeg(config_.endPosition); - r.controlPoint_1 = ccpAdd(config_.controlPoint_2, ccpNeg(config_.endPosition)); - r.controlPoint_2 = ccpAdd(config_.controlPoint_1, ccpNeg(config_.endPosition)); + r.endPosition = ccpNeg(_config.endPosition); + r.controlPoint_1 = ccpAdd(_config.controlPoint_2, ccpNeg(_config.endPosition)); + r.controlPoint_2 = ccpAdd(_config.controlPoint_1, ccpNeg(_config.endPosition)); CCBezierBy *action = [[self class] actionWithDuration:[self duration] bezier:r]; return action; @@ -896,13 +990,27 @@ - (CCActionInterval*) reverse // #pragma mark - CCBezierTo @implementation CCBezierTo +-(id) initWithDuration: (ccTime) t bezier:(ccBezierConfig) c +{ + if( (self=[super initWithDuration: t]) ) { + _toConfig = c; + } + return self; +} + -(void) startWithTarget:(id)aTarget { [super startWithTarget:aTarget]; - config_.controlPoint_1 = ccpSub(config_.controlPoint_1, startPosition_); - config_.controlPoint_2 = ccpSub(config_.controlPoint_2, startPosition_); - config_.endPosition = ccpSub(config_.endPosition, startPosition_); + _config.controlPoint_1 = ccpSub(_toConfig.controlPoint_1, _startPosition); + _config.controlPoint_2 = ccpSub(_toConfig.controlPoint_2, _startPosition); + _config.endPosition = ccpSub(_toConfig.endPosition, _startPosition); } + +-(id) copyWithZone: (NSZone*) zone +{ + return [[[self class] allocWithZone: zone] initWithDuration:[self duration] bezier:_toConfig]; +} + @end @@ -913,51 +1021,51 @@ -(void) startWithTarget:(id)aTarget @implementation CCScaleTo +(id) actionWithDuration: (ccTime) t scale:(float) s { - return [[[self alloc] initWithDuration: t scale:s] autorelease]; + return [[self alloc] initWithDuration: t scale:s]; } -(id) initWithDuration: (ccTime) t scale:(float) s { if( (self=[super initWithDuration: t]) ) { - endScaleX_ = s; - endScaleY_ = s; + _endScaleX = s; + _endScaleY = s; } return self; } +(id) actionWithDuration: (ccTime) t scaleX:(float)sx scaleY:(float)sy { - return [[[self alloc] initWithDuration: t scaleX:sx scaleY:sy] autorelease]; + return [[self alloc] initWithDuration: t scaleX:sx scaleY:sy]; } -(id) initWithDuration: (ccTime) t scaleX:(float)sx scaleY:(float)sy { if( (self=[super initWithDuration: t]) ) { - endScaleX_ = sx; - endScaleY_ = sy; + _endScaleX = sx; + _endScaleY = sy; } return self; } -(id) copyWithZone: (NSZone*) zone { - CCAction *copy = [[[self class] allocWithZone: zone] initWithDuration:[self duration] scaleX:endScaleX_ scaleY:endScaleY_]; + CCAction *copy = [[[self class] allocWithZone: zone] initWithDuration:[self duration] scaleX:_endScaleX scaleY:_endScaleY]; return copy; } --(void) startWithTarget:(CCNode *)aTarget +-(void) startWithTarget:(id)aTarget { [super startWithTarget:aTarget]; - startScaleX_ = [target_ scaleX]; - startScaleY_ = [target_ scaleY]; - deltaX_ = endScaleX_ - startScaleX_; - deltaY_ = endScaleY_ - startScaleY_; + _startScaleX = [_target scaleX]; + _startScaleY = [_target scaleY]; + _deltaX = _endScaleX - _startScaleX; + _deltaY = _endScaleY - _startScaleY; } -(void) update: (ccTime) t { - [target_ setScaleX: (startScaleX_ + deltaX_ * t ) ]; - [target_ setScaleY: (startScaleY_ + deltaY_ * t ) ]; + [_target setScaleX: (_startScaleX + _deltaX * t ) ]; + [_target setScaleY: (_startScaleY + _deltaY * t ) ]; } @end @@ -966,16 +1074,16 @@ -(void) update: (ccTime) t // #pragma mark - CCScaleBy @implementation CCScaleBy --(void) startWithTarget:(CCNode *)aTarget +-(void) startWithTarget:(id)aTarget { [super startWithTarget:aTarget]; - deltaX_ = startScaleX_ * endScaleX_ - startScaleX_; - deltaY_ = startScaleY_ * endScaleY_ - startScaleY_; + _deltaX = _startScaleX * _endScaleX - _startScaleX; + _deltaY = _startScaleY * _endScaleY - _startScaleY; } -(CCActionInterval*) reverse { - return [[self class] actionWithDuration:duration_ scaleX:1/endScaleX_ scaleY:1/endScaleY_]; + return [[self class] actionWithDuration:_duration scaleX:1/_endScaleX scaleY:1/_endScaleY]; } @end @@ -986,36 +1094,48 @@ -(CCActionInterval*) reverse @implementation CCBlink +(id) actionWithDuration: (ccTime) t blinks: (NSUInteger) b { - return [[[ self alloc] initWithDuration: t blinks: b] autorelease]; + return [[ self alloc] initWithDuration: t blinks: b]; } -(id) initWithDuration: (ccTime) t blinks: (NSUInteger) b { if( (self=[super initWithDuration: t] ) ) - times_ = b; + _times = b; return self; } -(id) copyWithZone: (NSZone*) zone { - CCAction *copy = [[[self class] allocWithZone: zone] initWithDuration: [self duration] blinks: times_]; + CCAction *copy = [[[self class] allocWithZone: zone] initWithDuration: [self duration] blinks: _times]; return copy; } +-(void) startWithTarget:(id)target +{ + [super startWithTarget:target]; + _originalState = [target visible]; +} + -(void) update: (ccTime) t { if( ! [self isDone] ) { - ccTime slice = 1.0f / times_; + ccTime slice = 1.0f / _times; ccTime m = fmodf(t, slice); - [target_ setVisible: (m > slice/2) ? YES : NO]; + [_target setVisible: (m > slice/2) ? YES : NO]; } } +-(void) stop +{ + [_target setVisible:_originalState]; + [super stop]; +} + -(CCActionInterval*) reverse { // return 'self' - return [[self class] actionWithDuration:duration_ blinks: times_]; + return [[self class] actionWithDuration:_duration blinks: _times]; } @end @@ -1026,12 +1146,12 @@ -(CCActionInterval*) reverse @implementation CCFadeIn -(void) update: (ccTime) t { - [(id) target_ setOpacity: 255 *t]; + [(id) _target setOpacity: 255 *t]; } -(CCActionInterval*) reverse { - return [CCFadeOut actionWithDuration:duration_]; + return [CCFadeOut actionWithDuration:_duration]; } @end @@ -1042,12 +1162,12 @@ -(CCActionInterval*) reverse @implementation CCFadeOut -(void) update: (ccTime) t { - [(id) target_ setOpacity: 255 *(1-t)]; + [(id) _target setOpacity: 255 *(1-t)]; } -(CCActionInterval*) reverse { - return [CCFadeIn actionWithDuration:duration_]; + return [CCFadeIn actionWithDuration:_duration]; } @end @@ -1058,32 +1178,32 @@ -(CCActionInterval*) reverse @implementation CCFadeTo +(id) actionWithDuration: (ccTime) t opacity: (GLubyte) o { - return [[[ self alloc] initWithDuration: t opacity: o] autorelease]; + return [[ self alloc] initWithDuration: t opacity: o]; } -(id) initWithDuration: (ccTime) t opacity: (GLubyte) o { if( (self=[super initWithDuration: t] ) ) - toOpacity_ = o; + _toOpacity = o; return self; } -(id) copyWithZone: (NSZone*) zone { - CCAction *copy = [[[self class] allocWithZone: zone] initWithDuration:[self duration] opacity:toOpacity_]; + CCAction *copy = [[[self class] allocWithZone: zone] initWithDuration:[self duration] opacity:_toOpacity]; return copy; } --(void) startWithTarget:(CCNode *)aTarget +-(void) startWithTarget:(id)aTarget { [super startWithTarget:aTarget]; - fromOpacity_ = [(id)target_ opacity]; + _fromOpacity = [(id)_target opacity]; } -(void) update: (ccTime) t { - [(id)target_ setOpacity:fromOpacity_ + ( toOpacity_ - fromOpacity_ ) * t]; + [(id)_target setOpacity:_fromOpacity + ( _toOpacity - _fromOpacity ) * t]; } @end @@ -1094,20 +1214,20 @@ -(void) update: (ccTime) t @implementation CCTintTo +(id) actionWithDuration:(ccTime)t red:(GLubyte)r green:(GLubyte)g blue:(GLubyte)b { - return [[(CCTintTo*)[ self alloc] initWithDuration:t red:r green:g blue:b] autorelease]; + return [(CCTintTo*)[ self alloc] initWithDuration:t red:r green:g blue:b]; } -(id) initWithDuration: (ccTime) t red:(GLubyte)r green:(GLubyte)g blue:(GLubyte)b { if( (self=[super initWithDuration:t] ) ) - to_ = ccc3(r,g,b); + _to = ccc3(r,g,b); return self; } -(id) copyWithZone: (NSZone*) zone { - CCAction *copy = [(CCTintTo*)[[self class] allocWithZone: zone] initWithDuration:[self duration] red:to_.r green:to_.g blue:to_.b]; + CCAction *copy = [(CCTintTo*)[[self class] allocWithZone: zone] initWithDuration:[self duration] red:_to.r green:_to.g blue:_to.b]; return copy; } @@ -1115,14 +1235,14 @@ -(void) startWithTarget:(id)aTarget { [super startWithTarget:aTarget]; - id tn = (id) target_; - from_ = [tn color]; + id tn = (id) _target; + _from = [tn color]; } -(void) update: (ccTime) t { - id tn = (id) target_; - [tn setColor:ccc3(from_.r + (to_.r - from_.r) * t, from_.g + (to_.g - from_.g) * t, from_.b + (to_.b - from_.b) * t)]; + id tn = (id) _target; + [tn setColor:ccc3(_from.r + (_to.r - _from.r) * t, _from.g + (_to.g - _from.g) * t, _from.b + (_to.b - _from.b) * t)]; } @end @@ -1133,44 +1253,44 @@ -(void) update: (ccTime) t @implementation CCTintBy +(id) actionWithDuration:(ccTime)t red:(GLshort)r green:(GLshort)g blue:(GLshort)b { - return [[(CCTintBy*)[ self alloc] initWithDuration:t red:r green:g blue:b] autorelease]; + return [(CCTintBy*)[ self alloc] initWithDuration:t red:r green:g blue:b]; } -(id) initWithDuration:(ccTime)t red:(GLshort)r green:(GLshort)g blue:(GLshort)b { if( (self=[super initWithDuration: t] ) ) { - deltaR_ = r; - deltaG_ = g; - deltaB_ = b; + _deltaR = r; + _deltaG = g; + _deltaB = b; } return self; } -(id) copyWithZone: (NSZone*) zone { - return[(CCTintBy*)[[self class] allocWithZone: zone] initWithDuration: [self duration] red:deltaR_ green:deltaG_ blue:deltaB_]; + return[(CCTintBy*)[[self class] allocWithZone: zone] initWithDuration: [self duration] red:_deltaR green:_deltaG blue:_deltaB]; } -(void) startWithTarget:(id)aTarget { [super startWithTarget:aTarget]; - id tn = (id) target_; + id tn = (id) _target; ccColor3B color = [tn color]; - fromR_ = color.r; - fromG_ = color.g; - fromB_ = color.b; + _fromR = color.r; + _fromG = color.g; + _fromB = color.b; } -(void) update: (ccTime) t { - id tn = (id) target_; - [tn setColor:ccc3( fromR_ + deltaR_ * t, fromG_ + deltaG_ * t, fromB_ + deltaB_ * t)]; + id tn = (id) _target; + [tn setColor:ccc3( _fromR + _deltaR * t, _fromG + _deltaG * t, _fromB + _deltaB * t)]; } - (CCActionInterval*) reverse { - return [CCTintBy actionWithDuration:duration_ red:-deltaR_ green:-deltaG_ blue:-deltaB_]; + return [CCTintBy actionWithDuration:_duration red:-_deltaR green:-_deltaG blue:-_deltaB]; } @end @@ -1186,7 +1306,7 @@ -(void) update: (ccTime) t -(id)reverse { - return [[self class] actionWithDuration:duration_]; + return [[self class] actionWithDuration:_duration]; } @end @@ -1199,18 +1319,17 @@ +(id) actionWithAction: (CCFiniteTimeAction*) action { // casting to prevent warnings CCReverseTime *a = [self alloc]; - return [[a initWithAction:action] autorelease]; + return [a initWithAction:action]; } -(id) initWithAction: (CCFiniteTimeAction*) action { NSAssert(action != nil, @"CCReverseTime: action should not be nil"); - NSAssert(action != other_, @"CCReverseTime: re-init doesn't support using the same arguments"); + NSAssert(action != _other, @"CCReverseTime: re-init doesn't support using the same arguments"); if( (self=[super initWithDuration: [action duration]]) ) { // Don't leak if action is reused - [other_ release]; - other_ = [action retain]; + _other = action; } return self; @@ -1218,35 +1337,30 @@ -(id) initWithAction: (CCFiniteTimeAction*) action -(id) copyWithZone: (NSZone*) zone { - return [[[self class] allocWithZone: zone] initWithAction:[[other_ copy] autorelease] ]; + return [[[self class] allocWithZone: zone] initWithAction:[_other copy] ]; } --(void) dealloc -{ - [other_ release]; - [super dealloc]; -} -(void) startWithTarget:(id)aTarget { [super startWithTarget:aTarget]; - [other_ startWithTarget:target_]; + [_other startWithTarget:_target]; } -(void) stop { - [other_ stop]; + [_other stop]; [super stop]; } -(void) update:(ccTime)t { - [other_ update:1-t]; + [_other update:1-t]; } -(CCActionInterval*) reverse { - return [[other_ copy] autorelease]; + return [_other copy]; } @end @@ -1257,11 +1371,11 @@ -(CCActionInterval*) reverse #pragma mark - CCAnimate @implementation CCAnimate -@synthesize animation = animation_; +@synthesize animation = _animation; +(id) actionWithAnimation: (CCAnimation*)anim { - return [[[self alloc] initWithAnimation:anim] autorelease]; + return [[self alloc] initWithAnimation:anim]; } // delegate initializer @@ -1273,25 +1387,23 @@ -(id) initWithAnimation:(CCAnimation*)anim if( (self=[super initWithDuration:singleDuration * anim.loops] ) ) { - nextFrame_ = 0; + _nextFrame = 0; self.animation = anim; - origFrame_ = nil; - executedLoops_ = 0; + _origFrame = nil; + _executedLoops = 0; + + _splitTimes = [[NSMutableArray alloc] initWithCapacity:anim.frames.count]; float accumUnitsOfTime = 0; float newUnitOfTimeValue = singleDuration / anim.totalDelayUnits; - - float *splitTimes = malloc(sizeof(float) * anim.frames.count); - int i = 0; for( CCAnimationFrame *frame in anim.frames ) { - splitTimes[i++] = (accumUnitsOfTime * newUnitOfTimeValue) / singleDuration; + NSNumber *value = [NSNumber numberWithFloat: (accumUnitsOfTime * newUnitOfTimeValue) / singleDuration]; accumUnitsOfTime += frame.delayUnits; - } - - splitTimes_ = [[NSData alloc] initWithBytesNoCopy:splitTimes length:sizeof(float) * anim.frames.count freeWhenDone:YES]; + [_splitTimes addObject:value]; + } } return self; } @@ -1299,36 +1411,28 @@ -(id) initWithAnimation:(CCAnimation*)anim -(id) copyWithZone: (NSZone*) zone { - return [[[self class] allocWithZone: zone] initWithAnimation:[[animation_ copy]autorelease] ]; + return [[[self class] allocWithZone: zone] initWithAnimation:[_animation copy] ]; } --(void) dealloc -{ - [splitTimes_ release]; - [animation_ release]; - [origFrame_ release]; - [super dealloc]; -} -(void) startWithTarget:(id)aTarget { [super startWithTarget:aTarget]; - CCSprite *sprite = target_; + CCSprite *sprite = _target; - [origFrame_ release]; - if( animation_.restoreOriginalFrame ) - origFrame_ = [[sprite displayFrame] retain]; + if( _animation.restoreOriginalFrame ) + _origFrame = sprite.spriteFrame; - nextFrame_ = 0; - executedLoops_ = 0; + _nextFrame = 0; + _executedLoops = 0; } -(void) stop { - if( animation_.restoreOriginalFrame ) { - CCSprite *sprite = target_; - [sprite setDisplayFrame:origFrame_]; + if( _animation.restoreOriginalFrame ) { + CCSprite *sprite = _target; + sprite.spriteFrame = _origFrame; } [super stop]; @@ -1339,51 +1443,53 @@ -(void) update: (ccTime) t // if t==1, ignore. Animation should finish with t==1 if( t < 1.0f ) { - t *= animation_.loops; + t *= _animation.loops; // new loop? If so, reset frame counter NSUInteger loopNumber = (NSUInteger)t; - if( loopNumber > executedLoops_ ) { - nextFrame_ = 0; - executedLoops_++; + if( loopNumber > _executedLoops ) { + _nextFrame = 0; + _executedLoops++; } // new t for animations t = fmodf(t, 1.0f); } - NSArray *frames = [animation_ frames]; + NSArray *frames = [_animation frames]; NSUInteger numberOfFrames = [frames count]; CCSpriteFrame *frameToDisplay = nil; - const float *splitTimes = [splitTimes_ bytes]; - for( NSUInteger i=nextFrame_; i < numberOfFrames; i++ ) { - if( splitTimes[i] <= t ) { + for( NSUInteger i=_nextFrame; i < numberOfFrames; i++ ) { + NSNumber *splitTime = [_splitTimes objectAtIndex:i]; + + if( [splitTime floatValue] <= t ) { CCAnimationFrame *frame = [frames objectAtIndex:i]; frameToDisplay = [frame spriteFrame]; - [(CCSprite*)target_ setDisplayFrame: frameToDisplay]; + [(CCSprite*)_target setSpriteFrame: frameToDisplay]; NSDictionary *dict = [frame userInfo]; if( dict ) - [[NSNotificationCenter defaultCenter] postNotificationName:CCAnimationFrameDisplayedNotification object:target_ userInfo:dict]; - - nextFrame_ = i+1; + [[NSNotificationCenter defaultCenter] postNotificationName:CCAnimationFrameDisplayedNotification object:_target userInfo:dict]; - break; + _nextFrame = i+1; } - } + // Issue 1438. Could be more than one frame per tick, due to low frame rate or frame delta < 1/FPS + else + break; + } } - (CCActionInterval *) reverse { - NSArray *oldArray = [animation_ frames]; + NSArray *oldArray = [_animation frames]; NSMutableArray *newArray = [NSMutableArray arrayWithCapacity:[oldArray count]]; NSEnumerator *enumerator = [oldArray reverseObjectEnumerator]; for (id element in enumerator) - [newArray addObject:[[element copy] autorelease]]; + [newArray addObject:[element copy]]; - CCAnimation *newAnim = [CCAnimation animationWithAnimationFrames:newArray delayPerUnit:animation_.delayPerUnit loops:animation_.loops]; - newAnim.restoreOriginalFrame = animation_.restoreOriginalFrame; + CCAnimation *newAnim = [CCAnimation animationWithAnimationFrames:newArray delayPerUnit:_animation.delayPerUnit loops:_animation.loops]; + newAnim.restoreOriginalFrame = _animation.restoreOriginalFrame; return [[self class] actionWithAnimation:newAnim]; } @end @@ -1393,56 +1499,50 @@ - (CCActionInterval *) reverse @implementation CCTargetedAction -@synthesize forcedTarget = forcedTarget_; +@synthesize forcedTarget = _forcedTarget; + (id) actionWithTarget:(id) target action:(CCFiniteTimeAction*) action { - return [[ (CCTargetedAction*)[self alloc] initWithTarget:target action:action] autorelease]; + return [ (CCTargetedAction*)[self alloc] initWithTarget:target action:action]; } - (id) initWithTarget:(id) targetIn action:(CCFiniteTimeAction*) actionIn { if((self = [super initWithDuration:actionIn.duration])) { - forcedTarget_ = [targetIn retain]; - action_ = [actionIn retain]; + _forcedTarget = targetIn; + _action = actionIn; } return self; } -(id) copyWithZone: (NSZone*) zone { - CCAction *copy = [ (CCTargetedAction*) [[self class] allocWithZone: zone] initWithTarget:target_ action:[[action_ copy] autorelease]]; + CCAction *copy = [ (CCTargetedAction*) [[self class] allocWithZone: zone] initWithTarget:_forcedTarget action:[_action copy]]; return copy; } -- (void) dealloc -{ - [forcedTarget_ release]; - [action_ release]; - [super dealloc]; -} //- (void) updateDuration:(id)aTarget //{ // [action updateDuration:forcedTarget]; -// duration_ = action.duration; +// _duration = action.duration; //} - (void) startWithTarget:(id)aTarget { - [super startWithTarget:forcedTarget_]; - [action_ startWithTarget:forcedTarget_]; + [super startWithTarget:aTarget]; + [_action startWithTarget:_forcedTarget]; } - (void) stop { - [action_ stop]; + [_action stop]; } - (void) update:(ccTime) time { - [action_ update:time]; + [_action update:time]; } @end diff --git a/cocos2d/CCActionManager.h b/cocos2d/CCActionManager.h new file mode 100644 index 0000000..60af5e7 --- /dev/null +++ b/cocos2d/CCActionManager.h @@ -0,0 +1,112 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2009 Valentin Milea + * + * Copyright (c) 2008-2010 Ricardo Quesada + * Copyright (c) 2011 Zynga Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + */ + + +#import "CCAction.h" +#import "ccMacros.h" +#import "Support/uthash.h" + +typedef struct _hashElement +{ + __unsafe_unretained NSMutableArray *actions; + NSUInteger actionIndex; + BOOL currentActionSalvaged; + BOOL paused; + UT_hash_handle hh; + + __unsafe_unretained id target; + __unsafe_unretained CCAction *currentAction; +} tHashElement; + + +/** CCActionManager the object that manages all the actions. + Normally you won't need to use this API directly. 99% of the cases you will use the CCNode interface, which uses this object. + But there are some cases where you might need to use this API directly: + Examples: + - When you want to run an action where the target is different from a CCNode. + - When you want to pause / resume the actions + + @since v0.8 + */ +@interface CCActionManager : NSObject +{ + tHashElement *targets; + tHashElement *currentTarget; + BOOL currentTargetSalvaged; +} + + +// actions + +/** Adds an action with a target. + If the target is already present, then the action will be added to the existing target. + If the target is not present, a new instance of this target will be created either paused or paused, and the action will be added to the newly created target. + When the target is paused, the queued actions won't be 'ticked'. + */ +-(void) addAction: (CCAction*) action target:(id)target paused:(BOOL)paused; +/** Removes all actions from all the targets. + */ +-(void) removeAllActions; + +/** Removes all actions from a certain target. + All the actions that belongs to the target will be removed. + */ +-(void) removeAllActionsFromTarget:(id)target; +/** Removes an action given an action reference. + */ +-(void) removeAction: (CCAction*) action; +/** Removes an action given its tag and the target */ +-(void) removeActionByTag:(NSInteger)tag target:(id)target; +/** Gets an action given its tag an a target + @return the Action the with the given tag + */ +-(CCAction*) getActionByTag:(NSInteger) tag target:(id)target; +/** Returns the numbers of actions that are running in a certain target + * Composable actions are counted as 1 action. Example: + * If you are running 1 Sequence of 7 actions, it will return 1. + * If you are running 7 Sequences of 2 actions, it will return 7. + */ +-(NSUInteger) numberOfRunningActionsInTarget:(id)target; + +/** Pauses the target: all running actions and newly added actions will be paused. + */ +-(void) pauseTarget:(id)target; +/** Resumes the target. All queued actions will be resumed. + */ +-(void) resumeTarget:(id)target; + +/** Pauses all running actions, returning a list of targets whose actions were paused. + */ +-(NSSet *) pauseAllRunningActions; + +/** Resume a set of targets (convenience function to reverse a pauseAllRunningActions call) + */ +-(void) resumeTargets:(NSSet *)targetsToResume; + +@end + diff --git a/src/cocos2d/CCActionManager.m b/cocos2d/CCActionManager.m similarity index 76% rename from src/cocos2d/CCActionManager.m rename to cocos2d/CCActionManager.m index 49fc86c..4a28a42 100644 --- a/src/cocos2d/CCActionManager.m +++ b/cocos2d/CCActionManager.m @@ -28,7 +28,6 @@ #import "CCActionManager.h" -#import "CCScheduler.h" #import "ccMacros.h" @interface CCActionManager (Private) @@ -60,45 +59,49 @@ - (void) dealloc [self removeAllActions]; - [super dealloc]; } #pragma mark ActionManager - Private -(void) deleteHashElement:(tHashElement*)element { - ccArrayFree(element->actions); + void* a = (__bridge void*) element->actions; + CFRelease(a); HASH_DEL(targets, element); // CCLOG(@"cocos2d: ---- buckets: %d/%d - %@", targets->entries, targets->size, element->target); - [element->target release]; + void* t = (__bridge void*) element->target; + CFRelease(t); free(element); } -(void) actionAllocWithHashElement:(tHashElement*)element { + NSMutableArray* aObj = [[NSMutableArray alloc] init]; + void* a = (__bridge void*) aObj; + CFRetain(a); + // 4 actions per Node by default if( element->actions == nil ) - element->actions = ccArrayNew(4); - else if( element->actions->num == element->actions->max ) - ccArrayDoubleCapacity(element->actions); + element->actions = aObj; } -(void) removeActionAtIndex:(NSUInteger)index hashElement:(tHashElement*)element { - id action = element->actions->arr[index]; + id action = [element->actions objectAtIndex:index]; if( action == element->currentAction && !element->currentActionSalvaged ) { - [element->currentAction retain]; + void* a = (__bridge void*) element->currentAction; + CFRetain(a); element->currentActionSalvaged = YES; } - - ccArrayRemoveObjectAtIndex(element->actions, index); + + [element->actions removeObjectAtIndex:index]; // update actionIndex in case we are in tick:, looping over the actions if( element->actionIndex >= index ) element->actionIndex--; - if( element->actions->num == 0 ) { + if( element->actions.count == 0 ) { if( currentTarget == element ) currentTargetSalvaged = YES; else @@ -111,7 +114,8 @@ -(void) removeActionAtIndex:(NSUInteger)index hashElement:(tHashElement*)element -(void) pauseTarget:(id)target { tHashElement *element = NULL; - HASH_FIND_INT(targets, &target, element); + void* t = (__bridge void*) target; + HASH_FIND_INT(targets, &t, element); if( element ) element->paused = YES; // else @@ -121,7 +125,8 @@ -(void) pauseTarget:(id)target -(void) resumeTarget:(id)target { tHashElement *element = NULL; - HASH_FIND_INT(targets, &target, element); + void* t = (__bridge void*) target; + HASH_FIND_INT(targets, &t, element); if( element ) element->paused = NO; // else @@ -150,17 +155,19 @@ -(void) resumeTargets:(NSSet *)targetsToResume #pragma mark ActionManager - run --(void) addAction:(CCAction*)action target:(id)target paused:(BOOL)paused +-(void) addAction:(CCAction*)action target:(id)t paused:(BOOL)paused { NSAssert( action != nil, @"Argument action must be non-nil"); - NSAssert( target != nil, @"Argument target must be non-nil"); + NSAssert( t != nil, @"Argument target must be non-nil"); tHashElement *element = NULL; + void* target = (__bridge void*)t; HASH_FIND_INT(targets, &target, element); if( ! element ) { element = calloc( sizeof( *element ), 1 ); element->paused = paused; - element->target = [target retain]; + CFBridgingRetain(t); + element->target = t; HASH_ADD_INT(targets, target, element); // CCLOG(@"cocos2d: ---- buckets: %d/%d - %@", targets->entries, targets->size, element->target); @@ -168,10 +175,10 @@ -(void) addAction:(CCAction*)action target:(id)target paused:(BOOL)paused [self actionAllocWithHashElement:element]; - NSAssert( !ccArrayContainsObject(element->actions, action), @"runAction: Action already running"); - ccArrayAppendObject(element->actions, action); + NSAssert( ![element->actions containsObject:action], @"runAction: Action already running"); + [element->actions addObject:action]; - [action startWithTarget:target]; + [action startWithTarget:t]; } #pragma mark ActionManager - remove @@ -190,14 +197,16 @@ -(void) removeAllActionsFromTarget:(id)target if( target == nil ) return; + void* t = (__bridge void*) target; tHashElement *element = NULL; - HASH_FIND_INT(targets, &target, element); + HASH_FIND_INT(targets, &t, element); if( element ) { - if( ccArrayContainsObject(element->actions, element->currentAction) && !element->currentActionSalvaged ) { - [element->currentAction retain]; + if( [element->actions containsObject:element->currentAction] && !element->currentActionSalvaged ) { + void* a = (__bridge void*) element->currentAction; + CFRetain(a); element->currentActionSalvaged = YES; } - ccArrayRemoveAllObjects(element->actions); + [element->actions removeAllObjects]; if( currentTarget == element ) currentTargetSalvaged = YES; else @@ -216,9 +225,10 @@ -(void) removeAction: (CCAction*) action tHashElement *element = NULL; id target = [action originalTarget]; - HASH_FIND_INT(targets, &target, element ); + void* t = (__bridge void*) target; + HASH_FIND_INT(targets, &t, element ); if( element ) { - NSUInteger i = ccArrayGetIndexOfObject(element->actions, action); + NSUInteger i = [element->actions indexOfObject:action]; if( i != NSNotFound ) [self removeActionAtIndex:i hashElement:element]; } @@ -233,12 +243,13 @@ -(void) removeActionByTag:(NSInteger)aTag target:(id)target NSAssert( target != nil, @"Target should be ! nil"); tHashElement *element = NULL; - HASH_FIND_INT(targets, &target, element); + void* t = (__bridge void*) target; + HASH_FIND_INT(targets, &t, element); if( element ) { - NSUInteger limit = element->actions->num; + NSUInteger limit = element->actions.count; for( NSUInteger i = 0; i < limit; i++) { - CCAction *a = element->actions->arr[i]; + CCAction *a = [element->actions objectAtIndex:i]; if( a.tag == aTag && [a originalTarget]==target) { [self removeActionAtIndex:i hashElement:element]; @@ -256,13 +267,14 @@ -(CCAction*) getActionByTag:(NSInteger)aTag target:(id)target NSAssert( aTag != kCCActionTagInvalid, @"Invalid tag"); tHashElement *element = NULL; - HASH_FIND_INT(targets, &target, element); + void* t = (__bridge void*) target; + HASH_FIND_INT(targets, &t, element); if( element ) { if( element->actions != nil ) { - NSUInteger limit = element->actions->num; + NSUInteger limit = element->actions.count; for( NSUInteger i = 0; i < limit; i++) { - CCAction *a = element->actions->arr[i]; + CCAction *a = [element->actions objectAtIndex:i]; if( a.tag == aTag ) return a; @@ -279,9 +291,10 @@ -(CCAction*) getActionByTag:(NSInteger)aTag target:(id)target -(NSUInteger) numberOfRunningActionsInTarget:(id) target { tHashElement *element = NULL; - HASH_FIND_INT(targets, &target, element); + void* t = (__bridge void*) target; + HASH_FIND_INT(targets, &t, element); if( element ) - return element->actions ? element->actions->num : 0; + return element->actions ? element->actions.count : 0; // CCLOG(@"cocos2d: numberOfRunningActionsInTarget: Target not found"); return 0; @@ -299,8 +312,8 @@ -(void) update: (ccTime) dt if( ! currentTarget->paused ) { // The 'actions' ccArray may change while inside this loop. - for( currentTarget->actionIndex = 0; currentTarget->actionIndex < currentTarget->actions->num; currentTarget->actionIndex++) { - currentTarget->currentAction = currentTarget->actions->arr[currentTarget->actionIndex]; + for( currentTarget->actionIndex = 0; currentTarget->actionIndex < currentTarget->actions.count; currentTarget->actionIndex++) { + currentTarget->currentAction = [currentTarget->actions objectAtIndex:currentTarget->actionIndex]; currentTarget->currentActionSalvaged = NO; [currentTarget->currentAction step: dt]; @@ -309,7 +322,8 @@ -(void) update: (ccTime) dt // The currentAction told the node to remove it. To prevent the action from // accidentally deallocating itself before finishing its step, we retained // it. Now that step is done, it's safe to release it. - [currentTarget->currentAction release]; + void* a = (__bridge void*) currentTarget->currentAction; + CFRelease(a); } else if( [currentTarget->currentAction isDone] ) { [currentTarget->currentAction stop]; @@ -329,7 +343,7 @@ -(void) update: (ccTime) dt elt = elt->hh.next; // only delete currentTarget if no actions were scheduled during the cycle (issue #481) - if( currentTargetSalvaged && currentTarget->actions->num == 0 ) + if( currentTargetSalvaged && currentTarget->actions.count == 0 ) [self deleteHashElement:currentTarget]; } diff --git a/include/cocos2d/CCTransitionPageTurn.h b/cocos2d/CCActionPageTurn3D.h similarity index 53% rename from include/cocos2d/CCTransitionPageTurn.h rename to cocos2d/CCActionPageTurn3D.h index 1e83c08..7afa3e1 100644 --- a/include/cocos2d/CCTransitionPageTurn.h +++ b/cocos2d/CCActionPageTurn3D.h @@ -24,37 +24,20 @@ */ -#import "CCTransition.h" +#import "CCActionGrid3D.h" -/** CCTransitionPageTurn transition. - * A transition which peels back the bottom right hand corner of a scene - * to transition to the scene beneath it simulating a page turn - * - * This uses a 3DAction so it is strongly recommended that depth buffering - * is turned on in CCDirector using: +/** + * This action simulates a page turn from the bottom right hand corner of the screen + * It's not much use by itself but is used by the PageTurnTransition. * - * [[CCDirector sharedDirector] setDepthBufferFormat:kCCDepthBuffer16]; + * Based on an original paper by L Hong et al. + * http://www.parc.com/publication/1638/turning-pages-of-3d-electronic-books.html * * @since v0.8.2 */ -@interface CCTransitionPageTurn : CCTransitionScene +@interface CCPageTurn3D : CCGrid3DAction { - BOOL back_; } -/** - * creates a base transition with duration and incoming scene - * if back is TRUE then the effect is reversed to appear as if the incoming - * scene is being turned from left over the outgoing scene - */ -+(id) transitionWithDuration:(ccTime) t scene:(CCScene*)s backwards:(BOOL) back; - -/** - * creates a base transition with duration and incoming scene - * if back is TRUE then the effect is reversed to appear as if the incoming - * scene is being turned from left over the outgoing scene - */ --(id) initWithDuration:(ccTime) t scene:(CCScene*)s backwards:(BOOL) back; - --(CCActionInterval*) actionWithSize:(ccGridSize) vector; - +// XXX: To make BridgeSupport happy +-(void)update:(ccTime)time; @end diff --git a/src/cocos2d/CCActionPageTurn3D.m b/cocos2d/CCActionPageTurn3D.m similarity index 92% rename from src/cocos2d/CCActionPageTurn3D.m rename to cocos2d/CCActionPageTurn3D.m index cff9bc2..6cc1991 100644 --- a/src/cocos2d/CCActionPageTurn3D.m +++ b/cocos2d/CCActionPageTurn3D.m @@ -24,6 +24,7 @@ */ #import "CCActionPageTurn3D.h" +#import "Support/CGPointExtension.h" @implementation CCPageTurn3D @@ -43,12 +44,12 @@ -(void)update:(ccTime)time float sinTheta = sinf(theta); float cosTheta = cosf(theta); - for( int i = 0; i <=gridSize_.x; i++ ) + for( int i = 0; i <=_gridSize.width; i++ ) { - for( int j = 0; j <= gridSize_.y; j++ ) + for( int j = 0; j <= _gridSize.height; j++ ) { // Get original vertex - ccVertex3F p = [self originalVertex:ccg(i,j)]; + ccVertex3F p = [self originalVertex:ccp(i,j)]; float R = sqrtf(p.x*p.x + (p.y - ay) * (p.y - ay)); float r = R * sinTheta; @@ -79,7 +80,7 @@ -(void)update:(ccTime)time p.z = 0.5f; // Set new coords - [self setVertex:ccg(i,j) vertex:p]; + [self setVertex:ccp(i,j) vertex:p]; } } } diff --git a/cocos2d/CCActionProgressTimer.h b/cocos2d/CCActionProgressTimer.h new file mode 100644 index 0000000..1e1dc62 --- /dev/null +++ b/cocos2d/CCActionProgressTimer.h @@ -0,0 +1,59 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (C) 2010 Lam Pham + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + */ + + +#import +#import "CCProgressTimer.h" +#import "CCActionInterval.h" + +/** + Progress to percentage +@since v0.99.1 +*/ +@interface CCProgressTo : CCActionInterval +{ + float _to; + float _from; +} +/** Creates and initializes with a duration and a percent */ ++(id) actionWithDuration:(ccTime)duration percent:(float)percent; +/** Initializes with a duration and a percent */ +-(id) initWithDuration:(ccTime)duration percent:(float)percent; +@end + +/** + Progress from a percentage to another percentage + @since v0.99.1 + */ +@interface CCProgressFromTo : CCActionInterval +{ + float _to; + float _from; +} +/** Creates and initializes the action with a duration, a "from" percentage and a "to" percentage */ ++(id) actionWithDuration:(ccTime)duration from:(float)fromPercentage to:(float) toPercentage; +/** Initializes the action with a duration, a "from" percentage and a "to" percentage */ +-(id) initWithDuration:(ccTime)duration from:(float)fromPercentage to:(float) toPercentage; +@end diff --git a/src/cocos2d/CCActionProgressTimer.m b/cocos2d/CCActionProgressTimer.m similarity index 74% rename from src/cocos2d/CCActionProgressTimer.m rename to cocos2d/CCActionProgressTimer.m index d5e2993..404fa61 100644 --- a/src/cocos2d/CCActionProgressTimer.m +++ b/cocos2d/CCActionProgressTimer.m @@ -31,73 +31,76 @@ @implementation CCProgressTo +(id) actionWithDuration: (ccTime) t percent: (float) v { - return [[[ self alloc] initWithDuration: t percent: v] autorelease]; + return [[ self alloc] initWithDuration: t percent: v]; } -(id) initWithDuration: (ccTime) t percent: (float) v { if( (self=[super initWithDuration: t] ) ) - to_ = v; + _to = v; return self; } -(id) copyWithZone: (NSZone*) zone { - CCAction *copy = [[[self class] allocWithZone: zone] initWithDuration:duration_ percent:to_]; + CCAction *copy = [[[self class] allocWithZone: zone] initWithDuration:_duration percent:_to]; return copy; } --(void) startWithTarget:(id) aTarget; +#pragma clang diagnostic push COCOS2D +#pragma clang diagnostic ignored "-Wfloat-equal" +-(void) startWithTarget:(id) aTarget { [super startWithTarget:aTarget]; - from_ = [(kProgressTimerCast)target_ percentage]; + _from = [(kProgressTimerCast)_target percentage]; // XXX: Is this correct ? // Adding it to support CCRepeat - if( from_ == 100) - from_ = 0; + if( _from == 100) + _from = 0; } +#pragma clang diagnostic pop COCOS2D -(void) update: (ccTime) t { - [(kProgressTimerCast)target_ setPercentage: from_ + ( to_ - from_ ) * t]; + [(kProgressTimerCast)_target setPercentage: _from + ( _to - _from ) * t]; } @end @implementation CCProgressFromTo +(id) actionWithDuration: (ccTime) t from:(float)fromPercentage to:(float) toPercentage { - return [[[self alloc] initWithDuration: t from: fromPercentage to: toPercentage] autorelease]; + return [[self alloc] initWithDuration: t from: fromPercentage to: toPercentage]; } -(id) initWithDuration: (ccTime) t from:(float)fromPercentage to:(float) toPercentage { if( (self=[super initWithDuration: t] ) ){ - to_ = toPercentage; - from_ = fromPercentage; + _to = toPercentage; + _from = fromPercentage; } return self; } -(id) copyWithZone: (NSZone*) zone { - CCAction *copy = [[[self class] allocWithZone: zone] initWithDuration:duration_ from:from_ to:to_]; + CCAction *copy = [[[self class] allocWithZone: zone] initWithDuration:_duration from:_from to:_to]; return copy; } - (CCActionInterval *) reverse { - return [[self class] actionWithDuration:duration_ from:to_ to:from_]; + return [[self class] actionWithDuration:_duration from:_to to:_from]; } --(void) startWithTarget:(id) aTarget; +-(void) startWithTarget:(id) aTarget { [super startWithTarget:aTarget]; } -(void) update: (ccTime) t { - [(kProgressTimerCast)target_ setPercentage: from_ + ( to_ - from_ ) * t]; + [(kProgressTimerCast)_target setPercentage: _from + ( _to - _from ) * t]; } @end diff --git a/cocos2d/CCActionTiledGrid.h b/cocos2d/CCActionTiledGrid.h new file mode 100644 index 0000000..cd27a3b --- /dev/null +++ b/cocos2d/CCActionTiledGrid.h @@ -0,0 +1,219 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2009 On-Core + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + */ + +#import "CCActionGrid.h" + +/** CCShakyTiles3D action */ +@interface CCShakyTiles3D : CCTiledGrid3DAction +{ + int _randrange; + BOOL _shakeZ; +} + +/** creates the action with a range, whether or not to shake Z vertices, a grid size, and duration */ ++(id)actionWithDuration:(ccTime)duration size:(CGSize)gridSize range:(int)range shakeZ:(BOOL)shakeZ; +/** initializes the action with a range, whether or not to shake Z vertices, a grid size, and duration */ +-(id)initWithDuration:(ccTime)duration size:(CGSize)gridSize range:(int)range shakeZ:(BOOL)shakeZ; + +@end + +//////////////////////////////////////////////////////////// + +/** CCShatteredTiles3D action */ +@interface CCShatteredTiles3D : CCTiledGrid3DAction +{ + int _randrange; + BOOL _once; + BOOL _shatterZ; +} + +/** creates the action with a range, whether of not to shatter Z vertices, a grid size and duration */ ++(id)actionWithDuration:(ccTime)duration size:(CGSize)gridSize range:(int)range shatterZ:(BOOL)shatterZ; +/** initializes the action with a range, whether or not to shatter Z vertices, a grid size and duration */ +-(id)initWithDuration:(ccTime)duration size:(CGSize)gridSize range:(int)range shatterZ:(BOOL)shatterZ; + +@end + +//////////////////////////////////////////////////////////// + +/** CCShuffleTiles action + Shuffle the tiles in random order + */ +@interface CCShuffleTiles : CCTiledGrid3DAction +{ + int _seed; + NSUInteger _tilesCount; + NSUInteger *_tilesOrder; + void *_tiles; +} + +/** creates the action with a random seed, the grid size and the duration */ ++(id)actionWithDuration:(ccTime)duration size:(CGSize)gridSize seed:(unsigned)seed; +/** initializes the action with a random seed, the grid size and the duration */ +-(id)initWithDuration:(ccTime)duration size:(CGSize)gridSize seed:(unsigned)seed; + +@end + +//////////////////////////////////////////////////////////// + +/** CCFadeOutTRTiles action + Fades out the tiles in a Top-Right direction + */ +@interface CCFadeOutTRTiles : CCTiledGrid3DAction +{ +} +// XXX: private, but added to make BridgeSupport happy +-(float)testFunc:(CGSize)pos time:(ccTime)time; +@end + +//////////////////////////////////////////////////////////// + +/** CCFadeOutBLTiles action. + Fades out the tiles in a Bottom-Left direction + */ +@interface CCFadeOutBLTiles : CCFadeOutTRTiles +{ +} +// XXX: private, but added to make BridgeSupport happy +-(float)testFunc:(CGSize)pos time:(ccTime)time; +@end + +//////////////////////////////////////////////////////////// + +/** CCFadeOutUpTiles action. + Fades out the tiles in upwards direction + */ +@interface CCFadeOutUpTiles : CCFadeOutTRTiles +{ +} +// XXX: private, but added to make BridgeSupport happy +-(float)testFunc:(CGSize)pos time:(ccTime)time; +@end + +//////////////////////////////////////////////////////////// + +/** CCFadeOutDownTiles action. + Fades out the tiles in downwards direction + */ +@interface CCFadeOutDownTiles : CCFadeOutUpTiles +{ +} +// XXX: private, but added to make BridgeSupport happy +-(float)testFunc:(CGSize)pos time:(ccTime)time; +@end + +//////////////////////////////////////////////////////////// + +/** CCTurnOffTiles action. + Turn off the files in random order + */ +@interface CCTurnOffTiles : CCTiledGrid3DAction +{ + int _seed; + NSUInteger _tilesCount; + NSUInteger *_tilesOrder; +} + +/** creates the action with a random seed, the grid size and the duration */ ++(id)actionWithDuration:(ccTime)duration size:(CGSize)gridSize seed:(unsigned)seed; +/** initializes the action with a random seed, the grid size and the duration */ +-(id)initWithDuration:(ccTime)duration size:(CGSize)gridSize seed:(unsigned)seed; +@end + +//////////////////////////////////////////////////////////// + +/** CCWavesTiles3D action. */ +@interface CCWavesTiles3D : CCTiledGrid3DAction +{ + NSUInteger _waves; + float _amplitude; + float _amplitudeRate; +} + +/** waves amplitude */ +@property (nonatomic,readwrite) float amplitude; +/** waves amplitude rate */ +@property (nonatomic,readwrite) float amplitudeRate; + +/** creates the action with a number of waves, the waves amplitude, the grid size and the duration */ ++(id)actionWithDuration:(ccTime)duration size:(CGSize)gridSize waves:(NSUInteger)wav amplitude:(float)amp; +/** initializes the action with a number of waves, the waves amplitude, the grid size and the duration */ +-(id)initWithDuration:(ccTime)duration size:(CGSize)gridSize waves:(NSUInteger)wav amplitude:(float)amp; + +@end + +//////////////////////////////////////////////////////////// + +/** CCJumpTiles3D action. + A sin function is executed to move the tiles across the Z axis + */ +@interface CCJumpTiles3D : CCTiledGrid3DAction +{ + NSUInteger _jumps; + float _amplitude; + float _amplitudeRate; +} + +/** amplitude of the sin*/ +@property (nonatomic,readwrite) float amplitude; +/** amplitude rate */ +@property (nonatomic,readwrite) float amplitudeRate; + +/** creates the action with the number of jumps, the sin amplitude, the grid size and the duration */ ++(id)actionWithDuration:(ccTime)duration size:(CGSize)gridSize jumps:(NSUInteger)numberOfJumps amplitude:(float)amplitude; +/** initializes the action with the number of jumps, the sin amplitude, the grid size and the duration */ +-(id)initWithDuration:(ccTime)duration size:(CGSize)gridSize jumps:(NSUInteger)numberOfJumps amplitude:(float)amplitude; + +@end + +//////////////////////////////////////////////////////////// + +/** CCSplitRows action */ +@interface CCSplitRows : CCTiledGrid3DAction +{ + NSUInteger _rows; + CGSize _winSize; +} +/** creates the action with the number of rows to split and the duration */ ++(id)actionWithDuration:(ccTime)duration rows:(NSUInteger)rows; +/** initializes the action with the number of rows to split and the duration */ +-(id)initWithDuration:(ccTime)duration rows:(NSUInteger)rows; + +@end + +//////////////////////////////////////////////////////////// + +/** CCSplitCols action */ +@interface CCSplitCols : CCTiledGrid3DAction +{ + NSUInteger _cols; + CGSize _winSize; +} +/** creates the action with the number of columns to split and the duration */ ++(id)actionWithDuration:(ccTime)duration cols:(NSUInteger)cols; +/** initializes the action with the number of columns to split and the duration */ +-(id)initWithDuration:(ccTime)duration cols:(NSUInteger)cols; + +@end diff --git a/cocos2d/CCActionTiledGrid.m b/cocos2d/CCActionTiledGrid.m new file mode 100644 index 0000000..5da9d4c --- /dev/null +++ b/cocos2d/CCActionTiledGrid.m @@ -0,0 +1,772 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2009 On-Core + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + */ + + +#import "CCActionTiledGrid.h" +#import "CCDirector.h" +#import "ccMacros.h" +#import "Support/CGPointExtension.h" + +typedef struct +{ + CGPoint position; + CGPoint startPosition; + CGSize delta; +} Tile; + +#pragma mark - +#pragma mark ShakyTiles3D + +@implementation CCShakyTiles3D + ++(id)actionWithDuration:(ccTime)duration size:(CGSize)gridSize range:(int)range shakeZ:(BOOL)shakeZ +{ + return [[self alloc] initWithDuration:duration size:gridSize range:range shakeZ:shakeZ]; +} + +-(id)initWithDuration:(ccTime)duration size:(CGSize)gridSize range:(int)range shakeZ:(BOOL)shakeZ +{ + if ( (self = [super initWithDuration:duration size:gridSize]) ) + { + _randrange = range; + _shakeZ = shakeZ; + } + + return self; +} + +-(id) copyWithZone: (NSZone*) zone +{ + return [[[self class] allocWithZone:zone] initWithDuration:_duration size:_gridSize range:_randrange shakeZ:_shakeZ]; +} + + +-(void)update:(ccTime)time +{ + int i, j; + + for( i = 0; i < _gridSize.width; i++ ) + { + for( j = 0; j < _gridSize.height; j++ ) + { + ccQuad3 coords = [self originalTile:ccp(i,j)]; + + // X + coords.bl.x += ( rand() % (_randrange*2) ) - _randrange; + coords.br.x += ( rand() % (_randrange*2) ) - _randrange; + coords.tl.x += ( rand() % (_randrange*2) ) - _randrange; + coords.tr.x += ( rand() % (_randrange*2) ) - _randrange; + + // Y + coords.bl.y += ( rand() % (_randrange*2) ) - _randrange; + coords.br.y += ( rand() % (_randrange*2) ) - _randrange; + coords.tl.y += ( rand() % (_randrange*2) ) - _randrange; + coords.tr.y += ( rand() % (_randrange*2) ) - _randrange; + + if( _shakeZ ) { + coords.bl.z += ( rand() % (_randrange*2) ) - _randrange; + coords.br.z += ( rand() % (_randrange*2) ) - _randrange; + coords.tl.z += ( rand() % (_randrange*2) ) - _randrange; + coords.tr.z += ( rand() % (_randrange*2) ) - _randrange; + } + + [self setTile:ccp(i,j) coords:coords]; + } + } +} + +@end + +//////////////////////////////////////////////////////////// + +#pragma mark - +#pragma mark CCShatteredTiles3D + +@implementation CCShatteredTiles3D + ++(id)actionWithDuration:(ccTime)duration size:(CGSize)gridSize range:(int)range shatterZ:(BOOL)shatterZ +{ + return [[self alloc] initWithDuration:duration size:gridSize range:range shatterZ:shatterZ]; +} + +-(id)initWithDuration:(ccTime)duration size:(CGSize)gridSize range:(int)range shatterZ:(BOOL)shatterZ + +{ + if ( (self = [super initWithDuration:duration size:gridSize]) ) + { + _once = NO; + _randrange = range; + _shatterZ = shatterZ; + } + + return self; +} + +-(id) copyWithZone: (NSZone*) zone +{ + return [[[self class] allocWithZone:zone] initWithDuration:_duration size:_gridSize range:_randrange shatterZ:_shatterZ]; +} + + +-(void)update:(ccTime)time +{ + int i, j; + + if ( _once == NO ) + { + for( i = 0; i < _gridSize.width; i++ ) + { + for( j = 0; j < _gridSize.height; j++ ) + { + ccQuad3 coords = [self originalTile:ccp(i,j)]; + + // X + coords.bl.x += ( rand() % (_randrange*2) ) - _randrange; + coords.br.x += ( rand() % (_randrange*2) ) - _randrange; + coords.tl.x += ( rand() % (_randrange*2) ) - _randrange; + coords.tr.x += ( rand() % (_randrange*2) ) - _randrange; + + // Y + coords.bl.y += ( rand() % (_randrange*2) ) - _randrange; + coords.br.y += ( rand() % (_randrange*2) ) - _randrange; + coords.tl.y += ( rand() % (_randrange*2) ) - _randrange; + coords.tr.y += ( rand() % (_randrange*2) ) - _randrange; + + if( _shatterZ ) { + coords.bl.z += ( rand() % (_randrange*2) ) - _randrange; + coords.br.z += ( rand() % (_randrange*2) ) - _randrange; + coords.tl.z += ( rand() % (_randrange*2) ) - _randrange; + coords.tr.z += ( rand() % (_randrange*2) ) - _randrange; + } + + [self setTile:ccp(i,j) coords:coords]; + } + } + + _once = YES; + } +} + +@end + +//////////////////////////////////////////////////////////// + +#pragma mark - +#pragma mark CCShuffleTiles + +@implementation CCShuffleTiles + ++(id)actionWithDuration:(ccTime)duration size:(CGSize)gridSize seed:(unsigned)seed +{ + return [[self alloc] initWithDuration:duration size:gridSize seed:seed]; +} + +-(id)initWithDuration:(ccTime)duration size:(CGSize)gridSize seed:(unsigned)seed +{ + if ( (self = [super initWithDuration:duration size:gridSize]) ) + { + _seed = seed; + _tilesOrder = nil; + _tiles = nil; + } + + return self; +} + +-(id) copyWithZone: (NSZone*) zone +{ + return [[[self class] allocWithZone:zone] initWithDuration:_duration size:_gridSize seed:_seed]; +} + + +-(void)dealloc +{ + if(_tilesOrder) + free(_tilesOrder); + if(_tiles) + free(_tiles); +} + +-(void)shuffle:(NSUInteger*)array count:(NSUInteger)len +{ + NSInteger i; + for( i = len - 1; i >= 0; i-- ) + { + NSInteger j = rand() % (i+1); + NSUInteger v = array[i]; + array[i] = array[j]; + array[j] = v; + } +} + +-(CGSize)getDelta:(CGSize)pos +{ + CGPoint pos2; + + NSUInteger idx = pos.width * _gridSize.height + pos.height; + + pos2.x = _tilesOrder[idx] / (NSUInteger)_gridSize.height; + pos2.y = _tilesOrder[idx] % (NSUInteger)_gridSize.height; + + return CGSizeMake(pos2.x - pos.width, pos2.y - pos.height); +} + +-(void)placeTile:(CGPoint)pos tile:(Tile)t +{ + ccQuad3 coords = [self originalTile:pos]; + + CGPoint step = [[_target grid] step]; + coords.bl.x += (int)(t.position.x * step.x); + coords.bl.y += (int)(t.position.y * step.y); + + coords.br.x += (int)(t.position.x * step.x); + coords.br.y += (int)(t.position.y * step.y); + + coords.tl.x += (int)(t.position.x * step.x); + coords.tl.y += (int)(t.position.y * step.y); + + coords.tr.x += (int)(t.position.x * step.x); + coords.tr.y += (int)(t.position.y * step.y); + + [self setTile:pos coords:coords]; +} + +-(void)startWithTarget:(id)aTarget +{ + [super startWithTarget:aTarget]; + + if ( _seed != -1 ) + srand(_seed); + + _tilesCount = _gridSize.width * _gridSize.height; + _tilesOrder = (NSUInteger*)malloc(_tilesCount*sizeof(NSUInteger)); + NSUInteger i, j; + + for(i = 0; i < _tilesCount; i++ ) + _tilesOrder[i] = i; + + [self shuffle:_tilesOrder count:_tilesCount]; + + _tiles = malloc(_tilesCount*sizeof(Tile)); + Tile *tileArray = (Tile*)_tiles; + + for( i = 0; i < _gridSize.width; i++ ) + { + for( j = 0; j < _gridSize.height; j++ ) + { + tileArray->position = ccp(i,j); + tileArray->startPosition = ccp(i,j); + tileArray->delta = [self getDelta:CGSizeMake(i,j)]; + tileArray++; + } + } +} + +-(void)update:(ccTime)time +{ + int i, j; + + Tile *tileArray = (Tile*)_tiles; + + for( i = 0; i < _gridSize.width; i++ ) + { + for( j = 0; j < _gridSize.height; j++ ) + { + tileArray->position = ccpMult( ccp(tileArray->delta.width, tileArray->delta.height), time); + [self placeTile:ccp(i,j) tile:*tileArray]; + tileArray++; + } + } +} + +@end + +//////////////////////////////////////////////////////////// + +#pragma mark - +#pragma mark CCFadeOutTRTiles + +@implementation CCFadeOutTRTiles + +-(float)testFunc:(CGSize)pos time:(ccTime)time +{ + CGPoint n = ccpMult( ccp(_gridSize.width,_gridSize.height), time); + if ( (n.x+n.y) == 0.0f ) + return 1.0f; + + return powf( (pos.width+pos.height) / (n.x+n.y), 6 ); +} + +-(void)turnOnTile:(CGPoint)pos +{ + [self setTile:pos coords:[self originalTile:pos]]; +} + +-(void)turnOffTile:(CGPoint)pos +{ + ccQuad3 coords; + bzero(&coords, sizeof(ccQuad3)); + [self setTile:pos coords:coords]; +} + +-(void)transformTile:(CGPoint)pos distance:(float)distance +{ + ccQuad3 coords = [self originalTile:pos]; + CGPoint step = [[_target grid] step]; + + coords.bl.x += (step.x / 2) * (1.0f - distance); + coords.bl.y += (step.y / 2) * (1.0f - distance); + + coords.br.x -= (step.x / 2) * (1.0f - distance); + coords.br.y += (step.y / 2) * (1.0f - distance); + + coords.tl.x += (step.x / 2) * (1.0f - distance); + coords.tl.y -= (step.y / 2) * (1.0f - distance); + + coords.tr.x -= (step.x / 2) * (1.0f - distance); + coords.tr.y -= (step.y / 2) * (1.0f - distance); + + [self setTile:pos coords:coords]; +} + +#pragma clang diagnostic push COCOS2D +#pragma clang diagnostic ignored "-Wfloat-equal" +-(void)update:(ccTime)time +{ + int i, j; + + for( i = 0; i < _gridSize.width; i++ ) + { + for( j = 0; j < _gridSize.height; j++ ) + { + float distance = [self testFunc:CGSizeMake(i,j) time:time]; + if ( distance == 0 ) + [self turnOffTile:ccp(i,j)]; + else if ( distance < 1 ) + [self transformTile:ccp(i,j) distance:distance]; + else + [self turnOnTile:ccp(i,j)]; + } + } +} + +@end + +//////////////////////////////////////////////////////////// + +#pragma mark - +#pragma mark CCFadeOutBLTiles + +@implementation CCFadeOutBLTiles + +-(float)testFunc:(CGSize)pos time:(ccTime)time +{ + CGPoint n = ccpMult(ccp(_gridSize.width, _gridSize.height), (1.0f-time)); + if ( (pos.width+pos.height) == 0 ) + return 1.0f; + + return powf( (n.x+n.y) / (pos.width+pos.height), 6 ); +} + +@end + +//////////////////////////////////////////////////////////// + +#pragma mark - +#pragma mark CCFadeOutUpTiles + +@implementation CCFadeOutUpTiles + +-(float)testFunc:(CGSize)pos time:(ccTime)time +{ + CGPoint n = ccpMult(ccp(_gridSize.width, _gridSize.height), time); + if ( n.y == 0 ) + return 1.0f; + + return powf( pos.height / n.y, 6 ); +} + +-(void)transformTile:(CGPoint)pos distance:(float)distance +{ + ccQuad3 coords = [self originalTile:pos]; + CGPoint step = [[_target grid] step]; + + coords.bl.y += (step.y / 2) * (1.0f - distance); + coords.br.y += (step.y / 2) * (1.0f - distance); + coords.tl.y -= (step.y / 2) * (1.0f - distance); + coords.tr.y -= (step.y / 2) * (1.0f - distance); + + [self setTile:pos coords:coords]; +} + +@end + +//////////////////////////////////////////////////////////// + +#pragma mark - +#pragma mark CCFadeOutDownTiles + +@implementation CCFadeOutDownTiles + +-(float)testFunc:(CGSize)pos time:(ccTime)time +{ + CGPoint n = ccpMult(ccp(_gridSize.width,_gridSize.height), (1.0f - time)); + if ( pos.height == 0 ) + return 1.0f; + + return powf( n.y / pos.height, 6 ); +} + +@end + +//////////////////////////////////////////////////////////// + +#pragma mark - +#pragma mark TurnOffTiles + +@implementation CCTurnOffTiles + ++(id)actionWithDuration:(ccTime)duration size:(CGSize)gridSize seed:(unsigned)seed +{ + return [[self alloc] initWithDuration:duration size:gridSize seed:seed]; +} + +-(id)initWithDuration:(ccTime)duration size:(CGSize)gridSize seed:(unsigned)seed +{ + if ( (self = [super initWithDuration:duration size:gridSize]) ) + { + _seed = seed; + _tilesOrder = nil; + } + + return self; +} + +-(id) copyWithZone: (NSZone*) zone +{ + return [[[self class] allocWithZone:zone] initWithDuration:_duration size:_gridSize seed:_seed]; +} + +-(void)dealloc +{ + if(_tilesOrder) + free(_tilesOrder); +} + +-(void)shuffle:(NSUInteger*)array count:(NSUInteger)len +{ + NSInteger i; + for( i = len - 1; i >= 0; i-- ) + { + NSUInteger j = rand() % (i+1); + NSUInteger v = array[i]; + array[i] = array[j]; + array[j] = v; + } +} + +-(void)turnOnTile:(CGPoint)pos +{ + [self setTile:pos coords:[self originalTile:pos]]; +} + +-(void)turnOffTile:(CGPoint)pos +{ + ccQuad3 coords; + + bzero(&coords, sizeof(ccQuad3)); + [self setTile:pos coords:coords]; +} + +-(void)startWithTarget:(id)aTarget +{ + NSUInteger i; + + [super startWithTarget:aTarget]; + + if ( _seed != -1 ) + srand(_seed); + + _tilesCount = _gridSize.width * _gridSize.height; + _tilesOrder = (NSUInteger*)malloc(_tilesCount*sizeof(NSUInteger)); + + for( i = 0; i < _tilesCount; i++ ) + _tilesOrder[i] = i; + + [self shuffle:_tilesOrder count:_tilesCount]; +} + +-(void)update:(ccTime)time +{ + NSUInteger i, l, t; + + l = (NSUInteger)(time * (float)_tilesCount); + + for( i = 0; i < _tilesCount; i++ ) + { + t = _tilesOrder[i]; + CGPoint tilePos = ccp( (NSUInteger)(t / _gridSize.height), + t % (NSUInteger)_gridSize.height ); + + if ( i < l ) + [self turnOffTile:tilePos]; + else + [self turnOnTile:tilePos]; + } +} + +@end + +#pragma clang diagnostic pop COCOS2D + +//////////////////////////////////////////////////////////// + +#pragma mark - +#pragma mark CCWavesTiles3D + +@implementation CCWavesTiles3D + +@synthesize amplitude = _amplitude; +@synthesize amplitudeRate = _amplitudeRate; + ++(id)actionWithDuration:(ccTime)duration size:(CGSize)gridSize waves:(NSUInteger)wav amplitude:(float)amp +{ + return [[self alloc] initWithDuration:duration size:gridSize waves:wav amplitude:amp]; +} + +-(id)initWithDuration:(ccTime)duration size:(CGSize)gridSize waves:(NSUInteger)wav amplitude:(float)amp +{ + if ( (self = [super initWithDuration:duration size:gridSize]) ) + { + _waves = wav; + _amplitude = amp; + _amplitudeRate = 1.0f; + } + + return self; +} + +-(id) copyWithZone: (NSZone*) zone +{ + CCGridAction *copy = [[[self class] allocWithZone:zone] initWithDuration:_duration size:_gridSize waves:_waves amplitude:_amplitude]; + return copy; +} + + +-(void)update:(ccTime)time +{ + int i, j; + + for( i = 0; i < _gridSize.width; i++ ) + { + for( j = 0; j < _gridSize.height; j++ ) + { + ccQuad3 coords = [self originalTile:ccp(i,j)]; + + coords.bl.z = (sinf(time*(CGFloat)M_PI*_waves*2 + (coords.bl.y+coords.bl.x) * .01f) * _amplitude * _amplitudeRate ); + coords.br.z = coords.bl.z; + coords.tl.z = coords.bl.z; + coords.tr.z = coords.bl.z; + + [self setTile:ccp(i,j) coords:coords]; + } + } +} +@end + +//////////////////////////////////////////////////////////// + +#pragma mark - +#pragma mark CCJumpTiles3D + +@implementation CCJumpTiles3D + +@synthesize amplitude = _amplitude; +@synthesize amplitudeRate = _amplitudeRate; + ++(id)actionWithDuration:(ccTime)duration size:(CGSize)gridSize jumps:(NSUInteger)numberOfJumps amplitude:(float)amplitude +{ + return [[self alloc] initWithDuration:duration size:gridSize jumps:numberOfJumps amplitude:amplitude]; +} + +-(id)initWithDuration:(ccTime)duration size:(CGSize)gridSize jumps:(NSUInteger)numberOfJumps amplitude:(float)amplitude +{ + if ( (self = [super initWithDuration:duration size:gridSize]) ) + { + _jumps = numberOfJumps; + _amplitude = amplitude; + _amplitudeRate = 1.0f; + } + + return self; +} + +-(id) copyWithZone: (NSZone*) zone +{ + CCGridAction *copy = [[[self class] allocWithZone:zone] initWithDuration:_duration size:_gridSize jumps:_jumps amplitude:_amplitude]; + return copy; +} + + +-(void)update:(ccTime)time +{ + int i, j; + + float sinz = (sinf((CGFloat)M_PI*time*_jumps*2) * _amplitude * _amplitudeRate ); + float sinz2 = (sinf((CGFloat)M_PI*(time*_jumps*2 + 1)) * _amplitude * _amplitudeRate ); + + for( i = 0; i < _gridSize.width; i++ ) + { + for( j = 0; j < _gridSize.height; j++ ) + { + ccQuad3 coords = [self originalTile:ccp(i,j)]; + + if ( ((i+j) % 2) == 0 ) + { + coords.bl.z += sinz; + coords.br.z += sinz; + coords.tl.z += sinz; + coords.tr.z += sinz; + } + else + { + coords.bl.z += sinz2; + coords.br.z += sinz2; + coords.tl.z += sinz2; + coords.tr.z += sinz2; + } + + [self setTile:ccp(i,j) coords:coords]; + } + } +} +@end + +//////////////////////////////////////////////////////////// + +#pragma mark - +#pragma mark SplitRows + +@implementation CCSplitRows + ++(id)actionWithDuration:(ccTime)duration rows:(NSUInteger)rows +{ + return [[self alloc] initWithDuration:duration rows:rows]; +} + +-(id)initWithDuration:(ccTime)duration rows:(NSUInteger)rows +{ + if( (self=[super initWithDuration:duration size:CGSizeMake(1,rows)]) ) + _rows = rows; + + return self; +} + +-(id) copyWithZone: (NSZone*) zone +{ + return [[[self class] allocWithZone:zone] initWithDuration:_duration rows:_rows]; +} + +-(void)startWithTarget:(id)aTarget +{ + [super startWithTarget:aTarget]; + _winSize = [[CCDirector sharedDirector] winSizeInPixels]; +} + +-(void)update:(ccTime)time +{ + NSUInteger j; + + for( j = 0; j < _gridSize.height; j++ ) + { + ccQuad3 coords = [self originalTile:ccp(0,j)]; + float direction = 1; + + if ( (j % 2 ) == 0 ) + direction = -1; + + coords.bl.x += direction * _winSize.width * time; + coords.br.x += direction * _winSize.width * time; + coords.tl.x += direction * _winSize.width * time; + coords.tr.x += direction * _winSize.width * time; + + [self setTile:ccp(0,j) coords:coords]; + } +} + +@end + +//////////////////////////////////////////////////////////// + +#pragma mark - +#pragma mark CCSplitCols + +@implementation CCSplitCols + ++(id)actionWithDuration:(ccTime)duration cols:(NSUInteger)cols +{ + return [[self alloc] initWithDuration:duration cols:cols]; +} + +-(id)initWithDuration:(ccTime)duration cols:(NSUInteger)cols +{ + if( (self=[super initWithDuration:duration size:CGSizeMake(cols,1)]) ) + _cols = cols; + return self; +} + +-(id) copyWithZone: (NSZone*) zone +{ + return [[[self class] allocWithZone:zone] initWithDuration:_duration cols:_cols]; +} + +-(void)startWithTarget:(id)aTarget +{ + [super startWithTarget:aTarget]; + _winSize = [[CCDirector sharedDirector] winSizeInPixels]; +} + +-(void)update:(ccTime)time +{ + NSUInteger i; + + for( i = 0; i < _gridSize.width; i++ ) + { + ccQuad3 coords = [self originalTile:ccp(i,0)]; + float direction = 1; + + if ( (i % 2 ) == 0 ) + direction = -1; + + coords.bl.y += direction * _winSize.height * time; + coords.br.y += direction * _winSize.height * time; + coords.tl.y += direction * _winSize.height * time; + coords.tr.y += direction * _winSize.height * time; + + [self setTile:ccp(i,0) coords:coords]; + } +} + +@end diff --git a/cocos2d/CCActionTween.h b/cocos2d/CCActionTween.h new file mode 100644 index 0000000..3186e95 --- /dev/null +++ b/cocos2d/CCActionTween.h @@ -0,0 +1,62 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright 2009 lhunath (Maarten Billemont) + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + */ + + +#import +#import "CCActionInterval.h" + +/** CCActionTween + + CCActionTween is an action that lets you update any property of an object. + For example, if you want to modify the "width" property of a target from 200 to 300 in 2 seconds, then: + + id modifyWidth = [CCActionTween actionWithDuration:2 key:@"width" from:200 to:300]; + [target runAction:modifyWidth]; + + + Another example: CCScaleTo action could be rewriten using CCPropertyAction: + + // scaleA and scaleB are equivalents + id scaleA = [CCScaleTo actionWithDuration:2 scale:3]; + id scaleB = [CCActionTween actionWithDuration:2 key:@"scale" from:1 to:3]; + + + @since v0.99.2 + */ +@interface CCActionTween : CCActionInterval +{ + NSString *_key; + + float _from, _to; + float _delta; +} + +/** creates an initializes the action with the property name (key), and the from and to parameters. */ ++ (id)actionWithDuration:(ccTime)aDuration key:(NSString *)key from:(float)from to:(float)to; + +/** initializes the action with the property name (key), and the from and to parameters. */ +- (id)initWithDuration:(ccTime)aDuration key:(NSString *)key from:(float)from to:(float)to; + +@end diff --git a/src/cocos2d/CCActionTween.m b/cocos2d/CCActionTween.m similarity index 80% rename from src/cocos2d/CCActionTween.m rename to cocos2d/CCActionTween.m index a119d72..f3b8b87 100644 --- a/src/cocos2d/CCActionTween.m +++ b/cocos2d/CCActionTween.m @@ -30,42 +30,37 @@ @implementation CCActionTween + (id)actionWithDuration:(ccTime)aDuration key:(NSString *)aKey from:(float)aFrom to:(float)aTo { - return [[[[self class] alloc] initWithDuration:aDuration key:aKey from:aFrom to:aTo] autorelease]; + return [[[self class] alloc] initWithDuration:aDuration key:aKey from:aFrom to:aTo]; } - (id)initWithDuration:(ccTime)aDuration key:(NSString *)key from:(float)from to:(float)to { if ((self = [super initWithDuration:aDuration])) { - key_ = [key copy]; - to_ = to; - from_ = from; + _key = [key copy]; + _to = to; + _from = from; } return self; } -- (void) dealloc -{ - [key_ release]; - [super dealloc]; -} - (void)startWithTarget:aTarget { [super startWithTarget:aTarget]; - delta_ = to_ - from_; + _delta = _to - _from; } - (void) update:(ccTime) dt { - [target_ setValue:[NSNumber numberWithFloat:to_ - delta_ * (1 - dt)] forKey:key_]; + [_target setValue:[NSNumber numberWithFloat:_to - _delta * (1 - dt)] forKey:_key]; } - (CCActionInterval *) reverse { - return [[self class] actionWithDuration:duration_ key:key_ from:to_ to:from_]; + return [[self class] actionWithDuration:_duration key:_key from:_to to:_from]; } diff --git a/cocos2d/CCAnimation.h b/cocos2d/CCAnimation.h new file mode 100644 index 0000000..b4a4bf4 --- /dev/null +++ b/cocos2d/CCAnimation.h @@ -0,0 +1,150 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2008-2010 Ricardo Quesada + * Copyright (c) 2011 Zynga Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + */ + +#import +#ifdef __CC_PLATFORM_IOS +#import +#endif // IPHONE + +@class CCSpriteFrame; +@class CCTexture2D; +@class CCSpriteFrame; + +/** CCAnimationFrame + A frame of the animation. It contains information like: + - sprite frame name + - # of delay units. + - offset + + @since v2.0 + */ +@interface CCAnimationFrame : NSObject +{ + CCSpriteFrame* _spriteFrame; + float _delayUnits; + NSDictionary *_userInfo; +} +/** CCSpriteFrameName to be used */ +@property (nonatomic, readwrite, strong) CCSpriteFrame* spriteFrame; + +/** how many units of time the frame takes */ +@property (nonatomic, readwrite) float delayUnits; + +/** A CCAnimationFrameDisplayedNotification notification will be broadcasted when the frame is displayed with this dictionary as UserInfo. If UserInfo is nil, then no notification will be broadcasted. */ +@property (nonatomic, readwrite, strong) NSDictionary *userInfo; + +/** initializes the animation frame with a spriteframe, number of delay units and a notification user info */ +-(id) initWithSpriteFrame:(CCSpriteFrame*)spriteFrame delayUnits:(float)delayUnits userInfo:(NSDictionary*)userInfo; +@end + +/** A CCAnimation object is used to perform animations on the CCSprite objects. + + The CCAnimation object contains CCAnimationFrame objects, and a possible delay between the frames. + You can animate a CCAnimation object by using the CCAnimate action. Example: + + [sprite runAction:[CCAnimate actionWithAnimation:animation]]; + + */ +@interface CCAnimation : NSObject +{ + NSMutableArray *_frames; + float _totalDelayUnits; + float _delayPerUnit; + BOOL _restoreOriginalFrame; + NSUInteger _loops; +} + +/** total Delay units of the CCAnimation. */ +@property (nonatomic, readonly) float totalDelayUnits; +/** Delay in seconds of the "delay unit" */ +@property (nonatomic, readwrite) float delayPerUnit; +/** duration in seconds of the whole animation. It is the result of totalDelayUnits * delayPerUnit */ +@property (nonatomic,readonly) float duration; +/** array of CCAnimationFrames */ +@property (nonatomic,readwrite,strong) NSMutableArray *frames; +/** whether or not it shall restore the original frame when the animation finishes */ +@property (nonatomic,readwrite) BOOL restoreOriginalFrame; +/** how many times the animation is going to loop. 0 means animation is not animated. 1, animation is executed one time, ... */ +@property (nonatomic, readwrite) NSUInteger loops; + +/** Creates an animation + @since v0.99.5 + */ ++(id) animation; + +/** Creates an animation with an array of CCSpriteFrame. + The frames will be created with one "delay unit". + @since v0.99.5 + */ ++(id) animationWithSpriteFrames:(NSArray*)arrayOfSpriteFrameNames; + +/* Creates an animation with an array of CCSpriteFrame and a delay between frames in seconds. + The frames will be added with one "delay unit". + @since v0.99.5 + */ ++(id) animationWithSpriteFrames:(NSArray*)arrayOfSpriteFrameNames delay:(float)delay; + +/* Creates an animation with an array of CCAnimationFrame, the delay per units in seconds and and how many times it should be executed. + @since v2.0 + */ ++(id) animationWithAnimationFrames:(NSArray*)arrayOfAnimationFrames delayPerUnit:(float)delayPerUnit loops:(NSUInteger)loops; + + +/** Initializes a CCAnimation with an array of CCSpriteFrame. + The frames will be added with one "delay unit". + @since v0.99.5 +*/ +-(id) initWithSpriteFrames:(NSArray*)arrayOfSpriteFrameNames; + +/** Initializes a CCAnimation with an array of CCSpriteFrames and a delay between frames in seconds. + The frames will be added with one "delay unit". + @since v0.99.5 + */ +-(id) initWithSpriteFrames:(NSArray *)arrayOfSpriteFrameNames delay:(float)delay; + +/* Initializes an animation with an array of CCAnimationFrame and the delay per units in seconds. + @since v2.0 + */ +-(id) initWithAnimationFrames:(NSArray*)arrayOfAnimationFrames delayPerUnit:(float)delayPerUnit loops:(NSUInteger)loops; + +/** Adds a CCSpriteFrame to a CCAnimation. + The frame will be added with one "delay unit". +*/ +-(void) addSpriteFrame:(CCSpriteFrame*)frame; + +/** Adds a frame with an image filename. Internally it will create a CCSpriteFrame and it will add it. + The frame will be added with one "delay unit". + Added to facilitate the migration from v0.8 to v0.9. + */ +-(void) addSpriteFrameWithFilename:(NSString*)filename; + +/** Adds a frame with a texture and a rect. Internally it will create a CCSpriteFrame and it will add it. + The frame will be added with one "delay unit". + Added to facilitate the migration from v0.8 to v0.9. + */ +-(void) addSpriteFrameWithTexture:(CCTexture2D*)texture rect:(CGRect)rect; + +@end diff --git a/src/cocos2d/CCAnimation.m b/cocos2d/CCAnimation.m similarity index 74% rename from src/cocos2d/CCAnimation.m rename to cocos2d/CCAnimation.m index 4a28e49..c2f76be 100644 --- a/src/cocos2d/CCAnimation.m +++ b/cocos2d/CCAnimation.m @@ -33,7 +33,7 @@ #pragma mark - CCAnimationFrame @implementation CCAnimationFrame -@synthesize spriteFrame = spriteFrame_, delayUnits = delayUnits_, userInfo=userInfo_; +@synthesize spriteFrame = _spriteFrame, delayUnits = _delayUnits, userInfo=_userInfo; -(id) initWithSpriteFrame:(CCSpriteFrame *)spriteFrame delayUnits:(float)delayUnits userInfo:(NSDictionary*)userInfo { @@ -50,21 +50,18 @@ -(void) dealloc { CCLOGINFO( @"cocos2d: deallocing %@", self); - [spriteFrame_ release]; - [userInfo_ release]; - [super dealloc]; } -(id) copyWithZone: (NSZone*) zone { - CCAnimationFrame *copy = [[[self class] allocWithZone: zone] initWithSpriteFrame:[[spriteFrame_ copy] autorelease] delayUnits:delayUnits_ userInfo:[[userInfo_ copy] autorelease] ]; + CCAnimationFrame *copy = [[[self class] allocWithZone: zone] initWithSpriteFrame:[_spriteFrame copy] delayUnits:_delayUnits userInfo:[_userInfo copy] ]; return copy; } -(NSString*) description { - return [NSString stringWithFormat:@"<%@ = %p | SpriteFrame = %p, delayUnits = %0.2f >", [self class], self, spriteFrame_, delayUnits_ ]; + return [NSString stringWithFormat:@"<%@ = %p | SpriteFrame = %p, delayUnits = %0.2f >", [self class], self, _spriteFrame, _delayUnits ]; } @end @@ -72,26 +69,26 @@ -(NSString*) description #pragma mark - CCAnimation @implementation CCAnimation -@synthesize frames = frames_, totalDelayUnits=totalDelayUnits_, delayPerUnit=delayPerUnit_, restoreOriginalFrame=restoreOriginalFrame_, loops=loops_; +@synthesize frames = _frames, totalDelayUnits=_totalDelayUnits, delayPerUnit=_delayPerUnit, restoreOriginalFrame=_restoreOriginalFrame, loops=_loops; +(id) animation { - return [[[self alloc] init] autorelease]; + return [[self alloc] init]; } +(id) animationWithSpriteFrames:(NSArray*)frames { - return [[[self alloc] initWithSpriteFrames:frames] autorelease]; + return [[self alloc] initWithSpriteFrames:frames]; } +(id) animationWithSpriteFrames:(NSArray*)frames delay:(float)delay { - return [[[self alloc] initWithSpriteFrames:frames delay:delay] autorelease]; + return [[self alloc] initWithSpriteFrames:frames delay:delay]; } +(id) animationWithAnimationFrames:(NSArray*)arrayOfAnimationFrames delayPerUnit:(float)delayPerUnit loops:(NSUInteger)loops { - return [[[self alloc] initWithAnimationFrames:arrayOfAnimationFrames delayPerUnit:delayPerUnit loops:loops] autorelease]; + return [[self alloc] initWithAnimationFrames:arrayOfAnimationFrames delayPerUnit:delayPerUnit loops:loops]; } -(id) init @@ -108,8 +105,8 @@ -(id) initWithSpriteFrames:(NSArray*)array delay:(float)delay { if( (self=[super init]) ) { - loops_ = 1; - delayPerUnit_ = delay; + _loops = 1; + _delayPerUnit = delay; self.frames = [NSMutableArray arrayWithCapacity:[array count]]; @@ -117,8 +114,7 @@ -(id) initWithSpriteFrames:(NSArray*)array delay:(float)delay CCAnimationFrame *animFrame = [[CCAnimationFrame alloc] initWithSpriteFrame:frame delayUnits:1 userInfo:nil]; [self.frames addObject:animFrame]; - [animFrame release]; - totalDelayUnits_++; + _totalDelayUnits++; } } @@ -129,13 +125,13 @@ -(id) initWithAnimationFrames:(NSArray*)arrayOfAnimationFrames delayPerUnit:(flo { if( ( self=[super init]) ) { - delayPerUnit_ = delayPerUnit; - loops_ = loops; + _delayPerUnit = delayPerUnit; + _loops = loops; self.frames = [NSMutableArray arrayWithArray:arrayOfAnimationFrames]; - for( CCAnimationFrame *animFrame in frames_ ) - totalDelayUnits_ += animFrame.delayUnits; + for( CCAnimationFrame *animFrame in _frames ) + _totalDelayUnits += animFrame.delayUnits; } return self; } @@ -143,22 +139,22 @@ -(id) initWithAnimationFrames:(NSArray*)arrayOfAnimationFrames delayPerUnit:(flo - (NSString*) description { return [NSString stringWithFormat:@"<%@ = %p | frames=%lu, totalDelayUnits=%f, delayPerUnit=%f, loops=%lu>", [self class], self, - (unsigned long)[frames_ count], - totalDelayUnits_, - delayPerUnit_, - (unsigned long)loops_ + (unsigned long)[_frames count], + _totalDelayUnits, + _delayPerUnit, + (unsigned long)_loops ]; } -(float) duration { - return totalDelayUnits_ * delayPerUnit_; + return _totalDelayUnits * _delayPerUnit; } - (id)copyWithZone:(NSZone *)zone { - CCAnimation *animation = [[[self class] allocWithZone: zone] initWithAnimationFrames:frames_ delayPerUnit:delayPerUnit_ loops:loops_]; - animation.restoreOriginalFrame = restoreOriginalFrame_; + CCAnimation *animation = [[[self class] allocWithZone: zone] initWithAnimationFrames:_frames delayPerUnit:_delayPerUnit loops:_loops]; + animation.restoreOriginalFrame = _restoreOriginalFrame; return animation; } @@ -167,18 +163,15 @@ -(void) dealloc { CCLOGINFO( @"cocos2d: deallocing %@",self); - [frames_ release]; - [super dealloc]; } -(void) addSpriteFrame:(CCSpriteFrame*)frame { CCAnimationFrame *animFrame = [[CCAnimationFrame alloc] initWithSpriteFrame:frame delayUnits:1 userInfo:nil]; - [frames_ addObject:animFrame]; - [animFrame release]; + [_frames addObject:animFrame]; // update duration - totalDelayUnits_++; + _totalDelayUnits++; } -(void) addSpriteFrameWithFilename:(NSString*)filename diff --git a/cocos2d/CCAnimationCache.h b/cocos2d/CCAnimationCache.h new file mode 100644 index 0000000..2684a86 --- /dev/null +++ b/cocos2d/CCAnimationCache.h @@ -0,0 +1,74 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2010 Ricardo Quesada + * Copyright (c) 2011 Zynga Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + */ + +#import + +@class CCAnimation; + +/** Singleton that manages the CCAnimation objects. + It saves in a cache the animations. You should use this class if you want to save your animations in a cache. + + @since v0.99.5 + */ +@interface CCAnimationCache : NSObject +{ + NSMutableDictionary *_animations; +} + +/** Returns the shared instance of the Animation cache */ ++ (CCAnimationCache *) sharedAnimationCache; + +/** Purges the cache. It releases all the CCAnimation objects and the shared instance. + */ ++(void)purgeSharedAnimationCache; + +/** Adds a CCAnimation with a name. + */ +-(void) addAnimation:(CCAnimation*)animation name:(NSString*)name; + +/** Deletes a CCAnimation from the cache. + */ +-(void) removeAnimationByName:(NSString*)name; + +/** Returns a CCAnimation that was previously added. + If the name is not found it will return nil. + You should retain the returned copy if you are going to use it. + */ +-(CCAnimation*) animationByName:(NSString*)name; + +/** Adds an animation from an NSDictionary + Make sure that the frames were previously loaded in the CCSpriteFrameCache. + @since v1.1 + */ +-(void)addAnimationsWithDictionary:(NSDictionary *)dictionary; + +/** Adds an animation from a plist file. + Make sure that the frames were previously loaded in the CCSpriteFrameCache. + @since v1.1 + */ +-(void)addAnimationsWithFile:(NSString *)plist; + +@end diff --git a/src/cocos2d/CCAnimationCache.m b/cocos2d/CCAnimationCache.m similarity index 90% rename from src/cocos2d/CCAnimationCache.m rename to cocos2d/CCAnimationCache.m index 443b878..fff48c3 100644 --- a/src/cocos2d/CCAnimationCache.m +++ b/cocos2d/CCAnimationCache.m @@ -39,32 +39,31 @@ @implementation CCAnimationCache #pragma mark CCAnimationCache - Alloc, Init & Dealloc -static CCAnimationCache *sharedAnimationCache_=nil; +static CCAnimationCache *_sharedAnimationCache=nil; + (CCAnimationCache *)sharedAnimationCache { - if (!sharedAnimationCache_) - sharedAnimationCache_ = [[CCAnimationCache alloc] init]; + if (!_sharedAnimationCache) + _sharedAnimationCache = [[CCAnimationCache alloc] init]; - return sharedAnimationCache_; + return _sharedAnimationCache; } +(id)alloc { - NSAssert(sharedAnimationCache_ == nil, @"Attempted to allocate a second instance of a singleton."); + NSAssert(_sharedAnimationCache == nil, @"Attempted to allocate a second instance of a singleton."); return [super alloc]; } +(void)purgeSharedAnimationCache { - [sharedAnimationCache_ release]; - sharedAnimationCache_ = nil; + _sharedAnimationCache = nil; } -(id) init { if( (self=[super init]) ) { - animations_ = [[NSMutableDictionary alloc] initWithCapacity: 20]; + _animations = [[NSMutableDictionary alloc] initWithCapacity: 20]; } return self; @@ -72,22 +71,20 @@ -(id) init - (NSString*) description { - return [NSString stringWithFormat:@"<%@ = %p | num of animations = %lu>", [self class], self, (unsigned long)[animations_ count]]; + return [NSString stringWithFormat:@"<%@ = %p | num of animations = %lu>", [self class], self, (unsigned long)[_animations count]]; } -(void) dealloc { CCLOGINFO(@"cocos2d: deallocing %@", self); - [animations_ release]; - [super dealloc]; } #pragma mark CCAnimationCache - load/get/del -(void) addAnimation:(CCAnimation*)animation name:(NSString*)name { - [animations_ setObject:animation forKey:name]; + [_animations setObject:animation forKey:name]; } -(void) removeAnimationByName:(NSString*)name @@ -95,12 +92,12 @@ -(void) removeAnimationByName:(NSString*)name if( ! name ) return; - [animations_ removeObjectForKey:name]; + [_animations removeObjectForKey:name]; } -(CCAnimation*) animationByName:(NSString*)name { - return [animations_ objectForKey:name]; + return [_animations objectForKey:name]; } #pragma mark CCAnimationCache - from file @@ -134,7 +131,6 @@ -(void) parseVersion1:(NSDictionary*)animations CCAnimationFrame *animFrame = [[CCAnimationFrame alloc] initWithSpriteFrame:spriteFrame delayUnits:1 userInfo:nil]; [frames addObject:animFrame]; - [animFrame release]; } if ( [frames count] == 0 ) { @@ -188,17 +184,14 @@ -(void) parseVersion2:(NSDictionary*)animations CCAnimationFrame *animFrame = [[CCAnimationFrame alloc] initWithSpriteFrame:spriteFrame delayUnits:delayUnits userInfo:userInfo]; [array addObject:animFrame]; - [animFrame release]; } float delayPerUnit = [[animationDict objectForKey:@"delayPerUnit"] floatValue]; CCAnimation *animation = [[CCAnimation alloc] initWithAnimationFrames:array delayPerUnit:delayPerUnit loops:(loops?[loops intValue]:1)]; - [array release]; [animation setRestoreOriginalFrame:restoreOriginalFrame]; [[CCAnimationCache sharedAnimationCache] addAnimation:animation name:name]; - [animation release]; } } @@ -238,7 +231,7 @@ -(void)addAnimationsWithFile:(NSString *)plist { NSAssert( plist, @"Invalid texture file name"); - NSString *path = [[CCFileUtils sharedFileUtils] fullPathFromRelativePath:plist]; + NSString *path = [[CCFileUtils sharedFileUtils] fullPathForFilename:plist]; NSDictionary *dict = [NSDictionary dictionaryWithContentsOfFile:path]; NSAssert1( dict, @"CCAnimationCache: File could not be found: %@", plist); diff --git a/cocos2d/CCAtlasNode.h b/cocos2d/CCAtlasNode.h new file mode 100644 index 0000000..091bdba --- /dev/null +++ b/cocos2d/CCAtlasNode.h @@ -0,0 +1,98 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2008-2010 Ricardo Quesada + * Copyright (c) 2011 Zynga Inc. + * + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + + +#import "CCTextureAtlas.h" +#import "CCNode.h" +#import "CCProtocols.h" + +@class CCTexture2D; + +/** CCAtlasNode is a subclass of CCNode that implements the CCRGBAProtocol and + CCTextureProtocol protocol + + It knows how to render a TextureAtlas object. + If you are going to render a TextureAtlas consider sub-classing CCAtlasNode (or a subclass of CCAtlasNode) + + All features from CCNode are valid, plus the following features: + - opacity and RGB colors + */ +@interface CCAtlasNode : CCNodeRGBA +{ + // texture atlas + CCTextureAtlas *_textureAtlas; + + // chars per row + NSUInteger _itemsPerRow; + // chars per column + NSUInteger _itemsPerColumn; + + // width of each char + NSUInteger _itemWidth; + // height of each char + NSUInteger _itemHeight; + + // quads to draw + NSUInteger _quadsToDraw; + + // blend function + ccBlendFunc _blendFunc; + + // texture RGBA. + ccColor3B _colorUnmodified; + BOOL _opacityModifyRGB; + + // color uniform + GLint _uniformColor; +} + +/** conforms to CCTextureProtocol protocol */ +@property (nonatomic,readwrite,strong) CCTextureAtlas *textureAtlas; + +/** conforms to CCTextureProtocol protocol */ +@property (nonatomic,readwrite) ccBlendFunc blendFunc; + +/** conforms to CCRGBAProtocol protocol */ +@property (nonatomic,readwrite) ccColor3B color; + +/** how many quads to draw */ +@property (nonatomic,readwrite) NSUInteger quadsToDraw; + +/** creates a CCAtlasNode with an Atlas file the width and height of each item measured in points and the quantity of items to render*/ ++(id) atlasWithTileFile:(NSString*)tile tileWidth:(NSUInteger)w tileHeight:(NSUInteger)h itemsToRender: (NSUInteger) c; + +/** initializes an CCAtlasNode with an Atlas file the width and height of each item measured in points and the quantity of items to render*/ +-(id) initWithTileFile:(NSString*)tile tileWidth:(NSUInteger)w tileHeight:(NSUInteger)h itemsToRender: (NSUInteger) c; + +/** initializes an CCAtlasNode with a texture the width and height of each item measured in points and the quantity of items to render*/ +-(id) initWithTexture:(CCTexture2D*)texture tileWidth:(NSUInteger)w tileHeight:(NSUInteger)h itemsToRender: (NSUInteger) c; + + +/** updates the Atlas (indexed vertex array). + * Shall be overridden in subclasses + */ +-(void) updateAtlasValues; +@end diff --git a/src/cocos2d/CCAtlasNode.m b/cocos2d/CCAtlasNode.m similarity index 58% rename from src/cocos2d/CCAtlasNode.m rename to cocos2d/CCAtlasNode.m index 5f16333..8cfed97 100644 --- a/src/cocos2d/CCAtlasNode.m +++ b/cocos2d/CCAtlasNode.m @@ -27,6 +27,7 @@ #import "CCAtlasNode.h" #import "ccMacros.h" #import "CCGLProgram.h" +#import "CCTextureCache.h" #import "CCShaderCache.h" #import "ccGLStateCache.h" #import "CCDirector.h" @@ -44,9 +45,9 @@ -(void) updateOpacityModifyRGB; @implementation CCAtlasNode -@synthesize textureAtlas = textureAtlas_; -@synthesize blendFunc = blendFunc_; -@synthesize quadsToDraw = quadsToDraw_; +@synthesize textureAtlas = _textureAtlas; +@synthesize blendFunc = _blendFunc; +@synthesize quadsToDraw = _quadsToDraw; #pragma mark CCAtlasNode - Creation & Init - (id) init @@ -57,30 +58,32 @@ - (id) init +(id) atlasWithTileFile:(NSString*)tile tileWidth:(NSUInteger)w tileHeight:(NSUInteger)h itemsToRender: (NSUInteger) c { - return [[[self alloc] initWithTileFile:tile tileWidth:w tileHeight:h itemsToRender:c] autorelease]; + return [[self alloc] initWithTileFile:tile tileWidth:w tileHeight:h itemsToRender:c]; } --(id) initWithTileFile:(NSString*)tile tileWidth:(NSUInteger)w tileHeight:(NSUInteger)h itemsToRender: (NSUInteger) c +-(id) initWithTileFile:(NSString*)filename tileWidth:(NSUInteger)w tileHeight:(NSUInteger)h itemsToRender: (NSUInteger) c +{ + CCTexture2D *texture = [[CCTextureCache sharedTextureCache] addImage:filename]; + return [self initWithTexture:texture tileWidth:w tileHeight:h itemsToRender:c]; +} + +-(id) initWithTexture:(CCTexture2D*)texture tileWidth:(NSUInteger)w tileHeight:(NSUInteger)h itemsToRender: (NSUInteger) c { if( (self=[super init]) ) { - itemWidth_ = w; - itemHeight_ = h; + _itemWidth = w; + _itemHeight = h; - opacity_ = 255; - color_ = colorUnmodified_ = ccWHITE; - opacityModifyRGB_ = YES; + _colorUnmodified = ccWHITE; + _opacityModifyRGB = YES; - blendFunc_.src = CC_BLEND_SRC; - blendFunc_.dst = CC_BLEND_DST; + _blendFunc.src = CC_BLEND_SRC; + _blendFunc.dst = CC_BLEND_DST; - CCTextureAtlas * newAtlas = [[CCTextureAtlas alloc] initWithFile:tile capacity:c]; - self.textureAtlas = newAtlas; - [newAtlas release]; + _textureAtlas = [[CCTextureAtlas alloc] initWithTexture:texture capacity:c]; - if( ! textureAtlas_ ) { + if( ! _textureAtlas ) { CCLOG(@"cocos2d: Could not initialize CCAtlasNode. Invalid Texture"); - [self release]; return nil; } @@ -93,25 +96,19 @@ -(id) initWithTileFile:(NSString*)tile tileWidth:(NSUInteger)w tileHeight:(NSUIn // shader stuff self.shaderProgram = [[CCShaderCache sharedShaderCache] programForKey:kCCShader_PositionTexture_uColor]; - uniformColor_ = glGetUniformLocation( shaderProgram_->program_, "u_color"); + _uniformColor = glGetUniformLocation( _shaderProgram.program, "u_color"); } return self; } --(void) dealloc -{ - [textureAtlas_ release]; - - [super dealloc]; -} #pragma mark CCAtlasNode - Atlas generation -(void) calculateMaxItems { - CGSize s = [[textureAtlas_ texture] contentSize]; - itemsPerColumn_ = s.height / itemHeight_; - itemsPerRow_ = s.width / itemWidth_; + CGSize s = [[_textureAtlas texture] contentSize]; + _itemsPerColumn = s.height / _itemHeight; + _itemsPerRow = s.width / _itemWidth; } -(void) updateAtlasValues @@ -124,86 +121,85 @@ - (void) draw { CC_NODE_DRAW_SETUP(); - ccGLBlendFunc( blendFunc_.src, blendFunc_.dst ); + ccGLBlendFunc( _blendFunc.src, _blendFunc.dst ); - GLfloat colors[4] = {color_.r / 255.0f, color_.g / 255.0f, color_.b / 255.0f, opacity_ / 255.0f}; - [shaderProgram_ setUniformLocation:uniformColor_ with4fv:colors count:1]; + GLfloat colors[4] = { _displayedColor.r / 255.0f, + _displayedColor.g / 255.0f, + _displayedColor.b / 255.0f, + _displayedOpacity / 255.0f}; + [_shaderProgram setUniformLocation:_uniformColor with4fv:colors count:1]; - [textureAtlas_ drawNumberOfQuads:quadsToDraw_ fromIndex:0]; + [_textureAtlas drawNumberOfQuads:_quadsToDraw fromIndex:0]; } #pragma mark CCAtlasNode - RGBA protocol - (ccColor3B) color { - if(opacityModifyRGB_) - return colorUnmodified_; + if (_opacityModifyRGB) + return _colorUnmodified; - return color_; + return super.color; } -(void) setColor:(ccColor3B)color3 { - color_ = colorUnmodified_ = color3; + _colorUnmodified = color3; - if( opacityModifyRGB_ ){ - color_.r = color3.r * opacity_/255; - color_.g = color3.g * opacity_/255; - color_.b = color3.b * opacity_/255; + if( _opacityModifyRGB ){ + color3.r = color3.r * _displayedOpacity/255; + color3.g = color3.g * _displayedOpacity/255; + color3.b = color3.b * _displayedOpacity/255; } -} - --(GLubyte) opacity -{ - return opacity_; + [super setColor:color3]; } -(void) setOpacity:(GLubyte) anOpacity { - opacity_ = anOpacity; + [super setOpacity:anOpacity]; // special opacity for premultiplied textures - if( opacityModifyRGB_ ) - [self setColor: colorUnmodified_]; + if( _opacityModifyRGB ) + [self setColor: _colorUnmodified]; } -(void) setOpacityModifyRGB:(BOOL)modify { ccColor3B oldColor = self.color; - opacityModifyRGB_ = modify; + _opacityModifyRGB = modify; self.color = oldColor; } -(BOOL) doesOpacityModifyRGB { - return opacityModifyRGB_; + return _opacityModifyRGB; } -(void) updateOpacityModifyRGB { - opacityModifyRGB_ = [textureAtlas_.texture hasPremultipliedAlpha]; + _opacityModifyRGB = [_textureAtlas.texture hasPremultipliedAlpha]; } #pragma mark CCAtlasNode - CCNodeTexture protocol -(void) updateBlendFunc { - if( ! [textureAtlas_.texture hasPremultipliedAlpha] ) { - blendFunc_.src = GL_SRC_ALPHA; - blendFunc_.dst = GL_ONE_MINUS_SRC_ALPHA; + if( ! [_textureAtlas.texture hasPremultipliedAlpha] ) { + _blendFunc.src = GL_SRC_ALPHA; + _blendFunc.dst = GL_ONE_MINUS_SRC_ALPHA; } } -(void) setTexture:(CCTexture2D*)texture { - textureAtlas_.texture = texture; + _textureAtlas.texture = texture; [self updateBlendFunc]; [self updateOpacityModifyRGB]; } -(CCTexture2D*) texture { - return textureAtlas_.texture; + return _textureAtlas.texture; } @end diff --git a/cocos2d/CCCamera.h b/cocos2d/CCCamera.h new file mode 100644 index 0000000..9366ef5 --- /dev/null +++ b/cocos2d/CCCamera.h @@ -0,0 +1,101 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2008-2010 Ricardo Quesada + * Copyright (c) 2011 Zynga Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + + + +#import "CCNode.h" +#pragma clang diagnostic push COCOS2D +#pragma clang diagnostic ignored "-Wignored-qualifiers" +#import "kazmath/mat4.h" +#pragma clang diagnostic pop COCOS2D + +/** + A CCCamera is used in every CCNode. + Useful to look at the object from different views. + The OpenGL gluLookAt() function is used to locate the + camera. + + If the object is transformed by any of the scale, rotation or + position attributes, then they will override the camera. + + IMPORTANT: Either your use the camera or the rotation/scale/position properties. You can't use both. + World coordinates won't work if you use the camera. + + Limitations: + + - Some nodes, like CCParallaxNode, CCParticle uses world node coordinates, and they won't work properly if you move them (or any of their ancestors) + using the camera. + + - It doesn't work on batched nodes like CCSprite objects when they are parented to a CCSpriteBatchNode object. + + - It is recommended to use it ONLY if you are going to create 3D effects. For 2D effects, use the action CCFollow or position/scale/rotate. + +*/ + +@interface CCCamera : NSObject +{ + float _eyeX; + float _eyeY; + float _eyeZ; + + float _centerX; + float _centerY; + float _centerZ; + + float _upX; + float _upY; + float _upZ; + + BOOL _dirty; + + kmMat4 _lookupMatrix; +} + +/** whether of not the camera is dirty */ +@property (nonatomic,readwrite) BOOL dirty; + +/** returns the Z eye */ ++(float) getZEye; + +/** sets the camera in the defaul position */ +-(void) restore; +/** Sets the camera using gluLookAt using its eye, center and up_vector */ +-(void) locate; +/** sets the eye values in points */ +-(void) setEyeX: (float)x eyeY:(float)y eyeZ:(float)z; +/** sets the center values in points */ +-(void) setCenterX: (float)x centerY:(float)y centerZ:(float)z; +/** sets the up values */ +-(void) setUpX: (float)x upY:(float)y upZ:(float)z; + +/** get the eye vector values in points */ +-(void) eyeX:(float*)x eyeY:(float*)y eyeZ:(float*)z; +/** get the center vector values in points */ +-(void) centerX:(float*)x centerY:(float*)y centerZ:(float*)z; +/** get the up vector values */ +-(void) upX:(float*)x upY:(float*)y upZ:(float*)z; + + +@end diff --git a/cocos2d/CCClippingNode.h b/cocos2d/CCClippingNode.h new file mode 100644 index 0000000..f454901 --- /dev/null +++ b/cocos2d/CCClippingNode.h @@ -0,0 +1,77 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2012 Pierre-David Bélanger + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + */ + +#import "CCNode.h" + +/** CCClippingNode is a subclass of CCNode. + It draws its content (childs) clipped using a stencil. + The stencil is an other CCNode that will not be drawn. + The clipping is done using the alpha part of the stencil (adjusted with an alphaThreshold). + */ +@interface CCClippingNode : CCNode +{ + CCNode *_stencil; + GLfloat _alphaThreshold; + BOOL _inverted; +} + +/** The CCNode to use as a stencil to do the clipping. + The stencil node will be retained. + This default to nil. + */ +@property (nonatomic, strong) CCNode *stencil; + +/** The alpha threshold. + The content is drawn only where the stencil have pixel with alpha greater than the alphaThreshold. + Should be a float between 0 and 1. + This default to 1 (so alpha test is disabled). + */ +@property (nonatomic) GLfloat alphaThreshold; + +/** Inverted. If this is set to YES, + the stencil is inverted, so the content is drawn where the stencil is NOT drawn. + This default to NO. + */ +@property (nonatomic) BOOL inverted; + +/** Creates and initializes a clipping node without a stencil. + */ ++ (id)clippingNode; + +/** Creates and initializes a clipping node with an other node as its stencil. + The stencil node will be retained. + */ ++ (id)clippingNodeWithStencil:(CCNode *)stencil; + +/** Initializes a clipping node without a stencil. + */ +- (id)init; + +/** Initializes a clipping node with an other node as its stencil. + The stencil node will be retained, and its parent will be set to this clipping node. + */ +- (id)initWithStencil:(CCNode *)stencil; + +@end diff --git a/cocos2d/CCClippingNode.m b/cocos2d/CCClippingNode.m new file mode 100644 index 0000000..7445c85 --- /dev/null +++ b/cocos2d/CCClippingNode.m @@ -0,0 +1,352 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2012 Pierre-David Bélanger + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + */ + +#import "CCClippingNode.h" + +#import "CCGL.h" +#import "OpenGL_Internal.h" + +#import "CCGLProgram.h" +#import "CCShaderCache.h" + +#import "CCDirector.h" +#import "CCDrawingPrimitives.h" +#import "CGPointExtension.h" + +#import "kazmath/GL/matrix.h" + +static GLint _stencilBits = -1; + +static void setProgram(CCNode *n, CCGLProgram *p) { + n.shaderProgram = p; + if (!n.children) return; + for (CCNode* c in n.children) setProgram(c,p); +} + +@implementation CCClippingNode + +@synthesize stencil = _stencil; +@synthesize alphaThreshold = _alphaThreshold; +@synthesize inverted = _inverted; + + ++ (id)clippingNode +{ + return [self node]; +} + ++ (id)clippingNodeWithStencil:(CCNode *)stencil +{ + return [[self alloc] initWithStencil:stencil]; +} + +- (id)init +{ + return [self initWithStencil:nil]; +} + +- (id)initWithStencil:(CCNode *)stencil +{ + if ((self = [super init])) { + self.stencil = stencil; + self.alphaThreshold = 1; + self.inverted = NO; + // get (only once) the number of bits of the stencil buffer + static dispatch_once_t once; + dispatch_once(&once, ^{ + glGetIntegerv(GL_STENCIL_BITS, &_stencilBits); + // warn if the stencil buffer is not enabled + if (_stencilBits <= 0) { +#if defined(__CC_PLATFORM_IOS) + CCLOGWARN(@"Stencil buffer is not enabled; enable it by passing GL_DEPTH24_STENCIL8_OES into the depthFormat parrameter when initializing CCGLView. Until then, everything will be drawn without stencil."); +#elif defined(__CC_PLATFORM_MAC) + CCLOGWARN(@"Stencil buffer is not enabled; enable it by setting the Stencil attribue to 8 bit in the Attributes inspector of the CCGLView view object in MainMenu.xib, or programmatically by adding NSOpenGLPFAStencilSize and 8 in the NSOpenGLPixelFormatAttribute array of the NSOpenGLPixelFormat used when initializing CCGLView. Until then, everything will be drawn without stencil."); +#endif + } + }); + } + return self; +} + +- (void)onEnter +{ + [super onEnter]; + [_stencil onEnter]; +} + +- (void)onEnterTransitionDidFinish +{ + [super onEnterTransitionDidFinish]; + [_stencil onEnterTransitionDidFinish]; +} + +- (void)onExitTransitionDidStart +{ + [_stencil onExitTransitionDidStart]; + [super onExitTransitionDidStart]; +} + +- (void)onExit +{ + [_stencil onExit]; + [super onExit]; +} + +- (void)visit +{ + // if stencil buffer disabled + if (_stencilBits < 1) { + // draw everything, as if there where no stencil + [super visit]; + return; + } + + // return fast (draw nothing, or draw everything if in inverted mode) if: + // - nil stencil node + // - or stencil node invisible: + if (!_stencil || !_stencil.visible) { + if (_inverted) { + // draw everything + [super visit]; + } + return; + } + + // store the current stencil layer (position in the stencil buffer), + // this will allow nesting up to n CCClippingNode, + // where n is the number of bits of the stencil buffer. + static GLint layer = -1; + + // all the _stencilBits are in use? + if (layer + 1 == _stencilBits) { + // warn once + static dispatch_once_t once; + dispatch_once(&once, ^{ + CCLOGWARN(@"Nesting more than %d stencils is not supported. Everything will be drawn without stencil for this node and its childs.", _stencilBits); + }); + // draw everything, as if there where no stencil + [super visit]; + return; + } + + /////////////////////////////////// + // INIT + + // increment the current layer + layer++; + + // mask of the current layer (ie: for layer 3: 00000100) + GLint mask_layer = 0x1 << layer; + // mask of all layers less than the current (ie: for layer 3: 00000011) + GLint mask_layer_l = mask_layer - 1; + // mask of all layers less than or equal to the current (ie: for layer 3: 00000111) + GLint mask_layer_le = mask_layer | mask_layer_l; + + // manually save the stencil state + GLboolean currentStencilEnabled = GL_FALSE; + GLuint currentStencilWriteMask = ~0; + GLenum currentStencilFunc = GL_ALWAYS; + GLint currentStencilRef = 0; + GLuint currentStencilValueMask = ~0; + GLenum currentStencilFail = GL_KEEP; + GLenum currentStencilPassDepthFail = GL_KEEP; + GLenum currentStencilPassDepthPass = GL_KEEP; + currentStencilEnabled = glIsEnabled(GL_STENCIL_TEST); + glGetIntegerv(GL_STENCIL_WRITEMASK, (GLint *)¤tStencilWriteMask); + glGetIntegerv(GL_STENCIL_FUNC, (GLint *)¤tStencilFunc); + glGetIntegerv(GL_STENCIL_REF, ¤tStencilRef); + glGetIntegerv(GL_STENCIL_VALUE_MASK, (GLint *)¤tStencilValueMask); + glGetIntegerv(GL_STENCIL_FAIL, (GLint *)¤tStencilFail); + glGetIntegerv(GL_STENCIL_PASS_DEPTH_FAIL, (GLint *)¤tStencilPassDepthFail); + glGetIntegerv(GL_STENCIL_PASS_DEPTH_PASS, (GLint *)¤tStencilPassDepthPass); + + // enable stencil use + glEnable(GL_STENCIL_TEST); + // check for OpenGL error while enabling stencil test + CHECK_GL_ERROR_DEBUG(); + + // all bits on the stencil buffer are readonly, except the current layer bit, + // this means that operation like glClear or glStencilOp will be masked with this value + glStencilMask(mask_layer); + + // manually save the depth test state + //GLboolean currentDepthTestEnabled = GL_TRUE; + GLboolean currentDepthWriteMask = GL_TRUE; + //currentDepthTestEnabled = glIsEnabled(GL_DEPTH_TEST); + glGetBooleanv(GL_DEPTH_WRITEMASK, ¤tDepthWriteMask); + + // disable depth test while drawing the stencil + //glDisable(GL_DEPTH_TEST); + // disable update to the depth buffer while drawing the stencil, + // as the stencil is not meant to be rendered in the real scene, + // it should never prevent something else to be drawn, + // only disabling depth buffer update should do + glDepthMask(GL_FALSE); + + /////////////////////////////////// + // CLEAR STENCIL BUFFER + + // setup the stencil test func like this: + // for each pixel in the stencil buffer + // never draw it into the frame buffer + // if not in inverted mode: set the current layer value to 0 in the stencil buffer + // if in inverted mode: set the current layer value to 1 in the stencil buffer +#if defined(__CC_PLATFORM_MAC) + // There is a bug in some ATI drivers where glStencilMask does not affect glClear. + // Draw a full screen rectangle to clear the stencil buffer. + glStencilFunc(GL_NEVER, mask_layer, mask_layer); + glStencilOp(!_inverted ? GL_ZERO : GL_REPLACE, GL_KEEP, GL_KEEP); + + int viewport[4]; + glGetIntegerv(GL_VIEWPORT, viewport); + + int x = viewport[0]; + int y = viewport[1]; + int width = viewport[2]; + int height = viewport[3]; + + kmGLMatrixMode(KM_GL_PROJECTION); + kmGLPushMatrix(); + kmGLLoadIdentity(); + + kmMat4 orthoMatrix; + kmMat4OrthographicProjection(&orthoMatrix, x, width, y, height, -1, 1); + kmGLMultMatrix( &orthoMatrix ); + + kmGLMatrixMode(KM_GL_MODELVIEW); + kmGLPushMatrix(); + kmGLLoadIdentity(); + + ccDrawSolidRect(ccp(x, y), ccp(width, height), ccc4f(1, 1, 1, 1)); + + kmGLMatrixMode(KM_GL_PROJECTION); + kmGLPopMatrix(); + kmGLMatrixMode(KM_GL_MODELVIEW); + kmGLPopMatrix(); +#else + glClearStencil(!_inverted ? 0 : ~0); + glClear(GL_STENCIL_BUFFER_BIT); +#endif + + /////////////////////////////////// + // DRAW CLIPPING STENCIL + + // setup the stencil test func like this: + // for each pixel in the stencil node + // never draw it into the frame buffer + // if not in inverted mode: set the current layer value to 1 in the stencil buffer + // if in inverted mode: set the current layer value to 0 in the stencil buffer + glStencilFunc(GL_NEVER, mask_layer, mask_layer); + glStencilOp(!_inverted ? GL_REPLACE : GL_ZERO, GL_KEEP, GL_KEEP); + + // enable alpha test only if the alpha threshold < 1, + // indeed if alpha threshold == 1, every pixel will be drawn anyways +#if defined(__CC_PLATFORM_MAC) + GLboolean currentAlphaTestEnabled = GL_FALSE; + GLenum currentAlphaTestFunc = GL_ALWAYS; + GLclampf currentAlphaTestRef = 1; +#endif + if (_alphaThreshold < 1) { +#if defined(__CC_PLATFORM_IOS) + // since glAlphaTest do not exists in OES, use a shader that writes + // pixel only if greater than an alpha threshold + CCGLProgram *program = [[CCShaderCache sharedShaderCache] programForKey:kCCShader_PositionTextureColorAlphaTest]; + GLint alphaValueLocation = glGetUniformLocation(program.program, kCCUniformAlphaTestValue_s); + // set our alphaThreshold + [program setUniformLocation:alphaValueLocation withF1:_alphaThreshold]; + // we need to recursively apply this shader to all the nodes in the stencil node + // XXX: we should have a way to apply shader to all nodes without having to do this + setProgram(_stencil, program); +#elif defined(__CC_PLATFORM_MAC) + // manually save the alpha test state + currentAlphaTestEnabled = glIsEnabled(GL_ALPHA_TEST); + glGetIntegerv(GL_ALPHA_TEST_FUNC, (GLint *)¤tAlphaTestFunc); + glGetFloatv(GL_ALPHA_TEST_REF, ¤tAlphaTestRef); + // enable alpha testing + glEnable(GL_ALPHA_TEST); + // check for OpenGL error while enabling alpha test + CHECK_GL_ERROR_DEBUG(); + // pixel will be drawn only if greater than an alpha threshold + glAlphaFunc(GL_GREATER, _alphaThreshold); +#endif + } + + // draw the stencil node as if it was one of our child + // (according to the stencil test func/op and alpha (or alpha shader) test) + kmGLPushMatrix(); + [self transform]; + [_stencil visit]; + kmGLPopMatrix(); + + // restore alpha test state + if (_alphaThreshold < 1) { +#if defined(__CC_PLATFORM_IOS) + // XXX: we need to find a way to restore the shaders of the stencil node and its childs +#elif defined(__CC_PLATFORM_MAC) + // manually restore the alpha test state + glAlphaFunc(currentAlphaTestFunc, currentAlphaTestRef); + if (!currentAlphaTestEnabled) { + glDisable(GL_ALPHA_TEST); + } +#endif + } + + // restore the depth test state + glDepthMask(currentDepthWriteMask); + //if (currentDepthTestEnabled) { + // glEnable(GL_DEPTH_TEST); + //} + + /////////////////////////////////// + // DRAW CONTENT + + // setup the stencil test func like this: + // for each pixel of this node and its childs + // if all layers less than or equals to the current are set to 1 in the stencil buffer + // draw the pixel and keep the current layer in the stencil buffer + // else + // do not draw the pixel but keep the current layer in the stencil buffer + glStencilFunc(GL_EQUAL, mask_layer_le, mask_layer_le); + glStencilOp(GL_KEEP, GL_KEEP, GL_KEEP); + + // draw (according to the stencil test func) this node and its childs + [super visit]; + + /////////////////////////////////// + // CLEANUP + + // manually restore the stencil state + glStencilFunc(currentStencilFunc, currentStencilRef, currentStencilValueMask); + glStencilOp(currentStencilFail, currentStencilPassDepthFail, currentStencilPassDepthPass); + glStencilMask(currentStencilWriteMask); + if (!currentStencilEnabled) { + glDisable(GL_STENCIL_TEST); + } + + // we are done using this layer, decrement + layer--; +} + +@end diff --git a/cocos2d/CCConfiguration.h b/cocos2d/CCConfiguration.h new file mode 100644 index 0000000..5ca15c0 --- /dev/null +++ b/cocos2d/CCConfiguration.h @@ -0,0 +1,144 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2010 Ricardo Quesada + * Copyright (c) 2011 Zynga Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#import + +#import "Platforms/CCGL.h" + +/** OS version definitions. Includes both iOS and Mac OS versions + */ +enum { + kCCiOSVersion_4_0 = 0x04000000, + kCCiOSVersion_4_0_1 = 0x04000100, + kCCiOSVersion_4_1 = 0x04010000, + kCCiOSVersion_4_2 = 0x04020000, + kCCiOSVersion_4_2_1 = 0x04020100, + kCCiOSVersion_4_3 = 0x04030000, + kCCiOSVersion_4_3_1 = 0x04030100, + kCCiOSVersion_4_3_2 = 0x04030200, + kCCiOSVersion_4_3_3 = 0x04030300, + kCCiOSVersion_4_3_4 = 0x04030400, + kCCiOSVersion_4_3_5 = 0x04030500, + kCCiOSVersion_5_0 = 0x05000000, + kCCiOSVersion_5_0_1 = 0x05000100, + kCCiOSVersion_5_1_0 = 0x05010000, + kCCiOSVersion_6_0_0 = 0x06000000, + + kCCMacVersion_10_6 = 0x0a060000, + kCCMacVersion_10_7 = 0x0a070000, + kCCMacVersion_10_8 = 0x0a080000, +}; + +enum { + kCCDeviceiPhone, + kCCDeviceiPhoneRetinaDisplay, + kCCDeviceiPhone5, + kCCDeviceiPhone5RetinaDisplay, + kCCDeviceiPad, + kCCDeviceiPadRetinaDisplay, + + kCCDeviceMac, + kCCDeviceMacRetinaDisplay, +}; + +/** + CCConfiguration contains some openGL variables + @since v0.99.0 + */ +@interface CCConfiguration : NSObject { + + BOOL _openGLInitialized; + + GLint _maxTextureSize; + BOOL _supportsPVRTC; + BOOL _supportsNPOT; + BOOL _supportsBGRA8888; + BOOL _supportsDiscardFramebuffer; + BOOL _supportsShareableVAO; + GLint _maxSamplesAllowed; + GLint _maxTextureUnits; + + unsigned int _OSVersion; +} + +/** OpenGL Max texture size. */ +@property (nonatomic, readonly) GLint maxTextureSize; + +/** returns the maximum texture units + @since v2.0.0 + */ +@property (nonatomic, readonly) GLint maxTextureUnits; + +/** Whether or not the GPU supports NPOT (Non Power Of Two) textures. + OpenGL ES 2.0 already supports NPOT (iOS). + + @since v0.99.2 + */ +@property (nonatomic, readonly) BOOL supportsNPOT; + +/** Whether or not PVR Texture Compressed is supported */ +@property (nonatomic, readonly) BOOL supportsPVRTC; + +/** Whether or not BGRA8888 textures are supported. + + @since v0.99.2 + */ +@property (nonatomic, readonly) BOOL supportsBGRA8888; + +/** Whether or not glDiscardFramebufferEXT is supported + + @since v0.99.2 + */ +@property (nonatomic, readonly) BOOL supportsDiscardFramebuffer; + +/** Whether or not shareable VAOs are supported. + @since v2.0.0 + */ +@property (nonatomic, readonly) BOOL supportsShareableVAO; + +/** returns the OS version. + - On iOS devices it returns the firmware version. + - On Mac returns the OS version + + @since v0.99.5 + */ +@property (nonatomic, readonly) unsigned int OSVersion; + + +/** returns a shared instance of the CCConfiguration */ ++(CCConfiguration *) sharedConfiguration; + +/** returns whether or not an OpenGL is supported */ +- (BOOL) checkForGLExtension:(NSString *)searchName; + +/** returns the current device */ +-(NSInteger) runningDevice; + +/** dumps in the console the CCConfiguration information. + @since v2.1 + */ +-(void) dumpInfo; + +@end diff --git a/cocos2d/CCConfiguration.m b/cocos2d/CCConfiguration.m new file mode 100644 index 0000000..84cdca1 --- /dev/null +++ b/cocos2d/CCConfiguration.m @@ -0,0 +1,318 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2010 Ricardo Quesada + * Copyright (c) 2011 Zynga Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#import "ccMacros.h" + +#ifdef __CC_PLATFORM_IOS +#import // Needed for UIDevice +#endif + +#import "Platforms/CCGL.h" +#import "CCConfiguration.h" +#import "ccMacros.h" +#import "ccConfig.h" +#import "Support/OpenGL_Internal.h" +#import "cocos2d.h" + +@interface CCConfiguration () +-(void) getOpenGLvariables; +@end + +@implementation CCConfiguration + +@synthesize maxTextureSize = _maxTextureSize, maxTextureUnits=_maxTextureUnits; +@synthesize supportsPVRTC = _supportsPVRTC; +@synthesize supportsNPOT = _supportsNPOT; +@synthesize supportsBGRA8888 = _supportsBGRA8888; +@synthesize supportsDiscardFramebuffer = _supportsDiscardFramebuffer; +@synthesize supportsShareableVAO = _supportsShareableVAO; +@synthesize OSVersion = _OSVersion; + +// +// singleton stuff +// +static CCConfiguration *_sharedConfiguration = nil; + +static char * glExtensions; + ++ (CCConfiguration *)sharedConfiguration +{ + if (!_sharedConfiguration) + _sharedConfiguration = [[self alloc] init]; + + return _sharedConfiguration; +} + ++(id)alloc +{ + NSAssert(_sharedConfiguration == nil, @"Attempted to allocate a second instance of a singleton."); + return [super alloc]; +} + + +#ifdef __CC_PLATFORM_IOS +#elif defined(__CC_PLATFORM_MAC) +- (NSString*)getMacVersion +{ + SInt32 versionMajor, versionMinor, versionBugFix; + Gestalt(gestaltSystemVersionMajor, &versionMajor); + Gestalt(gestaltSystemVersionMinor, &versionMinor); + Gestalt(gestaltSystemVersionBugFix, &versionBugFix); + + return [NSString stringWithFormat:@"%d.%d.%d", versionMajor, versionMinor, versionBugFix]; +} +#endif // __CC_PLATFORM_MAC + +-(id) init +{ + if( (self=[super init])) { + + // Obtain iOS version + _OSVersion = 0; +#ifdef __CC_PLATFORM_IOS + NSString *OSVer = [[UIDevice currentDevice] systemVersion]; +#elif defined(__CC_PLATFORM_MAC) + NSString *OSVer = [self getMacVersion]; +#endif + NSArray *arr = [OSVer componentsSeparatedByString:@"."]; + int idx = 0x01000000; + for( NSString *str in arr ) { + int value = [str intValue]; + _OSVersion += value * idx; + idx = idx >> 8; + } + } + +#if CC_ENABLE_GL_STATE_CACHE == 0 + printf("\n"); + NSLog(@"cocos2d: **** WARNING **** CC_ENABLE_GL_STATE_CACHE is disabled. To improve performance, enable it by editing ccConfig.h"); + printf("\n"); +#endif + + CHECK_GL_ERROR_DEBUG(); + + return self; +} + +- (BOOL) checkForGLExtension:(NSString *)searchName +{ + // For best results, extensionsNames should be stored in your renderer so that it does not + // need to be recreated on each invocation. + NSString *extensionsString = [NSString stringWithCString:glExtensions encoding: NSASCIIStringEncoding]; + NSArray *extensionsNames = [extensionsString componentsSeparatedByString:@" "]; + return [extensionsNames containsObject: searchName]; +} + +// XXX: Optimization: This should be called only once +#pragma clang diagnostic push COCOS2D +#pragma clang diagnostic ignored "-Wfloat-equal" +-(NSInteger) runningDevice +{ + NSInteger ret=-1; + +#ifdef __CC_PLATFORM_IOS + + if( UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) + { + ret = (CC_CONTENT_SCALE_FACTOR() == 2) ? kCCDeviceiPadRetinaDisplay : kCCDeviceiPad; + } + else if( UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone ) + { + // From http://stackoverflow.com/a/12535566 + BOOL isiPhone5 = CGSizeEqualToSize([[UIScreen mainScreen] preferredMode].size,CGSizeMake(640, 1136)); + + if( CC_CONTENT_SCALE_FACTOR() == 2 ) { + ret = isiPhone5 ? kCCDeviceiPhone5RetinaDisplay : kCCDeviceiPhoneRetinaDisplay; + } else + ret = isiPhone5 ? kCCDeviceiPhone5 : kCCDeviceiPhone; + } + +#elif defined(__CC_PLATFORM_MAC) + + // XXX: Add here support for Mac Retina Display + ret = kCCDeviceMac; + +#endif // __CC_PLATFORM_MAC + + return ret; +} +#pragma clang diagnostic pop COCOS2D + +#pragma mark OpenGL getters + +/** OpenGL Max texture size. */ + +-(void) getOpenGLvariables +{ + if( ! _openGLInitialized ) { + + glExtensions = (char*) glGetString(GL_EXTENSIONS); + + NSAssert( glExtensions, @"OpenGL not initialized!"); + +#ifdef __CC_PLATFORM_IOS + if( _OSVersion >= kCCiOSVersion_4_0 ) + glGetIntegerv(GL_MAX_SAMPLES_APPLE, &_maxSamplesAllowed); + else + _maxSamplesAllowed = 0; +#elif defined(__CC_PLATFORM_MAC) + glGetIntegerv(GL_MAX_SAMPLES, &_maxSamplesAllowed); +#endif + + glGetIntegerv(GL_MAX_TEXTURE_SIZE, &_maxTextureSize); + glGetIntegerv(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, &_maxTextureUnits ); + +#ifdef __CC_PLATFORM_IOS + _supportsNPOT = YES; +#elif defined(__CC_PLATFORM_MAC) + _supportsNPOT = [self checkForGLExtension:@"GL_ARB_texture_non_power_of_two"]; +#endif + + _supportsPVRTC = [self checkForGLExtension:@"GL_IMG_texture_compression_pvrtc"]; + + // It seems that somewhere between firmware iOS 3.0 and 4.2 Apple renamed + // GL_IMG_... to GL_APPLE.... So we should check both names +#ifdef __CC_PLATFORM_IOS + BOOL bgra8a = [self checkForGLExtension:@"GL_IMG_texture_format_BGRA8888"]; + BOOL bgra8b = [self checkForGLExtension:@"GL_APPLE_texture_format_BGRA8888"]; + _supportsBGRA8888 = bgra8a | bgra8b; +#elif defined(__CC_PLATFORM_MAC) + _supportsBGRA8888 = [self checkForGLExtension:@"GL_EXT_bgra"]; +#endif + _supportsDiscardFramebuffer = [self checkForGLExtension:@"GL_EXT_discard_framebuffer"]; + + _supportsShareableVAO = [self checkForGLExtension:@"GL_APPLE_vertex_array_object"]; + + _openGLInitialized = YES; + } +} + +-(GLint) maxTextureSize +{ + if( ! _openGLInitialized ) + [self getOpenGLvariables]; + return _maxTextureSize; +} + +-(GLint) maxTextureUnits +{ + if( ! _openGLInitialized ) + [self getOpenGLvariables]; + + return _maxTextureUnits; +} + +-(BOOL) supportsNPOT +{ + if( ! _openGLInitialized ) + [self getOpenGLvariables]; + + return _supportsNPOT; +} + +-(BOOL) supportsPVRTC +{ + if( ! _openGLInitialized ) + [self getOpenGLvariables]; + + return _supportsPVRTC; +} + +-(BOOL) supportsBGRA8888 +{ + if( ! _openGLInitialized ) + [self getOpenGLvariables]; + + return _supportsBGRA8888; +} + +-(BOOL) supportsDiscardFramebuffer +{ + if( ! _openGLInitialized ) + [self getOpenGLvariables]; + + return _supportsDiscardFramebuffer; +} + +-(BOOL) supportsShareableVAO +{ + if( ! _openGLInitialized ) + [self getOpenGLvariables]; + + return _supportsShareableVAO; +} + + +#pragma mark Helper + +-(void) dumpInfo +{ +#if DEBUG + printf("cocos2d: %s\n", cocos2d_version ); + +#ifdef __CC_PLATFORM_IOS + NSString *OSVer = [[UIDevice currentDevice] systemVersion]; +#elif defined(__CC_PLATFORM_MAC) + NSString *OSVer = [self getMacVersion]; +#endif + +#ifdef __CC_PLATFORM_MAC + printf("cocos2d: Director's thread: %s\n", +#if (CC_DIRECTOR_MAC_THREAD == CC_MAC_USE_MAIN_THREAD) + "Main thread" +#elif (CC_DIRECTOR_MAC_THREAD == CC_MAC_USE_OWN_THREAD) + "Own thread" +#elif (CC_DIRECTOR_MAC_THREAD == CC_MAC_USE_DISPLAY_LINK_THREAD) + "DisplayLink thread" +#endif // + ); +#endif // Mac + + printf("cocos2d: compiled with Profiling Support: %s\n", +#if CC_ENABLE_PROFILERS + "YES - *** Disable it when you finish profiling ***" +#else + "NO" +#endif + ); + + printf("cocos2d: OS version: %s (0x%08x)\n", [OSVer UTF8String], _OSVersion); + + printf("cocos2d: GL_VENDOR: %s\n", glGetString(GL_VENDOR) ); + printf("cocos2d: GL_RENDERER: %s\n", glGetString ( GL_RENDERER ) ); + printf("cocos2d: GL_VERSION: %s\n", glGetString ( GL_VERSION ) ); + + printf("cocos2d: GL_MAX_TEXTURE_SIZE: %d\n", _maxTextureSize); + printf("cocos2d: GL_MAX_TEXTURE_UNITS: %d\n", _maxTextureUnits); + printf("cocos2d: GL_MAX_SAMPLES: %d\n", _maxSamplesAllowed); + printf("cocos2d: GL supports PVRTC: %s\n", (_supportsPVRTC ? "YES" : "NO") ); + printf("cocos2d: GL supports BGRA8888 textures: %s\n", (_supportsBGRA8888 ? "YES" : "NO") ); + printf("cocos2d: GL supports NPOT textures: %s\n", (_supportsNPOT ? "YES" : "NO") ); + printf("cocos2d: GL supports discard_framebuffer: %s\n", (_supportsDiscardFramebuffer ? "YES" : "NO") ); + printf("cocos2d: GL supports shareable VAO: %s\n", (_supportsShareableVAO ? "YES" : "NO") ); + +#endif // DEBUG +} +@end diff --git a/cocos2d/CCDirector.h b/cocos2d/CCDirector.h new file mode 100644 index 0000000..df5b35b --- /dev/null +++ b/cocos2d/CCDirector.h @@ -0,0 +1,405 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2008-2010 Ricardo Quesada + * Copyright (c) 2011 Zynga Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + + +#import "ccConfig.h" +#import "ccTypes.h" +#import "ccMacros.h" + +#import "CCProtocols.h" +#import "Platforms/CCGL.h" + +#pragma clang diagnostic push COCOS2D +#pragma clang diagnostic ignored "-Wignored-qualifiers" +#import "kazmath/mat4.h" +#pragma clang diagnostic pop COCOS2D + +#import "CCResponderManager.h" + +/** @typedef ccDirectorProjection + Possible OpenGL projections used by director + */ +typedef enum { + /// sets a 2D projection (orthogonal projection). + kCCDirectorProjection2D, + + /// sets a 3D projection with a fovy=60, znear=0.5f and zfar=1500. + kCCDirectorProjection3D, + + /// it calls "updateProjection" on the projection delegate. + kCCDirectorProjectionCustom, + + /// Detault projection is 3D projection + kCCDirectorProjectionDefault = kCCDirectorProjection3D, + +} ccDirectorProjection; + + +@class CCLabelAtlas; +@class CCScene; +@class CCScheduler; +@class CCActionManager; +@class CCTransition; + +#ifdef __CC_PLATFORM_IOS +#define CC_VIEWCONTROLLER UIViewController +#elif defined(__CC_PLATFORM_MAC) +#define CC_VIEWCONTROLLER NSObject +#endif + +/**Class that creates and handle the main Window and manages how +and when to execute the Scenes. + + The CCDirector is also responsible for: + - initializing the OpenGL ES context + - setting the OpenGL pixel format (default on is RGB565) + - setting the OpenGL buffer depth (default one is 0-bit) + - setting the projection (default one is 3D) + + Since the CCDirector is a singleton, the standard way to use it is by calling: + - [[CCDirector sharedDirector] methodName]; + + The CCDirector also sets the default OpenGL context: + - GL_TEXTURE_2D is enabled + - GL_VERTEX_ARRAY is enabled + - GL_COLOR_ARRAY is enabled + - GL_TEXTURE_COORD_ARRAY is enabled +*/ +@interface CCDirector : CC_VIEWCONTROLLER +{ + // internal timer + NSTimeInterval _animationInterval; + NSTimeInterval _oldAnimationInterval; + + /* stats */ + BOOL _displayStats; + + NSUInteger _frames; + NSUInteger _totalFrames; + ccTime _secondsPerFrame; + + ccTime _accumDt; + ccTime _frameRate; + CCLabelAtlas *_FPSLabel; + CCLabelAtlas *_SPFLabel; + CCLabelAtlas *_drawsLabel; + + /* is the running scene paused */ + BOOL _isPaused; + + /* Is the director running */ + BOOL _isAnimating; + + /* The running scene */ + CCScene *_runningScene; + + /* This object will be visited after the scene. Useful to hook a notification node */ + id _notificationNode; + + /* will be the next 'runningScene' in the next frame + nextScene is a weak reference. */ + CCScene *_nextScene; + + /* If YES, then "old" scene will receive the cleanup message */ + BOOL _sendCleanupToScene; + + /* scheduled scenes */ + NSMutableArray *_scenesStack; + + /* last time the main loop was updated */ + struct timeval _lastUpdate; + /* delta time since last tick to main loop */ + ccTime _dt; + /* whether or not the next delta time will be zero */ + BOOL _nextDeltaTimeZero; + + /* projection used */ + ccDirectorProjection _projection; + + /* CCDirector delegate */ + id __unsafe_unretained _delegate; + + /* window size in points */ + CGSize _winSizeInPoints; + + /* window size in pixels */ + CGSize _winSizeInPixels; + + /* the cocos2d running thread */ + NSThread *__unsafe_unretained _runningThread; + + /* scheduler associated with this director */ + CCScheduler *_scheduler; + + /* action manager associated with this director */ + CCActionManager *_actionManager; + + /* OpenGLView. On iOS it is a copy of self.view */ + CCGLView *__view; +} + +/** returns the cocos2d thread. + If you want to run any cocos2d task, run it in this thread. + On iOS usually it is the main thread. + @since v0.99.5 + */ +@property (readonly, nonatomic ) NSThread *runningThread; +/** The current running Scene. Director can only run one Scene at the time */ +@property (nonatomic,readonly) CCScene* runningScene; +/** The FPS value */ +@property (nonatomic,readwrite, assign) NSTimeInterval animationInterval; +/** Whether or not to display director statistics */ +@property (nonatomic, readwrite, assign) BOOL displayStats; +/** whether or not the next delta time will be zero */ +@property (nonatomic,readwrite,assign) BOOL nextDeltaTimeZero; +/** Whether or not the Director is paused */ +@property (nonatomic,readonly,getter=isPaused) BOOL paused; +/** Whether or not the Director is active (animating) */ +@property (nonatomic,readonly) BOOL isAnimating; +/** Sets an OpenGL projection */ +@property (nonatomic,readwrite) ccDirectorProjection projection; +/** How many frames were called since the director started */ +@property (nonatomic,readonly) NSUInteger totalFrames; +/** seconds per frame */ +@property (nonatomic, readonly) ccTime secondsPerFrame; + +/** Sets the touch manager + @since v2.5 + */ +@property ( nonatomic, strong ) CCResponderManager* responderManager; + + +/** Whether or not the replaced scene will receive the cleanup message. + If the new scene is pushed, then the old scene won't receive the "cleanup" message. + If the new scene replaces the old one, the it will receive the "cleanup" message. + @since v0.99.0 + */ +@property (nonatomic, readonly) BOOL sendCleanupToScene; + +/** This object will be visited after the main scene is visited. + This object MUST implement the "visit" selector. + Useful to hook a notification object, like CCNotifications (http://github.com/manucorporat/CCNotifications) + @since v0.99.5 + */ +@property (nonatomic, readwrite, strong) id notificationNode; + +/** CCDirector delegate. It shall implement the CCDirectorDelegate protocol + @since v0.99.5 + */ +@property (nonatomic, readwrite, unsafe_unretained) id delegate; + +/** CCScheduler associated with this director + @since v2.0 + */ +@property (nonatomic,readwrite,strong) CCScheduler *scheduler; + +/** CCActionManager associated with this director + @since v2.0 + */ +@property (nonatomic,readwrite,strong) CCActionManager *actionManager; + +/** Position scaling factor, default is 2 for tablets and 1 for phones. Positions and content sizes are scale by this factor if the position type is set to scale. + @since v2.5 + */ +@property (nonatomic,readwrite,assign) float positionScaleFactor; + +/** returns a shared instance of the director */ ++(CCDirector*)sharedDirector; + + +#pragma mark Director - Stats + +#pragma mark Director - Win Size +/** returns the size of the OpenGL view in points */ +- (CGSize) winSize; + +/** returns the size of the OpenGL view in pixels. + On Mac winSize and winSizeInPixels return the same value. + */ +- (CGSize) winSizeInPixels; + +/** changes the projection size */ +-(void) reshapeProjection:(CGSize)newWindowSize; + +/** Sets the glViewport*/ +-(void) setViewport; + +/** converts a UIKit coordinate to an OpenGL coordinate + Useful to convert (multi) touch coordinates to the current layout (portrait or landscape) + */ +-(CGPoint) convertToGL: (CGPoint) p; +/** converts an OpenGL coordinate to a UIKit coordinate + Useful to convert node points to window points for calls such as glScissor + */ +-(CGPoint) convertToUI:(CGPoint)p; + +/// XXX: missing description +-(float) getZEye; + +#pragma mark Director - Scene Management + +/** Enters the Director's main loop with the given Scene. + * Call it to run only your FIRST scene. + * Don't call it if there is already a running scene. + * + * It will call pushScene: and then it will call startAnimation + */ +- (void) runWithScene:(CCScene*) scene; + +/** Suspends the execution of the running scene, pushing it on the stack of suspended scenes. + * The new scene will be executed. + * Try to avoid big stacks of pushed scenes to reduce memory allocation. + * ONLY call it if there is a running scene. + */ +- (void) pushScene:(CCScene*) scene; + +/** Pops out a scene from the queue. + * This scene will replace the running one. + * The running scene will be deleted. If there are no more scenes in the stack the execution is terminated. + * ONLY call it if there is a running scene. + */ +- (void) popScene; + +/**Pops out all scenes from the queue until the root scene in the queue. + * This scene will replace the running one. + * Internally it will call `popToSceneStackLevel:1` + */ +- (void) popToRootScene; + +/** Pops out all scenes from the queue until it reaches `level`. + If level is 0, it will end the director. + If level is 1, it will pop all scenes until it reaches to root scene. + If level is <= than the current stack level, it won't do anything. + */ +-(void) popToSceneStackLevel:(NSUInteger)level; + +/** Replaces the running scene with a new one. The running scene is terminated. + * ONLY call it if there is a running scene. + */ +-(void) replaceScene: (CCScene*) scene; + +/** + * Presents a new scene by either starting first scene, or replacing the running + * + * @param scene The scene to present + * @since v2.5 + */ +//- (void)presentScene:(CCScene *)scene; + +/** + * Presents a new scene by either starting first scene, or replacing the running + * Performs a transition between the outgoing and the incoming scene + * + * @param scene The incoming scene + * @param transition The transition to perform + * @since v2.5 + */ +- (void)replaceScene:(CCScene *)scene withTransition:(CCTransition *)transition; + +/** + * Pushes the running scene onto the scene stack, and presents the incoming scene, using a transition + * + * @param scene The scene to present + * @param transition The transition to use + * @since v2.5 + */ +- (void)pushScene:(CCScene *)scene withTransition:(CCTransition *)transition; + +/** + * Replaces the running scene, with the last scene pushed to the stack, using a transition + * + * @param transition The transition to use + * @since v2.5 + */ +- (void)popScenewithTransition:(CCTransition *)transition; + +/** Ends the execution, releases the running scene. + It doesn't remove the OpenGL view from its parent. You have to do it manually. + */ +-(void) end; + +/** Pauses the running scene. + The running scene will be _drawed_ but all scheduled timers will be paused + While paused, the draw rate will be 4 FPS to reduce CPU consumption + */ +-(void) pause; + +/** Resumes the paused scene + The scheduled timers will be activated again. + The "delta time" will be 0 (as if the game wasn't paused) + */ +-(void) resume; + +/** Stops the animation. Nothing will be drawn. The main loop won't be triggered anymore. + If you want to pause your animation call [pause] instead. + */ +-(void) stopAnimation; + +/** The main loop is triggered again. + Call this function only if [stopAnimation] was called earlier + @warning Don't call this function to start the main loop. To run the main loop call runWithScene + */ +-(void) startAnimation; + +/** Draw the scene. + This method is called every frame. Don't call it manually. + */ +-(void) drawScene; + + +// XXX: Hack. Should be placed on CCDirectorMac.h. Refactoring needed +#if defined(__CC_PLATFORM_MAC) +/** sets the openGL view */ +-(void) setView:(CCGLView*)view; + +/** returns the OpenGL view */ +-(CCGLView*) view; +#endif + +#pragma mark Director - Memory Helper + +/** Removes all the cocos2d data that was cached automatically. + It will purge the CCTextureCache, CCLabelBMFont cache. + IMPORTANT: The CCSpriteFrameCache won't be purged. If you want to purge it, you have to purge it manually. + @since v0.99.3 + */ +-(void) purgeCachedData; + +// OpenGL Helper + +/** sets the OpenGL default values */ +-(void) setGLDefaultValues; +/** enables/disables OpenGL alpha blending */ +- (void) setAlphaBlending: (BOOL) on; +/** enables/disables OpenGL depth test */ +- (void) setDepthTest: (BOOL) on; + +// helper +/** creates the Stats labels */ +-(void) createStatsLabel; +@end + +// optimization. Should only be used to read it. Never to write it. +extern NSUInteger __ccNumberOfDraws; diff --git a/cocos2d/CCDirector.m b/cocos2d/CCDirector.m new file mode 100644 index 0000000..ca114ef --- /dev/null +++ b/cocos2d/CCDirector.m @@ -0,0 +1,754 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2008-2010 Ricardo Quesada + * Copyright (c) 2011 Zynga Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + + +/* Idea of decoupling Window from Director taken from OC3D project: http://code.google.com/p/oc3d/ + */ + +#import + +// cocos2d imports +#import "CCDirector.h" +#import "CCScheduler.h" +#import "CCActionManager.h" +#import "CCTextureCache.h" +#import "CCAnimationCache.h" +#import "CCLabelAtlas.h" +#import "ccMacros.h" +#import "CCScene.h" +#import "CCSpriteFrameCache.h" +#import "CCTexture2D.h" +#import "CCLabelBMFont.h" +#import "CCLayer.h" +#import "ccGLStateCache.h" +#import "CCShaderCache.h" +#import "ccFPSImages.h" +#import "CCDrawingPrimitives.h" +#import "CCConfiguration.h" +#import "CCTransition.h" + +// support imports +#import "Platforms/CCGL.h" +#import "Platforms/CCNS.h" + +#import "Support/OpenGL_Internal.h" +#import "Support/CGPointExtension.h" +#import "Support/CCProfiling.h" +#import "Support/CCFileUtils.h" + +#ifdef __CC_PLATFORM_IOS +#import "Platforms/iOS/CCDirectorIOS.h" +#define CC_DIRECTOR_DEFAULT CCDirectorDisplayLink +#elif defined(__CC_PLATFORM_MAC) +#import "Platforms/Mac/CCDirectorMac.h" +#define CC_DIRECTOR_DEFAULT CCDirectorDisplayLink +#endif + + +#pragma mark - +#pragma mark Director - global variables (optimization) + +// XXX it shoul be a Director ivar. Move it there once support for multiple directors is added +NSUInteger __ccNumberOfDraws = 0; + +#define kDefaultFPS 60.0 // 60 frames per second + +extern NSString * cocos2dVersion(void); + +@interface CCDirector (Private) + +@property (readwrite, unsafe_unretained, nonatomic ) NSThread *runningThread; +-(void) setNextScene; +// shows the statistics +-(void) showStats; +// calculates delta time since last time it was called +-(void) calculateDeltaTime; +// calculates the milliseconds per frame from the start of the frame +-(void) calculateMPF; +// returns the FPS image data pointer and len +-(void)getFPSImageData:(unsigned char**)datapointer length:(NSUInteger*)len; +@end + +@implementation CCDirector + +@synthesize animationInterval = _animationInterval; +@synthesize runningScene = _runningScene; +@synthesize displayStats = _displayStats; +@synthesize nextDeltaTimeZero = _nextDeltaTimeZero; +@synthesize paused = _isPaused; +@synthesize isAnimating = _isAnimating; +@synthesize sendCleanupToScene = _sendCleanupToScene; +@synthesize runningThread = _runningThread; +@synthesize notificationNode = _notificationNode; +@synthesize delegate = _delegate; +@synthesize totalFrames = _totalFrames; +@synthesize secondsPerFrame = _secondsPerFrame; +@synthesize scheduler = _scheduler; +@synthesize actionManager = _actionManager; + +// +// singleton stuff +// +static CCDirector *_sharedDirector = nil; + ++ (CCDirector *)sharedDirector +{ + if (!_sharedDirector) { + + // + // Default Director is DisplayLink + // + if( [ [CCDirector class] isEqual:[self class]] ) + _sharedDirector = [[CC_DIRECTOR_DEFAULT alloc] init]; + else + _sharedDirector = [[self alloc] init]; + } + + return _sharedDirector; +} + ++(id)alloc +{ + NSAssert(_sharedDirector == nil, @"Attempted to allocate a second instance of a singleton."); + return [super alloc]; +} + +- (id) init +{ + if( (self=[super init] ) ) { + + // scenes + _runningScene = nil; + _nextScene = nil; + + _notificationNode = nil; + + _oldAnimationInterval = _animationInterval = 1.0 / kDefaultFPS; + _scenesStack = [[NSMutableArray alloc] initWithCapacity:10]; + + // Set default projection (3D) + _projection = kCCDirectorProjectionDefault; + + // projection delegate if "Custom" projection is used + _delegate = nil; + + // FPS + _displayStats = NO; + _totalFrames = _frames = 0; + + // paused ? + _isPaused = NO; + + // running thread + _runningThread = nil; + + // scheduler + _scheduler = [[CCScheduler alloc] init]; + + // action manager + _actionManager = [[CCActionManager alloc] init]; + [_scheduler scheduleUpdateForTarget:_actionManager priority:kCCPrioritySystem paused:NO]; + + // touch manager + _responderManager = [ CCResponderManager responderManager ]; + + _winSizeInPixels = _winSizeInPoints = CGSizeZero; + + } + + return self; +} + +- (NSString*) description +{ + return [NSString stringWithFormat:@"<%@ = %p | Size: %0.f x %0.f, view = %@>", [self class], self, _winSizeInPoints.width, _winSizeInPoints.height, __view]; +} + +- (void) dealloc +{ + CCLOGINFO(@"cocos2d: deallocing %@", self); + + + _sharedDirector = nil; + +} + +-(void) setGLDefaultValues +{ + // This method SHOULD be called only after __view was initialized + NSAssert( __view, @"__view must be initialized"); + + [self setAlphaBlending: YES]; + [self setDepthTest: __view.depthFormat]; + [self setProjection: _projection]; + + // set other opengl default values + glClearColor(0.0f, 0.0f, 0.0f, 1.0f); +} + +// +// Draw the Scene +// +- (void) drawScene +{ + // Override me +} + +-(void) calculateDeltaTime +{ + struct timeval now; + + if( gettimeofday( &now, NULL) != 0 ) { + CCLOG(@"cocos2d: error in gettimeofday"); + _dt = 0; + return; + } + + // new delta time + if( _nextDeltaTimeZero ) { + _dt = 0; + _nextDeltaTimeZero = NO; + } else { + _dt = (now.tv_sec - _lastUpdate.tv_sec) + (now.tv_usec - _lastUpdate.tv_usec) / 1000000.0f; + _dt = MAX(0,_dt); + } + +#ifdef DEBUG + // If we are debugging our code, prevent big delta time + if( _dt > 0.2f ) + _dt = 1/60.0f; +#endif + + _lastUpdate = now; +} + +#pragma mark Director - Memory Helper + +-(void) purgeCachedData +{ + [CCLabelBMFont purgeCachedData]; + if ([_sharedDirector view]) + [[CCTextureCache sharedTextureCache] removeUnusedTextures]; + [[CCFileUtils sharedFileUtils] purgeCachedEntries]; +} + +#pragma mark Director - Scene OpenGL Helper + +-(ccDirectorProjection) projection +{ + return _projection; +} + +-(float) getZEye +{ + return ( _winSizeInPixels.height / 1.1566f / CC_CONTENT_SCALE_FACTOR() ); +} + +-(void) setViewport +{ + CCLOG(@"cocos2d: override me"); +} + +-(void) setProjection:(ccDirectorProjection)projection +{ + CCLOG(@"cocos2d: override me"); +} + +- (void) setAlphaBlending: (BOOL) on +{ + if (on) { + ccGLBlendFunc(CC_BLEND_SRC, CC_BLEND_DST); + + } else + ccGLBlendFunc(GL_ONE, GL_ZERO); + + CHECK_GL_ERROR_DEBUG(); +} + +- (void) setDepthTest: (BOOL) on +{ + if (on) { + glClearDepth(1.0f); + + glEnable(GL_DEPTH_TEST); + glDepthFunc(GL_LEQUAL); +// glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST); + } else + glDisable( GL_DEPTH_TEST ); + + CHECK_GL_ERROR_DEBUG(); +} + +#pragma mark Director Integration with a UIKit view + +-(void) setView:(id)view +{ +// NSAssert( view, @"OpenGLView must be non-nil"); + + if( view != __view ) { + +#ifdef __CC_PLATFORM_IOS + [super setView:view]; +#endif + __view = (CCGLView *)view; + + // set size + _winSizeInPixels = _winSizeInPoints = CCNSSizeToCGSize( [__view bounds].size ); + + // it could be nil + if( view ) { + [self createStatsLabel]; + [self setGLDefaultValues]; + } + + // Dump info once OpenGL was initilized + [[CCConfiguration sharedConfiguration] dumpInfo]; + + CHECK_GL_ERROR_DEBUG(); + } +} + +-(CCGLView*) view +{ + return __view; +} + + +#pragma mark Director Scene Landscape + +-(CGPoint)convertToGL:(CGPoint)uiPoint +{ + CCLOG(@"CCDirector#convertToGL: OVERRIDE ME."); + return CGPointZero; +} + +-(CGPoint)convertToUI:(CGPoint)glPoint +{ + CCLOG(@"CCDirector#convertToUI: OVERRIDE ME."); + return CGPointZero; +} + +-(CGSize)winSize +{ + return _winSizeInPoints; +} + +-(CGSize)winSizeInPixels +{ + return _winSizeInPixels; +} + +-(void) reshapeProjection:(CGSize)newWindowSize +{ + _winSizeInPixels = _winSizeInPoints = newWindowSize; + [self setProjection:_projection]; +} + +#pragma mark Director Scene Management + +- (void)runWithScene:(CCScene*) scene +{ + NSAssert( scene != nil, @"Argument must be non-nil"); + NSAssert(_runningScene == nil, @"This command can only be used to start the CCDirector. There is already a scene present."); + + [self pushScene:scene]; + [self startAnimation]; +} + +/* +-(void) replaceScene: (CCScene*) scene +{ + NSAssert( _runningScene, @"Use runWithScene: instead to start the director"); + NSAssert( scene != nil, @"Argument must be non-nil"); + + NSUInteger index = [_scenesStack count]; + + _sendCleanupToScene = YES; + [_scenesStack replaceObjectAtIndex:index-1 withObject:scene]; + _nextScene = scene; // _nextScene is a weak ref +}*/ + +- (void) pushScene: (CCScene*) scene +{ + NSAssert( scene != nil, @"Argument must be non-nil"); + + _sendCleanupToScene = NO; + + [_scenesStack addObject: scene]; + _nextScene = scene; // _nextScene is a weak ref +} + +- (void)pushScene:(CCScene *)scene withTransition:(CCTransition *)transition +{ + NSAssert(scene, @"Scene must be non-nil"); + + [_scenesStack addObject:scene]; + _sendCleanupToScene = NO; + [transition performSelector:@selector(replaceScene:) withObject:scene]; +} + +-(void) popScene +{ + NSAssert( _runningScene != nil, @"A running Scene is needed"); + + [_scenesStack removeLastObject]; + NSUInteger c = [_scenesStack count]; + + if( c == 0 ) + [self end]; + else { + _sendCleanupToScene = YES; + _nextScene = [_scenesStack objectAtIndex:c-1]; + } +} + +- (void)popScenewithTransition:(CCTransition *)transition +{ + NSAssert( _runningScene != nil, @"A running Scene is needed"); + + if (_scenesStack.count < 2) + { + [self end]; + } + else + { + [_scenesStack removeLastObject]; + CCScene * incomingScene = [_scenesStack lastObject]; + _sendCleanupToScene = YES; + [transition performSelector:@selector(replaceScene:) withObject:incomingScene]; + } +} + +-(void) popToRootScene +{ + [self popToSceneStackLevel:1]; +} + +-(void) popToSceneStackLevel:(NSUInteger)level +{ + NSAssert(_runningScene != nil, @"A running Scene is needed"); + NSUInteger c = [_scenesStack count]; + + // level 0? -> end + if( level == 0) { + [self end]; + return; + } + + // current level or lower -> nothing + if( level >= c) + return; + + // pop stack until reaching desired level + while (c > level) { + CCScene *current = [_scenesStack lastObject]; + if( [current isRunning] ){ + [current onExitTransitionDidStart]; + [current onExit]; + } + [current cleanup]; + + [_scenesStack removeLastObject]; + c--; + } + _nextScene = [_scenesStack lastObject]; + _sendCleanupToScene = NO; +} + +// ----------------------------------------------------------------- + +- (void)replaceScene:(CCScene *)scene +{ + NSAssert( scene != nil, @"Argument must be non-nil"); + + if (_runningScene) + { + _sendCleanupToScene = YES; + [_scenesStack removeLastObject]; + [_scenesStack addObject:scene]; + _nextScene = scene; // _nextScene is a weak ref + } + else + { + [self pushScene:scene]; + [self startAnimation]; + } +} + +- (void)replaceScene:(CCScene *)scene withTransition:(CCTransition *)transition +{ + // the transition gets to become the running scene + _sendCleanupToScene = YES; + [transition performSelector:@selector(replaceScene:) withObject:scene]; +} + +// ----------------------------------------------------------------- + +-(void) end +{ + [_runningScene onExitTransitionDidStart]; + [_runningScene onExit]; + [_runningScene cleanup]; + + _runningScene = nil; + _nextScene = nil; + + // remove all objects, but don't release it. + // runWithScene might be executed after 'end'. + [_scenesStack removeAllObjects]; + + [self stopAnimation]; + + _FPSLabel = nil, _SPFLabel=nil, _drawsLabel=nil; + + _delegate = nil; + + [self setView:nil]; + + // Purge bitmap cache + [CCLabelBMFont purgeCachedData]; + + // Purge all managers / caches + ccDrawFree(); + [CCAnimationCache purgeSharedAnimationCache]; + [CCSpriteFrameCache purgeSharedSpriteFrameCache]; + [CCTextureCache purgeSharedTextureCache]; + [CCShaderCache purgeSharedShaderCache]; + [[CCFileUtils sharedFileUtils] purgeCachedEntries]; + + // OpenGL view + + // Since the director doesn't attach the openglview to the window + // it shouldn't remove it from the window too. +// [openGLView_ removeFromSuperview]; + + + // Invalidate GL state cache + ccGLInvalidateStateCache(); + + CHECK_GL_ERROR(); +} + +-(void) setNextScene +{ + // ----------------------------------------------------------------- + // v2.5 functionality + + // If next scene is a transition, the transition has just started + // Make transition the running scene. + // Outgoing scene will continue to run + // Incoming scene was started by transition + if ([_nextScene isKindOfClass:[CCTransition class]]) + { + _runningScene = nil; + _runningScene = _nextScene; + _nextScene = nil; + [_runningScene onEnter]; + return; + } + + // If running scene is a transition class, the transition has ended + // Make new scene, the running scene + // Clean up transition + // Outgoing scene was stopped by transition + if ([_runningScene isKindOfClass:[CCTransition class]]) + { + [_runningScene onExit]; + if( _sendCleanupToScene) [_runningScene cleanup]; + _runningScene = nil; + _runningScene = _nextScene; + _nextScene = nil; + return; + } + // ----------------------------------------------------------------- + + Class transClass = [CCTransition class]; + BOOL runningIsTransition = [_runningScene isKindOfClass:transClass]; + BOOL newIsTransition = [_nextScene isKindOfClass:transClass]; + + // If it is not a transition, call onExit/cleanup + if( ! newIsTransition ) { + [_runningScene onExitTransitionDidStart]; + [_runningScene onExit]; + + // issue #709. the root node (scene) should receive the cleanup message too + // otherwise it might be leaked. + if( _sendCleanupToScene) + [_runningScene cleanup]; + } + + + _runningScene = _nextScene; + _nextScene = nil; + + if( ! runningIsTransition ) { + [_runningScene onEnter]; + [_runningScene onEnterTransitionDidFinish]; + } +} + +-(void) pause +{ + if( _isPaused ) + return; + + _oldAnimationInterval = _animationInterval; + + // when paused, don't consume CPU + [self setAnimationInterval:1/4.0]; + + [self willChangeValueForKey:@"isPaused"]; + _isPaused = YES; + [self didChangeValueForKey:@"isPaused"]; +} + +-(void) resume +{ + if( ! _isPaused ) + return; + + [self setAnimationInterval: _oldAnimationInterval]; + + if( gettimeofday( &_lastUpdate, NULL) != 0 ) { + CCLOG(@"cocos2d: Director: Error in gettimeofday"); + } + + [self willChangeValueForKey:@"isPaused"]; + _isPaused = NO; + [self didChangeValueForKey:@"isPaused"]; + + _dt = 0; +} + +- (void)startAnimation +{ + _nextDeltaTimeZero = YES; +} + +- (void)stopAnimation +{ + CCLOG(@"cocos2d: Director#stopAnimation. Override me"); +} + +- (void)setAnimationInterval:(NSTimeInterval)interval +{ + CCLOG(@"cocos2d: Director#setAnimationInterval. Override me"); +} + + +// display statistics +-(void) showStats +{ + _frames++; + _accumDt += _dt; + + if( _displayStats ) { + // Ms per Frame + + if( _accumDt > CC_DIRECTOR_STATS_INTERVAL) + { + NSString *spfstr = [[NSString alloc] initWithFormat:@"%.3f", _secondsPerFrame]; + [_SPFLabel setString:spfstr]; + + _frameRate = _frames/_accumDt; + _frames = 0; + _accumDt = 0; + +// sprintf(format,"%.1f",frameRate); +// [FPSLabel setCString:format]; + + NSString *fpsstr = [[NSString alloc] initWithFormat:@"%.1f", _frameRate]; + [_FPSLabel setString:fpsstr]; + + NSString *draws = [[NSString alloc] initWithFormat:@"%4lu", (unsigned long)__ccNumberOfDraws]; + [_drawsLabel setString:draws]; + } + + [_drawsLabel visit]; + [_FPSLabel visit]; + [_SPFLabel visit]; + } + + __ccNumberOfDraws = 0; +} + +-(void) calculateMPF +{ + struct timeval now; + gettimeofday( &now, NULL); + + _secondsPerFrame = (now.tv_sec - _lastUpdate.tv_sec) + (now.tv_usec - _lastUpdate.tv_usec) / 1000000.0f; +} + +#pragma mark Director - Helper + +-(void)getFPSImageData:(unsigned char**)datapointer length:(NSUInteger*)len +{ + *datapointer = cc_fps_images_png; + *len = cc_fps_images_len(); +} + +-(void) createStatsLabel +{ + CCTexture2D *texture; + CCTextureCache *textureCache = [CCTextureCache sharedTextureCache]; + + if( _FPSLabel && _SPFLabel ) { + + [textureCache removeTextureForKey:@"cc_fps_images"]; + _FPSLabel = nil; + _SPFLabel = nil; + _drawsLabel = nil; + + [[CCFileUtils sharedFileUtils] purgeCachedEntries]; + } + + CCTexture2DPixelFormat currentFormat = [CCTexture2D defaultAlphaPixelFormat]; + [CCTexture2D setDefaultAlphaPixelFormat:kCCTexture2DPixelFormat_RGBA4444]; + + unsigned char *data; + NSUInteger data_len; + [self getFPSImageData:&data length:&data_len]; + + NSData *nsdata = [NSData dataWithBytes:data length:data_len]; + CGDataProviderRef imgDataProvider = CGDataProviderCreateWithCFData( (__bridge CFDataRef) nsdata); + CGImageRef imageRef = CGImageCreateWithPNGDataProvider(imgDataProvider, NULL, true, kCGRenderingIntentDefault); + texture = [textureCache addCGImage:imageRef forKey:@"cc_fps_images"]; + CGDataProviderRelease(imgDataProvider); + CGImageRelease(imageRef); + + _FPSLabel = [[CCLabelAtlas alloc] initWithString:@"00.0" texture:texture itemWidth:12 itemHeight:32 startCharMap:'.']; + _SPFLabel = [[CCLabelAtlas alloc] initWithString:@"0.000" texture:texture itemWidth:12 itemHeight:32 startCharMap:'.']; + _drawsLabel = [[CCLabelAtlas alloc] initWithString:@"000" texture:texture itemWidth:12 itemHeight:32 startCharMap:'.']; + + [CCTexture2D setDefaultAlphaPixelFormat:currentFormat]; + + [_drawsLabel setPosition: ccpAdd( ccp(0,34), CC_DIRECTOR_STATS_POSITION ) ]; + [_SPFLabel setPosition: ccpAdd( ccp(0,17), CC_DIRECTOR_STATS_POSITION ) ]; + [_FPSLabel setPosition: CC_DIRECTOR_STATS_POSITION ]; +} + +@end + diff --git a/cocos2d/CCDrawNode.h b/cocos2d/CCDrawNode.h new file mode 100644 index 0000000..3fa4034 --- /dev/null +++ b/cocos2d/CCDrawNode.h @@ -0,0 +1,65 @@ +/* Copyright (c) 2012 Scott Lembcke and Howling Moon Software + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +/* + * Code copied & pasted from SpacePatrol game https://github.com/slembcke/SpacePatrol + * + * Renamed and added some changes for cocos2d + * + */ + +#import "CCNode.h" + +/** CCDrawNode + Node that draws dots, segments and polygons. + Faster than the "drawing primitives" since they it draws everything in one single batch. + + @since v2.1 + */ +@interface CCDrawNode : CCNode +{ + GLuint _vao; + GLuint _vbo; + + NSUInteger _bufferCapacity; + GLsizei _bufferCount; + ccV2F_C4B_T2F *_buffer; + + ccBlendFunc _blendFunc; + + BOOL _dirty; +} + +@property(nonatomic, assign) ccBlendFunc blendFunc; + +/** draw a dot at a position, with a given radius and color */ +-(void)drawDot:(CGPoint)pos radius:(CGFloat)radius color:(ccColor4F)color; + +/** draw a segment with a radius and color */ +-(void)drawSegmentFrom:(CGPoint)a to:(CGPoint)b radius:(CGFloat)radius color:(ccColor4F)color; + +/** draw a polygon with a fill color and line color */ +-(void)drawPolyWithVerts:(const CGPoint*)verts count:(NSUInteger)count fillColor:(ccColor4F)fill borderWidth:(CGFloat)width borderColor:(ccColor4F)line; + +/** Clear the geometry in the node's buffer. */ +-(void)clear; + +@end diff --git a/cocos2d/CCDrawNode.m b/cocos2d/CCDrawNode.m new file mode 100644 index 0000000..6d5ef03 --- /dev/null +++ b/cocos2d/CCDrawNode.m @@ -0,0 +1,376 @@ +/* Copyright (c) 2012 Scott Lembcke and Howling Moon Software + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +/* + * Code copied & pasted from SpacePatrol game https://github.com/slembcke/SpacePatrol + * + * Renamed and added some changes for cocos2d + * + */ + +#import "CCDrawNode.h" +#import "CCShaderCache.h" +#import "CCGLProgram.h" +#import "Support/CGPointExtension.h" +#import "Support/OpenGL_Internal.h" + + +// ccVertex2F == CGPoint in 32-bits, but not in 64-bits (OS X) +// that's why the "v2f" functions are needed +static ccVertex2F v2fzero = (ccVertex2F){0,0}; + +static inline ccVertex2F v2f( float x, float y ) +{ + return (ccVertex2F){x,y}; +} + +static inline ccVertex2F v2fadd( ccVertex2F v0, ccVertex2F v1 ) +{ + return v2f( v0.x+v1.x, v0.y+v1.y ); +} + +static inline ccVertex2F v2fsub( ccVertex2F v0, ccVertex2F v1 ) +{ + return v2f( v0.x-v1.x, v0.y-v1.y ); +} + +static inline ccVertex2F v2fmult( ccVertex2F v, float s ) +{ + return v2f( v.x * s, v.y * s ); +} + +static inline ccVertex2F v2fperp( ccVertex2F p0 ) +{ + return v2f( -p0.y, p0.x ); +} + +static inline ccVertex2F v2fneg( ccVertex2F p0 ) +{ + return v2f( -p0.x, - p0.y ); +} + +static inline float v2fdot(ccVertex2F p0, ccVertex2F p1) +{ + return p0.x * p1.x + p0.y * p1.y; +} + +static inline ccVertex2F v2fforangle( float _a_) +{ + return v2f( cosf(_a_), sinf(_a_) ); +} + +static inline ccVertex2F v2fnormalize( ccVertex2F p ) +{ + CGPoint r = ccpNormalize( ccp(p.x, p.y) ); + return v2f( r.x, r.y); +} + +static inline ccVertex2F __v2f(CGPoint v ) +{ +#ifdef __LP64__ + return v2f(v.x, v.y); +#else + return * ((ccVertex2F*) &v); +#endif +} + +static inline ccTex2F __t(ccVertex2F v ) +{ + return *(ccTex2F*)&v; +} + + +@implementation CCDrawNode + +@synthesize blendFunc = _blendFunc; + +#pragma mark memory + +-(void)ensureCapacity:(NSUInteger)count +{ + if(_bufferCount + count > _bufferCapacity){ + _bufferCapacity += MAX(_bufferCapacity, count); + _buffer = realloc(_buffer, _bufferCapacity*sizeof(ccV2F_C4B_T2F)); + +// NSLog(@"Resized vertex buffer to %d", _bufferCapacity); + } +} + +-(id)init +{ + if((self = [super init])){ + self.blendFunc = (ccBlendFunc){CC_BLEND_SRC, CC_BLEND_DST}; + + self.shaderProgram = [[CCShaderCache sharedShaderCache] programForKey:kCCShader_PositionLengthTexureColor]; + + [self ensureCapacity:512]; + + glGenVertexArrays(1, &_vao); + ccGLBindVAO(_vao); + + glGenBuffers(1, &_vbo); + glBindBuffer(GL_ARRAY_BUFFER, _vbo); + glBufferData(GL_ARRAY_BUFFER, sizeof(ccV2F_C4B_T2F)*_bufferCapacity, _buffer, GL_STREAM_DRAW); + + glEnableVertexAttribArray(kCCVertexAttrib_Position); + glVertexAttribPointer(kCCVertexAttrib_Position, 2, GL_FLOAT, GL_FALSE, sizeof(ccV2F_C4B_T2F), (GLvoid *)offsetof(ccV2F_C4B_T2F, vertices)); + + glEnableVertexAttribArray(kCCVertexAttrib_Color); + glVertexAttribPointer(kCCVertexAttrib_Color, 4, GL_UNSIGNED_BYTE, GL_TRUE, sizeof(ccV2F_C4B_T2F), (GLvoid *)offsetof(ccV2F_C4B_T2F, colors)); + + glEnableVertexAttribArray(kCCVertexAttrib_TexCoords); + glVertexAttribPointer(kCCVertexAttrib_TexCoords, 2, GL_FLOAT, GL_FALSE, sizeof(ccV2F_C4B_T2F), (GLvoid *)offsetof(ccV2F_C4B_T2F, texCoords)); + + glBindBuffer(GL_ARRAY_BUFFER, 0); + ccGLBindVAO(0); + + CHECK_GL_ERROR(); + + _dirty = YES; + } + + return self; +} + +-(void)dealloc +{ +#ifdef __CC_PLATFORM_IOS + NSAssert([EAGLContext currentContext], @"No GL context set!"); +#endif + + free(_buffer); _buffer = NULL; + + glDeleteBuffers(1, &_vbo); _vbo = 0; + glDeleteVertexArrays(1, &_vao); _vao = 0; + +} + +#pragma mark Rendering + +-(void)render +{ + if( _dirty ) { + glBindBuffer(GL_ARRAY_BUFFER, _vbo); + glBufferData(GL_ARRAY_BUFFER, sizeof(ccV2F_C4B_T2F)*_bufferCapacity, _buffer, GL_STREAM_DRAW); + glBindBuffer(GL_ARRAY_BUFFER, 0); + _dirty = NO; + } + + ccGLBindVAO(_vao); + glDrawArrays(GL_TRIANGLES, 0, _bufferCount); + + CC_INCREMENT_GL_DRAWS(1); + + CHECK_GL_ERROR(); +} + +-(void)draw +{ + ccGLBlendFunc(_blendFunc.src, _blendFunc.dst); + + [_shaderProgram use]; + [_shaderProgram setUniformsForBuiltins]; + + [self render]; +} + +#pragma mark Immediate Mode + +-(void)drawDot:(CGPoint)pos radius:(CGFloat)radius color:(ccColor4F)color +{ + NSUInteger vertex_count = 2*3; + [self ensureCapacity:vertex_count]; + + ccV2F_C4B_T2F a = {{pos.x - radius, pos.y - radius}, ccc4BFromccc4F(color), {-1.0, -1.0} }; + ccV2F_C4B_T2F b = {{pos.x - radius, pos.y + radius}, ccc4BFromccc4F(color), {-1.0, 1.0} }; + ccV2F_C4B_T2F c = {{pos.x + radius, pos.y + radius}, ccc4BFromccc4F(color), { 1.0, 1.0} }; + ccV2F_C4B_T2F d = {{pos.x + radius, pos.y - radius}, ccc4BFromccc4F(color), { 1.0, -1.0} }; + + ccV2F_C4B_T2F_Triangle *triangles = (ccV2F_C4B_T2F_Triangle *)(_buffer + _bufferCount); + triangles[0] = (ccV2F_C4B_T2F_Triangle){a, b, c}; + triangles[1] = (ccV2F_C4B_T2F_Triangle){a, c, d}; + + _bufferCount += vertex_count; + + _dirty = YES; +} + +-(void)drawSegmentFrom:(CGPoint)_a to:(CGPoint)_b radius:(CGFloat)radius color:(ccColor4F)color +{ + NSUInteger vertex_count = 6*3; + [self ensureCapacity:vertex_count]; + + ccVertex2F a = __v2f(_a); + ccVertex2F b = __v2f(_b); + + + ccVertex2F n = v2fnormalize(v2fperp(v2fsub(b, a))); + ccVertex2F t = v2fperp(n); + + ccVertex2F nw = v2fmult(n, radius); + ccVertex2F tw = v2fmult(t, radius); + ccVertex2F v0 = v2fsub(b, v2fadd(nw, tw)); + ccVertex2F v1 = v2fadd(b, v2fsub(nw, tw)); + ccVertex2F v2 = v2fsub(b, nw); + ccVertex2F v3 = v2fadd(b, nw); + ccVertex2F v4 = v2fsub(a, nw); + ccVertex2F v5 = v2fadd(a, nw); + ccVertex2F v6 = v2fsub(a, v2fsub(nw, tw)); + ccVertex2F v7 = v2fadd(a, v2fadd(nw, tw)); + + + ccV2F_C4B_T2F_Triangle *triangles = (ccV2F_C4B_T2F_Triangle *)(_buffer + _bufferCount); + + triangles[0] = (ccV2F_C4B_T2F_Triangle) { + {v0, ccc4BFromccc4F(color), __t(v2fneg(v2fadd(n, t))) }, + {v1, ccc4BFromccc4F(color), __t(v2fsub(n, t)) }, + {v2, ccc4BFromccc4F(color), __t(v2fneg(n)) }, + }; + + triangles[1] = (ccV2F_C4B_T2F_Triangle){ + {v3, ccc4BFromccc4F(color), __t(n)}, + {v1, ccc4BFromccc4F(color), __t(v2fsub(n, t)) }, + {v2, ccc4BFromccc4F(color), __t(v2fneg(n)) }, + }; + + triangles[2] = (ccV2F_C4B_T2F_Triangle){ + {v3, ccc4BFromccc4F(color), __t(n)}, + {v4, ccc4BFromccc4F(color), __t(v2fneg(n)) }, + {v2, ccc4BFromccc4F(color), __t(v2fneg(n)) }, + }; + triangles[3] = (ccV2F_C4B_T2F_Triangle){ + {v3, ccc4BFromccc4F(color), __t(n) }, + {v4, ccc4BFromccc4F(color), __t(v2fneg(n)) }, + {v5, ccc4BFromccc4F(color), __t(n) }, + }; + triangles[4] = (ccV2F_C4B_T2F_Triangle){ + {v6, ccc4BFromccc4F(color), __t(v2fsub(t, n))}, + {v4, ccc4BFromccc4F(color), __t(v2fneg(n)) }, + {v5, ccc4BFromccc4F(color), __t(n)}, + }; + triangles[5] = (ccV2F_C4B_T2F_Triangle){ + {v6, ccc4BFromccc4F(color), __t(v2fsub(t, n)) }, + {v7, ccc4BFromccc4F(color), __t(v2fadd(n, t)) }, + {v5, ccc4BFromccc4F(color), __t(n)}, + }; + + _bufferCount += vertex_count; + + _dirty = YES; +} + +-(void)drawPolyWithVerts:(const CGPoint *)verts count:(NSUInteger)count fillColor:(ccColor4F)fill borderWidth:(CGFloat)width borderColor:(ccColor4F)line +{ + struct ExtrudeVerts {ccVertex2F offset, n;}; + struct ExtrudeVerts extrude[count]; + bzero(extrude, sizeof(extrude) ); + + for(NSUInteger i=0; i 0.0 && width > 0.0); + + NSUInteger triangle_count = 3*count - 2; + NSUInteger vertex_count = 3*triangle_count; + [self ensureCapacity:vertex_count]; + + ccV2F_C4B_T2F_Triangle *triangles = (ccV2F_C4B_T2F_Triangle *)(_buffer + _bufferCount); + ccV2F_C4B_T2F_Triangle *cursor = triangles; + + CGFloat inset = (outline == 0.0 ? 0.5 : 0.0); + for(NSUInteger i=0; i + +#import "ccTypes.h" +#import "ccMacros.h" + +#ifdef __CC_PLATFORM_IOS +#import // for CGPoint +#endif + + +#ifdef __cplusplus +extern "C" { +#endif + +@class CCPointArray; + + +/** + @file + Drawing OpenGL ES primitives. + - ccDrawPoint, ccDrawPoints + - ccDrawLine + - ccDrawRect, ccDrawSolidRect + - ccDrawPoly, ccDrawSolidPoly + - ccDrawCircle, ccDrawSolidCircle + - ccDrawArc, ccDrawSolidArc + - ccDrawQuadBezier + - ccDrawCubicBezier + - ccDrawCatmullRom + - ccDrawCardinalSpline + + You can change the color, point size, width by calling: + - ccDrawColor4B(), ccDrawColor4F() + - ccPointSize() + - glLineWidth() + + @warning These functions draws the Line, Point, Polygon, immediately. They aren't batched. If you are going to make a game that depends on these primitives, I suggest creating a batch. Instead you should use CCDrawNode + + */ + + +/** Initializes the drawing primitives */ +void ccDrawInit(void); + +/** Frees allocated resources by the drawing primitives */ +void ccDrawFree(void); + +/** draws a point given x and y coordinate measured in points. */ +void ccDrawPoint( CGPoint point ); + +/** draws an array of points. + @since v0.7.2 + */ +void ccDrawPoints( const CGPoint *points, NSUInteger numberOfPoints ); + +/** draws a line given the origin and destination point measured in points. */ +void ccDrawLine( CGPoint origin, CGPoint destination ); + +/** draws a rectangle given the origin and destination point measured in points. */ +void ccDrawRect( CGPoint origin, CGPoint destination ); + +/** draws a solid rectangle given the origin and destination point measured in points. + @since 1.1 + */ +void ccDrawSolidRect( CGPoint origin, CGPoint destination, ccColor4F color ); + +/** draws a polygon given a pointer to CGPoint coordinates and the number of vertices measured in points. + The polygon can be closed or open + */ +void ccDrawPoly( const CGPoint *vertices, NSUInteger numOfVertices, BOOL closePolygon ); + +/** draws a solid polygon given a pointer to CGPoint coordinates, the number of vertices measured in points, and a color. + */ +void ccDrawSolidPoly( const CGPoint *poli, NSUInteger numberOfPoints, ccColor4F color ); + +/** draws a circle given the center, radius and number of segments measured in points */ +void ccDrawCircle( CGPoint center, float radius, float angle, NSUInteger segments, BOOL drawLineToCenter); + +/** draws a solid circle given the center, radius and number of segments measured in points */ +void ccDrawSolidCircle( CGPoint center, float radius, NSUInteger segments); + +/** draws a arc given the center, radius, arc length and number of segments measured in points */ +void ccDrawArc(CGPoint center, CGFloat r, CGFloat a, CGFloat arcLength, NSUInteger segs, BOOL drawLineToCenter); + +/** draws a solid arc given the center, radius, arc length and number of segments measured in points */ +void ccDrawSolidArc(CGPoint center, CGFloat r, CGFloat a, CGFloat arcLength, NSUInteger segs); + +/** draws a quad bezier path measured in points. + @warning This function could be pretty slow. Use it only for debugging purposes. + @since v0.8 + */ +void ccDrawQuadBezier(CGPoint origin, CGPoint control, CGPoint destination, NSUInteger segments); + +/** draws a cubic bezier path measured in points. + @warning This function could be pretty slow. Use it only for debugging purposes. + @since v0.8 + */ +void ccDrawCubicBezier(CGPoint origin, CGPoint control1, CGPoint control2, CGPoint destination, NSUInteger segments); + +/** draws a Catmull Rom path. + @warning This function could be pretty slow. Use it only for debugging purposes. + @since v2.0 + */ +void ccDrawCatmullRom( CCPointArray *arrayOfControlPoints, NSUInteger segments ); + +/** draws a Cardinal Spline path. + @warning This function could be pretty slow. Use it only for debugging purposes. + @since v2.0 + */ +void ccDrawCardinalSpline( CCPointArray *config, CGFloat tension, NSUInteger segments ); + +/** set the drawing color with 4 unsigned bytes + @since v2.0 + */ +void ccDrawColor4B( GLubyte r, GLubyte g, GLubyte b, GLubyte a ); + +/** set the drawing color with 4 floats + @since v2.0 + */ +void ccDrawColor4F( GLfloat r, GLfloat g, GLfloat b, GLfloat a ); + +/** set the point size in points. Default 1. + @since v2.0 + */ +void ccPointSize( GLfloat pointSize ); + + +#ifdef __cplusplus +} +#endif + +#endif // __CC_DRAWING_PRIMITIVES_H diff --git a/src/cocos2d/CCDrawingPrimitives.m b/cocos2d/CCDrawingPrimitives.m similarity index 69% rename from src/cocos2d/CCDrawingPrimitives.m rename to cocos2d/CCDrawingPrimitives.m index 03adf9b..c2be202 100644 --- a/src/cocos2d/CCDrawingPrimitives.m +++ b/cocos2d/CCDrawingPrimitives.m @@ -3,6 +3,7 @@ * * Copyright (c) 2008-2010 Ricardo Quesada * Copyright (c) 2011 Zynga Inc. + * Copyright (c) 2013 Nader Eloshaiker * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -23,6 +24,17 @@ * THE SOFTWARE. */ +/* + * + * IMPORTANT IMPORTANT IMPORTANT IMPORTANT + * + * + * LEGACY FUNCTIONS + * + * USE CCDrawNode instead + * + */ + #import #import #import @@ -53,14 +65,26 @@ static void lazy_init( void ) // shader_ = [[CCShaderCache sharedShaderCache] programForKey:kCCShader_Position_uColor]; - colorLocation_ = glGetUniformLocation( shader_->program_, "u_color"); - pointSizeLocation_ = glGetUniformLocation( shader_->program_, "u_pointSize"); + colorLocation_ = glGetUniformLocation( shader_.program, "u_color"); + pointSizeLocation_ = glGetUniformLocation( shader_.program, "u_pointSize"); initialized = YES; } } +void ccDrawFree(void) +{ + + shader_ = nil; + initialized = NO; +} + +void ccDrawInit(void) +{ + lazy_init(); +} + void ccDrawPoint( CGPoint point ) { lazy_init(); @@ -70,7 +94,7 @@ void ccDrawPoint( CGPoint point ) ccGLEnableVertexAttribs( kCCVertexAttribFlag_Position ); [shader_ use]; - [shader_ setUniformForModelViewProjectionMatrix]; + [shader_ setUniformsForBuiltins]; [shader_ setUniformLocation:colorLocation_ with4fv:(GLfloat*) &color_.r count:1]; [shader_ setUniformLocation:pointSizeLocation_ withF1:pointSize_]; @@ -89,25 +113,33 @@ void ccDrawPoints( const CGPoint *points, NSUInteger numberOfPoints ) ccGLEnableVertexAttribs( kCCVertexAttribFlag_Position ); [shader_ use]; - [shader_ setUniformForModelViewProjectionMatrix]; + [shader_ setUniformsForBuiltins]; [shader_ setUniformLocation:colorLocation_ with4fv:(GLfloat*) &color_.r count:1]; [shader_ setUniformLocation:pointSizeLocation_ withF1:pointSize_]; // XXX: Mac OpenGL error. arrays can't go out of scope before draw is executed ccVertex2F newPoints[numberOfPoints]; + //TODO: Fix -Wunreachable-code // iPhone and 32-bit machines optimization + +#pragma clang diagnostic push COCOS2D +#pragma clang diagnostic ignored "-Wunreachable-code" if( sizeof(CGPoint) == sizeof(ccVertex2F) ) + { glVertexAttribPointer(kCCVertexAttrib_Position, 2, GL_FLOAT, GL_FALSE, 0, points); - + } else { // Mac on 64-bit - for( NSUInteger i=0; i +#import "ccMacros.h" +#import "Platforms/CCGL.h" + +enum { + kCCVertexAttrib_Position, + kCCVertexAttrib_Color, + kCCVertexAttrib_TexCoords, + + kCCVertexAttrib_MAX, +}; + +enum { + kCCUniformPMatrix, + kCCUniformMVMatrix, + kCCUniformMVPMatrix, + kCCUniformTime, + kCCUniformSinTime, + kCCUniformCosTime, + kCCUniformRandom01, + kCCUniformSampler, + + kCCUniform_MAX, +}; + +#define kCCShader_PositionTextureColor @"ShaderPositionTextureColor" +#define kCCShader_PositionTextureColorAlphaTest @"ShaderPositionTextureColorAlphaTest" +#define kCCShader_PositionColor @"ShaderPositionColor" +#define kCCShader_PositionTexture @"ShaderPositionTexture" +#define kCCShader_PositionTexture_uColor @"ShaderPositionTexture_uColor" +#define kCCShader_PositionTextureA8Color @"ShaderPositionTextureA8Color" +#define kCCShader_Position_uColor @"ShaderPosition_uColor" +#define kCCShader_PositionLengthTexureColor @"ShaderPositionLengthTextureColor" + +// uniform names +#define kCCUniformPMatrix_s "CC_PMatrix" +#define kCCUniformMVMatrix_s "CC_MVMatrix" +#define kCCUniformMVPMatrix_s "CC_MVPMatrix" +#define kCCUniformTime_s "CC_Time" +#define kCCUniformSinTime_s "CC_SinTime" +#define kCCUniformCosTime_s "CC_CosTime" +#define kCCUniformRandom01_s "CC_Random01" +#define kCCUniformSampler_s "CC_Texture0" +#define kCCUniformAlphaTestValue_s "CC_AlphaValue" + +// Attribute names +#define kCCAttributeNameColor @"a_color" +#define kCCAttributeNamePosition @"a_position" +#define kCCAttributeNameTexCoord @"a_texCoord" + + +struct _hashUniformEntry; + +/** CCGLProgram + Class that implements a glProgram + + + @since v2.0.0 + */ +@interface CCGLProgram : NSObject +{ + struct _hashUniformEntry *_hashForUniforms; + +@public + GLuint _program, + _vertShader, + _fragShader; + + GLint _uniforms[kCCUniform_MAX]; + + struct { + unsigned int usesTime:1; + unsigned int usesMVP:1; + unsigned int usesMV:1; + unsigned int usesRandom:1; + } _flags; +} + +@property(nonatomic, readonly) GLuint program; + +/** creates the CCGLProgram with a vertex and fragment from byte arrays */ ++ (id)programWithVertexShaderByteArray:(const GLchar*)vShaderByteArray fragmentShaderByteArray:(const GLchar*)fShaderByteArray; + +/** creates the CCGLProgram with a vertex and fragment with contents of filenames */ ++ (id)programWithVertexShaderFilename:(NSString *)vShaderFilename fragmentShaderFilename:(NSString *)fShaderFilename; + +/** Initializes the CCGLProgram with a vertex and fragment with bytes array */ +- (id)initWithVertexShaderByteArray:(const GLchar*)vShaderByteArray fragmentShaderByteArray:(const GLchar*)fShaderByteArray; + +/** Initializes the CCGLProgram with a vertex and fragment with contents of filenames */ +- (id)initWithVertexShaderFilename:(NSString *)vShaderFilename fragmentShaderFilename:(NSString *)fShaderFilename; + +/** It will add a new attribute to the shader */ +- (void)addAttribute:(NSString *)attributeName index:(GLuint)index; + +/** links the glProgram */ +- (BOOL)link; + +/** it will call glUseProgram() */ +- (void)use; + +/** It will create 4 uniforms: + - kCCUniformPMatrix + - kCCUniformMVMatrix + - kCCUniformMVPMatrix + - kCCUniformSampler + + And it will bind "kCCUniformSampler" to 0 + */ +- (void) updateUniforms; + +/** calls retrieves the named uniform location for this shader program. */ +- (GLint)uniformLocationForName:(NSString*)name; + +/** calls glUniform1i only if the values are different than the previous call for this same shader program. */ +-(void) setUniformLocation:(GLint)location withI1:(GLint)i1; + +/** calls glUniform1f only if the values are different than the previous call for this same shader program. */ +-(void) setUniformLocation:(GLint)location withF1:(GLfloat)f1; + +/** calls glUniform2f only if the values are different than the previous call for this same shader program. */ +-(void) setUniformLocation:(GLint)location withF1:(GLfloat)f1 f2:(GLfloat)f2; + +/** calls glUniform3f only if the values are different than the previous call for this same shader program. */ +-(void) setUniformLocation:(GLint)location withF1:(GLfloat)f1 f2:(GLfloat)f2 f3:(GLfloat)f3; + +/** calls glUniform4f only if the values are different than the previous call for this same shader program. */ +-(void) setUniformLocation:(GLint)location withF1:(GLfloat)f1 f2:(GLfloat)f2 f3:(GLfloat)f3 f4:(GLfloat)f4; + +/** calls glUniform2fv only if the values are different than the previous call for this same shader program. */ +-(void) setUniformLocation:(GLint)location with2fv:(GLfloat*)floats count:(NSUInteger)numberOfArrays; + +/** calls glUniform3fv only if the values are different than the previous call for this same shader program. */ +-(void) setUniformLocation:(GLint)location with3fv:(GLfloat*)floats count:(NSUInteger)numberOfArrays; + +/** calls glUniform4fv only if the values are different than the previous call for this same shader program. */ +-(void) setUniformLocation:(GLint)location with4fv:(GLvoid*)floats count:(NSUInteger)numberOfArrays; + +/** calls glUniformMatrix4fv only if the values are different than the previous call for this same shader program. */ +-(void) setUniformLocation:(GLint)location withMatrix4fv:(GLvoid*)matrix_array count:(NSUInteger)numberOfMatrix; + +/** will update the builtin uniforms if they are different than the previous call for this same shader program. */ +-(void) setUniformsForBuiltins; + +/** Deprecated alias for setUniformsForBuiltins */ +-(void)setUniformForModelViewProjectionMatrix __attribute__((__deprecated__)); + +/** returns the vertexShader error log */ +- (NSString *)vertexShaderLog; + +/** returns the fragmentShader error log */ +- (NSString *)fragmentShaderLog; + +/** returns the program error log */ +- (NSString *)programLog; +@end diff --git a/cocos2d/CCGLProgram.m b/cocos2d/CCGLProgram.m new file mode 100644 index 0000000..54f1ec1 --- /dev/null +++ b/cocos2d/CCGLProgram.m @@ -0,0 +1,509 @@ +// +// Copyright 2011 Jeff Lamarche +// +// Copyright 2012 Goffredo Marocchi +// +// Copyright 2012 Ricardo Quesada +// +// +// Redistribution and use in source and binary forms, with or without modification, are permitted provided +// that the following conditions are met: +// 1. Redistributions of source code must retain the above copyright notice, this list of conditions and +// the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions +// and the following disclaimer in the documentation and/or other materials provided with the +// distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE FREEBSD PROJECT ``AS IS'' AND ANY EXPRESS OR IMPLIED +// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +// FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FREEBSD PROJECT +// OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED +// AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +#import "CCGLProgram.h" +#import "ccGLStateCache.h" +#import "ccMacros.h" +#import "Support/CCFileUtils.h" +#import "Support/uthash.h" +#import "Support/OpenGL_Internal.h" + +#import "CCDirector.h" + +// extern + +#pragma clang diagnostic push COCOS2D +#pragma clang diagnostic ignored "-Wignored-qualifiers" +#import "kazmath/GL/matrix.h" +#import "kazmath/kazmath.h" +#pragma clang diagnostic pop COCOS2D + + +typedef struct _hashUniformEntry +{ + GLvoid *value; // value + size_t length; + NSUInteger location; // Key + UT_hash_handle hh; // hash entry +} tHashUniformEntry; + + +#pragma mark Function Pointer Definitions +typedef void (*GLInfoFunction)(GLuint program, + GLenum pname, + GLint* params); +typedef void (*GLLogFunction) (GLuint program, + GLsizei bufsize, + GLsizei* length, + GLchar* infolog); +#pragma mark - +#pragma mark Private Extension Method Declaration + +@interface CCGLProgram() +- (BOOL)compileShader:(GLuint *)shader type:(GLenum)type byteArray:(const GLchar*)byteArray; + +- (NSString *)logForOpenGLObject:(GLuint)object infoCallback:(GLInfoFunction)infoFunc logFunc:(GLLogFunction)logFunc; +@end + +#pragma mark - + +@implementation CCGLProgram + +@synthesize program = _program; + ++ (id)programWithVertexShaderByteArray:(const GLchar*)vShaderByteArray fragmentShaderByteArray:(const GLchar*)fShaderByteArray +{ + return [[self alloc] initWithVertexShaderByteArray:vShaderByteArray fragmentShaderByteArray:fShaderByteArray]; +} + ++ (id)programWithVertexShaderFilename:(NSString *)vShaderFilename fragmentShaderFilename:(NSString *)fShaderFilename +{ + return [[self alloc] initWithVertexShaderFilename:vShaderFilename fragmentShaderFilename:fShaderFilename]; +} + +- (id)initWithVertexShaderByteArray:(const GLchar *)vShaderByteArray fragmentShaderByteArray:(const GLchar *)fShaderByteArray +{ + if ((self = [super init]) ) + { + _program = glCreateProgram(); + + _vertShader = _fragShader = 0; + + if( vShaderByteArray ) { + + if (![self compileShader:&_vertShader + type:GL_VERTEX_SHADER + byteArray:vShaderByteArray] ) + CCLOG(@"cocos2d: ERROR: Failed to compile vertex shader"); + } + + // Create and compile fragment shader + if( fShaderByteArray ) { + if (![self compileShader:&_fragShader + type:GL_FRAGMENT_SHADER + byteArray:fShaderByteArray] ) + + CCLOG(@"cocos2d: ERROR: Failed to compile fragment shader"); + } + + if( _vertShader ) + glAttachShader(_program, _vertShader); + + if( _fragShader ) + glAttachShader(_program, _fragShader); + + _hashForUniforms = NULL; + } + + return self; +} + +- (id)initWithVertexShaderFilename:(NSString *)vShaderFilename fragmentShaderFilename:(NSString *)fShaderFilename +{ + NSString *v = [[CCFileUtils sharedFileUtils] fullPathForFilenameIgnoringResolutions:vShaderFilename]; + NSString *f = [[CCFileUtils sharedFileUtils] fullPathForFilenameIgnoringResolutions:fShaderFilename]; + if( !(v || f) ) { + if(!v) + CCLOGWARN(@"Could not open vertex shader: %@", vShaderFilename); + if(!f) + CCLOGWARN(@"Could not open fragment shader: %@", fShaderFilename); + return nil; + } + const GLchar * vertexSource = (GLchar*) [[NSString stringWithContentsOfFile:v encoding:NSUTF8StringEncoding error:nil] UTF8String]; + const GLchar * fragmentSource = (GLchar*) [[NSString stringWithContentsOfFile:f encoding:NSUTF8StringEncoding error:nil] UTF8String]; + + return [self initWithVertexShaderByteArray:vertexSource fragmentShaderByteArray:fragmentSource]; +} + +- (NSString*) description +{ + return [NSString stringWithFormat:@"<%@ = %p | Program = %i, VertexShader = %i, FragmentShader = %i>", [self class], self, _program, _vertShader, _fragShader]; +} + + +- (BOOL)compileShader:(GLuint *)shader type:(GLenum)type byteArray:(const GLchar *)source +{ + GLint status; + + if (!source) + return NO; + + const GLchar *sources[] = { +#ifdef __CC_PLATFORM_IOS + (type == GL_VERTEX_SHADER ? "precision highp float;\n" : "precision mediump float;\n"), +#endif + "uniform mat4 CC_PMatrix;\n" + "uniform mat4 CC_MVMatrix;\n" + "uniform mat4 CC_MVPMatrix;\n" + "uniform vec4 CC_Time;\n" + "uniform vec4 CC_SinTime;\n" + "uniform vec4 CC_CosTime;\n" + "uniform vec4 CC_Random01;\n" + "//CC INCLUDES END\n\n", + source, + }; + + *shader = glCreateShader(type); + glShaderSource(*shader, sizeof(sources)/sizeof(*sources), sources, NULL); + glCompileShader(*shader); + + glGetShaderiv(*shader, GL_COMPILE_STATUS, &status); + + if( ! status ) { + GLsizei length; + glGetShaderiv(*shader, GL_SHADER_SOURCE_LENGTH, &length); + GLchar src[length]; + + glGetShaderSource(*shader, length, NULL, src); + CCLOG(@"cocos2d: ERROR: Failed to compile shader:\n%s", src); + + if( type == GL_VERTEX_SHADER ) + CCLOG(@"cocos2d: %@", [self vertexShaderLog] ); + else + CCLOG(@"cocos2d: %@", [self fragmentShaderLog] ); + + abort(); + } + return ( status == GL_TRUE ); +} + +#pragma mark - + +- (void)addAttribute:(NSString *)attributeName index:(GLuint)index +{ + glBindAttribLocation(_program, + index, + [attributeName UTF8String]); +} + +-(void) updateUniforms +{ + _uniforms[ kCCUniformPMatrix] = glGetUniformLocation(_program, kCCUniformPMatrix_s); + _uniforms[ kCCUniformMVMatrix] = glGetUniformLocation(_program, kCCUniformMVMatrix_s); + _uniforms[kCCUniformMVPMatrix] = glGetUniformLocation(_program, kCCUniformMVPMatrix_s); + + _uniforms[kCCUniformTime] = glGetUniformLocation(_program, kCCUniformTime_s); + _uniforms[kCCUniformSinTime] = glGetUniformLocation(_program, kCCUniformSinTime_s); + _uniforms[kCCUniformCosTime] = glGetUniformLocation(_program, kCCUniformCosTime_s); + + _uniforms[kCCUniformRandom01] = glGetUniformLocation(_program, kCCUniformRandom01_s); + + _uniforms[kCCUniformSampler] = glGetUniformLocation(_program, kCCUniformSampler_s); + + _flags.usesMVP = _uniforms[kCCUniformMVPMatrix] != -1; + _flags.usesMV = (_uniforms[kCCUniformMVMatrix] != -1 && _uniforms[kCCUniformPMatrix] != -1 ); + _flags.usesTime = ( + _uniforms[kCCUniformTime] != -1 || + _uniforms[kCCUniformSinTime] != -1 || + _uniforms[kCCUniformCosTime] != -1 + ); + _flags.usesRandom = _uniforms[kCCUniformRandom01] != -1; + + + [self use]; + + // Since sample most probably won't change, set it to 0 now. + [self setUniformLocation:_uniforms[kCCUniformSampler] withI1:0]; +} + +#pragma mark - + +-(BOOL) link +{ + NSAssert(_program != 0, @"Cannot link invalid program"); + + GLint status = GL_TRUE; + glLinkProgram(_program); + + if (_vertShader) + glDeleteShader(_vertShader); + + if (_fragShader) + glDeleteShader(_fragShader); + + _vertShader = _fragShader = 0; + +#if DEBUG + glGetProgramiv(_program, GL_LINK_STATUS, &status); + NSString* log = self.programLog; + + if (status == GL_FALSE) { + NSLog(@"cocos2d: ERROR: Failed to link program: %i - %@", _program, log); + ccGLDeleteProgram( _program ); + _program = 0; + } +#endif + + return (status == GL_TRUE); +} + +-(void) use +{ + ccGLUseProgram(_program); +} + +#pragma mark - + +-(NSString *) logForOpenGLObject:(GLuint)object + infoCallback:(GLInfoFunction)infoFunc + logFunc:(GLLogFunction)logFunc +{ + GLint logLength = 0, charsWritten = 0; + + infoFunc(object, GL_INFO_LOG_LENGTH, &logLength); + if (logLength < 1) + return nil; + + char *logBytes = malloc(logLength); + logFunc(object, logLength, &charsWritten, logBytes); + NSString *log = [[NSString alloc] initWithBytes:logBytes + length:logLength + encoding:NSUTF8StringEncoding]; + free(logBytes); + return log; +} + +- (NSString *)vertexShaderLog +{ + return [self logForOpenGLObject:_vertShader + infoCallback:(GLInfoFunction)&glGetShaderiv + logFunc:(GLLogFunction)&glGetShaderInfoLog]; +} + +- (NSString *)fragmentShaderLog +{ + return [self logForOpenGLObject:_fragShader + infoCallback:(GLInfoFunction)&glGetShaderiv + logFunc:(GLLogFunction)&glGetShaderInfoLog]; +} + +- (NSString *)programLog +{ + return [self logForOpenGLObject:_program + infoCallback:(GLInfoFunction)&glGetProgramiv + logFunc:(GLLogFunction)&glGetProgramInfoLog]; +} + +#pragma mark - Uniform cache + +-(BOOL) updateUniformLocation:(GLint)location withData:(GLvoid*)data sizeOfData:(NSUInteger)bytes +{ + if(location < 0) + return FALSE; + + BOOL updated = YES; + tHashUniformEntry *element = NULL; + HASH_FIND_INT(_hashForUniforms, &location, element); + + if( ! element ) { + + element = malloc( sizeof(*element) ); + + // key + element->location = location; + + // value + element->value = malloc( bytes ); + element->length = bytes; + memcpy(element->value, data, bytes ); + + HASH_ADD_INT(_hashForUniforms, location, element); + } + else + { + if (element->length != bytes) + { + element->value = realloc(element->value, bytes); + memcpy(element->value, data, bytes); + element->length = bytes; + } + else + { + if( memcmp( element->value, data, bytes) == 0 ) + { + updated = NO; + } + else + { + memcpy( element->value, data, bytes ); + } + } + } + + return updated; +} + +- (GLint)uniformLocationForName:(NSString*)name +{ + NSAssert(name != nil, @"Invalid uniform name" ); + NSAssert(_program != 0, @"Invalid operation. Cannot get uniform location when program is not initialized"); + + return glGetUniformLocation(_program, [name UTF8String]); +} + +-(void) setUniformLocation:(GLint)location withI1:(GLint)i1 +{ + BOOL updated = [self updateUniformLocation:location withData:&i1 sizeOfData:sizeof(i1)*1]; + + if( updated ) + glUniform1i( (GLint)location, i1); +} + +-(void) setUniformLocation:(GLint)location withF1:(GLfloat)f1 +{ + BOOL updated = [self updateUniformLocation:location withData:&f1 sizeOfData:sizeof(f1)*1]; + + if( updated ) + glUniform1f( (GLint)location, f1); +} + +-(void) setUniformLocation:(GLint)location withF1:(GLfloat)f1 f2:(GLfloat)f2 +{ + GLfloat floats[2] = {f1,f2}; + BOOL updated = [self updateUniformLocation:location withData:floats sizeOfData:sizeof(floats)]; + + if( updated ) + glUniform2f( (GLint)location, f1, f2); +} + +-(void) setUniformLocation:(GLint)location withF1:(GLfloat)f1 f2:(GLfloat)f2 f3:(GLfloat)f3 +{ + GLfloat floats[3] = {f1,f2,f3}; + BOOL updated = [self updateUniformLocation:location withData:floats sizeOfData:sizeof(floats)]; + + if( updated ) + glUniform3f( (GLint)location, f1, f2, f3); +} + +-(void) setUniformLocation:(GLint)location withF1:(GLfloat)f1 f2:(GLfloat)f2 f3:(GLfloat)f3 f4:(GLfloat)f4 +{ + GLfloat floats[4] = {f1,f2,f3,f4}; + BOOL updated = [self updateUniformLocation:location withData:floats sizeOfData:sizeof(floats)]; + + if( updated ) + glUniform4f( (GLint)location, f1, f2, f3,f4); +} + +-(void) setUniformLocation:(GLint)location with2fv:(GLfloat*)floats count:(NSUInteger)numberOfArrays +{ + BOOL updated = [self updateUniformLocation:location withData:floats sizeOfData:sizeof(float)*2*numberOfArrays]; + + if( updated ) + glUniform2fv( (GLint)location, (GLsizei)numberOfArrays, floats ); +} + +-(void) setUniformLocation:(GLint)location with3fv:(GLfloat*)floats count:(NSUInteger)numberOfArrays +{ + BOOL updated = [self updateUniformLocation:location withData:floats sizeOfData:sizeof(float)*3*numberOfArrays]; + + if( updated ) + glUniform3fv( (GLint)location, (GLsizei)numberOfArrays, floats ); +} + +-(void) setUniformLocation:(GLint)location with4fv:(GLvoid*)floats count:(NSUInteger)numberOfArrays +{ + BOOL updated = [self updateUniformLocation:location withData:floats sizeOfData:sizeof(float)*4*numberOfArrays]; + + if( updated ) + glUniform4fv( (GLint)location, (GLsizei)numberOfArrays, floats ); +} + + +-(void) setUniformLocation:(GLint)location withMatrix4fv:(GLvoid*)matrixArray count:(NSUInteger)numberOfMatrices +{ + BOOL updated = [self updateUniformLocation:location withData:matrixArray sizeOfData:sizeof(float)*16*numberOfMatrices]; + + if( updated ) + glUniformMatrix4fv( (GLint)location, (GLsizei)numberOfMatrices, GL_FALSE, matrixArray); +} + +-(void) setUniformsForBuiltins +{ + kmMat4 matrixP; + kmMat4 matrixMV; + + kmGLGetMatrix(KM_GL_PROJECTION, &matrixP ); + kmGLGetMatrix(KM_GL_MODELVIEW, &matrixMV ); + + if( _flags.usesMVP) { + kmMat4 matrixMVP; + kmMat4Multiply(&matrixMVP, &matrixP, &matrixMV); + [self setUniformLocation:_uniforms[kCCUniformMVPMatrix] withMatrix4fv:matrixMVP.mat count:1]; + } + + if( _flags.usesMV) { + [self setUniformLocation:_uniforms[ kCCUniformPMatrix] withMatrix4fv: matrixP.mat count:1]; + [self setUniformLocation:_uniforms[ kCCUniformMVMatrix] withMatrix4fv: matrixMV.mat count:1]; + } + + if(_flags.usesTime){ + CCDirector *director = [CCDirector sharedDirector]; + // This doesn't give the most accurate global time value. + // Cocos2D doesn't store a high precision time value, so this will have to do. + // Getting Mach time per frame per shader using time could be extremely expensive. + ccTime time = director.totalFrames*director.animationInterval; + + [self setUniformLocation:_uniforms[kCCUniformTime] withF1:time/10.0 f2:time f3:time*2 f4:time*4]; + [self setUniformLocation:_uniforms[kCCUniformSinTime] withF1:sinf(time/8.0) f2:sinf(time/4.0) f3:sinf(time/2.0) f4:sinf(time)]; + [self setUniformLocation:_uniforms[kCCUniformCosTime] withF1:cosf(time/8.0) f2:cosf(time/4.0) f3:cosf(time/2.0) f4:cosf(time)]; + } + + if(_flags.usesRandom) + [self setUniformLocation:_uniforms[kCCUniformRandom01] withF1:CCRANDOM_0_1() f2:CCRANDOM_0_1() f3:CCRANDOM_0_1() f4:CCRANDOM_0_1()]; +} + +-(void)setUniformForModelViewProjectionMatrix +{ + [self setUniformsForBuiltins]; +} + + +#pragma mark - + +- (void)dealloc +{ + CCLOGINFO( @"cocos2d: deallocing %@", self); + + // there is no need to delete the shaders. They should have been already deleted. + NSAssert( _vertShader == 0, @"Vertex Shaders should have been already deleted"); + NSAssert( _fragShader == 0, @"Fragment Shaders should have been already deleted"); + + if (_program) + ccGLDeleteProgram(_program); + + tHashUniformEntry *current_element, *tmp; + + // Purge uniform hash + HASH_ITER(hh, _hashForUniforms, current_element, tmp) { + HASH_DEL(_hashForUniforms, current_element); + free(current_element->value); + free(current_element); + } + +} +@end diff --git a/cocos2d/CCGrabber.h b/cocos2d/CCGrabber.h new file mode 100644 index 0000000..06bb210 --- /dev/null +++ b/cocos2d/CCGrabber.h @@ -0,0 +1,44 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2009 On-Core + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + */ + + +#import "Platforms/CCGL.h" +#import + +@class CCTexture2D; + +/** FBO class that grabs the the contents of the screen */ +@interface CCGrabber : NSObject +{ + GLuint _FBO; + GLint _oldFBO; + GLfloat oldClearColor_[4]; +} + +-(void)grab:(CCTexture2D*)texture; +-(void)beforeRender:(CCTexture2D*)texture; +-(void)afterRender:(CCTexture2D*)texture; + +@end diff --git a/src/cocos2d/CCGrabber.m b/cocos2d/CCGrabber.m similarity index 87% rename from src/cocos2d/CCGrabber.m rename to cocos2d/CCGrabber.m index 5b12542..14b509c 100644 --- a/src/cocos2d/CCGrabber.m +++ b/cocos2d/CCGrabber.m @@ -36,17 +36,17 @@ -(id) init { if(( self = [super init] )) { // generate FBO - glGenFramebuffers(1, &fbo_); + glGenFramebuffers(1, &_FBO); } return self; } -(void)grab:(CCTexture2D*)texture { - glGetIntegerv(GL_FRAMEBUFFER_BINDING, &oldFBO_); + glGetIntegerv(GL_FRAMEBUFFER_BINDING, &_oldFBO); // bind - glBindFramebuffer(GL_FRAMEBUFFER, fbo_); + glBindFramebuffer(GL_FRAMEBUFFER, _FBO); // associate texture with FBO glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, texture.name, 0); @@ -56,13 +56,13 @@ -(void)grab:(CCTexture2D*)texture if (status != GL_FRAMEBUFFER_COMPLETE) [NSException raise:@"Frame Grabber" format:@"Could not attach texture to framebuffer"]; - glBindFramebuffer(GL_FRAMEBUFFER, oldFBO_); + glBindFramebuffer(GL_FRAMEBUFFER, _oldFBO); } -(void)beforeRender:(CCTexture2D*)texture { - glGetIntegerv(GL_FRAMEBUFFER_BINDING, &oldFBO_); - glBindFramebuffer(GL_FRAMEBUFFER, fbo_); + glGetIntegerv(GL_FRAMEBUFFER_BINDING, &_oldFBO); + glBindFramebuffer(GL_FRAMEBUFFER, _FBO); // save clear color glGetFloatv(GL_COLOR_CLEAR_VALUE,oldClearColor_); @@ -82,7 +82,7 @@ -(void)beforeRender:(CCTexture2D*)texture -(void)afterRender:(CCTexture2D*)texture { - glBindFramebuffer(GL_FRAMEBUFFER, oldFBO_); + glBindFramebuffer(GL_FRAMEBUFFER, _oldFBO); // glColorMask(TRUE, TRUE, TRUE, TRUE); // #631 // Restore clear color @@ -92,8 +92,7 @@ -(void)afterRender:(CCTexture2D*)texture - (void) dealloc { CCLOGINFO(@"cocos2d: deallocing %@", self); - glDeleteFramebuffers(1, &fbo_); - [super dealloc]; + glDeleteFramebuffers(1, &_FBO); } @end diff --git a/cocos2d/CCGrid.h b/cocos2d/CCGrid.h new file mode 100644 index 0000000..fee4b59 --- /dev/null +++ b/cocos2d/CCGrid.h @@ -0,0 +1,133 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2009 On-Core + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + */ + + +#import + +#import "CCNode.h" +#import "ccTypes.h" +#import "CCDirector.h" + +#pragma clang diagnostic push COCOS2D +#pragma clang diagnostic ignored "-Wignored-qualifiers" +#import "kazmath/mat4.h" +#pragma clang diagnostic pop COCOS2D + +@class CCTexture2D; +@class CCGrabber; +@class CCGLProgram; + +/** Base class for other + */ +@interface CCGridBase : NSObject +{ + BOOL _active; + int _reuseGrid; + CGSize _gridSize; + CCTexture2D *_texture; + CGPoint _step; + CCGrabber *_grabber; + BOOL _isTextureFlipped; + + CCGLProgram *__unsafe_unretained _shaderProgram; + + ccDirectorProjection _directorProjection; +} + +/** whether or not the grid is active */ +@property (nonatomic,readwrite) BOOL active; +/** number of times that the grid will be reused */ +@property (nonatomic,readwrite) int reuseGrid; +/** size of the grid */ +@property (nonatomic,readonly) CGSize gridSize; +/** pixels between the grids */ +@property (nonatomic,readwrite) CGPoint step; +/** texture used */ +@property (nonatomic, strong) CCTexture2D *texture; +/** grabber used */ +@property (nonatomic, strong) CCGrabber *grabber; +/** is texture flipped */ +@property (nonatomic, readwrite) BOOL isTextureFlipped; +/** shader program */ +@property (nonatomic, readwrite, unsafe_unretained) CCGLProgram *shaderProgram; + ++(id) gridWithSize:(CGSize)gridSize texture:(CCTexture2D*)texture flippedTexture:(BOOL)flipped; ++(id) gridWithSize:(CGSize)gridSize; + +-(id) initWithSize:(CGSize)gridSize texture:(CCTexture2D*)texture flippedTexture:(BOOL)flipped; +-(id)initWithSize:(CGSize)gridSize; +-(void)beforeDraw; +-(void)afterDraw:(CCNode*)target; +-(void)blit; +-(void)reuse; + +-(void)calculateVertexPoints; + +@end + +//////////////////////////////////////////////////////////// + +/** + CCGrid3D is a 3D grid implementation. Each vertex has 3 dimensions: x,y,z + */ +@interface CCGrid3D : CCGridBase +{ + GLvoid *_texCoordinates; + GLvoid *_vertices; + GLvoid *_originalVertices; + GLushort *_indices; +} + +/** returns the vertex at a given position */ +-(ccVertex3F)vertex:(CGPoint)pos; +/** returns the original (non-transformed) vertex at a given position */ +-(ccVertex3F)originalVertex:(CGPoint)pos; +/** sets a new vertex at a given position */ +-(void)setVertex:(CGPoint)pos vertex:(ccVertex3F)vertex; + +@end + +//////////////////////////////////////////////////////////// + +/** + CCTiledGrid3D is a 3D grid implementation. It differs from Grid3D in that + the tiles can be separated from the grid. +*/ +@interface CCTiledGrid3D : CCGridBase +{ + GLvoid *_texCoordinates; + GLvoid *_vertices; + GLvoid *_originalVertices; + GLushort *_indices; +} + +/** returns the tile at the given position */ +-(ccQuad3)tile:(CGPoint)pos; +/** returns the original tile (untransformed) at the given position */ +-(ccQuad3)originalTile:(CGPoint)pos; +/** sets a new tile */ +-(void)setTile:(CGPoint)pos coords:(ccQuad3)coords; + +@end diff --git a/src/cocos2d/CCGrid.m b/cocos2d/CCGrid.m similarity index 55% rename from src/cocos2d/CCGrid.m rename to cocos2d/CCGrid.m index cab291a..674855f 100644 --- a/src/cocos2d/CCGrid.m +++ b/cocos2d/CCGrid.m @@ -39,8 +39,11 @@ #import "Support/TransformUtils.h" #import "Support/OpenGL_Internal.h" -#import "kazmath/kazmath.h" +#pragma clang diagnostic push COCOS2D +#pragma clang diagnostic ignored "-Wignored-qualifiers" #import "kazmath/GL/matrix.h" +#import "kazmath/kazmath.h" +#pragma clang diagnostic pop COCOS2D #ifdef __CC_PLATFORM_IOS #import "Platforms/iOS/CCDirectorIOS.h" @@ -51,40 +54,40 @@ @implementation CCGridBase -@synthesize reuseGrid = reuseGrid_; -@synthesize texture = texture_; -@synthesize grabber = grabber_; -@synthesize gridSize = gridSize_; -@synthesize step = step_; -@synthesize shaderProgram = shaderProgram_; +@synthesize reuseGrid = _reuseGrid; +@synthesize texture = _texture; +@synthesize grabber = _grabber; +@synthesize gridSize = _gridSize; +@synthesize step = _step; +@synthesize shaderProgram = _shaderProgram; -+(id) gridWithSize:(ccGridSize)gridSize texture:(CCTexture2D*)texture flippedTexture:(BOOL)flipped ++(id) gridWithSize:(CGSize)gridSize texture:(CCTexture2D*)texture flippedTexture:(BOOL)flipped { - return [[[self alloc] initWithSize:gridSize texture:texture flippedTexture:flipped] autorelease]; + return [[self alloc] initWithSize:gridSize texture:texture flippedTexture:flipped]; } -+(id) gridWithSize:(ccGridSize)gridSize ++(id) gridWithSize:(CGSize)gridSize { - return [[(CCGridBase*)[self alloc] initWithSize:gridSize] autorelease]; + return [(CCGridBase*)[self alloc] initWithSize:gridSize]; } --(id) initWithSize:(ccGridSize)gridSize texture:(CCTexture2D*)texture flippedTexture:(BOOL)flipped +-(id) initWithSize:(CGSize)gridSize texture:(CCTexture2D*)texture flippedTexture:(BOOL)flipped { if( (self=[super init]) ) { - active_ = NO; - reuseGrid_ = 0; - gridSize_ = gridSize; + _active = NO; + _reuseGrid = 0; + _gridSize = gridSize; self.texture = texture; - isTextureFlipped_ = flipped; + _isTextureFlipped = flipped; - CGSize texSize = [texture_ contentSize]; - step_.x = texSize.width / gridSize_.x; - step_.y = texSize.height / gridSize_.y; + CGSize texSize = [_texture contentSize]; + _step.x = texSize.width / _gridSize.width; + _step.y = texSize.height / _gridSize.height; - grabber_ = [[CCGrabber alloc] init]; - [grabber_ grab:texture_]; + _grabber = [[CCGrabber alloc] init]; + [_grabber grab:_texture]; self.shaderProgram = [[CCShaderCache sharedShaderCache] programForKey:kCCShader_PositionTexture]; @@ -93,7 +96,7 @@ -(id) initWithSize:(ccGridSize)gridSize texture:(CCTexture2D*)texture flippedTex return self; } --(id)initWithSize:(ccGridSize)gSize +-(id)initWithSize:(CGSize)gSize { CCDirector *director = [CCDirector sharedDirector]; CGSize s = [director winSizeInPixels]; @@ -116,7 +119,6 @@ -(id)initWithSize:(ccGridSize)gSize void *data = calloc((size_t)(POTWide * POTHigh * bpp), 1); if( ! data ) { CCLOG(@"cocos2d: CCGrid: not enough memory"); - [self release]; return nil; } @@ -125,19 +127,17 @@ -(id)initWithSize:(ccGridSize)gSize if( ! texture ) { CCLOG(@"cocos2d: CCGrid: error creating texture"); - [self release]; return nil; } self = [self initWithSize:gSize texture:texture flippedTexture:NO]; - [texture release]; return self; } - (NSString*) description { - return [NSString stringWithFormat:@"<%@ = %p | Dimensions = %ldx%ld>", [self class], self, (long)gridSize_.x, (long)gridSize_.y]; + return [NSString stringWithFormat:@"<%@ = %p | Dimensions = %ldx%ld>", [self class], self, (long)_gridSize.width, (long)_gridSize.height]; } - (void) dealloc @@ -146,20 +146,17 @@ - (void) dealloc // [self setActive: NO]; - [texture_ release]; - [grabber_ release]; - [super dealloc]; } // properties -(BOOL) active { - return active_; + return _active; } -(void) setActive:(BOOL)active { - active_ = active; + _active = active; if( ! active ) { CCDirector *director = [CCDirector sharedDirector]; ccDirectorProjection proj = [director projection]; @@ -169,13 +166,13 @@ -(void) setActive:(BOOL)active -(BOOL) isTextureFlipped { - return isTextureFlipped_; + return _isTextureFlipped; } -(void) setIsTextureFlipped:(BOOL)flipped { - if( isTextureFlipped_ != flipped ) { - isTextureFlipped_ = flipped; + if( _isTextureFlipped != flipped ) { + _isTextureFlipped = flipped; [self calculateVertexPoints]; } } @@ -186,12 +183,12 @@ -(void)set2DProjection CGSize size = [director winSizeInPixels]; - glViewport(0, 0, size.width * CC_CONTENT_SCALE_FACTOR(), size.height * CC_CONTENT_SCALE_FACTOR() ); + glViewport(0, 0, size.width, size.height); kmGLMatrixMode(KM_GL_PROJECTION); kmGLLoadIdentity(); kmMat4 orthoMatrix; - kmMat4OrthographicProjection(&orthoMatrix, 0, size.width * CC_CONTENT_SCALE_FACTOR(), 0, size.height * CC_CONTENT_SCALE_FACTOR(), -1, 1); + kmMat4OrthographicProjection(&orthoMatrix, 0, size.width, 0, size.height, -1, 1); kmGLMultMatrix( &orthoMatrix ); kmGLMatrixMode(KM_GL_MODELVIEW); @@ -205,38 +202,26 @@ -(void)beforeDraw { // save projection CCDirector *director = [CCDirector sharedDirector]; - directorProjection_ = [director projection]; + _directorProjection = [director projection]; // 2d projection // [director setProjection:kCCDirectorProjection2D]; [self set2DProjection]; - [grabber_ beforeRender:texture_]; + [_grabber beforeRender:_texture]; } -(void)afterDraw:(CCNode *)target { - [grabber_ afterRender:texture_]; + [_grabber afterRender:_texture]; // restore projection CCDirector *director = [CCDirector sharedDirector]; - [director setProjection: directorProjection_]; - - if( target.camera.dirty ) { - - CGPoint offset = [target anchorPointInPoints]; - - // - // XXX: Camera should be applied in the AnchorPoint - // - kmGLTranslatef(offset.x, offset.y, 0); - [target.camera locate]; - kmGLTranslatef(-offset.x, -offset.y, 0); - } + [director setProjection: _directorProjection]; - ccGLBindTexture2D( texture_.name ); + ccGLBindTexture2D( _texture.name ); [self blit]; } @@ -267,75 +252,74 @@ @implementation CCGrid3D -(void)dealloc { - free(texCoordinates); - free(vertices); - free(indices); - free(originalVertices); - [super dealloc]; + free(_texCoordinates); + free(_vertices); + free(_indices); + free(_originalVertices); } -(void)blit { - NSInteger n = gridSize_.x * gridSize_.y; + NSInteger n = _gridSize.width * _gridSize.height; ccGLEnableVertexAttribs( kCCVertexAttribFlag_Position | kCCVertexAttribFlag_TexCoords ); - [shaderProgram_ use]; - [shaderProgram_ setUniformForModelViewProjectionMatrix]; + [_shaderProgram use]; + [_shaderProgram setUniformsForBuiltins]; // // Attributes // // position - glVertexAttribPointer(kCCVertexAttrib_Position, 3, GL_FLOAT, GL_FALSE, 0, vertices); + glVertexAttribPointer(kCCVertexAttrib_Position, 3, GL_FLOAT, GL_FALSE, 0, _vertices); // texCoods - glVertexAttribPointer(kCCVertexAttrib_TexCoords, 2, GL_FLOAT, GL_FALSE, 0, texCoordinates); + glVertexAttribPointer(kCCVertexAttrib_TexCoords, 2, GL_FLOAT, GL_FALSE, 0, _texCoordinates); - glDrawElements(GL_TRIANGLES, (GLsizei) n*6, GL_UNSIGNED_SHORT, indices); + glDrawElements(GL_TRIANGLES, (GLsizei) n*6, GL_UNSIGNED_SHORT, _indices); CC_INCREMENT_GL_DRAWS(1); } -(void)calculateVertexPoints { - float width = (float)texture_.pixelsWide; - float height = (float)texture_.pixelsHigh; - float imageH = texture_.contentSizeInPixels.height; + float width = (float)_texture.pixelsWide; + float height = (float)_texture.pixelsHigh; + float imageH = _texture.contentSizeInPixels.height; int x, y, i; - if (vertices) free(vertices); - if (originalVertices) free(originalVertices); - if (texCoordinates) free(texCoordinates); - if (indices) free(indices); + if (_vertices) free(_vertices); + if (_originalVertices) free(_originalVertices); + if (_texCoordinates) free(_texCoordinates); + if (_indices) free(_indices); - NSUInteger numOfPoints = (gridSize_.x+1) * (gridSize_.y+1); + NSUInteger numOfPoints = (_gridSize.width+1) * (_gridSize.height+1); - vertices = malloc(numOfPoints * sizeof(ccVertex3F)); - originalVertices = malloc(numOfPoints * sizeof(ccVertex3F)); - texCoordinates = malloc(numOfPoints * sizeof(ccVertex2F)); - indices = malloc( (gridSize_.x * gridSize_.y) * sizeof(GLushort)*6); + _vertices = malloc(numOfPoints * sizeof(ccVertex3F)); + _originalVertices = malloc(numOfPoints * sizeof(ccVertex3F)); + _texCoordinates = malloc(numOfPoints * sizeof(ccVertex2F)); + _indices = malloc( (_gridSize.width * _gridSize.height) * sizeof(GLushort)*6); - GLfloat *vertArray = (GLfloat*)vertices; - GLfloat *texArray = (GLfloat*)texCoordinates; - GLushort *idxArray = (GLushort *)indices; + GLfloat *vertArray = (GLfloat*)_vertices; + GLfloat *texArray = (GLfloat*)_texCoordinates; + GLushort *idxArray = (GLushort *)_indices; - for( x = 0; x < gridSize_.x; x++ ) + for( x = 0; x < _gridSize.width; x++ ) { - for( y = 0; y < gridSize_.y; y++ ) + for( y = 0; y < _gridSize.height; y++ ) { - NSInteger idx = (y * gridSize_.x) + x; + NSInteger idx = (y * _gridSize.width) + x; - GLfloat x1 = x * step_.x; - GLfloat x2 = x1 + step_.x; - GLfloat y1 = y * step_.y; - GLfloat y2 = y1 + step_.y; + GLfloat x1 = x * _step.x; + GLfloat x2 = x1 + _step.x; + GLfloat y1 = y * _step.y; + GLfloat y2 = y1 + _step.y; - GLushort a = x * (gridSize_.y+1) + y; - GLushort b = (x+1) * (gridSize_.y+1) + y; - GLushort c = (x+1) * (gridSize_.y+1) + (y+1); - GLushort d = x * (gridSize_.y+1) + (y+1); + GLushort a = x * (_gridSize.height+1) + y; + GLushort b = (x+1) * (_gridSize.height+1) + y; + GLushort c = (x+1) * (_gridSize.height+1) + (y+1); + GLushort d = x * (_gridSize.height+1) + (y+1); GLushort tempidx[6] = { a, b, d, b, c, d }; @@ -359,7 +343,7 @@ -(void)calculateVertexPoints vertArray[ l1[i] + 2 ] = l2[i].z; texArray[ tex1[i] ] = tex2[i].x / width; - if( isTextureFlipped_ ) + if( _isTextureFlipped ) texArray[ tex1[i] + 1 ] = (imageH - tex2[i].y) / height; else texArray[ tex1[i] + 1 ] = tex2[i].y / height; @@ -367,44 +351,53 @@ -(void)calculateVertexPoints } } - memcpy(originalVertices, vertices, (gridSize_.x+1)*(gridSize_.y+1)*sizeof(ccVertex3F)); + memcpy(_originalVertices, _vertices, (_gridSize.width+1)*(_gridSize.height+1)*sizeof(ccVertex3F)); } --(ccVertex3F)vertex:(ccGridSize)pos +#pragma clang diagnostic push COCOS2D +#pragma clang diagnostic ignored "-Wfloat-equal" +-(ccVertex3F)vertex:(CGPoint)pos { - NSInteger index = (pos.x * (gridSize_.y+1) + pos.y) * 3; - float *vertArray = (float *)vertices; + NSAssert( pos.x == (NSUInteger)pos.x && pos.y == (NSUInteger) pos.y , @"Numbers must be integers"); + + NSInteger index = (pos.x * (_gridSize.height+1) + pos.y) * 3; + float *vertArray = (float *)_vertices; ccVertex3F vert = { vertArray[index], vertArray[index+1], vertArray[index+2] }; return vert; } --(ccVertex3F)originalVertex:(ccGridSize)pos +-(ccVertex3F)originalVertex:(CGPoint)pos { - NSInteger index = (pos.x * (gridSize_.y+1) + pos.y) * 3; - float *vertArray = (float *)originalVertices; + NSAssert( pos.x == (NSUInteger)pos.x && pos.y == (NSUInteger) pos.y , @"Numbers must be integers"); + + NSInteger index = (pos.x * (_gridSize.height+1) + pos.y) * 3; + float *vertArray = (float *)_originalVertices; ccVertex3F vert = { vertArray[index], vertArray[index+1], vertArray[index+2] }; return vert; } --(void)setVertex:(ccGridSize)pos vertex:(ccVertex3F)vertex +-(void)setVertex:(CGPoint)pos vertex:(ccVertex3F)vertex { - NSInteger index = (pos.x * (gridSize_.y+1) + pos.y) * 3; - float *vertArray = (float *)vertices; + NSAssert( pos.x == (NSUInteger)pos.x && pos.y == (NSUInteger) pos.y , @"Numbers must be integers"); + + NSInteger index = (pos.x * (_gridSize.height+1) + pos.y) * 3; + float *vertArray = (float *)_vertices; vertArray[index] = vertex.x; vertArray[index+1] = vertex.y; vertArray[index+2] = vertex.z; } +#pragma clang diagnostic pop COCOS2D -(void)reuse { - if ( reuseGrid_ > 0 ) + if ( _reuseGrid > 0 ) { - memcpy(originalVertices, vertices, (gridSize_.x+1)*(gridSize_.y+1)*sizeof(ccVertex3F)); - reuseGrid_--; + memcpy(_originalVertices, _vertices, (_gridSize.width+1)*(_gridSize.height+1)*sizeof(ccVertex3F)); + _reuseGrid--; } } @@ -419,19 +412,18 @@ @implementation CCTiledGrid3D -(void)dealloc { - free(texCoordinates); - free(vertices); - free(indices); - free(originalVertices); - [super dealloc]; + free(_texCoordinates); + free(_vertices); + free(_indices); + free(_originalVertices); } -(void)blit { - NSInteger n = gridSize_.x * gridSize_.y; + NSInteger n = _gridSize.width * _gridSize.height; - [shaderProgram_ use]; - [shaderProgram_ setUniformForModelViewProjectionMatrix]; + [_shaderProgram use]; + [_shaderProgram setUniformsForBuiltins]; // @@ -440,48 +432,48 @@ -(void)blit ccGLEnableVertexAttribs( kCCVertexAttribFlag_Position | kCCVertexAttribFlag_TexCoords ); // position - glVertexAttribPointer(kCCVertexAttrib_Position, 3, GL_FLOAT, GL_FALSE, 0, vertices); + glVertexAttribPointer(kCCVertexAttrib_Position, 3, GL_FLOAT, GL_FALSE, 0, _vertices); // texCoods - glVertexAttribPointer(kCCVertexAttrib_TexCoords, 2, GL_FLOAT, GL_FALSE, 0, texCoordinates); + glVertexAttribPointer(kCCVertexAttrib_TexCoords, 2, GL_FLOAT, GL_FALSE, 0, _texCoordinates); - glDrawElements(GL_TRIANGLES, (GLsizei) n*6, GL_UNSIGNED_SHORT, indices); + glDrawElements(GL_TRIANGLES, (GLsizei) n*6, GL_UNSIGNED_SHORT, _indices); CC_INCREMENT_GL_DRAWS(1); } -(void)calculateVertexPoints { - float width = (float)texture_.pixelsWide; - float height = (float)texture_.pixelsHigh; - float imageH = texture_.contentSizeInPixels.height; + float width = (float)_texture.pixelsWide; + float height = (float)_texture.pixelsHigh; + float imageH = _texture.contentSizeInPixels.height; - NSInteger numQuads = gridSize_.x * gridSize_.y; + NSInteger numQuads = _gridSize.width * _gridSize.height; - if (vertices) free(vertices); - if (originalVertices) free(originalVertices); - if (texCoordinates) free(texCoordinates); - if (indices) free(indices); + if (_vertices) free(_vertices); + if (_originalVertices) free(_originalVertices); + if (_texCoordinates) free(_texCoordinates); + if (_indices) free(_indices); - vertices = malloc(numQuads*4*sizeof(ccVertex3F)); - originalVertices = malloc(numQuads*4*sizeof(ccVertex3F)); - texCoordinates = malloc(numQuads*4*sizeof(ccVertex2F)); - indices = malloc(numQuads*6*sizeof(GLushort)); + _vertices = malloc(numQuads*4*sizeof(ccVertex3F)); + _originalVertices = malloc(numQuads*4*sizeof(ccVertex3F)); + _texCoordinates = malloc(numQuads*4*sizeof(ccVertex2F)); + _indices = malloc(numQuads*6*sizeof(GLushort)); - GLfloat *vertArray = (GLfloat*)vertices; - GLfloat *texArray = (GLfloat*)texCoordinates; - GLushort *idxArray = (GLushort *)indices; + GLfloat *vertArray = (GLfloat*)_vertices; + GLfloat *texArray = (GLfloat*)_texCoordinates; + GLushort *idxArray = (GLushort *)_indices; int x, y; - for( x = 0; x < gridSize_.x; x++ ) + for( x = 0; x < _gridSize.width; x++ ) { - for( y = 0; y < gridSize_.y; y++ ) + for( y = 0; y < _gridSize.height; y++ ) { - float x1 = x * step_.x; - float x2 = x1 + step_.x; - float y1 = y * step_.y; - float y2 = y1 + step_.y; + float x1 = x * _step.x; + float x2 = x1 + _step.x; + float y1 = y * _step.y; + float y2 = y1 + _step.y; *vertArray++ = x1; *vertArray++ = y1; @@ -499,7 +491,7 @@ -(void)calculateVertexPoints float newY1 = y1; float newY2 = y2; - if( isTextureFlipped_ ) { + if( _isTextureFlipped ) { newY1 = imageH - y1; newY2 = imageH - y2; } @@ -526,20 +518,26 @@ -(void)calculateVertexPoints idxArray[x*6+5] = x*4+3; } - memcpy(originalVertices, vertices, numQuads*12*sizeof(GLfloat)); + memcpy(_originalVertices, _vertices, numQuads*12*sizeof(GLfloat)); } --(void)setTile:(ccGridSize)pos coords:(ccQuad3)coords +#pragma clang diagnostic push COCOS2D +#pragma clang diagnostic ignored "-Wfloat-equal" +-(void)setTile:(CGPoint)pos coords:(ccQuad3)coords { - NSInteger idx = (gridSize_.y * pos.x + pos.y) * 4 * 3; - float *vertArray = (float*)vertices; + NSAssert( pos.x == (NSUInteger)pos.x && pos.y == (NSUInteger) pos.y , @"Numbers must be integers"); + + NSInteger idx = (_gridSize.height * pos.x + pos.y) * 4 * 3; + float *vertArray = (float*)_vertices; memcpy(&vertArray[idx], &coords, sizeof(ccQuad3)); } --(ccQuad3)originalTile:(ccGridSize)pos +-(ccQuad3)originalTile:(CGPoint)pos { - NSInteger idx = (gridSize_.y * pos.x + pos.y) * 4 * 3; - float *vertArray = (float*)originalVertices; + NSAssert( pos.x == (NSUInteger)pos.x && pos.y == (NSUInteger) pos.y , @"Numbers must be integers"); + + NSInteger idx = (_gridSize.height * pos.x + pos.y) * 4 * 3; + float *vertArray = (float*)_originalVertices; ccQuad3 ret; memcpy(&ret, &vertArray[idx], sizeof(ccQuad3)); @@ -547,25 +545,28 @@ -(ccQuad3)originalTile:(ccGridSize)pos return ret; } --(ccQuad3)tile:(ccGridSize)pos +-(ccQuad3)tile:(CGPoint)pos { - NSInteger idx = (gridSize_.y * pos.x + pos.y) * 4 * 3; - float *vertArray = (float*)vertices; + NSAssert( pos.x == (NSUInteger)pos.x && pos.y == (NSUInteger) pos.y , @"Numbers must be integers"); + + NSInteger idx = (_gridSize.height * pos.x + pos.y) * 4 * 3; + float *vertArray = (float*)_vertices; ccQuad3 ret; memcpy(&ret, &vertArray[idx], sizeof(ccQuad3)); return ret; } +#pragma clang diagnostic pop COCOS2D -(void)reuse { - if ( reuseGrid_ > 0 ) + if ( _reuseGrid > 0 ) { - NSInteger numQuads = gridSize_.x * gridSize_.y; + NSInteger numQuads = _gridSize.width * _gridSize.height; - memcpy(originalVertices, vertices, numQuads*12*sizeof(GLfloat)); - reuseGrid_--; + memcpy(_originalVertices, _vertices, numQuads*12*sizeof(GLfloat)); + _reuseGrid--; } } diff --git a/cocos2d/CCLabelAtlas.h b/cocos2d/CCLabelAtlas.h new file mode 100644 index 0000000..369c1e9 --- /dev/null +++ b/cocos2d/CCLabelAtlas.h @@ -0,0 +1,71 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2008-2010 Ricardo Quesada + * Copyright (c) 2011 Zynga Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + */ + + +#import "CCAtlasNode.h" +#import "CCTextureAtlas.h" + +/** CCLabelAtlas is a subclass of CCAtlasNode. + + It can be as a replacement of CCLabel since it is MUCH faster. + + CCLabelAtlas versus CCLabel: + - CCLabelAtlas is MUCH faster than CCLabel + - CCLabelAtlas "characters" have a fixed height and width + - CCLabelAtlas "characters" can be anything you want since they are taken from an image file + + A more flexible class is CCLabelBMFont. It supports variable width characters and it also has a nice editor. + */ +@interface CCLabelAtlas : CCAtlasNode +{ + // string to render + NSString *_string; + + // the first char in the charmap + NSUInteger _mapStartChar; +} + + +/** creates the CCLabelAtlas with a string, a char map file(the atlas), the width and height of each element in points and the starting char of the atlas */ ++(id) labelWithString:(NSString*) string charMapFile: (NSString*) charmapfile itemWidth:(NSUInteger)w itemHeight:(NSUInteger)h startCharMap:(NSUInteger)firstElement; + +/** creates the CCLabelAtlas with a string and a configuration file + @since v2.0 + */ ++(id) labelWithString:(NSString*) string fntFile:(NSString*)fontFile; + +/** initializes the CCLabelAtlas with a string, a char map file(the atlas), the width and height in points of each element and the starting char of the atlas */ +-(id) initWithString:(NSString*) string charMapFile: (NSString*) charmapfile itemWidth:(NSUInteger)w itemHeight:(NSUInteger)h startCharMap:(NSUInteger)firstElement; + +/** initializes the CCLabelAtlas with a string, a texture, the width and height in points of each element and the starting char of the atlas */ +-(id) initWithString:(NSString*) theString texture:(CCTexture2D*)texture itemWidth:(NSUInteger)w itemHeight:(NSUInteger)h startCharMap:(NSUInteger)c; + +/** initializes the CCLabelAtlas with a string and a configuration file + @since v2.0 + */ +-(id) initWithString:(NSString*) string fntFile:(NSString*)fontFile; + +@end diff --git a/src/cocos2d/CCLabelAtlas.m b/cocos2d/CCLabelAtlas.m similarity index 67% rename from src/cocos2d/CCLabelAtlas.m rename to cocos2d/CCLabelAtlas.m index 40b94e8..12e4695 100644 --- a/src/cocos2d/CCLabelAtlas.m +++ b/cocos2d/CCLabelAtlas.m @@ -32,6 +32,7 @@ #import "CCShaderCache.h" #import "CCGLProgram.h" #import "ccGLStateCache.h" +#import "CCTextureCache.h" #import "CCDirector.h" #import "Support/CGPointExtension.h" #import "Support/TransformUtils.h" @@ -45,21 +46,24 @@ @implementation CCLabelAtlas #pragma mark CCLabelAtlas - Creation & Init +(id) labelWithString:(NSString*)string charMapFile:(NSString*)charmapfile itemWidth:(NSUInteger)w itemHeight:(NSUInteger)h startCharMap:(NSUInteger)c { - return [[[self alloc] initWithString:string charMapFile:charmapfile itemWidth:w itemHeight:h startCharMap:c] autorelease]; + return [[self alloc] initWithString:string charMapFile:charmapfile itemWidth:w itemHeight:h startCharMap:c]; } +(id) labelWithString:(NSString*)string fntFile:(NSString*)fntFile { - return [[[self alloc] initWithString:string fntFile:fntFile] autorelease]; + return [[self alloc] initWithString:string fntFile:fntFile]; } -(id) initWithString:(NSString*) theString fntFile:(NSString*)fntFile { - NSDictionary *dict = [NSDictionary dictionaryWithContentsOfFile:[[CCFileUtils sharedFileUtils] fullPathFromRelativePath:fntFile]]; + NSDictionary *dict = [NSDictionary dictionaryWithContentsOfFile:[[CCFileUtils sharedFileUtils] fullPathForFilename:fntFile]]; NSAssert( [[dict objectForKey:@"version"] intValue] == 1, @"Unsupported version. Upgrade cocos2d version"); - NSString *textureFilename = [dict objectForKey:@"textureFilename"]; + // obtain the path, and prepend it + NSString *path = [fntFile stringByDeletingLastPathComponent]; + NSString *textureFilename = [path stringByAppendingPathComponent:[dict objectForKey:@"textureFilename"]]; + NSUInteger width = [[dict objectForKey:@"itemWidth"] unsignedIntValue] / CC_CONTENT_SCALE_FACTOR(); NSUInteger height = [[dict objectForKey:@"itemHeight"] unsignedIntValue] / CC_CONTENT_SCALE_FACTOR(); NSUInteger startChar = [[dict objectForKey:@"firstChar"] unsignedIntValue]; @@ -71,46 +75,46 @@ -(id) initWithString:(NSString*) theString fntFile:(NSString*)fntFile startCharMap:startChar]; } --(id) initWithString:(NSString*) theString charMapFile: (NSString*) charmapfile itemWidth:(NSUInteger)w itemHeight:(NSUInteger)h startCharMap:(NSUInteger)c +-(id) initWithString:(NSString*)string charMapFile: (NSString*)filename itemWidth:(NSUInteger)w itemHeight:(NSUInteger)h startCharMap:(NSUInteger)c { - if ((self=[super initWithTileFile:charmapfile tileWidth:w tileHeight:h itemsToRender:[theString length] ]) ) { + CCTexture2D *texture = [[CCTextureCache sharedTextureCache] addImage:filename]; + return [self initWithString:string texture:texture itemWidth:w itemHeight:h startCharMap:c]; +} - mapStartChar_ = c; +-(id) initWithString:(NSString*) theString texture:(CCTexture2D*)texture itemWidth:(NSUInteger)w itemHeight:(NSUInteger)h startCharMap:(NSUInteger)c +{ + if ((self=[super initWithTexture:texture tileWidth:w tileHeight:h itemsToRender:[theString length] ]) ) { + + _mapStartChar = c; [self setString: theString]; } - + return self; } --(void) dealloc -{ - [string_ release]; - - [super dealloc]; -} #pragma mark CCLabelAtlas - Atlas generation -(void) updateAtlasValues { - NSUInteger n = [string_ length]; + NSUInteger n = [_string length]; ccV3F_C4B_T2F_Quad quad; - const unsigned char *s = (unsigned char*) [string_ UTF8String]; + const unsigned char *s = (unsigned char*) [_string UTF8String]; - CCTexture2D *texture = [textureAtlas_ texture]; + CCTexture2D *texture = [_textureAtlas texture]; float textureWide = [texture pixelsWide]; float textureHigh = [texture pixelsHigh]; - float itemWidthInPixels = itemWidth_ * CC_CONTENT_SCALE_FACTOR(); - float itemHeightInPixels = itemHeight_ * CC_CONTENT_SCALE_FACTOR(); + float itemWidthInPixels = _itemWidth * CC_CONTENT_SCALE_FACTOR(); + float itemHeightInPixels = _itemHeight * CC_CONTENT_SCALE_FACTOR(); for( NSUInteger i=0; i textureAtlas_.capacity ) - [textureAtlas_ resizeCapacity:len]; + if( len > _textureAtlas.capacity ) + [_textureAtlas resizeCapacity:len]; - [string_ release]; - string_ = [newString copy]; + _string = [newString copy]; [self updateAtlasValues]; - CGSize s = CGSizeMake(len * itemWidth_, itemHeight_); + CGSize s = CGSizeMake(len * _itemWidth, _itemHeight); [self setContentSize:s]; self.quadsToDraw = len; @@ -182,7 +185,7 @@ - (void) setString:(NSString*) newString -(NSString*) string { - return string_; + return _string; } #pragma mark CCLabelAtlas - DebugDraw diff --git a/cocos2d/CCLabelBMFont.h b/cocos2d/CCLabelBMFont.h new file mode 100644 index 0000000..9757953 --- /dev/null +++ b/cocos2d/CCLabelBMFont.h @@ -0,0 +1,240 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2008-2010 Ricardo Quesada + * Copyright (c) 2011 Zynga Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * Portions of this code are based and inspired on: + * http://www.71squared.co.uk/2009/04/iphone-game-programming-tutorial-4-bitmap-font-class + * by Michael Daley + * + * Use any of these editors to generate BMFonts: + * http://glyphdesigner.71squared.com/ (Commercial, Mac OS X) + * http://www.n4te.com/hiero/hiero.jnlp (Free, Java) + * http://slick.cokeandcode.com/demos/hiero.jnlp (Free, Java) + * http://www.angelcode.com/products/bmfont/ (Free, Windows only) + */ + +#import "CCSpriteBatchNode.h" +#import "Support/uthash.h" + +enum { + kCCLabelAutomaticWidth = -1, +}; + +/** @struct ccBMFontDef + BMFont definition + */ +typedef struct _BMFontDef { + //! ID of the character + unichar charID; + //! origin and size of the font + CGRect rect; + //! The X amount the image should be offset when drawing the image (in pixels) + short xOffset; + //! The Y amount the image should be offset when drawing the image (in pixels) + short yOffset; + //! The amount to move the current position after drawing the character (in pixels) + short xAdvance; +} ccBMFontDef; + +/** @struct ccBMFontPadding + BMFont padding + @since v0.8.2 + */ +typedef struct _BMFontPadding { + /// padding left + int left; + /// padding top + int top; + /// padding right + int right; + /// padding bottom + int bottom; +} ccBMFontPadding; + +#pragma mark - Hash Element +typedef struct _FontDefHashElement +{ + NSUInteger key; // key. Font Unicode value + ccBMFontDef fontDef; // font definition + UT_hash_handle hh; +} tCCFontDefHashElement; + +// Equal function for targetSet. +typedef struct _KerningHashElement +{ + int key; // key for the hash. 16-bit for 1st element, 16-bit for 2nd element + int amount; + UT_hash_handle hh; +} tCCKerningHashElement; +#pragma mark - + +/** CCBMFontConfiguration has parsed configuration of the the .fnt file + @since v0.8 + */ +@interface CCBMFontConfiguration : NSObject +{ + // Character Set defines the letters that actually exist in the font + NSCharacterSet *_characterSet; + + // atlas name + NSString *_atlasName; + + // XXX: Creating a public interface so that the bitmapFontArray[] is accessible +@public + + // BMFont definitions + tCCFontDefHashElement *_fontDefDictionary; + + // FNTConfig: Common Height. Should be signed (issue #1343) + NSInteger _commonHeight; + + // Padding + ccBMFontPadding _padding; + + // values for kerning + tCCKerningHashElement *_kerningDictionary; +} + +// Character set +@property (nonatomic, readonly) NSCharacterSet *characterSet; + +// atlasName +@property (nonatomic, readwrite, strong) NSString *atlasName; + +/** allocates a CCBMFontConfiguration with a FNT file */ ++(id) configurationWithFNTFile:(NSString*)FNTfile; +/** initializes a CCBMFontConfiguration with a FNT file */ +-(id) initWithFNTfile:(NSString*)FNTfile; +@end + + +/** CCLabelBMFont is a subclass of CCSpriteBatchNode + + Features: + - Treats each character like a CCSprite. This means that each individual character can be: + - rotated + - scaled + - translated + - tinted + - chage the opacity + - It can be used as part of a menu item. + - anchorPoint can be used to align the "label" + - Supports AngelCode text format + + Limitations: + - All inner characters are using an anchorPoint of (0.5f, 0.5f) and it is not recommend to change it + because it might affect the rendering + + CCLabelBMFont implements the protocol CCLabelProtocol, like CCLabel and CCLabelAtlas. + CCLabelBMFont has the flexibility of CCLabel, the speed of CCLabelAtlas and all the features of CCSprite. + If in doubt, use CCLabelBMFont instead of CCLabelAtlas / CCLabel. + + Supported editors: + - http://glyphdesigner.71squared.com/ + - http://www.bmglyph.com/ + - http://www.n4te.com/hiero/hiero.jnlp + - http://slick.cokeandcode.com/demos/hiero.jnlp + - http://www.angelcode.com/products/bmfont/ + + @since v0.8 + */ + +@interface CCLabelBMFont : CCSpriteBatchNode +{ + // string to render + NSString *_string; + + // name of fntFile + NSString *_fntFile; + + // initial string without line breaks + NSString *_initialString; + // max width until a line break is added + float _width; + // alignment of all lines + CCTextAlignment _alignment; + + CCBMFontConfiguration *_configuration; + + // texture RGBA + GLubyte _displayedOpacity, _realOpacity; + ccColor3B _displayedColor, _realColor; + BOOL _cascadeOpacityEnabled, _cascadeColorEnabled; + BOOL _opacityModifyRGB; + + // offset of the texture atlas + CGPoint _imageOffset; + + // reused char + CCSprite *_reusedChar; +} + +/** Purges the cached data. + Removes from memory the cached configurations and the atlas name dictionary. + @since v0.99.3 + */ ++(void) purgeCachedData; + +/** alignment used for the label */ +@property (nonatomic,readonly) CCTextAlignment alignment; +/** fntFile used for the font */ +@property (nonatomic,strong) NSString* fntFile; +/** conforms to CCRGBAProtocol protocol */ +@property (nonatomic,readwrite) GLubyte opacity; +/** conforms to CCRGBAProtocol protocol */ +@property (nonatomic,readwrite) ccColor3B color; + + +/** creates a BMFont label with an initial string and the FNT file. */ ++(id) labelWithString:(NSString*)string fntFile:(NSString*)fntFile; +/** creates a BMFont label with an initial string, the FNT file, width, and alignment option */ ++(id) labelWithString:(NSString*)string fntFile:(NSString*)fntFile width:(float)width alignment:(CCTextAlignment)alignment; +/** creates a BMFont label with an initial string, the FNT file, width, alignment option and the offset of where the glyphs start on the .PNG image */ ++(id) labelWithString:(NSString*)string fntFile:(NSString*)fntFile width:(float)width alignment:(CCTextAlignment)alignment imageOffset:(CGPoint)offset; + +/** init a BMFont label with an initial string and the FNT file */ +-(id) initWithString:(NSString*)string fntFile:(NSString*)fntFile; +/** init a BMFont label with an initial string and the FNT file, width, and alignment option*/ +-(id) initWithString:(NSString*)string fntFile:(NSString*)fntFile width:(float)width alignment:(CCTextAlignment)alignment; +/** init a BMFont label with an initial string and the FNT file, width, alignment option and the offset of where the glyphs start on the .PNG image */ +-(id) initWithString:(NSString*)string fntFile:(NSString*)fntFile width:(float)width alignment:(CCTextAlignment)alignment imageOffset:(CGPoint)offset; + +/** updates the font chars based on the string to render */ +-(void) createFontChars; + +/** set label width */ +- (void)setWidth:(float)width; + +/** set label alignment */ +- (void)setAlignment:(CCTextAlignment)alignment; + +@end + +/** Free function that parses a FNT file a place it on the cache + */ +CCBMFontConfiguration * FNTConfigLoadFile( NSString *file ); +/** Purges the FNT config cache + */ +void FNTConfigRemoveCache( void ); + + diff --git a/src/cocos2d/CCLabelBMFont.m b/cocos2d/CCLabelBMFont.m similarity index 66% rename from src/cocos2d/CCLabelBMFont.m rename to cocos2d/CCLabelBMFont.m index 6fd2cca..9d542ef 100644 --- a/src/cocos2d/CCLabelBMFont.m +++ b/cocos2d/CCLabelBMFont.m @@ -48,21 +48,21 @@ #pragma mark - #pragma mark FNTConfig Cache - free functions -NSMutableDictionary *configurations = nil; +static NSMutableDictionary *configurations = nil; CCBMFontConfiguration* FNTConfigLoadFile( NSString *fntFile) { CCBMFontConfiguration *ret = nil; - + if( configurations == nil ) - configurations = [[NSMutableDictionary dictionaryWithCapacity:3] retain]; - + configurations = [NSMutableDictionary dictionaryWithCapacity:3]; + ret = [configurations objectForKey:fntFile]; if( ret == nil ) { ret = [CCBMFontConfiguration configurationWithFNTFile:fntFile]; if( ret ) [configurations setObject:ret forKey:fntFile]; } - + return ret; } @@ -75,7 +75,7 @@ void FNTConfigRemoveCache( void ) #pragma mark BitmapFontConfiguration @interface CCBMFontConfiguration () --(BOOL) parseConfigFile:(NSString*)controlFile; +-(NSMutableString *) parseConfigFile:(NSString*)controlFile; -(void) parseCharacterDefinition:(NSString*)line charDef:(ccBMFontDef*)characterDefinition; -(void) parseInfoArguments:(NSString*)line; -(void) parseCommonArguments:(NSString*)line; @@ -89,24 +89,28 @@ -(void) purgeFontDefDictionary; #pragma mark CCBMFontConfiguration @implementation CCBMFontConfiguration -@synthesize atlasName=atlasName_; +@synthesize characterSet=_characterSet; +@synthesize atlasName=_atlasName; +(id) configurationWithFNTFile:(NSString*)FNTfile { - return [[[self alloc] initWithFNTfile:FNTfile] autorelease]; + return [[self alloc] initWithFNTfile:FNTfile]; } -(id) initWithFNTfile:(NSString*)fntFile { if((self=[super init])) { - - kerningDictionary_ = NULL; - fontDefDictionary_ = NULL; - - if( ! [self parseConfigFile:fntFile] ) { - [self release]; + + _kerningDictionary = NULL; + _fontDefDictionary = NULL; + + NSMutableString *validCharsString = [self parseConfigFile:fntFile]; + + if( ! validCharsString ) { return nil; } + + _characterSet = [NSCharacterSet characterSetWithCharactersInString:validCharsString]; } return self; } @@ -116,67 +120,67 @@ - (void) dealloc CCLOGINFO( @"cocos2d: deallocing %@", self); [self purgeFontDefDictionary]; [self purgeKerningDictionary]; - [atlasName_ release]; - [super dealloc]; } - (NSString*) description { return [NSString stringWithFormat:@"<%@ = %p | Glphys:%d Kernings:%d | Image = %@>", [self class], self, - HASH_COUNT(fontDefDictionary_), - HASH_COUNT(kerningDictionary_), - atlasName_]; + HASH_COUNT(_fontDefDictionary), + HASH_COUNT(_kerningDictionary), + _atlasName]; } -(void) purgeFontDefDictionary { - tFontDefHashElement *current, *tmp; + tCCFontDefHashElement *current, *tmp; - HASH_ITER(hh, fontDefDictionary_, current, tmp) { - HASH_DEL(fontDefDictionary_, current); + HASH_ITER(hh, _fontDefDictionary, current, tmp) { + HASH_DEL(_fontDefDictionary, current); free(current); } } -(void) purgeKerningDictionary { - tKerningHashElement *current; - - while(kerningDictionary_) { - current = kerningDictionary_; - HASH_DEL(kerningDictionary_,current); + tCCKerningHashElement *current; + + while(_kerningDictionary) { + current = _kerningDictionary; + HASH_DEL(_kerningDictionary,current); free(current); } } -- (BOOL)parseConfigFile:(NSString*)fntFile +- (NSMutableString *)parseConfigFile:(NSString*)fntFile { - NSString *fullpath = [[CCFileUtils sharedFileUtils] fullPathFromRelativePath:fntFile]; + NSString *fullpath = [[CCFileUtils sharedFileUtils] fullPathForFilename:fntFile]; NSError *error; NSString *contents = [NSString stringWithContentsOfFile:fullpath encoding:NSUTF8StringEncoding error:&error]; - + + NSMutableString *validCharsString = [[NSMutableString alloc] initWithCapacity:512]; + if( ! contents ) { NSLog(@"cocos2d: Error parsing FNTfile %@: %@", fntFile, error); - return NO; + return nil; } - + // Move all lines in the string, which are denoted by \n, into an array NSArray *lines = [[NSArray alloc] initWithArray:[contents componentsSeparatedByString:@"\n"]]; - + // Create an enumerator which we can use to move through the lines read from the control file NSEnumerator *nse = [lines objectEnumerator]; - + // Create a holder for each line we are going to work with NSString *line; - + // Loop through all the lines in the lines array processing each one while( (line = [nse nextObject]) ) { // parse spacing / padding if([line hasPrefix:@"info face"]) { // XXX: info parsing is incomplete // Not needed for the Hiero editors, but needed for the AngelCode editor - // [self parseInfoArguments:line]; +// [self parseInfoArguments:line]; } // Check to see if the start of the line is something we are interested in else if([line hasPrefix:@"common lineHeight"]) { @@ -190,12 +194,14 @@ - (BOOL)parseConfigFile:(NSString*)fntFile } else if([line hasPrefix:@"char"]) { // Parse the current line and create a new CharDef - tFontDefHashElement *element = malloc( sizeof(*element) ); + tCCFontDefHashElement *element = malloc( sizeof(*element) ); [self parseCharacterDefinition:line charDef:&element->fontDef]; element->key = element->fontDef.charID; - HASH_ADD_INT(fontDefDictionary_, key, element); + HASH_ADD_INT(_fontDefDictionary, key, element); + + [validCharsString appendString:[NSString stringWithFormat:@"%C", element->fontDef.charID]]; } // else if([line hasPrefix:@"kernings count"]) { // [self parseKerningCapacity:line]; @@ -205,39 +211,37 @@ - (BOOL)parseConfigFile:(NSString*)fntFile } } // Finished with lines so release it - [lines release]; - return YES; + return validCharsString; } -(void) parseImageFileName:(NSString*)line fntFile:(NSString*)fntFile { NSString *propertyValue = nil; - + // Break the values for this line up using = NSArray *values = [line componentsSeparatedByString:@"="]; - + // Get the enumerator for the array of components which has been created NSEnumerator *nse = [values objectEnumerator]; - + // We need to move past the first entry in the array before we start assigning values [nse nextObject]; - + // page ID. Sanity check propertyValue = [nse nextObject]; NSAssert( [propertyValue intValue] == 0, @"XXX: LabelBMFont only supports 1 page"); - + // file propertyValue = [nse nextObject]; NSArray *array = [propertyValue componentsSeparatedByString:@"\""]; propertyValue = [array objectAtIndex:1]; NSAssert(propertyValue,@"LabelBMFont file could not be found"); - + // Supports subdirectories NSString *dir = [fntFile stringByDeletingLastPathComponent]; - atlasName_ = [dir stringByAppendingPathComponent:propertyValue]; - - [atlasName_ retain]; + _atlasName = [dir stringByAppendingPathComponent:propertyValue]; + } -(void) parseInfoArguments:(NSString*)line @@ -250,62 +254,62 @@ -(void) parseInfoArguments:(NSString*)line NSArray *values = [line componentsSeparatedByString:@"="]; NSEnumerator *nse = [values objectEnumerator]; NSString *propertyValue = nil; - + // We need to move past the first entry in the array before we start assigning values [nse nextObject]; - + // face (ignore) [nse nextObject]; - + // size (ignore) [nse nextObject]; - + // bold (ignore) [nse nextObject]; - + // italic (ignore) [nse nextObject]; - + // charset (ignore) [nse nextObject]; - + // unicode (ignore) [nse nextObject]; - + // strechH (ignore) [nse nextObject]; - + // smooth (ignore) [nse nextObject]; - + // aa (ignore) [nse nextObject]; - + // padding (ignore) propertyValue = [nse nextObject]; { - + NSArray *paddingValues = [propertyValue componentsSeparatedByString:@","]; NSEnumerator *paddingEnum = [paddingValues objectEnumerator]; // padding top propertyValue = [paddingEnum nextObject]; - padding_.top = [propertyValue intValue]; - + _padding.top = [propertyValue intValue]; + // padding right propertyValue = [paddingEnum nextObject]; - padding_.right = [propertyValue intValue]; - + _padding.right = [propertyValue intValue]; + // padding bottom propertyValue = [paddingEnum nextObject]; - padding_.bottom = [propertyValue intValue]; - + _padding.bottom = [propertyValue intValue]; + // padding left propertyValue = [paddingEnum nextObject]; - padding_.left = [propertyValue intValue]; - - CCLOG(@"cocos2d: padding: %d,%d,%d,%d", padding_.left, padding_.top, padding_.right, padding_.bottom); + _padding.left = [propertyValue intValue]; + + CCLOG(@"cocos2d: padding: %d,%d,%d,%d", _padding.left, _padding.top, _padding.right, _padding.bottom); } - + // spacing (ignore) [nse nextObject]; } @@ -319,30 +323,30 @@ -(void) parseCommonArguments:(NSString*)line NSArray *values = [line componentsSeparatedByString:@"="]; NSEnumerator *nse = [values objectEnumerator]; NSString *propertyValue = nil; - + // We need to move past the first entry in the array before we start assigning values [nse nextObject]; - + // Character ID propertyValue = [nse nextObject]; - commonHeight_ = [propertyValue intValue]; - + _commonHeight = [propertyValue intValue]; + // base (ignore) [nse nextObject]; - - + + // scaleW. sanity check propertyValue = [nse nextObject]; NSAssert( [propertyValue intValue] <= [[CCConfiguration sharedConfiguration] maxTextureSize], @"CCLabelBMFont: page can't be larger than supported"); - + // scaleH. sanity check propertyValue = [nse nextObject]; NSAssert( [propertyValue intValue] <= [[CCConfiguration sharedConfiguration] maxTextureSize], @"CCLabelBMFont: page can't be larger than supported"); - + // pages. sanity check propertyValue = [nse nextObject]; NSAssert( [propertyValue intValue] == 1, @"CCBitfontAtlas: only supports 1 page"); - + // packed (ignore) What does this mean ?? } - (void)parseCharacterDefinition:(NSString*)line charDef:(ccBMFontDef*)characterDefinition @@ -351,15 +355,15 @@ - (void)parseCharacterDefinition:(NSString*)line charDef:(ccBMFontDef*)character NSArray *values = [line componentsSeparatedByString:@"="]; NSEnumerator *nse = [values objectEnumerator]; NSString *propertyValue; - + // We need to move past the first entry in the array before we start assigning values [nse nextObject]; - + // Character ID propertyValue = [nse nextObject]; propertyValue = [propertyValue substringToIndex: [propertyValue rangeOfString: @" "].location]; characterDefinition->charID = [propertyValue intValue]; - + // Character x propertyValue = [nse nextObject]; characterDefinition->rect.origin.x = [propertyValue intValue]; @@ -388,26 +392,26 @@ -(void) parseKerningEntry:(NSString*) line NSArray *values = [line componentsSeparatedByString:@"="]; NSEnumerator *nse = [values objectEnumerator]; NSString *propertyValue; - + // We need to move past the first entry in the array before we start assigning values [nse nextObject]; - + // first propertyValue = [nse nextObject]; int first = [propertyValue intValue]; - + // second propertyValue = [nse nextObject]; int second = [propertyValue intValue]; - + // second propertyValue = [nse nextObject]; int amount = [propertyValue intValue]; - - tKerningHashElement *element = calloc( sizeof( *element ), 1 ); + + tCCKerningHashElement *element = calloc( sizeof( *element ), 1 ); element->amount = amount; element->key = (first<<16) | (second&0xffff); - HASH_ADD_INT(kerningDictionary_,key, element); + HASH_ADD_INT(_kerningDictionary,key, element); } @end @@ -428,9 +432,8 @@ -(void) setString:(NSString*) newString updateLabel:(BOOL)update; @implementation CCLabelBMFont -@synthesize alignment = alignment_; -@synthesize opacity = opacity_, color = color_; - +@synthesize alignment = _alignment; +@synthesize cascadeColorEnabled = _cascadeColorEnabled, cascadeOpacityEnabled = _cascadeOpacityEnabled; #pragma mark LabelBMFont - Purge Cache +(void) purgeCachedData @@ -442,17 +445,17 @@ +(void) purgeCachedData +(id) labelWithString:(NSString *)string fntFile:(NSString *)fntFile { - return [[[self alloc] initWithString:string fntFile:fntFile width:kCCLabelAutomaticWidth alignment:kCCTextAlignmentLeft imageOffset:CGPointZero] autorelease]; + return [[self alloc] initWithString:string fntFile:fntFile width:kCCLabelAutomaticWidth alignment:kCCTextAlignmentLeft imageOffset:CGPointZero]; } +(id) labelWithString:(NSString*)string fntFile:(NSString*)fntFile width:(float)width alignment:(CCTextAlignment)alignment { - return [[[self alloc] initWithString:string fntFile:fntFile width:width alignment:alignment imageOffset:CGPointZero] autorelease]; + return [[self alloc] initWithString:string fntFile:fntFile width:width alignment:alignment imageOffset:CGPointZero]; } +(id) labelWithString:(NSString*)string fntFile:(NSString*)fntFile width:(float)width alignment:(CCTextAlignment)alignment imageOffset:(CGPoint)offset { - return [[[self alloc] initWithString:string fntFile:fntFile width:width alignment:alignment imageOffset:offset] autorelease]; + return [[self alloc] initWithString:string fntFile:fntFile width:width alignment:alignment imageOffset:offset]; } -(id) init @@ -473,83 +476,93 @@ -(id) initWithString:(NSString*)theString fntFile:(NSString*)fntFile width:(floa // designated initializer -(id) initWithString:(NSString*)theString fntFile:(NSString*)fntFile width:(float)width alignment:(CCTextAlignment)alignment imageOffset:(CGPoint)offset { - NSAssert(!configuration_, @"re-init is no longer supported"); + NSAssert(!_configuration, @"re-init is no longer supported"); // if theString && fntfile are both nil, then it is OK NSAssert( (theString && fntFile) || (theString==nil && fntFile==nil), @"Invalid params for CCLabelBMFont"); CCTexture2D *texture = nil; - + if( fntFile ) { CCBMFontConfiguration *newConf = FNTConfigLoadFile(fntFile); - NSAssert( newConf, @"CCLabelBMFont: Impossible to create font. Please check file: '%@'", fntFile ); - - configuration_ = [newConf retain]; - - fntFile_ = [fntFile retain]; - - texture = [[CCTextureCache sharedTextureCache] addImage:configuration_.atlasName]; - + if(!newConf) { + CCLOGWARN(@"cocos2d: WARNING. CCLabelBMFont: Impossible to create font. Please check file: '%@'", fntFile ); + return nil; + } + + _configuration = newConf; + _fntFile = [fntFile copy]; + + texture = [[CCTextureCache sharedTextureCache] addImage:_configuration.atlasName]; + } else - texture = [[[CCTexture2D alloc] init] autorelease]; - + texture = [[CCTexture2D alloc] init]; + + + if ( (self=[super initWithTexture:texture capacity:[theString length]]) ) { + _width = width; + _alignment = alignment; - if( (self=[super initWithTexture:texture capacity:[theString length]]) ) { - width_ = width; - alignment_ = alignment; + _displayedOpacity = _realOpacity = 255; + _displayedColor = _realColor = ccWHITE; + _cascadeOpacityEnabled = YES; + _cascadeColorEnabled = YES; - opacity_ = 255; - color_ = ccWHITE; + _contentSize = CGSizeZero; - contentSize_ = CGSizeZero; + _opacityModifyRGB = [[_textureAtlas texture] hasPremultipliedAlpha]; - opacityModifyRGB_ = [[textureAtlas_ texture] hasPremultipliedAlpha]; - - anchorPoint_ = ccp(0.5f, 0.5f); - - imageOffset_ = offset; + _anchorPoint = ccp(0.5f, 0.5f); + + _imageOffset = offset; + + _reusedChar = [[CCSprite alloc] initWithTexture:_textureAtlas.texture rect:CGRectMake(0, 0, 0, 0) rotated:NO]; + [_reusedChar setBatchNode:self]; [self setString:theString updateLabel:YES]; } - + return self; } --(void) dealloc -{ - [string_ release]; - [initialString_ release]; - [configuration_ release]; - [fntFile_ release]; - - [super dealloc]; -} #pragma mark LabelBMFont - Alignment +#pragma clang diagnostic push COCOS2D +#pragma clang diagnostic ignored "-Wfloat-equal" - (void)updateLabel { - [self setString:initialString_ updateLabel:NO]; + [self setString:_initialString updateLabel:NO]; - if (width_ > 0){ + if (_width > 0) + { //Step 1: Make multiline NSString *multilineString = @"", *lastWord = @""; - int line = 1, i = 0; - NSUInteger stringLength = [self.string length]; + NSInteger line = 1, i = 0; + NSInteger stringLength = [self.string length]; float startOfLine = -1, startOfWord = -1; int skip = 0; //Go through each character and insert line breaks as necessary - for (int j = 0; j < [children_ count]; j++) { + for (NSUInteger j = 0; j < [_children count]; j++) + { CCSprite *characterSprite; + int justSkipped = 0; + while(!(characterSprite = (CCSprite *)[self getChildByTag:j+skip+justSkipped])) + { + justSkipped++; + } + skip += justSkipped; - while(!(characterSprite = (CCSprite *)[self getChildByTag:j+skip])) - skip++; - - if (!characterSprite.visible) continue; + if (!characterSprite.visible) + { + continue; + } if (i >= stringLength || i < 0) + { break; + } unichar character = [self.string characterAtIndex:i]; @@ -561,30 +574,39 @@ - (void)updateLabel //Character is a line break //Put lastWord on the current line and start a new line //Reset lastWord - if ([[NSCharacterSet newlineCharacterSet] characterIsMember:character]) { - lastWord = [[lastWord stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]] stringByAppendingFormat:@"%C", character]; + if ([[NSCharacterSet newlineCharacterSet] characterIsMember:character]) + { + lastWord = [lastWord stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]]; + lastWord = [lastWord stringByPaddingToLength:[lastWord length] + justSkipped withString:[NSString stringWithFormat:@"%C", character] startingAtIndex:0]; multilineString = [multilineString stringByAppendingString:lastWord]; lastWord = @""; startOfWord = -1; line++; startOfLine = -1; - i++; + i+=justSkipped; //CCLabelBMFont do not have a character for new lines, so do NOT "continue;" in the for loop. Process the next character if (i >= stringLength || i < 0) + { break; + } character = [self.string characterAtIndex:i]; if (startOfWord == -1) + { startOfWord = characterSprite.position.x - characterSprite.contentSize.width/2; + } if (startOfLine == -1) + { startOfLine = startOfWord; + } } //Character is a whitespace //Put lastWord on current line and continue on current line //Reset lastWord - if ([[NSCharacterSet whitespaceCharacterSet] characterIsMember:character]) { + if ([[NSCharacterSet whitespaceCharacterSet] characterIsMember:character]) + { lastWord = [lastWord stringByAppendingFormat:@"%C", character]; multilineString = [multilineString stringByAppendingString:lastWord]; lastWord = @""; @@ -596,7 +618,8 @@ - (void)updateLabel //Character is out of bounds //Do not put lastWord on current line. Add "\n" to current line to start a new line //Append to lastWord - if (characterSprite.position.x + characterSprite.contentSize.width/2 - startOfLine > width_) { + if (characterSprite.position.x + characterSprite.contentSize.width/2 - startOfLine > _width) + { lastWord = [lastWord stringByAppendingFormat:@"%C", character]; NSString *trimmedString = [multilineString stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]]; multilineString = [trimmedString stringByAppendingString:@"\n"]; @@ -604,7 +627,9 @@ - (void)updateLabel startOfLine = -1; i++; continue; - } else { + } + else + { //Character is normal //Append to lastWord lastWord = [lastWord stringByAppendingFormat:@"%C", character]; @@ -620,20 +645,22 @@ - (void)updateLabel //Step 2: Make alignment - if (self.alignment != kCCTextAlignmentLeft) { - + if (self.alignment != kCCTextAlignmentLeft) + { int i = 0; //Number of spaces skipped int lineNumber = 0; //Go through line by line - for (NSString *lineString in [string_ componentsSeparatedByCharactersInSet:[NSCharacterSet newlineCharacterSet]]) { + for (NSString *lineString in [_string componentsSeparatedByCharactersInSet:[NSCharacterSet newlineCharacterSet]]) + { int lineWidth = 0; //Find index of last character in this line NSInteger index = i + [lineString length] - 1 + lineNumber; if (index < 0) + { continue; - + } //Find position of last character on the line CCSprite *lastChar = (CCSprite *)[self getChildByTag:index]; @@ -641,20 +668,23 @@ - (void)updateLabel //Figure out how much to shift each character in this line horizontally float shift = 0; - switch (self.alignment) { + switch (self.alignment) + { case kCCTextAlignmentCenter: shift = self.contentSize.width/2 - lineWidth/2; break; case kCCTextAlignmentRight: shift = self.contentSize.width - lineWidth; - default: + case kCCTextAlignmentLeft: break; } - if (shift != 0) { - int j = 0; + if (shift != 0) + { + NSUInteger j = 0; //For each character, shift it so that the line is center aligned - for (j = 0; j < [lineString length]; j++) { + for (j = 0; j < [lineString length]; j++) + { index = i + j + lineNumber; if (index < 0) continue; @@ -667,6 +697,7 @@ - (void)updateLabel } } } +#pragma clang diagnostic pop COCOS2D #pragma mark LabelBMFont - Atlas generation @@ -674,14 +705,14 @@ -(int) kerningAmountForFirst:(unichar)first second:(unichar)second { int ret = 0; unsigned int key = (first<<16) | (second & 0xffff); - - if( configuration_->kerningDictionary_ ) { - tKerningHashElement *element = NULL; - HASH_FIND_INT(configuration_->kerningDictionary_, &key, element); + + if( _configuration->_kerningDictionary ) { + tCCKerningHashElement *element = NULL; + HASH_FIND_INT(_configuration->_kerningDictionary, &key, element); if(element) ret = element->amount; } - + return ret; } @@ -691,75 +722,108 @@ -(void) createFontChars NSInteger nextFontPositionY = 0; unichar prev = -1; NSInteger kerningAmount = 0; - + CGSize tmpSize = CGSizeZero; - + NSInteger longestLine = 0; NSUInteger totalHeight = 0; - + NSUInteger quantityOfLines = 1; - - NSUInteger stringLen = [string_ length]; + + NSCharacterSet *charSet = _configuration.characterSet; + + NSUInteger stringLen = [_string length]; if( ! stringLen ) return; - + // quantity of lines NEEDS to be calculated before parsing the lines, // since the Y position needs to be calcualted before hand for(NSUInteger i=0; i < stringLen-1;i++) { - unichar c = [string_ characterAtIndex:i]; + unichar c = [_string characterAtIndex:i]; if( c=='\n') quantityOfLines++; } - - totalHeight = configuration_->commonHeight_ * quantityOfLines; - nextFontPositionY = -(configuration_->commonHeight_ - configuration_->commonHeight_*quantityOfLines); + + totalHeight = _configuration->_commonHeight * quantityOfLines; + nextFontPositionY = -(_configuration->_commonHeight - _configuration->_commonHeight*quantityOfLines); + CGRect rect; + ccBMFontDef fontDef; for(NSUInteger i = 0; icommonHeight_; + nextFontPositionY -= _configuration->_commonHeight; continue; } - + + if(![charSet characterIsMember:c]){ + CCLOGWARN(@"cocos2d: CCLabelBMFont: Attempted to use character not defined in this bitmap: %C", c); + continue; + } + kerningAmount = [self kerningAmountForFirst:prev second:c]; - - tFontDefHashElement *element = NULL; + tCCFontDefHashElement *element = NULL; // unichar is a short, and an int is needed on HASH_FIND_INT NSUInteger key = (NSUInteger)c; - HASH_FIND_INT(configuration_->fontDefDictionary_ , &key, element); - NSAssert(element, @"FontDefinition could not be found!"); - - ccBMFontDef fontDef = element->fontDef; - - CGRect rect = fontDef.rect; + HASH_FIND_INT(_configuration->_fontDefDictionary , &key, element); + if( ! element ) { + CCLOGWARN(@"cocos2d: CCLabelBMFont: characer not found %c", c); + continue; + } + + fontDef = element->fontDef; + + rect = fontDef.rect; rect = CC_RECT_PIXELS_TO_POINTS(rect); - rect.origin.x += imageOffset_.x; - rect.origin.y += imageOffset_.y; - + rect.origin.x += _imageOffset.x; + rect.origin.y += _imageOffset.y; + CCSprite *fontChar; + BOOL hasSprite = YES; fontChar = (CCSprite*) [self getChildByTag:i]; - if( ! fontChar ) { - fontChar = [[CCSprite alloc] initWithTexture:textureAtlas_.texture rect:rect]; - [self addChild:fontChar z:0 tag:i]; - [fontChar release]; + if( fontChar ) + { + // Reusing previous Sprite + fontChar.visible = YES; } - else { - // reusing fonts - [fontChar setTextureRect:rect rotated:NO untrimmedSize:rect.size]; + else + { + // New Sprite ? Set correct color, opacity, etc... + if( 0 ) { + /* WIP: Doesn't support many features yet. + But this code is super fast. It doesn't create any sprite. + Ideal for big labels. + */ + + //TODO: Super fast because it does not get executed... ever... "if( 0 )" +// fontChar = _reusedChar; +// fontChar.batchNode = nil; +// hasSprite = NO; + } else { + fontChar = [[CCSprite alloc] initWithTexture:_textureAtlas.texture rect:rect]; + [self addChild:fontChar z:i tag:i]; + } + + // Apply label properties + [fontChar setOpacityModifyRGB:_opacityModifyRGB]; - // restore to default in case they were modified - fontChar.visible = YES; - fontChar.opacity = 255; + // Color MUST be set before opacity, since opacity might change color if OpacityModifyRGB is on + [fontChar updateDisplayedColor:_displayedColor]; + [fontChar updateDisplayedOpacity:_displayedOpacity]; } + // updating previous sprite + [fontChar setTextureRect:rect rotated:NO untrimmedSize:rect.size]; + + // See issue 1343. cast( signed short + unsigned integer ) == unsigned integer (sign is lost!) - NSInteger yOffset = configuration_->commonHeight_ - fontDef.yOffset; + NSInteger yOffset = _configuration->_commonHeight - fontDef.yOffset; CGPoint fontPos = ccp( (CGFloat)nextFontPositionX + fontDef.xOffset + fontDef.rect.size.width*0.5f + kerningAmount, (CGFloat)nextFontPositionY + yOffset - rect.size.height*0.5f * CC_CONTENT_SCALE_FACTOR() ); fontChar.position = CC_POINT_PIXELS_TO_POINTS(fontPos); @@ -767,31 +831,32 @@ -(void) createFontChars // update kerning nextFontPositionX += fontDef.xAdvance + kerningAmount; prev = c; - - // Apply label properties - [fontChar setOpacityModifyRGB:opacityModifyRGB_]; - // Color MUST be set before opacity, since opacity might change color if OpacityModifyRGB is on - [fontChar setColor:color_]; - - // only apply opacity if it is different than 255 ) - // to prevent modifying the color too (issue #610) - if( opacity_ != 255 ) - [fontChar setOpacity: opacity_]; + if (longestLine < nextFontPositionX) longestLine = nextFontPositionX; + + if( ! hasSprite ) + [self updateQuadFromSprite:fontChar quadIndex:i]; } - - tmpSize.width = longestLine; - tmpSize.height = totalHeight; - + + // If the last character processed has an xAdvance which is less that the width of the characters image, then we need + // to adjust the width of the string to take this into account, or the character will overlap the end of the bounding + // box + if (fontDef.xAdvance < fontDef.rect.size.width) { + tmpSize.width = longestLine + fontDef.rect.size.width - fontDef.xAdvance; + } else { + tmpSize.width = longestLine; + } + tmpSize.height = totalHeight; + [self setContentSize:CC_SIZE_PIXELS_TO_POINTS(tmpSize)]; } #pragma mark LabelBMFont - CCLabelProtocol protocol -(NSString*) string { - return string_; + return _string; } -(void) setCString:(char*)label @@ -807,16 +872,13 @@ - (void) setString:(NSString*)newString - (void) setString:(NSString*) newString updateLabel:(BOOL)update { if( !update ) { - [string_ release]; - string_ = [newString copy]; + _string = [newString copy]; } else { - [initialString_ release]; - initialString_ = [newString copy]; + _initialString = [newString copy]; } - - CCSprite *child; - CCARRAY_FOREACH(children_, child) - child.visible = NO; + + for (CCSprite* child in _children) + child.visible = NO; [self createFontChars]; @@ -826,41 +888,88 @@ - (void) setString:(NSString*) newString updateLabel:(BOOL)update #pragma mark LabelBMFont - CCRGBAProtocol protocol +-(ccColor3B) color +{ + return _realColor; +} + +-(ccColor3B) displayedColor +{ + return _displayedColor; +} + -(void) setColor:(ccColor3B)color { - color_ = color; + _displayedColor = _realColor = color; + + if( _cascadeColorEnabled ) { + ccColor3B parentColor = ccWHITE; + if( [_parent conformsToProtocol:@protocol(CCRGBAProtocol)] && [(id)_parent isCascadeColorEnabled] ) + parentColor = [(id)_parent displayedColor]; + [self updateDisplayedColor:parentColor]; + } +} - CCSprite *child; - CCARRAY_FOREACH(children_, child) - [child setColor:color_]; +-(GLubyte) opacity +{ + return _realOpacity; } --(void) setOpacity:(GLubyte)opacity +-(GLubyte) displayedOpacity { - opacity_ = opacity; + return _displayedOpacity; +} - id child; - CCARRAY_FOREACH(children_, child) - [child setOpacity:opacity_]; +/** Override synthesized setOpacity to recurse items */ +- (void) setOpacity:(GLubyte)opacity +{ + _displayedOpacity = _realOpacity = opacity; + + if( _cascadeOpacityEnabled ) { + GLubyte parentOpacity = 255; + if( [_parent conformsToProtocol:@protocol(CCRGBAProtocol)] && [(id)_parent isCascadeOpacityEnabled] ) + parentOpacity = [(id)_parent displayedOpacity]; + [self updateDisplayedOpacity:parentOpacity]; + } } + -(void) setOpacityModifyRGB:(BOOL)modify { - opacityModifyRGB_ = modify; - - id child; - CCARRAY_FOREACH(children_, child) - [child setOpacityModifyRGB:modify]; + _opacityModifyRGB = modify; + + for (id child in _children) + [child setOpacityModifyRGB:modify]; } -(BOOL) doesOpacityModifyRGB { - return opacityModifyRGB_; + return _opacityModifyRGB; +} + +- (void)updateDisplayedOpacity:(GLubyte)parentOpacity +{ + _displayedOpacity = _realOpacity * parentOpacity/255.0; + + for (CCSprite* item in _children) { + [item updateDisplayedOpacity:_displayedOpacity]; + } +} + +- (void)updateDisplayedColor:(ccColor3B)parentColor +{ + _displayedColor.r = _realColor.r * parentColor.r/255.0; + _displayedColor.g = _realColor.g * parentColor.g/255.0; + _displayedColor.b = _realColor.b * parentColor.b/255.0; + + for (CCSprite* item in _children) { + [item updateDisplayedColor:_displayedColor]; + } } #pragma mark LabelBMFont - AnchorPoint -(void) setAnchorPoint:(CGPoint)point { - if( ! CGPointEqualToPoint(point, anchorPoint_) ) { + if( ! CGPointEqualToPoint(point, _anchorPoint) ) { [super setAnchorPoint:point]; [self createFontChars]; } @@ -868,38 +977,36 @@ -(void) setAnchorPoint:(CGPoint)point #pragma mark LabelBMFont - Alignment - (void)setWidth:(float)width { - width_ = width; + _width = width; [self updateLabel]; } - (void)setAlignment:(CCTextAlignment)alignment { - alignment_ = alignment; + _alignment = alignment; [self updateLabel]; } #pragma mark LabelBMFont - FntFile - (void) setFntFile:(NSString*) fntFile { - if( fntFile != fntFile_ ) { + if( fntFile != _fntFile ) { CCBMFontConfiguration *newConf = FNTConfigLoadFile(fntFile); NSAssert( newConf, @"CCLabelBMFont: Impossible to create font. Please check file: '%@'", fntFile ); - [fntFile_ release]; - fntFile_ = [fntFile retain]; + _fntFile = fntFile; - [configuration_ release]; - configuration_ = [newConf retain]; - - [self setTexture:[[CCTextureCache sharedTextureCache] addImage:configuration_.atlasName]]; + _configuration = newConf; + + [self setTexture:[[CCTextureCache sharedTextureCache] addImage:_configuration.atlasName]]; [self createFontChars]; } } - (NSString*) fntFile { - return fntFile_; + return _fntFile; } #pragma mark LabelBMFont - Debug draw @@ -907,7 +1014,7 @@ - (NSString*) fntFile -(void) draw { [super draw]; - + CGSize s = [self contentSize]; CGPoint vertices[4]={ ccp(0,0),ccp(s.width,0), diff --git a/cocos2d/CCLabelTTF.h b/cocos2d/CCLabelTTF.h new file mode 100644 index 0000000..c1f1c96 --- /dev/null +++ b/cocos2d/CCLabelTTF.h @@ -0,0 +1,148 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2008-2010 Ricardo Quesada + * Copyright (c) 2011 Zynga Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + */ + + +#import "CCTexture2D.h" +#import "CCSprite.h" +#import "Platforms/CCNS.h" + +/** CCLabel is a subclass of CCTextureNode that knows how to render text labels + * + * All features from CCTextureNode are valid in CCLabel + * + * CCLabel objects are slow. Consider using CCLabelAtlas or CCLabelBMFont instead. + */ + +@interface CCLabelTTF : CCSprite +{ + BOOL _isTextureDirty; +} + +#pragma mark String and font + +/** Changes the text of the label. + * @warning Changing the string is as expensive as creating a new CCLabelTTF. To obtain better performance use CCLabelAtlas or CCLabelBMFont. + */ +@property (nonatomic,copy) NSString* string; + +/** Changes text of the label, draws the string with given attributes. The attributes used will override the alignment, color and shadow as set by the properties of the label. Attributed strings are only available on Mac and iOS 6 or later. + * @warning Changing the string is as expensive as creating a new CCLabelTTF. To obtain better performance use CCLabelAtlas or CCLabelBMFont. + */ +@property (nonatomic,copy) NSAttributedString* attributedString; + +/** Font name used in the label */ +@property (nonatomic,strong) NSString* fontName; + +/** Font size used in the label */ +@property (nonatomic,assign) float fontSize; + +/** Font color. If not using shadow or outline, it is more efficient to use the color property. */ +@property (nonatomic,assign) ccColor4B fontColor; + +#pragma mark Dimensions + +/** Dimensions of the label in Points */ +@property (nonatomic,assign) CGSize dimensions; + +@property (nonatomic,assign) CCContentSizeType dimensionsType; + + +#pragma mark Alignment + +/** The alignment of the label */ +@property (nonatomic,assign) CCTextAlignment horizontalAlignment; + +/** The vertical alignment of the label */ +@property (nonatomic,assign) CCVerticalTextAlignment verticalAlignment; + + +#pragma mark Shadow + +/** The color of a text shadow. If the color is transparent, no shadow will be used. */ +@property (nonatomic,assign) ccColor4B shadowColor; + +/** The offset of the shadow (in the type specified by shadowOffsetType), default is (0,0). */ +@property (nonatomic,assign) CGPoint shadowOffset; + + +@property (nonatomic,assign) CCPositionType shadowOffsetType; + +/** The blur radius of the shadow, default is 0. */ +@property (nonatomic,assign) float shadowBlurRadius; + + +#pragma mark Outline + +/** The color of the label's outline. Default is transparent/no outline. */ +@property (nonatomic,assign) ccColor4B outlineColor; + +/** The width of the label's outline. Default is 0/no outline. */ +@property (nonatomic,assign) float outlineWidth; + + +#pragma mark Font adjustments + +/** If set, the label will be scaled down to fit into the size provided by the dimensions property. Only has an effect if dimensions are set. */ +@property (nonatomic,assign) BOOL adjustsFontSizeToFit; + +/** Used together with adjustsFontSizeToFit. Fonts will not be scaled down below this size (the label will instead be clipped). */ +@property (nonatomic,assign) float minimumFontSize; + +/** Adjusts the fonts baseline, the value is set in points. */ +@property (nonatomic,assign) float baselineAdjustment; + +/** Creates a CCLabelTTF with a font name and font size in points */ ++ (id) labelWithString:(NSString *)string fontName:(NSString *)name fontSize:(CGFloat)size; + +/** Creates a CCLabelTTF with a font name, font size in points and the desired dimensions. */ ++ (id) labelWithString:(NSString *)string fontName:(NSString *)name fontSize:(CGFloat)size dimensions:(CGSize)dimensions; + +/** Creates a CCLabelTTF with an attributed string. Only supported on Mac and iOS 6 or later. */ ++ (id) labelWithAttributedString:(NSAttributedString *)attrString; + +/** Creates a CCLabelTTF with an attributed string and the desired dimensions. Only supported on Mac and iOS 6 or later. */ ++ (id) labelWithAttributedString:(NSAttributedString *)attrString dimensions:(CGSize)dimensions; + + +/** Initializes the CCLabelTTF with a font name and font size in points. */ +- (id) initWithString:(NSString*)string fontName:(NSString*)name fontSize:(CGFloat)size; + +/** Initializes the CCLabelTTF with a font name, font size in points and the desired dimensions. */ +- (id) initWithString:(NSString*)string fontName:(NSString*)name fontSize:(CGFloat)size dimensions:(CGSize)dimensions; + +/** Initializes the CCLabelTTF with an attributed string. Only supported on Mac and iOS 6 or later. */ +- (id) initWithAttributedString:(NSAttributedString *)attrString; + +/** Initializes the CCLabelTTF with an attributed string and the desired dimensions. Only supported on Mac and iOS 6 or later. */ +- (id) initWithAttributedString:(NSAttributedString *)attrString dimensions:(CGSize)dimensions; + +#ifdef __CC_PLATFORM_MAC +- (void) setHTML:(NSString*) html; +#endif + ++ (void) registerCustomTTF:(NSString*)fontFile; + +@end diff --git a/cocos2d/CCLabelTTF.m b/cocos2d/CCLabelTTF.m new file mode 100644 index 0000000..33396d3 --- /dev/null +++ b/cocos2d/CCLabelTTF.m @@ -0,0 +1,1117 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2008-2010 Ricardo Quesada + * Copyright (c) 2011 Zynga Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + */ + + +#import "CCLabelTTF.h" +#import "Support/CGPointExtension.h" +#import "ccMacros.h" +#import "CCShaderCache.h" +#import "CCGLProgram.h" +#import "Support/CCFileUtils.h" +#import "ccDeprecated.h" +#import "ccMacros.h" +#import "ccUtils.h" +#import "NSAttributedString+CCAdditions.h" +#import "CCConfiguration.h" + +#ifdef __CC_PLATFORM_IOS +#import "Platforms/iOS/CCDirectorIOS.h" +#import +#endif + +static __strong NSMutableDictionary* ccLabelTTF_registeredFonts; + +#pragma clang diagnostic push COCOS2D +#pragma clang diagnostic ignored "-Wfloat-equal" + +@implementation CCTexture2D (CCLabelTTF) + +- (void) setPremultipliedAlpha:(BOOL)flag +{ + _hasPremultipliedAlpha = flag; +} + +@end + +#pragma mark CCLabelTTF + + +@implementation CCLabelTTF + ++ (id) labelWithString:(NSString *)string fontName:(NSString *)name fontSize:(CGFloat)size +{ + return [[self alloc] initWithString:string fontName:name fontSize:size]; +} + ++ (id) labelWithString:(NSString *)string fontName:(NSString *)name fontSize:(CGFloat)size dimensions:(CGSize)dimensions +{ + return [[self alloc] initWithString:string fontName:name fontSize:size dimensions:dimensions]; +} + ++ (id) labelWithAttributedString:(NSAttributedString *)attrString +{ + return [[self alloc] initWithAttributedString:attrString]; +} + ++ (id) labelWithAttributedString:(NSAttributedString *)attrString dimensions:(CGSize)dimensions +{ + return [[self alloc] initWithAttributedString:attrString dimensions:dimensions]; +} + +- (id) init +{ + return [self initWithString:@"" fontName:@"Helvetica" fontSize:12]; +} + + +- (id) initWithString:(NSString*)str fontName:(NSString*)name fontSize:(CGFloat)size +{ + return [self initWithAttributedString:[[NSAttributedString alloc] initWithString:str] fontName:name fontSize:size dimensions:CGSizeZero]; +} + +- (id) initWithString:(NSString*)str fontName:(NSString*)name fontSize:(CGFloat)size dimensions:(CGSize)dimensions +{ + return [self initWithAttributedString:[[NSAttributedString alloc] initWithString:str] fontName:name fontSize:size dimensions:dimensions]; +} + +- (id) initWithAttributedString:(NSAttributedString *)attrString +{ + NSAssert([CCConfiguration sharedConfiguration].OSVersion >= kCCiOSVersion_6_0_0, @"Attributed strings are only supported on iOS 6 or later"); + return [self initWithAttributedString:attrString fontName:@"Helvetica" fontSize:12 dimensions:CGSizeZero]; +} + +- (id) initWithAttributedString:(NSAttributedString *)attrString dimensions:(CGSize)dimensions +{ + NSAssert([CCConfiguration sharedConfiguration].OSVersion >= kCCiOSVersion_6_0_0, @"Attributed strings are only supported on iOS 6 or later"); + return [self initWithAttributedString:attrString fontName:@"Helvetica" fontSize:12 dimensions:dimensions]; +} + +// This is a private initializer +- (id) initWithAttributedString:(NSAttributedString *)attrString fontName:(NSString*)fontName fontSize:(float)fontSize dimensions:(CGSize)dimensions +{ + if ( (self = [super init]) ) + { + if (!fontName) fontName = @"Helvetica"; + if (!fontSize) fontSize = 12; + + _blendFunc.src = CC_BLEND_SRC; + _blendFunc.dst = CC_BLEND_DST; + + // other properties + self.fontName = fontName; + self.fontSize = fontSize; + self.dimensions = dimensions; + self.fontColor = ccc4(255, 255, 255, 255); + self.outlineWidth = 1; + [self _setAttributedString:attrString]; + } + return self; +} + + + +#pragma mark Properties + +- (void) _setAttributedString:(NSAttributedString *)attributedString +{ + NSAssert(attributedString, @"Invalid attributedString"); + + if ( _attributedString.hash != attributedString.hash) + { + _attributedString = [attributedString copy]; + + [self setTextureDirty]; + } +} + +- (void) setAttributedString:(NSAttributedString *)attributedString +{ + NSAssert([CCConfiguration sharedConfiguration].OSVersion >= kCCiOSVersion_6_0_0, @"Attributed strings are only supported on iOS 6 or later"); + [self _setAttributedString:attributedString]; +} + +- (void) setString:(NSString*)str +{ + NSAssert( str, @"Invalid string" ); + [self _setAttributedString:[[NSAttributedString alloc] initWithString:str]]; +} + +-(NSString*) string +{ + return [_attributedString string]; +} + +- (void)setFontName:(NSString*)fontName +{ + // Handle passing of complete file paths + if ([[[fontName pathExtension] lowercaseString] isEqualToString:@"ttf"]) + { + [CCLabelTTF registerCustomTTF:fontName]; + fontName = [[fontName lastPathComponent] stringByDeletingPathExtension]; + } + + if( fontName.hash != _fontName.hash ) { + _fontName = [fontName copy]; + [self setTextureDirty]; + } +} + +#pragma clang diagnostic push COCOS2D +#pragma clang diagnostic ignored "-Wfloat-equal" +- (void) setFontSize:(float)fontSize +{ + if( fontSize != _fontSize ) { + _fontSize = fontSize; + [self setTextureDirty]; + } +} +#pragma clang diagnostic pop COCOS2D + +- (void) setAdjustsFontSizeToFit:(BOOL)adjustsFontSizeToFit +{ + if (adjustsFontSizeToFit != _adjustsFontSizeToFit) + { + _adjustsFontSizeToFit = adjustsFontSizeToFit; + [self setTextureDirty]; + } +} + +- (void) setFontColor:(ccColor4B)fontColor +{ + if (!ccc4BEqual(_fontColor, fontColor)) + { + _fontColor = fontColor; + [self setTextureDirty]; + } +} + +- (void) setMinimumFontSize:(float)minimumFontSize +{ + if (minimumFontSize != _minimumFontSize) + { + _minimumFontSize = minimumFontSize; + [self setTextureDirty]; + } +} + +-(void) setDimensions:(CGSize) dim +{ + if( dim.width != _dimensions.width || dim.height != _dimensions.height) + { + _dimensions = dim; + [self setTextureDirty]; + } +} + +- (CGSize) contentSize +{ + [self updateTexture]; + return _contentSize; +} + +-(void) setHorizontalAlignment:(CCTextAlignment)alignment +{ + if (alignment != _horizontalAlignment) + { + _horizontalAlignment = alignment; + [self setTextureDirty]; + + } +} + +-(void) setVerticalAlignment:(CCVerticalTextAlignment)verticalAlignment +{ + if (_verticalAlignment != verticalAlignment) + { + _verticalAlignment = verticalAlignment; + [self setTextureDirty]; + } +} + + +- (void) setShadowColor:(ccColor4B)shadowColor +{ + if (!ccc4BEqual(_shadowColor, shadowColor)) + { + _shadowColor = shadowColor; + [self setTextureDirty]; + } +} + +- (void) setShadowOffset:(CGPoint)shadowOffset +{ + if (!CGPointEqualToPoint(_shadowOffset, shadowOffset)) + { + _shadowOffset = shadowOffset; + [self setTextureDirty]; + } +} + +- (void) setShadowBlurRadius:(float)shadowBlurRadius +{ + if (_shadowBlurRadius != shadowBlurRadius) + { + _shadowBlurRadius = shadowBlurRadius; + [self setTextureDirty]; + } +} + +- (void) setOutlineColor:(ccColor4B)outlineColor +{ + if (!ccc4BEqual(outlineColor, _outlineColor)) + { + _outlineColor = outlineColor; + [self setTextureDirty]; + } +} + +- (void) setOutlineWidth:(float)outlineWidth +{ + if (outlineWidth != _outlineWidth) + { + _outlineWidth = outlineWidth; + [self setTextureDirty]; + } +} + +- (NSString*) description +{ + // XXX: _string, _fontName can't be displayed here, since they might be already released + + return [NSString stringWithFormat:@"<%@ = %p | FontSize = %.1f>", [self class], self, _fontSize]; +} + +- (void) visit +{ + if (_isTextureDirty) + { + [self updateTexture]; + } + + [super visit]; +} + +- (void) setTextureDirty +{ + _isTextureDirty = YES; +} + + +#pragma mark - +#pragma mark Render Font Mac & iOS 6 + +- (BOOL) updateTexture +{ + if (!_attributedString) return NO; + if (!_isTextureDirty) return NO; + + _isTextureDirty = NO; + +#ifdef __CC_PLATFORM_IOS + // Handle fonts on iOS 5 + if ([CCConfiguration sharedConfiguration].OSVersion < kCCiOSVersion_6_0_0) + { + return [self updateTextureOld]; + } +#endif + + // Set default values for font attributes if they are not set in the attributed string + + NSMutableAttributedString* formattedAttributedString = [_attributedString mutableCopy]; + NSRange fullRange = NSMakeRange(0, formattedAttributedString.length); + + BOOL useFullColor = NO; + + if (_shadowColor.a > 0) useFullColor = YES; + if (_outlineColor.a > 0 && _outlineWidth > 0) useFullColor = YES; + +#ifdef __CC_PLATFORM_IOS + + // Font color + if (![formattedAttributedString hasAttribute:NSForegroundColorAttributeName]) + { + if (!ccc4BEqual(_fontColor, ccc4(255, 255, 255, 255))) + { + useFullColor = YES; + } + + float r = ((float)_fontColor.r)/255; + float g = ((float)_fontColor.g)/255; + float b = ((float)_fontColor.b)/255; + float a = ((float)_fontColor.a)/255; + + UIColor* color = [UIColor colorWithRed:r green:g blue:b alpha:a]; + + [formattedAttributedString addAttribute:NSForegroundColorAttributeName value:color range:fullRange]; + } + else + { + useFullColor = YES; + } + + // Font + if (![formattedAttributedString hasAttribute:NSFontAttributeName]) + { + UIFont* font = [UIFont fontWithName:_fontName size:_fontSize]; + if (!font) font = [UIFont fontWithName:@"Helvetica" size:_fontSize]; + [formattedAttributedString addAttribute:NSFontAttributeName value:font range:fullRange]; + } + + // Shadow + if ([formattedAttributedString hasAttribute:NSShadowAttributeName]) + { + useFullColor = YES; + } + + // Text alignment + if (![formattedAttributedString hasAttribute:NSParagraphStyleAttributeName]) + { + NSMutableParagraphStyle* style = [[NSMutableParagraphStyle alloc] init]; + + if (_horizontalAlignment == kCCTextAlignmentLeft) style.alignment = NSTextAlignmentLeft; + else if (_horizontalAlignment == kCCTextAlignmentCenter) style.alignment = NSTextAlignmentCenter; + else if (_horizontalAlignment == kCCTextAlignmentRight) style.alignment = NSTextAlignmentRight; + + [formattedAttributedString addAttribute:NSParagraphStyleAttributeName value:style range:fullRange]; + } + +#elif defined(__CC_PLATFORM_MAC) + // Font color + if (![formattedAttributedString hasAttribute:NSForegroundColorAttributeName]) + { + if (!ccc4BEqual(_fontColor, ccc4(255, 255, 255, 255))) + { + useFullColor = YES; + } + + float r = ((float)_fontColor.r)/255; + float g = ((float)_fontColor.g)/255; + float b = ((float)_fontColor.b)/255; + float a = ((float)_fontColor.a)/255; + + NSColor* color = [NSColor colorWithCalibratedRed:r green:g blue:b alpha:a]; + + [formattedAttributedString addAttribute:NSForegroundColorAttributeName value:color range:fullRange]; + } + else + { + useFullColor = YES; + } + + // Font + if (![formattedAttributedString hasAttribute:NSFontAttributeName]) + { + NSFont* font = [NSFont fontWithName:_fontName size:_fontSize]; + if (!font) font = [NSFont fontWithName:@"Helvetica" size:_fontSize]; + [formattedAttributedString addAttribute:NSFontAttributeName value:font range:fullRange]; + } + + // Shadow + if ([formattedAttributedString hasAttribute:NSShadowAttributeName]) + { + useFullColor = YES; + } + + // Text alignment + if (![formattedAttributedString hasAttribute:NSParagraphStyleAttributeName]) + { + NSMutableParagraphStyle* style = [[NSMutableParagraphStyle alloc] init]; + + if (_horizontalAlignment == kCCTextAlignmentLeft) style.alignment = NSLeftTextAlignment; + else if (_horizontalAlignment == kCCTextAlignmentCenter) style.alignment = NSCenterTextAlignment; + else if (_horizontalAlignment == kCCTextAlignmentRight) style.alignment = NSRightTextAlignment; + + [formattedAttributedString addAttribute:NSParagraphStyleAttributeName value:style range:fullRange]; + } +#endif + + + // Generate a new texture from the attributed string + CCTexture2D *tex; + + tex = [self createTextureWithAttributedString:[formattedAttributedString copyAdjustedForContentScaleFactor] useFullColor:useFullColor]; + + if( !tex ) + return NO; + + if (!useFullColor) + { + self.shaderProgram = [[CCShaderCache sharedShaderCache] programForKey:kCCShader_PositionTextureA8Color]; + } + else + { + self.shaderProgram = [[CCShaderCache sharedShaderCache] programForKey:kCCShader_PositionTextureColor]; + } + +#ifdef __CC_PLATFORM_IOS + // iPad ? + if( UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad ) { + if( CC_CONTENT_SCALE_FACTOR() == 2 ) + [tex setResolutionType:kCCResolutioniPadRetinaDisplay]; + else + [tex setResolutionType:kCCResolutioniPad]; + } + // iPhone ? + else + { + if( CC_CONTENT_SCALE_FACTOR() == 2 ) + [tex setResolutionType:kCCResolutioniPhoneRetinaDisplay]; + else + [tex setResolutionType:kCCResolutioniPhone]; + } +#endif + + // Update texture and content size + [self setTexture:tex]; + + CGRect rect = CGRectZero; + rect.size = [_texture contentSize]; + [self setTextureRect: rect]; + + return YES; +} + +- (CCTexture2D*) createTextureWithAttributedString:(NSAttributedString*)attributedString useFullColor:(BOOL) fullColor +{ + NSAssert(attributedString, @"Invalid attributedString"); + + CGSize originalDimensions = _dimensions; + +#ifdef __CC_PLATFORM_IOS + originalDimensions.width *= CC_CONTENT_SCALE_FACTOR(); + originalDimensions.height *= CC_CONTENT_SCALE_FACTOR(); +#endif + + CGSize dimensions = originalDimensions; + + float shadowBlurRadius = _shadowBlurRadius * CC_CONTENT_SCALE_FACTOR(); + CGPoint shadowOffset = ccpMult(_shadowOffset, CC_CONTENT_SCALE_FACTOR()); + float outlineWidth = _outlineWidth * CC_CONTENT_SCALE_FACTOR(); + + BOOL hasShadow = (_shadowColor.a > 0); + BOOL hasOutline = (_outlineColor.a > 0 && _outlineWidth > 0); + + float xOffset = 0; + float yOffset = 0; + float scaleFactor = 1; + + float xPadding = 0; + float yPadding = 0; + float wDrawArea = 0; + float hDrawArea = 0; + + // Calculate padding + if (hasShadow) + { + xPadding = (shadowBlurRadius + fabs(shadowOffset.x)); + yPadding = (shadowBlurRadius + fabs(shadowOffset.y)); + } + if (hasOutline) + { + xPadding += outlineWidth; + yPadding += outlineWidth; + } + + // Get actual rendered dimensions + if (dimensions.height == 0) + { + // Get dimensions for string without dimensions of string with variable height +#ifdef __CC_PLATFORM_IOS + dimensions = [attributedString boundingRectWithSize:dimensions options:NSStringDrawingUsesLineFragmentOrigin context:NULL].size; +#elif defined(__CC_PLATFORM_MAC) + dimensions = [attributedString boundingRectWithSize:NSSizeFromCGSize(dimensions) options:NSStringDrawingUsesLineFragmentOrigin].size; +#endif + + wDrawArea = dimensions.width; + hDrawArea = dimensions.height; + + dimensions.width += xPadding * 2; + dimensions.height += yPadding * 2; + } + else if (dimensions.width > 0 && dimensions.height > 0) + { + wDrawArea = dimensions.width - xPadding * 2; + hDrawArea = dimensions.height - yPadding * 2; + + // Handle strings with fixed dimensions + if (_adjustsFontSizeToFit) + { + float fontSize = [attributedString singleFontSize]; + if (fontSize) + { + // This is a string that can be resized (it only uses one font and size) +#ifdef __CC_PLATFORM_IOS + CGSize wantedSize = [attributedString boundingRectWithSize:CGSizeZero options:NSStringDrawingUsesLineFragmentOrigin context:NULL].size; +#elif defined(__CC_PLATFORM_MAC) + CGSize wantedSize = [attributedString boundingRectWithSize:CGSizeZero options:NSStringDrawingUsesLineFragmentOrigin].size; +#endif + + float wScaleFactor = 1; + float hScaleFactor = 1; + if (wantedSize.width > wDrawArea) + { + wScaleFactor = wDrawArea/wantedSize.width; + } + if (wantedSize.height > hDrawArea) + { + hScaleFactor = hDrawArea/wantedSize.height; + } + + if (wScaleFactor < hScaleFactor) scaleFactor = wScaleFactor; + else scaleFactor = hScaleFactor; + + if (scaleFactor != 1) + { + float newFontSize = fontSize * scaleFactor; + float minFontSize = _minimumFontSize * CC_CONTENT_SCALE_FACTOR(); + if (minFontSize && newFontSize < minFontSize) newFontSize = minFontSize; + attributedString = [attributedString copyWithNewFontSize:newFontSize]; + } + } + } + + // Handle vertical alignment +#ifdef __CC_PLATFORM_IOS + CGSize actualSize = [attributedString boundingRectWithSize:CGSizeMake(wDrawArea, 0) options:NSStringDrawingUsesLineFragmentOrigin context:NULL].size; +#elif defined(__CC_PLATFORM_MAC) + CGSize actualSize = NSSizeToCGSize([attributedString boundingRectWithSize:NSMakeSize(wDrawArea, 0) options:NSStringDrawingUsesLineFragmentOrigin].size); +#endif + if (_verticalAlignment == kCCVerticalTextAlignmentBottom) + { + yOffset = hDrawArea - actualSize.height; + } + else if (_verticalAlignment == kCCVerticalTextAlignmentCenter) + { + yOffset = (hDrawArea - actualSize.height)/2; + } + } + + // Handle baseline adjustments + yOffset += _baselineAdjustment * scaleFactor * CC_CONTENT_SCALE_FACTOR() + yPadding; + xOffset += xPadding; + + // Round dimensions to nearest number that is dividable by 2 + dimensions.width = ceilf(dimensions.width/2)*2; + dimensions.height = ceilf(dimensions.height/2)*2; + + // get nearest power of two + CGSize POTSize = CGSizeMake(ccNextPOT(dimensions.width), ccNextPOT(dimensions.height)); + + // Mac crashes if the width or height is 0 + if( POTSize.width == 0 ) + POTSize.width = 2; + + if( POTSize.height == 0) + POTSize.height = 2; + + // Render the label - different code for Mac / iOS + +#ifdef __CC_PLATFORM_IOS + yOffset = (POTSize.height - dimensions.height) + yOffset; + + CGRect drawArea = CGRectMake(xOffset, yOffset, wDrawArea, hDrawArea); + + unsigned char* data = calloc(POTSize.width, POTSize.height * 4); + + CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB(); + CGContextRef context = CGBitmapContextCreate(data, POTSize.width, POTSize.height, 8, POTSize.width * 4, colorSpace, (CGBitmapInfo)(kCGImageAlphaPremultipliedLast | kCGBitmapByteOrder32Big)); + CGColorSpaceRelease(colorSpace); + + if (!context) + { + free(data); + return NULL; + } + + CGAffineTransform flipVertical = CGAffineTransformMake(1, 0, 0, -1, 0, POTSize.height * 2 - dimensions.height); + CGContextConcatCTM(context, flipVertical); + + UIGraphicsPushContext(context); + + // Handle shadow + if (hasShadow) + { + float r = ((float)_shadowColor.r)/255; + float g = ((float)_shadowColor.g)/255; + float b = ((float)_shadowColor.b)/255; + float a = ((float)_shadowColor.a)/255; + + UIColor* color = [UIColor colorWithRed:r green:g blue:b alpha:a]; + + CGContextSetShadowWithColor(context, CGSizeMake(shadowOffset.x, shadowOffset.y), shadowBlurRadius, [color CGColor]); + } + + // Handle outline + if (hasOutline) + { + float r = ((float)_outlineColor.r)/255; + float g = ((float)_outlineColor.g)/255; + float b = ((float)_outlineColor.b)/255; + float a = ((float)_outlineColor.a)/255; + + UIColor* color = [UIColor colorWithRed:r green:g blue:b alpha:a]; + + CGContextSetTextDrawingMode(context, kCGTextFillStroke); + CGContextSetLineWidth(context, outlineWidth * 2); + CGContextSetLineJoin(context, kCGLineJoinRound); + CGContextSetStrokeColorWithColor(context, [color CGColor]); + + NSMutableAttributedString* outlineString = [attributedString mutableCopy]; + [outlineString removeAttribute:NSForegroundColorAttributeName range:NSMakeRange(0, outlineString.length)]; + + [outlineString drawInRect:drawArea]; + + CGContextSetTextDrawingMode(context, kCGTextFill); + + // Don't draw shadow for main font + CGContextSetShadowWithColor(context, CGSizeZero, 0, NULL); + + if (hasShadow) + { + // Draw outline again because shadow overlap + [outlineString drawInRect:drawArea]; + } + } + + [attributedString drawInRect:drawArea]; + + UIGraphicsPopContext(); + CGContextRelease(context); + +#elif defined(__CC_PLATFORM_MAC) + yOffset = (POTSize.height - hDrawArea) - yOffset; + + CGRect drawArea = CGRectMake(xOffset, yOffset, wDrawArea, hDrawArea); + + NSImage *image = [[NSImage alloc] initWithSize:POTSize]; + [image lockFocus]; + [[NSAffineTransform transform] set]; + + // XXX: The shadows are for some reason scaled on OS X if a retina display is connected + float retinaFix = 1; + for (NSScreen* screen in [NSScreen screens]) + { + if (screen.backingScaleFactor > retinaFix) retinaFix = screen.backingScaleFactor; + } + + CGContextRef context = [[NSGraphicsContext currentContext] graphicsPort]; + + // Handle shadow + if (hasShadow || hasOutline) + { + NSMutableAttributedString* effectsString = [attributedString mutableCopy]; + + if (hasShadow) + { + float r = ((float)_shadowColor.r)/255; + float g = ((float)_shadowColor.g)/255; + float b = ((float)_shadowColor.b)/255; + float a = ((float)_shadowColor.a)/255; + NSColor* color = [NSColor colorWithCalibratedRed:r green:g blue:b alpha:a]; + + CGContextSetShadowWithColor(context, CGSizeMake(shadowOffset.x/retinaFix, shadowOffset.y/retinaFix), shadowBlurRadius/retinaFix, [color CGColor]); + } + + if (hasOutline) + { + + CGContextSetTextDrawingMode(context, kCGTextFillStroke); + CGContextSetLineWidth(context, outlineWidth * 2); + CGContextSetLineJoin(context, kCGLineJoinRound); + + float r = ((float)_outlineColor.r)/255; + float g = ((float)_outlineColor.g)/255; + float b = ((float)_outlineColor.b)/255; + float a = ((float)_outlineColor.a)/255; + NSColor* color = [NSColor colorWithCalibratedRed:r green:g blue:b alpha:a]; + + [effectsString addAttribute:NSForegroundColorAttributeName value:color range:NSMakeRange(0, effectsString.length)]; + + [effectsString drawWithRect:NSRectFromCGRect(drawArea) options:NSStringDrawingUsesLineFragmentOrigin]; + + if (hasShadow) + { + CGContextSetShadowWithColor(context, CGSizeZero, 0, NULL); + [effectsString drawInRect:drawArea]; + } + CGContextSetTextDrawingMode(context, kCGTextFill); + } + } + + [attributedString drawWithRect:NSRectFromCGRect(drawArea) options:NSStringDrawingUsesLineFragmentOrigin]; + + NSBitmapImageRep *bitmap = [[NSBitmapImageRep alloc] initWithFocusedViewRect:NSMakeRect (0.0f, 0.0f, POTSize.width, POTSize.height)]; + [image unlockFocus]; + + unsigned char *data = (unsigned char*) [bitmap bitmapData]; //Use the same buffer to improve the performance. +#endif + + CCTexture2D* texture = NULL; + + // Initialize the texture + if (fullColor) + { + // RGBA8888 format + texture = [[CCTexture2D alloc] initWithData:data pixelFormat:kCCTexture2DPixelFormat_RGBA8888 pixelsWide:POTSize.width pixelsHigh:POTSize.height contentSize:dimensions]; + [texture setPremultipliedAlpha:YES]; + } + else + { + NSUInteger textureSize = POTSize.width * POTSize.height; + + // A8 format (alpha channel only) + unsigned char* dst = data; + for(NSUInteger i = 0; i 0) useFullColor = YES; + if (!ccc4BEqual(_fontColor, ccc4(255, 255, 255, 255))) useFullColor = YES; + if (_outlineColor.a > 0 && _outlineWidth > 0) useFullColor = YES; + + CCTexture2D* tex = [self createTextureWithString:string useFullColor:useFullColor]; + if (!tex) return NO; + + if (!useFullColor) + { + self.shaderProgram = [[CCShaderCache sharedShaderCache] programForKey:kCCShader_PositionTextureA8Color]; + } + + if( UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad ) { + if( CC_CONTENT_SCALE_FACTOR() == 2 ) + [tex setResolutionType:kCCResolutioniPadRetinaDisplay]; + else + [tex setResolutionType:kCCResolutioniPad]; + } + // iPhone ? + else + { + if( CC_CONTENT_SCALE_FACTOR() == 2 ) + [tex setResolutionType:kCCResolutioniPhoneRetinaDisplay]; + else + [tex setResolutionType:kCCResolutioniPhone]; + } + + // Update texture and content size + [self setTexture:tex]; + + CGRect rect = CGRectZero; + rect.size = [_texture contentSize]; + [self setTextureRect: rect]; + + return YES; +} + +- (CCTexture2D*) createTextureWithString:(NSString*) string useFullColor:(BOOL)useFullColor +{ + // Scale everything up by content scale + UIFont* font = [UIFont fontWithName:_fontName size:_fontSize * CC_CONTENT_SCALE_FACTOR()]; + float shadowBlurRadius = _shadowBlurRadius * CC_CONTENT_SCALE_FACTOR(); + CGPoint shadowOffset = ccpMult(_shadowOffset, CC_CONTENT_SCALE_FACTOR()); + float outlineWidth = _outlineWidth * CC_CONTENT_SCALE_FACTOR(); + + BOOL hasShadow = (_shadowColor.a > 0); + BOOL hasOutline = (_outlineColor.a > 0 && _outlineWidth > 0); + + float xOffset = 0; + float yOffset = 0; + float scaleFactor = 1; + + float xPadding = 0; + float yPadding = 0; + float wDrawArea = 0; + float hDrawArea = 0; + + CGSize originalDimensions = _dimensions; + originalDimensions.width *= CC_CONTENT_SCALE_FACTOR(); + originalDimensions.height *= CC_CONTENT_SCALE_FACTOR(); + + // Calculate padding + if (hasShadow) + { + xPadding = (shadowBlurRadius + fabs(shadowOffset.x)); + yPadding = (shadowBlurRadius + fabs(shadowOffset.y)); + } + if (hasOutline) + { + xPadding += outlineWidth; + yPadding += outlineWidth; + } + + CGSize dimensions = originalDimensions; + + // Get actual rendered dimensions + if (dimensions.height == 0) + { + // Get dimensions for string without dimensions of string with variable height + if (dimensions.width > 0) + { + dimensions = [string sizeWithFont:font forWidth:dimensions.width lineBreakMode:0]; + } + else + { + CGSize firstLineSize = [string sizeWithFont:font]; + dimensions = [string sizeWithFont:font constrainedToSize:CGSizeMake(firstLineSize.width,1024) lineBreakMode:0]; + } + + wDrawArea = dimensions.width; + hDrawArea = dimensions.height; + + dimensions.width += xPadding * 2; + dimensions.height += yPadding * 2; + } + else if (dimensions.width > 0 && dimensions.height > 0) + { + wDrawArea = dimensions.width - xPadding * 2; + hDrawArea = dimensions.height - yPadding * 2; + + // Handle strings with fixed dimensions + if (_adjustsFontSizeToFit) + { + float fontSize = font.pointSize; + CGSize wantedSizeFirstLine = [string sizeWithFont:font]; + CGSize wantedSize = [string sizeWithFont:font constrainedToSize:CGSizeMake(wantedSizeFirstLine.width, 1024) lineBreakMode:0]; + + float wScaleFactor = 1; + float hScaleFactor = 1; + if (wantedSize.width > wDrawArea) + { + wScaleFactor = wDrawArea/wantedSize.width; + } + if (wantedSize.height > hDrawArea) + { + hScaleFactor = hDrawArea/wantedSize.height; + } + + if (wScaleFactor < hScaleFactor) scaleFactor = wScaleFactor; + else scaleFactor = hScaleFactor; + + if (scaleFactor != 1) + { + float newFontSize = fontSize * scaleFactor; + float minFontSize = _minimumFontSize * CC_CONTENT_SCALE_FACTOR(); + if (minFontSize && newFontSize < minFontSize) newFontSize = minFontSize; + font = [UIFont fontWithName:font.fontName size:newFontSize]; + } + } + + // Handle vertical alignment + CGSize actualSize = [string sizeWithFont:font constrainedToSize:CGSizeMake(wDrawArea, 1024) lineBreakMode:0]; + + if (_verticalAlignment == kCCVerticalTextAlignmentBottom) + { + yOffset = hDrawArea - actualSize.height; + } + else if (_verticalAlignment == kCCVerticalTextAlignmentCenter) + { + yOffset = (hDrawArea - actualSize.height)/2; + } + } + + // Handle baseline adjustments + yOffset += _baselineAdjustment * scaleFactor * CC_CONTENT_SCALE_FACTOR() + yPadding; + xOffset += xPadding; + + // Round dimensions to nearest number that is dividable by 2 + dimensions.width = ceilf(dimensions.width/2)*2; + dimensions.height = ceilf(dimensions.height/2)*2; + + // get nearest power of two + CGSize POTSize = CGSizeMake(ccNextPOT(dimensions.width), ccNextPOT(dimensions.height)); + + // Mac crashes if the width or height is 0 + if( POTSize.width == 0 ) + POTSize.width = 2; + + if( POTSize.height == 0) + POTSize.height = 2; + + yOffset = (POTSize.height - dimensions.height) + yOffset; + + CGRect drawArea = CGRectMake(xOffset, yOffset, wDrawArea, hDrawArea); + + unsigned char* data = calloc(POTSize.width, POTSize.height * 4); + + CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB(); + CGContextRef context = CGBitmapContextCreate(data, POTSize.width, POTSize.height, 8, POTSize.width * 4, colorSpace, (CGBitmapInfo)(kCGImageAlphaPremultipliedLast | kCGBitmapByteOrder32Big)); + CGColorSpaceRelease(colorSpace); + + if (!context) + { + free(data); + return NULL; + } + + CGAffineTransform flipVertical = CGAffineTransformMake(1, 0, 0, -1, 0, POTSize.height * 2 - dimensions.height); + CGContextConcatCTM(context, flipVertical); + + UIGraphicsPushContext(context); + + // Handle shadow + if (hasShadow) + { + float r = ((float)_shadowColor.r)/255; + float g = ((float)_shadowColor.g)/255; + float b = ((float)_shadowColor.b)/255; + float a = ((float)_shadowColor.a)/255; + + UIColor* color = [UIColor colorWithRed:r green:g blue:b alpha:a]; + + CGContextSetShadowWithColor(context, CGSizeMake(shadowOffset.x, shadowOffset.y), shadowBlurRadius, [color CGColor]); + } + + // Handle outline + if (hasOutline) + { + float r = ((float)_outlineColor.r)/255; + float g = ((float)_outlineColor.g)/255; + float b = ((float)_outlineColor.b)/255; + float a = ((float)_outlineColor.a)/255; + + CGContextSetTextDrawingMode(context, kCGTextFillStroke); + CGContextSetRGBStrokeColor(context, r, g, b, a); + CGContextSetRGBFillColor(context, r, g, b, a); + CGContextSetLineWidth(context, outlineWidth * 2); + CGContextSetLineJoin(context, kCGLineJoinRound); + + [string drawInRect:drawArea withFont:font lineBreakMode:0 alignment:(int)_horizontalAlignment]; + + // Don't draw shadow for main font + CGContextSetShadowWithColor(context, CGSizeZero, 0, NULL); + + if (hasShadow) + { + // Draw again, because shadows overlap + [string drawInRect:drawArea withFont:font lineBreakMode:0 alignment:(int)_horizontalAlignment]; + } + + CGContextSetTextDrawingMode(context, kCGTextFill); + } + + // Handle font color + float r = ((float)_fontColor.r)/255; + float g = ((float)_fontColor.g)/255; + float b = ((float)_fontColor.b)/255; + float a = ((float)_fontColor.a)/255; + + UIColor* color = [UIColor colorWithRed:r green:g blue:b alpha:a]; + [color set]; + + [string drawInRect:drawArea withFont:font lineBreakMode:0 alignment:(int)_horizontalAlignment]; + + UIGraphicsPopContext(); + CGContextRelease(context); + + CCTexture2D* texture = NULL; + + // Initialize the texture + if (useFullColor) + { + // RGBA8888 format + texture = [[CCTexture2D alloc] initWithData:data pixelFormat:kCCTexture2DPixelFormat_RGBA8888 pixelsWide:POTSize.width pixelsHigh:POTSize.height contentSize:dimensions]; + [texture setPremultipliedAlpha:YES]; + } + else + { + NSUInteger textureSize = POTSize.width * POTSize.height; + + // A8 format (alpha channel only) + unsigned char* dst = data; + for(NSUInteger i = 0; i // Needed for UIAccelerometerDelegate +#elif defined(__CC_PLATFORM_MAC) + +#endif + +#import "CCProtocols.h" +#import "CCNode.h" + +#pragma mark - CCLayer + +@interface CCLayer : CCNode + +@end + +#pragma mark - +#pragma mark CCLayerColor + +/** CCLayerColor is a subclass of CCLayer that implements the CCRGBAProtocol protocol. + + All features from CCLayer are valid, plus the following new features: + - opacity + - RGB colors + */ +@interface CCLayerColor : CCNodeRGBA +{ + ccVertex2F _squareVertices[4]; + ccColor4F _squareColors[4]; + + ccBlendFunc _blendFunc; +} + +/** creates a CCLayer with color, width and height in Points*/ ++ (id) layerWithColor: (ccColor4B)color width:(GLfloat)w height:(GLfloat)h; +/** creates a CCLayer with color. Width and height are the window size. */ ++ (id) layerWithColor: (ccColor4B)color; + +/** initializes a CCLayer with color, width and height in Points. + This is the designated initializer. + */ +- (id) initWithColor:(ccColor4B)color width:(GLfloat)w height:(GLfloat)h; +/** initializes a CCLayer with color. Width and height are the window size. */ +- (id) initWithColor:(ccColor4B)color; + +/** change width in Points */ +-(void) changeWidth: (GLfloat)w; +/** change height in Points */ +-(void) changeHeight: (GLfloat)h; +/** change width and height in Points + @since v0.8 + */ +-(void) changeWidth:(GLfloat)w height:(GLfloat)h; + +/** BlendFunction. Conforms to CCBlendProtocol protocol */ +@property (nonatomic,readwrite) ccBlendFunc blendFunc; +@end + +#pragma mark - +#pragma mark CCLayerGradient + +/** CCLayerGradient is a subclass of CCLayerColor that draws gradients across +the background. + + All features from CCLayerColor are valid, plus the following new features: + - direction + - final color + - interpolation mode + + Color is interpolated between the startColor and endColor along the given + vector (starting at the origin, ending at the terminus). If no vector is + supplied, it defaults to (0, -1) -- a fade from top to bottom. + + If 'compressedInterpolation' is disabled, you will not see either the start or end color for + non-cardinal vectors; a smooth gradient implying both end points will be still + be drawn, however. + + If ' compressedInterpolation' is enabled (default mode) you will see both the start and end colors of the gradient. + + @since v0.99.5 + */ +@interface CCLayerGradient : CCLayerColor +{ + ccColor3B _endColor; + GLubyte _startOpacity; + GLubyte _endOpacity; + CGPoint _vector; + BOOL _compressedInterpolation; +} + +/** Creates a full-screen CCLayer with a gradient between start and end. */ ++ (id) layerWithColor: (ccColor4B) start fadingTo: (ccColor4B) end; +/** Creates a full-screen CCLayer with a gradient between start and end in the direction of v. */ ++ (id) layerWithColor: (ccColor4B) start fadingTo: (ccColor4B) end alongVector: (CGPoint) v; + +/** Initializes the CCLayer with a gradient between start and end. */ +- (id) initWithColor: (ccColor4B) start fadingTo: (ccColor4B) end; +/** Initializes the CCLayer with a gradient between start and end in the direction of v. */ +- (id) initWithColor: (ccColor4B) start fadingTo: (ccColor4B) end alongVector: (CGPoint) v; + +/** The starting color. */ +@property (nonatomic, readwrite) ccColor3B startColor; +/** The ending color. */ +@property (nonatomic, readwrite) ccColor3B endColor; +/** The starting opacity. */ +@property (nonatomic, readwrite) GLubyte startOpacity; +/** The ending color. */ +@property (nonatomic, readwrite) GLubyte endOpacity; +/** The vector along which to fade color. */ +@property (nonatomic, readwrite) CGPoint vector; +/** Whether or not the interpolation will be compressed in order to display all the colors of the gradient both in canonical and non canonical vectors + Default: YES + */ +@property (nonatomic, readwrite) BOOL compressedInterpolation; + +@end + +#pragma mark - +#pragma mark CCLayerMultiplex + +/** CCLayerMultiplex is a CCLayer with the ability to multiplex its children. + Features: + - It supports one or more children + - Only one children will be active a time + */ +@interface CCLayerMultiplex : CCLayer +{ + unsigned int _enabledLayer; + NSMutableArray *_layers; +} + +/** creates a CCMultiplexLayer with an array of layers. + @since v2.1 + */ ++(id) layerWithArray:(NSArray*)arrayOfLayers; +/** creates a CCMultiplexLayer with one or more layers using a variable argument list. */ ++(id) layerWithLayers: (CCLayer*) layer, ... NS_REQUIRES_NIL_TERMINATION; +/** initializes a CCMultiplexLayer with an array of layers + @since v2.1 + */ +-(id) initWithArray:(NSArray*)arrayOfLayers; +/** initializes a MultiplexLayer with one or more layers using a variable argument list. */ +-(id) initWithLayers: (CCLayer*) layer vaList:(va_list) params; +/** switches to a certain layer indexed by n. + The current (old) layer will be removed from its parent with 'cleanup:YES'. + */ +-(void) switchTo: (unsigned int) n; +/** release the current layer and switches to another layer indexed by n. + The current (old) layer will be removed from its parent with 'cleanup:YES'. + */ +-(void) switchToAndReleaseMe: (unsigned int) n; +@end + diff --git a/cocos2d/CCLayer.m b/cocos2d/CCLayer.m new file mode 100644 index 0000000..aff6a72 --- /dev/null +++ b/cocos2d/CCLayer.m @@ -0,0 +1,432 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2008-2010 Ricardo Quesada + * Copyright (c) 2011 Zynga Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + */ + + +#import + +#import "Platforms/CCGL.h" + +#import "CCLayer.h" +#import "CCDirector.h" +#import "ccMacros.h" +#import "CCShaderCache.h" +#import "CCGLProgram.h" +#import "ccGLStateCache.h" +#import "Support/TransformUtils.h" +#import "Support/CGPointExtension.h" + +#ifdef __CC_PLATFORM_IOS +#import "Platforms/iOS/CCDirectorIOS.h" +#elif defined(__CC_PLATFORM_MAC) +#import "Platforms/Mac/CCDirectorMac.h" +#endif + +// extern +#import "kazmath/GL/matrix.h" + +#pragma mark - +#pragma mark Layer + +#if defined(__CC_PLATFORM_IOS) + +#endif // __CC_PLATFORM_IOS + +@implementation CCLayer + +- (id) init +{ + self = [super init]; + + CCLOG(@"WARNING! CCLayer is depricated, use CCNode instead"); + + return self; +} + +@end + +#pragma mark - LayerRGBA + + +#pragma mark - +#pragma mark LayerColor + +@interface CCLayerColor (Private) +-(void) updateColor; +@end + +@implementation CCLayerColor + +// Opacity and RGB color protocol +@synthesize blendFunc = _blendFunc; + + ++ (id) layerWithColor:(ccColor4B)color width:(GLfloat)w height:(GLfloat) h +{ + return [[self alloc] initWithColor:color width:w height:h]; +} + ++ (id) layerWithColor:(ccColor4B)color +{ + return [(CCLayerColor*)[self alloc] initWithColor:color]; +} + +-(id) init +{ + CGSize s = [[CCDirector sharedDirector] winSize]; + return [self initWithColor:ccc4(0,0,0,0) width:s.width height:s.height]; +} + +// Designated initializer +- (id) initWithColor:(ccColor4B)color width:(GLfloat)w height:(GLfloat) h +{ + if( (self=[super init]) ) { + + // default blend function + _blendFunc = (ccBlendFunc) { GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA }; + + _displayedColor.r = _realColor.r = color.r; + _displayedColor.g = _realColor.g = color.g; + _displayedColor.b = _realColor.b = color.b; + _displayedOpacity = _realOpacity = color.a; + + for (NSUInteger i = 0; i= rowColumns) { height += rowHeight + 5; - + columnsOccupied = 0; rowHeight = 0; ++row; } } NSAssert( !columnsOccupied, @"Too many rows/columns for available menu items." ); - + CGSize winSize = [[CCDirector sharedDirector] winSize]; - + row = 0; rowHeight = 0; rowColumns = 0; - float w, x, y = height / 2; - CCARRAY_FOREACH(children_, item) { + float w = 0.0, x = 0.0, y = height / 2; + for (CCMenuItem* item in _children) { if(rowColumns == 0) { rowColumns = [(NSNumber *) [rows objectAtIndex:row] unsignedIntegerValue]; w = winSize.width / (1 + rowColumns); x = w; } - + CGSize itemSize = item.contentSize; rowHeight = fmaxf(rowHeight, itemSize.height); [item setPosition:ccp(x - winSize.width / 2, y - itemSize.height / 2)]; - + x += w; ++columnsOccupied; - + if(columnsOccupied >= rowColumns) { y -= rowHeight + 5; - + columnsOccupied = 0; rowColumns = 0; rowHeight = 0; ++row; } } - - [rows release]; } -(void) alignItemsInRows: (NSNumber *) rows, ... @@ -467,28 +289,33 @@ -(void) alignItemsInRows: (NSNumber *) rows vaList: (va_list) args rows = va_arg(args, NSNumber*); } + [self alignItemsInRowsWithArray:columns]; + +} + +-(void) alignItemsInRowsWithArray:(NSArray*) columns +{ NSMutableArray *columnWidths = [[NSMutableArray alloc] init]; NSMutableArray *columnHeights = [[NSMutableArray alloc] init]; - + int width = -10, columnHeight = -5; NSUInteger column = 0, columnWidth = 0, rowsOccupied = 0, columnRows; - CCMenuItem *item; - CCARRAY_FOREACH(children_, item){ + for (CCMenuItem* item in _children){ NSAssert( column < [columns count], @"Too many menu items for the amount of rows/columns."); - + columnRows = [(NSNumber *) [columns objectAtIndex:column] unsignedIntegerValue]; NSAssert( columnRows, @"Can't have zero rows on a column"); - + CGSize itemSize = item.contentSize; columnWidth = fmaxf(columnWidth, itemSize.width); columnHeight += itemSize.height + 5; ++rowsOccupied; - + if(rowsOccupied >= columnRows) { [columnWidths addObject:[NSNumber numberWithUnsignedInteger:columnWidth]]; [columnHeights addObject:[NSNumber numberWithUnsignedInteger:columnHeight]]; width += columnWidth + 10; - + rowsOccupied = 0; columnWidth = 0; columnHeight = -5; @@ -496,29 +323,29 @@ -(void) alignItemsInRows: (NSNumber *) rows vaList: (va_list) args } } NSAssert( !rowsOccupied, @"Too many rows/columns for available menu items."); - + CGSize winSize = [[CCDirector sharedDirector] winSize]; - + column = 0; columnWidth = 0; columnRows = 0; - float x = -width / 2, y; - - CCARRAY_FOREACH(children_, item){ + float x = -width / 2, y = 0.0; + + for (CCMenuItem* item in _children){ if(columnRows == 0) { columnRows = [(NSNumber *) [columns objectAtIndex:column] unsignedIntegerValue]; y = ([(NSNumber *) [columnHeights objectAtIndex:column] intValue] + winSize.height) / 2; } - + CGSize itemSize = item.contentSize; columnWidth = fmaxf(columnWidth, itemSize.width); [item setPosition:ccp(x + [(NSNumber *) [columnWidths objectAtIndex:column] unsignedIntegerValue] / 2, y - winSize.height / 2)]; - + y -= itemSize.height + 10; ++rowsOccupied; - + if(rowsOccupied >= columnRows) { x += columnWidth + 5; - + rowsOccupied = 0; columnRows = 0; columnWidth = 0; @@ -526,29 +353,5 @@ -(void) alignItemsInRows: (NSNumber *) rows vaList: (va_list) args } } - [columns release]; - [columnWidths release]; - [columnHeights release]; -} - -#pragma mark Menu - Opacity Protocol - -/** Override synthesized setOpacity to recurse items */ -- (void) setOpacity:(GLubyte)newOpacity -{ - opacity_ = newOpacity; - - id item; - CCARRAY_FOREACH(children_, item) - [item setOpacity:opacity_]; -} - --(void) setColor:(ccColor3B)color -{ - color_ = color; - - id item; - CCARRAY_FOREACH(children_, item) - [item setColor:color_]; } @end diff --git a/cocos2d/CCMenuItem.h b/cocos2d/CCMenuItem.h new file mode 100644 index 0000000..2cc4f94 --- /dev/null +++ b/cocos2d/CCMenuItem.h @@ -0,0 +1,429 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2008-2011 Ricardo Quesada + * Copyright (c) 2011 Zynga Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + */ + +#import "CCNode.h" +#import "CCProtocols.h" + +@class CCSprite; +@class CCSpriteFrame; + +#define kCCItemSize 32 + +#pragma mark - +#pragma mark CCMenuItem +/** CCMenuItem base class + * + * Subclass CCMenuItem (or any subclass) to create your custom CCMenuItem objects. + */ +@interface CCMenuItem : CCNodeRGBA +{ + // used for menu items using a block + void (^_block)(id sender); + + BOOL _isEnabled; + BOOL _isSelected; + + BOOL _releaseBlockAtCleanup; + CGRect _activeArea; +} + +/** returns whether or not the item is selected +@since v0.8.2 +*/ +@property (nonatomic,readonly) BOOL isSelected; + +/** If enabled, it releases the block at cleanup time. + @since v2.1 + */ +@property (nonatomic) BOOL releaseBlockAtCleanup; + +/** the active area (relative to the current position) */ +@property (nonatomic,assign) CGRect activeArea; + +/** Creates a CCMenuItem with a target/selector. + target/selector will be implemented using blocks. + "target" won't be retained. + */ ++(id) itemWithTarget:(id)target selector:(SEL)selector; + +/** Creates a CCMenuItem with the specified block. + The block will be "copied". + */ ++(id) itemWithBlock:(void(^)(id sender))block; + +/** Initializes a CCMenuItem with a target/selector */ +-(id) initWithTarget:(id)target selector:(SEL)selector; + +/** Initializes a CCMenuItem with the specified block. + The block will be "copied". +*/ +-(id) initWithBlock:(void(^)(id sender))block; + +/** Activate the item */ +-(void) activate; + +/** The item was selected (not activated), similar to "mouse-over" */ +-(void) selected; + +/** The item was unselected */ +-(void) unselected; + +/** Enable or disabled the CCMenuItem */ +-(void) setIsEnabled:(BOOL)enabled; + +/** Returns whether or not the CCMenuItem is enabled */ +-(BOOL) isEnabled; + +/** Sets the block that is called when the item is tapped. + The block will be "copied". + */ +-(void) setBlock:(void(^)(id sender))block; + +/** Sets the target and selector that is called when the item is tapped. + target/selector will be implemented using blocks. + "target" won't be retained. + */ +-(void) setTarget:(id)target selector:(SEL)selector; + +/** cleanup event. It will release the block and call [super cleanup] */ +-(void) cleanup; + +@end + +#pragma mark - +#pragma mark CCMenuItemLabel + +/** An abstract class for "label" CCMenuItemLabel items + Any CCNode that supports the CCLabelProtocol protocol can be added. + Supported nodes: + - CCLabelBMFont + - CCLabelAtlas + - CCLabelTTF + */ +@interface CCMenuItemLabel : CCMenuItem +{ + CCNode *_label; + ccColor3B _colorBackup; + ccColor3B _disabledColor; + float _originalScale; +} + +/** the color that will be used to disable the item */ +@property (nonatomic,readwrite) ccColor3B disabledColor; + +/** Label that is rendered. It can be any CCNode that implements the CCLabelProtocol */ +@property (nonatomic,readwrite,unsafe_unretained) CCNode* label; + +/** creates a CCMenuItemLabel with a Label. */ ++(id) itemWithLabel:(CCNode*)label; + +/** creates a CCMenuItemLabel with a Label, target and selector. + The "target" won't be retained. + */ ++(id) itemWithLabel:(CCNode*)label target:(id)target selector:(SEL)selector; + +/** creates a CCMenuItemLabel with a Label and a block to execute. + The block will be "copied". + */ ++(id) itemWithLabel:(CCNode*)label block:(void(^)(id sender))block; + +/** initializes a CCMenuItemLabel with a Label, target and selector. + Internally it will create a block that executes the target/selector. + The "target" won't be retained. + */ +-(id) initWithLabel:(CCNode*)label target:(id)target selector:(SEL)selector; + +/** initializes a CCMenuItemLabel with a Label and a block to execute. + The block will be "copied". + This is the designated initializer. + */ +-(id) initWithLabel:(CCNode*)label block:(void(^)(id sender))block; + +/** sets a new string to the inner label */ +-(void) setString:(NSString*)label; + +/** Enable or disabled the CCMenuItemFont + @warning setIsEnabled changes the RGB color of the font + */ +-(void) setIsEnabled: (BOOL)enabled; +@end + +#pragma mark - +#pragma mark CCMenuItemAtlasFont + +/** A CCMenuItemAtlasFont + Helper class that creates a CCMenuItemLabel class with a CCLabelAtlas + */ +@interface CCMenuItemAtlasFont : CCMenuItemLabel +{ +} + +/** creates a menu item from a string and atlas with a target/selector */ ++(id) itemWithString: (NSString*) value charMapFile:(NSString*) charMapFile itemWidth:(int)itemWidth itemHeight:(int)itemHeight startCharMap:(char)startCharMap; + +/** creates a menu item from a string and atlas. Use it with CCMenuItemToggle. + The "target" won't be retained. + */ ++(id) itemWithString: (NSString*) value charMapFile:(NSString*) charMapFile itemWidth:(int)itemWidth itemHeight:(int)itemHeight startCharMap:(char)startCharMap target:(id)target selector:(SEL)selector; + +/** initializes a menu item from a string and atlas with a target/selector. + The "target" won't be retained. + */ +-(id) initWithString: (NSString*) value charMapFile:(NSString*) charMapFile itemWidth:(int)itemWidth itemHeight:(int)itemHeight startCharMap:(char)startCharMap target:(id)target selector:(SEL)selector; + +/** creates a menu item from a string and atlas. Use it with CCMenuItemToggle. + The block will be "copied". + */ ++(id) itemWithString: (NSString*) value charMapFile:(NSString*) charMapFile itemWidth:(int)itemWidth itemHeight:(int)itemHeight startCharMap:(char)startCharMap block:(void(^)(id sender))block; + +/** initializes a menu item from a string and atlas with a block. + The block will be "copied". + */ +-(id) initWithString: (NSString*) value charMapFile:(NSString*) charMapFile itemWidth:(int)itemWidth itemHeight:(int)itemHeight startCharMap:(char)startCharMap block:(void(^)(id sender))block; + +@end + +#pragma mark - +#pragma mark CCMenuItemFont + +/** A CCMenuItemFont + Helper class that creates a CCMenuItemLabel class with a Label + */ +@interface CCMenuItemFont : CCMenuItemLabel +{ + NSUInteger _fontSize; + NSString *_fontName; +} +/** set default font size */ ++(void) setFontSize: (NSUInteger) s; + +/** get default font size */ ++(NSUInteger) fontSize; + +/** set default font name */ ++(void) setFontName: (NSString*) n; + +/** get default font name */ ++(NSString*) fontName; + +/** creates a menu item from a string without target/selector. To be used with CCMenuItemToggle */ ++(id) itemWithString: (NSString*) value; + +/** creates a menu item from a string with a target/selector. + The "target" won't be retained. + */ ++(id) itemWithString: (NSString*) value target:(id) r selector:(SEL) s; + +/** creates a menu item from a string with the specified block. + The block will be "copied". + */ ++(id) itemWithString: (NSString*) value block:(void(^)(id sender))block; + +/** initializes a menu item from a string with a target/selector + The "target" won't be retained. + */ +-(id) initWithString: (NSString*) value target:(id) r selector:(SEL) s; + +/** set font size */ +-(void) setFontSize: (NSUInteger) s; + +/** get font size */ +-(NSUInteger) fontSize; + +/** set the font name */ +-(void) setFontName: (NSString*) n; + +/** get the font name */ +-(NSString*) fontName; + +/** initializes a menu item from a string with the specified block. + The block will be "copied". + */ +-(id) initWithString: (NSString*) value block:(void(^)(id sender))block; + +@end + +#pragma mark - +#pragma mark CCMenuItemSprite + +/** CCMenuItemSprite accepts CCNode objects as items. + The images has 3 different states: + - unselected image + - selected image + - disabled image + + @since v0.8.0 + */ +@interface CCMenuItemSprite : CCMenuItem +{ + CCNode *__unsafe_unretained _normalImage, *__unsafe_unretained _selectedImage, *__unsafe_unretained _disabledImage; +} + +// weak references + +/** the image used when the item is not selected */ +@property (nonatomic,readwrite,unsafe_unretained) CCNode *normalImage; +/** the image used when the item is selected */ +@property (nonatomic,readwrite,unsafe_unretained) CCNode *selectedImage; +/** the image used when the item is disabled */ +@property (nonatomic,readwrite,unsafe_unretained) CCNode *disabledImage; + +/** creates a menu item with a normal and selected image*/ ++(id) itemWithNormalSprite:(CCNode*)normalSprite selectedSprite:(CCNode*)selectedSprite; +/** creates a menu item with a normal and selected image with target/selector. + The "target" won't be retained. + */ ++(id) itemWithNormalSprite:(CCNode*)normalSprite selectedSprite:(CCNode*)selectedSprite target:(id)target selector:(SEL)selector; + +/** creates a menu item with a normal, selected and disabled image with target/selector. + The "target" won't be retained. + */ ++(id) itemWithNormalSprite:(CCNode*)normalSprite selectedSprite:(CCNode*)selectedSprite disabledSprite:(CCNode*)disabledSprite target:(id)target selector:(SEL)selector; + +/** creates a menu item with a normal and selected image with a block. + The block will be "copied". + */ ++(id) itemWithNormalSprite:(CCNode*)normalSprite selectedSprite:(CCNode*)selectedSprite block:(void(^)(id sender))block; + +/** creates a menu item with a normal, selected and disabled image with a block. + The block will be "copied". + */ ++(id) itemWithNormalSprite:(CCNode*)normalSprite selectedSprite:(CCNode*)selectedSprite disabledSprite:(CCNode*)disabledSprite block:(void(^)(id sender))block; + +/** initializes a menu item with a normal, selected and disabled image with target/selector. + The "target" won't be retained. + */ +-(id) initWithNormalSprite:(CCNode*)normalSprite selectedSprite:(CCNode*)selectedSprite disabledSprite:(CCNode*)disabledSprite target:(id)target selector:(SEL)selector; + +/** initializes a menu item with a normal, selected and disabled image with a block. + The block will be "copied". + */ +-(id) initWithNormalSprite:(CCNode*)normalSprite selectedSprite:(CCNode*)selectedSprite disabledSprite:(CCNode*)disabledSprite block:(void(^)(id sender))block; + +@end + +#pragma mark - +#pragma mark CCMenuItemImage + +/** CCMenuItemImage accepts images as items. + The images has 3 different states: + - unselected image + - selected image + - disabled image + + For best results try that all images are of the same size + */ +@interface CCMenuItemImage : CCMenuItemSprite +{ +} + +/** creates a menu item with a normal and selected image*/ ++(id) itemWithNormalImage: (NSString*)value selectedImage:(NSString*) value2; + +/** creates a menu item with a normal, selected and disabled image */ ++(id) itemWithNormalImage: (NSString*)value selectedImage:(NSString*) value2 disabledImage: (NSString*) value3; + +/** creates a menu item with a normal and selected image with target/selector */ ++(id) itemWithNormalImage: (NSString*)value selectedImage:(NSString*) value2 target:(id) r selector:(SEL) s; + +/** creates a menu item with a normal, selected and disabled image with target/selector. + The "target" won't be retained. + */ ++(id) itemWithNormalImage: (NSString*)value selectedImage:(NSString*) value2 disabledImage:(NSString*) value3 target:(id) r selector:(SEL) s; + +/** creates a menu item with a normal and selected image with a block. + The block will be "copied". + */ ++(id) itemWithNormalImage: (NSString*)value selectedImage:(NSString*) value2 block:(void(^)(id sender))block; + +/** creates a menu item with a normal, selected and disabled image with a block. + The block will be "copied". +*/ ++(id) itemWithNormalImage: (NSString*)value selectedImage:(NSString*) value2 disabledImage:(NSString*) value3 block:(void(^)(id sender))block; + +/** initializes a menu item with a normal, selected and disabled image with target/selector. + The "target" won't be retained. + */ +-(id) initWithNormalImage: (NSString*) value selectedImage:(NSString*)value2 disabledImage:(NSString*) value3 target:(id) r selector:(SEL) s; + +/** initializes a menu item with a normal, selected and disabled image with a block. + The block will be "copied". +*/ +-(id) initWithNormalImage: (NSString*) value selectedImage:(NSString*)value2 disabledImage:(NSString*) value3 block:(void(^)(id sender))block; + +/** sets the sprite frame for the normal image */ +- (void) setNormalSpriteFrame:(CCSpriteFrame*)frame; + +/** sets the sprite frame for the selected image */ +- (void) setSelectedSpriteFrame:(CCSpriteFrame*)frame; + +/** sets the sprite frame for the disabled image */ +- (void) setDisabledSpriteFrame:(CCSpriteFrame*)frame; + +@end + +#pragma mark - +#pragma mark CCMenuItemToggle + +/** A CCMenuItemToggle + A simple container class that "toggles" its inner items + The inner itmes can be any MenuItem + */ +@interface CCMenuItemToggle : CCMenuItem +{ + NSUInteger _selectedIndex; + NSMutableArray* _subItems; + CCMenuItem* __unsafe_unretained _currentItem; +} + +/** returns the selected item */ +@property (nonatomic,readwrite) NSUInteger selectedIndex; +/** NSMutableArray that contains the subitems. You can add/remove items in runtime, and you can replace the array with a new one. + @since v0.7.2 + */ +@property (nonatomic,readwrite,strong) NSMutableArray *subItems; + +/** creates a menu item from a list of items with a target/selector */ ++(id) itemWithTarget:(id)target selector:(SEL)selector items:(CCMenuItem*) item, ... NS_REQUIRES_NIL_TERMINATION; ++(id) itemWithTarget:(id)target selector:(SEL)selector items:(CCMenuItem*) item vaList:(va_list)args; + +/** creates a menu item from a list of items. */ ++(id) itemWithItems:(NSArray*)arrayOfItems; + +/** creates a menu item from a list of items and executes the given block when the item is selected. + The block will be "copied". + */ ++(id) itemWithItems:(NSArray*)arrayOfItems block:(void(^)(id sender))block; + +/** initializes a menu item from a list of items with a block. + The block will be "copied". + */ +-(id) initWithItems:(NSArray*)arrayOfItems block:(void (^)(id))block; + +/** return the selected item */ +-(CCMenuItem*) selectedItem; +@end + diff --git a/src/cocos2d/CCMenuItem.m b/cocos2d/CCMenuItem.m similarity index 59% rename from src/cocos2d/CCMenuItem.m rename to cocos2d/CCMenuItem.m index 4a38b59..a31ed90 100644 --- a/src/cocos2d/CCMenuItem.m +++ b/cocos2d/CCMenuItem.m @@ -30,14 +30,16 @@ #import "CCActionInterval.h" #import "CCSprite.h" #import "Support/CGPointExtension.h" +#import +#import "CCMenu.h" -static NSUInteger _fontSize = kCCItemSize; -static NSString *_fontName = @"Marker Felt"; -static BOOL _fontNameRelease = NO; +static NSUInteger _globalFontSize = kCCItemSize; +static NSString *_globalFontName = @"Marker Felt"; +static BOOL _globalFontNameRelease = NO; -const NSInteger kCCCurrentItemTag = 0xc0c05001; -const NSInteger kCCZoomActionTag = 0xc0c05002; +static const NSInteger kCCCurrentItemTag = 0xc0c05001; +static const NSInteger kCCZoomActionTag = 0xc0c05002; #pragma mark - @@ -45,14 +47,17 @@ @implementation CCMenuItem -@synthesize isSelected=isSelected_; +@synthesize isSelected=_isSelected; +@synthesize releaseBlockAtCleanup=_releaseBlockAtCleanup; +@synthesize activeArea=_activeArea; + +(id) itemWithTarget:(id) r selector:(SEL) s { - return [[[self alloc] initWithTarget:r selector:s] autorelease]; + return [[self alloc] initWithTarget:r selector:s]; } +(id) itemWithBlock:(void(^)(id sender))block { - return [[[self alloc] initWithBlock:block] autorelease]; + return [[self alloc] initWithBlock:block]; } -(id) init @@ -63,93 +68,163 @@ -(id) init -(id) initWithTarget:(id)target selector:(SEL)selector { // avoid retain cycle - __block id t = target; + __unsafe_unretained id t = target; return [self initWithBlock:^(id sender) { - - [t performSelector:selector withObject:sender]; + + objc_msgSend(t, selector, sender); }]; } // Designated initializer --(id) initWithBlock:(void (^)(id))block -{ - if((self=[super init]) ) { +-(id) initWithBlock:(void (^)(id))block { + + self = [ super init ]; + NSAssert( self != nil, @"Unable to create class" ); + + if( block ) + _block = [block copy]; + + self.anchorPoint = ccp(0.5f, 0.5f); + _isEnabled = YES; + _isSelected = NO; + + // enable touch handling for all menu items + self.userInteractionEnabled = YES; + + // WARNING: Will be disabled in v2.2 + _releaseBlockAtCleanup = YES; - if( block ) - block_ = [block copy]; - - anchorPoint_ = ccp(0.5f, 0.5f); - isEnabled_ = YES; - isSelected_ = NO; + + return( self ); +} - } - return self; +-(void) setContentSize:(CGSize)contentSize { + [super setContentSize:contentSize]; + + // Reset touch area to match the outside box + _activeArea = CGRectMake(0, 0, contentSize.width, contentSize.height); } --(void) dealloc -{ - [block_ release]; - [super dealloc]; -} -(void) cleanup { - [block_ release]; - block_ = nil; + if( _releaseBlockAtCleanup ) { + _block = nil; + } [super cleanup]; } -(void) selected { - isSelected_ = YES; + _isSelected = YES; } -(void) unselected { - isSelected_ = NO; + _isSelected = NO; } -(void) activate { - if(isEnabled_&& block_ ) - block_(self); + if(_isEnabled && _block ) + _block(self); } -(void) setIsEnabled: (BOOL)enabled { - isEnabled_ = enabled; + _isEnabled = enabled; } -(BOOL) isEnabled { - return isEnabled_; -} - --(CGRect) rect -{ - return CGRectMake( position_.x - contentSize_.width*anchorPoint_.x, - position_.y - contentSize_.height*anchorPoint_.y, - contentSize_.width, contentSize_.height); + return _isEnabled; } -(void) setBlock:(void(^)(id sender))block { - [block_ release]; - block_ = [block copy]; + _block = [block copy]; } -(void) setTarget:(id)target selector:(SEL)selector { - [self setBlock:^(id sender) { - - [target performSelector:selector withObject:sender]; + __unsafe_unretained id weakTarget = target; // avoid retain cycle + [self setBlock:^(id sender) { + objc_msgSend(weakTarget, selector, sender); }]; } +// ----------------------------------------------------------------- +#pragma mark - iOS touch functionality - +// ----------------------------------------------------------------- + +#if TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR + +/** touch protocol implementation + @since v2.5 + */ + +- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event +{ + // if menu item is child of a menu, notify the menu that a child has been pressed + if ([self.parent isMemberOfClass:[CCMenu class]] == YES) [((CCMenu*)self.parent) menuItemPressed:self]; + + // perform pressed selector + [self selected]; +} + +- (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event +{ + // perform cancelled selector + [self unselected]; +} + +- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event +{ + // if menu item is child of a menu, notify the menu that a child has been released + if ([self.parent isMemberOfClass:[CCMenu class]] == YES) [((CCMenu*)self.parent) menuItemReleased:self]; + + // perform released selector + [self unselected]; + [self activate]; +} + +#else + +// ----------------------------------------------------------------- +#pragma mark - Mac mouse functionality - +// ----------------------------------------------------------------- + +/** mouse protocol implementation + @since v2.5 + */ + +- (void)mouseDown:(NSEvent *)theEvent +{ + // if menu item is child of a menu, notify the menu that a child has been pressed + if ([self.parent isMemberOfClass:[CCMenu class]] == YES) [((CCMenu*)self.parent) menuItemPressed:self]; + + // perform pressed selector + [self selected]; +} + +- (void)mouseUp:(NSEvent *)theEvent +{ + // if menu item is child of a menu, notify the menu that a child has been released + if ([self.parent isMemberOfClass:[CCMenu class]] == YES) [((CCMenu*)self.parent) menuItemReleased:self]; + + // perform released selector + [self unselected]; + [self activate]; +} + +#endif + +// ----------------------------------------------------------------- + @end @@ -158,30 +233,30 @@ -(void) setTarget:(id)target selector:(SEL)selector @implementation CCMenuItemLabel -@synthesize disabledColor = disabledColor_; +@synthesize disabledColor = _disabledColor; +(id) itemWithLabel:(CCNode*)label { - return [[[self alloc] initWithLabel:label block:nil] autorelease]; + return [[self alloc] initWithLabel:label block:nil]; } +(id) itemWithLabel:(CCNode*)label target:(id)target selector:(SEL)selector { - return [[[self alloc] initWithLabel:label target:target selector:selector] autorelease]; + return [[self alloc] initWithLabel:label target:target selector:selector]; } +(id) itemWithLabel:(CCNode*)label block:(void(^)(id sender))block { - return [[[self alloc] initWithLabel:label block:block] autorelease]; + return [[self alloc] initWithLabel:label block:block]; } -(id) initWithLabel:(CCNode*)label target:(id)target selector:(SEL)selector { // avoid retain cycle - __block id t = target; + __unsafe_unretained id t = target; self = [self initWithLabel:label block: ^(id sender) { - [t performSelector:selector withObject:sender]; + objc_msgSend(t, selector, sender); } ]; return self; @@ -193,10 +268,13 @@ -(id) initWithLabel:(CCNode*)label target:(id)ta -(id) initWithLabel:(CCNode *)label block:(void (^)(id))block { if( (self=[self initWithBlock:block]) ) { - originalScale_ = 1; - colorBackup = ccWHITE; - disabledColor_ = ccc3( 126,126,126); + _originalScale = 1; + _colorBackup = ccWHITE; + self.disabledColor = ccc3( 126,126,126); self.label = label; + + self.cascadeColorEnabled = YES; + self.cascadeOpacityEnabled = YES; } return self; @@ -204,32 +282,32 @@ -(id) initWithLabel:(CCNode *)label block:(void -(CCNode*) label { - return label_; + return _label; } -(void) setLabel:(CCNode*) label { - if( label != label_ ) { - [self removeChild:label_ cleanup:YES]; + if( label != _label ) { + [self removeChild:_label cleanup:YES]; [self addChild:label]; - label_ = label; - label_.anchorPoint = ccp(0,0); + _label = label; + _label.anchorPoint = ccp(0,0); - [self setContentSize:[label_ contentSize]]; + [self setContentSize:[_label contentSize]]; } } -(void) setString:(NSString *)string { - [label_ setString:string]; - [self setContentSize: [label_ contentSize]]; + [_label setString:string]; + [self setContentSize: [_label contentSize]]; } -(void) activate { - if(isEnabled_) { + if(_isEnabled) { [self stopAllActions]; - self.scale = originalScale_; + self.scale = _originalScale; [super activate]; } @@ -238,16 +316,16 @@ -(void) activate { -(void) selected { // subclass to change the default action - if(isEnabled_) { + if(_isEnabled) { [super selected]; CCAction *action = [self getActionByTag:kCCZoomActionTag]; if( action ) [self stopAction:action]; else - originalScale_ = self.scale; + _originalScale = self.scale; - CCAction *zoomAction = [CCScaleTo actionWithDuration:0.1f scale:originalScale_ * 1.2f]; + CCAction *zoomAction = [CCScaleTo actionWithDuration:0.1f scale:_originalScale * 1.2f]; zoomAction.tag = kCCZoomActionTag; [self runAction:zoomAction]; } @@ -256,10 +334,10 @@ -(void) selected -(void) unselected { // subclass to change the default action - if(isEnabled_) { + if(_isEnabled) { [super unselected]; [self stopActionByTag:kCCZoomActionTag]; - CCAction *zoomAction = [CCScaleTo actionWithDuration:0.1f scale:originalScale_]; + CCAction *zoomAction = [CCScaleTo actionWithDuration:0.1f scale:_originalScale]; zoomAction.tag = kCCZoomActionTag; [self runAction:zoomAction]; } @@ -267,34 +345,17 @@ -(void) unselected -(void) setIsEnabled: (BOOL)enabled { - if( isEnabled_ != enabled ) { + if( _isEnabled != enabled ) { if(enabled == NO) { - colorBackup = [label_ color]; - [label_ setColor: disabledColor_]; + _colorBackup = [_label color]; + [_label setColor: _disabledColor]; } else - [label_ setColor:colorBackup]; + [_label setColor:_colorBackup]; } [super setIsEnabled:enabled]; } - -- (void) setOpacity: (GLubyte)opacity -{ - [label_ setOpacity:opacity]; -} --(GLubyte) opacity -{ - return [label_ opacity]; -} --(void) setColor:(ccColor3B)color -{ - [label_ setColor:color]; -} --(ccColor3B) color -{ - return [label_ color]; -} @end #pragma mark - CCMenuItemAtlasFont @@ -308,21 +369,21 @@ +(id) itemWithString: (NSString*) value charMapFile:(NSString*) charMapFile item +(id) itemWithString: (NSString*) value charMapFile:(NSString*) charMapFile itemWidth:(int)itemWidth itemHeight:(int)itemHeight startCharMap:(char)startCharMap target:(id)target selector:(SEL)selector { - return [[[self alloc] initWithString:value charMapFile:charMapFile itemWidth:itemWidth itemHeight:itemHeight startCharMap:startCharMap target:target selector:selector] autorelease]; + return [[self alloc] initWithString:value charMapFile:charMapFile itemWidth:itemWidth itemHeight:itemHeight startCharMap:startCharMap target:target selector:selector]; } +(id) itemWithString:(NSString*)value charMapFile:(NSString*)charMapFile itemWidth:(int)itemWidth itemHeight:(int)itemHeight startCharMap:(char)startCharMap block:(void(^)(id sender))block { - return [[[self alloc] initWithString:value charMapFile:charMapFile itemWidth:itemWidth itemHeight:itemHeight startCharMap:startCharMap block:block] autorelease]; + return [[self alloc] initWithString:value charMapFile:charMapFile itemWidth:itemWidth itemHeight:itemHeight startCharMap:startCharMap block:block]; } -(id) initWithString: (NSString*) value charMapFile:(NSString*) charMapFile itemWidth:(int)itemWidth itemHeight:(int)itemHeight startCharMap:(char)startCharMap target:(id)target selector:(SEL)selector { // avoid retain cycle - __block id t = target; + __unsafe_unretained id t = target; return [self initWithString:value charMapFile:charMapFile itemWidth:itemWidth itemHeight:itemHeight startCharMap:startCharMap block:^(id sender) { - [t performSelector:selector withObject:sender]; + objc_msgSend(t, selector, sender); } ]; } @@ -337,16 +398,11 @@ -(id) initWithString:(NSString*)value charMapFile:(NSString*)charMapFile itemWid id ret = [self initWithLabel:label block:block]; - [label release]; return ret; } --(void) dealloc -{ - [super dealloc]; -} @end @@ -356,50 +412,48 @@ @implementation CCMenuItemFont +(void) setFontSize: (NSUInteger) s { - _fontSize = s; + _globalFontSize = s; } +(NSUInteger) fontSize { - return _fontSize; + return _globalFontSize; } +(void) setFontName: (NSString*) n { - if( _fontNameRelease ) - [_fontName release]; - _fontName = [n retain]; - _fontNameRelease = YES; + _globalFontName = n; + _globalFontNameRelease = YES; } +(NSString*) fontName { - return _fontName; + return _globalFontName; } +(id) itemWithString: (NSString*) value target:(id) r selector:(SEL) s { - return [[[self alloc] initWithString: value target:r selector:s] autorelease]; + return [[self alloc] initWithString: value target:r selector:s]; } +(id) itemWithString: (NSString*) value { - return [[[self alloc] initWithString: value target:nil selector:nil] autorelease]; + return [[self alloc] initWithString: value target:nil selector:nil]; } +(id) itemWithString: (NSString*) value block:(void(^)(id sender))block { - return [[[self alloc] initWithString:value block:block] autorelease]; + return [[self alloc] initWithString:value block:block]; } -(id) initWithString: (NSString*) value target:(id)target selector:(SEL)selector { // avoid retain cycle - __block id t = target; + __unsafe_unretained id t = target; return [self initWithString:value block:^(id sender) { - [t performSelector:selector withObject:sender]; + objc_msgSend(t, selector, sender); }]; } @@ -410,10 +464,10 @@ -(id) initWithString: (NSString*)string block:(void(^)(id sender))block { NSAssert( [string length] > 0, @"Value length must be greater than 0"); - fontName_ = [_fontName copy]; - fontSize_ = _fontSize; + _fontName = [_globalFontName copy]; + _fontSize = _globalFontSize; - CCLabelTTF *label = [CCLabelTTF labelWithString:string fontName:fontName_ fontSize:fontSize_]; + CCLabelTTF *label = [CCLabelTTF labelWithString:string fontName:_fontName fontSize:_fontSize]; if((self=[super initWithLabel:label block:block]) ) { // do something ? @@ -424,34 +478,31 @@ -(id) initWithString: (NSString*)string block:(void(^)(id sender))block -(void) recreateLabel { - CCLabelTTF *label = [[CCLabelTTF alloc] initWithString:[label_ string] fontName:fontName_ fontSize:fontSize_]; + CCLabelTTF *label = [[CCLabelTTF alloc] initWithString:[_label string] fontName:_fontName fontSize:_fontSize]; self.label = label; - [label release]; } -(void) setFontSize: (NSUInteger) size { - fontSize_ = size; + _fontSize = size; [self recreateLabel]; } -(NSUInteger) fontSize { - return fontSize_; + return _fontSize; } -(void) setFontName: (NSString*) fontName { - if (fontName_) - [fontName_ release]; - fontName_ = [fontName copy]; + _fontName = [fontName copy]; [self recreateLabel]; } -(NSString*) fontName { - return fontName_; + return _fontName; } @end @@ -463,7 +514,7 @@ -(void) updateImagesVisibility; @implementation CCMenuItemSprite -@synthesize normalImage=normalImage_, selectedImage=selectedImage_, disabledImage=disabledImage_; +@synthesize normalImage=_normalImage, selectedImage=_selectedImage, disabledImage=_disabledImage; +(id) itemWithNormalSprite:(CCNode*)normalSprite selectedSprite:(CCNode*)selectedSprite { @@ -477,7 +528,7 @@ +(id) itemWithNormalSprite:(CCNode*)normalSprite selectedSprite: +(id) itemWithNormalSprite:(CCNode*)normalSprite selectedSprite:(CCNode*)selectedSprite disabledSprite:(CCNode*)disabledSprite target:(id)target selector:(SEL)selector { - return [[[self alloc] initWithNormalSprite:normalSprite selectedSprite:selectedSprite disabledSprite:disabledSprite target:target selector:selector] autorelease]; + return [[self alloc] initWithNormalSprite:normalSprite selectedSprite:selectedSprite disabledSprite:disabledSprite target:target selector:selector]; } +(id) itemWithNormalSprite:(CCNode*)normalSprite selectedSprite:(CCNode*)selectedSprite block:(void(^)(id sender))block @@ -487,16 +538,16 @@ +(id) itemWithNormalSprite:(CCNode*)normalSprite selectedSprite: +(id) itemWithNormalSprite:(CCNode*)normalSprite selectedSprite:(CCNode*)selectedSprite disabledSprite:(CCNode*)disabledSprite block:(void(^)(id sender))block { - return [[[self alloc] initWithNormalSprite:normalSprite selectedSprite:selectedSprite disabledSprite:disabledSprite block:block] autorelease]; + return [[self alloc] initWithNormalSprite:normalSprite selectedSprite:selectedSprite disabledSprite:disabledSprite block:block]; } -(id) initWithNormalSprite:(CCNode*)normalSprite selectedSprite:(CCNode*)selectedSprite disabledSprite:(CCNode*)disabledSprite target:(id)target selector:(SEL)selector { // avoid retain cycle - __block id t = target; + __unsafe_unretained id t = target; return [self initWithNormalSprite:normalSprite selectedSprite:selectedSprite disabledSprite:disabledSprite block:^(id sender) { - [t performSelector:selector withObject:sender]; + objc_msgSend(t, selector, sender); } ]; } @@ -511,22 +562,25 @@ -(id) initWithNormalSprite:(CCNode*)normalSprite selectedSprite: self.selectedImage = selectedSprite; self.disabledImage = disabledSprite; - [self setContentSize: [normalImage_ contentSize]]; + [self setContentSize: [_normalImage contentSize]]; + + self.cascadeColorEnabled = YES; + self.cascadeOpacityEnabled = YES; } return self; } -(void) setNormalImage:(CCNode *)image { - if( image != normalImage_ ) { + if( image != _normalImage ) { image.anchorPoint = ccp(0,0); - [self removeChild:normalImage_ cleanup:YES]; + [self removeChild:_normalImage cleanup:YES]; [self addChild:image]; - normalImage_ = image; + _normalImage = image; - [self setContentSize: [normalImage_ contentSize]]; + [self setContentSize: [_normalImage contentSize]]; [self updateImagesVisibility]; } @@ -534,13 +588,13 @@ -(void) setNormalImage:(CCNode *)image -(void) setSelectedImage:(CCNode *)image { - if( image != selectedImage_ ) { + if( image != _selectedImage ) { image.anchorPoint = ccp(0,0); - [self removeChild:selectedImage_ cleanup:YES]; + [self removeChild:_selectedImage cleanup:YES]; [self addChild:image]; - selectedImage_ = image; + _selectedImage = image; [self updateImagesVisibility]; } @@ -548,72 +602,46 @@ -(void) setSelectedImage:(CCNode *)image -(void) setDisabledImage:(CCNode *)image { - if( image != disabledImage_ ) { + if( image != _disabledImage ) { image.anchorPoint = ccp(0,0); - [self removeChild:disabledImage_ cleanup:YES]; + [self removeChild:_disabledImage cleanup:YES]; [self addChild:image]; - disabledImage_ = image; + _disabledImage = image; [self updateImagesVisibility]; } } -#pragma mark CCMenuItemSprite - CCRGBAProtocol protocol - -- (void) setOpacity: (GLubyte)opacity -{ - [normalImage_ setOpacity:opacity]; - [selectedImage_ setOpacity:opacity]; - [disabledImage_ setOpacity:opacity]; -} - --(void) setColor:(ccColor3B)color -{ - [normalImage_ setColor:color]; - [selectedImage_ setColor:color]; - [disabledImage_ setColor:color]; -} - --(GLubyte) opacity -{ - return [normalImage_ opacity]; -} - --(ccColor3B) color -{ - return [normalImage_ color]; -} - -(void) selected { [super selected]; - if( selectedImage_ ) { - [normalImage_ setVisible:NO]; - [selectedImage_ setVisible:YES]; - [disabledImage_ setVisible:NO]; + if( _selectedImage ) { + [_normalImage setVisible:NO]; + [_selectedImage setVisible:YES]; + [_disabledImage setVisible:NO]; } else { // there is not selected image - [normalImage_ setVisible:YES]; - [selectedImage_ setVisible:NO]; - [disabledImage_ setVisible:NO]; + [_normalImage setVisible:YES]; + [_selectedImage setVisible:NO]; + [_disabledImage setVisible:NO]; } } -(void) unselected { [super unselected]; - [normalImage_ setVisible:YES]; - [selectedImage_ setVisible:NO]; - [disabledImage_ setVisible:NO]; + [_normalImage setVisible:YES]; + [_selectedImage setVisible:NO]; + [_disabledImage setVisible:NO]; } -(void) setIsEnabled:(BOOL)enabled { - if( isEnabled_ != enabled ) { + if( _isEnabled != enabled ) { [super setIsEnabled:enabled]; [self updateImagesVisibility]; @@ -624,20 +652,20 @@ -(void) setIsEnabled:(BOOL)enabled // Helper -(void) updateImagesVisibility { - if( isEnabled_ ) { - [normalImage_ setVisible:YES]; - [selectedImage_ setVisible:NO]; - [disabledImage_ setVisible:NO]; + if( _isEnabled ) { + [_normalImage setVisible:YES]; + [_selectedImage setVisible:NO]; + [_disabledImage setVisible:NO]; } else { - if( disabledImage_ ) { - [normalImage_ setVisible:NO]; - [selectedImage_ setVisible:NO]; - [disabledImage_ setVisible:YES]; + if( _disabledImage ) { + [_normalImage setVisible:NO]; + [_selectedImage setVisible:NO]; + [_disabledImage setVisible:YES]; } else { - [normalImage_ setVisible:YES]; - [selectedImage_ setVisible:NO]; - [disabledImage_ setVisible:NO]; + [_normalImage setVisible:YES]; + [_selectedImage setVisible:NO]; + [_disabledImage setVisible:NO]; } } } @@ -660,12 +688,12 @@ +(id) itemWithNormalImage: (NSString*)value selectedImage:(NSString*) value2 tar +(id) itemWithNormalImage: (NSString*)value selectedImage:(NSString*) value2 disabledImage: (NSString*) value3 { - return [[[self alloc] initWithNormalImage:value selectedImage:value2 disabledImage:value3 target:nil selector:nil] autorelease]; + return [[self alloc] initWithNormalImage:value selectedImage:value2 disabledImage:value3 target:nil selector:nil]; } +(id) itemWithNormalImage: (NSString*)value selectedImage:(NSString*) value2 disabledImage: (NSString*) value3 target:(id) t selector:(SEL) s { - return [[[self alloc] initWithNormalImage:value selectedImage:value2 disabledImage:value3 target:t selector:s] autorelease]; + return [[self alloc] initWithNormalImage:value selectedImage:value2 disabledImage:value3 target:t selector:s]; } +(id) itemWithNormalImage: (NSString*)value selectedImage:(NSString*) value2 block:(void(^)(id sender))block @@ -675,16 +703,16 @@ +(id) itemWithNormalImage: (NSString*)value selectedImage:(NSString*) value2 blo +(id) itemWithNormalImage: (NSString*)value selectedImage:(NSString*) value2 disabledImage:(NSString*) value3 block:(void(^)(id sender))block { - return [[[self alloc] initWithNormalImage:value selectedImage:value2 disabledImage:value3 block:block] autorelease]; + return [[self alloc] initWithNormalImage:value selectedImage:value2 disabledImage:value3 block:block]; } -(id) initWithNormalImage: (NSString*) normalI selectedImage:(NSString*)selectedI disabledImage: (NSString*) disabledI target:(id)target selector:(SEL)selector { // avoid retain cycle - __block id t = target; + __unsafe_unretained id t = target; return [self initWithNormalImage:normalI selectedImage:selectedI disabledImage:disabledI block:^(id sender) { - [t performSelector:selector withObject:sender]; + objc_msgSend(t, selector, sender); }]; } @@ -731,31 +759,32 @@ -(void) setDisabledSpriteFrame:(CCSpriteFrame *)frame // // MenuItemToggle // -@implementation CCMenuItemToggle +@interface CCMenuItemToggle () +/** + Reference to the current display item. + */ +@property (nonatomic, unsafe_unretained) CCMenuItem *currentItem; +@end -@synthesize subItems = subItems_; -@synthesize opacity = opacity_, color = color_; +@implementation CCMenuItemToggle +@synthesize currentItem = _currentItem; +@synthesize subItems = _subItems; +(id) itemWithTarget: (id)t selector: (SEL)sel items: (CCMenuItem*) item, ... { va_list args; va_start(args, item); - - id s = [[[self alloc] initWithTarget: t selector:sel items: item vaList:args] autorelease]; - + + id s = [self itemWithTarget: t selector:sel items: item vaList:args]; + va_end(args); return s; } -+(id) itemWithItems:(NSArray*)arrayOfItems block:(void(^)(id))block -{ - return [[[self alloc] initWithItems:arrayOfItems block:block] autorelease]; -} - --(id) initWithTarget:(id)target selector:(SEL)selector items:(CCMenuItem*) item vaList: (va_list) args ++(id) itemWithTarget:(id)target selector:(SEL)selector items:(CCMenuItem*) item vaList: (va_list) args { NSMutableArray *array = [NSMutableArray arrayWithCapacity:2]; - + int z = 0; CCMenuItem *i = item; while(i) { @@ -763,14 +792,25 @@ -(id) initWithTarget:(id)target selector:(SEL)selector items:(CCMenuItem*) item [array addObject:i]; i = va_arg(args, CCMenuItem*); } - + // avoid retain cycle - __block id t = target; - - return [self initWithItems:array block:^(id sender) { - [t performSelector:selector withObject:sender]; + __unsafe_unretained id t = target; + + return [[self alloc] initWithItems:array block:^(id sender) { + objc_msgSend(t, selector, sender); } - ]; + ]; +} + + ++(id) itemWithItems:(NSArray*)arrayOfItems +{ + return [[self alloc] initWithItems:arrayOfItems block:NULL]; +} + ++(id) itemWithItems:(NSArray*)arrayOfItems block:(void(^)(id))block +{ + return [[self alloc] initWithItems:arrayOfItems block:block]; } -(id) initWithItems:(NSArray*)arrayOfItems block:(void(^)(id sender))block @@ -779,29 +819,29 @@ -(id) initWithItems:(NSArray*)arrayOfItems block:(void(^)(id sender))block self.subItems = [NSMutableArray arrayWithArray:arrayOfItems]; - selectedIndex_ = NSUIntegerMax; + _currentItem = nil; + _selectedIndex = NSUIntegerMax; [self setSelectedIndex:0]; + + self.cascadeColorEnabled = YES; + self.cascadeOpacityEnabled = YES; } return self; } --(void) dealloc -{ - [subItems_ release]; - [super dealloc]; -} -(void)setSelectedIndex:(NSUInteger)index { - if( index != selectedIndex_ ) { - selectedIndex_=index; - CCMenuItem *currentItem = (CCMenuItem*)[self getChildByTag:kCCCurrentItemTag]; - if( currentItem ) - [currentItem removeFromParentAndCleanup:NO]; + if( index != _selectedIndex ) { + _selectedIndex=index; + + if( _currentItem ) + [_currentItem removeFromParentAndCleanup:NO]; - CCMenuItem *item = [subItems_ objectAtIndex:selectedIndex_]; - [self addChild:item z:0 tag:kCCCurrentItemTag]; + CCMenuItem *item = [_subItems objectAtIndex:_selectedIndex]; + [self addChild:item z:0]; + self.currentItem = item; CGSize s = [item contentSize]; [self setContentSize: s]; @@ -811,27 +851,27 @@ -(void)setSelectedIndex:(NSUInteger)index -(NSUInteger) selectedIndex { - return selectedIndex_; + return _selectedIndex; } -(void) selected { [super selected]; - [[subItems_ objectAtIndex:selectedIndex_] selected]; + [[_subItems objectAtIndex:_selectedIndex] selected]; } -(void) unselected { [super unselected]; - [[subItems_ objectAtIndex:selectedIndex_] unselected]; + [[_subItems objectAtIndex:_selectedIndex] unselected]; } -(void) activate { // update index - if( isEnabled_ ) { - NSUInteger newIndex = (selectedIndex_ + 1) % [subItems_ count]; + if( _isEnabled ) { + NSUInteger newIndex = (_selectedIndex + 1) % [_subItems count]; [self setSelectedIndex:newIndex]; } @@ -841,32 +881,16 @@ -(void) activate -(void) setIsEnabled: (BOOL)enabled { - if( isEnabled_ != enabled ) { + if( _isEnabled != enabled ) { [super setIsEnabled:enabled]; - for(CCMenuItem* item in subItems_) + for(CCMenuItem* item in _subItems) [item setIsEnabled:enabled]; } } -(CCMenuItem*) selectedItem { - return [subItems_ objectAtIndex:selectedIndex_]; -} - -#pragma mark CCMenuItemToggle - CCRGBAProtocol protocol - -- (void) setOpacity: (GLubyte)opacity -{ - opacity_ = opacity; - for(CCMenuItem* item in subItems_) - [item setOpacity:opacity]; -} - -- (void) setColor:(ccColor3B)color -{ - color_ = color; - for(CCMenuItem* item in subItems_) - [item setColor:color]; + return [_subItems objectAtIndex:_selectedIndex]; } @end diff --git a/cocos2d/CCMotionStreak.h b/cocos2d/CCMotionStreak.h new file mode 100644 index 0000000..865867f --- /dev/null +++ b/cocos2d/CCMotionStreak.h @@ -0,0 +1,86 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2011 ForzeField Studios S.L. http://forzefield.com + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + */ + + +#import +#import "CCTexture2D.h" +#import "ccTypes.h" +#import "CCNode.h" + +/** MotionStreak. + Creates a trailing path. + */ +@interface CCMotionStreak : CCNodeRGBA +{ + CCTexture2D *_texture; + CGPoint _positionR; + ccBlendFunc _blendFunc; + float _stroke; + float _fadeDelta; + float _minSeg; + + NSUInteger _maxPoints; + NSUInteger _nuPoints; + NSUInteger _previousNuPoints; + + /** Pointers */ + CGPoint *_pointVertexes; + float *_pointState; + + // Opengl + ccVertex2F *_vertices; + unsigned char *_colorPointer; + ccTex2F *_texCoords; + + BOOL _fastMode; + + BOOL _startingPositionInitialized; +} +/** blending function */ +@property (nonatomic, readwrite, assign) ccBlendFunc blendFunc; + +/** When fast mode is enabled, new points are added faster but with lower precision */ +@property (nonatomic, readwrite, assign, getter = isFastMode) BOOL fastMode; + +/** texture used for the motion streak */ +@property (nonatomic, strong) CCTexture2D *texture; + +/** creates and initializes a motion streak with fade in seconds, minimum segments, stroke's width, color, texture filename */ ++ (id) streakWithFade:(float)fade minSeg:(float)minSeg width:(float)stroke color:(ccColor3B)color textureFilename:(NSString*)path; +/** creates and initializes a motion streak with fade in seconds, minimum segments, stroke's width, color, texture */ ++ (id) streakWithFade:(float)fade minSeg:(float)minSeg width:(float)stroke color:(ccColor3B)color texture:(CCTexture2D*)texture; + +/** initializes a motion streak with fade in seconds, minimum segments, stroke's width, color and texture filename */ +- (id) initWithFade:(float)fade minSeg:(float)minSeg width:(float)stroke color:(ccColor3B)color textureFilename:(NSString*)path; +/** initializes a motion streak with fade in seconds, minimum segments, stroke's width, color and texture */ +- (id) initWithFade:(float)fade minSeg:(float)minSeg width:(float)stroke color:(ccColor3B)color texture:(CCTexture2D*)texture; + +/** color used for the tint */ +- (void) tintWithColor:(ccColor3B)colors; + +/** Remove all living segments of the ribbon */ +- (void) reset; + +@end diff --git a/src/cocos2d/CCMotionStreak.m b/cocos2d/CCMotionStreak.m similarity index 52% rename from src/cocos2d/CCMotionStreak.m rename to cocos2d/CCMotionStreak.m index e299eef..b693054 100644 --- a/src/cocos2d/CCMotionStreak.m +++ b/cocos2d/CCMotionStreak.m @@ -35,18 +35,18 @@ @implementation CCMotionStreak -@synthesize texture = texture_; -@synthesize blendFunc = blendFunc_; -@synthesize fastMode = fastMode_; +@synthesize texture = _texture; +@synthesize blendFunc = _blendFunc; +@synthesize fastMode = _fastMode; + (id) streakWithFade:(float)fade minSeg:(float)minSeg width:(float)stroke color:(ccColor3B)color textureFilename:(NSString*)path { - return [[[self alloc] initWithFade:fade minSeg:minSeg width:stroke color:color textureFilename:path] autorelease]; + return [[self alloc] initWithFade:fade minSeg:minSeg width:stroke color:color textureFilename:path]; } + (id) streakWithFade:(float)fade minSeg:(float)minSeg width:(float)stroke color:(ccColor3B)color texture:(CCTexture2D*)texture { - return [[[self alloc] initWithFade:fade minSeg:minSeg width:stroke color:color texture:texture] autorelease]; + return [[self alloc] initWithFade:fade minSeg:minSeg width:stroke color:color texture:texture]; } - (id) initWithFade:(float)fade minSeg:(float)minSeg width:(float)stroke color:(ccColor3B)color textureFilename:(NSString*)path @@ -57,6 +57,8 @@ - (id) initWithFade:(float)fade minSeg:(float)minSeg width:(float)stroke color:( return [self initWithFade:fade minSeg:minSeg width:stroke color:color texture:texture]; } +#pragma clang diagnostic push COCOS2D +#pragma clang diagnostic ignored "-Wfloat-equal" - (id) initWithFade:(float)fade minSeg:(float)minSeg width:(float)stroke color:(ccColor3B)color texture:(CCTexture2D*)texture { self = [super init]; @@ -64,29 +66,28 @@ - (id) initWithFade:(float)fade minSeg:(float)minSeg width:(float)stroke color:( { [super setPosition:CGPointZero]; [self setAnchorPoint:CGPointZero]; - [self setIgnoreAnchorPointForPosition:YES]; - startingPositionInitialized_ = NO; - positionR_ = CGPointZero; - fastMode_ = YES; - minSeg_ = (minSeg == -1.0f) ? stroke/5.0f : minSeg; - minSeg_ *= minSeg_; + _startingPositionInitialized = NO; + _positionR = CGPointZero; + _fastMode = YES; + _minSeg = (minSeg == -1.0f) ? stroke/5.0f : minSeg; + _minSeg *= _minSeg; - stroke_ = stroke; - fadeDelta_ = 1.0f/fade; + _stroke = stroke; + _fadeDelta = 1.0f/fade; - maxPoints_ = (int)(fade*60.0f)+2; - nuPoints_ = previousNuPoints_ = 0; - pointState_ = malloc(sizeof(float) * maxPoints_); - pointVertexes_ = malloc(sizeof(CGPoint) * maxPoints_); + _maxPoints = (int)(fade*60.0f)+2; + _nuPoints = _previousNuPoints = 0; + _pointState = malloc(sizeof(float) * _maxPoints); + _pointVertexes = malloc(sizeof(CGPoint) * _maxPoints); - vertices_ = malloc(sizeof(ccVertex2F) * maxPoints_ * 2); - texCoords_ = malloc(sizeof(ccTex2F) * maxPoints_ * 2); - colorPointer_ = malloc(sizeof(GLubyte) * maxPoints_ * 2 * 4); + _vertices = malloc(sizeof(ccVertex2F) * _maxPoints * 2); + _texCoords = malloc(sizeof(ccTex2F) * _maxPoints * 2); + _colorPointer = malloc(sizeof(GLubyte) * _maxPoints * 2 * 4); // Set blend mode - blendFunc_.src = GL_SRC_ALPHA; - blendFunc_.dst = GL_ONE_MINUS_SRC_ALPHA; + _blendFunc.src = GL_SRC_ALPHA; + _blendFunc.dst = GL_ONE_MINUS_SRC_ALPHA; // shader program self.shaderProgram = [[CCShaderCache sharedShaderCache] programForKey:kCCShader_PositionTextureColor]; @@ -98,13 +99,14 @@ - (id) initWithFade:(float)fade minSeg:(float)minSeg width:(float)stroke color:( } return self; } +#pragma clang diagnostic pop COCOS2D #pragma mark - - (void) setPosition:(CGPoint)position { - startingPositionInitialized_ = YES; - positionR_ = position; + _startingPositionInitialized = YES; + _positionR = position; } - (void) tintWithColor:(ccColor3B)colors @@ -112,18 +114,8 @@ - (void) tintWithColor:(ccColor3B)colors [self setColor:colors]; // Fast assignation - for(int i = 0; i0) { // Move data - pointState_[newIdx] = pointState_[i]; + _pointState[newIdx] = _pointState[i]; // Move point - pointVertexes_[newIdx] = pointVertexes_[i]; + _pointVertexes[newIdx] = _pointVertexes[i]; // Move vertices i2 = i*2; newIdx2 = newIdx*2; - vertices_[newIdx2] = vertices_[i2]; - vertices_[newIdx2+1] = vertices_[i2+1]; + _vertices[newIdx2] = _vertices[i2]; + _vertices[newIdx2+1] = _vertices[i2+1]; // Move color i2 *= 4; newIdx2 *= 4; - colorPointer_[newIdx2+0] = colorPointer_[i2+0]; - colorPointer_[newIdx2+1] = colorPointer_[i2+1]; - colorPointer_[newIdx2+2] = colorPointer_[i2+2]; - colorPointer_[newIdx2+4] = colorPointer_[i2+4]; - colorPointer_[newIdx2+5] = colorPointer_[i2+5]; - colorPointer_[newIdx2+6] = colorPointer_[i2+6]; + _colorPointer[newIdx2+0] = _colorPointer[i2+0]; + _colorPointer[newIdx2+1] = _colorPointer[i2+1]; + _colorPointer[newIdx2+2] = _colorPointer[i2+2]; + _colorPointer[newIdx2+4] = _colorPointer[i2+4]; + _colorPointer[newIdx2+5] = _colorPointer[i2+5]; + _colorPointer[newIdx2+6] = _colorPointer[i2+6]; }else newIdx2 = newIdx*8; - const GLubyte op = pointState_[newIdx] * 255.0f; - colorPointer_[newIdx2+3] = op; - colorPointer_[newIdx2+7] = op; + const GLubyte op = _pointState[newIdx] * 255.0f; + _colorPointer[newIdx2+3] = op; + _colorPointer[newIdx2+7] = op; } } - nuPoints_-=mov; + _nuPoints-=mov; // Append new point BOOL appendNewPoint = YES; - if(nuPoints_ >= maxPoints_) + if(_nuPoints >= _maxPoints) appendNewPoint = NO; - else if(nuPoints_>0) + else if(_nuPoints>0) { - BOOL a1 = ccpDistanceSQ(pointVertexes_[nuPoints_-1], positionR_) < minSeg_; - BOOL a2 = (nuPoints_ == 1) ? NO : (ccpDistanceSQ(pointVertexes_[nuPoints_-2], positionR_) < (minSeg_ * 2.0f)); + BOOL a1 = ccpDistanceSQ(_pointVertexes[_nuPoints-1], _positionR) < _minSeg; + BOOL a2 = (_nuPoints == 1) ? NO : (ccpDistanceSQ(_pointVertexes[_nuPoints-2], _positionR) < (_minSeg * 2.0f)); if(a1 || a2) appendNewPoint = NO; } if(appendNewPoint) { - pointVertexes_[nuPoints_] = positionR_; - pointState_[nuPoints_] = 1.0f; + _pointVertexes[_nuPoints] = _positionR; + _pointState[_nuPoints] = 1.0f; // Color asignation - const NSUInteger offset = nuPoints_*8; - *((ccColor3B*)(colorPointer_ + offset)) = color_; - *((ccColor3B*)(colorPointer_ + offset+4)) = color_; + const NSUInteger offset = _nuPoints*8; + *((ccColor3B*)(_colorPointer + offset)) = _displayedColor; + *((ccColor3B*)(_colorPointer + offset+4)) = _displayedColor; // Opacity - colorPointer_[offset+3] = 255; - colorPointer_[offset+7] = 255; + _colorPointer[offset+3] = 255; + _colorPointer[offset+7] = 255; // Generate polygon - if(nuPoints_ > 0 && fastMode_ ) + if(_nuPoints > 0 && _fastMode ) { - if(nuPoints_ > 1) - ccVertexLineToPolygon(pointVertexes_, stroke_, vertices_, nuPoints_, 1); + if(_nuPoints > 1) + ccVertexLineToPolygon(_pointVertexes, _stroke, _vertices, _nuPoints, 1); else - ccVertexLineToPolygon(pointVertexes_, stroke_, vertices_, 0, 2); + ccVertexLineToPolygon(_pointVertexes, _stroke, _vertices, 0, 2); } - nuPoints_ ++; + _nuPoints ++; } - if( ! fastMode_ ) - ccVertexLineToPolygon(pointVertexes_, stroke_, vertices_, 0, nuPoints_); + if( ! _fastMode ) + ccVertexLineToPolygon(_pointVertexes, _stroke, _vertices, 0, _nuPoints); // Updated Tex Coords only if they are different than previous step - if( nuPoints_ && previousNuPoints_ != nuPoints_ ) { - float texDelta = 1.0f / nuPoints_; - for( i=0; i < nuPoints_; i++ ) { - texCoords_[i*2] = (ccTex2F) {0, texDelta*i}; - texCoords_[i*2+1] = (ccTex2F) {1, texDelta*i}; + if( _nuPoints && _previousNuPoints != _nuPoints ) { + float texDelta = 1.0f / _nuPoints; + for( i=0; i < _nuPoints; i++ ) { + _texCoords[i*2] = (ccTex2F) {0, texDelta*i}; + _texCoords[i*2+1] = (ccTex2F) {1, texDelta*i}; } - previousNuPoints_ = nuPoints_; + _previousNuPoints = _nuPoints; } } - (void) reset { - nuPoints_ = 0; + _nuPoints = 0; } - (void) draw { - if(nuPoints_ <= 1) + if(_nuPoints <= 1) return; CC_NODE_DRAW_SETUP(); ccGLEnableVertexAttribs(kCCVertexAttribFlag_PosColorTex ); - ccGLBlendFunc( blendFunc_.src, blendFunc_.dst ); + ccGLBlendFunc( _blendFunc.src, _blendFunc.dst ); - ccGLBindTexture2D( [texture_ name] ); + ccGLBindTexture2D( [_texture name] ); - glVertexAttribPointer(kCCVertexAttrib_Position, 2, GL_FLOAT, GL_FALSE, 0, vertices_); - glVertexAttribPointer(kCCVertexAttrib_TexCoords, 2, GL_FLOAT, GL_FALSE, 0, texCoords_); - glVertexAttribPointer(kCCVertexAttrib_Color, 4, GL_UNSIGNED_BYTE, GL_TRUE, 0, colorPointer_); + glVertexAttribPointer(kCCVertexAttrib_Position, 2, GL_FLOAT, GL_FALSE, 0, _vertices); + glVertexAttribPointer(kCCVertexAttrib_TexCoords, 2, GL_FLOAT, GL_FALSE, 0, _texCoords); + glVertexAttribPointer(kCCVertexAttrib_Color, 4, GL_UNSIGNED_BYTE, GL_TRUE, 0, _colorPointer); - glDrawArrays(GL_TRIANGLE_STRIP, 0, (GLsizei)nuPoints_*2); + glDrawArrays(GL_TRIANGLE_STRIP, 0, (GLsizei)_nuPoints*2); CC_INCREMENT_GL_DRAWS(1); } - (void)dealloc { - [texture_ release]; - free(pointState_); - free(pointVertexes_); - free(vertices_); - free(colorPointer_); - free(texCoords_); + free(_pointState); + free(_pointVertexes); + free(_vertices); + free(_colorPointer); + free(_texCoords); - [super dealloc]; } @end diff --git a/cocos2d/CCNode+Debug.h b/cocos2d/CCNode+Debug.h new file mode 100644 index 0000000..f2e08fe --- /dev/null +++ b/cocos2d/CCNode+Debug.h @@ -0,0 +1,39 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2012 Zynga Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#import "CCNode.h" + +#ifdef DEBUG + +/** Debugging extensions of CCNode. + They are available when the DEBUG macro is defined at compile time + */ +@interface CCNode (Debug) + +/** prints on the debug console the scene graph */ +-(void) walkSceneGraph:(NSUInteger)level; + +@end + +#endif // DEBUG diff --git a/src/cocos2d/CCNode+Debug.m b/cocos2d/CCNode+Debug.m similarity index 89% rename from src/cocos2d/CCNode+Debug.m rename to cocos2d/CCNode+Debug.m index 3e84954..7ea097f 100644 --- a/src/cocos2d/CCNode+Debug.m +++ b/cocos2d/CCNode+Debug.m @@ -37,16 +37,15 @@ -(void) walkSceneGraph:(NSUInteger)level buf[i] = 0; - if(children_) { + if(_children) { [self sortAllChildren]; - ccArray *arrayData = children_->data; i = 0; // draw children zOrder < 0 - for( ; i < arrayData->num; i++ ) { - CCNode *child = arrayData->arr[i]; + for( ; i < _children.count; i++ ) { + CCNode *child = [_children objectAtIndex:i]; if ( [child zOrder] < 0 ) [child walkSceneGraph:level+1]; else @@ -57,8 +56,8 @@ -(void) walkSceneGraph:(NSUInteger)level NSLog(@"walk tree: %s> %@ %p", buf, self, self); // draw children zOrder >= 0 - for( ; i < arrayData->num; i++ ) { - CCNode *child = arrayData->arr[i]; + for( ; i < _children.count; i++ ) { + CCNode *child = [_children objectAtIndex:i]; [child walkSceneGraph:level+1]; } diff --git a/cocos2d/CCNode.h b/cocos2d/CCNode.h new file mode 100644 index 0000000..0eb3f05 --- /dev/null +++ b/cocos2d/CCNode.h @@ -0,0 +1,676 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2009 Valentin Milea + * + * Copyright (c) 2008-2010 Ricardo Quesada + * Copyright (c) 2011 Zynga Inc. + * Copyright (c) 2013 Lars Birkemose + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#import "Platforms/CCGL.h" +#import "ccTypes.h" +#import "CCProtocols.h" +#import "ccConfig.h" +#import "ccGLStateCache.h" + +#pragma clang diagnostic pop COCOS2D +#pragma clang diagnostic ignored "-Wignored-qualifiers" +#import "kazmath/kazmath.h" +#pragma clang diagnostic push COCOS2D + +#import "CCResponder.h" + +enum { + kCCNodeTagInvalid = -1, +}; + +@class CCScene; +@class CCGridBase; +@class CCGLProgram; +@class CCScheduler; +@class CCActionManager; +@class CCAction; +@class CCPhysicsBody; + +/** CCNode is the main element. Anything thats gets drawn or contains things that get drawn is a CCNode. + The most popular CCNodes are: CCScene, CCLayer, CCSprite, CCMenu. + + The main features of a CCNode are: + - They can contain other CCNode nodes (addChild, getChildByTag, removeChild, etc) + - They can schedule periodic callback (schedule, unschedule, etc) + - They can execute actions (runAction, stopAction, etc) + + Some CCNode nodes provide extra functionality for them or their children. + + Subclassing a CCNode usually means (one/all) of: + - overriding init to initialize resources and schedule callbacks + - create callbacks to handle the advancement of time + - overriding draw to render the node + + Features of CCNode: + - position + - scale (x, y) + - rotation (in degrees, clockwise) + - CCGridBase (to do mesh transformations) + - anchor point + - size + - visible + - z-order + - openGL z position + + Default values: + - rotation: 0 + - position: (x=0,y=0) + - scale: (x=1,y=1) + - contentSize: (x=0,y=0) + - anchorPoint: (x=0,y=0) + + Limitations: + - A CCNode is a "void" object. It doesn't have a texture + + Order in transformations with grid disabled + -# The node will be translated (position) + -# The node will be rotated (rotation) + -# The node will be skewed (skewX, skewY) + -# The node will be scaled (scale, scaleX, scaleY) + -# The node will be moved according to the camera values (camera) + + Order in transformations with grid enabled + -# The node will be translated (position) + -# The node will be rotated (rotation, rotationX, rotationY) + -# The node will be skewed (skewX, skewY) + -# The node will be scaled (scale, scaleX, scaleY) + -# The grid will capture the screen + -# The node will be moved according to the camera values (camera) + -# The grid will render the captured screen + */ +@interface CCNode : CCResponder < CCResponderProtocol > { + // rotation angle + float _rotationalSkewX, _rotationalSkewY; + + // scaling factors + float _scaleX, _scaleY; + + // openGL real Z vertex + float _vertexZ; + + // position of the node + CGPoint _position; + + // skew angles + float _skewX, _skewY; + + // anchor point in points + CGPoint _anchorPointInPoints; + // anchor point normalized (NOT in points) + CGPoint _anchorPoint; + + // untransformed size of the node + CGSize _contentSize; + + // transform + CGAffineTransform _transform, _inverse; + BOOL _isTransformDirty; + BOOL _isInverseDirty; + + // a Grid + CCGridBase *_grid; + + // z-order value + NSInteger _zOrder; + + // array of children + NSMutableArray *_children; + + // weak ref to parent + CCNode *__unsafe_unretained _parent; + + // a tag. any number you want to assign to the node + NSInteger _tag; + + // user data field + id _userObject; + + // Shader + CCGLProgram *_shaderProgram; + + // Server side state + ccGLServerState _glServerState; + + // used to preserve sequence while sorting children with the same zOrder + NSUInteger _orderOfArrival; + + // scheduler used to schedule timers and updates + CCScheduler *_scheduler; + + // ActionManager used to handle all the actions + CCActionManager *_actionManager; + + // Is running + BOOL _isRunning; + + // is visible + BOOL _visible; + + BOOL _isReorderChildDirty; + + CCPhysicsBody* _physicsBody; +} + +/** The z order of the node relative to its "siblings": children of the same parent */ +@property(nonatomic,assign) NSInteger zOrder; +/** The real openGL Z vertex. + Differences between openGL Z vertex and cocos2d Z order: + - OpenGL Z modifies the Z vertex, and not the Z order in the relation between parent-children + - OpenGL Z might require to set 2D projection + - cocos2d Z order works OK if all the nodes uses the same openGL Z vertex. eg: vertexZ = 0 + @warning: Use it at your own risk since it might break the cocos2d parent-children z order + @since v0.8 + */ +@property (nonatomic,readwrite) float vertexZ; + +/** The X skew angle of the node in degrees. + This angle describes the shear distortion in the X direction. + Thus, it is the angle between the Y axis and the left edge of the shape + The default skewX angle is 0. Positive values distort the node in a CW direction. + */ +@property(nonatomic,readwrite,assign) float skewX; + +/** The Y skew angle of the node in degrees. + This angle describes the shear distortion in the Y direction. + Thus, it is the angle between the X axis and the bottom edge of the shape + The default skewY angle is 0. Positive values distort the node in a CCW direction. + */ +@property(nonatomic,readwrite,assign) float skewY; +/** The rotation (angle) of the node in degrees. 0 is the default rotation angle. Positive values rotate node CW. */ +@property(nonatomic,readwrite,assign) float rotation; +/** The rotation (angle) of the node in degrees. 0 is the default rotation angle. Positive values rotate node CW. It only modifies the X rotation performing a horizontal rotational skew . */ +@property(nonatomic,readwrite,assign) float rotationalSkewX; +/** The rotation (angle) of the node in degrees. 0 is the default rotation angle. Positive values rotate node CW. It only modifies the Y rotation performing a vertical rotational skew . */ +@property(nonatomic,readwrite,assign) float rotationalSkewY; + +/** The scale factor of the node. 1.0 is the default scale factor. It modifies the X and Y scale at the same time. */ +@property(nonatomic,readwrite,assign) float scale; +/** The scale factor of the node. 1.0 is the default scale factor. It only modifies the X scale factor. */ +@property(nonatomic,readwrite,assign) float scaleX; +/** The scale factor of the node. 1.0 is the default scale factor. It only modifies the Y scale factor. */ +@property(nonatomic,readwrite,assign) float scaleY; + +@property (nonatomic,readonly) float scaleInPoints; +@property (nonatomic,readonly) float scaleXInPoints; +@property (nonatomic,readonly) float scaleYInPoints; + +@property (nonatomic,assign) CCScaleType scaleType; +@property (nonatomic,readonly) BOOL isPhysicsNode; + +/** Position (x,y) of the node in the unit specified by the positionType property. The distance is measured from one of the corners of the node's parent container, which corner is specified by the positionType property. Default setting is referencing the bottom left corner in points. */ +@property(nonatomic,readwrite,assign) CGPoint position; +/** Position (x,y) of the node in points from the bottom left corner */ +@property(nonatomic,readonly) CGPoint positionInPoints; +/** Defines the position type used for the X component of the position property */ +@property(nonatomic,readwrite,assign) CCPositionType positionType; +/** Array of children */ +@property(nonatomic,readonly) NSArray *children; +/** A CCGrid object that is used when applying effects */ +@property(nonatomic,readwrite,strong) CCGridBase* grid; +/** Whether of not the node is visible. Default is YES */ +@property( nonatomic,readwrite,assign) BOOL visible; +/** anchorPoint is the point around which all transformations and positioning manipulations take place. + It's like a pin in the node where it is "attached" to its parent. + The anchorPoint is normalized, like a percentage. (0,0) means the bottom-left corner and (1,1) means the top-right corner. + But you can use values higher than (1,1) and lower than (0,0) too. + The default anchorPoint is (0,0). It starts in the bottom-left corner. CCSprite and other subclasses have a different default anchorPoint. + @since v0.8 + */ +@property(nonatomic,readwrite) CGPoint anchorPoint; +/** The anchorPoint in absolute pixels. + Since v0.8 you can only read it. If you wish to modify it, use anchorPoint instead + */ +@property(nonatomic,readonly) CGPoint anchorPointInPoints; + +/** The untransformed size of the node in the unit specified by contentSizeType property. The contentSize remains the same no matter the node is scaled or rotated. + @since v0.8 + */ +@property (nonatomic,readwrite,assign) CGSize contentSize; +/** The untransformed size of the node in Points. The contentSize remains the same no matter the node is scaled or rotated. */ +@property (nonatomic,readonly) CGSize contentSizeInPoints; +/** Defines the contentSize type used for the widht and height component of the contentSize property. */ +@property (nonatomic,readwrite,assign) CCContentSizeType contentSizeType; + +/** The scene this node is added to, or nil if it's not part of a scene. */ +@property(nonatomic, readonly) CCScene *scene; + +/** The physics body (if any) that this node is attached to. */ +@property(nonatomic, strong) CCPhysicsBody *physicsBody; + +/** whether or not the node is running */ +@property(nonatomic,readonly) BOOL isRunning; +/** A weak reference to the parent */ +@property(nonatomic,readwrite,unsafe_unretained) CCNode* parent; +/** A tag used to identify the node easily */ +@property(nonatomic,readwrite,assign) NSInteger tag; +/** Similar to userData, but instead of holding a void* it holds an id */ +@property(nonatomic,readwrite,strong) id userObject; + +/** Shader Program + @since v2.0 + */ +@property(nonatomic,readwrite,strong) CCGLProgram *shaderProgram; + +/** used internally for zOrder sorting, don't change this manually */ +@property(nonatomic,readwrite) NSUInteger orderOfArrival; + +/** GL server side state + @since v2.0 +*/ +@property (nonatomic, readwrite) ccGLServerState glServerState; + +/** CCActionManager used by all the actions. + IMPORTANT: If you set a new CCActionManager, then previously created actions are going to be removed. + @since v2.0 + */ +@property (nonatomic, readwrite, strong) CCActionManager *actionManager; + +/** CCScheduler used to schedule all "updates" and timers. + IMPORTANT: If you set a new CCScheduler, then previously created timers/update are going to be removed. + @since v2.0 + */ +@property (nonatomic, readwrite, strong) CCScheduler *scheduler; + +/** Enabled user interaction on a node, like touch + @since v2.5 + */ +@property ( nonatomic, assign, getter = isUserInteractionEnabled ) BOOL userInteractionEnabled; + +/** Enabled multiple touches inside a single node + @since v2.5 + */ +@property ( nonatomic, assign, getter = isMultipleTouchEnabled ) BOOL multipleTouchEnabled; + +/** Locks the touch to the node if touch started outside + If a touch is moved inside a non locked node, a touchesBegan will be generated + @since v2.5 + */ +@property (nonatomic, assign) BOOL claimsUserInteraction; + +/** Expands ( or contracts ) the hit area of the node + hitAreaExpansion = 0 => hit area has no size + hitAreaExpansion = 1 => hit area has same size as sprite (default) + hitAreaExpansion = 2 => hit area has double width and double height + @since v2.5 + */ +@property (nonatomic,assign) float hitAreaExpansion; + +// initializators +/** allocates and initializes a node. + The node will be created as "autorelease". + */ ++(id) node; +/** initializes the node */ +-(id) init; + +// scene management + +/** Event that is called every time the CCNode enters the 'stage'. + If the CCNode enters the 'stage' with a transition, this event is called when the transition starts. + During onEnter you can't access a sibling node. + If you override onEnter, you shall call [super onEnter]. + */ +-(void) onEnter; + +/** Event that is called when the CCNode enters in the 'stage'. + If the CCNode enters the 'stage' with a transition, this event is called when the transition finishes. + If you override onEnterTransitionDidFinish, you shall call [super onEnterTransitionDidFinish]. + @since v0.8 + */ +-(void) onEnterTransitionDidFinish; + +/** Event that is called every time the CCNode leaves the 'stage'. + If the CCNode leaves the 'stage' with a transition, this event is called when the transition finishes. + During onExit you can't access a sibling node. + If you override onExit, you shall call [super onExit]. + */ +-(void) onExit; + +/** callback that is called every time the CCNode leaves the 'stage'. + If the CCNode leaves the 'stage' with a transition, this callback is called when the transition starts. + */ +-(void) onExitTransitionDidStart; + +// composition: ADD + +/** Adds a child to the container with z-order as 0. + If the child is added to a 'running' node, then 'onEnter' and 'onEnterTransitionDidFinish' will be called immediately. + @since v0.7.1 + */ +-(void) addChild: (CCNode*)node; + +/** Adds a child to the container with a z-order. + If the child is added to a 'running' node, then 'onEnter' and 'onEnterTransitionDidFinish' will be called immediately. + @since v0.7.1 + */ +-(void) addChild: (CCNode*)node z:(NSInteger)z; + +/** Adds a child to the container with z order and tag. + If the child is added to a 'running' node, then 'onEnter' and 'onEnterTransitionDidFinish' will be called immediately. + @since v0.7.1 + */ +-(void) addChild: (CCNode*)node z:(NSInteger)z tag:(NSInteger)tag; + +// composition: REMOVE + +/** Remove itself from its parent node forcing a cleanup. + If the node orphan, then nothing happens. + @since v2.1 + */ +-(void) removeFromParent; + +/** Remove itself from its parent node. If cleanup is YES, then also remove all actions and callbacks. + If the node orphan, then nothing happens. + @since v0.99.3 + */ +-(void) removeFromParentAndCleanup:(BOOL)cleanup; + +/** Removes a child from the container forcing a cleanup + @since v2.1 + */ +-(void) removeChild:(CCNode*)child; + +/** Removes a child from the container. It will also cleanup all running actions depending on the cleanup parameter. + @since v0.7.1 + */ +-(void) removeChild: (CCNode*)node cleanup:(BOOL)cleanup; + +/** Removes a child from the container by tag value forcing a cleanup. + @since v2.1 + */ +-(void) removeChildByTag:(NSInteger) tag; + +/** Removes a child from the container by tag value. It will also cleanup all running actions depending on the cleanup parameter + @since v0.7.1 + */ +-(void) removeChildByTag:(NSInteger) tag cleanup:(BOOL)cleanup; + +/** Removes all children from the container forcing a cleanup. + @since v2.1 + */ +-(void) removeAllChildren; + +/** Removes all children from the container and do a cleanup all running actions depending on the cleanup parameter. + @since v0.7.1 + */ +-(void) removeAllChildrenWithCleanup:(BOOL)cleanup; + +// composition: GET +/** Gets a child from the container given its tag + @return returns a CCNode object + @since v0.7.1 + */ +-(CCNode*) getChildByTag:(NSInteger) tag; + +/** Reorders a child according to a new z value. + * The child MUST be already added. + */ +-(void) reorderChild:(CCNode*)child z:(NSInteger)zOrder; + +/** performance improvement, Sort the children array once before drawing, instead of every time when a child is added or reordered + don't call this manually unless a child added needs to be removed in the same frame */ +- (void) sortAllChildren; + +/** Event that is called when the running node is no longer running (eg: its CCScene is being removed from the "stage" ). + On cleanup you should break any possible circular references. + CCNode's cleanup removes any possible scheduled timer and/or any possible action. + If you override cleanup, you shall call [super cleanup] + @since v0.8 + */ +-(void) cleanup; + +// draw + +/** Override this method to draw your own node. + You should use cocos2d's GL API to enable/disable the GL state / shaders. + For further info, please see ccGLstate.h. + You shall NOT call [super draw]; + */ +-(void) draw; + +/** recursive method that visit its children and draw them */ +-(void) visit; + +// transformations + +/** performs OpenGL view-matrix transformation based on position, scale, rotation and other attributes. */ +-(void) transform; + +/** performs OpenGL view-matrix transformation of its ancestors. + Generally the ancestors are already transformed, but in certain cases (eg: attaching a FBO) it is necessary to transform the ancestors again. + @since v0.7.2 + */ +-(void) transformAncestors; + +/** returns a "local" axis aligned bounding box of the node in points. + The returned box is relative only to its parent. + The returned box is in Points. + + @since v0.8.2 + */ +- (CGRect) boundingBox; + +// actions + +/** Executes an action, and returns the action that is executed. + The node becomes the action's target. + @warning Starting from v0.8 actions don't retain their target anymore. + @since v0.7.1 + @return An Action pointer + */ +-(CCAction*) runAction: (CCAction*) action; +/** Removes all actions from the running action list */ +-(void) stopAllActions; +/** Removes an action from the running action list */ +-(void) stopAction: (CCAction*) action; +/** Removes an action from the running action list given its tag + @since v0.7.1 +*/ +-(void) stopActionByTag:(NSInteger) tag; +/** Gets an action from the running action list given its tag + @since v0.7.1 + @return the Action the with the given tag + */ +-(CCAction*) getActionByTag:(NSInteger) tag; +/** Returns the numbers of actions that are running plus the ones that are schedule to run (actions in actionsToAdd and actions arrays). + * Composable actions are counted as 1 action. Example: + * If you are running 1 Sequence of 7 actions, it will return 1. + * If you are running 7 Sequences of 2 actions, it will return 7. + */ +-(NSUInteger) numberOfRunningActions; + +// timers + +/** check whether a selector is scheduled. */ +//-(BOOL) isScheduled: (SEL) selector; + +/** schedules the "update" method. It will use the order number 0. This method will be called every frame. + Scheduled methods with a lower order value will be called before the ones that have a higher order value. + Only one "update" method could be scheduled per node. + + @since v0.99.3 + */ +-(void) scheduleUpdate; + +/** schedules the "update" selector with a custom priority. This selector will be called every frame. + Scheduled selectors with a lower priority will be called before the ones that have a higher value. + Only one "update" selector could be scheduled per node (You can't have 2 'update' selectors). + + @since v0.99.3 + */ +-(void) scheduleUpdateWithPriority:(NSInteger)priority; + +/* unschedules the "update" method. + + @since v0.99.3 + */ +-(void) unscheduleUpdate; + +/** schedules a selector. + The scheduled selector will be ticked every frame + */ +-(void) schedule: (SEL) s; +/** schedules a custom selector with an interval time in seconds. + If time is 0 it will be ticked every frame. + If time is 0, it is recommended to use 'scheduleUpdate' instead. + + If the selector is already scheduled, then the interval parameter will be updated without scheduling it again. + */ +-(void) schedule: (SEL) s interval:(ccTime)seconds; +/** + repeat will execute the action repeat + 1 times, for a continues action use kCCRepeatForever + delay is the amount of time the action will wait before execution + */ +-(void) schedule:(SEL)selector interval:(ccTime)interval repeat: (uint) repeat delay:(ccTime) delay; + +/** + Schedules a selector that runs only once, with a delay of 0 or larger +*/ +- (void) scheduleOnce:(SEL) selector delay:(ccTime) delay; + +/** unschedules a custom selector.*/ +-(void) unschedule: (SEL) s; + +/** unschedule all scheduled selectors: custom selectors, and the 'update' selector. + Actions are not affected by this method. +@since v0.99.3 + */ +-(void) unscheduleAllSelectors; + +/** resumes all scheduled selectors and actions. + Called internally by onEnter + */ +-(void) resumeSchedulerAndActions; +/** pauses all scheduled selectors and actions. + Called internally by onExit + */ +-(void) pauseSchedulerAndActions; + +/* Update will be called automatically every frame if "scheduleUpdate" is called, and the node is "live" + */ +-(void) update:(ccTime)delta; + +// transformation methods + +/** Returns the matrix that transform the node's (local) space coordinates into the parent's space coordinates. + The matrix is in Pixels. + @since v0.7.1 + */ +- (CGAffineTransform)nodeToParentTransform; + +- (CGPoint) convertPositionToPoints:(CGPoint)position type:(CCPositionType)type; +- (CGPoint) convertPositionFromPoints:(CGPoint)positionInPoints type:(CCPositionType) type; + +- (CGSize) convertContentSizeToPoints:(CGSize)contentSize type:(CCContentSizeType) type; +- (CGSize) convertContentSizeFromPoints:(CGSize)pointSize type:(CCContentSizeType) type; + +/** Returns the matrix that transform parent's space coordinates to the node's (local) space coordinates. + The matrix is in Pixels. + @since v0.7.1 + */ +- (CGAffineTransform)parentToNodeTransform; + +/** Returns the world affine transform matrix. The matrix is in Pixels. + @since v0.7.1 + */ +- (CGAffineTransform)nodeToWorldTransform; + +/** Returns the inverse world affine transform matrix. The matrix is in Pixels. + @since v0.7.1 + */ +- (CGAffineTransform)worldToNodeTransform; + +/** Converts a Point to node (local) space coordinates. The result is in Points. + @since v0.7.1 + */ +- (CGPoint)convertToNodeSpace:(CGPoint)worldPoint; + +/** Converts a Point to world space coordinates. The result is in Points. + @since v0.7.1 + */ +- (CGPoint)convertToWorldSpace:(CGPoint)nodePoint; + +/** Converts a Point to node (local) space coordinates. The result is in Points. + treating the returned/received node point as anchor relative. + @since v0.7.1 + */ +- (CGPoint)convertToNodeSpaceAR:(CGPoint)worldPoint; + +/** Converts a local Point to world space coordinates.The result is in Points. + treating the returned/received node point as anchor relative. + @since v0.7.1 + */ +- (CGPoint)convertToWorldSpaceAR:(CGPoint)nodePoint; + +#ifdef __CC_PLATFORM_IOS + +/** Converts a UITouch to node (local) space coordinates. The result is in Points. + @since v0.7.1 + */ +- (CGPoint)convertTouchToNodeSpace:(UITouch *)touch; +/** Converts a UITouch to node (local) space coordinates. The result is in Points. + This method is AR (Anchor Relative).. + @since v0.7.1 + */ +- (CGPoint)convertTouchToNodeSpaceAR:(UITouch *)touch; +#endif // __CC_PLATFORM_IOS + +/** Compares two nodes in respect to zOrder and orderOfArrival (used for sorting sprites in display list) */ +- (NSComparisonResult) compareZOrderToNode:(CCNode*)node; + +/** check if a touch is inside the node + to expand or shrink the touch area of a node, override this method + @since v2.5 + */ +- (BOOL)hitTestWithWorldPos:(CGPoint)pos; + +@end + + +#pragma mark - CCNodeRGBA + +/** CCNodeRGBA is a subclass of CCNode that implements the CCRGBAProtocol protocol. + + All features from CCNode are valid, plus the following new features: + - opacity + - RGB colors + + Opacity/Color propagates into children that conform to the CCRGBAProtocol if cascadeOpacity/cascadeColor is enabled. + @since v2.1 + */ +@interface CCNodeRGBA : CCNode +{ + GLubyte _displayedOpacity, _realOpacity; + ccColor3B _displayedColor, _realColor; + BOOL _cascadeColorEnabled, _cascadeOpacityEnabled; +} + +// XXX To make BridgeSupport happy +-(GLubyte) opacity; + +@end diff --git a/cocos2d/CCNode.m b/cocos2d/CCNode.m new file mode 100644 index 0000000..ae75341 --- /dev/null +++ b/cocos2d/CCNode.m @@ -0,0 +1,1594 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2009 Valentin Milea + * + * Copyright (c) 2008-2010 Ricardo Quesada + * Copyright (c) 2011 Zynga Inc. + * Copyright (c) 2013 Lars Birkemose + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#import "CCNode.h" +#import "CCGrid.h" +#import "CCDirector.h" +#import "CCActionManager.h" +#import "CCScheduler.h" +#import "ccConfig.h" +#import "ccMacros.h" +#import "Support/CGPointExtension.h" +#import "Support/TransformUtils.h" +#import "ccMacros.h" +#import "CCGLProgram.h" +#import "CCPhysics+ObjectiveChipmunk.h" + +// externals +#import "kazmath/GL/matrix.h" + +#ifdef __CC_PLATFORM_IOS +#import "Platforms/iOS/CCDirectorIOS.h" +#endif + + +#pragma mark - Node + +@interface CCNode () +// lazy allocs +-(void) childrenAlloc; +// helper that reorder a child +-(void) insertChild:(CCNode*)child z:(NSInteger)z; +// used internally to alter the zOrder variable. DON'T call this method manually +-(void) _setZOrder:(NSInteger) z; +-(void) detachChild:(CCNode *)child cleanup:(BOOL)doCleanup; +@end + +@implementation CCNode { + +} + +static inline +CCPhysicsBody * +GetBodyIfRunning(CCNode *node) +{ + return (node->_isRunning ? node->_physicsBody : nil); +} + +static inline CGAffineTransform +NodeToPhysicsTransform(CCNode *node) +{ + CGAffineTransform transform = CGAffineTransformIdentity; + for(; node; node = node.parent){ + if(node.isPhysicsNode){ + return transform; + } else { + transform = cpTransformMult(node.nodeToParentTransform, transform); + } + } + + @throw [NSException exceptionWithName:@"CCPhysics Error" reason:@"Node is not added to a CCPhysicsNode" userInfo:nil]; +} + +static inline float +NodeToPhysicsRotation(CCNode *node) +{ + float rotation = 0.0; + for(; node; node = node.parent){ + if(node.isPhysicsNode){ + return rotation; + } else { + rotation -= node.rotation; + } + } + + @throw [NSException exceptionWithName:@"CCPhysics Error" reason:@"Node is not added to a CCPhysicsNode" userInfo:nil]; +} + +static inline CGAffineTransform +RigidBodyToParentTransform(CCNode *node, CCPhysicsBody *body) +{ + return cpTransformMult(cpTransformInverse(NodeToPhysicsTransform(node.parent)), body.absoluteTransform); +} + +// XXX: Yes, nodes might have a sort problem once every 15 days if the game runs at 60 FPS and each frame sprites are reordered. +static NSUInteger globalOrderOfArrival = 1; + +@synthesize children = _children; +@synthesize visible = _visible; +@synthesize parent = _parent; +@synthesize grid = _grid; +@synthesize zOrder = _zOrder; +@synthesize tag = _tag; +@synthesize vertexZ = _vertexZ; +@synthesize isRunning = _isRunning; +@synthesize userObject = _userObject; +@synthesize shaderProgram = _shaderProgram; +@synthesize orderOfArrival = _orderOfArrival; +@synthesize glServerState = _glServerState; +@synthesize physicsBody = _physicsBody; + +#pragma mark CCNode - Transform related properties + +@synthesize scaleX = _scaleX, scaleY = _scaleY; +@synthesize anchorPoint = _anchorPoint, anchorPointInPoints = _anchorPointInPoints; +@synthesize contentSize = _contentSize; +@synthesize skewX = _skewX, skewY = _skewY; + +#pragma mark CCNode - Init & cleanup + ++(id) node +{ + return [[self alloc] init]; +} + +-(id) init +{ + if ((self=[super init]) ) { + + _isRunning = NO; + + _skewX = _skewY = 0.0f; + _rotationalSkewX = _rotationalSkewY = 0.0f; + _scaleX = _scaleY = 1.0f; + _position = CGPointZero; + _contentSize = CGSizeZero; + _anchorPointInPoints = _anchorPoint = CGPointZero; + + _isTransformDirty = _isInverseDirty = YES; + + _vertexZ = 0; + + _grid = nil; + + _visible = YES; + + _tag = kCCNodeTagInvalid; + + _zOrder = 0; + + // children (lazy allocs) + _children = nil; + + // userObject is always inited as nil + _userObject = nil; + + //initialize parent to nil + _parent = nil; + + _shaderProgram = nil; + + _orderOfArrival = 0; + + _glServerState = 0; + + // set default scheduler and actionManager + CCDirector *director = [CCDirector sharedDirector]; + self.actionManager = [director actionManager]; + self.scheduler = [director scheduler]; + + // set default touch handling + self.userInteractionEnabled = NO; + self.claimsUserInteraction = YES; + self.multipleTouchEnabled = NO; + self.hitAreaExpansion = 1.0f; + + } + + return self; +} + +- (void)cleanup +{ + // actions + [self stopAllActions]; + [self unscheduleAllSelectors]; + + // timers + [_children makeObjectsPerformSelector:@selector(cleanup)]; +} + +- (NSString*) description +{ + return [NSString stringWithFormat:@"<%@ = %p | Tag = %ld>", [self class], self, (long)_tag]; +} + +- (void) dealloc +{ + CCLOGINFO( @"cocos2d: deallocing %@", self); + + + // children + for (CCNode* child in _children) + child.parent = nil; + + +} + +#pragma mark Setters + +// getters synthesized, setters explicit +-(void) setRotation: (float)newRotation +{ + CCPhysicsBody *body = GetBodyIfRunning(self); + if(body){ + body.absoluteRadians = -CC_DEGREES_TO_RADIANS(newRotation + NodeToPhysicsRotation(self.parent)); + } else { + _rotationalSkewX = newRotation; + _rotationalSkewY = newRotation; + _isTransformDirty = _isInverseDirty = YES; + } +} + +#pragma clang diagnostic push COCOS2D +#pragma clang diagnostic ignored "-Wfloat-equal" +-(float) rotation +{ + CCPhysicsBody *body = GetBodyIfRunning(self); + if(body){ + return -CC_RADIANS_TO_DEGREES(body.absoluteRadians) + NodeToPhysicsRotation(self.parent); + } else { + NSAssert( _rotationalSkewX == _rotationalSkewY, @"CCNode#rotation. RotationX != RotationY. Don't know which one to return"); + return _rotationalSkewX; + } +} +#pragma clang diagnostic pop COCOS2D + +-(float)rotationalSkewX { + return _rotationalSkewX; +} + +-(void) setRotationalSkewX: (float)newX +{ + NSAssert(_physicsBody == nil, @"Currently physics nodes don't support skewing."); + + _rotationalSkewX = newX; + _isTransformDirty = _isInverseDirty = YES; +} + +-(float)rotationalSkewY +{ + return _rotationalSkewY; +} + +-(void) setRotationalSkewY: (float)newY +{ + NSAssert(_physicsBody == nil, @"Currently physics nodes don't support skewing."); + + _rotationalSkewY = newY; + _isTransformDirty = _isInverseDirty = YES; +} + +-(void) setScaleX: (float)newScaleX +{ + _scaleX = newScaleX; + _isTransformDirty = _isInverseDirty = YES; +} + +-(void) setScaleY: (float)newScaleY +{ + _scaleY = newScaleY; + _isTransformDirty = _isInverseDirty = YES; +} + +-(void) setSkewX:(float)newSkewX +{ + NSAssert(_physicsBody == nil, @"Currently physics nodes don't support skewing."); + + _skewX = newSkewX; + _isTransformDirty = _isInverseDirty = YES; +} + +-(void) setSkewY:(float)newSkewY +{ + NSAssert(_physicsBody == nil, @"Currently physics nodes don't support skewing."); + + _skewY = newSkewY; + _isTransformDirty = _isInverseDirty = YES; +} + +static inline +CGPoint GetPosition(CCNode *node) +{ + CCPhysicsBody *body = GetBodyIfRunning(node); + if(body){ + // Return the position of the anchor point +// CGPoint anchor = node->_anchorPointInPoints; +// return cpTransformPoint(RigidBodyToParentTransform(node, body), cpv(anchor.x*node->_scaleX, anchor.y*node->_scaleY)); + return cpTransformPoint([node nodeToParentTransform], node->_anchorPointInPoints); + } else { + return node->_position; + } +} + +-(CGPoint)position +{ + return GetPosition(self); +} + +-(void) setPosition: (CGPoint)newPosition +{ + CCPhysicsBody *body = GetBodyIfRunning(self); + if(body){ + //TODO: This is "ridiculously" inefficient, but works for now. + CGPoint currentPosition = GetPosition(self); + CGPoint delta = ccpSub(newPosition, currentPosition); + body.absolutePosition = ccpAdd(body.absolutePosition, cpTransformVect(NodeToPhysicsTransform(self.parent), delta)); + } else { + _position = newPosition; + _isTransformDirty = _isInverseDirty = YES; + } +} + +-(void)setPositionType:(CCPositionType)positionType +{ + NSAssert(_physicsBody == nil, @"Currently only 'Points' is supported as a position unit type for physics nodes."); + _positionType = positionType; + _isTransformDirty = _isInverseDirty = YES; + + //TODO: Position is not preserved when changing position type. +} + +-(void) setAnchorPoint:(CGPoint)point +{ + if( ! CGPointEqualToPoint(point, _anchorPoint) ) { + _anchorPoint = point; + CGSize contentSizeInPoints = self.contentSizeInPoints; + _anchorPointInPoints = ccp( contentSizeInPoints.width * _anchorPoint.x, contentSizeInPoints.height * _anchorPoint.y ); + _isTransformDirty = _isInverseDirty = YES; + } +} + +-(void) setContentSize:(CGSize)size +{ + if( ! CGSizeEqualToSize(size, _contentSize) ) { + _contentSize = size; + + CGSize contentSizeInPoints = self.contentSizeInPoints; + _anchorPointInPoints = ccp( contentSizeInPoints.width * _anchorPoint.x, contentSizeInPoints.height * _anchorPoint.y ); + _isTransformDirty = _isInverseDirty = YES; + } +} + +- (void) setContentSizeType:(CCContentSizeType)contentSizeType +{ + _contentSizeType = contentSizeType; + + CGSize contentSizeInPoints = self.contentSizeInPoints; + _anchorPointInPoints = ccp( contentSizeInPoints.width * _anchorPoint.x, contentSizeInPoints.height * _anchorPoint.y ); + _isTransformDirty = _isInverseDirty = YES; +} + +- (CGSize) convertContentSizeToPoints:(CGSize)contentSize type:(CCContentSizeType)type +{ + CGSize size = CGSizeZero; + CCDirector* director = [CCDirector sharedDirector]; + + CCContentSizeUnit widthUnit = type.widthUnit; + CCContentSizeUnit heightUnit = type.heightUnit; + + // Width + if (widthUnit == kCCContentSizeUnitPoints) + { + size.width = contentSize.width; + } + else if (widthUnit == kCCContentSizeUnitScaled) + { + size.width = director.positionScaleFactor * contentSize.width; + } + else if (widthUnit == kCCContentSizeUnitNormalized) + { + size.width = contentSize.width * _parent.contentSizeInPoints.width; + } + else if (widthUnit == kCCContentSizeUnitInsetPoints) + { + size.width = _parent.contentSizeInPoints.width - contentSize.width; + } + else if (widthUnit == kCCContentSizeUnitInsetScaled) + { + size.width = _parent.contentSizeInPoints.width - contentSize.width * director.positionScaleFactor; + } + + // Height + if (heightUnit == kCCContentSizeUnitPoints) + { + size.height = contentSize.height; + } + else if (heightUnit == kCCContentSizeUnitScaled) + { + size.height = director.positionScaleFactor * contentSize.height; + } + else if (heightUnit == kCCContentSizeUnitNormalized) + { + size.height = contentSize.height * _parent.contentSizeInPoints.height; + } + else if (heightUnit == kCCContentSizeUnitInsetPoints) + { + size.height = _parent.contentSizeInPoints.height - contentSize.height; + } + else if (heightUnit == kCCContentSizeUnitInsetScaled) + { + size.height = _parent.contentSizeInPoints.height - contentSize.height * director.positionScaleFactor; + } + + return size; +} + +- (CGSize) convertContentSizeFromPoints:(CGSize)pointSize type:(CCContentSizeType)type +{ + CGSize size = CGSizeZero; + + CCDirector* director = [CCDirector sharedDirector]; + + CCContentSizeUnit widthUnit = type.widthUnit; + CCContentSizeUnit heightUnit = type.heightUnit; + + // Width + if (widthUnit == kCCContentSizeUnitPoints) + { + size.width = pointSize.width; + } + else if (widthUnit == kCCContentSizeUnitScaled) + { + size.width = pointSize.width / director.positionScaleFactor; + } + else if (widthUnit == kCCContentSizeUnitNormalized) + { + + float parentWidthInPoints = _parent.contentSizeInPoints.width; + if (parentWidthInPoints > 0) + { + size.width = pointSize.width/parentWidthInPoints; + } + else + { + size.width = 0; + } + } + else if (widthUnit == kCCContentSizeUnitInsetPoints) + { + size.width = _parent.contentSizeInPoints.width - pointSize.width; + } + else if (widthUnit == kCCContentSizeUnitInsetScaled) + { + size.width = (_parent.contentSizeInPoints.width - pointSize.width) / director.positionScaleFactor; + } + + // Height + if (heightUnit == kCCContentSizeUnitPoints) + { + size.height = pointSize.height; + } + else if (heightUnit == kCCContentSizeUnitScaled) + { + size.height = pointSize.height / director.positionScaleFactor; + } + else if (heightUnit == kCCContentSizeUnitNormalized) + { + + float parentHeightInPoints = _parent.contentSizeInPoints.height; + if (parentHeightInPoints > 0) + { + size.height = pointSize.height/parentHeightInPoints; + } + else + { + size.height = 0; + } + } + else if (heightUnit == kCCContentSizeUnitInsetPoints) + { + size.height = _parent.contentSizeInPoints.height - pointSize.height; + } + else if (heightUnit == kCCContentSizeUnitInsetScaled) + { + size.height = (_parent.contentSizeInPoints.height - pointSize.height) / director.positionScaleFactor; + } + + return size; +} + +- (CGSize) contentSizeInPoints +{ + return [self convertContentSizeToPoints:self.contentSize type:_contentSizeType]; +} + +- (float) scaleInPoints +{ + if (_scaleType == kCCScaleTypeScaled) + { + return self.scale * [CCDirector sharedDirector].positionScaleFactor; + } + return self.scale; +} + +- (float) scaleXInPoints +{ + if (_scaleType == kCCScaleTypeScaled) + { + return _scaleX * [CCDirector sharedDirector].positionScaleFactor; + } + return _scaleX; +} + +- (float) scaleYInPoints +{ + if (_scaleType == kCCScaleTypeScaled) + { + return _scaleY * [CCDirector sharedDirector].positionScaleFactor; + } + return _scaleY; +} + +- (void) setScaleType:(CCScaleType)scaleType +{ + _scaleType = scaleType; + _isTransformDirty = _isInverseDirty = YES; +} + +- (CGRect) boundingBox +{ + CGSize contentSize = self.contentSizeInPoints; + CGRect rect = CGRectMake(0, 0, contentSize.width, contentSize.height); + return CGRectApplyAffineTransform(rect, [self nodeToParentTransform]); +} + +-(void) setVertexZ:(float)vertexZ +{ + _vertexZ = vertexZ; +} + +- (void)setVisible:(BOOL)visible +{ + if (visible == _visible) return; + + /** mark responder manager as dirty + @since v2.5 + */ + [[[CCDirector sharedDirector] responderManager] markAsDirty]; + _visible = visible; +} + +#pragma clang diagnostic push COCOS2D +#pragma clang diagnostic ignored "-Wfloat-equal" +-(float) scale +{ + NSAssert( _scaleX == _scaleY, @"CCNode#scale. ScaleX != ScaleY. Don't know which one to return"); + return _scaleX; +} +#pragma clang diagnostic pop COCOS2D + +-(void) setScale:(float) s +{ + _scaleX = _scaleY = s; + _isTransformDirty = _isInverseDirty = YES; +} + +- (void) setZOrder:(NSInteger)zOrder +{ + [self _setZOrder:zOrder]; + + if (_parent) + [_parent reorderChild:self z:zOrder]; +} + +#pragma mark CCNode Composition + +-(void) childrenAlloc +{ + _children = [[NSMutableArray alloc] init]; +} + +-(CCNode*) getChildByTag:(NSInteger) aTag +{ + NSAssert( aTag != kCCNodeTagInvalid, @"Invalid tag"); + + for (CCNode* node in _children) { + if( node.tag == aTag ) + return node; + } + // not found + return nil; +} + +/* "add" logic MUST only be on this method + * If a class want's to extend the 'addChild' behaviour it only needs + * to override this method + */ +-(void) addChild: (CCNode*) child z:(NSInteger)z tag:(NSInteger) aTag +{ + NSAssert( child != nil, @"Argument must be non-nil"); + NSAssert( child.parent == nil, @"child already added. It can't be added again"); + + if( ! _children ) + [self childrenAlloc]; + + [self insertChild:child z:z]; + + child.tag = aTag; + + [child setParent: self]; + + [child setOrderOfArrival: globalOrderOfArrival++]; + + if( _isRunning ) { + [child onEnter]; + [child onEnterTransitionDidFinish]; + } + + /** mark responder manager as dirty + @since v2.5 + */ + [[[CCDirector sharedDirector] responderManager] markAsDirty]; +} + +-(void) addChild: (CCNode*) child z:(NSInteger)z +{ + NSAssert( child != nil, @"Argument must be non-nil"); + [self addChild:child z:z tag:child.tag]; +} + +-(void) addChild: (CCNode*) child +{ + NSAssert( child != nil, @"Argument must be non-nil"); + [self addChild:child z:child.zOrder tag:child.tag]; +} + +-(void) removeFromParent +{ + [self removeFromParentAndCleanup:YES]; +} + +-(void) removeFromParentAndCleanup:(BOOL)cleanup +{ + [_parent removeChild:self cleanup:cleanup]; +} + +-(void) removeChild: (CCNode*)child +{ + [self removeChild:child cleanup:YES]; +} + +/* "remove" logic MUST only be on this method + * If a class wants to extend the 'removeChild' behavior it only needs + * to override this method + */ +-(void) removeChild: (CCNode*)child cleanup:(BOOL)cleanup +{ + // explicit nil handling + if (child == nil) + return; + + if ( [_children containsObject:child] ) + [self detachChild:child cleanup:cleanup]; +} + +-(void) removeChildByTag:(NSInteger)aTag +{ + [self removeChildByTag:aTag cleanup:YES]; +} + +-(void) removeChildByTag:(NSInteger)aTag cleanup:(BOOL)cleanup +{ + NSAssert( aTag != kCCNodeTagInvalid, @"Invalid tag"); + + CCNode *child = [self getChildByTag:aTag]; + + if (child == nil) + CCLOG(@"cocos2d: removeChildByTag: child not found!"); + else + [self removeChild:child cleanup:cleanup]; +} + +-(void) removeAllChildren +{ + [self removeAllChildrenWithCleanup:YES]; +} + +-(void) removeAllChildrenWithCleanup:(BOOL)cleanup +{ + // not using detachChild improves speed here + for (CCNode* c in _children) + { + // IMPORTANT: + // -1st do onExit + // -2nd cleanup + if (_isRunning) + { + [c onExitTransitionDidStart]; + [c onExit]; + } + + if (cleanup) + [c cleanup]; + + // set parent nil at the end (issue #476) + [c setParent:nil]; + + /** mark responder manager as dirty + @since v2.5 + */ + [[[CCDirector sharedDirector] responderManager] markAsDirty]; + + } + + [_children removeAllObjects]; +} + +-(void) detachChild:(CCNode *)child cleanup:(BOOL)doCleanup +{ + // IMPORTANT: + // -1st do onExit + // -2nd cleanup + if (_isRunning) + { + [child onExitTransitionDidStart]; + [child onExit]; + } + + // If you don't do cleanup, the child's actions will not get removed and the + // its scheduledSelectors_ dict will not get released! + if (doCleanup) + [child cleanup]; + + // set parent nil at the end (issue #476) + [child setParent:nil]; + + /** mark responder manager as dirty + @since v2.5 + */ + [[[CCDirector sharedDirector] responderManager] markAsDirty]; + + [_children removeObject:child]; +} + +// used internally to alter the zOrder variable. DON'T call this method manually +-(void) _setZOrder:(NSInteger) z +{ + _zOrder = z; +} + +// helper used by reorderChild & add +-(void) insertChild:(CCNode*)child z:(NSInteger)z +{ + _isReorderChildDirty=YES; + + [_children addObject:child]; + [child _setZOrder:z]; +} + +-(void) reorderChild:(CCNode*) child z:(NSInteger)z +{ + NSAssert( child != nil, @"Child must be non-nil"); + + _isReorderChildDirty = YES; + + [child setOrderOfArrival: globalOrderOfArrival++]; + [child _setZOrder:z]; +} + +- (NSComparisonResult) compareZOrderToNode:(CCNode*)node +{ + if (node->_zOrder == _zOrder) + { + if (node->_orderOfArrival == _orderOfArrival) + { + return NSOrderedSame; + } + else if (node->_orderOfArrival < _orderOfArrival) + { + return NSOrderedDescending; + } + else + { + return NSOrderedAscending; + } + } + else if (node->_zOrder < _zOrder) + { + return NSOrderedDescending; + } + else + { + return NSOrderedAscending; + } +} + +- (void) sortAllChildren +{ + if (_isReorderChildDirty) + { + [_children sortUsingSelector:@selector(compareZOrderToNode:)]; + + //don't need to check children recursively, that's done in visit of each child + + _isReorderChildDirty = NO; + + /** mark responder manager as dirty + @since v2.5 + */ + [[[CCDirector sharedDirector] responderManager] markAsDirty]; + + } +} + +#pragma mark CCNode Draw + +-(void) draw +{ +} + +-(void) visit +{ + // quick return if not visible. children won't be drawn. + if (!_visible) + return; + + kmGLPushMatrix(); + + if ( _grid && _grid.active) + [_grid beforeDraw]; + + [self transform]; + + if(_children) { + + [self sortAllChildren]; + + NSUInteger i = 0; + + // draw children zOrder < 0 + for( ; i < _children.count; i++ ) { + CCNode *child = [_children objectAtIndex:i]; + if ( [child zOrder] < 0 ) + [child visit]; + else + break; + } + + // self draw + [self draw]; + + // draw children zOrder >= 0 + for( ; i < _children.count; i++ ) { + CCNode *child = [_children objectAtIndex:i]; + [child visit]; + } + + } else + [self draw]; + + // reset for next frame + _orderOfArrival = 0; + + if ( _grid && _grid.active) + [_grid afterDraw:self]; + + kmGLPopMatrix(); +} + +#pragma mark CCNode - Transformations + +-(void) transformAncestors +{ + if( _parent ) { + [_parent transformAncestors]; + [_parent transform]; + } +} + +-(void) transform +{ + kmMat4 transfrom4x4; + + // Convert 3x3 into 4x4 matrix + CGAffineTransform tmpAffine = [self nodeToParentTransform]; + CGAffineToGL(&tmpAffine, transfrom4x4.mat); + + // Update Z vertex manually + transfrom4x4.mat[14] = _vertexZ; + + kmGLMultMatrix( &transfrom4x4 ); +} + +#pragma mark CCPhysics support. + +// Overriden by CCPhysicsNode to return YES. +-(BOOL)isPhysicsNode {return NO;} +-(CCPhysicsNode *)physicsNode {return (self.isPhysicsNode ? (CCPhysicsNode *)self : self.parent.physicsNode);} + +-(void)setupPhysicsBody:(CCPhysicsBody *)physicsBody +{ + if(physicsBody){ + CCPhysicsNode *physics = self.physicsNode; + NSAssert(physics != nil, @"A CCNode with an attached CCPhysicsBody must be added as a descendent of a CCPhysicsNode."); + + // Copy the node's rotation first. + // Otherwise it may cause the position to rotate around a non-zero center of gravity. + physicsBody.absoluteRadians = CC_DEGREES_TO_RADIANS(NodeToPhysicsRotation(self)); + + // Grab the origin position of the node from it's transform. + CGAffineTransform transform = NodeToPhysicsTransform(self); + physicsBody.absolutePosition = ccp(transform.tx, transform.ty); + + [_physicsBody willAddToPhysicsNode:physics]; + [physics.space smartAdd:physicsBody]; + +#ifndef NDEBUG + // Reset these to zero since they shouldn't be read anyway. + _position = CGPointZero; + _rotationalSkewX = _rotationalSkewY = 0.0f; +#endif + } +} + +-(void)teardownPhysics +{ + if(_physicsBody){ + CCPhysicsNode *physics = self.physicsNode; + NSAssert(physics != nil, @"A CCNode with an attached CCPhysicsBody must be a descendent of a CCPhysicsNode."); + + // Copy the positional data back to the ivars. + _position = self.position; + _rotationalSkewX = _rotationalSkewY = self.rotation; + + [_physicsBody didRemoveFromPhysicsNode:physics]; + [physics.space smartRemove:_physicsBody]; + } +} + +-(void)setPhysicsBody:(CCPhysicsBody *)physicsBody +{ + if(physicsBody){ + + BOOL rotationalSkewPresent = (ABS(_rotationalSkewX - _rotationalSkewY)) > 0.00001f; + + NSAssert(_positionType.xUnit == kCCPositionUnitPoints, @"Currently only 'Points' is supported as a position unit type for physics nodes."); + NSAssert(_positionType.yUnit == kCCPositionUnitPoints, @"Currently only 'Points' is supported as a position unit type for physics nodes."); + NSAssert(_scaleType == kCCScaleTypePoints, @"Currently only 'Points' is supported as a scale type for physics nodes."); + NSAssert(rotationalSkewPresent == NO, @"Currently physics nodes don't support skewing."); + NSAssert(_skewX == 0.0 && _skewY == 0.0, @"Currently physics nodes don't support skewing."); + + (void)rotationalSkewPresent; + } + + if(physicsBody != _physicsBody){ + if(_isRunning){ + [self teardownPhysics]; + [self setupPhysicsBody:physicsBody]; + } + + // nil out the old body's node reference. + _physicsBody.node = nil; + + _physicsBody = physicsBody; + _physicsBody.node = self; + } +} + +#pragma mark CCNode SceneManagement + +// Overriden by CCScene to return YES. +-(BOOL)isScene {return NO;} +-(CCScene *)scene {return (self.isScene ? (CCScene *)self : self.parent.scene);} + +-(void) onEnter +{ + [_children makeObjectsPerformSelector:@selector(onEnter)]; + + [self setupPhysicsBody:_physicsBody]; + + [self resumeSchedulerAndActions]; + _isRunning = YES; +} + +-(void) onEnterTransitionDidFinish +{ + [_children makeObjectsPerformSelector:@selector(onEnterTransitionDidFinish)]; +} + +-(void) onExitTransitionDidStart +{ + [_children makeObjectsPerformSelector:@selector(onExitTransitionDidStart)]; +} + +-(void) onExit +{ + [self teardownPhysics]; + + [self pauseSchedulerAndActions]; + _isRunning = NO; + + [_children makeObjectsPerformSelector:@selector(onExit)]; +} + +#pragma mark CCNode Actions + +-(void) setActionManager:(CCActionManager *)actionManager +{ + if( actionManager != _actionManager ) { + [self stopAllActions]; + + _actionManager = actionManager; + } +} + +-(CCActionManager*) actionManager +{ + return _actionManager; +} + +-(CCAction*) runAction:(CCAction*) action +{ + NSAssert( action != nil, @"Argument must be non-nil"); + + [_actionManager addAction:action target:self paused:!_isRunning]; + return action; +} + +-(void) stopAllActions +{ + [_actionManager removeAllActionsFromTarget:self]; +} + +-(void) stopAction: (CCAction*) action +{ + [_actionManager removeAction:action]; +} + +-(void) stopActionByTag:(NSInteger)aTag +{ + NSAssert( aTag != kCCActionTagInvalid, @"Invalid tag"); + [_actionManager removeActionByTag:aTag target:self]; +} + +-(CCAction*) getActionByTag:(NSInteger) aTag +{ + NSAssert( aTag != kCCActionTagInvalid, @"Invalid tag"); + return [_actionManager getActionByTag:aTag target:self]; +} + +-(NSUInteger) numberOfRunningActions +{ + return [_actionManager numberOfRunningActionsInTarget:self]; +} + +#pragma mark CCNode - Scheduler + +-(void) setScheduler:(CCScheduler *)scheduler +{ + if( scheduler != _scheduler ) { + [self unscheduleAllSelectors]; + + _scheduler = scheduler; + } +} + +-(CCScheduler*) scheduler +{ + return _scheduler; +} + +-(void) scheduleUpdate +{ + [self scheduleUpdateWithPriority:0]; +} + +-(void) scheduleUpdateWithPriority:(NSInteger)priority +{ + [_scheduler scheduleUpdateForTarget:self priority:priority paused:!_isRunning]; +} + +-(void) unscheduleUpdate +{ + [_scheduler unscheduleUpdateForTarget:self]; +} + +-(void) schedule:(SEL)selector +{ + [self schedule:selector interval:0 repeat:kCCRepeatForever delay:0]; +} + +-(void) schedule:(SEL)selector interval:(ccTime)interval +{ + [self schedule:selector interval:interval repeat:kCCRepeatForever delay:0]; +} + +-(void) schedule:(SEL)selector interval:(ccTime)interval repeat: (uint) repeat delay:(ccTime) delay +{ + NSAssert( selector != nil, @"Argument must be non-nil"); + NSAssert( interval >=0, @"Arguemnt must be positive"); + + [_scheduler scheduleSelector:selector forTarget:self interval:interval repeat:repeat delay:delay paused:!_isRunning]; +} + +- (void) scheduleOnce:(SEL) selector delay:(ccTime) delay +{ + [self schedule:selector interval:0.f repeat:0 delay:delay]; +} + +-(void) unschedule:(SEL)selector +{ + // explicit nil handling + if (selector == nil) + return; + + [_scheduler unscheduleSelector:selector forTarget:self]; +} + +-(void) unscheduleAllSelectors +{ + [_scheduler unscheduleAllForTarget:self]; +} +- (void) resumeSchedulerAndActions +{ + [_scheduler resumeTarget:self]; + [_actionManager resumeTarget:self]; +} + +- (void) pauseSchedulerAndActions +{ + [_scheduler pauseTarget:self]; + [_actionManager pauseTarget:self]; +} + +/* override me */ +-(void) update:(ccTime)delta +{ +} + +#pragma mark CCNode Transform + +- (CGPoint) convertPositionToPoints:(CGPoint)position type:(CCPositionType)type +{ + CCDirector* director = [CCDirector sharedDirector]; + + CGPoint positionInPoints; + float x = 0; + float y = 0; + + // Convert position to points + CCPositionUnit xUnit = type.xUnit; + if (xUnit == kCCPositionUnitPoints) x = position.x; + else if (xUnit == kCCPositionUnitScaled) x = position.x * director.positionScaleFactor; + else if (xUnit == kCCPositionUnitNormalized) x = position.x * _parent.contentSizeInPoints.width; + + CCPositionUnit yUnit = type.yUnit; + if (yUnit == kCCPositionUnitPoints) y = position.y; + else if (yUnit == kCCPositionUnitScaled) y = position.y * director.positionScaleFactor; + else if (yUnit == kCCPositionUnitNormalized) y = position.y * _parent.contentSizeInPoints.height; + + // Account for reference corner + CCPositionReferenceCorner corner = _positionType.corner; + if (corner == kCCPositionReferenceCornerBottomLeft) + { + // Nothing needs to be done + } + else if (corner == kCCPositionReferenceCornerTopLeft) + { + // Reverse y-axis + y = _parent.contentSizeInPoints.height - y; + } + else if (corner == kCCPositionReferenceCornerTopRight) + { + // Reverse x-axis and y-axis + x = _parent.contentSizeInPoints.width - x; + y = _parent.contentSizeInPoints.height - y; + } + else if (corner == kCCPositionReferenceCornerBottomRight) + { + // Reverse x-axis + x = _parent.contentSizeInPoints.width - x; + } + + positionInPoints.x = x; + positionInPoints.y = y; + + return positionInPoints; +} + +- (CGPoint) convertPositionFromPoints:(CGPoint)positionInPoints type:(CCPositionType)type +{ + CCDirector* director = [CCDirector sharedDirector]; + + CGPoint position; + + float x = positionInPoints.x; + float y = positionInPoints.y; + + // Account for reference corner + CCPositionReferenceCorner corner = type.corner; + if (corner == kCCPositionReferenceCornerBottomLeft) + { + // Nothing needs to be done + } + else if (corner == kCCPositionReferenceCornerTopLeft) + { + // Reverse y-axis + y = _parent.contentSizeInPoints.height - y; + } + else if (corner == kCCPositionReferenceCornerTopRight) + { + // Reverse x-axis and y-axis + x = _parent.contentSizeInPoints.width - x; + y = _parent.contentSizeInPoints.height - y; + } + else if (corner == kCCPositionReferenceCornerBottomRight) + { + // Reverse x-axis + x = _parent.contentSizeInPoints.width - x; + } + + // Convert position from points + CCPositionUnit xUnit = type.xUnit; + if (xUnit == kCCPositionUnitPoints) position.x = x; + else if (xUnit == kCCPositionUnitScaled) position.x = x / director.positionScaleFactor; + else if (xUnit == kCCPositionUnitNormalized) + { + float parentWidth = _parent.contentSizeInPoints.width; + if (parentWidth > 0) + { + position.x = x / parentWidth; + } + } + + CCPositionUnit yUnit = type.yUnit; + if (yUnit == kCCPositionUnitPoints) position.y = y; + else if (yUnit == kCCPositionUnitScaled) position.y = y / director.positionScaleFactor; + else if (yUnit == kCCPositionUnitNormalized) + { + float parentHeight = _parent.contentSizeInPoints.height; + if (parentHeight > 0) + { + position.y = y / parentHeight; + } + } + + return position; +} + +- (CGPoint) positionInPoints +{ + return [self convertPositionToPoints:GetPosition(self) type:_positionType]; +} + +- (CGAffineTransform)nodeToParentTransform +{ + CCPhysicsBody *physicsBody = GetBodyIfRunning(self); + if(physicsBody){ + CGAffineTransform rigidTransform = RigidBodyToParentTransform(self, physicsBody); + return cpTransformMult(rigidTransform, cpTransformScale(_scaleX, _scaleY)); + } else if ( _isTransformDirty ) { + + // TODO: Make this more efficient + CGSize contentSizeInPoints = self.contentSizeInPoints; + _anchorPointInPoints = ccp( contentSizeInPoints.width * _anchorPoint.x, contentSizeInPoints.height * _anchorPoint.y ); + + // Convert position to points + CGPoint positionInPoints = [self convertPositionToPoints:_position type:_positionType]; + float x = positionInPoints.x; + float y = positionInPoints.y; + + // Rotation values + // Change rotation code to handle X and Y + // If we skew with the exact same value for both x and y then we're simply just rotating + float cx = 1, sx = 0, cy = 1, sy = 0; + if( _rotationalSkewX || _rotationalSkewY ) { + float radiansX = -CC_DEGREES_TO_RADIANS(_rotationalSkewX); + float radiansY = -CC_DEGREES_TO_RADIANS(_rotationalSkewY); + cx = cosf(radiansX); + sx = sinf(radiansX); + cy = cosf(radiansY); + sy = sinf(radiansY); + } + + BOOL needsSkewMatrix = ( _skewX || _skewY ); + + float scaleFactor = 1; + if (_scaleType == kCCScaleTypeScaled) scaleFactor = [CCDirector sharedDirector].positionScaleFactor; + + // optimization: + // inline anchor point calculation if skew is not needed + // Adjusted transform calculation for rotational skew + if( !needsSkewMatrix && !CGPointEqualToPoint(_anchorPointInPoints, CGPointZero) ) { + x += cy * -_anchorPointInPoints.x * _scaleX * scaleFactor + -sx * -_anchorPointInPoints.y * _scaleY; + y += sy * -_anchorPointInPoints.x * _scaleX * scaleFactor + cx * -_anchorPointInPoints.y * _scaleY; + } + + + // Build Transform Matrix + // Adjusted transfor m calculation for rotational skew + _transform = CGAffineTransformMake( cy * _scaleX * scaleFactor, sy * _scaleX * scaleFactor, + -sx * _scaleY * scaleFactor, cx * _scaleY * scaleFactor, + x, y ); + + // XXX: Try to inline skew + // If skew is needed, apply skew and then anchor point + if( needsSkewMatrix ) { + CGAffineTransform skewMatrix = CGAffineTransformMake(1.0f, tanf(CC_DEGREES_TO_RADIANS(_skewY)), + tanf(CC_DEGREES_TO_RADIANS(_skewX)), 1.0f, + 0.0f, 0.0f ); + _transform = CGAffineTransformConcat(skewMatrix, _transform); + + // adjust anchor point + if( ! CGPointEqualToPoint(_anchorPointInPoints, CGPointZero) ) + _transform = CGAffineTransformTranslate(_transform, -_anchorPointInPoints.x, -_anchorPointInPoints.y); + } + + _isTransformDirty = NO; + } + + return _transform; +} + +- (CGAffineTransform)parentToNodeTransform +{ + // TODO Need to find a better way to mark physics transforms as dirty + if ( _isInverseDirty || GetBodyIfRunning(self) ) { + _inverse = CGAffineTransformInvert([self nodeToParentTransform]); + _isInverseDirty = NO; + } + + return _inverse; +} + +- (CGAffineTransform)nodeToWorldTransform +{ + CGAffineTransform t = [self nodeToParentTransform]; + + for (CCNode *p = _parent; p != nil; p = p.parent) + t = CGAffineTransformConcat(t, [p nodeToParentTransform]); + + return t; +} + +- (CGAffineTransform)worldToNodeTransform +{ + return CGAffineTransformInvert([self nodeToWorldTransform]); +} + +- (CGPoint)convertToNodeSpace:(CGPoint)worldPoint +{ + CGPoint ret = CGPointApplyAffineTransform(worldPoint, [self worldToNodeTransform]); + return ret; +} + +- (CGPoint)convertToWorldSpace:(CGPoint)nodePoint +{ + CGPoint ret = CGPointApplyAffineTransform(nodePoint, [self nodeToWorldTransform]); + return ret; +} + +- (CGPoint)convertToNodeSpaceAR:(CGPoint)worldPoint +{ + CGPoint nodePoint = [self convertToNodeSpace:worldPoint]; + return ccpSub(nodePoint, _anchorPointInPoints); +} + +- (CGPoint)convertToWorldSpaceAR:(CGPoint)nodePoint +{ + nodePoint = ccpAdd(nodePoint, _anchorPointInPoints); + return [self convertToWorldSpace:nodePoint]; +} + +- (CGPoint)convertToWindowSpace:(CGPoint)nodePoint +{ + CGPoint worldPoint = [self convertToWorldSpace:nodePoint]; + return [[CCDirector sharedDirector] convertToUI:worldPoint]; +} + +// convenience methods which take a UITouch instead of CGPoint + +#ifdef __CC_PLATFORM_IOS + +- (CGPoint)convertTouchToNodeSpace:(UITouch *)touch +{ + CGPoint point = [touch locationInView: [touch view]]; + point = [[CCDirector sharedDirector] convertToGL: point]; + return [self convertToNodeSpace:point]; +} + +- (CGPoint)convertTouchToNodeSpaceAR:(UITouch *)touch +{ + CGPoint point = [touch locationInView: [touch view]]; + point = [[CCDirector sharedDirector] convertToGL: point]; + return [self convertToNodeSpaceAR:point]; +} + +#endif // __CC_PLATFORM_IOS + +// ----------------------------------------------------------------- +#pragma mark - touch interface +// ----------------------------------------------------------------- + +/** Returns YES, if touch is inside sprite + Added hit area expansion / contraction + @since v2.5 + */ +- (BOOL)hitTestWithWorldPos:(CGPoint)pos +{ + pos = [self convertToNodeSpace:pos]; + CGPoint offset = CGPointMake(self.contentSizeInPoints.width * (1 - _hitAreaExpansion) / 2, self.contentSizeInPoints.height * (1 - _hitAreaExpansion) / 2 ); + CGSize size = CGSizeMake(self.contentSizeInPoints.width - offset.x, self.contentSizeInPoints.height - offset.y); + if ((pos.y < offset.y) || (pos.y > size.height) || (pos.x < offset.x) || (pos.x > size.width)) return(NO); + + return(YES); +} + +- (void)setUserInteractionEnabled:(BOOL)userInteractionEnabled +{ + if (_userInteractionEnabled == userInteractionEnabled) return; + _userInteractionEnabled = userInteractionEnabled; + [[[CCDirector sharedDirector] responderManager] markAsDirty]; +} + +// ----------------------------------------------------------------- + +@end + +#pragma mark - NodeRGBA + +@implementation CCNodeRGBA + +@synthesize cascadeColorEnabled=_cascadeColorEnabled; +@synthesize cascadeOpacityEnabled=_cascadeOpacityEnabled; + +-(id) init +{ + if ((self=[super init]) ) { + _displayedOpacity = _realOpacity = 255; + _displayedColor = _realColor = ccWHITE; + _cascadeOpacityEnabled = NO; + _cascadeColorEnabled = NO; + } + return self; +} + +-(GLubyte) opacity +{ + return _realOpacity; +} + +-(GLubyte) displayedOpacity +{ + return _displayedOpacity; +} + +- (void) setOpacity:(GLubyte)opacity +{ + _displayedOpacity = _realOpacity = opacity; + + if( _cascadeOpacityEnabled ) { + GLubyte parentOpacity = 255; + if( [_parent conformsToProtocol:@protocol(CCRGBAProtocol)] && [(id)_parent isCascadeOpacityEnabled] ) + parentOpacity = [(id)_parent displayedOpacity]; + [self updateDisplayedOpacity:parentOpacity]; + } +} + +- (void)updateDisplayedOpacity:(GLubyte)parentOpacity +{ + _displayedOpacity = _realOpacity * parentOpacity/255.0; + + if (_cascadeOpacityEnabled) { + for (id item in _children) { + if ([item conformsToProtocol:@protocol(CCRGBAProtocol)]) { + [item updateDisplayedOpacity:_displayedOpacity]; + } + } + } +} + +-(ccColor3B) color +{ + return _realColor; +} + +-(ccColor3B) displayedColor +{ + return _displayedColor; +} + +- (void) setColor:(ccColor3B)color +{ + _displayedColor = _realColor = color; + + if( _cascadeColorEnabled ) { + ccColor3B parentColor = ccWHITE; + if( [_parent conformsToProtocol:@protocol(CCRGBAProtocol)] && [(id)_parent isCascadeColorEnabled] ) + parentColor = [(id)_parent displayedColor]; + [self updateDisplayedColor:parentColor]; + } +} + +- (void)updateDisplayedColor:(ccColor3B)parentColor +{ + _displayedColor.r = _realColor.r * parentColor.r/255.0; + _displayedColor.g = _realColor.g * parentColor.g/255.0; + _displayedColor.b = _realColor.b * parentColor.b/255.0; + + if (_cascadeColorEnabled) { + for (id item in _children) { + if ([item conformsToProtocol:@protocol(CCRGBAProtocol)]) { + [item updateDisplayedColor:_displayedColor]; + } + } + } +} + +@end + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/include/cocos2d/CCTransitionProgress.h b/cocos2d/CCParallaxNode.h similarity index 56% rename from include/cocos2d/CCTransitionProgress.h rename to cocos2d/CCParallaxNode.h index 241ff63..b2a1b3f 100644 --- a/include/cocos2d/CCTransitionProgress.h +++ b/cocos2d/CCParallaxNode.h @@ -1,9 +1,8 @@ /* * cocos2d for iPhone: http://www.cocos2d-iphone.org * - * Copyright (c) 2009 Lam Pham - * - * Copyright (c) 2012 Ricardo Quesada + * Copyright (c) 2009-2010 Ricardo Quesada + * Copyright (c) 2011 Zynga Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -25,38 +24,26 @@ * */ -#import "CCTransition.h" +#import "CCNode.h" -@interface CCTransitionProgress : CCTransitionScene -{ - float to_, from_; - CCScene *sceneToBeModified_; -} -@end - -/** CCTransitionRadialCCW transition. - A counter colock-wise radial transition to the next scene - */ -@interface CCTransitionProgressRadialCCW : CCTransitionProgress -@end +/** CCParallaxNode: A node that simulates a parallax scroller -/** CCTransitionRadialCW transition. - A counter colock-wise radial transition to the next scene -*/ -@interface CCTransitionProgressRadialCW : CCTransitionProgress -@end + The children will be moved faster / slower than the parent according the the parallax ratio. -/** CCTransitionProgressHorizontal transition. - A colock-wise radial transition to the next scene */ -@interface CCTransitionProgressHorizontal : CCTransitionProgress -@end +@interface CCParallaxNode : CCNode +{ + NSMutableArray *_parallaxArray; + CGPoint _lastPosition; +} -@interface CCTransitionProgressVertical : CCTransitionProgress -@end +/** array that holds the offset / ratio of the children */ +@property (nonatomic,readonly) NSArray * parallaxArray; -@interface CCTransitionProgressInOut : CCTransitionProgress -@end +/** Adds a child to the container with a z-order, a parallax ratio and a position offset + It returns self, so you can chain several addChilds. + @since v0.8 + */ +-(void) addChild: (CCNode*)node z:(NSInteger)z parallaxRatio:(CGPoint)c positionOffset:(CGPoint)positionOffset; -@interface CCTransitionProgressOutIn : CCTransitionProgress @end diff --git a/src/cocos2d/CCParallaxNode.m b/cocos2d/CCParallaxNode.m similarity index 74% rename from src/cocos2d/CCParallaxNode.m rename to cocos2d/CCParallaxNode.m index d30486c..908293c 100644 --- a/src/cocos2d/CCParallaxNode.m +++ b/cocos2d/CCParallaxNode.m @@ -26,34 +26,33 @@ #import "CCParallaxNode.h" #import "Support/CGPointExtension.h" -#import "Support/ccCArray.h" @interface CGPointObject : NSObject { - CGPoint ratio_; - CGPoint offset_; - CCNode *child_; // weak ref + CGPoint _ratio; + CGPoint _offset; + CCNode *__unsafe_unretained _child; // weak ref } @property (nonatomic,readwrite) CGPoint ratio; @property (nonatomic,readwrite) CGPoint offset; -@property (nonatomic,readwrite,assign) CCNode *child; +@property (nonatomic,readwrite,unsafe_unretained) CCNode *child; +(id) pointWithCGPoint:(CGPoint)point offset:(CGPoint)offset; -(id) initWithCGPoint:(CGPoint)point offset:(CGPoint)offset; @end @implementation CGPointObject -@synthesize ratio = ratio_; -@synthesize offset = offset_; -@synthesize child=child_; +@synthesize ratio = _ratio; +@synthesize offset = _offset; +@synthesize child = _child; +(id) pointWithCGPoint:(CGPoint)ratio offset:(CGPoint)offset { - return [[[self alloc] initWithCGPoint:ratio offset:offset] autorelease]; + return [[self alloc] initWithCGPoint:ratio offset:offset]; } -(id) initWithCGPoint:(CGPoint)ratio offset:(CGPoint)offset { if( (self=[super init])) { - ratio_ = ratio; - offset_ = offset; + _ratio = ratio; + _offset = offset; } return self; } @@ -61,25 +60,17 @@ -(id) initWithCGPoint:(CGPoint)ratio offset:(CGPoint)offset @implementation CCParallaxNode -@synthesize parallaxArray = parallaxArray_; +@synthesize parallaxArray = _parallaxArray; -(id) init { if( (self=[super init]) ) { - parallaxArray_ = ccArrayNew(5); - lastPosition = CGPointMake(-100,-100); + _parallaxArray = [[NSMutableArray alloc] init]; + _lastPosition = CGPointMake(-100,-100); } return self; } -- (void) dealloc -{ - if( parallaxArray_ ) { - ccArrayFree(parallaxArray_); - parallaxArray_ = nil; - } - [super dealloc]; -} -(void) addChild:(CCNode*)child z:(NSInteger)z tag:(NSInteger)tag { @@ -91,7 +82,7 @@ -(void) addChild: (CCNode*) child z:(NSInteger)z parallaxRatio:(CGPoint)ratio po NSAssert( child != nil, @"Argument must be non-nil"); CGPointObject *obj = [CGPointObject pointWithCGPoint:ratio offset:offset]; obj.child = child; - ccArrayAppendObjectWithResize(parallaxArray_, obj); + [_parallaxArray addObject:obj]; CGPoint pos = self.position; pos.x = pos.x * ratio.x + offset.x; @@ -103,25 +94,19 @@ -(void) addChild: (CCNode*) child z:(NSInteger)z parallaxRatio:(CGPoint)ratio po -(void) removeChild:(CCNode*)node cleanup:(BOOL)cleanup { - for( unsigned int i=0;i < parallaxArray_->num;i++) { - CGPointObject *point = parallaxArray_->arr[i]; - if( [point.child isEqual:node] ) { - ccArrayRemoveObjectAtIndex(parallaxArray_, i); - break; - } - } + [_parallaxArray removeObject:node]; [super removeChild:node cleanup:cleanup]; } -(void) removeAllChildrenWithCleanup:(BOOL)cleanup { - ccArrayRemoveAllObjects(parallaxArray_); + [_parallaxArray removeAllObjects]; [super removeAllChildrenWithCleanup:cleanup]; } -(CGPoint) absolutePosition_ { - CGPoint ret = position_; + CGPoint ret = _position; CCNode *cn = self; @@ -140,20 +125,17 @@ -(CGPoint) absolutePosition_ */ -(void) visit { -// CGPoint pos = position_; +// CGPoint pos = _position; // CGPoint pos = [self convertToWorldSpace:CGPointZero]; CGPoint pos = [self absolutePosition_]; - if( ! CGPointEqualToPoint(pos, lastPosition) ) { - - for(unsigned int i=0; i < parallaxArray_->num; i++ ) { - - CGPointObject *point = parallaxArray_->arr[i]; + if( ! CGPointEqualToPoint(pos, _lastPosition) ) { + for (CGPointObject *point in _parallaxArray) { float x = -pos.x + pos.x * point.ratio.x + point.offset.x; float y = -pos.y + pos.y * point.ratio.y + point.offset.y; point.child.position = ccp(x,y); } - lastPosition = pos; + _lastPosition = pos; } [super visit]; diff --git a/cocos2d/CCParticleBatchNode.h b/cocos2d/CCParticleBatchNode.h new file mode 100644 index 0000000..010c063 --- /dev/null +++ b/cocos2d/CCParticleBatchNode.h @@ -0,0 +1,99 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (C) 2009 Matt Oswald + * + * Copyright (c) 2009-2010 Ricardo Quesada + * Copyright (c) 2011 Zynga Inc. + * + * Copyright (c) 2011 Marco Tillemans + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + */ + +#import "CCNode.h" +@class CCTextureAtlas; +@class CCParticleSystem; + +//don't use lazy sorting for particle systems +@interface CCNode (extension) +-(void) setZOrder:(NSUInteger) z; +@end + +/** CCParticleBatchNode is like a batch node: if it contains children, it will draw them in 1 single OpenGL call + * (often known as "batch draw"). + * + * A CCParticleBatchNode can reference one and only one texture (one image file, one texture atlas). + * Only the CCParticleSystems that are contained in that texture can be added to the CCSpriteBatchNode. + * All CCParticleSystems added to a CCSpriteBatchNode are drawn in one OpenGL ES draw call. + * If the CCParticleSystems are not added to a CCParticleBatchNode then an OpenGL ES draw call will be needed for each one, which is less efficient. + * + * + * Limitations: + * - At the moment only CCParticleSystemQuad is supported + * - All systems need to be drawn with the same parameters, blend function, aliasing, texture + * + * Most efficient usage + * - Initialize the ParticleBatchNode with the texture and enough capacity for all the particle systems + * - Initialize all particle systems and add them as child to the batch node + * @since v1.1 + */ + +@interface CCParticleBatchNode : CCNode { + + CCTextureAtlas *_textureAtlas; + ccBlendFunc _blendFunc; +} + +/** the texture atlas used for drawing the quads */ +@property (nonatomic, strong) CCTextureAtlas* textureAtlas; +/** the blend function used for drawing the quads */ +@property (nonatomic, readwrite) ccBlendFunc blendFunc; + +/** initializes the particle system with CCTexture2D, a default capacity of 500 */ ++(id)batchNodeWithTexture:(CCTexture2D *)tex; + +/** initializes the particle system with the name of a file on disk (for a list of supported formats look at the CCTexture2D class), a default capacity of 500 particles */ ++(id)batchNodeWithFile:(NSString*) imageFile; + +/** initializes the particle system with CCTexture2D, a capacity of particles, which particle system to use */ ++(id)batchNodeWithTexture:(CCTexture2D *)tex capacity:(NSUInteger) capacity; + +/** initializes the particle system with the name of a file on disk (for a list of supported formats look at the CCTexture2D class), a capacity of particles */ ++(id)batchNodeWithFile:(NSString*)fileImage capacity:(NSUInteger)capacity; + +/** initializes the particle system with CCTexture2D, a capacity of particles */ +-(id)initWithTexture:(CCTexture2D *)tex capacity:(NSUInteger)capacity; + +/** initializes the particle system with the name of a file on disk (for a list of supported formats look at the CCTexture2D class), a capacity of particles */ +-(id)initWithFile:(NSString *)fileImage capacity:(NSUInteger)capacity; + +/** Add a child into the CCParticleBatchNode */ +-(void) addChild:(CCNode*)child z:(NSInteger)z tag:(NSInteger) aTag; + +/** Inserts a child into the CCParticleBatchNode */ +-(void) insertChild:(CCNode*) pSystem inAtlasAtIndex:(NSUInteger)index; + +/** remove child from the CCParticleBatchNode */ +-(void) removeChild:(CCNode*) pSystem cleanup:(BOOL)doCleanUp; + +/** disables a particle by inserting a 0'd quad into the texture atlas */ +-(void) disableParticle:(NSUInteger) particleIndex; +@end diff --git a/src/cocos2d/CCParticleBatchNode.m b/cocos2d/CCParticleBatchNode.m similarity index 69% rename from src/cocos2d/CCParticleBatchNode.m rename to cocos2d/CCParticleBatchNode.m index dcdad1a..fc7bb83 100644 --- a/src/cocos2d/CCParticleBatchNode.m +++ b/cocos2d/CCParticleBatchNode.m @@ -47,7 +47,7 @@ #import "kazmath/GL/matrix.h" -#define kCCParticleDefaultCapacity 500 +#define kCCParticleDefaultCapacity (500) @interface CCNode() -(void) _setZOrder:(NSInteger)z; @@ -63,20 +63,20 @@ -(NSUInteger) addChildHelper: (CCNode*) child z:(NSInteger)z tag:(NSInteger) aTa @implementation CCParticleBatchNode -@synthesize textureAtlas = textureAtlas_; -@synthesize blendFunc = blendFunc_; +@synthesize textureAtlas = _textureAtlas; +@synthesize blendFunc = _blendFunc; /* * creation with CCTexture2D */ +(id)batchNodeWithTexture:(CCTexture2D *)tex { - return [[[self alloc] initWithTexture:tex capacity:kCCParticleDefaultCapacity] autorelease]; + return [[self alloc] initWithTexture:tex capacity:kCCParticleDefaultCapacity]; } +(id)batchNodeWithTexture:(CCTexture2D *)tex capacity:(NSUInteger) capacity { - return [[[self alloc] initWithTexture:tex capacity:capacity] autorelease]; + return [[self alloc] initWithTexture:tex capacity:capacity]; } /* @@ -84,12 +84,12 @@ +(id)batchNodeWithTexture:(CCTexture2D *)tex capacity:(NSUInteger) capacity */ +(id)batchNodeWithFile:(NSString*)fileImage capacity:(NSUInteger)capacity { - return [[[self alloc] initWithFile:fileImage capacity:capacity] autorelease]; + return [[self alloc] initWithFile:fileImage capacity:capacity]; } +(id)batchNodeWithFile:(NSString*) imageFile { - return [[[self alloc] initWithFile:imageFile capacity:kCCParticleDefaultCapacity] autorelease]; + return [[self alloc] initWithFile:imageFile capacity:kCCParticleDefaultCapacity]; } /* @@ -97,15 +97,15 @@ +(id)batchNodeWithFile:(NSString*) imageFile */ -(id)initWithTexture:(CCTexture2D *)tex capacity:(NSUInteger)capacity { - if (self = [super init]) + if ((self = [super init])) { - textureAtlas_ = [[CCTextureAtlas alloc] initWithTexture:tex capacity:capacity]; + _textureAtlas = [[CCTextureAtlas alloc] initWithTexture:tex capacity:capacity]; // no lazy alloc in this node - children_ = [[CCArray alloc] initWithCapacity:capacity]; + _children = [[NSMutableArray alloc] initWithCapacity:capacity]; - blendFunc_.src = CC_BLEND_SRC; - blendFunc_.dst = CC_BLEND_DST; + _blendFunc.src = CC_BLEND_SRC; + _blendFunc.dst = CC_BLEND_DST; self.shaderProgram = [[CCShaderCache sharedShaderCache] programForKey:kCCShader_PositionTextureColor]; } @@ -124,14 +124,9 @@ -(id)initWithFile:(NSString *)fileImage capacity:(NSUInteger)capacity -(NSString*) description { - return [NSString stringWithFormat:@"<%@ = %p | Tag = %ld>", [self class], self, (long)tag_ ]; + return [NSString stringWithFormat:@"<%@ = %p | Tag = %ld>", [self class], self, (long)_tag ]; } --(void)dealloc -{ - [textureAtlas_ release]; - [super dealloc]; -} #pragma mark CCParticleBatchNode - composition @@ -146,13 +141,13 @@ -(void) visit // The alternative is to have a void CCSprite#visit, but // although this is less mantainable, is faster // - if (!visible_) + if (!_visible) return; kmGLPushMatrix(); - if ( grid_ && grid_.active) { - [grid_ beforeDraw]; + if ( _grid && _grid.active) { + [_grid beforeDraw]; [self transformAncestors]; } @@ -160,24 +155,26 @@ -(void) visit [self draw]; - if ( grid_ && grid_.active) - [grid_ afterDraw:self]; + if ( _grid && _grid.active) + [_grid afterDraw:self]; kmGLPopMatrix(); } // override addChild: --(void) addChild:(CCParticleSystem*)child z:(NSInteger)z tag:(NSInteger) aTag +-(void) addChild:(CCNode*)childNode z:(NSInteger)z tag:(NSInteger) aTag { + CCParticleSystem *child = (CCParticleSystem*)childNode; + NSAssert( child != nil, @"Argument must be non-nil"); NSAssert( [child isKindOfClass:[CCParticleSystem class]], @"CCParticleBatchNode only supports CCQuadParticleSystems as children"); - NSAssert( child.texture.name == textureAtlas_.texture.name, @"CCParticleSystem is not using the same texture id"); + NSAssert( child.texture.name == _textureAtlas.texture.name, @"CCParticleSystem is not using the same texture id"); // If this is the 1st children, then copy blending function - if( [children_ count] == 0 ) - blendFunc_ = [child blendFunc]; + if( [_children count] == 0 ) + _blendFunc = [child blendFunc]; - NSAssert( blendFunc_.src == child.blendFunc.src && blendFunc_.dst == child.blendFunc.dst, @"Can't add a PaticleSystem that uses a differnt blending function"); + NSAssert( _blendFunc.src == child.blendFunc.src && _blendFunc.dst == child.blendFunc.dst, @"Can't add a PaticleSystem that uses a differnt blending function"); //no lazy sorting, so don't call super addChild, call helper instead NSUInteger pos = [self addChildHelper:child z:z tag:aTag]; @@ -186,7 +183,7 @@ -(void) addChild:(CCParticleSystem*)child z:(NSInteger)z tag:(NSInteger) aTag NSUInteger atlasIndex; if (pos != 0) - atlasIndex = [[children_ objectAtIndex:pos-1] atlasIndex] + [[children_ objectAtIndex:pos-1] totalParticles]; + atlasIndex = [[_children objectAtIndex:pos-1] atlasIndex] + [[_children objectAtIndex:pos-1] totalParticles]; else atlasIndex = 0; @@ -205,20 +202,20 @@ -(NSUInteger) addChildHelper: (CCNode*) child z:(NSInteger)z tag:(NSInteger) aTa NSAssert( child != nil, @"Argument must be non-nil"); NSAssert( child.parent == nil, @"child already added. It can't be added again"); - if( ! children_ ) - children_ = [[CCArray alloc] initWithCapacity:4]; + if( ! _children ) + _children = [[NSMutableArray alloc] initWithCapacity:4]; //don't use a lazy insert NSUInteger pos = [self searchNewPositionInChildrenForZ:z]; - [children_ insertObject:child atIndex:pos]; + [_children insertObject:child atIndex:pos]; child.tag = aTag; [child _setZOrder:z]; [child setParent: self]; - if( isRunning_ ) { + if( _isRunning ) { [child onEnter]; [child onEnterTransitionDidFinish]; } @@ -226,28 +223,29 @@ -(NSUInteger) addChildHelper: (CCNode*) child z:(NSInteger)z tag:(NSInteger) aTa } // Reorder will be done in this function, no "lazy" reorder to particles --(void) reorderChild:(CCParticleSystem*)child z:(NSInteger)z +-(void) reorderChild:(CCNode*)childNode z:(NSInteger)z { + CCParticleSystem *child = (CCParticleSystem *)childNode; + NSAssert([child isKindOfClass:[CCParticleSystem class]], @"childNode must be a CCParticleNode."); NSAssert( child != nil, @"Child must be non-nil"); - NSAssert( [children_ containsObject:child], @"Child doesn't belong to batch" ); + NSAssert( [_children containsObject:child], @"Child doesn't belong to batch" ); if( z == child.zOrder ) return; // no reordering if only 1 child - if( [children_ count] > 1) + if( [_children count] > 1) { - NSUInteger newIndex, oldIndex; + NSUInteger newIndex = 0; + NSUInteger oldIndex = 0; [self getCurrentIndex:&oldIndex newIndex:&newIndex forChild:child z:z]; if( oldIndex != newIndex ) { - // reorder children_ array - [child retain]; - [children_ removeObjectAtIndex:oldIndex]; - [children_ insertObject:child atIndex:newIndex]; - [child release]; + // reorder _children array + [_children removeObjectAtIndex:oldIndex]; + [_children insertObject:child atIndex:newIndex]; // save old altasIndex NSUInteger oldAtlasIndex = child.atlasIndex; @@ -257,8 +255,8 @@ -(void) reorderChild:(CCParticleSystem*)child z:(NSInteger)z // Find new AtlasIndex NSUInteger newAtlasIndex = 0; - for( NSUInteger i=0;i < [children_ count];i++) { - CCParticleSystem *node = [children_ objectAtIndex:i]; + for( NSUInteger i=0;i < [_children count];i++) { + CCParticleSystem *node = [_children objectAtIndex:i]; if( node == child ) { newAtlasIndex = [child atlasIndex]; break; @@ -266,7 +264,7 @@ -(void) reorderChild:(CCParticleSystem*)child z:(NSInteger)z } // reorder textureAtlas quads - [textureAtlas_ moveQuadsFromIndex:oldAtlasIndex amount:child.totalParticles atIndex:newAtlasIndex]; + [_textureAtlas moveQuadsFromIndex:oldAtlasIndex amount:child.totalParticles atIndex:newAtlasIndex]; [child updateWithNoTime]; } @@ -281,11 +279,11 @@ -(void) getCurrentIndex:(NSUInteger*)oldIndex newIndex:(NSUInteger*)newIndex for BOOL foundNewIdx = NO; NSInteger minusOne = 0; - NSUInteger count = [children_ count]; + NSUInteger count = [_children count]; for( NSUInteger i=0; i < count; i++ ) { - CCNode *node = [children_ objectAtIndex:i]; + CCNode *node = [_children objectAtIndex:i]; // new index if( node.zOrder > z && ! foundNewIdx ) { @@ -319,10 +317,10 @@ -(void) getCurrentIndex:(NSUInteger*)oldIndex newIndex:(NSUInteger*)newIndex for -(NSUInteger) searchNewPositionInChildrenForZ: (NSInteger) z { - NSUInteger count = [children_ count]; + NSUInteger count = [_children count]; for( NSUInteger i=0; i < count; i++ ) { - CCNode *child = [children_ objectAtIndex:i]; + CCNode *child = [_children objectAtIndex:i]; if (child.zOrder > z) return i; } @@ -330,21 +328,26 @@ -(NSUInteger) searchNewPositionInChildrenForZ: (NSInteger) z } // override removeChild: --(void)removeChild: (CCParticleSystem*) child cleanup:(BOOL)doCleanup +-(void)removeChild: (CCNode*) childNode cleanup:(BOOL)doCleanup { + CCParticleSystem *child = (CCParticleSystem *)childNode; + NSAssert([child isKindOfClass:[CCParticleSystem class]], @"childNode must be a CCParticleNode."); + // explicit nil handling if (child == nil) + { return; + } - NSAssert([children_ containsObject:child], @"CCParticleBatchNode doesn't contain the sprite. Can't remove it"); + NSAssert([_children containsObject:child], @"CCParticleBatchNode doesn't contain the sprite. Can't remove it"); [super removeChild:child cleanup:doCleanup]; // remove child helper - [textureAtlas_ removeQuadsAtIndex:child.atlasIndex amount:child.totalParticles]; + [_textureAtlas removeQuadsAtIndex:child.atlasIndex amount:child.totalParticles]; // after memmove of data, empty the quads at the end of array - [textureAtlas_ fillWithEmptyQuadsFromIndex:textureAtlas_.totalQuads amount:child.totalParticles]; + [_textureAtlas fillWithEmptyQuadsFromIndex:_textureAtlas.totalQuads amount:child.totalParticles]; // paticle could be reused for self rendering [child setBatchNode:nil]; @@ -354,16 +357,16 @@ -(void)removeChild: (CCParticleSystem*) child cleanup:(BOOL)doCleanup -(void)removeChildAtIndex:(NSUInteger)index cleanup:(BOOL) doCleanup { - [self removeChild:(CCParticleSystem *)[children_ objectAtIndex:index] cleanup:doCleanup]; + [self removeChild:(CCParticleSystem *)[_children objectAtIndex:index] cleanup:doCleanup]; } -(void)removeAllChildrenWithCleanup:(BOOL)doCleanup { - [children_ makeObjectsPerformSelector:@selector(useSelfRender)]; + [_children makeObjectsPerformSelector:@selector(setBatchNode:) withObject:nil]; [super removeAllChildrenWithCleanup:doCleanup]; - [textureAtlas_ removeAllQuads]; + [_textureAtlas removeAllQuads]; } #pragma mark CCParticleBatchNode - Node overrides @@ -371,14 +374,14 @@ -(void) draw { CC_PROFILER_STOP(@"CCParticleBatchNode - draw"); - if( textureAtlas_.totalQuads == 0 ) + if( _textureAtlas.totalQuads == 0 ) return; CC_NODE_DRAW_SETUP(); - ccGLBlendFunc( blendFunc_.src, blendFunc_.dst ); + ccGLBlendFunc( _blendFunc.src, _blendFunc.dst ); - [textureAtlas_ drawQuads]; + [_textureAtlas drawQuads]; CC_PROFILER_STOP(@"CCParticleBatchNode - draw"); } @@ -388,10 +391,10 @@ -(void) draw -(void) increaseAtlasCapacityTo:(NSUInteger) quantity { CCLOG(@"cocos2d: CCParticleBatchNode: resizing TextureAtlas capacity from [%lu] to [%lu].", - (long)textureAtlas_.capacity, + (long)_textureAtlas.capacity, (long)quantity); - if( ! [textureAtlas_ resizeCapacity:quantity] ) { + if( ! [_textureAtlas resizeCapacity:quantity] ) { // serious problems CCLOGWARN(@"cocos2d: WARNING: Not enough memory to resize the atlas"); NSAssert(NO,@"XXX: CCParticleBatchNode #increaseAtlasCapacity SHALL handle this assert"); @@ -401,31 +404,32 @@ -(void) increaseAtlasCapacityTo:(NSUInteger) quantity //sets a 0'd quad into the quads array -(void) disableParticle:(NSUInteger)particleIndex { - ccV3F_C4B_T2F_Quad* quad = &((textureAtlas_.quads)[particleIndex]); + ccV3F_C4B_T2F_Quad* quad = &((_textureAtlas.quads)[particleIndex]); quad->br.vertices.x = quad->br.vertices.y = quad->tr.vertices.x = quad->tr.vertices.y = quad->tl.vertices.x = quad->tl.vertices.y = quad->bl.vertices.x = quad->bl.vertices.y = 0.0f; } #pragma mark CCParticleBatchNode - add / remove / reorder helper methods // add child helper --(void) insertChild:(CCParticleSystem*) pSystem inAtlasAtIndex:(NSUInteger)index +-(void) insertChild:(CCNode *)childPSystem inAtlasAtIndex:(NSUInteger)index { + CCParticleSystem *pSystem = (CCParticleSystem*)childPSystem; pSystem.atlasIndex = index; - if(textureAtlas_.totalQuads + pSystem.totalParticles > textureAtlas_.capacity) + if(_textureAtlas.totalQuads + pSystem.totalParticles > _textureAtlas.capacity) { - [self increaseAtlasCapacityTo:textureAtlas_.totalQuads + pSystem.totalParticles]; + [self increaseAtlasCapacityTo:_textureAtlas.totalQuads + pSystem.totalParticles]; // after a realloc empty quads of textureAtlas can be filled with gibberish (realloc doesn't perform calloc), insert empty quads to prevent it - [textureAtlas_ fillWithEmptyQuadsFromIndex:textureAtlas_.capacity - pSystem.totalParticles amount:pSystem.totalParticles]; + [_textureAtlas fillWithEmptyQuadsFromIndex:_textureAtlas.capacity - pSystem.totalParticles amount:pSystem.totalParticles]; } // make room for quads, not necessary for last child - if (pSystem.atlasIndex + pSystem.totalParticles != textureAtlas_.totalQuads) - [textureAtlas_ moveQuadsFromIndex:index to:index+pSystem.totalParticles]; + if (pSystem.atlasIndex + pSystem.totalParticles != _textureAtlas.totalQuads) + [_textureAtlas moveQuadsFromIndex:index to:index+pSystem.totalParticles]; // increase totalParticles here for new particles, update method of particlesystem will fill the quads - [textureAtlas_ increaseTotalQuadsWith:pSystem.totalParticles]; + [_textureAtlas increaseTotalQuadsWith:pSystem.totalParticles]; [self updateAllAtlasIndexes]; } @@ -433,10 +437,9 @@ -(void) insertChild:(CCParticleSystem*) pSystem inAtlasAtIndex:(NSUInteger)index //rebuild atlas indexes -(void) updateAllAtlasIndexes { - CCParticleSystem *child; NSUInteger index = 0; - CCARRAY_FOREACH(children_,child) + for (CCParticleSystem *child in _children) { child.atlasIndex = index; index += child.totalParticles; @@ -447,27 +450,27 @@ -(void) updateAllAtlasIndexes -(void) updateBlendFunc { - if( ! [textureAtlas_.texture hasPremultipliedAlpha] ) { - blendFunc_.src = GL_SRC_ALPHA; - blendFunc_.dst = GL_ONE_MINUS_SRC_ALPHA; + if( ! [_textureAtlas.texture hasPremultipliedAlpha] ) { + _blendFunc.src = GL_SRC_ALPHA; + _blendFunc.dst = GL_ONE_MINUS_SRC_ALPHA; } } -(void) setTexture:(CCTexture2D*)texture { - textureAtlas_.texture = texture; + _textureAtlas.texture = texture; // If the new texture has No premultiplied alpha, AND the blendFunc hasn't been changed, then update it - if( texture && ! [texture hasPremultipliedAlpha] && ( blendFunc_.src == CC_BLEND_SRC && blendFunc_.dst == CC_BLEND_DST ) ) + if( texture && ! [texture hasPremultipliedAlpha] && ( _blendFunc.src == CC_BLEND_SRC && _blendFunc.dst == CC_BLEND_DST ) ) { - blendFunc_.src = GL_SRC_ALPHA; - blendFunc_.dst = GL_ONE_MINUS_SRC_ALPHA; + _blendFunc.src = GL_SRC_ALPHA; + _blendFunc.dst = GL_ONE_MINUS_SRC_ALPHA; } } -(CCTexture2D*) texture { - return textureAtlas_.texture; + return _textureAtlas.texture; } @end diff --git a/cocos2d/CCParticleExamples.h b/cocos2d/CCParticleExamples.h new file mode 100644 index 0000000..747c92a --- /dev/null +++ b/cocos2d/CCParticleExamples.h @@ -0,0 +1,117 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2008-2010 Ricardo Quesada + * Copyright (c) 2011 Zynga Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + */ + + +#import "ccMacros.h" +#import "CCParticleSystemQuad.h" + +//! A fire particle system +@interface CCParticleFire: CCParticleSystemQuad +{ +} +// needed for BridgeSupport +-(id) init; +@end + +//! A fireworks particle system +@interface CCParticleFireworks : CCParticleSystemQuad +{ +} +// needed for BridgeSupport +-(id) init; +@end + +//! A sun particle system +@interface CCParticleSun : CCParticleSystemQuad +{ +} +// needed for BridgeSupport +-(id) init; +@end + +//! A galaxy particle system +@interface CCParticleGalaxy : CCParticleSystemQuad +{ +} +// needed for BridgeSupport +-(id) init; +@end + +//! A flower particle system +@interface CCParticleFlower : CCParticleSystemQuad +{ +} +// needed for BridgeSupport +-(id) init; +@end + +//! A meteor particle system +@interface CCParticleMeteor : CCParticleSystemQuad +{ +} +// needed for BridgeSupport +-(id) init; +@end + +//! An spiral particle system +@interface CCParticleSpiral : CCParticleSystemQuad +{ +} +// needed for BridgeSupport +-(id) init; +@end + +//! An explosion particle system +@interface CCParticleExplosion : CCParticleSystemQuad +{ +} +// needed for BridgeSupport +-(id) init; +@end + +//! An smoke particle system +@interface CCParticleSmoke : CCParticleSystemQuad +{ +} +// needed for BridgeSupport +-(id) init; +@end + +//! An snow particle system +@interface CCParticleSnow : CCParticleSystemQuad +{ +} +// needed for BridgeSupport +-(id) init; +@end + +//! A rain particle system +@interface CCParticleRain : CCParticleSystemQuad +{ +} +// needed for BridgeSupport +-(id) init; +@end diff --git a/cocos2d/CCParticleExamples.m b/cocos2d/CCParticleExamples.m new file mode 100644 index 0000000..7cfcfa8 --- /dev/null +++ b/cocos2d/CCParticleExamples.m @@ -0,0 +1,926 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2008-2010 Ricardo Quesada + * Copyright (c) 2011 Zynga Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + */ + + +// cocos2d +#import "CCParticleExamples.h" +#import "CCTextureCache.h" +#import "CCDirector.h" +#import "Support/CGPointExtension.h" + +// +// ParticleFireworks +// +@implementation CCParticleFireworks +-(id) init +{ + return [self initWithTotalParticles:1500]; +} + +-(id) initWithTotalParticles:(NSUInteger)p +{ + if( (self=[super initWithTotalParticles:p]) ) { + // _duration + _duration = kCCParticleDurationInfinity; + + // Gravity Mode + self.emitterMode = kCCParticleModeGravity; + + // Gravity Mode: gravity + self.gravity = ccp(0,-90); + + // Gravity Mode: radial + self.radialAccel = 0; + self.radialAccelVar = 0; + + // Gravity Mode: speed of particles + self.speed = 180; + self.speedVar = 50; + + // emitter position + CGSize winSize = [[CCDirector sharedDirector] winSize]; + self.position = ccp(winSize.width/2, winSize.height/2); + + // angle + _angle = 90; + _angleVar = 20; + + // life of particles + _life = 3.5f; + _lifeVar = 1; + + // emits per frame + _emissionRate = _totalParticles/_life; + + // color of particles + _startColor.r = 0.5f; + _startColor.g = 0.5f; + _startColor.b = 0.5f; + _startColor.a = 1.0f; + _startColorVar.r = 0.5f; + _startColorVar.g = 0.5f; + _startColorVar.b = 0.5f; + _startColorVar.a = 0.1f; + _endColor.r = 0.1f; + _endColor.g = 0.1f; + _endColor.b = 0.1f; + _endColor.a = 0.2f; + _endColorVar.r = 0.1f; + _endColorVar.g = 0.1f; + _endColorVar.b = 0.1f; + _endColorVar.a = 0.2f; + + // size, in pixels + _startSize = 8.0f; + _startSizeVar = 2.0f; + _endSize = kCCParticleStartSizeEqualToEndSize; + + self.texture = [[CCTextureCache sharedTextureCache] addImage: @"fire.png"]; + + // additive + self.blendAdditive = NO; + } + + return self; +} +@end + +// +// ParticleFire +// +@implementation CCParticleFire +-(id) init +{ + return [self initWithTotalParticles:250]; +} + +-(id) initWithTotalParticles:(NSUInteger) p +{ + if( (self=[super initWithTotalParticles:p]) ) { + + // _duration + _duration = kCCParticleDurationInfinity; + + // Gravity Mode + self.emitterMode = kCCParticleModeGravity; + + // Gravity Mode: gravity + self.gravity = ccp(0,0); + + // Gravity Mode: radial acceleration + self.radialAccel = 0; + self.radialAccelVar = 0; + + // Gravity Mode: speed of particles + self.speed = 60; + self.speedVar = 20; + + // starting _angle + _angle = 90; + _angleVar = 10; + + // emitter position + CGSize winSize = [[CCDirector sharedDirector] winSize]; + self.position = ccp(winSize.width/2, 60); + self.posVar = ccp(40, 20); + + // _life of particles + _life = 3; + _lifeVar = 0.25f; + + + // size, in pixels + _startSize = 54.0f; + _startSizeVar = 10.0f; + _endSize = kCCParticleStartSizeEqualToEndSize; + + // emits per frame + _emissionRate = _totalParticles/_life; + + // color of particles + _startColor.r = 0.76f; + _startColor.g = 0.25f; + _startColor.b = 0.12f; + _startColor.a = 1.0f; + _startColorVar.r = 0.0f; + _startColorVar.g = 0.0f; + _startColorVar.b = 0.0f; + _startColorVar.a = 0.0f; + _endColor.r = 0.0f; + _endColor.g = 0.0f; + _endColor.b = 0.0f; + _endColor.a = 1.0f; + _endColorVar.r = 0.0f; + _endColorVar.g = 0.0f; + _endColorVar.b = 0.0f; + _endColorVar.a = 0.0f; + + self.texture = [[CCTextureCache sharedTextureCache] addImage: @"fire.png"]; + + // additive + self.blendAdditive = YES; + } + + return self; +} +@end + +// +// ParticleSun +// +@implementation CCParticleSun +-(id) init +{ + return [self initWithTotalParticles:350]; +} + +-(id) initWithTotalParticles:(NSUInteger) p +{ + if( (self=[super initWithTotalParticles:p]) ) { + + // additive + self.blendAdditive = YES; + + // _duration + _duration = kCCParticleDurationInfinity; + + // Gravity Mode + self.emitterMode = kCCParticleModeGravity; + + // Gravity Mode: gravity + self.gravity = ccp(0,0); + + // Gravity mode: radial acceleration + self.radialAccel = 0; + self.radialAccelVar = 0; + + // Gravity mode: speed of particles + self.speed = 20; + self.speedVar = 5; + + + // _angle + _angle = 90; + _angleVar = 360; + + // emitter position + CGSize winSize = [[CCDirector sharedDirector] winSize]; + self.position = ccp(winSize.width/2, winSize.height/2); + self.posVar = CGPointZero; + + // _life of particles + _life = 1; + _lifeVar = 0.5f; + + // size, in pixels + _startSize = 30.0f; + _startSizeVar = 10.0f; + _endSize = kCCParticleStartSizeEqualToEndSize; + + // emits per seconds + _emissionRate = _totalParticles/_life; + + // color of particles + _startColor.r = 0.76f; + _startColor.g = 0.25f; + _startColor.b = 0.12f; + _startColor.a = 1.0f; + _startColorVar.r = 0.0f; + _startColorVar.g = 0.0f; + _startColorVar.b = 0.0f; + _startColorVar.a = 0.0f; + _endColor.r = 0.0f; + _endColor.g = 0.0f; + _endColor.b = 0.0f; + _endColor.a = 1.0f; + _endColorVar.r = 0.0f; + _endColorVar.g = 0.0f; + _endColorVar.b = 0.0f; + _endColorVar.a = 0.0f; + + self.texture = [[CCTextureCache sharedTextureCache] addImage: @"fire.png"]; + } + + return self; +} +@end + +// +// ParticleGalaxy +// +@implementation CCParticleGalaxy +-(id) init +{ + return [self initWithTotalParticles:200]; +} + +-(id) initWithTotalParticles:(NSUInteger)p +{ + if( (self=[super initWithTotalParticles:p]) ) { + + // _duration + _duration = kCCParticleDurationInfinity; + + // Gravity Mode + self.emitterMode = kCCParticleModeGravity; + + // Gravity Mode: gravity + self.gravity = ccp(0,0); + + // Gravity Mode: speed of particles + self.speed = 60; + self.speedVar = 10; + + // Gravity Mode: radial + self.radialAccel = -80; + self.radialAccelVar = 0; + + // Gravity Mode: tagential + self.tangentialAccel = 80; + self.tangentialAccelVar = 0; + + // _angle + _angle = 90; + _angleVar = 360; + + // emitter position + CGSize winSize = [[CCDirector sharedDirector] winSize]; + self.position = ccp(winSize.width/2, winSize.height/2); + self.posVar = CGPointZero; + + // _life of particles + _life = 4; + _lifeVar = 1; + + // size, in pixels + _startSize = 37.0f; + _startSizeVar = 10.0f; + _endSize = kCCParticleStartSizeEqualToEndSize; + + // emits per second + _emissionRate = _totalParticles/_life; + + // color of particles + _startColor.r = 0.12f; + _startColor.g = 0.25f; + _startColor.b = 0.76f; + _startColor.a = 1.0f; + _startColorVar.r = 0.0f; + _startColorVar.g = 0.0f; + _startColorVar.b = 0.0f; + _startColorVar.a = 0.0f; + _endColor.r = 0.0f; + _endColor.g = 0.0f; + _endColor.b = 0.0f; + _endColor.a = 1.0f; + _endColorVar.r = 0.0f; + _endColorVar.g = 0.0f; + _endColorVar.b = 0.0f; + _endColorVar.a = 0.0f; + + self.texture = [[CCTextureCache sharedTextureCache] addImage: @"fire.png"]; + + // additive + self.blendAdditive = YES; + } + + return self; +} +@end + +// +// ParticleFlower +// +@implementation CCParticleFlower +-(id) init +{ + return [self initWithTotalParticles:250]; +} + +-(id) initWithTotalParticles:(NSUInteger) p +{ + if( (self=[super initWithTotalParticles:p]) ) { + + // _duration + _duration = kCCParticleDurationInfinity; + + // Gravity Mode + self.emitterMode = kCCParticleModeGravity; + + // Gravity Mode: gravity + self.gravity = ccp(0,0); + + // Gravity Mode: speed of particles + self.speed = 80; + self.speedVar = 10; + + // Gravity Mode: radial + self.radialAccel = -60; + self.radialAccelVar = 0; + + // Gravity Mode: tagential + self.tangentialAccel = 15; + self.tangentialAccelVar = 0; + + // _angle + _angle = 90; + _angleVar = 360; + + // emitter position + CGSize winSize = [[CCDirector sharedDirector] winSize]; + self.position = ccp(winSize.width/2, winSize.height/2); + self.posVar = CGPointZero; + + // _life of particles + _life = 4; + _lifeVar = 1; + + // size, in pixels + _startSize = 30.0f; + _startSizeVar = 10.0f; + _endSize = kCCParticleStartSizeEqualToEndSize; + + // emits per second + _emissionRate = _totalParticles/_life; + + // color of particles + _startColor.r = 0.50f; + _startColor.g = 0.50f; + _startColor.b = 0.50f; + _startColor.a = 1.0f; + _startColorVar.r = 0.5f; + _startColorVar.g = 0.5f; + _startColorVar.b = 0.5f; + _startColorVar.a = 0.5f; + _endColor.r = 0.0f; + _endColor.g = 0.0f; + _endColor.b = 0.0f; + _endColor.a = 1.0f; + _endColorVar.r = 0.0f; + _endColorVar.g = 0.0f; + _endColorVar.b = 0.0f; + _endColorVar.a = 0.0f; + + self.texture = [[CCTextureCache sharedTextureCache] addImage: @"fire.png"]; + + // additive + self.blendAdditive = YES; + } + + return self; +} +@end + +// +// ParticleMeteor +// +@implementation CCParticleMeteor +-(id) init +{ + return [self initWithTotalParticles:150]; +} + +-(id) initWithTotalParticles:(NSUInteger) p +{ + if( (self=[super initWithTotalParticles:p]) ) { + + // _duration + _duration = kCCParticleDurationInfinity; + + // Gravity Mode + self.emitterMode = kCCParticleModeGravity; + + // Gravity Mode: gravity + self.gravity = ccp(-200,200); + + // Gravity Mode: speed of particles + self.speed = 15; + self.speedVar = 5; + + // Gravity Mode: radial + self.radialAccel = 0; + self.radialAccelVar = 0; + + // Gravity Mode: tagential + self.tangentialAccel = 0; + self.tangentialAccelVar = 0; + + // _angle + _angle = 90; + _angleVar = 360; + + // emitter position + CGSize winSize = [[CCDirector sharedDirector] winSize]; + self.position = ccp(winSize.width/2, winSize.height/2); + self.posVar = CGPointZero; + + // _life of particles + _life = 2; + _lifeVar = 1; + + // size, in pixels + _startSize = 60.0f; + _startSizeVar = 10.0f; + _endSize = kCCParticleStartSizeEqualToEndSize; + + // emits per second + _emissionRate = _totalParticles/_life; + + // color of particles + _startColor.r = 0.2f; + _startColor.g = 0.4f; + _startColor.b = 0.7f; + _startColor.a = 1.0f; + _startColorVar.r = 0.0f; + _startColorVar.g = 0.0f; + _startColorVar.b = 0.2f; + _startColorVar.a = 0.1f; + _endColor.r = 0.0f; + _endColor.g = 0.0f; + _endColor.b = 0.0f; + _endColor.a = 1.0f; + _endColorVar.r = 0.0f; + _endColorVar.g = 0.0f; + _endColorVar.b = 0.0f; + _endColorVar.a = 0.0f; + + self.texture = [[CCTextureCache sharedTextureCache] addImage: @"fire.png"]; + + // additive + self.blendAdditive = YES; + } + + return self; +} +@end + +// +// ParticleSpiral +// +@implementation CCParticleSpiral +-(id) init +{ + return [self initWithTotalParticles:500]; +} + +-(id) initWithTotalParticles:(NSUInteger) p +{ + if( (self=[super initWithTotalParticles:p]) ) { + + // _duration + _duration = kCCParticleDurationInfinity; + + // Gravity Mode + self.emitterMode = kCCParticleModeGravity; + + // Gravity Mode: gravity + self.gravity = ccp(0,0); + + // Gravity Mode: speed of particles + self.speed = 150; + self.speedVar = 0; + + // Gravity Mode: radial + self.radialAccel = -380; + self.radialAccelVar = 0; + + // Gravity Mode: tagential + self.tangentialAccel = 45; + self.tangentialAccelVar = 0; + + // _angle + _angle = 90; + _angleVar = 0; + + // emitter position + CGSize winSize = [[CCDirector sharedDirector] winSize]; + self.position = ccp(winSize.width/2, winSize.height/2); + self.posVar = CGPointZero; + + // _life of particles + _life = 12; + _lifeVar = 0; + + // size, in pixels + _startSize = 20.0f; + _startSizeVar = 0.0f; + _endSize = kCCParticleStartSizeEqualToEndSize; + + // emits per second + _emissionRate = _totalParticles/_life; + + // color of particles + _startColor.r = 0.5f; + _startColor.g = 0.5f; + _startColor.b = 0.5f; + _startColor.a = 1.0f; + _startColorVar.r = 0.5f; + _startColorVar.g = 0.5f; + _startColorVar.b = 0.5f; + _startColorVar.a = 0.0f; + _endColor.r = 0.5f; + _endColor.g = 0.5f; + _endColor.b = 0.5f; + _endColor.a = 1.0f; + _endColorVar.r = 0.5f; + _endColorVar.g = 0.5f; + _endColorVar.b = 0.5f; + _endColorVar.a = 0.0f; + + self.texture = [[CCTextureCache sharedTextureCache] addImage: @"fire.png"]; + + // additive + self.blendAdditive = NO; + } + + return self; +} +@end + +// +// ParticleExplosion +// +@implementation CCParticleExplosion +-(id) init +{ + return [self initWithTotalParticles:700]; +} + +-(id) initWithTotalParticles:(NSUInteger)p +{ + if( (self=[super initWithTotalParticles:p]) ) { + + // _duration + _duration = 0.1f; + + self.emitterMode = kCCParticleModeGravity; + + // Gravity Mode: gravity + self.gravity = ccp(0,0); + + // Gravity Mode: speed of particles + self.speed = 70; + self.speedVar = 40; + + // Gravity Mode: radial + self.radialAccel = 0; + self.radialAccelVar = 0; + + // Gravity Mode: tagential + self.tangentialAccel = 0; + self.tangentialAccelVar = 0; + + // _angle + _angle = 90; + _angleVar = 360; + + // emitter position + CGSize winSize = [[CCDirector sharedDirector] winSize]; + self.position = ccp(winSize.width/2, winSize.height/2); + self.posVar = CGPointZero; + + // _life of particles + _life = 5.0f; + _lifeVar = 2; + + // size, in pixels + _startSize = 15.0f; + _startSizeVar = 10.0f; + _endSize = kCCParticleStartSizeEqualToEndSize; + + // emits per second + _emissionRate = _totalParticles/_duration; + + // color of particles + _startColor.r = 0.7f; + _startColor.g = 0.1f; + _startColor.b = 0.2f; + _startColor.a = 1.0f; + _startColorVar.r = 0.5f; + _startColorVar.g = 0.5f; + _startColorVar.b = 0.5f; + _startColorVar.a = 0.0f; + _endColor.r = 0.5f; + _endColor.g = 0.5f; + _endColor.b = 0.5f; + _endColor.a = 0.0f; + _endColorVar.r = 0.5f; + _endColorVar.g = 0.5f; + _endColorVar.b = 0.5f; + _endColorVar.a = 0.0f; + + self.texture = [[CCTextureCache sharedTextureCache] addImage: @"fire.png"]; + + // additive + self.blendAdditive = NO; + } + + return self; +} +@end + +// +// ParticleSmoke +// +@implementation CCParticleSmoke +-(id) init +{ + return [self initWithTotalParticles:200]; +} + +-(id) initWithTotalParticles:(NSUInteger) p +{ + if( (self=[super initWithTotalParticles:p]) ) { + + // _duration + _duration = kCCParticleDurationInfinity; + + // Emitter mode: Gravity Mode + self.emitterMode = kCCParticleModeGravity; + + // Gravity Mode: gravity + self.gravity = ccp(0,0); + + // Gravity Mode: radial acceleration + self.radialAccel = 0; + self.radialAccelVar = 0; + + // Gravity Mode: speed of particles + self.speed = 25; + self.speedVar = 10; + + // _angle + _angle = 90; + _angleVar = 5; + + // emitter position + CGSize winSize = [[CCDirector sharedDirector] winSize]; + self.position = ccp(winSize.width/2, 0); + self.posVar = ccp(20, 0); + + // _life of particles + _life = 4; + _lifeVar = 1; + + // size, in pixels + _startSize = 60.0f; + _startSizeVar = 10.0f; + _endSize = kCCParticleStartSizeEqualToEndSize; + + // emits per frame + _emissionRate = _totalParticles/_life; + + // color of particles + _startColor.r = 0.8f; + _startColor.g = 0.8f; + _startColor.b = 0.8f; + _startColor.a = 1.0f; + _startColorVar.r = 0.02f; + _startColorVar.g = 0.02f; + _startColorVar.b = 0.02f; + _startColorVar.a = 0.0f; + _endColor.r = 0.0f; + _endColor.g = 0.0f; + _endColor.b = 0.0f; + _endColor.a = 1.0f; + _endColorVar.r = 0.0f; + _endColorVar.g = 0.0f; + _endColorVar.b = 0.0f; + _endColorVar.a = 0.0f; + + self.texture = [[CCTextureCache sharedTextureCache] addImage: @"fire.png"]; + + // additive + self.blendAdditive = NO; + } + + return self; +} +@end + +@implementation CCParticleSnow +-(id) init +{ + return [self initWithTotalParticles:700]; +} + +-(id) initWithTotalParticles:(NSUInteger)p +{ + if( (self=[super initWithTotalParticles:p]) ) { + + // _duration + _duration = kCCParticleDurationInfinity; + + // set gravity mode. + self.emitterMode = kCCParticleModeGravity; + + // Gravity Mode: gravity + self.gravity = ccp(0,-1); + + // Gravity Mode: speed of particles + self.speed = 5; + self.speedVar = 1; + + // Gravity Mode: radial + self.radialAccel = 0; + self.radialAccelVar = 1; + + // Gravity mode: tagential + self.tangentialAccel = 0; + self.tangentialAccelVar = 1; + + // emitter position + self.position = (CGPoint) { + [[CCDirector sharedDirector] winSize].width / 2, + [[CCDirector sharedDirector] winSize].height + 10 + }; + self.posVar = ccp( [[CCDirector sharedDirector] winSize].width / 2, 0 ); + + // _angle + _angle = -90; + _angleVar = 5; + + // _life of particles + _life = 45; + _lifeVar = 15; + + // size, in pixels + _startSize = 10.0f; + _startSizeVar = 5.0f; + _endSize = kCCParticleStartSizeEqualToEndSize; + + // emits per second + _emissionRate = 10; + + // color of particles + _startColor.r = 1.0f; + _startColor.g = 1.0f; + _startColor.b = 1.0f; + _startColor.a = 1.0f; + _startColorVar.r = 0.0f; + _startColorVar.g = 0.0f; + _startColorVar.b = 0.0f; + _startColorVar.a = 0.0f; + _endColor.r = 1.0f; + _endColor.g = 1.0f; + _endColor.b = 1.0f; + _endColor.a = 0.0f; + _endColorVar.r = 0.0f; + _endColorVar.g = 0.0f; + _endColorVar.b = 0.0f; + _endColorVar.a = 0.0f; + + self.texture = [[CCTextureCache sharedTextureCache] addImage: @"fire.png"]; + + // additive + self.blendAdditive = NO; + } + + return self; +} +@end + +@implementation CCParticleRain +-(id) init +{ + return [self initWithTotalParticles:1000]; +} + +-(id) initWithTotalParticles:(NSUInteger)p +{ + if( (self=[super initWithTotalParticles:p]) ) { + + // _duration + _duration = kCCParticleDurationInfinity; + + self.emitterMode = kCCParticleModeGravity; + + // Gravity Mode: gravity + self.gravity = ccp(10,-10); + + // Gravity Mode: radial + self.radialAccel = 0; + self.radialAccelVar = 1; + + // Gravity Mode: tagential + self.tangentialAccel = 0; + self.tangentialAccelVar = 1; + + // Gravity Mode: speed of particles + self.speed = 130; + self.speedVar = 30; + + // _angle + _angle = -90; + _angleVar = 5; + + + // emitter position + self.position = (CGPoint) { + [[CCDirector sharedDirector] winSize].width / 2, + [[CCDirector sharedDirector] winSize].height + }; + self.posVar = ccp( [[CCDirector sharedDirector] winSize].width / 2, 0 ); + + // _life of particles + _life = 4.5f; + _lifeVar = 0; + + // size, in pixels + _startSize = 4.0f; + _startSizeVar = 2.0f; + _endSize = kCCParticleStartSizeEqualToEndSize; + + // emits per second + _emissionRate = 20; + + // color of particles + _startColor.r = 0.7f; + _startColor.g = 0.8f; + _startColor.b = 1.0f; + _startColor.a = 1.0f; + _startColorVar.r = 0.0f; + _startColorVar.g = 0.0f; + _startColorVar.b = 0.0f; + _startColorVar.a = 0.0f; + _endColor.r = 0.7f; + _endColor.g = 0.8f; + _endColor.b = 1.0f; + _endColor.a = 0.5f; + _endColorVar.r = 0.0f; + _endColorVar.g = 0.0f; + _endColorVar.b = 0.0f; + _endColorVar.a = 0.0f; + + self.texture = [[CCTextureCache sharedTextureCache] addImage: @"fire.png"]; + + // additive + self.blendAdditive = NO; + } + + return self; +} +@end diff --git a/cocos2d/CCParticleSystem.h b/cocos2d/CCParticleSystem.h new file mode 100644 index 0000000..1910ae0 --- /dev/null +++ b/cocos2d/CCParticleSystem.h @@ -0,0 +1,464 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2008-2010 Ricardo Quesada + * Copyright (c) 2011 Zynga Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + */ + + +#import "CCProtocols.h" +#import "CCNode.h" +#import "ccTypes.h" +#import "ccConfig.h" + +@class CCParticleBatchNode; + +//* @enum +enum { + /** The Particle emitter lives forever */ + kCCParticleDurationInfinity = -1, + + /** The starting size of the particle is equal to the ending size */ + kCCParticleStartSizeEqualToEndSize = -1, + + /** The starting radius of the particle is equal to the ending radius */ + kCCParticleStartRadiusEqualToEndRadius = -1, + + // backward compatible + kParticleStartSizeEqualToEndSize = kCCParticleStartSizeEqualToEndSize, + kParticleDurationInfinity = kCCParticleDurationInfinity, +}; + +//* @enum +enum { + /** Gravity mode (A mode) */ + kCCParticleModeGravity, + + /** Radius mode (B mode) */ + kCCParticleModeRadius, +}; + + +/** @typedef tCCParticlePositionType + possible types of particle positions + */ +typedef enum { + /** Living particles are attached to the world and are unaffected by emitter repositioning. */ + kCCParticlePositionTypeFree, + + /** Living particles are attached to the world but will follow the emitter repositioning. + Use case: Attach an emitter to an sprite, and you want that the emitter follows the sprite. + */ + kCCParticlePositionTypeRelative, + + /** Living particles are attached to the emitter and are translated along with it. */ + kCCParticlePositionTypeGrouped, +}tCCParticlePositionType; + +// backward compatible +enum { + kParticlePositionTypeFree = kCCParticlePositionTypeFree, + kParticlePositionTypeGrouped = kCCParticlePositionTypeGrouped, +}; + +/** @struct tCCParticle + Structure that contains the values of each particle + */ +typedef struct sCCParticle { + CGPoint pos; + CGPoint startPos; + + ccColor4F color; + ccColor4F deltaColor; + + float size; + float deltaSize; + + float rotation; + float deltaRotation; + + ccTime timeToLive; + + NSUInteger atlasIndex; + + union { + // Mode A: gravity, direction, radial accel, tangential accel + struct { + CGPoint dir; + float radialAccel; + float tangentialAccel; + } A; + + // Mode B: radius mode + struct { + float angle; + float degreesPerSecond; + float radius; + float deltaRadius; + } B; + } mode; + +}tCCParticle; + +typedef void (*CC_UPDATE_PARTICLE_IMP)(id, SEL, tCCParticle*, CGPoint); + +@class CCTexture2D; + +/** Particle System base class + Attributes of a Particle System: + - emmision rate of the particles + - Gravity Mode (Mode A): + - gravity + - direction + - speed +- variance + - tangential acceleration +- variance + - radial acceleration +- variance + - Radius Mode (Mode B): + - startRadius +- variance + - endRadius +- variance + - rotate +- variance + - Properties common to all modes: + - life +- life variance + - start spin +- variance + - end spin +- variance + - start size +- variance + - end size +- variance + - start color +- variance + - end color +- variance + - life +- variance + - blending function + - texture + + cocos2d also supports particles generated by Particle Designer (http://particledesigner.71squared.com/). + 'Radius Mode' in Particle Designer uses a fixed emit rate of 30 hz. Since that can't be guarateed in cocos2d, + cocos2d uses a another approach, but the results are almost identical. + + cocos2d supports all the variables used by Particle Designer plus a bit more: + - spinning particles (supported when using CCParticleSystemQuad) + - tangential acceleration (Gravity mode) + - radial acceleration (Gravity mode) + - radius direction (Radius mode) (Particle Designer supports outwards to inwards direction only) + + It is possible to customize any of the above mentioned properties in runtime. Example: + + @code + emitter.radialAccel = 15; + emitter.startSpin = 0; + @endcode + + */ +@interface CCParticleSystem : CCNode +{ + // is the particle system active ? + BOOL _active; + // duration in seconds of the system. -1 is infinity + float _duration; + // time elapsed since the start of the system (in seconds) + float _elapsed; + + // position is from "superclass" CocosNode + CGPoint _sourcePosition; + // Position variance + CGPoint _posVar; + + // The angle (direction) of the particles measured in degrees + float _angle; + // Angle variance measured in degrees; + float _angleVar; + + // Different modes + + NSInteger _emitterMode; + union { + // Mode A:Gravity + Tangential Accel + Radial Accel + struct { + // gravity of the particles + CGPoint gravity; + + // The speed the particles will have. + float speed; + // The speed variance + float speedVar; + + // Tangential acceleration + float tangentialAccel; + // Tangential acceleration variance + float tangentialAccelVar; + + // Radial acceleration + float radialAccel; + // Radial acceleration variance + float radialAccelVar; + } A; + + // Mode B: circular movement (gravity, radial accel and tangential accel don't are not used in this mode) + struct { + + // The starting radius of the particles + float startRadius; + // The starting radius variance of the particles + float startRadiusVar; + // The ending radius of the particles + float endRadius; + // The ending radius variance of the particles + float endRadiusVar; + // Number of degress to rotate a particle around the source pos per second + float rotatePerSecond; + // Variance in degrees for rotatePerSecond + float rotatePerSecondVar; + } B; + } _mode; + + // start ize of the particles + float _startSize; + // start Size variance + float _startSizeVar; + // End size of the particle + float _endSize; + // end size of variance + float _endSizeVar; + + // How many seconds will the particle live + float _life; + // Life variance + float _lifeVar; + + // Start color of the particles + ccColor4F _startColor; + // Start color variance + ccColor4F _startColorVar; + // End color of the particles + ccColor4F _endColor; + // End color variance + ccColor4F _endColorVar; + + // start angle of the particles + float _startSpin; + // start angle variance + float _startSpinVar; + // End angle of the particle + float _endSpin; + // end angle ariance + float _endSpinVar; + + // Array of particles + tCCParticle *_particles; + // Maximum particles + NSUInteger _totalParticles; + // Count of active particles + NSUInteger _particleCount; + // Number of allocated particles + NSUInteger _allocatedParticles; + + // How many particles can be emitted per second + float _emissionRate; + float _emitCounter; + + // Texture of the particles + CCTexture2D *_texture; + // blend function + ccBlendFunc _blendFunc; + // Texture alpha behavior + BOOL _opacityModifyRGB; + + // movment type: free or grouped + tCCParticlePositionType _particlePositionType; + + // Whether or not the node will be auto-removed when there are not particles + BOOL _autoRemoveOnFinish; + + // particle idx + NSUInteger _particleIdx; + + // Optimization + CC_UPDATE_PARTICLE_IMP _updateParticleImp; + SEL _updateParticleSel; + + // for batching. If nil, then it won't be batched + CCParticleBatchNode *_batchNode; + + // index of system in batch node array + NSUInteger _atlasIndex; + + //YES if scaled or rotated + BOOL _transformSystemDirty; +} + +/** Is the emitter active */ +@property (nonatomic,readonly) BOOL active; +/** Quantity of particles that are being simulated at the moment */ +@property (nonatomic,readonly) NSUInteger particleCount; +/** How many seconds the emitter wil run. -1 means 'forever' */ +@property (nonatomic,readwrite,assign) float duration; +/** sourcePosition of the emitter */ +@property (nonatomic,readwrite,assign) CGPoint sourcePosition; +/** Position variance of the emitter */ +@property (nonatomic,readwrite,assign) CGPoint posVar; +/** life, and life variation of each particle */ +@property (nonatomic,readwrite,assign) float life; +/** life variance of each particle */ +@property (nonatomic,readwrite,assign) float lifeVar; +/** angle and angle variation of each particle */ +@property (nonatomic,readwrite,assign) float angle; +/** angle variance of each particle */ +@property (nonatomic,readwrite,assign) float angleVar; + +/** Gravity value. Only available in 'Gravity' mode. */ +@property (nonatomic,readwrite,assign) CGPoint gravity; +/** speed of each particle. Only available in 'Gravity' mode. */ +@property (nonatomic,readwrite,assign) float speed; +/** speed variance of each particle. Only available in 'Gravity' mode. */ +@property (nonatomic,readwrite,assign) float speedVar; +/** tangential acceleration of each particle. Only available in 'Gravity' mode. */ +@property (nonatomic,readwrite,assign) float tangentialAccel; +/** tangential acceleration variance of each particle. Only available in 'Gravity' mode. */ +@property (nonatomic,readwrite,assign) float tangentialAccelVar; +/** radial acceleration of each particle. Only available in 'Gravity' mode. */ +@property (nonatomic,readwrite,assign) float radialAccel; +/** radial acceleration variance of each particle. Only available in 'Gravity' mode. */ +@property (nonatomic,readwrite,assign) float radialAccelVar; + +/** The starting radius of the particles. Only available in 'Radius' mode. */ +@property (nonatomic,readwrite,assign) float startRadius; +/** The starting radius variance of the particles. Only available in 'Radius' mode. */ +@property (nonatomic,readwrite,assign) float startRadiusVar; +/** The ending radius of the particles. Only available in 'Radius' mode. */ +@property (nonatomic,readwrite,assign) float endRadius; +/** The ending radius variance of the particles. Only available in 'Radius' mode. */ +@property (nonatomic,readwrite,assign) float endRadiusVar; +/** Number of degress to rotate a particle around the source pos per second. Only available in 'Radius' mode. */ +@property (nonatomic,readwrite,assign) float rotatePerSecond; +/** Variance in degrees for rotatePerSecond. Only available in 'Radius' mode. */ +@property (nonatomic,readwrite,assign) float rotatePerSecondVar; + +/** start size in pixels of each particle */ +@property (nonatomic,readwrite,assign) float startSize; +/** size variance in pixels of each particle */ +@property (nonatomic,readwrite,assign) float startSizeVar; +/** end size in pixels of each particle */ +@property (nonatomic,readwrite,assign) float endSize; +/** end size variance in pixels of each particle */ +@property (nonatomic,readwrite,assign) float endSizeVar; +/** start color of each particle */ +@property (nonatomic,readwrite,assign) ccColor4F startColor; +/** start color variance of each particle */ +@property (nonatomic,readwrite,assign) ccColor4F startColorVar; +/** end color and end color variation of each particle */ +@property (nonatomic,readwrite,assign) ccColor4F endColor; +/** end color variance of each particle */ +@property (nonatomic,readwrite,assign) ccColor4F endColorVar; +//* initial angle of each particle +@property (nonatomic,readwrite,assign) float startSpin; +//* initial angle of each particle +@property (nonatomic,readwrite,assign) float startSpinVar; +//* initial angle of each particle +@property (nonatomic,readwrite,assign) float endSpin; +//* initial angle of each particle +@property (nonatomic,readwrite,assign) float endSpinVar; +/** emission rate of the particles */ +@property (nonatomic,readwrite,assign) float emissionRate; +/** maximum particles of the system */ +@property (nonatomic,readwrite,assign) NSUInteger totalParticles; +/** conforms to CocosNodeTexture protocol */ +@property (nonatomic,readwrite, strong) CCTexture2D * texture; +/** conforms to CocosNodeTexture protocol */ +@property (nonatomic,readwrite) ccBlendFunc blendFunc; +/** does the alpha value modify color */ +@property (nonatomic, readwrite, getter=doesOpacityModifyRGB, assign) BOOL opacityModifyRGB; +/** whether or not the particles are using blend additive. + If enabled, the following blending function will be used. + @code + source blend function = GL_SRC_ALPHA; + dest blend function = GL_ONE; + @endcode + */ +@property (nonatomic,readwrite) BOOL blendAdditive; +/** particles movement type: Free or Grouped + @since v0.8 + */ +@property (nonatomic,readwrite) tCCParticlePositionType particlePositionType; +/** whether or not the node will be auto-removed when it has no particles left. + By default it is NO. + @since v0.8 + */ +@property (nonatomic,readwrite) BOOL autoRemoveOnFinish; +/** Switch between different kind of emitter modes: + - kCCParticleModeGravity: uses gravity, speed, radial and tangential acceleration + - kCCParticleModeRadius: uses radius movement + rotation + */ +@property (nonatomic,readwrite) NSInteger emitterMode; + +/** weak reference to the CCSpriteBatchNode that renders the CCSprite */ +@property (nonatomic,readwrite,unsafe_unretained) CCParticleBatchNode *batchNode; + +@property (nonatomic,readwrite) NSUInteger atlasIndex; + +/** creates an initializes a CCParticleSystem from a plist file. + This plist files can be creted manually or with Particle Designer: + http://particledesigner.71squared.com/ + @since v0.99.3 + */ ++(id) particleWithFile:(NSString*)plistFile; + +/* creates an void particle emitter with a maximun number of particles. + @since v2.1 +*/ ++(id) particleWithTotalParticles:(NSUInteger) numberOfParticles; + + +/** initializes a CCParticleSystem from a plist file. + This plist files can be creted manually or with Particle Designer: + http://particledesigner.71squared.com/ + @since v0.99.3 + */ +-(id) initWithFile:(NSString*) plistFile; + +/** initializes a particle system from a NSDictionary. + @since v0.99.3 + */ +-(id) initWithDictionary:(NSDictionary*)dictionary; + +/** initializes a particle system from a NSDictionary and the path from where to load the png + @since v2.1 + */ +-(id) initWithDictionary:(NSDictionary *)dictionary path:(NSString*)dirname; + +//! Initializes a system with a fixed number of particles +-(id) initWithTotalParticles:(NSUInteger) numberOfParticles; +//! stop emitting particles. Running particles will continue to run until they die +-(void) stopSystem; +//! Kill all living particles. +-(void) resetSystem; +//! whether or not the system is full +-(BOOL) isFull; + +//! should be overriden by subclasses +-(void) updateQuadWithParticle:(tCCParticle*)particle newPosition:(CGPoint)pos; +//! should be overriden by subclasses +-(void) postStep; + +//! called in every loop. +-(void) update: (ccTime) dt; + +-(void) updateWithNoTime; + +@end diff --git a/src/cocos2d/CCParticleSystem.m b/cocos2d/CCParticleSystem.m similarity index 52% rename from src/cocos2d/CCParticleSystem.m rename to cocos2d/CCParticleSystem.m index 3d5c38c..9c7c546 100644 --- a/src/cocos2d/CCParticleSystem.m +++ b/cocos2d/CCParticleSystem.m @@ -66,26 +66,34 @@ -(void) updateBlendFunc; @end @implementation CCParticleSystem -@synthesize active, duration; -@synthesize sourcePosition, posVar; -@synthesize particleCount; -@synthesize life, lifeVar; -@synthesize angle, angleVar; -@synthesize startColor, startColorVar, endColor, endColorVar; -@synthesize startSpin, startSpinVar, endSpin, endSpinVar; -@synthesize emissionRate; -@synthesize startSize, startSizeVar; -@synthesize endSize, endSizeVar; -@synthesize opacityModifyRGB = opacityModifyRGB_; -@synthesize blendFunc = blendFunc_; -@synthesize positionType = positionType_; -@synthesize autoRemoveOnFinish = autoRemoveOnFinish_; -@synthesize emitterMode = emitterMode_; -@synthesize atlasIndex = atlasIndex_; +@synthesize active = _active, duration = _duration; +@synthesize sourcePosition = _sourcePosition, posVar = _posVar; +@synthesize particleCount = _particleCount; +@synthesize life = _life, lifeVar = _lifeVar; +@synthesize angle = _angle, angleVar = _angleVar; +@synthesize startColor = _startColor, startColorVar = _startColorVar; +@synthesize endColor = _endColor, endColorVar = _endColorVar; +@synthesize startSpin = _startSpin, startSpinVar = _startSpinVar; +@synthesize endSpin = _endSpin, endSpinVar = _endSpinVar; +@synthesize emissionRate = _emissionRate; +@synthesize startSize = _startSize, startSizeVar = _startSizeVar; +@synthesize endSize = _endSize, endSizeVar = _endSizeVar; +@synthesize opacityModifyRGB = _opacityModifyRGB; +@synthesize blendFunc = _blendFunc; +@synthesize particlePositionType = _particlePositionType; +@synthesize autoRemoveOnFinish = _autoRemoveOnFinish; +@synthesize emitterMode = _emitterMode; +@synthesize atlasIndex = _atlasIndex; +@synthesize totalParticles = _totalParticles; +(id) particleWithFile:(NSString*) plistFile { - return [[[self alloc] initWithFile:plistFile] autorelease]; + return [[self alloc] initWithFile:plistFile]; +} + ++(id) particleWithTotalParticles:(NSUInteger) numberOfParticles +{ + return [[self alloc] initWithTotalParticles:numberOfParticles]; } -(id) init { @@ -94,14 +102,21 @@ -(id) init { -(id) initWithFile:(NSString *)plistFile { - NSString *path = [[CCFileUtils sharedFileUtils] fullPathFromRelativePath:plistFile]; + NSString *path = [[CCFileUtils sharedFileUtils] fullPathForFilename:plistFile]; NSDictionary *dict = [NSDictionary dictionaryWithContentsOfFile:path]; NSAssert( dict != nil, @"Particles: file not found"); - return [self initWithDictionary:dict]; + + return [self initWithDictionary:dict path:[plistFile stringByDeletingLastPathComponent]]; } + -(id) initWithDictionary:(NSDictionary *)dictionary +{ + return [self initWithDictionary:dictionary path:@""]; +} + +-(id) initWithDictionary:(NSDictionary *)dictionary path:(NSString*)dirname { NSUInteger maxParticles = [[dictionary valueForKey:@"maxParticles"] integerValue]; // self, not super @@ -109,15 +124,15 @@ -(id) initWithDictionary:(NSDictionary *)dictionary if ((self=[self initWithTotalParticles:maxParticles] ) ) { // angle - angle = [[dictionary valueForKey:@"angle"] floatValue]; - angleVar = [[dictionary valueForKey:@"angleVariance"] floatValue]; + _angle = [[dictionary valueForKey:@"angle"] floatValue]; + _angleVar = [[dictionary valueForKey:@"angleVariance"] floatValue]; // duration - duration = [[dictionary valueForKey:@"duration"] floatValue]; + _duration = [[dictionary valueForKey:@"duration"] floatValue]; // blend function - blendFunc_.src = [[dictionary valueForKey:@"blendFuncSource"] intValue]; - blendFunc_.dst = [[dictionary valueForKey:@"blendFuncDestination"] intValue]; + _blendFunc.src = [[dictionary valueForKey:@"blendFuncSource"] intValue]; + _blendFunc.dst = [[dictionary valueForKey:@"blendFuncDestination"] intValue]; // color float r,g,b,a; @@ -126,107 +141,112 @@ -(id) initWithDictionary:(NSDictionary *)dictionary g = [[dictionary valueForKey:@"startColorGreen"] floatValue]; b = [[dictionary valueForKey:@"startColorBlue"] floatValue]; a = [[dictionary valueForKey:@"startColorAlpha"] floatValue]; - startColor = (ccColor4F) {r,g,b,a}; + _startColor = (ccColor4F) {r,g,b,a}; r = [[dictionary valueForKey:@"startColorVarianceRed"] floatValue]; g = [[dictionary valueForKey:@"startColorVarianceGreen"] floatValue]; b = [[dictionary valueForKey:@"startColorVarianceBlue"] floatValue]; a = [[dictionary valueForKey:@"startColorVarianceAlpha"] floatValue]; - startColorVar = (ccColor4F) {r,g,b,a}; + _startColorVar = (ccColor4F) {r,g,b,a}; r = [[dictionary valueForKey:@"finishColorRed"] floatValue]; g = [[dictionary valueForKey:@"finishColorGreen"] floatValue]; b = [[dictionary valueForKey:@"finishColorBlue"] floatValue]; a = [[dictionary valueForKey:@"finishColorAlpha"] floatValue]; - endColor = (ccColor4F) {r,g,b,a}; + _endColor = (ccColor4F) {r,g,b,a}; r = [[dictionary valueForKey:@"finishColorVarianceRed"] floatValue]; g = [[dictionary valueForKey:@"finishColorVarianceGreen"] floatValue]; b = [[dictionary valueForKey:@"finishColorVarianceBlue"] floatValue]; a = [[dictionary valueForKey:@"finishColorVarianceAlpha"] floatValue]; - endColorVar = (ccColor4F) {r,g,b,a}; + _endColorVar = (ccColor4F) {r,g,b,a}; // particle size - startSize = [[dictionary valueForKey:@"startParticleSize"] floatValue]; - startSizeVar = [[dictionary valueForKey:@"startParticleSizeVariance"] floatValue]; - endSize = [[dictionary valueForKey:@"finishParticleSize"] floatValue]; - endSizeVar = [[dictionary valueForKey:@"finishParticleSizeVariance"] floatValue]; + _startSize = [[dictionary valueForKey:@"startParticleSize"] floatValue]; + _startSizeVar = [[dictionary valueForKey:@"startParticleSizeVariance"] floatValue]; + _endSize = [[dictionary valueForKey:@"finishParticleSize"] floatValue]; + _endSizeVar = [[dictionary valueForKey:@"finishParticleSizeVariance"] floatValue]; // position float x = [[dictionary valueForKey:@"sourcePositionx"] floatValue]; float y = [[dictionary valueForKey:@"sourcePositiony"] floatValue]; self.position = ccp(x,y); - posVar.x = [[dictionary valueForKey:@"sourcePositionVariancex"] floatValue]; - posVar.y = [[dictionary valueForKey:@"sourcePositionVariancey"] floatValue]; + _posVar.x = [[dictionary valueForKey:@"sourcePositionVariancex"] floatValue]; + _posVar.y = [[dictionary valueForKey:@"sourcePositionVariancey"] floatValue]; // Spinning - startSpin = [[dictionary valueForKey:@"rotationStart"] floatValue]; - startSpinVar = [[dictionary valueForKey:@"rotationStartVariance"] floatValue]; - endSpin = [[dictionary valueForKey:@"rotationEnd"] floatValue]; - endSpinVar = [[dictionary valueForKey:@"rotationEndVariance"] floatValue]; + _startSpin = [[dictionary valueForKey:@"rotationStart"] floatValue]; + _startSpinVar = [[dictionary valueForKey:@"rotationStartVariance"] floatValue]; + _endSpin = [[dictionary valueForKey:@"rotationEnd"] floatValue]; + _endSpinVar = [[dictionary valueForKey:@"rotationEndVariance"] floatValue]; - emitterMode_ = [[dictionary valueForKey:@"emitterType"] intValue]; + _emitterMode = [[dictionary valueForKey:@"emitterType"] intValue]; // Mode A: Gravity + tangential accel + radial accel - if( emitterMode_ == kCCParticleModeGravity ) { + if( _emitterMode == kCCParticleModeGravity ) { // gravity - mode.A.gravity.x = [[dictionary valueForKey:@"gravityx"] floatValue]; - mode.A.gravity.y = [[dictionary valueForKey:@"gravityy"] floatValue]; + _mode.A.gravity.x = [[dictionary valueForKey:@"gravityx"] floatValue]; + _mode.A.gravity.y = [[dictionary valueForKey:@"gravityy"] floatValue]; // // speed - mode.A.speed = [[dictionary valueForKey:@"speed"] floatValue]; - mode.A.speedVar = [[dictionary valueForKey:@"speedVariance"] floatValue]; + _mode.A.speed = [[dictionary valueForKey:@"speed"] floatValue]; + _mode.A.speedVar = [[dictionary valueForKey:@"speedVariance"] floatValue]; // radial acceleration NSString *tmp = [dictionary valueForKey:@"radialAcceleration"]; - mode.A.radialAccel = tmp ? [tmp floatValue] : 0; + _mode.A.radialAccel = tmp ? [tmp floatValue] : 0; tmp = [dictionary valueForKey:@"radialAccelVariance"]; - mode.A.radialAccelVar = tmp ? [tmp floatValue] : 0; + _mode.A.radialAccelVar = tmp ? [tmp floatValue] : 0; // tangential acceleration tmp = [dictionary valueForKey:@"tangentialAcceleration"]; - mode.A.tangentialAccel = tmp ? [tmp floatValue] : 0; + _mode.A.tangentialAccel = tmp ? [tmp floatValue] : 0; tmp = [dictionary valueForKey:@"tangentialAccelVariance"]; - mode.A.tangentialAccelVar = tmp ? [tmp floatValue] : 0; + _mode.A.tangentialAccelVar = tmp ? [tmp floatValue] : 0; } // or Mode B: radius movement - else if( emitterMode_ == kCCParticleModeRadius ) { + else if( _emitterMode == kCCParticleModeRadius ) { float maxRadius = [[dictionary valueForKey:@"maxRadius"] floatValue]; float maxRadiusVar = [[dictionary valueForKey:@"maxRadiusVariance"] floatValue]; float minRadius = [[dictionary valueForKey:@"minRadius"] floatValue]; - mode.B.startRadius = maxRadius; - mode.B.startRadiusVar = maxRadiusVar; - mode.B.endRadius = minRadius; - mode.B.endRadiusVar = 0; - mode.B.rotatePerSecond = [[dictionary valueForKey:@"rotatePerSecond"] floatValue]; - mode.B.rotatePerSecondVar = [[dictionary valueForKey:@"rotatePerSecondVariance"] floatValue]; + _mode.B.startRadius = maxRadius; + _mode.B.startRadiusVar = maxRadiusVar; + _mode.B.endRadius = minRadius; + _mode.B.endRadiusVar = 0; + _mode.B.rotatePerSecond = [[dictionary valueForKey:@"rotatePerSecond"] floatValue]; + _mode.B.rotatePerSecondVar = [[dictionary valueForKey:@"rotatePerSecondVariance"] floatValue]; } else { NSAssert( NO, @"Invalid emitterType in config file"); } // life span - life = [[dictionary valueForKey:@"particleLifespan"] floatValue]; - lifeVar = [[dictionary valueForKey:@"particleLifespanVariance"] floatValue]; + _life = [[dictionary valueForKey:@"particleLifespan"] floatValue]; + _lifeVar = [[dictionary valueForKey:@"particleLifespanVariance"] floatValue]; // emission Rate - emissionRate = totalParticles/life; + _emissionRate = _totalParticles/_life; //don't get the internal texture if a batchNode is used - if (!batchNode_) + if (!_batchNode) { // Set a compatible default for the alpha transfer - opacityModifyRGB_ = NO; + _opacityModifyRGB = NO; // texture // Try to get the texture from the cache NSString *textureName = [dictionary valueForKey:@"textureFileName"]; + NSString *textureDir = [textureName stringByDeletingLastPathComponent]; + + // For backward compatibility, only append the dirname if both dirnames are the same + if( ! [textureDir isEqualToString:dirname] ) + textureName = [dirname stringByAppendingPathComponent:textureName]; CCTexture2D *tex = [[CCTextureCache sharedTextureCache] addImage:textureName]; @@ -258,8 +278,6 @@ -(id) initWithDictionary:(NSDictionary *)dictionary free(deflated); deflated = NULL; [self setTexture: [ [CCTextureCache sharedTextureCache] addCGImage:[image CGImage] forKey:textureName]]; - [data release]; - [image release]; } NSAssert( [self texture] != NULL, @"CCParticleSystem: error loading the texture"); @@ -273,47 +291,46 @@ -(id) initWithTotalParticles:(NSUInteger) numberOfParticles { if( (self=[super init]) ) { - totalParticles = numberOfParticles; + _totalParticles = numberOfParticles; - particles = calloc( totalParticles, sizeof(tCCParticle) ); + _particles = calloc( _totalParticles, sizeof(tCCParticle) ); - if( ! particles ) { + if( ! _particles ) { CCLOG(@"Particle system: not enough memory"); - [self release]; return nil; } - allocatedParticles = numberOfParticles; + _allocatedParticles = numberOfParticles; - if (batchNode_) + if (_batchNode) { - for (int i = 0; i < totalParticles; i++) + for (NSUInteger i = 0; i < _totalParticles; i++) { - particles[i].atlasIndex=i; + _particles[i].atlasIndex=i; } } // default, active - active = YES; + _active = YES; // default blend function - blendFunc_ = (ccBlendFunc) { CC_BLEND_SRC, CC_BLEND_DST }; + _blendFunc = (ccBlendFunc) { CC_BLEND_SRC, CC_BLEND_DST }; // default movement type; - positionType_ = kCCPositionTypeFree; + _particlePositionType = kCCParticlePositionTypeFree; // by default be in mode A: - emitterMode_ = kCCParticleModeGravity; + _emitterMode = kCCParticleModeGravity; - autoRemoveOnFinish_ = NO; + _autoRemoveOnFinish = NO; - // Optimization: compile udpateParticle method - updateParticleSel = @selector(updateQuadWithParticle:newPosition:); - updateParticleImp = (CC_UPDATE_PARTICLE_IMP) [self methodForSelector:updateParticleSel]; + // Optimization: compile updateParticle method + _updateParticleSel = @selector(updateQuadWithParticle:newPosition:); + _updateParticleImp = (CC_UPDATE_PARTICLE_IMP) [self methodForSelector:_updateParticleSel]; //for batchNode - transformSystemDirty_ = NO; + _transformSystemDirty = NO; - // udpate after action in run! + // update after action in run! [self scheduleUpdateWithPriority:1]; } return self; @@ -321,39 +338,41 @@ -(id) initWithTotalParticles:(NSUInteger) numberOfParticles -(void) dealloc { - [self unscheduleUpdate]; + // Since the scheduler retains the "target (in this case the ParticleSystem) + // it is not needed to call "unscheduleUpdate" here. In fact, it will be called in "cleanup" +// [self unscheduleUpdate]; - free( particles ); + free( _particles ); - [texture_ release]; - [super dealloc]; } +#pragma clang diagnostic push COCOS2D +#pragma clang diagnostic ignored "-Wfloat-equal" -(void) initParticle: (tCCParticle*) particle { - //CGPoint currentPosition = position_; + //CGPoint currentPosition = _position; // timeToLive // no negative life. prevent division by 0 - particle->timeToLive = life + lifeVar * CCRANDOM_MINUS1_1(); + particle->timeToLive = _life + _lifeVar * CCRANDOM_MINUS1_1(); particle->timeToLive = MAX(0, particle->timeToLive); // position - particle->pos.x = sourcePosition.x + posVar.x * CCRANDOM_MINUS1_1(); - particle->pos.y = sourcePosition.y + posVar.y * CCRANDOM_MINUS1_1(); + particle->pos.x = _sourcePosition.x + _posVar.x * CCRANDOM_MINUS1_1(); + particle->pos.y = _sourcePosition.y + _posVar.y * CCRANDOM_MINUS1_1(); // Color ccColor4F start; - start.r = clampf( startColor.r + startColorVar.r * CCRANDOM_MINUS1_1(), 0, 1); - start.g = clampf( startColor.g + startColorVar.g * CCRANDOM_MINUS1_1(), 0, 1); - start.b = clampf( startColor.b + startColorVar.b * CCRANDOM_MINUS1_1(), 0, 1); - start.a = clampf( startColor.a + startColorVar.a * CCRANDOM_MINUS1_1(), 0, 1); + start.r = clampf( _startColor.r + _startColorVar.r * CCRANDOM_MINUS1_1(), 0, 1); + start.g = clampf( _startColor.g + _startColorVar.g * CCRANDOM_MINUS1_1(), 0, 1); + start.b = clampf( _startColor.b + _startColorVar.b * CCRANDOM_MINUS1_1(), 0, 1); + start.a = clampf( _startColor.a + _startColorVar.a * CCRANDOM_MINUS1_1(), 0, 1); ccColor4F end; - end.r = clampf( endColor.r + endColorVar.r * CCRANDOM_MINUS1_1(), 0, 1); - end.g = clampf( endColor.g + endColorVar.g * CCRANDOM_MINUS1_1(), 0, 1); - end.b = clampf( endColor.b + endColorVar.b * CCRANDOM_MINUS1_1(), 0, 1); - end.a = clampf( endColor.a + endColorVar.a * CCRANDOM_MINUS1_1(), 0, 1); + end.r = clampf( _endColor.r + _endColorVar.r * CCRANDOM_MINUS1_1(), 0, 1); + end.g = clampf( _endColor.g + _endColorVar.g * CCRANDOM_MINUS1_1(), 0, 1); + end.b = clampf( _endColor.b + _endColorVar.b * CCRANDOM_MINUS1_1(), 0, 1); + end.a = clampf( _endColor.a + _endColorVar.a * CCRANDOM_MINUS1_1(), 0, 1); particle->color = start; particle->deltaColor.r = (end.r - start.r) / particle->timeToLive; @@ -362,95 +381,96 @@ -(void) initParticle: (tCCParticle*) particle particle->deltaColor.a = (end.a - start.a) / particle->timeToLive; // size - float startS = startSize + startSizeVar * CCRANDOM_MINUS1_1(); + float startS = _startSize + _startSizeVar * CCRANDOM_MINUS1_1(); startS = MAX(0, startS); // No negative value particle->size = startS; - if( endSize == kCCParticleStartSizeEqualToEndSize ) + if( _endSize == kCCParticleStartSizeEqualToEndSize ) particle->deltaSize = 0; else { - float endS = endSize + endSizeVar * CCRANDOM_MINUS1_1(); + float endS = _endSize + _endSizeVar * CCRANDOM_MINUS1_1(); endS = MAX(0, endS); // No negative values particle->deltaSize = (endS - startS) / particle->timeToLive; } // rotation - float startA = startSpin + startSpinVar * CCRANDOM_MINUS1_1(); - float endA = endSpin + endSpinVar * CCRANDOM_MINUS1_1(); + float startA = _startSpin + _startSpinVar * CCRANDOM_MINUS1_1(); + float endA = _endSpin + _endSpinVar * CCRANDOM_MINUS1_1(); particle->rotation = startA; particle->deltaRotation = (endA - startA) / particle->timeToLive; // position - if( positionType_ == kCCPositionTypeFree ) + if( _particlePositionType == kCCParticlePositionTypeFree ) particle->startPos = [self convertToWorldSpace:CGPointZero]; - else if( positionType_ == kCCPositionTypeRelative ) - particle->startPos = position_; + else if( _particlePositionType == kCCParticlePositionTypeRelative ) + particle->startPos = _position; // direction - float a = CC_DEGREES_TO_RADIANS( angle + angleVar * CCRANDOM_MINUS1_1() ); + float a = CC_DEGREES_TO_RADIANS( _angle + _angleVar * CCRANDOM_MINUS1_1() ); // Mode Gravity: A - if( emitterMode_ == kCCParticleModeGravity ) { + if( _emitterMode == kCCParticleModeGravity ) { CGPoint v = {cosf( a ), sinf( a )}; - float s = mode.A.speed + mode.A.speedVar * CCRANDOM_MINUS1_1(); + float s = _mode.A.speed + _mode.A.speedVar * CCRANDOM_MINUS1_1(); // direction particle->mode.A.dir = ccpMult( v, s ); // radial accel - particle->mode.A.radialAccel = mode.A.radialAccel + mode.A.radialAccelVar * CCRANDOM_MINUS1_1(); + particle->mode.A.radialAccel = _mode.A.radialAccel + _mode.A.radialAccelVar * CCRANDOM_MINUS1_1(); // tangential accel - particle->mode.A.tangentialAccel = mode.A.tangentialAccel + mode.A.tangentialAccelVar * CCRANDOM_MINUS1_1(); + particle->mode.A.tangentialAccel = _mode.A.tangentialAccel + _mode.A.tangentialAccelVar * CCRANDOM_MINUS1_1(); } // Mode Radius: B else { // Set the default diameter of the particle from the source position - float startRadius = mode.B.startRadius + mode.B.startRadiusVar * CCRANDOM_MINUS1_1(); - float endRadius = mode.B.endRadius + mode.B.endRadiusVar * CCRANDOM_MINUS1_1(); + float startRadius = _mode.B.startRadius + _mode.B.startRadiusVar * CCRANDOM_MINUS1_1(); + float endRadius = _mode.B.endRadius + _mode.B.endRadiusVar * CCRANDOM_MINUS1_1(); particle->mode.B.radius = startRadius; - if( mode.B.endRadius == kCCParticleStartRadiusEqualToEndRadius ) + if( _mode.B.endRadius == kCCParticleStartRadiusEqualToEndRadius ) particle->mode.B.deltaRadius = 0; else particle->mode.B.deltaRadius = (endRadius - startRadius) / particle->timeToLive; particle->mode.B.angle = a; - particle->mode.B.degreesPerSecond = CC_DEGREES_TO_RADIANS(mode.B.rotatePerSecond + mode.B.rotatePerSecondVar * CCRANDOM_MINUS1_1()); + particle->mode.B.degreesPerSecond = CC_DEGREES_TO_RADIANS(_mode.B.rotatePerSecond + _mode.B.rotatePerSecondVar * CCRANDOM_MINUS1_1()); } } +#pragma clang diagnostic pop COCOS2D -(BOOL) addParticle { if( [self isFull] ) return NO; - tCCParticle * particle = &particles[ particleCount ]; + tCCParticle * particle = &_particles[ _particleCount ]; [self initParticle: particle]; - particleCount++; + _particleCount++; return YES; } -(void) stopSystem { - active = NO; - elapsed = duration; - emitCounter = 0; + _active = NO; + _elapsed = _duration; + _emitCounter = 0; } -(void) resetSystem { - active = YES; - elapsed = 0; - for(particleIdx = 0; particleIdx < particleCount; ++particleIdx) { - tCCParticle *p = &particles[particleIdx]; + _active = YES; + _elapsed = 0; + for(_particleIdx = 0; _particleIdx < _particleCount; ++_particleIdx) { + tCCParticle *p = &_particles[_particleIdx]; p->timeToLive = 0; } @@ -458,46 +478,48 @@ -(void) resetSystem -(BOOL) isFull { - return (particleCount == totalParticles); + return (_particleCount == _totalParticles); } #pragma mark ParticleSystem - MainLoop +#pragma clang diagnostic push COCOS2D +#pragma clang diagnostic ignored "-Wfloat-equal" -(void) update: (ccTime) dt { CC_PROFILER_START_CATEGORY(kCCProfilerCategoryParticles , @"CCParticleSystem - update"); - if( active && emissionRate ) { - float rate = 1.0f / emissionRate; + if( _active && _emissionRate ) { + float rate = 1.0f / _emissionRate; //issue #1201, prevent bursts of particles, due to too high emitCounter - if (particleCount < totalParticles) - emitCounter += dt; + if (_particleCount < _totalParticles) + _emitCounter += dt; - while( particleCount < totalParticles && emitCounter > rate ) { + while( _particleCount < _totalParticles && _emitCounter > rate ) { [self addParticle]; - emitCounter -= rate; + _emitCounter -= rate; } - elapsed += dt; + _elapsed += dt; - if(duration != -1 && duration < elapsed) + if(_duration != -1 && _duration < _elapsed) [self stopSystem]; } - particleIdx = 0; + _particleIdx = 0; CGPoint currentPosition = CGPointZero; - if( positionType_ == kCCPositionTypeFree ) + if( _particlePositionType == kCCParticlePositionTypeFree ) currentPosition = [self convertToWorldSpace:CGPointZero]; - else if( positionType_ == kCCPositionTypeRelative ) - currentPosition = position_; + else if( _particlePositionType == kCCParticlePositionTypeRelative ) + currentPosition = _position; - if (visible_) + if (_visible) { - while( particleIdx < particleCount ) + while( _particleIdx < _particleCount ) { - tCCParticle *p = &particles[particleIdx]; + tCCParticle *p = &_particles[_particleIdx]; // life p->timeToLive -= dt; @@ -505,7 +527,7 @@ -(void) update: (ccTime) dt if( p->timeToLive > 0 ) { // Mode A: gravity, direction, tangential accel & radial accel - if( emitterMode_ == kCCParticleModeGravity ) { + if( _emitterMode == kCCParticleModeGravity ) { CGPoint tmp, radial, tangential; radial = CGPointZero; @@ -523,7 +545,7 @@ -(void) update: (ccTime) dt tangential = ccpMult(tangential, p->mode.A.tangentialAccel); // (gravity + radial + tangential) * dt - tmp = ccpAdd( ccpAdd( radial, tangential), mode.A.gravity); + tmp = ccpAdd( ccpAdd( radial, tangential), _mode.A.gravity); tmp = ccpMult( tmp, dt); p->mode.A.dir = ccpAdd( p->mode.A.dir, tmp); tmp = ccpMult(p->mode.A.dir, dt); @@ -559,7 +581,7 @@ -(void) update: (ccTime) dt CGPoint newPos; - if( positionType_ == kCCPositionTypeFree || positionType_ == kCCPositionTypeRelative ) + if( _particlePositionType == kCCParticlePositionTypeFree || _particlePositionType == kCCParticlePositionTypeRelative ) { CGPoint diff = ccpSub( currentPosition, p->startPos ); newPos = ccpSub(p->pos, diff); @@ -568,57 +590,58 @@ -(void) update: (ccTime) dt // translate newPos to correct position, since matrix transform isn't performed in batchnode // don't update the particle with the new position information, it will interfere with the radius and tangential calculations - if (batchNode_) + if (_batchNode) { - newPos.x+=position_.x; - newPos.y+=position_.y; + newPos.x+=_position.x; + newPos.y+=_position.y; } - updateParticleImp(self, updateParticleSel, p, newPos); + _updateParticleImp(self, _updateParticleSel, p, newPos); // update particle counter - particleIdx++; + _particleIdx++; } else { // life < 0 NSInteger currentIndex = p->atlasIndex; - if( particleIdx != particleCount-1 ) - particles[particleIdx] = particles[particleCount-1]; + if( _particleIdx != _particleCount-1 ) + _particles[_particleIdx] = _particles[_particleCount-1]; - if (batchNode_) + if (_batchNode) { //disable the switched particle - [batchNode_ disableParticle:(atlasIndex_+currentIndex)]; + [_batchNode disableParticle:(_atlasIndex+currentIndex)]; //switch indexes - particles[particleCount-1].atlasIndex = currentIndex; + _particles[_particleCount-1].atlasIndex = currentIndex; } - particleCount--; + _particleCount--; - if( particleCount == 0 && autoRemoveOnFinish_ ) { + if( _particleCount == 0 && _autoRemoveOnFinish ) { [self unscheduleUpdate]; - [parent_ removeChild:self cleanup:YES]; + [_parent removeChild:self cleanup:YES]; return; } } }//while - transformSystemDirty_ = NO; + _transformSystemDirty = NO; } - if (!batchNode_) + if (!_batchNode) [self postStep]; CC_PROFILER_STOP_CATEGORY(kCCProfilerCategoryParticles , @"CCParticleSystem - update"); } +#pragma clang diagnostic pop COCOS2D -(void) updateWithNoTime { [self update:0.0f]; } --(void) updateQuadWithParticle:(tCCParticle*)particle newPosition:(CGPoint)pos; +-(void) updateQuadWithParticle:(tCCParticle*)particle newPosition:(CGPoint)pos { // should be overriden } @@ -632,9 +655,8 @@ -(void) postStep -(void) setTexture:(CCTexture2D*) texture { - if( texture_ != texture ) { - [texture_ release]; - texture_ = [texture retain]; + if( _texture != texture ) { + _texture = texture; [self updateBlendFunc]; } @@ -642,37 +664,37 @@ -(void) setTexture:(CCTexture2D*) texture -(CCTexture2D*) texture { - return texture_; + return _texture; } #pragma mark ParticleSystem - Additive Blending -(void) setBlendAdditive:(BOOL)additive { if( additive ) { - blendFunc_.src = GL_SRC_ALPHA; - blendFunc_.dst = GL_ONE; + _blendFunc.src = GL_SRC_ALPHA; + _blendFunc.dst = GL_ONE; } else { - if( texture_ && ! [texture_ hasPremultipliedAlpha] ) { - blendFunc_.src = GL_SRC_ALPHA; - blendFunc_.dst = GL_ONE_MINUS_SRC_ALPHA; + if( _texture && ! [_texture hasPremultipliedAlpha] ) { + _blendFunc.src = GL_SRC_ALPHA; + _blendFunc.dst = GL_ONE_MINUS_SRC_ALPHA; } else { - blendFunc_.src = CC_BLEND_SRC; - blendFunc_.dst = CC_BLEND_DST; + _blendFunc.src = CC_BLEND_SRC; + _blendFunc.dst = CC_BLEND_DST; } } } -(BOOL) blendAdditive { - return( blendFunc_.src == GL_SRC_ALPHA && blendFunc_.dst == GL_ONE); + return( _blendFunc.src == GL_SRC_ALPHA && _blendFunc.dst == GL_ONE); } -(void) setBlendFunc:(ccBlendFunc)blendFunc { - if( blendFunc_.src != blendFunc.src || blendFunc_.dst != blendFunc.dst ) { - blendFunc_ = blendFunc; + if( _blendFunc.src != blendFunc.src || _blendFunc.dst != blendFunc.dst ) { + _blendFunc = blendFunc; [self updateBlendFunc]; } } @@ -680,179 +702,179 @@ -(void) setBlendFunc:(ccBlendFunc)blendFunc - (void) setTotalParticles:(NSUInteger)tp { - NSAssert( tp <= allocatedParticles, @"Particle: resizing particle array only supported for quads"); - totalParticles = tp; + NSAssert( tp <= _allocatedParticles, @"Particle: resizing particle array only supported for quads"); + _totalParticles = tp; } -- (NSUInteger) totalParticles +- (NSUInteger) _totalParticles { - return totalParticles; + return _totalParticles; } #pragma mark ParticleSystem - Properties of Gravity Mode -(void) setTangentialAccel:(float)t { - NSAssert( emitterMode_ == kCCParticleModeGravity, @"Particle Mode should be Gravity"); - mode.A.tangentialAccel = t; + NSAssert( _emitterMode == kCCParticleModeGravity, @"Particle Mode should be Gravity"); + _mode.A.tangentialAccel = t; } -(float) tangentialAccel { - NSAssert( emitterMode_ == kCCParticleModeGravity, @"Particle Mode should be Gravity"); - return mode.A.tangentialAccel; + NSAssert( _emitterMode == kCCParticleModeGravity, @"Particle Mode should be Gravity"); + return _mode.A.tangentialAccel; } -(void) setTangentialAccelVar:(float)t { - NSAssert( emitterMode_ == kCCParticleModeGravity, @"Particle Mode should be Gravity"); - mode.A.tangentialAccelVar = t; + NSAssert( _emitterMode == kCCParticleModeGravity, @"Particle Mode should be Gravity"); + _mode.A.tangentialAccelVar = t; } -(float) tangentialAccelVar { - NSAssert( emitterMode_ == kCCParticleModeGravity, @"Particle Mode should be Gravity"); - return mode.A.tangentialAccelVar; + NSAssert( _emitterMode == kCCParticleModeGravity, @"Particle Mode should be Gravity"); + return _mode.A.tangentialAccelVar; } -(void) setRadialAccel:(float)t { - NSAssert( emitterMode_ == kCCParticleModeGravity, @"Particle Mode should be Gravity"); - mode.A.radialAccel = t; + NSAssert( _emitterMode == kCCParticleModeGravity, @"Particle Mode should be Gravity"); + _mode.A.radialAccel = t; } -(float) radialAccel { - NSAssert( emitterMode_ == kCCParticleModeGravity, @"Particle Mode should be Gravity"); - return mode.A.radialAccel; + NSAssert( _emitterMode == kCCParticleModeGravity, @"Particle Mode should be Gravity"); + return _mode.A.radialAccel; } -(void) setRadialAccelVar:(float)t { - NSAssert( emitterMode_ == kCCParticleModeGravity, @"Particle Mode should be Gravity"); - mode.A.radialAccelVar = t; + NSAssert( _emitterMode == kCCParticleModeGravity, @"Particle Mode should be Gravity"); + _mode.A.radialAccelVar = t; } -(float) radialAccelVar { - NSAssert( emitterMode_ == kCCParticleModeGravity, @"Particle Mode should be Gravity"); - return mode.A.radialAccelVar; + NSAssert( _emitterMode == kCCParticleModeGravity, @"Particle Mode should be Gravity"); + return _mode.A.radialAccelVar; } -(void) setGravity:(CGPoint)g { - NSAssert( emitterMode_ == kCCParticleModeGravity, @"Particle Mode should be Gravity"); - mode.A.gravity = g; + NSAssert( _emitterMode == kCCParticleModeGravity, @"Particle Mode should be Gravity"); + _mode.A.gravity = g; } -(CGPoint) gravity { - NSAssert( emitterMode_ == kCCParticleModeGravity, @"Particle Mode should be Gravity"); - return mode.A.gravity; + NSAssert( _emitterMode == kCCParticleModeGravity, @"Particle Mode should be Gravity"); + return _mode.A.gravity; } -(void) setSpeed:(float)speed { - NSAssert( emitterMode_ == kCCParticleModeGravity, @"Particle Mode should be Gravity"); - mode.A.speed = speed; + NSAssert( _emitterMode == kCCParticleModeGravity, @"Particle Mode should be Gravity"); + _mode.A.speed = speed; } -(float) speed { - NSAssert( emitterMode_ == kCCParticleModeGravity, @"Particle Mode should be Gravity"); - return mode.A.speed; + NSAssert( _emitterMode == kCCParticleModeGravity, @"Particle Mode should be Gravity"); + return _mode.A.speed; } -(void) setSpeedVar:(float)speedVar { - NSAssert( emitterMode_ == kCCParticleModeGravity, @"Particle Mode should be Gravity"); - mode.A.speedVar = speedVar; + NSAssert( _emitterMode == kCCParticleModeGravity, @"Particle Mode should be Gravity"); + _mode.A.speedVar = speedVar; } -(float) speedVar { - NSAssert( emitterMode_ == kCCParticleModeGravity, @"Particle Mode should be Gravity"); - return mode.A.speedVar; + NSAssert( _emitterMode == kCCParticleModeGravity, @"Particle Mode should be Gravity"); + return _mode.A.speedVar; } #pragma mark ParticleSystem - Properties of Radius Mode -(void) setStartRadius:(float)startRadius { - NSAssert( emitterMode_ == kCCParticleModeRadius, @"Particle Mode should be Radius"); - mode.B.startRadius = startRadius; + NSAssert( _emitterMode == kCCParticleModeRadius, @"Particle Mode should be Radius"); + _mode.B.startRadius = startRadius; } -(float) startRadius { - NSAssert( emitterMode_ == kCCParticleModeRadius, @"Particle Mode should be Radius"); - return mode.B.startRadius; + NSAssert( _emitterMode == kCCParticleModeRadius, @"Particle Mode should be Radius"); + return _mode.B.startRadius; } -(void) setStartRadiusVar:(float)startRadiusVar { - NSAssert( emitterMode_ == kCCParticleModeRadius, @"Particle Mode should be Radius"); - mode.B.startRadiusVar = startRadiusVar; + NSAssert( _emitterMode == kCCParticleModeRadius, @"Particle Mode should be Radius"); + _mode.B.startRadiusVar = startRadiusVar; } -(float) startRadiusVar { - NSAssert( emitterMode_ == kCCParticleModeRadius, @"Particle Mode should be Radius"); - return mode.B.startRadiusVar; + NSAssert( _emitterMode == kCCParticleModeRadius, @"Particle Mode should be Radius"); + return _mode.B.startRadiusVar; } -(void) setEndRadius:(float)endRadius { - NSAssert( emitterMode_ == kCCParticleModeRadius, @"Particle Mode should be Radius"); - mode.B.endRadius = endRadius; + NSAssert( _emitterMode == kCCParticleModeRadius, @"Particle Mode should be Radius"); + _mode.B.endRadius = endRadius; } -(float) endRadius { - NSAssert( emitterMode_ == kCCParticleModeRadius, @"Particle Mode should be Radius"); - return mode.B.endRadius; + NSAssert( _emitterMode == kCCParticleModeRadius, @"Particle Mode should be Radius"); + return _mode.B.endRadius; } -(void) setEndRadiusVar:(float)endRadiusVar { - NSAssert( emitterMode_ == kCCParticleModeRadius, @"Particle Mode should be Radius"); - mode.B.endRadiusVar = endRadiusVar; + NSAssert( _emitterMode == kCCParticleModeRadius, @"Particle Mode should be Radius"); + _mode.B.endRadiusVar = endRadiusVar; } -(float) endRadiusVar { - NSAssert( emitterMode_ == kCCParticleModeRadius, @"Particle Mode should be Radius"); - return mode.B.endRadiusVar; + NSAssert( _emitterMode == kCCParticleModeRadius, @"Particle Mode should be Radius"); + return _mode.B.endRadiusVar; } -(void) setRotatePerSecond:(float)degrees { - NSAssert( emitterMode_ == kCCParticleModeRadius, @"Particle Mode should be Radius"); - mode.B.rotatePerSecond = degrees; + NSAssert( _emitterMode == kCCParticleModeRadius, @"Particle Mode should be Radius"); + _mode.B.rotatePerSecond = degrees; } -(float) rotatePerSecond { - NSAssert( emitterMode_ == kCCParticleModeRadius, @"Particle Mode should be Radius"); - return mode.B.rotatePerSecond; + NSAssert( _emitterMode == kCCParticleModeRadius, @"Particle Mode should be Radius"); + return _mode.B.rotatePerSecond; } -(void) setRotatePerSecondVar:(float)degrees { - NSAssert( emitterMode_ == kCCParticleModeRadius, @"Particle Mode should be Radius"); - mode.B.rotatePerSecondVar = degrees; + NSAssert( _emitterMode == kCCParticleModeRadius, @"Particle Mode should be Radius"); + _mode.B.rotatePerSecondVar = degrees; } -(float) rotatePerSecondVar { - NSAssert( emitterMode_ == kCCParticleModeRadius, @"Particle Mode should be Radius"); - return mode.B.rotatePerSecondVar; + NSAssert( _emitterMode == kCCParticleModeRadius, @"Particle Mode should be Radius"); + return _mode.B.rotatePerSecondVar; } #pragma mark ParticleSystem - methods for batchNode rendering -(CCParticleBatchNode*) batchNode { - return batchNode_; + return _batchNode; } -(void) setBatchNode:(CCParticleBatchNode*) batchNode { - if( batchNode_ != batchNode ) { + if( _batchNode != batchNode ) { - batchNode_ = batchNode; // weak reference + _batchNode = batchNode; // weak reference if( batchNode ) { //each particle needs a unique index - for (int i = 0; i < totalParticles; i++) + for (NSUInteger i = 0; i < _totalParticles; i++) { - particles[i].atlasIndex=i; + _particles[i].atlasIndex=i; } } } @@ -861,25 +883,25 @@ -(void) setBatchNode:(CCParticleBatchNode*) batchNode //don't use a transform matrix, this is faster -(void) setScale:(float) s { - transformSystemDirty_ = YES; + _transformSystemDirty = YES; [super setScale:s]; } -(void) setRotation: (float)newRotation { - transformSystemDirty_ = YES; + _transformSystemDirty = YES; [super setRotation:newRotation]; } -(void) setScaleX: (float)newScaleX { - transformSystemDirty_ = YES; + _transformSystemDirty = YES; [super setScaleX:newScaleX]; } -(void) setScaleY: (float)newScaleY { - transformSystemDirty_ = YES; + _transformSystemDirty = YES; [super setScaleY:newScaleY]; } @@ -887,18 +909,18 @@ -(void) setScaleY: (float)newScaleY -(void) updateBlendFunc { - NSAssert(! batchNode_, @"Can't change blending functions when the particle is being batched"); + NSAssert(! _batchNode, @"Can't change blending functions when the particle is being batched"); - BOOL premultiplied = [texture_ hasPremultipliedAlpha]; + BOOL premultiplied = [_texture hasPremultipliedAlpha]; - opacityModifyRGB_ = NO; + _opacityModifyRGB = NO; - if( texture_ && ( blendFunc_.src == CC_BLEND_SRC && blendFunc_.dst == CC_BLEND_DST ) ) { + if( _texture && ( _blendFunc.src == CC_BLEND_SRC && _blendFunc.dst == CC_BLEND_DST ) ) { if( premultiplied ) - opacityModifyRGB_ = YES; + _opacityModifyRGB = YES; else { - blendFunc_.src = GL_SRC_ALPHA; - blendFunc_.dst = GL_ONE_MINUS_SRC_ALPHA; + _blendFunc.src = GL_SRC_ALPHA; + _blendFunc.dst = GL_ONE_MINUS_SRC_ALPHA; } } } diff --git a/cocos2d/CCParticleSystemQuad.h b/cocos2d/CCParticleSystemQuad.h new file mode 100644 index 0000000..4e264db --- /dev/null +++ b/cocos2d/CCParticleSystemQuad.h @@ -0,0 +1,73 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2009 Leonardo Kasperavičius + * + * Copyright (c) 2008-2010 Ricardo Quesada + * Copyright (c) 2011 Zynga Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + */ + + +#import "CCParticleSystem.h" +#import "ccConfig.h" + +@class CCSpriteFrame; + +/** CCParticleSystemQuad is a subclass of CCParticleSystem + + It includes all the features of ParticleSystem. + + Special features and Limitations: + - Particle size can be any float number. + - The system can be scaled + - The particles can be rotated + - It supports subrects + - It supports batched rendering since 1.1 + @since v0.8 + */ +@interface CCParticleSystemQuad : CCParticleSystem +{ + ccV3F_C4B_T2F_Quad *_quads; // quads to be rendered + GLushort *_indices; // indices + GLuint _VAOname; + GLuint _buffersVBO[2]; //0: vertex 1: indices +} + +/** initialices the indices for the vertices */ +-(void) initIndices; + +/** initilizes the texture with a rectangle measured Points */ +-(void) initTexCoordsWithRect:(CGRect)rect; + +/** Sets a new CCSpriteFrame as particle. + WARNING: this method is experimental. Use setTexture:withRect instead. + @since v0.99.4 + */ +-(void)setSpriteFrame:(CCSpriteFrame*)spriteFrame; + +/** Sets a new texture with a rect. The rect is in Points. + @since v0.99.4 + */ +-(void) setTexture:(CCTexture2D *)texture withRect:(CGRect)rect; + +@end + diff --git a/src/cocos2d/CCParticleSystemQuad.m b/cocos2d/CCParticleSystemQuad.m similarity index 66% rename from src/cocos2d/CCParticleSystemQuad.m rename to cocos2d/CCParticleSystemQuad.m index b87504a..dd8f2af 100644 --- a/src/cocos2d/CCParticleSystemQuad.m +++ b/cocos2d/CCParticleSystemQuad.m @@ -68,12 +68,11 @@ -(id) initWithTotalParticles:(NSUInteger) numberOfParticles // allocating data space if( ! [self allocMemory] ) { - [self release]; return nil; } // Don't initialize the texCoords yet since there are not textures -// [self initTexCoordsWithRect:CGRectMake(0, 0, [texture_ pixelsWide], [texture_ pixelsHigh])]; +// [self initTexCoordsWithRect:CGRectMake(0, 0, [_texture pixelsWide], [_texture pixelsHigh])]; [self initIndices]; [self initVAO]; @@ -86,18 +85,18 @@ -(id) initWithTotalParticles:(NSUInteger) numberOfParticles -(BOOL) allocMemory { - NSAssert( ( !quads_ && !indices_), @"Memory already alloced"); - NSAssert( !batchNode_, @"Memory should not be alloced when not using batchNode"); + NSAssert( ( !_quads && !_indices), @"Memory already alloced"); + NSAssert( !_batchNode, @"Memory should not be alloced when not using batchNode"); - quads_ = calloc( sizeof(quads_[0]) * totalParticles, 1 ); - indices_ = calloc( sizeof(indices_[0]) * totalParticles * 6, 1 ); + _quads = calloc( sizeof(_quads[0]) * _totalParticles, 1 ); + _indices = calloc( sizeof(_indices[0]) * _totalParticles * 6, 1 ); - if( !quads_ || !indices_) { + if( !_quads || !_indices) { CCLOG(@"cocos2d: Particle system: not enough memory"); - if( quads_ ) - free( quads_ ); - if(indices_) - free(indices_); + if( _quads ) + free( _quads ); + if(_indices) + free(_indices); return NO; } @@ -109,60 +108,68 @@ - (void) setTotalParticles:(NSUInteger)tp { // If we are setting the total numer of particles to a number higher // than what is allocated, we need to allocate new arrays - if( tp > allocatedParticles ) + if( tp > _allocatedParticles ) { // Allocate new memory size_t particlesSize = tp * sizeof(tCCParticle); - size_t quadsSize = sizeof(quads_[0]) * tp * 1; - size_t indicesSize = sizeof(indices_[0]) * tp * 6 * 1; + size_t quadsSize = sizeof(_quads[0]) * tp * 1; + size_t indicesSize = sizeof(_indices[0]) * tp * 6 * 1; - tCCParticle* particlesNew = realloc(particles, particlesSize); - ccV3F_C4B_T2F_Quad *quadsNew = realloc(quads_, quadsSize); - GLushort* indicesNew = realloc(indices_, indicesSize); + tCCParticle* particlesNew = realloc(_particles, particlesSize); + ccV3F_C4B_T2F_Quad *quadsNew = realloc(_quads, quadsSize); + GLushort* indicesNew = realloc(_indices, indicesSize); if (particlesNew && quadsNew && indicesNew) { // Assign pointers - particles = particlesNew; - quads_ = quadsNew; - indices_ = indicesNew; + _particles = particlesNew; + _quads = quadsNew; + _indices = indicesNew; // Clear the memory - memset(particles, 0, particlesSize); - memset(quads_, 0, quadsSize); - memset(indices_, 0, indicesSize); + // XXX: Bug? If the quads are cleared, then drawing doesn't work... WHY??? XXX +// memset(_quads, 0, quadsSize); + memset(_particles, 0, particlesSize); + memset(_indices, 0, indicesSize); - allocatedParticles = tp; + _allocatedParticles = tp; } else { // Out of memory, failed to resize some array - if (particlesNew) particles = particlesNew; - if (quadsNew) quads_ = quadsNew; - if (indicesNew) indices_ = indicesNew; + if (particlesNew) _particles = particlesNew; + if (quadsNew) _quads = quadsNew; + if (indicesNew) _indices = indicesNew; CCLOG(@"Particle system: out of memory"); return; } - totalParticles = tp; + _totalParticles = tp; // Init particles - if (batchNode_) + if (_batchNode) { - for (int i = 0; i < totalParticles; i++) + for (NSUInteger i = 0; i < _totalParticles; i++) { - particles[i].atlasIndex=i; + _particles[i].atlasIndex=i; } } [self initIndices]; + + // clean VAO + glDeleteBuffers(2, &_buffersVBO[0]); + glDeleteVertexArrays(1, &_VAOname); + [self initVAO]; } else { - totalParticles = tp; + _totalParticles = tp; } + + [self resetSystem]; } -(void) initVAO @@ -171,15 +178,15 @@ -(void) initVAO // https://devforums.apple.com/thread/145566?tstart=0 void (^createVAO)(void) = ^ { - glGenVertexArrays(1, &VAOname_); - glBindVertexArray(VAOname_); + glGenVertexArrays(1, &self->_VAOname); + ccGLBindVAO(self->_VAOname); - #define kQuadSize sizeof(quads_[0].bl) + #define kQuadSize sizeof(self->_quads[0].bl) - glGenBuffers(2, &buffersVBO_[0]); + glGenBuffers(2, &self->_buffersVBO[0]); - glBindBuffer(GL_ARRAY_BUFFER, buffersVBO_[0]); - glBufferData(GL_ARRAY_BUFFER, sizeof(quads_[0]) * totalParticles, quads_, GL_DYNAMIC_DRAW); + glBindBuffer(GL_ARRAY_BUFFER, self->_buffersVBO[0]); + glBufferData(GL_ARRAY_BUFFER, sizeof(self->_quads[0]) * self->_totalParticles, self->_quads, GL_DYNAMIC_DRAW); // vertices glEnableVertexAttribArray(kCCVertexAttrib_Position); @@ -193,10 +200,11 @@ -(void) initVAO glEnableVertexAttribArray(kCCVertexAttrib_TexCoords); glVertexAttribPointer(kCCVertexAttrib_TexCoords, 2, GL_FLOAT, GL_FALSE, kQuadSize, (GLvoid*) offsetof( ccV3F_C4B_T2F, texCoords)); - glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, buffersVBO_[1]); - glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(indices_[0]) * totalParticles * 6, indices_, GL_STATIC_DRAW); + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, self->_buffersVBO[1]); + glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(self->_indices[0]) * self->_totalParticles * 6, self->_indices, GL_STATIC_DRAW); - glBindVertexArray(0); + // Must unbind the VAO before changing the element buffer. + ccGLBindVAO(0); glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); glBindBuffer(GL_ARRAY_BUFFER, 0); @@ -212,15 +220,14 @@ -(void) initVAO -(void) dealloc { - if( ! batchNode_ ) { - free(quads_); - free(indices_); + if( ! _batchNode ) { + free(_quads); + free(_indices); - glDeleteBuffers(2, &buffersVBO_[0]); - glDeleteVertexArrays(1, &VAOname_); + glDeleteBuffers(2, &_buffersVBO[0]); + glDeleteVertexArrays(1, &_VAOname); } - [super dealloc]; } // pointRect is in Points coordinates. @@ -234,8 +241,8 @@ -(void) initTexCoordsWithRect:(CGRect)pointRect pointRect.size.width * CC_CONTENT_SCALE_FACTOR(), pointRect.size.height * CC_CONTENT_SCALE_FACTOR() ); - GLfloat wide = [texture_ pixelsWide]; - GLfloat high = [texture_ pixelsHigh]; + GLfloat wide = [_texture pixelsWide]; + GLfloat high = [_texture pixelsHigh]; #if CC_FIX_ARTIFACTS_BY_STRECHING_TEXEL GLfloat left = (rect.origin.x*2+1) / (wide*2); @@ -254,17 +261,17 @@ -(void) initTexCoordsWithRect:(CGRect)pointRect ccV3F_C4B_T2F_Quad *quads; NSUInteger start, end; - if (batchNode_) + if (_batchNode) { - quads = [[batchNode_ textureAtlas] quads]; - start = atlasIndex_; - end = atlasIndex_ + totalParticles; + quads = [[_batchNode textureAtlas] quads]; + start = _atlasIndex; + end = _atlasIndex + _totalParticles; } else { - quads = quads_; + quads = _quads; start = 0; - end = totalParticles; + end = _totalParticles; } for(NSUInteger i=start; iatlasIndex]); + ccV3F_C4B_T2F_Quad *batchQuads = [[_batchNode textureAtlas] quads]; + quad = &(batchQuads[_atlasIndex+p->atlasIndex]); } else - quad = &(quads_[particleIdx]); + quad = &(_quads[_particleIdx]); - ccColor4B color = (opacityModifyRGB_) + ccColor4B color = (_opacityModifyRGB) ? (ccColor4B){ p->color.r*p->color.a*255, p->color.g*p->color.a*255, p->color.b*p->color.a*255, p->color.a*255} : (ccColor4B){ p->color.r*255, p->color.g*255, p->color.b*255, p->color.a*255}; @@ -404,8 +411,23 @@ -(void) updateQuadWithParticle:(tCCParticle*)p newPosition:(CGPoint)newPos -(void) postStep { - glBindBuffer(GL_ARRAY_BUFFER, buffersVBO_[0] ); - glBufferSubData(GL_ARRAY_BUFFER, 0, sizeof(quads_[0])*particleCount, quads_); + glBindBuffer(GL_ARRAY_BUFFER, _buffersVBO[0] ); + + // Option 1: Sub Data +#if defined (__CC_PLATFORM_MAC) + glBufferSubData(GL_ARRAY_BUFFER, 0, sizeof(_quads[0])*_particleCount, _quads); + + // Option 2: Data +// glBufferData(GL_ARRAY_BUFFER, sizeof(_quads[0]) * _particleCount, _quads, GL_STREAM_DRAW); + +#elif defined (__CC_PLATFORM_IOS) + // Option 3: Orphaning + glMapBuffer + glBufferData(GL_ARRAY_BUFFER, sizeof(_quads[0])*_totalParticles, nil, GL_STREAM_DRAW); + void *buf = glMapBuffer(GL_ARRAY_BUFFER, GL_WRITE_ONLY); + memcpy(buf, _quads, sizeof(_quads[0])*_particleCount); + glUnmapBuffer(GL_ARRAY_BUFFER); +#endif + glBindBuffer(GL_ARRAY_BUFFER, 0); CHECK_GL_ERROR_DEBUG(); @@ -414,21 +436,18 @@ -(void) postStep // overriding draw method -(void) draw { - NSAssert(!batchNode_,@"draw should not be called when added to a particleBatchNode"); + NSAssert(!_batchNode,@"draw should not be called when added to a particleBatchNode"); CC_NODE_DRAW_SETUP(); - ccGLBindTexture2D( [texture_ name] ); - ccGLBlendFunc( blendFunc_.src, blendFunc_.dst ); - - NSAssert( particleIdx == particleCount, @"Abnormal error in particle quad"); - - glBindVertexArray( VAOname_ ); + ccGLBindTexture2D( [_texture name] ); + ccGLBlendFunc( _blendFunc.src, _blendFunc.dst ); - glDrawElements(GL_TRIANGLES, (GLsizei) particleIdx*6, GL_UNSIGNED_SHORT, 0); - - glBindVertexArray( 0 ); + NSAssert( _particleIdx == _particleCount, @"Abnormal error in particle quad"); + ccGLBindVAO( _VAOname ); + glDrawElements(GL_TRIANGLES, (GLsizei) _particleIdx*6, GL_UNSIGNED_SHORT, 0); + CC_INCREMENT_GL_DRAWS(1); CHECK_GL_ERROR_DEBUG(); @@ -436,9 +455,9 @@ -(void) draw -(void) setBatchNode:(CCParticleBatchNode *)batchNode { - if( batchNode_ != batchNode ) { + if( _batchNode != batchNode ) { - CCParticleBatchNode *oldBatch = batchNode_; + CCParticleBatchNode *oldBatch = _batchNode; [super setBatchNode:batchNode]; @@ -454,20 +473,20 @@ -(void) setBatchNode:(CCParticleBatchNode *)batchNode else if( ! oldBatch ) { // copy current state to batch - ccV3F_C4B_T2F_Quad *batchQuads = [[batchNode_ textureAtlas] quads]; - ccV3F_C4B_T2F_Quad *quad = &(batchQuads[atlasIndex_] ); - memcpy( quad, quads_, totalParticles * sizeof(quads_[0]) ); + ccV3F_C4B_T2F_Quad *batchQuads = [[_batchNode textureAtlas] quads]; + ccV3F_C4B_T2F_Quad *quad = &(batchQuads[_atlasIndex] ); + memcpy( quad, _quads, _totalParticles * sizeof(_quads[0]) ); - if (quads_) - free(quads_); - quads_ = NULL; + if (_quads) + free(_quads); + _quads = NULL; - if (indices_) - free(indices_); - indices_ = NULL; + if (_indices) + free(_indices); + _indices = NULL; - glDeleteBuffers(2, &buffersVBO_[0]); - glDeleteVertexArrays(1, &VAOname_); + glDeleteBuffers(2, &_buffersVBO[0]); + glDeleteVertexArrays(1, &_VAOname); } } } diff --git a/cocos2d/CCPhysics+ObjectiveChipmunk.h b/cocos2d/CCPhysics+ObjectiveChipmunk.h new file mode 100644 index 0000000..78b2da7 --- /dev/null +++ b/cocos2d/CCPhysics+ObjectiveChipmunk.h @@ -0,0 +1,132 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2013 Scott Lembcke + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#import "CCPhysicsNode.h" +#import "CCPhysicsJoint.h" +#import "ObjectiveChipmunk/ObjectiveChipmunk.h" + + +// For comparison: +// https://developer.apple.com/library/ios/documentation/SpriteKit/Reference/SpriteKitFramework_Ref/_index.html#//apple_ref/doc/uid/TP40013041 + +/* + TODO: + * Sensors + * Collision only mode. (Are sensors good enough?) + * Projectile bodies? + * Fixed timesteps are a hack. + * Currently body must be set before adding to a parent node. + * Currently nodes must have rigid transforms. + * Currently a parent's absolute transform must be identity. + * Currently nodes with a physics body are always considered to have dirty transforms. + * Body constructors are still a little temporary. + * Objective-Chipmunk interop. + * affectedByGravity and allowsRotation properties not implemented. + * Joints. + * Queries. + * Need to rename the CCPhysicsBody.absolute* properties. (not really absolute anymore) + + Consider: + * Interpolation? + * Post-step callbacks? + * What to do about CCActions? + * What to do about transform changes? + * Chain/loop body types have multiple ChipmunkShapes and thus will get multiple callbacks. + * Check argument types for delegate callbacks? + * Angular velocity in degrees? + * Warnings for CCPhysicsCollisionPair methods in the wrong event cycle? + * Should CCPhysicsCollisionPair.userData retain? + + Probably Definitely Not: + * Body queries? +*/ + + +@interface CCPhysicsBody(ObjectiveChipmunk) + +/// The CCNode this physics body is attached to. +@property(nonatomic, strong) CCNode *node; +/// The CCPhysicsNode this body is added to. +@property(nonatomic, readonly) CCPhysicsNode *physicsNode; +/// Returns YES if the body is currently added to a physicsNode. +@property(nonatomic, readonly) BOOL isRunning; + +// TODO should probably rename these. +/// The position of the body relative to the space. +@property(nonatomic, assign) cpVect absolutePosition; +/// The rotation of the body relative to the space. +@property(nonatomic, assign) cpFloat absoluteRadians; +/// The transform of the body relative to the space. +@property(nonatomic, readonly) cpTransform absoluteTransform; + +/// Implements the ChipmunkObject protocol. +@property(nonatomic, readonly) NSArray *chipmunkObjects; + +// Used for deferring collision type setup until there is access to the physics node. +-(void)willAddToPhysicsNode:(CCPhysicsNode *)physics; +-(void)didRemoveFromPhysicsNode:(CCPhysicsNode *)physics; + +@end + + +@interface CCPhysicsJoint(ObjectiveChipmunk) + +/// Access to the underlying Objective-Chipmunk object. +@property(nonatomic, readonly) ChipmunkConstraint *constraint; + +@end + + +@interface CCPhysicsCollisionPair(ObjectiveChipmunk) + +/// Access to the underlying Objective-Chipmunk object. +@property(nonatomic, assign) cpArbiter *arbiter; + +@end + + +@interface CCPhysicsNode(ObjectiveChipmunk) + +/// Access to the underlying Objective-Chipmunk object. +@property(nonatomic, readonly) ChipmunkSpace *space; + +/// Intern and copy a string to ensure it can be checked by reference +/// Used for collision type identifiers by CCPhysics. +/// nil and @"default" both return the value nil. +-(NSString *)internString:(NSString *)string; + +/// Retain and track a category identifier and return it's index. +/// Up to 32 categories can be tracked for a space. +-(NSUInteger)indexForCategory:(NSString *)category; + +/// Convert an array of NSStrings for collision category identifiers into a category bitmask. +/// The categories are retained and assigned indexes. +/// Up to 32 categories can be tracked for a space. +-(cpBitmask)bitmaskForCategories:(NSArray *)categories; + +/// Convert a cpBitmask value to an array of collision category strings. +/// Ignores any bits that don't have a collision category assigned in the physics node. +-(NSArray *)categoriesForBitmask:(cpBitmask)categories; + +@end diff --git a/cocos2d/CCPhysicsBody.m b/cocos2d/CCPhysicsBody.m new file mode 100644 index 0000000..6b8d6f5 --- /dev/null +++ b/cocos2d/CCPhysicsBody.m @@ -0,0 +1,333 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2013 Scott Lembcke + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#import "CCPhysicsBody.h" +#import "CCPhysics+ObjectiveChipmunk.h" + +#define DEFAULT_FRICTION 0.7 +#define DEFAULT_ELASTICITY 0.2 + +// TODO temporary +#pragma clang diagnostic push COCOS2D +#pragma clang diagnostic ignored "-Wmissing-noreturn" +static inline void NYI(){@throw @"Not Yet Implemented";} +#pragma clang diagnostic pop COCOS2D + + +@implementation CCPhysicsBody +{ + ChipmunkBody *_body; + ChipmunkShape *_shape; + + NSArray *_chipmunkObjects; + + NSString *_collisionType; + NSArray *_collisionCategories; + NSArray *_collisionMask; +} + +//MARK: Constructors: + ++(CCPhysicsBody *)bodyWithCircleOfRadius:(CGFloat)radius andCenter:(CGPoint)center +{ + // TODO temporary code. + CCPhysicsBody *body = [[CCPhysicsBody alloc] init]; + body->_body = [ChipmunkBody bodyWithMass:0.0 andMoment:0.0]; + body->_body.userData = body; + + body->_shape = [ChipmunkCircleShape circleWithBody:body->_body radius:radius offset:center]; + body->_shape.mass = 1.0; + body->_shape.friction = DEFAULT_FRICTION; + body->_shape.elasticity = DEFAULT_ELASTICITY; + body->_shape.userData = body; + + body->_chipmunkObjects = @[body->_body, body->_shape]; + + return body; +} + ++(CCPhysicsBody *)bodyWithRect:(CGRect)rect cornerRadius:(CGFloat)cornerRadius +{ + // TODO temporary code. + CCPhysicsBody *body = [[CCPhysicsBody alloc] init]; + body->_body = [ChipmunkBody bodyWithMass:0.0 andMoment:0.0]; + body->_body.userData = body; + + cpBB bb = {CGRectGetMinX(rect), CGRectGetMinY(rect), CGRectGetMaxX(rect), CGRectGetMaxY(rect)}; + body->_shape = [ChipmunkPolyShape boxWithBody:body->_body bb:bb radius:cornerRadius]; + body->_shape.mass = 1.0; + body->_shape.friction = DEFAULT_FRICTION; + body->_shape.elasticity = DEFAULT_ELASTICITY; + body->_shape.userData = body; + + body->_chipmunkObjects = @[body->_body, body->_shape]; + + return body; +} + ++(CCPhysicsBody *)bodyWithPillFrom:(CGPoint)from to:(CGPoint)to cornerRadius:(CGFloat)cornerRadius +{ + // TODO temporary code. + CCPhysicsBody *body = [[CCPhysicsBody alloc] init]; + body->_body = [ChipmunkBody bodyWithMass:0.0 andMoment:0.0]; + body->_body.userData = body; + + body->_shape = [ChipmunkSegmentShape segmentWithBody:body->_body from:from to:to radius:cornerRadius]; + body->_shape.mass = 1.0; + body->_shape.friction = DEFAULT_FRICTION; + body->_shape.elasticity = DEFAULT_ELASTICITY; + body->_shape.userData = body; + + body->_chipmunkObjects = @[body->_body, body->_shape]; + + return body; +} + ++(CCPhysicsBody *)bodyWithPolygonFromPoints:(CGPoint *)points count:(NSUInteger)count cornerRadius:(CGFloat)cornerRadius +{ + // TODO temporary code. + CCPhysicsBody *body = [[CCPhysicsBody alloc] init]; + body->_body = [ChipmunkBody bodyWithMass:0.0 andMoment:0.0]; + body->_body.userData = body; + + int countInt = (int)count; + NSAssert (countInt < 0, @"Precision issue with count parameter, CCPhysicsBody"); + + body->_shape = [ChipmunkPolyShape polyWithBody:body->_body count:countInt verts:points transform:cpTransformIdentity radius:cornerRadius]; + body->_shape.mass = 1.0; + body->_shape.friction = DEFAULT_FRICTION; + body->_shape.elasticity = DEFAULT_ELASTICITY; + body->_shape.userData = body; + + body->_chipmunkObjects = @[body->_body, body->_shape]; + + return body; +} + ++(CCPhysicsBody *)bodyWithSegmentLoopFromPoints:(CGPoint *)points count:(NSUInteger)count cornerRadius:(CGFloat)cornerRadius +{ + NYI(); return nil; +} + ++(CCPhysicsBody *)bodyWithSegmentChainFromPoints:(CGPoint *)points count:(NSUInteger)count cornerRadius:(CGFloat)cornerRadius +{ + NYI(); return nil; +} + +//MARK: Basic Properties: + +-(CGFloat)mass {return _shape.mass;} +-(void)setMass:(CGFloat)mass {_shape.mass = mass;} + +-(CGFloat)density {return _shape.density;} +-(void)setDensity:(CGFloat)density {_shape.density = density;} + +-(CGFloat)area {return _shape.area;} + +-(CGFloat)friction {return _shape.friction;} +-(void)setFriction:(CGFloat)friction {_shape.friction = friction;} + +-(CGFloat)elasticity {return _shape.elasticity;} +-(void)setElasticity:(CGFloat)elasticity {_shape.elasticity = elasticity;} + +-(CGPoint)surfaceVelocity {return _shape.surfaceVelocity;} +-(void)setSurfaceVelocity:(CGPoint)surfaceVelocity {_shape.surfaceVelocity = surfaceVelocity;} + + +//MARK: Simulation Properties: + +-(CCPhysicsNode *)physicsNode {return _body.space.userData;} +-(BOOL)isRunning {return self.physicsNode != nil;} + +-(BOOL)affectedByGravity {NYI(); return YES;} +-(void)setAffectedByGravity:(BOOL)affectedByGravity {NYI();} + +-(BOOL)allowsRotation {NYI(); return YES;} +-(void)setAllowsRotation:(BOOL)allowsRotation {NYI();} + +static ccPhysicsBodyType ToCocosBodyType[] = {kCCPhysicsBodyTypeDynamic, kCCPhysicsBodyTypeKinematic, kCCPhysicsBodyTypeStatic}; +static cpBodyType ToChipmunkBodyType[] = {CP_BODY_TYPE_DYNAMIC, CP_BODY_TYPE_KINEMATIC, CP_BODY_TYPE_STATIC}; + +-(ccPhysicsBodyType)type {return ToCocosBodyType[_body.type];} +-(void)setType:(ccPhysicsBodyType)type {_body.type = ToChipmunkBodyType[type];} + +//MARK: Collision and Contact: + +-(BOOL)sensor {return _shape.sensor;} +-(void)setSensor:(BOOL)sensor {_shape.sensor = sensor;} + +-(id)collisionGroup {return _shape.group;}; +-(void)setCollisionGroup:(id)collisionGroup {_shape.group = collisionGroup;} + +-(NSString *)collisionType {return _collisionType;} +-(void)setCollisionType:(NSString *)collisionType {_collisionType = [collisionType copy];} + +-(NSArray *)collisionCategories { + if(_collisionCategories){ + return _collisionCategories; + } else { + // This will still correctly return nil if not added to a physics node. + return [self.physicsNode categoriesForBitmask:_shape.filter.categories]; + } +} + +-(void)setCollisionCategories:(NSArray *)collisionCategories +{ + CCPhysicsNode *physics = self.physicsNode; + if(physics){ + cpShapeFilter filter = _shape.filter; + filter.categories = [physics bitmaskForCategories:collisionCategories]; + _shape.filter = filter; + } else { + _collisionCategories = collisionCategories; + } +} + +-(NSArray *)collisionMask +{ + if(_collisionMask){ + return _collisionMask; + } else { + // This will still correctly return nil if not added to a physics node. + return [self.physicsNode categoriesForBitmask:_shape.filter.mask]; + } +} + +-(void)setCollisionMask:(NSArray *)collisionMask +{ + CCPhysicsNode *physics = self.physicsNode; + if(physics){ + cpShapeFilter filter = _shape.filter; + filter.mask = [physics bitmaskForCategories:collisionMask]; + _shape.filter = filter; + } else { + _collisionMask = collisionMask; + } +} + +-(void)eachCollisionPair:(void (^)(CCPhysicsCollisionPair *))block +{ + CCPhysicsCollisionPair *pair = [[CCPhysicsCollisionPair alloc] init]; + cpBodyEachArbiter_b(_body.body, ^(cpArbiter *arbiter){ + pair.arbiter = arbiter; + block(pair); + }); + + pair.arbiter = NULL; +} + +//MARK: Velocity + +-(CGPoint)velocity {return _body.velocity;} +-(void)setVelocity:(CGPoint)velocity {_body.velocity = velocity;} + +-(CGFloat)angularVelocity {return _body.angularVelocity;} +-(void)setAngularVelocity:(CGFloat)angularVelocity {_body.angularVelocity = angularVelocity;} + +//MARK: Forces, Torques and Impulses: + +-(CGPoint)force {return _body.force;} +-(void)setForce:(CGPoint)force {_body.force = force;} + +-(CGFloat)torque {return _body.torque;} +-(void)setTorque:(CGFloat)torque {_body.torque = torque;} + +-(void)applyTorque:(CGFloat)torque {_body.torque += torque;} +-(void)applyAngularImpulse:(CGFloat)impulse {_body.angularVelocity += impulse/_body.moment;} + +-(void)applyForce:(CGPoint)force {_body.force = cpvadd(_body.force, force);} +-(void)applyImpulse:(CGPoint)impulse {_body.velocity = cpvadd(_body.velocity, cpvmult(impulse, 1.0f/_body.moment));} + +-(void)applyForce:(CGPoint)force atLocalPoint:(CGPoint)point +{ + cpVect f = cpTransformVect(_body.transform, force); + [_body applyForce:f atLocalPoint:point]; +} + +-(void)applyImpulse:(CGPoint)impulse atLocalPoint:(CGPoint)point +{ + cpVect j = cpTransformVect(_body.transform, impulse); + [_body applyImpulse:j atLocalPoint:point]; +} + +-(void)applyForce:(CGPoint)force atWorldPoint:(CGPoint)point {[_body applyForce:force atWorldPoint:point];} +-(void)applyImpulse:(CGPoint)impulse atWorldPoint:(CGPoint)point {[_body applyImpulse:impulse atWorldPoint:point];} + +//MARK: Misc. + +-(NSArray *)joints +{ + NYI(); + return @[]; +} + +-(BOOL)sleeping {return _body.isSleeping;} + +@end + + +@implementation CCPhysicsBody(ObjectiveChipmunk) + +-(void)setNode:(CCNode *)node {_node = node;} + +-(cpVect)absolutePosition {return _body.position;} +-(void)setAbsolutePosition:(cpVect)absolutePosition {_body.position = absolutePosition;} + +-(cpFloat)absoluteRadians {return _body.angle;} +-(void)setAbsoluteRadians:(cpFloat)absoluteRadians {_body.angle = absoluteRadians;} + +-(cpTransform)absoluteTransform {return _body.transform;} + +-(NSArray *)chipmunkObjects {return _chipmunkObjects;} + +-(void)willAddToPhysicsNode:(CCPhysicsNode *)physics +{ + // Intern the collision type to ensure it's not a unique object reference. + _collisionType = [physics internString:_collisionType]; + _shape.collisionType = _collisionType; + + // Set up the collision bitmasks. + cpShapeFilter filter = _shape.filter; + filter.categories = [physics bitmaskForCategories:_collisionCategories]; + filter.mask = [physics bitmaskForCategories:_collisionMask]; + _shape.filter = filter; + + // nil the array references to save on memory. + // They will rarely be read back and we can easily reconstruct the array. + _collisionCategories = nil; + _collisionType = nil; +} + +-(void)didRemoveFromPhysicsNode:(CCPhysicsNode *)physics +{ + cpShapeFilter filter = _shape.filter; + + // Read the collision categories back just in case they are read later. + _collisionCategories = [physics categoriesForBitmask:filter.categories]; + _collisionMask = [physics categoriesForBitmask:filter.mask]; +} + +@end + + diff --git a/cocos2d/CCPhysicsJoint.h b/cocos2d/CCPhysicsJoint.h new file mode 100644 index 0000000..ede7a4b --- /dev/null +++ b/cocos2d/CCPhysicsJoint.h @@ -0,0 +1,59 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2013 Scott Lembcke + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#import "CCPhysicsBody.h" + +@interface CCPhysicsJoint : NSObject + +/// The first body this joint is attached to. +@property(nonatomic, strong) CCPhysicsBody *bodyA; +/// The second body this joint is attached to. +@property(nonatomic, strong) CCPhysicsBody *bodyB; + +/// The maximum force this joint is allowed to use. +/// Defaults to INFINITY. +@property(nonatomic, assign) CGFloat maxForce; +/// The maximum speed this joint is allowed to fix any stretching at in absolute coordinates or radians (depending on the joint). +/// Defaults to INFINITY. +@property(nonatomic, assign) CGFloat maxBias; + +/// Whether not the connected bodies are allowed to collide with one another. +/// Defaults to YES. +@property(nonatomic, assign) BOOL collideBodies; + +/// Depending on the joint, either the magnitude of the linear or angular impulse that this joint applied on the previous fixed time step. +@property(nonatomic, readonly) CGFloat impulse; + +/// Whether the joint is active or not. +/// NOTE: Be careful when reactivating a joint if the two bodies have drifted apart. It will cause them to snap back together. +@property(nonatomic, assign) BOOL enabled; + +/// Maximum force that can be applied before the joint disables itself. +/// To avoid problems with round-off errors, make sure that this value is lower than CCPhysicsJoint.maxForce. +/// Defaults to INFINITY. +@property(nonatomic, assign) CGFloat breakingForce; + +@end + +// TODO Joint subclasses. diff --git a/cocos2d/CCPhysicsJoint.m b/cocos2d/CCPhysicsJoint.m new file mode 100644 index 0000000..15aca6f --- /dev/null +++ b/cocos2d/CCPhysicsJoint.m @@ -0,0 +1,60 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2013 Scott Lembcke + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#import "CCPhysicsJoint.h" +#import "CCPhysics+ObjectiveChipmunk.h" + +// TODO temporary +#pragma clang diagnostic push COCOS2D +#pragma clang diagnostic ignored "-Wmissing-noreturn" +static inline void NYI(){@throw @"Not Yet Implemented";} +#pragma clang diagnostic pop COCOS2D + +@implementation CCPhysicsJoint + +-(id)init +{ + @throw @"CCPhysicsJoint is an abstract class."; +} + +-(CCPhysicsBody *)bodyA {return self.constraint.bodyA.userData;} +-(void)setBodyA:(CCPhysicsBody *)bodyA {NYI();} + +-(CCPhysicsBody *)bodyB {return self.constraint.bodyB.userData;} +-(void)setBodyB:(CCPhysicsBody *)bodyB {NYI();} + +-(CGFloat)maxForce {return self.constraint.maxForce;} +-(void)setMaxForce:(CGFloat)maxForce {self.constraint.maxForce = maxForce;} + +-(CGFloat)maxBias {return self.constraint.maxBias;} +-(void)setMaxBias:(CGFloat)maxBias {self.constraint.maxBias = maxBias;} + +-(CGFloat)impulse {return self.constraint.impulse;} + +-(BOOL)enabled {NYI(); return NO;} +-(void)setEnabled:(BOOL)enabled {NYI();} + +-(void)setBreakingForce:(CGFloat)breakingForce {NYI();} + +@end diff --git a/cocos2d/CCPhysicsNode.h b/cocos2d/CCPhysicsNode.h new file mode 100644 index 0000000..43d6438 --- /dev/null +++ b/cocos2d/CCPhysicsNode.h @@ -0,0 +1,153 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2013 Scott Lembcke + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#import "CCNode.h" +#import "CCPhysicsbody.h" + +#pragma clang diagnostic push COCOS2D +#pragma clang diagnostic ignored "-Wfloat-equal" +#import "ObjectiveChipmunk/ObjectiveChipmunk.h" +#pragma clang diagnostic pop COCOS2D + + +/// Contains information about colliding physics bodies. +/// NOTE: There is only one CCPhysicsCollisionPair object per scene and it's reused. +/// Only use the CCPhysicsCollisionPair object in the method or block it was given to you in. +@interface CCPhysicsCollisionPair : NSObject + +/// The contact information from the two colliding bodies. +@property(nonatomic, readonly) cpContactPointSet contacts; + +/// Ignore the collision between these two physics bodies until they stop colliding. +/// It's idomatic to write "return [pair ignore];" if using this method from a CCCollisionPairDelegate pre-solve method. +/// Always returns false. +-(BOOL)ignore; + +/// The friction coefficient for this pair of colliding bodies. +/// The default value is pair.bodyA.friction*pair.bodyB.friction. +/// Can be overriden in a CCCollisionPairDelegate pre-solve method to change the collision. +@property(nonatomic, assign) CGFloat friction; +/// The restitution coefficient for this pair of colliding bodies. +/// The default value is "pair.bodyA.elasticity*pair.bodyB.elasticity". +/// Can be overriden in a CCCollisionPairDelegate pre-solve method to change the collision. +@property(nonatomic, assign) CGFloat restitution; +/// The relative surface velocities of the two colliding shapes. +/// The default value is CGPointZero. +/// Can be overriden in a CCCollisionPairDelegate pre-solve method to change the collision. +@property(nonatomic, assign) CGPoint surfaceVelocity; + +// NOTE: The following two methods return the value from the previous collision. +// They are intended to be called from a CCPhysicsCollisionPairDelegate post-solve method or from a [CCPhysicsBody eachContactPair:] block. +// TODO Is it possible to make a warning for this? + +/// The amount of kinetic energy disappated by the last collision of the two bodies. +/// This is roughly equivalent to the idea of damage. +/// NOTE: By definition, fully elastic collisions do not lose any energy or cause any permanent damage. +@property(nonatomic, readonly) CGFloat totalKineticEnergy; +/// The total impulse applied by this collision to the colliding bodies. +@property(nonatomic, readonly) CGPoint totalImpulse; + +/// A persistent object reference associated with these two colliding objects. +/// If you want to store some information about a collision from time step to time step, store it here. +// TODO Possible to add a default to release it automatically? +@property(nonatomic, assign) id userData; + +@end + + +/// Delegate type called when two physics bodies collide. +/// The final two parameter names should be replaced with strings used with CCPhysicsBody.collisionType. +/// If both final parameter names are "default" then the method is called when a more specific method isn't found. +/// "wildcard" can be used as the final parameter name to mean "collides with anything". +@protocol CCPhysicsCollisionDelegate + +@optional +/// Begin methods are called on the first fixed time step when two bodies begin colliding. +/// If you return NO from a begin method, the collision between the two bodies will be ignored. +-(BOOL)ccPhysicsCollisionBegin:(CCPhysicsCollisionPair *)pair typeA:(CCPhysicsBody *)bodyA typeB:(CCPhysicsBody *)bodyB; +/// Pre-solve methods are called every fixed time step when two bodies are in contact before the physics solver runs. +/// You can call use properties such as friction, restitution, surfaceVelocity on CCPhysicsCollisionPair from a post-solve method. +/// If you return NO from a pre-solve method, the collision will be ignored for the current time step. +-(BOOL)ccPhysicsCollisionPreSolve:(CCPhysicsCollisionPair *)pair typeA:(CCPhysicsBody *)bodyA typeB:(CCPhysicsBody *)bodyB; +/// Post-solve methods are called every fixed time step when two bodies are in contact after the physics solver runs. +/// You can call use properties such as totalKineticEnergy and totalImpulse on CCPhysicsCollisionPair from a post-solve method. +-(void)ccPhysicsCollisionPostSolve:(CCPhysicsCollisionPair *)pair typeA:(CCPhysicsBody *)bodyA typeB:(CCPhysicsBody *)bodyB; +/// Separate methods are called the first fixed time step after two bodies stop colliding. +-(void)ccPhysicsCollisionSeparate:(CCPhysicsCollisionPair *)pair typeA:(CCPhysicsBody *)bodyA typeB:(CCPhysicsBody *)bodyB; + +@end + + +@interface CCPhysicsNode : CCNode + +/// Should the node draw a debug overlay of the joints and collision shapes? +/// Defaults to NO +@property(nonatomic, assign) BOOL debugDraw; + + +// TODO Would *really* like to push this to CCScheduler. +// Will be a lot of work and testing, so it's here for now. + +/// How often the physics is updated. +/// This is run independently of the framerate. +/// Defaults to 60hz. +@property(nonatomic, assign) ccTime fixedRate; + +/// Maximum delta time to process in a single update call. +/// Defaults to 1/15. +@property(nonatomic, assign) ccTime maxDeltaTime; + +/// Previous fixed update time. +@property(nonatomic, readonly) ccTime fixedTime; + +/// Gravity applied to the dynamic bodies in the world. +/// Defaults to CGPointZero. +@property(nonatomic, assign) CGPoint gravity; + +/// Physics bodies fall asleep when a group of them move slowly for longer than the threshold. +/// Sleeping bodies use minimal CPU resources and wake automatically when a collision happens. +/// Defaults to 0.5 seconds. +@property(nonatomic, assign) ccTime sleepTimeThreshold; + +/// The delegate that is called when two physics bodies collide. +@property(nonatomic, assign) NSObject *collisionDelegate; + +// TODO think about these more. +// More variations? Filtering? thickness? +-(CCPhysicsBody *)pointQueryAt:(CGPoint)point within:(CGFloat)radius block:(BOOL (^)(CCPhysicsBody *body, CGPoint nearest, CGFloat distance))block; +-(CCPhysicsBody *)rayQueryFirstFrom:(CGPoint)start to:(CGPoint)end block:(BOOL (^)(CCPhysicsBody *body, CGPoint point, CGPoint normal, CGFloat distance))block; +-(BOOL)rectQuery:(CGRect)rect block:(BOOL (^)(CCPhysicsBody *body))block; +// Unsure about this one. +//-(BOOL)bodyQuery:(CCPhysicsBody *)body withPosition:(CGPoint)position rotation:(CGFloat)rotation block:(BOOL (^)(ChipmunkBody *bodyB, cpContactPointSet))block; + +@end + + +@interface CCNode(CCPhysics) + +/// Nearest CCPhysicsNode ancestor of this node, or nil if none. +/// Unlike CCPhysicsBody.physicsNode, this will return a value before onEnter is called on the node. +-(CCPhysicsNode *)physicsNode; + +@end diff --git a/cocos2d/CCPhysicsNode.m b/cocos2d/CCPhysicsNode.m new file mode 100644 index 0000000..4e4214a --- /dev/null +++ b/cocos2d/CCPhysicsNode.m @@ -0,0 +1,573 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2013 Scott Lembcke + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#import "CCPhysicsNode.h" +#import "CCPhysics+ObjectiveChipmunk.h" + +#import + +// Do not change this value unless you redefine the cpBitmask type to have more than 32 bits. +#define MAX_CATEGORIES 32 + +// Maximum number of categories to cache +// There are usually few unique categories in a given simulation. +#define MAX_CACHED_CATEGORIES 64 + +// TODO temporary +#pragma clang diagnostic push COCOS2D +#pragma clang diagnostic ignored "-Wmissing-noreturn" +static inline void NYI(){@throw @"Not Yet Implemented";} +#pragma clang diagnostic pop COCOS2D + + +@interface CCPhysicsNode(Private) + +@property(nonatomic, readonly) CCPhysicsCollisionPair *collisionPairSingleton; + +@end + + +@implementation CCPhysicsCollisionPair { + @public + cpArbiter *_arbiter; +} + +-(cpArbiter *)arbiter {return _arbiter;} + +// Check that the arbiter is set and return it. +-(cpArbiter *)arb +{ + NSAssert(_arbiter, @"Do not store references to CCPhysicsCollisionPair objects."); + return _arbiter; +} + +-(BOOL)ignore +{ + return cpArbiterIgnore(self.arb); +} + +-(CGFloat)friction {return cpArbiterGetFriction(self.arb);} +-(void)setFriction:(CGFloat)friction {cpArbiterSetFriction(self.arb, friction);} + +-(CGFloat)restitution {return cpArbiterGetRestitution(self.arb);} +-(void)setRestitution:(CGFloat)restitution {cpArbiterSetRestitution(self.arb, restitution);} + +-(CGPoint)surfaceVelocity {return cpArbiterGetSurfaceVelocity(self.arb);} +-(void)setSurfaceVelocity:(CGPoint)surfaceVelocity {cpArbiterSetSurfaceVelocity(self.arb, surfaceVelocity);} + +-(CGFloat)totalKineticEnergy {return cpArbiterTotalKE(self.arb);} +-(CGPoint)totalImpulse {return cpArbiterTotalImpulse(self.arb);} + +-(id)userData {return cpArbiterGetUserData(self.arb);} +-(void)setUserData:(id)userData {cpArbiterSetUserData(self.arb, userData);} + +@end + + +/// Internal class used to wrap cpCollisionHandlers +@interface CCPhysicsCollisionHandler : NSObject { + cpCollisionHandler *_handler; + id _delegate; + + // Cache the CCPhysicsNode's collision pair singleton. + CCPhysicsCollisionPair *_collisionPairSingleton; + + // Is this handler for a wildcard or not. + BOOL _wildcard; + + // Cache all the methods, imps and selectors. + Method _begin, _preSolve, _postSolve, _separate; + IMP _beginImp, _preSolveImp, _postSolveImp, _separateImp; + SEL _beginSel, _preSolveSel, _postSolveSel, _separateSel; +} + ++(CCPhysicsCollisionHandler *)wrapCPHandler:(cpCollisionHandler *)cpHandler ForPhysicsNode:(CCPhysicsNode *)physicsNode wildcard:(BOOL)wildcard; + +@property(nonatomic, assign) Method begin; +@property(nonatomic, assign) Method preSolve; +@property(nonatomic, assign) Method postSolve; +@property(nonatomic, assign) Method separate; + +@end + + +@implementation CCPhysicsCollisionHandler + ++(CCPhysicsCollisionHandler *)wrapCPHandler:(cpCollisionHandler *)cpHandler ForPhysicsNode:(CCPhysicsNode *)physicsNode wildcard:(BOOL)wildcard +{ + CCPhysicsCollisionHandler *ccHandler = [[self alloc] init]; + ccHandler->_delegate = physicsNode.collisionDelegate; + ccHandler->_collisionPairSingleton = physicsNode.collisionPairSingleton; + ccHandler->_wildcard = wildcard; + + ccHandler->_handler = cpHandler; + cpHandler->userData = ccHandler; + + return ccHandler; +} + +static cpBool PhysicsBegin(cpArbiter *arb, cpSpace *space, CCPhysicsCollisionHandler *handler){ + CHIPMUNK_ARBITER_GET_SHAPES(arb, bodyA, bodyB); + CCPhysicsCollisionPair *pair = handler->_collisionPairSingleton; + pair->_arbiter = arb; + + cpBool (*imp)(id, SEL, id, id, id) = (__typeof(imp))handler->_beginImp; + BOOL retval = imp(handler->_delegate, handler->_beginSel, pair, bodyA.userData, bodyB.userData); + + if(!handler->_wildcard){ + retval = cpArbiterCallWildcardBeginA(arb, space) && retval; + retval = cpArbiterCallWildcardBeginB(arb, space) && retval; + } + + return retval; +} + +-(void)setBegin:(Method)m +{ + NSAssert(m, @"Internal Error: Method is NULL."); + _begin = m; + _beginImp = method_getImplementation(m); + _beginSel = method_getName(m); + _handler->beginFunc = PhysicsBegin; +} + +static cpBool PhysicsPreSolve(cpArbiter *arb, cpSpace *space, CCPhysicsCollisionHandler *handler){ + CHIPMUNK_ARBITER_GET_SHAPES(arb, bodyA, bodyB); + CCPhysicsCollisionPair *pair = handler->_collisionPairSingleton; + pair->_arbiter = arb; + + cpBool (*imp)(id, SEL, id, id, id) = (__typeof(imp))handler->_preSolveImp; + BOOL retval = imp(handler->_delegate, handler->_preSolveSel, pair, bodyA.userData, bodyB.userData); + + if(!handler->_wildcard){ + retval = cpArbiterCallWildcardPreSolveA(arb, space) && retval; + retval = cpArbiterCallWildcardPreSolveB(arb, space) && retval; + } + + return retval; +} + +-(void)setPreSolve:(Method)m +{ + NSAssert(m, @"Internal Error: Method is NULL."); + _preSolve = m; + _preSolveImp = method_getImplementation(m); + _preSolveSel = method_getName(m); + _handler->preSolveFunc = PhysicsPreSolve; +} + +static void PhysicsPostSolve(cpArbiter *arb, cpSpace *space, CCPhysicsCollisionHandler *handler){ + CHIPMUNK_ARBITER_GET_SHAPES(arb, bodyA, bodyB); + CCPhysicsCollisionPair *pair = handler->_collisionPairSingleton; + pair->_arbiter = arb; + + void (*imp)(id, SEL, id, id, id) = (__typeof(imp))handler->_postSolveImp; + imp(handler->_delegate, handler->_postSolveSel, pair, bodyA.userData, bodyB.userData); + + if(!handler->_wildcard){ + cpArbiterCallWildcardPostSolveA(arb, space); + cpArbiterCallWildcardPostSolveB(arb, space); + } +} + +-(void)setPostSolve:(Method)m +{ + NSAssert(m, @"Internal Error: Method is NULL."); + _postSolve = m; + _postSolveImp = method_getImplementation(m); + _postSolveSel = method_getName(m); + _handler->postSolveFunc = PhysicsPostSolve; +} + +static void PhysicsSeparate(cpArbiter *arb, cpSpace *space, CCPhysicsCollisionHandler *handler){ + CHIPMUNK_ARBITER_GET_SHAPES(arb, bodyA, bodyB); + CCPhysicsCollisionPair *pair = handler->_collisionPairSingleton; + pair->_arbiter = arb; + + void (*imp)(id, SEL, id, id, id) = (__typeof(imp))handler->_separateImp; + imp(handler->_delegate, handler->_separateSel, pair, bodyA.userData, bodyB.userData); + + if(!handler->_wildcard){ + cpArbiterCallWildcardSeparateA(arb, space); + cpArbiterCallWildcardSeparateB(arb, space); + } +} + +-(void)setSeparate:(Method)m +{ + NSAssert(m, @"Internal Error: Method is NULL."); + _separate = m; + _separateImp = method_getImplementation(m); + _separateSel = method_getName(m); + _handler->separateFunc = PhysicsSeparate; +} + +@end + + +@implementation CCPhysicsNode { + ChipmunkSpace *_space; + + // Interned strings for collision and category types. + NSMutableDictionary *_internedStrings; + + // List of category strings used in this space. + NSMutableArray *_categories; + + // Cached category arrays for category bitmasks. + // Used for fast lookup when possible. + // Limited to MAX_CACHED_CATEGORIES in size. + NSMutableDictionary *_cachedCategories; + + // All collisions in a CCPhysicsNode share the same CCPhysicsCollisionPair. + // The cpArbiter it wraps is simply changed each time. + // That's one of the reasons you aren't allowed to keep references to CCPhysicsCollisionPair objects. + CCPhysicsCollisionPair *_collisionPairSingleton; + + // Interned copies of the two reserved types. + NSString *_wildcardType; + + // Need a way to retain the CCPhysicsCollisionHandler objects. + NSMutableSet *_handlers; + + // CCDrawNode used for drawing the debug overlay. + // Only allocated if CCPhysicsNode.debugDraw is YES. + CCDrawNode *_debug; + + // How much time passes per fixedUpdate. + ccTime _fixedTimestep; + + // "left-over" time from the last update. + ccTime _accumulator; +} + +// Used by CCNode.physicsNode +-(BOOL)isPhysicsNode {return YES;} + +-(id)init +{ + if((self = [super init])){ + _space = [[ChipmunkSpace alloc] init]; + _space.gravity = cpvzero; + _space.sleepTimeThreshold = 0.5f; + _space.userData = self; + + _internedStrings = [NSMutableDictionary dictionary]; + _categories = [NSMutableArray array]; + _cachedCategories = [NSMutableDictionary dictionary]; + + // Intern the reserved string @"wildcard" + _wildcardType = [self internString:@"wildcard"]; + + _collisionPairSingleton = [[CCPhysicsCollisionPair alloc] init]; + _handlers = [NSMutableSet set]; + + _debug = [CCDrawNode node]; + [self addChild:_debug z:NSIntegerMax]; + + self.fixedRate = 60; + self.maxDeltaTime = 1.0/15.0; + } + + return self; +} + +-(void)setFixedRate:(ccTime)fixedRate +{ + _fixedRate = fixedRate; + _fixedTimestep = 1.0/fixedRate; +} + +-(CGPoint)gravity {return _space.gravity;} +-(void)setGravity:(CGPoint)gravity {_space.gravity = gravity;} + +-(ccTime)sleepTimeThreshold {return _space.sleepTimeThreshold;} +-(void)setSleepTimeThreshold:(ccTime)sleepTimeThreshold {_space.sleepTimeThreshold = sleepTimeThreshold;} + +// Collision Delegates + +-(CCPhysicsCollisionPair *)collisionPairSingleton {return _collisionPairSingleton;} + +-(CCPhysicsCollisionHandler *)handlerForTypeA:(NSString *)typeA typeB:(NSString *)typeB +{ + NSAssert(typeA != _wildcardType, @"'wildcard' is only allowed as the second type identifier."); + + BOOL wildcard = (typeB == _wildcardType); + cpCollisionHandler *cpHandler = (wildcard ? + cpSpaceAddWildcardHandler(_space.space, typeA) : cpSpaceAddCollisionHandler(_space.space, typeA, typeB) + ); + + // Assume that the userData pointer is a CCPhysicsCollisionHandler. + // Dangerous, so be careful about mixing vanilla Chipmunk and Objective-Chipmunk handlers here. + if(cpHandler->userData == nil){ + // Retain the handler in the _handlers set. + [_handlers addObject:[CCPhysicsCollisionHandler wrapCPHandler:cpHandler ForPhysicsNode:self wildcard:wildcard]]; + } + + return cpHandler->userData; +} + +-(void)registerDelegateMethodsForClass:(Class)class +{ + if(class == nil) return; + + // Search for superclass delegate methods first. + [self registerDelegateMethodsForClass:class_getSuperclass(class)]; + + unsigned int count; + Method *methods = class_copyMethodList(class, &count); + for(unsigned int i=0; i *)collisionDelegate +{ + NSAssert(_collisionDelegate == nil, @"The collision delegate can only be set once per CCPhysicsNode."); + _collisionDelegate = collisionDelegate; + + // Recurse the inheritance tree to find all the matching collision delegate methods. + [self registerDelegateMethodsForClass:collisionDelegate.class]; +} + +//MARK: Queries: + +-(CCPhysicsBody *)pointQueryAt:(CGPoint)point within:(CGFloat)radius block:(BOOL (^)(CCPhysicsBody *, CGPoint, CGFloat))block +{ + NYI(); + return nil; +} + +-(CCPhysicsBody *)rayQueryFirstFrom:(CGPoint)start to:(CGPoint)end block:(BOOL (^)(CCPhysicsBody *, CGPoint, CGPoint, CGFloat))block +{ + NYI(); + return nil; +} + +-(BOOL)rectQuery:(CGRect)rect block:(BOOL (^)(CCPhysicsBody *))block +{ + NYI(); + return NO; +} + +//MARK: Lifecycle and Scheduling + +-(void)onEnter +{ + [super onEnter]; + [self scheduleUpdate]; +} + +-(void)onExit +{ + [super onExit]; + [self unscheduleUpdate]; +} + +-(void)fixedUpdate:(ccTime)delta +{ + [_space step:1.0f/60.0f]; + + // Null out the arbiter just in case somebody retained a pair. + _collisionPairSingleton->_arbiter = NULL; +} + +-(void)update:(ccTime)delta +{ + // Add the current dynamic timestep to the accumulator. + _accumulator += MIN(delta, _maxDeltaTime); + + // Subtract off fixed-sized chunks of time from the accumulator and step + while(_accumulator > _fixedTimestep){ + [self fixedUpdate:_fixedTimestep]; + _accumulator -= _fixedTimestep; + _fixedTime += _fixedTimestep; + } +} + +//MARK: Debug Drawing: + +static inline ccColor4F ToCCColor4f(cpSpaceDebugColor c){return (ccColor4F){c.r, c.g, c.b, c.a};} + +static void +DrawCircle(cpVect p, cpFloat a, cpFloat r, cpSpaceDebugColor outline, cpSpaceDebugColor fill, CCDrawNode *draw) +{[draw drawDot:p radius:r color:ToCCColor4f(fill)];} + +static void +DrawSegment(cpVect a, cpVect b, cpSpaceDebugColor color, CCDrawNode *draw) +{[draw drawSegmentFrom:a to:b radius:1.0 color:ToCCColor4f(color)];} + +static void +DrawFatSegment(cpVect a, cpVect b, cpFloat r, cpSpaceDebugColor outline, cpSpaceDebugColor fill, CCDrawNode *draw) +{[draw drawSegmentFrom:a to:b radius:r color:ToCCColor4f(fill)];} + +static void +DrawPolygon(int count, const cpVect *verts, cpFloat r, cpSpaceDebugColor outline, cpSpaceDebugColor fill, CCDrawNode *draw) +{[draw drawPolyWithVerts:verts count:count fillColor:ToCCColor4f(fill) borderWidth:1.0 borderColor:ToCCColor4f(outline)];} + +static void +DrawDot(cpFloat size, cpVect pos, cpSpaceDebugColor color, CCDrawNode *draw) +{[draw drawDot:pos radius:size/2.0 color:ToCCColor4f(color)];} + +static cpSpaceDebugColor +ColorForShape(cpShape *shape, CCDrawNode *draw) +{return (cpSpaceDebugColor){0.8, 0.0, 0.0, 0.75};} + +-(void)draw +{ + if(!_debugDraw) return; + + cpSpaceDebugDrawOptions drawOptions = { + (cpSpaceDebugDrawCircleImpl)DrawCircle, + (cpSpaceDebugDrawSegmentImpl)DrawSegment, + (cpSpaceDebugDrawFatSegmentImpl)DrawFatSegment, + (cpSpaceDebugDrawPolygonImpl)DrawPolygon, + (cpSpaceDebugDrawDotImpl)DrawDot, + + ((cpSpaceDebugDrawFlags)(CP_SPACE_DEBUG_DRAW_SHAPES | CP_SPACE_DEBUG_DRAW_CONSTRAINTS | CP_SPACE_DEBUG_DRAW_COLLISION_POINTS)), + + {1.0, 1.0, 1.0, 1.0}, + (cpSpaceDebugDrawColorForShapeImpl)ColorForShape, + {0.0, 1.0, 0.0, 1.0}, + {1.0, 0.0, 0.0, 1.0}, + _debug, + }; + + [_debug clear]; + cpSpaceDebugDraw(_space.space, &drawOptions); + + cpSpaceEachBody_b(_space.space, ^(cpBody *body){ + if(cpBodyGetType(body) == CP_BODY_TYPE_DYNAMIC){ + [self->_debug drawDot:cpBodyGetPosition(body) radius:5.0 color:ccc4f(1, 0, 0, 1)]; + + cpVect cog = cpBodyLocalToWorld(body, cpBodyGetCenterOfGravity(body)); + [self->_debug drawDot:cog radius:5.0 color:ccc4f(1, 1, 0, 1)]; +// CCLOG(@"%p cog: %@", body, NSStringFromCGPoint(cog)); + } + }); +} + +@end + +@implementation CCPhysicsNode(ObjectiveChipmunk) + +-(ChipmunkSpace *)space {return _space;} + +//MARK: Interned Strings and Categories: + +-(NSString *)internString:(NSString *)string +{ + if(string == nil || [string isEqualToString:@"default"]) return nil; + + NSString *interned = [_internedStrings objectForKey:string]; + if(interned == nil){ + interned = [string copy]; + [_internedStrings setObject:interned forKey:interned]; + } + + return interned; +} + +-(NSUInteger)indexForCategory:(NSString *)category +{ + // Add the category if it doesn't exist yet. + if(![_categories containsObject:category]){ + NSAssert(_categories.count <= MAX_CATEGORIES, @"A space can only track up to %d categories.", MAX_CATEGORIES); + [_categories addObject:category]; + } + + return [_categories indexOfObject:category]; +} + +-(cpBitmask)bitmaskForCategories:(NSArray *)categories +{ + if(categories){ + cpBitmask bitmask = 0; + + for(NSString *category in categories){ + bitmask |= (1 << [self indexForCategory:category]); + } + + if(_cachedCategories.count < MAX_CACHED_CATEGORIES){ + [_cachedCategories setObject:[categories copy] forKey:@(bitmask)]; + } + + return bitmask; + } else { + // nil (the default value) is equivalent to all categories. + return CP_ALL_CATEGORIES; + } +} + +-(NSArray *)categoriesForBitmask:(cpBitmask)bitmask +{ + // nil (the default value) is equivalent to all categories. + if(bitmask == CP_ALL_CATEGORIES) return nil; + + // First check if it has been cached. + NSArray *cached = [_cachedCategories objectForKey:@(bitmask)]; + if(cached) return cached; + + NSString *arr[MAX_CATEGORIES] = {}; + NSUInteger count = 0; + + for(NSUInteger i=0; i<_categories.count; i++){ + if(bitmask & (1< +#import "CCSprite.h" + +/** Types of progress + @since v0.99.1 + */ +typedef enum { + /// Radial Counter-Clockwise + kCCProgressTimerTypeRadial, + /// Bar + kCCProgressTimerTypeBar, +} CCProgressTimerType; + +/** + CCProgresstimer is a subclass of CCNode. + It renders the inner sprite according to the percentage. + The progress can be Radial, Horizontal or vertical. + @since v0.99.1 + */ +@interface CCProgressTimer : CCNodeRGBA { + CCProgressTimerType _type; + float _percentage; + CCSprite *_sprite; + + int _vertexDataCount; + ccV2F_C4B_T2F *_vertexData; + CGPoint _midpoint; + CGPoint _barChangeRate; + BOOL _reverseDirection; +} +/** Change the percentage to change progress. */ +@property (nonatomic, readwrite) CCProgressTimerType type; +@property (nonatomic, readwrite) BOOL reverseDirection; +@property (nonatomic, readonly) ccV2F_C4B_T2F *vertexData; +@property (nonatomic, readonly) int vertexDataCount; + +/** + * Midpoint is used to modify the progress start position. + * If you're using radials type then the midpoint changes the center point + * If you're using bar type the the midpoint changes the bar growth + * it expands from the center but clamps to the sprites edge so: + * you want a left to right then set the midpoint all the way to ccp(0,y) + * you want a right to left then set the midpoint all the way to ccp(1,y) + * you want a bottom to top then set the midpoint all the way to ccp(x,0) + * you want a top to bottom then set the midpoint all the way to ccp(x,1) + */ +@property (nonatomic, readwrite) CGPoint midpoint; + +/** + * This allows the bar type to move the component at a specific rate + * Set the component to 0 to make sure it stays at 100%. + * For example you want a left to right bar but not have the height stay 100% + * Set the rate to be ccp(0,1); and set the midpoint to = ccp(0,.5f); + */ +@property (nonatomic, readwrite) CGPoint barChangeRate; + +/** Percentages are from 0 to 100 */ +@property (nonatomic, readwrite) float percentage; + +/** The image to show the progress percentage */ +@property (nonatomic, readwrite, strong) CCSprite *sprite; + +/** Creates a progress timer with the sprite as the shape the timer goes through */ ++ (id) progressWithSprite:(CCSprite*) sprite; +/** Initializes a progress timer with the sprite as the shape the timer goes through */ +- (id) initWithSprite:(CCSprite*) sprite; +@end diff --git a/src/cocos2d/CCProgressTimer.m b/cocos2d/CCProgressTimer.m similarity index 59% rename from src/cocos2d/CCProgressTimer.m rename to cocos2d/CCProgressTimer.m index 084b0c6..d4ac7a9 100644 --- a/src/cocos2d/CCProgressTimer.m +++ b/cocos2d/CCProgressTimer.m @@ -40,7 +40,7 @@ #define kProgressTextureCoordsCount 4 // kProgressTextureCoords holds points {0,1} {0,0} {1,0} {1,1} we can represent it as bits -const char kCCProgressTextureCoords = 0x4b; +static const char kCCProgressTextureCoords = 0x4b; @interface CCProgressTimer () @@ -53,18 +53,18 @@ -(CGPoint)boundaryTexCoord:(char)index; @implementation CCProgressTimer -@synthesize percentage = percentage_; -@synthesize sprite = sprite_; -@synthesize type = type_; -@synthesize reverseDirection = reverseDirection_; -@synthesize midpoint = midpoint_; -@synthesize barChangeRate = barChangeRate_; -@synthesize vertexData = vertexData_; -@synthesize vertexDataCount = vertexDataCount_; +@synthesize percentage = _percentage; +@synthesize sprite = _sprite; +@synthesize type = _type; +@synthesize reverseDirection = _reverseDirection; +@synthesize midpoint = _midpoint; +@synthesize barChangeRate = _barChangeRate; +@synthesize vertexData = _vertexData; +@synthesize vertexDataCount = _vertexDataCount; +(id)progressWithSprite:(CCSprite*) sprite { - return [[[self alloc]initWithSprite:sprite] autorelease]; + return [[self alloc]initWithSprite:sprite]; } -(id) init @@ -76,9 +76,9 @@ -(id) init -(id)initWithSprite:(CCSprite*) sprite { if(( self = [super init] )){ - percentage_ = 0.f; - vertexData_ = NULL; - vertexDataCount_ = 0; + _percentage = 0.f; + _vertexData = NULL; + _vertexDataCount = 0; self.anchorPoint = ccp(0.5f,0.5f); self.type = kCCProgressTimerTypeRadial; self.reverseDirection = NO; @@ -94,85 +94,86 @@ -(id)initWithSprite:(CCSprite*) sprite -(void)dealloc { - if(vertexData_){ - free(vertexData_); + if(_vertexData){ + free(_vertexData); } - [sprite_ release]; - [super dealloc]; } +#pragma clang diagnostic push COCOS2D +#pragma clang diagnostic ignored "-Wfloat-equal" -(void)setPercentage:(float) percentage { - if(percentage_ != percentage) { - percentage_ = clampf( percentage, 0, 100); + if(_percentage != percentage) { + _percentage = clampf( percentage, 0, 100); [self updateProgress]; } } +#pragma clang diagnostic pop COCOS2D -(void)setSprite:(CCSprite *)newSprite { - if(sprite_ != newSprite){ - [sprite_ release]; - sprite_ = [newSprite retain]; - self.contentSize = sprite_.contentSize; + if(_sprite != newSprite){ + _sprite = newSprite; + self.contentSize = _sprite.contentSize; // Everytime we set a new sprite, we free the current vertex data - if(vertexData_){ - free(vertexData_); - vertexData_ = NULL; - vertexDataCount_ = 0; + if(_vertexData){ + free(_vertexData); + _vertexData = NULL; + _vertexDataCount = 0; } } } -(void)setType:(CCProgressTimerType)newType { - if (newType != type_) { + if (newType != _type) { // release all previous information - if(vertexData_){ - free(vertexData_); - vertexData_ = NULL; - vertexDataCount_ = 0; + if(_vertexData){ + free(_vertexData); + _vertexData = NULL; + _vertexDataCount = 0; } - type_ = newType; + _type = newType; + [self updateProgress]; } } --(void)setReverseProgress:(BOOL)reverse +-(void)setReverseDirection:(BOOL)reverse { - if( reverseDirection_ != reverse ) { - reverseDirection_ = reverse; + if( _reverseDirection != reverse ) { + _reverseDirection = reverse; // release all previous information - if(vertexData_){ - free(vertexData_); - vertexData_ = NULL; - vertexDataCount_ = 0; + if(_vertexData){ + free(_vertexData); + _vertexData = NULL; + _vertexDataCount = 0; } } } -(void)setColor:(ccColor3B)c { - sprite_.color = c; + _sprite.color = c; [self updateColor]; } -(ccColor3B)color { - return sprite_.color; + return _sprite.color; } -(void)setOpacity:(GLubyte)o { - sprite_.opacity = o; + _sprite.opacity = o; [self updateColor]; } -(GLubyte)opacity { - return sprite_.opacity; + return _sprite.opacity; } #pragma mark ProgressTimer Internal @@ -182,14 +183,14 @@ -(GLubyte)opacity /// -(ccTex2F)textureCoordFromAlphaPoint:(CGPoint) alpha { - if (!sprite_) { + if (!_sprite) { return (ccTex2F){0,0}; } - ccV3F_C4B_T2F_Quad quad = sprite_.quad; + ccV3F_C4B_T2F_Quad quad = _sprite.quad; CGPoint min = (CGPoint){quad.bl.texCoords.u,quad.bl.texCoords.v}; CGPoint max = (CGPoint){quad.tr.texCoords.u,quad.tr.texCoords.v}; // Fix bug #1303 so that progress timer handles sprite frame texture rotation - if (sprite_.textureRectRotated) { + if (_sprite.textureRectRotated) { CC_SWAP(alpha.x, alpha.y); } return (ccTex2F){min.x * (1.f - alpha.x) + max.x * alpha.x, min.y * (1.f - alpha.y) + max.y * alpha.y}; @@ -197,10 +198,10 @@ -(ccTex2F)textureCoordFromAlphaPoint:(CGPoint) alpha -(ccVertex2F)vertexFromAlphaPoint:(CGPoint) alpha { - if (!sprite_) { + if (!_sprite) { return (ccVertex2F){0.f, 0.f}; } - ccV3F_C4B_T2F_Quad quad = sprite_.quad; + ccV3F_C4B_T2F_Quad quad = _sprite.quad; CGPoint min = (CGPoint){quad.bl.vertices.x,quad.bl.vertices.y}; CGPoint max = (CGPoint){quad.tr.vertices.x,quad.tr.vertices.y}; return (ccVertex2F){min.x * (1.f - alpha.x) + max.x * alpha.x, min.y * (1.f - alpha.y) + max.y * alpha.y}; @@ -208,28 +209,26 @@ -(ccVertex2F)vertexFromAlphaPoint:(CGPoint) alpha -(void)updateColor { - if (!sprite_) { + if (!_sprite) { return; } - if(vertexData_){ - ccColor4B sc = sprite_.quad.tl.colors; - for (int i=0; i < vertexDataCount_; ++i) { - vertexData_[i].colors = sc; + if(_vertexData){ + ccColor4B sc = _sprite.quad.tl.colors; + for (int i=0; i < _vertexDataCount; ++i) { + _vertexData[i].colors = sc; } } } -(void)updateProgress { - switch (type_) { + switch (_type) { case kCCProgressTimerTypeRadial: [self updateRadial]; break; case kCCProgressTimerTypeBar: [self updateBar]; break; - default: - break; } } @@ -240,12 +239,12 @@ -(void)setAnchorPoint:(CGPoint)anchorPoint -(CGPoint) midpoint { - return midpoint_; + return _midpoint; } -(void)setMidpoint:(CGPoint)midPoint { - midpoint_ = ccpClamp(midPoint, CGPointZero, ccp(1,1)); + _midpoint = ccpClamp(midPoint, CGPointZero, ccp(1,1)); } /// @@ -259,19 +258,19 @@ -(void)setMidpoint:(CGPoint)midPoint /// -(void)updateRadial { - if (!sprite_) { + if (!_sprite) { return; } - float alpha = percentage_ / 100.f; + float alpha = _percentage / 100.f; - float angle = 2.f*((float)M_PI) * ( reverseDirection_ == YES ? alpha : 1.f - alpha); + float angle = 2.f*((float)M_PI) * ( _reverseDirection == YES ? alpha : 1.f - alpha); // We find the vector to do a hit detection based on the percentage // We know the first vector is the one @ 12 o'clock (top,mid) so we rotate - // from that by the progress angle around the midpoint_ pivot - CGPoint topMid = ccp(midpoint_.x, 1.f); - CGPoint percentagePt = ccpRotateByAngle(topMid, midpoint_, angle); + // from that by the progress angle around the _midpoint pivot + CGPoint topMid = ccp(_midpoint.x, 1.f); + CGPoint percentagePt = ccpRotateByAngle(topMid, _midpoint, angle); int index = 0; @@ -303,14 +302,14 @@ -(void)updateRadial // Remember that the top edge is split in half for the 12 o'clock position // Let's deal with that here by finding the correct endpoints if(i == 0){ - edgePtB = ccpLerp(edgePtA, edgePtB, 1 - midpoint_.x); + edgePtB = ccpLerp(edgePtA, edgePtB, 1 - _midpoint.x); } else if(i == 4){ - edgePtA = ccpLerp(edgePtA, edgePtB, 1 - midpoint_.x); + edgePtA = ccpLerp(edgePtA, edgePtB, 1 - _midpoint.x); } // s and t are returned by ccpLineIntersect float s = 0, t = 0; - if(ccpLineIntersect(edgePtA, edgePtB, midpoint_, percentagePt, &s, &t)) + if(ccpLineIntersect(edgePtA, edgePtB, _midpoint, percentagePt, &s, &t)) { // Since our hit test is on rays we have to deal with the top edge @@ -322,7 +321,7 @@ -(void)updateRadial } } // As long as our t isn't negative we are at least finding a - // correct hitpoint from midpoint_ to percentagePt. + // correct hitpoint from _midpoint to percentagePt. if (t >= 0.f) { // Because the percentage line and all the texture edges are // rays we should only account for the shortest intersection @@ -335,52 +334,52 @@ -(void)updateRadial } // Now that we have the minimum magnitude we can use that to find our intersection - hit = ccpAdd(midpoint_, ccpMult(ccpSub(percentagePt, midpoint_),min_t)); + hit = ccpAdd(_midpoint, ccpMult(ccpSub(percentagePt, _midpoint),min_t)); } // The size of the vertex data is the index from the hitpoint - // the 3 is for the midpoint_, 12 o'clock point and hitpoint position. + // the 3 is for the _midpoint, 12 o'clock point and hitpoint position. BOOL sameIndexCount = YES; - if(vertexDataCount_ != index + 3){ + if(_vertexDataCount != index + 3){ sameIndexCount = NO; - if(vertexData_){ - free(vertexData_); - vertexData_ = NULL; - vertexDataCount_ = 0; + if(_vertexData){ + free(_vertexData); + _vertexData = NULL; + _vertexDataCount = 0; } } - if(!vertexData_) { - vertexDataCount_ = index + 3; - vertexData_ = malloc(vertexDataCount_ * sizeof(ccV2F_C4B_T2F)); - NSAssert( vertexData_, @"CCProgressTimer. Not enough memory"); + if(!_vertexData) { + _vertexDataCount = index + 3; + _vertexData = malloc(_vertexDataCount * sizeof(ccV2F_C4B_T2F)); + NSAssert( _vertexData, @"CCProgressTimer. Not enough memory"); } [self updateColor]; if (!sameIndexCount) { - // First we populate the array with the midpoint_, then all + // First we populate the array with the _midpoint, then all // vertices/texcoords/colors of the 12 'o clock start and edges and the hitpoint - vertexData_[0].texCoords = [self textureCoordFromAlphaPoint:midpoint_]; - vertexData_[0].vertices = [self vertexFromAlphaPoint:midpoint_]; + _vertexData[0].texCoords = [self textureCoordFromAlphaPoint:_midpoint]; + _vertexData[0].vertices = [self vertexFromAlphaPoint:_midpoint]; - vertexData_[1].texCoords = [self textureCoordFromAlphaPoint:topMid]; - vertexData_[1].vertices = [self vertexFromAlphaPoint:topMid]; + _vertexData[1].texCoords = [self textureCoordFromAlphaPoint:topMid]; + _vertexData[1].vertices = [self vertexFromAlphaPoint:topMid]; for(int i = 0; i < index; ++i){ CGPoint alphaPoint = [self boundaryTexCoord:i]; - vertexData_[i+2].texCoords = [self textureCoordFromAlphaPoint:alphaPoint]; - vertexData_[i+2].vertices = [self vertexFromAlphaPoint:alphaPoint]; + _vertexData[i+2].texCoords = [self textureCoordFromAlphaPoint:alphaPoint]; + _vertexData[i+2].vertices = [self vertexFromAlphaPoint:alphaPoint]; } } // hitpoint will go last - vertexData_[vertexDataCount_ - 1].texCoords = [self textureCoordFromAlphaPoint:hit]; - vertexData_[vertexDataCount_ - 1].vertices = [self vertexFromAlphaPoint:hit]; + _vertexData[_vertexDataCount - 1].texCoords = [self textureCoordFromAlphaPoint:hit]; + _vertexData[_vertexDataCount - 1].vertices = [self vertexFromAlphaPoint:hit]; } /// @@ -394,13 +393,13 @@ -(void)updateRadial /// -(void)updateBar { - if (!sprite_) { + if (!_sprite) { return; } - float alpha = percentage_ / 100.f; - CGPoint alphaOffset = ccpMult(ccp(1.f * (1.f - barChangeRate_.x) + alpha * barChangeRate_.x, 1.f * (1.f - barChangeRate_.y) + alpha * barChangeRate_.y), .5f); - CGPoint min = ccpSub(midpoint_, alphaOffset); - CGPoint max = ccpAdd(midpoint_, alphaOffset); + float alpha = _percentage / 100.f; + CGPoint alphaOffset = ccpMult(ccp(1.f * (1.f - _barChangeRate.x) + alpha * _barChangeRate.x, 1.f * (1.f - _barChangeRate.y) + alpha * _barChangeRate.y), .5f); + CGPoint min = ccpSub(_midpoint, alphaOffset); + CGPoint max = ccpAdd(_midpoint, alphaOffset); if (min.x < 0.f) { max.x += -min.x; @@ -423,64 +422,64 @@ -(void)updateBar } - if (!reverseDirection_) { - if(!vertexData_) { - vertexDataCount_ = 4; - vertexData_ = malloc(vertexDataCount_ * sizeof(ccV2F_C4B_T2F)); - NSAssert( vertexData_, @"CCProgressTimer. Not enough memory"); + if (!_reverseDirection) { + if(!_vertexData) { + _vertexDataCount = 4; + _vertexData = malloc(_vertexDataCount * sizeof(ccV2F_C4B_T2F)); + NSAssert( _vertexData, @"CCProgressTimer. Not enough memory"); } // TOPLEFT - vertexData_[0].texCoords = [self textureCoordFromAlphaPoint:ccp(min.x,max.y)]; - vertexData_[0].vertices = [self vertexFromAlphaPoint:ccp(min.x,max.y)]; + _vertexData[0].texCoords = [self textureCoordFromAlphaPoint:ccp(min.x,max.y)]; + _vertexData[0].vertices = [self vertexFromAlphaPoint:ccp(min.x,max.y)]; // BOTLEFT - vertexData_[1].texCoords = [self textureCoordFromAlphaPoint:ccp(min.x,min.y)]; - vertexData_[1].vertices = [self vertexFromAlphaPoint:ccp(min.x,min.y)]; + _vertexData[1].texCoords = [self textureCoordFromAlphaPoint:ccp(min.x,min.y)]; + _vertexData[1].vertices = [self vertexFromAlphaPoint:ccp(min.x,min.y)]; // TOPRIGHT - vertexData_[2].texCoords = [self textureCoordFromAlphaPoint:ccp(max.x,max.y)]; - vertexData_[2].vertices = [self vertexFromAlphaPoint:ccp(max.x,max.y)]; + _vertexData[2].texCoords = [self textureCoordFromAlphaPoint:ccp(max.x,max.y)]; + _vertexData[2].vertices = [self vertexFromAlphaPoint:ccp(max.x,max.y)]; // BOTRIGHT - vertexData_[3].texCoords = [self textureCoordFromAlphaPoint:ccp(max.x,min.y)]; - vertexData_[3].vertices = [self vertexFromAlphaPoint:ccp(max.x,min.y)]; + _vertexData[3].texCoords = [self textureCoordFromAlphaPoint:ccp(max.x,min.y)]; + _vertexData[3].vertices = [self vertexFromAlphaPoint:ccp(max.x,min.y)]; } else { - if(!vertexData_) { - vertexDataCount_ = 8; - vertexData_ = malloc(vertexDataCount_ * sizeof(ccV2F_C4B_T2F)); - NSAssert( vertexData_, @"CCProgressTimer. Not enough memory"); + if(!_vertexData) { + _vertexDataCount = 8; + _vertexData = malloc(_vertexDataCount * sizeof(ccV2F_C4B_T2F)); + NSAssert( _vertexData, @"CCProgressTimer. Not enough memory"); // TOPLEFT 1 - vertexData_[0].texCoords = [self textureCoordFromAlphaPoint:ccp(0,1)]; - vertexData_[0].vertices = [self vertexFromAlphaPoint:ccp(0,1)]; + _vertexData[0].texCoords = [self textureCoordFromAlphaPoint:ccp(0,1)]; + _vertexData[0].vertices = [self vertexFromAlphaPoint:ccp(0,1)]; // BOTLEFT 1 - vertexData_[1].texCoords = [self textureCoordFromAlphaPoint:ccp(0,0)]; - vertexData_[1].vertices = [self vertexFromAlphaPoint:ccp(0,0)]; + _vertexData[1].texCoords = [self textureCoordFromAlphaPoint:ccp(0,0)]; + _vertexData[1].vertices = [self vertexFromAlphaPoint:ccp(0,0)]; // TOPRIGHT 2 - vertexData_[6].texCoords = [self textureCoordFromAlphaPoint:ccp(1,1)]; - vertexData_[6].vertices = [self vertexFromAlphaPoint:ccp(1,1)]; + _vertexData[6].texCoords = [self textureCoordFromAlphaPoint:ccp(1,1)]; + _vertexData[6].vertices = [self vertexFromAlphaPoint:ccp(1,1)]; // BOTRIGHT 2 - vertexData_[7].texCoords = [self textureCoordFromAlphaPoint:ccp(1,0)]; - vertexData_[7].vertices = [self vertexFromAlphaPoint:ccp(1,0)]; + _vertexData[7].texCoords = [self textureCoordFromAlphaPoint:ccp(1,0)]; + _vertexData[7].vertices = [self vertexFromAlphaPoint:ccp(1,0)]; } // TOPRIGHT 1 - vertexData_[2].texCoords = [self textureCoordFromAlphaPoint:ccp(min.x,max.y)]; - vertexData_[2].vertices = [self vertexFromAlphaPoint:ccp(min.x,max.y)]; + _vertexData[2].texCoords = [self textureCoordFromAlphaPoint:ccp(min.x,max.y)]; + _vertexData[2].vertices = [self vertexFromAlphaPoint:ccp(min.x,max.y)]; // BOTRIGHT 1 - vertexData_[3].texCoords = [self textureCoordFromAlphaPoint:ccp(min.x,min.y)]; - vertexData_[3].vertices = [self vertexFromAlphaPoint:ccp(min.x,min.y)]; + _vertexData[3].texCoords = [self textureCoordFromAlphaPoint:ccp(min.x,min.y)]; + _vertexData[3].vertices = [self vertexFromAlphaPoint:ccp(min.x,min.y)]; // TOPLEFT 2 - vertexData_[4].texCoords = [self textureCoordFromAlphaPoint:ccp(max.x,max.y)]; - vertexData_[4].vertices = [self vertexFromAlphaPoint:ccp(max.x,max.y)]; + _vertexData[4].texCoords = [self textureCoordFromAlphaPoint:ccp(max.x,max.y)]; + _vertexData[4].vertices = [self vertexFromAlphaPoint:ccp(max.x,max.y)]; // BOTLEFT 2 - vertexData_[5].texCoords = [self textureCoordFromAlphaPoint:ccp(max.x,min.y)]; - vertexData_[5].vertices = [self vertexFromAlphaPoint:ccp(max.x,min.y)]; + _vertexData[5].texCoords = [self textureCoordFromAlphaPoint:ccp(max.x,min.y)]; + _vertexData[5].vertices = [self vertexFromAlphaPoint:ccp(max.x,min.y)]; } [self updateColor]; } @@ -488,7 +487,7 @@ -(void)updateBar -(CGPoint)boundaryTexCoord:(char)index { if (index < kProgressTextureCoordsCount) { - if (reverseDirection_) { + if (_reverseDirection) { return ccp((kCCProgressTextureCoords>>(7-(index<<1)))&1,(kCCProgressTextureCoords>>(7-((index<<1)+1)))&1); } else { return ccp((kCCProgressTextureCoords>>((index<<1)+1))&1,(kCCProgressTextureCoords>>(index<<1))&1); @@ -499,35 +498,35 @@ -(CGPoint)boundaryTexCoord:(char)index -(void) draw { - if( ! vertexData_ || ! sprite_) + if( ! _vertexData || ! _sprite) return; CC_NODE_DRAW_SETUP(); - ccGLBlendFunc( sprite_.blendFunc.src, sprite_.blendFunc.dst ); + ccGLBlendFunc( _sprite.blendFunc.src, _sprite.blendFunc.dst ); ccGLEnableVertexAttribs(kCCVertexAttribFlag_PosColorTex ); - ccGLBindTexture2D( sprite_.texture.name ); + ccGLBindTexture2D( _sprite.texture.name ); - glVertexAttribPointer( kCCVertexAttrib_Position, 2, GL_FLOAT, GL_FALSE, sizeof(vertexData_[0]) , &vertexData_[0].vertices); - glVertexAttribPointer( kCCVertexAttrib_TexCoords, 2, GL_FLOAT, GL_FALSE, sizeof(vertexData_[0]), &vertexData_[0].texCoords); - glVertexAttribPointer( kCCVertexAttrib_Color, 4, GL_UNSIGNED_BYTE, GL_TRUE, sizeof(vertexData_[0]), &vertexData_[0].colors); + glVertexAttribPointer( kCCVertexAttrib_Position, 2, GL_FLOAT, GL_FALSE, sizeof(_vertexData[0]) , &_vertexData[0].vertices); + glVertexAttribPointer( kCCVertexAttrib_TexCoords, 2, GL_FLOAT, GL_FALSE, sizeof(_vertexData[0]), &_vertexData[0].texCoords); + glVertexAttribPointer( kCCVertexAttrib_Color, 4, GL_UNSIGNED_BYTE, GL_TRUE, sizeof(_vertexData[0]), &_vertexData[0].colors); - if(type_ == kCCProgressTimerTypeRadial) + if(_type == kCCProgressTimerTypeRadial) { - glDrawArrays(GL_TRIANGLE_FAN, 0, vertexDataCount_); + glDrawArrays(GL_TRIANGLE_FAN, 0, _vertexDataCount); } - else if (type_ == kCCProgressTimerTypeBar) + else if (_type == kCCProgressTimerTypeBar) { - if (!reverseDirection_) + if (!_reverseDirection) { - glDrawArrays(GL_TRIANGLE_STRIP, 0, vertexDataCount_); + glDrawArrays(GL_TRIANGLE_STRIP, 0, _vertexDataCount); } else { - glDrawArrays(GL_TRIANGLE_STRIP, 0, vertexDataCount_/2); - glDrawArrays(GL_TRIANGLE_STRIP, 4, vertexDataCount_/2); + glDrawArrays(GL_TRIANGLE_STRIP, 0, _vertexDataCount/2); + glDrawArrays(GL_TRIANGLE_STRIP, 4, _vertexDataCount/2); // 2 draw calls CC_INCREMENT_GL_DRAWS(1); diff --git a/cocos2d/CCProtocols.h b/cocos2d/CCProtocols.h new file mode 100644 index 0000000..b2cb9f3 --- /dev/null +++ b/cocos2d/CCProtocols.h @@ -0,0 +1,159 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2008-2010 Ricardo Quesada + * Copyright (c) 2011 Zynga Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#import "ccMacros.h" +#import "ccTypes.h" + + +@class CCTexture2D; +@class CCDirector; + +#pragma mark - CCRGBAProtocol + +/// CC RGBA protocol +@protocol CCRGBAProtocol +/** sets and returns the color (tint) + @since v0.8 + */ +@property (nonatomic) ccColor3B color; +/** returns the displayed color */ +@property (nonatomic, readonly) ccColor3B displayedColor; +/** whether or not color should be propagated to its children */ +@property (nonatomic, getter = isCascadeColorEnabled) BOOL cascadeColorEnabled; + +/** recursive method that updates display color */ +- (void)updateDisplayedColor:(ccColor3B)color; + +/** sets and returns the opacity. + @warning If the the texture has premultiplied alpha then, the R, G and B channels will be modified. + Values goes from 0 to 255, where 255 means fully opaque. + */ +@property (nonatomic) GLubyte opacity; +/** returns the displayed opacity */ +@property (nonatomic, readonly) GLubyte displayedOpacity; +/** whether or not opacity should be propagated to its children */ +@property (nonatomic, getter = isCascadeOpacityEnabled) BOOL cascadeOpacityEnabled; + +/** recursive method that updates the displayed opacity */ +- (void)updateDisplayedOpacity:(GLubyte)opacity; + +@optional +/** sets the premultipliedAlphaOpacity property. + If set to NO then opacity will be applied as: glColor(R,G,B,opacity); + If set to YES then opacity will be applied as: glColor(opacity, opacity, opacity, opacity ); + Textures with premultiplied alpha will have this property by default on YES. Otherwise the default value is NO + @since v0.8 + */ +-(void) setOpacityModifyRGB:(BOOL)boolean; +/** returns whether or not the opacity will be applied using glColor(R,G,B,opacity) or glColor(opacity, opacity, opacity, opacity); + @since v0.8 + */ + -(BOOL) doesOpacityModifyRGB; +@end + +#pragma mark - CCBlendProtocol +/** + You can specify the blending function. + @since v0.99.0 + */ +@protocol CCBlendProtocol +/** set the source blending function for the texture */ +-(void) setBlendFunc:(ccBlendFunc)blendFunc; +/** returns the blending function used for the texture */ +-(ccBlendFunc) blendFunc; +@end + + +#pragma mark - CCTextureProtocol + +/** CCNode objects that uses a Texture2D to render the images. + The texture can have a blending function. + If the texture has alpha premultiplied the default blending function is: + src=GL_ONE dst= GL_ONE_MINUS_SRC_ALPHA + else + src=GL_SRC_ALPHA dst= GL_ONE_MINUS_SRC_ALPHA + But you can change the blending function at any time. + @since v0.8.0 + */ +@protocol CCTextureProtocol +/** returns the used texture */ +-(CCTexture2D*) texture; +/** sets a new texture. it will be retained */ +-(void) setTexture:(CCTexture2D*)texture; +@end + +#pragma mark - CCLabelProtocol +/** Common interface for Labels */ +@protocol CCLabelProtocol +/** sets a new label using an NSString. + The string will be copied. + */ +-(void) setString:(NSString*)label; +/** returns the string that is rendered */ +-(NSString*) string; +@optional +/** sets a new label using a CString. + @since v0.99.0 + */ +-(void) setCString:(char*)label; +@end + + +#pragma mark - CCDirectorDelegate +/** CCDirector delegate */ +@protocol CCDirectorDelegate + +@optional +/** Called by CCDirector when the projection is updated, and "custom" projection is used */ +-(void) updateProjection; + +#ifdef __CC_PLATFORM_IOS +/** Returns a Boolean value indicating whether the CCDirector supports the specified orientation. Default value is YES (supports all possible orientations) */ +- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation; + +// Commented. See issue #1453 for further info: http://code.google.com/p/cocos2d-iphone/issues/detail?id=1453 +//- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration; + +/** Called when projection is resized (due to layoutSubviews on the view). This is important to respond to in order to setup your scene with the proper dimensions (which only exist after the first call to layoutSubviews) so that you can set your scene as early as possible to avoid startup flicker + */ +-(void) directorDidReshapeProjection:(CCDirector*)director; + +#endif // __CC_PLATFORM_IOS + +@end + + +#pragma mark - CCAccelerometerDelegate + +#ifdef __CC_PLATFORM_IOS +/** CCAccelerometerDelegate delegate */ +@class UIAcceleration; +@class UIAccelerometer; +@protocol CCAccelerometerDelegate + +@optional +- (void)accelerometer:(UIAccelerometer *)accelerometer didAccelerate:(UIAcceleration *)acceleration; +@end +#endif // __CC_PLATFORM_IOS diff --git a/cocos2d/CCRenderTexture.h b/cocos2d/CCRenderTexture.h new file mode 100644 index 0000000..f6fd8a7 --- /dev/null +++ b/cocos2d/CCRenderTexture.h @@ -0,0 +1,163 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2009 Jason Booth + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + */ + +#import + +#import "ccMacros.h" +#import "CCNode.h" +#import "CCSprite.h" +#import "Support/OpenGL_Internal.h" + +#pragma clang diagnostic push COCOS2D +#pragma clang diagnostic ignored "-Wignored-qualifiers" +#import "kazmath/mat4.h" +#pragma clang diagnostic pop COCOS2D + +#ifdef __CC_PLATFORM_IOS +#import +#endif // iPHone + +typedef enum +{ + kCCImageFormatJPEG = 0, + kCCImageFormatPNG = 1, +} tCCImageFormat; + + +/** + CCRenderTexture is a generic rendering target. To render things into it, + simply construct a render target, call begin on it, call visit on any cocos2d + scenes or objects to render them, and call end. For convenience, render texture + adds a sprite as its display child with the results, so you can simply add + the render texture to your scene and treat it like any other CCNode. + There are also functions for saving the render texture to disk in PNG or JPG format. + + @since v0.8.1 + */ +@interface CCRenderTexture : CCNode +{ + GLuint _FBO; + GLuint _depthRenderBufffer; + GLint _oldFBO; + CCTexture2D* _texture; + CCSprite* _sprite; + GLenum _pixelFormat; + + // code for "auto" update + GLbitfield _clearFlags; + ccColor4F _clearColor; + GLclampf _clearDepth; + GLint _clearStencil; + BOOL _autoDraw; +} + +/** The CCSprite being used. + The sprite, by default, will use the following blending function: GL_ONE, GL_ONE_MINUS_SRC_ALPHA. + The blending function can be changed in runtime by calling: + - [[renderTexture sprite] setBlendFunc:(ccBlendFunc){GL_ONE, GL_ONE_MINUS_SRC_ALPHA}]; +*/ +@property (nonatomic,readwrite, strong) CCSprite* sprite; + +/** Valid flags: GL_COLOR_BUFFER_BIT, GL_DEPTH_BUFFER_BIT, GL_STENCIL_BUFFER_BIT. They can be OR'ed. Valid when "autoDraw is YES. */ +@property (nonatomic, readwrite) GLbitfield clearFlags; +/** Clear color value. Valid only when "autoDraw" is YES. */ +@property (nonatomic, readwrite) ccColor4F clearColor; +/** Value for clearDepth. Valid only when autoDraw is YES. */ +@property (nonatomic, readwrite) GLclampf clearDepth; +/** Value for clear Stencil. Valid only when autoDraw is YES */ +@property (nonatomic, readwrite) GLint clearStencil; +/** When enabled, it will render its children into the texture automatically. Disabled by default for compatiblity reasons. + Will be enabled in the future. + */ +@property (nonatomic, readwrite) BOOL autoDraw; + + +/** initializes a RenderTexture object with width and height in Points and a pixel format( only RGB and RGBA formats are valid ) and depthStencil format*/ ++(id)renderTextureWithWidth:(int)w height:(int)h pixelFormat:(CCTexture2DPixelFormat) format depthStencilFormat:(GLuint)depthStencilFormat; + +/** creates a RenderTexture object with width and height in Points and a pixel format, only RGB and RGBA formats are valid */ ++(id)renderTextureWithWidth:(int)w height:(int)h pixelFormat:(CCTexture2DPixelFormat) format; + +/** creates a RenderTexture object with width and height in Points, pixel format is RGBA8888 */ ++(id)renderTextureWithWidth:(int)w height:(int)h; + +/** initializes a RenderTexture object with width and height in Points and a pixel format, only RGB and RGBA formats are valid */ +-(id)initWithWidth:(int)w height:(int)h pixelFormat:(CCTexture2DPixelFormat) format; + +/** initializes a RenderTexture object with width and height in Points and a pixel format( only RGB and RGBA formats are valid ) and depthStencil format*/ +- (id)initWithWidth:(int)w height:(int)h pixelFormat:(CCTexture2DPixelFormat)format depthStencilFormat:(GLuint)depthStencilFormat; + +/** starts grabbing */ +-(void)begin; + +/** starts rendering to the texture while clearing the texture first. + This is more efficient then calling -clear first and then -begin */ +-(void)beginWithClear:(float)r g:(float)g b:(float)b a:(float)a; + +/** starts rendering to the texture while clearing the texture first. + This is more efficient then calling -clear first and then -begin */ +- (void)beginWithClear:(float)r g:(float)g b:(float)b a:(float)a depth:(float)depthValue; + +/** starts rendering to the texture while clearing the texture first. + This is more efficient then calling -clear first and then -begin */ +- (void)beginWithClear:(float)r g:(float)g b:(float)b a:(float)a depth:(float)depthValue stencil:(int)stencilValue; + + +/** ends grabbing */ +-(void)end; + +/** clears the texture with a color */ +-(void)clear:(float)r g:(float)g b:(float)b a:(float)a; + +/** clears the texture with a specified depth value */ +- (void)clearDepth:(float)depthValue; + +/** clears the texture with a specified stencil value */ +- (void)clearStencil:(int)stencilValue; + +/* creates a new CGImage from with the texture's data. + Caller is responsible for releasing it by calling CGImageRelease(). + */ +-(CGImageRef) newCGImage; + +/** saves the texture into a file using JPEG format. The file will be saved in the Documents folder. + Returns YES if the operation is successful. + */ +-(BOOL)saveToFile:(NSString*)name; + +/** saves the texture into a file. The format could be JPG or PNG. The file will be saved in the Documents folder. + Returns YES if the operation is successful. + */ +-(BOOL)saveToFile:(NSString*)name format:(tCCImageFormat)format; + +#ifdef __CC_PLATFORM_IOS + +/* returns an autoreleased UIImage from the texture */ +-(UIImage *) getUIImage; + +#endif // __CC_PLATFORM_IOS + +@end + diff --git a/src/cocos2d/CCRenderTexture.m b/cocos2d/CCRenderTexture.m similarity index 58% rename from src/cocos2d/CCRenderTexture.m rename to cocos2d/CCRenderTexture.m index 1c349d8..24b7932 100644 --- a/src/cocos2d/CCRenderTexture.m +++ b/cocos2d/CCRenderTexture.m @@ -31,33 +31,39 @@ #import "CCConfiguration.h" #import "Support/ccUtils.h" #import "Support/CCFileUtils.h" +#import "Support/CGPointExtension.h" +#import "CCGrid.h" -#if __CC_PLATFORM_MAC +#if defined (__CC_PLATFORM_MAC) #import #endif // extern #import "kazmath/GL/matrix.h" -#import "CCRenderTargetNode.h" @implementation CCRenderTexture -@synthesize sprite=sprite_; +@synthesize sprite=_sprite; +@synthesize autoDraw=_autoDraw; +@synthesize clearColor=_clearColor; +@synthesize clearDepth=_clearDepth; +@synthesize clearStencil=_clearStencil; +@synthesize clearFlags=_clearFlags; +(id)renderTextureWithWidth:(int)w height:(int)h pixelFormat:(CCTexture2DPixelFormat) format depthStencilFormat:(GLuint)depthStencilFormat { - return [[[self alloc] initWithWidth:w height:h pixelFormat:format depthStencilFormat:depthStencilFormat] autorelease]; + return [[self alloc] initWithWidth:w height:h pixelFormat:format depthStencilFormat:depthStencilFormat]; } // issue #994 +(id)renderTextureWithWidth:(int)w height:(int)h pixelFormat:(CCTexture2DPixelFormat) format { - return [[[self alloc] initWithWidth:w height:h pixelFormat:format] autorelease]; + return [[self alloc] initWithWidth:w height:h pixelFormat:format]; } +(id)renderTextureWithWidth:(int)w height:(int)h { - return [[[self alloc] initWithWidth:w height:h pixelFormat:kCCTexture2DPixelFormat_RGBA8888 depthStencilFormat:0] autorelease]; + return [[self alloc] initWithWidth:w height:h pixelFormat:kCCTexture2DPixelFormat_RGBA8888 depthStencilFormat:0]; } -(id)initWithWidth:(int)w height:(int)h @@ -67,7 +73,7 @@ -(id)initWithWidth:(int)w height:(int)h - (id)initWithWidth:(int)w height:(int)h pixelFormat:(CCTexture2DPixelFormat)format { - return [self initWithWidth:w height:h pixelFormat:format depthStencilFormat:0]; + return [self initWithWidth:w height:h pixelFormat:format depthStencilFormat:0]; } -(id)initWithWidth:(int)w height:(int)h pixelFormat:(CCTexture2DPixelFormat) format depthStencilFormat:(GLuint)depthStencilFormat @@ -86,7 +92,7 @@ -(id)initWithWidth:(int)w height:(int)h pixelFormat:(CCTexture2DPixelFormat) for w *= CC_CONTENT_SCALE_FACTOR(); h *= CC_CONTENT_SCALE_FACTOR(); - glGetIntegerv(GL_FRAMEBUFFER_BINDING, &oldFBO_); + glGetIntegerv(GL_FRAMEBUFFER_BINDING, &_oldFBO); // textures must be power of two NSUInteger powW; @@ -102,174 +108,162 @@ -(id)initWithWidth:(int)w height:(int)h pixelFormat:(CCTexture2DPixelFormat) for void *data = malloc((int)(powW * powH * 4)); memset(data, 0, (int)(powW * powH * 4)); - pixelFormat_=format; + _pixelFormat=format; - texture_ = [[CCTexture2D alloc] initWithData:data pixelFormat:pixelFormat_ pixelsWide:powW pixelsHigh:powH contentSize:CGSizeMake(w, h)]; + _texture = [[CCTexture2D alloc] initWithData:data pixelFormat:_pixelFormat pixelsWide:powW pixelsHigh:powH contentSize:CGSizeMake(w, h)]; free( data ); GLint oldRBO; glGetIntegerv(GL_RENDERBUFFER_BINDING, &oldRBO); // generate FBO - glGenFramebuffers(1, &fbo_); - glBindFramebuffer(GL_FRAMEBUFFER, fbo_); + glGenFramebuffers(1, &_FBO); + glBindFramebuffer(GL_FRAMEBUFFER, _FBO); // associate texture with FBO - glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, texture_.name, 0); + glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, _texture.name, 0); if (depthStencilFormat != 0) { //create and attach depth buffer - glGenRenderbuffers(1, &depthRenderBufffer_); - glBindRenderbuffer(GL_RENDERBUFFER, depthRenderBufffer_); + glGenRenderbuffers(1, &_depthRenderBufffer); + glBindRenderbuffer(GL_RENDERBUFFER, _depthRenderBufffer); glRenderbufferStorage(GL_RENDERBUFFER, depthStencilFormat, (GLsizei)powW, (GLsizei)powH); - glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, depthRenderBufffer_); + glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, _depthRenderBufffer); // if depth format is the one with stencil part, bind same render buffer as stencil attachment - if (depthStencilFormat == CC_GL_DEPTH24_STENCIL8) - glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, GL_RENDERBUFFER, depthRenderBufffer_); + if (depthStencilFormat == GL_DEPTH24_STENCIL8) + glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, GL_RENDERBUFFER, _depthRenderBufffer); } // check if it worked (probably worth doing :) ) NSAssert( glCheckFramebufferStatus(GL_FRAMEBUFFER) == GL_FRAMEBUFFER_COMPLETE, @"Could not attach texture to framebuffer"); - [texture_ setAliasTexParameters]; + [_texture setAliasTexParameters]; - sprite_ = [CCSprite spriteWithTexture:texture_]; + // retained + self.sprite = [CCSprite spriteWithTexture:_texture]; - [texture_ release]; - [sprite_ setScaleY:-1]; - [self addChild:sprite_]; + [_sprite setScaleY:-1]; // issue #937 - [sprite_ setBlendFunc:(ccBlendFunc){GL_ONE, GL_ONE_MINUS_SRC_ALPHA}]; + [_sprite setBlendFunc:(ccBlendFunc){GL_ONE, GL_ONE_MINUS_SRC_ALPHA}]; + // issue #1464 + [_sprite setOpacityModifyRGB:YES]; glBindRenderbuffer(GL_RENDERBUFFER, oldRBO); - glBindFramebuffer(GL_FRAMEBUFFER, oldFBO_); + glBindFramebuffer(GL_FRAMEBUFFER, _oldFBO); + + // Diabled by default. + _autoDraw = NO; + + // add sprite for backward compatibility + [self addChild:_sprite]; } return self; } -(void)dealloc { - glDeleteFramebuffers(1, &fbo_); - if (depthRenderBufffer_) - glDeleteRenderbuffers(1, &depthRenderBufffer_); + glDeleteFramebuffers(1, &_FBO); + if (_depthRenderBufffer) + glDeleteRenderbuffers(1, &_depthRenderBufffer); - [super dealloc]; -} - -- (CCRenderTargetNode *)renderTargetNode -{ - if (!renderTargetNode_) { - renderTargetNode_ = [[CCRenderTargetNode alloc] initWithRenderTexture:self]; - [self addChild:renderTargetNode_]; - [renderTargetNode_ release]; - } - return renderTargetNode_; } -(void)begin { - kmGLMatrixMode(KM_GL_PROJECTION); - kmGLPushMatrix(); - kmGLMatrixMode(KM_GL_MODELVIEW); - kmGLPushMatrix(); + kmGLMatrixMode(KM_GL_PROJECTION); + kmGLPushMatrix(); + kmGLMatrixMode(KM_GL_MODELVIEW); + kmGLPushMatrix(); CCDirector *director = [CCDirector sharedDirector]; [director setProjection:director.projection]; - CGSize texSize = [texture_ contentSizeInPixels]; - - + CGSize texSize = [_texture contentSizeInPixels]; + + // Calculate the adjustment ratios based on the old and new projections CGSize size = [director winSizeInPixels]; float widthRatio = size.width / texSize.width; float heightRatio = size.height / texSize.height; - - + + // Adjust the orthographic projection and viewport glViewport(0, 0, texSize.width, texSize.height ); - + kmMat4 orthoMatrix; kmMat4OrthographicProjection(&orthoMatrix, (float)-1.0 / widthRatio, (float)1.0 / widthRatio, (float)-1.0 / heightRatio, (float)1.0 / heightRatio, -1,1 ); kmGLMultMatrix(&orthoMatrix); - - glGetIntegerv(GL_FRAMEBUFFER_BINDING, &oldFBO_); - glBindFramebuffer(GL_FRAMEBUFFER, fbo_); + + glGetIntegerv(GL_FRAMEBUFFER_BINDING, &_oldFBO); + glBindFramebuffer(GL_FRAMEBUFFER, _FBO); } --(void)beginWithClear:(float)r g:(float)g b:(float)b a:(float)a +-(void)beginWithClear:(float)r g:(float)g b:(float)b a:(float)a depth:(float)depthValue stencil:(int)stencilValue flags:(GLbitfield)flags { [self begin]; - + // save clear color GLfloat clearColor[4]; - glGetFloatv(GL_COLOR_CLEAR_VALUE,clearColor); - - glClearColor(r, g, b, a); - glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + GLfloat depthClearValue = 0.0; + int stencilClearValue = 0; + + if(flags & GL_COLOR_BUFFER_BIT) { + glGetFloatv(GL_COLOR_CLEAR_VALUE,clearColor); + glClearColor(r, g, b, a); + } + + if( flags & GL_DEPTH_BUFFER_BIT ) { + glGetFloatv(GL_DEPTH_CLEAR_VALUE, &depthClearValue); + glClearDepth(depthValue); + } + + if( flags & GL_STENCIL_BUFFER_BIT ) { + glGetIntegerv(GL_STENCIL_CLEAR_VALUE, &stencilClearValue); + glClearStencil(stencilValue); + } + + glClear(flags); + + + // restore + if( flags & GL_COLOR_BUFFER_BIT) + glClearColor(clearColor[0], clearColor[1], clearColor[2], clearColor[3]); + if( flags & GL_DEPTH_BUFFER_BIT) + glClearDepth(depthClearValue); + if( flags & GL_STENCIL_BUFFER_BIT) + glClearStencil(stencilClearValue); +} - // restore clear color - glClearColor(clearColor[0], clearColor[1], clearColor[2], clearColor[3]); +-(void)beginWithClear:(float)r g:(float)g b:(float)b a:(float)a +{ + [self beginWithClear:r g:g b:b a:a depth:0 stencil:0 flags:GL_COLOR_BUFFER_BIT]; } -(void)beginWithClear:(float)r g:(float)g b:(float)b a:(float)a depth:(float)depthValue { - [self begin]; - - // save clear color - GLfloat clearColor[4]; - GLfloat depthClearValue; - glGetFloatv(GL_COLOR_CLEAR_VALUE,clearColor); - glGetFloatv(GL_DEPTH_CLEAR_VALUE, &depthClearValue); - - glClearColor(r, g, b, a); - glClearDepth(depthValue); - glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - - // restore clear color - glClearColor(clearColor[0], clearColor[1], clearColor[2], clearColor[3]); - glClearDepth(depthClearValue); + [self beginWithClear:r g:g b:b a:a depth:depthValue stencil:0 flags:GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT]; } - -(void)beginWithClear:(float)r g:(float)g b:(float)b a:(float)a depth:(float)depthValue stencil:(int)stencilValue { - [self begin]; - - // save clear color - GLfloat clearColor[4]; - GLfloat depthClearValue; - int stencilClearValue; - glGetFloatv(GL_COLOR_CLEAR_VALUE,clearColor); - glGetFloatv(GL_DEPTH_CLEAR_VALUE, &depthClearValue); - glGetIntegerv(GL_STENCIL_CLEAR_VALUE, &stencilClearValue); - - glClearColor(r, g, b, a); - glClearDepth(depthValue); - glClearStencil(stencilValue); - glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); - - // restore clear color - glClearColor(clearColor[0], clearColor[1], clearColor[2], clearColor[3]); - glClearDepth(depthClearValue); - glClearStencil(stencilClearValue); + [self beginWithClear:r g:g b:b a:a depth:depthValue stencil:stencilValue flags:GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT|GL_STENCIL_BUFFER_BIT]; } -(void)end { CCDirector *director = [CCDirector sharedDirector]; - glBindFramebuffer(GL_FRAMEBUFFER, oldFBO_); - CGSize size = [director winSizeInPixels]; - + glBindFramebuffer(GL_FRAMEBUFFER, _oldFBO); + // restore viewport - glViewport(0, 0, size.width, size.height ); + [director setViewport]; - kmGLMatrixMode(KM_GL_PROJECTION); - kmGLPopMatrix(); - kmGLMatrixMode(KM_GL_MODELVIEW); - kmGLPopMatrix(); + kmGLMatrixMode(KM_GL_PROJECTION); + kmGLPopMatrix(); + kmGLMatrixMode(KM_GL_MODELVIEW); + kmGLPopMatrix(); } -(void)clear:(float)r g:(float)g b:(float)b a:(float)a @@ -280,40 +274,122 @@ -(void)clear:(float)r g:(float)g b:(float)b a:(float)a - (void)clearDepth:(float)depthValue { - [self begin]; - //! save old depth value - GLfloat depthClearValue; - glGetFloatv(GL_DEPTH_CLEAR_VALUE, &depthClearValue); - - glClearDepth(depthValue); - glClear(GL_DEPTH_BUFFER_BIT); - - // restore clear color - glClearDepth(depthClearValue); - [self end]; + [self begin]; + //! save old depth value + GLfloat depthClearValue; + glGetFloatv(GL_DEPTH_CLEAR_VALUE, &depthClearValue); + + glClearDepth(depthValue); + glClear(GL_DEPTH_BUFFER_BIT); + + // restore clear color + glClearDepth(depthClearValue); + [self end]; } - (void)clearStencil:(int)stencilValue { - // save old stencil value - int stencilClearValue; - glGetIntegerv(GL_STENCIL_CLEAR_VALUE, &stencilClearValue); - - glClearStencil(stencilValue); - glClear(GL_STENCIL_BUFFER_BIT); - - // restore clear color - glClearStencil(stencilClearValue); + // save old stencil value + int stencilClearValue; + glGetIntegerv(GL_STENCIL_CLEAR_VALUE, &stencilClearValue); + + glClearStencil(stencilValue); + glClear(GL_STENCIL_BUFFER_BIT); + + // restore clear color + glClearStencil(stencilClearValue); +} + +#pragma mark RenderTexture - "auto" update + +- (void)visit +{ + // override visit. + // Don't call visit on its children + if (!_visible) + return; + + kmGLPushMatrix(); + + if (_grid && _grid.active) { + [_grid beforeDraw]; + [self transformAncestors]; + } + + [self transform]; + [_sprite visit]; + [self draw]; + + if (_grid && _grid.active) + [_grid afterDraw:self]; + + kmGLPopMatrix(); + + _orderOfArrival = 0; +} + +- (void)draw +{ + if( _autoDraw) { + + [self begin]; + + if (_clearFlags) { + + GLfloat oldClearColor[4]; + GLfloat oldDepthClearValue = 0.0; + GLint oldStencilClearValue = 0; + + // backup and set + if( _clearFlags & GL_COLOR_BUFFER_BIT ) { + glGetFloatv(GL_COLOR_CLEAR_VALUE, oldClearColor); + glClearColor(_clearColor.r, _clearColor.g, _clearColor.b, _clearColor.a); + } + + if( _clearFlags & GL_DEPTH_BUFFER_BIT ) { + glGetFloatv(GL_DEPTH_CLEAR_VALUE, &oldDepthClearValue); + glClearDepth(_clearDepth); + } + + if( _clearFlags & GL_STENCIL_BUFFER_BIT ) { + glGetIntegerv(GL_STENCIL_CLEAR_VALUE, &oldStencilClearValue); + glClearStencil(_clearStencil); + } + + // clear + glClear(_clearFlags); + + // restore + if( _clearFlags & GL_COLOR_BUFFER_BIT ) + glClearColor(oldClearColor[0], oldClearColor[1], oldClearColor[2], oldClearColor[3]); + if( _clearFlags & GL_DEPTH_BUFFER_BIT ) + glClearDepth(oldDepthClearValue); + if( _clearFlags & GL_STENCIL_BUFFER_BIT ) + glClearStencil(oldStencilClearValue); + } + + //! make sure all children are drawn + [self sortAllChildren]; + + for (CCNode *child in _children) { + if( child != _sprite) + [child visit]; + } + [self end]; + + } + +// [_sprite visit]; } #pragma mark RenderTexture - Save Image -(CGImageRef) newCGImage { - NSAssert(pixelFormat_ == kCCTexture2DPixelFormat_RGBA8888,@"only RGBA8888 can be saved as image"); + NSAssert(_pixelFormat == kCCTexture2DPixelFormat_RGBA8888,@"only RGBA8888 can be saved as image"); - CGSize s = [texture_ contentSizeInPixels]; + CGSize s = [_texture contentSizeInPixels]; int tx = s.width; int ty = s.height; @@ -343,7 +419,7 @@ -(CGImageRef) newCGImage // make data provider with data. - CGBitmapInfo bitmapInfo = kCGImageAlphaPremultipliedLast | kCGBitmapByteOrderDefault; + CGBitmapInfo bitmapInfo = (CGBitmapInfo)(kCGImageAlphaPremultipliedLast | kCGBitmapByteOrderDefault); CGDataProviderRef provider = CGDataProviderCreateWithData(NULL, buffer, myDataLength, NULL); CGColorSpaceRef colorSpaceRef = CGColorSpaceCreateDeviceRGB(); CGImageRef iref = CGImageCreate(tx, ty, @@ -365,8 +441,8 @@ -(CGImageRef) newCGImage CGContextDrawImage(context, CGRectMake(0.0f, 0.0f, tx, ty), iref); CGImageRef image = CGBitmapContextCreateImage(context); - CGImageRelease(iref); CGContextRelease(context); + CGImageRelease(iref); CGColorSpaceRelease(colorSpaceRef); CGDataProviderRelease(provider); @@ -394,28 +470,27 @@ -(BOOL)saveToFile:(NSString*)fileName format:(tCCImageFormat)format return NO; } -#if __CC_PLATFORM_IOS +#if defined(__CC_PLATFORM_IOS) UIImage* image = [[UIImage alloc] initWithCGImage:imageRef scale:CC_CONTENT_SCALE_FACTOR() orientation:UIImageOrientationUp]; - NSData *imageData; - + NSData *imageData = nil; + if( format == kCCImageFormatPNG ) imageData = UIImagePNGRepresentation( image ); - + else if( format == kCCImageFormatJPEG ) imageData = UIImageJPEGRepresentation(image, 0.9f); - + else NSAssert(NO, @"Unsupported format"); - [image release]; - + success = [imageData writeToFile:fullPath atomically:YES]; -#elif __CC_PLATFORM_MAC +#elif defined(__CC_PLATFORM_MAC) - CFURLRef url = (CFURLRef)[NSURL fileURLWithPath:fullPath]; + CFURLRef url = (__bridge CFURLRef)[NSURL fileURLWithPath:fullPath]; CGImageDestinationRef dest; @@ -444,17 +519,30 @@ -(BOOL)saveToFile:(NSString*)fileName format:(tCCImageFormat)format } -#if __CC_PLATFORM_IOS +#if defined(__CC_PLATFORM_IOS) -(UIImage *) getUIImage { CGImageRef imageRef = [self newCGImage]; UIImage* image = [[UIImage alloc] initWithCGImage:imageRef scale:CC_CONTENT_SCALE_FACTOR() orientation:UIImageOrientationUp]; - + CGImageRelease( imageRef ); - - return [image autorelease]; + + return image; } #endif // __CC_PLATFORM_IOS + +#pragma RenderTexture - Override + +-(CGSize) contentSize +{ + return _texture.contentSize; +} + +-(void) setContentSize:(CGSize)size +{ + NSAssert(NO, @"You cannot change the content size of an already created CCRenderTexture. Recreate it"); +} + @end diff --git a/cocos2d/CCResponder.h b/cocos2d/CCResponder.h new file mode 100644 index 0000000..8298dbb --- /dev/null +++ b/cocos2d/CCResponder.h @@ -0,0 +1,46 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2010 Ricardo Quesada + * Copyright (c) 2011 Zynga Inc. + * Copyright (c) 2013 Lars Birkemose + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * + * File autogenerated with Xcode. Adapted for cocos2d needs. + */ + +#import +#import "CCResponderManager.h" + +// ----------------------------------------------------------------- +/** + * CCResponder is the base class for all nodes. + * It exposes the touch and mouse protocol to any node, which enables user interaction + */ +@interface CCResponder : NSObject + +// ----------------------------------------------------------------- + +- (id)init; + +// ----------------------------------------------------------------- + +@end diff --git a/cocos2d/CCResponder.m b/cocos2d/CCResponder.m new file mode 100644 index 0000000..9ab7680 --- /dev/null +++ b/cocos2d/CCResponder.m @@ -0,0 +1,158 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2010 Ricardo Quesada + * Copyright (c) 2011 Zynga Inc. + * Copyright (c) 2013 Lars Birkemose + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * + * File autogenerated with Xcode. Adapted for cocos2d needs. + */ + +#import "CCResponder.h" +#import "CCDirector.h" + +// ----------------------------------------------------------------- + +@implementation CCResponder +{ + +} + +// ----------------------------------------------------------------- +/** + * Creates a new CCResponder instance + * + * @return CCResponder + * @since v2.5 + */ +- (id)init +{ + self = [super init]; + NSAssert(self, @"Unable to create class"); + + // initialize + + // done + return(self); +} + +// ----------------------------------------------------------------- + +#if ( TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR ) + +/** + * Touch callbacks + * If these functions are not overridden by a responder, the event will not be flagged as being processed, and thus be sent to next responder + * Likewise a responder can call the super callback, and force the event to next responder + * + * @param touches A NSSet of touches, associated with the callback + * @param event The event associated with the callback + */ +- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event +{ + CCResponderManager *strongResponderManager = [CCDirector sharedDirector].responderManager; + strongResponderManager.eventProcessed = NO; +} + +- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event +{ + CCResponderManager *strongResponderManager = [CCDirector sharedDirector].responderManager; + strongResponderManager.eventProcessed = NO; +} + +- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event +{ + CCResponderManager *strongResponderManager = [CCDirector sharedDirector].responderManager; + strongResponderManager.eventProcessed = NO; +} + +- (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event +{ + CCResponderManager *strongResponderManager = [CCDirector sharedDirector].responderManager; + strongResponderManager.eventProcessed = NO; +} + +// ----------------------------------------------------------------- + +#else +/** + * Mouse callbacks + * If these functions are not overridden by a responder, the event will not be flagged as being processed, and thus be sent to next responder + * Likewise a responder can call the super callback, and force the event to next responder + * + * @param theEvent The event associated with the mouse callback + */ +- (void)mouseDown:(NSEvent *)theEvent +{ + [CCDirector sharedDirector].responderManager.eventProcessed = NO; +} + +- (void)mouseDragged:(NSEvent *)theEvent +{ + [CCDirector sharedDirector].responderManager.eventProcessed = NO; +} + +- (void)mouseUp:(NSEvent *)theEvent +{ + [CCDirector sharedDirector].responderManager.eventProcessed = NO; +} + +- (void)rightMouseDown:(NSEvent *)theEvent +{ + [CCDirector sharedDirector].responderManager.eventProcessed = NO; +} + +- (void)rightMouseDragged:(NSEvent *)theEvent +{ + [CCDirector sharedDirector].responderManager.eventProcessed = NO; +} + +- (void)rightMouseUp:(NSEvent *)theEvent +{ + [CCDirector sharedDirector].responderManager.eventProcessed = NO; +} + +- (void)otherMouseDown:(NSEvent *)theEvent +{ + [CCDirector sharedDirector].responderManager.eventProcessed = NO; +} + +- (void)otherMouseDragged:(NSEvent *)theEvent +{ + [CCDirector sharedDirector].responderManager.eventProcessed = NO; +} + +- (void)otherMouseUp:(NSEvent *)theEvent +{ + [CCDirector sharedDirector].responderManager.eventProcessed = NO; +} + +- (void)scrollWheel:(NSEvent *)theEvent +{ + [CCDirector sharedDirector].responderManager.eventProcessed = NO; +} + +#endif + +// ----------------------------------------------------------------- + +@end diff --git a/cocos2d/CCResponderManager.h b/cocos2d/CCResponderManager.h new file mode 100644 index 0000000..d8cdd0d --- /dev/null +++ b/cocos2d/CCResponderManager.h @@ -0,0 +1,178 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2010 Ricardo Quesada + * Copyright (c) 2011 Zynga Inc. + * Copyright (c) 2013 Lars Birkemose + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * + * File autogenerated with Xcode. Adapted for cocos2d needs. + */ + +// TODO: Add circular touch detection +// TODO: support expand / contract touch area +// TODO: Grab mouse and touch by implementing onPressed, onReleased, onClicked + +#import + +#if TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR + +// ----------------------------------------------------------------- +#pragma mark - iOS +// ----------------------------------------------------------------- + +#import +#import "Platforms/iOS/CCResponderManager.h" + +@interface CCRunningResponder : NSObject + +@property (nonatomic, strong) id target; // the target associated with the touch +@property (nonatomic, weak) UITouch *touch; // the current touch ( should not be retained ) +@property (nonatomic, weak) UIEvent *event; // the current event ( should not be retained ) + +@end + +#else + +// ----------------------------------------------------------------- +#pragma mark - Mac +// ----------------------------------------------------------------- + +#import + +#define RESPONDER NSResponder + +typedef enum +{ + CCMouseButtonLeft, + CCMouseButtonRight, + CCMouseButtonOther, +} CCMouseButton; + +@protocol CCResponderProtocol + +@optional +- (void)mouseDown:(NSEvent *)theEvent; +- (void)mouseDragged:(NSEvent *)theEvent; +- (void)mouseUp:(NSEvent *)theEvent; +- (void)rightMouseDown:(NSEvent *)theEvent; +- (void)rightMouseDragged:(NSEvent *)theEvent; +- (void)rightMouseUp:(NSEvent *)theEvent; +- (void)otherMouseDown:(NSEvent *)theEvent; +- (void)otherMouseDragged:(NSEvent *)theEvent; +- (void)otherMouseUp:(NSEvent *)theEvent; +- (void)scrollWheel:(NSEvent *)theEvent; + +- (void)mouseMoved:(NSEvent *)theEvent; +- (void)mouseEntered:(NSEvent *)theEvent; +- (void)mouseExited:(NSEvent *)theEvent; + +@end + +// ----------------------------------------------------------------- + +@interface CCRunningResponder : NSObject + +@property (nonatomic, strong) id target; // the target associated with the mouse event +@property (nonatomic, assign) CCMouseButton button; // button of the current event + +@end + +#endif + +// ----------------------------------------------------------------- +#pragma mark - Both +// ----------------------------------------------------------------- + +@class CCNode; + +// ----------------------------------------------------------------- + +enum +{ + CCResponderManagerBufferSize = 128, +}; + +// ----------------------------------------------------------------- + +@interface CCResponderManager : RESPONDER + +// ----------------------------------------------------------------- + +@property (nonatomic) BOOL eventProcessed; // event was processed + +// ----------------------------------------------------------------- + ++ (CCResponderManager*)responderManager; +- (id)init; + +- (void)addResponder:(CCNode *)responder; +- (void)removeAllResponders; +- (void)markAsDirty; + +- (CCNode *)nodeAtPoint:(CGPoint)pos; +- (NSArray *)nodesAtPoint:(CGPoint)pos; + +// ----------------------------------------------------------------- + +@end + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/cocos2d/CCResponderManager.m b/cocos2d/CCResponderManager.m new file mode 100644 index 0000000..c6d7386 --- /dev/null +++ b/cocos2d/CCResponderManager.m @@ -0,0 +1,701 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2010 Ricardo Quesada + * Copyright (c) 2011 Zynga Inc. + * Copyright (c) 2013 Lars Birkemose + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * + * File autogenerated with Xcode. Adapted for cocos2d needs. + */ + +#import "CCResponderManager.h" +#import "CCNode.h" +#import "CCDirector.h" +#import "CCDirectorMac.h" +#import "CCScene.h" + +// ----------------------------------------------------------------- +#pragma mark - +// ----------------------------------------------------------------- + +@implementation CCRunningResponder + +@end + +// ----------------------------------------------------------------- +#pragma mark - +// ----------------------------------------------------------------- + +@implementation CCResponderManager +{ + __weak CCNode *_responderList[CCResponderManagerBufferSize]; // list of active responders + int _responderListCount; // number of active responders + BOOL _dirty; // list of responders should be rebuild + + NSMutableArray *_runningResponderList; // list of running responders +} + +// ----------------------------------------------------------------- +#pragma mark - create and destroy +// ----------------------------------------------------------------- + ++ (id)responderManager +{ + return([[self alloc] init]); +} + +- (id)init +{ + self = [super init]; + NSAssert(self, @"Unable to create class"); + + // initalize + _runningResponderList = [NSMutableArray array]; + // reset touch handling + [self removeAllResponders]; + _dirty = YES; + + // done + return(self); +} + +// ----------------------------------------------------------------- +#pragma mark - add and remove touch responders +// ----------------------------------------------------------------- + +- (void)buildResponderList +{ + // rebuild responder list + [self removeAllResponders]; + [self buildResponderList:[CCDirector sharedDirector].runningScene]; + _dirty = NO; +} + +-( void )buildResponderList:(CCNode *)node +{ + BOOL nodeAdded = NO; + + // dont add invisible nodes + if (!node.visible) return; + + if (node.children) + { + // scan through children, and build responderlist + for (CCNode *child in node.children) + { + if ((child.zOrder >= 0) && (!nodeAdded) && (node.isUserInteractionEnabled)) + { + [self addResponder:node]; + nodeAdded = YES; + } + [self buildResponderList:child]; + } + } + else + { + // only add self + if (node.isUserInteractionEnabled) [self addResponder:node]; + } +} + +// ----------------------------------------------------------------- + +- (void)addResponder:(CCNode *)responder +{ + _responderList[_responderListCount] = responder; + _responderListCount ++; + NSAssert(_responderListCount < CCResponderManagerBufferSize, @"Number of touchable nodes pr. scene can not exceed <%d>", CCResponderManagerBufferSize); +} + +- (void)removeAllResponders +{ + _responderListCount = 0; +} + +// ----------------------------------------------------------------- +#pragma mark - dirty +// ----------------------------------------------------------------- + +- (void)markAsDirty +{ + _dirty = YES; +} + +// ----------------------------------------------------------------- +#pragma mark - nodes at specific positions +// ----------------------------------------------------------------- + +- (CCNode *)nodeAtPoint:(CGPoint)pos +{ + if (_dirty) [self buildResponderList]; + + // scan backwards through touch responders + for (int index = _responderListCount - 1; index >= 0; index --) + { + CCNode *node = _responderList[index]; + + // check for hit test + if ([node hitTestWithWorldPos:pos]) + { + return(node); + } + } + // nothing found + return(nil); +} + +- (NSArray *)nodesAtPoint:(CGPoint)pos +{ + if (_dirty) [self buildResponderList]; + + NSMutableArray *result = [NSMutableArray array]; + // scan backwards through touch responders + for (int index = _responderListCount - 1; index >= 0; index --) + { + CCNode *node = _responderList[index]; + + // check for hit test + if ([node hitTestWithWorldPos:pos]) + { + [result addObject:node]; + } + } + // if nothing was found, an empty array will be returned + return(result); +} + +// ----------------------------------------------------------------- +#pragma mark - iOS touch handling - +// ----------------------------------------------------------------- + +#if TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR + +- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event +{ + BOOL responderCanAcceptTouch; + + if (_dirty) [self buildResponderList]; + + // go through all touches + for (UITouch *touch in touches) + { + CGPoint worldTouchLocation = [[CCDirector sharedDirector] convertToGL:[touch locationInView:[CCDirector sharedDirector].view]]; + + // scan backwards through touch responders + for (int index = _responderListCount - 1; index >= 0; index --) + { + CCNode *node = _responderList[index]; + + // check for hit test + if ([node hitTestWithWorldPos:worldTouchLocation]) + { + // if not a multi touch node, check if node already is being touched + responderCanAcceptTouch = YES; + if (!node.isMultipleTouchEnabled) + { + // scan current touch objects, and break if object already has a touch + for (CCRunningResponder *responderEntry in _runningResponderList) + { + if (responderEntry.target == node) + { + responderCanAcceptTouch = NO; + break; + } + } + } + if (!responderCanAcceptTouch) break; + + // begin the touch + self.eventProcessed = YES; + if ([node respondsToSelector:@selector(touchesBegan:withEvent:)]) + [node touchesBegan:[NSSet setWithObject:touch] withEvent:event]; + + // if touch was processed, add it and break + if (self.eventProcessed) + { + [self addResponder:node withTouch:touch andEvent:event]; + break; + } + } + } + } +} + +// ----------------------------------------------------------------- + +- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event +{ + if (_dirty) [self buildResponderList]; + + // go through all touches + for (UITouch *touch in touches) + { + // get touch object + CCRunningResponder *touchEntry = [self responderForTouch:touch]; + + // if a touch object was found + if (touchEntry) + { + CCNode *node = (CCNode *)touchEntry.target; + + // check if it locks touches + if (node.claimsUserInteraction) + { + // move the touch + if ([node respondsToSelector:@selector(touchesMoved:withEvent:)]) + [node touchesMoved:[NSSet setWithObject:touch] withEvent:event]; + } + else + { + // as node does not lock touch, check if it was moved outside + if (![node hitTestWithWorldPos:[[CCDirector sharedDirector] convertToGL:[touch locationInView:[CCDirector sharedDirector].view]]]) + { + // cancel the touch + if ([node respondsToSelector:@selector(touchesCancelled:withEvent:)]) + [node touchesCancelled:[NSSet setWithObject:touch] withEvent:event]; + // remove from list + [_runningResponderList removeObject:touchEntry]; + } + else + { + // move the touch + if ([node respondsToSelector:@selector(touchesMoved:withEvent:)]) + [node touchesMoved:[NSSet setWithObject:touch] withEvent:event]; + } + } + } + else + { + // scan backwards through touch responders + for (int index = _responderListCount - 1; index >= 0; index --) + { + CCNode *node = _responderList[index]; + + // if the touch responder does not lock touch, it will receive a touchesBegan if a touch is moved inside + if (!node.claimsUserInteraction && [node hitTestWithWorldPos:[[CCDirector sharedDirector] convertToGL:[touch locationInView:[CCDirector sharedDirector].view ]]]) + { + // begin the touch + self.eventProcessed = YES; + if ([node respondsToSelector:@selector(touchesBegan:withEvent:)]) + [node touchesBegan:[NSSet setWithObject:touch] withEvent:event]; + + // if touch was accepted, add it and break + if (self.eventProcessed) + { + [self addResponder:node withTouch:touch andEvent:event]; + break; + } + } + } + } + } +} + +// ----------------------------------------------------------------- + +- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event +{ + if (_dirty) [self buildResponderList]; + + // go through all touches + for (UITouch *touch in touches) + { + // get touch object + CCRunningResponder *touchEntry = [self responderForTouch:touch]; + + if (touchEntry) + { + CCNode *node = (CCNode *)touchEntry.target; + + // end the touch + if ([node respondsToSelector:@selector(touchesEnded:withEvent:)]) + [node touchesEnded:[NSSet setWithObject:touch] withEvent:event]; + // remove from list + [_runningResponderList removeObject:touchEntry]; + } + } +} + +// ----------------------------------------------------------------- + +- (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event +{ + if (_dirty) [self buildResponderList]; + + // go through all touches + for (UITouch *touch in touches) + { + // get touch object + CCRunningResponder *touchEntry = [self responderForTouch:touch]; + + if (touchEntry) + { + CCNode *node = (CCNode *)touchEntry.target; + + // cancel the touch + if ([node respondsToSelector:@selector(touchesCancelled:withEvent:)]) + [node touchesCancelled:[NSSet setWithObject:touch] withEvent:event]; + // remove from list + [_runningResponderList removeObject:touchEntry]; + } + } +} + +// ----------------------------------------------------------------- +#pragma mark - iOS helper functions +// ----------------------------------------------------------------- +// finds a responder object for a touch + +- (CCRunningResponder *)responderForTouch:(UITouch *)touch +{ + for (CCRunningResponder *touchEntry in _runningResponderList) + { + if (touchEntry.touch == touch) return(touchEntry); + } + return(nil); +} + +// ----------------------------------------------------------------- +// adds a responder object ( running responder ) to the responder object list + +- (void)addResponder:(CCNode *)node withTouch:(UITouch *)touch andEvent:(UIEvent *)event +{ + CCRunningResponder *touchEntry; + + // create a new touch object + touchEntry = [[CCRunningResponder alloc] init]; + touchEntry.target = node; + touchEntry.touch = touch; + touchEntry.event = event; + [_runningResponderList addObject:touchEntry]; +} + +// ----------------------------------------------------------------- + +#else + +// ----------------------------------------------------------------- +#pragma mark - Mac mouse handling - +// ----------------------------------------------------------------- + +- (void)mouseDown:(NSEvent *)theEvent button:(CCMouseButton)button +{ + NSAssert(![self responderForButton:button], @"Unexpected Mouse State"); + + if (_dirty) [self buildResponderList]; + + // scan backwards through mouse responders + for (int index = _responderListCount - 1; index >= 0; index --) + { + CCNode *node = _responderList[index]; + + // check for hit test + if ([node hitTestWithWorldPos:[[CCDirector sharedDirector] convertEventToGL:theEvent]]) + { + // begin the mouse down + self.eventProcessed = YES; + switch (button) + { + case CCMouseButtonLeft: if ([node respondsToSelector:@selector(mouseDown:)]) [node mouseDown:theEvent]; break; + case CCMouseButtonRight: if ([node respondsToSelector:@selector(rightMouseDown:)]) [node rightMouseDown:theEvent]; break; + case CCMouseButtonOther: if ([node respondsToSelector:@selector(otherMouseDown:)]) [node otherMouseDown:theEvent]; break; + } + + // if mouse was processed, remember it and break + if (self.eventProcessed) + { + [self addResponder:node withButton:button]; + break; + } + } + } +} + +// TODO: Should all mouse buttons call mouseDragged? +// As it is now, only mouseDragged gets called if several buttons are pressed + +- (void)mouseDragged:(NSEvent *)theEvent button:(CCMouseButton)button +{ + if (_dirty) [self buildResponderList]; + + CCRunningResponder *responder = [self responderForButton:button]; + + if (responder) + { + CCNode *node = (CCNode *)responder.target; + + // check if it locks mouse + if (node.claimsUserInteraction) + { + // move the mouse + switch (button) + { + case CCMouseButtonLeft: if ([node respondsToSelector:@selector(mouseDragged:)]) [node mouseDragged:theEvent]; break; + case CCMouseButtonRight: if ([node respondsToSelector:@selector(rightMouseDragged:)]) [node rightMouseDragged:theEvent]; break; + case CCMouseButtonOther: if ([node respondsToSelector:@selector(otherMouseDragged:)]) [node otherMouseDragged:theEvent]; break; + } + } + else + { + // as node does not lock mouse, check if it was moved outside + if (![node hitTestWithWorldPos:[[CCDirector sharedDirector] convertEventToGL:theEvent]]) + { + [_runningResponderList removeObject:responder]; + } + else + { + // move the mouse + switch (button) + { + case CCMouseButtonLeft: if ([node respondsToSelector:@selector(mouseDragged:)]) [node mouseDragged:theEvent]; break; + case CCMouseButtonRight: if ([node respondsToSelector:@selector(rightMouseDragged:)]) [node rightMouseDragged:theEvent]; break; + case CCMouseButtonOther: if ([node respondsToSelector:@selector(otherMouseDragged:)]) [node otherMouseDragged:theEvent]; break; + } + } + } + } + else + { + // scan backwards through mouse responders + for (int index = _responderListCount - 1; index >= 0; index --) + { + CCNode *node = _responderList[index]; + + // if the mouse responder does not lock mouse, it will receive a mouseDown if mouse is moved inside + if (!node.claimsUserInteraction && [node hitTestWithWorldPos:[[CCDirector sharedDirector] convertEventToGL:theEvent]]) + { + // begin the mouse down + self.eventProcessed = YES; + switch (button) + { + case CCMouseButtonLeft: if ([node respondsToSelector:@selector(mouseDown:)]) [node mouseDown:theEvent]; break; + case CCMouseButtonRight: if ([node respondsToSelector:@selector(rightMouseDown:)]) [node rightMouseDown:theEvent]; break; + case CCMouseButtonOther: if ([node respondsToSelector:@selector(otherMouseDown:)]) [node otherMouseDown:theEvent]; break; + } + + // if mouse was accepted, add it and break + if (self.eventProcessed) + { + [self addResponder:node withButton:button]; + break; + } + } + } + } +} + +- (void)mouseUp:(NSEvent *)theEvent button:(CCMouseButton)button +{ + if (_dirty) [self buildResponderList]; + + CCRunningResponder *responder = [self responderForButton:button]; + if (responder) + { + CCNode *node = (CCNode *)responder.target; + + // end the mouse + switch (button) + { + case CCMouseButtonLeft: if ([node respondsToSelector:@selector(mouseUp:)]) [node mouseUp:theEvent]; break; + case CCMouseButtonRight: if ([node respondsToSelector:@selector(rightMouseUp:)]) [node rightMouseUp:theEvent]; break; + case CCMouseButtonOther: if ([node respondsToSelector:@selector(otherMouseUp:)]) [node otherMouseUp:theEvent]; break; + } + // remove + [_runningResponderList removeObject:responder]; + } +} + +// ----------------------------------------------------------------- + +- (void)mouseDown:(NSEvent *)theEvent +{ + [self mouseDown:theEvent button:CCMouseButtonLeft]; +} + +- (void)mouseDragged:(NSEvent *)theEvent +{ + [self mouseDragged:theEvent button:CCMouseButtonLeft]; +} + +- (void)mouseUp:(NSEvent *)theEvent +{ + [self mouseUp:theEvent button:CCMouseButtonLeft]; +} + +- (void)rightMouseDown:(NSEvent *)theEvent +{ + [self mouseDown:theEvent button:CCMouseButtonRight]; +} + +- (void)rightMouseDragged:(NSEvent *)theEvent +{ + [self mouseDragged:theEvent button:CCMouseButtonRight]; +} + +- (void)rightMouseUp:(NSEvent *)theEvent +{ + [self mouseUp:theEvent button:CCMouseButtonRight]; +} + +- (void)otherMouseDown:(NSEvent *)theEvent +{ + [self mouseDown:theEvent button:CCMouseButtonOther]; +} + +- (void)otherMouseDragged:(NSEvent *)theEvent +{ + [self mouseDragged:theEvent button:CCMouseButtonOther]; +} + +- (void)otherMouseUp:(NSEvent *)theEvent +{ + [self mouseUp:theEvent button:CCMouseButtonOther]; +} + +- (void)scrollWheel:(NSEvent *)theEvent +{ + if (_dirty) [self buildResponderList]; + + // if otherMouse is active, scrollWheel goes to that node + // otherwise, scrollWheel goes to the node under the cursor + CCRunningResponder *responder = [self responderForButton:CCMouseButtonOther]; + + if (responder) + { + CCNode *node = (CCNode *)responder.target; + + self.eventProcessed = YES; + if ([node respondsToSelector:@selector(scrollWheel:)]) [node scrollWheel:theEvent]; + + // if mouse was accepted, return + if (self.eventProcessed) return; + } + + // scan through responders, and find first one + for (int index = _responderListCount - 1; index >= 0; index --) + { + CCNode *node = _responderList[index]; + + // check for hit test + if ([node hitTestWithWorldPos:[[CCDirector sharedDirector] convertEventToGL:theEvent]]) + { + self.eventProcessed = YES; + if ([node respondsToSelector:@selector(scrollWheel:)]) [node scrollWheel:theEvent]; + + // if mouse was accepted, break + if (self.eventProcessed) break; + } + } +} + +/** Moved, Entered and Exited is not supported + @since v2.5 + */ + +- (void)mouseMoved:(NSEvent *)theEvent +{ + +} + +- (void)mouseEntered:(NSEvent *)theEvent +{ + +} + +- (void)mouseExited:(NSEvent *)theEvent +{ + +} + +// ----------------------------------------------------------------- +#pragma mark - Mac helper functions +// ----------------------------------------------------------------- +// finds a responder object for an event + +- (CCRunningResponder *)responderForButton:(CCMouseButton)button +{ + for (CCRunningResponder *touchEntry in _runningResponderList) + { + if (touchEntry.button == button) return(touchEntry); + } + return(nil); +} + +// ----------------------------------------------------------------- +// adds a responder object ( running responder ) to the responder object list + +- (void)addResponder:(CCNode *)node withButton:(CCMouseButton)button +{ + CCRunningResponder *touchEntry; + + // create a new touch object + touchEntry = [[CCRunningResponder alloc] init]; + touchEntry.target = node; + touchEntry.button = button; + [_runningResponderList addObject:touchEntry]; +} + +// ----------------------------------------------------------------- + +#endif + +// ----------------------------------------------------------------- + +@end + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/cocos2d/CCScene.h b/cocos2d/CCScene.h new file mode 100644 index 0000000..d820c81 --- /dev/null +++ b/cocos2d/CCScene.h @@ -0,0 +1,47 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2008-2010 Ricardo Quesada + * Copyright (c) 2011 Zynga Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + */ + + +#import "CCNode.h" + +/** CCScene is a subclass of CCNode that is used only as an abstract concept. + + CCScene an CCNode are almost identical with the difference that CCScene has its + anchor point (by default) at the center of the screen. + + For the moment CCScene has no other logic than that, but in future releases it might have + additional logic. + + It is a good practice to use and CCScene as the parent of all your nodes. +*/ +@interface CCScene : CCNode + +/** initializes a node. + The node will be created as "autorelease". + */ +-(id) init; + +@end diff --git a/cocos2d/CCScene.m b/cocos2d/CCScene.m new file mode 100644 index 0000000..2ab2b7d --- /dev/null +++ b/cocos2d/CCScene.m @@ -0,0 +1,101 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2008-2010 Ricardo Quesada + * Copyright (c) 2011 Zynga Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + */ + + +#import "CCScene.h" +#import "Support/CGPointExtension.h" +#import "CCDirector.h" + + +@implementation CCScene { + +} + +// ----------------------------------------------------------------- + +-( id )init { + self = [ super init ]; + NSAssert( self != nil, @"Unable to create class" ); + + CGSize s = [[CCDirector sharedDirector] winSize]; + _anchorPoint = ccp(0.0f, 0.0f); + [self setContentSize:s]; + + return( self ); +} + +// ----------------------------------------------------------------- + +@end + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/cocos2d/CCScheduler.h b/cocos2d/CCScheduler.h new file mode 100644 index 0000000..b23db1b --- /dev/null +++ b/cocos2d/CCScheduler.h @@ -0,0 +1,284 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2008-2010 Ricardo Quesada + * Copyright (c) 2011 Zynga Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + + + +#import "Support/uthash.h" +#import "ccTypes.h" + +// Priority level reserved for system services. +#define kCCPrioritySystem INT_MIN + +// Minimum priority level for user scheduling. +#define kCCPriorityNonSystemMin (kCCPrioritySystem+1) + +typedef void (*TICK_IMP)(id, SEL, ccTime); + +// +// CCTimer +// +/** Light weight timer */ +@interface CCTimer : NSObject +{ + ccTime _interval; + ccTime _elapsed; + BOOL _runForever; + BOOL _useDelay; + uint _nTimesExecuted; + uint _repeat; //0 = once, 1 is 2 x executed + ccTime _delay; +} + +/** interval in seconds */ +@property (nonatomic,readwrite,assign) ccTime interval; + + +/** triggers the timer */ +-(void) update: (ccTime) dt; +@end + +@interface CCTimerTargetSelector : CCTimer +{ + id _target; + SEL _selector; + TICK_IMP _impMethod; +} + +/** selector */ +@property (nonatomic,readonly) SEL selector; + +/** Allocates a timer with a target and a selector. */ ++(id) timerWithTarget:(id) t selector:(SEL)s; + +/** Allocates a timer with a target, a selector and an interval in seconds. */ ++(id) timerWithTarget:(id) t selector:(SEL)s interval:(ccTime)seconds; + +/** Initializes a timer with a target and a selector. */ +-(id) initWithTarget:(id) t selector:(SEL)s; + +/** Initializes a timer with a target, a selector, an interval in seconds, repeat in number of times to repeat, delay in seconds */ +-(id) initWithTarget:(id)t selector:(SEL)s interval:(ccTime) seconds repeat:(uint) r delay:(ccTime) d; +@end + + +@interface CCTimerBlock : CCTimer +{ + void (^_block)(ccTime delta); + NSString *_key; + id __unsafe_unretained _target; +} + +/** unique identifier of the block */ +@property (nonatomic, readonly) NSString *key; + +/** owner of the timer */ +@property (nonatomic, readonly) id target; + +/** Allocates a timer with a target, interval in seconds, a key and a block */ ++(id) timerWithTarget:(id)owner interval:(ccTime)seconds key:(NSString*)key block:(void(^)(ccTime delta)) block; + +/** Initializes a timer with a target(owner), interval in seconds, repeat in number of times to repeat, delay in seconds and a block */ +-(id) initWithTarget:(id)owner interval:(ccTime) seconds repeat:(uint) r delay:(ccTime)d key:(NSString*)key block:(void(^)(ccTime delta))block; +@end + + +// +// CCScheduler +// +/** CCScheduler is responsible of triggering the scheduled callbacks. + You should not use NSTimer. Instead use this class. + + There are 2 different types of callbacks (selectors): + + - update selector: the 'update' selector will be called every frame. You can customize the priority. + - custom selector: A custom selector will be called every frame, or with a custom interval of time + + The 'custom selectors' should be avoided when possible. It is faster, and consumes less memory to use the 'update selector'. + +*/ + +struct _listEntry; +struct _hashSelectorEntry; +struct _hashUpdateEntry; + +@interface CCScheduler : NSObject +{ + ccTime _timeScale; + + // + // "updates with priority" stuff + // + struct _listEntry *updatesNeg; // list of priority < 0 + struct _listEntry *updates0; // list priority == 0 + struct _listEntry *updatesPos; // list priority > 0 + struct _hashUpdateEntry *hashForUpdates; // hash used to fetch quickly the list entries for pause,delete,etc. + + // Used for "selectors with interval" + struct _hashSelectorEntry *hashForTimers; + struct _hashSelectorEntry *currentTarget; + BOOL currentTargetSalvaged; + + // Optimization + TICK_IMP impMethod; + SEL updateSelector; + + BOOL updateHashLocked; // If true unschedule will not remove anything from a hash. Elements will only be marked for deletion. + + BOOL _paused; +} + +/** Modifies the time of all scheduled callbacks. + You can use this property to create a 'slow motion' or 'fast forward' effect. + Default is 1.0. To create a 'slow motion' effect, use values below 1.0. + To create a 'fast forward' effect, use values higher than 1.0. + @since v0.8 + @warning It will affect EVERY scheduled selector / action. + */ +@property (nonatomic,readwrite) ccTime timeScale; + + +/** Will pause / resume the CCScheduler. + It won't dispatch any message to any target/selector, block if it is paused. + + The difference between `pauseAllTargets` and `pause, is that `setPaused` will pause the CCScheduler, + while `pauseAllTargets` will pause all the targets, one by one. + `setPaused` will pause the whole Scheduler, meaning that calls to `resumeTargets:`, `resumeTarget:` won't affect it. + + @since v2.1.0 + */ +@property (nonatomic,readonly,getter=isPaused) BOOL paused; + +/** 'update' the scheduler. + You should NEVER call this method, unless you know what you are doing. + */ +-(void) update:(ccTime)dt; + +/** The scheduled method will be called every 'interval' seconds. + If paused is YES, then it won't be called until it is resumed. + If 'interval' is 0, it will be called every frame, but if so, it recommended to use 'scheduleUpdateForTarget:' instead. + If the selector is already scheduled, then only the interval parameter will be updated without re-scheduling it again. + repeat lets the action be repeated repeat + 1 times, use kCCRepeatForever to let the action run continuously + delay is the amount of time the action will wait before it'll start + + @since v0.99.3, repeat and delay added in v1.1 + */ +-(void) scheduleSelector:(SEL)selector forTarget:(id)target interval:(ccTime)interval repeat:(uint)repeat delay:(ccTime)delay paused:(BOOL)paused; + +/** calls scheduleSelector with kCCRepeatForever and a 0 delay */ +-(void) scheduleSelector:(SEL)selector forTarget:(id)target interval:(ccTime)interval paused:(BOOL)paused; + +/** Schedules the 'update' selector for a given target with a given priority. + The 'update' selector will be called every frame. + The lower the priority, the earlier it is called. + @since v0.99.3 + */ +-(void) scheduleUpdateForTarget:(id)target priority:(NSInteger)priority paused:(BOOL)paused; + +/** The scheduled block will be called every 'interval' seconds. + 'key' is a unique identifier of the block. Needed to unschedule the block or update its interval. + 'target' is needed for all the method related to "target" like "pause" and "unschedule" + If 'interval' is 0, it will be called every frame, but if so, it recommended to use 'scheduleUpdateForTarget:' instead. + 'repeat' lets the action be repeated repeat + 1 times, use kCCRepeatForever to let the action run continuously. + 'delay' is the amount of time the action will wait before it'll start. + If paused is YES, then it won't be called until it is resumed. + If the block is already scheduled, then only the interval parameter will be updated without re-scheduling it again. + @since v2.1 + */ +-(void) scheduleBlockForKey:(NSString*)key target:(id)target interval:(ccTime)interval repeat:(uint)repeat delay:(ccTime)delay paused:(BOOL)paused block:(void(^)(ccTime dt))block; + +/** Unshedules a selector for a given target. + If you want to unschedule the "update", use unscheudleUpdateForTarget. + @since v0.99.3 + */ +-(void) unscheduleSelector:(SEL)selector forTarget:(id)target; + +/** Unshedules a block for a given key / target pair. + If you want to unschedule the "update", use unscheudleUpdateForTarget. + @since v2.1 + */ +-(void) unscheduleBlockForKey:(NSString*)key target:(id)target; + +/** Unschedules the update selector for a given target + @since v0.99.3 + */ +-(void) unscheduleUpdateForTarget:(id)target; + +/** Unschedules all selectors and blocks for a given target. + This also includes the "update" selector. + @since v0.99.3 + */ +-(void) unscheduleAllForTarget:(id)target; + +/** Unschedules all selectors and blocks from all targets. + You should NEVER call this method, unless you know what you are doing. + + @since v0.99.3 + */ +-(void) unscheduleAll; + +/** Unschedules all selectors and blocks from all targets with a minimum priority. + You should only call this with kCCPriorityNonSystemMin or higher. + @since v2.0.0 + */ +-(void) unscheduleAllWithMinPriority:(NSInteger)minPriority; + +/** Pauses the target. + All scheduled selectors/update for a given target won't be 'ticked' until the target is resumed. + If the target is not present, nothing happens. + @since v0.99.3 + */ +-(void) pauseTarget:(id)target; + +/** Resumes the target. + The 'target' will be unpaused, so all schedule selectors/update will be 'ticked' again. + If the target is not present, nothing happens. + @since v0.99.3 + */ +-(void) resumeTarget:(id)target; + +/** Returns whether or not the target is paused + @since v1.0.0 + */ +-(BOOL) isTargetPaused:(id)target; + +/** Pause all selectors and blocks from all targets. + You should NEVER call this method, unless you know what you are doing. + @since v2.0.0 + */ +-(NSSet*) pauseAllTargets; + +/** Pause all selectors and blocks from all targets with a minimum priority. + You should only call this with kCCPriorityNonSystemMin or higher. + @since v2.0.0 + */ +-(NSSet*) pauseAllTargetsWithMinPriority:(NSInteger)minPriority; + +/** Resume selectors on a set of targets. + This can be useful for undoing a call to pauseAllSelectors. + @since v2.0.0 + */ +-(void) resumeTargets:(NSSet *)targetsToResume; + +@end diff --git a/src/cocos2d/CCScheduler.m b/cocos2d/CCScheduler.m similarity index 51% rename from src/cocos2d/CCScheduler.m rename to cocos2d/CCScheduler.m index f99e18a..4fcc270 100644 --- a/src/cocos2d/CCScheduler.m +++ b/cocos2d/CCScheduler.m @@ -30,7 +30,7 @@ #import "CCDirector.h" #import "Support/uthash.h" #import "Support/utlist.h" -#import "Support/ccCArray.h" +#import // // Data structures @@ -43,7 +43,7 @@ { struct _listEntry *prev, *next; TICK_IMP impMethod; - id target; // not retained (retained by hashUpdateEntry) + __unsafe_unretained id target; // not retained (retained by hashUpdateEntry) NSInteger priority; BOOL paused; BOOL markedForDeletion; // selector will no longer be called and entry will be removed at end of the next tick @@ -53,49 +53,133 @@ { tListEntry **list; // Which list does it belong to ? tListEntry *entry; // entry in the list - id target; // hash key (retained) + __unsafe_unretained id target; // hash key (retained) UT_hash_handle hh; } tHashUpdateEntry; // Hash Element used for "selectors with interval" typedef struct _hashSelectorEntry { - struct ccArray *timers; - id target; // hash key (retained) + __unsafe_unretained NSMutableArray *timers; + __unsafe_unretained id target; // hash key (retained) unsigned int timerIndex; - CCTimer *currentTimer; + __unsafe_unretained CCTimer *currentTimer; BOOL currentTimerSalvaged; BOOL paused; UT_hash_handle hh; -} tHashSelectorEntry; +} tHashTimerEntry; // // CCTimer // -#pragma mark - #pragma mark - CCTimer +@interface CCTimer () +-(void) setupTimerWithInterval:(ccTime)seconds repeat:(uint)r delay:(ccTime)d; +-(void) trigger; +-(void) cancel; +@end + @implementation CCTimer -@synthesize interval; +@synthesize interval=_interval; + +-(void) setupTimerWithInterval:(ccTime)seconds repeat:(uint)r delay:(ccTime)d +{ + _elapsed = -1; + _interval = seconds; + _delay = d; + _useDelay = (_delay > 0) ? YES : NO; + _repeat = r; + _runForever = (_repeat == kCCRepeatForever) ? YES : NO; +} + +-(void) dealloc +{ + CCLOGINFO(@"cocos2d: deallocing %@", self); + +} + +-(void) trigger +{ + // override me +} --(id) init +-(void) cancel { - NSAssert(NO, @"CCTimer: Init not supported."); - [self release]; - return nil; + // override me +} + +#pragma clang diagnostic push COCOS2D +#pragma clang diagnostic ignored "-Wfloat-equal" +-(void) update: (ccTime) dt +{ + if( _elapsed == - 1) + { + _elapsed = 0; + _nTimesExecuted = 0; + } + else + { + if (_runForever && !_useDelay) + {//standard timer usage + _elapsed += dt; + if( _elapsed >= _interval ) { + [self trigger]; + _elapsed = 0; + + } + } + else + {//advanced usage + _elapsed += dt; + if (_useDelay) + { + if( _elapsed >= _delay ) + { + [self trigger]; + _elapsed = _elapsed - _delay; + _nTimesExecuted+=1; + _useDelay = NO; + } + } + else + { + if (_elapsed >= _interval) + { + [self trigger]; + _elapsed = 0; + _nTimesExecuted += 1; + + } + } + + if (!_runForever && _nTimesExecuted > _repeat) + { //unschedule timer + [self cancel]; + } + } + } } +#pragma clang diagnostic pop COCOS2D +@end + +#pragma mark CCTimerTargetSelector + +@implementation CCTimerTargetSelector + +@synthesize selector=_selector; +(id) timerWithTarget:(id)t selector:(SEL)s { - return [[[self alloc] initWithTarget:t selector:s interval:0 repeat:kCCRepeatForever delay:0] autorelease]; + return [[self alloc] initWithTarget:t selector:s interval:0 repeat:kCCRepeatForever delay:0]; } +(id) timerWithTarget:(id)t selector:(SEL)s interval:(ccTime) i { - return [[[self alloc] initWithTarget:t selector:s interval:i repeat:kCCRepeatForever delay:0] autorelease]; + return [[self alloc] initWithTarget:t selector:s interval:i repeat:kCCRepeatForever delay:0]; } -(id) initWithTarget:(id)t selector:(SEL)s @@ -112,105 +196,99 @@ -(id) initWithTarget:(id)t selector:(SEL)s interval:(ccTime) seconds repeat:(uin #endif // target is not retained. It is retained in the hash structure - target = t; - selector = s; - impMethod = (TICK_IMP) [t methodForSelector:s]; - elapsed = -1; - interval = seconds; - repeat = r; - delay = d; - useDelay = (delay > 0) ? YES : NO; - repeat = r; - runForever = (repeat == kCCRepeatForever) ? YES : NO; + _target = t; + _selector = s; + _impMethod = (TICK_IMP) [t methodForSelector:s]; + + [self setupTimerWithInterval:seconds repeat:r delay:d]; } return self; } - - (NSString*) description { - return [NSString stringWithFormat:@"<%@ = %p | target:%@ selector:(%@)>", [self class], self, [target class], NSStringFromSelector(selector)]; + return [NSString stringWithFormat:@"<%@ = %p | target:%@ selector:(%@)>", [self class], self, [_target class], NSStringFromSelector(_selector)]; } --(void) dealloc +-(void) trigger { - CCLOGINFO(@"cocos2d: deallocing %@", self); - [super dealloc]; + _impMethod(_target, _selector, _elapsed); } --(void) update: (ccTime) dt +-(void) cancel { - if( elapsed == - 1) - { - elapsed = 0; - nTimesExecuted = 0; - } - else - { - if (runForever && !useDelay) - {//standard timer usage - elapsed += dt; - if( elapsed >= interval ) { - impMethod(target, selector, elapsed); - elapsed = 0; + [[[CCDirector sharedDirector] scheduler] unscheduleSelector:_selector forTarget:_target]; +} - } - } - else - {//advanced usage - elapsed += dt; - if (useDelay) - { - if( elapsed >= delay ) - { - impMethod(target, selector, elapsed); - elapsed = elapsed - delay; - nTimesExecuted+=1; - useDelay = NO; - } - } - else - { - if (elapsed >= interval) - { - impMethod(target, selector, elapsed); - elapsed = 0; - nTimesExecuted += 1; +@end - } - } +#pragma mark CCTimerBlock - if (nTimesExecuted > repeat) - { //unschedule timer - [[[CCDirector sharedDirector] scheduler] unscheduleSelector:selector forTarget:target]; - } - } +@implementation CCTimerBlock + +@synthesize key=_key; +@synthesize target=_target; + ++(id) timerWithTarget:(id)owner interval:(ccTime)seconds key:(NSString*)key block:(void(^)(ccTime delta)) block +{ + return [[self alloc] initWithTarget:(id)owner interval:seconds repeat:kCCRepeatForever delay:0 key:key block:block]; +} + +-(id) initWithTarget:(id)owner interval:(ccTime) seconds repeat:(uint) r delay:(ccTime)d key:(NSString*)key block:(void(^)(ccTime delta))block +{ + if( (self=[super init]) ) { + _block = [block copy]; + _key = [key copy]; + _target = owner; + + [self setupTimerWithInterval:seconds repeat:r delay:d]; } + + return self; +} + +- (NSString*) description +{ + return [NSString stringWithFormat:@"<%@ = %p | block>", [self class], self]; } + + +-(void) trigger +{ + _block( _elapsed); +} + +-(void) cancel +{ + [[[CCDirector sharedDirector] scheduler] unscheduleBlockForKey:_key target:_target]; +} + @end + + // // CCScheduler // -#pragma mark - #pragma mark - CCScheduler @interface CCScheduler (Private) --(void) removeHashElement:(tHashSelectorEntry*)element; +-(void) removeHashElement:(tHashTimerEntry*)element; @end @implementation CCScheduler -@synthesize timeScale = timeScale_; +@synthesize paused = _paused; +@synthesize timeScale = _timeScale; - (id) init { if( (self=[super init]) ) { - timeScale_ = 1.0f; + _timeScale = 1.0f; // used to trigger CCTimer#update updateSelector = @selector(update:); - impMethod = (TICK_IMP) [CCTimer instanceMethodForSelector:updateSelector]; + impMethod = (TICK_IMP) [CCTimerTargetSelector instanceMethodForSelector:updateSelector]; // updates with priority updates0 = NULL; @@ -221,8 +299,9 @@ - (id) init // selectors with interval currentTarget = nil; currentTargetSalvaged = NO; - hashForSelectors = nil; + hashForTimers = nil; updateHashLocked = NO; + _paused = NO; } return self; @@ -230,46 +309,50 @@ - (id) init - (NSString*) description { - return [NSString stringWithFormat:@"<%@ = %p | timeScale = %0.2f >", [self class], self, timeScale_]; + return [NSString stringWithFormat:@"<%@ = %p | timeScale = %0.2f >", [self class], self, _timeScale]; } - (void) dealloc { CCLOG(@"cocos2d: deallocing %@", self); - [self unscheduleAllSelectors]; + [self unscheduleAll]; - [super dealloc]; } -#pragma mark CCScheduler - Custom Selectors +#pragma mark CCScheduler - Timers --(void) removeHashElement:(tHashSelectorEntry*)element +-(void) removeHashElement:(tHashTimerEntry*)element { - ccArrayFree(element->timers); - [element->target release]; - HASH_DEL(hashForSelectors, element); + void* ti = (__bridge void*) element->timers; + CFRelease(ti); + void* ta = (__bridge void*) element->target; + CFRelease(ta); + + HASH_DEL(hashForTimers, element); free(element); } -(void) scheduleSelector:(SEL)selector forTarget:(id)target interval:(ccTime)interval paused:(BOOL)paused { - [self scheduleSelector:selector forTarget:target interval:interval paused:paused repeat:kCCRepeatForever delay:0.0f]; + [self scheduleSelector:selector forTarget:target interval:interval repeat:kCCRepeatForever delay:0.0f paused:paused]; } --(void) scheduleSelector:(SEL)selector forTarget:(id)target interval:(ccTime)interval paused:(BOOL)paused repeat:(uint) repeat delay:(ccTime) delay +-(void) scheduleSelector:(SEL)selector forTarget:(id)target interval:(ccTime)interval repeat:(uint)repeat delay:(ccTime)delay paused:(BOOL)paused { NSAssert( selector != nil, @"Argument selector must be non-nil"); NSAssert( target != nil, @"Argument target must be non-nil"); - tHashSelectorEntry *element = NULL; - HASH_FIND_INT(hashForSelectors, &target, element); + tHashTimerEntry *element = NULL; + void* t = (__bridge void*) target; + HASH_FIND_INT(hashForTimers, &t, element); if( ! element ) { element = calloc( sizeof( *element ), 1 ); - element->target = [target retain]; - HASH_ADD_INT( hashForSelectors, target, element ); + CFRetain(t); + element->target = target; + HASH_ADD_INT( hashForTimers, target, element ); // Is this the 1st element ? Then set the pause level to all the selectors of this target element->paused = paused; @@ -279,23 +362,70 @@ -(void) scheduleSelector:(SEL)selector forTarget:(id)target interval:(ccTime)int if( element->timers == nil ) - element->timers = ccArrayNew(10); + { + NSMutableArray* arr = [[NSMutableArray alloc] init]; + void* a = (__bridge void*) arr; + CFRetain(a); + element->timers = arr; + } else { - for( unsigned int i=0; i< element->timers->num; i++ ) { - CCTimer *timer = element->timers->arr[i]; - if( selector == timer->selector ) { - CCLOG(@"CCScheduler#scheduleSelector. Selector already scheduled. Updating interval from: %.4f to %.4f", timer->interval, interval); - timer->interval = interval; + for( unsigned int i=0; i< element->timers.count; i++ ) { + CCTimer *timer = [element->timers objectAtIndex:i]; + if( [timer isKindOfClass:[CCTimerTargetSelector class]] && selector == [(CCTimerTargetSelector*)timer selector] ) { + CCLOG(@"CCScheduler#scheduleSelector. Selector already scheduled. Updating interval from: %.4f to %.4f", [timer interval], interval); + [timer setInterval: interval]; return; } } - ccArrayEnsureExtraCapacity(element->timers, 1); } - CCTimer *timer = [[CCTimer alloc] initWithTarget:target selector:selector interval:interval repeat:repeat delay:delay]; - ccArrayAppendObject(element->timers, timer); - [timer release]; + CCTimerTargetSelector *timer = [[CCTimerTargetSelector alloc] initWithTarget:target selector:selector interval:interval repeat:repeat delay:delay]; + [element->timers addObject:timer]; +} + +-(void) scheduleBlockForKey:(NSString*)key target:(id)owner interval:(ccTime)interval repeat:(uint)repeat delay:(ccTime)delay paused:(BOOL)paused block:(void(^)(ccTime dt))block +{ + NSAssert( block != nil, @"Argument block must be non-nil"); + NSAssert( owner != nil, @"Argument owner must be non-nil"); + + tHashTimerEntry *element = NULL; + void* o = (__bridge void*) owner; + HASH_FIND_INT(hashForTimers, &o, element); + + if( ! element ) { + element = calloc( sizeof( *element ), 1 ); + element->target = owner; + HASH_ADD_INT( hashForTimers, target, element ); + + // Is this the 1st element ? Then set the pause level to all the selectors of this target + element->paused = paused; + + } else + NSAssert( element->paused == paused, @"CCScheduler. Trying to schedule a block with a pause value different than the target"); + + + if( element->timers == nil ) + { + NSMutableArray* arr = [[NSMutableArray alloc] init]; + void* a = (__bridge void*) arr; + CFRetain(a); + element->timers = arr; + } + else + { + for( unsigned int i=0; i< element->timers.count; i++ ) { + CCTimer *timer = [element->timers objectAtIndex:i]; + if( [timer isKindOfClass:[CCTimerBlock class]] && [key isEqualToString:[(CCTimerBlock*)timer key] ] ) { + CCLOG(@"CCScheduler#scheduleBlock. Block already scheduled. Updating interval from: %.4f to %.4f", [timer interval], interval); + [timer setInterval: interval]; + return; + } + } + } + + CCTimerBlock *timer = [[CCTimerBlock alloc] initWithTarget:owner interval:interval repeat:repeat delay:delay key:key block:block]; + [element->timers addObject:timer]; } -(void) unscheduleSelector:(SEL)selector forTarget:(id)target @@ -303,33 +433,84 @@ -(void) unscheduleSelector:(SEL)selector forTarget:(id)target // explicity handle nil arguments when removing an object if( target==nil && selector==NULL) return; - + NSAssert( target != nil, @"Target MUST not be nil"); NSAssert( selector != NULL, @"Selector MUST not be NULL"); + + tHashTimerEntry *element = NULL; + void* t = (__bridge void*)target; + HASH_FIND_INT(hashForTimers, &t, element); + + if( element ) { + + for( unsigned int i=0; i< element->timers.count; i++ ) { + CCTimer *timer = [element->timers objectAtIndex:i]; + + + if( [timer isKindOfClass:[CCTimerTargetSelector class]] && selector == [(CCTimerTargetSelector*)timer selector] ) { + + if( timer == element->currentTimer && !element->currentTimerSalvaged ) { + void* ct = (__bridge void*) element->currentTimer; + CFRetain(ct); + element->currentTimerSalvaged = YES; + } + + [element->timers removeObjectAtIndex:i]; + + // update timerIndex in case we are in tick:, looping over the actions + if( element->timerIndex >= i ) + element->timerIndex--; + + if( element->timers.count == 0 ) { + if( currentTarget == element ) + currentTargetSalvaged = YES; + else + [self removeHashElement: element]; + } + return; + } + } + } + + // Not Found + // NSLog(@"CCScheduler#unscheduleSelector:forTarget: selector not found: %@", selString); + +} - tHashSelectorEntry *element = NULL; - HASH_FIND_INT(hashForSelectors, &target, element); +-(void) unscheduleBlockForKey:(NSString*)key target:(id)target +{ + // explicity handle nil arguments when removing an object + if( target==nil && key==NULL) + return; + + NSAssert( target != nil, @"Target MUST not be nil"); + NSAssert( key != NULL, @"key MUST not be NULL"); + + tHashTimerEntry *element = NULL; + void* t = (__bridge void*) target; + HASH_FIND_INT(hashForTimers, &t, element); if( element ) { - for( unsigned int i=0; i< element->timers->num; i++ ) { - CCTimer *timer = element->timers->arr[i]; + for( unsigned int i=0; i< element->timers.count; i++ ) { + CCTimer *timer = [element->timers objectAtIndex:i]; - if( selector == timer->selector ) { + if( [timer isKindOfClass:[CCTimerBlock class]] && [key isEqualToString: [(CCTimerBlock*)timer key]] ) { if( timer == element->currentTimer && !element->currentTimerSalvaged ) { - [element->currentTimer retain]; + void* ct = (__bridge void*) element->currentTimer; + CFRetain(ct); element->currentTimerSalvaged = YES; } - - ccArrayRemoveObjectAtIndex(element->timers, i ); + + [element->timers removeObjectAtIndex:i]; // update timerIndex in case we are in tick:, looping over the actions if( element->timerIndex >= i ) element->timerIndex--; - if( element->timers->num == 0 ) { + if( element->timers.count == 0 ) { if( currentTarget == element ) currentTargetSalvaged = YES; else @@ -342,7 +523,6 @@ -(void) unscheduleSelector:(SEL)selector forTarget:(id)target // Not Found // NSLog(@"CCScheduler#unscheduleSelector:forTarget: selector not found: %@", selString); - } #pragma mark CCScheduler - Update Specific @@ -390,7 +570,7 @@ -(void) priorityIn:(tListEntry**)list target:(id)target priority:(NSInteger)prio // update hash entry for quicker access tHashUpdateEntry *hashElement = calloc( sizeof(*hashElement), 1 ); - hashElement->target = [target retain]; + hashElement->target = target; hashElement->list = list; hashElement->entry = listElement; HASH_ADD_INT(hashForUpdates, target, hashElement ); @@ -410,7 +590,7 @@ -(void) appendIn:(tListEntry**)list target:(id)target paused:(BOOL)paused // update hash entry for quicker access tHashUpdateEntry *hashElement = calloc( sizeof(*hashElement), 1 ); - hashElement->target = [target retain]; + hashElement->target = target; hashElement->list = list; hashElement->entry = listElement; HASH_ADD_INT(hashForUpdates, target, hashElement ); @@ -419,7 +599,8 @@ -(void) appendIn:(tListEntry**)list target:(id)target paused:(BOOL)paused -(void) scheduleUpdateForTarget:(id)target priority:(NSInteger)priority paused:(BOOL)paused { tHashUpdateEntry * hashElement = NULL; - HASH_FIND_INT(hashForUpdates, &target, hashElement); + void* t = (__bridge void*)target; + HASH_FIND_INT(hashForUpdates, &t, hashElement); if(hashElement) { #if COCOS2D_DEBUG >= 1 @@ -447,20 +628,24 @@ - (void) removeUpdateFromHash:(tListEntry*)entry { tHashUpdateEntry * element = NULL; - HASH_FIND_INT(hashForUpdates, &entry->target, element); + void* t = (__bridge void*) entry->target; + HASH_FIND_INT(hashForUpdates, &t, element); if( element ) { // list entry DL_DELETE( *element->list, element->entry ); free( element->entry ); // hash entry - id target = element->target; + //id target = element->target; HASH_DEL( hashForUpdates, element); free(element); // target#release should be the last one to prevent // a possible double-free. eg: If the [target dealloc] might want to remove it itself from there - [target release]; + + //TODO: There may be a memory leak here (but cannot verify with instruments)! +//#warning There may be a memory leak here (but cannot verify with instruments)! + //CFRelease(t); } } @@ -470,7 +655,8 @@ -(void) unscheduleUpdateForTarget:(id)target return; tHashUpdateEntry * element = NULL; - HASH_FIND_INT(hashForUpdates, &target, element); + void* t = (__bridge void*) target; + HASH_FIND_INT(hashForUpdates, &t, element); if( element ) { if(updateHashLocked) element->entry->markedForDeletion = YES; @@ -490,18 +676,18 @@ -(void) unscheduleUpdateForTarget:(id)target #pragma mark CCScheduler - Common for Update selector & Custom Selectors --(void) unscheduleAllSelectors +-(void) unscheduleAll { - [self unscheduleAllSelectorsWithMinPriority:kCCPrioritySystem]; + [self unscheduleAllWithMinPriority:kCCPrioritySystem]; } --(void) unscheduleAllSelectorsWithMinPriority:(NSInteger)minPriority +-(void) unscheduleAllWithMinPriority:(NSInteger)minPriority { // Custom Selectors - for(tHashSelectorEntry *element=hashForSelectors; element != NULL; ) { + for(tHashTimerEntry *element=hashForTimers; element != NULL; ) { id target = element->target; element=element->hh.next; - [self unscheduleAllSelectorsForTarget:target]; + [self unscheduleAllForTarget:target]; } // Updates selectors @@ -526,22 +712,24 @@ -(void) unscheduleAllSelectorsWithMinPriority:(NSInteger)minPriority } --(void) unscheduleAllSelectorsForTarget:(id)target +-(void) unscheduleAllForTarget:(id)target { // explicit nil handling if( target == nil ) return; // Custom Selectors - tHashSelectorEntry *element = NULL; - HASH_FIND_INT(hashForSelectors, &target, element); + tHashTimerEntry *element = NULL; + void* t = (__bridge void*)target; + HASH_FIND_INT(hashForTimers, &t, element); if( element ) { - if( ccArrayContainsObject(element->timers, element->currentTimer) && !element->currentTimerSalvaged ) { - [element->currentTimer retain]; + if( [element->timers containsObject:element->currentTimer] && !element->currentTimerSalvaged ) { + void* ct = (__bridge void*) element->currentTimer; + CFRetain(ct); element->currentTimerSalvaged = YES; } - ccArrayRemoveAllObjects(element->timers); + [element->timers removeAllObjects]; if( currentTarget == element ) currentTargetSalvaged = YES; else @@ -557,14 +745,15 @@ -(void) resumeTarget:(id)target NSAssert( target != nil, @"target must be non nil" ); // Custom Selectors - tHashSelectorEntry *element = NULL; - HASH_FIND_INT(hashForSelectors, &target, element); + tHashTimerEntry *element = NULL; + void* t = (__bridge void*)target; + HASH_FIND_INT(hashForTimers, &t, element); if( element ) element->paused = NO; // Update selector tHashUpdateEntry * elementUpdate = NULL; - HASH_FIND_INT(hashForUpdates, &target, elementUpdate); + HASH_FIND_INT(hashForUpdates, &t, elementUpdate); if( elementUpdate ) { NSAssert( elementUpdate->entry != NULL, @"resumeTarget: unknown error"); elementUpdate->entry->paused = NO; @@ -576,14 +765,15 @@ -(void) pauseTarget:(id)target NSAssert( target != nil, @"target must be non nil" ); // Custom selectors - tHashSelectorEntry *element = NULL; - HASH_FIND_INT(hashForSelectors, &target, element); + tHashTimerEntry *element = NULL; + void* t = (__bridge void*)target; + HASH_FIND_INT(hashForTimers, &t, element); if( element ) element->paused = YES; // Update selector tHashUpdateEntry * elementUpdate = NULL; - HASH_FIND_INT(hashForUpdates, &target, elementUpdate); + HASH_FIND_INT(hashForUpdates, &t, elementUpdate); if( elementUpdate ) { NSAssert( elementUpdate->entry != NULL, @"pauseTarget: unknown error"); elementUpdate->entry->paused = YES; @@ -596,55 +786,60 @@ -(BOOL) isTargetPaused:(id)target NSAssert( target != nil, @"target must be non nil" ); // Custom selectors - tHashSelectorEntry *element = NULL; - HASH_FIND_INT(hashForSelectors, &target, element); + tHashTimerEntry *element = NULL; + void* t = (__bridge void*)target; + HASH_FIND_INT(hashForTimers, &t, element); if( element ) - { return element->paused; - } - return NO; // should never get here - + + // We should check update selectors if target does not have custom selectors + tHashUpdateEntry * elementUpdate = NULL; + HASH_FIND_INT(hashForUpdates, &t, elementUpdate); + if ( elementUpdate ) + return elementUpdate->entry->paused; + + return NO; // should never get here } -(NSSet*) pauseAllTargets { - return [self pauseAllTargetsWithMinPriority:kCCPrioritySystem]; + return [self pauseAllTargetsWithMinPriority:kCCPrioritySystem]; } -(NSSet*) pauseAllTargetsWithMinPriority:(NSInteger)minPriority { - NSMutableSet* idsWithSelectors = [NSMutableSet setWithCapacity:50]; - - // Custom Selectors - for(tHashSelectorEntry *element=hashForSelectors; element != NULL; element=element->hh.next) { - element->paused = YES; - [idsWithSelectors addObject:element->target]; - } - - // Updates selectors - tListEntry *entry, *tmp; - if(minPriority < 0) { - DL_FOREACH_SAFE( updatesNeg, entry, tmp ) { - if(entry->priority >= minPriority) { - entry->paused = YES; - [idsWithSelectors addObject:entry->target]; - } - } - } - if(minPriority <= 0) { - DL_FOREACH_SAFE( updates0, entry, tmp ) { - entry->paused = YES; - [idsWithSelectors addObject:entry->target]; - } - } - DL_FOREACH_SAFE( updatesPos, entry, tmp ) { - if(entry->priority >= minPriority) { - entry->paused = YES; - [idsWithSelectors addObject:entry->target]; - } - } - - return idsWithSelectors; + NSMutableSet* idsWithSelectors = [NSMutableSet setWithCapacity:50]; + + // Custom Selectors + for(tHashTimerEntry *element=hashForTimers; element != NULL; element=element->hh.next) { + element->paused = YES; + [idsWithSelectors addObject:element->target]; + } + + // Updates selectors + tListEntry *entry, *tmp; + if(minPriority < 0) { + DL_FOREACH_SAFE( updatesNeg, entry, tmp ) { + if(entry->priority >= minPriority) { + entry->paused = YES; + [idsWithSelectors addObject:entry->target]; + } + } + } + if(minPriority <= 0) { + DL_FOREACH_SAFE( updates0, entry, tmp ) { + entry->paused = YES; + [idsWithSelectors addObject:entry->target]; + } + } + DL_FOREACH_SAFE( updatesPos, entry, tmp ) { + if(entry->priority >= minPriority) { + entry->paused = YES; + [idsWithSelectors addObject:entry->target]; + } + } + + return idsWithSelectors; } -(void) resumeTargets:(NSSet *)targetsToResume @@ -658,36 +853,45 @@ -(void) resumeTargets:(NSSet *)targetsToResume -(void) update: (ccTime) dt { + // all "dt" are going to be ignored if paused + if( _paused ) + return; + updateHashLocked = YES; - if( timeScale_ != 1.0f ) - dt *= timeScale_; + if( _timeScale != 1.0f ) + dt *= _timeScale; // Iterate all over the Updates selectors tListEntry *entry, *tmp; // updates with priority < 0 DL_FOREACH_SAFE( updatesNeg, entry, tmp ) { - if( ! entry->paused && !entry->markedForDeletion ) - entry->impMethod( entry->target, updateSelector, dt ); + if( ! entry->paused && !entry->markedForDeletion ) { +// entry->impMethod( entry->target, updateSelector, dt ); + ((void (*)(id,SEL, ccTime))objc_msgSend)(entry->target, updateSelector, dt); + } } // updates with priority == 0 DL_FOREACH_SAFE( updates0, entry, tmp ) { if( ! entry->paused && !entry->markedForDeletion ) { - entry->impMethod( entry->target, updateSelector, dt ); +// entry->impMethod( entry->target, updateSelector, dt ); + ((void (*)(id,SEL, ccTime))objc_msgSend)(entry->target, updateSelector, dt); } } // updates with priority > 0 DL_FOREACH_SAFE( updatesPos, entry, tmp ) { - if( ! entry->paused && !entry->markedForDeletion ) - entry->impMethod( entry->target, updateSelector, dt ); + if( ! entry->paused && !entry->markedForDeletion ) { +// entry->impMethod( entry->target, updateSelector, dt ); + ((void (*)(id,SEL, ccTime))objc_msgSend)(entry->target, updateSelector, dt); + } } - // Iterate all over the custome selectors - for(tHashSelectorEntry *elt=hashForSelectors; elt != NULL; ) { + // Iterate all over the custom selectors (CCTimers) + for(tHashTimerEntry *elt=hashForTimers; elt != NULL; ) { currentTarget = elt; currentTargetSalvaged = NO; @@ -695,17 +899,19 @@ -(void) update: (ccTime) dt if( ! currentTarget->paused ) { // The 'timers' ccArray may change while inside this loop. - for( elt->timerIndex = 0; elt->timerIndex < elt->timers->num; elt->timerIndex++) { - elt->currentTimer = elt->timers->arr[elt->timerIndex]; + for( elt->timerIndex = 0; elt->timerIndex < elt->timers.count; elt->timerIndex++) { + elt->currentTimer = [elt->timers objectAtIndex: elt->timerIndex]; elt->currentTimerSalvaged = NO; - impMethod( elt->currentTimer, updateSelector, dt); +// impMethod( elt->currentTimer, updateSelector, dt); + ((void (*)(id,SEL, ccTime))objc_msgSend)(elt->currentTimer, updateSelector, dt); if( elt->currentTimerSalvaged ) { // The currentTimer told the remove itself. To prevent the timer from // accidentally deallocating itself before finishing its step, we retained // it. Now that step is done, it is safe to release it. - [elt->currentTimer release]; + void* t = (__bridge void*) elt->currentTimer; + CFRelease(t); } elt->currentTimer = nil; @@ -717,7 +923,7 @@ -(void) update: (ccTime) dt elt = elt->hh.next; // only delete currentTarget if no actions were scheduled during the cycle (issue #481) - if( currentTargetSalvaged && currentTarget->timers->num == 0 ) + if( currentTargetSalvaged && currentTarget->timers.count == 0 ) [self removeHashElement:currentTarget]; } diff --git a/cocos2d/CCShaderCache.h b/cocos2d/CCShaderCache.h new file mode 100644 index 0000000..2ee948b --- /dev/null +++ b/cocos2d/CCShaderCache.h @@ -0,0 +1,60 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2008-2010 Ricardo Quesada + * Copyright (c) 2011 Zynga Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#import +#import "ccMacros.h" +#ifdef __CC_PLATFORM_IOS +#import +#endif // __CC_PLATFORM_IOS + +@class CCGLProgram; + +/** CCShaderCache + Singleton that stores manages GL shaders + @since v2.0 + */ +@interface CCShaderCache : NSObject { + + NSMutableDictionary *_programs; + +} + +/** returns the shared instance */ ++ (CCShaderCache *)sharedShaderCache; + +/** purges the cache. It releases the retained instance. */ ++(void)purgeSharedShaderCache; + +/** loads the default shaders */ +-(void) loadDefaultShaders; + +/** returns a GL program for a given key */ +-(CCGLProgram *) programForKey:(NSString*)key; + +/** adds a CCGLProgram to the cache for a given name */ +- (void) addProgram:(CCGLProgram*)program forKey:(NSString*)key; + +@end + diff --git a/src/cocos2d/CCShaderCache.m b/cocos2d/CCShaderCache.m similarity index 81% rename from src/cocos2d/CCShaderCache.m rename to cocos2d/CCShaderCache.m index 33bdf28..20973b8 100644 --- a/src/cocos2d/CCShaderCache.m +++ b/cocos2d/CCShaderCache.m @@ -45,7 +45,6 @@ + (CCShaderCache *)sharedShaderCache +(void)purgeSharedShaderCache { - [_sharedShaderCache release]; _sharedShaderCache = nil; } @@ -60,20 +59,17 @@ - (void)dealloc { CCLOGINFO(@"cocos2d deallocing %@", self); - [programs_ release]; - [super dealloc]; } +(void)purgeSharedTextureCache { - [_sharedShaderCache release]; _sharedShaderCache = nil; } -(id) init { if( (self=[super init]) ) { - programs_ = [[NSMutableDictionary alloc ] initWithCapacity: 10]; + _programs = [[NSMutableDictionary alloc ] initWithCapacity: 10]; [self loadDefaultShaders]; } @@ -94,8 +90,7 @@ -(void) loadDefaultShaders [p link]; [p updateUniforms]; - [programs_ setObject:p forKey:kCCShader_PositionTextureColor]; - [p release]; + [_programs setObject:p forKey:kCCShader_PositionTextureColor]; CHECK_GL_ERROR_DEBUG(); @@ -110,8 +105,7 @@ -(void) loadDefaultShaders [p link]; [p updateUniforms]; - [programs_ setObject:p forKey:kCCShader_PositionTextureColorAlphaTest]; - [p release]; + [_programs setObject:p forKey:kCCShader_PositionTextureColorAlphaTest]; CHECK_GL_ERROR_DEBUG(); @@ -127,8 +121,7 @@ -(void) loadDefaultShaders [p link]; [p updateUniforms]; - [programs_ setObject:p forKey:kCCShader_PositionColor]; - [p release]; + [_programs setObject:p forKey:kCCShader_PositionColor]; CHECK_GL_ERROR_DEBUG(); @@ -144,8 +137,7 @@ -(void) loadDefaultShaders [p link]; [p updateUniforms]; - [programs_ setObject:p forKey:kCCShader_PositionTexture]; - [p release]; + [_programs setObject:p forKey:kCCShader_PositionTexture]; CHECK_GL_ERROR_DEBUG(); @@ -161,8 +153,7 @@ -(void) loadDefaultShaders [p link]; [p updateUniforms]; - [programs_ setObject:p forKey:kCCShader_PositionTexture_uColor]; - [p release]; + [_programs setObject:p forKey:kCCShader_PositionTexture_uColor]; CHECK_GL_ERROR_DEBUG(); @@ -179,8 +170,7 @@ -(void) loadDefaultShaders [p link]; [p updateUniforms]; - [programs_ setObject:p forKey:kCCShader_PositionTextureA8Color]; - [p release]; + [_programs setObject:p forKey:kCCShader_PositionTextureA8Color]; CHECK_GL_ERROR_DEBUG(); @@ -190,24 +180,40 @@ -(void) loadDefaultShaders p = [[CCGLProgram alloc] initWithVertexShaderByteArray:ccPosition_uColor_vert fragmentShaderByteArray:ccPosition_uColor_frag]; - [p addAttribute:kCCAttributeNamePosition index:kCCVertexAttrib_Position]; + [p addAttribute:@"aVertex" index:kCCVertexAttrib_Position]; + [p link]; [p updateUniforms]; - [programs_ setObject:p forKey:kCCShader_Position_uColor]; - [p release]; + [_programs setObject:p forKey:kCCShader_Position_uColor]; CHECK_GL_ERROR_DEBUG(); + + // + // Position, Legth(TexCoords, Color (used by Draw Node basically ) + // + p = [[CCGLProgram alloc] initWithVertexShaderByteArray:ccPositionColorLengthTexture_vert + fragmentShaderByteArray:ccPositionColorLengthTexture_frag]; + + [p addAttribute:kCCAttributeNamePosition index:kCCVertexAttrib_Position]; + [p addAttribute:kCCAttributeNameTexCoord index:kCCVertexAttrib_TexCoords]; + [p addAttribute:kCCAttributeNameColor index:kCCVertexAttrib_Color]; + + [p link]; + [p updateUniforms]; + + [_programs setObject:p forKey:kCCShader_PositionLengthTexureColor]; + CHECK_GL_ERROR_DEBUG(); } -(CCGLProgram *) programForKey:(NSString*)key { - return [programs_ objectForKey:key]; + return [_programs objectForKey:key]; } - (void) addProgram:(CCGLProgram*)program forKey:(NSString*)key { - [programs_ setObject:program forKey:key]; + [_programs setObject:program forKey:key]; } @end diff --git a/cocos2d/CCSprite.h b/cocos2d/CCSprite.h new file mode 100644 index 0000000..b86a77f --- /dev/null +++ b/cocos2d/CCSprite.h @@ -0,0 +1,284 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2008-2010 Ricardo Quesada + * Copyright (c) 2011 Zynga Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + */ + + +#import "CCNode.h" +#import "CCProtocols.h" +#import "CCTextureAtlas.h" + +@class CCSpriteBatchNode; +@class CCSpriteFrame; +@class CCAnimation; + +#pragma mark CCSprite + +#define CCSpriteIndexNotInitialized 0xffffffff /// CCSprite invalid index on the CCSpriteBatchode + + +/** CCSprite is a 2d image ( http://en.wikipedia.org/wiki/Sprite_(computer_graphics) ) + * + * CCSprite can be created with an image, or with a sub-rectangle of an image. + * + * If the parent or any of its ancestors is a CCSpriteBatchNode then the following features/limitations are valid + * - Features when the parent is a CCBatchNode: + * - MUCH faster rendering, specially if the CCSpriteBatchNode has many children. All the children will be drawn in a single batch. + * + * - Limitations + * - Camera is not supported yet (eg: CCOrbitCamera action doesn't work) + * - GridBase actions are not supported (eg: CCLens, CCRipple, CCTwirl) + * - The Alias/Antialias property belongs to CCSpriteBatchNode, so you can't individually set the aliased property. + * - The Blending function property belongs to CCSpriteBatchNode, so you can't individually set the blending function property. + * - Parallax scroller is not supported, but can be simulated with a "proxy" sprite. + * + * If the parent is an standard CCNode, then CCSprite behaves like any other CCNode: + * - It supports blending functions + * - It supports aliasing / antialiasing + * - But the rendering will be slower: 1 draw per children. + * + * The default anchorPoint in CCSprite is (0.5, 0.5). + */ +@interface CCSprite : CCNodeRGBA +{ + + // + // Data used when the sprite is rendered using a CCSpriteBatchNode + // + CCTextureAtlas *__unsafe_unretained _textureAtlas; // Sprite Sheet texture atlas (weak reference) + NSUInteger _atlasIndex; // Absolute (real) Index on the batch node + CCSpriteBatchNode *_batchNode; // Used batch node (weak reference) + CGAffineTransform _transformToBatch; // + BOOL _dirty; // Sprite needs to be updated + BOOL _recursiveDirty; // Subchildren needs to be updated + BOOL _hasChildren; // optimization to check if it contain children + BOOL _shouldBeHidden; // should not be drawn because one of the ancestors is not visible + + // + // Data used when the sprite is self-rendered + // + ccBlendFunc _blendFunc; // Needed for the texture protocol + CCTexture2D *_texture; // Texture used to render the sprite + + // + // Shared data + // + + // sprite rectangle + CGRect _rect; + + // texture + BOOL _rectRotated; + + // Offset Position (used by Zwoptex) + CGPoint _offsetPosition; + CGPoint _unflippedOffsetPositionFromCenter; + + // vertex coords, texture coords and color info + ccV3F_C4B_T2F_Quad _quad; + + // opacity and RGB protocol + BOOL _opacityModifyRGB; + + // image is flipped + BOOL _flipX; + BOOL _flipY; +} + +/** whether or not the Sprite needs to be updated in the Atlas */ +@property (nonatomic,readwrite) BOOL dirty; +/** the quad (tex coords, vertex coords and color) information */ +@property (nonatomic,readonly) ccV3F_C4B_T2F_Quad quad; +/** The index used on the TextureAtlas. Don't modify this value unless you know what you are doing */ +@property (nonatomic,readwrite) NSUInteger atlasIndex; +/** returns the texture rect of the CCSprite in points */ +@property (nonatomic,readonly) CGRect textureRect; +/** returns whether or not the texture rectangle is rotated */ +@property (nonatomic,readonly) BOOL textureRectRotated; + +/** + * The currently displayed spriteFrame. + */ +@property (nonatomic,strong) CCSpriteFrame* spriteFrame; + +/** whether or not the sprite is flipped horizontally. + It only flips the texture of the sprite, and not the texture of the sprite's children. + Also, flipping the texture doesn't alter the anchorPoint. + If you want to flip the anchorPoint too, and/or to flip the children too use: + + sprite.scaleX *= -1; + */ +@property (nonatomic,readwrite) BOOL flipX; +/** whether or not the sprite is flipped vertically. + It only flips the texture of the sprite, and not the texture of the sprite's children. + Also, flipping the texture doesn't alter the anchorPoint. + If you want to flip the anchorPoint too, and/or to flip the children too use: + + sprite.scaleY *= -1; + */ +@property (nonatomic,readwrite) BOOL flipY; +/** weak reference of the CCTextureAtlas used when the sprite is rendered using a CCSpriteBatchNode */ +@property (nonatomic,readwrite,unsafe_unretained) CCTextureAtlas *textureAtlas; +/** weak reference to the CCSpriteBatchNode that renders the CCSprite */ +@property (nonatomic,readwrite,unsafe_unretained) CCSpriteBatchNode *batchNode; +/** offset position in points of the sprite in points. Calculated automatically by editors like Zwoptex. + @since v0.99.0 + */ +@property (nonatomic,readonly) CGPoint offsetPosition; +/** conforms to CCTextureProtocol protocol */ +@property (nonatomic,readwrite) ccBlendFunc blendFunc; + +#pragma mark CCSprite - Initializers + +/** + * Creates a sprite with the name of an image. The name can be either a name in a sprite sheet or the name of a file. + * + * @param imageName name of the image to load + * + * @return a sprite + */ ++(id)spriteWithImageNamed:(NSString*)imageName; + +/** Creates an sprite with a texture. + The rect used will be the size of the texture. + The offset will be (0,0). + */ ++(id) spriteWithTexture:(CCTexture2D*)texture; + +/** Creates an sprite with a texture and a rect. + The offset will be (0,0). + */ ++(id) spriteWithTexture:(CCTexture2D*)texture rect:(CGRect)rect; + +/** Creates an sprite with an sprite frame. + */ ++(id) spriteWithSpriteFrame:(CCSpriteFrame*)spriteFrame; + +/** Creates an sprite with an sprite frame name. + An CCSpriteFrame will be fetched from the CCSpriteFrameCache by name. + If the CCSpriteFrame doesn't exist it will raise an exception. + @since v0.9 + */ ++(id) spriteWithSpriteFrameName:(NSString*)spriteFrameName; + +/** Creates an sprite with an image filename. + The rect used will be the size of the image. + The offset will be (0,0). + */ ++(id) spriteWithFile:(NSString*)filename; + +/** Creates an sprite with an image filename and a rect. + The offset will be (0,0). + */ ++(id) spriteWithFile:(NSString*)filename rect:(CGRect)rect; + +/** Creates an sprite with a CGImageRef and a key. + The key is used by the CCTextureCache to know if a texture was already created with this CGImage. + For example, a valid key is: @"_spriteframe_01". + If key is nil, then a new texture will be created each time by the CCTextureCache. + @since v0.99.0 + */ ++(id) spriteWithCGImage: (CGImageRef)image key:(NSString*)key; + +/** Initializes an sprite with a texture. + The rect used will be the size of the texture. + The offset will be (0,0). + */ +-(id) initWithTexture:(CCTexture2D*)texture; + +/** Initializes an sprite with a texture and a rect in points (unrotated) + The offset will be (0,0). + */ +-(id) initWithTexture:(CCTexture2D*)texture rect:(CGRect)rect; + +/** Initializes an sprite with a texture and a rect in points, optionally rotated. + The offset will be (0,0). + IMPORTANT: This is the designated initializer. + */ +- (id)initWithTexture:(CCTexture2D *)texture rect:(CGRect)rect rotated:(BOOL)rotated; + + +/** Initializes an sprite with an sprite frame. + */ +-(id) initWithSpriteFrame:(CCSpriteFrame*)spriteFrame; + +/** Initializes an sprite with an sprite frame name. + An CCSpriteFrame will be fetched from the CCSpriteFrameCache by name. + If the CCSpriteFrame doesn't exist it will raise an exception. + @since v0.9 + */ +-(id) initWithSpriteFrameName:(NSString*)spriteFrameName; + +/** Initializes an sprite with an image filename. + The rect used will be the size of the image. + The offset will be (0,0). + */ +-(id) initWithFile:(NSString*)filename; + +/** Initializes an sprite with an image filename, and a rect. + The offset will be (0,0). + */ +-(id) initWithFile:(NSString*)filename rect:(CGRect)rect; + +/** Initializes an sprite with a CGImageRef and a key + The key is used by the CCTextureCache to know if a texture was already created with this CGImage. + For example, a valid key is: @"_spriteframe_01". + If key is nil, then a new texture will be created each time by the CCTextureCache. + @since v0.99.0 + */ +-(id) initWithCGImage:(CGImageRef)image key:(NSString*)key; + +#pragma mark CCSprite - BatchNode methods + +/** updates the quad according the the rotation, position, scale values. + */ +-(void)updateTransform; + +#pragma mark CCSprite - Texture methods + +/** set the texture rect of the CCSprite in points. + It will call setTextureRect:rotated:untrimmedSize with rotated = NO, and utrimmedSize = rect.size. + */ +-(void) setTextureRect:(CGRect) rect; + +/** set the texture rect, rectRotated and untrimmed size of the CCSprite in points. + It will update the texture coordinates and the vertex rectangle. + */ +-(void) setTextureRect:(CGRect)rect rotated:(BOOL)rotated untrimmedSize:(CGSize)size; + +/** set the vertex rect. + It will be called internally by setTextureRect. Useful if you want to create 2x images from SD images in Retina Display. + Do not call it manually. Use setTextureRect instead. + */ +-(void)setVertexRect:(CGRect)rect; + +#pragma mark CCSprite - Animation + +/** changes the display frame with animation name and index. + The animation name will be get from the CCAnimationCache + @since v0.99.5 + */ +-(void) setSpriteFrameWithAnimationName:(NSString*)animationName index:(int) frameIndex; + +@end diff --git a/src/cocos2d/CCSprite.m b/cocos2d/CCSprite.m similarity index 53% rename from src/cocos2d/CCSprite.m rename to cocos2d/CCSprite.m index 6549f20..a5de5ec 100644 --- a/src/cocos2d/CCSprite.m +++ b/cocos2d/CCSprite.m @@ -51,7 +51,7 @@ #if CC_SPRITEBATCHNODE_RENDER_SUBPIXEL #define RENDER_IN_SUBPIXEL #else -#define RENDER_IN_SUBPIXEL(__A__) ( (int)(__A__)) +#define RENDER_IN_SUBPIXEL(__ARGS__) (ceil(__ARGS__)) #endif @@ -63,40 +63,43 @@ -(void) setReorderChildDirtyRecursively; @implementation CCSprite -@synthesize dirty = dirty_; -@synthesize quad = quad_; -@synthesize atlasIndex = atlasIndex_; -@synthesize textureRect = rect_; -@synthesize textureRectRotated = rectRotated_; -@synthesize blendFunc = blendFunc_; -@synthesize textureAtlas = textureAtlas_; -@synthesize offsetPosition = offsetPosition_; -@synthesize forceDisableDebugDraw = forceDisableDebugDraw_; +@synthesize dirty = _dirty; +@synthesize quad = _quad; +@synthesize atlasIndex = _atlasIndex; +@synthesize textureRect = _rect; +@synthesize textureRectRotated = _rectRotated; +@synthesize blendFunc = _blendFunc; +@synthesize textureAtlas = _textureAtlas; +@synthesize offsetPosition = _offsetPosition; ++(id)spriteWithImageNamed:(NSString*)imageName +{ + return [[self alloc] initWithSpriteFrame:[CCSpriteFrame frameWithImageNamed:imageName]]; +} +(id)spriteWithTexture:(CCTexture2D*)texture { - return [[[self alloc] initWithTexture:texture] autorelease]; + return [[self alloc] initWithTexture:texture]; } +(id)spriteWithTexture:(CCTexture2D*)texture rect:(CGRect)rect { - return [[[self alloc] initWithTexture:texture rect:rect] autorelease]; + return [[self alloc] initWithTexture:texture rect:rect]; } +(id)spriteWithFile:(NSString*)filename { - return [[[self alloc] initWithFile:filename] autorelease]; + return [[self alloc] initWithFile:filename]; } +(id)spriteWithFile:(NSString*)filename rect:(CGRect)rect { - return [[[self alloc] initWithFile:filename rect:rect] autorelease]; + return [[self alloc] initWithFile:filename rect:rect]; } +(id)spriteWithSpriteFrame:(CCSpriteFrame*)spriteFrame { - return [[[self alloc] initWithSpriteFrame:spriteFrame] autorelease]; + return [[self alloc] initWithSpriteFrame:spriteFrame]; } +(id)spriteWithSpriteFrameName:(NSString*)spriteFrameName @@ -109,7 +112,7 @@ +(id)spriteWithSpriteFrameName:(NSString*)spriteFrameName +(id)spriteWithCGImage:(CGImageRef)image key:(NSString*)key { - return [[[self alloc] initWithCGImage:image key:key] autorelease]; + return [[self alloc] initWithCGImage:image key:key]; } -(id) init @@ -125,35 +128,33 @@ -(id) initWithTexture:(CCTexture2D*)texture rect:(CGRect)rect rotated:(BOOL)rota // shader program self.shaderProgram = [[CCShaderCache sharedShaderCache] programForKey:kCCShader_PositionTextureColor]; - dirty_ = recursiveDirty_ = NO; + _dirty = _recursiveDirty = NO; - opacityModifyRGB_ = YES; - opacity_ = 255; - color_ = colorUnmodified_ = ccWHITE; + _opacityModifyRGB = YES; - blendFunc_.src = CC_BLEND_SRC; - blendFunc_.dst = CC_BLEND_DST; + _blendFunc.src = CC_BLEND_SRC; + _blendFunc.dst = CC_BLEND_DST; - flipY_ = flipX_ = NO; + _flipY = _flipX = NO; // default transform anchor: center - anchorPoint_ = ccp(0.5f, 0.5f); + _anchorPoint = ccp(0.5f, 0.5f); // zwoptex default values - offsetPosition_ = CGPointZero; + _offsetPosition = CGPointZero; - hasChildren_ = NO; - batchNode_ = nil; + _hasChildren = NO; + _batchNode = nil; // clean the Quad - bzero(&quad_, sizeof(quad_)); + bzero(&_quad, sizeof(_quad)); // Atlas: Color ccColor4B tmpColor = {255,255,255,255}; - quad_.bl.colors = tmpColor; - quad_.br.colors = tmpColor; - quad_.tl.colors = tmpColor; - quad_.tr.colors = tmpColor; + _quad.bl.colors = tmpColor; + _quad.br.colors = tmpColor; + _quad.tl.colors = tmpColor; + _quad.tr.colors = tmpColor; [self setTexture:texture]; [self setTextureRect:rect rotated:rotated untrimmedSize:rect.size]; @@ -192,7 +193,6 @@ -(id) initWithFile:(NSString*)filename return [self initWithTexture:texture rect:rect]; } - [self release]; return nil; } @@ -204,7 +204,6 @@ -(id) initWithFile:(NSString*)filename rect:(CGRect)rect if( texture ) return [self initWithTexture:texture rect:rect]; - [self release]; return nil; } @@ -213,7 +212,7 @@ - (id) initWithSpriteFrame:(CCSpriteFrame*)spriteFrame NSAssert(spriteFrame!=nil, @"Invalid spriteFrame for sprite"); id ret = [self initWithTexture:spriteFrame.texture rect:spriteFrame.rect]; - [self setDisplayFrame:spriteFrame]; + self.spriteFrame = spriteFrame; return ret; } @@ -241,47 +240,42 @@ - (id) initWithCGImage:(CGImageRef)image key:(NSString*)key - (NSString*) description { return [NSString stringWithFormat:@"<%@ = %p | Rect = (%.2f,%.2f,%.2f,%.2f) | tag = %ld | atlasIndex = %ld>", [self class], self, - rect_.origin.x, rect_.origin.y, rect_.size.width, rect_.size.height, - (long)tag_, - (unsigned long)atlasIndex_ + _rect.origin.x, _rect.origin.y, _rect.size.width, _rect.size.height, + (long)_tag, + (unsigned long)_atlasIndex ]; } -- (void) dealloc -{ - [texture_ release]; - [super dealloc]; -} -(CCSpriteBatchNode*) batchNode { - return batchNode_; + return _batchNode; } -(void) setBatchNode:(CCSpriteBatchNode *)batchNode { - batchNode_ = batchNode; // weak reference + _batchNode = batchNode; // weak reference // self render if( ! batchNode ) { - atlasIndex_ = CCSpriteIndexNotInitialized; - textureAtlas_ = nil; - dirty_ = recursiveDirty_ = NO; - - float x1 = offsetPosition_.x; - float y1 = offsetPosition_.y; - float x2 = x1 + rect_.size.width; - float y2 = y1 + rect_.size.height; - quad_.bl.vertices = (ccVertex3F) { x1, y1, 0 }; - quad_.br.vertices = (ccVertex3F) { x2, y1, 0 }; - quad_.tl.vertices = (ccVertex3F) { x1, y2, 0 }; - quad_.tr.vertices = (ccVertex3F) { x2, y2, 0 }; + _atlasIndex = CCSpriteIndexNotInitialized; + _textureAtlas = nil; + _dirty = _recursiveDirty = NO; + + float x1 = _offsetPosition.x; + float y1 = _offsetPosition.y; + float x2 = x1 + _rect.size.width; + float y2 = y1 + _rect.size.height; + _quad.bl.vertices = (ccVertex3F) { x1, y1, 0 }; + _quad.br.vertices = (ccVertex3F) { x2, y1, 0 }; + _quad.tl.vertices = (ccVertex3F) { x1, y2, 0 }; + _quad.tr.vertices = (ccVertex3F) { x2, y2, 0 }; } else { // using batch - transformToBatch_ = CGAffineTransformIdentity; - textureAtlas_ = [batchNode textureAtlas]; // weak ref + _transformToBatch = CGAffineTransformIdentity; + _textureAtlas = [batchNode textureAtlas]; // weak ref } } @@ -292,59 +286,60 @@ -(void) setTextureRect:(CGRect)rect -(void) setTextureRect:(CGRect)rect rotated:(BOOL)rotated untrimmedSize:(CGSize)untrimmedSize { - rectRotated_ = rotated; + _rectRotated = rotated; + self.contentSizeType = kCCContentSizeTypePoints; [self setContentSize:untrimmedSize]; [self setVertexRect:rect]; [self setTextureCoords:rect]; - CGPoint relativeOffset = unflippedOffsetPositionFromCenter_; + CGPoint relativeOffset = _unflippedOffsetPositionFromCenter; // issue #732 - if( flipX_ ) + if( _flipX ) relativeOffset.x = -relativeOffset.x; - if( flipY_ ) + if( _flipY ) relativeOffset.y = -relativeOffset.y; - offsetPosition_.x = relativeOffset.x + (contentSize_.width - rect_.size.width) / 2; - offsetPosition_.y = relativeOffset.y + (contentSize_.height - rect_.size.height) / 2; + _offsetPosition.x = relativeOffset.x + (_contentSize.width - _rect.size.width) / 2; + _offsetPosition.y = relativeOffset.y + (_contentSize.height - _rect.size.height) / 2; // rendering using batch node - if( batchNode_ ) { - // update dirty_, don't update recursiveDirty_ - dirty_ = YES; + if( _batchNode ) { + // update _dirty, don't update _recursiveDirty + _dirty = YES; } // self rendering else { // Atlas: Vertex - float x1 = offsetPosition_.x; - float y1 = offsetPosition_.y; - float x2 = x1 + rect_.size.width; - float y2 = y1 + rect_.size.height; + float x1 = _offsetPosition.x; + float y1 = _offsetPosition.y; + float x2 = x1 + _rect.size.width; + float y2 = y1 + _rect.size.height; // Don't update Z. - quad_.bl.vertices = (ccVertex3F) { x1, y1, 0 }; - quad_.br.vertices = (ccVertex3F) { x2, y1, 0 }; - quad_.tl.vertices = (ccVertex3F) { x1, y2, 0 }; - quad_.tr.vertices = (ccVertex3F) { x2, y2, 0 }; + _quad.bl.vertices = (ccVertex3F) { x1, y1, 0 }; + _quad.br.vertices = (ccVertex3F) { x2, y1, 0 }; + _quad.tl.vertices = (ccVertex3F) { x1, y2, 0 }; + _quad.tr.vertices = (ccVertex3F) { x2, y2, 0 }; } } // override this method to generate "double scale" sprites -(void) setVertexRect:(CGRect)rect { - rect_ = rect; + _rect = rect; } -(void) setTextureCoords:(CGRect)rect { rect = CC_RECT_POINTS_TO_PIXELS(rect); - CCTexture2D *tex = (batchNode_) ? [textureAtlas_ texture] : texture_; + CCTexture2D *tex = (_batchNode) ? [_textureAtlas texture] : _texture; if(!tex) return; @@ -353,7 +348,7 @@ -(void) setTextureCoords:(CGRect)rect float left, right ,top , bottom; - if(rectRotated_) + if(_rectRotated) { #if CC_FIX_ARTIFACTS_BY_STRECHING_TEXEL left = (2*rect.origin.x+1)/(2*atlasWidth); @@ -367,19 +362,19 @@ -(void) setTextureCoords:(CGRect)rect bottom = (rect.origin.y+rect.size.width) / atlasHeight; #endif // ! CC_FIX_ARTIFACTS_BY_STRECHING_TEXEL - if( flipX_) + if( _flipX) CC_SWAP(top,bottom); - if( flipY_) + if( _flipY) CC_SWAP(left,right); - quad_.bl.texCoords.u = left; - quad_.bl.texCoords.v = top; - quad_.br.texCoords.u = left; - quad_.br.texCoords.v = bottom; - quad_.tl.texCoords.u = right; - quad_.tl.texCoords.v = top; - quad_.tr.texCoords.u = right; - quad_.tr.texCoords.v = bottom; + _quad.bl.texCoords.u = left; + _quad.bl.texCoords.v = top; + _quad.br.texCoords.u = left; + _quad.br.texCoords.v = bottom; + _quad.tl.texCoords.u = right; + _quad.tl.texCoords.v = top; + _quad.tr.texCoords.u = right; + _quad.tr.texCoords.v = bottom; } else { #if CC_FIX_ARTIFACTS_BY_STRECHING_TEXEL left = (2*rect.origin.x+1)/(2*atlasWidth); @@ -393,66 +388,66 @@ -(void) setTextureCoords:(CGRect)rect bottom = (rect.origin.y + rect.size.height) / atlasHeight; #endif // ! CC_FIX_ARTIFACTS_BY_STRECHING_TEXEL - if( flipX_) + if( _flipX) CC_SWAP(left,right); - if( flipY_) + if( _flipY) CC_SWAP(top,bottom); - quad_.bl.texCoords.u = left; - quad_.bl.texCoords.v = bottom; - quad_.br.texCoords.u = right; - quad_.br.texCoords.v = bottom; - quad_.tl.texCoords.u = left; - quad_.tl.texCoords.v = top; - quad_.tr.texCoords.u = right; - quad_.tr.texCoords.v = top; + _quad.bl.texCoords.u = left; + _quad.bl.texCoords.v = bottom; + _quad.br.texCoords.u = right; + _quad.br.texCoords.v = bottom; + _quad.tl.texCoords.u = left; + _quad.tl.texCoords.v = top; + _quad.tr.texCoords.u = right; + _quad.tr.texCoords.v = top; } } -(void)updateTransform { - NSAssert( batchNode_, @"updateTransform is only valid when CCSprite is being rendered using an CCSpriteBatchNode"); + NSAssert( _batchNode, @"updateTransform is only valid when CCSprite is being rendered using an CCSpriteBatchNode"); // recaculate matrix only if it is dirty if( self.dirty ) { // If it is not visible, or one of its ancestors is not visible, then do nothing: - if( !visible_ || ( parent_ && parent_ != batchNode_ && ((CCSprite*)parent_)->shouldBeHidden_) ) { - quad_.br.vertices = quad_.tl.vertices = quad_.tr.vertices = quad_.bl.vertices = (ccVertex3F){0,0,0}; - shouldBeHidden_ = YES; + if( !_visible || ( _parent && _parent != _batchNode && ((CCSprite*)_parent)->_shouldBeHidden) ) { + _quad.br.vertices = _quad.tl.vertices = _quad.tr.vertices = _quad.bl.vertices = (ccVertex3F){0,0,0}; + _shouldBeHidden = YES; } else { - shouldBeHidden_ = NO; + _shouldBeHidden = NO; - if( ! parent_ || parent_ == batchNode_ ) - transformToBatch_ = [self nodeToParentTransform]; + if( ! _parent || _parent == _batchNode ) + _transformToBatch = [self nodeToParentTransform]; else { - NSAssert( [parent_ isKindOfClass:[CCSprite class]], @"Logic error in CCSprite. Parent must be a CCSprite"); + NSAssert( [_parent isKindOfClass:[CCSprite class]], @"Logic error in CCSprite. Parent must be a CCSprite"); - transformToBatch_ = CGAffineTransformConcat( [self nodeToParentTransform] , ((CCSprite*)parent_)->transformToBatch_ ); + _transformToBatch = CGAffineTransformConcat( [self nodeToParentTransform] , ((CCSprite*)_parent)->_transformToBatch ); } // // calculate the Quad based on the Affine Matrix // - CGSize size = rect_.size; + CGSize size = _rect.size; - float x1 = offsetPosition_.x; - float y1 = offsetPosition_.y; + float x1 = _offsetPosition.x; + float y1 = _offsetPosition.y; float x2 = x1 + size.width; float y2 = y1 + size.height; - float x = transformToBatch_.tx; - float y = transformToBatch_.ty; + float x = _transformToBatch.tx; + float y = _transformToBatch.ty; - float cr = transformToBatch_.a; - float sr = transformToBatch_.b; - float cr2 = transformToBatch_.d; - float sr2 = -transformToBatch_.c; + float cr = _transformToBatch.a; + float sr = _transformToBatch.b; + float cr2 = _transformToBatch.d; + float sr2 = -_transformToBatch.c; float ax = x1 * cr - y1 * sr2 + x; float ay = x1 * sr + y1 * cr2 + y; @@ -465,31 +460,29 @@ -(void)updateTransform float dx = x1 * cr - y2 * sr2 + x; float dy = x1 * sr + y2 * cr2 + y; - quad_.bl.vertices = (ccVertex3F) { RENDER_IN_SUBPIXEL(ax), RENDER_IN_SUBPIXEL(ay), vertexZ_ }; - quad_.br.vertices = (ccVertex3F) { RENDER_IN_SUBPIXEL(bx), RENDER_IN_SUBPIXEL(by), vertexZ_ }; - quad_.tl.vertices = (ccVertex3F) { RENDER_IN_SUBPIXEL(dx), RENDER_IN_SUBPIXEL(dy), vertexZ_ }; - quad_.tr.vertices = (ccVertex3F) { RENDER_IN_SUBPIXEL(cx), RENDER_IN_SUBPIXEL(cy), vertexZ_ }; + _quad.bl.vertices = (ccVertex3F) { RENDER_IN_SUBPIXEL(ax), RENDER_IN_SUBPIXEL(ay), _vertexZ }; + _quad.br.vertices = (ccVertex3F) { RENDER_IN_SUBPIXEL(bx), RENDER_IN_SUBPIXEL(by), _vertexZ }; + _quad.tl.vertices = (ccVertex3F) { RENDER_IN_SUBPIXEL(dx), RENDER_IN_SUBPIXEL(dy), _vertexZ }; + _quad.tr.vertices = (ccVertex3F) { RENDER_IN_SUBPIXEL(cx), RENDER_IN_SUBPIXEL(cy), _vertexZ }; } - [textureAtlas_ updateQuad:&quad_ atIndex:atlasIndex_]; - dirty_ = recursiveDirty_ = NO; + [_textureAtlas updateQuad:&_quad atIndex:_atlasIndex]; + _dirty = _recursiveDirty = NO; } // recursively iterate over children - if( hasChildren_ ) - [children_ makeObjectsPerformSelector:@selector(updateTransform)]; + if( _hasChildren ) + [_children makeObjectsPerformSelector:@selector(updateTransform)]; #if CC_SPRITE_DEBUG_DRAW - if(!forceDisableDebugDraw_) { - // draw bounding box - CGPoint vertices[4] = { - ccp( quad_.bl.vertices.x, quad_.bl.vertices.y ), - ccp( quad_.br.vertices.x, quad_.br.vertices.y ), - ccp( quad_.tr.vertices.x, quad_.tr.vertices.y ), - ccp( quad_.tl.vertices.x, quad_.tl.vertices.y ), - }; - ccDrawPoly(vertices, 4, YES); - } + // draw bounding box + CGPoint vertices[4] = { + ccp( _quad.bl.vertices.x, _quad.bl.vertices.y ), + ccp( _quad.br.vertices.x, _quad.br.vertices.y ), + ccp( _quad.tr.vertices.x, _quad.tr.vertices.y ), + ccp( _quad.tl.vertices.x, _quad.tl.vertices.y ), + }; + ccDrawPoly(vertices, 4, YES); #endif // CC_SPRITE_DEBUG_DRAW } @@ -500,13 +493,13 @@ -(void) draw { CC_PROFILER_START_CATEGORY(kCCProfilerCategorySprite, @"CCSprite - draw"); - NSAssert(!batchNode_, @"If CCSprite is being rendered by CCSpriteBatchNode, CCSprite#draw SHOULD NOT be called"); + NSAssert(!_batchNode, @"If CCSprite is being rendered by CCSpriteBatchNode, CCSprite#draw SHOULD NOT be called"); CC_NODE_DRAW_SETUP(); - ccGLBlendFunc( blendFunc_.src, blendFunc_.dst ); + ccGLBlendFunc( _blendFunc.src, _blendFunc.dst ); - ccGLBindTexture2D( [texture_ name] ); + ccGLBindTexture2D( [_texture name] ); // // Attributes @@ -514,8 +507,8 @@ -(void) draw ccGLEnableVertexAttribs( kCCVertexAttribFlag_PosColorTex ); -#define kQuadSize sizeof(quad_.bl) - long offset = (long)&quad_; +#define kQuadSize sizeof(_quad.bl) + long offset = (long)&_quad; // vertex NSInteger diff = offsetof( ccV3F_C4B_T2F, vertices); @@ -536,27 +529,23 @@ -(void) draw #if CC_SPRITE_DEBUG_DRAW == 1 - if(!forceDisableDebugDraw_) { - // draw bounding box - CGPoint vertices[4]={ - ccp(quad_.tl.vertices.x,quad_.tl.vertices.y), - ccp(quad_.bl.vertices.x,quad_.bl.vertices.y), - ccp(quad_.br.vertices.x,quad_.br.vertices.y), - ccp(quad_.tr.vertices.x,quad_.tr.vertices.y), - }; - ccDrawPoly(vertices, 4, YES); - } + // draw bounding box + CGPoint vertices[4]={ + ccp(_quad.tl.vertices.x,_quad.tl.vertices.y), + ccp(_quad.bl.vertices.x,_quad.bl.vertices.y), + ccp(_quad.br.vertices.x,_quad.br.vertices.y), + ccp(_quad.tr.vertices.x,_quad.tr.vertices.y), + }; + ccDrawPoly(vertices, 4, YES); #elif CC_SPRITE_DEBUG_DRAW == 2 - if(!forceDisableDebugDraw_) { - // draw texture box - CGSize s = self.textureRect.size; - CGPoint offsetPix = self.offsetPosition; - CGPoint vertices[4] = { - ccp(offsetPix.x,offsetPix.y), ccp(offsetPix.x+s.width,offsetPix.y), - ccp(offsetPix.x+s.width,offsetPix.y+s.height), ccp(offsetPix.x,offsetPix.y+s.height) - }; - ccDrawPoly(vertices, 4, YES); - } + // draw texture box + CGSize s = self.textureRect.size; + CGPoint offsetPix = self.offsetPosition; + CGPoint vertices[4] = { + ccp(offsetPix.x,offsetPix.y), ccp(offsetPix.x+s.width,offsetPix.y), + ccp(offsetPix.x+s.width,offsetPix.y+s.height), ccp(offsetPix.x,offsetPix.y+s.height) + }; + ccDrawPoly(vertices, 4, YES); #endif // CC_SPRITE_DEBUG_DRAW CC_INCREMENT_GL_DRAWS(1); @@ -566,94 +555,85 @@ -(void) draw #pragma mark CCSprite - CCNode overrides --(void) addChild:(CCSprite*)child z:(NSInteger)z tag:(NSInteger) aTag +-(void) addChild:(CCNode *)childNode z:(NSInteger)z tag:(NSInteger) aTag { - NSAssert( child != nil, @"Argument must be non-nil"); + NSAssert( childNode != nil, @"Argument must be non-nil"); + CCSprite *child = (CCSprite *) childNode; - if( batchNode_ ) { + if( _batchNode ) { NSAssert( [child isKindOfClass:[CCSprite class]], @"CCSprite only supports CCSprites as children when using CCSpriteBatchNode"); - NSAssert( child.texture.name == textureAtlas_.texture.name, @"CCSprite is not using the same texture id"); + NSAssert( child.texture.name == _textureAtlas.texture.name, @"CCSprite is not using the same texture id"); //put it in descendants array of batch node - [batchNode_ appendChild:child]; + [_batchNode appendChild:child]; - if (!isReorderChildDirty_) + if (!_isReorderChildDirty) [self setReorderChildDirtyRecursively]; } - //CCNode already sets isReorderChildDirty_ so this needs to be after batchNode check + //CCNode already sets _isReorderChildDirty so this needs to be after batchNode check [super addChild:child z:z tag:aTag]; - hasChildren_ = YES; + _hasChildren = YES; } --(void) reorderChild:(CCSprite*)child z:(NSInteger)z +-(void) reorderChild:(CCNode *)childNode z:(NSInteger)z { - NSAssert( child != nil, @"Child must be non-nil"); - NSAssert( [children_ containsObject:child], @"Child doesn't belong to Sprite" ); + NSAssert( childNode != nil, @"Argument must be non-nil"); + CCSprite *child = (CCSprite *) childNode; + + NSAssert( [_children containsObject:child], @"Child doesn't belong to Sprite" ); if( z == child.zOrder ) return; - if( batchNode_ && ! isReorderChildDirty_) + if( _batchNode && ! _isReorderChildDirty) { [self setReorderChildDirtyRecursively]; - [batchNode_ reorderBatch:YES]; + [_batchNode reorderBatch:YES]; } [super reorderChild:child z:z]; } --(void)removeChild: (CCSprite *)sprite cleanup:(BOOL)doCleanup +-(void)removeChild: (CCNode *)spriteNode cleanup:(BOOL)doCleanup { - if( batchNode_ ) - [batchNode_ removeSpriteFromAtlas:sprite]; + NSAssert( spriteNode != nil, @"Argument must be non-nil"); + CCSprite *sprite = (CCSprite *) spriteNode; + + if( _batchNode ) + { + [_batchNode removeSpriteFromAtlas:sprite]; + } [super removeChild:sprite cleanup:doCleanup]; - hasChildren_ = ( [children_ count] > 0 ); + _hasChildren = ( [_children count] > 0 ); } -(void)removeAllChildrenWithCleanup:(BOOL)doCleanup { - if( batchNode_ ) { - CCSprite *child; - CCARRAY_FOREACH(children_, child) - [batchNode_ removeSpriteFromAtlas:child]; + if( _batchNode ) + { + for (CCSprite *child in _children) + [_batchNode removeSpriteFromAtlas:child]; } [super removeAllChildrenWithCleanup:doCleanup]; - hasChildren_ = NO; + _hasChildren = NO; } - (void) sortAllChildren { - if (isReorderChildDirty_) + if (_isReorderChildDirty) { - NSInteger i,j,length = children_->data->num; - CCNode** x = children_->data->arr; - CCNode *tempItem; + [_children sortUsingSelector:@selector(compareZOrderToNode:)]; - // insertion sort - for(i=1; i=0 && ( tempItem.zOrder < x[j].zOrder || ( tempItem.zOrder == x[j].zOrder && tempItem.orderOfArrival < x[j].orderOfArrival ) ) ) - { - x[j+1] = x[j]; - j = j-1; - } - x[j+1] = tempItem; - } + if ( _batchNode) + [_children makeObjectsPerformSelector:@selector(sortAllChildren)]; - if ( batchNode_) - [children_ makeObjectsPerformSelector:@selector(sortAllChildren)]; - - isReorderChildDirty_=NO; + _isReorderChildDirty=NO; } } @@ -667,11 +647,11 @@ -(void) setReorderChildDirtyRecursively { //only set parents flag the first time - if ( ! isReorderChildDirty_ ) + if ( ! _isReorderChildDirty ) { - isReorderChildDirty_ = YES; - CCNode* node = (CCNode*) parent_; - while (node && node != batchNode_) + _isReorderChildDirty = YES; + CCNode* node = (CCNode*) _parent; + while (node && node != _batchNode) { [(CCSprite*)node setReorderChildDirtyRecursively]; node=node.parent; @@ -681,20 +661,19 @@ -(void) setReorderChildDirtyRecursively -(void) setDirtyRecursively:(BOOL)b { - dirty_ = recursiveDirty_ = b; + _dirty = _recursiveDirty = b; // recursively set dirty - if( hasChildren_ ) { - CCSprite *child; - CCARRAY_FOREACH(children_, child) + if( _hasChildren ) { + for (CCSprite *child in _children) [child setDirtyRecursively:YES]; } } // XXX HACK: optimization #define SET_DIRTY_RECURSIVELY() { \ - if( batchNode_ && ! recursiveDirty_ ) { \ - dirty_ = recursiveDirty_ = YES; \ - if( hasChildren_) \ + if( _batchNode && ! _recursiveDirty ) { \ + _dirty = _recursiveDirty = YES; \ + if( _hasChildren) \ [self setDirtyRecursively:YES]; \ } \ } @@ -711,6 +690,18 @@ -(void)setRotation:(float)rot SET_DIRTY_RECURSIVELY(); } +-(void)setRotationalSkewX:(float)rot +{ + [super setRotationalSkewX:rot]; + SET_DIRTY_RECURSIVELY(); +} + +-(void)setRotationalSkewY:(float)rot +{ + [super setRotationalSkewY:rot]; + SET_DIRTY_RECURSIVELY(); +} + -(void)setSkewX:(float)sx { [super setSkewX:sx]; @@ -753,12 +744,6 @@ -(void)setAnchorPoint:(CGPoint)anchor SET_DIRTY_RECURSIVELY(); } --(void) setIgnoreAnchorPointForPosition:(BOOL)value -{ - NSAssert( ! batchNode_, @"ignoreAnchorPointForPosition is invalid in CCSprite"); - [super setIgnoreAnchorPointForPosition:value]; -} - -(void)setVisible:(BOOL)v { [super setVisible:v]; @@ -767,26 +752,26 @@ -(void)setVisible:(BOOL)v -(void)setFlipX:(BOOL)b { - if( flipX_ != b ) { - flipX_ = b; - [self setTextureRect:rect_ rotated:rectRotated_ untrimmedSize:contentSize_]; + if( _flipX != b ) { + _flipX = b; + [self setTextureRect:_rect rotated:_rectRotated untrimmedSize:_contentSize]; } } -(BOOL) flipX { - return flipX_; + return _flipX; } -(void) setFlipY:(BOOL)b { - if( flipY_ != b ) { - flipY_ = b; - [self setTextureRect:rect_ rotated:rectRotated_ untrimmedSize:contentSize_]; + if( _flipY != b ) { + _flipY = b; + [self setTextureRect:_rect rotated:_rectRotated untrimmedSize:_contentSize]; } } -(BOOL) flipY { - return flipY_; + return _flipY; } // @@ -795,142 +780,123 @@ -(BOOL) flipY #pragma mark CCSprite - RGBA protocol -(void) updateColor { - ccColor4B color4 = {color_.r, color_.g, color_.b, opacity_}; + ccColor4B color4 = {_displayedColor.r, _displayedColor.g, _displayedColor.b, _displayedOpacity}; - quad_.bl.colors = color4; - quad_.br.colors = color4; - quad_.tl.colors = color4; - quad_.tr.colors = color4; + + // special opacity for premultiplied textures + if ( _opacityModifyRGB ) { + color4.r *= _displayedOpacity/255.0f; + color4.g *= _displayedOpacity/255.0f; + color4.b *= _displayedOpacity/255.0f; + } + + _quad.bl.colors = color4; + _quad.br.colors = color4; + _quad.tl.colors = color4; + _quad.tr.colors = color4; // renders using batch node - if( batchNode_ ) { - if( atlasIndex_ != CCSpriteIndexNotInitialized) - [textureAtlas_ updateQuad:&quad_ atIndex:atlasIndex_]; + if( _batchNode ) { + if( _atlasIndex != CCSpriteIndexNotInitialized) + [_textureAtlas updateQuad:&_quad atIndex:_atlasIndex]; else // no need to set it recursively - // update dirty_, don't update recursiveDirty_ - dirty_ = YES; + // update _dirty, don't update _recursiveDirty + _dirty = YES; } // self render // do nothing } --(GLubyte) opacity -{ - return opacity_; -} - --(void) setOpacity:(GLubyte) anOpacity +-(void) setColor:(ccColor3B)color3 { - opacity_ = anOpacity; - - // special opacity for premultiplied textures - if( opacityModifyRGB_ ) - [self setColor: colorUnmodified_]; - + [super setColor:color3]; [self updateColor]; } -- (ccColor3B) color +-(void)updateDisplayedColor:(ccColor3B)parentColor { - if(opacityModifyRGB_) - return colorUnmodified_; - - return color_; + [super updateDisplayedColor:parentColor]; + [self updateColor]; } --(void) setColor:(ccColor3B)color3 +-(void) setOpacity:(GLubyte)opacity { - color_ = colorUnmodified_ = color3; - - if( opacityModifyRGB_ ){ - color_.r = color3.r * opacity_/255.0f; - color_.g = color3.g * opacity_/255.0f; - color_.b = color3.b * opacity_/255.0f; - } - + [super setOpacity:opacity]; [self updateColor]; } -(void) setOpacityModifyRGB:(BOOL)modify { - ccColor3B oldColor = self.color; - opacityModifyRGB_ = modify; - self.color = oldColor; + if( _opacityModifyRGB != modify ) { + _opacityModifyRGB = modify; + [self updateColor]; + } } -(BOOL) doesOpacityModifyRGB { - return opacityModifyRGB_; + return _opacityModifyRGB; +} + +-(void)updateDisplayedOpacity:(GLubyte)parentOpacity +{ + [super updateDisplayedOpacity:parentOpacity]; + [self updateColor]; } + // // Frames // #pragma mark CCSprite - Frames --(void) setDisplayFrame:(CCSpriteFrame*)frame +-(void) setSpriteFrame:(CCSpriteFrame*)frame { - unflippedOffsetPositionFromCenter_ = frame.offset; + _unflippedOffsetPositionFromCenter = frame.offset; CCTexture2D *newTexture = [frame texture]; // update texture before updating texture rect - if ( newTexture.name != texture_.name ) + if ( newTexture.name != _texture.name ) [self setTexture: newTexture]; // update rect - rectRotated_ = frame.rotated; + _rectRotated = frame.rotated; - [self setTextureRect:frame.rect rotated:rectRotated_ untrimmedSize:frame.originalSize]; + [self setTextureRect:frame.rect rotated:_rectRotated untrimmedSize:frame.originalSize]; + + _spriteFrame = frame; } --(void) setDisplayFrameWithAnimationName: (NSString*) animationName index:(int) frameIndex +-(void) setSpriteFrameWithAnimationName: (NSString*) animationName index:(int) frameIndex { - NSAssert( animationName, @"CCSprite#setDisplayFrameWithAnimationName. animationName must not be nil"); + NSAssert( animationName, @"CCSprite#setSpriteFrameWithAnimationName. animationName must not be nil"); CCAnimation *a = [[CCAnimationCache sharedAnimationCache] animationByName:animationName]; - NSAssert( a, @"CCSprite#setDisplayFrameWithAnimationName: Frame not found"); + NSAssert( a, @"CCSprite#setSpriteFrameWithAnimationName: Frame not found"); CCAnimationFrame *frame = [[a frames] objectAtIndex:frameIndex]; - NSAssert( frame, @"CCSprite#setDisplayFrame. Invalid frame"); - - [self setDisplayFrame:frame.spriteFrame]; -} - - --(BOOL) isFrameDisplayed:(CCSpriteFrame*)frame -{ - CGRect r = [frame rect]; - return ( CGRectEqualToRect(r, rect_) && - frame.texture.name == self.texture.name && - CGPointEqualToPoint( frame.offset, unflippedOffsetPositionFromCenter_ ) ); -} - --(CCSpriteFrame*) displayFrame -{ - return [CCSpriteFrame frameWithTexture:texture_ - rectInPixels:CC_RECT_POINTS_TO_PIXELS(rect_) - rotated:rectRotated_ - offset:CC_POINT_POINTS_TO_PIXELS(unflippedOffsetPositionFromCenter_) - originalSize:CC_SIZE_POINTS_TO_PIXELS(contentSize_)]; + NSAssert( frame, @"CCSprite#setSpriteFrame. Invalid frame"); + + self.spriteFrame = frame.spriteFrame; } #pragma mark CCSprite - CocosNodeTexture protocol -(void) updateBlendFunc { - NSAssert( ! batchNode_, @"CCSprite: updateBlendFunc doesn't work when the sprite is rendered using a CCSpriteBatchNode"); + NSAssert( ! _batchNode, @"CCSprite: updateBlendFunc doesn't work when the sprite is rendered using a CCSpriteBatchNode"); // it is possible to have an untextured sprite - if( !texture_ || ! [texture_ hasPremultipliedAlpha] ) { - blendFunc_.src = GL_SRC_ALPHA; - blendFunc_.dst = GL_ONE_MINUS_SRC_ALPHA; + if( !_texture || ! [_texture hasPremultipliedAlpha] ) { + _blendFunc.src = GL_SRC_ALPHA; + _blendFunc.dst = GL_ONE_MINUS_SRC_ALPHA; [self setOpacityModifyRGB:NO]; } else { - blendFunc_.src = CC_BLEND_SRC; - blendFunc_.dst = CC_BLEND_DST; + _blendFunc.src = CC_BLEND_SRC; + _blendFunc.dst = CC_BLEND_DST; [self setOpacityModifyRGB:YES]; } } @@ -938,14 +904,13 @@ -(void) updateBlendFunc -(void) setTexture:(CCTexture2D*)texture { // If batchnode, then texture id should be the same - NSAssert( !batchNode_ || texture.name == batchNode_.texture.name , @"CCSprite: Batched sprites should use the same texture as the batchnode"); + NSAssert( !_batchNode || texture.name == _batchNode.texture.name , @"CCSprite: Batched sprites should use the same texture as the batchnode"); // accept texture==nil as argument NSAssert( !texture || [texture isKindOfClass:[CCTexture2D class]], @"setTexture expects a CCTexture2D. Invalid argument"); - if( ! batchNode_ && texture_ != texture ) { - [texture_ release]; - texture_ = [texture retain]; + if( ! _batchNode && _texture != texture ) { + _texture = texture; [self updateBlendFunc]; } @@ -953,7 +918,32 @@ -(void) setTexture:(CCTexture2D*)texture -(CCTexture2D*) texture { - return texture_; + return _texture; } @end + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/cocos2d/CCSprite9Slice.h b/cocos2d/CCSprite9Slice.h new file mode 100644 index 0000000..9ec57d5 --- /dev/null +++ b/cocos2d/CCSprite9Slice.h @@ -0,0 +1,96 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2008-2010 Ricardo Quesada + * Copyright (c) 2011 Zynga Inc. + * Copyright (c) 2013 Lars Birkemose + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + */ + +#import +#import "cocos2d.h" + +/* + * Implements a 9 slice sprite + * The sprite can be scaled, by using scale, scaleX and scaleY + * A margin will be kept unscaled + */ + +// --------------------------------------------------------------------- + +@interface CCSprite9Slice : CCSprite +{ + +} + +// --------------------------------------------------------------------- + +@property (nonatomic, assign) float margin; // normalized unstretched margin + +@property (nonatomic, assign) float marginLeft; +@property (nonatomic, assign) float marginRight; +@property (nonatomic, assign) float marginTop; +@property (nonatomic, assign) float marginBottom; + +// --------------------------------------------------------------------- + +@end + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/cocos2d/CCSprite9Slice.m b/cocos2d/CCSprite9Slice.m new file mode 100644 index 0000000..d1b2c88 --- /dev/null +++ b/cocos2d/CCSprite9Slice.m @@ -0,0 +1,320 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2008-2010 Ricardo Quesada + * Copyright (c) 2011 Zynga Inc. + * Copyright (c) 2013 Lars Birkemose + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + */ + +#import "CCSprite9Slice.h" + +// --------------------------------------------------------------------- + +static const float CCSprite9SliceMarginDefault = 1.0f/3.0f; + +typedef enum { + CCSprite9SliceStrips = 3, + CCSprite9SliceVerticesX = 4, + CCSprite9SliceVerticesY = 4, + CCSprite9SliceVertices = 8, +} CCSprite9SliceSizes; + +// --------------------------------------------------------------------- + +@implementation CCSprite9Slice +{ + CGSize _originalContentSize; + CGPoint _contentScale; +} + +// --------------------------------------------------------------------- +#pragma mark - create and destroy +// --------------------------------------------------------------------- + +- (id)initWithTexture:(CCTexture2D *)texture rect:(CGRect)rect rotated:(BOOL)rotated +{ + self = [super initWithTexture:texture rect:rect rotated:rotated]; + NSAssert(self != nil, @"Unable to create class"); + + // initialize new parts in 9slice + _marginLeft = CCSprite9SliceMarginDefault; + _marginRight = CCSprite9SliceMarginDefault; + _marginTop = CCSprite9SliceMarginDefault; + _marginBottom = CCSprite9SliceMarginDefault; + + // done + return(self); +} + +// --------------------------------------------------------------------- +// override to set original contentSize when a texture is assigned + +- (void)setTextureRect:(CGRect)rect rotated:(BOOL)rotated untrimmedSize:(CGSize)untrimmedSize +{ + CGSize oldContentSize = self.contentSize; + CCContentSizeType oldContentSizeType = self.contentSizeType; + + [super setTextureRect:rect rotated:rotated untrimmedSize:untrimmedSize]; + _originalContentSize = self.contentSizeInPoints; + + if (!CGSizeEqualToSize(oldContentSize, CGSizeZero)) + { + self.contentSizeType = oldContentSizeType; + self.contentSize = oldContentSize; + } +} + +// --------------------------------------------------------------------- +#pragma mark - draw +// --------------------------------------------------------------------- + +- (ccV3F_C4B_T2F)calculateVertice:(CGPoint)mult andTexture:(CGPoint)texMult +{ + ccV3F_C4B_T2F result; + + // calculate vertices, color and texture coordinates + result.vertices.x = _contentScale.x * ((_quad.bl.vertices.x * (1 - mult.x)) + (_quad.br.vertices.x * mult.x)); + result.vertices.y = _contentScale.y * ((_quad.bl.vertices.y * (1 - mult.y)) + (_quad.tl.vertices.y * mult.y)); + result.vertices.z = _quad.bl.vertices.z; + result.colors = _quad.bl.colors; + if (_rectRotated) + { + result.texCoords.u = (_quad.bl.texCoords.u * (1 - texMult.y)) + (_quad.tr.texCoords.u * texMult.y); + result.texCoords.v = (_quad.bl.texCoords.v * (1 - texMult.x)) + (_quad.br.texCoords.v * texMult.x); + } + else + { + result.texCoords.u = (_quad.bl.texCoords.u * (1 - texMult.x)) + (_quad.br.texCoords.u * texMult.x); + result.texCoords.v = (_quad.bl.texCoords.v * (1 - texMult.y)) + (_quad.tl.texCoords.v * texMult.y); + } + // done + return(result); +} + +// --------------------------------------------------------------------- +// this completely overrides draw of CCSprite +// sprite is divided into 9 quads, and rendered as 3 triangle strips +// + +-( void )draw +{ + // create a clamped content size + CGSize clampedSize = self.contentSizeInPoints; + if (clampedSize.width < (_originalContentSize.width * (_marginLeft + _marginRight))) clampedSize.width = _originalContentSize.width * (_marginLeft + _marginRight); + if (clampedSize.height < (_originalContentSize.height * (_marginTop + _marginBottom))) clampedSize.height = _originalContentSize.height * (_marginTop + _marginBottom); + + _contentScale = CGPointMake(clampedSize.width / _originalContentSize.width, clampedSize.height / _originalContentSize.height); + + CC_PROFILER_START_CATEGORY(kCCProfilerCategorySprite, @"CCSprite9Slice - draw"); + + CC_NODE_DRAW_SETUP(); + + ccGLBlendFunc(_blendFunc.src, _blendFunc.dst); + + ccGLBindTexture2D([_texture name]); + + // enable buffers + ccGLEnableVertexAttribs(kCCVertexAttribFlag_PosColorTex); + + // create space for a single strip, and set single color + ccV3F_C4B_T2F vertice[CCSprite9SliceVertices]; + + // set the buffer positions + // position + glVertexAttribPointer(kCCVertexAttrib_Position, 3, GL_FLOAT, GL_FALSE, sizeof(ccV3F_C4B_T2F), (void *)&vertice[0].vertices); + // texCoods + glVertexAttribPointer(kCCVertexAttrib_TexCoords, 2, GL_FLOAT, GL_FALSE, sizeof(ccV3F_C4B_T2F), (void *)&vertice[0].texCoords); + // color + glVertexAttribPointer(kCCVertexAttrib_Color, 4, GL_UNSIGNED_BYTE, GL_TRUE, sizeof(ccV3F_C4B_T2F), (void *)&vertice[0].colors); + + // create some helper vars + float multX[CCSprite9SliceVerticesX] = {0, _marginLeft / _contentScale.x, 1 - (_marginRight / _contentScale.x), 1}; + float multY[CCSprite9SliceVerticesY] = {0, _marginBottom / _contentScale.y, 1 - (_marginTop / _contentScale.y), 1}; + + float texMultX[CCSprite9SliceVerticesX] = {0, _marginLeft, 1 - _marginRight, 1}; + float texMultY[CCSprite9SliceVerticesY] = {0, _marginBottom, 1 - _marginTop, 1}; + + // create bottow row vertices + for (int index = 0; index < CCSprite9SliceVerticesX; index ++) + { + vertice[index * 2] = [self calculateVertice:ccp(multX[index], multY[0]) andTexture:ccp(texMultX[index], texMultY[0])]; + } + + // scan through the strips + for (int strip = 0; strip < CCSprite9SliceStrips; strip ++) + { + // create top row vertices + for (int index = 0; index < CCSprite9SliceVerticesX; index ++) + { + vertice[(index * 2 ) + 1] = [self calculateVertice:ccp(multX[index], multY[strip + 1]) andTexture:ccp(texMultX[index], texMultY[strip + 1])]; + } + + // draw + glDrawArrays(GL_TRIANGLE_STRIP, 0, 8); + + // copy top vertices to bottom vertices + for (int index = 0; index < CCSprite9SliceVerticesX; index ++) + { + vertice[index * 2] = vertice[(index * 2) + 1]; + } + + } + + // check for errors + CHECK_GL_ERROR_DEBUG(); + + +#if CC_SPRITE_DEBUG_DRAW == 1 + // draw bounding box + CGPoint vertices[4] = + { + ccp(_quad.bl.vertices.x,_quad.bl.vertices.y), + ccp(_quad.bl.vertices.x + _contentSize.width,_quad.bl.vertices.y), + ccp(_quad.bl.vertices.x + _contentSize.width,_quad.bl.vertices.y + _contentSize.height), + ccp(_quad.bl.vertices.x,_quad.bl.vertices.y + _contentSize.height), + }; + ccDrawPoly(vertices, 4, YES); +#elif CC_SPRITE_DEBUG_DRAW == 2 + // draw texture box + CGSize s = self.textureRect.size; + CGPoint offsetPix = self.offsetPosition; + CGPoint vertices[4] = + { + ccp(offsetPix.x,offsetPix.y), ccp(offsetPix.x+s.width,offsetPix.y), + ccp(offsetPix.x+s.width,offsetPix.y+s.height), ccp(offsetPix.x,offsetPix.y+s.height) + }; + ccDrawPoly(vertices, 4, YES); +#endif // CC_SPRITE_DEBUG_DRAW + + CC_INCREMENT_GL_DRAWS(1); + + CC_PROFILER_STOP_CATEGORY(kCCProfilerCategorySprite, @"CCSprite9Slice - draw"); +} + +// --------------------------------------------------------------------- +#pragma mark - properties +// --------------------------------------------------------------------- + +#pragma clang diagnostic push COCOS2D +#pragma clang diagnostic ignored "-Wfloat-equal" +- (float)margin +{ + // if margins are not the same, a unified margin can nort be read + NSAssert(_marginLeft == _marginRight == _marginTop == _marginBottom, @"Margin can not be read. Do not know which margin to return"); + // just return any of them + return(_marginLeft); +} + +- (void)setMargin:(float)margin +{ + margin = clampf(margin, 0, 1); + _marginLeft = margin; + _marginRight = margin; + _marginTop = margin; + _marginBottom = margin; +} + +// --------------------------------------------------------------------- + +- (void)setMarginLeft:(float)marginLeft +{ + _marginLeft = clampf(marginLeft, 0, 1); + // sum of left and right margin, can not exceed 1 + NSAssert((_marginLeft + _marginRight) <= 1, @"Sum of left and right margine, can not exceed 1"); +} + +- (void)setMarginRight:(float)marginRight +{ + _marginRight = clampf(marginRight, 0, 1); + // sum of left and right margin, can not exceed 1 + NSAssert((_marginLeft + _marginRight) <= 1, @"Sum of left and right margine, can not exceed 1"); +} + +- (void)setMarginTop:(float)marginTop +{ + _marginTop = clampf(marginTop, 0, 1); + // sum of top and bottom margin, can not exceed 1 + NSAssert((_marginTop + _marginBottom) <= 1, @"Sum of top and bottom margine, can not exceed 1"); +} + +- (void)setMarginBottom:(float)marginBottom +{ + _marginBottom = clampf(marginBottom, 0, 1); + // sum of top and bottom margin, can not exceed 1 + NSAssert((_marginTop + _marginBottom) <= 1, @"Sum of top and bottom margine, can not exceed 1"); +} +#pragma clang diagnostic pop COCOS2D + +// --------------------------------------------------------------------- + +- (void)setBatchNode:(CCSpriteBatchNode *)batchNode +{ + NSAssert(batchNode == nil, @"CCSprite9Slice can not be rendered as a batch node!"); +} + +// --------------------------------------------------------------------- + +@end + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/cocos2d/CCSpriteBatchNode.h b/cocos2d/CCSpriteBatchNode.h new file mode 100644 index 0000000..554bc94 --- /dev/null +++ b/cocos2d/CCSpriteBatchNode.h @@ -0,0 +1,145 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (C) 2009 Matt Oswald + * + * Copyright (c) 2009-2010 Ricardo Quesada + * Copyright (c) 2011 Zynga Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + */ + + +#import "CCNode.h" +#import "CCProtocols.h" +#import "CCTextureAtlas.h" +#import "ccMacros.h" + +#pragma mark CCSpriteBatchNode + +@class CCSprite; + +/** CCSpriteBatchNode is like a batch node: if it contains children, it will draw them in 1 single OpenGL call + * (often known as "batch draw"). + * + * A CCSpriteBatchNode can reference one and only one texture (one image file, one texture atlas). + * Only the CCSprites that are contained in that texture can be added to the CCSpriteBatchNode. + * All CCSprites added to a CCSpriteBatchNode are drawn in one OpenGL ES draw call. + * If the CCSprites are not added to a CCSpriteBatchNode then an OpenGL ES draw call will be needed for each one, which is less efficient. + * + * + * Limitations: + * - The only object that is accepted as child (or grandchild, grand-grandchild, etc...) is CCSprite or any subclass of CCSprite. eg: particles, labels and layer can't be added to a CCSpriteBatchNode. + * - Either all its children are Aliased or Antialiased. It can't be a mix. This is because "alias" is a property of the texture, and all the sprites share the same texture. + * + * @since v0.7.1 + */ +@interface CCSpriteBatchNode : CCNode +{ + CCTextureAtlas *_textureAtlas; + ccBlendFunc _blendFunc; + + // all descendants: children, grandchildren, etc... + NSMutableArray *_descendants; +} + +/** returns the TextureAtlas that is used */ +@property (nonatomic,readwrite,strong) CCTextureAtlas * textureAtlas; + +/** conforms to CCTextureProtocol protocol */ +@property (nonatomic,readwrite) ccBlendFunc blendFunc; + +/** descendants (children, grandchildren, etc) */ +@property (nonatomic,readonly) NSArray *descendants; + +/** creates a CCSpriteBatchNode with a texture2d and a default capacity of 29 children. + The capacity will be increased in 33% in runtime if it run out of space. + */ ++(id)batchNodeWithTexture:(CCTexture2D *)tex; + +/** creates a CCSpriteBatchNode with a texture2d and capacity of children. + The capacity will be increased in 33% in runtime if it run out of space. + */ ++(id)batchNodeWithTexture:(CCTexture2D *)tex capacity:(NSUInteger)capacity; + +/** creates a CCSpriteBatchNode with a file image (.png, .jpeg, .pvr, etc) with a default capacity of 29 children. + The capacity will be increased in 33% in runtime if it run out of space. + The file will be loaded using the TextureMgr. + */ ++(id)batchNodeWithFile:(NSString*) fileImage; + +/** creates a CCSpriteBatchNode with a file image (.png, .jpeg, .pvr, etc) and capacity of children. + The capacity will be increased in 33% in runtime if it run out of space. + The file will be loaded using the TextureMgr. +*/ ++(id)batchNodeWithFile:(NSString*)fileImage capacity:(NSUInteger)capacity; + +/** initializes a CCSpriteBatchNode with a texture2d and capacity of children. + The capacity will be increased in 33% in runtime if it run out of space. + */ +-(id)initWithTexture:(CCTexture2D *)tex capacity:(NSUInteger)capacity; +/** initializes a CCSpriteBatchNode with a file image (.png, .jpeg, .pvr, etc) and a capacity of children. + The capacity will be increased in 33% in runtime if it run out of space. + The file will be loaded using the TextureMgr. + */ +-(id)initWithFile:(NSString*)fileImage capacity:(NSUInteger)capacity; + +-(void) increaseAtlasCapacity; + +/** removes a child given a certain index. It will also cleanup the running actions depending on the cleanup parameter. + @warning Removing a child from a CCSpriteBatchNode is very slow + */ +-(void)removeChildAtIndex:(NSUInteger)index cleanup:(BOOL)doCleanup; + +/** removes a child given a reference. It will also cleanup the running actions depending on the cleanup parameter. + @warning Removing a child from a CCSpriteBatchNode is very slow + */ +-(void)removeChild: (CCNode *)sprite cleanup:(BOOL)doCleanup; + +-(void) insertChild:(CCSprite*)child inAtlasAtIndex:(NSUInteger)index; +-(void) appendChild:(CCSprite*)sprite; +-(void) removeSpriteFromAtlas:(CCSprite*)sprite; + +-(NSUInteger) rebuildIndexInOrder:(CCSprite*)parent atlasIndex:(NSUInteger)index; +-(NSUInteger) atlasIndexForChild:(CCSprite*)sprite atZ:(NSInteger)z; +/* Sprites use this to start sortChildren, don't call this manually */ +- (void) reorderBatch:(BOOL) reorder; + +@end + +@interface CCSpriteBatchNode (QuadExtensions) +/** Inserts a quad at a certain index into the texture atlas. The CCSprite won't be added into the children array. + This method should be called only when you are dealing with very big AtlasSrite and when most of the CCSprite won't be updated. + For example: a tile map (CCTMXMap) or a label with lots of characters (CCLabelBMFont) + */ +-(void) insertQuadFromSprite:(CCSprite*)sprite quadIndex:(NSUInteger)index; + +/** Updates a quad at a certain index into the texture atlas. The CCSprite won't be added into the children array. + This method should be called only when you are dealing with very big AtlasSrite and when most of the CCSprite won't be updated. + For example: a tile map (CCTMXMap) or a label with lots of characters (CCLabelBMFont) + */ +-(void) updateQuadFromSprite:(CCSprite*)sprite quadIndex:(NSUInteger)index; + +/* This is the opposite of "addQuadFromSprite". + It adds the sprite to the children and descendants array, but it doesn't add it to the texture atlas. + */ +-(id) addSpriteWithoutQuad:(CCSprite*)child z:(NSUInteger)z tag:(NSInteger)aTag; + +@end diff --git a/src/cocos2d/CCSpriteBatchNode.m b/cocos2d/CCSpriteBatchNode.m similarity index 70% rename from src/cocos2d/CCSpriteBatchNode.m rename to cocos2d/CCSpriteBatchNode.m index 9928e50..5180a99 100644 --- a/src/cocos2d/CCSpriteBatchNode.m +++ b/cocos2d/CCSpriteBatchNode.m @@ -44,7 +44,7 @@ // external #import "kazmath/GL/matrix.h" -const NSUInteger defaultCapacity = 29; +static const NSUInteger defaultCapacity = 29; #pragma mark - #pragma mark CCSpriteBatchNode @@ -57,9 +57,9 @@ -(void) updateBlendFunc; @implementation CCSpriteBatchNode -@synthesize textureAtlas = textureAtlas_; -@synthesize blendFunc = blendFunc_; -@synthesize descendants = descendants_; +@synthesize textureAtlas = _textureAtlas; +@synthesize blendFunc = _blendFunc; +@synthesize descendants = _descendants; /* @@ -67,12 +67,12 @@ @implementation CCSpriteBatchNode */ +(id)batchNodeWithTexture:(CCTexture2D *)tex { - return [[[self alloc] initWithTexture:tex capacity:defaultCapacity] autorelease]; + return [[self alloc] initWithTexture:tex capacity:defaultCapacity]; } +(id)batchNodeWithTexture:(CCTexture2D *)tex capacity:(NSUInteger)capacity { - return [[[self alloc] initWithTexture:tex capacity:capacity] autorelease]; + return [[self alloc] initWithTexture:tex capacity:capacity]; } /* @@ -80,17 +80,17 @@ +(id)batchNodeWithTexture:(CCTexture2D *)tex capacity:(NSUInteger)capacity */ +(id)batchNodeWithFile:(NSString*)fileImage capacity:(NSUInteger)capacity { - return [[[self alloc] initWithFile:fileImage capacity:capacity] autorelease]; + return [[self alloc] initWithFile:fileImage capacity:capacity]; } +(id)batchNodeWithFile:(NSString*) imageFile { - return [[[self alloc] initWithFile:imageFile capacity:defaultCapacity] autorelease]; + return [[self alloc] initWithFile:imageFile capacity:defaultCapacity]; } -(id)init { - return [self initWithTexture:[[[CCTexture2D alloc] init] autorelease] capacity:0]; + return [self initWithTexture:[[CCTexture2D alloc] init] capacity:0]; } -(id)initWithFile:(NSString *)fileImage capacity:(NSUInteger)capacity @@ -104,15 +104,15 @@ -(id)initWithTexture:(CCTexture2D *)tex capacity:(NSUInteger)capacity { if( (self=[super init])) { - blendFunc_.src = CC_BLEND_SRC; - blendFunc_.dst = CC_BLEND_DST; - textureAtlas_ = [[CCTextureAtlas alloc] initWithTexture:tex capacity:capacity]; + _blendFunc.src = CC_BLEND_SRC; + _blendFunc.dst = CC_BLEND_DST; + _textureAtlas = [[CCTextureAtlas alloc] initWithTexture:tex capacity:capacity]; [self updateBlendFunc]; // no lazy alloc in this node - children_ = [[CCArray alloc] initWithCapacity:capacity]; - descendants_ = [[CCArray alloc] initWithCapacity:capacity]; + _children = [[NSMutableArray alloc] initWithCapacity:capacity]; + _descendants = [[NSMutableArray alloc] initWithCapacity:capacity]; self.shaderProgram = [[CCShaderCache sharedShaderCache] programForKey:kCCShader_PositionTextureColor]; } @@ -123,16 +123,9 @@ -(id)initWithTexture:(CCTexture2D *)tex capacity:(NSUInteger)capacity - (NSString*) description { - return [NSString stringWithFormat:@"<%@ = %p | Tag = %ld>", [self class], self, (long)tag_ ]; + return [NSString stringWithFormat:@"<%@ = %p | Tag = %ld>", [self class], self, (long)_tag ]; } --(void)dealloc -{ - [textureAtlas_ release]; - [descendants_ release]; - - [super dealloc]; -} #pragma mark CCSpriteBatchNode - composition @@ -142,8 +135,8 @@ -(void) visit { CC_PROFILER_START_CATEGORY(kCCProfilerCategoryBatchSprite, @"CCSpriteBatchNode - visit"); - NSAssert(parent_ != nil, @"CCSpriteBatchNode should NOT be root node"); - + NSAssert(_parent != nil, @"CCSpriteBatchNode should NOT be root node"); + // CAREFUL: // This visit is almost identical to CCNode#visit // with the exception that it doesn't call visit on its children @@ -151,13 +144,13 @@ -(void) visit // The alternative is to have a void CCSprite#visit, but // although this is less mantainable, is faster // - if (!visible_) + if (!_visible) return; kmGLPushMatrix(); - if ( grid_ && grid_.active) { - [grid_ beforeDraw]; + if ( _grid && _grid.active) { + [_grid beforeDraw]; [self transformAncestors]; } @@ -165,22 +158,23 @@ -(void) visit [self transform]; [self draw]; - if ( grid_ && grid_.active) - [grid_ afterDraw:self]; + if ( _grid && _grid.active) + [_grid afterDraw:self]; kmGLPopMatrix(); - orderOfArrival_ = 0; + _orderOfArrival = 0; CC_PROFILER_STOP_CATEGORY(kCCProfilerCategoryBatchSprite, @"CCSpriteBatchNode - visit"); } // override addChild: --(void) addChild:(CCSprite*)child z:(NSInteger)z tag:(NSInteger) aTag +-(void) addChild:(CCNode *)childNode z:(NSInteger)z tag:(NSInteger) aTag { + CCSprite *child = (CCSprite *)childNode; NSAssert( child != nil, @"Argument must be non-nil"); NSAssert( [child isKindOfClass:[CCSprite class]], @"CCSpriteBatchNode only supports CCSprites as children"); - NSAssert( child.texture.name == textureAtlas_.texture.name, @"CCSprite is not using the same texture id"); + NSAssert( child.texture.name == _textureAtlas.texture.name, @"CCSprite is not using the same texture id"); [super addChild:child z:z tag:aTag]; @@ -188,10 +182,11 @@ -(void) addChild:(CCSprite*)child z:(NSInteger)z tag:(NSInteger) aTag } // override reorderChild --(void) reorderChild:(CCSprite*)child z:(NSInteger)z +-(void) reorderChild:(CCNode *)childNode z:(NSInteger)z { + CCSprite *child = (CCSprite *)childNode; NSAssert( child != nil, @"Child must be non-nil"); - NSAssert( [children_ containsObject:child], @"Child doesn't belong to Sprite" ); + NSAssert( [_children containsObject:child], @"Child doesn't belong to Sprite" ); if( z == child.zOrder ) return; @@ -201,13 +196,14 @@ -(void) reorderChild:(CCSprite*)child z:(NSInteger)z } // override removeChild: --(void)removeChild: (CCSprite *)sprite cleanup:(BOOL)doCleanup +-(void)removeChild: (CCNode *)spriteNode cleanup:(BOOL)doCleanup { + CCSprite *sprite = (CCSprite *)spriteNode; // explicit nil handling if (sprite == nil) return; - NSAssert([children_ containsObject:sprite], @"CCSpriteBatchNode doesn't contain the sprite. Can't remove it"); + NSAssert([_children containsObject:sprite], @"CCSpriteBatchNode doesn't contain the sprite. Can't remove it"); // cleanup before removing [self removeSpriteFromAtlas:sprite]; @@ -217,28 +213,31 @@ -(void)removeChild: (CCSprite *)sprite cleanup:(BOOL)doCleanup -(void)removeChildAtIndex:(NSUInteger)index cleanup:(BOOL)doCleanup { - [self removeChild:(CCSprite *)[children_ objectAtIndex:index] cleanup:doCleanup]; + [self removeChild:(CCSprite *)[_children objectAtIndex:index] cleanup:doCleanup]; } -(void)removeAllChildrenWithCleanup:(BOOL)doCleanup { // Invalidate atlas index. issue #569 // useSelfRender should be performed on all descendants. issue #1216 - [descendants_ makeObjectsPerformSelector:@selector(setBatchNode:) withObject:nil]; + [_descendants makeObjectsPerformSelector:@selector(setBatchNode:) withObject:nil]; [super removeAllChildrenWithCleanup:doCleanup]; - [descendants_ removeAllObjects]; - [textureAtlas_ removeAllQuads]; + [_descendants removeAllObjects]; + [_textureAtlas removeAllQuads]; } //override sortAllChildren - (void) sortAllChildren { - if (isReorderChildDirty_) + if (_isReorderChildDirty) { - NSInteger i,j,length = children_->data->num; - CCNode ** x = children_->data->arr; + [_children sortUsingSelector:@selector(compareZOrderToNode:)]; + + /* + NSInteger i,j,length = _children->data->num; + CCNode ** x = _children->data->arr; CCNode *tempItem; CCSprite *child; @@ -256,29 +255,29 @@ - (void) sortAllChildren } x[j+1] = tempItem; - } + }*/ //sorted now check all children - if ([children_ count] > 0) + if ([_children count] > 0) { //first sort all children recursively based on zOrder - [children_ makeObjectsPerformSelector:@selector(sortAllChildren)]; + [_children makeObjectsPerformSelector:@selector(sortAllChildren)]; NSInteger index=0; //fast dispatch, give every child a new atlasIndex based on their relative zOrder (keep parent -> child relations intact) // and at the same time reorder descedants and the quads to the right index - CCARRAY_FOREACH(children_, child) + for (CCSprite* child in _children) [self updateAtlasIndex:child currentIndex:&index]; } - isReorderChildDirty_=NO; + _isReorderChildDirty=NO; } } -(void) updateAtlasIndex:(CCSprite*) sprite currentIndex:(NSInteger*) curIndex { - CCArray *array = [sprite children]; + NSMutableArray *array = (NSMutableArray*)[sprite children]; NSUInteger count = [array count]; NSInteger oldIndex; @@ -295,7 +294,7 @@ -(void) updateAtlasIndex:(CCSprite*) sprite currentIndex:(NSInteger*) curIndex { BOOL needNewIndex=YES; - if (((CCSprite*) (array->data->arr[0])).zOrder >= 0) + if (((CCSprite*) [array objectAtIndex:0]).zOrder >= 0) { //all children are in front of the parent oldIndex = sprite.atlasIndex; @@ -308,8 +307,7 @@ -(void) updateAtlasIndex:(CCSprite*) sprite currentIndex:(NSInteger*) curIndex needNewIndex = NO; } - CCSprite* child; - CCARRAY_FOREACH(array,child) + for (CCSprite* child in array) { if (needNewIndex && child.zOrder >= 0) { @@ -340,24 +338,14 @@ -(void) updateAtlasIndex:(CCSprite*) sprite currentIndex:(NSInteger*) curIndex - (void) swap:(NSInteger) oldIndex withNewIndex:(NSInteger) newIndex { - id* x = descendants_->data->arr; - ccV3F_C4B_T2F_Quad* quads = textureAtlas_.quads; - - id tempItem = x[oldIndex]; - ccV3F_C4B_T2F_Quad tempItemQuad=quads[oldIndex]; - - //update the index of other swapped item - ((CCSprite*) x[newIndex]).atlasIndex=oldIndex; - - x[oldIndex]=x[newIndex]; - quads[oldIndex]=quads[newIndex]; - x[newIndex]=tempItem; - quads[newIndex]=tempItemQuad; + //update the index of other swapped item + ( ( CCSprite* )[ _descendants objectAtIndex:newIndex ] ).atlasIndex = oldIndex; + [_descendants exchangeObjectAtIndex:oldIndex withObjectAtIndex:newIndex]; } - (void) reorderBatch:(BOOL) reorder { - isReorderChildDirty_=reorder; + _isReorderChildDirty=reorder; } #pragma mark CCSpriteBatchNode - draw @@ -366,16 +354,16 @@ -(void) draw CC_PROFILER_START(@"CCSpriteBatchNode - draw"); // Optimization: Fast Dispatch - if( textureAtlas_.totalQuads == 0 ) + if( _textureAtlas.totalQuads == 0 ) return; CC_NODE_DRAW_SETUP(); - [children_ makeObjectsPerformSelector:@selector(updateTransform)]; + [_children makeObjectsPerformSelector:@selector(updateTransform)]; - ccGLBlendFunc( blendFunc_.src, blendFunc_.dst ); + ccGLBlendFunc( _blendFunc.src, _blendFunc.dst ); - [textureAtlas_ drawQuads]; + [_textureAtlas drawQuads]; CC_PROFILER_STOP(@"CCSpriteBatchNode - draw"); } @@ -386,14 +374,14 @@ -(void) increaseAtlasCapacity // if we're going beyond the current CCTextureAtlas's capacity, // all the previously initialized sprites will need to redo their texture coords // this is likely computationally expensive - NSUInteger quantity = (textureAtlas_.capacity + 1) * 4 / 3; + NSUInteger quantity = (_textureAtlas.capacity + 1) * 4 / 3; CCLOG(@"cocos2d: CCSpriteBatchNode: resizing TextureAtlas capacity from [%lu] to [%lu].", - (long)textureAtlas_.capacity, + (long)_textureAtlas.capacity, (long)quantity); - if( ! [textureAtlas_ resizeCapacity:quantity] ) { + if( ! [_textureAtlas resizeCapacity:quantity] ) { // serious problems CCLOGWARN(@"cocos2d: WARNING: Not enough memory to resize the atlas"); NSAssert(NO,@"XXX: CCSpriteBatchNode#increaseAtlasCapacity SHALL handle this assert"); @@ -405,8 +393,7 @@ -(void) increaseAtlasCapacity -(NSUInteger) rebuildIndexInOrder:(CCSprite*)node atlasIndex:(NSUInteger)index { - CCSprite *sprite; - CCARRAY_FOREACH(node.children, sprite){ + for (CCSprite* sprite in node.children) { if( sprite.zOrder < 0 ) index = [self rebuildIndexInOrder:sprite atlasIndex:index]; } @@ -417,7 +404,7 @@ -(NSUInteger) rebuildIndexInOrder:(CCSprite*)node atlasIndex:(NSUInteger)index index++; } - CCARRAY_FOREACH(node.children, sprite){ + for (CCSprite* sprite in node.children) { if( sprite.zOrder >= 0 ) index = [self rebuildIndexInOrder:sprite atlasIndex:index]; } @@ -427,17 +414,15 @@ -(NSUInteger) rebuildIndexInOrder:(CCSprite*)node atlasIndex:(NSUInteger)index -(NSUInteger) highestAtlasIndexInChild:(CCSprite*)sprite { - CCArray *array = [sprite children]; - NSUInteger count = [array count]; - if( count == 0 ) + if( sprite.children.count == 0 ) return sprite.atlasIndex; else - return [self highestAtlasIndexInChild:[array lastObject]]; + return [self highestAtlasIndexInChild:[sprite.children lastObject]]; } -(NSUInteger) lowestAtlasIndexInChild:(CCSprite*)sprite { - CCArray *array = [sprite children]; + NSArray *array = [sprite children]; NSUInteger count = [array count]; if( count == 0 ) return sprite.atlasIndex; @@ -448,7 +433,7 @@ -(NSUInteger) lowestAtlasIndexInChild:(CCSprite*)sprite -(NSUInteger)atlasIndexForChild:(CCSprite*)sprite atZ:(NSInteger)z { - CCArray *brothers = [[sprite parent] children]; + NSArray *brothers = [[sprite parent] children]; NSUInteger childIndex = [brothers indexOfObject:sprite]; // ignore parent Z if parent is batchnode @@ -500,26 +485,24 @@ -(void) insertChild:(CCSprite*)sprite inAtlasAtIndex:(NSUInteger)index [sprite setAtlasIndex:index]; [sprite setDirty: YES]; - if(textureAtlas_.totalQuads == textureAtlas_.capacity) + if(_textureAtlas.totalQuads == _textureAtlas.capacity) [self increaseAtlasCapacity]; ccV3F_C4B_T2F_Quad quad = [sprite quad]; - [textureAtlas_ insertQuad:&quad atIndex:index]; + [_textureAtlas insertQuad:&quad atIndex:index]; - ccArray *descendantsData = descendants_->data; - - ccArrayInsertObjectAtIndex(descendantsData, sprite, index); + [_descendants insertObject:sprite atIndex:index]; // update indices NSUInteger i = index+1; CCSprite *child; - for(; inum; i++){ - child = descendantsData->arr[i]; + for(; i<_descendants.count; i++){ + child = [_descendants objectAtIndex:i]; child.atlasIndex = child.atlasIndex + 1; } // add children recursively - CCARRAY_FOREACH(sprite.children, child){ + for (child in sprite.children){ NSUInteger idx = [self atlasIndexForChild:child atZ: child.zOrder]; [self insertChild:child inAtlasAtIndex:idx]; } @@ -528,27 +511,24 @@ -(void) insertChild:(CCSprite*)sprite inAtlasAtIndex:(NSUInteger)index // addChild helper, faster than insertChild -(void) appendChild:(CCSprite*)sprite { - isReorderChildDirty_=YES; + _isReorderChildDirty=YES; [sprite setBatchNode:self]; [sprite setDirty: YES]; - if(textureAtlas_.totalQuads == textureAtlas_.capacity) + if(_textureAtlas.totalQuads == _textureAtlas.capacity) [self increaseAtlasCapacity]; - ccArray *descendantsData = descendants_->data; - - ccArrayAppendObjectWithResize(descendantsData, sprite); + [_descendants addObject:sprite]; - NSUInteger index=descendantsData->num-1; + NSUInteger index=_descendants.count-1; sprite.atlasIndex=index; ccV3F_C4B_T2F_Quad quad = [sprite quad]; - [textureAtlas_ insertQuad:&quad atIndex:index]; + [_textureAtlas insertQuad:&quad atIndex:index]; // add children recursively - CCSprite* child; - CCARRAY_FOREACH(sprite.children, child) + for (CCSprite* child in sprite.children) [self appendChild:child]; } @@ -557,29 +537,27 @@ -(void) appendChild:(CCSprite*)sprite -(void) removeSpriteFromAtlas:(CCSprite*)sprite { // remove from TextureAtlas - [textureAtlas_ removeQuadAtIndex:sprite.atlasIndex]; + [_textureAtlas removeQuadAtIndex:sprite.atlasIndex]; // Cleanup sprite. It might be reused (issue #569) [sprite setBatchNode:nil]; - ccArray *descendantsData = descendants_->data; - NSUInteger index = ccArrayGetIndexOfObject(descendantsData, sprite); + NSUInteger index = [_descendants indexOfObject:sprite]; if( index != NSNotFound ) { - ccArrayRemoveObjectAtIndex(descendantsData, index); + [_descendants removeObjectAtIndex:index]; // update all sprites beyond this one - NSUInteger count = descendantsData->num; + NSUInteger count = _descendants.count; for(; index < count; index++) { - CCSprite *s = descendantsData->arr[index]; + CCSprite *s = [_descendants objectAtIndex:index]; s.atlasIndex = s.atlasIndex - 1; } } // remove children recursively - CCSprite *child; - CCARRAY_FOREACH(sprite.children, child) + for (CCSprite* child in sprite.children) [self removeSpriteFromAtlas:child]; } @@ -587,21 +565,21 @@ -(void) removeSpriteFromAtlas:(CCSprite*)sprite -(void) updateBlendFunc { - if( ! [textureAtlas_.texture hasPremultipliedAlpha] ) { - blendFunc_.src = GL_SRC_ALPHA; - blendFunc_.dst = GL_ONE_MINUS_SRC_ALPHA; + if( ! [_textureAtlas.texture hasPremultipliedAlpha] ) { + _blendFunc.src = GL_SRC_ALPHA; + _blendFunc.dst = GL_ONE_MINUS_SRC_ALPHA; } } -(void) setTexture:(CCTexture2D*)texture { - textureAtlas_.texture = texture; + _textureAtlas.texture = texture; [self updateBlendFunc]; } -(CCTexture2D*) texture { - return textureAtlas_.texture; + return _textureAtlas.texture; } @end @@ -610,13 +588,13 @@ -(CCTexture2D*) texture @implementation CCSpriteBatchNode (QuadExtension) --(void) addQuadFromSprite:(CCSprite*)sprite quadIndex:(NSUInteger)index +-(void) insertQuadFromSprite:(CCSprite*)sprite quadIndex:(NSUInteger)index { NSAssert( sprite != nil, @"Argument must be non-nil"); NSAssert( [sprite isKindOfClass:[CCSprite class]], @"CCSpriteBatchNode only supports CCSprites as children"); - - while(index >= textureAtlas_.capacity || textureAtlas_.capacity == textureAtlas_.totalQuads ) + // make needed room + while(index >= _textureAtlas.capacity || _textureAtlas.capacity == _textureAtlas.totalQuads ) [self increaseAtlasCapacity]; // @@ -627,16 +605,39 @@ -(void) addQuadFromSprite:(CCSprite*)sprite quadIndex:(NSUInteger)index [sprite setAtlasIndex:index]; ccV3F_C4B_T2F_Quad quad = [sprite quad]; - [textureAtlas_ insertQuad:&quad atIndex:index]; + [_textureAtlas insertQuad:&quad atIndex:index]; - // XXX: updateTransform will update the textureAtlas too using updateQuad. + // XXX: updateTransform will update the textureAtlas too, using updateQuad. // XXX: so, it should be AFTER the insertQuad [sprite setDirty:YES]; [sprite updateTransform]; } --(id) addSpriteWithoutQuad:(CCSprite*)child z:(NSUInteger)z tag:(NSInteger)aTag +-(void) updateQuadFromSprite:(CCSprite*)sprite quadIndex:(NSUInteger)index +{ + NSAssert( sprite != nil, @"Argument must be non-nil"); + NSAssert( [sprite isKindOfClass:[CCSprite class]], @"CCSpriteBatchNode only supports CCSprites as children"); + + // make needed room + while(index >= _textureAtlas.capacity || _textureAtlas.capacity == _textureAtlas.totalQuads ) + [self increaseAtlasCapacity]; + + // + // update the quad directly. Don't add the sprite to the scene graph + // + [sprite setBatchNode:self]; + [sprite setAtlasIndex:index]; + + [sprite setDirty:YES]; + + // UpdateTransform updates the textureAtlas quad + [sprite updateTransform]; +} + + +-(id) addSpriteWithoutQuad:(CCNode *)childNode z:(NSUInteger)z tag:(NSInteger)aTag { + CCSprite *child = (CCSprite *)childNode; NSAssert( child != nil, @"Argument must be non-nil"); NSAssert( [child isKindOfClass:[CCSprite class]], @"CCSpriteBatchNode only supports CCSprites as children"); @@ -645,12 +646,12 @@ -(id) addSpriteWithoutQuad:(CCSprite*)child z:(NSUInteger)z tag:(NSInteger)aTag // XXX: optimize with a binary search int i=0; - for( CCSprite *c in descendants_ ) { + for( CCSprite *c in _descendants ) { if( c.atlasIndex >= z ) break; i++; } - [descendants_ insertObject:child atIndex:i]; + [_descendants insertObject:child atIndex:i]; // IMPORTANT: Call super, and not self. Avoid adding it to the texture atlas array diff --git a/cocos2d/CCSpriteFrame.h b/cocos2d/CCSpriteFrame.h new file mode 100644 index 0000000..179b9bf --- /dev/null +++ b/cocos2d/CCSpriteFrame.h @@ -0,0 +1,129 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2008-2011 Ricardo Quesada + * Copyright (c) 2011 Zynga Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + */ + +#import +#import "CCNode.h" +#import "CCProtocols.h" + +/** A CCSpriteFrame has: + - texture: A CCTexture2D that will be used by the CCSprite + - rectangle: A rectangle of the texture + + + You can modify the frame of a CCSprite by doing: + + CCSpriteFrame *frame = [CCSpriteFrame frameWithTexture:texture rect:rect offset:offset]; + [sprite setSpriteFrame:frame]; + */ +@interface CCSpriteFrame : NSObject +{ + CGRect _rect; + CGRect _rectInPixels; + BOOL _rotated; + CGPoint _offset; + CGPoint _offsetInPixels; + CGSize _originalSize; + CGSize _originalSizeInPixels; + CCTexture2D *_texture; + NSString *_textureFilename; +} +/** rect of the frame in points. If it is updated, then rectInPixels will be updated too. */ +@property (nonatomic,readwrite) CGRect rect; + +/** rect of the frame in pixels. If it is updated, then rect (points) will be updated too. */ +@property (nonatomic,readwrite) CGRect rectInPixels; + +/** whether or not the rect of the frame is rotated ( x = x+width, y = y+height, width = height, height = width ) */ +@property (nonatomic,readwrite) BOOL rotated; + +/** offset of the frame in points */ +@property (nonatomic,readwrite) CGPoint offset; + +/** offset of the frame in pixels */ +@property (nonatomic,readwrite) CGPoint offsetInPixels; + +/** original size of the trimmed image in points */ +@property (nonatomic,readwrite) CGSize originalSize; + +/** original size of the trimmed image in pixels */ +@property (nonatomic,readwrite) CGSize originalSizeInPixels; + +/** texture of the frame */ +@property (nonatomic, strong, readwrite) CCTexture2D *texture; + +/** texture file name of the frame */ +@property (nonatomic, readonly) NSString *textureFilename; + +/** Retrieves a sprite frame from the sprite frame cache, or if no such sprite frame is know, attempts to create a sprite frame from an image of the same name. */ ++(id) frameWithImageNamed:(NSString*)imageName; + +/** Create a CCSpriteFrame with a texture, rect in points. + It is assumed that the frame was not trimmed. + */ ++(id) frameWithTexture:(CCTexture2D*)texture rect:(CGRect)rect; + +/** Create a CCSpriteFrame with a texture filename, rect in points. + It is assumed that the frame was not trimmed. + */ ++(id) frameWithTextureFilename:(NSString*)filename rect:(CGRect)rect; + +/** Create a CCSpriteFrame with a texture, rect, rotated, offset and originalSize in pixels. + The originalSize is the size in pixels of the frame before being trimmed. + */ ++(id) frameWithTexture:(CCTexture2D*)texture rectInPixels:(CGRect)rect rotated:(BOOL)rotated offset:(CGPoint)offset originalSize:(CGSize)originalSize; + + +/** Create a CCSpriteFrame with a texture filename, rect, rotated, offset and originalSize in pixels. + The originalSize is the size in pixels of the frame before being trimmed. + */ ++(id) frameWithTextureFilename:(NSString*)filename rectInPixels:(CGRect)rect rotated:(BOOL)rotated offset:(CGPoint)offset originalSize:(CGSize)originalSize; + + +/** Initializes a CCSpriteFrame with a texture, rect in points; + It is assumed that the frame was not trimmed. + */ +-(id) initWithTexture:(CCTexture2D*)texture rect:(CGRect)rect; + +/** Initializes a CCSpriteFrame with a texture filename, rect in points; + It is assumed that the frame was not trimmed. + */ +-(id) initWithTextureFilename:(NSString*)filename rect:(CGRect)rect; + + +/** Initializes a CCSpriteFrame with a texture, rect, rotated, offset and originalSize in pixels. + The originalSize is the size in pixels of the frame before being trimmed. + */ +-(id) initWithTexture:(CCTexture2D*)texture rectInPixels:(CGRect)rect rotated:(BOOL)rotated offset:(CGPoint)offset originalSize:(CGSize)originalSize; + +/** Initializes a CCSpriteFrame with a texture, rect, rotated, offset and originalSize in pixels. + The originalSize is the size in pixels of the frame before being trimmed. + + @since v1.1 + */ +-(id) initWithTextureFilename:(NSString*)filename rectInPixels:(CGRect)rect rotated:(BOOL)rotated offset:(CGPoint)offset originalSize:(CGSize)originalSize; + +@end + diff --git a/src/cocos2d/CCSpriteFrame.m b/cocos2d/CCSpriteFrame.m similarity index 56% rename from src/cocos2d/CCSpriteFrame.m rename to cocos2d/CCSpriteFrame.m index 92b4baa..ec4d920 100644 --- a/src/cocos2d/CCSpriteFrame.m +++ b/cocos2d/CCSpriteFrame.m @@ -27,32 +27,53 @@ #import "CCTextureCache.h" #import "CCSpriteFrame.h" +#import "CCTexture2D.h" #import "ccMacros.h" +#import "CCSpriteFrameCache.h" + +@interface CCSpriteFrame () + +/** texture file name of the frame */ +@property (nonatomic, copy,readwrite) NSString *textureFilename; + +@end @implementation CCSpriteFrame -@synthesize offsetInPixels = offsetInPixels_, offset = offset_; -@synthesize originalSize = originalSize_, originalSizeInPixels = originalSizeInPixels_; -@synthesize textureFilename = textureFilename_; -@synthesize rotated = rotated_; +@synthesize offsetInPixels = _offsetInPixels, offset = _offset; +@synthesize originalSize = _originalSize, originalSizeInPixels = _originalSizeInPixels; +@synthesize textureFilename = _textureFilename; +@synthesize rotated = _rotated; + ++(id) frameWithImageNamed:(NSString*)imageName +{ + CCSpriteFrame* frame = [[CCSpriteFrameCache sharedSpriteFrameCache] spriteFrameByName:imageName]; + if (!frame) + { + CCTexture2D* texture = [[CCTextureCache sharedTextureCache] addImage:imageName]; + frame = [texture createSpriteFrame]; + } + + return frame; +} +(id) frameWithTexture:(CCTexture2D*)texture rect:(CGRect)rect { - return [[[self alloc] initWithTexture:texture rect:rect] autorelease]; + return [[self alloc] initWithTexture:texture rect:rect]; } +(id) frameWithTextureFilename:(NSString*)filename rect:(CGRect)rect { - return [[[self alloc] initWithTextureFilename:filename rect:rect] autorelease]; + return [[self alloc] initWithTextureFilename:filename rect:rect]; } +(id) frameWithTexture:(CCTexture2D*)texture rectInPixels:(CGRect)rect rotated:(BOOL)rotated offset:(CGPoint)offset originalSize:(CGSize)originalSize { - return [[[self alloc] initWithTexture:texture rectInPixels:rect rotated:rotated offset:offset originalSize:originalSize] autorelease]; + return [[self alloc] initWithTexture:texture rectInPixels:rect rotated:rotated offset:offset originalSize:originalSize]; } +(id) frameWithTextureFilename:(NSString*)filename rectInPixels:(CGRect)rect rotated:(BOOL)rotated offset:(CGPoint)offset originalSize:(CGSize)originalSize { - return [[[self alloc] initWithTextureFilename:filename rectInPixels:rect rotated:rotated offset:offset originalSize:originalSize] autorelease]; + return [[self alloc] initWithTextureFilename:filename rectInPixels:rect rotated:rotated offset:offset originalSize:originalSize]; } -(id) initWithTexture:(CCTexture2D*)texture rect:(CGRect)rect @@ -72,13 +93,13 @@ -(id) initWithTexture:(CCTexture2D*)texture rectInPixels:(CGRect)rect rotated:(B if( (self=[super init]) ) { self.texture = texture; - rectInPixels_ = rect; - rect_ = CC_RECT_PIXELS_TO_POINTS( rect ); - offsetInPixels_ = offset; - offset_ = CC_POINT_PIXELS_TO_POINTS( offsetInPixels_ ); - originalSizeInPixels_ = originalSize; - originalSize_ = CC_SIZE_PIXELS_TO_POINTS( originalSizeInPixels_ ); - rotated_ = rotated; + _rectInPixels = rect; + _rect = CC_RECT_PIXELS_TO_POINTS( rect ); + _offsetInPixels = offset; + _offset = CC_POINT_PIXELS_TO_POINTS( _offsetInPixels ); + _originalSizeInPixels = originalSize; + _originalSize = CC_SIZE_PIXELS_TO_POINTS( _originalSizeInPixels ); + _rotated = rotated; } return self; } @@ -87,15 +108,15 @@ -(id) initWithTextureFilename:(NSString *)filename rectInPixels:(CGRect)rect rot { if( (self=[super init]) ) { - texture_ = nil; - textureFilename_ = [filename copy]; - rectInPixels_ = rect; - rect_ = CC_RECT_PIXELS_TO_POINTS( rect ); - offsetInPixels_ = offset; - offset_ = CC_POINT_PIXELS_TO_POINTS( offsetInPixels_ ); - originalSizeInPixels_ = originalSize; - originalSize_ = CC_SIZE_PIXELS_TO_POINTS( originalSizeInPixels_ ); - rotated_ = rotated; + _texture = nil; + _textureFilename = [filename copy]; + _rectInPixels = rect; + _rect = CC_RECT_PIXELS_TO_POINTS( rect ); + _offsetInPixels = offset; + _offset = CC_POINT_PIXELS_TO_POINTS( _offsetInPixels ); + _originalSizeInPixels = originalSize; + _originalSize = CC_SIZE_PIXELS_TO_POINTS( _originalSizeInPixels ); + _rotated = rotated; } return self; } @@ -103,81 +124,77 @@ -(id) initWithTextureFilename:(NSString *)filename rectInPixels:(CGRect)rect rot - (NSString*) description { return [NSString stringWithFormat:@"<%@ = %p | Texture=%@, Rect = (%.2f,%.2f,%.2f,%.2f)> rotated:%d offset=(%.2f,%.2f)", [self class], self, - textureFilename_, - rect_.origin.x, - rect_.origin.y, - rect_.size.width, - rect_.size.height, - rotated_, - offsetInPixels_.x, - offsetInPixels_.y + _textureFilename, + _rect.origin.x, + _rect.origin.y, + _rect.size.width, + _rect.size.height, + _rotated, + _offsetInPixels.x, + _offsetInPixels.y ]; } - (void) dealloc { CCLOGINFO( @"cocos2d: deallocing %@",self); - [texture_ release]; - [textureFilename_ release]; - [super dealloc]; } -(id) copyWithZone: (NSZone*) zone { - CCSpriteFrame *copy = [[[self class] allocWithZone: zone] initWithTextureFilename:textureFilename_ rectInPixels:rectInPixels_ rotated:rotated_ offset:offsetInPixels_ originalSize:originalSizeInPixels_]; - copy.texture = texture_; + CCSpriteFrame *copy = [[[self class] allocWithZone: zone] initWithTextureFilename:_textureFilename rectInPixels:_rectInPixels rotated:_rotated offset:_offsetInPixels originalSize:_originalSizeInPixels]; + copy.texture = _texture; return copy; } -(CGRect) rect { - return rect_; + return _rect; } -(CGRect) rectInPixels { - return rectInPixels_; + return _rectInPixels; } -(void) setRect:(CGRect)rect { - rect_ = rect; - rectInPixels_ = CC_RECT_POINTS_TO_PIXELS( rect_ ); + _rect = rect; + _rectInPixels = CC_RECT_POINTS_TO_PIXELS(_rect); } -(void) setRectInPixels:(CGRect)rectInPixels { - rectInPixels_ = rectInPixels; - rect_ = CC_RECT_PIXELS_TO_POINTS( rectInPixels_ ); + _rectInPixels = rectInPixels; + _rect = CC_RECT_PIXELS_TO_POINTS( _rectInPixels ); } -(void) setOffset:(CGPoint)offsets { - offset_ = offsets; - offsetInPixels_ = CC_POINT_POINTS_TO_PIXELS( offset_ ); + _offset = offsets; + _offsetInPixels = CC_POINT_POINTS_TO_PIXELS( _offset ); } -(void) setOffsetInPixels:(CGPoint)offsetInPixels { - offsetInPixels_ = offsetInPixels; - offset_ = CC_POINT_PIXELS_TO_POINTS( offsetInPixels_ ); + _offsetInPixels = offsetInPixels; + _offset = CC_POINT_PIXELS_TO_POINTS( _offsetInPixels ); } -(void) setTexture:(CCTexture2D *)texture { - if( texture_ != texture ) { - [texture_ release]; - texture_ = [texture retain]; + if( _texture != texture ) { + _texture = texture; } } -(CCTexture2D*) texture { - if( texture_ ) - return texture_; + if( _texture ) + return _texture; - if( textureFilename_ ) - return [[CCTextureCache sharedTextureCache] addImage:textureFilename_]; + if( _textureFilename ) + return [[CCTextureCache sharedTextureCache] addImage:_textureFilename]; // no texture or texture filename return nil; diff --git a/cocos2d/CCSpriteFrameCache.h b/cocos2d/CCSpriteFrameCache.h new file mode 100644 index 0000000..be1383f --- /dev/null +++ b/cocos2d/CCSpriteFrameCache.h @@ -0,0 +1,126 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2009 Jason Booth + * + * Copyright (c) 2009 Robert J Payne + * + * Copyright (c) 2008-2010 Ricardo Quesada + * Copyright (c) 2011 Zynga Inc. + * + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + */ + + +/* + * To create sprite frames and texture atlas, use this tool: + * http://zwoptex.zwopple.com/ + */ + +#import + +#import "CCSpriteFrame.h" + +@class CCSprite; +@class CCTexture2D; + +/** Singleton that handles the loading of the sprite frames. + It saves in a cache the sprite frames. + @since v0.9 + */ +@interface CCSpriteFrameCache : NSObject +{ + NSMutableDictionary *_spriteFrames; + NSMutableDictionary *_spriteFramesAliases; + NSMutableSet *_loadedFilenames; + + NSMutableDictionary *_spriteFrameFileLookup; +} + +/** Retruns ths shared instance of the Sprite Frame cache */ ++ (CCSpriteFrameCache *) sharedSpriteFrameCache; + +/** Purges the cache. It releases all the Sprite Frames and the retained instance. + */ ++(void)purgeSharedSpriteFrameCache; + +- (void) registerSpriteFramesFile:(NSString*)plist; + +-(void) loadSpriteFrameLookupDictionaryFromFile:(NSString*)filename; + +/** Adds multiple Sprite Frames from a plist file. + * A texture will be loaded automatically. The texture name will composed by replacing the .plist suffix with .png . + * If you want to use another texture, you should use the addSpriteFramesWithFile:texture method. + */ +-(void) addSpriteFramesWithFile:(NSString*)plist; + +/** Adds multiple Sprite Frames from a plist file. The texture filename will be associated with the created sprite frames. + */ +-(void) addSpriteFramesWithFile:(NSString*)plist textureFilename:(NSString*)filename; + +/** Adds multiple Sprite Frames from a plist file. The texture will be associated with the created sprite frames. + */ +-(void) addSpriteFramesWithFile:(NSString*)plist texture:(CCTexture2D*)texture; + +/** Adds an sprite frame with a given name. + If the name already exists, then the contents of the old name will be replaced with the new one. + */ +-(void) addSpriteFrame:(CCSpriteFrame*)frame name:(NSString*)frameName; + + +/** Purges the dictionary of loaded sprite frames. + * Call this method if you receive the "Memory Warning". + * In the short term: it will free some resources preventing your app from being killed. + * In the medium term: it will allocate more resources. + * In the long term: it will be the same. + */ +-(void) removeSpriteFrames; + +/** Removes unused sprite frames. + * Sprite Frames that have a retain count of 1 will be deleted. + * It is convenient to call this method after when starting a new Scene. + */ +-(void) removeUnusedSpriteFrames; + +/** Deletes an sprite frame from the sprite frame cache. + */ +-(void) removeSpriteFrameByName:(NSString*)name; + +/** Removes multiple Sprite Frames from a plist file. +* Sprite Frames stored in this file will be removed. +* It is convenient to call this method when a specific texture needs to be removed. +* @since v0.99.5 +*/ +- (void) removeSpriteFramesFromFile:(NSString*) plist; + +/** Removes all Sprite Frames associated with the specified textures. + * It is convenient to call this method when a specific texture needs to be removed. + * @since v0.995. + */ +- (void) removeSpriteFramesFromTexture:(CCTexture2D*) texture; + +/** Returns an Sprite Frame that was previously added. + If the name is not found it will return nil. + You should retain the returned copy if you are going to use it. + */ +-(CCSpriteFrame*) spriteFrameByName:(NSString*)name; + +@end diff --git a/src/cocos2d/CCSpriteFrameCache.m b/cocos2d/CCSpriteFrameCache.m similarity index 70% rename from src/cocos2d/CCSpriteFrameCache.m rename to cocos2d/CCSpriteFrameCache.m index eec6ee0..0effa78 100644 --- a/src/cocos2d/CCSpriteFrameCache.m +++ b/cocos2d/CCSpriteFrameCache.m @@ -54,34 +54,34 @@ @implementation CCSpriteFrameCache #pragma mark CCSpriteFrameCache - Alloc, Init & Dealloc -static CCSpriteFrameCache *sharedSpriteFrameCache_=nil; +static CCSpriteFrameCache *_sharedSpriteFrameCache=nil; + (CCSpriteFrameCache *)sharedSpriteFrameCache { - if (!sharedSpriteFrameCache_) - sharedSpriteFrameCache_ = [[CCSpriteFrameCache alloc] init]; + if (!_sharedSpriteFrameCache) + _sharedSpriteFrameCache = [[CCSpriteFrameCache alloc] init]; - return sharedSpriteFrameCache_; + return _sharedSpriteFrameCache; } +(id)alloc { - NSAssert(sharedSpriteFrameCache_ == nil, @"Attempted to allocate a second instance of a singleton."); + NSAssert(_sharedSpriteFrameCache == nil, @"Attempted to allocate a second instance of a singleton."); return [super alloc]; } +(void)purgeSharedSpriteFrameCache { - [sharedSpriteFrameCache_ release]; - sharedSpriteFrameCache_ = nil; + _sharedSpriteFrameCache = nil; } -(id) init { if( (self=[super init]) ) { - spriteFrames_ = [[NSMutableDictionary alloc] initWithCapacity: 100]; - spriteFramesAliases_ = [[NSMutableDictionary alloc] initWithCapacity:10]; - loadedFilenames_ = [[NSMutableSet alloc] initWithCapacity:30]; + _spriteFrames = [[NSMutableDictionary alloc] initWithCapacity: 100]; + _spriteFramesAliases = [[NSMutableDictionary alloc] initWithCapacity:10]; + _loadedFilenames = [[NSMutableSet alloc] initWithCapacity:30]; + _spriteFrameFileLookup = [[NSMutableDictionary alloc] init]; } return self; @@ -89,18 +89,62 @@ -(id) init - (NSString*) description { - return [NSString stringWithFormat:@"<%@ = %p | num of sprite frames = %lu>", [self class], self, (unsigned long)[spriteFrames_ count]]; + return [NSString stringWithFormat:@"<%@ = %p | num of sprite frames = %lu>", [self class], self, (unsigned long)[_spriteFrames count]]; } -(void) dealloc { CCLOGINFO(@"cocos2d: deallocing %@", self); - [spriteFrames_ release]; - [spriteFramesAliases_ release]; - [loadedFilenames_ release]; - [super dealloc]; +} + +#pragma mark CCSpriteFrameCache - registering sprite sheets + +-(void) loadSpriteFrameLookupDictionaryFromFile:(NSString*)filename +{ + NSString *fullpath = [[CCFileUtils sharedFileUtils] fullPathForFilenameIgnoringResolutions:filename]; + if( fullpath ) { + NSDictionary *dict = [NSDictionary dictionaryWithContentsOfFile:fullpath]; + + NSDictionary *metadata = [dict objectForKey:@"metadata"]; + NSInteger version = [[metadata objectForKey:@"version"] integerValue]; + if( version != 1) { + CCLOG(@"cocos2d: ERROR: Invalid filenameLookup dictionary version: %ld. Filename: %@", (long)version, filename); + return; + } + + NSArray *spriteFrameFiles = [dict objectForKey:@"spriteFrameFiles"]; + for (NSString* spriteFrameFile in spriteFrameFiles) + { + [self registerSpriteFramesFile:spriteFrameFile]; + } + } +} + +- (void) registerSpriteFramesFile:(NSString*)plist +{ + NSAssert(plist, @"plist filename should not be nil"); + + NSString *path = [[CCFileUtils sharedFileUtils] fullPathForFilename:plist]; + NSDictionary *dictionary = [NSDictionary dictionaryWithContentsOfFile:path]; + + NSDictionary *metadataDict = [dictionary objectForKey:@"metadata"]; + NSDictionary *framesDict = [dictionary objectForKey:@"frames"]; + + int format = 0; + + // get the format + if(metadataDict != nil) + format = [[metadataDict objectForKey:@"format"] intValue]; + + // check the format + NSAssert( format >= 0 && format <= 3, @"format is not supported for CCSpriteFrameCache addSpriteFramesWithDictionary:textureFilename:"); + + for(NSString *frameDictKey in framesDict) + { + [_spriteFrameFileLookup setObject:plist forKey:frameDictKey]; + } } #pragma mark CCSpriteFrameCache - loading sprite frames @@ -128,7 +172,7 @@ -(void) addSpriteFramesWithDictionary:(NSDictionary*)dictionary textureReference // SpriteFrame info CGRect rectInPixels; - BOOL isRotated; + BOOL isRotated = NO; CGPoint frameOffset; CGSize originalSize; @@ -185,10 +229,10 @@ -(void) addSpriteFramesWithDictionary:(NSDictionary*)dictionary textureReference // get aliases NSArray *aliases = [frameDict objectForKey:@"aliases"]; for(NSString *alias in aliases) { - if( [spriteFramesAliases_ objectForKey:alias] ) + if( [_spriteFramesAliases objectForKey:alias] ) CCLOGWARN(@"cocos2d: WARNING: an alias with name %@ already exists",alias); - [spriteFramesAliases_ setObject:frameDictKey forKey:alias]; + [_spriteFramesAliases setObject:frameDictKey forKey:alias]; } // set frame info @@ -220,8 +264,7 @@ -(void) addSpriteFramesWithDictionary:(NSDictionary*)dictionary textureReference } // add sprite frame - [spriteFrames_ setObject:spriteFrame forKey:frameDictKey]; - [spriteFrame release]; + [_spriteFrames setObject:spriteFrame forKey:frameDictKey]; } } @@ -240,14 +283,14 @@ -(void) addSpriteFramesWithFile:(NSString*)plist textureReference:(id)textureRef NSAssert(textureReference, @"textureReference should not be nil"); NSAssert(plist, @"plist filename should not be nil"); - if( ! [loadedFilenames_ member:plist] ) { + if( ! [_loadedFilenames member:plist] ) { - NSString *path = [[CCFileUtils sharedFileUtils] fullPathFromRelativePath:plist]; + NSString *path = [[CCFileUtils sharedFileUtils] fullPathForFilename:plist]; NSDictionary *dict = [NSDictionary dictionaryWithContentsOfFile:path]; [self addSpriteFramesWithDictionary:dict textureReference:textureReference]; - [loadedFilenames_ addObject:plist]; + [_loadedFilenames addObject:plist]; } else CCLOGINFO(@"cocos2d: CCSpriteFrameCache: file already loaded: %@", plist); @@ -268,9 +311,9 @@ -(void) addSpriteFramesWithFile:(NSString*)plist { NSAssert(plist, @"plist filename should not be nil"); - if( ! [loadedFilenames_ member:plist] ) { + if( ! [_loadedFilenames member:plist] ) { - NSString *path = [[CCFileUtils sharedFileUtils] fullPathFromRelativePath:plist]; + NSString *path = [[CCFileUtils sharedFileUtils] fullPathForFilename:plist]; NSDictionary *dict = [NSDictionary dictionaryWithContentsOfFile:path]; NSString *texturePath = nil; @@ -295,7 +338,7 @@ -(void) addSpriteFramesWithFile:(NSString*)plist [self addSpriteFramesWithDictionary:dict textureFilename:texturePath]; - [loadedFilenames_ addObject:plist]; + [_loadedFilenames addObject:plist]; } else CCLOGINFO(@"cocos2d: CCSpriteFrameCache: file already loaded: %@", plist); @@ -304,34 +347,38 @@ -(void) addSpriteFramesWithFile:(NSString*)plist -(void) addSpriteFrame:(CCSpriteFrame*)frame name:(NSString*)frameName { - [spriteFrames_ setObject:frame forKey:frameName]; + [_spriteFrames setObject:frame forKey:frameName]; } #pragma mark CCSpriteFrameCache - removing -(void) removeSpriteFrames { - [spriteFrames_ removeAllObjects]; - [spriteFramesAliases_ removeAllObjects]; - [loadedFilenames_ removeAllObjects]; + [_spriteFrames removeAllObjects]; + [_spriteFramesAliases removeAllObjects]; + [_loadedFilenames removeAllObjects]; } -(void) removeUnusedSpriteFrames { + //TODO: Check... not implemented with ARC... +//#warning Not implemented with ARC + /* BOOL removed_ = NO; - NSArray *keys = [spriteFrames_ allKeys]; + NSArray *keys = [_spriteFrames allKeys]; for( id key in keys ) { - id value = [spriteFrames_ objectForKey:key]; + id value = [_spriteFrames objectForKey:key]; if( [value retainCount] == 1 ) { CCLOG(@"cocos2d: CCSpriteFrameCache: removing unused frame: %@", key); - [spriteFrames_ removeObjectForKey:key]; + [_spriteFrames removeObjectForKey:key]; removed_ = YES; } } // XXX. Since we don't know the .plist file that originated the frame, we must remove all .plist from the cache if( removed_ ) - [loadedFilenames_ removeAllObjects]; + [_loadedFilenames removeAllObjects]; + */ } -(void) removeSpriteFrameByName:(NSString*)name @@ -341,30 +388,30 @@ -(void) removeSpriteFrameByName:(NSString*)name return; // Is this an alias ? - NSString *key = [spriteFramesAliases_ objectForKey:name]; + NSString *key = [_spriteFramesAliases objectForKey:name]; if( key ) { - [spriteFrames_ removeObjectForKey:key]; - [spriteFramesAliases_ removeObjectForKey:name]; + [_spriteFrames removeObjectForKey:key]; + [_spriteFramesAliases removeObjectForKey:name]; } else - [spriteFrames_ removeObjectForKey:name]; + [_spriteFrames removeObjectForKey:name]; // XXX. Since we don't know the .plist file that originated the frame, we must remove all .plist from the cache - [loadedFilenames_ removeAllObjects]; + [_loadedFilenames removeAllObjects]; } - (void) removeSpriteFramesFromFile:(NSString*) plist { - NSString *path = [[CCFileUtils sharedFileUtils] fullPathFromRelativePath:plist]; + NSString *path = [[CCFileUtils sharedFileUtils] fullPathForFilename:plist]; NSDictionary *dict = [NSDictionary dictionaryWithContentsOfFile:path]; [self removeSpriteFramesFromDictionary:dict]; // remove it from the cache - id ret = [loadedFilenames_ member:plist]; + id ret = [_loadedFilenames member:plist]; if( ret ) - [loadedFilenames_ removeObject:ret]; + [_loadedFilenames removeObject:ret]; } - (void) removeSpriteFramesFromDictionary:(NSDictionary*) dictionary @@ -374,34 +421,45 @@ - (void) removeSpriteFramesFromDictionary:(NSDictionary*) dictionary for(NSString *frameDictKey in framesDict) { - if ([spriteFrames_ objectForKey:frameDictKey]!=nil) + if ([_spriteFrames objectForKey:frameDictKey]!=nil) [keysToRemove addObject:frameDictKey]; } - [spriteFrames_ removeObjectsForKeys:keysToRemove]; + [_spriteFrames removeObjectsForKeys:keysToRemove]; } - (void) removeSpriteFramesFromTexture:(CCTexture2D*) texture { NSMutableArray *keysToRemove=[NSMutableArray array]; - for (NSString *spriteFrameKey in spriteFrames_) + for (NSString *spriteFrameKey in _spriteFrames) { - if ([[spriteFrames_ valueForKey:spriteFrameKey] texture] == texture) + if ([[_spriteFrames valueForKey:spriteFrameKey] texture] == texture) [keysToRemove addObject:spriteFrameKey]; } - [spriteFrames_ removeObjectsForKeys:keysToRemove]; + [_spriteFrames removeObjectsForKeys:keysToRemove]; } #pragma mark CCSpriteFrameCache - getting -(CCSpriteFrame*) spriteFrameByName:(NSString*)name { - CCSpriteFrame *frame = [spriteFrames_ objectForKey:name]; + CCSpriteFrame *frame = [_spriteFrames objectForKey:name]; + + if (!frame) + { + // Try finding the frame in one of the registered sprite sheets + NSString* spriteFrameFile = [_spriteFrameFileLookup objectForKey:name]; + if (spriteFrameFile) [self addSpriteFramesWithFile:spriteFrameFile]; + + // Attempt to load the frame again + frame = [_spriteFrames objectForKey:name]; + } + if( ! frame ) { // try alias dictionary - NSString *key = [spriteFramesAliases_ objectForKey:name]; - frame = [spriteFrames_ objectForKey:key]; + NSString *key = [_spriteFramesAliases objectForKey:name]; + frame = [_spriteFrames objectForKey:key]; if( ! frame ) CCLOG(@"cocos2d: CCSpriteFrameCache: Frame '%@' not found", name); diff --git a/cocos2d/CCTMXLayer.h b/cocos2d/CCTMXLayer.h new file mode 100644 index 0000000..56d6ccf --- /dev/null +++ b/cocos2d/CCTMXLayer.h @@ -0,0 +1,164 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2009-2010 Ricardo Quesada + * Copyright (c) 2011 Zynga Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * + * TMX Tiled Map support: + * http://www.mapeditor.org + * + */ + + +#import "CCAtlasNode.h" +#import "CCSpriteBatchNode.h" +#import "CCTMXXMLParser.h" + +@class CCTMXMapInfo; +@class CCTMXLayerInfo; +@class CCTMXTilesetInfo; + + +/** CCTMXLayer represents the TMX layer. + + It is a subclass of CCSpriteBatchNode. By default the tiles are rendered using a CCTextureAtlas. + If you mofify a tile on runtime, then, that tile will become a CCSprite, otherwise no CCSprite objects are created. + The benefits of using CCSprite objects as tiles are: + - tiles (CCSprite) can be rotated/scaled/moved with a nice API + + cocos2d v2.0 doesn't support the cc_vertexz value. Whenever a the cc_vertexz property is found, it will raise an exception. + + "value" by default is 0, but you can change it from Tiled by adding the "cc_alpha_func" property to the layer. + The value 0 should work for most cases, but if you have tiles that are semi-transparent, then you might want to use a differnt + value, like 0.5. + + For further information, please see the programming guide: + + http://www.cocos2d-iphone.org/wiki/doku.php/prog_guide:tiled_maps + + @since v0.8.1 + + Tiles can have tile flags for additional properties. At the moment only flip horizontal and flip vertical are used. These bit flags are defined in CCTMXXMLParser.h. + + @since 1.1 + */ +@interface CCTMXLayer : CCSpriteBatchNode +{ + CCTMXTilesetInfo *_tileset; + NSString *_layerName; + CGSize _layerSize; + CGSize _mapTileSize; + uint32_t *_tiles; // GID are 32 bit + NSUInteger _layerOrientation; + NSMutableDictionary *_properties; + + unsigned char _opacity; // TMX Layer supports opacity + + NSUInteger _minGID; + NSUInteger _maxGID; + + // Only used when vertexZ is used + NSInteger _vertexZvalue; + BOOL _useAutomaticVertexZ; + + // used for optimization + CCSprite *_reusedTile; + NSMutableArray *_atlasIndexArray; +} +/** name of the layer */ +@property (nonatomic,readwrite,strong) NSString *layerName; +/** size of the layer in tiles */ +@property (nonatomic,readwrite) CGSize layerSize; +/** size of the map's tile (could be different from the tile's size) */ +@property (nonatomic,readwrite) CGSize mapTileSize; +/** pointer to the map of tiles */ +@property (nonatomic,readwrite) uint32_t *tiles; +/** Tileset information for the layer */ +@property (nonatomic,readwrite,strong) CCTMXTilesetInfo *tileset; +/** Layer orientation, which is the same as the map orientation */ +@property (nonatomic,readwrite) NSUInteger layerOrientation; +/** properties from the layer. They can be added using Tiled */ +@property (nonatomic,readwrite,strong) NSMutableDictionary *properties; + +/** creates a CCTMXLayer with an tileset info, a layer info and a map info */ ++(id) layerWithTilesetInfo:(CCTMXTilesetInfo*)tilesetInfo layerInfo:(CCTMXLayerInfo*)layerInfo mapInfo:(CCTMXMapInfo*)mapInfo; +/** initializes a CCTMXLayer with a tileset info, a layer info and a map info */ +-(id) initWithTilesetInfo:(CCTMXTilesetInfo*)tilesetInfo layerInfo:(CCTMXLayerInfo*)layerInfo mapInfo:(CCTMXMapInfo*)mapInfo; + +/** dealloc the map that contains the tile position from memory. + Unless you want to know at runtime the tiles positions, you can safely call this method. + If you are going to call [layer tileGIDAt:] then, don't release the map + */ +-(void) releaseMap; + +/** returns the tile (CCSprite) at a given a tile coordinate. + The returned CCSprite will be already added to the CCTMXLayer. Don't add it again. + The CCSprite can be treated like any other CCSprite: rotated, scaled, translated, opacity, color, etc. + You can remove either by calling: + - [layer removeChild:sprite cleanup:cleanup]; + - or [layer removeTileAt:ccp(x,y)]; + */ +-(CCSprite*) tileAt:(CGPoint)tileCoordinate; + +/** returns the tile gid at a given tile coordinate. + if it returns 0, it means that the tile is empty. + This method requires the the tile map has not been previously released (eg. don't call [layer releaseMap]) + */ +-(uint32_t) tileGIDAt:(CGPoint)tileCoordinate; + +/** returns the tile gid at a given tile coordinate. It also returns the tile flags. + This method requires the the tile map has not been previously released (eg. don't call [layer releaseMap]) + */ +-(uint32_t) tileGIDAt:(CGPoint)pos withFlags:(ccTMXTileFlags*)flags; + +/** sets the tile gid (gid = tile global id) at a given tile coordinate. + The Tile GID can be obtained by using the method "tileGIDAt" or by using the TMX editor -> Tileset Mgr +1. + If a tile is already placed at that position, then it will be removed. + */ +-(void) setTileGID:(uint32_t)gid at:(CGPoint)tileCoordinate; + +/** sets the tile gid (gid = tile global id) at a given tile coordinate. + The Tile GID can be obtained by using the method "tileGIDAt" or by using the TMX editor -> Tileset Mgr +1. + If a tile is already placed at that position, then it will be removed. + + Use withFlags if the tile flags need to be changed as well + */ + +-(void) setTileGID:(uint32_t)gid at:(CGPoint)pos withFlags:(ccTMXTileFlags)flags; + +/** removes a tile at given tile coordinate */ +-(void) removeTileAt:(CGPoint)tileCoordinate; + +/** returns the position in points of a given tile coordinate */ +-(CGPoint) positionAt:(CGPoint)tileCoordinate; + +/** return the value for the specific property name */ +-(id) propertyNamed:(NSString *)propertyName; + +/** Creates the tiles */ +-(void) setupTiles; + +/** CCTMXLayer doesn't support adding a CCSprite manually. + @warning addchild:z:tag: is not supported on CCTMXLayer. Instead of setTileGID:at:/tileAt: + */ +-(void) addChild: (CCNode*)node z:(NSInteger)z tag:(NSInteger)tag; +@end diff --git a/src/cocos2d/CCTMXLayer.m b/cocos2d/CCTMXLayer.m similarity index 67% rename from src/cocos2d/CCTMXLayer.m rename to cocos2d/CCTMXLayer.m index 15c57fa..60670bc 100644 --- a/src/cocos2d/CCTMXLayer.m +++ b/cocos2d/CCTMXLayer.m @@ -69,17 +69,17 @@ -(NSUInteger) atlasIndexForNewZ:(NSUInteger)z; @end @implementation CCTMXLayer -@synthesize layerSize = layerSize_, layerName = layerName_, tiles = tiles_; -@synthesize tileset = tileset_; -@synthesize layerOrientation = layerOrientation_; -@synthesize mapTileSize = mapTileSize_; -@synthesize properties = properties_; +@synthesize layerSize = _layerSize, layerName = _layerName, tiles = _tiles; +@synthesize tileset = _tileset; +@synthesize layerOrientation = _layerOrientation; +@synthesize mapTileSize = _mapTileSize; +@synthesize properties = _properties; #pragma mark CCTMXLayer - init & alloc & dealloc +(id) layerWithTilesetInfo:(CCTMXTilesetInfo*)tilesetInfo layerInfo:(CCTMXLayerInfo*)layerInfo mapInfo:(CCTMXMapInfo*)mapInfo { - return [[[self alloc] initWithTilesetInfo:tilesetInfo layerInfo:layerInfo mapInfo:mapInfo] autorelease]; + return [[self alloc] initWithTilesetInfo:tilesetInfo layerInfo:layerInfo mapInfo:mapInfo]; } -(id) initWithTilesetInfo:(CCTMXTilesetInfo*)tilesetInfo layerInfo:(CCTMXLayerInfo*)layerInfo mapInfo:(CCTMXMapInfo*)mapInfo @@ -97,30 +97,30 @@ -(id) initWithTilesetInfo:(CCTMXTilesetInfo*)tilesetInfo layerInfo:(CCTMXLayerIn // layerInfo self.layerName = layerInfo.name; - layerSize_ = size; - tiles_ = layerInfo.tiles; - minGID_ = layerInfo.minGID; - maxGID_ = layerInfo.maxGID; - opacity_ = layerInfo.opacity; + _layerSize = size; + _tiles = layerInfo.tiles; + _minGID = layerInfo.minGID; + _maxGID = layerInfo.maxGID; + _opacity = layerInfo.opacity; self.properties = [NSMutableDictionary dictionaryWithDictionary:layerInfo.properties]; // tilesetInfo self.tileset = tilesetInfo; // mapInfo - mapTileSize_ = mapInfo.tileSize; - layerOrientation_ = mapInfo.orientation; + _mapTileSize = mapInfo.tileSize; + _layerOrientation = mapInfo.orientation; // offset (after layer orientation is set); CGPoint offset = [self calculateLayerOffset:layerInfo.offset]; [self setPosition:CC_POINT_PIXELS_TO_POINTS(offset)]; - atlasIndexArray_ = ccCArrayNew(totalNumberOfTiles); + _atlasIndexArray = [[NSMutableArray alloc] initWithCapacity:totalNumberOfTiles]; - [self setContentSize:CC_SIZE_PIXELS_TO_POINTS(CGSizeMake( layerSize_.width * mapTileSize_.width, layerSize_.height * mapTileSize_.height ))]; + [self setContentSize:CC_SIZE_PIXELS_TO_POINTS(CGSizeMake( _layerSize.width * _mapTileSize.width, _layerSize.height * _mapTileSize.height ))]; - useAutomaticVertexZ_= NO; - vertexZvalue_ = 0; + _useAutomaticVertexZ= NO; + _vertexZvalue = 0; } return self; @@ -128,34 +128,27 @@ -(id) initWithTilesetInfo:(CCTMXTilesetInfo*)tilesetInfo layerInfo:(CCTMXLayerIn - (void) dealloc { - [layerName_ release]; - [tileset_ release]; - [reusedTile_ release]; - [properties_ release]; - - if( atlasIndexArray_ ) { - ccCArrayFree(atlasIndexArray_); - atlasIndexArray_ = NULL; + + if( _atlasIndexArray ) { + _atlasIndexArray = NULL; } - if( tiles_ ) { - free(tiles_); - tiles_ = NULL; + if( _tiles ) { + free(_tiles); + _tiles = NULL; } - [super dealloc]; } -(void) releaseMap { - if( tiles_) { - free( tiles_); - tiles_ = NULL; + if( _tiles) { + free( _tiles); + _tiles = NULL; } - if( atlasIndexArray_ ) { - ccCArrayFree(atlasIndexArray_); - atlasIndexArray_ = NULL; + if( _atlasIndexArray ) { + _atlasIndexArray = NULL; } } @@ -163,44 +156,46 @@ -(void) releaseMap -(CCSprite*) reusedTileWithRect:(CGRect)rect { - if( ! reusedTile_ ) { - reusedTile_ = [[CCSprite alloc] initWithTexture:textureAtlas_.texture rect:rect rotated:NO]; - [reusedTile_ setBatchNode:self]; + if( ! _reusedTile ) { + _reusedTile = [[CCSprite alloc] initWithTexture:_textureAtlas.texture rect:rect rotated:NO]; + [_reusedTile setBatchNode:self]; } else { - // XXX: should not be re-init. Potential memeory leak. Not following best practices - // XXX: it shall call directory [setRect:rect] - [reusedTile_ initWithTexture:textureAtlas_.texture rect:rect rotated:NO]; - - // Since initWithTexture resets the batchNode, we need to re add it. - // but should be removed once initWithTexture is not called again - [reusedTile_ setBatchNode:self]; + // XXX HACK: Needed because if "batch node" is nil, + // then the Sprite'squad will be reset + [_reusedTile setBatchNode:nil]; + + // Re-init the sprite + [_reusedTile setTextureRect:rect rotated:NO untrimmedSize:rect.size]; + + // restore the batch node + [_reusedTile setBatchNode:self]; } - return reusedTile_; + return _reusedTile; } -(void) setupTiles { // Optimization: quick hack that sets the image size on the tileset - tileset_.imageSize = [textureAtlas_.texture contentSizeInPixels]; + _tileset.imageSize = [_textureAtlas.texture contentSizeInPixels]; // By default all the tiles are aliased // pros: // - easier to render // cons: // - difficult to scale / rotate / etc. - [textureAtlas_.texture setAliasTexParameters]; + [_textureAtlas.texture setAliasTexParameters]; // Parse cocos2d properties [self parseInternalProperties]; - for( NSUInteger y = 0; y < layerSize_.height; y++ ) { - for( NSUInteger x = 0; x < layerSize_.width; x++ ) { + for( NSUInteger y = 0; y < _layerSize.height; y++ ) { + for( NSUInteger x = 0; x < _layerSize.width; x++ ) { - NSUInteger pos = x + layerSize_.width * y; - uint32_t gid = tiles_[ pos ]; + NSUInteger pos = x + _layerSize.width * y; + uint32_t gid = _tiles[ pos ]; // gid are stored in little endian. // if host is big endian, then swap @@ -211,23 +206,23 @@ -(void) setupTiles [self appendTileForGID:gid at:ccp(x,y)]; // Optimization: update min and max GID rendered by the layer - minGID_ = MIN(gid, minGID_); - maxGID_ = MAX(gid, maxGID_); -// minGID_ = MIN((gid & kFlippedMask), minGID_); -// maxGID_ = MAX((gid & kFlippedMask), maxGID_); + _minGID = MIN(gid, _minGID); + _maxGID = MAX(gid, _maxGID); +// _minGID = MIN((gid & kFlippedMask), _minGID); +// _maxGID = MAX((gid & kFlippedMask), _maxGID); } } } - NSAssert( maxGID_ >= tileset_.firstGid && - minGID_ >= tileset_.firstGid, @"TMX: Only 1 tilset per layer is supported"); + NSAssert( _maxGID >= _tileset.firstGid && + _minGID >= _tileset.firstGid, @"TMX: Only 1 tilset per layer is supported"); } #pragma mark CCTMXLayer - Properties -(id) propertyNamed:(NSString *)propertyName { - return [properties_ valueForKey:propertyName]; + return [_properties valueForKey:propertyName]; } -(void) parseInternalProperties @@ -239,20 +234,20 @@ -(void) parseInternalProperties // If "automatic" is on, then parse the "cc_alpha_func" too if( [vertexz isEqualToString:@"automatic"] ) { - useAutomaticVertexZ_ = YES; + _useAutomaticVertexZ = YES; NSString *alphaFuncVal = [self propertyNamed:@"cc_alpha_func"]; float alphaFuncValue = [alphaFuncVal floatValue]; self.shaderProgram = [[CCShaderCache sharedShaderCache] programForKey:kCCShader_PositionTextureColorAlphaTest]; - GLint alphaValueLocation = glGetUniformLocation(self.shaderProgram->program_, kCCUniformAlphaTestValue); + GLint alphaValueLocation = glGetUniformLocation(self.shaderProgram.program, kCCUniformAlphaTestValue_s); // NOTE: alpha test shader is hard-coded to use the equivalent of a glAlphaFunc(GL_GREATER) comparison [self.shaderProgram setUniformLocation:alphaValueLocation withF1:alphaFuncValue]; } else - vertexZvalue_ = [vertexz intValue]; + _vertexZvalue = [vertexz intValue]; } } @@ -260,20 +255,20 @@ -(void) parseInternalProperties -(CCSprite*) tileAt:(CGPoint)pos { - NSAssert( pos.x < layerSize_.width && pos.y < layerSize_.height && pos.x >=0 && pos.y >=0, @"TMXLayer: invalid position"); - NSAssert( tiles_ && atlasIndexArray_, @"TMXLayer: the tiles map has been released"); + NSAssert( pos.x < _layerSize.width && pos.y < _layerSize.height && pos.x >=0 && pos.y >=0, @"TMXLayer: invalid position"); + NSAssert( _tiles && _atlasIndexArray, @"TMXLayer: the tiles map has been released"); CCSprite *tile = nil; uint32_t gid = [self tileGIDAt:pos]; // if GID == 0, then no tile is present if( gid ) { - int z = pos.x + pos.y * layerSize_.width; + int z = pos.x + pos.y * _layerSize.width; tile = (CCSprite*) [self getChildByTag:z]; // tile not created yet. create it if( ! tile ) { - CGRect rect = [tileset_ rectForGID:gid]; + CGRect rect = [_tileset rectForGID:gid]; rect = CC_RECT_PIXELS_TO_POINTS(rect); tile = [[CCSprite alloc] initWithTexture:self.texture rect:rect]; [tile setBatchNode:self]; @@ -282,11 +277,10 @@ -(CCSprite*) tileAt:(CGPoint)pos [tile setPosition:p]; [tile setVertexZ: [self vertexZForPos:pos]]; tile.anchorPoint = CGPointZero; - [tile setOpacity:opacity_]; + [tile setOpacity:_opacity]; NSUInteger indexForZ = [self atlasIndexForExistantZ:z]; [self addSpriteWithoutQuad:tile z:indexForZ tag:z]; - [tile release]; } } return tile; @@ -299,14 +293,14 @@ -(uint32_t) tileGIDAt:(CGPoint)pos -(uint32_t) tileGIDAt:(CGPoint)pos withFlags:(ccTMXTileFlags*)flags { - NSAssert( pos.x < layerSize_.width && pos.y < layerSize_.height && pos.x >=0 && pos.y >=0, @"TMXLayer: invalid position"); - NSAssert( tiles_ && atlasIndexArray_, @"TMXLayer: the tiles map has been released"); + NSAssert( pos.x < _layerSize.width && pos.y < _layerSize.height && pos.x >=0 && pos.y >=0, @"TMXLayer: invalid position"); + NSAssert( _tiles && _atlasIndexArray, @"TMXLayer: the tiles map has been released"); - NSInteger idx = pos.x + pos.y * layerSize_.width; + NSInteger idx = pos.x + pos.y * _layerSize.width; // Bits on the far end of the 32-bit global tile ID are used for tile flags - uint32_t tile = tiles_[idx]; + uint32_t tile = _tiles[idx]; // issue1264, flipped tiles can be changed dynamically if (flags) @@ -321,14 +315,19 @@ - (void) setupTileSprite:(CCSprite*) sprite position:(CGPoint)pos withGID:(uint3 { [sprite setPosition: [self positionAt:pos]]; [sprite setVertexZ: [self vertexZForPos:pos]]; - sprite.anchorPoint = CGPointZero; - [sprite setOpacity:opacity_]; + //sprite.anchorPoint = CGPointZero; // was the default + [sprite setOpacity:_opacity]; //issue 1264, flip can be undone as well sprite.flipX = NO; sprite.flipY = NO; sprite.rotation = 0; - sprite.anchorPoint = ccp(0,0); + //sprite.anchorPoint = ccp(0,0); // was the default + + // All tile sprites in the layer should have the same anchorpoint. + // The default anchor point is defined in the TMX file (within the tileset node) and stored in the + // CCTMXTilesetInfo* property of the CCTMXLayer. + sprite.anchorPoint = _tileset.tileAnchorPoint; // Rotation in tiled is achieved using 3 flipped states, flipping across the horizontal, vertical, and diagonal axes of the tiles. if (gid & kCCTMXTileDiagonalFlag) @@ -373,10 +372,10 @@ - (void) setupTileSprite:(CCSprite*) sprite position:(CGPoint)pos withGID:(uint3 -(CCSprite*) insertTileForGID:(uint32_t)gid at:(CGPoint)pos { - CGRect rect = [tileset_ rectForGID:gid]; + CGRect rect = [_tileset rectForGID:gid]; rect = CC_RECT_PIXELS_TO_POINTS(rect); - NSInteger z = pos.x + pos.y * layerSize_.width; + NSInteger z = pos.x + pos.y * _layerSize.width; CCSprite *tile = [self reusedTileWithRect:rect]; @@ -386,30 +385,29 @@ -(CCSprite*) insertTileForGID:(uint32_t)gid at:(CGPoint)pos NSUInteger indexForZ = [self atlasIndexForNewZ:z]; // Optimization: add the quad without adding a child - [self addQuadFromSprite:tile quadIndex:indexForZ]; + [self insertQuadFromSprite:tile quadIndex:indexForZ]; // insert it into the local atlasindex array - ccCArrayInsertValueAtIndex(atlasIndexArray_, (void*)z, indexForZ); + [_atlasIndexArray insertObject:[NSNumber numberWithInt:(int)z] atIndex:indexForZ]; // update possible children - CCSprite *sprite; - CCARRAY_FOREACH(children_, sprite) { + for (CCSprite *sprite in _children) { NSUInteger ai = [sprite atlasIndex]; if( ai >= indexForZ) [sprite setAtlasIndex: ai+1]; } - tiles_[z] = gid; + _tiles[z] = gid; return tile; } -(CCSprite*) updateTileForGID:(uint32_t)gid at:(CGPoint)pos { - CGRect rect = [tileset_ rectForGID:gid]; + CGRect rect = [_tileset rectForGID:gid]; rect = CC_RECT_PIXELS_TO_POINTS(rect); - int z = pos.x + pos.y * layerSize_.width; + int z = pos.x + pos.y * _layerSize.width; CCSprite *tile = [self reusedTileWithRect:rect]; @@ -421,7 +419,7 @@ -(CCSprite*) updateTileForGID:(uint32_t)gid at:(CGPoint)pos [tile setAtlasIndex:indexForZ]; [tile setDirty:YES]; [tile updateTransform]; - tiles_[z] = gid; + _tiles[z] = gid; return tile; } @@ -431,10 +429,10 @@ -(CCSprite*) updateTileForGID:(uint32_t)gid at:(CGPoint)pos // since lot's of assumptions are no longer true -(CCSprite*) appendTileForGID:(uint32_t)gid at:(CGPoint)pos { - CGRect rect = [tileset_ rectForGID:gid]; + CGRect rect = [_tileset rectForGID:gid]; rect = CC_RECT_PIXELS_TO_POINTS(rect); - NSInteger z = pos.x + pos.y * layerSize_.width; + NSInteger z = pos.x + pos.y * _layerSize.width; CCSprite *tile = [self reusedTileWithRect:rect]; @@ -443,15 +441,15 @@ -(CCSprite*) appendTileForGID:(uint32_t)gid at:(CGPoint)pos // optimization: // The difference between appendTileForGID and insertTileforGID is that append is faster, since // it appends the tile at the end of the texture atlas - NSUInteger indexForZ = atlasIndexArray_->num; + NSUInteger indexForZ = _atlasIndexArray.count; // don't add it using the "standard" way. - [self addQuadFromSprite:tile quadIndex:indexForZ]; + [self insertQuadFromSprite:tile quadIndex:indexForZ]; // append should be after addQuadFromSprite since it modifies the quantity values - ccCArrayInsertValueAtIndex(atlasIndexArray_, (void*)z, indexForZ); + [_atlasIndexArray insertObject:[NSNumber numberWithInt:(int)z] atIndex:indexForZ]; return tile; } @@ -465,21 +463,37 @@ int compareInts (const void * a, const void * b) -(NSUInteger) atlasIndexForExistantZ:(NSUInteger)z { + //TODO: Improve old solution +//#warning Needs to be improved (old solution below) + NSUInteger idx = 0; + for (NSNumber* zValue in _atlasIndexArray) + { + if ([zValue unsignedIntValue] == z) + { + return idx; + } + idx++; + } + /* NSInteger key = z; - NSInteger *item = bsearch((void*)&key, (void*)&atlasIndexArray_->arr[0], atlasIndexArray_->num, sizeof(void*), compareInts); + NSInteger *item = bsearch((void*)&key, (void*)&_atlasIndexArray->arr[0], _atlasIndexArray->num, sizeof(void*), compareInts); NSAssert( item, @"TMX atlas index not found. Shall not happen"); - NSUInteger index = ((NSInteger)item - (NSInteger)atlasIndexArray_->arr) / sizeof(void*); + NSUInteger index = ((NSInteger)item - (NSInteger)_atlasIndexArray->arr) / sizeof(void*); return index; + */ + + // Shouldn't happen + return 0; } -(NSUInteger)atlasIndexForNewZ:(NSUInteger)z { // XXX: This can be improved with a sort of binary search NSUInteger i = 0; - for(i = 0; i< atlasIndexArray_->num; i++) { - NSUInteger val = (NSUInteger) atlasIndexArray_->arr[i]; + for(i = 0; i< _atlasIndexArray.count; i++) { + NSUInteger val = (NSUInteger) [[_atlasIndexArray objectAtIndex:i] intValue]; if( z < val ) break; } @@ -489,14 +503,15 @@ -(NSUInteger)atlasIndexForNewZ:(NSUInteger)z #pragma mark CCTMXLayer - adding / remove tiles -(void) setTileGID:(uint32_t)gid at:(CGPoint)pos { - [self setTileGID:gid at:pos withFlags:NO]; + //TODO: Should we really cast here? + [self setTileGID:gid at:pos withFlags:(ccTMXTileFlags)NO]; } -(void) setTileGID:(uint32_t)gid at:(CGPoint)pos withFlags:(ccTMXTileFlags)flags { - NSAssert( pos.x < layerSize_.width && pos.y < layerSize_.height && pos.x >=0 && pos.y >=0, @"TMXLayer: invalid position"); - NSAssert( tiles_ && atlasIndexArray_, @"TMXLayer: the tiles map has been released"); - NSAssert( gid == 0 || gid >= tileset_.firstGid, @"TMXLayer: invalid gid" ); + NSAssert( pos.x < _layerSize.width && pos.y < _layerSize.height && pos.x >=0 && pos.y >=0, @"TMXLayer: invalid position"); + NSAssert( _tiles && _atlasIndexArray, @"TMXLayer: the tiles map has been released"); + NSAssert( gid == 0 || gid >= _tileset.firstGid, @"TMXLayer: invalid gid" ); ccTMXTileFlags currentFlags; uint32_t currentGID = [self tileGIDAt:pos withFlags:¤tFlags]; @@ -516,10 +531,10 @@ -(void) setTileGID:(uint32_t)gid at:(CGPoint)pos withFlags:(ccTMXTileFlags)flags // modifying an existing tile with a non-empty tile else { - NSUInteger z = pos.x + pos.y * layerSize_.width; + NSUInteger z = pos.x + pos.y * _layerSize.width; CCSprite *sprite = (CCSprite*)[self getChildByTag:z]; if( sprite ) { - CGRect rect = [tileset_ rectForGID:gid]; + CGRect rect = [_tileset rectForGID:gid]; rect = CC_RECT_PIXELS_TO_POINTS(rect); [sprite setTextureRect:rect rotated:NO untrimmedSize:rect.size]; @@ -527,7 +542,7 @@ -(void) setTileGID:(uint32_t)gid at:(CGPoint)pos withFlags:(ccTMXTileFlags)flags if (flags) [self setupTileSprite:sprite position:[sprite position] withGID:gidAndFlags]; - tiles_[z] = gidAndFlags; + _tiles[z] = gidAndFlags; } else [self updateTileForGID:gidAndFlags at:pos]; } @@ -539,48 +554,52 @@ -(void) addChild: (CCNode*)node z:(NSInteger)z tag:(NSInteger)tag NSAssert(NO, @"addChild: is not supported on CCTMXLayer. Instead use setTileGID:at:/tileAt:"); } --(void) removeChild:(CCSprite*)sprite cleanup:(BOOL)cleanup +-(void) removeChild:(CCNode*)spriteChild cleanup:(BOOL)cleanup { + CCSprite *sprite = (CCSprite *)spriteChild; + NSAssert([sprite isKindOfClass:[CCSprite class]],@"sprite must be a CCSprite object or subclass"); + // allows removing nil objects if( ! sprite ) return; - NSAssert( [children_ containsObject:sprite], @"Tile does not belong to TMXLayer"); + NSAssert( [_children containsObject:sprite], @"Tile does not belong to TMXLayer"); NSUInteger atlasIndex = [sprite atlasIndex]; - NSUInteger zz = (NSUInteger) atlasIndexArray_->arr[atlasIndex]; - tiles_[zz] = 0; - ccCArrayRemoveValueAtIndex(atlasIndexArray_, atlasIndex); + NSUInteger zz = (NSUInteger) [[_atlasIndexArray objectAtIndex:atlasIndex] intValue]; + _tiles[zz] = 0; + [_atlasIndexArray removeObjectAtIndex:atlasIndex]; [super removeChild:sprite cleanup:cleanup]; } -(void) removeTileAt:(CGPoint)pos { - NSAssert( pos.x < layerSize_.width && pos.y < layerSize_.height && pos.x >=0 && pos.y >=0, @"TMXLayer: invalid position"); - NSAssert( tiles_ && atlasIndexArray_, @"TMXLayer: the tiles map has been released"); + NSAssert( pos.x < _layerSize.width && pos.y < _layerSize.height && pos.x >=0 && pos.y >=0, @"TMXLayer: invalid position"); + NSAssert( _tiles && _atlasIndexArray, @"TMXLayer: the tiles map has been released"); uint32_t gid = [self tileGIDAt:pos]; if( gid ) { - NSUInteger z = pos.x + pos.y * layerSize_.width; + NSUInteger z = pos.x + pos.y * _layerSize.width; NSUInteger atlasIndex = [self atlasIndexForExistantZ:z]; // remove tile from GID map - tiles_[z] = 0; + _tiles[z] = 0; // remove tile from atlas position array - ccCArrayRemoveValueAtIndex(atlasIndexArray_, atlasIndex); + [_atlasIndexArray removeObjectAtIndex:atlasIndex]; // remove it from sprites and/or texture atlas id sprite = [self getChildByTag:z]; if( sprite ) [super removeChild:sprite cleanup:YES]; else { - [textureAtlas_ removeQuadAtIndex:atlasIndex]; + [_textureAtlas removeQuadAtIndex:atlasIndex]; // update possible children - CCARRAY_FOREACH(children_, sprite) { + for (sprite in _children) + { NSUInteger ai = [sprite atlasIndex]; if( ai >= atlasIndex) { [sprite setAtlasIndex: ai-1]; @@ -595,13 +614,13 @@ -(void) removeTileAt:(CGPoint)pos -(CGPoint) calculateLayerOffset:(CGPoint)pos { CGPoint ret = CGPointZero; - switch( layerOrientation_ ) { + switch( _layerOrientation ) { case CCTMXOrientationOrtho: - ret = ccp( pos.x * mapTileSize_.width, -pos.y *mapTileSize_.height); + ret = ccp( pos.x * _mapTileSize.width, -pos.y *_mapTileSize.height); break; case CCTMXOrientationIso: - ret = ccp( (mapTileSize_.width /2) * (pos.x - pos.y), - (mapTileSize_.height /2 ) * (-pos.x - pos.y) ); + ret = ccp( (_mapTileSize.width /2) * (pos.x - pos.y), + (_mapTileSize.height /2 ) * (-pos.x - pos.y) ); break; case CCTMXOrientationHex: NSAssert(CGPointEqualToPoint(pos, CGPointZero), @"offset for hexagonal map not implemented yet"); @@ -613,7 +632,7 @@ -(CGPoint) calculateLayerOffset:(CGPoint)pos -(CGPoint) positionAt:(CGPoint)pos { CGPoint ret = CGPointZero; - switch( layerOrientation_ ) { + switch( _layerOrientation ) { case CCTMXOrientationOrtho: ret = [self positionForOrthoAt:pos]; break; @@ -632,8 +651,8 @@ -(CGPoint) positionAt:(CGPoint)pos -(CGPoint) positionForOrthoAt:(CGPoint)pos { CGPoint xy = { - pos.x * mapTileSize_.width, - (layerSize_.height - pos.y - 1) * mapTileSize_.height, + pos.x * _mapTileSize.width, + (_layerSize.height - pos.y - 1) * _mapTileSize.height, }; return xy; } @@ -641,8 +660,8 @@ -(CGPoint) positionForOrthoAt:(CGPoint)pos -(CGPoint) positionForIsoAt:(CGPoint)pos { CGPoint xy = { - mapTileSize_.width /2 * ( layerSize_.width + pos.x - pos.y - 1), - mapTileSize_.height /2 * (( layerSize_.height * 2 - pos.x - pos.y) - 2), + _mapTileSize.width /2 * ( _layerSize.width + pos.x - pos.y - 1), + _mapTileSize.height /2 * (( _layerSize.height * 2 - pos.x - pos.y) - 2), }; return xy; } @@ -651,11 +670,11 @@ -(CGPoint) positionForHexAt:(CGPoint)pos { float diffY = 0; if( (int)pos.x % 2 == 1 ) - diffY = -mapTileSize_.height/2 ; + diffY = -_mapTileSize.height/2 ; CGPoint xy = { - pos.x * mapTileSize_.width*3/4, - (layerSize_.height - pos.y - 1) * mapTileSize_.height + diffY + pos.x * _mapTileSize.width*3/4, + (_layerSize.height - pos.y - 1) * _mapTileSize.height + diffY }; return xy; } @@ -664,14 +683,14 @@ -(NSInteger) vertexZForPos:(CGPoint)pos { NSInteger ret = 0; NSUInteger maxVal = 0; - if( useAutomaticVertexZ_ ) { - switch( layerOrientation_ ) { + if( _useAutomaticVertexZ ) { + switch( _layerOrientation ) { case CCTMXOrientationIso: - maxVal = layerSize_.width + layerSize_.height; + maxVal = _layerSize.width + _layerSize.height; ret = -(maxVal - (pos.x + pos.y)); break; case CCTMXOrientationOrtho: - ret = -(layerSize_.height-pos.y); + ret = -(_layerSize.height-pos.y); break; case CCTMXOrientationHex: NSAssert(NO,@"TMX Hexa zOrder not supported"); @@ -681,7 +700,7 @@ -(NSInteger) vertexZForPos:(CGPoint)pos break; } } else - ret = vertexZvalue_; + ret = _vertexZvalue; return ret; } diff --git a/cocos2d/CCTMXObjectGroup.h b/cocos2d/CCTMXObjectGroup.h new file mode 100644 index 0000000..eaee3ce --- /dev/null +++ b/cocos2d/CCTMXObjectGroup.h @@ -0,0 +1,67 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2010 Neophit + * + * Copyright (c) 2010 Ricardo Quesada + * Copyright (c) 2011 Zynga Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * + * TMX Tiled Map support: + * http://www.mapeditor.org + * + */ + +#import "CCNode.h" + + +@class CCTMXObjectGroup; + + +/** CCTMXObjectGroup represents the TMX object group. +@since v0.99.0 +*/ +@interface CCTMXObjectGroup : NSObject +{ + NSString *_groupName; + CGPoint _positionOffset; + NSMutableArray *_objects; + NSMutableDictionary *_properties; +} + +/** name of the group */ +@property (nonatomic,readwrite,strong) NSString *groupName; +/** offset position of child objects */ +@property (nonatomic,readwrite,assign) CGPoint positionOffset; +/** array of the objects */ +@property (nonatomic,readwrite,strong) NSMutableArray *objects; +/** list of properties stored in a dictionary */ +@property (nonatomic,readwrite,strong) NSMutableDictionary *properties; + +/** return the value for the specific property name */ +-(id) propertyNamed:(NSString *)propertyName; + +/** return the dictionary for the specific object name. + It will return the 1st object found on the array for the given name. + */ +-(NSMutableDictionary*) objectNamed:(NSString *)objectName; + +@end diff --git a/src/cocos2d/CCTMXObjectGroup.m b/cocos2d/CCTMXObjectGroup.m similarity index 86% rename from src/cocos2d/CCTMXObjectGroup.m rename to cocos2d/CCTMXObjectGroup.m index 970effa..f2bbefd 100644 --- a/src/cocos2d/CCTMXObjectGroup.m +++ b/cocos2d/CCTMXObjectGroup.m @@ -41,10 +41,10 @@ @implementation CCTMXObjectGroup -@synthesize groupName = groupName_; -@synthesize objects = objects_; -@synthesize positionOffset = positionOffset_; -@synthesize properties = properties_; +@synthesize groupName = _groupName; +@synthesize objects = _objects; +@synthesize positionOffset = _positionOffset; +@synthesize properties = _properties; -(id) init { @@ -61,15 +61,11 @@ -(void) dealloc { CCLOGINFO( @"cocos2d: deallocing %@", self ); - [groupName_ release]; - [objects_ release]; - [properties_ release]; - [super dealloc]; } -(NSMutableDictionary*) objectNamed:(NSString *)objectName { - for( id object in objects_ ) { + for( id object in _objects ) { if( [[object valueForKey:@"name"] isEqual:objectName] ) return object; } @@ -80,7 +76,7 @@ -(NSMutableDictionary*) objectNamed:(NSString *)objectName -(id) propertyNamed:(NSString *)propertyName { - return [properties_ valueForKey:propertyName]; + return [_properties valueForKey:propertyName]; } @end diff --git a/cocos2d/CCTMXTiledMap.h b/cocos2d/CCTMXTiledMap.h new file mode 100644 index 0000000..c438848 --- /dev/null +++ b/cocos2d/CCTMXTiledMap.h @@ -0,0 +1,145 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2009-2010 Ricardo Quesada + * Copyright (c) 2011 Zynga Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * + * TMX Tiled Map support: + * http://www.mapeditor.org + * + */ + +#import "CCNode.h" + +@class CCTMXLayer; +@class CCTMXObjectGroup; + +/** Possible oritentations of the TMX map */ +enum +{ + /** Orthogonal orientation */ + CCTMXOrientationOrtho, + + /** Hexagonal orientation */ + CCTMXOrientationHex, + + /** Isometric orientation */ + CCTMXOrientationIso, +}; + +/** CCTMXTiledMap knows how to parse and render a TMX map. + + It adds support for the TMX tiled map format used by http://www.mapeditor.org + It supports isometric, hexagonal and orthogonal tiles. + It also supports object groups, objects, and properties. + + Features: + - Each tile will be treated as an CCSprite + - The sprites are created on demand. They will be created only when you call "[layer tileAt:]" + - Each tile can be rotated / moved / scaled / tinted / "opacitied", since each tile is a CCSprite + - Tiles can be added/removed in runtime + - The z-order of the tiles can be modified in runtime + - Each tile has an anchorPoint of (0,0) + - The anchorPoint of the TMXTileMap is (0,0) + - The TMX layers will be added as a child + - The TMX layers will be aliased by default + - The tileset image will be loaded using the CCTextureCache + - Each tile will have a unique tag + - Each tile will have a unique z value. top-left: z=1, bottom-right: z=max z + - Each object group will be treated as an NSMutableArray + - Object class which will contain all the properties in a dictionary + - Properties can be assigned to the Map, Layer, Object Group, and Object + + Limitations: + - It only supports one tileset per layer. + - Embedded images are not supported + - It only supports the XML format (the JSON format is not supported) + + Technical description: + Each layer is created using an CCTMXLayer (subclass of CCSpriteBatchNode). If you have 5 layers, then 5 CCTMXLayer will be created, + unless the layer visibility is off. In that case, the layer won't be created at all. + You can obtain the layers (CCTMXLayer objects) at runtime by: + - [map getChildByTag: tax_number]; // 0=1st layer, 1=2nd layer, 2=3rd layer, etc... + - [map layerNamed: name_of_the_layer]; + + Each object group is created using a CCTMXObjectGroup which is a subclass of NSMutableArray. + You can obtain the object groups at runtime by: + - [map objectGroupNamed: name_of_the_object_group]; + + Each object is a CCTMXObject. + + Each property is stored as a key-value pair in an NSMutableDictionary. + You can obtain the properties at runtime by: + + [map propertyNamed: name_of_the_property]; + [layer propertyNamed: name_of_the_property]; + [objectGroup propertyNamed: name_of_the_property]; + [object propertyNamed: name_of_the_property]; + + @since v0.8.1 + */ +@interface CCTMXTiledMap : CCNode +{ + CGSize _mapSize; + CGSize _tileSize; + int _mapOrientation; + NSMutableArray *_objectGroups; + NSMutableDictionary *_properties; + NSMutableDictionary *_tileProperties; +} + +/** the map's size property measured in tiles */ +@property (nonatomic,readonly) CGSize mapSize; +/** the tiles's size property measured in pixels */ +@property (nonatomic,readonly) CGSize tileSize; +/** map orientation */ +@property (nonatomic,readonly) int mapOrientation; +/** object groups */ +@property (nonatomic,readwrite,strong) NSMutableArray *objectGroups; +/** properties */ +@property (nonatomic,readwrite,strong) NSMutableDictionary *properties; + +/** creates a TMX Tiled Map with a TMX file.*/ ++(id) tiledMapWithTMXFile:(NSString*)tmxFile; + +/** initializes a TMX Tiled Map with a TMX formatted XML string and a path to TMX resources */ ++(id) tiledMapWithXML:(NSString*)tmxString resourcePath:(NSString*)resourcePath; + +/** initializes a TMX Tiled Map with a TMX file */ +-(id) initWithTMXFile:(NSString*)tmxFile; + +/** initializes a TMX Tiled Map with a TMX formatted XML string and a path to TMX resources */ +-(id) initWithXML:(NSString*)tmxString resourcePath:(NSString*)resourcePath; + +/** return the TMXLayer for the specific layer */ +-(CCTMXLayer*) layerNamed:(NSString *)layerName; + +/** return the TMXObjectGroup for the specific group */ +-(CCTMXObjectGroup*) objectGroupNamed:(NSString *)groupName; + +/** return the value for the specific property name */ +-(id) propertyNamed:(NSString *)propertyName; + +/** return properties dictionary for tile GID */ +-(NSDictionary*)propertiesForGID:(unsigned int)GID; +@end + diff --git a/src/cocos2d/CCTMXTiledMap.m b/cocos2d/CCTMXTiledMap.m similarity index 84% rename from src/cocos2d/CCTMXTiledMap.m rename to cocos2d/CCTMXTiledMap.m index 0117b2e..a029c31 100644 --- a/src/cocos2d/CCTMXTiledMap.m +++ b/cocos2d/CCTMXTiledMap.m @@ -47,30 +47,30 @@ -(void) buildWithMapInfo:(CCTMXMapInfo*)mapInfo; @end @implementation CCTMXTiledMap -@synthesize mapSize = mapSize_; -@synthesize tileSize = tileSize_; -@synthesize mapOrientation = mapOrientation_; -@synthesize objectGroups = objectGroups_; -@synthesize properties = properties_; +@synthesize mapSize = _mapSize; +@synthesize tileSize = _tileSize; +@synthesize mapOrientation = _mapOrientation; +@synthesize objectGroups = _objectGroups; +@synthesize properties = _properties; +(id) tiledMapWithTMXFile:(NSString*)tmxFile { - return [[[self alloc] initWithTMXFile:tmxFile] autorelease]; + return [[self alloc] initWithTMXFile:tmxFile]; } +(id) tiledMapWithXML:(NSString*)tmxString resourcePath:(NSString*)resourcePath { - return [[[self alloc] initWithXML:tmxString resourcePath:resourcePath] autorelease]; + return [[self alloc] initWithXML:tmxString resourcePath:resourcePath]; } -(void) buildWithMapInfo:(CCTMXMapInfo*)mapInfo { - mapSize_ = mapInfo.mapSize; - tileSize_ = mapInfo.tileSize; - mapOrientation_ = mapInfo.orientation; - objectGroups_ = [mapInfo.objectGroups retain]; - properties_ = [mapInfo.properties retain]; - tileProperties_ = [mapInfo.tileProperties retain]; + _mapSize = mapInfo.mapSize; + _tileSize = mapInfo.tileSize; + _mapOrientation = mapInfo.orientation; + _objectGroups = mapInfo.objectGroups; + _properties = mapInfo.properties; + _tileProperties = mapInfo.tileProperties; int idx=0; @@ -124,13 +124,6 @@ -(id) initWithTMXFile:(NSString*)tmxFile return self; } --(void) dealloc -{ - [objectGroups_ release]; - [properties_ release]; - [tileProperties_ release]; - [super dealloc]; -} // private -(id) parseLayer:(CCTMXLayerInfo*)layerInfo map:(CCTMXMapInfo*)mapInfo @@ -184,8 +177,7 @@ -(CCTMXTilesetInfo*) tilesetForLayer:(CCTMXLayerInfo*)layerInfo map:(CCTMXMapInf -(CCTMXLayer*) layerNamed:(NSString *)layerName { - CCTMXLayer *layer; - CCARRAY_FOREACH(children_, layer) { + for (CCTMXLayer *layer in _children) { if([layer isKindOfClass:[CCTMXLayer class]]) if([layer.layerName isEqual:layerName]) return layer; @@ -197,7 +189,7 @@ -(CCTMXLayer*) layerNamed:(NSString *)layerName -(CCTMXObjectGroup*) objectGroupNamed:(NSString *)groupName { - for( CCTMXObjectGroup *objectGroup in objectGroups_ ) { + for( CCTMXObjectGroup *objectGroup in _objectGroups ) { if( [objectGroup.groupName isEqual:groupName] ) return objectGroup; } @@ -208,10 +200,10 @@ -(CCTMXObjectGroup*) objectGroupNamed:(NSString *)groupName -(id) propertyNamed:(NSString *)propertyName { - return [properties_ valueForKey:propertyName]; + return [_properties valueForKey:propertyName]; } -(NSDictionary*)propertiesForGID:(unsigned int)GID{ - return [tileProperties_ objectForKey:[NSNumber numberWithInt:GID]]; + return [_tileProperties objectForKey:[NSNumber numberWithInt:GID]]; } @end diff --git a/cocos2d/CCTMXXMLParser.h b/cocos2d/CCTMXXMLParser.h new file mode 100644 index 0000000..935ae47 --- /dev/null +++ b/cocos2d/CCTMXXMLParser.h @@ -0,0 +1,228 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2009-2010 Ricardo Quesada + * Copyright (c) 2011 Zynga Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * + * TMX Tiled Map support: + * http://www.mapeditor.org + * + */ + +/* + * Internal TMX parser + * + * IMPORTANT: These classed should not be documented using doxygen strings + * since the user should not use them. + * + */ + + +#import + +#import "ccMacros.h" + +enum { + TMXLayerAttribNone = 1 << 0, + TMXLayerAttribBase64 = 1 << 1, + TMXLayerAttribGzip = 1 << 2, + TMXLayerAttribZlib = 1 << 3, +}; + +enum { + TMXPropertyNone, + TMXPropertyMap, + TMXPropertyLayer, + TMXPropertyObjectGroup, + TMXPropertyObject, + TMXPropertyTile +}; + +typedef enum ccTMXTileFlags_ { + kCCTMXTileHorizontalFlag = 0x80000000, + kCCTMXTileVerticalFlag = 0x40000000, + kCCTMXTileDiagonalFlag = 0x20000000, + + kCCFlipedAll = (kCCTMXTileHorizontalFlag|kCCTMXTileVerticalFlag|kCCTMXTileDiagonalFlag), + kCCFlippedMask = ~(kCCFlipedAll), +} ccTMXTileFlags; + +// Bits on the far end of the 32-bit global tile ID (GID's) are used for tile flags + +/* CCTMXLayerInfo contains the information about the layers like: + - Layer name + - Layer size + - Layer opacity at creation time (it can be modified at runtime) + - Whether the layer is visible (if it is not visible, then the CCNode won't be created) + + This information is obtained from the TMX file. + */ +@interface CCTMXLayerInfo : NSObject +{ + NSString *_name; + CGSize _layerSize; + unsigned int *_tiles; + BOOL _visible; + unsigned char _opacity; + BOOL _ownTiles; + unsigned int _minGID; + unsigned int _maxGID; + NSMutableDictionary *_properties; + CGPoint _offset; +} + +@property (nonatomic,readwrite,strong) NSString *name; +@property (nonatomic,readwrite) CGSize layerSize; +@property (nonatomic,readwrite) unsigned int *tiles; +@property (nonatomic,readwrite) BOOL visible; +@property (nonatomic,readwrite) unsigned char opacity; +@property (nonatomic,readwrite) BOOL ownTiles; +@property (nonatomic,readwrite) unsigned int minGID; +@property (nonatomic,readwrite) unsigned int maxGID; +@property (nonatomic,readwrite,strong) NSMutableDictionary *properties; +@property (nonatomic,readwrite) CGPoint offset; +@end + +/* CCTMXTilesetInfo contains the information about the tilesets like: + - Tileset name + - Tilset spacing + - Tileset margin + - size of the tiles + - Image used for the tiles + - Image size + + This information is obtained from the TMX file. + */ +@interface CCTMXTilesetInfo : NSObject +{ + NSString *_name; + unsigned int _firstGid; + CGSize _tileSize; + unsigned int _spacing; + unsigned int _margin; + + // Offset of tiles. New TMX XML node introduced here: https://github.com/bjorn/tiled/issues/16 . + // Node structure: + // (...) + // + // + // (...) + CGPoint _tileOffset; + CGPoint _tileAnchorPoint; //normalized anchor point + + // filename containing the tiles (should be spritesheet / texture atlas) + NSString *_sourceImage; + + // size in pixels of the image + CGSize _imageSize; +} +@property (nonatomic,readwrite,strong) NSString *name; +@property (nonatomic,readwrite,assign) unsigned int firstGid; +@property (nonatomic,readwrite,assign) CGSize tileSize; +@property (nonatomic,readwrite,assign) unsigned int spacing; +@property (nonatomic,readwrite,assign) unsigned int margin; +@property (nonatomic,readwrite,strong) NSString *sourceImage; +@property (nonatomic,readwrite,assign) CGSize imageSize; +@property (nonatomic,readwrite,assign) CGPoint tileOffset; //setter has a custom implementation +@property (nonatomic,assign) CGPoint tileAnchorPoint; //set automatically when tileOffset changes + +-(CGRect) rectForGID:(unsigned int)gid; +@end + +/* CCTMXMapInfo contains the information about the map like: + - Map orientation (hexagonal, isometric or orthogonal) + - Tile size + - Map size + + And it also contains: + - Layers (an array of TMXLayerInfo objects) + - Tilesets (an array of TMXTilesetInfo objects) + - ObjectGroups (an array of TMXObjectGroupInfo objects) + + This information is obtained from the TMX file. + + */ +@interface CCTMXMapInfo : NSObject +{ + NSMutableString *_currentString; + BOOL _storingCharacters; + int _layerAttribs; + int _parentElement; + unsigned int _parentGID; + unsigned int _currentFirstGID; + + // tmx filename + NSString *_filename; + + // tmx resource path + NSString *_resources; + + // map orientation + int _orientation; + + // map width & height + CGSize _mapSize; + + // tiles width & height + CGSize _tileSize; + + // Layers + NSMutableArray *_layers; + + // tilesets + NSMutableArray *_tilesets; + + // ObjectGroups + NSMutableArray *_objectGroups; + + // properties + NSMutableDictionary *_properties; + + // tile properties + NSMutableDictionary *_tileProperties; +} + +@property (nonatomic,readwrite,assign) int orientation; +@property (nonatomic,readwrite,assign) CGSize mapSize; +@property (nonatomic,readwrite,assign) CGSize tileSize; +@property (nonatomic,readwrite,strong) NSMutableArray *layers; +@property (nonatomic,readwrite,strong) NSMutableArray *tilesets; +@property (nonatomic,readwrite,strong) NSString *filename; +@property (nonatomic,readwrite,strong) NSString *resources; +@property (nonatomic,readwrite,strong) NSMutableArray *objectGroups; +@property (nonatomic,readwrite,strong) NSMutableDictionary *properties; +@property (nonatomic,readwrite,strong) NSMutableDictionary *tileProperties; + +/** creates a TMX Format with a tmx file */ ++(id) formatWithTMXFile:(NSString*)tmxFile; + +/** creates a TMX Format with an XML string and a TMX resource path */ ++(id) formatWithXML:(NSString*)tmxString resourcePath:(NSString*)resourcePath; + +/** initializes a TMX format with a tmx file */ +-(id) initWithTMXFile:(NSString*)tmxFile; + +/** initializes a TMX format with an XML string and a TMX resource path */ +-(id) initWithXML:(NSString*)tmxString resourcePath:(NSString*)resourcePath; + +@end + diff --git a/src/cocos2d/CCTMXXMLParser.m b/cocos2d/CCTMXXMLParser.m similarity index 65% rename from src/cocos2d/CCTMXXMLParser.m rename to cocos2d/CCTMXXMLParser.m index 9eb0231..a51ac62 100644 --- a/src/cocos2d/CCTMXXMLParser.m +++ b/cocos2d/CCTMXXMLParser.m @@ -47,17 +47,17 @@ @implementation CCTMXLayerInfo -@synthesize name = name_, layerSize = layerSize_, tiles = tiles_, visible = visible_, opacity = opacity_, ownTiles = ownTiles_, minGID = minGID_, maxGID = maxGID_, properties = properties_; -@synthesize offset = offset_; +@synthesize name = _name, layerSize = _layerSize, tiles = _tiles, visible = _visible, opacity = _opacity, ownTiles = _ownTiles, minGID = _minGID, maxGID = _maxGID, properties = _properties; +@synthesize offset = _offset; -(id) init { if( (self=[super init])) { - ownTiles_ = YES; - minGID_ = 100000; - maxGID_ = 0; + _ownTiles = YES; + _minGID = 100000; + _maxGID = 0; self.name = nil; - tiles_ = NULL; - offset_ = CGPointZero; + _tiles = NULL; + _offset = CGPointZero; self.properties = [NSMutableDictionary dictionaryWithCapacity:5]; } return self; @@ -66,14 +66,11 @@ - (void) dealloc { CCLOGINFO(@"cocos2d: deallocing %@",self); - [name_ release]; - [properties_ release]; - if( ownTiles_ && tiles_ ) { - free( tiles_ ); - tiles_ = NULL; + if( _ownTiles && _tiles ) { + free( _tiles ); + _tiles = NULL; } - [super dealloc]; } @end @@ -82,29 +79,43 @@ - (void) dealloc #pragma mark TMXTilesetInfo @implementation CCTMXTilesetInfo -@synthesize name = name_, firstGid = firstGid_, tileSize = tileSize_, spacing = spacing_, margin = margin_, sourceImage = sourceImage_, imageSize = imageSize_; +@synthesize name = _name, firstGid = _firstGid, tileSize = _tileSize, spacing = _spacing, margin = _margin, sourceImage = _sourceImage, imageSize = _imageSize; +@synthesize tileOffset = _tileOffset, tileAnchorPoint = _tileAnchorPoint; + +/** + Custom Setter: + Sets the _tileOffset property (expressed in pixels) as specified in the TMX file (should be double for retina). + Then it calculates the anchorPoint for the tiles (expressed as %), and stores it in the _tileAnchorPoint readonly property. + The CCTMXLayer is then responsible for setting the anchorPoint of its tile sprites. + (implemented in -[CCTMXLayer setupTileSprite:position:withGID:]) + */ +- (void)setTileOffset:(CGPoint)tileOffset +{ + _tileOffset = tileOffset; + NSAssert((self.tileSize.width > 0 && self.tileSize.height > 0), @"Error in [CCTMXTilesetInfo setTileOffset:], tileSize is Zero"); + float normalizedOffsetX = tileOffset.x / _tileSize.width; + float normalizedOffsetY = tileOffset.y / _tileSize.height; + _tileAnchorPoint = CGPointMake(normalizedOffsetX, normalizedOffsetY); +} - (void) dealloc { CCLOGINFO(@"cocos2d: deallocing %@", self); - [sourceImage_ release]; - [name_ release]; - [super dealloc]; } -(CGRect) rectForGID:(unsigned int)gid { CGRect rect; - rect.size = tileSize_; + rect.size = _tileSize; gid &= kCCFlippedMask; - gid = gid - firstGid_; + gid = gid - _firstGid; - int max_x = (imageSize_.width - margin_*2 + spacing_) / (tileSize_.width + spacing_); + int max_x = (_imageSize.width - _margin*2 + _spacing) / (_tileSize.width + _spacing); // int max_y = (imageSize.height - margin*2 + spacing) / (tileSize.height + spacing); - rect.origin.x = (gid % max_x) * (tileSize_.width + spacing_) + margin_; - rect.origin.y = (gid / max_x) * (tileSize_.height + spacing_) + margin_; + rect.origin.x = (gid % max_x) * (_tileSize.width + _spacing) + _margin; + rect.origin.y = (gid / max_x) * (_tileSize.height + _spacing) + _margin; return rect; } @@ -124,17 +135,17 @@ - (void) parseXMLData:(NSData*)data; @implementation CCTMXMapInfo -@synthesize orientation = orientation_, mapSize = mapSize_, layers = layers_, tilesets = tilesets_, tileSize = tileSize_, filename = filename_, resources = resources_, objectGroups = objectGroups_, properties = properties_; -@synthesize tileProperties = tileProperties_; +@synthesize orientation = _orientation, mapSize = _mapSize, layers = _layers, tilesets = _tilesets, tileSize = _tileSize, filename = _filename, resources = _resources, objectGroups = _objectGroups, properties = _properties; +@synthesize tileProperties = _tileProperties; +(id) formatWithTMXFile:(NSString*)tmxFile { - return [[[self alloc] initWithTMXFile:tmxFile] autorelease]; + return [[self alloc] initWithTMXFile:tmxFile]; } +(id) formatWithXML:(NSString*)tmxString resourcePath:(NSString*)resourcePath { - return [[[self alloc] initWithXML:tmxString resourcePath:resourcePath] autorelease]; + return [[self alloc] initWithXML:tmxString resourcePath:resourcePath]; } - (void) internalInit:(NSString*)tmxFileName resourcePath:(NSString*)resourcePath @@ -148,10 +159,11 @@ - (void) internalInit:(NSString*)tmxFileName resourcePath:(NSString*)resourcePat self.tileProperties = [NSMutableDictionary dictionaryWithCapacity:5]; // tmp vars - currentString = [[NSMutableString alloc] initWithCapacity:1024]; - storingCharacters = NO; - layerAttribs = TMXLayerAttribNone; - parentElement = TMXPropertyNone; + _currentString = [[NSMutableString alloc] initWithCapacity:1024]; + _storingCharacters = NO; + _layerAttribs = TMXLayerAttribNone; + _parentElement = TMXPropertyNone; + _currentFirstGID = 0; } -(id) initWithXML:(NSString *)tmxString resourcePath:(NSString*)resourcePath @@ -167,7 +179,7 @@ -(id) initWithTMXFile:(NSString*)tmxFile { if( (self=[super init])) { [self internalInit:tmxFile resourcePath:nil]; - [self parseXMLFile:filename_]; + [self parseXMLFile:_filename]; } return self; } @@ -175,20 +187,11 @@ -(id) initWithTMXFile:(NSString*)tmxFile - (void) dealloc { CCLOGINFO(@"cocos2d: deallocing %@", self); - [tilesets_ release]; - [layers_ release]; - [filename_ release]; - [resources_ release]; - [currentString release]; - [objectGroups_ release]; - [properties_ release]; - [tileProperties_ release]; - [super dealloc]; } - (void) parseXMLData:(NSData*)data { - NSXMLParser *parser = [[[NSXMLParser alloc] initWithData:data] autorelease]; + NSXMLParser *parser = [[NSXMLParser alloc] initWithData:data]; // we'll do the parsing [parser setDelegate:self]; @@ -208,7 +211,7 @@ - (void) parseXMLString:(NSString *)xmlString - (void) parseXMLFile:(NSString *)xmlFilename { - NSURL *url = [NSURL fileURLWithPath:[[CCFileUtils sharedFileUtils] fullPathFromRelativePath:xmlFilename] ]; + NSURL *url = [NSURL fileURLWithPath:[[CCFileUtils sharedFileUtils] fullPathForFilename:xmlFilename] ]; NSData *data = [NSData dataWithContentsOfURL:url]; [self parseXMLData:data]; } @@ -222,58 +225,72 @@ -(void)parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName name CCLOG(@"cocos2d: TMXFormat: Unsupported TMX version: %@", version); NSString *orientationStr = [attributeDict objectForKey:@"orientation"]; if( [orientationStr isEqualToString:@"orthogonal"]) - orientation_ = CCTMXOrientationOrtho; + _orientation = CCTMXOrientationOrtho; else if ( [orientationStr isEqualToString:@"isometric"]) - orientation_ = CCTMXOrientationIso; + _orientation = CCTMXOrientationIso; else if( [orientationStr isEqualToString:@"hexagonal"]) - orientation_ = CCTMXOrientationHex; + _orientation = CCTMXOrientationHex; else - CCLOG(@"cocos2d: TMXFomat: Unsupported orientation: %d", orientation_); + CCLOG(@"cocos2d: TMXFomat: Unsupported orientation: %d", _orientation); - mapSize_.width = [[attributeDict objectForKey:@"width"] intValue]; - mapSize_.height = [[attributeDict objectForKey:@"height"] intValue]; - tileSize_.width = [[attributeDict objectForKey:@"tilewidth"] intValue]; - tileSize_.height = [[attributeDict objectForKey:@"tileheight"] intValue]; + _mapSize.width = [[attributeDict objectForKey:@"width"] intValue]; + _mapSize.height = [[attributeDict objectForKey:@"height"] intValue]; + _tileSize.width = [[attributeDict objectForKey:@"tilewidth"] intValue]; + _tileSize.height = [[attributeDict objectForKey:@"tileheight"] intValue]; // The parent element is now "map" - parentElement = TMXPropertyMap; + _parentElement = TMXPropertyMap; } else if([elementName isEqualToString:@"tileset"]) { // If this is an external tileset then start parsing that NSString *externalTilesetFilename = [attributeDict objectForKey:@"source"]; if (externalTilesetFilename) { - // Tileset file will be relative to the map file. So we need to convert it to an absolute path - NSString *dir = [filename_ stringByDeletingLastPathComponent]; // Directory of map file - if (!dir) - dir = resources_; - externalTilesetFilename = [dir stringByAppendingPathComponent:externalTilesetFilename]; // Append path to tileset file + // Tileset file will be relative to the map file. So we need to convert it to an absolute path + NSString *dir = [_filename stringByDeletingLastPathComponent]; // Directory of map file + if (!dir) + dir = _resources; + externalTilesetFilename = [dir stringByAppendingPathComponent:externalTilesetFilename]; // Append path to tileset file - [self parseXMLFile:externalTilesetFilename]; + _currentFirstGID = [[attributeDict objectForKey:@"firstgid"] intValue]; + + [self parseXMLFile:externalTilesetFilename]; } else { - CCTMXTilesetInfo *tileset = [CCTMXTilesetInfo new]; tileset.name = [attributeDict objectForKey:@"name"]; - tileset.firstGid = [[attributeDict objectForKey:@"firstgid"] intValue]; + if(_currentFirstGID == 0) { + tileset.firstGid = [[attributeDict objectForKey:@"firstgid"] intValue]; + } else { + tileset.firstGid = _currentFirstGID; + _currentFirstGID = 0; + } tileset.spacing = [[attributeDict objectForKey:@"spacing"] intValue]; tileset.margin = [[attributeDict objectForKey:@"margin"] intValue]; CGSize s; s.width = [[attributeDict objectForKey:@"tilewidth"] intValue]; s.height = [[attributeDict objectForKey:@"tileheight"] intValue]; tileset.tileSize = s; + tileset.tileOffset = CGPointZero; //default offset (0,0) - [tilesets_ addObject:tileset]; - [tileset release]; + [_tilesets addObject:tileset]; } - }else if([elementName isEqualToString:@"tile"]){ - CCTMXTilesetInfo* info = [tilesets_ lastObject]; + } + else if([elementName isEqualToString:@"tileoffset"]) { + //should only be found within a tileset. Getting the parent. + CCTMXTilesetInfo *tileset = [_tilesets lastObject]; + CGPoint offset = CGPointMake([[attributeDict objectForKey:@"x"] floatValue], + [[attributeDict objectForKey:@"y"] floatValue]); + tileset.tileOffset = offset; + } + else if([elementName isEqualToString:@"tile"]) { + CCTMXTilesetInfo* info = [_tilesets lastObject]; NSMutableDictionary* dict = [NSMutableDictionary dictionaryWithCapacity:3]; - parentGID_ = [info firstGid] + [[attributeDict objectForKey:@"id"] intValue]; - [tileProperties_ setObject:dict forKey:[NSNumber numberWithInt:parentGID_]]; + _parentGID = [info firstGid] + [[attributeDict objectForKey:@"id"] intValue]; + [_tileProperties setObject:dict forKey:[NSNumber numberWithInt:_parentGID]]; - parentElement = TMXPropertyTile; + _parentElement = TMXPropertyTile; - }else if([elementName isEqualToString:@"layer"]) { + } else if([elementName isEqualToString:@"layer"]) { CCTMXLayerInfo *layer = [CCTMXLayerInfo new]; layer.name = [attributeDict objectForKey:@"name"]; @@ -293,36 +310,34 @@ -(void)parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName name int y = [[attributeDict objectForKey:@"y"] intValue]; layer.offset = ccp(x,y); - [layers_ addObject:layer]; - [layer release]; + [_layers addObject:layer]; // The parent element is now "layer" - parentElement = TMXPropertyLayer; + _parentElement = TMXPropertyLayer; } else if([elementName isEqualToString:@"objectgroup"]) { CCTMXObjectGroup *objectGroup = [[CCTMXObjectGroup alloc] init]; objectGroup.groupName = [attributeDict objectForKey:@"name"]; CGPoint positionOffset; - positionOffset.x = [[attributeDict objectForKey:@"x"] intValue] * tileSize_.width; - positionOffset.y = [[attributeDict objectForKey:@"y"] intValue] * tileSize_.height; + positionOffset.x = [[attributeDict objectForKey:@"x"] intValue] * _tileSize.width; + positionOffset.y = [[attributeDict objectForKey:@"y"] intValue] * _tileSize.height; objectGroup.positionOffset = positionOffset; - [objectGroups_ addObject:objectGroup]; - [objectGroup release]; + [_objectGroups addObject:objectGroup]; // The parent element is now "objectgroup" - parentElement = TMXPropertyObjectGroup; + _parentElement = TMXPropertyObjectGroup; } else if([elementName isEqualToString:@"image"]) { - CCTMXTilesetInfo *tileset = [tilesets_ lastObject]; + CCTMXTilesetInfo *tileset = [_tilesets lastObject]; // build full path NSString *imagename = [attributeDict objectForKey:@"source"]; - NSString *path = [filename_ stringByDeletingLastPathComponent]; + NSString *path = [_filename stringByDeletingLastPathComponent]; if (!path) - path = resources_; + path = _resources; tileset.sourceImage = [path stringByAppendingPathComponent:imagename]; } else if([elementName isEqualToString:@"data"]) { @@ -330,23 +345,23 @@ -(void)parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName name NSString *compression = [attributeDict objectForKey:@"compression"]; if( [encoding isEqualToString:@"base64"] ) { - layerAttribs |= TMXLayerAttribBase64; - storingCharacters = YES; + _layerAttribs |= TMXLayerAttribBase64; + _storingCharacters = YES; if( [compression isEqualToString:@"gzip"] ) - layerAttribs |= TMXLayerAttribGzip; + _layerAttribs |= TMXLayerAttribGzip; else if( [compression isEqualToString:@"zlib"] ) - layerAttribs |= TMXLayerAttribZlib; + _layerAttribs |= TMXLayerAttribZlib; NSAssert( !compression || [compression isEqualToString:@"gzip"] || [compression isEqualToString:@"zlib"], @"TMX: unsupported compression method" ); } - NSAssert( layerAttribs != TMXLayerAttribNone, @"TMX tile map: Only base64 and/or gzip/zlib maps are supported" ); + NSAssert( _layerAttribs != TMXLayerAttribNone, @"TMX tile map: Only base64 and/or gzip/zlib maps are supported" ); } else if([elementName isEqualToString:@"object"]) { - CCTMXObjectGroup *objectGroup = [objectGroups_ lastObject]; + CCTMXObjectGroup *objectGroup = [_objectGroups lastObject]; // The value for "type" was blank or not a valid class name // Create an instance of TMXObjectInfo to store the object and its properties @@ -374,46 +389,45 @@ -(void)parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName name int y = [value intValue] + objectGroup.positionOffset.y; // Correct y position. (Tiled uses Flipped, cocos2d uses Standard) - y = (mapSize_.height * tileSize_.height) - y - [[attributeDict objectForKey:@"height"] intValue]; + y = (_mapSize.height * _tileSize.height) - y - [[attributeDict objectForKey:@"height"] intValue]; [dict setObject:[NSNumber numberWithInt:y] forKey:@"y"]; } // Add the object to the objectGroup [[objectGroup objects] addObject:dict]; - [dict release]; // The parent element is now "object" - parentElement = TMXPropertyObject; + _parentElement = TMXPropertyObject; } else if([elementName isEqualToString:@"property"]) { - if ( parentElement == TMXPropertyNone ) { + if ( _parentElement == TMXPropertyNone ) { CCLOG( @"TMX tile map: Parent element is unsupported. Cannot add property named '%@' with value '%@'", [attributeDict objectForKey:@"name"], [attributeDict objectForKey:@"value"] ); - } else if ( parentElement == TMXPropertyMap ) { + } else if ( _parentElement == TMXPropertyMap ) { // The parent element is the map - [properties_ setObject:[attributeDict objectForKey:@"value"] forKey:[attributeDict objectForKey:@"name"]]; + [_properties setObject:[attributeDict objectForKey:@"value"] forKey:[attributeDict objectForKey:@"name"]]; - } else if ( parentElement == TMXPropertyLayer ) { + } else if ( _parentElement == TMXPropertyLayer ) { // The parent element is the last layer - CCTMXLayerInfo *layer = [layers_ lastObject]; + CCTMXLayerInfo *layer = [_layers lastObject]; // Add the property to the layer [[layer properties] setObject:[attributeDict objectForKey:@"value"] forKey:[attributeDict objectForKey:@"name"]]; - } else if ( parentElement == TMXPropertyObjectGroup ) { + } else if ( _parentElement == TMXPropertyObjectGroup ) { // The parent element is the last object group - CCTMXObjectGroup *objectGroup = [objectGroups_ lastObject]; + CCTMXObjectGroup *objectGroup = [_objectGroups lastObject]; [[objectGroup properties] setObject:[attributeDict objectForKey:@"value"] forKey:[attributeDict objectForKey:@"name"]]; - } else if ( parentElement == TMXPropertyObject ) { + } else if ( _parentElement == TMXPropertyObject ) { // The parent element is the last object - CCTMXObjectGroup *objectGroup = [objectGroups_ lastObject]; + CCTMXObjectGroup *objectGroup = [_objectGroups lastObject]; NSMutableDictionary *dict = [[objectGroup objects] lastObject]; NSString *propertyName = [attributeDict objectForKey:@"name"]; @@ -421,9 +435,9 @@ -(void)parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName name [dict setObject:propertyValue forKey:propertyName]; - } else if ( parentElement == TMXPropertyTile ) { + } else if ( _parentElement == TMXPropertyTile ) { - NSMutableDictionary* dict = [tileProperties_ objectForKey:[NSNumber numberWithInt:parentGID_]]; + NSMutableDictionary* dict = [_tileProperties objectForKey:[NSNumber numberWithInt:_parentGID]]; NSString *propertyName = [attributeDict objectForKey:@"name"]; NSString *propertyValue = [attributeDict objectForKey:@"value"]; [dict setObject:propertyValue forKey:propertyName]; @@ -432,14 +446,14 @@ -(void)parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName name } else if ([elementName isEqualToString:@"polygon"]) { // find parent object's dict and add polygon-points to it - CCTMXObjectGroup *objectGroup = [objectGroups_ lastObject]; + CCTMXObjectGroup *objectGroup = [_objectGroups lastObject]; NSMutableDictionary *dict = [[objectGroup objects] lastObject]; [dict setObject:[attributeDict objectForKey:@"points"] forKey:@"polygonPoints"]; } else if ([elementName isEqualToString:@"polyline"]) { // find parent object's dict and add polyline-points to it - CCTMXObjectGroup *objectGroup = [objectGroups_ lastObject]; + CCTMXObjectGroup *objectGroup = [_objectGroups lastObject]; NSMutableDictionary *dict = [[objectGroup objects] lastObject]; [dict setObject:[attributeDict objectForKey:@"points"] forKey:@"polylinePoints"]; } @@ -449,19 +463,21 @@ - (void)parser:(NSXMLParser *)parser didEndElement:(NSString *)elementName names { int len = 0; - if([elementName isEqualToString:@"data"] && layerAttribs&TMXLayerAttribBase64) { - storingCharacters = NO; + if([elementName isEqualToString:@"data"] && _layerAttribs&TMXLayerAttribBase64) { + _storingCharacters = NO; - CCTMXLayerInfo *layer = [layers_ lastObject]; + CCTMXLayerInfo *layer = [_layers lastObject]; unsigned char *buffer; - len = base64Decode((unsigned char*)[currentString UTF8String], (unsigned int) [currentString length], &buffer); + len = base64Decode((unsigned char*)[_currentString UTF8String], (unsigned int) [_currentString length], &buffer); if( ! buffer ) { CCLOG(@"cocos2d: TiledMap: decode data error"); return; } - if( layerAttribs & (TMXLayerAttribGzip | TMXLayerAttribZlib) ) { +#pragma clang diagnostic push COCOS2D +#pragma clang diagnostic ignored "-Wcast-align" + if( _layerAttribs & (TMXLayerAttribGzip | TMXLayerAttribZlib) ) { unsigned char *deflated; CGSize s = [layer layerSize]; int sizeHint = s.width * s.height * sizeof(uint32_t); @@ -480,32 +496,35 @@ - (void)parser:(NSXMLParser *)parser didEndElement:(NSString *)elementName names layer.tiles = (unsigned int*) deflated; } else + { layer.tiles = (unsigned int*) buffer; - - [currentString setString:@""]; + } +#pragma clang diagnostic pop COCOS2D + + [_currentString setString:@""]; } else if ([elementName isEqualToString:@"map"]) { // The map element has ended - parentElement = TMXPropertyNone; + _parentElement = TMXPropertyNone; } else if ([elementName isEqualToString:@"layer"]) { // The layer element has ended - parentElement = TMXPropertyNone; + _parentElement = TMXPropertyNone; } else if ([elementName isEqualToString:@"objectgroup"]) { // The objectgroup element has ended - parentElement = TMXPropertyNone; + _parentElement = TMXPropertyNone; } else if ([elementName isEqualToString:@"object"]) { // The object element has ended - parentElement = TMXPropertyNone; + _parentElement = TMXPropertyNone; } } - (void)parser:(NSXMLParser *)parser foundCharacters:(NSString *)string { - if (storingCharacters) - [currentString appendString:string]; + if (_storingCharacters) + [_currentString appendString:string]; } diff --git a/cocos2d/CCTexture2D.h b/cocos2d/CCTexture2D.h new file mode 100644 index 0000000..c1d29f5 --- /dev/null +++ b/cocos2d/CCTexture2D.h @@ -0,0 +1,341 @@ +/* + +===== IMPORTANT ===== + +This is sample code demonstrating API, technology or techniques in development. +Although this sample code has been reviewed for technical accuracy, it is not +final. Apple is supplying this information to help you plan for the adoption of +the technologies and programming interfaces described herein. This information +is subject to change, and software implemented based on this sample code should +be tested with final operating system software and final documentation. Newer +versions of this sample code may be provided with future seeds of the API or +technology. For information about updates to this and other developer +documentation, view the New & Updated sidebars in subsequent documentation +seeds. + +===================== + +File: Texture2D.h +Abstract: Creates OpenGL 2D textures from images or text. + +Version: 1.6 + +Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple Inc. +("Apple") in consideration of your agreement to the following terms, and your +use, installation, modification or redistribution of this Apple software +constitutes acceptance of these terms. If you do not agree with these terms, +please do not use, install, modify or redistribute this Apple software. + +In consideration of your agreement to abide by the following terms, and subject +to these terms, Apple grants you a personal, non-exclusive license, under +Apple's copyrights in this original Apple software (the "Apple Software"), to +use, reproduce, modify and redistribute the Apple Software, with or without +modifications, in source and/or binary forms; provided that if you redistribute +the Apple Software in its entirety and without modifications, you must retain +this notice and the following text and disclaimers in all such redistributions +of the Apple Software. +Neither the name, trademarks, service marks or logos of Apple Inc. may be used +to endorse or promote products derived from the Apple Software without specific +prior written permission from Apple. Except as expressly stated in this notice, +no other rights or licenses, express or implied, are granted by Apple herein, +including but not limited to any patent rights that may be infringed by your +derivative works or by other works in which the Apple Software may be +incorporated. + +The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES NO +WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED +WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION ALONE OR IN +COMBINATION WITH YOUR PRODUCTS. + +IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE +GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR +DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF +CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF +APPLE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Copyright (C) 2008 Apple Inc. All Rights Reserved. + +*/ + +#import // for NSObject + +#import "ccTypes.h" +#import "ccMacros.h" + +#import "Platforms/CCGL.h" // OpenGL stuff +#import "Platforms/CCNS.h" // Next-Step stuff + +@class CCSpriteFrame; + +//CONSTANTS: + +/** @typedef CCTexture2DPixelFormat + Possible texture pixel formats + */ +typedef enum { + //! 32-bit texture: RGBA8888 + kCCTexture2DPixelFormat_RGBA8888, + //! 32-bit texture without Alpha channel. Don't use it. + kCCTexture2DPixelFormat_RGB888, + //! 16-bit texture without Alpha channel + kCCTexture2DPixelFormat_RGB565, + //! 8-bit textures used as masks + kCCTexture2DPixelFormat_A8, + //! 8-bit intensity texture + kCCTexture2DPixelFormat_I8, + //! 16-bit textures used as masks + kCCTexture2DPixelFormat_AI88, + //! 16-bit textures: RGBA4444 + kCCTexture2DPixelFormat_RGBA4444, + //! 16-bit textures: RGB5A1 + kCCTexture2DPixelFormat_RGB5A1, + //! 4-bit PVRTC-compressed texture: PVRTC4 + kCCTexture2DPixelFormat_PVRTC4, + //! 2-bit PVRTC-compressed texture: PVRTC2 + kCCTexture2DPixelFormat_PVRTC2, + + //! Default texture format: RGBA8888 + kCCTexture2DPixelFormat_Default = kCCTexture2DPixelFormat_RGBA8888, + +} CCTexture2DPixelFormat; + + +@class CCGLProgram; + +/** CCTexture2D class. + * This class allows to easily create OpenGL 2D textures from images, text or raw data. + * The created CCTexture2D object will always have power-of-two dimensions. + * Depending on how you create the CCTexture2D object, the actual image area of the texture might be smaller than the texture dimensions i.e. "contentSize" != (pixelsWide, pixelsHigh) and (maxS, maxT) != (1.0, 1.0). + * Be aware that the content of the generated textures will be upside-down! + */ +@interface CCTexture2D : NSObject +{ + GLuint _name; + CGSize _size; + NSUInteger _width, + _height; + CCTexture2DPixelFormat _format; + GLfloat _maxS, + _maxT; + BOOL _hasPremultipliedAlpha; + BOOL _hasMipmaps; + + ccResolutionType _resolutionType; + + // needed for drawAtRect, drawInPoint + CCGLProgram *_shaderProgram; + +} +/** Initializes with a texture2d with data */ +- (id) initWithData:(const void*)data pixelFormat:(CCTexture2DPixelFormat)pixelFormat pixelsWide:(NSUInteger)width pixelsHigh:(NSUInteger)height contentSize:(CGSize)size; + +/** These functions are needed to create mutable textures */ +- (void) releaseData:(void*)data; +- (void*) keepData:(void*)data length:(NSUInteger)length; + +/** pixel format of the texture */ +@property(nonatomic,readonly) CCTexture2DPixelFormat pixelFormat; +/** width in pixels */ +@property(nonatomic,readonly) NSUInteger pixelsWide; +/** hight in pixels */ +@property(nonatomic,readonly) NSUInteger pixelsHigh; + +/** texture name */ +@property(nonatomic,readonly) GLuint name; + +/** returns content size of the texture in pixels */ +@property(nonatomic,readonly, nonatomic) CGSize contentSizeInPixels; + +/** texture max S */ +@property(nonatomic,readwrite) GLfloat maxS; +/** texture max T */ +@property(nonatomic,readwrite) GLfloat maxT; +/** whether or not the texture has their Alpha premultiplied */ +@property(nonatomic,readonly) BOOL hasPremultipliedAlpha; + +/** shader program used by drawAtPoint and drawInRect */ +@property(nonatomic,readwrite,strong) CCGLProgram *shaderProgram; + +/** Returns the resolution type of the texture. + Is it a RetinaDisplay texture, an iPad texture, a Mac, a Mac RetinaDisplay or an standard texture ? + + Should be a readonly property. It is readwrite as a hack. + + @since v1.1 + */ +@property (nonatomic, readwrite) ccResolutionType resolutionType; + + +/** returns the content size of the texture in points */ +-(CGSize) contentSize; + + +/** + * Creates a sprite frame from the texture. + * + * @return A new sprite frame. + * @since v2.5 + */ +-(CCSpriteFrame*) createSpriteFrame; + + +@end + +/** +Drawing extensions to make it easy to draw basic quads using a CCTexture2D object. +These functions require GL_TEXTURE_2D and both GL_VERTEX_ARRAY and GL_TEXTURE_COORD_ARRAY client states to be enabled. +*/ +@interface CCTexture2D (Drawing) +/** draws a texture at a given point */ +- (void) drawAtPoint:(CGPoint)point; +/** draws a texture inside a rect */ +- (void) drawInRect:(CGRect)rect; +@end + +/** +Extensions to make it easy to create a CCTexture2D object from an image file. +Note that RGBA type textures will have their alpha premultiplied - use the blending mode (GL_ONE, GL_ONE_MINUS_SRC_ALPHA). +*/ +@interface CCTexture2D (Image) +/** Initializes a texture from a CGImage object */ +- (id) initWithCGImage:(CGImageRef)cgImage resolutionType:(ccResolutionType)resolution; +@end + +/** + 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 (PVRSupport) +/** 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 + + By default PVR images are treated as if they alpha channel is NOT premultiplied. You can override this behavior with this class method: + - PVRImagesHavePremultipliedAlpha:(BOOL)haveAlphaPremultiplied; + + IMPORTANT: This method is only defined on iOS. It is not supported on the Mac version. + + */ +-(id) initWithPVRFile: (NSString*) file; + +/** treats (or not) PVR files as if they have alpha premultiplied. + Since it is impossible to know at runtime if the PVR images have the alpha channel premultiplied, it is + possible load them as if they have (or not) the alpha channel premultiplied. + + By default it is disabled. + + @since v0.99.5 + */ ++(void) PVRImagesHavePremultipliedAlpha:(BOOL)haveAlphaPremultiplied; +@end + +/** + Extension to set the Min / Mag filter + */ +typedef struct _ccTexParams { + GLuint minFilter; + GLuint magFilter; + GLuint wrapS; + GLuint wrapT; +} ccTexParams; + +@interface CCTexture2D (GLFilter) +/** sets the min filter, mag filter, wrap s and wrap t texture parameters. + If the texture size is NPOT (non power of 2), then in can only use GL_CLAMP_TO_EDGE in GL_TEXTURE_WRAP_{S,T}. + + @warning Calling this method could allocate additional texture memory. + + @since v0.8 + */ +-(void) setTexParameters: (ccTexParams*) texParams; + +/** sets antialias texture parameters: + - GL_TEXTURE_MIN_FILTER = GL_LINEAR + - GL_TEXTURE_MAG_FILTER = GL_LINEAR + + @warning Calling this method could allocate additional texture memory. + + @since v0.8 + */ +- (void) setAntiAliasTexParameters; + +/** sets alias texture parameters: + - GL_TEXTURE_MIN_FILTER = GL_NEAREST + - GL_TEXTURE_MAG_FILTER = GL_NEAREST + + @warning Calling this method could allocate additional texture memory. + + @since v0.8 + */ +- (void) setAliasTexParameters; + + +/** Generates mipmap images for the texture. + It only works if the texture size is POT (power of 2). + @since v0.99.0 + */ +-(void) generateMipmap; + + +@end + +@interface CCTexture2D (PixelFormat) +/** sets the default pixel format for CGImages that contains alpha channel. + If the CGImage contains alpha channel, then the options are: + - generate 32-bit textures: kCCTexture2DPixelFormat_RGBA8888 (default one) + - generate 16-bit textures: kCCTexture2DPixelFormat_RGBA4444 + - generate 16-bit textures: kCCTexture2DPixelFormat_RGB5A1 + - generate 24-bit textures: kCCTexture2DPixelFormat_RGB888 (no alpha) + - generate 16-bit textures: kCCTexture2DPixelFormat_RGB565 (no alpha) + - generate 8-bit textures: kCCTexture2DPixelFormat_A8 (only use it if you use just 1 color) + + How does it work ? + - If the image is an RGBA (with Alpha) then the default pixel format will be used (it can be a 8-bit, 16-bit or 32-bit texture) + - If the image is an RGB (without Alpha) then: If the default pixel format is RGBA8888 then a RGBA8888 (32-bit) will be used. Otherwise a RGB565 (16-bit texture) will be used. + + This parameter is not valid for PVR / PVR.CCZ images. + + @since v0.8 + */ ++(void) setDefaultAlphaPixelFormat:(CCTexture2DPixelFormat)format; + +/** returns the alpha pixel format + @since v0.8 + */ ++(CCTexture2DPixelFormat) defaultAlphaPixelFormat; + +/** returns the bits-per-pixel of the in-memory OpenGL texture + @since v1.0 + */ +-(NSUInteger) bitsPerPixelForFormat; + +/** returns the pixel format in a NSString. + @since v2.0 + */ +-(NSString*) stringForFormat; + + +/** Helper functions that returns bits per pixels for a given format. + @since v2.0 + */ ++(NSUInteger) bitsPerPixelForFormat:(CCTexture2DPixelFormat)format; + +@end + + + + + diff --git a/src/cocos2d/CCTexture2D.m b/cocos2d/CCTexture2D.m similarity index 58% rename from src/cocos2d/CCTexture2D.m rename to cocos2d/CCTexture2D.m index ad9c4fd..89db932 100644 --- a/src/cocos2d/CCTexture2D.m +++ b/cocos2d/CCTexture2D.m @@ -88,32 +88,22 @@ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE #import "ccDeprecated.h" - -#if CC_USE_LA88_LABELS -#define LABEL_PIXEL_FORMAT kCCTexture2DPixelFormat_AI88 -#else -#define LABEL_PIXEL_FORMAT kCCTexture2DPixelFormat_A8 -#endif - //CLASS IMPLEMENTATIONS: // If the image has alpha, you can create RGBA8 (32-bit) or RGBA4 (16-bit) or RGB5A1 (16-bit) // Default is: RGBA8888 (32-bit textures) -static CCTexture2DPixelFormat defaultAlphaPixelFormat_ = kCCTexture2DPixelFormat_Default; +static CCTexture2DPixelFormat defaultAlphaPixel_format = kCCTexture2DPixelFormat_Default; #pragma mark - #pragma mark CCTexture2D - Main @implementation CCTexture2D -@synthesize contentSizeInPixels = size_, pixelFormat = format_, pixelsWide = width_, pixelsHigh = height_, name = name_, maxS = maxS_, maxT = maxT_; -@synthesize hasPremultipliedAlpha = hasPremultipliedAlpha_; -@synthesize shaderProgram = shaderProgram_; - -#ifdef __CC_PLATFORM_IOS -@synthesize resolutionType = resolutionType_; -#endif +@synthesize contentSizeInPixels = _size, pixelFormat = _format, pixelsWide = _width, pixelsHigh = _height, name = _name, maxS = _maxS, maxT = _maxT; +@synthesize hasPremultipliedAlpha = _hasPremultipliedAlpha; +@synthesize shaderProgram = _shaderProgram; +@synthesize resolutionType = _resolutionType; - (id) initWithData:(const void*)data pixelFormat:(CCTexture2DPixelFormat)pixelFormat pixelsWide:(NSUInteger)width pixelsHigh:(NSUInteger)height contentSize:(CGSize)size @@ -127,8 +117,8 @@ - (id) initWithData:(const void*)data pixelFormat:(CCTexture2DPixelFormat)pixelF else glPixelStorei(GL_UNPACK_ALIGNMENT,1); - glGenTextures(1, &name_); - ccGLBindTexture2D( name_ ); + glGenTextures(1, &_name); + ccGLBindTexture2D( _name ); glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR ); glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR ); @@ -160,25 +150,25 @@ - (id) initWithData:(const void*)data pixelFormat:(CCTexture2DPixelFormat)pixelF case kCCTexture2DPixelFormat_A8: glTexImage2D(GL_TEXTURE_2D, 0, GL_ALPHA, (GLsizei) width, (GLsizei) height, 0, GL_ALPHA, GL_UNSIGNED_BYTE, data); break; - default: - [NSException raise:NSInternalInconsistencyException format:@""]; + case kCCTexture2DPixelFormat_PVRTC4: + case kCCTexture2DPixelFormat_PVRTC2: + case kCCTexture2DPixelFormat_I8: + [NSException raise:NSInternalInconsistencyException format:@""]; } - size_ = size; - width_ = width; - height_ = height; - format_ = pixelFormat; - maxS_ = size.width / (float)width; - maxT_ = size.height / (float)height; + _size = size; + _width = width; + _height = height; + _format = pixelFormat; + _maxS = size.width / (float)width; + _maxT = size.height / (float)height; - hasPremultipliedAlpha_ = NO; + _hasPremultipliedAlpha = NO; - hasMipmaps_ = NO; + _hasMipmaps = NO; -#ifdef __CC_PLATFORM_IOS - resolutionType_ = kCCResolutionUnknown; -#endif + _resolutionType = kCCResolutionUnknown; self.shaderProgram = [[CCShaderCache sharedShaderCache] programForKey:kCCShader_PositionTexture]; } return self; @@ -200,28 +190,32 @@ - (void) dealloc { CCLOGINFO(@"cocos2d: deallocing %@", self); - [shaderProgram_ release]; - if( name_ ) - ccGLDeleteTexture( name_ ); + if( _name ) + ccGLDeleteTexture( _name ); - [super dealloc]; } - (NSString*) description { - return [NSString stringWithFormat:@"<%@ = %p | Name = %i | Dimensions = %lux%lu | Pixel format = %@ | Coordinates = (%.2f, %.2f)>", [self class], self, name_, (unsigned long)width_, (unsigned long)height_, [self stringForFormat], maxS_, maxT_]; + return [NSString stringWithFormat:@"<%@ = %p | Name = %i | Dimensions = %lux%lu | Pixel format = %@ | Coordinates = (%.2f, %.2f)>", [self class], self, _name, (unsigned long)_width, (unsigned long)_height, [self stringForFormat], _maxS, _maxT]; } -(CGSize) contentSize { CGSize ret; - ret.width = size_.width / CC_CONTENT_SCALE_FACTOR(); - ret.height = size_.height / CC_CONTENT_SCALE_FACTOR(); + ret.width = _size.width / CC_CONTENT_SCALE_FACTOR(); + ret.height = _size.height / CC_CONTENT_SCALE_FACTOR(); return ret; } +-(CCSpriteFrame*) createSpriteFrame +{ + CGRect bounds = CGRectMake(0, 0, self.contentSize.width, self.contentSize.height); + return [CCSpriteFrame frameWithTexture:self rect:bounds]; +} + @end #pragma mark - @@ -229,11 +223,7 @@ -(CGSize) contentSize @implementation CCTexture2D (Image) -#ifdef __CC_PLATFORM_IOS - (id) initWithCGImage:(CGImageRef)cgImage resolutionType:(ccResolutionType)resolution -#elif defined(__CC_PLATFORM_MAC) -- (id) initWithCGImage:(CGImageRef)cgImage -#endif { NSUInteger textureWidth, textureHeight; CGContextRef context = nil; @@ -249,7 +239,6 @@ - (id) initWithCGImage:(CGImageRef)cgImage if(cgImage == NULL) { CCLOG(@"cocos2d: CCTexture2D. Can't create Texture. cgImage is nil"); - [self release]; return nil; } @@ -272,7 +261,7 @@ - (id) initWithCGImage:(CGImageRef)cgImage if(colorSpace) { if( hasAlpha ) { - pixelFormat = defaultAlphaPixelFormat_; + pixelFormat = defaultAlphaPixel_format; info = kCGImageAlphaPremultipliedLast; } else @@ -281,13 +270,13 @@ - (id) initWithCGImage:(CGImageRef)cgImage // Use RGBA8888 if default is RGBA8888, otherwise use RGB565. // DO NOT USE RGB888 since it is the same as RGBA8888, but it is more expensive to create it - if( defaultAlphaPixelFormat_ == kCCTexture2DPixelFormat_RGBA8888 ) + if( defaultAlphaPixel_format == kCCTexture2DPixelFormat_RGBA8888 ) pixelFormat = kCCTexture2DPixelFormat_RGBA8888; else + { pixelFormat = kCCTexture2DPixelFormat_RGB565; - - CCLOG(@"cocos2d: CCTexture2D: Using RGB565 texture since image has no alpha"); - + CCLOG(@"cocos2d: CCTexture2D: Using RGB565 texture since image has no alpha"); + } } } else { // NOTE: No colorspace means a mask image @@ -324,11 +313,11 @@ - (id) initWithCGImage:(CGImageRef)cgImage if( mod != 0 ) { NSUInteger neededBytes = (4 - mod ) / (bpp/8); - + CCLOGWARN(@"cocos2d: WARNING converting size=(%d,%d) to size=(%d,%d) due to iOS 5.x memory BUG. See: http://www.cocos2d-iphone.org/forum/topic/31092", textureWidth, textureHeight, textureWidth + neededBytes, textureHeight ); textureWidth = textureWidth + neededBytes; } - } + } #endif // IOS NSUInteger maxTextureSize = [conf maxTextureSize]; @@ -336,7 +325,6 @@ - (id) initWithCGImage:(CGImageRef)cgImage CCLOGWARN(@"cocos2d: WARNING: Image (%lu x %lu) is bigger than the supported %ld x %ld", (long)textureWidth, (long)textureHeight, (long)maxTextureSize, (long)maxTextureSize); - [self release]; return nil; } @@ -360,10 +348,14 @@ - (id) initWithCGImage:(CGImageRef)cgImage case kCCTexture2DPixelFormat_A8: data = malloc(textureHeight * textureWidth); info = kCGImageAlphaOnly; - context = CGBitmapContextCreate(data, textureWidth, textureHeight, 8, textureWidth, NULL, info); + context = CGBitmapContextCreate(data, textureWidth, textureHeight, 8, textureWidth, NULL, (CGBitmapInfo)info); break; - default: + case kCCTexture2DPixelFormat_AI88: + case kCCTexture2DPixelFormat_I8: + case kCCTexture2DPixelFormat_PVRTC2: + case kCCTexture2DPixelFormat_PVRTC4: [NSException raise:NSInternalInconsistencyException format:@"Invalid pixel format"]; + break; } @@ -449,320 +441,59 @@ We need to check new alpha value first (it may be 1 or 0) and depending on it wh self = [self initWithData:data pixelFormat:pixelFormat pixelsWide:textureWidth pixelsHigh:textureHeight contentSize:imageSize]; // should be after calling super init - hasPremultipliedAlpha_ = (info == kCGImageAlphaPremultipliedLast || info == kCGImageAlphaPremultipliedFirst); + _hasPremultipliedAlpha = (info == kCGImageAlphaPremultipliedLast || info == kCGImageAlphaPremultipliedFirst); CGContextRelease(context); [self releaseData:data]; -#ifdef __CC_PLATFORM_IOS - resolutionType_ = resolution; -#endif + _resolutionType = resolution; return self; } @end -#pragma mark - -#pragma mark CCTexture2D - Text - -@implementation CCTexture2D (Text) - -#ifdef __CC_PLATFORM_IOS - -- (id) initWithString:(NSString*)string dimensions:(CGSize)dimensions hAlignment:(CCTextAlignment)hAlignment vAlignment:(CCVerticalTextAlignment) vAlignment lineBreakMode:(CCLineBreakMode)lineBreakMode font:(UIFont*)uifont -{ - NSAssert( uifont, @"Invalid font"); - - // MUST have the same order declared on ccTypes - NSInteger linebreaks[] = {UILineBreakModeWordWrap, UILineBreakModeCharacterWrap, UILineBreakModeClip, UILineBreakModeHeadTruncation, UILineBreakModeTailTruncation, UILineBreakModeMiddleTruncation}; - - NSUInteger textureWidth = ccNextPOT(dimensions.width); - NSUInteger textureHeight = ccNextPOT(dimensions.height); - unsigned char* data; - - CGContextRef context; - CGColorSpaceRef colorSpace; - -#if CC_USE_LA88_LABELS - data = calloc(textureHeight, textureWidth * 2); -#else - data = calloc(textureHeight, textureWidth); -#endif - - colorSpace = CGColorSpaceCreateDeviceGray(); - context = CGBitmapContextCreate(data, textureWidth, textureHeight, 8, textureWidth, colorSpace, kCGImageAlphaNone); - CGColorSpaceRelease(colorSpace); - - if( ! context ) { - free(data); - [self release]; - return nil; - } - - CGContextSetGrayFillColor(context, 1.0f, 1.0f); - CGContextTranslateCTM(context, 0.0f, textureHeight); - CGContextScaleCTM(context, 1.0f, -1.0f); //NOTE: NSString draws in UIKit referential i.e. renders upside-down compared to CGBitmapContext referential - - UIGraphicsPushContext(context); - - CGRect drawArea; - if(vAlignment == kCCVerticalTextAlignmentTop) - { - drawArea = CGRectMake(0, 0, dimensions.width, dimensions.height); - } - else - { - CGSize drawSize = [string sizeWithFont:uifont constrainedToSize:dimensions lineBreakMode:linebreaks[lineBreakMode] ]; - - if(vAlignment == kCCVerticalTextAlignmentBottom) - { - drawArea = CGRectMake(0, dimensions.height - drawSize.height, dimensions.width, drawSize.height); - } - else // kCCVerticalTextAlignmentCenter - { - drawArea = CGRectMake(0, (dimensions.height - drawSize.height) / 2, dimensions.width, drawSize.height); - } - } - - // must follow the same order of CCTextureAligment - NSUInteger alignments[] = { UITextAlignmentLeft, UITextAlignmentCenter, UITextAlignmentRight }; - - [string drawInRect:drawArea withFont:uifont lineBreakMode:linebreaks[lineBreakMode] alignment:alignments[hAlignment]]; - - UIGraphicsPopContext(); - -#if CC_USE_LA88_LABELS - NSUInteger textureSize = textureWidth*textureHeight; - unsigned short *la88_data = (unsigned short*)data; - for(int i = textureSize-1; i>=0; i--) //Convert A8 to AI88 - la88_data[i] = (data[i] << 8) | 0xff; - -#endif - - self = [self initWithData:data pixelFormat:LABEL_PIXEL_FORMAT pixelsWide:textureWidth pixelsHigh:textureHeight contentSize:dimensions]; - - CGContextRelease(context); - [self releaseData:data]; - - return self; -} - - -#elif defined(__CC_PLATFORM_MAC) - -- (id) initWithString:(NSString*)string dimensions:(CGSize)dimensions hAlignment:(CCTextAlignment)hAlignment vAlignment:(CCVerticalTextAlignment)vAlignment attributedString:(NSAttributedString*)stringWithAttributes -{ - NSAssert(stringWithAttributes, @"Invalid stringWithAttributes"); - - // get nearest power of two - NSSize POTSize = NSMakeSize(ccNextPOT(dimensions.width), ccNextPOT(dimensions.height)); - - // Get actual rendered dimensions - NSRect boundingRect = [stringWithAttributes boundingRectWithSize:NSSizeFromCGSize(dimensions) options:NSStringDrawingUsesLineFragmentOrigin]; - - // Mac crashes if the width or height is 0 - if( boundingRect.size.width > 0 && boundingRect.size.height > 0 ) { - - CGSize offset = CGSizeMake(0, POTSize.height - dimensions.height); - - //Alignment - switch (hAlignment) { - case kCCTextAlignmentLeft: break; - case kCCTextAlignmentCenter: offset.width = (dimensions.width-boundingRect.size.width)/2.0f; break; - case kCCTextAlignmentRight: offset.width = dimensions.width-boundingRect.size.width; break; - default: break; - } - switch (vAlignment) { - case kCCVerticalTextAlignmentTop: offset.height += dimensions.height - boundingRect.size.height; break; - case kCCVerticalTextAlignmentCenter: offset.height += (dimensions.height - boundingRect.size.height) / 2; break; - case kCCVerticalTextAlignmentBottom: break; - default: break; - } - - CGRect drawArea = CGRectMake(offset.width, offset.height, boundingRect.size.width, boundingRect.size.height); - - //Disable antialias - [[NSGraphicsContext currentContext] setShouldAntialias:NO]; - - NSImage *image = [[NSImage alloc] initWithSize:POTSize]; - [image lockFocus]; - - [stringWithAttributes drawWithRect:NSRectFromCGRect(drawArea) options:NSStringDrawingUsesLineFragmentOrigin]; - - NSBitmapImageRep *bitmap = [[NSBitmapImageRep alloc] initWithFocusedViewRect:NSMakeRect (0.0f, 0.0f, POTSize.width, POTSize.height)]; - [image unlockFocus]; - - unsigned char *data = (unsigned char*) [bitmap bitmapData]; //Use the same buffer to improve the performance. - - NSUInteger textureSize = POTSize.width * POTSize.height; -#if CC_USE_LA88_LABELS - unsigned short *dst = (unsigned short*)data; - for(int i = 0; i 1 ); - [pvr release]; + _hasMipmaps = ( pvr.numberOfMipmaps > 1 ); } else { CCLOG(@"cocos2d: Couldn't load PVR image: %@", relPath); - [self release]; return nil; } -#ifdef __CC_PLATFORM_IOS - resolutionType_ = resolution; -#endif + _resolutionType = resolution; } return self; } +(void) PVRImagesHavePremultipliedAlpha:(BOOL)haveAlphaPremultiplied { - PVRHaveAlphaPremultiplied_ = haveAlphaPremultiplied; + _PVRHaveAlphaPremultiplied = haveAlphaPremultiplied; } @end @@ -773,12 +504,12 @@ @implementation CCTexture2D (Drawing) - (void) drawAtPoint:(CGPoint)point { - GLfloat coordinates[] = { 0.0f, maxT_, - maxS_, maxT_, + GLfloat coordinates[] = { 0.0f, _maxT, + _maxS, _maxT, 0.0f, 0.0f, - maxS_, 0.0f }; - GLfloat width = (GLfloat)width_ * maxS_, - height = (GLfloat)height_ * maxT_; + _maxS, 0.0f }; + GLfloat width = (GLfloat)_width * _maxS, + height = (GLfloat)_height * _maxT; GLfloat vertices[] = { point.x, point.y, width + point.x, point.y, @@ -786,10 +517,10 @@ - (void) drawAtPoint:(CGPoint)point width + point.x, height + point.y }; ccGLEnableVertexAttribs( kCCVertexAttribFlag_Position | kCCVertexAttribFlag_TexCoords ); - [shaderProgram_ use]; - [shaderProgram_ setUniformForModelViewProjectionMatrix]; + [_shaderProgram use]; + [_shaderProgram setUniformsForBuiltins]; - ccGLBindTexture2D( name_ ); + ccGLBindTexture2D( _name ); glVertexAttribPointer(kCCVertexAttrib_Position, 2, GL_FLOAT, GL_FALSE, 0, vertices); @@ -804,22 +535,22 @@ - (void) drawAtPoint:(CGPoint)point - (void) drawInRect:(CGRect)rect { - GLfloat coordinates[] = { 0.0f, maxT_, - maxS_, maxT_, + GLfloat coordinates[] = { 0.0f, _maxT, + _maxS, _maxT, 0.0f, 0.0f, - maxS_, 0.0f }; + _maxS, 0.0f }; GLfloat vertices[] = { rect.origin.x, rect.origin.y, rect.origin.x + rect.size.width, rect.origin.y, rect.origin.x, rect.origin.y + rect.size.height, rect.origin.x + rect.size.width, rect.origin.y + rect.size.height }; - [shaderProgram_ use]; - [shaderProgram_ setUniformForModelViewProjectionMatrix]; + [_shaderProgram use]; + [_shaderProgram setUniformsForBuiltins]; ccGLEnableVertexAttribs( kCCVertexAttribFlag_Position | kCCVertexAttribFlag_TexCoords ); - ccGLBindTexture2D( name_ ); + ccGLBindTexture2D( _name ); glVertexAttribPointer(kCCVertexAttrib_Position, 2, GL_FLOAT, GL_FALSE, 0, vertices); glVertexAttribPointer(kCCVertexAttrib_TexCoords, 2, GL_FLOAT, GL_FALSE, 0, coordinates); @@ -843,19 +574,19 @@ @implementation CCTexture2D (GLFilter) -(void) generateMipmap { - NSAssert( width_ == ccNextPOT(width_) && height_ == ccNextPOT(height_), @"Mimpap texture only works in POT textures"); - ccGLBindTexture2D( name_ ); + NSAssert( _width == ccNextPOT(_width) && _height == ccNextPOT(_height), @"Mimpap texture only works in POT textures"); + ccGLBindTexture2D( _name ); glGenerateMipmap(GL_TEXTURE_2D); - hasMipmaps_ = YES; + _hasMipmaps = YES; } -(void) setTexParameters: (ccTexParams*) texParams { - NSAssert( (width_ == ccNextPOT(width_) || texParams->wrapS == GL_CLAMP_TO_EDGE) && - (height_ == ccNextPOT(height_) || texParams->wrapT == GL_CLAMP_TO_EDGE), - @"GL_CLAMP_TO_EDGE should be used in NPOT dimensions"); + NSAssert( (_width == ccNextPOT(_width) && _height == ccNextPOT(_height)) || + (texParams->wrapS == GL_CLAMP_TO_EDGE && texParams->wrapT == GL_CLAMP_TO_EDGE), + @"GL_CLAMP_TO_EDGE should be used in NPOT dimensions"); - ccGLBindTexture2D( name_ ); + ccGLBindTexture2D( _name ); glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, texParams->minFilter ); glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, texParams->magFilter ); glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, texParams->wrapS ); @@ -864,9 +595,9 @@ -(void) setTexParameters: (ccTexParams*) texParams -(void) setAliasTexParameters { - ccGLBindTexture2D( name_ ); + ccGLBindTexture2D( _name ); - if( ! hasMipmaps_ ) + if( ! _hasMipmaps ) glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST ); else glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST_MIPMAP_NEAREST ); @@ -876,9 +607,9 @@ -(void) setAliasTexParameters -(void) setAntiAliasTexParameters { - ccGLBindTexture2D( name_ ); + ccGLBindTexture2D( _name ); - if( ! hasMipmaps_ ) + if( ! _hasMipmaps ) glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR ); else glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_NEAREST ); @@ -897,17 +628,17 @@ -(void) setAntiAliasTexParameters @implementation CCTexture2D (PixelFormat) +(void) setDefaultAlphaPixelFormat:(CCTexture2DPixelFormat)format { - defaultAlphaPixelFormat_ = format; + defaultAlphaPixel_format = format; } +(CCTexture2DPixelFormat) defaultAlphaPixelFormat { - return defaultAlphaPixelFormat_; + return defaultAlphaPixel_format; } +(NSUInteger) bitsPerPixelForFormat:(CCTexture2DPixelFormat)format { - NSUInteger ret=0; + NSUInteger ret=UINT_MAX; switch (format) { case kCCTexture2DPixelFormat_RGBA8888: @@ -941,24 +672,29 @@ +(NSUInteger) bitsPerPixelForFormat:(CCTexture2DPixelFormat)format case kCCTexture2DPixelFormat_PVRTC2: ret = 2; break; - default: - ret = -1; - NSAssert1(NO , @"bitsPerPixelForFormat: %ld, unrecognised pixel format", (long)format); - CCLOG(@"bitsPerPixelForFormat: %ld, cannot give useful result", (long)format); - break; +// default: +// ret = -1; +// NSAssert1(NO , @"bitsPerPixelForFormat: %ld, unrecognised pixel format", (long)format); +// CCLOG(@"bitsPerPixelForFormat: %ld, cannot give useful result", (long)format); +// break; } + if (ret == UINT_MAX) + { + NSAssert1(NO , @"bitsPerPixelForFormat: %ld, unrecognised pixel format", (long)format); + CCLOG(@"bitsPerPixelForFormat: %ld, cannot give useful result", (long)format); + } return ret; } -(NSUInteger) bitsPerPixelForFormat { - return [[self class] bitsPerPixelForFormat:format_]; + return [[self class] bitsPerPixelForFormat:_format]; } -(NSString*) stringForFormat { - switch (format_) { + switch (_format) { case kCCTexture2DPixelFormat_RGBA8888: return @"RGBA8888"; @@ -988,12 +724,10 @@ -(NSString*) stringForFormat case kCCTexture2DPixelFormat_PVRTC2: return @"PVRTC2"; - - default: - NSAssert1(NO , @"stringForFormat: %ld, unrecognised pixel format", (long)format_); - CCLOG(@"stringForFormat: %ld, cannot give useful result", (long)format_); - break; } + + NSAssert1(NO , @"stringForFormat: %ld, unrecognised pixel format", (long)_format); + CCLOG(@"stringForFormat: %ld, cannot give useful result", (long)_format); return nil; } diff --git a/cocos2d/CCTextureAtlas.h b/cocos2d/CCTextureAtlas.h new file mode 100644 index 0000000..17edc83 --- /dev/null +++ b/cocos2d/CCTextureAtlas.h @@ -0,0 +1,188 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2008-2010 Ricardo Quesada + * Copyright (c) 2011 Zynga Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + */ + +#import "CCTexture2D.h" +#import "ccTypes.h" +#import "ccConfig.h" + +/** A class that implements a Texture Atlas. + Supported features: + * The atlas file can be a PVRTC, PNG or any other format supported by Texture2D + * Quads can be updated in runtime + * Quads can be added in runtime + * Quads can be removed in runtime + * Quads can be re-ordered in runtime + * The TextureAtlas capacity can be increased or decreased in runtime + * OpenGL component: V3F, C4B, T2F. + The quads are rendered using an OpenGL ES VBO. + To render the quads using an interleaved vertex array list, you should modify the ccConfig.h file + */ +@interface CCTextureAtlas : NSObject +{ + NSUInteger _totalQuads; + NSUInteger _capacity; + ccV3F_C4B_T2F_Quad *_quads; // quads to be rendered + GLushort *_indices; + CCTexture2D *_texture; + + GLuint _buffersVBO[2]; //0: vertex 1: indices + BOOL _dirty; //indicates whether or not the array buffer of the VBO needs to be updated + +#if CC_TEXTURE_ATLAS_USE_VAO + GLuint _VAOname; +#endif +} + +/** quantity of quads that are going to be drawn */ +@property (nonatomic,readonly) NSUInteger totalQuads; +/** quantity of quads that can be stored with the current texture atlas size */ +@property (nonatomic,readonly) NSUInteger capacity; +/** Texture of the texture atlas */ +@property (nonatomic,strong) CCTexture2D *texture; +/** Quads that are going to be rendered */ +@property (nonatomic,readwrite) ccV3F_C4B_T2F_Quad *quads; + +/** creates a TextureAtlas with an filename and with an initial capacity for Quads. + * The TextureAtlas capacity can be increased in runtime. + */ ++(id) textureAtlasWithFile:(NSString*)file capacity:(NSUInteger)capacity; + +/** initializes a TextureAtlas with a filename and with a certain capacity for Quads. + * The TextureAtlas capacity can be increased in runtime. + * + * WARNING: Do not reinitialize the TextureAtlas because it will leak memory (issue #706) + */ +-(id) initWithFile: (NSString*) file capacity:(NSUInteger)capacity; + +/** creates a TextureAtlas with a previously initialized Texture2D object, and + * with an initial capacity for n Quads. + * The TextureAtlas capacity can be increased in runtime. + */ ++(id) textureAtlasWithTexture:(CCTexture2D *)tex capacity:(NSUInteger)capacity; + +/** initializes a TextureAtlas with a previously initialized Texture2D object, and + * with an initial capacity for Quads. + * The TextureAtlas capacity can be increased in runtime. + * + * WARNING: Do not reinitialize the TextureAtlas because it will leak memory (issue #706) + */ +-(id) initWithTexture:(CCTexture2D *)tex capacity:(NSUInteger)capacity; + +/** updates a Quad (texture, vertex and color) at a certain index + * index must be between 0 and the atlas capacity - 1 + @since v0.8 + */ +-(void) updateQuad:(ccV3F_C4B_T2F_Quad*)quad atIndex:(NSUInteger)index; + +/** Inserts a Quad (texture, vertex and color) at a certain index + index must be between 0 and the atlas capacity - 1 + @since v0.8 + */ +-(void) insertQuad:(ccV3F_C4B_T2F_Quad*)quad atIndex:(NSUInteger)index; + +/** Inserts a c array of quads at a given index + index must be between 0 and the atlas capacity - 1 + this method doesn't enlarge the array when amount + index > totalQuads + @since v1.1 +*/ +-(void) insertQuads:(ccV3F_C4B_T2F_Quad*)quads atIndex:(NSUInteger)index amount:(NSUInteger)amount; + +/** Removes the quad that is located at a certain index and inserts it at a new index + This operation is faster than removing and inserting in a quad in 2 different steps + @since v0.7.2 +*/ +-(void) insertQuadFromIndex:(NSUInteger)fromIndex atIndex:(NSUInteger)newIndex; + +/** removes a quad at a given index number. + The capacity remains the same, but the total number of quads to be drawn is reduced in 1 + @since v0.7.2 + */ +-(void) removeQuadAtIndex:(NSUInteger) index; + +/** removes a amount of quads starting from index + @since 1.1 + */ +- (void) removeQuadsAtIndex:(NSUInteger) index amount:(NSUInteger) amount; + +/** removes all Quads. + The TextureAtlas capacity remains untouched. No memory is freed. + The total number of quads to be drawn will be 0 + @since v0.7.2 + */ +-(void) removeAllQuads; + +/** resize the capacity of the CCTextureAtlas. + * The new capacity can be lower or higher than the current one + * It returns YES if the resize was successful. + * If it fails to resize the capacity it will return NO with a new capacity of 0. + */ +-(BOOL) resizeCapacity: (NSUInteger) n; + +/** + Used internally by CCParticleBatchNode + don't use this unless you know what you're doing + @since 1.1 +*/ +- (void) increaseTotalQuadsWith:(NSUInteger) amount; + +/** Moves an amount of quads from oldIndex at newIndex + @since v1.1 + */ +-(void) moveQuadsFromIndex:(NSUInteger)oldIndex amount:(NSUInteger) amount atIndex:(NSUInteger)newIndex; + +/** + Moves quads from index till totalQuads to the newIndex + Used internally by CCParticleBatchNode + This method doesn't enlarge the array if newIndex + quads to be moved > capacity + @since 1.1 +*/ +- (void) moveQuadsFromIndex:(NSUInteger) index to:(NSUInteger) newIndex; + +/** + Ensures that after a realloc quads are still empty + Used internally by CCParticleBatchNode + @since 1.1 +*/ +- (void) fillWithEmptyQuadsFromIndex:(NSUInteger) index amount:(NSUInteger) amount; + +/** draws n quads + * n can't be greater than the capacity of the Atlas + */ + +-(void) drawNumberOfQuads: (NSUInteger) n; + +/** draws n quads from an index (offset). + n + start can't be greater than the capacity of the atlas + + @since v1.0 + */ +-(void) drawNumberOfQuads: (NSUInteger) n fromIndex: (NSUInteger) start; + +/** draws all the Atlas's Quads + */ +-(void) drawQuads; + +@end diff --git a/src/cocos2d/CCTextureAtlas.m b/cocos2d/CCTextureAtlas.m similarity index 61% rename from src/cocos2d/CCTextureAtlas.m rename to cocos2d/CCTextureAtlas.m index 5e703bf..369e2b5 100644 --- a/src/cocos2d/CCTextureAtlas.m +++ b/cocos2d/CCTextureAtlas.m @@ -39,7 +39,6 @@ @interface CCTextureAtlas () -(void) setupIndices; --(void) mapBuffers; #if CC_TEXTURE_ATLAS_USE_VAO -(void) setupVBOandVAO; @@ -52,20 +51,20 @@ -(void) setupVBO; @implementation CCTextureAtlas -@synthesize totalQuads = totalQuads_, capacity = capacity_; -@synthesize texture = texture_; -@synthesize quads = quads_; +@synthesize totalQuads = _totalQuads, capacity = _capacity; +@synthesize texture = _texture; +@synthesize quads = _quads; #pragma mark TextureAtlas - alloc & init +(id) textureAtlasWithFile:(NSString*) file capacity: (NSUInteger) n { - return [[[self alloc] initWithFile:file capacity:n] autorelease]; + return [[self alloc] initWithFile:file capacity:n]; } +(id) textureAtlasWithTexture:(CCTexture2D *)tex capacity:(NSUInteger)n { - return [[[self alloc] initWithTexture:tex capacity:n] autorelease]; + return [[self alloc] initWithTexture:tex capacity:n]; } -(id) initWithFile:(NSString*)file capacity:(NSUInteger)n @@ -78,7 +77,6 @@ -(id) initWithFile:(NSString*)file capacity:(NSUInteger)n // else { CCLOG(@"cocos2d: Could not open file: %@", file); - [self release]; return nil; } } @@ -87,26 +85,25 @@ -(id) initWithTexture:(CCTexture2D*)tex capacity:(NSUInteger)n { if( (self=[super init]) ) { - capacity_ = n; - totalQuads_ = 0; + _capacity = n; + _totalQuads = 0; // retained in property self.texture = tex; // Re-initialization is not allowed - NSAssert(quads_==nil && indices_==nil, @"CCTextureAtlas re-initialization is not allowed"); + NSAssert(_quads==nil && _indices==nil, @"CCTextureAtlas re-initialization is not allowed"); - quads_ = calloc( sizeof(quads_[0]) * capacity_, 1 ); - indices_ = calloc( sizeof(indices_[0]) * capacity_ * 6, 1 ); + _quads = calloc( sizeof(_quads[0]) * _capacity, 1 ); + _indices = calloc( sizeof(_indices[0]) * _capacity * 6, 1 ); - if( ! ( quads_ && indices_) ) { + if( ! ( _quads && _indices) ) { CCLOG(@"cocos2d: CCTextureAtlas: not enough memory"); - if( quads_ ) - free(quads_); - if( indices_ ) - free(indices_); + if( _quads ) + free(_quads); + if( _indices ) + free(_indices); - [self release]; return nil; } @@ -118,7 +115,7 @@ -(id) initWithTexture:(CCTexture2D*)tex capacity:(NSUInteger)n [self setupVBO]; #endif - dirty_ = YES; + _dirty = YES; } return self; @@ -126,47 +123,45 @@ -(id) initWithTexture:(CCTexture2D*)tex capacity:(NSUInteger)n -(NSString*) description { - return [NSString stringWithFormat:@"<%@ = %p | totalQuads = %lu>", [self class], self, (unsigned long)totalQuads_]; + return [NSString stringWithFormat:@"<%@ = %p | totalQuads = %lu>", [self class], self, (unsigned long)_totalQuads]; } -(void) dealloc { CCLOGINFO(@"cocos2d: deallocing %@",self); - free(quads_); - free(indices_); + free(_quads); + free(_indices); - glDeleteBuffers(2, buffersVBO_); + glDeleteBuffers(2, _buffersVBO); #if CC_TEXTURE_ATLAS_USE_VAO - glDeleteVertexArrays(1, &VAOname_); + glDeleteVertexArrays(1, &_VAOname); #endif - [texture_ release]; - [super dealloc]; } -(void) setupIndices { - for( NSUInteger i = 0; i < capacity_;i++) + for( NSUInteger i = 0; i < _capacity;i++) { #if CC_TEXTURE_ATLAS_USE_TRIANGLE_STRIP - indices_[i*6+0] = i*4+0; - indices_[i*6+1] = i*4+0; - indices_[i*6+2] = i*4+2; - indices_[i*6+3] = i*4+1; - indices_[i*6+4] = i*4+3; - indices_[i*6+5] = i*4+3; + _indices[i*6+0] = i*4+0; + _indices[i*6+1] = i*4+0; + _indices[i*6+2] = i*4+2; + _indices[i*6+3] = i*4+1; + _indices[i*6+4] = i*4+3; + _indices[i*6+5] = i*4+3; #else - indices_[i*6+0] = i*4+0; - indices_[i*6+1] = i*4+1; - indices_[i*6+2] = i*4+2; + _indices[i*6+0] = i*4+0; + _indices[i*6+1] = i*4+1; + _indices[i*6+2] = i*4+2; // inverted index. issue #179 - indices_[i*6+3] = i*4+3; - indices_[i*6+4] = i*4+2; - indices_[i*6+5] = i*4+1; + _indices[i*6+3] = i*4+3; + _indices[i*6+4] = i*4+2; + _indices[i*6+5] = i*4+1; #endif } } @@ -180,15 +175,14 @@ -(void) setupVBOandVAO // https://devforums.apple.com/thread/145566?tstart=0 void (^createVAO)(void) = ^{ - glGenVertexArrays(1, &VAOname_); - glBindVertexArray(VAOname_); + glGenVertexArrays(1, &self->_VAOname); + ccGLBindVAO(self->_VAOname); - #define kQuadSize sizeof(quads_[0].bl) + #define kQuadSize sizeof(self->_quads[0].bl) - glGenBuffers(2, &buffersVBO_[0]); + glGenBuffers(2, &self->_buffersVBO[0]); - glBindBuffer(GL_ARRAY_BUFFER, buffersVBO_[0]); - glBufferData(GL_ARRAY_BUFFER, sizeof(quads_[0]) * capacity_, quads_, GL_DYNAMIC_DRAW); + glBindBuffer(GL_ARRAY_BUFFER, self->_buffersVBO[0]); // vertices glEnableVertexAttribArray(kCCVertexAttrib_Position); @@ -202,10 +196,10 @@ -(void) setupVBOandVAO glEnableVertexAttribArray(kCCVertexAttrib_TexCoords); glVertexAttribPointer(kCCVertexAttrib_TexCoords, 2, GL_FLOAT, GL_FALSE, kQuadSize, (GLvoid*) offsetof( ccV3F_C4B_T2F, texCoords)); - glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, buffersVBO_[1]); - glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(indices_[0]) * capacity_ * 6, indices_, GL_STATIC_DRAW); + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, self->_buffersVBO[1]); - glBindVertexArray(0); + // Must unbind the VAO before changing the element buffer. + ccGLBindVAO(0); glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); glBindBuffer(GL_ARRAY_BUFFER, 0); @@ -221,81 +215,65 @@ -(void) setupVBOandVAO #else // CC_TEXTURE_ATLAS_USE_VAO -(void) setupVBO { - glGenBuffers(2, &buffersVBO_[0]); - - [self mapBuffers]; + glGenBuffers(2, &_buffersVBO[0]); } #endif // ! // CC_TEXTURE_ATLAS_USE_VAO - --(void) mapBuffers -{ - glBindBuffer(GL_ARRAY_BUFFER, buffersVBO_[0]); - glBufferData(GL_ARRAY_BUFFER, sizeof(quads_[0]) * capacity_, quads_, GL_DYNAMIC_DRAW); - glBindBuffer(GL_ARRAY_BUFFER, 0); - - glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, buffersVBO_[1]); - glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(indices_[0]) * capacity_ * 6, indices_, GL_STATIC_DRAW); - glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); - - CHECK_GL_ERROR_DEBUG(); -} - #pragma mark TextureAtlas - Update, Insert, Move & Remove -(ccV3F_C4B_T2F_Quad *) quads { //if someone accesses the quads directly, presume that changes will be made - dirty_ = YES; - return quads_; + _dirty = YES; + return _quads; } -(void) updateQuad:(ccV3F_C4B_T2F_Quad*)quad atIndex:(NSUInteger) n { - NSAssert(n < capacity_, @"updateQuadWithTexture: Invalid index"); + NSAssert(n < _capacity, @"updateQuadWithTexture: Invalid index"); - totalQuads_ = MAX( n+1, totalQuads_); + _totalQuads = MAX( n+1, _totalQuads); - quads_[n] = *quad; + _quads[n] = *quad; - dirty_ = YES; + _dirty = YES; } -(void) insertQuad:(ccV3F_C4B_T2F_Quad*)quad atIndex:(NSUInteger)index { - NSAssert(index < capacity_, @"insertQuadWithTexture: Invalid index"); + NSAssert(index < _capacity, @"insertQuadWithTexture: Invalid index"); - totalQuads_++; - NSAssert( totalQuads_ <= capacity_, @"invalid totalQuads"); + _totalQuads++; + NSAssert( _totalQuads <= _capacity, @"invalid totalQuads"); // issue #575. index can be > totalQuads - NSInteger remaining = (totalQuads_-1) - index; + NSInteger remaining = (_totalQuads-1) - index; // last object doesn't need to be moved if( remaining > 0) // tex coordinates - memmove( &quads_[index+1],&quads_[index], sizeof(quads_[0]) * remaining ); + memmove( &_quads[index+1],&_quads[index], sizeof(_quads[0]) * remaining ); - quads_[index] = *quad; + _quads[index] = *quad; - dirty_ = YES; + _dirty = YES; } -(void) insertQuads:(ccV3F_C4B_T2F_Quad*)quads atIndex:(NSUInteger)index amount:(NSUInteger) amount { - NSAssert(index + amount <= capacity_, @"insertQuadWithTexture: Invalid index + amount"); + NSAssert(index + amount <= _capacity, @"insertQuadWithTexture: Invalid index + amount"); - totalQuads_+= amount; + _totalQuads+= amount; - NSAssert( totalQuads_ <= capacity_, @"invalid totalQuads"); + NSAssert( _totalQuads <= _capacity, @"invalid totalQuads"); // issue #575. index can be > totalQuads - NSInteger remaining = (totalQuads_-1) - index - amount; + NSInteger remaining = (_totalQuads-1) - index - amount; // last object doesn't need to be moved if( remaining > 0) // tex coordinates - memmove( &quads_[index+amount],&quads_[index], sizeof(quads_[0]) * remaining ); + memmove( &_quads[index+amount],&_quads[index], sizeof(_quads[0]) * remaining ); @@ -303,18 +281,18 @@ -(void) insertQuads:(ccV3F_C4B_T2F_Quad*)quads atIndex:(NSUInteger)index amount: NSUInteger j = 0; for (NSUInteger i = index; i < max ; i++) { - quads_[index] = quads[j]; + _quads[index] = quads[j]; index++; j++; } - dirty_ = YES; + _dirty = YES; } -(void) insertQuadFromIndex:(NSUInteger)oldIndex atIndex:(NSUInteger)newIndex { - NSAssert(newIndex < totalQuads_, @"insertQuadFromIndex:atIndex: Invalid index"); - NSAssert(oldIndex < totalQuads_, @"insertQuadFromIndex:atIndex: Invalid index"); + NSAssert(newIndex < _totalQuads, @"insertQuadFromIndex:atIndex: Invalid index"); + NSAssert(oldIndex < _totalQuads, @"insertQuadFromIndex:atIndex: Invalid index"); if( oldIndex == newIndex ) return; @@ -328,17 +306,17 @@ -(void) insertQuadFromIndex:(NSUInteger)oldIndex atIndex:(NSUInteger)newIndex } // tex coordinates - ccV3F_C4B_T2F_Quad quadsBackup = quads_[oldIndex]; - memmove( &quads_[dst],&quads_[src], sizeof(quads_[0]) * howMany ); - quads_[newIndex] = quadsBackup; + ccV3F_C4B_T2F_Quad quadsBackup = _quads[oldIndex]; + memmove( &_quads[dst],&_quads[src], sizeof(_quads[0]) * howMany ); + _quads[newIndex] = quadsBackup; - dirty_ = YES; + _dirty = YES; } -(void) moveQuadsFromIndex:(NSUInteger)oldIndex amount:(NSUInteger) amount atIndex:(NSUInteger)newIndex { - NSAssert(newIndex + amount <= totalQuads_, @"insertQuadFromIndex:atIndex: Invalid index"); - NSAssert(oldIndex < totalQuads_, @"insertQuadFromIndex:atIndex: Invalid index"); + NSAssert(newIndex + amount <= _totalQuads, @"insertQuadFromIndex:atIndex: Invalid index"); + NSAssert(oldIndex < _totalQuads, @"insertQuadFromIndex:atIndex: Invalid index"); if( oldIndex == newIndex ) return; @@ -346,99 +324,98 @@ -(void) moveQuadsFromIndex:(NSUInteger)oldIndex amount:(NSUInteger) amount atInd //create buffer size_t quadSize = sizeof(ccV3F_C4B_T2F_Quad); ccV3F_C4B_T2F_Quad *tempQuads = malloc( quadSize * amount); - memcpy( tempQuads, &quads_[oldIndex], quadSize * amount ); + memcpy( tempQuads, &_quads[oldIndex], quadSize * amount ); if (newIndex < oldIndex) { // move quads from newIndex to newIndex + amount to make room for buffer - memmove( &quads_[newIndex], &quads_[newIndex+amount], (oldIndex-newIndex)*quadSize); + memmove( &_quads[newIndex], &_quads[newIndex+amount], (oldIndex-newIndex)*quadSize); } else { // move quads above back - memmove( &quads_[oldIndex], &quads_[oldIndex+amount], (newIndex-oldIndex)*quadSize); + memmove( &_quads[oldIndex], &_quads[oldIndex+amount], (newIndex-oldIndex)*quadSize); } - memcpy( &quads_[newIndex], tempQuads, amount*quadSize); + memcpy( &_quads[newIndex], tempQuads, amount*quadSize); free(tempQuads); - dirty_ = YES; + _dirty = YES; } -(void) removeQuadAtIndex:(NSUInteger) index { - NSAssert(index < totalQuads_, @"removeQuadAtIndex: Invalid index"); + NSAssert(index < _totalQuads, @"removeQuadAtIndex: Invalid index"); - NSUInteger remaining = (totalQuads_-1) - index; + NSUInteger remaining = (_totalQuads-1) - index; // last object doesn't need to be moved if( remaining ) - memmove( &quads_[index],&quads_[index+1], sizeof(quads_[0]) * remaining ); + memmove( &_quads[index],&_quads[index+1], sizeof(_quads[0]) * remaining ); - totalQuads_--; + _totalQuads--; - dirty_ = YES; + _dirty = YES; } -(void) removeQuadsAtIndex:(NSUInteger) index amount:(NSUInteger) amount { - NSAssert(index + amount <= totalQuads_, @"removeQuadAtIndex: index + amount out of bounds"); + NSAssert(index + amount <= _totalQuads, @"removeQuadAtIndex: index + amount out of bounds"); - NSUInteger remaining = (totalQuads_) - (index + amount); + NSUInteger remaining = (_totalQuads) - (index + amount); - totalQuads_ -= amount; + _totalQuads -= amount; if ( remaining ) - memmove( &quads_[index], &quads_[index+amount], sizeof(quads_[0]) * remaining ); + memmove( &_quads[index], &_quads[index+amount], sizeof(_quads[0]) * remaining ); - dirty_ = YES; + _dirty = YES; } -(void) removeAllQuads { - totalQuads_ = 0; + _totalQuads = 0; } #pragma mark TextureAtlas - Resize -(BOOL) resizeCapacity: (NSUInteger) newCapacity { - if( newCapacity == capacity_ ) + if( newCapacity == _capacity ) return YES; // update capacity and totolQuads - totalQuads_ = MIN(totalQuads_,newCapacity); - capacity_ = newCapacity; + _totalQuads = MIN(_totalQuads,newCapacity); + _capacity = newCapacity; - void * tmpQuads = realloc( quads_, sizeof(quads_[0]) * capacity_ ); - void * tmpIndices = realloc( indices_, sizeof(indices_[0]) * capacity_ * 6 ); + void * tmpQuads = realloc( _quads, sizeof(_quads[0]) * _capacity ); + void * tmpIndices = realloc( _indices, sizeof(_indices[0]) * _capacity * 6 ); if( ! ( tmpQuads && tmpIndices) ) { CCLOG(@"cocos2d: CCTextureAtlas: not enough memory"); if( tmpQuads ) free(tmpQuads); else - free(quads_); + free(_quads); if( tmpIndices ) free(tmpIndices); else - free(indices_); + free(_indices); - indices_ = nil; - quads_ = nil; - capacity_ = totalQuads_ = 0; + _indices = nil; + _quads = nil; + _capacity = _totalQuads = 0; return NO; } - quads_ = tmpQuads; - indices_ = tmpIndices; + _quads = tmpQuads; + _indices = tmpIndices; // Update Indices [self setupIndices]; - [self mapBuffers]; - dirty_ = YES; + _dirty = YES; return YES; } @@ -451,29 +428,29 @@ -(void) fillWithEmptyQuadsFromIndex:(NSUInteger) index amount:(NSUInteger) amoun bzero( &quad, sizeof(quad) ); NSUInteger to = index + amount; - for (NSInteger i = index ; i < to ; i++) + for (NSUInteger i = index ; i < to ; i++) { - quads_[i] = quad; + _quads[i] = quad; } } -(void) increaseTotalQuadsWith:(NSUInteger) amount { - totalQuads_ += amount; + _totalQuads += amount; } -(void) moveQuadsFromIndex:(NSUInteger) index to:(NSUInteger) newIndex { - NSAssert(newIndex + (totalQuads_ - index) <= capacity_, @"moveQuadsFromIndex move is out of bounds"); + NSAssert(newIndex + (_totalQuads - index) <= _capacity, @"moveQuadsFromIndex move is out of bounds"); - memmove(quads_ + newIndex,quads_ + index, (totalQuads_ - index) * sizeof(quads_[0])); + memmove(_quads + newIndex,_quads + index, (_totalQuads - index) * sizeof(_quads[0])); } #pragma mark TextureAtlas - Drawing -(void) drawQuads { - [self drawNumberOfQuads: totalQuads_ fromIndex:0]; + [self drawNumberOfQuads: _totalQuads fromIndex:0]; } -(void) drawNumberOfQuads: (NSUInteger) n @@ -483,32 +460,50 @@ -(void) drawNumberOfQuads: (NSUInteger) n -(void) drawNumberOfQuads: (NSUInteger) n fromIndex: (NSUInteger) start { - ccGLBindTexture2D( [texture_ name] ); + ccGLBindTexture2D( [_texture name] ); #if CC_TEXTURE_ATLAS_USE_VAO // // Using VBO and VAO // - // XXX: update is done in draw... perhaps it should be done in a timer - if (dirty_) { - glBindBuffer(GL_ARRAY_BUFFER, buffersVBO_[0]); - glBufferSubData(GL_ARRAY_BUFFER, sizeof(quads_[0])*start, sizeof(quads_[0]) * n , &quads_[start] ); + if (_dirty) { + + ccGLBindVAO(0); + + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, _buffersVBO[1]); + glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(_indices[0]) * _capacity * 6, _indices, GL_STATIC_DRAW); + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); + + + glBindBuffer(GL_ARRAY_BUFFER, _buffersVBO[0]); + // option 1: subdata +// glBufferSubData(GL_ARRAY_BUFFER, sizeof(_quads[0])*start, sizeof(_quads[0]) * n , &_quads[start] ); + + // option 2: data +// glBufferData(GL_ARRAY_BUFFER, sizeof(_quads[0]) * (n-start), &_quads[start], GL_DYNAMIC_DRAW); + + // option 3: orphaning + glMapBuffer + glBufferData(GL_ARRAY_BUFFER, sizeof(_quads[0]) * (n-start), nil, GL_DYNAMIC_DRAW); + void *buf = glMapBuffer(GL_ARRAY_BUFFER, GL_WRITE_ONLY); + memcpy(buf, _quads, sizeof(_quads[0])* (n-start)); + glUnmapBuffer(GL_ARRAY_BUFFER); + glBindBuffer(GL_ARRAY_BUFFER, 0); - dirty_ = NO; + _dirty = NO; } - glBindVertexArray( VAOname_ ); + ccGLBindVAO( _VAOname ); #if CC_TEXTURE_ATLAS_USE_TRIANGLE_STRIP - glDrawElements(GL_TRIANGLE_STRIP, (GLsizei) n*6, GL_UNSIGNED_SHORT, (GLvoid*) (start*6*sizeof(indices_[0])) ); + glDrawElements(GL_TRIANGLE_STRIP, (GLsizei) n*6, GL_UNSIGNED_SHORT, (GLvoid*) (start*6*sizeof(_indices[0])) ); #else - glDrawElements(GL_TRIANGLES, (GLsizei) n*6, GL_UNSIGNED_SHORT, (GLvoid*) (start*6*sizeof(indices_[0])) ); + glDrawElements(GL_TRIANGLES, (GLsizei) n*6, GL_UNSIGNED_SHORT, (GLvoid*) (start*6*sizeof(_indices[0])) ); #endif // CC_TEXTURE_ATLAS_USE_TRIANGLE_STRIP - - glBindVertexArray(0); + +// glBindVertexArray(0); #else // ! CC_TEXTURE_ATLAS_USE_VAO @@ -517,13 +512,16 @@ -(void) drawNumberOfQuads: (NSUInteger) n fromIndex: (NSUInteger) start // Using VBO without VAO // -#define kQuadSize sizeof(quads_[0].bl) - glBindBuffer(GL_ARRAY_BUFFER, buffersVBO_[0]); +#define kQuadSize sizeof(_quads[0].bl) + glBindBuffer(GL_ARRAY_BUFFER, _buffersVBO[0]); // XXX: update is done in draw... perhaps it should be done in a timer - if (dirty_) { - glBufferSubData(GL_ARRAY_BUFFER, sizeof(quads_[0])*start, sizeof(quads_[0]) * n , &quads_[start] ); - dirty_ = NO; + if (_dirty) { +// glBufferSubData(GL_ARRAY_BUFFER, sizeof(_quads[0])*start, sizeof(_quads[0]) * n , &_quads[start] ); + + // Apparently this is faster... need to do performance tests + glBufferData(GL_ARRAY_BUFFER, sizeof(_quads[0]) * n, _quads, GL_DYNAMIC_DRAW); + _dirty = NO; } ccGLEnableVertexAttribs( kCCVertexAttribFlag_PosColorTex ); @@ -539,12 +537,12 @@ -(void) drawNumberOfQuads: (NSUInteger) n fromIndex: (NSUInteger) start glBindBuffer(GL_ARRAY_BUFFER, 0); - glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, buffersVBO_[1]); + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, _buffersVBO[1]); #if CC_TEXTURE_ATLAS_USE_TRIANGLE_STRIP - glDrawElements(GL_TRIANGLE_STRIP, (GLsizei) n*6, GL_UNSIGNED_SHORT, (GLvoid*) (start*6*sizeof(indices_[0])) ); + glDrawElements(GL_TRIANGLE_STRIP, (GLsizei) n*6, GL_UNSIGNED_SHORT, (GLvoid*) (start*6*sizeof(_indices[0])) ); #else - glDrawElements(GL_TRIANGLES, (GLsizei) n*6, GL_UNSIGNED_SHORT, (GLvoid*) (start*6*sizeof(indices_[0])) ); + glDrawElements(GL_TRIANGLES, (GLsizei) n*6, GL_UNSIGNED_SHORT, (GLvoid*) (start*6*sizeof(_indices[0])) ); #endif // CC_TEXTURE_ATLAS_USE_TRIANGLE_STRIP glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); diff --git a/cocos2d/CCTextureCache.h b/cocos2d/CCTextureCache.h new file mode 100644 index 0000000..5c7568d --- /dev/null +++ b/cocos2d/CCTextureCache.h @@ -0,0 +1,146 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2008-2010 Ricardo Quesada + * Copyright (c) 2011 Zynga Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + */ + +#import "ccMacros.h" + +#ifdef __CC_PLATFORM_IOS +#import +#endif + +#import + +@class CCTexture2D; + +/** Singleton that handles the loading of textures + * Once the texture is loaded, the next time it will return + * a reference of the previously loaded texture reducing GPU & CPU memory + */ +@interface CCTextureCache : NSObject +{ + NSMutableDictionary *_textures; + + dispatch_queue_t _loadingQueue; + dispatch_queue_t _dictQueue; +} + +/** Retruns ths shared instance of the cache */ ++ (CCTextureCache *) sharedTextureCache; + +/** purges the cache. It releases the retained instance. + @since v0.99.0 + */ ++(void)purgeSharedTextureCache; + + +/** Returns a Texture2D object given an file image + * If the file image was not previously loaded, it will create a new CCTexture2D + * object and it will return it. It will use the filename as a key. + * Otherwise it will return a reference of a previously loaded image. + * Supported image extensions: .png, .bmp, .tiff, .jpeg, .pvr, .gif + */ +-(CCTexture2D*) addImage: (NSString*) fileimage; + +/** Asynchronously, load a texture2d from a file. + * If the file image was previously loaded, it will use it. + * Otherwise it will load a texture in a new thread, and when the image is loaded, the callback will be called with the Texture2D as a parameter. + * The callback will be called in the cocos2d thread, so it is safe to create any cocos2d object from the callback. + * Supported image extensions: .png, .bmp, .tiff, .jpeg, .pvr, .gif + * @since v0.8 + */ +-(void) addImageAsync:(NSString*) filename target:(id)target selector:(SEL)selector; + +/** Asynchronously, load a texture2d from a file. + * If the file image was previously loaded, it will use it. + * Otherwise it will load a texture in a new thread, and when the image is loaded, the block will be called. + * The callback will be called in the cocos2d thread, so it is safe to create any cocos2d object from the callback. + * Supported image extensions: .png, .bmp, .tiff, .jpeg, .pvr, .gif + * @since v2.0 + */ +-(void) addImageAsync:(NSString*) filename withBlock:(void(^)(CCTexture2D *tex))block; + + +/** Returns a Texture2D object given an CGImageRef image + * If the image was not previously loaded, it will create a new CCTexture2D object and it will return it. + * Otherwise it will return a reference of a previously loaded image + * The "key" parameter will be used as the "key" for the cache. + * If "key" is nil, then a new texture will be created each time. + * @since v0.8 + */ +-(CCTexture2D*) addCGImage: (CGImageRef) image forKey: (NSString *)key; + +/** Returns an already created texture. Returns nil if the texture doesn't exist. + @since v0.99.5 + */ +-(CCTexture2D *) textureForKey:(NSString *)key; + +/** Purges the dictionary of loaded textures. + * Call this method if you receive the "Memory Warning" + * In the short term: it will free some resources preventing your app from being killed + * In the medium term: it will allocate more resources + * In the long term: it will be the same + */ +-(void) removeAllTextures; + +/** Removes unused textures + * Textures that have a retain count of 1 will be deleted + * It is convenient to call this method after when starting a new Scene + * @since v0.8 + */ +-(void) removeUnusedTextures; + +/** Deletes a texture from the cache given a texture + */ +-(void) removeTexture: (CCTexture2D*) tex; + +/** Deletes a texture from the cache given a its key name + @since v0.99.4 + */ +-(void) removeTextureForKey: (NSString*) textureKeyName; + +@end + + +@interface CCTextureCache (PVRSupport) + +/** Returns a Texture2D object given an PVR filename. + * If the file image was not previously loaded, it will create a new CCTexture2D + * object and it will return it. Otherwise it will return a reference of a previously loaded image + * + */ +-(CCTexture2D*) addPVRImage:(NSString*) filename; + +@end + + +@interface CCTextureCache (Debug) +/** Output to CCLOG the current contents of this CCTextureCache + * This will attempt to calculate the size of each texture, and the total texture memory in use + * + * @since v1.0 + */ +-(void) dumpCachedTextureInfo; + +@end diff --git a/src/cocos2d/CCTextureCache.m b/cocos2d/CCTextureCache.m similarity index 80% rename from src/cocos2d/CCTextureCache.m rename to cocos2d/CCTextureCache.m index e151e39..ab70da7 100644 --- a/src/cocos2d/CCTextureCache.m +++ b/cocos2d/CCTextureCache.m @@ -37,6 +37,8 @@ #import "Support/CCFileUtils.h" #import "Support/NSThread+performBlock.h" +#import + #ifdef __CC_PLATFORM_MAC #import "Platforms/Mac/CCDirectorMac.h" @@ -73,14 +75,13 @@ +(id)alloc +(void)purgeSharedTextureCache { - [sharedTextureCache release]; sharedTextureCache = nil; } -(id) init { if( (self=[super init]) ) { - textures_ = [[NSMutableDictionary dictionaryWithCapacity: 10] retain]; + _textures = [NSMutableDictionary dictionaryWithCapacity: 10]; // init "global" stuff _loadingQueue = dispatch_queue_create("org.cocos2d.texturecacheloading", NULL); @@ -116,8 +117,8 @@ - (NSString*) description desc = [NSString stringWithFormat:@"<%@ = %p | num of textures = %lu | keys: %@>", [self class], self, - (unsigned long)[textures_ count], - [textures_ allKeys] + (unsigned long)[self->_textures count], + [self->_textures allKeys] ]; }); return desc; @@ -126,17 +127,12 @@ - (NSString*) description -(void) dealloc { CCLOGINFO(@"cocos2d: deallocing %@", self); - - dispatch_sync(_dictQueue, ^{ - [textures_ release]; - }); - [_auxGLcontext release]; + _auxGLcontext = nil; sharedTextureCache = nil; dispatch_release(_loadingQueue); dispatch_release(_dictQueue); - [super dealloc]; } #pragma mark TextureCache - Add Images @@ -147,20 +143,19 @@ -(void) addImageAsync: (NSString*)path target:(id)target selector:(SEL)selector NSAssert(target != nil, @"TextureCache: target can't be nil"); NSAssert(selector != NULL, @"TextureCache: selector can't be NULL"); - // optimization + // remove possible -HD suffix to prevent caching the same image twice (issue #1040) + CCFileUtils *fileUtils = [CCFileUtils sharedFileUtils]; + path = [fileUtils standarizePath:path]; + // optimization __block CCTexture2D * tex; - -#ifdef __CC_PLATFORM_IOS - path = [[CCFileUtils sharedFileUtils] removeSuffixFromFile:path]; -#endif - + dispatch_sync(_dictQueue, ^{ - tex = [textures_ objectForKey:path]; + tex = [self->_textures objectForKey:path]; }); if(tex) { - [target performSelector:selector withObject:tex]; + objc_msgSend(target, selector, tex); return; } @@ -208,16 +203,15 @@ -(void) addImageAsync:(NSString*)path withBlock:(void(^)(CCTexture2D *tex))block { NSAssert(path != nil, @"TextureCache: fileimage MUST not be nil"); - // optimization + // remove possible -HD suffix to prevent caching the same image twice (issue #1040) + CCFileUtils *fileUtils = [CCFileUtils sharedFileUtils]; + path = [fileUtils standarizePath:path]; + // optimization __block CCTexture2D * tex; -#ifdef __CC_PLATFORM_IOS - path = [[CCFileUtils sharedFileUtils] removeSuffixFromFile:path]; -#endif - dispatch_sync(_dictQueue, ^{ - tex = [textures_ objectForKey:path]; + tex = [self->_textures objectForKey:path]; }); if(tex) { @@ -269,22 +263,28 @@ -(void) addImageAsync:(NSString*)path withBlock:(void(^)(CCTexture2D *tex))block -(CCTexture2D*) addImage: (NSString*) path { - NSAssert(path != nil, @"TextureCache: fileimage MUST not be nill"); - - __block CCTexture2D * tex = nil; + NSAssert(path != nil, @"TextureCache: fileimage MUST not be nil"); // remove possible -HD suffix to prevent caching the same image twice (issue #1040) -#ifdef __CC_PLATFORM_IOS - path = [[CCFileUtils sharedFileUtils] removeSuffixFromFile: path]; -#endif + CCFileUtils *fileUtils = [CCFileUtils sharedFileUtils]; + path = [fileUtils standarizePath:path]; + + __block CCTexture2D * tex = nil; dispatch_sync(_dictQueue, ^{ - tex = [textures_ objectForKey: path]; + tex = [self->_textures objectForKey: path]; }); if( ! tex ) { - NSString *lowerCase = [path lowercaseString]; + ccResolutionType resolution; + NSString *fullpath = [fileUtils fullPathForFilename:path resolutionType:&resolution]; + if( ! fullpath ) { + CCLOG(@"cocos2d: Couldn't find file:%@", path); + return nil; + } + + NSString *lowerCase = [fullpath lowercaseString]; // all images are handled by UIKit/AppKit except PVR extension that is handled by cocos2d's handler @@ -294,48 +294,38 @@ -(CCTexture2D*) addImage: (NSString*) path #ifdef __CC_PLATFORM_IOS else { - - ccResolutionType resolution; - NSString *fullpath = [[CCFileUtils sharedFileUtils] fullPathFromRelativePath:path resolutionType:&resolution]; - + UIImage *image = [[UIImage alloc] initWithContentsOfFile:fullpath]; tex = [[CCTexture2D alloc] initWithCGImage:image.CGImage resolutionType:resolution]; - [image release]; - + if( tex ){ dispatch_sync(_dictQueue, ^{ - [textures_ setObject: tex forKey:path]; + [self->_textures setObject: tex forKey:path]; }); }else{ - CCLOG(@"cocos2d: Couldn't add image:%@ in CCTextureCache", path); + CCLOG(@"cocos2d: Couldn't create texture for file:%@ in CCTextureCache", path); } - - // autorelease prevents possible crash in multithreaded environments - [tex autorelease]; } #elif defined(__CC_PLATFORM_MAC) else { - NSString *fullpath = [[CCFileUtils sharedFileUtils] fullPathFromRelativePath: path ]; NSData *data = [[NSData alloc] initWithContentsOfFile:fullpath]; NSBitmapImageRep *image = [[NSBitmapImageRep alloc] initWithData:data]; - tex = [ [CCTexture2D alloc] initWithCGImage:[image CGImage]]; + tex = [ [CCTexture2D alloc] initWithCGImage:[image CGImage] resolutionType:resolution]; - [data release]; - [image release]; if( tex ){ dispatch_sync(_dictQueue, ^{ - [textures_ setObject: tex forKey:path]; + [self->_textures setObject: tex forKey:path]; }); }else{ - CCLOG(@"cocos2d: Couldn't add image:%@ in CCTextureCache", path); + CCLOG(@"cocos2d: Couldn't create texture for file:%@ in CCTextureCache", path); } // autorelease prevents possible crash in multithreaded environments - [tex autorelease]; + //[tex autorelease]; } #endif // __CC_PLATFORM_MAC @@ -354,27 +344,23 @@ -(CCTexture2D*) addCGImage: (CGImageRef) imageref forKey: (NSString *)key // If key is nil, then create a new texture each time if( key ) { dispatch_sync(_dictQueue, ^{ - tex = [textures_ objectForKey:key]; + tex = [self->_textures objectForKey:key]; }); if(tex) return tex; } -#ifdef __CC_PLATFORM_IOS tex = [[CCTexture2D alloc] initWithCGImage:imageref resolutionType:kCCResolutionUnknown]; -#elif __CC_PLATFORM_MAC - tex = [[CCTexture2D alloc] initWithCGImage:imageref]; -#endif if(tex && key){ dispatch_sync(_dictQueue, ^{ - [textures_ setObject: tex forKey:key]; + [self->_textures setObject: tex forKey:key]; }); }else{ CCLOG(@"cocos2d: Couldn't add CGImage in CCTextureCache"); } - return [tex autorelease]; + return tex; } #pragma mark TextureCache - Remove @@ -382,22 +368,26 @@ -(CCTexture2D*) addCGImage: (CGImageRef) imageref forKey: (NSString *)key -(void) removeAllTextures { dispatch_sync(_dictQueue, ^{ - [textures_ removeAllObjects]; + [self->_textures removeAllObjects]; }); } -(void) removeUnusedTextures { + //TODO: remove method not implemented with ARC +//#warning Not implemented with ARC + /* dispatch_sync(_dictQueue, ^{ - NSArray *keys = [textures_ allKeys]; + NSArray *keys = [_textures allKeys]; for( id key in keys ) { - id value = [textures_ objectForKey:key]; + id value = [_textures objectForKey:key]; if( [value retainCount] == 1 ) { CCLOG(@"cocos2d: CCTextureCache: removing unused texture: %@", key); - [textures_ removeObjectForKey:key]; + [_textures removeObjectForKey:key]; } } }); + */ } -(void) removeTexture: (CCTexture2D*) tex @@ -406,10 +396,10 @@ -(void) removeTexture: (CCTexture2D*) tex return; dispatch_sync(_dictQueue, ^{ - NSArray *keys = [textures_ allKeysForObject:tex]; + NSArray *keys = [self->_textures allKeysForObject:tex]; for( NSUInteger i = 0; i < [keys count]; i++ ) - [textures_ removeObjectForKey:[keys objectAtIndex:i]]; + [self->_textures removeObjectForKey:[keys objectAtIndex:i]]; }); } @@ -419,7 +409,7 @@ -(void) removeTextureForKey:(NSString*)name return; dispatch_sync(_dictQueue, ^{ - [textures_ removeObjectForKey:name]; + [self->_textures removeObjectForKey:name]; }); } @@ -429,7 +419,7 @@ - (CCTexture2D *)textureForKey:(NSString *)key __block CCTexture2D *tex = nil; dispatch_sync(_dictQueue, ^{ - tex = [textures_ objectForKey:key]; + tex = [self->_textures objectForKey:key]; }); return tex; @@ -444,15 +434,14 @@ -(CCTexture2D*) addPVRImage:(NSString*)path { NSAssert(path != nil, @"TextureCache: fileimage MUST not be nill"); - __block CCTexture2D * tex; - // remove possible -HD suffix to prevent caching the same image twice (issue #1040) -#ifdef __CC_PLATFORM_IOS - path = [[CCFileUtils sharedFileUtils] removeSuffixFromFile: path]; -#endif + CCFileUtils *fileUtils = [CCFileUtils sharedFileUtils]; + path = [fileUtils standarizePath:path]; + __block CCTexture2D * tex; + dispatch_sync(_dictQueue, ^{ - tex = [textures_ objectForKey:path]; + tex = [self->_textures objectForKey:path]; }); if(tex) { @@ -462,13 +451,13 @@ -(CCTexture2D*) addPVRImage:(NSString*)path tex = [[CCTexture2D alloc] initWithPVRFile: path]; if( tex ){ dispatch_sync(_dictQueue, ^{ - [textures_ setObject: tex forKey:path]; + [self->_textures setObject: tex forKey:path]; }); }else{ CCLOG(@"cocos2d: Couldn't add PVRImage:%@ in CCTextureCache",path); } - return [tex autorelease]; + return tex; } @end @@ -482,16 +471,15 @@ -(void) dumpCachedTextureInfo __block NSUInteger totalBytes = 0; dispatch_sync(_dictQueue, ^{ - for (NSString* texKey in textures_) { - CCTexture2D* tex = [textures_ objectForKey:texKey]; + for (NSString* texKey in self->_textures) { + CCTexture2D* tex = [self->_textures objectForKey:texKey]; NSUInteger bpp = [tex bitsPerPixelForFormat]; // Each texture takes up width * height * bytesPerPixel bytes. NSUInteger bytes = tex.pixelsWide * tex.pixelsHigh * bpp / 8; totalBytes += bytes; count++; - NSLog( @"cocos2d: \"%@\"\trc=%lu\tid=%lu\t%lu x %lu\t@ %ld bpp =>\t%lu KB", + NSLog( @"cocos2d: \"%@\"\tid=%lu\t%lu x %lu\t@ %ld bpp =>\t%lu KB", texKey, - (long)[tex retainCount], (long)tex.name, (long)tex.pixelsWide, (long)tex.pixelsHigh, diff --git a/cocos2d/CCTexturePVR.h b/cocos2d/CCTexturePVR.h new file mode 100644 index 0000000..61d1dc4 --- /dev/null +++ b/cocos2d/CCTexturePVR.h @@ -0,0 +1,146 @@ +/* + +File: PVRTexture.h +Abstract: The PVRTexture class is responsible for loading .pvr files. + +Version: 1.0 + +Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple Inc. +("Apple") in consideration of your agreement to the following terms, and your +use, installation, modification or redistribution of this Apple software +constitutes acceptance of these terms. If you do not agree with these terms, +please do not use, install, modify or redistribute this Apple software. + +In consideration of your agreement to abide by the following terms, and subject +to these terms, Apple grants you a personal, non-exclusive license, under +Apple's copyrights in this original Apple software (the "Apple Software"), to +use, reproduce, modify and redistribute the Apple Software, with or without +modifications, in source and/or binary forms; provided that if you redistribute +the Apple Software in its entirety and without modifications, you must retain +this notice and the following text and disclaimers in all such redistributions +of the Apple Software. +Neither the name, trademarks, service marks or logos of Apple Inc. may be used +to endorse or promote products derived from the Apple Software without specific +prior written permission from Apple. Except as expressly stated in this notice, +no other rights or licenses, express or implied, are granted by Apple herein, +including but not limited to any patent rights that may be infringed by your +derivative works or by other works in which the Apple Software may be +incorporated. + +The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES NO +WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED +WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION ALONE OR IN +COMBINATION WITH YOUR PRODUCTS. + +IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE +GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR +DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF +CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF +APPLE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Copyright (C) 2008 Apple Inc. All Rights Reserved. + +*/ + +#import + +#import "Platforms/CCGL.h" +#import "CCTexture2D.h" + + +#pragma mark - +#pragma mark CCTexturePVR + +struct CCPVRMipmap { + unsigned char *address; + unsigned int len; +}; + +typedef struct _ccPVRTexturePixelFormatInfo { + GLenum internalFormat; + GLenum format; + GLenum type; + uint32_t bpp; + BOOL compressed; + BOOL alpha; + CCTexture2DPixelFormat ccPixelFormat; +} ccPVRTexturePixelFormatInfo; + +enum { + CC_PVRMIPMAP_MAX = 16, +}; + +/** CCTexturePVR + + Object that loads PVR images. + + Supported PVR formats: + - RGBA8888 + - BGRA8888 + - RGBA4444 + - RGBA5551 + - RGB565 + - A8 + - I8 + - AI88 + - PVRTC 4BPP + - PVRTC 2BPP + + Limitations: + Pre-generated mipmaps, such as PVR textures with mipmap levels embedded in file, + are only supported if all individual sprites are of _square_ size. + To use mipmaps with non-square textures, instead call CCTexture2D#generateMipmap on the sheet texture itself + (and to save space, save the PVR sprite sheet without mip maps included). + */ +@interface CCTexturePVR : NSObject +{ + struct CCPVRMipmap _mipmaps[CC_PVRMIPMAP_MAX]; // pointer to mipmap images + NSUInteger _numberOfMipmaps; // number of mipmap used + + uint32_t _width, _height; + GLuint _name; + BOOL _hasAlpha; + BOOL _hasPremultipliedAlpha; + BOOL _forcePremultipliedAlpha; + + // cocos2d integration + BOOL _retainName; + CCTexture2DPixelFormat _format; + + const ccPVRTexturePixelFormatInfo *_pixelFormatInfo; +} + +/** initializes a CCTexturePVR with a path */ +- (id)initWithContentsOfFile:(NSString *)path; +/** initializes a CCTexturePVR with an URL */ +- (id)initWithContentsOfURL:(NSURL *)url; +/** creates and initializes a CCTexturePVR with a path */ ++ (id)pvrTextureWithContentsOfFile:(NSString *)path; +/** creates and initializes a CCTexturePVR with an URL */ ++ (id)pvrTextureWithContentsOfURL:(NSURL *)url; + +/** texture id name */ +@property (nonatomic,readonly) GLuint name; +/** texture width */ +@property (nonatomic,readonly) uint32_t width; +/** texture height */ +@property (nonatomic,readonly) uint32_t height; +/** whether or not the texture has alpha */ +@property (nonatomic,readonly) BOOL hasAlpha; +/** whether or not the texture has premultiplied alpha */ +@property (nonatomic,readonly) BOOL hasPremultipliedAlpha; +/** whether or not the texture should use hasPremultipliedAlpha instead of global default */ +@property (nonatomic,readonly) BOOL forcePremultipliedAlpha; +/** how many mipmaps the texture has. 1 means one level (level 0 */ +@property (nonatomic, readonly) NSUInteger numberOfMipmaps; + +// cocos2d integration +@property (nonatomic,readwrite) BOOL retainName; +@property (nonatomic,readonly) CCTexture2DPixelFormat format; + +@end + + diff --git a/src/cocos2d/CCTexturePVR.m b/cocos2d/CCTexturePVR.m similarity index 67% rename from src/cocos2d/CCTexturePVR.m rename to cocos2d/CCTexturePVR.m index b1bf3ab..c989395 100644 --- a/src/cocos2d/CCTexturePVR.m +++ b/cocos2d/CCTexturePVR.m @@ -1,49 +1,49 @@ /* - - File: PVRTexture.m - Abstract: The PVRTexture class is responsible for loading .pvr files. - - Version: 1.0 - - Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple Inc. - ("Apple") in consideration of your agreement to the following terms, and your - use, installation, modification or redistribution of this Apple software - constitutes acceptance of these terms. If you do not agree with these terms, - please do not use, install, modify or redistribute this Apple software. - - In consideration of your agreement to abide by the following terms, and subject - to these terms, Apple grants you a personal, non-exclusive license, under - Apple's copyrights in this original Apple software (the "Apple Software"), to - use, reproduce, modify and redistribute the Apple Software, with or without - modifications, in source and/or binary forms; provided that if you redistribute - the Apple Software in its entirety and without modifications, you must retain - this notice and the following text and disclaimers in all such redistributions - of the Apple Software. - Neither the name, trademarks, service marks or logos of Apple Inc. may be used - to endorse or promote products derived from the Apple Software without specific - prior written permission from Apple. Except as expressly stated in this notice, - no other rights or licenses, express or implied, are granted by Apple herein, - including but not limited to any patent rights that may be infringed by your - derivative works or by other works in which the Apple Software may be - incorporated. - - The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES NO - WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED - WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION ALONE OR IN - COMBINATION WITH YOUR PRODUCTS. - - IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR - DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF - CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF - APPLE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - Copyright (C) 2008 Apple Inc. All Rights Reserved. - - */ + +File: PVRTexture.m +Abstract: The PVRTexture class is responsible for loading .pvr files. + +Version: 1.0 + +Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple Inc. +("Apple") in consideration of your agreement to the following terms, and your +use, installation, modification or redistribution of this Apple software +constitutes acceptance of these terms. If you do not agree with these terms, +please do not use, install, modify or redistribute this Apple software. + +In consideration of your agreement to abide by the following terms, and subject +to these terms, Apple grants you a personal, non-exclusive license, under +Apple's copyrights in this original Apple software (the "Apple Software"), to +use, reproduce, modify and redistribute the Apple Software, with or without +modifications, in source and/or binary forms; provided that if you redistribute +the Apple Software in its entirety and without modifications, you must retain +this notice and the following text and disclaimers in all such redistributions +of the Apple Software. +Neither the name, trademarks, service marks or logos of Apple Inc. may be used +to endorse or promote products derived from the Apple Software without specific +prior written permission from Apple. Except as expressly stated in this notice, +no other rights or licenses, express or implied, are granted by Apple herein, +including but not limited to any patent rights that may be infringed by your +derivative works or by other works in which the Apple Software may be +incorporated. + +The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES NO +WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED +WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION ALONE OR IN +COMBINATION WITH YOUR PRODUCTS. + +IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE +GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR +DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF +CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF +APPLE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Copyright (C) 2008 Apple Inc. All Rights Reserved. + +*/ /* * Extended PVR formats for cocos2d project ( http://www.cocos2d-iphone.org ) @@ -114,7 +114,7 @@ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE #endif // #__CC_PLATFORM_IOS }; -struct _pixelformat_hash { +struct _pixel_formathash { uint64_t pixelFormat; const ccPVRTexturePixelFormatInfo * pixelFormatInfo; }; @@ -124,15 +124,19 @@ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE // Values taken from PVRTexture.h from http://www.imgtec.com enum { - kPVRTextureFlagMipmap = (1<<8), // has mip map levels - kPVRTextureFlagTwiddle = (1<<9), // is twiddled - kPVRTextureFlagBumpmap = (1<<10), // has normals encoded for a bump map - kPVRTextureFlagTiling = (1<<11), // is bordered for tiled pvr - kPVRTextureFlagCubemap = (1<<12), // is a cubemap/skybox - kPVRTextureFlagFalseMipCol = (1<<13), // are there false coloured MIP levels - kPVRTextureFlagVolume = (1<<14), // is this a volume texture - kPVRTextureFlagAlpha = (1<<15), // v2.1 is there transparency info in the texture - kPVRTextureFlagVerticalFlip = (1<<16), // v2.1 is the texture vertically flipped + kPVR2TextureFlagMipmap = (1<<8), // has mip map levels + kPVR2TextureFlagTwiddle = (1<<9), // is twiddled + kPVR2TextureFlagBumpmap = (1<<10), // has normals encoded for a bump map + kPVR2TextureFlagTiling = (1<<11), // is bordered for tiled pvr + kPVR2TextureFlagCubemap = (1<<12), // is a cubemap/skybox + kPVR2TextureFlagFalseMipCol = (1<<13), // are there false coloured MIP levels + kPVR2TextureFlagVolume = (1<<14), // is this a volume texture + kPVR2TextureFlagAlpha = (1<<15), // v2.1 is there transparency info in the texture + kPVR2TextureFlagVerticalFlip = (1<<16), // v2.1 is the texture vertically flipped +}; + +enum { + kPVR3TextureFlagPremultipliedAlpha = (1<<1) // has premultiplied alpha }; @@ -176,8 +180,8 @@ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE } ccPVR3TexturePixelFormat; // v2 -static struct _pixelformat_hash v2_pixelformat_hash[] = { - +static struct _pixel_formathash v2_pixel_formathash[] = { + { kPVR2TexturePixelFormat_BGRA_8888, &PVRTableFormats[0] }, { kPVR2TexturePixelFormat_RGBA_8888, &PVRTableFormats[1] }, { kPVR2TexturePixelFormat_RGBA_4444, &PVRTableFormats[2] }, @@ -187,17 +191,17 @@ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE { kPVR2TexturePixelFormat_A_8, &PVRTableFormats[6] }, { kPVR2TexturePixelFormat_I_8, &PVRTableFormats[7] }, { kPVR2TexturePixelFormat_AI_88, &PVRTableFormats[8] }, - + #ifdef __CC_PLATFORM_IOS { kPVR2TexturePixelFormat_PVRTC_2BPP_RGBA, &PVRTableFormats[10] }, { kPVR2TexturePixelFormat_PVRTC_4BPP_RGBA, &PVRTableFormats[12] }, #endif // iphone only }; -#define PVR2_MAX_TABLE_ELEMENTS (sizeof(v2_pixelformat_hash) / sizeof(v2_pixelformat_hash[0])) +#define PVR2_MAX_TABLE_ELEMENTS (sizeof(v2_pixel_formathash) / sizeof(v2_pixel_formathash[0])) // v3 -struct _pixelformat_hash v3_pixelformat_hash[] = { +static struct _pixel_formathash v3_pixel_formathash[] = { {kPVR3TexturePixelFormat_BGRA_8888, &PVRTableFormats[0] }, {kPVR3TexturePixelFormat_RGBA_8888, &PVRTableFormats[1] }, @@ -217,8 +221,10 @@ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE #endif // #__CC_PLATFORM_IOS }; -#define PVR3_MAX_TABLE_ELEMENTS (sizeof(v3_pixelformat_hash) / sizeof(v3_pixelformat_hash[0])) +#define PVR3_MAX_TABLE_ELEMENTS (sizeof(v3_pixel_formathash) / sizeof(v3_pixel_formathash[0])) +#pragma clang diagnostic push COCOS2D +#pragma clang diagnostic ignored "-Wpacked" typedef struct _PVRTexHeader { uint32_t headerLength; @@ -234,7 +240,7 @@ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE uint32_t bitmaskAlpha; uint32_t pvrTag; uint32_t numSurfs; -} ccPVRv2TexHeader; +} __attribute__((packed)) ccPVRv2TexHeader; typedef struct { uint32_t version; @@ -251,74 +257,81 @@ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE uint32_t metadataLength; } __attribute__((packed)) ccPVRv3TexHeader ; +#pragma clang diagnostic pop COCOS2D + @implementation CCTexturePVR -@synthesize name = name_; -@synthesize width = width_; -@synthesize height = height_; -@synthesize hasAlpha = hasAlpha_; -@synthesize numberOfMipmaps = numberOfMipmaps_; +@synthesize name = _name; +@synthesize width = _width; +@synthesize height = _height; +@synthesize hasAlpha = _hasAlpha; +@synthesize hasPremultipliedAlpha = _hasPremultipliedAlpha; +@synthesize forcePremultipliedAlpha = _forcePremultipliedAlpha; +@synthesize numberOfMipmaps = _numberOfMipmaps; // cocos2d integration -@synthesize retainName = retainName_; -@synthesize format = format_; +@synthesize retainName = _retainName; +@synthesize format = _format; - (BOOL)unpackPVRv2Data:(unsigned char*)data PVRLen:(NSUInteger)len { - BOOL success = FALSE; + BOOL success = NO; ccPVRv2TexHeader *header = NULL; + uint32_t flags, pvrTag; uint32_t dataLength = 0, dataOffset = 0, dataSize = 0; uint32_t blockSize = 0, widthBlocks = 0, heightBlocks = 0; uint32_t width = 0, height = 0, bpp = 4; uint8_t *bytes = NULL; uint32_t formatFlags; - + + header = malloc(len * sizeof(ccPVRv2TexHeader)); + memcpy(header, data, len * sizeof(unsigned char)); header = (ccPVRv2TexHeader *)data; - + pvrTag = CFSwapInt32LittleToHost(header->pvrTag); - + if ((uint32_t)gPVRTexIdentifier[0] != ((pvrTag >> 0) & 0xff) || (uint32_t)gPVRTexIdentifier[1] != ((pvrTag >> 8) & 0xff) || (uint32_t)gPVRTexIdentifier[2] != ((pvrTag >> 16) & 0xff) || (uint32_t)gPVRTexIdentifier[3] != ((pvrTag >> 24) & 0xff)) { - return FALSE; + return NO; } - + CCConfiguration *configuration = [CCConfiguration sharedConfiguration]; - + flags = CFSwapInt32LittleToHost(header->flags); formatFlags = flags & PVR_TEXTURE_FLAG_TYPE_MASK; - BOOL flipped = flags & kPVRTextureFlagVerticalFlip; + BOOL flipped = flags & kPVR2TextureFlagVerticalFlip; if( flipped ) CCLOGWARN(@"cocos2d: WARNING: Image is flipped. Regenerate it using PVRTexTool"); - + if( ! [configuration supportsNPOT] && ( header->width != ccNextPOT(header->width) || header->height != ccNextPOT(header->height ) ) ) { CCLOGWARN(@"cocos2d: ERROR: Loding an NPOT texture (%dx%d) but is not supported on this device", header->width, header->height); - return FALSE; + return NO; } - + for( NSUInteger i=0; i < (unsigned int)PVR2_MAX_TABLE_ELEMENTS ; i++) { - if( v2_pixelformat_hash[i].pixelFormat == formatFlags ) { - - _pixelFormatInfo = v2_pixelformat_hash[i].pixelFormatInfo; - numberOfMipmaps_ = 0; - - width_ = width = CFSwapInt32LittleToHost(header->width); - height_ = height = CFSwapInt32LittleToHost(header->height); - + if( v2_pixel_formathash[i].pixelFormat == formatFlags ) { + + _pixelFormatInfo = v2_pixel_formathash[i].pixelFormatInfo; + _numberOfMipmaps = 0; + + _width = width = CFSwapInt32LittleToHost(header->width); + _height = height = CFSwapInt32LittleToHost(header->height); + if (CFSwapInt32LittleToHost(header->bitmaskAlpha)) - hasAlpha_ = TRUE; + _hasAlpha = YES; else - hasAlpha_ = FALSE; - + _hasAlpha = NO; + dataLength = CFSwapInt32LittleToHost(header->dataLength); bytes = ((uint8_t *)data) + sizeof(ccPVRv2TexHeader); - format_ = _pixelFormatInfo->ccPixelFormat; + _format = _pixelFormatInfo->ccPixelFormat; bpp = _pixelFormatInfo->bpp; - + // Calculate the data size for each texture level and respect the minimum number of blocks while (dataOffset < dataLength) { @@ -336,7 +349,7 @@ - (BOOL)unpackPVRv2Data:(unsigned char*)data PVRLen:(NSUInteger)len case kPVR2TexturePixelFormat_BGRA_8888: if( ! [[CCConfiguration sharedConfiguration] supportsBGRA8888] ) { CCLOG(@"cocos2d: TexturePVR. BGRA8888 not supported on this device"); - return FALSE; + return NO; } default: blockSize = 1; @@ -344,44 +357,44 @@ - (BOOL)unpackPVRv2Data:(unsigned char*)data PVRLen:(NSUInteger)len heightBlocks = height; break; } - + // Clamp to minimum number of blocks if (widthBlocks < 2) widthBlocks = 2; if (heightBlocks < 2) heightBlocks = 2; - + dataSize = widthBlocks * heightBlocks * ((blockSize * bpp) / 8); unsigned int packetLength = (dataLength-dataOffset); packetLength = packetLength > dataSize ? dataSize : packetLength; - - mipmaps_[numberOfMipmaps_].address = bytes+dataOffset; - mipmaps_[numberOfMipmaps_].len = packetLength; - numberOfMipmaps_++; - - NSAssert( numberOfMipmaps_ < CC_PVRMIPMAP_MAX, @"TexturePVR: Maximum number of mimpaps reached. Increate the CC_PVRMIPMAP_MAX value"); - + + _mipmaps[_numberOfMipmaps].address = bytes+dataOffset; + _mipmaps[_numberOfMipmaps].len = packetLength; + _numberOfMipmaps++; + + NSAssert( _numberOfMipmaps < CC_PVRMIPMAP_MAX, @"TexturePVR: Maximum number of mimpaps reached. Increate the CC_PVRMIPMAP_MAX value"); + dataOffset += packetLength; - - width = MAX(width >> 1, 1); - height = MAX(height >> 1, 1); + + width = MAX(width >> 1, (uint32_t)1); + height = MAX(height >> 1, (uint32_t)1); } - - success = TRUE; + + success = YES; break; } } - + if( ! success ) CCLOGWARN(@"cocos2d: WARNING: Unsupported PVR Pixel Format: 0x%2x. Re-encode it with a OpenGL pixel format variant", formatFlags); - + return success; } - (BOOL)unpackPVRv3Data:(unsigned char*)dataPointer PVRLen:(NSUInteger)dataLength { if(dataLength < sizeof(ccPVRv3TexHeader)) { - return FALSE; + return NO; } ccPVRv3TexHeader *header = (ccPVRv3TexHeader *)dataPointer; @@ -389,19 +402,19 @@ - (BOOL)unpackPVRv3Data:(unsigned char*)dataPointer PVRLen:(NSUInteger)dataLengt // validate version if(CFSwapInt32BigToHost(header->version) != 0x50565203) { CCLOG(@"cocos2d: WARNING: pvr file version mismatch"); - return FALSE; + return NO; } // parse pixel format uint64_t pixelFormat = header->pixelFormat; - + BOOL infoValid = NO; - for(int i = 0; i < PVR3_MAX_TABLE_ELEMENTS; i++) { - if( v3_pixelformat_hash[i].pixelFormat == pixelFormat ) { - _pixelFormatInfo = v3_pixelformat_hash[i].pixelFormatInfo; - hasAlpha_ = _pixelFormatInfo->alpha; + for(unsigned long i = 0; i < PVR3_MAX_TABLE_ELEMENTS; i++) { + if( v3_pixel_formathash[i].pixelFormat == pixelFormat ) { + _pixelFormatInfo = v3_pixel_formathash[i].pixelFormatInfo; + _hasAlpha = _pixelFormatInfo->alpha; infoValid = YES; break; } @@ -409,15 +422,24 @@ - (BOOL)unpackPVRv3Data:(unsigned char*)dataPointer PVRLen:(NSUInteger)dataLengt // unsupported / bad pixel format if(!infoValid) { - CCLOG(@"cocos2d: WARNING: unsupported pvr pixelformat: %x", pixelFormat ); - return FALSE; + CCLOG(@"cocos2d: WARNING: unsupported pvr pixelformat: %llx", pixelFormat ); + return NO; } - + + // flags + uint32_t flags = CFSwapInt32LittleToHost(header->flags); + + // PVRv3 specifies premultiply alpha in a flag -- should always respect this in PVRv3 files + _forcePremultipliedAlpha = YES; + if(flags & kPVR3TextureFlagPremultipliedAlpha) { + _hasPremultipliedAlpha = YES; + } + // sizing uint32_t width = CFSwapInt32LittleToHost(header->width); uint32_t height = CFSwapInt32LittleToHost(header->height); - width_ = width; - height_ = height; + _width = width; + _height = height; uint32_t dataOffset = 0, dataSize = 0; uint32_t blockSize = 0, widthBlocks = 0, heightBlocks = 0; uint8_t *bytes = NULL; @@ -425,10 +447,10 @@ - (BOOL)unpackPVRv3Data:(unsigned char*)dataPointer PVRLen:(NSUInteger)dataLengt dataOffset = (sizeof(ccPVRv3TexHeader) + header->metadataLength); bytes = dataPointer; - numberOfMipmaps_ = header->numberOfMipmaps; - NSAssert( numberOfMipmaps_ < CC_PVRMIPMAP_MAX, @"TexturePVR: Maximum number of mimpaps reached. Increate the CC_PVRMIPMAP_MAX value"); - - for(int i = 0; i < numberOfMipmaps_; i++) { + _numberOfMipmaps = header->numberOfMipmaps; + NSAssert( _numberOfMipmaps < CC_PVRMIPMAP_MAX, @"TexturePVR: Maximum number of mimpaps reached. Increate the CC_PVRMIPMAP_MAX value"); + + for(NSUInteger i = 0; i < _numberOfMipmaps; i++) { switch(pixelFormat) { case kPVR3TexturePixelFormat_PVRTC_2BPP_RGB : @@ -446,7 +468,7 @@ - (BOOL)unpackPVRv3Data:(unsigned char*)dataPointer PVRLen:(NSUInteger)dataLengt case kPVR3TexturePixelFormat_BGRA_8888: if( ! [[CCConfiguration sharedConfiguration] supportsBGRA8888] ) { CCLOG(@"cocos2d: TexturePVR. BGRA8888 not supported on this device"); - return FALSE; + return NO; } default: blockSize = 1; @@ -454,7 +476,7 @@ - (BOOL)unpackPVRv3Data:(unsigned char*)dataPointer PVRLen:(NSUInteger)dataLengt heightBlocks = height; break; } - + // Clamp to minimum number of blocks if (widthBlocks < 2) widthBlocks = 2; @@ -462,43 +484,43 @@ - (BOOL)unpackPVRv3Data:(unsigned char*)dataPointer PVRLen:(NSUInteger)dataLengt heightBlocks = 2; dataSize = widthBlocks * heightBlocks * ((blockSize * _pixelFormatInfo->bpp) / 8); - unsigned int packetLength = (dataLength-dataOffset); + unsigned int packetLength = ((unsigned int)dataLength-dataOffset); packetLength = packetLength > dataSize ? dataSize : packetLength; - mipmaps_[i].address = bytes+dataOffset; - mipmaps_[i].len = packetLength; + _mipmaps[i].address = bytes+dataOffset; + _mipmaps[i].len = packetLength; dataOffset += packetLength; - NSAssert( dataOffset <= dataLength, @"CCTexurePVR: Invalid lenght"); + NSAssert( dataOffset <= dataLength, @"CCTexurePVR: Invalid length"); - width = MAX(width >> 1, 1); - height = MAX(height >> 1, 1); + width = MAX(width >> 1, (uint32_t)1); + height = MAX(height >> 1, (uint32_t)1); } - return TRUE; + return YES; } - (BOOL)createGLTexture { - GLsizei width = width_; - GLsizei height = height_; + GLsizei width = _width; + GLsizei height = _height; GLenum err; - - if (numberOfMipmaps_ > 0) + + if (_numberOfMipmaps > 0) { - if (name_ != 0) - ccGLDeleteTexture( name_ ); - + if (_name != 0) + ccGLDeleteTexture( _name ); + // From PVR sources: "PVR files are never row aligned." glPixelStorei(GL_UNPACK_ALIGNMENT,1); - - glGenTextures(1, &name_); - ccGLBindTexture2D( name_ ); - + + glGenTextures(1, &_name); + ccGLBindTexture2D( _name ); + // Default: Anti alias. - if( numberOfMipmaps_ == 1 ) + if( _numberOfMipmaps == 1 ) glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR ); else glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_NEAREST ); @@ -509,43 +531,44 @@ - (BOOL)createGLTexture } CHECK_GL_ERROR(); // clean possible GL error - + GLenum internalFormat = _pixelFormatInfo->internalFormat; GLenum format = _pixelFormatInfo->format; GLenum type = _pixelFormatInfo->type; BOOL compressed = _pixelFormatInfo->compressed; - + + NSAssert(_numberOfMipmaps < INT_MAX, @"Invalid int"); // Generate textures with mipmaps - for (GLint i=0; i < numberOfMipmaps_; i++) + for (GLint i=0; i < (GLint)_numberOfMipmaps; i++) { if( compressed && ! [[CCConfiguration sharedConfiguration] supportsPVRTC] ) { CCLOGWARN(@"cocos2d: WARNING: PVRTC images are not supported"); - return FALSE; + return NO; } - - unsigned char *data = mipmaps_[i].address; - unsigned int datalen = mipmaps_[i].len; - + + unsigned char *data = _mipmaps[i].address; + GLsizei datalen = _mipmaps[i].len; + if( compressed) glCompressedTexImage2D(GL_TEXTURE_2D, i, internalFormat, width, height, 0, datalen, data); else glTexImage2D(GL_TEXTURE_2D, i, internalFormat, width, height, 0, format, type, data); - - if( i > 0 && (width != height || ccNextPOT(width) != width ) ) + + if( i > 0 && (width != height || ccNextPOT(width) != (unsigned long)width ) ) CCLOGWARN(@"cocos2d: TexturePVR. WARNING. Mipmap level %u is not squared. Texture won't render correctly. width=%u != height=%u", i, width, height); - + err = glGetError(); if (err != GL_NO_ERROR) { CCLOGWARN(@"cocos2d: TexturePVR: Error uploading compressed texture level: %u . glError: 0x%04X", i, err); - return FALSE; + return NO; } - + width = MAX(width >> 1, 1); height = MAX(height >> 1, 1); } - return TRUE; + return YES; } @@ -556,47 +579,42 @@ - (id)initWithContentsOfFile:(NSString *)path unsigned char *pvrdata = NULL; NSInteger pvrlen = 0; NSString *lowerCase = [path lowercaseString]; - + if ( [lowerCase hasSuffix:@".ccz"]) pvrlen = ccInflateCCZFile( [path UTF8String], &pvrdata ); - + else if( [lowerCase hasSuffix:@".gz"] ) pvrlen = ccInflateGZipFile( [path UTF8String], &pvrdata ); - + else pvrlen = ccLoadFileIntoMemory( [path UTF8String], &pvrdata ); - + if( pvrlen < 0 ) { - [self release]; return nil; } - - - numberOfMipmaps_ = 0; - - name_ = 0; - width_ = height_ = 0; - hasAlpha_ = FALSE; + + + _numberOfMipmaps = 0; + + _name = 0; + _width = _height = 0; + _hasAlpha = NO; + _hasPremultipliedAlpha = NO; + _forcePremultipliedAlpha = NO; _pixelFormatInfo = NULL; - - retainName_ = NO; // cocos2d integration - BOOL ok = YES; + + _retainName = NO; // cocos2d integration - ok = [self unpackPVRv2Data:pvrdata PVRLen:pvrlen]; - if( ! ok ) - ok = [self unpackPVRv3Data:pvrdata PVRLen:pvrlen]; - - if( ok ) - ok = [self createGLTexture]; - if( ! ok ) { + if( ! (([self unpackPVRv2Data:pvrdata PVRLen:pvrlen] || [self unpackPVRv3Data:pvrdata PVRLen:pvrlen]) && + [self createGLTexture] ) ) + { free(pvrdata); - [self release]; return nil; } #if defined(__CC_PLATFORM_IOS) && defined(DEBUG) - + GLenum pixelFormat = _pixelFormatInfo->ccPixelFormat; CCConfiguration *conf = [CCConfiguration sharedConfiguration]; @@ -611,12 +629,12 @@ - (id)initWithContentsOfFile:(NSString *)path printf("\n"); NSLog(@"cocos2d: WARNING. Using RGB888 texture. Convert it to RGB565 or RGBA8888 in order to reduce memory"); NSLog(@"cocos2d: WARNING: File: %@", [path lastPathComponent] ); - NSLog(@"cocos2d: WARNING: For furhter info visit: http://www.cocos2d-iphone.org/forum/topic/31092"); + NSLog(@"cocos2d: WARNING: For further info visit: http://www.cocos2d-iphone.org/forum/topic/31092"); printf("\n"); } - + - else if( width_ != ccNextPOT(width_) ) { + else if( _width != ccNextPOT(_width) ) { // XXX: Is this applicable for compressed textures ? // Since they are squared and POT (PVRv2) it is not an issue now. Not sure in the future. @@ -625,32 +643,32 @@ - (id)initWithContentsOfFile:(NSString *)path // If width is not word aligned, then log warning. // http://www.cocos2d-iphone.org/forum/topic/31092 - + NSUInteger bpp = [CCTexture2D bitsPerPixelForFormat:pixelFormat]; - NSUInteger bytes = width_ * bpp / 8; - + NSUInteger bytes = _width * bpp / 8; + // XXX: Should it be 4 or sizeof(int) ?? NSUInteger mod = bytes % 4; // Not word aligned ? if( mod != 0 ) { - + NSUInteger neededBytes = (4 - mod ) / (bpp/8); printf("\n"); - NSLog(@"cocos2d: WARNING. Current texture size=(%d,%d). Convert it to size=(%d,%d) in order to save memory", width_, height_, width_ + neededBytes, height_ ); + NSLog(@"cocos2d: WARNING. Current texture size=(%d,%d). Convert it to size=(%d,%d) in order to save memory", _width, _height, _width + neededBytes, _height ); NSLog(@"cocos2d: WARNING: File: %@", [path lastPathComponent] ); - NSLog(@"cocos2d: WARNING: For furhter info visit: http://www.cocos2d-iphone.org/forum/topic/31092"); + NSLog(@"cocos2d: WARNING: For further info visit: http://www.cocos2d-iphone.org/forum/topic/31092"); printf("\n"); } } } #endif // iOS - - + + free(pvrdata); } - + return self; } @@ -659,17 +677,16 @@ - (id)initWithContentsOfURL:(NSURL *)url if (![url isFileURL]) { CCLOG(@"cocos2d: CCPVRTexture: Only files are supported"); - [self release]; return nil; } - + return [self initWithContentsOfFile:[url path]]; } + (id)pvrTextureWithContentsOfFile:(NSString *)path { - return [[[self alloc] initWithContentsOfFile:path] autorelease]; + return [[self alloc] initWithContentsOfFile:path]; } @@ -677,7 +694,7 @@ + (id)pvrTextureWithContentsOfURL:(NSURL *)url { if (![url isFileURL]) return nil; - + return [CCTexturePVR pvrTextureWithContentsOfFile:[url path]]; } @@ -685,11 +702,10 @@ + (id)pvrTextureWithContentsOfURL:(NSURL *)url - (void)dealloc { CCLOGINFO( @"cocos2d: deallocing %@", self); - - if (name_ != 0 && ! retainName_ ) - ccGLDeleteTexture( name_ ); - - [super dealloc]; + + if (_name != 0 && ! _retainName ) + ccGLDeleteTexture( _name ); + } @end diff --git a/cocos2d/CCTileMapAtlas.h b/cocos2d/CCTileMapAtlas.h new file mode 100644 index 0000000..8033cf3 --- /dev/null +++ b/cocos2d/CCTileMapAtlas.h @@ -0,0 +1,83 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2008-2010 Ricardo Quesada + * Copyright (c) 2011 Zynga Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + */ + +#import "CCTextureAtlas.h" +#import "CCAtlasNode.h" +#import "Support/TGAlib.h" + +/** CCTileMapAtlas is a subclass of CCAtlasNode. + + It knows how to render a map based of tiles. + The tiles must be in a .PNG format while the map must be a .TGA file. + + For more information regarding the format, please see this post: + http://www.cocos2d-iphone.org/archives/27 + + All features from CCAtlasNode are valid in CCTileMapAtlas + + IMPORTANT: + This class is deprecated. It is maintained for compatibility reasons only. + You SHOULD not use this class. + Instead, use the newer TMX file format: CCTMXTiledMap + */ +@interface CCTileMapAtlas : CCAtlasNode +{ + + /// info about the map file + tImageTGA *_tgaInfo; + + /// x,y to altas dictionary + NSMutableDictionary *_posToAtlasIndex; + + /// numbers of tiles to render + int _itemsToRender; +} + +/** TileMap info */ +@property (nonatomic,readonly) tImageTGA *tgaInfo; + +/** creates a CCTileMap with a tile file (atlas) with a map file and the width and height of each tile in points. + The tile file will be loaded using the TextureMgr. + */ ++(id) tileMapAtlasWithTileFile:(NSString*)tile mapFile:(NSString*)map tileWidth:(int)w tileHeight:(int)h; + +/** initializes a CCTileMap with a tile file (atlas) with a map file and the width and height of each tile in points. + The file will be loaded using the TextureMgr. + */ +-(id) initWithTileFile:(NSString*)tile mapFile:(NSString*)map tileWidth:(int)w tileHeight:(int)h; + +/** returns a tile from position x,y. + For the moment only channel R is used + */ +-(ccColor3B) tileAt: (CGPoint) position; + +/** sets a tile at position x,y. + For the moment only channel R is used + */ +-(void) setTile:(ccColor3B)tile at:(CGPoint)position; +/** dealloc the map from memory */ +-(void) releaseMap; +@end diff --git a/src/cocos2d/CCTileMapAtlas.m b/cocos2d/CCTileMapAtlas.m similarity index 55% rename from src/cocos2d/CCTileMapAtlas.m rename to cocos2d/CCTileMapAtlas.m index 30168a8..aa5cdef 100644 --- a/src/cocos2d/CCTileMapAtlas.m +++ b/cocos2d/CCTileMapAtlas.m @@ -28,22 +28,23 @@ #import "CCTileMapAtlas.h" #import "ccMacros.h" #import "Support/CCFileUtils.h" +#import "Support/CGPointExtension.h" @interface CCTileMapAtlas (Private) -(void) loadTGAfile:(NSString*)file; -(void) calculateItemsToRender; --(void) updateAtlasValueAt:(ccGridSize)pos withValue:(ccColor3B)value withIndex:(NSUInteger)idx; +-(void) updateAtlasValueAt:(CGPoint)pos withValue:(ccColor3B)value withIndex:(NSUInteger)idx; @end @implementation CCTileMapAtlas -@synthesize tgaInfo; +@synthesize tgaInfo=_tgaInfo; #pragma mark CCTileMapAtlas - Creation & Init +(id) tileMapAtlasWithTileFile:(NSString*)tile mapFile:(NSString*)map tileWidth:(int)w tileHeight:(int)h { - return [[[self alloc] initWithTileFile:tile mapFile:map tileWidth:w tileHeight:h] autorelease]; + return [[self alloc] initWithTileFile:tile mapFile:map tileWidth:w tileHeight:h]; } @@ -52,15 +53,13 @@ -(id) initWithTileFile:(NSString*)tile mapFile:(NSString*)map tileWidth:(int)w t [self loadTGAfile: map]; [self calculateItemsToRender]; - if( (self=[super initWithTileFile:tile tileWidth:w tileHeight:h itemsToRender: itemsToRender]) ) { + if( (self=[super initWithTileFile:tile tileWidth:w tileHeight:h itemsToRender: _itemsToRender]) ) { - color_ = ccWHITE; - - posToAtlasIndex = [[NSMutableDictionary dictionaryWithCapacity:itemsToRender] retain]; + _posToAtlasIndex = [NSMutableDictionary dictionaryWithCapacity:_itemsToRender]; [self updateAtlasValues]; - [self setContentSize: CGSizeMake(tgaInfo->width*itemWidth_, tgaInfo->height*itemHeight_)]; + [self setContentSize: CGSizeMake(_tgaInfo->width*_itemWidth, _tgaInfo->height*_itemHeight)]; } return self; @@ -68,36 +67,33 @@ -(id) initWithTileFile:(NSString*)tile mapFile:(NSString*)map tileWidth:(int)w t -(void) dealloc { - if( tgaInfo ) - tgaDestroy(tgaInfo); + if( _tgaInfo ) + tgaDestroy(_tgaInfo); - [posToAtlasIndex release]; - [super dealloc]; } -(void) releaseMap { - if( tgaInfo ) - tgaDestroy(tgaInfo); + if( _tgaInfo ) + tgaDestroy(_tgaInfo); - tgaInfo = nil; + _tgaInfo = nil; - [posToAtlasIndex release]; - posToAtlasIndex = nil; + _posToAtlasIndex = nil; } -(void) calculateItemsToRender { - NSAssert( tgaInfo != nil, @"tgaInfo must be non-nil"); + NSAssert( _tgaInfo != nil, @"tgaInfo must be non-nil"); - itemsToRender = 0; - for(int x = 0;x < tgaInfo->width; x++ ) { - for(int y = 0; y < tgaInfo->height; y++ ) { - ccColor3B *ptr = (ccColor3B*) tgaInfo->imageData; - ccColor3B value = ptr[x + y * tgaInfo->width]; + _itemsToRender = 0; + for(int x = 0;x < _tgaInfo->width; x++ ) { + for(int y = 0; y < _tgaInfo->height; y++ ) { + ccColor3B *ptr = (ccColor3B*) _tgaInfo->imageData; + ccColor3B value = ptr[x + y * _tgaInfo->width]; if( value.r ) - itemsToRender++; + _itemsToRender++; } } } @@ -106,16 +102,16 @@ -(void) loadTGAfile:(NSString*)file { NSAssert( file != nil, @"file must be non-nil"); - NSString *path = [[CCFileUtils sharedFileUtils] fullPathFromRelativePath:file ]; + NSString *path = [[CCFileUtils sharedFileUtils] fullPathForFilename:file ]; // //Find the path of the file // NSBundle *mainBndl = [CCDirector sharedDirector].loadingBundle; // NSString *resourcePath = [mainBndl resourcePath]; // NSString * path = [resourcePath stringByAppendingPathComponent:file]; - tgaInfo = tgaLoad( [path UTF8String] ); + _tgaInfo = tgaLoad( [path UTF8String] ); #if 1 - if( tgaInfo->status != TGA_OK ) + if( _tgaInfo->status != TGA_OK ) [NSException raise:@"TileMapAtlasLoadTGA" format:@"TileMapAtas cannot load TGA file"]; #endif @@ -123,54 +119,54 @@ -(void) loadTGAfile:(NSString*)file #pragma mark CCTileMapAtlas - Atlas generation / updates --(void) setTile:(ccColor3B) tile at:(ccGridSize) pos +-(void) setTile:(ccColor3B) tile at:(CGPoint) pos { - NSAssert( tgaInfo != nil, @"tgaInfo must not be nil"); - NSAssert( posToAtlasIndex != nil, @"posToAtlasIndex must not be nil"); - NSAssert( pos.x < tgaInfo->width, @"Invalid position.x"); - NSAssert( pos.y < tgaInfo->height, @"Invalid position.x"); + NSAssert( _tgaInfo != nil, @"_tgaInfo must not be nil"); + NSAssert( _posToAtlasIndex != nil, @"_posToAtlasIndex must not be nil"); + NSAssert( pos.x < _tgaInfo->width, @"Invalid position.x"); + NSAssert( pos.y < _tgaInfo->height, @"Invalid position.x"); NSAssert( tile.r != 0, @"R component must be non 0"); - ccColor3B *ptr = (ccColor3B*) tgaInfo->imageData; - ccColor3B value = ptr[pos.x + pos.y * tgaInfo->width]; + ccColor3B *ptr = (ccColor3B*) _tgaInfo->imageData; + ccColor3B value = ptr[(NSUInteger)(pos.x + pos.y * _tgaInfo->width)]; if( value.r == 0 ) CCLOG(@"cocos2d: Value.r must be non 0."); else { - ptr[pos.x + pos.y * tgaInfo->width] = tile; + ptr[(NSUInteger)(pos.x + pos.y * _tgaInfo->width)] = tile; // XXX: this method consumes a lot of memory // XXX: a tree of something like that shall be impolemented - NSNumber *num = [posToAtlasIndex objectForKey: [NSString stringWithFormat:@"%ld,%ld", (long)pos.x, (long)pos.y]]; + NSNumber *num = [_posToAtlasIndex objectForKey: [NSString stringWithFormat:@"%ld,%ld", (long)pos.x, (long)pos.y]]; [self updateAtlasValueAt:pos withValue:tile withIndex: [num integerValue]]; } } --(ccColor3B) tileAt:(ccGridSize) pos +-(ccColor3B) tileAt:(CGPoint) pos { - NSAssert( tgaInfo != nil, @"tgaInfo must not be nil"); - NSAssert( pos.x < tgaInfo->width, @"Invalid position.x"); - NSAssert( pos.y < tgaInfo->height, @"Invalid position.y"); + NSAssert( _tgaInfo != nil, @"_tgaInfo must not be nil"); + NSAssert( pos.x < _tgaInfo->width, @"Invalid position.x"); + NSAssert( pos.y < _tgaInfo->height, @"Invalid position.y"); - ccColor3B *ptr = (ccColor3B*) tgaInfo->imageData; - ccColor3B value = ptr[pos.x + pos.y * tgaInfo->width]; + ccColor3B *ptr = (ccColor3B*) _tgaInfo->imageData; + ccColor3B value = ptr[(NSUInteger)(pos.x + pos.y * _tgaInfo->width)]; return value; } --(void) updateAtlasValueAt:(ccGridSize)pos withValue:(ccColor3B)value withIndex:(NSUInteger)idx +-(void) updateAtlasValueAt:(CGPoint)pos withValue:(ccColor3B)value withIndex:(NSUInteger)idx { ccV3F_C4B_T2F_Quad quad; NSInteger x = pos.x; NSInteger y = pos.y; - float row = (value.r % itemsPerRow_); - float col = (value.r / itemsPerRow_); + float row = (value.r % _itemsPerRow); + float col = (value.r / _itemsPerRow); - float textureWide = [[textureAtlas_ texture] pixelsWide]; - float textureHigh = [[textureAtlas_ texture] pixelsHigh]; + float textureWide = [[_textureAtlas texture] pixelsWide]; + float textureHigh = [[_textureAtlas texture] pixelsHigh]; - float itemWidthInPixels = itemWidth_ * CC_CONTENT_SCALE_FACTOR(); - float itemHeightInPixels = itemHeight_ * CC_CONTENT_SCALE_FACTOR(); + float itemWidthInPixels = _itemWidth * CC_CONTENT_SCALE_FACTOR(); + float itemHeightInPixels = _itemHeight * CC_CONTENT_SCALE_FACTOR(); #if CC_FIX_ARTIFACTS_BY_STRECHING_TEXEL @@ -195,46 +191,46 @@ -(void) updateAtlasValueAt:(ccGridSize)pos withValue:(ccColor3B)value withIndex: quad.br.texCoords.u = right; quad.br.texCoords.v = bottom; - quad.bl.vertices.x = (int) (x * itemWidth_); - quad.bl.vertices.y = (int) (y * itemHeight_); + quad.bl.vertices.x = (int) (x * _itemWidth); + quad.bl.vertices.y = (int) (y * _itemHeight); quad.bl.vertices.z = 0.0f; - quad.br.vertices.x = (int)(x * itemWidth_ + itemWidth_); - quad.br.vertices.y = (int)(y * itemHeight_); + quad.br.vertices.x = (int)(x * _itemWidth + _itemWidth); + quad.br.vertices.y = (int)(y * _itemHeight); quad.br.vertices.z = 0.0f; - quad.tl.vertices.x = (int)(x * itemWidth_); - quad.tl.vertices.y = (int)(y * itemHeight_ + itemHeight_); + quad.tl.vertices.x = (int)(x * _itemWidth); + quad.tl.vertices.y = (int)(y * _itemHeight + _itemHeight); quad.tl.vertices.z = 0.0f; - quad.tr.vertices.x = (int)(x * itemWidth_ + itemWidth_); - quad.tr.vertices.y = (int)(y * itemHeight_ + itemHeight_); + quad.tr.vertices.x = (int)(x * _itemWidth + _itemWidth); + quad.tr.vertices.y = (int)(y * _itemHeight + _itemHeight); quad.tr.vertices.z = 0.0f; - ccColor4B color = { color_.r, color_.g, color_.b, opacity_ }; + ccColor4B color = { _displayedColor.r, _displayedColor.g, _displayedColor.b, _displayedOpacity }; quad.tr.colors = color; quad.tl.colors = color; quad.br.colors = color; quad.bl.colors = color; - [textureAtlas_ updateQuad:&quad atIndex:idx]; + [_textureAtlas updateQuad:&quad atIndex:idx]; } -(void) updateAtlasValues { - NSAssert( tgaInfo != nil, @"tgaInfo must be non-nil"); + NSAssert( _tgaInfo != nil, @"_tgaInfo must be non-nil"); int total = 0; - for(int x = 0;x < tgaInfo->width; x++ ) { - for(int y = 0; y < tgaInfo->height; y++ ) { - if( total < itemsToRender ) { - ccColor3B *ptr = (ccColor3B*) tgaInfo->imageData; - ccColor3B value = ptr[x + y * tgaInfo->width]; + for(int x = 0;x < _tgaInfo->width; x++ ) { + for(int y = 0; y < _tgaInfo->height; y++ ) { + if( total < _itemsToRender ) { + ccColor3B *ptr = (ccColor3B*) _tgaInfo->imageData; + ccColor3B value = ptr[x + y * _tgaInfo->width]; if( value.r != 0 ) { - [self updateAtlasValueAt:ccg(x,y) withValue:value withIndex:total]; + [self updateAtlasValueAt:ccp(x,y) withValue:value withIndex:total]; NSString *key = [NSString stringWithFormat:@"%d,%d", x,y]; NSNumber *num = [NSNumber numberWithInt:total]; - [posToAtlasIndex setObject:num forKey:key]; + [_posToAtlasIndex setObject:num forKey:key]; total++; } diff --git a/cocos2d/CCTransition.h b/cocos2d/CCTransition.h new file mode 100644 index 0000000..3b572ce --- /dev/null +++ b/cocos2d/CCTransition.h @@ -0,0 +1,109 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2008-2010 Ricardo Quesada + * Copyright (c) 2011 Zynga Inc. + * Copyright (c) 2013 Lars Birkemose + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + */ + +#import +#import "cocos2d.h" +#import "CCScene.h" + +// ----------------------------------------------------------------- + +typedef NS_ENUM(NSInteger, CCTransitionDirection) +{ + CCTransitionDirectionUp, + CCTransitionDirectionDown, + CCTransitionDirectionRight, + CCTransitionDirectionLeft, + CCTransitionDirectionInvalid = -1, +}; + +// ----------------------------------------------------------------- + +@interface CCTransition : CCScene + +// ----------------------------------------------------------------- + +/** + * Will downscale incoming and outgoing scene + * Can be used as an effect, or to decrease render time on complex scenes + * Default 1.0 + */ +@property (nonatomic, assign) float outgoingDownScale; +@property (nonatomic, assign) float incomingDownScale; + +/** + * Transition will be performed in retina resolution + * Will force outgoingDownScale and incomingDownScale to 1.0 on non retina devices, and 2.0 on retina devices if not set + * Default YES + */ +@property (nonatomic, getter = isRetinaTransition) BOOL retinaTransition; + +/** + * Pixel format used for transition + * Default kCCTexture2DPixelFormat_RGB565 + */ +@property (nonatomic, assign) CCTexture2DPixelFormat transitionPixelFormat; + +/** + * Defines whether incoming and outgoing scene will be animated during transition + * Default NO + */ +@property (nonatomic, getter = isOutgoingSceneAnimated) BOOL outgoingSceneAnimated; +@property (nonatomic, getter = isIncomingSceneAnimated) BOOL incomingSceneAnimated; + +/** + * The actual transition runtime in seconds + */ +@property (nonatomic, readonly) NSTimeInterval runTime; + +/** + * Normalized transition progress + */ +@property (nonatomic, readonly) float progress; + +// ----------------------------------------------------------------- + +/** + * Creates a cross fade transition + * + * @param duration The duration of the transition in seconds + * @return A CCTransition + */ ++ (CCTransition *)crossFadeWithDuration:(NSTimeInterval)duration; + ++ (CCTransition *)fadeWithColor:(ccColor3B)color duration:(NSTimeInterval)duration; + ++ (CCTransition *)fadeWithDuration:(NSTimeInterval)duration; + ++ (CCTransition *)moveInWithDirection:(CCTransitionDirection)direction duration:(NSTimeInterval)duration; + ++ (CCTransition *)pushWithDirection:(CCTransitionDirection)direction duration:(NSTimeInterval)duration; + ++ (CCTransition *)revealWithDirection:(CCTransitionDirection)direction duration:(NSTimeInterval)duration; + +// ----------------------------------------------------------------- + +@end diff --git a/cocos2d/CCTransition.m b/cocos2d/CCTransition.m new file mode 100644 index 0000000..d902fa5 --- /dev/null +++ b/cocos2d/CCTransition.m @@ -0,0 +1,391 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2008-2010 Ricardo Quesada + * Copyright (c) 2011 Zynga Inc. + * Copyright (c) 2013 Lars Birkemose + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + */ + +#import "CCTransition.h" + +// ----------------------------------------------------------------- + +static const float CCTransitionDownScaleMin = 1.0f; // range for transition downscales +static const float CCTransitionDownScaleRetina = 2.0f; +static const float CCTransitionDownScaleMax = 128.0f; + +typedef NS_ENUM(NSInteger, CCTransitionFixedFunction) +{ + CCTransitionFixedFunctionCrossFade, + CCTransitionFixedFunctionFadeWithColor, + CCTransitionFixedFunctionMoveIn, + CCTransitionFixedFunctionPush, + CCTransitionFixedFunctionReveal, +}; + +// ----------------------------------------------------------------- + +@implementation CCTransition +{ + NSTimeInterval _duration; + __strong CCScene *_incomingScene; + __strong CCScene *_outgoingScene; + CCRenderTexture *_incomingTexture; + CCRenderTexture *_outgoingTexture; + // + CCTransitionFixedFunction _fixedFunction; + CCTransitionDirection _direction; + ccColor4F _color; + SEL _drawSelector; + BOOL _outgoingOverIncoming; + CGPoint _outgoingDestination; +} + +// ----------------------------------------------------------------- + ++ (CCTransition *)crossFadeWithDuration:(NSTimeInterval)duration +{ + return([[self alloc] initWithDuration:duration fixedFunction:CCTransitionFixedFunctionCrossFade direction:CCTransitionDirectionInvalid color:ccBLACK]); +} + ++ (CCTransition *)fadeWithColor:(ccColor3B)color duration:(NSTimeInterval)duration +{ + return([[self alloc] initWithDuration:duration fixedFunction:CCTransitionFixedFunctionFadeWithColor direction:CCTransitionDirectionInvalid color:color]); +} + ++ (CCTransition *)fadeWithDuration:(NSTimeInterval)duration +{ + return([[self alloc] initWithDuration:duration fixedFunction:CCTransitionFixedFunctionFadeWithColor direction:CCTransitionDirectionInvalid color:ccBLACK]); +} + ++ (CCTransition *)moveInWithDirection:(CCTransitionDirection)direction duration:(NSTimeInterval)duration +{ + return([[self alloc] initWithDuration:duration fixedFunction:CCTransitionFixedFunctionMoveIn direction:direction color:ccBLACK]); +} + ++ (CCTransition *)pushWithDirection:(CCTransitionDirection)direction duration:(NSTimeInterval)duration +{ + return([[self alloc] initWithDuration:duration fixedFunction:CCTransitionFixedFunctionPush direction:direction color:ccBLACK]); +} + ++ (CCTransition *)revealWithDirection:(CCTransitionDirection)direction duration:(NSTimeInterval)duration +{ + return([[self alloc] initWithDuration:duration fixedFunction:CCTransitionFixedFunctionReveal direction:direction color:ccBLACK]); +} + +// ----------------------------------------------------------------- + +- (id)initWithDuration:(NSTimeInterval)duration + fixedFunction:(CCTransitionFixedFunction)function + direction:(CCTransitionDirection)direction + color:(ccColor3B)color +{ + self = [self initWithDuration:duration]; + + // set up fixed function transition + _fixedFunction = function; + _direction = direction; + _color = (ccColor4F){(float)color.r / 255, (float)color.g / 255, (float)color.b / 255, 1}; + _drawSelector = @selector(drawFixedFunction); + _outgoingOverIncoming = NO; + + // find out where the outgoing scene will end (if it is a transition with movement) + CGSize size = [CCDirector sharedDirector].winSize; + switch (direction) { + case CCTransitionDirectionDown: + { + _outgoingDestination = CGPointMake(0, -size.height); + break; + } + case CCTransitionDirectionLeft: + { + _outgoingDestination = CGPointMake(-size.width, 0); + break; + } + case CCTransitionDirectionRight: + { + _outgoingDestination = CGPointMake(size.width, 0); + break; + } + case CCTransitionDirectionUp: + { + _outgoingDestination = CGPointMake(0, size.height); + break; + } + case CCTransitionDirectionInvalid: + { + _outgoingDestination = CGPointZero; + break; + } + } + + // start actions to move sprites into position (will not start until scene is started by director) + switch (_fixedFunction) { + case CCTransitionFixedFunctionCrossFade: + case CCTransitionFixedFunctionFadeWithColor: + break; + case CCTransitionFixedFunctionReveal: + _outgoingOverIncoming = YES; + break; + case CCTransitionFixedFunctionMoveIn: + case CCTransitionFixedFunctionPush: + break; + } + + // done + return(self); +} + +- (id)initWithDuration:(NSTimeInterval)duration +{ + self = [super init]; + NSAssert(self, @"Unable to create class"); + NSAssert(duration > 0,@"Invalid duration"); + + // initialize + _incomingScene = nil; + _outgoingScene = nil; + _duration = duration; + + _incomingDownScale = CCTransitionDownScaleMin; + _outgoingDownScale = CCTransitionDownScaleMin; + + _incomingSceneAnimated = NO; + _outgoingSceneAnimated = NO; + + _incomingTexture = nil; + _outgoingTexture = nil; + + // reset internal data + _runTime = 0.0f; + _progress = 0.0f; + + _transitionPixelFormat = kCCTexture2DPixelFormat_RGB565; + + // disable touch during transition + self.userInteractionEnabled = NO; + + // done + return(self); +} + +// ----------------------------------------------------------------- + +- (void)replaceScene:(CCScene *)scene +{ + _incomingScene = scene; + [_incomingScene onEnter]; + _outgoingScene = [CCDirector sharedDirector].runningScene; + [_outgoingScene onExitTransitionDidStart]; + + // create render textures + // get viewport size + CGSize size = [CCDirector sharedDirector].winSize; + + // create texture for outgoing scene + _outgoingTexture = [CCRenderTexture renderTextureWithWidth:size.width / _outgoingDownScale + height:size.height / _outgoingDownScale + pixelFormat:_transitionPixelFormat]; + _outgoingTexture.position = CGPointMake(size.width * 0.5f, size.height * 0.5f); + _outgoingTexture.scale = _outgoingDownScale; + [self addChild:_outgoingTexture z:_outgoingOverIncoming]; + + // create texture for incoming scene + _incomingTexture = [CCRenderTexture renderTextureWithWidth:size.width / _incomingDownScale + height:size.height / _incomingDownScale + pixelFormat:_transitionPixelFormat]; + _incomingTexture.position = CGPointMake(size.width * 0.5f, size.height * 0.5f); + _incomingTexture.scale = _incomingDownScale; + [self addChild:_incomingTexture]; + + // make sure scene is rendered at least once at progress 0.0 + [self renderOutgoing:0]; + [self renderIncoming:0]; + + // switch to transition scene + [[CCDirector sharedDirector] replaceScene:self]; +} + +// ----------------------------------------------------------------- + +- (void)dealloc +{ + // clean up if needed + +} + +// ----------------------------------------------------------------- + +- (void)onEnter +{ + [super onEnter]; + // shedule update for transition + [self scheduleUpdate]; +} + +- (void)onExit +{ + // clean up + [self unscheduleUpdate]; + [super onExit]; +} + +// ----------------------------------------------------------------- + +- (void)update:(ccTime)delta +{ + // update progress + _runTime += delta; + _progress = clampf(_runTime / _duration, 0.0f, 1.0f); + + // check for runtime expired + if (_progress >= 1.0f) + { + // exit out scene, and start new scene + [_outgoingScene onExit]; + [[CCDirector sharedDirector] replaceScene:_incomingScene]; + [_incomingScene onEnterTransitionDidFinish]; + + // release scenes + _incomingScene = nil; + _outgoingScene = nil; + + return; + } + + // render the scenes + if (_incomingSceneAnimated) [self renderIncoming:_progress]; + if (_outgoingSceneAnimated) [self renderOutgoing:_progress]; +} + +// ----------------------------------------------------------------- + +- (void)renderOutgoing:(float)progress +{ + float oldScale; + + // scale the out scene to fit render texture + oldScale = _outgoingScene.scale; + _outgoingScene.scale = oldScale / _outgoingDownScale; + + [_outgoingTexture beginWithClear:0 g:0 b:0 a:1]; + [_outgoingScene visit]; + [_outgoingTexture end]; + + _outgoingScene.scale = oldScale; +} + +- (void)renderIncoming:(float)progress +{ + float oldScale; + + // scale the in scene to fit render texture + oldScale = _incomingScene.scale; + _incomingScene.scale = oldScale / _incomingDownScale; + + [_incomingTexture beginWithClear:0 g:0 b:0 a:1]; + [_incomingScene visit]; + [_incomingTexture end]; + + _incomingScene.scale = oldScale; + +} + +// ----------------------------------------------------------------- + +- (void)setRetinaTransition:(BOOL)retinaTransition +{ + _retinaTransition = retinaTransition; + _incomingDownScale = CCTransitionDownScaleMin; + _outgoingDownScale = CCTransitionDownScaleMin; +#ifdef __CC_PLATFORM_IOS + if (!_retinaTransition && (CC_CONTENT_SCALE_FACTOR() > 1.0)) + { + + _incomingDownScale = CCTransitionDownScaleRetina; + _outgoingDownScale = CCTransitionDownScaleRetina; + } +#endif +} + +- (void)setIncomingDownScale:(float)incomingDownScale +{ + NSAssert((incomingDownScale >= CCTransitionDownScaleMin) && (incomingDownScale <= CCTransitionDownScaleMax),@"Invalid down scale"); + _incomingDownScale = incomingDownScale; +} + +- (void)setOutgoingDownScale:(float)outgoingDownScale +{ + NSAssert((outgoingDownScale >= CCTransitionDownScaleMin) && (outgoingDownScale <= CCTransitionDownScaleMax),@"Invalid down scale"); + _outgoingDownScale = outgoingDownScale; +} + +// ----------------------------------------------------------------- + +- (void)draw +{ + // remove ARC warning about possible leak from performSelector +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Warc-performSelector-leaks" + [self performSelector:_drawSelector]; +#pragma clang diagnostic pop +} + +- (void)drawFixedFunction +{ + switch (_fixedFunction) + { + case CCTransitionFixedFunctionCrossFade: + { + _incomingTexture.sprite.opacity = 255 * _progress; + _outgoingTexture.sprite.opacity = 255 * (1 - _progress); + break; + } + case CCTransitionFixedFunctionFadeWithColor: + { + glClearColor(_color.r, _color.g, _color.b, _color.a); + _incomingTexture.sprite.opacity = clampf(512 * (_progress - 0.5), 0, 255); + _outgoingTexture.sprite.opacity = clampf(255 * (1 - (2 * _progress)), 0, 255); + break; + } + case CCTransitionFixedFunctionReveal: + { + _outgoingTexture.sprite.position = ccpMult(_outgoingDestination, _progress); + break; + } + case CCTransitionFixedFunctionMoveIn: + { + _incomingTexture.sprite.position = ccpMult(_outgoingDestination, -1 + _progress); + break; + } + case CCTransitionFixedFunctionPush: + { + _outgoingTexture.sprite.position = ccpMult(_outgoingDestination, _progress); + _incomingTexture.sprite.position = ccpMult(_outgoingDestination, -1 + _progress); + break; + } + } +} + +// ----------------------------------------------------------------- + +@end diff --git a/cocos2d/Platforms/CCGL.h b/cocos2d/Platforms/CCGL.h new file mode 100644 index 0000000..8ba3d79 --- /dev/null +++ b/cocos2d/Platforms/CCGL.h @@ -0,0 +1,74 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2010 Ricardo Quesada + * Copyright (c) 2011 Zynga Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +// +// Common layer for OpenGL stuff +// + +#import "ccMacros.h" + +#if defined (__CC_PLATFORM_IOS) +#import +#import +#import +#import "iOS/CCGLView.h" + +#elif defined (__CC_PLATFORM_MAC) +#import +#import +#import // needed for NSOpenGLView +#import "Mac/CCGLView.h" +#endif + + +// iOS +#if defined (__CC_PLATFORM_IOS) +#define glClearDepth glClearDepthf +#define glDeleteVertexArrays glDeleteVertexArraysOES +#define glGenVertexArrays glGenVertexArraysOES +#define glBindVertexArray glBindVertexArrayOES +#define glMapBuffer glMapBufferOES +#define glUnmapBuffer glUnmapBufferOES + +#define GL_DEPTH24_STENCIL8 GL_DEPTH24_STENCIL8_OES +#define GL_WRITE_ONLY GL_WRITE_ONLY_OES + +// Mac +#elif defined(__CC_PLATFORM_MAC) + + +#if 1 +#define glDeleteVertexArrays glDeleteVertexArraysAPPLE +#define glGenVertexArrays glGenVertexArraysAPPLE +#define glBindVertexArray glBindVertexArrayAPPLE + +#else // OpenGL 3.2 Core Profile + +#define glDeleteVertexArrays glDeleteVertexArrays +#define glGenVertexArrays glGenVertexArrays +#define glBindVertexArray glBindVertexArray +#endif + +#endif diff --git a/cocos2d/Platforms/CCNS.h b/cocos2d/Platforms/CCNS.h new file mode 100644 index 0000000..cb3e891 --- /dev/null +++ b/cocos2d/Platforms/CCNS.h @@ -0,0 +1,54 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2010 Ricardo Quesada + * Copyright (c) 2011 Zynga Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +// +// Common layer for NS (Next-Step) stuff +// + +#import "ccMacros.h" + +#import // for NSObject + +#ifdef __CC_PLATFORM_IOS + +#define CCRectFromString(__r__) CGRectFromString(__r__) +#define CCPointFromString(__p__) CGPointFromString(__p__) +#define CCSizeFromString(__s__) CGSizeFromString(__s__) +#define CCNSSizeToCGSize +#define CCNSRectToCGRect +#define CCNSPointToCGPoint + + +#elif defined(__CC_PLATFORM_MAC) + +#define CCRectFromString(__r__) NSRectToCGRect( NSRectFromString(__r__) ) +#define CCPointFromString(__p__) NSPointToCGPoint( NSPointFromString(__p__) ) +#define CCSizeFromString(__s__) NSSizeToCGSize( NSSizeFromString(__s__) ) +#define CCNSSizeToCGSize NSSizeToCGSize +#define CCNSRectToCGRect NSRectToCGRect +#define CCNSPointToCGPoint NSPointToCGPoint +#endif + + diff --git a/cocos2d/Platforms/Mac/CCDirectorMac.h b/cocos2d/Platforms/Mac/CCDirectorMac.h new file mode 100644 index 0000000..a393202 --- /dev/null +++ b/cocos2d/Platforms/Mac/CCDirectorMac.h @@ -0,0 +1,103 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2010 Ricardo Quesada + * Copyright (c) 2011 Zynga Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + + +// Only compile this code on Mac. These files should not be included on your iOS project. +// But in case they are included, it won't be compiled. +#import "ccMacros.h" +#ifdef __CC_PLATFORM_MAC + +#import +#import "CCDirector.h" + +enum { + /// If the window is resized, it won't be autoscaled + kCCDirectorResize_NoScale, + /// If the window is resized, it will be autoscaled (default behavior) + kCCDirectorResize_AutoScale, +}; + +@interface CCDirector (MacExtension) + +/** converts an NSEvent to GL coordinates (Mac only) */ +-(CGPoint) convertEventToGL:(NSEvent*)event; +@end + +/** Base class of Mac directors + @since v0.99.5 + */ +@interface CCDirectorMac : CCDirector +{ + BOOL _isFullScreen; + int _resizeMode; + CGPoint _winOffset; + CGSize _originalWinSize; + + NSWindow *_fullScreenWindow; + + // cache + NSWindow *_windowGLView; + NSView *_superViewGLView; + NSRect _originalWinRect; // Original size and position +} + +// whether or not the view is in fullscreen mode +@property (nonatomic, readonly) BOOL isFullScreen; + +// resize mode: with or without scaling +@property (nonatomic, readwrite) int resizeMode; + +@property (nonatomic, readwrite) CGSize originalWinSize; + +/** Sets the view in fullscreen or window mode */ +- (void) setFullScreen:(BOOL)fullscreen; + +/** Converts window size coordinates to logical coordinates. + Useful only if resizeMode is kCCDirectorResize_Scale. + If resizeMode is kCCDirectorResize_NoScale, then no conversion will be done. +*/ +- (CGPoint) convertToLogicalCoordinates:(CGPoint)coordinates; +@end + + +/** DisplayLinkDirector is a Director that synchronizes timers with the refresh rate of the display. + * + * Features and Limitations: + * - Only available on 3.1+ + * - Scheduled timers & drawing are synchronizes with the refresh rate of the display + * - Only supports animation intervals of 1/60 1/30 & 1/15 + * + * It is the recommended Director if the SDK is 3.1 or newer + * + * @since v0.8.2 + */ +@interface CCDirectorDisplayLink : CCDirectorMac +{ + CVDisplayLinkRef displayLink; +} +@end + +#endif // __CC_PLATFORM_MAC + diff --git a/src/cocos2d/Platforms/Mac/CCDirectorMac.m b/cocos2d/Platforms/Mac/CCDirectorMac.m similarity index 62% rename from src/cocos2d/Platforms/Mac/CCDirectorMac.m rename to cocos2d/Platforms/Mac/CCDirectorMac.m index baa8e27..d169731 100644 --- a/src/cocos2d/Platforms/Mac/CCDirectorMac.m +++ b/cocos2d/Platforms/Mac/CCDirectorMac.m @@ -25,25 +25,28 @@ // Only compile this code on Mac. These files should not be included on your iOS project. // But in case they are included, it won't be compiled. -#import "../../ccMacros.h" +#import "ccMacros.h" #ifdef __CC_PLATFORM_MAC #import #import "CCDirectorMac.h" -#import "CCEventDispatcher.h" #import "CCGLView.h" #import "CCWindow.h" -#import "../../CCNode.h" -#import "../../CCScheduler.h" -#import "../../ccMacros.h" -#import "../../CCGLProgram.h" -#import "../../ccGLStateCache.h" +#import "CCNode.h" +#import "CCScene.h" +#import "CCScheduler.h" +#import "ccMacros.h" +#import "CCGLProgram.h" +#import "ccGLStateCache.h" // external -#import "kazmath/kazmath.h" +#pragma clang diagnostic push COCOS2D +#pragma clang diagnostic ignored "-Wignored-qualifiers" #import "kazmath/GL/matrix.h" +#import "kazmath/kazmath.h" +#pragma clang diagnostic pop COCOS2D #pragma mark - #pragma mark Director Mac extensions @@ -65,16 +68,6 @@ -(CGPoint) convertEventToGL:(NSEvent*)event return [(CCDirectorMac*)self convertToLogicalCoordinates:p]; } --(void) setEventDispatcher:(CCEventDispatcher *)dispatcher -{ - NSAssert(NO, @"override me"); -} - --(CCEventDispatcher *) eventDispatcher -{ - NSAssert(NO, @"override me"); - return nil; -} @end #pragma mark - @@ -82,45 +75,35 @@ -(CCEventDispatcher *) eventDispatcher @implementation CCDirectorMac -@synthesize isFullScreen = isFullScreen_; -@synthesize originalWinSize = originalWinSize_; +@synthesize isFullScreen = _isFullScreen; +@synthesize originalWinSize = _originalWinSize; -(id) init { if( (self = [super init]) ) { - isFullScreen_ = NO; - resizeMode_ = kCCDirectorResize_AutoScale; + _isFullScreen = NO; + _resizeMode = kCCDirectorResize_AutoScale; - originalWinSize_ = CGSizeZero; - fullScreenWindow_ = nil; - windowGLView_ = nil; - winOffset_ = CGPointZero; + _originalWinSize = CGSizeZero; + _fullScreenWindow = nil; + _windowGLView = nil; + _winOffset = CGPointZero; - eventDispatcher_ = [[CCEventDispatcher alloc] init]; + self.positionScaleFactor = 1; } return self; } -- (void) dealloc -{ - [eventDispatcher_ release]; - [view_ release]; - [superViewGLView_ release]; - [fullScreenWindow_ release]; - [windowGLView_ release]; - - [super dealloc]; -} // // setFullScreen code taken from GLFullScreen example by Apple // - (void) setFullScreen:(BOOL)fullscreen { -// isFullScreen_ = !isFullScreen_; +// _isFullScreen = !_isFullScreen; // -// if (isFullScreen_) +// if (_isFullScreen) // { // [self.view enterFullScreenMode:[[self.view window] screen] withOptions:nil]; // } @@ -135,27 +118,27 @@ - (void) setFullScreen:(BOOL)fullscreen // Mac OS X 10.6 and later offer a simplified mechanism to create full-screen contexts #if MAC_OS_X_VERSION_MIN_REQUIRED > MAC_OS_X_VERSION_10_5 - if (isFullScreen_ == fullscreen) + if (_isFullScreen == fullscreen) return; CCGLView *openGLview = (CCGLView*) self.view; + BOOL viewAcceptsTouchEvents = openGLview.acceptsTouchEvents; if( fullscreen ) { - originalWinRect_ = [openGLview frame]; + _originalWinRect = [openGLview frame]; // Cache normal window and superview of openGLView - if(!windowGLView_) - windowGLView_ = [[openGLview window] retain]; + if(!_windowGLView) + _windowGLView = [openGLview window]; - [superViewGLView_ release]; - superViewGLView_ = [[openGLview superview] retain]; + _superViewGLView = [openGLview superview]; // Get screen size NSRect displayRect = [[NSScreen mainScreen] frame]; // Create a screen-sized window on the display you want to take over - fullScreenWindow_ = [[CCWindow alloc] initWithFrame:displayRect fullscreen:YES]; + _fullScreenWindow = [[CCWindow alloc] initWithFrame:displayRect fullscreen:YES]; // Remove glView from window [openGLview removeFromSuperview]; @@ -164,11 +147,11 @@ - (void) setFullScreen:(BOOL)fullscreen [openGLview setFrame:displayRect]; // Attach glView to fullscreen window - [fullScreenWindow_ setContentView:openGLview]; + [_fullScreenWindow setContentView:openGLview]; // Show the fullscreen window - [fullScreenWindow_ makeKeyAndOrderFront:self]; - [fullScreenWindow_ makeMainWindow]; + [_fullScreenWindow makeKeyAndOrderFront:self]; + [_fullScreenWindow makeMainWindow]; } else { @@ -176,31 +159,32 @@ - (void) setFullScreen:(BOOL)fullscreen [openGLview removeFromSuperview]; // Release fullscreen window - [fullScreenWindow_ release]; - fullScreenWindow_ = nil; + _fullScreenWindow = nil; // Attach glView to superview - [superViewGLView_ addSubview:openGLview]; + [_superViewGLView addSubview:openGLview]; // Set new frame - [openGLview setFrame:originalWinRect_]; + [openGLview setFrame:_originalWinRect]; // Show the window - [windowGLView_ makeKeyAndOrderFront:self]; - [windowGLView_ makeMainWindow]; + [_windowGLView makeKeyAndOrderFront:self]; + [_windowGLView makeMainWindow]; } // issue #1189 - [windowGLView_ makeFirstResponder:openGLview]; + [_windowGLView makeFirstResponder:openGLview]; - isFullScreen_ = fullscreen; + _isFullScreen = fullscreen; - [openGLview retain]; // Retain +1 + // Retain +1 // re-configure glView [self setView:openGLview]; - - [openGLview release]; // Retain -1 + + [openGLview setAcceptsTouchEvents:viewAcceptsTouchEvents]; + + // Retain -1 [openGLview setNeedsDisplay:YES]; #else @@ -211,67 +195,76 @@ - (void) setFullScreen:(BOOL)fullscreen -(void) setView:(CCGLView *)view { - if( view != view_) { + if( view != __view) { [super setView:view]; // cache the NSWindow and NSOpenGLView created from the NIB - if( !isFullScreen_ && CGSizeEqualToSize(originalWinSize_, CGSizeZero)) + if( !_isFullScreen && CGSizeEqualToSize(_originalWinSize, CGSizeZero)) { - originalWinSize_ = winSizeInPixels_; + _originalWinSize = _winSizeInPixels; } } } -(int) resizeMode { - return resizeMode_; + return _resizeMode; } -(void) setResizeMode:(int)mode { - if( mode != resizeMode_ ) { + if( mode != _resizeMode ) { - resizeMode_ = mode; + _resizeMode = mode; - [self setProjection:projection_]; + [self setProjection:_projection]; [self.view setNeedsDisplay: YES]; } } --(void) setProjection:(ccDirectorProjection)projection +-(void) setViewport { - CGSize size = winSizeInPixels_; - CGPoint offset = CGPointZero; - float widthAspect = size.width; - float heightAspect = size.height; - - - if( resizeMode_ == kCCDirectorResize_AutoScale && ! CGSizeEqualToSize(originalWinSize_, CGSizeZero ) ) { + float widthAspect = _winSizeInPixels.width; + float heightAspect = _winSizeInPixels.height; - size = originalWinSize_; - float aspect = originalWinSize_.width / originalWinSize_.height; - widthAspect = winSizeInPixels_.width; - heightAspect = winSizeInPixels_.width / aspect; - - if( heightAspect > winSizeInPixels_.height ) { - widthAspect = winSizeInPixels_.height * aspect; - heightAspect = winSizeInPixels_.height; + if( _resizeMode == kCCDirectorResize_AutoScale && ! CGSizeEqualToSize(_originalWinSize, CGSizeZero ) ) { + + float aspect = _originalWinSize.width / _originalWinSize.height; + widthAspect = _winSizeInPixels.width; + heightAspect = _winSizeInPixels.width / aspect; + + if( heightAspect > _winSizeInPixels.height ) { + widthAspect = _winSizeInPixels.height * aspect; + heightAspect = _winSizeInPixels.height; } + + _winOffset.x = (_winSizeInPixels.width - widthAspect) / 2; + _winOffset.y = (_winSizeInPixels.height - heightAspect) / 2; + + offset = _winOffset; + } - winOffset_.x = (winSizeInPixels_.width - widthAspect) / 2; - winOffset_.y = (winSizeInPixels_.height - heightAspect) / 2; + glViewport(offset.x, offset.y, widthAspect, heightAspect); +} - offset = winOffset_; +-(void) setProjection:(ccDirectorProjection)projection +{ + CGSize size = _winSizeInPixels; + if( _resizeMode == kCCDirectorResize_AutoScale && ! CGSizeEqualToSize(_originalWinSize, CGSizeZero ) ) { + size = _originalWinSize; + } + + BOOL isProjectionValid = NO; - } + [self setViewport]; switch (projection) { case kCCDirectorProjection2D: - - glViewport(offset.x, offset.y, widthAspect, heightAspect); + { + isProjectionValid = YES; kmGLMatrixMode(KM_GL_PROJECTION); kmGLLoadIdentity(); @@ -282,14 +275,13 @@ -(void) setProjection:(ccDirectorProjection)projection kmGLMatrixMode(KM_GL_MODELVIEW); kmGLLoadIdentity(); break; - + } case kCCDirectorProjection3D: { - + isProjectionValid = YES; float zeye = [self getZEye]; - glViewport(offset.x, offset.y, widthAspect, heightAspect); kmGLMatrixMode(KM_GL_PROJECTION); kmGLLoadIdentity(); @@ -307,7 +299,7 @@ -(void) setProjection:(ccDirectorProjection)projection kmGLLoadIdentity(); kmVec3 eye, center, up; - float eyeZ = size.height * zeye / winSizeInPixels_.height; + float eyeZ = size.height * zeye / _winSizeInPixels.height; kmVec3Fill( &eye, size.width/2, size.height/2, eyeZ ); kmVec3Fill( ¢er, size.width/2, size.height/2, 0 ); @@ -318,16 +310,20 @@ -(void) setProjection:(ccDirectorProjection)projection } case kCCDirectorProjectionCustom: - if( [delegate_ respondsToSelector:@selector(updateProjection)] ) - [delegate_ updateProjection]; - break; - - default: - CCLOG(@"cocos2d: Director: unrecognized projection"); + { + isProjectionValid = YES; + if( [_delegate respondsToSelector:@selector(updateProjection)] ) + [_delegate updateProjection]; break; + } } + + if (isProjectionValid == NO) + { + CCLOG(@"cocos2d: Director: unrecognized projection"); + } - projection_ = projection; + _projection = projection; ccSetProjectionMatrixDirty(); } @@ -337,10 +333,10 @@ -(void) setProjection:(ccDirectorProjection)projection // otherwise it should return the "real" size. -(CGSize) winSize { - if( resizeMode_ == kCCDirectorResize_AutoScale ) - return originalWinSize_; + if( _resizeMode == kCCDirectorResize_AutoScale ) + return _originalWinSize; - return winSizeInPixels_; + return _winSizeInPixels; } -(CGSize) winSizeInPixels @@ -352,16 +348,16 @@ - (CGPoint) convertToLogicalCoordinates:(CGPoint)coords { CGPoint ret; - if( resizeMode_ == kCCDirectorResize_NoScale ) + if( _resizeMode == kCCDirectorResize_NoScale ) ret = coords; else { - float x_diff = originalWinSize_.width / (winSizeInPixels_.width - winOffset_.x * 2); - float y_diff = originalWinSize_.height / (winSizeInPixels_.height - winOffset_.y * 2); + float x_diff = _originalWinSize.width / (_winSizeInPixels.width - _winOffset.x * 2); + float y_diff = _originalWinSize.height / (_winSizeInPixels.height - _winOffset.y * 2); - float adjust_x = (winSizeInPixels_.width * x_diff - originalWinSize_.width ) / 2; - float adjust_y = (winSizeInPixels_.height * y_diff - originalWinSize_.height ) / 2; + float adjust_x = (_winSizeInPixels.width * x_diff - _originalWinSize.width ) / 2; + float adjust_y = (_winSizeInPixels.height * y_diff - _originalWinSize.height ) / 2; ret = CGPointMake( (x_diff * coords.x) - adjust_x, ( y_diff * coords.y ) - adjust_y ); } @@ -369,18 +365,14 @@ - (CGPoint) convertToLogicalCoordinates:(CGPoint)coords return ret; } --(void) setEventDispatcher:(CCEventDispatcher *)dispatcher +-(CGPoint)convertToGL:(CGPoint)uiPoint { - if( dispatcher != eventDispatcher_ ) { - [eventDispatcher_ release]; - eventDispatcher_ = [dispatcher retain]; - } + NSPoint point = [[self view] convertPoint:uiPoint fromView:nil]; + CGPoint p = NSPointToCGPoint(point); + + return [(CCDirectorMac*)self convertToLogicalCoordinates:p]; } --(CCEventDispatcher *) eventDispatcher -{ - return eventDispatcher_; -} @end @@ -392,53 +384,55 @@ @implementation CCDirectorDisplayLink - (CVReturn) getFrameForTime:(const CVTimeStamp*)outputTime { + @autoreleasepool + { #if (CC_DIRECTOR_MAC_THREAD == CC_MAC_USE_DISPLAY_LINK_THREAD) - if( ! runningThread_ ) - runningThread_ = [NSThread currentThread]; - - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; + if( ! _runningThread ) + _runningThread = [NSThread currentThread]; - [self drawScene]; + [self drawScene]; - // Process timers and other events - [[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode beforeDate:nil]; + // Process timers and other events + [[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode beforeDate:nil]; - [pool release]; - + #else - [self performSelector:@selector(drawScene) onThread:runningThread_ withObject:nil waitUntilDone:YES]; + [self performSelector:@selector(drawScene) onThread:_runningThread withObject:nil waitUntilDone:YES]; #endif - return kCVReturnSuccess; + return kCVReturnSuccess; + } } // This is the renderer output callback function static CVReturn MyDisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTimeStamp* now, const CVTimeStamp* outputTime, CVOptionFlags flagsIn, CVOptionFlags* flagsOut, void* displayLinkContext) { - CVReturn result = [(CCDirectorDisplayLink*)displayLinkContext getFrameForTime:outputTime]; + CVReturn result = [(__bridge CCDirectorDisplayLink*)displayLinkContext getFrameForTime:outputTime]; return result; } - (void) startAnimation { - if(isAnimating_) + [super startAnimation]; + + if(_isAnimating) return; CCLOG(@"cocos2d: startAnimation"); #if (CC_DIRECTOR_MAC_THREAD == CC_MAC_USE_OWN_THREAD) - runningThread_ = [[NSThread alloc] initWithTarget:self selector:@selector(mainLoop) object:nil]; - [runningThread_ start]; + _runningThread = [[NSThread alloc] initWithTarget:self selector:@selector(mainLoop) object:nil]; + [_runningThread start]; #elif (CC_DIRECTOR_MAC_THREAD == CC_MAC_USE_MAIN_THREAD) - runningThread_ = [NSThread mainThread]; + _runningThread = [NSThread mainThread]; #endif - gettimeofday( &lastUpdate_, NULL); + gettimeofday( &_lastUpdate, NULL); // Create a display link capable of being used with all active displays CVDisplayLinkCreateWithActiveCGDisplays(&displayLink); // Set the renderer output callback function - CVDisplayLinkSetOutputCallback(displayLink, &MyDisplayLinkCallback, self); + CVDisplayLinkSetOutputCallback(displayLink, &MyDisplayLinkCallback, (__bridge void *)(self)); // Set the display link for the current renderer CCGLView *openGLview = (CCGLView*) self.view; @@ -449,12 +443,12 @@ - (void) startAnimation // Activate the display link CVDisplayLinkStart(displayLink); - isAnimating_ = YES; + _isAnimating = YES; } - (void) stopAnimation { - if(!isAnimating_) + if(!_isAnimating) return; CCLOG(@"cocos2d: stopAnimation"); @@ -465,15 +459,15 @@ - (void) stopAnimation displayLink = NULL; #if CC_DIRECTOR_MAC_THREAD == CC_MAC_USE_OWN_THREAD - [runningThread_ cancel]; - [runningThread_ release]; - runningThread_ = nil; + [_runningThread cancel]; + [_runningThread release]; + _runningThread = nil; #elif (CC_DIRECTOR_MAC_THREAD == CC_MAC_USE_MAIN_THREAD) - runningThread_ = nil; + _runningThread = nil; #endif } - isAnimating_ = NO; + _isAnimating = NO; } -(void) dealloc @@ -482,7 +476,6 @@ -(void) dealloc CVDisplayLinkStop(displayLink); CVDisplayLinkRelease(displayLink); } - [super dealloc]; } // @@ -493,11 +486,11 @@ -(void) mainLoop while( ![[NSThread currentThread] isCancelled] ) { // There is no autorelease pool when this method is called because it will be called from a background thread // It's important to create one or you will leak objects - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; + @autoreleasepool { - [[NSRunLoop currentRunLoop] run]; + [[NSRunLoop currentRunLoop] run]; - [pool release]; + } } } @@ -516,31 +509,31 @@ - (void) drawScene [self.view lockOpenGLContext]; /* tick before glClear: issue #533 */ - if( ! isPaused_ ) - [scheduler_ update: dt]; + if( ! _isPaused ) + [_scheduler update: _dt]; glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); /* to avoid flickr, nextScene MUST be here: after tick and before draw. XXX: Which bug is this one. It seems that it can't be reproduced with v0.9 */ - if( nextScene_ ) + if( _nextScene ) [self setNextScene]; kmGLPushMatrix(); /* draw the scene */ - [runningScene_ visit]; + [_runningScene visit]; /* draw the notification node */ - [notificationNode_ visit]; + [_notificationNode visit]; - if( displayStats_ ) + if( _displayStats ) [self showStats]; kmGLPopMatrix(); - totalFrames_++; + _totalFrames++; // flush buffer @@ -548,7 +541,7 @@ - (void) drawScene [self.view unlockOpenGLContext]; - if( displayStats_ ) + if( _displayStats ) [self calculateMPF]; } @@ -557,17 +550,6 @@ -(void) setView:(CCGLView *)view { [super setView:view]; - [view setEventDelegate:eventDispatcher_]; - [eventDispatcher_ setDispatchEvents: YES]; - - // Enable Touches. Default no. - // Only available on OS X 10.6+ -#if MAC_OS_X_VERSION_MIN_REQUIRED > MAC_OS_X_VERSION_10_5 - [view setAcceptsTouchEvents:NO]; -// [view setAcceptsTouchEvents:YES]; -#endif - - // Synchronize buffer swaps with vertical refresh rate [[view openGLContext] makeCurrentContext]; GLint swapInt = 1; diff --git a/cocos2d/Platforms/Mac/CCGLView.h b/cocos2d/Platforms/Mac/CCGLView.h new file mode 100644 index 0000000..b824c16 --- /dev/null +++ b/cocos2d/Platforms/Mac/CCGLView.h @@ -0,0 +1,58 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2010 Ricardo Quesada + * Copyright (c) 2011 Zynga Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +// Only compile this code on Mac. These files should not be included on your iOS project. +// But in case they are included, it won't be compiled. +#import "ccMacros.h" +#ifdef __CC_PLATFORM_MAC + +#import + +#import "ccConfig.h" + +/** CCGLView + + Only available for Mac OS X + */ +@interface CCGLView : NSOpenGLView + +/** initializes the CCGLView with a frame rect and an OpenGL context */ +- (id) initWithFrame:(NSRect)frameRect shareContext:(NSOpenGLContext*)context; + +/** uses and locks the OpenGL context */ +-(void) lockOpenGLContext; + +/** unlocks the openGL context */ +-(void) unlockOpenGLContext; + +/** returns the depth format of the view in BPP */ +- (NSUInteger) depthFormat; + +// private ++(void) load_; +@end + +#endif // __CC_PLATFORM_MAC + diff --git a/src/cocos2d/Platforms/Mac/CCGLView.m b/cocos2d/Platforms/Mac/CCGLView.m similarity index 62% rename from src/cocos2d/Platforms/Mac/CCGLView.m rename to cocos2d/Platforms/Mac/CCGLView.m index 62c2237..d79d012 100644 --- a/src/cocos2d/Platforms/Mac/CCGLView.m +++ b/cocos2d/Platforms/Mac/CCGLView.m @@ -29,21 +29,18 @@ // Only compile this code on Mac. These files should not be included on your iOS project. // But in case they are included, it won't be compiled. -#import "../../ccMacros.h" +#import "ccMacros.h" #ifdef __CC_PLATFORM_MAC -#import "../../Platforms/CCGL.h" +#import "Platforms/CCGL.h" #import "CCGLView.h" #import "CCDirectorMac.h" -#import "CCEventDispatcher.h" -#import "../../ccConfig.h" -#import "../../ccMacros.h" +#import "ccConfig.h" +#import "ccMacros.h" @implementation CCGLView -@synthesize eventDelegate = eventDelegate_; - +(void) load_ { CCLOG(@"%@ loaded", self); @@ -78,13 +75,11 @@ - (id) initWithFrame:(NSRect)frameRect shareContext:(NSOpenGLContext*)context if (!pixelFormat) CCLOG(@"No OpenGL pixel format"); - if( (self = [super initWithFrame:frameRect pixelFormat:[pixelFormat autorelease]]) ) { + if( (self = [super initWithFrame:frameRect pixelFormat:pixelFormat]) ) { if( context ) [self setOpenGLContext:context]; - // event delegate - eventDelegate_ = nil; } return self; @@ -133,7 +128,10 @@ - (void) reshape [director reshapeProjection: NSSizeToCGSize(rect.size) ]; // avoid flicker - [director drawScene]; + // Only draw if there is something to draw, otherwise it actually creates a flicker of the current glClearColor + if(director.runningScene){ + [director drawScene]; + } // [self setNeedsDisplay:YES]; [self unlockOpenGLContext]; @@ -161,129 +159,86 @@ - (void) dealloc { CCLOGINFO(@"cocos2d: deallocing %@", self); - [super dealloc]; } -#define DISPATCH_EVENT(__event__, __selector__) \ - id obj = eventDelegate_; \ - CCEventObject *event = [[CCEventObject alloc] init]; \ - event->event = [__event__ retain]; \ - event->selector = __selector__; \ - [obj performSelector:@selector(dispatchEvent:) \ - onThread:[[CCDirector sharedDirector] runningThread] \ - withObject:event \ - waitUntilDone:NO]; \ - [event release]; - -#pragma mark CCGLView - Mouse events +#pragma mark CCGLView - Mouse Delegate - (void)mouseDown:(NSEvent *)theEvent { - DISPATCH_EVENT(theEvent, _cmd); -} - -- (void)mouseMoved:(NSEvent *)theEvent -{ - DISPATCH_EVENT(theEvent, _cmd); + // dispatch mouse to responder manager + [[CCDirector sharedDirector].responderManager mouseDown:theEvent]; } - (void)mouseDragged:(NSEvent *)theEvent { - DISPATCH_EVENT(theEvent, _cmd); + // dispatch mouse to responder manager + [[CCDirector sharedDirector].responderManager mouseDragged:theEvent]; } - (void)mouseUp:(NSEvent *)theEvent { - DISPATCH_EVENT(theEvent, _cmd); -} - -- (void)rightMouseDown:(NSEvent *)theEvent { - DISPATCH_EVENT(theEvent, _cmd); -} - -- (void)rightMouseDragged:(NSEvent *)theEvent { - DISPATCH_EVENT(theEvent, _cmd); -} - -- (void)rightMouseUp:(NSEvent *)theEvent { - DISPATCH_EVENT(theEvent, _cmd); -} - -- (void)otherMouseDown:(NSEvent *)theEvent { - DISPATCH_EVENT(theEvent, _cmd); -} - -- (void)otherMouseDragged:(NSEvent *)theEvent { - DISPATCH_EVENT(theEvent, _cmd); -} - -- (void)otherMouseUp:(NSEvent *)theEvent { - DISPATCH_EVENT(theEvent, _cmd); -} - -- (void)mouseEntered:(NSEvent *)theEvent { - DISPATCH_EVENT(theEvent, _cmd); + // dispatch mouse to responder manager + [[CCDirector sharedDirector].responderManager mouseUp:theEvent]; } -- (void)mouseExited:(NSEvent *)theEvent { - DISPATCH_EVENT(theEvent, _cmd); -} - --(void) scrollWheel:(NSEvent *)theEvent { - DISPATCH_EVENT(theEvent, _cmd); -} - -#pragma mark CCGLView - Key events - --(BOOL) becomeFirstResponder +- (void)mouseMoved:(NSEvent *)theEvent { - return YES; + // dispatch mouse to responder manager + [[CCDirector sharedDirector].responderManager mouseMoved:theEvent]; } --(BOOL) acceptsFirstResponder +- (void)mouseEntered:(NSEvent *)theEvent { - return YES; + // dispatch mouse to responder manager + [[CCDirector sharedDirector].responderManager mouseEntered:theEvent]; } --(BOOL) resignFirstResponder +- (void)mouseExited:(NSEvent *)theEvent { - return YES; + // dispatch mouse to responder manager + [[CCDirector sharedDirector].responderManager mouseExited:theEvent]; } -- (void)keyDown:(NSEvent *)theEvent +- (void)rightMouseDown:(NSEvent *)theEvent { - DISPATCH_EVENT(theEvent, _cmd); + // dispatch mouse to responder manager + [[CCDirector sharedDirector].responderManager rightMouseDown:theEvent]; } -- (void)keyUp:(NSEvent *)theEvent +- (void)rightMouseDragged:(NSEvent *)theEvent { - DISPATCH_EVENT(theEvent, _cmd); + // dispatch mouse to responder manager + [[CCDirector sharedDirector].responderManager rightMouseDragged:theEvent]; } -- (void)flagsChanged:(NSEvent *)theEvent +- (void)rightMouseUp:(NSEvent *)theEvent { - DISPATCH_EVENT(theEvent, _cmd); + // dispatch mouse to responder manager + [[CCDirector sharedDirector].responderManager rightMouseUp:theEvent]; } -#pragma mark CCGLView - Touch events -- (void)touchesBeganWithEvent:(NSEvent *)theEvent +- (void)otherMouseDown:(NSEvent *)theEvent { - DISPATCH_EVENT(theEvent, _cmd); + // dispatch mouse to responder manager + [[CCDirector sharedDirector].responderManager otherMouseDown:theEvent]; } -- (void)touchesMovedWithEvent:(NSEvent *)theEvent +- (void)otherMouseDragged:(NSEvent *)theEvent { - DISPATCH_EVENT(theEvent, _cmd); + // dispatch mouse to responder manager + [[CCDirector sharedDirector].responderManager otherMouseDragged:theEvent]; } -- (void)touchesEndedWithEvent:(NSEvent *)theEvent +- (void)otherMouseUp:(NSEvent *)theEvent { - DISPATCH_EVENT(theEvent, _cmd); + // dispatch mouse to responder manager + [[CCDirector sharedDirector].responderManager otherMouseUp:theEvent]; } -- (void)touchesCancelledWithEvent:(NSEvent *)theEvent +- (void)scrollWheel:(NSEvent *)theEvent { - DISPATCH_EVENT(theEvent, _cmd); + // dispatch mouse to responder manager + [[CCDirector sharedDirector].responderManager scrollWheel:theEvent]; } @end diff --git a/cocos2d/Platforms/Mac/CCWindow.h b/cocos2d/Platforms/Mac/CCWindow.h new file mode 100644 index 0000000..b79df95 --- /dev/null +++ b/cocos2d/Platforms/Mac/CCWindow.h @@ -0,0 +1,41 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2010 Ricardo Quesada + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +// Only compile this code on Mac. These files should not be included on your iOS project. +// But in case they are included, it won't be compiled. +#import "ccMacros.h" +#ifdef __CC_PLATFORM_MAC + +#import + + +@interface CCWindow : NSWindow +{ +} +- (id) initWithFrame:(NSRect)frame fullscreen:(BOOL)fullscreen; + +@end + + +#endif // __CC_PLATFORM_MAC diff --git a/src/cocos2d/Platforms/Mac/CCWindow.m b/cocos2d/Platforms/Mac/CCWindow.m similarity index 98% rename from src/cocos2d/Platforms/Mac/CCWindow.m rename to cocos2d/Platforms/Mac/CCWindow.m index 8852a20..4ba315e 100644 --- a/src/cocos2d/Platforms/Mac/CCWindow.m +++ b/cocos2d/Platforms/Mac/CCWindow.m @@ -24,7 +24,7 @@ // Only compile this code on Mac. These files should not be included on your iOS project. // But in case they are included, it won't be compiled. -#import "../../ccMacros.h" +#import "ccMacros.h" #ifdef __CC_PLATFORM_MAC #import "CCWindow.h" diff --git a/cocos2d/Platforms/Mac/NSEvent+CC.h b/cocos2d/Platforms/Mac/NSEvent+CC.h new file mode 100644 index 0000000..d69482a --- /dev/null +++ b/cocos2d/Platforms/Mac/NSEvent+CC.h @@ -0,0 +1,41 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2013 Apportable Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#import "ccMacros.h" + +#ifdef __CC_PLATFORM_MAC + +#import + +@class CCNode; + +@interface NSEvent (CC) + +- (CGPoint) locationInNode:(CCNode*) node; + +- (CGPoint) locationInWorld; + +@end + +#endif diff --git a/cocos2d/Platforms/Mac/NSEvent+CC.m b/cocos2d/Platforms/Mac/NSEvent+CC.m new file mode 100644 index 0000000..d77ff26 --- /dev/null +++ b/cocos2d/Platforms/Mac/NSEvent+CC.m @@ -0,0 +1,51 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2013 Apportable Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#import "ccMacros.h" + +#ifdef __CC_PLATFORM_MAC + +#import "NSEvent+CC.h" +#import "CCDirectorMac.h" +#import "CCNode.h" + +@implementation NSEvent (CC) + +- (CGPoint) locationInNode:(CCNode *)node +{ + CCDirector* dir = [CCDirector sharedDirector]; + CGPoint mouseLocation = [dir convertEventToGL:self]; + return [node convertToNodeSpace:mouseLocation]; +} + +- (CGPoint) locationInWorld +{ + CCDirector* dir = [CCDirector sharedDirector]; + + return [dir convertEventToGL:self]; +} + +@end + +#endif diff --git a/cocos2d/Platforms/iOS/CCDirectorIOS.h b/cocos2d/Platforms/iOS/CCDirectorIOS.h new file mode 100644 index 0000000..89053fc --- /dev/null +++ b/cocos2d/Platforms/iOS/CCDirectorIOS.h @@ -0,0 +1,110 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2008-2010 Ricardo Quesada + * Copyright (c) 2011 Zynga Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + + +// Only compile this code on iOS. These files should NOT be included on your Mac project. +// But in case they are included, it won't be compiled. +#import "ccMacros.h" + +#ifdef __CC_PLATFORM_IOS + +#import "CCDirector.h" + +#pragma clang diagnostic push COCOS2D +#pragma clang diagnostic ignored "-Wignored-qualifiers" +#import "kazmath/mat4.h" +#pragma clang diagnostic pop COCOS2D + +/** CCDirector extensions for iPhone + */ +@interface CCDirector (iOSExtension) + +/** The size in pixels of the surface. It could be different than the screen size. + High-res devices might have a higher surface size than the screen size. + In non High-res device the contentScale will be emulated. + + The recommend way to enable Retina Display is by using the "enableRetinaDisplay:(BOOL)enabled" method. + + @since v0.99.4 + */ +-(void) setContentScaleFactor:(CGFloat)scaleFactor; + +/** Will enable Retina Display on devices that supports it. + It will enable Retina Display on iPhone4 and iPod Touch 4. + It will return YES, if it could enabled it, otherwise it will return NO. + + This is the recommended way to enable Retina Display. + @since v0.99.5 + */ +-(BOOL) enableRetinaDisplay:(BOOL)enableRetina; + +/** returns the content scale factor */ +-(CGFloat) contentScaleFactor; + +/** converts a UITouch to a GL point */ +-(CGPoint)convertTouchToGL:(UITouch*)touch; +@end + +#pragma mark - +#pragma mark CCDirectorIOS + +/** CCDirectorIOS: Base class of iOS directors + @since v0.99.5 + */ +@interface CCDirectorIOS : CCDirector +{ + /* contentScaleFactor could be simulated */ + BOOL _isContentScaleSupported; + +} + +// XXX: At least one method is needed for BridgeSupport +- (void) drawScene; + +@end + +/** DisplayLinkDirector is a Director that synchronizes timers with the refresh rate of the display. + * + * Features and Limitations: + * - Only available on 3.1+ + * - Scheduled timers & drawing are synchronizes with the refresh rate of the display + * - Only supports animation intervals of 1/60 1/30 & 1/15 + * + * It is the recommended Director if the SDK is 3.1 or newer + * + * @since v0.8.2 + */ +@interface CCDirectorDisplayLink : CCDirectorIOS +{ + CADisplayLink *_displayLink; + CFTimeInterval _lastDisplayTime; +} +-(void) mainLoop:(id)sender; +@end + +// optimization. Should only be used to read it. Never to write it. +extern CGFloat __ccContentScaleFactor; + +#endif // __CC_PLATFORM_IOS diff --git a/src/cocos2d/Platforms/iOS/CCDirectorIOS.m b/cocos2d/Platforms/iOS/CCDirectorIOS.m similarity index 54% rename from src/cocos2d/Platforms/iOS/CCDirectorIOS.m rename to cocos2d/Platforms/iOS/CCDirectorIOS.m index 22854f6..edb85db 100644 --- a/src/cocos2d/Platforms/iOS/CCDirectorIOS.m +++ b/cocos2d/Platforms/iOS/CCDirectorIOS.m @@ -26,34 +26,38 @@ // Only compile this code on iOS. These files should NOT be included on your Mac project. // But in case they are included, it won't be compiled. -#import "../../ccMacros.h" +#import "ccMacros.h" #ifdef __CC_PLATFORM_IOS #import // cocos2d imports #import "CCDirectorIOS.h" -#import "CCTouchDelegateProtocol.h" -#import "CCTouchDispatcher.h" -#import "../../CCScheduler.h" -#import "../../CCActionManager.h" -#import "../../CCTextureCache.h" -#import "../../ccMacros.h" -#import "../../CCScene.h" -#import "../../CCGLProgram.h" -#import "../../ccGLStateCache.h" -#import "../../CCLayer.h" +#import "CCScheduler.h" +#import "CCActionManager.h" +#import "CCTextureCache.h" +#import "ccMacros.h" +#import "CCScene.h" +#import "CCGLProgram.h" +#import "ccGLStateCache.h" +#import "CCLayer.h" +#import "ccFPSImages.h" +#import "CCConfiguration.h" // support imports -#import "../../Support/OpenGL_Internal.h" -#import "../../Support/CGPointExtension.h" -#import "../../Support/TransformUtils.h" +#import "Support/OpenGL_Internal.h" +#import "Support/CGPointExtension.h" +#import "Support/TransformUtils.h" +#import "Support/CCFileUtils.h" +#pragma clang diagnostic push COCOS2D +#pragma clang diagnostic ignored "-Wignored-qualifiers" #import "kazmath/kazmath.h" #import "kazmath/GL/matrix.h" +#pragma clang diagnostic pop COCOS2D #if CC_ENABLE_PROFILERS -#import "../../Support/CCProfiling.h" +#import "Support/CCProfiling.h" #endif @@ -84,15 +88,6 @@ -(void) setInterfaceOrientationDelegate:(id)delegate // override me } --(CCTouchDispatcher*) touchDispatcher -{ - return nil; -} - --(void) setTouchDispatcher:(CCTouchDispatcher*)touchDispatcher -{ - // -} @end @@ -111,33 +106,37 @@ - (id) init if( (self=[super init]) ) { __ccContentScaleFactor = 1; - isContentScaleSupported_ = NO; + _isContentScaleSupported = NO; - touchDispatcher_ = [[CCTouchDispatcher alloc] init]; + + // running thread is main thread on iOS - runningThread_ = [NSThread currentThread]; + _runningThread = [NSThread currentThread]; // Apparently it comes with a default view, and we don't want it // [self setView:nil]; + + if( UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) + { + self.positionScaleFactor = 2; + } + else + { + self.positionScaleFactor = 1; + } } return self; } -- (void) dealloc -{ - [touchDispatcher_ release]; - - [super dealloc]; -} // // Draw the Scene // - (void) drawScene -{ - /* calculate "global" dt */ +{ + /* calculate "global" dt */ [self calculateDeltaTime]; CCGLView *openGLview = (CCGLView*)[self view]; @@ -145,41 +144,50 @@ - (void) drawScene [EAGLContext setCurrentContext: [openGLview context]]; /* tick before glClear: issue #533 */ - if( ! isPaused_ ) - [scheduler_ update: dt]; + if( ! _isPaused ) + [_scheduler update: _dt]; glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); /* to avoid flickr, nextScene MUST be here: after tick and before draw. XXX: Which bug is this one. It seems that it can't be reproduced with v0.9 */ - if( nextScene_ ) + if( _nextScene ) [self setNextScene]; kmGLPushMatrix(); - [runningScene_ visit]; + [_runningScene visit]; - [notificationNode_ visit]; + [_notificationNode visit]; - if( displayStats_ ) + if( _displayStats ) [self showStats]; kmGLPopMatrix(); - totalFrames_++; + _totalFrames++; [openGLview swapBuffers]; - if( displayStats_ ) + if( _displayStats ) [self calculateMPF]; + } --(void) setProjection:(ccDirectorProjection)projection +-(void) setViewport { - CGSize size = winSizeInPixels_; - CGSize sizePoint = winSizeInPoints_; - + CGSize size = _winSizeInPixels; glViewport(0, 0, size.width, size.height ); +} + +#pragma clang diagnostic push COCOS2D +#pragma clang diagnostic ignored "-Wfloat-equal" +-(void) setProjection:(ccDirectorProjection)projection +{ + CGSize size = _winSizeInPixels; + CGSize sizePoint = _winSizeInPoints; + + [self setViewport]; switch (projection) { case kCCDirectorProjection2D: @@ -222,33 +230,30 @@ -(void) setProjection:(ccDirectorProjection)projection } case kCCDirectorProjectionCustom: - if( [delegate_ respondsToSelector:@selector(updateProjection)] ) - [delegate_ updateProjection]; + if( [_delegate respondsToSelector:@selector(updateProjection)] ) + [_delegate updateProjection]; break; - default: - CCLOG(@"cocos2d: Director: unrecognized projection"); - break; + //default: + // CCLOG(@"cocos2d: Director: unrecognized projection"); + // break; } - projection_ = projection; + _projection = projection; ccSetProjectionMatrixDirty(); } -#pragma mark Director - TouchDispatcher - --(CCTouchDispatcher*) touchDispatcher +// override default logic +- (void)runWithScene:(CCScene*) scene { - return touchDispatcher_; -} + NSAssert( scene != nil, @"Argument must be non-nil"); + NSAssert(_runningScene == nil, @"This command can only be used to start the CCDirector. There is already a scene present."); + + [self pushScene:scene]; --(void) setTouchDispatcher:(CCTouchDispatcher*)touchDispatcher -{ - if( touchDispatcher != touchDispatcher_ ) { - [touchDispatcher_ release]; - touchDispatcher_ = [touchDispatcher retain]; - } + NSThread *thread = [self runningThread]; + [self performSelector:@selector(drawScene) onThread:thread withObject:nil waitUntilDone:YES]; } #pragma mark Director - Retina Display @@ -263,22 +268,22 @@ -(void) setContentScaleFactor:(CGFloat)scaleFactor if( scaleFactor != __ccContentScaleFactor ) { __ccContentScaleFactor = scaleFactor; - winSizeInPixels_ = CGSizeMake( winSizeInPoints_.width * scaleFactor, winSizeInPoints_.height * scaleFactor ); + _winSizeInPixels = CGSizeMake( _winSizeInPoints.width * scaleFactor, _winSizeInPoints.height * scaleFactor ); - if( view_ ) + if( __view ) [self updateContentScaleFactor]; // update projection - [self setProjection:projection_]; + [self setProjection:_projection]; } } -(void) updateContentScaleFactor { - NSAssert( [view_ respondsToSelector:@selector(setContentScaleFactor:)], @"cocos2d v2.0+ runs on iOS 4 or later"); + NSAssert( [__view respondsToSelector:@selector(setContentScaleFactor:)], @"cocos2d v2.0+ runs on iOS 4 or later"); - [view_ setContentScaleFactor: __ccContentScaleFactor]; - isContentScaleSupported_ = YES; + [__view setContentScaleFactor: __ccContentScaleFactor]; + _isContentScaleSupported = YES; } -(BOOL) enableRetinaDisplay:(BOOL)enabled @@ -289,10 +294,10 @@ -(BOOL) enableRetinaDisplay:(BOOL)enabled // Already disabled if( ! enabled && __ccContentScaleFactor == 1 ) - return YES; + return NO; // setContentScaleFactor is not supported - if (! [view_ respondsToSelector:@selector(setContentScaleFactor:)]) + if (! [__view respondsToSelector:@selector(setContentScaleFactor:)]) return NO; // SD device @@ -303,6 +308,7 @@ -(BOOL) enableRetinaDisplay:(BOOL)enabled [self setContentScaleFactor:newScale]; // Load Hi-Res FPS label + [[CCFileUtils sharedFileUtils] buildSearchResolutionsOrder]; [self createStatsLabel]; return YES; @@ -311,35 +317,73 @@ -(BOOL) enableRetinaDisplay:(BOOL)enabled // overriden, don't call super -(void) reshapeProjection:(CGSize)size { - winSizeInPoints_ = [view_ bounds].size; - winSizeInPixels_ = CGSizeMake(winSizeInPoints_.width * __ccContentScaleFactor, winSizeInPoints_.height *__ccContentScaleFactor); + _winSizeInPoints = [__view bounds].size; + _winSizeInPixels = CGSizeMake(_winSizeInPoints.width * __ccContentScaleFactor, _winSizeInPoints.height *__ccContentScaleFactor); - [self setProjection:projection_]; + [self setProjection:_projection]; + + if( [_delegate respondsToSelector:@selector(directorDidReshapeProjection:)] ) + [_delegate directorDidReshapeProjection:self]; +} + +static void +GLToClipTransform(kmMat4 *transformOut) +{ + kmMat4 projection; + kmGLGetMatrix(KM_GL_PROJECTION, &projection); + + kmMat4 modelview; + kmGLGetMatrix(KM_GL_MODELVIEW, &modelview); + + kmMat4Multiply(transformOut, &projection, &modelview); } #pragma mark Director Point Convertion -(CGPoint)convertToGL:(CGPoint)uiPoint { - CGSize s = winSizeInPoints_; - float newY = s.height - uiPoint.y; + kmMat4 transform; + GLToClipTransform(&transform); + + kmMat4 transformInv; + kmMat4Inverse(&transformInv, &transform); + + // Calculate z=0 using -> transform*[0, 0, 0, 1]/w + kmScalar zClip = transform.mat[14]/transform.mat[15]; + + CGSize glSize = __view.bounds.size; + kmVec3 clipCoord = {2.0*uiPoint.x/glSize.width - 1.0, 1.0 - 2.0*uiPoint.y/glSize.height, zClip}; + + kmVec3 glCoord; + kmVec3TransformCoord(&glCoord, &clipCoord, &transformInv); + +// NSLog(@"uiPoint: %@, glPoint: %@", NSStringFromCGPoint(uiPoint), NSStringFromCGPoint(ccp(glCoord.x, glCoord.y))); + return ccp(glCoord.x, glCoord.y); +} - return ccp( uiPoint.x, newY ); +-(CGPoint)convertTouchToGL:(UITouch*)touch +{ + CGPoint uiPoint = [touch locationInView: [touch view]]; + return [self convertToGL:uiPoint]; } + -(CGPoint)convertToUI:(CGPoint)glPoint { - CGSize winSize = winSizeInPoints_; - int oppositeY = winSize.height - glPoint.y; - - return ccp(glPoint.x, oppositeY); + kmMat4 transform; + GLToClipTransform(&transform); + + kmVec3 clipCoord; + // Need to calculate the zero depth from the transform. + kmVec3 glCoord = {glPoint.x, glPoint.y, 0.0}; + kmVec3TransformCoord(&clipCoord, &glCoord, &transform); + + CGSize glSize = __view.bounds.size; + return ccp(glSize.width*(clipCoord.x*0.5 + 0.5), glSize.height*(-clipCoord.y*0.5 + 0.5)); } -(void) end { - // don't release the event handlers - // They are needed in case the director is run again - [touchDispatcher_ removeAllDelegates]; [super end]; } @@ -347,20 +391,18 @@ -(void) end #pragma mark Director - UIViewController delegate --(void) setView:(CCGLView *)view +-(void) setView:(UIView *)view { - if( view != view_) { + if( view != __view) { [super setView:view]; if( view ) { // set size - winSizeInPixels_ = CGSizeMake(winSizeInPoints_.width * __ccContentScaleFactor, winSizeInPoints_.height *__ccContentScaleFactor); + _winSizeInPixels = CGSizeMake(_winSizeInPoints.width * __ccContentScaleFactor, _winSizeInPoints.height *__ccContentScaleFactor); if( __ccContentScaleFactor != 1 ) [self updateContentScaleFactor]; - [view setTouchDelegate: touchDispatcher_]; - [touchDispatcher_ setDispatchEvents: YES]; } } } @@ -369,16 +411,18 @@ -(void) setView:(CCGLView *)view - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { BOOL ret =YES; - if( [delegate_ respondsToSelector:_cmd] ) - ret = (BOOL) [delegate_ shouldAutorotateToInterfaceOrientation:interfaceOrientation]; + if( [_delegate respondsToSelector:_cmd] ) + ret = (BOOL) [_delegate shouldAutorotateToInterfaceOrientation:interfaceOrientation]; return ret; } --(void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration -{ - // do something ? -} +// Commented. See issue #1453 for further info: http://code.google.com/p/cocos2d-iphone/issues/detail?id=1453 +//-(void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration +//{ +// if( [_delegate respondsToSelector:_cmd] ) +// [_delegate willRotateToInterfaceOrientation:toInterfaceOrientation duration:duration]; +//} -(void) viewWillAppear:(BOOL)animated @@ -432,6 +476,27 @@ - (void)viewDidUnload // Release any retained subviews of the main view. // e.g. self.myOutlet = nil; } + +#pragma mark helper + +-(void)getFPSImageData:(unsigned char**)datapointer length:(NSUInteger*)len +{ + int device = [[CCConfiguration sharedConfiguration] runningDevice]; + + if( device == kCCDeviceiPadRetinaDisplay) { + *datapointer = cc_fps_images_ipadhd_png; + *len = cc_fps_images_ipadhd_len(); + + } else if( device == kCCDeviceiPhoneRetinaDisplay || device == kCCDeviceiPhone5RetinaDisplay ) { + *datapointer = cc_fps_images_hd_png; + *len = cc_fps_images_hd_len(); + + } else { + *datapointer = cc_fps_images_png; + *len = cc_fps_images_len(); + } +} + @end @@ -448,8 +513,8 @@ -(void) mainLoop:(id)sender - (void)setAnimationInterval:(NSTimeInterval)interval { - animationInterval_ = interval; - if(displayLink_){ + _animationInterval = interval; + if(_displayLink){ [self stopAnimation]; [self startAnimation]; } @@ -457,75 +522,81 @@ - (void)setAnimationInterval:(NSTimeInterval)interval - (void) startAnimation { - if(isAnimating_) + [super startAnimation]; + + if(_isAnimating) return; - gettimeofday( &lastUpdate_, NULL); + gettimeofday( &_lastUpdate, NULL); // approximate frame rate // assumes device refreshes at 60 fps - int frameInterval = (int) floor(animationInterval_ * 60.0f); + int frameInterval = (int) (floor(_animationInterval * 60.0f)); CCLOG(@"cocos2d: animation started with frame interval: %.2f", 60.0f/frameInterval); - displayLink_ = [CADisplayLink displayLinkWithTarget:self selector:@selector(mainLoop:)]; - [displayLink_ setFrameInterval:frameInterval]; + _displayLink = [CADisplayLink displayLinkWithTarget:self selector:@selector(mainLoop:)]; + [_displayLink setFrameInterval:frameInterval]; #if CC_DIRECTOR_IOS_USE_BACKGROUND_THREAD // - runningThread_ = [[NSThread alloc] initWithTarget:self selector:@selector(threadMainLoop) object:nil]; - [runningThread_ start]; + _runningThread = [[NSThread alloc] initWithTarget:self selector:@selector(threadMainLoop) object:nil]; + [_runningThread start]; #else // setup DisplayLink in main thread - [displayLink_ addToRunLoop:[NSRunLoop currentRunLoop] forMode:NSDefaultRunLoopMode]; + [_displayLink addToRunLoop:[NSRunLoop currentRunLoop] forMode:NSDefaultRunLoopMode]; #endif - isAnimating_ = YES; + _isAnimating = YES; } +#pragma clang diagnostic pop COCOS2D - (void) stopAnimation { - if(!isAnimating_) + if(!_isAnimating) return; CCLOG(@"cocos2d: animation stopped"); #if CC_DIRECTOR_IOS_USE_BACKGROUND_THREAD - [runningThread_ cancel]; - [runningThread_ release]; - runningThread_ = nil; + [_runningThread cancel]; + [_runningThread release]; + _runningThread = nil; #endif - [displayLink_ invalidate]; - displayLink_ = nil; - isAnimating_ = NO; + [_displayLink invalidate]; + _displayLink = nil; + _isAnimating = NO; } +#pragma clang diagnostic push COCOS2D +#pragma clang diagnostic ignored "-Wfloat-equal" // Overriden in order to use a more stable delta time -(void) calculateDeltaTime { // New delta time. Re-fixed issue #1277 - if( nextDeltaTimeZero_ || lastDisplayTime_==0 ) { - dt = 0; - nextDeltaTimeZero_ = NO; + if( _nextDeltaTimeZero || _lastDisplayTime==0 ) { + _dt = 0; + _nextDeltaTimeZero = NO; } else { - dt = displayLink_.timestamp - lastDisplayTime_; - dt = MAX(0,dt); + _dt = _displayLink.timestamp - _lastDisplayTime; + _dt = MAX(0,_dt); } // Store this timestamp for next time - lastDisplayTime_ = displayLink_.timestamp; + _lastDisplayTime = _displayLink.timestamp; // needed for SPF - if( displayStats_ ) - gettimeofday( &lastUpdate_, NULL); + if( _displayStats ) + gettimeofday( &_lastUpdate, NULL); #ifdef DEBUG // If we are debugging our code, prevent big delta time - if( dt > 0.2f ) - dt = 1/60.0f; + if( _dt > 0.2f ) + _dt = 1/60.0f; #endif } +#pragma clang diagnostic pop COCOS2D #pragma mark Director Thread @@ -535,21 +606,16 @@ -(void) calculateDeltaTime // -(void) threadMainLoop { - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; + @autoreleasepool { - [displayLink_ addToRunLoop:[NSRunLoop currentRunLoop] forMode:NSDefaultRunLoopMode]; + [_displayLink addToRunLoop:[NSRunLoop currentRunLoop] forMode:NSDefaultRunLoopMode]; - // start the run loop - [[NSRunLoop currentRunLoop] run]; + // start the run loop + [[NSRunLoop currentRunLoop] run]; - [pool release]; + } } --(void) dealloc -{ - [displayLink_ release]; - [super dealloc]; -} @end #endif // __CC_PLATFORM_IOS diff --git a/cocos2d/Platforms/iOS/CCES2Renderer.h b/cocos2d/Platforms/iOS/CCES2Renderer.h new file mode 100644 index 0000000..325f793 --- /dev/null +++ b/cocos2d/Platforms/iOS/CCES2Renderer.h @@ -0,0 +1,83 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2010 Ricardo Quesada + * Copyright (c) 2011 Zynga Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * + * File autogenerated with Xcode. Adapted for cocos2d needs. + */ + +// Only compile this code on iOS. These files should NOT be included on your Mac project. +// But in case they are included, it won't be compiled. +#import "ccMacros.h" +#ifdef __CC_PLATFORM_IOS + +#import "CCESRenderer.h" + +#import +#import + +@interface CCES2Renderer : NSObject +{ + // The pixel dimensions of the CAEAGLLayer + GLint _backingWidth; + GLint _backingHeight; + + unsigned int _samplesToUse; + BOOL _multiSampling; + + unsigned int _depthFormat; + unsigned int _pixelFormat; + + // The OpenGL ES names for the framebuffer and renderbuffer used to render to this view + GLuint _defaultFramebuffer; + GLuint _colorRenderbuffer; + GLuint _depthBuffer; + + + //buffers for MSAA + GLuint _msaaFramebuffer; + GLuint _msaaColorbuffer; + + EAGLContext *_context; +} + +/** Color Renderbuffer */ +@property (nonatomic,readonly) GLuint colorRenderbuffer; + +/** Default Renderbuffer */ +@property (nonatomic,readonly) GLuint defaultFramebuffer; + +/** MSAA Framebuffer */ +@property (nonatomic,readonly) GLuint msaaFramebuffer; + +/** MSAA Color Buffer */ +@property (nonatomic,readonly) GLuint msaaColorbuffer; + +/** EAGLContext */ +@property (nonatomic,readonly) EAGLContext* context; + +- (BOOL)resizeFromLayer:(CAEAGLLayer *)layer; +@end + +#endif // __CC_PLATFORM_IOS + diff --git a/src/cocos2d/Platforms/iOS/CCES2Renderer.m b/cocos2d/Platforms/iOS/CCES2Renderer.m similarity index 53% rename from src/cocos2d/Platforms/iOS/CCES2Renderer.m rename to cocos2d/Platforms/iOS/CCES2Renderer.m index ad7f72e..ae7110f 100644 --- a/src/cocos2d/Platforms/iOS/CCES2Renderer.m +++ b/cocos2d/Platforms/iOS/CCES2Renderer.m @@ -28,21 +28,21 @@ // Only compile this code on iOS. These files should NOT be included on your Mac project. // But in case they are included, it won't be compiled. -#import "../../ccMacros.h" +#import "ccMacros.h" #ifdef __CC_PLATFORM_IOS #import "CCES2Renderer.h" -#import "../../Support/OpenGL_Internal.h" -#import "../../ccMacros.h" +#import "Support/OpenGL_Internal.h" +#import "ccMacros.h" @implementation CCES2Renderer -@synthesize context=context_; -@synthesize defaultFramebuffer=defaultFramebuffer_; -@synthesize colorRenderbuffer=colorRenderbuffer_; -@synthesize msaaColorbuffer=msaaColorbuffer_; -@synthesize msaaFramebuffer=msaaFramebuffer_; +@synthesize context=_context; +@synthesize defaultFramebuffer=_defaultFramebuffer; +@synthesize colorRenderbuffer=_colorRenderbuffer; +@synthesize msaaColorbuffer=_msaaColorbuffer; +@synthesize msaaFramebuffer=_msaaFramebuffer; // Create an OpenGL ES 2.0 context - (id) initWithDepthFormat:(unsigned int)depthFormat withPixelFormat:(unsigned int)pixelFormat withSharegroup:(EAGLSharegroup*)sharegroup withMultiSampling:(BOOL) multiSampling withNumberOfSamples:(unsigned int) requestedSamples @@ -51,41 +51,40 @@ - (id) initWithDepthFormat:(unsigned int)depthFormat withPixelFormat:(unsigned i if (self) { if( ! sharegroup ) - context_ = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2]; + _context = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2]; else - context_ = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2 sharegroup:sharegroup]; + _context = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2 sharegroup:sharegroup]; - if (!context_ || ![EAGLContext setCurrentContext:context_] ) + if (!_context || ![EAGLContext setCurrentContext:_context] ) { - [self release]; return nil; } - depthFormat_ = depthFormat; - pixelFormat_ = pixelFormat; - multiSampling_ = multiSampling; + _depthFormat = depthFormat; + _pixelFormat = pixelFormat; + _multiSampling = multiSampling; // Create default framebuffer object. The backing will be allocated for the current layer in -resizeFromLayer - glGenFramebuffers(1, &defaultFramebuffer_); - NSAssert( defaultFramebuffer_, @"Can't create default frame buffer"); + glGenFramebuffers(1, &_defaultFramebuffer); + NSAssert( _defaultFramebuffer, @"Can't create default frame buffer"); - glGenRenderbuffers(1, &colorRenderbuffer_); - NSAssert( colorRenderbuffer_, @"Can't create default render buffer"); + glGenRenderbuffers(1, &_colorRenderbuffer); + NSAssert( _colorRenderbuffer, @"Can't create default render buffer"); - glBindFramebuffer(GL_FRAMEBUFFER, defaultFramebuffer_); - glBindRenderbuffer(GL_RENDERBUFFER, colorRenderbuffer_); - glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, colorRenderbuffer_); + glBindFramebuffer(GL_FRAMEBUFFER, _defaultFramebuffer); + glBindRenderbuffer(GL_RENDERBUFFER, _colorRenderbuffer); + glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, _colorRenderbuffer); - if (multiSampling_) + if (_multiSampling) { GLint maxSamplesAllowed; glGetIntegerv(GL_MAX_SAMPLES_APPLE, &maxSamplesAllowed); - samplesToUse_ = MIN(maxSamplesAllowed,requestedSamples); + _samplesToUse = MIN((unsigned int)maxSamplesAllowed,requestedSamples); /* Create the MSAA framebuffer (offscreen) */ - glGenFramebuffers(1, &msaaFramebuffer_); - NSAssert( msaaFramebuffer_, @"Can't create default MSAA frame buffer"); - glBindFramebuffer(GL_FRAMEBUFFER, msaaFramebuffer_); + glGenFramebuffers(1, &_msaaFramebuffer); + NSAssert( _msaaFramebuffer, @"Can't create default MSAA frame buffer"); + glBindFramebuffer(GL_FRAMEBUFFER, _msaaFramebuffer); } @@ -98,36 +97,36 @@ - (id) initWithDepthFormat:(unsigned int)depthFormat withPixelFormat:(unsigned i - (BOOL)resizeFromLayer:(CAEAGLLayer *)layer { // Allocate color buffer backing based on the current layer size - glBindRenderbuffer(GL_RENDERBUFFER, colorRenderbuffer_); + glBindRenderbuffer(GL_RENDERBUFFER, _colorRenderbuffer); - if( ! [context_ renderbufferStorage:GL_RENDERBUFFER fromDrawable:layer] ) + if( ! [_context renderbufferStorage:GL_RENDERBUFFER fromDrawable:layer] ) CCLOG(@"failed to call context"); - glGetRenderbufferParameteriv(GL_RENDERBUFFER, GL_RENDERBUFFER_WIDTH, &backingWidth_); - glGetRenderbufferParameteriv(GL_RENDERBUFFER, GL_RENDERBUFFER_HEIGHT, &backingHeight_); + glGetRenderbufferParameteriv(GL_RENDERBUFFER, GL_RENDERBUFFER_WIDTH, &_backingWidth); + glGetRenderbufferParameteriv(GL_RENDERBUFFER, GL_RENDERBUFFER_HEIGHT, &_backingHeight); - CCLOG(@"cocos2d: surface size: %dx%d", (int)backingWidth_, (int)backingHeight_); + CCLOG(@"cocos2d: surface size: %dx%d", (int)_backingWidth, (int)_backingHeight); - if (multiSampling_) + if (_multiSampling) { - if ( msaaColorbuffer_) { - glDeleteRenderbuffers(1, &msaaColorbuffer_); - msaaColorbuffer_ = 0; + if ( _msaaColorbuffer) { + glDeleteRenderbuffers(1, &_msaaColorbuffer); + _msaaColorbuffer = 0; } /* Create the offscreen MSAA color buffer. After rendering, the contents of this will be blitted into ColorRenderbuffer */ //msaaFrameBuffer needs to be binded - glBindFramebuffer(GL_FRAMEBUFFER, msaaFramebuffer_); - glGenRenderbuffers(1, &msaaColorbuffer_); - NSAssert(msaaFramebuffer_, @"Can't create MSAA color buffer"); + glBindFramebuffer(GL_FRAMEBUFFER, _msaaFramebuffer); + glGenRenderbuffers(1, &_msaaColorbuffer); + NSAssert(_msaaFramebuffer, @"Can't create MSAA color buffer"); - glBindRenderbuffer(GL_RENDERBUFFER, msaaColorbuffer_); + glBindRenderbuffer(GL_RENDERBUFFER, _msaaColorbuffer); - glRenderbufferStorageMultisampleAPPLE(GL_RENDERBUFFER, samplesToUse_, pixelFormat_ , backingWidth_, backingHeight_); + glRenderbufferStorageMultisampleAPPLE(GL_RENDERBUFFER, _samplesToUse, _pixelFormat , _backingWidth, _backingHeight); - glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, msaaColorbuffer_); + glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, _msaaColorbuffer); GLenum error; if ( (error=glCheckFramebufferStatus(GL_FRAMEBUFFER)) != GL_FRAMEBUFFER_COMPLETE) @@ -139,24 +138,28 @@ - (BOOL)resizeFromLayer:(CAEAGLLayer *)layer CHECK_GL_ERROR(); - if (depthFormat_) + if (_depthFormat) { - if( ! depthBuffer_ ) { - glGenRenderbuffers(1, &depthBuffer_); - NSAssert(depthBuffer_, @"Can't create depth buffer"); + if( ! _depthBuffer ) { + glGenRenderbuffers(1, &_depthBuffer); + NSAssert(_depthBuffer, @"Can't create depth buffer"); } - glBindRenderbuffer(GL_RENDERBUFFER, depthBuffer_); + glBindRenderbuffer(GL_RENDERBUFFER, _depthBuffer); - if( multiSampling_ ) - glRenderbufferStorageMultisampleAPPLE(GL_RENDERBUFFER, samplesToUse_, depthFormat_,backingWidth_, backingHeight_); + if( _multiSampling ) + glRenderbufferStorageMultisampleAPPLE(GL_RENDERBUFFER, _samplesToUse, _depthFormat,_backingWidth, _backingHeight); else - glRenderbufferStorage(GL_RENDERBUFFER, depthFormat_, backingWidth_, backingHeight_); + glRenderbufferStorage(GL_RENDERBUFFER, _depthFormat, _backingWidth, _backingHeight); - glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, depthBuffer_); + glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, _depthBuffer); + if (_depthFormat == GL_DEPTH24_STENCIL8_OES) { + glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, GL_RENDERBUFFER, _depthBuffer); + } + // bind color buffer - glBindRenderbuffer(GL_RENDERBUFFER, colorRenderbuffer_); + glBindRenderbuffer(GL_RENDERBUFFER, _colorRenderbuffer); } CHECK_GL_ERROR(); @@ -173,32 +176,32 @@ - (BOOL)resizeFromLayer:(CAEAGLLayer *)layer -(CGSize) backingSize { - return CGSizeMake( backingWidth_, backingHeight_); + return CGSizeMake( _backingWidth, _backingHeight); } - (NSString*) description { - return [NSString stringWithFormat:@"<%@ = %p | size = %ix%i>", [self class], self, backingWidth_, backingHeight_]; + return [NSString stringWithFormat:@"<%@ = %p | size = %ix%i>", [self class], self, _backingWidth, _backingHeight]; } - (unsigned int) colorRenderBuffer { - return colorRenderbuffer_; + return _colorRenderbuffer; } - (unsigned int) defaultFrameBuffer { - return defaultFramebuffer_; + return _defaultFramebuffer; } - (unsigned int) msaaFrameBuffer { - return msaaFramebuffer_; + return _msaaFramebuffer; } - (unsigned int) msaaColorBuffer { - return msaaColorbuffer_; + return _msaaColorbuffer; } - (void)dealloc @@ -206,41 +209,38 @@ - (void)dealloc CCLOGINFO(@"cocos2d: deallocing %@", self); // Tear down GL - if (defaultFramebuffer_) { - glDeleteFramebuffers(1, &defaultFramebuffer_); - defaultFramebuffer_ = 0; + if (_defaultFramebuffer) { + glDeleteFramebuffers(1, &_defaultFramebuffer); + _defaultFramebuffer = 0; } - if (colorRenderbuffer_) { - glDeleteRenderbuffers(1, &colorRenderbuffer_); - colorRenderbuffer_ = 0; + if (_colorRenderbuffer) { + glDeleteRenderbuffers(1, &_colorRenderbuffer); + _colorRenderbuffer = 0; } - if( depthBuffer_ ) { - glDeleteRenderbuffers(1, &depthBuffer_ ); - depthBuffer_ = 0; + if( _depthBuffer ) { + glDeleteRenderbuffers(1, &_depthBuffer ); + _depthBuffer = 0; } - if ( msaaColorbuffer_) + if ( _msaaColorbuffer) { - glDeleteRenderbuffers(1, &msaaColorbuffer_); - msaaColorbuffer_ = 0; + glDeleteRenderbuffers(1, &_msaaColorbuffer); + _msaaColorbuffer = 0; } - if ( msaaFramebuffer_) + if ( _msaaFramebuffer) { - glDeleteRenderbuffers(1, &msaaFramebuffer_); - msaaFramebuffer_ = 0; + glDeleteRenderbuffers(1, &_msaaFramebuffer); + _msaaFramebuffer = 0; } // Tear down context - if ([EAGLContext currentContext] == context_) + if ([EAGLContext currentContext] == _context) [EAGLContext setCurrentContext:nil]; - [context_ release]; - context_ = nil; - [super dealloc]; } @end diff --git a/cocos2d/Platforms/iOS/CCESRenderer.h b/cocos2d/Platforms/iOS/CCESRenderer.h new file mode 100644 index 0000000..b0dc688 --- /dev/null +++ b/cocos2d/Platforms/iOS/CCESRenderer.h @@ -0,0 +1,54 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2010 Ricardo Quesada + * Copyright (c) 2011 Zynga Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * + * File autogenerated with Xcode. Adapted for cocos2d needs. + */ + +// Only compile this code on iOS. These files should NOT be included on your Mac project. +// But in case they are included, it won't be compiled. +#import "ccMacros.h" +#ifdef __CC_PLATFORM_IOS + +#import + +#import +#import + +@protocol CCESRenderer + +- (id) initWithDepthFormat:(unsigned int)depthFormat withPixelFormat:(unsigned int)pixelFormat withSharegroup:(EAGLSharegroup*)sharegroup withMultiSampling:(BOOL) multiSampling withNumberOfSamples:(unsigned int) requestedSamples; + +- (BOOL) resizeFromLayer:(CAEAGLLayer *)layer; + +- (EAGLContext*) context; +- (CGSize) backingSize; + +- (unsigned int) colorRenderBuffer; +- (unsigned int) defaultFrameBuffer; +- (unsigned int) msaaFrameBuffer; +- (unsigned int) msaaColorBuffer; +@end + +#endif // __CC_PLATFORM_IOS diff --git a/cocos2d/Platforms/iOS/CCGLView.h b/cocos2d/Platforms/iOS/CCGLView.h new file mode 100644 index 0000000..efa2094 --- /dev/null +++ b/cocos2d/Platforms/iOS/CCGLView.h @@ -0,0 +1,162 @@ +/* + +===== IMPORTANT ===== + +This is sample code demonstrating API, technology or techniques in development. +Although this sample code has been reviewed for technical accuracy, it is not +final. Apple is supplying this information to help you plan for the adoption of +the technologies and programming interfaces described herein. This information +is subject to change, and software implemented based on this sample code should +be tested with final operating system software and final documentation. Newer +versions of this sample code may be provided with future seeds of the API or +technology. For information about updates to this and other developer +documentation, view the New & Updated sidebars in subsequent documentation +seeds. + +===================== + +File: CCGLView.h +Abstract: Convenience class that wraps the CAEAGLLayer from CoreAnimation into a +UIView subclass. + +Version: 1.3 + +Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple Inc. +("Apple") in consideration of your agreement to the following terms, and your +use, installation, modification or redistribution of this Apple software +constitutes acceptance of these terms. If you do not agree with these terms, +please do not use, install, modify or redistribute this Apple software. + +In consideration of your agreement to abide by the following terms, and subject +to these terms, Apple grants you a personal, non-exclusive license, under +Apple's copyrights in this original Apple software (the "Apple Software"), to +use, reproduce, modify and redistribute the Apple Software, with or without +modifications, in source and/or binary forms; provided that if you redistribute +the Apple Software in its entirety and without modifications, you must retain +this notice and the following text and disclaimers in all such redistributions +of the Apple Software. +Neither the name, trademarks, service marks or logos of Apple Inc. may be used +to endorse or promote products derived from the Apple Software without specific +prior written permission from Apple. Except as expressly stated in this notice, +no other rights or licenses, express or implied, are granted by Apple herein, +including but not limited to any patent rights that may be infringed by your +derivative works or by other works in which the Apple Software may be +incorporated. + +The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES NO +WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED +WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION ALONE OR IN +COMBINATION WITH YOUR PRODUCTS. + +IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE +GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR +DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF +CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF +APPLE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Copyright (C) 2008 Apple Inc. All Rights Reserved. + +*/ + +// Only compile this code on iOS. These files should NOT be included on your Mac project. +// But in case they are included, it won't be compiled. +#import "ccMacros.h" +#ifdef __CC_PLATFORM_IOS + +#import +#import +#import +#import +#import + +#import "CCESRenderer.h" + +//CLASSES: + +@class CCGLView; + +//CLASS INTERFACE: + +/** CCGLView Class. + This class wraps the CAEAGLLayer from CoreAnimation into a convenient UIView subclass. + The view content is basically an EAGL surface you render your OpenGL scene into. + Note that setting the view non-opaque will only work if the EAGL surface has an alpha channel. + + Parameters: + + - viewWithFrame: size of the OpenGL view. For full screen use [_window bounds] + - Possible values: any CGRect + - pixelFormat: Format of the render buffer. Use RGBA8 for better color precision (eg: gradients). But it takes more memory and it is slower + - Possible values: kEAGLColorFormatRGBA8, kEAGLColorFormatRGB565 + - depthFormat: Use stencil if you plan to use CCClippingNode. Use Depth if you plan to use 3D effects, like CCCamera or CCNode#vertexZ + - Possible values: 0, GL_DEPTH_COMPONENT24_OES, GL_DEPTH24_STENCIL8_OES + - sharegroup: OpenGL sharegroup. Useful if you want to share the same OpenGL context between different threads + - Possible values: nil, or any valid EAGLSharegroup group + - multiSampling: Whether or not to enable multisampling + - Possible values: YES, NO + - numberOfSamples: Only valid if multisampling is enabled + - Possible values: 0 to glGetIntegerv(GL_MAX_SAMPLES_APPLE) + */ +@interface CCGLView : UIView +{ + id _renderer; + EAGLContext *__unsafe_unretained _context; // weak ref + + NSString *__unsafe_unretained _pixelformat; + GLuint _depthFormat; + BOOL _preserveBackbuffer; + + CGSize _size; + BOOL _discardFramebufferSupported; + + //fsaa addition + BOOL _multisampling; + unsigned int _requestedSamples; +} + +/** creates an initializes an CCGLView with a frame and 0-bit depth buffer, and a RGB565 color buffer. */ ++ (id) viewWithFrame:(CGRect)frame; +/** creates an initializes an CCGLView with a frame, a color buffer format, and 0-bit depth buffer. */ ++ (id) viewWithFrame:(CGRect)frame pixelFormat:(NSString*)format; +/** creates an initializes an CCGLView with a frame, a color buffer format, and a depth buffer. */ ++ (id) viewWithFrame:(CGRect)frame pixelFormat:(NSString*)format depthFormat:(GLuint)depth; +/** creates an initializes an CCGLView with a frame, a color buffer format, a depth buffer format, a sharegroup, and multisamping */ ++ (id) viewWithFrame:(CGRect)frame pixelFormat:(NSString*)format depthFormat:(GLuint)depth preserveBackbuffer:(BOOL)retained sharegroup:(EAGLSharegroup*)sharegroup multiSampling:(BOOL)multisampling numberOfSamples:(unsigned int)samples; + +/** Initializes an CCGLView with a frame and 0-bit depth buffer, and a RGB565 color buffer */ +- (id) initWithFrame:(CGRect)frame; //These also set the current context +/** Initializes an CCGLView with a frame, a color buffer format, and 0-bit depth buffer */ +- (id) initWithFrame:(CGRect)frame pixelFormat:(NSString*)format; +/** Initializes an CCGLView with a frame, a color buffer format, a depth buffer format, a sharegroup and multisampling support */ +- (id) initWithFrame:(CGRect)frame pixelFormat:(NSString*)format depthFormat:(GLuint)depth preserveBackbuffer:(BOOL)retained sharegroup:(EAGLSharegroup*)sharegroup multiSampling:(BOOL)sampling numberOfSamples:(unsigned int)nSamples; + +/** pixel format: it could be RGBA8 (32-bit) or RGB565 (16-bit) */ +@property(nonatomic,readonly) NSString* pixelFormat; +/** depth format of the render buffer: 0, 16 or 24 bits*/ +@property(nonatomic,readonly) GLuint depthFormat; + +/** returns surface size in pixels */ +@property(nonatomic,readonly) CGSize surfaceSize; + +/** OpenGL context */ +@property(nonatomic,readonly) EAGLContext *context; + +@property(nonatomic,readwrite) BOOL multiSampling; + +/** CCGLView uses double-buffer. This method swaps the buffers */ +-(void) swapBuffers; + +/** uses and locks the OpenGL context */ +-(void) lockOpenGLContext; + +/** unlocks the openGL context */ +-(void) unlockOpenGLContext; + +- (CGPoint) convertPointFromViewToSurface:(CGPoint)point; +- (CGRect) convertRectFromViewToSurface:(CGRect)rect; +@end + +#endif // __CC_PLATFORM_IOS diff --git a/src/cocos2d/Platforms/iOS/CCGLView.m b/cocos2d/Platforms/iOS/CCGLView.m similarity index 69% rename from src/cocos2d/Platforms/iOS/CCGLView.m rename to cocos2d/Platforms/iOS/CCGLView.m index 3347c5e..6b8112e 100644 --- a/src/cocos2d/Platforms/iOS/CCGLView.m +++ b/cocos2d/Platforms/iOS/CCGLView.m @@ -67,18 +67,18 @@ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE // Only compile this code on iOS. These files should NOT be included on your Mac project. // But in case they are included, it won't be compiled. -#import "../../ccMacros.h" +#import "ccMacros.h" #ifdef __CC_PLATFORM_IOS #import #import "CCGLView.h" #import "CCES2Renderer.h" -#import "../../CCDirector.h" -#import "../../ccMacros.h" -#import "../../CCConfiguration.h" -#import "../../Support/OpenGL_Internal.h" - +#import "CCDirector.h" +#import "ccMacros.h" +#import "CCConfiguration.h" +#import "Support/OpenGL_Internal.h" +#import "CCScene.h" //CLASS IMPLEMENTATIONS: @@ -89,11 +89,10 @@ - (unsigned int) convertPixelFormat:(NSString*) pixelFormat; @implementation CCGLView -@synthesize surfaceSize=size_; -@synthesize pixelFormat=pixelformat_, depthFormat=depthFormat_; -@synthesize touchDelegate=touchDelegate_; -@synthesize context=context_; -@synthesize multiSampling=multiSampling_; +@synthesize surfaceSize=_size; +@synthesize pixelFormat=_pixelformat, depthFormat=_depthFormat; +@synthesize context=_context; +@synthesize multiSampling=_multiSampling; + (Class) layerClass { @@ -102,22 +101,22 @@ + (Class) layerClass + (id) viewWithFrame:(CGRect)frame { - return [[[self alloc] initWithFrame:frame] autorelease]; + return [[self alloc] initWithFrame:frame]; } + (id) viewWithFrame:(CGRect)frame pixelFormat:(NSString*)format { - return [[[self alloc] initWithFrame:frame pixelFormat:format] autorelease]; + return [[self alloc] initWithFrame:frame pixelFormat:format]; } + (id) viewWithFrame:(CGRect)frame pixelFormat:(NSString*)format depthFormat:(GLuint)depth { - return [[[self alloc] initWithFrame:frame pixelFormat:format depthFormat:depth preserveBackbuffer:NO sharegroup:nil multiSampling:NO numberOfSamples:0] autorelease]; + return [[self alloc] initWithFrame:frame pixelFormat:format depthFormat:depth preserveBackbuffer:NO sharegroup:nil multiSampling:NO numberOfSamples:0]; } + (id) viewWithFrame:(CGRect)frame pixelFormat:(NSString*)format depthFormat:(GLuint)depth preserveBackbuffer:(BOOL)retained sharegroup:(EAGLSharegroup*)sharegroup multiSampling:(BOOL)multisampling numberOfSamples:(unsigned int)samples { - return [[[self alloc] initWithFrame:frame pixelFormat:format depthFormat:depth preserveBackbuffer:retained sharegroup:sharegroup multiSampling:multisampling numberOfSamples:samples] autorelease]; + return [[self alloc] initWithFrame:frame pixelFormat:format depthFormat:depth preserveBackbuffer:retained sharegroup:sharegroup multiSampling:multisampling numberOfSamples:samples]; } - (id) initWithFrame:(CGRect)frame @@ -134,16 +133,20 @@ - (id) initWithFrame:(CGRect)frame pixelFormat:(NSString*)format depthFormat:(GL { if((self = [super initWithFrame:frame])) { - pixelformat_ = format; - depthFormat_ = depth; - multiSampling_ = sampling; - requestedSamples_ = nSamples; - preserveBackbuffer_ = retained; + _pixelformat = format; + _depthFormat = depth; + _multiSampling = sampling; + _requestedSamples = nSamples; + _preserveBackbuffer = retained; if( ! [self setupSurfaceWithSharegroup:sharegroup] ) { - [self release]; return nil; } + + /** Multiple touch default enabled + @since v2.5 + */ + self.multipleTouchEnabled = YES; CHECK_GL_ERROR_DEBUG(); } @@ -157,14 +160,13 @@ -(id) initWithCoder:(NSCoder *)aDecoder CAEAGLLayer* eaglLayer = (CAEAGLLayer*)[self layer]; - pixelformat_ = kEAGLColorFormatRGB565; - depthFormat_ = 0; // GL_DEPTH_COMPONENT24; - multiSampling_= NO; - requestedSamples_ = 0; - size_ = [eaglLayer bounds].size; + _pixelformat = kEAGLColorFormatRGB565; + _depthFormat = 0; // GL_DEPTH_COMPONENT24; + _multiSampling= NO; + _requestedSamples = 0; + _size = [eaglLayer bounds].size; if( ! [self setupSurfaceWithSharegroup:nil] ) { - [self release]; return nil; } @@ -180,24 +182,24 @@ -(BOOL) setupSurfaceWithSharegroup:(EAGLSharegroup*)sharegroup eaglLayer.opaque = YES; eaglLayer.drawableProperties = [NSDictionary dictionaryWithObjectsAndKeys: - [NSNumber numberWithBool:preserveBackbuffer_], kEAGLDrawablePropertyRetainedBacking, - pixelformat_, kEAGLDrawablePropertyColorFormat, nil]; + [NSNumber numberWithBool:_preserveBackbuffer], kEAGLDrawablePropertyRetainedBacking, + _pixelformat, kEAGLDrawablePropertyColorFormat, nil]; // ES2 renderer only - renderer_ = [[CCES2Renderer alloc] initWithDepthFormat:depthFormat_ - withPixelFormat:[self convertPixelFormat:pixelformat_] + _renderer = [[CCES2Renderer alloc] initWithDepthFormat:_depthFormat + withPixelFormat:[self convertPixelFormat:_pixelformat] withSharegroup:sharegroup - withMultiSampling:multiSampling_ - withNumberOfSamples:requestedSamples_]; + withMultiSampling:_multiSampling + withNumberOfSamples:_requestedSamples]; - NSAssert( renderer_, @"OpenGL ES 2.0 is required"); + NSAssert( _renderer, @"OpenGL ES 2.0 is required"); - if (!renderer_) + if (!_renderer) return NO; - context_ = [renderer_ context]; + _context = [_renderer context]; - discardFramebufferSupported_ = [[CCConfiguration sharedConfiguration] supportsDiscardFramebuffer]; + _discardFramebufferSupported = [[CCConfiguration sharedConfiguration] supportsDiscardFramebuffer]; CHECK_GL_ERROR_DEBUG(); @@ -208,46 +210,47 @@ - (void) dealloc { CCLOGINFO(@"cocos2d: deallocing %@", self); - [renderer_ release]; - [super dealloc]; } - (void) layoutSubviews { - [renderer_ resizeFromLayer:(CAEAGLLayer*)self.layer]; + [_renderer resizeFromLayer:(CAEAGLLayer*)self.layer]; - size_ = [renderer_ backingSize]; + _size = [_renderer backingSize]; // Issue #914 #924 CCDirector *director = [CCDirector sharedDirector]; - [director reshapeProjection:size_]; + [director reshapeProjection:_size]; // Avoid flicker. Issue #350 - NSThread *thread = [director runningThread]; - [director performSelector:@selector(drawScene) onThread:thread withObject:nil waitUntilDone:YES]; + // Only draw if there is something to draw, otherwise it actually creates a flicker of the current glClearColor +// if(director.runningScene){ +// NSThread *thread = [director runningThread]; +// [director performSelector:@selector(drawScene) onThread:thread withObject:nil waitUntilDone:YES]; +// } } - (void) swapBuffers { // IMPORTANT: // - preconditions - // -> context_ MUST be the OpenGL context + // -> _context MUST be the OpenGL context // -> renderbuffer_ must be the the RENDER BUFFER - if (multiSampling_) + if (_multiSampling) { /* Resolve from msaaFramebuffer to resolveFramebuffer */ //glDisable(GL_SCISSOR_TEST); - glBindFramebuffer(GL_READ_FRAMEBUFFER_APPLE, [renderer_ msaaFrameBuffer]); - glBindFramebuffer(GL_DRAW_FRAMEBUFFER_APPLE, [renderer_ defaultFrameBuffer]); + glBindFramebuffer(GL_READ_FRAMEBUFFER_APPLE, [_renderer msaaFrameBuffer]); + glBindFramebuffer(GL_DRAW_FRAMEBUFFER_APPLE, [_renderer defaultFrameBuffer]); glResolveMultisampleFramebufferAPPLE(); } - if( discardFramebufferSupported_) + if( _discardFramebufferSupported) { - if (multiSampling_) + if (_multiSampling) { - if (depthFormat_) + if (_depthFormat) { GLenum attachments[] = {GL_COLOR_ATTACHMENT0, GL_DEPTH_ATTACHMENT}; glDiscardFramebufferEXT(GL_READ_FRAMEBUFFER_APPLE, 2, attachments); @@ -258,24 +261,24 @@ - (void) swapBuffers glDiscardFramebufferEXT(GL_READ_FRAMEBUFFER_APPLE, 1, attachments); } - glBindRenderbuffer(GL_RENDERBUFFER, [renderer_ colorRenderBuffer]); + glBindRenderbuffer(GL_RENDERBUFFER, [_renderer colorRenderBuffer]); } // not MSAA - else if (depthFormat_ ) { + else if (_depthFormat ) { GLenum attachments[] = { GL_DEPTH_ATTACHMENT}; glDiscardFramebufferEXT(GL_FRAMEBUFFER, 1, attachments); } } - if(![context_ presentRenderbuffer:GL_RENDERBUFFER]) + if(![_context presentRenderbuffer:GL_RENDERBUFFER]) CCLOG(@"cocos2d: Failed to swap renderbuffer in %s\n", __FUNCTION__); // We can safely re-bind the framebuffer here, since this will be the // 1st instruction of the new main loop - if( multiSampling_ ) - glBindFramebuffer(GL_FRAMEBUFFER, [renderer_ msaaFrameBuffer]); + if( _multiSampling ) + glBindFramebuffer(GL_FRAMEBUFFER, [_renderer msaaFrameBuffer]); CHECK_GL_ERROR_DEBUG(); } @@ -310,50 +313,42 @@ - (CGPoint) convertPointFromViewToSurface:(CGPoint)point { CGRect bounds = [self bounds]; - return CGPointMake((point.x - bounds.origin.x) / bounds.size.width * size_.width, (point.y - bounds.origin.y) / bounds.size.height * size_.height); + return CGPointMake((point.x - bounds.origin.x) / bounds.size.width * _size.width, (point.y - bounds.origin.y) / bounds.size.height * _size.height); } - (CGRect) convertRectFromViewToSurface:(CGRect)rect { CGRect bounds = [self bounds]; - return CGRectMake((rect.origin.x - bounds.origin.x) / bounds.size.width * size_.width, (rect.origin.y - bounds.origin.y) / bounds.size.height * size_.height, rect.size.width / bounds.size.width * size_.width, rect.size.height / bounds.size.height * size_.height); + return CGRectMake((rect.origin.x - bounds.origin.x) / bounds.size.width * _size.width, (rect.origin.y - bounds.origin.y) / bounds.size.height * _size.height, rect.size.width / bounds.size.width * _size.width, rect.size.height / bounds.size.height * _size.height); } -// Pass the touches to the superview #pragma mark CCGLView - Touch Delegate -- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event -{ - if(touchDelegate_) - { - [touchDelegate_ touchesBegan:touches withEvent:event]; - } +- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { + + // dispatch touch to responder manager + [ [ CCDirector sharedDirector ].responderManager touchesBegan:touches withEvent:event ]; } -- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event -{ - if(touchDelegate_) - { - [touchDelegate_ touchesMoved:touches withEvent:event]; - } +- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event { + + // dispatch touch to responder manager + [ [ CCDirector sharedDirector ].responderManager touchesMoved:touches withEvent:event ]; } -- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event -{ - if(touchDelegate_) - { - [touchDelegate_ touchesEnded:touches withEvent:event]; - } -} -- (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event -{ - if(touchDelegate_) - { - [touchDelegate_ touchesCancelled:touches withEvent:event]; - } +- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event { + + // dispatch touch to responder manager + [ [ CCDirector sharedDirector ].responderManager touchesEnded:touches withEvent:event ]; } +- (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event { + + // dispatch touch to responder manager + [ [ CCDirector sharedDirector ].responderManager touchesCancelled:touches withEvent:event ]; +} + @end diff --git a/cocos2d/Platforms/iOS/CCResponder.h b/cocos2d/Platforms/iOS/CCResponder.h new file mode 100644 index 0000000..a83e0d1 --- /dev/null +++ b/cocos2d/Platforms/iOS/CCResponder.h @@ -0,0 +1,56 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2010 Ricardo Quesada + * Copyright (c) 2011 Zynga Inc. + * Copyright (c) 2013 Lars Birkemose + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * + * File autogenerated with Xcode. Adapted for cocos2d needs. + */ + +#import +#import "Platforms/iOS/CCResponderManager.h" + +@class CCResponderManager; + +#if ( TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR ) + +#import + +#else + +#endif + +// ----------------------------------------------------------------- + +@interface CCResponder : NSObject + +// ----------------------------------------------------------------- + +@property (nonatomic, weak) CCResponderManager *responderManager; + ++ (id)responder; +- (id)init; + +// ----------------------------------------------------------------- + +@end diff --git a/cocos2d/Platforms/iOS/CCResponder.m b/cocos2d/Platforms/iOS/CCResponder.m new file mode 100644 index 0000000..f1cfac4 --- /dev/null +++ b/cocos2d/Platforms/iOS/CCResponder.m @@ -0,0 +1,133 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2010 Ricardo Quesada + * Copyright (c) 2011 Zynga Inc. + * Copyright (c) 2013 Lars Birkemose + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * + * File autogenerated with Xcode. Adapted for cocos2d needs. + */ + +#import "CCResponder.h" +#import "Platforms/iOS/../../CCResponderManager.h" + +// ----------------------------------------------------------------- + +@implementation CCResponder +{ + +} + +// ----------------------------------------------------------------- + ++ (id)responder +{ + return([[self alloc] init]); +} + +// ----------------------------------------------------------------- + +- (id)init +{ + self = [super init]; + NSAssert(self != nil, @"Unable to create class"); + + // initialize + + // done + return(self); +} + +// ----------------------------------------------------------------- +/** touchesBegan will be called if touch handler passed touch on to super ( next in chain ) + @since v2.5 + */ + +- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event +{ + CCResponderManager *strongResponderManager = _responderManager; + strongResponderManager.eventProcessed = NO; +} + +- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event +{ + CCResponderManager *strongResponderManager = _responderManager; + strongResponderManager.eventProcessed = NO; +} + +- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event +{ + CCResponderManager *strongResponderManager = _responderManager; + strongResponderManager.eventProcessed = NO; +} + +- (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event +{ + CCResponderManager *strongResponderManager = _responderManager; + strongResponderManager.eventProcessed = NO; +} + +// ----------------------------------------------------------------- + +@end + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/cocos2d/Platforms/iOS/CCResponderManager.h b/cocos2d/Platforms/iOS/CCResponderManager.h new file mode 100644 index 0000000..65b1857 --- /dev/null +++ b/cocos2d/Platforms/iOS/CCResponderManager.h @@ -0,0 +1,131 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2010 Ricardo Quesada + * Copyright (c) 2011 Zynga Inc. + * Copyright (c) 2013 Lars Birkemose + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * + * File autogenerated with Xcode. Adapted for cocos2d needs. + */ + +#import + +#if TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR + +// ----------------------------------------------------------------- +#pragma mark - iOS +// ----------------------------------------------------------------- + +@class CCNode; + +#import + +#define RESPONDER UIResponder + +@protocol CCResponderProtocol + +@optional +- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event; +- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event; +- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event; +- (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event; + +@end + +// ----------------------------------------------------------------- + +@interface CCTouch : NSObject + +@property (nonatomic, strong) CCNode *node; // the node associated with the touch +@property (nonatomic, weak) UITouch *touch; // the current touch ( should not be retained ) +@property (nonatomic, weak) UIEvent *event; // the current event ( should not be retained ) + +@end + +#else + +// ----------------------------------------------------------------- +#pragma mark - Mac +// ----------------------------------------------------------------- + +#import + +#define RESPONDER NSResponder + +@protocol CCResponderProtocol + +@optional +- (void)mouseDown:(NSEvent *)theEvent; + +@end + + + +#endif + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/cocos2d/Platforms/iOS/CCResponderManager.m b/cocos2d/Platforms/iOS/CCResponderManager.m new file mode 100644 index 0000000..12e1955 --- /dev/null +++ b/cocos2d/Platforms/iOS/CCResponderManager.m @@ -0,0 +1,378 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2010 Ricardo Quesada + * Copyright (c) 2011 Zynga Inc. + * Copyright (c) 2013 Lars Birkemose + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * + * File autogenerated with Xcode. Adapted for cocos2d needs. + */ + +#import "Platforms/iOS/CCResponderManager.h" +#import "CCNode.h" +#import "CCDirector.h" +#import "CCScene.h" + +// ----------------------------------------------------------------- +#pragma mark - +// ----------------------------------------------------------------- + +@implementation CCTouch + +@end + +// ----------------------------------------------------------------- +#pragma mark - +// ----------------------------------------------------------------- + +@implementation CCResponderManager +{ + __weak CCNode* _responderList[CCResponderManagerBufferSize]; + int _responderCount; + NSMutableArray* _touchList; // list of running touches +} + +// ----------------------------------------------------------------- +#pragma mark - create and destroy +// ----------------------------------------------------------------- + ++ (id)responderManager +{ + return([[self alloc] init]); +} + +- (id)init +{ + self = [super init]; + NSAssert(self != nil, @"Unable to create class"); + + // initalize + _touchList = [NSMutableArray array]; + + // reset touch handling + [self removeAllResponders]; + + // done + return(self); +} + +// ----------------------------------------------------------------- +#pragma mark - add and remove touch responders +// ----------------------------------------------------------------- + +- (void)addResponder:(CCNode *)responder +{ + _responderList[_responderCount] = responder; + _responderCount ++; + NSAssert(_responderCount < CCResponderManagerBufferSize, @"Number of touchable nodes pr. scene can not exceed <%d>", CCResponderManagerBufferSize); +} + +- (void)removeAllResponders +{ + _responderCount = 0; +} + +// ----------------------------------------------------------------- +#pragma mark - iOS touch handling - +// ----------------------------------------------------------------- + +#if TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR + +- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event +{ + BOOL responderCanAcceptTouch; + + [self buildResponderList]; + + // go through all touches + for (UITouch *touch in touches) + { + // scan backwards through touch responders + for (int index = _responderCount - 1; index >= 0; index --) + { + CCNode *node = _responderList[index]; + + // check for hit test + if ([node hitTestWithWorldPos:[[CCDirector sharedDirector] convertToGL:[touch locationInView:[CCDirector sharedDirector].view]]] != NO) + { + // if not a multi touch node, check if node already is being touched + responderCanAcceptTouch = YES; + if (node.isMultipleTouchEnabled == NO) + { + // scan current touch objects, and break if object already has a touch + for (CCTouch *touchEntry in _touchList) if (touchEntry.node == node) + { + responderCanAcceptTouch = NO; + break; + } + } + if (responderCanAcceptTouch == NO) break; + + // begin the touch + self.eventProcessed = YES; + if ([node respondsToSelector:@selector(touchesBegan:withEvent:)] != NO) + [node touchesBegan:[NSSet setWithObject:touch] withEvent:event]; + + // if touch was processed, add it and break + if (self.eventProcessed != NO) + { + [self addtouchResponder:node withTouch:touch andEvent:event]; + break; + } + } + } + } +} + +// ----------------------------------------------------------------- + +- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event +{ + [self buildResponderList]; + + // go through all touches + for (UITouch *touch in touches) + { + // get touch object + CCTouch *touchEntry = [self touchResponderForEvent:event]; + + // if a touch object was found + if (touchEntry != nil) + { + // check if it locks touches + if (touchEntry.node.isUserInteractionClaimed != NO) + { + // move the touch + if ([touchEntry.node respondsToSelector:@selector(touchesMoved:withEvent:)] != NO) + [touchEntry.node touchesMoved:[NSSet setWithObject:touch] withEvent:event]; + } + else + { + // as node does not lock touch, check if it was moved outside + if ([touchEntry.node hitTestWithWorldPos:[[CCDirector sharedDirector] convertToGL:[touch locationInView:[CCDirector sharedDirector].view]]] == NO) + { + // cancel the touch + if ([touchEntry.node respondsToSelector:@selector(touchesCancelled:withEvent:)] != NO) + [touchEntry.node touchesCancelled:[NSSet setWithObject:touch] withEvent:event]; + // remove from list + [_touchList removeObject:touchEntry]; + } + else + { + // move the touch + if ([touchEntry.node respondsToSelector:@selector(touchesMoved:withEvent:)] != NO) + [touchEntry.node touchesMoved:[NSSet setWithObject:touch] withEvent:event]; + } + } + } + else + { + // scan backwards through touch responders + for (int index = _responderCount - 1; index >= 0; index --) + { + CCNode *node = _responderList[index]; + + // if the touch responder does not lock touch, it will receive a touchesBegan if a touch is moved inside + if ((node.isUserInteractionClaimed == NO) && ([node hitTestWithWorldPos:[[CCDirector sharedDirector] convertToGL:[touch locationInView:[CCDirector sharedDirector].view ]]] != NO)) + { + // begin the touch + self.eventProcessed = YES; + if ([node respondsToSelector:@selector(touchesBegan:withEvent:)] != NO) + [node touchesBegan:[NSSet setWithObject:touch] withEvent:event]; + + // if touch was accepted, add it and break + if (self.eventProcessed != NO) + { + [self addtouchResponder:node withTouch:touch andEvent:event]; + break; + } + } + } + } + } +} + +// ----------------------------------------------------------------- + +- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event +{ + [self buildResponderList]; + + // go through all touches + for (UITouch *touch in touches) + { + // get touch object + CCTouch *touchEntry = [self touchResponderForEvent:event]; + + if (touchEntry != nil) + { + // end the touch + if ([touchEntry.node respondsToSelector:@selector(touchesEnded:withEvent:)] != NO) + [touchEntry.node touchesEnded:[NSSet setWithObject:touch] withEvent:event]; + // remove from list + [_touchList removeObject:touchEntry]; + } + } +} + +// ----------------------------------------------------------------- + +- (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event +{ + [self buildResponderList]; + + // go through all touches + for (UITouch *touch in touches) + { + // get touch object + CCTouch *touchEntry = [self touchResponderForEvent:event]; + + if (touchEntry != nil) + { + // cancel the touch + NSLog(@"Cancelled with <%d> touch responder(s)", _touchList.count); + if ([touchEntry.node respondsToSelector:@selector(touchesCancelled:withEvent:)] != NO) + [touchEntry.node touchesCancelled:[NSSet setWithObject:touch] withEvent:event]; + // remove from list + [_touchList removeObject:touchEntry]; + } + } +} + +// ----------------------------------------------------------------- +#pragma mark - helper functions +// ----------------------------------------------------------------- +// finds a touch object for an event + +- (CCTouch *)touchResponderForEvent:(UIEvent *)event +{ + for (CCTouch *touchEntry in _touchList) + { + if (touchEntry.event == event) return(touchEntry); + } + return(nil); +} + +// ----------------------------------------------------------------- +// finds a touch object for a node + +- (NSSet *)touchSetForNode:(CCNode *)node +{ + NSMutableSet *result = [NSMutableSet set]; + for (CCTouch *touchEntry in _touchList) + { + if (touchEntry.node == node) [result addObject:touchEntry.touch]; + } + return(result); +} + +// ----------------------------------------------------------------- +// adds a touch object ( running touch ) to the touch object list + +- (void)addtouchResponder:(CCNode *)node withTouch:(UITouch *)touch andEvent:(UIEvent *)event +{ + CCTouch *touchEntry; + + // create a new touch object + touchEntry = [[CCTouch alloc] init]; + touchEntry.node = node; + touchEntry.touch = touch; + touchEntry.event = event; + [_touchList addObject:touchEntry]; +} + +// ----------------------------------------------------------------- + +- (void)buildResponderList +{ + // rebuild touch list + // TODO: only rebuild if dirty + [self removeAllResponders]; + [[CCDirector sharedDirector].runningScene performSelector:@selector(buildResponderList)]; +} + +// ----------------------------------------------------------------- + +#else + +// ----------------------------------------------------------------- +#pragma mark - Mac mouse handling - +// ----------------------------------------------------------------- + +- (void)mouseDown:(NSEvent *)theEvent +{ + +} + +// ----------------------------------------------------------------- + +#endif + +// ----------------------------------------------------------------- +#pragma mark - dirty +// ----------------------------------------------------------------- + +- (void)markAsDirty +{ + +} + + +@end + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/cocos2d/Platforms/iOS/UITouch+CC.h b/cocos2d/Platforms/iOS/UITouch+CC.h new file mode 100644 index 0000000..2642def --- /dev/null +++ b/cocos2d/Platforms/iOS/UITouch+CC.h @@ -0,0 +1,39 @@ + +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2013 Apportable Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#import "ccMacros.h" + +#ifdef __CC_PLATFORM_IOS + +#import "cocos2d.h" +#import + +@interface UITouch (CC) + +- (CGPoint) locationInNode:(CCNode*) node; +- (CGPoint) locationInWorld; +@end + +#endif diff --git a/cocos2d/Platforms/iOS/UITouch+CC.m b/cocos2d/Platforms/iOS/UITouch+CC.m new file mode 100644 index 0000000..2480ab6 --- /dev/null +++ b/cocos2d/Platforms/iOS/UITouch+CC.m @@ -0,0 +1,52 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2013 Apportable Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#import "ccMacros.h" + +#ifdef __CC_PLATFORM_IOS + +#import "UITouch+CC.h" + +@implementation UITouch (CC) + +- (CGPoint) locationInNode:(CCNode*) node +{ + CCDirector* dir = [CCDirector sharedDirector]; + + CGPoint touchLocation = [self locationInView: [self view]]; + touchLocation = [dir convertToGL: touchLocation]; + return [node convertToNodeSpace:touchLocation]; +} + +- (CGPoint) locationInWorld +{ + CCDirector* dir = [CCDirector sharedDirector]; + + CGPoint touchLocation = [self locationInView: [self view]]; + return [dir convertToGL: touchLocation]; +} + +@end + +#endif diff --git a/cocos2d/Support/CCFileUtils.h b/cocos2d/Support/CCFileUtils.h new file mode 100644 index 0000000..83556c5 --- /dev/null +++ b/cocos2d/Support/CCFileUtils.h @@ -0,0 +1,394 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2008-2010 Ricardo Quesada + * Copyright (c) 2011 Zynga Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + */ + + +#import +#import "../ccTypes.h" + +// keys used for the suffix or directory dictionaries +extern NSString const *kCCFileUtilsDefault; +extern NSString const *kCCFileUtilsiPad; +extern NSString const *kCCFileUtilsiPadHD; +extern NSString const *kCCFileUtilsiPhone; +extern NSString const *kCCFileUtilsiPhoneHD; +extern NSString const *kCCFileUtilsiPhone5; +extern NSString const *kCCFileUtilsiPhone5HD; +extern NSString const *kCCFileUtilsMac; +extern NSString const *kCCFileUtilsMacHD; + +extern NSString const *kCCFileUtilsDefaultSearchPath; + +enum { + kCCFileUtilsSearchSuffixMode, + kCCFileUtilsSearchDirectoryMode, +}; + + +/** Helper class to handle file operations */ +@interface CCFileUtils : NSObject +{ + NSFileManager *_fileManager; + NSBundle *_bundle; + + NSMutableDictionary *_fullPathCache; + NSMutableDictionary *_fullPathNoResolutionsCache; + NSMutableDictionary *_removeSuffixCache; + + NSMutableDictionary *_directoriesDict; + NSMutableDictionary *_suffixesDict; + + NSMutableDictionary *_filenameLookup; + + NSMutableArray *_searchResolutionsOrder; + NSMutableArray *_searchPath; + + // it could be suffix (default) or directory + int _searchMode; + + BOOL _enableiPhoneResourcesOniPad; +} + +/** NSBundle used by CCFileUtils. By default it uses [NSBundle mainBundle]. + @since v2.0 + */ +@property (nonatomic, readwrite, strong) NSBundle *bundle; + +/** NSFileManager used by CCFileUtils. By default it uses its own instance. + @since v2.0 + */ +@property (nonatomic, readwrite, strong) NSFileManager *fileManager; + +/** Whether of not the fallback suffixes is enabled. + When enabled it will try to search for the following suffixes in the following order until one is found: + * On iPad HD : iPad HD, iPad, iPhone HD, Resources without resolution + * On iPad : iPad, iPhone HD, Resources without resolution + * On iPhone HD: iPhone HD, Resources without resolution + * On Mac HD : Mac HD, Mac, Resources without resolution + * On Mac : Mac, Resources without resolution + + By default this functionality is off; + */ +@property (nonatomic, readwrite, getter = isEnablediPhoneResourcesOniPad) BOOL enableiPhoneResourcesOniPad; + +/** Dictionary that contians the search directories for the different devices. Default values: + - iPhone: "resources-iphone" + - iPhone HD: "resources-hd" + - iPhone5 : "resources-wide" + - iPhone5 HD: "resources-widehd" + - iPad: "resources-ipad" + - iPad HD: "resources-ipadhd" + - Mac: "resources-mac" + - Mac HD: "resources-machd" + + If "search in directories" is enabled (disabled by default), it will try to get the resources from the directories according to the order of "searchResolutionsOrder" array. + @since v2.1 + */ +@property (nonatomic, copy) NSMutableDictionary *directoriesDict; + +/** Dictionary that contians the suffix for the different devices. Default values: + - iPhone: "" + - iPhone HD: "-hd" + - iPhone5 : "-wide" + - iPhone5 HD: "-widehd" + - iPad: "-ipad" + - iPad HD: "-ipadhd" + - Mac: "" + - Mac HD: "-machd" + + If "search with suffixes" is enabled (enabled by default), it will try to get the resources by appending the suffixes according to the order of "searchResolutionsOrder" array. + @since v2.1 + */ +@property (nonatomic, copy) NSMutableDictionary *suffixesDict; + +/** Array that contains the search order of the resources based for the device. + By default it will try to load resources in the following order until one is found: + - On iPad HD: iPad HD resources, iPad resources, resources not associated with any device + - On iPad: iPad resources, resources not associated with any device + - On iPhone 5 HD: iPhone 5 HD resources, iPhone HD resouces, iPhone 5 resources, iPhone resources, resources not associated with any device + - On iPhone HD: iPhone HD resources, iPhone resouces, resources not associated with any device + - On iPhone: iPhone resources, resources not associated with any device + + - On Mac HD: Mac HD resources, Mac resources, resources not associated with any device + - On Mac: Mac resources, resources not associated with any device + + If the property "enableiPhoneResourcesOniPad" is enabled, it will also search for iPhone resources if you are in an iPad. + + @since v2.1 + */ +@property (nonatomic, copy) NSArray *searchResolutionsOrder; + +/** Array of search paths. + You can use this array to modify the search path of the resources. + If you want to use "themes" or search resources in the "cache", you can do it easily by adding new entries in this array. + + By default it is an array with only the "" (empty string) element. + + @since v2.1 + */ +@property (nonatomic, copy) NSArray *searchPath; + + +/** It determines how the "resolution resources" are to be searched. + Possible values: + - kCCFileUtilsSearchSuffix: It will search for resources by appending suffixes like "-hd", "-ipad", etc... + - kCCFileUtilsSearchDirectory: It will search the resoureces in subdirectories like "resources-hd", "resources-ipad", etc... + + Default: kCCFileUtilsSearchSuffix + @since v2.1 + */ +@property (nonatomic, readwrite) int searchMode; + +/** Dictionary used to lookup filenames based on a key. + It is used internally by the following methods: + + * -(NSString*) fullPathForFilename:(NSString*)key resolutionType:(ccResolutionType*)resolutionType; + * -(NSString*) fullPathForFilenameIgnoringResolutions:(NSString*)key; + + @since v2.1 + */ +@property (nonatomic, readwrite, copy) NSMutableDictionary *filenameLookup; + +#ifdef __CC_PLATFORM_IOS +/** The iPhone RetinaDisplay suffixes to load resources. + By default it is "-hd" and "" in that order. + Only valid on iOS. Not valid for OS X. + + @since v1.1 + */ +-(void) setiPhoneRetinaDisplaySuffix:(NSString*)iPhoneRetinaDisplaySuffix; + +/** The iPad suffixes to load resources. + By default it is "-ipad", "-hd", "", in that order. + Only valid on iOS. Not valid for OS X. + + @since v1.1 + */ +-(void) setiPadSuffix:(NSString*) iPadSuffix; + + +/** Sets the iPad Retina Display suffixes to load resources. + By default it is "-ipadhd", "-ipad", "-hd", "", in that order. + Only valid on iOS. Not valid for OS X. + + @since v2.0 + */ +-(void)setiPadRetinaDisplaySuffix:(NSString*)iPadRetinaDisplaySuffix; + +#endif // __CC_PLATFORM_IOS + + +/** returns the shared file utils instance */ ++(CCFileUtils*) sharedFileUtils; + + +/** Purge cached entries. + Will be called automatically by the Director when a memory warning is received + */ +-(void) purgeCachedEntries; + +/** Calling this method will populate the searchResolutionsOrder property depending on the current device. + + @since v2.1 + */ +- (void) buildSearchResolutionsOrder; + +/** Returns the fullpath of an filename. + + If in iPhoneRetinaDisplay mode, and a RetinaDisplay file is found, it will return that path. + If in iPad mode, and an iPad file is found, it will return that path. + + If the filename can't be found, it will return "relPath" instead of nil. + + Examples: + + * In iPad mode: "image.png" -> "/full/path/image-ipad.png" (in case the -ipad file exists) + * In iPhone RetinaDisplay mode: "image.png" -> "/full/path/image-hd.png" (in case the -hd file exists) + * In iPad RetinaDisplay mode: "image.png" -> "/full/path/image-ipadhd.png" (in case the -ipadhd file exists) + + */ +-(NSString*) fullPathFromRelativePath:(NSString*) relPath; + +/** Returns the fullpath of an filename. It will try to get the correct file for the current screen resolution. + Useful for loading images and other assets that are related for the screen resolution. + + If in iPad mode, and an iPad file is found, it will return that path. + If in iPhoneRetinaDisplay mode, and a RetinaDisplay file is found, it will return that path. But if it is not found, it will try load an iPhone Non-RetinaDisplay file. + + If the filename can't be found, it will return "relPath" instead of nil. + + Examples: + + * In iPad mode: "image.png" -> "/full/path/image-ipad.png" (in case the -ipad file exists) + * In iPhone RetinaDisplay mode: "image.png" -> "/full/path/image-hd.png" (in case the -hd file exists) + * In iPad RetinaDisplay mode: "image.png" -> "/full/path/image-ipadhd.png" (in case the -ipadhd file exists) + + */ +-(NSString*) fullPathFromRelativePath:(NSString*)relPath resolutionType:(ccResolutionType*)resolutionType; + +/** Returns the fullpath of an filename without taking into account the screen resolution suffixes or directories. + + It will use the "searchPath" though. + If the file can't be found, it will return nil. + + Useful for loading music files, shaders, "data" and other files that are not related to the screen resolution of the device. + + @since v2.1 + */ +-(NSString*) fullPathFromRelativePathIgnoringResolutions:(NSString*)relPath; + +/** Returns the fullpath for a given filename. + + First it will try to get a new filename from the "filenameLookup" dictionary. If a new filename can't be found on the dictionary, it will use the original filename. + Then it will try obtain the full path of the filename using the CCFileUtils search rules: resolutions, and search paths + + If in iPad mode, and an iPad file is found, it will return that path. + If in iPhoneRetinaDisplay mode, and a RetinaDisplay file is found, it will return that path. But if it is not found, it will try load an iPhone Non-RetinaDisplay file. + + If the filename can't be found on the file system, it will return nil. + + This method was added to simplify multiplatform support. Whether you are using cocos2d-js or any cross-compilation toolchain like StellaSDK or Apportable, + you might need to load differerent resources for a given file in the different platforms. + + Examples: + + * In iPad mode: "image.png" -> "image.pvr" -> "/full/path/image-ipad.pvr" (in case the -ipad file exists) + * In Android: "image.png" -> "image.png" -> "/full/path/image.png" + + @since v2.1 + */ +-(NSString*) fullPathForFilename:(NSString*)filename; + +/** Returns the fullpath for a given filename. + + First it will try to get a new filename from the "filenameLookup" dictionary. If a new filename can't be found on the dictionary, it will use the original filename. + Then it will try obtain the full path of the filename using the CCFileUtils search rules: resolutions, and search paths + + If in iPad mode, and an iPad file is found, it will return that path. + If in iPhoneRetinaDisplay mode, and a RetinaDisplay file is found, it will return that path. But if it is not found, it will try load an iPhone Non-RetinaDisplay file. + + If the filename can't be found on the file system, it will return nil. + + This method was added to simplify multiplatform support. Whether you are using cocos2d-js or any cross-compilation toolchain like StellaSDK or Apportable, + you might need to load differerent resources for a given file in the different platforms. + + Examples: + + * In iPad mode: "image.png" -> "image.pvr" -> "/full/path/image-ipad.pvr" (in case the -ipad file exists) + * In Android: "image.png" -> "image.png" -> "/full/path/image.png" + + @since v2.1 + */ +-(NSString*) fullPathForFilename:(NSString*)filename resolutionType:(ccResolutionType*)resolutionType; + +/** Returns the fullpath for a given filename, without taking into account device resolution. + + It will try to get a new filename from the "filenameLookup" dictionary. If a new filename can't be found on the dictionary, it will use the original filename. + + Once it gets the filename, it will try to get the fullpath for the filename, using the "searchPath", but it won't use any resolution search rules. + If the file can't be found, it will return nil. + + Useful for loading music files, shaders, "data" and other files that are not related to the screen resolution of the device. + + This method was added to simplify multiplatform support. Whether you are using cocos2d-js or any cross-compilation toolchain like StellaSDK or Apportable, + you might need to load differerent resources for a given file in the different platforms. + + Examples: + + * On iOS: "sound.wav" -> "sound.caf" -> "/full/path/sound.caf" (in case the key dictionary says that "sound.wav" should be converted to "sound.caf") + * On Android: "sound.wav" -> "sound.wav" -> "/full/path/sound.caf" (in case the key dictionary says that "sound.wav" should be converted to "sound.caf") + + + @since v2.1 + */ +-(NSString*) fullPathForFilenameIgnoringResolutions:(NSString*)key; + +/* Loads the filenameLookup dictionary from the contents of a filename. + + @since v2.1 + */ +-(void) loadFilenameLookupDictionaryFromFile:(NSString*)filename; + +/** removes the suffix from a path + * On iPhone RetinaDisplay it will remove the -hd suffix + * On iPad it will remove the -ipad suffix + * On iPad RetinaDisplay it will remove the -ipadhd suffix + + @since v0.99.5 + */ +-(NSString *)removeSuffixFromFile:(NSString*) path; + +/* Stadarize a path. + + It calls [string stringByStandardizingPath], and if "suffix mode" is on, it will also call [self removeSuffixFromFile:path]; + + @since v2.1 + */ +-(NSString*) standarizePath:(NSString*)path; + +#ifdef __CC_PLATFORM_IOS + +/** Returns whether or not a given path exists with the iPhone RetinaDisplay suffix. + Only available on iOS. Not supported on OS X. + @since v1.1 + */ +-(BOOL) iPhoneRetinaDisplayFileExistsAtPath:(NSString*)filename; + +/** Returns whether or not a given filename exists with the iPad suffix. + Only available on iOS. Not supported on OS X. + @since v1.1 + */ +-(BOOL) iPadFileExistsAtPath:(NSString*)filename; + +/** Returns whether or not a given filename exists with the iPad RetinaDisplay suffix. + Only available on iOS. Not supported on OS X. + @since v2.0 + */ +-(BOOL) iPadRetinaDisplayFileExistsAtPath:(NSString*)filename; + +#endif // __CC_PLATFORM_MAC + +/** + @deprecated + */ +-(void) setEnableFallbackSuffixes:(BOOL)enableFallbackSuffixes; + +@end + +#ifdef __cplusplus +extern "C" { +#endif + +/** loads a file into memory. + the caller should release the allocated buffer. + + @returns the size of the allocated buffer + @since v0.99.5 + */ +NSInteger ccLoadFileIntoMemory(const char *filename, unsigned char **out); + +#ifdef __cplusplus +} +#endif diff --git a/cocos2d/Support/CCFileUtils.m b/cocos2d/Support/CCFileUtils.m new file mode 100644 index 0000000..b71d5c4 --- /dev/null +++ b/cocos2d/Support/CCFileUtils.m @@ -0,0 +1,715 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2008-2010 Ricardo Quesada + * Copyright (c) 2011 Zynga Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + */ + + +#import "CCFileUtils.h" +#import "CCConfiguration.h" +#import "ccMacros.h" +#import "ccConfig.h" +#import "ccTypes.h" + +NSString *kCCFileUtilsDefault = @"default"; + +NSString *kCCFileUtilsiPad = @"ipad"; +NSString *kCCFileUtilsiPadHD = @"ipadhd"; +NSString *kCCFileUtilsiPhone = @"iphone"; +NSString *kCCFileUtilsiPhoneHD = @"iphonehd"; +NSString *kCCFileUtilsiPhone5 = @"iphone5"; +NSString *kCCFileUtilsiPhone5HD = @"iphone5hd"; +NSString *kCCFileUtilsMac = @"mac"; +NSString *kCCFileUtilsMacHD = @"machd"; + +NSString *kCCFileUtilsDefaultSearchPath = @""; + +#pragma mark - Helper free functions + +NSInteger ccLoadFileIntoMemory(const char *filename, unsigned char **out) +{ + NSCAssert( out, @"ccLoadFileIntoMemory: invalid 'out' parameter"); + NSCAssert( &*out, @"ccLoadFileIntoMemory: invalid 'out' parameter"); + + size_t size = 0; + FILE *f = fopen(filename, "rb"); + if( !f ) { + *out = NULL; + return -1; + } + + fseek(f, 0, SEEK_END); + size = ftell(f); + fseek(f, 0, SEEK_SET); + + *out = malloc(size); + size_t read = fread(*out, 1, size, f); + if( read != size ) { + free(*out); + *out = NULL; + return -1; + } + + fclose(f); + + return size; +} + +#pragma mark - CCCacheValue + +@interface CCCacheValue : NSObject +{ + NSString *_fullpath; + ccResolutionType _resolutionType; +} +@property (nonatomic, readwrite, strong) NSString *fullpath; +@property (nonatomic, readwrite ) ccResolutionType resolutionType; +@end + +@implementation CCCacheValue +@synthesize fullpath = _fullpath, resolutionType = _resolutionType; +-(id) initWithFullPath:(NSString*)path resolutionType:(ccResolutionType)resolutionType +{ + if( (self=[super init]) ) + { + self.fullpath = path; + self.resolutionType = resolutionType; + } + + return self; +} + +@end + +#pragma mark - CCFileUtils + +@interface CCFileUtils() +-(NSString *) removeSuffix:(NSString*)suffix fromPath:(NSString*)path; +-(BOOL) fileExistsAtPath:(NSString*)string withSuffix:(NSString*)suffix; +-(void) buildSearchResolutionsOrder; +@end + +@implementation CCFileUtils + +@synthesize fileManager=_fileManager, bundle=_bundle; +@synthesize enableiPhoneResourcesOniPad = _enableiPhoneResourcesOniPad; +@synthesize searchResolutionsOrder = _searchResolutionsOrder; +@synthesize suffixesDict = _suffixesDict, directoriesDict = _directoriesDict; +@synthesize searchMode = _searchMode; +@synthesize searchPath = _searchPath; +@synthesize filenameLookup = _filenameLookup; + ++ (id)sharedFileUtils +{ + static dispatch_once_t pred; + static CCFileUtils *fileUtils = nil; + dispatch_once(&pred, ^{ + fileUtils = [[self alloc] init]; + }); + return fileUtils; +} + +-(id) init +{ + if( (self=[super init])) { + _fileManager = [[NSFileManager alloc] init]; + + _fullPathCache = [[NSMutableDictionary alloc] initWithCapacity:30]; + _fullPathNoResolutionsCache = [[NSMutableDictionary alloc] initWithCapacity:30]; + _removeSuffixCache = [[NSMutableDictionary alloc] initWithCapacity:30]; + + _bundle = [NSBundle mainBundle]; + + _enableiPhoneResourcesOniPad = NO; + + _searchResolutionsOrder = [[NSMutableArray alloc] initWithCapacity:5]; + + _searchPath = [[NSMutableArray alloc] initWithObjects:@"", nil]; + + _filenameLookup = [[NSMutableDictionary alloc] initWithCapacity:10]; + + +#ifdef __CC_PLATFORM_IOS + _suffixesDict = [[NSMutableDictionary alloc] initWithObjectsAndKeys: + @"-ipad", kCCFileUtilsiPad, + @"-ipadhd", kCCFileUtilsiPadHD, + @"", kCCFileUtilsiPhone, + @"-hd", kCCFileUtilsiPhoneHD, + @"-iphone5", kCCFileUtilsiPhone5, + @"-iphone5hd", kCCFileUtilsiPhone5HD, + @"", kCCFileUtilsDefault, + nil]; + + _directoriesDict = [[NSMutableDictionary alloc] initWithObjectsAndKeys: + @"resources-ipad", kCCFileUtilsiPad, + @"resources-ipadhd", kCCFileUtilsiPadHD, + @"resources-iphone", kCCFileUtilsiPhone, + @"resources-iphonehd", kCCFileUtilsiPhoneHD, + @"resources-iphone5", kCCFileUtilsiPhone5, + @"resources-iphone5hd", kCCFileUtilsiPhone5HD, + @"", kCCFileUtilsDefault, + nil]; + +#elif defined(__CC_PLATFORM_MAC) + _suffixesDict = [[NSMutableDictionary alloc] initWithObjectsAndKeys: + @"", kCCFileUtilsMac, + @"-machd", kCCFileUtilsMacHD, + @"", kCCFileUtilsDefault, + nil]; + + _directoriesDict = [[NSMutableDictionary alloc] initWithObjectsAndKeys: + @"resources-mac", kCCFileUtilsMac, + @"resources-machd", kCCFileUtilsMacHD, + @"", kCCFileUtilsDefault, + nil]; + +#endif // __CC_PLATFORM_IOS + + _searchMode = kCCFileUtilsSearchSuffixMode; + + [self buildSearchResolutionsOrder]; + } + + return self; +} + +-(void) purgeCachedEntries +{ + [_fullPathCache removeAllObjects]; + [_fullPathNoResolutionsCache removeAllObjects]; + [_removeSuffixCache removeAllObjects]; +} + + +- (void) buildSearchResolutionsOrder +{ + NSInteger device = [[CCConfiguration sharedConfiguration] runningDevice]; + + [_searchResolutionsOrder removeAllObjects]; + +#ifdef __CC_PLATFORM_IOS + if (device == kCCDeviceiPadRetinaDisplay) + { + [_searchResolutionsOrder addObject:kCCFileUtilsiPadHD]; + [_searchResolutionsOrder addObject:kCCFileUtilsiPad]; + if( _enableiPhoneResourcesOniPad ) { + [_searchResolutionsOrder addObject:kCCFileUtilsiPhone5HD]; + [_searchResolutionsOrder addObject:kCCFileUtilsiPhoneHD]; + } + } + else if (device == kCCDeviceiPad) + { + [_searchResolutionsOrder addObject:kCCFileUtilsiPad]; + if( _enableiPhoneResourcesOniPad ) { + [_searchResolutionsOrder addObject:kCCFileUtilsiPhone5HD]; + [_searchResolutionsOrder addObject:kCCFileUtilsiPhoneHD]; + } + } + else if (device == kCCDeviceiPhone5RetinaDisplay) + { + [_searchResolutionsOrder addObject:kCCFileUtilsiPhone5HD]; + [_searchResolutionsOrder addObject:kCCFileUtilsiPhoneHD]; + [_searchResolutionsOrder addObject:kCCFileUtilsiPhone5]; + [_searchResolutionsOrder addObject:kCCFileUtilsiPhone]; + } + else if (device == kCCDeviceiPhoneRetinaDisplay) + { + [_searchResolutionsOrder addObject:kCCFileUtilsiPhoneHD]; + [_searchResolutionsOrder addObject:kCCFileUtilsiPhone]; + } + else if (device == kCCDeviceiPhone5) + { + [_searchResolutionsOrder addObject:kCCFileUtilsiPhone5]; + [_searchResolutionsOrder addObject:kCCFileUtilsiPhone]; + } + else if (device == kCCDeviceiPhone) + { + [_searchResolutionsOrder addObject:kCCFileUtilsiPhone]; + } + +#elif defined(__CC_PLATFORM_MAC) + if (device == kCCDeviceMacRetinaDisplay) + { + [_searchResolutionsOrder addObject:kCCFileUtilsMacHD]; + [_searchResolutionsOrder addObject:kCCFileUtilsMac]; + } + else if (device == kCCDeviceMac) + { + [_searchResolutionsOrder addObject:kCCFileUtilsMac]; + } +#endif + + [_searchResolutionsOrder addObject:kCCFileUtilsDefault]; +} + +-(NSString*) pathForResource:(NSString*)resource ofType:(NSString *)ext inDirectory:(NSString *)subpath +{ + // An absolute path could be used if the searchPath contains absolute paths + if( [subpath isAbsolutePath] ) { + NSString *fullpath = [subpath stringByAppendingPathComponent:resource]; + if( ext ) + fullpath = [fullpath stringByAppendingPathExtension:ext]; + + if( [_fileManager fileExistsAtPath:fullpath] ) + return fullpath; + return nil; + } + + // Default to normal resource directory + return [_bundle pathForResource:resource + ofType:ext + inDirectory:subpath]; +} + +-(NSString*) getPathForFilename:(NSString*)path withSuffix:(NSString*)suffix +{ + NSString *newName = path; + + // only recreate filename if suffix is valid + if( suffix && [suffix length] > 0) + { + NSString *pathWithoutExtension = [path stringByDeletingPathExtension]; + NSString *name = [pathWithoutExtension lastPathComponent]; + + // check if path already has the suffix. + if( [name rangeOfString:suffix].location == NSNotFound ) { + + + NSString *extension = [path pathExtension]; + + if( [extension isEqualToString:@"ccz"] || [extension isEqualToString:@"gz"] ) + { + // All ccz / gz files should be in the format filename.xxx.ccz + // so we need to pull off the .xxx part of the extension as well + extension = [NSString stringWithFormat:@"%@.%@", [pathWithoutExtension pathExtension], extension]; + pathWithoutExtension = [pathWithoutExtension stringByDeletingPathExtension]; + } + + + newName = [pathWithoutExtension stringByAppendingString:suffix]; + newName = [newName stringByAppendingPathExtension:extension]; + } else + CCLOGWARN(@"cocos2d: WARNING Filename(%@) already has the suffix %@. Using it.", name, suffix); + } + + NSString *ret = nil; + // only if it is not an absolute path + if( ! [path isAbsolutePath] ) { + + // pathForResource also searches in .lproj directories. issue #1230 + // If the file does not exist it will return nil. + NSString *filename = [newName lastPathComponent]; + NSString *imageDirectory = [path stringByDeletingLastPathComponent]; + + // on iOS it is OK to pass inDirector=nil and pass a path in "Resources", + // but on OS X it doesn't work. + ret = [self pathForResource:filename + ofType:nil + inDirectory:imageDirectory]; + } + else if( [_fileManager fileExistsAtPath:newName] ) + ret = newName; + + if( ! ret ) + CCLOGINFO(@"cocos2d: CCFileUtils: file not found: %@", [newName lastPathComponent] ); + + return ret; +} + +-(NSString*) getPathForFilename:(NSString*)filename withResourceDirectory:(NSString*)resourceDirectory withSearchPath:(NSString*)searchPath +{ + NSString *ret = nil; + + NSString *file = [filename lastPathComponent]; + NSString *file_path = [filename stringByDeletingLastPathComponent]; + + // searchPath + file_path + resourceDirectory + NSString * path = [searchPath stringByAppendingPathComponent:file_path]; + path = [path stringByAppendingPathComponent:resourceDirectory]; + + // only if it is not an absolute path + if( ! [filename isAbsolutePath] ) { + + // pathForResource also searches in .lproj directories. issue #1230 + // If the file does not exist it will return nil. + // on iOS it is OK to pass inDirector=nil and pass a path in "Resources", + // but on OS X it doesn't work. + ret = [self pathForResource:file + ofType:nil + inDirectory:path]; + } + else + { + NSString *newName = [[file_path stringByAppendingPathComponent:path] stringByAppendingPathComponent:file]; + if ([_fileManager fileExistsAtPath:newName]) + ret = newName; + } + + return ret; +} + +-(ccResolutionType) resolutionTypeForKey:(NSString*)k inDictionary:dictionary +{ + // XXX XXX Super Slow + for( NSString *key in dictionary) { + NSString *value = [dictionary objectForKey:key]; + if( [value isEqualToString:k] ) { + +#ifdef __CC_PLATFORM_IOS + // XXX Add this in a Dictionary + if( [key isEqualToString:kCCFileUtilsiPad] ) + return kCCResolutioniPad; + if( [key isEqualToString:kCCFileUtilsiPadHD] ) + return kCCResolutioniPadRetinaDisplay; + if( [key isEqualToString:kCCFileUtilsiPhone] ) + return kCCResolutioniPhone; + if( [key isEqualToString:kCCFileUtilsiPhoneHD] ) + return kCCResolutioniPhoneRetinaDisplay; + if( [key isEqualToString:kCCFileUtilsiPhone5HD] ) + return kCCResolutioniPhone5RetinaDisplay; + if( [key isEqualToString:kCCFileUtilsiPhone5] ) + return kCCResolutioniPhone5; + if( [key isEqualToString:kCCFileUtilsDefault] ) + return kCCResolutionUnknown; +#elif defined(__CC_PLATFORM_MAC) + if( [key isEqualToString:kCCFileUtilsMacHD] ) + return kCCResolutionMacRetinaDisplay; + if( [key isEqualToString:kCCFileUtilsMac] ) + return kCCResolutionMac; + if( [key isEqualToString:kCCFileUtilsDefault] ) + return kCCResolutionUnknown; +#endif // __CC_PLATFORM_MAC + } + } +// NSAssert(NO, @"Should not reach here"); + return kCCResolutionUnknown; +} + + +-(NSString*) fullPathForFilenameIgnoringResolutions:(NSString*)filename +{ + // fullpath? return it + if ([filename isAbsolutePath]) + return filename; + + // Already cached ? + NSString* ret = [_fullPathNoResolutionsCache objectForKey:filename]; + if (ret) + return ret; + + // Lookup rules + NSString *newfilename = [_filenameLookup objectForKey:filename]; + if( ! newfilename ) + newfilename = filename; + + + for( NSString *path in _searchPath ) { + + ret = [path stringByAppendingPathComponent:newfilename]; + + if ([_fileManager fileExistsAtPath:ret]) + break; + + NSString *file = [ret lastPathComponent]; + NSString *file_path = [ret stringByDeletingLastPathComponent]; + // Default to normal resource directory + ret = [_bundle pathForResource:file + ofType:nil + inDirectory:file_path]; + if(ret) + break; + } + + // Save in cache + if( ret ) + [_fullPathNoResolutionsCache setObject:ret forKey:filename]; + else + CCLOGINFO(@"cocos2d: CCFileUtils: file not found: %@", filename ); + + return ret; +} + +-(NSString*) fullPathFromRelativePathIgnoringResolutions:(NSString*)relPath +{ + NSString *ret = [self fullPathForFilenameIgnoringResolutions:relPath]; + + if( !ret ) + ret = relPath; + + return ret; +} + +-(NSString*) fullPathForFilename:(NSString*)filename +{ + ccResolutionType ignore; + return [self fullPathForFilename:filename resolutionType:&ignore]; +} + +-(NSString*) fullPathForFilename:(NSString*)filename resolutionType:(ccResolutionType*)resolutionType +{ + // fullpath? return it + if ([filename isAbsolutePath]) { + CCLOGWARN(@"cocos2d: WARNING fullPathForFilename:resolutionType: should not be called with absolute path. Instead call fullPathForFilenameIgnoringResolutions:"); + *resolutionType = kCCResolutionUnknown; + return filename; + } + + // Already Cached ? + CCCacheValue *value = [_fullPathCache objectForKey:filename]; + if( value ) { + *resolutionType = value.resolutionType; + return value.fullpath; + } + + // in Lookup Filename dictionary ? + NSString *newfilename = [_filenameLookup objectForKey:filename]; + if( ! newfilename ) + newfilename = filename; + + BOOL found = NO; + NSString *ret = @""; + + for( NSString *path in _searchPath ) { + + // Search with Suffixes + for( NSString *device in _searchResolutionsOrder ) { + + NSString *fileWithPath = [path stringByAppendingPathComponent:newfilename]; + + if( _searchMode == kCCFileUtilsSearchSuffixMode ) { + // Search using suffixes + NSString *suffix = [_suffixesDict objectForKey:device]; + ret = [self getPathForFilename:fileWithPath withSuffix:suffix]; + *resolutionType = [self resolutionTypeForKey:suffix inDictionary:_suffixesDict]; + } else { + // Search in subdirectories + NSString *directory = [_directoriesDict objectForKey:device]; + ret = [self getPathForFilename:newfilename withResourceDirectory:directory withSearchPath:path]; + *resolutionType = [self resolutionTypeForKey:directory inDictionary:_directoriesDict]; + } + + if( ret ) { + found = YES; + break; + } + } + + // there are 2 loops + if(found) + break; + } + + if( found ) { + value = [[CCCacheValue alloc] initWithFullPath:ret resolutionType:*resolutionType]; + [_fullPathCache setObject:value forKey:filename]; + } + else + { + CCLOGWARN(@"cocos2d: Warning: File not found: %@", filename); + ret = nil; + } + + + return ret; +} + +-(NSString*) fullPathFromRelativePath:(NSString*)relPath resolutionType:(ccResolutionType*)resolutionType +{ + NSAssert(relPath != nil, @"CCFileUtils: Invalid path"); + + NSString *ret = [self fullPathForFilename:relPath resolutionType:resolutionType]; + + // The only difference is that it returns nil + if( ! ret ) + ret = relPath; + + return ret; +} + +-(NSString*) fullPathFromRelativePath:(NSString*) relPath +{ + ccResolutionType ignore; + return [self fullPathFromRelativePath:relPath resolutionType:&ignore]; +} + +-(void) loadFilenameLookupDictionaryFromFile:(NSString*)filename +{ + NSString *fullpath = [self fullPathForFilenameIgnoringResolutions:filename]; + if( fullpath ) { + NSDictionary *dict = [NSDictionary dictionaryWithContentsOfFile:fullpath]; + + NSDictionary *metadata = [dict objectForKey:@"metadata"]; + NSInteger version = [[metadata objectForKey:@"version"] integerValue]; + if( version != 1) { + CCLOG(@"cocos2d: ERROR: Invalid filenameLookup dictionary version: %ld. Filename: %@", (long)version, filename); + return; + } + + NSMutableDictionary *filenames = [dict objectForKey:@"filenames"]; + self.filenameLookup = filenames; + } +} + +#pragma mark Helpers + +-(NSString*) standarizePath:(NSString*)path +{ + NSString *ret = [path stringByStandardizingPath]; + if( _searchMode == kCCFileUtilsSearchSuffixMode ) + ret = [self removeSuffixFromFile:ret]; + + return ret; +} + +#pragma mark CCFileUtils - Suffix / Directory search chain + +-(void) setEnableiPhoneResourcesOniPad:(BOOL)enable +{ + if( _enableiPhoneResourcesOniPad != enable ) { + + _enableiPhoneResourcesOniPad = enable; + + [self buildSearchResolutionsOrder]; + } +} + +#ifdef __CC_PLATFORM_IOS + +-(void) setiPadRetinaDisplaySuffix:(NSString *)suffix +{ + [_suffixesDict setObject:suffix forKey:kCCFileUtilsiPadHD]; +} + +-(void) setiPadSuffix:(NSString *)suffix +{ + [_suffixesDict setObject:suffix forKey:kCCFileUtilsiPad]; +} + +-(void) setiPhoneRetinaDisplaySuffix:(NSString *)suffix +{ + [_suffixesDict setObject:suffix forKey:kCCFileUtilsiPhoneHD]; +} + +#endif // __CC_PLATFORM_IOS + + +-(NSString *) removeSuffix:(NSString*)suffix fromPath:(NSString*)path +{ + // quick return + if( ! suffix || [suffix length] == 0 ) + return path; + + NSString *name = [path lastPathComponent]; + + // check if path already has the suffix. + if( [name rangeOfString:suffix].location != NSNotFound ) { + + CCLOGINFO(@"cocos2d: Filename(%@) contains %@ suffix. Removing it. See cocos2d issue #1040", path, suffix); + + NSString *newLastname = [name stringByReplacingOccurrencesOfString:suffix withString:@""]; + + NSString *pathWithoutLastname = [path stringByDeletingLastPathComponent]; + return [pathWithoutLastname stringByAppendingPathComponent:newLastname]; + } + + // suffix was not removed + return nil; +} + +-(NSString*) removeSuffixFromFile:(NSString*) path +{ + NSString *withoutSuffix = [_removeSuffixCache objectForKey:path]; + if( withoutSuffix ) + return withoutSuffix; + + // Initial value should be non-nil + NSString *ret = @""; + + for( NSString *device in _searchResolutionsOrder ) { + NSString *suffix = [_suffixesDict objectForKey:device]; + ret = [self removeSuffix:suffix fromPath:path]; + + if( ret ) + break; + } + + if( ! ret ) + ret = path; + + [_removeSuffixCache setObject:ret forKey:path]; + + return ret; +} + +-(BOOL) fileExistsAtPath:(NSString*)relPath withSuffix:(NSString*)suffix +{ + NSString *fullpath = nil; + + // only if it is not an absolute path + if( ! [relPath isAbsolutePath] ) { + // pathForResource also searches in .lproj directories. issue #1230 + NSString *file = [relPath lastPathComponent]; + NSString *imageDirectory = [relPath stringByDeletingLastPathComponent]; + + fullpath = [_bundle pathForResource:file + ofType:nil + inDirectory:imageDirectory]; + + } + + if (fullpath == nil) + fullpath = relPath; + + NSString *path = [self getPathForFilename:fullpath withSuffix:suffix]; + + return ( path != nil ); +} + +#pragma mark CCFileUtils - deprecated + +// XXX deprecated +-(void) setEnableFallbackSuffixes:(BOOL)enableFallbackSuffixes +{ + [self setEnableiPhoneResourcesOniPad:enableFallbackSuffixes]; +} + +#ifdef __CC_PLATFORM_IOS + +-(BOOL) iPhoneRetinaDisplayFileExistsAtPath:(NSString*)path +{ + return [self fileExistsAtPath:path withSuffix:[_suffixesDict objectForKey:kCCFileUtilsiPhoneHD]]; +} + +-(BOOL) iPadFileExistsAtPath:(NSString*)path +{ + return [self fileExistsAtPath:path withSuffix:[_suffixesDict objectForKey:kCCFileUtilsiPad]]; +} + +-(BOOL) iPadRetinaDisplayFileExistsAtPath:(NSString*)path +{ + return [self fileExistsAtPath:path withSuffix:[_suffixesDict objectForKey:kCCFileUtilsiPadHD]]; +} + +#endif // __CC_PLATFORM_IOS + +@end diff --git a/cocos2d/Support/CCProfiling.h b/cocos2d/Support/CCProfiling.h new file mode 100644 index 0000000..9b645f1 --- /dev/null +++ b/cocos2d/Support/CCProfiling.h @@ -0,0 +1,89 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2010 Stuart Carnie + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + */ + + +#import +#import + +@class CCProfilingTimer; + +/** CCProfiler + cocos2d builtin profiler. + + To use it, enable set the CC_ENABLE_PROFILERS=1 in the ccConfig.h file + */ +@interface CCProfiler : NSObject { +@public + NSMutableDictionary* activeTimers; +} + +/** shared instance */ ++ (CCProfiler*)sharedProfiler; + +/** Creates and adds a new timer */ +- (CCProfilingTimer*) createAndAddTimerWithName:(NSString*)timerName; + +/** releases a timer */ +- (void)releaseTimer:(NSString*)timerName; + +/** releases all timers */ +- (void) releaseAllTimers; + +/** display the timers */ +- (void)displayTimers; + +@end + +/** CCProfilingTimer +Profiling timers used by CCProfiler + */ +@interface CCProfilingTimer : NSObject { + +@public + NSString *name; + struct timeval startTime; + double averageTime; + double minTime; + double maxTime; + double totalTime; + NSUInteger numberOfCalls; +} + +/** resets the timer properties */ +-(void) reset; +@end + +extern void CCProfilingBeginTimingBlock(NSString *timerName); +extern void CCProfilingEndTimingBlock(NSString *timerName); +extern void CCProfilingResetTimingBlock(NSString *timerName); + +/* + * cocos2d profiling categories + * used to enable / disable profilers with granularity + */ + +extern BOOL kCCProfilerCategorySprite; +extern BOOL kCCProfilerCategoryBatchSprite; +extern BOOL kCCProfilerCategoryParticles; diff --git a/src/cocos2d/Support/CCProfiling.m b/cocos2d/Support/CCProfiling.m similarity index 96% rename from src/cocos2d/Support/CCProfiling.m rename to cocos2d/Support/CCProfiling.m index abd8979..0e96e81 100644 --- a/src/cocos2d/Support/CCProfiling.m +++ b/cocos2d/Support/CCProfiling.m @@ -23,8 +23,8 @@ * */ -#import "../ccConfig.h" -#import "../ccMacros.h" +#import "ccConfig.h" +#import "ccMacros.h" #import "CCProfiling.h" @@ -59,7 +59,6 @@ - (CCProfilingTimer*) createAndAddTimerWithName:(NSString*)timerName { CCProfilingTimer* t = [[CCProfilingTimer alloc] initWithName:timerName]; [activeTimers setObject:t forKey:timerName]; - [t release]; return t; } @@ -82,11 +81,6 @@ - (id)init return self; } -- (void)dealloc -{ - [activeTimers release]; - [super dealloc]; -} - (void)displayTimers { @@ -121,8 +115,6 @@ - (id)initWithName:(NSString*)timerName - (void)dealloc { CCLOGINFO(@"deallocing %@", self); - [name release]; - [super dealloc]; } - (NSString*)description diff --git a/cocos2d/Support/CCVertex.h b/cocos2d/Support/CCVertex.h new file mode 100644 index 0000000..b0f7374 --- /dev/null +++ b/cocos2d/Support/CCVertex.h @@ -0,0 +1,36 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2011 ForzeField Studios S.L. http://forzefield.com + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#import "ccTypes.h" + +/** @file CCVertex.h */ + +/** converts a line to a polygon */ +void ccVertexLineToPolygon(CGPoint *points, float stroke, ccVertex2F *vertices, NSUInteger offset, NSUInteger nuPoints); + +/** returns whether or not the line intersects */ +BOOL ccVertexLineIntersect(float Ax, float Ay, + float Bx, float By, + float Cx, float Cy, + float Dx, float Dy, float *T); diff --git a/src/cocos2d/Support/CCVertex.m b/cocos2d/Support/CCVertex.m similarity index 96% rename from src/cocos2d/Support/CCVertex.m rename to cocos2d/Support/CCVertex.m index fcb83f3..c1d1f45 100644 --- a/src/cocos2d/Support/CCVertex.m +++ b/cocos2d/Support/CCVertex.m @@ -24,7 +24,10 @@ #import "CCVertex.h" #import "CGPointExtension.h" -#import "../ccMacros.h" +#import "ccMacros.h" + +#pragma clang diagnostic push COCOS2D +#pragma clang diagnostic ignored "-Wfloat-equal" void ccVertexLineToPolygon(CGPoint *points, float stroke, ccVertex2F *vertices, NSUInteger offset, NSUInteger nuPoints) { @@ -132,3 +135,5 @@ BOOL ccVertexLineIntersect(float Ax, float Ay, // Success. return YES; } + +#pragma clang diagnostic pop COCOS2D diff --git a/cocos2d/Support/CGPointExtension.h b/cocos2d/Support/CGPointExtension.h new file mode 100644 index 0000000..ff92362 --- /dev/null +++ b/cocos2d/Support/CGPointExtension.h @@ -0,0 +1,346 @@ +/* cocos2d for iPhone + * http://www.cocos2d-iphone.org + * + * Copyright (c) 2007 Scott Lembcke + * + * Copyright (c) 2010 Lam Pham + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +/* + * Some of the functions were based on Chipmunk's cpVect.h. + */ + +/** + @file + CGPoint extensions based on Chipmunk's cpVect file. + These extensions work both with CGPoint and cpVect. + + The "ccp" prefix means: "CoCos2d Point" + + Examples: + - ccpAdd( ccp(1,1), ccp(2,2) ); // preferred cocos2d way + - ccpAdd( CGPointMake(1,1), CGPointMake(2,2) ); // also ok but more verbose + + - cpvadd( cpv(1,1), cpv(2,2) ); // way of the chipmunk + - ccpAdd( cpv(1,1), cpv(2,2) ); // mixing chipmunk and cocos2d (avoid) + - cpvadd( CGPointMake(1,1), CGPointMake(2,2) ); // mixing chipmunk and CG (avoid) + */ + +#import "ccMacros.h" + +#ifdef __CC_PLATFORM_IOS +#import +#elif defined(__CC_PLATFORM_MAC) +#import +#endif + +#import +#import + +#ifdef __cplusplus +extern "C" { +#endif + +/** Helper macro that creates a CGPoint + @return CGPoint + @since v0.7.2 + */ +static inline CGPoint ccp( CGFloat x, CGFloat y ) +{ + return CGPointMake(x, y); +} + +/** Returns opposite of point. + @return CGPoint + @since v0.7.2 + */ +static inline CGPoint +ccpNeg(const CGPoint v) +{ + return ccp(-v.x, -v.y); +} + +/** Calculates sum of two points. + @return CGPoint + @since v0.7.2 + */ +static inline CGPoint +ccpAdd(const CGPoint v1, const CGPoint v2) +{ + return ccp(v1.x + v2.x, v1.y + v2.y); +} + +/** Calculates difference of two points. + @return CGPoint + @since v0.7.2 + */ +static inline CGPoint +ccpSub(const CGPoint v1, const CGPoint v2) +{ + return ccp(v1.x - v2.x, v1.y - v2.y); +} + +/** Returns point multiplied by given factor. + @return CGPoint + @since v0.7.2 + */ +static inline CGPoint +ccpMult(const CGPoint v, const CGFloat s) +{ + return ccp(v.x*s, v.y*s); +} + +/** Calculates midpoint between two points. + @return CGPoint + @since v0.7.2 + */ +static inline CGPoint +ccpMidpoint(const CGPoint v1, const CGPoint v2) +{ + return ccpMult(ccpAdd(v1, v2), 0.5f); +} + +/** Calculates dot product of two points. + @return CGFloat + @since v0.7.2 + */ +static inline CGFloat +ccpDot(const CGPoint v1, const CGPoint v2) +{ + return v1.x*v2.x + v1.y*v2.y; +} + +/** Calculates cross product of two points. + @return CGFloat + @since v0.7.2 + */ +static inline CGFloat +ccpCross(const CGPoint v1, const CGPoint v2) +{ + return v1.x*v2.y - v1.y*v2.x; +} + +/** Calculates perpendicular of v, rotated 90 degrees counter-clockwise -- cross(v, perp(v)) >= 0 + @return CGPoint + @since v0.7.2 + */ +static inline CGPoint +ccpPerp(const CGPoint v) +{ + return ccp(-v.y, v.x); +} + +/** Calculates perpendicular of v, rotated 90 degrees clockwise -- cross(v, rperp(v)) <= 0 + @return CGPoint + @since v0.7.2 + */ +static inline CGPoint +ccpRPerp(const CGPoint v) +{ + return ccp(v.y, -v.x); +} + +/** Calculates the projection of v1 over v2. + @return CGPoint + @since v0.7.2 + */ +static inline CGPoint +ccpProject(const CGPoint v1, const CGPoint v2) +{ + return ccpMult(v2, ccpDot(v1, v2)/ccpDot(v2, v2)); +} + +/** Rotates two points. + @return CGPoint + @since v0.7.2 + */ +static inline CGPoint +ccpRotate(const CGPoint v1, const CGPoint v2) +{ + return ccp(v1.x*v2.x - v1.y*v2.y, v1.x*v2.y + v1.y*v2.x); +} + +/** Unrotates two points. + @return CGPoint + @since v0.7.2 + */ +static inline CGPoint +ccpUnrotate(const CGPoint v1, const CGPoint v2) +{ + return ccp(v1.x*v2.x + v1.y*v2.y, v1.y*v2.x - v1.x*v2.y); +} + +/** Calculates the square length of a CGPoint (not calling sqrt() ) + @return CGFloat + @since v0.7.2 + */ +static inline CGFloat +ccpLengthSQ(const CGPoint v) +{ + return ccpDot(v, v); +} + +/** Calculates the square distance between two points (not calling sqrt() ) + @return CGFloat + @since v1.1 +*/ +static inline CGFloat +ccpDistanceSQ(const CGPoint p1, const CGPoint p2) +{ + return ccpLengthSQ(ccpSub(p1, p2)); +} + +/** Calculates distance between point an origin + @return CGFloat + @since v0.7.2 + */ +CGFloat ccpLength(const CGPoint v); + +/** Calculates the distance between two points + @return CGFloat + @since v0.7.2 + */ +CGFloat ccpDistance(const CGPoint v1, const CGPoint v2); + +/** Returns point multiplied to a length of 1. + @return CGPoint + @since v0.7.2 + */ +CGPoint ccpNormalize(const CGPoint v); + +/** Converts radians to a normalized vector. + @return CGPoint + @since v0.7.2 + */ +CGPoint ccpForAngle(const CGFloat a); + +/** Converts a vector to radians. + @return CGFloat + @since v0.7.2 + */ +CGFloat ccpToAngle(const CGPoint v); + + +/** Clamp a value between from and to. + @since v0.99.1 + */ +float clampf(float value, float min_inclusive, float max_inclusive); + +/** Clamp a point between from and to. + @since v0.99.1 + */ +CGPoint ccpClamp(CGPoint p, CGPoint from, CGPoint to); + +/** Quickly convert CGSize to a CGPoint + @since v0.99.1 + */ +CGPoint ccpFromSize(CGSize s); + +/** Run a math operation function on each point component + * absf, fllorf, ceilf, roundf + * any function that has the signature: float func(float); + * For example: let's try to take the floor of x,y + * ccpCompOp(p,floorf); + @since v0.99.1 + */ +CGPoint ccpCompOp(CGPoint p, float (*opFunc)(float)); + +/** Linear Interpolation between two points a and b + @returns + alpha == 0 ? a + alpha == 1 ? b + otherwise a value between a..b + @since v0.99.1 + */ +CGPoint ccpLerp(CGPoint a, CGPoint b, float alpha); + + +/** @returns if points have fuzzy equality which means equal with some degree of variance. + @since v0.99.1 + */ +BOOL ccpFuzzyEqual(CGPoint a, CGPoint b, float variance); + + +/** Multiplies a nd b components, a.x*b.x, a.y*b.y + @returns a component-wise multiplication + @since v0.99.1 + */ +CGPoint ccpCompMult(CGPoint a, CGPoint b); + +/** @returns the signed angle in radians between two vector directions + @since v0.99.1 + */ +float ccpAngleSigned(CGPoint a, CGPoint b); + +/** @returns the angle in radians between two vector directions + @since v0.99.1 +*/ +float ccpAngle(CGPoint a, CGPoint b); + +/** Rotates a point counter clockwise by the angle around a pivot + @param v is the point to rotate + @param pivot is the pivot, naturally + @param angle is the angle of rotation cw in radians + @returns the rotated point + @since v0.99.1 + */ +CGPoint ccpRotateByAngle(CGPoint v, CGPoint pivot, float angle); + +/** A general line-line intersection test + @param p1 + is the startpoint for the first line P1 = (p1 - p2) + @param p2 + is the endpoint for the first line P1 = (p1 - p2) + @param p3 + is the startpoint for the second line P2 = (p3 - p4) + @param p4 + is the endpoint for the second line P2 = (p3 - p4) + @param s + is the range for a hitpoint in P1 (pa = p1 + s*(p2 - p1)) + @param t + is the range for a hitpoint in P3 (pa = p2 + t*(p4 - p3)) + @return bool + indicating successful intersection of a line + note that to truly test intersection for segments we have to make + sure that s & t lie within [0..1] and for rays, make sure s & t > 0 + the hit point is p3 + t * (p4 - p3); + the hit point also is p1 + s * (p2 - p1); + @since v0.99.1 + */ +BOOL ccpLineIntersect(CGPoint p1, CGPoint p2, + CGPoint p3, CGPoint p4, + float *s, float *t); + +/* + ccpSegmentIntersect returns YES if Segment A-B intersects with segment C-D + @since v1.0.0 + */ +BOOL ccpSegmentIntersect(CGPoint A, CGPoint B, CGPoint C, CGPoint D); + +/* + ccpIntersectPoint returns the intersection point of line A-B, C-D + @since v1.0.0 + */ +CGPoint ccpIntersectPoint(CGPoint A, CGPoint B, CGPoint C, CGPoint D); + +#ifdef __cplusplus +} +#endif diff --git a/src/cocos2d/Support/CGPointExtension.m b/cocos2d/Support/CGPointExtension.m similarity index 93% rename from src/cocos2d/Support/CGPointExtension.m rename to cocos2d/Support/CGPointExtension.m index d96f820..149b411 100644 --- a/src/cocos2d/Support/CGPointExtension.m +++ b/cocos2d/Support/CGPointExtension.m @@ -27,11 +27,9 @@ #include "stdio.h" #include "math.h" -#import "../ccMacros.h" // CC_SWAP +#import "ccMacros.h" // CC_SWAP #include "CGPointExtension.h" -#define kCGPointEpsilon FLT_EPSILON - CGFloat ccpLength(const CGPoint v) { @@ -108,7 +106,7 @@ float ccpAngleSigned(CGPoint a, CGPoint b) CGPoint a2 = ccpNormalize(a); CGPoint b2 = ccpNormalize(b); float angle = atan2f(a2.x * b2.y - a2.y * b2.x, ccpDot(a2, b2)); - if( fabs(angle) < kCGPointEpsilon ) return 0.f; + if( fabs(angle) < FLT_EPSILON ) return 0.f; return angle; } @@ -149,6 +147,9 @@ CGPoint ccpIntersectPoint(CGPoint A, CGPoint B, CGPoint C, CGPoint D) return CGPointZero; } + +#pragma clang diagnostic push COCOS2D +#pragma clang diagnostic ignored "-Wfloat-equal" BOOL ccpLineIntersect(CGPoint A, CGPoint B, CGPoint C, CGPoint D, float *S, float *T) @@ -187,11 +188,11 @@ BOOL ccpLineIntersect(CGPoint A, CGPoint B, return YES; } +#pragma clang diagnostic pop COCOS2D float ccpAngle(CGPoint a, CGPoint b) { - CGPoint delta = ccpSub(a, b); - CGFloat angle = atan2f(delta.y, delta.x); - if (fabs(angle) < kCGPointEpsilon) return 0.0f; - return angle; + float angle = acosf(ccpDot(ccpNormalize(a), ccpNormalize(b))); + if( fabs(angle) < FLT_EPSILON ) return 0.f; + return angle; } diff --git a/src/cocos2d/CCScene.m b/cocos2d/Support/NSAttributedString+CCAdditions.h similarity index 79% rename from src/cocos2d/CCScene.m rename to cocos2d/Support/NSAttributedString+CCAdditions.h index 3016e19..91a609f 100644 --- a/src/cocos2d/CCScene.m +++ b/cocos2d/Support/NSAttributedString+CCAdditions.h @@ -3,6 +3,7 @@ * * Copyright (c) 2008-2010 Ricardo Quesada * Copyright (c) 2011 Zynga Inc. + * Copyright (c) 2013 Apportable * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -24,22 +25,12 @@ * */ +#import -#import "CCScene.h" -#import "Support/CGPointExtension.h" -#import "CCDirector.h" +@interface NSAttributedString (CCAdditions) - -@implementation CCScene --(id) init -{ - if( (self=[super init]) ) { - CGSize s = [[CCDirector sharedDirector] winSize]; - self.ignoreAnchorPointForPosition = YES; - anchorPoint_ = ccp(0.5f, 0.5f); - [self setContentSize:s]; - } - - return self; -} +- (BOOL) hasAttribute:(NSString*)attr; +- (NSAttributedString*) copyAdjustedForContentScaleFactor; +- (float) singleFontSize; +- (NSAttributedString*) copyWithNewFontSize:(float) size; @end diff --git a/cocos2d/Support/NSAttributedString+CCAdditions.m b/cocos2d/Support/NSAttributedString+CCAdditions.m new file mode 100644 index 0000000..f7bd90f --- /dev/null +++ b/cocos2d/Support/NSAttributedString+CCAdditions.m @@ -0,0 +1,146 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2008-2010 Ricardo Quesada + * Copyright (c) 2011 Zynga Inc. + * Copyright (c) 2013 Apportable + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + */ + +#import "NSAttributedString+CCAdditions.h" +#import "ccMacros.h" +#import "cocos2d.h" + +@implementation NSAttributedString (CCAdditions) + +- (BOOL) hasAttribute:(NSString*)attr +{ + NSRange fullRange = NSMakeRange(0, self.length); + __block BOOL hasAttribute = NO; + [self enumerateAttribute:attr + inRange:fullRange + options:NSAttributedStringEnumerationReverse + usingBlock:^(id value, NSRange range, BOOL* stop){ + if (value) + { + hasAttribute = YES; + *stop = YES; + } + }]; + + return hasAttribute; +} + +- (NSAttributedString*) copyAdjustedForContentScaleFactor +{ + NSMutableAttributedString* copy = [self mutableCopy]; + +#ifdef __CC_PLATFORM_IOS + NSRange fullRange = NSMakeRange(0, copy.length); + + // Update font size + [copy enumerateAttribute:NSFontAttributeName + inRange:fullRange + options:(NSAttributedStringEnumerationOptions)0 + usingBlock:^(id value, NSRange range, BOOL* stop){ + if (value) + { + UIFont* font = value; + [copy removeAttribute:NSFontAttributeName range:range]; + font = [UIFont fontWithName:font.fontName size:font.pointSize * CC_CONTENT_SCALE_FACTOR()]; + [copy addAttribute:NSFontAttributeName value:font range:range]; + } + }]; + + // Update shadows + [copy enumerateAttribute:NSShadowAttributeName + inRange:fullRange + options:(NSAttributedStringEnumerationOptions)0 + usingBlock:^(id value, NSRange range, BOOL* stop){ + if (value) + { + NSShadow* shadow = value; + [copy removeAttribute:NSShadowAttributeName range:range]; + shadow.shadowBlurRadius = shadow.shadowBlurRadius * CC_CONTENT_SCALE_FACTOR(); + CGSize offset = shadow.shadowOffset; + shadow.shadowOffset = CGSizeMake(offset.width * CC_CONTENT_SCALE_FACTOR(), offset.height * CC_CONTENT_SCALE_FACTOR()); + [copy addAttribute:NSShadowAttributeName value:shadow range:range]; + } + }]; +#endif + + return copy; +} + +- (float) singleFontSize +{ + NSRange fullRange = NSMakeRange(0, self.length); + __block BOOL foundValue = NO; + __block BOOL singleValue = YES; + __block float fontSize = 0; + [self enumerateAttribute:NSFontAttributeName + inRange:fullRange + options:(NSAttributedStringEnumerationOptions)0 + usingBlock:^(id value, NSRange range, BOOL* stop){ + if (value) + { +#ifdef __CC_PLATFORM_IOS + UIFont* font = value; +#elif defined(__CC_PLATFORM_MAC) + NSFont* font = value; +#endif + + if (foundValue) + { + singleValue = NO; + *stop = YES; + } + foundValue = YES; + fontSize = font.pointSize; + if (!NSEqualRanges(fullRange, range)) singleValue = NO; + } + }]; + + if (foundValue && singleValue) return fontSize; + return 0; +} + +- (NSAttributedString*) copyWithNewFontSize:(float) size +{ +#ifdef __CC_PLATFORM_IOS + UIFont* font = [self attribute:NSFontAttributeName atIndex:0 effectiveRange:NULL]; +#elif defined(__CC_PLATFORM_MAC) + NSFont* font = [self attribute:NSFontAttributeName atIndex:0 effectiveRange:NULL]; +#endif + if (!font) return NULL; + +#ifdef __CC_PLATFORM_IOS + UIFont* newFont = [UIFont fontWithName:font.fontName size:size]; +#elif defined(__CC_PLATFORM_MAC) + NSFont* newFont = [NSFont fontWithName:font.fontName size:size]; +#endif + NSMutableAttributedString* copy = [self mutableCopy]; + [copy addAttribute:NSFontAttributeName value:newFont range:NSMakeRange(0, copy.length)]; + + return copy; +} + +@end diff --git a/cocos2d/Support/NSThread+performBlock.h b/cocos2d/Support/NSThread+performBlock.h new file mode 100644 index 0000000..bb5ec8d --- /dev/null +++ b/cocos2d/Support/NSThread+performBlock.h @@ -0,0 +1,22 @@ +/* cocos2d for iPhone + * + * http://www.cocos2d-iphone.org + * + * + * Idea taken from: http://stackoverflow.com/a/3940757 + * + */ + +#import + +@interface NSThread (sendBlockToBackground) +/** performs a block on the thread. It won't wait until it is done. */ +- (void) performBlock:(void (^)(void))block; + +/** performs a block on the thread. */ +- (void) performBlock:(void (^)(void))block waitUntilDone:(BOOL)wait; + +/** performs a block on the thread. */ +- (void) performBlock:(void (^)(id param))block withObject:(id)object waitUntilDone:(BOOL)wait; + +@end diff --git a/src/cocos2d/Support/NSThread+performBlock.m b/cocos2d/Support/NSThread+performBlock.m similarity index 81% rename from src/cocos2d/Support/NSThread+performBlock.m rename to cocos2d/Support/NSThread+performBlock.m index 2035161..6c47bee 100644 --- a/src/cocos2d/Support/NSThread+performBlock.m +++ b/cocos2d/Support/NSThread+performBlock.m @@ -9,7 +9,7 @@ #import "NSThread+performBlock.h" -#import "../ccMacros.h" +#import "ccMacros.h" typedef void (^BlockWithParam)(id param); @interface CCObjectWith2Params : NSObject @@ -19,23 +19,20 @@ @interface CCObjectWith2Params : NSObject id param; } @property (nonatomic,copy) BlockWithParam block; -@property (nonatomic,readwrite,retain) id param; +@property (nonatomic,readwrite,strong) id param; @end @implementation CCObjectWith2Params @synthesize block, param; - (void)dealloc { CCLOG(@"cocos2d: deallocing %@", self); - [block release]; - [param release]; - [super dealloc]; } @end @implementation NSThread (sendBlockToBackground) -- (void) performBlock: (void (^)(void))block; +- (void) performBlock: (void (^)(void))block { return [self performBlock:block waitUntilDone:NO]; } @@ -44,7 +41,7 @@ - (void) performBlock:(void (^)(void))block waitUntilDone:(BOOL)wait { [self performSelector:@selector(executeBlock:) onThread:self - withObject: [[block copy] autorelease] + withObject: [block copy] waitUntilDone: wait]; } @@ -54,15 +51,13 @@ - (void) performBlock:(void (^)(id param))block withObject:(id)object waitUntilD obj.block = block; obj.param = object; - [obj autorelease]; - [self performSelector:@selector(executeBlock2:) onThread:self withObject:obj waitUntilDone:wait]; } -- (void) executeBlock: (void (^)(void))block; +- (void) executeBlock: (void (^)(void))block { block(); } diff --git a/cocos2d/Support/OpenGL_Internal.h b/cocos2d/Support/OpenGL_Internal.h new file mode 100644 index 0000000..82dc473 --- /dev/null +++ b/cocos2d/Support/OpenGL_Internal.h @@ -0,0 +1,86 @@ +/* + +===== IMPORTANT ===== + +This is sample code demonstrating API, technology or techniques in development. +Although this sample code has been reviewed for technical accuracy, it is not +final. Apple is supplying this information to help you plan for the adoption of +the technologies and programming interfaces described herein. This information +is subject to change, and software implemented based on this sample code should +be tested with final operating system software and final documentation. Newer +versions of this sample code may be provided with future seeds of the API or +technology. For information about updates to this and other developer +documentation, view the New & Updated sidebars in subsequent documentation +seeds. + +===================== + +File: OpenGL_Internal.h +Abstract: This file is included for support purposes and isn't necessary for +understanding this sample. + +Version: 1.0 + +Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple Inc. +("Apple") in consideration of your agreement to the following terms, and your +use, installation, modification or redistribution of this Apple software +constitutes acceptance of these terms. If you do not agree with these terms, +please do not use, install, modify or redistribute this Apple software. + +In consideration of your agreement to abide by the following terms, and subject +to these terms, Apple grants you a personal, non-exclusive license, under +Apple's copyrights in this original Apple software (the "Apple Software"), to +use, reproduce, modify and redistribute the Apple Software, with or without +modifications, in source and/or binary forms; provided that if you redistribute +the Apple Software in its entirety and without modifications, you must retain +this notice and the following text and disclaimers in all such redistributions +of the Apple Software. +Neither the name, trademarks, service marks or logos of Apple Inc. may be used +to endorse or promote products derived from the Apple Software without specific +prior written permission from Apple. Except as expressly stated in this notice, +no other rights or licenses, express or implied, are granted by Apple herein, +including but not limited to any patent rights that may be infringed by your +derivative works or by other works in which the Apple Software may be +incorporated. + +The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES NO +WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED +WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION ALONE OR IN +COMBINATION WITH YOUR PRODUCTS. + +IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE +GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR +DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF +CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF +APPLE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Copyright (C) 2008 Apple Inc. All Rights Reserved. + +*/ + +/* Generic error reporting */ +#define REPORT_ERROR(__FORMAT__, ...) printf("%s: %s\n", __FUNCTION__, [[NSString stringWithFormat:__FORMAT__, __VA_ARGS__] UTF8String]) + +/* EAGL and GL functions calling wrappers that log on error */ +#define CALL_EAGL_FUNCTION(__FUNC__, ...) ({ EAGLError __error = __FUNC__( __VA_ARGS__ ); if(__error != kEAGLErrorSuccess) printf("%s() called from %s returned error %i\n", #__FUNC__, __FUNCTION__, __error); (__error ? NO : YES); }) +//#define CHECK_GL_ERROR() ({ GLenum __error = glGetError(); if(__error) printf("OpenGL error 0x%04X in %s\n", __error, __FUNCTION__); (__error ? NO : YES); }) +#define CHECK_GL_ERROR() ({ GLenum __error = glGetError(); if(__error) printf("OpenGL error 0x%04X in %s %d\n", __error, __FUNCTION__, __LINE__); }) + +#if DEBUG +#define CHECK_GL_ERROR_DEBUG() ({ GLenum __error = glGetError(); if(__error) printf("OpenGL error 0x%04X in %s %d\n", __error, __FUNCTION__, __LINE__); }) +#else +#define CHECK_GL_ERROR_DEBUG() +#endif + +/* Optional delegate methods support */ +#ifndef __DELEGATE_IVAR__ +#define __DELEGATE_IVAR__ _delegate +#endif +#ifndef __DELEGATE_METHODS_IVAR__ +#define __DELEGATE_METHODS_IVAR__ _delegateMethods +#endif +#define TEST_DELEGATE_METHOD_BIT(__BIT__) (self->__DELEGATE_METHODS_IVAR__ & (1 << __BIT__)) +#define SET_DELEGATE_METHOD_BIT(__BIT__, __NAME__) { if([self->__DELEGATE_IVAR__ respondsToSelector:@selector(__NAME__)]) self->__DELEGATE_METHODS_IVAR__ |= (1 << __BIT__); else self->__DELEGATE_METHODS_IVAR__ &= ~(1 << __BIT__); } diff --git a/cocos2d/Support/TGAlib.h b/cocos2d/Support/TGAlib.h new file mode 100644 index 0000000..c52a2a5 --- /dev/null +++ b/cocos2d/Support/TGAlib.h @@ -0,0 +1,55 @@ +// +// TGA lib for cocos2d-iphone +// +// sources from: http://www.lighthouse3d.com/opengl/terrain/index.php3?tgasource +// + +//#ifndef TGA_LIB +//#define TGA_LIB + +/** + @file + TGA image support + */ + +enum { + TGA_OK, + TGA_ERROR_FILE_OPEN, + TGA_ERROR_READING_FILE, + TGA_ERROR_INDEXED_COLOR, + TGA_ERROR_MEMORY, + TGA_ERROR_COMPRESSED_FILE, +}; + +/** TGA format */ +typedef struct sImageTGA { + int status; + unsigned char type, pixelDepth; + + /** map width */ + short int width; + + /** map height */ + short int height; + + /** raw data */ + unsigned char *imageData; + int flipped; +} tImageTGA; + +/// load the image header fields. We only keep those that matter! +void tgaLoadHeader(FILE *file, tImageTGA *info); + +/// loads the image pixels. You shouldn't call this function directly +void tgaLoadImageData(FILE *file, tImageTGA *info); + +/// this is the function to call when we want to load an image +tImageTGA * tgaLoad(const char *filename); + +// /converts RGB to greyscale +void tgaRGBtogreyscale(tImageTGA *info); + +/// releases the memory used for the image +void tgaDestroy(tImageTGA *info); + +//#endif // TGA_LIB diff --git a/src/cocos2d/Support/TGAlib.m b/cocos2d/Support/TGAlib.m similarity index 100% rename from src/cocos2d/Support/TGAlib.m rename to cocos2d/Support/TGAlib.m diff --git a/cocos2d/Support/TransformUtils.h b/cocos2d/Support/TransformUtils.h new file mode 100644 index 0000000..4808035 --- /dev/null +++ b/cocos2d/Support/TransformUtils.h @@ -0,0 +1,36 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2009 Valentin Milea + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + */ + +#import "ccMacros.h" +#import "../Platforms/CCGL.h" + +#ifdef __CC_PLATFORM_IOS +#import +#elif defined(__CC_PLATFORM_MAC) +#import +#endif + +void CGAffineToGL(const CGAffineTransform *t, GLfloat *m); +void GLToCGAffine(const GLfloat *m, CGAffineTransform *t); diff --git a/src/cocos2d/Support/TransformUtils.m b/cocos2d/Support/TransformUtils.m similarity index 100% rename from src/cocos2d/Support/TransformUtils.m rename to cocos2d/Support/TransformUtils.m diff --git a/cocos2d/Support/ZipUtils.h b/cocos2d/Support/ZipUtils.h new file mode 100644 index 0000000..6474523 --- /dev/null +++ b/cocos2d/Support/ZipUtils.h @@ -0,0 +1,94 @@ +/* cocos2d for iPhone + * + * http://www.cocos2d-iphone.org + * + * + * inflateMemory_ based on zlib example code + * http://www.zlib.net + * + * Some ideas were taken from: + * http://themanaworld.org/ + * from the mapreader.cpp file + * + */ + +#ifndef __CC_ZIP_UTILS_H +#define __CC_ZIP_UTILS_H + +#import + +#ifdef __cplusplus +extern "C" { +#endif + + /* XXX: pragma pack ??? */ + /** @struct CCZHeader + */ +#pragma clang diagnostic push COCOS2D +#pragma clang diagnostic ignored "-Wpacked" + struct CCZHeader { + uint8_t sig[4]; // signature. Should be 'CCZ!' 4 bytes + uint16_t compression_type; // should 0 + uint16_t version; // should be 2 (although version type==1 is also supported) + uint32_t reserved; // Reserved for users. + uint32_t len; // size of the uncompressed file + }__attribute__((packed)); + + enum { + CCZ_COMPRESSION_ZLIB, // zlib format. + CCZ_COMPRESSION_BZIP2, // bzip2 format (not supported yet) + CCZ_COMPRESSION_GZIP, // gzip format (not supported yet) + CCZ_COMPRESSION_NONE, // plain (not supported yet) + }; +#pragma clang diagnostic pop COCOS2D + +/** @file + * Zip helper functions + */ + +/** + * Inflates either zlib or gzip deflated memory. The inflated memory is + * expected to be freed by the caller. + * + * It will allocate 256k for the destination buffer. If it is not enough it will multiply the previous buffer size per 2, until there is enough memory. + * @returns the length of the deflated buffer + * + @since v0.8.1 + */ +int ccInflateMemory(unsigned char *in, unsigned int inLength, unsigned char **out); + +/** + * Inflates either zlib or gzip deflated memory. The inflated memory is + * expected to be freed by the caller. + * + * outlengthHint is assumed to be the needed room to allocate the inflated buffer. + * + * @returns the length of the deflated buffer + * + @since v1.0.0 + */ +int ccInflateMemoryWithHint(unsigned char *in, unsigned int inLength, unsigned char **out, unsigned int outlengthHint ); + + +/** inflates a GZip file into memory + * + * @returns the length of the deflated buffer + * + * @since v0.99.5 + */ +int ccInflateGZipFile(const char *filename, unsigned char **out); + +/** inflates a CCZ file into memory + * + * @returns the length of the deflated buffer + * + * @since v0.99.5 + */ +int ccInflateCCZFile(const char *filename, unsigned char **out); + + +#ifdef __cplusplus +} +#endif + +#endif // __CC_ZIP_UTILS_H diff --git a/src/cocos2d/Support/ZipUtils.m b/cocos2d/Support/ZipUtils.m similarity index 98% rename from src/cocos2d/Support/ZipUtils.m rename to cocos2d/Support/ZipUtils.m index d3a2379..3cc693e 100644 --- a/src/cocos2d/Support/ZipUtils.m +++ b/cocos2d/Support/ZipUtils.m @@ -21,18 +21,18 @@ #import "ZipUtils.h" #import "CCFileUtils.h" -#import "../ccMacros.h" +#import "ccMacros.h" // memory in iPhone is precious // Should buffer factor be 1.5 instead of 2 ? #define BUFFER_INC_FACTOR (2) -static int inflateMemoryWithHint(unsigned char *in, unsigned int inLength, unsigned char **out, unsigned int *outLength, unsigned int outLenghtHint ) +static int inflateMemoryWithHint(unsigned char *in, unsigned int inLength, unsigned char **out, unsigned int *outLength, unsigned int outlengthHint ) { /* ret value */ int err = Z_OK; - int bufferSize = outLenghtHint; + int bufferSize = outlengthHint; *out = (unsigned char*) malloc(bufferSize); z_stream d_stream; /* decompression stream */ diff --git a/src/cocos2d/Support/base64.c b/cocos2d/Support/base64.c similarity index 93% rename from src/cocos2d/Support/base64.c rename to cocos2d/Support/base64.c index 1a7df47..a679898 100644 --- a/src/cocos2d/Support/base64.c +++ b/cocos2d/Support/base64.c @@ -9,14 +9,14 @@ #include "base64.h" -unsigned char alphabet[64] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; +static unsigned char alphabet[64] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; int _base64Decode( unsigned char *input, unsigned int input_len, unsigned char *output, unsigned int *output_len ); int _base64Decode( unsigned char *input, unsigned int input_len, unsigned char *output, unsigned int *output_len ) { static char inalphabet[256], decoder[256]; - int i, bits, c, char_count, errors = 0; + int i, bits, c = 0, char_count, errors = 0; unsigned int input_idx = 0; unsigned int output_idx = 0; diff --git a/cocos2d/Support/base64.h b/cocos2d/Support/base64.h new file mode 100644 index 0000000..095fc98 --- /dev/null +++ b/cocos2d/Support/base64.h @@ -0,0 +1,33 @@ +/* + public domain BASE64 code + + modified for cocos2d-iphone: http://www.cocos2d-iphone.org + */ + +#ifndef __CC_BASE64_DECODE_H +#define __CC_BASE64_DECODE_H + +#ifdef __cplusplus +extern "C" { +#endif + + +/** @file + base64 helper functions + */ + +/** + * Decodes a 64base encoded memory. The decoded memory is + * expected to be freed by the caller. + * + * @returns the length of the out buffer + * + @since v0.8.1 + */ +int base64Decode(unsigned char *in, unsigned int inLength, unsigned char **out); + +#ifdef __cplusplus +} +#endif + +#endif // __CC_BASE64_DECODE_H diff --git a/src/cocos2d/Support/ccUtils.c b/cocos2d/Support/ccUtils.c similarity index 100% rename from src/cocos2d/Support/ccUtils.c rename to cocos2d/Support/ccUtils.c diff --git a/cocos2d/Support/ccUtils.h b/cocos2d/Support/ccUtils.h new file mode 100644 index 0000000..5f84ff3 --- /dev/null +++ b/cocos2d/Support/ccUtils.h @@ -0,0 +1,36 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + */ + +#ifndef __CC_UTILS_H +#define __CC_UTILS_H + +#ifdef __cplusplus +extern "C" { +#endif + +/** @file ccUtils.h + Misc free functions + */ + +/* + ccNextPOT function is licensed under the same license that is used in CCTexture2D.m. + */ + +/** returns the Next Power of Two value. + + Examples: + - If "value" is 15, it will return 16. + - If "value" is 16, it will return 16. + - If "value" is 17, it will return 32. + + @since v0.99.5 + */ +unsigned long ccNextPOT( unsigned long value ); + +#ifdef __cplusplus +} +#endif + +#endif // ! __CC_UTILS_H diff --git a/cocos2d/Support/uthash.h b/cocos2d/Support/uthash.h new file mode 100644 index 0000000..92635f5 --- /dev/null +++ b/cocos2d/Support/uthash.h @@ -0,0 +1,917 @@ +/* +Copyright (c) 2003-2013, Troy D. Hanson http://uthash.sourceforge.net +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS +IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER +OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#ifndef UTHASH_H +#define UTHASH_H + +#include /* memcmp,strlen */ +#include /* ptrdiff_t */ +#include /* exit() */ + +/* These macros use decltype or the earlier __typeof GNU extension. + As decltype is only available in newer compilers (VS2010 or gcc 4.3+ + when compiling c++ source) this code uses whatever method is needed + or, for VS2008 where neither is available, uses casting workarounds. */ +#ifdef _MSC_VER /* MS compiler */ +#if _MSC_VER >= 1600 && defined(__cplusplus) /* VS2010 or newer in C++ mode */ +#define DECLTYPE(x) (decltype(x)) +#else /* VS2008 or older (or VS2010 in C mode) */ +#define NO_DECLTYPE +#define DECLTYPE(x) +#endif +#else /* GNU, Sun and other compilers */ +#define DECLTYPE(x) (__typeof(x)) +#endif + +#ifdef NO_DECLTYPE +#define DECLTYPE_ASSIGN(dst,src) \ +do { \ + char **_da_dst = (char**)(&(dst)); \ + *_da_dst = (char*)(src); \ +} while(0) +#else +#define DECLTYPE_ASSIGN(dst,src) \ +do { \ + (dst) = DECLTYPE(dst)(src); \ +} while(0) +#endif + +/* a number of the hash function use uint32_t which isn't defined on win32 */ +#ifdef _MSC_VER +typedef unsigned int uint32_t; +typedef unsigned char uint8_t; +#else +#include /* uint32_t */ +#endif + +#define UTHASH_VERSION 1.9.7 + +#ifndef uthash_fatal +#define uthash_fatal(msg) exit(-1) /* fatal error (out of memory,etc) */ +#endif +#ifndef uthash_malloc +#define uthash_malloc(sz) malloc(sz) /* malloc fcn */ +#endif +#ifndef uthash_free +#define uthash_free(ptr,sz) free(ptr) /* free fcn */ +#endif + +#ifndef uthash_noexpand_fyi +#define uthash_noexpand_fyi(tbl) /* can be defined to log noexpand */ +#endif +#ifndef uthash_expand_fyi +#define uthash_expand_fyi(tbl) /* can be defined to log expands */ +#endif + +/* initial number of buckets */ +#define HASH_INITIAL_NUM_BUCKETS 32 /* initial number of buckets */ +#define HASH_INITIAL_NUM_BUCKETS_LOG2 5 /* lg2 of initial number of buckets */ +#define HASH_BKT_CAPACITY_THRESH 10 /* expand when bucket count reaches */ + +/* calculate the element whose hash handle address is hhe */ +#define ELMT_FROM_HH(tbl,hhp) ((void*)(((char*)(hhp)) - ((tbl)->hho))) + +#define HASH_FIND(hh,head,keyptr,keylen,out) \ +do { \ + unsigned _hf_bkt,_hf_hashv; \ + out=NULL; \ + if (head) { \ + HASH_FCN(keyptr,keylen, (head)->hh.tbl->num_buckets, _hf_hashv, _hf_bkt); \ + if (HASH_BLOOM_TEST((head)->hh.tbl, _hf_hashv)) { \ + HASH_FIND_IN_BKT((head)->hh.tbl, hh, (head)->hh.tbl->buckets[ _hf_bkt ], \ + keyptr,keylen,out); \ + } \ + } \ +} while (0) + +#ifdef HASH_BLOOM +#define HASH_BLOOM_BITLEN (1ULL << HASH_BLOOM) +#define HASH_BLOOM_BYTELEN (HASH_BLOOM_BITLEN/8) + ((HASH_BLOOM_BITLEN%8) ? 1:0) +#define HASH_BLOOM_MAKE(tbl) \ +do { \ + (tbl)->bloom_nbits = HASH_BLOOM; \ + (tbl)->bloom_bv = (uint8_t*)uthash_malloc(HASH_BLOOM_BYTELEN); \ + if (!((tbl)->bloom_bv)) { uthash_fatal( "out of memory"); } \ + memset((tbl)->bloom_bv, 0, HASH_BLOOM_BYTELEN); \ + (tbl)->bloom_sig = HASH_BLOOM_SIGNATURE; \ +} while (0) + +#define HASH_BLOOM_FREE(tbl) \ +do { \ + uthash_free((tbl)->bloom_bv, HASH_BLOOM_BYTELEN); \ +} while (0) + +#define HASH_BLOOM_BITSET(bv,idx) (bv[(idx)/8] |= (1U << ((idx)%8))) +#define HASH_BLOOM_BITTEST(bv,idx) (bv[(idx)/8] & (1U << ((idx)%8))) + +#define HASH_BLOOM_ADD(tbl,hashv) \ + HASH_BLOOM_BITSET((tbl)->bloom_bv, (hashv & (uint32_t)((1ULL << (tbl)->bloom_nbits) - 1))) + +#define HASH_BLOOM_TEST(tbl,hashv) \ + HASH_BLOOM_BITTEST((tbl)->bloom_bv, (hashv & (uint32_t)((1ULL << (tbl)->bloom_nbits) - 1))) + +#else +#define HASH_BLOOM_MAKE(tbl) +#define HASH_BLOOM_FREE(tbl) +#define HASH_BLOOM_ADD(tbl,hashv) +#define HASH_BLOOM_TEST(tbl,hashv) (1) +#endif + +#define HASH_MAKE_TABLE(hh,head) \ +do { \ + (head)->hh.tbl = (UT_hash_table*)uthash_malloc( \ + sizeof(UT_hash_table)); \ + if (!((head)->hh.tbl)) { uthash_fatal( "out of memory"); } \ + memset((head)->hh.tbl, 0, sizeof(UT_hash_table)); \ + (head)->hh.tbl->tail = &((head)->hh); \ + (head)->hh.tbl->num_buckets = HASH_INITIAL_NUM_BUCKETS; \ + (head)->hh.tbl->log2_num_buckets = HASH_INITIAL_NUM_BUCKETS_LOG2; \ + (head)->hh.tbl->hho = (char*)(&(head)->hh) - (char*)(head); \ + (head)->hh.tbl->buckets = (UT_hash_bucket*)uthash_malloc( \ + HASH_INITIAL_NUM_BUCKETS*sizeof(struct UT_hash_bucket)); \ + if (! (head)->hh.tbl->buckets) { uthash_fatal( "out of memory"); } \ + memset((head)->hh.tbl->buckets, 0, \ + HASH_INITIAL_NUM_BUCKETS*sizeof(struct UT_hash_bucket)); \ + HASH_BLOOM_MAKE((head)->hh.tbl); \ + (head)->hh.tbl->signature = HASH_SIGNATURE; \ +} while(0) + +#define HASH_ADD(hh,head,fieldname,keylen_in,add) \ + HASH_ADD_KEYPTR(hh,head,(void*)(&((add)->fieldname)),keylen_in,add) + +#define HASH_ADD_KEYPTR(hh,head,keyptr,keylen_in,add) \ +do { \ + unsigned _ha_bkt; \ + (add)->hh.next = NULL; \ + (add)->hh.key = (char*)keyptr; \ + (add)->hh.keylen = (unsigned)keylen_in; \ + if (!(head)) { \ + head = (add); \ + (head)->hh.prev = NULL; \ + HASH_MAKE_TABLE(hh,head); \ + } else { \ + (head)->hh.tbl->tail->next = (add); \ + (add)->hh.prev = ELMT_FROM_HH((head)->hh.tbl, (head)->hh.tbl->tail); \ + (head)->hh.tbl->tail = &((add)->hh); \ + } \ + (head)->hh.tbl->num_items++; \ + (add)->hh.tbl = (head)->hh.tbl; \ + HASH_FCN(keyptr,keylen_in, (head)->hh.tbl->num_buckets, \ + (add)->hh.hashv, _ha_bkt); \ + HASH_ADD_TO_BKT((head)->hh.tbl->buckets[_ha_bkt],&(add)->hh); \ + HASH_BLOOM_ADD((head)->hh.tbl,(add)->hh.hashv); \ + HASH_EMIT_KEY(hh,head,keyptr,keylen_in); \ + HASH_FSCK(hh,head); \ +} while(0) + +#define HASH_TO_BKT( hashv, num_bkts, bkt ) \ +do { \ + bkt = ((hashv) & ((num_bkts) - 1)); \ +} while(0) + +/* delete "delptr" from the hash table. + * "the usual" patch-up process for the app-order doubly-linked-list. + * The use of _hd_hh_del below deserves special explanation. + * These used to be expressed using (delptr) but that led to a bug + * if someone used the same symbol for the head and deletee, like + * HASH_DELETE(hh,users,users); + * We want that to work, but by changing the head (users) below + * we were forfeiting our ability to further refer to the deletee (users) + * in the patch-up process. Solution: use scratch space to + * copy the deletee pointer, then the latter references are via that + * scratch pointer rather than through the repointed (users) symbol. + */ +#define HASH_DELETE(hh,head,delptr) \ +do { \ + unsigned _hd_bkt; \ + struct UT_hash_handle *_hd_hh_del; \ + if ( ((delptr)->hh.prev == NULL) && ((delptr)->hh.next == NULL) ) { \ + uthash_free((head)->hh.tbl->buckets, \ + (head)->hh.tbl->num_buckets*sizeof(struct UT_hash_bucket) ); \ + HASH_BLOOM_FREE((head)->hh.tbl); \ + uthash_free((head)->hh.tbl, sizeof(UT_hash_table)); \ + head = NULL; \ + } else { \ + _hd_hh_del = &((delptr)->hh); \ + if ((delptr) == ELMT_FROM_HH((head)->hh.tbl,(head)->hh.tbl->tail)) { \ + (head)->hh.tbl->tail = \ + (UT_hash_handle*)((ptrdiff_t)((delptr)->hh.prev) + \ + (head)->hh.tbl->hho); \ + } \ + if ((delptr)->hh.prev) { \ + ((UT_hash_handle*)((ptrdiff_t)((delptr)->hh.prev) + \ + (head)->hh.tbl->hho))->next = (delptr)->hh.next; \ + } else { \ + DECLTYPE_ASSIGN(head,(delptr)->hh.next); \ + } \ + if (_hd_hh_del->next) { \ + ((UT_hash_handle*)((ptrdiff_t)_hd_hh_del->next + \ + (head)->hh.tbl->hho))->prev = \ + _hd_hh_del->prev; \ + } \ + HASH_TO_BKT( _hd_hh_del->hashv, (head)->hh.tbl->num_buckets, _hd_bkt); \ + HASH_DEL_IN_BKT(hh,(head)->hh.tbl->buckets[_hd_bkt], _hd_hh_del); \ + (head)->hh.tbl->num_items--; \ + } \ + HASH_FSCK(hh,head); \ +} while (0) + + +/* convenience forms of HASH_FIND/HASH_ADD/HASH_DEL */ +#define HASH_FIND_STR(head,findstr,out) \ + HASH_FIND(hh,head,findstr,strlen(findstr),out) +#define HASH_ADD_STR(head,strfield,add) \ + HASH_ADD(hh,head,strfield,strlen(add->strfield),add) +#define HASH_FIND_INT(head,findint,out) \ + HASH_FIND(hh,head,findint,sizeof(int),out) +#define HASH_ADD_INT(head,intfield,add) \ + HASH_ADD(hh,head,intfield,sizeof(int),add) +#define HASH_FIND_PTR(head,findptr,out) \ + HASH_FIND(hh,head,findptr,sizeof(void *),out) +#define HASH_ADD_PTR(head,ptrfield,add) \ + HASH_ADD(hh,head,ptrfield,sizeof(void *),add) +#define HASH_DEL(head,delptr) \ + HASH_DELETE(hh,head,delptr) + +/* HASH_FSCK checks hash integrity on every add/delete when HASH_DEBUG is defined. + * This is for uthash developer only; it compiles away if HASH_DEBUG isn't defined. + */ +#ifdef HASH_DEBUG +#define HASH_OOPS(...) do { fprintf(stderr,__VA_ARGS__); exit(-1); } while (0) +#define HASH_FSCK(hh,head) \ +do { \ + unsigned _bkt_i; \ + unsigned _count, _bkt_count; \ + char *_prev; \ + struct UT_hash_handle *_thh; \ + if (head) { \ + _count = 0; \ + for( _bkt_i = 0; _bkt_i < (head)->hh.tbl->num_buckets; _bkt_i++) { \ + _bkt_count = 0; \ + _thh = (head)->hh.tbl->buckets[_bkt_i].hh_head; \ + _prev = NULL; \ + while (_thh) { \ + if (_prev != (char*)(_thh->hh_prev)) { \ + HASH_OOPS("invalid hh_prev %p, actual %p\n", \ + _thh->hh_prev, _prev ); \ + } \ + _bkt_count++; \ + _prev = (char*)(_thh); \ + _thh = _thh->hh_next; \ + } \ + _count += _bkt_count; \ + if ((head)->hh.tbl->buckets[_bkt_i].count != _bkt_count) { \ + HASH_OOPS("invalid bucket count %d, actual %d\n", \ + (head)->hh.tbl->buckets[_bkt_i].count, _bkt_count); \ + } \ + } \ + if (_count != (head)->hh.tbl->num_items) { \ + HASH_OOPS("invalid hh item count %d, actual %d\n", \ + (head)->hh.tbl->num_items, _count ); \ + } \ + /* traverse hh in app order; check next/prev integrity, count */ \ + _count = 0; \ + _prev = NULL; \ + _thh = &(head)->hh; \ + while (_thh) { \ + _count++; \ + if (_prev !=(char*)(_thh->prev)) { \ + HASH_OOPS("invalid prev %p, actual %p\n", \ + _thh->prev, _prev ); \ + } \ + _prev = (char*)ELMT_FROM_HH((head)->hh.tbl, _thh); \ + _thh = ( _thh->next ? (UT_hash_handle*)((char*)(_thh->next) + \ + (head)->hh.tbl->hho) : NULL ); \ + } \ + if (_count != (head)->hh.tbl->num_items) { \ + HASH_OOPS("invalid app item count %d, actual %d\n", \ + (head)->hh.tbl->num_items, _count ); \ + } \ + } \ +} while (0) +#else +#define HASH_FSCK(hh,head) +#endif + +/* When compiled with -DHASH_EMIT_KEYS, length-prefixed keys are emitted to + * the descriptor to which this macro is defined for tuning the hash function. + * The app can #include to get the prototype for write(2). */ +#ifdef HASH_EMIT_KEYS +#define HASH_EMIT_KEY(hh,head,keyptr,fieldlen) \ +do { \ + unsigned _klen = fieldlen; \ + write(HASH_EMIT_KEYS, &_klen, sizeof(_klen)); \ + write(HASH_EMIT_KEYS, keyptr, fieldlen); \ +} while (0) +#else +#define HASH_EMIT_KEY(hh,head,keyptr,fieldlen) +#endif + +/* default to Jenkin's hash unless overridden e.g. DHASH_FUNCTION=HASH_SAX */ +#ifdef HASH_FUNCTION +#define HASH_FCN HASH_FUNCTION +#else +#define HASH_FCN HASH_JEN +#endif + +/* The Bernstein hash function, used in Perl prior to v5.6 */ +#define HASH_BER(key,keylen,num_bkts,hashv,bkt) \ +do { \ + unsigned _hb_keylen=keylen; \ + char *_hb_key=(char*)(key); \ + (hashv) = 0; \ + while (_hb_keylen--) { (hashv) = ((hashv) * 33) + *_hb_key++; } \ + bkt = (hashv) & (num_bkts-1); \ +} while (0) + + +/* SAX/FNV/OAT/JEN hash functions are macro variants of those listed at + * http://eternallyconfuzzled.com/tuts/algorithms/jsw_tut_hashing.aspx */ +#define HASH_SAX(key,keylen,num_bkts,hashv,bkt) \ +do { \ + unsigned _sx_i; \ + char *_hs_key=(char*)(key); \ + hashv = 0; \ + for(_sx_i=0; _sx_i < keylen; _sx_i++) \ + hashv ^= (hashv << 5) + (hashv >> 2) + _hs_key[_sx_i]; \ + bkt = hashv & (num_bkts-1); \ +} while (0) + +#define HASH_FNV(key,keylen,num_bkts,hashv,bkt) \ +do { \ + unsigned _fn_i; \ + char *_hf_key=(char*)(key); \ + hashv = 2166136261UL; \ + for(_fn_i=0; _fn_i < keylen; _fn_i++) \ + hashv = (hashv * 16777619) ^ _hf_key[_fn_i]; \ + bkt = hashv & (num_bkts-1); \ +} while(0) + +#define HASH_OAT(key,keylen,num_bkts,hashv,bkt) \ +do { \ + unsigned _ho_i; \ + char *_ho_key=(char*)(key); \ + hashv = 0; \ + for(_ho_i=0; _ho_i < keylen; _ho_i++) { \ + hashv += _ho_key[_ho_i]; \ + hashv += (hashv << 10); \ + hashv ^= (hashv >> 6); \ + } \ + hashv += (hashv << 3); \ + hashv ^= (hashv >> 11); \ + hashv += (hashv << 15); \ + bkt = hashv & (num_bkts-1); \ +} while(0) + +#define HASH_JEN_MIX(a,b,c) \ +do { \ + a -= b; a -= c; a ^= ( c >> 13 ); \ + b -= c; b -= a; b ^= ( a << 8 ); \ + c -= a; c -= b; c ^= ( b >> 13 ); \ + a -= b; a -= c; a ^= ( c >> 12 ); \ + b -= c; b -= a; b ^= ( a << 16 ); \ + c -= a; c -= b; c ^= ( b >> 5 ); \ + a -= b; a -= c; a ^= ( c >> 3 ); \ + b -= c; b -= a; b ^= ( a << 10 ); \ + c -= a; c -= b; c ^= ( b >> 15 ); \ +} while (0) + +#define HASH_JEN(key,keylen,num_bkts,hashv,bkt) \ +do { \ + unsigned _hj_i,_hj_j,_hj_k; \ + char *_hj_key=(char*)(key); \ + hashv = 0xfeedbeef; \ + _hj_i = _hj_j = 0x9e3779b9; \ + _hj_k = (unsigned)keylen; \ + while (_hj_k >= 12) { \ + _hj_i += (_hj_key[0] + ( (unsigned)_hj_key[1] << 8 ) \ + + ( (unsigned)_hj_key[2] << 16 ) \ + + ( (unsigned)_hj_key[3] << 24 ) ); \ + _hj_j += (_hj_key[4] + ( (unsigned)_hj_key[5] << 8 ) \ + + ( (unsigned)_hj_key[6] << 16 ) \ + + ( (unsigned)_hj_key[7] << 24 ) ); \ + hashv += (_hj_key[8] + ( (unsigned)_hj_key[9] << 8 ) \ + + ( (unsigned)_hj_key[10] << 16 ) \ + + ( (unsigned)_hj_key[11] << 24 ) ); \ + \ + HASH_JEN_MIX(_hj_i, _hj_j, hashv); \ + \ + _hj_key += 12; \ + _hj_k -= 12; \ + } \ + hashv += keylen; \ + switch ( _hj_k ) { \ + case 11: hashv += ( (unsigned)_hj_key[10] << 24 ); \ + case 10: hashv += ( (unsigned)_hj_key[9] << 16 ); \ + case 9: hashv += ( (unsigned)_hj_key[8] << 8 ); \ + case 8: _hj_j += ( (unsigned)_hj_key[7] << 24 ); \ + case 7: _hj_j += ( (unsigned)_hj_key[6] << 16 ); \ + case 6: _hj_j += ( (unsigned)_hj_key[5] << 8 ); \ + case 5: _hj_j += _hj_key[4]; \ + case 4: _hj_i += ( (unsigned)_hj_key[3] << 24 ); \ + case 3: _hj_i += ( (unsigned)_hj_key[2] << 16 ); \ + case 2: _hj_i += ( (unsigned)_hj_key[1] << 8 ); \ + case 1: _hj_i += _hj_key[0]; \ + } \ + HASH_JEN_MIX(_hj_i, _hj_j, hashv); \ + bkt = hashv & (num_bkts-1); \ +} while(0) + +/* The Paul Hsieh hash function */ +#undef get16bits +#if (defined(__GNUC__) && defined(__i386__)) || defined(__WATCOMC__) \ + || defined(_MSC_VER) || defined (__BORLANDC__) || defined (__TURBOC__) +#define get16bits(d) (*((const uint16_t *) (d))) +#endif + +#if !defined (get16bits) +#define get16bits(d) ((((uint32_t)(((const uint8_t *)(d))[1])) << 8) \ + +(uint32_t)(((const uint8_t *)(d))[0]) ) +#endif +#define HASH_SFH(key,keylen,num_bkts,hashv,bkt) \ +do { \ + char *_sfh_key=(char*)(key); \ + uint32_t _sfh_tmp, _sfh_len = keylen; \ + \ + int _sfh_rem = _sfh_len & 3; \ + _sfh_len >>= 2; \ + hashv = 0xcafebabe; \ + \ + /* Main loop */ \ + for (;_sfh_len > 0; _sfh_len--) { \ + hashv += get16bits (_sfh_key); \ + _sfh_tmp = (get16bits (_sfh_key+2) << 11) ^ hashv; \ + hashv = (hashv << 16) ^ _sfh_tmp; \ + _sfh_key += 2*sizeof (uint16_t); \ + hashv += hashv >> 11; \ + } \ + \ + /* Handle end cases */ \ + switch (_sfh_rem) { \ + case 3: hashv += get16bits (_sfh_key); \ + hashv ^= hashv << 16; \ + hashv ^= _sfh_key[sizeof (uint16_t)] << 18; \ + hashv += hashv >> 11; \ + break; \ + case 2: hashv += get16bits (_sfh_key); \ + hashv ^= hashv << 11; \ + hashv += hashv >> 17; \ + break; \ + case 1: hashv += *_sfh_key; \ + hashv ^= hashv << 10; \ + hashv += hashv >> 1; \ + } \ + \ + /* Force "avalanching" of final 127 bits */ \ + hashv ^= hashv << 3; \ + hashv += hashv >> 5; \ + hashv ^= hashv << 4; \ + hashv += hashv >> 17; \ + hashv ^= hashv << 25; \ + hashv += hashv >> 6; \ + bkt = hashv & (num_bkts-1); \ +} while(0) + +#ifdef HASH_USING_NO_STRICT_ALIASING +/* The MurmurHash exploits some CPU's (x86,x86_64) tolerance for unaligned reads. + * For other types of CPU's (e.g. Sparc) an unaligned read causes a bus error. + * MurmurHash uses the faster approach only on CPU's where we know it's safe. + * + * Note the preprocessor built-in defines can be emitted using: + * + * gcc -m64 -dM -E - < /dev/null (on gcc) + * cc -## a.c (where a.c is a simple test file) (Sun Studio) + */ +#if (defined(__i386__) || defined(__x86_64__) || defined(_M_IX86)) +#define MUR_GETBLOCK(p,i) p[i] +#else /* non intel */ +#define MUR_PLUS0_ALIGNED(p) (((unsigned long)p & 0x3) == 0) +#define MUR_PLUS1_ALIGNED(p) (((unsigned long)p & 0x3) == 1) +#define MUR_PLUS2_ALIGNED(p) (((unsigned long)p & 0x3) == 2) +#define MUR_PLUS3_ALIGNED(p) (((unsigned long)p & 0x3) == 3) +#define WP(p) ((uint32_t*)((unsigned long)(p) & ~3UL)) +#if (defined(__BIG_ENDIAN__) || defined(SPARC) || defined(__ppc__) || defined(__ppc64__)) +#define MUR_THREE_ONE(p) ((((*WP(p))&0x00ffffff) << 8) | (((*(WP(p)+1))&0xff000000) >> 24)) +#define MUR_TWO_TWO(p) ((((*WP(p))&0x0000ffff) <<16) | (((*(WP(p)+1))&0xffff0000) >> 16)) +#define MUR_ONE_THREE(p) ((((*WP(p))&0x000000ff) <<24) | (((*(WP(p)+1))&0xffffff00) >> 8)) +#else /* assume little endian non-intel */ +#define MUR_THREE_ONE(p) ((((*WP(p))&0xffffff00) >> 8) | (((*(WP(p)+1))&0x000000ff) << 24)) +#define MUR_TWO_TWO(p) ((((*WP(p))&0xffff0000) >>16) | (((*(WP(p)+1))&0x0000ffff) << 16)) +#define MUR_ONE_THREE(p) ((((*WP(p))&0xff000000) >>24) | (((*(WP(p)+1))&0x00ffffff) << 8)) +#endif +#define MUR_GETBLOCK(p,i) (MUR_PLUS0_ALIGNED(p) ? ((p)[i]) : \ + (MUR_PLUS1_ALIGNED(p) ? MUR_THREE_ONE(p) : \ + (MUR_PLUS2_ALIGNED(p) ? MUR_TWO_TWO(p) : \ + MUR_ONE_THREE(p)))) +#endif +#define MUR_ROTL32(x,r) (((x) << (r)) | ((x) >> (32 - (r)))) +#define MUR_FMIX(_h) \ +do { \ + _h ^= _h >> 16; \ + _h *= 0x85ebca6b; \ + _h ^= _h >> 13; \ + _h *= 0xc2b2ae35l; \ + _h ^= _h >> 16; \ +} while(0) + +#define HASH_MUR(key,keylen,num_bkts,hashv,bkt) \ +do { \ + const uint8_t *_mur_data = (const uint8_t*)(key); \ + const int _mur_nblocks = (keylen) / 4; \ + uint32_t _mur_h1 = 0xf88D5353; \ + uint32_t _mur_c1 = 0xcc9e2d51; \ + uint32_t _mur_c2 = 0x1b873593; \ + uint32_t _mur_k1 = 0; \ + const uint8_t *_mur_tail; \ + const uint32_t *_mur_blocks = (const uint32_t*)(_mur_data+_mur_nblocks*4); \ + int _mur_i; \ + for(_mur_i = -_mur_nblocks; _mur_i; _mur_i++) { \ + _mur_k1 = MUR_GETBLOCK(_mur_blocks,_mur_i); \ + _mur_k1 *= _mur_c1; \ + _mur_k1 = MUR_ROTL32(_mur_k1,15); \ + _mur_k1 *= _mur_c2; \ + \ + _mur_h1 ^= _mur_k1; \ + _mur_h1 = MUR_ROTL32(_mur_h1,13); \ + _mur_h1 = _mur_h1*5+0xe6546b64; \ + } \ + _mur_tail = (const uint8_t*)(_mur_data + _mur_nblocks*4); \ + _mur_k1=0; \ + switch((keylen) & 3) { \ + case 3: _mur_k1 ^= _mur_tail[2] << 16; \ + case 2: _mur_k1 ^= _mur_tail[1] << 8; \ + case 1: _mur_k1 ^= _mur_tail[0]; \ + _mur_k1 *= _mur_c1; \ + _mur_k1 = MUR_ROTL32(_mur_k1,15); \ + _mur_k1 *= _mur_c2; \ + _mur_h1 ^= _mur_k1; \ + } \ + _mur_h1 ^= (keylen); \ + MUR_FMIX(_mur_h1); \ + hashv = _mur_h1; \ + bkt = hashv & (num_bkts-1); \ +} while(0) +#endif /* HASH_USING_NO_STRICT_ALIASING */ + +/* key comparison function; return 0 if keys equal */ +#define HASH_KEYCMP(a,b,len) memcmp(a,b,len) + +/* iterate over items in a known bucket to find desired item */ +#define HASH_FIND_IN_BKT(tbl,hh,head,keyptr,keylen_in,out) \ +do { \ + if (head.hh_head) DECLTYPE_ASSIGN(out,ELMT_FROM_HH(tbl,head.hh_head)); \ + else out=NULL; \ + while (out) { \ + if ((out)->hh.keylen == keylen_in) { \ + if ((HASH_KEYCMP((out)->hh.key,keyptr,keylen_in)) == 0) break; \ + } \ + if ((out)->hh.hh_next) DECLTYPE_ASSIGN(out,ELMT_FROM_HH(tbl,(out)->hh.hh_next)); \ + else out = NULL; \ + } \ +} while(0) + +/* add an item to a bucket */ +#define HASH_ADD_TO_BKT(head,addhh) \ +do { \ + head.count++; \ + (addhh)->hh_next = head.hh_head; \ + (addhh)->hh_prev = NULL; \ + if (head.hh_head) { (head).hh_head->hh_prev = (addhh); } \ + (head).hh_head=addhh; \ + if (head.count >= ((head.expand_mult+1) * HASH_BKT_CAPACITY_THRESH) \ + && (addhh)->tbl->noexpand != 1) { \ + HASH_EXPAND_BUCKETS((addhh)->tbl); \ + } \ +} while(0) + +/* remove an item from a given bucket */ +#define HASH_DEL_IN_BKT(hh,head,hh_del) \ + (head).count--; \ + if ((head).hh_head == hh_del) { \ + (head).hh_head = hh_del->hh_next; \ + } \ + if (hh_del->hh_prev) { \ + hh_del->hh_prev->hh_next = hh_del->hh_next; \ + } \ + if (hh_del->hh_next) { \ + hh_del->hh_next->hh_prev = hh_del->hh_prev; \ + } + +/* Bucket expansion has the effect of doubling the number of buckets + * and redistributing the items into the new buckets. Ideally the + * items will distribute more or less evenly into the new buckets + * (the extent to which this is true is a measure of the quality of + * the hash function as it applies to the key domain). + * + * With the items distributed into more buckets, the chain length + * (item count) in each bucket is reduced. Thus by expanding buckets + * the hash keeps a bound on the chain length. This bounded chain + * length is the essence of how a hash provides constant time lookup. + * + * The calculation of tbl->ideal_chain_maxlen below deserves some + * explanation. First, keep in mind that we're calculating the ideal + * maximum chain length based on the *new* (doubled) bucket count. + * In fractions this is just n/b (n=number of items,b=new num buckets). + * Since the ideal chain length is an integer, we want to calculate + * ceil(n/b). We don't depend on floating point arithmetic in this + * hash, so to calculate ceil(n/b) with integers we could write + * + * ceil(n/b) = (n/b) + ((n%b)?1:0) + * + * and in fact a previous version of this hash did just that. + * But now we have improved things a bit by recognizing that b is + * always a power of two. We keep its base 2 log handy (call it lb), + * so now we can write this with a bit shift and logical AND: + * + * ceil(n/b) = (n>>lb) + ( (n & (b-1)) ? 1:0) + * + */ +#define HASH_EXPAND_BUCKETS(tbl) \ +do { \ + unsigned _he_bkt; \ + unsigned _he_bkt_i; \ + struct UT_hash_handle *_he_thh, *_he_hh_nxt; \ + UT_hash_bucket *_he_new_buckets, *_he_newbkt; \ + _he_new_buckets = (UT_hash_bucket*)uthash_malloc( \ + 2 * tbl->num_buckets * sizeof(struct UT_hash_bucket)); \ + if (!_he_new_buckets) { uthash_fatal( "out of memory"); } \ + memset(_he_new_buckets, 0, \ + 2 * tbl->num_buckets * sizeof(struct UT_hash_bucket)); \ + tbl->ideal_chain_maxlen = \ + (tbl->num_items >> (tbl->log2_num_buckets+1)) + \ + ((tbl->num_items & ((tbl->num_buckets*2)-1)) ? 1 : 0); \ + tbl->nonideal_items = 0; \ + for(_he_bkt_i = 0; _he_bkt_i < tbl->num_buckets; _he_bkt_i++) \ + { \ + _he_thh = tbl->buckets[ _he_bkt_i ].hh_head; \ + while (_he_thh) { \ + _he_hh_nxt = _he_thh->hh_next; \ + HASH_TO_BKT( _he_thh->hashv, tbl->num_buckets*2, _he_bkt); \ + _he_newbkt = &(_he_new_buckets[ _he_bkt ]); \ + if (++(_he_newbkt->count) > tbl->ideal_chain_maxlen) { \ + tbl->nonideal_items++; \ + _he_newbkt->expand_mult = _he_newbkt->count / \ + tbl->ideal_chain_maxlen; \ + } \ + _he_thh->hh_prev = NULL; \ + _he_thh->hh_next = _he_newbkt->hh_head; \ + if (_he_newbkt->hh_head) _he_newbkt->hh_head->hh_prev = \ + _he_thh; \ + _he_newbkt->hh_head = _he_thh; \ + _he_thh = _he_hh_nxt; \ + } \ + } \ + uthash_free( tbl->buckets, tbl->num_buckets*sizeof(struct UT_hash_bucket) ); \ + tbl->num_buckets *= 2; \ + tbl->log2_num_buckets++; \ + tbl->buckets = _he_new_buckets; \ + tbl->ineff_expands = (tbl->nonideal_items > (tbl->num_items >> 1)) ? \ + (tbl->ineff_expands+1) : 0; \ + if (tbl->ineff_expands > 1) { \ + tbl->noexpand=1; \ + uthash_noexpand_fyi(tbl); \ + } \ + uthash_expand_fyi(tbl); \ +} while(0) + + +/* This is an adaptation of Simon Tatham's O(n log(n)) mergesort */ +/* Note that HASH_SORT assumes the hash handle name to be hh. + * HASH_SRT was added to allow the hash handle name to be passed in. */ +#define HASH_SORT(head,cmpfcn) HASH_SRT(hh,head,cmpfcn) +#define HASH_SRT(hh,head,cmpfcn) \ +do { \ + unsigned _hs_i; \ + unsigned _hs_looping,_hs_nmerges,_hs_insize,_hs_psize,_hs_qsize; \ + struct UT_hash_handle *_hs_p, *_hs_q, *_hs_e, *_hs_list, *_hs_tail; \ + if (head) { \ + _hs_insize = 1; \ + _hs_looping = 1; \ + _hs_list = &((head)->hh); \ + while (_hs_looping) { \ + _hs_p = _hs_list; \ + _hs_list = NULL; \ + _hs_tail = NULL; \ + _hs_nmerges = 0; \ + while (_hs_p) { \ + _hs_nmerges++; \ + _hs_q = _hs_p; \ + _hs_psize = 0; \ + for ( _hs_i = 0; _hs_i < _hs_insize; _hs_i++ ) { \ + _hs_psize++; \ + _hs_q = (UT_hash_handle*)((_hs_q->next) ? \ + ((void*)((char*)(_hs_q->next) + \ + (head)->hh.tbl->hho)) : NULL); \ + if (! (_hs_q) ) break; \ + } \ + _hs_qsize = _hs_insize; \ + while ((_hs_psize > 0) || ((_hs_qsize > 0) && _hs_q )) { \ + if (_hs_psize == 0) { \ + _hs_e = _hs_q; \ + _hs_q = (UT_hash_handle*)((_hs_q->next) ? \ + ((void*)((char*)(_hs_q->next) + \ + (head)->hh.tbl->hho)) : NULL); \ + _hs_qsize--; \ + } else if ( (_hs_qsize == 0) || !(_hs_q) ) { \ + _hs_e = _hs_p; \ + _hs_p = (UT_hash_handle*)((_hs_p->next) ? \ + ((void*)((char*)(_hs_p->next) + \ + (head)->hh.tbl->hho)) : NULL); \ + _hs_psize--; \ + } else if (( \ + cmpfcn(DECLTYPE(head)(ELMT_FROM_HH((head)->hh.tbl,_hs_p)), \ + DECLTYPE(head)(ELMT_FROM_HH((head)->hh.tbl,_hs_q))) \ + ) <= 0) { \ + _hs_e = _hs_p; \ + _hs_p = (UT_hash_handle*)((_hs_p->next) ? \ + ((void*)((char*)(_hs_p->next) + \ + (head)->hh.tbl->hho)) : NULL); \ + _hs_psize--; \ + } else { \ + _hs_e = _hs_q; \ + _hs_q = (UT_hash_handle*)((_hs_q->next) ? \ + ((void*)((char*)(_hs_q->next) + \ + (head)->hh.tbl->hho)) : NULL); \ + _hs_qsize--; \ + } \ + if ( _hs_tail ) { \ + _hs_tail->next = ((_hs_e) ? \ + ELMT_FROM_HH((head)->hh.tbl,_hs_e) : NULL); \ + } else { \ + _hs_list = _hs_e; \ + } \ + _hs_e->prev = ((_hs_tail) ? \ + ELMT_FROM_HH((head)->hh.tbl,_hs_tail) : NULL); \ + _hs_tail = _hs_e; \ + } \ + _hs_p = _hs_q; \ + } \ + _hs_tail->next = NULL; \ + if ( _hs_nmerges <= 1 ) { \ + _hs_looping=0; \ + (head)->hh.tbl->tail = _hs_tail; \ + DECLTYPE_ASSIGN(head,ELMT_FROM_HH((head)->hh.tbl, _hs_list)); \ + } \ + _hs_insize *= 2; \ + } \ + HASH_FSCK(hh,head); \ + } \ +} while (0) + +/* This function selects items from one hash into another hash. + * The end result is that the selected items have dual presence + * in both hashes. There is no copy of the items made; rather + * they are added into the new hash through a secondary hash + * hash handle that must be present in the structure. */ +#define HASH_SELECT(hh_dst, dst, hh_src, src, cond) \ +do { \ + unsigned _src_bkt, _dst_bkt; \ + void *_last_elt=NULL, *_elt; \ + UT_hash_handle *_src_hh, *_dst_hh, *_last_elt_hh=NULL; \ + ptrdiff_t _dst_hho = ((char*)(&(dst)->hh_dst) - (char*)(dst)); \ + if (src) { \ + for(_src_bkt=0; _src_bkt < (src)->hh_src.tbl->num_buckets; _src_bkt++) { \ + for(_src_hh = (src)->hh_src.tbl->buckets[_src_bkt].hh_head; \ + _src_hh; \ + _src_hh = _src_hh->hh_next) { \ + _elt = ELMT_FROM_HH((src)->hh_src.tbl, _src_hh); \ + if (cond(_elt)) { \ + _dst_hh = (UT_hash_handle*)(((char*)_elt) + _dst_hho); \ + _dst_hh->key = _src_hh->key; \ + _dst_hh->keylen = _src_hh->keylen; \ + _dst_hh->hashv = _src_hh->hashv; \ + _dst_hh->prev = _last_elt; \ + _dst_hh->next = NULL; \ + if (_last_elt_hh) { _last_elt_hh->next = _elt; } \ + if (!dst) { \ + DECLTYPE_ASSIGN(dst,_elt); \ + HASH_MAKE_TABLE(hh_dst,dst); \ + } else { \ + _dst_hh->tbl = (dst)->hh_dst.tbl; \ + } \ + HASH_TO_BKT(_dst_hh->hashv, _dst_hh->tbl->num_buckets, _dst_bkt); \ + HASH_ADD_TO_BKT(_dst_hh->tbl->buckets[_dst_bkt],_dst_hh); \ + (dst)->hh_dst.tbl->num_items++; \ + _last_elt = _elt; \ + _last_elt_hh = _dst_hh; \ + } \ + } \ + } \ + } \ + HASH_FSCK(hh_dst,dst); \ +} while (0) + +#define HASH_CLEAR(hh,head) \ +do { \ + if (head) { \ + uthash_free((head)->hh.tbl->buckets, \ + (head)->hh.tbl->num_buckets*sizeof(struct UT_hash_bucket)); \ + HASH_BLOOM_FREE((head)->hh.tbl); \ + uthash_free((head)->hh.tbl, sizeof(UT_hash_table)); \ + (head)=NULL; \ + } \ +} while(0) + +#ifdef NO_DECLTYPE +#define HASH_ITER(hh,head,el,tmp) \ +for((el)=(head), (*(char**)(&(tmp)))=(char*)((head)?(head)->hh.next:NULL); \ + el; (el)=(tmp),(*(char**)(&(tmp)))=(char*)((tmp)?(tmp)->hh.next:NULL)) +#else +#define HASH_ITER(hh,head,el,tmp) \ +for((el)=(head),(tmp)=DECLTYPE(el)((head)?(head)->hh.next:NULL); \ + el; (el)=(tmp),(tmp)=DECLTYPE(el)((tmp)?(tmp)->hh.next:NULL)) +#endif + +/* obtain a count of items in the hash */ +#define HASH_COUNT(head) HASH_CNT(hh,head) +#define HASH_CNT(hh,head) ((head)?((head)->hh.tbl->num_items):0) + +typedef struct UT_hash_bucket { + struct UT_hash_handle *hh_head; + unsigned count; + + /* expand_mult is normally set to 0. In this situation, the max chain length + * threshold is enforced at its default value, HASH_BKT_CAPACITY_THRESH. (If + * the bucket's chain exceeds this length, bucket expansion is triggered). + * However, setting expand_mult to a non-zero value delays bucket expansion + * (that would be triggered by additions to this particular bucket) + * until its chain length reaches a *multiple* of HASH_BKT_CAPACITY_THRESH. + * (The multiplier is simply expand_mult+1). The whole idea of this + * multiplier is to reduce bucket expansions, since they are expensive, in + * situations where we know that a particular bucket tends to be overused. + * It is better to let its chain length grow to a longer yet-still-bounded + * value, than to do an O(n) bucket expansion too often. + */ + unsigned expand_mult; + +} UT_hash_bucket; + +/* random signature used only to find hash tables in external analysis */ +#define HASH_SIGNATURE 0xa0111fe1 +#define HASH_BLOOM_SIGNATURE 0xb12220f2 + +typedef struct UT_hash_table { + UT_hash_bucket *buckets; + unsigned num_buckets, log2_num_buckets; + unsigned num_items; + struct UT_hash_handle *tail; /* tail hh in app order, for fast append */ + ptrdiff_t hho; /* hash handle offset (byte pos of hash handle in element */ + + /* in an ideal situation (all buckets used equally), no bucket would have + * more than ceil(#items/#buckets) items. that's the ideal chain length. */ + unsigned ideal_chain_maxlen; + + /* nonideal_items is the number of items in the hash whose chain position + * exceeds the ideal chain maxlen. these items pay the penalty for an uneven + * hash distribution; reaching them in a chain traversal takes >ideal steps */ + unsigned nonideal_items; + + /* ineffective expands occur when a bucket doubling was performed, but + * afterward, more than half the items in the hash had nonideal chain + * positions. If this happens on two consecutive expansions we inhibit any + * further expansion, as it's not helping; this happens when the hash + * function isn't a good fit for the key domain. When expansion is inhibited + * the hash will still work, albeit no longer in constant time. */ + unsigned ineff_expands, noexpand; + + uint32_t signature; /* used only to find hash tables in external analysis */ +#ifdef HASH_BLOOM + uint32_t bloom_sig; /* used only to test bloom exists in external analysis */ + uint8_t *bloom_bv; + char bloom_nbits; +#endif + +} UT_hash_table; + +typedef struct UT_hash_handle { + struct UT_hash_table *tbl; + void *prev; /* prev element in app order */ + void *next; /* next element in app order */ + struct UT_hash_handle *hh_prev; /* previous hh in bucket order */ + struct UT_hash_handle *hh_next; /* next hh in bucket order */ + void *key; /* ptr to enclosing struct's key */ + unsigned keylen; /* enclosing struct's key len */ + unsigned hashv; /* result of hash-fcn(key) */ +} UT_hash_handle; + +#endif /* UTHASH_H */ diff --git a/cocos2d/Support/utlist.h b/cocos2d/Support/utlist.h new file mode 100644 index 0000000..58bfcbc --- /dev/null +++ b/cocos2d/Support/utlist.h @@ -0,0 +1,733 @@ +/* +Copyright (c) 2007-2013, Troy D. Hanson http://uthash.sourceforge.net +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS +IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER +OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#ifndef UTLIST_H +#define UTLIST_H + +#define UTLIST_VERSION 1.9.7 + +#include + +/* + * This file contains macros to manipulate singly and doubly-linked lists. + * + * 1. LL_ macros: singly-linked lists. + * 2. DL_ macros: doubly-linked lists. + * 3. CDL_ macros: circular doubly-linked lists. + * + * To use singly-linked lists, your structure must have a "next" pointer. + * To use doubly-linked lists, your structure must "prev" and "next" pointers. + * Either way, the pointer to the head of the list must be initialized to NULL. + * + * ----------------.EXAMPLE ------------------------- + * struct item { + * int id; + * struct item *prev, *next; + * } + * + * struct item *list = NULL: + * + * int main() { + * struct item *item; + * ... allocate and populate item ... + * DL_APPEND(list, item); + * } + * -------------------------------------------------- + * + * For doubly-linked lists, the append and delete macros are O(1) + * For singly-linked lists, append and delete are O(n) but prepend is O(1) + * The sort macro is O(n log(n)) for all types of single/double/circular lists. + */ + +/* These macros use decltype or the earlier __typeof GNU extension. + As decltype is only available in newer compilers (VS2010 or gcc 4.3+ + when compiling c++ code), this code uses whatever method is needed + or, for VS2008 where neither is available, uses casting workarounds. */ +#ifdef _MSC_VER /* MS compiler */ +#if _MSC_VER >= 1600 && defined(__cplusplus) /* VS2010 or newer in C++ mode */ +#define LDECLTYPE(x) decltype(x) +#else /* VS2008 or older (or VS2010 in C mode) */ +#define NO_DECLTYPE +#define LDECLTYPE(x) char* +#endif +#else /* GNU, Sun and other compilers */ +#define LDECLTYPE(x) __typeof(x) +#endif + +/* for VS2008 we use some workarounds to get around the lack of decltype, + * namely, we always reassign our tmp variable to the list head if we need + * to dereference its prev/next pointers, and save/restore the real head.*/ +#ifdef NO_DECLTYPE +#define _SV(elt,list) _tmp = (char*)(list); {char **_alias = (char**)&(list); *_alias = (elt); } +#define _NEXT(elt,list,next) ((char*)((list)->next)) +#define _NEXTASGN(elt,list,to,next) { char **_alias = (char**)&((list)->next); *_alias=(char*)(to); } +/* #define _PREV(elt,list,prev) ((char*)((list)->prev)) */ +#define _PREVASGN(elt,list,to,prev) { char **_alias = (char**)&((list)->prev); *_alias=(char*)(to); } +#define _RS(list) { char **_alias = (char**)&(list); *_alias=_tmp; } +#define _CASTASGN(a,b) { char **_alias = (char**)&(a); *_alias=(char*)(b); } +#else +#define _SV(elt,list) +#define _NEXT(elt,list,next) ((elt)->next) +#define _NEXTASGN(elt,list,to,next) ((elt)->next)=(to) +/* #define _PREV(elt,list,prev) ((elt)->prev) */ +#define _PREVASGN(elt,list,to,prev) ((elt)->prev)=(to) +#define _RS(list) +#define _CASTASGN(a,b) (a)=(b) +#endif + +/****************************************************************************** + * The sort macro is an adaptation of Simon Tatham's O(n log(n)) mergesort * + * Unwieldy variable names used here to avoid shadowing passed-in variables. * + *****************************************************************************/ +#define LL_SORT(list, cmp) \ + LL_SORT2(list, cmp, next) + +#define LL_SORT2(list, cmp, next) \ +do { \ + LDECLTYPE(list) _ls_p; \ + LDECLTYPE(list) _ls_q; \ + LDECLTYPE(list) _ls_e; \ + LDECLTYPE(list) _ls_tail; \ + LDECLTYPE(list) _ls_oldhead; \ + LDECLTYPE(list) _tmp; \ + int _ls_insize, _ls_nmerges, _ls_psize, _ls_qsize, _ls_i, _ls_looping; \ + if (list) { \ + _ls_insize = 1; \ + _ls_looping = 1; \ + while (_ls_looping) { \ + _CASTASGN(_ls_p,list); \ + _CASTASGN(_ls_oldhead,list); \ + list = NULL; \ + _ls_tail = NULL; \ + _ls_nmerges = 0; \ + while (_ls_p) { \ + _ls_nmerges++; \ + _ls_q = _ls_p; \ + _ls_psize = 0; \ + for (_ls_i = 0; _ls_i < _ls_insize; _ls_i++) { \ + _ls_psize++; \ + _SV(_ls_q,list); _ls_q = _NEXT(_ls_q,list,next); _RS(list); \ + if (!_ls_q) break; \ + } \ + _ls_qsize = _ls_insize; \ + while (_ls_psize > 0 || (_ls_qsize > 0 && _ls_q)) { \ + if (_ls_psize == 0) { \ + _ls_e = _ls_q; _SV(_ls_q,list); _ls_q = \ + _NEXT(_ls_q,list,next); _RS(list); _ls_qsize--; \ + } else if (_ls_qsize == 0 || !_ls_q) { \ + _ls_e = _ls_p; _SV(_ls_p,list); _ls_p = \ + _NEXT(_ls_p,list,next); _RS(list); _ls_psize--; \ + } else if (cmp(_ls_p,_ls_q) <= 0) { \ + _ls_e = _ls_p; _SV(_ls_p,list); _ls_p = \ + _NEXT(_ls_p,list,next); _RS(list); _ls_psize--; \ + } else { \ + _ls_e = _ls_q; _SV(_ls_q,list); _ls_q = \ + _NEXT(_ls_q,list,next); _RS(list); _ls_qsize--; \ + } \ + if (_ls_tail) { \ + _SV(_ls_tail,list); _NEXTASGN(_ls_tail,list,_ls_e,next); _RS(list); \ + } else { \ + _CASTASGN(list,_ls_e); \ + } \ + _ls_tail = _ls_e; \ + } \ + _ls_p = _ls_q; \ + } \ + _SV(_ls_tail,list); _NEXTASGN(_ls_tail,list,NULL,next); _RS(list); \ + if (_ls_nmerges <= 1) { \ + _ls_looping=0; \ + } \ + _ls_insize *= 2; \ + } \ + } else _tmp=NULL; /* quiet gcc unused variable warning */ \ +} while (0) + + +#define DL_SORT(list, cmp) \ + DL_SORT2(list, cmp, prev, next) + +#define DL_SORT2(list, cmp, prev, next) \ +do { \ + LDECLTYPE(list) _ls_p; \ + LDECLTYPE(list) _ls_q; \ + LDECLTYPE(list) _ls_e; \ + LDECLTYPE(list) _ls_tail; \ + LDECLTYPE(list) _ls_oldhead; \ + LDECLTYPE(list) _tmp; \ + int _ls_insize, _ls_nmerges, _ls_psize, _ls_qsize, _ls_i, _ls_looping; \ + if (list) { \ + _ls_insize = 1; \ + _ls_looping = 1; \ + while (_ls_looping) { \ + _CASTASGN(_ls_p,list); \ + _CASTASGN(_ls_oldhead,list); \ + list = NULL; \ + _ls_tail = NULL; \ + _ls_nmerges = 0; \ + while (_ls_p) { \ + _ls_nmerges++; \ + _ls_q = _ls_p; \ + _ls_psize = 0; \ + for (_ls_i = 0; _ls_i < _ls_insize; _ls_i++) { \ + _ls_psize++; \ + _SV(_ls_q,list); _ls_q = _NEXT(_ls_q,list,next); _RS(list); \ + if (!_ls_q) break; \ + } \ + _ls_qsize = _ls_insize; \ + while (_ls_psize > 0 || (_ls_qsize > 0 && _ls_q)) { \ + if (_ls_psize == 0) { \ + _ls_e = _ls_q; _SV(_ls_q,list); _ls_q = \ + _NEXT(_ls_q,list,next); _RS(list); _ls_qsize--; \ + } else if (_ls_qsize == 0 || !_ls_q) { \ + _ls_e = _ls_p; _SV(_ls_p,list); _ls_p = \ + _NEXT(_ls_p,list,next); _RS(list); _ls_psize--; \ + } else if (cmp(_ls_p,_ls_q) <= 0) { \ + _ls_e = _ls_p; _SV(_ls_p,list); _ls_p = \ + _NEXT(_ls_p,list,next); _RS(list); _ls_psize--; \ + } else { \ + _ls_e = _ls_q; _SV(_ls_q,list); _ls_q = \ + _NEXT(_ls_q,list,next); _RS(list); _ls_qsize--; \ + } \ + if (_ls_tail) { \ + _SV(_ls_tail,list); _NEXTASGN(_ls_tail,list,_ls_e,next); _RS(list); \ + } else { \ + _CASTASGN(list,_ls_e); \ + } \ + _SV(_ls_e,list); _PREVASGN(_ls_e,list,_ls_tail,prev); _RS(list); \ + _ls_tail = _ls_e; \ + } \ + _ls_p = _ls_q; \ + } \ + _CASTASGN(list->prev, _ls_tail); \ + _SV(_ls_tail,list); _NEXTASGN(_ls_tail,list,NULL,next); _RS(list); \ + if (_ls_nmerges <= 1) { \ + _ls_looping=0; \ + } \ + _ls_insize *= 2; \ + } \ + } else _tmp=NULL; /* quiet gcc unused variable warning */ \ +} while (0) + +#define CDL_SORT(list, cmp) \ + CDL_SORT2(list, cmp, prev, next) + +#define CDL_SORT2(list, cmp, prev, next) \ +do { \ + LDECLTYPE(list) _ls_p; \ + LDECLTYPE(list) _ls_q; \ + LDECLTYPE(list) _ls_e; \ + LDECLTYPE(list) _ls_tail; \ + LDECLTYPE(list) _ls_oldhead; \ + LDECLTYPE(list) _tmp; \ + LDECLTYPE(list) _tmp2; \ + int _ls_insize, _ls_nmerges, _ls_psize, _ls_qsize, _ls_i, _ls_looping; \ + if (list) { \ + _ls_insize = 1; \ + _ls_looping = 1; \ + while (_ls_looping) { \ + _CASTASGN(_ls_p,list); \ + _CASTASGN(_ls_oldhead,list); \ + list = NULL; \ + _ls_tail = NULL; \ + _ls_nmerges = 0; \ + while (_ls_p) { \ + _ls_nmerges++; \ + _ls_q = _ls_p; \ + _ls_psize = 0; \ + for (_ls_i = 0; _ls_i < _ls_insize; _ls_i++) { \ + _ls_psize++; \ + _SV(_ls_q,list); \ + if (_NEXT(_ls_q,list,next) == _ls_oldhead) { \ + _ls_q = NULL; \ + } else { \ + _ls_q = _NEXT(_ls_q,list,next); \ + } \ + _RS(list); \ + if (!_ls_q) break; \ + } \ + _ls_qsize = _ls_insize; \ + while (_ls_psize > 0 || (_ls_qsize > 0 && _ls_q)) { \ + if (_ls_psize == 0) { \ + _ls_e = _ls_q; _SV(_ls_q,list); _ls_q = \ + _NEXT(_ls_q,list,next); _RS(list); _ls_qsize--; \ + if (_ls_q == _ls_oldhead) { _ls_q = NULL; } \ + } else if (_ls_qsize == 0 || !_ls_q) { \ + _ls_e = _ls_p; _SV(_ls_p,list); _ls_p = \ + _NEXT(_ls_p,list,next); _RS(list); _ls_psize--; \ + if (_ls_p == _ls_oldhead) { _ls_p = NULL; } \ + } else if (cmp(_ls_p,_ls_q) <= 0) { \ + _ls_e = _ls_p; _SV(_ls_p,list); _ls_p = \ + _NEXT(_ls_p,list,next); _RS(list); _ls_psize--; \ + if (_ls_p == _ls_oldhead) { _ls_p = NULL; } \ + } else { \ + _ls_e = _ls_q; _SV(_ls_q,list); _ls_q = \ + _NEXT(_ls_q,list,next); _RS(list); _ls_qsize--; \ + if (_ls_q == _ls_oldhead) { _ls_q = NULL; } \ + } \ + if (_ls_tail) { \ + _SV(_ls_tail,list); _NEXTASGN(_ls_tail,list,_ls_e,next); _RS(list); \ + } else { \ + _CASTASGN(list,_ls_e); \ + } \ + _SV(_ls_e,list); _PREVASGN(_ls_e,list,_ls_tail,prev); _RS(list); \ + _ls_tail = _ls_e; \ + } \ + _ls_p = _ls_q; \ + } \ + _CASTASGN(list->prev,_ls_tail); \ + _CASTASGN(_tmp2,list); \ + _SV(_ls_tail,list); _NEXTASGN(_ls_tail,list,_tmp2,next); _RS(list); \ + if (_ls_nmerges <= 1) { \ + _ls_looping=0; \ + } \ + _ls_insize *= 2; \ + } \ + } else _tmp=NULL; /* quiet gcc unused variable warning */ \ +} while (0) + +/****************************************************************************** + * singly linked list macros (non-circular) * + *****************************************************************************/ +#define LL_PREPEND(head,add) \ + LL_PREPEND2(head,add,next) + +#define LL_PREPEND2(head,add,next) \ +do { \ + (add)->next = head; \ + head = add; \ +} while (0) + +#define LL_CONCAT(head1,head2) \ + LL_CONCAT2(head1,head2,next) + +#define LL_CONCAT2(head1,head2,next) \ +do { \ + LDECLTYPE(head1) _tmp; \ + if (head1) { \ + _tmp = head1; \ + while (_tmp->next) { _tmp = _tmp->next; } \ + _tmp->next=(head2); \ + } else { \ + (head1)=(head2); \ + } \ +} while (0) + +#define LL_APPEND(head,add) \ + LL_APPEND2(head,add,next) + +#define LL_APPEND2(head,add,next) \ +do { \ + LDECLTYPE(head) _tmp; \ + (add)->next=NULL; \ + if (head) { \ + _tmp = head; \ + while (_tmp->next) { _tmp = _tmp->next; } \ + _tmp->next=(add); \ + } else { \ + (head)=(add); \ + } \ +} while (0) + +#define LL_DELETE(head,del) \ + LL_DELETE2(head,del,next) + +#define LL_DELETE2(head,del,next) \ +do { \ + LDECLTYPE(head) _tmp; \ + if ((head) == (del)) { \ + (head)=(head)->next; \ + } else { \ + _tmp = head; \ + while (_tmp->next && (_tmp->next != (del))) { \ + _tmp = _tmp->next; \ + } \ + if (_tmp->next) { \ + _tmp->next = ((del)->next); \ + } \ + } \ +} while (0) + +/* Here are VS2008 replacements for LL_APPEND and LL_DELETE */ +#define LL_APPEND_VS2008(head,add) \ + LL_APPEND2_VS2008(head,add,next) + +#define LL_APPEND2_VS2008(head,add,next) \ +do { \ + if (head) { \ + (add)->next = head; /* use add->next as a temp variable */ \ + while ((add)->next->next) { (add)->next = (add)->next->next; } \ + (add)->next->next=(add); \ + } else { \ + (head)=(add); \ + } \ + (add)->next=NULL; \ +} while (0) + +#define LL_DELETE_VS2008(head,del) \ + LL_DELETE2_VS2008(head,del,next) + +#define LL_DELETE2_VS2008(head,del,next) \ +do { \ + if ((head) == (del)) { \ + (head)=(head)->next; \ + } else { \ + char *_tmp = (char*)(head); \ + while ((head)->next && ((head)->next != (del))) { \ + head = (head)->next; \ + } \ + if ((head)->next) { \ + (head)->next = ((del)->next); \ + } \ + { \ + char **_head_alias = (char**)&(head); \ + *_head_alias = _tmp; \ + } \ + } \ +} while (0) +#ifdef NO_DECLTYPE +#undef LL_APPEND +#define LL_APPEND LL_APPEND_VS2008 +#undef LL_DELETE +#define LL_DELETE LL_DELETE_VS2008 +#undef LL_DELETE2 +#define LL_DELETE2_VS2008 +#undef LL_APPEND2 +#define LL_APPEND2 LL_APPEND2_VS2008 +#undef LL_CONCAT /* no LL_CONCAT_VS2008 */ +#undef DL_CONCAT /* no DL_CONCAT_VS2008 */ +#endif +/* end VS2008 replacements */ + +#define LL_FOREACH(head,el) \ + LL_FOREACH2(head,el,next) + +#define LL_FOREACH2(head,el,next) \ + for(el=head;el;el=(el)->next) + +#define LL_FOREACH_SAFE(head,el,tmp) \ + LL_FOREACH_SAFE2(head,el,tmp,next) + +#define LL_FOREACH_SAFE2(head,el,tmp,next) \ + for((el)=(head);(el) && (tmp = (el)->next, 1); (el) = tmp) + +#define LL_SEARCH_SCALAR(head,out,field,val) \ + LL_SEARCH_SCALAR2(head,out,field,val,next) + +#define LL_SEARCH_SCALAR2(head,out,field,val,next) \ +do { \ + LL_FOREACH2(head,out,next) { \ + if ((out)->field == (val)) break; \ + } \ +} while(0) + +#define LL_SEARCH(head,out,elt,cmp) \ + LL_SEARCH2(head,out,elt,cmp,next) + +#define LL_SEARCH2(head,out,elt,cmp,next) \ +do { \ + LL_FOREACH2(head,out,next) { \ + if ((cmp(out,elt))==0) break; \ + } \ +} while(0) + +#define LL_REPLACE_ELEM(head, el, add) \ +do { \ + LDECLTYPE(head) _tmp; \ + assert(head != NULL); \ + assert(el != NULL); \ + assert(add != NULL); \ + (add)->next = (el)->next; \ + if ((head) == (el)) { \ + (head) = (add); \ + } else { \ + _tmp = head; \ + while (_tmp->next && (_tmp->next != (el))) { \ + _tmp = _tmp->next; \ + } \ + if (_tmp->next) { \ + _tmp->next = (add); \ + } \ + } \ +} while (0) + +#define LL_PREPEND_ELEM(head, el, add) \ +do { \ + LDECLTYPE(head) _tmp; \ + assert(head != NULL); \ + assert(el != NULL); \ + assert(add != NULL); \ + (add)->next = (el); \ + if ((head) == (el)) { \ + (head) = (add); \ + } else { \ + _tmp = head; \ + while (_tmp->next && (_tmp->next != (el))) { \ + _tmp = _tmp->next; \ + } \ + if (_tmp->next) { \ + _tmp->next = (add); \ + } \ + } \ +} while (0) \ + + +/****************************************************************************** + * doubly linked list macros (non-circular) * + *****************************************************************************/ +#define DL_PREPEND(head,add) \ + DL_PREPEND2(head,add,prev,next) + +#define DL_PREPEND2(head,add,prev,next) \ +do { \ + (add)->next = head; \ + if (head) { \ + (add)->prev = (head)->prev; \ + (head)->prev = (add); \ + } else { \ + (add)->prev = (add); \ + } \ + (head) = (add); \ +} while (0) + +#define DL_APPEND(head,add) \ + DL_APPEND2(head,add,prev,next) + +#define DL_APPEND2(head,add,prev,next) \ +do { \ + if (head) { \ + (add)->prev = (head)->prev; \ + (head)->prev->next = (add); \ + (head)->prev = (add); \ + (add)->next = NULL; \ + } else { \ + (head)=(add); \ + (head)->prev = (head); \ + (head)->next = NULL; \ + } \ +} while (0) + +#define DL_CONCAT(head1,head2) \ + DL_CONCAT2(head1,head2,prev,next) + +#define DL_CONCAT2(head1,head2,prev,next) \ +do { \ + LDECLTYPE(head1) _tmp; \ + if (head2) { \ + if (head1) { \ + _tmp = (head2)->prev; \ + (head2)->prev = (head1)->prev; \ + (head1)->prev->next = (head2); \ + (head1)->prev = _tmp; \ + } else { \ + (head1)=(head2); \ + } \ + } \ +} while (0) + +#define DL_DELETE(head,del) \ + DL_DELETE2(head,del,prev,next) + +#define DL_DELETE2(head,del,prev,next) \ +do { \ + assert((del)->prev != NULL); \ + if ((del)->prev == (del)) { \ + (head)=NULL; \ + } else if ((del)==(head)) { \ + (del)->next->prev = (del)->prev; \ + (head) = (del)->next; \ + } else { \ + (del)->prev->next = (del)->next; \ + if ((del)->next) { \ + (del)->next->prev = (del)->prev; \ + } else { \ + (head)->prev = (del)->prev; \ + } \ + } \ +} while (0) + + +#define DL_FOREACH(head,el) \ + DL_FOREACH2(head,el,next) + +#define DL_FOREACH2(head,el,next) \ + for(el=head;el;el=(el)->next) + +/* this version is safe for deleting the elements during iteration */ +#define DL_FOREACH_SAFE(head,el,tmp) \ + DL_FOREACH_SAFE2(head,el,tmp,next) + +#define DL_FOREACH_SAFE2(head,el,tmp,next) \ + for((el)=(head);(el) && (tmp = (el)->next, 1); (el) = tmp) + +/* these are identical to their singly-linked list counterparts */ +#define DL_SEARCH_SCALAR LL_SEARCH_SCALAR +#define DL_SEARCH LL_SEARCH +#define DL_SEARCH_SCALAR2 LL_SEARCH_SCALAR2 +#define DL_SEARCH2 LL_SEARCH2 + +#define DL_REPLACE_ELEM(head, el, add) \ +do { \ + assert(head != NULL); \ + assert(el != NULL); \ + assert(add != NULL); \ + if ((head) == (el)) { \ + (head) = (add); \ + (add)->next = (el)->next; \ + if ((el)->next == NULL) { \ + (add)->prev = (add); \ + } else { \ + (add)->prev = (el)->prev; \ + (add)->next->prev = (add); \ + } \ + } else { \ + (add)->next = (el)->next; \ + (add)->prev = (el)->prev; \ + (add)->prev->next = (add); \ + if ((el)->next == NULL) { \ + (head)->prev = (add); \ + } else { \ + (add)->next->prev = (add); \ + } \ + } \ +} while (0) + +#define DL_PREPEND_ELEM(head, el, add) \ +do { \ + assert(head != NULL); \ + assert(el != NULL); \ + assert(add != NULL); \ + (add)->next = (el); \ + (add)->prev = (el)->prev; \ + (el)->prev = (add); \ + if ((head) == (el)) { \ + (head) = (add); \ + } else { \ + (add)->prev->next = (add); \ + } \ +} while (0) \ + + +/****************************************************************************** + * circular doubly linked list macros * + *****************************************************************************/ +#define CDL_PREPEND(head,add) \ + CDL_PREPEND2(head,add,prev,next) + +#define CDL_PREPEND2(head,add,prev,next) \ +do { \ + if (head) { \ + (add)->prev = (head)->prev; \ + (add)->next = (head); \ + (head)->prev = (add); \ + (add)->prev->next = (add); \ + } else { \ + (add)->prev = (add); \ + (add)->next = (add); \ + } \ +(head)=(add); \ +} while (0) + +#define CDL_DELETE(head,del) \ + CDL_DELETE2(head,del,prev,next) + +#define CDL_DELETE2(head,del,prev,next) \ +do { \ + if ( ((head)==(del)) && ((head)->next == (head))) { \ + (head) = 0L; \ + } else { \ + (del)->next->prev = (del)->prev; \ + (del)->prev->next = (del)->next; \ + if ((del) == (head)) (head)=(del)->next; \ + } \ +} while (0) + +#define CDL_FOREACH(head,el) \ + CDL_FOREACH2(head,el,next) + +#define CDL_FOREACH2(head,el,next) \ + for(el=head;el;el=((el)->next==head ? 0L : (el)->next)) + +#define CDL_FOREACH_SAFE(head,el,tmp1,tmp2) \ + CDL_FOREACH_SAFE2(head,el,tmp1,tmp2,prev,next) + +#define CDL_FOREACH_SAFE2(head,el,tmp1,tmp2,prev,next) \ + for((el)=(head), ((tmp1)=(head)?((head)->prev):NULL); \ + (el) && ((tmp2)=(el)->next, 1); \ + ((el) = (((el)==(tmp1)) ? 0L : (tmp2)))) + +#define CDL_SEARCH_SCALAR(head,out,field,val) \ + CDL_SEARCH_SCALAR2(head,out,field,val,next) + +#define CDL_SEARCH_SCALAR2(head,out,field,val,next) \ +do { \ + CDL_FOREACH2(head,out,next) { \ + if ((out)->field == (val)) break; \ + } \ +} while(0) + +#define CDL_SEARCH(head,out,elt,cmp) \ + CDL_SEARCH2(head,out,elt,cmp,next) + +#define CDL_SEARCH2(head,out,elt,cmp,next) \ +do { \ + CDL_FOREACH2(head,out,next) { \ + if ((cmp(out,elt))==0) break; \ + } \ +} while(0) + +#define CDL_REPLACE_ELEM(head, el, add) \ +do { \ + assert(head != NULL); \ + assert(el != NULL); \ + assert(add != NULL); \ + if ((el)->next == (el)) { \ + (add)->next = (add); \ + (add)->prev = (add); \ + (head) = (add); \ + } else { \ + (add)->next = (el)->next; \ + (add)->prev = (el)->prev; \ + (add)->next->prev = (add); \ + (add)->prev->next = (add); \ + if ((head) == (el)) { \ + (head) = (add); \ + } \ + } \ +} while (0) + +#define CDL_PREPEND_ELEM(head, el, add) \ +do { \ + assert(head != NULL); \ + assert(el != NULL); \ + assert(add != NULL); \ + (add)->next = (el); \ + (add)->prev = (el)->prev; \ + (el)->prev = (add); \ + (add)->prev->next = (add); \ + if ((head) == (el)) { \ + (head) = (add); \ + } \ +} while (0) \ + +#endif /* UTLIST_H */ + diff --git a/cocos2d/ccConfig.h b/cocos2d/ccConfig.h new file mode 100644 index 0000000..587cc8a --- /dev/null +++ b/cocos2d/ccConfig.h @@ -0,0 +1,279 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2008-2010 Ricardo Quesada + * Copyright (c) 2011 Zynga Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +/** + @file + cocos2d (cc) configuration file +*/ + +/** @def CC_ENABLE_CHIPMUNK_INTEGRATION + If enabled, it will include CCPhysicsScript and CCPhysicsDebugNode with Chipmunk Physics support. + If you enable it, make sure that Chipmunk is in the search path. + Disabled by default + + @since v2.1 + */ +#ifndef CC_ENABLE_CHIPMUNK_INTEGRATION +#define CC_ENABLE_CHIPMUNK_INTEGRATION 0 +#endif + +/** @def CC_CHIPMUNK_IMPORT + Which file to import if using Chipmunk. + Change it to "ObjectiveChipmunk.h" or define it as a preprocessor macro if you are using ObjectiveChipmunk. + @since v2.1 + */ +#if CC_ENABLE_CHIPMUNK_INTEGRATION && !defined(CC_CHIPMUNK_IMPORT) +#define CC_CHIPMUNK_IMPORT "chipmunk.h" +#endif + +/** @def CC_ENABLE_BOX2D_INTEGRATION + If enabled, it will include CCPhysicsScript with Box2D Physics support. + If you enable it, make sure that Box2D is in the search path. + + Disabled by default + + @since v2.1 + */ +#ifndef CC_ENABLE_BOX2D_INTEGRATION +#define CC_ENABLE_BOX2D_INTEGRATION 0 +#endif + +/** @def CC_ENABLE_STACKABLE_ACTIONS + If enabled, actions that alter the position property (eg: CCMoveBy, CCJumpBy, CCBezierBy, etc..) will be stacked. + If you run 2 or more 'position' actions at the same time on a node, then end position will be the sum of all the positions. + If disabled, only the last run action will take effect. + + Enabled by default. Disable to be compatible with v2.0 and older versions. + + @since v2.1 + */ +#ifndef CC_ENABLE_STACKABLE_ACTIONS +#define CC_ENABLE_STACKABLE_ACTIONS 1 +#endif + + +/** @def CC_ENABLE_GL_STATE_CACHE + If enabled, cocos2d will maintain an OpenGL state cache internally to avoid unnecessary switches. + In order to use them, you have to use the following functions, instead of the the GL ones: + - ccGLUseProgram() instead of glUseProgram() + - ccGLDeleteProgram() instead of glDeleteProgram() + - ccGLBlendFunc() instead of glBlendFunc() + + If this functionality is disabled, then ccGLUseProgram(), ccGLDeleteProgram(), ccGLBlendFunc() will call the GL ones, without using the cache. + + It is recommended to enable it whenever possible to improve speed. + If you are migrating your code from GL ES 1.1, then keep it disabled. Once all your code works as expected, turn it on. + + Default value: Enabled by default + + @since v2.0.0 + */ +#ifndef CC_ENABLE_GL_STATE_CACHE +#define CC_ENABLE_GL_STATE_CACHE 1 +#endif + +/** @def CC_ENABLE_DEPRECATED + If enabled, cocos2d will compile all deprecated methods, classes and free functions. Also, renamed constants will be active as well. + Enable it only when migrating a v1.0 or earlier v2.0 versions to the most recent cocos2d version. + + Default value: Enabled by default + + @since v2.0.0 + */ +#ifndef CC_ENABLE_DEPRECATED +#define CC_ENABLE_DEPRECATED 1 +#endif + + +/** @def CC_FIX_ARTIFACTS_BY_STRECHING_TEXEL + If enabled, the texture coordinates will be calculated by using this formula: + - texCoord.left = (rect.origin.x*2+1) / (texture.wide*2); + - texCoord.right = texCoord.left + (rect.size.width*2-2)/(texture.wide*2); + + The same for bottom and top. + + This formula prevents artifacts by using 99% of the texture. + The "correct" way to prevent artifacts is by using the spritesheet-artifact-fixer.py or a similar tool. + + Affected nodes: + - CCSprite / CCSpriteBatchNode and subclasses: CCLabelBMFont, CCTMXLayer + - CCLabelAtlas + - CCParticleSystemQuad + - CCTileMap + + To enabled set it to 1. Disabled by default. + + @since v0.99.5 + */ +#ifndef CC_FIX_ARTIFACTS_BY_STRECHING_TEXEL +#define CC_FIX_ARTIFACTS_BY_STRECHING_TEXEL 0 +#endif + +/** @def CC_DIRECTOR_STATS_INTERVAL + Seconds between stats updates. + 0.5 seconds, means that the stats will be updated every 0.5 seconds. + Having a bigger number means more stable stats + + Default value: 0.1f + */ +#ifndef CC_DIRECTOR_STATS_INTERVAL +#define CC_DIRECTOR_STATS_INTERVAL (0.1f) +#endif + +/** @def CC_DIRECTOR_STATS_POSITION + Position of the FPS + + Default: 0,0 (bottom-left corner) + */ +#ifndef CC_DIRECTOR_STATS_POSITION +#define CC_DIRECTOR_STATS_POSITION ccp(0,0) +#endif + +/** @def CC_DIRECTOR_IOS_USE_BACKGROUND_THREAD + If enabled, cocos2d-ios will run on a background thread. If disabled cocos2d-ios will run the main thread. + + To enable set it to a 1, to disable it set to 0. Disabled by default. + + Only valid for cocos2d-ios. Not supported on cocos2d-mac. + + This is an EXPERIMENTAL feature. Do not use it unless you are a developer. + + */ +#ifndef CC_DIRECTOR_IOS_USE_BACKGROUND_THREAD +#define CC_DIRECTOR_IOS_USE_BACKGROUND_THREAD 0 +#endif + + +#define CC_MAC_USE_DISPLAY_LINK_THREAD 0 +#define CC_MAC_USE_OWN_THREAD 1 +#define CC_MAC_USE_MAIN_THREAD 2 + +/** @def CC_DIRECTOR_MAC_THREAD + cocos2d-mac can run on its own thread, on the Display Link thread, or in the main thread. + If you are developing a game, the Display Link or Own thread are the best alternatives. + If you are developing an editor that uses AppKit, you might need to use the Main Thread (only if you are lazy and don't want to create a sync queue). + + Options: + CC_MAC_USE_DISPLAY_LINK_THREAD (default) + CC_MAC_USE_OWN_THREAD + CC_MAC_USE_MAIN_THREAD + + Only valid for cocos2d-mac. Not supported on cocos2d-ios. + + */ +#ifndef CC_DIRECTOR_MAC_THREAD +#define CC_DIRECTOR_MAC_THREAD CC_MAC_USE_DISPLAY_LINK_THREAD +#endif + +/** @def CC_NODE_RENDER_SUBPIXEL + If enabled, the CCNode objects (CCSprite, CCLabel,etc) will be able to render in subpixels. + If disabled, integer pixels will be used. + + To enable set it to 1. Enabled by default. + */ +#ifndef CC_NODE_RENDER_SUBPIXEL +#define CC_NODE_RENDER_SUBPIXEL 1 +#endif + +/** @def CC_SPRITEBATCHNODE_RENDER_SUBPIXEL + If enabled, the CCSprite objects rendered with CCSpriteBatchNode will be able to render in subpixels. + If disabled, integer pixels will be used. + + To enable set it to 1. Enabled by default. + */ +#ifndef CC_SPRITEBATCHNODE_RENDER_SUBPIXEL +#define CC_SPRITEBATCHNODE_RENDER_SUBPIXEL 1 +#endif + +/** @def CC_TEXTURE_ATLAS_USE_TRIANGLE_STRIP + Use GL_TRIANGLE_STRIP instead of GL_TRIANGLES when rendering the texture atlas. + It seems it is the recommend way, but it is much slower, so, enable it at your own risk + + To enable set it to a value different than 0. Disabled by default. + + */ +#ifndef CC_TEXTURE_ATLAS_USE_TRIANGLE_STRIP +#define CC_TEXTURE_ATLAS_USE_TRIANGLE_STRIP 0 +#endif + +/** @def CC_TEXTURE_ATLAS_USE_VAO + By default, CCTextureAtlas (used by many cocos2d classes) will use VAO (Vertex Array Objects). + Apple recommends its usage but they might consume a lot of memory, specially if you use many of them. + So for certain cases, where you might need hundreds of VAO objects, it might be a good idea to disable it. + + To disable it set it to 0. Enabled by default. + + */ +#ifndef CC_TEXTURE_ATLAS_USE_VAO +#define CC_TEXTURE_ATLAS_USE_VAO 1 +#endif + + +/** @def CC_SPRITE_DEBUG_DRAW + If enabled, all subclasses of CCSprite will draw a bounding box. + Useful for debugging purposes only. It is recommended to leave it disabled. + + If the CCSprite is being drawn by a CCSpriteBatchNode, the bounding box might be a bit different. + To enable set it to a value different than 0. Disabled by default: + 0 -- disabled + 1 -- draw bounding box + 2 -- draw texture box + */ +#ifndef CC_SPRITE_DEBUG_DRAW +#define CC_SPRITE_DEBUG_DRAW 0 +#endif + + +/** @def CC_LABELBMFONT_DEBUG_DRAW + If enabled, all subclasses of CCLabelBMFont will draw a bounding box + Useful for debugging purposes only. It is recommended to leave it disabled. + + To enable set it to a value different than 0. Disabled by default. + */ +#ifndef CC_LABELBMFONT_DEBUG_DRAW +#define CC_LABELBMFONT_DEBUG_DRAW 0 +#endif + +/** @def CC_LABELATLAS_DEBUG_DRAW + If enabled, all subclasses of CCLabeltAtlas will draw a bounding box + Useful for debugging purposes only. It is recommended to leave it disabled. + + To enable set it to a value different than 0. Disabled by default. + */ +#ifndef CC_LABELATLAS_DEBUG_DRAW +#define CC_LABELATLAS_DEBUG_DRAW 0 +#endif + +/** @def CC_ENABLE_PROFILERS + If enabled, it will activate various profilers within cocos2d. This statistical data will be saved in the CCProfiler singleton. + In order to display saved data, you have to call the CC_PROFILER_DISPLAY_TIMERS() macro. + Useful for profiling purposes only. If unsure, leave it disabled. + + To enable set it to a value different than 0. Disabled by default. + */ +#ifndef CC_ENABLE_PROFILERS +#define CC_ENABLE_PROFILERS 0 +#endif + diff --git a/cocos2d/ccDeprecated.h b/cocos2d/ccDeprecated.h new file mode 100644 index 0000000..d677c63 --- /dev/null +++ b/cocos2d/ccDeprecated.h @@ -0,0 +1,423 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2012 Ricardo Quesada + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#import "ccConfig.h" + +#if CC_ENABLE_DEPRECATED + +#import "ccTypes.h" +#import "ccMacros.h" +#import "CCMenu.h" +#import "CCDirector.h" +#import "CCSprite.h" +#import "CCParticleSystemQuad.h" +#import "CCGLProgram.h" +#import "CCAnimation.h" +#import "CCScheduler.h" +#import "CCActionManager.h" +#import "CCActionInterval.h" +#import "CCRenderTexture.h" +#import "CCSpriteFrameCache.h" +#import "CCLabelTTF.h" +#import "CCTexture2D.h" +#import "Support/CCFileUtils.h" +#import "Platforms/Mac/CCDirectorMac.h" +#import "Platforms/iOS/CCDirectorIOS.h" +#import "CCActionTiledGrid.h" +#import "CCActionGrid3D.h" + + +/* + * + * IMPORTANT + * + * See the ccDrepecated.m file to see the name of the new methods + * + */ + +// CCLOGERROR is no longer supported. +#define CCLOGERROR CCLOGWARN + +#define ccGridSize CGSize +#define ccg CGSizeMake + +// ccTypes.h +enum { +#ifdef __CC_PLATFORM_IOS + kCCResolutionStandard DEPRECATED_ATTRIBUTE = kCCResolutioniPhone, + kCCResolutionRetinaDisplay DEPRECATED_ATTRIBUTE = kCCResolutioniPhoneRetinaDisplay, +#endif // __CC_PLATFORM_IOS + kCCMenuTouchPriority DEPRECATED_ATTRIBUTE = kCCMenuHandlerPriority, +}; + +// CCRenderTexture.h +enum { + kCCImageFormatJPG DEPRECATED_ATTRIBUTE = kCCImageFormatJPEG, + kCCImageFormatRawData UNAVAILABLE_ATTRIBUTE, +}; + +enum { + CCTextAlignmentLeft DEPRECATED_ATTRIBUTE = kCCTextAlignmentLeft, + CCTextAlignmentCenter DEPRECATED_ATTRIBUTE = kCCTextAlignmentCenter, + CCTextAlignmentRight DEPRECATED_ATTRIBUTE = kCCTextAlignmentRight, + + CCVerticalTextAlignmentTop DEPRECATED_ATTRIBUTE = kCCVerticalTextAlignmentTop, + CCVerticalTextAlignmentMiddle DEPRECATED_ATTRIBUTE = kCCVerticalTextAlignmentCenter, + CCVerticalTextAlignmentBottom DEPRECATED_ATTRIBUTE = kCCVerticalTextAlignmentBottom, + + CCLineBreakModeWordWrap DEPRECATED_ATTRIBUTE = kCCLineBreakModeWordWrap, + CCLineBreakModeCharacterWrap DEPRECATED_ATTRIBUTE = kCCLineBreakModeCharacterWrap, + CCLineBreakModeClip DEPRECATED_ATTRIBUTE = kCCLineBreakModeClip, + CCLineBreakModeHeadTruncation DEPRECATED_ATTRIBUTE = kCCLineBreakModeHeadTruncation, + CCLineBreakModeTailTruncation DEPRECATED_ATTRIBUTE = kCCLineBreakModeTailTruncation, + CCLineBreakModeMiddleTruncation DEPRECATED_ATTRIBUTE = kCCLineBreakModeMiddleTruncation, +}; + +//DEPRECATED_ATTRIBUTE typedef ccTextAlignment CCTextAlignment; +// +//DEPRECATED_ATTRIBUTE typedef ccVerticalTextAlignment CCVerticalTextAlignment; + +// Free functions +void ccGLUniformModelViewProjectionMatrix(CCGLProgram* program) DEPRECATED_ATTRIBUTE; + +// Renamed classes +DEPRECATED_ATTRIBUTE @interface EAGLView : CCGLView +@end + +DEPRECATED_ATTRIBUTE @interface MacView : CCGLView +@end + +// hack to prevent "incopatible pointer type" +#define GLProgram CCGLProgram + +// Extensions + +@interface CCScheduler (Deprecated) +// new: [director scheduler] ++(CCScheduler*) sharedScheduler DEPRECATED_ATTRIBUTE; +// new: -(void) scheduleSelector:(SEL)selector forTarget:(id)target interval:(ccTime)interval repeat: (uint) repeat delay: (ccTime) delay paused:(BOOL)paused; +-(void) scheduleSelector:(SEL)selector forTarget:(id)target interval:(ccTime)interval paused:(BOOL)paused repeat:(uint)repeat delay:(ccTime)delay DEPRECATED_ATTRIBUTE; +// new: unscheduleAllForTarget +-(void) unscheduleAllSelectorsForTarget:(id)target DEPRECATED_ATTRIBUTE; +// new: unscheduleAll +-(void) unscheduleAllSelectors DEPRECATED_ATTRIBUTE; +// new: unscheduleAllWithMinPriority: +-(void) unscheduleAllSelectorsWithMinPriority:(NSInteger)minPriority DEPRECATED_ATTRIBUTE; +@end + +@interface CCActionManager (Deprecated) +// new: [director actionManager] ++(CCActionManager*) sharedManager DEPRECATED_ATTRIBUTE; +@end + +#if defined(__CC_PLATFORM_IOS) + +#elif defined(__CC_PLATFORM_MAC) + +#endif // __CC_PLATFORM_MAC + +@interface CCDirector (Deprecated) +// new: [director isPaused] +-(BOOL) getIsPaused DEPRECATED_ATTRIBUTE; +// new: setView: +-(void) setOpenGLView:(CCGLView*)view DEPRECATED_ATTRIBUTE; +// new: view +-(CCGLView*) openGLView DEPRECATED_ATTRIBUTE; +// new: setDisplayStats: +-(void) setDisplayFPS:(BOOL)display DEPRECATED_ATTRIBUTE; +@end + +@interface CCNode (Deprecated) +-(void) setIsRelativeAnchorPoint:(BOOL)value DEPRECATED_ATTRIBUTE; +-(BOOL) isRelativeAnchorPoint DEPRECATED_ATTRIBUTE; +- (void) setIgnoreAnchorPointForPosition:(BOOL)value DEPRECATED_ATTRIBUTE; +- (BOOL) ignoreAnchorPointForPosition:(BOOL)value DEPRECATED_ATTRIBUTE; +@end + +@interface CCSprite (Deprecated) +// new: spriteWithTexture:rect: ++(id) spriteWithBatchNode:(CCSpriteBatchNode*)node rect:(CGRect)rect DEPRECATED_ATTRIBUTE; +// new: initWithTexture:rect: +-(id) initWithBatchNode:(CCSpriteBatchNode*)node rect:(CGRect)rect DEPRECATED_ATTRIBUTE; +// new: spriteFrame +-(CCSpriteFrame*) displayedFrame DEPRECATED_ATTRIBUTE; +// new: spriteFrame +- (CCSpriteFrame*) displayFrame DEPRECATED_ATTRIBUTE; +// new: spriteFrame +- (void) setDisplayFrame:(CCSpriteFrame *)newFrame DEPRECATED_ATTRIBUTE; +// don't use +-(BOOL) isFrameDisplayed:(CCSpriteFrame*)frame DEPRECATED_ATTRIBUTE; +// new: setSpriteFrameWithAnimationName:index: +-(void) setDisplayFrameWithAnimationName:(NSString*)animationName index:(int) frameIndex DEPRECATED_ATTRIBUTE; +@end + +@interface CCParticleSystemQuad (Deprecated) +-(void) setDisplayFrame:(CCSpriteFrame *)spriteFrame DEPRECATED_ATTRIBUTE; +@end + +@interface CCMenuItem (Deprecated) +// new: -(CGRect) activeArea; +-(CGRect) rect DEPRECATED_ATTRIBUTE; +-(void) setRect:(CGRect)rect DEPRECATED_ATTRIBUTE; +@end + +@interface CCMenuItemAtlasFont (Deprecated) +// new itemWithStirng:charmapFile:itemWidth:itemHeight:startCharMap ++(id) itemFromString: (NSString*) value charMapFile:(NSString*) charMapFile itemWidth:(int)itemWidth itemHeight:(int)itemHeight startCharMap:(char)startCharMap DEPRECATED_ATTRIBUTE; +// new itemWithStirng:charmapFile:itemWidth:itemHeight:startCharMap:target:selector ++(id) itemFromString: (NSString*) value charMapFile:(NSString*) charMapFile itemWidth:(int)itemWidth itemHeight:(int)itemHeight startCharMap:(char)startCharMap target:(id) rec selector:(SEL) cb DEPRECATED_ATTRIBUTE; +// new itemWithStirng:charmapFile:itemWidth:itemHeight:startCharMap:block ++(id) itemFromString: (NSString*) value charMapFile:(NSString*) charMapFile itemWidth:(int)itemWidth itemHeight:(int)itemHeight startCharMap:(char)startCharMap block:(void(^)(id sender))block DEPRECATED_ATTRIBUTE; +// new initWithStirng:charmapFile:itemWidth:itemHeight:startCharMap:target:selector +-(id) initFromString: (NSString*) value charMapFile:(NSString*) charMapFile itemWidth:(int)itemWidth itemHeight:(int)itemHeight startCharMap:(char)startCharMap target:(id) rec selector:(SEL) cb DEPRECATED_ATTRIBUTE; +// new initWithStirng:charmapFile:itemWidth:itemHeight:startCharMap:block +-(id) initFromString: (NSString*) value charMapFile:(NSString*) charMapFile itemWidth:(int)itemWidth itemHeight:(int)itemHeight startCharMap:(char)startCharMap block:(void(^)(id sender))block DEPRECATED_ATTRIBUTE; +@end + + +@interface CCMenuItemFont (Deprecated) +// new: itemWithString: ++(id) itemFromString: (NSString*) value DEPRECATED_ATTRIBUTE; +// new: itemWithString:target:selector ++(id) itemFromString: (NSString*) value target:(id) r selector:(SEL) s DEPRECATED_ATTRIBUTE; +// new: itemWithString:block: ++(id) itemFromString: (NSString*) value block:(void(^)(id sender))block DEPRECATED_ATTRIBUTE; +// new: initWithString:target:selector +-(id) initFromString: (NSString*) value target:(id) r selector:(SEL) s DEPRECATED_ATTRIBUTE; +// new: initWithString:block: +-(id) initFromString: (NSString*) value block:(void(^)(id sender))block DEPRECATED_ATTRIBUTE; +@end + +@interface CCMenuItemSprite (Deprecated) ++(id) itemFromNormalSprite:(CCNode*)normalSprite selectedSprite:(CCNode*)selectedSprite DEPRECATED_ATTRIBUTE; ++(id) itemFromNormalSprite:(CCNode*)normalSprite selectedSprite:(CCNode*)selectedSprite target:(id)target selector:(SEL)selector DEPRECATED_ATTRIBUTE; ++(id) itemFromNormalSprite:(CCNode*)normalSprite selectedSprite:(CCNode*)selectedSprite disabledSprite:(CCNode*)disabledSprite target:(id)target selector:(SEL)selector DEPRECATED_ATTRIBUTE; ++(id) itemFromNormalSprite:(CCNode*)normalSprite selectedSprite:(CCNode*)selectedSprite block:(void(^)(id sender))block DEPRECATED_ATTRIBUTE; ++(id) itemFromNormalSprite:(CCNode*)normalSprite selectedSprite:(CCNode*)selectedSprite disabledSprite:(CCNode*)disabledSprite block:(void(^)(id sender))block DEPRECATED_ATTRIBUTE; + +-(id) initFromNormalSprite:(CCNode*)normalSprite selectedSprite:(CCNode*)selectedSprite disabledSprite:(CCNode*)disabledSprite target:(id)target selector:(SEL)selector DEPRECATED_ATTRIBUTE; +-(id) initFromNormalSprite:(CCNode*)normalSprite selectedSprite:(CCNode*)selectedSprite disabledSprite:(CCNode*)disabledSprite block:(void(^)(id sender))block DEPRECATED_ATTRIBUTE; +@end + +@interface CCMenuItemImage (Deprecated) +// new: itemWithNormalImage:selectedImage: ++(id) itemFromNormalImage: (NSString*)value selectedImage:(NSString*) value2 DEPRECATED_ATTRIBUTE; +// new: itemWithNormalImage:selectedImage:target:selector ++(id) itemFromNormalImage: (NSString*)value selectedImage:(NSString*) value2 target:(id) r selector:(SEL) s DEPRECATED_ATTRIBUTE; +// new: itemWithNormalImage:selectedImage:disabledImage:target:selector ++(id) itemFromNormalImage: (NSString*)value selectedImage:(NSString*) value2 disabledImage:(NSString*) value3 target:(id) r selector:(SEL) s DEPRECATED_ATTRIBUTE; +// new: itemWithNormalImage:selectedImage:block ++(id) itemFromNormalImage: (NSString*)value selectedImage:(NSString*) value2 block:(void(^)(id sender))block DEPRECATED_ATTRIBUTE; +// new: itemWithNormalImage:selectedImage:disabledImage:block ++(id) itemFromNormalImage: (NSString*)value selectedImage:(NSString*) value2 disabledImage:(NSString*) value3 block:(void(^)(id sender))block DEPRECATED_ATTRIBUTE; +// new: initWithNormalImage:selectedImage:disabledImage:target:selector +-(id) initFromNormalImage: (NSString*) value selectedImage:(NSString*)value2 disabledImage:(NSString*) value3 target:(id) r selector:(SEL) s DEPRECATED_ATTRIBUTE; +// new: initWithNormalImage:selectedImage:disabledImage:block +-(id) initFromNormalImage: (NSString*) value selectedImage:(NSString*)value2 disabledImage:(NSString*) value3 block:(void(^)(id sender))block DEPRECATED_ATTRIBUTE; +@end + +@interface CCAnimation (Deprecated) ++(id) animationWithFrames:(NSArray*)arrayOfSpriteFrameNames DEPRECATED_ATTRIBUTE; ++(id) animationWithFrames:(NSArray*)arrayOfSpriteFrameNames delay:(float)delay DEPRECATED_ATTRIBUTE; +-(id) initWithFrames:(NSArray*)arrayOfSpriteFrameNames DEPRECATED_ATTRIBUTE; +-(id) initWithFrames:(NSArray *)arrayOfSpriteFrameNames delay:(float)delay DEPRECATED_ATTRIBUTE; +-(void) addFrame:(CCSpriteFrame*)frame DEPRECATED_ATTRIBUTE; +-(void) addFrameWithFilename:(NSString*)filename DEPRECATED_ATTRIBUTE; +-(void) addFrameWithTexture:(CCTexture2D*)texture rect:(CGRect)rect DEPRECATED_ATTRIBUTE; +@end + +@interface CCAnimate (Deprecated) +// new: actionWithAnimation: ++(id) actionWithAnimation:(CCAnimation*)animation restoreOriginalFrame:(BOOL)restoreOriginalFrame DEPRECATED_ATTRIBUTE; +// new: actiontWithAnimation: ++(id) actionWithDuration:(ccTime)duration animation:(CCAnimation*)animation restoreOriginalFrame:(BOOL)restoreOriginalFrame DEPRECATED_ATTRIBUTE; +// new: initWithAnimation: +-(id) initWithAnimation:(CCAnimation*) a restoreOriginalFrame:(BOOL)restoreOriginalFrame DEPRECATED_ATTRIBUTE; +// new: initWithAnimation: +-(id) initWithDuration:(ccTime)duration animation:(CCAnimation*)animation restoreOriginalFrame:(BOOL)restoreOriginalFrame DEPRECATED_ATTRIBUTE; +@end + +@interface CCSequence (Deprecated) +// new: actionWithArray ++(id) actionsWithArray: (NSArray*) actions DEPRECATED_ATTRIBUTE; +@end + +@interface CCSpawn (Deprecated) +// new: actionWithArray ++(id) actionsWithArray: (NSArray*) actions DEPRECATED_ATTRIBUTE; +@end + + +@interface CCRenderTexture (Deprecated) +// new: saveToFile: +-(BOOL)saveBuffer:(NSString*)name DEPRECATED_ATTRIBUTE; +// new: saveToFile:format: +-(BOOL)saveBuffer:(NSString*)name format:(int)format DEPRECATED_ATTRIBUTE; +// new: -- not implemented on v2.0 +-(NSData*)getUIImageAsDataFromBuffer:(int) format UNAVAILABLE_ATTRIBUTE; +#if defined(__CC_PLATFORM_IOS) +// new: getUIImage +-(UIImage *)getUIImageFromBuffer DEPRECATED_ATTRIBUTE; +#endif +@end + +@interface CCFileUtils (Deprecated) + +// new: -(NSString*) fullPathFromRelativePath: (instance method, not class method) ++(NSString*) fullPathFromRelativePath:(NSString*) relPath DEPRECATED_ATTRIBUTE; +// new: -(NSString*) fullPathFromRelativePath:resolutionType (instance method, not class method) ++(NSString*) fullPathFromRelativePath:(NSString*)relPath resolutionType:(ccResolutionType*)resolutionType DEPRECATED_ATTRIBUTE; + +#ifdef __CC_PLATFORM_IOS +// new: -(NSString*) removeSuffixFromFile: (instance method, not class method) ++(NSString *)removeSuffixFromFile:(NSString*) path DEPRECATED_ATTRIBUTE; +// new: -(BOOL) iPhoneRetinaDisplayFileExistsAtPath: (instance method, not class method) ++(BOOL) iPhoneRetinaDisplayFileExistsAtPath:(NSString*)filename DEPRECATED_ATTRIBUTE; +// new: -(BOOL) iPadFileExistsAtPath: (instance method, not class method) ++(BOOL) iPadFileExistsAtPath:(NSString*)filename DEPRECATED_ATTRIBUTE; +// new: -(BOOL) iPadRetinaDisplayFileExistsAtPath: (instance method, not class method) ++(BOOL) iPadRetinaDisplayFileExistsAtPath:(NSString*)filename DEPRECATED_ATTRIBUTE; +// new: -(void) setiPhoneRetinaDisplaySuffix: (instance method, not class method) ++(void) setRetinaDisplaySuffix:(NSString*)suffix DEPRECATED_ATTRIBUTE; +#endif //__CC_PLATFORM_IOS +@end + + +@interface CCSpriteFrameCache (Deprecated) +-(void) addSpriteFramesWithDictionary:(NSDictionary*)dictionary textureFile:(NSString*)filename DEPRECATED_ATTRIBUTE; +-(void) addSpriteFramesWithFile:(NSString*)plist textureFile:(NSString*)filename DEPRECATED_ATTRIBUTE; +@end + + +@interface CCLabelTTF (Deprecated) +/* +// new: + (id) labelWithString:(NSString*)string dimensions:hAlignment:fontName:fontSize: ++ (id) labelWithString:(NSString*)string dimensions:(CGSize)dimensions alignment:(CCTextAlignment)alignment fontName:(NSString*)name fontSize:(CGFloat)size DEPRECATED_ATTRIBUTE; +// new: + (id) labelWithString:(NSString*)string dimensions:hAlignment:lineBreakMode:fontName:fontSize: ++ (id) labelWithString:(NSString*)string dimensions:(CGSize)dimensions alignment:(CCTextAlignment)alignment lineBreakMode:(CCLineBreakMode)lineBreakMode fontName:(NSString*)name fontSize:(CGFloat)size DEPRECATED_ATTRIBUTE; + ++ (id) labelWithString:(NSString*)string dimensions:(CGSize)dimensions hAlignment:(CCTextAlignment)alignment fontName:(NSString*)name fontSize:(CGFloat)size DEPRECATED_ATTRIBUTE; ++ (id) labelWithString:(NSString*)string dimensions:(CGSize)dimensions hAlignment:(CCTextAlignment)alignment lineBreakMode:(CCLineBreakMode)lineBreakMode fontName:(NSString*)name fontSize:(CGFloat)size DEPRECATED_ATTRIBUTE; ++ (id) labelWithString:(NSString*)string dimensions:(CGSize)dimensions hAlignment:(CCTextAlignment)alignment vAlignment:(CCVerticalTextAlignment)vertAlignment lineBreakMode:(CCLineBreakMode)lineBreakMode fontName:(NSString*)name fontSize:(CGFloat)size DEPRECATED_ATTRIBUTE; ++ (id) labelWithString:(NSString*)string dimensions:(CGSize)dimensions hAlignment:(CCTextAlignment)alignment vAlignment:(CCVerticalTextAlignment)vertAlignment fontName:(NSString*)name fontSize:(CGFloat)size DEPRECATED_ATTRIBUTE; + +// new: + (id) initWithString:(NSString*)string dimensions:hAlignment:fontName:fontSize: +- (id) initWithString:(NSString*)string dimensions:(CGSize)dimensions alignment:(CCTextAlignment)alignment fontName:(NSString*)name fontSize:(CGFloat)size DEPRECATED_ATTRIBUTE; +// new: + (id) initWithString:(NSString*)string dimensions:hAlignment:lineBreakMode:fontName:fontSize: +- (id) initWithString:(NSString*)str dimensions:(CGSize)dimensions alignment:(CCTextAlignment)alignment lineBreakMode:(CCLineBreakMode)lineBreakMode fontName:(NSString*)name fontSize:(CGFloat)size DEPRECATED_ATTRIBUTE; + */ +@end + +@interface CCTexture2D (Deprecated) +/* +- (id) initWithString:(NSString*)string dimensions:(CGSize)dimensions alignment:(CCTextAlignment)alignment lineBreakMode:(CCLineBreakMode)lineBreakMode fontName:(NSString*)name fontSize:(CGFloat)size DEPRECATED_ATTRIBUTE; +- (id) initWithString:(NSString*)string dimensions:(CGSize)dimensions alignment:(CCTextAlignment)alignment fontName:(NSString*)name fontSize:(CGFloat)size DEPRECATED_ATTRIBUTE; + */ +@end + +// Effects +#pragma mark - Effects + +@interface CCGridAction (Deprecated) ++(id) actionWithSize:(CGSize)size duration:(ccTime)d DEPRECATED_ATTRIBUTE; +-(id) initWithSize:(CGSize)gridSize duration:(ccTime)d DEPRECATED_ATTRIBUTE; +@end + +@interface CCWaves3D (Deprecated) ++(id)actionWithWaves:(int)wav amplitude:(float)amp grid:(CGSize)gridSize duration:(ccTime)d DEPRECATED_ATTRIBUTE; +-(id)initWithWaves:(int)wav amplitude:(float)amp grid:(CGSize)gridSize duration:(ccTime)d DEPRECATED_ATTRIBUTE; +@end + +@interface CCLens3D (Deprecated) ++(id)actionWithPosition:(CGPoint)pos radius:(float)r grid:(CGSize)gridSize duration:(ccTime)d DEPRECATED_ATTRIBUTE; +-(id)initWithPosition:(CGPoint)pos radius:(float)r grid:(CGSize)gridSize duration:(ccTime)d DEPRECATED_ATTRIBUTE; +@end + +@interface CCRipple3D (Deprecated) ++(id)actionWithPosition:(CGPoint)pos radius:(float)r waves:(int)wav amplitude:(float)amp grid:(CGSize)gridSize duration:(ccTime)d DEPRECATED_ATTRIBUTE; +-(id)initWithPosition:(CGPoint)pos radius:(float)r waves:(int)wav amplitude:(float)amp grid:(CGSize)gridSize duration:(ccTime)d DEPRECATED_ATTRIBUTE; +@end + +@interface CCShaky3D (Deprecated) ++(id)actionWithRange:(int)range shakeZ:(BOOL)shakeZ grid:(CGSize)gridSize duration:(ccTime)d DEPRECATED_ATTRIBUTE; +-(id)initWithRange:(int)range shakeZ:(BOOL)shakeZ grid:(CGSize)gridSize duration:(ccTime)d DEPRECATED_ATTRIBUTE; +@end + +@interface CCLiquid (Deprecated) ++(id)actionWithWaves:(int)wav amplitude:(float)amp grid:(CGSize)gridSize duration:(ccTime)d DEPRECATED_ATTRIBUTE; +-(id)initWithWaves:(int)wav amplitude:(float)amp grid:(CGSize)gridSize duration:(ccTime)d DEPRECATED_ATTRIBUTE; +@end + +@interface CCWaves (Deprecated) ++(id)actionWithWaves:(int)wav amplitude:(float)amp horizontal:(BOOL)h vertical:(BOOL)v grid:(CGSize)gridSize duration:(ccTime)d DEPRECATED_ATTRIBUTE; +-(id)initWithWaves:(int)wav amplitude:(float)amp horizontal:(BOOL)h vertical:(BOOL)v grid:(CGSize)gridSize duration:(ccTime)d DEPRECATED_ATTRIBUTE; +@end + +@interface CCTwirl (Deprecated) ++(id)actionWithPosition:(CGPoint)pos twirls:(int)t amplitude:(float)amp grid:(CGSize)gridSize duration:(ccTime)d DEPRECATED_ATTRIBUTE; +-(id)initWithPosition:(CGPoint)pos twirls:(int)t amplitude:(float)amp grid:(CGSize)gridSize duration:(ccTime)d DEPRECATED_ATTRIBUTE; +@end + +@interface CCShakyTiles3D (Deprecated) ++(id)actionWithRange:(int)range shakeZ:(BOOL)shakeZ grid:(CGSize)gridSize duration:(ccTime)d DEPRECATED_ATTRIBUTE; +-(id)initWithRange:(int)range shakeZ:(BOOL)shakeZ grid:(CGSize)gridSize duration:(ccTime)d DEPRECATED_ATTRIBUTE; +@end + +@interface CCShatteredTiles3D (Deprecated) ++(id)actionWithRange:(int)range shatterZ:(BOOL)shatterZ grid:(CGSize)gridSize duration:(ccTime)d DEPRECATED_ATTRIBUTE; +-(id)initWithRange:(int)range shatterZ:(BOOL)shatterZ grid:(CGSize)gridSize duration:(ccTime)d DEPRECATED_ATTRIBUTE; +@end + +@interface CCShuffleTiles (Deprecated) ++(id)actionWithSeed:(int)s grid:(CGSize)gridSize duration:(ccTime)d DEPRECATED_ATTRIBUTE; +-(id)initWithSeed:(int)s grid:(CGSize)gridSize duration:(ccTime)d DEPRECATED_ATTRIBUTE; +@end + +@interface CCTurnOffTiles (Deprecated) ++(id)actionWithSeed:(int)s grid:(CGSize)gridSize duration:(ccTime)d DEPRECATED_ATTRIBUTE; +-(id)initWithSeed:(int)s grid:(CGSize)gridSize duration:(ccTime)d DEPRECATED_ATTRIBUTE; +@end + +@interface CCWavesTiles3D (Deprecated) ++(id)actionWithWaves:(int)wav amplitude:(float)amp grid:(CGSize)gridSize duration:(ccTime)d DEPRECATED_ATTRIBUTE; +-(id)initWithWaves:(int)wav amplitude:(float)amp grid:(CGSize)gridSize duration:(ccTime)d DEPRECATED_ATTRIBUTE; +@end + +@interface CCJumpTiles3D (Deprecated) ++(id)actionWithJumps:(int)j amplitude:(float)amp grid:(CGSize)gridSize duration:(ccTime)d DEPRECATED_ATTRIBUTE; +-(id)initWithJumps:(int)j amplitude:(float)amp grid:(CGSize)gridSize duration:(ccTime)d DEPRECATED_ATTRIBUTE; +@end + +@interface CCSplitRows (Deprecated) ++(id)actionWithRows:(int)rows duration:(ccTime)duration DEPRECATED_ATTRIBUTE; +-(id)initWithRows:(int)rows duration:(ccTime)duration DEPRECATED_ATTRIBUTE; +@end + +@interface CCSplitCols (Deprecated) ++(id)actionWithCols:(int)cols duration:(ccTime)duration DEPRECATED_ATTRIBUTE; +-(id)initWithCols:(int)cols duration:(ccTime)duration DEPRECATED_ATTRIBUTE; +@end + +#endif // CC_ENABLE_DEPRECATED + diff --git a/src/cocos2d/ccDeprecated.m b/cocos2d/ccDeprecated.m similarity index 59% rename from src/cocos2d/ccDeprecated.m rename to cocos2d/ccDeprecated.m index 34b0645..6f93d06 100644 --- a/src/cocos2d/ccDeprecated.m +++ b/cocos2d/ccDeprecated.m @@ -31,16 +31,36 @@ // Free functions void ccGLUniformModelViewProjectionMatrix( CCGLProgram* program ) { - [program setUniformForModelViewProjectionMatrix]; + [program setUniformsForBuiltins]; } +#pragma mark - Scheduler + @implementation CCScheduler (Deprecated) +(CCScheduler*) sharedScheduler { return [[CCDirector sharedDirector] scheduler]; } +-(void) scheduleSelector:(SEL)selector forTarget:(id)target interval:(ccTime)interval paused:(BOOL)paused repeat:(uint)repeat delay:(ccTime)delay +{ + [self scheduleSelector:selector forTarget:target interval:interval repeat:repeat delay:delay paused:paused]; +} +-(void) unscheduleAllSelectorsForTarget:(id)target +{ + [self unscheduleAllForTarget:target]; +} +-(void) unscheduleAllSelectorsWithMinPriority:(NSInteger)minPriority +{ + [self unscheduleAllWithMinPriority:minPriority]; +} +-(void) unscheduleAllSelectors +{ + [self unscheduleAll]; +} @end +#pragma mark - ActionManager + @implementation CCActionManager (Deprecated) +(CCActionManager*) sharedManager { @@ -48,25 +68,20 @@ +(CCActionManager*) sharedManager } @end -#if __CC_PLATFORM_IOS -@implementation CCTouchDispatcher (Deprecated) -+(CCTouchDispatcher*) sharedDispatcher -{ - return [[CCDirector sharedDirector] touchDispatcher]; -} -@end +#if defined(__CC_PLATFORM_IOS) + #elif __CC_PLATFORM_MAC -@implementation CCEventDispatcher (Deprecated) -+(CCEventDispatcher*) sharedDispatcher -{ - return [[CCDirector sharedDirector] eventDispatcher]; -} -@end + #endif // __CC_PLATFORM_MAC -#pragma mark - CCDirector +#pragma mark - Director @implementation CCDirector (Deprecated) +-(BOOL) getIsPaused +{ + return [self isPaused]; +} + -(void) setDisplayFPS:(BOOL)display { [self setDisplayStats:display]; @@ -79,21 +94,34 @@ -(void) setOpenGLView:(CCGLView*)view -(CCGLView*) openGLView { - return (CCGLView*)view_; + return (CCGLView*)__view; } @end +#pragma mark - Node @implementation CCNode (Deprecated) -(void) setIsRelativeAnchorPoint:(BOOL)value { - [self setIgnoreAnchorPointForPosition:!value]; + NSAssert(NO, @"Set anchorPoint to 0, 0 instead of changing this property"); } -(BOOL) isRelativeAnchorPoint { - return ! self.ignoreAnchorPointForPosition; + NSAssert(NO, @"Set anchorPoint to 0, 0 instead of changing this property"); + return YES; +} +- (void) setIgnoreAnchorPointForPosition:(BOOL)value +{ + NSAssert(NO, @"Set anchorPoint to 0, 0 instead of changing this property"); +} +- (BOOL) ignoreAnchorPointForPosition:(BOOL)value +{ + NSAssert(NO, @"Set anchorPoint to 0, 0 instead of changing this property"); + return NO; } @end +#pragma mark - Sprite + @implementation CCSprite (Deprecated) +(id) spriteWithBatchNode:(CCSpriteBatchNode*)node rect:(CGRect)rect @@ -114,8 +142,57 @@ -(CCSpriteFrame*) displayedFrame { return [self displayFrame]; } + +- (CCSpriteFrame*) displayFrame +{ + return [self spriteFrame]; +} + +- (void) setDisplayFrame:(CCSpriteFrame *)newFrame +{ + self.spriteFrame = newFrame; +} + +-(BOOL) isFrameDisplayed:(CCSpriteFrame*)frame +{ + return NO; +} + +-(void) setDisplayFrameWithAnimationName:(NSString*)animationName index:(int) frameIndex +{ + [self setSpriteFrameWithAnimationName:(NSString*)animationName index:(int) frameIndex]; +} + +@end + +#pragma mark - Particle syste + +@implementation CCParticleSystemQuad (Deprecated) + +-(void) setDisplayFrame:(CCSpriteFrame *)spriteFrame +{ + [self setSpriteFrame:spriteFrame]; +} + +@end + +@implementation CCMenuItem (Deprecated) +// new: -(CGRect) activeArea; +-(CGRect) rect +{ + NSAssert(NO, @"Use CCMenuItem # activeArea instead"); + return CGRectZero; +} + +-(void) setRect:(CGRect)rect +{ + NSAssert(NO, @"Use CCMenuItem # setActiveArea instead"); +} + @end +#pragma mark - MenuItemAtlasFont + @implementation CCMenuItemAtlasFont (Deprecated) +(id) itemFromString: (NSString*) value charMapFile:(NSString*) charMapFile itemWidth:(int)itemWidth itemHeight:(int)itemHeight startCharMap:(char)startCharMap { @@ -139,6 +216,8 @@ -(id) initFromString: (NSString*) value charMapFile:(NSString*) charMapFile item } @end +#pragma mark - MenuItemFont + @implementation CCMenuItemFont (Deprecated) +(id) itemFromString: (NSString*) value { @@ -162,6 +241,8 @@ -(id) initFromString: (NSString*) value block:(void(^)(id sender))block } @end +#pragma mark - MenuItemSprite + @implementation CCMenuItemSprite (Deprecated) +(id) itemFromNormalSprite:(CCNode*)normalSprite selectedSprite:(CCNode*)selectedSprite { @@ -194,6 +275,8 @@ -(id) initFromNormalSprite:(CCNode*)normalSprite selectedSprite: } @end +#pragma mark - MenuItemImage + @implementation CCMenuItemImage (Deprecated) +(id) itemFromNormalImage: (NSString*)value selectedImage:(NSString*) value2 { @@ -225,6 +308,7 @@ -(id) initFromNormalImage: (NSString*) value selectedImage:(NSString*)value2 dis } @end +#pragma mark - Animation @implementation CCAnimation (Deprecated) +(id) animationWithFrames:(NSArray*)arrayOfSpriteFrameNames @@ -257,32 +341,34 @@ -(void) addFrameWithTexture:(CCTexture2D*)texture rect:(CGRect)rect } @end +#pragma mark - Animate + @implementation CCAnimate (Deprecated) +(id) actionWithAnimation:(CCAnimation*)animation restoreOriginalFrame:(BOOL)restoreOriginalFrame { - CCAnimation *anim = [[animation copy] autorelease]; + CCAnimation *anim = [animation copy]; anim.restoreOriginalFrame = restoreOriginalFrame; - return [[[self alloc] initWithAnimation:anim] autorelease]; + return [[self alloc] initWithAnimation:anim]; } +(id) actionWithDuration:(ccTime)duration animation:(CCAnimation*)animation restoreOriginalFrame:(BOOL)restoreOriginalFrame { - CCAnimation *anim = [[animation copy] autorelease]; + CCAnimation *anim = [animation copy]; anim.restoreOriginalFrame = restoreOriginalFrame; anim.delayPerUnit = duration / animation.frames.count; - return [[[self alloc] initWithAnimation:anim] autorelease]; + return [[self alloc] initWithAnimation:anim]; } -(id) initWithAnimation:(CCAnimation*)animation restoreOriginalFrame:(BOOL)restoreOriginalFrame { - CCAnimation *anim = [[animation copy] autorelease]; + CCAnimation *anim = [animation copy]; anim.restoreOriginalFrame = restoreOriginalFrame; return [self initWithAnimation:anim]; } -(id) initWithDuration:(ccTime)duration animation:(CCAnimation*)animation restoreOriginalFrame:(BOOL)restoreOriginalFrame { - CCAnimation *anim = [[animation copy] autorelease]; + CCAnimation *anim = [animation copy]; anim.restoreOriginalFrame = restoreOriginalFrame; anim.delayPerUnit = duration / animation.frames.count; @@ -290,6 +376,8 @@ -(id) initWithDuration:(ccTime)duration animation:(CCAnimation*)animation restor } @end +#pragma mark - Sequence + @implementation CCSequence (Deprecated) // new: actionWithArray +(id) actionsWithArray: (NSArray*) actions @@ -298,6 +386,8 @@ +(id) actionsWithArray: (NSArray*) actions } @end +#pragma mark - Spawn + @implementation CCSpawn (Deprecated) // new: actionWithArray +(id) actionsWithArray: (NSArray*) actions @@ -306,6 +396,8 @@ +(id) actionsWithArray: (NSArray*) actions } @end +#pragma mark - RenderTexture + @implementation CCRenderTexture (Deprecated) -(BOOL)saveBuffer:(NSString*)name { @@ -322,7 +414,7 @@ -(NSData*)getUIImageAsDataFromBuffer:(int) format return nil; } -#if __CC_PLATFORM_IOS +#if defined(__CC_PLATFORM_IOS) -(UIImage *)getUIImageFromBuffer { return [self getUIImage]; @@ -330,6 +422,8 @@ -(UIImage *)getUIImageFromBuffer #endif @end +#pragma mark - FileUtils + @implementation CCFileUtils (Deprecated) +(NSString*) fullPathFromRelativePath:(NSString*) relPath { @@ -341,7 +435,7 @@ +(NSString*) fullPathFromRelativePath:(NSString*)relPath resolutionType:(ccResol return [[self sharedFileUtils] fullPathFromRelativePath:relPath resolutionType:resolutionType]; } -#if __CC_PLATFORM_IOS +#if defined(__CC_PLATFORM_IOS) +(void) setRetinaDisplaySuffix:(NSString*)suffix { return [[self sharedFileUtils] setiPhoneRetinaDisplaySuffix:suffix]; @@ -365,6 +459,8 @@ +(BOOL) iPadRetinaDisplayFileExistsAtPath:(NSString*)filename #endif @end +#pragma mark - SpriteFrameCache + @implementation CCSpriteFrameCache (Deprecated) -(void) addSpriteFramesWithDictionary:(NSDictionary*)dictionary textureFile:(NSString*)filename { @@ -378,37 +474,198 @@ -(void) addSpriteFramesWithFile:(NSString*)plist textureFile:(NSString*)filename } @end +#pragma mark - LabelTTF + @implementation CCLabelTTF (Deprecated) -+ (id) labelWithString:(NSString*)string dimensions:(CGSize)dimensions alignment:(CCTextAlignment)alignment fontName:(NSString*)name fontSize:(CGFloat)size + +@end + +#pragma mark - Texture2D + +@implementation CCTexture2D (Deprecated) + +@end + +#pragma mark - Effects + +@implementation CCGridAction (Deprecated) ++(id) actionWithSize:(CGSize)size duration:(ccTime)d { - return [self labelWithString:string dimensions:dimensions hAlignment:alignment fontName:name fontSize:size]; + return [self actionWithDuration:d size:size]; } -+ (id) labelWithString:(NSString*)string dimensions:(CGSize)dimensions alignment:(CCTextAlignment)alignment lineBreakMode:(CCLineBreakMode)lineBreakMode fontName:(NSString*)name fontSize:(CGFloat)size +-(id) initWithSize:(CGSize)gridSize duration:(ccTime)d { - return [self labelWithString:string dimensions:dimensions hAlignment:alignment lineBreakMode:lineBreakMode fontName:name fontSize:size]; + return [self initWithDuration:d size:gridSize]; } -- (id) initWithString:(NSString*)string dimensions:(CGSize)dimensions alignment:(CCTextAlignment)alignment fontName:(NSString*)name fontSize:(CGFloat)size +@end + +@implementation CCWaves3D (Deprecated) ++(id)actionWithWaves:(int)wav amplitude:(float)amp grid:(CGSize)gridSize duration:(ccTime)d { - return [self initWithString:string dimensions:dimensions hAlignment:alignment fontName:name fontSize:size]; + return [self actionWithDuration:d size:gridSize waves:wav amplitude:amp]; } -- (id) initWithString:(NSString*)string dimensions:(CGSize)dimensions alignment:(CCTextAlignment)alignment lineBreakMode:(CCLineBreakMode)lineBreakMode fontName:(NSString*)name fontSize:(CGFloat)size +-(id)initWithWaves:(int)wav amplitude:(float)amp grid:(CGSize)gridSize duration:(ccTime)d { - return [self initWithString:string dimensions:dimensions hAlignment:alignment lineBreakMode:lineBreakMode fontName:name fontSize:size]; + return [self initWithDuration:d size:gridSize waves:wav amplitude:amp]; } @end -@implementation CCTexture2D (Deprecated) -- (id) initWithString:(NSString*)string dimensions:(CGSize)dimensions alignment:(CCTextAlignment)alignment lineBreakMode:(CCLineBreakMode)lineBreakMode fontName:(NSString*)name fontSize:(CGFloat)size +@implementation CCLens3D (Deprecated) ++(id)actionWithPosition:(CGPoint)pos radius:(float)r grid:(CGSize)gridSize duration:(ccTime)d +{ + return [self actionWithDuration:d size:gridSize position:pos radius:r]; +} +-(id)initWithPosition:(CGPoint)pos radius:(float)r grid:(CGSize)gridSize duration:(ccTime)d +{ + return [self initWithDuration:d size:gridSize position:pos radius:r]; +} +@end + +@implementation CCRipple3D (Deprecated) ++(id)actionWithPosition:(CGPoint)pos radius:(float)r waves:(int)wav amplitude:(float)amp grid:(CGSize)gridSize duration:(ccTime)d +{ + return [self actionWithDuration:d size:gridSize position:pos radius:r waves:wav amplitude:amp]; +} +-(id)initWithPosition:(CGPoint)pos radius:(float)r waves:(int)wav amplitude:(float)amp grid:(CGSize)gridSize duration:(ccTime)d +{ + return [self initWithDuration:d size:gridSize position:pos radius:r waves:wav amplitude:amp]; +} +@end + +@implementation CCShaky3D (Deprecated) ++(id)actionWithRange:(int)range shakeZ:(BOOL)shakeZ grid:(CGSize)gridSize duration:(ccTime)d +{ + return [self actionWithDuration:d size:gridSize range:range shakeZ:shakeZ]; +} +-(id)initWithRange:(int)range shakeZ:(BOOL)shakeZ grid:(CGSize)gridSize duration:(ccTime)d +{ + return [self initWithDuration:d size:gridSize range:range shakeZ:shakeZ]; +} +@end + +@implementation CCLiquid (Deprecated) ++(id)actionWithWaves:(int)wav amplitude:(float)amp grid:(CGSize)gridSize duration:(ccTime)d +{ + return [self actionWithDuration:d size:gridSize waves:wav amplitude:amp]; +} +-(id)initWithWaves:(int)wav amplitude:(float)amp grid:(CGSize)gridSize duration:(ccTime)d +{ + return [self initWithDuration:d size:gridSize waves:wav amplitude:amp]; +} +@end + +@implementation CCWaves (Deprecated) ++(id)actionWithWaves:(int)wav amplitude:(float)amp horizontal:(BOOL)h vertical:(BOOL)v grid:(CGSize)gridSize duration:(ccTime)d +{ + return [self actionWithDuration:d size:gridSize waves:wav amplitude:amp horizontal:h vertical:v]; +} +-(id)initWithWaves:(int)wav amplitude:(float)amp horizontal:(BOOL)h vertical:(BOOL)v grid:(CGSize)gridSize duration:(ccTime)d +{ + return [self initWithDuration:d size:gridSize waves:wav amplitude:amp horizontal:h vertical:v]; +} +@end + +@implementation CCTwirl (Deprecated) ++(id)actionWithPosition:(CGPoint)pos twirls:(int)t amplitude:(float)amp grid:(CGSize)gridSize duration:(ccTime)d +{ + return [self actionWithDuration:d size:gridSize position:pos twirls:t amplitude:amp]; +} +-(id)initWithPosition:(CGPoint)pos twirls:(int)t amplitude:(float)amp grid:(CGSize)gridSize duration:(ccTime)d +{ + return [self initWithDuration:d size:gridSize position:pos twirls:t amplitude:amp]; +} +@end + +@implementation CCShakyTiles3D (Deprecated) ++(id)actionWithRange:(int)range shakeZ:(BOOL)shakeZ grid:(CGSize)gridSize duration:(ccTime)d +{ + return [self actionWithDuration:d size:gridSize range:range shakeZ:shakeZ]; +} +-(id)initWithRange:(int)range shakeZ:(BOOL)shakeZ grid:(CGSize)gridSize duration:(ccTime)d +{ + return [self initWithDuration:d size:gridSize range:range shakeZ:shakeZ]; +} +@end + +@implementation CCShatteredTiles3D (Deprecated) ++(id)actionWithRange:(int)range shatterZ:(BOOL)shatterZ grid:(CGSize)gridSize duration:(ccTime)d +{ + return [self actionWithDuration:d size:gridSize range:range shatterZ:shatterZ]; +} +-(id)initWithRange:(int)range shatterZ:(BOOL)shatterZ grid:(CGSize)gridSize duration:(ccTime)d +{ + return [self initWithDuration:d size:gridSize range:range shatterZ:shatterZ]; +} +@end + +@implementation CCShuffleTiles (Deprecated) ++(id)actionWithSeed:(int)s grid:(CGSize)gridSize duration:(ccTime)d +{ + return [self actionWithDuration:d size:gridSize seed:s]; +} +-(id)initWithSeed:(int)s grid:(CGSize)gridSize duration:(ccTime)d +{ + return [self initWithDuration:d size:gridSize seed:s]; +} +@end + +@implementation CCTurnOffTiles (Deprecated) ++(id)actionWithSeed:(int)s grid:(CGSize)gridSize duration:(ccTime)d +{ + return [self actionWithDuration:d size:gridSize seed:s]; +} +-(id)initWithSeed:(int)s grid:(CGSize)gridSize duration:(ccTime)d +{ + return [self initWithDuration:d size:gridSize seed:s]; +} +@end + +@implementation CCWavesTiles3D (Deprecated) ++(id)actionWithWaves:(int)wav amplitude:(float)amp grid:(CGSize)gridSize duration:(ccTime)d { - return [self initWithString:string dimensions:dimensions hAlignment:alignment vAlignment:kCCVerticalTextAlignmentTop lineBreakMode:lineBreakMode fontName:name fontSize:size]; + return [self actionWithDuration:d size:gridSize waves:wav amplitude:amp]; } -- (id) initWithString:(NSString*)string dimensions:(CGSize)dimensions alignment:(CCTextAlignment)alignment fontName:(NSString*)name fontSize:(CGFloat)size +-(id)initWithWaves:(int)wav amplitude:(float)amp grid:(CGSize)gridSize duration:(ccTime)d { - return [self initWithString:string dimensions:dimensions hAlignment:alignment vAlignment:kCCVerticalTextAlignmentTop fontName:name fontSize:size]; + return [self initWithDuration:d size:gridSize waves:wav amplitude:amp]; } @end -#if __CC_PLATFORM_IOS +@implementation CCJumpTiles3D (Deprecated) ++(id)actionWithJumps:(int)j amplitude:(float)amp grid:(CGSize)gridSize duration:(ccTime)d +{ + return [self actionWithDuration:d size:gridSize jumps:j amplitude:amp]; +} +-(id)initWithJumps:(int)j amplitude:(float)amp grid:(CGSize)gridSize duration:(ccTime)d +{ + return [self initWithDuration:d size:gridSize jumps:j amplitude:amp]; +} +@end + +@implementation CCSplitRows (Deprecated) ++(id)actionWithRows:(int)rows duration:(ccTime)duration +{ + return [self actionWithDuration:duration rows:rows]; +} +-(id)initWithRows:(int)rows duration:(ccTime)duration +{ + return [self initWithDuration:duration rows:rows]; +} +@end + +@implementation CCSplitCols (Deprecated) ++(id)actionWithCols:(int)cols duration:(ccTime)duration +{ + return [self actionWithDuration:duration cols:cols]; +} +-(id)initWithCols:(int)cols duration:(ccTime)duration +{ + return [self initWithDuration:duration cols:cols]; +} +@end + + +#if defined(__CC_PLATFORM_IOS) @implementation EAGLView @end diff --git a/cocos2d/ccFPSImages.h b/cocos2d/ccFPSImages.h new file mode 100644 index 0000000..ad35566 --- /dev/null +++ b/cocos2d/ccFPSImages.h @@ -0,0 +1,39 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2012 Zynga Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +extern unsigned char cc_fps_images_png[]; +extern unsigned char cc_fps_images_hd_png[]; +extern unsigned char cc_fps_images_ipadhd_png[]; + +#ifdef __cplusplus +extern "C" { +#endif + +unsigned int cc_fps_images_len(void); +unsigned int cc_fps_images_hd_len(void); +unsigned int cc_fps_images_ipadhd_len(void); + +#ifdef __cplusplus +} +#endif diff --git a/cocos2d/ccFPSImages.m b/cocos2d/ccFPSImages.m new file mode 100644 index 0000000..12fc21a --- /dev/null +++ b/cocos2d/ccFPSImages.m @@ -0,0 +1,4537 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2012 Zynga Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#import "ccFPSImages.h" + +unsigned char cc_fps_images_png[] = { + 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, + 0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x20, + 0x08, 0x06, 0x00, 0x00, 0x00, 0xfd, 0xa9, 0xa6, 0xe4, 0x00, 0x00, 0x0a, + 0x43, 0x69, 0x43, 0x43, 0x50, 0x49, 0x43, 0x43, 0x20, 0x70, 0x72, 0x6f, + 0x66, 0x69, 0x6c, 0x65, 0x00, 0x00, 0x78, 0xda, 0x9d, 0x53, 0x77, 0x58, + 0x93, 0xf7, 0x16, 0x3e, 0xdf, 0xf7, 0x65, 0x0f, 0x56, 0x42, 0xd8, 0xf0, + 0xb1, 0x97, 0x6c, 0x81, 0x00, 0x22, 0x23, 0xac, 0x08, 0xc8, 0x10, 0x59, + 0xa2, 0x10, 0x92, 0x00, 0x61, 0x84, 0x10, 0x12, 0x40, 0xc5, 0x85, 0x88, + 0x0a, 0x56, 0x14, 0x15, 0x11, 0x9c, 0x48, 0x55, 0xc4, 0x82, 0xd5, 0x0a, + 0x48, 0x9d, 0x88, 0xe2, 0xa0, 0x28, 0xb8, 0x67, 0x41, 0x8a, 0x88, 0x5a, + 0x8b, 0x55, 0x5c, 0x38, 0xee, 0x1f, 0xdc, 0xa7, 0xb5, 0x7d, 0x7a, 0xef, + 0xed, 0xed, 0xfb, 0xd7, 0xfb, 0xbc, 0xe7, 0x9c, 0xe7, 0xfc, 0xce, 0x79, + 0xcf, 0x0f, 0x80, 0x11, 0x12, 0x26, 0x91, 0xe6, 0xa2, 0x6a, 0x00, 0x39, + 0x52, 0x85, 0x3c, 0x3a, 0xd8, 0x1f, 0x8f, 0x4f, 0x48, 0xc4, 0xc9, 0xbd, + 0x80, 0x02, 0x15, 0x48, 0xe0, 0x04, 0x20, 0x10, 0xe6, 0xcb, 0xc2, 0x67, + 0x05, 0xc5, 0x00, 0x00, 0xf0, 0x03, 0x79, 0x78, 0x7e, 0x74, 0xb0, 0x3f, + 0xfc, 0x01, 0xaf, 0x6f, 0x00, 0x02, 0x00, 0x70, 0xd5, 0x2e, 0x24, 0x12, + 0xc7, 0xe1, 0xff, 0x83, 0xba, 0x50, 0x26, 0x57, 0x00, 0x20, 0x91, 0x00, + 0xe0, 0x22, 0x12, 0xe7, 0x0b, 0x01, 0x90, 0x52, 0x00, 0xc8, 0x2e, 0x54, + 0xc8, 0x14, 0x00, 0xc8, 0x18, 0x00, 0xb0, 0x53, 0xb3, 0x64, 0x0a, 0x00, + 0x94, 0x00, 0x00, 0x6c, 0x79, 0x7c, 0x42, 0x22, 0x00, 0xaa, 0x0d, 0x00, + 0xec, 0xf4, 0x49, 0x3e, 0x05, 0x00, 0xd8, 0xa9, 0x93, 0xdc, 0x17, 0x00, + 0xd8, 0xa2, 0x1c, 0xa9, 0x08, 0x00, 0x8d, 0x01, 0x00, 0x99, 0x28, 0x47, + 0x24, 0x02, 0x40, 0xbb, 0x00, 0x60, 0x55, 0x81, 0x52, 0x2c, 0x02, 0xc0, + 0xc2, 0x00, 0xa0, 0xac, 0x40, 0x22, 0x2e, 0x04, 0xc0, 0xae, 0x01, 0x80, + 0x59, 0xb6, 0x32, 0x47, 0x02, 0x80, 0xbd, 0x05, 0x00, 0x76, 0x8e, 0x58, + 0x90, 0x0f, 0x40, 0x60, 0x00, 0x80, 0x99, 0x42, 0x2c, 0xcc, 0x00, 0x20, + 0x38, 0x02, 0x00, 0x43, 0x1e, 0x13, 0xcd, 0x03, 0x20, 0x4c, 0x03, 0xa0, + 0x30, 0xd2, 0xbf, 0xe0, 0xa9, 0x5f, 0x70, 0x85, 0xb8, 0x48, 0x01, 0x00, + 0xc0, 0xcb, 0x95, 0xcd, 0x97, 0x4b, 0xd2, 0x33, 0x14, 0xb8, 0x95, 0xd0, + 0x1a, 0x77, 0xf2, 0xf0, 0xe0, 0xe2, 0x21, 0xe2, 0xc2, 0x6c, 0xb1, 0x42, + 0x61, 0x17, 0x29, 0x10, 0x66, 0x09, 0xe4, 0x22, 0x9c, 0x97, 0x9b, 0x23, + 0x13, 0x48, 0xe7, 0x03, 0x4c, 0xce, 0x0c, 0x00, 0x00, 0x1a, 0xf9, 0xd1, + 0xc1, 0xfe, 0x38, 0x3f, 0x90, 0xe7, 0xe6, 0xe4, 0xe1, 0xe6, 0x66, 0xe7, + 0x6c, 0xef, 0xf4, 0xc5, 0xa2, 0xfe, 0x6b, 0xf0, 0x6f, 0x22, 0x3e, 0x21, + 0xf1, 0xdf, 0xfe, 0xbc, 0x8c, 0x02, 0x04, 0x00, 0x10, 0x4e, 0xcf, 0xef, + 0xda, 0x5f, 0xe5, 0xe5, 0xd6, 0x03, 0x70, 0xc7, 0x01, 0xb0, 0x75, 0xbf, + 0x6b, 0xa9, 0x5b, 0x00, 0xda, 0x56, 0x00, 0x68, 0xdf, 0xf9, 0x5d, 0x33, + 0xdb, 0x09, 0xa0, 0x5a, 0x0a, 0xd0, 0x7a, 0xf9, 0x8b, 0x79, 0x38, 0xfc, + 0x40, 0x1e, 0x9e, 0xa1, 0x50, 0xc8, 0x3c, 0x1d, 0x1c, 0x0a, 0x0b, 0x0b, + 0xed, 0x25, 0x62, 0xa1, 0xbd, 0x30, 0xe3, 0x8b, 0x3e, 0xff, 0x33, 0xe1, + 0x6f, 0xe0, 0x8b, 0x7e, 0xf6, 0xfc, 0x40, 0x1e, 0xfe, 0xdb, 0x7a, 0xf0, + 0x00, 0x71, 0x9a, 0x40, 0x99, 0xad, 0xc0, 0xa3, 0x83, 0xfd, 0x71, 0x61, + 0x6e, 0x76, 0xae, 0x52, 0x8e, 0xe7, 0xcb, 0x04, 0x42, 0x31, 0x6e, 0xf7, + 0xe7, 0x23, 0xfe, 0xc7, 0x85, 0x7f, 0xfd, 0x8e, 0x29, 0xd1, 0xe2, 0x34, + 0xb1, 0x5c, 0x2c, 0x15, 0x8a, 0xf1, 0x58, 0x89, 0xb8, 0x50, 0x22, 0x4d, + 0xc7, 0x79, 0xb9, 0x52, 0x91, 0x44, 0x21, 0xc9, 0x95, 0xe2, 0x12, 0xe9, + 0x7f, 0x32, 0xf1, 0x1f, 0x96, 0xfd, 0x09, 0x93, 0x77, 0x0d, 0x00, 0xac, + 0x86, 0x4f, 0xc0, 0x4e, 0xb6, 0x07, 0xb5, 0xcb, 0x6c, 0xc0, 0x7e, 0xee, + 0x01, 0x02, 0x8b, 0x0e, 0x58, 0xd2, 0x76, 0x00, 0x40, 0x7e, 0xf3, 0x2d, + 0x8c, 0x1a, 0x0b, 0x91, 0x00, 0x10, 0x67, 0x34, 0x32, 0x79, 0xf7, 0x00, + 0x00, 0x93, 0xbf, 0xf9, 0x8f, 0x40, 0x2b, 0x01, 0x00, 0xcd, 0x97, 0xa4, + 0xe3, 0x00, 0x00, 0xbc, 0xe8, 0x18, 0x5c, 0xa8, 0x94, 0x17, 0x4c, 0xc6, + 0x08, 0x00, 0x00, 0x44, 0xa0, 0x81, 0x2a, 0xb0, 0x41, 0x07, 0x0c, 0xc1, + 0x14, 0xac, 0xc0, 0x0e, 0x9c, 0xc1, 0x1d, 0xbc, 0xc0, 0x17, 0x02, 0x61, + 0x06, 0x44, 0x40, 0x0c, 0x24, 0xc0, 0x3c, 0x10, 0x42, 0x06, 0xe4, 0x80, + 0x1c, 0x0a, 0xa1, 0x18, 0x96, 0x41, 0x19, 0x54, 0xc0, 0x3a, 0xd8, 0x04, + 0xb5, 0xb0, 0x03, 0x1a, 0xa0, 0x11, 0x9a, 0xe1, 0x10, 0xb4, 0xc1, 0x31, + 0x38, 0x0d, 0xe7, 0xe0, 0x12, 0x5c, 0x81, 0xeb, 0x70, 0x17, 0x06, 0x60, + 0x18, 0x9e, 0xc2, 0x18, 0xbc, 0x86, 0x09, 0x04, 0x41, 0xc8, 0x08, 0x13, + 0x61, 0x21, 0x3a, 0x88, 0x11, 0x62, 0x8e, 0xd8, 0x22, 0xce, 0x08, 0x17, + 0x99, 0x8e, 0x04, 0x22, 0x61, 0x48, 0x34, 0x92, 0x80, 0xa4, 0x20, 0xe9, + 0x88, 0x14, 0x51, 0x22, 0xc5, 0xc8, 0x72, 0xa4, 0x02, 0xa9, 0x42, 0x6a, + 0x91, 0x5d, 0x48, 0x23, 0xf2, 0x2d, 0x72, 0x14, 0x39, 0x8d, 0x5c, 0x40, + 0xfa, 0x90, 0xdb, 0xc8, 0x20, 0x32, 0x8a, 0xfc, 0x8a, 0xbc, 0x47, 0x31, + 0x94, 0x81, 0xb2, 0x51, 0x03, 0xd4, 0x02, 0x75, 0x40, 0xb9, 0xa8, 0x1f, + 0x1a, 0x8a, 0xc6, 0xa0, 0x73, 0xd1, 0x74, 0x34, 0x0f, 0x5d, 0x80, 0x96, + 0xa2, 0x6b, 0xd1, 0x1a, 0xb4, 0x1e, 0x3d, 0x80, 0xb6, 0xa2, 0xa7, 0xd1, + 0x4b, 0xe8, 0x75, 0x74, 0x00, 0x7d, 0x8a, 0x8e, 0x63, 0x80, 0xd1, 0x31, + 0x0e, 0x66, 0x8c, 0xd9, 0x61, 0x5c, 0x8c, 0x87, 0x45, 0x60, 0x89, 0x58, + 0x1a, 0x26, 0xc7, 0x16, 0x63, 0xe5, 0x58, 0x35, 0x56, 0x8f, 0x35, 0x63, + 0x1d, 0x58, 0x37, 0x76, 0x15, 0x1b, 0xc0, 0x9e, 0x61, 0xef, 0x08, 0x24, + 0x02, 0x8b, 0x80, 0x13, 0xec, 0x08, 0x5e, 0x84, 0x10, 0xc2, 0x6c, 0x82, + 0x90, 0x90, 0x47, 0x58, 0x4c, 0x58, 0x43, 0xa8, 0x25, 0xec, 0x23, 0xb4, + 0x12, 0xba, 0x08, 0x57, 0x09, 0x83, 0x84, 0x31, 0xc2, 0x27, 0x22, 0x93, + 0xa8, 0x4f, 0xb4, 0x25, 0x7a, 0x12, 0xf9, 0xc4, 0x78, 0x62, 0x3a, 0xb1, + 0x90, 0x58, 0x46, 0xac, 0x26, 0xee, 0x21, 0x1e, 0x21, 0x9e, 0x25, 0x5e, + 0x27, 0x0e, 0x13, 0x5f, 0x93, 0x48, 0x24, 0x0e, 0xc9, 0x92, 0xe4, 0x4e, + 0x0a, 0x21, 0x25, 0x90, 0x32, 0x49, 0x0b, 0x49, 0x6b, 0x48, 0xdb, 0x48, + 0x2d, 0xa4, 0x53, 0xa4, 0x3e, 0xd2, 0x10, 0x69, 0x9c, 0x4c, 0x26, 0xeb, + 0x90, 0x6d, 0xc9, 0xde, 0xe4, 0x08, 0xb2, 0x80, 0xac, 0x20, 0x97, 0x91, + 0xb7, 0x90, 0x0f, 0x90, 0x4f, 0x92, 0xfb, 0xc9, 0xc3, 0xe4, 0xb7, 0x14, + 0x3a, 0xc5, 0x88, 0xe2, 0x4c, 0x09, 0xa2, 0x24, 0x52, 0xa4, 0x94, 0x12, + 0x4a, 0x35, 0x65, 0x3f, 0xe5, 0x04, 0xa5, 0x9f, 0x32, 0x42, 0x99, 0xa0, + 0xaa, 0x51, 0xcd, 0xa9, 0x9e, 0xd4, 0x08, 0xaa, 0x88, 0x3a, 0x9f, 0x5a, + 0x49, 0x6d, 0xa0, 0x76, 0x50, 0x2f, 0x53, 0x87, 0xa9, 0x13, 0x34, 0x75, + 0x9a, 0x25, 0xcd, 0x9b, 0x16, 0x43, 0xcb, 0xa4, 0x2d, 0xa3, 0xd5, 0xd0, + 0x9a, 0x69, 0x67, 0x69, 0xf7, 0x68, 0x2f, 0xe9, 0x74, 0xba, 0x09, 0xdd, + 0x83, 0x1e, 0x45, 0x97, 0xd0, 0x97, 0xd2, 0x6b, 0xe8, 0x07, 0xe9, 0xe7, + 0xe9, 0x83, 0xf4, 0x77, 0x0c, 0x0d, 0x86, 0x0d, 0x83, 0xc7, 0x48, 0x62, + 0x28, 0x19, 0x6b, 0x19, 0x7b, 0x19, 0xa7, 0x18, 0xb7, 0x19, 0x2f, 0x99, + 0x4c, 0xa6, 0x05, 0xd3, 0x97, 0x99, 0xc8, 0x54, 0x30, 0xd7, 0x32, 0x1b, + 0x99, 0x67, 0x98, 0x0f, 0x98, 0x6f, 0x55, 0x58, 0x2a, 0xf6, 0x2a, 0x7c, + 0x15, 0x91, 0xca, 0x12, 0x95, 0x3a, 0x95, 0x56, 0x95, 0x7e, 0x95, 0xe7, + 0xaa, 0x54, 0x55, 0x73, 0x55, 0x3f, 0xd5, 0x79, 0xaa, 0x0b, 0x54, 0xab, + 0x55, 0x0f, 0xab, 0x5e, 0x56, 0x7d, 0xa6, 0x46, 0x55, 0xb3, 0x50, 0xe3, + 0xa9, 0x09, 0xd4, 0x16, 0xab, 0xd5, 0xa9, 0x1d, 0x55, 0xbb, 0xa9, 0x36, + 0xae, 0xce, 0x52, 0x77, 0x52, 0x8f, 0x50, 0xcf, 0x51, 0x5f, 0xa3, 0xbe, + 0x5f, 0xfd, 0x82, 0xfa, 0x63, 0x0d, 0xb2, 0x86, 0x85, 0x46, 0xa0, 0x86, + 0x48, 0xa3, 0x54, 0x63, 0xb7, 0xc6, 0x19, 0x8d, 0x21, 0x16, 0xc6, 0x32, + 0x65, 0xf1, 0x58, 0x42, 0xd6, 0x72, 0x56, 0x03, 0xeb, 0x2c, 0x6b, 0x98, + 0x4d, 0x62, 0x5b, 0xb2, 0xf9, 0xec, 0x4c, 0x76, 0x05, 0xfb, 0x1b, 0x76, + 0x2f, 0x7b, 0x4c, 0x53, 0x43, 0x73, 0xaa, 0x66, 0xac, 0x66, 0x91, 0x66, + 0x9d, 0xe6, 0x71, 0xcd, 0x01, 0x0e, 0xc6, 0xb1, 0xe0, 0xf0, 0x39, 0xd9, + 0x9c, 0x4a, 0xce, 0x21, 0xce, 0x0d, 0xce, 0x7b, 0x2d, 0x03, 0x2d, 0x3f, + 0x2d, 0xb1, 0xd6, 0x6a, 0xad, 0x66, 0xad, 0x7e, 0xad, 0x37, 0xda, 0x7a, + 0xda, 0xbe, 0xda, 0x62, 0xed, 0x72, 0xed, 0x16, 0xed, 0xeb, 0xda, 0xef, + 0x75, 0x70, 0x9d, 0x40, 0x9d, 0x2c, 0x9d, 0xf5, 0x3a, 0x6d, 0x3a, 0xf7, + 0x75, 0x09, 0xba, 0x36, 0xba, 0x51, 0xba, 0x85, 0xba, 0xdb, 0x75, 0xcf, + 0xea, 0x3e, 0xd3, 0x63, 0xeb, 0x79, 0xe9, 0x09, 0xf5, 0xca, 0xf5, 0x0e, + 0xe9, 0xdd, 0xd1, 0x47, 0xf5, 0x6d, 0xf4, 0xa3, 0xf5, 0x17, 0xea, 0xef, + 0xd6, 0xef, 0xd1, 0x1f, 0x37, 0x30, 0x34, 0x08, 0x36, 0x90, 0x19, 0x6c, + 0x31, 0x38, 0x63, 0xf0, 0xcc, 0x90, 0x63, 0xe8, 0x6b, 0x98, 0x69, 0xb8, + 0xd1, 0xf0, 0x84, 0xe1, 0xa8, 0x11, 0xcb, 0x68, 0xba, 0x91, 0xc4, 0x68, + 0xa3, 0xd1, 0x49, 0xa3, 0x27, 0xb8, 0x26, 0xee, 0x87, 0x67, 0xe3, 0x35, + 0x78, 0x17, 0x3e, 0x66, 0xac, 0x6f, 0x1c, 0x62, 0xac, 0x34, 0xde, 0x65, + 0xdc, 0x6b, 0x3c, 0x61, 0x62, 0x69, 0x32, 0xdb, 0xa4, 0xc4, 0xa4, 0xc5, + 0xe4, 0xbe, 0x29, 0xcd, 0x94, 0x6b, 0x9a, 0x66, 0xba, 0xd1, 0xb4, 0xd3, + 0x74, 0xcc, 0xcc, 0xc8, 0x2c, 0xdc, 0xac, 0xd8, 0xac, 0xc9, 0xec, 0x8e, + 0x39, 0xd5, 0x9c, 0x6b, 0x9e, 0x61, 0xbe, 0xd9, 0xbc, 0xdb, 0xfc, 0x8d, + 0x85, 0xa5, 0x45, 0x9c, 0xc5, 0x4a, 0x8b, 0x36, 0x8b, 0xc7, 0x96, 0xda, + 0x96, 0x7c, 0xcb, 0x05, 0x96, 0x4d, 0x96, 0xf7, 0xac, 0x98, 0x56, 0x3e, + 0x56, 0x79, 0x56, 0xf5, 0x56, 0xd7, 0xac, 0x49, 0xd6, 0x5c, 0xeb, 0x2c, + 0xeb, 0x6d, 0xd6, 0x57, 0x6c, 0x50, 0x1b, 0x57, 0x9b, 0x0c, 0x9b, 0x3a, + 0x9b, 0xcb, 0xb6, 0xa8, 0xad, 0x9b, 0xad, 0xc4, 0x76, 0x9b, 0x6d, 0xdf, + 0x14, 0xe2, 0x14, 0x8f, 0x29, 0xd2, 0x29, 0xf5, 0x53, 0x6e, 0xda, 0x31, + 0xec, 0xfc, 0xec, 0x0a, 0xec, 0x9a, 0xec, 0x06, 0xed, 0x39, 0xf6, 0x61, + 0xf6, 0x25, 0xf6, 0x6d, 0xf6, 0xcf, 0x1d, 0xcc, 0x1c, 0x12, 0x1d, 0xd6, + 0x3b, 0x74, 0x3b, 0x7c, 0x72, 0x74, 0x75, 0xcc, 0x76, 0x6c, 0x70, 0xbc, + 0xeb, 0xa4, 0xe1, 0x34, 0xc3, 0xa9, 0xc4, 0xa9, 0xc3, 0xe9, 0x57, 0x67, + 0x1b, 0x67, 0xa1, 0x73, 0x9d, 0xf3, 0x35, 0x17, 0xa6, 0x4b, 0x90, 0xcb, + 0x12, 0x97, 0x76, 0x97, 0x17, 0x53, 0x6d, 0xa7, 0x8a, 0xa7, 0x6e, 0x9f, + 0x7a, 0xcb, 0x95, 0xe5, 0x1a, 0xee, 0xba, 0xd2, 0xb5, 0xd3, 0xf5, 0xa3, + 0x9b, 0xbb, 0x9b, 0xdc, 0xad, 0xd9, 0x6d, 0xd4, 0xdd, 0xcc, 0x3d, 0xc5, + 0x7d, 0xab, 0xfb, 0x4d, 0x2e, 0x9b, 0x1b, 0xc9, 0x5d, 0xc3, 0x3d, 0xef, + 0x41, 0xf4, 0xf0, 0xf7, 0x58, 0xe2, 0x71, 0xcc, 0xe3, 0x9d, 0xa7, 0x9b, + 0xa7, 0xc2, 0xf3, 0x90, 0xe7, 0x2f, 0x5e, 0x76, 0x5e, 0x59, 0x5e, 0xfb, + 0xbd, 0x1e, 0x4f, 0xb3, 0x9c, 0x26, 0x9e, 0xd6, 0x30, 0x6d, 0xc8, 0xdb, + 0xc4, 0x5b, 0xe0, 0xbd, 0xcb, 0x7b, 0x60, 0x3a, 0x3e, 0x3d, 0x65, 0xfa, + 0xce, 0xe9, 0x03, 0x3e, 0xc6, 0x3e, 0x02, 0x9f, 0x7a, 0x9f, 0x87, 0xbe, + 0xa6, 0xbe, 0x22, 0xdf, 0x3d, 0xbe, 0x23, 0x7e, 0xd6, 0x7e, 0x99, 0x7e, + 0x07, 0xfc, 0x9e, 0xfb, 0x3b, 0xfa, 0xcb, 0xfd, 0x8f, 0xf8, 0xbf, 0xe1, + 0x79, 0xf2, 0x16, 0xf1, 0x4e, 0x05, 0x60, 0x01, 0xc1, 0x01, 0xe5, 0x01, + 0xbd, 0x81, 0x1a, 0x81, 0xb3, 0x03, 0x6b, 0x03, 0x1f, 0x04, 0x99, 0x04, + 0xa5, 0x07, 0x35, 0x05, 0x8d, 0x05, 0xbb, 0x06, 0x2f, 0x0c, 0x3e, 0x15, + 0x42, 0x0c, 0x09, 0x0d, 0x59, 0x1f, 0x72, 0x93, 0x6f, 0xc0, 0x17, 0xf2, + 0x1b, 0xf9, 0x63, 0x33, 0xdc, 0x67, 0x2c, 0x9a, 0xd1, 0x15, 0xca, 0x08, + 0x9d, 0x15, 0x5a, 0x1b, 0xfa, 0x30, 0xcc, 0x26, 0x4c, 0x1e, 0xd6, 0x11, + 0x8e, 0x86, 0xcf, 0x08, 0xdf, 0x10, 0x7e, 0x6f, 0xa6, 0xf9, 0x4c, 0xe9, + 0xcc, 0xb6, 0x08, 0x88, 0xe0, 0x47, 0x6c, 0x88, 0xb8, 0x1f, 0x69, 0x19, + 0x99, 0x17, 0xf9, 0x7d, 0x14, 0x29, 0x2a, 0x32, 0xaa, 0x2e, 0xea, 0x51, + 0xb4, 0x53, 0x74, 0x71, 0x74, 0xf7, 0x2c, 0xd6, 0xac, 0xe4, 0x59, 0xfb, + 0x67, 0xbd, 0x8e, 0xf1, 0x8f, 0xa9, 0x8c, 0xb9, 0x3b, 0xdb, 0x6a, 0xb6, + 0x72, 0x76, 0x67, 0xac, 0x6a, 0x6c, 0x52, 0x6c, 0x63, 0xec, 0x9b, 0xb8, + 0x80, 0xb8, 0xaa, 0xb8, 0x81, 0x78, 0x87, 0xf8, 0x45, 0xf1, 0x97, 0x12, + 0x74, 0x13, 0x24, 0x09, 0xed, 0x89, 0xe4, 0xc4, 0xd8, 0xc4, 0x3d, 0x89, + 0xe3, 0x73, 0x02, 0xe7, 0x6c, 0x9a, 0x33, 0x9c, 0xe4, 0x9a, 0x54, 0x96, + 0x74, 0x63, 0xae, 0xe5, 0xdc, 0xa2, 0xb9, 0x17, 0xe6, 0xe9, 0xce, 0xcb, + 0x9e, 0x77, 0x3c, 0x59, 0x35, 0x59, 0x90, 0x7c, 0x38, 0x85, 0x98, 0x12, + 0x97, 0xb2, 0x3f, 0xe5, 0x83, 0x20, 0x42, 0x50, 0x2f, 0x18, 0x4f, 0xe5, + 0xa7, 0x6e, 0x4d, 0x1d, 0x13, 0xf2, 0x84, 0x9b, 0x85, 0x4f, 0x45, 0xbe, + 0xa2, 0x8d, 0xa2, 0x51, 0xb1, 0xb7, 0xb8, 0x4a, 0x3c, 0x92, 0xe6, 0x9d, + 0x56, 0x95, 0xf6, 0x38, 0xdd, 0x3b, 0x7d, 0x43, 0xfa, 0x68, 0x86, 0x4f, + 0x46, 0x75, 0xc6, 0x33, 0x09, 0x4f, 0x52, 0x2b, 0x79, 0x91, 0x19, 0x92, + 0xb9, 0x23, 0xf3, 0x4d, 0x56, 0x44, 0xd6, 0xde, 0xac, 0xcf, 0xd9, 0x71, + 0xd9, 0x2d, 0x39, 0x94, 0x9c, 0x94, 0x9c, 0xa3, 0x52, 0x0d, 0x69, 0x96, + 0xb4, 0x2b, 0xd7, 0x30, 0xb7, 0x28, 0xb7, 0x4f, 0x66, 0x2b, 0x2b, 0x93, + 0x0d, 0xe4, 0x79, 0xe6, 0x6d, 0xca, 0x1b, 0x93, 0x87, 0xca, 0xf7, 0xe4, + 0x23, 0xf9, 0x73, 0xf3, 0xdb, 0x15, 0x6c, 0x85, 0x4c, 0xd1, 0xa3, 0xb4, + 0x52, 0xae, 0x50, 0x0e, 0x16, 0x4c, 0x2f, 0xa8, 0x2b, 0x78, 0x5b, 0x18, + 0x5b, 0x78, 0xb8, 0x48, 0xbd, 0x48, 0x5a, 0xd4, 0x33, 0xdf, 0x66, 0xfe, + 0xea, 0xf9, 0x23, 0x0b, 0x82, 0x16, 0x7c, 0xbd, 0x90, 0xb0, 0x50, 0xb8, + 0xb0, 0xb3, 0xd8, 0xb8, 0x78, 0x59, 0xf1, 0xe0, 0x22, 0xbf, 0x45, 0xbb, + 0x16, 0x23, 0x8b, 0x53, 0x17, 0x77, 0x2e, 0x31, 0x5d, 0x52, 0xba, 0x64, + 0x78, 0x69, 0xf0, 0xd2, 0x7d, 0xcb, 0x68, 0xcb, 0xb2, 0x96, 0xfd, 0x50, + 0xe2, 0x58, 0x52, 0x55, 0xf2, 0x6a, 0x79, 0xdc, 0xf2, 0x8e, 0x52, 0x83, + 0xd2, 0xa5, 0xa5, 0x43, 0x2b, 0x82, 0x57, 0x34, 0x95, 0xa9, 0x94, 0xc9, + 0xcb, 0x6e, 0xae, 0xf4, 0x5a, 0xb9, 0x63, 0x15, 0x61, 0x95, 0x64, 0x55, + 0xef, 0x6a, 0x97, 0xd5, 0x5b, 0x56, 0x7f, 0x2a, 0x17, 0x95, 0x5f, 0xac, + 0x70, 0xac, 0xa8, 0xae, 0xf8, 0xb0, 0x46, 0xb8, 0xe6, 0xe2, 0x57, 0x4e, + 0x5f, 0xd5, 0x7c, 0xf5, 0x79, 0x6d, 0xda, 0xda, 0xde, 0x4a, 0xb7, 0xca, + 0xed, 0xeb, 0x48, 0xeb, 0xa4, 0xeb, 0x6e, 0xac, 0xf7, 0x59, 0xbf, 0xaf, + 0x4a, 0xbd, 0x6a, 0x41, 0xd5, 0xd0, 0x86, 0xf0, 0x0d, 0xad, 0x1b, 0xf1, + 0x8d, 0xe5, 0x1b, 0x5f, 0x6d, 0x4a, 0xde, 0x74, 0xa1, 0x7a, 0x6a, 0xf5, + 0x8e, 0xcd, 0xb4, 0xcd, 0xca, 0xcd, 0x03, 0x35, 0x61, 0x35, 0xed, 0x5b, + 0xcc, 0xb6, 0xac, 0xdb, 0xf2, 0xa1, 0x36, 0xa3, 0xf6, 0x7a, 0x9d, 0x7f, + 0x5d, 0xcb, 0x56, 0xfd, 0xad, 0xab, 0xb7, 0xbe, 0xd9, 0x26, 0xda, 0xd6, + 0xbf, 0xdd, 0x77, 0x7b, 0xf3, 0x0e, 0x83, 0x1d, 0x15, 0x3b, 0xde, 0xef, + 0x94, 0xec, 0xbc, 0xb5, 0x2b, 0x78, 0x57, 0x6b, 0xbd, 0x45, 0x7d, 0xf5, + 0x6e, 0xd2, 0xee, 0x82, 0xdd, 0x8f, 0x1a, 0x62, 0x1b, 0xba, 0xbf, 0xe6, + 0x7e, 0xdd, 0xb8, 0x47, 0x77, 0x4f, 0xc5, 0x9e, 0x8f, 0x7b, 0xa5, 0x7b, + 0x07, 0xf6, 0x45, 0xef, 0xeb, 0x6a, 0x74, 0x6f, 0x6c, 0xdc, 0xaf, 0xbf, + 0xbf, 0xb2, 0x09, 0x6d, 0x52, 0x36, 0x8d, 0x1e, 0x48, 0x3a, 0x70, 0xe5, + 0x9b, 0x80, 0x6f, 0xda, 0x9b, 0xed, 0x9a, 0x77, 0xb5, 0x70, 0x5a, 0x2a, + 0x0e, 0xc2, 0x41, 0xe5, 0xc1, 0x27, 0xdf, 0xa6, 0x7c, 0x7b, 0xe3, 0x50, + 0xe8, 0xa1, 0xce, 0xc3, 0xdc, 0xc3, 0xcd, 0xdf, 0x99, 0x7f, 0xb7, 0xf5, + 0x08, 0xeb, 0x48, 0x79, 0x2b, 0xd2, 0x3a, 0xbf, 0x75, 0xac, 0x2d, 0xa3, + 0x6d, 0xa0, 0x3d, 0xa1, 0xbd, 0xef, 0xe8, 0x8c, 0xa3, 0x9d, 0x1d, 0x5e, + 0x1d, 0x47, 0xbe, 0xb7, 0xff, 0x7e, 0xef, 0x31, 0xe3, 0x63, 0x75, 0xc7, + 0x35, 0x8f, 0x57, 0x9e, 0xa0, 0x9d, 0x28, 0x3d, 0xf1, 0xf9, 0xe4, 0x82, + 0x93, 0xe3, 0xa7, 0x64, 0xa7, 0x9e, 0x9d, 0x4e, 0x3f, 0x3d, 0xd4, 0x99, + 0xdc, 0x79, 0xf7, 0x4c, 0xfc, 0x99, 0x6b, 0x5d, 0x51, 0x5d, 0xbd, 0x67, + 0x43, 0xcf, 0x9e, 0x3f, 0x17, 0x74, 0xee, 0x4c, 0xb7, 0x5f, 0xf7, 0xc9, + 0xf3, 0xde, 0xe7, 0x8f, 0x5d, 0xf0, 0xbc, 0x70, 0xf4, 0x22, 0xf7, 0x62, + 0xdb, 0x25, 0xb7, 0x4b, 0xad, 0x3d, 0xae, 0x3d, 0x47, 0x7e, 0x70, 0xfd, + 0xe1, 0x48, 0xaf, 0x5b, 0x6f, 0xeb, 0x65, 0xf7, 0xcb, 0xed, 0x57, 0x3c, + 0xae, 0x74, 0xf4, 0x4d, 0xeb, 0x3b, 0xd1, 0xef, 0xd3, 0x7f, 0xfa, 0x6a, + 0xc0, 0xd5, 0x73, 0xd7, 0xf8, 0xd7, 0x2e, 0x5d, 0x9f, 0x79, 0xbd, 0xef, + 0xc6, 0xec, 0x1b, 0xb7, 0x6e, 0x26, 0xdd, 0x1c, 0xb8, 0x25, 0xba, 0xf5, + 0xf8, 0x76, 0xf6, 0xed, 0x17, 0x77, 0x0a, 0xee, 0x4c, 0xdc, 0x5d, 0x7a, + 0x8f, 0x78, 0xaf, 0xfc, 0xbe, 0xda, 0xfd, 0xea, 0x07, 0xfa, 0x0f, 0xea, + 0x7f, 0xb4, 0xfe, 0xb1, 0x65, 0xc0, 0x6d, 0xe0, 0xf8, 0x60, 0xc0, 0x60, + 0xcf, 0xc3, 0x59, 0x0f, 0xef, 0x0e, 0x09, 0x87, 0x9e, 0xfe, 0x94, 0xff, + 0xd3, 0x87, 0xe1, 0xd2, 0x47, 0xcc, 0x47, 0xd5, 0x23, 0x46, 0x23, 0x8d, + 0x8f, 0x9d, 0x1f, 0x1f, 0x1b, 0x0d, 0x1a, 0xbd, 0xf2, 0x64, 0xce, 0x93, + 0xe1, 0xa7, 0xb2, 0xa7, 0x13, 0xcf, 0xca, 0x7e, 0x56, 0xff, 0x79, 0xeb, + 0x73, 0xab, 0xe7, 0xdf, 0xfd, 0xe2, 0xfb, 0x4b, 0xcf, 0x58, 0xfc, 0xd8, + 0xf0, 0x0b, 0xf9, 0x8b, 0xcf, 0xbf, 0xae, 0x79, 0xa9, 0xf3, 0x72, 0xef, + 0xab, 0xa9, 0xaf, 0x3a, 0xc7, 0x23, 0xc7, 0x1f, 0xbc, 0xce, 0x79, 0x3d, + 0xf1, 0xa6, 0xfc, 0xad, 0xce, 0xdb, 0x7d, 0xef, 0xb8, 0xef, 0xba, 0xdf, + 0xc7, 0xbd, 0x1f, 0x99, 0x28, 0xfc, 0x40, 0xfe, 0x50, 0xf3, 0xd1, 0xfa, + 0x63, 0xc7, 0xa7, 0xd0, 0x4f, 0xf7, 0x3e, 0xe7, 0x7c, 0xfe, 0xfc, 0x2f, + 0xf7, 0x84, 0xf3, 0xfb, 0x80, 0x39, 0x25, 0x11, 0x00, 0x00, 0x00, 0x06, + 0x62, 0x4b, 0x47, 0x44, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0xa0, 0xbd, + 0xa7, 0x93, 0x00, 0x00, 0x00, 0x09, 0x70, 0x48, 0x59, 0x73, 0x00, 0x00, + 0x0b, 0x13, 0x00, 0x00, 0x0b, 0x13, 0x01, 0x00, 0x9a, 0x9c, 0x18, 0x00, + 0x00, 0x00, 0x07, 0x74, 0x49, 0x4d, 0x45, 0x07, 0xdc, 0x02, 0x07, 0x10, + 0x2f, 0x1c, 0x54, 0x04, 0xda, 0x7f, 0x00, 0x00, 0x10, 0x67, 0x49, 0x44, + 0x41, 0x54, 0x78, 0xda, 0xed, 0x9b, 0x7b, 0x74, 0x15, 0x55, 0x96, 0xc6, + 0xbf, 0x53, 0x75, 0xef, 0xcd, 0xbd, 0x79, 0x12, 0xf2, 0x20, 0xa0, 0x04, + 0x3a, 0x22, 0x12, 0x12, 0xd3, 0xe1, 0x25, 0x32, 0x40, 0x62, 0xec, 0x81, + 0x0e, 0x68, 0x56, 0x8c, 0x01, 0x31, 0xe2, 0x20, 0x06, 0x06, 0x1c, 0x40, + 0xe3, 0x00, 0x01, 0x6d, 0x50, 0x0c, 0x59, 0x40, 0x1e, 0xca, 0x43, 0x02, + 0x33, 0xe1, 0xd1, 0x4d, 0xc0, 0x51, 0x5a, 0x43, 0x47, 0xda, 0x5e, 0x66, + 0xa1, 0x2d, 0x0b, 0x08, 0x2a, 0xd0, 0x4e, 0x46, 0x1e, 0x41, 0x60, 0x50, + 0x48, 0x20, 0x08, 0x81, 0x84, 0x57, 0x12, 0x92, 0x9b, 0x5b, 0xf5, 0xcd, + 0x1f, 0x9c, 0xd2, 0xe2, 0x7a, 0x11, 0xed, 0xf6, 0x8f, 0x11, 0xeb, 0xb7, + 0xd6, 0x5d, 0x21, 0xe1, 0xd4, 0xa9, 0xbd, 0xcf, 0xad, 0xfd, 0x9d, 0x7d, + 0xf6, 0x39, 0x05, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, + 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, + 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, + 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, + 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, + 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0xfc, 0x7f, 0x43, 0xfc, 0xc4, 0x7d, + 0xa9, 0xf2, 0xa7, 0x2e, 0x3f, 0xf4, 0xd1, 0x4e, 0xf5, 0x6a, 0xa7, 0xc9, + 0x9f, 0xdf, 0x87, 0x0a, 0x40, 0x91, 0xfd, 0x69, 0x37, 0xe9, 0xd7, 0x6c, + 0x83, 0x22, 0x7f, 0xd7, 0x01, 0x78, 0x7e, 0x40, 0xdf, 0xaa, 0xa9, 0xbd, + 0xfe, 0x03, 0xec, 0x51, 0xe4, 0xe7, 0x56, 0xbe, 0x9a, 0xdb, 0x19, 0x50, + 0x7e, 0x7c, 0x5d, 0x23, 0xbc, 0xec, 0xd1, 0x6e, 0xe2, 0xaf, 0x30, 0xf5, + 0xed, 0x8b, 0x5b, 0xd9, 0x64, 0xfb, 0x11, 0xe3, 0x6f, 0xfe, 0xbe, 0x28, + 0xc7, 0x53, 0xb7, 0x42, 0xe7, 0xf6, 0x40, 0xfd, 0xa9, 0x82, 0xdf, 0x6e, + 0xb7, 0x07, 0xe8, 0xba, 0xde, 0x05, 0x40, 0x4f, 0x00, 0x54, 0x14, 0xa5, + 0x9d, 0xa4, 0x66, 0x7e, 0xf0, 0x14, 0x45, 0x09, 0x20, 0xd9, 0x19, 0x40, + 0x6f, 0x00, 0x7d, 0x01, 0x38, 0x65, 0x5b, 0x92, 0xf4, 0x19, 0xa8, 0x8a, + 0xa2, 0x38, 0x49, 0x86, 0x03, 0x88, 0x06, 0xa0, 0xda, 0xed, 0x76, 0x8f, + 0xae, 0xeb, 0x1d, 0x3e, 0xda, 0xf9, 0x91, 0x0c, 0x05, 0xd0, 0x15, 0x40, + 0x02, 0x80, 0x48, 0x00, 0x14, 0x42, 0x28, 0x37, 0x79, 0x68, 0x55, 0x21, + 0x44, 0x30, 0x00, 0xc3, 0x9e, 0xde, 0x00, 0xec, 0x00, 0x84, 0xa2, 0x28, + 0xba, 0x97, 0xed, 0xdf, 0x3a, 0x2a, 0x84, 0x1d, 0x40, 0xa8, 0xbc, 0x2e, + 0x1c, 0x80, 0x6e, 0xb7, 0xdb, 0x85, 0xb7, 0x4d, 0xaa, 0xaa, 0xfa, 0x91, + 0x0c, 0x94, 0x76, 0x74, 0x01, 0x10, 0x26, 0x3f, 0xc1, 0x00, 0xe8, 0xe7, + 0xe7, 0xa7, 0x6a, 0x9a, 0x66, 0xbe, 0xc6, 0x26, 0x84, 0x08, 0x01, 0x10, + 0x01, 0x60, 0x20, 0x80, 0xbb, 0x01, 0xe8, 0x0e, 0x87, 0x43, 0x68, 0x9a, + 0x66, 0x08, 0x01, 0x84, 0x10, 0x2a, 0x80, 0x40, 0x00, 0x9d, 0x00, 0x74, + 0x93, 0x36, 0x84, 0x99, 0x3e, 0x21, 0x00, 0x84, 0xd3, 0xe9, 0x54, 0x3c, + 0x1e, 0x8f, 0xc7, 0x24, 0x02, 0x8a, 0x10, 0x22, 0x50, 0xb6, 0xbf, 0x0b, + 0xc0, 0x3d, 0x72, 0xfc, 0x0d, 0x7f, 0xbd, 0xc7, 0x5f, 0x11, 0x42, 0x04, + 0xc9, 0xf6, 0x7d, 0x01, 0xc4, 0x1b, 0x62, 0xf6, 0x7d, 0xe3, 0x63, 0xf1, + 0xf3, 0xc2, 0xf6, 0x53, 0x09, 0x49, 0x47, 0x47, 0x47, 0xd0, 0x43, 0x0f, + 0x3d, 0xb4, 0x63, 0xe6, 0xcc, 0x99, 0x3d, 0x47, 0x8d, 0x1a, 0xb5, 0xd1, + 0xed, 0x76, 0xff, 0xeb, 0x8d, 0x71, 0x23, 0x02, 0x75, 0x5d, 0x8f, 0x4d, + 0x49, 0x49, 0x59, 0x9b, 0x9d, 0x9d, 0x7d, 0x6f, 0x97, 0x2e, 0x5d, 0x70, + 0xf2, 0xe4, 0x49, 0xcc, 0x9f, 0x3f, 0xff, 0xe3, 0x86, 0x86, 0x86, 0x09, + 0xaa, 0xaa, 0x9e, 0xd5, 0x34, 0xad, 0xd5, 0x6b, 0x26, 0xf4, 0xd3, 0x75, + 0x3d, 0x22, 0x2a, 0x2a, 0x6a, 0xf5, 0xda, 0xb5, 0x6b, 0x47, 0x95, 0x94, + 0x94, 0x7c, 0xb5, 0x6d, 0xdb, 0xb6, 0x01, 0x00, 0xae, 0x99, 0x67, 0x37, + 0x21, 0x84, 0x43, 0xd7, 0xf5, 0x30, 0x55, 0x55, 0xe7, 0x15, 0x14, 0x14, + 0x4c, 0x8b, 0x8d, 0x8d, 0x45, 0x73, 0x73, 0x33, 0x76, 0xef, 0xde, 0xdd, + 0x58, 0x52, 0x52, 0x92, 0xaf, 0x28, 0xca, 0x66, 0x5d, 0xd7, 0x9b, 0x00, + 0x18, 0x01, 0x27, 0x14, 0x45, 0x09, 0xd6, 0x75, 0xfd, 0x9f, 0x32, 0x33, + 0x33, 0x57, 0x67, 0x66, 0x66, 0x46, 0x87, 0x84, 0x84, 0xe0, 0xe4, 0xc9, + 0x93, 0x98, 0x39, 0x73, 0xe6, 0x5f, 0xdb, 0xdb, 0xdb, 0xa7, 0xda, 0x6c, + 0xb6, 0xb3, 0x1e, 0x8f, 0xa7, 0xd5, 0x3b, 0x28, 0x48, 0x86, 0x00, 0x18, + 0x53, 0x58, 0x58, 0xf8, 0x1f, 0xa1, 0xa1, 0xa1, 0xa8, 0xa8, 0xa8, 0x38, + 0x5d, 0x59, 0x59, 0x79, 0xaf, 0x97, 0x4d, 0x42, 0xd3, 0x34, 0x57, 0x42, + 0x42, 0xc2, 0xc6, 0x89, 0x13, 0x27, 0x3e, 0xe4, 0x76, 0xbb, 0x75, 0x21, + 0x04, 0xe5, 0x7d, 0x79, 0xe0, 0xc0, 0x01, 0x65, 0xd3, 0xa6, 0x4d, 0x3d, + 0xe4, 0x35, 0x1e, 0xe9, 0x6b, 0x28, 0xc9, 0x11, 0x39, 0x39, 0x39, 0x6b, + 0xd2, 0xd2, 0xd2, 0x02, 0xec, 0x76, 0x3b, 0xf6, 0xec, 0xd9, 0xc3, 0xb9, + 0x73, 0xe7, 0xbe, 0xa6, 0x28, 0xca, 0x52, 0x92, 0x17, 0x48, 0x76, 0x90, + 0x54, 0x01, 0xa4, 0xbc, 0xf2, 0xca, 0x2b, 0xef, 0xba, 0x5c, 0xae, 0x0e, + 0x92, 0xc2, 0x4b, 0x08, 0x59, 0x57, 0x57, 0x67, 0x2f, 0x29, 0x29, 0x49, + 0x04, 0x50, 0x23, 0x85, 0x4f, 0xb1, 0xd9, 0x6c, 0x21, 0x1e, 0x8f, 0x67, + 0x50, 0x7a, 0x7a, 0xfa, 0xea, 0xcc, 0xcc, 0xcc, 0xbb, 0xc2, 0xc2, 0xc2, + 0x50, 0x5f, 0x5f, 0x8f, 0x17, 0x5f, 0x7c, 0xf1, 0xe3, 0xc6, 0xc6, 0xc6, + 0x89, 0x36, 0x9b, 0xed, 0x6b, 0x8f, 0xc7, 0xd3, 0x62, 0x12, 0xeb, 0x4e, + 0xba, 0xae, 0x0f, 0xc8, 0xc8, 0xc8, 0xf8, 0xcf, 0xac, 0xac, 0xac, 0x98, + 0xa8, 0xa8, 0x28, 0x1c, 0x3e, 0x7c, 0x18, 0x33, 0x66, 0xcc, 0xd8, 0xea, + 0xf1, 0x78, 0x72, 0x54, 0x55, 0x3d, 0x6f, 0xfa, 0xbe, 0x2c, 0x7e, 0xe1, + 0x04, 0x01, 0x18, 0xbb, 0x73, 0xe7, 0x4e, 0x56, 0x55, 0x55, 0x11, 0x40, + 0x1a, 0x00, 0x97, 0xe9, 0xff, 0xed, 0x00, 0x7a, 0x0e, 0x1c, 0x38, 0xf0, + 0x6b, 0x4a, 0x76, 0xee, 0xdc, 0x69, 0xfc, 0x93, 0xbd, 0x7b, 0xf7, 0xfe, + 0x40, 0xce, 0xdc, 0x8a, 0x9c, 0x3d, 0x9d, 0xf2, 0xf7, 0x91, 0x00, 0x4a, + 0xb7, 0x6c, 0xd9, 0x42, 0x92, 0x7c, 0xee, 0xb9, 0xe7, 0xea, 0x64, 0x26, + 0xa0, 0x78, 0xa5, 0xc3, 0x61, 0x00, 0x0a, 0xcf, 0x9c, 0x39, 0x43, 0x92, + 0xac, 0xaf, 0xaf, 0x67, 0x53, 0x53, 0x13, 0x49, 0xf2, 0xa3, 0x8f, 0x3e, + 0x22, 0x80, 0x69, 0xc6, 0xcc, 0x28, 0x05, 0xc3, 0x09, 0xe0, 0xd7, 0x63, + 0xc7, 0x8e, 0xf5, 0x90, 0xe4, 0xc5, 0x8b, 0x17, 0xb9, 0x77, 0xef, 0x5e, + 0x92, 0xa4, 0xc7, 0xe3, 0x61, 0xff, 0xfe, 0xfd, 0x77, 0x03, 0x88, 0xf2, + 0xce, 0x90, 0x14, 0x45, 0xf1, 0x07, 0xd0, 0x7f, 0xce, 0x9c, 0x39, 0xed, + 0x86, 0xed, 0x73, 0xe6, 0xcc, 0x39, 0xe7, 0xc3, 0x26, 0x15, 0x40, 0x8f, + 0x59, 0xb3, 0x66, 0x9d, 0xa3, 0x0f, 0xde, 0x7a, 0xeb, 0x2d, 0x9a, 0x32, + 0x0e, 0x63, 0xfc, 0x1e, 0x5e, 0xbc, 0x78, 0x31, 0x49, 0xf2, 0xc8, 0x91, + 0x23, 0xdf, 0xd8, 0x73, 0xec, 0xd8, 0x31, 0x02, 0x98, 0x29, 0xdb, 0x40, + 0xce, 0xda, 0xd3, 0xae, 0x5d, 0xbb, 0xc6, 0x9b, 0x51, 0x5d, 0x5d, 0x4d, + 0x00, 0xa3, 0x00, 0x38, 0x0c, 0x81, 0x04, 0x10, 0x3f, 0x63, 0xc6, 0x8c, + 0x76, 0x92, 0xec, 0xe8, 0xe8, 0xe0, 0xc7, 0x1f, 0x7f, 0xfc, 0x4d, 0xfb, + 0xfb, 0xef, 0xbf, 0xff, 0x6f, 0x72, 0xbc, 0x55, 0xe9, 0xa7, 0x0b, 0xc0, + 0xc0, 0xc7, 0x1e, 0x7b, 0xcc, 0x63, 0xb4, 0x31, 0xec, 0xb9, 0x72, 0xe5, + 0x0a, 0xa3, 0xa3, 0xa3, 0xff, 0xe2, 0x6b, 0x7c, 0x2c, 0x7e, 0x99, 0x28, + 0x00, 0xba, 0x85, 0x86, 0x86, 0x6e, 0x21, 0xc9, 0x09, 0x13, 0x26, 0x9c, + 0x92, 0x29, 0xa6, 0xdd, 0xd4, 0x26, 0x10, 0xc0, 0xd4, 0x9a, 0x9a, 0x1a, + 0x92, 0x64, 0x48, 0x48, 0xc8, 0x61, 0x00, 0x73, 0x87, 0x0f, 0x1f, 0xde, + 0x40, 0x92, 0x1b, 0x37, 0x6e, 0x24, 0x80, 0xa1, 0x32, 0x30, 0x01, 0xc0, + 0x15, 0x13, 0x13, 0xb3, 0x65, 0xd7, 0xae, 0x5d, 0x6c, 0x69, 0x69, 0x21, + 0x49, 0x9d, 0x24, 0xa7, 0x4f, 0x9f, 0x7e, 0x1a, 0xc0, 0xaf, 0x7c, 0x04, + 0x5b, 0xf4, 0xbc, 0x79, 0xf3, 0xae, 0x90, 0xe4, 0x4b, 0x2f, 0xbd, 0xa4, + 0x03, 0x58, 0x0a, 0x60, 0xc3, 0xd6, 0xad, 0x5b, 0x49, 0x92, 0x4f, 0x3d, + 0xf5, 0xd4, 0x49, 0x00, 0x77, 0x98, 0xae, 0x0b, 0x04, 0xb0, 0x84, 0x24, + 0x8f, 0x1f, 0x3f, 0x4e, 0x00, 0xef, 0x00, 0xf8, 0xdd, 0xe3, 0x8f, 0x3f, + 0xde, 0x46, 0x92, 0x6f, 0xbc, 0xf1, 0x06, 0x65, 0x1a, 0xee, 0xf0, 0xba, + 0xcf, 0x9d, 0xc1, 0xc1, 0xc1, 0x5b, 0x48, 0x72, 0xfd, 0xfa, 0xf5, 0x3a, + 0x49, 0xce, 0x9a, 0x35, 0xeb, 0x3c, 0x80, 0x5e, 0x5e, 0xc1, 0x60, 0x07, + 0xd0, 0xf7, 0xd5, 0x57, 0x5f, 0x25, 0x49, 0x02, 0xf8, 0x0c, 0xc0, 0x46, + 0x21, 0xc4, 0x3a, 0x00, 0xab, 0x5c, 0x2e, 0x57, 0x81, 0x14, 0x2d, 0xa3, + 0x5e, 0xd1, 0x6d, 0xf0, 0xe0, 0xc1, 0x7b, 0x48, 0xb2, 0xa2, 0xa2, 0x82, + 0x00, 0x96, 0x01, 0xc8, 0x2f, 0x2a, 0x2a, 0x62, 0x43, 0x43, 0x03, 0xb3, + 0xb2, 0xb2, 0xbe, 0x30, 0x09, 0xaa, 0xa3, 0x53, 0xa7, 0x4e, 0xf7, 0x87, + 0x86, 0x86, 0xbe, 0x19, 0x19, 0x19, 0xf9, 0x76, 0x64, 0x64, 0xe4, 0x96, + 0x88, 0x88, 0x88, 0xbf, 0x38, 0x1c, 0x8e, 0x4f, 0x66, 0xce, 0x9c, 0xa9, + 0x91, 0x64, 0x66, 0x66, 0xe6, 0x69, 0x99, 0xb6, 0x1b, 0x19, 0x5e, 0x00, + 0x80, 0xf9, 0xcd, 0xcd, 0xcd, 0x6c, 0x6b, 0x6b, 0x23, 0x80, 0xdd, 0x00, + 0xe6, 0x24, 0x26, 0x26, 0xd6, 0x92, 0x64, 0x79, 0x79, 0x39, 0x01, 0xdc, + 0x6f, 0xf2, 0xb7, 0xb3, 0xcd, 0x66, 0x5b, 0x4b, 0x92, 0x4d, 0x4d, 0x4d, + 0x04, 0x50, 0x05, 0x60, 0x56, 0xdf, 0xbe, 0x7d, 0x4f, 0x93, 0xe4, 0xdb, + 0x6f, 0xbf, 0x4d, 0x00, 0x0f, 0x08, 0x21, 0x5c, 0xd6, 0xe3, 0x6f, 0xe1, + 0x07, 0x20, 0x3e, 0x3f, 0x3f, 0xdf, 0x2d, 0x1f, 0xf6, 0x65, 0x72, 0x1d, + 0x6b, 0x4e, 0x4d, 0x23, 0xfc, 0xfd, 0xfd, 0x37, 0x91, 0xe4, 0x9e, 0x3d, + 0x7b, 0x08, 0x60, 0xaa, 0x5c, 0x53, 0xae, 0xd2, 0x34, 0x8d, 0x8d, 0x8d, + 0x8d, 0x04, 0x30, 0xdf, 0x34, 0xcb, 0xb9, 0x62, 0x62, 0x62, 0x36, 0x94, + 0x94, 0x94, 0xe8, 0x4b, 0x96, 0x2c, 0xe9, 0xf8, 0xe4, 0x93, 0x4f, 0x34, + 0x93, 0x00, 0xc4, 0x78, 0x09, 0x80, 0x0d, 0xc0, 0x3d, 0x1b, 0x36, 0x6c, + 0x20, 0x49, 0x46, 0x45, 0x45, 0xbd, 0x0b, 0x20, 0x16, 0xc0, 0xb0, 0x29, + 0x53, 0xa6, 0x34, 0x90, 0xe4, 0x8a, 0x15, 0x2b, 0x28, 0x83, 0xd4, 0x08, + 0x08, 0x67, 0x44, 0x44, 0xc4, 0xc6, 0xb2, 0xb2, 0x32, 0x66, 0x65, 0x65, + 0x11, 0xc0, 0xbd, 0x00, 0x1e, 0x08, 0x0f, 0x0f, 0xdf, 0x4e, 0x92, 0xdb, + 0xb6, 0x6d, 0x23, 0x80, 0xdf, 0x78, 0x09, 0x40, 0x27, 0x00, 0x99, 0x95, + 0x95, 0x95, 0x5c, 0xb3, 0x66, 0x8d, 0x67, 0xf2, 0xe4, 0xc9, 0x17, 0x49, + 0x72, 0xf6, 0xec, 0xd9, 0xbe, 0x04, 0xc0, 0x09, 0x20, 0x65, 0xf3, 0xe6, + 0xcd, 0x3c, 0x70, 0xe0, 0x00, 0x01, 0x14, 0x03, 0x78, 0x06, 0x40, 0xba, + 0xbc, 0x57, 0x94, 0x49, 0xec, 0x1c, 0x00, 0xee, 0x5d, 0xb9, 0x72, 0x25, + 0x49, 0x32, 0x21, 0x21, 0xa1, 0x1a, 0xc0, 0x63, 0x00, 0xc6, 0x02, 0x98, + 0x02, 0x60, 0x06, 0x80, 0x24, 0xbb, 0xdd, 0xee, 0x6f, 0xac, 0xa5, 0x64, + 0xff, 0x21, 0xb2, 0xb6, 0x10, 0x0d, 0x60, 0x48, 0x42, 0x42, 0xc2, 0x21, + 0x92, 0x5c, 0xbe, 0x7c, 0x39, 0x01, 0xa4, 0xaa, 0xaa, 0x1a, 0x62, 0xfa, + 0x0e, 0x02, 0x00, 0x2c, 0x32, 0x8d, 0xff, 0x7c, 0x99, 0xa5, 0x55, 0x90, + 0x64, 0x65, 0x65, 0x25, 0x01, 0x3c, 0x68, 0xf2, 0x37, 0x2a, 0x23, 0x23, + 0xa3, 0x9a, 0x24, 0x57, 0xad, 0x5a, 0x45, 0x00, 0x23, 0x00, 0xf4, 0x01, + 0x30, 0xf7, 0xc8, 0x91, 0x23, 0x74, 0xbb, 0xdd, 0x04, 0x50, 0x20, 0x6d, + 0xb0, 0xf8, 0x85, 0x13, 0x0a, 0x60, 0x6e, 0x7d, 0x7d, 0x3d, 0xd7, 0xad, + 0x5b, 0x67, 0xcc, 0xe4, 0xde, 0x33, 0x43, 0xd7, 0xa4, 0xa4, 0xa4, 0x2a, + 0x92, 0xdc, 0xb4, 0x69, 0x13, 0x01, 0xa4, 0xc8, 0xe2, 0x58, 0xce, 0x89, + 0x13, 0x27, 0x48, 0x92, 0x8a, 0xa2, 0xac, 0x95, 0x05, 0x27, 0xa8, 0xaa, + 0xea, 0x90, 0x0f, 0x57, 0x2f, 0x00, 0xe9, 0xc6, 0x4c, 0x7a, 0x13, 0x01, + 0x50, 0x00, 0x84, 0xb9, 0x5c, 0xae, 0x17, 0x01, 0xbc, 0x1c, 0x1c, 0x1c, + 0x3c, 0x42, 0x16, 0xc7, 0x7e, 0xbb, 0x64, 0xc9, 0x12, 0x8d, 0x24, 0x17, + 0x2d, 0x5a, 0xd4, 0x26, 0x8b, 0x93, 0x46, 0x8a, 0xeb, 0x90, 0x01, 0xdd, + 0x03, 0xc0, 0x5d, 0x42, 0x88, 0x2c, 0x00, 0xeb, 0x0a, 0x0b, 0x0b, 0x49, + 0x92, 0x63, 0xc6, 0x8c, 0x39, 0x2f, 0x33, 0x0d, 0x9b, 0x0c, 0x3a, 0x3f, + 0x00, 0x31, 0x23, 0x46, 0x8c, 0xf8, 0x5f, 0x29, 0x72, 0x15, 0xb9, 0xb9, + 0xb9, 0x8d, 0x26, 0x01, 0xb8, 0xcb, 0xcb, 0x26, 0x7f, 0x00, 0xe3, 0xab, + 0xab, 0xab, 0x59, 0x56, 0x56, 0xd6, 0xb1, 0x60, 0xc1, 0x82, 0x8e, 0xbd, + 0x7b, 0xf7, 0xb2, 0xa2, 0xa2, 0x82, 0x83, 0x07, 0x0f, 0x3e, 0x0e, 0x20, + 0x49, 0x06, 0xa8, 0x21, 0x16, 0xe9, 0xdb, 0xb7, 0x6f, 0x37, 0xb2, 0x85, + 0xfa, 0xd2, 0xd2, 0x52, 0xbd, 0xbc, 0xbc, 0x9c, 0x05, 0x05, 0x05, 0xed, + 0x32, 0x9b, 0xe9, 0x61, 0x12, 0x0c, 0xef, 0xec, 0x2b, 0x02, 0x40, 0xde, + 0xa9, 0x53, 0xa7, 0x78, 0xf6, 0xec, 0x59, 0x02, 0x28, 0x34, 0xa7, 0xf3, + 0xa6, 0x25, 0xcf, 0x83, 0xcb, 0x97, 0x2f, 0x27, 0x49, 0x26, 0x27, 0x27, + 0x37, 0x01, 0x78, 0x7f, 0xe9, 0xd2, 0xa5, 0x6e, 0x92, 0x4c, 0x4b, 0x4b, + 0xab, 0x97, 0xe3, 0x63, 0x08, 0x64, 0xd7, 0x09, 0x13, 0x26, 0xd4, 0x90, + 0xe4, 0xeb, 0xaf, 0xbf, 0x4e, 0x00, 0xa9, 0x32, 0xa3, 0xf8, 0xdd, 0xb1, + 0x63, 0xc7, 0x48, 0x92, 0x01, 0x01, 0x01, 0x6f, 0xc8, 0x7b, 0x5b, 0xfc, + 0xc2, 0x77, 0x11, 0x7a, 0x0c, 0x19, 0x32, 0x64, 0x2f, 0x49, 0xf6, 0xeb, + 0xd7, 0x6f, 0xb7, 0x51, 0xad, 0xf7, 0x5a, 0xa3, 0xdf, 0x39, 0x66, 0xcc, + 0x98, 0xfd, 0x24, 0x59, 0x5a, 0x5a, 0x4a, 0x00, 0x83, 0x64, 0x0a, 0x9c, + 0x7d, 0xe8, 0xd0, 0x21, 0x63, 0x59, 0xb0, 0x41, 0x8a, 0x82, 0xf9, 0xe1, + 0xf6, 0x07, 0xd0, 0x6f, 0xd9, 0xb2, 0x65, 0xdf, 0x27, 0x00, 0x42, 0x55, + 0x55, 0x9b, 0x4c, 0x91, 0x43, 0x64, 0xf0, 0x27, 0x0d, 0x1d, 0x3a, 0xb4, + 0x96, 0x24, 0x75, 0x5d, 0x67, 0x58, 0x58, 0xd8, 0x66, 0x1f, 0x59, 0x89, + 0x22, 0x67, 0xbc, 0xd0, 0xe9, 0xd3, 0xa7, 0x5f, 0x31, 0xd6, 0xba, 0x79, + 0x79, 0x79, 0x04, 0xb0, 0xd2, 0x66, 0xb3, 0xdd, 0x85, 0x6f, 0xb7, 0xbf, + 0x22, 0x01, 0x2c, 0xbc, 0x7c, 0xf9, 0x32, 0x9f, 0x7d, 0xf6, 0xd9, 0x26, + 0x00, 0x8f, 0xe5, 0xe6, 0xe6, 0x5e, 0x30, 0x2d, 0x01, 0xee, 0xf1, 0x2a, + 0xa8, 0x06, 0x00, 0xc8, 0xbd, 0x74, 0xe9, 0x12, 0x49, 0xb2, 0xb6, 0xb6, + 0x96, 0x95, 0x95, 0x95, 0xdf, 0xac, 0xb9, 0xc7, 0x8f, 0x1f, 0x7f, 0x19, + 0x40, 0x6f, 0xb9, 0x36, 0x77, 0x01, 0x78, 0xea, 0xe0, 0xc1, 0x83, 0x24, + 0xa9, 0xb7, 0xb7, 0xb7, 0xf3, 0xe8, 0xd1, 0xa3, 0xac, 0xad, 0xad, 0x35, + 0xd7, 0x00, 0x16, 0xca, 0x5d, 0x07, 0xef, 0x1d, 0x09, 0x27, 0x80, 0xc4, + 0xf9, 0xf3, 0xe7, 0xbb, 0x49, 0x32, 0x3d, 0x3d, 0xbd, 0x0e, 0xc0, 0xdd, + 0x52, 0xb0, 0x6e, 0xc8, 0xd2, 0x84, 0x10, 0x09, 0x00, 0x76, 0x9c, 0x3f, + 0x7f, 0xfe, 0x86, 0x7a, 0x81, 0x0c, 0xf0, 0x65, 0x26, 0x7f, 0x01, 0x20, + 0x3c, 0x22, 0x22, 0xa2, 0x9c, 0x24, 0x1b, 0x1b, 0x1b, 0x69, 0xb3, 0xd9, + 0x3e, 0x03, 0xb0, 0xe8, 0xbe, 0xfb, 0xee, 0xfb, 0xe6, 0xe2, 0x9e, 0x3d, + 0x7b, 0x6e, 0x95, 0x19, 0x88, 0xc5, 0x2f, 0x15, 0x21, 0x84, 0x3f, 0x80, + 0xa4, 0xb2, 0xb2, 0x32, 0x9e, 0x38, 0x71, 0xc2, 0x28, 0x56, 0x75, 0xf2, + 0x6e, 0x06, 0xe0, 0xce, 0x47, 0x1f, 0x7d, 0xf4, 0x73, 0x92, 0x5c, 0xb3, + 0x66, 0x0d, 0x01, 0x0c, 0x96, 0x02, 0x30, 0xc9, 0xa8, 0x0b, 0x04, 0x05, + 0x05, 0x79, 0x0b, 0x80, 0xb1, 0x96, 0xbe, 0xf7, 0x16, 0x02, 0x00, 0x53, + 0xa1, 0x2b, 0x0a, 0xc0, 0xd3, 0xd3, 0xa7, 0x4f, 0x6f, 0x31, 0x1e, 0xd4, + 0xb8, 0xb8, 0xb8, 0xaf, 0x01, 0xf4, 0x96, 0x05, 0x3c, 0x73, 0xf0, 0xdb, + 0xe5, 0xec, 0xdb, 0x79, 0xe4, 0xc8, 0x91, 0x15, 0xb3, 0x67, 0xcf, 0xbe, + 0x68, 0xcc, 0x6e, 0xf9, 0xf9, 0xf9, 0x04, 0xf0, 0x80, 0x0c, 0x1c, 0x07, + 0x80, 0xfe, 0x0b, 0x17, 0x2e, 0xf4, 0xd4, 0xd5, 0xd5, 0x11, 0x40, 0x09, + 0x80, 0x09, 0xcf, 0x3f, 0xff, 0x7c, 0x93, 0x2c, 0x4c, 0x36, 0x01, 0xe8, + 0xe7, 0x70, 0x38, 0xcc, 0x7e, 0xfb, 0x05, 0x04, 0x04, 0x4c, 0xcb, 0xcf, + 0xcf, 0xbf, 0x94, 0x9b, 0x9b, 0xdb, 0x06, 0xe0, 0x25, 0x00, 0x53, 0x12, + 0x13, 0x13, 0xcf, 0x99, 0xd6, 0xd5, 0x2f, 0x4a, 0xa1, 0xf0, 0x07, 0x30, + 0xf1, 0xf0, 0xe1, 0xc3, 0x94, 0x82, 0x72, 0x15, 0x40, 0x11, 0x80, 0x15, + 0x6f, 0xbe, 0xf9, 0x26, 0x49, 0xf2, 0x85, 0x17, 0x5e, 0x68, 0x96, 0x33, + 0xb4, 0x77, 0xf1, 0x33, 0x02, 0xc0, 0x6a, 0xa3, 0x70, 0x08, 0x60, 0xb6, + 0x14, 0x0a, 0xef, 0xf3, 0x1d, 0x21, 0x00, 0x72, 0x8d, 0x2c, 0x63, 0xca, + 0x94, 0x29, 0x9e, 0xe4, 0xe4, 0xe4, 0xfd, 0x9b, 0x37, 0x6f, 0x36, 0xfb, + 0x3b, 0x4c, 0x0a, 0x8a, 0x21, 0xbc, 0x29, 0x79, 0x79, 0x79, 0xdf, 0x08, + 0xc5, 0xe9, 0xd3, 0xa7, 0x49, 0x92, 0x47, 0x8f, 0x1e, 0xd5, 0x49, 0xb2, + 0x5b, 0xb7, 0x6e, 0x5b, 0x2c, 0x01, 0xb8, 0x3d, 0xb1, 0xc9, 0x07, 0x20, + 0x14, 0x40, 0xa0, 0xa2, 0x28, 0x7e, 0xf0, 0x7d, 0x60, 0xc8, 0x98, 0x19, + 0x57, 0x92, 0xe4, 0xcb, 0x2f, 0xbf, 0xdc, 0x26, 0xd3, 0x44, 0x87, 0x8f, + 0xb6, 0x5d, 0x87, 0x0c, 0x19, 0xb2, 0xc3, 0x54, 0x01, 0x1f, 0x21, 0x83, + 0x75, 0x76, 0x5d, 0x5d, 0x1d, 0x49, 0x52, 0x08, 0x51, 0x2a, 0x45, 0xc1, + 0x8c, 0xe3, 0x07, 0x0a, 0x80, 0x5d, 0xa6, 0xbd, 0x0b, 0xde, 0x7b, 0xef, + 0x3d, 0x92, 0xe4, 0x17, 0x5f, 0x7c, 0xc1, 0xe8, 0xe8, 0xe8, 0xed, 0x00, + 0xe2, 0x55, 0x55, 0x0d, 0x36, 0xfb, 0xe0, 0x74, 0x3a, 0x03, 0x00, 0xfc, + 0x5a, 0xae, 0xc9, 0x87, 0xca, 0xe0, 0x1a, 0x00, 0xe0, 0x43, 0x5d, 0xd7, + 0x8d, 0x54, 0x7c, 0xa9, 0xac, 0x49, 0xb8, 0x00, 0xcc, 0x6e, 0x69, 0x69, + 0x61, 0x79, 0x79, 0xb9, 0x5e, 0x54, 0x54, 0xd4, 0x56, 0x50, 0x50, 0xe0, + 0x7e, 0xff, 0xfd, 0xf7, 0x75, 0x63, 0xfd, 0x9c, 0x9d, 0x9d, 0x4d, 0x5c, + 0xdf, 0xb7, 0x87, 0x5c, 0xc2, 0xf8, 0x4b, 0x7b, 0xe2, 0x01, 0xc4, 0x2a, + 0x8a, 0xd2, 0x43, 0xda, 0x5d, 0x74, 0xe1, 0xc2, 0x05, 0x63, 0xc9, 0x53, + 0x2a, 0xc5, 0xd2, 0x05, 0x60, 0x4c, 0x55, 0x55, 0x95, 0x71, 0xdf, 0x72, + 0x79, 0xdd, 0x80, 0xd4, 0xd4, 0xd4, 0x43, 0xa6, 0x65, 0xd3, 0x40, 0xaf, + 0x2c, 0xc3, 0x0e, 0xa0, 0x77, 0x6e, 0x6e, 0x6e, 0xb3, 0x14, 0x89, 0x56, + 0x39, 0xfe, 0x7e, 0x3e, 0xc6, 0x3f, 0x2a, 0x3d, 0x3d, 0xbd, 0xda, 0xd4, + 0xd7, 0x54, 0x00, 0xc3, 0x01, 0xac, 0xbf, 0x78, 0xf1, 0x22, 0x4d, 0xb5, + 0x9b, 0x60, 0xd9, 0xaf, 0x5d, 0x08, 0xd1, 0x15, 0xc0, 0xb8, 0x07, 0x1f, + 0x7c, 0xf0, 0x60, 0x69, 0x69, 0x29, 0x57, 0xaf, 0x5e, 0x4d, 0x87, 0xc3, + 0x71, 0xd8, 0xb0, 0x53, 0x16, 0x34, 0xc3, 0xac, 0x70, 0xf9, 0xf9, 0x57, + 0xf0, 0xbd, 0x71, 0x02, 0x98, 0xde, 0xbd, 0x7b, 0xf7, 0x95, 0x11, 0x11, + 0x11, 0xa5, 0xba, 0xae, 0x87, 0xc1, 0xf7, 0x76, 0x8f, 0x0d, 0x40, 0xd0, + 0xa4, 0x49, 0x93, 0x32, 0x01, 0xe0, 0xb5, 0xd7, 0x5e, 0xab, 0x00, 0x70, + 0x11, 0xdf, 0xee, 0xb5, 0x9b, 0xe9, 0xa8, 0xae, 0xae, 0x3e, 0x01, 0x00, + 0x71, 0x71, 0x71, 0x90, 0x0f, 0x78, 0x37, 0x00, 0x7d, 0xba, 0x77, 0xef, + 0x8e, 0xb3, 0x67, 0xcf, 0x82, 0xe4, 0x97, 0x00, 0xdc, 0x7f, 0x4f, 0x22, + 0x22, 0xab, 0xfa, 0xe9, 0x9b, 0x36, 0x6d, 0x7a, 0xe5, 0xe1, 0x87, 0x1f, + 0xc6, 0x8a, 0x15, 0x2b, 0x10, 0x1b, 0x1b, 0xbb, 0xaa, 0xae, 0xae, 0x6e, + 0x01, 0x80, 0x36, 0x4d, 0xd3, 0x84, 0xaa, 0xaa, 0x46, 0x60, 0x88, 0xb6, + 0xb6, 0x36, 0xe5, 0xe9, 0xa7, 0x9f, 0x7e, 0xef, 0xd8, 0xb1, 0x63, 0xef, + 0xe6, 0xe4, 0xe4, 0xec, 0x96, 0x82, 0xd7, 0x01, 0xe0, 0xe0, 0xf9, 0xf3, + 0xe7, 0x8d, 0x8c, 0xc2, 0x85, 0x6f, 0x4f, 0x1f, 0xb6, 0xd5, 0xd6, 0xd6, + 0x62, 0xf8, 0xf0, 0xe1, 0x62, 0xe2, 0xc4, 0x89, 0x7e, 0xd9, 0xd9, 0xd9, + 0xf6, 0x51, 0xa3, 0x46, 0x09, 0x92, 0x4c, 0x4d, 0x4d, 0x45, 0x4a, 0x4a, + 0x0a, 0x4c, 0x05, 0x4c, 0x68, 0x9a, 0xc6, 0xd4, 0xd4, 0xd4, 0xe5, 0xd3, + 0xa6, 0x4d, 0xfb, 0xd3, 0xb0, 0x61, 0xc3, 0xfe, 0xa0, 0xeb, 0xba, 0x43, + 0x8a, 0x99, 0xd3, 0xe1, 0xb8, 0xae, 0x8f, 0xba, 0xae, 0xb7, 0xe2, 0xdb, + 0x93, 0x75, 0x5f, 0xd6, 0xd4, 0xd4, 0x5c, 0x8f, 0x6a, 0xbb, 0xdd, 0x4f, + 0x8e, 0xad, 0x50, 0x14, 0x45, 0x01, 0x80, 0x96, 0x96, 0x16, 0x00, 0x68, + 0xf3, 0x21, 0x8e, 0x43, 0xc7, 0x8d, 0x1b, 0x17, 0x00, 0x00, 0xeb, 0xd7, + 0xaf, 0xff, 0x10, 0xc0, 0x15, 0x1f, 0x63, 0x28, 0x00, 0x28, 0xbd, 0x7a, + 0xf5, 0xea, 0x02, 0x00, 0x17, 0x2e, 0x5c, 0x00, 0x80, 0x5a, 0xd9, 0xf6, + 0x84, 0xe1, 0xaf, 0xd3, 0xe9, 0x0c, 0x34, 0xed, 0x4a, 0x88, 0xf0, 0xf0, + 0xf0, 0x5e, 0x00, 0xe2, 0xb6, 0x6f, 0xdf, 0xfe, 0xd1, 0xd4, 0xa9, 0x53, + 0x47, 0x4f, 0x9b, 0x36, 0xed, 0x61, 0xb7, 0xdb, 0xbd, 0xaf, 0x5f, 0xbf, + 0x7e, 0xa8, 0xad, 0xad, 0x05, 0xc9, 0x83, 0x00, 0xda, 0xad, 0x10, 0xba, + 0xfd, 0x08, 0xcf, 0xce, 0xce, 0x3e, 0x40, 0x92, 0x1f, 0x7c, 0xf0, 0x81, + 0xf7, 0xf6, 0x90, 0x99, 0x20, 0x00, 0xe3, 0x77, 0xed, 0xda, 0x65, 0xb4, + 0x7b, 0x54, 0x06, 0xa2, 0x2f, 0x02, 0x00, 0xfc, 0x8b, 0xb1, 0x97, 0x1c, + 0x13, 0x13, 0x53, 0x0b, 0x60, 0x65, 0x46, 0x46, 0xc6, 0x45, 0xd3, 0xb2, + 0x60, 0x90, 0x8f, 0xd9, 0xcb, 0x01, 0x20, 0xde, 0x94, 0x01, 0x9c, 0xc2, + 0x77, 0xb7, 0x01, 0x6d, 0x00, 0xa2, 0x8d, 0x8a, 0x7f, 0x75, 0x75, 0x35, + 0x13, 0x13, 0x13, 0xcf, 0xa4, 0xa6, 0xa6, 0xd6, 0x8c, 0x1e, 0x3d, 0xfa, + 0x7f, 0xd2, 0xd2, 0xd2, 0xf6, 0x25, 0x24, 0x24, 0x6c, 0x97, 0xa9, 0xb1, + 0x21, 0x64, 0x9d, 0xbb, 0x77, 0xef, 0xfe, 0x0e, 0x49, 0xee, 0xdf, 0xbf, + 0x9f, 0x00, 0xb6, 0x01, 0x28, 0x4c, 0x4e, 0x4e, 0xbe, 0x48, 0x92, 0x9f, + 0x7f, 0xfe, 0x39, 0x01, 0x64, 0x4b, 0x61, 0xb0, 0xfb, 0xf9, 0xf9, 0xdd, + 0x01, 0xe0, 0xdf, 0xe4, 0x12, 0x67, 0x2e, 0x80, 0x82, 0xc9, 0x93, 0x27, + 0xb7, 0x92, 0x64, 0x76, 0x76, 0x76, 0x0b, 0x80, 0x7f, 0x17, 0x42, 0x84, + 0x9b, 0x53, 0xee, 0xf8, 0xf8, 0xf8, 0xad, 0x24, 0xf9, 0xe5, 0x97, 0x5f, + 0x12, 0xc0, 0x56, 0x00, 0xaf, 0xa6, 0xa5, 0xa5, 0x5d, 0x32, 0x8d, 0xeb, + 0x68, 0x39, 0xfb, 0x2b, 0x00, 0xee, 0x48, 0x4a, 0x4a, 0xfa, 0x6f, 0x92, + 0xdc, 0xb0, 0x61, 0x03, 0x01, 0xbc, 0x0e, 0xe0, 0xad, 0x1d, 0x3b, 0x76, + 0x50, 0x16, 0xe9, 0x8e, 0x00, 0xb8, 0xd3, 0xcb, 0xef, 0x70, 0x55, 0x55, + 0xd7, 0x91, 0xe4, 0xb9, 0x73, 0xe7, 0x8c, 0xca, 0x7e, 0xa7, 0x9b, 0x8c, + 0x7f, 0x44, 0x5c, 0x5c, 0xdc, 0x87, 0x24, 0xd9, 0xd0, 0xd0, 0x40, 0x55, + 0x55, 0xf7, 0x02, 0x58, 0x14, 0x17, 0x17, 0x77, 0xc6, 0xf8, 0x9b, 0xf4, + 0xcb, 0x10, 0x01, 0x3f, 0x00, 0x79, 0x2d, 0x2d, 0x2d, 0x46, 0x61, 0x71, + 0x37, 0x80, 0x65, 0x4f, 0x3c, 0xf1, 0xc4, 0x65, 0x92, 0x5c, 0xbc, 0x78, + 0xb1, 0x2e, 0x45, 0xdc, 0x61, 0x85, 0xcb, 0xed, 0x47, 0xa7, 0x94, 0x94, + 0x94, 0x9a, 0xba, 0xba, 0x3a, 0x16, 0x17, 0x17, 0x53, 0xa6, 0xc6, 0x76, + 0x1f, 0xed, 0x22, 0x23, 0x23, 0x23, 0xff, 0x48, 0x92, 0x59, 0x59, 0x59, + 0x5f, 0x99, 0xab, 0xe6, 0x37, 0xc9, 0x16, 0xba, 0x0f, 0x1b, 0x36, 0xac, + 0xc6, 0x58, 0x53, 0x9e, 0x3a, 0x75, 0x8a, 0x24, 0xd9, 0xdc, 0xdc, 0x4c, + 0x97, 0xcb, 0x65, 0xac, 0x27, 0x7d, 0xa5, 0xf6, 0xbd, 0x4a, 0x4a, 0x4a, + 0x48, 0x92, 0x39, 0x39, 0x39, 0xa7, 0x64, 0xe6, 0xa0, 0x78, 0xb5, 0x19, + 0x66, 0xac, 0x6f, 0x7d, 0x51, 0x56, 0x56, 0x46, 0x5c, 0x3f, 0x07, 0x60, + 0x37, 0x09, 0xd2, 0x08, 0xa3, 0xea, 0x6f, 0x5e, 0xe3, 0x92, 0x64, 0x7c, + 0x7c, 0xfc, 0xdf, 0x64, 0xc0, 0xd9, 0xe4, 0x24, 0x6c, 0x14, 0x19, 0x8d, + 0x23, 0xb8, 0x7d, 0xe6, 0xcd, 0x9b, 0xd7, 0x28, 0x53, 0xef, 0xf3, 0x00, + 0x62, 0x64, 0xad, 0xc0, 0x2c, 0x78, 0xbf, 0x2d, 0x2e, 0x2e, 0xa6, 0xb7, + 0xbf, 0x9a, 0xa6, 0x11, 0xc0, 0x9f, 0xbd, 0x2a, 0xf5, 0x41, 0x00, 0x1e, + 0x5d, 0xbd, 0x7a, 0x35, 0x8d, 0xc2, 0x9b, 0x71, 0xd0, 0xe7, 0x9d, 0x77, + 0xde, 0x21, 0x80, 0xa7, 0xe4, 0xb1, 0x65, 0x33, 0x61, 0x29, 0x29, 0x29, + 0x7f, 0x35, 0x1d, 0x76, 0x4a, 0xc5, 0x8d, 0x87, 0xaf, 0xcc, 0x04, 0x02, + 0x78, 0x68, 0xe9, 0xd2, 0xa5, 0xdf, 0xb1, 0x87, 0x24, 0x63, 0x63, 0x63, + 0x4f, 0x00, 0xf8, 0x95, 0xe1, 0x83, 0x2c, 0x22, 0xf6, 0x1d, 0x37, 0x6e, + 0x9c, 0xdb, 0x68, 0x63, 0xec, 0xd6, 0x48, 0x71, 0x5c, 0x20, 0x77, 0x6c, + 0x14, 0x2b, 0x5c, 0x7e, 0xe6, 0x75, 0xbc, 0xef, 0x44, 0xaa, 0xcd, 0xe6, + 0xef, 0xf1, 0x78, 0xee, 0xc6, 0xf5, 0x93, 0x6a, 0x97, 0xfd, 0xfd, 0xfd, + 0xf7, 0xb5, 0xb6, 0xb6, 0x5e, 0xc1, 0x8d, 0x67, 0xe9, 0x05, 0x80, 0xce, + 0xcf, 0x3c, 0xf3, 0xcc, 0x85, 0x49, 0x93, 0x26, 0x61, 0xd0, 0xa0, 0x41, + 0x0b, 0x01, 0x2c, 0x07, 0x70, 0x09, 0xbe, 0x5f, 0x40, 0x11, 0x36, 0x9b, + 0x2d, 0xc0, 0xe3, 0xf1, 0xdc, 0x11, 0x15, 0x15, 0xb5, 0x72, 0xd6, 0xac, + 0x59, 0xbf, 0x09, 0x0a, 0x0a, 0x52, 0xce, 0x9d, 0x3b, 0x77, 0xad, 0xb0, + 0xb0, 0xf0, 0xbf, 0x5a, 0x5b, 0x5b, 0xf3, 0x14, 0x45, 0x69, 0xd4, 0x75, + 0xfd, 0x9a, 0x8f, 0x5d, 0x86, 0xe0, 0x01, 0x03, 0x06, 0x6c, 0x8d, 0x8f, + 0x8f, 0x0f, 0xfe, 0xea, 0xab, 0xaf, 0xf6, 0x57, 0x55, 0x55, 0x3d, 0x2b, + 0xd3, 0x57, 0xb3, 0xb8, 0xf4, 0x49, 0x49, 0x49, 0xf9, 0x63, 0xd7, 0xae, + 0x5d, 0x75, 0x5d, 0xd7, 0x55, 0xb3, 0x0d, 0xaa, 0xaa, 0xea, 0x47, 0x8f, + 0x1e, 0x6d, 0xfe, 0xec, 0xb3, 0xcf, 0x46, 0x03, 0xb8, 0x2a, 0x53, 0x6e, + 0xc5, 0x66, 0xb3, 0x85, 0x7a, 0x3c, 0x9e, 0xe4, 0xe4, 0xe4, 0xe4, 0x97, + 0x32, 0x32, 0x32, 0x12, 0x5d, 0x2e, 0x17, 0x1a, 0x1a, 0x1a, 0xda, 0x8a, + 0x8a, 0x8a, 0xfe, 0x74, 0xf5, 0xea, 0xd5, 0x57, 0x54, 0x55, 0x3d, 0x23, + 0x8f, 0xba, 0xfa, 0xf2, 0x27, 0xa8, 0x4f, 0x9f, 0x3e, 0xbf, 0x1f, 0x32, + 0x64, 0xc8, 0xdd, 0xc7, 0x8f, 0x1f, 0x3f, 0x52, 0x55, 0x55, 0x35, 0x45, + 0xf6, 0x6d, 0xb4, 0x55, 0x6d, 0x36, 0x5b, 0x27, 0xd9, 0x7f, 0xde, 0xd8, + 0xb1, 0x63, 0xe3, 0x5d, 0x2e, 0x17, 0xea, 0xea, 0xea, 0x5a, 0xf3, 0xf2, + 0xf2, 0x36, 0x02, 0x58, 0x2c, 0x84, 0xb8, 0x40, 0xd2, 0xf0, 0x57, 0x55, + 0x14, 0xa5, 0xb3, 0xae, 0xeb, 0xff, 0xfc, 0xe4, 0x93, 0x4f, 0x2e, 0x4e, + 0x4e, 0x4e, 0xee, 0xa9, 0x69, 0x1a, 0x3e, 0xfd, 0xf4, 0xd3, 0xba, 0xb2, + 0xb2, 0xb2, 0x7c, 0x45, 0x51, 0xfe, 0x2c, 0x8f, 0x32, 0x9b, 0xcf, 0xeb, + 0x07, 0x74, 0xee, 0xdc, 0x79, 0xd1, 0x23, 0x8f, 0x3c, 0x92, 0x72, 0xe8, + 0xd0, 0xa1, 0xb6, 0x7d, 0xfb, 0xf6, 0x65, 0x02, 0x38, 0x0b, 0xdf, 0x2f, + 0x3f, 0xa9, 0xaa, 0xaa, 0x86, 0x6a, 0x9a, 0x96, 0x9c, 0x96, 0x96, 0xb6, + 0x70, 0xe4, 0xc8, 0x91, 0x7d, 0xfd, 0xfd, 0xfd, 0xd1, 0xd0, 0xd0, 0xd0, + 0x51, 0x5c, 0x5c, 0xfc, 0x6e, 0x53, 0x53, 0xd3, 0xcb, 0xaa, 0xaa, 0xd6, + 0x6b, 0x9a, 0xd6, 0x2c, 0x7d, 0x50, 0x54, 0x55, 0x0d, 0xd1, 0x34, 0xad, + 0x5f, 0x52, 0x52, 0x52, 0xf1, 0xf8, 0xf1, 0xe3, 0xfb, 0x07, 0x06, 0x06, + 0xe2, 0xe0, 0xc1, 0x83, 0x57, 0x0a, 0x0a, 0x0a, 0x5e, 0x05, 0xb0, 0x5e, + 0xda, 0xef, 0xb6, 0x42, 0xe8, 0x36, 0x13, 0x00, 0xf9, 0x37, 0x9b, 0x0c, + 0x3e, 0xe3, 0x6d, 0x31, 0xef, 0x17, 0x3f, 0x84, 0xd3, 0xe9, 0x0c, 0x68, + 0x6b, 0x6b, 0x1b, 0x20, 0x67, 0x97, 0xbd, 0x42, 0x88, 0x2b, 0xb7, 0x78, + 0x20, 0x84, 0xa2, 0x28, 0x2e, 0x5d, 0xd7, 0x03, 0xe5, 0x8c, 0xe7, 0xc0, + 0xf5, 0xb3, 0xf0, 0xcd, 0x8a, 0xa2, 0x5c, 0xd5, 0x75, 0xdd, 0xd7, 0x7a, + 0x52, 0xa8, 0xaa, 0xea, 0xa7, 0x69, 0x9a, 0x5d, 0xa6, 0xa5, 0xed, 0x36, + 0x9b, 0xad, 0xdd, 0xe3, 0xf1, 0xb8, 0xbd, 0xc4, 0xc5, 0xe5, 0xf1, 0x78, + 0xec, 0xb2, 0x5f, 0xef, 0x59, 0xc9, 0x03, 0xa0, 0x59, 0x55, 0x55, 0xb7, + 0xa6, 0x69, 0xed, 0xb8, 0xf1, 0xe5, 0x98, 0x00, 0xf9, 0xc2, 0x4e, 0x90, + 0xf4, 0xd9, 0xdb, 0x1e, 0x9f, 0x6f, 0x1d, 0xaa, 0xaa, 0xea, 0xd0, 0x34, + 0xcd, 0x4f, 0xfa, 0xe0, 0xf6, 0x61, 0x93, 0x51, 0x5f, 0x09, 0x90, 0x7d, + 0x1b, 0xfd, 0xb7, 0x00, 0xb8, 0xaa, 0x28, 0x4a, 0xb3, 0x0f, 0x7f, 0x6d, + 0xa6, 0xf6, 0xc6, 0x52, 0xaa, 0x05, 0xc0, 0x55, 0x21, 0x44, 0xb3, 0xf7, + 0xcb, 0x3a, 0x42, 0x08, 0x3b, 0x49, 0xa7, 0x1c, 0x97, 0x0e, 0xe9, 0x5f, + 0x1b, 0x6e, 0xfe, 0xa6, 0xa4, 0x51, 0xdc, 0x35, 0xec, 0x51, 0x65, 0x5d, + 0xe1, 0x8a, 0xb4, 0xc7, 0xfb, 0x5a, 0x55, 0x08, 0xe1, 0x22, 0x19, 0x2c, + 0x0b, 0xc2, 0xfe, 0x00, 0x1a, 0x4c, 0xf6, 0x58, 0xc1, 0x7f, 0x9b, 0x0a, + 0xc0, 0x8f, 0x29, 0x20, 0x1a, 0xfb, 0xe4, 0xbe, 0x44, 0xe2, 0xfb, 0xee, + 0xf9, 0x43, 0x5e, 0x1b, 0xf6, 0xbe, 0x86, 0xff, 0x80, 0x2f, 0xbc, 0x85, + 0x1f, 0xca, 0x8f, 0xb4, 0xe7, 0xc7, 0x8e, 0xd3, 0x8f, 0xe9, 0x5f, 0xc1, + 0x8d, 0xaf, 0x03, 0xeb, 0x3f, 0xc1, 0xd8, 0xdc, 0xac, 0xff, 0x5b, 0xbd, + 0x5e, 0xfd, 0xf7, 0xb4, 0xb7, 0xf8, 0x19, 0xf1, 0x7f, 0x2c, 0x2e, 0x06, + 0x08, 0x9c, 0x01, 0xc9, 0x62, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, + 0x44, 0xae, 0x42, 0x60, 0x82 +}; + +unsigned char cc_fps_images_hd_png[] = { + 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, + 0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x40, + 0x08, 0x06, 0x00, 0x00, 0x00, 0x6c, 0xbf, 0xcf, 0xbf, 0x00, 0x00, 0x0a, + 0x43, 0x69, 0x43, 0x43, 0x50, 0x49, 0x43, 0x43, 0x20, 0x70, 0x72, 0x6f, + 0x66, 0x69, 0x6c, 0x65, 0x00, 0x00, 0x78, 0xda, 0x9d, 0x53, 0x77, 0x58, + 0x93, 0xf7, 0x16, 0x3e, 0xdf, 0xf7, 0x65, 0x0f, 0x56, 0x42, 0xd8, 0xf0, + 0xb1, 0x97, 0x6c, 0x81, 0x00, 0x22, 0x23, 0xac, 0x08, 0xc8, 0x10, 0x59, + 0xa2, 0x10, 0x92, 0x00, 0x61, 0x84, 0x10, 0x12, 0x40, 0xc5, 0x85, 0x88, + 0x0a, 0x56, 0x14, 0x15, 0x11, 0x9c, 0x48, 0x55, 0xc4, 0x82, 0xd5, 0x0a, + 0x48, 0x9d, 0x88, 0xe2, 0xa0, 0x28, 0xb8, 0x67, 0x41, 0x8a, 0x88, 0x5a, + 0x8b, 0x55, 0x5c, 0x38, 0xee, 0x1f, 0xdc, 0xa7, 0xb5, 0x7d, 0x7a, 0xef, + 0xed, 0xed, 0xfb, 0xd7, 0xfb, 0xbc, 0xe7, 0x9c, 0xe7, 0xfc, 0xce, 0x79, + 0xcf, 0x0f, 0x80, 0x11, 0x12, 0x26, 0x91, 0xe6, 0xa2, 0x6a, 0x00, 0x39, + 0x52, 0x85, 0x3c, 0x3a, 0xd8, 0x1f, 0x8f, 0x4f, 0x48, 0xc4, 0xc9, 0xbd, + 0x80, 0x02, 0x15, 0x48, 0xe0, 0x04, 0x20, 0x10, 0xe6, 0xcb, 0xc2, 0x67, + 0x05, 0xc5, 0x00, 0x00, 0xf0, 0x03, 0x79, 0x78, 0x7e, 0x74, 0xb0, 0x3f, + 0xfc, 0x01, 0xaf, 0x6f, 0x00, 0x02, 0x00, 0x70, 0xd5, 0x2e, 0x24, 0x12, + 0xc7, 0xe1, 0xff, 0x83, 0xba, 0x50, 0x26, 0x57, 0x00, 0x20, 0x91, 0x00, + 0xe0, 0x22, 0x12, 0xe7, 0x0b, 0x01, 0x90, 0x52, 0x00, 0xc8, 0x2e, 0x54, + 0xc8, 0x14, 0x00, 0xc8, 0x18, 0x00, 0xb0, 0x53, 0xb3, 0x64, 0x0a, 0x00, + 0x94, 0x00, 0x00, 0x6c, 0x79, 0x7c, 0x42, 0x22, 0x00, 0xaa, 0x0d, 0x00, + 0xec, 0xf4, 0x49, 0x3e, 0x05, 0x00, 0xd8, 0xa9, 0x93, 0xdc, 0x17, 0x00, + 0xd8, 0xa2, 0x1c, 0xa9, 0x08, 0x00, 0x8d, 0x01, 0x00, 0x99, 0x28, 0x47, + 0x24, 0x02, 0x40, 0xbb, 0x00, 0x60, 0x55, 0x81, 0x52, 0x2c, 0x02, 0xc0, + 0xc2, 0x00, 0xa0, 0xac, 0x40, 0x22, 0x2e, 0x04, 0xc0, 0xae, 0x01, 0x80, + 0x59, 0xb6, 0x32, 0x47, 0x02, 0x80, 0xbd, 0x05, 0x00, 0x76, 0x8e, 0x58, + 0x90, 0x0f, 0x40, 0x60, 0x00, 0x80, 0x99, 0x42, 0x2c, 0xcc, 0x00, 0x20, + 0x38, 0x02, 0x00, 0x43, 0x1e, 0x13, 0xcd, 0x03, 0x20, 0x4c, 0x03, 0xa0, + 0x30, 0xd2, 0xbf, 0xe0, 0xa9, 0x5f, 0x70, 0x85, 0xb8, 0x48, 0x01, 0x00, + 0xc0, 0xcb, 0x95, 0xcd, 0x97, 0x4b, 0xd2, 0x33, 0x14, 0xb8, 0x95, 0xd0, + 0x1a, 0x77, 0xf2, 0xf0, 0xe0, 0xe2, 0x21, 0xe2, 0xc2, 0x6c, 0xb1, 0x42, + 0x61, 0x17, 0x29, 0x10, 0x66, 0x09, 0xe4, 0x22, 0x9c, 0x97, 0x9b, 0x23, + 0x13, 0x48, 0xe7, 0x03, 0x4c, 0xce, 0x0c, 0x00, 0x00, 0x1a, 0xf9, 0xd1, + 0xc1, 0xfe, 0x38, 0x3f, 0x90, 0xe7, 0xe6, 0xe4, 0xe1, 0xe6, 0x66, 0xe7, + 0x6c, 0xef, 0xf4, 0xc5, 0xa2, 0xfe, 0x6b, 0xf0, 0x6f, 0x22, 0x3e, 0x21, + 0xf1, 0xdf, 0xfe, 0xbc, 0x8c, 0x02, 0x04, 0x00, 0x10, 0x4e, 0xcf, 0xef, + 0xda, 0x5f, 0xe5, 0xe5, 0xd6, 0x03, 0x70, 0xc7, 0x01, 0xb0, 0x75, 0xbf, + 0x6b, 0xa9, 0x5b, 0x00, 0xda, 0x56, 0x00, 0x68, 0xdf, 0xf9, 0x5d, 0x33, + 0xdb, 0x09, 0xa0, 0x5a, 0x0a, 0xd0, 0x7a, 0xf9, 0x8b, 0x79, 0x38, 0xfc, + 0x40, 0x1e, 0x9e, 0xa1, 0x50, 0xc8, 0x3c, 0x1d, 0x1c, 0x0a, 0x0b, 0x0b, + 0xed, 0x25, 0x62, 0xa1, 0xbd, 0x30, 0xe3, 0x8b, 0x3e, 0xff, 0x33, 0xe1, + 0x6f, 0xe0, 0x8b, 0x7e, 0xf6, 0xfc, 0x40, 0x1e, 0xfe, 0xdb, 0x7a, 0xf0, + 0x00, 0x71, 0x9a, 0x40, 0x99, 0xad, 0xc0, 0xa3, 0x83, 0xfd, 0x71, 0x61, + 0x6e, 0x76, 0xae, 0x52, 0x8e, 0xe7, 0xcb, 0x04, 0x42, 0x31, 0x6e, 0xf7, + 0xe7, 0x23, 0xfe, 0xc7, 0x85, 0x7f, 0xfd, 0x8e, 0x29, 0xd1, 0xe2, 0x34, + 0xb1, 0x5c, 0x2c, 0x15, 0x8a, 0xf1, 0x58, 0x89, 0xb8, 0x50, 0x22, 0x4d, + 0xc7, 0x79, 0xb9, 0x52, 0x91, 0x44, 0x21, 0xc9, 0x95, 0xe2, 0x12, 0xe9, + 0x7f, 0x32, 0xf1, 0x1f, 0x96, 0xfd, 0x09, 0x93, 0x77, 0x0d, 0x00, 0xac, + 0x86, 0x4f, 0xc0, 0x4e, 0xb6, 0x07, 0xb5, 0xcb, 0x6c, 0xc0, 0x7e, 0xee, + 0x01, 0x02, 0x8b, 0x0e, 0x58, 0xd2, 0x76, 0x00, 0x40, 0x7e, 0xf3, 0x2d, + 0x8c, 0x1a, 0x0b, 0x91, 0x00, 0x10, 0x67, 0x34, 0x32, 0x79, 0xf7, 0x00, + 0x00, 0x93, 0xbf, 0xf9, 0x8f, 0x40, 0x2b, 0x01, 0x00, 0xcd, 0x97, 0xa4, + 0xe3, 0x00, 0x00, 0xbc, 0xe8, 0x18, 0x5c, 0xa8, 0x94, 0x17, 0x4c, 0xc6, + 0x08, 0x00, 0x00, 0x44, 0xa0, 0x81, 0x2a, 0xb0, 0x41, 0x07, 0x0c, 0xc1, + 0x14, 0xac, 0xc0, 0x0e, 0x9c, 0xc1, 0x1d, 0xbc, 0xc0, 0x17, 0x02, 0x61, + 0x06, 0x44, 0x40, 0x0c, 0x24, 0xc0, 0x3c, 0x10, 0x42, 0x06, 0xe4, 0x80, + 0x1c, 0x0a, 0xa1, 0x18, 0x96, 0x41, 0x19, 0x54, 0xc0, 0x3a, 0xd8, 0x04, + 0xb5, 0xb0, 0x03, 0x1a, 0xa0, 0x11, 0x9a, 0xe1, 0x10, 0xb4, 0xc1, 0x31, + 0x38, 0x0d, 0xe7, 0xe0, 0x12, 0x5c, 0x81, 0xeb, 0x70, 0x17, 0x06, 0x60, + 0x18, 0x9e, 0xc2, 0x18, 0xbc, 0x86, 0x09, 0x04, 0x41, 0xc8, 0x08, 0x13, + 0x61, 0x21, 0x3a, 0x88, 0x11, 0x62, 0x8e, 0xd8, 0x22, 0xce, 0x08, 0x17, + 0x99, 0x8e, 0x04, 0x22, 0x61, 0x48, 0x34, 0x92, 0x80, 0xa4, 0x20, 0xe9, + 0x88, 0x14, 0x51, 0x22, 0xc5, 0xc8, 0x72, 0xa4, 0x02, 0xa9, 0x42, 0x6a, + 0x91, 0x5d, 0x48, 0x23, 0xf2, 0x2d, 0x72, 0x14, 0x39, 0x8d, 0x5c, 0x40, + 0xfa, 0x90, 0xdb, 0xc8, 0x20, 0x32, 0x8a, 0xfc, 0x8a, 0xbc, 0x47, 0x31, + 0x94, 0x81, 0xb2, 0x51, 0x03, 0xd4, 0x02, 0x75, 0x40, 0xb9, 0xa8, 0x1f, + 0x1a, 0x8a, 0xc6, 0xa0, 0x73, 0xd1, 0x74, 0x34, 0x0f, 0x5d, 0x80, 0x96, + 0xa2, 0x6b, 0xd1, 0x1a, 0xb4, 0x1e, 0x3d, 0x80, 0xb6, 0xa2, 0xa7, 0xd1, + 0x4b, 0xe8, 0x75, 0x74, 0x00, 0x7d, 0x8a, 0x8e, 0x63, 0x80, 0xd1, 0x31, + 0x0e, 0x66, 0x8c, 0xd9, 0x61, 0x5c, 0x8c, 0x87, 0x45, 0x60, 0x89, 0x58, + 0x1a, 0x26, 0xc7, 0x16, 0x63, 0xe5, 0x58, 0x35, 0x56, 0x8f, 0x35, 0x63, + 0x1d, 0x58, 0x37, 0x76, 0x15, 0x1b, 0xc0, 0x9e, 0x61, 0xef, 0x08, 0x24, + 0x02, 0x8b, 0x80, 0x13, 0xec, 0x08, 0x5e, 0x84, 0x10, 0xc2, 0x6c, 0x82, + 0x90, 0x90, 0x47, 0x58, 0x4c, 0x58, 0x43, 0xa8, 0x25, 0xec, 0x23, 0xb4, + 0x12, 0xba, 0x08, 0x57, 0x09, 0x83, 0x84, 0x31, 0xc2, 0x27, 0x22, 0x93, + 0xa8, 0x4f, 0xb4, 0x25, 0x7a, 0x12, 0xf9, 0xc4, 0x78, 0x62, 0x3a, 0xb1, + 0x90, 0x58, 0x46, 0xac, 0x26, 0xee, 0x21, 0x1e, 0x21, 0x9e, 0x25, 0x5e, + 0x27, 0x0e, 0x13, 0x5f, 0x93, 0x48, 0x24, 0x0e, 0xc9, 0x92, 0xe4, 0x4e, + 0x0a, 0x21, 0x25, 0x90, 0x32, 0x49, 0x0b, 0x49, 0x6b, 0x48, 0xdb, 0x48, + 0x2d, 0xa4, 0x53, 0xa4, 0x3e, 0xd2, 0x10, 0x69, 0x9c, 0x4c, 0x26, 0xeb, + 0x90, 0x6d, 0xc9, 0xde, 0xe4, 0x08, 0xb2, 0x80, 0xac, 0x20, 0x97, 0x91, + 0xb7, 0x90, 0x0f, 0x90, 0x4f, 0x92, 0xfb, 0xc9, 0xc3, 0xe4, 0xb7, 0x14, + 0x3a, 0xc5, 0x88, 0xe2, 0x4c, 0x09, 0xa2, 0x24, 0x52, 0xa4, 0x94, 0x12, + 0x4a, 0x35, 0x65, 0x3f, 0xe5, 0x04, 0xa5, 0x9f, 0x32, 0x42, 0x99, 0xa0, + 0xaa, 0x51, 0xcd, 0xa9, 0x9e, 0xd4, 0x08, 0xaa, 0x88, 0x3a, 0x9f, 0x5a, + 0x49, 0x6d, 0xa0, 0x76, 0x50, 0x2f, 0x53, 0x87, 0xa9, 0x13, 0x34, 0x75, + 0x9a, 0x25, 0xcd, 0x9b, 0x16, 0x43, 0xcb, 0xa4, 0x2d, 0xa3, 0xd5, 0xd0, + 0x9a, 0x69, 0x67, 0x69, 0xf7, 0x68, 0x2f, 0xe9, 0x74, 0xba, 0x09, 0xdd, + 0x83, 0x1e, 0x45, 0x97, 0xd0, 0x97, 0xd2, 0x6b, 0xe8, 0x07, 0xe9, 0xe7, + 0xe9, 0x83, 0xf4, 0x77, 0x0c, 0x0d, 0x86, 0x0d, 0x83, 0xc7, 0x48, 0x62, + 0x28, 0x19, 0x6b, 0x19, 0x7b, 0x19, 0xa7, 0x18, 0xb7, 0x19, 0x2f, 0x99, + 0x4c, 0xa6, 0x05, 0xd3, 0x97, 0x99, 0xc8, 0x54, 0x30, 0xd7, 0x32, 0x1b, + 0x99, 0x67, 0x98, 0x0f, 0x98, 0x6f, 0x55, 0x58, 0x2a, 0xf6, 0x2a, 0x7c, + 0x15, 0x91, 0xca, 0x12, 0x95, 0x3a, 0x95, 0x56, 0x95, 0x7e, 0x95, 0xe7, + 0xaa, 0x54, 0x55, 0x73, 0x55, 0x3f, 0xd5, 0x79, 0xaa, 0x0b, 0x54, 0xab, + 0x55, 0x0f, 0xab, 0x5e, 0x56, 0x7d, 0xa6, 0x46, 0x55, 0xb3, 0x50, 0xe3, + 0xa9, 0x09, 0xd4, 0x16, 0xab, 0xd5, 0xa9, 0x1d, 0x55, 0xbb, 0xa9, 0x36, + 0xae, 0xce, 0x52, 0x77, 0x52, 0x8f, 0x50, 0xcf, 0x51, 0x5f, 0xa3, 0xbe, + 0x5f, 0xfd, 0x82, 0xfa, 0x63, 0x0d, 0xb2, 0x86, 0x85, 0x46, 0xa0, 0x86, + 0x48, 0xa3, 0x54, 0x63, 0xb7, 0xc6, 0x19, 0x8d, 0x21, 0x16, 0xc6, 0x32, + 0x65, 0xf1, 0x58, 0x42, 0xd6, 0x72, 0x56, 0x03, 0xeb, 0x2c, 0x6b, 0x98, + 0x4d, 0x62, 0x5b, 0xb2, 0xf9, 0xec, 0x4c, 0x76, 0x05, 0xfb, 0x1b, 0x76, + 0x2f, 0x7b, 0x4c, 0x53, 0x43, 0x73, 0xaa, 0x66, 0xac, 0x66, 0x91, 0x66, + 0x9d, 0xe6, 0x71, 0xcd, 0x01, 0x0e, 0xc6, 0xb1, 0xe0, 0xf0, 0x39, 0xd9, + 0x9c, 0x4a, 0xce, 0x21, 0xce, 0x0d, 0xce, 0x7b, 0x2d, 0x03, 0x2d, 0x3f, + 0x2d, 0xb1, 0xd6, 0x6a, 0xad, 0x66, 0xad, 0x7e, 0xad, 0x37, 0xda, 0x7a, + 0xda, 0xbe, 0xda, 0x62, 0xed, 0x72, 0xed, 0x16, 0xed, 0xeb, 0xda, 0xef, + 0x75, 0x70, 0x9d, 0x40, 0x9d, 0x2c, 0x9d, 0xf5, 0x3a, 0x6d, 0x3a, 0xf7, + 0x75, 0x09, 0xba, 0x36, 0xba, 0x51, 0xba, 0x85, 0xba, 0xdb, 0x75, 0xcf, + 0xea, 0x3e, 0xd3, 0x63, 0xeb, 0x79, 0xe9, 0x09, 0xf5, 0xca, 0xf5, 0x0e, + 0xe9, 0xdd, 0xd1, 0x47, 0xf5, 0x6d, 0xf4, 0xa3, 0xf5, 0x17, 0xea, 0xef, + 0xd6, 0xef, 0xd1, 0x1f, 0x37, 0x30, 0x34, 0x08, 0x36, 0x90, 0x19, 0x6c, + 0x31, 0x38, 0x63, 0xf0, 0xcc, 0x90, 0x63, 0xe8, 0x6b, 0x98, 0x69, 0xb8, + 0xd1, 0xf0, 0x84, 0xe1, 0xa8, 0x11, 0xcb, 0x68, 0xba, 0x91, 0xc4, 0x68, + 0xa3, 0xd1, 0x49, 0xa3, 0x27, 0xb8, 0x26, 0xee, 0x87, 0x67, 0xe3, 0x35, + 0x78, 0x17, 0x3e, 0x66, 0xac, 0x6f, 0x1c, 0x62, 0xac, 0x34, 0xde, 0x65, + 0xdc, 0x6b, 0x3c, 0x61, 0x62, 0x69, 0x32, 0xdb, 0xa4, 0xc4, 0xa4, 0xc5, + 0xe4, 0xbe, 0x29, 0xcd, 0x94, 0x6b, 0x9a, 0x66, 0xba, 0xd1, 0xb4, 0xd3, + 0x74, 0xcc, 0xcc, 0xc8, 0x2c, 0xdc, 0xac, 0xd8, 0xac, 0xc9, 0xec, 0x8e, + 0x39, 0xd5, 0x9c, 0x6b, 0x9e, 0x61, 0xbe, 0xd9, 0xbc, 0xdb, 0xfc, 0x8d, + 0x85, 0xa5, 0x45, 0x9c, 0xc5, 0x4a, 0x8b, 0x36, 0x8b, 0xc7, 0x96, 0xda, + 0x96, 0x7c, 0xcb, 0x05, 0x96, 0x4d, 0x96, 0xf7, 0xac, 0x98, 0x56, 0x3e, + 0x56, 0x79, 0x56, 0xf5, 0x56, 0xd7, 0xac, 0x49, 0xd6, 0x5c, 0xeb, 0x2c, + 0xeb, 0x6d, 0xd6, 0x57, 0x6c, 0x50, 0x1b, 0x57, 0x9b, 0x0c, 0x9b, 0x3a, + 0x9b, 0xcb, 0xb6, 0xa8, 0xad, 0x9b, 0xad, 0xc4, 0x76, 0x9b, 0x6d, 0xdf, + 0x14, 0xe2, 0x14, 0x8f, 0x29, 0xd2, 0x29, 0xf5, 0x53, 0x6e, 0xda, 0x31, + 0xec, 0xfc, 0xec, 0x0a, 0xec, 0x9a, 0xec, 0x06, 0xed, 0x39, 0xf6, 0x61, + 0xf6, 0x25, 0xf6, 0x6d, 0xf6, 0xcf, 0x1d, 0xcc, 0x1c, 0x12, 0x1d, 0xd6, + 0x3b, 0x74, 0x3b, 0x7c, 0x72, 0x74, 0x75, 0xcc, 0x76, 0x6c, 0x70, 0xbc, + 0xeb, 0xa4, 0xe1, 0x34, 0xc3, 0xa9, 0xc4, 0xa9, 0xc3, 0xe9, 0x57, 0x67, + 0x1b, 0x67, 0xa1, 0x73, 0x9d, 0xf3, 0x35, 0x17, 0xa6, 0x4b, 0x90, 0xcb, + 0x12, 0x97, 0x76, 0x97, 0x17, 0x53, 0x6d, 0xa7, 0x8a, 0xa7, 0x6e, 0x9f, + 0x7a, 0xcb, 0x95, 0xe5, 0x1a, 0xee, 0xba, 0xd2, 0xb5, 0xd3, 0xf5, 0xa3, + 0x9b, 0xbb, 0x9b, 0xdc, 0xad, 0xd9, 0x6d, 0xd4, 0xdd, 0xcc, 0x3d, 0xc5, + 0x7d, 0xab, 0xfb, 0x4d, 0x2e, 0x9b, 0x1b, 0xc9, 0x5d, 0xc3, 0x3d, 0xef, + 0x41, 0xf4, 0xf0, 0xf7, 0x58, 0xe2, 0x71, 0xcc, 0xe3, 0x9d, 0xa7, 0x9b, + 0xa7, 0xc2, 0xf3, 0x90, 0xe7, 0x2f, 0x5e, 0x76, 0x5e, 0x59, 0x5e, 0xfb, + 0xbd, 0x1e, 0x4f, 0xb3, 0x9c, 0x26, 0x9e, 0xd6, 0x30, 0x6d, 0xc8, 0xdb, + 0xc4, 0x5b, 0xe0, 0xbd, 0xcb, 0x7b, 0x60, 0x3a, 0x3e, 0x3d, 0x65, 0xfa, + 0xce, 0xe9, 0x03, 0x3e, 0xc6, 0x3e, 0x02, 0x9f, 0x7a, 0x9f, 0x87, 0xbe, + 0xa6, 0xbe, 0x22, 0xdf, 0x3d, 0xbe, 0x23, 0x7e, 0xd6, 0x7e, 0x99, 0x7e, + 0x07, 0xfc, 0x9e, 0xfb, 0x3b, 0xfa, 0xcb, 0xfd, 0x8f, 0xf8, 0xbf, 0xe1, + 0x79, 0xf2, 0x16, 0xf1, 0x4e, 0x05, 0x60, 0x01, 0xc1, 0x01, 0xe5, 0x01, + 0xbd, 0x81, 0x1a, 0x81, 0xb3, 0x03, 0x6b, 0x03, 0x1f, 0x04, 0x99, 0x04, + 0xa5, 0x07, 0x35, 0x05, 0x8d, 0x05, 0xbb, 0x06, 0x2f, 0x0c, 0x3e, 0x15, + 0x42, 0x0c, 0x09, 0x0d, 0x59, 0x1f, 0x72, 0x93, 0x6f, 0xc0, 0x17, 0xf2, + 0x1b, 0xf9, 0x63, 0x33, 0xdc, 0x67, 0x2c, 0x9a, 0xd1, 0x15, 0xca, 0x08, + 0x9d, 0x15, 0x5a, 0x1b, 0xfa, 0x30, 0xcc, 0x26, 0x4c, 0x1e, 0xd6, 0x11, + 0x8e, 0x86, 0xcf, 0x08, 0xdf, 0x10, 0x7e, 0x6f, 0xa6, 0xf9, 0x4c, 0xe9, + 0xcc, 0xb6, 0x08, 0x88, 0xe0, 0x47, 0x6c, 0x88, 0xb8, 0x1f, 0x69, 0x19, + 0x99, 0x17, 0xf9, 0x7d, 0x14, 0x29, 0x2a, 0x32, 0xaa, 0x2e, 0xea, 0x51, + 0xb4, 0x53, 0x74, 0x71, 0x74, 0xf7, 0x2c, 0xd6, 0xac, 0xe4, 0x59, 0xfb, + 0x67, 0xbd, 0x8e, 0xf1, 0x8f, 0xa9, 0x8c, 0xb9, 0x3b, 0xdb, 0x6a, 0xb6, + 0x72, 0x76, 0x67, 0xac, 0x6a, 0x6c, 0x52, 0x6c, 0x63, 0xec, 0x9b, 0xb8, + 0x80, 0xb8, 0xaa, 0xb8, 0x81, 0x78, 0x87, 0xf8, 0x45, 0xf1, 0x97, 0x12, + 0x74, 0x13, 0x24, 0x09, 0xed, 0x89, 0xe4, 0xc4, 0xd8, 0xc4, 0x3d, 0x89, + 0xe3, 0x73, 0x02, 0xe7, 0x6c, 0x9a, 0x33, 0x9c, 0xe4, 0x9a, 0x54, 0x96, + 0x74, 0x63, 0xae, 0xe5, 0xdc, 0xa2, 0xb9, 0x17, 0xe6, 0xe9, 0xce, 0xcb, + 0x9e, 0x77, 0x3c, 0x59, 0x35, 0x59, 0x90, 0x7c, 0x38, 0x85, 0x98, 0x12, + 0x97, 0xb2, 0x3f, 0xe5, 0x83, 0x20, 0x42, 0x50, 0x2f, 0x18, 0x4f, 0xe5, + 0xa7, 0x6e, 0x4d, 0x1d, 0x13, 0xf2, 0x84, 0x9b, 0x85, 0x4f, 0x45, 0xbe, + 0xa2, 0x8d, 0xa2, 0x51, 0xb1, 0xb7, 0xb8, 0x4a, 0x3c, 0x92, 0xe6, 0x9d, + 0x56, 0x95, 0xf6, 0x38, 0xdd, 0x3b, 0x7d, 0x43, 0xfa, 0x68, 0x86, 0x4f, + 0x46, 0x75, 0xc6, 0x33, 0x09, 0x4f, 0x52, 0x2b, 0x79, 0x91, 0x19, 0x92, + 0xb9, 0x23, 0xf3, 0x4d, 0x56, 0x44, 0xd6, 0xde, 0xac, 0xcf, 0xd9, 0x71, + 0xd9, 0x2d, 0x39, 0x94, 0x9c, 0x94, 0x9c, 0xa3, 0x52, 0x0d, 0x69, 0x96, + 0xb4, 0x2b, 0xd7, 0x30, 0xb7, 0x28, 0xb7, 0x4f, 0x66, 0x2b, 0x2b, 0x93, + 0x0d, 0xe4, 0x79, 0xe6, 0x6d, 0xca, 0x1b, 0x93, 0x87, 0xca, 0xf7, 0xe4, + 0x23, 0xf9, 0x73, 0xf3, 0xdb, 0x15, 0x6c, 0x85, 0x4c, 0xd1, 0xa3, 0xb4, + 0x52, 0xae, 0x50, 0x0e, 0x16, 0x4c, 0x2f, 0xa8, 0x2b, 0x78, 0x5b, 0x18, + 0x5b, 0x78, 0xb8, 0x48, 0xbd, 0x48, 0x5a, 0xd4, 0x33, 0xdf, 0x66, 0xfe, + 0xea, 0xf9, 0x23, 0x0b, 0x82, 0x16, 0x7c, 0xbd, 0x90, 0xb0, 0x50, 0xb8, + 0xb0, 0xb3, 0xd8, 0xb8, 0x78, 0x59, 0xf1, 0xe0, 0x22, 0xbf, 0x45, 0xbb, + 0x16, 0x23, 0x8b, 0x53, 0x17, 0x77, 0x2e, 0x31, 0x5d, 0x52, 0xba, 0x64, + 0x78, 0x69, 0xf0, 0xd2, 0x7d, 0xcb, 0x68, 0xcb, 0xb2, 0x96, 0xfd, 0x50, + 0xe2, 0x58, 0x52, 0x55, 0xf2, 0x6a, 0x79, 0xdc, 0xf2, 0x8e, 0x52, 0x83, + 0xd2, 0xa5, 0xa5, 0x43, 0x2b, 0x82, 0x57, 0x34, 0x95, 0xa9, 0x94, 0xc9, + 0xcb, 0x6e, 0xae, 0xf4, 0x5a, 0xb9, 0x63, 0x15, 0x61, 0x95, 0x64, 0x55, + 0xef, 0x6a, 0x97, 0xd5, 0x5b, 0x56, 0x7f, 0x2a, 0x17, 0x95, 0x5f, 0xac, + 0x70, 0xac, 0xa8, 0xae, 0xf8, 0xb0, 0x46, 0xb8, 0xe6, 0xe2, 0x57, 0x4e, + 0x5f, 0xd5, 0x7c, 0xf5, 0x79, 0x6d, 0xda, 0xda, 0xde, 0x4a, 0xb7, 0xca, + 0xed, 0xeb, 0x48, 0xeb, 0xa4, 0xeb, 0x6e, 0xac, 0xf7, 0x59, 0xbf, 0xaf, + 0x4a, 0xbd, 0x6a, 0x41, 0xd5, 0xd0, 0x86, 0xf0, 0x0d, 0xad, 0x1b, 0xf1, + 0x8d, 0xe5, 0x1b, 0x5f, 0x6d, 0x4a, 0xde, 0x74, 0xa1, 0x7a, 0x6a, 0xf5, + 0x8e, 0xcd, 0xb4, 0xcd, 0xca, 0xcd, 0x03, 0x35, 0x61, 0x35, 0xed, 0x5b, + 0xcc, 0xb6, 0xac, 0xdb, 0xf2, 0xa1, 0x36, 0xa3, 0xf6, 0x7a, 0x9d, 0x7f, + 0x5d, 0xcb, 0x56, 0xfd, 0xad, 0xab, 0xb7, 0xbe, 0xd9, 0x26, 0xda, 0xd6, + 0xbf, 0xdd, 0x77, 0x7b, 0xf3, 0x0e, 0x83, 0x1d, 0x15, 0x3b, 0xde, 0xef, + 0x94, 0xec, 0xbc, 0xb5, 0x2b, 0x78, 0x57, 0x6b, 0xbd, 0x45, 0x7d, 0xf5, + 0x6e, 0xd2, 0xee, 0x82, 0xdd, 0x8f, 0x1a, 0x62, 0x1b, 0xba, 0xbf, 0xe6, + 0x7e, 0xdd, 0xb8, 0x47, 0x77, 0x4f, 0xc5, 0x9e, 0x8f, 0x7b, 0xa5, 0x7b, + 0x07, 0xf6, 0x45, 0xef, 0xeb, 0x6a, 0x74, 0x6f, 0x6c, 0xdc, 0xaf, 0xbf, + 0xbf, 0xb2, 0x09, 0x6d, 0x52, 0x36, 0x8d, 0x1e, 0x48, 0x3a, 0x70, 0xe5, + 0x9b, 0x80, 0x6f, 0xda, 0x9b, 0xed, 0x9a, 0x77, 0xb5, 0x70, 0x5a, 0x2a, + 0x0e, 0xc2, 0x41, 0xe5, 0xc1, 0x27, 0xdf, 0xa6, 0x7c, 0x7b, 0xe3, 0x50, + 0xe8, 0xa1, 0xce, 0xc3, 0xdc, 0xc3, 0xcd, 0xdf, 0x99, 0x7f, 0xb7, 0xf5, + 0x08, 0xeb, 0x48, 0x79, 0x2b, 0xd2, 0x3a, 0xbf, 0x75, 0xac, 0x2d, 0xa3, + 0x6d, 0xa0, 0x3d, 0xa1, 0xbd, 0xef, 0xe8, 0x8c, 0xa3, 0x9d, 0x1d, 0x5e, + 0x1d, 0x47, 0xbe, 0xb7, 0xff, 0x7e, 0xef, 0x31, 0xe3, 0x63, 0x75, 0xc7, + 0x35, 0x8f, 0x57, 0x9e, 0xa0, 0x9d, 0x28, 0x3d, 0xf1, 0xf9, 0xe4, 0x82, + 0x93, 0xe3, 0xa7, 0x64, 0xa7, 0x9e, 0x9d, 0x4e, 0x3f, 0x3d, 0xd4, 0x99, + 0xdc, 0x79, 0xf7, 0x4c, 0xfc, 0x99, 0x6b, 0x5d, 0x51, 0x5d, 0xbd, 0x67, + 0x43, 0xcf, 0x9e, 0x3f, 0x17, 0x74, 0xee, 0x4c, 0xb7, 0x5f, 0xf7, 0xc9, + 0xf3, 0xde, 0xe7, 0x8f, 0x5d, 0xf0, 0xbc, 0x70, 0xf4, 0x22, 0xf7, 0x62, + 0xdb, 0x25, 0xb7, 0x4b, 0xad, 0x3d, 0xae, 0x3d, 0x47, 0x7e, 0x70, 0xfd, + 0xe1, 0x48, 0xaf, 0x5b, 0x6f, 0xeb, 0x65, 0xf7, 0xcb, 0xed, 0x57, 0x3c, + 0xae, 0x74, 0xf4, 0x4d, 0xeb, 0x3b, 0xd1, 0xef, 0xd3, 0x7f, 0xfa, 0x6a, + 0xc0, 0xd5, 0x73, 0xd7, 0xf8, 0xd7, 0x2e, 0x5d, 0x9f, 0x79, 0xbd, 0xef, + 0xc6, 0xec, 0x1b, 0xb7, 0x6e, 0x26, 0xdd, 0x1c, 0xb8, 0x25, 0xba, 0xf5, + 0xf8, 0x76, 0xf6, 0xed, 0x17, 0x77, 0x0a, 0xee, 0x4c, 0xdc, 0x5d, 0x7a, + 0x8f, 0x78, 0xaf, 0xfc, 0xbe, 0xda, 0xfd, 0xea, 0x07, 0xfa, 0x0f, 0xea, + 0x7f, 0xb4, 0xfe, 0xb1, 0x65, 0xc0, 0x6d, 0xe0, 0xf8, 0x60, 0xc0, 0x60, + 0xcf, 0xc3, 0x59, 0x0f, 0xef, 0x0e, 0x09, 0x87, 0x9e, 0xfe, 0x94, 0xff, + 0xd3, 0x87, 0xe1, 0xd2, 0x47, 0xcc, 0x47, 0xd5, 0x23, 0x46, 0x23, 0x8d, + 0x8f, 0x9d, 0x1f, 0x1f, 0x1b, 0x0d, 0x1a, 0xbd, 0xf2, 0x64, 0xce, 0x93, + 0xe1, 0xa7, 0xb2, 0xa7, 0x13, 0xcf, 0xca, 0x7e, 0x56, 0xff, 0x79, 0xeb, + 0x73, 0xab, 0xe7, 0xdf, 0xfd, 0xe2, 0xfb, 0x4b, 0xcf, 0x58, 0xfc, 0xd8, + 0xf0, 0x0b, 0xf9, 0x8b, 0xcf, 0xbf, 0xae, 0x79, 0xa9, 0xf3, 0x72, 0xef, + 0xab, 0xa9, 0xaf, 0x3a, 0xc7, 0x23, 0xc7, 0x1f, 0xbc, 0xce, 0x79, 0x3d, + 0xf1, 0xa6, 0xfc, 0xad, 0xce, 0xdb, 0x7d, 0xef, 0xb8, 0xef, 0xba, 0xdf, + 0xc7, 0xbd, 0x1f, 0x99, 0x28, 0xfc, 0x40, 0xfe, 0x50, 0xf3, 0xd1, 0xfa, + 0x63, 0xc7, 0xa7, 0xd0, 0x4f, 0xf7, 0x3e, 0xe7, 0x7c, 0xfe, 0xfc, 0x2f, + 0xf7, 0x84, 0xf3, 0xfb, 0x80, 0x39, 0x25, 0x11, 0x00, 0x00, 0x00, 0x06, + 0x62, 0x4b, 0x47, 0x44, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0xa0, 0xbd, + 0xa7, 0x93, 0x00, 0x00, 0x00, 0x09, 0x70, 0x48, 0x59, 0x73, 0x00, 0x00, + 0x0b, 0x13, 0x00, 0x00, 0x0b, 0x13, 0x01, 0x00, 0x9a, 0x9c, 0x18, 0x00, + 0x00, 0x00, 0x07, 0x74, 0x49, 0x4d, 0x45, 0x07, 0xdc, 0x02, 0x07, 0x10, + 0x2f, 0x03, 0xd9, 0x0c, 0xd7, 0x8a, 0x00, 0x00, 0x20, 0x00, 0x49, 0x44, + 0x41, 0x54, 0x78, 0xda, 0xed, 0x7d, 0x79, 0x78, 0x54, 0x55, 0xd2, 0xf7, + 0xef, 0xf6, 0x9e, 0x74, 0xa7, 0x3b, 0xfb, 0x4a, 0x16, 0x08, 0x21, 0x21, + 0x21, 0x2c, 0xb2, 0x89, 0xec, 0x4b, 0x10, 0x71, 0x19, 0x96, 0x41, 0x5e, + 0x51, 0x14, 0x5e, 0xb7, 0x6f, 0x5c, 0x50, 0x04, 0x1d, 0x66, 0x5e, 0x54, + 0x70, 0x1c, 0x07, 0x17, 0x44, 0x65, 0x90, 0x51, 0x71, 0x14, 0x91, 0x45, + 0x05, 0x71, 0xd0, 0x80, 0x03, 0x01, 0x45, 0x20, 0x42, 0x58, 0x43, 0xd8, + 0x21, 0x64, 0x4f, 0xc8, 0x9e, 0x5e, 0x92, 0xf4, 0x7e, 0xbf, 0x3f, 0x72, + 0xef, 0xcd, 0xb9, 0x9d, 0xdb, 0x5b, 0xd2, 0x09, 0x38, 0xd3, 0xf5, 0x3c, + 0xf7, 0x81, 0x4e, 0xdf, 0x3e, 0xa7, 0x4e, 0x9d, 0x3a, 0x55, 0x75, 0xea, + 0x54, 0xd5, 0xa1, 0x68, 0x9a, 0x86, 0x1f, 0xfc, 0xe0, 0x07, 0x3f, 0xf8, + 0xc1, 0x0f, 0x7e, 0xf8, 0xef, 0x02, 0x91, 0x9f, 0x04, 0x7e, 0xf0, 0x83, + 0x1f, 0xfc, 0xe0, 0x07, 0x3f, 0xf8, 0x0d, 0x00, 0x3f, 0xf8, 0xc1, 0x0f, + 0x7e, 0xf0, 0x83, 0x1f, 0xfc, 0xe0, 0x37, 0x00, 0xfc, 0xe0, 0x07, 0x3f, + 0xf8, 0xc1, 0x0f, 0x7e, 0xf0, 0xc3, 0x7f, 0x22, 0x48, 0xc8, 0x0f, 0x14, + 0x45, 0xf9, 0xa4, 0xd1, 0xae, 0xc4, 0x15, 0xf8, 0x02, 0x07, 0xb6, 0x7f, + 0x6f, 0xda, 0x72, 0x87, 0x73, 0x57, 0xf1, 0xf2, 0x96, 0x26, 0x3d, 0xd1, + 0x9f, 0xaf, 0xe6, 0xdb, 0x13, 0x1c, 0x3c, 0xed, 0xcb, 0x11, 0xef, 0xee, + 0xc2, 0xb1, 0xbb, 0xe7, 0xbb, 0x2b, 0xbc, 0x78, 0x33, 0xa0, 0x33, 0x73, + 0xf5, 0x5b, 0x92, 0x09, 0x5d, 0xc5, 0xa1, 0xab, 0x78, 0x08, 0xf5, 0xdd, + 0xd9, 0x35, 0xd1, 0xd5, 0xdf, 0xf6, 0x34, 0xdd, 0x6f, 0x05, 0xfa, 0xf7, + 0xb4, 0x6c, 0xf6, 0xa6, 0xcd, 0xce, 0x8e, 0xcb, 0x17, 0xf1, 0x7b, 0x54, + 0x77, 0x0a, 0xa8, 0x9e, 0x56, 0x7a, 0xdd, 0x81, 0xb3, 0x2f, 0x71, 0xba, + 0x19, 0x4a, 0xb9, 0x2b, 0xc2, 0xe3, 0x66, 0xce, 0x41, 0x4f, 0xe1, 0xf8, + 0x5b, 0xa4, 0xcf, 0x6f, 0x19, 0x7a, 0x42, 0x30, 0xde, 0x8a, 0x72, 0xc9, + 0x17, 0x72, 0xa5, 0xb3, 0xeb, 0xe2, 0x56, 0x93, 0xc3, 0xb7, 0xaa, 0x5e, + 0xf0, 0xf5, 0xa6, 0xa0, 0xa7, 0xe4, 0x7d, 0x57, 0x0c, 0x81, 0x6e, 0x3d, + 0x02, 0xa0, 0x28, 0xca, 0xe3, 0x01, 0xde, 0x2a, 0x42, 0x97, 0xc4, 0xb9, + 0xa7, 0x71, 0xea, 0x8e, 0xfe, 0x1c, 0xdb, 0xf4, 0x2b, 0x37, 0xdf, 0xf0, + 0xab, 0x1f, 0xba, 0x97, 0xc6, 0xff, 0x69, 0xf3, 0xe0, 0x8b, 0xf1, 0xfc, + 0x37, 0xf2, 0x66, 0x4f, 0x8e, 0xf9, 0xb7, 0xba, 0xfe, 0xbb, 0x82, 0xb7, + 0xe8, 0x3f, 0x6d, 0x12, 0x7f, 0xab, 0x38, 0x77, 0x67, 0x7f, 0x37, 0xcb, + 0xa0, 0xf1, 0xcf, 0xb7, 0x1f, 0x3a, 0x43, 0xef, 0x5b, 0x69, 0x2e, 0xfc, + 0x7c, 0xf1, 0xdf, 0x47, 0x7b, 0xa1, 0x7e, 0x7f, 0x0b, 0x7c, 0xd0, 0x19, + 0x1c, 0x25, 0xce, 0xbe, 0x48, 0x4c, 0x4c, 0xc4, 0x80, 0x01, 0x03, 0x38, + 0xb7, 0x53, 0x41, 0x41, 0x01, 0x4a, 0x4b, 0x4b, 0x79, 0xef, 0x3c, 0xfd, + 0xf4, 0xd3, 0x30, 0x18, 0x0c, 0xa8, 0xab, 0xab, 0x43, 0x61, 0x61, 0x21, + 0x2a, 0x2b, 0x2b, 0xa1, 0xd3, 0xe9, 0x7c, 0x32, 0x18, 0xa9, 0x54, 0x8a, + 0xb4, 0xb4, 0x34, 0xdc, 0x76, 0xdb, 0x6d, 0x00, 0x80, 0x3d, 0x7b, 0xf6, + 0xa0, 0xa6, 0xa6, 0x86, 0xf7, 0xce, 0x9f, 0xfe, 0xf4, 0x27, 0xe8, 0xf5, + 0x7a, 0x5c, 0xbe, 0x7c, 0x19, 0xfb, 0xf6, 0xed, 0x73, 0xda, 0x56, 0xaf, + 0x5e, 0xbd, 0x10, 0x15, 0x15, 0x85, 0x84, 0x84, 0x04, 0xc4, 0xc6, 0xc6, + 0x76, 0x1b, 0xce, 0x11, 0x11, 0x11, 0x18, 0x39, 0x72, 0x24, 0x00, 0xa0, + 0xa8, 0xa8, 0x08, 0x35, 0x35, 0x35, 0xa8, 0xad, 0xad, 0xed, 0xd2, 0xc4, + 0xf5, 0xee, 0xdd, 0x1b, 0xa1, 0xa1, 0xa1, 0x48, 0x4e, 0x4e, 0x86, 0x5a, + 0xad, 0x86, 0x56, 0xab, 0xc5, 0x8d, 0x1b, 0x37, 0x50, 0x5b, 0x5b, 0x8b, + 0xd2, 0xd2, 0x52, 0xb4, 0xb4, 0xb4, 0x74, 0x99, 0x39, 0xfa, 0xf4, 0xe9, + 0x83, 0xb0, 0xb0, 0x30, 0x24, 0x24, 0x24, 0x20, 0x24, 0x24, 0x04, 0x5a, + 0xad, 0x16, 0xe5, 0xe5, 0xe5, 0xa8, 0xaf, 0xaf, 0x47, 0x51, 0x51, 0x11, + 0x2c, 0x16, 0x8b, 0xe0, 0xef, 0x86, 0x0e, 0x1d, 0xea, 0x15, 0x4d, 0x15, + 0x0a, 0x05, 0xd4, 0x6a, 0x35, 0xa2, 0xa2, 0xa2, 0xb8, 0xbf, 0x35, 0x36, + 0x36, 0xc2, 0x6e, 0xb7, 0xa3, 0xb2, 0xb2, 0xd2, 0x6b, 0x7a, 0x27, 0x24, + 0x24, 0x20, 0x28, 0x28, 0xc8, 0x23, 0xd7, 0x1d, 0x45, 0x51, 0xd0, 0xe9, + 0x74, 0x1d, 0x78, 0xd8, 0x1d, 0xa8, 0xd5, 0x6a, 0x6e, 0x2d, 0x24, 0x25, + 0x25, 0x41, 0x24, 0x12, 0xa1, 0xbe, 0xbe, 0x1e, 0xa7, 0x4e, 0x9d, 0x42, + 0x4d, 0x4d, 0x0d, 0x8a, 0x8b, 0x8b, 0x3d, 0x6e, 0x2b, 0x3c, 0x3c, 0x1c, + 0x11, 0x11, 0x11, 0x10, 0x89, 0x44, 0x9d, 0x72, 0x85, 0xeb, 0xf5, 0xfa, + 0x0e, 0xf8, 0x3f, 0xf0, 0xc0, 0x03, 0x48, 0x4a, 0x4a, 0xc2, 0xdf, 0xfe, + 0xf6, 0x37, 0xa7, 0xbf, 0x4f, 0x4a, 0x4a, 0x82, 0x5a, 0xad, 0x46, 0x72, + 0x72, 0x32, 0x42, 0x43, 0x43, 0xd1, 0xdc, 0xdc, 0x8c, 0xea, 0xea, 0x6a, + 0x54, 0x57, 0x57, 0xa3, 0xac, 0xac, 0x0c, 0x7a, 0xbd, 0xbe, 0x4b, 0x7c, + 0x9f, 0x9c, 0x9c, 0x8c, 0xa8, 0xa8, 0x28, 0xa4, 0xa5, 0xa5, 0x21, 0x2a, + 0x2a, 0x8a, 0x5b, 0x93, 0x65, 0x65, 0x65, 0x28, 0x2e, 0x2e, 0x86, 0xd1, + 0x68, 0xf4, 0x99, 0x10, 0xeb, 0xee, 0x39, 0xf7, 0x44, 0x88, 0x46, 0x44, + 0x44, 0x74, 0x58, 0xd7, 0x9e, 0xc8, 0x2b, 0x57, 0xe0, 0x89, 0xbc, 0xed, + 0xee, 0xf5, 0xd4, 0x53, 0x3c, 0xdb, 0xd5, 0x79, 0x70, 0x94, 0x89, 0x1b, + 0x36, 0x6c, 0xf0, 0x39, 0xef, 0x7b, 0xca, 0x07, 0x9d, 0x91, 0xf7, 0x9e, + 0xf4, 0xe1, 0xcb, 0x35, 0xe5, 0x12, 0x68, 0x9a, 0x16, 0x9c, 0xd8, 0xcd, + 0x9b, 0x37, 0x73, 0xdf, 0xd1, 0x34, 0x8d, 0x47, 0x1e, 0x79, 0xc4, 0xe9, + 0x6f, 0x69, 0x9a, 0x46, 0x55, 0x55, 0x15, 0xde, 0x7d, 0xf7, 0x5d, 0xc8, + 0xe5, 0x72, 0xb7, 0x7d, 0x39, 0x3e, 0x42, 0x90, 0x9a, 0x9a, 0x8a, 0x73, + 0xe7, 0xce, 0x81, 0xa6, 0x69, 0xdc, 0xb8, 0x71, 0x03, 0x19, 0x19, 0x19, + 0x2e, 0xdb, 0x13, 0x82, 0xa0, 0xa0, 0x20, 0x8c, 0x1e, 0x3d, 0x1a, 0x87, + 0x0e, 0x1d, 0x82, 0xc9, 0x64, 0xea, 0xd0, 0xaf, 0x27, 0x38, 0x7b, 0x03, + 0x7f, 0xfe, 0xf3, 0x9f, 0xb9, 0xb6, 0xf7, 0xee, 0xdd, 0x8b, 0x98, 0x98, + 0x18, 0x8f, 0x68, 0x20, 0x04, 0x61, 0x61, 0x61, 0x78, 0xe0, 0x81, 0x07, + 0x70, 0xf2, 0xe4, 0x49, 0xd8, 0xed, 0xf6, 0x0e, 0xbf, 0xa9, 0xac, 0xac, + 0xc4, 0xdb, 0x6f, 0xbf, 0xcd, 0x5b, 0xfc, 0xde, 0x42, 0x64, 0x64, 0x24, + 0xe6, 0xcf, 0x9f, 0x8f, 0x0b, 0x17, 0x2e, 0x08, 0xf6, 0x51, 0x5a, 0x5a, + 0x8a, 0x67, 0x9e, 0x79, 0x06, 0x81, 0x81, 0x81, 0x1e, 0xcf, 0x69, 0x55, + 0x55, 0x95, 0xd3, 0x77, 0x33, 0x33, 0x33, 0x51, 0x56, 0x56, 0xc6, 0x7b, + 0xff, 0xc8, 0x91, 0x23, 0xe8, 0xdd, 0xbb, 0x77, 0xa7, 0xf0, 0x5f, 0xb5, + 0x6a, 0x15, 0xaa, 0xaa, 0xaa, 0x3c, 0x7e, 0x26, 0x4e, 0x9c, 0x28, 0x88, + 0xbf, 0x2b, 0x41, 0xf3, 0xde, 0x7b, 0xef, 0x41, 0xab, 0xd5, 0x0a, 0xce, + 0x5b, 0x4e, 0x4e, 0x0e, 0x00, 0x40, 0xa3, 0xd1, 0x78, 0x84, 0x6f, 0x7c, + 0x7c, 0x3c, 0x7e, 0xfc, 0xf1, 0x47, 0xaf, 0x70, 0x26, 0x9f, 0x15, 0x2b, + 0x56, 0x78, 0xbc, 0x7e, 0x59, 0xe1, 0x3d, 0x6f, 0xde, 0x3c, 0x9c, 0x38, + 0x71, 0x02, 0x16, 0x8b, 0xa5, 0x03, 0xfe, 0xb5, 0xb5, 0xb5, 0x78, 0xeb, + 0xad, 0xb7, 0x20, 0x91, 0x48, 0x3a, 0x45, 0x7f, 0x96, 0x47, 0xcf, 0x9d, + 0x3b, 0x27, 0xc8, 0x3f, 0x25, 0x25, 0x25, 0x98, 0x37, 0x6f, 0x1e, 0x42, + 0x42, 0x42, 0x3c, 0xe6, 0x9f, 0x9e, 0x9a, 0x73, 0x4f, 0xd7, 0xa1, 0xa7, + 0xd0, 0x55, 0x79, 0xe5, 0x89, 0xbc, 0xed, 0xca, 0x7a, 0x72, 0x36, 0x66, + 0x77, 0x74, 0xe8, 0x4e, 0x9e, 0xf5, 0x14, 0x07, 0x77, 0x32, 0xf1, 0x66, + 0xf0, 0x7e, 0x57, 0xe4, 0xbd, 0x2b, 0x5e, 0xeb, 0x8e, 0x35, 0xe5, 0x92, + 0xce, 0x9e, 0x32, 0xe4, 0xc3, 0x0f, 0x3f, 0xec, 0x51, 0x47, 0xfb, 0xf7, + 0xef, 0x47, 0x4a, 0x4a, 0x4a, 0x97, 0x0d, 0x80, 0x69, 0xd3, 0xa6, 0x71, + 0xdf, 0x6f, 0xda, 0xb4, 0x49, 0x50, 0xc8, 0xba, 0x6b, 0x43, 0x26, 0x93, + 0xa1, 0xbe, 0xbe, 0xde, 0x2d, 0x11, 0x5c, 0xe1, 0xec, 0x29, 0x84, 0x86, + 0x86, 0xa2, 0xa0, 0xa0, 0x80, 0xc7, 0x10, 0xd1, 0xd1, 0xd1, 0x9d, 0x32, + 0x00, 0x42, 0x43, 0x43, 0xf1, 0xe4, 0x93, 0x4f, 0xc2, 0x66, 0xb3, 0xb9, + 0xc5, 0xfd, 0xc2, 0x85, 0x0b, 0x18, 0x3c, 0x78, 0x70, 0xa7, 0x2c, 0xfb, + 0x8c, 0x8c, 0x0c, 0x41, 0x26, 0x73, 0x7c, 0x36, 0x6d, 0xda, 0x84, 0xf4, + 0xf4, 0x74, 0x8f, 0xe7, 0xd4, 0x59, 0x7f, 0x1f, 0x7d, 0xf4, 0x51, 0x87, + 0x77, 0x8f, 0x1c, 0x39, 0x82, 0xa4, 0xa4, 0xa4, 0x4e, 0x79, 0x5b, 0x76, + 0xef, 0xde, 0xed, 0x15, 0xb3, 0x67, 0x65, 0x65, 0x79, 0x6c, 0x00, 0x04, + 0x05, 0x05, 0x61, 0xfb, 0xf6, 0xed, 0x6e, 0xdb, 0xac, 0xaf, 0xaf, 0xc7, + 0x9c, 0x39, 0x73, 0x3c, 0x12, 0x24, 0x89, 0x89, 0x89, 0x38, 0x78, 0xf0, + 0xa0, 0x57, 0x38, 0x93, 0xcf, 0xeb, 0xaf, 0xbf, 0xee, 0xb1, 0x01, 0x10, + 0x16, 0x16, 0x86, 0x25, 0x4b, 0x96, 0x78, 0xc4, 0x43, 0x3b, 0x76, 0xec, + 0xc0, 0xc0, 0x81, 0x03, 0xbd, 0x56, 0xfe, 0x13, 0x26, 0x4c, 0xf0, 0x08, + 0xef, 0x95, 0x2b, 0x57, 0x3a, 0x9d, 0x63, 0x6f, 0x94, 0xb0, 0x2f, 0xe7, + 0xbc, 0xb3, 0x06, 0x40, 0x68, 0x68, 0x68, 0xb7, 0xc8, 0x2b, 0x4f, 0xe4, + 0x6d, 0x57, 0xd6, 0x53, 0x67, 0x94, 0x7f, 0x77, 0xf3, 0xac, 0x37, 0x78, + 0xb8, 0x92, 0x89, 0x3d, 0xcd, 0xfb, 0x5d, 0x95, 0xf7, 0xae, 0x0c, 0x9c, + 0xee, 0x58, 0x53, 0xae, 0x1e, 0x49, 0x57, 0x94, 0xde, 0xb2, 0x65, 0xcb, + 0x10, 0x17, 0x17, 0x87, 0xdf, 0xfd, 0xee, 0x77, 0x48, 0x48, 0x48, 0x00, + 0x00, 0x4c, 0x9a, 0x34, 0x09, 0x4b, 0x96, 0x2c, 0xc1, 0x8b, 0x2f, 0xbe, + 0xd8, 0x69, 0xd7, 0xa2, 0x46, 0xa3, 0xc1, 0x43, 0x0f, 0x3d, 0xc4, 0x7d, + 0xfe, 0xe2, 0x8b, 0x2f, 0xa0, 0xd5, 0x6a, 0x3b, 0xbc, 0xf7, 0xd6, 0x5b, + 0x6f, 0x21, 0x38, 0x38, 0x18, 0x4f, 0x3e, 0xf9, 0xa4, 0xa0, 0x45, 0xbe, + 0x77, 0xef, 0x5e, 0xde, 0x82, 0xcd, 0xce, 0xce, 0xc6, 0xa1, 0x43, 0x87, + 0x7c, 0x8a, 0x73, 0x48, 0x48, 0x08, 0x64, 0x32, 0x19, 0xbe, 0xf9, 0xe6, + 0x1b, 0x0c, 0x18, 0x30, 0xc0, 0xe3, 0xdd, 0xa5, 0x2b, 0x37, 0x50, 0x4a, + 0x4a, 0x0a, 0xd6, 0xae, 0x5d, 0x0b, 0x91, 0xa8, 0x3d, 0x44, 0xe3, 0xe8, + 0xd1, 0xa3, 0x28, 0x2f, 0x2f, 0x87, 0x44, 0x22, 0x41, 0x46, 0x46, 0x06, + 0x67, 0xb0, 0xf4, 0xef, 0xdf, 0x1f, 0xdb, 0xb6, 0x6d, 0xc3, 0xcc, 0x99, + 0x33, 0x71, 0xf1, 0xe2, 0x45, 0x8f, 0xf1, 0x1e, 0x3b, 0x76, 0x2c, 0x76, + 0xec, 0xd8, 0xc1, 0xf5, 0xaf, 0xd3, 0xe9, 0xf0, 0xc9, 0x27, 0x9f, 0x40, + 0xa7, 0xd3, 0x21, 0x29, 0x29, 0x09, 0xf7, 0xde, 0x7b, 0x2f, 0xc2, 0xc3, + 0xc3, 0x01, 0x00, 0x0f, 0x3d, 0xf4, 0x10, 0x64, 0x32, 0x19, 0x16, 0x2d, + 0x5a, 0x84, 0xea, 0xea, 0x6a, 0x5e, 0x3b, 0x8e, 0x34, 0x4d, 0x4c, 0x4c, + 0x14, 0xec, 0x6f, 0xf0, 0xe0, 0xc1, 0x4e, 0x77, 0x35, 0x9d, 0xd9, 0x7d, + 0x39, 0xba, 0x3e, 0x5b, 0x5b, 0x5b, 0x9d, 0x1e, 0x55, 0xb0, 0x60, 0x32, + 0x99, 0x3c, 0xf6, 0x8c, 0x3c, 0xfd, 0xf4, 0xd3, 0x98, 0x3d, 0x7b, 0x36, + 0xf7, 0xb7, 0x33, 0x67, 0xce, 0xe0, 0xcb, 0x2f, 0xbf, 0x84, 0xc9, 0x64, + 0xc2, 0xb8, 0x71, 0xe3, 0x30, 0x67, 0xce, 0x1c, 0x4e, 0x10, 0xac, 0x5b, + 0xb7, 0x0e, 0x97, 0x2e, 0x5d, 0x42, 0x41, 0x41, 0x81, 0xdb, 0xb9, 0x16, + 0x8b, 0xc5, 0x5d, 0xf2, 0xd6, 0x39, 0xc2, 0x99, 0x33, 0x67, 0x30, 0x64, + 0xc8, 0x90, 0x0e, 0x7f, 0x1f, 0x35, 0x6a, 0x14, 0x56, 0xad, 0x5a, 0xc5, + 0xf1, 0x90, 0xdd, 0x6e, 0xc7, 0xd6, 0xad, 0x5b, 0x71, 0xf9, 0xf2, 0x65, + 0x44, 0x45, 0x45, 0x61, 0xca, 0x94, 0x29, 0x48, 0x4d, 0x4d, 0x05, 0x00, + 0xcc, 0x9a, 0x35, 0x0b, 0x0a, 0x85, 0x02, 0x4f, 0x3c, 0xf1, 0x04, 0x2a, + 0x2a, 0x2a, 0x3c, 0xc2, 0x65, 0xe0, 0xc0, 0x81, 0xbc, 0x63, 0x37, 0x9a, + 0xa6, 0xf1, 0xfd, 0xf7, 0xdf, 0xe3, 0xd2, 0xa5, 0x4b, 0x08, 0x0e, 0x0e, + 0x46, 0x56, 0x56, 0x16, 0xb7, 0x13, 0x7d, 0xe5, 0x95, 0x57, 0x20, 0x97, + 0xcb, 0xf1, 0xc6, 0x1b, 0x6f, 0xb8, 0x3c, 0x6e, 0x73, 0xe7, 0x76, 0xed, + 0xce, 0x39, 0xf7, 0x66, 0x9d, 0x8f, 0x1b, 0x37, 0xae, 0x53, 0xf2, 0xca, + 0x97, 0xe0, 0xeb, 0xf5, 0xd4, 0x93, 0x3c, 0xeb, 0x4b, 0x99, 0x38, 0x6a, + 0xd4, 0xa8, 0x1e, 0xe5, 0xfd, 0xae, 0xca, 0xfb, 0x9e, 0x5e, 0x53, 0x9d, + 0x3e, 0x02, 0xb8, 0xfb, 0xee, 0xbb, 0xb1, 0x79, 0xf3, 0x66, 0xee, 0xe9, + 0xdf, 0xbf, 0xbf, 0xcb, 0xc9, 0x2a, 0x2a, 0x2a, 0xe2, 0xda, 0x6a, 0x68, + 0x68, 0x40, 0x66, 0x66, 0x66, 0xa7, 0x77, 0x8b, 0x19, 0x19, 0x19, 0xa8, + 0xad, 0xad, 0x05, 0x4d, 0xd3, 0xc8, 0xcf, 0xcf, 0x17, 0xdc, 0x9d, 0x07, + 0x04, 0x04, 0x00, 0x80, 0xd3, 0x9d, 0xd7, 0xf3, 0xcf, 0x3f, 0xcf, 0xeb, + 0x67, 0xc5, 0x8a, 0x15, 0x9c, 0xab, 0xdf, 0x1b, 0x9c, 0x23, 0x23, 0x23, + 0x05, 0xad, 0xe2, 0x47, 0x1e, 0x79, 0x04, 0xcb, 0x96, 0x2d, 0xc3, 0x57, + 0x5f, 0x7d, 0x85, 0xf2, 0xf2, 0xf2, 0x0e, 0xe3, 0xda, 0xbb, 0x77, 0xaf, + 0xa0, 0x7b, 0xde, 0xdd, 0xf8, 0xc3, 0xc3, 0xc3, 0xf1, 0xdd, 0x77, 0xdf, + 0x71, 0xdf, 0xdb, 0x6c, 0x36, 0xfc, 0xfe, 0xf7, 0xbf, 0x47, 0x64, 0x64, + 0x24, 0xe4, 0x72, 0x39, 0x34, 0x1a, 0x0d, 0xd2, 0xd2, 0xd2, 0x70, 0xe6, + 0xcc, 0x99, 0x0e, 0x96, 0x36, 0xb9, 0x38, 0x5c, 0x41, 0x52, 0x52, 0x12, + 0x8e, 0x1f, 0x3f, 0xce, 0xfd, 0xf6, 0xec, 0xd9, 0xb3, 0x08, 0x0c, 0x0c, + 0xe4, 0x68, 0xa9, 0x52, 0xa9, 0x10, 0x17, 0x17, 0x07, 0xa3, 0xd1, 0xc8, + 0xbd, 0x63, 0x34, 0x1a, 0x31, 0x68, 0xd0, 0xa0, 0x0e, 0x6d, 0x39, 0xd2, + 0xd4, 0x99, 0x2b, 0x3d, 0x37, 0x37, 0x97, 0x3b, 0x56, 0xa8, 0xa9, 0xa9, + 0xe1, 0xed, 0x58, 0x9c, 0x19, 0x0d, 0xae, 0x20, 0x3d, 0x3d, 0x9d, 0xa3, + 0x7b, 0x63, 0x63, 0x23, 0xfa, 0xf5, 0xeb, 0x87, 0xf4, 0xf4, 0x74, 0xa4, + 0xa7, 0xa7, 0x23, 0x23, 0x23, 0xa3, 0xc3, 0x33, 0x60, 0xc0, 0x00, 0xc4, + 0xc7, 0xc7, 0x7b, 0xd4, 0xf6, 0xe4, 0xc9, 0x93, 0x61, 0xb5, 0x5a, 0x39, + 0x1c, 0xbf, 0xf8, 0xe2, 0x0b, 0xc4, 0xc5, 0xc5, 0x71, 0xdf, 0x07, 0x06, + 0x06, 0x62, 0xe9, 0xd2, 0xa5, 0x3c, 0xfa, 0x2f, 0x5f, 0xbe, 0xbc, 0x43, + 0x3b, 0x36, 0x9b, 0x8d, 0xf7, 0x39, 0x2e, 0x2e, 0x0e, 0x99, 0x99, 0x99, + 0x98, 0x3a, 0x75, 0x2a, 0xb2, 0xb2, 0xb2, 0x3a, 0x3c, 0x53, 0xa6, 0x4c, + 0xc1, 0x94, 0x29, 0x53, 0x30, 0x79, 0xf2, 0x64, 0x4c, 0x98, 0x30, 0x01, + 0x7b, 0xf7, 0xee, 0xe5, 0xdc, 0x97, 0x25, 0x25, 0x25, 0xdc, 0x79, 0xa3, + 0x63, 0x9b, 0x42, 0x3c, 0x9b, 0x9d, 0x9d, 0xcd, 0xe1, 0x66, 0x36, 0x9b, + 0x91, 0x91, 0x91, 0x01, 0x95, 0x4a, 0xc5, 0x9b, 0x93, 0x43, 0x87, 0x0e, + 0xf1, 0xf8, 0xec, 0xf6, 0xdb, 0x6f, 0xf7, 0x88, 0x3e, 0xc9, 0xc9, 0xc9, + 0x38, 0x7d, 0xfa, 0x34, 0xf7, 0x5b, 0x9d, 0x4e, 0x87, 0xa1, 0x43, 0x87, + 0xf2, 0xd6, 0xa4, 0x5c, 0x2e, 0xc7, 0x89, 0x13, 0x27, 0xb8, 0x77, 0xf4, + 0x7a, 0xbd, 0xa0, 0xa7, 0xca, 0x9b, 0x1d, 0xb8, 0xaf, 0xe6, 0xdc, 0x9b, + 0xdd, 0xaf, 0xe3, 0x3a, 0xef, 0xac, 0xbc, 0x72, 0xd7, 0x97, 0xa7, 0xf2, + 0xb6, 0xb3, 0xeb, 0xa9, 0xb3, 0x47, 0x00, 0xdd, 0xc1, 0xb3, 0xde, 0xee, + 0xfe, 0x5d, 0xc9, 0xc4, 0x9e, 0xe0, 0x7d, 0x5f, 0xca, 0x7b, 0x67, 0x63, + 0xec, 0xae, 0x35, 0xd5, 0xe9, 0x23, 0x00, 0x6f, 0x61, 0xce, 0x9c, 0x39, + 0xbc, 0x86, 0x9f, 0x7e, 0xfa, 0xe9, 0x4e, 0xbb, 0xfc, 0x9e, 0x7c, 0xf2, + 0x49, 0xee, 0xfb, 0xd7, 0x5e, 0x7b, 0xcd, 0x63, 0xc5, 0x46, 0x4e, 0x18, + 0x39, 0xc1, 0x57, 0xaf, 0x5e, 0x45, 0x5a, 0x5a, 0x5a, 0xa7, 0x71, 0x76, + 0x84, 0xa7, 0x9e, 0x7a, 0xca, 0x2d, 0x61, 0x3b, 0x6b, 0x00, 0xf4, 0xef, + 0xdf, 0x9f, 0xb7, 0xa0, 0xbf, 0xfa, 0xea, 0x2b, 0xa7, 0x67, 0xcc, 0x06, + 0x83, 0x81, 0x7b, 0x2f, 0x2f, 0x2f, 0x0f, 0x7d, 0xfa, 0xf4, 0xf1, 0x08, + 0xff, 0xcc, 0xcc, 0x4c, 0x9e, 0x72, 0x7f, 0xea, 0xa9, 0xa7, 0x04, 0x8f, + 0x4f, 0x96, 0x2d, 0x5b, 0xc6, 0xc3, 0x75, 0xfe, 0xfc, 0xf9, 0x5e, 0xf3, + 0x85, 0x5c, 0x2e, 0xc7, 0x73, 0xcf, 0x3d, 0x07, 0x9a, 0xa6, 0x51, 0x5e, + 0x5e, 0x8e, 0xd4, 0xd4, 0x54, 0xde, 0xdc, 0x74, 0xc5, 0x00, 0x30, 0x9b, + 0xcd, 0xa0, 0x69, 0x1a, 0xb9, 0xb9, 0xb9, 0xe8, 0xd5, 0xab, 0x97, 0x4f, + 0x76, 0x3c, 0x1a, 0x8d, 0x06, 0x5b, 0xb7, 0x6e, 0xe5, 0xf0, 0xbb, 0x7e, + 0xfd, 0xba, 0xe0, 0x79, 0x6e, 0x44, 0x44, 0x04, 0xb6, 0x6e, 0xdd, 0x8a, + 0x6f, 0xbf, 0xfd, 0x16, 0xdf, 0x7e, 0xfb, 0x2d, 0x3e, 0xf9, 0xe4, 0x93, + 0x0e, 0xe7, 0x72, 0x5d, 0x59, 0x57, 0xe3, 0xc7, 0x8f, 0x47, 0x43, 0x43, + 0x03, 0x27, 0x0c, 0xa6, 0x4d, 0x9b, 0xe6, 0xf1, 0x6f, 0xd3, 0xd2, 0xd2, + 0x50, 0x58, 0x58, 0xc8, 0x8d, 0xe1, 0xeb, 0xaf, 0xbf, 0x46, 0x58, 0x58, + 0x98, 0xe0, 0x7b, 0x2c, 0x0d, 0x69, 0x9a, 0x16, 0xf4, 0xa4, 0x09, 0x41, + 0x56, 0x56, 0x16, 0x8f, 0x2f, 0xde, 0x7e, 0xfb, 0x6d, 0x28, 0x95, 0x4a, + 0xc1, 0xf6, 0x1b, 0x1b, 0x1b, 0x5d, 0x1a, 0x49, 0xee, 0xe2, 0x18, 0xba, + 0x63, 0xce, 0x3d, 0x15, 0xca, 0x42, 0xeb, 0xbc, 0xb3, 0xf2, 0xca, 0x57, + 0xf1, 0x06, 0x9d, 0x5d, 0x4f, 0x9d, 0x35, 0x00, 0xba, 0x83, 0x67, 0xbd, + 0xed, 0xdf, 0x1b, 0x99, 0xd8, 0x1d, 0xbc, 0xef, 0x4b, 0x79, 0xef, 0x6c, + 0x8c, 0xdd, 0xb5, 0xa6, 0xdc, 0x3d, 0x3e, 0x4b, 0x03, 0x3c, 0x7f, 0xfe, + 0x3c, 0xcf, 0x15, 0x31, 0x6d, 0xda, 0x34, 0x04, 0x07, 0x07, 0x7b, 0xed, + 0xea, 0x89, 0x8f, 0x8f, 0xc7, 0xdc, 0xb9, 0x73, 0x39, 0x17, 0xdf, 0xce, + 0x9d, 0x3b, 0x61, 0xb7, 0xdb, 0xbd, 0xc2, 0x45, 0xa9, 0x54, 0xf2, 0xdc, + 0xa2, 0x79, 0x79, 0x79, 0x28, 0x29, 0x29, 0xf1, 0x09, 0xce, 0x00, 0xa0, + 0xd5, 0x6a, 0xb9, 0x48, 0x52, 0xf6, 0x31, 0x18, 0x0c, 0x3e, 0x73, 0x35, + 0x46, 0x44, 0x44, 0x70, 0x9f, 0x7f, 0xfa, 0xe9, 0x27, 0x41, 0x77, 0x62, + 0x7c, 0x7c, 0x3c, 0x2e, 0x5c, 0xb8, 0xc0, 0xb3, 0x6a, 0x59, 0x6b, 0xd1, + 0x1d, 0xc4, 0xc6, 0xc6, 0xf2, 0x02, 0x1f, 0x0f, 0x1d, 0x3a, 0xd4, 0xe1, + 0x1d, 0xb3, 0xd9, 0x8c, 0x6b, 0xd7, 0xae, 0x75, 0x38, 0xa3, 0xf2, 0x16, + 0xd2, 0xd2, 0xd2, 0xf0, 0xc7, 0x3f, 0xfe, 0x91, 0x3b, 0xb2, 0xd1, 0xe9, + 0x74, 0x5d, 0x0a, 0xbc, 0x21, 0x77, 0x05, 0x52, 0xa9, 0x14, 0x00, 0x50, + 0x5a, 0x5a, 0xda, 0xe1, 0x68, 0xa2, 0xb3, 0x10, 0x1b, 0x1b, 0x8b, 0xb1, + 0x63, 0xc7, 0x72, 0x9f, 0x7f, 0xf8, 0xe1, 0x07, 0x5c, 0xbd, 0x7a, 0xb5, + 0xc3, 0x7b, 0x8d, 0x8d, 0x8d, 0x78, 0xec, 0xb1, 0xc7, 0x30, 0x7f, 0xfe, + 0x7c, 0x3c, 0xfc, 0xf0, 0xc3, 0x78, 0xe1, 0x85, 0x17, 0xba, 0x1c, 0x4d, + 0x4f, 0xba, 0x02, 0x3f, 0xff, 0xfc, 0x73, 0xce, 0xa0, 0x58, 0xb9, 0x72, + 0x25, 0x8e, 0x1c, 0x39, 0xe2, 0x95, 0x0b, 0x95, 0xe4, 0x85, 0xc2, 0xc2, + 0x42, 0xd4, 0xd7, 0xd7, 0x77, 0x78, 0x4f, 0x22, 0x91, 0xc0, 0x6c, 0x36, + 0x73, 0x9f, 0xc9, 0x5d, 0x92, 0x2b, 0x98, 0x34, 0x69, 0x12, 0xef, 0xf3, + 0xee, 0xdd, 0xbb, 0xd1, 0xdc, 0xdc, 0x2c, 0xb8, 0x4e, 0x8e, 0x1d, 0x3b, + 0xc6, 0x7d, 0xbe, 0xeb, 0xae, 0xbb, 0xb8, 0x63, 0xb7, 0x5b, 0x69, 0xce, + 0x3d, 0x5d, 0xe7, 0xdd, 0x25, 0xaf, 0x6e, 0x85, 0xf5, 0x74, 0xb3, 0x79, + 0xd6, 0x17, 0x32, 0xb1, 0xbb, 0x78, 0xbf, 0x3b, 0xe5, 0xfd, 0xcd, 0x5e, + 0x53, 0x3e, 0xe3, 0x1c, 0xb3, 0xd9, 0x8c, 0xa2, 0xa2, 0x22, 0xce, 0x4d, + 0x9c, 0x9c, 0x9c, 0x8c, 0xc8, 0xc8, 0x48, 0x34, 0x35, 0x35, 0x79, 0xd5, + 0x4e, 0x74, 0x74, 0x34, 0x46, 0x8f, 0x1e, 0x0d, 0x00, 0x38, 0x7c, 0xf8, + 0x70, 0xa7, 0x16, 0x79, 0x7c, 0x7c, 0x3c, 0xcf, 0x7a, 0x3a, 0x79, 0xf2, + 0x24, 0x5a, 0x5b, 0x5b, 0x7d, 0x86, 0xf3, 0xe1, 0xc3, 0x87, 0x31, 0x65, + 0xca, 0x14, 0x9e, 0x25, 0x25, 0x16, 0x8b, 0x71, 0xea, 0xd4, 0x29, 0x4e, + 0x40, 0x75, 0x45, 0xc8, 0x91, 0x0a, 0xe7, 0xcc, 0x99, 0x33, 0x82, 0xef, + 0x99, 0x4c, 0x26, 0x5e, 0xca, 0x49, 0x70, 0x70, 0xb0, 0xc7, 0x82, 0xe7, + 0xf4, 0xe9, 0xd3, 0x18, 0x32, 0x64, 0x08, 0x87, 0x7b, 0x63, 0x63, 0xa3, + 0xe0, 0x7b, 0x8e, 0x06, 0x85, 0xb7, 0xa9, 0x45, 0x51, 0x51, 0x51, 0x78, + 0xe1, 0x85, 0x17, 0x10, 0x13, 0x13, 0x83, 0xe3, 0xc7, 0x8f, 0x63, 0xd7, + 0xae, 0x5d, 0x5e, 0x7b, 0x73, 0x5c, 0xcd, 0x31, 0x0b, 0xf9, 0xf9, 0xf9, + 0x6e, 0xcf, 0x82, 0xbd, 0xa1, 0x3f, 0xe9, 0x56, 0x3f, 0x78, 0xf0, 0x20, + 0x4f, 0x50, 0xb0, 0x60, 0xb5, 0x5a, 0x61, 0xb5, 0x5a, 0x7d, 0x2e, 0x48, + 0xe3, 0xe2, 0xe2, 0xf0, 0xfa, 0xeb, 0xaf, 0x73, 0x01, 0x3e, 0xd9, 0xd9, + 0xd9, 0xf8, 0xe6, 0x9b, 0x6f, 0xbc, 0x32, 0x2e, 0x5a, 0x5b, 0x5b, 0x51, + 0x51, 0x51, 0xc1, 0x45, 0x25, 0x47, 0x47, 0x47, 0x43, 0x2e, 0x97, 0x77, + 0x38, 0x0f, 0x57, 0x28, 0x14, 0x3c, 0x7e, 0xbd, 0x72, 0xe5, 0x8a, 0xc7, + 0x46, 0x12, 0x09, 0xce, 0xd2, 0xdd, 0xaa, 0xaa, 0xaa, 0x78, 0xe7, 0xaa, + 0x29, 0x29, 0x29, 0x1e, 0x1b, 0x19, 0x3d, 0x39, 0xe7, 0x9e, 0xae, 0xf3, + 0xee, 0x92, 0x57, 0xb7, 0xc2, 0x7a, 0xba, 0xd9, 0x3c, 0xeb, 0x0b, 0x99, + 0xd8, 0x5d, 0xbc, 0xdf, 0x9d, 0xf2, 0xfe, 0x66, 0xaf, 0x29, 0x09, 0xe9, + 0x32, 0xe8, 0x4a, 0xb1, 0x03, 0xbd, 0x5e, 0xcf, 0x43, 0x3a, 0x26, 0x26, + 0xc6, 0x6b, 0xcb, 0x54, 0x2c, 0x16, 0x63, 0xf6, 0xec, 0xd9, 0x90, 0xc9, + 0x64, 0x00, 0xda, 0x22, 0x63, 0x3b, 0x93, 0xcf, 0xea, 0xe8, 0x0a, 0x77, + 0x96, 0xab, 0xdd, 0x59, 0x9c, 0x85, 0xbc, 0x09, 0xfd, 0xfb, 0xf7, 0x87, + 0xd5, 0x6a, 0xed, 0x32, 0x43, 0x14, 0x14, 0x14, 0x60, 0xc6, 0x8c, 0x19, + 0xdc, 0x67, 0x67, 0x96, 0xa6, 0x46, 0xa3, 0xe1, 0x31, 0x8d, 0xc1, 0x60, + 0xf0, 0x78, 0xfe, 0x6a, 0x6a, 0x6a, 0xdc, 0xe6, 0x28, 0x6b, 0x34, 0x1a, + 0x4c, 0x99, 0x32, 0x85, 0xfb, 0x5c, 0x5b, 0x5b, 0x8b, 0x13, 0x27, 0x4e, + 0x78, 0x35, 0x96, 0x21, 0x43, 0x86, 0xe0, 0x81, 0x07, 0x1e, 0x80, 0xcd, + 0x66, 0xc3, 0xca, 0x95, 0x2b, 0x51, 0x5c, 0x5c, 0xdc, 0x29, 0x6b, 0x55, + 0x2a, 0x95, 0x76, 0x10, 0xf6, 0x64, 0xaa, 0x53, 0x5e, 0x5e, 0x1e, 0x82, + 0x83, 0x83, 0x91, 0x99, 0x99, 0x89, 0x61, 0xc3, 0x86, 0x21, 0x38, 0x38, + 0x18, 0x75, 0x75, 0x75, 0x38, 0x71, 0xe2, 0x04, 0xaa, 0xaa, 0xaa, 0xbc, + 0xca, 0xd5, 0x77, 0x3c, 0x2a, 0x2a, 0x2c, 0x2c, 0x04, 0x00, 0xf4, 0xed, + 0xdb, 0x17, 0x91, 0x91, 0x91, 0x88, 0x8c, 0x8c, 0xe4, 0x72, 0x89, 0xeb, + 0xeb, 0xeb, 0x5d, 0x06, 0x0e, 0x95, 0x95, 0x95, 0xa1, 0x4f, 0x9f, 0x3e, + 0xb8, 0x7e, 0xfd, 0xba, 0xc7, 0xe3, 0x9c, 0x31, 0x63, 0x06, 0xee, 0xbd, + 0xf7, 0x5e, 0x00, 0x40, 0x43, 0x43, 0x03, 0x56, 0xae, 0x5c, 0xe9, 0x32, + 0x8f, 0xba, 0x6f, 0xdf, 0xbe, 0x1d, 0x3c, 0x35, 0xc5, 0xc5, 0xc5, 0xd8, + 0xbd, 0x7b, 0x37, 0x86, 0x0d, 0x1b, 0x06, 0x00, 0x98, 0x39, 0x73, 0x26, + 0x16, 0x2e, 0x5c, 0xd8, 0xc1, 0x9b, 0xb3, 0x70, 0xe1, 0x42, 0x6e, 0xad, + 0x95, 0x95, 0x95, 0xe1, 0xfc, 0xf9, 0xf3, 0x1e, 0xe1, 0x18, 0x14, 0x14, + 0xc4, 0x73, 0x35, 0xba, 0x5b, 0xd3, 0xa4, 0x20, 0xef, 0x4a, 0x40, 0x59, + 0x77, 0xcd, 0xb9, 0x37, 0xeb, 0xbc, 0x33, 0xf2, 0x4a, 0x88, 0x46, 0x9d, + 0x91, 0xb7, 0xbe, 0x5a, 0x4f, 0xee, 0xc0, 0x1b, 0xdc, 0xbc, 0xe5, 0xd9, + 0xce, 0x1c, 0x31, 0x78, 0x2a, 0x13, 0xbb, 0x8b, 0xf7, 0xbb, 0x53, 0xde, + 0xdf, 0xec, 0x35, 0xe5, 0xf6, 0x6c, 0xe2, 0xed, 0xb7, 0xdf, 0xe6, 0x7d, + 0xef, 0xe8, 0xaa, 0x20, 0x77, 0x8b, 0xdf, 0x7e, 0xfb, 0x2d, 0xef, 0x5d, + 0x57, 0x01, 0x0a, 0x42, 0xd0, 0xaf, 0x5f, 0x3f, 0x5c, 0xb8, 0x70, 0x81, + 0xcb, 0x73, 0x77, 0x15, 0x08, 0xe3, 0x0a, 0x7c, 0x8d, 0xb3, 0x27, 0xd0, + 0xbf, 0x7f, 0x7f, 0xb4, 0xb4, 0xb4, 0x74, 0x39, 0x06, 0xc0, 0x53, 0x98, + 0x36, 0x6d, 0x1a, 0xef, 0x0c, 0x2b, 0x37, 0x37, 0xb7, 0x53, 0x67, 0xe9, + 0x2c, 0xa8, 0xd5, 0x6a, 0x24, 0x24, 0x24, 0xa0, 0x5f, 0xbf, 0x7e, 0x08, + 0x0e, 0x0e, 0xc6, 0xf2, 0xe5, 0xcb, 0xb9, 0xb6, 0xed, 0x76, 0x3b, 0x66, + 0xcc, 0x98, 0xe1, 0x55, 0xbd, 0x84, 0xe4, 0xe4, 0x64, 0x2e, 0xd0, 0xf0, + 0x9b, 0x6f, 0xbe, 0xe1, 0x52, 0x64, 0x12, 0x13, 0x13, 0xf1, 0xeb, 0xaf, + 0xbf, 0x76, 0x29, 0x06, 0x40, 0x24, 0x12, 0xe1, 0xb3, 0xcf, 0x3e, 0xe3, + 0xc5, 0x6e, 0xe4, 0xe4, 0xe4, 0x74, 0xa0, 0xad, 0xdd, 0x6e, 0xc7, 0xd1, + 0xa3, 0x47, 0x91, 0x98, 0x98, 0xe8, 0x71, 0xae, 0xfe, 0x5f, 0xff, 0xfa, + 0x57, 0x5e, 0x20, 0x4e, 0x58, 0x58, 0x18, 0x16, 0x2c, 0x58, 0x80, 0x6b, + 0xd7, 0xae, 0xf1, 0xda, 0x36, 0x99, 0x4c, 0x38, 0x7c, 0xf8, 0x30, 0xee, + 0xb8, 0xe3, 0x0e, 0xde, 0xe2, 0x25, 0x61, 0xf2, 0xe4, 0xc9, 0x82, 0x06, + 0xa5, 0xb3, 0x79, 0x1f, 0x3c, 0x78, 0x30, 0xaa, 0xaa, 0xaa, 0xb8, 0x3e, + 0x5e, 0x7a, 0xe9, 0x25, 0x28, 0x14, 0x0a, 0xc1, 0x77, 0x1d, 0xf1, 0x72, + 0x84, 0xc4, 0xc4, 0x44, 0x1e, 0x8d, 0x2a, 0x2a, 0x2a, 0xf0, 0xc0, 0x03, + 0x0f, 0x60, 0xe8, 0xd0, 0xa1, 0x18, 0x37, 0x6e, 0x1c, 0xde, 0x7d, 0xf7, + 0x5d, 0x2e, 0x05, 0x54, 0xaf, 0xd7, 0x3b, 0xc5, 0x55, 0x08, 0x3e, 0xfe, + 0xf8, 0x63, 0x1e, 0x2d, 0x9c, 0x05, 0x50, 0x45, 0x47, 0x47, 0x63, 0xdf, + 0xbe, 0x7d, 0xbc, 0x77, 0x27, 0x4f, 0x9e, 0xec, 0x95, 0x4c, 0xe8, 0x8e, + 0x39, 0xf7, 0xd5, 0xd9, 0xb7, 0xa7, 0xf2, 0xca, 0xdb, 0xd4, 0xb9, 0xee, + 0x58, 0x4f, 0x9d, 0x4d, 0xe3, 0x73, 0x87, 0x97, 0x37, 0x3c, 0xdb, 0xdd, + 0x31, 0x08, 0x3d, 0xc1, 0xfb, 0x5d, 0x95, 0xf7, 0xce, 0xc6, 0xd8, 0x5d, + 0x6b, 0xca, 0xe3, 0x20, 0x40, 0x67, 0x88, 0xfd, 0xfd, 0xef, 0x7f, 0xe7, + 0x7d, 0x2f, 0x14, 0xd5, 0xc9, 0x82, 0x63, 0x2e, 0xeb, 0x88, 0x11, 0x23, + 0xbc, 0x5a, 0xec, 0xd3, 0xa7, 0x4f, 0xe7, 0xbe, 0xff, 0xf4, 0xd3, 0x4f, + 0x05, 0x05, 0xeb, 0xcb, 0x2f, 0xbf, 0xec, 0x56, 0x11, 0xf9, 0x1a, 0x67, + 0x4f, 0x20, 0x3d, 0x3d, 0xbd, 0xc7, 0x0c, 0x80, 0xa4, 0xa4, 0x24, 0xe4, + 0xe7, 0xe7, 0xf3, 0xda, 0x59, 0xb4, 0x68, 0x51, 0x97, 0x17, 0xcd, 0x3b, + 0xef, 0xbc, 0x83, 0xb3, 0x67, 0xcf, 0x72, 0x81, 0x3c, 0xec, 0xd3, 0xa7, + 0x4f, 0x1f, 0xa8, 0xd5, 0x6a, 0x8f, 0xdb, 0x52, 0x28, 0x14, 0x78, 0xe9, + 0xa5, 0x97, 0xb8, 0xe3, 0x85, 0xe1, 0xc3, 0x87, 0xf3, 0xfa, 0xe9, 0xaa, + 0x01, 0x10, 0x15, 0x15, 0x85, 0xbd, 0x7b, 0xf7, 0x72, 0x6d, 0x08, 0x15, + 0xfa, 0x20, 0x9f, 0x96, 0x96, 0x16, 0xcc, 0x99, 0x33, 0xc7, 0x23, 0x57, + 0xd9, 0xfa, 0xf5, 0xeb, 0x79, 0x11, 0xc4, 0xef, 0xbd, 0xf7, 0x9e, 0xcb, + 0x5a, 0x09, 0x46, 0xa3, 0x11, 0xf7, 0xdc, 0x73, 0x8f, 0x60, 0xfc, 0x85, + 0x33, 0x41, 0x28, 0x04, 0x91, 0x91, 0x91, 0xd8, 0xb6, 0x6d, 0x1b, 0xd7, + 0xee, 0x99, 0x33, 0x67, 0xd0, 0xaf, 0x5f, 0x3f, 0xa7, 0xef, 0x93, 0x78, + 0x39, 0x03, 0x8a, 0xa2, 0xb0, 0x7f, 0xff, 0x7e, 0x5e, 0xb4, 0xb3, 0xdd, + 0x6e, 0xef, 0x30, 0x9e, 0xf8, 0xf8, 0x78, 0xaf, 0x70, 0x7d, 0xf4, 0xd1, + 0x47, 0x79, 0xbf, 0x77, 0xb6, 0x26, 0xfb, 0xf6, 0xed, 0x0b, 0x9d, 0x4e, + 0xc7, 0x7b, 0xf7, 0xee, 0xbb, 0xef, 0xee, 0x94, 0x01, 0xe0, 0xcb, 0x39, + 0xf7, 0x95, 0xe2, 0xf1, 0x44, 0x5e, 0xf9, 0x42, 0xc9, 0xfa, 0x62, 0x3d, + 0x75, 0x87, 0xf2, 0xf7, 0x96, 0x67, 0x7b, 0xca, 0x00, 0xe8, 0x4e, 0xde, + 0xef, 0xaa, 0xbc, 0x77, 0x36, 0xc6, 0xee, 0x5a, 0x53, 0x5d, 0xae, 0x03, + 0xe0, 0x68, 0x45, 0x3b, 0xa6, 0x36, 0x91, 0xe0, 0x78, 0x56, 0xea, 0x69, + 0x50, 0x1a, 0xd0, 0x16, 0xe8, 0xc1, 0xe6, 0xd2, 0xd2, 0x34, 0x8d, 0xcd, + 0x9b, 0x37, 0x0b, 0x9e, 0x21, 0xad, 0x58, 0xb1, 0x02, 0x15, 0x15, 0x15, + 0x38, 0x74, 0xe8, 0x10, 0xea, 0xeb, 0xeb, 0xa1, 0x52, 0xa9, 0x3a, 0xb8, + 0x9b, 0x7c, 0x8d, 0xb3, 0x52, 0xa9, 0x44, 0x42, 0x42, 0x82, 0x57, 0x79, + 0xf6, 0xdd, 0x05, 0xfd, 0xfb, 0xf7, 0xc7, 0xae, 0x5d, 0xbb, 0xd0, 0xb7, + 0x6f, 0x5f, 0xee, 0x6f, 0xdb, 0xb6, 0x6d, 0xc3, 0x0f, 0x3f, 0xfc, 0xd0, + 0x65, 0x37, 0xd4, 0xe8, 0xd1, 0xa3, 0x05, 0x53, 0x21, 0xa3, 0xa2, 0xa2, + 0xbc, 0x2a, 0x71, 0x99, 0x9e, 0x9e, 0x8e, 0xa5, 0x4b, 0x97, 0x02, 0x00, + 0x3e, 0xfa, 0xe8, 0x23, 0x1e, 0xdd, 0x84, 0x5c, 0x8b, 0xde, 0x2e, 0x7a, + 0x8d, 0x46, 0xc3, 0x5b, 0x6c, 0x12, 0x89, 0x04, 0xd7, 0xae, 0x5d, 0xc3, + 0x27, 0x9f, 0x7c, 0x82, 0x86, 0x86, 0x06, 0xf4, 0xea, 0xd5, 0x0b, 0xf7, + 0xdf, 0x7f, 0x3f, 0xb7, 0x23, 0x0b, 0x08, 0x08, 0xc0, 0xc6, 0x8d, 0x1b, + 0x31, 0x79, 0xf2, 0x64, 0xfc, 0xfa, 0xeb, 0xaf, 0x2e, 0xdb, 0x26, 0x15, + 0x86, 0x54, 0x2a, 0xc5, 0xb3, 0xcf, 0x3e, 0x0b, 0x8a, 0xa2, 0xb0, 0x7b, + 0xf7, 0x6e, 0x9c, 0x3f, 0x7f, 0x1e, 0x72, 0xb9, 0x1c, 0xe3, 0xc6, 0x8d, + 0xe3, 0x3c, 0x45, 0x72, 0xb9, 0x1c, 0x5b, 0xb7, 0x6e, 0xc5, 0xb4, 0x69, + 0xd3, 0x3a, 0x04, 0x3d, 0xc9, 0xe5, 0x72, 0x8f, 0x4b, 0x76, 0x66, 0x66, + 0x66, 0x62, 0xd6, 0xac, 0x59, 0xdc, 0xe7, 0x0f, 0x3e, 0xf8, 0xc0, 0xe9, + 0xb9, 0x24, 0xbb, 0xd3, 0x65, 0xf1, 0x12, 0x02, 0x96, 0x67, 0xc9, 0x3a, + 0x18, 0xce, 0xce, 0x8b, 0x67, 0xce, 0x9c, 0x89, 0x8d, 0x1b, 0x37, 0x7a, + 0x8c, 0x6b, 0x5e, 0x5e, 0x1e, 0xf4, 0x7a, 0x3d, 0xa7, 0xf0, 0x84, 0xd6, + 0xa4, 0xdd, 0x6e, 0x47, 0x4e, 0x4e, 0x4e, 0x07, 0xa5, 0xe8, 0xaa, 0xaa, + 0x64, 0x4f, 0xcd, 0x39, 0x45, 0x51, 0x4e, 0xdd, 0xf2, 0xce, 0x78, 0xb4, + 0xb3, 0xf2, 0xca, 0x17, 0xe0, 0x8b, 0xf5, 0xc4, 0xbe, 0xe7, 0xcb, 0x1a, + 0x01, 0xde, 0xf2, 0x6c, 0x4f, 0x41, 0x77, 0xf2, 0x7e, 0x77, 0xc1, 0xcd, + 0x58, 0x53, 0x1e, 0xed, 0x48, 0xff, 0xf9, 0xcf, 0x7f, 0xf2, 0xbe, 0x27, + 0xad, 0x4f, 0x47, 0xf8, 0xfc, 0xf3, 0xcf, 0x79, 0xef, 0x3a, 0x16, 0xcc, + 0x70, 0xc5, 0x08, 0x64, 0x2e, 0xed, 0xe9, 0xd3, 0xa7, 0x79, 0x0a, 0xce, + 0xf1, 0xf7, 0x66, 0xb3, 0x19, 0xa7, 0x4e, 0x9d, 0xc2, 0x0f, 0x3f, 0xfc, + 0x80, 0x03, 0x07, 0x0e, 0x74, 0x3b, 0xce, 0x01, 0x01, 0x01, 0xbc, 0x72, + 0xb0, 0x42, 0x01, 0x85, 0xbe, 0xb6, 0x08, 0x85, 0x5c, 0xf4, 0xd3, 0xa6, + 0x4d, 0xe3, 0xa5, 0xb8, 0xd0, 0x34, 0x8d, 0x5f, 0x7f, 0xfd, 0xd5, 0x29, + 0x73, 0x7b, 0x13, 0xb5, 0x9f, 0x9c, 0x9c, 0x8c, 0xcd, 0x9b, 0x37, 0x63, + 0xff, 0xfe, 0xfd, 0xb8, 0x74, 0xe9, 0x52, 0x87, 0x2a, 0x5a, 0xaf, 0xbe, + 0xfa, 0xaa, 0x47, 0x15, 0xfb, 0x62, 0x62, 0x62, 0xb0, 0x65, 0xcb, 0x16, + 0xd0, 0x34, 0x8d, 0x6b, 0xd7, 0xae, 0x71, 0x05, 0x37, 0x5c, 0xed, 0x58, + 0xbc, 0x3d, 0xc7, 0x4c, 0x4b, 0x4b, 0xc3, 0xe1, 0xc3, 0x87, 0x71, 0xf6, + 0xec, 0x59, 0x5c, 0xb9, 0x72, 0x05, 0x9f, 0x7f, 0xfe, 0x79, 0x87, 0x36, + 0x44, 0x22, 0x11, 0xaf, 0x52, 0x17, 0x4d, 0xd3, 0xd8, 0xba, 0x75, 0xab, + 0x60, 0x6a, 0x0d, 0x09, 0x64, 0x0a, 0x20, 0x4d, 0xd3, 0x68, 0x6e, 0x6e, + 0x46, 0x56, 0x56, 0x16, 0xb7, 0x4b, 0x10, 0x8b, 0xc5, 0xe8, 0xd3, 0xa7, + 0x0f, 0x0e, 0x1c, 0x38, 0xc0, 0x7b, 0xef, 0xdb, 0x6f, 0xbf, 0xed, 0x40, + 0xef, 0x77, 0xde, 0x79, 0xc7, 0xa3, 0xda, 0x03, 0x71, 0x71, 0x71, 0xbc, + 0x0a, 0x77, 0xee, 0xf8, 0x5f, 0x08, 0x2f, 0xc7, 0xb1, 0x0b, 0xf1, 0xec, + 0xce, 0x9d, 0x3b, 0xf1, 0xce, 0x3b, 0xef, 0xe0, 0xe3, 0x8f, 0x3f, 0xc6, + 0xa9, 0x53, 0xa7, 0x78, 0xf8, 0x7b, 0x8a, 0x2b, 0x2b, 0x70, 0x5e, 0x7f, + 0xfd, 0x75, 0xde, 0xef, 0x1d, 0xd7, 0xa4, 0xa3, 0x17, 0x89, 0x7d, 0xee, + 0xb9, 0xe7, 0x9e, 0x4e, 0x79, 0xc5, 0x7c, 0x3d, 0xe7, 0x5d, 0xdd, 0x8d, + 0x7a, 0x23, 0xaf, 0xba, 0xb2, 0xd3, 0xf6, 0xf5, 0x7a, 0xf2, 0xd5, 0xee, + 0xbf, 0x33, 0x3c, 0xeb, 0x8b, 0x7e, 0x1d, 0x65, 0x62, 0x77, 0xf3, 0xbe, + 0x33, 0x5c, 0x7c, 0x2d, 0xef, 0xbb, 0x7b, 0x4d, 0x75, 0xfa, 0x08, 0xc0, + 0x1b, 0x60, 0x19, 0x95, 0x7d, 0xd8, 0x40, 0x0c, 0x4f, 0x0c, 0x80, 0x3f, + 0xfc, 0xe1, 0x0f, 0xdc, 0xef, 0x5e, 0x79, 0xe5, 0x15, 0xc1, 0x77, 0x9c, + 0xb9, 0x62, 0x1d, 0x61, 0xed, 0xda, 0xb5, 0xbc, 0xef, 0xef, 0xb8, 0xe3, + 0x8e, 0x2e, 0xe1, 0x4c, 0xd6, 0xdb, 0x6e, 0x6a, 0x6a, 0x12, 0x54, 0xac, + 0xdd, 0x69, 0x00, 0x24, 0x26, 0x26, 0x62, 0xf9, 0xf2, 0xe5, 0xbc, 0xbc, + 0x7f, 0x9a, 0xa6, 0x71, 0xf8, 0xf0, 0x61, 0x97, 0x31, 0x0b, 0x42, 0xb5, + 0x0f, 0x9c, 0x81, 0x44, 0x22, 0x81, 0x46, 0xa3, 0x41, 0x5c, 0x5c, 0x1c, + 0x52, 0x53, 0x53, 0x31, 0x7d, 0xfa, 0xf4, 0x0e, 0x65, 0x94, 0x97, 0x2f, + 0x5f, 0xee, 0x36, 0xe8, 0xe5, 0xbe, 0xfb, 0xee, 0xe3, 0xdc, 0xb3, 0x0b, + 0x16, 0x2c, 0xe8, 0xf0, 0x7d, 0x42, 0x42, 0x42, 0x07, 0x81, 0xe5, 0xa9, + 0xe2, 0x61, 0x21, 0x36, 0x36, 0x16, 0x7d, 0xfb, 0xf6, 0x45, 0x6a, 0x6a, + 0x2a, 0x52, 0x53, 0x53, 0x9d, 0xd6, 0x3f, 0x18, 0x35, 0x6a, 0x14, 0xcf, + 0x55, 0x5c, 0x58, 0x58, 0xd8, 0x41, 0x80, 0x3a, 0xc2, 0x86, 0x0d, 0x1b, + 0x3a, 0x08, 0x07, 0x67, 0x67, 0xc9, 0xc5, 0xc5, 0xc5, 0xdc, 0x7b, 0x35, + 0x35, 0x35, 0x1d, 0xe8, 0x4d, 0xd3, 0x34, 0x16, 0x2f, 0x5e, 0xec, 0x76, + 0x3c, 0x13, 0x27, 0x4e, 0xe4, 0x19, 0x5c, 0xcf, 0x3f, 0xff, 0xbc, 0x5b, + 0x01, 0xee, 0x0a, 0xaf, 0xfe, 0xfd, 0xfb, 0x0b, 0xf2, 0x2c, 0xfb, 0xbe, + 0x48, 0x24, 0x42, 0x5c, 0x5c, 0x1c, 0xbe, 0xfe, 0xfa, 0x6b, 0xde, 0x58, + 0x3d, 0xc1, 0x95, 0x54, 0x00, 0x2f, 0xbf, 0xfc, 0xb2, 0xcb, 0xe3, 0x91, + 0xbc, 0xbc, 0x3c, 0xfc, 0xf5, 0xaf, 0x7f, 0xe5, 0xd5, 0x9c, 0x98, 0x3a, + 0x75, 0x6a, 0xa7, 0x0c, 0x00, 0x5f, 0xcf, 0x79, 0x57, 0x95, 0x90, 0x27, + 0xf2, 0xca, 0x17, 0x4a, 0xcf, 0xd7, 0xeb, 0xc9, 0x57, 0x8a, 0xb8, 0x33, + 0x3c, 0xeb, 0x4b, 0x03, 0x80, 0x95, 0x89, 0xde, 0xf2, 0xbe, 0x58, 0x2c, + 0xf6, 0x8a, 0xf7, 0x7b, 0xca, 0x00, 0xe8, 0xee, 0x35, 0xd5, 0x23, 0x06, + 0x80, 0x63, 0xc7, 0x42, 0xee, 0x64, 0x21, 0x48, 0x48, 0x48, 0xc0, 0xcf, + 0x3f, 0xff, 0xcc, 0xed, 0x6c, 0x9c, 0x29, 0xb5, 0xc9, 0x93, 0x27, 0xe3, + 0xa7, 0x9f, 0x7e, 0xe2, 0x14, 0xa1, 0xd5, 0x6a, 0xc5, 0x8d, 0x1b, 0x37, + 0x3a, 0xbc, 0xf7, 0xb7, 0xbf, 0xfd, 0x8d, 0x87, 0x87, 0x10, 0x81, 0x80, + 0xb6, 0x7a, 0xef, 0xff, 0xfa, 0xd7, 0xbf, 0xdc, 0xe2, 0x4c, 0x06, 0x18, + 0x3d, 0xf7, 0xdc, 0x73, 0x82, 0x51, 0x97, 0x5d, 0x61, 0x08, 0x77, 0x6e, + 0x36, 0xb2, 0xb2, 0x15, 0x1b, 0x80, 0xb6, 0x66, 0xcd, 0x1a, 0xa7, 0x16, + 0x37, 0x29, 0x0c, 0xbb, 0x02, 0xf1, 0xf1, 0xf1, 0x3c, 0xa3, 0x23, 0x3f, + 0x3f, 0xdf, 0xe5, 0x19, 0x5f, 0x74, 0x74, 0x34, 0x57, 0xa1, 0xec, 0xe2, + 0xc5, 0x8b, 0x08, 0x0d, 0x0d, 0x45, 0x5a, 0x5a, 0x1a, 0xef, 0x89, 0x89, + 0x89, 0xe1, 0x05, 0xd4, 0x5d, 0xb9, 0x72, 0x05, 0x31, 0x31, 0x31, 0x48, + 0x4f, 0x4f, 0xf7, 0x79, 0x44, 0x73, 0x6a, 0x6a, 0x2a, 0x17, 0xa4, 0x45, + 0xd3, 0x34, 0x0c, 0x06, 0x83, 0x60, 0x51, 0x1f, 0x12, 0xd6, 0xac, 0x59, + 0xe3, 0xd6, 0x23, 0xc4, 0x5a, 0xec, 0x8e, 0xde, 0x02, 0x47, 0x7a, 0xb3, + 0x34, 0x73, 0x35, 0x4f, 0xa1, 0xa1, 0xa1, 0xf8, 0xf2, 0xcb, 0x2f, 0x79, + 0x29, 0x99, 0xce, 0x70, 0xf4, 0x04, 0x2f, 0x00, 0x5c, 0xa1, 0x18, 0x77, + 0x3c, 0x2b, 0x95, 0x4a, 0x71, 0xfd, 0xfa, 0x75, 0xde, 0xfc, 0xba, 0xe3, + 0x29, 0x12, 0x82, 0x83, 0x83, 0x9d, 0xae, 0xc9, 0x55, 0xab, 0x56, 0x21, + 0x26, 0x26, 0x06, 0x4f, 0x3f, 0xfd, 0x34, 0x0f, 0x6f, 0xa1, 0x6a, 0x92, + 0xbe, 0x94, 0x3f, 0x9e, 0xce, 0x79, 0x57, 0x94, 0x90, 0xa7, 0xf2, 0xaa, + 0xab, 0x4a, 0xaf, 0x3b, 0xd6, 0x93, 0x2f, 0x14, 0x71, 0x67, 0x79, 0xd6, + 0x57, 0xca, 0x9f, 0x94, 0x89, 0xdd, 0xcd, 0xfb, 0x3d, 0x69, 0x00, 0x74, + 0xd7, 0x9a, 0xea, 0xb6, 0xbb, 0x00, 0x5c, 0x41, 0x6d, 0x6d, 0xad, 0xc7, + 0x79, 0xd2, 0x51, 0x51, 0x51, 0x9c, 0xf0, 0xfc, 0xe5, 0x97, 0x5f, 0x9c, + 0xe6, 0xd2, 0xee, 0xdf, 0xbf, 0x1f, 0x17, 0x2e, 0x5c, 0x80, 0x46, 0xa3, + 0x81, 0x42, 0xa1, 0x80, 0xc5, 0x62, 0x11, 0xcc, 0x05, 0xbe, 0x7c, 0xf9, + 0x32, 0xef, 0xb3, 0x50, 0xc9, 0x48, 0xf6, 0x5c, 0x91, 0x2c, 0xfc, 0xe3, + 0x0e, 0x67, 0x8a, 0xa2, 0x70, 0xf8, 0xf0, 0x61, 0x97, 0x31, 0x05, 0xbe, + 0x84, 0x31, 0x63, 0xc6, 0xe0, 0xd3, 0x4f, 0x3f, 0xe5, 0x29, 0xdd, 0xe2, + 0xe2, 0x62, 0x2c, 0x5e, 0xbc, 0x18, 0x87, 0x0f, 0x1f, 0x46, 0x5d, 0x5d, + 0x9d, 0x5b, 0x01, 0xdd, 0x15, 0x08, 0x08, 0x08, 0xc0, 0xc5, 0x8b, 0x17, + 0x39, 0xaf, 0x48, 0x4a, 0x4a, 0x0a, 0x97, 0x3a, 0x23, 0x04, 0x32, 0x99, + 0x8c, 0x9b, 0x8f, 0xb4, 0xb4, 0x34, 0x5c, 0xbe, 0x7c, 0xb9, 0x03, 0x3d, + 0xa5, 0x52, 0x29, 0xcf, 0x83, 0x92, 0x92, 0x92, 0x82, 0x82, 0x82, 0x02, + 0x58, 0x2c, 0x16, 0x2c, 0x5d, 0xba, 0x14, 0x9b, 0x37, 0x6f, 0xf6, 0x19, + 0xfd, 0x9a, 0x9b, 0x9b, 0x79, 0x34, 0x52, 0x2a, 0x95, 0x6e, 0xcf, 0x77, + 0x8b, 0x8a, 0x8a, 0x78, 0x1e, 0x27, 0xa1, 0x22, 0x22, 0x00, 0xd0, 0xd2, + 0xd2, 0xd2, 0x21, 0xd5, 0x4c, 0x88, 0xde, 0xe9, 0xe9, 0xe9, 0x2e, 0x83, + 0x56, 0x63, 0x63, 0x63, 0xb9, 0x14, 0x2a, 0x00, 0xc8, 0xcd, 0xcd, 0x75, + 0x9b, 0xa2, 0xe9, 0x0a, 0x2f, 0xa5, 0x52, 0xc9, 0xcb, 0x7a, 0x71, 0xc5, + 0xb3, 0x41, 0x41, 0x41, 0x38, 0x7f, 0xfe, 0x3c, 0x97, 0x5e, 0xe7, 0x0e, + 0x57, 0x47, 0x68, 0x6a, 0x6a, 0x72, 0xba, 0x26, 0x4b, 0x4b, 0x4b, 0x61, + 0x34, 0x1a, 0x79, 0x8a, 0x41, 0xab, 0xd5, 0x76, 0x7b, 0xee, 0x7e, 0x67, + 0xe6, 0xdc, 0x5b, 0xf0, 0x54, 0x5e, 0x79, 0x0b, 0x8e, 0x78, 0xde, 0x6a, + 0xeb, 0xa9, 0x2b, 0x3c, 0xdb, 0x9d, 0x32, 0xf1, 0x66, 0xf0, 0x7e, 0x77, + 0x41, 0x4f, 0xaf, 0xa9, 0x6e, 0x33, 0x00, 0xaa, 0xab, 0xab, 0x05, 0x0b, + 0xa8, 0x38, 0x82, 0x58, 0x2c, 0xc6, 0x9c, 0x39, 0x73, 0x78, 0xb9, 0xb4, + 0xae, 0xae, 0x94, 0x65, 0xaf, 0x99, 0x74, 0x05, 0x8e, 0x79, 0x9b, 0xce, + 0x76, 0xad, 0x2a, 0x95, 0x8a, 0x67, 0xb5, 0xb9, 0xc3, 0xd9, 0x6a, 0xb5, + 0xfa, 0x3c, 0x58, 0xc4, 0x95, 0x70, 0x5a, 0xbf, 0x7e, 0x3d, 0x0f, 0xf7, + 0x9d, 0x3b, 0x77, 0xe2, 0xd5, 0x57, 0x5f, 0x75, 0x7b, 0xe9, 0x0c, 0xc9, + 0x1c, 0x42, 0xbb, 0xf4, 0x17, 0x5e, 0x78, 0x81, 0x53, 0x56, 0x2d, 0x2d, + 0x2d, 0x78, 0xff, 0xfd, 0xf7, 0x79, 0x8a, 0x8f, 0x14, 0xa6, 0x64, 0x60, + 0x53, 0x40, 0x40, 0x80, 0x57, 0xbb, 0x34, 0xf6, 0x32, 0x21, 0x77, 0xc0, + 0x0a, 0x30, 0x4f, 0xf2, 0x59, 0x25, 0x12, 0x09, 0x54, 0x2a, 0x15, 0x67, + 0xc1, 0x52, 0x14, 0x05, 0x93, 0xc9, 0x24, 0x38, 0x2f, 0x22, 0x91, 0x88, + 0x47, 0xdf, 0xe6, 0xe6, 0x66, 0xb7, 0xf8, 0x3b, 0x56, 0xfd, 0x73, 0x85, + 0x93, 0x63, 0x5b, 0x42, 0xf4, 0x96, 0x48, 0x24, 0x4e, 0xd3, 0x04, 0x01, + 0x60, 0xdc, 0xb8, 0x71, 0xbc, 0xb3, 0xcc, 0xec, 0xec, 0x6c, 0xc1, 0x80, + 0xcb, 0xbb, 0xee, 0xba, 0xcb, 0x23, 0xbc, 0x82, 0x83, 0x83, 0x79, 0x25, + 0x89, 0x5d, 0xf1, 0xac, 0x56, 0xab, 0xe5, 0xe5, 0x54, 0xbb, 0xc3, 0xd5, + 0xdb, 0x35, 0x19, 0x1e, 0x1e, 0x8e, 0xe4, 0xe4, 0x64, 0x1e, 0x6d, 0x5d, + 0xad, 0x1f, 0x67, 0x6b, 0xa1, 0xbb, 0xe7, 0xdc, 0x1b, 0xf0, 0x54, 0x5e, + 0x75, 0x47, 0xd0, 0x5b, 0x77, 0xac, 0xa7, 0xce, 0xc8, 0x27, 0x4f, 0x79, + 0xb6, 0xb3, 0x34, 0xf0, 0x46, 0x26, 0xde, 0x6c, 0xde, 0xef, 0x2e, 0xf0, + 0xd5, 0x9a, 0xf2, 0xa9, 0x01, 0x90, 0x98, 0x98, 0x88, 0x01, 0x03, 0x06, + 0x70, 0x8b, 0xb0, 0xa0, 0xa0, 0xc0, 0x69, 0xc1, 0x87, 0xd3, 0xa7, 0x4f, + 0xbb, 0x55, 0xd4, 0x40, 0x5b, 0xf0, 0x19, 0x6b, 0x4d, 0x96, 0x97, 0x97, + 0x3b, 0x2d, 0x36, 0xc3, 0x4e, 0x7a, 0x6b, 0x6b, 0x2b, 0xca, 0xca, 0xca, + 0x5c, 0xb6, 0x79, 0xe3, 0xc6, 0x0d, 0x54, 0x57, 0x57, 0x73, 0xca, 0x7d, + 0xe8, 0xd0, 0xa1, 0x08, 0x0b, 0x0b, 0xeb, 0xb0, 0x6b, 0x92, 0xc9, 0x64, + 0xbc, 0xe2, 0x22, 0xee, 0x70, 0x96, 0x48, 0x24, 0x9d, 0x4a, 0x19, 0xf1, + 0x16, 0xd2, 0xd2, 0xd2, 0xb0, 0x61, 0xc3, 0x06, 0xde, 0x6d, 0x53, 0xeb, + 0xd6, 0xad, 0xc3, 0x8b, 0x2f, 0xbe, 0x28, 0x18, 0x80, 0xe8, 0x0c, 0x72, + 0x73, 0x73, 0x3b, 0xfc, 0xad, 0xa1, 0xa1, 0x01, 0x09, 0x09, 0x09, 0x5c, + 0xf9, 0xd2, 0x9a, 0x9a, 0x1a, 0x7c, 0xf8, 0xe1, 0x87, 0x4e, 0xdd, 0xdc, + 0x64, 0x24, 0x2d, 0x9b, 0x7e, 0xe2, 0x0c, 0x44, 0x22, 0x11, 0x6a, 0x6b, + 0x6b, 0xb1, 0x7f, 0xff, 0x7e, 0xa7, 0xef, 0x04, 0x05, 0x05, 0x75, 0x48, + 0xb5, 0x3c, 0x76, 0xec, 0x18, 0x0c, 0x06, 0x03, 0x5a, 0x5a, 0x5a, 0xdc, + 0x8e, 0x49, 0xa9, 0x54, 0xe2, 0xdd, 0x77, 0xdf, 0xe5, 0x84, 0xa1, 0xcd, + 0x66, 0xc3, 0xe2, 0xc5, 0x8b, 0x05, 0x0b, 0xbf, 0xa8, 0x54, 0x2a, 0x5e, + 0x4a, 0x54, 0x69, 0x69, 0xa9, 0x5b, 0xaf, 0x54, 0x49, 0x49, 0x09, 0xea, + 0xea, 0xea, 0x10, 0x1e, 0x1e, 0x0e, 0x91, 0x48, 0x84, 0x94, 0x94, 0x14, + 0x9c, 0x3d, 0x7b, 0xb6, 0xc3, 0x7b, 0x21, 0x21, 0x21, 0xbc, 0xb3, 0xe5, + 0xe6, 0xe6, 0x66, 0x41, 0x03, 0x80, 0xcd, 0x35, 0x76, 0x26, 0xd0, 0xa7, + 0x4f, 0x9f, 0xce, 0x13, 0x58, 0x42, 0x73, 0xe6, 0x0d, 0x5e, 0x26, 0x93, + 0x89, 0xd7, 0x9f, 0x2b, 0x9e, 0x8d, 0x88, 0x88, 0xe0, 0x79, 0x2d, 0x5c, + 0xe1, 0xea, 0xe8, 0x02, 0x0f, 0x0c, 0x0c, 0xe4, 0x2a, 0x4f, 0x3a, 0x5b, + 0x93, 0x91, 0x91, 0x91, 0xbc, 0x6b, 0xa4, 0x8f, 0x1c, 0x39, 0xe2, 0xb6, + 0xb8, 0xce, 0xcd, 0x98, 0x73, 0x6f, 0x14, 0x91, 0xa7, 0xf2, 0xaa, 0x33, + 0xe0, 0x58, 0x80, 0xa7, 0x27, 0xd6, 0x53, 0x67, 0x8c, 0x10, 0x4f, 0x79, + 0xb6, 0x27, 0x64, 0x62, 0x4f, 0xf3, 0x7e, 0x77, 0x41, 0x4f, 0xaf, 0x29, + 0xde, 0xc0, 0x3d, 0x3d, 0x7b, 0x71, 0xcc, 0x99, 0x17, 0xba, 0x8e, 0xd2, + 0xd3, 0xfb, 0xac, 0x59, 0xb8, 0xfb, 0xee, 0xbb, 0xb9, 0xdf, 0x7c, 0xfc, + 0xf1, 0xc7, 0x82, 0x29, 0x0d, 0xf9, 0xf9, 0xf9, 0x28, 0x28, 0x28, 0x40, + 0x41, 0x41, 0x01, 0x56, 0xae, 0x5c, 0xe9, 0x36, 0x27, 0xdd, 0x31, 0x67, + 0xb8, 0xb2, 0xb2, 0xb2, 0x43, 0x04, 0xbb, 0x58, 0x2c, 0xc6, 0xe2, 0xc5, + 0x8b, 0x79, 0x81, 0x2c, 0xce, 0x70, 0x26, 0xc7, 0xfc, 0xc2, 0x0b, 0x2f, + 0x08, 0xba, 0x8a, 0x7c, 0x55, 0x07, 0x40, 0x2e, 0x97, 0xf3, 0x8a, 0xd1, + 0xb0, 0x39, 0xa1, 0x5d, 0x75, 0xe7, 0x93, 0xf0, 0xc2, 0x0b, 0x2f, 0xf0, + 0xce, 0xc9, 0x06, 0x0d, 0x1a, 0x24, 0x28, 0xec, 0xa6, 0x4e, 0x9d, 0xca, + 0x8b, 0x01, 0x38, 0x78, 0xf0, 0xa0, 0xcb, 0x73, 0x7a, 0xb5, 0x5a, 0x8d, + 0xd8, 0xd8, 0x58, 0xc4, 0xc5, 0xc5, 0x21, 0x36, 0x36, 0x96, 0x7b, 0x62, + 0x62, 0x62, 0x10, 0x1d, 0x1d, 0x8d, 0xa8, 0xa8, 0x28, 0x84, 0x84, 0x84, + 0xf0, 0x6e, 0xbd, 0x3a, 0x79, 0xf2, 0x24, 0x42, 0x42, 0x42, 0x10, 0x13, + 0x13, 0x23, 0x48, 0x2f, 0x21, 0x58, 0xb5, 0x6a, 0x15, 0x8f, 0x3e, 0xf7, + 0xdd, 0x77, 0x5f, 0x87, 0xa3, 0x09, 0xb1, 0x58, 0x8c, 0x07, 0x1f, 0x7c, + 0x90, 0x77, 0xab, 0xdf, 0x86, 0x0d, 0x1b, 0xdc, 0x1a, 0x70, 0x11, 0x11, + 0x11, 0xf8, 0xfe, 0xfb, 0xef, 0x79, 0x59, 0x16, 0x42, 0xc1, 0x76, 0x83, + 0x06, 0x0d, 0x42, 0x65, 0x65, 0x25, 0xef, 0x3d, 0xc7, 0xe0, 0x2b, 0xf6, + 0x32, 0x21, 0x67, 0xc1, 0x98, 0x69, 0x69, 0x69, 0xb8, 0x71, 0xe3, 0x06, + 0xd7, 0xc6, 0xf9, 0xf3, 0xe7, 0x9d, 0xee, 0x6e, 0x3c, 0xc5, 0x0b, 0x00, + 0x56, 0xaf, 0x5e, 0xed, 0x11, 0xcf, 0xf6, 0xeb, 0xd7, 0x0f, 0xd5, 0xd5, + 0xd5, 0xbc, 0x8b, 0x8f, 0x3c, 0x09, 0x1c, 0x8d, 0x8f, 0x8f, 0x77, 0xbb, + 0x26, 0xe5, 0x72, 0x39, 0x9e, 0x7e, 0xfa, 0x69, 0x8e, 0xfe, 0x36, 0x9b, + 0x0d, 0xe3, 0xc7, 0x8f, 0x77, 0xb9, 0xbe, 0x7a, 0x72, 0xce, 0x3b, 0x7b, + 0x0e, 0xed, 0x89, 0xbc, 0xf2, 0xb4, 0x7d, 0x77, 0x7d, 0x76, 0xc7, 0x7a, + 0xea, 0xea, 0x59, 0xbc, 0xa7, 0x3c, 0xeb, 0xcb, 0x9a, 0x03, 0xde, 0xc8, + 0x44, 0x5f, 0xf3, 0x7e, 0x4f, 0xc5, 0x00, 0x74, 0xd7, 0x9a, 0xf2, 0x69, + 0x10, 0xa0, 0xa3, 0x01, 0x20, 0xa4, 0x30, 0x3d, 0x8d, 0xb6, 0x66, 0x5d, + 0x36, 0x6c, 0x20, 0x95, 0xab, 0xc1, 0x38, 0x5e, 0xdd, 0x38, 0x69, 0xd2, + 0x24, 0xc4, 0xc4, 0xc4, 0x40, 0x2e, 0x97, 0x3b, 0x55, 0x8c, 0xb3, 0x67, + 0xcf, 0xe6, 0xe1, 0xba, 0x67, 0xcf, 0x1e, 0xa8, 0xd5, 0x6a, 0x44, 0x44, + 0x44, 0x20, 0x34, 0x34, 0x14, 0x51, 0x51, 0x51, 0xbc, 0x1b, 0xa6, 0x9c, + 0xe1, 0x3c, 0x66, 0xcc, 0x98, 0x0e, 0x45, 0x47, 0x84, 0xc6, 0xed, 0x2b, + 0x03, 0x20, 0x2d, 0x2d, 0x0d, 0xa5, 0xa5, 0xa5, 0xbc, 0x82, 0x27, 0x79, + 0x79, 0x79, 0x58, 0xb3, 0x66, 0x0d, 0xd6, 0xac, 0x59, 0x83, 0xf7, 0xde, + 0x7b, 0x4f, 0xf0, 0xf9, 0xe0, 0x83, 0x0f, 0x3c, 0x76, 0x11, 0x0e, 0x1e, + 0x3c, 0x98, 0x73, 0x8d, 0xb2, 0x81, 0x52, 0x77, 0xdd, 0x75, 0x17, 0x92, + 0x93, 0x93, 0x11, 0x1a, 0x1a, 0x8a, 0xd8, 0xd8, 0x58, 0xa8, 0x54, 0xaa, + 0x0e, 0x59, 0x00, 0x42, 0x51, 0xc8, 0xde, 0x82, 0x50, 0xda, 0x92, 0xb7, + 0x59, 0x00, 0x23, 0x47, 0x8e, 0x84, 0xc9, 0x64, 0xe2, 0x5d, 0x8b, 0x39, + 0x65, 0xca, 0x14, 0x24, 0x26, 0x26, 0x22, 0x28, 0x28, 0x08, 0xa1, 0xa1, + 0xa1, 0x48, 0x4c, 0x4c, 0x44, 0x5d, 0x5d, 0x1d, 0xaf, 0x30, 0x8c, 0xa7, + 0x45, 0x9e, 0xa6, 0x4e, 0x9d, 0xca, 0x33, 0x0c, 0x37, 0x6f, 0xde, 0x8c, + 0x8c, 0x8c, 0x0c, 0x9e, 0x8b, 0xf1, 0xe8, 0xd1, 0xa3, 0x3c, 0xda, 0xdc, + 0x7f, 0xff, 0xfd, 0x82, 0x73, 0xbd, 0x76, 0xed, 0x5a, 0xa7, 0x4a, 0xe2, + 0x8e, 0x3b, 0xee, 0xe8, 0x90, 0x4a, 0xe8, 0xaa, 0x58, 0x91, 0x33, 0xbc, + 0x3c, 0xe5, 0xd9, 0x7e, 0xfd, 0xfa, 0x71, 0xf3, 0x2b, 0x93, 0xc9, 0x3a, + 0xa4, 0xcc, 0xb9, 0xc2, 0x95, 0x04, 0xa1, 0xeb, 0x54, 0x1d, 0xd7, 0x64, + 0x46, 0x46, 0x06, 0x2f, 0x15, 0x2b, 0x27, 0x27, 0x47, 0xf0, 0xea, 0x62, + 0x4f, 0x65, 0x8f, 0xaf, 0xe7, 0xbc, 0x33, 0x8a, 0xc8, 0x53, 0x79, 0xe5, + 0x2b, 0x03, 0xa0, 0x3b, 0xd6, 0x53, 0x57, 0xf1, 0xf1, 0x94, 0x67, 0x7d, + 0x69, 0x00, 0xb8, 0x92, 0x89, 0xdd, 0xcd, 0xfb, 0x3d, 0x65, 0x00, 0x74, + 0xd7, 0x9a, 0xf2, 0xda, 0x00, 0x70, 0xc5, 0x84, 0x9e, 0x1a, 0x00, 0x4f, + 0x3d, 0xf5, 0x94, 0x47, 0xa5, 0x15, 0x33, 0x32, 0x32, 0x38, 0x25, 0x73, + 0xfc, 0xf8, 0x71, 0xa7, 0xa9, 0x3d, 0xb3, 0x67, 0xcf, 0xe6, 0x2d, 0x7e, + 0x9b, 0xcd, 0x86, 0xbd, 0x7b, 0xf7, 0x62, 0xcb, 0x96, 0x2d, 0xd8, 0xb7, + 0x6f, 0x9f, 0xe0, 0x25, 0x38, 0x89, 0x89, 0x89, 0x1d, 0x84, 0x74, 0x49, + 0x49, 0x09, 0x76, 0xef, 0xde, 0x8d, 0x9c, 0x9c, 0x1c, 0xde, 0x2e, 0xc1, + 0x15, 0xce, 0xe1, 0xe1, 0xe1, 0xf8, 0xe0, 0x83, 0x0f, 0x78, 0xef, 0x0a, + 0x05, 0x95, 0xf8, 0xca, 0x00, 0x20, 0xab, 0x8b, 0x79, 0xfb, 0x0c, 0x1c, + 0x38, 0xd0, 0x23, 0xa1, 0xa1, 0xd1, 0x68, 0xf0, 0xd6, 0x5b, 0x6f, 0xf1, + 0x7e, 0xdb, 0xda, 0xda, 0x8a, 0xa3, 0x47, 0x8f, 0xe2, 0xfb, 0xef, 0xbf, + 0xc7, 0xcf, 0x3f, 0xff, 0x8c, 0xd6, 0xd6, 0x56, 0xde, 0xf7, 0xdb, 0xb7, + 0x6f, 0xf7, 0x5a, 0x51, 0x3b, 0x53, 0x1e, 0x5d, 0xad, 0x04, 0x18, 0x1a, + 0x1a, 0xda, 0x21, 0xd5, 0xd3, 0x64, 0x32, 0xe1, 0xa7, 0x9f, 0x7e, 0xc2, + 0xf6, 0xed, 0xdb, 0x71, 0xf0, 0xe0, 0xc1, 0x0e, 0xf3, 0x1b, 0x1f, 0x1f, + 0xef, 0xf1, 0x19, 0x5f, 0x4c, 0x4c, 0x4c, 0x87, 0xd2, 0x9c, 0x57, 0xaf, + 0x5e, 0xc5, 0x77, 0xdf, 0x7d, 0x87, 0xef, 0xbf, 0xff, 0x9e, 0xb7, 0x73, + 0x60, 0x69, 0xe3, 0x78, 0x15, 0x30, 0xd0, 0x76, 0x89, 0x88, 0xab, 0x1d, + 0xf5, 0xc2, 0x85, 0x0b, 0x79, 0xed, 0xac, 0x58, 0xb1, 0xa2, 0x53, 0x78, + 0x79, 0xca, 0xb3, 0xa7, 0x4e, 0x9d, 0x42, 0x76, 0x76, 0x36, 0x72, 0x72, + 0x72, 0x78, 0xbb, 0x38, 0x36, 0xa5, 0xd4, 0x9b, 0xb4, 0x51, 0x4f, 0xd6, + 0xa4, 0xb7, 0x51, 0xe2, 0x3d, 0x35, 0xe7, 0x9d, 0x55, 0x44, 0x9e, 0xca, + 0xab, 0x9e, 0x34, 0x00, 0xbc, 0x5d, 0x4f, 0x5d, 0xc5, 0xc7, 0x53, 0x9e, + 0xf5, 0xa5, 0x01, 0xe0, 0x4a, 0x26, 0x76, 0x37, 0xef, 0xf7, 0x64, 0x16, + 0x40, 0x77, 0xac, 0x29, 0x9f, 0x1a, 0x00, 0x77, 0xdf, 0x7d, 0x37, 0x36, + 0x6f, 0xde, 0xcc, 0x3d, 0x42, 0xb5, 0xaf, 0x57, 0xaf, 0x5e, 0x2d, 0x28, + 0x0c, 0x85, 0xe0, 0x99, 0x67, 0x9e, 0xe1, 0xfa, 0xfc, 0xf3, 0x9f, 0xff, + 0xec, 0xd2, 0x2d, 0x3b, 0x70, 0xe0, 0x40, 0x5e, 0xee, 0xa3, 0x27, 0x38, + 0x0f, 0x18, 0x30, 0x80, 0xab, 0x9f, 0xed, 0xec, 0xb1, 0xdb, 0xed, 0x6e, + 0x71, 0x4e, 0x48, 0x48, 0xc0, 0x27, 0x9f, 0x7c, 0xe2, 0x56, 0x38, 0x38, + 0x32, 0x04, 0x5b, 0xaf, 0xdb, 0x1b, 0x03, 0x60, 0xc5, 0x8a, 0x15, 0xdd, + 0x6e, 0x00, 0xb0, 0x2e, 0xa7, 0xf7, 0xde, 0x7b, 0xaf, 0x43, 0xc1, 0x1f, + 0xa1, 0xe7, 0x87, 0x1f, 0x7e, 0x70, 0x5a, 0x04, 0xc8, 0x5b, 0xa1, 0xd5, + 0xa7, 0x4f, 0x9f, 0x0e, 0x02, 0xcb, 0x93, 0x02, 0x43, 0x42, 0x06, 0xde, + 0xbb, 0xef, 0xbe, 0xeb, 0x16, 0x77, 0xab, 0xd5, 0x8a, 0xcf, 0x3e, 0xfb, + 0xcc, 0x69, 0x26, 0x88, 0x33, 0xfc, 0x93, 0x92, 0x92, 0xb0, 0x63, 0xc7, + 0x0e, 0xb7, 0xed, 0xe7, 0xe7, 0xe7, 0x3b, 0x15, 0x1e, 0xee, 0xa2, 0xcf, + 0xdf, 0x7c, 0xf3, 0x4d, 0x5e, 0x5b, 0xf3, 0xe7, 0xcf, 0x77, 0x3b, 0x6e, + 0x21, 0xbc, 0x3c, 0xe5, 0x59, 0x67, 0xcf, 0xfe, 0xfd, 0xfb, 0xbd, 0x8e, + 0x94, 0xf7, 0x64, 0x4d, 0xd2, 0x34, 0x8d, 0xda, 0xda, 0x5a, 0x4c, 0x98, + 0x30, 0xc1, 0xa3, 0xfa, 0xf0, 0x3d, 0x39, 0xe7, 0x9d, 0x51, 0xc4, 0x9e, + 0xca, 0x2b, 0x5f, 0x2b, 0x40, 0x5f, 0xad, 0x27, 0x5f, 0xe0, 0xe2, 0x09, + 0xcf, 0xfa, 0xba, 0xec, 0xb0, 0x2b, 0x99, 0xd8, 0x9d, 0xbc, 0xdf, 0x1d, + 0xf2, 0xde, 0x15, 0xde, 0xdd, 0xb1, 0xa6, 0x7c, 0x9a, 0x06, 0x98, 0x9d, + 0x9d, 0x8d, 0xec, 0xec, 0x6c, 0x97, 0xef, 0xbc, 0xf3, 0xce, 0x3b, 0x4e, + 0xaf, 0x97, 0x75, 0x14, 0x64, 0x73, 0xe6, 0xcc, 0x01, 0xd0, 0x76, 0xbb, + 0x93, 0xab, 0x76, 0x6b, 0x6b, 0x6b, 0x61, 0x36, 0x9b, 0x71, 0xcf, 0x3d, + 0xf7, 0xe0, 0xf9, 0xe7, 0x9f, 0xc7, 0x98, 0x31, 0x63, 0x78, 0xe7, 0x9f, + 0xce, 0xd2, 0xe1, 0xce, 0x9d, 0x3b, 0x87, 0xac, 0xac, 0x2c, 0xbc, 0xfc, + 0xf2, 0xcb, 0xdc, 0xbd, 0xc9, 0x4a, 0xa5, 0x12, 0x76, 0xbb, 0x1d, 0x3a, + 0x9d, 0x0e, 0xc7, 0x8f, 0x1f, 0xc7, 0xb6, 0x6d, 0xdb, 0xb0, 0x67, 0xcf, + 0x1e, 0x97, 0x38, 0x97, 0x96, 0x96, 0xe2, 0xe5, 0x97, 0x5f, 0xc6, 0x81, + 0x03, 0x07, 0xf0, 0xd4, 0x53, 0x4f, 0xf1, 0x02, 0x51, 0x48, 0x1c, 0xb7, + 0x6c, 0xd9, 0xc2, 0x95, 0x12, 0x6e, 0x6c, 0x6c, 0xec, 0x30, 0xd1, 0x9e, + 0x2c, 0xee, 0xc3, 0x87, 0x0f, 0x63, 0xcb, 0x96, 0x2d, 0x9d, 0xda, 0x5d, + 0x97, 0x97, 0x97, 0x7b, 0xfc, 0x6e, 0x59, 0x59, 0x19, 0x5e, 0x7d, 0xf5, + 0x55, 0xe4, 0xe4, 0xe4, 0xe0, 0xd1, 0x47, 0x1f, 0xc5, 0xe8, 0xd1, 0xa3, + 0xa1, 0xd1, 0x68, 0x20, 0x93, 0xc9, 0x38, 0x17, 0xeb, 0xa9, 0x53, 0xa7, + 0xb0, 0x75, 0xeb, 0x56, 0xfc, 0xfb, 0xdf, 0xff, 0x76, 0x1a, 0x68, 0xc2, + 0x1e, 0x25, 0xd8, 0xed, 0x76, 0x8f, 0xa2, 0x8e, 0xad, 0x56, 0x2b, 0xb6, + 0x6c, 0xd9, 0xc2, 0xdd, 0x90, 0xa7, 0xd5, 0x6a, 0x3b, 0x15, 0xa4, 0x55, + 0x52, 0x52, 0x82, 0xd7, 0x5e, 0x7b, 0x0d, 0x3b, 0x77, 0xee, 0xc4, 0x8a, + 0x15, 0x2b, 0x30, 0x70, 0xe0, 0x40, 0xde, 0x11, 0x48, 0x63, 0x63, 0x23, + 0xf2, 0xf2, 0xf2, 0xf0, 0xc1, 0x07, 0x1f, 0xe0, 0xc4, 0x89, 0x13, 0x5e, + 0xa7, 0x29, 0x15, 0x17, 0x17, 0xe3, 0xb9, 0xe7, 0x9e, 0x43, 0x6e, 0x6e, + 0x2e, 0xe6, 0xcf, 0x9f, 0x8f, 0xf4, 0xf4, 0x74, 0xae, 0x08, 0x92, 0xc5, + 0x62, 0xc1, 0xd9, 0xb3, 0x67, 0xb1, 0x7b, 0xf7, 0x6e, 0x6c, 0xda, 0xb4, + 0x49, 0x70, 0x17, 0xee, 0xc9, 0x7c, 0xef, 0xdb, 0xb7, 0x0f, 0xbd, 0x7a, + 0xf5, 0xe2, 0xcd, 0x7d, 0x67, 0xf0, 0xf2, 0x94, 0x67, 0xc9, 0xe3, 0xb2, + 0xe6, 0xe6, 0x66, 0x9c, 0x3f, 0x7f, 0x1e, 0x9b, 0x37, 0x6f, 0xe6, 0x2a, + 0xba, 0x79, 0x03, 0x9e, 0xac, 0xc9, 0x03, 0x07, 0x0e, 0x60, 0xf5, 0xea, + 0xd5, 0x38, 0x73, 0xe6, 0x8c, 0x60, 0x76, 0x8d, 0xb7, 0x7d, 0x76, 0xf7, + 0x9c, 0xfb, 0x4a, 0x5e, 0x75, 0x35, 0x03, 0xc0, 0x9b, 0x92, 0xc4, 0x9e, + 0xae, 0x27, 0x5f, 0x65, 0x25, 0x74, 0x86, 0x67, 0xbb, 0x0a, 0xde, 0xca, + 0xc4, 0xee, 0xe6, 0x7d, 0x5f, 0xc8, 0x7b, 0xa1, 0x1b, 0x17, 0x6f, 0xc6, + 0x9a, 0xa2, 0x5c, 0xd5, 0x8d, 0xee, 0x4e, 0x50, 0x2a, 0x95, 0x58, 0xb7, + 0x6e, 0x1d, 0xa4, 0x52, 0x29, 0x72, 0x72, 0x72, 0xb0, 0x67, 0xcf, 0x1e, + 0xc1, 0xa2, 0x3e, 0x8e, 0x10, 0x15, 0x15, 0x85, 0xb0, 0xb0, 0x30, 0x84, + 0x87, 0x87, 0x43, 0xa9, 0x54, 0xa2, 0xa9, 0xa9, 0x09, 0x5a, 0xad, 0x16, + 0x17, 0x2e, 0x5c, 0x70, 0xfa, 0x1b, 0x89, 0x44, 0x82, 0xa4, 0xa4, 0x24, + 0xc8, 0xe5, 0x72, 0xee, 0x6a, 0x59, 0x8a, 0xa2, 0xd0, 0xd8, 0xd8, 0xe8, + 0xf2, 0x3a, 0x57, 0x21, 0x88, 0x8b, 0x8b, 0x83, 0x5a, 0xad, 0xee, 0xd4, + 0xbd, 0x00, 0x37, 0x8b, 0xd6, 0xee, 0x20, 0x3c, 0x3c, 0x1c, 0xe1, 0xe1, + 0xe1, 0xa0, 0x28, 0x0a, 0x81, 0x81, 0x81, 0x30, 0x1a, 0x8d, 0xb0, 0xdb, + 0xed, 0x30, 0x18, 0x0c, 0x6e, 0x33, 0x2e, 0x32, 0x32, 0x32, 0xba, 0x4c, + 0xd3, 0xae, 0x42, 0x4c, 0x4c, 0x0c, 0x42, 0x42, 0x42, 0xb8, 0x54, 0x1e, + 0x36, 0x37, 0xb6, 0xa9, 0xa9, 0xc9, 0x65, 0x8e, 0x36, 0x39, 0x1f, 0xce, + 0xe6, 0x41, 0x24, 0x12, 0x21, 0x39, 0x39, 0x19, 0x32, 0x99, 0x0c, 0x6a, + 0xb5, 0x9a, 0x4b, 0x3f, 0x33, 0x99, 0x4c, 0x28, 0x29, 0x29, 0xe9, 0x74, + 0x84, 0x79, 0x57, 0xc1, 0x11, 0x2f, 0x57, 0x77, 0x1c, 0xb0, 0x3c, 0x2b, + 0x91, 0x48, 0xa0, 0x56, 0xab, 0xa1, 0xd7, 0xeb, 0x61, 0xb1, 0x58, 0xd0, + 0xda, 0xda, 0xea, 0x93, 0x6b, 0x73, 0x9d, 0xad, 0xc9, 0xaa, 0xaa, 0x2a, + 0x97, 0x86, 0xb5, 0xe3, 0x7a, 0xf0, 0x66, 0x2d, 0xf8, 0x62, 0xce, 0x5d, + 0x0a, 0x46, 0x07, 0x5c, 0xbc, 0x91, 0x57, 0xdd, 0x5d, 0xf7, 0xde, 0x5b, + 0x99, 0xd1, 0x15, 0x7c, 0x3a, 0x23, 0x9f, 0xba, 0x3a, 0x7e, 0x5f, 0xca, + 0xc4, 0xae, 0xf0, 0xbe, 0x27, 0xf2, 0xa1, 0x2b, 0x74, 0x70, 0xd5, 0xa6, + 0xaf, 0xd6, 0x54, 0xa7, 0x0c, 0x00, 0x5f, 0x4f, 0x82, 0x97, 0x77, 0x5f, + 0x53, 0xc4, 0xbf, 0x8e, 0x3f, 0xa2, 0x99, 0x07, 0xc4, 0xbf, 0xde, 0xb4, + 0xe5, 0xac, 0x3d, 0xda, 0xc3, 0xf6, 0x5c, 0xf5, 0x43, 0x39, 0xf4, 0xd9, + 0x01, 0x5f, 0x2f, 0x0d, 0x00, 0x57, 0xb8, 0xd3, 0x02, 0xf8, 0x77, 0x16, + 0x6f, 0x57, 0x7d, 0xd0, 0x02, 0xff, 0xef, 0x0e, 0x1a, 0xa1, 0x0b, 0xf3, + 0x0a, 0x81, 0xff, 0x43, 0x60, 0x9e, 0x79, 0x6d, 0x3b, 0x4e, 0x86, 0xc0, + 0x3c, 0x08, 0xd1, 0x86, 0x72, 0xc1, 0x37, 0xb4, 0x8f, 0x71, 0x16, 0xc2, + 0x1f, 0x3e, 0xe4, 0x7f, 0x5f, 0xf0, 0x90, 0x33, 0x1a, 0xd1, 0xee, 0xd6, + 0xd7, 0xcd, 0x30, 0x86, 0xbd, 0x11, 0x8e, 0x5d, 0xc1, 0xc5, 0x6f, 0x00, + 0xdc, 0x3a, 0x06, 0x80, 0xaf, 0xe6, 0xb0, 0xbb, 0xe8, 0xe0, 0x6b, 0x3d, + 0xeb, 0x2d, 0x48, 0x7c, 0xa4, 0xb4, 0x7d, 0x85, 0x14, 0x2b, 0x40, 0xc4, + 0xc4, 0x23, 0x62, 0x84, 0x87, 0x1d, 0x80, 0x15, 0x80, 0xcd, 0x03, 0x81, + 0xc5, 0xb6, 0x23, 0x72, 0x68, 0x4b, 0x4c, 0x08, 0x2d, 0x3b, 0xd3, 0x96, + 0x8d, 0x69, 0xd7, 0xce, 0x3c, 0xb4, 0x17, 0x2e, 0x38, 0xf6, 0x05, 0x16, + 0x4f, 0x09, 0xf3, 0x2f, 0x88, 0xf6, 0xd8, 0x3e, 0xbc, 0x11, 0xda, 0x8e, + 0xb8, 0xb3, 0xed, 0x3a, 0xe2, 0xce, 0xd2, 0x83, 0xc3, 0xdd, 0x43, 0x4b, + 0xd6, 0xb1, 0x0f, 0x09, 0x31, 0x06, 0x8a, 0xa0, 0xb7, 0x8d, 0x78, 0x5c, + 0xf6, 0xe1, 0xe5, 0x78, 0x9c, 0xf5, 0x63, 0x27, 0x95, 0xb3, 0x0b, 0xa5, + 0x2c, 0x22, 0xda, 0x13, 0x39, 0xd0, 0x46, 0x08, 0xec, 0x0e, 0xf3, 0x61, + 0x27, 0x6e, 0x47, 0xa3, 0x05, 0xf8, 0x5d, 0x88, 0xfe, 0x62, 0x62, 0x6e, + 0x69, 0x07, 0xfa, 0xdb, 0x08, 0xda, 0xd0, 0x4e, 0xc6, 0x4f, 0x11, 0x6d, + 0x88, 0x9d, 0x18, 0xa4, 0xae, 0x0c, 0x00, 0x1e, 0xfe, 0x2c, 0xad, 0x9c, + 0xcc, 0x87, 0x37, 0x3c, 0xd4, 0x81, 0xff, 0x3b, 0x31, 0xa7, 0x12, 0x87, + 0xf5, 0x45, 0xbb, 0xe2, 0xd1, 0x9e, 0xbc, 0x19, 0xae, 0xa7, 0x94, 0xb2, + 0x1f, 0xfe, 0x73, 0xc0, 0xd9, 0x4d, 0x91, 0xdd, 0x61, 0x98, 0xdc, 0x24, + 0x3d, 0xeb, 0xde, 0x03, 0xe0, 0x0b, 0x2b, 0xc5, 0x4b, 0x2b, 0x8a, 0x15, + 0x2a, 0x12, 0x00, 0x32, 0x00, 0x0a, 0x00, 0x72, 0xe6, 0xb3, 0x1d, 0x80, + 0x19, 0x80, 0x11, 0x80, 0x09, 0x80, 0xc5, 0x85, 0xb0, 0x22, 0x05, 0x93, + 0x8c, 0x69, 0x43, 0xc1, 0x3c, 0x52, 0xe6, 0xef, 0x34, 0x23, 0x98, 0xc8, + 0x36, 0x8d, 0xa4, 0x81, 0xe1, 0x42, 0x09, 0x39, 0xf6, 0x25, 0x66, 0xda, + 0x65, 0xf1, 0x95, 0x31, 0x7f, 0xb7, 0x10, 0xed, 0x9a, 0x01, 0xd8, 0x68, + 0x9a, 0xb6, 0xbb, 0xa1, 0x2f, 0x45, 0x18, 0x12, 0x32, 0x02, 0x6f, 0x19, + 0xd3, 0x87, 0x88, 0x50, 0x3e, 0x26, 0x87, 0xc7, 0xe2, 0x68, 0x1c, 0x39, + 0xd9, 0x65, 0x51, 0x84, 0xd0, 0x26, 0xe9, 0x23, 0x67, 0xfa, 0xa0, 0x9c, + 0xd0, 0xc7, 0x91, 0xee, 0xde, 0x28, 0x0a, 0xc7, 0xbe, 0xd8, 0xb1, 0xb0, + 0xf3, 0xda, 0x4a, 0x8e, 0x81, 0xa4, 0x93, 0x03, 0xfd, 0x59, 0xfa, 0x48, + 0x89, 0xf6, 0x48, 0xda, 0x88, 0x9c, 0x78, 0x78, 0xac, 0x4c, 0xdb, 0x66, + 0xa6, 0x1f, 0x33, 0xab, 0x94, 0x48, 0x6d, 0xc4, 0xd0, 0x86, 0xa4, 0x8f, + 0x1c, 0x40, 0x80, 0x03, 0x2f, 0x52, 0xcc, 0x6f, 0xd9, 0xb6, 0x5a, 0x19, + 0x1a, 0x59, 0x08, 0x45, 0x4a, 0x3b, 0xe1, 0x11, 0x21, 0x9c, 0xdd, 0x79, + 0x2e, 0x58, 0x65, 0x6a, 0x21, 0xe6, 0xc1, 0xec, 0xa4, 0x2f, 0x8b, 0x44, + 0xad, 0x02, 0x00, 0x00, 0x20, 0x00, 0x49, 0x44, 0x41, 0x54, 0x67, 0x3c, + 0x24, 0x27, 0xe6, 0x97, 0xe4, 0x21, 0xa1, 0xf9, 0xe5, 0xf8, 0xdf, 0x09, + 0xef, 0x0b, 0xb5, 0x1f, 0x20, 0xd0, 0x3e, 0xc9, 0xff, 0x6c, 0x1f, 0x56, + 0xc2, 0x08, 0xa0, 0x7b, 0x72, 0xf7, 0xd7, 0x19, 0x01, 0x79, 0x33, 0x76, + 0xbf, 0xbe, 0xc6, 0xcd, 0x17, 0xf8, 0x78, 0x43, 0x07, 0x5f, 0x8d, 0xff, + 0x66, 0x78, 0x01, 0xba, 0xe2, 0xb2, 0xef, 0x2a, 0x1d, 0x6e, 0x96, 0xc7, + 0x49, 0xe2, 0x4d, 0x07, 0x3d, 0xc0, 0x74, 0xac, 0xd2, 0x56, 0x01, 0x08, + 0x06, 0x90, 0x0a, 0x40, 0xc9, 0x08, 0x25, 0x2d, 0x80, 0xb3, 0x0e, 0xbb, + 0x20, 0x67, 0xc2, 0x89, 0x55, 0xc8, 0x2a, 0x00, 0x6a, 0x00, 0x1a, 0x00, + 0xe1, 0x00, 0x62, 0x98, 0x76, 0x4d, 0x00, 0x74, 0x00, 0x8a, 0x01, 0xe8, + 0x99, 0xb6, 0x75, 0x00, 0x5a, 0x58, 0x41, 0xc5, 0xdc, 0x19, 0xee, 0xca, + 0x1b, 0x40, 0x11, 0xf8, 0x06, 0x32, 0x7d, 0xc4, 0x01, 0x08, 0x65, 0xbe, + 0x33, 0x02, 0xb8, 0x06, 0xa0, 0xc9, 0x61, 0xc7, 0xe6, 0xcc, 0x0a, 0x24, + 0x15, 0x45, 0x00, 0x80, 0x20, 0x06, 0x77, 0x35, 0x80, 0x30, 0x00, 0xb1, + 0xcc, 0xdf, 0x8d, 0x00, 0x1a, 0x00, 0xd4, 0x30, 0xb8, 0xeb, 0x98, 0x7f, + 0x9b, 0x99, 0xef, 0x3a, 0x28, 0x36, 0x01, 0xe5, 0x2f, 0x13, 0xe8, 0x23, + 0x14, 0x40, 0x34, 0x43, 0xef, 0x56, 0x00, 0x75, 0x00, 0x6a, 0x09, 0xfa, + 0xe8, 0x19, 0xfa, 0xb0, 0xca, 0xc7, 0x53, 0x8f, 0x86, 0x44, 0x60, 0x2e, + 0x02, 0x19, 0x3c, 0x2c, 0x4c, 0xbb, 0x4d, 0xcc, 0x38, 0x9a, 0x1d, 0xe9, + 0xe4, 0x40, 0x7f, 0x8a, 0x68, 0x8f, 0xc5, 0x3d, 0x88, 0x19, 0x8b, 0x54, + 0xc0, 0x00, 0x00, 0x61, 0x2c, 0xb5, 0x30, 0x7d, 0xe8, 0x08, 0x5a, 0xd9, + 0x05, 0x94, 0x3f, 0xab, 0xd8, 0x94, 0x04, 0xbe, 0xa1, 0x00, 0x92, 0x19, + 0x1e, 0xa2, 0x00, 0x18, 0x00, 0x14, 0x31, 0x73, 0xa0, 0x65, 0x1e, 0x03, + 0x43, 0x37, 0x0b, 0xb9, 0xd3, 0xa5, 0x28, 0x8a, 0x55, 0x96, 0x2c, 0xbd, + 0x35, 0x0c, 0x2d, 0x14, 0x84, 0xc1, 0x05, 0x37, 0xde, 0x0b, 0xd6, 0x48, + 0xd2, 0x3b, 0xf4, 0x45, 0xbb, 0x30, 0x36, 0x02, 0x98, 0x7e, 0x34, 0xc4, + 0x38, 0x62, 0x99, 0xbf, 0x99, 0x19, 0x9a, 0xdf, 0x20, 0x68, 0xc2, 0xd2, + 0x85, 0xc7, 0xff, 0x4e, 0xf8, 0x47, 0xca, 0xcc, 0x21, 0xdb, 0xbe, 0x86, + 0xe1, 0x9d, 0x38, 0x66, 0x8c, 0x26, 0x00, 0x95, 0x00, 0xca, 0x99, 0x76, + 0xb5, 0x04, 0x8f, 0x9a, 0x01, 0xd8, 0x84, 0xda, 0xbf, 0xd9, 0x42, 0xf8, + 0xb7, 0xe4, 0x5d, 0xe8, 0xc9, 0x3e, 0x7f, 0x8b, 0xe3, 0xeb, 0x0e, 0x3e, + 0xe9, 0x4e, 0x3a, 0xf4, 0xa0, 0x8e, 0xf5, 0xde, 0x00, 0xf0, 0x55, 0xa7, + 0xae, 0x7e, 0x4f, 0x08, 0x97, 0x00, 0x00, 0x21, 0x52, 0xa9, 0x74, 0x4a, + 0x5a, 0x5a, 0xda, 0x5f, 0x6f, 0xbb, 0xed, 0x36, 0x23, 0x00, 0x7a, 0xcf, + 0x9e, 0x3d, 0x8a, 0x9a, 0x9a, 0x9a, 0xb9, 0x00, 0xf2, 0x18, 0x21, 0x42, + 0x39, 0xd9, 0xbd, 0xb1, 0xc2, 0x56, 0x03, 0x20, 0x02, 0xc0, 0x6d, 0xbd, + 0x7a, 0xf5, 0xba, 0x3f, 0x2a, 0x2a, 0xaa, 0x7f, 0x42, 0x42, 0x82, 0x2c, + 0x36, 0x36, 0x56, 0x62, 0x30, 0x18, 0xe8, 0xba, 0xba, 0x3a, 0x4b, 0x61, + 0x61, 0xa1, 0xa1, 0xb2, 0xb2, 0xf2, 0x57, 0x9d, 0x4e, 0xf7, 0x25, 0x23, + 0xac, 0xea, 0x09, 0xc5, 0x66, 0x75, 0xe2, 0x7e, 0xa6, 0x1c, 0x94, 0xbf, + 0x12, 0x40, 0x08, 0x80, 0xc4, 0x88, 0x88, 0x88, 0xcd, 0x23, 0x47, 0x8e, + 0xb4, 0x02, 0x40, 0x51, 0x51, 0x91, 0xa2, 0xa6, 0xa6, 0x66, 0x5d, 0x6d, + 0x6d, 0xed, 0x27, 0x0c, 0xbe, 0x16, 0x37, 0x63, 0x67, 0x0d, 0x17, 0x25, + 0x63, 0xa4, 0x44, 0x00, 0x18, 0xd7, 0xbb, 0x77, 0xef, 0x99, 0xa1, 0xa1, + 0xa1, 0x49, 0xc9, 0xc9, 0xc9, 0x12, 0xb5, 0x5a, 0x2d, 0xd6, 0x6a, 0xb5, + 0xf6, 0x1b, 0x37, 0x6e, 0xd8, 0x6a, 0x6b, 0x6b, 0x1b, 0x4b, 0x4b, 0x4b, + 0x7f, 0x6e, 0x69, 0x69, 0xf9, 0x37, 0x80, 0xeb, 0x0c, 0xee, 0xac, 0xe1, + 0x61, 0x71, 0x14, 0xb0, 0x02, 0x7d, 0x84, 0x30, 0x7d, 0x4c, 0xed, 0xd3, + 0xa7, 0xcf, 0x7d, 0x61, 0x61, 0x61, 0x31, 0x09, 0x09, 0x09, 0xd2, 0x90, + 0x90, 0x10, 0x4a, 0xab, 0xd5, 0xd2, 0xe5, 0xe5, 0xe5, 0xd6, 0xfa, 0xfa, + 0xfa, 0x86, 0xa2, 0xa2, 0xa2, 0x7d, 0x16, 0x8b, 0xe5, 0x07, 0x46, 0xa0, + 0x37, 0x30, 0x82, 0x9c, 0x06, 0x60, 0xf5, 0x70, 0x3e, 0x59, 0x83, 0x2e, + 0x5c, 0xa1, 0x50, 0x0c, 0x57, 0xab, 0xd5, 0xef, 0x46, 0x45, 0x45, 0xb5, + 0x32, 0xb8, 0xda, 0x1b, 0x1b, 0x1b, 0xe5, 0x76, 0xbb, 0x7d, 0x43, 0x65, + 0x65, 0xe5, 0x87, 0xc4, 0x2e, 0xda, 0xe6, 0xc4, 0x48, 0x62, 0xf1, 0x57, + 0x01, 0xe8, 0x9b, 0x90, 0x90, 0xf0, 0x61, 0x50, 0x50, 0x10, 0x4d, 0xd3, + 0xb4, 0xe3, 0xb1, 0x02, 0xef, 0xa7, 0x14, 0x45, 0xd9, 0x28, 0x8a, 0xb2, + 0xea, 0x74, 0xba, 0x86, 0xd2, 0xd2, 0xd2, 0xa7, 0x98, 0xf6, 0x49, 0x8f, + 0x09, 0x69, 0x80, 0xca, 0x19, 0x25, 0x16, 0x06, 0xa0, 0x97, 0x5a, 0xad, + 0x9e, 0x97, 0x98, 0x98, 0x38, 0x7e, 0xc0, 0x80, 0x01, 0xca, 0xa4, 0xa4, + 0x24, 0xb9, 0x48, 0x24, 0x42, 0x7d, 0x7d, 0xbd, 0xf9, 0xd4, 0xa9, 0x53, + 0x96, 0x9a, 0x9a, 0x9a, 0xcb, 0xc5, 0xc5, 0xc5, 0xdf, 0x00, 0x38, 0xc6, + 0x18, 0x4c, 0x14, 0x61, 0x24, 0xb1, 0x7c, 0x44, 0xb1, 0x34, 0x0f, 0x0f, + 0x0f, 0xbf, 0x33, 0x22, 0x22, 0xe2, 0x59, 0x91, 0x48, 0x24, 0x76, 0xc0, + 0xd9, 0xe5, 0xb2, 0xa1, 0x28, 0xca, 0x06, 0xc0, 0xa6, 0xd7, 0xeb, 0xa9, + 0xd2, 0xd2, 0xd2, 0x3f, 0x00, 0xb8, 0x42, 0x78, 0x4b, 0x84, 0xe6, 0x97, + 0x35, 0xa0, 0xc3, 0x01, 0x4c, 0x4a, 0x4a, 0x4a, 0xba, 0x47, 0xad, 0x56, + 0x27, 0x25, 0x27, 0x27, 0x4b, 0x43, 0x43, 0x43, 0x45, 0xcd, 0xcd, 0xcd, + 0x74, 0x75, 0x75, 0xb5, 0xad, 0xba, 0xba, 0x5a, 0x57, 0x56, 0x56, 0xf6, + 0xb3, 0x5e, 0xaf, 0xff, 0x9e, 0x31, 0x68, 0x1a, 0x18, 0x85, 0xcd, 0x7a, + 0xc3, 0x68, 0x27, 0xf3, 0x49, 0xf2, 0xe8, 0x84, 0xe4, 0xe4, 0xe4, 0xd9, + 0x51, 0x51, 0x51, 0xbd, 0xd2, 0xd2, 0xd2, 0x64, 0x51, 0x51, 0x51, 0x12, + 0xbd, 0x5e, 0x6f, 0xbb, 0x7c, 0xf9, 0xb2, 0xb9, 0xac, 0xac, 0xac, 0xa1, + 0xb8, 0xb8, 0xf8, 0x3b, 0xa3, 0xd1, 0xb8, 0x97, 0x31, 0x36, 0x44, 0x8c, + 0xf1, 0x62, 0x14, 0x9a, 0x63, 0xbf, 0xe2, 0xf3, 0xc3, 0x7f, 0xfb, 0xdc, + 0xf5, 0x38, 0xde, 0x5d, 0xcd, 0xd9, 0xf4, 0xc5, 0x43, 0x28, 0x6e, 0x35, + 0x80, 0x24, 0x00, 0x63, 0x53, 0x53, 0x53, 0x4f, 0x9e, 0x3b, 0x77, 0x8e, + 0xa6, 0x69, 0x9a, 0xbe, 0x71, 0xe3, 0x06, 0x9d, 0x91, 0x91, 0x71, 0x19, + 0xc0, 0x60, 0x00, 0x91, 0xcc, 0xee, 0x49, 0x24, 0xd0, 0x86, 0x94, 0x69, + 0x23, 0x11, 0xc0, 0xc8, 0xa0, 0xa0, 0xa0, 0xb7, 0x47, 0x8f, 0x1e, 0x5d, + 0x7b, 0xe8, 0xd0, 0x21, 0xda, 0x64, 0x32, 0xd1, 0x8e, 0x50, 0x55, 0x55, + 0x45, 0xbf, 0xfb, 0xee, 0xbb, 0x66, 0xb9, 0x5c, 0xde, 0x0c, 0x60, 0x2e, + 0x80, 0x4c, 0x66, 0x27, 0xc3, 0xee, 0x50, 0x29, 0xa2, 0x6d, 0x11, 0xe1, + 0x16, 0x56, 0x31, 0xbb, 0xc2, 0x78, 0xe6, 0x37, 0x53, 0x00, 0xbc, 0xfd, + 0xe7, 0x3f, 0xff, 0xb9, 0x99, 0x6d, 0x7b, 0xef, 0xde, 0xbd, 0x74, 0x4c, + 0x4c, 0xcc, 0x26, 0x00, 0x03, 0x18, 0x41, 0x2c, 0x63, 0xdb, 0x13, 0x18, + 0xbf, 0x88, 0xf9, 0x3e, 0x04, 0x40, 0x5f, 0x00, 0x63, 0xc3, 0xc2, 0xc2, + 0x76, 0x3c, 0xf0, 0xc0, 0x03, 0x8d, 0x27, 0x4f, 0x9e, 0xa4, 0xed, 0x76, + 0x7b, 0x07, 0xdc, 0x2b, 0x2b, 0x2b, 0xe9, 0xb7, 0xdf, 0x7e, 0xdb, 0x14, + 0x15, 0x15, 0x55, 0x07, 0xe0, 0x09, 0x00, 0xc3, 0x18, 0x7c, 0x82, 0xd8, + 0x9d, 0xa5, 0x40, 0x1f, 0x72, 0x06, 0xef, 0x7e, 0x00, 0xc6, 0x47, 0x46, + 0x46, 0xee, 0x9f, 0x3f, 0x7f, 0xbe, 0xee, 0xc2, 0x85, 0x0b, 0x82, 0x7d, + 0x94, 0x96, 0x96, 0xd2, 0xcf, 0x3c, 0xf3, 0x8c, 0x31, 0x30, 0x30, 0x50, + 0x0b, 0x60, 0x0e, 0x80, 0x81, 0x42, 0xf4, 0x71, 0x32, 0x9f, 0x22, 0x66, + 0x9e, 0x22, 0x00, 0x64, 0x00, 0x98, 0x9d, 0x99, 0x99, 0x59, 0x52, 0x56, + 0x56, 0xc6, 0xeb, 0xe3, 0xc8, 0x91, 0x23, 0x74, 0xef, 0xde, 0xbd, 0xff, + 0xc5, 0xd0, 0x31, 0x82, 0xc1, 0x91, 0x72, 0xd2, 0xa6, 0x8c, 0xc1, 0xbf, + 0x3f, 0x80, 0xd7, 0x56, 0xad, 0x5a, 0x65, 0xad, 0xaa, 0xaa, 0xa2, 0x3d, + 0x7d, 0x26, 0x4e, 0x9c, 0x58, 0x09, 0x20, 0x8b, 0xd9, 0xa9, 0x2a, 0x01, + 0x88, 0x89, 0xb6, 0xc5, 0xcc, 0xdf, 0xa2, 0x99, 0x71, 0xfe, 0xbe, 0x77, + 0xef, 0xde, 0x67, 0xde, 0x7b, 0xef, 0x3d, 0x93, 0x56, 0xab, 0xa5, 0x85, + 0x20, 0x27, 0x27, 0x87, 0x06, 0x40, 0x6b, 0x34, 0x9a, 0x77, 0x00, 0x8c, + 0x62, 0x78, 0x57, 0x43, 0xd2, 0x9f, 0x98, 0xd7, 0x7e, 0xf1, 0xf1, 0xf1, + 0x5b, 0x7e, 0xfc, 0xf1, 0x47, 0xda, 0x1b, 0x9c, 0xc9, 0x67, 0xc5, 0x8a, + 0x15, 0x06, 0x00, 0xcf, 0x03, 0xe8, 0xcd, 0xf0, 0xb9, 0xd8, 0xc9, 0xfc, + 0xf6, 0x05, 0x30, 0x3e, 0x3c, 0x3c, 0xfc, 0x5f, 0xf3, 0xe6, 0xcd, 0x6b, + 0x3c, 0x71, 0xe2, 0x04, 0x6d, 0xb1, 0x58, 0x3a, 0xe0, 0x5f, 0x5b, 0x5b, + 0x4b, 0xbf, 0xf5, 0xd6, 0x5b, 0x66, 0x89, 0x44, 0x62, 0x06, 0xf0, 0x10, + 0xb3, 0xbe, 0x62, 0x18, 0x3a, 0x48, 0x04, 0xf8, 0x5f, 0xc1, 0x18, 0x46, + 0xfd, 0x00, 0x8c, 0x67, 0x79, 0xf4, 0xdc, 0xb9, 0x73, 0x82, 0xfc, 0x53, + 0x52, 0x52, 0x42, 0xcf, 0x9b, 0x37, 0xcf, 0x18, 0x12, 0x12, 0x52, 0x04, + 0xe0, 0x1e, 0x66, 0x2d, 0x44, 0xb9, 0xe3, 0x1f, 0xff, 0xe3, 0x7f, 0xfc, + 0x4f, 0x0f, 0xe9, 0xde, 0x5b, 0xc8, 0x00, 0x90, 0x33, 0x0a, 0x60, 0x20, + 0x80, 0xff, 0x37, 0x6d, 0xda, 0xb4, 0x3a, 0x56, 0x90, 0x6c, 0xda, 0xb4, + 0xc9, 0xa2, 0xd1, 0x68, 0x3e, 0x65, 0x04, 0x94, 0xa0, 0x92, 0x20, 0xbc, + 0x07, 0xd1, 0x00, 0x86, 0x00, 0xf8, 0xa3, 0x4c, 0x26, 0xb3, 0xd5, 0xd7, + 0xd7, 0xd3, 0xee, 0x60, 0xff, 0xfe, 0xfd, 0x74, 0x4a, 0x4a, 0xca, 0x05, + 0x00, 0xf7, 0x32, 0xc2, 0x2d, 0x84, 0x54, 0xd8, 0x0e, 0x9e, 0x85, 0x10, + 0x00, 0xbd, 0x18, 0x25, 0x34, 0x0a, 0xc0, 0x7d, 0x00, 0x96, 0x85, 0x86, + 0x86, 0x6a, 0x0b, 0x0a, 0x0a, 0x68, 0xd2, 0x00, 0x88, 0x8e, 0x8e, 0xfe, + 0x06, 0xc0, 0x70, 0x06, 0x27, 0x85, 0x0b, 0x85, 0x29, 0x66, 0x8c, 0x8a, + 0x78, 0x00, 0x23, 0x43, 0x43, 0x43, 0x37, 0x3c, 0xf9, 0xe4, 0x93, 0x2d, + 0x36, 0x9b, 0xcd, 0x2d, 0xee, 0x17, 0x2e, 0x5c, 0xa0, 0x07, 0x0f, 0x1e, + 0x5c, 0x07, 0xe0, 0x59, 0x00, 0x83, 0x18, 0x01, 0x1b, 0xe0, 0xa0, 0x1c, + 0x58, 0xfc, 0x83, 0x00, 0x24, 0x00, 0xb8, 0x23, 0x3c, 0x3c, 0x7c, 0x67, + 0x46, 0x46, 0x86, 0x55, 0x48, 0x70, 0x3b, 0xc2, 0xa6, 0x4d, 0x9b, 0xec, + 0xe9, 0xe9, 0xe9, 0x57, 0x19, 0x23, 0x29, 0xd5, 0x91, 0x3e, 0x4e, 0xe6, + 0x53, 0xca, 0x28, 0xc3, 0x64, 0x00, 0x13, 0xc2, 0xc3, 0xc3, 0xff, 0xf5, + 0xd1, 0x47, 0x1f, 0x75, 0xd0, 0x42, 0x47, 0x8e, 0x1c, 0xa1, 0x93, 0x92, + 0x92, 0x7e, 0x04, 0x30, 0x82, 0x51, 0x3e, 0x0a, 0x17, 0x06, 0x00, 0x3b, + 0xbf, 0xc3, 0x23, 0x22, 0x22, 0xbe, 0xda, 0xbd, 0x7b, 0x37, 0xed, 0x0d, + 0x64, 0x65, 0x65, 0x55, 0x02, 0xb8, 0x8b, 0xa1, 0xb3, 0x0a, 0x80, 0xc4, + 0x41, 0x79, 0x86, 0x31, 0xf3, 0x7a, 0x77, 0x50, 0x50, 0x50, 0xc3, 0xf6, + 0xed, 0xdb, 0xdd, 0x4e, 0x40, 0x7d, 0x7d, 0x3d, 0x3d, 0x67, 0xce, 0x9c, + 0x46, 0x89, 0x44, 0xf2, 0x06, 0xc3, 0xbb, 0x9c, 0x81, 0x4a, 0x18, 0x2d, + 0xe1, 0x00, 0x32, 0x12, 0x13, 0x13, 0xb7, 0x1f, 0x3c, 0x78, 0x90, 0xee, + 0x2c, 0xbc, 0xfe, 0xfa, 0xeb, 0x06, 0x00, 0xcb, 0x18, 0x1e, 0x0d, 0x66, + 0xf1, 0x17, 0xe0, 0xa1, 0xdb, 0xc3, 0xc2, 0xc2, 0x76, 0x2c, 0x59, 0xb2, + 0xa4, 0xd5, 0x13, 0x1e, 0xda, 0xb1, 0x63, 0x07, 0x3d, 0x70, 0xe0, 0xc0, + 0x12, 0x00, 0x0f, 0x02, 0x48, 0x63, 0xe8, 0x20, 0x63, 0x8d, 0x6c, 0x01, + 0x03, 0x7d, 0x4c, 0x58, 0x58, 0xd8, 0x8e, 0x09, 0x13, 0x26, 0x98, 0x3d, + 0xc1, 0x7b, 0xe5, 0xca, 0x95, 0xd6, 0xa4, 0xa4, 0xa4, 0x53, 0x00, 0xa6, + 0x03, 0x48, 0x21, 0xf8, 0x47, 0xe4, 0x17, 0xc2, 0xfe, 0xc7, 0xff, 0xdc, + 0xbc, 0x47, 0x72, 0x8b, 0x78, 0x3e, 0xc8, 0x73, 0x52, 0x8d, 0x46, 0xa3, + 0x99, 0xf0, 0xd0, 0x43, 0x0f, 0x71, 0xa5, 0xf9, 0xbe, 0xf8, 0xe2, 0x0b, + 0xad, 0x56, 0xab, 0x3d, 0xea, 0xc4, 0x6d, 0x4b, 0xba, 0xff, 0x59, 0x77, + 0x73, 0x74, 0x6a, 0x6a, 0xea, 0xe3, 0x7b, 0xf7, 0xee, 0x15, 0x91, 0xb7, + 0xd9, 0x65, 0x67, 0x67, 0xe3, 0xd0, 0xa1, 0x43, 0x96, 0xb8, 0xb8, 0x38, + 0xd1, 0xef, 0x7e, 0xf7, 0x3b, 0x31, 0x7b, 0xb1, 0xcd, 0xa4, 0x49, 0x93, + 0xb0, 0x64, 0xc9, 0x92, 0xbe, 0x2f, 0xbe, 0xf8, 0xe2, 0xfd, 0x7a, 0xbd, + 0xfe, 0xef, 0xe4, 0x59, 0x28, 0xe1, 0xc6, 0x65, 0xdd, 0xc3, 0x6a, 0x46, + 0x88, 0x25, 0x02, 0x48, 0x08, 0x09, 0x09, 0x19, 0x22, 0x93, 0xc9, 0x26, + 0x7f, 0xf3, 0xcd, 0x37, 0x01, 0x8e, 0x05, 0x82, 0x68, 0x9a, 0x96, 0xba, + 0x38, 0x9b, 0x16, 0x72, 0xad, 0x06, 0x01, 0x18, 0x98, 0x92, 0x92, 0x32, + 0x73, 0xed, 0xda, 0xb5, 0x01, 0x22, 0x51, 0xfb, 0xcf, 0x8e, 0x1e, 0x3d, + 0x8a, 0xf2, 0xf2, 0x72, 0x48, 0x24, 0x12, 0x64, 0x64, 0x64, 0x20, 0x25, + 0x25, 0x05, 0x00, 0xd0, 0xbf, 0x7f, 0x7f, 0x6c, 0xdb, 0xb6, 0x2d, 0x6c, + 0xe6, 0xcc, 0x99, 0x8b, 0x2e, 0x5e, 0xbc, 0x78, 0x9d, 0x70, 0xb1, 0x5a, + 0x29, 0x8a, 0x22, 0x63, 0x01, 0x48, 0xf7, 0xf6, 0xed, 0x63, 0xc7, 0x8e, + 0x1d, 0xbf, 0x63, 0xc7, 0x0e, 0x31, 0x7b, 0xe6, 0xa4, 0xd3, 0xe9, 0xf0, + 0xc9, 0x27, 0x9f, 0xd8, 0x74, 0x3a, 0x9d, 0x35, 0x29, 0x29, 0x49, 0x7a, + 0xef, 0xbd, 0xf7, 0x8a, 0xd8, 0x22, 0x2b, 0x0f, 0x3d, 0xf4, 0x10, 0x25, + 0x93, 0xc9, 0x92, 0x16, 0x2d, 0x5a, 0x34, 0xaf, 0xba, 0xba, 0xba, 0x88, + 0x39, 0x06, 0x30, 0x39, 0xba, 0x89, 0x1d, 0x5c, 0xd1, 0x6c, 0x6c, 0x44, + 0x30, 0x80, 0xdb, 0x06, 0x0f, 0x1e, 0x3c, 0xf6, 0x91, 0x47, 0x1e, 0x91, + 0x38, 0xf1, 0x42, 0xb1, 0x01, 0x72, 0x62, 0x17, 0x2e, 0x71, 0x72, 0x8e, + 0x03, 0xd5, 0x6a, 0x75, 0x2f, 0xb2, 0xf4, 0x66, 0x6b, 0x6b, 0xab, 0xdb, + 0x7b, 0xb1, 0x4d, 0x26, 0x93, 0xc8, 0x21, 0x78, 0x8e, 0x26, 0xda, 0x66, + 0x8f, 0x46, 0x42, 0x23, 0x23, 0x23, 0x9f, 0x7e, 0xfa, 0xe9, 0xa7, 0x55, + 0xb3, 0x67, 0xcf, 0xe6, 0x26, 0xe0, 0xcc, 0x99, 0x33, 0xf8, 0xf2, 0xcb, + 0x2f, 0xcd, 0x26, 0x93, 0xc9, 0x36, 0x6e, 0xdc, 0x38, 0xf9, 0x9c, 0x39, + 0x73, 0x44, 0x40, 0x5b, 0x89, 0xda, 0x75, 0xeb, 0xd6, 0x05, 0x5f, 0xba, + 0x74, 0xe9, 0x7f, 0x0a, 0x0a, 0x0a, 0xf6, 0x03, 0x68, 0x04, 0x3f, 0x1a, + 0x9e, 0x3d, 0x0a, 0xb0, 0x53, 0x14, 0x45, 0x75, 0xe5, 0x8a, 0x56, 0x9a, + 0xa6, 0x85, 0xd2, 0xf8, 0x1c, 0x69, 0xae, 0x02, 0x70, 0xdb, 0xa8, 0x51, + 0xa3, 0xc6, 0xaf, 0x5a, 0xb5, 0x4a, 0xc1, 0xf2, 0x90, 0xdd, 0x6e, 0xc7, + 0xd6, 0xad, 0x5b, 0xe9, 0xcb, 0x97, 0x2f, 0x9b, 0xa3, 0xa2, 0xa2, 0xc4, + 0x53, 0xa6, 0x4c, 0x91, 0xb0, 0x77, 0x5f, 0xcc, 0x9a, 0x35, 0x0b, 0x0a, + 0x85, 0xa2, 0xd7, 0x13, 0x4f, 0x3c, 0xb1, 0xb0, 0xa2, 0xa2, 0xa2, 0x90, + 0x99, 0xdf, 0x56, 0xe2, 0x18, 0x8c, 0x8c, 0xbd, 0xd0, 0x00, 0x98, 0x3c, + 0x70, 0xe0, 0xc0, 0xa9, 0xfb, 0xf6, 0xed, 0x93, 0x92, 0x9e, 0xc4, 0xef, + 0xbf, 0xff, 0x1e, 0x97, 0x2e, 0x5d, 0xb2, 0x04, 0x07, 0x07, 0x8b, 0xb2, + 0xb2, 0xb2, 0xc4, 0xec, 0x4d, 0x9b, 0xaf, 0xbc, 0xf2, 0x8a, 0x58, 0x2e, + 0x97, 0xf7, 0x7f, 0xe3, 0x8d, 0x37, 0xee, 0xd7, 0xe9, 0x74, 0xeb, 0x89, + 0x58, 0x1b, 0x1b, 0xfc, 0xe0, 0x07, 0x3f, 0xdc, 0xdc, 0x33, 0x87, 0x5b, + 0x60, 0xf7, 0x2f, 0x65, 0x76, 0x05, 0x69, 0x00, 0xee, 0xcb, 0xc8, 0xc8, + 0x28, 0xad, 0xad, 0xad, 0xa5, 0x69, 0x9a, 0xa6, 0xf3, 0xf3, 0xf3, 0xe9, + 0x94, 0x94, 0x94, 0x33, 0x8c, 0xeb, 0xb6, 0x2f, 0xa3, 0x80, 0x25, 0x4e, + 0x3c, 0x08, 0x91, 0x8c, 0x97, 0xe0, 0x2f, 0xcf, 0x3f, 0xff, 0xbc, 0x9e, + 0xdc, 0x85, 0xac, 0x58, 0xb1, 0xc2, 0x2c, 0x97, 0xcb, 0xb5, 0x00, 0xb6, + 0x52, 0x14, 0xb5, 0x1b, 0x00, 0x5d, 0x54, 0x54, 0xc4, 0x7d, 0xdf, 0xd0, + 0xd0, 0x40, 0x67, 0x66, 0x66, 0x96, 0x31, 0x3b, 0xfa, 0x14, 0x46, 0xd0, + 0x49, 0x88, 0xdd, 0x55, 0x20, 0xb3, 0xbb, 0xbe, 0x33, 0x31, 0x31, 0xb1, + 0xf6, 0x91, 0x47, 0x1e, 0xa9, 0x5d, 0xb6, 0x6c, 0x99, 0xfe, 0xab, 0xaf, + 0xbe, 0xb2, 0x95, 0x97, 0x97, 0x77, 0xd8, 0xf5, 0xec, 0xdd, 0xbb, 0x97, + 0x8e, 0x8a, 0x8a, 0xda, 0x05, 0x60, 0x0c, 0xe3, 0x72, 0x0e, 0x70, 0xb3, + 0xb3, 0x8d, 0x01, 0x30, 0x22, 0x3c, 0x3c, 0xfc, 0xeb, 0xef, 0xbe, 0xfb, + 0xce, 0xca, 0xb6, 0x63, 0xb3, 0xd9, 0xe8, 0xdf, 0xff, 0xfe, 0xf7, 0xa6, + 0xc8, 0xc8, 0xc8, 0x72, 0xb9, 0x5c, 0xfe, 0x83, 0x46, 0xa3, 0xd9, 0x97, + 0x96, 0x96, 0x56, 0x77, 0xe6, 0xcc, 0x19, 0xbb, 0xc3, 0xee, 0xb0, 0x45, + 0x24, 0x12, 0xad, 0x66, 0xbc, 0x00, 0x3c, 0x2f, 0x09, 0xa3, 0x1c, 0xd8, + 0x3e, 0x86, 0x27, 0x25, 0x25, 0xfd, 0x7c, 0xfc, 0xf8, 0x71, 0xee, 0xb7, + 0x67, 0xcf, 0x9e, 0xa5, 0x03, 0x03, 0x03, 0xcd, 0x12, 0x89, 0xe4, 0x27, + 0x00, 0x9f, 0xab, 0x54, 0xaa, 0x03, 0x71, 0x71, 0x71, 0x26, 0xa3, 0xd1, + 0xc8, 0xbd, 0x63, 0x34, 0x1a, 0xe9, 0x41, 0x83, 0x06, 0x55, 0x31, 0x3b, + 0xe8, 0xde, 0x8c, 0x21, 0x21, 0x76, 0xe1, 0xcd, 0x09, 0x63, 0xe6, 0x73, + 0x5a, 0xef, 0xde, 0xbd, 0xcf, 0xe6, 0xe6, 0xe6, 0xb2, 0xc7, 0x0a, 0xf6, + 0x9a, 0x9a, 0x1a, 0x9e, 0x07, 0x20, 0x31, 0x31, 0xf1, 0x27, 0x00, 0xe3, + 0x19, 0xef, 0x44, 0xa0, 0x13, 0x3a, 0x89, 0x98, 0x3e, 0xfb, 0x00, 0xb8, + 0x33, 0x3d, 0x3d, 0xfd, 0x0a, 0x4b, 0xf7, 0xc6, 0xc6, 0x46, 0xba, 0x5f, + 0xbf, 0x7e, 0x2d, 0xe9, 0xe9, 0xe9, 0xd5, 0xe9, 0xe9, 0xe9, 0x95, 0x19, + 0x19, 0x19, 0xe5, 0x19, 0x19, 0x19, 0x65, 0xcc, 0x53, 0x9a, 0x91, 0x91, + 0x51, 0x34, 0x60, 0xc0, 0x80, 0x6b, 0xf1, 0xf1, 0xf1, 0x27, 0x09, 0xfa, + 0x04, 0x38, 0xec, 0xd2, 0x43, 0x99, 0xa3, 0x8a, 0x27, 0x26, 0x4f, 0x9e, + 0x5c, 0x67, 0xb5, 0x72, 0x53, 0x40, 0x7f, 0xf1, 0xc5, 0x17, 0xd6, 0xb8, + 0xb8, 0xb8, 0x0a, 0x00, 0x9b, 0x00, 0x7c, 0x1c, 0x18, 0x18, 0x58, 0xbe, + 0x74, 0xe9, 0x52, 0x23, 0x49, 0xff, 0xe5, 0xcb, 0x97, 0x6b, 0x19, 0xf7, + 0x7c, 0x22, 0x49, 0x1b, 0xc2, 0x13, 0x92, 0x14, 0x17, 0x17, 0xb7, 0x3e, + 0x33, 0x33, 0xb3, 0x61, 0xea, 0xd4, 0xa9, 0xd5, 0x59, 0x59, 0x59, 0xb5, + 0x59, 0x59, 0x59, 0x75, 0x59, 0x59, 0x59, 0xf5, 0xec, 0x33, 0x65, 0xca, + 0x94, 0xc6, 0x29, 0x53, 0xa6, 0x68, 0x27, 0x4f, 0x9e, 0x6c, 0x98, 0x30, + 0x61, 0x42, 0xeb, 0xde, 0xbd, 0x7b, 0xed, 0xac, 0xeb, 0xbe, 0xa4, 0xa4, + 0x84, 0x1e, 0x39, 0x72, 0x64, 0x39, 0x80, 0x85, 0x8e, 0xf4, 0x67, 0xc6, + 0xa0, 0x60, 0xf8, 0x73, 0x68, 0x64, 0x64, 0xe4, 0x8e, 0xec, 0xec, 0x6c, + 0x8e, 0x3f, 0xcc, 0x66, 0x33, 0x9d, 0x91, 0x91, 0x61, 0x52, 0xa9, 0x54, + 0xe7, 0x00, 0x6c, 0x04, 0xb0, 0xbd, 0x77, 0xef, 0xde, 0xb5, 0x87, 0x0e, + 0x1d, 0xb2, 0x93, 0x7c, 0x76, 0xfb, 0xed, 0xb7, 0x57, 0x03, 0x98, 0xc1, + 0x78, 0x6d, 0xc8, 0xf6, 0x59, 0xef, 0x42, 0x22, 0x80, 0xf1, 0xc9, 0xc9, + 0xc9, 0xf9, 0xa7, 0x4f, 0x9f, 0xe6, 0xc6, 0xae, 0xd3, 0xe9, 0xe8, 0xa1, + 0x43, 0x87, 0x1a, 0x03, 0x02, 0x02, 0x2a, 0x01, 0x6c, 0x92, 0x48, 0x24, + 0xbb, 0xe4, 0x72, 0xb9, 0xf9, 0xc4, 0x89, 0x13, 0x5c, 0xfb, 0x7a, 0xbd, + 0x9e, 0x1e, 0x3c, 0x78, 0x70, 0x05, 0x80, 0x59, 0x84, 0x07, 0x43, 0xea, + 0xdf, 0x85, 0xf9, 0x1f, 0xff, 0xf3, 0xdf, 0xed, 0x01, 0xa0, 0x1c, 0x76, + 0xa7, 0x43, 0xc7, 0x8c, 0x19, 0x13, 0xcc, 0xee, 0x3e, 0xff, 0xf5, 0xaf, + 0x7f, 0x19, 0x0b, 0x0b, 0x0b, 0x7f, 0x76, 0xd8, 0x95, 0xd8, 0x5d, 0xb5, + 0x91, 0x98, 0x98, 0x38, 0x7a, 0xf6, 0xec, 0xd9, 0xdc, 0x15, 0x55, 0xd7, + 0xae, 0x5d, 0xc3, 0xb6, 0x6d, 0xdb, 0xaa, 0x4c, 0x26, 0xd3, 0xfb, 0x00, + 0x1a, 0x69, 0x9a, 0x96, 0x00, 0x28, 0x7a, 0xe9, 0xa5, 0x97, 0x1e, 0xfe, + 0xfa, 0xeb, 0xaf, 0x55, 0x40, 0xdb, 0xfd, 0xee, 0xe3, 0xc6, 0x8d, 0x0b, + 0x2e, 0x28, 0x28, 0x18, 0x08, 0xa0, 0x84, 0x51, 0x0a, 0xad, 0x54, 0x7b, + 0x58, 0x26, 0xbb, 0x0b, 0x0a, 0xbf, 0xfb, 0xee, 0xbb, 0xa9, 0x75, 0xeb, + 0xd6, 0x85, 0x79, 0x38, 0x36, 0x77, 0xf9, 0xde, 0xbc, 0xe8, 0xf3, 0x88, + 0x88, 0x88, 0x21, 0x77, 0xdc, 0x71, 0x07, 0xb7, 0x4d, 0xdc, 0xbe, 0x7d, + 0xbb, 0x7d, 0xdf, 0xbe, 0x7d, 0x85, 0x5a, 0xad, 0x76, 0x1d, 0x00, 0xbd, + 0xc9, 0x64, 0x92, 0x69, 0xb5, 0xda, 0x73, 0x83, 0x07, 0x0f, 0x7e, 0xde, + 0x60, 0x30, 0x40, 0xa9, 0x54, 0x02, 0x00, 0xa6, 0x4e, 0x9d, 0x1a, 0xf0, + 0xcf, 0x7f, 0xfe, 0x73, 0xf8, 0xf5, 0xeb, 0xd7, 0x77, 0xb0, 0xee, 0x55, + 0x87, 0x5d, 0x28, 0x17, 0x24, 0x16, 0x14, 0x14, 0xd4, 0x27, 0x33, 0x33, + 0x93, 0x43, 0xe0, 0x1f, 0xff, 0xf8, 0x47, 0x73, 0x4b, 0x4b, 0xcb, 0x97, + 0x4c, 0x30, 0x9b, 0xcd, 0x60, 0x30, 0x04, 0x9b, 0xcd, 0x66, 0xf9, 0x8a, + 0x15, 0x2b, 0x46, 0xfc, 0xed, 0x6f, 0x7f, 0x93, 0x00, 0x6d, 0x57, 0x51, + 0x0e, 0x1c, 0x38, 0x50, 0x9e, 0x9f, 0x9f, 0x9f, 0xc4, 0x04, 0x1d, 0x76, + 0xd8, 0xad, 0x0b, 0x04, 0xfe, 0x85, 0xca, 0xe5, 0xf2, 0xbb, 0xee, 0xbb, + 0xef, 0xbe, 0xe4, 0x51, 0xa3, 0x46, 0xa1, 0xa2, 0xa2, 0x02, 0x59, 0x59, + 0x59, 0xd6, 0x0d, 0x1b, 0x36, 0x48, 0x23, 0x22, 0x22, 0xe0, 0x24, 0xc8, + 0xd2, 0x15, 0x9d, 0xd8, 0x20, 0x37, 0x39, 0x00, 0x35, 0x5b, 0xeb, 0xfd, + 0xe2, 0xc5, 0x8b, 0x68, 0x69, 0x69, 0xb9, 0x5e, 0x5e, 0x5e, 0xfe, 0x2d, + 0x13, 0x8c, 0xd7, 0x4c, 0xec, 0x30, 0x4d, 0xcc, 0x67, 0x1d, 0xda, 0x22, + 0xdf, 0xb5, 0xc4, 0x77, 0xa4, 0x77, 0x47, 0x01, 0x20, 0x48, 0xa3, 0xd1, + 0x4c, 0x78, 0xec, 0xb1, 0xc7, 0x42, 0xd8, 0x9d, 0x7a, 0x51, 0x51, 0x11, + 0xde, 0x7c, 0xf3, 0xcd, 0xba, 0x8a, 0x8a, 0x8a, 0x7f, 0x00, 0xa8, 0x06, + 0x60, 0x6d, 0x69, 0x69, 0x39, 0xb3, 0x71, 0xe3, 0xc6, 0xd7, 0x87, 0x0e, + 0x1d, 0x2a, 0x67, 0xaf, 0x1a, 0x4d, 0x4c, 0x4c, 0x54, 0x87, 0x84, 0x84, + 0xf4, 0x6f, 0x6c, 0x6c, 0xdc, 0x8e, 0x8e, 0x85, 0x7b, 0x2c, 0x00, 0x9a, + 0x2b, 0x2a, 0x2a, 0xde, 0xaf, 0xa8, 0xa8, 0xf8, 0x57, 0x41, 0x41, 0x81, + 0x1a, 0xfc, 0x74, 0x48, 0x31, 0xb1, 0xbb, 0x8e, 0x00, 0x90, 0x3a, 0x7e, + 0xfc, 0xf8, 0xd1, 0xc3, 0x86, 0x0d, 0xa3, 0x24, 0x12, 0x09, 0xf4, 0x7a, + 0x3d, 0x9e, 0x7c, 0xf2, 0xc9, 0xc6, 0x63, 0xc7, 0x8e, 0xfd, 0x03, 0x6d, + 0x99, 0x30, 0x46, 0x01, 0xef, 0x0b, 0xb7, 0x06, 0x42, 0x43, 0x43, 0x93, + 0xd3, 0xd2, 0xd2, 0x38, 0x7a, 0x7e, 0xf7, 0xdd, 0x77, 0xb8, 0x71, 0xe3, + 0xc6, 0x39, 0x83, 0xc1, 0xb0, 0x8d, 0x19, 0xbf, 0xac, 0xa8, 0xa8, 0xa8, + 0xe2, 0xf1, 0xc7, 0x1f, 0x7f, 0xe2, 0xec, 0xd9, 0xb3, 0x0a, 0xa9, 0x54, + 0x0a, 0x91, 0x48, 0x84, 0x41, 0x83, 0x06, 0xc9, 0x8f, 0x1e, 0x3d, 0x9a, + 0x08, 0xe0, 0xa2, 0xc3, 0xfc, 0x92, 0x1e, 0x80, 0xa4, 0x3e, 0x7d, 0xfa, + 0xc4, 0x0d, 0x1e, 0x3c, 0x98, 0xeb, 0xf8, 0xa3, 0x8f, 0x3e, 0xb2, 0x5c, + 0xba, 0x74, 0xe9, 0x60, 0x6b, 0x6b, 0xeb, 0x4e, 0x00, 0x3a, 0xab, 0xd5, + 0x2a, 0xb5, 0x5a, 0xad, 0x67, 0x1f, 0x7a, 0xe8, 0xa1, 0x67, 0x7f, 0xfd, + 0xf5, 0x57, 0x75, 0x70, 0x70, 0x30, 0x54, 0x2a, 0x15, 0xee, 0xb9, 0xe7, + 0x9e, 0x90, 0x33, 0x67, 0xce, 0x0c, 0x67, 0x02, 0x0e, 0xb9, 0xf5, 0x75, + 0x53, 0x0a, 0x03, 0xf8, 0xc1, 0x0f, 0x7e, 0xb8, 0xb9, 0x06, 0x00, 0xe1, + 0xba, 0x67, 0xd3, 0x8a, 0x82, 0xe2, 0xe3, 0xe3, 0xc7, 0xcf, 0x9d, 0x3b, + 0x37, 0x88, 0x75, 0xeb, 0xee, 0xdc, 0xb9, 0x53, 0x6b, 0xb7, 0xdb, 0x8f, + 0x91, 0xae, 0x6d, 0x08, 0xe7, 0x3e, 0x73, 0x01, 0x7a, 0x4a, 0xa5, 0x32, + 0x75, 0xc8, 0x90, 0x21, 0xdc, 0x97, 0x79, 0x79, 0x79, 0xf6, 0x92, 0x92, + 0x92, 0x13, 0x00, 0x4a, 0xd1, 0x16, 0xe9, 0x2c, 0x01, 0x60, 0x3d, 0x7f, + 0xfe, 0xfc, 0x2c, 0x9d, 0x4e, 0xa7, 0x62, 0xef, 0x5d, 0x9e, 0x36, 0x6d, + 0x9a, 0x72, 0xf3, 0xe6, 0xcd, 0x83, 0x9a, 0x9a, 0x9a, 0xf6, 0x3b, 0x71, + 0xdd, 0xd3, 0x00, 0xec, 0x5a, 0xad, 0x56, 0xe4, 0x58, 0x6e, 0x54, 0xa9, + 0x54, 0xba, 0xbc, 0xca, 0xd5, 0x43, 0x23, 0x21, 0x20, 0x24, 0x24, 0x44, + 0x49, 0x2a, 0xc7, 0x9f, 0x7e, 0xfa, 0xc9, 0xa0, 0xd5, 0x6a, 0xbf, 0x01, + 0x50, 0xc8, 0x28, 0xb2, 0x00, 0x00, 0xf6, 0xf8, 0xf8, 0xf8, 0xf3, 0x17, + 0x2e, 0x5c, 0xc8, 0x18, 0x3e, 0x7c, 0x38, 0x80, 0xb6, 0x5b, 0xc1, 0x02, + 0x02, 0x02, 0xe2, 0x18, 0x1a, 0xb0, 0x45, 0x59, 0x20, 0x80, 0x7f, 0x50, + 0x6c, 0x6c, 0xac, 0x84, 0xbc, 0x23, 0xfb, 0xd0, 0xa1, 0x43, 0x06, 0x00, + 0x3f, 0x31, 0xb4, 0xa1, 0x00, 0xd8, 0xcc, 0x66, 0xf3, 0xb1, 0x6b, 0xd7, + 0xae, 0x0d, 0x22, 0x79, 0x24, 0x2c, 0x2c, 0x4c, 0xc4, 0xb8, 0xc9, 0x29, + 0x17, 0x73, 0x49, 0x66, 0x61, 0x24, 0xa5, 0xa5, 0xa5, 0xcd, 0xfe, 0xe3, + 0x1f, 0xff, 0x18, 0x08, 0x00, 0x6f, 0xbd, 0xf5, 0x96, 0x59, 0xa7, 0xd3, + 0x69, 0x25, 0x12, 0x49, 0x44, 0x27, 0x8f, 0x89, 0xd8, 0xa3, 0xa2, 0x90, + 0xf0, 0xf0, 0x70, 0x09, 0x5b, 0x9b, 0xbf, 0xb4, 0xb4, 0x94, 0xae, 0xae, + 0xae, 0xae, 0x62, 0xe8, 0xd3, 0xcc, 0xf0, 0x0a, 0x9b, 0x2f, 0xdf, 0xca, + 0x7c, 0xd6, 0x31, 0xff, 0x72, 0xa9, 0x68, 0x02, 0xc6, 0xa3, 0x2a, 0x36, + 0x36, 0x76, 0xf8, 0xd8, 0xb1, 0x63, 0xb9, 0x79, 0xff, 0xe1, 0x87, 0x1f, + 0xac, 0x57, 0xaf, 0x5e, 0x3d, 0xc6, 0xb8, 0xf6, 0xd9, 0xdf, 0xb6, 0x36, + 0x36, 0x36, 0xae, 0x7a, 0xec, 0xb1, 0xc7, 0x06, 0xa3, 0x2d, 0xa5, 0xad, + 0x95, 0xa2, 0x28, 0x43, 0x6b, 0x6b, 0xeb, 0xb7, 0x02, 0xae, 0x6d, 0x36, + 0x87, 0xbf, 0x85, 0xf9, 0xbf, 0x01, 0xfc, 0x9a, 0x14, 0xe4, 0xd1, 0x52, + 0x34, 0x00, 0xc5, 0xc0, 0x81, 0x03, 0x07, 0x7f, 0xfe, 0xf9, 0xe7, 0x01, + 0xec, 0x05, 0x55, 0x2b, 0x57, 0xae, 0x6c, 0x3d, 0x72, 0xe4, 0x48, 0x36, + 0x80, 0x23, 0x0c, 0x1e, 0x2d, 0x2e, 0xd6, 0x01, 0x45, 0x51, 0x94, 0x8c, + 0xad, 0x51, 0x0e, 0x00, 0x85, 0x85, 0x85, 0xd6, 0xfa, 0xfa, 0xfa, 0xab, + 0x68, 0x4f, 0xc9, 0x93, 0x01, 0xa8, 0x92, 0x48, 0x24, 0xcd, 0x66, 0xb3, + 0x59, 0xc1, 0xd2, 0x51, 0xa5, 0x52, 0xb1, 0xde, 0x1b, 0xca, 0x85, 0x81, + 0x9d, 0x3a, 0x69, 0xd2, 0x24, 0xde, 0xbd, 0xa9, 0xbb, 0x77, 0xef, 0x6e, + 0x69, 0x6e, 0x6e, 0xfe, 0x99, 0x59, 0x5f, 0x4d, 0xcc, 0xd8, 0x2c, 0x5a, + 0xad, 0x36, 0xff, 0xd8, 0xb1, 0x63, 0x63, 0xef, 0xbc, 0xf3, 0x4e, 0x00, + 0xc0, 0x5d, 0x77, 0xdd, 0x15, 0xf0, 0xc5, 0x17, 0x5f, 0x0c, 0x2f, 0x2d, + 0x2d, 0xcd, 0x76, 0x38, 0xf2, 0xf1, 0x1b, 0x00, 0x7e, 0xf0, 0xc3, 0x7f, + 0x9b, 0x01, 0x40, 0x9c, 0x4d, 0xb3, 0xa9, 0x45, 0x31, 0xd1, 0xd1, 0xd1, + 0xfd, 0x47, 0x8f, 0x1e, 0x0d, 0xa0, 0xed, 0x12, 0x88, 0xea, 0xea, 0xea, + 0x02, 0x66, 0xe7, 0xe5, 0x28, 0xb8, 0x85, 0x04, 0x94, 0x0c, 0x40, 0x4c, + 0x7c, 0x7c, 0xbc, 0x82, 0xdd, 0x19, 0x03, 0xc0, 0xc9, 0x93, 0x27, 0x8d, + 0xad, 0xad, 0xad, 0x85, 0xcc, 0xee, 0xb0, 0x8e, 0x11, 0x50, 0x0a, 0xb3, + 0xd9, 0x5c, 0x55, 0x54, 0x54, 0x14, 0x3d, 0x68, 0xd0, 0x20, 0x00, 0x40, + 0x72, 0x72, 0x32, 0x15, 0x19, 0x19, 0x99, 0xdc, 0xd4, 0xd4, 0x14, 0x40, + 0x08, 0x68, 0xca, 0x41, 0x90, 0x5f, 0x3f, 0x7c, 0xf8, 0x70, 0xe9, 0x94, + 0x29, 0x53, 0xaa, 0x68, 0x9a, 0x96, 0xd2, 0x34, 0x2d, 0xa3, 0x69, 0x5a, + 0x26, 0x16, 0x8b, 0x43, 0x4f, 0x9d, 0x3a, 0x25, 0x67, 0x85, 0xa9, 0x37, + 0xa7, 0x30, 0x68, 0x4f, 0x3b, 0x0c, 0x08, 0x0f, 0x0f, 0x17, 0x93, 0x97, + 0xcb, 0x9c, 0x39, 0x73, 0xc6, 0x02, 0xe0, 0x1c, 0x80, 0x2a, 0x66, 0xfc, + 0x41, 0x00, 0x82, 0x4d, 0x26, 0x53, 0x75, 0x6d, 0x6d, 0x2d, 0x77, 0x1f, + 0x64, 0x70, 0x70, 0x30, 0xec, 0x76, 0xbb, 0x02, 0xc2, 0x05, 0x71, 0x58, + 0xfc, 0xcd, 0x00, 0x0c, 0xa7, 0x4f, 0x9f, 0xc6, 0x90, 0x21, 0x43, 0x2a, + 0x69, 0x9a, 0x16, 0x31, 0x57, 0x4b, 0x96, 0x31, 0x34, 0x36, 0x33, 0xca, + 0x09, 0x00, 0x78, 0x4a, 0x04, 0x00, 0x2a, 0x2b, 0x2b, 0xad, 0x8c, 0x02, + 0x71, 0x56, 0x0c, 0x88, 0xdd, 0xc9, 0xaa, 0x01, 0x84, 0x45, 0x45, 0x45, + 0xcd, 0x7b, 0xe1, 0x85, 0x17, 0xa2, 0x62, 0x62, 0x62, 0x70, 0xfc, 0xf8, + 0x71, 0xec, 0xda, 0xb5, 0xab, 0x4e, 0x24, 0x12, 0x99, 0x99, 0x5d, 0x6e, + 0x67, 0x79, 0x45, 0x02, 0x20, 0x3c, 0x3e, 0x3e, 0x9e, 0x33, 0x70, 0xf2, + 0xf3, 0xf3, 0xcd, 0x16, 0x8b, 0xc5, 0xc8, 0xb4, 0x1b, 0xc3, 0xe0, 0xa7, + 0x05, 0x50, 0xc6, 0xd0, 0xcd, 0xc8, 0xcc, 0x23, 0x59, 0x11, 0x90, 0x16, + 0x30, 0x1e, 0x23, 0xc3, 0xc3, 0xc3, 0x35, 0xe4, 0x1d, 0xdb, 0x07, 0x0f, + 0x1e, 0x34, 0x9a, 0xcd, 0xe6, 0x7a, 0x86, 0x3f, 0xa5, 0xcc, 0xbb, 0x36, + 0xab, 0xd5, 0xaa, 0xb7, 0x5a, 0xad, 0x39, 0x0c, 0x5f, 0x36, 0x32, 0x7c, + 0x55, 0x8f, 0x8e, 0x45, 0xaa, 0xc8, 0xa2, 0x3b, 0xac, 0x47, 0x82, 0xac, + 0x60, 0xc8, 0xc6, 0x1e, 0x88, 0x01, 0x58, 0xe3, 0xe2, 0xe2, 0xee, 0x7c, + 0xfd, 0xf5, 0xd7, 0x43, 0xd9, 0x1b, 0xdd, 0xb2, 0xb3, 0xb3, 0xed, 0xdf, + 0x7c, 0xf3, 0xcd, 0x79, 0xbd, 0x5e, 0xff, 0x15, 0xda, 0x6b, 0x3f, 0x08, + 0x9d, 0x9f, 0x73, 0xd5, 0x32, 0x5b, 0x5b, 0x5b, 0x6b, 0x2a, 0x2a, 0x2a, + 0xfa, 0xc7, 0xc4, 0xc4, 0x00, 0x00, 0xa2, 0xa3, 0xa3, 0xc5, 0x72, 0xb9, + 0x3c, 0xc4, 0x64, 0x32, 0x91, 0x85, 0xa5, 0x94, 0x0a, 0x85, 0x42, 0x42, + 0xf2, 0xeb, 0x95, 0x2b, 0x57, 0xcc, 0xcc, 0x38, 0x1c, 0xeb, 0x6c, 0x90, + 0x59, 0x30, 0x41, 0xb1, 0xb1, 0xb1, 0x72, 0xb2, 0xe3, 0x9a, 0x9a, 0x1a, + 0x1b, 0xda, 0xd2, 0xfc, 0xb4, 0x0c, 0x2d, 0x64, 0x00, 0x82, 0xaa, 0xaa, + 0xaa, 0x8a, 0x2b, 0x2a, 0x2a, 0x46, 0xb3, 0xfc, 0x98, 0x92, 0x92, 0x02, + 0x95, 0x4a, 0xd5, 0x9b, 0x31, 0x10, 0x49, 0x2f, 0x95, 0x1f, 0xfc, 0xe0, + 0x87, 0xff, 0x42, 0x03, 0x80, 0x57, 0xd8, 0x45, 0x2c, 0x16, 0x8f, 0x9a, + 0x3d, 0x7b, 0xb6, 0x46, 0x26, 0x93, 0x01, 0x00, 0x36, 0x6f, 0xde, 0xac, + 0xab, 0xac, 0xac, 0x3c, 0xc8, 0xec, 0x5c, 0xd8, 0x22, 0x2b, 0x42, 0x55, + 0xc4, 0x48, 0xf7, 0x70, 0x74, 0x9f, 0x3e, 0x7d, 0x78, 0x5a, 0xb8, 0xb8, + 0xb8, 0xd8, 0xcc, 0x28, 0x02, 0x03, 0xf3, 0x48, 0x01, 0x18, 0xf4, 0x7a, + 0x7d, 0x55, 0x4d, 0x4d, 0x0d, 0xe7, 0x2a, 0x88, 0x89, 0x89, 0x81, 0x44, + 0x22, 0x61, 0x53, 0xf6, 0xa4, 0xc4, 0x2e, 0x9a, 0xac, 0xbe, 0x57, 0x56, + 0x52, 0x52, 0xf2, 0x3f, 0xcc, 0x0e, 0x37, 0x0c, 0x6d, 0xe7, 0xae, 0x09, + 0xfd, 0xfb, 0xf7, 0x7f, 0xce, 0x6a, 0xb5, 0x76, 0xc6, 0x00, 0x20, 0x95, + 0x73, 0x59, 0x41, 0x41, 0x41, 0xc1, 0x8c, 0x19, 0x33, 0x58, 0x85, 0x60, + 0x37, 0x18, 0x0c, 0x35, 0x68, 0xcb, 0xfb, 0xd6, 0x11, 0x02, 0x53, 0xaa, + 0xd1, 0x68, 0xa2, 0x63, 0x63, 0x63, 0xb9, 0x06, 0x0c, 0x06, 0x03, 0x28, + 0x8a, 0x32, 0x82, 0x5f, 0x96, 0x16, 0x02, 0xf8, 0x17, 0xd5, 0xd4, 0xd4, + 0x64, 0xd5, 0xd4, 0xd4, 0x04, 0x11, 0xbb, 0x3d, 0x33, 0xf3, 0x8e, 0x1c, + 0x4c, 0x7e, 0xb7, 0x46, 0xa3, 0x99, 0x3e, 0x65, 0xca, 0x14, 0xce, 0x02, + 0xa8, 0xad, 0xad, 0xc5, 0x89, 0x13, 0x27, 0x8c, 0x8c, 0xfb, 0x96, 0x67, + 0x88, 0x09, 0x04, 0xfe, 0x85, 0x00, 0x18, 0x3a, 0x64, 0xc8, 0x90, 0x3b, + 0x1e, 0x78, 0xe0, 0x01, 0x89, 0xcd, 0x66, 0xc3, 0xca, 0x95, 0x2b, 0x75, + 0xc5, 0xc5, 0xc5, 0x87, 0x12, 0x12, 0x12, 0x06, 0x77, 0x81, 0x57, 0xd8, + 0x39, 0x0e, 0xef, 0xdd, 0xbb, 0xb7, 0x9c, 0xf4, 0xf0, 0x04, 0x07, 0x07, + 0x0f, 0xcf, 0xcc, 0xcc, 0x1c, 0x33, 0x6c, 0xd8, 0x30, 0x71, 0x70, 0x70, + 0xb0, 0xa8, 0xae, 0xae, 0xce, 0x76, 0xe2, 0xc4, 0x09, 0x53, 0x55, 0x55, + 0x55, 0x51, 0x71, 0x71, 0xf1, 0x76, 0x66, 0xf7, 0xcc, 0x2a, 0x62, 0xb2, + 0xa4, 0x34, 0x89, 0x7b, 0x5c, 0x5a, 0x5a, 0x9a, 0x8c, 0xec, 0xb4, 0xb0, + 0xb0, 0x10, 0x00, 0x92, 0xfa, 0xf6, 0xed, 0x3b, 0x21, 0x32, 0x32, 0x32, + 0x28, 0x32, 0x32, 0x92, 0x6a, 0x6e, 0x6e, 0x46, 0x75, 0x75, 0xb5, 0xa5, + 0xbe, 0xbe, 0xbe, 0xa8, 0xa2, 0xa2, 0x62, 0x0f, 0x80, 0x13, 0xcc, 0xeb, + 0x1d, 0x4a, 0x26, 0x13, 0x15, 0xf5, 0xd8, 0x3e, 0x2d, 0xe0, 0xd7, 0x92, + 0x08, 0x60, 0x68, 0x26, 0x93, 0x4a, 0xa5, 0xe3, 0x66, 0xcc, 0x98, 0x91, + 0x7a, 0xef, 0xbd, 0xf7, 0x8a, 0x00, 0xa0, 0xa1, 0xa1, 0x01, 0x2b, 0x57, + 0xae, 0xac, 0x2b, 0x2d, 0x2d, 0xfd, 0x27, 0x63, 0xa0, 0x35, 0x91, 0xbb, + 0x7f, 0x87, 0x75, 0xc0, 0x96, 0xca, 0x36, 0x15, 0x17, 0x17, 0x1f, 0xdf, + 0xbd, 0x7b, 0xf7, 0x88, 0x61, 0xc3, 0x86, 0x05, 0x00, 0xc0, 0xcc, 0x99, + 0x33, 0xa9, 0x85, 0x0b, 0x17, 0x4e, 0x65, 0x94, 0xfb, 0x15, 0x00, 0x41, + 0x61, 0x61, 0x61, 0xd3, 0x16, 0x2e, 0x5c, 0xa8, 0x64, 0xd7, 0x5a, 0x59, + 0x59, 0x19, 0xce, 0x9f, 0x3f, 0xaf, 0x47, 0x5b, 0x71, 0x2c, 0xa1, 0x4a, + 0x9b, 0x14, 0x00, 0x4a, 0x2a, 0x95, 0x06, 0x06, 0x05, 0x05, 0x71, 0x06, + 0x26, 0x59, 0x6a, 0x42, 0xe0, 0x11, 0x91, 0x41, 0x8f, 0xe1, 0xe1, 0xe1, + 0x10, 0x8b, 0xc5, 0x6c, 0xe1, 0x26, 0x09, 0x5c, 0x07, 0x7d, 0xfa, 0xc1, + 0x0f, 0x7e, 0xf8, 0x4f, 0x35, 0x00, 0x1c, 0x0a, 0x97, 0x04, 0x02, 0x50, + 0x27, 0x27, 0x27, 0x4f, 0xbc, 0xef, 0xbe, 0xfb, 0xe4, 0x00, 0x50, 0x55, + 0x55, 0x85, 0xbc, 0xbc, 0xbc, 0x46, 0x00, 0x67, 0x08, 0x97, 0xae, 0x15, + 0xee, 0xcb, 0xff, 0x06, 0xf7, 0xe9, 0xd3, 0x87, 0x27, 0xc4, 0x9b, 0x9a, + 0x9a, 0xec, 0xcc, 0xce, 0x89, 0x2d, 0x34, 0x03, 0x00, 0x66, 0x9d, 0x4e, + 0xd7, 0x64, 0x30, 0x18, 0x40, 0xee, 0xa2, 0x65, 0x32, 0x19, 0x79, 0x36, + 0x4b, 0x11, 0x3b, 0x47, 0x56, 0x81, 0xd2, 0x8c, 0x12, 0x69, 0x46, 0x7b, + 0x34, 0xb3, 0x04, 0x1d, 0x0b, 0x07, 0x79, 0xe3, 0x01, 0xb0, 0x31, 0xbb, + 0xd4, 0xca, 0xa2, 0xa2, 0xa2, 0xff, 0xc7, 0xd0, 0x43, 0xca, 0xf4, 0xcb, + 0x96, 0x52, 0xa5, 0x09, 0xe5, 0x3a, 0x38, 0x39, 0x39, 0xb9, 0x57, 0x46, + 0x06, 0xe7, 0x00, 0xc0, 0xc5, 0x8b, 0x17, 0xd1, 0xdc, 0xdc, 0x5c, 0x82, + 0xf6, 0x63, 0x12, 0x47, 0x01, 0xce, 0x79, 0x00, 0x18, 0x3a, 0x34, 0x31, + 0x4a, 0x4f, 0x06, 0x40, 0xa1, 0x56, 0xab, 0x33, 0x83, 0x83, 0x83, 0xff, + 0x47, 0xa1, 0x50, 0x44, 0xd6, 0xd4, 0xd4, 0x0c, 0x78, 0xe6, 0x99, 0x67, + 0x24, 0x0f, 0x3f, 0xfc, 0xb0, 0x88, 0x15, 0xf2, 0x4f, 0x3c, 0xf1, 0x44, + 0x6b, 0x45, 0x45, 0xc5, 0x77, 0xcc, 0x98, 0x2d, 0x4e, 0x76, 0xd1, 0xdc, + 0x39, 0x76, 0x72, 0x72, 0xf2, 0x82, 0xbf, 0xfc, 0xe5, 0x2f, 0x21, 0x52, + 0xa9, 0x14, 0xdb, 0xb7, 0x6f, 0xb7, 0x9d, 0x3c, 0x79, 0xf2, 0x22, 0x80, + 0x2b, 0x14, 0x45, 0xf5, 0xef, 0x24, 0xaf, 0x70, 0xb5, 0xf4, 0x45, 0x22, + 0x51, 0x48, 0x72, 0x72, 0x32, 0x67, 0x00, 0xa4, 0xa5, 0xa5, 0xc9, 0xfe, + 0xf4, 0xa7, 0x3f, 0x45, 0x4e, 0x9e, 0x3c, 0x99, 0xa7, 0x4c, 0x68, 0x9a, + 0x46, 0x5e, 0x5e, 0x5e, 0xc4, 0xdc, 0xb9, 0x73, 0x33, 0x9b, 0x9a, 0x9a, + 0xb6, 0x68, 0xb5, 0xda, 0xcf, 0xd1, 0xf1, 0x7e, 0x03, 0xf2, 0xee, 0x89, + 0x90, 0xa4, 0xa4, 0x24, 0x8e, 0x77, 0xf4, 0x7a, 0x3d, 0xca, 0xca, 0xca, + 0xe4, 0x0b, 0x16, 0x2c, 0x18, 0xb5, 0x7c, 0xf9, 0x72, 0x45, 0x72, 0x72, + 0x32, 0xd7, 0xb6, 0xd9, 0x6c, 0xc6, 0xf1, 0xe3, 0xc7, 0xa3, 0x5e, 0x7a, + 0xe9, 0xa5, 0xfe, 0x05, 0x05, 0x05, 0x5f, 0xe9, 0xf5, 0xfa, 0x6d, 0x68, + 0xaf, 0x96, 0xc8, 0x8b, 0xbf, 0x20, 0x14, 0x35, 0x19, 0xb9, 0x4f, 0xd6, + 0xd1, 0x57, 0x01, 0x48, 0xcc, 0xc8, 0xc8, 0x98, 0xb1, 0x7c, 0xf9, 0x72, + 0xce, 0xbd, 0xfe, 0xe6, 0x9b, 0x6f, 0xb6, 0x16, 0x14, 0x14, 0xfc, 0x00, + 0xe0, 0x02, 0xe3, 0x5d, 0x30, 0xa0, 0xbd, 0xac, 0x34, 0xef, 0x62, 0x23, + 0x8a, 0xa2, 0x58, 0x2f, 0x92, 0x09, 0x40, 0xde, 0x3f, 0xff, 0xf9, 0xcf, + 0xfb, 0x13, 0x12, 0x12, 0xe2, 0x17, 0x2c, 0x58, 0x40, 0x69, 0x34, 0x1a, + 0x54, 0x54, 0x54, 0x60, 0xe9, 0xd2, 0xa5, 0x33, 0xaf, 0x5c, 0xb9, 0x62, + 0x51, 0x2a, 0x95, 0xa2, 0x19, 0x33, 0x66, 0x04, 0xfc, 0xe1, 0x0f, 0x7f, + 0x10, 0xb3, 0xc6, 0xe3, 0xc2, 0x85, 0x0b, 0x5b, 0x4a, 0x4b, 0x4b, 0xb7, + 0x33, 0x86, 0xb6, 0x19, 0x1d, 0xb3, 0x6d, 0xec, 0x00, 0x6c, 0x16, 0x8b, + 0xa5, 0xa9, 0xae, 0xae, 0xce, 0xca, 0xca, 0x0e, 0x8a, 0xa2, 0x10, 0x14, + 0x14, 0x24, 0x43, 0x5b, 0xfa, 0x61, 0x3d, 0xb1, 0xa6, 0x43, 0xa2, 0xa3, + 0xa3, 0xfb, 0xc4, 0xc5, 0xc5, 0x89, 0x88, 0x31, 0x23, 0x32, 0x32, 0x92, + 0x42, 0x5b, 0xc0, 0xa5, 0x5f, 0xf9, 0xfb, 0xc1, 0x0f, 0xff, 0xe5, 0x1e, + 0x00, 0xee, 0xec, 0x15, 0x40, 0x6a, 0xdf, 0xbe, 0x7d, 0x63, 0xfa, 0xf7, + 0x6f, 0xd3, 0x0f, 0x7b, 0xf6, 0xec, 0xb1, 0x96, 0x97, 0x97, 0x1f, 0x62, + 0xdc, 0x8a, 0xac, 0xfb, 0x9f, 0x76, 0x11, 0x30, 0xc4, 0x1a, 0x01, 0xf2, + 0x80, 0x80, 0x00, 0xde, 0xf9, 0x77, 0x73, 0x73, 0x33, 0x0d, 0xa2, 0x4c, + 0x2e, 0xfb, 0xb4, 0xb6, 0x01, 0x4d, 0x0a, 0x22, 0x99, 0x4c, 0x46, 0x5e, + 0xda, 0x42, 0x06, 0xf0, 0xd9, 0x09, 0xc5, 0x6a, 0x21, 0xda, 0x93, 0x00, + 0x08, 0xa3, 0x28, 0xca, 0xde, 0x05, 0x3a, 0xd8, 0x89, 0x5d, 0xb8, 0x85, + 0x11, 0xf4, 0x64, 0xff, 0x52, 0xb4, 0xb9, 0xfe, 0x23, 0x01, 0x0c, 0x4e, + 0x4a, 0x4a, 0x7a, 0xe4, 0xcd, 0x37, 0xdf, 0x54, 0x93, 0xde, 0x86, 0x6d, + 0xdb, 0xb6, 0x19, 0x4a, 0x4a, 0x4a, 0x0e, 0x12, 0x0a, 0xda, 0x26, 0xd0, + 0x07, 0x89, 0x3f, 0xb9, 0x63, 0x97, 0x84, 0x84, 0x84, 0xcc, 0x7b, 0xf6, + 0xd9, 0x67, 0xef, 0x9a, 0x3a, 0x75, 0x2a, 0x7a, 0xf5, 0xea, 0x05, 0xf6, + 0xfc, 0x19, 0x00, 0xfa, 0xf6, 0xed, 0x6b, 0xad, 0xab, 0xab, 0x3b, 0x65, + 0x32, 0x99, 0x8e, 0x3b, 0x7a, 0x18, 0x04, 0x52, 0xd0, 0x42, 0x15, 0x0a, + 0xc5, 0xbd, 0xb3, 0x67, 0xcf, 0xee, 0x3d, 0x6c, 0xd8, 0x30, 0x34, 0x35, + 0x35, 0xe1, 0xad, 0xb7, 0xde, 0xaa, 0xbf, 0x71, 0xe3, 0xc6, 0x6e, 0xc2, + 0xf8, 0x10, 0x9a, 0x3b, 0x77, 0x01, 0x93, 0x5c, 0x40, 0x5a, 0x44, 0x44, + 0x44, 0x24, 0xa9, 0x58, 0xde, 0x7b, 0xef, 0x3d, 0xb1, 0x44, 0x22, 0x11, + 0x32, 0x1c, 0x30, 0x72, 0xe4, 0x48, 0x5c, 0xbc, 0x78, 0x31, 0xe0, 0x91, + 0x47, 0x1e, 0xf9, 0x9f, 0x3d, 0x7b, 0xf6, 0x98, 0x0d, 0x06, 0xc3, 0x67, + 0xe0, 0xd7, 0xbd, 0x07, 0x61, 0x04, 0x28, 0x43, 0x43, 0x43, 0x39, 0xa2, + 0x2a, 0x14, 0x0a, 0xbc, 0xfc, 0xf2, 0xcb, 0x92, 0x45, 0x8b, 0x16, 0x49, + 0x1d, 0x4b, 0x74, 0xca, 0x64, 0x32, 0x8c, 0x1e, 0x3d, 0x9a, 0x3a, 0x70, + 0xe0, 0x40, 0xf0, 0xef, 0x7f, 0xff, 0xfb, 0x87, 0xf6, 0xef, 0xdf, 0x6f, + 0x6e, 0x6d, 0x6d, 0xfd, 0x92, 0x30, 0x0a, 0xad, 0x1e, 0x18, 0xbf, 0x6c, + 0xea, 0x67, 0x68, 0x64, 0x64, 0xe4, 0xbc, 0x65, 0xcb, 0x96, 0x45, 0x46, + 0x47, 0x47, 0x03, 0x00, 0xf2, 0xf3, 0xf3, 0xf1, 0xdd, 0x77, 0xdf, 0x95, + 0x18, 0x8d, 0xc6, 0x7f, 0x31, 0x8a, 0x55, 0x07, 0x27, 0x15, 0xf4, 0x98, + 0xf6, 0xc8, 0x7b, 0x03, 0x9a, 0x4b, 0x4a, 0x4a, 0x3e, 0xf9, 0xdf, 0xff, + 0xfd, 0xdf, 0xd7, 0x12, 0x12, 0x12, 0x6c, 0x93, 0x26, 0x4d, 0x12, 0xc7, + 0xc6, 0xc6, 0xe2, 0xcb, 0x2f, 0xbf, 0x0c, 0xa0, 0x28, 0x2a, 0x80, 0xa5, + 0x0d, 0x0b, 0xe9, 0xe9, 0xe9, 0x96, 0xda, 0xda, 0xda, 0x43, 0x56, 0xab, + 0xb5, 0x00, 0xc2, 0x97, 0x6d, 0xd1, 0x84, 0xf7, 0xa2, 0xea, 0xd8, 0xb1, + 0x63, 0x2d, 0x8f, 0x3f, 0xfe, 0xb8, 0x9a, 0xfd, 0x32, 0x2b, 0x2b, 0x2b, + 0xe0, 0xf4, 0xe9, 0xd3, 0x0b, 0x4d, 0x26, 0xd3, 0x6a, 0xc6, 0x40, 0x95, + 0x00, 0x18, 0xa1, 0x52, 0xa9, 0x06, 0x8d, 0x1c, 0x39, 0x92, 0x87, 0xab, + 0x42, 0xa1, 0x60, 0x0b, 0x0a, 0x89, 0xe0, 0xdd, 0x85, 0x48, 0x7e, 0xf0, + 0x83, 0x1f, 0xfe, 0x83, 0x0c, 0x00, 0x5e, 0x8d, 0xf4, 0x90, 0x90, 0x90, + 0xd1, 0x0f, 0x3d, 0xf4, 0x90, 0x86, 0xdd, 0xb9, 0x6d, 0xde, 0xbc, 0x59, + 0xa7, 0xd7, 0xeb, 0x73, 0xc1, 0x2f, 0x4d, 0x6a, 0x77, 0xa1, 0x1c, 0x28, + 0xc2, 0x3d, 0xce, 0x3b, 0x03, 0xb7, 0xd9, 0x6c, 0x20, 0xbc, 0x07, 0xe4, + 0x63, 0x35, 0x9b, 0xcd, 0x3c, 0x03, 0x80, 0x39, 0xf7, 0x66, 0x05, 0x34, + 0xc8, 0x1d, 0x1c, 0xa3, 0xe4, 0xc9, 0x5b, 0xd4, 0x5a, 0xd1, 0x7e, 0x19, + 0x4c, 0x57, 0x02, 0x99, 0xec, 0xe0, 0xdf, 0x78, 0xc8, 0x7a, 0x15, 0xe4, + 0xac, 0x77, 0x04, 0x6d, 0x47, 0x0d, 0x13, 0xfa, 0xf7, 0xef, 0xff, 0xd8, + 0xae, 0x5d, 0xbb, 0xc2, 0xfb, 0xf6, 0xed, 0x4b, 0x2a, 0x7f, 0xfc, 0xf0, + 0xc3, 0x0f, 0x45, 0x00, 0x0e, 0x13, 0xde, 0x12, 0x3b, 0x71, 0xd3, 0x9d, + 0x10, 0xfe, 0xac, 0x67, 0x43, 0x0c, 0xc0, 0x26, 0x95, 0x4a, 0xcd, 0xa3, + 0x47, 0x8f, 0x06, 0x99, 0x1d, 0xc0, 0x42, 0x54, 0x54, 0x14, 0xc5, 0xc4, + 0x1b, 0x04, 0xa2, 0xe3, 0xcd, 0x81, 0x20, 0x5c, 0xd9, 0x1a, 0x00, 0xc9, + 0xe9, 0xe9, 0xe9, 0xbf, 0x5b, 0xba, 0x74, 0x69, 0x20, 0x00, 0x7c, 0xf4, + 0xd1, 0x47, 0xa6, 0x8b, 0x17, 0x2f, 0x1e, 0x46, 0xdb, 0x19, 0xb1, 0x44, + 0xc8, 0x50, 0xa2, 0x69, 0x9a, 0x55, 0x86, 0x52, 0xa2, 0x6d, 0x9b, 0x13, + 0x6f, 0x89, 0x55, 0xa3, 0xd1, 0x44, 0x90, 0x35, 0x00, 0x24, 0x12, 0x09, + 0xae, 0x5d, 0xbb, 0x86, 0x4f, 0x3e, 0xf9, 0xc4, 0xd4, 0xd0, 0xd0, 0x60, + 0xe9, 0xd5, 0xab, 0x97, 0xf4, 0xfe, 0xfb, 0xef, 0x97, 0xb3, 0xc6, 0x64, + 0x40, 0x40, 0x00, 0x36, 0x6e, 0xdc, 0xa8, 0x9c, 0x3c, 0x79, 0xf2, 0xac, + 0x5f, 0x7f, 0xfd, 0xf5, 0x08, 0xda, 0xef, 0x7d, 0xb0, 0x10, 0xe3, 0x10, + 0x01, 0x90, 0xa9, 0x54, 0x2a, 0x6e, 0xde, 0xa5, 0x52, 0x29, 0x9e, 0x7d, + 0xf6, 0x59, 0x8a, 0xa2, 0x28, 0xec, 0xde, 0xbd, 0x1b, 0xe7, 0xcf, 0x9f, + 0x37, 0xcb, 0xe5, 0x72, 0xd1, 0xb8, 0x71, 0xe3, 0x24, 0x6c, 0x14, 0xbc, + 0x5c, 0x2e, 0xc7, 0xd6, 0xad, 0x5b, 0x95, 0xd3, 0xa6, 0x4d, 0xbb, 0xff, + 0xc8, 0x91, 0x23, 0xf9, 0x68, 0xcf, 0x56, 0xb1, 0xc0, 0x79, 0x9e, 0x3b, + 0xe9, 0x31, 0x51, 0x03, 0xc8, 0xcc, 0xcc, 0xcc, 0x1c, 0x3e, 0x6b, 0xd6, + 0x2c, 0xce, 0x70, 0xfd, 0xe0, 0x83, 0x0f, 0x0c, 0x57, 0xae, 0x5c, 0xd9, + 0x89, 0xb6, 0xfb, 0x18, 0xb4, 0x68, 0xcf, 0x80, 0x71, 0x66, 0x04, 0x93, + 0x41, 0x92, 0x12, 0xa5, 0x52, 0xd9, 0x2f, 0x21, 0x21, 0xc1, 0x18, 0x1a, + 0x1a, 0xaa, 0xe0, 0x5e, 0x10, 0x09, 0x97, 0xa3, 0x98, 0x39, 0x73, 0xa6, + 0x68, 0xe3, 0xc6, 0x8d, 0x23, 0x8d, 0x46, 0xe3, 0x2e, 0x27, 0xf3, 0x4b, + 0x13, 0xfc, 0x7e, 0x31, 0x2f, 0x2f, 0x4f, 0xa7, 0xd7, 0xeb, 0xd5, 0x41, + 0x41, 0x41, 0x00, 0x80, 0x15, 0x2b, 0x56, 0x88, 0x2b, 0x2a, 0x2a, 0xa2, + 0x0e, 0x1d, 0x3a, 0xf4, 0x6c, 0x7d, 0x7d, 0x7d, 0x89, 0x4a, 0xa5, 0x52, + 0xdb, 0xed, 0xf6, 0x81, 0x39, 0x39, 0x39, 0x0a, 0xf6, 0x1d, 0x16, 0x02, + 0x03, 0x03, 0x81, 0xf6, 0x3b, 0x10, 0xfc, 0xca, 0xdf, 0x0f, 0x7e, 0xf8, + 0x6f, 0x33, 0x00, 0x84, 0xce, 0x8c, 0x63, 0x63, 0x63, 0x6f, 0xcf, 0xca, + 0xca, 0x12, 0xb1, 0xbb, 0x9f, 0xd2, 0xd2, 0xd2, 0x52, 0xb4, 0x47, 0xbe, + 0x7b, 0x53, 0x34, 0x84, 0x76, 0x2c, 0x08, 0xc3, 0xec, 0x76, 0x84, 0x02, + 0x8e, 0x44, 0x8e, 0x3b, 0x3b, 0x87, 0x62, 0x2b, 0x8e, 0xdf, 0x71, 0xae, + 0x5c, 0x66, 0x0c, 0x9d, 0xbd, 0x22, 0x17, 0x02, 0xc6, 0x05, 0x08, 0x03, + 0x87, 0x15, 0xe6, 0x01, 0x60, 0x2e, 0x02, 0x52, 0xab, 0xd5, 0x0f, 0xde, + 0x71, 0xc7, 0x1d, 0xd3, 0xd6, 0xad, 0x5b, 0xa7, 0xe9, 0xd3, 0xa7, 0x0f, + 0xf7, 0xfb, 0xa3, 0x47, 0x8f, 0xe2, 0xc1, 0x07, 0x1f, 0xb4, 0xdb, 0xed, + 0xf6, 0x77, 0xd0, 0x16, 0x24, 0xd6, 0x8c, 0x76, 0x17, 0xbd, 0x23, 0xcd, + 0x3b, 0x9c, 0xd1, 0xb2, 0x06, 0x08, 0x4d, 0xd3, 0xb8, 0x7e, 0xfd, 0x3a, + 0x5a, 0x5a, 0x5a, 0x10, 0x17, 0x17, 0x87, 0x94, 0x94, 0x14, 0x4e, 0x61, + 0xe4, 0xe6, 0xe6, 0x8a, 0x57, 0xac, 0x58, 0xa1, 0xde, 0xb8, 0x71, 0xe3, + 0x1f, 0x8a, 0x8b, 0x8b, 0xff, 0x0f, 0xed, 0xc1, 0x68, 0xbc, 0xe2, 0x3c, + 0x00, 0x42, 0x62, 0x62, 0x62, 0x1e, 0x5a, 0xba, 0x74, 0x69, 0x64, 0x44, + 0x44, 0x04, 0x0a, 0x0b, 0x0b, 0xf1, 0xd9, 0x67, 0x9f, 0xd5, 0x19, 0x0c, + 0x86, 0x13, 0xac, 0x71, 0xc6, 0xd4, 0xc0, 0x17, 0xe2, 0xc3, 0x40, 0xb4, + 0xdf, 0x2a, 0xe7, 0x2c, 0xc8, 0xcd, 0x0a, 0xc0, 0x28, 0x12, 0x89, 0x42, + 0xf5, 0x7a, 0x3d, 0x0a, 0x0a, 0x0a, 0xa0, 0x50, 0x28, 0x90, 0x9b, 0x9b, + 0x6b, 0x7f, 0xe5, 0x95, 0x57, 0x2a, 0x4b, 0x4b, 0x4b, 0xbf, 0x67, 0xc6, + 0x1f, 0xfb, 0xda, 0x6b, 0xaf, 0xfd, 0x4f, 0x7e, 0x7e, 0x3e, 0x35, 0x60, + 0xc0, 0x00, 0x8a, 0x35, 0x02, 0x16, 0x2d, 0x5a, 0x14, 0x7e, 0xf6, 0xec, + 0xd9, 0x3b, 0x9b, 0x9b, 0x9b, 0x2f, 0x13, 0x4a, 0x95, 0x47, 0x26, 0x89, + 0x44, 0xc2, 0xd3, 0x92, 0x46, 0xa3, 0x11, 0x33, 0x66, 0xcc, 0x30, 0x1d, + 0x3a, 0x74, 0xa8, 0xd9, 0x68, 0x34, 0xfe, 0x20, 0x16, 0x8b, 0xe5, 0x89, + 0x89, 0x89, 0x13, 0x36, 0x6c, 0xd8, 0x10, 0x3e, 0x71, 0xe2, 0x44, 0x31, + 0x00, 0xa8, 0x54, 0x2a, 0x2c, 0x59, 0xb2, 0x24, 0xfc, 0xd2, 0xa5, 0x4b, + 0x77, 0xd7, 0xd7, 0xd7, 0x17, 0xa0, 0xed, 0x78, 0xa5, 0xd5, 0x0d, 0xef, + 0x73, 0x85, 0x87, 0xe2, 0xe2, 0xe2, 0x66, 0x2d, 0x59, 0xb2, 0x24, 0x84, + 0xf5, 0xe8, 0x9c, 0x39, 0x73, 0x06, 0xbf, 0xfc, 0xf2, 0x4b, 0x29, 0x80, + 0x5c, 0xb4, 0x67, 0x1f, 0x58, 0xe0, 0xe4, 0x92, 0x27, 0xf0, 0xa3, 0xf4, + 0x95, 0x22, 0x91, 0x68, 0xac, 0xdd, 0x6e, 0x7f, 0xf0, 0xe8, 0xd1, 0xa3, + 0x22, 0x36, 0xc3, 0xc5, 0x68, 0x34, 0xe2, 0xc7, 0x1f, 0x7f, 0xa4, 0x0b, + 0x0b, 0x0b, 0xad, 0x6a, 0xb5, 0x5a, 0x34, 0x6c, 0xd8, 0x30, 0x31, 0x9b, + 0x29, 0xf3, 0xfe, 0xfb, 0xef, 0x8b, 0x13, 0x12, 0x12, 0xd4, 0xef, 0xbf, + 0xff, 0xfe, 0x13, 0x65, 0x65, 0x65, 0x7f, 0x42, 0xfb, 0xe5, 0x4a, 0x66, + 0x82, 0x6f, 0xac, 0x8c, 0xd1, 0x54, 0x5d, 0x58, 0x58, 0xb8, 0xef, 0x83, + 0x0f, 0x3e, 0x78, 0xe0, 0xff, 0xfe, 0xef, 0xff, 0x14, 0xac, 0x61, 0xf1, + 0x8f, 0x7f, 0xfc, 0x43, 0x71, 0xee, 0xdc, 0xb9, 0x94, 0xca, 0xca, 0xca, + 0x94, 0xc0, 0xc0, 0x40, 0x0c, 0x1e, 0x3c, 0x98, 0xe7, 0x45, 0x62, 0xa1, + 0xb5, 0xb5, 0x15, 0xcc, 0x58, 0xfc, 0x91, 0xff, 0x7e, 0xf0, 0xc3, 0xad, + 0x6e, 0x00, 0x38, 0xe4, 0xc1, 0x53, 0x0e, 0xbb, 0x02, 0xf6, 0x5f, 0xda, + 0xcb, 0x5c, 0x5e, 0x32, 0xf7, 0x5a, 0x05, 0x60, 0xe8, 0xb8, 0x71, 0xe3, + 0x42, 0xd8, 0xdc, 0xff, 0x9d, 0x3b, 0x77, 0xb6, 0x5e, 0xbb, 0x76, 0xed, + 0x80, 0xc3, 0x4e, 0xcd, 0xee, 0xa2, 0x0f, 0x72, 0x57, 0x6f, 0x69, 0x6e, + 0x6e, 0xb6, 0x91, 0x3b, 0x78, 0x46, 0xb0, 0x8a, 0x04, 0x94, 0x9f, 0x48, + 0x26, 0x93, 0xf1, 0x04, 0x7e, 0x4b, 0x4b, 0x0b, 0x79, 0xf7, 0x7a, 0x8f, + 0xdb, 0x46, 0x04, 0x5d, 0xd8, 0xcb, 0x56, 0x32, 0x12, 0x13, 0x13, 0x9f, + 0x9d, 0x3f, 0x7f, 0x7e, 0xff, 0x65, 0xcb, 0x96, 0xf1, 0xb2, 0x1b, 0x8e, + 0x1c, 0x39, 0x42, 0x3f, 0xf3, 0xcc, 0x33, 0x95, 0x76, 0xbb, 0xfd, 0x2d, + 0xb4, 0xe5, 0x6e, 0x0b, 0xa6, 0x88, 0x11, 0x4a, 0x87, 0x55, 0x3c, 0xec, + 0x2e, 0x8f, 0xbd, 0xf9, 0x8e, 0x2e, 0x29, 0x29, 0xf9, 0xf0, 0xa9, 0xa7, + 0x9e, 0xba, 0xa1, 0x52, 0xa9, 0x62, 0x55, 0x2a, 0x55, 0x6a, 0x72, 0x72, + 0x72, 0xdc, 0xa6, 0x4d, 0x9b, 0x94, 0x6c, 0x25, 0xc5, 0x15, 0x2b, 0x56, + 0x88, 0x6c, 0x36, 0x5b, 0xf2, 0x9b, 0x6f, 0xbe, 0x39, 0xd1, 0x62, 0xb1, + 0x94, 0x31, 0xbf, 0x63, 0x3d, 0x1f, 0xac, 0x02, 0x1f, 0x3a, 0x7c, 0xf8, + 0xf0, 0xe1, 0x73, 0xe6, 0xcc, 0x11, 0x03, 0xc0, 0xeb, 0xaf, 0xbf, 0xde, + 0x7a, 0xf9, 0xf2, 0xe5, 0x53, 0xcc, 0x77, 0x00, 0x10, 0x40, 0xd3, 0xb4, + 0x5c, 0xc0, 0x08, 0x62, 0x6b, 0xd8, 0x07, 0x13, 0x1e, 0x0c, 0x93, 0xc0, + 0x1c, 0xdb, 0x00, 0xb4, 0xea, 0x74, 0xba, 0xaf, 0x17, 0x2c, 0x58, 0x70, + 0xbb, 0x58, 0x2c, 0x56, 0x03, 0x08, 0xb4, 0x58, 0x2c, 0xcd, 0xa5, 0xa5, + 0xa5, 0xeb, 0x18, 0xa5, 0x4e, 0x01, 0x08, 0xb6, 0xdb, 0xed, 0x55, 0x4f, + 0x3c, 0xf1, 0xc4, 0x93, 0xbf, 0xfc, 0xf2, 0x8b, 0x8a, 0x3d, 0x1e, 0x18, + 0x31, 0x62, 0x84, 0xb8, 0x57, 0xaf, 0x5e, 0x83, 0x2e, 0x5f, 0xbe, 0xcc, + 0xc6, 0x58, 0x88, 0x1c, 0x78, 0xc7, 0xc6, 0xf0, 0x0e, 0x67, 0xa4, 0xac, + 0x5f, 0xbf, 0xde, 0x9a, 0x97, 0x97, 0x77, 0xd0, 0x68, 0x34, 0xee, 0x04, + 0xa0, 0xb5, 0xd9, 0x6c, 0x92, 0xeb, 0xd7, 0xaf, 0x9f, 0x9f, 0x34, 0x69, + 0xd2, 0x6b, 0xc5, 0xc5, 0xc5, 0x48, 0x4c, 0x4c, 0x04, 0x00, 0x8c, 0x19, + 0x33, 0x46, 0x1c, 0x11, 0x11, 0x31, 0xb8, 0xbe, 0xbe, 0x5e, 0x85, 0xf6, + 0x54, 0x4c, 0x67, 0x40, 0xd6, 0xbd, 0xe8, 0xd7, 0xaf, 0x5f, 0xbf, 0xcc, + 0x3b, 0xef, 0xbc, 0x93, 0x33, 0x3c, 0x37, 0x6e, 0xdc, 0xd8, 0x72, 0xed, + 0xda, 0xb5, 0x6c, 0x66, 0x3e, 0x3d, 0xb9, 0x3c, 0x87, 0x4c, 0xbf, 0x0c, + 0x4b, 0x4d, 0x4d, 0x9d, 0xbd, 0x77, 0xef, 0x5e, 0x4e, 0xf9, 0x6b, 0xb5, + 0x5a, 0x24, 0x27, 0x27, 0x5b, 0xad, 0x56, 0xeb, 0x59, 0xad, 0x56, 0x7b, + 0x4e, 0x24, 0x12, 0x29, 0x63, 0x62, 0x62, 0xc6, 0xad, 0x59, 0xb3, 0x26, + 0x94, 0x9d, 0xab, 0x25, 0x4b, 0x96, 0x88, 0x2a, 0x2a, 0x2a, 0x92, 0xd7, + 0xac, 0x59, 0x33, 0x16, 0x6d, 0x01, 0xb3, 0x32, 0xa2, 0x5f, 0xb6, 0x82, + 0xa2, 0x11, 0x40, 0x53, 0x4b, 0x4b, 0xcb, 0x97, 0xeb, 0xd7, 0xaf, 0x4f, + 0x31, 0x99, 0x4c, 0x23, 0x56, 0xae, 0x5c, 0x29, 0xa3, 0x28, 0x0a, 0x52, + 0xa9, 0x14, 0x43, 0x86, 0x0c, 0x01, 0x99, 0x7e, 0x7b, 0xfc, 0xf8, 0x71, + 0x7a, 0xdf, 0xbe, 0x7d, 0xf4, 0x92, 0x25, 0x4b, 0x44, 0x6c, 0xda, 0x29, + 0xe3, 0x71, 0x33, 0x3b, 0xd0, 0xdd, 0x0f, 0x7e, 0xf0, 0xc3, 0xad, 0x66, + 0x00, 0x10, 0xd6, 0x3f, 0x19, 0xb0, 0xe4, 0x18, 0x19, 0x6f, 0x45, 0x5b, + 0x2e, 0xb4, 0xdd, 0x61, 0x97, 0xec, 0xae, 0x4d, 0xf6, 0xca, 0x52, 0x75, + 0x42, 0x42, 0xc2, 0xf8, 0xb9, 0x73, 0xe7, 0xaa, 0x18, 0x05, 0x8c, 0x5d, + 0xbb, 0x76, 0xe9, 0xd0, 0x76, 0xeb, 0x9f, 0x9e, 0x10, 0x42, 0xee, 0x04, + 0x05, 0xab, 0xb8, 0x8d, 0x06, 0x83, 0xc1, 0xca, 0xb4, 0x0f, 0x66, 0x87, + 0x26, 0x62, 0x0c, 0x0d, 0x31, 0x39, 0x8e, 0xa0, 0xa0, 0x20, 0x0d, 0xa9, + 0x50, 0x01, 0xc0, 0x64, 0x32, 0xb1, 0x3b, 0x4d, 0x6f, 0xee, 0xbd, 0xf7, + 0x85, 0x47, 0x84, 0x14, 0xe2, 0xc1, 0x68, 0x4b, 0x67, 0x1b, 0x9b, 0x99, + 0x99, 0xf9, 0xcc, 0xaa, 0x55, 0xab, 0x62, 0xa7, 0x4f, 0x9f, 0xce, 0x19, + 0x2a, 0x66, 0xb3, 0x19, 0x1f, 0x7e, 0xf8, 0xa1, 0x79, 0xdd, 0xba, 0x75, + 0x85, 0xd7, 0xae, 0x5d, 0xfb, 0x00, 0xc0, 0x29, 0xb8, 0x4e, 0x11, 0x23, + 0x77, 0x88, 0x6c, 0xd4, 0x39, 0x7b, 0xbf, 0x3d, 0x0d, 0x80, 0xb6, 0x5a, + 0xad, 0x15, 0x5a, 0xad, 0x76, 0x83, 0x56, 0xab, 0x0d, 0x01, 0x10, 0x73, + 0xf9, 0xf2, 0xe5, 0x19, 0x83, 0x07, 0x0f, 0xbe, 0xe7, 0xe2, 0xc5, 0x8b, + 0x52, 0x96, 0x46, 0x73, 0xe6, 0xcc, 0x09, 0xfc, 0xfa, 0xeb, 0xaf, 0xc7, + 0x5c, 0xb9, 0x72, 0x85, 0x2c, 0x36, 0xc4, 0xf2, 0x91, 0x3c, 0x3a, 0x3a, + 0x7a, 0xf2, 0xb2, 0x65, 0xcb, 0x82, 0x25, 0x12, 0x09, 0x2e, 0x5d, 0xba, + 0x84, 0x5d, 0xbb, 0x76, 0x49, 0xd2, 0xd2, 0xd2, 0x46, 0x00, 0xb8, 0x8d, + 0xe9, 0x47, 0xa4, 0xd5, 0x6a, 0x43, 0xc8, 0x3a, 0x07, 0x11, 0x11, 0x11, + 0xb0, 0x5a, 0xad, 0x69, 0xe9, 0xe9, 0xe9, 0x7f, 0x32, 0x18, 0x0c, 0x7a, + 0xe6, 0xb6, 0x3e, 0x83, 0x00, 0xfe, 0xac, 0x87, 0xc4, 0x52, 0x59, 0x59, + 0xb9, 0x13, 0x6d, 0x75, 0x0b, 0xd8, 0x2c, 0x05, 0x23, 0xda, 0xaf, 0xc8, + 0x15, 0x31, 0x86, 0xa3, 0xb8, 0xa1, 0xa1, 0xa1, 0xe2, 0xea, 0xd5, 0xab, + 0xa9, 0xec, 0x51, 0x40, 0x54, 0x54, 0x14, 0x24, 0x12, 0x49, 0x28, 0xda, + 0x8f, 0x1b, 0x44, 0x84, 0xb1, 0x64, 0x07, 0x60, 0xd4, 0xeb, 0xf5, 0x3c, + 0x03, 0x60, 0xd7, 0xae, 0x5d, 0x2d, 0x5a, 0xad, 0xf6, 0x17, 0xb4, 0xa5, + 0x14, 0x36, 0x32, 0x63, 0x35, 0x07, 0x06, 0x06, 0xee, 0xfe, 0xf5, 0xd7, + 0x5f, 0xa7, 0x25, 0x26, 0x26, 0x8a, 0xd8, 0x71, 0x84, 0x84, 0x84, 0xb0, + 0xd7, 0xe3, 0x4a, 0xe0, 0xbc, 0xfc, 0x33, 0xaf, 0x56, 0x42, 0x68, 0x68, + 0x68, 0xd6, 0xa3, 0x8f, 0x3e, 0x1a, 0xc2, 0x7a, 0x5b, 0x9a, 0x9a, 0x9a, + 0xb0, 0x6f, 0xdf, 0x3e, 0x2d, 0xda, 0x32, 0x0b, 0x48, 0xd7, 0xbf, 0x2b, + 0x03, 0x58, 0x44, 0xac, 0xa7, 0x21, 0x53, 0xa7, 0x4e, 0x0d, 0xef, 0xd5, + 0xab, 0x17, 0x6b, 0x5c, 0xe1, 0xd5, 0x57, 0x5f, 0x35, 0x35, 0x35, 0x35, + 0xfd, 0x64, 0xb3, 0xd9, 0x76, 0x02, 0xd0, 0xd9, 0xed, 0x76, 0x79, 0x45, + 0x45, 0xc5, 0x89, 0x07, 0x1f, 0x7c, 0xf0, 0x2f, 0xc3, 0x86, 0x0d, 0x03, + 0x5b, 0xb2, 0x77, 0xc1, 0x82, 0x05, 0xaa, 0xef, 0xbf, 0xff, 0x7e, 0x12, + 0x63, 0x7c, 0xc8, 0x09, 0xa3, 0x99, 0xbd, 0xba, 0x99, 0x0d, 0x7e, 0xad, + 0xab, 0xa8, 0xa8, 0x58, 0xb5, 0x76, 0xed, 0xda, 0x3f, 0xe6, 0xe6, 0xe6, + 0x0e, 0x5a, 0xbe, 0x7c, 0xb9, 0x7a, 0xf8, 0xf0, 0xe1, 0x50, 0x2a, 0x95, + 0xb0, 0xd9, 0x6c, 0xa8, 0xab, 0xab, 0xc3, 0xe7, 0x9f, 0x7f, 0x6e, 0x7d, + 0xff, 0xfd, 0xf7, 0x8d, 0xb3, 0x66, 0xcd, 0x92, 0xcb, 0xe5, 0x72, 0x8e, + 0x16, 0xd5, 0xd5, 0xd5, 0x34, 0x43, 0x47, 0xdb, 0x4d, 0x32, 0xb2, 0xfd, + 0xe0, 0x07, 0x3f, 0x78, 0x71, 0x04, 0xc0, 0xba, 0xea, 0x15, 0xe0, 0xe7, + 0xef, 0xb2, 0x91, 0xeb, 0xec, 0x63, 0xf1, 0x62, 0x41, 0x73, 0xee, 0x4a, + 0x00, 0xb1, 0x51, 0x51, 0x51, 0xfd, 0x47, 0x8d, 0x1a, 0x05, 0x00, 0xf8, + 0xe5, 0x97, 0x5f, 0xe8, 0xea, 0xea, 0xea, 0x7c, 0xc2, 0x9d, 0x6d, 0xf6, + 0xc0, 0xfd, 0x4f, 0x9e, 0x9f, 0xd7, 0x5f, 0xbe, 0x7c, 0xd9, 0x42, 0x28, + 0x07, 0x44, 0x46, 0x46, 0x8a, 0x19, 0xc1, 0x2c, 0x27, 0x84, 0xbf, 0x5c, + 0xa3, 0xd1, 0x84, 0x04, 0x07, 0x07, 0x73, 0x8d, 0xd4, 0xd6, 0xd6, 0xc2, + 0x6a, 0xb5, 0xb2, 0x81, 0x6a, 0xd6, 0xae, 0xba, 0xf7, 0xbd, 0x04, 0xb2, + 0x20, 0x4c, 0x14, 0x80, 0xf1, 0x63, 0xc6, 0x8c, 0x59, 0xfc, 0xe9, 0xa7, + 0x9f, 0x46, 0xf4, 0xeb, 0xd7, 0x8f, 0x7b, 0xa9, 0xb8, 0xb8, 0x18, 0x8b, + 0x17, 0x2f, 0xd6, 0x1f, 0x3e, 0x7c, 0xf8, 0x70, 0x5d, 0x5d, 0xdd, 0x46, + 0xb4, 0x55, 0x2d, 0xac, 0x77, 0xe6, 0xfa, 0x17, 0x50, 0x3a, 0xbd, 0x00, + 0x4c, 0x65, 0xfe, 0x2f, 0x66, 0xc6, 0x99, 0xcb, 0xec, 0xfa, 0xf4, 0x84, + 0x7b, 0xf6, 0xdf, 0x01, 0x01, 0x01, 0xfd, 0x2f, 0x5e, 0xbc, 0x98, 0x36, + 0x6c, 0xd8, 0x30, 0x00, 0x6d, 0x79, 0xdc, 0x32, 0x99, 0x2c, 0x86, 0xa0, + 0x21, 0x9b, 0xfd, 0x20, 0x02, 0x20, 0x96, 0xc9, 0x64, 0x76, 0xf6, 0xf8, + 0x25, 0x2d, 0x2d, 0x0d, 0x97, 0x2f, 0x5f, 0x96, 0x5a, 0xad, 0xd6, 0x28, + 0x12, 0x11, 0xa9, 0x54, 0x8a, 0xb0, 0xb0, 0xf6, 0x22, 0x8a, 0x29, 0x29, + 0x29, 0x28, 0x28, 0x28, 0x08, 0xb4, 0x58, 0x2c, 0xc9, 0x4b, 0x97, 0x2e, + 0xad, 0xdb, 0xbc, 0x79, 0x73, 0x22, 0xa3, 0x6c, 0x85, 0xc6, 0x20, 0x22, + 0x8c, 0x51, 0x8a, 0x98, 0x73, 0xb6, 0xd8, 0x8f, 0x81, 0x30, 0xf2, 0xf4, + 0xcd, 0xcd, 0xcd, 0xd5, 0x75, 0x75, 0x75, 0xa9, 0x6c, 0x03, 0x4a, 0xa5, + 0x12, 0x14, 0x45, 0x49, 0x05, 0x76, 0xe7, 0x6c, 0xf0, 0x65, 0x63, 0x51, + 0x51, 0x91, 0x99, 0x19, 0x1f, 0xec, 0x76, 0x3b, 0xea, 0xeb, 0xeb, 0x2d, + 0xe0, 0xe7, 0xb8, 0x4b, 0x01, 0x04, 0xb6, 0xb4, 0xb4, 0x94, 0x17, 0x17, + 0x17, 0x5b, 0x98, 0x39, 0x03, 0x00, 0x04, 0x07, 0x07, 0x53, 0xcc, 0xae, + 0xde, 0x55, 0x7e, 0x3b, 0x99, 0xf9, 0x12, 0x1a, 0x1b, 0x1b, 0x3b, 0x92, + 0x4d, 0xfb, 0x03, 0x80, 0xdc, 0xdc, 0x5c, 0xd4, 0xd4, 0xd4, 0x9c, 0x46, + 0x5b, 0xca, 0x9e, 0xc1, 0x43, 0xfe, 0xe7, 0x3c, 0x47, 0x4a, 0xa5, 0xb2, + 0xdf, 0xa4, 0x49, 0x93, 0x54, 0x84, 0x71, 0x89, 0xc3, 0x87, 0x0f, 0xb7, + 0xda, 0x6c, 0xb6, 0x1c, 0xb4, 0x5d, 0xe9, 0xdc, 0xc8, 0xac, 0x65, 0x5b, + 0x50, 0x50, 0xd0, 0xc1, 0xf3, 0xe7, 0xcf, 0x4f, 0x66, 0x0d, 0x80, 0xf4, + 0xf4, 0x74, 0xc8, 0xe5, 0xf2, 0x04, 0xf0, 0x0b, 0x15, 0x91, 0xde, 0x33, + 0x96, 0x4e, 0xad, 0x6d, 0xb6, 0x4a, 0xd3, 0xfb, 0xfb, 0xf7, 0xef, 0x1f, + 0x74, 0xe1, 0xc2, 0x85, 0xf1, 0x1a, 0x8d, 0x26, 0x59, 0xa1, 0x50, 0xc8, + 0x2c, 0x16, 0x0b, 0x6d, 0xb1, 0x58, 0x5a, 0x4a, 0x4b, 0x4b, 0xaf, 0x1a, + 0x8d, 0x46, 0x45, 0x46, 0x46, 0xc6, 0x1d, 0x2c, 0x2e, 0x5a, 0xad, 0x16, + 0x16, 0x8b, 0xa5, 0x85, 0xe1, 0xd5, 0x9e, 0x5e, 0x5f, 0x7e, 0xf0, 0x83, + 0x1f, 0xbc, 0x34, 0x00, 0x78, 0x97, 0xf4, 0xa0, 0xed, 0x26, 0x38, 0x25, + 0xb1, 0x23, 0xa8, 0x47, 0x5b, 0x5e, 0x38, 0x29, 0x44, 0x69, 0x0f, 0x84, + 0x15, 0x1b, 0xe0, 0x16, 0x24, 0x16, 0x8b, 0x6f, 0x9f, 0x33, 0x67, 0x8e, + 0x9a, 0xcc, 0xfd, 0xaf, 0xaa, 0xaa, 0xfa, 0x05, 0xed, 0xb9, 0xff, 0x56, + 0x0f, 0x8e, 0x18, 0xc8, 0x28, 0xe5, 0x1b, 0x25, 0x25, 0x25, 0x66, 0xf2, + 0xcb, 0x7e, 0xfd, 0xfa, 0xc9, 0xd0, 0x56, 0x8f, 0x3f, 0x88, 0x11, 0xa8, + 0x52, 0x00, 0x41, 0x2a, 0x95, 0x2a, 0x86, 0x0c, 0x26, 0xab, 0xae, 0xae, + 0x86, 0xd9, 0x6c, 0xae, 0x43, 0x7b, 0x14, 0x77, 0xb7, 0xef, 0x50, 0x04, + 0xd2, 0x21, 0xc3, 0xd0, 0x76, 0x9b, 0xe1, 0x1b, 0xeb, 0xd7, 0xaf, 0x07, + 0xa9, 0xfc, 0x77, 0xee, 0xdc, 0x69, 0x7f, 0xf5, 0xd5, 0x57, 0xeb, 0x0a, + 0x0a, 0x0a, 0xbe, 0x05, 0x70, 0x88, 0x51, 0x12, 0x46, 0x06, 0x4f, 0x76, + 0xae, 0xec, 0x02, 0xc2, 0x95, 0xfd, 0x2e, 0x30, 0x3a, 0x3a, 0x7a, 0xd1, + 0x0b, 0x2f, 0xbc, 0x30, 0x8f, 0x35, 0x1e, 0xbb, 0x65, 0xb0, 0x00, 0x00, + 0x10, 0xb9, 0x49, 0x44, 0x41, 0x54, 0x7c, 0x5a, 0x5a, 0x5a, 0xf0, 0xfe, + 0xfb, 0xef, 0x9f, 0x2e, 0x2a, 0x2a, 0x5a, 0x82, 0xb6, 0xb3, 0x6b, 0xd6, + 0xb0, 0x6b, 0x6d, 0x6e, 0x6e, 0x6e, 0xd4, 0xeb, 0xf5, 0x5c, 0xff, 0x01, + 0x01, 0x01, 0xec, 0xc5, 0x3d, 0x42, 0x0a, 0xd4, 0xea, 0xa8, 0xa8, 0xd8, + 0x23, 0x1d, 0x77, 0xc0, 0x1a, 0x04, 0x4c, 0xce, 0xb8, 0x58, 0x60, 0xf7, + 0xcc, 0x15, 0x7a, 0x92, 0x48, 0x24, 0x09, 0x2a, 0x95, 0xea, 0x7e, 0x9a, + 0xa6, 0x03, 0x68, 0x9a, 0x96, 0x50, 0x14, 0x65, 0x37, 0x99, 0x4c, 0x3f, + 0x1b, 0x8d, 0xc6, 0x02, 0x62, 0x37, 0x2f, 0x06, 0x20, 0x11, 0x89, 0x44, + 0xbc, 0xe8, 0xfd, 0xe6, 0xe6, 0x66, 0xd0, 0x34, 0xed, 0x78, 0xa1, 0x14, + 0x4b, 0x2f, 0x0b, 0x80, 0x1b, 0x57, 0xaf, 0x5e, 0x35, 0x31, 0xde, 0x22, + 0x16, 0x27, 0x32, 0x2b, 0x84, 0x3c, 0x46, 0xa2, 0x1d, 0xe3, 0x45, 0xb4, + 0x5a, 0x2d, 0x8d, 0xb6, 0x23, 0x18, 0x77, 0x73, 0xcd, 0xc6, 0x4c, 0x0c, + 0x1e, 0x37, 0x6e, 0x9c, 0x86, 0x75, 0xd5, 0x03, 0x40, 0x76, 0x76, 0xb6, + 0xa1, 0xb6, 0xb6, 0xf6, 0x24, 0xda, 0x8f, 0x42, 0xdc, 0x1d, 0x7f, 0xf1, + 0x8c, 0xa3, 0xe0, 0xe0, 0xe0, 0xb0, 0x90, 0x90, 0x10, 0x0e, 0x2f, 0xab, + 0xd5, 0x0a, 0xa3, 0xd1, 0x68, 0x67, 0xf0, 0x62, 0x8d, 0x75, 0x00, 0x30, + 0x69, 0xb5, 0x5a, 0x5e, 0x1a, 0xac, 0x44, 0x22, 0x01, 0x93, 0xe3, 0x2f, + 0x41, 0xc7, 0x23, 0x33, 0x21, 0x4f, 0xa0, 0x1d, 0x40, 0x61, 0x55, 0x55, + 0x55, 0x59, 0x55, 0x55, 0x15, 0x4d, 0xac, 0x43, 0x45, 0xdb, 0xf4, 0x87, + 0xdf, 0x97, 0x9c, 0x9c, 0xcc, 0xf1, 0xca, 0xd5, 0xab, 0x57, 0x61, 0x34, + 0x1a, 0x4b, 0xc1, 0xcf, 0xc2, 0xf0, 0x1b, 0x00, 0x7e, 0xf0, 0xc3, 0x2d, + 0x6a, 0x00, 0x90, 0xb7, 0xa4, 0x4d, 0x4c, 0x4c, 0x4c, 0x7c, 0x6f, 0xc0, + 0x80, 0x01, 0xcd, 0x6d, 0x69, 0xc7, 0x14, 0x5d, 0x50, 0x50, 0x40, 0x95, + 0x96, 0x96, 0x3e, 0x84, 0xb6, 0x4a, 0x75, 0x6c, 0x81, 0x15, 0x6f, 0x94, + 0x9d, 0x3a, 0x39, 0x39, 0x79, 0xc2, 0xbd, 0xf7, 0xde, 0x2b, 0x07, 0x80, + 0xf2, 0xf2, 0x72, 0x9c, 0x38, 0x71, 0xa2, 0x1e, 0xc0, 0x69, 0xb8, 0xcf, + 0xfd, 0x17, 0x32, 0x00, 0xcc, 0x00, 0xaa, 0x6f, 0xdc, 0xb8, 0x61, 0xa8, + 0xae, 0xae, 0x0e, 0x67, 0x95, 0xfb, 0xd0, 0xa1, 0x43, 0x15, 0x61, 0x61, + 0x61, 0xe9, 0xf5, 0xf5, 0xf5, 0xc7, 0x88, 0x9d, 0x6b, 0x94, 0x4c, 0x26, + 0x8b, 0x62, 0x77, 0x3f, 0x00, 0x70, 0xfa, 0xf4, 0x69, 0x5b, 0x55, 0x55, + 0xd5, 0x05, 0xc2, 0xa3, 0xd1, 0x53, 0x02, 0x8a, 0x4c, 0x09, 0x8b, 0x4f, + 0x4b, 0x4b, 0x7b, 0x61, 0xc3, 0x86, 0x0d, 0x20, 0x6f, 0x17, 0x5c, 0xb7, + 0x6e, 0x9d, 0xe5, 0xc5, 0x17, 0x5f, 0x34, 0xb6, 0xb6, 0xb6, 0x7e, 0xc5, + 0x18, 0x5d, 0xec, 0x05, 0x30, 0x6a, 0xe2, 0xf7, 0x6c, 0x29, 0xdc, 0x56, + 0x00, 0x16, 0x87, 0x3a, 0xeb, 0x22, 0x00, 0xb2, 0x86, 0x86, 0x86, 0xda, + 0x84, 0x84, 0x04, 0xf1, 0xdc, 0xb9, 0x73, 0x45, 0x00, 0x50, 0x53, 0x53, + 0x83, 0x0f, 0x3f, 0xfc, 0x30, 0x96, 0xf1, 0x0c, 0x48, 0x19, 0x1a, 0xaa, + 0x00, 0x04, 0x04, 0x06, 0x06, 0x06, 0x93, 0xb7, 0x29, 0xea, 0x74, 0x3a, + 0xd0, 0x34, 0xdd, 0xea, 0xe0, 0x36, 0x67, 0x95, 0x7f, 0xab, 0x48, 0x24, + 0x32, 0xd7, 0xd6, 0xd6, 0x62, 0xff, 0xfe, 0xfd, 0x4e, 0x07, 0x1a, 0x14, + 0x14, 0x84, 0x11, 0x23, 0x46, 0xf0, 0xfe, 0x76, 0xec, 0xd8, 0x31, 0x18, + 0x0c, 0x06, 0xb4, 0xb4, 0xb4, 0xb0, 0xc1, 0x66, 0x56, 0x67, 0x34, 0x52, + 0x2a, 0x95, 0x0f, 0xbc, 0xfb, 0xee, 0xbb, 0x7f, 0x60, 0x8d, 0x0b, 0x9b, + 0xcd, 0x86, 0xc5, 0x8b, 0x17, 0xdf, 0x5d, 0x5c, 0x5c, 0xfc, 0x24, 0x63, + 0x10, 0x59, 0x19, 0x9a, 0x04, 0xab, 0x54, 0xaa, 0x5e, 0xec, 0x19, 0x3d, + 0x00, 0x94, 0x96, 0x96, 0xc2, 0x6a, 0xb5, 0xd6, 0x38, 0x18, 0x78, 0x64, + 0x91, 0xa4, 0xd2, 0x92, 0x92, 0x92, 0xe6, 0xba, 0xba, 0xba, 0xb0, 0xf0, + 0xf0, 0x70, 0x88, 0x44, 0x22, 0xa4, 0xa4, 0xa4, 0xc8, 0xcf, 0x9e, 0x3d, + 0x9b, 0xca, 0xb4, 0xcd, 0xae, 0x99, 0x90, 0x90, 0x90, 0x90, 0xa4, 0xd4, + 0xd4, 0x54, 0x29, 0x69, 0x5c, 0x68, 0xb5, 0x5a, 0x33, 0x63, 0x44, 0x59, + 0x5d, 0x78, 0x62, 0xb8, 0xca, 0x97, 0xe1, 0xe1, 0xe1, 0x43, 0xa7, 0x4f, + 0x9f, 0xae, 0x22, 0x95, 0x75, 0x6e, 0x6e, 0xae, 0x11, 0x6d, 0xf1, 0x1c, + 0x2d, 0x1e, 0xee, 0xfe, 0xc9, 0x35, 0x40, 0x9b, 0x4c, 0x26, 0x03, 0x69, + 0xb4, 0x49, 0x24, 0x12, 0x28, 0x14, 0x0a, 0x29, 0xda, 0x8e, 0x95, 0x94, + 0x0c, 0x5f, 0xcb, 0x01, 0x04, 0x46, 0x44, 0x44, 0x44, 0x91, 0x1e, 0x30, + 0x9a, 0xa6, 0xa1, 0xd7, 0xeb, 0x29, 0x74, 0x74, 0xcf, 0x93, 0x77, 0x26, + 0x04, 0x25, 0x24, 0x24, 0xfc, 0x31, 0x30, 0x30, 0x30, 0xc9, 0x6e, 0xb7, + 0xcb, 0x01, 0x88, 0x5b, 0x5b, 0x5b, 0xc5, 0x65, 0x65, 0x65, 0x9f, 0x32, + 0xde, 0x05, 0xb6, 0xb6, 0x82, 0x2d, 0x32, 0x32, 0x32, 0x3e, 0x3d, 0x3d, + 0x9d, 0x6b, 0xe4, 0xc8, 0x91, 0x23, 0xe6, 0x92, 0x92, 0x92, 0x33, 0x68, + 0x0f, 0xec, 0xf5, 0x7b, 0x00, 0xfc, 0xe0, 0x87, 0x5b, 0xdc, 0x00, 0x60, + 0x3d, 0x00, 0xc9, 0x6f, 0xbc, 0xf1, 0x86, 0x6a, 0xde, 0xbc, 0x79, 0x9c, + 0xc0, 0x5a, 0xb0, 0x60, 0x41, 0xed, 0xc6, 0x8d, 0x1b, 0xa3, 0x01, 0x5c, + 0x65, 0xde, 0x33, 0x79, 0xe1, 0xea, 0x56, 0x01, 0x48, 0x4b, 0x49, 0x49, + 0x89, 0x49, 0x4b, 0x4b, 0x03, 0xd0, 0x96, 0xfb, 0x5f, 0x5a, 0x5a, 0x7a, + 0x08, 0xed, 0xc1, 0x7f, 0x66, 0x0f, 0x76, 0x3f, 0xa4, 0x01, 0x60, 0x04, + 0xd0, 0xdc, 0xd0, 0xd0, 0x70, 0xee, 0xec, 0xd9, 0xb3, 0x49, 0x59, 0x59, + 0x59, 0x00, 0x80, 0x21, 0x43, 0x86, 0x20, 0x28, 0x28, 0x68, 0x78, 0x7d, + 0x7d, 0xfd, 0xaf, 0x8c, 0x3b, 0x57, 0x2c, 0x16, 0x8b, 0xc7, 0x4f, 0x9e, + 0x3c, 0x59, 0x49, 0xe6, 0x8f, 0xe7, 0xe4, 0xe4, 0xe8, 0x5b, 0x5a, 0x5a, + 0xce, 0x91, 0x7d, 0xf7, 0xc0, 0x1c, 0xf0, 0x8a, 0xe8, 0xc8, 0xe5, 0xf2, + 0xa9, 0xf3, 0xe7, 0xcf, 0xef, 0xc5, 0x96, 0x43, 0x06, 0x80, 0x57, 0x5e, + 0x79, 0xc5, 0xbe, 0x76, 0xed, 0x5a, 0x5d, 0x6b, 0x6b, 0xeb, 0x65, 0xb4, + 0xdd, 0x86, 0x17, 0x81, 0xf6, 0xe3, 0x11, 0x13, 0x3b, 0x6e, 0x00, 0xe7, + 0xd1, 0x16, 0x0f, 0xe0, 0x18, 0xc8, 0xc8, 0xd1, 0xcf, 0x6c, 0x36, 0xdf, + 0xc8, 0xcb, 0xcb, 0xd3, 0xcf, 0x9d, 0x3b, 0x57, 0x03, 0xb4, 0x9d, 0x5d, + 0x07, 0x04, 0x04, 0x44, 0x51, 0x14, 0xf5, 0x30, 0x4d, 0xd3, 0x3b, 0x99, + 0xb6, 0x02, 0x00, 0x4c, 0xea, 0xdd, 0xbb, 0x77, 0x3c, 0x99, 0x6e, 0x78, + 0xe6, 0xcc, 0x19, 0x18, 0x0c, 0x86, 0x6b, 0xe0, 0x1f, 0xf9, 0xb0, 0x9e, + 0x17, 0x43, 0x43, 0x43, 0xc3, 0xe7, 0x8b, 0x16, 0x2d, 0xb2, 0x52, 0x14, + 0x25, 0xa5, 0x69, 0x9a, 0x2b, 0xf5, 0x4a, 0xd3, 0xb4, 0x98, 0x29, 0x9b, + 0xac, 0x34, 0x9b, 0xcd, 0xe9, 0x07, 0x0e, 0x1c, 0x50, 0xb3, 0x69, 0x74, + 0xa7, 0x4e, 0x9d, 0xc2, 0x5d, 0x77, 0xdd, 0xd5, 0xa8, 0x50, 0x28, 0xf2, + 0xec, 0x76, 0x7b, 0x09, 0xda, 0x8a, 0xde, 0x98, 0x9d, 0x79, 0xa3, 0xb4, + 0x5a, 0x6d, 0x71, 0x4d, 0x4d, 0x4d, 0xf3, 0xc2, 0x85, 0x0b, 0xb9, 0xe0, + 0x8d, 0xcf, 0x3e, 0xfb, 0x4c, 0x5d, 0x59, 0x59, 0x39, 0xdb, 0x6c, 0x36, + 0xff, 0xc4, 0xfc, 0x56, 0x29, 0x16, 0x8b, 0xa7, 0x0e, 0x19, 0x32, 0x24, + 0x9c, 0xac, 0x96, 0x98, 0x9b, 0x9b, 0x6b, 0x29, 0x29, 0x29, 0x39, 0xed, + 0x30, 0xbf, 0x64, 0x91, 0x27, 0x7d, 0x6d, 0x6d, 0x6d, 0xfe, 0xd1, 0xa3, + 0x47, 0x7b, 0xdd, 0x73, 0xcf, 0x3d, 0x22, 0x00, 0x58, 0xba, 0x74, 0x69, + 0x60, 0x4e, 0x4e, 0xce, 0xc3, 0x5a, 0xad, 0xb6, 0x92, 0x31, 0x2c, 0xc4, + 0x00, 0xfa, 0x24, 0x24, 0x24, 0x0c, 0x1f, 0x35, 0x6a, 0x14, 0xb7, 0xd3, + 0x2e, 0x28, 0x28, 0x80, 0x4e, 0xa7, 0xbb, 0xc6, 0x18, 0x5f, 0xce, 0xb2, + 0x56, 0x48, 0xef, 0x57, 0x60, 0x78, 0x78, 0x78, 0x06, 0x7b, 0xbc, 0x02, + 0x00, 0x57, 0xae, 0x5c, 0x41, 0x4b, 0x4b, 0x0b, 0xeb, 0xa6, 0x6f, 0xf5, + 0x70, 0xf7, 0xcf, 0xf3, 0x80, 0xd5, 0xd5, 0xd5, 0x95, 0x5e, 0xba, 0x74, + 0xc9, 0x34, 0x7d, 0xfa, 0x74, 0xee, 0x68, 0x62, 0xfc, 0xf8, 0xf1, 0x01, + 0xe7, 0xce, 0x9d, 0x5b, 0x60, 0x32, 0x99, 0xd6, 0x32, 0x86, 0x80, 0x0c, + 0x40, 0xaa, 0x5a, 0xad, 0x1e, 0x78, 0xdb, 0x6d, 0xb7, 0x71, 0x8d, 0x14, + 0x17, 0x17, 0xc3, 0x66, 0xb3, 0xd5, 0x12, 0x06, 0x92, 0x8d, 0x68, 0x9b, + 0x95, 0x17, 0x62, 0x9a, 0xa6, 0xa7, 0x7e, 0xf5, 0xd5, 0x57, 0x31, 0x6c, + 0xdc, 0xc2, 0xb7, 0xdf, 0x7e, 0x4b, 0xaf, 0x5e, 0xbd, 0xfa, 0x71, 0x9d, + 0x4e, 0xb7, 0x81, 0x79, 0x37, 0x40, 0x2e, 0x97, 0x8f, 0x99, 0x38, 0x71, + 0x62, 0x30, 0x5b, 0x8e, 0xd8, 0x6e, 0xb7, 0x63, 0xe7, 0xce, 0x9d, 0x3a, + 0x9b, 0xcd, 0x76, 0x0a, 0xce, 0x6b, 0x55, 0xf8, 0xc1, 0x0f, 0x7e, 0xb8, + 0x85, 0x0c, 0x00, 0xd2, 0x7d, 0xdc, 0xa1, 0xc6, 0x2d, 0x93, 0xbf, 0xcd, + 0xee, 0xa8, 0x3d, 0xc9, 0xeb, 0x25, 0x8f, 0x14, 0xd4, 0xc1, 0xc1, 0xc1, + 0x63, 0xd8, 0xdc, 0x7f, 0xbb, 0xdd, 0x8e, 0xcd, 0x9b, 0x37, 0x6b, 0x5b, + 0x5a, 0x5a, 0x8e, 0x80, 0x7f, 0xf3, 0x9f, 0x27, 0x3b, 0x04, 0xb2, 0x0a, + 0x9a, 0xbe, 0xba, 0xba, 0xfa, 0xe7, 0x8f, 0x3e, 0xfa, 0x68, 0x6c, 0x56, + 0x56, 0x96, 0x06, 0x68, 0x2b, 0xf1, 0xbb, 0x7e, 0xfd, 0x7a, 0xd5, 0xdc, + 0xb9, 0x73, 0x97, 0xca, 0xe5, 0xf2, 0x53, 0x36, 0x9b, 0x2d, 0x5a, 0x2a, + 0x95, 0xc6, 0xff, 0xe9, 0x4f, 0x7f, 0x92, 0xb2, 0x42, 0xec, 0xfa, 0xf5, + 0xeb, 0x38, 0x76, 0xec, 0x58, 0x2d, 0x80, 0x7c, 0x42, 0xb9, 0x7a, 0x23, + 0x7c, 0x85, 0xde, 0x23, 0xd3, 0x04, 0x5d, 0x15, 0x30, 0xe2, 0x8c, 0xa2, + 0xde, 0xbd, 0x7b, 0x4f, 0x99, 0x3f, 0x7f, 0xbe, 0x82, 0xdc, 0x15, 0xde, + 0x7b, 0xef, 0xbd, 0x54, 0x68, 0x68, 0x68, 0x30, 0x80, 0x11, 0x4c, 0xc5, + 0x37, 0x38, 0x2a, 0x76, 0x91, 0x48, 0x64, 0x7f, 0xed, 0xb5, 0xd7, 0x8c, + 0x75, 0x75, 0x75, 0x63, 0x19, 0x05, 0xed, 0xe8, 0x3d, 0x61, 0x03, 0x36, + 0x2f, 0x1d, 0x38, 0x70, 0xc0, 0xd0, 0xd2, 0xd2, 0xa2, 0x09, 0x0c, 0x0c, + 0x04, 0x45, 0x51, 0x38, 0x72, 0xe4, 0x88, 0x74, 0xce, 0x9c, 0x39, 0x63, + 0xaf, 0x5c, 0xb9, 0xd2, 0xab, 0xb1, 0xb1, 0xf1, 0x86, 0x42, 0xa1, 0x88, + 0xd3, 0xe9, 0x74, 0xa9, 0x5b, 0xb7, 0x6e, 0x15, 0x93, 0x41, 0x92, 0x9f, + 0x7d, 0xf6, 0x99, 0xae, 0xb4, 0xb4, 0xf4, 0x27, 0xf0, 0x63, 0x33, 0xd8, + 0xa8, 0x6e, 0x83, 0x4e, 0xa7, 0x3b, 0xa3, 0xd3, 0xe9, 0x0a, 0x99, 0x9d, + 0xa6, 0x8c, 0x70, 0x25, 0xb3, 0xb1, 0x0d, 0x31, 0x89, 0x89, 0x89, 0x8f, + 0x1a, 0x8d, 0x46, 0xae, 0x1c, 0xb0, 0xd1, 0x68, 0x84, 0x4a, 0xa5, 0xba, + 0x56, 0x56, 0x56, 0xf6, 0x25, 0x63, 0x48, 0x36, 0x11, 0x6e, 0x6a, 0x47, + 0x3a, 0xdb, 0x01, 0x5c, 0xd8, 0xb9, 0x73, 0xa7, 0x76, 0xf1, 0xe2, 0xc5, + 0x4a, 0xe2, 0xd8, 0x48, 0x31, 0x73, 0xe6, 0xcc, 0x99, 0x57, 0xaf, 0x5e, + 0xcd, 0x68, 0x68, 0x68, 0xb8, 0x21, 0x95, 0x4a, 0xfb, 0x07, 0x05, 0x05, + 0xc5, 0xbe, 0xff, 0xfe, 0xfb, 0x32, 0xb6, 0x14, 0x6d, 0x6b, 0x6b, 0x2b, + 0x3e, 0xfe, 0xf8, 0xe3, 0x7a, 0xa3, 0xd1, 0x78, 0x80, 0x9c, 0x5f, 0x82, + 0x77, 0x8c, 0x8c, 0x01, 0xf0, 0xe3, 0xda, 0xb5, 0x6b, 0x47, 0x4f, 0x9f, + 0x3e, 0x3d, 0x54, 0x24, 0x12, 0xe1, 0xf6, 0xdb, 0x6f, 0xa7, 0x3e, 0xfc, + 0xf0, 0x43, 0xcd, 0x1b, 0x6f, 0xbc, 0xb1, 0xb8, 0xa2, 0xa2, 0xe2, 0x02, + 0x45, 0x51, 0xaa, 0xc6, 0xc6, 0xc6, 0x51, 0x1f, 0x7d, 0xf4, 0x11, 0xcd, + 0x2a, 0x37, 0x00, 0x58, 0xb3, 0x66, 0x8d, 0xbe, 0xac, 0xac, 0x6c, 0x2f, + 0xc3, 0xbb, 0xae, 0xee, 0xac, 0xe0, 0x2a, 0xe5, 0x85, 0x86, 0x86, 0xaa, + 0xc9, 0x23, 0xa8, 0xcb, 0x97, 0x2f, 0xd3, 0x95, 0x95, 0x95, 0x17, 0x08, + 0xfc, 0x3c, 0xe5, 0x7f, 0x32, 0x16, 0xa2, 0x60, 0xe7, 0xce, 0x9d, 0xda, + 0x45, 0x8b, 0x16, 0x45, 0xb2, 0xc6, 0xed, 0xea, 0xd5, 0xab, 0x25, 0x75, + 0x75, 0x75, 0x09, 0x47, 0x8f, 0x1e, 0x7d, 0xb6, 0xae, 0xae, 0xae, 0x54, + 0xa1, 0x50, 0xa8, 0xea, 0xea, 0xea, 0x86, 0xef, 0xd8, 0xb1, 0x43, 0xc4, + 0xde, 0xa8, 0xc8, 0x1c, 0x3f, 0x98, 0x4a, 0x4b, 0x4b, 0x73, 0x05, 0xe8, + 0x63, 0x23, 0x8f, 0x01, 0x24, 0x12, 0xc9, 0x49, 0x9d, 0x4e, 0x77, 0xcf, + 0x98, 0x31, 0x63, 0x00, 0x00, 0xe9, 0xe9, 0xe9, 0xd4, 0xc1, 0x83, 0x07, + 0xfb, 0x5f, 0xbc, 0x78, 0xf1, 0xd9, 0x86, 0x86, 0x86, 0x6b, 0x01, 0x01, + 0x01, 0x83, 0xe2, 0xe2, 0xe2, 0x22, 0xdf, 0x78, 0xe3, 0x0d, 0x8e, 0xfe, + 0x3f, 0xfd, 0xf4, 0x13, 0x7d, 0xed, 0xda, 0xb5, 0xf3, 0x68, 0x4f, 0xed, + 0xf5, 0x74, 0x7d, 0xf9, 0xc1, 0x0f, 0x7e, 0xb8, 0x89, 0x06, 0x80, 0xab, + 0xb4, 0x38, 0x1a, 0xde, 0xe5, 0xc2, 0xb3, 0x47, 0x0a, 0x72, 0x00, 0xaa, + 0xb8, 0xb8, 0xb8, 0x91, 0x53, 0xa7, 0x4e, 0x15, 0xb1, 0x3b, 0xc1, 0xb2, + 0xb2, 0xb2, 0x22, 0xc6, 0xbd, 0x6d, 0xf0, 0x66, 0x07, 0xce, 0x94, 0x42, + 0x65, 0xab, 0xe9, 0xe9, 0x01, 0x9c, 0x3e, 0x71, 0xe2, 0x44, 0xd1, 0xb1, + 0x63, 0xc7, 0x06, 0x8d, 0x1c, 0x39, 0x92, 0x02, 0x80, 0x69, 0xd3, 0xa6, + 0x89, 0x0a, 0x0a, 0x0a, 0x14, 0xe7, 0xcf, 0x9f, 0xbf, 0x43, 0x26, 0x93, + 0x61, 0xc2, 0x84, 0x09, 0x20, 0xeb, 0x94, 0xaf, 0x5e, 0xbd, 0xba, 0xa5, + 0xb0, 0xb0, 0x70, 0x37, 0xda, 0x6e, 0xc4, 0x6b, 0x81, 0xfb, 0x18, 0x00, + 0xb2, 0xf2, 0x9a, 0xb3, 0xd8, 0x07, 0x1b, 0x3c, 0x8b, 0x25, 0x60, 0x0d, + 0xa3, 0xd8, 0x3e, 0x7d, 0xfa, 0x84, 0xc6, 0xc7, 0xc7, 0xf3, 0x5c, 0xb8, + 0xc3, 0x87, 0x0f, 0xa7, 0x86, 0x0f, 0x1f, 0x2e, 0x76, 0x47, 0x87, 0x0d, + 0x1b, 0x36, 0x34, 0xd4, 0xd5, 0xd5, 0x05, 0x80, 0x7f, 0x86, 0x0b, 0x62, + 0x97, 0x6b, 0x04, 0x50, 0x53, 0x54, 0x54, 0xf4, 0xcb, 0xba, 0x75, 0xeb, + 0x66, 0xbe, 0xf8, 0xe2, 0x8b, 0x0a, 0xa0, 0x2d, 0x38, 0xee, 0xdb, 0x6f, + 0xbf, 0x55, 0xe5, 0xe7, 0xe7, 0x67, 0xd6, 0xd6, 0xd6, 0x66, 0x06, 0x05, + 0x05, 0x61, 0xe4, 0xc8, 0x91, 0x50, 0x28, 0x38, 0x3b, 0x04, 0x3b, 0x76, + 0xec, 0xb0, 0xed, 0xdf, 0xbf, 0xff, 0x32, 0x80, 0x5f, 0xd1, 0x9e, 0x6d, + 0x60, 0x27, 0x8c, 0x00, 0x23, 0xd1, 0x47, 0x13, 0xda, 0x03, 0xf5, 0x58, + 0x03, 0x20, 0x18, 0x80, 0x55, 0x24, 0x12, 0x35, 0x77, 0x18, 0xbc, 0x48, + 0xd4, 0xc2, 0xb8, 0xd8, 0x9b, 0x08, 0xe5, 0x20, 0x64, 0xe0, 0x99, 0xd1, + 0x76, 0x4e, 0x7f, 0xf0, 0xe3, 0x8f, 0x3f, 0x9e, 0xf5, 0xcc, 0x33, 0xcf, + 0xc8, 0x81, 0xb6, 0x3c, 0xfc, 0xec, 0xec, 0x6c, 0x65, 0x6e, 0x6e, 0xee, + 0x90, 0xfa, 0xfa, 0x7a, 0x44, 0x44, 0x44, 0x60, 0xf4, 0xe8, 0xd1, 0xbc, + 0xf9, 0x4d, 0x4d, 0x4d, 0xb5, 0x35, 0x35, 0x35, 0xed, 0x66, 0x14, 0x90, + 0xc1, 0xc1, 0x80, 0x21, 0x79, 0xa7, 0xa0, 0xa0, 0xa0, 0xe0, 0xe4, 0xa7, + 0x9f, 0x7e, 0x3a, 0xf1, 0xf1, 0xc7, 0x1f, 0x97, 0x00, 0xc0, 0xbc, 0x79, + 0xf3, 0xa4, 0x23, 0x46, 0x8c, 0x88, 0x3b, 0x7f, 0xfe, 0x7c, 0x9c, 0x58, + 0x2c, 0xc6, 0x88, 0x11, 0x23, 0xd8, 0x92, 0xb6, 0x2c, 0x6d, 0xe8, 0x7d, + 0xfb, 0xf6, 0xd5, 0x39, 0xd0, 0xc6, 0x55, 0x11, 0x20, 0x0a, 0x40, 0x64, + 0x6a, 0x6a, 0x2a, 0x6f, 0xfd, 0x9d, 0x3d, 0x7b, 0xd6, 0x68, 0x30, 0x18, + 0x0a, 0x1d, 0xdc, 0xff, 0x9e, 0x1a, 0x00, 0xec, 0x8d, 0x83, 0xd7, 0x2e, + 0x5d, 0xba, 0x74, 0x74, 0xfd, 0xfa, 0xf5, 0x77, 0x3d, 0xfb, 0xec, 0xb3, + 0x52, 0xc2, 0x78, 0x53, 0xe4, 0xe7, 0xe7, 0xf7, 0xab, 0xaa, 0xaa, 0xea, + 0x27, 0x97, 0xcb, 0x31, 0x60, 0xc0, 0x00, 0x90, 0xc6, 0xc7, 0x91, 0x23, + 0x47, 0xb0, 0x6e, 0xdd, 0xba, 0xb2, 0x96, 0x96, 0x96, 0x6c, 0x81, 0x31, + 0xb0, 0x99, 0x11, 0x76, 0x00, 0xd6, 0xa2, 0xa2, 0xa2, 0xbd, 0xef, 0xbd, + 0xf7, 0xde, 0xa8, 0x11, 0x23, 0x46, 0x84, 0xc9, 0x64, 0x32, 0x88, 0x44, + 0x22, 0xec, 0xdb, 0xb7, 0x4f, 0xbe, 0x7f, 0xff, 0xfe, 0xd4, 0xba, 0xba, + 0xba, 0xd4, 0x88, 0x88, 0x08, 0x4c, 0x9e, 0x3c, 0x99, 0xab, 0x36, 0xd8, + 0xd4, 0xd4, 0x84, 0xe7, 0x9e, 0x7b, 0xae, 0xa9, 0xa2, 0xa2, 0x62, 0x0b, + 0xb3, 0xbe, 0x9a, 0xe1, 0xaf, 0x05, 0xe0, 0x07, 0x3f, 0xdc, 0xf2, 0x06, + 0x00, 0xb9, 0x3b, 0x6a, 0xd9, 0xb2, 0x65, 0x0b, 0xef, 0xcb, 0xe3, 0xc7, + 0x8f, 0x07, 0x3a, 0xb8, 0x53, 0x9d, 0x2e, 0x68, 0x87, 0x7a, 0xee, 0x52, + 0x00, 0x03, 0x27, 0x4e, 0x9c, 0xa8, 0x66, 0xcf, 0x98, 0x77, 0xee, 0xdc, + 0xd9, 0x72, 0xfd, 0xfa, 0xf5, 0x1c, 0xb4, 0x45, 0x5b, 0x7b, 0x92, 0xfb, + 0x2f, 0x24, 0x04, 0xd9, 0x34, 0xa5, 0x9a, 0x92, 0x92, 0x92, 0xf7, 0x1f, + 0x7b, 0xec, 0xb1, 0xbf, 0x7d, 0xf6, 0xd9, 0x67, 0xd1, 0xac, 0x9b, 0x35, + 0x21, 0x21, 0x01, 0x09, 0x09, 0x09, 0x8e, 0xc6, 0x03, 0xd6, 0xac, 0x59, + 0x63, 0xdd, 0xba, 0x75, 0xeb, 0x75, 0xab, 0xd5, 0xfa, 0x2d, 0xda, 0x8b, + 0xb8, 0x78, 0xb2, 0xfb, 0x62, 0x05, 0x6f, 0x2b, 0x45, 0x51, 0x42, 0x25, + 0x5a, 0x4d, 0xe0, 0xdf, 0x3d, 0xef, 0x4c, 0x21, 0xb0, 0x10, 0x35, 0x62, + 0xc4, 0x08, 0x85, 0x0f, 0x8e, 0x14, 0x84, 0x80, 0xdd, 0x21, 0x36, 0x6a, + 0xb5, 0xda, 0x7f, 0xae, 0x5d, 0xbb, 0xb6, 0x8f, 0x4c, 0x26, 0x1b, 0xfa, + 0xec, 0xb3, 0xcf, 0x4a, 0x44, 0x22, 0x11, 0x14, 0x0a, 0x05, 0x1c, 0xcb, + 0xb6, 0x12, 0x3b, 0x43, 0xfb, 0xd2, 0xa5, 0x4b, 0x2b, 0xcb, 0xca, 0xca, + 0xfe, 0x02, 0x87, 0x62, 0x43, 0x84, 0xf1, 0xc5, 0xba, 0x74, 0xcd, 0x0e, + 0xc6, 0x07, 0x7b, 0xc5, 0xac, 0x15, 0x80, 0x94, 0xa2, 0xa8, 0x16, 0x01, + 0x3a, 0xb5, 0xa2, 0x3d, 0xe7, 0xdd, 0x59, 0x19, 0x5d, 0xd6, 0xb8, 0xd0, + 0x36, 0x34, 0x34, 0x7c, 0xf9, 0xce, 0x3b, 0xef, 0xf4, 0xb3, 0x58, 0x2c, + 0x83, 0x16, 0x2f, 0x5e, 0x2c, 0x01, 0xda, 0x4a, 0xf3, 0x4e, 0x98, 0x30, + 0xa1, 0xe3, 0x8f, 0x6c, 0x36, 0x6c, 0xda, 0xb4, 0xc9, 0x68, 0x32, 0x99, + 0x2e, 0xe8, 0xf5, 0xfa, 0x2f, 0x1d, 0x15, 0x90, 0x83, 0xf1, 0x68, 0x00, + 0x50, 0x57, 0x55, 0x55, 0xf5, 0xd1, 0x1b, 0x6f, 0xbc, 0xd1, 0x27, 0x2c, + 0x2c, 0xac, 0xf7, 0xac, 0x59, 0xb3, 0x44, 0x00, 0xd0, 0xb7, 0x6f, 0x5f, + 0x90, 0xc7, 0x21, 0x84, 0xd2, 0xc6, 0xf2, 0xe5, 0xcb, 0x2b, 0x1a, 0x1b, + 0x1b, 0x5f, 0x44, 0x5b, 0xd5, 0x3e, 0x77, 0xc6, 0x2b, 0xbb, 0xa3, 0x56, + 0x09, 0x5c, 0x3c, 0xd4, 0x82, 0xb6, 0x0c, 0x88, 0xce, 0xf0, 0x3f, 0x5b, + 0xa8, 0xa7, 0xa1, 0xae, 0xae, 0xee, 0xe3, 0x77, 0xde, 0x79, 0x27, 0x25, + 0x20, 0x20, 0x20, 0xe5, 0xb1, 0xc7, 0x1e, 0x93, 0x30, 0x46, 0x56, 0x87, + 0x3c, 0x7d, 0x16, 0x0e, 0x1c, 0x38, 0x80, 0x29, 0x53, 0xa6, 0xd0, 0x34, + 0x4d, 0xbf, 0x86, 0xb6, 0xcb, 0x80, 0xf4, 0xe4, 0x0e, 0x9d, 0xa8, 0xde, + 0xc8, 0x66, 0x00, 0x1c, 0xfd, 0xe5, 0x97, 0x5f, 0xf6, 0x0f, 0x1f, 0x3e, + 0x7c, 0x66, 0x5e, 0x5e, 0x9e, 0x54, 0x2e, 0x97, 0x43, 0x24, 0x12, 0x81, + 0x3d, 0x72, 0x23, 0xa1, 0xae, 0xae, 0x0e, 0x73, 0xe6, 0xcc, 0x31, 0x14, + 0x16, 0x16, 0xfe, 0x1d, 0x6d, 0xf7, 0x7a, 0x34, 0xc1, 0xf3, 0xd4, 0x5e, + 0x3f, 0xf8, 0xc1, 0x0f, 0xb7, 0x80, 0x01, 0xd0, 0x0c, 0xe0, 0xeb, 0xec, + 0xec, 0x6c, 0x64, 0x67, 0x67, 0x07, 0xa2, 0x3d, 0x7f, 0xba, 0x0c, 0x6d, + 0x67, 0xce, 0x9e, 0x2a, 0x4c, 0x2e, 0xa2, 0x38, 0x29, 0x29, 0x69, 0xcc, + 0x9c, 0x39, 0x73, 0xd4, 0x40, 0xdb, 0x65, 0x24, 0xd9, 0xd9, 0xd9, 0x0d, + 0x68, 0xbb, 0xb1, 0x4d, 0xd7, 0x49, 0x01, 0x41, 0x13, 0x42, 0xb0, 0x11, + 0x40, 0xfe, 0xb9, 0x73, 0xe7, 0x96, 0x67, 0x65, 0x65, 0xbd, 0xf3, 0xf2, + 0xcb, 0x2f, 0x2b, 0xee, 0xba, 0xeb, 0x2e, 0x45, 0x42, 0x42, 0x02, 0x94, + 0x4a, 0x25, 0xec, 0x76, 0x3b, 0x74, 0x3a, 0x1d, 0x8e, 0x1f, 0x3f, 0x8e, + 0x6d, 0xdb, 0xb6, 0x35, 0xee, 0xd9, 0xb3, 0xe7, 0x44, 0x63, 0x63, 0xe3, + 0x5b, 0x8c, 0x72, 0xd3, 0xc1, 0xf3, 0xca, 0x83, 0xec, 0xd9, 0xb1, 0xae, + 0xb6, 0xb6, 0x56, 0xb9, 0x65, 0xcb, 0x16, 0xb6, 0x94, 0x30, 0x1a, 0x1b, + 0x1b, 0x41, 0xd3, 0xb4, 0x15, 0xee, 0xab, 0xb8, 0x91, 0x3b, 0x50, 0xf9, + 0xe1, 0xc3, 0x87, 0x95, 0x8e, 0x86, 0x96, 0xa7, 0x50, 0x5e, 0x5e, 0xae, + 0x76, 0x32, 0x17, 0x64, 0x8c, 0x84, 0x0e, 0x40, 0x45, 0x59, 0x59, 0xd9, + 0xcb, 0xaf, 0xbe, 0xfa, 0xea, 0x1b, 0x39, 0x39, 0x39, 0x7d, 0x1f, 0x7d, + 0xf4, 0x51, 0xcd, 0xe8, 0xd1, 0xa3, 0x29, 0x8d, 0x46, 0x03, 0x99, 0x4c, + 0xc6, 0x06, 0x83, 0xe1, 0xd4, 0xa9, 0x53, 0xd8, 0xba, 0x75, 0xab, 0xee, + 0xdf, 0xff, 0xfe, 0xf7, 0xb5, 0x92, 0x92, 0x92, 0xd5, 0x68, 0xbb, 0xef, + 0xbd, 0xd1, 0xb1, 0x0f, 0x66, 0x5c, 0xec, 0x85, 0x34, 0x36, 0x27, 0x74, + 0x12, 0x01, 0x90, 0x5b, 0xad, 0x56, 0x7a, 0xcb, 0x96, 0x2d, 0xb8, 0x7e, + 0xfd, 0x3a, 0x80, 0xb6, 0xd4, 0x30, 0xab, 0xd5, 0x4a, 0x13, 0x8a, 0x41, + 0x68, 0x67, 0x48, 0xe2, 0xaf, 0x05, 0x50, 0x5c, 0x52, 0x52, 0xf2, 0xe7, + 0xd7, 0x5e, 0x7b, 0xed, 0xf5, 0x9d, 0x3b, 0x77, 0xa6, 0xad, 0x58, 0xb1, + 0x42, 0x35, 0x70, 0xe0, 0x40, 0x8a, 0xcc, 0x3a, 0x68, 0x6c, 0x6c, 0x44, + 0x5e, 0x5e, 0x1e, 0x3e, 0xf8, 0xe0, 0x83, 0xc6, 0x13, 0x27, 0x4e, 0x1c, + 0xaf, 0xa9, 0xa9, 0x79, 0x17, 0x6d, 0xf1, 0x1f, 0x42, 0x0a, 0x88, 0x34, + 0x74, 0x9b, 0x00, 0x5c, 0x29, 0x2e, 0x2e, 0x5e, 0xfc, 0xdc, 0x73, 0xcf, + 0xbd, 0x91, 0x9b, 0x9b, 0xdb, 0x7b, 0xfe, 0xfc, 0xf9, 0xca, 0xf4, 0xf4, + 0x74, 0xb6, 0xa0, 0x14, 0x2c, 0x16, 0x0b, 0xce, 0x9e, 0x3d, 0x8b, 0xdd, + 0xbb, 0x77, 0xb7, 0x6c, 0xda, 0xb4, 0xa9, 0xf4, 0xea, 0xd5, 0xab, 0xef, + 0x30, 0x9e, 0x85, 0x06, 0x37, 0x6b, 0x81, 0xab, 0x37, 0x00, 0x00, 0xfb, + 0xf6, 0xed, 0x53, 0xb0, 0xf9, 0xfa, 0x00, 0x70, 0xf8, 0xf0, 0x61, 0x39, + 0x80, 0x8a, 0x4e, 0xec, 0x90, 0x1d, 0xe9, 0x53, 0x52, 0x5a, 0x5a, 0xba, + 0xf8, 0xe5, 0x97, 0x5f, 0xfe, 0xcb, 0x81, 0x03, 0x07, 0xfa, 0x3d, 0xf5, + 0xd4, 0x53, 0x9a, 0x01, 0x03, 0x06, 0x80, 0x0c, 0xf8, 0x6b, 0x6e, 0x6e, + 0xc6, 0xf9, 0xf3, 0xe7, 0xb1, 0x79, 0xf3, 0x66, 0xc3, 0xee, 0xdd, 0xbb, + 0x4b, 0x69, 0x9a, 0x7e, 0x17, 0xed, 0x97, 0x0e, 0x91, 0x17, 0x3e, 0x91, + 0x97, 0x0d, 0xb1, 0x5e, 0x86, 0xc6, 0xda, 0xda, 0xda, 0xbf, 0x9b, 0xcd, + 0x66, 0xeb, 0x3d, 0xf7, 0xdc, 0x93, 0xf5, 0xfc, 0xf3, 0xcf, 0x87, 0x8f, + 0x19, 0x33, 0x86, 0xd2, 0x68, 0x34, 0x3c, 0xc5, 0x7f, 0xe0, 0xc0, 0x01, + 0xdb, 0xea, 0xd5, 0xab, 0x6b, 0xce, 0x9c, 0x39, 0xb3, 0xc9, 0x6c, 0x36, + 0xef, 0x01, 0x3f, 0xb5, 0xd1, 0xef, 0xfe, 0xf7, 0x83, 0x1f, 0x6e, 0x32, + 0x50, 0xae, 0xd6, 0x20, 0x71, 0x63, 0x19, 0x5b, 0x93, 0x5e, 0x89, 0xb6, + 0x60, 0x35, 0x31, 0xb1, 0x1b, 0x68, 0x21, 0x5d, 0x96, 0xce, 0x16, 0x35, + 0xe3, 0x01, 0x90, 0xa2, 0x2d, 0xf8, 0x2f, 0x59, 0xa9, 0x54, 0x1e, 0x5a, + 0xb7, 0x6e, 0x9d, 0x5c, 0x2a, 0x95, 0x22, 0x27, 0x27, 0x87, 0xde, 0xb3, + 0x67, 0xcf, 0x57, 0x37, 0x6e, 0xdc, 0x78, 0x0b, 0x6d, 0xd7, 0x9e, 0x6a, + 0x01, 0x18, 0x69, 0x9a, 0xf6, 0x38, 0x48, 0xc8, 0xa1, 0x98, 0x0e, 0x1b, + 0x1d, 0x1f, 0x0a, 0x20, 0x5e, 0x22, 0x91, 0x4c, 0x49, 0x4a, 0x4a, 0x1a, + 0x2b, 0x97, 0xcb, 0xa3, 0xa4, 0x52, 0xa9, 0xcc, 0x62, 0xb1, 0x80, 0xa2, + 0x28, 0x43, 0x63, 0x63, 0xe3, 0xa5, 0x8a, 0x8a, 0x8a, 0x5c, 0x00, 0x3f, + 0x33, 0xc2, 0x89, 0x2d, 0xbb, 0x6a, 0x72, 0x35, 0x16, 0x87, 0xf1, 0xb0, + 0x85, 0x7b, 0x6e, 0x63, 0x1e, 0x76, 0x57, 0xd7, 0x0a, 0x60, 0x17, 0xda, + 0x72, 0xaf, 0xf5, 0xce, 0xc6, 0xc3, 0xd0, 0x98, 0xad, 0x89, 0x10, 0x0a, + 0x60, 0x2e, 0xda, 0xb2, 0x01, 0xd8, 0x7b, 0xdb, 0x45, 0x1e, 0x08, 0x7e, + 0xd6, 0xf3, 0x71, 0x16, 0xc0, 0x51, 0xb4, 0x17, 0x90, 0xb1, 0xd0, 0x34, + 0x6d, 0x27, 0xf0, 0x25, 0x03, 0x30, 0x83, 0xd1, 0x96, 0x72, 0x78, 0x47, + 0x78, 0x78, 0xf8, 0x88, 0xf0, 0xf0, 0xf0, 0xc1, 0x14, 0x45, 0xa9, 0x02, + 0x03, 0x03, 0xc5, 0x46, 0xa3, 0x11, 0x76, 0xbb, 0xbd, 0xc5, 0x60, 0x30, + 0x5c, 0x2e, 0x2b, 0x2b, 0x3b, 0xcc, 0xb8, 0xb6, 0x6f, 0x30, 0xf4, 0xe1, + 0x15, 0x67, 0xf2, 0x44, 0x88, 0x53, 0x14, 0x45, 0xce, 0x49, 0x12, 0x80, + 0x3b, 0x19, 0x3c, 0x68, 0x86, 0xd6, 0x7b, 0x18, 0x63, 0x52, 0xc7, 0xd0, + 0xc9, 0xea, 0x84, 0xde, 0x6c, 0xe5, 0x42, 0x15, 0xda, 0x2e, 0x9d, 0x09, + 0x03, 0x30, 0x32, 0x26, 0x26, 0x66, 0x72, 0x48, 0x48, 0x48, 0x9a, 0x44, + 0x22, 0x09, 0x0a, 0x0a, 0x0a, 0xa2, 0x99, 0x7c, 0xf3, 0xe6, 0xa6, 0xa6, + 0xa6, 0xb3, 0xd5, 0xd5, 0xd5, 0xfb, 0x19, 0x23, 0xb5, 0x16, 0xed, 0x47, + 0x0c, 0x1d, 0xe6, 0x97, 0x68, 0x9f, 0xad, 0x4e, 0x19, 0x0a, 0x20, 0x46, + 0x24, 0x12, 0x4d, 0x4c, 0x4e, 0x4e, 0x9e, 0x2c, 0x93, 0xc9, 0xe2, 0xd5, + 0x6a, 0xb5, 0xc4, 0x64, 0x32, 0x51, 0x46, 0xa3, 0xd1, 0x62, 0x32, 0x99, + 0x4a, 0x4a, 0x4a, 0x4a, 0x7e, 0xb5, 0x5a, 0xad, 0x39, 0x00, 0xca, 0x19, + 0xe5, 0xcf, 0xc6, 0xae, 0x08, 0xd2, 0x86, 0x98, 0x6b, 0x16, 0xff, 0xb9, + 0x68, 0xbf, 0x5f, 0xc1, 0x02, 0xe0, 0x1a, 0x80, 0x83, 0x04, 0x9e, 0x66, + 0x76, 0xfe, 0x3c, 0xe4, 0x7f, 0x89, 0x43, 0xfb, 0x11, 0x00, 0x6e, 0x8f, + 0x8b, 0x8b, 0x9b, 0xa2, 0x56, 0xab, 0x53, 0x24, 0x12, 0x89, 0x52, 0xad, + 0x56, 0xd3, 0x7a, 0xbd, 0x9e, 0xb2, 0x58, 0x2c, 0xc6, 0xd6, 0xd6, 0xd6, + 0xc2, 0xe2, 0xe2, 0xe2, 0x83, 0x68, 0xaf, 0x03, 0xd1, 0x08, 0x87, 0xf8, + 0x1b, 0xa2, 0x54, 0xb5, 0xd0, 0x95, 0xcf, 0x61, 0x00, 0x06, 0x47, 0x45, + 0x45, 0xdd, 0x1d, 0x16, 0x16, 0x36, 0x38, 0x3c, 0x3c, 0x5c, 0xae, 0x54, + 0x2a, 0xa9, 0xa6, 0xa6, 0x26, 0x5a, 0xab, 0xd5, 0xea, 0xab, 0xaa, 0xaa, + 0xf2, 0x1a, 0x1b, 0x1b, 0xf7, 0xa0, 0x2d, 0xab, 0xa1, 0xbe, 0x0b, 0xde, + 0x3d, 0x3f, 0xf8, 0xc1, 0x0f, 0x37, 0xc1, 0x00, 0x70, 0x74, 0xdb, 0x4b, + 0xd0, 0x1e, 0xf0, 0xc7, 0x06, 0x1e, 0x59, 0x89, 0xdd, 0x02, 0xed, 0xc6, + 0x00, 0x20, 0x15, 0xc1, 0x9d, 0x68, 0x4b, 0x3d, 0x93, 0x30, 0x0a, 0x85, + 0x2d, 0x7d, 0xca, 0x55, 0x3f, 0xf3, 0x54, 0xf8, 0x39, 0x31, 0x02, 0x58, + 0xa3, 0x25, 0x88, 0x11, 0x88, 0x2a, 0xa6, 0x6f, 0xb6, 0xfa, 0x9d, 0x19, + 0xed, 0x05, 0x64, 0xf4, 0x68, 0xaf, 0x24, 0x67, 0x61, 0xfa, 0xf6, 0xa4, + 0xa2, 0x21, 0x59, 0x81, 0x2d, 0x10, 0xed, 0xd7, 0xf8, 0xb2, 0x8a, 0x8d, + 0xbc, 0x32, 0x58, 0x70, 0x3c, 0x0e, 0x46, 0x56, 0x00, 0x63, 0x08, 0x04, + 0x12, 0xb8, 0xba, 0x0a, 0xae, 0x24, 0xbd, 0x07, 0x6c, 0x26, 0x40, 0x33, + 0xb1, 0x93, 0xb6, 0x39, 0x08, 0x70, 0x52, 0x88, 0xb3, 0x7d, 0xa9, 0x18, + 0x1a, 0xb1, 0x75, 0xf8, 0x45, 0x02, 0xf4, 0x31, 0x10, 0xf4, 0x31, 0xc3, + 0xb3, 0xda, 0x0c, 0x8e, 0x63, 0x94, 0x12, 0x73, 0x12, 0x48, 0x18, 0x4a, + 0x66, 0xc2, 0x88, 0x34, 0x91, 0x46, 0x8b, 0x93, 0xb9, 0x25, 0xf1, 0x57, + 0x11, 0xf3, 0x1b, 0x48, 0x18, 0x4c, 0xe4, 0x71, 0x10, 0x3b, 0xbf, 0xcd, + 0x04, 0xfe, 0x76, 0xc7, 0x3e, 0x1c, 0x78, 0x9d, 0x9d, 0x8b, 0x20, 0xa2, + 0x7d, 0xb6, 0x3e, 0x3e, 0xeb, 0x0a, 0x37, 0x12, 0x6d, 0xeb, 0x09, 0x23, + 0xd8, 0x29, 0x6d, 0x04, 0x0c, 0xea, 0x40, 0xc2, 0xa0, 0x66, 0x8f, 0x68, + 0x48, 0x3c, 0x6d, 0x5e, 0xd0, 0x98, 0xc4, 0xdf, 0x13, 0xfa, 0x58, 0x9c, + 0xf0, 0xbf, 0xc9, 0xd9, 0x18, 0x08, 0x23, 0x52, 0x4a, 0x18, 0x4a, 0x2c, + 0x8d, 0x94, 0x00, 0xc2, 0x99, 0xbf, 0x1b, 0x08, 0x63, 0x5a, 0x47, 0xb4, + 0xef, 0x69, 0x5d, 0x03, 0x3f, 0xf8, 0xc1, 0x0f, 0x37, 0xdb, 0x00, 0x70, + 0x10, 0x2c, 0x8e, 0x0f, 0x59, 0xcb, 0xdb, 0x6d, 0x19, 0x60, 0x07, 0x85, + 0xc9, 0x56, 0x15, 0x64, 0x85, 0x1f, 0xeb, 0xbe, 0x6c, 0xe9, 0xaa, 0x90, + 0x70, 0x10, 0x84, 0xec, 0x8e, 0x91, 0xac, 0x00, 0xc8, 0xee, 0xa8, 0x59, + 0xc3, 0xc5, 0xc4, 0x08, 0x5b, 0x56, 0x78, 0xdb, 0xbd, 0x54, 0x6c, 0x22, + 0x07, 0x03, 0x49, 0x44, 0xb8, 0xbd, 0xd9, 0x8a, 0x82, 0x36, 0x67, 0xed, + 0x0a, 0xe0, 0xeb, 0x68, 0x68, 0xb9, 0xcb, 0xac, 0x60, 0xbd, 0x00, 0x64, + 0x7f, 0x56, 0x21, 0x25, 0xe7, 0x30, 0x0f, 0x12, 0x42, 0x29, 0xcb, 0xd0, + 0x1e, 0xb5, 0x4f, 0x39, 0x78, 0x16, 0xcc, 0x8e, 0xf4, 0x81, 0x97, 0x77, + 0x3f, 0x10, 0x7d, 0x0a, 0xd1, 0xc9, 0xee, 0x09, 0x9d, 0x9c, 0xe0, 0x2f, + 0x73, 0x98, 0x5f, 0x12, 0x7f, 0x0b, 0x31, 0xbf, 0x26, 0xa2, 0x0f, 0xbb, + 0x1b, 0x23, 0xd5, 0xb1, 0x7d, 0x39, 0xf3, 0x90, 0x05, 0x90, 0x58, 0x5a, + 0x9b, 0x09, 0xfe, 0xf1, 0xd4, 0x08, 0x76, 0x34, 0xa8, 0xc5, 0x84, 0x52, + 0xb6, 0xc2, 0xa1, 0x0a, 0xa5, 0xb7, 0x6b, 0x80, 0xe0, 0x49, 0x4f, 0xe6, + 0xd7, 0x91, 0x3e, 0x9e, 0x8e, 0x41, 0x44, 0x18, 0x1a, 0x72, 0x87, 0xf5, + 0x45, 0x11, 0x73, 0x6a, 0x76, 0x68, 0xdf, 0x06, 0xbf, 0xf2, 0xf7, 0x83, + 0x1f, 0x7e, 0x3b, 0x06, 0x80, 0x4f, 0x3b, 0xe3, 0x2b, 0x4c, 0x67, 0xde, + 0x04, 0x9f, 0x08, 0x09, 0x87, 0x0b, 0x70, 0x44, 0xe8, 0x78, 0xc5, 0x29, + 0x99, 0x03, 0x6e, 0xef, 0x82, 0x62, 0x03, 0xa1, 0x34, 0x28, 0x07, 0xc5, + 0xcc, 0x3d, 0x1e, 0x28, 0x35, 0xa1, 0x5b, 0xfa, 0x3c, 0xbd, 0x2e, 0xd5, + 0xd1, 0x18, 0xa3, 0x5d, 0x19, 0x64, 0x0e, 0xfd, 0x89, 0xd1, 0xb1, 0xd2, + 0x1d, 0xed, 0x60, 0x58, 0x74, 0x8a, 0x3e, 0x1e, 0x18, 0x92, 0x5e, 0xd1, + 0xc9, 0x89, 0xa2, 0x16, 0x11, 0x63, 0xa0, 0x7c, 0x81, 0xbf, 0xc0, 0x1d, + 0x18, 0x24, 0x7d, 0x1c, 0x79, 0xc7, 0xd6, 0xc9, 0xb6, 0x9d, 0x19, 0xd4, + 0x6e, 0xe7, 0xaf, 0x13, 0xf8, 0x93, 0xff, 0xc2, 0x87, 0x63, 0x10, 0x09, + 0xd0, 0x88, 0x22, 0xc6, 0x61, 0x23, 0x1e, 0xba, 0x2b, 0xfc, 0xe3, 0x07, + 0x3f, 0xf8, 0xe1, 0xb7, 0x6f, 0x00, 0x38, 0x2a, 0x4c, 0x08, 0x78, 0x13, + 0x7c, 0x2a, 0x24, 0x1c, 0xfa, 0x04, 0x84, 0x6f, 0x33, 0xc4, 0x7f, 0xab, + 0x60, 0x12, 0xb8, 0xed, 0x11, 0xbf, 0x15, 0xfa, 0xb8, 0x98, 0x5b, 0x9f, + 0xe0, 0xef, 0x82, 0x36, 0xa4, 0xe1, 0x72, 0xcb, 0xf2, 0xce, 0x2d, 0x40, + 0x1f, 0xf8, 0x95, 0xbe, 0x1f, 0xfc, 0x70, 0xeb, 0xc2, 0xff, 0x07, 0xa7, + 0xfe, 0x1e, 0x9a, 0x36, 0x55, 0xcc, 0xcc, 0x00, 0x00, 0x00, 0x00, 0x49, + 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82 +}; + +unsigned char cc_fps_images_ipadhd_png[] = { + 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, + 0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x40, + 0x08, 0x06, 0x00, 0x00, 0x00, 0x6c, 0xbf, 0xcf, 0xbf, 0x00, 0x00, 0x0a, + 0x43, 0x69, 0x43, 0x43, 0x50, 0x49, 0x43, 0x43, 0x20, 0x70, 0x72, 0x6f, + 0x66, 0x69, 0x6c, 0x65, 0x00, 0x00, 0x78, 0xda, 0x9d, 0x53, 0x77, 0x58, + 0x93, 0xf7, 0x16, 0x3e, 0xdf, 0xf7, 0x65, 0x0f, 0x56, 0x42, 0xd8, 0xf0, + 0xb1, 0x97, 0x6c, 0x81, 0x00, 0x22, 0x23, 0xac, 0x08, 0xc8, 0x10, 0x59, + 0xa2, 0x10, 0x92, 0x00, 0x61, 0x84, 0x10, 0x12, 0x40, 0xc5, 0x85, 0x88, + 0x0a, 0x56, 0x14, 0x15, 0x11, 0x9c, 0x48, 0x55, 0xc4, 0x82, 0xd5, 0x0a, + 0x48, 0x9d, 0x88, 0xe2, 0xa0, 0x28, 0xb8, 0x67, 0x41, 0x8a, 0x88, 0x5a, + 0x8b, 0x55, 0x5c, 0x38, 0xee, 0x1f, 0xdc, 0xa7, 0xb5, 0x7d, 0x7a, 0xef, + 0xed, 0xed, 0xfb, 0xd7, 0xfb, 0xbc, 0xe7, 0x9c, 0xe7, 0xfc, 0xce, 0x79, + 0xcf, 0x0f, 0x80, 0x11, 0x12, 0x26, 0x91, 0xe6, 0xa2, 0x6a, 0x00, 0x39, + 0x52, 0x85, 0x3c, 0x3a, 0xd8, 0x1f, 0x8f, 0x4f, 0x48, 0xc4, 0xc9, 0xbd, + 0x80, 0x02, 0x15, 0x48, 0xe0, 0x04, 0x20, 0x10, 0xe6, 0xcb, 0xc2, 0x67, + 0x05, 0xc5, 0x00, 0x00, 0xf0, 0x03, 0x79, 0x78, 0x7e, 0x74, 0xb0, 0x3f, + 0xfc, 0x01, 0xaf, 0x6f, 0x00, 0x02, 0x00, 0x70, 0xd5, 0x2e, 0x24, 0x12, + 0xc7, 0xe1, 0xff, 0x83, 0xba, 0x50, 0x26, 0x57, 0x00, 0x20, 0x91, 0x00, + 0xe0, 0x22, 0x12, 0xe7, 0x0b, 0x01, 0x90, 0x52, 0x00, 0xc8, 0x2e, 0x54, + 0xc8, 0x14, 0x00, 0xc8, 0x18, 0x00, 0xb0, 0x53, 0xb3, 0x64, 0x0a, 0x00, + 0x94, 0x00, 0x00, 0x6c, 0x79, 0x7c, 0x42, 0x22, 0x00, 0xaa, 0x0d, 0x00, + 0xec, 0xf4, 0x49, 0x3e, 0x05, 0x00, 0xd8, 0xa9, 0x93, 0xdc, 0x17, 0x00, + 0xd8, 0xa2, 0x1c, 0xa9, 0x08, 0x00, 0x8d, 0x01, 0x00, 0x99, 0x28, 0x47, + 0x24, 0x02, 0x40, 0xbb, 0x00, 0x60, 0x55, 0x81, 0x52, 0x2c, 0x02, 0xc0, + 0xc2, 0x00, 0xa0, 0xac, 0x40, 0x22, 0x2e, 0x04, 0xc0, 0xae, 0x01, 0x80, + 0x59, 0xb6, 0x32, 0x47, 0x02, 0x80, 0xbd, 0x05, 0x00, 0x76, 0x8e, 0x58, + 0x90, 0x0f, 0x40, 0x60, 0x00, 0x80, 0x99, 0x42, 0x2c, 0xcc, 0x00, 0x20, + 0x38, 0x02, 0x00, 0x43, 0x1e, 0x13, 0xcd, 0x03, 0x20, 0x4c, 0x03, 0xa0, + 0x30, 0xd2, 0xbf, 0xe0, 0xa9, 0x5f, 0x70, 0x85, 0xb8, 0x48, 0x01, 0x00, + 0xc0, 0xcb, 0x95, 0xcd, 0x97, 0x4b, 0xd2, 0x33, 0x14, 0xb8, 0x95, 0xd0, + 0x1a, 0x77, 0xf2, 0xf0, 0xe0, 0xe2, 0x21, 0xe2, 0xc2, 0x6c, 0xb1, 0x42, + 0x61, 0x17, 0x29, 0x10, 0x66, 0x09, 0xe4, 0x22, 0x9c, 0x97, 0x9b, 0x23, + 0x13, 0x48, 0xe7, 0x03, 0x4c, 0xce, 0x0c, 0x00, 0x00, 0x1a, 0xf9, 0xd1, + 0xc1, 0xfe, 0x38, 0x3f, 0x90, 0xe7, 0xe6, 0xe4, 0xe1, 0xe6, 0x66, 0xe7, + 0x6c, 0xef, 0xf4, 0xc5, 0xa2, 0xfe, 0x6b, 0xf0, 0x6f, 0x22, 0x3e, 0x21, + 0xf1, 0xdf, 0xfe, 0xbc, 0x8c, 0x02, 0x04, 0x00, 0x10, 0x4e, 0xcf, 0xef, + 0xda, 0x5f, 0xe5, 0xe5, 0xd6, 0x03, 0x70, 0xc7, 0x01, 0xb0, 0x75, 0xbf, + 0x6b, 0xa9, 0x5b, 0x00, 0xda, 0x56, 0x00, 0x68, 0xdf, 0xf9, 0x5d, 0x33, + 0xdb, 0x09, 0xa0, 0x5a, 0x0a, 0xd0, 0x7a, 0xf9, 0x8b, 0x79, 0x38, 0xfc, + 0x40, 0x1e, 0x9e, 0xa1, 0x50, 0xc8, 0x3c, 0x1d, 0x1c, 0x0a, 0x0b, 0x0b, + 0xed, 0x25, 0x62, 0xa1, 0xbd, 0x30, 0xe3, 0x8b, 0x3e, 0xff, 0x33, 0xe1, + 0x6f, 0xe0, 0x8b, 0x7e, 0xf6, 0xfc, 0x40, 0x1e, 0xfe, 0xdb, 0x7a, 0xf0, + 0x00, 0x71, 0x9a, 0x40, 0x99, 0xad, 0xc0, 0xa3, 0x83, 0xfd, 0x71, 0x61, + 0x6e, 0x76, 0xae, 0x52, 0x8e, 0xe7, 0xcb, 0x04, 0x42, 0x31, 0x6e, 0xf7, + 0xe7, 0x23, 0xfe, 0xc7, 0x85, 0x7f, 0xfd, 0x8e, 0x29, 0xd1, 0xe2, 0x34, + 0xb1, 0x5c, 0x2c, 0x15, 0x8a, 0xf1, 0x58, 0x89, 0xb8, 0x50, 0x22, 0x4d, + 0xc7, 0x79, 0xb9, 0x52, 0x91, 0x44, 0x21, 0xc9, 0x95, 0xe2, 0x12, 0xe9, + 0x7f, 0x32, 0xf1, 0x1f, 0x96, 0xfd, 0x09, 0x93, 0x77, 0x0d, 0x00, 0xac, + 0x86, 0x4f, 0xc0, 0x4e, 0xb6, 0x07, 0xb5, 0xcb, 0x6c, 0xc0, 0x7e, 0xee, + 0x01, 0x02, 0x8b, 0x0e, 0x58, 0xd2, 0x76, 0x00, 0x40, 0x7e, 0xf3, 0x2d, + 0x8c, 0x1a, 0x0b, 0x91, 0x00, 0x10, 0x67, 0x34, 0x32, 0x79, 0xf7, 0x00, + 0x00, 0x93, 0xbf, 0xf9, 0x8f, 0x40, 0x2b, 0x01, 0x00, 0xcd, 0x97, 0xa4, + 0xe3, 0x00, 0x00, 0xbc, 0xe8, 0x18, 0x5c, 0xa8, 0x94, 0x17, 0x4c, 0xc6, + 0x08, 0x00, 0x00, 0x44, 0xa0, 0x81, 0x2a, 0xb0, 0x41, 0x07, 0x0c, 0xc1, + 0x14, 0xac, 0xc0, 0x0e, 0x9c, 0xc1, 0x1d, 0xbc, 0xc0, 0x17, 0x02, 0x61, + 0x06, 0x44, 0x40, 0x0c, 0x24, 0xc0, 0x3c, 0x10, 0x42, 0x06, 0xe4, 0x80, + 0x1c, 0x0a, 0xa1, 0x18, 0x96, 0x41, 0x19, 0x54, 0xc0, 0x3a, 0xd8, 0x04, + 0xb5, 0xb0, 0x03, 0x1a, 0xa0, 0x11, 0x9a, 0xe1, 0x10, 0xb4, 0xc1, 0x31, + 0x38, 0x0d, 0xe7, 0xe0, 0x12, 0x5c, 0x81, 0xeb, 0x70, 0x17, 0x06, 0x60, + 0x18, 0x9e, 0xc2, 0x18, 0xbc, 0x86, 0x09, 0x04, 0x41, 0xc8, 0x08, 0x13, + 0x61, 0x21, 0x3a, 0x88, 0x11, 0x62, 0x8e, 0xd8, 0x22, 0xce, 0x08, 0x17, + 0x99, 0x8e, 0x04, 0x22, 0x61, 0x48, 0x34, 0x92, 0x80, 0xa4, 0x20, 0xe9, + 0x88, 0x14, 0x51, 0x22, 0xc5, 0xc8, 0x72, 0xa4, 0x02, 0xa9, 0x42, 0x6a, + 0x91, 0x5d, 0x48, 0x23, 0xf2, 0x2d, 0x72, 0x14, 0x39, 0x8d, 0x5c, 0x40, + 0xfa, 0x90, 0xdb, 0xc8, 0x20, 0x32, 0x8a, 0xfc, 0x8a, 0xbc, 0x47, 0x31, + 0x94, 0x81, 0xb2, 0x51, 0x03, 0xd4, 0x02, 0x75, 0x40, 0xb9, 0xa8, 0x1f, + 0x1a, 0x8a, 0xc6, 0xa0, 0x73, 0xd1, 0x74, 0x34, 0x0f, 0x5d, 0x80, 0x96, + 0xa2, 0x6b, 0xd1, 0x1a, 0xb4, 0x1e, 0x3d, 0x80, 0xb6, 0xa2, 0xa7, 0xd1, + 0x4b, 0xe8, 0x75, 0x74, 0x00, 0x7d, 0x8a, 0x8e, 0x63, 0x80, 0xd1, 0x31, + 0x0e, 0x66, 0x8c, 0xd9, 0x61, 0x5c, 0x8c, 0x87, 0x45, 0x60, 0x89, 0x58, + 0x1a, 0x26, 0xc7, 0x16, 0x63, 0xe5, 0x58, 0x35, 0x56, 0x8f, 0x35, 0x63, + 0x1d, 0x58, 0x37, 0x76, 0x15, 0x1b, 0xc0, 0x9e, 0x61, 0xef, 0x08, 0x24, + 0x02, 0x8b, 0x80, 0x13, 0xec, 0x08, 0x5e, 0x84, 0x10, 0xc2, 0x6c, 0x82, + 0x90, 0x90, 0x47, 0x58, 0x4c, 0x58, 0x43, 0xa8, 0x25, 0xec, 0x23, 0xb4, + 0x12, 0xba, 0x08, 0x57, 0x09, 0x83, 0x84, 0x31, 0xc2, 0x27, 0x22, 0x93, + 0xa8, 0x4f, 0xb4, 0x25, 0x7a, 0x12, 0xf9, 0xc4, 0x78, 0x62, 0x3a, 0xb1, + 0x90, 0x58, 0x46, 0xac, 0x26, 0xee, 0x21, 0x1e, 0x21, 0x9e, 0x25, 0x5e, + 0x27, 0x0e, 0x13, 0x5f, 0x93, 0x48, 0x24, 0x0e, 0xc9, 0x92, 0xe4, 0x4e, + 0x0a, 0x21, 0x25, 0x90, 0x32, 0x49, 0x0b, 0x49, 0x6b, 0x48, 0xdb, 0x48, + 0x2d, 0xa4, 0x53, 0xa4, 0x3e, 0xd2, 0x10, 0x69, 0x9c, 0x4c, 0x26, 0xeb, + 0x90, 0x6d, 0xc9, 0xde, 0xe4, 0x08, 0xb2, 0x80, 0xac, 0x20, 0x97, 0x91, + 0xb7, 0x90, 0x0f, 0x90, 0x4f, 0x92, 0xfb, 0xc9, 0xc3, 0xe4, 0xb7, 0x14, + 0x3a, 0xc5, 0x88, 0xe2, 0x4c, 0x09, 0xa2, 0x24, 0x52, 0xa4, 0x94, 0x12, + 0x4a, 0x35, 0x65, 0x3f, 0xe5, 0x04, 0xa5, 0x9f, 0x32, 0x42, 0x99, 0xa0, + 0xaa, 0x51, 0xcd, 0xa9, 0x9e, 0xd4, 0x08, 0xaa, 0x88, 0x3a, 0x9f, 0x5a, + 0x49, 0x6d, 0xa0, 0x76, 0x50, 0x2f, 0x53, 0x87, 0xa9, 0x13, 0x34, 0x75, + 0x9a, 0x25, 0xcd, 0x9b, 0x16, 0x43, 0xcb, 0xa4, 0x2d, 0xa3, 0xd5, 0xd0, + 0x9a, 0x69, 0x67, 0x69, 0xf7, 0x68, 0x2f, 0xe9, 0x74, 0xba, 0x09, 0xdd, + 0x83, 0x1e, 0x45, 0x97, 0xd0, 0x97, 0xd2, 0x6b, 0xe8, 0x07, 0xe9, 0xe7, + 0xe9, 0x83, 0xf4, 0x77, 0x0c, 0x0d, 0x86, 0x0d, 0x83, 0xc7, 0x48, 0x62, + 0x28, 0x19, 0x6b, 0x19, 0x7b, 0x19, 0xa7, 0x18, 0xb7, 0x19, 0x2f, 0x99, + 0x4c, 0xa6, 0x05, 0xd3, 0x97, 0x99, 0xc8, 0x54, 0x30, 0xd7, 0x32, 0x1b, + 0x99, 0x67, 0x98, 0x0f, 0x98, 0x6f, 0x55, 0x58, 0x2a, 0xf6, 0x2a, 0x7c, + 0x15, 0x91, 0xca, 0x12, 0x95, 0x3a, 0x95, 0x56, 0x95, 0x7e, 0x95, 0xe7, + 0xaa, 0x54, 0x55, 0x73, 0x55, 0x3f, 0xd5, 0x79, 0xaa, 0x0b, 0x54, 0xab, + 0x55, 0x0f, 0xab, 0x5e, 0x56, 0x7d, 0xa6, 0x46, 0x55, 0xb3, 0x50, 0xe3, + 0xa9, 0x09, 0xd4, 0x16, 0xab, 0xd5, 0xa9, 0x1d, 0x55, 0xbb, 0xa9, 0x36, + 0xae, 0xce, 0x52, 0x77, 0x52, 0x8f, 0x50, 0xcf, 0x51, 0x5f, 0xa3, 0xbe, + 0x5f, 0xfd, 0x82, 0xfa, 0x63, 0x0d, 0xb2, 0x86, 0x85, 0x46, 0xa0, 0x86, + 0x48, 0xa3, 0x54, 0x63, 0xb7, 0xc6, 0x19, 0x8d, 0x21, 0x16, 0xc6, 0x32, + 0x65, 0xf1, 0x58, 0x42, 0xd6, 0x72, 0x56, 0x03, 0xeb, 0x2c, 0x6b, 0x98, + 0x4d, 0x62, 0x5b, 0xb2, 0xf9, 0xec, 0x4c, 0x76, 0x05, 0xfb, 0x1b, 0x76, + 0x2f, 0x7b, 0x4c, 0x53, 0x43, 0x73, 0xaa, 0x66, 0xac, 0x66, 0x91, 0x66, + 0x9d, 0xe6, 0x71, 0xcd, 0x01, 0x0e, 0xc6, 0xb1, 0xe0, 0xf0, 0x39, 0xd9, + 0x9c, 0x4a, 0xce, 0x21, 0xce, 0x0d, 0xce, 0x7b, 0x2d, 0x03, 0x2d, 0x3f, + 0x2d, 0xb1, 0xd6, 0x6a, 0xad, 0x66, 0xad, 0x7e, 0xad, 0x37, 0xda, 0x7a, + 0xda, 0xbe, 0xda, 0x62, 0xed, 0x72, 0xed, 0x16, 0xed, 0xeb, 0xda, 0xef, + 0x75, 0x70, 0x9d, 0x40, 0x9d, 0x2c, 0x9d, 0xf5, 0x3a, 0x6d, 0x3a, 0xf7, + 0x75, 0x09, 0xba, 0x36, 0xba, 0x51, 0xba, 0x85, 0xba, 0xdb, 0x75, 0xcf, + 0xea, 0x3e, 0xd3, 0x63, 0xeb, 0x79, 0xe9, 0x09, 0xf5, 0xca, 0xf5, 0x0e, + 0xe9, 0xdd, 0xd1, 0x47, 0xf5, 0x6d, 0xf4, 0xa3, 0xf5, 0x17, 0xea, 0xef, + 0xd6, 0xef, 0xd1, 0x1f, 0x37, 0x30, 0x34, 0x08, 0x36, 0x90, 0x19, 0x6c, + 0x31, 0x38, 0x63, 0xf0, 0xcc, 0x90, 0x63, 0xe8, 0x6b, 0x98, 0x69, 0xb8, + 0xd1, 0xf0, 0x84, 0xe1, 0xa8, 0x11, 0xcb, 0x68, 0xba, 0x91, 0xc4, 0x68, + 0xa3, 0xd1, 0x49, 0xa3, 0x27, 0xb8, 0x26, 0xee, 0x87, 0x67, 0xe3, 0x35, + 0x78, 0x17, 0x3e, 0x66, 0xac, 0x6f, 0x1c, 0x62, 0xac, 0x34, 0xde, 0x65, + 0xdc, 0x6b, 0x3c, 0x61, 0x62, 0x69, 0x32, 0xdb, 0xa4, 0xc4, 0xa4, 0xc5, + 0xe4, 0xbe, 0x29, 0xcd, 0x94, 0x6b, 0x9a, 0x66, 0xba, 0xd1, 0xb4, 0xd3, + 0x74, 0xcc, 0xcc, 0xc8, 0x2c, 0xdc, 0xac, 0xd8, 0xac, 0xc9, 0xec, 0x8e, + 0x39, 0xd5, 0x9c, 0x6b, 0x9e, 0x61, 0xbe, 0xd9, 0xbc, 0xdb, 0xfc, 0x8d, + 0x85, 0xa5, 0x45, 0x9c, 0xc5, 0x4a, 0x8b, 0x36, 0x8b, 0xc7, 0x96, 0xda, + 0x96, 0x7c, 0xcb, 0x05, 0x96, 0x4d, 0x96, 0xf7, 0xac, 0x98, 0x56, 0x3e, + 0x56, 0x79, 0x56, 0xf5, 0x56, 0xd7, 0xac, 0x49, 0xd6, 0x5c, 0xeb, 0x2c, + 0xeb, 0x6d, 0xd6, 0x57, 0x6c, 0x50, 0x1b, 0x57, 0x9b, 0x0c, 0x9b, 0x3a, + 0x9b, 0xcb, 0xb6, 0xa8, 0xad, 0x9b, 0xad, 0xc4, 0x76, 0x9b, 0x6d, 0xdf, + 0x14, 0xe2, 0x14, 0x8f, 0x29, 0xd2, 0x29, 0xf5, 0x53, 0x6e, 0xda, 0x31, + 0xec, 0xfc, 0xec, 0x0a, 0xec, 0x9a, 0xec, 0x06, 0xed, 0x39, 0xf6, 0x61, + 0xf6, 0x25, 0xf6, 0x6d, 0xf6, 0xcf, 0x1d, 0xcc, 0x1c, 0x12, 0x1d, 0xd6, + 0x3b, 0x74, 0x3b, 0x7c, 0x72, 0x74, 0x75, 0xcc, 0x76, 0x6c, 0x70, 0xbc, + 0xeb, 0xa4, 0xe1, 0x34, 0xc3, 0xa9, 0xc4, 0xa9, 0xc3, 0xe9, 0x57, 0x67, + 0x1b, 0x67, 0xa1, 0x73, 0x9d, 0xf3, 0x35, 0x17, 0xa6, 0x4b, 0x90, 0xcb, + 0x12, 0x97, 0x76, 0x97, 0x17, 0x53, 0x6d, 0xa7, 0x8a, 0xa7, 0x6e, 0x9f, + 0x7a, 0xcb, 0x95, 0xe5, 0x1a, 0xee, 0xba, 0xd2, 0xb5, 0xd3, 0xf5, 0xa3, + 0x9b, 0xbb, 0x9b, 0xdc, 0xad, 0xd9, 0x6d, 0xd4, 0xdd, 0xcc, 0x3d, 0xc5, + 0x7d, 0xab, 0xfb, 0x4d, 0x2e, 0x9b, 0x1b, 0xc9, 0x5d, 0xc3, 0x3d, 0xef, + 0x41, 0xf4, 0xf0, 0xf7, 0x58, 0xe2, 0x71, 0xcc, 0xe3, 0x9d, 0xa7, 0x9b, + 0xa7, 0xc2, 0xf3, 0x90, 0xe7, 0x2f, 0x5e, 0x76, 0x5e, 0x59, 0x5e, 0xfb, + 0xbd, 0x1e, 0x4f, 0xb3, 0x9c, 0x26, 0x9e, 0xd6, 0x30, 0x6d, 0xc8, 0xdb, + 0xc4, 0x5b, 0xe0, 0xbd, 0xcb, 0x7b, 0x60, 0x3a, 0x3e, 0x3d, 0x65, 0xfa, + 0xce, 0xe9, 0x03, 0x3e, 0xc6, 0x3e, 0x02, 0x9f, 0x7a, 0x9f, 0x87, 0xbe, + 0xa6, 0xbe, 0x22, 0xdf, 0x3d, 0xbe, 0x23, 0x7e, 0xd6, 0x7e, 0x99, 0x7e, + 0x07, 0xfc, 0x9e, 0xfb, 0x3b, 0xfa, 0xcb, 0xfd, 0x8f, 0xf8, 0xbf, 0xe1, + 0x79, 0xf2, 0x16, 0xf1, 0x4e, 0x05, 0x60, 0x01, 0xc1, 0x01, 0xe5, 0x01, + 0xbd, 0x81, 0x1a, 0x81, 0xb3, 0x03, 0x6b, 0x03, 0x1f, 0x04, 0x99, 0x04, + 0xa5, 0x07, 0x35, 0x05, 0x8d, 0x05, 0xbb, 0x06, 0x2f, 0x0c, 0x3e, 0x15, + 0x42, 0x0c, 0x09, 0x0d, 0x59, 0x1f, 0x72, 0x93, 0x6f, 0xc0, 0x17, 0xf2, + 0x1b, 0xf9, 0x63, 0x33, 0xdc, 0x67, 0x2c, 0x9a, 0xd1, 0x15, 0xca, 0x08, + 0x9d, 0x15, 0x5a, 0x1b, 0xfa, 0x30, 0xcc, 0x26, 0x4c, 0x1e, 0xd6, 0x11, + 0x8e, 0x86, 0xcf, 0x08, 0xdf, 0x10, 0x7e, 0x6f, 0xa6, 0xf9, 0x4c, 0xe9, + 0xcc, 0xb6, 0x08, 0x88, 0xe0, 0x47, 0x6c, 0x88, 0xb8, 0x1f, 0x69, 0x19, + 0x99, 0x17, 0xf9, 0x7d, 0x14, 0x29, 0x2a, 0x32, 0xaa, 0x2e, 0xea, 0x51, + 0xb4, 0x53, 0x74, 0x71, 0x74, 0xf7, 0x2c, 0xd6, 0xac, 0xe4, 0x59, 0xfb, + 0x67, 0xbd, 0x8e, 0xf1, 0x8f, 0xa9, 0x8c, 0xb9, 0x3b, 0xdb, 0x6a, 0xb6, + 0x72, 0x76, 0x67, 0xac, 0x6a, 0x6c, 0x52, 0x6c, 0x63, 0xec, 0x9b, 0xb8, + 0x80, 0xb8, 0xaa, 0xb8, 0x81, 0x78, 0x87, 0xf8, 0x45, 0xf1, 0x97, 0x12, + 0x74, 0x13, 0x24, 0x09, 0xed, 0x89, 0xe4, 0xc4, 0xd8, 0xc4, 0x3d, 0x89, + 0xe3, 0x73, 0x02, 0xe7, 0x6c, 0x9a, 0x33, 0x9c, 0xe4, 0x9a, 0x54, 0x96, + 0x74, 0x63, 0xae, 0xe5, 0xdc, 0xa2, 0xb9, 0x17, 0xe6, 0xe9, 0xce, 0xcb, + 0x9e, 0x77, 0x3c, 0x59, 0x35, 0x59, 0x90, 0x7c, 0x38, 0x85, 0x98, 0x12, + 0x97, 0xb2, 0x3f, 0xe5, 0x83, 0x20, 0x42, 0x50, 0x2f, 0x18, 0x4f, 0xe5, + 0xa7, 0x6e, 0x4d, 0x1d, 0x13, 0xf2, 0x84, 0x9b, 0x85, 0x4f, 0x45, 0xbe, + 0xa2, 0x8d, 0xa2, 0x51, 0xb1, 0xb7, 0xb8, 0x4a, 0x3c, 0x92, 0xe6, 0x9d, + 0x56, 0x95, 0xf6, 0x38, 0xdd, 0x3b, 0x7d, 0x43, 0xfa, 0x68, 0x86, 0x4f, + 0x46, 0x75, 0xc6, 0x33, 0x09, 0x4f, 0x52, 0x2b, 0x79, 0x91, 0x19, 0x92, + 0xb9, 0x23, 0xf3, 0x4d, 0x56, 0x44, 0xd6, 0xde, 0xac, 0xcf, 0xd9, 0x71, + 0xd9, 0x2d, 0x39, 0x94, 0x9c, 0x94, 0x9c, 0xa3, 0x52, 0x0d, 0x69, 0x96, + 0xb4, 0x2b, 0xd7, 0x30, 0xb7, 0x28, 0xb7, 0x4f, 0x66, 0x2b, 0x2b, 0x93, + 0x0d, 0xe4, 0x79, 0xe6, 0x6d, 0xca, 0x1b, 0x93, 0x87, 0xca, 0xf7, 0xe4, + 0x23, 0xf9, 0x73, 0xf3, 0xdb, 0x15, 0x6c, 0x85, 0x4c, 0xd1, 0xa3, 0xb4, + 0x52, 0xae, 0x50, 0x0e, 0x16, 0x4c, 0x2f, 0xa8, 0x2b, 0x78, 0x5b, 0x18, + 0x5b, 0x78, 0xb8, 0x48, 0xbd, 0x48, 0x5a, 0xd4, 0x33, 0xdf, 0x66, 0xfe, + 0xea, 0xf9, 0x23, 0x0b, 0x82, 0x16, 0x7c, 0xbd, 0x90, 0xb0, 0x50, 0xb8, + 0xb0, 0xb3, 0xd8, 0xb8, 0x78, 0x59, 0xf1, 0xe0, 0x22, 0xbf, 0x45, 0xbb, + 0x16, 0x23, 0x8b, 0x53, 0x17, 0x77, 0x2e, 0x31, 0x5d, 0x52, 0xba, 0x64, + 0x78, 0x69, 0xf0, 0xd2, 0x7d, 0xcb, 0x68, 0xcb, 0xb2, 0x96, 0xfd, 0x50, + 0xe2, 0x58, 0x52, 0x55, 0xf2, 0x6a, 0x79, 0xdc, 0xf2, 0x8e, 0x52, 0x83, + 0xd2, 0xa5, 0xa5, 0x43, 0x2b, 0x82, 0x57, 0x34, 0x95, 0xa9, 0x94, 0xc9, + 0xcb, 0x6e, 0xae, 0xf4, 0x5a, 0xb9, 0x63, 0x15, 0x61, 0x95, 0x64, 0x55, + 0xef, 0x6a, 0x97, 0xd5, 0x5b, 0x56, 0x7f, 0x2a, 0x17, 0x95, 0x5f, 0xac, + 0x70, 0xac, 0xa8, 0xae, 0xf8, 0xb0, 0x46, 0xb8, 0xe6, 0xe2, 0x57, 0x4e, + 0x5f, 0xd5, 0x7c, 0xf5, 0x79, 0x6d, 0xda, 0xda, 0xde, 0x4a, 0xb7, 0xca, + 0xed, 0xeb, 0x48, 0xeb, 0xa4, 0xeb, 0x6e, 0xac, 0xf7, 0x59, 0xbf, 0xaf, + 0x4a, 0xbd, 0x6a, 0x41, 0xd5, 0xd0, 0x86, 0xf0, 0x0d, 0xad, 0x1b, 0xf1, + 0x8d, 0xe5, 0x1b, 0x5f, 0x6d, 0x4a, 0xde, 0x74, 0xa1, 0x7a, 0x6a, 0xf5, + 0x8e, 0xcd, 0xb4, 0xcd, 0xca, 0xcd, 0x03, 0x35, 0x61, 0x35, 0xed, 0x5b, + 0xcc, 0xb6, 0xac, 0xdb, 0xf2, 0xa1, 0x36, 0xa3, 0xf6, 0x7a, 0x9d, 0x7f, + 0x5d, 0xcb, 0x56, 0xfd, 0xad, 0xab, 0xb7, 0xbe, 0xd9, 0x26, 0xda, 0xd6, + 0xbf, 0xdd, 0x77, 0x7b, 0xf3, 0x0e, 0x83, 0x1d, 0x15, 0x3b, 0xde, 0xef, + 0x94, 0xec, 0xbc, 0xb5, 0x2b, 0x78, 0x57, 0x6b, 0xbd, 0x45, 0x7d, 0xf5, + 0x6e, 0xd2, 0xee, 0x82, 0xdd, 0x8f, 0x1a, 0x62, 0x1b, 0xba, 0xbf, 0xe6, + 0x7e, 0xdd, 0xb8, 0x47, 0x77, 0x4f, 0xc5, 0x9e, 0x8f, 0x7b, 0xa5, 0x7b, + 0x07, 0xf6, 0x45, 0xef, 0xeb, 0x6a, 0x74, 0x6f, 0x6c, 0xdc, 0xaf, 0xbf, + 0xbf, 0xb2, 0x09, 0x6d, 0x52, 0x36, 0x8d, 0x1e, 0x48, 0x3a, 0x70, 0xe5, + 0x9b, 0x80, 0x6f, 0xda, 0x9b, 0xed, 0x9a, 0x77, 0xb5, 0x70, 0x5a, 0x2a, + 0x0e, 0xc2, 0x41, 0xe5, 0xc1, 0x27, 0xdf, 0xa6, 0x7c, 0x7b, 0xe3, 0x50, + 0xe8, 0xa1, 0xce, 0xc3, 0xdc, 0xc3, 0xcd, 0xdf, 0x99, 0x7f, 0xb7, 0xf5, + 0x08, 0xeb, 0x48, 0x79, 0x2b, 0xd2, 0x3a, 0xbf, 0x75, 0xac, 0x2d, 0xa3, + 0x6d, 0xa0, 0x3d, 0xa1, 0xbd, 0xef, 0xe8, 0x8c, 0xa3, 0x9d, 0x1d, 0x5e, + 0x1d, 0x47, 0xbe, 0xb7, 0xff, 0x7e, 0xef, 0x31, 0xe3, 0x63, 0x75, 0xc7, + 0x35, 0x8f, 0x57, 0x9e, 0xa0, 0x9d, 0x28, 0x3d, 0xf1, 0xf9, 0xe4, 0x82, + 0x93, 0xe3, 0xa7, 0x64, 0xa7, 0x9e, 0x9d, 0x4e, 0x3f, 0x3d, 0xd4, 0x99, + 0xdc, 0x79, 0xf7, 0x4c, 0xfc, 0x99, 0x6b, 0x5d, 0x51, 0x5d, 0xbd, 0x67, + 0x43, 0xcf, 0x9e, 0x3f, 0x17, 0x74, 0xee, 0x4c, 0xb7, 0x5f, 0xf7, 0xc9, + 0xf3, 0xde, 0xe7, 0x8f, 0x5d, 0xf0, 0xbc, 0x70, 0xf4, 0x22, 0xf7, 0x62, + 0xdb, 0x25, 0xb7, 0x4b, 0xad, 0x3d, 0xae, 0x3d, 0x47, 0x7e, 0x70, 0xfd, + 0xe1, 0x48, 0xaf, 0x5b, 0x6f, 0xeb, 0x65, 0xf7, 0xcb, 0xed, 0x57, 0x3c, + 0xae, 0x74, 0xf4, 0x4d, 0xeb, 0x3b, 0xd1, 0xef, 0xd3, 0x7f, 0xfa, 0x6a, + 0xc0, 0xd5, 0x73, 0xd7, 0xf8, 0xd7, 0x2e, 0x5d, 0x9f, 0x79, 0xbd, 0xef, + 0xc6, 0xec, 0x1b, 0xb7, 0x6e, 0x26, 0xdd, 0x1c, 0xb8, 0x25, 0xba, 0xf5, + 0xf8, 0x76, 0xf6, 0xed, 0x17, 0x77, 0x0a, 0xee, 0x4c, 0xdc, 0x5d, 0x7a, + 0x8f, 0x78, 0xaf, 0xfc, 0xbe, 0xda, 0xfd, 0xea, 0x07, 0xfa, 0x0f, 0xea, + 0x7f, 0xb4, 0xfe, 0xb1, 0x65, 0xc0, 0x6d, 0xe0, 0xf8, 0x60, 0xc0, 0x60, + 0xcf, 0xc3, 0x59, 0x0f, 0xef, 0x0e, 0x09, 0x87, 0x9e, 0xfe, 0x94, 0xff, + 0xd3, 0x87, 0xe1, 0xd2, 0x47, 0xcc, 0x47, 0xd5, 0x23, 0x46, 0x23, 0x8d, + 0x8f, 0x9d, 0x1f, 0x1f, 0x1b, 0x0d, 0x1a, 0xbd, 0xf2, 0x64, 0xce, 0x93, + 0xe1, 0xa7, 0xb2, 0xa7, 0x13, 0xcf, 0xca, 0x7e, 0x56, 0xff, 0x79, 0xeb, + 0x73, 0xab, 0xe7, 0xdf, 0xfd, 0xe2, 0xfb, 0x4b, 0xcf, 0x58, 0xfc, 0xd8, + 0xf0, 0x0b, 0xf9, 0x8b, 0xcf, 0xbf, 0xae, 0x79, 0xa9, 0xf3, 0x72, 0xef, + 0xab, 0xa9, 0xaf, 0x3a, 0xc7, 0x23, 0xc7, 0x1f, 0xbc, 0xce, 0x79, 0x3d, + 0xf1, 0xa6, 0xfc, 0xad, 0xce, 0xdb, 0x7d, 0xef, 0xb8, 0xef, 0xba, 0xdf, + 0xc7, 0xbd, 0x1f, 0x99, 0x28, 0xfc, 0x40, 0xfe, 0x50, 0xf3, 0xd1, 0xfa, + 0x63, 0xc7, 0xa7, 0xd0, 0x4f, 0xf7, 0x3e, 0xe7, 0x7c, 0xfe, 0xfc, 0x2f, + 0xf7, 0x84, 0xf3, 0xfb, 0x80, 0x39, 0x25, 0x11, 0x00, 0x00, 0x00, 0x06, + 0x62, 0x4b, 0x47, 0x44, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0xa0, 0xbd, + 0xa7, 0x93, 0x00, 0x00, 0x00, 0x09, 0x70, 0x48, 0x59, 0x73, 0x00, 0x00, + 0x0b, 0x13, 0x00, 0x00, 0x0b, 0x13, 0x01, 0x00, 0x9a, 0x9c, 0x18, 0x00, + 0x00, 0x00, 0x07, 0x74, 0x49, 0x4d, 0x45, 0x07, 0xdc, 0x02, 0x07, 0x10, + 0x2f, 0x03, 0xd9, 0x0c, 0xd7, 0x8a, 0x00, 0x00, 0x20, 0x00, 0x49, 0x44, + 0x41, 0x54, 0x78, 0xda, 0xed, 0x7d, 0x79, 0x78, 0x54, 0x55, 0xd2, 0xf7, + 0xef, 0xf6, 0x9e, 0x74, 0xa7, 0x3b, 0xfb, 0x4a, 0x16, 0x08, 0x21, 0x21, + 0x21, 0x2c, 0xb2, 0x89, 0xec, 0x4b, 0x10, 0x71, 0x19, 0x96, 0x41, 0x5e, + 0x51, 0x14, 0x5e, 0xb7, 0x6f, 0x5c, 0x50, 0x04, 0x1d, 0x66, 0x5e, 0x54, + 0x70, 0x1c, 0x07, 0x17, 0x44, 0x65, 0x90, 0x51, 0x71, 0x14, 0x91, 0x45, + 0x05, 0x71, 0xd0, 0x80, 0x03, 0x01, 0x45, 0x20, 0x42, 0x58, 0x43, 0xd8, + 0x21, 0x64, 0x4f, 0xc8, 0x9e, 0x5e, 0x92, 0xf4, 0x7e, 0xbf, 0x3f, 0x72, + 0xef, 0xcd, 0xb9, 0x9d, 0xdb, 0x5b, 0xd2, 0x09, 0x38, 0xd3, 0xf5, 0x3c, + 0xf7, 0x81, 0x4e, 0xdf, 0x3e, 0xa7, 0x4e, 0x9d, 0x3a, 0x55, 0x75, 0xea, + 0x54, 0xd5, 0xa1, 0x68, 0x9a, 0x86, 0x1f, 0xfc, 0xe0, 0x07, 0x3f, 0xf8, + 0xc1, 0x0f, 0x7e, 0xf8, 0xef, 0x02, 0x91, 0x9f, 0x04, 0x7e, 0xf0, 0x83, + 0x1f, 0xfc, 0xe0, 0x07, 0x3f, 0xf8, 0x0d, 0x00, 0x3f, 0xf8, 0xc1, 0x0f, + 0x7e, 0xf0, 0x83, 0x1f, 0xfc, 0xe0, 0x37, 0x00, 0xfc, 0xe0, 0x07, 0x3f, + 0xf8, 0xc1, 0x0f, 0x7e, 0xf0, 0xc3, 0x7f, 0x22, 0x48, 0xc8, 0x0f, 0x14, + 0x45, 0xf9, 0xa4, 0xd1, 0xae, 0xc4, 0x15, 0xf8, 0x02, 0x07, 0xb6, 0x7f, + 0x6f, 0xda, 0x72, 0x87, 0x73, 0x57, 0xf1, 0xf2, 0x96, 0x26, 0x3d, 0xd1, + 0x9f, 0xaf, 0xe6, 0xdb, 0x13, 0x1c, 0x3c, 0xed, 0xcb, 0x11, 0xef, 0xee, + 0xc2, 0xb1, 0xbb, 0xe7, 0xbb, 0x2b, 0xbc, 0x78, 0x33, 0xa0, 0x33, 0x73, + 0xf5, 0x5b, 0x92, 0x09, 0x5d, 0xc5, 0xa1, 0xab, 0x78, 0x08, 0xf5, 0xdd, + 0xd9, 0x35, 0xd1, 0xd5, 0xdf, 0xf6, 0x34, 0xdd, 0x6f, 0x05, 0xfa, 0xf7, + 0xb4, 0x6c, 0xf6, 0xa6, 0xcd, 0xce, 0x8e, 0xcb, 0x17, 0xf1, 0x7b, 0x54, + 0x77, 0x0a, 0xa8, 0x9e, 0x56, 0x7a, 0xdd, 0x81, 0xb3, 0x2f, 0x71, 0xba, + 0x19, 0x4a, 0xb9, 0x2b, 0xc2, 0xe3, 0x66, 0xce, 0x41, 0x4f, 0xe1, 0xf8, + 0x5b, 0xa4, 0xcf, 0x6f, 0x19, 0x7a, 0x42, 0x30, 0xde, 0x8a, 0x72, 0xc9, + 0x17, 0x72, 0xa5, 0xb3, 0xeb, 0xe2, 0x56, 0x93, 0xc3, 0xb7, 0xaa, 0x5e, + 0xf0, 0xf5, 0xa6, 0xa0, 0xa7, 0xe4, 0x7d, 0x57, 0x0c, 0x81, 0x6e, 0x3d, + 0x02, 0xa0, 0x28, 0xca, 0xe3, 0x01, 0xde, 0x2a, 0x42, 0x97, 0xc4, 0xb9, + 0xa7, 0x71, 0xea, 0x8e, 0xfe, 0x1c, 0xdb, 0xf4, 0x2b, 0x37, 0xdf, 0xf0, + 0xab, 0x1f, 0xba, 0x97, 0xc6, 0xff, 0x69, 0xf3, 0xe0, 0x8b, 0xf1, 0xfc, + 0x37, 0xf2, 0x66, 0x4f, 0x8e, 0xf9, 0xb7, 0xba, 0xfe, 0xbb, 0x82, 0xb7, + 0xe8, 0x3f, 0x6d, 0x12, 0x7f, 0xab, 0x38, 0x77, 0x67, 0x7f, 0x37, 0xcb, + 0xa0, 0xf1, 0xcf, 0xb7, 0x1f, 0x3a, 0x43, 0xef, 0x5b, 0x69, 0x2e, 0xfc, + 0x7c, 0xf1, 0xdf, 0x47, 0x7b, 0xa1, 0x7e, 0x7f, 0x0b, 0x7c, 0xd0, 0x19, + 0x1c, 0x25, 0xce, 0xbe, 0x48, 0x4c, 0x4c, 0xc4, 0x80, 0x01, 0x03, 0x38, + 0xb7, 0x53, 0x41, 0x41, 0x01, 0x4a, 0x4b, 0x4b, 0x79, 0xef, 0x3c, 0xfd, + 0xf4, 0xd3, 0x30, 0x18, 0x0c, 0xa8, 0xab, 0xab, 0x43, 0x61, 0x61, 0x21, + 0x2a, 0x2b, 0x2b, 0xa1, 0xd3, 0xe9, 0x7c, 0x32, 0x18, 0xa9, 0x54, 0x8a, + 0xb4, 0xb4, 0x34, 0xdc, 0x76, 0xdb, 0x6d, 0x00, 0x80, 0x3d, 0x7b, 0xf6, + 0xa0, 0xa6, 0xa6, 0x86, 0xf7, 0xce, 0x9f, 0xfe, 0xf4, 0x27, 0xe8, 0xf5, + 0x7a, 0x5c, 0xbe, 0x7c, 0x19, 0xfb, 0xf6, 0xed, 0x73, 0xda, 0x56, 0xaf, + 0x5e, 0xbd, 0x10, 0x15, 0x15, 0x85, 0x84, 0x84, 0x04, 0xc4, 0xc6, 0xc6, + 0x76, 0x1b, 0xce, 0x11, 0x11, 0x11, 0x18, 0x39, 0x72, 0x24, 0x00, 0xa0, + 0xa8, 0xa8, 0x08, 0x35, 0x35, 0x35, 0xa8, 0xad, 0xad, 0xed, 0xd2, 0xc4, + 0xf5, 0xee, 0xdd, 0x1b, 0xa1, 0xa1, 0xa1, 0x48, 0x4e, 0x4e, 0x86, 0x5a, + 0xad, 0x86, 0x56, 0xab, 0xc5, 0x8d, 0x1b, 0x37, 0x50, 0x5b, 0x5b, 0x8b, + 0xd2, 0xd2, 0x52, 0xb4, 0xb4, 0xb4, 0x74, 0x99, 0x39, 0xfa, 0xf4, 0xe9, + 0x83, 0xb0, 0xb0, 0x30, 0x24, 0x24, 0x24, 0x20, 0x24, 0x24, 0x04, 0x5a, + 0xad, 0x16, 0xe5, 0xe5, 0xe5, 0xa8, 0xaf, 0xaf, 0x47, 0x51, 0x51, 0x11, + 0x2c, 0x16, 0x8b, 0xe0, 0xef, 0x86, 0x0e, 0x1d, 0xea, 0x15, 0x4d, 0x15, + 0x0a, 0x05, 0xd4, 0x6a, 0x35, 0xa2, 0xa2, 0xa2, 0xb8, 0xbf, 0x35, 0x36, + 0x36, 0xc2, 0x6e, 0xb7, 0xa3, 0xb2, 0xb2, 0xd2, 0x6b, 0x7a, 0x27, 0x24, + 0x24, 0x20, 0x28, 0x28, 0xc8, 0x23, 0xd7, 0x1d, 0x45, 0x51, 0xd0, 0xe9, + 0x74, 0x1d, 0x78, 0xd8, 0x1d, 0xa8, 0xd5, 0x6a, 0x6e, 0x2d, 0x24, 0x25, + 0x25, 0x41, 0x24, 0x12, 0xa1, 0xbe, 0xbe, 0x1e, 0xa7, 0x4e, 0x9d, 0x42, + 0x4d, 0x4d, 0x0d, 0x8a, 0x8b, 0x8b, 0x3d, 0x6e, 0x2b, 0x3c, 0x3c, 0x1c, + 0x11, 0x11, 0x11, 0x10, 0x89, 0x44, 0x9d, 0x72, 0x85, 0xeb, 0xf5, 0xfa, + 0x0e, 0xf8, 0x3f, 0xf0, 0xc0, 0x03, 0x48, 0x4a, 0x4a, 0xc2, 0xdf, 0xfe, + 0xf6, 0x37, 0xa7, 0xbf, 0x4f, 0x4a, 0x4a, 0x82, 0x5a, 0xad, 0x46, 0x72, + 0x72, 0x32, 0x42, 0x43, 0x43, 0xd1, 0xdc, 0xdc, 0x8c, 0xea, 0xea, 0x6a, + 0x54, 0x57, 0x57, 0xa3, 0xac, 0xac, 0x0c, 0x7a, 0xbd, 0xbe, 0x4b, 0x7c, + 0x9f, 0x9c, 0x9c, 0x8c, 0xa8, 0xa8, 0x28, 0xa4, 0xa5, 0xa5, 0x21, 0x2a, + 0x2a, 0x8a, 0x5b, 0x93, 0x65, 0x65, 0x65, 0x28, 0x2e, 0x2e, 0x86, 0xd1, + 0x68, 0xf4, 0x99, 0x10, 0xeb, 0xee, 0x39, 0xf7, 0x44, 0x88, 0x46, 0x44, + 0x44, 0x74, 0x58, 0xd7, 0x9e, 0xc8, 0x2b, 0x57, 0xe0, 0x89, 0xbc, 0xed, + 0xee, 0xf5, 0xd4, 0x53, 0x3c, 0xdb, 0xd5, 0x79, 0x70, 0x94, 0x89, 0x1b, + 0x36, 0x6c, 0xf0, 0x39, 0xef, 0x7b, 0xca, 0x07, 0x9d, 0x91, 0xf7, 0x9e, + 0xf4, 0xe1, 0xcb, 0x35, 0xe5, 0x12, 0x68, 0x9a, 0x16, 0x9c, 0xd8, 0xcd, + 0x9b, 0x37, 0x73, 0xdf, 0xd1, 0x34, 0x8d, 0x47, 0x1e, 0x79, 0xc4, 0xe9, + 0x6f, 0x69, 0x9a, 0x46, 0x55, 0x55, 0x15, 0xde, 0x7d, 0xf7, 0x5d, 0xc8, + 0xe5, 0x72, 0xb7, 0x7d, 0x39, 0x3e, 0x42, 0x90, 0x9a, 0x9a, 0x8a, 0x73, + 0xe7, 0xce, 0x81, 0xa6, 0x69, 0xdc, 0xb8, 0x71, 0x03, 0x19, 0x19, 0x19, + 0x2e, 0xdb, 0x13, 0x82, 0xa0, 0xa0, 0x20, 0x8c, 0x1e, 0x3d, 0x1a, 0x87, + 0x0e, 0x1d, 0x82, 0xc9, 0x64, 0xea, 0xd0, 0xaf, 0x27, 0x38, 0x7b, 0x03, + 0x7f, 0xfe, 0xf3, 0x9f, 0xb9, 0xb6, 0xf7, 0xee, 0xdd, 0x8b, 0x98, 0x98, + 0x18, 0x8f, 0x68, 0x20, 0x04, 0x61, 0x61, 0x61, 0x78, 0xe0, 0x81, 0x07, + 0x70, 0xf2, 0xe4, 0x49, 0xd8, 0xed, 0xf6, 0x0e, 0xbf, 0xa9, 0xac, 0xac, + 0xc4, 0xdb, 0x6f, 0xbf, 0xcd, 0x5b, 0xfc, 0xde, 0x42, 0x64, 0x64, 0x24, + 0xe6, 0xcf, 0x9f, 0x8f, 0x0b, 0x17, 0x2e, 0x08, 0xf6, 0x51, 0x5a, 0x5a, + 0x8a, 0x67, 0x9e, 0x79, 0x06, 0x81, 0x81, 0x81, 0x1e, 0xcf, 0x69, 0x55, + 0x55, 0x95, 0xd3, 0x77, 0x33, 0x33, 0x33, 0x51, 0x56, 0x56, 0xc6, 0x7b, + 0xff, 0xc8, 0x91, 0x23, 0xe8, 0xdd, 0xbb, 0x77, 0xa7, 0xf0, 0x5f, 0xb5, + 0x6a, 0x15, 0xaa, 0xaa, 0xaa, 0x3c, 0x7e, 0x26, 0x4e, 0x9c, 0x28, 0x88, + 0xbf, 0x2b, 0x41, 0xf3, 0xde, 0x7b, 0xef, 0x41, 0xab, 0xd5, 0x0a, 0xce, + 0x5b, 0x4e, 0x4e, 0x0e, 0x00, 0x40, 0xa3, 0xd1, 0x78, 0x84, 0x6f, 0x7c, + 0x7c, 0x3c, 0x7e, 0xfc, 0xf1, 0x47, 0xaf, 0x70, 0x26, 0x9f, 0x15, 0x2b, + 0x56, 0x78, 0xbc, 0x7e, 0x59, 0xe1, 0x3d, 0x6f, 0xde, 0x3c, 0x9c, 0x38, + 0x71, 0x02, 0x16, 0x8b, 0xa5, 0x03, 0xfe, 0xb5, 0xb5, 0xb5, 0x78, 0xeb, + 0xad, 0xb7, 0x20, 0x91, 0x48, 0x3a, 0x45, 0x7f, 0x96, 0x47, 0xcf, 0x9d, + 0x3b, 0x27, 0xc8, 0x3f, 0x25, 0x25, 0x25, 0x98, 0x37, 0x6f, 0x1e, 0x42, + 0x42, 0x42, 0x3c, 0xe6, 0x9f, 0x9e, 0x9a, 0x73, 0x4f, 0xd7, 0xa1, 0xa7, + 0xd0, 0x55, 0x79, 0xe5, 0x89, 0xbc, 0xed, 0xca, 0x7a, 0x72, 0x36, 0x66, + 0x77, 0x74, 0xe8, 0x4e, 0x9e, 0xf5, 0x14, 0x07, 0x77, 0x32, 0xf1, 0x66, + 0xf0, 0x7e, 0x57, 0xe4, 0xbd, 0x2b, 0x5e, 0xeb, 0x8e, 0x35, 0xe5, 0x92, + 0xce, 0x9e, 0x32, 0xe4, 0xc3, 0x0f, 0x3f, 0xec, 0x51, 0x47, 0xfb, 0xf7, + 0xef, 0x47, 0x4a, 0x4a, 0x4a, 0x97, 0x0d, 0x80, 0x69, 0xd3, 0xa6, 0x71, + 0xdf, 0x6f, 0xda, 0xb4, 0x49, 0x50, 0xc8, 0xba, 0x6b, 0x43, 0x26, 0x93, + 0xa1, 0xbe, 0xbe, 0xde, 0x2d, 0x11, 0x5c, 0xe1, 0xec, 0x29, 0x84, 0x86, + 0x86, 0xa2, 0xa0, 0xa0, 0x80, 0xc7, 0x10, 0xd1, 0xd1, 0xd1, 0x9d, 0x32, + 0x00, 0x42, 0x43, 0x43, 0xf1, 0xe4, 0x93, 0x4f, 0xc2, 0x66, 0xb3, 0xb9, + 0xc5, 0xfd, 0xc2, 0x85, 0x0b, 0x18, 0x3c, 0x78, 0x70, 0xa7, 0x2c, 0xfb, + 0x8c, 0x8c, 0x0c, 0x41, 0x26, 0x73, 0x7c, 0x36, 0x6d, 0xda, 0x84, 0xf4, + 0xf4, 0x74, 0x8f, 0xe7, 0xd4, 0x59, 0x7f, 0x1f, 0x7d, 0xf4, 0x51, 0x87, + 0x77, 0x8f, 0x1c, 0x39, 0x82, 0xa4, 0xa4, 0xa4, 0x4e, 0x79, 0x5b, 0x76, + 0xef, 0xde, 0xed, 0x15, 0xb3, 0x67, 0x65, 0x65, 0x79, 0x6c, 0x00, 0x04, + 0x05, 0x05, 0x61, 0xfb, 0xf6, 0xed, 0x6e, 0xdb, 0xac, 0xaf, 0xaf, 0xc7, + 0x9c, 0x39, 0x73, 0x3c, 0x12, 0x24, 0x89, 0x89, 0x89, 0x38, 0x78, 0xf0, + 0xa0, 0x57, 0x38, 0x93, 0xcf, 0xeb, 0xaf, 0xbf, 0xee, 0xb1, 0x01, 0x10, + 0x16, 0x16, 0x86, 0x25, 0x4b, 0x96, 0x78, 0xc4, 0x43, 0x3b, 0x76, 0xec, + 0xc0, 0xc0, 0x81, 0x03, 0xbd, 0x56, 0xfe, 0x13, 0x26, 0x4c, 0xf0, 0x08, + 0xef, 0x95, 0x2b, 0x57, 0x3a, 0x9d, 0x63, 0x6f, 0x94, 0xb0, 0x2f, 0xe7, + 0xbc, 0xb3, 0x06, 0x40, 0x68, 0x68, 0x68, 0xb7, 0xc8, 0x2b, 0x4f, 0xe4, + 0x6d, 0x57, 0xd6, 0x53, 0x67, 0x94, 0x7f, 0x77, 0xf3, 0xac, 0x37, 0x78, + 0xb8, 0x92, 0x89, 0x3d, 0xcd, 0xfb, 0x5d, 0x95, 0xf7, 0xae, 0x0c, 0x9c, + 0xee, 0x58, 0x53, 0xae, 0x1e, 0x49, 0x57, 0x94, 0xde, 0xb2, 0x65, 0xcb, + 0x10, 0x17, 0x17, 0x87, 0xdf, 0xfd, 0xee, 0x77, 0x48, 0x48, 0x48, 0x00, + 0x00, 0x4c, 0x9a, 0x34, 0x09, 0x4b, 0x96, 0x2c, 0xc1, 0x8b, 0x2f, 0xbe, + 0xd8, 0x69, 0xd7, 0xa2, 0x46, 0xa3, 0xc1, 0x43, 0x0f, 0x3d, 0xc4, 0x7d, + 0xfe, 0xe2, 0x8b, 0x2f, 0xa0, 0xd5, 0x6a, 0x3b, 0xbc, 0xf7, 0xd6, 0x5b, + 0x6f, 0x21, 0x38, 0x38, 0x18, 0x4f, 0x3e, 0xf9, 0xa4, 0xa0, 0x45, 0xbe, + 0x77, 0xef, 0x5e, 0xde, 0x82, 0xcd, 0xce, 0xce, 0xc6, 0xa1, 0x43, 0x87, + 0x7c, 0x8a, 0x73, 0x48, 0x48, 0x08, 0x64, 0x32, 0x19, 0xbe, 0xf9, 0xe6, + 0x1b, 0x0c, 0x18, 0x30, 0xc0, 0xe3, 0xdd, 0xa5, 0x2b, 0x37, 0x50, 0x4a, + 0x4a, 0x0a, 0xd6, 0xae, 0x5d, 0x0b, 0x91, 0xa8, 0x3d, 0x44, 0xe3, 0xe8, + 0xd1, 0xa3, 0x28, 0x2f, 0x2f, 0x87, 0x44, 0x22, 0x41, 0x46, 0x46, 0x06, + 0x67, 0xb0, 0xf4, 0xef, 0xdf, 0x1f, 0xdb, 0xb6, 0x6d, 0xc3, 0xcc, 0x99, + 0x33, 0x71, 0xf1, 0xe2, 0x45, 0x8f, 0xf1, 0x1e, 0x3b, 0x76, 0x2c, 0x76, + 0xec, 0xd8, 0xc1, 0xf5, 0xaf, 0xd3, 0xe9, 0xf0, 0xc9, 0x27, 0x9f, 0x40, + 0xa7, 0xd3, 0x21, 0x29, 0x29, 0x09, 0xf7, 0xde, 0x7b, 0x2f, 0xc2, 0xc3, + 0xc3, 0x01, 0x00, 0x0f, 0x3d, 0xf4, 0x10, 0x64, 0x32, 0x19, 0x16, 0x2d, + 0x5a, 0x84, 0xea, 0xea, 0x6a, 0x5e, 0x3b, 0x8e, 0x34, 0x4d, 0x4c, 0x4c, + 0x14, 0xec, 0x6f, 0xf0, 0xe0, 0xc1, 0x4e, 0x77, 0x35, 0x9d, 0xd9, 0x7d, + 0x39, 0xba, 0x3e, 0x5b, 0x5b, 0x5b, 0x9d, 0x1e, 0x55, 0xb0, 0x60, 0x32, + 0x99, 0x3c, 0xf6, 0x8c, 0x3c, 0xfd, 0xf4, 0xd3, 0x98, 0x3d, 0x7b, 0x36, + 0xf7, 0xb7, 0x33, 0x67, 0xce, 0xe0, 0xcb, 0x2f, 0xbf, 0x84, 0xc9, 0x64, + 0xc2, 0xb8, 0x71, 0xe3, 0x30, 0x67, 0xce, 0x1c, 0x4e, 0x10, 0xac, 0x5b, + 0xb7, 0x0e, 0x97, 0x2e, 0x5d, 0x42, 0x41, 0x41, 0x81, 0xdb, 0xb9, 0x16, + 0x8b, 0xc5, 0x5d, 0xf2, 0xd6, 0x39, 0xc2, 0x99, 0x33, 0x67, 0x30, 0x64, + 0xc8, 0x90, 0x0e, 0x7f, 0x1f, 0x35, 0x6a, 0x14, 0x56, 0xad, 0x5a, 0xc5, + 0xf1, 0x90, 0xdd, 0x6e, 0xc7, 0xd6, 0xad, 0x5b, 0x71, 0xf9, 0xf2, 0x65, + 0x44, 0x45, 0x45, 0x61, 0xca, 0x94, 0x29, 0x48, 0x4d, 0x4d, 0x05, 0x00, + 0xcc, 0x9a, 0x35, 0x0b, 0x0a, 0x85, 0x02, 0x4f, 0x3c, 0xf1, 0x04, 0x2a, + 0x2a, 0x2a, 0x3c, 0xc2, 0x65, 0xe0, 0xc0, 0x81, 0xbc, 0x63, 0x37, 0x9a, + 0xa6, 0xf1, 0xfd, 0xf7, 0xdf, 0xe3, 0xd2, 0xa5, 0x4b, 0x08, 0x0e, 0x0e, + 0x46, 0x56, 0x56, 0x16, 0xb7, 0x13, 0x7d, 0xe5, 0x95, 0x57, 0x20, 0x97, + 0xcb, 0xf1, 0xc6, 0x1b, 0x6f, 0xb8, 0x3c, 0x6e, 0x73, 0xe7, 0x76, 0xed, + 0xce, 0x39, 0xf7, 0x66, 0x9d, 0x8f, 0x1b, 0x37, 0xae, 0x53, 0xf2, 0xca, + 0x97, 0xe0, 0xeb, 0xf5, 0xd4, 0x93, 0x3c, 0xeb, 0x4b, 0x99, 0x38, 0x6a, + 0xd4, 0xa8, 0x1e, 0xe5, 0xfd, 0xae, 0xca, 0xfb, 0x9e, 0x5e, 0x53, 0x9d, + 0x3e, 0x02, 0xb8, 0xfb, 0xee, 0xbb, 0xb1, 0x79, 0xf3, 0x66, 0xee, 0xe9, + 0xdf, 0xbf, 0xbf, 0xcb, 0xc9, 0x2a, 0x2a, 0x2a, 0xe2, 0xda, 0x6a, 0x68, + 0x68, 0x40, 0x66, 0x66, 0x66, 0xa7, 0x77, 0x8b, 0x19, 0x19, 0x19, 0xa8, + 0xad, 0xad, 0x05, 0x4d, 0xd3, 0xc8, 0xcf, 0xcf, 0x17, 0xdc, 0x9d, 0x07, + 0x04, 0x04, 0x00, 0x80, 0xd3, 0x9d, 0xd7, 0xf3, 0xcf, 0x3f, 0xcf, 0xeb, + 0x67, 0xc5, 0x8a, 0x15, 0x9c, 0xab, 0xdf, 0x1b, 0x9c, 0x23, 0x23, 0x23, + 0x05, 0xad, 0xe2, 0x47, 0x1e, 0x79, 0x04, 0xcb, 0x96, 0x2d, 0xc3, 0x57, + 0x5f, 0x7d, 0x85, 0xf2, 0xf2, 0xf2, 0x0e, 0xe3, 0xda, 0xbb, 0x77, 0xaf, + 0xa0, 0x7b, 0xde, 0xdd, 0xf8, 0xc3, 0xc3, 0xc3, 0xf1, 0xdd, 0x77, 0xdf, + 0x71, 0xdf, 0xdb, 0x6c, 0x36, 0xfc, 0xfe, 0xf7, 0xbf, 0x47, 0x64, 0x64, + 0x24, 0xe4, 0x72, 0x39, 0x34, 0x1a, 0x0d, 0xd2, 0xd2, 0xd2, 0x70, 0xe6, + 0xcc, 0x99, 0x0e, 0x96, 0x36, 0xb9, 0x38, 0x5c, 0x41, 0x52, 0x52, 0x12, + 0x8e, 0x1f, 0x3f, 0xce, 0xfd, 0xf6, 0xec, 0xd9, 0xb3, 0x08, 0x0c, 0x0c, + 0xe4, 0x68, 0xa9, 0x52, 0xa9, 0x10, 0x17, 0x17, 0x07, 0xa3, 0xd1, 0xc8, + 0xbd, 0x63, 0x34, 0x1a, 0x31, 0x68, 0xd0, 0xa0, 0x0e, 0x6d, 0x39, 0xd2, + 0xd4, 0x99, 0x2b, 0x3d, 0x37, 0x37, 0x97, 0x3b, 0x56, 0xa8, 0xa9, 0xa9, + 0xe1, 0xed, 0x58, 0x9c, 0x19, 0x0d, 0xae, 0x20, 0x3d, 0x3d, 0x9d, 0xa3, + 0x7b, 0x63, 0x63, 0x23, 0xfa, 0xf5, 0xeb, 0x87, 0xf4, 0xf4, 0x74, 0xa4, + 0xa7, 0xa7, 0x23, 0x23, 0x23, 0xa3, 0xc3, 0x33, 0x60, 0xc0, 0x00, 0xc4, + 0xc7, 0xc7, 0x7b, 0xd4, 0xf6, 0xe4, 0xc9, 0x93, 0x61, 0xb5, 0x5a, 0x39, + 0x1c, 0xbf, 0xf8, 0xe2, 0x0b, 0xc4, 0xc5, 0xc5, 0x71, 0xdf, 0x07, 0x06, + 0x06, 0x62, 0xe9, 0xd2, 0xa5, 0x3c, 0xfa, 0x2f, 0x5f, 0xbe, 0xbc, 0x43, + 0x3b, 0x36, 0x9b, 0x8d, 0xf7, 0x39, 0x2e, 0x2e, 0x0e, 0x99, 0x99, 0x99, + 0x98, 0x3a, 0x75, 0x2a, 0xb2, 0xb2, 0xb2, 0x3a, 0x3c, 0x53, 0xa6, 0x4c, + 0xc1, 0x94, 0x29, 0x53, 0x30, 0x79, 0xf2, 0x64, 0x4c, 0x98, 0x30, 0x01, + 0x7b, 0xf7, 0xee, 0xe5, 0xdc, 0x97, 0x25, 0x25, 0x25, 0xdc, 0x79, 0xa3, + 0x63, 0x9b, 0x42, 0x3c, 0x9b, 0x9d, 0x9d, 0xcd, 0xe1, 0x66, 0x36, 0x9b, + 0x91, 0x91, 0x91, 0x01, 0x95, 0x4a, 0xc5, 0x9b, 0x93, 0x43, 0x87, 0x0e, + 0xf1, 0xf8, 0xec, 0xf6, 0xdb, 0x6f, 0xf7, 0x88, 0x3e, 0xc9, 0xc9, 0xc9, + 0x38, 0x7d, 0xfa, 0x34, 0xf7, 0x5b, 0x9d, 0x4e, 0x87, 0xa1, 0x43, 0x87, + 0xf2, 0xd6, 0xa4, 0x5c, 0x2e, 0xc7, 0x89, 0x13, 0x27, 0xb8, 0x77, 0xf4, + 0x7a, 0xbd, 0xa0, 0xa7, 0xca, 0x9b, 0x1d, 0xb8, 0xaf, 0xe6, 0xdc, 0x9b, + 0xdd, 0xaf, 0xe3, 0x3a, 0xef, 0xac, 0xbc, 0x72, 0xd7, 0x97, 0xa7, 0xf2, + 0xb6, 0xb3, 0xeb, 0xa9, 0xb3, 0x47, 0x00, 0xdd, 0xc1, 0xb3, 0xde, 0xee, + 0xfe, 0x5d, 0xc9, 0xc4, 0x9e, 0xe0, 0x7d, 0x5f, 0xca, 0x7b, 0x67, 0x63, + 0xec, 0xae, 0x35, 0xd5, 0xe9, 0x23, 0x00, 0x6f, 0x61, 0xce, 0x9c, 0x39, + 0xbc, 0x86, 0x9f, 0x7e, 0xfa, 0xe9, 0x4e, 0xbb, 0xfc, 0x9e, 0x7c, 0xf2, + 0x49, 0xee, 0xfb, 0xd7, 0x5e, 0x7b, 0xcd, 0x63, 0xc5, 0x46, 0x4e, 0x18, + 0x39, 0xc1, 0x57, 0xaf, 0x5e, 0x45, 0x5a, 0x5a, 0x5a, 0xa7, 0x71, 0x76, + 0x84, 0xa7, 0x9e, 0x7a, 0xca, 0x2d, 0x61, 0x3b, 0x6b, 0x00, 0xf4, 0xef, + 0xdf, 0x9f, 0xb7, 0xa0, 0xbf, 0xfa, 0xea, 0x2b, 0xa7, 0x67, 0xcc, 0x06, + 0x83, 0x81, 0x7b, 0x2f, 0x2f, 0x2f, 0x0f, 0x7d, 0xfa, 0xf4, 0xf1, 0x08, + 0xff, 0xcc, 0xcc, 0x4c, 0x9e, 0x72, 0x7f, 0xea, 0xa9, 0xa7, 0x04, 0x8f, + 0x4f, 0x96, 0x2d, 0x5b, 0xc6, 0xc3, 0x75, 0xfe, 0xfc, 0xf9, 0x5e, 0xf3, + 0x85, 0x5c, 0x2e, 0xc7, 0x73, 0xcf, 0x3d, 0x07, 0x9a, 0xa6, 0x51, 0x5e, + 0x5e, 0x8e, 0xd4, 0xd4, 0x54, 0xde, 0xdc, 0x74, 0xc5, 0x00, 0x30, 0x9b, + 0xcd, 0xa0, 0x69, 0x1a, 0xb9, 0xb9, 0xb9, 0xe8, 0xd5, 0xab, 0x97, 0x4f, + 0x76, 0x3c, 0x1a, 0x8d, 0x06, 0x5b, 0xb7, 0x6e, 0xe5, 0xf0, 0xbb, 0x7e, + 0xfd, 0xba, 0xe0, 0x79, 0x6e, 0x44, 0x44, 0x04, 0xb6, 0x6e, 0xdd, 0x8a, + 0x6f, 0xbf, 0xfd, 0x16, 0xdf, 0x7e, 0xfb, 0x2d, 0x3e, 0xf9, 0xe4, 0x93, + 0x0e, 0xe7, 0x72, 0x5d, 0x59, 0x57, 0xe3, 0xc7, 0x8f, 0x47, 0x43, 0x43, + 0x03, 0x27, 0x0c, 0xa6, 0x4d, 0x9b, 0xe6, 0xf1, 0x6f, 0xd3, 0xd2, 0xd2, + 0x50, 0x58, 0x58, 0xc8, 0x8d, 0xe1, 0xeb, 0xaf, 0xbf, 0x46, 0x58, 0x58, + 0x98, 0xe0, 0x7b, 0x2c, 0x0d, 0x69, 0x9a, 0x16, 0xf4, 0xa4, 0x09, 0x41, + 0x56, 0x56, 0x16, 0x8f, 0x2f, 0xde, 0x7e, 0xfb, 0x6d, 0x28, 0x95, 0x4a, + 0xc1, 0xf6, 0x1b, 0x1b, 0x1b, 0x5d, 0x1a, 0x49, 0xee, 0xe2, 0x18, 0xba, + 0x63, 0xce, 0x3d, 0x15, 0xca, 0x42, 0xeb, 0xbc, 0xb3, 0xf2, 0xca, 0x57, + 0xf1, 0x06, 0x9d, 0x5d, 0x4f, 0x9d, 0x35, 0x00, 0xba, 0x83, 0x67, 0xbd, + 0xed, 0xdf, 0x1b, 0x99, 0xd8, 0x1d, 0xbc, 0xef, 0x4b, 0x79, 0xef, 0x6c, + 0x8c, 0xdd, 0xb5, 0xa6, 0xdc, 0x3d, 0x3e, 0x4b, 0x03, 0x3c, 0x7f, 0xfe, + 0x3c, 0xcf, 0x15, 0x31, 0x6d, 0xda, 0x34, 0x04, 0x07, 0x07, 0x7b, 0xed, + 0xea, 0x89, 0x8f, 0x8f, 0xc7, 0xdc, 0xb9, 0x73, 0x39, 0x17, 0xdf, 0xce, + 0x9d, 0x3b, 0x61, 0xb7, 0xdb, 0xbd, 0xc2, 0x45, 0xa9, 0x54, 0xf2, 0xdc, + 0xa2, 0x79, 0x79, 0x79, 0x28, 0x29, 0x29, 0xf1, 0x09, 0xce, 0x00, 0xa0, + 0xd5, 0x6a, 0xb9, 0x48, 0x52, 0xf6, 0x31, 0x18, 0x0c, 0x3e, 0x73, 0x35, + 0x46, 0x44, 0x44, 0x70, 0x9f, 0x7f, 0xfa, 0xe9, 0x27, 0x41, 0x77, 0x62, + 0x7c, 0x7c, 0x3c, 0x2e, 0x5c, 0xb8, 0xc0, 0xb3, 0x6a, 0x59, 0x6b, 0xd1, + 0x1d, 0xc4, 0xc6, 0xc6, 0xf2, 0x02, 0x1f, 0x0f, 0x1d, 0x3a, 0xd4, 0xe1, + 0x1d, 0xb3, 0xd9, 0x8c, 0x6b, 0xd7, 0xae, 0x75, 0x38, 0xa3, 0xf2, 0x16, + 0xd2, 0xd2, 0xd2, 0xf0, 0xc7, 0x3f, 0xfe, 0x91, 0x3b, 0xb2, 0xd1, 0xe9, + 0x74, 0x5d, 0x0a, 0xbc, 0x21, 0x77, 0x05, 0x52, 0xa9, 0x14, 0x00, 0x50, + 0x5a, 0x5a, 0xda, 0xe1, 0x68, 0xa2, 0xb3, 0x10, 0x1b, 0x1b, 0x8b, 0xb1, + 0x63, 0xc7, 0x72, 0x9f, 0x7f, 0xf8, 0xe1, 0x07, 0x5c, 0xbd, 0x7a, 0xb5, + 0xc3, 0x7b, 0x8d, 0x8d, 0x8d, 0x78, 0xec, 0xb1, 0xc7, 0x30, 0x7f, 0xfe, + 0x7c, 0x3c, 0xfc, 0xf0, 0xc3, 0x78, 0xe1, 0x85, 0x17, 0xba, 0x1c, 0x4d, + 0x4f, 0xba, 0x02, 0x3f, 0xff, 0xfc, 0x73, 0xce, 0xa0, 0x58, 0xb9, 0x72, + 0x25, 0x8e, 0x1c, 0x39, 0xe2, 0x95, 0x0b, 0x95, 0xe4, 0x85, 0xc2, 0xc2, + 0x42, 0xd4, 0xd7, 0xd7, 0x77, 0x78, 0x4f, 0x22, 0x91, 0xc0, 0x6c, 0x36, + 0x73, 0x9f, 0xc9, 0x5d, 0x92, 0x2b, 0x98, 0x34, 0x69, 0x12, 0xef, 0xf3, + 0xee, 0xdd, 0xbb, 0xd1, 0xdc, 0xdc, 0x2c, 0xb8, 0x4e, 0x8e, 0x1d, 0x3b, + 0xc6, 0x7d, 0xbe, 0xeb, 0xae, 0xbb, 0xb8, 0x63, 0xb7, 0x5b, 0x69, 0xce, + 0x3d, 0x5d, 0xe7, 0xdd, 0x25, 0xaf, 0x6e, 0x85, 0xf5, 0x74, 0xb3, 0x79, + 0xd6, 0x17, 0x32, 0xb1, 0xbb, 0x78, 0xbf, 0x3b, 0xe5, 0xfd, 0xcd, 0x5e, + 0x53, 0x3e, 0xe3, 0x1c, 0xb3, 0xd9, 0x8c, 0xa2, 0xa2, 0x22, 0xce, 0x4d, + 0x9c, 0x9c, 0x9c, 0x8c, 0xc8, 0xc8, 0x48, 0x34, 0x35, 0x35, 0x79, 0xd5, + 0x4e, 0x74, 0x74, 0x34, 0x46, 0x8f, 0x1e, 0x0d, 0x00, 0x38, 0x7c, 0xf8, + 0x70, 0xa7, 0x16, 0x79, 0x7c, 0x7c, 0x3c, 0xcf, 0x7a, 0x3a, 0x79, 0xf2, + 0x24, 0x5a, 0x5b, 0x5b, 0x7d, 0x86, 0xf3, 0xe1, 0xc3, 0x87, 0x31, 0x65, + 0xca, 0x14, 0x9e, 0x25, 0x25, 0x16, 0x8b, 0x71, 0xea, 0xd4, 0x29, 0x4e, + 0x40, 0x75, 0x45, 0xc8, 0x91, 0x0a, 0xe7, 0xcc, 0x99, 0x33, 0x82, 0xef, + 0x99, 0x4c, 0x26, 0x5e, 0xca, 0x49, 0x70, 0x70, 0xb0, 0xc7, 0x82, 0xe7, + 0xf4, 0xe9, 0xd3, 0x18, 0x32, 0x64, 0x08, 0x87, 0x7b, 0x63, 0x63, 0xa3, + 0xe0, 0x7b, 0x8e, 0x06, 0x85, 0xb7, 0xa9, 0x45, 0x51, 0x51, 0x51, 0x78, + 0xe1, 0x85, 0x17, 0x10, 0x13, 0x13, 0x83, 0xe3, 0xc7, 0x8f, 0x63, 0xd7, + 0xae, 0x5d, 0x5e, 0x7b, 0x73, 0x5c, 0xcd, 0x31, 0x0b, 0xf9, 0xf9, 0xf9, + 0x6e, 0xcf, 0x82, 0xbd, 0xa1, 0x3f, 0xe9, 0x56, 0x3f, 0x78, 0xf0, 0x20, + 0x4f, 0x50, 0xb0, 0x60, 0xb5, 0x5a, 0x61, 0xb5, 0x5a, 0x7d, 0x2e, 0x48, + 0xe3, 0xe2, 0xe2, 0xf0, 0xfa, 0xeb, 0xaf, 0x73, 0x01, 0x3e, 0xd9, 0xd9, + 0xd9, 0xf8, 0xe6, 0x9b, 0x6f, 0xbc, 0x32, 0x2e, 0x5a, 0x5b, 0x5b, 0x51, + 0x51, 0x51, 0xc1, 0x45, 0x25, 0x47, 0x47, 0x47, 0x43, 0x2e, 0x97, 0x77, + 0x38, 0x0f, 0x57, 0x28, 0x14, 0x3c, 0x7e, 0xbd, 0x72, 0xe5, 0x8a, 0xc7, + 0x46, 0x12, 0x09, 0xce, 0xd2, 0xdd, 0xaa, 0xaa, 0xaa, 0x78, 0xe7, 0xaa, + 0x29, 0x29, 0x29, 0x1e, 0x1b, 0x19, 0x3d, 0x39, 0xe7, 0x9e, 0xae, 0xf3, + 0xee, 0x92, 0x57, 0xb7, 0xc2, 0x7a, 0xba, 0xd9, 0x3c, 0xeb, 0x0b, 0x99, + 0xd8, 0x5d, 0xbc, 0xdf, 0x9d, 0xf2, 0xfe, 0x66, 0xaf, 0x29, 0x09, 0xe9, + 0x32, 0xe8, 0x4a, 0xb1, 0x03, 0xbd, 0x5e, 0xcf, 0x43, 0x3a, 0x26, 0x26, + 0xc6, 0x6b, 0xcb, 0x54, 0x2c, 0x16, 0x63, 0xf6, 0xec, 0xd9, 0x90, 0xc9, + 0x64, 0x00, 0xda, 0x22, 0x63, 0x3b, 0x93, 0xcf, 0xea, 0xe8, 0x0a, 0x77, + 0x96, 0xab, 0xdd, 0x59, 0x9c, 0x85, 0xbc, 0x09, 0xfd, 0xfb, 0xf7, 0x87, + 0xd5, 0x6a, 0xed, 0x32, 0x43, 0x14, 0x14, 0x14, 0x60, 0xc6, 0x8c, 0x19, + 0xdc, 0x67, 0x67, 0x96, 0xa6, 0x46, 0xa3, 0xe1, 0x31, 0x8d, 0xc1, 0x60, + 0xf0, 0x78, 0xfe, 0x6a, 0x6a, 0x6a, 0xdc, 0xe6, 0x28, 0x6b, 0x34, 0x1a, + 0x4c, 0x99, 0x32, 0x85, 0xfb, 0x5c, 0x5b, 0x5b, 0x8b, 0x13, 0x27, 0x4e, + 0x78, 0x35, 0x96, 0x21, 0x43, 0x86, 0xe0, 0x81, 0x07, 0x1e, 0x80, 0xcd, + 0x66, 0xc3, 0xca, 0x95, 0x2b, 0x51, 0x5c, 0x5c, 0xdc, 0x29, 0x6b, 0x55, + 0x2a, 0x95, 0x76, 0x10, 0xf6, 0x64, 0xaa, 0x53, 0x5e, 0x5e, 0x1e, 0x82, + 0x83, 0x83, 0x91, 0x99, 0x99, 0x89, 0x61, 0xc3, 0x86, 0x21, 0x38, 0x38, + 0x18, 0x75, 0x75, 0x75, 0x38, 0x71, 0xe2, 0x04, 0xaa, 0xaa, 0xaa, 0xbc, + 0xca, 0xd5, 0x77, 0x3c, 0x2a, 0x2a, 0x2c, 0x2c, 0x04, 0x00, 0xf4, 0xed, + 0xdb, 0x17, 0x91, 0x91, 0x91, 0x88, 0x8c, 0x8c, 0xe4, 0x72, 0x89, 0xeb, + 0xeb, 0xeb, 0x5d, 0x06, 0x0e, 0x95, 0x95, 0x95, 0xa1, 0x4f, 0x9f, 0x3e, + 0xb8, 0x7e, 0xfd, 0xba, 0xc7, 0xe3, 0x9c, 0x31, 0x63, 0x06, 0xee, 0xbd, + 0xf7, 0x5e, 0x00, 0x40, 0x43, 0x43, 0x03, 0x56, 0xae, 0x5c, 0xe9, 0x32, + 0x8f, 0xba, 0x6f, 0xdf, 0xbe, 0x1d, 0x3c, 0x35, 0xc5, 0xc5, 0xc5, 0xd8, + 0xbd, 0x7b, 0x37, 0x86, 0x0d, 0x1b, 0x06, 0x00, 0x98, 0x39, 0x73, 0x26, + 0x16, 0x2e, 0x5c, 0xd8, 0xc1, 0x9b, 0xb3, 0x70, 0xe1, 0x42, 0x6e, 0xad, + 0x95, 0x95, 0x95, 0xe1, 0xfc, 0xf9, 0xf3, 0x1e, 0xe1, 0x18, 0x14, 0x14, + 0xc4, 0x73, 0x35, 0xba, 0x5b, 0xd3, 0xa4, 0x20, 0xef, 0x4a, 0x40, 0x59, + 0x77, 0xcd, 0xb9, 0x37, 0xeb, 0xbc, 0x33, 0xf2, 0x4a, 0x88, 0x46, 0x9d, + 0x91, 0xb7, 0xbe, 0x5a, 0x4f, 0xee, 0xc0, 0x1b, 0xdc, 0xbc, 0xe5, 0xd9, + 0xce, 0x1c, 0x31, 0x78, 0x2a, 0x13, 0xbb, 0x8b, 0xf7, 0xbb, 0x53, 0xde, + 0xdf, 0xec, 0x35, 0xe5, 0xf6, 0x6c, 0xe2, 0xed, 0xb7, 0xdf, 0xe6, 0x7d, + 0xef, 0xe8, 0xaa, 0x20, 0x77, 0x8b, 0xdf, 0x7e, 0xfb, 0x2d, 0xef, 0x5d, + 0x57, 0x01, 0x0a, 0x42, 0xd0, 0xaf, 0x5f, 0x3f, 0x5c, 0xb8, 0x70, 0x81, + 0xcb, 0x73, 0x77, 0x15, 0x08, 0xe3, 0x0a, 0x7c, 0x8d, 0xb3, 0x27, 0xd0, + 0xbf, 0x7f, 0x7f, 0xb4, 0xb4, 0xb4, 0x74, 0x39, 0x06, 0xc0, 0x53, 0x98, + 0x36, 0x6d, 0x1a, 0xef, 0x0c, 0x2b, 0x37, 0x37, 0xb7, 0x53, 0x67, 0xe9, + 0x2c, 0xa8, 0xd5, 0x6a, 0x24, 0x24, 0x24, 0xa0, 0x5f, 0xbf, 0x7e, 0x08, + 0x0e, 0x0e, 0xc6, 0xf2, 0xe5, 0xcb, 0xb9, 0xb6, 0xed, 0x76, 0x3b, 0x66, + 0xcc, 0x98, 0xe1, 0x55, 0xbd, 0x84, 0xe4, 0xe4, 0x64, 0x2e, 0xd0, 0xf0, + 0x9b, 0x6f, 0xbe, 0xe1, 0x52, 0x64, 0x12, 0x13, 0x13, 0xf1, 0xeb, 0xaf, + 0xbf, 0x76, 0x29, 0x06, 0x40, 0x24, 0x12, 0xe1, 0xb3, 0xcf, 0x3e, 0xe3, + 0xc5, 0x6e, 0xe4, 0xe4, 0xe4, 0x74, 0xa0, 0xad, 0xdd, 0x6e, 0xc7, 0xd1, + 0xa3, 0x47, 0x91, 0x98, 0x98, 0xe8, 0x71, 0xae, 0xfe, 0x5f, 0xff, 0xfa, + 0x57, 0x5e, 0x20, 0x4e, 0x58, 0x58, 0x18, 0x16, 0x2c, 0x58, 0x80, 0x6b, + 0xd7, 0xae, 0xf1, 0xda, 0x36, 0x99, 0x4c, 0x38, 0x7c, 0xf8, 0x30, 0xee, + 0xb8, 0xe3, 0x0e, 0xde, 0xe2, 0x25, 0x61, 0xf2, 0xe4, 0xc9, 0x82, 0x06, + 0xa5, 0xb3, 0x79, 0x1f, 0x3c, 0x78, 0x30, 0xaa, 0xaa, 0xaa, 0xb8, 0x3e, + 0x5e, 0x7a, 0xe9, 0x25, 0x28, 0x14, 0x0a, 0xc1, 0x77, 0x1d, 0xf1, 0x72, + 0x84, 0xc4, 0xc4, 0x44, 0x1e, 0x8d, 0x2a, 0x2a, 0x2a, 0xf0, 0xc0, 0x03, + 0x0f, 0x60, 0xe8, 0xd0, 0xa1, 0x18, 0x37, 0x6e, 0x1c, 0xde, 0x7d, 0xf7, + 0x5d, 0x2e, 0x05, 0x54, 0xaf, 0xd7, 0x3b, 0xc5, 0x55, 0x08, 0x3e, 0xfe, + 0xf8, 0x63, 0x1e, 0x2d, 0x9c, 0x05, 0x50, 0x45, 0x47, 0x47, 0x63, 0xdf, + 0xbe, 0x7d, 0xbc, 0x77, 0x27, 0x4f, 0x9e, 0xec, 0x95, 0x4c, 0xe8, 0x8e, + 0x39, 0xf7, 0xd5, 0xd9, 0xb7, 0xa7, 0xf2, 0xca, 0xdb, 0xd4, 0xb9, 0xee, + 0x58, 0x4f, 0x9d, 0x4d, 0xe3, 0x73, 0x87, 0x97, 0x37, 0x3c, 0xdb, 0xdd, + 0x31, 0x08, 0x3d, 0xc1, 0xfb, 0x5d, 0x95, 0xf7, 0xce, 0xc6, 0xd8, 0x5d, + 0x6b, 0xca, 0xe3, 0x20, 0x40, 0x67, 0x88, 0xfd, 0xfd, 0xef, 0x7f, 0xe7, + 0x7d, 0x2f, 0x14, 0xd5, 0xc9, 0x82, 0x63, 0x2e, 0xeb, 0x88, 0x11, 0x23, + 0xbc, 0x5a, 0xec, 0xd3, 0xa7, 0x4f, 0xe7, 0xbe, 0xff, 0xf4, 0xd3, 0x4f, + 0x05, 0x05, 0xeb, 0xcb, 0x2f, 0xbf, 0xec, 0x56, 0x11, 0xf9, 0x1a, 0x67, + 0x4f, 0x20, 0x3d, 0x3d, 0xbd, 0xc7, 0x0c, 0x80, 0xa4, 0xa4, 0x24, 0xe4, + 0xe7, 0xe7, 0xf3, 0xda, 0x59, 0xb4, 0x68, 0x51, 0x97, 0x17, 0xcd, 0x3b, + 0xef, 0xbc, 0x83, 0xb3, 0x67, 0xcf, 0x72, 0x81, 0x3c, 0xec, 0xd3, 0xa7, + 0x4f, 0x1f, 0xa8, 0xd5, 0x6a, 0x8f, 0xdb, 0x52, 0x28, 0x14, 0x78, 0xe9, + 0xa5, 0x97, 0xb8, 0xe3, 0x85, 0xe1, 0xc3, 0x87, 0xf3, 0xfa, 0xe9, 0xaa, + 0x01, 0x10, 0x15, 0x15, 0x85, 0xbd, 0x7b, 0xf7, 0x72, 0x6d, 0x08, 0x15, + 0xfa, 0x20, 0x9f, 0x96, 0x96, 0x16, 0xcc, 0x99, 0x33, 0xc7, 0x23, 0x57, + 0xd9, 0xfa, 0xf5, 0xeb, 0x79, 0x11, 0xc4, 0xef, 0xbd, 0xf7, 0x9e, 0xcb, + 0x5a, 0x09, 0x46, 0xa3, 0x11, 0xf7, 0xdc, 0x73, 0x8f, 0x60, 0xfc, 0x85, + 0x33, 0x41, 0x28, 0x04, 0x91, 0x91, 0x91, 0xd8, 0xb6, 0x6d, 0x1b, 0xd7, + 0xee, 0x99, 0x33, 0x67, 0xd0, 0xaf, 0x5f, 0x3f, 0xa7, 0xef, 0x93, 0x78, + 0x39, 0x03, 0x8a, 0xa2, 0xb0, 0x7f, 0xff, 0x7e, 0x5e, 0xb4, 0xb3, 0xdd, + 0x6e, 0xef, 0x30, 0x9e, 0xf8, 0xf8, 0x78, 0xaf, 0x70, 0x7d, 0xf4, 0xd1, + 0x47, 0x79, 0xbf, 0x77, 0xb6, 0x26, 0xfb, 0xf6, 0xed, 0x0b, 0x9d, 0x4e, + 0xc7, 0x7b, 0xf7, 0xee, 0xbb, 0xef, 0xee, 0x94, 0x01, 0xe0, 0xcb, 0x39, + 0xf7, 0x95, 0xe2, 0xf1, 0x44, 0x5e, 0xf9, 0x42, 0xc9, 0xfa, 0x62, 0x3d, + 0x75, 0x87, 0xf2, 0xf7, 0x96, 0x67, 0x7b, 0xca, 0x00, 0xe8, 0x4e, 0xde, + 0xef, 0xaa, 0xbc, 0x77, 0x36, 0xc6, 0xee, 0x5a, 0x53, 0x5d, 0xae, 0x03, + 0xe0, 0x68, 0x45, 0x3b, 0xa6, 0x36, 0x91, 0xe0, 0x78, 0x56, 0xea, 0x69, + 0x50, 0x1a, 0xd0, 0x16, 0xe8, 0xc1, 0xe6, 0xd2, 0xd2, 0x34, 0x8d, 0xcd, + 0x9b, 0x37, 0x0b, 0x9e, 0x21, 0xad, 0x58, 0xb1, 0x02, 0x15, 0x15, 0x15, + 0x38, 0x74, 0xe8, 0x10, 0xea, 0xeb, 0xeb, 0xa1, 0x52, 0xa9, 0x3a, 0xb8, + 0x9b, 0x7c, 0x8d, 0xb3, 0x52, 0xa9, 0x44, 0x42, 0x42, 0x82, 0x57, 0x79, + 0xf6, 0xdd, 0x05, 0xfd, 0xfb, 0xf7, 0xc7, 0xae, 0x5d, 0xbb, 0xd0, 0xb7, + 0x6f, 0x5f, 0xee, 0x6f, 0xdb, 0xb6, 0x6d, 0xc3, 0x0f, 0x3f, 0xfc, 0xd0, + 0x65, 0x37, 0xd4, 0xe8, 0xd1, 0xa3, 0x05, 0x53, 0x21, 0xa3, 0xa2, 0xa2, + 0xbc, 0x2a, 0x71, 0x99, 0x9e, 0x9e, 0x8e, 0xa5, 0x4b, 0x97, 0x02, 0x00, + 0x3e, 0xfa, 0xe8, 0x23, 0x1e, 0xdd, 0x84, 0x5c, 0x8b, 0xde, 0x2e, 0x7a, + 0x8d, 0x46, 0xc3, 0x5b, 0x6c, 0x12, 0x89, 0x04, 0xd7, 0xae, 0x5d, 0xc3, + 0x27, 0x9f, 0x7c, 0x82, 0x86, 0x86, 0x06, 0xf4, 0xea, 0xd5, 0x0b, 0xf7, + 0xdf, 0x7f, 0x3f, 0xb7, 0x23, 0x0b, 0x08, 0x08, 0xc0, 0xc6, 0x8d, 0x1b, + 0x31, 0x79, 0xf2, 0x64, 0xfc, 0xfa, 0xeb, 0xaf, 0x2e, 0xdb, 0x26, 0x15, + 0x86, 0x54, 0x2a, 0xc5, 0xb3, 0xcf, 0x3e, 0x0b, 0x8a, 0xa2, 0xb0, 0x7b, + 0xf7, 0x6e, 0x9c, 0x3f, 0x7f, 0x1e, 0x72, 0xb9, 0x1c, 0xe3, 0xc6, 0x8d, + 0xe3, 0x3c, 0x45, 0x72, 0xb9, 0x1c, 0x5b, 0xb7, 0x6e, 0xc5, 0xb4, 0x69, + 0xd3, 0x3a, 0x04, 0x3d, 0xc9, 0xe5, 0x72, 0x8f, 0x4b, 0x76, 0x66, 0x66, + 0x66, 0x62, 0xd6, 0xac, 0x59, 0xdc, 0xe7, 0x0f, 0x3e, 0xf8, 0xc0, 0xe9, + 0xb9, 0x24, 0xbb, 0xd3, 0x65, 0xf1, 0x12, 0x02, 0x96, 0x67, 0xc9, 0x3a, + 0x18, 0xce, 0xce, 0x8b, 0x67, 0xce, 0x9c, 0x89, 0x8d, 0x1b, 0x37, 0x7a, + 0x8c, 0x6b, 0x5e, 0x5e, 0x1e, 0xf4, 0x7a, 0x3d, 0xa7, 0xf0, 0x84, 0xd6, + 0xa4, 0xdd, 0x6e, 0x47, 0x4e, 0x4e, 0x4e, 0x07, 0xa5, 0xe8, 0xaa, 0xaa, + 0x64, 0x4f, 0xcd, 0x39, 0x45, 0x51, 0x4e, 0xdd, 0xf2, 0xce, 0x78, 0xb4, + 0xb3, 0xf2, 0xca, 0x17, 0xe0, 0x8b, 0xf5, 0xc4, 0xbe, 0xe7, 0xcb, 0x1a, + 0x01, 0xde, 0xf2, 0x6c, 0x4f, 0x41, 0x77, 0xf2, 0x7e, 0x77, 0xc1, 0xcd, + 0x58, 0x53, 0x1e, 0xed, 0x48, 0xff, 0xf9, 0xcf, 0x7f, 0xf2, 0xbe, 0x27, + 0xad, 0x4f, 0x47, 0xf8, 0xfc, 0xf3, 0xcf, 0x79, 0xef, 0x3a, 0x16, 0xcc, + 0x70, 0xc5, 0x08, 0x64, 0x2e, 0xed, 0xe9, 0xd3, 0xa7, 0x79, 0x0a, 0xce, + 0xf1, 0xf7, 0x66, 0xb3, 0x19, 0xa7, 0x4e, 0x9d, 0xc2, 0x0f, 0x3f, 0xfc, + 0x80, 0x03, 0x07, 0x0e, 0x74, 0x3b, 0xce, 0x01, 0x01, 0x01, 0xbc, 0x72, + 0xb0, 0x42, 0x01, 0x85, 0xbe, 0xb6, 0x08, 0x85, 0x5c, 0xf4, 0xd3, 0xa6, + 0x4d, 0xe3, 0xa5, 0xb8, 0xd0, 0x34, 0x8d, 0x5f, 0x7f, 0xfd, 0xd5, 0x29, + 0x73, 0x7b, 0x13, 0xb5, 0x9f, 0x9c, 0x9c, 0x8c, 0xcd, 0x9b, 0x37, 0x63, + 0xff, 0xfe, 0xfd, 0xb8, 0x74, 0xe9, 0x52, 0x87, 0x2a, 0x5a, 0xaf, 0xbe, + 0xfa, 0xaa, 0x47, 0x15, 0xfb, 0x62, 0x62, 0x62, 0xb0, 0x65, 0xcb, 0x16, + 0xd0, 0x34, 0x8d, 0x6b, 0xd7, 0xae, 0x71, 0x05, 0x37, 0x5c, 0xed, 0x58, + 0xbc, 0x3d, 0xc7, 0x4c, 0x4b, 0x4b, 0xc3, 0xe1, 0xc3, 0x87, 0x71, 0xf6, + 0xec, 0x59, 0x5c, 0xb9, 0x72, 0x05, 0x9f, 0x7f, 0xfe, 0x79, 0x87, 0x36, + 0x44, 0x22, 0x11, 0xaf, 0x52, 0x17, 0x4d, 0xd3, 0xd8, 0xba, 0x75, 0xab, + 0x60, 0x6a, 0x0d, 0x09, 0x64, 0x0a, 0x20, 0x4d, 0xd3, 0x68, 0x6e, 0x6e, + 0x46, 0x56, 0x56, 0x16, 0xb7, 0x4b, 0x10, 0x8b, 0xc5, 0xe8, 0xd3, 0xa7, + 0x0f, 0x0e, 0x1c, 0x38, 0xc0, 0x7b, 0xef, 0xdb, 0x6f, 0xbf, 0xed, 0x40, + 0xef, 0x77, 0xde, 0x79, 0xc7, 0xa3, 0xda, 0x03, 0x71, 0x71, 0x71, 0xbc, + 0x0a, 0x77, 0xee, 0xf8, 0x5f, 0x08, 0x2f, 0xc7, 0xb1, 0x0b, 0xf1, 0xec, + 0xce, 0x9d, 0x3b, 0xf1, 0xce, 0x3b, 0xef, 0xe0, 0xe3, 0x8f, 0x3f, 0xc6, + 0xa9, 0x53, 0xa7, 0x78, 0xf8, 0x7b, 0x8a, 0x2b, 0x2b, 0x70, 0x5e, 0x7f, + 0xfd, 0x75, 0xde, 0xef, 0x1d, 0xd7, 0xa4, 0xa3, 0x17, 0x89, 0x7d, 0xee, + 0xb9, 0xe7, 0x9e, 0x4e, 0x79, 0xc5, 0x7c, 0x3d, 0xe7, 0x5d, 0xdd, 0x8d, + 0x7a, 0x23, 0xaf, 0xba, 0xb2, 0xd3, 0xf6, 0xf5, 0x7a, 0xf2, 0xd5, 0xee, + 0xbf, 0x33, 0x3c, 0xeb, 0x8b, 0x7e, 0x1d, 0x65, 0x62, 0x77, 0xf3, 0xbe, + 0x33, 0x5c, 0x7c, 0x2d, 0xef, 0xbb, 0x7b, 0x4d, 0x75, 0xfa, 0x08, 0xc0, + 0x1b, 0x60, 0x19, 0x95, 0x7d, 0xd8, 0x40, 0x0c, 0x4f, 0x0c, 0x80, 0x3f, + 0xfc, 0xe1, 0x0f, 0xdc, 0xef, 0x5e, 0x79, 0xe5, 0x15, 0xc1, 0x77, 0x9c, + 0xb9, 0x62, 0x1d, 0x61, 0xed, 0xda, 0xb5, 0xbc, 0xef, 0xef, 0xb8, 0xe3, + 0x8e, 0x2e, 0xe1, 0x4c, 0xd6, 0xdb, 0x6e, 0x6a, 0x6a, 0x12, 0x54, 0xac, + 0xdd, 0x69, 0x00, 0x24, 0x26, 0x26, 0x62, 0xf9, 0xf2, 0xe5, 0xbc, 0xbc, + 0x7f, 0x9a, 0xa6, 0x71, 0xf8, 0xf0, 0x61, 0x97, 0x31, 0x0b, 0x42, 0xb5, + 0x0f, 0x9c, 0x81, 0x44, 0x22, 0x81, 0x46, 0xa3, 0x41, 0x5c, 0x5c, 0x1c, + 0x52, 0x53, 0x53, 0x31, 0x7d, 0xfa, 0xf4, 0x0e, 0x65, 0x94, 0x97, 0x2f, + 0x5f, 0xee, 0x36, 0xe8, 0xe5, 0xbe, 0xfb, 0xee, 0xe3, 0xdc, 0xb3, 0x0b, + 0x16, 0x2c, 0xe8, 0xf0, 0x7d, 0x42, 0x42, 0x42, 0x07, 0x81, 0xe5, 0xa9, + 0xe2, 0x61, 0x21, 0x36, 0x36, 0x16, 0x7d, 0xfb, 0xf6, 0x45, 0x6a, 0x6a, + 0x2a, 0x52, 0x53, 0x53, 0x9d, 0xd6, 0x3f, 0x18, 0x35, 0x6a, 0x14, 0xcf, + 0x55, 0x5c, 0x58, 0x58, 0xd8, 0x41, 0x80, 0x3a, 0xc2, 0x86, 0x0d, 0x1b, + 0x3a, 0x08, 0x07, 0x67, 0x67, 0xc9, 0xc5, 0xc5, 0xc5, 0xdc, 0x7b, 0x35, + 0x35, 0x35, 0x1d, 0xe8, 0x4d, 0xd3, 0x34, 0x16, 0x2f, 0x5e, 0xec, 0x76, + 0x3c, 0x13, 0x27, 0x4e, 0xe4, 0x19, 0x5c, 0xcf, 0x3f, 0xff, 0xbc, 0x5b, + 0x01, 0xee, 0x0a, 0xaf, 0xfe, 0xfd, 0xfb, 0x0b, 0xf2, 0x2c, 0xfb, 0xbe, + 0x48, 0x24, 0x42, 0x5c, 0x5c, 0x1c, 0xbe, 0xfe, 0xfa, 0x6b, 0xde, 0x58, + 0x3d, 0xc1, 0x95, 0x54, 0x00, 0x2f, 0xbf, 0xfc, 0xb2, 0xcb, 0xe3, 0x91, + 0xbc, 0xbc, 0x3c, 0xfc, 0xf5, 0xaf, 0x7f, 0xe5, 0xd5, 0x9c, 0x98, 0x3a, + 0x75, 0x6a, 0xa7, 0x0c, 0x00, 0x5f, 0xcf, 0x79, 0x57, 0x95, 0x90, 0x27, + 0xf2, 0xca, 0x17, 0x4a, 0xcf, 0xd7, 0xeb, 0xc9, 0x57, 0x8a, 0xb8, 0x33, + 0x3c, 0xeb, 0x4b, 0x03, 0x80, 0x95, 0x89, 0xde, 0xf2, 0xbe, 0x58, 0x2c, + 0xf6, 0x8a, 0xf7, 0x7b, 0xca, 0x00, 0xe8, 0xee, 0x35, 0xd5, 0x23, 0x06, + 0x80, 0x63, 0xc7, 0x42, 0xee, 0x64, 0x21, 0x48, 0x48, 0x48, 0xc0, 0xcf, + 0x3f, 0xff, 0xcc, 0xed, 0x6c, 0x9c, 0x29, 0xb5, 0xc9, 0x93, 0x27, 0xe3, + 0xa7, 0x9f, 0x7e, 0xe2, 0x14, 0xa1, 0xd5, 0x6a, 0xc5, 0x8d, 0x1b, 0x37, + 0x3a, 0xbc, 0xf7, 0xb7, 0xbf, 0xfd, 0x8d, 0x87, 0x87, 0x10, 0x81, 0x80, + 0xb6, 0x7a, 0xef, 0xff, 0xfa, 0xd7, 0xbf, 0xdc, 0xe2, 0x4c, 0x06, 0x18, + 0x3d, 0xf7, 0xdc, 0x73, 0x82, 0x51, 0x97, 0x5d, 0x61, 0x08, 0x77, 0x6e, + 0x36, 0xb2, 0xb2, 0x15, 0x1b, 0x80, 0xb6, 0x66, 0xcd, 0x1a, 0xa7, 0x16, + 0x37, 0x29, 0x0c, 0xbb, 0x02, 0xf1, 0xf1, 0xf1, 0x3c, 0xa3, 0x23, 0x3f, + 0x3f, 0xdf, 0xe5, 0x19, 0x5f, 0x74, 0x74, 0x34, 0x57, 0xa1, 0xec, 0xe2, + 0xc5, 0x8b, 0x08, 0x0d, 0x0d, 0x45, 0x5a, 0x5a, 0x1a, 0xef, 0x89, 0x89, + 0x89, 0xe1, 0x05, 0xd4, 0x5d, 0xb9, 0x72, 0x05, 0x31, 0x31, 0x31, 0x48, + 0x4f, 0x4f, 0xf7, 0x79, 0x44, 0x73, 0x6a, 0x6a, 0x2a, 0x17, 0xa4, 0x45, + 0xd3, 0x34, 0x0c, 0x06, 0x83, 0x60, 0x51, 0x1f, 0x12, 0xd6, 0xac, 0x59, + 0xe3, 0xd6, 0x23, 0xc4, 0x5a, 0xec, 0x8e, 0xde, 0x02, 0x47, 0x7a, 0xb3, + 0x34, 0x73, 0x35, 0x4f, 0xa1, 0xa1, 0xa1, 0xf8, 0xf2, 0xcb, 0x2f, 0x79, + 0x29, 0x99, 0xce, 0x70, 0xf4, 0x04, 0x2f, 0x00, 0x5c, 0xa1, 0x18, 0x77, + 0x3c, 0x2b, 0x95, 0x4a, 0x71, 0xfd, 0xfa, 0x75, 0xde, 0xfc, 0xba, 0xe3, + 0x29, 0x12, 0x82, 0x83, 0x83, 0x9d, 0xae, 0xc9, 0x55, 0xab, 0x56, 0x21, + 0x26, 0x26, 0x06, 0x4f, 0x3f, 0xfd, 0x34, 0x0f, 0x6f, 0xa1, 0x6a, 0x92, + 0xbe, 0x94, 0x3f, 0x9e, 0xce, 0x79, 0x57, 0x94, 0x90, 0xa7, 0xf2, 0xaa, + 0xab, 0x4a, 0xaf, 0x3b, 0xd6, 0x93, 0x2f, 0x14, 0x71, 0x67, 0x79, 0xd6, + 0x57, 0xca, 0x9f, 0x94, 0x89, 0xdd, 0xcd, 0xfb, 0x3d, 0x69, 0x00, 0x74, + 0xd7, 0x9a, 0xea, 0xb6, 0xbb, 0x00, 0x5c, 0x41, 0x6d, 0x6d, 0xad, 0xc7, + 0x79, 0xd2, 0x51, 0x51, 0x51, 0x9c, 0xf0, 0xfc, 0xe5, 0x97, 0x5f, 0x9c, + 0xe6, 0xd2, 0xee, 0xdf, 0xbf, 0x1f, 0x17, 0x2e, 0x5c, 0x80, 0x46, 0xa3, + 0x81, 0x42, 0xa1, 0x80, 0xc5, 0x62, 0x11, 0xcc, 0x05, 0xbe, 0x7c, 0xf9, + 0x32, 0xef, 0xb3, 0x50, 0xc9, 0x48, 0xf6, 0x5c, 0x91, 0x2c, 0xfc, 0xe3, + 0x0e, 0x67, 0x8a, 0xa2, 0x70, 0xf8, 0xf0, 0x61, 0x97, 0x31, 0x05, 0xbe, + 0x84, 0x31, 0x63, 0xc6, 0xe0, 0xd3, 0x4f, 0x3f, 0xe5, 0x29, 0xdd, 0xe2, + 0xe2, 0x62, 0x2c, 0x5e, 0xbc, 0x18, 0x87, 0x0f, 0x1f, 0x46, 0x5d, 0x5d, + 0x9d, 0x5b, 0x01, 0xdd, 0x15, 0x08, 0x08, 0x08, 0xc0, 0xc5, 0x8b, 0x17, + 0x39, 0xaf, 0x48, 0x4a, 0x4a, 0x0a, 0x97, 0x3a, 0x23, 0x04, 0x32, 0x99, + 0x8c, 0x9b, 0x8f, 0xb4, 0xb4, 0x34, 0x5c, 0xbe, 0x7c, 0xb9, 0x03, 0x3d, + 0xa5, 0x52, 0x29, 0xcf, 0x83, 0x92, 0x92, 0x92, 0x82, 0x82, 0x82, 0x02, + 0x58, 0x2c, 0x16, 0x2c, 0x5d, 0xba, 0x14, 0x9b, 0x37, 0x6f, 0xf6, 0x19, + 0xfd, 0x9a, 0x9b, 0x9b, 0x79, 0x34, 0x52, 0x2a, 0x95, 0x6e, 0xcf, 0x77, + 0x8b, 0x8a, 0x8a, 0x78, 0x1e, 0x27, 0xa1, 0x22, 0x22, 0x00, 0xd0, 0xd2, + 0xd2, 0xd2, 0x21, 0xd5, 0x4c, 0x88, 0xde, 0xe9, 0xe9, 0xe9, 0x2e, 0x83, + 0x56, 0x63, 0x63, 0x63, 0xb9, 0x14, 0x2a, 0x00, 0xc8, 0xcd, 0xcd, 0x75, + 0x9b, 0xa2, 0xe9, 0x0a, 0x2f, 0xa5, 0x52, 0xc9, 0xcb, 0x7a, 0x71, 0xc5, + 0xb3, 0x41, 0x41, 0x41, 0x38, 0x7f, 0xfe, 0x3c, 0x97, 0x5e, 0xe7, 0x0e, + 0x57, 0x47, 0x68, 0x6a, 0x6a, 0x72, 0xba, 0x26, 0x4b, 0x4b, 0x4b, 0x61, + 0x34, 0x1a, 0x79, 0x8a, 0x41, 0xab, 0xd5, 0x76, 0x7b, 0xee, 0x7e, 0x67, + 0xe6, 0xdc, 0x5b, 0xf0, 0x54, 0x5e, 0x79, 0x0b, 0x8e, 0x78, 0xde, 0x6a, + 0xeb, 0xa9, 0x2b, 0x3c, 0xdb, 0x9d, 0x32, 0xf1, 0x66, 0xf0, 0x7e, 0x77, + 0x41, 0x4f, 0xaf, 0xa9, 0x6e, 0x33, 0x00, 0xaa, 0xab, 0xab, 0x05, 0x0b, + 0xa8, 0x38, 0x82, 0x58, 0x2c, 0xc6, 0x9c, 0x39, 0x73, 0x78, 0xb9, 0xb4, + 0xae, 0xae, 0x94, 0x65, 0xaf, 0x99, 0x74, 0x05, 0x8e, 0x79, 0x9b, 0xce, + 0x76, 0xad, 0x2a, 0x95, 0x8a, 0x67, 0xb5, 0xb9, 0xc3, 0xd9, 0x6a, 0xb5, + 0xfa, 0x3c, 0x58, 0xc4, 0x95, 0x70, 0x5a, 0xbf, 0x7e, 0x3d, 0x0f, 0xf7, + 0x9d, 0x3b, 0x77, 0xe2, 0xd5, 0x57, 0x5f, 0x75, 0x7b, 0xe9, 0x0c, 0xc9, + 0x1c, 0x42, 0xbb, 0xf4, 0x17, 0x5e, 0x78, 0x81, 0x53, 0x56, 0x2d, 0x2d, + 0x2d, 0x78, 0xff, 0xfd, 0xf7, 0x79, 0x8a, 0x8f, 0x14, 0xa6, 0x64, 0x60, + 0x53, 0x40, 0x40, 0x80, 0x57, 0xbb, 0x34, 0xf6, 0x32, 0x21, 0x77, 0xc0, + 0x0a, 0x30, 0x4f, 0xf2, 0x59, 0x25, 0x12, 0x09, 0x54, 0x2a, 0x15, 0x67, + 0xc1, 0x52, 0x14, 0x05, 0x93, 0xc9, 0x24, 0x38, 0x2f, 0x22, 0x91, 0x88, + 0x47, 0xdf, 0xe6, 0xe6, 0x66, 0xb7, 0xf8, 0x3b, 0x56, 0xfd, 0x73, 0x85, + 0x93, 0x63, 0x5b, 0x42, 0xf4, 0x96, 0x48, 0x24, 0x4e, 0xd3, 0x04, 0x01, + 0x60, 0xdc, 0xb8, 0x71, 0xbc, 0xb3, 0xcc, 0xec, 0xec, 0x6c, 0xc1, 0x80, + 0xcb, 0xbb, 0xee, 0xba, 0xcb, 0x23, 0xbc, 0x82, 0x83, 0x83, 0x79, 0x25, + 0x89, 0x5d, 0xf1, 0xac, 0x56, 0xab, 0xe5, 0xe5, 0x54, 0xbb, 0xc3, 0xd5, + 0xdb, 0x35, 0x19, 0x1e, 0x1e, 0x8e, 0xe4, 0xe4, 0x64, 0x1e, 0x6d, 0x5d, + 0xad, 0x1f, 0x67, 0x6b, 0xa1, 0xbb, 0xe7, 0xdc, 0x1b, 0xf0, 0x54, 0x5e, + 0x75, 0x47, 0xd0, 0x5b, 0x77, 0xac, 0xa7, 0xce, 0xc8, 0x27, 0x4f, 0x79, + 0xb6, 0xb3, 0x34, 0xf0, 0x46, 0x26, 0xde, 0x6c, 0xde, 0xef, 0x2e, 0xf0, + 0xd5, 0x9a, 0xf2, 0xa9, 0x01, 0x90, 0x98, 0x98, 0x88, 0x01, 0x03, 0x06, + 0x70, 0x8b, 0xb0, 0xa0, 0xa0, 0xc0, 0x69, 0xc1, 0x87, 0xd3, 0xa7, 0x4f, + 0xbb, 0x55, 0xd4, 0x40, 0x5b, 0xf0, 0x19, 0x6b, 0x4d, 0x96, 0x97, 0x97, + 0x3b, 0x2d, 0x36, 0xc3, 0x4e, 0x7a, 0x6b, 0x6b, 0x2b, 0xca, 0xca, 0xca, + 0x5c, 0xb6, 0x79, 0xe3, 0xc6, 0x0d, 0x54, 0x57, 0x57, 0x73, 0xca, 0x7d, + 0xe8, 0xd0, 0xa1, 0x08, 0x0b, 0x0b, 0xeb, 0xb0, 0x6b, 0x92, 0xc9, 0x64, + 0xbc, 0xe2, 0x22, 0xee, 0x70, 0x96, 0x48, 0x24, 0x9d, 0x4a, 0x19, 0xf1, + 0x16, 0xd2, 0xd2, 0xd2, 0xb0, 0x61, 0xc3, 0x06, 0xde, 0x6d, 0x53, 0xeb, + 0xd6, 0xad, 0xc3, 0x8b, 0x2f, 0xbe, 0x28, 0x18, 0x80, 0xe8, 0x0c, 0x72, + 0x73, 0x73, 0x3b, 0xfc, 0xad, 0xa1, 0xa1, 0x01, 0x09, 0x09, 0x09, 0x5c, + 0xf9, 0xd2, 0x9a, 0x9a, 0x1a, 0x7c, 0xf8, 0xe1, 0x87, 0x4e, 0xdd, 0xdc, + 0x64, 0x24, 0x2d, 0x9b, 0x7e, 0xe2, 0x0c, 0x44, 0x22, 0x11, 0x6a, 0x6b, + 0x6b, 0xb1, 0x7f, 0xff, 0x7e, 0xa7, 0xef, 0x04, 0x05, 0x05, 0x75, 0x48, + 0xb5, 0x3c, 0x76, 0xec, 0x18, 0x0c, 0x06, 0x03, 0x5a, 0x5a, 0x5a, 0xdc, + 0x8e, 0x49, 0xa9, 0x54, 0xe2, 0xdd, 0x77, 0xdf, 0xe5, 0x84, 0xa1, 0xcd, + 0x66, 0xc3, 0xe2, 0xc5, 0x8b, 0x05, 0x0b, 0xbf, 0xa8, 0x54, 0x2a, 0x5e, + 0x4a, 0x54, 0x69, 0x69, 0xa9, 0x5b, 0xaf, 0x54, 0x49, 0x49, 0x09, 0xea, + 0xea, 0xea, 0x10, 0x1e, 0x1e, 0x0e, 0x91, 0x48, 0x84, 0x94, 0x94, 0x14, + 0x9c, 0x3d, 0x7b, 0xb6, 0xc3, 0x7b, 0x21, 0x21, 0x21, 0xbc, 0xb3, 0xe5, + 0xe6, 0xe6, 0x66, 0x41, 0x03, 0x80, 0xcd, 0x35, 0x76, 0x26, 0xd0, 0xa7, + 0x4f, 0x9f, 0xce, 0x13, 0x58, 0x42, 0x73, 0xe6, 0x0d, 0x5e, 0x26, 0x93, + 0x89, 0xd7, 0x9f, 0x2b, 0x9e, 0x8d, 0x88, 0x88, 0xe0, 0x79, 0x2d, 0x5c, + 0xe1, 0xea, 0xe8, 0x02, 0x0f, 0x0c, 0x0c, 0xe4, 0x2a, 0x4f, 0x3a, 0x5b, + 0x93, 0x91, 0x91, 0x91, 0xbc, 0x6b, 0xa4, 0x8f, 0x1c, 0x39, 0xe2, 0xb6, + 0xb8, 0xce, 0xcd, 0x98, 0x73, 0x6f, 0x14, 0x91, 0xa7, 0xf2, 0xaa, 0x33, + 0xe0, 0x58, 0x80, 0xa7, 0x27, 0xd6, 0x53, 0x67, 0x8c, 0x10, 0x4f, 0x79, + 0xb6, 0x27, 0x64, 0x62, 0x4f, 0xf3, 0x7e, 0x77, 0x41, 0x4f, 0xaf, 0x29, + 0xde, 0xc0, 0x3d, 0x3d, 0x7b, 0x71, 0xcc, 0x99, 0x17, 0xba, 0x8e, 0xd2, + 0xd3, 0xfb, 0xac, 0x59, 0xb8, 0xfb, 0xee, 0xbb, 0xb9, 0xdf, 0x7c, 0xfc, + 0xf1, 0xc7, 0x82, 0x29, 0x0d, 0xf9, 0xf9, 0xf9, 0x28, 0x28, 0x28, 0x40, + 0x41, 0x41, 0x01, 0x56, 0xae, 0x5c, 0xe9, 0x36, 0x27, 0xdd, 0x31, 0x67, + 0xb8, 0xb2, 0xb2, 0xb2, 0x43, 0x04, 0xbb, 0x58, 0x2c, 0xc6, 0xe2, 0xc5, + 0x8b, 0x79, 0x81, 0x2c, 0xce, 0x70, 0x26, 0xc7, 0xfc, 0xc2, 0x0b, 0x2f, + 0x08, 0xba, 0x8a, 0x7c, 0x55, 0x07, 0x40, 0x2e, 0x97, 0xf3, 0x8a, 0xd1, + 0xb0, 0x39, 0xa1, 0x5d, 0x75, 0xe7, 0x93, 0xf0, 0xc2, 0x0b, 0x2f, 0xf0, + 0xce, 0xc9, 0x06, 0x0d, 0x1a, 0x24, 0x28, 0xec, 0xa6, 0x4e, 0x9d, 0xca, + 0x8b, 0x01, 0x38, 0x78, 0xf0, 0xa0, 0xcb, 0x73, 0x7a, 0xb5, 0x5a, 0x8d, + 0xd8, 0xd8, 0x58, 0xc4, 0xc5, 0xc5, 0x21, 0x36, 0x36, 0x96, 0x7b, 0x62, + 0x62, 0x62, 0x10, 0x1d, 0x1d, 0x8d, 0xa8, 0xa8, 0x28, 0x84, 0x84, 0x84, + 0xf0, 0x6e, 0xbd, 0x3a, 0x79, 0xf2, 0x24, 0x42, 0x42, 0x42, 0x10, 0x13, + 0x13, 0x23, 0x48, 0x2f, 0x21, 0x58, 0xb5, 0x6a, 0x15, 0x8f, 0x3e, 0xf7, + 0xdd, 0x77, 0x5f, 0x87, 0xa3, 0x09, 0xb1, 0x58, 0x8c, 0x07, 0x1f, 0x7c, + 0x90, 0x77, 0xab, 0xdf, 0x86, 0x0d, 0x1b, 0xdc, 0x1a, 0x70, 0x11, 0x11, + 0x11, 0xf8, 0xfe, 0xfb, 0xef, 0x79, 0x59, 0x16, 0x42, 0xc1, 0x76, 0x83, + 0x06, 0x0d, 0x42, 0x65, 0x65, 0x25, 0xef, 0x3d, 0xc7, 0xe0, 0x2b, 0xf6, + 0x32, 0x21, 0x67, 0xc1, 0x98, 0x69, 0x69, 0x69, 0xb8, 0x71, 0xe3, 0x06, + 0xd7, 0xc6, 0xf9, 0xf3, 0xe7, 0x9d, 0xee, 0x6e, 0x3c, 0xc5, 0x0b, 0x00, + 0x56, 0xaf, 0x5e, 0xed, 0x11, 0xcf, 0xf6, 0xeb, 0xd7, 0x0f, 0xd5, 0xd5, + 0xd5, 0xbc, 0x8b, 0x8f, 0x3c, 0x09, 0x1c, 0x8d, 0x8f, 0x8f, 0x77, 0xbb, + 0x26, 0xe5, 0x72, 0x39, 0x9e, 0x7e, 0xfa, 0x69, 0x8e, 0xfe, 0x36, 0x9b, + 0x0d, 0xe3, 0xc7, 0x8f, 0x77, 0xb9, 0xbe, 0x7a, 0x72, 0xce, 0x3b, 0x7b, + 0x0e, 0xed, 0x89, 0xbc, 0xf2, 0xb4, 0x7d, 0x77, 0x7d, 0x76, 0xc7, 0x7a, + 0xea, 0xea, 0x59, 0xbc, 0xa7, 0x3c, 0xeb, 0xcb, 0x9a, 0x03, 0xde, 0xc8, + 0x44, 0x5f, 0xf3, 0x7e, 0x4f, 0xc5, 0x00, 0x74, 0xd7, 0x9a, 0xf2, 0x69, + 0x10, 0xa0, 0xa3, 0x01, 0x20, 0xa4, 0x30, 0x3d, 0x8d, 0xb6, 0x66, 0x5d, + 0x36, 0x6c, 0x20, 0x95, 0xab, 0xc1, 0x38, 0x5e, 0xdd, 0x38, 0x69, 0xd2, + 0x24, 0xc4, 0xc4, 0xc4, 0x40, 0x2e, 0x97, 0x3b, 0x55, 0x8c, 0xb3, 0x67, + 0xcf, 0xe6, 0xe1, 0xba, 0x67, 0xcf, 0x1e, 0xa8, 0xd5, 0x6a, 0x44, 0x44, + 0x44, 0x20, 0x34, 0x34, 0x14, 0x51, 0x51, 0x51, 0xbc, 0x1b, 0xa6, 0x9c, + 0xe1, 0x3c, 0x66, 0xcc, 0x98, 0x0e, 0x45, 0x47, 0x84, 0xc6, 0xed, 0x2b, + 0x03, 0x20, 0x2d, 0x2d, 0x0d, 0xa5, 0xa5, 0xa5, 0xbc, 0x82, 0x27, 0x79, + 0x79, 0x79, 0x58, 0xb3, 0x66, 0x0d, 0xd6, 0xac, 0x59, 0x83, 0xf7, 0xde, + 0x7b, 0x4f, 0xf0, 0xf9, 0xe0, 0x83, 0x0f, 0x3c, 0x76, 0x11, 0x0e, 0x1e, + 0x3c, 0x98, 0x73, 0x8d, 0xb2, 0x81, 0x52, 0x77, 0xdd, 0x75, 0x17, 0x92, + 0x93, 0x93, 0x11, 0x1a, 0x1a, 0x8a, 0xd8, 0xd8, 0x58, 0xa8, 0x54, 0xaa, + 0x0e, 0x59, 0x00, 0x42, 0x51, 0xc8, 0xde, 0x82, 0x50, 0xda, 0x92, 0xb7, + 0x59, 0x00, 0x23, 0x47, 0x8e, 0x84, 0xc9, 0x64, 0xe2, 0x5d, 0x8b, 0x39, + 0x65, 0xca, 0x14, 0x24, 0x26, 0x26, 0x22, 0x28, 0x28, 0x08, 0xa1, 0xa1, + 0xa1, 0x48, 0x4c, 0x4c, 0x44, 0x5d, 0x5d, 0x1d, 0xaf, 0x30, 0x8c, 0xa7, + 0x45, 0x9e, 0xa6, 0x4e, 0x9d, 0xca, 0x33, 0x0c, 0x37, 0x6f, 0xde, 0x8c, + 0x8c, 0x8c, 0x0c, 0x9e, 0x8b, 0xf1, 0xe8, 0xd1, 0xa3, 0x3c, 0xda, 0xdc, + 0x7f, 0xff, 0xfd, 0x82, 0x73, 0xbd, 0x76, 0xed, 0x5a, 0xa7, 0x4a, 0xe2, + 0x8e, 0x3b, 0xee, 0xe8, 0x90, 0x4a, 0xe8, 0xaa, 0x58, 0x91, 0x33, 0xbc, + 0x3c, 0xe5, 0xd9, 0x7e, 0xfd, 0xfa, 0x71, 0xf3, 0x2b, 0x93, 0xc9, 0x3a, + 0xa4, 0xcc, 0xb9, 0xc2, 0x95, 0x04, 0xa1, 0xeb, 0x54, 0x1d, 0xd7, 0x64, + 0x46, 0x46, 0x06, 0x2f, 0x15, 0x2b, 0x27, 0x27, 0x47, 0xf0, 0xea, 0x62, + 0x4f, 0x65, 0x8f, 0xaf, 0xe7, 0xbc, 0x33, 0x8a, 0xc8, 0x53, 0x79, 0xe5, + 0x2b, 0x03, 0xa0, 0x3b, 0xd6, 0x53, 0x57, 0xf1, 0xf1, 0x94, 0x67, 0x7d, + 0x69, 0x00, 0xb8, 0x92, 0x89, 0xdd, 0xcd, 0xfb, 0x3d, 0x65, 0x00, 0x74, + 0xd7, 0x9a, 0xf2, 0xda, 0x00, 0x70, 0xc5, 0x84, 0x9e, 0x1a, 0x00, 0x4f, + 0x3d, 0xf5, 0x94, 0x47, 0xa5, 0x15, 0x33, 0x32, 0x32, 0x38, 0x25, 0x73, + 0xfc, 0xf8, 0x71, 0xa7, 0xa9, 0x3d, 0xb3, 0x67, 0xcf, 0xe6, 0x2d, 0x7e, + 0x9b, 0xcd, 0x86, 0xbd, 0x7b, 0xf7, 0x62, 0xcb, 0x96, 0x2d, 0xd8, 0xb7, + 0x6f, 0x9f, 0xe0, 0x25, 0x38, 0x89, 0x89, 0x89, 0x1d, 0x84, 0x74, 0x49, + 0x49, 0x09, 0x76, 0xef, 0xde, 0x8d, 0x9c, 0x9c, 0x1c, 0xde, 0x2e, 0xc1, + 0x15, 0xce, 0xe1, 0xe1, 0xe1, 0xf8, 0xe0, 0x83, 0x0f, 0x78, 0xef, 0x0a, + 0x05, 0x95, 0xf8, 0xca, 0x00, 0x20, 0xab, 0x8b, 0x79, 0xfb, 0x0c, 0x1c, + 0x38, 0xd0, 0x23, 0xa1, 0xa1, 0xd1, 0x68, 0xf0, 0xd6, 0x5b, 0x6f, 0xf1, + 0x7e, 0xdb, 0xda, 0xda, 0x8a, 0xa3, 0x47, 0x8f, 0xe2, 0xfb, 0xef, 0xbf, + 0xc7, 0xcf, 0x3f, 0xff, 0x8c, 0xd6, 0xd6, 0x56, 0xde, 0xf7, 0xdb, 0xb7, + 0x6f, 0xf7, 0x5a, 0x51, 0x3b, 0x53, 0x1e, 0x5d, 0xad, 0x04, 0x18, 0x1a, + 0x1a, 0xda, 0x21, 0xd5, 0xd3, 0x64, 0x32, 0xe1, 0xa7, 0x9f, 0x7e, 0xc2, + 0xf6, 0xed, 0xdb, 0x71, 0xf0, 0xe0, 0xc1, 0x0e, 0xf3, 0x1b, 0x1f, 0x1f, + 0xef, 0xf1, 0x19, 0x5f, 0x4c, 0x4c, 0x4c, 0x87, 0xd2, 0x9c, 0x57, 0xaf, + 0x5e, 0xc5, 0x77, 0xdf, 0x7d, 0x87, 0xef, 0xbf, 0xff, 0x9e, 0xb7, 0x73, + 0x60, 0x69, 0xe3, 0x78, 0x15, 0x30, 0xd0, 0x76, 0x89, 0x88, 0xab, 0x1d, + 0xf5, 0xc2, 0x85, 0x0b, 0x79, 0xed, 0xac, 0x58, 0xb1, 0xa2, 0x53, 0x78, + 0x79, 0xca, 0xb3, 0xa7, 0x4e, 0x9d, 0x42, 0x76, 0x76, 0x36, 0x72, 0x72, + 0x72, 0x78, 0xbb, 0x38, 0x36, 0xa5, 0xd4, 0x9b, 0xb4, 0x51, 0x4f, 0xd6, + 0xa4, 0xb7, 0x51, 0xe2, 0x3d, 0x35, 0xe7, 0x9d, 0x55, 0x44, 0x9e, 0xca, + 0xab, 0x9e, 0x34, 0x00, 0xbc, 0x5d, 0x4f, 0x5d, 0xc5, 0xc7, 0x53, 0x9e, + 0xf5, 0xa5, 0x01, 0xe0, 0x4a, 0x26, 0x76, 0x37, 0xef, 0xf7, 0x64, 0x16, + 0x40, 0x77, 0xac, 0x29, 0x9f, 0x1a, 0x00, 0x77, 0xdf, 0x7d, 0x37, 0x36, + 0x6f, 0xde, 0xcc, 0x3d, 0x42, 0xb5, 0xaf, 0x57, 0xaf, 0x5e, 0x2d, 0x28, + 0x0c, 0x85, 0xe0, 0x99, 0x67, 0x9e, 0xe1, 0xfa, 0xfc, 0xf3, 0x9f, 0xff, + 0xec, 0xd2, 0x2d, 0x3b, 0x70, 0xe0, 0x40, 0x5e, 0xee, 0xa3, 0x27, 0x38, + 0x0f, 0x18, 0x30, 0x80, 0xab, 0x9f, 0xed, 0xec, 0xb1, 0xdb, 0xed, 0x6e, + 0x71, 0x4e, 0x48, 0x48, 0xc0, 0x27, 0x9f, 0x7c, 0xe2, 0x56, 0x38, 0x38, + 0x32, 0x04, 0x5b, 0xaf, 0xdb, 0x1b, 0x03, 0x60, 0xc5, 0x8a, 0x15, 0xdd, + 0x6e, 0x00, 0xb0, 0x2e, 0xa7, 0xf7, 0xde, 0x7b, 0xaf, 0x43, 0xc1, 0x1f, + 0xa1, 0xe7, 0x87, 0x1f, 0x7e, 0x70, 0x5a, 0x04, 0xc8, 0x5b, 0xa1, 0xd5, + 0xa7, 0x4f, 0x9f, 0x0e, 0x02, 0xcb, 0x93, 0x02, 0x43, 0x42, 0x06, 0xde, + 0xbb, 0xef, 0xbe, 0xeb, 0x16, 0x77, 0xab, 0xd5, 0x8a, 0xcf, 0x3e, 0xfb, + 0xcc, 0x69, 0x26, 0x88, 0x33, 0xfc, 0x93, 0x92, 0x92, 0xb0, 0x63, 0xc7, + 0x0e, 0xb7, 0xed, 0xe7, 0xe7, 0xe7, 0x3b, 0x15, 0x1e, 0xee, 0xa2, 0xcf, + 0xdf, 0x7c, 0xf3, 0x4d, 0x5e, 0x5b, 0xf3, 0xe7, 0xcf, 0x77, 0x3b, 0x6e, + 0x21, 0xbc, 0x3c, 0xe5, 0x59, 0x67, 0xcf, 0xfe, 0xfd, 0xfb, 0xbd, 0x8e, + 0x94, 0xf7, 0x64, 0x4d, 0xd2, 0x34, 0x8d, 0xda, 0xda, 0x5a, 0x4c, 0x98, + 0x30, 0xc1, 0xa3, 0xfa, 0xf0, 0x3d, 0x39, 0xe7, 0x9d, 0x51, 0xc4, 0x9e, + 0xca, 0x2b, 0x5f, 0x2b, 0x40, 0x5f, 0xad, 0x27, 0x5f, 0xe0, 0xe2, 0x09, + 0xcf, 0xfa, 0xba, 0xec, 0xb0, 0x2b, 0x99, 0xd8, 0x9d, 0xbc, 0xdf, 0x1d, + 0xf2, 0xde, 0x15, 0xde, 0xdd, 0xb1, 0xa6, 0x7c, 0x9a, 0x06, 0x98, 0x9d, + 0x9d, 0x8d, 0xec, 0xec, 0x6c, 0x97, 0xef, 0xbc, 0xf3, 0xce, 0x3b, 0x4e, + 0xaf, 0x97, 0x75, 0x14, 0x64, 0x73, 0xe6, 0xcc, 0x01, 0xd0, 0x76, 0xbb, + 0x93, 0xab, 0x76, 0x6b, 0x6b, 0x6b, 0x61, 0x36, 0x9b, 0x71, 0xcf, 0x3d, + 0xf7, 0xe0, 0xf9, 0xe7, 0x9f, 0xc7, 0x98, 0x31, 0x63, 0x78, 0xe7, 0x9f, + 0xce, 0xd2, 0xe1, 0xce, 0x9d, 0x3b, 0x87, 0xac, 0xac, 0x2c, 0xbc, 0xfc, + 0xf2, 0xcb, 0xdc, 0xbd, 0xc9, 0x4a, 0xa5, 0x12, 0x76, 0xbb, 0x1d, 0x3a, + 0x9d, 0x0e, 0xc7, 0x8f, 0x1f, 0xc7, 0xb6, 0x6d, 0xdb, 0xb0, 0x67, 0xcf, + 0x1e, 0x97, 0x38, 0x97, 0x96, 0x96, 0xe2, 0xe5, 0x97, 0x5f, 0xc6, 0x81, + 0x03, 0x07, 0xf0, 0xd4, 0x53, 0x4f, 0xf1, 0x02, 0x51, 0x48, 0x1c, 0xb7, + 0x6c, 0xd9, 0xc2, 0x95, 0x12, 0x6e, 0x6c, 0x6c, 0xec, 0x30, 0xd1, 0x9e, + 0x2c, 0xee, 0xc3, 0x87, 0x0f, 0x63, 0xcb, 0x96, 0x2d, 0x9d, 0xda, 0x5d, + 0x97, 0x97, 0x97, 0x7b, 0xfc, 0x6e, 0x59, 0x59, 0x19, 0x5e, 0x7d, 0xf5, + 0x55, 0xe4, 0xe4, 0xe4, 0xe0, 0xd1, 0x47, 0x1f, 0xc5, 0xe8, 0xd1, 0xa3, + 0xa1, 0xd1, 0x68, 0x20, 0x93, 0xc9, 0x38, 0x17, 0xeb, 0xa9, 0x53, 0xa7, + 0xb0, 0x75, 0xeb, 0x56, 0xfc, 0xfb, 0xdf, 0xff, 0x76, 0x1a, 0x68, 0xc2, + 0x1e, 0x25, 0xd8, 0xed, 0x76, 0x8f, 0xa2, 0x8e, 0xad, 0x56, 0x2b, 0xb6, + 0x6c, 0xd9, 0xc2, 0xdd, 0x90, 0xa7, 0xd5, 0x6a, 0x3b, 0x15, 0xa4, 0x55, + 0x52, 0x52, 0x82, 0xd7, 0x5e, 0x7b, 0x0d, 0x3b, 0x77, 0xee, 0xc4, 0x8a, + 0x15, 0x2b, 0x30, 0x70, 0xe0, 0x40, 0xde, 0x11, 0x48, 0x63, 0x63, 0x23, + 0xf2, 0xf2, 0xf2, 0xf0, 0xc1, 0x07, 0x1f, 0xe0, 0xc4, 0x89, 0x13, 0x5e, + 0xa7, 0x29, 0x15, 0x17, 0x17, 0xe3, 0xb9, 0xe7, 0x9e, 0x43, 0x6e, 0x6e, + 0x2e, 0xe6, 0xcf, 0x9f, 0x8f, 0xf4, 0xf4, 0x74, 0xae, 0x08, 0x92, 0xc5, + 0x62, 0xc1, 0xd9, 0xb3, 0x67, 0xb1, 0x7b, 0xf7, 0x6e, 0x6c, 0xda, 0xb4, + 0x49, 0x70, 0x17, 0xee, 0xc9, 0x7c, 0xef, 0xdb, 0xb7, 0x0f, 0xbd, 0x7a, + 0xf5, 0xe2, 0xcd, 0x7d, 0x67, 0xf0, 0xf2, 0x94, 0x67, 0xc9, 0xe3, 0xb2, + 0xe6, 0xe6, 0x66, 0x9c, 0x3f, 0x7f, 0x1e, 0x9b, 0x37, 0x6f, 0xe6, 0x2a, + 0xba, 0x79, 0x03, 0x9e, 0xac, 0xc9, 0x03, 0x07, 0x0e, 0x60, 0xf5, 0xea, + 0xd5, 0x38, 0x73, 0xe6, 0x8c, 0x60, 0x76, 0x8d, 0xb7, 0x7d, 0x76, 0xf7, + 0x9c, 0xfb, 0x4a, 0x5e, 0x75, 0x35, 0x03, 0xc0, 0x9b, 0x92, 0xc4, 0x9e, + 0xae, 0x27, 0x5f, 0x65, 0x25, 0x74, 0x86, 0x67, 0xbb, 0x0a, 0xde, 0xca, + 0xc4, 0xee, 0xe6, 0x7d, 0x5f, 0xc8, 0x7b, 0xa1, 0x1b, 0x17, 0x6f, 0xc6, + 0x9a, 0xa2, 0x5c, 0xd5, 0x8d, 0xee, 0x4e, 0x50, 0x2a, 0x95, 0x58, 0xb7, + 0x6e, 0x1d, 0xa4, 0x52, 0x29, 0x72, 0x72, 0x72, 0xb0, 0x67, 0xcf, 0x1e, + 0xc1, 0xa2, 0x3e, 0x8e, 0x10, 0x15, 0x15, 0x85, 0xb0, 0xb0, 0x30, 0x84, + 0x87, 0x87, 0x43, 0xa9, 0x54, 0xa2, 0xa9, 0xa9, 0x09, 0x5a, 0xad, 0x16, + 0x17, 0x2e, 0x5c, 0x70, 0xfa, 0x1b, 0x89, 0x44, 0x82, 0xa4, 0xa4, 0x24, + 0xc8, 0xe5, 0x72, 0xee, 0x6a, 0x59, 0x8a, 0xa2, 0xd0, 0xd8, 0xd8, 0xe8, + 0xf2, 0x3a, 0x57, 0x21, 0x88, 0x8b, 0x8b, 0x83, 0x5a, 0xad, 0xee, 0xd4, + 0xbd, 0x00, 0x37, 0x8b, 0xd6, 0xee, 0x20, 0x3c, 0x3c, 0x1c, 0xe1, 0xe1, + 0xe1, 0xa0, 0x28, 0x0a, 0x81, 0x81, 0x81, 0x30, 0x1a, 0x8d, 0xb0, 0xdb, + 0xed, 0x30, 0x18, 0x0c, 0x6e, 0x33, 0x2e, 0x32, 0x32, 0x32, 0xba, 0x4c, + 0xd3, 0xae, 0x42, 0x4c, 0x4c, 0x0c, 0x42, 0x42, 0x42, 0xb8, 0x54, 0x1e, + 0x36, 0x37, 0xb6, 0xa9, 0xa9, 0xc9, 0x65, 0x8e, 0x36, 0x39, 0x1f, 0xce, + 0xe6, 0x41, 0x24, 0x12, 0x21, 0x39, 0x39, 0x19, 0x32, 0x99, 0x0c, 0x6a, + 0xb5, 0x9a, 0x4b, 0x3f, 0x33, 0x99, 0x4c, 0x28, 0x29, 0x29, 0xe9, 0x74, + 0x84, 0x79, 0x57, 0xc1, 0x11, 0x2f, 0x57, 0x77, 0x1c, 0xb0, 0x3c, 0x2b, + 0x91, 0x48, 0xa0, 0x56, 0xab, 0xa1, 0xd7, 0xeb, 0x61, 0xb1, 0x58, 0xd0, + 0xda, 0xda, 0xea, 0x93, 0x6b, 0x73, 0x9d, 0xad, 0xc9, 0xaa, 0xaa, 0x2a, + 0x97, 0x86, 0xb5, 0xe3, 0x7a, 0xf0, 0x66, 0x2d, 0xf8, 0x62, 0xce, 0x5d, + 0x0a, 0x46, 0x07, 0x5c, 0xbc, 0x91, 0x57, 0xdd, 0x5d, 0xf7, 0xde, 0x5b, + 0x99, 0xd1, 0x15, 0x7c, 0x3a, 0x23, 0x9f, 0xba, 0x3a, 0x7e, 0x5f, 0xca, + 0xc4, 0xae, 0xf0, 0xbe, 0x27, 0xf2, 0xa1, 0x2b, 0x74, 0x70, 0xd5, 0xa6, + 0xaf, 0xd6, 0x54, 0xa7, 0x0c, 0x00, 0x5f, 0x4f, 0x82, 0x97, 0x77, 0x5f, + 0x53, 0xc4, 0xbf, 0x8e, 0x3f, 0xa2, 0x99, 0x07, 0xc4, 0xbf, 0xde, 0xb4, + 0xe5, 0xac, 0x3d, 0xda, 0xc3, 0xf6, 0x5c, 0xf5, 0x43, 0x39, 0xf4, 0xd9, + 0x01, 0x5f, 0x2f, 0x0d, 0x00, 0x57, 0xb8, 0xd3, 0x02, 0xf8, 0x77, 0x16, + 0x6f, 0x57, 0x7d, 0xd0, 0x02, 0xff, 0xef, 0x0e, 0x1a, 0xa1, 0x0b, 0xf3, + 0x0a, 0x81, 0xff, 0x43, 0x60, 0x9e, 0x79, 0x6d, 0x3b, 0x4e, 0x86, 0xc0, + 0x3c, 0x08, 0xd1, 0x86, 0x72, 0xc1, 0x37, 0xb4, 0x8f, 0x71, 0x16, 0xc2, + 0x1f, 0x3e, 0xe4, 0x7f, 0x5f, 0xf0, 0x90, 0x33, 0x1a, 0xd1, 0xee, 0xd6, + 0xd7, 0xcd, 0x30, 0x86, 0xbd, 0x11, 0x8e, 0x5d, 0xc1, 0xc5, 0x6f, 0x00, + 0xdc, 0x3a, 0x06, 0x80, 0xaf, 0xe6, 0xb0, 0xbb, 0xe8, 0xe0, 0x6b, 0x3d, + 0xeb, 0x2d, 0x48, 0x7c, 0xa4, 0xb4, 0x7d, 0x85, 0x14, 0x2b, 0x40, 0xc4, + 0xc4, 0x23, 0x62, 0x84, 0x87, 0x1d, 0x80, 0x15, 0x80, 0xcd, 0x03, 0x81, + 0xc5, 0xb6, 0x23, 0x72, 0x68, 0x4b, 0x4c, 0x08, 0x2d, 0x3b, 0xd3, 0x96, + 0x8d, 0x69, 0xd7, 0xce, 0x3c, 0xb4, 0x17, 0x2e, 0x38, 0xf6, 0x05, 0x16, + 0x4f, 0x09, 0xf3, 0x2f, 0x88, 0xf6, 0xd8, 0x3e, 0xbc, 0x11, 0xda, 0x8e, + 0xb8, 0xb3, 0xed, 0x3a, 0xe2, 0xce, 0xd2, 0x83, 0xc3, 0xdd, 0x43, 0x4b, + 0xd6, 0xb1, 0x0f, 0x09, 0x31, 0x06, 0x8a, 0xa0, 0xb7, 0x8d, 0x78, 0x5c, + 0xf6, 0xe1, 0xe5, 0x78, 0x9c, 0xf5, 0x63, 0x27, 0x95, 0xb3, 0x0b, 0xa5, + 0x2c, 0x22, 0xda, 0x13, 0x39, 0xd0, 0x46, 0x08, 0xec, 0x0e, 0xf3, 0x61, + 0x27, 0x6e, 0x47, 0xa3, 0x05, 0xf8, 0x5d, 0x88, 0xfe, 0x62, 0x62, 0x6e, + 0x69, 0x07, 0xfa, 0xdb, 0x08, 0xda, 0xd0, 0x4e, 0xc6, 0x4f, 0x11, 0x6d, + 0x88, 0x9d, 0x18, 0xa4, 0xae, 0x0c, 0x00, 0x1e, 0xfe, 0x2c, 0xad, 0x9c, + 0xcc, 0x87, 0x37, 0x3c, 0xd4, 0x81, 0xff, 0x3b, 0x31, 0xa7, 0x12, 0x87, + 0xf5, 0x45, 0xbb, 0xe2, 0xd1, 0x9e, 0xbc, 0x19, 0xae, 0xa7, 0x94, 0xb2, + 0x1f, 0xfe, 0x73, 0xc0, 0xd9, 0x4d, 0x91, 0xdd, 0x61, 0x98, 0xdc, 0x24, + 0x3d, 0xeb, 0xde, 0x03, 0xe0, 0x0b, 0x2b, 0xc5, 0x4b, 0x2b, 0x8a, 0x15, + 0x2a, 0x12, 0x00, 0x32, 0x00, 0x0a, 0x00, 0x72, 0xe6, 0xb3, 0x1d, 0x80, + 0x19, 0x80, 0x11, 0x80, 0x09, 0x80, 0xc5, 0x85, 0xb0, 0x22, 0x05, 0x93, + 0x8c, 0x69, 0x43, 0xc1, 0x3c, 0x52, 0xe6, 0xef, 0x34, 0x23, 0x98, 0xc8, + 0x36, 0x8d, 0xa4, 0x81, 0xe1, 0x42, 0x09, 0x39, 0xf6, 0x25, 0x66, 0xda, + 0x65, 0xf1, 0x95, 0x31, 0x7f, 0xb7, 0x10, 0xed, 0x9a, 0x01, 0xd8, 0x68, + 0x9a, 0xb6, 0xbb, 0xa1, 0x2f, 0x45, 0x18, 0x12, 0x32, 0x02, 0x6f, 0x19, + 0xd3, 0x87, 0x88, 0x50, 0x3e, 0x26, 0x87, 0xc7, 0xe2, 0x68, 0x1c, 0x39, + 0xd9, 0x65, 0x51, 0x84, 0xd0, 0x26, 0xe9, 0x23, 0x67, 0xfa, 0xa0, 0x9c, + 0xd0, 0xc7, 0x91, 0xee, 0xde, 0x28, 0x0a, 0xc7, 0xbe, 0xd8, 0xb1, 0xb0, + 0xf3, 0xda, 0x4a, 0x8e, 0x81, 0xa4, 0x93, 0x03, 0xfd, 0x59, 0xfa, 0x48, + 0x89, 0xf6, 0x48, 0xda, 0x88, 0x9c, 0x78, 0x78, 0xac, 0x4c, 0xdb, 0x66, + 0xa6, 0x1f, 0x33, 0xab, 0x94, 0x48, 0x6d, 0xc4, 0xd0, 0x86, 0xa4, 0x8f, + 0x1c, 0x40, 0x80, 0x03, 0x2f, 0x52, 0xcc, 0x6f, 0xd9, 0xb6, 0x5a, 0x19, + 0x1a, 0x59, 0x08, 0x45, 0x4a, 0x3b, 0xe1, 0x11, 0x21, 0x9c, 0xdd, 0x79, + 0x2e, 0x58, 0x65, 0x6a, 0x21, 0xe6, 0xc1, 0xec, 0xa4, 0x2f, 0x8b, 0x44, + 0xad, 0x02, 0x00, 0x00, 0x20, 0x00, 0x49, 0x44, 0x41, 0x54, 0x67, 0x3c, + 0x24, 0x27, 0xe6, 0x97, 0xe4, 0x21, 0xa1, 0xf9, 0xe5, 0xf8, 0xdf, 0x09, + 0xef, 0x0b, 0xb5, 0x1f, 0x20, 0xd0, 0x3e, 0xc9, 0xff, 0x6c, 0x1f, 0x56, + 0xc2, 0x08, 0xa0, 0x7b, 0x72, 0xf7, 0xd7, 0x19, 0x01, 0x79, 0x33, 0x76, + 0xbf, 0xbe, 0xc6, 0xcd, 0x17, 0xf8, 0x78, 0x43, 0x07, 0x5f, 0x8d, 0xff, + 0x66, 0x78, 0x01, 0xba, 0xe2, 0xb2, 0xef, 0x2a, 0x1d, 0x6e, 0x96, 0xc7, + 0x49, 0xe2, 0x4d, 0x07, 0x3d, 0xc0, 0x74, 0xac, 0xd2, 0x56, 0x01, 0x08, + 0x06, 0x90, 0x0a, 0x40, 0xc9, 0x08, 0x25, 0x2d, 0x80, 0xb3, 0x0e, 0xbb, + 0x20, 0x67, 0xc2, 0x89, 0x55, 0xc8, 0x2a, 0x00, 0x6a, 0x00, 0x1a, 0x00, + 0xe1, 0x00, 0x62, 0x98, 0x76, 0x4d, 0x00, 0x74, 0x00, 0x8a, 0x01, 0xe8, + 0x99, 0xb6, 0x75, 0x00, 0x5a, 0x58, 0x41, 0xc5, 0xdc, 0x19, 0xee, 0xca, + 0x1b, 0x40, 0x11, 0xf8, 0x06, 0x32, 0x7d, 0xc4, 0x01, 0x08, 0x65, 0xbe, + 0x33, 0x02, 0xb8, 0x06, 0xa0, 0xc9, 0x61, 0xc7, 0xe6, 0xcc, 0x0a, 0x24, + 0x15, 0x45, 0x00, 0x80, 0x20, 0x06, 0x77, 0x35, 0x80, 0x30, 0x00, 0xb1, + 0xcc, 0xdf, 0x8d, 0x00, 0x1a, 0x00, 0xd4, 0x30, 0xb8, 0xeb, 0x98, 0x7f, + 0x9b, 0x99, 0xef, 0x3a, 0x28, 0x36, 0x01, 0xe5, 0x2f, 0x13, 0xe8, 0x23, + 0x14, 0x40, 0x34, 0x43, 0xef, 0x56, 0x00, 0x75, 0x00, 0x6a, 0x09, 0xfa, + 0xe8, 0x19, 0xfa, 0xb0, 0xca, 0xc7, 0x53, 0x8f, 0x86, 0x44, 0x60, 0x2e, + 0x02, 0x19, 0x3c, 0x2c, 0x4c, 0xbb, 0x4d, 0xcc, 0x38, 0x9a, 0x1d, 0xe9, + 0xe4, 0x40, 0x7f, 0x8a, 0x68, 0x8f, 0xc5, 0x3d, 0x88, 0x19, 0x8b, 0x54, + 0xc0, 0x00, 0x00, 0x61, 0x2c, 0xb5, 0x30, 0x7d, 0xe8, 0x08, 0x5a, 0xd9, + 0x05, 0x94, 0x3f, 0xab, 0xd8, 0x94, 0x04, 0xbe, 0xa1, 0x00, 0x92, 0x19, + 0x1e, 0xa2, 0x00, 0x18, 0x00, 0x14, 0x31, 0x73, 0xa0, 0x65, 0x1e, 0x03, + 0x43, 0x37, 0x0b, 0xb9, 0xd3, 0xa5, 0x28, 0x8a, 0x55, 0x96, 0x2c, 0xbd, + 0x35, 0x0c, 0x2d, 0x14, 0x84, 0xc1, 0x05, 0x37, 0xde, 0x0b, 0xd6, 0x48, + 0xd2, 0x3b, 0xf4, 0x45, 0xbb, 0x30, 0x36, 0x02, 0x98, 0x7e, 0x34, 0xc4, + 0x38, 0x62, 0x99, 0xbf, 0x99, 0x19, 0x9a, 0xdf, 0x20, 0x68, 0xc2, 0xd2, + 0x85, 0xc7, 0xff, 0x4e, 0xf8, 0x47, 0xca, 0xcc, 0x21, 0xdb, 0xbe, 0x86, + 0xe1, 0x9d, 0x38, 0x66, 0x8c, 0x26, 0x00, 0x95, 0x00, 0xca, 0x99, 0x76, + 0xb5, 0x04, 0x8f, 0x9a, 0x01, 0xd8, 0x84, 0xda, 0xbf, 0xd9, 0x42, 0xf8, + 0xb7, 0xe4, 0x5d, 0xe8, 0xc9, 0x3e, 0x7f, 0x8b, 0xe3, 0xeb, 0x0e, 0x3e, + 0xe9, 0x4e, 0x3a, 0xf4, 0xa0, 0x8e, 0xf5, 0xde, 0x00, 0xf0, 0x55, 0xa7, + 0xae, 0x7e, 0x4f, 0x08, 0x97, 0x00, 0x00, 0x21, 0x52, 0xa9, 0x74, 0x4a, + 0x5a, 0x5a, 0xda, 0x5f, 0x6f, 0xbb, 0xed, 0x36, 0x23, 0x00, 0x7a, 0xcf, + 0x9e, 0x3d, 0x8a, 0x9a, 0x9a, 0x9a, 0xb9, 0x00, 0xf2, 0x18, 0x21, 0x42, + 0x39, 0xd9, 0xbd, 0xb1, 0xc2, 0x56, 0x03, 0x20, 0x02, 0xc0, 0x6d, 0xbd, + 0x7a, 0xf5, 0xba, 0x3f, 0x2a, 0x2a, 0xaa, 0x7f, 0x42, 0x42, 0x82, 0x2c, + 0x36, 0x36, 0x56, 0x62, 0x30, 0x18, 0xe8, 0xba, 0xba, 0x3a, 0x4b, 0x61, + 0x61, 0xa1, 0xa1, 0xb2, 0xb2, 0xf2, 0x57, 0x9d, 0x4e, 0xf7, 0x25, 0x23, + 0xac, 0xea, 0x09, 0xc5, 0x66, 0x75, 0xe2, 0x7e, 0xa6, 0x1c, 0x94, 0xbf, + 0x12, 0x40, 0x08, 0x80, 0xc4, 0x88, 0x88, 0x88, 0xcd, 0x23, 0x47, 0x8e, + 0xb4, 0x02, 0x40, 0x51, 0x51, 0x91, 0xa2, 0xa6, 0xa6, 0x66, 0x5d, 0x6d, + 0x6d, 0xed, 0x27, 0x0c, 0xbe, 0x16, 0x37, 0x63, 0x67, 0x0d, 0x17, 0x25, + 0x63, 0xa4, 0x44, 0x00, 0x18, 0xd7, 0xbb, 0x77, 0xef, 0x99, 0xa1, 0xa1, + 0xa1, 0x49, 0xc9, 0xc9, 0xc9, 0x12, 0xb5, 0x5a, 0x2d, 0xd6, 0x6a, 0xb5, + 0xf6, 0x1b, 0x37, 0x6e, 0xd8, 0x6a, 0x6b, 0x6b, 0x1b, 0x4b, 0x4b, 0x4b, + 0x7f, 0x6e, 0x69, 0x69, 0xf9, 0x37, 0x80, 0xeb, 0x0c, 0xee, 0xac, 0xe1, + 0x61, 0x71, 0x14, 0xb0, 0x02, 0x7d, 0x84, 0x30, 0x7d, 0x4c, 0xed, 0xd3, + 0xa7, 0xcf, 0x7d, 0x61, 0x61, 0x61, 0x31, 0x09, 0x09, 0x09, 0xd2, 0x90, + 0x90, 0x10, 0x4a, 0xab, 0xd5, 0xd2, 0xe5, 0xe5, 0xe5, 0xd6, 0xfa, 0xfa, + 0xfa, 0x86, 0xa2, 0xa2, 0xa2, 0x7d, 0x16, 0x8b, 0xe5, 0x07, 0x46, 0xa0, + 0x37, 0x30, 0x82, 0x9c, 0x06, 0x60, 0xf5, 0x70, 0x3e, 0x59, 0x83, 0x2e, + 0x5c, 0xa1, 0x50, 0x0c, 0x57, 0xab, 0xd5, 0xef, 0x46, 0x45, 0x45, 0xb5, + 0x32, 0xb8, 0xda, 0x1b, 0x1b, 0x1b, 0xe5, 0x76, 0xbb, 0x7d, 0x43, 0x65, + 0x65, 0xe5, 0x87, 0xc4, 0x2e, 0xda, 0xe6, 0xc4, 0x48, 0x62, 0xf1, 0x57, + 0x01, 0xe8, 0x9b, 0x90, 0x90, 0xf0, 0x61, 0x50, 0x50, 0x10, 0x4d, 0xd3, + 0xb4, 0xe3, 0xb1, 0x02, 0xef, 0xa7, 0x14, 0x45, 0xd9, 0x28, 0x8a, 0xb2, + 0xea, 0x74, 0xba, 0x86, 0xd2, 0xd2, 0xd2, 0xa7, 0x98, 0xf6, 0x49, 0x8f, + 0x09, 0x69, 0x80, 0xca, 0x19, 0x25, 0x16, 0x06, 0xa0, 0x97, 0x5a, 0xad, + 0x9e, 0x97, 0x98, 0x98, 0x38, 0x7e, 0xc0, 0x80, 0x01, 0xca, 0xa4, 0xa4, + 0x24, 0xb9, 0x48, 0x24, 0x42, 0x7d, 0x7d, 0xbd, 0xf9, 0xd4, 0xa9, 0x53, + 0x96, 0x9a, 0x9a, 0x9a, 0xcb, 0xc5, 0xc5, 0xc5, 0xdf, 0x00, 0x38, 0xc6, + 0x18, 0x4c, 0x14, 0x61, 0x24, 0xb1, 0x7c, 0x44, 0xb1, 0x34, 0x0f, 0x0f, + 0x0f, 0xbf, 0x33, 0x22, 0x22, 0xe2, 0x59, 0x91, 0x48, 0x24, 0x76, 0xc0, + 0xd9, 0xe5, 0xb2, 0xa1, 0x28, 0xca, 0x06, 0xc0, 0xa6, 0xd7, 0xeb, 0xa9, + 0xd2, 0xd2, 0xd2, 0x3f, 0x00, 0xb8, 0x42, 0x78, 0x4b, 0x84, 0xe6, 0x97, + 0x35, 0xa0, 0xc3, 0x01, 0x4c, 0x4a, 0x4a, 0x4a, 0xba, 0x47, 0xad, 0x56, + 0x27, 0x25, 0x27, 0x27, 0x4b, 0x43, 0x43, 0x43, 0x45, 0xcd, 0xcd, 0xcd, + 0x74, 0x75, 0x75, 0xb5, 0xad, 0xba, 0xba, 0x5a, 0x57, 0x56, 0x56, 0xf6, + 0xb3, 0x5e, 0xaf, 0xff, 0x9e, 0x31, 0x68, 0x1a, 0x18, 0x85, 0xcd, 0x7a, + 0xc3, 0x68, 0x27, 0xf3, 0x49, 0xf2, 0xe8, 0x84, 0xe4, 0xe4, 0xe4, 0xd9, + 0x51, 0x51, 0x51, 0xbd, 0xd2, 0xd2, 0xd2, 0x64, 0x51, 0x51, 0x51, 0x12, + 0xbd, 0x5e, 0x6f, 0xbb, 0x7c, 0xf9, 0xb2, 0xb9, 0xac, 0xac, 0xac, 0xa1, + 0xb8, 0xb8, 0xf8, 0x3b, 0xa3, 0xd1, 0xb8, 0x97, 0x31, 0x36, 0x44, 0x8c, + 0xf1, 0x62, 0x14, 0x9a, 0x63, 0xbf, 0xe2, 0xf3, 0xc3, 0x7f, 0xfb, 0xdc, + 0xf5, 0x38, 0xde, 0x5d, 0xcd, 0xd9, 0xf4, 0xc5, 0x43, 0x28, 0x6e, 0x35, + 0x80, 0x24, 0x00, 0x63, 0x53, 0x53, 0x53, 0x4f, 0x9e, 0x3b, 0x77, 0x8e, + 0xa6, 0x69, 0x9a, 0xbe, 0x71, 0xe3, 0x06, 0x9d, 0x91, 0x91, 0x71, 0x19, + 0xc0, 0x60, 0x00, 0x91, 0xcc, 0xee, 0x49, 0x24, 0xd0, 0x86, 0x94, 0x69, + 0x23, 0x11, 0xc0, 0xc8, 0xa0, 0xa0, 0xa0, 0xb7, 0x47, 0x8f, 0x1e, 0x5d, + 0x7b, 0xe8, 0xd0, 0x21, 0xda, 0x64, 0x32, 0xd1, 0x8e, 0x50, 0x55, 0x55, + 0x45, 0xbf, 0xfb, 0xee, 0xbb, 0x66, 0xb9, 0x5c, 0xde, 0x0c, 0x60, 0x2e, + 0x80, 0x4c, 0x66, 0x27, 0xc3, 0xee, 0x50, 0x29, 0xa2, 0x6d, 0x11, 0xe1, + 0x16, 0x56, 0x31, 0xbb, 0xc2, 0x78, 0xe6, 0x37, 0x53, 0x00, 0xbc, 0xfd, + 0xe7, 0x3f, 0xff, 0xb9, 0x99, 0x6d, 0x7b, 0xef, 0xde, 0xbd, 0x74, 0x4c, + 0x4c, 0xcc, 0x26, 0x00, 0x03, 0x18, 0x41, 0x2c, 0x63, 0xdb, 0x13, 0x18, + 0xbf, 0x88, 0xf9, 0x3e, 0x04, 0x40, 0x5f, 0x00, 0x63, 0xc3, 0xc2, 0xc2, + 0x76, 0x3c, 0xf0, 0xc0, 0x03, 0x8d, 0x27, 0x4f, 0x9e, 0xa4, 0xed, 0x76, + 0x7b, 0x07, 0xdc, 0x2b, 0x2b, 0x2b, 0xe9, 0xb7, 0xdf, 0x7e, 0xdb, 0x14, + 0x15, 0x15, 0x55, 0x07, 0xe0, 0x09, 0x00, 0xc3, 0x18, 0x7c, 0x82, 0xd8, + 0x9d, 0xa5, 0x40, 0x1f, 0x72, 0x06, 0xef, 0x7e, 0x00, 0xc6, 0x47, 0x46, + 0x46, 0xee, 0x9f, 0x3f, 0x7f, 0xbe, 0xee, 0xc2, 0x85, 0x0b, 0x82, 0x7d, + 0x94, 0x96, 0x96, 0xd2, 0xcf, 0x3c, 0xf3, 0x8c, 0x31, 0x30, 0x30, 0x50, + 0x0b, 0x60, 0x0e, 0x80, 0x81, 0x42, 0xf4, 0x71, 0x32, 0x9f, 0x22, 0x66, + 0x9e, 0x22, 0x00, 0x64, 0x00, 0x98, 0x9d, 0x99, 0x99, 0x59, 0x52, 0x56, + 0x56, 0xc6, 0xeb, 0xe3, 0xc8, 0x91, 0x23, 0x74, 0xef, 0xde, 0xbd, 0xff, + 0xc5, 0xd0, 0x31, 0x82, 0xc1, 0x91, 0x72, 0xd2, 0xa6, 0x8c, 0xc1, 0xbf, + 0x3f, 0x80, 0xd7, 0x56, 0xad, 0x5a, 0x65, 0xad, 0xaa, 0xaa, 0xa2, 0x3d, + 0x7d, 0x26, 0x4e, 0x9c, 0x58, 0x09, 0x20, 0x8b, 0xd9, 0xa9, 0x2a, 0x01, + 0x88, 0x89, 0xb6, 0xc5, 0xcc, 0xdf, 0xa2, 0x99, 0x71, 0xfe, 0xbe, 0x77, + 0xef, 0xde, 0x67, 0xde, 0x7b, 0xef, 0x3d, 0x93, 0x56, 0xab, 0xa5, 0x85, + 0x20, 0x27, 0x27, 0x87, 0x06, 0x40, 0x6b, 0x34, 0x9a, 0x77, 0x00, 0x8c, + 0x62, 0x78, 0x57, 0x43, 0xd2, 0x9f, 0x98, 0xd7, 0x7e, 0xf1, 0xf1, 0xf1, + 0x5b, 0x7e, 0xfc, 0xf1, 0x47, 0xda, 0x1b, 0x9c, 0xc9, 0x67, 0xc5, 0x8a, + 0x15, 0x06, 0x00, 0xcf, 0x03, 0xe8, 0xcd, 0xf0, 0xb9, 0xd8, 0xc9, 0xfc, + 0xf6, 0x05, 0x30, 0x3e, 0x3c, 0x3c, 0xfc, 0x5f, 0xf3, 0xe6, 0xcd, 0x6b, + 0x3c, 0x71, 0xe2, 0x04, 0x6d, 0xb1, 0x58, 0x3a, 0xe0, 0x5f, 0x5b, 0x5b, + 0x4b, 0xbf, 0xf5, 0xd6, 0x5b, 0x66, 0x89, 0x44, 0x62, 0x06, 0xf0, 0x10, + 0xb3, 0xbe, 0x62, 0x18, 0x3a, 0x48, 0x04, 0xf8, 0x5f, 0xc1, 0x18, 0x46, + 0xfd, 0x00, 0x8c, 0x67, 0x79, 0xf4, 0xdc, 0xb9, 0x73, 0x82, 0xfc, 0x53, + 0x52, 0x52, 0x42, 0xcf, 0x9b, 0x37, 0xcf, 0x18, 0x12, 0x12, 0x52, 0x04, + 0xe0, 0x1e, 0x66, 0x2d, 0x44, 0xb9, 0xe3, 0x1f, 0xff, 0xe3, 0x7f, 0xfc, + 0x4f, 0x0f, 0xe9, 0xde, 0x5b, 0xc8, 0x00, 0x90, 0x33, 0x0a, 0x60, 0x20, + 0x80, 0xff, 0x37, 0x6d, 0xda, 0xb4, 0x3a, 0x56, 0x90, 0x6c, 0xda, 0xb4, + 0xc9, 0xa2, 0xd1, 0x68, 0x3e, 0x65, 0x04, 0x94, 0xa0, 0x92, 0x20, 0xbc, + 0x07, 0xd1, 0x00, 0x86, 0x00, 0xf8, 0xa3, 0x4c, 0x26, 0xb3, 0xd5, 0xd7, + 0xd7, 0xd3, 0xee, 0x60, 0xff, 0xfe, 0xfd, 0x74, 0x4a, 0x4a, 0xca, 0x05, + 0x00, 0xf7, 0x32, 0xc2, 0x2d, 0x84, 0x54, 0xd8, 0x0e, 0x9e, 0x85, 0x10, + 0x00, 0xbd, 0x18, 0x25, 0x34, 0x0a, 0xc0, 0x7d, 0x00, 0x96, 0x85, 0x86, + 0x86, 0x6a, 0x0b, 0x0a, 0x0a, 0x68, 0xd2, 0x00, 0x88, 0x8e, 0x8e, 0xfe, + 0x06, 0xc0, 0x70, 0x06, 0x27, 0x85, 0x0b, 0x85, 0x29, 0x66, 0x8c, 0x8a, + 0x78, 0x00, 0x23, 0x43, 0x43, 0x43, 0x37, 0x3c, 0xf9, 0xe4, 0x93, 0x2d, + 0x36, 0x9b, 0xcd, 0x2d, 0xee, 0x17, 0x2e, 0x5c, 0xa0, 0x07, 0x0f, 0x1e, + 0x5c, 0x07, 0xe0, 0x59, 0x00, 0x83, 0x18, 0x01, 0x1b, 0xe0, 0xa0, 0x1c, + 0x58, 0xfc, 0x83, 0x00, 0x24, 0x00, 0xb8, 0x23, 0x3c, 0x3c, 0x7c, 0x67, + 0x46, 0x46, 0x86, 0x55, 0x48, 0x70, 0x3b, 0xc2, 0xa6, 0x4d, 0x9b, 0xec, + 0xe9, 0xe9, 0xe9, 0x57, 0x19, 0x23, 0x29, 0xd5, 0x91, 0x3e, 0x4e, 0xe6, + 0x53, 0xca, 0x28, 0xc3, 0x64, 0x00, 0x13, 0xc2, 0xc3, 0xc3, 0xff, 0xf5, + 0xd1, 0x47, 0x1f, 0x75, 0xd0, 0x42, 0x47, 0x8e, 0x1c, 0xa1, 0x93, 0x92, + 0x92, 0x7e, 0x04, 0x30, 0x82, 0x51, 0x3e, 0x0a, 0x17, 0x06, 0x00, 0x3b, + 0xbf, 0xc3, 0x23, 0x22, 0x22, 0xbe, 0xda, 0xbd, 0x7b, 0x37, 0xed, 0x0d, + 0x64, 0x65, 0x65, 0x55, 0x02, 0xb8, 0x8b, 0xa1, 0xb3, 0x0a, 0x80, 0xc4, + 0x41, 0x79, 0x86, 0x31, 0xf3, 0x7a, 0x77, 0x50, 0x50, 0x50, 0xc3, 0xf6, + 0xed, 0xdb, 0xdd, 0x4e, 0x40, 0x7d, 0x7d, 0x3d, 0x3d, 0x67, 0xce, 0x9c, + 0x46, 0x89, 0x44, 0xf2, 0x06, 0xc3, 0xbb, 0x9c, 0x81, 0x4a, 0x18, 0x2d, + 0xe1, 0x00, 0x32, 0x12, 0x13, 0x13, 0xb7, 0x1f, 0x3c, 0x78, 0x90, 0xee, + 0x2c, 0xbc, 0xfe, 0xfa, 0xeb, 0x06, 0x00, 0xcb, 0x18, 0x1e, 0x0d, 0x66, + 0xf1, 0x17, 0xe0, 0xa1, 0xdb, 0xc3, 0xc2, 0xc2, 0x76, 0x2c, 0x59, 0xb2, + 0xa4, 0xd5, 0x13, 0x1e, 0xda, 0xb1, 0x63, 0x07, 0x3d, 0x70, 0xe0, 0xc0, + 0x12, 0x00, 0x0f, 0x02, 0x48, 0x63, 0xe8, 0x20, 0x63, 0x8d, 0x6c, 0x01, + 0x03, 0x7d, 0x4c, 0x58, 0x58, 0xd8, 0x8e, 0x09, 0x13, 0x26, 0x98, 0x3d, + 0xc1, 0x7b, 0xe5, 0xca, 0x95, 0xd6, 0xa4, 0xa4, 0xa4, 0x53, 0x00, 0xa6, + 0x03, 0x48, 0x21, 0xf8, 0x47, 0xe4, 0x17, 0xc2, 0xfe, 0xc7, 0xff, 0xdc, + 0xbc, 0x47, 0x72, 0x8b, 0x78, 0x3e, 0xc8, 0x73, 0x52, 0x8d, 0x46, 0xa3, + 0x99, 0xf0, 0xd0, 0x43, 0x0f, 0x71, 0xa5, 0xf9, 0xbe, 0xf8, 0xe2, 0x0b, + 0xad, 0x56, 0xab, 0x3d, 0xea, 0xc4, 0x6d, 0x4b, 0xba, 0xff, 0x59, 0x77, + 0x73, 0x74, 0x6a, 0x6a, 0xea, 0xe3, 0x7b, 0xf7, 0xee, 0x15, 0x91, 0xb7, + 0xd9, 0x65, 0x67, 0x67, 0xe3, 0xd0, 0xa1, 0x43, 0x96, 0xb8, 0xb8, 0x38, + 0xd1, 0xef, 0x7e, 0xf7, 0x3b, 0x31, 0x7b, 0xb1, 0xcd, 0xa4, 0x49, 0x93, + 0xb0, 0x64, 0xc9, 0x92, 0xbe, 0x2f, 0xbe, 0xf8, 0xe2, 0xfd, 0x7a, 0xbd, + 0xfe, 0xef, 0xe4, 0x59, 0x28, 0xe1, 0xc6, 0x65, 0xdd, 0xc3, 0x6a, 0x46, + 0x88, 0x25, 0x02, 0x48, 0x08, 0x09, 0x09, 0x19, 0x22, 0x93, 0xc9, 0x26, + 0x7f, 0xf3, 0xcd, 0x37, 0x01, 0x8e, 0x05, 0x82, 0x68, 0x9a, 0x96, 0xba, + 0x38, 0x9b, 0x16, 0x72, 0xad, 0x06, 0x01, 0x18, 0x98, 0x92, 0x92, 0x32, + 0x73, 0xed, 0xda, 0xb5, 0x01, 0x22, 0x51, 0xfb, 0xcf, 0x8e, 0x1e, 0x3d, + 0x8a, 0xf2, 0xf2, 0x72, 0x48, 0x24, 0x12, 0x64, 0x64, 0x64, 0x20, 0x25, + 0x25, 0x05, 0x00, 0xd0, 0xbf, 0x7f, 0x7f, 0x6c, 0xdb, 0xb6, 0x2d, 0x6c, + 0xe6, 0xcc, 0x99, 0x8b, 0x2e, 0x5e, 0xbc, 0x78, 0x9d, 0x70, 0xb1, 0x5a, + 0x29, 0x8a, 0x22, 0x63, 0x01, 0x48, 0xf7, 0xf6, 0xed, 0x63, 0xc7, 0x8e, + 0x1d, 0xbf, 0x63, 0xc7, 0x0e, 0x31, 0x7b, 0xe6, 0xa4, 0xd3, 0xe9, 0xf0, + 0xc9, 0x27, 0x9f, 0xd8, 0x74, 0x3a, 0x9d, 0x35, 0x29, 0x29, 0x49, 0x7a, + 0xef, 0xbd, 0xf7, 0x8a, 0xd8, 0x22, 0x2b, 0x0f, 0x3d, 0xf4, 0x10, 0x25, + 0x93, 0xc9, 0x92, 0x16, 0x2d, 0x5a, 0x34, 0xaf, 0xba, 0xba, 0xba, 0x88, + 0x39, 0x06, 0x30, 0x39, 0xba, 0x89, 0x1d, 0x5c, 0xd1, 0x6c, 0x6c, 0x44, + 0x30, 0x80, 0xdb, 0x06, 0x0f, 0x1e, 0x3c, 0xf6, 0x91, 0x47, 0x1e, 0x91, + 0x38, 0xf1, 0x42, 0xb1, 0x01, 0x72, 0x62, 0x17, 0x2e, 0x71, 0x72, 0x8e, + 0x03, 0xd5, 0x6a, 0x75, 0x2f, 0xb2, 0xf4, 0x66, 0x6b, 0x6b, 0xab, 0xdb, + 0x7b, 0xb1, 0x4d, 0x26, 0x93, 0xc8, 0x21, 0x78, 0x8e, 0x26, 0xda, 0x66, + 0x8f, 0x46, 0x42, 0x23, 0x23, 0x23, 0x9f, 0x7e, 0xfa, 0xe9, 0xa7, 0x55, + 0xb3, 0x67, 0xcf, 0xe6, 0x26, 0xe0, 0xcc, 0x99, 0x33, 0xf8, 0xf2, 0xcb, + 0x2f, 0xcd, 0x26, 0x93, 0xc9, 0x36, 0x6e, 0xdc, 0x38, 0xf9, 0x9c, 0x39, + 0x73, 0x44, 0x40, 0x5b, 0x89, 0xda, 0x75, 0xeb, 0xd6, 0x05, 0x5f, 0xba, + 0x74, 0xe9, 0x7f, 0x0a, 0x0a, 0x0a, 0xf6, 0x03, 0x68, 0x04, 0x3f, 0x1a, + 0x9e, 0x3d, 0x0a, 0xb0, 0x53, 0x14, 0x45, 0x75, 0xe5, 0x8a, 0x56, 0x9a, + 0xa6, 0x85, 0xd2, 0xf8, 0x1c, 0x69, 0xae, 0x02, 0x70, 0xdb, 0xa8, 0x51, + 0xa3, 0xc6, 0xaf, 0x5a, 0xb5, 0x4a, 0xc1, 0xf2, 0x90, 0xdd, 0x6e, 0xc7, + 0xd6, 0xad, 0x5b, 0xe9, 0xcb, 0x97, 0x2f, 0x9b, 0xa3, 0xa2, 0xa2, 0xc4, + 0x53, 0xa6, 0x4c, 0x91, 0xb0, 0x77, 0x5f, 0xcc, 0x9a, 0x35, 0x0b, 0x0a, + 0x85, 0xa2, 0xd7, 0x13, 0x4f, 0x3c, 0xb1, 0xb0, 0xa2, 0xa2, 0xa2, 0x90, + 0x99, 0xdf, 0x56, 0xe2, 0x18, 0x8c, 0x8c, 0xbd, 0xd0, 0x00, 0x98, 0x3c, + 0x70, 0xe0, 0xc0, 0xa9, 0xfb, 0xf6, 0xed, 0x93, 0x92, 0x9e, 0xc4, 0xef, + 0xbf, 0xff, 0x1e, 0x97, 0x2e, 0x5d, 0xb2, 0x04, 0x07, 0x07, 0x8b, 0xb2, + 0xb2, 0xb2, 0xc4, 0xec, 0x4d, 0x9b, 0xaf, 0xbc, 0xf2, 0x8a, 0x58, 0x2e, + 0x97, 0xf7, 0x7f, 0xe3, 0x8d, 0x37, 0xee, 0xd7, 0xe9, 0x74, 0xeb, 0x89, + 0x58, 0x1b, 0x1b, 0xfc, 0xe0, 0x07, 0x3f, 0xdc, 0xdc, 0x33, 0x87, 0x5b, + 0x60, 0xf7, 0x2f, 0x65, 0x76, 0x05, 0x69, 0x00, 0xee, 0xcb, 0xc8, 0xc8, + 0x28, 0xad, 0xad, 0xad, 0xa5, 0x69, 0x9a, 0xa6, 0xf3, 0xf3, 0xf3, 0xe9, + 0x94, 0x94, 0x94, 0x33, 0x8c, 0xeb, 0xb6, 0x2f, 0xa3, 0x80, 0x25, 0x4e, + 0x3c, 0x08, 0x91, 0x8c, 0x97, 0xe0, 0x2f, 0xcf, 0x3f, 0xff, 0xbc, 0x9e, + 0xdc, 0x85, 0xac, 0x58, 0xb1, 0xc2, 0x2c, 0x97, 0xcb, 0xb5, 0x00, 0xb6, + 0x52, 0x14, 0xb5, 0x1b, 0x00, 0x5d, 0x54, 0x54, 0xc4, 0x7d, 0xdf, 0xd0, + 0xd0, 0x40, 0x67, 0x66, 0x66, 0x96, 0x31, 0x3b, 0xfa, 0x14, 0x46, 0xd0, + 0x49, 0x88, 0xdd, 0x55, 0x20, 0xb3, 0xbb, 0xbe, 0x33, 0x31, 0x31, 0xb1, + 0xf6, 0x91, 0x47, 0x1e, 0xa9, 0x5d, 0xb6, 0x6c, 0x99, 0xfe, 0xab, 0xaf, + 0xbe, 0xb2, 0x95, 0x97, 0x97, 0x77, 0xd8, 0xf5, 0xec, 0xdd, 0xbb, 0x97, + 0x8e, 0x8a, 0x8a, 0xda, 0x05, 0x60, 0x0c, 0xe3, 0x72, 0x0e, 0x70, 0xb3, + 0xb3, 0x8d, 0x01, 0x30, 0x22, 0x3c, 0x3c, 0xfc, 0xeb, 0xef, 0xbe, 0xfb, + 0xce, 0xca, 0xb6, 0x63, 0xb3, 0xd9, 0xe8, 0xdf, 0xff, 0xfe, 0xf7, 0xa6, + 0xc8, 0xc8, 0xc8, 0x72, 0xb9, 0x5c, 0xfe, 0x83, 0x46, 0xa3, 0xd9, 0x97, + 0x96, 0x96, 0x56, 0x77, 0xe6, 0xcc, 0x19, 0xbb, 0xc3, 0xee, 0xb0, 0x45, + 0x24, 0x12, 0xad, 0x66, 0xbc, 0x00, 0x3c, 0x2f, 0x09, 0xa3, 0x1c, 0xd8, + 0x3e, 0x86, 0x27, 0x25, 0x25, 0xfd, 0x7c, 0xfc, 0xf8, 0x71, 0xee, 0xb7, + 0x67, 0xcf, 0x9e, 0xa5, 0x03, 0x03, 0x03, 0xcd, 0x12, 0x89, 0xe4, 0x27, + 0x00, 0x9f, 0xab, 0x54, 0xaa, 0x03, 0x71, 0x71, 0x71, 0x26, 0xa3, 0xd1, + 0xc8, 0xbd, 0x63, 0x34, 0x1a, 0xe9, 0x41, 0x83, 0x06, 0x55, 0x31, 0x3b, + 0xe8, 0xde, 0x8c, 0x21, 0x21, 0x76, 0xe1, 0xcd, 0x09, 0x63, 0xe6, 0x73, + 0x5a, 0xef, 0xde, 0xbd, 0xcf, 0xe6, 0xe6, 0xe6, 0xb2, 0xc7, 0x0a, 0xf6, + 0x9a, 0x9a, 0x1a, 0x9e, 0x07, 0x20, 0x31, 0x31, 0xf1, 0x27, 0x00, 0xe3, + 0x19, 0xef, 0x44, 0xa0, 0x13, 0x3a, 0x89, 0x98, 0x3e, 0xfb, 0x00, 0xb8, + 0x33, 0x3d, 0x3d, 0xfd, 0x0a, 0x4b, 0xf7, 0xc6, 0xc6, 0x46, 0xba, 0x5f, + 0xbf, 0x7e, 0x2d, 0xe9, 0xe9, 0xe9, 0xd5, 0xe9, 0xe9, 0xe9, 0x95, 0x19, + 0x19, 0x19, 0xe5, 0x19, 0x19, 0x19, 0x65, 0xcc, 0x53, 0x9a, 0x91, 0x91, + 0x51, 0x34, 0x60, 0xc0, 0x80, 0x6b, 0xf1, 0xf1, 0xf1, 0x27, 0x09, 0xfa, + 0x04, 0x38, 0xec, 0xd2, 0x43, 0x99, 0xa3, 0x8a, 0x27, 0x26, 0x4f, 0x9e, + 0x5c, 0x67, 0xb5, 0x72, 0x53, 0x40, 0x7f, 0xf1, 0xc5, 0x17, 0xd6, 0xb8, + 0xb8, 0xb8, 0x0a, 0x00, 0x9b, 0x00, 0x7c, 0x1c, 0x18, 0x18, 0x58, 0xbe, + 0x74, 0xe9, 0x52, 0x23, 0x49, 0xff, 0xe5, 0xcb, 0x97, 0x6b, 0x19, 0xf7, + 0x7c, 0x22, 0x49, 0x1b, 0xc2, 0x13, 0x92, 0x14, 0x17, 0x17, 0xb7, 0x3e, + 0x33, 0x33, 0xb3, 0x61, 0xea, 0xd4, 0xa9, 0xd5, 0x59, 0x59, 0x59, 0xb5, + 0x59, 0x59, 0x59, 0x75, 0x59, 0x59, 0x59, 0xf5, 0xec, 0x33, 0x65, 0xca, + 0x94, 0xc6, 0x29, 0x53, 0xa6, 0x68, 0x27, 0x4f, 0x9e, 0x6c, 0x98, 0x30, + 0x61, 0x42, 0xeb, 0xde, 0xbd, 0x7b, 0xed, 0xac, 0xeb, 0xbe, 0xa4, 0xa4, + 0x84, 0x1e, 0x39, 0x72, 0x64, 0x39, 0x80, 0x85, 0x8e, 0xf4, 0x67, 0xc6, + 0xa0, 0x60, 0xf8, 0x73, 0x68, 0x64, 0x64, 0xe4, 0x8e, 0xec, 0xec, 0x6c, + 0x8e, 0x3f, 0xcc, 0x66, 0x33, 0x9d, 0x91, 0x91, 0x61, 0x52, 0xa9, 0x54, + 0xe7, 0x00, 0x6c, 0x04, 0xb0, 0xbd, 0x77, 0xef, 0xde, 0xb5, 0x87, 0x0e, + 0x1d, 0xb2, 0x93, 0x7c, 0x76, 0xfb, 0xed, 0xb7, 0x57, 0x03, 0x98, 0xc1, + 0x78, 0x6d, 0xc8, 0xf6, 0x59, 0xef, 0x42, 0x22, 0x80, 0xf1, 0xc9, 0xc9, + 0xc9, 0xf9, 0xa7, 0x4f, 0x9f, 0xe6, 0xc6, 0xae, 0xd3, 0xe9, 0xe8, 0xa1, + 0x43, 0x87, 0x1a, 0x03, 0x02, 0x02, 0x2a, 0x01, 0x6c, 0x92, 0x48, 0x24, + 0xbb, 0xe4, 0x72, 0xb9, 0xf9, 0xc4, 0x89, 0x13, 0x5c, 0xfb, 0x7a, 0xbd, + 0x9e, 0x1e, 0x3c, 0x78, 0x70, 0x05, 0x80, 0x59, 0x84, 0x07, 0x43, 0xea, + 0xdf, 0x85, 0xf9, 0x1f, 0xff, 0xf3, 0xdf, 0xed, 0x01, 0xa0, 0x1c, 0x76, + 0xa7, 0x43, 0xc7, 0x8c, 0x19, 0x13, 0xcc, 0xee, 0x3e, 0xff, 0xf5, 0xaf, + 0x7f, 0x19, 0x0b, 0x0b, 0x0b, 0x7f, 0x76, 0xd8, 0x95, 0xd8, 0x5d, 0xb5, + 0x91, 0x98, 0x98, 0x38, 0x7a, 0xf6, 0xec, 0xd9, 0xdc, 0x15, 0x55, 0xd7, + 0xae, 0x5d, 0xc3, 0xb6, 0x6d, 0xdb, 0xaa, 0x4c, 0x26, 0xd3, 0xfb, 0x00, + 0x1a, 0x69, 0x9a, 0x96, 0x00, 0x28, 0x7a, 0xe9, 0xa5, 0x97, 0x1e, 0xfe, + 0xfa, 0xeb, 0xaf, 0x55, 0x40, 0xdb, 0xfd, 0xee, 0xe3, 0xc6, 0x8d, 0x0b, + 0x2e, 0x28, 0x28, 0x18, 0x08, 0xa0, 0x84, 0x51, 0x0a, 0xad, 0x54, 0x7b, + 0x58, 0x26, 0xbb, 0x0b, 0x0a, 0xbf, 0xfb, 0xee, 0xbb, 0xa9, 0x75, 0xeb, + 0xd6, 0x85, 0x79, 0x38, 0x36, 0x77, 0xf9, 0xde, 0xbc, 0xe8, 0xf3, 0x88, + 0x88, 0x88, 0x21, 0x77, 0xdc, 0x71, 0x07, 0xb7, 0x4d, 0xdc, 0xbe, 0x7d, + 0xbb, 0x7d, 0xdf, 0xbe, 0x7d, 0x85, 0x5a, 0xad, 0x76, 0x1d, 0x00, 0xbd, + 0xc9, 0x64, 0x92, 0x69, 0xb5, 0xda, 0x73, 0x83, 0x07, 0x0f, 0x7e, 0xde, + 0x60, 0x30, 0x40, 0xa9, 0x54, 0x02, 0x00, 0xa6, 0x4e, 0x9d, 0x1a, 0xf0, + 0xcf, 0x7f, 0xfe, 0x73, 0xf8, 0xf5, 0xeb, 0xd7, 0x77, 0xb0, 0xee, 0x55, + 0x87, 0x5d, 0x28, 0x17, 0x24, 0x16, 0x14, 0x14, 0xd4, 0x27, 0x33, 0x33, + 0x93, 0x43, 0xe0, 0x1f, 0xff, 0xf8, 0x47, 0x73, 0x4b, 0x4b, 0xcb, 0x97, + 0x4c, 0x30, 0x9b, 0xcd, 0x60, 0x30, 0x04, 0x9b, 0xcd, 0x66, 0xf9, 0x8a, + 0x15, 0x2b, 0x46, 0xfc, 0xed, 0x6f, 0x7f, 0x93, 0x00, 0x6d, 0x57, 0x51, + 0x0e, 0x1c, 0x38, 0x50, 0x9e, 0x9f, 0x9f, 0x9f, 0xc4, 0x04, 0x1d, 0x76, + 0xd8, 0xad, 0x0b, 0x04, 0xfe, 0x85, 0xca, 0xe5, 0xf2, 0xbb, 0xee, 0xbb, + 0xef, 0xbe, 0xe4, 0x51, 0xa3, 0x46, 0xa1, 0xa2, 0xa2, 0x02, 0x59, 0x59, + 0x59, 0xd6, 0x0d, 0x1b, 0x36, 0x48, 0x23, 0x22, 0x22, 0xe0, 0x24, 0xc8, + 0xd2, 0x15, 0x9d, 0xd8, 0x20, 0x37, 0x39, 0x00, 0x35, 0x5b, 0xeb, 0xfd, + 0xe2, 0xc5, 0x8b, 0x68, 0x69, 0x69, 0xb9, 0x5e, 0x5e, 0x5e, 0xfe, 0x2d, + 0x13, 0x8c, 0xd7, 0x4c, 0xec, 0x30, 0x4d, 0xcc, 0x67, 0x1d, 0xda, 0x22, + 0xdf, 0xb5, 0xc4, 0x77, 0xa4, 0x77, 0x47, 0x01, 0x20, 0x48, 0xa3, 0xd1, + 0x4c, 0x78, 0xec, 0xb1, 0xc7, 0x42, 0xd8, 0x9d, 0x7a, 0x51, 0x51, 0x11, + 0xde, 0x7c, 0xf3, 0xcd, 0xba, 0x8a, 0x8a, 0x8a, 0x7f, 0x00, 0xa8, 0x06, + 0x60, 0x6d, 0x69, 0x69, 0x39, 0xb3, 0x71, 0xe3, 0xc6, 0xd7, 0x87, 0x0e, + 0x1d, 0x2a, 0x67, 0xaf, 0x1a, 0x4d, 0x4c, 0x4c, 0x54, 0x87, 0x84, 0x84, + 0xf4, 0x6f, 0x6c, 0x6c, 0xdc, 0x8e, 0x8e, 0x85, 0x7b, 0x2c, 0x00, 0x9a, + 0x2b, 0x2a, 0x2a, 0xde, 0xaf, 0xa8, 0xa8, 0xf8, 0x57, 0x41, 0x41, 0x81, + 0x1a, 0xfc, 0x74, 0x48, 0x31, 0xb1, 0xbb, 0x8e, 0x00, 0x90, 0x3a, 0x7e, + 0xfc, 0xf8, 0xd1, 0xc3, 0x86, 0x0d, 0xa3, 0x24, 0x12, 0x09, 0xf4, 0x7a, + 0x3d, 0x9e, 0x7c, 0xf2, 0xc9, 0xc6, 0x63, 0xc7, 0x8e, 0xfd, 0x03, 0x6d, + 0x99, 0x30, 0x46, 0x01, 0xef, 0x0b, 0xb7, 0x06, 0x42, 0x43, 0x43, 0x93, + 0xd3, 0xd2, 0xd2, 0x38, 0x7a, 0x7e, 0xf7, 0xdd, 0x77, 0xb8, 0x71, 0xe3, + 0xc6, 0x39, 0x83, 0xc1, 0xb0, 0x8d, 0x19, 0xbf, 0xac, 0xa8, 0xa8, 0xa8, + 0xe2, 0xf1, 0xc7, 0x1f, 0x7f, 0xe2, 0xec, 0xd9, 0xb3, 0x0a, 0xa9, 0x54, + 0x0a, 0x91, 0x48, 0x84, 0x41, 0x83, 0x06, 0xc9, 0x8f, 0x1e, 0x3d, 0x9a, + 0x08, 0xe0, 0xa2, 0xc3, 0xfc, 0x92, 0x1e, 0x80, 0xa4, 0x3e, 0x7d, 0xfa, + 0xc4, 0x0d, 0x1e, 0x3c, 0x98, 0xeb, 0xf8, 0xa3, 0x8f, 0x3e, 0xb2, 0x5c, + 0xba, 0x74, 0xe9, 0x60, 0x6b, 0x6b, 0xeb, 0x4e, 0x00, 0x3a, 0xab, 0xd5, + 0x2a, 0xb5, 0x5a, 0xad, 0x67, 0x1f, 0x7a, 0xe8, 0xa1, 0x67, 0x7f, 0xfd, + 0xf5, 0x57, 0x75, 0x70, 0x70, 0x30, 0x54, 0x2a, 0x15, 0xee, 0xb9, 0xe7, + 0x9e, 0x90, 0x33, 0x67, 0xce, 0x0c, 0x67, 0x02, 0x0e, 0xb9, 0xf5, 0x75, + 0x53, 0x0a, 0x03, 0xf8, 0xc1, 0x0f, 0x7e, 0xb8, 0xb9, 0x06, 0x00, 0xe1, + 0xba, 0x67, 0xd3, 0x8a, 0x82, 0xe2, 0xe3, 0xe3, 0xc7, 0xcf, 0x9d, 0x3b, + 0x37, 0x88, 0x75, 0xeb, 0xee, 0xdc, 0xb9, 0x53, 0x6b, 0xb7, 0xdb, 0x8f, + 0x91, 0xae, 0x6d, 0x08, 0xe7, 0x3e, 0x73, 0x01, 0x7a, 0x4a, 0xa5, 0x32, + 0x75, 0xc8, 0x90, 0x21, 0xdc, 0x97, 0x79, 0x79, 0x79, 0xf6, 0x92, 0x92, + 0x92, 0x13, 0x00, 0x4a, 0xd1, 0x16, 0xe9, 0x2c, 0x01, 0x60, 0x3d, 0x7f, + 0xfe, 0xfc, 0x2c, 0x9d, 0x4e, 0xa7, 0x62, 0xef, 0x5d, 0x9e, 0x36, 0x6d, + 0x9a, 0x72, 0xf3, 0xe6, 0xcd, 0x83, 0x9a, 0x9a, 0x9a, 0xf6, 0x3b, 0x71, + 0xdd, 0xd3, 0x00, 0xec, 0x5a, 0xad, 0x56, 0xe4, 0x58, 0x6e, 0x54, 0xa9, + 0x54, 0xba, 0xbc, 0xca, 0xd5, 0x43, 0x23, 0x21, 0x20, 0x24, 0x24, 0x44, + 0x49, 0x2a, 0xc7, 0x9f, 0x7e, 0xfa, 0xc9, 0xa0, 0xd5, 0x6a, 0xbf, 0x01, + 0x50, 0xc8, 0x28, 0xb2, 0x00, 0x00, 0xf6, 0xf8, 0xf8, 0xf8, 0xf3, 0x17, + 0x2e, 0x5c, 0xc8, 0x18, 0x3e, 0x7c, 0x38, 0x80, 0xb6, 0x5b, 0xc1, 0x02, + 0x02, 0x02, 0xe2, 0x18, 0x1a, 0xb0, 0x45, 0x59, 0x20, 0x80, 0x7f, 0x50, + 0x6c, 0x6c, 0xac, 0x84, 0xbc, 0x23, 0xfb, 0xd0, 0xa1, 0x43, 0x06, 0x00, + 0x3f, 0x31, 0xb4, 0xa1, 0x00, 0xd8, 0xcc, 0x66, 0xf3, 0xb1, 0x6b, 0xd7, + 0xae, 0x0d, 0x22, 0x79, 0x24, 0x2c, 0x2c, 0x4c, 0xc4, 0xb8, 0xc9, 0x29, + 0x17, 0x73, 0x49, 0x66, 0x61, 0x24, 0xa5, 0xa5, 0xa5, 0xcd, 0xfe, 0xe3, + 0x1f, 0xff, 0x18, 0x08, 0x00, 0x6f, 0xbd, 0xf5, 0x96, 0x59, 0xa7, 0xd3, + 0x69, 0x25, 0x12, 0x49, 0x44, 0x27, 0x8f, 0x89, 0xd8, 0xa3, 0xa2, 0x90, + 0xf0, 0xf0, 0x70, 0x09, 0x5b, 0x9b, 0xbf, 0xb4, 0xb4, 0x94, 0xae, 0xae, + 0xae, 0xae, 0x62, 0xe8, 0xd3, 0xcc, 0xf0, 0x0a, 0x9b, 0x2f, 0xdf, 0xca, + 0x7c, 0xd6, 0x31, 0xff, 0x72, 0xa9, 0x68, 0x02, 0xc6, 0xa3, 0x2a, 0x36, + 0x36, 0x76, 0xf8, 0xd8, 0xb1, 0x63, 0xb9, 0x79, 0xff, 0xe1, 0x87, 0x1f, + 0xac, 0x57, 0xaf, 0x5e, 0x3d, 0xc6, 0xb8, 0xf6, 0xd9, 0xdf, 0xb6, 0x36, + 0x36, 0x36, 0xae, 0x7a, 0xec, 0xb1, 0xc7, 0x06, 0xa3, 0x2d, 0xa5, 0xad, + 0x95, 0xa2, 0x28, 0x43, 0x6b, 0x6b, 0xeb, 0xb7, 0x02, 0xae, 0x6d, 0x36, + 0x87, 0xbf, 0x85, 0xf9, 0xbf, 0x01, 0xfc, 0x9a, 0x14, 0xe4, 0xd1, 0x52, + 0x34, 0x00, 0xc5, 0xc0, 0x81, 0x03, 0x07, 0x7f, 0xfe, 0xf9, 0xe7, 0x01, + 0xec, 0x05, 0x55, 0x2b, 0x57, 0xae, 0x6c, 0x3d, 0x72, 0xe4, 0x48, 0x36, + 0x80, 0x23, 0x0c, 0x1e, 0x2d, 0x2e, 0xd6, 0x01, 0x45, 0x51, 0x94, 0x8c, + 0xad, 0x51, 0x0e, 0x00, 0x85, 0x85, 0x85, 0xd6, 0xfa, 0xfa, 0xfa, 0xab, + 0x68, 0x4f, 0xc9, 0x93, 0x01, 0xa8, 0x92, 0x48, 0x24, 0xcd, 0x66, 0xb3, + 0x59, 0xc1, 0xd2, 0x51, 0xa5, 0x52, 0xb1, 0xde, 0x1b, 0xca, 0x85, 0x81, + 0x9d, 0x3a, 0x69, 0xd2, 0x24, 0xde, 0xbd, 0xa9, 0xbb, 0x77, 0xef, 0x6e, + 0x69, 0x6e, 0x6e, 0xfe, 0x99, 0x59, 0x5f, 0x4d, 0xcc, 0xd8, 0x2c, 0x5a, + 0xad, 0x36, 0xff, 0xd8, 0xb1, 0x63, 0x63, 0xef, 0xbc, 0xf3, 0x4e, 0x00, + 0xc0, 0x5d, 0x77, 0xdd, 0x15, 0xf0, 0xc5, 0x17, 0x5f, 0x0c, 0x2f, 0x2d, + 0x2d, 0xcd, 0x76, 0x38, 0xf2, 0xf1, 0x1b, 0x00, 0x7e, 0xf0, 0xc3, 0x7f, + 0x9b, 0x01, 0x40, 0x9c, 0x4d, 0xb3, 0xa9, 0x45, 0x31, 0xd1, 0xd1, 0xd1, + 0xfd, 0x47, 0x8f, 0x1e, 0x0d, 0xa0, 0xed, 0x12, 0x88, 0xea, 0xea, 0xea, + 0x02, 0x66, 0xe7, 0xe5, 0x28, 0xb8, 0x85, 0x04, 0x94, 0x0c, 0x40, 0x4c, + 0x7c, 0x7c, 0xbc, 0x82, 0xdd, 0x19, 0x03, 0xc0, 0xc9, 0x93, 0x27, 0x8d, + 0xad, 0xad, 0xad, 0x85, 0xcc, 0xee, 0xb0, 0x8e, 0x11, 0x50, 0x0a, 0xb3, + 0xd9, 0x5c, 0x55, 0x54, 0x54, 0x14, 0x3d, 0x68, 0xd0, 0x20, 0x00, 0x40, + 0x72, 0x72, 0x32, 0x15, 0x19, 0x19, 0x99, 0xdc, 0xd4, 0xd4, 0x14, 0x40, + 0x08, 0x68, 0xca, 0x41, 0x90, 0x5f, 0x3f, 0x7c, 0xf8, 0x70, 0xe9, 0x94, + 0x29, 0x53, 0xaa, 0x68, 0x9a, 0x96, 0xd2, 0x34, 0x2d, 0xa3, 0x69, 0x5a, + 0x26, 0x16, 0x8b, 0x43, 0x4f, 0x9d, 0x3a, 0x25, 0x67, 0x85, 0xa9, 0x37, + 0xa7, 0x30, 0x68, 0x4f, 0x3b, 0x0c, 0x08, 0x0f, 0x0f, 0x17, 0x93, 0x97, + 0xcb, 0x9c, 0x39, 0x73, 0xc6, 0x02, 0xe0, 0x1c, 0x80, 0x2a, 0x66, 0xfc, + 0x41, 0x00, 0x82, 0x4d, 0x26, 0x53, 0x75, 0x6d, 0x6d, 0x2d, 0x77, 0x1f, + 0x64, 0x70, 0x70, 0x30, 0xec, 0x76, 0xbb, 0x02, 0xc2, 0x05, 0x71, 0x58, + 0xfc, 0xcd, 0x00, 0x0c, 0xa7, 0x4f, 0x9f, 0xc6, 0x90, 0x21, 0x43, 0x2a, + 0x69, 0x9a, 0x16, 0x31, 0x57, 0x4b, 0x96, 0x31, 0x34, 0x36, 0x33, 0xca, + 0x09, 0x00, 0x78, 0x4a, 0x04, 0x00, 0x2a, 0x2b, 0x2b, 0xad, 0x8c, 0x02, + 0x71, 0x56, 0x0c, 0x88, 0xdd, 0xc9, 0xaa, 0x01, 0x84, 0x45, 0x45, 0x45, + 0xcd, 0x7b, 0xe1, 0x85, 0x17, 0xa2, 0x62, 0x62, 0x62, 0x70, 0xfc, 0xf8, + 0x71, 0xec, 0xda, 0xb5, 0xab, 0x4e, 0x24, 0x12, 0x99, 0x99, 0x5d, 0x6e, + 0x67, 0x79, 0x45, 0x02, 0x20, 0x3c, 0x3e, 0x3e, 0x9e, 0x33, 0x70, 0xf2, + 0xf3, 0xf3, 0xcd, 0x16, 0x8b, 0xc5, 0xc8, 0xb4, 0x1b, 0xc3, 0xe0, 0xa7, + 0x05, 0x50, 0xc6, 0xd0, 0xcd, 0xc8, 0xcc, 0x23, 0x59, 0x11, 0x90, 0x16, + 0x30, 0x1e, 0x23, 0xc3, 0xc3, 0xc3, 0x35, 0xe4, 0x1d, 0xdb, 0x07, 0x0f, + 0x1e, 0x34, 0x9a, 0xcd, 0xe6, 0x7a, 0x86, 0x3f, 0xa5, 0xcc, 0xbb, 0x36, + 0xab, 0xd5, 0xaa, 0xb7, 0x5a, 0xad, 0x39, 0x0c, 0x5f, 0x36, 0x32, 0x7c, + 0x55, 0x8f, 0x8e, 0x45, 0xaa, 0xc8, 0xa2, 0x3b, 0xac, 0x47, 0x82, 0xac, + 0x60, 0xc8, 0xc6, 0x1e, 0x88, 0x01, 0x58, 0xe3, 0xe2, 0xe2, 0xee, 0x7c, + 0xfd, 0xf5, 0xd7, 0x43, 0xd9, 0x1b, 0xdd, 0xb2, 0xb3, 0xb3, 0xed, 0xdf, + 0x7c, 0xf3, 0xcd, 0x79, 0xbd, 0x5e, 0xff, 0x15, 0xda, 0x6b, 0x3f, 0x08, + 0x9d, 0x9f, 0x73, 0xd5, 0x32, 0x5b, 0x5b, 0x5b, 0x6b, 0x2a, 0x2a, 0x2a, + 0xfa, 0xc7, 0xc4, 0xc4, 0x00, 0x00, 0xa2, 0xa3, 0xa3, 0xc5, 0x72, 0xb9, + 0x3c, 0xc4, 0x64, 0x32, 0x91, 0x85, 0xa5, 0x94, 0x0a, 0x85, 0x42, 0x42, + 0xf2, 0xeb, 0x95, 0x2b, 0x57, 0xcc, 0xcc, 0x38, 0x1c, 0xeb, 0x6c, 0x90, + 0x59, 0x30, 0x41, 0xb1, 0xb1, 0xb1, 0x72, 0xb2, 0xe3, 0x9a, 0x9a, 0x1a, + 0x1b, 0xda, 0xd2, 0xfc, 0xb4, 0x0c, 0x2d, 0x64, 0x00, 0x82, 0xaa, 0xaa, + 0xaa, 0x8a, 0x2b, 0x2a, 0x2a, 0x46, 0xb3, 0xfc, 0x98, 0x92, 0x92, 0x02, + 0x95, 0x4a, 0xd5, 0x9b, 0x31, 0x10, 0x49, 0x2f, 0x95, 0x1f, 0xfc, 0xe0, + 0x87, 0xff, 0x42, 0x03, 0x80, 0x57, 0xd8, 0x45, 0x2c, 0x16, 0x8f, 0x9a, + 0x3d, 0x7b, 0xb6, 0x46, 0x26, 0x93, 0x01, 0x00, 0x36, 0x6f, 0xde, 0xac, + 0xab, 0xac, 0xac, 0x3c, 0xc8, 0xec, 0x5c, 0xd8, 0x22, 0x2b, 0x42, 0x55, + 0xc4, 0x48, 0xf7, 0x70, 0x74, 0x9f, 0x3e, 0x7d, 0x78, 0x5a, 0xb8, 0xb8, + 0xb8, 0xd8, 0xcc, 0x28, 0x02, 0x03, 0xf3, 0x48, 0x01, 0x18, 0xf4, 0x7a, + 0x7d, 0x55, 0x4d, 0x4d, 0x0d, 0xe7, 0x2a, 0x88, 0x89, 0x89, 0x81, 0x44, + 0x22, 0x61, 0x53, 0xf6, 0xa4, 0xc4, 0x2e, 0x9a, 0xac, 0xbe, 0x57, 0x56, + 0x52, 0x52, 0xf2, 0x3f, 0xcc, 0x0e, 0x37, 0x0c, 0x6d, 0xe7, 0xae, 0x09, + 0xfd, 0xfb, 0xf7, 0x7f, 0xce, 0x6a, 0xb5, 0x76, 0xc6, 0x00, 0x20, 0x95, + 0x73, 0x59, 0x41, 0x41, 0x41, 0xc1, 0x8c, 0x19, 0x33, 0x58, 0x85, 0x60, + 0x37, 0x18, 0x0c, 0x35, 0x68, 0xcb, 0xfb, 0xd6, 0x11, 0x02, 0x53, 0xaa, + 0xd1, 0x68, 0xa2, 0x63, 0x63, 0x63, 0xb9, 0x06, 0x0c, 0x06, 0x03, 0x28, + 0x8a, 0x32, 0x82, 0x5f, 0x96, 0x16, 0x02, 0xf8, 0x17, 0xd5, 0xd4, 0xd4, + 0x64, 0xd5, 0xd4, 0xd4, 0x04, 0x11, 0xbb, 0x3d, 0x33, 0xf3, 0x8e, 0x1c, + 0x4c, 0x7e, 0xb7, 0x46, 0xa3, 0x99, 0x3e, 0x65, 0xca, 0x14, 0xce, 0x02, + 0xa8, 0xad, 0xad, 0xc5, 0x89, 0x13, 0x27, 0x8c, 0x8c, 0xfb, 0x96, 0x67, + 0x88, 0x09, 0x04, 0xfe, 0x85, 0x00, 0x18, 0x3a, 0x64, 0xc8, 0x90, 0x3b, + 0x1e, 0x78, 0xe0, 0x01, 0x89, 0xcd, 0x66, 0xc3, 0xca, 0x95, 0x2b, 0x75, + 0xc5, 0xc5, 0xc5, 0x87, 0x12, 0x12, 0x12, 0x06, 0x77, 0x81, 0x57, 0xd8, + 0x39, 0x0e, 0xef, 0xdd, 0xbb, 0xb7, 0x9c, 0xf4, 0xf0, 0x04, 0x07, 0x07, + 0x0f, 0xcf, 0xcc, 0xcc, 0x1c, 0x33, 0x6c, 0xd8, 0x30, 0x71, 0x70, 0x70, + 0xb0, 0xa8, 0xae, 0xae, 0xce, 0x76, 0xe2, 0xc4, 0x09, 0x53, 0x55, 0x55, + 0x55, 0x51, 0x71, 0x71, 0xf1, 0x76, 0x66, 0xf7, 0xcc, 0x2a, 0x62, 0xb2, + 0xa4, 0x34, 0x89, 0x7b, 0x5c, 0x5a, 0x5a, 0x9a, 0x8c, 0xec, 0xb4, 0xb0, + 0xb0, 0x10, 0x00, 0x92, 0xfa, 0xf6, 0xed, 0x3b, 0x21, 0x32, 0x32, 0x32, + 0x28, 0x32, 0x32, 0x92, 0x6a, 0x6e, 0x6e, 0x46, 0x75, 0x75, 0xb5, 0xa5, + 0xbe, 0xbe, 0xbe, 0xa8, 0xa2, 0xa2, 0x62, 0x0f, 0x80, 0x13, 0xcc, 0xeb, + 0x1d, 0x4a, 0x26, 0x13, 0x15, 0xf5, 0xd8, 0x3e, 0x2d, 0xe0, 0xd7, 0x92, + 0x08, 0x60, 0x68, 0x26, 0x93, 0x4a, 0xa5, 0xe3, 0x66, 0xcc, 0x98, 0x91, + 0x7a, 0xef, 0xbd, 0xf7, 0x8a, 0x00, 0xa0, 0xa1, 0xa1, 0x01, 0x2b, 0x57, + 0xae, 0xac, 0x2b, 0x2d, 0x2d, 0xfd, 0x27, 0x63, 0xa0, 0x35, 0x91, 0xbb, + 0x7f, 0x87, 0x75, 0xc0, 0x96, 0xca, 0x36, 0x15, 0x17, 0x17, 0x1f, 0xdf, + 0xbd, 0x7b, 0xf7, 0x88, 0x61, 0xc3, 0x86, 0x05, 0x00, 0xc0, 0xcc, 0x99, + 0x33, 0xa9, 0x85, 0x0b, 0x17, 0x4e, 0x65, 0x94, 0xfb, 0x15, 0x00, 0x41, + 0x61, 0x61, 0x61, 0xd3, 0x16, 0x2e, 0x5c, 0xa8, 0x64, 0xd7, 0x5a, 0x59, + 0x59, 0x19, 0xce, 0x9f, 0x3f, 0xaf, 0x47, 0x5b, 0x71, 0x2c, 0xa1, 0x4a, + 0x9b, 0x14, 0x00, 0x4a, 0x2a, 0x95, 0x06, 0x06, 0x05, 0x05, 0x71, 0x06, + 0x26, 0x59, 0x6a, 0x42, 0xe0, 0x11, 0x91, 0x41, 0x8f, 0xe1, 0xe1, 0xe1, + 0x10, 0x8b, 0xc5, 0x6c, 0xe1, 0x26, 0x09, 0x5c, 0x07, 0x7d, 0xfa, 0xc1, + 0x0f, 0x7e, 0xf8, 0x4f, 0x35, 0x00, 0x1c, 0x0a, 0x97, 0x04, 0x02, 0x50, + 0x27, 0x27, 0x27, 0x4f, 0xbc, 0xef, 0xbe, 0xfb, 0xe4, 0x00, 0x50, 0x55, + 0x55, 0x85, 0xbc, 0xbc, 0xbc, 0x46, 0x00, 0x67, 0x08, 0x97, 0xae, 0x15, + 0xee, 0xcb, 0xff, 0x06, 0xf7, 0xe9, 0xd3, 0x87, 0x27, 0xc4, 0x9b, 0x9a, + 0x9a, 0xec, 0xcc, 0xce, 0x89, 0x2d, 0x34, 0x03, 0x00, 0x66, 0x9d, 0x4e, + 0xd7, 0x64, 0x30, 0x18, 0x40, 0xee, 0xa2, 0x65, 0x32, 0x19, 0x79, 0x36, + 0x4b, 0x11, 0x3b, 0x47, 0x56, 0x81, 0xd2, 0x8c, 0x12, 0x69, 0x46, 0x7b, + 0x34, 0xb3, 0x04, 0x1d, 0x0b, 0x07, 0x79, 0xe3, 0x01, 0xb0, 0x31, 0xbb, + 0xd4, 0xca, 0xa2, 0xa2, 0xa2, 0xff, 0xc7, 0xd0, 0x43, 0xca, 0xf4, 0xcb, + 0x96, 0x52, 0xa5, 0x09, 0xe5, 0x3a, 0x38, 0x39, 0x39, 0xb9, 0x57, 0x46, + 0x06, 0xe7, 0x00, 0xc0, 0xc5, 0x8b, 0x17, 0xd1, 0xdc, 0xdc, 0x5c, 0x82, + 0xf6, 0x63, 0x12, 0x47, 0x01, 0xce, 0x79, 0x00, 0x18, 0x3a, 0x34, 0x31, + 0x4a, 0x4f, 0x06, 0x40, 0xa1, 0x56, 0xab, 0x33, 0x83, 0x83, 0x83, 0xff, + 0x47, 0xa1, 0x50, 0x44, 0xd6, 0xd4, 0xd4, 0x0c, 0x78, 0xe6, 0x99, 0x67, + 0x24, 0x0f, 0x3f, 0xfc, 0xb0, 0x88, 0x15, 0xf2, 0x4f, 0x3c, 0xf1, 0x44, + 0x6b, 0x45, 0x45, 0xc5, 0x77, 0xcc, 0x98, 0x2d, 0x4e, 0x76, 0xd1, 0xdc, + 0x39, 0x76, 0x72, 0x72, 0xf2, 0x82, 0xbf, 0xfc, 0xe5, 0x2f, 0x21, 0x52, + 0xa9, 0x14, 0xdb, 0xb7, 0x6f, 0xb7, 0x9d, 0x3c, 0x79, 0xf2, 0x22, 0x80, + 0x2b, 0x14, 0x45, 0xf5, 0xef, 0x24, 0xaf, 0x70, 0xb5, 0xf4, 0x45, 0x22, + 0x51, 0x48, 0x72, 0x72, 0x32, 0x67, 0x00, 0xa4, 0xa5, 0xa5, 0xc9, 0xfe, + 0xf4, 0xa7, 0x3f, 0x45, 0x4e, 0x9e, 0x3c, 0x99, 0xa7, 0x4c, 0x68, 0x9a, + 0x46, 0x5e, 0x5e, 0x5e, 0xc4, 0xdc, 0xb9, 0x73, 0x33, 0x9b, 0x9a, 0x9a, + 0xb6, 0x68, 0xb5, 0xda, 0xcf, 0xd1, 0xf1, 0x7e, 0x03, 0xf2, 0xee, 0x89, + 0x90, 0xa4, 0xa4, 0x24, 0x8e, 0x77, 0xf4, 0x7a, 0x3d, 0xca, 0xca, 0xca, + 0xe4, 0x0b, 0x16, 0x2c, 0x18, 0xb5, 0x7c, 0xf9, 0x72, 0x45, 0x72, 0x72, + 0x32, 0xd7, 0xb6, 0xd9, 0x6c, 0xc6, 0xf1, 0xe3, 0xc7, 0xa3, 0x5e, 0x7a, + 0xe9, 0xa5, 0xfe, 0x05, 0x05, 0x05, 0x5f, 0xe9, 0xf5, 0xfa, 0x6d, 0x68, + 0xaf, 0x96, 0xc8, 0x8b, 0xbf, 0x20, 0x14, 0x35, 0x19, 0xb9, 0x4f, 0xd6, + 0xd1, 0x57, 0x01, 0x48, 0xcc, 0xc8, 0xc8, 0x98, 0xb1, 0x7c, 0xf9, 0x72, + 0xce, 0xbd, 0xfe, 0xe6, 0x9b, 0x6f, 0xb6, 0x16, 0x14, 0x14, 0xfc, 0x00, + 0xe0, 0x02, 0xe3, 0x5d, 0x30, 0xa0, 0xbd, 0xac, 0x34, 0xef, 0x62, 0x23, + 0x8a, 0xa2, 0x58, 0x2f, 0x92, 0x09, 0x40, 0xde, 0x3f, 0xff, 0xf9, 0xcf, + 0xfb, 0x13, 0x12, 0x12, 0xe2, 0x17, 0x2c, 0x58, 0x40, 0x69, 0x34, 0x1a, + 0x54, 0x54, 0x54, 0x60, 0xe9, 0xd2, 0xa5, 0x33, 0xaf, 0x5c, 0xb9, 0x62, + 0x51, 0x2a, 0x95, 0xa2, 0x19, 0x33, 0x66, 0x04, 0xfc, 0xe1, 0x0f, 0x7f, + 0x10, 0xb3, 0xc6, 0xe3, 0xc2, 0x85, 0x0b, 0x5b, 0x4a, 0x4b, 0x4b, 0xb7, + 0x33, 0x86, 0xb6, 0x19, 0x1d, 0xb3, 0x6d, 0xec, 0x00, 0x6c, 0x16, 0x8b, + 0xa5, 0xa9, 0xae, 0xae, 0xce, 0xca, 0xca, 0x0e, 0x8a, 0xa2, 0x10, 0x14, + 0x14, 0x24, 0x43, 0x5b, 0xfa, 0x61, 0x3d, 0xb1, 0xa6, 0x43, 0xa2, 0xa3, + 0xa3, 0xfb, 0xc4, 0xc5, 0xc5, 0x89, 0x88, 0x31, 0x23, 0x32, 0x32, 0x92, + 0x42, 0x5b, 0xc0, 0xa5, 0x5f, 0xf9, 0xfb, 0xc1, 0x0f, 0xff, 0xe5, 0x1e, + 0x00, 0xee, 0xec, 0x15, 0x40, 0x6a, 0xdf, 0xbe, 0x7d, 0x63, 0xfa, 0xf7, + 0x6f, 0xd3, 0x0f, 0x7b, 0xf6, 0xec, 0xb1, 0x96, 0x97, 0x97, 0x1f, 0x62, + 0xdc, 0x8a, 0xac, 0xfb, 0x9f, 0x76, 0x11, 0x30, 0xc4, 0x1a, 0x01, 0xf2, + 0x80, 0x80, 0x00, 0xde, 0xf9, 0x77, 0x73, 0x73, 0x33, 0x0d, 0xa2, 0x4c, + 0x2e, 0xfb, 0xb4, 0xb6, 0x01, 0x4d, 0x0a, 0x22, 0x99, 0x4c, 0x46, 0x5e, + 0xda, 0x42, 0x06, 0xf0, 0xd9, 0x09, 0xc5, 0x6a, 0x21, 0xda, 0x93, 0x00, + 0x08, 0xa3, 0x28, 0xca, 0xde, 0x05, 0x3a, 0xd8, 0x89, 0x5d, 0xb8, 0x85, + 0x11, 0xf4, 0x64, 0xff, 0x52, 0xb4, 0xb9, 0xfe, 0x23, 0x01, 0x0c, 0x4e, + 0x4a, 0x4a, 0x7a, 0xe4, 0xcd, 0x37, 0xdf, 0x54, 0x93, 0xde, 0x86, 0x6d, + 0xdb, 0xb6, 0x19, 0x4a, 0x4a, 0x4a, 0x0e, 0x12, 0x0a, 0xda, 0x26, 0xd0, + 0x07, 0x89, 0x3f, 0xb9, 0x63, 0x97, 0x84, 0x84, 0x84, 0xcc, 0x7b, 0xf6, + 0xd9, 0x67, 0xef, 0x9a, 0x3a, 0x75, 0x2a, 0x7a, 0xf5, 0xea, 0x05, 0xf6, + 0xfc, 0x19, 0x00, 0xfa, 0xf6, 0xed, 0x6b, 0xad, 0xab, 0xab, 0x3b, 0x65, + 0x32, 0x99, 0x8e, 0x3b, 0x7a, 0x18, 0x04, 0x52, 0xd0, 0x42, 0x15, 0x0a, + 0xc5, 0xbd, 0xb3, 0x67, 0xcf, 0xee, 0x3d, 0x6c, 0xd8, 0x30, 0x34, 0x35, + 0x35, 0xe1, 0xad, 0xb7, 0xde, 0xaa, 0xbf, 0x71, 0xe3, 0xc6, 0x6e, 0xc2, + 0xf8, 0x10, 0x9a, 0x3b, 0x77, 0x01, 0x93, 0x5c, 0x40, 0x5a, 0x44, 0x44, + 0x44, 0x24, 0xa9, 0x58, 0xde, 0x7b, 0xef, 0x3d, 0xb1, 0x44, 0x22, 0x11, + 0x32, 0x1c, 0x30, 0x72, 0xe4, 0x48, 0x5c, 0xbc, 0x78, 0x31, 0xe0, 0x91, + 0x47, 0x1e, 0xf9, 0x9f, 0x3d, 0x7b, 0xf6, 0x98, 0x0d, 0x06, 0xc3, 0x67, + 0xe0, 0xd7, 0xbd, 0x07, 0x61, 0x04, 0x28, 0x43, 0x43, 0x43, 0x39, 0xa2, + 0x2a, 0x14, 0x0a, 0xbc, 0xfc, 0xf2, 0xcb, 0x92, 0x45, 0x8b, 0x16, 0x49, + 0x1d, 0x4b, 0x74, 0xca, 0x64, 0x32, 0x8c, 0x1e, 0x3d, 0x9a, 0x3a, 0x70, + 0xe0, 0x40, 0xf0, 0xef, 0x7f, 0xff, 0xfb, 0x87, 0xf6, 0xef, 0xdf, 0x6f, + 0x6e, 0x6d, 0x6d, 0xfd, 0x92, 0x30, 0x0a, 0xad, 0x1e, 0x18, 0xbf, 0x6c, + 0xea, 0x67, 0x68, 0x64, 0x64, 0xe4, 0xbc, 0x65, 0xcb, 0x96, 0x45, 0x46, + 0x47, 0x47, 0x03, 0x00, 0xf2, 0xf3, 0xf3, 0xf1, 0xdd, 0x77, 0xdf, 0x95, + 0x18, 0x8d, 0xc6, 0x7f, 0x31, 0x8a, 0x55, 0x07, 0x27, 0x15, 0xf4, 0x98, + 0xf6, 0xc8, 0x7b, 0x03, 0x9a, 0x4b, 0x4a, 0x4a, 0x3e, 0xf9, 0xdf, 0xff, + 0xfd, 0xdf, 0xd7, 0x12, 0x12, 0x12, 0x6c, 0x93, 0x26, 0x4d, 0x12, 0xc7, + 0xc6, 0xc6, 0xe2, 0xcb, 0x2f, 0xbf, 0x0c, 0xa0, 0x28, 0x2a, 0x80, 0xa5, + 0x0d, 0x0b, 0xe9, 0xe9, 0xe9, 0x96, 0xda, 0xda, 0xda, 0x43, 0x56, 0xab, + 0xb5, 0x00, 0xc2, 0x97, 0x6d, 0xd1, 0x84, 0xf7, 0xa2, 0xea, 0xd8, 0xb1, + 0x63, 0x2d, 0x8f, 0x3f, 0xfe, 0xb8, 0x9a, 0xfd, 0x32, 0x2b, 0x2b, 0x2b, + 0xe0, 0xf4, 0xe9, 0xd3, 0x0b, 0x4d, 0x26, 0xd3, 0x6a, 0xc6, 0x40, 0x95, + 0x00, 0x18, 0xa1, 0x52, 0xa9, 0x06, 0x8d, 0x1c, 0x39, 0x92, 0x87, 0xab, + 0x42, 0xa1, 0x60, 0x0b, 0x0a, 0x89, 0xe0, 0xdd, 0x85, 0x48, 0x7e, 0xf0, + 0x83, 0x1f, 0xfe, 0x83, 0x0c, 0x00, 0x5e, 0x8d, 0xf4, 0x90, 0x90, 0x90, + 0xd1, 0x0f, 0x3d, 0xf4, 0x90, 0x86, 0xdd, 0xb9, 0x6d, 0xde, 0xbc, 0x59, + 0xa7, 0xd7, 0xeb, 0x73, 0xc1, 0x2f, 0x4d, 0x6a, 0x77, 0xa1, 0x1c, 0x28, + 0xc2, 0x3d, 0xce, 0x3b, 0x03, 0xb7, 0xd9, 0x6c, 0x20, 0xbc, 0x07, 0xe4, + 0x63, 0x35, 0x9b, 0xcd, 0x3c, 0x03, 0x80, 0x39, 0xf7, 0x66, 0x05, 0x34, + 0xc8, 0x1d, 0x1c, 0xa3, 0xe4, 0xc9, 0x5b, 0xd4, 0x5a, 0xd1, 0x7e, 0x19, + 0x4c, 0x57, 0x02, 0x99, 0xec, 0xe0, 0xdf, 0x78, 0xc8, 0x7a, 0x15, 0xe4, + 0xac, 0x77, 0x04, 0x6d, 0x47, 0x0d, 0x13, 0xfa, 0xf7, 0xef, 0xff, 0xd8, + 0xae, 0x5d, 0xbb, 0xc2, 0xfb, 0xf6, 0xed, 0x4b, 0x2a, 0x7f, 0xfc, 0xf0, + 0xc3, 0x0f, 0x45, 0x00, 0x0e, 0x13, 0xde, 0x12, 0x3b, 0x71, 0xd3, 0x9d, + 0x10, 0xfe, 0xac, 0x67, 0x43, 0x0c, 0xc0, 0x26, 0x95, 0x4a, 0xcd, 0xa3, + 0x47, 0x8f, 0x06, 0x99, 0x1d, 0xc0, 0x42, 0x54, 0x54, 0x14, 0xc5, 0xc4, + 0x1b, 0x04, 0xa2, 0xe3, 0xcd, 0x81, 0x20, 0x5c, 0xd9, 0x1a, 0x00, 0xc9, + 0xe9, 0xe9, 0xe9, 0xbf, 0x5b, 0xba, 0x74, 0x69, 0x20, 0x00, 0x7c, 0xf4, + 0xd1, 0x47, 0xa6, 0x8b, 0x17, 0x2f, 0x1e, 0x46, 0xdb, 0x19, 0xb1, 0x44, + 0xc8, 0x50, 0xa2, 0x69, 0x9a, 0x55, 0x86, 0x52, 0xa2, 0x6d, 0x9b, 0x13, + 0x6f, 0x89, 0x55, 0xa3, 0xd1, 0x44, 0x90, 0x35, 0x00, 0x24, 0x12, 0x09, + 0xae, 0x5d, 0xbb, 0x86, 0x4f, 0x3e, 0xf9, 0xc4, 0xd4, 0xd0, 0xd0, 0x60, + 0xe9, 0xd5, 0xab, 0x97, 0xf4, 0xfe, 0xfb, 0xef, 0x97, 0xb3, 0xc6, 0x64, + 0x40, 0x40, 0x00, 0x36, 0x6e, 0xdc, 0xa8, 0x9c, 0x3c, 0x79, 0xf2, 0xac, + 0x5f, 0x7f, 0xfd, 0xf5, 0x08, 0xda, 0xef, 0x7d, 0xb0, 0x10, 0xe3, 0x10, + 0x01, 0x90, 0xa9, 0x54, 0x2a, 0x6e, 0xde, 0xa5, 0x52, 0x29, 0x9e, 0x7d, + 0xf6, 0x59, 0x8a, 0xa2, 0x28, 0xec, 0xde, 0xbd, 0x1b, 0xe7, 0xcf, 0x9f, + 0x37, 0xcb, 0xe5, 0x72, 0xd1, 0xb8, 0x71, 0xe3, 0x24, 0x6c, 0x14, 0xbc, + 0x5c, 0x2e, 0xc7, 0xd6, 0xad, 0x5b, 0x95, 0xd3, 0xa6, 0x4d, 0xbb, 0xff, + 0xc8, 0x91, 0x23, 0xf9, 0x68, 0xcf, 0x56, 0xb1, 0xc0, 0x79, 0x9e, 0x3b, + 0xe9, 0x31, 0x51, 0x03, 0xc8, 0xcc, 0xcc, 0xcc, 0x1c, 0x3e, 0x6b, 0xd6, + 0x2c, 0xce, 0x70, 0xfd, 0xe0, 0x83, 0x0f, 0x0c, 0x57, 0xae, 0x5c, 0xd9, + 0x89, 0xb6, 0xfb, 0x18, 0xb4, 0x68, 0xcf, 0x80, 0x71, 0x66, 0x04, 0x93, + 0x41, 0x92, 0x12, 0xa5, 0x52, 0xd9, 0x2f, 0x21, 0x21, 0xc1, 0x18, 0x1a, + 0x1a, 0xaa, 0xe0, 0x5e, 0x10, 0x09, 0x97, 0xa3, 0x98, 0x39, 0x73, 0xa6, + 0x68, 0xe3, 0xc6, 0x8d, 0x23, 0x8d, 0x46, 0xe3, 0x2e, 0x27, 0xf3, 0x4b, + 0x13, 0xfc, 0x7e, 0x31, 0x2f, 0x2f, 0x4f, 0xa7, 0xd7, 0xeb, 0xd5, 0x41, + 0x41, 0x41, 0x00, 0x80, 0x15, 0x2b, 0x56, 0x88, 0x2b, 0x2a, 0x2a, 0xa2, + 0x0e, 0x1d, 0x3a, 0xf4, 0x6c, 0x7d, 0x7d, 0x7d, 0x89, 0x4a, 0xa5, 0x52, + 0xdb, 0xed, 0xf6, 0x81, 0x39, 0x39, 0x39, 0x0a, 0xf6, 0x1d, 0x16, 0x02, + 0x03, 0x03, 0x81, 0xf6, 0x3b, 0x10, 0xfc, 0xca, 0xdf, 0x0f, 0x7e, 0xf8, + 0x6f, 0x33, 0x00, 0x84, 0xce, 0x8c, 0x63, 0x63, 0x63, 0x6f, 0xcf, 0xca, + 0xca, 0x12, 0xb1, 0xbb, 0x9f, 0xd2, 0xd2, 0xd2, 0x52, 0xb4, 0x47, 0xbe, + 0x7b, 0x53, 0x34, 0x84, 0x76, 0x2c, 0x08, 0xc3, 0xec, 0x76, 0x84, 0x02, + 0x8e, 0x44, 0x8e, 0x3b, 0x3b, 0x87, 0x62, 0x2b, 0x8e, 0xdf, 0x71, 0xae, + 0x5c, 0x66, 0x0c, 0x9d, 0xbd, 0x22, 0x17, 0x02, 0xc6, 0x05, 0x08, 0x03, + 0x87, 0x15, 0xe6, 0x01, 0x60, 0x2e, 0x02, 0x52, 0xab, 0xd5, 0x0f, 0xde, + 0x71, 0xc7, 0x1d, 0xd3, 0xd6, 0xad, 0x5b, 0xa7, 0xe9, 0xd3, 0xa7, 0x0f, + 0xf7, 0xfb, 0xa3, 0x47, 0x8f, 0xe2, 0xc1, 0x07, 0x1f, 0xb4, 0xdb, 0xed, + 0xf6, 0x77, 0xd0, 0x16, 0x24, 0xd6, 0x8c, 0x76, 0x17, 0xbd, 0x23, 0xcd, + 0x3b, 0x9c, 0xd1, 0xb2, 0x06, 0x08, 0x4d, 0xd3, 0xb8, 0x7e, 0xfd, 0x3a, + 0x5a, 0x5a, 0x5a, 0x10, 0x17, 0x17, 0x87, 0x94, 0x94, 0x14, 0x4e, 0x61, + 0xe4, 0xe6, 0xe6, 0x8a, 0x57, 0xac, 0x58, 0xa1, 0xde, 0xb8, 0x71, 0xe3, + 0x1f, 0x8a, 0x8b, 0x8b, 0xff, 0x0f, 0xed, 0xc1, 0x68, 0xbc, 0xe2, 0x3c, + 0x00, 0x42, 0x62, 0x62, 0x62, 0x1e, 0x5a, 0xba, 0x74, 0x69, 0x64, 0x44, + 0x44, 0x04, 0x0a, 0x0b, 0x0b, 0xf1, 0xd9, 0x67, 0x9f, 0xd5, 0x19, 0x0c, + 0x86, 0x13, 0xac, 0x71, 0xc6, 0xd4, 0xc0, 0x17, 0xe2, 0xc3, 0x40, 0xb4, + 0xdf, 0x2a, 0xe7, 0x2c, 0xc8, 0xcd, 0x0a, 0xc0, 0x28, 0x12, 0x89, 0x42, + 0xf5, 0x7a, 0x3d, 0x0a, 0x0a, 0x0a, 0xa0, 0x50, 0x28, 0x90, 0x9b, 0x9b, + 0x6b, 0x7f, 0xe5, 0x95, 0x57, 0x2a, 0x4b, 0x4b, 0x4b, 0xbf, 0x67, 0xc6, + 0x1f, 0xfb, 0xda, 0x6b, 0xaf, 0xfd, 0x4f, 0x7e, 0x7e, 0x3e, 0x35, 0x60, + 0xc0, 0x00, 0x8a, 0x35, 0x02, 0x16, 0x2d, 0x5a, 0x14, 0x7e, 0xf6, 0xec, + 0xd9, 0x3b, 0x9b, 0x9b, 0x9b, 0x2f, 0x13, 0x4a, 0x95, 0x47, 0x26, 0x89, + 0x44, 0xc2, 0xd3, 0x92, 0x46, 0xa3, 0x11, 0x33, 0x66, 0xcc, 0x30, 0x1d, + 0x3a, 0x74, 0xa8, 0xd9, 0x68, 0x34, 0xfe, 0x20, 0x16, 0x8b, 0xe5, 0x89, + 0x89, 0x89, 0x13, 0x36, 0x6c, 0xd8, 0x10, 0x3e, 0x71, 0xe2, 0x44, 0x31, + 0x00, 0xa8, 0x54, 0x2a, 0x2c, 0x59, 0xb2, 0x24, 0xfc, 0xd2, 0xa5, 0x4b, + 0x77, 0xd7, 0xd7, 0xd7, 0x17, 0xa0, 0xed, 0x78, 0xa5, 0xd5, 0x0d, 0xef, + 0x73, 0x85, 0x87, 0xe2, 0xe2, 0xe2, 0x66, 0x2d, 0x59, 0xb2, 0x24, 0x84, + 0xf5, 0xe8, 0x9c, 0x39, 0x73, 0x06, 0xbf, 0xfc, 0xf2, 0x4b, 0x29, 0x80, + 0x5c, 0xb4, 0x67, 0x1f, 0x58, 0xe0, 0xe4, 0x92, 0x27, 0xf0, 0xa3, 0xf4, + 0x95, 0x22, 0x91, 0x68, 0xac, 0xdd, 0x6e, 0x7f, 0xf0, 0xe8, 0xd1, 0xa3, + 0x22, 0x36, 0xc3, 0xc5, 0x68, 0x34, 0xe2, 0xc7, 0x1f, 0x7f, 0xa4, 0x0b, + 0x0b, 0x0b, 0xad, 0x6a, 0xb5, 0x5a, 0x34, 0x6c, 0xd8, 0x30, 0x31, 0x9b, + 0x29, 0xf3, 0xfe, 0xfb, 0xef, 0x8b, 0x13, 0x12, 0x12, 0xd4, 0xef, 0xbf, + 0xff, 0xfe, 0x13, 0x65, 0x65, 0x65, 0x7f, 0x42, 0xfb, 0xe5, 0x4a, 0x66, + 0x82, 0x6f, 0xac, 0x8c, 0xd1, 0x54, 0x5d, 0x58, 0x58, 0xb8, 0xef, 0x83, + 0x0f, 0x3e, 0x78, 0xe0, 0xff, 0xfe, 0xef, 0xff, 0x14, 0xac, 0x61, 0xf1, + 0x8f, 0x7f, 0xfc, 0x43, 0x71, 0xee, 0xdc, 0xb9, 0x94, 0xca, 0xca, 0xca, + 0x94, 0xc0, 0xc0, 0x40, 0x0c, 0x1e, 0x3c, 0x98, 0xe7, 0x45, 0x62, 0xa1, + 0xb5, 0xb5, 0x15, 0xcc, 0x58, 0xfc, 0x91, 0xff, 0x7e, 0xf0, 0xc3, 0xad, + 0x6e, 0x00, 0x38, 0xe4, 0xc1, 0x53, 0x0e, 0xbb, 0x02, 0xf6, 0x5f, 0xda, + 0xcb, 0x5c, 0x5e, 0x32, 0xf7, 0x5a, 0x05, 0x60, 0xe8, 0xb8, 0x71, 0xe3, + 0x42, 0xd8, 0xdc, 0xff, 0x9d, 0x3b, 0x77, 0xb6, 0x5e, 0xbb, 0x76, 0xed, + 0x80, 0xc3, 0x4e, 0xcd, 0xee, 0xa2, 0x0f, 0x72, 0x57, 0x6f, 0x69, 0x6e, + 0x6e, 0xb6, 0x91, 0x3b, 0x78, 0x46, 0xb0, 0x8a, 0x04, 0x94, 0x9f, 0x48, + 0x26, 0x93, 0xf1, 0x04, 0x7e, 0x4b, 0x4b, 0x0b, 0x79, 0xf7, 0x7a, 0x8f, + 0xdb, 0x46, 0x04, 0x5d, 0xd8, 0xcb, 0x56, 0x32, 0x12, 0x13, 0x13, 0x9f, + 0x9d, 0x3f, 0x7f, 0x7e, 0xff, 0x65, 0xcb, 0x96, 0xf1, 0xb2, 0x1b, 0x8e, + 0x1c, 0x39, 0x42, 0x3f, 0xf3, 0xcc, 0x33, 0x95, 0x76, 0xbb, 0xfd, 0x2d, + 0xb4, 0xe5, 0x6e, 0x0b, 0xa6, 0x88, 0x11, 0x4a, 0x87, 0x55, 0x3c, 0xec, + 0x2e, 0x8f, 0xbd, 0xf9, 0x8e, 0x2e, 0x29, 0x29, 0xf9, 0xf0, 0xa9, 0xa7, + 0x9e, 0xba, 0xa1, 0x52, 0xa9, 0x62, 0x55, 0x2a, 0x55, 0x6a, 0x72, 0x72, + 0x72, 0xdc, 0xa6, 0x4d, 0x9b, 0x94, 0x6c, 0x25, 0xc5, 0x15, 0x2b, 0x56, + 0x88, 0x6c, 0x36, 0x5b, 0xf2, 0x9b, 0x6f, 0xbe, 0x39, 0xd1, 0x62, 0xb1, + 0x94, 0x31, 0xbf, 0x63, 0x3d, 0x1f, 0xac, 0x02, 0x1f, 0x3a, 0x7c, 0xf8, + 0xf0, 0xe1, 0x73, 0xe6, 0xcc, 0x11, 0x03, 0xc0, 0xeb, 0xaf, 0xbf, 0xde, + 0x7a, 0xf9, 0xf2, 0xe5, 0x53, 0xcc, 0x77, 0x00, 0x10, 0x40, 0xd3, 0xb4, + 0x5c, 0xc0, 0x08, 0x62, 0x6b, 0xd8, 0x07, 0x13, 0x1e, 0x0c, 0x93, 0xc0, + 0x1c, 0xdb, 0x00, 0xb4, 0xea, 0x74, 0xba, 0xaf, 0x17, 0x2c, 0x58, 0x70, + 0xbb, 0x58, 0x2c, 0x56, 0x03, 0x08, 0xb4, 0x58, 0x2c, 0xcd, 0xa5, 0xa5, + 0xa5, 0xeb, 0x18, 0xa5, 0x4e, 0x01, 0x08, 0xb6, 0xdb, 0xed, 0x55, 0x4f, + 0x3c, 0xf1, 0xc4, 0x93, 0xbf, 0xfc, 0xf2, 0x8b, 0x8a, 0x3d, 0x1e, 0x18, + 0x31, 0x62, 0x84, 0xb8, 0x57, 0xaf, 0x5e, 0x83, 0x2e, 0x5f, 0xbe, 0xcc, + 0xc6, 0x58, 0x88, 0x1c, 0x78, 0xc7, 0xc6, 0xf0, 0x0e, 0x67, 0xa4, 0xac, + 0x5f, 0xbf, 0xde, 0x9a, 0x97, 0x97, 0x77, 0xd0, 0x68, 0x34, 0xee, 0x04, + 0xa0, 0xb5, 0xd9, 0x6c, 0x92, 0xeb, 0xd7, 0xaf, 0x9f, 0x9f, 0x34, 0x69, + 0xd2, 0x6b, 0xc5, 0xc5, 0xc5, 0x48, 0x4c, 0x4c, 0x04, 0x00, 0x8c, 0x19, + 0x33, 0x46, 0x1c, 0x11, 0x11, 0x31, 0xb8, 0xbe, 0xbe, 0x5e, 0x85, 0xf6, + 0x54, 0x4c, 0x67, 0x40, 0xd6, 0xbd, 0xe8, 0xd7, 0xaf, 0x5f, 0xbf, 0xcc, + 0x3b, 0xef, 0xbc, 0x93, 0x33, 0x3c, 0x37, 0x6e, 0xdc, 0xd8, 0x72, 0xed, + 0xda, 0xb5, 0x6c, 0x66, 0x3e, 0x3d, 0xb9, 0x3c, 0x87, 0x4c, 0xbf, 0x0c, + 0x4b, 0x4d, 0x4d, 0x9d, 0xbd, 0x77, 0xef, 0x5e, 0x4e, 0xf9, 0x6b, 0xb5, + 0x5a, 0x24, 0x27, 0x27, 0x5b, 0xad, 0x56, 0xeb, 0x59, 0xad, 0x56, 0x7b, + 0x4e, 0x24, 0x12, 0x29, 0x63, 0x62, 0x62, 0xc6, 0xad, 0x59, 0xb3, 0x26, + 0x94, 0x9d, 0xab, 0x25, 0x4b, 0x96, 0x88, 0x2a, 0x2a, 0x2a, 0x92, 0xd7, + 0xac, 0x59, 0x33, 0x16, 0x6d, 0x01, 0xb3, 0x32, 0xa2, 0x5f, 0xb6, 0x82, + 0xa2, 0x11, 0x40, 0x53, 0x4b, 0x4b, 0xcb, 0x97, 0xeb, 0xd7, 0xaf, 0x4f, + 0x31, 0x99, 0x4c, 0x23, 0x56, 0xae, 0x5c, 0x29, 0xa3, 0x28, 0x0a, 0x52, + 0xa9, 0x14, 0x43, 0x86, 0x0c, 0x01, 0x99, 0x7e, 0x7b, 0xfc, 0xf8, 0x71, + 0x7a, 0xdf, 0xbe, 0x7d, 0xf4, 0x92, 0x25, 0x4b, 0x44, 0x6c, 0xda, 0x29, + 0xe3, 0x71, 0x33, 0x3b, 0xd0, 0xdd, 0x0f, 0x7e, 0xf0, 0xc3, 0xad, 0x66, + 0x00, 0x10, 0xd6, 0x3f, 0x19, 0xb0, 0xe4, 0x18, 0x19, 0x6f, 0x45, 0x5b, + 0x2e, 0xb4, 0xdd, 0x61, 0x97, 0xec, 0xae, 0x4d, 0xf6, 0xca, 0x52, 0x75, + 0x42, 0x42, 0xc2, 0xf8, 0xb9, 0x73, 0xe7, 0xaa, 0x18, 0x05, 0x8c, 0x5d, + 0xbb, 0x76, 0xe9, 0xd0, 0x76, 0xeb, 0x9f, 0x9e, 0x10, 0x42, 0xee, 0x04, + 0x05, 0xab, 0xb8, 0x8d, 0x06, 0x83, 0xc1, 0xca, 0xb4, 0x0f, 0x66, 0x87, + 0x26, 0x62, 0x0c, 0x0d, 0x31, 0x39, 0x8e, 0xa0, 0xa0, 0x20, 0x0d, 0xa9, + 0x50, 0x01, 0xc0, 0x64, 0x32, 0xb1, 0x3b, 0x4d, 0x6f, 0xee, 0xbd, 0xf7, + 0x85, 0x47, 0x84, 0x14, 0xe2, 0xc1, 0x68, 0x4b, 0x67, 0x1b, 0x9b, 0x99, + 0x99, 0xf9, 0xcc, 0xaa, 0x55, 0xab, 0x62, 0xa7, 0x4f, 0x9f, 0xce, 0x19, + 0x2a, 0x66, 0xb3, 0x19, 0x1f, 0x7e, 0xf8, 0xa1, 0x79, 0xdd, 0xba, 0x75, + 0x85, 0xd7, 0xae, 0x5d, 0xfb, 0x00, 0xc0, 0x29, 0xb8, 0x4e, 0x11, 0x23, + 0x77, 0x88, 0x6c, 0xd4, 0x39, 0x7b, 0xbf, 0x3d, 0x0d, 0x80, 0xb6, 0x5a, + 0xad, 0x15, 0x5a, 0xad, 0x76, 0x83, 0x56, 0xab, 0x0d, 0x01, 0x10, 0x73, + 0xf9, 0xf2, 0xe5, 0x19, 0x83, 0x07, 0x0f, 0xbe, 0xe7, 0xe2, 0xc5, 0x8b, + 0x52, 0x96, 0x46, 0x73, 0xe6, 0xcc, 0x09, 0xfc, 0xfa, 0xeb, 0xaf, 0xc7, + 0x5c, 0xb9, 0x72, 0x85, 0x2c, 0x36, 0xc4, 0xf2, 0x91, 0x3c, 0x3a, 0x3a, + 0x7a, 0xf2, 0xb2, 0x65, 0xcb, 0x82, 0x25, 0x12, 0x09, 0x2e, 0x5d, 0xba, + 0x84, 0x5d, 0xbb, 0x76, 0x49, 0xd2, 0xd2, 0xd2, 0x46, 0x00, 0xb8, 0x8d, + 0xe9, 0x47, 0xa4, 0xd5, 0x6a, 0x43, 0xc8, 0x3a, 0x07, 0x11, 0x11, 0x11, + 0xb0, 0x5a, 0xad, 0x69, 0xe9, 0xe9, 0xe9, 0x7f, 0x32, 0x18, 0x0c, 0x7a, + 0xe6, 0xb6, 0x3e, 0x83, 0x00, 0xfe, 0xac, 0x87, 0xc4, 0x52, 0x59, 0x59, + 0xb9, 0x13, 0x6d, 0x75, 0x0b, 0xd8, 0x2c, 0x05, 0x23, 0xda, 0xaf, 0xc8, + 0x15, 0x31, 0x86, 0xa3, 0xb8, 0xa1, 0xa1, 0xa1, 0xe2, 0xea, 0xd5, 0xab, + 0xa9, 0xec, 0x51, 0x40, 0x54, 0x54, 0x14, 0x24, 0x12, 0x49, 0x28, 0xda, + 0x8f, 0x1b, 0x44, 0x84, 0xb1, 0x64, 0x07, 0x60, 0xd4, 0xeb, 0xf5, 0x3c, + 0x03, 0x60, 0xd7, 0xae, 0x5d, 0x2d, 0x5a, 0xad, 0xf6, 0x17, 0xb4, 0xa5, + 0x14, 0x36, 0x32, 0x63, 0x35, 0x07, 0x06, 0x06, 0xee, 0xfe, 0xf5, 0xd7, + 0x5f, 0xa7, 0x25, 0x26, 0x26, 0x8a, 0xd8, 0x71, 0x84, 0x84, 0x84, 0xb0, + 0xd7, 0xe3, 0x4a, 0xe0, 0xbc, 0xfc, 0x33, 0xaf, 0x56, 0x42, 0x68, 0x68, + 0x68, 0xd6, 0xa3, 0x8f, 0x3e, 0x1a, 0xc2, 0x7a, 0x5b, 0x9a, 0x9a, 0x9a, + 0xb0, 0x6f, 0xdf, 0x3e, 0x2d, 0xda, 0x32, 0x0b, 0x48, 0xd7, 0xbf, 0x2b, + 0x03, 0x58, 0x44, 0xac, 0xa7, 0x21, 0x53, 0xa7, 0x4e, 0x0d, 0xef, 0xd5, + 0xab, 0x17, 0x6b, 0x5c, 0xe1, 0xd5, 0x57, 0x5f, 0x35, 0x35, 0x35, 0x35, + 0xfd, 0x64, 0xb3, 0xd9, 0x76, 0x02, 0xd0, 0xd9, 0xed, 0x76, 0x79, 0x45, + 0x45, 0xc5, 0x89, 0x07, 0x1f, 0x7c, 0xf0, 0x2f, 0xc3, 0x86, 0x0d, 0x03, + 0x5b, 0xb2, 0x77, 0xc1, 0x82, 0x05, 0xaa, 0xef, 0xbf, 0xff, 0x7e, 0x12, + 0x63, 0x7c, 0xc8, 0x09, 0xa3, 0x99, 0xbd, 0xba, 0x99, 0x0d, 0x7e, 0xad, + 0xab, 0xa8, 0xa8, 0x58, 0xb5, 0x76, 0xed, 0xda, 0x3f, 0xe6, 0xe6, 0xe6, + 0x0e, 0x5a, 0xbe, 0x7c, 0xb9, 0x7a, 0xf8, 0xf0, 0xe1, 0x50, 0x2a, 0x95, + 0xb0, 0xd9, 0x6c, 0xa8, 0xab, 0xab, 0xc3, 0xe7, 0x9f, 0x7f, 0x6e, 0x7d, + 0xff, 0xfd, 0xf7, 0x8d, 0xb3, 0x66, 0xcd, 0x92, 0xcb, 0xe5, 0x72, 0x8e, + 0x16, 0xd5, 0xd5, 0xd5, 0x34, 0x43, 0x47, 0xdb, 0x4d, 0x32, 0xb2, 0xfd, + 0xe0, 0x07, 0x3f, 0x78, 0x71, 0x04, 0xc0, 0xba, 0xea, 0x15, 0xe0, 0xe7, + 0xef, 0xb2, 0x91, 0xeb, 0xec, 0x63, 0xf1, 0x62, 0x41, 0x73, 0xee, 0x4a, + 0x00, 0xb1, 0x51, 0x51, 0x51, 0xfd, 0x47, 0x8d, 0x1a, 0x05, 0x00, 0xf8, + 0xe5, 0x97, 0x5f, 0xe8, 0xea, 0xea, 0xea, 0x7c, 0xc2, 0x9d, 0x6d, 0xf6, + 0xc0, 0xfd, 0x4f, 0x9e, 0x9f, 0xd7, 0x5f, 0xbe, 0x7c, 0xd9, 0x42, 0x28, + 0x07, 0x44, 0x46, 0x46, 0x8a, 0x19, 0xc1, 0x2c, 0x27, 0x84, 0xbf, 0x5c, + 0xa3, 0xd1, 0x84, 0x04, 0x07, 0x07, 0x73, 0x8d, 0xd4, 0xd6, 0xd6, 0xc2, + 0x6a, 0xb5, 0xb2, 0x81, 0x6a, 0xd6, 0xae, 0xba, 0xf7, 0xbd, 0x04, 0xb2, + 0x20, 0x4c, 0x14, 0x80, 0xf1, 0x63, 0xc6, 0x8c, 0x59, 0xfc, 0xe9, 0xa7, + 0x9f, 0x46, 0xf4, 0xeb, 0xd7, 0x8f, 0x7b, 0xa9, 0xb8, 0xb8, 0x18, 0x8b, + 0x17, 0x2f, 0xd6, 0x1f, 0x3e, 0x7c, 0xf8, 0x70, 0x5d, 0x5d, 0xdd, 0x46, + 0xb4, 0x55, 0x2d, 0xac, 0x77, 0xe6, 0xfa, 0x17, 0x50, 0x3a, 0xbd, 0x00, + 0x4c, 0x65, 0xfe, 0x2f, 0x66, 0xc6, 0x99, 0xcb, 0xec, 0xfa, 0xf4, 0x84, + 0x7b, 0xf6, 0xdf, 0x01, 0x01, 0x01, 0xfd, 0x2f, 0x5e, 0xbc, 0x98, 0x36, + 0x6c, 0xd8, 0x30, 0x00, 0x6d, 0x79, 0xdc, 0x32, 0x99, 0x2c, 0x86, 0xa0, + 0x21, 0x9b, 0xfd, 0x20, 0x02, 0x20, 0x96, 0xc9, 0x64, 0x76, 0xf6, 0xf8, + 0x25, 0x2d, 0x2d, 0x0d, 0x97, 0x2f, 0x5f, 0x96, 0x5a, 0xad, 0xd6, 0x28, + 0x12, 0x11, 0xa9, 0x54, 0x8a, 0xb0, 0xb0, 0xf6, 0x22, 0x8a, 0x29, 0x29, + 0x29, 0x28, 0x28, 0x28, 0x08, 0xb4, 0x58, 0x2c, 0xc9, 0x4b, 0x97, 0x2e, + 0xad, 0xdb, 0xbc, 0x79, 0x73, 0x22, 0xa3, 0x6c, 0x85, 0xc6, 0x20, 0x22, + 0x8c, 0x51, 0x8a, 0x98, 0x73, 0xb6, 0xd8, 0x8f, 0x81, 0x30, 0xf2, 0xf4, + 0xcd, 0xcd, 0xcd, 0xd5, 0x75, 0x75, 0x75, 0xa9, 0x6c, 0x03, 0x4a, 0xa5, + 0x12, 0x14, 0x45, 0x49, 0x05, 0x76, 0xe7, 0x6c, 0xf0, 0x65, 0x63, 0x51, + 0x51, 0x91, 0x99, 0x19, 0x1f, 0xec, 0x76, 0x3b, 0xea, 0xeb, 0xeb, 0x2d, + 0xe0, 0xe7, 0xb8, 0x4b, 0x01, 0x04, 0xb6, 0xb4, 0xb4, 0x94, 0x17, 0x17, + 0x17, 0x5b, 0x98, 0x39, 0x03, 0x00, 0x04, 0x07, 0x07, 0x53, 0xcc, 0xae, + 0xde, 0x55, 0x7e, 0x3b, 0x99, 0xf9, 0x12, 0x1a, 0x1b, 0x1b, 0x3b, 0x92, + 0x4d, 0xfb, 0x03, 0x80, 0xdc, 0xdc, 0x5c, 0xd4, 0xd4, 0xd4, 0x9c, 0x46, + 0x5b, 0xca, 0x9e, 0xc1, 0x43, 0xfe, 0xe7, 0x3c, 0x47, 0x4a, 0xa5, 0xb2, + 0xdf, 0xa4, 0x49, 0x93, 0x54, 0x84, 0x71, 0x89, 0xc3, 0x87, 0x0f, 0xb7, + 0xda, 0x6c, 0xb6, 0x1c, 0xb4, 0x5d, 0xe9, 0xdc, 0xc8, 0xac, 0x65, 0x5b, + 0x50, 0x50, 0xd0, 0xc1, 0xf3, 0xe7, 0xcf, 0x4f, 0x66, 0x0d, 0x80, 0xf4, + 0xf4, 0x74, 0xc8, 0xe5, 0xf2, 0x04, 0xf0, 0x0b, 0x15, 0x91, 0xde, 0x33, + 0x96, 0x4e, 0xad, 0x6d, 0xb6, 0x4a, 0xd3, 0xfb, 0xfb, 0xf7, 0xef, 0x1f, + 0x74, 0xe1, 0xc2, 0x85, 0xf1, 0x1a, 0x8d, 0x26, 0x59, 0xa1, 0x50, 0xc8, + 0x2c, 0x16, 0x0b, 0x6d, 0xb1, 0x58, 0x5a, 0x4a, 0x4b, 0x4b, 0xaf, 0x1a, + 0x8d, 0x46, 0x45, 0x46, 0x46, 0xc6, 0x1d, 0x2c, 0x2e, 0x5a, 0xad, 0x16, + 0x16, 0x8b, 0xa5, 0x85, 0xe1, 0xd5, 0x9e, 0x5e, 0x5f, 0x7e, 0xf0, 0x83, + 0x1f, 0xbc, 0x34, 0x00, 0x78, 0x97, 0xf4, 0xa0, 0xed, 0x26, 0x38, 0x25, + 0xb1, 0x23, 0xa8, 0x47, 0x5b, 0x5e, 0x38, 0x29, 0x44, 0x69, 0x0f, 0x84, + 0x15, 0x1b, 0xe0, 0x16, 0x24, 0x16, 0x8b, 0x6f, 0x9f, 0x33, 0x67, 0x8e, + 0x9a, 0xcc, 0xfd, 0xaf, 0xaa, 0xaa, 0xfa, 0x05, 0xed, 0xb9, 0xff, 0x56, + 0x0f, 0x8e, 0x18, 0xc8, 0x28, 0xe5, 0x1b, 0x25, 0x25, 0x25, 0x66, 0xf2, + 0xcb, 0x7e, 0xfd, 0xfa, 0xc9, 0xd0, 0x56, 0x8f, 0x3f, 0x88, 0x11, 0xa8, + 0x52, 0x00, 0x41, 0x2a, 0x95, 0x2a, 0x86, 0x0c, 0x26, 0xab, 0xae, 0xae, + 0x86, 0xd9, 0x6c, 0xae, 0x43, 0x7b, 0x14, 0x77, 0xb7, 0xef, 0x50, 0x04, + 0xd2, 0x21, 0xc3, 0xd0, 0x76, 0x9b, 0xe1, 0x1b, 0xeb, 0xd7, 0xaf, 0x07, + 0xa9, 0xfc, 0x77, 0xee, 0xdc, 0x69, 0x7f, 0xf5, 0xd5, 0x57, 0xeb, 0x0a, + 0x0a, 0x0a, 0xbe, 0x05, 0x70, 0x88, 0x51, 0x12, 0x46, 0x06, 0x4f, 0x76, + 0xae, 0xec, 0x02, 0xc2, 0x95, 0xfd, 0x2e, 0x30, 0x3a, 0x3a, 0x7a, 0xd1, + 0x0b, 0x2f, 0xbc, 0x30, 0x8f, 0x35, 0x1e, 0xbb, 0x65, 0xb0, 0x00, 0x00, + 0x10, 0xb9, 0x49, 0x44, 0x41, 0x54, 0x7c, 0x5a, 0x5a, 0x5a, 0xf0, 0xfe, + 0xfb, 0xef, 0x9f, 0x2e, 0x2a, 0x2a, 0x5a, 0x82, 0xb6, 0xb3, 0x6b, 0xd6, + 0xb0, 0x6b, 0x6d, 0x6e, 0x6e, 0x6e, 0xd4, 0xeb, 0xf5, 0x5c, 0xff, 0x01, + 0x01, 0x01, 0xec, 0xc5, 0x3d, 0x42, 0x0a, 0xd4, 0xea, 0xa8, 0xa8, 0xd8, + 0x23, 0x1d, 0x77, 0xc0, 0x1a, 0x04, 0x4c, 0xce, 0xb8, 0x58, 0x60, 0xf7, + 0xcc, 0x15, 0x7a, 0x92, 0x48, 0x24, 0x09, 0x2a, 0x95, 0xea, 0x7e, 0x9a, + 0xa6, 0x03, 0x68, 0x9a, 0x96, 0x50, 0x14, 0x65, 0x37, 0x99, 0x4c, 0x3f, + 0x1b, 0x8d, 0xc6, 0x02, 0x62, 0x37, 0x2f, 0x06, 0x20, 0x11, 0x89, 0x44, + 0xbc, 0xe8, 0xfd, 0xe6, 0xe6, 0x66, 0xd0, 0x34, 0xed, 0x78, 0xa1, 0x14, + 0x4b, 0x2f, 0x0b, 0x80, 0x1b, 0x57, 0xaf, 0x5e, 0x35, 0x31, 0xde, 0x22, + 0x16, 0x27, 0x32, 0x2b, 0x84, 0x3c, 0x46, 0xa2, 0x1d, 0xe3, 0x45, 0xb4, + 0x5a, 0x2d, 0x8d, 0xb6, 0x23, 0x18, 0x77, 0x73, 0xcd, 0xc6, 0x4c, 0x0c, + 0x1e, 0x37, 0x6e, 0x9c, 0x86, 0x75, 0xd5, 0x03, 0x40, 0x76, 0x76, 0xb6, + 0xa1, 0xb6, 0xb6, 0xf6, 0x24, 0xda, 0x8f, 0x42, 0xdc, 0x1d, 0x7f, 0xf1, + 0x8c, 0xa3, 0xe0, 0xe0, 0xe0, 0xb0, 0x90, 0x90, 0x10, 0x0e, 0x2f, 0xab, + 0xd5, 0x0a, 0xa3, 0xd1, 0x68, 0x67, 0xf0, 0x62, 0x8d, 0x75, 0x00, 0x30, + 0x69, 0xb5, 0x5a, 0x5e, 0x1a, 0xac, 0x44, 0x22, 0x01, 0x93, 0xe3, 0x2f, + 0x41, 0xc7, 0x23, 0x33, 0x21, 0x4f, 0xa0, 0x1d, 0x40, 0x61, 0x55, 0x55, + 0x55, 0x59, 0x55, 0x55, 0x15, 0x4d, 0xac, 0x43, 0x45, 0xdb, 0xf4, 0x87, + 0xdf, 0x97, 0x9c, 0x9c, 0xcc, 0xf1, 0xca, 0xd5, 0xab, 0x57, 0x61, 0x34, + 0x1a, 0x4b, 0xc1, 0xcf, 0xc2, 0xf0, 0x1b, 0x00, 0x7e, 0xf0, 0xc3, 0x2d, + 0x6a, 0x00, 0x90, 0xb7, 0xa4, 0x4d, 0x4c, 0x4c, 0x4c, 0x7c, 0x6f, 0xc0, + 0x80, 0x01, 0xcd, 0x6d, 0x69, 0xc7, 0x14, 0x5d, 0x50, 0x50, 0x40, 0x95, + 0x96, 0x96, 0x3e, 0x84, 0xb6, 0x4a, 0x75, 0x6c, 0x81, 0x15, 0x6f, 0x94, + 0x9d, 0x3a, 0x39, 0x39, 0x79, 0xc2, 0xbd, 0xf7, 0xde, 0x2b, 0x07, 0x80, + 0xf2, 0xf2, 0x72, 0x9c, 0x38, 0x71, 0xa2, 0x1e, 0xc0, 0x69, 0xb8, 0xcf, + 0xfd, 0x17, 0x32, 0x00, 0xcc, 0x00, 0xaa, 0x6f, 0xdc, 0xb8, 0x61, 0xa8, + 0xae, 0xae, 0x0e, 0x67, 0x95, 0xfb, 0xd0, 0xa1, 0x43, 0x15, 0x61, 0x61, + 0x61, 0xe9, 0xf5, 0xf5, 0xf5, 0xc7, 0x88, 0x9d, 0x6b, 0x94, 0x4c, 0x26, + 0x8b, 0x62, 0x77, 0x3f, 0x00, 0x70, 0xfa, 0xf4, 0x69, 0x5b, 0x55, 0x55, + 0xd5, 0x05, 0xc2, 0xa3, 0xd1, 0x53, 0x02, 0x8a, 0x4c, 0x09, 0x8b, 0x4f, + 0x4b, 0x4b, 0x7b, 0x61, 0xc3, 0x86, 0x0d, 0x20, 0x6f, 0x17, 0x5c, 0xb7, + 0x6e, 0x9d, 0xe5, 0xc5, 0x17, 0x5f, 0x34, 0xb6, 0xb6, 0xb6, 0x7e, 0xc5, + 0x18, 0x5d, 0xec, 0x05, 0x30, 0x6a, 0xe2, 0xf7, 0x6c, 0x29, 0xdc, 0x56, + 0x00, 0x16, 0x87, 0x3a, 0xeb, 0x22, 0x00, 0xb2, 0x86, 0x86, 0x86, 0xda, + 0x84, 0x84, 0x04, 0xf1, 0xdc, 0xb9, 0x73, 0x45, 0x00, 0x50, 0x53, 0x53, + 0x83, 0x0f, 0x3f, 0xfc, 0x30, 0x96, 0xf1, 0x0c, 0x48, 0x19, 0x1a, 0xaa, + 0x00, 0x04, 0x04, 0x06, 0x06, 0x06, 0x93, 0xb7, 0x29, 0xea, 0x74, 0x3a, + 0xd0, 0x34, 0xdd, 0xea, 0xe0, 0x36, 0x67, 0x95, 0x7f, 0xab, 0x48, 0x24, + 0x32, 0xd7, 0xd6, 0xd6, 0x62, 0xff, 0xfe, 0xfd, 0x4e, 0x07, 0x1a, 0x14, + 0x14, 0x84, 0x11, 0x23, 0x46, 0xf0, 0xfe, 0x76, 0xec, 0xd8, 0x31, 0x18, + 0x0c, 0x06, 0xb4, 0xb4, 0xb4, 0xb0, 0xc1, 0x66, 0x56, 0x67, 0x34, 0x52, + 0x2a, 0x95, 0x0f, 0xbc, 0xfb, 0xee, 0xbb, 0x7f, 0x60, 0x8d, 0x0b, 0x9b, + 0xcd, 0x86, 0xc5, 0x8b, 0x17, 0xdf, 0x5d, 0x5c, 0x5c, 0xfc, 0x24, 0x63, + 0x10, 0x59, 0x19, 0x9a, 0x04, 0xab, 0x54, 0xaa, 0x5e, 0xec, 0x19, 0x3d, + 0x00, 0x94, 0x96, 0x96, 0xc2, 0x6a, 0xb5, 0xd6, 0x38, 0x18, 0x78, 0x64, + 0x91, 0xa4, 0xd2, 0x92, 0x92, 0x92, 0xe6, 0xba, 0xba, 0xba, 0xb0, 0xf0, + 0xf0, 0x70, 0x88, 0x44, 0x22, 0xa4, 0xa4, 0xa4, 0xc8, 0xcf, 0x9e, 0x3d, + 0x9b, 0xca, 0xb4, 0xcd, 0xae, 0x99, 0x90, 0x90, 0x90, 0x90, 0xa4, 0xd4, + 0xd4, 0x54, 0x29, 0x69, 0x5c, 0x68, 0xb5, 0x5a, 0x33, 0x63, 0x44, 0x59, + 0x5d, 0x78, 0x62, 0xb8, 0xca, 0x97, 0xe1, 0xe1, 0xe1, 0x43, 0xa7, 0x4f, + 0x9f, 0xae, 0x22, 0x95, 0x75, 0x6e, 0x6e, 0xae, 0x11, 0x6d, 0xf1, 0x1c, + 0x2d, 0x1e, 0xee, 0xfe, 0xc9, 0x35, 0x40, 0x9b, 0x4c, 0x26, 0x03, 0x69, + 0xb4, 0x49, 0x24, 0x12, 0x28, 0x14, 0x0a, 0x29, 0xda, 0x8e, 0x95, 0x94, + 0x0c, 0x5f, 0xcb, 0x01, 0x04, 0x46, 0x44, 0x44, 0x44, 0x91, 0x1e, 0x30, + 0x9a, 0xa6, 0xa1, 0xd7, 0xeb, 0x29, 0x74, 0x74, 0xcf, 0x93, 0x77, 0x26, + 0x04, 0x25, 0x24, 0x24, 0xfc, 0x31, 0x30, 0x30, 0x30, 0xc9, 0x6e, 0xb7, + 0xcb, 0x01, 0x88, 0x5b, 0x5b, 0x5b, 0xc5, 0x65, 0x65, 0x65, 0x9f, 0x32, + 0xde, 0x05, 0xb6, 0xb6, 0x82, 0x2d, 0x32, 0x32, 0x32, 0x3e, 0x3d, 0x3d, + 0x9d, 0x6b, 0xe4, 0xc8, 0x91, 0x23, 0xe6, 0x92, 0x92, 0x92, 0x33, 0x68, + 0x0f, 0xec, 0xf5, 0x7b, 0x00, 0xfc, 0xe0, 0x87, 0x5b, 0xdc, 0x00, 0x60, + 0x3d, 0x00, 0xc9, 0x6f, 0xbc, 0xf1, 0x86, 0x6a, 0xde, 0xbc, 0x79, 0x9c, + 0xc0, 0x5a, 0xb0, 0x60, 0x41, 0xed, 0xc6, 0x8d, 0x1b, 0xa3, 0x01, 0x5c, + 0x65, 0xde, 0x33, 0x79, 0xe1, 0xea, 0x56, 0x01, 0x48, 0x4b, 0x49, 0x49, + 0x89, 0x49, 0x4b, 0x4b, 0x03, 0xd0, 0x96, 0xfb, 0x5f, 0x5a, 0x5a, 0x7a, + 0x08, 0xed, 0xc1, 0x7f, 0x66, 0x0f, 0x76, 0x3f, 0xa4, 0x01, 0x60, 0x04, + 0xd0, 0xdc, 0xd0, 0xd0, 0x70, 0xee, 0xec, 0xd9, 0xb3, 0x49, 0x59, 0x59, + 0x59, 0x00, 0x80, 0x21, 0x43, 0x86, 0x20, 0x28, 0x28, 0x68, 0x78, 0x7d, + 0x7d, 0xfd, 0xaf, 0x8c, 0x3b, 0x57, 0x2c, 0x16, 0x8b, 0xc7, 0x4f, 0x9e, + 0x3c, 0x59, 0x49, 0xe6, 0x8f, 0xe7, 0xe4, 0xe4, 0xe8, 0x5b, 0x5a, 0x5a, + 0xce, 0x91, 0x7d, 0xf7, 0xc0, 0x1c, 0xf0, 0x8a, 0xe8, 0xc8, 0xe5, 0xf2, + 0xa9, 0xf3, 0xe7, 0xcf, 0xef, 0xc5, 0x96, 0x43, 0x06, 0x80, 0x57, 0x5e, + 0x79, 0xc5, 0xbe, 0x76, 0xed, 0x5a, 0x5d, 0x6b, 0x6b, 0xeb, 0x65, 0xb4, + 0xdd, 0x86, 0x17, 0x81, 0xf6, 0xe3, 0x11, 0x13, 0x3b, 0x6e, 0x00, 0xe7, + 0xd1, 0x16, 0x0f, 0xe0, 0x18, 0xc8, 0xc8, 0xd1, 0xcf, 0x6c, 0x36, 0xdf, + 0xc8, 0xcb, 0xcb, 0xd3, 0xcf, 0x9d, 0x3b, 0x57, 0x03, 0xb4, 0x9d, 0x5d, + 0x07, 0x04, 0x04, 0x44, 0x51, 0x14, 0xf5, 0x30, 0x4d, 0xd3, 0x3b, 0x99, + 0xb6, 0x02, 0x00, 0x4c, 0xea, 0xdd, 0xbb, 0x77, 0x3c, 0x99, 0x6e, 0x78, + 0xe6, 0xcc, 0x19, 0x18, 0x0c, 0x86, 0x6b, 0xe0, 0x1f, 0xf9, 0xb0, 0x9e, + 0x17, 0x43, 0x43, 0x43, 0xc3, 0xe7, 0x8b, 0x16, 0x2d, 0xb2, 0x52, 0x14, + 0x25, 0xa5, 0x69, 0x9a, 0x2b, 0xf5, 0x4a, 0xd3, 0xb4, 0x98, 0x29, 0x9b, + 0xac, 0x34, 0x9b, 0xcd, 0xe9, 0x07, 0x0e, 0x1c, 0x50, 0xb3, 0x69, 0x74, + 0xa7, 0x4e, 0x9d, 0xc2, 0x5d, 0x77, 0xdd, 0xd5, 0xa8, 0x50, 0x28, 0xf2, + 0xec, 0x76, 0x7b, 0x09, 0xda, 0x8a, 0xde, 0x98, 0x9d, 0x79, 0xa3, 0xb4, + 0x5a, 0x6d, 0x71, 0x4d, 0x4d, 0x4d, 0xf3, 0xc2, 0x85, 0x0b, 0xb9, 0xe0, + 0x8d, 0xcf, 0x3e, 0xfb, 0x4c, 0x5d, 0x59, 0x59, 0x39, 0xdb, 0x6c, 0x36, + 0xff, 0xc4, 0xfc, 0x56, 0x29, 0x16, 0x8b, 0xa7, 0x0e, 0x19, 0x32, 0x24, + 0x9c, 0xac, 0x96, 0x98, 0x9b, 0x9b, 0x6b, 0x29, 0x29, 0x29, 0x39, 0xed, + 0x30, 0xbf, 0x64, 0x91, 0x27, 0x7d, 0x6d, 0x6d, 0x6d, 0xfe, 0xd1, 0xa3, + 0x47, 0x7b, 0xdd, 0x73, 0xcf, 0x3d, 0x22, 0x00, 0x58, 0xba, 0x74, 0x69, + 0x60, 0x4e, 0x4e, 0xce, 0xc3, 0x5a, 0xad, 0xb6, 0x92, 0x31, 0x2c, 0xc4, + 0x00, 0xfa, 0x24, 0x24, 0x24, 0x0c, 0x1f, 0x35, 0x6a, 0x14, 0xb7, 0xd3, + 0x2e, 0x28, 0x28, 0x80, 0x4e, 0xa7, 0xbb, 0xc6, 0x18, 0x5f, 0xce, 0xb2, + 0x56, 0x48, 0xef, 0x57, 0x60, 0x78, 0x78, 0x78, 0x06, 0x7b, 0xbc, 0x02, + 0x00, 0x57, 0xae, 0x5c, 0x41, 0x4b, 0x4b, 0x0b, 0xeb, 0xa6, 0x6f, 0xf5, + 0x70, 0xf7, 0xcf, 0xf3, 0x80, 0xd5, 0xd5, 0xd5, 0x95, 0x5e, 0xba, 0x74, + 0xc9, 0x34, 0x7d, 0xfa, 0x74, 0xee, 0x68, 0x62, 0xfc, 0xf8, 0xf1, 0x01, + 0xe7, 0xce, 0x9d, 0x5b, 0x60, 0x32, 0x99, 0xd6, 0x32, 0x86, 0x80, 0x0c, + 0x40, 0xaa, 0x5a, 0xad, 0x1e, 0x78, 0xdb, 0x6d, 0xb7, 0x71, 0x8d, 0x14, + 0x17, 0x17, 0xc3, 0x66, 0xb3, 0xd5, 0x12, 0x06, 0x92, 0x8d, 0x68, 0x9b, + 0x95, 0x17, 0x62, 0x9a, 0xa6, 0xa7, 0x7e, 0xf5, 0xd5, 0x57, 0x31, 0x6c, + 0xdc, 0xc2, 0xb7, 0xdf, 0x7e, 0x4b, 0xaf, 0x5e, 0xbd, 0xfa, 0x71, 0x9d, + 0x4e, 0xb7, 0x81, 0x79, 0x37, 0x40, 0x2e, 0x97, 0x8f, 0x99, 0x38, 0x71, + 0x62, 0x30, 0x5b, 0x8e, 0xd8, 0x6e, 0xb7, 0x63, 0xe7, 0xce, 0x9d, 0x3a, + 0x9b, 0xcd, 0x76, 0x0a, 0xce, 0x6b, 0x55, 0xf8, 0xc1, 0x0f, 0x7e, 0xb8, + 0x85, 0x0c, 0x00, 0xd2, 0x7d, 0xdc, 0xa1, 0xc6, 0x2d, 0x93, 0xbf, 0xcd, + 0xee, 0xa8, 0x3d, 0xc9, 0xeb, 0x25, 0x8f, 0x14, 0xd4, 0xc1, 0xc1, 0xc1, + 0x63, 0xd8, 0xdc, 0x7f, 0xbb, 0xdd, 0x8e, 0xcd, 0x9b, 0x37, 0x6b, 0x5b, + 0x5a, 0x5a, 0x8e, 0x80, 0x7f, 0xf3, 0x9f, 0x27, 0x3b, 0x04, 0xb2, 0x0a, + 0x9a, 0xbe, 0xba, 0xba, 0xfa, 0xe7, 0x8f, 0x3e, 0xfa, 0x68, 0x6c, 0x56, + 0x56, 0x96, 0x06, 0x68, 0x2b, 0xf1, 0xbb, 0x7e, 0xfd, 0x7a, 0xd5, 0xdc, + 0xb9, 0x73, 0x97, 0xca, 0xe5, 0xf2, 0x53, 0x36, 0x9b, 0x2d, 0x5a, 0x2a, + 0x95, 0xc6, 0xff, 0xe9, 0x4f, 0x7f, 0x92, 0xb2, 0x42, 0xec, 0xfa, 0xf5, + 0xeb, 0x38, 0x76, 0xec, 0x58, 0x2d, 0x80, 0x7c, 0x42, 0xb9, 0x7a, 0x23, + 0x7c, 0x85, 0xde, 0x23, 0xd3, 0x04, 0x5d, 0x15, 0x30, 0xe2, 0x8c, 0xa2, + 0xde, 0xbd, 0x7b, 0x4f, 0x99, 0x3f, 0x7f, 0xbe, 0x82, 0xdc, 0x15, 0xde, + 0x7b, 0xef, 0xbd, 0x54, 0x68, 0x68, 0x68, 0x30, 0x80, 0x11, 0x4c, 0xc5, + 0x37, 0x38, 0x2a, 0x76, 0x91, 0x48, 0x64, 0x7f, 0xed, 0xb5, 0xd7, 0x8c, + 0x75, 0x75, 0x75, 0x63, 0x19, 0x05, 0xed, 0xe8, 0x3d, 0x61, 0x03, 0x36, + 0x2f, 0x1d, 0x38, 0x70, 0xc0, 0xd0, 0xd2, 0xd2, 0xa2, 0x09, 0x0c, 0x0c, + 0x04, 0x45, 0x51, 0x38, 0x72, 0xe4, 0x88, 0x74, 0xce, 0x9c, 0x39, 0x63, + 0xaf, 0x5c, 0xb9, 0xd2, 0xab, 0xb1, 0xb1, 0xf1, 0x86, 0x42, 0xa1, 0x88, + 0xd3, 0xe9, 0x74, 0xa9, 0x5b, 0xb7, 0x6e, 0x15, 0x93, 0x41, 0x92, 0x9f, + 0x7d, 0xf6, 0x99, 0xae, 0xb4, 0xb4, 0xf4, 0x27, 0xf0, 0x63, 0x33, 0xd8, + 0xa8, 0x6e, 0x83, 0x4e, 0xa7, 0x3b, 0xa3, 0xd3, 0xe9, 0x0a, 0x99, 0x9d, + 0xa6, 0x8c, 0x70, 0x25, 0xb3, 0xb1, 0x0d, 0x31, 0x89, 0x89, 0x89, 0x8f, + 0x1a, 0x8d, 0x46, 0xae, 0x1c, 0xb0, 0xd1, 0x68, 0x84, 0x4a, 0xa5, 0xba, + 0x56, 0x56, 0x56, 0xf6, 0x25, 0x63, 0x48, 0x36, 0x11, 0x6e, 0x6a, 0x47, + 0x3a, 0xdb, 0x01, 0x5c, 0xd8, 0xb9, 0x73, 0xa7, 0x76, 0xf1, 0xe2, 0xc5, + 0x4a, 0xe2, 0xd8, 0x48, 0x31, 0x73, 0xe6, 0xcc, 0x99, 0x57, 0xaf, 0x5e, + 0xcd, 0x68, 0x68, 0x68, 0xb8, 0x21, 0x95, 0x4a, 0xfb, 0x07, 0x05, 0x05, + 0xc5, 0xbe, 0xff, 0xfe, 0xfb, 0x32, 0xb6, 0x14, 0x6d, 0x6b, 0x6b, 0x2b, + 0x3e, 0xfe, 0xf8, 0xe3, 0x7a, 0xa3, 0xd1, 0x78, 0x80, 0x9c, 0x5f, 0x82, + 0x77, 0x8c, 0x8c, 0x01, 0xf0, 0xe3, 0xda, 0xb5, 0x6b, 0x47, 0x4f, 0x9f, + 0x3e, 0x3d, 0x54, 0x24, 0x12, 0xe1, 0xf6, 0xdb, 0x6f, 0xa7, 0x3e, 0xfc, + 0xf0, 0x43, 0xcd, 0x1b, 0x6f, 0xbc, 0xb1, 0xb8, 0xa2, 0xa2, 0xe2, 0x02, + 0x45, 0x51, 0xaa, 0xc6, 0xc6, 0xc6, 0x51, 0x1f, 0x7d, 0xf4, 0x11, 0xcd, + 0x2a, 0x37, 0x00, 0x58, 0xb3, 0x66, 0x8d, 0xbe, 0xac, 0xac, 0x6c, 0x2f, + 0xc3, 0xbb, 0xae, 0xee, 0xac, 0xe0, 0x2a, 0xe5, 0x85, 0x86, 0x86, 0xaa, + 0xc9, 0x23, 0xa8, 0xcb, 0x97, 0x2f, 0xd3, 0x95, 0x95, 0x95, 0x17, 0x08, + 0xfc, 0x3c, 0xe5, 0x7f, 0x32, 0x16, 0xa2, 0x60, 0xe7, 0xce, 0x9d, 0xda, + 0x45, 0x8b, 0x16, 0x45, 0xb2, 0xc6, 0xed, 0xea, 0xd5, 0xab, 0x25, 0x75, + 0x75, 0x75, 0x09, 0x47, 0x8f, 0x1e, 0x7d, 0xb6, 0xae, 0xae, 0xae, 0x54, + 0xa1, 0x50, 0xa8, 0xea, 0xea, 0xea, 0x86, 0xef, 0xd8, 0xb1, 0x43, 0xc4, + 0xde, 0xa8, 0xc8, 0x1c, 0x3f, 0x98, 0x4a, 0x4b, 0x4b, 0x73, 0x05, 0xe8, + 0x63, 0x23, 0x8f, 0x01, 0x24, 0x12, 0xc9, 0x49, 0x9d, 0x4e, 0x77, 0xcf, + 0x98, 0x31, 0x63, 0x00, 0x00, 0xe9, 0xe9, 0xe9, 0xd4, 0xc1, 0x83, 0x07, + 0xfb, 0x5f, 0xbc, 0x78, 0xf1, 0xd9, 0x86, 0x86, 0x86, 0x6b, 0x01, 0x01, + 0x01, 0x83, 0xe2, 0xe2, 0xe2, 0x22, 0xdf, 0x78, 0xe3, 0x0d, 0x8e, 0xfe, + 0x3f, 0xfd, 0xf4, 0x13, 0x7d, 0xed, 0xda, 0xb5, 0xf3, 0x68, 0x4f, 0xed, + 0xf5, 0x74, 0x7d, 0xf9, 0xc1, 0x0f, 0x7e, 0xb8, 0x89, 0x06, 0x80, 0xab, + 0xb4, 0x38, 0x1a, 0xde, 0xe5, 0xc2, 0xb3, 0x47, 0x0a, 0x72, 0x00, 0xaa, + 0xb8, 0xb8, 0xb8, 0x91, 0x53, 0xa7, 0x4e, 0x15, 0xb1, 0x3b, 0xc1, 0xb2, + 0xb2, 0xb2, 0x22, 0xc6, 0xbd, 0x6d, 0xf0, 0x66, 0x07, 0xce, 0x94, 0x42, + 0x65, 0xab, 0xe9, 0xe9, 0x01, 0x9c, 0x3e, 0x71, 0xe2, 0x44, 0xd1, 0xb1, + 0x63, 0xc7, 0x06, 0x8d, 0x1c, 0x39, 0x92, 0x02, 0x80, 0x69, 0xd3, 0xa6, + 0x89, 0x0a, 0x0a, 0x0a, 0x14, 0xe7, 0xcf, 0x9f, 0xbf, 0x43, 0x26, 0x93, + 0x61, 0xc2, 0x84, 0x09, 0x20, 0xeb, 0x94, 0xaf, 0x5e, 0xbd, 0xba, 0xa5, + 0xb0, 0xb0, 0x70, 0x37, 0xda, 0x6e, 0xc4, 0x6b, 0x81, 0xfb, 0x18, 0x00, + 0xb2, 0xf2, 0x9a, 0xb3, 0xd8, 0x07, 0x1b, 0x3c, 0x8b, 0x25, 0x60, 0x0d, + 0xa3, 0xd8, 0x3e, 0x7d, 0xfa, 0x84, 0xc6, 0xc7, 0xc7, 0xf3, 0x5c, 0xb8, + 0xc3, 0x87, 0x0f, 0xa7, 0x86, 0x0f, 0x1f, 0x2e, 0x76, 0x47, 0x87, 0x0d, + 0x1b, 0x36, 0x34, 0xd4, 0xd5, 0xd5, 0x05, 0x80, 0x7f, 0x86, 0x0b, 0x62, + 0x97, 0x6b, 0x04, 0x50, 0x53, 0x54, 0x54, 0xf4, 0xcb, 0xba, 0x75, 0xeb, + 0x66, 0xbe, 0xf8, 0xe2, 0x8b, 0x0a, 0xa0, 0x2d, 0x38, 0xee, 0xdb, 0x6f, + 0xbf, 0x55, 0xe5, 0xe7, 0xe7, 0x67, 0xd6, 0xd6, 0xd6, 0x66, 0x06, 0x05, + 0x05, 0x61, 0xe4, 0xc8, 0x91, 0x50, 0x28, 0x38, 0x3b, 0x04, 0x3b, 0x76, + 0xec, 0xb0, 0xed, 0xdf, 0xbf, 0xff, 0x32, 0x80, 0x5f, 0xd1, 0x9e, 0x6d, + 0x60, 0x27, 0x8c, 0x00, 0x23, 0xd1, 0x47, 0x13, 0xda, 0x03, 0xf5, 0x58, + 0x03, 0x20, 0x18, 0x80, 0x55, 0x24, 0x12, 0x35, 0x77, 0x18, 0xbc, 0x48, + 0xd4, 0xc2, 0xb8, 0xd8, 0x9b, 0x08, 0xe5, 0x20, 0x64, 0xe0, 0x99, 0xd1, + 0x76, 0x4e, 0x7f, 0xf0, 0xe3, 0x8f, 0x3f, 0x9e, 0xf5, 0xcc, 0x33, 0xcf, + 0xc8, 0x81, 0xb6, 0x3c, 0xfc, 0xec, 0xec, 0x6c, 0x65, 0x6e, 0x6e, 0xee, + 0x90, 0xfa, 0xfa, 0x7a, 0x44, 0x44, 0x44, 0x60, 0xf4, 0xe8, 0xd1, 0xbc, + 0xf9, 0x4d, 0x4d, 0x4d, 0xb5, 0x35, 0x35, 0x35, 0xed, 0x66, 0x14, 0x90, + 0xc1, 0xc1, 0x80, 0x21, 0x79, 0xa7, 0xa0, 0xa0, 0xa0, 0xe0, 0xe4, 0xa7, + 0x9f, 0x7e, 0x3a, 0xf1, 0xf1, 0xc7, 0x1f, 0x97, 0x00, 0xc0, 0xbc, 0x79, + 0xf3, 0xa4, 0x23, 0x46, 0x8c, 0x88, 0x3b, 0x7f, 0xfe, 0x7c, 0x9c, 0x58, + 0x2c, 0xc6, 0x88, 0x11, 0x23, 0xd8, 0x92, 0xb6, 0x2c, 0x6d, 0xe8, 0x7d, + 0xfb, 0xf6, 0xd5, 0x39, 0xd0, 0xc6, 0x55, 0x11, 0x20, 0x0a, 0x40, 0x64, + 0x6a, 0x6a, 0x2a, 0x6f, 0xfd, 0x9d, 0x3d, 0x7b, 0xd6, 0x68, 0x30, 0x18, + 0x0a, 0x1d, 0xdc, 0xff, 0x9e, 0x1a, 0x00, 0xec, 0x8d, 0x83, 0xd7, 0x2e, + 0x5d, 0xba, 0x74, 0x74, 0xfd, 0xfa, 0xf5, 0x77, 0x3d, 0xfb, 0xec, 0xb3, + 0x52, 0xc2, 0x78, 0x53, 0xe4, 0xe7, 0xe7, 0xf7, 0xab, 0xaa, 0xaa, 0xea, + 0x27, 0x97, 0xcb, 0x31, 0x60, 0xc0, 0x00, 0x90, 0xc6, 0xc7, 0x91, 0x23, + 0x47, 0xb0, 0x6e, 0xdd, 0xba, 0xb2, 0x96, 0x96, 0x96, 0x6c, 0x81, 0x31, + 0xb0, 0x99, 0x11, 0x76, 0x00, 0xd6, 0xa2, 0xa2, 0xa2, 0xbd, 0xef, 0xbd, + 0xf7, 0xde, 0xa8, 0x11, 0x23, 0x46, 0x84, 0xc9, 0x64, 0x32, 0x88, 0x44, + 0x22, 0xec, 0xdb, 0xb7, 0x4f, 0xbe, 0x7f, 0xff, 0xfe, 0xd4, 0xba, 0xba, + 0xba, 0xd4, 0x88, 0x88, 0x08, 0x4c, 0x9e, 0x3c, 0x99, 0xab, 0x36, 0xd8, + 0xd4, 0xd4, 0x84, 0xe7, 0x9e, 0x7b, 0xae, 0xa9, 0xa2, 0xa2, 0x62, 0x0b, + 0xb3, 0xbe, 0x9a, 0xe1, 0xaf, 0x05, 0xe0, 0x07, 0x3f, 0xdc, 0xf2, 0x06, + 0x00, 0xb9, 0x3b, 0x6a, 0xd9, 0xb2, 0x65, 0x0b, 0xef, 0xcb, 0xe3, 0xc7, + 0x8f, 0x07, 0x3a, 0xb8, 0x53, 0x9d, 0x2e, 0x68, 0x87, 0x7a, 0xee, 0x52, + 0x00, 0x03, 0x27, 0x4e, 0x9c, 0xa8, 0x66, 0xcf, 0x98, 0x77, 0xee, 0xdc, + 0xd9, 0x72, 0xfd, 0xfa, 0xf5, 0x1c, 0xb4, 0x45, 0x5b, 0x7b, 0x92, 0xfb, + 0x2f, 0x24, 0x04, 0xd9, 0x34, 0xa5, 0x9a, 0x92, 0x92, 0x92, 0xf7, 0x1f, + 0x7b, 0xec, 0xb1, 0xbf, 0x7d, 0xf6, 0xd9, 0x67, 0xd1, 0xac, 0x9b, 0x35, + 0x21, 0x21, 0x01, 0x09, 0x09, 0x09, 0x8e, 0xc6, 0x03, 0xd6, 0xac, 0x59, + 0x63, 0xdd, 0xba, 0x75, 0xeb, 0x75, 0xab, 0xd5, 0xfa, 0x2d, 0xda, 0x8b, + 0xb8, 0x78, 0xb2, 0xfb, 0x62, 0x05, 0x6f, 0x2b, 0x45, 0x51, 0x42, 0x25, + 0x5a, 0x4d, 0xe0, 0xdf, 0x3d, 0xef, 0x4c, 0x21, 0xb0, 0x10, 0x35, 0x62, + 0xc4, 0x08, 0x85, 0x0f, 0x8e, 0x14, 0x84, 0x80, 0xdd, 0x21, 0x36, 0x6a, + 0xb5, 0xda, 0x7f, 0xae, 0x5d, 0xbb, 0xb6, 0x8f, 0x4c, 0x26, 0x1b, 0xfa, + 0xec, 0xb3, 0xcf, 0x4a, 0x44, 0x22, 0x11, 0x14, 0x0a, 0x05, 0x1c, 0xcb, + 0xb6, 0x12, 0x3b, 0x43, 0xfb, 0xd2, 0xa5, 0x4b, 0x2b, 0xcb, 0xca, 0xca, + 0xfe, 0x02, 0x87, 0x62, 0x43, 0x84, 0xf1, 0xc5, 0xba, 0x74, 0xcd, 0x0e, + 0xc6, 0x07, 0x7b, 0xc5, 0xac, 0x15, 0x80, 0x94, 0xa2, 0xa8, 0x16, 0x01, + 0x3a, 0xb5, 0xa2, 0x3d, 0xe7, 0xdd, 0x59, 0x19, 0x5d, 0xd6, 0xb8, 0xd0, + 0x36, 0x34, 0x34, 0x7c, 0xf9, 0xce, 0x3b, 0xef, 0xf4, 0xb3, 0x58, 0x2c, + 0x83, 0x16, 0x2f, 0x5e, 0x2c, 0x01, 0xda, 0x4a, 0xf3, 0x4e, 0x98, 0x30, + 0xa1, 0xe3, 0x8f, 0x6c, 0x36, 0x6c, 0xda, 0xb4, 0xc9, 0x68, 0x32, 0x99, + 0x2e, 0xe8, 0xf5, 0xfa, 0x2f, 0x1d, 0x15, 0x90, 0x83, 0xf1, 0x68, 0x00, + 0x50, 0x57, 0x55, 0x55, 0xf5, 0xd1, 0x1b, 0x6f, 0xbc, 0xd1, 0x27, 0x2c, + 0x2c, 0xac, 0xf7, 0xac, 0x59, 0xb3, 0x44, 0x00, 0xd0, 0xb7, 0x6f, 0x5f, + 0x90, 0xc7, 0x21, 0x84, 0xd2, 0xc6, 0xf2, 0xe5, 0xcb, 0x2b, 0x1a, 0x1b, + 0x1b, 0x5f, 0x44, 0x5b, 0xd5, 0x3e, 0x77, 0xc6, 0x2b, 0xbb, 0xa3, 0x56, + 0x09, 0x5c, 0x3c, 0xd4, 0x82, 0xb6, 0x0c, 0x88, 0xce, 0xf0, 0x3f, 0x5b, + 0xa8, 0xa7, 0xa1, 0xae, 0xae, 0xee, 0xe3, 0x77, 0xde, 0x79, 0x27, 0x25, + 0x20, 0x20, 0x20, 0xe5, 0xb1, 0xc7, 0x1e, 0x93, 0x30, 0x46, 0x56, 0x87, + 0x3c, 0x7d, 0x16, 0x0e, 0x1c, 0x38, 0x80, 0x29, 0x53, 0xa6, 0xd0, 0x34, + 0x4d, 0xbf, 0x86, 0xb6, 0xcb, 0x80, 0xf4, 0xe4, 0x0e, 0x9d, 0xa8, 0xde, + 0xc8, 0x66, 0x00, 0x1c, 0xfd, 0xe5, 0x97, 0x5f, 0xf6, 0x0f, 0x1f, 0x3e, + 0x7c, 0x66, 0x5e, 0x5e, 0x9e, 0x54, 0x2e, 0x97, 0x43, 0x24, 0x12, 0x81, + 0x3d, 0x72, 0x23, 0xa1, 0xae, 0xae, 0x0e, 0x73, 0xe6, 0xcc, 0x31, 0x14, + 0x16, 0x16, 0xfe, 0x1d, 0x6d, 0xf7, 0x7a, 0x34, 0xc1, 0xf3, 0xd4, 0x5e, + 0x3f, 0xf8, 0xc1, 0x0f, 0xb7, 0x80, 0x01, 0xd0, 0x0c, 0xe0, 0xeb, 0xec, + 0xec, 0x6c, 0x64, 0x67, 0x67, 0x07, 0xa2, 0x3d, 0x7f, 0xba, 0x0c, 0x6d, + 0x67, 0xce, 0x9e, 0x2a, 0x4c, 0x2e, 0xa2, 0x38, 0x29, 0x29, 0x69, 0xcc, + 0x9c, 0x39, 0x73, 0xd4, 0x40, 0xdb, 0x65, 0x24, 0xd9, 0xd9, 0xd9, 0x0d, + 0x68, 0xbb, 0xb1, 0x4d, 0xd7, 0x49, 0x01, 0x41, 0x13, 0x42, 0xb0, 0x11, + 0x40, 0xfe, 0xb9, 0x73, 0xe7, 0x96, 0x67, 0x65, 0x65, 0xbd, 0xf3, 0xf2, + 0xcb, 0x2f, 0x2b, 0xee, 0xba, 0xeb, 0x2e, 0x45, 0x42, 0x42, 0x02, 0x94, + 0x4a, 0x25, 0xec, 0x76, 0x3b, 0x74, 0x3a, 0x1d, 0x8e, 0x1f, 0x3f, 0x8e, + 0x6d, 0xdb, 0xb6, 0x35, 0xee, 0xd9, 0xb3, 0xe7, 0x44, 0x63, 0x63, 0xe3, + 0x5b, 0x8c, 0x72, 0xd3, 0xc1, 0xf3, 0xca, 0x83, 0xec, 0xd9, 0xb1, 0xae, + 0xb6, 0xb6, 0x56, 0xb9, 0x65, 0xcb, 0x16, 0xb6, 0x94, 0x30, 0x1a, 0x1b, + 0x1b, 0x41, 0xd3, 0xb4, 0x15, 0xee, 0xab, 0xb8, 0x91, 0x3b, 0x50, 0xf9, + 0xe1, 0xc3, 0x87, 0x95, 0x8e, 0x86, 0x96, 0xa7, 0x50, 0x5e, 0x5e, 0xae, + 0x76, 0x32, 0x17, 0x64, 0x8c, 0x84, 0x0e, 0x40, 0x45, 0x59, 0x59, 0xd9, + 0xcb, 0xaf, 0xbe, 0xfa, 0xea, 0x1b, 0x39, 0x39, 0x39, 0x7d, 0x1f, 0x7d, + 0xf4, 0x51, 0xcd, 0xe8, 0xd1, 0xa3, 0x29, 0x8d, 0x46, 0x03, 0x99, 0x4c, + 0xc6, 0x06, 0x83, 0xe1, 0xd4, 0xa9, 0x53, 0xd8, 0xba, 0x75, 0xab, 0xee, + 0xdf, 0xff, 0xfe, 0xf7, 0xb5, 0x92, 0x92, 0x92, 0xd5, 0x68, 0xbb, 0xef, + 0xbd, 0xd1, 0xb1, 0x0f, 0x66, 0x5c, 0xec, 0x85, 0x34, 0x36, 0x27, 0x74, + 0x12, 0x01, 0x90, 0x5b, 0xad, 0x56, 0x7a, 0xcb, 0x96, 0x2d, 0xb8, 0x7e, + 0xfd, 0x3a, 0x80, 0xb6, 0xd4, 0x30, 0xab, 0xd5, 0x4a, 0x13, 0x8a, 0x41, + 0x68, 0x67, 0x48, 0xe2, 0xaf, 0x05, 0x50, 0x5c, 0x52, 0x52, 0xf2, 0xe7, + 0xd7, 0x5e, 0x7b, 0xed, 0xf5, 0x9d, 0x3b, 0x77, 0xa6, 0xad, 0x58, 0xb1, + 0x42, 0x35, 0x70, 0xe0, 0x40, 0x8a, 0xcc, 0x3a, 0x68, 0x6c, 0x6c, 0x44, + 0x5e, 0x5e, 0x1e, 0x3e, 0xf8, 0xe0, 0x83, 0xc6, 0x13, 0x27, 0x4e, 0x1c, + 0xaf, 0xa9, 0xa9, 0x79, 0x17, 0x6d, 0xf1, 0x1f, 0x42, 0x0a, 0x88, 0x34, + 0x74, 0x9b, 0x00, 0x5c, 0x29, 0x2e, 0x2e, 0x5e, 0xfc, 0xdc, 0x73, 0xcf, + 0xbd, 0x91, 0x9b, 0x9b, 0xdb, 0x7b, 0xfe, 0xfc, 0xf9, 0xca, 0xf4, 0xf4, + 0x74, 0xb6, 0xa0, 0x14, 0x2c, 0x16, 0x0b, 0xce, 0x9e, 0x3d, 0x8b, 0xdd, + 0xbb, 0x77, 0xb7, 0x6c, 0xda, 0xb4, 0xa9, 0xf4, 0xea, 0xd5, 0xab, 0xef, + 0x30, 0x9e, 0x85, 0x06, 0x37, 0x6b, 0x81, 0xab, 0x37, 0x00, 0x00, 0xfb, + 0xf6, 0xed, 0x53, 0xb0, 0xf9, 0xfa, 0x00, 0x70, 0xf8, 0xf0, 0x61, 0x39, + 0x80, 0x8a, 0x4e, 0xec, 0x90, 0x1d, 0xe9, 0x53, 0x52, 0x5a, 0x5a, 0xba, + 0xf8, 0xe5, 0x97, 0x5f, 0xfe, 0xcb, 0x81, 0x03, 0x07, 0xfa, 0x3d, 0xf5, + 0xd4, 0x53, 0x9a, 0x01, 0x03, 0x06, 0x80, 0x0c, 0xf8, 0x6b, 0x6e, 0x6e, + 0xc6, 0xf9, 0xf3, 0xe7, 0xb1, 0x79, 0xf3, 0x66, 0xc3, 0xee, 0xdd, 0xbb, + 0x4b, 0x69, 0x9a, 0x7e, 0x17, 0xed, 0x97, 0x0e, 0x91, 0x17, 0x3e, 0x91, + 0x97, 0x0d, 0xb1, 0x5e, 0x86, 0xc6, 0xda, 0xda, 0xda, 0xbf, 0x9b, 0xcd, + 0x66, 0xeb, 0x3d, 0xf7, 0xdc, 0x93, 0xf5, 0xfc, 0xf3, 0xcf, 0x87, 0x8f, + 0x19, 0x33, 0x86, 0xd2, 0x68, 0x34, 0x3c, 0xc5, 0x7f, 0xe0, 0xc0, 0x01, + 0xdb, 0xea, 0xd5, 0xab, 0x6b, 0xce, 0x9c, 0x39, 0xb3, 0xc9, 0x6c, 0x36, + 0xef, 0x01, 0x3f, 0xb5, 0xd1, 0xef, 0xfe, 0xf7, 0x83, 0x1f, 0x6e, 0x32, + 0x50, 0xae, 0xd6, 0x20, 0x71, 0x63, 0x19, 0x5b, 0x93, 0x5e, 0x89, 0xb6, + 0x60, 0x35, 0x31, 0xb1, 0x1b, 0x68, 0x21, 0x5d, 0x96, 0xce, 0x16, 0x35, + 0xe3, 0x01, 0x90, 0xa2, 0x2d, 0xf8, 0x2f, 0x59, 0xa9, 0x54, 0x1e, 0x5a, + 0xb7, 0x6e, 0x9d, 0x5c, 0x2a, 0x95, 0x22, 0x27, 0x27, 0x87, 0xde, 0xb3, + 0x67, 0xcf, 0x57, 0x37, 0x6e, 0xdc, 0x78, 0x0b, 0x6d, 0xd7, 0x9e, 0x6a, + 0x01, 0x18, 0x69, 0x9a, 0xf6, 0x38, 0x48, 0xc8, 0xa1, 0x98, 0x0e, 0x1b, + 0x1d, 0x1f, 0x0a, 0x20, 0x5e, 0x22, 0x91, 0x4c, 0x49, 0x4a, 0x4a, 0x1a, + 0x2b, 0x97, 0xcb, 0xa3, 0xa4, 0x52, 0xa9, 0xcc, 0x62, 0xb1, 0x80, 0xa2, + 0x28, 0x43, 0x63, 0x63, 0xe3, 0xa5, 0x8a, 0x8a, 0x8a, 0x5c, 0x00, 0x3f, + 0x33, 0xc2, 0x89, 0x2d, 0xbb, 0x6a, 0x72, 0x35, 0x16, 0x87, 0xf1, 0xb0, + 0x85, 0x7b, 0x6e, 0x63, 0x1e, 0x76, 0x57, 0xd7, 0x0a, 0x60, 0x17, 0xda, + 0x72, 0xaf, 0xf5, 0xce, 0xc6, 0xc3, 0xd0, 0x98, 0xad, 0x89, 0x10, 0x0a, + 0x60, 0x2e, 0xda, 0xb2, 0x01, 0xd8, 0x7b, 0xdb, 0x45, 0x1e, 0x08, 0x7e, + 0xd6, 0xf3, 0x71, 0x16, 0xc0, 0x51, 0xb4, 0x17, 0x90, 0xb1, 0xd0, 0x34, + 0x6d, 0x27, 0xf0, 0x25, 0x03, 0x30, 0x83, 0xd1, 0x96, 0x72, 0x78, 0x47, + 0x78, 0x78, 0xf8, 0x88, 0xf0, 0xf0, 0xf0, 0xc1, 0x14, 0x45, 0xa9, 0x02, + 0x03, 0x03, 0xc5, 0x46, 0xa3, 0x11, 0x76, 0xbb, 0xbd, 0xc5, 0x60, 0x30, + 0x5c, 0x2e, 0x2b, 0x2b, 0x3b, 0xcc, 0xb8, 0xb6, 0x6f, 0x30, 0xf4, 0xe1, + 0x15, 0x67, 0xf2, 0x44, 0x88, 0x53, 0x14, 0x45, 0xce, 0x49, 0x12, 0x80, + 0x3b, 0x19, 0x3c, 0x68, 0x86, 0xd6, 0x7b, 0x18, 0x63, 0x52, 0xc7, 0xd0, + 0xc9, 0xea, 0x84, 0xde, 0x6c, 0xe5, 0x42, 0x15, 0xda, 0x2e, 0x9d, 0x09, + 0x03, 0x30, 0x32, 0x26, 0x26, 0x66, 0x72, 0x48, 0x48, 0x48, 0x9a, 0x44, + 0x22, 0x09, 0x0a, 0x0a, 0x0a, 0xa2, 0x99, 0x7c, 0xf3, 0xe6, 0xa6, 0xa6, + 0xa6, 0xb3, 0xd5, 0xd5, 0xd5, 0xfb, 0x19, 0x23, 0xb5, 0x16, 0xed, 0x47, + 0x0c, 0x1d, 0xe6, 0x97, 0x68, 0x9f, 0xad, 0x4e, 0x19, 0x0a, 0x20, 0x46, + 0x24, 0x12, 0x4d, 0x4c, 0x4e, 0x4e, 0x9e, 0x2c, 0x93, 0xc9, 0xe2, 0xd5, + 0x6a, 0xb5, 0xc4, 0x64, 0x32, 0x51, 0x46, 0xa3, 0xd1, 0x62, 0x32, 0x99, + 0x4a, 0x4a, 0x4a, 0x4a, 0x7e, 0xb5, 0x5a, 0xad, 0x39, 0x00, 0xca, 0x19, + 0xe5, 0xcf, 0xc6, 0xae, 0x08, 0xd2, 0x86, 0x98, 0x6b, 0x16, 0xff, 0xb9, + 0x68, 0xbf, 0x5f, 0xc1, 0x02, 0xe0, 0x1a, 0x80, 0x83, 0x04, 0x9e, 0x66, + 0x76, 0xfe, 0x3c, 0xe4, 0x7f, 0x89, 0x43, 0xfb, 0x11, 0x00, 0x6e, 0x8f, + 0x8b, 0x8b, 0x9b, 0xa2, 0x56, 0xab, 0x53, 0x24, 0x12, 0x89, 0x52, 0xad, + 0x56, 0xd3, 0x7a, 0xbd, 0x9e, 0xb2, 0x58, 0x2c, 0xc6, 0xd6, 0xd6, 0xd6, + 0xc2, 0xe2, 0xe2, 0xe2, 0x83, 0x68, 0xaf, 0x03, 0xd1, 0x08, 0x87, 0xf8, + 0x1b, 0xa2, 0x54, 0xb5, 0xd0, 0x95, 0xcf, 0x61, 0x00, 0x06, 0x47, 0x45, + 0x45, 0xdd, 0x1d, 0x16, 0x16, 0x36, 0x38, 0x3c, 0x3c, 0x5c, 0xae, 0x54, + 0x2a, 0xa9, 0xa6, 0xa6, 0x26, 0x5a, 0xab, 0xd5, 0xea, 0xab, 0xaa, 0xaa, + 0xf2, 0x1a, 0x1b, 0x1b, 0xf7, 0xa0, 0x2d, 0xab, 0xa1, 0xbe, 0x0b, 0xde, + 0x3d, 0x3f, 0xf8, 0xc1, 0x0f, 0x37, 0xc1, 0x00, 0x70, 0x74, 0xdb, 0x4b, + 0xd0, 0x1e, 0xf0, 0xc7, 0x06, 0x1e, 0x59, 0x89, 0xdd, 0x02, 0xed, 0xc6, + 0x00, 0x20, 0x15, 0xc1, 0x9d, 0x68, 0x4b, 0x3d, 0x93, 0x30, 0x0a, 0x85, + 0x2d, 0x7d, 0xca, 0x55, 0x3f, 0xf3, 0x54, 0xf8, 0x39, 0x31, 0x02, 0x58, + 0xa3, 0x25, 0x88, 0x11, 0x88, 0x2a, 0xa6, 0x6f, 0xb6, 0xfa, 0x9d, 0x19, + 0xed, 0x05, 0x64, 0xf4, 0x68, 0xaf, 0x24, 0x67, 0x61, 0xfa, 0xf6, 0xa4, + 0xa2, 0x21, 0x59, 0x81, 0x2d, 0x10, 0xed, 0xd7, 0xf8, 0xb2, 0x8a, 0x8d, + 0xbc, 0x32, 0x58, 0x70, 0x3c, 0x0e, 0x46, 0x56, 0x00, 0x63, 0x08, 0x04, + 0x12, 0xb8, 0xba, 0x0a, 0xae, 0x24, 0xbd, 0x07, 0x6c, 0x26, 0x40, 0x33, + 0xb1, 0x93, 0xb6, 0x39, 0x08, 0x70, 0x52, 0x88, 0xb3, 0x7d, 0xa9, 0x18, + 0x1a, 0xb1, 0x75, 0xf8, 0x45, 0x02, 0xf4, 0x31, 0x10, 0xf4, 0x31, 0xc3, + 0xb3, 0xda, 0x0c, 0x8e, 0x63, 0x94, 0x12, 0x73, 0x12, 0x48, 0x18, 0x4a, + 0x66, 0xc2, 0x88, 0x34, 0x91, 0x46, 0x8b, 0x93, 0xb9, 0x25, 0xf1, 0x57, + 0x11, 0xf3, 0x1b, 0x48, 0x18, 0x4c, 0xe4, 0x71, 0x10, 0x3b, 0xbf, 0xcd, + 0x04, 0xfe, 0x76, 0xc7, 0x3e, 0x1c, 0x78, 0x9d, 0x9d, 0x8b, 0x20, 0xa2, + 0x7d, 0xb6, 0x3e, 0x3e, 0xeb, 0x0a, 0x37, 0x12, 0x6d, 0xeb, 0x09, 0x23, + 0xd8, 0x29, 0x6d, 0x04, 0x0c, 0xea, 0x40, 0xc2, 0xa0, 0x66, 0x8f, 0x68, + 0x48, 0x3c, 0x6d, 0x5e, 0xd0, 0x98, 0xc4, 0xdf, 0x13, 0xfa, 0x58, 0x9c, + 0xf0, 0xbf, 0xc9, 0xd9, 0x18, 0x08, 0x23, 0x52, 0x4a, 0x18, 0x4a, 0x2c, + 0x8d, 0x94, 0x00, 0xc2, 0x99, 0xbf, 0x1b, 0x08, 0x63, 0x5a, 0x47, 0xb4, + 0xef, 0x69, 0x5d, 0x03, 0x3f, 0xf8, 0xc1, 0x0f, 0x37, 0xdb, 0x00, 0x70, + 0x10, 0x2c, 0x8e, 0x0f, 0x59, 0xcb, 0xdb, 0x6d, 0x19, 0x60, 0x07, 0x85, + 0xc9, 0x56, 0x15, 0x64, 0x85, 0x1f, 0xeb, 0xbe, 0x6c, 0xe9, 0xaa, 0x90, + 0x70, 0x10, 0x84, 0xec, 0x8e, 0x91, 0xac, 0x00, 0xc8, 0xee, 0xa8, 0x59, + 0xc3, 0xc5, 0xc4, 0x08, 0x5b, 0x56, 0x78, 0xdb, 0xbd, 0x54, 0x6c, 0x22, + 0x07, 0x03, 0x49, 0x44, 0xb8, 0xbd, 0xd9, 0x8a, 0x82, 0x36, 0x67, 0xed, + 0x0a, 0xe0, 0xeb, 0x68, 0x68, 0xb9, 0xcb, 0xac, 0x60, 0xbd, 0x00, 0x64, + 0x7f, 0x56, 0x21, 0x25, 0xe7, 0x30, 0x0f, 0x12, 0x42, 0x29, 0xcb, 0xd0, + 0x1e, 0xb5, 0x4f, 0x39, 0x78, 0x16, 0xcc, 0x8e, 0xf4, 0x81, 0x97, 0x77, + 0x3f, 0x10, 0x7d, 0x0a, 0xd1, 0xc9, 0xee, 0x09, 0x9d, 0x9c, 0xe0, 0x2f, + 0x73, 0x98, 0x5f, 0x12, 0x7f, 0x0b, 0x31, 0xbf, 0x26, 0xa2, 0x0f, 0xbb, + 0x1b, 0x23, 0xd5, 0xb1, 0x7d, 0x39, 0xf3, 0x90, 0x05, 0x90, 0x58, 0x5a, + 0x9b, 0x09, 0xfe, 0xf1, 0xd4, 0x08, 0x76, 0x34, 0xa8, 0xc5, 0x84, 0x52, + 0xb6, 0xc2, 0xa1, 0x0a, 0xa5, 0xb7, 0x6b, 0x80, 0xe0, 0x49, 0x4f, 0xe6, + 0xd7, 0x91, 0x3e, 0x9e, 0x8e, 0x41, 0x44, 0x18, 0x1a, 0x72, 0x87, 0xf5, + 0x45, 0x11, 0x73, 0x6a, 0x76, 0x68, 0xdf, 0x06, 0xbf, 0xf2, 0xf7, 0x83, + 0x1f, 0x7e, 0x3b, 0x06, 0x80, 0x4f, 0x3b, 0xe3, 0x2b, 0x4c, 0x67, 0xde, + 0x04, 0x9f, 0x08, 0x09, 0x87, 0x0b, 0x70, 0x44, 0xe8, 0x78, 0xc5, 0x29, + 0x99, 0x03, 0x6e, 0xef, 0x82, 0x62, 0x03, 0xa1, 0x34, 0x28, 0x07, 0xc5, + 0xcc, 0x3d, 0x1e, 0x28, 0x35, 0xa1, 0x5b, 0xfa, 0x3c, 0xbd, 0x2e, 0xd5, + 0xd1, 0x18, 0xa3, 0x5d, 0x19, 0x64, 0x0e, 0xfd, 0x89, 0xd1, 0xb1, 0xd2, + 0x1d, 0xed, 0x60, 0x58, 0x74, 0x8a, 0x3e, 0x1e, 0x18, 0x92, 0x5e, 0xd1, + 0xc9, 0x89, 0xa2, 0x16, 0x11, 0x63, 0xa0, 0x7c, 0x81, 0xbf, 0xc0, 0x1d, + 0x18, 0x24, 0x7d, 0x1c, 0x79, 0xc7, 0xd6, 0xc9, 0xb6, 0x9d, 0x19, 0xd4, + 0x6e, 0xe7, 0xaf, 0x13, 0xf8, 0x93, 0xff, 0xc2, 0x87, 0x63, 0x10, 0x09, + 0xd0, 0x88, 0x22, 0xc6, 0x61, 0x23, 0x1e, 0xba, 0x2b, 0xfc, 0xe3, 0x07, + 0x3f, 0xf8, 0xe1, 0xb7, 0x6f, 0x00, 0x38, 0x2a, 0x4c, 0x08, 0x78, 0x13, + 0x7c, 0x2a, 0x24, 0x1c, 0xfa, 0x04, 0x84, 0x6f, 0x33, 0xc4, 0x7f, 0xab, + 0x60, 0x12, 0xb8, 0xed, 0x11, 0xbf, 0x15, 0xfa, 0xb8, 0x98, 0x5b, 0x9f, + 0xe0, 0xef, 0x82, 0x36, 0xa4, 0xe1, 0x72, 0xcb, 0xf2, 0xce, 0x2d, 0x40, + 0x1f, 0xf8, 0x95, 0xbe, 0x1f, 0xfc, 0x70, 0xeb, 0xc2, 0xff, 0x07, 0xa7, + 0xfe, 0x1e, 0x9a, 0x36, 0x55, 0xcc, 0xcc, 0x00, 0x00, 0x00, 0x00, 0x49, + 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82 +}; + +unsigned int cc_fps_images_len(void) +{ + return sizeof(cc_fps_images_png); +} + +unsigned int cc_fps_images_hd_len(void) +{ + return sizeof(cc_fps_images_hd_png); +} + +unsigned int cc_fps_images_ipadhd_len(void) +{ + return sizeof(cc_fps_images_ipadhd_png); +} diff --git a/cocos2d/ccGLStateCache.h b/cocos2d/ccGLStateCache.h new file mode 100644 index 0000000..a299e45 --- /dev/null +++ b/cocos2d/ccGLStateCache.h @@ -0,0 +1,156 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2011 Ricardo Quesada + * Copyright (c) 2011 Zynga Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#import +#import "ccMacros.h" +#import "Platforms/CCGL.h" + +@class CCGLProgram; + +/** vertex attrib flags */ +enum { + kCCVertexAttribFlag_None = 0, + + kCCVertexAttribFlag_Position = 1 << 0, + kCCVertexAttribFlag_Color = 1 << 1, + kCCVertexAttribFlag_TexCoords = 1 << 2, + + kCCVertexAttribFlag_PosColorTex = ( kCCVertexAttribFlag_Position | kCCVertexAttribFlag_Color | kCCVertexAttribFlag_TexCoords ), +}; + +/** GL server side states */ +typedef enum { +// CC_GL_SCISSOR_TEST = 1 << 0, +// CC_GL_STENCIL_TEST = 1 << 1, +// CC_GL_DEPTH_TEST = 1 << 2, +// CC_GL_BLEND = 1 << 3, +// CC_GL_DITHER = 1 << 4, + +// CC_GL_ALL = ( CC_GL_SCISSOR_TEST | CC_GL_STENCIL_TEST | CC_GL_DEPTH_TEST | CC_GL_BLEND | CC_GL_DITHER ), +// CC_GL_ALL = ( CC_GL_BLEND ), + CC_GL_ALL = 0, + +} ccGLServerState; + +#ifdef __cplusplus +extern "C" { +#endif + +/** @file ccGLStateCache.h + */ + +/** Invalidates the GL state cache. + If CC_ENABLE_GL_STATE_CACHE it will reset the GL state cache. + @since v2.0.0 + */ +void ccGLInvalidateStateCache( void ); + +/** Uses the GL program in case program is different than the current one. + If CC_ENABLE_GL_STATE_CACHE is disabled, it will the glUseProgram() directly. + @since v2.0.0 + */ +void ccGLUseProgram( GLuint program ); + +/** Deletes the GL program. If it is the one that is being used, it invalidates it. + If CC_ENABLE_GL_STATE_CACHE is disabled, it will the glDeleteProgram() directly. + @since v2.0.0 + */ +void ccGLDeleteProgram( GLuint program ); + +/** Uses a blending function in case it not already used. + If CC_ENABLE_GL_STATE_CACHE is disabled, it will the glBlendFunc() directly. + @since v2.0.0 + */ +void ccGLBlendFunc(GLenum sfactor, GLenum dfactor); + +/** Resets the blending mode back to the cached state in case you used glBlendFuncSeparate() or glBlendEquation(). + If CC_ENABLE_GL_STATE_CACHE is disabled, it will just set the default blending mode using GL_FUNC_ADD. + @since v2.0.0 + */ +void ccGLBlendResetToCache(void); + +/** sets the projection matrix as dirty + @since v2.0.0 + */ +void ccSetProjectionMatrixDirty( void ); + +/** Will enable the vertex attribs that are passed as flags. + Possible flags: + + * kCCVertexAttribFlag_Position + * kCCVertexAttribFlag_Color + * kCCVertexAttribFlag_TexCoords + + These flags can be ORed. The flags that are not present, will be disabled. + + @since v2.0.0 + */ +void ccGLEnableVertexAttribs( unsigned int flags ); + +/** If the texture is not already bound to texture unit 0 and if target is GL_TEXTURE_2D, it binds it. + If CC_ENABLE_GL_STATE_CACHE is disabled or if target != GL_TEXTURE_2D it will call glBindTexture() directly. + @since v2.1 + */ +void ccGLBindTexture( GLenum target, GLuint textureId ); + +/** If the texture is not already bound to texture unit 0, it binds it. + If CC_ENABLE_GL_STATE_CACHE is disabled, it will call glBindTexture() directly. + @since v2.0.0 + */ +void ccGLBindTexture2D( GLuint textureId ); + +/** If the texture is not already bound to a given unit, it binds it. + If CC_ENABLE_GL_STATE_CACHE is disabled, it will call glBindTexture() directly. + @since v2.1.0 + */ +void ccGLBindTexture2DN( GLuint textureUnit, GLuint textureId ); + +/** It will delete a given texture. If the texture was bound, it will invalidate the cached for texture unit 0. + If CC_ENABLE_GL_STATE_CACHE is disabled, it will call glDeleteTextures() directly. + @since v2.0.0 + */ +void ccGLDeleteTexture(GLuint textureId); + +/** It will delete a given texture. If the texture was bound, it will invalidate the cached for the given texture unit. + If CC_ENABLE_GL_STATE_CACHE is disabled, it will call glDeleteTextures() directly. + @since v2.1.0 + */ +void ccGLDeleteTextureN( GLuint textureUnit, GLuint textureId ); + +/** If the vertex array is not already bound, it binds it. + If CC_ENABLE_GL_STATE_CACHE is disabled, it will call glBindVertexArray() directly. + @since v2.0.0 + */ +void ccGLBindVAO(GLuint vaoId); + +/** It will enable / disable the server side GL states. + If CC_ENABLE_GL_STATE_CACHE is disabled, it will call glEnable() directly. + @since v2.0.0 + */ +void ccGLEnable( ccGLServerState flags ); + +#ifdef __cplusplus +} +#endif diff --git a/src/cocos2d/ccGLStateCache.m b/cocos2d/ccGLStateCache.m similarity index 70% rename from src/cocos2d/ccGLStateCache.m rename to cocos2d/ccGLStateCache.m index 0918db0..ace098b 100644 --- a/src/cocos2d/ccGLStateCache.m +++ b/cocos2d/ccGLStateCache.m @@ -29,8 +29,11 @@ #import "ccConfig.h" // extern +#pragma clang diagnostic push COCOS2D +#pragma clang diagnostic ignored "-Wignored-qualifiers" #import "kazmath/GL/matrix.h" #import "kazmath/kazmath.h" +#pragma clang diagnostic pop COCOS2D static GLuint _ccCurrentProjectionMatrix = -1; static BOOL _vertexAttribPosition = NO; @@ -41,10 +44,10 @@ #define kCCMaxActiveTexture 16 static GLuint _ccCurrentShaderProgram = -1; static GLuint _ccCurrentBoundTexture[kCCMaxActiveTexture] = {-1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, }; -static GLenum _ccCurrentActiveTexture = (GL_TEXTURE0 - GL_TEXTURE0); static GLenum _ccBlendingSource = -1; static GLenum _ccBlendingDest = -1; static ccGLServerState _ccGLServerState = 0; +static GLuint _ccVAO = 0; #endif // CC_ENABLE_GL_STATE_CACHE #pragma mark - GL State Cache functions @@ -52,17 +55,16 @@ void ccGLInvalidateStateCache( void ) { kmGLFreeAll(); - + _ccCurrentProjectionMatrix = -1; _vertexAttribPosition = NO; _vertexAttribColor = NO; _vertexAttribTexCoords = NO; - + #if CC_ENABLE_GL_STATE_CACHE _ccCurrentShaderProgram = -1; for( NSInteger i=0; i < kCCMaxActiveTexture; i++ ) _ccCurrentBoundTexture[i] = -1; - _ccCurrentActiveTexture = (GL_TEXTURE0 - GL_TEXTURE0); _ccBlendingSource = -1; _ccBlendingDest = -1; _ccGLServerState = 0; @@ -75,7 +77,7 @@ void ccGLDeleteProgram( GLuint program ) if( program == _ccCurrentShaderProgram ) _ccCurrentShaderProgram = -1; #endif // CC_ENABLE_GL_STATE_CACHE - + glDeleteProgram( program ); } @@ -91,6 +93,15 @@ void ccGLUseProgram( GLuint program ) #endif // CC_ENABLE_GL_STATE_CACHE } +static void SetBlending(GLenum sfactor, GLenum dfactor) +{ + if(sfactor == GL_ONE && dfactor == GL_ZERO){ + glDisable(GL_BLEND); + } else { + glEnable(GL_BLEND); + glBlendFunc( sfactor, dfactor ); + } +} void ccGLBlendFunc(GLenum sfactor, GLenum dfactor) { @@ -98,83 +109,103 @@ void ccGLBlendFunc(GLenum sfactor, GLenum dfactor) if( sfactor != _ccBlendingSource || dfactor != _ccBlendingDest ) { _ccBlendingSource = sfactor; _ccBlendingDest = dfactor; - glBlendFunc( sfactor, dfactor ); + SetBlending( sfactor, dfactor ); } #else - glBlendFunc( sfactor, dfactor ); + SetBlending( sfactor, dfactor ); #endif // CC_ENABLE_GL_STATE_CACHE } -GLenum ccGLGetActiveTexture( void ) +void ccGLBlendResetToCache(void) { + glBlendEquation(GL_FUNC_ADD); #if CC_ENABLE_GL_STATE_CACHE - return _ccCurrentActiveTexture + GL_TEXTURE0; + SetBlending( _ccBlendingSource, _ccBlendingDest ); #else - GLenum activeTexture; - glGetIntegerv(GL_ACTIVE_TEXTURE, (GLint*)&activeTexture); - return activeTexture; -#endif + SetBlending( CC_BLEND_SRC, CC_BLEND_DST ); +#endif // CC_ENABLE_GL_STATE_CACHE } -void ccGLActiveTexture( GLenum textureEnum ) +void ccGLBindTexture( GLenum target, GLuint textureId ) { -#if CC_ENABLE_GL_STATE_CACHE - NSCAssert1( (textureEnum - GL_TEXTURE0) < kCCMaxActiveTexture, @"cocos2d ERROR: Increase kCCMaxActiveTexture to %d!", (textureEnum-GL_TEXTURE0) ); - if( (textureEnum - GL_TEXTURE0) != _ccCurrentActiveTexture ) { - _ccCurrentActiveTexture = (textureEnum - GL_TEXTURE0); - glActiveTexture( textureEnum ); - } -#else - glActiveTexture( textureEnum ); -#endif + if( target == GL_TEXTURE_2D ) + ccGLBindTexture2DN(0, textureId); + else + glBindTexture(target, textureId); } - void ccGLBindTexture2D( GLuint textureId ) +{ + ccGLBindTexture2DN(0, textureId); +} + +void ccGLBindTexture2DN( GLuint textureUnit, GLuint textureId ) { #if CC_ENABLE_GL_STATE_CACHE - if( _ccCurrentBoundTexture[ _ccCurrentActiveTexture ] != textureId ) + NSCAssert1( textureUnit < kCCMaxActiveTexture, @"cocos2d ERROR: Increase kCCMaxActiveTexture to %d!", textureUnit - GL_TEXTURE0); + if( _ccCurrentBoundTexture[ textureUnit ] != textureId ) { - _ccCurrentBoundTexture[ _ccCurrentActiveTexture ] = textureId; + _ccCurrentBoundTexture[ textureUnit ] = textureId; + glActiveTexture( GL_TEXTURE0 + textureUnit ); glBindTexture(GL_TEXTURE_2D, textureId ); } #else + glActiveTexture( GL_TEXTURE0 + textureUnit ); glBindTexture(GL_TEXTURE_2D, textureId ); #endif } void ccGLDeleteTexture( GLuint textureId ) +{ + ccGLDeleteTextureN( 0, textureId ); +} + +void ccGLDeleteTextureN( GLuint textureUnit, GLuint textureId ) { #if CC_ENABLE_GL_STATE_CACHE - if( textureId == _ccCurrentBoundTexture[ _ccCurrentActiveTexture ] ) - _ccCurrentBoundTexture[ _ccCurrentActiveTexture ] = -1; -#endif + if( _ccCurrentBoundTexture[ textureUnit ] == textureId ) + _ccCurrentBoundTexture[ textureUnit ] = -1; +#endif // CC_ENABLE_GL_STATE_CACHE + glDeleteTextures(1, &textureId ); } -void ccGLEnable( ccGLServerState flags ) +void ccGLBindVAO(GLuint vaoId) { #if CC_ENABLE_GL_STATE_CACHE - - BOOL enabled = NO; - - /* GL_BLEND */ - if( (enabled=(flags & CC_GL_BLEND)) != (_ccGLServerState & CC_GL_BLEND) ) { - if( enabled ) { - glEnable( GL_BLEND ); - _ccGLServerState |= CC_GL_BLEND; - } else { - glDisable( GL_BLEND ); - _ccGLServerState &= ~CC_GL_BLEND; - } + if( _ccVAO != vaoId ) + { + _ccVAO = vaoId; + glBindVertexArray(vaoId); } +#else + glBindVertexArray(vaoId); +#endif +} +void ccGLEnable( ccGLServerState flags ) +{ +#if CC_ENABLE_GL_STATE_CACHE + +// BOOL enabled = NO; +// +// /* GL_BLEND */ +// if( (enabled=(flags & CC_GL_BLEND)) != (_ccGLServerState & CC_GL_BLEND) ) { +// if( enabled ) { +// glEnable( GL_BLEND ); +// _ccGLServerState |= CC_GL_BLEND; +// } else { +// glDisable( GL_BLEND ); +// _ccGLServerState &= ~CC_GL_BLEND; +// } +// } + #else - if( flags & CC_GL_BLEND ) - glEnable( GL_BLEND ); - else - glDisable( GL_BLEND ); +// if( flags & CC_GL_BLEND ) +// glEnable( GL_BLEND ); +// else +// glDisable( GL_BLEND ); #endif } @@ -182,9 +213,11 @@ void ccGLEnable( ccGLServerState flags ) void ccGLEnableVertexAttribs( unsigned int flags ) { + ccGLBindVAO(0); + /* Position */ BOOL enablePosition = flags & kCCVertexAttribFlag_Position; - + if( enablePosition != _vertexAttribPosition ) { if( enablePosition ) glEnableVertexAttribArray( kCCVertexAttrib_Position ); @@ -196,7 +229,7 @@ void ccGLEnableVertexAttribs( unsigned int flags ) /* Color */ BOOL enableColor = flags & kCCVertexAttribFlag_Color; - + if( enableColor != _vertexAttribColor ) { if( enableColor ) glEnableVertexAttribArray( kCCVertexAttrib_Color ); @@ -208,7 +241,7 @@ void ccGLEnableVertexAttribs( unsigned int flags ) /* Tex Coords */ BOOL enableTexCoords = flags & kCCVertexAttribFlag_TexCoords; - + if( enableTexCoords != _vertexAttribTexCoords ) { if( enableTexCoords ) glEnableVertexAttribArray( kCCVertexAttrib_TexCoords ); diff --git a/cocos2d/ccMacros.h b/cocos2d/ccMacros.h new file mode 100644 index 0000000..8547cc0 --- /dev/null +++ b/cocos2d/ccMacros.h @@ -0,0 +1,337 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2008-2010 Ricardo Quesada + * Copyright (c) 2011 Zynga Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + + +#import +#import "ccConfig.h" + +#import +#import + +/** + @file + cocos2d helper macros + */ + +#ifdef __IPHONE_OS_VERSION_MAX_ALLOWED +#define __CC_PLATFORM_IOS 1 +#elif defined(__MAC_OS_X_VERSION_MAX_ALLOWED) +#define __CC_PLATFORM_MAC 1 +#endif + +/* + * if COCOS2D_DEBUG is not defined, or if it is 0 then + * all CCLOGXXX macros will be disabled + * + * if COCOS2D_DEBUG==1 then: + * CCLOG() will be enabled + * CCLOGWARN() will be enabled + * CCLOGINFO() will be disabled + * + * if COCOS2D_DEBUG==2 or higher then: + * CCLOG() will be enabled + * CCLOGWARN() will be enabled + * CCLOGINFO() will be enabled + */ + + +#define __CCLOGWITHFUNCTION(s, ...) \ +NSLog(@"%s : %@",__FUNCTION__,[NSString stringWithFormat:(s), ##__VA_ARGS__]) + +#define __CCLOG(s, ...) \ +NSLog(@"%@",[NSString stringWithFormat:(s), ##__VA_ARGS__]) + + +#if !defined(COCOS2D_DEBUG) || COCOS2D_DEBUG == 0 +#define CCLOG(...) do {} while (0) +#define CCLOGWARN(...) do {} while (0) +#define CCLOGINFO(...) do {} while (0) + +#elif COCOS2D_DEBUG == 1 +#define CCLOG(...) __CCLOG(__VA_ARGS__) +#define CCLOGWARN(...) __CCLOGWITHFUNCTION(__VA_ARGS__) +#define CCLOGINFO(...) do {} while (0) + +#elif COCOS2D_DEBUG > 1 +#define CCLOG(...) __CCLOG(__VA_ARGS__) +#define CCLOGWARN(...) __CCLOGWITHFUNCTION(__VA_ARGS__) +#define CCLOGINFO(...) __CCLOG(__VA_ARGS__) +#endif // COCOS2D_DEBUG + + +/** @def CC_SWAP +simple macro that swaps 2 variables +*/ +#define CC_SWAP( x, y ) \ +({ __typeof__(x) temp = (x); \ + x = y; y = temp; \ +}) + + +/** @def CCRANDOM_MINUS1_1 + returns a random float between -1 and 1 + */ +#define CCRANDOM_MINUS1_1() ((random() / (float)0x3fffffff )-1.0f) + +/** @def CCRANDOM_0_1 + returns a random float between 0 and 1 + */ +#define CCRANDOM_0_1() ((random() / (float)0x7fffffff )) + +/** @def CC_DEGREES_TO_RADIANS + converts degrees to radians + */ +#define CC_DEGREES_TO_RADIANS(__ANGLE__) ((__ANGLE__) * 0.01745329252f) // PI / 180 + +/** @def CC_RADIANS_TO_DEGREES + converts radians to degrees + */ +#define CC_RADIANS_TO_DEGREES(__ANGLE__) ((__ANGLE__) * 57.29577951f) // PI * 180 + +#define kCCRepeatForever (UINT_MAX -1) +/** @def CC_BLEND_SRC +default gl blend src function. Compatible with premultiplied alpha images. +*/ +#define CC_BLEND_SRC GL_ONE +#define CC_BLEND_DST GL_ONE_MINUS_SRC_ALPHA + +/** @def CC_DIRECTOR_INIT + - Initializes an CCGLView with 0-bit depth format, and RGB565 render buffer. + - The CCGLView view will have multiple touches disabled. + - It will create a UIWindow and it will assign it the 'window_' ivar. 'window_' must be declared before calling this macro. + - It will create a UINavigationController and it will assign it the 'navigationController_' ivar. 'navController_' must be declared before using this macro. + - The director_ will be the root view controller of the navController. + - It will connect the CCGLView to the Director + - It will connect the UINavController view to the UIWindow. + - It will try to run at 60 FPS. + - It will connect the director with the CCGLView. + + IMPORTANT: If you want to use another type of render buffer (eg: RGBA8) + or if you want to use a 16-bit or 24-bit depth buffer, you should NOT + use this macro. Instead, you should create the CCGLView manually. + + @since v0.99.4 + */ + +#ifdef __CC_PLATFORM_IOS + +#define CC_DIRECTOR_INIT() \ +do { \ + window_ = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; \ + director_ = (CCDirectorIOS*)[CCDirector sharedDirector]; \ + [director_ setDisplayStats:NO]; \ + [director_ setAnimationInterval:1.0/60]; \ + CCGLView *__glView = [CCGLView viewWithFrame:[window_ bounds] \ + pixelFormat:kEAGLColorFormatRGB565 \ + depthFormat:0 /* GL_DEPTH_COMPONENT24_OES */ \ + preserveBackbuffer:NO \ + sharegroup:nil \ + multiSampling:NO \ + numberOfSamples:0 \ + ]; \ + [director_ setView:__glView]; \ + [director_ setDelegate:self]; \ + director_.wantsFullScreenLayout = YES; \ + if( ! [director_ enableRetinaDisplay:YES] ) \ + CCLOG(@"Retina Display Not supported"); \ + navController_ = [[UINavigationController alloc] initWithRootViewController:director_]; \ + navController_.navigationBarHidden = YES; \ + [window_ addSubview:navController_.view]; \ + [window_ makeKeyAndVisible]; \ +} while(0) + + +#elif __CC_PLATFORM_MAC + +#define CC_DIRECTOR_INIT(__WINSIZE__) \ +do { \ + NSRect frameRect = NSMakeRect(0, 0, (__WINSIZE__).width, (__WINSIZE__).height); \ + window_ = [[CCWindow alloc] initWithFrame:frameRect fullscreen:NO]; \ + glView_ = [[CCGLView alloc] initWithFrame:frameRect shareContext:nil]; \ + [self.window setContentView:self.glView]; \ + director_ = (CCDirectorMac*) [CCDirector sharedDirector]; \ + [director_ setDisplayStats:NO]; \ + [director_ setView:self.glView]; \ + [director_ setOriginalWinSize:__WINSIZE__]; \ + [self.window makeMainWindow]; \ + [self.window makeKeyAndOrderFront:self]; \ + [self.window center]; \ +} while(0) + +#endif + +/** @def CC_NODE_DRAW_SETUP + Helpful macro that setups the GL server state, the correct GL program and sets the Model View Projection matrix + @since v2.0 + */ +#define CC_NODE_DRAW_SETUP() \ +do { \ + ccGLEnable( _glServerState ); \ + NSAssert1(_shaderProgram, @"No shader program set for node: %@", self); \ + [_shaderProgram use]; \ + [_shaderProgram setUniformsForBuiltins]; \ +} while(0) + + + /** @def CC_DIRECTOR_END + Stops and removes the director from memory. + Removes the CCGLView from its parent + + @since v0.99.4 + */ +#define CC_DIRECTOR_END() \ +do { \ + CCDirector *__director = [CCDirector sharedDirector]; \ + [__director end]; \ +} while(0) + + + + +#if defined (__CC_PLATFORM_IOS) + +/****************************/ +/** RETINA DISPLAY ENABLED **/ +/****************************/ + +/** @def CC_CONTENT_SCALE_FACTOR + On Mac it returns 1; + On iPhone it returns 2 if RetinaDisplay is On. Otherwise it returns 1 + */ +extern float __ccContentScaleFactor; +#define CC_CONTENT_SCALE_FACTOR() __ccContentScaleFactor + + +/** @def CC_RECT_PIXELS_TO_POINTS + Converts a rect in pixels to points + */ +#define CC_RECT_PIXELS_TO_POINTS(__rect_in_pixels__) \ + CGRectMake( (__rect_in_pixels__).origin.x / CC_CONTENT_SCALE_FACTOR(), (__rect_in_pixels__).origin.y / CC_CONTENT_SCALE_FACTOR(), \ + (__rect_in_pixels__).size.width / CC_CONTENT_SCALE_FACTOR(), (__rect_in_pixels__).size.height / CC_CONTENT_SCALE_FACTOR() ) + +/** @def CC_RECT_POINTS_TO_PIXELS + Converts a rect in points to pixels + */ +#define CC_RECT_POINTS_TO_PIXELS(__rect_in_points_points__) \ + CGRectMake( (__rect_in_points_points__).origin.x * CC_CONTENT_SCALE_FACTOR(), (__rect_in_points_points__).origin.y * CC_CONTENT_SCALE_FACTOR(), \ + (__rect_in_points_points__).size.width * CC_CONTENT_SCALE_FACTOR(), (__rect_in_points_points__).size.height * CC_CONTENT_SCALE_FACTOR() ) + +/** @def CC_POINT_PIXELS_TO_POINTS + Converts a rect in pixels to points + */ +#define CC_POINT_PIXELS_TO_POINTS(__pixels__) \ +CGPointMake( (__pixels__).x / CC_CONTENT_SCALE_FACTOR(), (__pixels__).y / CC_CONTENT_SCALE_FACTOR()) + +/** @def CC_POINT_POINTS_TO_PIXELS + Converts a rect in points to pixels + */ +#define CC_POINT_POINTS_TO_PIXELS(__points__) \ +CGPointMake( (__points__).x * CC_CONTENT_SCALE_FACTOR(), (__points__).y * CC_CONTENT_SCALE_FACTOR()) + +/** @def CC_POINT_PIXELS_TO_POINTS + Converts a rect in pixels to points + */ +#define CC_SIZE_PIXELS_TO_POINTS(__size_in_pixels__) \ +CGSizeMake( (__size_in_pixels__).width / CC_CONTENT_SCALE_FACTOR(), (__size_in_pixels__).height / CC_CONTENT_SCALE_FACTOR()) + +/** @def CC_POINT_POINTS_TO_PIXELS + Converts a rect in points to pixels + */ +#define CC_SIZE_POINTS_TO_PIXELS(__size_in_points__) \ +CGSizeMake( (__size_in_points__).width * CC_CONTENT_SCALE_FACTOR(), (__size_in_points__).height * CC_CONTENT_SCALE_FACTOR()) + + +#elif defined(__CC_PLATFORM_MAC) + +/*****************************/ +/** RETINA DISPLAY DISABLED **/ +/*****************************/ + +#define CC_CONTENT_SCALE_FACTOR() 1 +#define CC_RECT_PIXELS_TO_POINTS(__pixels__) __pixels__ +#define CC_RECT_POINTS_TO_PIXELS(__points__) __points__ +#define CC_SIZE_PIXELS_TO_POINTS(__pixels__) __pixels__ +#define CC_SIZE_POINTS_TO_PIXELS(__points__) __points__ +#define CC_POINT_PIXELS_TO_POINTS(__pixels__) __pixels__ +#define CC_POINT_POINTS_TO_PIXELS(__points__) __points__ + + +#endif // __CC_PLATFORM_MAC + + +/**********************/ +/** Profiling Macros **/ +/**********************/ +#if CC_ENABLE_PROFILERS + +#define CC_PROFILER_DISPLAY_TIMERS() [[CCProfiler sharedProfiler] displayTimers] +#define CC_PROFILER_PURGE_ALL() [[CCProfiler sharedProfiler] releaseAllTimers] + +#define CC_PROFILER_START(__name__) CCProfilingBeginTimingBlock(__name__) +#define CC_PROFILER_STOP(__name__) CCProfilingEndTimingBlock(__name__) +#define CC_PROFILER_RESET(__name__) CCProfilingResetTimingBlock(__name__) + +#define CC_PROFILER_START_CATEGORY(__cat__, __name__) do{ if(__cat__) CCProfilingBeginTimingBlock(__name__); } while(0) +#define CC_PROFILER_STOP_CATEGORY(__cat__, __name__) do{ if(__cat__) CCProfilingEndTimingBlock(__name__); } while(0) +#define CC_PROFILER_RESET_CATEGORY(__cat__, __name__) do{ if(__cat__) CCProfilingResetTimingBlock(__name__); } while(0) + +#define CC_PROFILER_START_INSTANCE(__id__, __name__) do{ CCProfilingBeginTimingBlock( [NSString stringWithFormat:@"%08X - %@", __id__, __name__] ); } while(0) +#define CC_PROFILER_STOP_INSTANCE(__id__, __name__) do{ CCProfilingEndTimingBlock( [NSString stringWithFormat:@"%08X - %@", __id__, __name__] ); } while(0) +#define CC_PROFILER_RESET_INSTANCE(__id__, __name__) do{ CCProfilingResetTimingBlock( [NSString stringWithFormat:@"%08X - %@", __id__, __name__] ); } while(0) + + +#else + +#define CC_PROFILER_DISPLAY_TIMERS() do {} while (0) +#define CC_PROFILER_PURGE_ALL() do {} while (0) + +#define CC_PROFILER_START(__name__) do {} while (0) +#define CC_PROFILER_STOP(__name__) do {} while (0) +#define CC_PROFILER_RESET(__name__) do {} while (0) + +#define CC_PROFILER_START_CATEGORY(__cat__, __name__) do {} while(0) +#define CC_PROFILER_STOP_CATEGORY(__cat__, __name__) do {} while(0) +#define CC_PROFILER_RESET_CATEGORY(__cat__, __name__) do {} while(0) + +#define CC_PROFILER_START_INSTANCE(__id__, __name__) do {} while(0) +#define CC_PROFILER_STOP_INSTANCE(__id__, __name__) do {} while(0) +#define CC_PROFILER_RESET_INSTANCE(__id__, __name__) do {} while(0) + +#endif + +/** @def CC_INCREMENT_GL_DRAWS + Increments the GL Draws counts by one. + The number of calls per frame are displayed on the screen when the CCDirector's stats are enabled. + */ +extern NSUInteger __ccNumberOfDraws; +#define CC_INCREMENT_GL_DRAWS(__n__) __ccNumberOfDraws += __n__ + +/*******************/ +/** Notifications **/ +/*******************/ +/** @def CCAnimationFrameDisplayedNotification + Notification name when a CCSpriteFrame is displayed + */ +#define CCAnimationFrameDisplayedNotification @"CCAnimationFrameDisplayedNotification" diff --git a/cocos2d/ccShader_PositionColorLengthTexture_frag.h b/cocos2d/ccShader_PositionColorLengthTexture_frag.h new file mode 100644 index 0000000..80470e2 --- /dev/null +++ b/cocos2d/ccShader_PositionColorLengthTexture_frag.h @@ -0,0 +1,41 @@ +/* Copyright (c) 2012 Scott Lembcke and Howling Moon Software + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +" \n\ +#extension GL_OES_standard_derivatives : enable \n\ + \n\ +#ifdef GL_ES \n\ +varying mediump vec4 v_color; \n\ +varying mediump vec2 v_texcoord; \n\ +#else \n\ +varying vec4 v_color; \n\ +varying vec2 v_texcoord; \n\ +#endif \n\ + \n\ +void main() \n\ +{ \n\ +#if defined GL_OES_standard_derivatives \n\ + gl_FragColor = v_color*smoothstep(0.0, length(fwidth(v_texcoord)), 1.0 - length(v_texcoord)); \n\ +#else \n\ + gl_FragColor = v_color*step(0.0, 1.0 - length(v_texcoord)); \n\ +#endif \n\ +} \n\ +"; diff --git a/cocos2d/ccShader_PositionColorLengthTexture_vert.h b/cocos2d/ccShader_PositionColorLengthTexture_vert.h new file mode 100644 index 0000000..3a8e96d --- /dev/null +++ b/cocos2d/ccShader_PositionColorLengthTexture_vert.h @@ -0,0 +1,47 @@ +/* Copyright (c) 2012 Scott Lembcke and Howling Moon Software + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +" \n\ +#ifdef GL_ES \n\ +attribute mediump vec4 a_position; \n\ +attribute mediump vec2 a_texcoord; \n\ +attribute mediump vec4 a_color; \n\ + \n\ +varying mediump vec4 v_color; \n\ +varying mediump vec2 v_texcoord; \n\ + \n\ +#else \n\ +attribute vec4 a_position; \n\ +attribute vec2 a_texcoord; \n\ +attribute vec4 a_color; \n\ + \n\ +varying vec4 v_color; \n\ +varying vec2 v_texcoord; \n\ +#endif \n\ + \n\ +void main() \n\ +{ \n\ + v_color = vec4(a_color.rgb * a_color.a, a_color.a); \n\ + v_texcoord = a_texcoord; \n\ + \n\ + gl_Position = CC_MVPMatrix * a_position; \n\ +} \n\ +"; diff --git a/cocos2d/ccShader_PositionColor_frag.h b/cocos2d/ccShader_PositionColor_frag.h new file mode 100644 index 0000000..910903d --- /dev/null +++ b/cocos2d/ccShader_PositionColor_frag.h @@ -0,0 +1,37 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2011 Ricardo Quesada + * Copyright (c) 2012 Zynga Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +" \n\ +#ifdef GL_ES \n\ +precision lowp float; \n\ +#endif \n\ + \n\ +varying vec4 v_fragmentColor; \n\ + \n\ +void main() \n\ +{ \n\ + gl_FragColor = v_fragmentColor; \n\ +} \n\ +"; diff --git a/cocos2d/ccShader_PositionColor_vert.h b/cocos2d/ccShader_PositionColor_vert.h new file mode 100644 index 0000000..633f338 --- /dev/null +++ b/cocos2d/ccShader_PositionColor_vert.h @@ -0,0 +1,40 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2011 Ricardo Quesada + * Copyright (c) 2012 Zynga Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +" \n\ +attribute vec4 a_position; \n\ +attribute vec4 a_color; \n\ +#ifdef GL_ES \n\ +varying lowp vec4 v_fragmentColor; \n\ +#else \n\ +varying vec4 v_fragmentColor; \n\ +#endif \n\ + \n\ +void main() \n\ +{ \n\ + gl_Position = CC_MVPMatrix * a_position; \n\ + v_fragmentColor = a_color; \n\ +} \n\ +"; diff --git a/cocos2d/ccShader_PositionTextureA8Color_frag.h b/cocos2d/ccShader_PositionTextureA8Color_frag.h new file mode 100644 index 0000000..6a8fb85 --- /dev/null +++ b/cocos2d/ccShader_PositionTextureA8Color_frag.h @@ -0,0 +1,41 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2011 Ricardo Quesada + * Copyright (c) 2012 Zynga Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +" \n\ +#ifdef GL_ES \n\ +precision lowp float; \n\ +#endif \n\ + \n\ +varying vec4 v_fragmentColor; \n\ +varying vec2 v_texCoord; \n\ +uniform sampler2D CC_Texture0; \n\ + \n\ +void main() \n\ +{ \n\ + gl_FragColor = vec4( v_fragmentColor.rgb, // RGB from uniform \n\ + v_fragmentColor.a * texture2D(CC_Texture0, v_texCoord).a // A from texture & uniform \n\ + ); \n\ +} \n\ +"; diff --git a/cocos2d/ccShader_PositionTextureA8Color_vert.h b/cocos2d/ccShader_PositionTextureA8Color_vert.h new file mode 100644 index 0000000..bb29e7d --- /dev/null +++ b/cocos2d/ccShader_PositionTextureA8Color_vert.h @@ -0,0 +1,45 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2011 Ricardo Quesada + * Copyright (c) 2012 Zynga Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +" \n\ +attribute vec4 a_position; \n\ +attribute vec2 a_texCoord; \n\ +attribute vec4 a_color; \n\ + \n\ +#ifdef GL_ES \n\ +varying lowp vec4 v_fragmentColor; \n\ +varying mediump vec2 v_texCoord; \n\ +#else \n\ +varying vec4 v_fragmentColor; \n\ +varying vec2 v_texCoord; \n\ +#endif \n\ + \n\ +void main() \n\ +{ \n\ + gl_Position = CC_MVPMatrix * a_position; \n\ + v_fragmentColor = a_color; \n\ + v_texCoord = a_texCoord; \n\ +} \n\ +"; diff --git a/cocos2d/ccShader_PositionTextureColorAlphaTest_frag.h b/cocos2d/ccShader_PositionTextureColorAlphaTest_frag.h new file mode 100644 index 0000000..759bb02 --- /dev/null +++ b/cocos2d/ccShader_PositionTextureColorAlphaTest_frag.h @@ -0,0 +1,47 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2011 Brian Chapados + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +" \n\ +#ifdef GL_ES \n\ +precision lowp float; \n\ +#endif \n\ + \n\ +varying vec4 v_fragmentColor; \n\ +varying vec2 v_texCoord; \n\ +uniform sampler2D CC_Texture0; \n\ +uniform float CC_AlphaValue; \n\ + \n\ +void main() \n\ +{ \n\ + vec4 texColor = texture2D(CC_Texture0, v_texCoord); \n\ + \n\ + // mimic: glAlphaFunc(GL_GREATER) \n\ + // pass if ( incoming_pixel >= CC_AlphaValue ) => fail if incoming_pixel < CC_AlphaValue \n\ + \n\ + if ( texColor.a <= CC_AlphaValue ) \n\ + discard; \n\ + \n\ + gl_FragColor = texColor * v_fragmentColor; \n\ +} \n\ +"; diff --git a/cocos2d/ccShader_PositionTextureColor_frag.h b/cocos2d/ccShader_PositionTextureColor_frag.h new file mode 100644 index 0000000..df5527e --- /dev/null +++ b/cocos2d/ccShader_PositionTextureColor_frag.h @@ -0,0 +1,39 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2011 Ricardo Quesada + * Copyright (c) 2012 Zynga Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +" \n\ +#ifdef GL_ES \n\ +precision lowp float; \n\ +#endif \n\ + \n\ +varying vec4 v_fragmentColor; \n\ +varying vec2 v_texCoord; \n\ +uniform sampler2D CC_Texture0; \n\ + \n\ +void main() \n\ +{ \n\ + gl_FragColor = v_fragmentColor * texture2D(CC_Texture0, v_texCoord); \n\ +} \n\ +"; diff --git a/cocos2d/ccShader_PositionTextureColor_vert.h b/cocos2d/ccShader_PositionTextureColor_vert.h new file mode 100644 index 0000000..bb29e7d --- /dev/null +++ b/cocos2d/ccShader_PositionTextureColor_vert.h @@ -0,0 +1,45 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2011 Ricardo Quesada + * Copyright (c) 2012 Zynga Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +" \n\ +attribute vec4 a_position; \n\ +attribute vec2 a_texCoord; \n\ +attribute vec4 a_color; \n\ + \n\ +#ifdef GL_ES \n\ +varying lowp vec4 v_fragmentColor; \n\ +varying mediump vec2 v_texCoord; \n\ +#else \n\ +varying vec4 v_fragmentColor; \n\ +varying vec2 v_texCoord; \n\ +#endif \n\ + \n\ +void main() \n\ +{ \n\ + gl_Position = CC_MVPMatrix * a_position; \n\ + v_fragmentColor = a_color; \n\ + v_texCoord = a_texCoord; \n\ +} \n\ +"; diff --git a/cocos2d/ccShader_PositionTexture_frag.h b/cocos2d/ccShader_PositionTexture_frag.h new file mode 100644 index 0000000..93a8f0e --- /dev/null +++ b/cocos2d/ccShader_PositionTexture_frag.h @@ -0,0 +1,38 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2011 Ricardo Quesada + * Copyright (c) 2012 Zynga Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +" \n\ +#ifdef GL_ES \n\ +precision lowp float; \n\ +#endif \n\ + \n\ +varying vec2 v_texCoord; \n\ +uniform sampler2D CC_Texture0; \n\ + \n\ +void main() \n\ +{ \n\ + gl_FragColor = texture2D(CC_Texture0, v_texCoord); \n\ +} \n\ +"; diff --git a/cocos2d/ccShader_PositionTexture_uColor_frag.h b/cocos2d/ccShader_PositionTexture_uColor_frag.h new file mode 100644 index 0000000..a97d250 --- /dev/null +++ b/cocos2d/ccShader_PositionTexture_uColor_frag.h @@ -0,0 +1,41 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2011 Ricardo Quesada + * Copyright (c) 2012 Zynga Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +" \n\ +#ifdef GL_ES \n\ +precision lowp float; \n\ +#endif \n\ + \n\ +uniform vec4 u_color; \n\ + \n\ +varying vec2 v_texCoord; \n\ + \n\ +uniform sampler2D CC_Texture0; \n\ + \n\ +void main() \n\ +{ \n\ + gl_FragColor = texture2D(CC_Texture0, v_texCoord) * u_color; \n\ +} \n\ +"; diff --git a/cocos2d/ccShader_PositionTexture_uColor_vert.h b/cocos2d/ccShader_PositionTexture_uColor_vert.h new file mode 100644 index 0000000..9d2bfd3 --- /dev/null +++ b/cocos2d/ccShader_PositionTexture_uColor_vert.h @@ -0,0 +1,41 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2011 Ricardo Quesada + * Copyright (c) 2012 Zynga Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +" \n\ +attribute vec4 a_position; \n\ +attribute vec2 a_texCoord; \n\ + \n\ +#ifdef GL_ES \n\ +varying mediump vec2 v_texCoord; \n\ +#else \n\ +varying vec2 v_texCoord; \n\ +#endif \n\ + \n\ +void main() \n\ +{ \n\ + gl_Position = CC_MVPMatrix * a_position; \n\ + v_texCoord = a_texCoord; \n\ +} \n\ +"; diff --git a/cocos2d/ccShader_PositionTexture_vert.h b/cocos2d/ccShader_PositionTexture_vert.h new file mode 100644 index 0000000..1278ab0 --- /dev/null +++ b/cocos2d/ccShader_PositionTexture_vert.h @@ -0,0 +1,41 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2011 Ricardo Quesada + * Copyright (c) 2012 Zynga Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +" \n\ +attribute vec4 a_position; \n\ +attribute vec2 a_texCoord; \n\ + \n\ +#ifdef GL_ES \n\ +varying mediump vec2 v_texCoord; \n\ +#else \n\ +varying vec2 v_texCoord; \n\ +#endif \n\ + \n\ +void main() \n\ +{ \n\ + gl_Position = CC_MVPMatrix * a_position; \n\ + v_texCoord = a_texCoord; \n\ +} \n\ +"; diff --git a/cocos2d/ccShader_Position_uColor_frag.h b/cocos2d/ccShader_Position_uColor_frag.h new file mode 100644 index 0000000..d882c88 --- /dev/null +++ b/cocos2d/ccShader_Position_uColor_frag.h @@ -0,0 +1,37 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2011 Ricardo Quesada + * Copyright (c) 2012 Zynga Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +" \n\ +#ifdef GL_ES \n\ +precision lowp float; \n\ +#endif \n\ + \n\ +varying vec4 v_fragmentColor; \n\ + \n\ +void main() \n\ +{ \n\ + gl_FragColor = v_fragmentColor; \n\ +} \n\ +"; diff --git a/cocos2d/ccShader_Position_uColor_vert.h b/cocos2d/ccShader_Position_uColor_vert.h new file mode 100644 index 0000000..c50e38b --- /dev/null +++ b/cocos2d/ccShader_Position_uColor_vert.h @@ -0,0 +1,43 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2011 Ricardo Quesada + * Copyright (c) 2012 Zynga Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +" \n\ +attribute vec4 a_position; \n\ +uniform vec4 u_color; \n\ +uniform float u_pointSize; \n\ + \n\ +#ifdef GL_ES \n\ +varying lowp vec4 v_fragmentColor; \n\ +#else \n\ +varying vec4 v_fragmentColor; \n\ +#endif \n\ + \n\ +void main() \n\ +{ \n\ + gl_Position = CC_MVPMatrix * a_position; \n\ + gl_PointSize = u_pointSize; \n\ + v_fragmentColor = u_color; \n\ +} \n\ +"; diff --git a/cocos2d/ccShaders.h b/cocos2d/ccShaders.h new file mode 100644 index 0000000..076c3e0 --- /dev/null +++ b/cocos2d/ccShaders.h @@ -0,0 +1,56 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2012 Zynga Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#import "Platforms/CCGL.h" + +#ifdef __cplusplus__ +extern "C" { +#endif // __cplusplus__ + +extern const GLchar * ccPosition_uColor_frag; +extern const GLchar * ccPosition_uColor_vert; + +extern const GLchar * ccPositionColor_frag; +extern const GLchar * ccPositionColor_vert; + +extern const GLchar * ccPositionTexture_frag; +extern const GLchar * ccPositionTexture_vert; + +extern const GLchar * ccPositionTextureA8Color_frag; +extern const GLchar * ccPositionTextureA8Color_vert; + +extern const GLchar * ccPositionTextureColor_frag; +extern const GLchar * ccPositionTextureColor_vert; + +extern const GLchar * ccPositionTextureColorAlphaTest_frag; + +extern const GLchar * ccPositionTexture_uColor_frag; +extern const GLchar * ccPositionTexture_uColor_vert; + +extern const GLchar * ccPositionColorLengthTexture_frag; +extern const GLchar * ccPositionColorLengthTexture_vert; + +#ifdef __cplusplus__ +} +#endif // __cplusplus__ diff --git a/src/cocos2d/ccShaders.m b/cocos2d/ccShaders.m similarity index 91% rename from src/cocos2d/ccShaders.m rename to cocos2d/ccShaders.m index 36ca949..91dd677 100644 --- a/src/cocos2d/ccShaders.m +++ b/cocos2d/ccShaders.m @@ -63,3 +63,11 @@ #import "ccShader_PositionTexture_uColor_frag.h" const GLchar * ccPositionTexture_uColor_vert = #import "ccShader_PositionTexture_uColor_vert.h" + +// +const GLchar * ccPositionColorLengthTexture_frag = +#import "ccShader_PositionColorLengthTexture_frag.h" + +const GLchar * ccPositionColorLengthTexture_vert = +#import "ccShader_PositionColorLengthTexture_vert.h" + diff --git a/cocos2d/ccTypes.h b/cocos2d/ccTypes.h new file mode 100644 index 0000000..1596271 --- /dev/null +++ b/cocos2d/ccTypes.h @@ -0,0 +1,552 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2008-2010 Ricardo Quesada + * Copyright (c) 2011 Zynga Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + + +/** + @file + cocos2d (cc) types +*/ + +#import +#import "ccMacros.h" + +#ifdef __CC_PLATFORM_IOS +#import // CGPoint +#endif + +#import "Platforms/CCGL.h" + +/** RGB color composed of bytes 3 bytes +@since v0.8 + */ + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct _ccColor3B +{ + GLubyte r; + GLubyte g; + GLubyte b; +} ccColor3B; + +//! helper macro that creates an ccColor3B type +static inline ccColor3B +ccc3(const GLubyte r, const GLubyte g, const GLubyte b) +{ + ccColor3B c = {r, g, b}; + return c; +} + + //ccColor3B predefined colors +//! White color (255,255,255) +static const ccColor3B ccWHITE = {255,255,255}; +//! Yellow color (255,255,0) +static const ccColor3B ccYELLOW = {255,255,0}; +//! Blue color (0,0,255) +static const ccColor3B ccBLUE = {0,0,255}; +//! Green Color (0,255,0) +static const ccColor3B ccGREEN = {0,255,0}; +//! Red Color (255,0,0,) +static const ccColor3B ccRED = {255,0,0}; +//! Magenta Color (255,0,255) +static const ccColor3B ccMAGENTA = {255,0,255}; +//! Black Color (0,0,0) +static const ccColor3B ccBLACK = {0,0,0}; +//! Orange Color (255,127,0) +static const ccColor3B ccORANGE = {255,127,0}; +//! Gray Color (166,166,166) +static const ccColor3B ccGRAY = {166,166,166}; + +/** RGBA color composed of 4 bytes +@since v0.8 +*/ +typedef struct _ccColor4B +{ + GLubyte r; + GLubyte g; + GLubyte b; + GLubyte a; +} ccColor4B; +//! helper macro that creates an ccColor4B type +static inline ccColor4B +ccc4(const GLubyte r, const GLubyte g, const GLubyte b, const GLubyte o) +{ + ccColor4B c = {r, g, b, o}; + return c; +} + +/** returns YES if both ccColor4F are equal. Otherwise it returns NO. + @since v0.99.1 + */ +static inline BOOL ccc4BEqual(ccColor4B a, ccColor4B b) +{ + return a.r == b.r && a.g == b.g && a.b == b.b && a.a == b.a; +} + +/** RGBA color composed of 4 floats +@since v0.8 +*/ +typedef struct _ccColor4F { + GLfloat r; + GLfloat g; + GLfloat b; + GLfloat a; +} ccColor4F; + +//! helper that creates a ccColor4f type +static inline ccColor4F ccc4f(const GLfloat r, const GLfloat g, const GLfloat b, const GLfloat a) +{ + return (ccColor4F){r, g, b, a}; +} + +/** Returns a ccColor4F from a ccColor3B. Alpha will be 1. + @since v0.99.1 + */ +static inline ccColor4F ccc4FFromccc3B(ccColor3B c) +{ + return (ccColor4F){c.r/255.f, c.g/255.f, c.b/255.f, 1.f}; +} + +/** Returns a ccColor4F from a ccColor4B. + @since v0.99.1 + */ +static inline ccColor4F ccc4FFromccc4B(ccColor4B c) +{ + return (ccColor4F){c.r/255.f, c.g/255.f, c.b/255.f, c.a/255.f}; +} + +#pragma clang diagnostic push COCOS2D +#pragma clang diagnostic ignored "-Wfloat-equal" +/** returns YES if both ccColor4F are equal. Otherwise it returns NO. + @since v0.99.1 + */ +static inline BOOL ccc4FEqual(ccColor4F a, ccColor4F b) +{ + return a.r == b.r && a.g == b.g && a.b == b.b && a.a == b.a; +} + +static inline ccColor4B ccc4BFromccc4F(ccColor4F c) +{ + return (ccColor4B){(GLubyte)(c.r*255), (GLubyte)(c.g*255), (GLubyte)(c.b*255), (GLubyte)(c.a*255)}; +} +#pragma clang diagnostic pop COCOS2D + +/** A vertex composed of 2 GLfloats: x, y + @since v0.8 + */ +typedef struct _ccVertex2F +{ + GLfloat x; + GLfloat y; +} ccVertex2F; + +/** A vertex composed of 2 floats: x, y + @since v0.8 + */ +typedef struct _ccVertex3F +{ + GLfloat x; + GLfloat y; + GLfloat z; +} ccVertex3F; + +/** A texcoord composed of 2 floats: u, y + @since v0.8 + */ +typedef struct _ccTex2F { + GLfloat u; + GLfloat v; +} ccTex2F; + + +//! Point Sprite component +typedef struct _ccPointSprite +{ + ccVertex2F pos; // 8 bytes + ccColor4B color; // 4 bytes + GLfloat size; // 4 bytes +} ccPointSprite; + +//! A 2D Quad. 4 * 2 floats +typedef struct _ccQuad2 { + ccVertex2F tl; + ccVertex2F tr; + ccVertex2F bl; + ccVertex2F br; +} ccQuad2; + + +//! A 3D Quad. 4 * 3 floats +typedef struct _ccQuad3 { + ccVertex3F bl; + ccVertex3F br; + ccVertex3F tl; + ccVertex3F tr; +} ccQuad3; + +//! a Point with a vertex point, a tex coord point and a color 4B +typedef struct _ccV2F_C4B_T2F +{ + //! vertices (2F) + ccVertex2F vertices; + //! colors (4B) + ccColor4B colors; + //! tex coords (2F) + ccTex2F texCoords; +} ccV2F_C4B_T2F; + +//! a Point with a vertex point, a tex coord point and a color 4F +typedef struct _ccV2F_C4F_T2F +{ + //! vertices (2F) + ccVertex2F vertices; + //! colors (4F) + ccColor4F colors; + //! tex coords (2F) + ccTex2F texCoords; +} ccV2F_C4F_T2F; + +//! a Point with a vertex point, a tex coord point and a color 4F +typedef struct _ccV3F_C4F_T2F +{ + //! vertices (3F) + ccVertex3F vertices; + //! colors (4F) + ccColor4F colors; + //! tex coords (2F) + ccTex2F texCoords; +} ccV3F_C4F_T2F; + +//! 4 ccV3F_C4F_T2F +typedef struct _ccV3F_C4F_T2F_Quad +{ + //! top left + ccV3F_C4F_T2F tl; + //! bottom left + ccV3F_C4F_T2F bl; + //! top right + ccV3F_C4F_T2F tr; + //! bottom right + ccV3F_C4F_T2F br; +} ccV3F_C4F_T2F_Quad; + +//! a Point with a vertex point, a tex coord point and a color 4B +typedef struct _ccV3F_C4B_T2F +{ + //! vertices (3F) + ccVertex3F vertices; // 12 bytes +// char __padding__[4]; + + //! colors (4B) + ccColor4B colors; // 4 bytes +// char __padding2__[4]; + + // tex coords (2F) + ccTex2F texCoords; // 8 byts +} ccV3F_C4B_T2F; + + +//! A Triangle of ccV2F_C4B_T2F +typedef struct _ccV2F_C4B_T2F_Triangle +{ + //! Point A + ccV2F_C4B_T2F a; + //! Point B + ccV2F_C4B_T2F b; + //! Point B + ccV2F_C4B_T2F c; +} ccV2F_C4B_T2F_Triangle; + +//! A Quad of ccV2F_C4B_T2F +typedef struct _ccV2F_C4B_T2F_Quad +{ + //! bottom left + ccV2F_C4B_T2F bl; + //! bottom right + ccV2F_C4B_T2F br; + //! top left + ccV2F_C4B_T2F tl; + //! top right + ccV2F_C4B_T2F tr; +} ccV2F_C4B_T2F_Quad; + +//! 4 ccVertex3FTex2FColor4B +typedef struct _ccV3F_C4B_T2F_Quad +{ + //! top left + ccV3F_C4B_T2F tl; + //! bottom left + ccV3F_C4B_T2F bl; + //! top right + ccV3F_C4B_T2F tr; + //! bottom right + ccV3F_C4B_T2F br; +} ccV3F_C4B_T2F_Quad; + +//! 4 ccVertex2FTex2FColor4F Quad +typedef struct _ccV2F_C4F_T2F_Quad +{ + //! bottom left + ccV2F_C4F_T2F bl; + //! bottom right + ccV2F_C4F_T2F br; + //! top left + ccV2F_C4F_T2F tl; + //! top right + ccV2F_C4F_T2F tr; +} ccV2F_C4F_T2F_Quad; + +//! Blend Function used for textures +typedef struct _ccBlendFunc +{ + //! source blend function + GLenum src; + //! destination blend function + GLenum dst; +} ccBlendFunc; + +static const ccBlendFunc kCCBlendFuncDisable = {GL_ONE, GL_ZERO}; + +//! ccResolutionType +typedef enum +{ + //! Unknown resolution type + kCCResolutionUnknown, +#ifdef __CC_PLATFORM_IOS + //! iPhone resolution type + kCCResolutioniPhone, + //! iPhone RetinaDisplay resolution type + kCCResolutioniPhoneRetinaDisplay, + //! iPhone5 resolution type + kCCResolutioniPhone5, + //! iPhone 5 RetinaDisplay resolution type + kCCResolutioniPhone5RetinaDisplay, + //! iPad resolution type + kCCResolutioniPad, + //! iPad Retina Display resolution type + kCCResolutioniPadRetinaDisplay, + +#elif defined(__CC_PLATFORM_MAC) + //! Mac resolution type + kCCResolutionMac, + + //! Mac RetinaDisplay resolution type + kCCResolutionMacRetinaDisplay, +#endif // platform + +} ccResolutionType; + +// XXX: If any of these enums are edited and/or reordered, update CCTexture2D.m +//! Vertical text alignment type +typedef enum +{ + kCCVerticalTextAlignmentTop, + kCCVerticalTextAlignmentCenter, + kCCVerticalTextAlignmentBottom, +} CCVerticalTextAlignment; + +// XXX: If any of these enums are edited and/or reordered, update CCTexture2D.m +//! Horizontal text alignment type +typedef enum +{ + kCCTextAlignmentLeft, + kCCTextAlignmentCenter, + kCCTextAlignmentRight, +} CCTextAlignment; + +// XXX: If any of these enums are edited and/or reordered, update CCTexture2D.m +//! Line break modes +typedef enum { + kCCLineBreakModeWordWrap, + kCCLineBreakModeCharacterWrap, + kCCLineBreakModeClip, + kCCLineBreakModeHeadTruncation, + kCCLineBreakModeTailTruncation, + kCCLineBreakModeMiddleTruncation +} CCLineBreakMode; + +//! delta time type +//! if you want more resolution redefine it as a double +typedef CGFloat ccTime; +//typedef double ccTime; + +typedef float ccMat4[16]; + +/* +typedef struct _ccFontShadow +{ + // true if shadow enabled + bool m_shadowEnabled; + // shadow x and y offset + CGSize m_shadowOffset; + // shadow blurrines + float m_shadowBlur; + // shadow opacity + float m_shadowOpacity; + +} ccFontShadow; + +typedef struct _ccFontStroke +{ + // true if stroke enabled + bool m_strokeEnabled; + // stroke color + ccColor3B m_strokeColor; + // stroke size + float m_strokeSize; + +} ccFontStroke; + */ + +/* +typedef struct _ccFontDefinition +{ + // font name + NSString *m_fontName; + // font size + int m_fontSize; + // horizontal alignment + CCTextAlignment m_alignment; + // vertical alignment + CCVerticalTextAlignment m_vertAlignment; + // line break mode + CCLineBreakMode m_lineBreakMode; + // renering box + CGSize m_dimensions; + // font color + ccColor3B m_fontFillColor; + // font shadow + ccFontShadow m_shadow; + // font stroke + ccFontStroke m_stroke; + +} ccFontDefinition; +*/ + +enum +{ + //! Position is set in points (this is the default) + kCCPositionUnitPoints, + + //! Position is scaled by the global positionScaleFactor (as defined by CCDirector) + kCCPositionUnitScaled, + + //! Position is a normalized value multiplied by the content size of the parent's container + kCCPositionUnitNormalized, + +}; +typedef unsigned char CCPositionUnit; + +enum +{ + //! Content size is set in points (this is the default) + kCCContentSizeUnitPoints, + + //! Content size is scaled by the global positionScaleFactor (as defined by CCDirector) + kCCContentSizeUnitScaled, + + //! Content size is a normalized value multiplied by the content size of the parent's container + kCCContentSizeUnitNormalized, + + //! Content size is the size of the parents container inset by the supplied value + kCCContentSizeUnitInsetPoints, + + //! Content size is the size of the parents container inset by the supplied value multiplied by the positionScaleFactor (as defined by CCDirector) + kCCContentSizeUnitInsetScaled, + +}; +typedef unsigned char CCContentSizeUnit; + +enum +{ + //! Position is relative to the bottom left corner of the parent container (this is the default) + kCCPositionReferenceCornerBottomLeft, + + //! Position is relative to the top left corner of the parent container + kCCPositionReferenceCornerTopLeft, + + //! Position is relative to the top right corner of the parent container + kCCPositionReferenceCornerTopRight, + + //! Position is relative to the bottom right corner of the parent container + kCCPositionReferenceCornerBottomRight, + +}; +typedef unsigned char CCPositionReferenceCorner; + +typedef struct _CCPositionType +{ + CCPositionUnit xUnit; + CCPositionUnit yUnit; + CCPositionReferenceCorner corner; +} CCPositionType; + +typedef struct _CCContentSizeType +{ + CCContentSizeUnit widthUnit; + CCContentSizeUnit heightUnit; +} CCContentSizeType; + +//! helper that creates a CCPositionType type +static inline CCPositionType CCPositionTypeMake(CCPositionUnit xUnit, CCPositionUnit yUnit, CCPositionReferenceCorner corner) +{ + CCPositionType pt; + pt.xUnit = xUnit; + pt.yUnit = yUnit; + pt.corner = corner; + return pt; +} + +//! helper that creates a CCContentSizeType type +static inline CCContentSizeType CCContentSizeTypeMake(CCContentSizeUnit widthUnit, CCContentSizeUnit heightUnit) +{ + CCContentSizeType cst; + cst.widthUnit = widthUnit; + cst.heightUnit = heightUnit; + return cst; +} + +#define kCCPositionTypePoints CCPositionTypeMake(kCCPositionUnitPoints, kCCPositionUnitPoints, kCCPositionReferenceCornerBottomLeft) + +#define kCCPositionTypeScaled CCPositionTypeMake(kCCPositionUnitScaled, kCCPositionUnitScaled, kCCPositionReferenceCornerBottomLeft) + +#define kCCPositionTypeNormalized CCPositionTypeMake(kCCPositionUnitNormalized, kCCPositionUnitNormalized, kCCPositionReferenceCornerBottomLeft) + + +#define kCCContentSizeTypePoints CCContentSizeTypeMake(kCCContentSizeUnitPoints, kCCContentSizeUnitPoints) +#define kCCContentSizeTypeScaled CCContentSizeTypeMake(kCCContentSizeUnitScaled, kCCContentSizeUnitScaled) +#define kCCContentSizeTypeNormalized CCContentSizeTypeMake(kCCContentSizeUnitNormalized, kCCContentSizeUnitNormalized) + +typedef enum { + kCCScaleTypePoints, + kCCScaleTypeScaled, +} CCScaleType; + +#ifdef __cplusplus +} +#endif + diff --git a/cocos2d/cocos2d.h b/cocos2d/cocos2d.h new file mode 100644 index 0000000..22290c5 --- /dev/null +++ b/cocos2d/cocos2d.h @@ -0,0 +1,194 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2008-2010 Ricardo Quesada + * Copyright (c) 2011 Zynga Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +/** @mainpage cocos2d for iPhone API reference + * + * @image html Icon.png + * + * @section intro Introduction + * This is cocos2d API reference + * + * The programming guide is hosted here: http://www.cocos2d-iphone.org/wiki/doku.php/prog_guide:index + * + *
+ * + * @todo A native English speaker should check the grammar. We need your help! + * + */ + +// 0x00 HI ME LO +// 00 02 05 00 +#define COCOS2D_VERSION 0x00020500 + + +// +// all cocos2d include files +// +#import "ccConfig.h" // should be included first + +#import "CCActionManager.h" +#import "CCAction.h" +#import "CCActionInstant.h" +#import "CCActionInterval.h" +#import "CCActionEase.h" +#import "CCActionTween.h" +#import "CCActionEase.h" +#import "CCActionTiledGrid.h" +#import "CCActionGrid3D.h" +#import "CCActionGrid.h" +#import "CCActionProgressTimer.h" +#import "CCActionPageTurn3D.h" +#import "CCActionCatmullRom.h" + +#import "CCAnimation.h" +#import "CCAnimationCache.h" +#import "CCSprite.h" +#import "CCSpriteFrame.h" +#import "CCSpriteBatchNode.h" +#import "CCSpriteFrameCache.h" +#import "CCSprite9Slice.h" + +#import "CCLabelTTF.h" +#import "CCLabelBMFont.h" +#import "CCLabelAtlas.h" + +#import "CCParticleSystem.h" +#import "CCParticleSystemQuad.h" +#import "CCParticleExamples.h" +#import "CCParticleBatchNode.h" + +#import "CCTexture2D.h" +#import "CCTexturePVR.h" +#import "CCTextureCache.h" +#import "CCTextureAtlas.h" + +#import "CCTransition.h" + +#import "CCTMXTiledMap.h" +#import "CCTMXLayer.h" +#import "CCTMXObjectGroup.h" +#import "CCTMXXMLParser.h" +#import "CCTileMapAtlas.h" + +#import "CCLayer.h" +#import "CCMenu.h" +#import "CCMenuItem.h" +#import "CCDrawingPrimitives.h" +#import "CCScene.h" +#import "CCScheduler.h" +#import "CCProtocols.h" +#import "CCNode.h" +#import "CCNode+Debug.h" +#import "CCDirector.h" +#import "CCAtlasNode.h" +#import "CCGrabber.h" +#import "CCGrid.h" +#import "CCParallaxNode.h" +#import "CCRenderTexture.h" +#import "CCMotionStreak.h" +#import "CCConfiguration.h" +#import "CCDrawNode.h" +#import "CCClippingNode.h" + +#import "ccFPSImages.h" + +// Shaders +#import "CCGLProgram.h" +#import "ccGLStateCache.h" +#import "CCShaderCache.h" +#import "ccShaders.h" + +// Physics +#import "CCPhysicsBody.h" +#import "CCPhysicsJoint.h" +#import "CCPhysicsNode.h" + +// +// cocos2d macros +// +#import "ccTypes.h" +#import "ccMacros.h" + +// +// Deprecated methods/classes/functions since v1.0 +// +#import "ccDeprecated.h" + +// Platform common +#import "Platforms/CCGL.h" +#import "Platforms/CCNS.h" + +#ifdef __CC_PLATFORM_IOS +#import "Platforms/iOS/CCGLView.h" +#import "Platforms/iOS/CCDirectorIOS.h" +#import "Platforms/iOS/UITouch+CC.h" + +#elif defined(__CC_PLATFORM_MAC) +#import "Platforms/Mac/CCGLView.h" +#import "Platforms/Mac/CCDirectorMac.h" +#import "Platforms/Mac/CCWindow.h" +#endif + +// +// cocos2d helper files +// +#import "Support/OpenGL_Internal.h" +#import "Support/CCFileUtils.h" +#import "Support/CGPointExtension.h" +#import "Support/ccUtils.h" +#import "Support/TransformUtils.h" +#import "Support/CCProfiling.h" +#import "Support/NSThread+performBlock.h" +#import "Support/uthash.h" +#import "Support/utlist.h" + +// +// external +// +#pragma clang diagnostic push COCOS2D +#pragma clang diagnostic ignored "-Wignored-qualifiers" +#import "kazmath/kazmath.h" +#import "kazmath/GL/matrix.h" +#pragma clang diagnostic pop COCOS2D + + +#ifdef __cplusplus +extern "C" { +#endif + +// free functions +NSString * cocos2dVersion(void); +extern const char * cocos2d_version; + +#ifdef __cplusplus +} +#endif + + +#ifdef __CC_PLATFORM_IOS +#ifndef __IPHONE_4_0 +#error "If you are targeting iPad, you should set BASE SDK = 4.0 (or 4.1, or 4.2), and set the 'iOS deploy target' = 3.2" +#endif +#endif diff --git a/src/cocos2d/cocos2d.m b/cocos2d/cocos2d.m similarity index 90% rename from src/cocos2d/cocos2d.m rename to cocos2d/cocos2d.m index db52e21..bfec174 100644 --- a/src/cocos2d/cocos2d.m +++ b/cocos2d/cocos2d.m @@ -26,9 +26,9 @@ #import #import "cocos2d.h" -static NSString *version = @"cocos2d v2.0.0"; +const char *cocos2d_version = "cocos2d-iphone v2.1"; NSString *cocos2dVersion() { - return version; + return [NSString stringWithCString:cocos2d_version encoding:NSUTF8StringEncoding]; } diff --git a/external/Box2d/Box2D/Box2D.h b/external/Box2d/Box2D/Box2D.h new file mode 100644 index 0000000..66d2217 --- /dev/null +++ b/external/Box2d/Box2D/Box2D.h @@ -0,0 +1,67 @@ +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef BOX2D_H +#define BOX2D_H + +/** +\mainpage Box2D API Documentation + +\section intro_sec Getting Started + +For documentation please see http://box2d.org/documentation.html + +For discussion please visit http://box2d.org/forum +*/ + +// These include files constitute the main Box2D API + +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#endif diff --git a/external/Box2d/Box2D/Box2DConfig.cmake b/external/Box2d/Box2D/Box2DConfig.cmake new file mode 100644 index 0000000..b567c17 --- /dev/null +++ b/external/Box2d/Box2D/Box2DConfig.cmake @@ -0,0 +1,3 @@ +get_filename_component(SELF_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) +include(${SELF_DIR}/Box2D-targets.cmake) +get_filename_component(Box2D_INCLUDE_DIRS "${SELF_DIR}/../../include" ABSOLUTE) diff --git a/external/Box2d/Box2D/CMakeLists.txt b/external/Box2d/Box2D/CMakeLists.txt new file mode 100644 index 0000000..445c248 --- /dev/null +++ b/external/Box2d/Box2D/CMakeLists.txt @@ -0,0 +1,205 @@ +set(BOX2D_Collision_SRCS + Collision/b2BroadPhase.cpp + Collision/b2CollideCircle.cpp + Collision/b2CollideEdge.cpp + Collision/b2CollidePolygon.cpp + Collision/b2Collision.cpp + Collision/b2Distance.cpp + Collision/b2DynamicTree.cpp + Collision/b2TimeOfImpact.cpp +) +set(BOX2D_Collision_HDRS + Collision/b2BroadPhase.h + Collision/b2Collision.h + Collision/b2Distance.h + Collision/b2DynamicTree.h + Collision/b2TimeOfImpact.h +) +set(BOX2D_Shapes_SRCS + Collision/Shapes/b2CircleShape.cpp + Collision/Shapes/b2EdgeShape.cpp + Collision/Shapes/b2ChainShape.cpp + Collision/Shapes/b2PolygonShape.cpp +) +set(BOX2D_Shapes_HDRS + Collision/Shapes/b2CircleShape.h + Collision/Shapes/b2EdgeShape.h + Collision/Shapes/b2ChainShape.h + Collision/Shapes/b2PolygonShape.h + Collision/Shapes/b2Shape.h +) +set(BOX2D_Common_SRCS + Common/b2BlockAllocator.cpp + Common/b2Draw.cpp + Common/b2Math.cpp + Common/b2Settings.cpp + Common/b2StackAllocator.cpp + Common/b2Timer.cpp +) +set(BOX2D_Common_HDRS + Common/b2BlockAllocator.h + Common/b2Draw.h + Common/b2GrowableStack.h + Common/b2Math.h + Common/b2Settings.h + Common/b2StackAllocator.h + Common/b2Timer.h +) +set(BOX2D_Dynamics_SRCS + Dynamics/b2Body.cpp + Dynamics/b2ContactManager.cpp + Dynamics/b2Fixture.cpp + Dynamics/b2Island.cpp + Dynamics/b2World.cpp + Dynamics/b2WorldCallbacks.cpp +) +set(BOX2D_Dynamics_HDRS + Dynamics/b2Body.h + Dynamics/b2ContactManager.h + Dynamics/b2Fixture.h + Dynamics/b2Island.h + Dynamics/b2TimeStep.h + Dynamics/b2World.h + Dynamics/b2WorldCallbacks.h +) +set(BOX2D_Contacts_SRCS + Dynamics/Contacts/b2CircleContact.cpp + Dynamics/Contacts/b2Contact.cpp + Dynamics/Contacts/b2ContactSolver.cpp + Dynamics/Contacts/b2PolygonAndCircleContact.cpp + Dynamics/Contacts/b2EdgeAndCircleContact.cpp + Dynamics/Contacts/b2EdgeAndPolygonContact.cpp + Dynamics/Contacts/b2ChainAndCircleContact.cpp + Dynamics/Contacts/b2ChainAndPolygonContact.cpp + Dynamics/Contacts/b2PolygonContact.cpp +) +set(BOX2D_Contacts_HDRS + Dynamics/Contacts/b2CircleContact.h + Dynamics/Contacts/b2Contact.h + Dynamics/Contacts/b2ContactSolver.h + Dynamics/Contacts/b2PolygonAndCircleContact.h + Dynamics/Contacts/b2EdgeAndCircleContact.h + Dynamics/Contacts/b2EdgeAndPolygonContact.h + Dynamics/Contacts/b2ChainAndCircleContact.h + Dynamics/Contacts/b2ChainAndPolygonContact.h + Dynamics/Contacts/b2PolygonContact.h +) +set(BOX2D_Joints_SRCS + Dynamics/Joints/b2DistanceJoint.cpp + Dynamics/Joints/b2FrictionJoint.cpp + Dynamics/Joints/b2GearJoint.cpp + Dynamics/Joints/b2Joint.cpp + Dynamics/Joints/b2MouseJoint.cpp + Dynamics/Joints/b2PrismaticJoint.cpp + Dynamics/Joints/b2PulleyJoint.cpp + Dynamics/Joints/b2RevoluteJoint.cpp + Dynamics/Joints/b2RopeJoint.cpp + Dynamics/Joints/b2WeldJoint.cpp + Dynamics/Joints/b2WheelJoint.cpp +) +set(BOX2D_Joints_HDRS + Dynamics/Joints/b2DistanceJoint.h + Dynamics/Joints/b2FrictionJoint.h + Dynamics/Joints/b2GearJoint.h + Dynamics/Joints/b2Joint.h + Dynamics/Joints/b2MouseJoint.h + Dynamics/Joints/b2PrismaticJoint.h + Dynamics/Joints/b2PulleyJoint.h + Dynamics/Joints/b2RevoluteJoint.h + Dynamics/Joints/b2RopeJoint.h + Dynamics/Joints/b2WeldJoint.h + Dynamics/Joints/b2WheelJoint.h +) +set(BOX2D_Rope_SRCS + Rope/b2Rope.cpp +) +set(BOX2D_Rope_HDRS + Rope/b2Rope.h +) +set(BOX2D_General_HDRS + Box2D.h +) +include_directories( ../ ) + +if(BOX2D_BUILD_SHARED) + add_library(Box2D_shared SHARED + ${BOX2D_General_HDRS} + ${BOX2D_Joints_SRCS} + ${BOX2D_Joints_HDRS} + ${BOX2D_Contacts_SRCS} + ${BOX2D_Contacts_HDRS} + ${BOX2D_Dynamics_SRCS} + ${BOX2D_Dynamics_HDRS} + ${BOX2D_Common_SRCS} + ${BOX2D_Common_HDRS} + ${BOX2D_Shapes_SRCS} + ${BOX2D_Shapes_HDRS} + ${BOX2D_Collision_SRCS} + ${BOX2D_Collision_HDRS} + ${BOX2D_Rope_SRCS} + ${BOX2D_Rope_HDRS} + ) + set_target_properties(Box2D_shared PROPERTIES + OUTPUT_NAME "Box2D" + CLEAN_DIRECT_OUTPUT 1 + VERSION ${BOX2D_VERSION} + ) +endif() + +if(BOX2D_BUILD_STATIC) + add_library(Box2D STATIC + ${BOX2D_General_HDRS} + ${BOX2D_Joints_SRCS} + ${BOX2D_Joints_HDRS} + ${BOX2D_Contacts_SRCS} + ${BOX2D_Contacts_HDRS} + ${BOX2D_Dynamics_SRCS} + ${BOX2D_Dynamics_HDRS} + ${BOX2D_Common_SRCS} + ${BOX2D_Common_HDRS} + ${BOX2D_Shapes_SRCS} + ${BOX2D_Shapes_HDRS} + ${BOX2D_Collision_SRCS} + ${BOX2D_Collision_HDRS} + ${BOX2D_Rope_SRCS} + ${BOX2D_Rope_HDRS} + ) + set_target_properties(Box2D PROPERTIES + CLEAN_DIRECT_OUTPUT 1 + VERSION ${BOX2D_VERSION} + ) +endif() + +# These are used to create visual studio folders. +source_group(Collision FILES ${BOX2D_Collision_SRCS} ${BOX2D_Collision_HDRS}) +source_group(Collision\\Shapes FILES ${BOX2D_Shapes_SRCS} ${BOX2D_Shapes_HDRS}) +source_group(Common FILES ${BOX2D_Common_SRCS} ${BOX2D_Common_HDRS}) +source_group(Dynamics FILES ${BOX2D_Dynamics_SRCS} ${BOX2D_Dynamics_HDRS}) +source_group(Dynamics\\Contacts FILES ${BOX2D_Contacts_SRCS} ${BOX2D_Contacts_HDRS}) +source_group(Dynamics\\Joints FILES ${BOX2D_Joints_SRCS} ${BOX2D_Joints_HDRS}) +source_group(Include FILES ${BOX2D_General_HDRS}) +source_group(Rope FILES ${BOX2D_Rope_SRCS} ${BOX2D_Rope_HDRS}) + +if(BOX2D_INSTALL) + # install headers + install(FILES ${BOX2D_General_HDRS} DESTINATION include/Box2D) + install(FILES ${BOX2D_Collision_HDRS} DESTINATION include/Box2D/Collision) + install(FILES ${BOX2D_Shapes_HDRS} DESTINATION include/Box2D/Collision/Shapes) + install(FILES ${BOX2D_Common_HDRS} DESTINATION include/Box2D/Common) + install(FILES ${BOX2D_Dynamics_HDRS} DESTINATION include/Box2D/Dynamics) + install(FILES ${BOX2D_Contacts_HDRS} DESTINATION include/Box2D/Dynamics/Contacts) + install(FILES ${BOX2D_Joints_HDRS} DESTINATION include/Box2D/Dynamics/Joints) + install(FILES ${BOX2D_Rope_HDRS} DESTINATION include/Box2D/Rope) + + # install libraries + if(BOX2D_BUILD_SHARED) + install(TARGETS Box2D_shared EXPORT Box2D-targets DESTINATION lib) + endif() + if(BOX2D_BUILD_STATIC) + install(TARGETS Box2D EXPORT Box2D-targets DESTINATION lib) + endif() + + # install build system hooks for third-party apps + install(EXPORT Box2D-targets DESTINATION lib/Box2D) + install(FILES Box2DConfig.cmake DESTINATION lib/Box2D) +endif(BOX2D_INSTALL) \ No newline at end of file diff --git a/src/Box2D/Collision/Shapes/b2ChainShape.cpp b/external/Box2d/Box2D/Collision/Shapes/b2ChainShape.cpp similarity index 86% rename from src/Box2D/Collision/Shapes/b2ChainShape.cpp rename to external/Box2d/Box2D/Collision/Shapes/b2ChainShape.cpp index 76bceab..f7bbe06 100644 --- a/src/Box2D/Collision/Shapes/b2ChainShape.cpp +++ b/external/Box2d/Box2D/Collision/Shapes/b2ChainShape.cpp @@ -33,14 +33,6 @@ void b2ChainShape::CreateLoop(const b2Vec2* vertices, int32 count) { b2Assert(m_vertices == NULL && m_count == 0); b2Assert(count >= 3); - for (int32 i = 1; i < count; ++i) - { - b2Vec2 v1 = vertices[i-1]; - b2Vec2 v2 = vertices[i]; - // If the code crashes here, it means your vertices are too close together. - b2Assert(b2DistanceSquared(v1, v2) > b2_linearSlop * b2_linearSlop); - } - m_count = count + 1; m_vertices = (b2Vec2*)b2Alloc(m_count * sizeof(b2Vec2)); memcpy(m_vertices, vertices, count * sizeof(b2Vec2)); @@ -55,18 +47,9 @@ void b2ChainShape::CreateChain(const b2Vec2* vertices, int32 count) { b2Assert(m_vertices == NULL && m_count == 0); b2Assert(count >= 2); - for (int32 i = 1; i < count; ++i) - { - b2Vec2 v1 = vertices[i-1]; - b2Vec2 v2 = vertices[i]; - // If the code crashes here, it means your vertices are too close together. - b2Assert(b2DistanceSquared(v1, v2) > b2_linearSlop * b2_linearSlop); - } - m_count = count; m_vertices = (b2Vec2*)b2Alloc(count * sizeof(b2Vec2)); memcpy(m_vertices, vertices, m_count * sizeof(b2Vec2)); - m_hasPrevVertex = false; m_hasNextVertex = false; } diff --git a/external/Box2d/Box2D/Collision/Shapes/b2ChainShape.h b/external/Box2d/Box2D/Collision/Shapes/b2ChainShape.h new file mode 100644 index 0000000..6aa41ea --- /dev/null +++ b/external/Box2d/Box2D/Collision/Shapes/b2ChainShape.h @@ -0,0 +1,102 @@ +/* +* Copyright (c) 2006-2010 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_CHAIN_SHAPE_H +#define B2_CHAIN_SHAPE_H + +#include + +class b2EdgeShape; + +/// A chain shape is a free form sequence of line segments. +/// The chain has two-sided collision, so you can use inside and outside collision. +/// Therefore, you may use any winding order. +/// Since there may be many vertices, they are allocated using b2Alloc. +/// Connectivity information is used to create smooth collisions. +/// WARNING: The chain will not collide properly if there are self-intersections. +class b2ChainShape : public b2Shape +{ +public: + b2ChainShape(); + + /// The destructor frees the vertices using b2Free. + ~b2ChainShape(); + + /// Create a loop. This automatically adjusts connectivity. + /// @param vertices an array of vertices, these are copied + /// @param count the vertex count + void CreateLoop(const b2Vec2* vertices, int32 count); + + /// Create a chain with isolated end vertices. + /// @param vertices an array of vertices, these are copied + /// @param count the vertex count + void CreateChain(const b2Vec2* vertices, int32 count); + + /// Establish connectivity to a vertex that precedes the first vertex. + /// Don't call this for loops. + void SetPrevVertex(const b2Vec2& prevVertex); + + /// Establish connectivity to a vertex that follows the last vertex. + /// Don't call this for loops. + void SetNextVertex(const b2Vec2& nextVertex); + + /// Implement b2Shape. Vertices are cloned using b2Alloc. + b2Shape* Clone(b2BlockAllocator* allocator) const; + + /// @see b2Shape::GetChildCount + int32 GetChildCount() const; + + /// Get a child edge. + void GetChildEdge(b2EdgeShape* edge, int32 index) const; + + /// This always return false. + /// @see b2Shape::TestPoint + bool TestPoint(const b2Transform& transform, const b2Vec2& p) const; + + /// Implement b2Shape. + bool RayCast(b2RayCastOutput* output, const b2RayCastInput& input, + const b2Transform& transform, int32 childIndex) const; + + /// @see b2Shape::ComputeAABB + void ComputeAABB(b2AABB* aabb, const b2Transform& transform, int32 childIndex) const; + + /// Chains have zero mass. + /// @see b2Shape::ComputeMass + void ComputeMass(b2MassData* massData, float32 density) const; + + /// The vertices. Owned by this class. + b2Vec2* m_vertices; + + /// The vertex count. + int32 m_count; + + b2Vec2 m_prevVertex, m_nextVertex; + bool m_hasPrevVertex, m_hasNextVertex; +}; + +inline b2ChainShape::b2ChainShape() +{ + m_type = e_chain; + m_radius = b2_polygonRadius; + m_vertices = NULL; + m_count = 0; + m_hasPrevVertex = NULL; + m_hasNextVertex = NULL; +} + +#endif diff --git a/src/Box2D/Collision/Shapes/b2CircleShape.cpp b/external/Box2d/Box2D/Collision/Shapes/b2CircleShape.cpp similarity index 100% rename from src/Box2D/Collision/Shapes/b2CircleShape.cpp rename to external/Box2d/Box2D/Collision/Shapes/b2CircleShape.cpp diff --git a/external/Box2d/Box2D/Collision/Shapes/b2CircleShape.h b/external/Box2d/Box2D/Collision/Shapes/b2CircleShape.h new file mode 100644 index 0000000..6c1fd54 --- /dev/null +++ b/external/Box2d/Box2D/Collision/Shapes/b2CircleShape.h @@ -0,0 +1,91 @@ +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_CIRCLE_SHAPE_H +#define B2_CIRCLE_SHAPE_H + +#include + +/// A circle shape. +class b2CircleShape : public b2Shape +{ +public: + b2CircleShape(); + + /// Implement b2Shape. + b2Shape* Clone(b2BlockAllocator* allocator) const; + + /// @see b2Shape::GetChildCount + int32 GetChildCount() const; + + /// Implement b2Shape. + bool TestPoint(const b2Transform& transform, const b2Vec2& p) const; + + /// Implement b2Shape. + bool RayCast(b2RayCastOutput* output, const b2RayCastInput& input, + const b2Transform& transform, int32 childIndex) const; + + /// @see b2Shape::ComputeAABB + void ComputeAABB(b2AABB* aabb, const b2Transform& transform, int32 childIndex) const; + + /// @see b2Shape::ComputeMass + void ComputeMass(b2MassData* massData, float32 density) const; + + /// Get the supporting vertex index in the given direction. + int32 GetSupport(const b2Vec2& d) const; + + /// Get the supporting vertex in the given direction. + const b2Vec2& GetSupportVertex(const b2Vec2& d) const; + + /// Get the vertex count. + int32 GetVertexCount() const { return 1; } + + /// Get a vertex by index. Used by b2Distance. + const b2Vec2& GetVertex(int32 index) const; + + /// Position + b2Vec2 m_p; +}; + +inline b2CircleShape::b2CircleShape() +{ + m_type = e_circle; + m_radius = 0.0f; + m_p.SetZero(); +} + +inline int32 b2CircleShape::GetSupport(const b2Vec2 &d) const +{ + B2_NOT_USED(d); + return 0; +} + +inline const b2Vec2& b2CircleShape::GetSupportVertex(const b2Vec2 &d) const +{ + B2_NOT_USED(d); + return m_p; +} + +inline const b2Vec2& b2CircleShape::GetVertex(int32 index) const +{ + B2_NOT_USED(index); + b2Assert(index == 0); + return m_p; +} + +#endif diff --git a/src/Box2D/Collision/Shapes/b2EdgeShape.cpp b/external/Box2d/Box2D/Collision/Shapes/b2EdgeShape.cpp similarity index 100% rename from src/Box2D/Collision/Shapes/b2EdgeShape.cpp rename to external/Box2d/Box2D/Collision/Shapes/b2EdgeShape.cpp diff --git a/external/Box2d/Box2D/Collision/Shapes/b2EdgeShape.h b/external/Box2d/Box2D/Collision/Shapes/b2EdgeShape.h new file mode 100644 index 0000000..6107b06 --- /dev/null +++ b/external/Box2d/Box2D/Collision/Shapes/b2EdgeShape.h @@ -0,0 +1,74 @@ +/* +* Copyright (c) 2006-2010 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_EDGE_SHAPE_H +#define B2_EDGE_SHAPE_H + +#include + +/// A line segment (edge) shape. These can be connected in chains or loops +/// to other edge shapes. The connectivity information is used to ensure +/// correct contact normals. +class b2EdgeShape : public b2Shape +{ +public: + b2EdgeShape(); + + /// Set this as an isolated edge. + void Set(const b2Vec2& v1, const b2Vec2& v2); + + /// Implement b2Shape. + b2Shape* Clone(b2BlockAllocator* allocator) const; + + /// @see b2Shape::GetChildCount + int32 GetChildCount() const; + + /// @see b2Shape::TestPoint + bool TestPoint(const b2Transform& transform, const b2Vec2& p) const; + + /// Implement b2Shape. + bool RayCast(b2RayCastOutput* output, const b2RayCastInput& input, + const b2Transform& transform, int32 childIndex) const; + + /// @see b2Shape::ComputeAABB + void ComputeAABB(b2AABB* aabb, const b2Transform& transform, int32 childIndex) const; + + /// @see b2Shape::ComputeMass + void ComputeMass(b2MassData* massData, float32 density) const; + + /// These are the edge vertices + b2Vec2 m_vertex1, m_vertex2; + + /// Optional adjacent vertices. These are used for smooth collision. + b2Vec2 m_vertex0, m_vertex3; + bool m_hasVertex0, m_hasVertex3; +}; + +inline b2EdgeShape::b2EdgeShape() +{ + m_type = e_edge; + m_radius = b2_polygonRadius; + m_vertex0.x = 0.0f; + m_vertex0.y = 0.0f; + m_vertex3.x = 0.0f; + m_vertex3.y = 0.0f; + m_hasVertex0 = false; + m_hasVertex3 = false; +} + +#endif diff --git a/src/Box2D/Collision/Shapes/b2PolygonShape.cpp b/external/Box2d/Box2D/Collision/Shapes/b2PolygonShape.cpp similarity index 77% rename from src/Box2D/Collision/Shapes/b2PolygonShape.cpp rename to external/Box2d/Box2D/Collision/Shapes/b2PolygonShape.cpp index 09b1e55..67627d3 100644 --- a/src/Box2D/Collision/Shapes/b2PolygonShape.cpp +++ b/external/Box2d/Box2D/Collision/Shapes/b2PolygonShape.cpp @@ -29,7 +29,7 @@ b2Shape* b2PolygonShape::Clone(b2BlockAllocator* allocator) const void b2PolygonShape::SetAsBox(float32 hx, float32 hy) { - m_count = 4; + m_vertexCount = 4; m_vertices[0].Set(-hx, -hy); m_vertices[1].Set( hx, -hy); m_vertices[2].Set( hx, hy); @@ -43,7 +43,7 @@ void b2PolygonShape::SetAsBox(float32 hx, float32 hy) void b2PolygonShape::SetAsBox(float32 hx, float32 hy, const b2Vec2& center, float32 angle) { - m_count = 4; + m_vertexCount = 4; m_vertices[0].Set(-hx, -hy); m_vertices[1].Set( hx, -hy); m_vertices[2].Set( hx, hy); @@ -59,7 +59,7 @@ void b2PolygonShape::SetAsBox(float32 hx, float32 hy, const b2Vec2& center, floa xf.q.Set(angle); // Transform vertices and normals. - for (int32 i = 0; i < m_count; ++i) + for (int32 i = 0; i < m_vertexCount; ++i) { m_vertices[i] = b2Mul(xf, m_vertices[i]); m_normals[i] = b2Mul(xf.q, m_normals[i]); @@ -120,106 +120,61 @@ static b2Vec2 ComputeCentroid(const b2Vec2* vs, int32 count) void b2PolygonShape::Set(const b2Vec2* vertices, int32 count) { b2Assert(3 <= count && count <= b2_maxPolygonVertices); - if (count < 3) - { - SetAsBox(1.0f, 1.0f); - return; - } - - int32 n = b2Min(count, b2_maxPolygonVertices); + m_vertexCount = count; - // Copy vertices into local buffer - b2Vec2 ps[b2_maxPolygonVertices]; - for (int32 i = 0; i < n; ++i) + // Copy vertices. + for (int32 i = 0; i < m_vertexCount; ++i) { - ps[i] = vertices[i]; + m_vertices[i] = vertices[i]; } - // Create the convex hull using the Gift wrapping algorithm - // http://en.wikipedia.org/wiki/Gift_wrapping_algorithm - - // Find the right most point on the hull - int32 i0 = 0; - float32 x0 = ps[0].x; - for (int32 i = 1; i < count; ++i) + // Compute normals. Ensure the edges have non-zero length. + for (int32 i = 0; i < m_vertexCount; ++i) { - float32 x = ps[i].x; - if (x > x0 || (x == x0 && ps[i].y < ps[i0].y)) - { - i0 = i; - x0 = x; - } + int32 i1 = i; + int32 i2 = i + 1 < m_vertexCount ? i + 1 : 0; + b2Vec2 edge = m_vertices[i2] - m_vertices[i1]; + b2Assert(edge.LengthSquared() > b2_epsilon * b2_epsilon); + m_normals[i] = b2Cross(edge, 1.0f); + m_normals[i].Normalize(); } - int32 hull[b2_maxPolygonVertices]; - int32 m = 0; - int32 ih = i0; - - for (;;) +#ifdef _DEBUG + // Ensure the polygon is convex and the interior + // is to the left of each edge. + for (int32 i = 0; i < m_vertexCount; ++i) { - hull[m] = ih; + int32 i1 = i; + int32 i2 = i + 1 < m_vertexCount ? i + 1 : 0; + b2Vec2 edge = m_vertices[i2] - m_vertices[i1]; - int32 ie = 0; - for (int32 j = 1; j < n; ++j) + for (int32 j = 0; j < m_vertexCount; ++j) { - if (ie == ih) + // Don't check vertices on the current edge. + if (j == i1 || j == i2) { - ie = j; continue; } - b2Vec2 r = ps[ie] - ps[hull[m]]; - b2Vec2 v = ps[j] - ps[hull[m]]; - float32 c = b2Cross(r, v); - if (c < 0.0f) - { - ie = j; - } + b2Vec2 r = m_vertices[j] - m_vertices[i1]; - // Collinearity check - if (c == 0.0f && v.LengthSquared() > r.LengthSquared()) - { - ie = j; - } - } - - ++m; - ih = ie; - - if (ie == i0) - { - break; + // If this crashes, your polygon is non-convex, has colinear edges, + // or the winding order is wrong. + float32 s = b2Cross(edge, r); + b2Assert(s > 0.0f && "ERROR: Please ensure your polygon is convex and has a CCW winding order"); } } - - m_count = m; - - // Copy vertices. - for (int32 i = 0; i < m; ++i) - { - m_vertices[i] = ps[hull[i]]; - } - - // Compute normals. Ensure the edges have non-zero length. - for (int32 i = 0; i < m; ++i) - { - int32 i1 = i; - int32 i2 = i + 1 < m ? i + 1 : 0; - b2Vec2 edge = m_vertices[i2] - m_vertices[i1]; - b2Assert(edge.LengthSquared() > b2_epsilon * b2_epsilon); - m_normals[i] = b2Cross(edge, 1.0f); - m_normals[i].Normalize(); - } +#endif // Compute the polygon centroid. - m_centroid = ComputeCentroid(m_vertices, m); + m_centroid = ComputeCentroid(m_vertices, m_vertexCount); } bool b2PolygonShape::TestPoint(const b2Transform& xf, const b2Vec2& p) const { b2Vec2 pLocal = b2MulT(xf.q, p - xf.p); - for (int32 i = 0; i < m_count; ++i) + for (int32 i = 0; i < m_vertexCount; ++i) { float32 dot = b2Dot(m_normals[i], pLocal - m_vertices[i]); if (dot > 0.0f) @@ -245,7 +200,7 @@ bool b2PolygonShape::RayCast(b2RayCastOutput* output, const b2RayCastInput& inpu int32 index = -1; - for (int32 i = 0; i < m_count; ++i) + for (int32 i = 0; i < m_vertexCount; ++i) { // p = p1 + a * d // dot(normal, p - v) = 0 @@ -254,7 +209,7 @@ bool b2PolygonShape::RayCast(b2RayCastOutput* output, const b2RayCastInput& inpu float32 denominator = b2Dot(m_normals[i], d); if (denominator == 0.0f) - { + { if (numerator < 0.0f) { return false; @@ -310,7 +265,7 @@ void b2PolygonShape::ComputeAABB(b2AABB* aabb, const b2Transform& xf, int32 chil b2Vec2 lower = b2Mul(xf, m_vertices[0]); b2Vec2 upper = lower; - for (int32 i = 1; i < m_count; ++i) + for (int32 i = 1; i < m_vertexCount; ++i) { b2Vec2 v = b2Mul(xf, m_vertices[i]); lower = b2Min(lower, v); @@ -348,7 +303,7 @@ void b2PolygonShape::ComputeMass(b2MassData* massData, float32 density) const // // The rest of the derivation is handled by computer algebra. - b2Assert(m_count >= 3); + b2Assert(m_vertexCount >= 3); b2Vec2 center; center.Set(0.0f, 0.0f); float32 area = 0.0f; @@ -359,19 +314,19 @@ void b2PolygonShape::ComputeMass(b2MassData* massData, float32 density) const b2Vec2 s(0.0f, 0.0f); // This code would put the reference point inside the polygon. - for (int32 i = 0; i < m_count; ++i) + for (int32 i = 0; i < m_vertexCount; ++i) { s += m_vertices[i]; } - s *= 1.0f / m_count; + s *= 1.0f / m_vertexCount; const float32 k_inv3 = 1.0f / 3.0f; - for (int32 i = 0; i < m_count; ++i) + for (int32 i = 0; i < m_vertexCount; ++i) { // Triangle vertices. b2Vec2 e1 = m_vertices[i] - s; - b2Vec2 e2 = i + 1 < m_count ? m_vertices[i+1] - s : m_vertices[0] - s; + b2Vec2 e2 = i + 1 < m_vertexCount ? m_vertices[i+1] - s : m_vertices[0] - s; float32 D = b2Cross(e1, e2); @@ -400,35 +355,7 @@ void b2PolygonShape::ComputeMass(b2MassData* massData, float32 density) const // Inertia tensor relative to the local origin (point s). massData->I = density * I; - + // Shift to center of mass then to original body origin. massData->I += massData->mass * (b2Dot(massData->center, massData->center) - b2Dot(center, center)); } - -bool b2PolygonShape::Validate() const -{ - for (int32 i = 0; i < m_count; ++i) - { - int32 i1 = i; - int32 i2 = i < m_count - 1 ? i1 + 1 : 0; - b2Vec2 p = m_vertices[i1]; - b2Vec2 e = m_vertices[i2] - p; - - for (int32 j = 0; j < m_count; ++j) - { - if (j == i1 || j == i2) - { - continue; - } - - b2Vec2 v = m_vertices[j] - p; - float32 c = b2Cross(e, v); - if (c < 0.0f) - { - return false; - } - } - } - - return true; -} diff --git a/external/Box2d/Box2D/Collision/Shapes/b2PolygonShape.h b/external/Box2d/Box2D/Collision/Shapes/b2PolygonShape.h new file mode 100644 index 0000000..fd11bd1 --- /dev/null +++ b/external/Box2d/Box2D/Collision/Shapes/b2PolygonShape.h @@ -0,0 +1,95 @@ +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_POLYGON_SHAPE_H +#define B2_POLYGON_SHAPE_H + +#include + +/// A convex polygon. It is assumed that the interior of the polygon is to +/// the left of each edge. +/// Polygons have a maximum number of vertices equal to b2_maxPolygonVertices. +/// In most cases you should not need many vertices for a convex polygon. +class b2PolygonShape : public b2Shape +{ +public: + b2PolygonShape(); + + /// Implement b2Shape. + b2Shape* Clone(b2BlockAllocator* allocator) const; + + /// @see b2Shape::GetChildCount + int32 GetChildCount() const; + + /// Copy vertices. This assumes the vertices define a convex polygon. + /// It is assumed that the exterior is the the right of each edge. + /// The count must be in the range [3, b2_maxPolygonVertices]. + void Set(const b2Vec2* vertices, int32 vertexCount); + + /// Build vertices to represent an axis-aligned box. + /// @param hx the half-width. + /// @param hy the half-height. + void SetAsBox(float32 hx, float32 hy); + + /// Build vertices to represent an oriented box. + /// @param hx the half-width. + /// @param hy the half-height. + /// @param center the center of the box in local coordinates. + /// @param angle the rotation of the box in local coordinates. + void SetAsBox(float32 hx, float32 hy, const b2Vec2& center, float32 angle); + + /// @see b2Shape::TestPoint + bool TestPoint(const b2Transform& transform, const b2Vec2& p) const; + + /// Implement b2Shape. + bool RayCast(b2RayCastOutput* output, const b2RayCastInput& input, + const b2Transform& transform, int32 childIndex) const; + + /// @see b2Shape::ComputeAABB + void ComputeAABB(b2AABB* aabb, const b2Transform& transform, int32 childIndex) const; + + /// @see b2Shape::ComputeMass + void ComputeMass(b2MassData* massData, float32 density) const; + + /// Get the vertex count. + int32 GetVertexCount() const { return m_vertexCount; } + + /// Get a vertex by index. + const b2Vec2& GetVertex(int32 index) const; + + b2Vec2 m_centroid; + b2Vec2 m_vertices[b2_maxPolygonVertices]; + b2Vec2 m_normals[b2_maxPolygonVertices]; + int32 m_vertexCount; +}; + +inline b2PolygonShape::b2PolygonShape() +{ + m_type = e_polygon; + m_radius = b2_polygonRadius; + m_vertexCount = 0; + m_centroid.SetZero(); +} + +inline const b2Vec2& b2PolygonShape::GetVertex(int32 index) const +{ + b2Assert(0 <= index && index < m_vertexCount); + return m_vertices[index]; +} + +#endif diff --git a/external/Box2d/Box2D/Collision/Shapes/b2Shape.h b/external/Box2d/Box2D/Collision/Shapes/b2Shape.h new file mode 100644 index 0000000..f37850d --- /dev/null +++ b/external/Box2d/Box2D/Collision/Shapes/b2Shape.h @@ -0,0 +1,101 @@ +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_SHAPE_H +#define B2_SHAPE_H + +#include +#include +#include + +/// This holds the mass data computed for a shape. +struct b2MassData +{ + /// The mass of the shape, usually in kilograms. + float32 mass; + + /// The position of the shape's centroid relative to the shape's origin. + b2Vec2 center; + + /// The rotational inertia of the shape about the local origin. + float32 I; +}; + +/// A shape is used for collision detection. You can create a shape however you like. +/// Shapes used for simulation in b2World are created automatically when a b2Fixture +/// is created. Shapes may encapsulate a one or more child shapes. +class b2Shape +{ +public: + + enum Type + { + e_circle = 0, + e_edge = 1, + e_polygon = 2, + e_chain = 3, + e_typeCount = 4 + }; + + virtual ~b2Shape() {} + + /// Clone the concrete shape using the provided allocator. + virtual b2Shape* Clone(b2BlockAllocator* allocator) const = 0; + + /// Get the type of this shape. You can use this to down cast to the concrete shape. + /// @return the shape type. + Type GetType() const; + + /// Get the number of child primitives. + virtual int32 GetChildCount() const = 0; + + /// Test a point for containment in this shape. This only works for convex shapes. + /// @param xf the shape world transform. + /// @param p a point in world coordinates. + virtual bool TestPoint(const b2Transform& xf, const b2Vec2& p) const = 0; + + /// Cast a ray against a child shape. + /// @param output the ray-cast results. + /// @param input the ray-cast input parameters. + /// @param transform the transform to be applied to the shape. + /// @param childIndex the child shape index + virtual bool RayCast(b2RayCastOutput* output, const b2RayCastInput& input, + const b2Transform& transform, int32 childIndex) const = 0; + + /// Given a transform, compute the associated axis aligned bounding box for a child shape. + /// @param aabb returns the axis aligned box. + /// @param xf the world transform of the shape. + /// @param childIndex the child shape + virtual void ComputeAABB(b2AABB* aabb, const b2Transform& xf, int32 childIndex) const = 0; + + /// Compute the mass properties of this shape using its dimensions and density. + /// The inertia tensor is computed about the local origin. + /// @param massData returns the mass data for this shape. + /// @param density the density in kilograms per meter squared. + virtual void ComputeMass(b2MassData* massData, float32 density) const = 0; + + Type m_type; + float32 m_radius; +}; + +inline b2Shape::Type b2Shape::GetType() const +{ + return m_type; +} + +#endif diff --git a/src/Box2D/Collision/b2BroadPhase.cpp b/external/Box2d/Box2D/Collision/b2BroadPhase.cpp similarity index 95% rename from src/Box2D/Collision/b2BroadPhase.cpp rename to external/Box2d/Box2D/Collision/b2BroadPhase.cpp index 7a2b0d6..2aa62f9 100644 --- a/src/Box2D/Collision/b2BroadPhase.cpp +++ b/external/Box2d/Box2D/Collision/b2BroadPhase.cpp @@ -90,6 +90,7 @@ void b2BroadPhase::UnBufferMove(int32 proxyId) if (m_moveBuffer[i] == proxyId) { m_moveBuffer[i] = e_nullProxy; + return; } } } diff --git a/external/Box2d/Box2D/Collision/b2BroadPhase.h b/external/Box2d/Box2D/Collision/b2BroadPhase.h new file mode 100644 index 0000000..c7398c9 --- /dev/null +++ b/external/Box2d/Box2D/Collision/b2BroadPhase.h @@ -0,0 +1,248 @@ +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_BROAD_PHASE_H +#define B2_BROAD_PHASE_H + +#include +#include +#include +#include + +struct b2Pair +{ + int32 proxyIdA; + int32 proxyIdB; + int32 next; +}; + +/// The broad-phase is used for computing pairs and performing volume queries and ray casts. +/// This broad-phase does not persist pairs. Instead, this reports potentially new pairs. +/// It is up to the client to consume the new pairs and to track subsequent overlap. +class b2BroadPhase +{ +public: + + enum + { + e_nullProxy = -1 + }; + + b2BroadPhase(); + ~b2BroadPhase(); + + /// Create a proxy with an initial AABB. Pairs are not reported until + /// UpdatePairs is called. + int32 CreateProxy(const b2AABB& aabb, void* userData); + + /// Destroy a proxy. It is up to the client to remove any pairs. + void DestroyProxy(int32 proxyId); + + /// Call MoveProxy as many times as you like, then when you are done + /// call UpdatePairs to finalized the proxy pairs (for your time step). + void MoveProxy(int32 proxyId, const b2AABB& aabb, const b2Vec2& displacement); + + /// Call to trigger a re-processing of it's pairs on the next call to UpdatePairs. + void TouchProxy(int32 proxyId); + + /// Get the fat AABB for a proxy. + const b2AABB& GetFatAABB(int32 proxyId) const; + + /// Get user data from a proxy. Returns NULL if the id is invalid. + void* GetUserData(int32 proxyId) const; + + /// Test overlap of fat AABBs. + bool TestOverlap(int32 proxyIdA, int32 proxyIdB) const; + + /// Get the number of proxies. + int32 GetProxyCount() const; + + /// Update the pairs. This results in pair callbacks. This can only add pairs. + template + void UpdatePairs(T* callback); + + /// Query an AABB for overlapping proxies. The callback class + /// is called for each proxy that overlaps the supplied AABB. + template + void Query(T* callback, const b2AABB& aabb) const; + + /// Ray-cast against the proxies in the tree. This relies on the callback + /// to perform a exact ray-cast in the case were the proxy contains a shape. + /// The callback also performs the any collision filtering. This has performance + /// roughly equal to k * log(n), where k is the number of collisions and n is the + /// number of proxies in the tree. + /// @param input the ray-cast input data. The ray extends from p1 to p1 + maxFraction * (p2 - p1). + /// @param callback a callback class that is called for each proxy that is hit by the ray. + template + void RayCast(T* callback, const b2RayCastInput& input) const; + + /// Get the height of the embedded tree. + int32 GetTreeHeight() const; + + /// Get the balance of the embedded tree. + int32 GetTreeBalance() const; + + /// Get the quality metric of the embedded tree. + float32 GetTreeQuality() const; + +private: + + friend class b2DynamicTree; + + void BufferMove(int32 proxyId); + void UnBufferMove(int32 proxyId); + + bool QueryCallback(int32 proxyId); + + b2DynamicTree m_tree; + + int32 m_proxyCount; + + int32* m_moveBuffer; + int32 m_moveCapacity; + int32 m_moveCount; + + b2Pair* m_pairBuffer; + int32 m_pairCapacity; + int32 m_pairCount; + + int32 m_queryProxyId; +}; + +/// This is used to sort pairs. +inline bool b2PairLessThan(const b2Pair& pair1, const b2Pair& pair2) +{ + if (pair1.proxyIdA < pair2.proxyIdA) + { + return true; + } + + if (pair1.proxyIdA == pair2.proxyIdA) + { + return pair1.proxyIdB < pair2.proxyIdB; + } + + return false; +} + +inline void* b2BroadPhase::GetUserData(int32 proxyId) const +{ + return m_tree.GetUserData(proxyId); +} + +inline bool b2BroadPhase::TestOverlap(int32 proxyIdA, int32 proxyIdB) const +{ + const b2AABB& aabbA = m_tree.GetFatAABB(proxyIdA); + const b2AABB& aabbB = m_tree.GetFatAABB(proxyIdB); + return b2TestOverlap(aabbA, aabbB); +} + +inline const b2AABB& b2BroadPhase::GetFatAABB(int32 proxyId) const +{ + return m_tree.GetFatAABB(proxyId); +} + +inline int32 b2BroadPhase::GetProxyCount() const +{ + return m_proxyCount; +} + +inline int32 b2BroadPhase::GetTreeHeight() const +{ + return m_tree.GetHeight(); +} + +inline int32 b2BroadPhase::GetTreeBalance() const +{ + return m_tree.GetMaxBalance(); +} + +inline float32 b2BroadPhase::GetTreeQuality() const +{ + return m_tree.GetAreaRatio(); +} + +template +void b2BroadPhase::UpdatePairs(T* callback) +{ + // Reset pair buffer + m_pairCount = 0; + + // Perform tree queries for all moving proxies. + for (int32 i = 0; i < m_moveCount; ++i) + { + m_queryProxyId = m_moveBuffer[i]; + if (m_queryProxyId == e_nullProxy) + { + continue; + } + + // We have to query the tree with the fat AABB so that + // we don't fail to create a pair that may touch later. + const b2AABB& fatAABB = m_tree.GetFatAABB(m_queryProxyId); + + // Query tree, create pairs and add them pair buffer. + m_tree.Query(this, fatAABB); + } + + // Reset move buffer + m_moveCount = 0; + + // Sort the pair buffer to expose duplicates. + std::sort(m_pairBuffer, m_pairBuffer + m_pairCount, b2PairLessThan); + + // Send the pairs back to the client. + int32 i = 0; + while (i < m_pairCount) + { + b2Pair* primaryPair = m_pairBuffer + i; + void* userDataA = m_tree.GetUserData(primaryPair->proxyIdA); + void* userDataB = m_tree.GetUserData(primaryPair->proxyIdB); + + callback->AddPair(userDataA, userDataB); + ++i; + + // Skip any duplicate pairs. + while (i < m_pairCount) + { + b2Pair* pair = m_pairBuffer + i; + if (pair->proxyIdA != primaryPair->proxyIdA || pair->proxyIdB != primaryPair->proxyIdB) + { + break; + } + ++i; + } + } + + // Try to keep the tree balanced. + //m_tree.Rebalance(4); +} + +template +inline void b2BroadPhase::Query(T* callback, const b2AABB& aabb) const +{ + m_tree.Query(callback, aabb); +} + +template +inline void b2BroadPhase::RayCast(T* callback, const b2RayCastInput& input) const +{ + m_tree.RayCast(callback, input); +} + +#endif diff --git a/src/Box2D/Collision/b2CollideCircle.cpp b/external/Box2d/Box2D/Collision/b2CollideCircle.cpp similarity index 95% rename from src/Box2D/Collision/b2CollideCircle.cpp rename to external/Box2d/Box2D/Collision/b2CollideCircle.cpp index e60b208..0ad58f0 100644 --- a/src/Box2D/Collision/b2CollideCircle.cpp +++ b/external/Box2d/Box2D/Collision/b2CollideCircle.cpp @@ -63,7 +63,7 @@ void b2CollidePolygonAndCircle( int32 normalIndex = 0; float32 separation = -b2_maxFloat; float32 radius = polygonA->m_radius + circleB->m_radius; - int32 vertexCount = polygonA->m_count; + int32 vertexCount = polygonA->m_vertexCount; const b2Vec2* vertices = polygonA->m_vertices; const b2Vec2* normals = polygonA->m_normals; diff --git a/src/Box2D/Collision/b2CollideEdge.cpp b/external/Box2d/Box2D/Collision/b2CollideEdge.cpp similarity index 93% rename from src/Box2D/Collision/b2CollideEdge.cpp rename to external/Box2d/Box2D/Collision/b2CollideEdge.cpp index 3f5fa37..8e4a7eb 100644 --- a/src/Box2D/Collision/b2CollideEdge.cpp +++ b/external/Box2d/Box2D/Collision/b2CollideEdge.cpp @@ -29,23 +29,23 @@ void b2CollideEdgeAndCircle(b2Manifold* manifold, const b2CircleShape* circleB, const b2Transform& xfB) { manifold->pointCount = 0; - + // Compute circle in frame of edge b2Vec2 Q = b2MulT(xfA, b2Mul(xfB, circleB->m_p)); - + b2Vec2 A = edgeA->m_vertex1, B = edgeA->m_vertex2; b2Vec2 e = B - A; - + // Barycentric coordinates float32 u = b2Dot(e, B - Q); float32 v = b2Dot(e, Q - A); - + float32 radius = edgeA->m_radius + circleB->m_radius; - + b2ContactFeature cf; cf.indexB = 0; cf.typeB = b2ContactFeature::e_vertex; - + // Region A if (v <= 0.0f) { @@ -56,7 +56,7 @@ void b2CollideEdgeAndCircle(b2Manifold* manifold, { return; } - + // Is there an edge connected to A? if (edgeA->m_hasVertex0) { @@ -64,14 +64,14 @@ void b2CollideEdgeAndCircle(b2Manifold* manifold, b2Vec2 B1 = A; b2Vec2 e1 = B1 - A1; float32 u1 = b2Dot(e1, B1 - Q); - + // Is the circle in Region AB of the previous edge? if (u1 > 0.0f) { return; } } - + cf.indexA = 0; cf.typeA = b2ContactFeature::e_vertex; manifold->pointCount = 1; @@ -83,7 +83,7 @@ void b2CollideEdgeAndCircle(b2Manifold* manifold, manifold->points[0].localPoint = circleB->m_p; return; } - + // Region B if (u <= 0.0f) { @@ -94,7 +94,7 @@ void b2CollideEdgeAndCircle(b2Manifold* manifold, { return; } - + // Is there an edge connected to B? if (edgeA->m_hasVertex3) { @@ -102,14 +102,14 @@ void b2CollideEdgeAndCircle(b2Manifold* manifold, b2Vec2 A2 = B; b2Vec2 e2 = B2 - A2; float32 v2 = b2Dot(e2, Q - A2); - + // Is the circle in Region AB of the next edge? if (v2 > 0.0f) { return; } } - + cf.indexA = 1; cf.typeA = b2ContactFeature::e_vertex; manifold->pointCount = 1; @@ -121,7 +121,7 @@ void b2CollideEdgeAndCircle(b2Manifold* manifold, manifold->points[0].localPoint = circleB->m_p; return; } - + // Region AB float32 den = b2Dot(e, e); b2Assert(den > 0.0f); @@ -132,14 +132,14 @@ void b2CollideEdgeAndCircle(b2Manifold* manifold, { return; } - + b2Vec2 n(-e.y, e.x); if (b2Dot(n, Q - A) < 0.0f) { n.Set(-n.x, -n.y); } n.Normalize(); - + cf.indexA = 0; cf.typeA = b2ContactFeature::e_face; manifold->pointCount = 1; @@ -160,7 +160,7 @@ struct b2EPAxis e_edgeA, e_edgeB }; - + Type type; int32 index; float32 separation; @@ -178,14 +178,14 @@ struct b2TempPolygon struct b2ReferenceFace { int32 i1, i2; - + b2Vec2 v1, v2; - + b2Vec2 normal; - + b2Vec2 sideNormal1; float32 sideOffset1; - + b2Vec2 sideNormal2; float32 sideOffset2; }; @@ -197,16 +197,16 @@ struct b2EPCollider const b2PolygonShape* polygonB, const b2Transform& xfB); b2EPAxis ComputeEdgeSeparation(); b2EPAxis ComputePolygonSeparation(); - + enum VertexType { e_isolated, e_concave, e_convex }; - + b2TempPolygon m_polygonB; - + b2Transform m_xf; b2Vec2 m_centroidB; b2Vec2 m_v0, m_v1, m_v2, m_v3; @@ -231,24 +231,24 @@ void b2EPCollider::Collide(b2Manifold* manifold, const b2EdgeShape* edgeA, const const b2PolygonShape* polygonB, const b2Transform& xfB) { m_xf = b2MulT(xfA, xfB); - + m_centroidB = b2Mul(m_xf, polygonB->m_centroid); - + m_v0 = edgeA->m_vertex0; m_v1 = edgeA->m_vertex1; m_v2 = edgeA->m_vertex2; m_v3 = edgeA->m_vertex3; - + bool hasVertex0 = edgeA->m_hasVertex0; bool hasVertex3 = edgeA->m_hasVertex3; - + b2Vec2 edge1 = m_v2 - m_v1; edge1.Normalize(); m_normal1.Set(edge1.y, -edge1.x); float32 offset1 = b2Dot(m_normal1, m_centroidB - m_v1); float32 offset0 = 0.0f, offset2 = 0.0f; bool convex1 = false, convex2 = false; - + // Is there a preceding edge? if (hasVertex0) { @@ -258,7 +258,7 @@ void b2EPCollider::Collide(b2Manifold* manifold, const b2EdgeShape* edgeA, const convex1 = b2Cross(edge0, edge1) >= 0.0f; offset0 = b2Dot(m_normal0, m_centroidB - m_v0); } - + // Is there a following edge? if (hasVertex3) { @@ -268,7 +268,7 @@ void b2EPCollider::Collide(b2Manifold* manifold, const b2EdgeShape* edgeA, const convex2 = b2Cross(edge1, edge2) > 0.0f; offset2 = b2Dot(m_normal2, m_centroidB - m_v2); } - + // Determine front or back collision. Determine collision normal limits. if (hasVertex0 && hasVertex3) { @@ -405,7 +405,7 @@ void b2EPCollider::Collide(b2Manifold* manifold, const b2EdgeShape* edgeA, const m_lowerLimit = -m_normal2; m_upperLimit = m_normal1; } - } + } } else { @@ -423,42 +423,42 @@ void b2EPCollider::Collide(b2Manifold* manifold, const b2EdgeShape* edgeA, const m_upperLimit = m_normal1; } } - + // Get polygonB in frameA - m_polygonB.count = polygonB->m_count; - for (int32 i = 0; i < polygonB->m_count; ++i) + m_polygonB.count = polygonB->m_vertexCount; + for (int32 i = 0; i < polygonB->m_vertexCount; ++i) { m_polygonB.vertices[i] = b2Mul(m_xf, polygonB->m_vertices[i]); m_polygonB.normals[i] = b2Mul(m_xf.q, polygonB->m_normals[i]); } - + m_radius = 2.0f * b2_polygonRadius; - + manifold->pointCount = 0; - + b2EPAxis edgeAxis = ComputeEdgeSeparation(); - + // If no valid normal can be found than this edge should not collide. if (edgeAxis.type == b2EPAxis::e_unknown) { return; } - + if (edgeAxis.separation > m_radius) { return; } - + b2EPAxis polygonAxis = ComputePolygonSeparation(); if (polygonAxis.type != b2EPAxis::e_unknown && polygonAxis.separation > m_radius) { return; } - + // Use hysteresis for jitter reduction. const float32 k_relativeTol = 0.98f; const float32 k_absoluteTol = 0.001f; - + b2EPAxis primaryAxis; if (polygonAxis.type == b2EPAxis::e_unknown) { @@ -472,13 +472,13 @@ void b2EPCollider::Collide(b2Manifold* manifold, const b2EdgeShape* edgeA, const { primaryAxis = edgeAxis; } - + b2ClipVertex ie[2]; b2ReferenceFace rf; if (primaryAxis.type == b2EPAxis::e_edgeA) { manifold->type = b2Manifold::e_faceA; - + // Search for the polygon normal that is most anti-parallel to the edge normal. int32 bestIndex = 0; float32 bestValue = b2Dot(m_normal, m_polygonB.normals[0]); @@ -491,22 +491,22 @@ void b2EPCollider::Collide(b2Manifold* manifold, const b2EdgeShape* edgeA, const bestIndex = i; } } - + int32 i1 = bestIndex; int32 i2 = i1 + 1 < m_polygonB.count ? i1 + 1 : 0; - + ie[0].v = m_polygonB.vertices[i1]; ie[0].id.cf.indexA = 0; ie[0].id.cf.indexB = i1; ie[0].id.cf.typeA = b2ContactFeature::e_face; ie[0].id.cf.typeB = b2ContactFeature::e_vertex; - + ie[1].v = m_polygonB.vertices[i2]; ie[1].id.cf.indexA = 0; ie[1].id.cf.indexB = i2; ie[1].id.cf.typeA = b2ContactFeature::e_face; ie[1].id.cf.typeB = b2ContactFeature::e_vertex; - + if (m_front) { rf.i1 = 0; @@ -522,57 +522,57 @@ void b2EPCollider::Collide(b2Manifold* manifold, const b2EdgeShape* edgeA, const rf.v1 = m_v2; rf.v2 = m_v1; rf.normal = -m_normal1; - } + } } else { manifold->type = b2Manifold::e_faceB; - + ie[0].v = m_v1; ie[0].id.cf.indexA = 0; ie[0].id.cf.indexB = primaryAxis.index; ie[0].id.cf.typeA = b2ContactFeature::e_vertex; ie[0].id.cf.typeB = b2ContactFeature::e_face; - + ie[1].v = m_v2; ie[1].id.cf.indexA = 0; - ie[1].id.cf.indexB = primaryAxis.index; + ie[1].id.cf.indexB = primaryAxis.index; ie[1].id.cf.typeA = b2ContactFeature::e_vertex; ie[1].id.cf.typeB = b2ContactFeature::e_face; - + rf.i1 = primaryAxis.index; rf.i2 = rf.i1 + 1 < m_polygonB.count ? rf.i1 + 1 : 0; rf.v1 = m_polygonB.vertices[rf.i1]; rf.v2 = m_polygonB.vertices[rf.i2]; rf.normal = m_polygonB.normals[rf.i1]; } - + rf.sideNormal1.Set(rf.normal.y, -rf.normal.x); rf.sideNormal2 = -rf.sideNormal1; rf.sideOffset1 = b2Dot(rf.sideNormal1, rf.v1); rf.sideOffset2 = b2Dot(rf.sideNormal2, rf.v2); - + // Clip incident edge against extruded edge1 side edges. b2ClipVertex clipPoints1[2]; b2ClipVertex clipPoints2[2]; int32 np; - + // Clip to box side 1 np = b2ClipSegmentToLine(clipPoints1, ie, rf.sideNormal1, rf.sideOffset1, rf.i1); - + if (np < b2_maxManifoldPoints) { return; } - + // Clip to negative box side 1 np = b2ClipSegmentToLine(clipPoints2, clipPoints1, rf.sideNormal2, rf.sideOffset2, rf.i2); - + if (np < b2_maxManifoldPoints) { return; } - + // Now clipPoints2 contains the clipped points. if (primaryAxis.type == b2EPAxis::e_edgeA) { @@ -584,18 +584,18 @@ void b2EPCollider::Collide(b2Manifold* manifold, const b2EdgeShape* edgeA, const manifold->localNormal = polygonB->m_normals[rf.i1]; manifold->localPoint = polygonB->m_vertices[rf.i1]; } - + int32 pointCount = 0; for (int32 i = 0; i < b2_maxManifoldPoints; ++i) { float32 separation; - + separation = b2Dot(rf.normal, clipPoints2[i].v - rf.v1); - + if (separation <= m_radius) { b2ManifoldPoint* cp = manifold->points + pointCount; - + if (primaryAxis.type == b2EPAxis::e_edgeA) { cp->localPoint = b2MulT(m_xf, clipPoints2[i].v); @@ -609,11 +609,11 @@ void b2EPCollider::Collide(b2Manifold* manifold, const b2EdgeShape* edgeA, const cp->id.cf.indexA = clipPoints2[i].id.cf.indexB; cp->id.cf.indexB = clipPoints2[i].id.cf.indexA; } - + ++pointCount; } } - + manifold->pointCount = pointCount; } @@ -623,7 +623,7 @@ b2EPAxis b2EPCollider::ComputeEdgeSeparation() axis.type = b2EPAxis::e_edgeA; axis.index = m_front ? 0 : 1; axis.separation = FLT_MAX; - + for (int32 i = 0; i < m_polygonB.count; ++i) { float32 s = b2Dot(m_normal, m_polygonB.vertices[i] - m_v1); @@ -632,7 +632,7 @@ b2EPAxis b2EPCollider::ComputeEdgeSeparation() axis.separation = s; } } - + return axis; } @@ -648,11 +648,11 @@ b2EPAxis b2EPCollider::ComputePolygonSeparation() for (int32 i = 0; i < m_polygonB.count; ++i) { b2Vec2 n = -m_polygonB.normals[i]; - + float32 s1 = b2Dot(n, m_polygonB.vertices[i] - m_v1); float32 s2 = b2Dot(n, m_polygonB.vertices[i] - m_v2); float32 s = b2Min(s1, s2); - + if (s > m_radius) { // No collision @@ -661,7 +661,7 @@ b2EPAxis b2EPCollider::ComputePolygonSeparation() axis.separation = s; return axis; } - + // Adjacency if (b2Dot(n, perp) >= 0.0f) { @@ -677,7 +677,7 @@ b2EPAxis b2EPCollider::ComputePolygonSeparation() continue; } } - + if (s > axis.separation) { axis.type = b2EPAxis::e_edgeB; @@ -685,7 +685,7 @@ b2EPAxis b2EPCollider::ComputePolygonSeparation() axis.separation = s; } } - + return axis; } diff --git a/src/Box2D/Collision/b2CollidePolygon.cpp b/external/Box2d/Box2D/Collision/b2CollidePolygon.cpp similarity index 93% rename from src/Box2D/Collision/b2CollidePolygon.cpp rename to external/Box2d/Box2D/Collision/b2CollidePolygon.cpp index 8965c4f..7485591 100644 --- a/src/Box2D/Collision/b2CollidePolygon.cpp +++ b/external/Box2d/Box2D/Collision/b2CollidePolygon.cpp @@ -26,10 +26,10 @@ static float32 b2EdgeSeparation(const b2PolygonShape* poly1, const b2Transform& const b2Vec2* vertices1 = poly1->m_vertices; const b2Vec2* normals1 = poly1->m_normals; - int32 count2 = poly2->m_count; + int32 count2 = poly2->m_vertexCount; const b2Vec2* vertices2 = poly2->m_vertices; - b2Assert(0 <= edge1 && edge1 < poly1->m_count); + b2Assert(0 <= edge1 && edge1 < poly1->m_vertexCount); // Convert normal from poly1's frame into poly2's frame. b2Vec2 normal1World = b2Mul(xf1.q, normals1[edge1]); @@ -60,7 +60,7 @@ static float32 b2FindMaxSeparation(int32* edgeIndex, const b2PolygonShape* poly1, const b2Transform& xf1, const b2PolygonShape* poly2, const b2Transform& xf2) { - int32 count1 = poly1->m_count; + int32 count1 = poly1->m_vertexCount; const b2Vec2* normals1 = poly1->m_normals; // Vector pointing from the centroid of poly1 to the centroid of poly2. @@ -144,11 +144,11 @@ static void b2FindIncidentEdge(b2ClipVertex c[2], { const b2Vec2* normals1 = poly1->m_normals; - int32 count2 = poly2->m_count; + int32 count2 = poly2->m_vertexCount; const b2Vec2* vertices2 = poly2->m_vertices; const b2Vec2* normals2 = poly2->m_normals; - b2Assert(0 <= edge1 && edge1 < poly1->m_count); + b2Assert(0 <= edge1 && edge1 < poly1->m_vertexCount); // Get the normal of the reference edge in poly2's frame. b2Vec2 normal1 = b2MulT(xf2.q, b2Mul(xf1.q, normals1[edge1])); @@ -239,7 +239,7 @@ void b2CollidePolygons(b2Manifold* manifold, b2ClipVertex incidentEdge[2]; b2FindIncidentEdge(incidentEdge, poly1, xf1, edge1, poly2, xf2); - int32 count1 = poly1->m_count; + int32 count1 = poly1->m_vertexCount; const b2Vec2* vertices1 = poly1->m_vertices; int32 iv1 = edge1; @@ -250,13 +250,13 @@ void b2CollidePolygons(b2Manifold* manifold, b2Vec2 localTangent = v12 - v11; localTangent.Normalize(); - + b2Vec2 localNormal = b2Cross(localTangent, 1.0f); b2Vec2 planePoint = 0.5f * (v11 + v12); b2Vec2 tangent = b2Mul(xf1.q, localTangent); b2Vec2 normal = b2Cross(tangent, 1.0f); - + v11 = b2Mul(xf1, v11); v12 = b2Mul(xf1, v12); diff --git a/src/Box2D/Collision/b2Collision.cpp b/external/Box2d/Box2D/Collision/b2Collision.cpp similarity index 96% rename from src/Box2D/Collision/b2Collision.cpp rename to external/Box2d/Box2D/Collision/b2Collision.cpp index 4b092f0..62ccd35 100644 --- a/src/Box2D/Collision/b2Collision.cpp +++ b/external/Box2d/Box2D/Collision/b2Collision.cpp @@ -51,7 +51,7 @@ void b2WorldManifold::Initialize(const b2Manifold* manifold, { normal = b2Mul(xfA.q, manifold->localNormal); b2Vec2 planePoint = b2Mul(xfA, manifold->localPoint); - + for (int32 i = 0; i < manifold->pointCount; ++i) { b2Vec2 clipPoint = b2Mul(xfB, manifold->points[i].localPoint); diff --git a/external/Box2d/Box2D/Collision/b2Collision.h b/external/Box2d/Box2D/Collision/b2Collision.h new file mode 100644 index 0000000..27897f7 --- /dev/null +++ b/external/Box2d/Box2D/Collision/b2Collision.h @@ -0,0 +1,276 @@ +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_COLLISION_H +#define B2_COLLISION_H + +#include +#include + +/// @file +/// Structures and functions used for computing contact points, distance +/// queries, and TOI queries. + +class b2Shape; +class b2CircleShape; +class b2EdgeShape; +class b2PolygonShape; + +const uint8 b2_nullFeature = UCHAR_MAX; + +/// The features that intersect to form the contact point +/// This must be 4 bytes or less. +struct b2ContactFeature +{ + enum Type + { + e_vertex = 0, + e_face = 1 + }; + + uint8 indexA; ///< Feature index on shapeA + uint8 indexB; ///< Feature index on shapeB + uint8 typeA; ///< The feature type on shapeA + uint8 typeB; ///< The feature type on shapeB +}; + +/// Contact ids to facilitate warm starting. +union b2ContactID +{ + b2ContactFeature cf; + uint32 key; ///< Used to quickly compare contact ids. +}; + +/// A manifold point is a contact point belonging to a contact +/// manifold. It holds details related to the geometry and dynamics +/// of the contact points. +/// The local point usage depends on the manifold type: +/// -e_circles: the local center of circleB +/// -e_faceA: the local center of cirlceB or the clip point of polygonB +/// -e_faceB: the clip point of polygonA +/// This structure is stored across time steps, so we keep it small. +/// Note: the impulses are used for internal caching and may not +/// provide reliable contact forces, especially for high speed collisions. +struct b2ManifoldPoint +{ + b2Vec2 localPoint; ///< usage depends on manifold type + float32 normalImpulse; ///< the non-penetration impulse + float32 tangentImpulse; ///< the friction impulse + b2ContactID id; ///< uniquely identifies a contact point between two shapes +}; + +/// A manifold for two touching convex shapes. +/// Box2D supports multiple types of contact: +/// - clip point versus plane with radius +/// - point versus point with radius (circles) +/// The local point usage depends on the manifold type: +/// -e_circles: the local center of circleA +/// -e_faceA: the center of faceA +/// -e_faceB: the center of faceB +/// Similarly the local normal usage: +/// -e_circles: not used +/// -e_faceA: the normal on polygonA +/// -e_faceB: the normal on polygonB +/// We store contacts in this way so that position correction can +/// account for movement, which is critical for continuous physics. +/// All contact scenarios must be expressed in one of these types. +/// This structure is stored across time steps, so we keep it small. +struct b2Manifold +{ + enum Type + { + e_circles, + e_faceA, + e_faceB + }; + + b2ManifoldPoint points[b2_maxManifoldPoints]; ///< the points of contact + b2Vec2 localNormal; ///< not use for Type::e_points + b2Vec2 localPoint; ///< usage depends on manifold type + Type type; + int32 pointCount; ///< the number of manifold points +}; + +/// This is used to compute the current state of a contact manifold. +struct b2WorldManifold +{ + /// Evaluate the manifold with supplied transforms. This assumes + /// modest motion from the original state. This does not change the + /// point count, impulses, etc. The radii must come from the shapes + /// that generated the manifold. + void Initialize(const b2Manifold* manifold, + const b2Transform& xfA, float32 radiusA, + const b2Transform& xfB, float32 radiusB); + + b2Vec2 normal; ///< world vector pointing from A to B + b2Vec2 points[b2_maxManifoldPoints]; ///< world contact point (point of intersection) +}; + +/// This is used for determining the state of contact points. +enum b2PointState +{ + b2_nullState, ///< point does not exist + b2_addState, ///< point was added in the update + b2_persistState, ///< point persisted across the update + b2_removeState ///< point was removed in the update +}; + +/// Compute the point states given two manifolds. The states pertain to the transition from manifold1 +/// to manifold2. So state1 is either persist or remove while state2 is either add or persist. +void b2GetPointStates(b2PointState state1[b2_maxManifoldPoints], b2PointState state2[b2_maxManifoldPoints], + const b2Manifold* manifold1, const b2Manifold* manifold2); + +/// Used for computing contact manifolds. +struct b2ClipVertex +{ + b2Vec2 v; + b2ContactID id; +}; + +/// Ray-cast input data. The ray extends from p1 to p1 + maxFraction * (p2 - p1). +struct b2RayCastInput +{ + b2Vec2 p1, p2; + float32 maxFraction; +}; + +/// Ray-cast output data. The ray hits at p1 + fraction * (p2 - p1), where p1 and p2 +/// come from b2RayCastInput. +struct b2RayCastOutput +{ + b2Vec2 normal; + float32 fraction; +}; + +/// An axis aligned bounding box. +struct b2AABB +{ + /// Verify that the bounds are sorted. + bool IsValid() const; + + /// Get the center of the AABB. + b2Vec2 GetCenter() const + { + return 0.5f * (lowerBound + upperBound); + } + + /// Get the extents of the AABB (half-widths). + b2Vec2 GetExtents() const + { + return 0.5f * (upperBound - lowerBound); + } + + /// Get the perimeter length + float32 GetPerimeter() const + { + float32 wx = upperBound.x - lowerBound.x; + float32 wy = upperBound.y - lowerBound.y; + return 2.0f * (wx + wy); + } + + /// Combine an AABB into this one. + void Combine(const b2AABB& aabb) + { + lowerBound = b2Min(lowerBound, aabb.lowerBound); + upperBound = b2Max(upperBound, aabb.upperBound); + } + + /// Combine two AABBs into this one. + void Combine(const b2AABB& aabb1, const b2AABB& aabb2) + { + lowerBound = b2Min(aabb1.lowerBound, aabb2.lowerBound); + upperBound = b2Max(aabb1.upperBound, aabb2.upperBound); + } + + /// Does this aabb contain the provided AABB. + bool Contains(const b2AABB& aabb) const + { + bool result = true; + result = result && lowerBound.x <= aabb.lowerBound.x; + result = result && lowerBound.y <= aabb.lowerBound.y; + result = result && aabb.upperBound.x <= upperBound.x; + result = result && aabb.upperBound.y <= upperBound.y; + return result; + } + + bool RayCast(b2RayCastOutput* output, const b2RayCastInput& input) const; + + b2Vec2 lowerBound; ///< the lower vertex + b2Vec2 upperBound; ///< the upper vertex +}; + +/// Compute the collision manifold between two circles. +void b2CollideCircles(b2Manifold* manifold, + const b2CircleShape* circleA, const b2Transform& xfA, + const b2CircleShape* circleB, const b2Transform& xfB); + +/// Compute the collision manifold between a polygon and a circle. +void b2CollidePolygonAndCircle(b2Manifold* manifold, + const b2PolygonShape* polygonA, const b2Transform& xfA, + const b2CircleShape* circleB, const b2Transform& xfB); + +/// Compute the collision manifold between two polygons. +void b2CollidePolygons(b2Manifold* manifold, + const b2PolygonShape* polygonA, const b2Transform& xfA, + const b2PolygonShape* polygonB, const b2Transform& xfB); + +/// Compute the collision manifold between an edge and a circle. +void b2CollideEdgeAndCircle(b2Manifold* manifold, + const b2EdgeShape* polygonA, const b2Transform& xfA, + const b2CircleShape* circleB, const b2Transform& xfB); + +/// Compute the collision manifold between an edge and a circle. +void b2CollideEdgeAndPolygon(b2Manifold* manifold, + const b2EdgeShape* edgeA, const b2Transform& xfA, + const b2PolygonShape* circleB, const b2Transform& xfB); + +/// Clipping for contact manifolds. +int32 b2ClipSegmentToLine(b2ClipVertex vOut[2], const b2ClipVertex vIn[2], + const b2Vec2& normal, float32 offset, int32 vertexIndexA); + +/// Determine if two generic shapes overlap. +bool b2TestOverlap( const b2Shape* shapeA, int32 indexA, + const b2Shape* shapeB, int32 indexB, + const b2Transform& xfA, const b2Transform& xfB); + +// ---------------- Inline Functions ------------------------------------------ + +inline bool b2AABB::IsValid() const +{ + b2Vec2 d = upperBound - lowerBound; + bool valid = d.x >= 0.0f && d.y >= 0.0f; + valid = valid && lowerBound.IsValid() && upperBound.IsValid(); + return valid; +} + +inline bool b2TestOverlap(const b2AABB& a, const b2AABB& b) +{ + b2Vec2 d1, d2; + d1 = b.lowerBound - a.upperBound; + d2 = a.lowerBound - b.upperBound; + + if (d1.x > 0.0f || d1.y > 0.0f) + return false; + + if (d2.x > 0.0f || d2.y > 0.0f) + return false; + + return true; +} + +#endif diff --git a/src/Box2D/Collision/b2Distance.cpp b/external/Box2d/Box2D/Collision/b2Distance.cpp similarity index 94% rename from src/Box2D/Collision/b2Distance.cpp rename to external/Box2d/Box2D/Collision/b2Distance.cpp index 00ac3d0..5ee632b 100644 --- a/src/Box2D/Collision/b2Distance.cpp +++ b/external/Box2d/Box2D/Collision/b2Distance.cpp @@ -42,7 +42,7 @@ void b2DistanceProxy::Set(const b2Shape* shape, int32 index) { const b2PolygonShape* polygon = (b2PolygonShape*)shape; m_vertices = polygon->m_vertices; - m_count = polygon->m_count; + m_count = polygon->m_vertexCount; m_radius = polygon->m_radius; } break; @@ -100,7 +100,7 @@ struct b2Simplex const b2DistanceProxy* proxyB, const b2Transform& transformB) { b2Assert(cache->count <= 3); - + // Copy data from cache. m_count = cache->count; b2SimplexVertex* vertices = &m_v1; @@ -141,7 +141,6 @@ struct b2Simplex v->wA = b2Mul(transformA, wALocal); v->wB = b2Mul(transformB, wBLocal); v->w = v->wB - v->wA; - v->a = 1.0f; m_count = 1; } } @@ -245,7 +244,7 @@ struct b2Simplex { case 0: b2Assert(false); - return 0.0f; + return 0.0; case 1: return 0.0f; @@ -367,7 +366,7 @@ void b2Simplex::Solve3() float32 w3e23 = b2Dot(w3, e23); float32 d23_1 = w3e23; float32 d23_2 = -w2e23; - + // Triangle123 float32 n123 = b2Cross(e12, e13); @@ -466,7 +465,8 @@ void b2Distance(b2DistanceOutput* output, int32 saveA[3], saveB[3]; int32 saveCount = 0; - float32 distanceSqr1 = b2_maxFloat; + b2Vec2 closestPoint = simplex.GetClosestPoint(); + float32 distanceSqr1 = closestPoint.LengthSquared(); float32 distanceSqr2 = distanceSqr1; // Main iteration loop. diff --git a/external/Box2d/Box2D/Collision/b2Distance.h b/external/Box2d/Box2D/Collision/b2Distance.h new file mode 100644 index 0000000..92398a9 --- /dev/null +++ b/external/Box2d/Box2D/Collision/b2Distance.h @@ -0,0 +1,141 @@ + +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_DISTANCE_H +#define B2_DISTANCE_H + +#include + +class b2Shape; + +/// A distance proxy is used by the GJK algorithm. +/// It encapsulates any shape. +struct b2DistanceProxy +{ + b2DistanceProxy() : m_vertices(NULL), m_count(0), m_radius(0.0f) {} + + /// Initialize the proxy using the given shape. The shape + /// must remain in scope while the proxy is in use. + void Set(const b2Shape* shape, int32 index); + + /// Get the supporting vertex index in the given direction. + int32 GetSupport(const b2Vec2& d) const; + + /// Get the supporting vertex in the given direction. + const b2Vec2& GetSupportVertex(const b2Vec2& d) const; + + /// Get the vertex count. + int32 GetVertexCount() const; + + /// Get a vertex by index. Used by b2Distance. + const b2Vec2& GetVertex(int32 index) const; + + b2Vec2 m_buffer[2]; + const b2Vec2* m_vertices; + int32 m_count; + float32 m_radius; +}; + +/// Used to warm start b2Distance. +/// Set count to zero on first call. +struct b2SimplexCache +{ + float32 metric; ///< length or area + uint16 count; + uint8 indexA[3]; ///< vertices on shape A + uint8 indexB[3]; ///< vertices on shape B +}; + +/// Input for b2Distance. +/// You have to option to use the shape radii +/// in the computation. Even +struct b2DistanceInput +{ + b2DistanceProxy proxyA; + b2DistanceProxy proxyB; + b2Transform transformA; + b2Transform transformB; + bool useRadii; +}; + +/// Output for b2Distance. +struct b2DistanceOutput +{ + b2Vec2 pointA; ///< closest point on shapeA + b2Vec2 pointB; ///< closest point on shapeB + float32 distance; + int32 iterations; ///< number of GJK iterations used +}; + +/// Compute the closest points between two shapes. Supports any combination of: +/// b2CircleShape, b2PolygonShape, b2EdgeShape. The simplex cache is input/output. +/// On the first call set b2SimplexCache.count to zero. +void b2Distance(b2DistanceOutput* output, + b2SimplexCache* cache, + const b2DistanceInput* input); + + +////////////////////////////////////////////////////////////////////////// + +inline int32 b2DistanceProxy::GetVertexCount() const +{ + return m_count; +} + +inline const b2Vec2& b2DistanceProxy::GetVertex(int32 index) const +{ + b2Assert(0 <= index && index < m_count); + return m_vertices[index]; +} + +inline int32 b2DistanceProxy::GetSupport(const b2Vec2& d) const +{ + int32 bestIndex = 0; + float32 bestValue = b2Dot(m_vertices[0], d); + for (int32 i = 1; i < m_count; ++i) + { + float32 value = b2Dot(m_vertices[i], d); + if (value > bestValue) + { + bestIndex = i; + bestValue = value; + } + } + + return bestIndex; +} + +inline const b2Vec2& b2DistanceProxy::GetSupportVertex(const b2Vec2& d) const +{ + int32 bestIndex = 0; + float32 bestValue = b2Dot(m_vertices[0], d); + for (int32 i = 1; i < m_count; ++i) + { + float32 value = b2Dot(m_vertices[i], d); + if (value > bestValue) + { + bestIndex = i; + bestValue = value; + } + } + + return m_vertices[bestIndex]; +} + +#endif diff --git a/src/Box2D/Collision/b2DynamicTree.cpp b/external/Box2d/Box2D/Collision/b2DynamicTree.cpp similarity index 94% rename from src/Box2D/Collision/b2DynamicTree.cpp rename to external/Box2d/Box2D/Collision/b2DynamicTree.cpp index 00ed0b1..da6f350 100644 --- a/src/Box2D/Collision/b2DynamicTree.cpp +++ b/external/Box2d/Box2D/Collision/b2DynamicTree.cpp @@ -456,7 +456,7 @@ int32 b2DynamicTree::Balance(int32 iA) return iC; } - + // Rotate B up if (balance < -1) { @@ -769,13 +769,3 @@ void b2DynamicTree::RebuildBottomUp() Validate(); } - -void b2DynamicTree::ShiftOrigin(const b2Vec2& newOrigin) -{ - // Build array of leaves. Free the rest. - for (int32 i = 0; i < m_nodeCapacity; ++i) - { - m_nodes[i].aabb.lowerBound -= newOrigin; - m_nodes[i].aabb.upperBound -= newOrigin; - } -} diff --git a/external/Box2d/Box2D/Collision/b2DynamicTree.h b/external/Box2d/Box2D/Collision/b2DynamicTree.h new file mode 100644 index 0000000..a9bfbf3 --- /dev/null +++ b/external/Box2d/Box2D/Collision/b2DynamicTree.h @@ -0,0 +1,284 @@ +/* +* Copyright (c) 2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_DYNAMIC_TREE_H +#define B2_DYNAMIC_TREE_H + +#include +#include + +#define b2_nullNode (-1) + +/// A node in the dynamic tree. The client does not interact with this directly. +struct b2TreeNode +{ + bool IsLeaf() const + { + return child1 == b2_nullNode; + } + + /// Enlarged AABB + b2AABB aabb; + + void* userData; + + union + { + int32 parent; + int32 next; + }; + + int32 child1; + int32 child2; + + // leaf = 0, free node = -1 + int32 height; +}; + +/// A dynamic AABB tree broad-phase, inspired by Nathanael Presson's btDbvt. +/// A dynamic tree arranges data in a binary tree to accelerate +/// queries such as volume queries and ray casts. Leafs are proxies +/// with an AABB. In the tree we expand the proxy AABB by b2_fatAABBFactor +/// so that the proxy AABB is bigger than the client object. This allows the client +/// object to move by small amounts without triggering a tree update. +/// +/// Nodes are pooled and relocatable, so we use node indices rather than pointers. +class b2DynamicTree +{ +public: + /// Constructing the tree initializes the node pool. + b2DynamicTree(); + + /// Destroy the tree, freeing the node pool. + ~b2DynamicTree(); + + /// Create a proxy. Provide a tight fitting AABB and a userData pointer. + int32 CreateProxy(const b2AABB& aabb, void* userData); + + /// Destroy a proxy. This asserts if the id is invalid. + void DestroyProxy(int32 proxyId); + + /// Move a proxy with a swepted AABB. If the proxy has moved outside of its fattened AABB, + /// then the proxy is removed from the tree and re-inserted. Otherwise + /// the function returns immediately. + /// @return true if the proxy was re-inserted. + bool MoveProxy(int32 proxyId, const b2AABB& aabb1, const b2Vec2& displacement); + + /// Get proxy user data. + /// @return the proxy user data or 0 if the id is invalid. + void* GetUserData(int32 proxyId) const; + + /// Get the fat AABB for a proxy. + const b2AABB& GetFatAABB(int32 proxyId) const; + + /// Query an AABB for overlapping proxies. The callback class + /// is called for each proxy that overlaps the supplied AABB. + template + void Query(T* callback, const b2AABB& aabb) const; + + /// Ray-cast against the proxies in the tree. This relies on the callback + /// to perform a exact ray-cast in the case were the proxy contains a shape. + /// The callback also performs the any collision filtering. This has performance + /// roughly equal to k * log(n), where k is the number of collisions and n is the + /// number of proxies in the tree. + /// @param input the ray-cast input data. The ray extends from p1 to p1 + maxFraction * (p2 - p1). + /// @param callback a callback class that is called for each proxy that is hit by the ray. + template + void RayCast(T* callback, const b2RayCastInput& input) const; + + /// Validate this tree. For testing. + void Validate() const; + + /// Compute the height of the binary tree in O(N) time. Should not be + /// called often. + int32 GetHeight() const; + + /// Get the maximum balance of an node in the tree. The balance is the difference + /// in height of the two children of a node. + int32 GetMaxBalance() const; + + /// Get the ratio of the sum of the node areas to the root area. + float32 GetAreaRatio() const; + + /// Build an optimal tree. Very expensive. For testing. + void RebuildBottomUp(); + +private: + + int32 AllocateNode(); + void FreeNode(int32 node); + + void InsertLeaf(int32 node); + void RemoveLeaf(int32 node); + + int32 Balance(int32 index); + + int32 ComputeHeight() const; + int32 ComputeHeight(int32 nodeId) const; + + void ValidateStructure(int32 index) const; + void ValidateMetrics(int32 index) const; + + int32 m_root; + + b2TreeNode* m_nodes; + int32 m_nodeCount; + int32 m_nodeCapacity; + + int32 m_freeList; + + /// This is used to incrementally traverse the tree for re-balancing. + uint32 m_path; + + int32 m_insertionCount; +}; + +inline void* b2DynamicTree::GetUserData(int32 proxyId) const +{ + b2Assert(0 <= proxyId && proxyId < m_nodeCapacity); + return m_nodes[proxyId].userData; +} + +inline const b2AABB& b2DynamicTree::GetFatAABB(int32 proxyId) const +{ + b2Assert(0 <= proxyId && proxyId < m_nodeCapacity); + return m_nodes[proxyId].aabb; +} + +template +inline void b2DynamicTree::Query(T* callback, const b2AABB& aabb) const +{ + b2GrowableStack stack; + stack.Push(m_root); + + while (stack.GetCount() > 0) + { + int32 nodeId = stack.Pop(); + if (nodeId == b2_nullNode) + { + continue; + } + + const b2TreeNode* node = m_nodes + nodeId; + + if (b2TestOverlap(node->aabb, aabb)) + { + if (node->IsLeaf()) + { + bool proceed = callback->QueryCallback(nodeId); + if (proceed == false) + { + return; + } + } + else + { + stack.Push(node->child1); + stack.Push(node->child2); + } + } + } +} + +template +inline void b2DynamicTree::RayCast(T* callback, const b2RayCastInput& input) const +{ + b2Vec2 p1 = input.p1; + b2Vec2 p2 = input.p2; + b2Vec2 r = p2 - p1; + b2Assert(r.LengthSquared() > 0.0f); + r.Normalize(); + + // v is perpendicular to the segment. + b2Vec2 v = b2Cross(1.0f, r); + b2Vec2 abs_v = b2Abs(v); + + // Separating axis for segment (Gino, p80). + // |dot(v, p1 - c)| > dot(|v|, h) + + float32 maxFraction = input.maxFraction; + + // Build a bounding box for the segment. + b2AABB segmentAABB; + { + b2Vec2 t = p1 + maxFraction * (p2 - p1); + segmentAABB.lowerBound = b2Min(p1, t); + segmentAABB.upperBound = b2Max(p1, t); + } + + b2GrowableStack stack; + stack.Push(m_root); + + while (stack.GetCount() > 0) + { + int32 nodeId = stack.Pop(); + if (nodeId == b2_nullNode) + { + continue; + } + + const b2TreeNode* node = m_nodes + nodeId; + + if (b2TestOverlap(node->aabb, segmentAABB) == false) + { + continue; + } + + // Separating axis for segment (Gino, p80). + // |dot(v, p1 - c)| > dot(|v|, h) + b2Vec2 c = node->aabb.GetCenter(); + b2Vec2 h = node->aabb.GetExtents(); + float32 separation = b2Abs(b2Dot(v, p1 - c)) - b2Dot(abs_v, h); + if (separation > 0.0f) + { + continue; + } + + if (node->IsLeaf()) + { + b2RayCastInput subInput; + subInput.p1 = input.p1; + subInput.p2 = input.p2; + subInput.maxFraction = maxFraction; + + float32 value = callback->RayCastCallback(subInput, nodeId); + + if (value == 0.0f) + { + // The client has terminated the ray cast. + return; + } + + if (value > 0.0f) + { + // Update segment bounding box. + maxFraction = value; + b2Vec2 t = p1 + maxFraction * (p2 - p1); + segmentAABB.lowerBound = b2Min(p1, t); + segmentAABB.upperBound = b2Max(p1, t); + } + } + else + { + stack.Push(node->child1); + stack.Push(node->child2); + } + } +} + +#endif diff --git a/src/Box2D/Collision/b2TimeOfImpact.cpp b/external/Box2d/Box2D/Collision/b2TimeOfImpact.cpp similarity index 94% rename from src/Box2D/Collision/b2TimeOfImpact.cpp rename to external/Box2d/Box2D/Collision/b2TimeOfImpact.cpp index 60296b0..9fd7f8c 100644 --- a/src/Box2D/Collision/b2TimeOfImpact.cpp +++ b/external/Box2d/Box2D/Collision/b2TimeOfImpact.cpp @@ -98,7 +98,7 @@ struct b2SeparationFunction m_type = e_faceA; b2Vec2 localPointA1 = m_proxyA->GetVertex(cache->indexA[0]); b2Vec2 localPointA2 = m_proxyA->GetVertex(cache->indexA[1]); - + m_axis = b2Cross(localPointA2 - localPointA1, 1.0f); m_axis.Normalize(); b2Vec2 normal = b2Mul(xfA.q, m_axis); @@ -137,7 +137,7 @@ struct b2SeparationFunction b2Vec2 localPointA = m_proxyA->GetVertex(*indexA); b2Vec2 localPointB = m_proxyB->GetVertex(*indexB); - + b2Vec2 pointA = b2Mul(xfA, localPointA); b2Vec2 pointB = b2Mul(xfB, localPointB); @@ -151,7 +151,7 @@ struct b2SeparationFunction b2Vec2 pointA = b2Mul(xfA, m_localPoint); b2Vec2 axisB = b2MulT(xfB.q, -normal); - + *indexA = -1; *indexB = m_proxyB->GetSupport(axisB); @@ -197,6 +197,9 @@ struct b2SeparationFunction { case e_points: { + b2Vec2 axisA = b2MulT(xfA.q, m_axis); + b2Vec2 axisB = b2MulT(xfB.q, -m_axis); + b2Vec2 localPointA = m_proxyA->GetVertex(indexA); b2Vec2 localPointB = m_proxyB->GetVertex(indexB); @@ -212,6 +215,8 @@ struct b2SeparationFunction b2Vec2 normal = b2Mul(xfA.q, m_axis); b2Vec2 pointA = b2Mul(xfA, m_localPoint); + b2Vec2 axisB = b2MulT(xfB.q, -normal); + b2Vec2 localPointB = m_proxyB->GetVertex(indexB); b2Vec2 pointB = b2Mul(xfB, localPointB); @@ -224,6 +229,8 @@ struct b2SeparationFunction b2Vec2 normal = b2Mul(xfB.q, m_axis); b2Vec2 pointB = b2Mul(xfB, m_localPoint); + b2Vec2 axisA = b2MulT(xfA.q, -normal); + b2Vec2 localPointA = m_proxyA->GetVertex(indexA); b2Vec2 pointA = b2Mul(xfA, localPointA); diff --git a/external/Box2d/Box2D/Collision/b2TimeOfImpact.h b/external/Box2d/Box2D/Collision/b2TimeOfImpact.h new file mode 100644 index 0000000..179a170 --- /dev/null +++ b/external/Box2d/Box2D/Collision/b2TimeOfImpact.h @@ -0,0 +1,58 @@ +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_TIME_OF_IMPACT_H +#define B2_TIME_OF_IMPACT_H + +#include +#include + +/// Input parameters for b2TimeOfImpact +struct b2TOIInput +{ + b2DistanceProxy proxyA; + b2DistanceProxy proxyB; + b2Sweep sweepA; + b2Sweep sweepB; + float32 tMax; // defines sweep interval [0, tMax] +}; + +// Output parameters for b2TimeOfImpact. +struct b2TOIOutput +{ + enum State + { + e_unknown, + e_failed, + e_overlapped, + e_touching, + e_separated + }; + + State state; + float32 t; +}; + +/// Compute the upper bound on time before two shapes penetrate. Time is represented as +/// a fraction between [0,tMax]. This uses a swept separating axis and may miss some intermediate, +/// non-tunneling collision. If you change the time interval, you should call this function +/// again. +/// Note: use b2Distance to compute the contact point and normal at the time of impact. +void b2TimeOfImpact(b2TOIOutput* output, const b2TOIInput* input); + +#endif diff --git a/src/Box2D/Common/b2BlockAllocator.cpp b/external/Box2d/Box2D/Common/b2BlockAllocator.cpp similarity index 94% rename from src/Box2D/Common/b2BlockAllocator.cpp rename to external/Box2d/Box2D/Common/b2BlockAllocator.cpp index f5060da..1d1960f 100644 --- a/src/Box2D/Common/b2BlockAllocator.cpp +++ b/external/Box2d/Box2D/Common/b2BlockAllocator.cpp @@ -23,7 +23,7 @@ #include using namespace std; -int32 b2BlockAllocator::s_blockSizes[b2_blockSizes] = +int32 b2BlockAllocator::s_blockSizes[b2_blockSizes] = { 16, // 0 32, // 1 @@ -61,7 +61,7 @@ b2BlockAllocator::b2BlockAllocator() m_chunkSpace = b2_chunkArrayIncrement; m_chunkCount = 0; m_chunks = (b2Chunk*)b2Alloc(m_chunkSpace * sizeof(b2Chunk)); - + memset(m_chunks, 0, m_chunkSpace * sizeof(b2Chunk)); memset(m_freeLists, 0, sizeof(m_freeLists)); diff --git a/external/Box2d/Box2D/Common/b2BlockAllocator.h b/external/Box2d/Box2D/Common/b2BlockAllocator.h new file mode 100644 index 0000000..8ba29a5 --- /dev/null +++ b/external/Box2d/Box2D/Common/b2BlockAllocator.h @@ -0,0 +1,62 @@ +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_BLOCK_ALLOCATOR_H +#define B2_BLOCK_ALLOCATOR_H + +#include + +const int32 b2_chunkSize = 16 * 1024; +const int32 b2_maxBlockSize = 640; +const int32 b2_blockSizes = 14; +const int32 b2_chunkArrayIncrement = 128; + +struct b2Block; +struct b2Chunk; + +/// This is a small object allocator used for allocating small +/// objects that persist for more than one time step. +/// See: http://www.codeproject.com/useritems/Small_Block_Allocator.asp +class b2BlockAllocator +{ +public: + b2BlockAllocator(); + ~b2BlockAllocator(); + + /// Allocate memory. This will use b2Alloc if the size is larger than b2_maxBlockSize. + void* Allocate(int32 size); + + /// Free memory. This will use b2Free if the size is larger than b2_maxBlockSize. + void Free(void* p, int32 size); + + void Clear(); + +private: + + b2Chunk* m_chunks; + int32 m_chunkCount; + int32 m_chunkSpace; + + b2Block* m_freeLists[b2_blockSizes]; + + static int32 s_blockSizes[b2_blockSizes]; + static uint8 s_blockSizeLookup[b2_maxBlockSize + 1]; + static bool s_blockSizeLookupInitialized; +}; + +#endif diff --git a/src/Box2D/Common/b2Draw.cpp b/external/Box2d/Box2D/Common/b2Draw.cpp similarity index 100% rename from src/Box2D/Common/b2Draw.cpp rename to external/Box2d/Box2D/Common/b2Draw.cpp diff --git a/external/Box2d/Box2D/Common/b2Draw.h b/external/Box2d/Box2D/Common/b2Draw.h new file mode 100644 index 0000000..0b10478 --- /dev/null +++ b/external/Box2d/Box2D/Common/b2Draw.h @@ -0,0 +1,81 @@ +/* +* Copyright (c) 2011 Erin Catto http://box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include + +/// Color for debug drawing. Each value has the range [0,1]. +struct b2Color +{ + b2Color() {} + b2Color(float32 r, float32 g, float32 b) : r(r), g(g), b(b) {} + void Set(float32 ri, float32 gi, float32 bi) { r = ri; g = gi; b = bi; } + float32 r, g, b; +}; + +/// Implement and register this class with a b2World to provide debug drawing of physics +/// entities in your game. +class b2Draw +{ +public: + b2Draw(); + + virtual ~b2Draw() {} + + enum + { + e_shapeBit = 0x0001, ///< draw shapes + e_jointBit = 0x0002, ///< draw joint connections + e_aabbBit = 0x0004, ///< draw axis aligned bounding boxes + e_pairBit = 0x0008, ///< draw broad-phase pairs + e_centerOfMassBit = 0x0010 ///< draw center of mass frame + }; + + /// Set the drawing flags. + void SetFlags(uint32 flags); + + /// Get the drawing flags. + uint32 GetFlags() const; + + /// Append flags to the current flags. + void AppendFlags(uint32 flags); + + /// Clear flags from the current flags. + void ClearFlags(uint32 flags); + + /// Draw a closed polygon provided in CCW order. + virtual void DrawPolygon(const b2Vec2* vertices, int32 vertexCount, const b2Color& color) = 0; + + /// Draw a solid closed polygon provided in CCW order. + virtual void DrawSolidPolygon(const b2Vec2* vertices, int32 vertexCount, const b2Color& color) = 0; + + /// Draw a circle. + virtual void DrawCircle(const b2Vec2& center, float32 radius, const b2Color& color) = 0; + + /// Draw a solid circle. + virtual void DrawSolidCircle(const b2Vec2& center, float32 radius, const b2Vec2& axis, const b2Color& color) = 0; + + /// Draw a line segment. + virtual void DrawSegment(const b2Vec2& p1, const b2Vec2& p2, const b2Color& color) = 0; + + /// Draw a transform. Choose your own length scale. + /// @param xf a transform. + virtual void DrawTransform(const b2Transform& xf) = 0; + +protected: + uint32 m_drawFlags; +}; diff --git a/external/Box2d/Box2D/Common/b2GrowableStack.h b/external/Box2d/Box2D/Common/b2GrowableStack.h new file mode 100644 index 0000000..d2e0712 --- /dev/null +++ b/external/Box2d/Box2D/Common/b2GrowableStack.h @@ -0,0 +1,85 @@ +/* +* Copyright (c) 2010 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_GROWABLE_STACK_H +#define B2_GROWABLE_STACK_H +#include +#include + +/// This is a growable LIFO stack with an initial capacity of N. +/// If the stack size exceeds the initial capacity, the heap is used +/// to increase the size of the stack. +template +class b2GrowableStack +{ +public: + b2GrowableStack() + { + m_stack = m_array; + m_count = 0; + m_capacity = N; + } + + ~b2GrowableStack() + { + if (m_stack != m_array) + { + b2Free(m_stack); + m_stack = NULL; + } + } + + void Push(const T& element) + { + if (m_count == m_capacity) + { + T* old = m_stack; + m_capacity *= 2; + m_stack = (T*)b2Alloc(m_capacity * sizeof(T)); + std::memcpy(m_stack, old, m_count * sizeof(T)); + if (old != m_array) + { + b2Free(old); + } + } + + m_stack[m_count] = element; + ++m_count; + } + + T Pop() + { + b2Assert(m_count > 0); + --m_count; + return m_stack[m_count]; + } + + int32 GetCount() + { + return m_count; + } + +private: + T* m_stack; + T m_array[N]; + int32 m_count; + int32 m_capacity; +}; + + +#endif diff --git a/src/Box2D/Common/b2Math.cpp b/external/Box2d/Box2D/Common/b2Math.cpp similarity index 100% rename from src/Box2D/Common/b2Math.cpp rename to external/Box2d/Box2D/Common/b2Math.cpp diff --git a/external/Box2d/Box2D/Common/b2Math.h b/external/Box2d/Box2D/Common/b2Math.h new file mode 100644 index 0000000..15cb033 --- /dev/null +++ b/external/Box2d/Box2D/Common/b2Math.h @@ -0,0 +1,731 @@ +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_MATH_H +#define B2_MATH_H + +#include + +#include +#include +#include +#include + +/// This function is used to ensure that a floating point number is +/// not a NaN or infinity. +inline bool b2IsValid(float32 x) +{ + if (x != x) + { + // NaN. + return false; + } + + float32 infinity = std::numeric_limits::infinity(); + return -infinity < x && x < infinity; +} + +/// This is a approximate yet fast inverse square-root. +inline float32 b2InvSqrt(float32 x) +{ + union + { + float32 x; + int32 i; + } convert; + + convert.x = x; + float32 xhalf = 0.5f * x; + convert.i = 0x5f3759df - (convert.i >> 1); + x = convert.x; + x = x * (1.5f - xhalf * x * x); + return x; +} + +#define b2Sqrt(x) std::sqrt(x) +#define b2Atan2(y, x) std::atan2(y, x) + +/// A 2D column vector. +struct b2Vec2 +{ + /// Default constructor does nothing (for performance). + b2Vec2() {} + + /// Construct using coordinates. + b2Vec2(float32 x, float32 y) : x(x), y(y) {} + + /// Set this vector to all zeros. + void SetZero() { x = 0.0f; y = 0.0f; } + + /// Set this vector to some specified coordinates. + void Set(float32 x_, float32 y_) { x = x_; y = y_; } + + /// Negate this vector. + b2Vec2 operator -() const { b2Vec2 v; v.Set(-x, -y); return v; } + + /// Read from and indexed element. + float32 operator () (int32 i) const + { + return (&x)[i]; + } + + /// Write to an indexed element. + float32& operator () (int32 i) + { + return (&x)[i]; + } + + /// Add a vector to this vector. + void operator += (const b2Vec2& v) + { + x += v.x; y += v.y; + } + + /// Subtract a vector from this vector. + void operator -= (const b2Vec2& v) + { + x -= v.x; y -= v.y; + } + + /// Multiply this vector by a scalar. + void operator *= (float32 a) + { + x *= a; y *= a; + } + + /// Get the length of this vector (the norm). + float32 Length() const + { + return b2Sqrt(x * x + y * y); + } + + /// Get the length squared. For performance, use this instead of + /// b2Vec2::Length (if possible). + float32 LengthSquared() const + { + return x * x + y * y; + } + + /// Convert this vector into a unit vector. Returns the length. + float32 Normalize() + { + float32 length = Length(); + if (length < b2_epsilon) + { + return 0.0f; + } + float32 invLength = 1.0f / length; + x *= invLength; + y *= invLength; + + return length; + } + + /// Does this vector contain finite coordinates? + bool IsValid() const + { + return b2IsValid(x) && b2IsValid(y); + } + + /// Get the skew vector such that dot(skew_vec, other) == cross(vec, other) + b2Vec2 Skew() const + { + return b2Vec2(-y, x); + } + + float32 x, y; +}; + +/// A 2D column vector with 3 elements. +struct b2Vec3 +{ + /// Default constructor does nothing (for performance). + b2Vec3() {} + + /// Construct using coordinates. + b2Vec3(float32 x, float32 y, float32 z) : x(x), y(y), z(z) {} + + /// Set this vector to all zeros. + void SetZero() { x = 0.0f; y = 0.0f; z = 0.0f; } + + /// Set this vector to some specified coordinates. + void Set(float32 x_, float32 y_, float32 z_) { x = x_; y = y_; z = z_; } + + /// Negate this vector. + b2Vec3 operator -() const { b2Vec3 v; v.Set(-x, -y, -z); return v; } + + /// Add a vector to this vector. + void operator += (const b2Vec3& v) + { + x += v.x; y += v.y; z += v.z; + } + + /// Subtract a vector from this vector. + void operator -= (const b2Vec3& v) + { + x -= v.x; y -= v.y; z -= v.z; + } + + /// Multiply this vector by a scalar. + void operator *= (float32 s) + { + x *= s; y *= s; z *= s; + } + + float32 x, y, z; +}; + +/// A 2-by-2 matrix. Stored in column-major order. +struct b2Mat22 +{ + /// The default constructor does nothing (for performance). + b2Mat22() {} + + /// Construct this matrix using columns. + b2Mat22(const b2Vec2& c1, const b2Vec2& c2) + { + ex = c1; + ey = c2; + } + + /// Construct this matrix using scalars. + b2Mat22(float32 a11, float32 a12, float32 a21, float32 a22) + { + ex.x = a11; ex.y = a21; + ey.x = a12; ey.y = a22; + } + + /// Initialize this matrix using columns. + void Set(const b2Vec2& c1, const b2Vec2& c2) + { + ex = c1; + ey = c2; + } + + /// Set this to the identity matrix. + void SetIdentity() + { + ex.x = 1.0f; ey.x = 0.0f; + ex.y = 0.0f; ey.y = 1.0f; + } + + /// Set this matrix to all zeros. + void SetZero() + { + ex.x = 0.0f; ey.x = 0.0f; + ex.y = 0.0f; ey.y = 0.0f; + } + + b2Mat22 GetInverse() const + { + float32 a = ex.x, b = ey.x, c = ex.y, d = ey.y; + b2Mat22 B; + float32 det = a * d - b * c; + if (det != 0.0f) + { + det = 1.0f / det; + } + B.ex.x = det * d; B.ey.x = -det * b; + B.ex.y = -det * c; B.ey.y = det * a; + return B; + } + + /// Solve A * x = b, where b is a column vector. This is more efficient + /// than computing the inverse in one-shot cases. + b2Vec2 Solve(const b2Vec2& b) const + { + float32 a11 = ex.x, a12 = ey.x, a21 = ex.y, a22 = ey.y; + float32 det = a11 * a22 - a12 * a21; + if (det != 0.0f) + { + det = 1.0f / det; + } + b2Vec2 x; + x.x = det * (a22 * b.x - a12 * b.y); + x.y = det * (a11 * b.y - a21 * b.x); + return x; + } + + b2Vec2 ex, ey; +}; + +/// A 3-by-3 matrix. Stored in column-major order. +struct b2Mat33 +{ + /// The default constructor does nothing (for performance). + b2Mat33() {} + + /// Construct this matrix using columns. + b2Mat33(const b2Vec3& c1, const b2Vec3& c2, const b2Vec3& c3) + { + ex = c1; + ey = c2; + ez = c3; + } + + /// Set this matrix to all zeros. + void SetZero() + { + ex.SetZero(); + ey.SetZero(); + ez.SetZero(); + } + + /// Solve A * x = b, where b is a column vector. This is more efficient + /// than computing the inverse in one-shot cases. + b2Vec3 Solve33(const b2Vec3& b) const; + + /// Solve A * x = b, where b is a column vector. This is more efficient + /// than computing the inverse in one-shot cases. Solve only the upper + /// 2-by-2 matrix equation. + b2Vec2 Solve22(const b2Vec2& b) const; + + /// Get the inverse of this matrix as a 2-by-2. + /// Returns the zero matrix if singular. + void GetInverse22(b2Mat33* M) const; + + /// Get the symmetric inverse of this matrix as a 3-by-3. + /// Returns the zero matrix if singular. + void GetSymInverse33(b2Mat33* M) const; + + b2Vec3 ex, ey, ez; +}; + +/// Rotation +struct b2Rot +{ + b2Rot() {} + + /// Initialize from an angle in radians + explicit b2Rot(float32 angle) + { + /// TODO_ERIN optimize + s = sinf(angle); + c = cosf(angle); + } + + /// Set using an angle in radians. + void Set(float32 angle) + { + /// TODO_ERIN optimize + s = sinf(angle); + c = cosf(angle); + } + + /// Set to the identity rotation + void SetIdentity() + { + s = 0.0f; + c = 1.0f; + } + + /// Get the angle in radians + float32 GetAngle() const + { + return b2Atan2(s, c); + } + + /// Get the x-axis + b2Vec2 GetXAxis() const + { + return b2Vec2(c, s); + } + + /// Get the u-axis + b2Vec2 GetYAxis() const + { + return b2Vec2(-s, c); + } + + /// Sine and cosine + float32 s, c; +}; + +/// A transform contains translation and rotation. It is used to represent +/// the position and orientation of rigid frames. +struct b2Transform +{ + /// The default constructor does nothing. + b2Transform() {} + + /// Initialize using a position vector and a rotation. + b2Transform(const b2Vec2& position, const b2Rot& rotation) : p(position), q(rotation) {} + + /// Set this to the identity transform. + void SetIdentity() + { + p.SetZero(); + q.SetIdentity(); + } + + /// Set this based on the position and angle. + void Set(const b2Vec2& position, float32 angle) + { + p = position; + q.Set(angle); + } + + b2Vec2 p; + b2Rot q; +}; + +/// This describes the motion of a body/shape for TOI computation. +/// Shapes are defined with respect to the body origin, which may +/// no coincide with the center of mass. However, to support dynamics +/// we must interpolate the center of mass position. +struct b2Sweep +{ + /// Get the interpolated transform at a specific time. + /// @param beta is a factor in [0,1], where 0 indicates alpha0. + void GetTransform(b2Transform* xfb, float32 beta) const; + + /// Advance the sweep forward, yielding a new initial state. + /// @param alpha the new initial time. + void Advance(float32 alpha); + + /// Normalize the angles. + void Normalize(); + + b2Vec2 localCenter; ///< local center of mass position + b2Vec2 c0, c; ///< center world positions + float32 a0, a; ///< world angles + + /// Fraction of the current time step in the range [0,1] + /// c0 and a0 are the positions at alpha0. + float32 alpha0; +}; + +/// Useful constant +extern const b2Vec2 b2Vec2_zero; + +/// Perform the dot product on two vectors. +inline float32 b2Dot(const b2Vec2& a, const b2Vec2& b) +{ + return a.x * b.x + a.y * b.y; +} + +/// Perform the cross product on two vectors. In 2D this produces a scalar. +inline float32 b2Cross(const b2Vec2& a, const b2Vec2& b) +{ + return a.x * b.y - a.y * b.x; +} + +/// Perform the cross product on a vector and a scalar. In 2D this produces +/// a vector. +inline b2Vec2 b2Cross(const b2Vec2& a, float32 s) +{ + return b2Vec2(s * a.y, -s * a.x); +} + +/// Perform the cross product on a scalar and a vector. In 2D this produces +/// a vector. +inline b2Vec2 b2Cross(float32 s, const b2Vec2& a) +{ + return b2Vec2(-s * a.y, s * a.x); +} + +/// Multiply a matrix times a vector. If a rotation matrix is provided, +/// then this transforms the vector from one frame to another. +inline b2Vec2 b2Mul(const b2Mat22& A, const b2Vec2& v) +{ + return b2Vec2(A.ex.x * v.x + A.ey.x * v.y, A.ex.y * v.x + A.ey.y * v.y); +} + +/// Multiply a matrix transpose times a vector. If a rotation matrix is provided, +/// then this transforms the vector from one frame to another (inverse transform). +inline b2Vec2 b2MulT(const b2Mat22& A, const b2Vec2& v) +{ + return b2Vec2(b2Dot(v, A.ex), b2Dot(v, A.ey)); +} + +/// Add two vectors component-wise. +inline b2Vec2 operator + (const b2Vec2& a, const b2Vec2& b) +{ + return b2Vec2(a.x + b.x, a.y + b.y); +} + +/// Subtract two vectors component-wise. +inline b2Vec2 operator - (const b2Vec2& a, const b2Vec2& b) +{ + return b2Vec2(a.x - b.x, a.y - b.y); +} + +inline b2Vec2 operator * (float32 s, const b2Vec2& a) +{ + return b2Vec2(s * a.x, s * a.y); +} + +inline bool operator == (const b2Vec2& a, const b2Vec2& b) +{ + return a.x == b.x && a.y == b.y; +} + +inline float32 b2Distance(const b2Vec2& a, const b2Vec2& b) +{ + b2Vec2 c = a - b; + return c.Length(); +} + +inline float32 b2DistanceSquared(const b2Vec2& a, const b2Vec2& b) +{ + b2Vec2 c = a - b; + return b2Dot(c, c); +} + +inline b2Vec3 operator * (float32 s, const b2Vec3& a) +{ + return b2Vec3(s * a.x, s * a.y, s * a.z); +} + +/// Add two vectors component-wise. +inline b2Vec3 operator + (const b2Vec3& a, const b2Vec3& b) +{ + return b2Vec3(a.x + b.x, a.y + b.y, a.z + b.z); +} + +/// Subtract two vectors component-wise. +inline b2Vec3 operator - (const b2Vec3& a, const b2Vec3& b) +{ + return b2Vec3(a.x - b.x, a.y - b.y, a.z - b.z); +} + +/// Perform the dot product on two vectors. +inline float32 b2Dot(const b2Vec3& a, const b2Vec3& b) +{ + return a.x * b.x + a.y * b.y + a.z * b.z; +} + +/// Perform the cross product on two vectors. +inline b2Vec3 b2Cross(const b2Vec3& a, const b2Vec3& b) +{ + return b2Vec3(a.y * b.z - a.z * b.y, a.z * b.x - a.x * b.z, a.x * b.y - a.y * b.x); +} + +inline b2Mat22 operator + (const b2Mat22& A, const b2Mat22& B) +{ + return b2Mat22(A.ex + B.ex, A.ey + B.ey); +} + +// A * B +inline b2Mat22 b2Mul(const b2Mat22& A, const b2Mat22& B) +{ + return b2Mat22(b2Mul(A, B.ex), b2Mul(A, B.ey)); +} + +// A^T * B +inline b2Mat22 b2MulT(const b2Mat22& A, const b2Mat22& B) +{ + b2Vec2 c1(b2Dot(A.ex, B.ex), b2Dot(A.ey, B.ex)); + b2Vec2 c2(b2Dot(A.ex, B.ey), b2Dot(A.ey, B.ey)); + return b2Mat22(c1, c2); +} + +/// Multiply a matrix times a vector. +inline b2Vec3 b2Mul(const b2Mat33& A, const b2Vec3& v) +{ + return v.x * A.ex + v.y * A.ey + v.z * A.ez; +} + +/// Multiply a matrix times a vector. +inline b2Vec2 b2Mul22(const b2Mat33& A, const b2Vec2& v) +{ + return b2Vec2(A.ex.x * v.x + A.ey.x * v.y, A.ex.y * v.x + A.ey.y * v.y); +} + +/// Multiply two rotations: q * r +inline b2Rot b2Mul(const b2Rot& q, const b2Rot& r) +{ + // [qc -qs] * [rc -rs] = [qc*rc-qs*rs -qc*rs-qs*rc] + // [qs qc] [rs rc] [qs*rc+qc*rs -qs*rs+qc*rc] + // s = qs * rc + qc * rs + // c = qc * rc - qs * rs + b2Rot qr; + qr.s = q.s * r.c + q.c * r.s; + qr.c = q.c * r.c - q.s * r.s; + return qr; +} + +/// Transpose multiply two rotations: qT * r +inline b2Rot b2MulT(const b2Rot& q, const b2Rot& r) +{ + // [ qc qs] * [rc -rs] = [qc*rc+qs*rs -qc*rs+qs*rc] + // [-qs qc] [rs rc] [-qs*rc+qc*rs qs*rs+qc*rc] + // s = qc * rs - qs * rc + // c = qc * rc + qs * rs + b2Rot qr; + qr.s = q.c * r.s - q.s * r.c; + qr.c = q.c * r.c + q.s * r.s; + return qr; +} + +/// Rotate a vector +inline b2Vec2 b2Mul(const b2Rot& q, const b2Vec2& v) +{ + return b2Vec2(q.c * v.x - q.s * v.y, q.s * v.x + q.c * v.y); +} + +/// Inverse rotate a vector +inline b2Vec2 b2MulT(const b2Rot& q, const b2Vec2& v) +{ + return b2Vec2(q.c * v.x + q.s * v.y, -q.s * v.x + q.c * v.y); +} + +inline b2Vec2 b2Mul(const b2Transform& T, const b2Vec2& v) +{ + float32 x = (T.q.c * v.x - T.q.s * v.y) + T.p.x; + float32 y = (T.q.s * v.x + T.q.c * v.y) + T.p.y; + + return b2Vec2(x, y); +} + +inline b2Vec2 b2MulT(const b2Transform& T, const b2Vec2& v) +{ + float32 px = v.x - T.p.x; + float32 py = v.y - T.p.y; + float32 x = (T.q.c * px + T.q.s * py); + float32 y = (-T.q.s * px + T.q.c * py); + + return b2Vec2(x, y); +} + +// v2 = A.q.Rot(B.q.Rot(v1) + B.p) + A.p +// = (A.q * B.q).Rot(v1) + A.q.Rot(B.p) + A.p +inline b2Transform b2Mul(const b2Transform& A, const b2Transform& B) +{ + b2Transform C; + C.q = b2Mul(A.q, B.q); + C.p = b2Mul(A.q, B.p) + A.p; + return C; +} + +// v2 = A.q' * (B.q * v1 + B.p - A.p) +// = A.q' * B.q * v1 + A.q' * (B.p - A.p) +inline b2Transform b2MulT(const b2Transform& A, const b2Transform& B) +{ + b2Transform C; + C.q = b2MulT(A.q, B.q); + C.p = b2MulT(A.q, B.p - A.p); + return C; +} + +template +inline T b2Abs(T a) +{ + return a > T(0) ? a : -a; +} + +inline b2Vec2 b2Abs(const b2Vec2& a) +{ + return b2Vec2(b2Abs(a.x), b2Abs(a.y)); +} + +inline b2Mat22 b2Abs(const b2Mat22& A) +{ + return b2Mat22(b2Abs(A.ex), b2Abs(A.ey)); +} + +template +inline T b2Min(T a, T b) +{ + return a < b ? a : b; +} + +inline b2Vec2 b2Min(const b2Vec2& a, const b2Vec2& b) +{ + return b2Vec2(b2Min(a.x, b.x), b2Min(a.y, b.y)); +} + +template +inline T b2Max(T a, T b) +{ + return a > b ? a : b; +} + +inline b2Vec2 b2Max(const b2Vec2& a, const b2Vec2& b) +{ + return b2Vec2(b2Max(a.x, b.x), b2Max(a.y, b.y)); +} + +template +inline T b2Clamp(T a, T low, T high) +{ + return b2Max(low, b2Min(a, high)); +} + +inline b2Vec2 b2Clamp(const b2Vec2& a, const b2Vec2& low, const b2Vec2& high) +{ + return b2Max(low, b2Min(a, high)); +} + +template inline void b2Swap(T& a, T& b) +{ + T tmp = a; + a = b; + b = tmp; +} + +/// "Next Largest Power of 2 +/// Given a binary integer value x, the next largest power of 2 can be computed by a SWAR algorithm +/// that recursively "folds" the upper bits into the lower bits. This process yields a bit vector with +/// the same most significant 1 as x, but all 1's below it. Adding 1 to that value yields the next +/// largest power of 2. For a 32-bit value:" +inline uint32 b2NextPowerOfTwo(uint32 x) +{ + x |= (x >> 1); + x |= (x >> 2); + x |= (x >> 4); + x |= (x >> 8); + x |= (x >> 16); + return x + 1; +} + +inline bool b2IsPowerOfTwo(uint32 x) +{ + bool result = x > 0 && (x & (x - 1)) == 0; + return result; +} + +inline void b2Sweep::GetTransform(b2Transform* xf, float32 beta) const +{ + xf->p = (1.0f - beta) * c0 + beta * c; + float32 angle = (1.0f - beta) * a0 + beta * a; + xf->q.Set(angle); + + // Shift to origin + xf->p -= b2Mul(xf->q, localCenter); +} + +inline void b2Sweep::Advance(float32 alpha) +{ + b2Assert(alpha0 < 1.0f); + float32 beta = (alpha - alpha0) / (1.0f - alpha0); + c0 = (1.0f - beta) * c0 + beta * c; + a0 = (1.0f - beta) * a0 + beta * a; + alpha0 = alpha; +} + +/// Normalize an angle in radians to be between -pi and pi +inline void b2Sweep::Normalize() +{ + float32 twoPi = 2.0f * b2_pi; + float32 d = twoPi * floorf(a0 / twoPi); + a0 -= d; + a -= d; +} + +#endif diff --git a/src/Box2D/Common/b2Settings.cpp b/external/Box2d/Box2D/Common/b2Settings.cpp similarity index 94% rename from src/Box2D/Common/b2Settings.cpp rename to external/Box2d/Box2D/Common/b2Settings.cpp index 987cd3c..ab3c176 100644 --- a/src/Box2D/Common/b2Settings.cpp +++ b/external/Box2d/Box2D/Common/b2Settings.cpp @@ -21,7 +21,7 @@ #include #include -b2Version b2_version = {2, 3, 0}; +b2Version b2_version = {2, 2, 1}; // Memory allocators. Modify these to use your own allocator. void* b2Alloc(int32 size) diff --git a/external/Box2d/Box2D/Common/b2Settings.h b/external/Box2d/Box2D/Common/b2Settings.h new file mode 100644 index 0000000..7e0a165 --- /dev/null +++ b/external/Box2d/Box2D/Common/b2Settings.h @@ -0,0 +1,150 @@ +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_SETTINGS_H +#define B2_SETTINGS_H + +#include +#include + +#define B2_NOT_USED(x) ((void)(x)) +#define b2Assert(A) assert(A) + +typedef signed char int8; +typedef signed short int16; +typedef signed int int32; +typedef unsigned char uint8; +typedef unsigned short uint16; +typedef unsigned int uint32; +typedef float float32; +typedef double float64; + +#define b2_maxFloat FLT_MAX +#define b2_epsilon FLT_EPSILON +#define b2_pi 3.14159265359f + +/// @file +/// Global tuning constants based on meters-kilograms-seconds (MKS) units. +/// + +// Collision + +/// The maximum number of contact points between two convex shapes. Do +/// not change this value. +#define b2_maxManifoldPoints 2 + +/// The maximum number of vertices on a convex polygon. You cannot increase +/// this too much because b2BlockAllocator has a maximum object size. +#define b2_maxPolygonVertices 8 + +/// This is used to fatten AABBs in the dynamic tree. This allows proxies +/// to move by a small amount without triggering a tree adjustment. +/// This is in meters. +#define b2_aabbExtension 0.1f + +/// This is used to fatten AABBs in the dynamic tree. This is used to predict +/// the future position based on the current displacement. +/// This is a dimensionless multiplier. +#define b2_aabbMultiplier 2.0f + +/// A small length used as a collision and constraint tolerance. Usually it is +/// chosen to be numerically significant, but visually insignificant. +#define b2_linearSlop 0.005f + +/// A small angle used as a collision and constraint tolerance. Usually it is +/// chosen to be numerically significant, but visually insignificant. +#define b2_angularSlop (2.0f / 180.0f * b2_pi) + +/// The radius of the polygon/edge shape skin. This should not be modified. Making +/// this smaller means polygons will have an insufficient buffer for continuous collision. +/// Making it larger may create artifacts for vertex collision. +#define b2_polygonRadius (2.0f * b2_linearSlop) + +/// Maximum number of sub-steps per contact in continuous physics simulation. +#define b2_maxSubSteps 8 + + +// Dynamics + +/// Maximum number of contacts to be handled to solve a TOI impact. +#define b2_maxTOIContacts 32 + +/// A velocity threshold for elastic collisions. Any collision with a relative linear +/// velocity below this threshold will be treated as inelastic. +#define b2_velocityThreshold 1.0f + +/// The maximum linear position correction used when solving constraints. This helps to +/// prevent overshoot. +#define b2_maxLinearCorrection 0.2f + +/// The maximum angular position correction used when solving constraints. This helps to +/// prevent overshoot. +#define b2_maxAngularCorrection (8.0f / 180.0f * b2_pi) + +/// The maximum linear velocity of a body. This limit is very large and is used +/// to prevent numerical problems. You shouldn't need to adjust this. +#define b2_maxTranslation 2.0f +#define b2_maxTranslationSquared (b2_maxTranslation * b2_maxTranslation) + +/// The maximum angular velocity of a body. This limit is very large and is used +/// to prevent numerical problems. You shouldn't need to adjust this. +#define b2_maxRotation (0.5f * b2_pi) +#define b2_maxRotationSquared (b2_maxRotation * b2_maxRotation) + +/// This scale factor controls how fast overlap is resolved. Ideally this would be 1 so +/// that overlap is removed in one time step. However using values close to 1 often lead +/// to overshoot. +#define b2_baumgarte 0.2f +#define b2_toiBaugarte 0.75f + + +// Sleep + +/// The time that a body must be still before it will go to sleep. +#define b2_timeToSleep 0.5f + +/// A body cannot sleep if its linear velocity is above this tolerance. +#define b2_linearSleepTolerance 0.01f + +/// A body cannot sleep if its angular velocity is above this tolerance. +#define b2_angularSleepTolerance (2.0f / 180.0f * b2_pi) + +// Memory Allocation + +/// Implement this function to use your own memory allocator. +void* b2Alloc(int32 size); + +/// If you implement b2Alloc, you should also implement this function. +void b2Free(void* mem); + +/// Logging function. +void b2Log(const char* string, ...); + +/// Version numbering scheme. +/// See http://en.wikipedia.org/wiki/Software_versioning +struct b2Version +{ + int32 major; ///< significant changes + int32 minor; ///< incremental changes + int32 revision; ///< bug fixes +}; + +/// Current version. +extern b2Version b2_version; + +#endif diff --git a/src/Box2D/Common/b2StackAllocator.cpp b/external/Box2d/Box2D/Common/b2StackAllocator.cpp similarity index 100% rename from src/Box2D/Common/b2StackAllocator.cpp rename to external/Box2d/Box2D/Common/b2StackAllocator.cpp diff --git a/external/Box2d/Box2D/Common/b2StackAllocator.h b/external/Box2d/Box2D/Common/b2StackAllocator.h new file mode 100644 index 0000000..796c51d --- /dev/null +++ b/external/Box2d/Box2D/Common/b2StackAllocator.h @@ -0,0 +1,60 @@ +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_STACK_ALLOCATOR_H +#define B2_STACK_ALLOCATOR_H + +#include + +const int32 b2_stackSize = 100 * 1024; // 100k +const int32 b2_maxStackEntries = 32; + +struct b2StackEntry +{ + char* data; + int32 size; + bool usedMalloc; +}; + +// This is a stack allocator used for fast per step allocations. +// You must nest allocate/free pairs. The code will assert +// if you try to interleave multiple allocate/free pairs. +class b2StackAllocator +{ +public: + b2StackAllocator(); + ~b2StackAllocator(); + + void* Allocate(int32 size); + void Free(void* p); + + int32 GetMaxAllocation() const; + +private: + + char m_data[b2_stackSize]; + int32 m_index; + + int32 m_allocation; + int32 m_maxAllocation; + + b2StackEntry m_entries[b2_maxStackEntries]; + int32 m_entryCount; +}; + +#endif diff --git a/src/Box2D/Common/b2Timer.cpp b/external/Box2d/Box2D/Common/b2Timer.cpp similarity index 100% rename from src/Box2D/Common/b2Timer.cpp rename to external/Box2d/Box2D/Common/b2Timer.cpp diff --git a/external/Box2d/Box2D/Common/b2Timer.h b/external/Box2d/Box2D/Common/b2Timer.h new file mode 100644 index 0000000..19bde28 --- /dev/null +++ b/external/Box2d/Box2D/Common/b2Timer.h @@ -0,0 +1,45 @@ +/* +* Copyright (c) 2011 Erin Catto http://box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include + +/// Timer for profiling. This has platform specific code and may +/// not work on every platform. +class b2Timer +{ +public: + + /// Constructor + b2Timer(); + + /// Reset the timer. + void Reset(); + + /// Get the time since construction or the last reset. + float32 GetMilliseconds() const; + +private: + +#if defined(_WIN32) + float64 m_start; + static float64 s_invFrequency; +#elif defined(__linux__) || defined (__APPLE__) + unsigned long m_start_sec; + unsigned long m_start_msec; +#endif +}; diff --git a/src/Box2D/Dynamics/Contacts/b2ChainAndCircleContact.cpp b/external/Box2d/Box2D/Dynamics/Contacts/b2ChainAndCircleContact.cpp similarity index 100% rename from src/Box2D/Dynamics/Contacts/b2ChainAndCircleContact.cpp rename to external/Box2d/Box2D/Dynamics/Contacts/b2ChainAndCircleContact.cpp diff --git a/external/Box2d/Box2D/Dynamics/Contacts/b2ChainAndCircleContact.h b/external/Box2d/Box2D/Dynamics/Contacts/b2ChainAndCircleContact.h new file mode 100644 index 0000000..2dad0b6 --- /dev/null +++ b/external/Box2d/Box2D/Dynamics/Contacts/b2ChainAndCircleContact.h @@ -0,0 +1,39 @@ +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_CHAIN_AND_CIRCLE_CONTACT_H +#define B2_CHAIN_AND_CIRCLE_CONTACT_H + +#include + +class b2BlockAllocator; + +class b2ChainAndCircleContact : public b2Contact +{ +public: + static b2Contact* Create( b2Fixture* fixtureA, int32 indexA, + b2Fixture* fixtureB, int32 indexB, b2BlockAllocator* allocator); + static void Destroy(b2Contact* contact, b2BlockAllocator* allocator); + + b2ChainAndCircleContact(b2Fixture* fixtureA, int32 indexA, b2Fixture* fixtureB, int32 indexB); + ~b2ChainAndCircleContact() {} + + void Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB); +}; + +#endif diff --git a/src/Box2D/Dynamics/Contacts/b2ChainAndPolygonContact.cpp b/external/Box2d/Box2D/Dynamics/Contacts/b2ChainAndPolygonContact.cpp similarity index 100% rename from src/Box2D/Dynamics/Contacts/b2ChainAndPolygonContact.cpp rename to external/Box2d/Box2D/Dynamics/Contacts/b2ChainAndPolygonContact.cpp diff --git a/external/Box2d/Box2D/Dynamics/Contacts/b2ChainAndPolygonContact.h b/external/Box2d/Box2D/Dynamics/Contacts/b2ChainAndPolygonContact.h new file mode 100644 index 0000000..8f30ee8 --- /dev/null +++ b/external/Box2d/Box2D/Dynamics/Contacts/b2ChainAndPolygonContact.h @@ -0,0 +1,39 @@ +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_CHAIN_AND_POLYGON_CONTACT_H +#define B2_CHAIN_AND_POLYGON_CONTACT_H + +#include + +class b2BlockAllocator; + +class b2ChainAndPolygonContact : public b2Contact +{ +public: + static b2Contact* Create( b2Fixture* fixtureA, int32 indexA, + b2Fixture* fixtureB, int32 indexB, b2BlockAllocator* allocator); + static void Destroy(b2Contact* contact, b2BlockAllocator* allocator); + + b2ChainAndPolygonContact(b2Fixture* fixtureA, int32 indexA, b2Fixture* fixtureB, int32 indexB); + ~b2ChainAndPolygonContact() {} + + void Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB); +}; + +#endif diff --git a/src/Box2D/Dynamics/Contacts/b2CircleContact.cpp b/external/Box2d/Box2D/Dynamics/Contacts/b2CircleContact.cpp similarity index 100% rename from src/Box2D/Dynamics/Contacts/b2CircleContact.cpp rename to external/Box2d/Box2D/Dynamics/Contacts/b2CircleContact.cpp diff --git a/external/Box2d/Box2D/Dynamics/Contacts/b2CircleContact.h b/external/Box2d/Box2D/Dynamics/Contacts/b2CircleContact.h new file mode 100644 index 0000000..aac1f0b --- /dev/null +++ b/external/Box2d/Box2D/Dynamics/Contacts/b2CircleContact.h @@ -0,0 +1,39 @@ +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_CIRCLE_CONTACT_H +#define B2_CIRCLE_CONTACT_H + +#include + +class b2BlockAllocator; + +class b2CircleContact : public b2Contact +{ +public: + static b2Contact* Create( b2Fixture* fixtureA, int32 indexA, + b2Fixture* fixtureB, int32 indexB, b2BlockAllocator* allocator); + static void Destroy(b2Contact* contact, b2BlockAllocator* allocator); + + b2CircleContact(b2Fixture* fixtureA, b2Fixture* fixtureB); + ~b2CircleContact() {} + + void Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB); +}; + +#endif diff --git a/src/Box2D/Dynamics/Contacts/b2Contact.cpp b/external/Box2d/Box2D/Dynamics/Contacts/b2Contact.cpp similarity index 91% rename from src/Box2D/Dynamics/Contacts/b2Contact.cpp rename to external/Box2d/Box2D/Dynamics/Contacts/b2Contact.cpp index 8d0104e..6535f50 100644 --- a/src/Box2D/Dynamics/Contacts/b2Contact.cpp +++ b/external/Box2d/Box2D/Dynamics/Contacts/b2Contact.cpp @@ -53,7 +53,7 @@ void b2Contact::AddType(b2ContactCreateFcn* createFcn, b2ContactDestroyFcn* dest { b2Assert(0 <= type1 && type1 < b2Shape::e_typeCount); b2Assert(0 <= type2 && type2 < b2Shape::e_typeCount); - + s_registers[type1][type2].createFcn = createFcn; s_registers[type1][type2].destroyFcn = destoryFcn; s_registers[type1][type2].primary = true; @@ -79,7 +79,7 @@ b2Contact* b2Contact::Create(b2Fixture* fixtureA, int32 indexA, b2Fixture* fixtu b2Assert(0 <= type1 && type1 < b2Shape::e_typeCount); b2Assert(0 <= type2 && type2 < b2Shape::e_typeCount); - + b2ContactCreateFcn* createFcn = s_registers[type1][type2].createFcn; if (createFcn) { @@ -102,19 +102,14 @@ void b2Contact::Destroy(b2Contact* contact, b2BlockAllocator* allocator) { b2Assert(s_initialized == true); - b2Fixture* fixtureA = contact->m_fixtureA; - b2Fixture* fixtureB = contact->m_fixtureB; - - if (contact->m_manifold.pointCount > 0 && - fixtureA->IsSensor() == false && - fixtureB->IsSensor() == false) + if (contact->m_manifold.pointCount > 0) { - fixtureA->GetBody()->SetAwake(true); - fixtureB->GetBody()->SetAwake(true); + contact->GetFixtureA()->GetBody()->SetAwake(true); + contact->GetFixtureB()->GetBody()->SetAwake(true); } - b2Shape::Type typeA = fixtureA->GetType(); - b2Shape::Type typeB = fixtureB->GetType(); + b2Shape::Type typeA = contact->GetFixtureA()->GetType(); + b2Shape::Type typeB = contact->GetFixtureB()->GetType(); b2Assert(0 <= typeA && typeB < b2Shape::e_typeCount); b2Assert(0 <= typeA && typeB < b2Shape::e_typeCount); @@ -152,8 +147,6 @@ b2Contact::b2Contact(b2Fixture* fA, int32 indexA, b2Fixture* fB, int32 indexB) m_friction = b2MixFriction(m_fixtureA->m_friction, m_fixtureB->m_friction); m_restitution = b2MixRestitution(m_fixtureA->m_restitution, m_fixtureB->m_restitution); - - m_tangentSpeed = 0.0f; } // Update the contact manifold and touching status. diff --git a/external/Box2d/Box2D/Dynamics/Contacts/b2Contact.h b/external/Box2d/Box2D/Dynamics/Contacts/b2Contact.h new file mode 100644 index 0000000..7b5a6ab --- /dev/null +++ b/external/Box2d/Box2D/Dynamics/Contacts/b2Contact.h @@ -0,0 +1,331 @@ +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_CONTACT_H +#define B2_CONTACT_H + +#include +#include +#include +#include + +class b2Body; +class b2Contact; +class b2Fixture; +class b2World; +class b2BlockAllocator; +class b2StackAllocator; +class b2ContactListener; + +/// Friction mixing law. The idea is to allow either fixture to drive the restitution to zero. +/// For example, anything slides on ice. +inline float32 b2MixFriction(float32 friction1, float32 friction2) +{ + return std::sqrt(friction1 * friction2); +} + +/// Restitution mixing law. The idea is allow for anything to bounce off an inelastic surface. +/// For example, a superball bounces on anything. +inline float32 b2MixRestitution(float32 restitution1, float32 restitution2) +{ + return restitution1 > restitution2 ? restitution1 : restitution2; +} + +typedef b2Contact* b2ContactCreateFcn( b2Fixture* fixtureA, int32 indexA, + b2Fixture* fixtureB, int32 indexB, + b2BlockAllocator* allocator); +typedef void b2ContactDestroyFcn(b2Contact* contact, b2BlockAllocator* allocator); + +struct b2ContactRegister +{ + b2ContactCreateFcn* createFcn; + b2ContactDestroyFcn* destroyFcn; + bool primary; +}; + +/// A contact edge is used to connect bodies and contacts together +/// in a contact graph where each body is a node and each contact +/// is an edge. A contact edge belongs to a doubly linked list +/// maintained in each attached body. Each contact has two contact +/// nodes, one for each attached body. +struct b2ContactEdge +{ + b2Body* other; ///< provides quick access to the other body attached. + b2Contact* contact; ///< the contact + b2ContactEdge* prev; ///< the previous contact edge in the body's contact list + b2ContactEdge* next; ///< the next contact edge in the body's contact list +}; + +/// The class manages contact between two shapes. A contact exists for each overlapping +/// AABB in the broad-phase (except if filtered). Therefore a contact object may exist +/// that has no contact points. +class b2Contact +{ +public: + + /// Get the contact manifold. Do not modify the manifold unless you understand the + /// internals of Box2D. + b2Manifold* GetManifold(); + const b2Manifold* GetManifold() const; + + /// Get the world manifold. + void GetWorldManifold(b2WorldManifold* worldManifold) const; + + /// Is this contact touching? + bool IsTouching() const; + + /// Enable/disable this contact. This can be used inside the pre-solve + /// contact listener. The contact is only disabled for the current + /// time step (or sub-step in continuous collisions). + void SetEnabled(bool flag); + + /// Has this contact been disabled? + bool IsEnabled() const; + + /// Get the next contact in the world's contact list. + b2Contact* GetNext(); + const b2Contact* GetNext() const; + + /// Get fixture A in this contact. + b2Fixture* GetFixtureA(); + const b2Fixture* GetFixtureA() const; + + /// Get the child primitive index for fixture A. + int32 GetChildIndexA() const; + + /// Get fixture B in this contact. + b2Fixture* GetFixtureB(); + const b2Fixture* GetFixtureB() const; + + /// Get the child primitive index for fixture B. + int32 GetChildIndexB() const; + + /// Override the default friction mixture. You can call this in b2ContactListener::PreSolve. + /// This value persists until set or reset. + void SetFriction(float32 friction); + + /// Get the friction. + float32 GetFriction() const; + + /// Reset the friction mixture to the default value. + void ResetFriction(); + + /// Override the default restitution mixture. You can call this in b2ContactListener::PreSolve. + /// The value persists until you set or reset. + void SetRestitution(float32 restitution); + + /// Get the restitution. + float32 GetRestitution() const; + + /// Reset the restitution to the default value. + void ResetRestitution(); + + /// Evaluate this contact with your own manifold and transforms. + virtual void Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB) = 0; + +protected: + friend class b2ContactManager; + friend class b2World; + friend class b2ContactSolver; + friend class b2Body; + friend class b2Fixture; + + // Flags stored in m_flags + enum + { + // Used when crawling contact graph when forming islands. + e_islandFlag = 0x0001, + + // Set when the shapes are touching. + e_touchingFlag = 0x0002, + + // This contact can be disabled (by user) + e_enabledFlag = 0x0004, + + // This contact needs filtering because a fixture filter was changed. + e_filterFlag = 0x0008, + + // This bullet contact had a TOI event + e_bulletHitFlag = 0x0010, + + // This contact has a valid TOI in m_toi + e_toiFlag = 0x0020 + }; + + /// Flag this contact for filtering. Filtering will occur the next time step. + void FlagForFiltering(); + + static void AddType(b2ContactCreateFcn* createFcn, b2ContactDestroyFcn* destroyFcn, + b2Shape::Type typeA, b2Shape::Type typeB); + static void InitializeRegisters(); + static b2Contact* Create(b2Fixture* fixtureA, int32 indexA, b2Fixture* fixtureB, int32 indexB, b2BlockAllocator* allocator); + static void Destroy(b2Contact* contact, b2Shape::Type typeA, b2Shape::Type typeB, b2BlockAllocator* allocator); + static void Destroy(b2Contact* contact, b2BlockAllocator* allocator); + + b2Contact() : m_fixtureA(NULL), m_fixtureB(NULL) {} + b2Contact(b2Fixture* fixtureA, int32 indexA, b2Fixture* fixtureB, int32 indexB); + virtual ~b2Contact() {} + + void Update(b2ContactListener* listener); + + static b2ContactRegister s_registers[b2Shape::e_typeCount][b2Shape::e_typeCount]; + static bool s_initialized; + + uint32 m_flags; + + // World pool and list pointers. + b2Contact* m_prev; + b2Contact* m_next; + + // Nodes for connecting bodies. + b2ContactEdge m_nodeA; + b2ContactEdge m_nodeB; + + b2Fixture* m_fixtureA; + b2Fixture* m_fixtureB; + + int32 m_indexA; + int32 m_indexB; + + b2Manifold m_manifold; + + int32 m_toiCount; + float32 m_toi; + + float32 m_friction; + float32 m_restitution; +}; + +inline b2Manifold* b2Contact::GetManifold() +{ + return &m_manifold; +} + +inline const b2Manifold* b2Contact::GetManifold() const +{ + return &m_manifold; +} + +inline void b2Contact::GetWorldManifold(b2WorldManifold* worldManifold) const +{ + const b2Body* bodyA = m_fixtureA->GetBody(); + const b2Body* bodyB = m_fixtureB->GetBody(); + const b2Shape* shapeA = m_fixtureA->GetShape(); + const b2Shape* shapeB = m_fixtureB->GetShape(); + + worldManifold->Initialize(&m_manifold, bodyA->GetTransform(), shapeA->m_radius, bodyB->GetTransform(), shapeB->m_radius); +} + +inline void b2Contact::SetEnabled(bool flag) +{ + if (flag) + { + m_flags |= e_enabledFlag; + } + else + { + m_flags &= ~e_enabledFlag; + } +} + +inline bool b2Contact::IsEnabled() const +{ + return (m_flags & e_enabledFlag) == e_enabledFlag; +} + +inline bool b2Contact::IsTouching() const +{ + return (m_flags & e_touchingFlag) == e_touchingFlag; +} + +inline b2Contact* b2Contact::GetNext() +{ + return m_next; +} + +inline const b2Contact* b2Contact::GetNext() const +{ + return m_next; +} + +inline b2Fixture* b2Contact::GetFixtureA() +{ + return m_fixtureA; +} + +inline const b2Fixture* b2Contact::GetFixtureA() const +{ + return m_fixtureA; +} + +inline b2Fixture* b2Contact::GetFixtureB() +{ + return m_fixtureB; +} + +inline int32 b2Contact::GetChildIndexA() const +{ + return m_indexA; +} + +inline const b2Fixture* b2Contact::GetFixtureB() const +{ + return m_fixtureB; +} + +inline int32 b2Contact::GetChildIndexB() const +{ + return m_indexB; +} + +inline void b2Contact::FlagForFiltering() +{ + m_flags |= e_filterFlag; +} + +inline void b2Contact::SetFriction(float32 friction) +{ + m_friction = friction; +} + +inline float32 b2Contact::GetFriction() const +{ + return m_friction; +} + +inline void b2Contact::ResetFriction() +{ + m_friction = b2MixFriction(m_fixtureA->m_friction, m_fixtureB->m_friction); +} + +inline void b2Contact::SetRestitution(float32 restitution) +{ + m_restitution = restitution; +} + +inline float32 b2Contact::GetRestitution() const +{ + return m_restitution; +} + +inline void b2Contact::ResetRestitution() +{ + m_restitution = b2MixRestitution(m_fixtureA->m_restitution, m_fixtureB->m_restitution); +} + +#endif diff --git a/src/Box2D/Dynamics/Contacts/b2ContactSolver.cpp b/external/Box2d/Box2D/Dynamics/Contacts/b2ContactSolver.cpp similarity index 95% rename from src/Box2D/Dynamics/Contacts/b2ContactSolver.cpp rename to external/Box2d/Box2D/Dynamics/Contacts/b2ContactSolver.cpp index 516b725..62af88d 100644 --- a/src/Box2D/Dynamics/Contacts/b2ContactSolver.cpp +++ b/external/Box2d/Box2D/Dynamics/Contacts/b2ContactSolver.cpp @@ -73,7 +73,6 @@ b2ContactSolver::b2ContactSolver(b2ContactSolverDef* def) b2ContactVelocityConstraint* vc = m_velocityConstraints + i; vc->friction = contact->m_friction; vc->restitution = contact->m_restitution; - vc->tangentSpeed = contact->m_tangentSpeed; vc->indexA = bodyA->m_islandIndex; vc->indexB = bodyB->m_islandIndex; vc->invMassA = bodyA->m_invMass; @@ -105,7 +104,7 @@ b2ContactSolver::b2ContactSolver(b2ContactSolverDef* def) { b2ManifoldPoint* cp = manifold->points + j; b2VelocityConstraintPoint* vcp = vc->points + j; - + if (m_step.warmStarting) { vcp->normalImpulse = m_step.dtRatio * cp->normalImpulse; @@ -321,7 +320,7 @@ void b2ContactSolver::SolveVelocityConstraints() b2Vec2 dv = vB + b2Cross(wB, vcp->rB) - vA - b2Cross(wA, vcp->rA); // Compute tangent force - float32 vt = b2Dot(dv, tangent) - vc->tangentSpeed; + float32 vt = b2Dot(dv, tangent); float32 lambda = vcp->tangentMass * (-vt); // b2Clamp the accumulated force @@ -379,17 +378,17 @@ void b2ContactSolver::SolveVelocityConstraints() // implies that we must have in any solution either vn_i = 0 or x_i = 0. So for the 2D contact problem the cases // vn1 = 0 and vn2 = 0, x1 = 0 and x2 = 0, x1 = 0 and vn2 = 0, x2 = 0 and vn1 = 0 need to be tested. The first valid // solution that satisfies the problem is chosen. - // + // // In order to account of the accumulated impulse 'a' (because of the iterative nature of the solver which only requires // that the accumulated impulse is clamped and not the incremental impulse) we change the impulse variable (x_i). // // Substitute: - // + // // x = a + d - // + // // a := old total impulse // x := new total impulse - // d := incremental impulse + // d := incremental impulse // // For the current iteration we extend the formula for the incremental impulse // to compute the new total impulse: @@ -473,7 +472,7 @@ void b2ContactSolver::SolveVelocityConstraints() // // Case 2: vn1 = 0 and x2 = 0 // - // 0 = a11 * x1 + a12 * 0 + b1' + // 0 = a11 * x1 + a12 * 0 + b1' // vn2 = a21 * x1 + a22 * 0 + b2' // x.x = - cp1->normalMass * b.x; @@ -515,7 +514,7 @@ void b2ContactSolver::SolveVelocityConstraints() // // Case 3: vn2 = 0 and x1 = 0 // - // vn1 = a11 * 0 + a12 * x2 + b1' + // vn1 = a11 * 0 + a12 * x2 + b1' // 0 = a21 * 0 + a22 * x2 + b2' // x.x = 0.0f; @@ -555,7 +554,7 @@ void b2ContactSolver::SolveVelocityConstraints() // // Case 4: x1 = 0 and x2 = 0 - // + // // vn1 = b1 // vn2 = b2; x.x = 0.0f; @@ -764,8 +763,8 @@ bool b2ContactSolver::SolveTOIPositionConstraints(int32 toiIndexA, int32 toiInde iA = pc->invIA; } - float32 mB = 0.0f; - float32 iB = 0.; + float32 mB = pc->invMassB; + float32 iB = pc->invIB; if (indexB == toiIndexA || indexB == toiIndexB) { mB = pc->invMassB; diff --git a/external/Box2d/Box2D/Dynamics/Contacts/b2ContactSolver.h b/external/Box2d/Box2D/Dynamics/Contacts/b2ContactSolver.h new file mode 100644 index 0000000..ca9de04 --- /dev/null +++ b/external/Box2d/Box2D/Dynamics/Contacts/b2ContactSolver.h @@ -0,0 +1,94 @@ +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_CONTACT_SOLVER_H +#define B2_CONTACT_SOLVER_H + +#include +#include +#include + +class b2Contact; +class b2Body; +class b2StackAllocator; +struct b2ContactPositionConstraint; + +struct b2VelocityConstraintPoint +{ + b2Vec2 rA; + b2Vec2 rB; + float32 normalImpulse; + float32 tangentImpulse; + float32 normalMass; + float32 tangentMass; + float32 velocityBias; +}; + +struct b2ContactVelocityConstraint +{ + b2VelocityConstraintPoint points[b2_maxManifoldPoints]; + b2Vec2 normal; + b2Mat22 normalMass; + b2Mat22 K; + int32 indexA; + int32 indexB; + float32 invMassA, invMassB; + float32 invIA, invIB; + float32 friction; + float32 restitution; + int32 pointCount; + int32 contactIndex; +}; + +struct b2ContactSolverDef +{ + b2TimeStep step; + b2Contact** contacts; + int32 count; + b2Position* positions; + b2Velocity* velocities; + b2StackAllocator* allocator; +}; + +class b2ContactSolver +{ +public: + b2ContactSolver(b2ContactSolverDef* def); + ~b2ContactSolver(); + + void InitializeVelocityConstraints(); + + void WarmStart(); + void SolveVelocityConstraints(); + void StoreImpulses(); + + bool SolvePositionConstraints(); + bool SolveTOIPositionConstraints(int32 toiIndexA, int32 toiIndexB); + + b2TimeStep m_step; + b2Position* m_positions; + b2Velocity* m_velocities; + b2StackAllocator* m_allocator; + b2ContactPositionConstraint* m_positionConstraints; + b2ContactVelocityConstraint* m_velocityConstraints; + b2Contact** m_contacts; + int m_count; +}; + +#endif + diff --git a/src/Box2D/Dynamics/Contacts/b2EdgeAndCircleContact.cpp b/external/Box2d/Box2D/Dynamics/Contacts/b2EdgeAndCircleContact.cpp similarity index 100% rename from src/Box2D/Dynamics/Contacts/b2EdgeAndCircleContact.cpp rename to external/Box2d/Box2D/Dynamics/Contacts/b2EdgeAndCircleContact.cpp diff --git a/external/Box2d/Box2D/Dynamics/Contacts/b2EdgeAndCircleContact.h b/external/Box2d/Box2D/Dynamics/Contacts/b2EdgeAndCircleContact.h new file mode 100644 index 0000000..11b61b8 --- /dev/null +++ b/external/Box2d/Box2D/Dynamics/Contacts/b2EdgeAndCircleContact.h @@ -0,0 +1,39 @@ +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_EDGE_AND_CIRCLE_CONTACT_H +#define B2_EDGE_AND_CIRCLE_CONTACT_H + +#include + +class b2BlockAllocator; + +class b2EdgeAndCircleContact : public b2Contact +{ +public: + static b2Contact* Create( b2Fixture* fixtureA, int32 indexA, + b2Fixture* fixtureB, int32 indexB, b2BlockAllocator* allocator); + static void Destroy(b2Contact* contact, b2BlockAllocator* allocator); + + b2EdgeAndCircleContact(b2Fixture* fixtureA, b2Fixture* fixtureB); + ~b2EdgeAndCircleContact() {} + + void Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB); +}; + +#endif diff --git a/src/Box2D/Dynamics/Contacts/b2EdgeAndPolygonContact.cpp b/external/Box2d/Box2D/Dynamics/Contacts/b2EdgeAndPolygonContact.cpp similarity index 100% rename from src/Box2D/Dynamics/Contacts/b2EdgeAndPolygonContact.cpp rename to external/Box2d/Box2D/Dynamics/Contacts/b2EdgeAndPolygonContact.cpp diff --git a/external/Box2d/Box2D/Dynamics/Contacts/b2EdgeAndPolygonContact.h b/external/Box2d/Box2D/Dynamics/Contacts/b2EdgeAndPolygonContact.h new file mode 100644 index 0000000..74b27ee --- /dev/null +++ b/external/Box2d/Box2D/Dynamics/Contacts/b2EdgeAndPolygonContact.h @@ -0,0 +1,39 @@ +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_EDGE_AND_POLYGON_CONTACT_H +#define B2_EDGE_AND_POLYGON_CONTACT_H + +#include + +class b2BlockAllocator; + +class b2EdgeAndPolygonContact : public b2Contact +{ +public: + static b2Contact* Create( b2Fixture* fixtureA, int32 indexA, + b2Fixture* fixtureB, int32 indexB, b2BlockAllocator* allocator); + static void Destroy(b2Contact* contact, b2BlockAllocator* allocator); + + b2EdgeAndPolygonContact(b2Fixture* fixtureA, b2Fixture* fixtureB); + ~b2EdgeAndPolygonContact() {} + + void Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB); +}; + +#endif diff --git a/src/Box2D/Dynamics/Contacts/b2PolygonAndCircleContact.cpp b/external/Box2d/Box2D/Dynamics/Contacts/b2PolygonAndCircleContact.cpp similarity index 100% rename from src/Box2D/Dynamics/Contacts/b2PolygonAndCircleContact.cpp rename to external/Box2d/Box2D/Dynamics/Contacts/b2PolygonAndCircleContact.cpp diff --git a/external/Box2d/Box2D/Dynamics/Contacts/b2PolygonAndCircleContact.h b/external/Box2d/Box2D/Dynamics/Contacts/b2PolygonAndCircleContact.h new file mode 100644 index 0000000..6beca16 --- /dev/null +++ b/external/Box2d/Box2D/Dynamics/Contacts/b2PolygonAndCircleContact.h @@ -0,0 +1,38 @@ +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_POLYGON_AND_CIRCLE_CONTACT_H +#define B2_POLYGON_AND_CIRCLE_CONTACT_H + +#include + +class b2BlockAllocator; + +class b2PolygonAndCircleContact : public b2Contact +{ +public: + static b2Contact* Create(b2Fixture* fixtureA, int32 indexA, b2Fixture* fixtureB, int32 indexB, b2BlockAllocator* allocator); + static void Destroy(b2Contact* contact, b2BlockAllocator* allocator); + + b2PolygonAndCircleContact(b2Fixture* fixtureA, b2Fixture* fixtureB); + ~b2PolygonAndCircleContact() {} + + void Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB); +}; + +#endif diff --git a/src/Box2D/Dynamics/Contacts/b2PolygonContact.cpp b/external/Box2d/Box2D/Dynamics/Contacts/b2PolygonContact.cpp similarity index 100% rename from src/Box2D/Dynamics/Contacts/b2PolygonContact.cpp rename to external/Box2d/Box2D/Dynamics/Contacts/b2PolygonContact.cpp diff --git a/external/Box2d/Box2D/Dynamics/Contacts/b2PolygonContact.h b/external/Box2d/Box2D/Dynamics/Contacts/b2PolygonContact.h new file mode 100644 index 0000000..4593214 --- /dev/null +++ b/external/Box2d/Box2D/Dynamics/Contacts/b2PolygonContact.h @@ -0,0 +1,39 @@ +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_POLYGON_CONTACT_H +#define B2_POLYGON_CONTACT_H + +#include + +class b2BlockAllocator; + +class b2PolygonContact : public b2Contact +{ +public: + static b2Contact* Create( b2Fixture* fixtureA, int32 indexA, + b2Fixture* fixtureB, int32 indexB, b2BlockAllocator* allocator); + static void Destroy(b2Contact* contact, b2BlockAllocator* allocator); + + b2PolygonContact(b2Fixture* fixtureA, b2Fixture* fixtureB); + ~b2PolygonContact() {} + + void Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB); +}; + +#endif diff --git a/src/Box2D/Dynamics/Joints/b2DistanceJoint.cpp b/external/Box2d/Box2D/Dynamics/Joints/b2DistanceJoint.cpp similarity index 96% rename from src/Box2D/Dynamics/Joints/b2DistanceJoint.cpp rename to external/Box2d/Box2D/Dynamics/Joints/b2DistanceJoint.cpp index 1ced7d9..370865b 100644 --- a/src/Box2D/Dynamics/Joints/b2DistanceJoint.cpp +++ b/external/Box2d/Box2D/Dynamics/Joints/b2DistanceJoint.cpp @@ -26,7 +26,7 @@ // x2 = x1 + h * v2 // 1-D mass-damper-spring system -// m (v2 - v1) + h * d * v2 + h * k * +// m (v2 - v1) + h * d * v2 + h * k * // C = norm(p2 - p1) - L // u = (p2 - p1) / norm(p2 - p1) diff --git a/external/Box2d/Box2D/Dynamics/Joints/b2DistanceJoint.h b/external/Box2d/Box2D/Dynamics/Joints/b2DistanceJoint.h new file mode 100644 index 0000000..9d0528b --- /dev/null +++ b/external/Box2d/Box2D/Dynamics/Joints/b2DistanceJoint.h @@ -0,0 +1,169 @@ +/* +* Copyright (c) 2006-2007 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_DISTANCE_JOINT_H +#define B2_DISTANCE_JOINT_H + +#include + +/// Distance joint definition. This requires defining an +/// anchor point on both bodies and the non-zero length of the +/// distance joint. The definition uses local anchor points +/// so that the initial configuration can violate the constraint +/// slightly. This helps when saving and loading a game. +/// @warning Do not use a zero or short length. +struct b2DistanceJointDef : public b2JointDef +{ + b2DistanceJointDef() + { + type = e_distanceJoint; + localAnchorA.Set(0.0f, 0.0f); + localAnchorB.Set(0.0f, 0.0f); + length = 1.0f; + frequencyHz = 0.0f; + dampingRatio = 0.0f; + } + + /// Initialize the bodies, anchors, and length using the world + /// anchors. + void Initialize(b2Body* bodyA, b2Body* bodyB, + const b2Vec2& anchorA, const b2Vec2& anchorB); + + /// The local anchor point relative to bodyA's origin. + b2Vec2 localAnchorA; + + /// The local anchor point relative to bodyB's origin. + b2Vec2 localAnchorB; + + /// The natural length between the anchor points. + float32 length; + + /// The mass-spring-damper frequency in Hertz. A value of 0 + /// disables softness. + float32 frequencyHz; + + /// The damping ratio. 0 = no damping, 1 = critical damping. + float32 dampingRatio; +}; + +/// A distance joint constrains two points on two bodies +/// to remain at a fixed distance from each other. You can view +/// this as a massless, rigid rod. +class b2DistanceJoint : public b2Joint +{ +public: + + b2Vec2 GetAnchorA() const; + b2Vec2 GetAnchorB() const; + + /// Get the reaction force given the inverse time step. + /// Unit is N. + b2Vec2 GetReactionForce(float32 inv_dt) const; + + /// Get the reaction torque given the inverse time step. + /// Unit is N*m. This is always zero for a distance joint. + float32 GetReactionTorque(float32 inv_dt) const; + + /// The local anchor point relative to bodyA's origin. + const b2Vec2& GetLocalAnchorA() const { return m_localAnchorA; } + + /// The local anchor point relative to bodyB's origin. + const b2Vec2& GetLocalAnchorB() const { return m_localAnchorB; } + + /// Set/get the natural length. + /// Manipulating the length can lead to non-physical behavior when the frequency is zero. + void SetLength(float32 length); + float32 GetLength() const; + + /// Set/get frequency in Hz. + void SetFrequency(float32 hz); + float32 GetFrequency() const; + + /// Set/get damping ratio. + void SetDampingRatio(float32 ratio); + float32 GetDampingRatio() const; + + /// Dump joint to dmLog + void Dump(); + +protected: + + friend class b2Joint; + b2DistanceJoint(const b2DistanceJointDef* data); + + void InitVelocityConstraints(const b2SolverData& data); + void SolveVelocityConstraints(const b2SolverData& data); + bool SolvePositionConstraints(const b2SolverData& data); + + float32 m_frequencyHz; + float32 m_dampingRatio; + float32 m_bias; + + // Solver shared + b2Vec2 m_localAnchorA; + b2Vec2 m_localAnchorB; + float32 m_gamma; + float32 m_impulse; + float32 m_length; + + // Solver temp + int32 m_indexA; + int32 m_indexB; + b2Vec2 m_u; + b2Vec2 m_rA; + b2Vec2 m_rB; + b2Vec2 m_localCenterA; + b2Vec2 m_localCenterB; + float32 m_invMassA; + float32 m_invMassB; + float32 m_invIA; + float32 m_invIB; + float32 m_mass; +}; + +inline void b2DistanceJoint::SetLength(float32 length) +{ + m_length = length; +} + +inline float32 b2DistanceJoint::GetLength() const +{ + return m_length; +} + +inline void b2DistanceJoint::SetFrequency(float32 hz) +{ + m_frequencyHz = hz; +} + +inline float32 b2DistanceJoint::GetFrequency() const +{ + return m_frequencyHz; +} + +inline void b2DistanceJoint::SetDampingRatio(float32 ratio) +{ + m_dampingRatio = ratio; +} + +inline float32 b2DistanceJoint::GetDampingRatio() const +{ + return m_dampingRatio; +} + +#endif diff --git a/src/Box2D/Dynamics/Joints/b2FrictionJoint.cpp b/external/Box2d/Box2D/Dynamics/Joints/b2FrictionJoint.cpp similarity index 100% rename from src/Box2D/Dynamics/Joints/b2FrictionJoint.cpp rename to external/Box2d/Box2D/Dynamics/Joints/b2FrictionJoint.cpp diff --git a/include/Box2D/Dynamics/Joints/b2MotorJoint.h b/external/Box2d/Box2D/Dynamics/Joints/b2FrictionJoint.h similarity index 55% rename from include/Box2D/Dynamics/Joints/b2MotorJoint.h rename to external/Box2d/Box2D/Dynamics/Joints/b2FrictionJoint.h index d9c807a..785d9ac 100644 --- a/include/Box2D/Dynamics/Joints/b2MotorJoint.h +++ b/external/Box2d/Box2D/Dynamics/Joints/b2FrictionJoint.h @@ -1,5 +1,5 @@ /* -* Copyright (c) 2006-2012 Erin Catto http://www.box2d.org +* Copyright (c) 2006-2007 Erin Catto http://www.box2d.org * * This software is provided 'as-is', without any express or implied * warranty. In no event will the authors be held liable for any damages @@ -16,47 +16,43 @@ * 3. This notice may not be removed or altered from any source distribution. */ -#ifndef B2_MOTOR_JOINT_H -#define B2_MOTOR_JOINT_H +#ifndef B2_FRICTION_JOINT_H +#define B2_FRICTION_JOINT_H #include -/// Motor joint definition. -struct b2MotorJointDef : public b2JointDef +/// Friction joint definition. +struct b2FrictionJointDef : public b2JointDef { - b2MotorJointDef() + b2FrictionJointDef() { - type = e_motorJoint; - linearOffset.SetZero(); - angularOffset = 0.0f; - maxForce = 1.0f; - maxTorque = 1.0f; - correctionFactor = 0.3f; + type = e_frictionJoint; + localAnchorA.SetZero(); + localAnchorB.SetZero(); + maxForce = 0.0f; + maxTorque = 0.0f; } - /// Initialize the bodies and offsets using the current transforms. - void Initialize(b2Body* bodyA, b2Body* bodyB); + /// Initialize the bodies, anchors, axis, and reference angle using the world + /// anchor and world axis. + void Initialize(b2Body* bodyA, b2Body* bodyB, const b2Vec2& anchor); - /// Position of bodyB minus the position of bodyA, in bodyA's frame, in meters. - b2Vec2 linearOffset; + /// The local anchor point relative to bodyA's origin. + b2Vec2 localAnchorA; - /// The bodyB angle minus bodyA angle in radians. - float32 angularOffset; - - /// The maximum motor force in N. + /// The local anchor point relative to bodyB's origin. + b2Vec2 localAnchorB; + + /// The maximum friction force in N. float32 maxForce; - /// The maximum motor torque in N-m. + /// The maximum friction torque in N-m. float32 maxTorque; - - /// Position correction factor in the range [0,1]. - float32 correctionFactor; }; -/// A motor joint is used to control the relative motion -/// between two bodies. A typical usage is to control the movement -/// of a dynamic body with respect to the ground. -class b2MotorJoint : public b2Joint +/// Friction joint. This is used for top-down friction. +/// It provides 2D translational friction and angular friction. +class b2FrictionJoint : public b2Joint { public: b2Vec2 GetAnchorA() const; @@ -65,13 +61,11 @@ class b2MotorJoint : public b2Joint b2Vec2 GetReactionForce(float32 inv_dt) const; float32 GetReactionTorque(float32 inv_dt) const; - /// Set/get the target linear offset, in frame A, in meters. - void SetLinearOffset(const b2Vec2& linearOffset); - const b2Vec2& GetLinearOffset() const; + /// The local anchor point relative to bodyA's origin. + const b2Vec2& GetLocalAnchorA() const { return m_localAnchorA; } - /// Set/get the target angular offset, in radians. - void SetAngularOffset(float32 angularOffset); - float32 GetAngularOffset() const; + /// The local anchor point relative to bodyB's origin. + const b2Vec2& GetLocalAnchorB() const { return m_localAnchorB; } /// Set the maximum friction force in N. void SetMaxForce(float32 force); @@ -85,27 +79,27 @@ class b2MotorJoint : public b2Joint /// Get the maximum friction torque in N*m. float32 GetMaxTorque() const; - /// Dump to b2Log + /// Dump joint to dmLog void Dump(); protected: friend class b2Joint; - b2MotorJoint(const b2MotorJointDef* def); + b2FrictionJoint(const b2FrictionJointDef* def); void InitVelocityConstraints(const b2SolverData& data); void SolveVelocityConstraints(const b2SolverData& data); bool SolvePositionConstraints(const b2SolverData& data); + b2Vec2 m_localAnchorA; + b2Vec2 m_localAnchorB; + // Solver shared - b2Vec2 m_linearOffset; - float32 m_angularOffset; b2Vec2 m_linearImpulse; float32 m_angularImpulse; float32 m_maxForce; float32 m_maxTorque; - float32 m_correctionFactor; // Solver temp int32 m_indexA; @@ -114,8 +108,6 @@ class b2MotorJoint : public b2Joint b2Vec2 m_rB; b2Vec2 m_localCenterA; b2Vec2 m_localCenterB; - b2Vec2 m_linearError; - float32 m_angularError; float32 m_invMassA; float32 m_invMassB; float32 m_invIA; diff --git a/src/Box2D/Dynamics/Joints/b2GearJoint.cpp b/external/Box2d/Box2D/Dynamics/Joints/b2GearJoint.cpp similarity index 95% rename from src/Box2D/Dynamics/Joints/b2GearJoint.cpp rename to external/Box2d/Box2D/Dynamics/Joints/b2GearJoint.cpp index 233d972..201f012 100644 --- a/src/Box2D/Dynamics/Joints/b2GearJoint.cpp +++ b/external/Box2d/Box2D/Dynamics/Joints/b2GearJoint.cpp @@ -147,18 +147,22 @@ void b2GearJoint::InitVelocityConstraints(const b2SolverData& data) m_iC = m_bodyC->m_invI; m_iD = m_bodyD->m_invI; + b2Vec2 cA = data.positions[m_indexA].c; float32 aA = data.positions[m_indexA].a; b2Vec2 vA = data.velocities[m_indexA].v; float32 wA = data.velocities[m_indexA].w; + b2Vec2 cB = data.positions[m_indexB].c; float32 aB = data.positions[m_indexB].a; b2Vec2 vB = data.velocities[m_indexB].v; float32 wB = data.velocities[m_indexB].w; + b2Vec2 cC = data.positions[m_indexC].c; float32 aC = data.positions[m_indexC].a; b2Vec2 vC = data.velocities[m_indexC].v; float32 wC = data.velocities[m_indexC].w; + b2Vec2 cD = data.positions[m_indexD].c; float32 aD = data.positions[m_indexD].a; b2Vec2 vD = data.velocities[m_indexD].v; float32 wD = data.velocities[m_indexD].w; diff --git a/external/Box2d/Box2D/Dynamics/Joints/b2GearJoint.h b/external/Box2d/Box2D/Dynamics/Joints/b2GearJoint.h new file mode 100644 index 0000000..48cdfd8 --- /dev/null +++ b/external/Box2d/Box2D/Dynamics/Joints/b2GearJoint.h @@ -0,0 +1,125 @@ +/* +* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_GEAR_JOINT_H +#define B2_GEAR_JOINT_H + +#include + +/// Gear joint definition. This definition requires two existing +/// revolute or prismatic joints (any combination will work). +struct b2GearJointDef : public b2JointDef +{ + b2GearJointDef() + { + type = e_gearJoint; + joint1 = NULL; + joint2 = NULL; + ratio = 1.0f; + } + + /// The first revolute/prismatic joint attached to the gear joint. + b2Joint* joint1; + + /// The second revolute/prismatic joint attached to the gear joint. + b2Joint* joint2; + + /// The gear ratio. + /// @see b2GearJoint for explanation. + float32 ratio; +}; + +/// A gear joint is used to connect two joints together. Either joint +/// can be a revolute or prismatic joint. You specify a gear ratio +/// to bind the motions together: +/// coordinate1 + ratio * coordinate2 = constant +/// The ratio can be negative or positive. If one joint is a revolute joint +/// and the other joint is a prismatic joint, then the ratio will have units +/// of length or units of 1/length. +/// @warning You have to manually destroy the gear joint if joint1 or joint2 +/// is destroyed. +class b2GearJoint : public b2Joint +{ +public: + b2Vec2 GetAnchorA() const; + b2Vec2 GetAnchorB() const; + + b2Vec2 GetReactionForce(float32 inv_dt) const; + float32 GetReactionTorque(float32 inv_dt) const; + + /// Get the first joint. + b2Joint* GetJoint1() { return m_joint1; } + + /// Get the second joint. + b2Joint* GetJoint2() { return m_joint2; } + + /// Set/Get the gear ratio. + void SetRatio(float32 ratio); + float32 GetRatio() const; + + /// Dump joint to dmLog + void Dump(); + +protected: + + friend class b2Joint; + b2GearJoint(const b2GearJointDef* data); + + void InitVelocityConstraints(const b2SolverData& data); + void SolveVelocityConstraints(const b2SolverData& data); + bool SolvePositionConstraints(const b2SolverData& data); + + b2Joint* m_joint1; + b2Joint* m_joint2; + + b2JointType m_typeA; + b2JointType m_typeB; + + // Body A is connected to body C + // Body B is connected to body D + b2Body* m_bodyC; + b2Body* m_bodyD; + + // Solver shared + b2Vec2 m_localAnchorA; + b2Vec2 m_localAnchorB; + b2Vec2 m_localAnchorC; + b2Vec2 m_localAnchorD; + + b2Vec2 m_localAxisC; + b2Vec2 m_localAxisD; + + float32 m_referenceAngleA; + float32 m_referenceAngleB; + + float32 m_constant; + float32 m_ratio; + + float32 m_impulse; + + // Solver temp + int32 m_indexA, m_indexB, m_indexC, m_indexD; + b2Vec2 m_lcA, m_lcB, m_lcC, m_lcD; + float32 m_mA, m_mB, m_mC, m_mD; + float32 m_iA, m_iB, m_iC, m_iD; + b2Vec2 m_JvAC, m_JvBD; + float32 m_JwA, m_JwB, m_JwC, m_JwD; + float32 m_mass; +}; + +#endif diff --git a/src/Box2D/Dynamics/Joints/b2Joint.cpp b/external/Box2d/Box2D/Dynamics/Joints/b2Joint.cpp similarity index 90% rename from src/Box2D/Dynamics/Joints/b2Joint.cpp rename to external/Box2d/Box2D/Dynamics/Joints/b2Joint.cpp index 469864a..4a59b68 100644 --- a/src/Box2D/Dynamics/Joints/b2Joint.cpp +++ b/external/Box2d/Box2D/Dynamics/Joints/b2Joint.cpp @@ -27,7 +27,6 @@ #include #include #include -#include #include #include #include @@ -95,7 +94,7 @@ b2Joint* b2Joint::Create(const b2JointDef* def, b2BlockAllocator* allocator) joint = new (mem) b2WeldJoint((b2WeldJointDef*)def); } break; - + case e_frictionJoint: { void* mem = allocator->Allocate(sizeof(b2FrictionJoint)); @@ -110,13 +109,6 @@ b2Joint* b2Joint::Create(const b2JointDef* def, b2BlockAllocator* allocator) } break; - case e_motorJoint: - { - void* mem = allocator->Allocate(sizeof(b2MotorJoint)); - joint = new (mem) b2MotorJoint((b2MotorJointDef*)def); - } - break; - default: b2Assert(false); break; @@ -157,7 +149,7 @@ void b2Joint::Destroy(b2Joint* joint, b2BlockAllocator* allocator) case e_wheelJoint: allocator->Free(joint, sizeof(b2WheelJoint)); break; - + case e_weldJoint: allocator->Free(joint, sizeof(b2WeldJoint)); break; @@ -170,10 +162,6 @@ void b2Joint::Destroy(b2Joint* joint, b2BlockAllocator* allocator) allocator->Free(joint, sizeof(b2RopeJoint)); break; - case e_motorJoint: - allocator->Free(joint, sizeof(b2MotorJoint)); - break; - default: b2Assert(false); break; diff --git a/external/Box2d/Box2D/Dynamics/Joints/b2Joint.h b/external/Box2d/Box2D/Dynamics/Joints/b2Joint.h new file mode 100644 index 0000000..90154cc --- /dev/null +++ b/external/Box2d/Box2D/Dynamics/Joints/b2Joint.h @@ -0,0 +1,222 @@ +/* +* Copyright (c) 2006-2007 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_JOINT_H +#define B2_JOINT_H + +#include + +class b2Body; +class b2Joint; +struct b2SolverData; +class b2BlockAllocator; + +enum b2JointType +{ + e_unknownJoint, + e_revoluteJoint, + e_prismaticJoint, + e_distanceJoint, + e_pulleyJoint, + e_mouseJoint, + e_gearJoint, + e_wheelJoint, + e_weldJoint, + e_frictionJoint, + e_ropeJoint +}; + +enum b2LimitState +{ + e_inactiveLimit, + e_atLowerLimit, + e_atUpperLimit, + e_equalLimits +}; + +struct b2Jacobian +{ + b2Vec2 linear; + float32 angularA; + float32 angularB; +}; + +/// A joint edge is used to connect bodies and joints together +/// in a joint graph where each body is a node and each joint +/// is an edge. A joint edge belongs to a doubly linked list +/// maintained in each attached body. Each joint has two joint +/// nodes, one for each attached body. +struct b2JointEdge +{ + b2Body* other; ///< provides quick access to the other body attached. + b2Joint* joint; ///< the joint + b2JointEdge* prev; ///< the previous joint edge in the body's joint list + b2JointEdge* next; ///< the next joint edge in the body's joint list +}; + +/// Joint definitions are used to construct joints. +struct b2JointDef +{ + b2JointDef() + { + type = e_unknownJoint; + userData = NULL; + bodyA = NULL; + bodyB = NULL; + collideConnected = false; + } + + /// The joint type is set automatically for concrete joint types. + b2JointType type; + + /// Use this to attach application specific data to your joints. + void* userData; + + /// The first attached body. + b2Body* bodyA; + + /// The second attached body. + b2Body* bodyB; + + /// Set this flag to true if the attached bodies should collide. + bool collideConnected; +}; + +/// The base joint class. Joints are used to constraint two bodies together in +/// various fashions. Some joints also feature limits and motors. +class b2Joint +{ +public: + + /// Get the type of the concrete joint. + b2JointType GetType() const; + + /// Get the first body attached to this joint. + b2Body* GetBodyA(); + + /// Get the second body attached to this joint. + b2Body* GetBodyB(); + + /// Get the anchor point on bodyA in world coordinates. + virtual b2Vec2 GetAnchorA() const = 0; + + /// Get the anchor point on bodyB in world coordinates. + virtual b2Vec2 GetAnchorB() const = 0; + + /// Get the reaction force on bodyB at the joint anchor in Newtons. + virtual b2Vec2 GetReactionForce(float32 inv_dt) const = 0; + + /// Get the reaction torque on bodyB in N*m. + virtual float32 GetReactionTorque(float32 inv_dt) const = 0; + + /// Get the next joint the world joint list. + b2Joint* GetNext(); + const b2Joint* GetNext() const; + + /// Get the user data pointer. + void* GetUserData() const; + + /// Set the user data pointer. + void SetUserData(void* data); + + /// Short-cut function to determine if either body is inactive. + bool IsActive() const; + + /// Get collide connected. + /// Note: modifying the collide connect flag won't work correctly because + /// the flag is only checked when fixture AABBs begin to overlap. + bool GetCollideConnected() const; + + /// Dump this joint to the log file. + virtual void Dump() { b2Log("// Dump is not supported for this joint type.\n"); } + +protected: + friend class b2World; + friend class b2Body; + friend class b2Island; + friend class b2GearJoint; + + static b2Joint* Create(const b2JointDef* def, b2BlockAllocator* allocator); + static void Destroy(b2Joint* joint, b2BlockAllocator* allocator); + + b2Joint(const b2JointDef* def); + virtual ~b2Joint() {} + + virtual void InitVelocityConstraints(const b2SolverData& data) = 0; + virtual void SolveVelocityConstraints(const b2SolverData& data) = 0; + + // This returns true if the position errors are within tolerance. + virtual bool SolvePositionConstraints(const b2SolverData& data) = 0; + + b2JointType m_type; + b2Joint* m_prev; + b2Joint* m_next; + b2JointEdge m_edgeA; + b2JointEdge m_edgeB; + b2Body* m_bodyA; + b2Body* m_bodyB; + + int32 m_index; + + bool m_islandFlag; + bool m_collideConnected; + + void* m_userData; +}; + +inline b2JointType b2Joint::GetType() const +{ + return m_type; +} + +inline b2Body* b2Joint::GetBodyA() +{ + return m_bodyA; +} + +inline b2Body* b2Joint::GetBodyB() +{ + return m_bodyB; +} + +inline b2Joint* b2Joint::GetNext() +{ + return m_next; +} + +inline const b2Joint* b2Joint::GetNext() const +{ + return m_next; +} + +inline void* b2Joint::GetUserData() const +{ + return m_userData; +} + +inline void b2Joint::SetUserData(void* data) +{ + m_userData = data; +} + +inline bool b2Joint::GetCollideConnected() const +{ + return m_collideConnected; +} + +#endif diff --git a/src/Box2D/Dynamics/Joints/b2MouseJoint.cpp b/external/Box2d/Box2D/Dynamics/Joints/b2MouseJoint.cpp similarity index 94% rename from src/Box2D/Dynamics/Joints/b2MouseJoint.cpp rename to external/Box2d/Box2D/Dynamics/Joints/b2MouseJoint.cpp index eb1de9d..be7c383 100644 --- a/src/Box2D/Dynamics/Joints/b2MouseJoint.cpp +++ b/external/Box2d/Box2D/Dynamics/Joints/b2MouseJoint.cpp @@ -215,8 +215,3 @@ float32 b2MouseJoint::GetReactionTorque(float32 inv_dt) const { return inv_dt * 0.0f; } - -void b2MouseJoint::ShiftOrigin(const b2Vec2& newOrigin) -{ - m_targetA -= newOrigin; -} diff --git a/external/Box2d/Box2D/Dynamics/Joints/b2MouseJoint.h b/external/Box2d/Box2D/Dynamics/Joints/b2MouseJoint.h new file mode 100644 index 0000000..1f12a4d --- /dev/null +++ b/external/Box2d/Box2D/Dynamics/Joints/b2MouseJoint.h @@ -0,0 +1,126 @@ +/* +* Copyright (c) 2006-2007 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_MOUSE_JOINT_H +#define B2_MOUSE_JOINT_H + +#include + +/// Mouse joint definition. This requires a world target point, +/// tuning parameters, and the time step. +struct b2MouseJointDef : public b2JointDef +{ + b2MouseJointDef() + { + type = e_mouseJoint; + target.Set(0.0f, 0.0f); + maxForce = 0.0f; + frequencyHz = 5.0f; + dampingRatio = 0.7f; + } + + /// The initial world target point. This is assumed + /// to coincide with the body anchor initially. + b2Vec2 target; + + /// The maximum constraint force that can be exerted + /// to move the candidate body. Usually you will express + /// as some multiple of the weight (multiplier * mass * gravity). + float32 maxForce; + + /// The response speed. + float32 frequencyHz; + + /// The damping ratio. 0 = no damping, 1 = critical damping. + float32 dampingRatio; +}; + +/// A mouse joint is used to make a point on a body track a +/// specified world point. This a soft constraint with a maximum +/// force. This allows the constraint to stretch and without +/// applying huge forces. +/// NOTE: this joint is not documented in the manual because it was +/// developed to be used in the testbed. If you want to learn how to +/// use the mouse joint, look at the testbed. +class b2MouseJoint : public b2Joint +{ +public: + + /// Implements b2Joint. + b2Vec2 GetAnchorA() const; + + /// Implements b2Joint. + b2Vec2 GetAnchorB() const; + + /// Implements b2Joint. + b2Vec2 GetReactionForce(float32 inv_dt) const; + + /// Implements b2Joint. + float32 GetReactionTorque(float32 inv_dt) const; + + /// Use this to update the target point. + void SetTarget(const b2Vec2& target); + const b2Vec2& GetTarget() const; + + /// Set/get the maximum force in Newtons. + void SetMaxForce(float32 force); + float32 GetMaxForce() const; + + /// Set/get the frequency in Hertz. + void SetFrequency(float32 hz); + float32 GetFrequency() const; + + /// Set/get the damping ratio (dimensionless). + void SetDampingRatio(float32 ratio); + float32 GetDampingRatio() const; + + /// The mouse joint does not support dumping. + void Dump() { b2Log("Mouse joint dumping is not supported.\n"); } + +protected: + friend class b2Joint; + + b2MouseJoint(const b2MouseJointDef* def); + + void InitVelocityConstraints(const b2SolverData& data); + void SolveVelocityConstraints(const b2SolverData& data); + bool SolvePositionConstraints(const b2SolverData& data); + + b2Vec2 m_localAnchorB; + b2Vec2 m_targetA; + float32 m_frequencyHz; + float32 m_dampingRatio; + float32 m_beta; + + // Solver shared + b2Vec2 m_impulse; + float32 m_maxForce; + float32 m_gamma; + + // Solver temp + int32 m_indexA; + int32 m_indexB; + b2Vec2 m_rB; + b2Vec2 m_localCenterB; + float32 m_invMassB; + float32 m_invIB; + b2Mat22 m_mass; + b2Vec2 m_C; +}; + +#endif diff --git a/src/Box2D/Dynamics/Joints/b2PrismaticJoint.cpp b/external/Box2d/Box2D/Dynamics/Joints/b2PrismaticJoint.cpp similarity index 95% rename from src/Box2D/Dynamics/Joints/b2PrismaticJoint.cpp rename to external/Box2d/Box2D/Dynamics/Joints/b2PrismaticJoint.cpp index 171b012..88a3880 100644 --- a/src/Box2D/Dynamics/Joints/b2PrismaticJoint.cpp +++ b/external/Box2d/Box2D/Dynamics/Joints/b2PrismaticJoint.cpp @@ -108,7 +108,7 @@ b2PrismaticJoint::b2PrismaticJoint(const b2PrismaticJointDef* def) m_referenceAngle = def->referenceAngle; m_impulse.SetZero(); - m_motorMass = 0.0f; + m_motorMass = 0.0; m_motorImpulse = 0.0f; m_lowerTranslation = def->lowerTranslation; @@ -349,6 +349,17 @@ void b2PrismaticJoint::SolveVelocityConstraints(const b2SolverData& data) vB += mB * P; wB += iB * LB; + + b2Vec2 Cdot10 = Cdot1; + + Cdot1.x = b2Dot(m_perp, vB - vA) + m_s2 * wB - m_s1 * wA; + Cdot1.y = wB - wA; + + if (b2Abs(Cdot1.x) > 0.01f || b2Abs(Cdot1.y) > 0.01f) + { + b2Vec2 test = b2Mul22(m_K, df); + Cdot1.x += 0.0f; + } } data.velocities[m_indexA].v = vA; diff --git a/external/Box2d/Box2D/Dynamics/Joints/b2PrismaticJoint.h b/external/Box2d/Box2D/Dynamics/Joints/b2PrismaticJoint.h new file mode 100644 index 0000000..8d0f342 --- /dev/null +++ b/external/Box2d/Box2D/Dynamics/Joints/b2PrismaticJoint.h @@ -0,0 +1,196 @@ +/* +* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_PRISMATIC_JOINT_H +#define B2_PRISMATIC_JOINT_H + +#include + +/// Prismatic joint definition. This requires defining a line of +/// motion using an axis and an anchor point. The definition uses local +/// anchor points and a local axis so that the initial configuration +/// can violate the constraint slightly. The joint translation is zero +/// when the local anchor points coincide in world space. Using local +/// anchors and a local axis helps when saving and loading a game. +struct b2PrismaticJointDef : public b2JointDef +{ + b2PrismaticJointDef() + { + type = e_prismaticJoint; + localAnchorA.SetZero(); + localAnchorB.SetZero(); + localAxisA.Set(1.0f, 0.0f); + referenceAngle = 0.0f; + enableLimit = false; + lowerTranslation = 0.0f; + upperTranslation = 0.0f; + enableMotor = false; + maxMotorForce = 0.0f; + motorSpeed = 0.0f; + } + + /// Initialize the bodies, anchors, axis, and reference angle using the world + /// anchor and unit world axis. + void Initialize(b2Body* bodyA, b2Body* bodyB, const b2Vec2& anchor, const b2Vec2& axis); + + /// The local anchor point relative to bodyA's origin. + b2Vec2 localAnchorA; + + /// The local anchor point relative to bodyB's origin. + b2Vec2 localAnchorB; + + /// The local translation unit axis in bodyA. + b2Vec2 localAxisA; + + /// The constrained angle between the bodies: bodyB_angle - bodyA_angle. + float32 referenceAngle; + + /// Enable/disable the joint limit. + bool enableLimit; + + /// The lower translation limit, usually in meters. + float32 lowerTranslation; + + /// The upper translation limit, usually in meters. + float32 upperTranslation; + + /// Enable/disable the joint motor. + bool enableMotor; + + /// The maximum motor torque, usually in N-m. + float32 maxMotorForce; + + /// The desired motor speed in radians per second. + float32 motorSpeed; +}; + +/// A prismatic joint. This joint provides one degree of freedom: translation +/// along an axis fixed in bodyA. Relative rotation is prevented. You can +/// use a joint limit to restrict the range of motion and a joint motor to +/// drive the motion or to model joint friction. +class b2PrismaticJoint : public b2Joint +{ +public: + b2Vec2 GetAnchorA() const; + b2Vec2 GetAnchorB() const; + + b2Vec2 GetReactionForce(float32 inv_dt) const; + float32 GetReactionTorque(float32 inv_dt) const; + + /// The local anchor point relative to bodyA's origin. + const b2Vec2& GetLocalAnchorA() const { return m_localAnchorA; } + + /// The local anchor point relative to bodyB's origin. + const b2Vec2& GetLocalAnchorB() const { return m_localAnchorB; } + + /// The local joint axis relative to bodyA. + const b2Vec2& GetLocalAxisA() const { return m_localXAxisA; } + + /// Get the reference angle. + float32 GetReferenceAngle() const { return m_referenceAngle; } + + /// Get the current joint translation, usually in meters. + float32 GetJointTranslation() const; + + /// Get the current joint translation speed, usually in meters per second. + float32 GetJointSpeed() const; + + /// Is the joint limit enabled? + bool IsLimitEnabled() const; + + /// Enable/disable the joint limit. + void EnableLimit(bool flag); + + /// Get the lower joint limit, usually in meters. + float32 GetLowerLimit() const; + + /// Get the upper joint limit, usually in meters. + float32 GetUpperLimit() const; + + /// Set the joint limits, usually in meters. + void SetLimits(float32 lower, float32 upper); + + /// Is the joint motor enabled? + bool IsMotorEnabled() const; + + /// Enable/disable the joint motor. + void EnableMotor(bool flag); + + /// Set the motor speed, usually in meters per second. + void SetMotorSpeed(float32 speed); + + /// Get the motor speed, usually in meters per second. + float32 GetMotorSpeed() const; + + /// Set the maximum motor force, usually in N. + void SetMaxMotorForce(float32 force); + float32 GetMaxMotorForce() const { return m_maxMotorForce; } + + /// Get the current motor force given the inverse time step, usually in N. + float32 GetMotorForce(float32 inv_dt) const; + + /// Dump to b2Log + void Dump(); + +protected: + friend class b2Joint; + friend class b2GearJoint; + b2PrismaticJoint(const b2PrismaticJointDef* def); + + void InitVelocityConstraints(const b2SolverData& data); + void SolveVelocityConstraints(const b2SolverData& data); + bool SolvePositionConstraints(const b2SolverData& data); + + // Solver shared + b2Vec2 m_localAnchorA; + b2Vec2 m_localAnchorB; + b2Vec2 m_localXAxisA; + b2Vec2 m_localYAxisA; + float32 m_referenceAngle; + b2Vec3 m_impulse; + float32 m_motorImpulse; + float32 m_lowerTranslation; + float32 m_upperTranslation; + float32 m_maxMotorForce; + float32 m_motorSpeed; + bool m_enableLimit; + bool m_enableMotor; + b2LimitState m_limitState; + + // Solver temp + int32 m_indexA; + int32 m_indexB; + b2Vec2 m_localCenterA; + b2Vec2 m_localCenterB; + float32 m_invMassA; + float32 m_invMassB; + float32 m_invIA; + float32 m_invIB; + b2Vec2 m_axis, m_perp; + float32 m_s1, m_s2; + float32 m_a1, m_a2; + b2Mat33 m_K; + float32 m_motorMass; +}; + +inline float32 b2PrismaticJoint::GetMotorSpeed() const +{ + return m_motorSpeed; +} + +#endif diff --git a/src/Box2D/Dynamics/Joints/b2PulleyJoint.cpp b/external/Box2d/Box2D/Dynamics/Joints/b2PulleyJoint.cpp similarity index 93% rename from src/Box2D/Dynamics/Joints/b2PulleyJoint.cpp rename to external/Box2d/Box2D/Dynamics/Joints/b2PulleyJoint.cpp index f8b2285..e0bb7da 100644 --- a/src/Box2D/Dynamics/Joints/b2PulleyJoint.cpp +++ b/external/Box2d/Box2D/Dynamics/Joints/b2PulleyJoint.cpp @@ -292,21 +292,6 @@ b2Vec2 b2PulleyJoint::GetGroundAnchorB() const } float32 b2PulleyJoint::GetLengthA() const -{ - return m_lengthA; -} - -float32 b2PulleyJoint::GetLengthB() const -{ - return m_lengthB; -} - -float32 b2PulleyJoint::GetRatio() const -{ - return m_ratio; -} - -float32 b2PulleyJoint::GetCurrentLengthA() const { b2Vec2 p = m_bodyA->GetWorldPoint(m_localAnchorA); b2Vec2 s = m_groundAnchorA; @@ -314,7 +299,7 @@ float32 b2PulleyJoint::GetCurrentLengthA() const return d.Length(); } -float32 b2PulleyJoint::GetCurrentLengthB() const +float32 b2PulleyJoint::GetLengthB() const { b2Vec2 p = m_bodyB->GetWorldPoint(m_localAnchorB); b2Vec2 s = m_groundAnchorB; @@ -322,6 +307,11 @@ float32 b2PulleyJoint::GetCurrentLengthB() const return d.Length(); } +float32 b2PulleyJoint::GetRatio() const +{ + return m_ratio; +} + void b2PulleyJoint::Dump() { int32 indexA = m_bodyA->m_islandIndex; @@ -340,9 +330,3 @@ void b2PulleyJoint::Dump() b2Log(" jd.ratio = %.15lef;\n", m_ratio); b2Log(" joints[%d] = m_world->CreateJoint(&jd);\n", m_index); } - -void b2PulleyJoint::ShiftOrigin(const b2Vec2& newOrigin) -{ - m_groundAnchorA -= newOrigin; - m_groundAnchorB -= newOrigin; -} diff --git a/external/Box2d/Box2D/Dynamics/Joints/b2PulleyJoint.h b/external/Box2d/Box2D/Dynamics/Joints/b2PulleyJoint.h new file mode 100644 index 0000000..234bcc2 --- /dev/null +++ b/external/Box2d/Box2D/Dynamics/Joints/b2PulleyJoint.h @@ -0,0 +1,143 @@ +/* +* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_PULLEY_JOINT_H +#define B2_PULLEY_JOINT_H + +#include + +const float32 b2_minPulleyLength = 2.0f; + +/// Pulley joint definition. This requires two ground anchors, +/// two dynamic body anchor points, and a pulley ratio. +struct b2PulleyJointDef : public b2JointDef +{ + b2PulleyJointDef() + { + type = e_pulleyJoint; + groundAnchorA.Set(-1.0f, 1.0f); + groundAnchorB.Set(1.0f, 1.0f); + localAnchorA.Set(-1.0f, 0.0f); + localAnchorB.Set(1.0f, 0.0f); + lengthA = 0.0f; + lengthB = 0.0f; + ratio = 1.0f; + collideConnected = true; + } + + /// Initialize the bodies, anchors, lengths, max lengths, and ratio using the world anchors. + void Initialize(b2Body* bodyA, b2Body* bodyB, + const b2Vec2& groundAnchorA, const b2Vec2& groundAnchorB, + const b2Vec2& anchorA, const b2Vec2& anchorB, + float32 ratio); + + /// The first ground anchor in world coordinates. This point never moves. + b2Vec2 groundAnchorA; + + /// The second ground anchor in world coordinates. This point never moves. + b2Vec2 groundAnchorB; + + /// The local anchor point relative to bodyA's origin. + b2Vec2 localAnchorA; + + /// The local anchor point relative to bodyB's origin. + b2Vec2 localAnchorB; + + /// The a reference length for the segment attached to bodyA. + float32 lengthA; + + /// The a reference length for the segment attached to bodyB. + float32 lengthB; + + /// The pulley ratio, used to simulate a block-and-tackle. + float32 ratio; +}; + +/// The pulley joint is connected to two bodies and two fixed ground points. +/// The pulley supports a ratio such that: +/// length1 + ratio * length2 <= constant +/// Yes, the force transmitted is scaled by the ratio. +/// Warning: the pulley joint can get a bit squirrelly by itself. They often +/// work better when combined with prismatic joints. You should also cover the +/// the anchor points with static shapes to prevent one side from going to +/// zero length. +class b2PulleyJoint : public b2Joint +{ +public: + b2Vec2 GetAnchorA() const; + b2Vec2 GetAnchorB() const; + + b2Vec2 GetReactionForce(float32 inv_dt) const; + float32 GetReactionTorque(float32 inv_dt) const; + + /// Get the first ground anchor. + b2Vec2 GetGroundAnchorA() const; + + /// Get the second ground anchor. + b2Vec2 GetGroundAnchorB() const; + + /// Get the current length of the segment attached to bodyA. + float32 GetLengthA() const; + + /// Get the current length of the segment attached to bodyB. + float32 GetLengthB() const; + + /// Get the pulley ratio. + float32 GetRatio() const; + + /// Dump joint to dmLog + void Dump(); + +protected: + + friend class b2Joint; + b2PulleyJoint(const b2PulleyJointDef* data); + + void InitVelocityConstraints(const b2SolverData& data); + void SolveVelocityConstraints(const b2SolverData& data); + bool SolvePositionConstraints(const b2SolverData& data); + + b2Vec2 m_groundAnchorA; + b2Vec2 m_groundAnchorB; + float32 m_lengthA; + float32 m_lengthB; + + // Solver shared + b2Vec2 m_localAnchorA; + b2Vec2 m_localAnchorB; + float32 m_constant; + float32 m_ratio; + float32 m_impulse; + + // Solver temp + int32 m_indexA; + int32 m_indexB; + b2Vec2 m_uA; + b2Vec2 m_uB; + b2Vec2 m_rA; + b2Vec2 m_rB; + b2Vec2 m_localCenterA; + b2Vec2 m_localCenterB; + float32 m_invMassA; + float32 m_invMassB; + float32 m_invIA; + float32 m_invIB; + float32 m_mass; +}; + +#endif diff --git a/src/Box2D/Dynamics/Joints/b2RevoluteJoint.cpp b/external/Box2d/Box2D/Dynamics/Joints/b2RevoluteJoint.cpp similarity index 95% rename from src/Box2D/Dynamics/Joints/b2RevoluteJoint.cpp rename to external/Box2d/Box2D/Dynamics/Joints/b2RevoluteJoint.cpp index d48cae8..4572f50 100644 --- a/src/Box2D/Dynamics/Joints/b2RevoluteJoint.cpp +++ b/external/Box2d/Box2D/Dynamics/Joints/b2RevoluteJoint.cpp @@ -72,10 +72,12 @@ void b2RevoluteJoint::InitVelocityConstraints(const b2SolverData& data) m_invIA = m_bodyA->m_invI; m_invIB = m_bodyB->m_invI; + b2Vec2 cA = data.positions[m_indexA].c; float32 aA = data.positions[m_indexA].a; b2Vec2 vA = data.velocities[m_indexA].v; float32 wA = data.velocities[m_indexA].w; + b2Vec2 cB = data.positions[m_indexB].c; float32 aB = data.positions[m_indexB].a; b2Vec2 vB = data.velocities[m_indexB].v; float32 wB = data.velocities[m_indexB].w; @@ -370,7 +372,7 @@ bool b2RevoluteJoint::SolvePositionConstraints(const b2SolverData& data) data.positions[m_indexA].a = aA; data.positions[m_indexB].c = cB; data.positions[m_indexB].a = aB; - + return positionError <= b2_linearSlop && angularError <= b2_angularSlop; } @@ -469,7 +471,7 @@ float32 b2RevoluteJoint::GetUpperLimit() const void b2RevoluteJoint::SetLimits(float32 lower, float32 upper) { b2Assert(lower <= upper); - + if (lower != m_lowerAngle || upper != m_upperAngle) { m_bodyA->SetAwake(true); diff --git a/external/Box2d/Box2D/Dynamics/Joints/b2RevoluteJoint.h b/external/Box2d/Box2D/Dynamics/Joints/b2RevoluteJoint.h new file mode 100644 index 0000000..8163a45 --- /dev/null +++ b/external/Box2d/Box2D/Dynamics/Joints/b2RevoluteJoint.h @@ -0,0 +1,204 @@ +/* +* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_REVOLUTE_JOINT_H +#define B2_REVOLUTE_JOINT_H + +#include + +/// Revolute joint definition. This requires defining an +/// anchor point where the bodies are joined. The definition +/// uses local anchor points so that the initial configuration +/// can violate the constraint slightly. You also need to +/// specify the initial relative angle for joint limits. This +/// helps when saving and loading a game. +/// The local anchor points are measured from the body's origin +/// rather than the center of mass because: +/// 1. you might not know where the center of mass will be. +/// 2. if you add/remove shapes from a body and recompute the mass, +/// the joints will be broken. +struct b2RevoluteJointDef : public b2JointDef +{ + b2RevoluteJointDef() + { + type = e_revoluteJoint; + localAnchorA.Set(0.0f, 0.0f); + localAnchorB.Set(0.0f, 0.0f); + referenceAngle = 0.0f; + lowerAngle = 0.0f; + upperAngle = 0.0f; + maxMotorTorque = 0.0f; + motorSpeed = 0.0f; + enableLimit = false; + enableMotor = false; + } + + /// Initialize the bodies, anchors, and reference angle using a world + /// anchor point. + void Initialize(b2Body* bodyA, b2Body* bodyB, const b2Vec2& anchor); + + /// The local anchor point relative to bodyA's origin. + b2Vec2 localAnchorA; + + /// The local anchor point relative to bodyB's origin. + b2Vec2 localAnchorB; + + /// The bodyB angle minus bodyA angle in the reference state (radians). + float32 referenceAngle; + + /// A flag to enable joint limits. + bool enableLimit; + + /// The lower angle for the joint limit (radians). + float32 lowerAngle; + + /// The upper angle for the joint limit (radians). + float32 upperAngle; + + /// A flag to enable the joint motor. + bool enableMotor; + + /// The desired motor speed. Usually in radians per second. + float32 motorSpeed; + + /// The maximum motor torque used to achieve the desired motor speed. + /// Usually in N-m. + float32 maxMotorTorque; +}; + +/// A revolute joint constrains two bodies to share a common point while they +/// are free to rotate about the point. The relative rotation about the shared +/// point is the joint angle. You can limit the relative rotation with +/// a joint limit that specifies a lower and upper angle. You can use a motor +/// to drive the relative rotation about the shared point. A maximum motor torque +/// is provided so that infinite forces are not generated. +class b2RevoluteJoint : public b2Joint +{ +public: + b2Vec2 GetAnchorA() const; + b2Vec2 GetAnchorB() const; + + /// The local anchor point relative to bodyA's origin. + const b2Vec2& GetLocalAnchorA() const { return m_localAnchorA; } + + /// The local anchor point relative to bodyB's origin. + const b2Vec2& GetLocalAnchorB() const { return m_localAnchorB; } + + /// Get the reference angle. + float32 GetReferenceAngle() const { return m_referenceAngle; } + + /// Get the current joint angle in radians. + float32 GetJointAngle() const; + + /// Get the current joint angle speed in radians per second. + float32 GetJointSpeed() const; + + /// Is the joint limit enabled? + bool IsLimitEnabled() const; + + /// Enable/disable the joint limit. + void EnableLimit(bool flag); + + /// Get the lower joint limit in radians. + float32 GetLowerLimit() const; + + /// Get the upper joint limit in radians. + float32 GetUpperLimit() const; + + /// Set the joint limits in radians. + void SetLimits(float32 lower, float32 upper); + + /// Is the joint motor enabled? + bool IsMotorEnabled() const; + + /// Enable/disable the joint motor. + void EnableMotor(bool flag); + + /// Set the motor speed in radians per second. + void SetMotorSpeed(float32 speed); + + /// Get the motor speed in radians per second. + float32 GetMotorSpeed() const; + + /// Set the maximum motor torque, usually in N-m. + void SetMaxMotorTorque(float32 torque); + float32 GetMaxMotorTorque() const { return m_maxMotorTorque; } + + /// Get the reaction force given the inverse time step. + /// Unit is N. + b2Vec2 GetReactionForce(float32 inv_dt) const; + + /// Get the reaction torque due to the joint limit given the inverse time step. + /// Unit is N*m. + float32 GetReactionTorque(float32 inv_dt) const; + + /// Get the current motor torque given the inverse time step. + /// Unit is N*m. + float32 GetMotorTorque(float32 inv_dt) const; + + /// Dump to b2Log. + void Dump(); + +protected: + + friend class b2Joint; + friend class b2GearJoint; + + b2RevoluteJoint(const b2RevoluteJointDef* def); + + void InitVelocityConstraints(const b2SolverData& data); + void SolveVelocityConstraints(const b2SolverData& data); + bool SolvePositionConstraints(const b2SolverData& data); + + // Solver shared + b2Vec2 m_localAnchorA; + b2Vec2 m_localAnchorB; + b2Vec3 m_impulse; + float32 m_motorImpulse; + + bool m_enableMotor; + float32 m_maxMotorTorque; + float32 m_motorSpeed; + + bool m_enableLimit; + float32 m_referenceAngle; + float32 m_lowerAngle; + float32 m_upperAngle; + + // Solver temp + int32 m_indexA; + int32 m_indexB; + b2Vec2 m_rA; + b2Vec2 m_rB; + b2Vec2 m_localCenterA; + b2Vec2 m_localCenterB; + float32 m_invMassA; + float32 m_invMassB; + float32 m_invIA; + float32 m_invIB; + b2Mat33 m_mass; // effective mass for point-to-point constraint. + float32 m_motorMass; // effective mass for motor/limit angular constraint. + b2LimitState m_limitState; +}; + +inline float32 b2RevoluteJoint::GetMotorSpeed() const +{ + return m_motorSpeed; +} + +#endif diff --git a/src/Box2D/Dynamics/Joints/b2RopeJoint.cpp b/external/Box2d/Box2D/Dynamics/Joints/b2RopeJoint.cpp similarity index 100% rename from src/Box2D/Dynamics/Joints/b2RopeJoint.cpp rename to external/Box2d/Box2D/Dynamics/Joints/b2RopeJoint.cpp diff --git a/external/Box2d/Box2D/Dynamics/Joints/b2RopeJoint.h b/external/Box2d/Box2D/Dynamics/Joints/b2RopeJoint.h new file mode 100644 index 0000000..3025246 --- /dev/null +++ b/external/Box2d/Box2D/Dynamics/Joints/b2RopeJoint.h @@ -0,0 +1,114 @@ +/* +* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_ROPE_JOINT_H +#define B2_ROPE_JOINT_H + +#include + +/// Rope joint definition. This requires two body anchor points and +/// a maximum lengths. +/// Note: by default the connected objects will not collide. +/// see collideConnected in b2JointDef. +struct b2RopeJointDef : public b2JointDef +{ + b2RopeJointDef() + { + type = e_ropeJoint; + localAnchorA.Set(-1.0f, 0.0f); + localAnchorB.Set(1.0f, 0.0f); + maxLength = 0.0f; + } + + /// The local anchor point relative to bodyA's origin. + b2Vec2 localAnchorA; + + /// The local anchor point relative to bodyB's origin. + b2Vec2 localAnchorB; + + /// The maximum length of the rope. + /// Warning: this must be larger than b2_linearSlop or + /// the joint will have no effect. + float32 maxLength; +}; + +/// A rope joint enforces a maximum distance between two points +/// on two bodies. It has no other effect. +/// Warning: if you attempt to change the maximum length during +/// the simulation you will get some non-physical behavior. +/// A model that would allow you to dynamically modify the length +/// would have some sponginess, so I chose not to implement it +/// that way. See b2DistanceJoint if you want to dynamically +/// control length. +class b2RopeJoint : public b2Joint +{ +public: + b2Vec2 GetAnchorA() const; + b2Vec2 GetAnchorB() const; + + b2Vec2 GetReactionForce(float32 inv_dt) const; + float32 GetReactionTorque(float32 inv_dt) const; + + /// The local anchor point relative to bodyA's origin. + const b2Vec2& GetLocalAnchorA() const { return m_localAnchorA; } + + /// The local anchor point relative to bodyB's origin. + const b2Vec2& GetLocalAnchorB() const { return m_localAnchorB; } + + /// Set/Get the maximum length of the rope. + void SetMaxLength(float32 length) { m_maxLength = length; } + float32 GetMaxLength() const; + + b2LimitState GetLimitState() const; + + /// Dump joint to dmLog + void Dump(); + +protected: + + friend class b2Joint; + b2RopeJoint(const b2RopeJointDef* data); + + void InitVelocityConstraints(const b2SolverData& data); + void SolveVelocityConstraints(const b2SolverData& data); + bool SolvePositionConstraints(const b2SolverData& data); + + // Solver shared + b2Vec2 m_localAnchorA; + b2Vec2 m_localAnchorB; + float32 m_maxLength; + float32 m_length; + float32 m_impulse; + + // Solver temp + int32 m_indexA; + int32 m_indexB; + b2Vec2 m_u; + b2Vec2 m_rA; + b2Vec2 m_rB; + b2Vec2 m_localCenterA; + b2Vec2 m_localCenterB; + float32 m_invMassA; + float32 m_invMassB; + float32 m_invIA; + float32 m_invIB; + float32 m_mass; + b2LimitState m_state; +}; + +#endif diff --git a/src/Box2D/Dynamics/Joints/b2WeldJoint.cpp b/external/Box2d/Box2D/Dynamics/Joints/b2WeldJoint.cpp similarity index 95% rename from src/Box2D/Dynamics/Joints/b2WeldJoint.cpp rename to external/Box2d/Box2D/Dynamics/Joints/b2WeldJoint.cpp index e5cddf3..5cb5957 100644 --- a/src/Box2D/Dynamics/Joints/b2WeldJoint.cpp +++ b/external/Box2d/Box2D/Dynamics/Joints/b2WeldJoint.cpp @@ -66,10 +66,12 @@ void b2WeldJoint::InitVelocityConstraints(const b2SolverData& data) m_invIA = m_bodyA->m_invI; m_invIB = m_bodyB->m_invI; + b2Vec2 cA = data.positions[m_indexA].c; float32 aA = data.positions[m_indexA].a; b2Vec2 vA = data.velocities[m_indexA].v; float32 wA = data.velocities[m_indexA].w; + b2Vec2 cB = data.positions[m_indexB].c; float32 aB = data.positions[m_indexB].a; b2Vec2 vB = data.velocities[m_indexB].v; float32 wB = data.velocities[m_indexB].w; @@ -270,7 +272,7 @@ bool b2WeldJoint::SolvePositionConstraints(const b2SolverData& data) angularError = b2Abs(C2); b2Vec3 C(C1.x, C1.y, C2); - + b2Vec3 impulse = -K.Solve33(C); b2Vec2 P(impulse.x, impulse.y); diff --git a/external/Box2d/Box2D/Dynamics/Joints/b2WeldJoint.h b/external/Box2d/Box2D/Dynamics/Joints/b2WeldJoint.h new file mode 100644 index 0000000..0e465b1 --- /dev/null +++ b/external/Box2d/Box2D/Dynamics/Joints/b2WeldJoint.h @@ -0,0 +1,126 @@ +/* +* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_WELD_JOINT_H +#define B2_WELD_JOINT_H + +#include + +/// Weld joint definition. You need to specify local anchor points +/// where they are attached and the relative body angle. The position +/// of the anchor points is important for computing the reaction torque. +struct b2WeldJointDef : public b2JointDef +{ + b2WeldJointDef() + { + type = e_weldJoint; + localAnchorA.Set(0.0f, 0.0f); + localAnchorB.Set(0.0f, 0.0f); + referenceAngle = 0.0f; + frequencyHz = 0.0f; + dampingRatio = 0.0f; + } + + /// Initialize the bodies, anchors, and reference angle using a world + /// anchor point. + void Initialize(b2Body* bodyA, b2Body* bodyB, const b2Vec2& anchor); + + /// The local anchor point relative to bodyA's origin. + b2Vec2 localAnchorA; + + /// The local anchor point relative to bodyB's origin. + b2Vec2 localAnchorB; + + /// The bodyB angle minus bodyA angle in the reference state (radians). + float32 referenceAngle; + + /// The mass-spring-damper frequency in Hertz. Rotation only. + /// Disable softness with a value of 0. + float32 frequencyHz; + + /// The damping ratio. 0 = no damping, 1 = critical damping. + float32 dampingRatio; +}; + +/// A weld joint essentially glues two bodies together. A weld joint may +/// distort somewhat because the island constraint solver is approximate. +class b2WeldJoint : public b2Joint +{ +public: + b2Vec2 GetAnchorA() const; + b2Vec2 GetAnchorB() const; + + b2Vec2 GetReactionForce(float32 inv_dt) const; + float32 GetReactionTorque(float32 inv_dt) const; + + /// The local anchor point relative to bodyA's origin. + const b2Vec2& GetLocalAnchorA() const { return m_localAnchorA; } + + /// The local anchor point relative to bodyB's origin. + const b2Vec2& GetLocalAnchorB() const { return m_localAnchorB; } + + /// Get the reference angle. + float32 GetReferenceAngle() const { return m_referenceAngle; } + + /// Set/get frequency in Hz. + void SetFrequency(float32 hz) { m_frequencyHz = hz; } + float32 GetFrequency() const { return m_frequencyHz; } + + /// Set/get damping ratio. + void SetDampingRatio(float32 ratio) { m_dampingRatio = ratio; } + float32 GetDampingRatio() const { return m_dampingRatio; } + + /// Dump to b2Log + void Dump(); + +protected: + + friend class b2Joint; + + b2WeldJoint(const b2WeldJointDef* def); + + void InitVelocityConstraints(const b2SolverData& data); + void SolveVelocityConstraints(const b2SolverData& data); + bool SolvePositionConstraints(const b2SolverData& data); + + float32 m_frequencyHz; + float32 m_dampingRatio; + float32 m_bias; + + // Solver shared + b2Vec2 m_localAnchorA; + b2Vec2 m_localAnchorB; + float32 m_referenceAngle; + float32 m_gamma; + b2Vec3 m_impulse; + + // Solver temp + int32 m_indexA; + int32 m_indexB; + b2Vec2 m_rA; + b2Vec2 m_rB; + b2Vec2 m_localCenterA; + b2Vec2 m_localCenterB; + float32 m_invMassA; + float32 m_invMassB; + float32 m_invIA; + float32 m_invIB; + b2Mat33 m_mass; +}; + +#endif diff --git a/src/Box2D/Dynamics/Joints/b2WheelJoint.cpp b/external/Box2d/Box2D/Dynamics/Joints/b2WheelJoint.cpp similarity index 95% rename from src/Box2D/Dynamics/Joints/b2WheelJoint.cpp rename to external/Box2d/Box2D/Dynamics/Joints/b2WheelJoint.cpp index 74eda68..998c627 100644 --- a/src/Box2D/Dynamics/Joints/b2WheelJoint.cpp +++ b/external/Box2d/Box2D/Dynamics/Joints/b2WheelJoint.cpp @@ -55,7 +55,7 @@ b2WheelJoint::b2WheelJoint(const b2WheelJointDef* def) m_mass = 0.0f; m_impulse = 0.0f; - m_motorMass = 0.0f; + m_motorMass = 0.0; m_motorImpulse = 0.0f; m_springMass = 0.0f; m_springImpulse = 0.0f; diff --git a/external/Box2d/Box2D/Dynamics/Joints/b2WheelJoint.h b/external/Box2d/Box2D/Dynamics/Joints/b2WheelJoint.h new file mode 100644 index 0000000..9a8b136 --- /dev/null +++ b/external/Box2d/Box2D/Dynamics/Joints/b2WheelJoint.h @@ -0,0 +1,213 @@ +/* +* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_WHEEL_JOINT_H +#define B2_WHEEL_JOINT_H + +#include + +/// Wheel joint definition. This requires defining a line of +/// motion using an axis and an anchor point. The definition uses local +/// anchor points and a local axis so that the initial configuration +/// can violate the constraint slightly. The joint translation is zero +/// when the local anchor points coincide in world space. Using local +/// anchors and a local axis helps when saving and loading a game. +struct b2WheelJointDef : public b2JointDef +{ + b2WheelJointDef() + { + type = e_wheelJoint; + localAnchorA.SetZero(); + localAnchorB.SetZero(); + localAxisA.Set(1.0f, 0.0f); + enableMotor = false; + maxMotorTorque = 0.0f; + motorSpeed = 0.0f; + frequencyHz = 2.0f; + dampingRatio = 0.7f; + } + + /// Initialize the bodies, anchors, axis, and reference angle using the world + /// anchor and world axis. + void Initialize(b2Body* bodyA, b2Body* bodyB, const b2Vec2& anchor, const b2Vec2& axis); + + /// The local anchor point relative to bodyA's origin. + b2Vec2 localAnchorA; + + /// The local anchor point relative to bodyB's origin. + b2Vec2 localAnchorB; + + /// The local translation axis in bodyA. + b2Vec2 localAxisA; + + /// Enable/disable the joint motor. + bool enableMotor; + + /// The maximum motor torque, usually in N-m. + float32 maxMotorTorque; + + /// The desired motor speed in radians per second. + float32 motorSpeed; + + /// Suspension frequency, zero indicates no suspension + float32 frequencyHz; + + /// Suspension damping ratio, one indicates critical damping + float32 dampingRatio; +}; + +/// A wheel joint. This joint provides two degrees of freedom: translation +/// along an axis fixed in bodyA and rotation in the plane. You can use a +/// joint limit to restrict the range of motion and a joint motor to drive +/// the rotation or to model rotational friction. +/// This joint is designed for vehicle suspensions. +class b2WheelJoint : public b2Joint +{ +public: + void GetDefinition(b2WheelJointDef* def) const; + + b2Vec2 GetAnchorA() const; + b2Vec2 GetAnchorB() const; + + b2Vec2 GetReactionForce(float32 inv_dt) const; + float32 GetReactionTorque(float32 inv_dt) const; + + /// The local anchor point relative to bodyA's origin. + const b2Vec2& GetLocalAnchorA() const { return m_localAnchorA; } + + /// The local anchor point relative to bodyB's origin. + const b2Vec2& GetLocalAnchorB() const { return m_localAnchorB; } + + /// The local joint axis relative to bodyA. + const b2Vec2& GetLocalAxisA() const { return m_localXAxisA; } + + /// Get the current joint translation, usually in meters. + float32 GetJointTranslation() const; + + /// Get the current joint translation speed, usually in meters per second. + float32 GetJointSpeed() const; + + /// Is the joint motor enabled? + bool IsMotorEnabled() const; + + /// Enable/disable the joint motor. + void EnableMotor(bool flag); + + /// Set the motor speed, usually in radians per second. + void SetMotorSpeed(float32 speed); + + /// Get the motor speed, usually in radians per second. + float32 GetMotorSpeed() const; + + /// Set/Get the maximum motor force, usually in N-m. + void SetMaxMotorTorque(float32 torque); + float32 GetMaxMotorTorque() const; + + /// Get the current motor torque given the inverse time step, usually in N-m. + float32 GetMotorTorque(float32 inv_dt) const; + + /// Set/Get the spring frequency in hertz. Setting the frequency to zero disables the spring. + void SetSpringFrequencyHz(float32 hz); + float32 GetSpringFrequencyHz() const; + + /// Set/Get the spring damping ratio + void SetSpringDampingRatio(float32 ratio); + float32 GetSpringDampingRatio() const; + + /// Dump to b2Log + void Dump(); + +protected: + + friend class b2Joint; + b2WheelJoint(const b2WheelJointDef* def); + + void InitVelocityConstraints(const b2SolverData& data); + void SolveVelocityConstraints(const b2SolverData& data); + bool SolvePositionConstraints(const b2SolverData& data); + + float32 m_frequencyHz; + float32 m_dampingRatio; + + // Solver shared + b2Vec2 m_localAnchorA; + b2Vec2 m_localAnchorB; + b2Vec2 m_localXAxisA; + b2Vec2 m_localYAxisA; + + float32 m_impulse; + float32 m_motorImpulse; + float32 m_springImpulse; + + float32 m_maxMotorTorque; + float32 m_motorSpeed; + bool m_enableMotor; + + // Solver temp + int32 m_indexA; + int32 m_indexB; + b2Vec2 m_localCenterA; + b2Vec2 m_localCenterB; + float32 m_invMassA; + float32 m_invMassB; + float32 m_invIA; + float32 m_invIB; + + b2Vec2 m_ax, m_ay; + float32 m_sAx, m_sBx; + float32 m_sAy, m_sBy; + + float32 m_mass; + float32 m_motorMass; + float32 m_springMass; + + float32 m_bias; + float32 m_gamma; +}; + +inline float32 b2WheelJoint::GetMotorSpeed() const +{ + return m_motorSpeed; +} + +inline float32 b2WheelJoint::GetMaxMotorTorque() const +{ + return m_maxMotorTorque; +} + +inline void b2WheelJoint::SetSpringFrequencyHz(float32 hz) +{ + m_frequencyHz = hz; +} + +inline float32 b2WheelJoint::GetSpringFrequencyHz() const +{ + return m_frequencyHz; +} + +inline void b2WheelJoint::SetSpringDampingRatio(float32 ratio) +{ + m_dampingRatio = ratio; +} + +inline float32 b2WheelJoint::GetSpringDampingRatio() const +{ + return m_dampingRatio; +} + +#endif diff --git a/src/Box2D/Dynamics/b2Body.cpp b/external/Box2d/Box2D/Dynamics/b2Body.cpp similarity index 89% rename from src/Box2D/Dynamics/b2Body.cpp rename to external/Box2d/Box2D/Dynamics/b2Body.cpp index b1684cb..3fc5282 100644 --- a/src/Box2D/Dynamics/b2Body.cpp +++ b/external/Box2d/Box2D/Dynamics/b2Body.cpp @@ -141,25 +141,10 @@ void b2Body::SetType(b2BodyType type) m_force.SetZero(); m_torque = 0.0f; - // Delete the attached contacts. - b2ContactEdge* ce = m_contactList; - while (ce) - { - b2ContactEdge* ce0 = ce; - ce = ce->next; - m_world->m_contactManager.Destroy(ce0->contact); - } - m_contactList = NULL; - - // Touch the proxies so that new contacts will be created (when appropriate) - b2BroadPhase* broadPhase = &m_world->m_contactManager.m_broadPhase; + // Since the body type changed, we need to flag contacts for filtering. for (b2Fixture* f = m_fixtureList; f; f = f->m_next) { - int32 proxyCount = f->m_proxyCount; - for (int32 i = 0; i < proxyCount; ++i) - { - broadPhase->TouchProxy(f->m_proxies[i].proxyId); - } + f->Refilter(); } } @@ -498,28 +483,6 @@ void b2Body::SetActive(bool flag) } } -void b2Body::SetFixedRotation(bool flag) -{ - bool status = (m_flags & e_fixedRotationFlag) == e_fixedRotationFlag; - if (status == flag) - { - return; - } - - if (flag) - { - m_flags |= e_fixedRotationFlag; - } - else - { - m_flags &= ~e_fixedRotationFlag; - } - - m_angularVelocity = 0.0f; - - ResetMassData(); -} - void b2Body::Dump() { int32 bodyIndex = m_islandIndex; diff --git a/external/Box2d/Box2D/Dynamics/b2Body.h b/external/Box2d/Box2D/Dynamics/b2Body.h new file mode 100644 index 0000000..a65eb3f --- /dev/null +++ b/external/Box2d/Box2D/Dynamics/b2Body.h @@ -0,0 +1,846 @@ +/* +* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_BODY_H +#define B2_BODY_H + +#include +#include +#include + +class b2Fixture; +class b2Joint; +class b2Contact; +class b2Controller; +class b2World; +struct b2FixtureDef; +struct b2JointEdge; +struct b2ContactEdge; + +/// The body type. +/// static: zero mass, zero velocity, may be manually moved +/// kinematic: zero mass, non-zero velocity set by user, moved by solver +/// dynamic: positive mass, non-zero velocity determined by forces, moved by solver +enum b2BodyType +{ + b2_staticBody = 0, + b2_kinematicBody, + b2_dynamicBody + + // TODO_ERIN + //b2_bulletBody, +}; + +/// A body definition holds all the data needed to construct a rigid body. +/// You can safely re-use body definitions. Shapes are added to a body after construction. +struct b2BodyDef +{ + /// This constructor sets the body definition default values. + b2BodyDef() + { + userData = NULL; + position.Set(0.0f, 0.0f); + angle = 0.0f; + linearVelocity.Set(0.0f, 0.0f); + angularVelocity = 0.0f; + linearDamping = 0.0f; + angularDamping = 0.0f; + allowSleep = true; + awake = true; + fixedRotation = false; + bullet = false; + type = b2_staticBody; + active = true; + gravityScale = 1.0f; + } + + /// The body type: static, kinematic, or dynamic. + /// Note: if a dynamic body would have zero mass, the mass is set to one. + b2BodyType type; + + /// The world position of the body. Avoid creating bodies at the origin + /// since this can lead to many overlapping shapes. + b2Vec2 position; + + /// The world angle of the body in radians. + float32 angle; + + /// The linear velocity of the body's origin in world co-ordinates. + b2Vec2 linearVelocity; + + /// The angular velocity of the body. + float32 angularVelocity; + + /// Linear damping is use to reduce the linear velocity. The damping parameter + /// can be larger than 1.0f but the damping effect becomes sensitive to the + /// time step when the damping parameter is large. + float32 linearDamping; + + /// Angular damping is use to reduce the angular velocity. The damping parameter + /// can be larger than 1.0f but the damping effect becomes sensitive to the + /// time step when the damping parameter is large. + float32 angularDamping; + + /// Set this flag to false if this body should never fall asleep. Note that + /// this increases CPU usage. + bool allowSleep; + + /// Is this body initially awake or sleeping? + bool awake; + + /// Should this body be prevented from rotating? Useful for characters. + bool fixedRotation; + + /// Is this a fast moving body that should be prevented from tunneling through + /// other moving bodies? Note that all bodies are prevented from tunneling through + /// kinematic and static bodies. This setting is only considered on dynamic bodies. + /// @warning You should use this flag sparingly since it increases processing time. + bool bullet; + + /// Does this body start out active? + bool active; + + /// Use this to store application specific body data. + void* userData; + + /// Scale the gravity applied to this body. + float32 gravityScale; +}; + +/// A rigid body. These are created via b2World::CreateBody. +class b2Body +{ +public: + /// Creates a fixture and attach it to this body. Use this function if you need + /// to set some fixture parameters, like friction. Otherwise you can create the + /// fixture directly from a shape. + /// If the density is non-zero, this function automatically updates the mass of the body. + /// Contacts are not created until the next time step. + /// @param def the fixture definition. + /// @warning This function is locked during callbacks. + b2Fixture* CreateFixture(const b2FixtureDef* def); + + /// Creates a fixture from a shape and attach it to this body. + /// This is a convenience function. Use b2FixtureDef if you need to set parameters + /// like friction, restitution, user data, or filtering. + /// If the density is non-zero, this function automatically updates the mass of the body. + /// @param shape the shape to be cloned. + /// @param density the shape density (set to zero for static bodies). + /// @warning This function is locked during callbacks. + b2Fixture* CreateFixture(const b2Shape* shape, float32 density); + + /// Destroy a fixture. This removes the fixture from the broad-phase and + /// destroys all contacts associated with this fixture. This will + /// automatically adjust the mass of the body if the body is dynamic and the + /// fixture has positive density. + /// All fixtures attached to a body are implicitly destroyed when the body is destroyed. + /// @param fixture the fixture to be removed. + /// @warning This function is locked during callbacks. + void DestroyFixture(b2Fixture* fixture); + + /// Set the position of the body's origin and rotation. + /// This breaks any contacts and wakes the other bodies. + /// Manipulating a body's transform may cause non-physical behavior. + /// @param position the world position of the body's local origin. + /// @param angle the world rotation in radians. + void SetTransform(const b2Vec2& position, float32 angle); + + /// Get the body transform for the body's origin. + /// @return the world transform of the body's origin. + const b2Transform& GetTransform() const; + + /// Get the world body origin position. + /// @return the world position of the body's origin. + const b2Vec2& GetPosition() const; + + /// Get the angle in radians. + /// @return the current world rotation angle in radians. + float32 GetAngle() const; + + /// Get the world position of the center of mass. + const b2Vec2& GetWorldCenter() const; + + /// Get the local position of the center of mass. + const b2Vec2& GetLocalCenter() const; + + /// Set the linear velocity of the center of mass. + /// @param v the new linear velocity of the center of mass. + void SetLinearVelocity(const b2Vec2& v); + + /// Get the linear velocity of the center of mass. + /// @return the linear velocity of the center of mass. + b2Vec2 GetLinearVelocity() const; + + /// Set the angular velocity. + /// @param omega the new angular velocity in radians/second. + void SetAngularVelocity(float32 omega); + + /// Get the angular velocity. + /// @return the angular velocity in radians/second. + float32 GetAngularVelocity() const; + + /// Apply a force at a world point. If the force is not + /// applied at the center of mass, it will generate a torque and + /// affect the angular velocity. This wakes up the body. + /// @param force the world force vector, usually in Newtons (N). + /// @param point the world position of the point of application. + void ApplyForce(const b2Vec2& force, const b2Vec2& point); + + /// Apply a force to the center of mass. This wakes up the body. + /// @param force the world force vector, usually in Newtons (N). + void ApplyForceToCenter(const b2Vec2& force); + + /// Apply a torque. This affects the angular velocity + /// without affecting the linear velocity of the center of mass. + /// This wakes up the body. + /// @param torque about the z-axis (out of the screen), usually in N-m. + void ApplyTorque(float32 torque); + + /// Apply an impulse at a point. This immediately modifies the velocity. + /// It also modifies the angular velocity if the point of application + /// is not at the center of mass. This wakes up the body. + /// @param impulse the world impulse vector, usually in N-seconds or kg-m/s. + /// @param point the world position of the point of application. + void ApplyLinearImpulse(const b2Vec2& impulse, const b2Vec2& point); + + /// Apply an angular impulse. + /// @param impulse the angular impulse in units of kg*m*m/s + void ApplyAngularImpulse(float32 impulse); + + /// Get the total mass of the body. + /// @return the mass, usually in kilograms (kg). + float32 GetMass() const; + + /// Get the rotational inertia of the body about the local origin. + /// @return the rotational inertia, usually in kg-m^2. + float32 GetInertia() const; + + /// Get the mass data of the body. + /// @return a struct containing the mass, inertia and center of the body. + void GetMassData(b2MassData* data) const; + + /// Set the mass properties to override the mass properties of the fixtures. + /// Note that this changes the center of mass position. + /// Note that creating or destroying fixtures can also alter the mass. + /// This function has no effect if the body isn't dynamic. + /// @param massData the mass properties. + void SetMassData(const b2MassData* data); + + /// This resets the mass properties to the sum of the mass properties of the fixtures. + /// This normally does not need to be called unless you called SetMassData to override + /// the mass and you later want to reset the mass. + void ResetMassData(); + + /// Get the world coordinates of a point given the local coordinates. + /// @param localPoint a point on the body measured relative the the body's origin. + /// @return the same point expressed in world coordinates. + b2Vec2 GetWorldPoint(const b2Vec2& localPoint) const; + + /// Get the world coordinates of a vector given the local coordinates. + /// @param localVector a vector fixed in the body. + /// @return the same vector expressed in world coordinates. + b2Vec2 GetWorldVector(const b2Vec2& localVector) const; + + /// Gets a local point relative to the body's origin given a world point. + /// @param a point in world coordinates. + /// @return the corresponding local point relative to the body's origin. + b2Vec2 GetLocalPoint(const b2Vec2& worldPoint) const; + + /// Gets a local vector given a world vector. + /// @param a vector in world coordinates. + /// @return the corresponding local vector. + b2Vec2 GetLocalVector(const b2Vec2& worldVector) const; + + /// Get the world linear velocity of a world point attached to this body. + /// @param a point in world coordinates. + /// @return the world velocity of a point. + b2Vec2 GetLinearVelocityFromWorldPoint(const b2Vec2& worldPoint) const; + + /// Get the world velocity of a local point. + /// @param a point in local coordinates. + /// @return the world velocity of a point. + b2Vec2 GetLinearVelocityFromLocalPoint(const b2Vec2& localPoint) const; + + /// Get the linear damping of the body. + float32 GetLinearDamping() const; + + /// Set the linear damping of the body. + void SetLinearDamping(float32 linearDamping); + + /// Get the angular damping of the body. + float32 GetAngularDamping() const; + + /// Set the angular damping of the body. + void SetAngularDamping(float32 angularDamping); + + /// Get the gravity scale of the body. + float32 GetGravityScale() const; + + /// Set the gravity scale of the body. + void SetGravityScale(float32 scale); + + /// Set the type of this body. This may alter the mass and velocity. + void SetType(b2BodyType type); + + /// Get the type of this body. + b2BodyType GetType() const; + + /// Should this body be treated like a bullet for continuous collision detection? + void SetBullet(bool flag); + + /// Is this body treated like a bullet for continuous collision detection? + bool IsBullet() const; + + /// You can disable sleeping on this body. If you disable sleeping, the + /// body will be woken. + void SetSleepingAllowed(bool flag); + + /// Is this body allowed to sleep + bool IsSleepingAllowed() const; + + /// Set the sleep state of the body. A sleeping body has very + /// low CPU cost. + /// @param flag set to true to put body to sleep, false to wake it. + void SetAwake(bool flag); + + /// Get the sleeping state of this body. + /// @return true if the body is sleeping. + bool IsAwake() const; + + /// Set the active state of the body. An inactive body is not + /// simulated and cannot be collided with or woken up. + /// If you pass a flag of true, all fixtures will be added to the + /// broad-phase. + /// If you pass a flag of false, all fixtures will be removed from + /// the broad-phase and all contacts will be destroyed. + /// Fixtures and joints are otherwise unaffected. You may continue + /// to create/destroy fixtures and joints on inactive bodies. + /// Fixtures on an inactive body are implicitly inactive and will + /// not participate in collisions, ray-casts, or queries. + /// Joints connected to an inactive body are implicitly inactive. + /// An inactive body is still owned by a b2World object and remains + /// in the body list. + void SetActive(bool flag); + + /// Get the active state of the body. + bool IsActive() const; + + /// Set this body to have fixed rotation. This causes the mass + /// to be reset. + void SetFixedRotation(bool flag); + + /// Does this body have fixed rotation? + bool IsFixedRotation() const; + + /// Get the list of all fixtures attached to this body. + b2Fixture* GetFixtureList(); + const b2Fixture* GetFixtureList() const; + + /// Get the list of all joints attached to this body. + b2JointEdge* GetJointList(); + const b2JointEdge* GetJointList() const; + + /// Get the list of all contacts attached to this body. + /// @warning this list changes during the time step and you may + /// miss some collisions if you don't use b2ContactListener. + b2ContactEdge* GetContactList(); + const b2ContactEdge* GetContactList() const; + + /// Get the next body in the world's body list. + b2Body* GetNext(); + const b2Body* GetNext() const; + + /// Get the user data pointer that was provided in the body definition. + void* GetUserData() const; + + /// Set the user data. Use this to store your application specific data. + void SetUserData(void* data); + + /// Get the parent world of this body. + b2World* GetWorld(); + const b2World* GetWorld() const; + + /// Dump this body to a log file + void Dump(); + +private: + + friend class b2World; + friend class b2Island; + friend class b2ContactManager; + friend class b2ContactSolver; + friend class b2Contact; + + friend class b2DistanceJoint; + friend class b2GearJoint; + friend class b2WheelJoint; + friend class b2MouseJoint; + friend class b2PrismaticJoint; + friend class b2PulleyJoint; + friend class b2RevoluteJoint; + friend class b2WeldJoint; + friend class b2FrictionJoint; + friend class b2RopeJoint; + + // m_flags + enum + { + e_islandFlag = 0x0001, + e_awakeFlag = 0x0002, + e_autoSleepFlag = 0x0004, + e_bulletFlag = 0x0008, + e_fixedRotationFlag = 0x0010, + e_activeFlag = 0x0020, + e_toiFlag = 0x0040 + }; + + b2Body(const b2BodyDef* bd, b2World* world); + ~b2Body(); + + void SynchronizeFixtures(); + void SynchronizeTransform(); + + // This is used to prevent connected bodies from colliding. + // It may lie, depending on the collideConnected flag. + bool ShouldCollide(const b2Body* other) const; + + void Advance(float32 t); + + b2BodyType m_type; + + uint16 m_flags; + + int32 m_islandIndex; + + b2Transform m_xf; // the body origin transform + b2Sweep m_sweep; // the swept motion for CCD + + b2Vec2 m_linearVelocity; + float32 m_angularVelocity; + + b2Vec2 m_force; + float32 m_torque; + + b2World* m_world; + b2Body* m_prev; + b2Body* m_next; + + b2Fixture* m_fixtureList; + int32 m_fixtureCount; + + b2JointEdge* m_jointList; + b2ContactEdge* m_contactList; + + float32 m_mass, m_invMass; + + // Rotational inertia about the center of mass. + float32 m_I, m_invI; + + float32 m_linearDamping; + float32 m_angularDamping; + float32 m_gravityScale; + + float32 m_sleepTime; + + void* m_userData; +}; + +inline b2BodyType b2Body::GetType() const +{ + return m_type; +} + +inline const b2Transform& b2Body::GetTransform() const +{ + return m_xf; +} + +inline const b2Vec2& b2Body::GetPosition() const +{ + return m_xf.p; +} + +inline float32 b2Body::GetAngle() const +{ + return m_sweep.a; +} + +inline const b2Vec2& b2Body::GetWorldCenter() const +{ + return m_sweep.c; +} + +inline const b2Vec2& b2Body::GetLocalCenter() const +{ + return m_sweep.localCenter; +} + +inline void b2Body::SetLinearVelocity(const b2Vec2& v) +{ + if (m_type == b2_staticBody) + { + return; + } + + if (b2Dot(v,v) > 0.0f) + { + SetAwake(true); + } + + m_linearVelocity = v; +} + +inline b2Vec2 b2Body::GetLinearVelocity() const +{ + return m_linearVelocity; +} + +inline void b2Body::SetAngularVelocity(float32 w) +{ + if (m_type == b2_staticBody) + { + return; + } + + if (w * w > 0.0f) + { + SetAwake(true); + } + + m_angularVelocity = w; +} + +inline float32 b2Body::GetAngularVelocity() const +{ + return m_angularVelocity; +} + +inline float32 b2Body::GetMass() const +{ + return m_mass; +} + +inline float32 b2Body::GetInertia() const +{ + return m_I + m_mass * b2Dot(m_sweep.localCenter, m_sweep.localCenter); +} + +inline void b2Body::GetMassData(b2MassData* data) const +{ + data->mass = m_mass; + data->I = m_I + m_mass * b2Dot(m_sweep.localCenter, m_sweep.localCenter); + data->center = m_sweep.localCenter; +} + +inline b2Vec2 b2Body::GetWorldPoint(const b2Vec2& localPoint) const +{ + return b2Mul(m_xf, localPoint); +} + +inline b2Vec2 b2Body::GetWorldVector(const b2Vec2& localVector) const +{ + return b2Mul(m_xf.q, localVector); +} + +inline b2Vec2 b2Body::GetLocalPoint(const b2Vec2& worldPoint) const +{ + return b2MulT(m_xf, worldPoint); +} + +inline b2Vec2 b2Body::GetLocalVector(const b2Vec2& worldVector) const +{ + return b2MulT(m_xf.q, worldVector); +} + +inline b2Vec2 b2Body::GetLinearVelocityFromWorldPoint(const b2Vec2& worldPoint) const +{ + return m_linearVelocity + b2Cross(m_angularVelocity, worldPoint - m_sweep.c); +} + +inline b2Vec2 b2Body::GetLinearVelocityFromLocalPoint(const b2Vec2& localPoint) const +{ + return GetLinearVelocityFromWorldPoint(GetWorldPoint(localPoint)); +} + +inline float32 b2Body::GetLinearDamping() const +{ + return m_linearDamping; +} + +inline void b2Body::SetLinearDamping(float32 linearDamping) +{ + m_linearDamping = linearDamping; +} + +inline float32 b2Body::GetAngularDamping() const +{ + return m_angularDamping; +} + +inline void b2Body::SetAngularDamping(float32 angularDamping) +{ + m_angularDamping = angularDamping; +} + +inline float32 b2Body::GetGravityScale() const +{ + return m_gravityScale; +} + +inline void b2Body::SetGravityScale(float32 scale) +{ + m_gravityScale = scale; +} + +inline void b2Body::SetBullet(bool flag) +{ + if (flag) + { + m_flags |= e_bulletFlag; + } + else + { + m_flags &= ~e_bulletFlag; + } +} + +inline bool b2Body::IsBullet() const +{ + return (m_flags & e_bulletFlag) == e_bulletFlag; +} + +inline void b2Body::SetAwake(bool flag) +{ + if (flag) + { + if ((m_flags & e_awakeFlag) == 0) + { + m_flags |= e_awakeFlag; + m_sleepTime = 0.0f; + } + } + else + { + m_flags &= ~e_awakeFlag; + m_sleepTime = 0.0f; + m_linearVelocity.SetZero(); + m_angularVelocity = 0.0f; + m_force.SetZero(); + m_torque = 0.0f; + } +} + +inline bool b2Body::IsAwake() const +{ + return (m_flags & e_awakeFlag) == e_awakeFlag; +} + +inline bool b2Body::IsActive() const +{ + return (m_flags & e_activeFlag) == e_activeFlag; +} + +inline void b2Body::SetFixedRotation(bool flag) +{ + if (flag) + { + m_flags |= e_fixedRotationFlag; + } + else + { + m_flags &= ~e_fixedRotationFlag; + } + + ResetMassData(); +} + +inline bool b2Body::IsFixedRotation() const +{ + return (m_flags & e_fixedRotationFlag) == e_fixedRotationFlag; +} + +inline void b2Body::SetSleepingAllowed(bool flag) +{ + if (flag) + { + m_flags |= e_autoSleepFlag; + } + else + { + m_flags &= ~e_autoSleepFlag; + SetAwake(true); + } +} + +inline bool b2Body::IsSleepingAllowed() const +{ + return (m_flags & e_autoSleepFlag) == e_autoSleepFlag; +} + +inline b2Fixture* b2Body::GetFixtureList() +{ + return m_fixtureList; +} + +inline const b2Fixture* b2Body::GetFixtureList() const +{ + return m_fixtureList; +} + +inline b2JointEdge* b2Body::GetJointList() +{ + return m_jointList; +} + +inline const b2JointEdge* b2Body::GetJointList() const +{ + return m_jointList; +} + +inline b2ContactEdge* b2Body::GetContactList() +{ + return m_contactList; +} + +inline const b2ContactEdge* b2Body::GetContactList() const +{ + return m_contactList; +} + +inline b2Body* b2Body::GetNext() +{ + return m_next; +} + +inline const b2Body* b2Body::GetNext() const +{ + return m_next; +} + +inline void b2Body::SetUserData(void* data) +{ + m_userData = data; +} + +inline void* b2Body::GetUserData() const +{ + return m_userData; +} + +inline void b2Body::ApplyForce(const b2Vec2& force, const b2Vec2& point) +{ + if (m_type != b2_dynamicBody) + { + return; + } + + if (IsAwake() == false) + { + SetAwake(true); + } + + m_force += force; + m_torque += b2Cross(point - m_sweep.c, force); +} + +inline void b2Body::ApplyForceToCenter(const b2Vec2& force) +{ + if (m_type != b2_dynamicBody) + { + return; + } + + if (IsAwake() == false) + { + SetAwake(true); + } + + m_force += force; +} + +inline void b2Body::ApplyTorque(float32 torque) +{ + if (m_type != b2_dynamicBody) + { + return; + } + + if (IsAwake() == false) + { + SetAwake(true); + } + + m_torque += torque; +} + +inline void b2Body::ApplyLinearImpulse(const b2Vec2& impulse, const b2Vec2& point) +{ + if (m_type != b2_dynamicBody) + { + return; + } + + if (IsAwake() == false) + { + SetAwake(true); + } + m_linearVelocity += m_invMass * impulse; + m_angularVelocity += m_invI * b2Cross(point - m_sweep.c, impulse); +} + +inline void b2Body::ApplyAngularImpulse(float32 impulse) +{ + if (m_type != b2_dynamicBody) + { + return; + } + + if (IsAwake() == false) + { + SetAwake(true); + } + m_angularVelocity += m_invI * impulse; +} + +inline void b2Body::SynchronizeTransform() +{ + m_xf.q.Set(m_sweep.a); + m_xf.p = m_sweep.c - b2Mul(m_xf.q, m_sweep.localCenter); +} + +inline void b2Body::Advance(float32 alpha) +{ + // Advance to the new safe time. This doesn't sync the broad-phase. + m_sweep.Advance(alpha); + m_sweep.c = m_sweep.c0; + m_sweep.a = m_sweep.a0; + m_xf.q.Set(m_sweep.a); + m_xf.p = m_sweep.c - b2Mul(m_xf.q, m_sweep.localCenter); +} + +inline b2World* b2Body::GetWorld() +{ + return m_world; +} + +inline const b2World* b2Body::GetWorld() const +{ + return m_world; +} + +#endif diff --git a/src/Box2D/Dynamics/b2ContactManager.cpp b/external/Box2d/Box2D/Dynamics/b2ContactManager.cpp similarity index 94% rename from src/Box2D/Dynamics/b2ContactManager.cpp rename to external/Box2d/Box2D/Dynamics/b2ContactManager.cpp index d71439c..2829dfa 100644 --- a/src/Box2D/Dynamics/b2ContactManager.cpp +++ b/external/Box2d/Box2D/Dynamics/b2ContactManager.cpp @@ -114,7 +114,7 @@ void b2ContactManager::Collide() int32 indexB = c->GetChildIndexB(); b2Body* bodyA = fixtureA->GetBody(); b2Body* bodyB = fixtureB->GetBody(); - + // Is this contact flagged for filtering? if (c->m_flags & b2Contact::e_filterFlag) { @@ -286,11 +286,8 @@ void b2ContactManager::AddPair(void* proxyUserDataA, void* proxyUserDataB) bodyB->m_contactList = &c->m_nodeB; // Wake up the bodies - if (fixtureA->IsSensor() == false && fixtureB->IsSensor() == false) - { - bodyA->SetAwake(true); - bodyB->SetAwake(true); - } + bodyA->SetAwake(true); + bodyB->SetAwake(true); ++m_contactCount; } diff --git a/external/Box2d/Box2D/Dynamics/b2ContactManager.h b/external/Box2d/Box2D/Dynamics/b2ContactManager.h new file mode 100644 index 0000000..90212c7 --- /dev/null +++ b/external/Box2d/Box2D/Dynamics/b2ContactManager.h @@ -0,0 +1,52 @@ +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_CONTACT_MANAGER_H +#define B2_CONTACT_MANAGER_H + +#include + +class b2Contact; +class b2ContactFilter; +class b2ContactListener; +class b2BlockAllocator; + +// Delegate of b2World. +class b2ContactManager +{ +public: + b2ContactManager(); + + // Broad-phase callback. + void AddPair(void* proxyUserDataA, void* proxyUserDataB); + + void FindNewContacts(); + + void Destroy(b2Contact* c); + + void Collide(); + + b2BroadPhase m_broadPhase; + b2Contact* m_contactList; + int32 m_contactCount; + b2ContactFilter* m_contactFilter; + b2ContactListener* m_contactListener; + b2BlockAllocator* m_allocator; +}; + +#endif diff --git a/src/Box2D/Dynamics/b2Fixture.cpp b/external/Box2d/Box2D/Dynamics/b2Fixture.cpp similarity index 95% rename from src/Box2D/Dynamics/b2Fixture.cpp rename to external/Box2d/Box2D/Dynamics/b2Fixture.cpp index d97aa44..1f78cf1 100644 --- a/src/Box2D/Dynamics/b2Fixture.cpp +++ b/external/Box2d/Box2D/Dynamics/b2Fixture.cpp @@ -152,7 +152,7 @@ void b2Fixture::DestroyProxies(b2BroadPhase* broadPhase) void b2Fixture::Synchronize(b2BroadPhase* broadPhase, const b2Transform& transform1, const b2Transform& transform2) { if (m_proxyCount == 0) - { + { return; } @@ -164,7 +164,7 @@ void b2Fixture::Synchronize(b2BroadPhase* broadPhase, const b2Transform& transfo b2AABB aabb1, aabb2; m_shape->ComputeAABB(&aabb1, transform1, proxy->childIndex); m_shape->ComputeAABB(&aabb2, transform2, proxy->childIndex); - + proxy->aabb.Combine(aabb1, aabb2); b2Vec2 displacement = transform2.p - transform1.p; @@ -267,11 +267,11 @@ void b2Fixture::Dump(int32 bodyIndex) b2PolygonShape* s = (b2PolygonShape*)m_shape; b2Log(" b2PolygonShape shape;\n"); b2Log(" b2Vec2 vs[%d];\n", b2_maxPolygonVertices); - for (int32 i = 0; i < s->m_count; ++i) + for (int32 i = 0; i < s->m_vertexCount; ++i) { b2Log(" vs[%d].Set(%.15lef, %.15lef);\n", i, s->m_vertices[i].x, s->m_vertices[i].y); } - b2Log(" shape.Set(vs, %d);\n", s->m_count); + b2Log(" shape.Set(vs, %d);\n", s->m_vertexCount); } break; diff --git a/external/Box2d/Box2D/Dynamics/b2Fixture.h b/external/Box2d/Box2D/Dynamics/b2Fixture.h new file mode 100644 index 0000000..5ebd0c3 --- /dev/null +++ b/external/Box2d/Box2D/Dynamics/b2Fixture.h @@ -0,0 +1,345 @@ +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_FIXTURE_H +#define B2_FIXTURE_H + +#include +#include +#include + +class b2BlockAllocator; +class b2Body; +class b2BroadPhase; +class b2Fixture; + +/// This holds contact filtering data. +struct b2Filter +{ + b2Filter() + { + categoryBits = 0x0001; + maskBits = 0xFFFF; + groupIndex = 0; + } + + /// The collision category bits. Normally you would just set one bit. + uint16 categoryBits; + + /// The collision mask bits. This states the categories that this + /// shape would accept for collision. + uint16 maskBits; + + /// Collision groups allow a certain group of objects to never collide (negative) + /// or always collide (positive). Zero means no collision group. Non-zero group + /// filtering always wins against the mask bits. + int16 groupIndex; +}; + +/// A fixture definition is used to create a fixture. This class defines an +/// abstract fixture definition. You can reuse fixture definitions safely. +struct b2FixtureDef +{ + /// The constructor sets the default fixture definition values. + b2FixtureDef() + { + shape = NULL; + userData = NULL; + friction = 0.2f; + restitution = 0.0f; + density = 0.0f; + isSensor = false; + } + + /// The shape, this must be set. The shape will be cloned, so you + /// can create the shape on the stack. + const b2Shape* shape; + + /// Use this to store application specific fixture data. + void* userData; + + /// The friction coefficient, usually in the range [0,1]. + float32 friction; + + /// The restitution (elasticity) usually in the range [0,1]. + float32 restitution; + + /// The density, usually in kg/m^2. + float32 density; + + /// A sensor shape collects contact information but never generates a collision + /// response. + bool isSensor; + + /// Contact filtering data. + b2Filter filter; +}; + +/// This proxy is used internally to connect fixtures to the broad-phase. +struct b2FixtureProxy +{ + b2AABB aabb; + b2Fixture* fixture; + int32 childIndex; + int32 proxyId; +}; + +/// A fixture is used to attach a shape to a body for collision detection. A fixture +/// inherits its transform from its parent. Fixtures hold additional non-geometric data +/// such as friction, collision filters, etc. +/// Fixtures are created via b2Body::CreateFixture. +/// @warning you cannot reuse fixtures. +class b2Fixture +{ +public: + /// Get the type of the child shape. You can use this to down cast to the concrete shape. + /// @return the shape type. + b2Shape::Type GetType() const; + + /// Get the child shape. You can modify the child shape, however you should not change the + /// number of vertices because this will crash some collision caching mechanisms. + /// Manipulating the shape may lead to non-physical behavior. + b2Shape* GetShape(); + const b2Shape* GetShape() const; + + /// Set if this fixture is a sensor. + void SetSensor(bool sensor); + + /// Is this fixture a sensor (non-solid)? + /// @return the true if the shape is a sensor. + bool IsSensor() const; + + /// Set the contact filtering data. This will not update contacts until the next time + /// step when either parent body is active and awake. + /// This automatically calls Refilter. + void SetFilterData(const b2Filter& filter); + + /// Get the contact filtering data. + const b2Filter& GetFilterData() const; + + /// Call this if you want to establish collision that was previously disabled by b2ContactFilter::ShouldCollide. + void Refilter(); + + /// Get the parent body of this fixture. This is NULL if the fixture is not attached. + /// @return the parent body. + b2Body* GetBody(); + const b2Body* GetBody() const; + + /// Get the next fixture in the parent body's fixture list. + /// @return the next shape. + b2Fixture* GetNext(); + const b2Fixture* GetNext() const; + + /// Get the user data that was assigned in the fixture definition. Use this to + /// store your application specific data. + void* GetUserData() const; + + /// Set the user data. Use this to store your application specific data. + void SetUserData(void* data); + + /// Test a point for containment in this fixture. + /// @param p a point in world coordinates. + bool TestPoint(const b2Vec2& p) const; + + /// Cast a ray against this shape. + /// @param output the ray-cast results. + /// @param input the ray-cast input parameters. + bool RayCast(b2RayCastOutput* output, const b2RayCastInput& input, int32 childIndex) const; + + /// Get the mass data for this fixture. The mass data is based on the density and + /// the shape. The rotational inertia is about the shape's origin. This operation + /// may be expensive. + void GetMassData(b2MassData* massData) const; + + /// Set the density of this fixture. This will _not_ automatically adjust the mass + /// of the body. You must call b2Body::ResetMassData to update the body's mass. + void SetDensity(float32 density); + + /// Get the density of this fixture. + float32 GetDensity() const; + + /// Get the coefficient of friction. + float32 GetFriction() const; + + /// Set the coefficient of friction. This will _not_ change the friction of + /// existing contacts. + void SetFriction(float32 friction); + + /// Get the coefficient of restitution. + float32 GetRestitution() const; + + /// Set the coefficient of restitution. This will _not_ change the restitution of + /// existing contacts. + void SetRestitution(float32 restitution); + + /// Get the fixture's AABB. This AABB may be enlarge and/or stale. + /// If you need a more accurate AABB, compute it using the shape and + /// the body transform. + const b2AABB& GetAABB(int32 childIndex) const; + + /// Dump this fixture to the log file. + void Dump(int32 bodyIndex); + +protected: + + friend class b2Body; + friend class b2World; + friend class b2Contact; + friend class b2ContactManager; + + b2Fixture(); + + // We need separation create/destroy functions from the constructor/destructor because + // the destructor cannot access the allocator (no destructor arguments allowed by C++). + void Create(b2BlockAllocator* allocator, b2Body* body, const b2FixtureDef* def); + void Destroy(b2BlockAllocator* allocator); + + // These support body activation/deactivation. + void CreateProxies(b2BroadPhase* broadPhase, const b2Transform& xf); + void DestroyProxies(b2BroadPhase* broadPhase); + + void Synchronize(b2BroadPhase* broadPhase, const b2Transform& xf1, const b2Transform& xf2); + + float32 m_density; + + b2Fixture* m_next; + b2Body* m_body; + + b2Shape* m_shape; + + float32 m_friction; + float32 m_restitution; + + b2FixtureProxy* m_proxies; + int32 m_proxyCount; + + b2Filter m_filter; + + bool m_isSensor; + + void* m_userData; +}; + +inline b2Shape::Type b2Fixture::GetType() const +{ + return m_shape->GetType(); +} + +inline b2Shape* b2Fixture::GetShape() +{ + return m_shape; +} + +inline const b2Shape* b2Fixture::GetShape() const +{ + return m_shape; +} + +inline bool b2Fixture::IsSensor() const +{ + return m_isSensor; +} + +inline const b2Filter& b2Fixture::GetFilterData() const +{ + return m_filter; +} + +inline void* b2Fixture::GetUserData() const +{ + return m_userData; +} + +inline void b2Fixture::SetUserData(void* data) +{ + m_userData = data; +} + +inline b2Body* b2Fixture::GetBody() +{ + return m_body; +} + +inline const b2Body* b2Fixture::GetBody() const +{ + return m_body; +} + +inline b2Fixture* b2Fixture::GetNext() +{ + return m_next; +} + +inline const b2Fixture* b2Fixture::GetNext() const +{ + return m_next; +} + +inline void b2Fixture::SetDensity(float32 density) +{ + b2Assert(b2IsValid(density) && density >= 0.0f); + m_density = density; +} + +inline float32 b2Fixture::GetDensity() const +{ + return m_density; +} + +inline float32 b2Fixture::GetFriction() const +{ + return m_friction; +} + +inline void b2Fixture::SetFriction(float32 friction) +{ + m_friction = friction; +} + +inline float32 b2Fixture::GetRestitution() const +{ + return m_restitution; +} + +inline void b2Fixture::SetRestitution(float32 restitution) +{ + m_restitution = restitution; +} + +inline bool b2Fixture::TestPoint(const b2Vec2& p) const +{ + return m_shape->TestPoint(m_body->GetTransform(), p); +} + +inline bool b2Fixture::RayCast(b2RayCastOutput* output, const b2RayCastInput& input, int32 childIndex) const +{ + return m_shape->RayCast(output, input, m_body->GetTransform(), childIndex); +} + +inline void b2Fixture::GetMassData(b2MassData* massData) const +{ + m_shape->ComputeMass(massData, m_density); +} + +inline const b2AABB& b2Fixture::GetAABB(int32 childIndex) const +{ + b2Assert(0 <= childIndex && childIndex < m_proxyCount); + return m_proxies[childIndex].aabb; +} + +#endif diff --git a/src/Box2D/Dynamics/b2Island.cpp b/external/Box2d/Box2D/Dynamics/b2Island.cpp similarity index 96% rename from src/Box2D/Dynamics/b2Island.cpp rename to external/Box2d/Box2D/Dynamics/b2Island.cpp index 0e2129c..44e5b1a 100644 --- a/src/Box2D/Dynamics/b2Island.cpp +++ b/external/Box2d/Box2D/Dynamics/b2Island.cpp @@ -247,7 +247,7 @@ void b2Island::Solve(b2Profile* profile, const b2TimeStep& step, const b2Vec2& g { contactSolver.WarmStart(); } - + for (int32 i = 0; i < m_jointCount; ++i) { m_joints[i]->InitVelocityConstraints(solverData); @@ -525,7 +525,7 @@ void b2Island::Report(const b2ContactVelocityConstraint* constraints) b2Contact* c = m_contacts[i]; const b2ContactVelocityConstraint* vc = constraints + i; - + b2ContactImpulse impulse; impulse.count = vc->pointCount; for (int32 j = 0; j < vc->pointCount; ++j) diff --git a/external/Box2d/Box2D/Dynamics/b2Island.h b/external/Box2d/Box2D/Dynamics/b2Island.h new file mode 100644 index 0000000..ef3d9b1 --- /dev/null +++ b/external/Box2d/Box2D/Dynamics/b2Island.h @@ -0,0 +1,93 @@ +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_ISLAND_H +#define B2_ISLAND_H + +#include +#include +#include + +class b2Contact; +class b2Joint; +class b2StackAllocator; +class b2ContactListener; +struct b2ContactVelocityConstraint; +struct b2Profile; + +/// This is an internal class. +class b2Island +{ +public: + b2Island(int32 bodyCapacity, int32 contactCapacity, int32 jointCapacity, + b2StackAllocator* allocator, b2ContactListener* listener); + ~b2Island(); + + void Clear() + { + m_bodyCount = 0; + m_contactCount = 0; + m_jointCount = 0; + } + + void Solve(b2Profile* profile, const b2TimeStep& step, const b2Vec2& gravity, bool allowSleep); + + void SolveTOI(const b2TimeStep& subStep, int32 toiIndexA, int32 toiIndexB); + + void Add(b2Body* body) + { + b2Assert(m_bodyCount < m_bodyCapacity); + body->m_islandIndex = m_bodyCount; + m_bodies[m_bodyCount] = body; + ++m_bodyCount; + } + + void Add(b2Contact* contact) + { + b2Assert(m_contactCount < m_contactCapacity); + m_contacts[m_contactCount++] = contact; + } + + void Add(b2Joint* joint) + { + b2Assert(m_jointCount < m_jointCapacity); + m_joints[m_jointCount++] = joint; + } + + void Report(const b2ContactVelocityConstraint* constraints); + + b2StackAllocator* m_allocator; + b2ContactListener* m_listener; + + b2Body** m_bodies; + b2Contact** m_contacts; + b2Joint** m_joints; + + b2Position* m_positions; + b2Velocity* m_velocities; + + int32 m_bodyCount; + int32 m_jointCount; + int32 m_contactCount; + + int32 m_bodyCapacity; + int32 m_contactCapacity; + int32 m_jointCapacity; +}; + +#endif diff --git a/external/Box2d/Box2D/Dynamics/b2TimeStep.h b/external/Box2d/Box2D/Dynamics/b2TimeStep.h new file mode 100644 index 0000000..abe6fb6 --- /dev/null +++ b/external/Box2d/Box2D/Dynamics/b2TimeStep.h @@ -0,0 +1,70 @@ +/* +* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_TIME_STEP_H +#define B2_TIME_STEP_H + +#include + +/// Profiling data. Times are in milliseconds. +struct b2Profile +{ + float32 step; + float32 collide; + float32 solve; + float32 solveInit; + float32 solveVelocity; + float32 solvePosition; + float32 broadphase; + float32 solveTOI; +}; + +/// This is an internal structure. +struct b2TimeStep +{ + float32 dt; // time step + float32 inv_dt; // inverse time step (0 if dt == 0). + float32 dtRatio; // dt * inv_dt0 + int32 velocityIterations; + int32 positionIterations; + bool warmStarting; +}; + +/// This is an internal structure. +struct b2Position +{ + b2Vec2 c; + float32 a; +}; + +/// This is an internal structure. +struct b2Velocity +{ + b2Vec2 v; + float32 w; +}; + +/// Solver Data +struct b2SolverData +{ + b2TimeStep step; + b2Position* positions; + b2Velocity* velocities; +}; + +#endif diff --git a/src/Box2D/Dynamics/b2World.cpp b/external/Box2d/Box2D/Dynamics/b2World.cpp similarity index 94% rename from src/Box2D/Dynamics/b2World.cpp rename to external/Box2d/Box2D/Dynamics/b2World.cpp index dc9180c..a396c17 100644 --- a/src/Box2D/Dynamics/b2World.cpp +++ b/external/Box2d/Box2D/Dynamics/b2World.cpp @@ -839,7 +839,7 @@ void b2World::SolveTOI(const b2TimeStep& step) { continue; } - + // Add the other body to the island. other->m_flags |= b2Body::e_islandFlag; @@ -923,7 +923,7 @@ void b2World::Step(float32 dt, int32 velocityIterations, int32 positionIteration step.dtRatio = m_inv_dt0 * dt; step.warmStarting = m_warmStarting; - + // Update contacts. This is where some contacts are destroyed. { b2Timer timer; @@ -1073,7 +1073,7 @@ void b2World::DrawShape(b2Fixture* fixture, const b2Transform& xf, const b2Color case b2Shape::e_polygon: { b2PolygonShape* poly = (b2PolygonShape*)fixture->GetShape(); - int32 vertexCount = poly->m_count; + int32 vertexCount = poly->m_vertexCount; b2Assert(vertexCount <= b2_maxPolygonVertices); b2Vec2 vertices[b2_maxPolygonVertices]; @@ -1085,7 +1085,7 @@ void b2World::DrawShape(b2Fixture* fixture, const b2Transform& xf, const b2Color m_debugDraw->DrawSolidPolygon(vertices, vertexCount, color); } break; - + default: break; } @@ -1256,29 +1256,6 @@ float32 b2World::GetTreeQuality() const return m_contactManager.m_broadPhase.GetTreeQuality(); } -void b2World::ShiftOrigin(const b2Vec2& newOrigin) -{ - b2Assert((m_flags & e_locked) == 0); - if ((m_flags & e_locked) == e_locked) - { - return; - } - - for (b2Body* b = m_bodyList; b; b = b->m_next) - { - b->m_xf.p -= newOrigin; - b->m_sweep.c0 -= newOrigin; - b->m_sweep.c -= newOrigin; - } - - for (b2Joint* j = m_jointList; j; j = j->m_next) - { - j->ShiftOrigin(newOrigin); - } - - m_contactManager.m_broadPhase.ShiftOrigin(newOrigin); -} - void b2World::Dump() { if ((m_flags & e_locked) == e_locked) diff --git a/external/Box2d/Box2D/Dynamics/b2World.h b/external/Box2d/Box2D/Dynamics/b2World.h new file mode 100644 index 0000000..3224736 --- /dev/null +++ b/external/Box2d/Box2D/Dynamics/b2World.h @@ -0,0 +1,349 @@ +/* +* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_WORLD_H +#define B2_WORLD_H + +#include +#include +#include +#include +#include +#include + +struct b2AABB; +struct b2BodyDef; +struct b2Color; +struct b2JointDef; +class b2Body; +class b2Draw; +class b2Fixture; +class b2Joint; + +/// The world class manages all physics entities, dynamic simulation, +/// and asynchronous queries. The world also contains efficient memory +/// management facilities. +class b2World +{ +public: + /// Construct a world object. + /// @param gravity the world gravity vector. + b2World(const b2Vec2& gravity); + + /// Destruct the world. All physics entities are destroyed and all heap memory is released. + ~b2World(); + + /// Register a destruction listener. The listener is owned by you and must + /// remain in scope. + void SetDestructionListener(b2DestructionListener* listener); + + /// Register a contact filter to provide specific control over collision. + /// Otherwise the default filter is used (b2_defaultFilter). The listener is + /// owned by you and must remain in scope. + void SetContactFilter(b2ContactFilter* filter); + + /// Register a contact event listener. The listener is owned by you and must + /// remain in scope. + void SetContactListener(b2ContactListener* listener); + + /// Register a routine for debug drawing. The debug draw functions are called + /// inside with b2World::DrawDebugData method. The debug draw object is owned + /// by you and must remain in scope. + void SetDebugDraw(b2Draw* debugDraw); + + /// Create a rigid body given a definition. No reference to the definition + /// is retained. + /// @warning This function is locked during callbacks. + b2Body* CreateBody(const b2BodyDef* def); + + /// Destroy a rigid body given a definition. No reference to the definition + /// is retained. This function is locked during callbacks. + /// @warning This automatically deletes all associated shapes and joints. + /// @warning This function is locked during callbacks. + void DestroyBody(b2Body* body); + + /// Create a joint to constrain bodies together. No reference to the definition + /// is retained. This may cause the connected bodies to cease colliding. + /// @warning This function is locked during callbacks. + b2Joint* CreateJoint(const b2JointDef* def); + + /// Destroy a joint. This may cause the connected bodies to begin colliding. + /// @warning This function is locked during callbacks. + void DestroyJoint(b2Joint* joint); + + /// Take a time step. This performs collision detection, integration, + /// and constraint solution. + /// @param timeStep the amount of time to simulate, this should not vary. + /// @param velocityIterations for the velocity constraint solver. + /// @param positionIterations for the position constraint solver. + void Step( float32 timeStep, + int32 velocityIterations, + int32 positionIterations); + + /// Manually clear the force buffer on all bodies. By default, forces are cleared automatically + /// after each call to Step. The default behavior is modified by calling SetAutoClearForces. + /// The purpose of this function is to support sub-stepping. Sub-stepping is often used to maintain + /// a fixed sized time step under a variable frame-rate. + /// When you perform sub-stepping you will disable auto clearing of forces and instead call + /// ClearForces after all sub-steps are complete in one pass of your game loop. + /// @see SetAutoClearForces + void ClearForces(); + + /// Call this to draw shapes and other debug draw data. + void DrawDebugData(); + + /// Query the world for all fixtures that potentially overlap the + /// provided AABB. + /// @param callback a user implemented callback class. + /// @param aabb the query box. + void QueryAABB(b2QueryCallback* callback, const b2AABB& aabb) const; + + /// Ray-cast the world for all fixtures in the path of the ray. Your callback + /// controls whether you get the closest point, any point, or n-points. + /// The ray-cast ignores shapes that contain the starting point. + /// @param callback a user implemented callback class. + /// @param point1 the ray starting point + /// @param point2 the ray ending point + void RayCast(b2RayCastCallback* callback, const b2Vec2& point1, const b2Vec2& point2) const; + + /// Get the world body list. With the returned body, use b2Body::GetNext to get + /// the next body in the world list. A NULL body indicates the end of the list. + /// @return the head of the world body list. + b2Body* GetBodyList(); + const b2Body* GetBodyList() const; + + /// Get the world joint list. With the returned joint, use b2Joint::GetNext to get + /// the next joint in the world list. A NULL joint indicates the end of the list. + /// @return the head of the world joint list. + b2Joint* GetJointList(); + const b2Joint* GetJointList() const; + + /// Get the world contact list. With the returned contact, use b2Contact::GetNext to get + /// the next contact in the world list. A NULL contact indicates the end of the list. + /// @return the head of the world contact list. + /// @warning contacts are created and destroyed in the middle of a time step. + /// Use b2ContactListener to avoid missing contacts. + b2Contact* GetContactList(); + const b2Contact* GetContactList() const; + + /// Enable/disable sleep. + void SetAllowSleeping(bool flag); + bool GetAllowSleeping() const { return m_allowSleep; } + + /// Enable/disable warm starting. For testing. + void SetWarmStarting(bool flag) { m_warmStarting = flag; } + bool GetWarmStarting() const { return m_warmStarting; } + + /// Enable/disable continuous physics. For testing. + void SetContinuousPhysics(bool flag) { m_continuousPhysics = flag; } + bool GetContinuousPhysics() const { return m_continuousPhysics; } + + /// Enable/disable single stepped continuous physics. For testing. + void SetSubStepping(bool flag) { m_subStepping = flag; } + bool GetSubStepping() const { return m_subStepping; } + + /// Get the number of broad-phase proxies. + int32 GetProxyCount() const; + + /// Get the number of bodies. + int32 GetBodyCount() const; + + /// Get the number of joints. + int32 GetJointCount() const; + + /// Get the number of contacts (each may have 0 or more contact points). + int32 GetContactCount() const; + + /// Get the height of the dynamic tree. + int32 GetTreeHeight() const; + + /// Get the balance of the dynamic tree. + int32 GetTreeBalance() const; + + /// Get the quality metric of the dynamic tree. The smaller the better. + /// The minimum is 1. + float32 GetTreeQuality() const; + + /// Change the global gravity vector. + void SetGravity(const b2Vec2& gravity); + + /// Get the global gravity vector. + b2Vec2 GetGravity() const; + + /// Is the world locked (in the middle of a time step). + bool IsLocked() const; + + /// Set flag to control automatic clearing of forces after each time step. + void SetAutoClearForces(bool flag); + + /// Get the flag that controls automatic clearing of forces after each time step. + bool GetAutoClearForces() const; + + /// Get the contact manager for testing. + const b2ContactManager& GetContactManager() const; + + /// Get the current profile. + const b2Profile& GetProfile() const; + + /// Dump the world into the log file. + /// @warning this should be called outside of a time step. + void Dump(); + +private: + + // m_flags + enum + { + e_newFixture = 0x0001, + e_locked = 0x0002, + e_clearForces = 0x0004 + }; + + friend class b2Body; + friend class b2Fixture; + friend class b2ContactManager; + friend class b2Controller; + + void Solve(const b2TimeStep& step); + void SolveTOI(const b2TimeStep& step); + + void DrawJoint(b2Joint* joint); + void DrawShape(b2Fixture* shape, const b2Transform& xf, const b2Color& color); + + b2BlockAllocator m_blockAllocator; + b2StackAllocator m_stackAllocator; + + int32 m_flags; + + b2ContactManager m_contactManager; + + b2Body* m_bodyList; + b2Joint* m_jointList; + + int32 m_bodyCount; + int32 m_jointCount; + + b2Vec2 m_gravity; + bool m_allowSleep; + + b2DestructionListener* m_destructionListener; + b2Draw* m_debugDraw; + + // This is used to compute the time step ratio to + // support a variable time step. + float32 m_inv_dt0; + + // These are for debugging the solver. + bool m_warmStarting; + bool m_continuousPhysics; + bool m_subStepping; + + bool m_stepComplete; + + b2Profile m_profile; +}; + +inline b2Body* b2World::GetBodyList() +{ + return m_bodyList; +} + +inline const b2Body* b2World::GetBodyList() const +{ + return m_bodyList; +} + +inline b2Joint* b2World::GetJointList() +{ + return m_jointList; +} + +inline const b2Joint* b2World::GetJointList() const +{ + return m_jointList; +} + +inline b2Contact* b2World::GetContactList() +{ + return m_contactManager.m_contactList; +} + +inline const b2Contact* b2World::GetContactList() const +{ + return m_contactManager.m_contactList; +} + +inline int32 b2World::GetBodyCount() const +{ + return m_bodyCount; +} + +inline int32 b2World::GetJointCount() const +{ + return m_jointCount; +} + +inline int32 b2World::GetContactCount() const +{ + return m_contactManager.m_contactCount; +} + +inline void b2World::SetGravity(const b2Vec2& gravity) +{ + m_gravity = gravity; +} + +inline b2Vec2 b2World::GetGravity() const +{ + return m_gravity; +} + +inline bool b2World::IsLocked() const +{ + return (m_flags & e_locked) == e_locked; +} + +inline void b2World::SetAutoClearForces(bool flag) +{ + if (flag) + { + m_flags |= e_clearForces; + } + else + { + m_flags &= ~e_clearForces; + } +} + +/// Get the flag that controls automatic clearing of forces after each time step. +inline bool b2World::GetAutoClearForces() const +{ + return (m_flags & e_clearForces) == e_clearForces; +} + +inline const b2ContactManager& b2World::GetContactManager() const +{ + return m_contactManager; +} + +inline const b2Profile& b2World::GetProfile() const +{ + return m_profile; +} + +#endif diff --git a/src/Box2D/Dynamics/b2WorldCallbacks.cpp b/external/Box2d/Box2D/Dynamics/b2WorldCallbacks.cpp similarity index 100% rename from src/Box2D/Dynamics/b2WorldCallbacks.cpp rename to external/Box2d/Box2D/Dynamics/b2WorldCallbacks.cpp diff --git a/external/Box2d/Box2D/Dynamics/b2WorldCallbacks.h b/external/Box2d/Box2D/Dynamics/b2WorldCallbacks.h new file mode 100644 index 0000000..9b937e8 --- /dev/null +++ b/external/Box2d/Box2D/Dynamics/b2WorldCallbacks.h @@ -0,0 +1,155 @@ +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_WORLD_CALLBACKS_H +#define B2_WORLD_CALLBACKS_H + +#include + +struct b2Vec2; +struct b2Transform; +class b2Fixture; +class b2Body; +class b2Joint; +class b2Contact; +struct b2ContactResult; +struct b2Manifold; + +/// Joints and fixtures are destroyed when their associated +/// body is destroyed. Implement this listener so that you +/// may nullify references to these joints and shapes. +class b2DestructionListener +{ +public: + virtual ~b2DestructionListener() {} + + /// Called when any joint is about to be destroyed due + /// to the destruction of one of its attached bodies. + virtual void SayGoodbye(b2Joint* joint) = 0; + + /// Called when any fixture is about to be destroyed due + /// to the destruction of its parent body. + virtual void SayGoodbye(b2Fixture* fixture) = 0; +}; + +/// Implement this class to provide collision filtering. In other words, you can implement +/// this class if you want finer control over contact creation. +class b2ContactFilter +{ +public: + virtual ~b2ContactFilter() {} + + /// Return true if contact calculations should be performed between these two shapes. + /// @warning for performance reasons this is only called when the AABBs begin to overlap. + virtual bool ShouldCollide(b2Fixture* fixtureA, b2Fixture* fixtureB); +}; + +/// Contact impulses for reporting. Impulses are used instead of forces because +/// sub-step forces may approach infinity for rigid body collisions. These +/// match up one-to-one with the contact points in b2Manifold. +struct b2ContactImpulse +{ + float32 normalImpulses[b2_maxManifoldPoints]; + float32 tangentImpulses[b2_maxManifoldPoints]; + int32 count; +}; + +/// Implement this class to get contact information. You can use these results for +/// things like sounds and game logic. You can also get contact results by +/// traversing the contact lists after the time step. However, you might miss +/// some contacts because continuous physics leads to sub-stepping. +/// Additionally you may receive multiple callbacks for the same contact in a +/// single time step. +/// You should strive to make your callbacks efficient because there may be +/// many callbacks per time step. +/// @warning You cannot create/destroy Box2D entities inside these callbacks. +class b2ContactListener +{ +public: + virtual ~b2ContactListener() {} + + /// Called when two fixtures begin to touch. + virtual void BeginContact(b2Contact* contact) { B2_NOT_USED(contact); } + + /// Called when two fixtures cease to touch. + virtual void EndContact(b2Contact* contact) { B2_NOT_USED(contact); } + + /// This is called after a contact is updated. This allows you to inspect a + /// contact before it goes to the solver. If you are careful, you can modify the + /// contact manifold (e.g. disable contact). + /// A copy of the old manifold is provided so that you can detect changes. + /// Note: this is called only for awake bodies. + /// Note: this is called even when the number of contact points is zero. + /// Note: this is not called for sensors. + /// Note: if you set the number of contact points to zero, you will not + /// get an EndContact callback. However, you may get a BeginContact callback + /// the next step. + virtual void PreSolve(b2Contact* contact, const b2Manifold* oldManifold) + { + B2_NOT_USED(contact); + B2_NOT_USED(oldManifold); + } + + /// This lets you inspect a contact after the solver is finished. This is useful + /// for inspecting impulses. + /// Note: the contact manifold does not include time of impact impulses, which can be + /// arbitrarily large if the sub-step is small. Hence the impulse is provided explicitly + /// in a separate data structure. + /// Note: this is only called for contacts that are touching, solid, and awake. + virtual void PostSolve(b2Contact* contact, const b2ContactImpulse* impulse) + { + B2_NOT_USED(contact); + B2_NOT_USED(impulse); + } +}; + +/// Callback class for AABB queries. +/// See b2World::Query +class b2QueryCallback +{ +public: + virtual ~b2QueryCallback() {} + + /// Called for each fixture found in the query AABB. + /// @return false to terminate the query. + virtual bool ReportFixture(b2Fixture* fixture) = 0; +}; + +/// Callback class for ray casts. +/// See b2World::RayCast +class b2RayCastCallback +{ +public: + virtual ~b2RayCastCallback() {} + + /// Called for each fixture found in the query. You control how the ray cast + /// proceeds by returning a float: + /// return -1: ignore this fixture and continue + /// return 0: terminate the ray cast + /// return fraction: clip the ray to this point + /// return 1: don't clip the ray and continue + /// @param fixture the fixture hit by the ray + /// @param point the point of initial intersection + /// @param normal the normal vector at the point of intersection + /// @return -1 to filter, 0 to terminate, fraction to clip the ray for + /// closest hit, 1 to continue + virtual float32 ReportFixture( b2Fixture* fixture, const b2Vec2& point, + const b2Vec2& normal, float32 fraction) = 0; +}; + +#endif diff --git a/src/Box2D/Rope/b2Rope.cpp b/external/Box2d/Box2D/Rope/b2Rope.cpp similarity index 100% rename from src/Box2D/Rope/b2Rope.cpp rename to external/Box2d/Box2D/Rope/b2Rope.cpp diff --git a/external/Box2d/Box2D/Rope/b2Rope.h b/external/Box2d/Box2D/Rope/b2Rope.h new file mode 100644 index 0000000..a4b6cb4 --- /dev/null +++ b/external/Box2d/Box2D/Rope/b2Rope.h @@ -0,0 +1,115 @@ +/* +* Copyright (c) 2011 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef B2_ROPE_H +#define B2_ROPE_H + +#include + +class b2Draw; + +/// +struct b2RopeDef +{ + b2RopeDef() + { + vertices = NULL; + count = 0; + masses = NULL; + gravity.SetZero(); + damping = 0.1f; + k2 = 0.9f; + k3 = 0.1f; + } + + /// + b2Vec2* vertices; + + /// + int32 count; + + /// + float32* masses; + + /// + b2Vec2 gravity; + + /// + float32 damping; + + /// Stretching stiffness + float32 k2; + + /// Bending stiffness. Values above 0.5 can make the simulation blow up. + float32 k3; +}; + +/// +class b2Rope +{ +public: + b2Rope(); + ~b2Rope(); + + /// + void Initialize(const b2RopeDef* def); + + /// + void Step(float32 timeStep, int32 iterations); + + /// + int32 GetVertexCount() const + { + return m_count; + } + + /// + const b2Vec2* GetVertices() const + { + return m_ps; + } + + /// + void Draw(b2Draw* draw) const; + + /// + void SetAngle(float32 angle); + +private: + + void SolveC2(); + void SolveC3(); + + int32 m_count; + b2Vec2* m_ps; + b2Vec2* m_p0s; + b2Vec2* m_vs; + + float32* m_ims; + + float32* m_Ls; + float32* m_as; + + b2Vec2 m_gravity; + float32 m_damping; + + float32 m_k2; + float32 m_k3; +}; + +#endif diff --git a/external/Box2d/Testbed/Framework/Main.cpp b/external/Box2d/Testbed/Framework/Main.cpp new file mode 100644 index 0000000..a9d83a6 --- /dev/null +++ b/external/Box2d/Testbed/Framework/Main.cpp @@ -0,0 +1,447 @@ +/* +* Copyright (c) 2006-2007 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include "Render.h" +#include "Test.h" +#include "glui/glui.h" + +#include +using namespace std; + +namespace +{ + int32 testIndex = 0; + int32 testSelection = 0; + int32 testCount = 0; + TestEntry* entry; + Test* test; + Settings settings; + int32 width = 640; + int32 height = 480; + int32 framePeriod = 16; + int32 mainWindow; + float settingsHz = 60.0; + GLUI *glui; + float32 viewZoom = 1.0f; + int tx, ty, tw, th; + bool rMouseDown; + b2Vec2 lastp; +} + +void Resize(int32 w, int32 h) +{ + width = w; + height = h; + + GLUI_Master.get_viewport_area(&tx, &ty, &tw, &th); + glViewport(tx, ty, tw, th); + + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + float32 ratio = float32(tw) / float32(th); + + b2Vec2 extents(ratio * 25.0f, 25.0f); + extents *= viewZoom; + + b2Vec2 lower = settings.viewCenter - extents; + b2Vec2 upper = settings.viewCenter + extents; + + // L/R/B/T + gluOrtho2D(lower.x, upper.x, lower.y, upper.y); +} + +b2Vec2 ConvertScreenToWorld(int32 x, int32 y) +{ + float32 u = x / float32(tw); + float32 v = (th - y) / float32(th); + + float32 ratio = float32(tw) / float32(th); + b2Vec2 extents(ratio * 25.0f, 25.0f); + extents *= viewZoom; + + b2Vec2 lower = settings.viewCenter - extents; + b2Vec2 upper = settings.viewCenter + extents; + + b2Vec2 p; + p.x = (1.0f - u) * lower.x + u * upper.x; + p.y = (1.0f - v) * lower.y + v * upper.y; + return p; +} + +// This is used to control the frame rate (60Hz). +void Timer(int) +{ + glutSetWindow(mainWindow); + glutPostRedisplay(); + glutTimerFunc(framePeriod, Timer, 0); +} + +void SimulationLoop() +{ + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + + glMatrixMode(GL_MODELVIEW); + glLoadIdentity(); + + test->SetTextLine(30); + b2Vec2 oldCenter = settings.viewCenter; + settings.hz = settingsHz; + test->Step(&settings); + if (oldCenter.x != settings.viewCenter.x || oldCenter.y != settings.viewCenter.y) + { + Resize(width, height); + } + + test->DrawTitle(5, 15, entry->name); + + glutSwapBuffers(); + + if (testSelection != testIndex) + { + testIndex = testSelection; + delete test; + entry = g_testEntries + testIndex; + test = entry->createFcn(); + viewZoom = 1.0f; + settings.viewCenter.Set(0.0f, 20.0f); + Resize(width, height); + } +} + +void Keyboard(unsigned char key, int x, int y) +{ + B2_NOT_USED(x); + B2_NOT_USED(y); + + switch (key) + { + case 27: + // TODO: freeglut is not compiling on OSX. +#ifndef __APPLE__ + glutLeaveMainLoop(); +#endif + exit(0); + break; + + // Press 'z' to zoom out. + case 'z': + viewZoom = b2Min(1.1f * viewZoom, 20.0f); + Resize(width, height); + break; + + // Press 'x' to zoom in. + case 'x': + viewZoom = b2Max(0.9f * viewZoom, 0.02f); + Resize(width, height); + break; + + // Press 'r' to reset. + case 'r': + delete test; + test = entry->createFcn(); + break; + + // Press space to launch a bomb. + case ' ': + if (test) + { + test->LaunchBomb(); + } + break; + + case 'p': + settings.pause = !settings.pause; + break; + + // Press [ to prev test. + case '[': + --testSelection; + if (testSelection < 0) + { + testSelection = testCount - 1; + } + glui->sync_live(); + break; + + // Press ] to next test. + case ']': + ++testSelection; + if (testSelection == testCount) + { + testSelection = 0; + } + glui->sync_live(); + break; + + default: + if (test) + { + test->Keyboard(key); + } + } +} + +void KeyboardSpecial(int key, int x, int y) +{ + B2_NOT_USED(x); + B2_NOT_USED(y); + + switch (key) + { + case GLUT_ACTIVE_SHIFT: + // Press left to pan left. + case GLUT_KEY_LEFT: + settings.viewCenter.x -= 0.5f; + Resize(width, height); + break; + + // Press right to pan right. + case GLUT_KEY_RIGHT: + settings.viewCenter.x += 0.5f; + Resize(width, height); + break; + + // Press down to pan down. + case GLUT_KEY_DOWN: + settings.viewCenter.y -= 0.5f; + Resize(width, height); + break; + + // Press up to pan up. + case GLUT_KEY_UP: + settings.viewCenter.y += 0.5f; + Resize(width, height); + break; + + // Press home to reset the view. + case GLUT_KEY_HOME: + viewZoom = 1.0f; + settings.viewCenter.Set(0.0f, 20.0f); + Resize(width, height); + break; + } +} + +void KeyboardUp(unsigned char key, int x, int y) +{ + B2_NOT_USED(x); + B2_NOT_USED(y); + + if (test) + { + test->KeyboardUp(key); + } +} + +void Mouse(int32 button, int32 state, int32 x, int32 y) +{ + // Use the mouse to move things around. + if (button == GLUT_LEFT_BUTTON) + { + int mod = glutGetModifiers(); + b2Vec2 p = ConvertScreenToWorld(x, y); + if (state == GLUT_DOWN) + { + b2Vec2 p = ConvertScreenToWorld(x, y); + if (mod == GLUT_ACTIVE_SHIFT) + { + test->ShiftMouseDown(p); + } + else + { + test->MouseDown(p); + } + } + + if (state == GLUT_UP) + { + test->MouseUp(p); + } + } + else if (button == GLUT_RIGHT_BUTTON) + { + if (state == GLUT_DOWN) + { + lastp = ConvertScreenToWorld(x, y); + rMouseDown = true; + } + + if (state == GLUT_UP) + { + rMouseDown = false; + } + } +} + +void MouseMotion(int32 x, int32 y) +{ + b2Vec2 p = ConvertScreenToWorld(x, y); + test->MouseMove(p); + + if (rMouseDown) + { + b2Vec2 diff = p - lastp; + settings.viewCenter.x -= diff.x; + settings.viewCenter.y -= diff.y; + Resize(width, height); + lastp = ConvertScreenToWorld(x, y); + } +} + +void MouseWheel(int wheel, int direction, int x, int y) +{ + B2_NOT_USED(wheel); + B2_NOT_USED(x); + B2_NOT_USED(y); + if (direction > 0) + { + viewZoom /= 1.1f; + } + else + { + viewZoom *= 1.1f; + } + Resize(width, height); +} + +void Restart(int) +{ + delete test; + entry = g_testEntries + testIndex; + test = entry->createFcn(); + Resize(width, height); +} + +void Pause(int) +{ + settings.pause = !settings.pause; +} + +void Exit(int code) +{ + // TODO: freeglut is not building on OSX +#ifndef __APPLE__ + glutLeaveMainLoop(); +#endif + exit(code); +} + +void SingleStep(int) +{ + settings.pause = 1; + settings.singleStep = 1; +} + +int main(int argc, char** argv) +{ + testCount = 0; + while (g_testEntries[testCount].createFcn != NULL) + { + ++testCount; + } + + testIndex = b2Clamp(testIndex, 0, testCount-1); + testSelection = testIndex; + + entry = g_testEntries + testIndex; + test = entry->createFcn(); + + glutInit(&argc, argv); + glutInitDisplayMode(GLUT_RGBA | GLUT_DOUBLE); + glutInitWindowSize(width, height); + char title[32]; + sprintf(title, "Box2D Version %d.%d.%d", b2_version.major, b2_version.minor, b2_version.revision); + mainWindow = glutCreateWindow(title); + //glutSetOption (GLUT_ACTION_ON_WINDOW_CLOSE, GLUT_ACTION_GLUTMAINLOOP_RETURNS); + + glutDisplayFunc(SimulationLoop); + GLUI_Master.set_glutReshapeFunc(Resize); + GLUI_Master.set_glutKeyboardFunc(Keyboard); + GLUI_Master.set_glutSpecialFunc(KeyboardSpecial); + GLUI_Master.set_glutMouseFunc(Mouse); +#ifdef FREEGLUT + glutMouseWheelFunc(MouseWheel); +#endif + glutMotionFunc(MouseMotion); + + glutKeyboardUpFunc(KeyboardUp); + + glui = GLUI_Master.create_glui_subwindow( mainWindow, + GLUI_SUBWINDOW_RIGHT ); + + glui->add_statictext("Tests"); + GLUI_Listbox* testList = + glui->add_listbox("", &testSelection); + + glui->add_separator(); + + GLUI_Spinner* velocityIterationSpinner = + glui->add_spinner("Vel Iters", GLUI_SPINNER_INT, &settings.velocityIterations); + velocityIterationSpinner->set_int_limits(1, 500); + + GLUI_Spinner* positionIterationSpinner = + glui->add_spinner("Pos Iters", GLUI_SPINNER_INT, &settings.positionIterations); + positionIterationSpinner->set_int_limits(0, 100); + + GLUI_Spinner* hertzSpinner = + glui->add_spinner("Hertz", GLUI_SPINNER_FLOAT, &settingsHz); + + hertzSpinner->set_float_limits(5.0f, 200.0f); + + glui->add_checkbox("Warm Starting", &settings.enableWarmStarting); + glui->add_checkbox("Time of Impact", &settings.enableContinuous); + glui->add_checkbox("Sub-Stepping", &settings.enableSubStepping); + + //glui->add_separator(); + + GLUI_Panel* drawPanel = glui->add_panel("Draw"); + glui->add_checkbox_to_panel(drawPanel, "Shapes", &settings.drawShapes); + glui->add_checkbox_to_panel(drawPanel, "Joints", &settings.drawJoints); + glui->add_checkbox_to_panel(drawPanel, "AABBs", &settings.drawAABBs); + glui->add_checkbox_to_panel(drawPanel, "Pairs", &settings.drawPairs); + glui->add_checkbox_to_panel(drawPanel, "Contact Points", &settings.drawContactPoints); + glui->add_checkbox_to_panel(drawPanel, "Contact Normals", &settings.drawContactNormals); + glui->add_checkbox_to_panel(drawPanel, "Contact Forces", &settings.drawContactForces); + glui->add_checkbox_to_panel(drawPanel, "Friction Forces", &settings.drawFrictionForces); + glui->add_checkbox_to_panel(drawPanel, "Center of Masses", &settings.drawCOMs); + glui->add_checkbox_to_panel(drawPanel, "Statistics", &settings.drawStats); + glui->add_checkbox_to_panel(drawPanel, "Profile", &settings.drawProfile); + + int32 testCount = 0; + TestEntry* e = g_testEntries; + while (e->createFcn) + { + testList->add_item(testCount, e->name); + ++testCount; + ++e; + } + + glui->add_button("Pause", 0, Pause); + glui->add_button("Single Step", 0, SingleStep); + glui->add_button("Restart", 0, Restart); + + glui->add_button("Quit", 0,(GLUI_Update_CB)Exit); + glui->set_main_gfx_window( mainWindow ); + + // Use a timer to control the frame rate. + glutTimerFunc(framePeriod, Timer, 0); + + glutMainLoop(); + + return 0; +} diff --git a/external/Box2d/Testbed/Framework/Render.cpp b/external/Box2d/Testbed/Framework/Render.cpp new file mode 100644 index 0000000..dc4bce2 --- /dev/null +++ b/external/Box2d/Testbed/Framework/Render.cpp @@ -0,0 +1,193 @@ +/* +* Copyright (c) 2006-2007 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include "Render.h" + +#include "freeglut/freeglut.h" + +#include +#include +#include +using namespace std; + +void DebugDraw::DrawPolygon(const b2Vec2* vertices, int32 vertexCount, const b2Color& color) +{ + glColor3f(color.r, color.g, color.b); + glBegin(GL_LINE_LOOP); + for (int32 i = 0; i < vertexCount; ++i) + { + glVertex2f(vertices[i].x, vertices[i].y); + } + glEnd(); +} + +void DebugDraw::DrawSolidPolygon(const b2Vec2* vertices, int32 vertexCount, const b2Color& color) +{ + glEnable(GL_BLEND); + glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + glColor4f(0.5f * color.r, 0.5f * color.g, 0.5f * color.b, 0.5f); + glBegin(GL_TRIANGLE_FAN); + for (int32 i = 0; i < vertexCount; ++i) + { + glVertex2f(vertices[i].x, vertices[i].y); + } + glEnd(); + glDisable(GL_BLEND); + + glColor4f(color.r, color.g, color.b, 1.0f); + glBegin(GL_LINE_LOOP); + for (int32 i = 0; i < vertexCount; ++i) + { + glVertex2f(vertices[i].x, vertices[i].y); + } + glEnd(); +} + +void DebugDraw::DrawCircle(const b2Vec2& center, float32 radius, const b2Color& color) +{ + const float32 k_segments = 16.0f; + const float32 k_increment = 2.0f * b2_pi / k_segments; + float32 theta = 0.0f; + glColor3f(color.r, color.g, color.b); + glBegin(GL_LINE_LOOP); + for (int32 i = 0; i < k_segments; ++i) + { + b2Vec2 v = center + radius * b2Vec2(cosf(theta), sinf(theta)); + glVertex2f(v.x, v.y); + theta += k_increment; + } + glEnd(); +} + +void DebugDraw::DrawSolidCircle(const b2Vec2& center, float32 radius, const b2Vec2& axis, const b2Color& color) +{ + const float32 k_segments = 16.0f; + const float32 k_increment = 2.0f * b2_pi / k_segments; + float32 theta = 0.0f; + glEnable(GL_BLEND); + glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + glColor4f(0.5f * color.r, 0.5f * color.g, 0.5f * color.b, 0.5f); + glBegin(GL_TRIANGLE_FAN); + for (int32 i = 0; i < k_segments; ++i) + { + b2Vec2 v = center + radius * b2Vec2(cosf(theta), sinf(theta)); + glVertex2f(v.x, v.y); + theta += k_increment; + } + glEnd(); + glDisable(GL_BLEND); + + theta = 0.0f; + glColor4f(color.r, color.g, color.b, 1.0f); + glBegin(GL_LINE_LOOP); + for (int32 i = 0; i < k_segments; ++i) + { + b2Vec2 v = center + radius * b2Vec2(cosf(theta), sinf(theta)); + glVertex2f(v.x, v.y); + theta += k_increment; + } + glEnd(); + + b2Vec2 p = center + radius * axis; + glBegin(GL_LINES); + glVertex2f(center.x, center.y); + glVertex2f(p.x, p.y); + glEnd(); +} + +void DebugDraw::DrawSegment(const b2Vec2& p1, const b2Vec2& p2, const b2Color& color) +{ + glColor3f(color.r, color.g, color.b); + glBegin(GL_LINES); + glVertex2f(p1.x, p1.y); + glVertex2f(p2.x, p2.y); + glEnd(); +} + +void DebugDraw::DrawTransform(const b2Transform& xf) +{ + b2Vec2 p1 = xf.p, p2; + const float32 k_axisScale = 0.4f; + glBegin(GL_LINES); + + glColor3f(1.0f, 0.0f, 0.0f); + glVertex2f(p1.x, p1.y); + p2 = p1 + k_axisScale * xf.q.GetXAxis(); + glVertex2f(p2.x, p2.y); + + glColor3f(0.0f, 1.0f, 0.0f); + glVertex2f(p1.x, p1.y); + p2 = p1 + k_axisScale * xf.q.GetYAxis(); + glVertex2f(p2.x, p2.y); + + glEnd(); +} + +void DebugDraw::DrawPoint(const b2Vec2& p, float32 size, const b2Color& color) +{ + glPointSize(size); + glBegin(GL_POINTS); + glColor3f(color.r, color.g, color.b); + glVertex2f(p.x, p.y); + glEnd(); + glPointSize(1.0f); +} + +void DebugDraw::DrawString(int x, int y, const char *string, ...) +{ + char buffer[128]; + + va_list arg; + va_start(arg, string); + vsprintf(buffer, string, arg); + va_end(arg); + + glMatrixMode(GL_PROJECTION); + glPushMatrix(); + glLoadIdentity(); + int w = glutGet(GLUT_WINDOW_WIDTH); + int h = glutGet(GLUT_WINDOW_HEIGHT); + gluOrtho2D(0, w, h, 0); + glMatrixMode(GL_MODELVIEW); + glPushMatrix(); + glLoadIdentity(); + + glColor3f(0.9f, 0.6f, 0.6f); + glRasterPos2i(x, y); + int32 length = (int32)strlen(buffer); + for (int32 i = 0; i < length; ++i) + { + glutBitmapCharacter(GLUT_BITMAP_8_BY_13, buffer[i]); + } + + glPopMatrix(); + glMatrixMode(GL_PROJECTION); + glPopMatrix(); + glMatrixMode(GL_MODELVIEW); +} + +void DebugDraw::DrawAABB(b2AABB* aabb, const b2Color& c) +{ + glColor3f(c.r, c.g, c.b); + glBegin(GL_LINE_LOOP); + glVertex2f(aabb->lowerBound.x, aabb->lowerBound.y); + glVertex2f(aabb->upperBound.x, aabb->lowerBound.y); + glVertex2f(aabb->upperBound.x, aabb->upperBound.y); + glVertex2f(aabb->lowerBound.x, aabb->upperBound.y); + glEnd(); +} diff --git a/external/Box2d/Testbed/Framework/Render.h b/external/Box2d/Testbed/Framework/Render.h new file mode 100644 index 0000000..a1d0e88 --- /dev/null +++ b/external/Box2d/Testbed/Framework/Render.h @@ -0,0 +1,51 @@ +/* +* Copyright (c) 2006-2007 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef RENDER_H +#define RENDER_H + +#include + +struct b2AABB; + +// This class implements debug drawing callbacks that are invoked +// inside b2World::Step. +class DebugDraw : public b2Draw +{ +public: + void DrawPolygon(const b2Vec2* vertices, int32 vertexCount, const b2Color& color); + + void DrawSolidPolygon(const b2Vec2* vertices, int32 vertexCount, const b2Color& color); + + void DrawCircle(const b2Vec2& center, float32 radius, const b2Color& color); + + void DrawSolidCircle(const b2Vec2& center, float32 radius, const b2Vec2& axis, const b2Color& color); + + void DrawSegment(const b2Vec2& p1, const b2Vec2& p2, const b2Color& color); + + void DrawTransform(const b2Transform& xf); + + void DrawPoint(const b2Vec2& p, float32 size, const b2Color& color); + + void DrawString(int x, int y, const char* string, ...); + + void DrawAABB(b2AABB* aabb, const b2Color& color); +}; + + +#endif diff --git a/external/Box2d/Testbed/Framework/Test.cpp b/external/Box2d/Testbed/Framework/Test.cpp new file mode 100644 index 0000000..25cc223 --- /dev/null +++ b/external/Box2d/Testbed/Framework/Test.cpp @@ -0,0 +1,442 @@ +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include "Test.h" +#include +using namespace std; + +void DestructionListener::SayGoodbye(b2Joint* joint) +{ + if (test->m_mouseJoint == joint) + { + test->m_mouseJoint = NULL; + } + else + { + test->JointDestroyed(joint); + } +} + +Test::Test() +{ + b2Vec2 gravity; + gravity.Set(0.0f, -10.0f); + m_world = new b2World(gravity); + m_bomb = NULL; + m_textLine = 30; + m_mouseJoint = NULL; + m_pointCount = 0; + + m_destructionListener.test = this; + m_world->SetDestructionListener(&m_destructionListener); + m_world->SetContactListener(this); + m_world->SetDebugDraw(&m_debugDraw); + + m_bombSpawning = false; + + m_stepCount = 0; + + b2BodyDef bodyDef; + m_groundBody = m_world->CreateBody(&bodyDef); + + memset(&m_maxProfile, 0, sizeof(b2Profile)); + memset(&m_totalProfile, 0, sizeof(b2Profile)); +} + +Test::~Test() +{ + // By deleting the world, we delete the bomb, mouse joint, etc. + delete m_world; + m_world = NULL; +} + +void Test::PreSolve(b2Contact* contact, const b2Manifold* oldManifold) +{ + const b2Manifold* manifold = contact->GetManifold(); + + if (manifold->pointCount == 0) + { + return; + } + + b2Fixture* fixtureA = contact->GetFixtureA(); + b2Fixture* fixtureB = contact->GetFixtureB(); + + b2PointState state1[b2_maxManifoldPoints], state2[b2_maxManifoldPoints]; + b2GetPointStates(state1, state2, oldManifold, manifold); + + b2WorldManifold worldManifold; + contact->GetWorldManifold(&worldManifold); + + for (int32 i = 0; i < manifold->pointCount && m_pointCount < k_maxContactPoints; ++i) + { + ContactPoint* cp = m_points + m_pointCount; + cp->fixtureA = fixtureA; + cp->fixtureB = fixtureB; + cp->position = worldManifold.points[i]; + cp->normal = worldManifold.normal; + cp->state = state2[i]; + ++m_pointCount; + } +} + +void Test::DrawTitle(int x, int y, const char *string) +{ + m_debugDraw.DrawString(x, y, string); +} + +class QueryCallback : public b2QueryCallback +{ +public: + QueryCallback(const b2Vec2& point) + { + m_point = point; + m_fixture = NULL; + } + + bool ReportFixture(b2Fixture* fixture) + { + b2Body* body = fixture->GetBody(); + if (body->GetType() == b2_dynamicBody) + { + bool inside = fixture->TestPoint(m_point); + if (inside) + { + m_fixture = fixture; + + // We are done, terminate the query. + return false; + } + } + + // Continue the query. + return true; + } + + b2Vec2 m_point; + b2Fixture* m_fixture; +}; + +void Test::MouseDown(const b2Vec2& p) +{ + m_mouseWorld = p; + + if (m_mouseJoint != NULL) + { + return; + } + + // Make a small box. + b2AABB aabb; + b2Vec2 d; + d.Set(0.001f, 0.001f); + aabb.lowerBound = p - d; + aabb.upperBound = p + d; + + // Query the world for overlapping shapes. + QueryCallback callback(p); + m_world->QueryAABB(&callback, aabb); + + if (callback.m_fixture) + { + b2Body* body = callback.m_fixture->GetBody(); + b2MouseJointDef md; + md.bodyA = m_groundBody; + md.bodyB = body; + md.target = p; + md.maxForce = 1000.0f * body->GetMass(); + m_mouseJoint = (b2MouseJoint*)m_world->CreateJoint(&md); + body->SetAwake(true); + } +} + +void Test::SpawnBomb(const b2Vec2& worldPt) +{ + m_bombSpawnPoint = worldPt; + m_bombSpawning = true; +} + +void Test::CompleteBombSpawn(const b2Vec2& p) +{ + if (m_bombSpawning == false) + { + return; + } + + const float multiplier = 30.0f; + b2Vec2 vel = m_bombSpawnPoint - p; + vel *= multiplier; + LaunchBomb(m_bombSpawnPoint,vel); + m_bombSpawning = false; +} + +void Test::ShiftMouseDown(const b2Vec2& p) +{ + m_mouseWorld = p; + + if (m_mouseJoint != NULL) + { + return; + } + + SpawnBomb(p); +} + +void Test::MouseUp(const b2Vec2& p) +{ + if (m_mouseJoint) + { + m_world->DestroyJoint(m_mouseJoint); + m_mouseJoint = NULL; + } + + if (m_bombSpawning) + { + CompleteBombSpawn(p); + } +} + +void Test::MouseMove(const b2Vec2& p) +{ + m_mouseWorld = p; + + if (m_mouseJoint) + { + m_mouseJoint->SetTarget(p); + } +} + +void Test::LaunchBomb() +{ + b2Vec2 p(RandomFloat(-15.0f, 15.0f), 30.0f); + b2Vec2 v = -5.0f * p; + LaunchBomb(p, v); +} + +void Test::LaunchBomb(const b2Vec2& position, const b2Vec2& velocity) +{ + if (m_bomb) + { + m_world->DestroyBody(m_bomb); + m_bomb = NULL; + } + + b2BodyDef bd; + bd.type = b2_dynamicBody; + bd.position = position; + bd.bullet = true; + m_bomb = m_world->CreateBody(&bd); + m_bomb->SetLinearVelocity(velocity); + + b2CircleShape circle; + circle.m_radius = 0.3f; + + b2FixtureDef fd; + fd.shape = &circle; + fd.density = 20.0f; + fd.restitution = 0.0f; + + b2Vec2 minV = position - b2Vec2(0.3f,0.3f); + b2Vec2 maxV = position + b2Vec2(0.3f,0.3f); + + b2AABB aabb; + aabb.lowerBound = minV; + aabb.upperBound = maxV; + + m_bomb->CreateFixture(&fd); +} + +void Test::Step(Settings* settings) +{ + float32 timeStep = settings->hz > 0.0f ? 1.0f / settings->hz : float32(0.0f); + + if (settings->pause) + { + if (settings->singleStep) + { + settings->singleStep = 0; + } + else + { + timeStep = 0.0f; + } + + m_debugDraw.DrawString(5, m_textLine, "****PAUSED****"); + m_textLine += 15; + } + + uint32 flags = 0; + flags += settings->drawShapes * b2Draw::e_shapeBit; + flags += settings->drawJoints * b2Draw::e_jointBit; + flags += settings->drawAABBs * b2Draw::e_aabbBit; + flags += settings->drawPairs * b2Draw::e_pairBit; + flags += settings->drawCOMs * b2Draw::e_centerOfMassBit; + m_debugDraw.SetFlags(flags); + + m_world->SetWarmStarting(settings->enableWarmStarting > 0); + m_world->SetContinuousPhysics(settings->enableContinuous > 0); + m_world->SetSubStepping(settings->enableSubStepping > 0); + + m_pointCount = 0; + + m_world->Step(timeStep, settings->velocityIterations, settings->positionIterations); + + m_world->DrawDebugData(); + + if (timeStep > 0.0f) + { + ++m_stepCount; + } + + if (settings->drawStats) + { + int32 bodyCount = m_world->GetBodyCount(); + int32 contactCount = m_world->GetContactCount(); + int32 jointCount = m_world->GetJointCount(); + m_debugDraw.DrawString(5, m_textLine, "bodies/contacts/joints = %d/%d/%d", bodyCount, contactCount, jointCount); + m_textLine += 15; + + int32 proxyCount = m_world->GetProxyCount(); + int32 height = m_world->GetTreeHeight(); + int32 balance = m_world->GetTreeBalance(); + float32 quality = m_world->GetTreeQuality(); + m_debugDraw.DrawString(5, m_textLine, "proxies/height/balance/quality = %d/%d/%d/%g", proxyCount, height, balance, quality); + m_textLine += 15; + } + + // Track maximum profile times + { + const b2Profile& p = m_world->GetProfile(); + m_maxProfile.step = b2Max(m_maxProfile.step, p.step); + m_maxProfile.collide = b2Max(m_maxProfile.collide, p.collide); + m_maxProfile.solve = b2Max(m_maxProfile.solve, p.solve); + m_maxProfile.solveInit = b2Max(m_maxProfile.solveInit, p.solveInit); + m_maxProfile.solveVelocity = b2Max(m_maxProfile.solveVelocity, p.solveVelocity); + m_maxProfile.solvePosition = b2Max(m_maxProfile.solvePosition, p.solvePosition); + m_maxProfile.solveTOI = b2Max(m_maxProfile.solveTOI, p.solveTOI); + + m_totalProfile.step += p.step; + m_totalProfile.collide += p.collide; + m_totalProfile.solve += p.solve; + m_totalProfile.solveInit += p.solveInit; + m_totalProfile.solveVelocity += p.solveVelocity; + m_totalProfile.solvePosition += p.solvePosition; + m_totalProfile.solveTOI += p.solveTOI; + } + + if (settings->drawProfile) + { + const b2Profile& p = m_world->GetProfile(); + + b2Profile aveProfile; + memset(&aveProfile, 0, sizeof(b2Profile)); + if (m_stepCount > 0) + { + float32 scale = 1.0f / m_stepCount; + aveProfile.step = scale * m_totalProfile.step; + aveProfile.collide = scale * m_totalProfile.collide; + aveProfile.solve = scale * m_totalProfile.solve; + aveProfile.solveInit = scale * m_totalProfile.solveInit; + aveProfile.solveVelocity = scale * m_totalProfile.solveVelocity; + aveProfile.solvePosition = scale * m_totalProfile.solvePosition; + aveProfile.solveTOI = scale * m_totalProfile.solveTOI; + } + + m_debugDraw.DrawString(5, m_textLine, "step [ave] (max) = %5.2f [%6.2f] (%6.2f)", p.step, aveProfile.step, m_maxProfile.step); + m_textLine += 15; + m_debugDraw.DrawString(5, m_textLine, "collide [ave] (max) = %5.2f [%6.2f] (%6.2f)", p.collide, aveProfile.collide, m_maxProfile.collide); + m_textLine += 15; + m_debugDraw.DrawString(5, m_textLine, "solve [ave] (max) = %5.2f [%6.2f] (%6.2f)", p.solve, aveProfile.solve, m_maxProfile.solve); + m_textLine += 15; + m_debugDraw.DrawString(5, m_textLine, "solve init [ave] (max) = %5.2f [%6.2f] (%6.2f)", p.solveInit, aveProfile.solveInit, m_maxProfile.solveInit); + m_textLine += 15; + m_debugDraw.DrawString(5, m_textLine, "solve velocity [ave] (max) = %5.2f [%6.2f] (%6.2f)", p.solveVelocity, aveProfile.solveVelocity, m_maxProfile.solveVelocity); + m_textLine += 15; + m_debugDraw.DrawString(5, m_textLine, "solve position [ave] (max) = %5.2f [%6.2f] (%6.2f)", p.solvePosition, aveProfile.solvePosition, m_maxProfile.solvePosition); + m_textLine += 15; + m_debugDraw.DrawString(5, m_textLine, "solveTOI [ave] (max) = %5.2f [%6.2f] (%6.2f)", p.solveTOI, aveProfile.solveTOI, m_maxProfile.solveTOI); + m_textLine += 15; + } + + if (m_mouseJoint) + { + b2Vec2 p1 = m_mouseJoint->GetAnchorB(); + b2Vec2 p2 = m_mouseJoint->GetTarget(); + + b2Color c; + c.Set(0.0f, 1.0f, 0.0f); + m_debugDraw.DrawPoint(p1, 4.0f, c); + m_debugDraw.DrawPoint(p2, 4.0f, c); + + c.Set(0.8f, 0.8f, 0.8f); + m_debugDraw.DrawSegment(p1, p2, c); + } + + if (m_bombSpawning) + { + b2Color c; + c.Set(0.0f, 0.0f, 1.0f); + m_debugDraw.DrawPoint(m_bombSpawnPoint, 4.0f, c); + + c.Set(0.8f, 0.8f, 0.8f); + m_debugDraw.DrawSegment(m_mouseWorld, m_bombSpawnPoint, c); + } + + if (settings->drawContactPoints) + { + //const float32 k_impulseScale = 0.1f; + const float32 k_axisScale = 0.3f; + + for (int32 i = 0; i < m_pointCount; ++i) + { + ContactPoint* point = m_points + i; + + if (point->state == b2_addState) + { + // Add + m_debugDraw.DrawPoint(point->position, 10.0f, b2Color(0.3f, 0.95f, 0.3f)); + } + else if (point->state == b2_persistState) + { + // Persist + m_debugDraw.DrawPoint(point->position, 5.0f, b2Color(0.3f, 0.3f, 0.95f)); + } + + if (settings->drawContactNormals == 1) + { + b2Vec2 p1 = point->position; + b2Vec2 p2 = p1 + k_axisScale * point->normal; + m_debugDraw.DrawSegment(p1, p2, b2Color(0.9f, 0.9f, 0.9f)); + } + else if (settings->drawContactForces == 1) + { + //b2Vec2 p1 = point->position; + //b2Vec2 p2 = p1 + k_forceScale * point->normalForce * point->normal; + //DrawSegment(p1, p2, b2Color(0.9f, 0.9f, 0.3f)); + } + + if (settings->drawFrictionForces == 1) + { + //b2Vec2 tangent = b2Cross(point->normal, 1.0f); + //b2Vec2 p1 = point->position; + //b2Vec2 p2 = p1 + k_forceScale * point->tangentForce * tangent; + //DrawSegment(p1, p2, b2Color(0.9f, 0.9f, 0.3f)); + } + } + } +} diff --git a/external/Box2d/Testbed/Framework/Test.h b/external/Box2d/Testbed/Framework/Test.h new file mode 100644 index 0000000..71e3b46 --- /dev/null +++ b/external/Box2d/Testbed/Framework/Test.h @@ -0,0 +1,189 @@ +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef TEST_H +#define TEST_H + +#include +#include "Render.h" + +#include + +class Test; +struct Settings; + +typedef Test* TestCreateFcn(); + +#define RAND_LIMIT 32767 + +/// Random number in range [-1,1] +inline float32 RandomFloat() +{ + float32 r = (float32)(std::rand() & (RAND_LIMIT)); + r /= RAND_LIMIT; + r = 2.0f * r - 1.0f; + return r; +} + +/// Random floating point number in range [lo, hi] +inline float32 RandomFloat(float32 lo, float32 hi) +{ + float32 r = (float32)(std::rand() & (RAND_LIMIT)); + r /= RAND_LIMIT; + r = (hi - lo) * r + lo; + return r; +} + +/// Test settings. Some can be controlled in the GUI. +struct Settings +{ + Settings() : + viewCenter(0.0f, 20.0f), + hz(60.0f), + velocityIterations(8), + positionIterations(3), + drawShapes(1), + drawJoints(1), + drawAABBs(0), + drawPairs(0), + drawContactPoints(0), + drawContactNormals(0), + drawContactForces(0), + drawFrictionForces(0), + drawCOMs(0), + drawStats(0), + drawProfile(0), + enableWarmStarting(1), + enableContinuous(1), + enableSubStepping(0), + pause(0), + singleStep(0) + {} + + b2Vec2 viewCenter; + float32 hz; + int32 velocityIterations; + int32 positionIterations; + int32 drawShapes; + int32 drawJoints; + int32 drawAABBs; + int32 drawPairs; + int32 drawContactPoints; + int32 drawContactNormals; + int32 drawContactForces; + int32 drawFrictionForces; + int32 drawCOMs; + int32 drawStats; + int32 drawProfile; + int32 enableWarmStarting; + int32 enableContinuous; + int32 enableSubStepping; + int32 pause; + int32 singleStep; +}; + +struct TestEntry +{ + const char *name; + TestCreateFcn *createFcn; +}; + +extern TestEntry g_testEntries[]; +// This is called when a joint in the world is implicitly destroyed +// because an attached body is destroyed. This gives us a chance to +// nullify the mouse joint. +class DestructionListener : public b2DestructionListener +{ +public: + void SayGoodbye(b2Fixture* fixture) { B2_NOT_USED(fixture); } + void SayGoodbye(b2Joint* joint); + + Test* test; +}; + +const int32 k_maxContactPoints = 2048; + +struct ContactPoint +{ + b2Fixture* fixtureA; + b2Fixture* fixtureB; + b2Vec2 normal; + b2Vec2 position; + b2PointState state; +}; + +class Test : public b2ContactListener +{ +public: + + Test(); + virtual ~Test(); + + void SetTextLine(int32 line) { m_textLine = line; } + void DrawTitle(int x, int y, const char *string); + virtual void Step(Settings* settings); + virtual void Keyboard(unsigned char key) { B2_NOT_USED(key); } + virtual void KeyboardUp(unsigned char key) { B2_NOT_USED(key); } + void ShiftMouseDown(const b2Vec2& p); + virtual void MouseDown(const b2Vec2& p); + virtual void MouseUp(const b2Vec2& p); + void MouseMove(const b2Vec2& p); + void LaunchBomb(); + void LaunchBomb(const b2Vec2& position, const b2Vec2& velocity); + + void SpawnBomb(const b2Vec2& worldPt); + void CompleteBombSpawn(const b2Vec2& p); + + // Let derived tests know that a joint was destroyed. + virtual void JointDestroyed(b2Joint* joint) { B2_NOT_USED(joint); } + + // Callbacks for derived classes. + virtual void BeginContact(b2Contact* contact) { B2_NOT_USED(contact); } + virtual void EndContact(b2Contact* contact) { B2_NOT_USED(contact); } + virtual void PreSolve(b2Contact* contact, const b2Manifold* oldManifold); + virtual void PostSolve(const b2Contact* contact, const b2ContactImpulse* impulse) + { + B2_NOT_USED(contact); + B2_NOT_USED(impulse); + } + +protected: + friend class DestructionListener; + friend class BoundaryListener; + friend class ContactListener; + + b2Body* m_groundBody; + b2AABB m_worldAABB; + ContactPoint m_points[k_maxContactPoints]; + int32 m_pointCount; + DestructionListener m_destructionListener; + DebugDraw m_debugDraw; + int32 m_textLine; + b2World* m_world; + b2Body* m_bomb; + b2MouseJoint* m_mouseJoint; + b2Vec2 m_bombSpawnPoint; + bool m_bombSpawning; + b2Vec2 m_mouseWorld; + int32 m_stepCount; + + b2Profile m_maxProfile; + b2Profile m_totalProfile; +}; + +#endif diff --git a/external/Box2d/Testbed/Tests/AddPair.h b/external/Box2d/Testbed/Tests/AddPair.h new file mode 100755 index 0000000..9ba7dd9 --- /dev/null +++ b/external/Box2d/Testbed/Tests/AddPair.h @@ -0,0 +1,53 @@ + +#ifndef AddPair_H +#define AddPair_H + +class AddPair : public Test +{ +public: + + AddPair() + { + m_world->SetGravity(b2Vec2(0.0f,0.0f)); + { + float32 a = 0.1f; + + b2CircleShape shape; + shape.m_p.SetZero(); + shape.m_radius = 0.1f; + + float minX = -6.0f; + float maxX = 0.0f; + float minY = 4.0f; + float maxY = 6.0f; + + for (int32 i = 0; i < 400; ++i) + { + b2BodyDef bd; + bd.type = b2_dynamicBody; + bd.position = b2Vec2(RandomFloat(minX,maxX),RandomFloat(minY,maxY)); + b2Body* body = m_world->CreateBody(&bd); + body->CreateFixture(&shape, 0.01f); + } + } + + { + b2PolygonShape shape; + shape.SetAsBox(1.5f, 1.5f); + b2BodyDef bd; + bd.type = b2_dynamicBody; + bd.position.Set(-40.0f,5.0f); + bd.bullet = true; + b2Body* body = m_world->CreateBody(&bd); + body->CreateFixture(&shape, 1.0f); + body->SetLinearVelocity(b2Vec2(150.0f, 0.0f)); + } + } + + static Test* Create() + { + return new AddPair; + } +}; + +#endif diff --git a/external/Box2d/Testbed/Tests/ApplyForce.h b/external/Box2d/Testbed/Tests/ApplyForce.h new file mode 100755 index 0000000..8227075 --- /dev/null +++ b/external/Box2d/Testbed/Tests/ApplyForce.h @@ -0,0 +1,180 @@ +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef APPLY_FORCE_H +#define APPLY_FORCE_H + +class ApplyForce : public Test +{ +public: + ApplyForce() + { + m_world->SetGravity(b2Vec2(0.0f, 0.0f)); + + const float32 k_restitution = 0.4f; + + b2Body* ground; + { + b2BodyDef bd; + bd.position.Set(0.0f, 20.0f); + ground = m_world->CreateBody(&bd); + + b2EdgeShape shape; + + b2FixtureDef sd; + sd.shape = &shape; + sd.density = 0.0f; + sd.restitution = k_restitution; + + // Left vertical + shape.Set(b2Vec2(-20.0f, -20.0f), b2Vec2(-20.0f, 20.0f)); + ground->CreateFixture(&sd); + + // Right vertical + shape.Set(b2Vec2(20.0f, -20.0f), b2Vec2(20.0f, 20.0f)); + ground->CreateFixture(&sd); + + // Top horizontal + shape.Set(b2Vec2(-20.0f, 20.0f), b2Vec2(20.0f, 20.0f)); + ground->CreateFixture(&sd); + + // Bottom horizontal + shape.Set(b2Vec2(-20.0f, -20.0f), b2Vec2(20.0f, -20.0f)); + ground->CreateFixture(&sd); + } + + { + b2Transform xf1; + xf1.q.Set(0.3524f * b2_pi); + xf1.p = xf1.q.GetXAxis(); + + b2Vec2 vertices[3]; + vertices[0] = b2Mul(xf1, b2Vec2(-1.0f, 0.0f)); + vertices[1] = b2Mul(xf1, b2Vec2(1.0f, 0.0f)); + vertices[2] = b2Mul(xf1, b2Vec2(0.0f, 0.5f)); + + b2PolygonShape poly1; + poly1.Set(vertices, 3); + + b2FixtureDef sd1; + sd1.shape = &poly1; + sd1.density = 4.0f; + + b2Transform xf2; + xf2.q.Set(-0.3524f * b2_pi); + xf2.p = -xf2.q.GetXAxis(); + + vertices[0] = b2Mul(xf2, b2Vec2(-1.0f, 0.0f)); + vertices[1] = b2Mul(xf2, b2Vec2(1.0f, 0.0f)); + vertices[2] = b2Mul(xf2, b2Vec2(0.0f, 0.5f)); + + b2PolygonShape poly2; + poly2.Set(vertices, 3); + + b2FixtureDef sd2; + sd2.shape = &poly2; + sd2.density = 2.0f; + + b2BodyDef bd; + bd.type = b2_dynamicBody; + bd.angularDamping = 5.0f; + bd.linearDamping = 0.1f; + + bd.position.Set(0.0f, 2.0); + bd.angle = b2_pi; + bd.allowSleep = false; + m_body = m_world->CreateBody(&bd); + m_body->CreateFixture(&sd1); + m_body->CreateFixture(&sd2); + } + + { + b2PolygonShape shape; + shape.SetAsBox(0.5f, 0.5f); + + b2FixtureDef fd; + fd.shape = &shape; + fd.density = 1.0f; + fd.friction = 0.3f; + + for (int i = 0; i < 10; ++i) + { + b2BodyDef bd; + bd.type = b2_dynamicBody; + + bd.position.Set(0.0f, 5.0f + 1.54f * i); + b2Body* body = m_world->CreateBody(&bd); + + body->CreateFixture(&fd); + + float32 gravity = 10.0f; + float32 I = body->GetInertia(); + float32 mass = body->GetMass(); + + // For a circle: I = 0.5 * m * r * r ==> r = sqrt(2 * I / m) + float32 radius = b2Sqrt(2.0f * I / mass); + + b2FrictionJointDef jd; + jd.localAnchorA.SetZero(); + jd.localAnchorB.SetZero(); + jd.bodyA = ground; + jd.bodyB = body; + jd.collideConnected = true; + jd.maxForce = mass * gravity; + jd.maxTorque = mass * radius * gravity; + + m_world->CreateJoint(&jd); + } + } + } + + void Keyboard(unsigned char key) + { + switch (key) + { + case 'w': + { + b2Vec2 f = m_body->GetWorldVector(b2Vec2(0.0f, -200.0f)); + b2Vec2 p = m_body->GetWorldPoint(b2Vec2(0.0f, 2.0f)); + m_body->ApplyForce(f, p); + } + break; + + case 'a': + { + m_body->ApplyTorque(50.0f); + } + break; + + case 'd': + { + m_body->ApplyTorque(-50.0f); + } + break; + } + } + + static Test* Create() + { + return new ApplyForce; + } + + b2Body* m_body; +}; + +#endif diff --git a/external/Box2d/Testbed/Tests/BodyTypes.h b/external/Box2d/Testbed/Tests/BodyTypes.h new file mode 100755 index 0000000..9429ea0 --- /dev/null +++ b/external/Box2d/Testbed/Tests/BodyTypes.h @@ -0,0 +1,159 @@ +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef BODY_TYPES_H +#define BODY_TYPES_H + +class BodyTypes : public Test +{ +public: + BodyTypes() + { + b2Body* ground = NULL; + { + b2BodyDef bd; + ground = m_world->CreateBody(&bd); + + b2EdgeShape shape; + shape.Set(b2Vec2(-20.0f, 0.0f), b2Vec2(20.0f, 0.0f)); + + b2FixtureDef fd; + fd.shape = &shape; + + ground->CreateFixture(&fd); + } + + // Define attachment + { + b2BodyDef bd; + bd.type = b2_dynamicBody; + bd.position.Set(0.0f, 3.0f); + m_attachment = m_world->CreateBody(&bd); + + b2PolygonShape shape; + shape.SetAsBox(0.5f, 2.0f); + m_attachment->CreateFixture(&shape, 2.0f); + } + + // Define platform + { + b2BodyDef bd; + bd.type = b2_dynamicBody; + bd.position.Set(-4.0f, 5.0f); + m_platform = m_world->CreateBody(&bd); + + b2PolygonShape shape; + shape.SetAsBox(0.5f, 4.0f, b2Vec2(4.0f, 0.0f), 0.5f * b2_pi); + + b2FixtureDef fd; + fd.shape = &shape; + fd.friction = 0.6f; + fd.density = 2.0f; + m_platform->CreateFixture(&fd); + + b2RevoluteJointDef rjd; + rjd.Initialize(m_attachment, m_platform, b2Vec2(0.0f, 5.0f)); + rjd.maxMotorTorque = 50.0f; + rjd.enableMotor = true; + m_world->CreateJoint(&rjd); + + b2PrismaticJointDef pjd; + pjd.Initialize(ground, m_platform, b2Vec2(0.0f, 5.0f), b2Vec2(1.0f, 0.0f)); + + pjd.maxMotorForce = 1000.0f; + pjd.enableMotor = true; + pjd.lowerTranslation = -10.0f; + pjd.upperTranslation = 10.0f; + pjd.enableLimit = true; + + (b2PrismaticJoint*)m_world->CreateJoint(&pjd); + + m_speed = 3.0f; + } + + // Create a payload + { + b2BodyDef bd; + bd.type = b2_dynamicBody; + bd.position.Set(0.0f, 8.0f); + b2Body* body = m_world->CreateBody(&bd); + + b2PolygonShape shape; + shape.SetAsBox(0.75f, 0.75f); + + b2FixtureDef fd; + fd.shape = &shape; + fd.friction = 0.6f; + fd.density = 2.0f; + + body->CreateFixture(&fd); + } + } + + void Keyboard(unsigned char key) + { + switch (key) + { + case 'd': + m_platform->SetType(b2_dynamicBody); + break; + + case 's': + m_platform->SetType(b2_staticBody); + break; + + case 'k': + m_platform->SetType(b2_kinematicBody); + m_platform->SetLinearVelocity(b2Vec2(-m_speed, 0.0f)); + m_platform->SetAngularVelocity(0.0f); + break; + } + } + + void Step(Settings* settings) + { + // Drive the kinematic body. + if (m_platform->GetType() == b2_kinematicBody) + { + b2Vec2 p = m_platform->GetTransform().p; + b2Vec2 v = m_platform->GetLinearVelocity(); + + if ((p.x < -10.0f && v.x < 0.0f) || + (p.x > 10.0f && v.x > 0.0f)) + { + v.x = -v.x; + m_platform->SetLinearVelocity(v); + } + } + + Test::Step(settings); + m_debugDraw.DrawString(5, m_textLine, "Keys: (d) dynamic, (s) static, (k) kinematic"); + m_textLine += 15; + } + + static Test* Create() + { + return new BodyTypes; + } + + b2Body* m_attachment; + b2Body* m_platform; + float32 m_speed; +}; + +#endif diff --git a/external/Box2d/Testbed/Tests/Breakable.h b/external/Box2d/Testbed/Tests/Breakable.h new file mode 100755 index 0000000..2b43dce --- /dev/null +++ b/external/Box2d/Testbed/Tests/Breakable.h @@ -0,0 +1,155 @@ +/* +* Copyright (c) 2008-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef BREAKABLE_TEST_H +#define BREAKABLE_TEST_H + +// This is used to test sensor shapes. +class Breakable : public Test +{ +public: + + enum + { + e_count = 7 + }; + + Breakable() + { + // Ground body + { + b2BodyDef bd; + b2Body* ground = m_world->CreateBody(&bd); + + b2EdgeShape shape; + shape.Set(b2Vec2(-40.0f, 0.0f), b2Vec2(40.0f, 0.0f)); + ground->CreateFixture(&shape, 0.0f); + } + + // Breakable dynamic body + { + b2BodyDef bd; + bd.type = b2_dynamicBody; + bd.position.Set(0.0f, 40.0f); + bd.angle = 0.25f * b2_pi; + m_body1 = m_world->CreateBody(&bd); + + m_shape1.SetAsBox(0.5f, 0.5f, b2Vec2(-0.5f, 0.0f), 0.0f); + m_piece1 = m_body1->CreateFixture(&m_shape1, 1.0f); + + m_shape2.SetAsBox(0.5f, 0.5f, b2Vec2(0.5f, 0.0f), 0.0f); + m_piece2 = m_body1->CreateFixture(&m_shape2, 1.0f); + } + + m_break = false; + m_broke = false; + } + + void PostSolve(b2Contact* contact, const b2ContactImpulse* impulse) + { + if (m_broke) + { + // The body already broke. + return; + } + + // Should the body break? + int32 count = contact->GetManifold()->pointCount; + + float32 maxImpulse = 0.0f; + for (int32 i = 0; i < count; ++i) + { + maxImpulse = b2Max(maxImpulse, impulse->normalImpulses[i]); + } + + if (maxImpulse > 40.0f) + { + // Flag the body for breaking. + m_break = true; + } + } + + void Break() + { + // Create two bodies from one. + b2Body* body1 = m_piece1->GetBody(); + b2Vec2 center = body1->GetWorldCenter(); + + body1->DestroyFixture(m_piece2); + m_piece2 = NULL; + + b2BodyDef bd; + bd.type = b2_dynamicBody; + bd.position = body1->GetPosition(); + bd.angle = body1->GetAngle(); + + b2Body* body2 = m_world->CreateBody(&bd); + m_piece2 = body2->CreateFixture(&m_shape2, 1.0f); + + // Compute consistent velocities for new bodies based on + // cached velocity. + b2Vec2 center1 = body1->GetWorldCenter(); + b2Vec2 center2 = body2->GetWorldCenter(); + + b2Vec2 velocity1 = m_velocity + b2Cross(m_angularVelocity, center1 - center); + b2Vec2 velocity2 = m_velocity + b2Cross(m_angularVelocity, center2 - center); + + body1->SetAngularVelocity(m_angularVelocity); + body1->SetLinearVelocity(velocity1); + + body2->SetAngularVelocity(m_angularVelocity); + body2->SetLinearVelocity(velocity2); + } + + void Step(Settings* settings) + { + if (m_break) + { + Break(); + m_broke = true; + m_break = false; + } + + // Cache velocities to improve movement on breakage. + if (m_broke == false) + { + m_velocity = m_body1->GetLinearVelocity(); + m_angularVelocity = m_body1->GetAngularVelocity(); + } + + Test::Step(settings); + } + + static Test* Create() + { + return new Breakable; + } + + b2Body* m_body1; + b2Vec2 m_velocity; + float32 m_angularVelocity; + b2PolygonShape m_shape1; + b2PolygonShape m_shape2; + b2Fixture* m_piece1; + b2Fixture* m_piece2; + + bool m_broke; + bool m_break; +}; + +#endif diff --git a/external/Box2d/Testbed/Tests/Bridge.h b/external/Box2d/Testbed/Tests/Bridge.h new file mode 100755 index 0000000..ef83649 --- /dev/null +++ b/external/Box2d/Testbed/Tests/Bridge.h @@ -0,0 +1,125 @@ +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef BRIDGE_H +#define BRIDGE_H + +class Bridge : public Test +{ +public: + + enum + { + e_count = 30 + }; + + Bridge() + { + b2Body* ground = NULL; + { + b2BodyDef bd; + ground = m_world->CreateBody(&bd); + + b2EdgeShape shape; + shape.Set(b2Vec2(-40.0f, 0.0f), b2Vec2(40.0f, 0.0f)); + ground->CreateFixture(&shape, 0.0f); + } + + { + b2PolygonShape shape; + shape.SetAsBox(0.5f, 0.125f); + + b2FixtureDef fd; + fd.shape = &shape; + fd.density = 20.0f; + fd.friction = 0.2f; + + b2RevoluteJointDef jd; + + b2Body* prevBody = ground; + for (int32 i = 0; i < e_count; ++i) + { + b2BodyDef bd; + bd.type = b2_dynamicBody; + bd.position.Set(-14.5f + 1.0f * i, 5.0f); + b2Body* body = m_world->CreateBody(&bd); + body->CreateFixture(&fd); + + b2Vec2 anchor(-15.0f + 1.0f * i, 5.0f); + jd.Initialize(prevBody, body, anchor); + m_world->CreateJoint(&jd); + + if (i == (e_count >> 1)) + { + m_middle = body; + } + prevBody = body; + } + + b2Vec2 anchor(-15.0f + 1.0f * e_count, 5.0f); + jd.Initialize(prevBody, ground, anchor); + m_world->CreateJoint(&jd); + } + + for (int32 i = 0; i < 2; ++i) + { + b2Vec2 vertices[3]; + vertices[0].Set(-0.5f, 0.0f); + vertices[1].Set(0.5f, 0.0f); + vertices[2].Set(0.0f, 1.5f); + + b2PolygonShape shape; + shape.Set(vertices, 3); + + b2FixtureDef fd; + fd.shape = &shape; + fd.density = 1.0f; + + b2BodyDef bd; + bd.type = b2_dynamicBody; + bd.position.Set(-8.0f + 8.0f * i, 12.0f); + b2Body* body = m_world->CreateBody(&bd); + body->CreateFixture(&fd); + } + + for (int32 i = 0; i < 3; ++i) + { + b2CircleShape shape; + shape.m_radius = 0.5f; + + b2FixtureDef fd; + fd.shape = &shape; + fd.density = 1.0f; + + b2BodyDef bd; + bd.type = b2_dynamicBody; + bd.position.Set(-6.0f + 6.0f * i, 10.0f); + b2Body* body = m_world->CreateBody(&bd); + body->CreateFixture(&fd); + } + } + + static Test* Create() + { + return new Bridge; + } + + b2Body* m_middle; +}; + +#endif diff --git a/external/Box2d/Testbed/Tests/BulletTest.h b/external/Box2d/Testbed/Tests/BulletTest.h new file mode 100755 index 0000000..10f1f00 --- /dev/null +++ b/external/Box2d/Testbed/Tests/BulletTest.h @@ -0,0 +1,136 @@ +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef BULLET_TEST_H +#define BULLET_TEST_H + +class BulletTest : public Test +{ +public: + + BulletTest() + { + { + b2BodyDef bd; + bd.position.Set(0.0f, 0.0f); + b2Body* body = m_world->CreateBody(&bd); + + b2EdgeShape edge; + + edge.Set(b2Vec2(-10.0f, 0.0f), b2Vec2(10.0f, 0.0f)); + body->CreateFixture(&edge, 0.0f); + + b2PolygonShape shape; + shape.SetAsBox(0.2f, 1.0f, b2Vec2(0.5f, 1.0f), 0.0f); + body->CreateFixture(&shape, 0.0f); + } + + { + b2BodyDef bd; + bd.type = b2_dynamicBody; + bd.position.Set(0.0f, 4.0f); + + b2PolygonShape box; + box.SetAsBox(2.0f, 0.1f); + + m_body = m_world->CreateBody(&bd); + m_body->CreateFixture(&box, 1.0f); + + box.SetAsBox(0.25f, 0.25f); + + //m_x = RandomFloat(-1.0f, 1.0f); + m_x = 0.20352793f; + bd.position.Set(m_x, 10.0f); + bd.bullet = true; + + m_bullet = m_world->CreateBody(&bd); + m_bullet->CreateFixture(&box, 100.0f); + + m_bullet->SetLinearVelocity(b2Vec2(0.0f, -50.0f)); + } + } + + void Launch() + { + m_body->SetTransform(b2Vec2(0.0f, 4.0f), 0.0f); + m_body->SetLinearVelocity(b2Vec2_zero); + m_body->SetAngularVelocity(0.0f); + + m_x = RandomFloat(-1.0f, 1.0f); + m_bullet->SetTransform(b2Vec2(m_x, 10.0f), 0.0f); + m_bullet->SetLinearVelocity(b2Vec2(0.0f, -50.0f)); + m_bullet->SetAngularVelocity(0.0f); + + extern int32 b2_gjkCalls, b2_gjkIters, b2_gjkMaxIters; + extern int32 b2_toiCalls, b2_toiIters, b2_toiMaxIters; + extern int32 b2_toiRootIters, b2_toiMaxRootIters; + + b2_gjkCalls = 0; + b2_gjkIters = 0; + b2_gjkMaxIters = 0; + + b2_toiCalls = 0; + b2_toiIters = 0; + b2_toiMaxIters = 0; + b2_toiRootIters = 0; + b2_toiMaxRootIters = 0; + } + + void Step(Settings* settings) + { + Test::Step(settings); + + extern int32 b2_gjkCalls, b2_gjkIters, b2_gjkMaxIters; + extern int32 b2_toiCalls, b2_toiIters; + extern int32 b2_toiRootIters, b2_toiMaxRootIters; + + if (b2_gjkCalls > 0) + { + m_debugDraw.DrawString(5, m_textLine, "gjk calls = %d, ave gjk iters = %3.1f, max gjk iters = %d", + b2_gjkCalls, b2_gjkIters / float32(b2_gjkCalls), b2_gjkMaxIters); + m_textLine += 15; + } + + if (b2_toiCalls > 0) + { + m_debugDraw.DrawString(5, m_textLine, "toi calls = %d, ave toi iters = %3.1f, max toi iters = %d", + b2_toiCalls, b2_toiIters / float32(b2_toiCalls), b2_toiMaxRootIters); + m_textLine += 15; + + m_debugDraw.DrawString(5, m_textLine, "ave toi root iters = %3.1f, max toi root iters = %d", + b2_toiRootIters / float32(b2_toiCalls), b2_toiMaxRootIters); + m_textLine += 15; + } + + if (m_stepCount % 60 == 0) + { + Launch(); + } + } + + static Test* Create() + { + return new BulletTest; + } + + b2Body* m_body; + b2Body* m_bullet; + float32 m_x; +}; + +#endif diff --git a/external/Box2d/Testbed/Tests/Cantilever.h b/external/Box2d/Testbed/Tests/Cantilever.h new file mode 100755 index 0000000..28084da --- /dev/null +++ b/external/Box2d/Testbed/Tests/Cantilever.h @@ -0,0 +1,203 @@ +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef CANTILEVER_H +#define CANTILEVER_H + +class Cantilever : public Test +{ +public: + + enum + { + e_count = 8 + }; + + Cantilever() + { + b2Body* ground = NULL; + { + b2BodyDef bd; + ground = m_world->CreateBody(&bd); + + b2EdgeShape shape; + shape.Set(b2Vec2(-40.0f, 0.0f), b2Vec2(40.0f, 0.0f)); + ground->CreateFixture(&shape, 0.0f); + } + + { + b2PolygonShape shape; + shape.SetAsBox(0.5f, 0.125f); + + b2FixtureDef fd; + fd.shape = &shape; + fd.density = 20.0f; + + b2WeldJointDef jd; + + b2Body* prevBody = ground; + for (int32 i = 0; i < e_count; ++i) + { + b2BodyDef bd; + bd.type = b2_dynamicBody; + bd.position.Set(-14.5f + 1.0f * i, 5.0f); + b2Body* body = m_world->CreateBody(&bd); + body->CreateFixture(&fd); + + b2Vec2 anchor(-15.0f + 1.0f * i, 5.0f); + jd.Initialize(prevBody, body, anchor); + m_world->CreateJoint(&jd); + + prevBody = body; + } + } + + { + b2PolygonShape shape; + shape.SetAsBox(0.5f, 0.125f); + + b2FixtureDef fd; + fd.shape = &shape; + fd.density = 20.0f; + + b2WeldJointDef jd; + + b2Body* prevBody = ground; + for (int32 i = 0; i < e_count; ++i) + { + b2BodyDef bd; + bd.type = b2_dynamicBody; + bd.position.Set(-14.5f + 1.0f * i, 15.0f); + b2Body* body = m_world->CreateBody(&bd); + body->CreateFixture(&fd); + + b2Vec2 anchor(-15.0f + 1.0f * i, 15.0f); + jd.Initialize(prevBody, body, anchor); + m_world->CreateJoint(&jd); + + prevBody = body; + } + } + + { + b2PolygonShape shape; + shape.SetAsBox(0.5f, 0.125f); + + b2FixtureDef fd; + fd.shape = &shape; + fd.density = 20.0f; + + b2WeldJointDef jd; + + b2Body* prevBody = ground; + for (int32 i = 0; i < e_count; ++i) + { + b2BodyDef bd; + bd.type = b2_dynamicBody; + bd.position.Set(-4.5f + 1.0f * i, 5.0f); + b2Body* body = m_world->CreateBody(&bd); + body->CreateFixture(&fd); + + if (i > 0) + { + b2Vec2 anchor(-5.0f + 1.0f * i, 5.0f); + jd.Initialize(prevBody, body, anchor); + m_world->CreateJoint(&jd); + } + + prevBody = body; + } + } + + { + b2PolygonShape shape; + shape.SetAsBox(0.5f, 0.125f); + + b2FixtureDef fd; + fd.shape = &shape; + fd.density = 20.0f; + + b2WeldJointDef jd; + + b2Body* prevBody = ground; + for (int32 i = 0; i < e_count; ++i) + { + b2BodyDef bd; + bd.type = b2_dynamicBody; + bd.position.Set(5.5f + 1.0f * i, 10.0f); + b2Body* body = m_world->CreateBody(&bd); + body->CreateFixture(&fd); + + if (i > 0) + { + b2Vec2 anchor(5.0f + 1.0f * i, 10.0f); + jd.Initialize(prevBody, body, anchor); + m_world->CreateJoint(&jd); + } + + prevBody = body; + } + } + + for (int32 i = 0; i < 2; ++i) + { + b2Vec2 vertices[3]; + vertices[0].Set(-0.5f, 0.0f); + vertices[1].Set(0.5f, 0.0f); + vertices[2].Set(0.0f, 1.5f); + + b2PolygonShape shape; + shape.Set(vertices, 3); + + b2FixtureDef fd; + fd.shape = &shape; + fd.density = 1.0f; + + b2BodyDef bd; + bd.type = b2_dynamicBody; + bd.position.Set(-8.0f + 8.0f * i, 12.0f); + b2Body* body = m_world->CreateBody(&bd); + body->CreateFixture(&fd); + } + + for (int32 i = 0; i < 2; ++i) + { + b2CircleShape shape; + shape.m_radius = 0.5f; + + b2FixtureDef fd; + fd.shape = &shape; + fd.density = 1.0f; + + b2BodyDef bd; + bd.type = b2_dynamicBody; + bd.position.Set(-6.0f + 6.0f * i, 10.0f); + b2Body* body = m_world->CreateBody(&bd); + body->CreateFixture(&fd); + } + } + + static Test* Create() + { + return new Cantilever; + } + + b2Body* m_middle; +}; + +#endif diff --git a/external/Box2d/Testbed/Tests/Car.h b/external/Box2d/Testbed/Tests/Car.h new file mode 100755 index 0000000..53cdc53 --- /dev/null +++ b/external/Box2d/Testbed/Tests/Car.h @@ -0,0 +1,286 @@ +/* +* Copyright (c) 2006-2011 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef CAR_H +#define CAR_H + +// This is a fun demo that shows off the wheel joint +class Car : public Test +{ +public: + Car() + { + m_hz = 4.0f; + m_zeta = 0.7f; + m_speed = 50.0f; + + b2Body* ground = NULL; + { + b2BodyDef bd; + ground = m_world->CreateBody(&bd); + + b2EdgeShape shape; + + b2FixtureDef fd; + fd.shape = &shape; + fd.density = 0.0f; + fd.friction = 0.6f; + + shape.Set(b2Vec2(-20.0f, 0.0f), b2Vec2(20.0f, 0.0f)); + ground->CreateFixture(&fd); + + float32 hs[10] = {0.25f, 1.0f, 4.0f, 0.0f, 0.0f, -1.0f, -2.0f, -2.0f, -1.25f, 0.0f}; + + float32 x = 20.0f, y1 = 0.0f, dx = 5.0f; + + for (int32 i = 0; i < 10; ++i) + { + float32 y2 = hs[i]; + shape.Set(b2Vec2(x, y1), b2Vec2(x + dx, y2)); + ground->CreateFixture(&fd); + y1 = y2; + x += dx; + } + + for (int32 i = 0; i < 10; ++i) + { + float32 y2 = hs[i]; + shape.Set(b2Vec2(x, y1), b2Vec2(x + dx, y2)); + ground->CreateFixture(&fd); + y1 = y2; + x += dx; + } + + shape.Set(b2Vec2(x, 0.0f), b2Vec2(x + 40.0f, 0.0f)); + ground->CreateFixture(&fd); + + x += 80.0f; + shape.Set(b2Vec2(x, 0.0f), b2Vec2(x + 40.0f, 0.0f)); + ground->CreateFixture(&fd); + + x += 40.0f; + shape.Set(b2Vec2(x, 0.0f), b2Vec2(x + 10.0f, 5.0f)); + ground->CreateFixture(&fd); + + x += 20.0f; + shape.Set(b2Vec2(x, 0.0f), b2Vec2(x + 40.0f, 0.0f)); + ground->CreateFixture(&fd); + + x += 40.0f; + shape.Set(b2Vec2(x, 0.0f), b2Vec2(x, 20.0f)); + ground->CreateFixture(&fd); + } + + // Teeter + { + b2BodyDef bd; + bd.position.Set(140.0f, 1.0f); + bd.type = b2_dynamicBody; + b2Body* body = m_world->CreateBody(&bd); + + b2PolygonShape box; + box.SetAsBox(10.0f, 0.25f); + body->CreateFixture(&box, 1.0f); + + b2RevoluteJointDef jd; + jd.Initialize(ground, body, body->GetPosition()); + jd.lowerAngle = -8.0f * b2_pi / 180.0f; + jd.upperAngle = 8.0f * b2_pi / 180.0f; + jd.enableLimit = true; + m_world->CreateJoint(&jd); + + body->ApplyAngularImpulse(100.0f); + } + + // Bridge + { + int32 N = 20; + b2PolygonShape shape; + shape.SetAsBox(1.0f, 0.125f); + + b2FixtureDef fd; + fd.shape = &shape; + fd.density = 1.0f; + fd.friction = 0.6f; + + b2RevoluteJointDef jd; + + b2Body* prevBody = ground; + for (int32 i = 0; i < N; ++i) + { + b2BodyDef bd; + bd.type = b2_dynamicBody; + bd.position.Set(161.0f + 2.0f * i, -0.125f); + b2Body* body = m_world->CreateBody(&bd); + body->CreateFixture(&fd); + + b2Vec2 anchor(160.0f + 2.0f * i, -0.125f); + jd.Initialize(prevBody, body, anchor); + m_world->CreateJoint(&jd); + + prevBody = body; + } + + b2Vec2 anchor(160.0f + 2.0f * N, -0.125f); + jd.Initialize(prevBody, ground, anchor); + m_world->CreateJoint(&jd); + } + + // Boxes + { + b2PolygonShape box; + box.SetAsBox(0.5f, 0.5f); + + b2Body* body = NULL; + b2BodyDef bd; + bd.type = b2_dynamicBody; + + bd.position.Set(230.0f, 0.5f); + body = m_world->CreateBody(&bd); + body->CreateFixture(&box, 0.5f); + + bd.position.Set(230.0f, 1.5f); + body = m_world->CreateBody(&bd); + body->CreateFixture(&box, 0.5f); + + bd.position.Set(230.0f, 2.5f); + body = m_world->CreateBody(&bd); + body->CreateFixture(&box, 0.5f); + + bd.position.Set(230.0f, 3.5f); + body = m_world->CreateBody(&bd); + body->CreateFixture(&box, 0.5f); + + bd.position.Set(230.0f, 4.5f); + body = m_world->CreateBody(&bd); + body->CreateFixture(&box, 0.5f); + } + + // Car + { + b2PolygonShape chassis; + b2Vec2 vertices[8]; + vertices[0].Set(-1.5f, -0.5f); + vertices[1].Set(1.5f, -0.5f); + vertices[2].Set(1.5f, 0.0f); + vertices[3].Set(0.0f, 0.9f); + vertices[4].Set(-1.15f, 0.9f); + vertices[5].Set(-1.5f, 0.2f); + chassis.Set(vertices, 6); + + b2CircleShape circle; + circle.m_radius = 0.4f; + + b2BodyDef bd; + bd.type = b2_dynamicBody; + bd.position.Set(0.0f, 1.0f); + m_car = m_world->CreateBody(&bd); + m_car->CreateFixture(&chassis, 1.0f); + + b2FixtureDef fd; + fd.shape = &circle; + fd.density = 1.0f; + fd.friction = 0.9f; + + bd.position.Set(-1.0f, 0.35f); + m_wheel1 = m_world->CreateBody(&bd); + m_wheel1->CreateFixture(&fd); + + bd.position.Set(1.0f, 0.4f); + m_wheel2 = m_world->CreateBody(&bd); + m_wheel2->CreateFixture(&fd); + + b2WheelJointDef jd; + b2Vec2 axis(0.0f, 1.0f); + + jd.Initialize(m_car, m_wheel1, m_wheel1->GetPosition(), axis); + jd.motorSpeed = 0.0f; + jd.maxMotorTorque = 20.0f; + jd.enableMotor = true; + jd.frequencyHz = m_hz; + jd.dampingRatio = m_zeta; + m_spring1 = (b2WheelJoint*)m_world->CreateJoint(&jd); + + jd.Initialize(m_car, m_wheel2, m_wheel2->GetPosition(), axis); + jd.motorSpeed = 0.0f; + jd.maxMotorTorque = 10.0f; + jd.enableMotor = false; + jd.frequencyHz = m_hz; + jd.dampingRatio = m_zeta; + m_spring2 = (b2WheelJoint*)m_world->CreateJoint(&jd); + } + } + + void Keyboard(unsigned char key) + { + switch (key) + { + case 'a': + m_spring1->SetMotorSpeed(m_speed); + break; + + case 's': + m_spring1->SetMotorSpeed(0.0f); + break; + + case 'd': + m_spring1->SetMotorSpeed(-m_speed); + break; + + case 'q': + m_hz = b2Max(0.0f, m_hz - 1.0f); + m_spring1->SetSpringFrequencyHz(m_hz); + m_spring2->SetSpringFrequencyHz(m_hz); + break; + + case 'e': + m_hz += 1.0f; + m_spring1->SetSpringFrequencyHz(m_hz); + m_spring2->SetSpringFrequencyHz(m_hz); + break; + } + } + + void Step(Settings* settings) + { + m_debugDraw.DrawString(5, m_textLine, "Keys: left = a, brake = s, right = d, hz down = q, hz up = e"); + m_textLine += 15; + m_debugDraw.DrawString(5, m_textLine, "frequency = %g hz, damping ratio = %g", m_hz, m_zeta); + m_textLine += 15; + + settings->viewCenter.x = m_car->GetPosition().x; + Test::Step(settings); + } + + static Test* Create() + { + return new Car; + } + + b2Body* m_car; + b2Body* m_wheel1; + b2Body* m_wheel2; + + float32 m_hz; + float32 m_zeta; + float32 m_speed; + b2WheelJoint* m_spring1; + b2WheelJoint* m_spring2; +}; + +#endif diff --git a/external/Box2d/Testbed/Tests/Chain.h b/external/Box2d/Testbed/Tests/Chain.h new file mode 100755 index 0000000..33b8de9 --- /dev/null +++ b/external/Box2d/Testbed/Tests/Chain.h @@ -0,0 +1,74 @@ +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef CHAIN_H +#define CHAIN_H + +class Chain : public Test +{ +public: + Chain() + { + b2Body* ground = NULL; + { + b2BodyDef bd; + ground = m_world->CreateBody(&bd); + + b2EdgeShape shape; + shape.Set(b2Vec2(-40.0f, 0.0f), b2Vec2(40.0f, 0.0f)); + ground->CreateFixture(&shape, 0.0f); + } + + { + b2PolygonShape shape; + shape.SetAsBox(0.6f, 0.125f); + + b2FixtureDef fd; + fd.shape = &shape; + fd.density = 20.0f; + fd.friction = 0.2f; + + b2RevoluteJointDef jd; + jd.collideConnected = false; + + const float32 y = 25.0f; + b2Body* prevBody = ground; + for (int32 i = 0; i < 30; ++i) + { + b2BodyDef bd; + bd.type = b2_dynamicBody; + bd.position.Set(0.5f + i, y); + b2Body* body = m_world->CreateBody(&bd); + body->CreateFixture(&fd); + + b2Vec2 anchor(float32(i), y); + jd.Initialize(prevBody, body, anchor); + m_world->CreateJoint(&jd); + + prevBody = body; + } + } + } + + static Test* Create() + { + return new Chain; + } +}; + +#endif diff --git a/external/Box2d/Testbed/Tests/CharacterCollision.h b/external/Box2d/Testbed/Tests/CharacterCollision.h new file mode 100755 index 0000000..0af11df --- /dev/null +++ b/external/Box2d/Testbed/Tests/CharacterCollision.h @@ -0,0 +1,228 @@ +/* +* Copyright (c) 2006-2010 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef CHARACTER_COLLISION_H +#define CHARACTER_COLLISION_H + +/// This is a test of typical character collision scenarios. This does not +/// show how you should implement a character in your application. +/// Instead this is used to test smooth collision on edge chains. +class CharacterCollision : public Test +{ +public: + CharacterCollision() + { + // Ground body + { + b2BodyDef bd; + b2Body* ground = m_world->CreateBody(&bd); + + b2EdgeShape shape; + shape.Set(b2Vec2(-20.0f, 0.0f), b2Vec2(20.0f, 0.0f)); + ground->CreateFixture(&shape, 0.0f); + } + + // Collinear edges with no adjacency information. + // This shows the problematic case where a box shape can hit + // an internal vertex. + { + b2BodyDef bd; + b2Body* ground = m_world->CreateBody(&bd); + + b2EdgeShape shape; + shape.Set(b2Vec2(-8.0f, 1.0f), b2Vec2(-6.0f, 1.0f)); + ground->CreateFixture(&shape, 0.0f); + shape.Set(b2Vec2(-6.0f, 1.0f), b2Vec2(-4.0f, 1.0f)); + ground->CreateFixture(&shape, 0.0f); + shape.Set(b2Vec2(-4.0f, 1.0f), b2Vec2(-2.0f, 1.0f)); + ground->CreateFixture(&shape, 0.0f); + } + + // Chain shape + { + b2BodyDef bd; + bd.angle = 0.25f * b2_pi; + b2Body* ground = m_world->CreateBody(&bd); + + b2Vec2 vs[4]; + vs[0].Set(5.0f, 7.0f); + vs[1].Set(6.0f, 8.0f); + vs[2].Set(7.0f, 8.0f); + vs[3].Set(8.0f, 7.0f); + b2ChainShape shape; + shape.CreateChain(vs, 4); + ground->CreateFixture(&shape, 0.0f); + } + + // Square tiles. This shows that adjacency shapes may + // have non-smooth collision. There is no solution + // to this problem. + { + b2BodyDef bd; + b2Body* ground = m_world->CreateBody(&bd); + + b2PolygonShape shape; + shape.SetAsBox(1.0f, 1.0f, b2Vec2(4.0f, 3.0f), 0.0f); + ground->CreateFixture(&shape, 0.0f); + shape.SetAsBox(1.0f, 1.0f, b2Vec2(6.0f, 3.0f), 0.0f); + ground->CreateFixture(&shape, 0.0f); + shape.SetAsBox(1.0f, 1.0f, b2Vec2(8.0f, 3.0f), 0.0f); + ground->CreateFixture(&shape, 0.0f); + } + + // Square made from an edge loop. Collision should be smooth. + { + b2BodyDef bd; + b2Body* ground = m_world->CreateBody(&bd); + + b2Vec2 vs[4]; + vs[0].Set(-1.0f, 3.0f); + vs[1].Set(1.0f, 3.0f); + vs[2].Set(1.0f, 5.0f); + vs[3].Set(-1.0f, 5.0f); + b2ChainShape shape; + shape.CreateLoop(vs, 4); + ground->CreateFixture(&shape, 0.0f); + } + + // Edge loop. Collision should be smooth. + { + b2BodyDef bd; + bd.position.Set(-10.0f, 4.0f); + b2Body* ground = m_world->CreateBody(&bd); + + b2Vec2 vs[10]; + vs[0].Set(0.0f, 0.0f); + vs[1].Set(6.0f, 0.0f); + vs[2].Set(6.0f, 2.0f); + vs[3].Set(4.0f, 1.0f); + vs[4].Set(2.0f, 2.0f); + vs[5].Set(0.0f, 2.0f); + vs[6].Set(-2.0f, 2.0f); + vs[7].Set(-4.0f, 3.0f); + vs[8].Set(-6.0f, 2.0f); + vs[9].Set(-6.0f, 0.0f); + b2ChainShape shape; + shape.CreateLoop(vs, 10); + ground->CreateFixture(&shape, 0.0f); + } + + // Square character 1 + { + b2BodyDef bd; + bd.position.Set(-3.0f, 8.0f); + bd.type = b2_dynamicBody; + bd.fixedRotation = true; + bd.allowSleep = false; + + b2Body* body = m_world->CreateBody(&bd); + + b2PolygonShape shape; + shape.SetAsBox(0.5f, 0.5f); + + b2FixtureDef fd; + fd.shape = &shape; + fd.density = 20.0f; + body->CreateFixture(&fd); + } + + // Square character 2 + { + b2BodyDef bd; + bd.position.Set(-5.0f, 5.0f); + bd.type = b2_dynamicBody; + bd.fixedRotation = true; + bd.allowSleep = false; + + b2Body* body = m_world->CreateBody(&bd); + + b2PolygonShape shape; + shape.SetAsBox(0.25f, 0.25f); + + b2FixtureDef fd; + fd.shape = &shape; + fd.density = 20.0f; + body->CreateFixture(&fd); + } + + // Hexagon character + { + b2BodyDef bd; + bd.position.Set(-5.0f, 8.0f); + bd.type = b2_dynamicBody; + bd.fixedRotation = true; + bd.allowSleep = false; + + b2Body* body = m_world->CreateBody(&bd); + + float32 angle = 0.0f; + float32 delta = b2_pi / 3.0f; + b2Vec2 vertices[6]; + for (int32 i = 0; i < 6; ++i) + { + vertices[i].Set(0.5f * cosf(angle), 0.5f * sinf(angle)); + angle += delta; + } + + b2PolygonShape shape; + shape.Set(vertices, 6); + + b2FixtureDef fd; + fd.shape = &shape; + fd.density = 20.0f; + body->CreateFixture(&fd); + } + + // Circle character + { + b2BodyDef bd; + bd.position.Set(3.0f, 5.0f); + bd.type = b2_dynamicBody; + bd.fixedRotation = true; + bd.allowSleep = false; + + b2Body* body = m_world->CreateBody(&bd); + + b2CircleShape shape; + shape.m_radius = 0.5f; + + b2FixtureDef fd; + fd.shape = &shape; + fd.density = 20.0f; + body->CreateFixture(&fd); + } + } + + void Step(Settings* settings) + { + Test::Step(settings); + m_debugDraw.DrawString(5, m_textLine, "This tests various character collision shapes."); + m_textLine += 15; + m_debugDraw.DrawString(5, m_textLine, "Limitation: square and hexagon can snag on aligned boxes."); + m_textLine += 15; + m_debugDraw.DrawString(5, m_textLine, "Feature: edge chains have smooth collision inside and out."); + m_textLine += 15; + } + + static Test* Create() + { + return new CharacterCollision; + } +}; + +#endif diff --git a/external/Box2d/Testbed/Tests/CollisionFiltering.h b/external/Box2d/Testbed/Tests/CollisionFiltering.h new file mode 100755 index 0000000..4c90d97 --- /dev/null +++ b/external/Box2d/Testbed/Tests/CollisionFiltering.h @@ -0,0 +1,176 @@ +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef COLLISION_FILTERING_H +#define COLLISION_FILTERING_H + +// This is a test of collision filtering. +// There is a triangle, a box, and a circle. +// There are 6 shapes. 3 large and 3 small. +// The 3 small ones always collide. +// The 3 large ones never collide. +// The boxes don't collide with triangles (except if both are small). +const int16 k_smallGroup = 1; +const int16 k_largeGroup = -1; + +const uint16 k_defaultCategory = 0x0001; +const uint16 k_triangleCategory = 0x0002; +const uint16 k_boxCategory = 0x0004; +const uint16 k_circleCategory = 0x0008; + +const uint16 k_triangleMask = 0xFFFF; +const uint16 k_boxMask = 0xFFFF ^ k_triangleCategory; +const uint16 k_circleMask = 0xFFFF; + +class CollisionFiltering : public Test +{ +public: + CollisionFiltering() + { + // Ground body + { + b2EdgeShape shape; + shape.Set(b2Vec2(-40.0f, 0.0f), b2Vec2(40.0f, 0.0f)); + + b2FixtureDef sd; + sd.shape = &shape; + sd.friction = 0.3f; + + b2BodyDef bd; + b2Body* ground = m_world->CreateBody(&bd); + ground->CreateFixture(&sd); + } + + // Small triangle + b2Vec2 vertices[3]; + vertices[0].Set(-1.0f, 0.0f); + vertices[1].Set(1.0f, 0.0f); + vertices[2].Set(0.0f, 2.0f); + b2PolygonShape polygon; + polygon.Set(vertices, 3); + + b2FixtureDef triangleShapeDef; + triangleShapeDef.shape = &polygon; + triangleShapeDef.density = 1.0f; + + triangleShapeDef.filter.groupIndex = k_smallGroup; + triangleShapeDef.filter.categoryBits = k_triangleCategory; + triangleShapeDef.filter.maskBits = k_triangleMask; + + b2BodyDef triangleBodyDef; + triangleBodyDef.type = b2_dynamicBody; + triangleBodyDef.position.Set(-5.0f, 2.0f); + + b2Body* body1 = m_world->CreateBody(&triangleBodyDef); + body1->CreateFixture(&triangleShapeDef); + + // Large triangle (recycle definitions) + vertices[0] *= 2.0f; + vertices[1] *= 2.0f; + vertices[2] *= 2.0f; + polygon.Set(vertices, 3); + triangleShapeDef.filter.groupIndex = k_largeGroup; + triangleBodyDef.position.Set(-5.0f, 6.0f); + triangleBodyDef.fixedRotation = true; // look at me! + + b2Body* body2 = m_world->CreateBody(&triangleBodyDef); + body2->CreateFixture(&triangleShapeDef); + + { + b2BodyDef bd; + bd.type = b2_dynamicBody; + bd.position.Set(-5.0f, 10.0f); + b2Body* body = m_world->CreateBody(&bd); + + b2PolygonShape p; + p.SetAsBox(0.5f, 1.0f); + body->CreateFixture(&p, 1.0f); + + b2PrismaticJointDef jd; + jd.bodyA = body2; + jd.bodyB = body; + jd.enableLimit = true; + jd.localAnchorA.Set(0.0f, 4.0f); + jd.localAnchorB.SetZero(); + jd.localAxisA.Set(0.0f, 1.0f); + jd.lowerTranslation = -1.0f; + jd.upperTranslation = 1.0f; + + m_world->CreateJoint(&jd); + } + + // Small box + polygon.SetAsBox(1.0f, 0.5f); + b2FixtureDef boxShapeDef; + boxShapeDef.shape = &polygon; + boxShapeDef.density = 1.0f; + boxShapeDef.restitution = 0.1f; + + boxShapeDef.filter.groupIndex = k_smallGroup; + boxShapeDef.filter.categoryBits = k_boxCategory; + boxShapeDef.filter.maskBits = k_boxMask; + + b2BodyDef boxBodyDef; + boxBodyDef.type = b2_dynamicBody; + boxBodyDef.position.Set(0.0f, 2.0f); + + b2Body* body3 = m_world->CreateBody(&boxBodyDef); + body3->CreateFixture(&boxShapeDef); + + // Large box (recycle definitions) + polygon.SetAsBox(2.0f, 1.0f); + boxShapeDef.filter.groupIndex = k_largeGroup; + boxBodyDef.position.Set(0.0f, 6.0f); + + b2Body* body4 = m_world->CreateBody(&boxBodyDef); + body4->CreateFixture(&boxShapeDef); + + // Small circle + b2CircleShape circle; + circle.m_radius = 1.0f; + + b2FixtureDef circleShapeDef; + circleShapeDef.shape = &circle; + circleShapeDef.density = 1.0f; + + circleShapeDef.filter.groupIndex = k_smallGroup; + circleShapeDef.filter.categoryBits = k_circleCategory; + circleShapeDef.filter.maskBits = k_circleMask; + + b2BodyDef circleBodyDef; + circleBodyDef.type = b2_dynamicBody; + circleBodyDef.position.Set(5.0f, 2.0f); + + b2Body* body5 = m_world->CreateBody(&circleBodyDef); + body5->CreateFixture(&circleShapeDef); + + // Large circle + circle.m_radius *= 2.0f; + circleShapeDef.filter.groupIndex = k_largeGroup; + circleBodyDef.position.Set(5.0f, 6.0f); + + b2Body* body6 = m_world->CreateBody(&circleBodyDef); + body6->CreateFixture(&circleShapeDef); + } + static Test* Create() + { + return new CollisionFiltering; + } +}; + +#endif diff --git a/external/Box2d/Testbed/Tests/CollisionProcessing.h b/external/Box2d/Testbed/Tests/CollisionProcessing.h new file mode 100755 index 0000000..02215e1 --- /dev/null +++ b/external/Box2d/Testbed/Tests/CollisionProcessing.h @@ -0,0 +1,188 @@ +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef COLLISION_PROCESSING_H +#define COLLISION_PROCESSING_H + +#include + +// This test shows collision processing and tests +// deferred body destruction. +class CollisionProcessing : public Test +{ +public: + CollisionProcessing() + { + // Ground body + { + b2EdgeShape shape; + shape.Set(b2Vec2(-50.0f, 0.0f), b2Vec2(50.0f, 0.0f)); + + b2FixtureDef sd; + sd.shape = &shape;; + + b2BodyDef bd; + b2Body* ground = m_world->CreateBody(&bd); + ground->CreateFixture(&sd); + } + + float32 xLo = -5.0f, xHi = 5.0f; + float32 yLo = 2.0f, yHi = 35.0f; + + // Small triangle + b2Vec2 vertices[3]; + vertices[0].Set(-1.0f, 0.0f); + vertices[1].Set(1.0f, 0.0f); + vertices[2].Set(0.0f, 2.0f); + + b2PolygonShape polygon; + polygon.Set(vertices, 3); + + b2FixtureDef triangleShapeDef; + triangleShapeDef.shape = &polygon; + triangleShapeDef.density = 1.0f; + + b2BodyDef triangleBodyDef; + triangleBodyDef.type = b2_dynamicBody; + triangleBodyDef.position.Set(RandomFloat(xLo, xHi), RandomFloat(yLo, yHi)); + + b2Body* body1 = m_world->CreateBody(&triangleBodyDef); + body1->CreateFixture(&triangleShapeDef); + + // Large triangle (recycle definitions) + vertices[0] *= 2.0f; + vertices[1] *= 2.0f; + vertices[2] *= 2.0f; + polygon.Set(vertices, 3); + + triangleBodyDef.position.Set(RandomFloat(xLo, xHi), RandomFloat(yLo, yHi)); + + b2Body* body2 = m_world->CreateBody(&triangleBodyDef); + body2->CreateFixture(&triangleShapeDef); + + // Small box + polygon.SetAsBox(1.0f, 0.5f); + + b2FixtureDef boxShapeDef; + boxShapeDef.shape = &polygon; + boxShapeDef.density = 1.0f; + + b2BodyDef boxBodyDef; + boxBodyDef.type = b2_dynamicBody; + boxBodyDef.position.Set(RandomFloat(xLo, xHi), RandomFloat(yLo, yHi)); + + b2Body* body3 = m_world->CreateBody(&boxBodyDef); + body3->CreateFixture(&boxShapeDef); + + // Large box (recycle definitions) + polygon.SetAsBox(2.0f, 1.0f); + boxBodyDef.position.Set(RandomFloat(xLo, xHi), RandomFloat(yLo, yHi)); + + b2Body* body4 = m_world->CreateBody(&boxBodyDef); + body4->CreateFixture(&boxShapeDef); + + // Small circle + b2CircleShape circle; + circle.m_radius = 1.0f; + + b2FixtureDef circleShapeDef; + circleShapeDef.shape = &circle; + circleShapeDef.density = 1.0f; + + b2BodyDef circleBodyDef; + circleBodyDef.type = b2_dynamicBody; + circleBodyDef.position.Set(RandomFloat(xLo, xHi), RandomFloat(yLo, yHi)); + + b2Body* body5 = m_world->CreateBody(&circleBodyDef); + body5->CreateFixture(&circleShapeDef); + + // Large circle + circle.m_radius *= 2.0f; + circleBodyDef.position.Set(RandomFloat(xLo, xHi), RandomFloat(yLo, yHi)); + + b2Body* body6 = m_world->CreateBody(&circleBodyDef); + body6->CreateFixture(&circleShapeDef); + } + + void Step(Settings* settings) + { + Test::Step(settings); + + // We are going to destroy some bodies according to contact + // points. We must buffer the bodies that should be destroyed + // because they may belong to multiple contact points. + const int32 k_maxNuke = 6; + b2Body* nuke[k_maxNuke]; + int32 nukeCount = 0; + + // Traverse the contact results. Destroy bodies that + // are touching heavier bodies. + for (int32 i = 0; i < m_pointCount; ++i) + { + ContactPoint* point = m_points + i; + + b2Body* body1 = point->fixtureA->GetBody(); + b2Body* body2 = point->fixtureB->GetBody(); + float32 mass1 = body1->GetMass(); + float32 mass2 = body2->GetMass(); + + if (mass1 > 0.0f && mass2 > 0.0f) + { + if (mass2 > mass1) + { + nuke[nukeCount++] = body1; + } + else + { + nuke[nukeCount++] = body2; + } + + if (nukeCount == k_maxNuke) + { + break; + } + } + } + + // Sort the nuke array to group duplicates. + std::sort(nuke, nuke + nukeCount); + + // Destroy the bodies, skipping duplicates. + int32 i = 0; + while (i < nukeCount) + { + b2Body* b = nuke[i++]; + while (i < nukeCount && nuke[i] == b) + { + ++i; + } + + if (b != m_bomb) + { + m_world->DestroyBody(b); + } + } + } + + static Test* Create() + { + return new CollisionProcessing; + } +}; + +#endif diff --git a/external/Box2d/Testbed/Tests/CompoundShapes.h b/external/Box2d/Testbed/Tests/CompoundShapes.h new file mode 100755 index 0000000..bc14e88 --- /dev/null +++ b/external/Box2d/Testbed/Tests/CompoundShapes.h @@ -0,0 +1,143 @@ +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef COMPOUND_SHAPES_H +#define COMPOUND_SHAPES_H + +// TODO_ERIN test joints on compounds. +class CompoundShapes : public Test +{ +public: + CompoundShapes() + { + { + b2BodyDef bd; + bd.position.Set(0.0f, 0.0f); + b2Body* body = m_world->CreateBody(&bd); + + b2EdgeShape shape; + shape.Set(b2Vec2(50.0f, 0.0f), b2Vec2(-50.0f, 0.0f)); + + body->CreateFixture(&shape, 0.0f); + } + + { + b2CircleShape circle1; + circle1.m_radius = 0.5f; + circle1.m_p.Set(-0.5f, 0.5f); + + b2CircleShape circle2; + circle2.m_radius = 0.5f; + circle2.m_p.Set(0.5f, 0.5f); + + for (int i = 0; i < 10; ++i) + { + float32 x = RandomFloat(-0.1f, 0.1f); + b2BodyDef bd; + bd.type = b2_dynamicBody; + bd.position.Set(x + 5.0f, 1.05f + 2.5f * i); + bd.angle = RandomFloat(-b2_pi, b2_pi); + b2Body* body = m_world->CreateBody(&bd); + body->CreateFixture(&circle1, 2.0f); + body->CreateFixture(&circle2, 0.0f); + } + } + + { + b2PolygonShape polygon1; + polygon1.SetAsBox(0.25f, 0.5f); + + b2PolygonShape polygon2; + polygon2.SetAsBox(0.25f, 0.5f, b2Vec2(0.0f, -0.5f), 0.5f * b2_pi); + + for (int i = 0; i < 10; ++i) + { + float32 x = RandomFloat(-0.1f, 0.1f); + b2BodyDef bd; + bd.type = b2_dynamicBody; + bd.position.Set(x - 5.0f, 1.05f + 2.5f * i); + bd.angle = RandomFloat(-b2_pi, b2_pi); + b2Body* body = m_world->CreateBody(&bd); + body->CreateFixture(&polygon1, 2.0f); + body->CreateFixture(&polygon2, 2.0f); + } + } + + { + b2Transform xf1; + xf1.q.Set(0.3524f * b2_pi); + xf1.p = xf1.q.GetXAxis(); + + b2Vec2 vertices[3]; + + b2PolygonShape triangle1; + vertices[0] = b2Mul(xf1, b2Vec2(-1.0f, 0.0f)); + vertices[1] = b2Mul(xf1, b2Vec2(1.0f, 0.0f)); + vertices[2] = b2Mul(xf1, b2Vec2(0.0f, 0.5f)); + triangle1.Set(vertices, 3); + + b2Transform xf2; + xf2.q.Set(-0.3524f * b2_pi); + xf2.p = -xf2.q.GetXAxis(); + + b2PolygonShape triangle2; + vertices[0] = b2Mul(xf2, b2Vec2(-1.0f, 0.0f)); + vertices[1] = b2Mul(xf2, b2Vec2(1.0f, 0.0f)); + vertices[2] = b2Mul(xf2, b2Vec2(0.0f, 0.5f)); + triangle2.Set(vertices, 3); + + for (int32 i = 0; i < 10; ++i) + { + float32 x = RandomFloat(-0.1f, 0.1f); + b2BodyDef bd; + bd.type = b2_dynamicBody; + bd.position.Set(x, 2.05f + 2.5f * i); + bd.angle = 0.0f; + b2Body* body = m_world->CreateBody(&bd); + body->CreateFixture(&triangle1, 2.0f); + body->CreateFixture(&triangle2, 2.0f); + } + } + + { + b2PolygonShape bottom; + bottom.SetAsBox( 1.5f, 0.15f ); + + b2PolygonShape left; + left.SetAsBox(0.15f, 2.7f, b2Vec2(-1.45f, 2.35f), 0.2f); + + b2PolygonShape right; + right.SetAsBox(0.15f, 2.7f, b2Vec2(1.45f, 2.35f), -0.2f); + + b2BodyDef bd; + bd.type = b2_dynamicBody; + bd.position.Set( 0.0f, 2.0f ); + b2Body* body = m_world->CreateBody(&bd); + body->CreateFixture(&bottom, 4.0f); + body->CreateFixture(&left, 4.0f); + body->CreateFixture(&right, 4.0f); + } + } + + static Test* Create() + { + return new CompoundShapes; + } +}; + +#endif diff --git a/external/Box2d/Testbed/Tests/Confined.h b/external/Box2d/Testbed/Tests/Confined.h new file mode 100755 index 0000000..f2d205e --- /dev/null +++ b/external/Box2d/Testbed/Tests/Confined.h @@ -0,0 +1,167 @@ +/* +* Copyright (c) 2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef CONFINED_H +#define CONFINED_H + +class Confined : public Test +{ +public: + + enum + { + e_columnCount = 0, + e_rowCount = 0 + }; + + Confined() + { + { + b2BodyDef bd; + b2Body* ground = m_world->CreateBody(&bd); + + b2EdgeShape shape; + + // Floor + shape.Set(b2Vec2(-10.0f, 0.0f), b2Vec2(10.0f, 0.0f)); + ground->CreateFixture(&shape, 0.0f); + + // Left wall + shape.Set(b2Vec2(-10.0f, 0.0f), b2Vec2(-10.0f, 20.0f)); + ground->CreateFixture(&shape, 0.0f); + + // Right wall + shape.Set(b2Vec2(10.0f, 0.0f), b2Vec2(10.0f, 20.0f)); + ground->CreateFixture(&shape, 0.0f); + + // Roof + shape.Set(b2Vec2(-10.0f, 20.0f), b2Vec2(10.0f, 20.0f)); + ground->CreateFixture(&shape, 0.0f); + } + + float32 radius = 0.5f; + b2CircleShape shape; + shape.m_p.SetZero(); + shape.m_radius = radius; + + b2FixtureDef fd; + fd.shape = &shape; + fd.density = 1.0f; + fd.friction = 0.1f; + + for (int32 j = 0; j < e_columnCount; ++j) + { + for (int i = 0; i < e_rowCount; ++i) + { + b2BodyDef bd; + bd.type = b2_dynamicBody; + bd.position.Set(-10.0f + (2.1f * j + 1.0f + 0.01f * i) * radius, (2.0f * i + 1.0f) * radius); + b2Body* body = m_world->CreateBody(&bd); + + body->CreateFixture(&fd); + } + } + + m_world->SetGravity(b2Vec2(0.0f, 0.0f)); + } + + void CreateCircle() + { + float32 radius = 2.0f; + b2CircleShape shape; + shape.m_p.SetZero(); + shape.m_radius = radius; + + b2FixtureDef fd; + fd.shape = &shape; + fd.density = 1.0f; + fd.friction = 0.0f; + + b2Vec2 p(RandomFloat(), 3.0f + RandomFloat()); + b2BodyDef bd; + bd.type = b2_dynamicBody; + bd.position = p; + //bd.allowSleep = false; + b2Body* body = m_world->CreateBody(&bd); + + body->CreateFixture(&fd); + } + + void Keyboard(unsigned char key) + { + switch (key) + { + case 'c': + CreateCircle(); + break; + } + } + + void Step(Settings* settings) + { + bool sleeping = true; + for (b2Body* b = m_world->GetBodyList(); b; b = b->GetNext()) + { + if (b->GetType() != b2_dynamicBody) + { + continue; + } + + if (b->IsAwake()) + { + sleeping = false; + } + } + + if (m_stepCount == 180) + { + m_stepCount += 0; + } + + //if (sleeping) + //{ + // CreateCircle(); + //} + + Test::Step(settings); + + for (b2Body* b = m_world->GetBodyList(); b; b = b->GetNext()) + { + if (b->GetType() != b2_dynamicBody) + { + continue; + } + + b2Vec2 p = b->GetPosition(); + if (p.x <= -10.0f || 10.0f <= p.x || p.y <= 0.0f || 20.0f <= p.y) + { + p.x += 0.0; + } + } + + m_debugDraw.DrawString(5, m_textLine, "Press 'c' to create a circle."); + m_textLine += 15; + } + + static Test* Create() + { + return new Confined; + } +}; + +#endif diff --git a/external/Box2d/Testbed/Tests/ContinuousTest.h b/external/Box2d/Testbed/Tests/ContinuousTest.h new file mode 100755 index 0000000..b28d0b5 --- /dev/null +++ b/external/Box2d/Testbed/Tests/ContinuousTest.h @@ -0,0 +1,137 @@ +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef CONTINUOUS_TEST_H +#define CONTINUOUS_TEST_H + +class ContinuousTest : public Test +{ +public: + + ContinuousTest() + { + { + b2BodyDef bd; + bd.position.Set(0.0f, 0.0f); + b2Body* body = m_world->CreateBody(&bd); + + b2EdgeShape edge; + + edge.Set(b2Vec2(-10.0f, 0.0f), b2Vec2(10.0f, 0.0f)); + body->CreateFixture(&edge, 0.0f); + + b2PolygonShape shape; + shape.SetAsBox(0.2f, 1.0f, b2Vec2(0.5f, 1.0f), 0.0f); + body->CreateFixture(&shape, 0.0f); + } + +#if 1 + { + b2BodyDef bd; + bd.type = b2_dynamicBody; + bd.position.Set(0.0f, 20.0f); + //bd.angle = 0.1f; + + b2PolygonShape shape; + shape.SetAsBox(2.0f, 0.1f); + + m_body = m_world->CreateBody(&bd); + m_body->CreateFixture(&shape, 1.0f); + + m_angularVelocity = RandomFloat(-50.0f, 50.0f); + //m_angularVelocity = 46.661274f; + m_body->SetLinearVelocity(b2Vec2(0.0f, -100.0f)); + m_body->SetAngularVelocity(m_angularVelocity); + } +#else + { + b2BodyDef bd; + bd.type = b2_dynamicBody; + bd.position.Set(0.0f, 2.0f); + b2Body* body = m_world->CreateBody(&bd); + + b2CircleShape shape; + shape.m_p.SetZero(); + shape.m_radius = 0.5f; + body->CreateFixture(&shape, 1.0f); + + bd.bullet = true; + bd.position.Set(0.0f, 10.0f); + body = m_world->CreateBody(&bd); + body->CreateFixture(&shape, 1.0f); + body->SetLinearVelocity(b2Vec2(0.0f, -100.0f)); + } +#endif + } + + void Launch() + { + m_body->SetTransform(b2Vec2(0.0f, 20.0f), 0.0f); + m_angularVelocity = RandomFloat(-50.0f, 50.0f); + m_body->SetLinearVelocity(b2Vec2(0.0f, -100.0f)); + m_body->SetAngularVelocity(m_angularVelocity); + } + + void Step(Settings* settings) + { + if (m_stepCount == 12) + { + m_stepCount += 0; + } + + Test::Step(settings); + + extern int32 b2_gjkCalls, b2_gjkIters, b2_gjkMaxIters; + + if (b2_gjkCalls > 0) + { + m_debugDraw.DrawString(5, m_textLine, "gjk calls = %d, ave gjk iters = %3.1f, max gjk iters = %d", + b2_gjkCalls, b2_gjkIters / float32(b2_gjkCalls), b2_gjkMaxIters); + m_textLine += 15; + } + + extern int32 b2_toiCalls, b2_toiIters; + extern int32 b2_toiRootIters, b2_toiMaxRootIters; + + if (b2_toiCalls > 0) + { + m_debugDraw.DrawString(5, m_textLine, "toi calls = %d, ave toi iters = %3.1f, max toi iters = %d", + b2_toiCalls, b2_toiIters / float32(b2_toiCalls), b2_toiMaxRootIters); + m_textLine += 15; + + m_debugDraw.DrawString(5, m_textLine, "ave toi root iters = %3.1f, max toi root iters = %d", + b2_toiRootIters / float32(b2_toiCalls), b2_toiMaxRootIters); + m_textLine += 15; + } + + if (m_stepCount % 60 == 0) + { + //Launch(); + } + } + + static Test* Create() + { + return new ContinuousTest; + } + + b2Body* m_body; + float32 m_angularVelocity; +}; + +#endif diff --git a/external/Box2d/Testbed/Tests/DistanceTest.h b/external/Box2d/Testbed/Tests/DistanceTest.h new file mode 100755 index 0000000..81e96de --- /dev/null +++ b/external/Box2d/Testbed/Tests/DistanceTest.h @@ -0,0 +1,135 @@ +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef DISTANCE_TEST_H +#define DISTANCE_TEST_H + +class DistanceTest : public Test +{ +public: + DistanceTest() + { + { + m_transformA.SetIdentity(); + m_transformA.p.Set(0.0f, -0.2f); + m_polygonA.SetAsBox(10.0f, 0.2f); + } + + { + m_positionB.Set(12.017401f, 0.13678508f); + m_angleB = -0.0109265f; + m_transformB.Set(m_positionB, m_angleB); + + m_polygonB.SetAsBox(2.0f, 0.1f); + } + } + + static Test* Create() + { + return new DistanceTest; + } + + void Step(Settings* settings) + { + Test::Step(settings); + + b2DistanceInput input; + input.proxyA.Set(&m_polygonA, 0); + input.proxyB.Set(&m_polygonB, 0); + input.transformA = m_transformA; + input.transformB = m_transformB; + input.useRadii = true; + b2SimplexCache cache; + cache.count = 0; + b2DistanceOutput output; + b2Distance(&output, &cache, &input); + + m_debugDraw.DrawString(5, m_textLine, "distance = %g", output.distance); + m_textLine += 15; + + m_debugDraw.DrawString(5, m_textLine, "iterations = %d", output.iterations); + m_textLine += 15; + + { + b2Color color(0.9f, 0.9f, 0.9f); + b2Vec2 v[b2_maxPolygonVertices]; + for (int32 i = 0; i < m_polygonA.m_vertexCount; ++i) + { + v[i] = b2Mul(m_transformA, m_polygonA.m_vertices[i]); + } + m_debugDraw.DrawPolygon(v, m_polygonA.m_vertexCount, color); + + for (int32 i = 0; i < m_polygonB.m_vertexCount; ++i) + { + v[i] = b2Mul(m_transformB, m_polygonB.m_vertices[i]); + } + m_debugDraw.DrawPolygon(v, m_polygonB.m_vertexCount, color); + } + + b2Vec2 x1 = output.pointA; + b2Vec2 x2 = output.pointB; + + b2Color c1(1.0f, 0.0f, 0.0f); + m_debugDraw.DrawPoint(x1, 4.0f, c1); + + b2Color c2(1.0f, 1.0f, 0.0f); + m_debugDraw.DrawPoint(x2, 4.0f, c2); + } + + void Keyboard(unsigned char key) + { + switch (key) + { + case 'a': + m_positionB.x -= 0.1f; + break; + + case 'd': + m_positionB.x += 0.1f; + break; + + case 's': + m_positionB.y -= 0.1f; + break; + + case 'w': + m_positionB.y += 0.1f; + break; + + case 'q': + m_angleB += 0.1f * b2_pi; + break; + + case 'e': + m_angleB -= 0.1f * b2_pi; + break; + } + + m_transformB.Set(m_positionB, m_angleB); + } + + b2Vec2 m_positionB; + float32 m_angleB; + + b2Transform m_transformA; + b2Transform m_transformB; + b2PolygonShape m_polygonA; + b2PolygonShape m_polygonB; +}; + +#endif diff --git a/external/Box2d/Testbed/Tests/Dominos.h b/external/Box2d/Testbed/Tests/Dominos.h new file mode 100755 index 0000000..01e8bbd --- /dev/null +++ b/external/Box2d/Testbed/Tests/Dominos.h @@ -0,0 +1,215 @@ +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef DOMINOS_H +#define DOMINOS_H + +class Dominos : public Test +{ +public: + + Dominos() + { + b2Body* b1; + { + b2EdgeShape shape; + shape.Set(b2Vec2(-40.0f, 0.0f), b2Vec2(40.0f, 0.0f)); + + b2BodyDef bd; + b1 = m_world->CreateBody(&bd); + b1->CreateFixture(&shape, 0.0f); + } + + { + b2PolygonShape shape; + shape.SetAsBox(6.0f, 0.25f); + + b2BodyDef bd; + bd.position.Set(-1.5f, 10.0f); + b2Body* ground = m_world->CreateBody(&bd); + ground->CreateFixture(&shape, 0.0f); + } + + { + b2PolygonShape shape; + shape.SetAsBox(0.1f, 1.0f); + + b2FixtureDef fd; + fd.shape = &shape; + fd.density = 20.0f; + fd.friction = 0.1f; + + for (int i = 0; i < 10; ++i) + { + b2BodyDef bd; + bd.type = b2_dynamicBody; + bd.position.Set(-6.0f + 1.0f * i, 11.25f); + b2Body* body = m_world->CreateBody(&bd); + body->CreateFixture(&fd); + } + } + + { + b2PolygonShape shape; + shape.SetAsBox(7.0f, 0.25f, b2Vec2_zero, 0.3f); + + b2BodyDef bd; + bd.position.Set(1.0f, 6.0f); + b2Body* ground = m_world->CreateBody(&bd); + ground->CreateFixture(&shape, 0.0f); + } + + b2Body* b2; + { + b2PolygonShape shape; + shape.SetAsBox(0.25f, 1.5f); + + b2BodyDef bd; + bd.position.Set(-7.0f, 4.0f); + b2 = m_world->CreateBody(&bd); + b2->CreateFixture(&shape, 0.0f); + } + + b2Body* b3; + { + b2PolygonShape shape; + shape.SetAsBox(6.0f, 0.125f); + + b2BodyDef bd; + bd.type = b2_dynamicBody; + bd.position.Set(-0.9f, 1.0f); + bd.angle = -0.15f; + + b3 = m_world->CreateBody(&bd); + b3->CreateFixture(&shape, 10.0f); + } + + b2RevoluteJointDef jd; + b2Vec2 anchor; + + anchor.Set(-2.0f, 1.0f); + jd.Initialize(b1, b3, anchor); + jd.collideConnected = true; + m_world->CreateJoint(&jd); + + b2Body* b4; + { + b2PolygonShape shape; + shape.SetAsBox(0.25f, 0.25f); + + b2BodyDef bd; + bd.type = b2_dynamicBody; + bd.position.Set(-10.0f, 15.0f); + b4 = m_world->CreateBody(&bd); + b4->CreateFixture(&shape, 10.0f); + } + + anchor.Set(-7.0f, 15.0f); + jd.Initialize(b2, b4, anchor); + m_world->CreateJoint(&jd); + + b2Body* b5; + { + b2BodyDef bd; + bd.type = b2_dynamicBody; + bd.position.Set(6.5f, 3.0f); + b5 = m_world->CreateBody(&bd); + + b2PolygonShape shape; + b2FixtureDef fd; + + fd.shape = &shape; + fd.density = 10.0f; + fd.friction = 0.1f; + + shape.SetAsBox(1.0f, 0.1f, b2Vec2(0.0f, -0.9f), 0.0f); + b5->CreateFixture(&fd); + + shape.SetAsBox(0.1f, 1.0f, b2Vec2(-0.9f, 0.0f), 0.0f); + b5->CreateFixture(&fd); + + shape.SetAsBox(0.1f, 1.0f, b2Vec2(0.9f, 0.0f), 0.0f); + b5->CreateFixture(&fd); + } + + anchor.Set(6.0f, 2.0f); + jd.Initialize(b1, b5, anchor); + m_world->CreateJoint(&jd); + + b2Body* b6; + { + b2PolygonShape shape; + shape.SetAsBox(1.0f, 0.1f); + + b2BodyDef bd; + bd.type = b2_dynamicBody; + bd.position.Set(6.5f, 4.1f); + b6 = m_world->CreateBody(&bd); + b6->CreateFixture(&shape, 30.0f); + } + + anchor.Set(7.5f, 4.0f); + jd.Initialize(b5, b6, anchor); + m_world->CreateJoint(&jd); + + b2Body* b7; + { + b2PolygonShape shape; + shape.SetAsBox(0.1f, 1.0f); + + b2BodyDef bd; + bd.type = b2_dynamicBody; + bd.position.Set(7.4f, 1.0f); + + b7 = m_world->CreateBody(&bd); + b7->CreateFixture(&shape, 10.0f); + } + + b2DistanceJointDef djd; + djd.bodyA = b3; + djd.bodyB = b7; + djd.localAnchorA.Set(6.0f, 0.0f); + djd.localAnchorB.Set(0.0f, -1.0f); + b2Vec2 d = djd.bodyB->GetWorldPoint(djd.localAnchorB) - djd.bodyA->GetWorldPoint(djd.localAnchorA); + djd.length = d.Length(); + m_world->CreateJoint(&djd); + + { + float32 radius = 0.2f; + + b2CircleShape shape; + shape.m_radius = radius; + + for (int32 i = 0; i < 4; ++i) + { + b2BodyDef bd; + bd.type = b2_dynamicBody; + bd.position.Set(5.9f + 2.0f * radius * i, 2.4f); + b2Body* body = m_world->CreateBody(&bd); + body->CreateFixture(&shape, 10.0f); + } + } + } + + static Test* Create() + { + return new Dominos; + } +}; + +#endif diff --git a/external/Box2d/Testbed/Tests/DynamicTreeTest.h b/external/Box2d/Testbed/Tests/DynamicTreeTest.h new file mode 100755 index 0000000..4456a39 --- /dev/null +++ b/external/Box2d/Testbed/Tests/DynamicTreeTest.h @@ -0,0 +1,357 @@ +/* +* Copyright (c) 2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef DYNAMIC_TREE_TEST_H +#define DYNAMIC_TREE_TEST_H + +class DynamicTreeTest : public Test +{ +public: + + enum + { + e_actorCount = 128 + }; + + DynamicTreeTest() + { + m_worldExtent = 15.0f; + m_proxyExtent = 0.5f; + + srand(888); + + for (int32 i = 0; i < e_actorCount; ++i) + { + Actor* actor = m_actors + i; + GetRandomAABB(&actor->aabb); + actor->proxyId = m_tree.CreateProxy(actor->aabb, actor); + } + + m_stepCount = 0; + + float32 h = m_worldExtent; + m_queryAABB.lowerBound.Set(-3.0f, -4.0f + h); + m_queryAABB.upperBound.Set(5.0f, 6.0f + h); + + m_rayCastInput.p1.Set(-5.0, 5.0f + h); + m_rayCastInput.p2.Set(7.0f, -4.0f + h); + //m_rayCastInput.p1.Set(0.0f, 2.0f + h); + //m_rayCastInput.p2.Set(0.0f, -2.0f + h); + m_rayCastInput.maxFraction = 1.0f; + + m_automated = false; + } + + static Test* Create() + { + return new DynamicTreeTest; + } + + void Step(Settings* settings) + { + B2_NOT_USED(settings); + + m_rayActor = NULL; + for (int32 i = 0; i < e_actorCount; ++i) + { + m_actors[i].fraction = 1.0f; + m_actors[i].overlap = false; + } + + if (m_automated == true) + { + int32 actionCount = b2Max(1, e_actorCount >> 2); + + for (int32 i = 0; i < actionCount; ++i) + { + Action(); + } + } + + Query(); + RayCast(); + + for (int32 i = 0; i < e_actorCount; ++i) + { + Actor* actor = m_actors + i; + if (actor->proxyId == b2_nullNode) + continue; + + b2Color c(0.9f, 0.9f, 0.9f); + if (actor == m_rayActor && actor->overlap) + { + c.Set(0.9f, 0.6f, 0.6f); + } + else if (actor == m_rayActor) + { + c.Set(0.6f, 0.9f, 0.6f); + } + else if (actor->overlap) + { + c.Set(0.6f, 0.6f, 0.9f); + } + + m_debugDraw.DrawAABB(&actor->aabb, c); + } + + b2Color c(0.7f, 0.7f, 0.7f); + m_debugDraw.DrawAABB(&m_queryAABB, c); + + m_debugDraw.DrawSegment(m_rayCastInput.p1, m_rayCastInput.p2, c); + + b2Color c1(0.2f, 0.9f, 0.2f); + b2Color c2(0.9f, 0.2f, 0.2f); + m_debugDraw.DrawPoint(m_rayCastInput.p1, 6.0f, c1); + m_debugDraw.DrawPoint(m_rayCastInput.p2, 6.0f, c2); + + if (m_rayActor) + { + b2Color cr(0.2f, 0.2f, 0.9f); + b2Vec2 p = m_rayCastInput.p1 + m_rayActor->fraction * (m_rayCastInput.p2 - m_rayCastInput.p1); + m_debugDraw.DrawPoint(p, 6.0f, cr); + } + + { + int32 height = m_tree.GetHeight(); + m_debugDraw.DrawString(5, m_textLine, "dynamic tree height = %d", height); + m_textLine += 15; + } + + ++m_stepCount; + } + + void Keyboard(unsigned char key) + { + switch (key) + { + case 'a': + m_automated = !m_automated; + break; + + case 'c': + CreateProxy(); + break; + + case 'd': + DestroyProxy(); + break; + + case 'm': + MoveProxy(); + break; + } + } + + bool QueryCallback(int32 proxyId) + { + Actor* actor = (Actor*)m_tree.GetUserData(proxyId); + actor->overlap = b2TestOverlap(m_queryAABB, actor->aabb); + return true; + } + + float32 RayCastCallback(const b2RayCastInput& input, int32 proxyId) + { + Actor* actor = (Actor*)m_tree.GetUserData(proxyId); + + b2RayCastOutput output; + bool hit = actor->aabb.RayCast(&output, input); + + if (hit) + { + m_rayCastOutput = output; + m_rayActor = actor; + m_rayActor->fraction = output.fraction; + return output.fraction; + } + + return input.maxFraction; + } + +private: + + struct Actor + { + b2AABB aabb; + float32 fraction; + bool overlap; + int32 proxyId; + }; + + void GetRandomAABB(b2AABB* aabb) + { + b2Vec2 w; w.Set(2.0f * m_proxyExtent, 2.0f * m_proxyExtent); + //aabb->lowerBound.x = -m_proxyExtent; + //aabb->lowerBound.y = -m_proxyExtent + m_worldExtent; + aabb->lowerBound.x = RandomFloat(-m_worldExtent, m_worldExtent); + aabb->lowerBound.y = RandomFloat(0.0f, 2.0f * m_worldExtent); + aabb->upperBound = aabb->lowerBound + w; + } + + void MoveAABB(b2AABB* aabb) + { + b2Vec2 d; + d.x = RandomFloat(-0.5f, 0.5f); + d.y = RandomFloat(-0.5f, 0.5f); + //d.x = 2.0f; + //d.y = 0.0f; + aabb->lowerBound += d; + aabb->upperBound += d; + + b2Vec2 c0 = 0.5f * (aabb->lowerBound + aabb->upperBound); + b2Vec2 min; min.Set(-m_worldExtent, 0.0f); + b2Vec2 max; max.Set(m_worldExtent, 2.0f * m_worldExtent); + b2Vec2 c = b2Clamp(c0, min, max); + + aabb->lowerBound += c - c0; + aabb->upperBound += c - c0; + } + + void CreateProxy() + { + for (int32 i = 0; i < e_actorCount; ++i) + { + int32 j = rand() % e_actorCount; + Actor* actor = m_actors + j; + if (actor->proxyId == b2_nullNode) + { + GetRandomAABB(&actor->aabb); + actor->proxyId = m_tree.CreateProxy(actor->aabb, actor); + return; + } + } + } + + void DestroyProxy() + { + for (int32 i = 0; i < e_actorCount; ++i) + { + int32 j = rand() % e_actorCount; + Actor* actor = m_actors + j; + if (actor->proxyId != b2_nullNode) + { + m_tree.DestroyProxy(actor->proxyId); + actor->proxyId = b2_nullNode; + return; + } + } + } + + void MoveProxy() + { + for (int32 i = 0; i < e_actorCount; ++i) + { + int32 j = rand() % e_actorCount; + Actor* actor = m_actors + j; + if (actor->proxyId == b2_nullNode) + { + continue; + } + + b2AABB aabb0 = actor->aabb; + MoveAABB(&actor->aabb); + b2Vec2 displacement = actor->aabb.GetCenter() - aabb0.GetCenter(); + m_tree.MoveProxy(actor->proxyId, actor->aabb, displacement); + return; + } + } + + void Action() + { + int32 choice = rand() % 20; + + switch (choice) + { + case 0: + CreateProxy(); + break; + + case 1: + DestroyProxy(); + break; + + default: + MoveProxy(); + } + } + + void Query() + { + m_tree.Query(this, m_queryAABB); + + for (int32 i = 0; i < e_actorCount; ++i) + { + if (m_actors[i].proxyId == b2_nullNode) + { + continue; + } + + bool overlap = b2TestOverlap(m_queryAABB, m_actors[i].aabb); + B2_NOT_USED(overlap); + b2Assert(overlap == m_actors[i].overlap); + } + } + + void RayCast() + { + m_rayActor = NULL; + + b2RayCastInput input = m_rayCastInput; + + // Ray cast against the dynamic tree. + m_tree.RayCast(this, input); + + // Brute force ray cast. + Actor* bruteActor = NULL; + b2RayCastOutput bruteOutput; + for (int32 i = 0; i < e_actorCount; ++i) + { + if (m_actors[i].proxyId == b2_nullNode) + { + continue; + } + + b2RayCastOutput output; + bool hit = m_actors[i].aabb.RayCast(&output, input); + if (hit) + { + bruteActor = m_actors + i; + bruteOutput = output; + input.maxFraction = output.fraction; + } + } + + if (bruteActor != NULL) + { + b2Assert(bruteOutput.fraction == m_rayCastOutput.fraction); + } + } + + float32 m_worldExtent; + float32 m_proxyExtent; + + b2DynamicTree m_tree; + b2AABB m_queryAABB; + b2RayCastInput m_rayCastInput; + b2RayCastOutput m_rayCastOutput; + Actor* m_rayActor; + Actor m_actors[e_actorCount]; + int32 m_stepCount; + bool m_automated; +}; + +#endif diff --git a/external/Box2d/Testbed/Tests/EdgeShapes.h b/external/Box2d/Testbed/Tests/EdgeShapes.h new file mode 100755 index 0000000..56a6d62 --- /dev/null +++ b/external/Box2d/Testbed/Tests/EdgeShapes.h @@ -0,0 +1,249 @@ +/* +* Copyright (c) 2006-2010 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef EDGE_SHAPES_H +#define EDGE_SHAPES_H + +class EdgeShapesCallback : public b2RayCastCallback +{ +public: + EdgeShapesCallback() + { + m_fixture = NULL; + } + + float32 ReportFixture( b2Fixture* fixture, const b2Vec2& point, + const b2Vec2& normal, float32 fraction) + { + m_fixture = fixture; + m_point = point; + m_normal = normal; + + return fraction; + } + + b2Fixture* m_fixture; + b2Vec2 m_point; + b2Vec2 m_normal; +}; + +class EdgeShapes : public Test +{ +public: + + enum + { + e_maxBodies = 256 + }; + + EdgeShapes() + { + // Ground body + { + b2BodyDef bd; + b2Body* ground = m_world->CreateBody(&bd); + + float32 x1 = -20.0f; + float32 y1 = 2.0f * cosf(x1 / 10.0f * b2_pi); + for (int32 i = 0; i < 80; ++i) + { + float32 x2 = x1 + 0.5f; + float32 y2 = 2.0f * cosf(x2 / 10.0f * b2_pi); + + b2EdgeShape shape; + shape.Set(b2Vec2(x1, y1), b2Vec2(x2, y2)); + ground->CreateFixture(&shape, 0.0f); + + x1 = x2; + y1 = y2; + } + } + + { + b2Vec2 vertices[3]; + vertices[0].Set(-0.5f, 0.0f); + vertices[1].Set(0.5f, 0.0f); + vertices[2].Set(0.0f, 1.5f); + m_polygons[0].Set(vertices, 3); + } + + { + b2Vec2 vertices[3]; + vertices[0].Set(-0.1f, 0.0f); + vertices[1].Set(0.1f, 0.0f); + vertices[2].Set(0.0f, 1.5f); + m_polygons[1].Set(vertices, 3); + } + + { + float32 w = 1.0f; + float32 b = w / (2.0f + b2Sqrt(2.0f)); + float32 s = b2Sqrt(2.0f) * b; + + b2Vec2 vertices[8]; + vertices[0].Set(0.5f * s, 0.0f); + vertices[1].Set(0.5f * w, b); + vertices[2].Set(0.5f * w, b + s); + vertices[3].Set(0.5f * s, w); + vertices[4].Set(-0.5f * s, w); + vertices[5].Set(-0.5f * w, b + s); + vertices[6].Set(-0.5f * w, b); + vertices[7].Set(-0.5f * s, 0.0f); + + m_polygons[2].Set(vertices, 8); + } + + { + m_polygons[3].SetAsBox(0.5f, 0.5f); + } + + { + m_circle.m_radius = 0.5f; + } + + m_bodyIndex = 0; + memset(m_bodies, 0, sizeof(m_bodies)); + + m_angle = 0.0f; + } + + void Create(int32 index) + { + if (m_bodies[m_bodyIndex] != NULL) + { + m_world->DestroyBody(m_bodies[m_bodyIndex]); + m_bodies[m_bodyIndex] = NULL; + } + + b2BodyDef bd; + + float32 x = RandomFloat(-10.0f, 10.0f); + float32 y = RandomFloat(10.0f, 20.0f); + bd.position.Set(x, y); + bd.angle = RandomFloat(-b2_pi, b2_pi); + bd.type = b2_dynamicBody; + + if (index == 4) + { + bd.angularDamping = 0.02f; + } + + m_bodies[m_bodyIndex] = m_world->CreateBody(&bd); + + if (index < 4) + { + b2FixtureDef fd; + fd.shape = m_polygons + index; + fd.friction = 0.3f; + fd.density = 20.0f; + m_bodies[m_bodyIndex]->CreateFixture(&fd); + } + else + { + b2FixtureDef fd; + fd.shape = &m_circle; + fd.friction = 0.3f; + fd.density = 20.0f; + m_bodies[m_bodyIndex]->CreateFixture(&fd); + } + + m_bodyIndex = (m_bodyIndex + 1) % e_maxBodies; + } + + void DestroyBody() + { + for (int32 i = 0; i < e_maxBodies; ++i) + { + if (m_bodies[i] != NULL) + { + m_world->DestroyBody(m_bodies[i]); + m_bodies[i] = NULL; + return; + } + } + } + + void Keyboard(unsigned char key) + { + switch (key) + { + case '1': + case '2': + case '3': + case '4': + case '5': + Create(key - '1'); + break; + + case 'd': + DestroyBody(); + break; + } + } + + void Step(Settings* settings) + { + bool advanceRay = settings->pause == 0 || settings->singleStep; + + Test::Step(settings); + m_debugDraw.DrawString(5, m_textLine, "Press 1-5 to drop stuff"); + m_textLine += 15; + + float32 L = 25.0f; + b2Vec2 point1(0.0f, 10.0f); + b2Vec2 d(L * cosf(m_angle), -L * b2Abs(sinf(m_angle))); + b2Vec2 point2 = point1 + d; + + EdgeShapesCallback callback; + + m_world->RayCast(&callback, point1, point2); + + if (callback.m_fixture) + { + m_debugDraw.DrawPoint(callback.m_point, 5.0f, b2Color(0.4f, 0.9f, 0.4f)); + + m_debugDraw.DrawSegment(point1, callback.m_point, b2Color(0.8f, 0.8f, 0.8f)); + + b2Vec2 head = callback.m_point + 0.5f * callback.m_normal; + m_debugDraw.DrawSegment(callback.m_point, head, b2Color(0.9f, 0.9f, 0.4f)); + } + else + { + m_debugDraw.DrawSegment(point1, point2, b2Color(0.8f, 0.8f, 0.8f)); + } + + if (advanceRay) + { + m_angle += 0.25f * b2_pi / 180.0f; + } + } + + static Test* Create() + { + return new EdgeShapes; + } + + int32 m_bodyIndex; + b2Body* m_bodies[e_maxBodies]; + b2PolygonShape m_polygons[4]; + b2CircleShape m_circle; + + float32 m_angle; +}; + +#endif diff --git a/external/Box2d/Testbed/Tests/EdgeTest.h b/external/Box2d/Testbed/Tests/EdgeTest.h new file mode 100755 index 0000000..2cabf2e --- /dev/null +++ b/external/Box2d/Testbed/Tests/EdgeTest.h @@ -0,0 +1,109 @@ +/* +* Copyright (c) 2006-2010 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef EDGE_TEST_H +#define EDGE_TEST_H + +class EdgeTest : public Test +{ +public: + + EdgeTest() + { + { + b2BodyDef bd; + b2Body* ground = m_world->CreateBody(&bd); + + b2Vec2 v1(-10.0f, 0.0f), v2(-7.0f, -2.0f), v3(-4.0f, 0.0f); + b2Vec2 v4(0.0f, 0.0f), v5(4.0f, 0.0f), v6(7.0f, 2.0f), v7(10.0f, 0.0f); + + b2EdgeShape shape; + + shape.Set(v1, v2); + shape.m_hasVertex3 = true; + shape.m_vertex3 = v3; + ground->CreateFixture(&shape, 0.0f); + + shape.Set(v2, v3); + shape.m_hasVertex0 = true; + shape.m_hasVertex3 = true; + shape.m_vertex0 = v1; + shape.m_vertex3 = v4; + ground->CreateFixture(&shape, 0.0f); + + shape.Set(v3, v4); + shape.m_hasVertex0 = true; + shape.m_hasVertex3 = true; + shape.m_vertex0 = v2; + shape.m_vertex3 = v5; + ground->CreateFixture(&shape, 0.0f); + + shape.Set(v4, v5); + shape.m_hasVertex0 = true; + shape.m_hasVertex3 = true; + shape.m_vertex0 = v3; + shape.m_vertex3 = v6; + ground->CreateFixture(&shape, 0.0f); + + shape.Set(v5, v6); + shape.m_hasVertex0 = true; + shape.m_hasVertex3 = true; + shape.m_vertex0 = v4; + shape.m_vertex3 = v7; + ground->CreateFixture(&shape, 0.0f); + + shape.Set(v6, v7); + shape.m_hasVertex0 = true; + shape.m_vertex0 = v5; + ground->CreateFixture(&shape, 0.0f); + } + + { + b2BodyDef bd; + bd.type = b2_dynamicBody; + bd.position.Set(-0.5f, 0.6f); + bd.allowSleep = false; + b2Body* body = m_world->CreateBody(&bd); + + b2CircleShape shape; + shape.m_radius = 0.5f; + + body->CreateFixture(&shape, 1.0f); + } + + { + b2BodyDef bd; + bd.type = b2_dynamicBody; + bd.position.Set(1.0f, 0.6f); + bd.allowSleep = false; + b2Body* body = m_world->CreateBody(&bd); + + b2PolygonShape shape; + shape.SetAsBox(0.5f, 0.5f); + + body->CreateFixture(&shape, 1.0f); + } + } + + static Test* Create() + { + return new EdgeTest; + } +}; + +#endif diff --git a/external/Box2d/Testbed/Tests/Gears.h b/external/Box2d/Testbed/Tests/Gears.h new file mode 100755 index 0000000..0ef4b88 --- /dev/null +++ b/external/Box2d/Testbed/Tests/Gears.h @@ -0,0 +1,187 @@ +/* +* Copyright (c) 2007-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef GEARS_H +#define GEARS_H + +class Gears : public Test +{ +public: + Gears() + { + b2Body* ground = NULL; + { + b2BodyDef bd; + ground = m_world->CreateBody(&bd); + + b2EdgeShape shape; + shape.Set(b2Vec2(50.0f, 0.0f), b2Vec2(-50.0f, 0.0f)); + ground->CreateFixture(&shape, 0.0f); + } + + // Gears co + { + b2CircleShape circle1; + circle1.m_radius = 1.0f; + + b2PolygonShape box; + box.SetAsBox(0.5f, 5.0f); + + b2CircleShape circle2; + circle2.m_radius = 2.0f; + + b2BodyDef bd1; + bd1.type = b2_staticBody; + bd1.position.Set(10.0f, 9.0f); + b2Body* body1 = m_world->CreateBody(&bd1); + body1->CreateFixture(&circle1, 0.0f); + + b2BodyDef bd2; + bd2.type = b2_dynamicBody; + bd2.position.Set(10.0f, 8.0f); + b2Body* body2 = m_world->CreateBody(&bd2); + body2->CreateFixture(&box, 5.0f); + + b2BodyDef bd3; + bd3.type = b2_dynamicBody; + bd3.position.Set(10.0f, 6.0f); + b2Body* body3 = m_world->CreateBody(&bd3); + body3->CreateFixture(&circle2, 5.0f); + + b2RevoluteJointDef jd1; + jd1.Initialize(body2, body1, bd1.position); + b2Joint* joint1 = m_world->CreateJoint(&jd1); + + b2RevoluteJointDef jd2; + jd2.Initialize(body2, body3, bd3.position); + b2Joint* joint2 = m_world->CreateJoint(&jd2); + + b2GearJointDef jd4; + jd4.bodyA = body1; + jd4.bodyB = body3; + jd4.joint1 = joint1; + jd4.joint2 = joint2; + jd4.ratio = circle2.m_radius / circle1.m_radius; + m_world->CreateJoint(&jd4); + } + + { + b2CircleShape circle1; + circle1.m_radius = 1.0f; + + b2CircleShape circle2; + circle2.m_radius = 2.0f; + + b2PolygonShape box; + box.SetAsBox(0.5f, 5.0f); + + b2BodyDef bd1; + bd1.type = b2_dynamicBody; + bd1.position.Set(-3.0f, 12.0f); + b2Body* body1 = m_world->CreateBody(&bd1); + body1->CreateFixture(&circle1, 5.0f); + + b2RevoluteJointDef jd1; + jd1.bodyA = ground; + jd1.bodyB = body1; + jd1.localAnchorA = ground->GetLocalPoint(bd1.position); + jd1.localAnchorB = body1->GetLocalPoint(bd1.position); + jd1.referenceAngle = body1->GetAngle() - ground->GetAngle(); + m_joint1 = (b2RevoluteJoint*)m_world->CreateJoint(&jd1); + + b2BodyDef bd2; + bd2.type = b2_dynamicBody; + bd2.position.Set(0.0f, 12.0f); + b2Body* body2 = m_world->CreateBody(&bd2); + body2->CreateFixture(&circle2, 5.0f); + + b2RevoluteJointDef jd2; + jd2.Initialize(ground, body2, bd2.position); + m_joint2 = (b2RevoluteJoint*)m_world->CreateJoint(&jd2); + + b2BodyDef bd3; + bd3.type = b2_dynamicBody; + bd3.position.Set(2.5f, 12.0f); + b2Body* body3 = m_world->CreateBody(&bd3); + body3->CreateFixture(&box, 5.0f); + + b2PrismaticJointDef jd3; + jd3.Initialize(ground, body3, bd3.position, b2Vec2(0.0f, 1.0f)); + jd3.lowerTranslation = -5.0f; + jd3.upperTranslation = 5.0f; + jd3.enableLimit = true; + + m_joint3 = (b2PrismaticJoint*)m_world->CreateJoint(&jd3); + + b2GearJointDef jd4; + jd4.bodyA = body1; + jd4.bodyB = body2; + jd4.joint1 = m_joint1; + jd4.joint2 = m_joint2; + jd4.ratio = circle2.m_radius / circle1.m_radius; + m_joint4 = (b2GearJoint*)m_world->CreateJoint(&jd4); + + b2GearJointDef jd5; + jd5.bodyA = body2; + jd5.bodyB = body3; + jd5.joint1 = m_joint2; + jd5.joint2 = m_joint3; + jd5.ratio = -1.0f / circle2.m_radius; + m_joint5 = (b2GearJoint*)m_world->CreateJoint(&jd5); + } + } + + void Keyboard(unsigned char key) + { + switch (key) + { + case 0: + break; + } + } + + void Step(Settings* settings) + { + Test::Step(settings); + + float32 ratio, value; + + ratio = m_joint4->GetRatio(); + value = m_joint1->GetJointAngle() + ratio * m_joint2->GetJointAngle(); + m_debugDraw.DrawString(5, m_textLine, "theta1 + %4.2f * theta2 = %4.2f", (float) ratio, (float) value); + m_textLine += 15; + + ratio = m_joint5->GetRatio(); + value = m_joint2->GetJointAngle() + ratio * m_joint3->GetJointTranslation(); + m_debugDraw.DrawString(5, m_textLine, "theta2 + %4.2f * delta = %4.2f", (float) ratio, (float) value); + m_textLine += 15; + } + + static Test* Create() + { + return new Gears; + } + + b2RevoluteJoint* m_joint1; + b2RevoluteJoint* m_joint2; + b2PrismaticJoint* m_joint3; + b2GearJoint* m_joint4; + b2GearJoint* m_joint5; +}; + +#endif diff --git a/external/Box2d/Testbed/Tests/OneSidedPlatform.h b/external/Box2d/Testbed/Tests/OneSidedPlatform.h new file mode 100755 index 0000000..9d3c84e --- /dev/null +++ b/external/Box2d/Testbed/Tests/OneSidedPlatform.h @@ -0,0 +1,120 @@ +/* +* Copyright (c) 2008-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef ONE_SIDED_PLATFORM_H +#define ONE_SIDED_PLATFORM_H + +class OneSidedPlatform : public Test +{ +public: + + enum State + { + e_unknown, + e_above, + e_below + }; + + OneSidedPlatform() + { + // Ground + { + b2BodyDef bd; + b2Body* ground = m_world->CreateBody(&bd); + + b2EdgeShape shape; + shape.Set(b2Vec2(-20.0f, 0.0f), b2Vec2(20.0f, 0.0f)); + ground->CreateFixture(&shape, 0.0f); + } + + // Platform + { + b2BodyDef bd; + bd.position.Set(0.0f, 10.0f); + b2Body* body = m_world->CreateBody(&bd); + + b2PolygonShape shape; + shape.SetAsBox(3.0f, 0.5f); + m_platform = body->CreateFixture(&shape, 0.0f); + + m_bottom = 10.0f - 0.5f; + m_top = 10.0f + 0.5f; + } + + // Actor + { + b2BodyDef bd; + bd.type = b2_dynamicBody; + bd.position.Set(0.0f, 12.0f); + b2Body* body = m_world->CreateBody(&bd); + + m_radius = 0.5f; + b2CircleShape shape; + shape.m_radius = m_radius; + m_character = body->CreateFixture(&shape, 20.0f); + + body->SetLinearVelocity(b2Vec2(0.0f, -50.0f)); + + m_state = e_unknown; + } + } + + void PreSolve(b2Contact* contact, const b2Manifold* oldManifold) + { + Test::PreSolve(contact, oldManifold); + + b2Fixture* fixtureA = contact->GetFixtureA(); + b2Fixture* fixtureB = contact->GetFixtureB(); + + if (fixtureA != m_platform && fixtureA != m_character) + { + return; + } + + if (fixtureB != m_platform && fixtureB != m_character) + { + return; + } + + b2Vec2 position = m_character->GetBody()->GetPosition(); + + if (position.y < m_top + m_radius - 3.0f * b2_linearSlop) + { + contact->SetEnabled(false); + } + } + + void Step(Settings* settings) + { + Test::Step(settings); + m_debugDraw.DrawString(5, m_textLine, "Press: (c) create a shape, (d) destroy a shape."); + m_textLine += 15; + } + + static Test* Create() + { + return new OneSidedPlatform; + } + + float32 m_radius, m_top, m_bottom; + State m_state; + b2Fixture* m_platform; + b2Fixture* m_character; +}; + +#endif diff --git a/external/Box2d/Testbed/Tests/Pinball.h b/external/Box2d/Testbed/Tests/Pinball.h new file mode 100755 index 0000000..640edf4 --- /dev/null +++ b/external/Box2d/Testbed/Tests/Pinball.h @@ -0,0 +1,169 @@ +/* +* Copyright (c) 2006-2010 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef PINBALL_H +#define PINBALL_H + +/// This tests bullet collision and provides an example of a gameplay scenario. +/// This also uses a loop shape. +class Pinball : public Test +{ +public: + Pinball() + { + // Ground body + b2Body* ground = NULL; + { + b2BodyDef bd; + ground = m_world->CreateBody(&bd); + + b2Vec2 vs[5]; + vs[0].Set(0.0f, -2.0f); + vs[1].Set(8.0f, 6.0f); + vs[2].Set(8.0f, 20.0f); + vs[3].Set(-8.0f, 20.0f); + vs[4].Set(-8.0f, 6.0f); + + b2ChainShape loop; + loop.CreateLoop(vs, 5); + b2FixtureDef fd; + fd.shape = &loop; + fd.density = 0.0f; + ground->CreateFixture(&fd); + } + + // Flippers + { + b2Vec2 p1(-2.0f, 0.0f), p2(2.0f, 0.0f); + + b2BodyDef bd; + bd.type = b2_dynamicBody; + + bd.position = p1; + b2Body* leftFlipper = m_world->CreateBody(&bd); + + bd.position = p2; + b2Body* rightFlipper = m_world->CreateBody(&bd); + + b2PolygonShape box; + box.SetAsBox(1.75f, 0.1f); + + b2FixtureDef fd; + fd.shape = &box; + fd.density = 1.0f; + + leftFlipper->CreateFixture(&fd); + rightFlipper->CreateFixture(&fd); + + b2RevoluteJointDef jd; + jd.bodyA = ground; + jd.localAnchorB.SetZero(); + jd.enableMotor = true; + jd.maxMotorTorque = 1000.0f; + jd.enableLimit = true; + + jd.motorSpeed = 0.0f; + jd.localAnchorA = p1; + jd.bodyB = leftFlipper; + jd.lowerAngle = -30.0f * b2_pi / 180.0f; + jd.upperAngle = 5.0f * b2_pi / 180.0f; + m_leftJoint = (b2RevoluteJoint*)m_world->CreateJoint(&jd); + + jd.motorSpeed = 0.0f; + jd.localAnchorA = p2; + jd.bodyB = rightFlipper; + jd.lowerAngle = -5.0f * b2_pi / 180.0f; + jd.upperAngle = 30.0f * b2_pi / 180.0f; + m_rightJoint = (b2RevoluteJoint*)m_world->CreateJoint(&jd); + } + + // Circle character + { + b2BodyDef bd; + bd.position.Set(1.0f, 15.0f); + bd.type = b2_dynamicBody; + bd.bullet = true; + + m_ball = m_world->CreateBody(&bd); + + b2CircleShape shape; + shape.m_radius = 0.2f; + + b2FixtureDef fd; + fd.shape = &shape; + fd.density = 1.0f; + m_ball->CreateFixture(&fd); + } + + m_button = false; + } + + void Step(Settings* settings) + { + if (m_button) + { + m_leftJoint->SetMotorSpeed(20.0f); + m_rightJoint->SetMotorSpeed(-20.0f); + } + else + { + m_leftJoint->SetMotorSpeed(-10.0f); + m_rightJoint->SetMotorSpeed(10.0f); + } + + Test::Step(settings); + + m_debugDraw.DrawString(5, m_textLine, "Press 'a' to control the flippers"); + m_textLine += 15; + + } + + void Keyboard(unsigned char key) + { + switch (key) + { + case 'a': + case 'A': + m_button = true; + break; + } + } + + void KeyboardUp(unsigned char key) + { + switch (key) + { + case 'a': + case 'A': + m_button = false; + break; + } + } + + static Test* Create() + { + return new Pinball; + } + + b2RevoluteJoint* m_leftJoint; + b2RevoluteJoint* m_rightJoint; + b2Body* m_ball; + bool m_button; +}; + +#endif diff --git a/external/Box2d/Testbed/Tests/PolyCollision.h b/external/Box2d/Testbed/Tests/PolyCollision.h new file mode 100755 index 0000000..43ede33 --- /dev/null +++ b/external/Box2d/Testbed/Tests/PolyCollision.h @@ -0,0 +1,122 @@ +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef POLYCOLLISION_H +#define POLYCOLLISION_H + +class PolyCollision : public Test +{ +public: + PolyCollision() + { + { + m_polygonA.SetAsBox(0.2f, 0.4f); + m_transformA.Set(b2Vec2(0.0f, 0.0f), 0.0f); + } + + { + m_polygonB.SetAsBox(0.5f, 0.5f); + m_positionB.Set(19.345284f, 1.5632932f); + m_angleB = 1.9160721f; + m_transformB.Set(m_positionB, m_angleB); + } + } + + static Test* Create() + { + return new PolyCollision; + } + + void Step(Settings* settings) + { + B2_NOT_USED(settings); + + b2Manifold manifold; + b2CollidePolygons(&manifold, &m_polygonA, m_transformA, &m_polygonB, m_transformB); + + b2WorldManifold worldManifold; + worldManifold.Initialize(&manifold, m_transformA, m_polygonA.m_radius, m_transformB, m_polygonB.m_radius); + + m_debugDraw.DrawString(5, m_textLine, "point count = %d", manifold.pointCount); + m_textLine += 15; + + { + b2Color color(0.9f, 0.9f, 0.9f); + b2Vec2 v[b2_maxPolygonVertices]; + for (int32 i = 0; i < m_polygonA.m_vertexCount; ++i) + { + v[i] = b2Mul(m_transformA, m_polygonA.m_vertices[i]); + } + m_debugDraw.DrawPolygon(v, m_polygonA.m_vertexCount, color); + + for (int32 i = 0; i < m_polygonB.m_vertexCount; ++i) + { + v[i] = b2Mul(m_transformB, m_polygonB.m_vertices[i]); + } + m_debugDraw.DrawPolygon(v, m_polygonB.m_vertexCount, color); + } + + for (int32 i = 0; i < manifold.pointCount; ++i) + { + m_debugDraw.DrawPoint(worldManifold.points[i], 4.0f, b2Color(0.9f, 0.3f, 0.3f)); + } + } + + void Keyboard(unsigned char key) + { + switch (key) + { + case 'a': + m_positionB.x -= 0.1f; + break; + + case 'd': + m_positionB.x += 0.1f; + break; + + case 's': + m_positionB.y -= 0.1f; + break; + + case 'w': + m_positionB.y += 0.1f; + break; + + case 'q': + m_angleB += 0.1f * b2_pi; + break; + + case 'e': + m_angleB -= 0.1f * b2_pi; + break; + } + + m_transformB.Set(m_positionB, m_angleB); + } + + b2PolygonShape m_polygonA; + b2PolygonShape m_polygonB; + + b2Transform m_transformA; + b2Transform m_transformB; + + b2Vec2 m_positionB; + float32 m_angleB; +}; + +#endif diff --git a/external/Box2d/Testbed/Tests/PolyShapes.h b/external/Box2d/Testbed/Tests/PolyShapes.h new file mode 100755 index 0000000..95744f5 --- /dev/null +++ b/external/Box2d/Testbed/Tests/PolyShapes.h @@ -0,0 +1,295 @@ +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef POLY_SHAPES_H +#define POLY_SHAPES_H + +/// This tests stacking. It also shows how to use b2World::Query +/// and b2TestOverlap. + +const int32 k_maxBodies = 256; + +/// This callback is called by b2World::QueryAABB. We find all the fixtures +/// that overlap an AABB. Of those, we use b2TestOverlap to determine which fixtures +/// overlap a circle. Up to 4 overlapped fixtures will be highlighted with a yellow border. +class PolyShapesCallback : public b2QueryCallback +{ +public: + + enum + { + e_maxCount = 4 + }; + + PolyShapesCallback() + { + m_count = 0; + } + + void DrawFixture(b2Fixture* fixture) + { + b2Color color(0.95f, 0.95f, 0.6f); + const b2Transform& xf = fixture->GetBody()->GetTransform(); + + switch (fixture->GetType()) + { + case b2Shape::e_circle: + { + b2CircleShape* circle = (b2CircleShape*)fixture->GetShape(); + + b2Vec2 center = b2Mul(xf, circle->m_p); + float32 radius = circle->m_radius; + + m_debugDraw->DrawCircle(center, radius, color); + } + break; + + case b2Shape::e_polygon: + { + b2PolygonShape* poly = (b2PolygonShape*)fixture->GetShape(); + int32 vertexCount = poly->m_vertexCount; + b2Assert(vertexCount <= b2_maxPolygonVertices); + b2Vec2 vertices[b2_maxPolygonVertices]; + + for (int32 i = 0; i < vertexCount; ++i) + { + vertices[i] = b2Mul(xf, poly->m_vertices[i]); + } + + m_debugDraw->DrawPolygon(vertices, vertexCount, color); + } + break; + + default: + break; + } + } + + /// Called for each fixture found in the query AABB. + /// @return false to terminate the query. + bool ReportFixture(b2Fixture* fixture) + { + if (m_count == e_maxCount) + { + return false; + } + + b2Body* body = fixture->GetBody(); + b2Shape* shape = fixture->GetShape(); + + bool overlap = b2TestOverlap(shape, 0, &m_circle, 0, body->GetTransform(), m_transform); + + if (overlap) + { + DrawFixture(fixture); + ++m_count; + } + + return true; + } + + b2CircleShape m_circle; + b2Transform m_transform; + b2Draw* m_debugDraw; + int32 m_count; +}; + +class PolyShapes : public Test +{ +public: + PolyShapes() + { + // Ground body + { + b2BodyDef bd; + b2Body* ground = m_world->CreateBody(&bd); + + b2EdgeShape shape; + shape.Set(b2Vec2(-40.0f, 0.0f), b2Vec2(40.0f, 0.0f)); + ground->CreateFixture(&shape, 0.0f); + } + + { + b2Vec2 vertices[3]; + vertices[0].Set(-0.5f, 0.0f); + vertices[1].Set(0.5f, 0.0f); + vertices[2].Set(0.0f, 1.5f); + m_polygons[0].Set(vertices, 3); + } + + { + b2Vec2 vertices[3]; + vertices[0].Set(-0.1f, 0.0f); + vertices[1].Set(0.1f, 0.0f); + vertices[2].Set(0.0f, 1.5f); + m_polygons[1].Set(vertices, 3); + } + + { + float32 w = 1.0f; + float32 b = w / (2.0f + b2Sqrt(2.0f)); + float32 s = b2Sqrt(2.0f) * b; + + b2Vec2 vertices[8]; + vertices[0].Set(0.5f * s, 0.0f); + vertices[1].Set(0.5f * w, b); + vertices[2].Set(0.5f * w, b + s); + vertices[3].Set(0.5f * s, w); + vertices[4].Set(-0.5f * s, w); + vertices[5].Set(-0.5f * w, b + s); + vertices[6].Set(-0.5f * w, b); + vertices[7].Set(-0.5f * s, 0.0f); + + m_polygons[2].Set(vertices, 8); + } + + { + m_polygons[3].SetAsBox(0.5f, 0.5f); + } + + { + m_circle.m_radius = 0.5f; + } + + m_bodyIndex = 0; + memset(m_bodies, 0, sizeof(m_bodies)); + } + + void Create(int32 index) + { + if (m_bodies[m_bodyIndex] != NULL) + { + m_world->DestroyBody(m_bodies[m_bodyIndex]); + m_bodies[m_bodyIndex] = NULL; + } + + b2BodyDef bd; + bd.type = b2_dynamicBody; + + float32 x = RandomFloat(-2.0f, 2.0f); + bd.position.Set(x, 10.0f); + bd.angle = RandomFloat(-b2_pi, b2_pi); + + if (index == 4) + { + bd.angularDamping = 0.02f; + } + + m_bodies[m_bodyIndex] = m_world->CreateBody(&bd); + + if (index < 4) + { + b2FixtureDef fd; + fd.shape = m_polygons + index; + fd.density = 1.0f; + fd.friction = 0.3f; + m_bodies[m_bodyIndex]->CreateFixture(&fd); + } + else + { + b2FixtureDef fd; + fd.shape = &m_circle; + fd.density = 1.0f; + fd.friction = 0.3f; + + m_bodies[m_bodyIndex]->CreateFixture(&fd); + } + + m_bodyIndex = (m_bodyIndex + 1) % k_maxBodies; + } + + void DestroyBody() + { + for (int32 i = 0; i < k_maxBodies; ++i) + { + if (m_bodies[i] != NULL) + { + m_world->DestroyBody(m_bodies[i]); + m_bodies[i] = NULL; + return; + } + } + } + + void Keyboard(unsigned char key) + { + switch (key) + { + case '1': + case '2': + case '3': + case '4': + case '5': + Create(key - '1'); + break; + + case 'a': + for (int32 i = 0; i < k_maxBodies; i += 2) + { + if (m_bodies[i]) + { + bool active = m_bodies[i]->IsActive(); + m_bodies[i]->SetActive(!active); + } + } + break; + + case 'd': + DestroyBody(); + break; + } + } + + void Step(Settings* settings) + { + Test::Step(settings); + + PolyShapesCallback callback; + callback.m_circle.m_radius = 2.0f; + callback.m_circle.m_p.Set(0.0f, 1.1f); + callback.m_transform.SetIdentity(); + callback.m_debugDraw = &m_debugDraw; + + b2AABB aabb; + callback.m_circle.ComputeAABB(&aabb, callback.m_transform, 0); + + m_world->QueryAABB(&callback, aabb); + + b2Color color(0.4f, 0.7f, 0.8f); + m_debugDraw.DrawCircle(callback.m_circle.m_p, callback.m_circle.m_radius, color); + + m_debugDraw.DrawString(5, m_textLine, "Press 1-5 to drop stuff"); + m_textLine += 15; + m_debugDraw.DrawString(5, m_textLine, "Press 'a' to (de)activate some bodies"); + m_textLine += 15; + m_debugDraw.DrawString(5, m_textLine, "Press 'd' to destroy a body"); + m_textLine += 15; + } + + static Test* Create() + { + return new PolyShapes; + } + + int32 m_bodyIndex; + b2Body* m_bodies[k_maxBodies]; + b2PolygonShape m_polygons[4]; + b2CircleShape m_circle; +}; + +#endif diff --git a/external/Box2d/Testbed/Tests/Prismatic.h b/external/Box2d/Testbed/Tests/Prismatic.h new file mode 100755 index 0000000..468ba08 --- /dev/null +++ b/external/Box2d/Testbed/Tests/Prismatic.h @@ -0,0 +1,106 @@ +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef PRISMATIC_H +#define PRISMATIC_H + +class Prismatic : public Test +{ +public: + Prismatic() + { + b2Body* ground = NULL; + { + b2BodyDef bd; + ground = m_world->CreateBody(&bd); + + b2EdgeShape shape; + shape.Set(b2Vec2(-40.0f, 0.0f), b2Vec2(40.0f, 0.0f)); + ground->CreateFixture(&shape, 0.0f); + } + + { + b2PolygonShape shape; + shape.SetAsBox(2.0f, 0.5f); + + b2BodyDef bd; + bd.type = b2_dynamicBody; + bd.position.Set(-10.0f, 10.0f); + bd.angle = 0.5f * b2_pi; + bd.allowSleep = false; + b2Body* body = m_world->CreateBody(&bd); + body->CreateFixture(&shape, 5.0f); + + b2PrismaticJointDef pjd; + + // Bouncy limit + b2Vec2 axis(2.0f, 1.0f); + axis.Normalize(); + pjd.Initialize(ground, body, b2Vec2(0.0f, 0.0f), axis); + + // Non-bouncy limit + //pjd.Initialize(ground, body, b2Vec2(-10.0f, 10.0f), b2Vec2(1.0f, 0.0f)); + + pjd.motorSpeed = 10.0f; + pjd.maxMotorForce = 10000.0f; + pjd.enableMotor = true; + pjd.lowerTranslation = 0.0f; + pjd.upperTranslation = 20.0f; + pjd.enableLimit = true; + + m_joint = (b2PrismaticJoint*)m_world->CreateJoint(&pjd); + } + } + + void Keyboard(unsigned char key) + { + switch (key) + { + case 'l': + m_joint->EnableLimit(!m_joint->IsLimitEnabled()); + break; + + case 'm': + m_joint->EnableMotor(!m_joint->IsMotorEnabled()); + break; + + case 's': + m_joint->SetMotorSpeed(-m_joint->GetMotorSpeed()); + break; + } + } + + void Step(Settings* settings) + { + Test::Step(settings); + m_debugDraw.DrawString(5, m_textLine, "Keys: (l) limits, (m) motors, (s) speed"); + m_textLine += 15; + float32 force = m_joint->GetMotorForce(settings->hz); + m_debugDraw.DrawString(5, m_textLine, "Motor Force = %4.0f", (float) force); + m_textLine += 15; + } + + static Test* Create() + { + return new Prismatic; + } + + b2PrismaticJoint* m_joint; +}; + +#endif diff --git a/external/Box2d/Testbed/Tests/Pulleys.h b/external/Box2d/Testbed/Tests/Pulleys.h new file mode 100755 index 0000000..9c71626 --- /dev/null +++ b/external/Box2d/Testbed/Tests/Pulleys.h @@ -0,0 +1,106 @@ +/* +* Copyright (c) 2007-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef PULLEYS_H +#define PULLEYS_H + +class Pulleys : public Test +{ +public: + Pulleys() + { + float32 y = 16.0f; + float32 L = 12.0f; + float32 a = 1.0f; + float32 b = 2.0f; + + b2Body* ground = NULL; + { + b2BodyDef bd; + ground = m_world->CreateBody(&bd); + + b2EdgeShape edge; + edge.Set(b2Vec2(-40.0f, 0.0f), b2Vec2(40.0f, 0.0f)); + //ground->CreateFixture(&shape, 0.0f); + + b2CircleShape circle; + circle.m_radius = 2.0f; + + circle.m_p.Set(-10.0f, y + b + L); + ground->CreateFixture(&circle, 0.0f); + + circle.m_p.Set(10.0f, y + b + L); + ground->CreateFixture(&circle, 0.0f); + } + + { + + b2PolygonShape shape; + shape.SetAsBox(a, b); + + b2BodyDef bd; + bd.type = b2_dynamicBody; + + //bd.fixedRotation = true; + bd.position.Set(-10.0f, y); + b2Body* body1 = m_world->CreateBody(&bd); + body1->CreateFixture(&shape, 5.0f); + + bd.position.Set(10.0f, y); + b2Body* body2 = m_world->CreateBody(&bd); + body2->CreateFixture(&shape, 5.0f); + + b2PulleyJointDef pulleyDef; + b2Vec2 anchor1(-10.0f, y + b); + b2Vec2 anchor2(10.0f, y + b); + b2Vec2 groundAnchor1(-10.0f, y + b + L); + b2Vec2 groundAnchor2(10.0f, y + b + L); + pulleyDef.Initialize(body1, body2, groundAnchor1, groundAnchor2, anchor1, anchor2, 1.5f); + + m_joint1 = (b2PulleyJoint*)m_world->CreateJoint(&pulleyDef); + } + } + + void Keyboard(unsigned char key) + { + switch (key) + { + case 0: + break; + } + } + + void Step(Settings* settings) + { + Test::Step(settings); + + float32 ratio = m_joint1->GetRatio(); + float32 L = m_joint1->GetLengthA() + ratio * m_joint1->GetLengthB(); + m_debugDraw.DrawString(5, m_textLine, "L1 + %4.2f * L2 = %4.2f", (float) ratio, (float) L); + m_textLine += 15; + } + + static Test* Create() + { + return new Pulleys; + } + + b2PulleyJoint* m_joint1; +}; + +#endif diff --git a/external/Box2d/Testbed/Tests/Pyramid.h b/external/Box2d/Testbed/Tests/Pyramid.h new file mode 100755 index 0000000..ac3cd46 --- /dev/null +++ b/external/Box2d/Testbed/Tests/Pyramid.h @@ -0,0 +1,89 @@ +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef PYRAMID_H +#define PYRAMID_H + +class Pyramid : public Test +{ +public: + enum + { + e_count = 20 + }; + + Pyramid() + { + { + b2BodyDef bd; + b2Body* ground = m_world->CreateBody(&bd); + + b2EdgeShape shape; + shape.Set(b2Vec2(-40.0f, 0.0f), b2Vec2(40.0f, 0.0f)); + ground->CreateFixture(&shape, 0.0f); + } + + { + float32 a = 0.5f; + b2PolygonShape shape; + shape.SetAsBox(a, a); + + b2Vec2 x(-7.0f, 0.75f); + b2Vec2 y; + b2Vec2 deltaX(0.5625f, 1.25f); + b2Vec2 deltaY(1.125f, 0.0f); + + for (int32 i = 0; i < e_count; ++i) + { + y = x; + + for (int32 j = i; j < e_count; ++j) + { + b2BodyDef bd; + bd.type = b2_dynamicBody; + bd.position = y; + b2Body* body = m_world->CreateBody(&bd); + body->CreateFixture(&shape, 5.0f); + + y += deltaY; + } + + x += deltaX; + } + } + } + + void Step(Settings* settings) + { + Test::Step(settings); + + //b2DynamicTree* tree = &m_world->m_contactManager.m_broadPhase.m_tree; + + //if (m_stepCount == 400) + //{ + // tree->RebuildBottomUp(); + //} + } + + static Test* Create() + { + return new Pyramid; + } +}; + +#endif diff --git a/external/Box2d/Testbed/Tests/RayCast.h b/external/Box2d/Testbed/Tests/RayCast.h new file mode 100755 index 0000000..c4f067b --- /dev/null +++ b/external/Box2d/Testbed/Tests/RayCast.h @@ -0,0 +1,440 @@ +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef RAY_CAST_H +#define RAY_CAST_H + +// This test demonstrates how to use the world ray-cast feature. +// NOTE: we are intentionally filtering one of the polygons, therefore +// the ray will always miss one type of polygon. + +// This callback finds the closest hit. Polygon 0 is filtered. +class RayCastClosestCallback : public b2RayCastCallback +{ +public: + RayCastClosestCallback() + { + m_hit = false; + } + + float32 ReportFixture( b2Fixture* fixture, const b2Vec2& point, + const b2Vec2& normal, float32 fraction) + { + b2Body* body = fixture->GetBody(); + void* userData = body->GetUserData(); + if (userData) + { + int32 index = *(int32*)userData; + if (index == 0) + { + // filter + return -1.0f; + } + } + + m_hit = true; + m_point = point; + m_normal = normal; + return fraction; + } + + bool m_hit; + b2Vec2 m_point; + b2Vec2 m_normal; +}; + +// This callback finds any hit. Polygon 0 is filtered. +class RayCastAnyCallback : public b2RayCastCallback +{ +public: + RayCastAnyCallback() + { + m_hit = false; + } + + float32 ReportFixture( b2Fixture* fixture, const b2Vec2& point, + const b2Vec2& normal, float32 fraction) + { + b2Body* body = fixture->GetBody(); + void* userData = body->GetUserData(); + if (userData) + { + int32 index = *(int32*)userData; + if (index == 0) + { + // filter + return -1.0f; + } + } + + m_hit = true; + m_point = point; + m_normal = normal; + return 0.0f; + } + + bool m_hit; + b2Vec2 m_point; + b2Vec2 m_normal; +}; + +// This ray cast collects multiple hits along the ray. Polygon 0 is filtered. +class RayCastMultipleCallback : public b2RayCastCallback +{ +public: + enum + { + e_maxCount = 3 + }; + + RayCastMultipleCallback() + { + m_count = 0; + } + + float32 ReportFixture( b2Fixture* fixture, const b2Vec2& point, + const b2Vec2& normal, float32 fraction) + { + b2Body* body = fixture->GetBody(); + void* userData = body->GetUserData(); + if (userData) + { + int32 index = *(int32*)userData; + if (index == 0) + { + // filter + return -1.0f; + } + } + + b2Assert(m_count < e_maxCount); + + m_points[m_count] = point; + m_normals[m_count] = normal; + ++m_count; + + if (m_count == e_maxCount) + { + return 0.0f; + } + + return 1.0f; + } + + b2Vec2 m_points[e_maxCount]; + b2Vec2 m_normals[e_maxCount]; + int32 m_count; +}; + + +class RayCast : public Test +{ +public: + + enum + { + e_maxBodies = 256 + }; + + enum Mode + { + e_closest, + e_any, + e_multiple + }; + + RayCast() + { + // Ground body + { + b2BodyDef bd; + b2Body* ground = m_world->CreateBody(&bd); + + b2EdgeShape shape; + shape.Set(b2Vec2(-40.0f, 0.0f), b2Vec2(40.0f, 0.0f)); + ground->CreateFixture(&shape, 0.0f); + } + + { + b2Vec2 vertices[3]; + vertices[0].Set(-0.5f, 0.0f); + vertices[1].Set(0.5f, 0.0f); + vertices[2].Set(0.0f, 1.5f); + m_polygons[0].Set(vertices, 3); + } + + { + b2Vec2 vertices[3]; + vertices[0].Set(-0.1f, 0.0f); + vertices[1].Set(0.1f, 0.0f); + vertices[2].Set(0.0f, 1.5f); + m_polygons[1].Set(vertices, 3); + } + + { + float32 w = 1.0f; + float32 b = w / (2.0f + b2Sqrt(2.0f)); + float32 s = b2Sqrt(2.0f) * b; + + b2Vec2 vertices[8]; + vertices[0].Set(0.5f * s, 0.0f); + vertices[1].Set(0.5f * w, b); + vertices[2].Set(0.5f * w, b + s); + vertices[3].Set(0.5f * s, w); + vertices[4].Set(-0.5f * s, w); + vertices[5].Set(-0.5f * w, b + s); + vertices[6].Set(-0.5f * w, b); + vertices[7].Set(-0.5f * s, 0.0f); + + m_polygons[2].Set(vertices, 8); + } + + { + m_polygons[3].SetAsBox(0.5f, 0.5f); + } + + { + m_circle.m_radius = 0.5f; + } + + m_bodyIndex = 0; + memset(m_bodies, 0, sizeof(m_bodies)); + + m_angle = 0.0f; + + m_mode = e_closest; + } + + void Create(int32 index) + { + if (m_bodies[m_bodyIndex] != NULL) + { + m_world->DestroyBody(m_bodies[m_bodyIndex]); + m_bodies[m_bodyIndex] = NULL; + } + + b2BodyDef bd; + + float32 x = RandomFloat(-10.0f, 10.0f); + float32 y = RandomFloat(0.0f, 20.0f); + bd.position.Set(x, y); + bd.angle = RandomFloat(-b2_pi, b2_pi); + + m_userData[m_bodyIndex] = index; + bd.userData = m_userData + m_bodyIndex; + + if (index == 4) + { + bd.angularDamping = 0.02f; + } + + m_bodies[m_bodyIndex] = m_world->CreateBody(&bd); + + if (index < 4) + { + b2FixtureDef fd; + fd.shape = m_polygons + index; + fd.friction = 0.3f; + m_bodies[m_bodyIndex]->CreateFixture(&fd); + } + else + { + b2FixtureDef fd; + fd.shape = &m_circle; + fd.friction = 0.3f; + + m_bodies[m_bodyIndex]->CreateFixture(&fd); + } + + m_bodyIndex = (m_bodyIndex + 1) % e_maxBodies; + } + + void DestroyBody() + { + for (int32 i = 0; i < e_maxBodies; ++i) + { + if (m_bodies[i] != NULL) + { + m_world->DestroyBody(m_bodies[i]); + m_bodies[i] = NULL; + return; + } + } + } + + void Keyboard(unsigned char key) + { + switch (key) + { + case '1': + case '2': + case '3': + case '4': + case '5': + Create(key - '1'); + break; + + case 'd': + DestroyBody(); + break; + + case 'm': + if (m_mode == e_closest) + { + m_mode = e_any; + } + else if (m_mode == e_any) + { + m_mode = e_multiple; + } + else if (m_mode = e_multiple) + { + m_mode = e_closest; + } + } + } + + void Step(Settings* settings) + { + bool advanceRay = settings->pause == 0 || settings->singleStep; + + Test::Step(settings); + m_debugDraw.DrawString(5, m_textLine, "Press 1-5 to drop stuff, m to change the mode"); + m_textLine += 15; + m_debugDraw.DrawString(5, m_textLine, "Mode = %d", m_mode); + m_textLine += 15; + + float32 L = 11.0f; + b2Vec2 point1(0.0f, 10.0f); + b2Vec2 d(L * cosf(m_angle), L * sinf(m_angle)); + b2Vec2 point2 = point1 + d; + + if (m_mode == e_closest) + { + RayCastClosestCallback callback; + m_world->RayCast(&callback, point1, point2); + + if (callback.m_hit) + { + m_debugDraw.DrawPoint(callback.m_point, 5.0f, b2Color(0.4f, 0.9f, 0.4f)); + m_debugDraw.DrawSegment(point1, callback.m_point, b2Color(0.8f, 0.8f, 0.8f)); + b2Vec2 head = callback.m_point + 0.5f * callback.m_normal; + m_debugDraw.DrawSegment(callback.m_point, head, b2Color(0.9f, 0.9f, 0.4f)); + } + else + { + m_debugDraw.DrawSegment(point1, point2, b2Color(0.8f, 0.8f, 0.8f)); + } + } + else if (m_mode == e_any) + { + RayCastAnyCallback callback; + m_world->RayCast(&callback, point1, point2); + + if (callback.m_hit) + { + m_debugDraw.DrawPoint(callback.m_point, 5.0f, b2Color(0.4f, 0.9f, 0.4f)); + m_debugDraw.DrawSegment(point1, callback.m_point, b2Color(0.8f, 0.8f, 0.8f)); + b2Vec2 head = callback.m_point + 0.5f * callback.m_normal; + m_debugDraw.DrawSegment(callback.m_point, head, b2Color(0.9f, 0.9f, 0.4f)); + } + else + { + m_debugDraw.DrawSegment(point1, point2, b2Color(0.8f, 0.8f, 0.8f)); + } + } + else if (m_mode == e_multiple) + { + RayCastMultipleCallback callback; + m_world->RayCast(&callback, point1, point2); + m_debugDraw.DrawSegment(point1, point2, b2Color(0.8f, 0.8f, 0.8f)); + + for (int32 i = 0; i < callback.m_count; ++i) + { + b2Vec2 p = callback.m_points[i]; + b2Vec2 n = callback.m_normals[i]; + m_debugDraw.DrawPoint(p, 5.0f, b2Color(0.4f, 0.9f, 0.4f)); + m_debugDraw.DrawSegment(point1, p, b2Color(0.8f, 0.8f, 0.8f)); + b2Vec2 head = p + 0.5f * n; + m_debugDraw.DrawSegment(p, head, b2Color(0.9f, 0.9f, 0.4f)); + } + } + + if (advanceRay) + { + m_angle += 0.25f * b2_pi / 180.0f; + } + +#if 0 + // This case was failing. + { + b2Vec2 vertices[4]; + //vertices[0].Set(-22.875f, -3.0f); + //vertices[1].Set(22.875f, -3.0f); + //vertices[2].Set(22.875f, 3.0f); + //vertices[3].Set(-22.875f, 3.0f); + + b2PolygonShape shape; + //shape.Set(vertices, 4); + shape.SetAsBox(22.875f, 3.0f); + + b2RayCastInput input; + input.p1.Set(10.2725f,1.71372f); + input.p2.Set(10.2353f,2.21807f); + //input.maxFraction = 0.567623f; + input.maxFraction = 0.56762173f; + + b2Transform xf; + xf.SetIdentity(); + xf.position.Set(23.0f, 5.0f); + + b2RayCastOutput output; + bool hit; + hit = shape.RayCast(&output, input, xf); + hit = false; + + b2Color color(1.0f, 1.0f, 1.0f); + b2Vec2 vs[4]; + for (int32 i = 0; i < 4; ++i) + { + vs[i] = b2Mul(xf, shape.m_vertices[i]); + } + + m_debugDraw.DrawPolygon(vs, 4, color); + m_debugDraw.DrawSegment(input.p1, input.p2, color); + } +#endif + } + + static Test* Create() + { + return new RayCast; + } + + int32 m_bodyIndex; + b2Body* m_bodies[e_maxBodies]; + int32 m_userData[e_maxBodies]; + b2PolygonShape m_polygons[4]; + b2CircleShape m_circle; + + float32 m_angle; + + Mode m_mode; +}; + +#endif diff --git a/external/Box2d/Testbed/Tests/Revolute.h b/external/Box2d/Testbed/Tests/Revolute.h new file mode 100755 index 0000000..5157b9c --- /dev/null +++ b/external/Box2d/Testbed/Tests/Revolute.h @@ -0,0 +1,166 @@ +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef REVOLUTE_H +#define REVOLUTE_H + +class Revolute : public Test +{ +public: + Revolute() + { + b2Body* ground = NULL; + { + b2BodyDef bd; + ground = m_world->CreateBody(&bd); + + b2EdgeShape shape; + shape.Set(b2Vec2(-40.0f, 0.0f), b2Vec2(40.0f, 0.0f)); + + b2FixtureDef fd; + fd.shape = &shape; + //fd.filter.categoryBits = 2; + + ground->CreateFixture(&fd); + } + + { + b2CircleShape shape; + shape.m_radius = 0.5f; + + b2BodyDef bd; + bd.type = b2_dynamicBody; + + b2RevoluteJointDef rjd; + + bd.position.Set(-10.0f, 20.0f); + b2Body* body = m_world->CreateBody(&bd); + body->CreateFixture(&shape, 5.0f); + + float32 w = 100.0f; + body->SetAngularVelocity(w); + body->SetLinearVelocity(b2Vec2(-8.0f * w, 0.0f)); + + rjd.Initialize(ground, body, b2Vec2(-10.0f, 12.0f)); + rjd.motorSpeed = 1.0f * b2_pi; + rjd.maxMotorTorque = 10000.0f; + rjd.enableMotor = false; + rjd.lowerAngle = -0.25f * b2_pi; + rjd.upperAngle = 0.5f * b2_pi; + rjd.enableLimit = true; + rjd.collideConnected = true; + + m_joint = (b2RevoluteJoint*)m_world->CreateJoint(&rjd); + } + + { + b2CircleShape circle_shape; + circle_shape.m_radius = 3.0f; + + b2BodyDef circle_bd; + circle_bd.type = b2_dynamicBody; + circle_bd.position.Set(5.0f, 30.0f); + + b2FixtureDef fd; + fd.density = 5.0f; + fd.filter.maskBits = 1; + fd.shape = &circle_shape; + + m_ball = m_world->CreateBody(&circle_bd); + m_ball->CreateFixture(&fd); + + b2PolygonShape polygon_shape; + polygon_shape.SetAsBox(10.0f, 0.2f, b2Vec2 (-10.0f, 0.0f), 0.0f); + + b2BodyDef polygon_bd; + polygon_bd.position.Set(20.0f, 10.0f); + polygon_bd.type = b2_dynamicBody; + polygon_bd.bullet = true; + b2Body* polygon_body = m_world->CreateBody(&polygon_bd); + polygon_body->CreateFixture(&polygon_shape, 2.0f); + + b2RevoluteJointDef rjd; + rjd.Initialize(ground, polygon_body, b2Vec2(20.0f, 10.0f)); + rjd.lowerAngle = -0.25f * b2_pi; + rjd.upperAngle = 0.0f * b2_pi; + rjd.enableLimit = true; + m_world->CreateJoint(&rjd); + } + + // Tests mass computation of a small object far from the origin + { + b2BodyDef bodyDef; + bodyDef.type = b2_dynamicBody; + b2Body* body = m_world->CreateBody(&bodyDef); + + b2PolygonShape polyShape; + b2Vec2 verts[3]; + verts[0].Set( 17.63f, 36.31f ); + verts[1].Set( 17.52f, 36.69f ); + verts[2].Set( 17.19f, 36.36f ); + polyShape.Set(verts, 3); + + b2FixtureDef polyFixtureDef; + polyFixtureDef.shape = &polyShape; + polyFixtureDef.density = 1; + + body->CreateFixture(&polyFixtureDef); //assertion hits inside here + } + + } + + void Keyboard(unsigned char key) + { + switch (key) + { + case 'l': + m_joint->EnableLimit(!m_joint->IsLimitEnabled()); + break; + + case 'm': + m_joint->EnableMotor(!m_joint->IsMotorEnabled()); + break; + } + } + + void Step(Settings* settings) + { + Test::Step(settings); + m_debugDraw.DrawString(5, m_textLine, "Keys: (l) limits, (m) motor"); + m_textLine += 15; + + //if (m_stepCount == 360) + //{ + // m_ball->SetTransform(b2Vec2(0.0f, 0.5f), 0.0f); + //} + + //float32 torque1 = m_joint1->GetMotorTorque(); + //m_debugDraw.DrawString(5, m_textLine, "Motor Torque = %4.0f, %4.0f : Motor Force = %4.0f", (float) torque1, (float) torque2, (float) force3); + //m_textLine += 15; + } + + static Test* Create() + { + return new Revolute; + } + + b2Body* m_ball; + b2RevoluteJoint* m_joint; +}; + +#endif diff --git a/external/Box2d/Testbed/Tests/Rope.h b/external/Box2d/Testbed/Tests/Rope.h new file mode 100755 index 0000000..38ff81d --- /dev/null +++ b/external/Box2d/Testbed/Tests/Rope.h @@ -0,0 +1,101 @@ +/* +* Copyright (c) 2011 Erin Catto http://box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef ROPE_H +#define ROPE_H + +/// +class Rope : public Test +{ +public: + Rope() + { + const int32 N = 40; + b2Vec2 vertices[N]; + float32 masses[N]; + + for (int32 i = 0; i < N; ++i) + { + vertices[i].Set(0.0f, 20.0f - 0.25f * i); + masses[i] = 1.0f; + } + masses[0] = 0.0f; + masses[1] = 0.0f; + + b2RopeDef def; + def.vertices = vertices; + def.count = N; + def.gravity.Set(0.0f, -10.0f); + def.masses = masses; + def.damping = 0.1f; + def.k2 = 1.0f; + def.k3 = 0.5f; + + m_rope.Initialize(&def); + + m_angle = 0.0f; + m_rope.SetAngle(m_angle); + } + + void Keyboard(unsigned char key) + { + switch (key) + { + case 'q': + m_angle = b2Max(-b2_pi, m_angle - 0.05f * b2_pi); + m_rope.SetAngle(m_angle); + break; + + case 'e': + m_angle = b2Min(b2_pi, m_angle + 0.05f * b2_pi); + m_rope.SetAngle(m_angle); + break; + } + } + + void Step(Settings* settings) + { + float32 dt = settings->hz > 0.0f ? 1.0f / settings->hz : 0.0f; + + if (settings->pause == 1 && settings->singleStep == 0) + { + dt = 0.0f; + } + + m_rope.Step(dt, 1); + + Test::Step(settings); + + m_rope.Draw(&m_debugDraw); + + m_debugDraw.DrawString(5, m_textLine, "Press (q,e) to adjust target angle"); + m_textLine += 15; + m_debugDraw.DrawString(5, m_textLine, "Target angle = %g degrees", m_angle * 180.0f / b2_pi); + m_textLine += 15; + } + + static Test* Create() + { + return new Rope; + } + + b2Rope m_rope; + float32 m_angle; +}; + +#endif diff --git a/external/Box2d/Testbed/Tests/RopeJoint.h b/external/Box2d/Testbed/Tests/RopeJoint.h new file mode 100755 index 0000000..038dede --- /dev/null +++ b/external/Box2d/Testbed/Tests/RopeJoint.h @@ -0,0 +1,145 @@ +/* +* Copyright (c) 2006-2010 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef ROPE_JOINT_H +#define ROPE_JOINT_H + +/// This test shows how a rope joint can be used to stabilize a chain of +/// bodies with a heavy payload. Notice that the rope joint just prevents +/// excessive stretching and has no other effect. +/// By disabling the rope joint you can see that the Box2D solver has trouble +/// supporting heavy bodies with light bodies. Try playing around with the +/// densities, time step, and iterations to see how they affect stability. +/// This test also shows how to use contact filtering. Filtering is configured +/// so that the payload does not collide with the chain. +class RopeJoint : public Test +{ +public: + RopeJoint() + { + b2Body* ground = NULL; + { + b2BodyDef bd; + ground = m_world->CreateBody(&bd); + + b2EdgeShape shape; + shape.Set(b2Vec2(-40.0f, 0.0f), b2Vec2(40.0f, 0.0f)); + ground->CreateFixture(&shape, 0.0f); + } + + { + b2PolygonShape shape; + shape.SetAsBox(0.5f, 0.125f); + + b2FixtureDef fd; + fd.shape = &shape; + fd.density = 20.0f; + fd.friction = 0.2f; + fd.filter.categoryBits = 0x0001; + fd.filter.maskBits = 0xFFFF & ~0x0002; + + b2RevoluteJointDef jd; + jd.collideConnected = false; + + const int32 N = 10; + const float32 y = 15.0f; + m_ropeDef.localAnchorA.Set(0.0f, y); + + b2Body* prevBody = ground; + for (int32 i = 0; i < N; ++i) + { + b2BodyDef bd; + bd.type = b2_dynamicBody; + bd.position.Set(0.5f + 1.0f * i, y); + if (i == N - 1) + { + shape.SetAsBox(1.5f, 1.5f); + fd.density = 100.0f; + fd.filter.categoryBits = 0x0002; + bd.position.Set(1.0f * i, y); + bd.angularDamping = 0.4f; + } + + b2Body* body = m_world->CreateBody(&bd); + + body->CreateFixture(&fd); + + b2Vec2 anchor(float32(i), y); + jd.Initialize(prevBody, body, anchor); + m_world->CreateJoint(&jd); + + prevBody = body; + } + + m_ropeDef.localAnchorB.SetZero(); + + float32 extraLength = 0.01f; + m_ropeDef.maxLength = N - 1.0f + extraLength; + m_ropeDef.bodyB = prevBody; + } + + { + m_ropeDef.bodyA = ground; + m_rope = m_world->CreateJoint(&m_ropeDef); + } + } + + void Keyboard(unsigned char key) + { + switch (key) + { + case 'j': + if (m_rope) + { + m_world->DestroyJoint(m_rope); + m_rope = NULL; + } + else + { + m_rope = m_world->CreateJoint(&m_ropeDef); + } + break; + } + } + + void Step(Settings* settings) + { + Test::Step(settings); + m_debugDraw.DrawString(5, m_textLine, "Press (j) to toggle the rope joint."); + m_textLine += 15; + if (m_rope) + { + m_debugDraw.DrawString(5, m_textLine, "Rope ON"); + } + else + { + m_debugDraw.DrawString(5, m_textLine, "Rope OFF"); + } + m_textLine += 15; + } + + static Test* Create() + { + return new RopeJoint; + } + + b2RopeJointDef m_ropeDef; + b2Joint* m_rope; +}; + +#endif diff --git a/external/Box2d/Testbed/Tests/SensorTest.h b/external/Box2d/Testbed/Tests/SensorTest.h new file mode 100755 index 0000000..a268041 --- /dev/null +++ b/external/Box2d/Testbed/Tests/SensorTest.h @@ -0,0 +1,181 @@ +/* +* Copyright (c) 2008-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef SENSOR_TEST_H +#define SENSOR_TEST_H + +// This is used to test sensor shapes. +class SensorTest : public Test +{ +public: + + enum + { + e_count = 7 + }; + + SensorTest() + { + { + b2BodyDef bd; + b2Body* ground = m_world->CreateBody(&bd); + + { + b2EdgeShape shape; + shape.Set(b2Vec2(-40.0f, 0.0f), b2Vec2(40.0f, 0.0f)); + ground->CreateFixture(&shape, 0.0f); + } + +#if 0 + { + b2FixtureDef sd; + sd.SetAsBox(10.0f, 2.0f, b2Vec2(0.0f, 20.0f), 0.0f); + sd.isSensor = true; + m_sensor = ground->CreateFixture(&sd); + } +#else + { + b2CircleShape shape; + shape.m_radius = 5.0f; + shape.m_p.Set(0.0f, 10.0f); + + b2FixtureDef fd; + fd.shape = &shape; + fd.isSensor = true; + m_sensor = ground->CreateFixture(&fd); + } +#endif + } + + { + b2CircleShape shape; + shape.m_radius = 1.0f; + + for (int32 i = 0; i < e_count; ++i) + { + b2BodyDef bd; + bd.type = b2_dynamicBody; + bd.position.Set(-10.0f + 3.0f * i, 20.0f); + bd.userData = m_touching + i; + + m_touching[i] = false; + m_bodies[i] = m_world->CreateBody(&bd); + + m_bodies[i]->CreateFixture(&shape, 1.0f); + } + } + } + + // Implement contact listener. + void BeginContact(b2Contact* contact) + { + b2Fixture* fixtureA = contact->GetFixtureA(); + b2Fixture* fixtureB = contact->GetFixtureB(); + + if (fixtureA == m_sensor) + { + void* userData = fixtureB->GetBody()->GetUserData(); + if (userData) + { + bool* touching = (bool*)userData; + *touching = true; + } + } + + if (fixtureB == m_sensor) + { + void* userData = fixtureA->GetBody()->GetUserData(); + if (userData) + { + bool* touching = (bool*)userData; + *touching = true; + } + } + } + + // Implement contact listener. + void EndContact(b2Contact* contact) + { + b2Fixture* fixtureA = contact->GetFixtureA(); + b2Fixture* fixtureB = contact->GetFixtureB(); + + if (fixtureA == m_sensor) + { + void* userData = fixtureB->GetBody()->GetUserData(); + if (userData) + { + bool* touching = (bool*)userData; + *touching = false; + } + } + + if (fixtureB == m_sensor) + { + void* userData = fixtureA->GetBody()->GetUserData(); + if (userData) + { + bool* touching = (bool*)userData; + *touching = false; + } + } + } + + void Step(Settings* settings) + { + Test::Step(settings); + + // Traverse the contact results. Apply a force on shapes + // that overlap the sensor. + for (int32 i = 0; i < e_count; ++i) + { + if (m_touching[i] == false) + { + continue; + } + + b2Body* body = m_bodies[i]; + b2Body* ground = m_sensor->GetBody(); + + b2CircleShape* circle = (b2CircleShape*)m_sensor->GetShape(); + b2Vec2 center = ground->GetWorldPoint(circle->m_p); + + b2Vec2 position = body->GetPosition(); + + b2Vec2 d = center - position; + if (d.LengthSquared() < FLT_EPSILON * FLT_EPSILON) + { + continue; + } + + d.Normalize(); + b2Vec2 F = 100.0f * d; + body->ApplyForce(F, position); + } + } + + static Test* Create() + { + return new SensorTest; + } + + b2Fixture* m_sensor; + b2Body* m_bodies[e_count]; + bool m_touching[e_count]; +}; + +#endif diff --git a/external/Box2d/Testbed/Tests/ShapeEditing.h b/external/Box2d/Testbed/Tests/ShapeEditing.h new file mode 100755 index 0000000..c900bbc --- /dev/null +++ b/external/Box2d/Testbed/Tests/ShapeEditing.h @@ -0,0 +1,105 @@ +/* +* Copyright (c) 2008-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef SHAPE_EDITING_H +#define SHAPE_EDITING_H + +class ShapeEditing : public Test +{ +public: + + ShapeEditing() + { + { + b2BodyDef bd; + b2Body* ground = m_world->CreateBody(&bd); + + b2EdgeShape shape; + shape.Set(b2Vec2(-40.0f, 0.0f), b2Vec2(40.0f, 0.0f)); + ground->CreateFixture(&shape, 0.0f); + } + + b2BodyDef bd; + bd.type = b2_dynamicBody; + bd.position.Set(0.0f, 10.0f); + m_body = m_world->CreateBody(&bd); + + b2PolygonShape shape; + shape.SetAsBox(4.0f, 4.0f, b2Vec2(0.0f, 0.0f), 0.0f); + m_fixture1 = m_body->CreateFixture(&shape, 10.0f); + + m_fixture2 = NULL; + + m_sensor = false; + } + + void Keyboard(unsigned char key) + { + switch (key) + { + case 'c': + if (m_fixture2 == NULL) + { + b2CircleShape shape; + shape.m_radius = 3.0f; + shape.m_p.Set(0.5f, -4.0f); + m_fixture2 = m_body->CreateFixture(&shape, 10.0f); + m_body->SetAwake(true); + } + break; + + case 'd': + if (m_fixture2 != NULL) + { + m_body->DestroyFixture(m_fixture2); + m_fixture2 = NULL; + m_body->SetAwake(true); + } + break; + + case 's': + if (m_fixture2 != NULL) + { + m_sensor = !m_sensor; + m_fixture2->SetSensor(m_sensor); + } + break; + } + } + + void Step(Settings* settings) + { + Test::Step(settings); + m_debugDraw.DrawString(5, m_textLine, "Press: (c) create a shape, (d) destroy a shape."); + m_textLine += 15; + m_debugDraw.DrawString(5, m_textLine, "sensor = %d", m_sensor); + m_textLine += 15; + } + + static Test* Create() + { + return new ShapeEditing; + } + + b2Body* m_body; + b2Fixture* m_fixture1; + b2Fixture* m_fixture2; + bool m_sensor; +}; + +#endif diff --git a/external/Box2d/Testbed/Tests/SliderCrank.h b/external/Box2d/Testbed/Tests/SliderCrank.h new file mode 100755 index 0000000..52e6e9c --- /dev/null +++ b/external/Box2d/Testbed/Tests/SliderCrank.h @@ -0,0 +1,156 @@ +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef SLIDER_CRANK_H +#define SLIDER_CRANK_H + +// A motor driven slider crank with joint friction. + +class SliderCrank : public Test +{ +public: + SliderCrank() + { + b2Body* ground = NULL; + { + b2BodyDef bd; + ground = m_world->CreateBody(&bd); + + b2EdgeShape shape; + shape.Set(b2Vec2(-40.0f, 0.0f), b2Vec2(40.0f, 0.0f)); + ground->CreateFixture(&shape, 0.0f); + } + + { + b2Body* prevBody = ground; + + // Define crank. + { + b2PolygonShape shape; + shape.SetAsBox(0.5f, 2.0f); + + b2BodyDef bd; + bd.type = b2_dynamicBody; + bd.position.Set(0.0f, 7.0f); + b2Body* body = m_world->CreateBody(&bd); + body->CreateFixture(&shape, 2.0f); + + b2RevoluteJointDef rjd; + rjd.Initialize(prevBody, body, b2Vec2(0.0f, 5.0f)); + rjd.motorSpeed = 1.0f * b2_pi; + rjd.maxMotorTorque = 10000.0f; + rjd.enableMotor = true; + m_joint1 = (b2RevoluteJoint*)m_world->CreateJoint(&rjd); + + prevBody = body; + } + + // Define follower. + { + b2PolygonShape shape; + shape.SetAsBox(0.5f, 4.0f); + + b2BodyDef bd; + bd.type = b2_dynamicBody; + bd.position.Set(0.0f, 13.0f); + b2Body* body = m_world->CreateBody(&bd); + body->CreateFixture(&shape, 2.0f); + + b2RevoluteJointDef rjd; + rjd.Initialize(prevBody, body, b2Vec2(0.0f, 9.0f)); + rjd.enableMotor = false; + m_world->CreateJoint(&rjd); + + prevBody = body; + } + + // Define piston + { + b2PolygonShape shape; + shape.SetAsBox(1.5f, 1.5f); + + b2BodyDef bd; + bd.type = b2_dynamicBody; + bd.fixedRotation = true; + bd.position.Set(0.0f, 17.0f); + b2Body* body = m_world->CreateBody(&bd); + body->CreateFixture(&shape, 2.0f); + + b2RevoluteJointDef rjd; + rjd.Initialize(prevBody, body, b2Vec2(0.0f, 17.0f)); + m_world->CreateJoint(&rjd); + + b2PrismaticJointDef pjd; + pjd.Initialize(ground, body, b2Vec2(0.0f, 17.0f), b2Vec2(0.0f, 1.0f)); + + pjd.maxMotorForce = 1000.0f; + pjd.enableMotor = true; + + m_joint2 = (b2PrismaticJoint*)m_world->CreateJoint(&pjd); + } + + // Create a payload + { + b2PolygonShape shape; + shape.SetAsBox(1.5f, 1.5f); + + b2BodyDef bd; + bd.type = b2_dynamicBody; + bd.position.Set(0.0f, 23.0f); + b2Body* body = m_world->CreateBody(&bd); + body->CreateFixture(&shape, 2.0f); + } + } + } + + void Keyboard(unsigned char key) + { + switch (key) + { + case 'f': + m_joint2->EnableMotor(!m_joint2->IsMotorEnabled()); + m_joint2->GetBodyB()->SetAwake(true); + break; + + case 'm': + m_joint1->EnableMotor(!m_joint1->IsMotorEnabled()); + m_joint1->GetBodyB()->SetAwake(true); + break; + } + } + + void Step(Settings* settings) + { + Test::Step(settings); + m_debugDraw.DrawString(5, m_textLine, "Keys: (f) toggle friction, (m) toggle motor"); + m_textLine += 15; + float32 torque = m_joint1->GetMotorTorque(settings->hz); + m_debugDraw.DrawString(5, m_textLine, "Motor Torque = %5.0f", (float) torque); + m_textLine += 15; + } + + static Test* Create() + { + return new SliderCrank; + } + + b2RevoluteJoint* m_joint1; + b2PrismaticJoint* m_joint2; +}; + +#endif diff --git a/external/Box2d/Testbed/Tests/SphereStack.h b/external/Box2d/Testbed/Tests/SphereStack.h new file mode 100755 index 0000000..22485c6 --- /dev/null +++ b/external/Box2d/Testbed/Tests/SphereStack.h @@ -0,0 +1,86 @@ +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef SPHERE_STACK_H +#define SPHERE_STACK_H + +class SphereStack : public Test +{ +public: + + enum + { + e_count = 10 + }; + + SphereStack() + { + { + b2BodyDef bd; + b2Body* ground = m_world->CreateBody(&bd); + + b2EdgeShape shape; + shape.Set(b2Vec2(-40.0f, 0.0f), b2Vec2(40.0f, 0.0f)); + ground->CreateFixture(&shape, 0.0f); + } + + { + b2CircleShape shape; + shape.m_radius = 1.0f; + + for (int32 i = 0; i < e_count; ++i) + { + b2BodyDef bd; + bd.type = b2_dynamicBody; + bd.position.Set(0.0, 4.0f + 3.0f * i); + + m_bodies[i] = m_world->CreateBody(&bd); + + m_bodies[i]->CreateFixture(&shape, 1.0f); + + m_bodies[i]->SetLinearVelocity(b2Vec2(0.0f, -50.0f)); + } + } + } + + void Step(Settings* settings) + { + Test::Step(settings); + + //for (int32 i = 0; i < e_count; ++i) + //{ + // printf("%g ", m_bodies[i]->GetWorldCenter().y); + //} + + //for (int32 i = 0; i < e_count; ++i) + //{ + // printf("%g ", m_bodies[i]->GetLinearVelocity().y); + //} + + //printf("\n"); + } + + static Test* Create() + { + return new SphereStack; + } + + b2Body* m_bodies[e_count]; +}; + +#endif diff --git a/external/Box2d/Testbed/Tests/TestEntries.cpp b/external/Box2d/Testbed/Tests/TestEntries.cpp new file mode 100755 index 0000000..0315a60 --- /dev/null +++ b/external/Box2d/Testbed/Tests/TestEntries.cpp @@ -0,0 +1,115 @@ +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#include "../Framework/Test.h" +#include "../Framework/Render.h" +#include "../../freeglut/GL/glut.h" +#include +using namespace std; + +#include "AddPair.h" +#include "ApplyForce.h" +#include "BodyTypes.h" +#include "Breakable.h" +#include "Bridge.h" +#include "BulletTest.h" +#include "Cantilever.h" +#include "Car.h" +#include "ContinuousTest.h" +#include "Chain.h" +#include "CharacterCollision.h" +#include "CollisionFiltering.h" +#include "CollisionProcessing.h" +#include "CompoundShapes.h" +#include "Confined.h" +#include "DistanceTest.h" +#include "Dominos.h" +#include "DynamicTreeTest.h" +#include "EdgeShapes.h" +#include "EdgeTest.h" +#include "Gears.h" +#include "OneSidedPlatform.h" +#include "Pinball.h" +#include "PolyCollision.h" +#include "PolyShapes.h" +#include "Prismatic.h" +#include "Pulleys.h" +#include "Pyramid.h" +#include "RayCast.h" +#include "Revolute.h" +//#include "Rope.h" +#include "RopeJoint.h" +#include "SensorTest.h" +#include "ShapeEditing.h" +#include "SliderCrank.h" +#include "SphereStack.h" +#include "TheoJansen.h" +#include "Tiles.h" +#include "TimeOfImpact.h" +#include "VaryingFriction.h" +#include "VaryingRestitution.h" +#include "VerticalStack.h" +#include "Web.h" + +TestEntry g_testEntries[] = +{ + {"Gears", Gears::Create}, + {"Character Collision", CharacterCollision::Create}, + {"Edge Test", EdgeTest::Create}, + {"Body Types", BodyTypes::Create}, + {"Shape Editing", ShapeEditing::Create}, + {"Tiles", Tiles::Create}, + {"Car", Car::Create}, + {"Apply Force", ApplyForce::Create}, + {"Prismatic", Prismatic::Create}, + {"Vertical Stack", VerticalStack::Create}, + {"SphereStack", SphereStack::Create}, + {"Revolute", Revolute::Create}, + {"Pulleys", Pulleys::Create}, + {"Polygon Shapes", PolyShapes::Create}, + //{"Rope", Rope::Create}, + {"Web", Web::Create}, + {"RopeJoint", RopeJoint::Create}, + {"One-Sided Platform", OneSidedPlatform::Create}, + {"Pinball", Pinball::Create}, + {"Bullet Test", BulletTest::Create}, + {"Continuous Test", ContinuousTest::Create}, + {"Time of Impact", TimeOfImpact::Create}, + {"Ray-Cast", RayCast::Create}, + {"Confined", Confined::Create}, + {"Pyramid", Pyramid::Create}, + {"Varying Restitution", VaryingRestitution::Create}, + {"Theo Jansen's Walker", TheoJansen::Create}, + {"Edge Shapes", EdgeShapes::Create}, + {"PolyCollision", PolyCollision::Create}, + {"Cantilever", Cantilever::Create}, + {"Bridge", Bridge::Create}, + {"Breakable", Breakable::Create}, + {"Chain", Chain::Create}, + {"Collision Filtering", CollisionFiltering::Create}, + {"Collision Processing", CollisionProcessing::Create}, + {"Compound Shapes", CompoundShapes::Create}, + {"Distance Test", DistanceTest::Create}, + {"Dominos", Dominos::Create}, + {"Dynamic Tree", DynamicTreeTest::Create}, + {"Sensor Test", SensorTest::Create}, + {"Slider Crank", SliderCrank::Create}, + {"Varying Friction", VaryingFriction::Create}, + {"Add Pair Stress Test", AddPair::Create}, + {NULL, NULL} +}; diff --git a/external/Box2d/Testbed/Tests/TheoJansen.h b/external/Box2d/Testbed/Tests/TheoJansen.h new file mode 100755 index 0000000..c988f97 --- /dev/null +++ b/external/Box2d/Testbed/Tests/TheoJansen.h @@ -0,0 +1,256 @@ +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +// Inspired by a contribution by roman_m +// Dimensions scooped from APE (http://www.cove.org/ape/index.htm) + +#ifndef THEO_JANSEN_H +#define THEO_JANSEN_H + +class TheoJansen : public Test +{ +public: + + void CreateLeg(float32 s, const b2Vec2& wheelAnchor) + { + b2Vec2 p1(5.4f * s, -6.1f); + b2Vec2 p2(7.2f * s, -1.2f); + b2Vec2 p3(4.3f * s, -1.9f); + b2Vec2 p4(3.1f * s, 0.8f); + b2Vec2 p5(6.0f * s, 1.5f); + b2Vec2 p6(2.5f * s, 3.7f); + + b2FixtureDef fd1, fd2; + fd1.filter.groupIndex = -1; + fd2.filter.groupIndex = -1; + fd1.density = 1.0f; + fd2.density = 1.0f; + + b2PolygonShape poly1, poly2; + + if (s > 0.0f) + { + b2Vec2 vertices[3]; + + vertices[0] = p1; + vertices[1] = p2; + vertices[2] = p3; + poly1.Set(vertices, 3); + + vertices[0] = b2Vec2_zero; + vertices[1] = p5 - p4; + vertices[2] = p6 - p4; + poly2.Set(vertices, 3); + } + else + { + b2Vec2 vertices[3]; + + vertices[0] = p1; + vertices[1] = p3; + vertices[2] = p2; + poly1.Set(vertices, 3); + + vertices[0] = b2Vec2_zero; + vertices[1] = p6 - p4; + vertices[2] = p5 - p4; + poly2.Set(vertices, 3); + } + + fd1.shape = &poly1; + fd2.shape = &poly2; + + b2BodyDef bd1, bd2; + bd1.type = b2_dynamicBody; + bd2.type = b2_dynamicBody; + bd1.position = m_offset; + bd2.position = p4 + m_offset; + + bd1.angularDamping = 10.0f; + bd2.angularDamping = 10.0f; + + b2Body* body1 = m_world->CreateBody(&bd1); + b2Body* body2 = m_world->CreateBody(&bd2); + + body1->CreateFixture(&fd1); + body2->CreateFixture(&fd2); + + b2DistanceJointDef djd; + + // Using a soft distance constraint can reduce some jitter. + // It also makes the structure seem a bit more fluid by + // acting like a suspension system. + djd.dampingRatio = 0.5f; + djd.frequencyHz = 10.0f; + + djd.Initialize(body1, body2, p2 + m_offset, p5 + m_offset); + m_world->CreateJoint(&djd); + + djd.Initialize(body1, body2, p3 + m_offset, p4 + m_offset); + m_world->CreateJoint(&djd); + + djd.Initialize(body1, m_wheel, p3 + m_offset, wheelAnchor + m_offset); + m_world->CreateJoint(&djd); + + djd.Initialize(body2, m_wheel, p6 + m_offset, wheelAnchor + m_offset); + m_world->CreateJoint(&djd); + + b2RevoluteJointDef rjd; + + rjd.Initialize(body2, m_chassis, p4 + m_offset); + m_world->CreateJoint(&rjd); + } + + TheoJansen() + { + m_offset.Set(0.0f, 8.0f); + m_motorSpeed = 2.0f; + m_motorOn = true; + b2Vec2 pivot(0.0f, 0.8f); + + // Ground + { + b2BodyDef bd; + b2Body* ground = m_world->CreateBody(&bd); + + b2EdgeShape shape; + shape.Set(b2Vec2(-50.0f, 0.0f), b2Vec2(50.0f, 0.0f)); + ground->CreateFixture(&shape, 0.0f); + + shape.Set(b2Vec2(-50.0f, 0.0f), b2Vec2(-50.0f, 10.0f)); + ground->CreateFixture(&shape, 0.0f); + + shape.Set(b2Vec2(50.0f, 0.0f), b2Vec2(50.0f, 10.0f)); + ground->CreateFixture(&shape, 0.0f); + } + + // Balls + for (int32 i = 0; i < 40; ++i) + { + b2CircleShape shape; + shape.m_radius = 0.25f; + + b2BodyDef bd; + bd.type = b2_dynamicBody; + bd.position.Set(-40.0f + 2.0f * i, 0.5f); + + b2Body* body = m_world->CreateBody(&bd); + body->CreateFixture(&shape, 1.0f); + } + + // Chassis + { + b2PolygonShape shape; + shape.SetAsBox(2.5f, 1.0f); + + b2FixtureDef sd; + sd.density = 1.0f; + sd.shape = &shape; + sd.filter.groupIndex = -1; + b2BodyDef bd; + bd.type = b2_dynamicBody; + bd.position = pivot + m_offset; + m_chassis = m_world->CreateBody(&bd); + m_chassis->CreateFixture(&sd); + } + + { + b2CircleShape shape; + shape.m_radius = 1.6f; + + b2FixtureDef sd; + sd.density = 1.0f; + sd.shape = &shape; + sd.filter.groupIndex = -1; + b2BodyDef bd; + bd.type = b2_dynamicBody; + bd.position = pivot + m_offset; + m_wheel = m_world->CreateBody(&bd); + m_wheel->CreateFixture(&sd); + } + + { + b2RevoluteJointDef jd; + jd.Initialize(m_wheel, m_chassis, pivot + m_offset); + jd.collideConnected = false; + jd.motorSpeed = m_motorSpeed; + jd.maxMotorTorque = 400.0f; + jd.enableMotor = m_motorOn; + m_motorJoint = (b2RevoluteJoint*)m_world->CreateJoint(&jd); + } + + b2Vec2 wheelAnchor; + + wheelAnchor = pivot + b2Vec2(0.0f, -0.8f); + + CreateLeg(-1.0f, wheelAnchor); + CreateLeg(1.0f, wheelAnchor); + + m_wheel->SetTransform(m_wheel->GetPosition(), 120.0f * b2_pi / 180.0f); + CreateLeg(-1.0f, wheelAnchor); + CreateLeg(1.0f, wheelAnchor); + + m_wheel->SetTransform(m_wheel->GetPosition(), -120.0f * b2_pi / 180.0f); + CreateLeg(-1.0f, wheelAnchor); + CreateLeg(1.0f, wheelAnchor); + } + + void Step(Settings* settings) + { + m_debugDraw.DrawString(5, m_textLine, "Keys: left = a, brake = s, right = d, toggle motor = m"); + m_textLine += 15; + + Test::Step(settings); + } + + void Keyboard(unsigned char key) + { + switch (key) + { + case 'a': + m_motorJoint->SetMotorSpeed(-m_motorSpeed); + break; + + case 's': + m_motorJoint->SetMotorSpeed(0.0f); + break; + + case 'd': + m_motorJoint->SetMotorSpeed(m_motorSpeed); + break; + + case 'm': + m_motorJoint->EnableMotor(!m_motorJoint->IsMotorEnabled()); + break; + } + } + + static Test* Create() + { + return new TheoJansen; + } + + b2Vec2 m_offset; + b2Body* m_chassis; + b2Body* m_wheel; + b2RevoluteJoint* m_motorJoint; + bool m_motorOn; + float32 m_motorSpeed; +}; + +#endif // THEO_JANSEN_H diff --git a/external/Box2d/Testbed/Tests/Tiles.h b/external/Box2d/Testbed/Tests/Tiles.h new file mode 100755 index 0000000..a437961 --- /dev/null +++ b/external/Box2d/Testbed/Tests/Tiles.h @@ -0,0 +1,156 @@ +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef TILES_H +#define TILES_H + +/// This stress tests the dynamic tree broad-phase. This also shows that tile +/// based collision is _not_ smooth due to Box2D not knowing about adjacency. +class Tiles : public Test +{ +public: + enum + { + e_count = 20 + }; + + Tiles() + { + m_fixtureCount = 0; + b2Timer timer; + + { + float32 a = 0.5f; + b2BodyDef bd; + bd.position.y = -a; + b2Body* ground = m_world->CreateBody(&bd); + +#if 1 + int32 N = 200; + int32 M = 10; + b2Vec2 position; + position.y = 0.0f; + for (int32 j = 0; j < M; ++j) + { + position.x = -N * a; + for (int32 i = 0; i < N; ++i) + { + b2PolygonShape shape; + shape.SetAsBox(a, a, position, 0.0f); + ground->CreateFixture(&shape, 0.0f); + ++m_fixtureCount; + position.x += 2.0f * a; + } + position.y -= 2.0f * a; + } +#else + int32 N = 200; + int32 M = 10; + b2Vec2 position; + position.x = -N * a; + for (int32 i = 0; i < N; ++i) + { + position.y = 0.0f; + for (int32 j = 0; j < M; ++j) + { + b2PolygonShape shape; + shape.SetAsBox(a, a, position, 0.0f); + ground->CreateFixture(&shape, 0.0f); + position.y -= 2.0f * a; + } + position.x += 2.0f * a; + } +#endif + } + + { + float32 a = 0.5f; + b2PolygonShape shape; + shape.SetAsBox(a, a); + + b2Vec2 x(-7.0f, 0.75f); + b2Vec2 y; + b2Vec2 deltaX(0.5625f, 1.25f); + b2Vec2 deltaY(1.125f, 0.0f); + + for (int32 i = 0; i < e_count; ++i) + { + y = x; + + for (int32 j = i; j < e_count; ++j) + { + b2BodyDef bd; + bd.type = b2_dynamicBody; + bd.position = y; + + //if (i == 0 && j == 0) + //{ + // bd.allowSleep = false; + //} + //else + //{ + // bd.allowSleep = true; + //} + + b2Body* body = m_world->CreateBody(&bd); + body->CreateFixture(&shape, 5.0f); + ++m_fixtureCount; + y += deltaY; + } + + x += deltaX; + } + } + + m_createTime = timer.GetMilliseconds(); + } + + void Step(Settings* settings) + { + const b2ContactManager& cm = m_world->GetContactManager(); + int32 height = cm.m_broadPhase.GetTreeHeight(); + int32 leafCount = cm.m_broadPhase.GetProxyCount(); + int32 minimumNodeCount = 2 * leafCount - 1; + float32 minimumHeight = ceilf(logf(float32(minimumNodeCount)) / logf(2.0f)); + m_debugDraw.DrawString(5, m_textLine, "dynamic tree height = %d, min = %d", height, int32(minimumHeight)); + m_textLine += 15; + + Test::Step(settings); + + m_debugDraw.DrawString(5, m_textLine, "create time = %6.2f ms, fixture count = %d", + m_createTime, m_fixtureCount); + m_textLine += 15; + + //b2DynamicTree* tree = &m_world->m_contactManager.m_broadPhase.m_tree; + + //if (m_stepCount == 400) + //{ + // tree->RebuildBottomUp(); + //} + } + + static Test* Create() + { + return new Tiles; + } + + int32 m_fixtureCount; + float32 m_createTime; +}; + +#endif diff --git a/external/Box2d/Testbed/Tests/TimeOfImpact.h b/external/Box2d/Testbed/Tests/TimeOfImpact.h new file mode 100755 index 0000000..9e5541e --- /dev/null +++ b/external/Box2d/Testbed/Tests/TimeOfImpact.h @@ -0,0 +1,131 @@ +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef TIME_OF_IMPACT_H +#define TIME_OF_IMPACT_H + +class TimeOfImpact : public Test +{ +public: + TimeOfImpact() + { + m_shapeA.SetAsBox(25.0f, 5.0f); + m_shapeB.SetAsBox(2.5f, 2.5f); + } + + static Test* Create() + { + return new TimeOfImpact; + } + + void Step(Settings* settings) + { + Test::Step(settings); + + b2Sweep sweepA; + sweepA.c0.Set(24.0f, -60.0f); + sweepA.a0 = 2.95f; + sweepA.c = sweepA.c0; + sweepA.a = sweepA.a0; + sweepA.localCenter.SetZero(); + + b2Sweep sweepB; + sweepB.c0.Set(53.474274f, -50.252514f); + sweepB.a0 = 513.36676f; // - 162.0f * b2_pi; + sweepB.c.Set(54.595478f, -51.083473f); + sweepB.a = 513.62781f; // - 162.0f * b2_pi; + sweepB.localCenter.SetZero(); + + //sweepB.a0 -= 300.0f * b2_pi; + //sweepB.a -= 300.0f * b2_pi; + + b2TOIInput input; + input.proxyA.Set(&m_shapeA, 0); + input.proxyB.Set(&m_shapeB, 0); + input.sweepA = sweepA; + input.sweepB = sweepB; + input.tMax = 1.0f; + + b2TOIOutput output; + + b2TimeOfImpact(&output, &input); + + m_debugDraw.DrawString(5, m_textLine, "toi = %g", output.t); + m_textLine += 15; + + extern int32 b2_toiMaxIters, b2_toiMaxRootIters; + m_debugDraw.DrawString(5, m_textLine, "max toi iters = %d, max root iters = %d", b2_toiMaxIters, b2_toiMaxRootIters); + m_textLine += 15; + + b2Vec2 vertices[b2_maxPolygonVertices]; + + b2Transform transformA; + sweepA.GetTransform(&transformA, 0.0f); + for (int32 i = 0; i < m_shapeA.m_vertexCount; ++i) + { + vertices[i] = b2Mul(transformA, m_shapeA.m_vertices[i]); + } + m_debugDraw.DrawPolygon(vertices, m_shapeA.m_vertexCount, b2Color(0.9f, 0.9f, 0.9f)); + + b2Transform transformB; + sweepB.GetTransform(&transformB, 0.0f); + + b2Vec2 localPoint(2.0f, -0.1f); + b2Vec2 rB = b2Mul(transformB, localPoint) - sweepB.c0; + float32 wB = sweepB.a - sweepB.a0; + b2Vec2 vB = sweepB.c - sweepB.c0; + b2Vec2 v = vB + b2Cross(wB, rB); + + for (int32 i = 0; i < m_shapeB.m_vertexCount; ++i) + { + vertices[i] = b2Mul(transformB, m_shapeB.m_vertices[i]); + } + m_debugDraw.DrawPolygon(vertices, m_shapeB.m_vertexCount, b2Color(0.5f, 0.9f, 0.5f)); + + sweepB.GetTransform(&transformB, output.t); + for (int32 i = 0; i < m_shapeB.m_vertexCount; ++i) + { + vertices[i] = b2Mul(transformB, m_shapeB.m_vertices[i]); + } + m_debugDraw.DrawPolygon(vertices, m_shapeB.m_vertexCount, b2Color(0.5f, 0.7f, 0.9f)); + + sweepB.GetTransform(&transformB, 1.0f); + for (int32 i = 0; i < m_shapeB.m_vertexCount; ++i) + { + vertices[i] = b2Mul(transformB, m_shapeB.m_vertices[i]); + } + m_debugDraw.DrawPolygon(vertices, m_shapeB.m_vertexCount, b2Color(0.9f, 0.5f, 0.5f)); + +#if 0 + for (float32 t = 0.0f; t < 1.0f; t += 0.1f) + { + sweepB.GetTransform(&transformB, t); + for (int32 i = 0; i < m_shapeB.m_vertexCount; ++i) + { + vertices[i] = b2Mul(transformB, m_shapeB.m_vertices[i]); + } + m_debugDraw.DrawPolygon(vertices, m_shapeB.m_vertexCount, b2Color(0.9f, 0.5f, 0.5f)); + } +#endif + } + + b2PolygonShape m_shapeA; + b2PolygonShape m_shapeB; +}; + +#endif diff --git a/external/Box2d/Testbed/Tests/VaryingFriction.h b/external/Box2d/Testbed/Tests/VaryingFriction.h new file mode 100755 index 0000000..a28354a --- /dev/null +++ b/external/Box2d/Testbed/Tests/VaryingFriction.h @@ -0,0 +1,124 @@ +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef VARYING_FRICTION_H +#define VARYING_FRICTION_H + +class VaryingFriction : public Test +{ +public: + + VaryingFriction() + { + { + b2BodyDef bd; + b2Body* ground = m_world->CreateBody(&bd); + + b2EdgeShape shape; + shape.Set(b2Vec2(-40.0f, 0.0f), b2Vec2(40.0f, 0.0f)); + ground->CreateFixture(&shape, 0.0f); + } + + { + b2PolygonShape shape; + shape.SetAsBox(13.0f, 0.25f); + + b2BodyDef bd; + bd.position.Set(-4.0f, 22.0f); + bd.angle = -0.25f; + + b2Body* ground = m_world->CreateBody(&bd); + ground->CreateFixture(&shape, 0.0f); + } + + { + b2PolygonShape shape; + shape.SetAsBox(0.25f, 1.0f); + + b2BodyDef bd; + bd.position.Set(10.5f, 19.0f); + + b2Body* ground = m_world->CreateBody(&bd); + ground->CreateFixture(&shape, 0.0f); + } + + { + b2PolygonShape shape; + shape.SetAsBox(13.0f, 0.25f); + + b2BodyDef bd; + bd.position.Set(4.0f, 14.0f); + bd.angle = 0.25f; + + b2Body* ground = m_world->CreateBody(&bd); + ground->CreateFixture(&shape, 0.0f); + } + + { + b2PolygonShape shape; + shape.SetAsBox(0.25f, 1.0f); + + b2BodyDef bd; + bd.position.Set(-10.5f, 11.0f); + + b2Body* ground = m_world->CreateBody(&bd); + ground->CreateFixture(&shape, 0.0f); + } + + { + b2PolygonShape shape; + shape.SetAsBox(13.0f, 0.25f); + + b2BodyDef bd; + bd.position.Set(-4.0f, 6.0f); + bd.angle = -0.25f; + + b2Body* ground = m_world->CreateBody(&bd); + ground->CreateFixture(&shape, 0.0f); + } + + { + b2PolygonShape shape; + shape.SetAsBox(0.5f, 0.5f); + + b2FixtureDef fd; + fd.shape = &shape; + fd.density = 25.0f; + + float friction[5] = {0.75f, 0.5f, 0.35f, 0.1f, 0.0f}; + + for (int i = 0; i < 5; ++i) + { + b2BodyDef bd; + bd.type = b2_dynamicBody; + bd.position.Set(-15.0f + 4.0f * i, 28.0f); + b2Body* body = m_world->CreateBody(&bd); + + fd.friction = friction[i]; + body->CreateFixture(&fd); + } + } + } + + static Test* Create() + { + return new VaryingFriction; + } +}; + +#endif diff --git a/external/Box2d/Testbed/Tests/VaryingRestitution.h b/external/Box2d/Testbed/Tests/VaryingRestitution.h new file mode 100755 index 0000000..8a1bed6 --- /dev/null +++ b/external/Box2d/Testbed/Tests/VaryingRestitution.h @@ -0,0 +1,69 @@ +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef VARYING_RESTITUTION_H +#define VARYING_RESTITUTION_H + +// Note: even with a restitution of 1.0, there is some energy change +// due to position correction. +class VaryingRestitution : public Test +{ +public: + + VaryingRestitution() + { + { + b2BodyDef bd; + b2Body* ground = m_world->CreateBody(&bd); + + b2EdgeShape shape; + shape.Set(b2Vec2(-40.0f, 0.0f), b2Vec2(40.0f, 0.0f)); + ground->CreateFixture(&shape, 0.0f); + } + + { + b2CircleShape shape; + shape.m_radius = 1.0f; + + b2FixtureDef fd; + fd.shape = &shape; + fd.density = 1.0f; + + float32 restitution[7] = {0.0f, 0.1f, 0.3f, 0.5f, 0.75f, 0.9f, 1.0f}; + + for (int32 i = 0; i < 7; ++i) + { + b2BodyDef bd; + bd.type = b2_dynamicBody; + bd.position.Set(-10.0f + 3.0f * i, 20.0f); + + b2Body* body = m_world->CreateBody(&bd); + + fd.restitution = restitution[i]; + body->CreateFixture(&fd); + } + } + } + + static Test* Create() + { + return new VaryingRestitution; + } +}; + +#endif diff --git a/external/Box2d/Testbed/Tests/VerticalStack.h b/external/Box2d/Testbed/Tests/VerticalStack.h new file mode 100755 index 0000000..7d545e2 --- /dev/null +++ b/external/Box2d/Testbed/Tests/VerticalStack.h @@ -0,0 +1,165 @@ +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef VERTICAL_STACK_H +#define VERTICAL_STACK_H + +class VerticalStack : public Test +{ +public: + + enum + { + e_columnCount = 5, + e_rowCount = 16 + //e_columnCount = 1, + //e_rowCount = 1 + }; + + VerticalStack() + { + { + b2BodyDef bd; + b2Body* ground = m_world->CreateBody(&bd); + + b2EdgeShape shape; + shape.Set(b2Vec2(-40.0f, 0.0f), b2Vec2(40.0f, 0.0f)); + ground->CreateFixture(&shape, 0.0f); + + shape.Set(b2Vec2(20.0f, 0.0f), b2Vec2(20.0f, 20.0f)); + ground->CreateFixture(&shape, 0.0f); + } + + float32 xs[5] = {0.0f, -10.0f, -5.0f, 5.0f, 10.0f}; + + for (int32 j = 0; j < e_columnCount; ++j) + { + b2PolygonShape shape; + shape.SetAsBox(0.5f, 0.5f); + + b2FixtureDef fd; + fd.shape = &shape; + fd.density = 1.0f; + fd.friction = 0.3f; + + for (int i = 0; i < e_rowCount; ++i) + { + b2BodyDef bd; + bd.type = b2_dynamicBody; + + int32 n = j * e_rowCount + i; + b2Assert(n < e_rowCount * e_columnCount); + m_indices[n] = n; + bd.userData = m_indices + n; + + float32 x = 0.0f; + //float32 x = RandomFloat(-0.02f, 0.02f); + //float32 x = i % 2 == 0 ? -0.025f : 0.025f; + bd.position.Set(xs[j] + x, 0.752f + 1.54f * i); + b2Body* body = m_world->CreateBody(&bd); + + m_bodies[n] = body; + + body->CreateFixture(&fd); + } + } + + m_bullet = NULL; + } + + void Keyboard(unsigned char key) + { + switch (key) + { + case ',': + if (m_bullet != NULL) + { + m_world->DestroyBody(m_bullet); + m_bullet = NULL; + } + + { + b2CircleShape shape; + shape.m_radius = 0.25f; + + b2FixtureDef fd; + fd.shape = &shape; + fd.density = 20.0f; + fd.restitution = 0.05f; + + b2BodyDef bd; + bd.type = b2_dynamicBody; + bd.bullet = true; + bd.position.Set(-31.0f, 5.0f); + + m_bullet = m_world->CreateBody(&bd); + m_bullet->CreateFixture(&fd); + + m_bullet->SetLinearVelocity(b2Vec2(400.0f, 0.0f)); + } + break; + } + } + + void Step(Settings* settings) + { + Test::Step(settings); + m_debugDraw.DrawString(5, m_textLine, "Press: (,) to launch a bullet."); + m_textLine += 15; + + //if (m_stepCount == 300) + //{ + // if (m_bullet != NULL) + // { + // m_world->DestroyBody(m_bullet); + // m_bullet = NULL; + // } + + // { + // b2CircleShape shape; + // shape.m_radius = 0.25f; + + // b2FixtureDef fd; + // fd.shape = &shape; + // fd.density = 20.0f; + // fd.restitution = 0.05f; + + // b2BodyDef bd; + // bd.type = b2_dynamicBody; + // bd.bullet = true; + // bd.position.Set(-31.0f, 5.0f); + + // m_bullet = m_world->CreateBody(&bd); + // m_bullet->CreateFixture(&fd); + + // m_bullet->SetLinearVelocity(b2Vec2(400.0f, 0.0f)); + // } + //} + } + + static Test* Create() + { + return new VerticalStack; + } + + b2Body* m_bullet; + b2Body* m_bodies[e_rowCount * e_columnCount]; + int32 m_indices[e_rowCount * e_columnCount]; +}; + +#endif diff --git a/external/Box2d/Testbed/Tests/Web.h b/external/Box2d/Testbed/Tests/Web.h new file mode 100755 index 0000000..9ed279e --- /dev/null +++ b/external/Box2d/Testbed/Tests/Web.h @@ -0,0 +1,209 @@ +/* +* Copyright (c) 2006-2009 Erin Catto http://www.box2d.org +* +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef WEB_H +#define WEB_H + +// This tests distance joints, body destruction, and joint destruction. +class Web : public Test +{ +public: + Web() + { + b2Body* ground = NULL; + { + b2BodyDef bd; + ground = m_world->CreateBody(&bd); + + b2EdgeShape shape; + shape.Set(b2Vec2(-40.0f, 0.0f), b2Vec2(40.0f, 0.0f)); + ground->CreateFixture(&shape, 0.0f); + } + + { + b2PolygonShape shape; + shape.SetAsBox(0.5f, 0.5f); + + b2BodyDef bd; + bd.type = b2_dynamicBody; + + bd.position.Set(-5.0f, 5.0f); + m_bodies[0] = m_world->CreateBody(&bd); + m_bodies[0]->CreateFixture(&shape, 5.0f); + + bd.position.Set(5.0f, 5.0f); + m_bodies[1] = m_world->CreateBody(&bd); + m_bodies[1]->CreateFixture(&shape, 5.0f); + + bd.position.Set(5.0f, 15.0f); + m_bodies[2] = m_world->CreateBody(&bd); + m_bodies[2]->CreateFixture(&shape, 5.0f); + + bd.position.Set(-5.0f, 15.0f); + m_bodies[3] = m_world->CreateBody(&bd); + m_bodies[3]->CreateFixture(&shape, 5.0f); + + b2DistanceJointDef jd; + b2Vec2 p1, p2, d; + + jd.frequencyHz = 2.0f; + jd.dampingRatio = 0.0f; + + jd.bodyA = ground; + jd.bodyB = m_bodies[0]; + jd.localAnchorA.Set(-10.0f, 0.0f); + jd.localAnchorB.Set(-0.5f, -0.5f); + p1 = jd.bodyA->GetWorldPoint(jd.localAnchorA); + p2 = jd.bodyB->GetWorldPoint(jd.localAnchorB); + d = p2 - p1; + jd.length = d.Length(); + m_joints[0] = m_world->CreateJoint(&jd); + + jd.bodyA = ground; + jd.bodyB = m_bodies[1]; + jd.localAnchorA.Set(10.0f, 0.0f); + jd.localAnchorB.Set(0.5f, -0.5f); + p1 = jd.bodyA->GetWorldPoint(jd.localAnchorA); + p2 = jd.bodyB->GetWorldPoint(jd.localAnchorB); + d = p2 - p1; + jd.length = d.Length(); + m_joints[1] = m_world->CreateJoint(&jd); + + jd.bodyA = ground; + jd.bodyB = m_bodies[2]; + jd.localAnchorA.Set(10.0f, 20.0f); + jd.localAnchorB.Set(0.5f, 0.5f); + p1 = jd.bodyA->GetWorldPoint(jd.localAnchorA); + p2 = jd.bodyB->GetWorldPoint(jd.localAnchorB); + d = p2 - p1; + jd.length = d.Length(); + m_joints[2] = m_world->CreateJoint(&jd); + + jd.bodyA = ground; + jd.bodyB = m_bodies[3]; + jd.localAnchorA.Set(-10.0f, 20.0f); + jd.localAnchorB.Set(-0.5f, 0.5f); + p1 = jd.bodyA->GetWorldPoint(jd.localAnchorA); + p2 = jd.bodyB->GetWorldPoint(jd.localAnchorB); + d = p2 - p1; + jd.length = d.Length(); + m_joints[3] = m_world->CreateJoint(&jd); + + jd.bodyA = m_bodies[0]; + jd.bodyB = m_bodies[1]; + jd.localAnchorA.Set(0.5f, 0.0f); + jd.localAnchorB.Set(-0.5f, 0.0f);; + p1 = jd.bodyA->GetWorldPoint(jd.localAnchorA); + p2 = jd.bodyB->GetWorldPoint(jd.localAnchorB); + d = p2 - p1; + jd.length = d.Length(); + m_joints[4] = m_world->CreateJoint(&jd); + + jd.bodyA = m_bodies[1]; + jd.bodyB = m_bodies[2]; + jd.localAnchorA.Set(0.0f, 0.5f); + jd.localAnchorB.Set(0.0f, -0.5f); + p1 = jd.bodyA->GetWorldPoint(jd.localAnchorA); + p2 = jd.bodyB->GetWorldPoint(jd.localAnchorB); + d = p2 - p1; + jd.length = d.Length(); + m_joints[5] = m_world->CreateJoint(&jd); + + jd.bodyA = m_bodies[2]; + jd.bodyB = m_bodies[3]; + jd.localAnchorA.Set(-0.5f, 0.0f); + jd.localAnchorB.Set(0.5f, 0.0f); + p1 = jd.bodyA->GetWorldPoint(jd.localAnchorA); + p2 = jd.bodyB->GetWorldPoint(jd.localAnchorB); + d = p2 - p1; + jd.length = d.Length(); + m_joints[6] = m_world->CreateJoint(&jd); + + jd.bodyA = m_bodies[3]; + jd.bodyB = m_bodies[0]; + jd.localAnchorA.Set(0.0f, -0.5f); + jd.localAnchorB.Set(0.0f, 0.5f); + p1 = jd.bodyA->GetWorldPoint(jd.localAnchorA); + p2 = jd.bodyB->GetWorldPoint(jd.localAnchorB); + d = p2 - p1; + jd.length = d.Length(); + m_joints[7] = m_world->CreateJoint(&jd); + } + } + + void Keyboard(unsigned char key) + { + switch (key) + { + case 'b': + for (int32 i = 0; i < 4; ++i) + { + if (m_bodies[i]) + { + m_world->DestroyBody(m_bodies[i]); + m_bodies[i] = NULL; + break; + } + } + break; + + case 'j': + for (int32 i = 0; i < 8; ++i) + { + if (m_joints[i]) + { + m_world->DestroyJoint(m_joints[i]); + m_joints[i] = NULL; + break; + } + } + break; + } + } + + void Step(Settings* settings) + { + Test::Step(settings); + m_debugDraw.DrawString(5, m_textLine, "This demonstrates a soft distance joint."); + m_textLine += 15; + m_debugDraw.DrawString(5, m_textLine, "Press: (b) to delete a body, (j) to delete a joint"); + m_textLine += 15; + } + + void JointDestroyed(b2Joint* joint) + { + for (int32 i = 0; i < 8; ++i) + { + if (m_joints[i] == joint) + { + m_joints[i] = NULL; + break; + } + } + } + + static Test* Create() + { + return new Web; + } + + b2Body* m_bodies[4]; + b2Joint* m_joints[8]; +}; + +#endif diff --git a/external/Chipmunk/.gitignore b/external/Chipmunk/.gitignore new file mode 100644 index 0000000..d8f51c1 --- /dev/null +++ b/external/Chipmunk/.gitignore @@ -0,0 +1,23 @@ +.DS_Store +doc/index.html + +*.pbxuser +*.perspectivev3 +xcuserdata +project.xcworkspace +xcode/DerivedData + +build + +*.opensdf +*.sdf +*.suo +msvc/vc10/chipmunk/Win32/ +msvc/vc10/demo/ipch/ +msvc/vc10/demo/Win32/ + +*.pdb +*.vcxproj.user +msvc/vc12/chipmunk/Win32/ +msvc/vc12/demo/ipch/ +msvc/vc12/demo/Win32/ diff --git a/external/Chipmunk/CMakeLists.txt b/external/Chipmunk/CMakeLists.txt new file mode 100644 index 0000000..863afc0 --- /dev/null +++ b/external/Chipmunk/CMakeLists.txt @@ -0,0 +1,62 @@ +cmake_minimum_required(VERSION 2.6) +cmake_policy(SET CMP0001 NEW) # don't use MAKE_BACKWARDS_COMPATIBILITY but policies instead + +project(chipmunk) + +# to change the prefix, run cmake with the parameter: +# -D CMAKE_INSTALL_PREFIX=/my/prefix + +# to change the build type, run cmake with the parameter: +# -D CMAKE_BUILD_TYPE= +# run "cmake --help-variable CMAKE_BUILD_TYPE" for details +if(NOT CMAKE_BUILD_TYPE) + SET(CMAKE_BUILD_TYPE Release CACHE STRING + "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel." + FORCE) +endif() + +# other options for the build, you can i.e. activate the shared library by passing +# -D BUILD_SHARED=ON +# to cmake. Other options analog +if(ANDROID) + option(BUILD_DEMOS "Build the demo applications" OFF) + option(INSTALL_DEMOS "Install the demo applications" OFF) + option(BUILD_SHARED "Build and install the shared library" ON) + option(BUILD_STATIC "Build as static library" ON) + option(INSTALL_STATIC "Install the static library" OFF) +else() + option(BUILD_DEMOS "Build the demo applications" ON) + option(INSTALL_DEMOS "Install the demo applications" OFF) + option(BUILD_SHARED "Build and install the shared library" ON) + option(BUILD_STATIC "Build as static library" ON) + option(INSTALL_STATIC "Install the static library" ON) +endif() + +if(CMAKE_C_COMPILER_ID STREQUAL "Clang") + option(FORCE_CLANG_BLOCKS "Force enable Clang blocks" YES) +endif() + +# sanity checks... +if(INSTALL_DEMOS) + set(BUILD_DEMOS ON FORCE) +endif() + +# these need the static lib too +if(BUILD_DEMOS OR INSTALL_STATIC) + set(BUILD_STATIC ON FORCE) +endif() + +if(NOT MSVC) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99") # always use gnu99 + if(FORCE_CLANG_BLOCKS) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fblocks") + endif() + set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -ffast-math") # extend release-profile with fast-math + set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Wall") # extend debug-profile with -Wall +endif() + +add_subdirectory(src) + +if(BUILD_DEMOS) + add_subdirectory(Demo) +endif() diff --git a/external/Chipmunk/Demo/Bench.c b/external/Chipmunk/Demo/Bench.c new file mode 100644 index 0000000..e4ebbc6 --- /dev/null +++ b/external/Chipmunk/Demo/Bench.c @@ -0,0 +1,481 @@ +#include "chipmunk/chipmunk.h" +#include "chipmunk_unsafe.h" +#include "ChipmunkDemo.h" + +#if 1 + #define BENCH_SPACE_NEW cpSpaceNew + #define BENCH_SPACE_FREE cpSpaceFree + #define BENCH_SPACE_STEP cpSpaceStep +#else + #import "cpHastySpace.h" + + static cpSpace *MakeHastySpace(){ + cpSpace *space = cpHastySpaceNew(); + cpHastySpaceSetThreads(space, 0); + return space; + } + + #define BENCH_SPACE_NEW MakeHastySpace + #define BENCH_SPACE_FREE cpHastySpaceFree + #define BENCH_SPACE_STEP cpHastySpaceStep +#endif + +const cpFloat bevel = 1.0; + +static cpVect simple_terrain_verts[] = { + {350.00, 425.07}, {336.00, 436.55}, {272.00, 435.39}, {258.00, 427.63}, {225.28, 420.00}, {202.82, 396.00}, + {191.81, 388.00}, {189.00, 381.89}, {173.00, 380.39}, {162.59, 368.00}, {150.47, 319.00}, {128.00, 311.55}, + {119.14, 286.00}, {126.84, 263.00}, {120.56, 227.00}, {141.14, 178.00}, {137.52, 162.00}, {146.51, 142.00}, + {156.23, 136.00}, {158.00, 118.27}, {170.00, 100.77}, {208.43, 84.00}, {224.00, 69.65}, {249.30, 68.00}, + {257.00, 54.77}, {363.00, 45.94}, {374.15, 54.00}, {386.00, 69.60}, {413.00, 70.73}, {456.00, 84.89}, + {468.09, 99.00}, {467.09, 123.00}, {464.92, 135.00}, {469.00, 141.03}, {497.00, 148.67}, {513.85, 180.00}, + {509.56, 223.00}, {523.51, 247.00}, {523.00, 277.00}, {497.79, 311.00}, {478.67, 348.00}, {467.90, 360.00}, + {456.76, 382.00}, {432.95, 389.00}, {417.00, 411.32}, {373.00, 433.19}, {361.00, 430.02}, {350.00, 425.07}, +}; +static int simple_terrain_count = sizeof(simple_terrain_verts)/sizeof(cpVect); + +//cpBody bodies[1000] = {}; +//cpCircleShape circles[1000] = {}; + +static void add_circle(cpSpace *space, int index, cpFloat radius){ + cpFloat mass = radius*radius/25.0f; + cpBody *body = cpSpaceAddBody(space, cpBodyNew(mass, cpMomentForCircle(mass, 0.0f, radius, cpvzero))); +// cpBody *body = cpSpaceAddBody(space, cpBodyInit(&bodies[i], mass, cpMomentForCircle(mass, 0.0f, radius, cpvzero))); + cpBodySetPosition(body, cpvmult(frand_unit_circle(), 180.0f)); + + + cpShape *shape = cpSpaceAddShape(space, cpCircleShapeNew(body, radius, cpvzero)); +// cpShape *shape = cpSpaceAddShape(space, cpCircleShapeInit(&circles[i], body, radius, cpvzero)); + cpShapeSetElasticity(shape, 0.0); cpShapeSetFriction(shape, 0.9); +} + +static void add_box(cpSpace *space, int index, cpFloat size){ + cpFloat mass = size*size/100.0f; + cpBody *body = cpSpaceAddBody(space, cpBodyNew(mass, cpMomentForBox(mass, size, size))); +// cpBody *body = cpSpaceAddBody(space, cpBodyInit(&bodies[i], mass, cpMomentForBox(mass, size, size))); + cpBodySetPosition(body, cpvmult(frand_unit_circle(), 180.0f)); + + + cpShape *shape = cpSpaceAddShape(space, cpBoxShapeNew(body, size - bevel*2, size - bevel*2, 0.0)); + cpPolyShapeSetRadius(shape, bevel); + cpShapeSetElasticity(shape, 0.0); cpShapeSetFriction(shape, 0.9); +} + +static void add_hexagon(cpSpace *space, int index, cpFloat radius){ + cpVect hexagon[6] = {}; + for(int i=0; i<6; i++){ + cpFloat angle = -M_PI*2.0f*i/6.0f; + hexagon[i] = cpvmult(cpv(cos(angle), sin(angle)), radius - bevel); + } + + cpFloat mass = radius*radius; + cpBody *body = cpSpaceAddBody(space, cpBodyNew(mass, cpMomentForPoly(mass, 6, hexagon, cpvzero, 0.0f))); + cpBodySetPosition(body, cpvmult(frand_unit_circle(), 180.0f)); + + cpShape *shape = cpSpaceAddShape(space, cpPolyShapeNew(body, 6, hexagon, cpTransformIdentity, bevel)); + cpShapeSetElasticity(shape, 0.0); cpShapeSetFriction(shape, 0.9); +} + + +static cpSpace * +SetupSpace_simpleTerrain(){ + cpSpace *space = BENCH_SPACE_NEW(); + space->iterations = 10; + space->gravity = cpv(0, -100); + space->collisionSlop = 0.5f; + + cpVect offset = cpv(-320, -240); + for(int i=0; i<(simple_terrain_count - 1); i++){ + cpVect a = simple_terrain_verts[i], b = simple_terrain_verts[i+1]; + cpSpaceAddShape(space, cpSegmentShapeNew(cpSpaceGetStaticBody(space), cpvadd(a, offset), cpvadd(b, offset), 0.0f)); + } + + return space; +} + + +// SimpleTerrain constant sized objects +static cpSpace *init_SimpleTerrainCircles_1000(){ + cpSpace *space = SetupSpace_simpleTerrain(); + for(int i=0; i<1000; i++) add_circle(space, i, 5.0f); + + return space; +} + +static cpSpace *init_SimpleTerrainCircles_500(){ + cpSpace *space = SetupSpace_simpleTerrain(); + for(int i=0; i<500; i++) add_circle(space, i, 5.0f); + + return space; +} + +static cpSpace *init_SimpleTerrainCircles_100(){ + cpSpace *space = SetupSpace_simpleTerrain(); + for(int i=0; i<100; i++) add_circle(space, i, 5.0f); + + return space; +} + +static cpSpace *init_SimpleTerrainBoxes_1000(){ + cpSpace *space = SetupSpace_simpleTerrain(); + for(int i=0; i<1000; i++) add_box(space, i, 10.0f); + + return space; +} + +static cpSpace *init_SimpleTerrainBoxes_500(){ + cpSpace *space = SetupSpace_simpleTerrain(); + for(int i=0; i<500; i++) add_box(space, i, 10.0f); + + return space; +} + +static cpSpace *init_SimpleTerrainBoxes_100(){ + cpSpace *space = SetupSpace_simpleTerrain(); + for(int i=0; i<100; i++) add_box(space, i, 10.0f); + + return space; +} + +static cpSpace *init_SimpleTerrainHexagons_1000(){ + cpSpace *space = SetupSpace_simpleTerrain(); + for(int i=0; i<1000; i++) add_hexagon(space, i, 5.0f); + + return space; +} + +static cpSpace *init_SimpleTerrainHexagons_500(){ + cpSpace *space = SetupSpace_simpleTerrain(); + for(int i=0; i<500; i++) add_hexagon(space, i, 5.0f); + + return space; +} + +static cpSpace *init_SimpleTerrainHexagons_100(){ + cpSpace *space = SetupSpace_simpleTerrain(); + for(int i=0; i<100; i++) add_hexagon(space, i, 5.0f); + + return space; +} + + +// SimpleTerrain variable sized objects +static cpFloat rand_size(){ + return cpfpow(1.5, cpflerp(-1.5, 3.5, frand())); +} + +static cpSpace *init_SimpleTerrainVCircles_200(){ + cpSpace *space = SetupSpace_simpleTerrain(); + for(int i=0; i<200; i++) add_circle(space, i, 5.0f*rand_size()); + + return space; +} + +static cpSpace *init_SimpleTerrainVBoxes_200(){ + cpSpace *space = SetupSpace_simpleTerrain(); + for(int i=0; i<200; i++) add_box(space, i, 8.0f*rand_size()); + + return space; +} + +static cpSpace *init_SimpleTerrainVHexagons_200(){ + cpSpace *space = SetupSpace_simpleTerrain(); + for(int i=0; i<200; i++) add_hexagon(space, i, 5.0f*rand_size()); + + return space; +} + + +// ComplexTerrain +static cpVect complex_terrain_verts[] = { + { 46.78, 479.00}, { 35.00, 475.63}, { 27.52, 469.00}, { 23.52, 455.00}, { 23.78, 441.00}, { 28.41, 428.00}, { 49.61, 394.00}, { 59.00, 381.56}, { 80.00, 366.03}, { 81.46, 358.00}, { 86.31, 350.00}, { 77.74, 320.00}, + { 70.26, 278.00}, { 67.51, 270.00}, { 58.86, 260.00}, { 57.19, 247.00}, { 38.00, 235.60}, { 25.76, 221.00}, { 24.58, 209.00}, { 27.63, 202.00}, { 31.28, 198.00}, { 40.00, 193.72}, { 48.00, 193.73}, { 55.00, 196.70}, + { 62.10, 204.00}, { 71.00, 209.04}, { 79.00, 206.55}, { 88.00, 206.81}, { 95.88, 211.00}, {103.00, 220.49}, {131.00, 220.51}, {137.00, 222.66}, {143.08, 228.00}, {146.22, 234.00}, {147.08, 241.00}, {145.45, 248.00}, + {142.31, 253.00}, {132.00, 259.30}, {115.00, 259.70}, {109.28, 270.00}, {112.91, 296.00}, {119.69, 324.00}, {129.00, 336.26}, {141.00, 337.59}, {153.00, 331.57}, {175.00, 325.74}, {188.00, 325.19}, {235.00, 317.46}, + {250.00, 317.19}, {255.00, 309.12}, {262.62, 302.00}, {262.21, 295.00}, {248.00, 273.59}, {229.00, 257.93}, {221.00, 255.48}, {215.00, 251.59}, {210.79, 246.00}, {207.47, 234.00}, {203.25, 227.00}, {179.00, 205.90}, + {148.00, 189.54}, {136.00, 181.45}, {120.00, 180.31}, {110.00, 181.65}, { 95.00, 179.31}, { 63.00, 166.96}, { 50.00, 164.23}, { 31.00, 154.49}, { 19.76, 145.00}, { 15.96, 136.00}, { 16.65, 127.00}, { 20.57, 120.00}, + { 28.00, 114.63}, { 40.00, 113.67}, { 65.00, 127.22}, { 73.00, 128.69}, { 81.96, 120.00}, { 77.58, 103.00}, { 78.18, 92.00}, { 59.11, 77.00}, { 52.00, 67.29}, { 31.29, 55.00}, { 25.67, 47.00}, { 24.65, 37.00}, + { 27.82, 29.00}, { 35.00, 22.55}, { 44.00, 20.35}, { 49.00, 20.81}, { 61.00, 25.69}, { 79.00, 37.81}, { 88.00, 49.64}, { 97.00, 56.65}, {109.00, 49.61}, {143.00, 38.96}, {197.00, 37.27}, {215.00, 35.30}, + {222.00, 36.65}, {228.42, 41.00}, {233.30, 49.00}, {234.14, 57.00}, {231.00, 65.80}, {224.00, 72.38}, {218.00, 74.50}, {197.00, 76.62}, {145.00, 78.81}, {123.00, 87.41}, {117.59, 98.00}, {117.79, 104.00}, + {119.00, 106.23}, {138.73, 120.00}, {148.00, 129.50}, {158.50, 149.00}, {203.93, 175.00}, {229.00, 196.60}, {238.16, 208.00}, {245.20, 221.00}, {275.45, 245.00}, {289.00, 263.24}, {303.60, 287.00}, {312.00, 291.57}, + {339.25, 266.00}, {366.33, 226.00}, {363.43, 216.00}, {364.13, 206.00}, {353.00, 196.72}, {324.00, 181.05}, {307.00, 169.63}, {274.93, 156.00}, {256.00, 152.48}, {228.00, 145.13}, {221.09, 142.00}, {214.87, 135.00}, + {212.67, 127.00}, {213.81, 119.00}, {219.32, 111.00}, {228.00, 106.52}, {236.00, 106.39}, {290.00, 119.40}, {299.33, 114.00}, {300.52, 109.00}, {300.30, 53.00}, {301.46, 47.00}, {305.00, 41.12}, {311.00, 36.37}, + {317.00, 34.43}, {325.00, 34.81}, {334.90, 41.00}, {339.45, 50.00}, {339.82, 132.00}, {346.09, 139.00}, {350.00, 150.26}, {380.00, 167.38}, {393.00, 166.48}, {407.00, 155.54}, {430.00, 147.30}, {437.78, 135.00}, + {433.13, 122.00}, {410.23, 78.00}, {401.59, 69.00}, {393.48, 56.00}, {392.80, 44.00}, {395.50, 38.00}, {401.00, 32.49}, {409.00, 29.41}, {420.00, 30.84}, {426.92, 36.00}, {432.32, 44.00}, {439.49, 51.00}, + {470.13, 108.00}, {475.71, 124.00}, {483.00, 130.11}, {488.00, 139.43}, {529.00, 139.40}, {536.00, 132.52}, {543.73, 129.00}, {540.47, 115.00}, {541.11, 100.00}, {552.18, 68.00}, {553.78, 47.00}, {559.00, 39.76}, + {567.00, 35.52}, {577.00, 35.45}, {585.00, 39.58}, {591.38, 50.00}, {591.67, 66.00}, {590.31, 79.00}, {579.76, 109.00}, {582.25, 119.00}, {583.66, 136.00}, {586.45, 143.00}, {586.44, 151.00}, {580.42, 168.00}, + {577.15, 173.00}, {572.00, 177.13}, {564.00, 179.49}, {478.00, 178.81}, {443.00, 184.76}, {427.10, 190.00}, {424.00, 192.11}, {415.94, 209.00}, {408.82, 228.00}, {405.82, 241.00}, {411.00, 250.82}, {415.00, 251.50}, + {428.00, 248.89}, {469.00, 246.29}, {505.00, 246.49}, {533.00, 243.60}, {541.87, 248.00}, {547.55, 256.00}, {548.48, 267.00}, {544.00, 276.00}, {534.00, 282.24}, {513.00, 285.46}, {468.00, 285.76}, {402.00, 291.70}, + {392.00, 290.29}, {377.00, 294.46}, {367.00, 294.43}, {356.44, 304.00}, {354.22, 311.00}, {362.00, 321.36}, {390.00, 322.44}, {433.00, 330.16}, {467.00, 332.76}, {508.00, 347.64}, {522.00, 357.67}, {528.00, 354.46}, + {536.00, 352.96}, {546.06, 336.00}, {553.47, 306.00}, {564.19, 282.00}, {567.84, 268.00}, {578.72, 246.00}, {585.00, 240.97}, {592.00, 238.91}, {600.00, 239.72}, {606.00, 242.82}, {612.36, 251.00}, {613.35, 263.00}, + {588.75, 324.00}, {583.25, 350.00}, {572.12, 370.00}, {575.45, 378.00}, {575.20, 388.00}, {589.00, 393.81}, {599.20, 404.00}, {607.14, 416.00}, {609.96, 430.00}, {615.45, 441.00}, {613.44, 462.00}, {610.48, 469.00}, + {603.00, 475.63}, {590.96, 479.00}, +}; +static int complex_terrain_count = sizeof(complex_terrain_verts)/sizeof(cpVect); + +static cpSpace *init_ComplexTerrainCircles_1000(){ + cpSpace *space = BENCH_SPACE_NEW(); + space->iterations = 10; + space->gravity = cpv(0, -100); + space->collisionSlop = 0.5f; + + cpVect offset = cpv(-320, -240); + for(int i=0; i<(complex_terrain_count - 1); i++){ + cpVect a = complex_terrain_verts[i], b = complex_terrain_verts[i+1]; + cpSpaceAddShape(space, cpSegmentShapeNew(cpSpaceGetStaticBody(space), cpvadd(a, offset), cpvadd(b, offset), 0.0f)); + } + + for(int i=0; i<1000; i++){ + cpFloat radius = 5.0f; + cpFloat mass = radius*radius; + cpBody *body = cpSpaceAddBody(space, cpBodyNew(mass, cpMomentForCircle(mass, 0.0f, radius, cpvzero))); + cpBodySetPosition(body, cpvadd(cpvmult(frand_unit_circle(), 180.0f), cpv(0.0f, 300.0f))); + + cpShape *shape = cpSpaceAddShape(space, cpCircleShapeNew(body, radius, cpvzero)); + cpShapeSetElasticity(shape, 0.0); cpShapeSetFriction(shape, 0.0); + } + + return space; +} + +static cpSpace *init_ComplexTerrainHexagons_1000(){ + cpSpace *space = BENCH_SPACE_NEW(); + space->iterations = 10; + space->gravity = cpv(0, -100); + space->collisionSlop = 0.5f; + + cpVect offset = cpv(-320, -240); + for(int i=0; i<(complex_terrain_count - 1); i++){ + cpVect a = complex_terrain_verts[i], b = complex_terrain_verts[i+1]; + cpSpaceAddShape(space, cpSegmentShapeNew(cpSpaceGetStaticBody(space), cpvadd(a, offset), cpvadd(b, offset), 0.0f)); + } + + cpFloat radius = 5.0f; + cpVect hexagon[6] = {}; + for(int i=0; i<6; i++){ + cpFloat angle = -M_PI*2.0f*i/6.0f; + hexagon[i] = cpvmult(cpv(cos(angle), sin(angle)), radius - bevel); + } + + for(int i=0; i<1000; i++){ + cpFloat mass = radius*radius; + cpBody *body = cpSpaceAddBody(space, cpBodyNew(mass, cpMomentForPoly(mass, 6, hexagon, cpvzero, 0.0f))); + cpBodySetPosition(body, cpvadd(cpvmult(frand_unit_circle(), 180.0f), cpv(0.0f, 300.0f))); + + cpShape *shape = cpSpaceAddShape(space, cpPolyShapeNew(body, 6, hexagon, cpTransformIdentity, bevel)); + cpShapeSetElasticity(shape, 0.0); cpShapeSetFriction(shape, 0.0); + } + + return space; +} + + +// BouncyTerrain +static cpVect bouncy_terrain_verts[] = { + {537.18, 23.00}, {520.50, 36.00}, {501.53, 63.00}, {496.14, 76.00}, {498.86, 86.00}, {504.00, 90.51}, {508.00, 91.36}, {508.77, 84.00}, {513.00, 77.73}, {519.00, 74.48}, {530.00, 74.67}, {545.00, 54.65}, + {554.00, 48.77}, {562.00, 46.39}, {568.00, 45.94}, {568.61, 47.00}, {567.94, 55.00}, {571.27, 64.00}, {572.92, 80.00}, {572.00, 81.39}, {563.00, 79.93}, {556.00, 82.69}, {551.49, 88.00}, {549.00, 95.76}, + {538.00, 93.40}, {530.00, 102.38}, {523.00, 104.00}, {517.00, 103.02}, {516.22, 109.00}, {518.96, 116.00}, {526.00, 121.15}, {534.00, 116.48}, {543.00, 116.77}, {549.28, 121.00}, {554.00, 130.17}, {564.00, 125.67}, + {575.60, 129.00}, {573.31, 121.00}, {567.77, 111.00}, {575.00, 106.47}, {578.51, 102.00}, {580.25, 95.00}, {577.98, 87.00}, {582.00, 85.71}, {597.00, 89.46}, {604.80, 95.00}, {609.28, 104.00}, {610.55, 116.00}, + {609.30, 125.00}, {600.80, 142.00}, {597.31, 155.00}, {584.00, 167.23}, {577.86, 175.00}, {583.52, 184.00}, {582.64, 195.00}, {591.00, 196.56}, {597.81, 201.00}, {607.45, 219.00}, {607.51, 246.00}, {600.00, 275.46}, + {588.00, 267.81}, {579.00, 264.91}, {557.00, 264.41}, {552.98, 259.00}, {548.00, 246.18}, {558.00, 247.12}, {565.98, 244.00}, {571.10, 237.00}, {571.61, 229.00}, {568.25, 222.00}, {562.00, 217.67}, {544.00, 213.93}, + {536.73, 214.00}, {535.60, 204.00}, {539.69, 181.00}, {542.84, 171.00}, {550.43, 161.00}, {540.00, 156.27}, {536.62, 152.00}, {534.70, 146.00}, {527.00, 141.88}, {518.59, 152.00}, {514.51, 160.00}, {510.33, 175.00}, + {519.38, 183.00}, {520.52, 194.00}, {516.00, 201.27}, {505.25, 206.00}, {507.57, 223.00}, {519.90, 260.00}, {529.00, 260.48}, {534.00, 262.94}, {538.38, 268.00}, {540.00, 275.00}, {537.06, 284.00}, {530.00, 289.23}, + {520.00, 289.23}, {513.00, 284.18}, {509.71, 286.00}, {501.69, 298.00}, {501.56, 305.00}, {504.30, 311.00}, {512.00, 316.43}, {521.00, 316.42}, {525.67, 314.00}, {535.00, 304.98}, {562.00, 294.80}, {573.00, 294.81}, + {587.52, 304.00}, {600.89, 310.00}, {596.96, 322.00}, {603.28, 327.00}, {606.52, 333.00}, {605.38, 344.00}, {597.65, 352.00}, {606.36, 375.00}, {607.16, 384.00}, {603.40, 393.00}, {597.00, 398.14}, {577.00, 386.15}, + {564.35, 373.00}, {565.21, 364.00}, {562.81, 350.00}, {553.00, 346.06}, {547.48, 338.00}, {547.48, 330.00}, {550.00, 323.30}, {544.00, 321.53}, {537.00, 322.70}, {532.00, 326.23}, {528.89, 331.00}, {527.83, 338.00}, + {533.02, 356.00}, {542.00, 360.73}, {546.68, 369.00}, {545.38, 379.00}, {537.58, 386.00}, {537.63, 388.00}, {555.00, 407.47}, {563.00, 413.52}, {572.57, 418.00}, {582.72, 426.00}, {578.00, 431.12}, {563.21, 440.00}, + {558.00, 449.27}, {549.00, 452.94}, {541.00, 451.38}, {536.73, 448.00}, {533.00, 441.87}, {520.00, 437.96}, {514.00, 429.69}, {490.00, 415.15}, {472.89, 399.00}, {472.03, 398.00}, {474.00, 396.71}, {486.00, 393.61}, + {492.00, 385.85}, {492.00, 376.15}, {489.04, 371.00}, {485.00, 368.11}, {480.00, 376.27}, {472.00, 379.82}, {463.00, 378.38}, {455.08, 372.00}, {446.00, 377.69}, {439.00, 385.24}, {436.61, 391.00}, {437.52, 404.00}, + {440.00, 409.53}, {463.53, 433.00}, {473.80, 441.00}, {455.00, 440.30}, {443.00, 436.18}, {436.00, 431.98}, {412.00, 440.92}, {397.00, 442.46}, {393.59, 431.00}, {393.71, 412.00}, {400.00, 395.10}, {407.32, 387.00}, + {408.54, 380.00}, {407.42, 375.00}, {403.97, 370.00}, {399.00, 366.74}, {393.00, 365.68}, {391.23, 374.00}, {387.00, 380.27}, {381.00, 383.52}, {371.56, 384.00}, {364.98, 401.00}, {362.96, 412.00}, {363.63, 435.00}, + {345.00, 433.55}, {344.52, 442.00}, {342.06, 447.00}, {337.00, 451.38}, {330.00, 453.00}, {325.00, 452.23}, {318.00, 448.17}, {298.00, 453.70}, {284.00, 451.49}, {278.62, 449.00}, {291.47, 408.00}, {291.77, 398.00}, + {301.00, 393.83}, {305.00, 393.84}, {305.60, 403.00}, {310.00, 409.47}, {318.00, 413.07}, {325.00, 412.40}, {332.31, 407.00}, {335.07, 400.00}, {334.40, 393.00}, {329.00, 385.69}, {319.00, 382.79}, {301.00, 389.23}, + {289.00, 389.97}, {265.00, 389.82}, {251.00, 385.85}, {245.00, 389.23}, {239.00, 389.94}, {233.00, 388.38}, {226.00, 382.04}, {206.00, 374.75}, {206.00, 394.00}, {204.27, 402.00}, {197.00, 401.79}, {191.00, 403.49}, + {186.53, 407.00}, {183.60, 412.00}, {183.60, 422.00}, {189.00, 429.31}, {196.00, 432.07}, {203.00, 431.40}, {209.47, 427.00}, {213.00, 419.72}, {220.00, 420.21}, {227.00, 418.32}, {242.00, 408.41}, {258.98, 409.00}, + {250.00, 435.43}, {239.00, 438.78}, {223.00, 448.19}, {209.00, 449.70}, {205.28, 456.00}, {199.00, 460.23}, {190.00, 460.52}, {182.73, 456.00}, {178.00, 446.27}, {160.00, 441.42}, {148.35, 435.00}, {149.79, 418.00}, + {157.72, 401.00}, {161.00, 396.53}, {177.00, 385.00}, {180.14, 380.00}, {181.11, 374.00}, {180.00, 370.52}, {170.00, 371.68}, {162.72, 368.00}, {158.48, 361.00}, {159.56, 349.00}, {154.00, 342.53}, {146.00, 339.85}, + {136.09, 343.00}, {130.64, 351.00}, {131.74, 362.00}, {140.61, 374.00}, {130.68, 387.00}, {120.75, 409.00}, {118.09, 421.00}, {117.92, 434.00}, {100.00, 432.40}, { 87.00, 427.48}, { 81.59, 423.00}, { 73.64, 409.00}, + { 72.57, 398.00}, { 74.62, 386.00}, { 78.80, 378.00}, { 88.00, 373.43}, { 92.49, 367.00}, { 93.32, 360.00}, { 91.30, 353.00}, {103.00, 342.67}, {109.00, 343.10}, {116.00, 340.44}, {127.33, 330.00}, {143.00, 327.24}, + {154.30, 322.00}, {145.00, 318.06}, {139.77, 311.00}, {139.48, 302.00}, {144.95, 293.00}, {143.00, 291.56}, {134.00, 298.21}, {118.00, 300.75}, {109.40, 305.00}, { 94.67, 319.00}, { 88.00, 318.93}, { 81.00, 321.69}, + { 67.24, 333.00}, { 56.68, 345.00}, { 53.00, 351.40}, { 47.34, 333.00}, { 50.71, 314.00}, { 56.57, 302.00}, { 68.00, 287.96}, { 91.00, 287.24}, {110.00, 282.36}, {133.80, 271.00}, {147.34, 256.00}, {156.47, 251.00}, + {157.26, 250.00}, {154.18, 242.00}, {154.48, 236.00}, {158.72, 229.00}, {166.71, 224.00}, {170.15, 206.00}, {170.19, 196.00}, {167.24, 188.00}, {160.00, 182.67}, {150.00, 182.66}, {143.60, 187.00}, {139.96, 195.00}, + {139.50, 207.00}, {136.45, 221.00}, {136.52, 232.00}, {133.28, 238.00}, {129.00, 241.38}, {119.00, 243.07}, {115.00, 246.55}, {101.00, 253.16}, { 86.00, 257.32}, { 63.00, 259.24}, { 57.00, 257.31}, { 50.54, 252.00}, + { 47.59, 247.00}, { 46.30, 240.00}, { 47.58, 226.00}, { 50.00, 220.57}, { 58.00, 226.41}, { 69.00, 229.17}, { 79.00, 229.08}, { 94.50, 225.00}, {100.21, 231.00}, {107.00, 233.47}, {107.48, 224.00}, {109.94, 219.00}, + {115.00, 214.62}, {122.57, 212.00}, {116.00, 201.49}, {104.00, 194.57}, { 90.00, 194.04}, { 79.00, 198.21}, { 73.00, 198.87}, { 62.68, 191.00}, { 62.58, 184.00}, { 64.42, 179.00}, { 75.00, 167.70}, { 80.39, 157.00}, + { 68.79, 140.00}, { 61.67, 126.00}, { 61.47, 117.00}, { 64.43, 109.00}, { 63.10, 96.00}, { 56.48, 82.00}, { 48.00, 73.88}, { 43.81, 66.00}, { 43.81, 56.00}, { 50.11, 46.00}, { 59.00, 41.55}, { 71.00, 42.64}, + { 78.00, 36.77}, { 83.00, 34.75}, { 99.00, 34.32}, {117.00, 38.92}, {133.00, 55.15}, {142.00, 50.70}, {149.74, 51.00}, {143.55, 68.00}, {153.28, 74.00}, {156.23, 79.00}, {157.00, 84.00}, {156.23, 89.00}, + {153.28, 94.00}, {144.58, 99.00}, {151.52, 112.00}, {151.51, 124.00}, {150.00, 126.36}, {133.00, 130.25}, {126.71, 125.00}, {122.00, 117.25}, {114.00, 116.23}, {107.73, 112.00}, {104.48, 106.00}, {104.32, 99.00}, + {106.94, 93.00}, {111.24, 89.00}, {111.60, 85.00}, {107.24, 73.00}, {102.00, 67.57}, { 99.79, 67.00}, { 99.23, 76.00}, { 95.00, 82.27}, { 89.00, 85.52}, { 79.84, 86.00}, { 86.73, 114.00}, { 98.00, 136.73}, + { 99.00, 137.61}, {109.00, 135.06}, {117.00, 137.94}, {122.52, 146.00}, {122.94, 151.00}, {121.00, 158.58}, {134.00, 160.97}, {153.00, 157.45}, {171.30, 150.00}, {169.06, 142.00}, {169.77, 136.00}, {174.00, 129.73}, + {181.46, 126.00}, {182.22, 120.00}, {182.20, 111.00}, {180.06, 101.00}, {171.28, 85.00}, {171.75, 80.00}, {182.30, 53.00}, {189.47, 50.00}, {190.62, 38.00}, {194.00, 33.73}, {199.00, 30.77}, {208.00, 30.48}, + {216.00, 34.94}, {224.00, 31.47}, {240.00, 30.37}, {247.00, 32.51}, {249.77, 35.00}, {234.75, 53.00}, {213.81, 93.00}, {212.08, 99.00}, {213.00, 101.77}, {220.00, 96.77}, {229.00, 96.48}, {236.28, 101.00}, + {240.00, 107.96}, {245.08, 101.00}, {263.00, 65.32}, {277.47, 48.00}, {284.00, 47.03}, {286.94, 41.00}, {292.00, 36.62}, {298.00, 35.06}, {304.00, 35.77}, {314.00, 43.81}, {342.00, 32.56}, {359.00, 31.32}, + {365.00, 32.57}, {371.00, 36.38}, {379.53, 48.00}, {379.70, 51.00}, {356.00, 52.19}, {347.00, 54.74}, {344.38, 66.00}, {341.00, 70.27}, {335.00, 73.52}, {324.00, 72.38}, {317.00, 65.75}, {313.00, 67.79}, + {307.57, 76.00}, {315.00, 78.62}, {319.28, 82.00}, {322.23, 87.00}, {323.00, 94.41}, {334.00, 92.49}, {347.00, 87.47}, {349.62, 80.00}, {353.00, 75.73}, {359.00, 72.48}, {366.00, 72.32}, {372.00, 74.94}, + {377.00, 81.34}, {382.00, 83.41}, {392.00, 83.40}, {399.00, 79.15}, {404.00, 85.74}, {411.00, 85.06}, {417.00, 86.62}, {423.38, 93.00}, {425.05, 104.00}, {438.00, 110.35}, {450.00, 112.17}, {452.62, 103.00}, + {456.00, 98.73}, {462.00, 95.48}, {472.00, 95.79}, {471.28, 92.00}, {464.00, 84.62}, {445.00, 80.39}, {436.00, 75.33}, {428.00, 68.46}, {419.00, 68.52}, {413.00, 65.27}, {408.48, 58.00}, {409.87, 46.00}, + {404.42, 39.00}, {408.00, 33.88}, {415.00, 29.31}, {429.00, 26.45}, {455.00, 28.77}, {470.00, 33.81}, {482.00, 42.16}, {494.00, 46.85}, {499.65, 36.00}, {513.00, 25.95}, {529.00, 22.42}, {537.18, 23.00}, +}; +static int bouncy_terrain_count = sizeof(bouncy_terrain_verts)/sizeof(cpVect); + +static cpSpace *init_BouncyTerrainCircles_500(){ + cpSpace *space = BENCH_SPACE_NEW(); + space->iterations = 10; + + cpVect offset = cpv(-320, -240); + for(int i=0; i<(bouncy_terrain_count - 1); i++){ + cpVect a = bouncy_terrain_verts[i], b = bouncy_terrain_verts[i+1]; + cpShape *shape = cpSpaceAddShape(space, cpSegmentShapeNew(cpSpaceGetStaticBody(space), cpvadd(a, offset), cpvadd(b, offset), 0.0f)); + cpShapeSetElasticity(shape, 1.0); + } + + for(int i=0; i<500; i++){ + cpFloat radius = 5.0f; + cpFloat mass = radius*radius; + cpBody *body = cpSpaceAddBody(space, cpBodyNew(mass, cpMomentForCircle(mass, 0.0f, radius, cpvzero))); + cpBodySetPosition(body, cpvadd(cpvmult(frand_unit_circle(), 130.0f), cpvzero)); + cpBodySetVelocity(body, cpvmult(frand_unit_circle(), 50.0f)); + + cpShape *shape = cpSpaceAddShape(space, cpCircleShapeNew(body, radius, cpvzero)); + cpShapeSetElasticity(shape, 1.0); + } + + return space; +} + +static cpSpace *init_BouncyTerrainHexagons_500(){ + cpSpace *space = BENCH_SPACE_NEW(); + space->iterations = 10; + + cpVect offset = cpv(-320, -240); + for(int i=0; i<(bouncy_terrain_count - 1); i++){ + cpVect a = bouncy_terrain_verts[i], b = bouncy_terrain_verts[i+1]; + cpShape *shape = cpSpaceAddShape(space, cpSegmentShapeNew(cpSpaceGetStaticBody(space), cpvadd(a, offset), cpvadd(b, offset), 0.0f)); + cpShapeSetElasticity(shape, 1.0); + } + + cpFloat radius = 5.0f; + cpVect hexagon[6] = {}; + for(int i=0; i<6; i++){ + cpFloat angle = -M_PI*2.0f*i/6.0f; + hexagon[i] = cpvmult(cpv(cos(angle), sin(angle)), radius - bevel); + } + + for(int i=0; i<500; i++){ + cpFloat mass = radius*radius; + cpBody *body = cpSpaceAddBody(space, cpBodyNew(mass, cpMomentForPoly(mass, 6, hexagon, cpvzero, 0.0f))); + cpBodySetPosition(body, cpvadd(cpvmult(frand_unit_circle(), 130.0f), cpvzero)); + cpBodySetVelocity(body, cpvmult(frand_unit_circle(), 50.0f)); + + cpShape *shape = cpSpaceAddShape(space, cpPolyShapeNew(body, 6, hexagon, cpTransformIdentity, bevel)); + cpShapeSetElasticity(shape, 1.0); + } + + return space; +} + + +// No collisions + +static cpBool NoCollide_begin(cpArbiter *arb, cpSpace *space, void *data){ + abort(); + + return cpTrue; +} + + +static cpSpace *init_NoCollide(){ + cpSpace *space = BENCH_SPACE_NEW(); + space->iterations = 10; + + cpCollisionHandler *handler = cpSpaceAddCollisionHandler(space, 2, 2); + handler->beginFunc = NoCollide_begin; + + + float radius = 4.5f; + + cpShapeSetElasticity(cpSpaceAddShape(space, cpSegmentShapeNew(cpSpaceGetStaticBody(space), cpv(-330-radius, -250-radius), cpv( 330+radius, -250-radius), 0.0f)), 1.0f); + cpShapeSetElasticity(cpSpaceAddShape(space, cpSegmentShapeNew(cpSpaceGetStaticBody(space), cpv( 330+radius, 250+radius), cpv( 330+radius, -250-radius), 0.0f)), 1.0f); + cpShapeSetElasticity(cpSpaceAddShape(space, cpSegmentShapeNew(cpSpaceGetStaticBody(space), cpv( 330+radius, 250+radius), cpv(-330-radius, 250+radius), 0.0f)), 1.0f); + cpShapeSetElasticity(cpSpaceAddShape(space, cpSegmentShapeNew(cpSpaceGetStaticBody(space), cpv(-330-radius, -250-radius), cpv(-330-radius, 250+radius), 0.0f)), 1.0f); + + for(int x=-320; x<=320; x+=20){ + for(int y=-240; y<=240; y+=20){ + cpSpaceAddShape(space, cpCircleShapeNew(cpSpaceGetStaticBody(space), radius, cpv(x, y))); + } + } + + for(int y=10-240; y<=240; y+=40){ + cpFloat mass = 7.0f; + cpBody *body = cpSpaceAddBody(space, cpBodyNew(mass, cpMomentForCircle(mass, 0.0f, radius, cpvzero))); + cpBodySetPosition(body, cpv(-320.0f, y)); + cpBodySetVelocity(body, cpv(100.0f, 0.0f)); + + cpShape *shape = cpSpaceAddShape(space, cpCircleShapeNew(body, radius, cpvzero)); + cpShapeSetElasticity(shape, 1.0); + cpShapeSetCollisionType(shape, 2); + } + + for(int x=30-320; x<=320; x+=40){ + cpFloat mass = 7.0f; + cpBody *body = cpSpaceAddBody(space, cpBodyNew(mass, cpMomentForCircle(mass, 0.0f, radius, cpvzero))); + cpBodySetPosition(body, cpv(x, -240.0f)); + cpBodySetVelocity(body, cpv(0.0f, 100.0f)); + + cpShape *shape = cpSpaceAddShape(space, cpCircleShapeNew(body, radius, cpvzero)); + cpShapeSetElasticity(shape, 1.0); + cpShapeSetCollisionType(shape, 2); + } + + return space; +} + + +// TODO ideas: +// addition/removal +// Memory usage? (too small to matter?) +// http://forums.tigsource.com/index.php?topic=18077.msg518578#msg518578 + + +// Build benchmark list +static void update(cpSpace *space, double dt){ + BENCH_SPACE_STEP(space, dt); +} + +static void destroy(cpSpace *space){ + ChipmunkDemoFreeSpaceChildren(space); + BENCH_SPACE_FREE(space); +} + +// Make a second demo declaration for this demo to use in the regular demo set. +ChipmunkDemo BouncyHexagons = { + "Bouncy Hexagons", + 1.0/60.0, + init_BouncyTerrainHexagons_500, + update, + ChipmunkDemoDefaultDrawImpl, + destroy, +}; + +#define BENCH(n) {"benchmark - " #n, 1.0/60.0, init_##n, update, ChipmunkDemoDefaultDrawImpl, destroy} +ChipmunkDemo bench_list[] = { + BENCH(SimpleTerrainCircles_1000), + BENCH(SimpleTerrainCircles_500), + BENCH(SimpleTerrainCircles_100), + BENCH(SimpleTerrainBoxes_1000), + BENCH(SimpleTerrainBoxes_500), + BENCH(SimpleTerrainBoxes_100), + BENCH(SimpleTerrainHexagons_1000), + BENCH(SimpleTerrainHexagons_500), + BENCH(SimpleTerrainHexagons_100), + BENCH(SimpleTerrainVCircles_200), + BENCH(SimpleTerrainVBoxes_200), + BENCH(SimpleTerrainVHexagons_200), + BENCH(ComplexTerrainCircles_1000), + BENCH(ComplexTerrainHexagons_1000), + BENCH(BouncyTerrainCircles_500), + BENCH(BouncyTerrainHexagons_500), + BENCH(NoCollide), +}; + +int bench_count = sizeof(bench_list)/sizeof(ChipmunkDemo); diff --git a/external/Chipmunk/Demo/Buoyancy.c b/external/Chipmunk/Demo/Buoyancy.c new file mode 100644 index 0000000..2c24f34 --- /dev/null +++ b/external/Chipmunk/Demo/Buoyancy.c @@ -0,0 +1,226 @@ +/* Copyright (c) 2007 Scott Lembcke + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +#include "chipmunk/chipmunk.h" + +#include "ChipmunkDemo.h" + +static void +update(cpSpace *space, double dt) +{ + cpSpaceStep(space, dt); +} + +#define FLUID_DENSITY 0.00014 +#define FLUID_DRAG 2.0 + +char messageBuffer[1024] = {}; + +// Modified from chipmunk_private.h +static inline cpFloat +k_scalar_body(cpBody *body, cpVect point, cpVect n) +{ + cpFloat rcn = cpvcross(cpvsub(point, cpBodyGetPosition(body)), n); + return 1.0f/cpBodyGetMass(body) + rcn*rcn/cpBodyGetMoment(body); +} + +static cpBool +waterPreSolve(cpArbiter *arb, cpSpace *space, void *ptr) +{ + CP_ARBITER_GET_SHAPES(arb, water, poly); + cpBody *body = cpShapeGetBody(poly); + + // Get the top of the water sensor bounding box to use as the water level. + cpFloat level = cpShapeGetBB(water).t; + + // Clip the polygon against the water level + int count = cpPolyShapeGetCount(poly); + int clippedCount = 0; +#ifdef _MSC_VER + // MSVC is pretty much the only compiler in existence that doesn't support variable sized arrays. + cpVect clipped[10]; +#else + cpVect clipped[count + 1]; +#endif + + for(int i=0, j=count-1; iCP_PRIVATE(p)), 0.0f); + body->CP_PRIVATE(w) *= cpfexp(-w_damping*dt*body->CP_PRIVATE(i_inv)); + + return cpTrue; +} + +static cpSpace * +init(void) +{ + ChipmunkDemoMessageString = messageBuffer; + + cpSpace *space = cpSpaceNew(); + cpSpaceSetIterations(space, 30); + cpSpaceSetGravity(space, cpv(0, -500)); +// cpSpaceSetDamping(space, 0.5); + cpSpaceSetSleepTimeThreshold(space, 0.5f); + cpSpaceSetCollisionSlop(space, 0.5f); + + cpBody *body, *staticBody = cpSpaceGetStaticBody(space); + cpShape *shape; + + // Create segments around the edge of the screen. + shape = cpSpaceAddShape(space, cpSegmentShapeNew(staticBody, cpv(-320,-240), cpv(-320,240), 0.0f)); + cpShapeSetElasticity(shape, 1.0f); + cpShapeSetFriction(shape, 1.0f); + cpShapeSetFilter(shape, NOT_GRABBABLE_FILTER); + + shape = cpSpaceAddShape(space, cpSegmentShapeNew(staticBody, cpv(320,-240), cpv(320,240), 0.0f)); + cpShapeSetElasticity(shape, 1.0f); + cpShapeSetFriction(shape, 1.0f); + cpShapeSetFilter(shape, NOT_GRABBABLE_FILTER); + + shape = cpSpaceAddShape(space, cpSegmentShapeNew(staticBody, cpv(-320,-240), cpv(320,-240), 0.0f)); + cpShapeSetElasticity(shape, 1.0f); + cpShapeSetFriction(shape, 1.0f); + cpShapeSetFilter(shape, NOT_GRABBABLE_FILTER); + + shape = cpSpaceAddShape(space, cpSegmentShapeNew(staticBody, cpv(-320,240), cpv(320,240), 0.0f)); + cpShapeSetElasticity(shape, 1.0f); + cpShapeSetFriction(shape, 1.0f); + cpShapeSetFilter(shape, NOT_GRABBABLE_FILTER); + + { + // Add the edges of the bucket + cpBB bb = cpBBNew(-300, -200, 100, 0); + cpFloat radius = 5.0f; + + shape = cpSpaceAddShape(space, cpSegmentShapeNew(staticBody, cpv(bb.l, bb.b), cpv(bb.l, bb.t), radius)); + cpShapeSetElasticity(shape, 1.0f); + cpShapeSetFriction(shape, 1.0f); + cpShapeSetFilter(shape, NOT_GRABBABLE_FILTER); + + shape = cpSpaceAddShape(space, cpSegmentShapeNew(staticBody, cpv(bb.r, bb.b), cpv(bb.r, bb.t), radius)); + cpShapeSetElasticity(shape, 1.0f); + cpShapeSetFriction(shape, 1.0f); + cpShapeSetFilter(shape, NOT_GRABBABLE_FILTER); + + shape = cpSpaceAddShape(space, cpSegmentShapeNew(staticBody, cpv(bb.l, bb.b), cpv(bb.r, bb.b), radius)); + cpShapeSetElasticity(shape, 1.0f); + cpShapeSetFriction(shape, 1.0f); + cpShapeSetFilter(shape, NOT_GRABBABLE_FILTER); + + // Add the sensor for the water. + shape = cpSpaceAddShape(space, cpBoxShapeNew2(staticBody, bb, 0.0)); + cpShapeSetSensor(shape, cpTrue); + cpShapeSetCollisionType(shape, 1); + } + + + { + cpFloat width = 200.0f; + cpFloat height = 50.0f; + cpFloat mass = 0.3*FLUID_DENSITY*width*height; + cpFloat moment = cpMomentForBox(mass, width, height); + + body = cpSpaceAddBody(space, cpBodyNew(mass, moment)); + cpBodySetPosition(body, cpv(-50, -100)); + cpBodySetVelocity(body, cpv(0, -100)); + cpBodySetAngularVelocity(body, 1); + + shape = cpSpaceAddShape(space, cpBoxShapeNew(body, width, height, 0.0)); + cpShapeSetFriction(shape, 0.8f); + } + + { + cpFloat width = 40.0f; + cpFloat height = width*2; + cpFloat mass = 0.3*FLUID_DENSITY*width*height; + cpFloat moment = cpMomentForBox(mass, width, height); + + body = cpSpaceAddBody(space, cpBodyNew(mass, moment)); + cpBodySetPosition(body, cpv(-200, -50)); + cpBodySetVelocity(body, cpv(0, -100)); + cpBodySetAngularVelocity(body, 1); + + shape = cpSpaceAddShape(space, cpBoxShapeNew(body, width, height, 0.0)); + cpShapeSetFriction(shape, 0.8f); + } + + cpCollisionHandler *handler = cpSpaceAddCollisionHandler(space, 1, 0); + handler->preSolveFunc = (cpCollisionPreSolveFunc)waterPreSolve; + + return space; +} + +static void +destroy(cpSpace *space) +{ + ChipmunkDemoFreeSpaceChildren(space); + cpSpaceFree(space); +} + +ChipmunkDemo Buoyancy = { + "Simple Sensor based fluids.", + 1.0/180.0, + init, + update, + ChipmunkDemoDefaultDrawImpl, + destroy, +}; diff --git a/external/Chipmunk/Demo/CMakeLists.txt b/external/Chipmunk/Demo/CMakeLists.txt new file mode 100644 index 0000000..71a9f74 --- /dev/null +++ b/external/Chipmunk/Demo/CMakeLists.txt @@ -0,0 +1,44 @@ +find_package(OpenGL REQUIRED) + +# Quick and dirty package searching. +# Will probably only work on Unixes. +# TODO need to fix this up eventually. +FIND_LIBRARY(GLFW_LIBRARIES glfw /usr/lib) +FIND_LIBRARY(GLEW_LIBRARIES GLEW /usr/lib) +FIND_PATH(GLFW_INCLUDE_DIR GL/glfw.h /usr/include/GL) +FIND_PATH(GLEW_INCLUDE_DIR GL/glew.h /usr/include/GL) + + +set(chipmunk_demos_include_dirs + ${chipmunk_SOURCE_DIR}/include/chipmunk + ${GLFW_INCLUDE_DIR} + ${GLEW_INCLUDE_DIR} + ${OPENGL_INCLUDE_DIR} +) + +set(chipmunk_demos_libraries + chipmunk_static + ${GLFW_LIBRARIES} + ${GLEW_LIBRARIES} + ${OPENGL_LIBRARIES} +) + +if(NOT MSVC) + list(APPEND chipmunk_demos_libraries m) +endif(NOT MSVC) + +file(GLOB chipmunk_demos_source_files "*.c") + +include_directories(${chipmunk_demos_include_dirs}) +add_executable(chipmunk_demos ${chipmunk_demos_source_files}) +target_link_libraries(chipmunk_demos ${chipmunk_demos_libraries}) + +# Tell MSVC to compile the code as C++. +if(MSVC) + set_source_files_properties(${chipmunk_demos_source_files} PROPERTIES LANGUAGE CXX) + set_target_properties(chipmunk_demos PROPERTIES LINKER_LANGUAGE CXX) +endif(MSVC) + +if(INSTALL_DEMOS) + install(TARGETS chipmunk_demos RUNTIME DESTINATION bin) +endif(INSTALL_DEMOS) diff --git a/external/Chipmunk/Demo/Chains.c b/external/Chipmunk/Demo/Chains.c new file mode 100644 index 0000000..e1c7270 --- /dev/null +++ b/external/Chipmunk/Demo/Chains.c @@ -0,0 +1,150 @@ +/* Copyright (c) 2007 Scott Lembcke + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +#include "chipmunk/chipmunk.h" +#include "ChipmunkDemo.h" + +#define CHAIN_COUNT 8 +#define LINK_COUNT 10 + +static void +BreakablejointPostStepRemove(cpSpace *space, cpConstraint *joint, void *unused) +{ + cpSpaceRemoveConstraint(space, joint); + cpConstraintFree(joint); +} + +static void +BreakableJointPostSolve(cpConstraint *joint, cpSpace *space) +{ + cpFloat dt = cpSpaceGetCurrentTimeStep(space); + + // Convert the impulse to a force by dividing it by the timestep. + cpFloat force = cpConstraintGetImpulse(joint)/dt; + cpFloat maxForce = cpConstraintGetMaxForce(joint); + + // If the force is almost as big as the joint's max force, break it. + if(force > 0.9*maxForce){ + cpSpaceAddPostStepCallback(space, (cpPostStepFunc)BreakablejointPostStepRemove, joint, NULL); + } +} + +static void +update(cpSpace *space, double dt) +{ + cpSpaceStep(space, dt); +} + +static cpSpace * +init(void) +{ + cpSpace *space = cpSpaceNew(); + cpSpaceSetIterations(space, 30); + cpSpaceSetGravity(space, cpv(0, -100)); + cpSpaceSetSleepTimeThreshold(space, 0.5f); + + cpBody *body, *staticBody = cpSpaceGetStaticBody(space); + cpShape *shape; + + // Create segments around the edge of the screen. + shape = cpSpaceAddShape(space, cpSegmentShapeNew(staticBody, cpv(-320,-240), cpv(-320,240), 0.0f)); + cpShapeSetElasticity(shape, 1.0f); + cpShapeSetFriction(shape, 1.0f); + cpShapeSetFilter(shape, NOT_GRABBABLE_FILTER); + + shape = cpSpaceAddShape(space, cpSegmentShapeNew(staticBody, cpv(320,-240), cpv(320,240), 0.0f)); + cpShapeSetElasticity(shape, 1.0f); + cpShapeSetFriction(shape, 1.0f); + cpShapeSetFilter(shape, NOT_GRABBABLE_FILTER); + + shape = cpSpaceAddShape(space, cpSegmentShapeNew(staticBody, cpv(-320,-240), cpv(320,-240), 0.0f)); + cpShapeSetElasticity(shape, 1.0f); + cpShapeSetFriction(shape, 1.0f); + cpShapeSetFilter(shape, NOT_GRABBABLE_FILTER); + + shape = cpSpaceAddShape(space, cpSegmentShapeNew(staticBody, cpv(-320,240), cpv(320,240), 0.0f)); + cpShapeSetElasticity(shape, 1.0f); + cpShapeSetFriction(shape, 1.0f); + cpShapeSetFilter(shape, NOT_GRABBABLE_FILTER); + + cpFloat mass = 1; + cpFloat width = 20; + cpFloat height = 30; + + cpFloat spacing = width*0.3; + + // Add lots of boxes. + for(int i=0; i +#include + +#include "GL/glew.h" +#include "GL/glfw.h" + +#include "chipmunk/chipmunk_private.h" +#include "ChipmunkDebugDraw.h" +#include "ChipmunkDemoShaderSupport.h" + +float ChipmunkDebugDrawPointLineScale = 1.0f; +float ChipmunkDebugDrawOutlineWidth = 1.0f; + +static GLuint program; + +struct v2f {GLfloat x, y;}; +static struct v2f v2f0 = {0.0f, 0.0f}; + +static inline struct v2f +v2f(cpVect v) +{ + struct v2f v2 = {(GLfloat)v.x, (GLfloat)v.y}; + return v2; +} + +typedef struct Vertex {struct v2f vertex, aa_coord; cpSpaceDebugColor fill_color, outline_color;} Vertex; +typedef struct Triangle {Vertex a, b, c;} Triangle; + +static GLuint vao = 0; +static GLuint vbo = 0; + +void +ChipmunkDebugDrawInit(void) +{ + // Setup the AA shader. + GLint vshader = CompileShader(GL_VERTEX_SHADER, GLSL( + attribute vec2 vertex; + attribute vec2 aa_coord; + attribute vec4 fill_color; + attribute vec4 outline_color; + + varying vec2 v_aa_coord; + varying vec4 v_fill_color; + varying vec4 v_outline_color; + + void main(void){ + // TODO: get rid of the GL 2.x matrix bit eventually? + gl_Position = gl_ModelViewProjectionMatrix*vec4(vertex, 0.0, 1.0); + + v_fill_color = fill_color; + v_outline_color = outline_color; + v_aa_coord = aa_coord; + } + )); + + GLint fshader = CompileShader(GL_FRAGMENT_SHADER, GLSL( + uniform float u_outline_coef; + + varying vec2 v_aa_coord; + varying vec4 v_fill_color; + //const vec4 v_fill_color = vec4(0.0, 0.0, 0.0, 1.0); + varying vec4 v_outline_color; + + float aa_step(float t1, float t2, float f) + { + //return step(t2, f); + return smoothstep(t1, t2, f); + } + + void main(void) + { + float l = length(v_aa_coord); + + // Different pixel size estimations are handy. + //float fw = fwidth(l); + //float fw = length(vec2(dFdx(l), dFdy(l))); + float fw = length(fwidth(v_aa_coord)); + + // Outline width threshold. + float ow = 1.0 - fw;//*u_outline_coef; + + // Fill/outline color. + float fo_step = aa_step(max(ow - fw, 0.0), ow, l); + vec4 fo_color = mix(v_fill_color, v_outline_color, fo_step); + + // Use pre-multiplied alpha. + float alpha = 1.0 - aa_step(1.0 - fw, 1.0, l); + gl_FragColor = fo_color*(fo_color.a*alpha); + //gl_FragColor = vec4(vec3(l), 1); + } + )); + + program = LinkProgram(vshader, fshader); + CHECK_GL_ERRORS(); + + // Setu VBO and VAO. +#if __APPLE__ + glGenVertexArraysAPPLE(1, &vao); + glBindVertexArrayAPPLE(vao); +#else + glGenVertexArrays(1, &vao); + glBindVertexArray(vao); +#endif + + glGenBuffers(1, &vbo); + glBindBuffer(GL_ARRAY_BUFFER, vbo); + + SET_ATTRIBUTE(program, struct Vertex, vertex, GL_FLOAT); + SET_ATTRIBUTE(program, struct Vertex, aa_coord, GL_FLOAT); + SET_ATTRIBUTE(program, struct Vertex, fill_color, GL_FLOAT); + SET_ATTRIBUTE(program, struct Vertex, outline_color, GL_FLOAT); + + glBindBuffer(GL_ARRAY_BUFFER, 0); +#if __APPLE__ + glBindVertexArrayAPPLE(0); +#else + glBindVertexArray(0); +#endif + + CHECK_GL_ERRORS(); +} + +#undef MAX // Defined on some systems +#define MAX(__a__, __b__) (__a__ > __b__ ? __a__ : __b__) + +static GLsizei triangle_capacity = 0; +static GLsizei triangle_count = 0; +static Triangle *triangle_buffer = NULL; + +static Triangle *PushTriangles(size_t count) +{ + if(triangle_count + count > triangle_capacity){ + triangle_capacity += MAX(triangle_capacity, count); + triangle_buffer = (Triangle *)realloc(triangle_buffer, triangle_capacity*sizeof(Triangle)); + } + + Triangle *buffer = triangle_buffer + triangle_count; + triangle_count += count; + return buffer; +} + + +void ChipmunkDebugDrawCircle(cpVect pos, cpFloat angle, cpFloat radius, cpSpaceDebugColor outlineColor, cpSpaceDebugColor fillColor) +{ + Triangle *triangles = PushTriangles(2); + + cpFloat r = radius + 1.0f/ChipmunkDebugDrawPointLineScale; + Vertex a = {{pos.x - r, pos.y - r}, {-1.0, -1.0}, fillColor, outlineColor}; + Vertex b = {{pos.x - r, pos.y + r}, {-1.0, 1.0}, fillColor, outlineColor}; + Vertex c = {{pos.x + r, pos.y + r}, { 1.0, 1.0}, fillColor, outlineColor}; + Vertex d = {{pos.x + r, pos.y - r}, { 1.0, -1.0}, fillColor, outlineColor}; + + Triangle t0 = {a, b, c}; triangles[0] = t0; + Triangle t1 = {a, c, d}; triangles[1] = t1; + + ChipmunkDebugDrawSegment(pos, cpvadd(pos, cpvmult(cpvforangle(angle), radius - ChipmunkDebugDrawPointLineScale*0.5f)), outlineColor); +} + +void ChipmunkDebugDrawSegment(cpVect a, cpVect b, cpSpaceDebugColor color) +{ + ChipmunkDebugDrawFatSegment(a, b, 0.0f, color, color); +} + +void ChipmunkDebugDrawFatSegment(cpVect a, cpVect b, cpFloat radius, cpSpaceDebugColor outlineColor, cpSpaceDebugColor fillColor) +{ + Triangle *triangles = PushTriangles(6); + + cpVect n = cpvnormalize(cpvrperp(cpvsub(b, a))); + cpVect t = cpvrperp(n); + + cpFloat half = 1.0f/ChipmunkDebugDrawPointLineScale; + cpFloat r = radius + half; + if(r <= half){ + r = half; + fillColor = outlineColor; + } + + cpVect nw = (cpvmult(n, r)); + cpVect tw = (cpvmult(t, r)); + struct v2f v0 = v2f(cpvsub(b, cpvadd(nw, tw))); // { 1.0, -1.0} + struct v2f v1 = v2f(cpvadd(b, cpvsub(nw, tw))); // { 1.0, 1.0} + struct v2f v2 = v2f(cpvsub(b, nw)); // { 0.0, -1.0} + struct v2f v3 = v2f(cpvadd(b, nw)); // { 0.0, 1.0} + struct v2f v4 = v2f(cpvsub(a, nw)); // { 0.0, -1.0} + struct v2f v5 = v2f(cpvadd(a, nw)); // { 0.0, 1.0} + struct v2f v6 = v2f(cpvsub(a, cpvsub(nw, tw))); // {-1.0, -1.0} + struct v2f v7 = v2f(cpvadd(a, cpvadd(nw, tw))); // {-1.0, 1.0} + + Triangle t0 = {{v0, { 1.0f, -1.0f}, fillColor, outlineColor}, {v1, { 1.0f, 1.0f}, fillColor, outlineColor}, {v2, { 0.0f, -1.0f}, fillColor, outlineColor}}; triangles[0] = t0; + Triangle t1 = {{v3, { 0.0f, 1.0f}, fillColor, outlineColor}, {v1, { 1.0f, 1.0f}, fillColor, outlineColor}, {v2, { 0.0f, -1.0f}, fillColor, outlineColor}}; triangles[1] = t1; + Triangle t2 = {{v3, { 0.0f, 1.0f}, fillColor, outlineColor}, {v4, { 0.0f, -1.0f}, fillColor, outlineColor}, {v2, { 0.0f, -1.0f}, fillColor, outlineColor}}; triangles[2] = t2; + Triangle t3 = {{v3, { 0.0f, 1.0f}, fillColor, outlineColor}, {v4, { 0.0f, -1.0f}, fillColor, outlineColor}, {v5, { 0.0f, 1.0f}, fillColor, outlineColor}}; triangles[3] = t3; + Triangle t4 = {{v6, {-1.0f, -1.0f}, fillColor, outlineColor}, {v4, { 0.0f, -1.0f}, fillColor, outlineColor}, {v5, { 0.0f, 1.0f}, fillColor, outlineColor}}; triangles[4] = t4; + Triangle t5 = {{v6, {-1.0f, -1.0f}, fillColor, outlineColor}, {v7, {-1.0f, 1.0f}, fillColor, outlineColor}, {v5, { 0.0f, 1.0f}, fillColor, outlineColor}}; triangles[5] = t5; +} + +extern cpVect ChipmunkDemoMouse; + +void ChipmunkDebugDrawPolygon(int count, const cpVect *verts, cpFloat radius, cpSpaceDebugColor outlineColor, cpSpaceDebugColor fillColor) +{ + struct ExtrudeVerts {cpVect offset, n;}; + size_t bytes = sizeof(struct ExtrudeVerts)*count; + struct ExtrudeVerts *extrude = (struct ExtrudeVerts *)alloca(bytes); + memset(extrude, 0, sizeof(bytes)); + + for(int i=0; i +#include +#include +#include + +#include "GL/glew.h" +#include "GL/glfw.h" + +#include "chipmunk/chipmunk_private.h" +#include "ChipmunkDemo.h" +#include "ChipmunkDemoTextSupport.h" + +static ChipmunkDemo *demos; +static int demo_count = 0; +static int demo_index = 'a' - 'a'; + +static cpBool paused = cpFalse; +static cpBool step = cpFalse; + +static cpSpace *space; + +static double Accumulator = 0.0; +static double LastTime = 0.0; +int ChipmunkDemoTicks = 0; +double ChipmunkDemoTime; + +cpVect ChipmunkDemoMouse; +cpBool ChipmunkDemoRightClick = cpFalse; +cpBool ChipmunkDemoRightDown = cpFalse; +cpVect ChipmunkDemoKeyboard = {}; + +static cpBody *mouse_body = NULL; +static cpConstraint *mouse_joint = NULL; + +char *ChipmunkDemoMessageString = NULL; + +#define GRABBABLE_MASK_BIT (1<<31) +cpShapeFilter GRAB_FILTER = {CP_NO_GROUP, GRABBABLE_MASK_BIT, GRABBABLE_MASK_BIT}; +cpShapeFilter NOT_GRABBABLE_FILTER = {CP_NO_GROUP, ~GRABBABLE_MASK_BIT, ~GRABBABLE_MASK_BIT}; + +cpVect translate = {0, 0}; +cpFloat scale = 1.0; + +static void ShapeFreeWrap(cpSpace *space, cpShape *shape, void *unused){ + cpSpaceRemoveShape(space, shape); + cpShapeFree(shape); +} + +static void PostShapeFree(cpShape *shape, cpSpace *space){ + cpSpaceAddPostStepCallback(space, (cpPostStepFunc)ShapeFreeWrap, shape, NULL); +} + +static void ConstraintFreeWrap(cpSpace *space, cpConstraint *constraint, void *unused){ + cpSpaceRemoveConstraint(space, constraint); + cpConstraintFree(constraint); +} + +static void PostConstraintFree(cpConstraint *constraint, cpSpace *space){ + cpSpaceAddPostStepCallback(space, (cpPostStepFunc)ConstraintFreeWrap, constraint, NULL); +} + +static void BodyFreeWrap(cpSpace *space, cpBody *body, void *unused){ + cpSpaceRemoveBody(space, body); + cpBodyFree(body); +} + +static void PostBodyFree(cpBody *body, cpSpace *space){ + cpSpaceAddPostStepCallback(space, (cpPostStepFunc)BodyFreeWrap, body, NULL); +} + +// Safe and future proof way to remove and free all objects that have been added to the space. +void +ChipmunkDemoFreeSpaceChildren(cpSpace *space) +{ + // Must remove these BEFORE freeing the body or you will access dangling pointers. + cpSpaceEachShape(space, (cpSpaceShapeIteratorFunc)PostShapeFree, space); + cpSpaceEachConstraint(space, (cpSpaceConstraintIteratorFunc)PostConstraintFree, space); + + cpSpaceEachBody(space, (cpSpaceBodyIteratorFunc)PostBodyFree, space); +} + +static void +DrawCircle(cpVect p, cpFloat a, cpFloat r, cpSpaceDebugColor outline, cpSpaceDebugColor fill, cpDataPointer *data) +{ChipmunkDebugDrawCircle(p, a, r, outline, fill);} + +static void +DrawSegment(cpVect a, cpVect b, cpSpaceDebugColor color, cpDataPointer *data) +{ChipmunkDebugDrawSegment(a, b, color);} + +static void +DrawFatSegment(cpVect a, cpVect b, cpFloat r, cpSpaceDebugColor outline, cpSpaceDebugColor fill, cpDataPointer *data) +{ChipmunkDebugDrawFatSegment(a, b, r, outline, fill);} + +static void +DrawPolygon(int count, const cpVect *verts, cpFloat r, cpSpaceDebugColor outline, cpSpaceDebugColor fill, cpDataPointer *data) +{ChipmunkDebugDrawPolygon(count, verts, r, outline, fill);} + +static void +DrawDot(cpFloat size, cpVect pos, cpSpaceDebugColor color, cpDataPointer *data) +{ChipmunkDebugDrawDot(size, pos, color);} + +static cpSpaceDebugColor +ColorForShape(cpShape *shape, cpDataPointer *data) +{ + if(cpShapeGetSensor(shape)){ + return LAColor(1.0f, 0.1f); + } else { + cpBody *body = shape->body; + + if(cpBodyIsSleeping(body)){ + return LAColor(0.2f, 1.0f); + } else if(body->node.idleTime > shape->space->sleepTimeThreshold) { + return LAColor(0.66f, 1.0f); + } else { + uint32_t val = (uint32_t)shape->hashid; + + // scramble the bits up using Robert Jenkins' 32 bit integer hash function + val = (val+0x7ed55d16) + (val<<12); + val = (val^0xc761c23c) ^ (val>>19); + val = (val+0x165667b1) + (val<<5); + val = (val+0xd3a2646c) ^ (val<<9); + val = (val+0xfd7046c5) + (val<<3); + val = (val^0xb55a4f09) ^ (val>>16); + + GLfloat r = (GLfloat)((val>>0) & 0xFF); + GLfloat g = (GLfloat)((val>>8) & 0xFF); + GLfloat b = (GLfloat)((val>>16) & 0xFF); + + GLfloat max = (GLfloat)cpfmax(cpfmax(r, g), b); + GLfloat min = (GLfloat)cpfmin(cpfmin(r, g), b); + GLfloat intensity = (cpBodyIsStatic(body) ? 0.15f : 0.75f); + + // Saturate and scale the color + if(min == max){ + return RGBAColor(intensity, 0.0f, 0.0f, 1.0f); + } else { + GLfloat coef = (GLfloat)intensity/(max - min); + return RGBAColor( + (r - min)*coef, + (g - min)*coef, + (b - min)*coef, + 1.0f + ); + } + } + } +} + + +void +ChipmunkDemoDefaultDrawImpl(cpSpace *space) +{ + cpSpaceDebugDrawOptions drawOptions = { + DrawCircle, + DrawSegment, + DrawFatSegment, + DrawPolygon, + DrawDot, + + CP_SPACE_DEBUG_DRAW_SHAPES | CP_SPACE_DEBUG_DRAW_CONSTRAINTS | CP_SPACE_DEBUG_DRAW_COLLISION_POINTS, + + {200.0f/255.0f, 210.0f/255.0f, 230.0f/255.0f, 1.0f}, + ColorForShape, + {0.0f, 0.75f, 0.0f, 1.0f}, + {1.0f, 0.0f, 0.0f, 1.0f}, + }; + + cpSpaceDebugDraw(space, &drawOptions); +} + +static void +DrawInstructions() +{ + ChipmunkDemoTextDrawString(cpv(-300, 220), + "Controls:\n" + "A - * Switch demos. (return restarts)\n" + "Use the mouse to grab objects.\n" + ); +} + +static int max_arbiters = 0; +static int max_points = 0; +static int max_constraints = 0; + +static void +DrawInfo() +{ + int arbiters = space->arbiters->num; + int points = 0; + + for(int i=0; iarbiters->arr[i]))->count; + + int constraints = (space->constraints->num + points)*space->iterations; + + max_arbiters = arbiters > max_arbiters ? arbiters : max_arbiters; + max_points = points > max_points ? points : max_points; + max_constraints = constraints > max_constraints ? constraints : max_constraints; + + char buffer[1024]; + const char *format = + "Arbiters: %d (%d) - " + "Contact Points: %d (%d)\n" + "Other Constraints: %d, Iterations: %d\n" + "Constraints x Iterations: %d (%d)\n" + "Time:% 5.2fs, KE:% 5.2e"; + + cpArray *bodies = space->dynamicBodies; + cpFloat ke = 0.0f; + for(int i=0; inum; i++){ + cpBody *body = (cpBody *)bodies->arr[i]; + if(body->m == INFINITY || body->i == INFINITY) continue; + + ke += body->m*cpvdot(body->v, body->v) + body->i*body->w*body->w; + } + + sprintf(buffer, format, + arbiters, max_arbiters, + points, max_points, + space->constraints->num, space->iterations, + constraints, max_constraints, + ChipmunkDemoTime, (ke < 1e-10f ? 0.0f : ke) + ); + + ChipmunkDemoTextDrawString(cpv(0, 220), buffer); +} + +static char PrintStringBuffer[1024*8]; +static char *PrintStringCursor; + +void +ChipmunkDemoPrintString(char *fmt, ...) +{ + ChipmunkDemoMessageString = PrintStringBuffer; + + va_list args; + va_start(args, fmt); + // TODO: should use vsnprintf here + PrintStringCursor += vsprintf(PrintStringCursor, fmt, args); + va_end(args); +} + +static void +Tick(double dt) +{ + if(!paused || step){ + PrintStringBuffer[0] = 0; + PrintStringCursor = PrintStringBuffer; + + // Completely reset the renderer only at the beginning of a tick. + // That way it can always display at least the last ticks' debug drawing. + ChipmunkDebugDrawClearRenderer(); + ChipmunkDemoTextClearRenderer(); + + cpVect new_point = cpvlerp(mouse_body->p, ChipmunkDemoMouse, 0.25f); + mouse_body->v = cpvmult(cpvsub(new_point, mouse_body->p), 60.0f); + mouse_body->p = new_point; + + demos[demo_index].updateFunc(space, dt); + + ChipmunkDemoTicks++; + ChipmunkDemoTime += dt; + + step = cpFalse; + ChipmunkDemoRightDown = cpFalse; + + ChipmunkDemoTextDrawString(cpv(-300, -200), ChipmunkDemoMessageString); + } +} + +static void +Update(void) +{ + double time = glfwGetTime(); + double dt = time - LastTime; + if(dt > 0.2) dt = 0.2; + + double fixed_dt = demos[demo_index].timestep; + + for(Accumulator += dt; Accumulator > fixed_dt; Accumulator -= fixed_dt){ + Tick(fixed_dt); + } + + LastTime = time; +} + +static void +Display(void) +{ + glMatrixMode(GL_MODELVIEW); + glLoadIdentity(); + glTranslatef((GLfloat)translate.x, (GLfloat)translate.y, 0.0f); + glScalef((GLfloat)scale, (GLfloat)scale, 1.0f); + + Update(); + + ChipmunkDebugDrawPushRenderer(); + demos[demo_index].drawFunc(space); + +// // Highlight the shape under the mouse because it looks neat. +// cpShape *nearest = cpSpacePointQueryNearest(space, ChipmunkDemoMouse, 0.0f, CP_ALL_LAYERS, CP_NO_GROUP, NULL); +// if(nearest) ChipmunkDebugDrawShape(nearest, RGBAColor(1.0f, 0.0f, 0.0f, 1.0f), LAColor(0.0f, 0.0f)); + + // Draw the renderer contents and reset it back to the last tick's state. + ChipmunkDebugDrawFlushRenderer(); + ChipmunkDebugDrawPopRenderer(); + + ChipmunkDemoTextPushRenderer(); + // Now render all the UI text. + DrawInstructions(); + DrawInfo(); + + glMatrixMode(GL_MODELVIEW); + glPushMatrix(); { + // Draw the text at fixed positions, + // but save the drawing matrix for the mouse picking + glLoadIdentity(); + + ChipmunkDemoTextFlushRenderer(); + ChipmunkDemoTextPopRenderer(); + } glPopMatrix(); + + glfwSwapBuffers(); + glClear(GL_COLOR_BUFFER_BIT); +} + +static void +Reshape(int width, int height) +{ + glViewport(0, 0, width, height); + + float scale = (float)cpfmin(width/640.0, height/480.0); + float hw = width*(0.5f/scale); + float hh = height*(0.5f/scale); + + ChipmunkDebugDrawPointLineScale = scale; + glLineWidth((GLfloat)scale); + + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + gluOrtho2D(-hw, hw, -hh, hh); +} + +static char * +DemoTitle(int index) +{ + static char title[1024]; + sprintf(title, "Demo(%c): %s", 'a' + index, demos[demo_index].name); + + return title; +} + +static void +RunDemo(int index) +{ + srand(45073); + + demo_index = index; + + ChipmunkDemoTicks = 0; + ChipmunkDemoTime = 0.0; + Accumulator = 0.0; + LastTime = glfwGetTime(); + + mouse_joint = NULL; + ChipmunkDemoMessageString = ""; + max_arbiters = 0; + max_points = 0; + max_constraints = 0; + space = demos[demo_index].initFunc(); + + glfwSetWindowTitle(DemoTitle(index)); +} + +static void +Keyboard(int key, int state) +{ + if(state == GLFW_RELEASE) return; + + int index = key - 'a'; + + if(0 <= index && index < demo_count){ + demos[demo_index].destroyFunc(space); + RunDemo(index); + } else if(key == ' '){ + demos[demo_index].destroyFunc(space); + RunDemo(demo_index); + } else if(key == '`'){ + paused = !paused; + } else if(key == '1'){ + step = cpTrue; + } else if(key == '\\'){ + glDisable(GL_LINE_SMOOTH); + glDisable(GL_POINT_SMOOTH); + } + + GLfloat translate_increment = 50.0f/(GLfloat)scale; + GLfloat scale_increment = 1.2f; + if(key == '5'){ + translate.x = 0.0f; + translate.y = 0.0f; + scale = 1.0f; + }else if(key == '4'){ + translate.x += translate_increment; + }else if(key == '6'){ + translate.x -= translate_increment; + }else if(key == '2'){ + translate.y += translate_increment; + }else if(key == '8'){ + translate.y -= translate_increment; + }else if(key == '7'){ + scale /= scale_increment; + }else if(key == '9'){ + scale *= scale_increment; + } +} + +static cpVect +MouseToSpace(int x, int y) +{ + GLdouble model[16]; + glGetDoublev(GL_MODELVIEW_MATRIX, model); + + GLdouble proj[16]; + glGetDoublev(GL_PROJECTION_MATRIX, proj); + + GLint view[4]; + glGetIntegerv(GL_VIEWPORT, view); + + int ww, wh; + glfwGetWindowSize(&ww, &wh); + + GLdouble mx, my, mz; + gluUnProject(x, wh - y, 0.0f, model, proj, view, &mx, &my, &mz); + + return cpv(mx, my); +} + +static void +Mouse(int x, int y) +{ + ChipmunkDemoMouse = MouseToSpace(x, y); +} + +static void +Click(int button, int state) +{ + if(button == GLFW_MOUSE_BUTTON_1){ + if(state == GLFW_PRESS){ + // give the mouse click a little radius to make it easier to click small shapes. + cpFloat radius = 5.0; + + cpPointQueryInfo info = {}; + cpShape *shape = cpSpacePointQueryNearest(space, ChipmunkDemoMouse, radius, GRAB_FILTER, &info); + + if(shape){ + // Use the closest point on the surface if the click is outside of the shape. + cpVect nearest = (info.distance > 0.0f ? info.point : ChipmunkDemoMouse); + + cpBody *body = shape->body; + mouse_joint = cpPivotJointNew2(mouse_body, body, cpvzero, cpBodyWorldToLocal(body, nearest)); + mouse_joint->maxForce = 50000.0f; + mouse_joint->errorBias = cpfpow(1.0f - 0.15f, 60.0f); + cpSpaceAddConstraint(space, mouse_joint); + } + } else if(mouse_joint){ + cpSpaceRemoveConstraint(space, mouse_joint); + cpConstraintFree(mouse_joint); + mouse_joint = NULL; + } + } else if(button == GLFW_MOUSE_BUTTON_2){ + ChipmunkDemoRightDown = ChipmunkDemoRightClick = (state == GLFW_PRESS); + } +} + +static void +SpecialKeyboard(int key, int state) +{ + switch(key){ + case GLFW_KEY_UP : ChipmunkDemoKeyboard.y += (state == GLFW_PRESS ? 1.0 : -1.0); break; + case GLFW_KEY_DOWN : ChipmunkDemoKeyboard.y += (state == GLFW_PRESS ? -1.0 : 1.0); break; + case GLFW_KEY_RIGHT: ChipmunkDemoKeyboard.x += (state == GLFW_PRESS ? 1.0 : -1.0); break; + case GLFW_KEY_LEFT : ChipmunkDemoKeyboard.x += (state == GLFW_PRESS ? -1.0 : 1.0); break; + default: break; + } +} + +static int +WindowClose() +{ + glfwTerminate(); + exit(EXIT_SUCCESS); + + return GL_TRUE; +} + +static void +SetupGL(void) +{ + glewExperimental = GL_TRUE; + cpAssertHard(glewInit() == GLEW_NO_ERROR, "There was an error initializing GLEW."); + cpAssertHard(GLEW_ARB_vertex_array_object, "Requires VAO support."); + + ChipmunkDebugDrawInit(); + ChipmunkDemoTextInit(); + + glClearColor(52.0f/255.0f, 62.0f/255.0f, 72.0f/255.0f, 1.0f); + glClear(GL_COLOR_BUFFER_BIT); + + glEnable(GL_LINE_SMOOTH); + glEnable(GL_POINT_SMOOTH); + + glHint(GL_LINE_SMOOTH_HINT, GL_DONT_CARE); + glHint(GL_POINT_SMOOTH_HINT, GL_DONT_CARE); + + glEnable(GL_BLEND); + glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA); +} + +static void +SetupGLFW() +{ + cpAssertHard(glfwInit(), "Error initializing GLFW."); + + cpAssertHard(glfwOpenWindow(640, 480, 8, 8, 8, 8, 0, 0, GLFW_WINDOW), "Error opening GLFW window."); + glfwSetWindowTitle(DemoTitle(demo_index)); + glfwSwapInterval(1); + + SetupGL(); + + glfwSetWindowSizeCallback(Reshape); + glfwSetWindowCloseCallback(WindowClose); + + glfwSetCharCallback(Keyboard); + glfwSetKeyCallback(SpecialKeyboard); + + glfwSetMousePosCallback(Mouse); + glfwSetMouseButtonCallback(Click); +} + +static void +TimeTrial(int index, int count) +{ + space = demos[index].initFunc(); + + double start_time = glfwGetTime(); + double dt = demos[index].timestep; + + for(int i=0; i +#include +#include + +#include "GL/glew.h" +#include "GL/glfw.h" + +#include "chipmunk/chipmunk.h" + +#include "ChipmunkDemoShaderSupport.h" + +void +CheckGLErrors(void) +{ + for(GLenum err = glGetError(); err; err = glGetError()){ + if(err){ + fprintf(stderr, "GLError(%s:%d) 0x%04X\n", __FILE__, __LINE__, err); + abort(); + } + } +} + +//typedef GLAPIENTRY void (*GETIV)(GLuint shader, GLenum pname, GLint *params); +//typedef GLAPIENTRY void (*GETINFOLOG)(GLuint shader, GLsizei maxLength, GLsizei *length, GLchar *infoLog); + +static cpBool +CheckError(GLint obj, GLenum status, PFNGLGETSHADERIVPROC getiv, PFNGLGETSHADERINFOLOGPROC getInfoLog) +{ + GLint success; + getiv(obj, status, &success); + + if(!success){ + GLint length; + getiv(obj, GL_INFO_LOG_LENGTH, &length); + + char *log = (char *)alloca(length); + getInfoLog(obj, length, NULL, log); + + fprintf(stderr, "Shader compile error for 0x%04X: %s\n", status, log); + return cpFalse; + } else { + return cpTrue; + } +} + +GLint +CompileShader(GLenum type, const char *source) +{ + GLint shader = glCreateShader(type); + + glShaderSource(shader, 1, &source, NULL); + glCompileShader(shader); + + // TODO: return placeholder shader instead? + cpAssertHard(CheckError(shader, GL_COMPILE_STATUS, glGetShaderiv, glGetShaderInfoLog), "Error compiling shader"); + + return shader; +} + +GLint +LinkProgram(GLint vshader, GLint fshader) +{ + GLint program = glCreateProgram(); + + glAttachShader(program, vshader); + glAttachShader(program, fshader); + glLinkProgram(program); + + // todo return placeholder program instead? + cpAssertHard(CheckError(program, GL_LINK_STATUS, glGetProgramiv, glGetProgramInfoLog), "Error linking shader program"); + + return program; +} + +cpBool +ValidateProgram(GLint program) +{ + // TODO: Implement? + return cpTrue; +} + +void +SetAttribute(GLuint program, char *name, GLint size, GLenum gltype, GLsizei stride, GLvoid *offset) +{ + GLint index = glGetAttribLocation(program, name); + glEnableVertexAttribArray(index); + glVertexAttribPointer(index, size, gltype, GL_FALSE, stride, offset); +} diff --git a/external/Chipmunk/Demo/ChipmunkDemoShaderSupport.h b/external/Chipmunk/Demo/ChipmunkDemoShaderSupport.h new file mode 100644 index 0000000..f199060 --- /dev/null +++ b/external/Chipmunk/Demo/ChipmunkDemoShaderSupport.h @@ -0,0 +1,36 @@ +/* Copyright (c) 2007 Scott Lembcke + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +#include + +void CheckGLErrors(void); +#define CHECK_GL_ERRORS() CheckGLErrors() + +GLint CompileShader(GLenum type, const char *source); +GLint LinkProgram(GLint vshader, GLint fshader); +cpBool ValidateProgram(GLint program); + +#define GLSL(x) #x + +void SetAttribute(GLuint program, char *name, GLint size, GLenum gltype, GLsizei stride, GLvoid *offset); + +#define SET_ATTRIBUTE(program, type, name, gltype)\ + SetAttribute(program, #name, sizeof(((type *)NULL)->name)/sizeof(GLfloat), gltype, sizeof(type), (GLvoid *)offsetof(type, name)) diff --git a/external/Chipmunk/Demo/ChipmunkDemoTextSupport.c b/external/Chipmunk/Demo/ChipmunkDemoTextSupport.c new file mode 100644 index 0000000..ef650c2 --- /dev/null +++ b/external/Chipmunk/Demo/ChipmunkDemoTextSupport.c @@ -0,0 +1,257 @@ +/* Copyright (c) 2007 Scott Lembcke + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +#include + +#include "GL/glew.h" +#include "GL/glfw.h" + +#include "chipmunk/chipmunk_private.h" +#include "ChipmunkDemo.h" +#include "ChipmunkDemoShaderSupport.h" +#include "ChipmunkDemoTextSupport.h" + +#include "VeraMoBd.ttf_sdf.h" + +//#define Scale 3.0f +#define Scale 0.70f +#define LineHeight (18.0f*Scale) + +static GLuint program; +static GLuint texture; + +struct v2f {GLfloat x, y;}; +typedef struct Vertex {struct v2f vertex, tex_coord; cpSpaceDebugColor color;} Vertex; +typedef struct Triangle {Vertex a, b, c;} Triangle; + +static GLuint vao = 0; +static GLuint vbo = 0; + +// char -> glyph indexes generated by the lonesock tool. +static int glyph_indexes[256]; + +void +ChipmunkDemoTextInit(void) +{ + GLint vshader = CompileShader(GL_VERTEX_SHADER, GLSL( + attribute vec2 vertex; + attribute vec2 tex_coord; + attribute vec4 color; + + varying vec2 v_tex_coord; + varying vec4 v_color; + + void main(void){ + // TODO: get rid of the GL 2.x matrix bit eventually? + gl_Position = gl_ModelViewProjectionMatrix*vec4(vertex, 0.0, 1.0); + + v_color = color; + v_tex_coord = tex_coord; + } + )); + + GLint fshader = CompileShader(GL_FRAGMENT_SHADER, GLSL( + uniform sampler2D u_texture; + + varying vec2 v_tex_coord; + varying vec4 v_color; + + float aa_step(float t1, float t2, float f) + { + //return step(t2, f); + return smoothstep(t1, t2, f); + } + + void main(void) + { + float sdf = texture2D(u_texture, v_tex_coord).a; + + //float fw = fwidth(sdf)*0.5; + float fw = length(vec2(dFdx(sdf), dFdy(sdf)))*0.5; + + float alpha = aa_step(0.5 - fw, 0.5 + fw, sdf); + gl_FragColor = v_color*(v_color.a*alpha); +// gl_FragColor = vec4(1, 0, 0, 1); + } + )); + + program = LinkProgram(vshader, fshader); + CHECK_GL_ERRORS(); + +// GLint index = -1;//glGetUniformLocation(program, "u_texture"); +// glUniform1i(index, 0); +// CHECK_GL_ERRORS(); + + // Setu VBO and VAO. +#if __APPLE__ + glGenVertexArraysAPPLE(1, &vao); + glBindVertexArrayAPPLE(vao); +#else + glGenVertexArrays(1, &vao); + glBindVertexArray(vao); +#endif + + glGenBuffers(1, &vbo); + glBindBuffer(GL_ARRAY_BUFFER, vbo); + + SET_ATTRIBUTE(program, struct Vertex, vertex, GL_FLOAT); + SET_ATTRIBUTE(program, struct Vertex, tex_coord, GL_FLOAT); + SET_ATTRIBUTE(program, struct Vertex, color, GL_FLOAT); + + glBindBuffer(GL_ARRAY_BUFFER, 0); +#if __APPLE__ + glBindVertexArrayAPPLE(0); +#else + glBindVertexArray(0); +#endif + CHECK_GL_ERRORS(); + + // Load the SDF font texture. + glGenTextures(1, &texture); + glBindTexture(GL_TEXTURE_2D, texture); + glTexImage2D(GL_TEXTURE_2D, 0, GL_ALPHA, sdf_tex_width, sdf_tex_height, 0, GL_ALPHA, GL_UNSIGNED_BYTE, sdf_data); + glGenerateMipmap(GL_TEXTURE_2D); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP); + CHECK_GL_ERRORS(); + + // Fill in the glyph index array. + for(int i=0; i __b__ ? __a__ : __b__) + +static GLsizei triangle_capacity = 0; +static GLsizei triangle_count = 0; +static Triangle *triangle_buffer = NULL; + +static Triangle *PushTriangles(size_t count) +{ + if(triangle_count + count > triangle_capacity){ + triangle_capacity += MAX(triangle_capacity, count); + triangle_buffer = (Triangle *)realloc(triangle_buffer, triangle_capacity*sizeof(Triangle)); + } + + Triangle *buffer = triangle_buffer + triangle_count; + triangle_count += count; + return buffer; +} + +static GLfloat +PushChar(int character, GLfloat x, GLfloat y, cpSpaceDebugColor color) +{ + int i = glyph_indexes[character]; + GLfloat w = (GLfloat)sdf_tex_width; + GLfloat h = (GLfloat)sdf_tex_height; + + GLfloat gw = (GLfloat)sdf_spacing[i*8 + 3]; + GLfloat gh = (GLfloat)sdf_spacing[i*8 + 4]; + + GLfloat txmin = sdf_spacing[i*8 + 1]/w; + GLfloat tymin = sdf_spacing[i*8 + 2]/h; + GLfloat txmax = txmin + gw/w; + GLfloat tymax = tymin + gh/h; + + GLfloat s = Scale/scale_factor; + GLfloat xmin = x + sdf_spacing[i*8 + 5]/scale_factor*Scale; + GLfloat ymin = y + (sdf_spacing[i*8 + 6]/scale_factor - gh)*Scale; + GLfloat xmax = xmin + gw*Scale; + GLfloat ymax = ymin + gh*Scale; + + Vertex a = {{xmin, ymin}, {txmin, tymax}, color}; + Vertex b = {{xmin, ymax}, {txmin, tymin}, color}; + Vertex c = {{xmax, ymax}, {txmax, tymin}, color}; + Vertex d = {{xmax, ymin}, {txmax, tymax}, color}; + + Triangle *triangles = PushTriangles(2); + Triangle t0 = {a, b, c}; triangles[0] = t0; + Triangle t1 = {a, c, d}; triangles[1] = t1; + + return sdf_spacing[i*8 + 7]*s; +} + +#undef ChipmunkDemoTextDrawString + +void +ChipmunkDemoTextDrawString(cpVect pos, char *str) +{ + cpSpaceDebugColor c = LAColor(1.0f, 1.0f); + GLfloat x = (GLfloat)pos.x, y = (GLfloat)pos.y; + + for(size_t i=0, len=strlen(str); imagnitudeSum += cpvlength(j); + context->vectorSum = cpvadd(context->vectorSum, j); +} + +#endif + +static void +update(cpSpace *space, double dt) +{ + cpSpaceStep(space, dt); + + ChipmunkDemoPrintString("Place objects on the scale to weigh them. The ball marks the shapes it's sitting on.\n"); + + // Sum the total impulse applied to the scale from all collision pairs in the contact graph. + // If your compiler supports blocks, your life is a little easier. + // You can use the "Block" versions of the functions without needing the callbacks above. + #if USE_BLOCKS + __block cpVect impulseSum = cpvzero; + cpBodyEachArbiter_b(scaleStaticBody, ^(cpArbiter *arb){ + impulseSum = cpvadd(impulseSum, cpArbiterTotalImpulse(arb)); + }); + #else + cpVect impulseSum = cpvzero; + cpBodyEachArbiter(scaleStaticBody, (cpBodyArbiterIteratorFunc)ScaleIterator, &impulseSum); + #endif + + // Force is the impulse divided by the timestep. + cpFloat force = cpvlength(impulseSum)/dt; + + // Weight can be found similarly from the gravity vector. + cpVect g = cpSpaceGetGravity(space); + cpFloat weight = cpvdot(g, impulseSum)/(cpvlengthsq(g)*dt); + + ChipmunkDemoPrintString("Total force: %5.2f, Total weight: %5.2f. ", force, weight); + + + // Highlight and count the number of shapes the ball is touching. + #if USE_BLOCKS + __block int count = 0; + cpBodyEachArbiter_b(ballBody, ^(cpArbiter *arb){ + // body is the body we are iterating the arbiters for. + // CP_ARBITER_GET_*() in an arbiter iterator always returns the body/shape for the iterated body first. + CP_ARBITER_GET_SHAPES(arb, ball, other); + ChipmunkDebugDrawBB(cpShapeGetBB(other), RGBAColor(1, 0, 0, 1)); + + count++; + }); + #else + int count = 0; + cpBodyEachArbiter(ballBody, (cpBodyArbiterIteratorFunc)BallIterator, &count); + #endif + + ChipmunkDemoPrintString("The ball is touching %d shapes.\n", count); + + #if USE_BLOCKS + __block cpFloat magnitudeSum = 0.0f; + __block cpVect vectorSum = cpvzero; + cpBodyEachArbiter_b(ballBody, ^(cpArbiter *arb){ + cpVect j = cpArbiterTotalImpulse(arb); + magnitudeSum += cpvlength(j); + vectorSum = cpvadd(vectorSum, j); + }); + + cpFloat crushForce = (magnitudeSum - cpvlength(vectorSum))*dt; + #else + struct CrushingContext crush = {0.0f, cpvzero}; + cpBodyEachArbiter(ballBody, (cpBodyArbiterIteratorFunc)EstimateCrushing, &crush); + + cpFloat crushForce = (crush.magnitudeSum - cpvlength(crush.vectorSum))*dt; + #endif + + + if(crushForce > 10.0f){ + ChipmunkDemoPrintString("The ball is being crushed. (f: %.2f)", crushForce); + } else { + ChipmunkDemoPrintString("The ball is not being crushed. (f: %.2f)", crushForce); + } +} + +#define WIDTH 4.0f +#define HEIGHT 30.0f + +static cpSpace * +init(void) +{ + cpSpace *space = cpSpaceNew(); + cpSpaceSetIterations(space, 30); + cpSpaceSetGravity(space, cpv(0, -300)); + cpSpaceSetCollisionSlop(space, 0.5); + cpSpaceSetSleepTimeThreshold(space, 1.0f); + + cpBody *body, *staticBody = cpSpaceGetStaticBody(space); + cpShape *shape; + + // Create segments around the edge of the screen. + shape = cpSpaceAddShape(space, cpSegmentShapeNew(staticBody, cpv(-320,-240), cpv(-320,240), 0.0f)); + cpShapeSetElasticity(shape, 1.0f); + cpShapeSetFriction(shape, 1.0f); + cpShapeSetFilter(shape, NOT_GRABBABLE_FILTER); + + shape = cpSpaceAddShape(space, cpSegmentShapeNew(staticBody, cpv(320,-240), cpv(320,240), 0.0f)); + cpShapeSetElasticity(shape, 1.0f); + cpShapeSetFriction(shape, 1.0f); + cpShapeSetFilter(shape, NOT_GRABBABLE_FILTER); + + shape = cpSpaceAddShape(space, cpSegmentShapeNew(staticBody, cpv(-320,-240), cpv(320,-240), 0.0f)); + cpShapeSetElasticity(shape, 1.0f); + cpShapeSetFriction(shape, 1.0f); + cpShapeSetFilter(shape, NOT_GRABBABLE_FILTER); + + scaleStaticBody = cpSpaceAddBody(space, cpBodyNewStatic()); + shape = cpSpaceAddShape(space, cpSegmentShapeNew(scaleStaticBody, cpv(-240,-180), cpv(-140,-180), 4.0f)); + cpShapeSetElasticity(shape, 1.0f); + cpShapeSetFriction(shape, 1.0f); + cpShapeSetFilter(shape, NOT_GRABBABLE_FILTER); + + // add some boxes to stack on the scale + for(int i=0; i<5; i++){ + body = cpSpaceAddBody(space, cpBodyNew(1.0f, cpMomentForBox(1.0f, 30.0f, 30.0f))); + cpBodySetPosition(body, cpv(0, i*32 - 220)); + + shape = cpSpaceAddShape(space, cpBoxShapeNew(body, 30.0f, 30.0f, 0.0)); + cpShapeSetElasticity(shape, 0.0f); + cpShapeSetFriction(shape, 0.8f); + } + + // Add a ball that we'll track which objects are beneath it. + cpFloat radius = 15.0f; + ballBody = cpSpaceAddBody(space, cpBodyNew(10.0f, cpMomentForCircle(10.0f, 0.0f, radius, cpvzero))); + cpBodySetPosition(ballBody, cpv(120, -240 + radius+5)); + + shape = cpSpaceAddShape(space, cpCircleShapeNew(ballBody, radius, cpvzero)); + cpShapeSetElasticity(shape, 0.0f); + cpShapeSetFriction(shape, 0.9f); + + return space; +} + +static void +destroy(cpSpace *space) +{ + ChipmunkDemoFreeSpaceChildren(space); + cpSpaceFree(space); +} + +ChipmunkDemo ContactGraph = { + "Contact Graph", + 1.0/60.0, + init, + update, + ChipmunkDemoDefaultDrawImpl, + destroy, +}; diff --git a/external/Chipmunk/Demo/ContactPoints.c b/external/Chipmunk/Demo/ContactPoints.c new file mode 100644 index 0000000..6c25cda --- /dev/null +++ b/external/Chipmunk/Demo/ContactPoints.c @@ -0,0 +1,143 @@ +/* Copyright (c) 2007 Scott Lembcke + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +#include +#include +#include +#include + +#include "chipmunk_private.h" +#include "ChipmunkDemo.h" + +static cpBool NeverCollide(cpArbiter *arb, cpSpace *space, void *data){return cpFalse;} + +static void +update(cpSpace *space) +{ + int steps = 1; + cpFloat dt = 1.0f/60.0f/(cpFloat)steps; + + for(int i=0; i tolerance){ + cpBody *body = cpShapeGetBody(shape); + int count = cpPolyShapeGetCount(shape); + + // Allocate the space for the new vertexes on the stack. + cpVect *verts = (cpVect *)alloca((count + 1)*sizeof(cpVect)); + + for(int i=0; ibeginFunc = (cpCollisionBeginFunc)HookCrate; + + + return space; +} + +static void +destroy(cpSpace *space) +{ + ChipmunkDemoFreeSpaceChildren(space); + cpSpaceFree(space); +} + +ChipmunkDemo Crane = { + "Crane", + 1.0/60.0, + init, + update, + ChipmunkDemoDefaultDrawImpl, + destroy, +}; diff --git a/external/Chipmunk/Demo/GJK.c b/external/Chipmunk/Demo/GJK.c new file mode 100644 index 0000000..a79fcbc --- /dev/null +++ b/external/Chipmunk/Demo/GJK.c @@ -0,0 +1,148 @@ +/* Copyright (c) 2007 Scott Lembcke + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +#include +#include +#include +#include + +#include "chipmunk_private.h" +#include "chipmunk_unsafe.h" +#include "ChipmunkDemo.h" + +static cpShape *shape1, *shape2; + +static void +update(cpSpace *space, cpFloat dt) +{ + cpSpaceStep(space, dt); +} + +static void +draw(cpSpace *space) +{ + ChipmunkDemoDefaultDrawImpl(space); + struct cpContact arr[CP_MAX_CONTACTS_PER_ARBITER]; +// cpCollideShapes(shape1, shape2, (cpCollisionID[]){0}, arr); + cpCollisionInfo info = cpCollideShapes(shape2, shape1, 0x00000000, arr); +} + +static cpSpace * +init(void) +{ + cpSpace *space = cpSpaceNew(); + cpSpaceSetIterations(space, 5); + space->damping = 0.1; + + cpFloat mass = 1.0f; + + { + cpFloat size = 100.0; + + cpBody *body = cpSpaceAddBody(space, cpBodyNew(mass, cpMomentForBox(mass, size, size))); + cpBodySetPosition(body, cpv(100.0, 50.0f)); + + shape1 = cpSpaceAddShape(space, cpBoxShapeNew(body, size, size, 0.0)); + shape1->group = 1; + }{ + cpFloat size = 100.0; + + cpBody *body = cpSpaceAddBody(space, cpBodyNew(mass, cpMomentForBox(mass, size, size))); + cpBodySetPosition(body, cpv(120.0, -40.0f)); + cpBodySetAngle(body, 1e-2); + + shape2 = cpSpaceAddShape(space, cpBoxShapeNew(body, size, size, 0.0)); + shape2->group = 1; + } + +// { +// cpFloat size = 100.0; +// const int NUM_VERTS = 5; +// +// cpVect verts[NUM_VERTS]; +// for(int i=0; igroup = 1; +// } +// { +// cpFloat size = 100.0; +// const int NUM_VERTS = 4; +// +// cpVect verts[NUM_VERTS]; +// for(int i=0; igroup = 1; +// } +// +// { +// cpFloat size = 150.0; +// cpFloat radius = 25.0; +// +// cpVect a = cpv( size/2.0, 0.0); +// cpVect b = cpv(-size/2.0, 0.0); +// cpBody *body = cpSpaceAddBody(space, cpBodyNew(mass, cpMomentForSegment(mass, a, b))); +// cpBodySetPosition(body, cpv(0, 25)); +// +// shape1 = cpSpaceAddShape(space, cpSegmentShapeNew(body, a, b, radius)); +// shape1->group = 1; +// } +// { +// cpFloat radius = 50.0; +// +// cpBody *body = cpSpaceAddBody(space, cpBodyNew(mass, cpMomentForCircle(mass, 0.0f, radius, cpvzero))); +// cpBodySetPosition(body, cpv(0, -25)); +// +// shape2 = cpSpaceAddShape(space, cpCircleShapeNew(body, radius, cpvzero)); +// shape2->group = 1; +// } + + return space; +} + +static void +destroy(cpSpace *space) +{ + ChipmunkDemoFreeSpaceChildren(space); + cpSpaceFree(space); +} + +ChipmunkDemo GJK = { + "GJK", + 1.0f/60.0f, + init, + update, + draw, + destroy, +}; diff --git a/external/Chipmunk/Demo/GLEWConfig.cmake b/external/Chipmunk/Demo/GLEWConfig.cmake new file mode 100644 index 0000000..4b05ba6 --- /dev/null +++ b/external/Chipmunk/Demo/GLEWConfig.cmake @@ -0,0 +1,4 @@ +set(GLEW_INCLUDE_DIR "@CMAKE_INSTALL_PREFIX@/include") +set(GLEW_LIBRARY_DIR "@CMAKE_INSTALL_PREFIX@/lib@LIB_SUFFIX@") + +find_library(GLEW_LIBRARY "@GLEW_LIB_NAME@" HINTS ${GLEW_LIBRARY_DIR}) diff --git a/external/Chipmunk/Demo/GLFWConfig.cmake b/external/Chipmunk/Demo/GLFWConfig.cmake new file mode 100644 index 0000000..796ad2c --- /dev/null +++ b/external/Chipmunk/Demo/GLFWConfig.cmake @@ -0,0 +1,10 @@ +# - Config file for the glfw package +# It defines the following variables +# GLFW_INCLUDE_DIR, the path where GLFW headers are located +# GLFW_LIBRARY_DIR, folder in which the GLFW library is located +# GLFW_LIBRARY, library to link against to use GLFW + +set(GLFW_INCLUDE_DIR "@CMAKE_INSTALL_PREFIX@/include") +set(GLFW_LIBRARY_DIR "@CMAKE_INSTALL_PREFIX@/lib@LIB_SUFFIX@") + +find_library(GLFW_LIBRARY "@GLFW_LIB_NAME@" HINTS ${GLFW_LIBRARY_DIR}) diff --git a/external/Chipmunk/Demo/Joints.c b/external/Chipmunk/Demo/Joints.c new file mode 100644 index 0000000..c4c7b5a --- /dev/null +++ b/external/Chipmunk/Demo/Joints.c @@ -0,0 +1,298 @@ +/* Copyright (c) 2007 Scott Lembcke + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +#include "chipmunk/chipmunk.h" +#include "ChipmunkDemo.h" + +static cpBody * +addBall(cpSpace *space, cpVect pos, cpVect boxOffset) +{ + cpFloat radius = 15.0f; + cpFloat mass = 1.0f; + cpBody *body = cpSpaceAddBody(space, cpBodyNew(mass, cpMomentForCircle(mass, 0.0f, radius, cpvzero))); + cpBodySetPosition(body, cpvadd(pos, boxOffset)); + + cpShape *shape = cpSpaceAddShape(space, cpCircleShapeNew(body, radius, cpvzero)); + cpShapeSetElasticity(shape, 0.0f); + cpShapeSetFriction(shape, 0.7f); + + return body; +} + +static cpBody * +addLever(cpSpace *space, cpVect pos, cpVect boxOffset) +{ + cpFloat mass = 1.0f; + cpVect a = cpv(0, 15); + cpVect b = cpv(0, -15); + + cpBody *body = cpSpaceAddBody(space, cpBodyNew(mass, cpMomentForSegment(mass, a, b, 0.0f))); + cpBodySetPosition(body, cpvadd(pos, cpvadd(boxOffset, cpv(0, -15)))); + + cpShape *shape = cpSpaceAddShape(space, cpSegmentShapeNew(body, a, b, 5.0f)); + cpShapeSetElasticity(shape, 0.0f); + cpShapeSetFriction(shape, 0.7f); + + return body; +} + +static cpBody * +addBar(cpSpace *space, cpVect pos, cpVect boxOffset) +{ + cpFloat mass = 2.0f; + cpVect a = cpv(0, 30); + cpVect b = cpv(0, -30); + + cpBody *body = cpSpaceAddBody(space, cpBodyNew(mass, cpMomentForSegment(mass, a, b, 0.0f))); + cpBodySetPosition(body, cpvadd(pos, boxOffset)); + + cpShape *shape = cpSpaceAddShape(space, cpSegmentShapeNew(body, a, b, 5.0f)); + cpShapeSetElasticity(shape, 0.0f); + cpShapeSetFriction(shape, 0.7f); + cpShapeSetFilter(shape, cpShapeFilterNew(1, CP_ALL_CATEGORIES, CP_ALL_CATEGORIES)); + + return body; +} + +static cpBody * +addWheel(cpSpace *space, cpVect pos, cpVect boxOffset) +{ + cpFloat radius = 15.0f; + cpFloat mass = 1.0f; + cpBody *body = cpSpaceAddBody(space, cpBodyNew(mass, cpMomentForCircle(mass, 0.0f, radius, cpvzero))); + cpBodySetPosition(body, cpvadd(pos, boxOffset)); + + cpShape *shape = cpSpaceAddShape(space, cpCircleShapeNew(body, radius, cpvzero)); + cpShapeSetElasticity(shape, 0.0f); + cpShapeSetFriction(shape, 0.7f); + cpShapeSetFilter(shape, cpShapeFilterNew(1, CP_ALL_CATEGORIES, CP_ALL_CATEGORIES)); + + return body; +} + +static cpBody * +addChassis(cpSpace *space, cpVect pos, cpVect boxOffset) +{ + cpFloat mass = 5.0f; + cpFloat width = 80; + cpFloat height = 30; + + cpBody *body = cpSpaceAddBody(space, cpBodyNew(mass, cpMomentForBox(mass, width, height))); + cpBodySetPosition(body, cpvadd(pos, boxOffset)); + + cpShape *shape = cpSpaceAddShape(space, cpBoxShapeNew(body, width, height, 0.0)); + cpShapeSetElasticity(shape, 0.0f); + cpShapeSetFriction(shape, 0.7f); + cpShapeSetFilter(shape, cpShapeFilterNew(1, CP_ALL_CATEGORIES, CP_ALL_CATEGORIES)); + + return body; +} + +static cpSpace * +init(void) +{ + cpSpace *space = cpSpaceNew(); + cpSpaceSetIterations(space, 10); + cpSpaceSetGravity(space, cpv(0, -100)); + cpSpaceSetSleepTimeThreshold(space, 0.5f); + + cpBody *staticBody = cpSpaceGetStaticBody(space); + cpShape *shape; + + shape = cpSpaceAddShape(space, cpSegmentShapeNew(staticBody, cpv(-320,240), cpv(320,240), 0.0f)); + cpShapeSetElasticity(shape, 1.0f); + cpShapeSetFriction(shape, 1.0f); + cpShapeSetFilter(shape, NOT_GRABBABLE_FILTER); + + shape = cpSpaceAddShape(space, cpSegmentShapeNew(staticBody, cpv(-320,120), cpv(320,120), 0.0f)); + cpShapeSetElasticity(shape, 1.0f); + cpShapeSetFriction(shape, 1.0f); + cpShapeSetFilter(shape, NOT_GRABBABLE_FILTER); + + shape = cpSpaceAddShape(space, cpSegmentShapeNew(staticBody, cpv(-320,0), cpv(320,0), 0.0f)); + cpShapeSetElasticity(shape, 1.0f); + cpShapeSetFriction(shape, 1.0f); + cpShapeSetFilter(shape, NOT_GRABBABLE_FILTER); + + shape = cpSpaceAddShape(space, cpSegmentShapeNew(staticBody, cpv(-320,-120), cpv(320,-120), 0.0f)); + cpShapeSetElasticity(shape, 1.0f); + cpShapeSetFriction(shape, 1.0f); + cpShapeSetFilter(shape, NOT_GRABBABLE_FILTER); + + shape = cpSpaceAddShape(space, cpSegmentShapeNew(staticBody, cpv(-320,-240), cpv(320,-240), 0.0f)); + cpShapeSetElasticity(shape, 1.0f); + cpShapeSetFriction(shape, 1.0f); + cpShapeSetFilter(shape, NOT_GRABBABLE_FILTER); + + + shape = cpSpaceAddShape(space, cpSegmentShapeNew(staticBody, cpv(-320,-240), cpv(-320,240), 0.0f)); + cpShapeSetElasticity(shape, 1.0f); + cpShapeSetFriction(shape, 1.0f); + cpShapeSetFilter(shape, NOT_GRABBABLE_FILTER); + + shape = cpSpaceAddShape(space, cpSegmentShapeNew(staticBody, cpv(-160,-240), cpv(-160,240), 0.0f)); + cpShapeSetElasticity(shape, 1.0f); + cpShapeSetFriction(shape, 1.0f); + cpShapeSetFilter(shape, NOT_GRABBABLE_FILTER); + + shape = cpSpaceAddShape(space, cpSegmentShapeNew(staticBody, cpv(0,-240), cpv(0,240), 0.0f)); + cpShapeSetElasticity(shape, 1.0f); + cpShapeSetFriction(shape, 1.0f); + cpShapeSetFilter(shape, NOT_GRABBABLE_FILTER); + + shape = cpSpaceAddShape(space, cpSegmentShapeNew(staticBody, cpv(160,-240), cpv(160,240), 0.0f)); + cpShapeSetElasticity(shape, 1.0f); + cpShapeSetFriction(shape, 1.0f); + cpShapeSetFilter(shape, NOT_GRABBABLE_FILTER); + + shape = cpSpaceAddShape(space, cpSegmentShapeNew(staticBody, cpv(320,-240), cpv(320,240), 0.0f)); + cpShapeSetElasticity(shape, 1.0f); + cpShapeSetFriction(shape, 1.0f); + cpShapeSetFilter(shape, NOT_GRABBABLE_FILTER); + + cpVect boxOffset; + cpBody *body1, *body2; + + cpVect posA = cpv( 50, 60); + cpVect posB = cpv(110, 60); + + #define POS_A cpvadd(boxOffset, posA) + #define POS_B cpvadd(boxOffset, posB) + + // Pin Joints - Link shapes with a solid bar or pin. + // Keeps the anchor points the same distance apart from when the joint was created. + boxOffset = cpv(-320, -240); + body1 = addBall(space, posA, boxOffset); + body2 = addBall(space, posB, boxOffset); + cpSpaceAddConstraint(space, cpPinJointNew(body1, body2, cpv(15,0), cpv(-15,0))); + + // Slide Joints - Like pin joints but with a min/max distance. + // Can be used for a cheap approximation of a rope. + boxOffset = cpv(-160, -240); + body1 = addBall(space, posA, boxOffset); + body2 = addBall(space, posB, boxOffset); + cpSpaceAddConstraint(space, cpSlideJointNew(body1, body2, cpv(15,0), cpv(-15,0), 20.0f, 40.0f)); + + // Pivot Joints - Holds the two anchor points together. Like a swivel. + boxOffset = cpv(0, -240); + body1 = addBall(space, posA, boxOffset); + body2 = addBall(space, posB, boxOffset); + cpSpaceAddConstraint(space, cpPivotJointNew(body1, body2, cpvadd(boxOffset, cpv(80,60)))); + // cpPivotJointNew() takes it's anchor parameter in world coordinates. The anchors are calculated from that + // cpPivotJointNew2() lets you specify the two anchor points explicitly + + // Groove Joints - Like a pivot joint, but one of the anchors is a line segment that the pivot can slide in + boxOffset = cpv(160, -240); + body1 = addBall(space, posA, boxOffset); + body2 = addBall(space, posB, boxOffset); + cpSpaceAddConstraint(space, cpGrooveJointNew(body1, body2, cpv(30,30), cpv(30,-30), cpv(-30,0))); + + // Damped Springs + boxOffset = cpv(-320, -120); + body1 = addBall(space, posA, boxOffset); + body2 = addBall(space, posB, boxOffset); + cpSpaceAddConstraint(space, cpDampedSpringNew(body1, body2, cpv(15,0), cpv(-15,0), 20.0f, 5.0f, 0.3f)); + + // Damped Rotary Springs + boxOffset = cpv(-160, -120); + body1 = addBar(space, posA, boxOffset); + body2 = addBar(space, posB, boxOffset); + // Add some pin joints to hold the circles in place. + cpSpaceAddConstraint(space, cpPivotJointNew(body1, staticBody, POS_A)); + cpSpaceAddConstraint(space, cpPivotJointNew(body2, staticBody, POS_B)); + cpSpaceAddConstraint(space, cpDampedRotarySpringNew(body1, body2, 0.0f, 3000.0f, 60.0f)); + + // Rotary Limit Joint + boxOffset = cpv(0, -120); + body1 = addLever(space, posA, boxOffset); + body2 = addLever(space, posB, boxOffset); + // Add some pin joints to hold the circles in place. + cpSpaceAddConstraint(space, cpPivotJointNew(body1, staticBody, POS_A)); + cpSpaceAddConstraint(space, cpPivotJointNew(body2, staticBody, POS_B)); + // Hold their rotation within 90 degrees of each other. + cpSpaceAddConstraint(space, cpRotaryLimitJointNew(body1, body2, -M_PI_2, M_PI_2)); + + // Ratchet Joint - A rotary ratchet, like a socket wrench + boxOffset = cpv(160, -120); + body1 = addLever(space, posA, boxOffset); + body2 = addLever(space, posB, boxOffset); + // Add some pin joints to hold the circles in place. + cpSpaceAddConstraint(space, cpPivotJointNew(body1, staticBody, POS_A)); + cpSpaceAddConstraint(space, cpPivotJointNew(body2, staticBody, POS_B)); + // Ratchet every 90 degrees + cpSpaceAddConstraint(space, cpRatchetJointNew(body1, body2, 0.0f, M_PI_2)); + + // Gear Joint - Maintain a specific angular velocity ratio + boxOffset = cpv(-320, 0); + body1 = addBar(space, posA, boxOffset); + body2 = addBar(space, posB, boxOffset); + // Add some pin joints to hold the circles in place. + cpSpaceAddConstraint(space, cpPivotJointNew(body1, staticBody, POS_A)); + cpSpaceAddConstraint(space, cpPivotJointNew(body2, staticBody, POS_B)); + // Force one to sping 2x as fast as the other + cpSpaceAddConstraint(space, cpGearJointNew(body1, body2, 0.0f, 2.0f)); + + // Simple Motor - Maintain a specific angular relative velocity + boxOffset = cpv(-160, 0); + body1 = addBar(space, posA, boxOffset); + body2 = addBar(space, posB, boxOffset); + // Add some pin joints to hold the circles in place. + cpSpaceAddConstraint(space, cpPivotJointNew(body1, staticBody, POS_A)); + cpSpaceAddConstraint(space, cpPivotJointNew(body2, staticBody, POS_B)); + // Make them spin at 1/2 revolution per second in relation to each other. + cpSpaceAddConstraint(space, cpSimpleMotorNew(body1, body2, M_PI)); + + // Make a car with some nice soft suspension + boxOffset = cpv(0, 0); + cpBody *wheel1 = addWheel(space, posA, boxOffset); + cpBody *wheel2 = addWheel(space, posB, boxOffset); + cpBody *chassis = addChassis(space, cpv(80, 100), boxOffset); + + cpSpaceAddConstraint(space, cpGrooveJointNew(chassis, wheel1, cpv(-30, -10), cpv(-30, -40), cpvzero)); + cpSpaceAddConstraint(space, cpGrooveJointNew(chassis, wheel2, cpv( 30, -10), cpv( 30, -40), cpvzero)); + + cpSpaceAddConstraint(space, cpDampedSpringNew(chassis, wheel1, cpv(-30, 0), cpvzero, 50.0f, 20.0f, 10.0f)); + cpSpaceAddConstraint(space, cpDampedSpringNew(chassis, wheel2, cpv( 30, 0), cpvzero, 50.0f, 20.0f, 10.0f)); + + return space; +} + +static void +update(cpSpace *space, double dt) +{ + cpSpaceStep(space, dt); +} + +static void +destroy(cpSpace *space) +{ + ChipmunkDemoFreeSpaceChildren(space); + cpSpaceFree(space); +} + +ChipmunkDemo Joints = { + "Joints and Constraints", + 1.0/60.0, + init, + update, + ChipmunkDemoDefaultDrawImpl, + destroy, +}; diff --git a/external/Chipmunk/Demo/LogoSmash.c b/external/Chipmunk/Demo/LogoSmash.c new file mode 100644 index 0000000..575499f --- /dev/null +++ b/external/Chipmunk/Demo/LogoSmash.c @@ -0,0 +1,165 @@ +/* Copyright (c) 2007 Scott Lembcke + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +#include "chipmunk/chipmunk.h" +#include "ChipmunkDemo.h" + +static const int image_width = 188; +static const int image_height = 35; +static const int image_row_length = 24; + +static const unsigned char image_bitmap[] = { + 15,-16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,-64,15,63,-32,-2,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,31,-64,15,127,-125,-1,-128,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,127,-64,15,127,15,-1,-64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,-1,-64,15,-2, + 31,-1,-64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,-1,-64,0,-4,63,-1,-32,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,1,-1,-64,15,-8,127,-1,-32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 1,-1,-64,0,-8,-15,-1,-32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,-31,-1,-64,15,-8,-32, + -1,-32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,-15,-1,-64,9,-15,-32,-1,-32,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,31,-15,-1,-64,0,-15,-32,-1,-32,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,63,-7,-1,-64,9,-29,-32,127,-61,-16,63,15,-61,-1,-8,31,-16,15,-8,126,7,-31, + -8,31,-65,-7,-1,-64,9,-29,-32,0,7,-8,127,-97,-25,-1,-2,63,-8,31,-4,-1,15,-13, + -4,63,-1,-3,-1,-64,9,-29,-32,0,7,-8,127,-97,-25,-1,-2,63,-8,31,-4,-1,15,-13, + -2,63,-1,-3,-1,-64,9,-29,-32,0,7,-8,127,-97,-25,-1,-1,63,-4,63,-4,-1,15,-13, + -2,63,-33,-1,-1,-32,9,-25,-32,0,7,-8,127,-97,-25,-1,-1,63,-4,63,-4,-1,15,-13, + -1,63,-33,-1,-1,-16,9,-25,-32,0,7,-8,127,-97,-25,-1,-1,63,-4,63,-4,-1,15,-13, + -1,63,-49,-1,-1,-8,9,-57,-32,0,7,-8,127,-97,-25,-8,-1,63,-2,127,-4,-1,15,-13, + -1,-65,-49,-1,-1,-4,9,-57,-32,0,7,-8,127,-97,-25,-8,-1,63,-2,127,-4,-1,15,-13, + -1,-65,-57,-1,-1,-2,9,-57,-32,0,7,-8,127,-97,-25,-8,-1,63,-2,127,-4,-1,15,-13, + -1,-1,-57,-1,-1,-1,9,-57,-32,0,7,-1,-1,-97,-25,-8,-1,63,-1,-1,-4,-1,15,-13,-1, + -1,-61,-1,-1,-1,-119,-57,-32,0,7,-1,-1,-97,-25,-8,-1,63,-1,-1,-4,-1,15,-13,-1, + -1,-61,-1,-1,-1,-55,-49,-32,0,7,-1,-1,-97,-25,-8,-1,63,-1,-1,-4,-1,15,-13,-1, + -1,-63,-1,-1,-1,-23,-49,-32,127,-57,-1,-1,-97,-25,-1,-1,63,-1,-1,-4,-1,15,-13, + -1,-1,-63,-1,-1,-1,-16,-49,-32,-1,-25,-1,-1,-97,-25,-1,-1,63,-33,-5,-4,-1,15, + -13,-1,-1,-64,-1,-9,-1,-7,-49,-32,-1,-25,-8,127,-97,-25,-1,-1,63,-33,-5,-4,-1, + 15,-13,-1,-1,-64,-1,-13,-1,-32,-49,-32,-1,-25,-8,127,-97,-25,-1,-2,63,-49,-13, + -4,-1,15,-13,-1,-1,-64,127,-7,-1,-119,-17,-15,-1,-25,-8,127,-97,-25,-1,-2,63, + -49,-13,-4,-1,15,-13,-3,-1,-64,127,-8,-2,15,-17,-1,-1,-25,-8,127,-97,-25,-1, + -8,63,-49,-13,-4,-1,15,-13,-3,-1,-64,63,-4,120,0,-17,-1,-1,-25,-8,127,-97,-25, + -8,0,63,-57,-29,-4,-1,15,-13,-4,-1,-64,63,-4,0,15,-17,-1,-1,-25,-8,127,-97, + -25,-8,0,63,-57,-29,-4,-1,-1,-13,-4,-1,-64,31,-2,0,0,103,-1,-1,-57,-8,127,-97, + -25,-8,0,63,-57,-29,-4,-1,-1,-13,-4,127,-64,31,-2,0,15,103,-1,-1,-57,-8,127, + -97,-25,-8,0,63,-61,-61,-4,127,-1,-29,-4,127,-64,15,-8,0,0,55,-1,-1,-121,-8, + 127,-97,-25,-8,0,63,-61,-61,-4,127,-1,-29,-4,63,-64,15,-32,0,0,23,-1,-2,3,-16, + 63,15,-61,-16,0,31,-127,-127,-8,31,-1,-127,-8,31,-128,7,-128,0,0 +}; + +static inline int +get_pixel(int x, int y) +{ + return (image_bitmap[(x>>3) + y*image_row_length]>>(~x&0x7)) & 1; +} + +static int bodyCount = 0; + +static void +update(cpSpace *space, double dt) +{ + cpSpaceStep(space, dt); +} + +static void +DrawDot(cpBody *body, void *unused) +{ + ChipmunkDebugDrawDot(3.0, cpBodyGetPosition(body), RGBAColor(200.0f/255.0f, 210.0f/255.0f, 230.0f/255.0f, 1.0f)); +} + +static void +draw(cpSpace *space) +{ + cpSpaceEachBody(space, DrawDot, NULL); + +// ChipmunkDebugDrawCollisionPoints(space); +} + +static cpShape * +make_ball(cpFloat x, cpFloat y) +{ + cpBody *body = cpBodyNew(1.0, INFINITY); + cpBodySetPosition(body, cpv(x, y)); + + cpShape *shape = cpCircleShapeNew(body, 0.95, cpvzero); + cpShapeSetElasticity(shape, 0.0); + cpShapeSetFriction(shape, 0.0); + + return shape; +} + +static cpSpace * +init(void) +{ + cpSpace *space = cpSpaceNew(); + cpSpaceSetIterations(space, 1); + + // The space will contain a very large number of similary sized objects. + // This is the perfect candidate for using the spatial hash. + // Generally you will never need to do this. + cpSpaceUseSpatialHash(space, 2.0, 10000); + + bodyCount = 0; + + cpBody *body; + cpShape *shape; + + for(int y=0; yn) < 0){ + return cpArbiterIgnore(arb); + } + + return cpTrue; +} + +static void +update(cpSpace *space, double dt) +{ + cpSpaceStep(space, dt); +} + +static cpSpace * +init(void) +{ + ChipmunkDemoMessageString = "One way platforms are trivial in Chipmunk using a very simple collision callback."; + + cpSpace *space = cpSpaceNew(); + cpSpaceSetIterations(space, 10); + cpSpaceSetGravity(space, cpv(0, -100)); + + cpBody *body, *staticBody = cpSpaceGetStaticBody(space); + cpShape *shape; + + // Create segments around the edge of the screen. + shape = cpSpaceAddShape(space, cpSegmentShapeNew(staticBody, cpv(-320,-240), cpv(-320,240), 0.0f)); + cpShapeSetElasticity(shape, 1.0f); + cpShapeSetFriction(shape, 1.0f); + cpShapeSetFilter(shape, NOT_GRABBABLE_FILTER); + + shape = cpSpaceAddShape(space, cpSegmentShapeNew(staticBody, cpv(320,-240), cpv(320,240), 0.0f)); + cpShapeSetElasticity(shape, 1.0f); + cpShapeSetFriction(shape, 1.0f); + cpShapeSetFilter(shape, NOT_GRABBABLE_FILTER); + + shape = cpSpaceAddShape(space, cpSegmentShapeNew(staticBody, cpv(-320,-240), cpv(320,-240), 0.0f)); + cpShapeSetElasticity(shape, 1.0f); + cpShapeSetFriction(shape, 1.0f); + cpShapeSetFilter(shape, NOT_GRABBABLE_FILTER); + + // Add our one way segment + shape = cpSpaceAddShape(space, cpSegmentShapeNew(staticBody, cpv(-160,-100), cpv(160,-100), 10.0f)); + cpShapeSetElasticity(shape, 1.0f); + cpShapeSetFriction(shape, 1.0f); + cpShapeSetCollisionType(shape, COLLISION_TYPE_ONE_WAY); + cpShapeSetFilter(shape, NOT_GRABBABLE_FILTER); + + // We'll use the data pointer for the OneWayPlatform struct + platformInstance.n = cpv(0, 1); // let objects pass upwards + cpShapeSetUserData(shape, &platformInstance); + + + // Add a ball to test it out + cpFloat radius = 15.0f; + body = cpSpaceAddBody(space, cpBodyNew(10.0f, cpMomentForCircle(10.0f, 0.0f, radius, cpvzero))); + cpBodySetPosition(body, cpv(0, -200)); + cpBodySetVelocity(body, cpv(0, 170)); + + shape = cpSpaceAddShape(space, cpCircleShapeNew(body, radius, cpvzero)); + cpShapeSetElasticity(shape, 0.0f); + cpShapeSetFriction(shape, 0.9f); + cpShapeSetCollisionType(shape, 2); + + cpCollisionHandler *handler = cpSpaceAddWildcardHandler(space, COLLISION_TYPE_ONE_WAY); + handler->preSolveFunc = PreSolve; + + return space; +} + +static void +destroy(cpSpace *space) +{ + ChipmunkDemoFreeSpaceChildren(space); + cpSpaceFree(space); +} + +ChipmunkDemo OneWay = { + "One Way Platforms", + 1.0/60.0, + init, + update, + ChipmunkDemoDefaultDrawImpl, + destroy, +}; diff --git a/external/Chipmunk/Demo/Planet.c b/external/Chipmunk/Demo/Planet.c new file mode 100644 index 0000000..4120500 --- /dev/null +++ b/external/Chipmunk/Demo/Planet.c @@ -0,0 +1,134 @@ +/* Copyright (c) 2007 Scott Lembcke + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +#include "chipmunk/chipmunk.h" +#include "ChipmunkDemo.h" + +static cpBody *planetBody; + +static cpFloat gravityStrength = 5.0e6f; + +static void +update(cpSpace *space, double dt) +{ + cpSpaceStep(space, dt); + + // Update the static body spin so that it looks like it's rotating. + cpBodyUpdatePosition(planetBody, dt); +} + +static void +planetGravityVelocityFunc(cpBody *body, cpVect gravity, cpFloat damping, cpFloat dt) +{ + // Gravitational acceleration is proportional to the inverse square of + // distance, and directed toward the origin. The central planet is assumed + // to be massive enough that it affects the satellites but not vice versa. + cpVect p = cpBodyGetPosition(body); + cpFloat sqdist = cpvlengthsq(p); + cpVect g = cpvmult(p, -gravityStrength / (sqdist * cpfsqrt(sqdist))); + + cpBodyUpdateVelocity(body, g, damping, dt); +} + +static cpVect +rand_pos(cpFloat radius) +{ + cpVect v; + do { + v = cpv(frand()*(640 - 2*radius) - (320 - radius), frand()*(480 - 2*radius) - (240 - radius)); + } while(cpvlength(v) < 85.0f); + + return v; +} + +static void +add_box(cpSpace *space) +{ + const cpFloat size = 10.0f; + const cpFloat mass = 1.0f; + + cpVect verts[] = { + cpv(-size,-size), + cpv(-size, size), + cpv( size, size), + cpv( size,-size), + }; + + cpFloat radius = cpvlength(cpv(size, size)); + cpVect pos = rand_pos(radius); + + cpBody *body = cpSpaceAddBody(space, cpBodyNew(mass, cpMomentForPoly(mass, 4, verts, cpvzero, 0.0f))); + body->velocity_func = planetGravityVelocityFunc; + cpBodySetPosition(body, pos); + + // Set the box's velocity to put it into a circular orbit from its + // starting position. + cpFloat r = cpvlength(pos); + cpFloat v = cpfsqrt(gravityStrength / r) / r; + cpBodySetVelocity(body, cpvmult(cpvperp(pos), v)); + + // Set the box's angular velocity to match its orbital period and + // align its initial angle with its position. + cpBodySetAngularVelocity(body, v); + cpBodySetAngle(body, cpfatan2(pos.y, pos.x)); + + cpShape *shape = cpSpaceAddShape(space, cpPolyShapeNew(body, 4, verts, cpTransformIdentity, 0.0)); + cpShapeSetElasticity(shape, 0.0f); + cpShapeSetFriction(shape, 0.7f); +} + +static cpSpace * +init(void) +{ + // Create a rouge body to control the planet manually. + cpSpace *space = cpSpaceNew(); + cpSpaceSetIterations(space, 20); + + planetBody = cpSpaceAddBody(space, cpBodyNewKinematic()); + cpBodySetAngularVelocity(planetBody, 0.2f); + + for(int i=0; i<30; i++){ + add_box(space); + } + + cpShape *shape = cpSpaceAddShape(space, cpCircleShapeNew(planetBody, 70.0f, cpvzero)); + cpShapeSetElasticity(shape, 1.0f); + cpShapeSetFriction(shape, 1.0f); + cpShapeSetFilter(shape, NOT_GRABBABLE_FILTER); + + return space; +} + +static void +destroy(cpSpace *space) +{ + ChipmunkDemoFreeSpaceChildren(space); + cpSpaceFree(space); +} + +ChipmunkDemo Planet = { + "Planet", + 1.0/60.0, + init, + update, + ChipmunkDemoDefaultDrawImpl, + destroy, +}; diff --git a/external/Chipmunk/Demo/Player.c b/external/Chipmunk/Demo/Player.c new file mode 100644 index 0000000..d5bf8c2 --- /dev/null +++ b/external/Chipmunk/Demo/Player.c @@ -0,0 +1,177 @@ +/* Copyright (c) 2007 Scott Lembcke + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +#include "chipmunk/chipmunk_private.h" +#include "ChipmunkDemo.h" + +#define PLAYER_VELOCITY 500.0 + +#define PLAYER_GROUND_ACCEL_TIME 0.1 +#define PLAYER_GROUND_ACCEL (PLAYER_VELOCITY/PLAYER_GROUND_ACCEL_TIME) + +#define PLAYER_AIR_ACCEL_TIME 0.25 +#define PLAYER_AIR_ACCEL (PLAYER_VELOCITY/PLAYER_AIR_ACCEL_TIME) + +#define JUMP_HEIGHT 50.0 +#define JUMP_BOOST_HEIGHT 55.0 +#define FALL_VELOCITY 900.0 +#define GRAVITY 2000.0 + +static cpBody *playerBody = NULL; +static cpShape *playerShape = NULL; + +static cpFloat remainingBoost = 0; +static cpBool grounded = cpFalse; +static cpBool lastJumpState = cpFalse; + +static void +SelectPlayerGroundNormal(cpBody *body, cpArbiter *arb, cpVect *groundNormal){ + cpVect n = cpvneg(cpArbiterGetNormal(arb)); + + if(n.y > groundNormal->y){ + (*groundNormal) = n; + } +} + +static void +playerUpdateVelocity(cpBody *body, cpVect gravity, cpFloat damping, cpFloat dt) +{ + int jumpState = (ChipmunkDemoKeyboard.y > 0.0f); + + // Grab the grounding normal from last frame + cpVect groundNormal = cpvzero; + cpBodyEachArbiter(playerBody, (cpBodyArbiterIteratorFunc)SelectPlayerGroundNormal, &groundNormal); + + grounded = (groundNormal.y > 0.0); + if(groundNormal.y < 0.0f) remainingBoost = 0.0f; + + // Do a normal-ish update + cpBool boost = (jumpState && remainingBoost > 0.0f); + cpVect g = (boost ? cpvzero : gravity); + cpBodyUpdateVelocity(body, g, damping, dt); + + // Target horizontal speed for air/ground control + cpFloat target_vx = PLAYER_VELOCITY*ChipmunkDemoKeyboard.x; + + // Update the surface velocity and friction + // Note that the "feet" move in the opposite direction of the player. + cpVect surface_v = cpv(-target_vx, 0.0); + playerShape->surfaceV = surface_v; + playerShape->u = (grounded ? PLAYER_GROUND_ACCEL/GRAVITY : 0.0); + + // Apply air control if not grounded + if(!grounded){ + // Smoothly accelerate the velocity + playerBody->v.x = cpflerpconst(playerBody->v.x, target_vx, PLAYER_AIR_ACCEL*dt); + } + + body->v.y = cpfclamp(body->v.y, -FALL_VELOCITY, INFINITY); +} + +static void +update(cpSpace *space, double dt) +{ + int jumpState = (ChipmunkDemoKeyboard.y > 0.0f); + + // If the jump key was just pressed this frame, jump! + if(jumpState && !lastJumpState && grounded){ + cpFloat jump_v = cpfsqrt(2.0*JUMP_HEIGHT*GRAVITY); + playerBody->v = cpvadd(playerBody->v, cpv(0.0, jump_v)); + + remainingBoost = JUMP_BOOST_HEIGHT/jump_v; + } + + // Step the space + cpSpaceStep(space, dt); + + remainingBoost -= dt; + lastJumpState = jumpState; +} + +static cpSpace * +init(void) +{ + cpSpace *space = cpSpaceNew(); + space->iterations = 10; + space->gravity = cpv(0, -GRAVITY); +// space->sleepTimeThreshold = 1000; + + cpBody *body, *staticBody = cpSpaceGetStaticBody(space); + cpShape *shape; + + // Create segments around the edge of the screen. + shape = cpSpaceAddShape(space, cpSegmentShapeNew(staticBody, cpv(-320,-240), cpv(-320,240), 0.0f)); + shape->e = 1.0f; shape->u = 1.0f; + cpShapeSetFilter(shape, NOT_GRABBABLE_FILTER); + + shape = cpSpaceAddShape(space, cpSegmentShapeNew(staticBody, cpv(320,-240), cpv(320,240), 0.0f)); + shape->e = 1.0f; shape->u = 1.0f; + cpShapeSetFilter(shape, NOT_GRABBABLE_FILTER); + + shape = cpSpaceAddShape(space, cpSegmentShapeNew(staticBody, cpv(-320,-240), cpv(320,-240), 0.0f)); + shape->e = 1.0f; shape->u = 1.0f; + cpShapeSetFilter(shape, NOT_GRABBABLE_FILTER); + + shape = cpSpaceAddShape(space, cpSegmentShapeNew(staticBody, cpv(-320,240), cpv(320,240), 0.0f)); + shape->e = 1.0f; shape->u = 1.0f; + cpShapeSetFilter(shape, NOT_GRABBABLE_FILTER); + + // Set up the player + body = cpSpaceAddBody(space, cpBodyNew(1.0f, INFINITY)); + body->p = cpv(0, -200); + body->velocity_func = playerUpdateVelocity; + playerBody = body; + + shape = cpSpaceAddShape(space, cpBoxShapeNew2(body, cpBBNew(-15.0, -27.5, 15.0, 27.5), 10.0)); +// shape = cpSpaceAddShape(space, cpSegmentShapeNew(playerBody, cpvzero, cpv(0, radius), radius)); + shape->e = 0.0f; shape->u = 0.0f; + shape->type = 1; + playerShape = shape; + + // Add some boxes to jump on + for(int i=0; i<6; i++){ + for(int j=0; j<3; j++){ + body = cpSpaceAddBody(space, cpBodyNew(4.0f, INFINITY)); + body->p = cpv(100 + j*60, -200 + i*60); + + shape = cpSpaceAddShape(space, cpBoxShapeNew(body, 50, 50, 0.0)); + shape->e = 0.0f; shape->u = 0.7f; + } + } + + return space; +} + +static void +destroy(cpSpace *space) +{ + ChipmunkDemoFreeSpaceChildren(space); + cpSpaceFree(space); +} + +ChipmunkDemo Player = { + "Platformer Player Controls", + 1.0/180.0, + init, + update, + ChipmunkDemoDefaultDrawImpl, + destroy, +}; diff --git a/external/Chipmunk/Demo/Plink.c b/external/Chipmunk/Demo/Plink.c new file mode 100644 index 0000000..4eb955d --- /dev/null +++ b/external/Chipmunk/Demo/Plink.c @@ -0,0 +1,131 @@ +/* Copyright (c) 2007 Scott Lembcke + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +#include "chipmunk/chipmunk.h" +#include "ChipmunkDemo.h" + +static cpFloat pentagon_mass = 0.0f; +static cpFloat pentagon_moment = 0.0f; + +// Iterate over all of the bodies and reset the ones that have fallen offscreen. +static void +eachBody(cpBody *body, void *unused) +{ + cpVect pos = cpBodyGetPosition(body); + if(pos.y < -260 || cpfabs(pos.x) > 340){ + cpFloat x = rand()/(cpFloat)RAND_MAX*640 - 320; + cpBodySetPosition(body, cpv(x, 260)); + } +} + +static void +update(cpSpace *space, double dt) +{ + if(ChipmunkDemoRightDown){ + cpShape *nearest = cpSpacePointQueryNearest(space, ChipmunkDemoMouse, 0.0, GRAB_FILTER, NULL); + if(nearest){ + cpBody *body = cpShapeGetBody(nearest); + if(cpBodyGetType(body) == CP_BODY_TYPE_STATIC){ + cpBodySetType(body, CP_BODY_TYPE_DYNAMIC); + cpBodySetMass(body, pentagon_mass); + cpBodySetMoment(body, pentagon_moment); + } else if(cpBodyGetType(body) == CP_BODY_TYPE_DYNAMIC) { + cpBodySetType(body, CP_BODY_TYPE_STATIC); + } + } + } + + cpSpaceEachBody(space, &eachBody, NULL); + cpSpaceStep(space, dt); +} + +#define NUM_VERTS 5 + +static cpSpace * +init(void) +{ + ChipmunkDemoMessageString = "Right click to make pentagons static/dynamic."; + + cpSpace *space = cpSpaceNew(); + cpSpaceSetIterations(space, 5); + cpSpaceSetGravity(space, cpv(0, -100)); + + cpBody *body, *staticBody = cpSpaceGetStaticBody(space); + cpShape *shape; + + // Vertexes for a triangle shape. + cpVect tris[] = { + cpv(-15,-15), + cpv( 0, 10), + cpv( 15,-15), + }; + + // Create the static triangles. + for(int i=0; i<9; i++){ + for(int j=0; j<6; j++){ + cpFloat stagger = (j%2)*40; + cpVect offset = cpv(i*80 - 320 + stagger, j*70 - 240); + shape = cpSpaceAddShape(space, cpPolyShapeNew(staticBody, 3, tris, cpTransformTranslate(offset), 0.0)); + cpShapeSetElasticity(shape, 1.0f); + cpShapeSetFriction(shape, 1.0f); + cpShapeSetFilter(shape, NOT_GRABBABLE_FILTER); + } + } + + // Create vertexes for a pentagon shape. + cpVect verts[NUM_VERTS]; + for(int i=0; i 320.0f){ + cpBodySetVelocity(ball, cpvzero); + cpBodySetPosition(ball, cpv(-224.0f, 200.0f)); + } + } +} + +static cpBody * +add_ball(cpSpace *space, cpVect pos) +{ + cpBody *body = cpSpaceAddBody(space, cpBodyNew(1.0f, cpMomentForCircle(1.0f, 30, 0, cpvzero))); + cpBodySetPosition(body, pos); + + cpShape *shape = cpSpaceAddShape(space, cpCircleShapeNew(body, 30, cpvzero)); + cpShapeSetElasticity(shape, 0.0f); + cpShapeSetFriction(shape, 0.5f); + + return body; +} + +static cpSpace * +init(void) +{ + ChipmunkDemoMessageString = "Use the arrow keys to control the machine."; + + cpSpace *space = cpSpaceNew(); + cpSpaceSetGravity(space, cpv(0, -600)); + + cpBody *staticBody = cpSpaceGetStaticBody(space); + cpShape *shape; + + // beveling all of the line segments slightly helps prevent things from getting stuck on cracks + shape = cpSpaceAddShape(space, cpSegmentShapeNew(staticBody, cpv(-256,16), cpv(-256,300), 2.0f)); + cpShapeSetElasticity(shape, 0.0f); + cpShapeSetFriction(shape, 0.5f); + cpShapeSetFilter(shape, NOT_GRABBABLE_FILTER); + + shape = cpSpaceAddShape(space, cpSegmentShapeNew(staticBody, cpv(-256,16), cpv(-192,0), 2.0f)); + cpShapeSetElasticity(shape, 0.0f); + cpShapeSetFriction(shape, 0.5f); + cpShapeSetFilter(shape, NOT_GRABBABLE_FILTER); + + shape = cpSpaceAddShape(space, cpSegmentShapeNew(staticBody, cpv(-192,0), cpv(-192, -64), 2.0f)); + cpShapeSetElasticity(shape, 0.0f); + cpShapeSetFriction(shape, 0.5f); + cpShapeSetFilter(shape, NOT_GRABBABLE_FILTER); + + shape = cpSpaceAddShape(space, cpSegmentShapeNew(staticBody, cpv(-128,-64), cpv(-128,144), 2.0f)); + cpShapeSetElasticity(shape, 0.0f); + cpShapeSetFriction(shape, 0.5f); + cpShapeSetFilter(shape, NOT_GRABBABLE_FILTER); + + shape = cpSpaceAddShape(space, cpSegmentShapeNew(staticBody, cpv(-192,80), cpv(-192,176), 2.0f)); + cpShapeSetElasticity(shape, 0.0f); + cpShapeSetFriction(shape, 0.5f); + cpShapeSetFilter(shape, NOT_GRABBABLE_FILTER); + + shape = cpSpaceAddShape(space, cpSegmentShapeNew(staticBody, cpv(-192,176), cpv(-128,240), 2.0f)); + cpShapeSetElasticity(shape, 0.0f); + cpShapeSetFriction(shape, 0.5f); + cpShapeSetFilter(shape, NOT_GRABBABLE_FILTER); + + shape = cpSpaceAddShape(space, cpSegmentShapeNew(staticBody, cpv(-128,144), cpv(192,64), 2.0f)); + cpShapeSetElasticity(shape, 0.0f); + cpShapeSetFriction(shape, 0.5f); + cpShapeSetFilter(shape, NOT_GRABBABLE_FILTER); + + cpVect verts[] = { + cpv(-30,-80), + cpv(-30, 80), + cpv( 30, 64), + cpv( 30,-80), + }; + + cpBody *plunger = cpSpaceAddBody(space, cpBodyNew(1.0f, INFINITY)); + cpBodySetPosition(plunger, cpv(-160,-80)); + + shape = cpSpaceAddShape(space, cpPolyShapeNew(plunger, 4, verts, cpTransformIdentity, 0.0)); + cpShapeSetElasticity(shape, 1.0f); + cpShapeSetFriction(shape, 0.5f); + cpShapeSetFilter(shape, cpShapeFilterNew(CP_NO_GROUP, 1, 1)); + + // add balls to hopper + for(int i=0; i + +#include "chipmunk/chipmunk.h" + +#include "ChipmunkDemo.h" + +#define DENSITY (1.0/10000.0) + +#define MAX_VERTEXES_PER_VORONOI 16 + +struct WorleyContex { + uint32_t seed; + cpFloat cellSize; + int width, height; + cpBB bb; + cpVect focus; +}; + +static inline cpVect +HashVect(uint32_t x, uint32_t y, uint32_t seed) +{ +// cpFloat border = 0.21f; + cpFloat border = 0.05f; + uint32_t h = (x*1640531513 ^ y*2654435789) + seed; + + return cpv( + cpflerp(border, 1.0f - border, (cpFloat)( h & 0xFFFF)/(cpFloat)0xFFFF), + cpflerp(border, 1.0f - border, (cpFloat)((h>>16) & 0xFFFF)/(cpFloat)0xFFFF) + ); +} + +static cpVect +WorleyPoint(int i, int j, struct WorleyContex *context) +{ + cpFloat size = context->cellSize; + int width = context->width; + int height = context->height; + cpBB bb = context->bb; + +// cpVect fv = cpv(0.5, 0.5); + cpVect fv = HashVect(i, j, context->seed); + + return cpv( + cpflerp(bb.l, bb.r, 0.5f) + size*(i + fv.x - width*0.5f), + cpflerp(bb.b, bb.t, 0.5f) + size*(j + fv.y - height*0.5f) + ); +} + +static int +ClipCell(cpShape *shape, cpVect center, int i, int j, struct WorleyContex *context, cpVect *verts, cpVect *clipped, int count) +{ + cpVect other = WorleyPoint(i, j, context); +// printf(" other %dx%d: (% 5.2f, % 5.2f) ", i, j, other.x, other.y); + if(cpShapePointQuery(shape, other, NULL) > 0.0f){ +// printf("excluded\n"); + memcpy(clipped, verts, count*sizeof(cpVect)); + return count; + } else { +// printf("clipped\n"); + } + + cpVect n = cpvsub(other, center); + cpFloat dist = cpvdot(n, cpvlerp(center, other, 0.5f)); + + int clipped_count = 0; + for(int j=0, i=count-1; j MAX_VERTEXES_PER_VORONOI ? MAX_VERTEXES_PER_VORONOI : count); + + for(int i=0; iwidth; i++){ + for(int j=0; jheight; j++){ + if( + !(i == cell_i && j == cell_j) && + cpShapePointQuery(shape, cell, NULL) < 0.0f + ){ + count = ClipCell(shape, cell, i, j, context, ping, pong, count); + memcpy(ping, pong, count*sizeof(cpVect)); + } + } + } + + cpVect centroid = cpCentroidForPoly(count, ping); + cpFloat mass = cpAreaForPoly(count, ping, 0.0f)*DENSITY; + cpFloat moment = cpMomentForPoly(mass, count, ping, cpvneg(centroid), 0.0f); + + cpBody *new_body = cpSpaceAddBody(space, cpBodyNew(mass, moment)); + cpBodySetPosition(new_body, centroid); + cpBodySetVelocity(new_body, cpBodyGetVelocityAtWorldPoint(body, centroid)); + cpBodySetAngularVelocity(new_body, cpBodyGetAngularVelocity(body)); + + cpTransform transform = cpTransformTranslate(cpvneg(centroid)); + cpShape *new_shape = cpSpaceAddShape(space, cpPolyShapeNew(new_body, count, ping, transform, 0.0)); + // Copy whatever properties you have set on the original shape that are important + cpShapeSetFriction(new_shape, cpShapeGetFriction(shape)); +} + +static void +ShatterShape(cpSpace *space, cpShape *shape, cpFloat cellSize, cpVect focus) +{ + cpSpaceRemoveShape(space, shape); + cpSpaceRemoveBody(space, cpShapeGetBody(shape)); + + cpBB bb = cpShapeGetBB(shape); + int width = (int)((bb.r - bb.l)/cellSize) + 1; + int height = (int)((bb.t - bb.b)/cellSize) + 1; +// printf("Splitting as %dx%d\n", width, height); + struct WorleyContex context = {rand(), cellSize, width, height, bb, focus}; + + for(int i=0; i 5.0f){ + ShatterShape(space, (cpShape *)info.shape, cell_size, ChipmunkDemoMouse); + } else { +// printf("Too small to splinter %f\n", cell_size); + } + } + } +} + +static cpSpace * +init(void) +{ + ChipmunkDemoMessageString = "Right click something to shatter it."; + + cpSpace *space = cpSpaceNew(); + cpSpaceSetIterations(space, 30); + cpSpaceSetGravity(space, cpv(0, -500)); + cpSpaceSetSleepTimeThreshold(space, 0.5f); + cpSpaceSetCollisionSlop(space, 0.5f); + + cpBody *body, *staticBody = cpSpaceGetStaticBody(space); + cpShape *shape; + + // Create segments around the edge of the screen. + shape = cpSpaceAddShape(space, cpSegmentShapeNew(staticBody, cpv(-1000, -240), cpv( 1000, -240), 0.0f)); + cpShapeSetElasticity(shape, 1.0f); + cpShapeSetFriction(shape, 1.0f); + cpShapeSetFilter(shape, NOT_GRABBABLE_FILTER); + + cpFloat width = 200.0f; + cpFloat height = 200.0f; + cpFloat mass = width*height*DENSITY; + cpFloat moment = cpMomentForBox(mass, width, height); + + body = cpSpaceAddBody(space, cpBodyNew(mass, moment)); + + shape = cpSpaceAddShape(space, cpBoxShapeNew(body, width, height, 0.0)); + cpShapeSetFriction(shape, 0.6f); + + return space; +} + +static void +destroy(cpSpace *space) +{ + ChipmunkDemoFreeSpaceChildren(space); + cpSpaceFree(space); +} + +ChipmunkDemo Shatter = { + "Shatter.", + 1.0f/60.0f, + init, + update, + ChipmunkDemoDefaultDrawImpl, + destroy, +}; diff --git a/external/Chipmunk/Demo/Slice.c b/external/Chipmunk/Demo/Slice.c new file mode 100644 index 0000000..5bffc99 --- /dev/null +++ b/external/Chipmunk/Demo/Slice.c @@ -0,0 +1,188 @@ +/* Copyright (c) 2007 Scott Lembcke + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +#include "chipmunk/chipmunk.h" + +#include "ChipmunkDemo.h" + +#define DENSITY (1.0/10000.0) + +static void +ClipPoly(cpSpace *space, cpShape *shape, cpVect n, cpFloat dist) +{ + cpBody *body = cpShapeGetBody(shape); + + int count = cpPolyShapeGetCount(shape); + int clippedCount = 0; + + cpVect *clipped = (cpVect *)alloca((count + 1)*sizeof(cpVect)); + + for(int i=0, j=count-1; ia; + cpVect b = context->b; + + // Clipping plane normal and distance. + cpVect n = cpvnormalize(cpvperp(cpvsub(b, a))); + cpFloat dist = cpvdot(a, n); + + ClipPoly(space, shape, n, dist); + ClipPoly(space, shape, cpvneg(n), -dist); + + cpBody *body = cpShapeGetBody(shape); + cpSpaceRemoveShape(space, shape); + cpSpaceRemoveBody(space, body); + cpShapeFree(shape); + cpBodyFree(body); +} + +static void +SliceQuery(cpShape *shape, cpFloat t, cpVect n, struct SliceContext *context) +{ + cpVect a = context->a; + cpVect b = context->b; + + // Check that the slice was complete by checking that the endpoints aren't in the sliced shape. + if(cpShapePointQuery(shape, a, NULL) > 0.0f && cpShapePointQuery(shape, b, NULL) > 0.0f){ + // Can't modify the space during a query. + // Must make a post-step callback to do the actual slicing. + cpSpaceAddPostStepCallback(context->space, (cpPostStepFunc)SliceShapePostStep, shape, context); + } +} + +static void +update(cpSpace *space, double dt) +{ + cpSpaceStep(space, dt); + + static cpBool lastClickState = cpFalse; + static cpVect sliceStart = {0.0, 0.0}; + + // Annoying state tracking code that you wouldn't need + // in a real event driven system. + if(ChipmunkDemoRightClick != lastClickState){ + if(ChipmunkDemoRightClick){ + // MouseDown + sliceStart = ChipmunkDemoMouse; + } else { + // MouseUp + struct SliceContext context = {sliceStart, ChipmunkDemoMouse, space}; + cpSpaceSegmentQuery(space, sliceStart, ChipmunkDemoMouse, 0.0, GRAB_FILTER, (cpSpaceSegmentQueryFunc)SliceQuery, &context); + } + + lastClickState = ChipmunkDemoRightClick; + } + + if(ChipmunkDemoRightClick){ + ChipmunkDebugDrawSegment(sliceStart, ChipmunkDemoMouse, RGBAColor(1, 0, 0, 1)); + } +} + +static cpSpace * +init(void) +{ + ChipmunkDemoMessageString = "Right click and drag to slice up the block."; + + cpSpace *space = cpSpaceNew(); + cpSpaceSetIterations(space, 30); + cpSpaceSetGravity(space, cpv(0, -500)); + cpSpaceSetSleepTimeThreshold(space, 0.5f); + cpSpaceSetCollisionSlop(space, 0.5f); + + cpBody *body, *staticBody = cpSpaceGetStaticBody(space); + cpShape *shape; + + // Create segments around the edge of the screen. + shape = cpSpaceAddShape(space, cpSegmentShapeNew(staticBody, cpv(-1000,-240), cpv(1000,-240), 0.0f)); + cpShapeSetElasticity(shape, 1.0f); + cpShapeSetFriction(shape, 1.0f); + cpShapeSetFilter(shape, NOT_GRABBABLE_FILTER); + + cpFloat width = 200.0f; + cpFloat height = 300.0f; + cpFloat mass = width*height*DENSITY; + cpFloat moment = cpMomentForBox(mass, width, height); + + body = cpSpaceAddBody(space, cpBodyNew(mass, moment)); + + shape = cpSpaceAddShape(space, cpBoxShapeNew(body, width, height, 0.0)); + cpShapeSetFriction(shape, 0.6f); + + return space; +} + +static void +destroy(cpSpace *space) +{ + ChipmunkDemoFreeSpaceChildren(space); + cpSpaceFree(space); +} + +ChipmunkDemo Slice = { + "Slice.", + 1.0/60.0, + init, + update, + ChipmunkDemoDefaultDrawImpl, + destroy, +}; diff --git a/external/Chipmunk/Demo/Smooth.c b/external/Chipmunk/Demo/Smooth.c new file mode 100644 index 0000000..d375cf0 --- /dev/null +++ b/external/Chipmunk/Demo/Smooth.c @@ -0,0 +1,141 @@ +/* Copyright (c) 2007 Scott Lembcke + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +#include +#include +#include +#include + +#include "chipmunk_private.h" +#include "ChipmunkDemo.h" + +static cpBool DrawContacts(cpArbiter *arb, cpSpace *space, void *data){ + cpContactPointSet set = cpArbiterGetContactPointSet(arb); + + for(int i=0; i b ? a : b) +#define MIN(a, b) (a < b ? a : b) + +static cpSpace * +init(void) +{ + cpSpace *space = cpSpaceNew(); + cpSpaceSetIterations(space, 5); + cpSpaceSetDamping(space, 0.1f); + + cpSpaceSetDefaultCollisionHandler(space, NULL, DrawContacts, NULL, NULL, NULL); + + { + cpFloat mass = 1.0f; + cpFloat length = 100.0f; + cpVect a = cpv(-length/2.0f, 0.0f), b = cpv(length/2.0f, 0.0f); + + cpBody *body = cpSpaceAddBody(space, cpBodyNew(mass, cpMomentForSegment(mass, a, b))); + cpBodySetPos(body, cpv(-160.0f, 80.0f)); + + cpSpaceAddShape(space, cpSegmentShapeNew(body, a, b, 30.0f)); + } + + { + cpFloat mass = 1.0f; + const int NUM_VERTS = 5; + + cpVect verts[NUM_VERTS]; + for(int i=0; i + +#include "chipmunk/chipmunk.h" +#include "ChipmunkDemo.h" + +static cpFloat +springForce(cpConstraint *spring, cpFloat dist) +{ + cpFloat clamp = 20.0f; + return cpfclamp(cpDampedSpringGetRestLength(spring) - dist, -clamp, clamp)*cpDampedSpringGetStiffness(spring); +} + +static cpConstraint * +new_spring(cpBody *a, cpBody *b, cpVect anchr1, cpVect anchr2, cpFloat restLength, cpFloat stiff, cpFloat damp) +{ + cpConstraint *spring = cpDampedSpringNew(a, b, anchr1, anchr2, restLength, stiff, damp); + cpDampedSpringSetSpringForceFunc(spring, springForce); + + return spring; +} + +static void +update(cpSpace *space, double dt) +{ + cpSpaceStep(space, dt); +} + +static cpBody * +add_bar(cpSpace *space, cpVect a, cpVect b, int group) +{ + cpVect center = cpvmult(cpvadd(a, b), 1.0f/2.0f); + cpFloat length = cpvlength(cpvsub(b, a)); + cpFloat mass = length/160.0f; + + cpBody *body = cpSpaceAddBody(space, cpBodyNew(mass, mass*length*length/12.0f)); + cpBodySetPosition(body, center); + + cpShape *shape = cpSpaceAddShape(space, cpSegmentShapeNew(body, cpvsub(a, center), cpvsub(b, center), 10.0f)); + cpShapeSetFilter(shape, cpShapeFilterNew(group, CP_ALL_CATEGORIES, CP_ALL_CATEGORIES)); + + return body; +} + +static cpSpace * +init(void) +{ + cpSpace *space = cpSpaceNew(); + cpBody *staticBody = cpSpaceGetStaticBody(space); + + cpBody *body1 = add_bar(space, cpv(-240, 160), cpv(-160, 80), 1); + cpBody *body2 = add_bar(space, cpv(-160, 80), cpv( -80, 160), 1); + cpBody *body3 = add_bar(space, cpv( 0, 160), cpv( 80, 0), 0); + cpBody *body4 = add_bar(space, cpv( 160, 160), cpv( 240, 160), 0); + cpBody *body5 = add_bar(space, cpv(-240, 0), cpv(-160, -80), 2); + cpBody *body6 = add_bar(space, cpv(-160, -80), cpv( -80, 0), 2); + cpBody *body7 = add_bar(space, cpv( -80, 0), cpv( 0, 0), 2); + cpBody *body8 = add_bar(space, cpv( 0, -80), cpv( 80, -80), 0); + cpBody *body9 = add_bar(space, cpv( 240, 80), cpv( 160, 0), 3); + cpBody *body10 = add_bar(space, cpv( 160, 0), cpv( 240, -80), 3); + cpBody *body11 = add_bar(space, cpv(-240, -80), cpv(-160, -160), 4); + cpBody *body12 = add_bar(space, cpv(-160, -160), cpv( -80, -160), 4); + cpBody *body13 = add_bar(space, cpv( 0, -160), cpv( 80, -160), 0); + cpBody *body14 = add_bar(space, cpv( 160, -160), cpv( 240, -160), 0); + + cpSpaceAddConstraint(space, cpPivotJointNew2( body1, body2, cpv( 40,-40), cpv(-40,-40))); + cpSpaceAddConstraint(space, cpPivotJointNew2( body5, body6, cpv( 40,-40), cpv(-40,-40))); + cpSpaceAddConstraint(space, cpPivotJointNew2( body6, body7, cpv( 40, 40), cpv(-40, 0))); + cpSpaceAddConstraint(space, cpPivotJointNew2( body9, body10, cpv(-40,-40), cpv(-40, 40))); + cpSpaceAddConstraint(space, cpPivotJointNew2(body11, body12, cpv( 40,-40), cpv(-40, 0))); + + cpFloat stiff = 100.0f; + cpFloat damp = 0.5f; + cpSpaceAddConstraint(space, new_spring(staticBody, body1, cpv(-320, 240), cpv(-40, 40), 0.0f, stiff, damp)); + cpSpaceAddConstraint(space, new_spring(staticBody, body1, cpv(-320, 80), cpv(-40, 40), 0.0f, stiff, damp)); + cpSpaceAddConstraint(space, new_spring(staticBody, body1, cpv(-160, 240), cpv(-40, 40), 0.0f, stiff, damp)); + + cpSpaceAddConstraint(space, new_spring(staticBody, body2, cpv(-160, 240), cpv( 40, 40), 0.0f, stiff, damp)); + cpSpaceAddConstraint(space, new_spring(staticBody, body2, cpv( 0, 240), cpv( 40, 40), 0.0f, stiff, damp)); + + cpSpaceAddConstraint(space, new_spring(staticBody, body3, cpv( 80, 240), cpv(-40, 80), 0.0f, stiff, damp)); + + cpSpaceAddConstraint(space, new_spring(staticBody, body4, cpv( 80, 240), cpv(-40, 0), 0.0f, stiff, damp)); + cpSpaceAddConstraint(space, new_spring(staticBody, body4, cpv( 320, 240), cpv( 40, 0), 0.0f, stiff, damp)); + + cpSpaceAddConstraint(space, new_spring(staticBody, body5, cpv(-320, 80), cpv(-40, 40), 0.0f, stiff, damp)); + + cpSpaceAddConstraint(space, new_spring(staticBody, body9, cpv( 320, 80), cpv( 40, 40), 0.0f, stiff, damp)); + + cpSpaceAddConstraint(space, new_spring(staticBody, body10, cpv( 320, 0), cpv( 40,-40), 0.0f, stiff, damp)); + cpSpaceAddConstraint(space, new_spring(staticBody, body10, cpv( 320,-160), cpv( 40,-40), 0.0f, stiff, damp)); + + cpSpaceAddConstraint(space, new_spring(staticBody, body11, cpv(-320,-160), cpv(-40, 40), 0.0f, stiff, damp)); + + cpSpaceAddConstraint(space, new_spring(staticBody, body12, cpv(-240,-240), cpv(-40, 0), 0.0f, stiff, damp)); + cpSpaceAddConstraint(space, new_spring(staticBody, body12, cpv( 0,-240), cpv( 40, 0), 0.0f, stiff, damp)); + + cpSpaceAddConstraint(space, new_spring(staticBody, body13, cpv( 0,-240), cpv(-40, 0), 0.0f, stiff, damp)); + cpSpaceAddConstraint(space, new_spring(staticBody, body13, cpv( 80,-240), cpv( 40, 0), 0.0f, stiff, damp)); + + cpSpaceAddConstraint(space, new_spring(staticBody, body14, cpv( 80,-240), cpv(-40, 0), 0.0f, stiff, damp)); + cpSpaceAddConstraint(space, new_spring(staticBody, body14, cpv( 240,-240), cpv( 40, 0), 0.0f, stiff, damp)); + cpSpaceAddConstraint(space, new_spring(staticBody, body14, cpv( 320,-160), cpv( 40, 0), 0.0f, stiff, damp)); + + cpSpaceAddConstraint(space, new_spring( body1, body5, cpv( 40,-40), cpv(-40, 40), 0.0f, stiff, damp)); + cpSpaceAddConstraint(space, new_spring( body1, body6, cpv( 40,-40), cpv( 40, 40), 0.0f, stiff, damp)); + cpSpaceAddConstraint(space, new_spring( body2, body3, cpv( 40, 40), cpv(-40, 80), 0.0f, stiff, damp)); + cpSpaceAddConstraint(space, new_spring( body3, body4, cpv(-40, 80), cpv(-40, 0), 0.0f, stiff, damp)); + cpSpaceAddConstraint(space, new_spring( body3, body4, cpv( 40,-80), cpv(-40, 0), 0.0f, stiff, damp)); + cpSpaceAddConstraint(space, new_spring( body3, body7, cpv( 40,-80), cpv( 40, 0), 0.0f, stiff, damp)); + cpSpaceAddConstraint(space, new_spring( body3, body7, cpv(-40, 80), cpv(-40, 0), 0.0f, stiff, damp)); + cpSpaceAddConstraint(space, new_spring( body3, body8, cpv( 40,-80), cpv( 40, 0), 0.0f, stiff, damp)); + cpSpaceAddConstraint(space, new_spring( body3, body9, cpv( 40,-80), cpv(-40,-40), 0.0f, stiff, damp)); + cpSpaceAddConstraint(space, new_spring( body4, body9, cpv( 40, 0), cpv( 40, 40), 0.0f, stiff, damp)); + cpSpaceAddConstraint(space, new_spring( body5, body11, cpv(-40, 40), cpv(-40, 40), 0.0f, stiff, damp)); + cpSpaceAddConstraint(space, new_spring( body5, body11, cpv( 40,-40), cpv( 40,-40), 0.0f, stiff, damp)); + cpSpaceAddConstraint(space, new_spring( body7, body8, cpv( 40, 0), cpv(-40, 0), 0.0f, stiff, damp)); + cpSpaceAddConstraint(space, new_spring( body8, body12, cpv(-40, 0), cpv( 40, 0), 0.0f, stiff, damp)); + cpSpaceAddConstraint(space, new_spring( body8, body13, cpv(-40, 0), cpv(-40, 0), 0.0f, stiff, damp)); + cpSpaceAddConstraint(space, new_spring( body8, body13, cpv( 40, 0), cpv( 40, 0), 0.0f, stiff, damp)); + cpSpaceAddConstraint(space, new_spring( body8, body14, cpv( 40, 0), cpv(-40, 0), 0.0f, stiff, damp)); + cpSpaceAddConstraint(space, new_spring(body10, body14, cpv( 40,-40), cpv(-40, 0), 0.0f, stiff, damp)); + cpSpaceAddConstraint(space, new_spring(body10, body14, cpv( 40,-40), cpv(-40, 0), 0.0f, stiff, damp)); + + return space; +} + +static void +destroy(cpSpace *space) +{ + ChipmunkDemoFreeSpaceChildren(space); + cpSpaceFree(space); +} + +ChipmunkDemo Springies = { + "Springies", + 1.0/60.0, + init, + update, + ChipmunkDemoDefaultDrawImpl, + destroy, +}; diff --git a/external/Chipmunk/Demo/Sticky.c b/external/Chipmunk/Demo/Sticky.c new file mode 100644 index 0000000..1a5af97 --- /dev/null +++ b/external/Chipmunk/Demo/Sticky.c @@ -0,0 +1,197 @@ +/* Copyright (c) 2007 Scott Lembcke + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +#include "chipmunk/chipmunk.h" +#include "ChipmunkDemo.h" + +enum { + COLLISION_TYPE_STICKY = 1, +}; + +#define STICK_SENSOR_THICKNESS 2.5f + +static void +PostStepAddJoint(cpSpace *space, void *key, void *data) +{ +// printf("Adding joint for %p\n", data); + + cpConstraint *joint = (cpConstraint *)key; + cpSpaceAddConstraint(space, joint); +} + +static cpBool +StickyPreSolve(cpArbiter *arb, cpSpace *space, void *data) +{ + // We want to fudge the collisions a bit to allow shapes to overlap more. + // This simulates their squishy sticky surface, and more importantly + // keeps them from separating and destroying the joint. + + // Track the deepest collision point and use that to determine if a rigid collision should occur. + cpFloat deepest = INFINITY; + + // Grab the contact set and iterate over them. + cpContactPointSet contacts = cpArbiterGetContactPointSet(arb); + for(int i=0; ipreSolveFunc = StickyPreSolve; + handler->separateFunc = StickySeparate; + + return space; +} + +static void +destroy(cpSpace *space) +{ + ChipmunkDemoFreeSpaceChildren(space); + cpSpaceFree(space); +} + +ChipmunkDemo Sticky = { + "Sticky Surfaces", + 1.0/60.0, + init, + update, + ChipmunkDemoDefaultDrawImpl, + destroy, +}; diff --git a/external/Chipmunk/Demo/Tank.c b/external/Chipmunk/Demo/Tank.c new file mode 100644 index 0000000..2498289 --- /dev/null +++ b/external/Chipmunk/Demo/Tank.c @@ -0,0 +1,136 @@ +/* Copyright (c) 2007 Scott Lembcke + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +#include "chipmunk/chipmunk.h" +#include "ChipmunkDemo.h" + +static cpBody *tankBody, *tankControlBody; + +static void +update(cpSpace *space, double dt) +{ + // turn the control body based on the angle relative to the actual body + cpVect mouseDelta = cpvsub(ChipmunkDemoMouse, cpBodyGetPosition(tankBody)); + cpFloat turn = cpvtoangle(cpvunrotate(cpBodyGetRotation(tankBody), mouseDelta)); + cpBodySetAngle(tankControlBody, cpBodyGetAngle(tankBody) - turn); + + // drive the tank towards the mouse + if(cpvnear(ChipmunkDemoMouse, cpBodyGetPosition(tankBody), 30.0)){ + cpBodySetVelocity(tankControlBody, cpvzero); // stop + } else { + cpFloat direction = (cpvdot(mouseDelta, cpBodyGetRotation(tankBody)) > 0.0 ? 1.0 : -1.0); + cpBodySetVelocity(tankControlBody, cpvrotate(cpBodyGetRotation(tankBody), cpv(30.0f*direction, 0.0f))); + } + + cpSpaceStep(space, dt); +} + +static cpBody * +add_box(cpSpace *space, cpFloat size, cpFloat mass) +{ + cpFloat radius = cpvlength(cpv(size, size)); + + cpBody *body = cpSpaceAddBody(space, cpBodyNew(mass, cpMomentForBox(mass, size, size))); + cpBodySetPosition(body, cpv(frand()*(640 - 2*radius) - (320 - radius), frand()*(480 - 2*radius) - (240 - radius))); + + cpShape *shape = cpSpaceAddShape(space, cpBoxShapeNew(body, size, size, 0.0)); + cpShapeSetElasticity(shape, 0.0f); + cpShapeSetFriction(shape, 0.7f); + + return body; +} + +static cpSpace * +init(void) +{ + ChipmunkDemoMessageString = "Use the mouse to drive the tank, it will follow the cursor."; + + cpSpace *space = cpSpaceNew(); + cpSpaceSetIterations(space, 10); + cpSpaceSetSleepTimeThreshold(space, 0.5f); + + cpBody *staticBody = cpSpaceGetStaticBody(space); + cpShape *shape; + + // Create segments around the edge of the screen. + shape = cpSpaceAddShape(space, cpSegmentShapeNew(staticBody, cpv(-320,-240), cpv(-320,240), 0.0f)); + cpShapeSetElasticity(shape, 1.0f); + cpShapeSetFriction(shape, 1.0f); + cpShapeSetFilter(shape, NOT_GRABBABLE_FILTER); + + shape = cpSpaceAddShape(space, cpSegmentShapeNew(staticBody, cpv(320,-240), cpv(320,240), 0.0f)); + cpShapeSetElasticity(shape, 1.0f); + cpShapeSetFriction(shape, 1.0f); + cpShapeSetFilter(shape, NOT_GRABBABLE_FILTER); + + shape = cpSpaceAddShape(space, cpSegmentShapeNew(staticBody, cpv(-320,-240), cpv(320,-240), 0.0f)); + cpShapeSetElasticity(shape, 1.0f); + cpShapeSetFriction(shape, 1.0f); + cpShapeSetFilter(shape, NOT_GRABBABLE_FILTER); + + shape = cpSpaceAddShape(space, cpSegmentShapeNew(staticBody, cpv(-320,240), cpv(320,240), 0.0f)); + cpShapeSetElasticity(shape, 1.0f); + cpShapeSetFriction(shape, 1.0f); + cpShapeSetFilter(shape, NOT_GRABBABLE_FILTER); + + for(int i=0; i<50; i++){ + cpBody *body = add_box(space, 20, 1); + + cpConstraint *pivot = cpSpaceAddConstraint(space, cpPivotJointNew2(staticBody, body, cpvzero, cpvzero)); + cpConstraintSetMaxBias(pivot, 0); // disable joint correction + cpConstraintSetMaxForce(pivot, 1000.0f); // emulate linear friction + + cpConstraint *gear = cpSpaceAddConstraint(space, cpGearJointNew(staticBody, body, 0.0f, 1.0f)); + cpConstraintSetMaxBias(gear, 0); // disable joint correction + cpConstraintSetMaxForce(gear, 5000.0f); // emulate angular friction + } + + // We joint the tank to the control body and control the tank indirectly by modifying the control body. + tankControlBody = cpSpaceAddBody(space, cpBodyNewKinematic()); + tankBody = add_box(space, 30, 10); + + cpConstraint *pivot = cpSpaceAddConstraint(space, cpPivotJointNew2(tankControlBody, tankBody, cpvzero, cpvzero)); + cpConstraintSetMaxBias(pivot, 0); // disable joint correction + cpConstraintSetMaxForce(pivot, 10000.0f); // emulate linear friction + + cpConstraint *gear = cpSpaceAddConstraint(space, cpGearJointNew(tankControlBody, tankBody, 0.0f, 1.0f)); + cpConstraintSetErrorBias(gear, 0); // attempt to fully correct the joint each step + cpConstraintSetMaxBias(gear, 1.2f); // but limit it's angular correction rate + cpConstraintSetMaxForce(gear, 50000.0f); // emulate angular friction + + return space; +} + +static void +destroy(cpSpace *space) +{ + ChipmunkDemoFreeSpaceChildren(space); + cpSpaceFree(space); +} + +ChipmunkDemo Tank = { + "Tank", + 1.0/60.0, + init, + update, + ChipmunkDemoDefaultDrawImpl, + destroy, +}; diff --git a/external/Chipmunk/Demo/TheoJansen.c b/external/Chipmunk/Demo/TheoJansen.c new file mode 100644 index 0000000..6ebec81 --- /dev/null +++ b/external/Chipmunk/Demo/TheoJansen.c @@ -0,0 +1,167 @@ +/* Copyright (c) 2007 Scott Lembcke + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +/* + * The previous WalkBot demo I designed was fairly disappointing, so I implemented + * the mechanism that Theo Jansen uses in his kinetic sculptures. Brilliant. + * Read more here: http://en.wikipedia.org/wiki/Theo_Jansen + */ + +#include "chipmunk/chipmunk.h" +#include "ChipmunkDemo.h" + +static cpConstraint *motor; + +static void +update(cpSpace *space, double dt) +{ + cpFloat coef = (2.0f + ChipmunkDemoKeyboard.y)/3.0f; + cpFloat rate = ChipmunkDemoKeyboard.x*10.0f*coef; + cpSimpleMotorSetRate(motor, rate); + cpConstraintSetMaxForce(motor, (rate) ? 100000.0f : 0.0f); + + cpSpaceStep(space, dt); +} + +static cpFloat seg_radius = 3.0f; + +static void +make_leg(cpSpace *space, cpFloat side, cpFloat offset, cpBody *chassis, cpBody *crank, cpVect anchor) +{ + cpVect a, b; + cpShape *shape; + + cpFloat leg_mass = 1.0f; + + // make leg + a = cpvzero, b = cpv(0.0f, side); + cpBody *upper_leg = cpSpaceAddBody(space, cpBodyNew(leg_mass, cpMomentForSegment(leg_mass, a, b, 0.0f))); + cpBodySetPosition(upper_leg, cpv(offset, 0.0f)); + + shape = cpSpaceAddShape(space, cpSegmentShapeNew(upper_leg, a, b, seg_radius)); + cpShapeSetFilter(shape, cpShapeFilterNew(1, CP_ALL_CATEGORIES, CP_ALL_CATEGORIES)); + + cpSpaceAddConstraint(space, cpPivotJointNew2(chassis, upper_leg, cpv(offset, 0.0f), cpvzero)); + + // lower leg + a = cpvzero, b = cpv(0.0f, -1.0f*side); + cpBody *lower_leg = cpSpaceAddBody(space, cpBodyNew(leg_mass, cpMomentForSegment(leg_mass, a, b, 0.0f))); + cpBodySetPosition(lower_leg, cpv(offset, -side)); + + shape = cpSpaceAddShape(space, cpSegmentShapeNew(lower_leg, a, b, seg_radius)); + cpShapeSetFilter(shape, cpShapeFilterNew(1, CP_ALL_CATEGORIES, CP_ALL_CATEGORIES)); + + shape = cpSpaceAddShape(space, cpCircleShapeNew(lower_leg, seg_radius*2.0f, b)); + cpShapeSetFilter(shape, cpShapeFilterNew(1, CP_ALL_CATEGORIES, CP_ALL_CATEGORIES)); + cpShapeSetElasticity(shape, 0.0f); + cpShapeSetFriction(shape, 1.0f); + + cpSpaceAddConstraint(space, cpPinJointNew(chassis, lower_leg, cpv(offset, 0.0f), cpvzero)); + + cpSpaceAddConstraint(space, cpGearJointNew(upper_leg, lower_leg, 0.0f, 1.0f)); + + cpConstraint *constraint; + cpFloat diag = cpfsqrt(side*side + offset*offset); + + constraint = cpSpaceAddConstraint(space, cpPinJointNew(crank, upper_leg, anchor, cpv(0.0f, side))); + cpPinJointSetDist(constraint, diag); + + constraint = cpSpaceAddConstraint(space, cpPinJointNew(crank, lower_leg, anchor, cpvzero)); + cpPinJointSetDist(constraint, diag); +} + +static cpSpace * +init(void) +{ + ChipmunkDemoMessageString = "Use the arrow keys to control the machine."; + + cpSpace *space = cpSpaceNew(); + cpSpaceSetIterations(space, 20); + cpSpaceSetGravity(space, cpv(0,-500)); + + cpBody *staticBody = cpSpaceGetStaticBody(space); + cpShape *shape; + cpVect a, b; + + // Create segments around the edge of the screen. + shape = cpSpaceAddShape(space, cpSegmentShapeNew(staticBody, cpv(-320,-240), cpv(-320,240), 0.0f)); + cpShapeSetElasticity(shape, 1.0f); + cpShapeSetFriction(shape, 1.0f); + cpShapeSetFilter(shape, NOT_GRABBABLE_FILTER); + + shape = cpSpaceAddShape(space, cpSegmentShapeNew(staticBody, cpv(320,-240), cpv(320,240), 0.0f)); + cpShapeSetElasticity(shape, 1.0f); + cpShapeSetFriction(shape, 1.0f); + cpShapeSetFilter(shape, NOT_GRABBABLE_FILTER); + + shape = cpSpaceAddShape(space, cpSegmentShapeNew(staticBody, cpv(-320,-240), cpv(320,-240), 0.0f)); + cpShapeSetElasticity(shape, 1.0f); + cpShapeSetFriction(shape, 1.0f); + cpShapeSetFilter(shape, NOT_GRABBABLE_FILTER); + + cpFloat offset = 30.0f; + + // make chassis + cpFloat chassis_mass = 2.0f; + a = cpv(-offset, 0.0f), b = cpv(offset, 0.0f); + cpBody *chassis = cpSpaceAddBody(space, cpBodyNew(chassis_mass, cpMomentForSegment(chassis_mass, a, b, 0.0f))); + + shape = cpSpaceAddShape(space, cpSegmentShapeNew(chassis, a, b, seg_radius)); + cpShapeSetFilter(shape, cpShapeFilterNew(1, CP_ALL_CATEGORIES, CP_ALL_CATEGORIES)); + + // make crank + cpFloat crank_mass = 1.0f; + cpFloat crank_radius = 13.0f; + cpBody *crank = cpSpaceAddBody(space, cpBodyNew(crank_mass, cpMomentForCircle(crank_mass, crank_radius, 0.0f, cpvzero))); + + shape = cpSpaceAddShape(space, cpCircleShapeNew(crank, crank_radius, cpvzero)); + cpShapeSetFilter(shape, cpShapeFilterNew(1, CP_ALL_CATEGORIES, CP_ALL_CATEGORIES)); + + cpSpaceAddConstraint(space, cpPivotJointNew2(chassis, crank, cpvzero, cpvzero)); + + cpFloat side = 30.0f; + + int num_legs = 2; + for(int i=0; ipreSolve = motor_preSolve; + + { + cpFloat width = 100.0; + cpFloat height = 20.0; + cpFloat mass = 3.0; + + cpBody *boxBody = cpSpaceAddBody(space, cpBodyNew(mass, cpMomentForBox(mass, width, height))); + cpBodySetPosition(boxBody, cpv(200, -100)); + + cpShape *shape = cpSpaceAddShape(space, cpBoxShapeNew(boxBody, width, height, 0.0)); + cpShapeSetFriction(shape, 0.7); + } + + return space; +} + +static void +destroy(cpSpace *space) +{ + ChipmunkDemoFreeSpaceChildren(space); + cpSpaceFree(space); +} + +ChipmunkDemo Unicycle = { + "Unicycle", + 1.0/60.0, + init, + update, + ChipmunkDemoDefaultDrawImpl, + destroy, +}; diff --git a/external/Chipmunk/Demo/VeraMoBI.ttf_sdf.h b/external/Chipmunk/Demo/VeraMoBI.ttf_sdf.h new file mode 100755 index 0000000..e5223dd --- /dev/null +++ b/external/Chipmunk/Demo/VeraMoBI.ttf_sdf.h @@ -0,0 +1,815 @@ +/* + Jonathan "lonesock" Dummer + Signed Distance Font Tool + + C header + font: "Bitstream Vera Sans Mono" +*/ + +#ifndef HEADER_SIGNED_DISTANCE_FONT_XXX +#define HEADER_SIGNED_DISTANCE_FONT_XXX + +/* array size information */ +const int sdf_tex_width = 128; +const int sdf_tex_height = 128; +const int sdf_num_chars = 95; +/* 'unsigned char sdf_data[]' is defined last */ + +/* + The following array holds the spacing info for rendering. + Note that the final 3 values need sub-pixel accuracy, so + they are multiplied by a scaling factor. Make sure to + divide by scale_factor before using the 'offset' and + 'advance' values. + + Here is the data order in the following array: + [0] Unicode character ID + [1] X position in this texture + [2] Y position in this texture + [3] Width of this glyph in the texture + [4] Height of this glyph in the texture + [5] X Offset * scale_factor | Draw the glyph at X,Y offset + [6] Y Offset * scale_factor | relative to the cursor, then + [7] X Advance * scale_factor | advance the cursor by this. +*/ +const float scale_factor = 1000.000000; +const int sdf_spacing[] = { + 32,17,105,4,4,-1500,1500,8437, + 33,120,42,7,14,750,11750,8437, + 34,43,0,9,7,62,11750,8437, + 35,59,56,13,14,-1812,11625,8437, + 36,72,71,11,16,-1250,12187,8437, + 37,46,56,12,13,-1312,11312,8437, + 38,59,98,12,14,-1750,11937,8437, + 39,17,98,5,7,1812,11750,8437, + 40,22,31,9,16,750,12187,8437, + 41,22,47,9,16,-750,12187,8437, + 42,11,88,10,10,-687,11937,8437, + 43,11,53,11,11,-1062,9687,8437, + 44,64,0,7,8,-125,4000,8437, + 45,71,0,8,6,125,6562,8437, + 46,86,0,6,6,875,4000,8437, + 47,83,87,11,15,-1500,11750,8437, + 48,81,28,11,14,-937,11937,8437, + 49,118,99,10,14,-1250,11750,8437, + 50,96,42,12,14,-1750,11937,8437, + 51,92,28,11,14,-1750,11937,8437, + 52,103,28,11,14,-1437,11750,8437, + 53,114,28,11,14,-1500,11750,8437, + 54,33,42,11,14,-875,11875,8437, + 55,33,56,11,14,-812,11750,8437, + 56,33,70,11,14,-1125,11937,8437, + 57,33,84,11,14,-1125,11937,8437, + 58,25,0,7,11,562,8812,8437, + 59,120,56,8,13,-375,8750,8437, + 60,11,31,11,11,-937,9625,8437, + 61,11,113,11,8,-937,8250,8437, + 62,22,117,11,11,-937,9625,8437, + 63,118,71,9,14,437,11937,8437, + 64,72,56,12,15,-1625,11062,8437, + 65,106,113,12,14,-2312,11812,8437, + 66,94,113,12,14,-1687,11750,8437, + 67,33,98,11,14,-625,11937,8437, + 68,106,85,12,14,-1562,11750,8437, + 69,106,71,12,14,-1312,11750,8437, + 70,84,56,12,14,-1187,11812,8437, + 71,33,112,11,14,-812,11937,8437, + 72,108,56,12,14,-1562,11750,8437, + 73,59,70,12,14,-1375,11750,8437, + 74,96,56,12,14,-1687,11750,8437, + 75,46,42,13,14,-1625,11750,8437, + 76,118,113,10,14,-1000,11750,8437, + 77,46,28,13,14,-1937,11750,8437, + 78,94,71,12,14,-1687,11750,8437, + 79,72,101,11,14,-1125,11937,8437, + 80,94,99,12,14,-1437,11687,8437, + 81,83,71,11,16,-1125,11937,8437, + 82,106,99,12,14,-1500,11750,8437, + 83,59,28,11,14,-1500,11937,8437, + 84,46,97,11,14,-312,11750,8437, + 85,108,42,12,14,-1250,11750,8437, + 86,72,87,11,14,-125,11750,8437, + 87,59,42,13,14,-1250,11750,8437, + 88,11,0,14,14,-2500,11750,8437, + 89,84,42,12,14,-562,11750,8437, + 90,33,14,13,14,-1750,11750,8437, + 91,22,63,9,16,0,12187,8437, + 92,11,98,6,15,812,11750,8437, + 93,22,79,9,16,-812,12187,8437, + 94,11,121,11,7,-1125,11750,8437, + 95,52,0,12,5,-1500,-500,8437, + 96,79,0,7,6,1000,12812,8437, + 97,59,14,11,12,-1187,9375,8437, + 98,46,69,11,14,-1187,12187,8437, + 99,11,64,10,12,-500,9375,8437, + 100,59,112,12,14,-1062,12187,8437, + 101,72,115,11,12,-1000,9375,8437, + 102,46,111,11,14,62,12187,8437, + 103,59,84,12,14,-1437,9375,8437, + 104,46,83,11,14,-1125,12187,8437, + 105,83,102,11,15,-1437,12937,8437, + 106,0,0,11,18,-1937,12937,8437, + 107,94,85,12,14,-1000,12187,8437, + 108,105,14,9,14,62,12187,8437, + 109,82,14,12,11,-1750,9375,8437, + 110,114,14,11,11,-1125,9375,8437, + 111,94,14,11,12,-937,9375,8437, + 112,72,42,12,14,-1812,9375,8437, + 113,70,28,11,14,-1062,9375,8437, + 114,83,117,11,11,-500,9375,8437, + 115,11,76,10,12,-937,9375,8437, + 116,118,85,10,13,-437,11375,8437, + 117,22,95,11,11,-812,9187,8437, + 118,22,106,11,11,-375,9187,8437, + 119,70,14,12,11,-937,9187,8437, + 120,46,14,13,11,-2062,9187,8437, + 121,33,28,13,14,-2125,9187,8437, + 122,11,42,11,11,-1187,9187,8437, + 123,22,14,11,17,-625,12187,8437, + 124,0,18,5,18,1875,12250,8437, + 125,11,14,11,17,-1750,12187,8437, + 126,32,0,11,6,-937,7125,8437, + 0 +}; + +/* Signed Distance Field: edges are at 127.5 */ +const unsigned char sdf_data[] = { + 0,0,0,0,0,0,8,32,32,32,15,0,0,0,21,32,32,30,0,0,28,32,32,29,0,0,0,15, + 32,32,32,17,0,0,13,27,28,17,0,0,19,26,0,0,27,32,32,19,32,32,30,0,0,27, + 32,32,32,32,32,32,32,32,32,8,0,0,10,32,32,32,19,0,15,32,32,32,32,32,17, + 0,25,32,32,25,0,0,0,13,32,32,32,19,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,51,95,96,96,60,0,0, + 11,70,96,96,90,40,36,85,96,96,88,34,0,3,61,96,96,96,63,0,41,72,90,92, + 77,54,42,72,86,36,27,82,96,96,67,96,96,90,38,27,82,96,96,96,96,96,96, + 96,96,95,49,0,0,53,95,96,96,67,3,61,96,96,96,96,96,63,23,80,96,96,80, + 24,0,0,58,96,96,96,67,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,67,131,163,124,63,0,0,11,70,131,163, + 122,63,74,124,163,142,88,34,0,15,78,143,163,133,68,27,88,131,154,156, + 139,113,104,124,108,44,32,96,163,143,76,131,163,108,44,32,96,163,163, + 163,163,163,163,163,163,120,56,0,5,67,131,163,135,71,15,77,143,163,163, + 163,135,69,24,82,133,163,111,56,0,11,73,139,163,136,72,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15, + 78,143,178,112,51,0,0,0,47,106,167,148,87,113,165,153,99,49,0,0,27,90, + 154,183,120,56,28,92,158,139,139,154,177,171,163,108,44,32,96,163,143, + 76,131,175,108,44,31,92,112,112,112,112,112,112,112,112,110,54,0,19,80, + 143,184,120,59,27,88,154,159,159,159,120,58,0,43,93,144,144,86,30,23, + 86,151,187,124,61,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,12,45,48,82,116,116,101,39,0,0,0,24,83,144, + 172,111,154,163,111,61,10,0,0,36,99,124,124,107,44,27,90,102,73,72,93, + 115,120,104,73,27,32,96,163,143,76,131,175,108,44,3,42,48,48,48,48,48, + 48,48,48,47,20,0,45,103,163,147,94,40,22,77,92,92,92,92,88,42,0,4,54, + 104,135,116,52,32,95,124,124,111,48,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,42,102,112,112,112,112,81, + 19,0,0,0,0,59,119,179,151,175,122,72,22,0,0,0,22,54,60,60,57,20,2,44, + 47,15,11,35,52,56,44,19,0,32,96,147,143,76,131,147,108,44,0,0,0,0,0,0, + 0,0,0,0,0,0,13,70,131,163,110,58,6,0,22,28,28,28,28,27,0,0,0,15,60,68, + 67,31,10,53,60,60,58,23,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,116,179,179,179,140,76,14,0,0,0,0, + 36,95,156,186,136,83,33,0,0,0,0,61,108,108,108,72,10,0,0,0,0,0,0,0,0, + 0,0,0,21,70,80,80,57,80,80,76,31,0,0,0,0,0,0,0,0,0,0,0,0,28,91,124,124, + 73,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,58,111,112, + 124,191,131,65,2,0,0,0,17,68,116,170,183,122,63,4,0,0,0,13,75,139,175, + 135,72,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,7,51,60,60,34,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,23,48,76,140,179,115,52,0,0,0,6,57,106,159,159,167,147,86,28,0,0,0, + 24,87,151,179,120,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,26,88,152,167,103,40,0,0,0,46,96,147,170,116,144,170,110, + 51,0,0,0,31,92,112,112,105,47,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,38,100,164,155,91,28,0,0,35,85,136,181,131,79,119, + 179,135,74,15,0,0,3,42,48,48,46,15,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,50,112,176,143,79,16,0,19,74,124,175,142, + 90,40,95,157,158,97,38,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,63,124,188,131,67,4,0,26,86,108,108,99, + 51,13,72,108,108,102,45,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,29,44,44,76,139,181,116,55,0,0,0,36,44,44,41, + 9,0,29,44,44,42,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,11,72,108,108,116,163,163,101,40,0,0,0,0,0,10,32, + 32,31,19,0,0,0,0,0,0,0,0,4,23,32,32,31,6,0,0,0,22,32,32,32,32,32,32,32, + 27,0,0,0,0,30,32,32,22,8,32,32,32,24,0,0,0,0,2,18,29,32,28,15,0,0,0,25, + 32,32,19,0,0,3,31,32,32,10,0,0,2,20,20,25,32,19,30,32,13,0,0,0,0,0,19, + 32,32,23,1,0,0,0,19,32,32,32,32,31,6,0,0,0,2,20,20,20,26,32,24,0,0,0, + 0,0,24,87,151,175,179,168,131,76,19,0,0,0,0,0,53,95,96,92,81,46,0,0,0, + 0,0,0,18,61,85,95,96,93,45,0,0,18,74,96,96,96,96,96,96,96,82,27,0,0,38, + 90,96,96,73,51,95,96,96,76,19,0,0,26,63,80,92,96,92,76,45,1,23,80,96, + 96,67,8,0,42,92,96,95,53,0,0,50,84,84,86,96,76,91,95,68,23,0,0,15,52, + 79,95,96,85,58,18,0,8,67,96,96,96,96,93,45,0,0,0,50,84,84,83,87,96,85, + 51,4,0,0,0,31,93,116,116,116,106,79,37,0,0,0,0,0,6,68,133,163,159,139, + 86,27,0,0,0,0,0,56,108,148,159,163,112,50,0,0,31,93,158,163,163,163,163, + 163,155,91,29,0,0,39,97,156,160,101,93,144,163,124,76,19,0,0,53,115,143, + 158,163,156,135,91,38,28,92,159,139,75,32,32,63,124,163,113,53,0,7,70, + 135,151,144,162,119,154,158,111,52,0,11,60,105,140,159,162,145,108,61, + 8,21,83,147,163,163,163,112,50,0,0,7,69,135,151,120,149,163,142,92,33, + 0,0,0,6,45,52,52,52,44,24,0,0,0,0,0,0,11,73,112,115,160,163,96,32,0,0, + 0,0,20,81,143,171,122,112,99,38,0,0,43,104,147,147,147,147,159,192,143, + 79,16,0,0,12,69,131,186,131,136,181,133,82,34,0,0,2,65,131,144,131,124, + 150,182,120,58,28,92,159,139,80,96,96,83,145,152,91,31,0,19,82,147,161, + 124,172,153,131,181,124,60,0,45,99,153,175,139,139,178,151,92,32,28,92, + 131,131,156,163,99,38,0,0,19,82,147,183,151,136,170,175,108,45,0,0,0, + 0,25,32,32,15,0,0,0,0,0,0,0,0,0,32,48,92,156,154,88,27,0,0,0,0,34,96, + 160,151,87,48,44,9,0,0,31,76,80,80,80,124,174,150,99,51,0,0,0,0,42,99, + 158,159,176,142,91,42,0,0,0,12,68,107,99,108,108,131,187,120,59,28,92, + 159,135,108,163,135,103,165,131,68,9,0,32,95,159,139,104,168,131,112, + 178,116,55,10,70,131,188,135,82,88,151,172,108,44,9,54,64,103,167,151, + 87,24,0,0,31,93,158,167,108,85,151,171,107,44,0,0,0,23,80,96,96,60,0, + 0,0,0,0,0,0,0,0,0,41,104,168,142,77,15,0,0,0,0,45,108,172,139,74,11,0, + 0,0,0,0,14,20,69,116,167,156,105,57,9,0,0,0,0,26,74,131,191,147,96,49, + 1,0,0,0,53,102,140,163,173,175,176,176,112,49,28,92,159,135,133,136,139, + 124,167,106,47,0,0,43,106,170,124,116,179,116,124,170,106,43,24,87,151, + 171,107,47,81,147,175,108,44,0,0,54,116,180,139,73,11,0,0,43,106,170, + 149,85,95,159,160,96,34,0,0,0,28,92,159,135,68,0,0,0,0,0,0,0,0,0,0,52, + 116,180,131,66,43,17,0,31,44,62,120,185,124,63,0,0,0,0,0,0,15,63,111, + 161,161,111,63,15,0,0,0,0,20,68,116,167,180,158,99,42,0,0,0,22,83,144, + 184,136,112,108,154,164,100,38,28,92,159,131,157,120,143,145,145,83,24, + 0,0,55,116,177,112,131,167,103,139,159,95,32,28,92,159,163,96,33,93,156, + 165,101,39,0,5,67,131,187,122,61,0,0,0,55,116,182,139,73,108,172,147, + 83,21,0,0,0,28,92,159,135,68,0,0,0,0,0,0,0,0,0,0,56,119,179,142,111,106, + 53,14,76,108,115,153,161,104,45,0,0,0,0,0,9,57,105,156,167,116,68,20, + 0,0,0,0,12,60,108,159,159,131,186,131,70,12,0,0,32,96,160,167,100,63, + 113,172,152,88,26,28,92,159,124,145,120,143,167,120,62,2,0,6,68,131,165, + 100,142,155,91,151,147,82,19,28,92,158,165,102,72,119,177,145,85,24,0, + 18,80,144,174,110,47,0,0,5,68,131,188,124,61,120,183,135,72,10,0,0,0, + 28,92,159,135,68,0,0,0,0,0,0,0,0,0,1,54,99,131,175,167,112,48,27,88,153, + 174,136,108,68,19,0,0,0,0,2,50,99,147,173,122,74,26,4,0,0,0,5,54,102, + 153,165,115,99,160,156,97,40,0,0,30,92,156,177,124,120,156,197,140,76, + 13,28,92,159,175,120,116,178,160,99,39,0,0,17,80,143,153,90,154,143,98, + 163,135,70,7,17,78,139,189,147,135,164,164,113,58,1,0,31,93,158,160,96, + 34,0,0,17,80,143,175,112,69,135,187,120,59,0,0,0,0,28,92,159,135,68,0, + 0,0,0,0,0,0,0,0,24,85,144,169,119,100,91,36,28,85,100,113,173,144,80, + 16,0,0,0,0,43,91,142,177,131,80,68,68,68,37,0,0,28,91,139,139,122,74, + 72,131,139,124,64,0,0,12,69,119,156,163,145,124,151,124,64,2,28,92,139, + 139,97,116,139,139,77,17,0,0,30,92,151,142,101,151,131,111,151,120,58, + 0,0,49,96,139,159,162,147,113,71,24,0,0,44,107,171,147,83,24,24,4,28, + 92,151,151,100,81,145,151,110,47,0,0,0,0,28,92,159,135,68,0,0,0,0,0,0, + 0,0,0,39,102,167,144,82,38,33,1,0,30,43,104,171,140,76,13,0,0,0,13,76, + 136,184,145,135,135,135,135,124,60,0,0,13,61,72,72,69,32,43,72,72,72, + 43,0,0,0,29,69,92,96,85,84,84,83,45,0,13,61,72,72,61,69,72,72,46,0,0, + 0,22,73,84,84,78,84,83,81,84,82,40,0,0,6,50,79,95,96,85,60,25,0,0,0,56, + 120,183,135,88,88,87,49,19,71,84,84,73,66,84,84,78,29,0,0,0,0,28,92,159, + 135,68,0,0,0,0,0,0,0,0,0,51,113,178,131,67,5,0,0,0,0,55,116,181,124,64, + 2,0,0,0,25,87,151,175,175,175,175,175,175,113,51,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,12,30,32,24,20,20,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,19,32,32,23,3,0,0,0,0,56,119,181,169,155,155, + 120,58,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,92,159,135,68,0,0,0,0,0,0,0,36, + 52,66,124,182,116,55,0,0,0,0,4,67,131,179,115,52,47,9,0,0,30,90,108,108, + 108,108,108,108,108,96,38,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,37,88,124,139,139,139,108,45,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28, + 92,159,135,68,0,0,0,0,0,0,15,77,116,119,153,162,101,40,0,0,0,0,8,72,139, + 183,131,116,97,35,0,0,0,38,44,44,44,44,44,44,44,40,6,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38,63,72,72,72,67,24,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,28,92,159,135,68,0,0,0,0,0,0,27,90,154,159,149,120, + 73,17,0,0,0,0,0,58,113,149,159,156,92,30,0,0,0,0,10,32,32,32,15,0,24, + 32,32,29,0,0,0,0,27,32,32,32,8,31,32,32,30,0,0,0,0,0,0,20,31,32,27,13, + 0,0,0,0,3,25,32,25,19,20,20,6,0,0,0,0,10,28,32,26,6,0,0,0,0,0,0,15,27, + 32,31,19,0,0,0,0,0,0,0,0,13,32,32,32,15,0,0,0,19,32,32,32,32,32,32,22, + 0,0,0,28,92,159,135,68,0,0,0,0,0,0,22,77,92,92,85,67,32,0,0,0,0,0,0,23, + 63,85,92,92,71,15,0,0,0,0,53,95,96,96,60,24,77,96,96,88,34,0,0,27,82, + 96,96,95,49,92,96,96,90,38,0,0,0,21,56,81,93,96,90,74,49,0,0,18,58,86, + 96,85,82,84,84,57,0,0,0,34,67,91,96,87,62,23,0,0,0,4,53,77,90,96,93,79, + 50,9,0,0,0,0,0,11,60,96,96,96,60,0,0,8,67,96,96,96,96,96,96,73,0,0,0, + 28,92,159,135,68,0,0,0,0,0,0,0,22,28,28,23,8,0,0,0,0,0,0,0,0,6,23,28, + 28,19,0,0,0,0,0,55,116,163,139,76,54,110,163,151,93,36,0,0,40,103,163, + 163,124,67,124,163,163,103,40,0,0,20,68,111,143,159,163,154,135,87,0, + 11,63,108,147,163,144,122,151,135,68,0,0,34,82,122,153,163,151,113,65, + 10,0,0,24,87,140,155,163,159,140,99,51,0,0,0,0,3,51,99,151,163,124,63, + 0,0,21,83,147,163,163,163,163,143,79,0,0,0,28,92,159,135,68,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,20,26,0,0,0,0,0,10,32,32,28,0,0,0,0,0,42,104,168,151, + 87,85,142,174,116,62,7,0,0,52,115,179,165,131,93,154,179,155,91,29,0, + 0,53,108,161,165,142,139,153,142,77,0,42,99,153,173,139,145,135,183,120, + 57,0,12,69,122,175,153,139,175,154,93,33,0,0,37,99,159,144,139,149,187, + 140,79,0,0,0,0,43,92,144,192,176,112,50,0,0,34,96,160,149,147,147,147, + 131,67,0,0,0,28,92,159,135,68,0,0,0,0,0,0,0,0,0,0,0,9,32,56,79,86,36, + 0,0,0,8,57,95,96,85,30,0,0,0,0,30,91,155,163,98,115,172,144,86,31,0,0, + 2,64,131,173,139,135,120,153,157,143,79,16,0,10,72,136,178,116,78,75, + 92,131,65,6,67,124,186,133,80,101,164,172,108,44,0,37,95,156,162,104, + 87,151,172,108,44,0,0,41,99,95,80,72,97,163,151,84,0,0,0,34,83,135,156, + 151,164,100,38,0,0,45,108,172,124,80,80,80,80,45,0,0,0,28,92,159,135, + 68,0,0,0,0,0,0,0,0,0,21,44,68,91,115,140,108,44,0,0,0,47,96,147,140,85, + 30,0,0,0,0,16,79,143,174,108,147,167,110,54,0,0,0,14,76,140,162,135,139, + 148,124,169,131,67,5,0,12,76,143,179,122,86,62,37,64,37,21,83,147,170, + 107,47,96,163,159,95,33,0,57,116,179,140,78,82,147,175,108,44,0,0,9,41, + 77,92,95,122,174,135,74,0,0,26,74,124,163,111,163,152,88,26,0,0,58,120, + 175,124,131,115,83,40,0,0,0,0,23,80,96,96,60,0,0,0,0,0,0,0,33,57,81,103, + 131,153,176,158,108,44,0,0,30,83,136,159,102,49,0,0,0,0,0,4,67,131,185, + 120,177,136,79,24,0,0,0,26,88,152,151,131,145,158,116,182,116,55,0,0, + 6,67,124,176,176,147,119,88,46,0,28,92,159,163,96,47,107,170,147,83,20, + 10,72,135,185,120,135,105,155,168,104,40,0,0,0,38,100,159,159,152,131, + 94,45,0,18,67,116,167,119,110,174,140,76,14,0,7,69,135,175,171,182,174, + 131,76,19,0,0,0,0,25,32,32,15,0,0,0,0,0,0,25,84,116,142,164,163,142,119, + 97,76,31,0,6,62,116,173,124,70,15,0,0,0,0,0,0,54,116,180,179,160,102, + 47,0,0,0,0,38,100,164,139,120,187,133,131,169,104,43,0,0,0,39,85,120, + 149,174,177,139,84,27,32,95,159,163,99,81,133,190,135,71,9,20,84,148, + 172,108,165,122,164,159,95,32,0,0,0,51,112,151,157,164,133,83,28,0,58, + 108,159,131,80,120,186,124,76,42,0,19,82,131,111,104,122,170,162,98,36, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,92,159,154,124,102,79,58,37,15,0,0,33, + 90,151,157,97,40,0,0,0,0,0,0,0,41,104,168,184,131,72,16,0,0,0,0,50,112, + 176,124,115,124,104,143,158,93,31,0,0,25,44,33,63,90,116,164,169,106, + 43,23,86,148,187,144,139,151,186,120,59,0,28,92,156,164,100,100,115,178, + 144,81,19,0,0,12,40,82,84,95,145,170,107,44,13,75,139,160,143,143,145, + 186,143,122,60,0,8,60,72,49,41,84,149,171,104,40,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,28,92,140,163,162,140,116,95,74,53,17,0,56,116,177,135,72,13, + 0,0,0,0,0,15,28,45,101,160,153,95,40,0,0,0,0,0,62,124,175,112,59,60,92, + 156,145,81,19,0,5,65,107,71,44,38,83,147,175,108,44,4,62,113,154,160, + 135,147,173,108,47,0,28,92,159,163,96,74,135,185,122,63,2,0,51,76,54, + 40,38,77,140,175,111,48,25,87,151,163,163,163,173,178,163,110,47,0,57, + 83,59,48,57,96,157,160,97,35,0,0,0,0,0,0,0,0,0,0,0,0,0,0,9,54,79,102, + 124,151,174,158,136,106,43,11,74,136,176,112,52,0,0,0,0,0,7,65,92,95, + 136,176,119,65,8,0,0,0,0,11,74,139,164,100,38,42,104,168,135,69,7,0,17, + 80,143,131,106,100,120,167,156,95,36,0,23,67,91,96,93,158,162,96,34,0, + 25,88,152,172,113,113,163,156,97,40,0,13,75,139,116,104,100,119,164,158, + 97,37,23,80,96,96,96,96,160,155,96,88,34,15,77,142,120,112,119,144,187, + 136,78,19,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,19,43,67,90,113,139,162,108, + 44,24,87,151,163,99,36,0,0,0,0,0,21,83,147,159,181,142,86,33,0,0,0,0, + 0,23,86,151,152,88,26,55,116,175,120,57,0,0,28,91,155,183,171,167,179, + 161,116,68,12,0,0,10,30,43,104,170,149,85,23,0,10,69,124,174,170,172, + 163,116,68,12,0,26,87,151,179,168,167,179,161,119,69,13,0,25,32,32,45, + 108,172,143,79,29,0,27,88,154,180,179,183,167,136,94,45,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,8,30,54,77,101,104,43,28,92,159,155,91,28,0,0, + 0,0,0,32,96,135,135,124,95,49,0,0,0,0,0,0,26,86,108,108,74,13,57,107, + 108,102,45,0,0,20,74,101,120,131,135,124,102,71,26,0,0,0,0,0,55,116,147, + 136,72,10,0,0,37,82,116,135,131,106,71,28,0,0,24,82,110,124,135,135,124, + 102,71,29,0,0,0,0,0,50,108,112,112,66,4,0,22,77,103,116,120,116,104,81, + 46,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18,42,49,15,28,92,159, + 155,88,24,0,0,0,0,0,15,60,68,68,63,42,6,0,0,0,0,0,0,0,36,44,44,29,0,20, + 44,44,42,12,0,0,0,19,40,58,68,68,62,44,17,0,0,0,0,0,0,41,79,80,80,51, + 0,0,0,0,31,57,68,66,49,20,0,0,0,0,31,48,60,68,68,61,44,17,0,0,0,0,0,0, + 18,47,48,48,28,0,0,0,24,41,52,56,54,43,23,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,6,31,32,32,32,32,32,32,21,23,85,151,159,92,31,0,0,0,0,0,0,0, + 0,0,0,18,30,32,27,10,0,0,0,0,0,0,28,32,32,25,0,25,32,32,32,8,0,3,31,32, + 32,8,0,0,19,32,32,28,0,0,0,0,13,20,20,16,31,32,17,0,0,0,25,32,32,27,0, + 0,24,32,32,31,3,0,0,0,0,10,24,32,32,21,0,0,0,0,0,15,32,32,32,10,15,32, + 32,32,8,0,0,0,25,32,32,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,45,93,96,96,96, + 96,96,96,70,10,72,135,168,104,41,0,0,0,0,0,0,0,0,20,54,78,92,96,88,70, + 33,0,0,0,0,30,85,96,96,80,34,80,96,96,95,49,0,42,92,96,95,49,0,9,67,96, + 96,85,30,0,0,15,68,84,84,76,92,95,76,34,0,23,80,96,96,82,28,24,77,96, + 96,92,42,0,0,4,49,72,87,96,96,82,56,15,0,0,0,60,96,96,95,53,60,96,96, + 95,49,0,0,25,80,96,96,73,0,0,0,0,0,0,0,0,0,0,0,0,0,0,61,124,163,163,163, + 163,163,139,75,0,54,115,176,119,57,0,0,0,0,0,0,0,20,68,108,140,158,163, + 153,116,52,0,0,0,0,43,106,163,151,87,80,124,163,147,99,49,0,52,116,163, + 120,56,0,25,87,151,154,91,30,0,0,32,95,151,151,122,156,159,124,76,20, + 24,85,147,163,107,45,58,111,163,153,97,43,0,0,26,87,135,151,160,160,144, + 105,59,3,0,12,75,139,163,116,55,77,142,163,115,52,0,0,38,100,163,143, + 79,0,0,0,0,0,0,0,0,0,0,0,0,0,8,72,124,124,124,124,155,173,124,63,0,32, + 90,131,131,72,8,0,0,0,0,0,4,59,111,160,163,139,135,153,103,40,0,0,0,0, + 55,116,182,139,80,124,173,147,99,54,9,0,56,120,179,112,56,56,52,103,167, + 135,73,11,0,0,44,107,171,156,145,136,173,163,102,40,5,66,124,187,124, + 63,92,147,167,113,61,9,0,0,38,100,162,143,135,145,185,147,86,25,0,24, + 87,151,169,104,43,90,154,167,103,40,0,0,51,112,177,131,67,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,40,60,60,102,149,173,124,80,37,0,4,50,64,64,43,0,0,0, + 0,0,0,33,90,149,163,111,76,71,94,88,29,0,0,0,5,67,131,188,124,124,173, + 147,99,54,9,0,0,60,124,171,107,119,120,102,120,177,115,54,0,0,0,56,119, + 183,149,94,85,147,178,112,48,0,47,107,169,144,81,124,181,131,78,25,0, + 0,0,43,104,101,79,68,96,163,159,92,28,0,37,99,163,158,93,39,101,167,155, + 91,28,0,1,63,124,181,116,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,17,60,105,150, + 170,122,80,34,0,0,0,0,15,32,32,25,0,0,0,0,0,57,116,177,135,113,120,106, + 71,34,0,0,0,0,16,80,143,177,124,173,147,99,54,9,0,0,2,65,131,167,100, + 145,175,108,139,159,95,36,0,0,6,68,133,186,122,62,80,147,175,108,47,0, + 28,88,151,162,106,162,147,93,41,0,0,0,0,15,49,42,19,66,116,174,136,78, + 18,0,48,111,175,145,81,51,113,178,143,78,15,0,13,76,139,169,104,43,0, + 0,0,0,0,0,0,0,0,0,0,0,0,18,63,105,153,167,122,77,32,4,0,0,0,0,60,96,96, + 80,24,0,0,0,13,74,139,179,139,175,185,163,113,58,0,0,0,0,29,91,155,195, + 178,185,124,65,9,0,0,0,7,70,135,159,107,167,167,108,155,140,77,17,0,0, + 18,80,144,179,112,48,91,155,164,100,38,0,8,69,131,179,142,163,108,57, + 5,0,0,0,0,0,0,18,63,108,158,153,102,49,0,0,61,124,187,133,68,64,124,190, + 131,67,4,0,24,87,151,157,92,31,0,0,0,0,0,0,0,0,0,0,0,0,5,62,108,156,164, + 119,84,84,84,53,0,0,0,0,61,122,163,108,49,0,0,0,24,87,151,194,144,110, + 131,185,142,77,15,0,0,0,40,103,167,192,147,172,148,86,28,0,0,0,12,75, + 139,154,131,142,159,108,172,120,59,0,0,0,30,92,157,180,116,70,116,176, + 144,83,22,0,0,49,111,173,179,124,72,20,0,0,0,0,0,0,24,66,108,156,156, + 108,63,13,0,10,72,139,183,120,56,76,140,180,116,54,0,0,28,92,159,139, + 76,15,0,0,0,0,0,0,0,0,0,0,0,0,19,82,147,201,154,151,151,151,131,65,2, + 0,0,0,43,104,168,131,69,9,0,0,28,92,159,168,106,51,104,171,147,80,16, + 0,0,0,53,116,179,147,99,151,170,110,49,0,0,0,16,80,143,147,154,116,159, + 124,164,101,40,0,0,0,42,104,168,151,153,135,161,167,113,58,1,0,0,38,100, + 164,155,91,37,0,0,0,0,0,0,29,71,113,159,153,108,65,20,0,0,23,85,149,171, + 107,44,88,152,168,104,41,0,0,36,98,155,120,59,0,0,0,0,0,0,0,0,0,0,0,0, + 0,32,95,139,139,139,139,139,139,115,52,0,0,0,0,30,92,157,149,85,23,0, + 0,31,92,159,159,92,56,113,177,142,77,15,0,0,2,65,131,190,124,67,124,187, + 133,72,13,0,0,20,84,149,147,154,93,159,147,145,82,22,0,0,0,54,116,181, + 139,133,162,154,119,77,26,0,0,0,50,112,176,143,79,16,0,0,0,0,0,34,77, + 119,164,144,102,60,56,43,0,0,28,92,159,163,97,59,106,167,153,91,29,0, + 0,48,79,88,85,38,0,0,0,0,0,0,0,0,0,0,0,0,0,17,63,72,72,72,72,72,72,69, + 30,0,0,0,0,20,84,151,159,95,32,0,0,24,87,151,168,111,102,145,176,119, + 61,0,0,0,14,76,142,179,115,52,103,164,156,95,36,0,0,24,88,154,188,131, + 92,157,187,124,63,3,0,0,4,67,131,188,124,79,96,91,67,31,0,0,0,0,63,124, + 188,131,67,4,0,0,0,0,9,70,124,170,140,120,120,120,120,83,20,0,27,88,153, + 179,133,120,147,185,131,70,11,0,10,72,139,143,107,44,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,28,32,32,13,0,0,0,0,0,0,20,84,151,163,96,32,0,0,8,67, + 122,171,168,164,176,136,86,33,0,0,0,27,88,153,167,103,40,81,142,175,116, + 58,0,0,28,92,159,165,104,88,155,168,106,45,0,0,0,15,78,143,177,112,51, + 32,29,10,0,0,0,0,11,74,139,175,116,55,0,0,0,0,0,21,83,147,187,187,187, + 187,187,139,76,13,0,10,69,122,165,183,186,170,140,94,42,0,0,23,85,149, + 159,95,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,30,85,96,96,56,0,0,0,0,0,0, + 26,88,155,160,96,32,0,0,0,33,80,113,131,135,116,86,43,0,0,0,0,30,90,108, + 108,86,28,58,107,108,108,65,2,0,26,86,108,108,79,83,108,108,86,27,0,0, + 0,28,91,147,147,100,38,0,0,0,0,0,0,0,14,76,108,108,99,41,0,0,0,0,0,28, + 91,120,120,120,120,120,120,120,63,2,0,0,32,74,104,119,120,108,85,49,4, + 0,0,26,86,108,108,79,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,36,100,163,131, + 64,0,0,0,0,0,0,38,100,164,149,86,23,0,0,0,0,28,54,68,68,57,31,0,0,0,0, + 0,0,38,44,44,36,0,20,44,44,44,25,0,0,0,36,44,44,33,35,44,44,36,0,0,0, + 0,17,68,80,80,70,21,0,0,0,0,0,0,0,0,31,44,44,41,9,0,0,0,0,0,5,47,56,56, + 56,56,56,56,56,32,0,0,0,0,21,44,56,56,47,28,0,0,0,0,0,36,44,44,33,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,30,36,36,100,167,131,64,36,36,14,0,0,0,57,116, + 179,133,69,9,0,0,0,0,24,32,32,32,32,32,32,32,17,0,0,0,0,10,29,32,19,0, + 0,0,0,0,0,0,0,0,0,0,10,32,32,27,32,32,25,0,0,0,0,0,0,0,11,27,32,28,11, + 0,0,0,0,0,27,32,32,32,32,32,32,31,6,0,0,0,0,10,32,32,32,32,32,27,0,0, + 0,0,27,32,32,25,13,32,32,32,13,0,0,0,17,32,32,32,15,0,0,0,0,0,0,0,0,0, + 0,0,28,85,100,100,100,167,131,100,100,99,54,0,0,22,79,140,167,108,49, + 0,0,0,0,22,77,96,96,96,96,96,96,96,63,0,0,0,26,67,91,96,78,40,0,0,0,0, + 0,0,0,0,0,0,53,95,96,82,96,96,80,23,0,0,0,0,7,42,70,90,96,91,70,37,0, + 0,0,28,82,96,96,96,96,96,96,93,45,0,0,0,0,53,95,96,96,96,96,82,27,0,0, + 28,82,96,96,80,56,96,96,96,56,0,0,7,65,96,96,96,60,0,0,0,0,0,0,0,0,0, + 0,0,32,96,163,167,167,184,168,167,167,124,60,0,0,51,106,165,139,81,24, + 0,0,0,0,35,97,162,163,163,163,163,163,131,68,0,0,8,65,116,154,160,133, + 85,29,0,0,0,0,0,0,0,0,10,71,135,154,91,140,148,85,23,0,0,0,9,54,96,131, + 154,163,154,124,82,29,0,0,41,104,163,163,163,163,163,163,108,47,0,0,0, + 5,67,131,163,163,163,155,91,29,0,0,41,104,163,152,88,71,135,163,120,59, + 0,0,19,82,147,163,131,65,0,0,0,0,0,0,0,0,0,0,0,32,96,131,131,131,168, + 133,131,131,124,60,0,28,82,139,159,104,50,0,0,0,0,0,47,108,147,147,147, + 147,165,174,116,55,0,0,27,90,153,131,113,162,113,51,10,24,6,0,0,0,0,45, + 60,87,151,139,92,156,133,69,51,7,0,0,50,99,147,156,124,112,124,172,115, + 54,0,0,54,116,180,151,147,147,147,147,97,35,0,0,0,16,80,143,147,147,187, + 143,80,17,0,0,54,116,180,139,76,83,147,173,108,47,0,0,31,93,158,179,116, + 52,0,0,0,0,0,0,0,0,0,0,0,13,56,64,64,100,167,131,64,64,64,34,13,65,116, + 171,119,68,16,0,0,0,0,0,35,77,80,80,80,120,176,142,85,29,0,0,28,92,158, + 115,96,155,116,53,69,88,52,0,0,0,19,81,124,124,165,124,124,172,124,124, + 91,28,0,29,85,142,150,102,92,104,95,151,124,60,0,3,66,131,190,124,80, + 80,80,80,68,17,0,0,0,6,60,80,80,124,188,131,67,5,0,3,67,131,190,124,64, + 95,159,162,96,34,0,0,40,103,124,124,103,40,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,36,100,167,131,64,0,0,0,32,96,131,131,80,30,0,0,0,0,0,0,0,15,16,43, + 97,154,164,108,53,0,0,0,17,76,131,165,156,149,96,104,131,139,78,15,0, + 0,34,96,160,163,178,163,164,173,163,142,78,16,0,54,113,169,111,111,151, + 171,153,158,120,56,0,15,78,143,179,115,96,96,96,88,34,0,0,0,0,0,6,16, + 75,139,181,116,55,0,0,15,78,143,178,113,104,108,172,149,85,23,0,0,28, + 56,60,60,56,17,0,0,0,0,0,0,0,0,0,0,0,0,0,0,36,100,131,131,64,0,0,0,13, + 56,64,64,37,0,0,0,0,0,0,0,0,0,21,76,133,186,133,76,21,0,0,0,0,40,82,111, + 116,116,142,136,111,87,57,4,0,0,30,85,96,135,154,96,140,148,96,96,60, + 0,13,75,139,143,93,151,139,106,131,171,107,44,0,27,90,154,187,163,163, + 163,163,99,37,0,0,0,0,0,0,25,87,151,169,104,43,0,0,28,91,155,192,171, + 171,171,192,136,72,10,0,5,66,112,112,112,69,7,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,16,58,64,64,37,0,0,0,0,0,0,15,32,32,32,32,24,0,0,0,0,0,53,108,164, + 156,99,44,0,0,0,0,1,62,104,131,149,124,105,131,131,99,54,2,0,3,61,92, + 92,151,139,92,156,133,92,82,29,0,25,88,153,124,112,165,102,50,112,159, + 95,32,0,39,102,167,159,147,147,147,147,87,25,0,0,0,8,0,0,37,100,164,157, + 92,31,0,0,39,102,167,154,139,139,142,187,124,61,0,0,17,80,143,179,131, + 67,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,14,28,32,29,15,0,0,0,0,0,60,96,96, + 96,96,76,0,0,0,0,31,85,142,177,120,67,12,0,0,0,0,2,63,122,111,88,97,153, + 144,147,145,88,28,0,18,80,144,159,173,160,159,178,159,157,93,32,0,32, + 95,159,116,116,160,96,77,131,147,83,20,0,51,113,178,143,80,80,80,80,63, + 10,0,0,43,72,43,0,49,112,175,144,80,18,0,0,52,115,179,143,77,81,145,175, + 111,48,0,0,33,92,156,174,116,55,0,0,0,0,0,0,0,0,0,0,0,0,0,0,9,47,74,91, + 96,92,76,48,0,0,0,13,75,139,163,163,147,83,0,0,0,8,63,119,174,145,88, + 35,0,0,0,0,0,0,34,67,53,48,112,159,95,104,167,100,36,0,28,92,131,131, + 169,131,131,164,131,131,79,17,0,29,92,159,116,108,169,139,135,170,135, + 70,8,2,64,124,190,131,67,16,16,16,8,0,0,6,68,135,88,60,69,124,188,131, + 68,6,0,2,64,124,190,131,66,93,158,163,99,37,0,0,57,116,177,139,84,31, + 0,0,0,0,0,0,0,0,0,0,0,0,0,8,54,99,135,155,163,156,136,83,0,0,0,25,87, + 151,156,112,112,69,0,0,0,41,95,153,169,111,57,2,0,0,0,0,0,0,0,4,0,40, + 102,161,131,136,153,92,32,0,9,54,71,135,154,91,140,148,85,64,45,0,0,23, + 85,148,133,78,122,143,131,135,120,59,0,13,76,139,180,116,54,0,0,0,0,0, + 0,18,80,145,144,122,124,159,172,112,52,0,0,14,76,140,180,116,53,104,169, + 151,87,24,0,20,79,140,153,99,48,0,0,0,0,0,0,0,0,0,0,0,0,0,0,43,96,147, + 182,148,135,143,140,76,0,0,0,37,99,163,144,80,48,30,0,0,19,74,131,179, + 136,80,25,0,0,0,0,0,0,0,0,0,0,17,70,115,143,142,108,62,8,0,0,26,87,151, + 139,92,156,133,69,8,0,0,0,7,67,124,161,111,77,76,85,108,67,34,0,26,88, + 152,168,104,42,0,0,0,0,0,0,28,92,151,173,185,183,168,133,82,28,0,0,26, + 88,152,168,104,55,116,175,139,75,13,0,26,86,108,107,63,11,0,0,0,0,0,0, + 0,0,0,0,0,0,0,10,70,131,186,139,91,68,81,116,63,0,0,0,49,112,175,131, + 68,6,0,0,0,27,88,112,112,102,48,0,0,0,0,0,0,0,0,0,0,0,0,26,60,80,77,56, + 18,0,0,0,28,85,100,100,88,100,98,53,0,0,0,0,0,38,91,142,163,139,135,147, + 144,82,21,0,31,92,112,112,90,30,0,0,0,0,0,0,13,62,91,110,120,120,107, + 80,40,0,0,0,30,90,108,108,90,57,107,108,108,61,0,0,0,36,44,44,20,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,24,87,151,170,107,49,6,29,52,29,0,0,0,61,124, + 183,119,56,0,0,0,0,0,40,48,48,45,12,0,0,0,0,0,0,0,0,0,0,25,32,32,27,0, + 0,0,0,0,0,0,0,30,36,36,32,36,36,11,0,0,0,0,0,2,49,90,120,139,143,131, + 108,74,18,0,3,42,48,48,40,0,0,0,0,0,0,0,0,6,32,47,56,56,45,24,0,0,0,0, + 0,38,44,44,38,20,44,44,44,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,32,95,159,163,96,32,19,45,38,0,0,0,11,73,139,170,106,43,0,0,0,0,0,0, + 0,0,9,27,32,28,11,0,0,0,0,0,0,23,80,96,96,82,27,0,0,0,0,0,0,0,0,25,32, + 32,32,32,32,32,28,0,0,0,0,2,36,61,74,76,67,49,22,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,28,92,158,168,106,68,78,104,85,23,0,0,23,85,149, + 159,95,32,0,0,0,0,0,0,0,34,67,88,96,91,69,34,0,0,0,0,0,37,99,163,156, + 92,30,0,0,0,0,0,0,0,25,80,96,96,96,96,96,96,85,30,0,0,0,0,0,0,10,32,32, + 10,0,0,0,0,0,0,9,27,32,28,12,0,0,0,0,0,27,32,32,27,0,27,32,32,19,0,0, + 0,27,32,32,32,32,32,32,31,6,0,0,0,17,30,32,25,4,0,0,0,0,0,0,0,0,0,0,0, + 0,0,17,77,136,187,153,135,140,143,79,16,0,0,35,97,162,147,82,19,0,0,0, + 0,0,0,34,82,122,152,163,154,122,78,24,0,0,0,0,48,111,175,144,80,44,36, + 9,0,0,0,0,0,39,101,163,163,163,163,163,159,95,32,0,0,0,0,0,0,53,95,95, + 53,0,0,0,0,0,33,67,88,96,91,70,34,0,0,0,27,82,96,96,82,29,82,96,96,67, + 0,0,29,82,96,96,96,96,96,96,93,45,0,25,56,78,92,96,87,60,20,0,0,0,0,0, + 0,0,0,0,0,0,0,0,47,94,136,158,163,153,131,66,3,0,0,47,108,174,135,70, + 8,0,0,0,0,0,8,67,122,175,149,135,159,169,108,47,0,0,0,0,61,124,187,131, + 98,108,95,60,13,0,0,0,0,51,112,147,147,187,153,147,147,83,20,0,0,0,0, + 12,39,68,133,120,58,32,0,0,0,34,82,122,152,163,155,124,80,28,0,0,41,104, + 163,163,104,42,104,163,136,72,0,0,43,104,163,163,163,163,163,163,108, + 47,0,62,113,140,158,163,149,111,59,0,0,0,0,0,0,0,0,0,0,0,0,0,4,47,77, + 92,96,90,72,40,0,0,0,59,120,184,120,58,4,0,0,0,0,0,22,84,149,160,99,69, + 122,183,116,52,0,0,0,10,72,139,182,116,158,175,153,101,45,0,0,0,0,38, + 78,80,124,187,133,80,80,57,4,0,0,0,20,63,97,116,145,120,111,88,34,0,13, + 70,122,174,163,147,170,171,113,53,0,0,53,116,179,181,116,55,116,181,124, + 61,0,0,55,116,181,149,147,147,147,147,96,34,13,75,139,152,135,140,183, + 144,81,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,17,31,32,27,11,0,0,0,9,72,135,172, + 108,80,57,2,0,0,0,0,22,84,151,158,96,87,135,167,107,46,0,0,0,23,85,149, + 183,147,120,150,188,124,64,0,0,0,0,0,15,73,139,183,120,56,16,4,0,0,0, + 1,58,110,156,170,176,169,164,100,38,0,39,97,158,169,113,81,135,194,131, + 67,0,3,66,131,182,160,131,67,131,175,112,48,0,4,67,131,190,124,80,80, + 80,80,68,17,24,87,119,90,72,103,167,147,82,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,18,31,32,28,17,0,0,21,83,147,172,147,139,75,12,0,0,0,0,8,65,116, + 154,152,149,156,122,76,22,0,0,0,34,96,162,163,105,59,120,187,135,68,0, + 0,0,0,0,23,85,149,171,107,44,0,0,0,0,0,20,82,144,162,110,148,104,124, + 88,26,0,59,120,182,145,83,60,124,191,135,68,0,15,77,143,164,135,143,80, + 143,163,99,37,0,16,79,143,178,113,96,96,96,88,34,0,8,56,63,57,99,144, + 170,116,63,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,51,78,92,96,92,79,57,0,32,96, + 131,131,131,124,63,0,0,0,0,0,45,94,136,162,151,163,147,104,51,0,0,0,0, + 47,108,173,143,80,59,120,187,133,68,0,0,0,0,0,35,97,162,159,95,32,0,0, + 0,0,0,24,88,155,153,116,135,72,68,57,6,13,75,139,189,124,65,68,131,194, + 131,64,0,27,90,154,153,120,156,92,155,151,87,25,0,28,91,155,187,163,163, + 163,162,97,35,0,0,4,57,102,149,163,119,77,29,0,0,0,0,0,0,0,0,0,0,0,0, + 0,3,57,102,140,159,163,156,142,87,0,13,56,64,64,64,64,34,0,0,0,0,15,76, + 135,165,111,84,111,172,135,72,9,0,0,0,59,120,186,136,72,74,136,182,120, + 58,0,0,0,0,4,47,108,174,147,83,20,0,0,0,0,0,18,78,139,184,163,143,116, + 82,36,0,24,87,151,176,112,50,80,143,184,120,57,0,39,101,167,140,108,168, + 104,167,139,75,13,0,40,103,167,159,147,147,147,147,86,23,0,0,30,90,147, + 164,113,71,31,0,0,0,0,0,0,0,0,0,0,0,0,0,0,27,87,147,165,131,120,135,139, + 75,0,0,0,0,15,32,32,32,32,24,0,0,28,92,156,151,84,42,103,167,142,76,12, + 0,0,9,71,135,197,144,85,105,162,160,99,40,0,0,0,46,68,68,120,186,135, + 71,68,37,0,0,0,0,3,48,93,124,153,164,173,124,66,5,28,92,159,167,103,40, + 95,159,169,106,44,0,51,113,178,131,96,160,116,179,124,63,1,0,52,115,179, + 143,80,80,80,80,60,8,0,0,47,108,173,135,74,23,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,32,96,163,151,97,77,74,100,60,0,0,0,0,60,96,96,96,96,76,0,0,28, + 92,156,160,108,98,133,185,124,66,4,0,0,20,83,147,172,139,147,158,176, + 124,73,17,0,0,11,73,135,135,139,188,135,135,122,60,0,0,0,1,54,79,49,91, + 155,106,165,143,76,12,28,92,159,167,100,60,116,177,149,88,27,1,64,124, + 179,115,83,147,139,178,113,51,0,2,64,124,191,131,68,68,68,68,46,0,0,0, + 59,120,139,120,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,88,147,187,158,139, + 115,76,24,0,0,0,13,75,139,163,163,147,83,0,0,15,74,131,175,168,163,179, + 144,94,40,0,0,0,32,95,139,139,105,144,148,124,85,37,0,0,0,23,85,149,175, + 175,175,175,175,111,48,0,0,0,15,78,139,106,104,151,113,169,136,73,11, + 24,87,149,181,124,112,153,178,122,63,6,13,76,139,167,103,70,135,196,165, + 101,39,0,14,76,140,184,135,135,135,135,135,72,8,0,9,71,131,131,108,44, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,27,57,99,124,145,170,167,110,49,0,0,0, + 19,81,112,112,172,135,71,0,0,0,40,85,116,133,135,119,92,51,6,0,0,0,17, + 63,72,72,61,81,84,67,36,0,0,0,0,26,86,108,108,108,108,108,108,93,36,0, + 0,0,28,91,155,168,155,160,167,156,106,51,0,8,65,122,170,182,175,175,136, + 88,35,0,25,88,152,155,91,57,120,175,154,90,27,0,26,88,152,175,175,175, + 175,175,124,63,0,0,21,83,147,160,96,34,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 6,68,106,76,66,83,131,183,120,56,0,0,0,0,37,59,120,185,120,59,0,0,0,0, + 31,57,68,68,58,35,3,0,0,0,0,0,0,0,25,32,32,27,0,0,0,0,0,0,0,36,44,44, + 44,44,44,44,39,3,0,0,0,27,82,111,131,140,135,124,102,63,17,0,0,32,80, + 113,131,144,163,111,62,10,0,30,90,108,108,76,44,99,108,108,76,14,0,30, + 90,108,108,108,108,108,108,104,49,0,0,28,91,120,120,83,22,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,19,81,145,136,120,124,153,163,106,45,0,0,0,0,8,70,135, + 173,108,47,0,0,0,0,0,0,17,31,32,25,4,0,0,0,0,0,0,23,80,96,96,82,27,0, + 0,0,0,0,0,0,0,0,15,32,32,15,20,20,15,0,0,0,28,52,76,142,112,63,44,14, + 0,0,0,0,28,54,68,106,160,139,87,24,0,0,38,44,44,31,9,41,44,44,31,0,0, + 0,38,44,44,44,44,44,44,43,15,0,0,5,47,56,56,43,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,28,92,142,155,163,159,147,115,71,20,0,0,0,0,20,83,147,162,97, + 35,0,0,0,0,4,45,76,92,96,87,62,23,0,0,0,0,0,35,97,162,157,92,31,0,0,0, + 0,0,0,0,0,42,74,95,95,71,84,84,73,22,0,0,0,24,88,143,100,38,0,0,0,0,0, + 0,0,0,18,70,112,82,48,2,0,0,0,0,24,32,32,28,0,0,0,0,0,0,0,0,27,32,32, + 32,27,11,0,0,0,0,0,0,3,31,32,32,19,0,0,0,0,0,0,0,0,0,0,0,0,0,11,58,78, + 91,96,95,83,62,26,0,0,0,0,0,32,95,159,149,85,23,0,0,0,0,49,94,135,158, + 163,149,113,65,10,0,0,0,0,47,110,174,145,81,44,36,9,0,0,0,0,0,42,88,133, + 158,158,119,151,151,95,32,0,0,0,12,62,76,67,19,0,0,0,0,0,0,0,0,0,28,48, + 28,0,0,0,0,0,20,76,96,96,85,30,0,0,0,0,0,0,28,82,96,96,96,88,72,42,1, + 0,0,0,0,44,92,96,96,67,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16,28,32,32,22,3, + 0,0,0,0,0,0,44,107,171,139,72,10,0,0,0,28,85,140,184,144,135,170,154, + 95,34,0,0,0,0,59,120,186,133,99,108,95,60,10,0,0,0,19,76,133,181,153, + 139,149,172,147,82,19,0,0,27,32,32,25,0,8,32,32,32,17,0,0,0,0,0,0,0,30, + 32,31,3,0,0,34,96,160,159,95,32,0,0,0,0,0,0,41,104,163,163,163,153,131, + 91,43,0,0,6,20,59,120,163,135,71,20,13,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 30,32,25,0,0,0,0,0,0,0,56,119,183,124,61,0,0,0,0,50,111,172,148,92,79, + 140,175,110,47,0,0,0,10,72,135,183,120,160,175,153,97,37,0,0,0,43,103, + 163,158,102,78,139,196,135,70,8,0,27,82,96,96,80,23,51,95,96,96,63,0, + 0,0,0,0,0,40,90,96,92,42,0,0,46,108,172,147,83,30,32,32,31,3,0,0,54,116, + 180,149,147,167,184,133,74,14,2,57,84,84,135,185,120,84,84,68,0,0,0,0, + 0,0,0,0,0,0,0,0,6,24,38,90,96,80,23,22,0,0,0,0,6,68,133,175,111,48,0, + 0,0,0,60,124,188,131,66,77,142,179,112,48,0,0,0,21,83,147,188,142,120, + 162,175,110,47,0,0,0,60,122,186,133,70,72,135,184,120,58,0,0,32,95,159, + 159,92,28,74,135,163,122,63,0,0,0,0,0,12,69,124,160,101,43,0,0,59,120, + 185,135,71,90,96,96,92,42,0,3,67,131,189,124,83,116,177,155,91,28,17, + 80,143,151,156,185,151,151,149,85,0,0,0,0,0,0,0,0,0,0,0,0,52,88,63,108, + 159,92,72,83,37,0,0,4,18,80,144,163,99,37,0,0,0,0,60,124,189,131,78,105, + 162,175,111,48,0,0,0,34,96,160,162,101,87,151,169,104,42,0,0,6,68,135, + 187,120,58,85,147,172,108,45,0,0,28,92,159,160,96,40,99,160,158,97,38, + 0,0,0,0,0,40,97,156,131,72,15,0,8,70,135,185,120,97,142,163,136,94,42, + 0,15,78,143,177,112,51,100,167,159,92,28,28,91,143,143,167,163,143,143, + 139,73,0,0,0,0,0,0,0,0,0,0,0,24,83,142,120,108,159,97,131,124,67,0,4, + 57,80,92,156,151,87,24,0,0,0,0,50,111,170,167,143,156,175,165,101,39, + 0,0,0,45,108,172,147,83,97,163,158,93,31,0,0,7,70,135,191,131,81,116, + 172,160,96,34,0,0,24,88,155,163,96,63,122,183,133,72,13,0,0,0,0,12,69, + 124,160,101,44,0,0,19,82,147,173,108,147,170,131,85,46,4,0,28,91,155, + 165,101,41,104,170,155,90,27,15,65,76,106,170,149,85,76,76,48,0,0,0,0, + 0,0,0,0,0,0,0,24,82,115,147,147,163,156,139,108,69,0,20,83,147,147,172, + 139,75,13,0,0,0,0,26,80,124,151,151,124,165,148,86,25,0,0,0,58,120,184, + 135,71,110,174,145,81,19,0,0,0,59,119,175,167,147,150,178,147,83,21,0, + 0,23,85,151,163,96,87,148,165,104,47,0,0,0,0,0,40,97,156,131,72,15,0, + 0,32,95,159,165,156,162,119,77,37,0,0,0,39,102,167,154,88,54,116,179, + 144,80,18,0,7,55,116,182,136,72,12,12,0,0,0,0,0,0,0,0,0,0,0,0,15,61,90, + 120,153,182,144,111,82,49,0,28,92,131,131,131,124,63,0,0,0,0,0,51,70, + 69,87,87,131,183,124,65,6,0,0,7,69,135,186,120,59,120,187,135,69,7,0, + 0,0,34,84,124,147,139,120,183,135,71,10,0,0,20,84,151,163,96,111,172, + 140,79,22,0,0,0,0,12,69,124,158,101,44,0,0,0,43,106,170,192,168,169,108, + 51,0,0,0,0,52,115,179,142,77,73,135,189,131,66,4,0,6,68,131,187,124,61, + 12,1,0,0,0,0,0,0,0,0,0,0,0,0,32,95,149,147,113,159,122,156,139,76,0,9, + 54,64,64,64,64,34,0,0,0,0,15,77,131,102,97,120,165,150,95,38,0,0,0,19, + 82,147,173,108,72,135,184,120,57,0,0,0,8,70,120,95,84,95,144,177,116, + 56,0,0,0,16,80,147,167,100,136,174,113,54,0,0,0,0,0,40,97,156,131,70, + 13,0,0,0,56,119,183,144,122,183,136,76,18,0,0,2,64,124,190,131,72,105, + 160,167,107,47,0,0,16,80,143,175,111,76,76,54,1,0,0,0,0,0,0,0,0,0,0,0, + 10,67,116,88,108,159,92,97,105,51,0,0,0,24,32,32,28,21,32,32,30,0,27, + 90,154,167,163,179,151,108,60,7,0,0,0,28,92,139,139,97,83,139,139,108, + 45,0,0,0,20,83,147,159,151,157,185,144,90,33,0,0,0,13,76,143,167,100, + 160,149,88,29,0,0,0,0,13,69,124,158,99,42,0,0,0,6,68,131,187,124,97,158, + 162,102,44,0,0,14,76,140,184,135,136,158,183,135,79,22,0,0,20,83,147, + 188,147,143,139,75,12,0,0,0,0,0,0,0,0,0,0,0,0,29,52,44,107,124,91,42, + 49,15,0,0,19,76,96,96,85,70,96,96,90,38,30,90,119,135,133,120,95,60,18, + 0,0,0,0,13,61,72,72,63,57,72,72,67,24,0,0,0,28,91,131,143,147,143,124, + 95,51,2,0,0,0,12,76,142,167,124,182,122,63,4,0,0,0,0,42,99,158,131,70, + 13,0,0,0,17,80,143,175,112,73,133,188,131,69,12,0,26,88,152,175,175,171, + 158,131,91,43,0,0,0,7,65,113,143,151,151,124,63,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,20,57,60,51,7,0,0,0,0,34,96,160,159,95,86,151,163,104,42,0,38, + 58,68,68,58,38,8,0,0,0,0,0,0,17,32,32,32,32,32,32,32,32,15,0,0,5,47,67, + 76,80,76,66,40,6,0,0,0,0,8,72,139,172,149,156,97,38,0,0,0,0,13,70,131, + 158,99,42,0,0,0,0,28,92,139,139,100,48,107,139,139,95,32,0,30,90,108, + 108,108,104,95,74,41,1,0,0,0,0,23,62,80,84,84,83,43,0,0,0,0,0,0,0,0,0, + 0,0,0,0,27,32,31,6,0,0,27,32,32,19,0,46,108,172,147,83,98,163,157,92, + 30,0,0,0,0,0,18,31,32,26,9,0,0,0,4,63,96,96,96,96,96,96,96,96,60,0,0, + 0,0,0,0,0,11,27,32,30,18,0,0,0,4,68,135,175,175,131,70,13,0,0,0,0,42, + 99,158,131,70,13,0,0,0,0,13,61,72,72,63,21,65,72,72,63,17,0,0,38,44,44, + 44,40,33,15,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,27,82,96, + 93,47,0,27,82,96,96,67,0,58,120,184,135,71,110,174,144,80,18,0,0,0,20, + 54,79,92,96,87,69,32,0,0,18,80,144,163,163,163,163,163,163,124,63,0,0, + 0,0,0,0,39,70,90,96,92,80,45,0,0,2,65,108,108,108,102,45,0,0,0,0,13,70, + 131,158,99,42,0,0,0,0,0,0,0,0,27,32,32,32,32,23,4,0,0,0,0,0,25,32,32, + 32,32,22,1,0,0,0,0,0,0,10,25,32,32,30,0,0,0,0,0,0,0,0,0,0,0,0,29,92,158, + 122,60,0,32,96,163,143,76,8,70,135,186,120,60,122,187,133,68,6,0,0,23, + 68,108,140,159,163,151,120,56,0,0,28,92,143,143,143,189,147,143,143,112, + 51,0,0,0,0,0,38,85,131,154,163,159,124,60,0,0,0,25,44,44,44,42,12,0,0, + 0,0,32,96,131,124,69,13,0,0,0,0,0,0,0,27,82,96,96,96,96,85,62,26,0,0, + 0,25,80,96,96,96,95,83,58,18,0,0,0,9,54,72,87,96,96,90,38,0,0,0,0,0,0, + 0,0,0,0,0,22,84,151,131,67,3,32,96,163,143,76,20,83,147,174,108,73,135, + 183,119,56,0,0,8,62,113,161,177,151,148,169,110,47,0,0,15,65,76,76,131, + 190,124,76,76,72,30,0,0,0,0,5,66,124,178,145,131,140,112,50,0,0,0,0,0, + 0,9,27,32,28,13,0,0,13,56,64,64,34,0,0,0,0,0,0,0,0,39,101,163,163,163, + 160,148,115,69,15,0,0,39,101,163,163,163,159,145,108,60,3,0,0,30,92,136, + 151,163,163,102,39,0,0,0,0,0,0,0,0,0,0,0,15,77,143,139,73,11,32,96,163, + 143,76,28,92,159,171,104,101,156,171,107,44,0,0,37,93,151,177,131,90, + 84,113,97,35,0,0,0,7,15,78,143,179,115,52,12,10,0,0,0,0,0,12,76,143,175, + 108,64,79,88,35,0,0,0,0,0,33,67,88,96,91,70,34,0,0,0,0,0,0,3,31,32,32, + 19,0,0,0,51,113,178,144,139,147,182,159,98,37,0,0,51,112,177,147,139, + 149,190,147,83,22,0,0,42,104,167,151,172,155,91,28,0,0,0,0,0,0,0,0,0, + 0,0,7,70,135,147,80,18,32,96,147,143,76,28,92,156,190,151,154,164,159, + 95,32,0,0,61,120,181,147,88,37,24,65,63,17,0,0,0,0,27,90,154,167,102, + 39,0,0,0,0,0,0,0,17,72,135,188,131,69,24,29,12,0,0,0,0,34,82,122,152, + 163,155,124,80,27,0,0,0,0,0,44,92,96,96,67,8,0,1,64,124,190,131,72,92, + 157,171,104,40,0,1,63,124,189,131,72,104,171,155,88,24,0,0,46,105,102, + 111,175,143,78,15,0,0,0,0,0,0,0,0,0,0,0,0,63,124,155,88,25,21,70,80,80, + 57,14,71,122,149,144,111,139,139,83,20,0,16,78,142,184,120,62,3,0,5,4, + 0,0,0,0,0,39,101,167,155,91,28,0,0,0,0,0,0,17,63,106,145,190,154,95,69, + 76,76,45,0,0,13,69,122,174,163,147,170,170,112,53,0,0,0,0,0,58,120,163, + 135,71,9,0,13,76,139,180,116,55,97,160,163,99,37,0,13,75,139,182,116, + 68,112,174,145,83,20,0,0,15,46,60,122,187,131,67,4,0,0,0,0,0,0,0,0,0, + 0,0,0,56,119,162,96,32,0,0,0,0,0,0,32,67,84,80,68,72,72,54,3,0,27,88, + 155,169,104,43,0,0,0,0,0,0,0,0,0,51,113,178,143,78,15,0,0,0,0,0,0,53, + 105,156,147,142,181,120,100,143,124,64,0,0,38,97,157,169,113,81,135,193, + 131,67,0,0,0,0,8,70,135,183,120,59,0,0,26,88,152,168,116,116,142,185, + 140,81,20,0,25,87,151,172,131,133,156,159,113,60,2,0,0,0,10,72,136,180, + 116,54,0,0,0,0,0,0,0,0,0,0,0,0,0,48,112,168,104,40,0,0,0,0,0,0,25,32, + 32,25,0,22,32,32,30,0,32,96,160,163,96,33,2,36,33,0,0,0,0,0,1,63,124, + 190,131,67,3,0,0,0,0,0,19,79,140,165,106,113,174,149,115,177,115,53,0, + 0,59,120,182,145,83,60,124,191,135,68,0,0,0,40,48,74,116,116,108,47,0, + 0,38,100,164,187,183,182,172,145,102,52,0,0,37,99,163,177,171,184,135, + 101,68,23,0,0,0,0,22,84,148,168,104,42,0,0,0,0,0,0,0,0,0,0,0,0,0,40,104, + 168,112,48,0,0,0,0,0,23,80,96,96,80,23,74,96,96,90,38,31,93,159,167,103, + 47,58,91,84,25,0,0,0,0,13,76,139,180,116,54,0,0,0,0,0,0,31,93,159,159, + 92,87,147,176,147,150,92,34,0,13,75,139,189,124,65,68,131,195,131,65, + 0,0,30,90,112,112,112,112,88,27,0,0,50,112,176,143,116,116,108,88,56, + 12,0,0,49,112,175,144,104,140,183,120,61,0,0,0,0,4,34,96,160,156,92,30, + 0,0,0,0,0,0,0,0,0,0,0,0,0,32,96,162,116,55,0,0,0,0,0,27,90,155,160,96, + 44,102,162,158,97,39,22,83,147,188,139,108,116,145,87,25,0,0,0,0,25,87, + 151,168,104,42,0,0,0,0,0,0,29,92,157,174,119,96,119,183,158,108,60,6, + 0,24,87,151,176,112,50,80,143,184,120,58,0,0,41,104,168,179,179,149,85, + 23,0,0,62,124,188,131,68,52,45,29,2,0,0,0,61,124,188,133,68,113,176,142, + 79,18,0,0,46,68,68,108,172,144,80,68,46,0,0,0,0,0,0,0,0,0,0,0,0,25,88, + 155,124,63,0,0,0,0,0,19,82,147,167,100,69,131,186,131,70,13,3,60,115, + 164,190,175,180,139,76,13,0,0,0,0,30,90,108,108,90,30,0,0,0,0,0,0,15, + 74,131,175,176,163,174,160,172,112,54,0,0,28,92,159,167,103,40,95,159, + 169,106,45,0,0,46,105,112,116,183,139,72,10,0,11,74,139,182,116,55,0, + 0,0,0,0,0,11,73,139,183,119,56,95,159,160,97,37,0,11,74,135,135,135,185, + 139,135,135,72,0,0,0,0,0,0,0,0,0,0,0,0,18,80,147,135,69,0,0,0,0,0,11, + 74,139,171,107,95,156,158,99,42,0,0,26,71,108,131,135,124,104,62,1,0, + 0,0,0,0,38,44,44,38,0,0,0,0,0,0,0,0,40,85,116,135,131,113,120,120,120, + 71,8,0,28,92,159,167,100,60,116,177,149,88,28,0,0,15,46,68,131,187,124, + 61,0,0,24,87,151,170,106,43,0,0,0,0,0,0,23,85,151,171,107,44,79,142,175, + 116,56,0,23,86,151,175,175,175,175,175,124,63,0,0,0,0,0,0,0,0,0,0,0,0, + 11,73,131,131,76,0,0,0,0,0,3,67,131,179,112,120,181,131,70,13,0,0,0,21, + 49,65,68,63,45,18,0,0,0,0,0,0,0,0,0,20,31,32,32,28,0,0,0,0,0,32,57,68, + 67,53,56,56,56,37,0,0,23,86,149,181,124,112,153,177,120,63,6,0,0,0,17, + 80,144,175,112,48,0,0,26,86,108,108,90,30,0,0,0,0,0,0,26,86,108,108,90, + 32,61,108,108,108,61,0,26,86,108,108,108,108,108,108,104,49,0,0,0,0,0, + 0,0,0,0,0,0,0,0,43,64,64,45,0,0,0,0,0,0,59,120,183,116,149,160,101,44, + 0,0,0,0,0,0,0,18,31,32,26,9,0,0,0,0,0,0,6,51,81,92,96,96,85,30,0,0,0, + 0,0,0,0,0,0,21,32,32,30,0,0,7,65,122,170,182,175,175,136,88,35,0,0,26, + 40,40,92,156,163,99,40,38,9,0,36,44,44,38,0,0,0,0,0,0,0,0,36,44,44,38, + 0,22,44,44,44,22,0,0,36,44,44,44,44,44,44,43,15,0,0,0,0,0,0,0,0,0,0,0, + 0,25,32,32,32,32,32,32,32,30,0,0,51,112,179,124,174,131,72,15,0,0,0,0, + 0,19,53,78,92,96,87,69,32,0,0,0,0,0,42,96,142,159,163,159,93,31,0,0,0, + 0,0,0,0,0,11,70,96,96,90,38,0,0,32,80,113,133,133,115,85,43,0,0,10,70, + 104,104,104,168,151,104,104,99,44,0,0,0,27,32,32,32,32,27,10,0,0,0,0, + 0,0,0,0,30,32,32,30,0,0,0,0,0,27,32,32,27,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 23,80,96,96,96,96,96,96,96,90,38,0,43,106,171,163,160,101,44,0,0,0,0, + 0,22,68,108,140,159,163,151,120,56,0,0,0,19,32,66,124,186,142,131,131, + 82,19,0,0,0,0,0,0,0,0,26,88,152,163,103,40,0,0,0,28,54,68,68,56,31,0, + 0,0,23,85,149,171,171,187,176,171,169,104,43,0,0,27,82,96,96,96,96,90, + 69,34,0,0,0,0,0,0,40,90,96,96,90,38,0,0,0,27,82,96,96,82,27,0,0,0,0,0, + 0,0,0,0,0,0,0,0,28,92,159,163,163,163,163,163,163,108,44,0,36,98,139, + 139,133,74,17,0,0,0,0,7,61,111,161,177,151,147,169,108,47,0,0,9,67,96, + 96,144,175,111,96,95,53,0,0,0,0,0,0,13,37,44,38,100,164,155,91,29,0,0, + 0,0,0,17,31,32,24,4,0,0,28,91,120,120,120,120,120,120,120,93,31,0,0,39, + 102,163,163,163,163,153,122,76,21,0,0,0,0,10,67,124,163,163,112,48,0, + 0,0,39,101,163,155,91,28,0,0,0,0,0,0,0,0,0,0,0,0,0,28,92,135,135,135, + 135,135,135,135,108,44,0,17,63,72,72,72,43,0,0,0,0,0,37,93,151,177,124, + 90,83,113,96,34,0,0,22,84,148,163,171,184,163,163,120,58,0,0,0,0,0,29, + 69,97,108,97,112,176,143,79,16,0,0,0,12,49,77,92,96,86,60,23,0,5,47,56, + 56,56,56,56,56,56,47,6,0,0,51,113,178,142,135,139,170,165,103,40,0,0, + 0,0,37,93,154,164,183,116,52,0,0,0,51,113,178,143,78,15,0,0,0,0,0,0,0, + 0,0,0,0,0,0,20,74,88,88,88,88,88,88,88,83,35,0,22,24,2,0,0,0,0,0,0,0, + 0,61,120,181,145,88,36,36,65,61,15,0,0,32,96,131,131,172,152,131,131, + 108,46,0,0,0,0,19,71,119,158,175,153,124,188,131,67,5,0,0,9,57,102,139, + 158,163,147,113,68,15,0,0,0,20,20,20,21,32,31,15,0,0,1,64,124,188,124, + 68,83,147,172,108,44,0,0,0,5,63,120,181,122,179,120,56,0,0,1,63,124,190, + 131,67,4,0,0,0,0,0,0,0,0,0,0,0,0,0,28,92,155,155,155,155,155,155,155, + 108,44,22,77,85,62,38,14,0,0,0,0,0,16,78,142,185,120,91,100,100,100,85, + 28,0,0,13,56,64,116,181,139,75,64,61,22,0,0,0,0,49,106,162,164,124,135, + 142,181,116,55,0,0,0,43,97,150,173,139,131,161,158,99,40,0,0,48,83,84, + 84,82,96,93,74,33,0,13,76,139,176,112,96,111,162,153,93,34,0,0,0,32,90, + 149,156,112,179,124,62,0,0,13,76,139,180,116,54,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,28,92,143,143,143,143,143,143,143,108,44,28,92,145,120,97,73,51, + 27,3,0,0,28,91,155,170,106,112,167,167,153,88,27,0,0,0,4,67,131,188,124, + 63,0,0,0,0,0,0,10,70,133,186,124,72,98,163,169,104,43,0,0,9,69,131,186, + 133,84,84,131,181,116,52,0,5,67,131,151,124,142,160,158,116,52,0,25,88, + 152,184,163,163,165,139,108,62,8,0,0,1,59,116,176,131,108,175,131,68, + 4,0,25,88,152,168,104,42,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,65,76,76,76,76, + 76,76,76,72,29,28,92,153,174,158,135,110,86,62,39,6,32,96,163,163,96, + 124,135,168,140,76,14,0,0,0,16,79,143,177,112,51,0,0,0,0,0,0,24,87,151, + 168,104,43,96,163,157,92,31,0,0,24,87,151,185,151,151,151,152,182,116, + 52,0,17,80,143,182,147,144,139,152,104,41,0,38,100,164,153,135,135,153, + 156,113,58,0,0,0,28,86,145,164,104,108,175,139,72,8,0,38,100,164,156, + 92,30,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,27,32,32,17,0,0,0,17,68,92, + 113,136,158,170,147,122,96,40,31,93,159,167,103,68,111,175,124,64,2,0, + 0,0,28,91,155,164,100,38,0,0,0,0,0,0,32,95,159,163,96,53,111,173,145, + 81,19,0,0,32,96,160,162,139,139,139,139,139,108,45,0,29,92,156,177,122, + 82,72,94,90,30,0,49,112,176,140,76,69,116,179,139,76,12,0,0,54,112,172, + 170,159,159,182,143,76,12,0,49,112,176,144,80,18,4,4,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,35,82,96,96,66,15,0,0,0,10,32,53,74,95,119,142,175,108, + 44,21,82,144,188,139,108,124,179,115,52,0,0,0,0,40,103,167,153,88,27, + 0,0,0,0,0,0,32,95,159,165,104,91,142,195,133,68,6,0,0,30,92,159,159,97, + 72,72,90,116,67,25,0,41,104,168,154,92,33,10,38,38,0,0,62,124,188,124, + 64,67,120,184,139,74,11,0,24,81,142,172,143,143,143,170,147,80,17,0,62, + 124,188,131,68,68,68,68,48,0,0,0,0,0,0,0,0,0,0,0,0,0,24,74,124,163,156, + 105,54,5,0,5,47,69,91,112,135,157,169,145,108,44,1,58,111,160,189,175, + 182,163,102,39,0,0,0,0,52,115,139,139,76,14,0,0,0,0,0,0,22,83,144,194, + 154,151,142,183,120,57,0,0,0,18,78,139,187,149,135,139,152,124,60,0,0, + 54,116,180,139,76,13,0,0,0,0,11,73,139,179,120,120,124,159,175,119,59, + 0,0,51,108,168,147,86,76,100,167,151,86,23,11,74,139,188,135,135,135, + 135,135,76,0,0,0,0,0,0,0,0,0,0,0,0,14,63,113,164,153,170,145,94,43,0, + 28,91,131,153,174,156,133,108,85,62,22,0,23,68,104,131,135,124,106,71, + 22,0,0,0,0,33,70,72,72,49,0,0,0,0,0,0,0,0,56,105,143,148,122,139,139, + 107,44,0,0,0,0,49,96,136,157,163,158,143,111,48,0,3,66,131,190,124,64, + 1,0,0,0,0,23,86,151,175,175,175,171,158,131,84,32,0,19,78,136,179,120, + 62,32,96,163,155,91,28,23,86,151,175,175,175,175,175,124,63,0,0,0,0,0, + 0,0,0,0,0,0,2,52,102,154,150,104,122,167,136,82,33,28,92,159,144,119, + 95,72,49,25,2,0,0,0,18,47,64,68,63,47,19,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,15,56,80,84,67,72,72,67,24,0,0,0,0,6,48,77,92,96,92,80,59,23, + 0,15,78,143,178,113,51,0,0,0,0,0,26,86,108,108,108,108,104,95,74,39,0, + 0,27,88,112,112,93,36,31,92,112,112,88,27,26,86,108,108,108,108,108,108, + 104,51,0,0,0,0,0,0,0,0,0,0,0,27,90,144,147,102,57,74,119,147,122,66,27, + 90,106,83,59,36,13,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,17,29,32,28,18,0,0,0,27,90, + 151,151,102,39,0,0,0,0,0,0,36,44,44,44,44,42,34,15,0,0,0,0,40,48,48,42, + 3,3,42,48,48,40,0,0,36,44,44,44,44,44,44,43,15,0,0,0,0,0,0,0,0,0,0,0, + 17,68,80,80,54,12,29,70,80,80,51,2,44,47,24,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,19,71,84,84,73,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 255 +}; + +#endif /* HEADER_SIGNED_DISTANCE_FONT_XXX */ diff --git a/external/Chipmunk/Demo/VeraMoBd.ttf_sdf.h b/external/Chipmunk/Demo/VeraMoBd.ttf_sdf.h new file mode 100755 index 0000000..4403eaf --- /dev/null +++ b/external/Chipmunk/Demo/VeraMoBd.ttf_sdf.h @@ -0,0 +1,854 @@ +/* + Jonathan "lonesock" Dummer + Signed Distance Font Tool + + C header + font: "Bitstream Vera Sans Mono" +*/ + +#ifndef HEADER_SIGNED_DISTANCE_FONT_XXX +#define HEADER_SIGNED_DISTANCE_FONT_XXX + +/* array size information */ +const int sdf_tex_width = 128; +const int sdf_tex_height = 128; +const int sdf_num_chars = 95; +/* 'unsigned char sdf_data[]' is defined last */ + +/* + The following array holds the spacing info for rendering. + Note that the final 3 values need sub-pixel accuracy, so + they are multiplied by a scaling factor. Make sure to + divide by scale_factor before using the 'offset' and + 'advance' values. + + Here is the data order in the following array: + [0] Unicode character ID + [1] X position in this texture + [2] Y position in this texture + [3] Width of this glyph in the texture + [4] Height of this glyph in the texture + [5] X Offset * scale_factor | Draw the glyph at X,Y offset + [6] Y Offset * scale_factor | relative to the cursor, then + [7] X Advance * scale_factor | advance the cursor by this. +*/ +const float scale_factor = 1000.000000; +const int sdf_spacing[] = { + 32,109,124,4,4,-1500,1500,9625, + 33,122,76,6,15,2250,13187,9625, + 34,0,90,10,8,312,13250,9625, + 35,48,46,13,15,-1437,13062,9625, + 36,37,16,11,18,-250,13687,9625, + 37,61,46,13,15,-1250,12750,9625, + 38,25,0,13,16,-1187,13375,9625, + 39,0,118,6,8,2312,13250,9625, + 40,13,18,8,18,1500,13687,9625, + 41,13,36,8,18,875,13687,9625, + 42,0,42,11,11,-562,13375,9625, + 43,73,0,12,12,-1000,10875,9625, + 44,0,103,7,9,1312,4375,9625, + 45,0,112,8,6,875,7312,9625, + 46,6,118,6,6,2000,4375,9625, + 47,98,92,11,17,-625,13250,9625, + 48,25,97,11,16,-562,13375,9625, + 49,85,46,11,15,-62,13250,9625, + 50,96,46,11,15,-625,13437,9625, + 51,49,0,11,16,-500,13375,9625, + 52,87,61,12,15,-687,13187,9625, + 53,61,31,11,15,-375,13187,9625, + 54,38,0,11,16,-500,13437,9625, + 55,94,31,11,15,-437,13250,9625, + 56,25,81,11,16,-500,13437,9625, + 57,25,49,11,16,-625,13312,9625, + 58,121,0,6,12,2000,9875,9625, + 59,120,92,7,14,1375,9875,9625, + 60,85,0,12,12,-812,10750,9625, + 61,0,53,12,9,-812,9250,9625, + 62,97,0,12,12,-812,10750,9625, + 63,118,16,10,15,312,13437,9625, + 64,0,0,13,17,-1437,12437,9625, + 65,48,16,13,15,-1250,13187,9625, + 66,110,76,12,15,-500,13250,9625, + 67,48,93,11,16,-312,13375,9625, + 68,83,16,11,15,-437,13187,9625, + 69,72,16,11,15,-187,13250,9625, + 70,61,16,11,15,-62,13250,9625, + 71,48,77,11,16,-562,13375,9625, + 72,116,31,11,15,-437,13187,9625, + 73,118,46,10,15,-187,13250,9625, + 74,105,31,11,15,-687,13187,9625, + 75,86,107,12,15,-562,13187,9625, + 76,83,31,11,15,250,13250,9625, + 77,74,92,12,15,-812,13187,9625, + 78,72,31,11,15,-562,13187,9625, + 79,86,76,12,16,-812,13375,9625, + 80,107,46,11,15,-250,13187,9625, + 81,13,0,12,18,-812,13375,9625, + 82,99,61,12,15,-437,13187,9625, + 83,48,109,11,16,-500,13437,9625, + 84,111,61,12,15,-812,13187,9625, + 85,74,107,12,15,-687,13187,9625, + 86,86,92,12,15,-1062,13250,9625, + 87,74,61,13,15,-1500,13187,9625, + 88,61,61,13,15,-1312,13187,9625, + 89,48,31,13,15,-1437,13250,9625, + 90,109,109,12,15,-625,13250,9625, + 91,13,54,8,18,1812,13687,9625, + 92,109,92,11,17,-687,13250,9625, + 93,121,109,7,18,875,13687,9625, + 94,0,82,12,8,-1062,13250,9625, + 95,0,98,13,5,-1500,-812,9625, + 96,74,122,8,6,0,14312,9625, + 97,13,111,11,13,-750,10500,9625, + 98,37,34,11,16,-312,13687,9625, + 99,37,114,11,13,-187,10500,9625, + 100,48,61,11,16,-812,13687,9625, + 101,106,16,12,13,-812,10500,9625, + 102,37,50,11,16,-125,13687,9625, + 103,37,66,11,16,-750,10500,9625, + 104,37,82,11,16,-187,13687,9625, + 105,25,16,12,17,-375,14562,9625, + 106,61,94,9,20,-437,14562,9625, + 107,98,76,12,16,-125,13687,9625, + 108,25,65,11,16,-812,13687,9625, + 109,61,114,12,13,-875,10500,9625, + 110,13,98,11,13,-187,10500,9625, + 111,94,16,12,13,-750,10500,9625, + 112,25,33,11,16,-312,10500,9625, + 113,37,98,11,16,-812,10500,9625, + 114,0,29,10,13,750,10500,9625, + 115,13,72,11,13,-187,10500,9625, + 116,74,46,11,15,-625,12812,9625, + 117,13,85,11,13,-250,10250,9625, + 118,25,113,12,12,-875,10312,9625, + 119,60,0,13,12,-1500,10312,9625, + 120,109,0,12,12,-1125,10312,9625, + 121,74,76,12,16,-1062,10312,9625, + 122,0,17,11,12,-250,10312,9625, + 123,61,76,10,18,-187,13687,9625, + 124,0,62,5,20,2437,13750,9625, + 125,98,109,10,18,-125,13687,9625, + 126,86,122,12,6,-812,7875,9625, + 0 +}; + +/* Signed Distance Field: edges are at 127.5 */ +const unsigned char sdf_data[] = { + 0,0,0,0,0,19,31,32,26,8,0,0,0,0,0,0,0,21,32,32,22,2,0,0,0,0,0,0,0,13, + 28,32,31,21,4,0,0,0,0,0,0,0,13,27,32,28,18,0,0,0,0,9,22,31,32,28,17,0, + 0,0,0,27,32,32,24,0,0,0,3,31,32,32,15,0,0,0,0,17,32,32,30,0,0,0,0,0,0, + 0,0,0,0,0,0,0,22,26,0,0,23,25,3,0,0,0,0,0,0,0,0,0,19,32,32,32,25,0,29, + 32,32,32,13,0,27,32,32,32,15,0,0,0,0,24,56,81,93,96,87,67,33,0,0,0,0, + 18,54,82,95,96,83,59,23,0,0,0,0,0,40,72,91,96,93,83,60,8,0,0,0,0,9,45, + 73,90,96,92,79,58,13,0,43,70,84,92,96,92,78,52,15,0,27,82,96,96,76,19, + 0,0,44,92,96,96,60,0,0,0,4,63,96,96,90,38,0,0,0,0,0,0,0,0,0,10,34,58, + 81,86,36,25,80,85,62,38,15,0,0,0,0,0,0,8,67,96,96,96,80,37,88,96,96,96, + 56,27,82,96,96,96,60,0,0,0,29,74,111,142,159,163,151,122,80,31,0,0,11, + 63,108,143,159,160,145,111,68,18,0,0,0,35,85,131,154,163,159,147,84,20, + 0,0,0,5,54,97,133,154,163,158,142,96,32,8,72,135,149,159,163,157,139, + 105,60,9,29,91,155,158,92,30,12,12,57,120,163,131,65,0,0,0,8,72,139,163, + 108,44,0,0,0,0,0,0,0,23,47,69,93,116,142,108,44,32,96,145,120,97,74,51, + 28,4,0,0,0,8,67,119,163,163,113,67,122,163,163,110,56,32,96,163,163,135, + 68,0,0,15,68,119,164,154,131,124,144,173,119,63,4,0,44,99,153,198,168, + 165,193,160,106,51,0,0,0,61,120,178,167,143,147,151,84,20,0,0,0,38,93, + 147,188,164,151,156,163,96,32,8,72,139,169,159,155,168,195,153,95,38, + 17,80,144,167,102,70,76,76,67,131,180,116,53,0,4,8,8,72,139,175,108,44, + 8,8,0,0,12,36,58,82,106,131,154,177,170,108,44,32,96,163,182,158,135, + 110,86,63,40,17,0,0,30,82,136,187,145,97,156,179,124,73,21,32,96,163, + 199,135,68,0,0,45,102,159,147,99,68,76,90,145,147,83,22,7,67,131,188, + 156,108,102,150,194,135,74,13,0,4,68,135,199,135,79,82,104,81,19,0,0, + 3,63,122,182,153,105,85,92,115,96,32,8,72,124,106,92,88,111,165,179,115, + 52,6,68,135,176,112,108,143,143,80,142,168,104,42,17,63,72,72,72,139, + 175,108,72,72,72,43,21,70,95,119,143,167,176,154,133,110,86,36,25,80, + 106,131,151,172,170,147,122,99,76,31,0,0,45,97,151,176,131,186,142,88, + 37,0,32,96,151,151,135,68,0,8,68,131,169,110,85,122,143,135,131,159,92, + 28,20,83,147,196,135,70,63,124,188,154,91,28,0,0,62,122,185,151,93,39, + 45,37,0,0,0,19,81,144,183,120,79,84,77,58,56,13,0,43,64,47,56,57,91,155, + 179,115,52,0,58,120,184,120,120,185,158,93,151,158,93,31,32,96,139,139, + 139,144,177,139,139,139,131,64,32,96,156,179,160,139,115,93,70,49,28, + 0,0,24,45,67,88,110,135,156,177,160,108,44,0,0,9,60,113,167,191,159,104, + 52,0,0,22,73,84,84,84,53,0,22,84,148,147,85,131,178,147,147,160,159,92, + 28,28,92,158,187,120,58,50,112,179,164,100,36,0,6,51,97,154,182,124,73, + 20,28,28,25,0,28,92,156,171,111,143,151,140,111,68,18,0,0,28,91,120,120, + 139,179,150,93,36,0,46,108,173,135,135,142,168,107,160,147,82,19,32,96, + 163,175,175,177,195,175,175,175,131,64,32,96,163,169,136,113,92,70,49, + 28,7,0,0,2,24,45,67,88,110,133,159,175,108,44,0,0,0,47,99,153,202,144, + 91,39,0,0,13,56,64,64,64,40,0,30,92,159,135,93,157,144,88,85,140,159, + 92,28,32,96,163,183,116,52,44,108,175,171,104,40,0,43,94,144,182,177, + 163,108,65,92,92,84,33,32,96,163,177,159,165,167,194,160,104,47,0,0,28, + 92,159,187,168,124,97,57,7,0,35,97,163,143,149,124,154,120,171,135,71, + 8,30,90,108,108,108,139,175,108,108,108,108,61,28,85,116,140,164,176, + 154,133,108,87,65,25,15,60,83,104,124,149,170,169,145,120,94,39,0,0,31, + 83,136,188,152,181,131,76,22,0,32,96,131,131,131,68,0,32,96,163,131,100, + 167,131,64,60,124,159,92,28,32,96,163,183,116,52,44,108,175,171,104,40, + 14,73,133,186,136,136,190,144,88,139,159,104,40,32,96,163,206,149,102, + 104,151,192,131,67,0,0,28,92,139,139,152,178,144,95,40,0,24,87,151,152, + 163,112,139,135,180,122,60,0,0,38,44,44,72,139,175,108,44,44,44,22,0, + 33,57,79,103,131,152,176,170,149,108,44,32,96,145,167,179,156,133,108, + 85,62,38,4,0,16,68,119,174,156,110,167,165,111,59,7,32,96,163,195,135, + 68,0,32,95,159,135,96,162,139,78,74,135,159,92,28,28,92,159,187,120,57, + 49,112,179,167,100,36,29,92,156,168,104,99,154,179,122,142,165,100,37, + 29,92,159,191,124,63,66,131,192,143,76,0,4,13,61,72,72,94,147,185,124, + 62,0,13,75,139,193,160,97,124,184,175,111,48,0,0,0,0,8,72,139,175,108, + 44,0,0,0,0,0,0,21,44,67,91,115,139,163,108,44,32,96,163,144,119,95,72, + 49,25,2,0,0,0,52,105,159,179,122,78,135,190,150,95,43,32,96,163,183,135, + 68,0,24,87,151,143,81,140,170,131,131,167,159,92,28,21,83,147,194,133, + 69,62,124,187,155,91,29,32,96,163,168,104,65,116,172,160,158,149,87,26, + 24,87,151,191,124,60,63,124,191,143,76,17,63,63,40,28,25,68,135,199,135, + 68,0,2,64,124,147,147,83,110,147,147,100,37,0,0,0,0,8,72,135,135,108, + 44,0,0,0,0,0,0,0,0,8,32,56,78,102,104,43,31,93,106,83,59,36,13,0,0,0, + 0,0,27,88,144,147,147,92,45,101,147,147,133,77,31,93,116,116,116,67,0, + 11,72,135,163,102,99,142,163,154,131,151,92,28,8,68,131,189,154,102,99, + 147,197,139,76,15,27,90,153,188,136,91,83,139,194,173,119,63,6,11,73, + 135,196,139,85,86,142,192,131,68,32,96,122,102,92,88,105,153,190,131, + 64,0,0,45,80,80,80,57,74,80,80,70,21,0,0,0,0,0,46,68,68,65,25,0,0,0,0, + 0,0,0,0,0,0,0,19,43,49,15,6,45,47,24,0,0,0,0,0,0,0,0,17,68,80,80,80,57, + 15,65,80,80,80,60,6,45,52,52,52,31,0,0,51,108,165,140,91,83,96,91,84, + 84,71,19,0,45,101,156,195,163,162,190,164,110,53,0,10,68,122,175,181, + 152,147,167,183,177,122,69,15,0,53,110,167,178,145,147,178,164,108,49, + 32,96,163,167,157,155,165,195,161,106,48,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,21,76,124,173,144,115,101,104, + 122,120,63,6,0,14,65,111,147,163,164,179,116,72,26,0,0,34,82,122,153, + 167,163,147,122,155,155,102,45,0,24,74,119,154,168,168,153,119,73,21, + 32,96,139,155,163,167,160,144,111,68,18,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,35,82,122,154,176,167,168,172, + 145,88,24,0,0,20,59,86,99,113,164,164,116,67,6,0,0,34,67,91,100,98,85, + 83,88,88,85,38,0,0,29,67,91,104,104,92,65,29,0,13,56,77,91,98,100,96, + 82,58,23,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,32,67,95,112,120,120,108,86,56,8,0,0,0,3,25,36,71,119,144, + 102,61,3,0,0,0,10,29,36,36,24,22,24,24,23,0,0,0,0,10,30,40,40,31,10,0, + 0,0,0,15,28,36,36,32,21,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,34,49,56,56,47,28,1,0,0,0,0,0,0, + 0,30,79,91,52,14,0,0,0,0,0,30,32,32,28,0,0,0,0,0,0,0,0,27,32,28,0,0,0, + 0,0,0,0,0,24,32,32,32,25,0,0,0,0,0,27,32,32,32,32,32,32,32,31,3,0,27, + 32,32,32,32,32,32,32,31,3,0,27,32,32,32,30,21,5,0,0,0,0,0,0,1,21,32,32, + 22,1,0,0,0,0,0,0,0,21,32,32,25,8,0,0,0,0,0,4,22,32,32,24,6,0,0,0,22,32, + 32,32,32,32,32,32,29,0,0,0,0,0,0,0,0,0,0,28,33,2,0,0,0,0,0,38,90,96,96, + 85,30,0,0,0,0,0,0,27,82,96,85,30,0,0,0,0,0,0,19,76,96,96,96,80,23,0,0, + 0,27,82,96,96,96,96,96,96,96,92,42,27,82,96,96,96,96,96,96,96,92,42,27, + 82,96,96,96,92,83,65,37,0,0,0,0,22,58,83,95,96,83,58,23,0,0,0,0,21,56, + 82,95,96,87,65,33,0,0,0,37,63,83,95,96,86,63,29,0,15,73,96,96,96,96,96, + 96,96,88,34,0,0,0,0,0,15,32,32,29,0,0,0,0,0,0,0,0,44,108,163,163,100, + 36,0,0,0,0,0,4,32,96,163,100,36,18,0,0,0,0,0,36,97,160,163,163,101,40, + 0,0,0,32,96,163,163,163,163,163,163,163,112,48,32,96,163,163,163,163, + 163,163,163,112,48,32,96,163,163,163,159,147,122,88,46,0,0,20,68,111, + 144,159,160,145,113,71,22,0,0,20,68,111,144,159,163,151,122,82,34,0,29, + 88,122,147,159,160,149,119,74,24,20,84,151,163,163,163,163,163,163,104, + 40,0,0,0,0,9,62,96,96,88,34,0,0,0,0,0,0,0,44,108,175,167,100,36,0,0,0, + 0,18,59,88,100,163,104,95,79,42,0,0,0,0,52,113,177,175,181,116,57,0,0, + 0,32,96,163,190,163,163,163,163,163,112,48,32,96,163,190,163,163,163, + 163,163,112,48,32,96,163,190,163,165,185,179,136,83,28,0,54,108,161,184, + 155,154,184,163,111,56,0,0,53,108,161,179,151,147,167,175,124,69,11,32, + 96,163,164,151,155,184,167,110,49,20,84,143,143,143,143,143,193,171,104, + 40,0,0,0,0,42,97,153,151,93,36,0,0,0,0,0,0,12,44,108,139,139,100,36,0, + 0,0,3,58,108,149,167,181,169,159,124,60,0,0,0,8,68,131,187,122,183,136, + 73,11,0,0,32,96,163,179,112,96,96,96,96,92,42,32,96,163,179,112,96,96, + 96,96,92,42,32,96,163,179,112,100,131,177,172,111,52,17,78,140,197,144, + 94,93,142,197,142,81,19,16,78,139,194,136,90,83,116,176,154,92,31,32, + 96,133,102,86,93,149,189,124,60,8,60,76,76,76,108,159,178,131,80,29,0, + 0,0,15,72,131,183,122,65,7,0,0,0,0,0,39,75,76,76,76,76,69,22,0,0,0,24, + 85,147,182,140,164,135,148,124,60,0,0,0,24,86,148,172,108,168,153,90, + 28,0,0,32,96,163,179,112,60,60,60,60,45,3,32,96,163,179,112,60,60,60, + 60,45,3,32,96,163,179,112,48,90,152,193,131,68,28,92,157,183,119,57,54, + 116,179,159,95,32,28,92,157,179,120,120,120,120,167,170,104,42,24,76, + 79,45,49,96,153,177,116,55,0,4,12,54,102,153,184,136,85,38,0,0,0,0,40, + 99,160,160,98,39,0,0,0,0,0,0,56,120,143,143,143,143,100,36,0,0,0,32,96, + 163,163,96,163,100,86,111,58,0,0,0,40,102,164,159,95,154,169,106,44,0, + 0,32,96,163,179,124,124,124,124,124,80,16,32,96,163,179,124,124,124,124, + 124,80,16,32,96,163,179,112,48,74,139,203,143,76,32,96,163,179,112,48, + 44,108,175,167,100,36,32,96,163,204,183,183,183,183,183,175,108,44,0, + 19,20,48,94,142,187,140,88,33,0,1,49,96,147,189,142,91,45,0,0,0,0,0,62, + 122,183,139,77,17,0,0,0,0,0,0,56,120,163,163,187,167,100,36,0,0,0,31, + 92,157,176,122,163,100,74,48,23,0,0,0,57,119,181,144,80,139,186,122,61, + 0,0,32,96,163,210,191,191,191,191,147,80,16,32,96,163,210,191,191,191, + 191,147,80,16,32,96,163,179,112,48,68,135,199,147,80,31,92,159,180,116, + 53,51,112,179,160,96,32,31,93,159,179,116,116,116,116,116,116,104,43, + 0,0,31,86,139,185,139,94,49,0,0,43,91,142,188,147,97,50,28,25,0,0,0,16, + 78,142,187,122,61,0,0,0,0,0,0,0,49,95,96,108,175,167,100,36,0,0,0,15, + 72,131,174,181,181,156,135,99,53,1,0,11,73,136,192,131,104,124,188,140, + 78,16,0,32,96,163,180,135,135,135,135,135,80,16,32,96,163,180,135,135, + 135,135,135,80,16,32,96,163,179,112,48,70,135,199,147,80,20,82,144,196, + 136,83,82,135,193,147,83,22,21,82,145,189,131,83,68,73,91,119,84,20,0, + 0,51,112,176,149,94,48,4,0,28,85,136,183,153,102,92,92,92,84,33,0,0,27, + 90,155,176,112,48,0,0,0,0,0,0,0,8,32,44,108,175,167,100,36,0,0,0,0,37, + 82,116,143,171,168,190,144,86,28,0,29,90,153,205,171,171,171,202,157, + 95,33,0,32,96,163,179,112,68,68,68,68,51,1,32,96,163,179,112,68,68,68, + 68,51,1,32,96,163,179,112,48,79,143,202,139,74,1,60,115,170,175,143,142, + 175,171,116,62,3,2,60,116,170,173,144,135,139,153,151,84,20,0,0,56,120, + 187,139,72,8,0,0,32,96,163,206,160,159,159,159,159,104,40,0,0,32,96,163, + 171,104,42,0,0,0,0,0,0,0,0,0,44,108,175,167,100,36,0,0,0,11,58,62,60, + 96,163,108,160,169,104,42,0,45,106,169,165,147,147,147,162,173,111,49, + 0,32,96,163,179,112,48,4,4,4,0,0,32,96,163,179,112,52,52,52,52,50,18, + 32,96,163,179,112,62,101,160,187,124,63,0,28,77,122,156,172,172,157,122, + 80,29,0,0,28,77,119,153,169,175,171,159,140,84,20,0,0,56,120,143,139, + 72,8,0,0,32,96,147,147,147,147,147,147,147,104,40,0,0,32,96,163,171,104, + 40,0,0,0,0,0,0,0,8,12,44,108,175,167,100,36,12,7,0,28,92,116,90,96,163, + 100,151,173,108,44,0,62,122,186,147,83,80,81,144,190,131,66,4,32,96,163, + 179,112,48,0,0,0,0,0,32,96,163,179,116,116,116,116,116,108,47,32,96,163, + 179,120,124,149,192,160,102,44,0,0,32,69,95,108,108,95,70,33,0,0,0,0, + 31,65,91,104,108,104,95,78,53,4,0,0,55,113,116,116,70,7,0,0,21,70,80, + 80,80,80,80,80,80,74,28,0,0,28,92,157,175,108,47,0,0,0,0,0,0,19,67,76, + 76,108,175,167,100,76,76,65,15,28,92,159,152,135,164,140,178,154,95,34, + 16,78,142,194,133,69,16,66,131,190,145,82,21,32,96,163,179,112,48,0,0, + 0,0,0,32,96,163,204,183,183,183,183,179,112,48,32,96,163,203,187,188, + 185,160,119,70,17,0,0,0,12,34,44,44,34,13,0,0,0,0,0,0,8,30,41,44,41,34, + 18,0,0,0,0,56,120,183,139,72,8,0,0,0,15,20,20,19,21,32,32,19,0,0,0,0, + 19,81,145,183,120,58,0,0,0,0,0,0,32,96,143,143,143,178,170,143,143,143, + 92,28,28,91,136,157,168,184,167,151,111,65,10,32,95,143,143,116,54,0, + 50,112,143,143,98,36,32,96,143,143,112,48,0,0,0,0,0,32,96,143,143,143, + 143,143,143,143,112,48,32,96,139,139,139,135,122,101,70,29,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,56,120,155,139,72,8,0,0,22, + 73,84,84,81,82,96,95,79,49,0,0,0,5,66,131,189,135,73,11,0,0,0,0,0,32, + 96,163,163,163,163,163,163,163,159,92,28,7,51,76,93,104,163,100,90,61, + 20,0,19,67,76,76,73,32,0,29,72,76,76,69,22,19,67,76,76,73,32,0,0,0,0, + 0,19,67,76,76,76,76,76,76,76,73,32,17,63,72,72,72,68,60,42,15,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,45,87,88,88,59,2,0,0, + 32,96,151,151,112,142,160,159,140,76,0,0,0,0,45,104,165,154,92,33,0,0, + 0,0,0,27,82,96,96,96,96,96,96,96,96,80,23,0,0,15,32,96,163,100,36,6,0, + 0,0,27,32,32,32,10,0,0,27,32,32,32,10,0,17,32,32,32,32,32,32,32,19,0, + 0,27,32,32,32,10,6,31,32,32,19,0,27,32,32,31,3,0,0,0,0,0,0,27,32,32,32, + 32,32,32,32,31,6,0,0,0,28,32,32,32,32,32,27,0,0,27,32,32,31,3,22,32,32, + 32,10,0,32,96,163,180,142,165,155,159,143,76,0,0,0,0,22,79,139,177,116, + 58,0,0,0,0,0,0,27,32,32,32,32,32,32,32,32,25,0,0,0,0,32,96,131,100,36, + 0,0,0,27,82,96,96,95,54,0,27,82,96,96,95,53,4,63,96,96,96,96,96,96,96, + 67,8,27,82,96,96,95,54,45,93,96,96,67,27,82,96,96,92,42,0,0,0,0,0,27, + 82,96,96,96,96,96,96,96,93,45,0,0,30,85,96,96,96,96,96,82,27,27,82,96, + 96,92,42,73,96,96,95,53,0,32,96,163,202,147,106,88,95,124,76,0,0,0,0, + 0,50,105,161,144,86,29,0,0,0,0,0,15,20,20,19,25,32,27,8,0,0,0,0,0,0,13, + 56,64,58,16,0,0,0,27,85,144,163,140,81,24,54,111,163,163,111,54,8,72, + 139,163,163,163,163,163,143,76,12,32,96,163,163,139,77,52,116,163,143, + 76,32,96,163,163,112,48,0,0,0,0,0,32,96,163,163,163,163,163,163,163,116, + 52,0,0,36,100,163,163,163,163,163,96,32,32,96,163,163,112,48,84,151,163, + 124,60,0,32,96,163,183,116,58,26,36,67,48,0,0,0,0,0,18,71,112,112,99, + 38,0,0,0,0,22,73,84,84,81,86,96,90,65,26,0,0,0,27,32,32,31,3,0,0,0,0, + 0,0,56,111,170,169,110,52,82,142,199,142,83,26,8,72,139,187,163,163,163, + 163,143,76,12,32,96,163,220,160,99,52,116,183,143,76,32,96,163,179,112, + 48,0,0,0,0,0,32,96,163,163,163,163,163,184,181,116,52,0,0,36,100,163, + 163,163,190,163,96,32,32,96,163,179,112,48,84,151,191,124,60,0,32,96, + 163,179,112,48,0,0,3,0,0,0,0,0,0,0,28,48,48,44,9,0,0,0,0,32,96,151,151, + 112,147,163,152,116,71,17,0,27,82,96,96,92,42,0,0,0,0,0,0,26,83,142,195, + 139,79,110,169,169,111,54,0,8,72,139,175,108,96,96,96,96,67,8,32,96,163, + 187,183,122,62,116,183,143,76,32,96,163,179,112,48,0,0,0,0,0,27,82,96, + 96,96,96,116,179,158,97,38,0,0,30,85,96,96,112,179,163,96,32,32,96,163, + 179,112,48,84,151,191,124,60,0,32,96,163,179,112,48,0,0,0,0,0,0,0,0,25, + 32,32,21,0,0,0,0,0,0,0,32,96,163,181,144,152,158,195,161,102,45,0,32, + 96,163,163,112,48,0,0,0,0,0,0,0,54,111,170,167,106,139,197,140,81,24, + 0,8,72,139,175,108,96,91,72,42,19,0,32,96,163,163,149,145,85,116,183, + 143,76,32,96,163,179,112,48,0,0,0,0,0,0,27,32,32,32,82,143,194,135,74, + 15,0,0,0,28,32,48,112,179,163,96,32,32,96,163,179,112,68,84,151,191,124, + 60,0,32,96,163,179,112,48,0,0,0,0,0,0,0,23,80,96,96,71,19,0,0,0,0,0,0, + 32,96,163,198,140,90,102,158,188,124,63,0,32,96,163,179,112,48,20,15, + 0,0,0,0,0,26,83,142,193,136,167,169,110,53,0,0,8,72,139,181,153,163,155, + 131,93,46,0,32,96,163,163,124,168,107,116,183,143,76,32,96,163,179,112, + 48,0,0,0,0,0,0,0,0,0,45,104,165,170,110,51,0,0,0,0,0,0,48,112,179,163, + 96,32,32,96,163,180,135,135,135,153,191,124,60,0,32,96,163,179,112,48, + 0,0,0,0,0,0,0,24,83,140,162,106,52,0,0,0,0,0,0,32,96,163,181,116,55,74, + 139,201,139,72,0,32,96,163,179,112,74,84,77,54,18,0,0,0,0,54,111,169, + 186,197,140,81,24,0,0,8,72,139,164,155,159,179,184,139,83,26,32,96,163, + 163,102,163,131,116,183,143,76,32,96,163,179,112,48,0,0,0,0,0,0,0,0,10, + 69,131,189,148,87,28,0,0,0,0,0,0,48,112,179,163,96,32,32,96,163,210,191, + 191,191,196,191,124,60,0,32,96,159,159,112,48,0,0,0,0,0,0,0,0,54,111, + 172,140,83,26,0,0,0,0,0,32,96,163,179,112,48,68,135,199,143,76,0,32,96, + 163,179,112,135,151,140,108,63,10,0,0,0,24,81,140,197,167,110,53,0,0, + 0,8,72,124,101,88,93,124,174,170,108,46,32,96,163,163,96,140,153,116, + 183,143,76,32,96,163,179,112,48,0,0,0,0,0,0,0,0,33,92,153,185,122,63, + 4,0,0,0,0,0,0,48,112,179,163,96,32,32,96,163,179,124,124,124,151,191, + 124,60,0,25,80,92,92,88,40,0,0,0,0,0,0,0,0,28,87,148,170,110,51,0,0,0, + 0,0,32,96,163,180,116,54,73,139,200,139,75,0,32,96,163,179,136,168,173, + 197,153,97,40,0,0,0,0,56,120,187,155,88,24,0,0,0,0,43,63,40,27,35,88, + 152,185,120,56,32,96,163,163,96,116,176,116,183,143,76,32,96,163,179, + 112,48,0,0,0,0,0,0,0,0,56,115,176,160,99,40,0,0,15,60,60,18,0,48,112, + 179,163,96,32,32,96,163,179,112,60,84,151,191,124,60,0,0,23,28,28,27, + 0,0,0,0,0,0,0,0,0,5,66,124,189,135,73,11,0,0,0,0,32,96,163,197,139,88, + 99,156,190,131,66,0,32,96,163,204,150,104,113,165,185,122,61,0,0,0,0, + 56,120,187,155,88,24,0,0,0,17,63,65,43,32,40,91,154,183,120,56,32,96, + 163,163,96,95,156,139,184,143,76,32,96,163,179,112,52,52,52,52,49,15, + 0,0,20,79,140,197,139,77,17,0,0,32,96,108,69,44,53,116,180,159,92,31, + 32,96,163,179,112,48,84,151,191,124,60,0,0,0,0,0,22,32,32,13,0,0,0,0, + 0,0,0,49,111,175,153,90,27,0,0,0,0,32,96,163,183,151,148,154,192,165, + 107,48,0,32,96,163,185,120,61,79,143,200,139,72,0,0,0,0,56,120,187,155, + 88,24,0,0,0,32,96,124,104,96,102,131,177,167,104,44,32,96,163,163,96, + 72,133,192,207,143,76,32,96,163,179,116,116,116,116,116,104,43,0,0,43, + 102,163,174,112,53,0,0,0,32,96,159,124,108,108,144,197,151,87,24,32,96, + 163,179,112,48,84,151,191,124,60,0,0,0,16,15,73,96,96,56,9,13,0,0,0,0, + 0,37,100,164,167,100,38,0,0,0,0,32,96,163,179,112,153,171,160,122,76, + 21,0,32,96,163,179,112,48,68,135,199,143,76,0,0,0,0,56,120,187,155,88, + 24,0,0,0,32,96,163,168,163,167,185,175,131,78,22,32,96,163,163,96,49, + 108,170,203,143,76,32,96,163,204,183,183,183,183,175,108,44,0,8,67,124, + 186,151,90,30,0,0,0,32,96,163,187,172,172,193,178,124,68,8,32,96,163, + 179,112,48,84,151,191,124,60,0,0,45,80,57,84,151,131,64,67,74,28,0,0, + 0,0,30,92,159,174,108,44,0,0,0,0,32,96,163,179,112,93,104,96,72,32,0, + 0,32,96,163,179,112,51,70,135,199,142,76,0,0,0,0,56,120,143,143,88,24, + 0,0,0,32,95,131,147,155,155,143,119,83,40,0,32,96,139,139,96,32,86,139, + 139,139,76,32,96,143,143,143,143,143,143,143,108,44,0,27,90,143,143,124, + 66,7,0,0,0,28,85,116,139,151,155,147,124,85,38,0,32,96,139,139,112,48, + 84,139,139,124,60,0,19,74,133,113,84,151,131,92,122,113,58,0,0,0,0,28, + 92,159,175,108,44,0,0,0,0,32,96,163,179,112,48,40,34,15,0,0,0,32,96,163, + 190,131,72,88,149,194,131,68,0,0,0,0,39,75,76,76,62,12,0,0,0,8,49,68, + 81,88,88,80,62,32,0,0,17,63,72,72,63,17,54,72,72,72,51,19,67,76,76,76, + 76,76,76,76,72,29,0,15,65,76,76,75,39,0,0,0,0,0,33,57,76,87,88,82,65, + 36,0,0,17,63,72,72,69,30,57,72,72,72,40,0,31,93,135,164,140,151,131,149, + 156,124,74,0,0,0,0,36,98,163,168,104,40,0,0,0,0,32,96,163,179,112,48, + 0,0,0,0,0,0,32,96,163,188,162,131,136,179,172,112,53,0,0,0,0,3,31,32, + 32,25,32,32,21,0,0,0,4,26,32,25,3,0,0,0,0,0,0,0,0,0,21,32,32,32,13,0, + 0,0,0,0,4,18,32,32,32,21,0,0,0,0,0,5,21,31,32,28,15,0,0,0,0,27,32,32, + 32,32,28,18,0,0,0,0,27,32,32,32,32,32,32,32,24,6,47,76,106,136,188,173, + 131,97,67,37,0,0,0,0,46,108,172,157,92,31,0,0,0,0,31,92,112,112,105,46, + 0,0,0,0,0,0,32,96,163,171,119,167,187,174,136,83,28,0,0,0,0,42,92,96, + 95,80,96,96,70,11,0,18,59,87,96,86,57,15,0,0,0,0,0,0,0,11,70,96,96,96, + 56,0,0,0,0,45,66,80,95,96,96,70,11,0,0,0,42,67,83,92,96,92,76,49,12,0, + 27,82,96,96,96,96,92,80,58,25,0,27,82,96,96,96,96,96,96,96,76,25,80,111, + 142,161,156,144,163,133,102,65,0,0,0,0,62,122,186,139,77,16,0,0,0,0,3, + 42,48,48,46,15,0,0,0,0,0,0,29,88,104,104,99,108,120,112,85,43,0,0,0,0, + 0,59,120,163,116,101,163,139,76,14,4,59,108,149,163,147,105,56,0,0,0, + 0,0,0,0,16,80,147,163,131,64,0,0,0,20,83,131,143,159,163,147,80,16,0, + 0,16,79,131,147,159,163,156,136,102,57,6,32,96,163,163,163,163,156,143, + 113,71,21,32,96,163,163,163,163,163,163,155,88,28,86,144,136,102,151, + 131,113,145,124,69,0,0,0,22,82,143,176,116,57,0,0,0,0,0,0,0,0,10,27,32, + 30,17,0,0,0,0,0,34,40,40,38,48,56,51,29,0,0,0,1,33,36,74,139,164,101, + 116,180,120,59,16,26,87,149,150,120,153,144,83,22,0,0,0,0,10,53,60,80, + 147,195,131,64,60,60,32,20,84,151,179,167,203,147,80,16,0,0,16,80,147, + 167,151,147,163,192,149,92,34,32,96,163,186,155,155,164,195,164,108,51, + 32,96,163,163,167,208,164,163,155,88,0,56,103,79,84,151,131,64,88,94, + 39,0,0,0,47,106,165,149,90,33,0,0,0,0,0,0,0,36,69,90,96,92,78,50,9,0, + 0,0,0,0,0,4,23,32,32,32,28,0,0,36,91,100,100,154,148,100,135,168,104, + 100,58,32,96,163,120,61,124,159,92,28,40,60,34,0,32,95,124,124,147,195, + 131,124,124,122,60,20,84,133,116,124,191,147,80,16,0,0,16,80,133,106, + 87,82,111,169,177,112,50,32,96,163,179,112,88,104,156,193,131,67,27,82, + 96,96,143,199,135,96,96,76,0,17,40,24,83,120,120,63,31,37,4,0,0,19,76, + 135,171,115,60,4,0,0,0,0,0,0,33,82,124,153,163,158,139,99,54,2,0,0,0, + 0,20,61,86,96,96,96,85,30,0,40,104,167,167,181,170,167,169,181,167,131, + 64,26,87,149,147,120,151,144,83,76,99,124,67,8,32,96,163,179,183,213, + 179,179,179,124,60,6,57,69,60,124,191,147,80,16,0,0,4,57,74,47,25,30, + 92,159,182,116,52,32,96,163,179,112,48,76,143,203,139,72,0,27,32,76,143, + 199,135,68,32,24,0,0,0,0,43,56,56,32,0,0,0,0,0,27,88,112,112,81,28,0, + 0,0,0,0,0,7,65,122,175,167,143,153,192,145,88,31,0,0,0,2,60,111,148,160, + 163,163,100,36,0,40,104,135,135,179,135,135,168,139,135,131,64,4,60,108, + 149,163,147,105,111,136,149,124,82,19,31,92,112,112,147,195,131,112,112, + 111,58,0,0,7,60,124,191,147,80,16,0,0,0,2,11,0,9,60,113,172,164,103,42, + 32,96,163,179,112,72,91,151,196,135,68,0,0,12,76,143,199,135,68,4,0,0, + 27,32,32,32,32,32,32,32,32,30,0,0,0,40,48,48,35,0,0,0,0,0,0,0,24,86,149, + 182,122,79,99,158,174,112,52,0,0,0,19,81,144,201,153,143,143,100,36,0, + 30,63,75,139,164,100,116,180,120,68,68,40,0,22,60,87,98,122,147,139,111, + 88,65,40,0,3,42,48,80,147,195,131,64,48,48,23,0,0,0,60,124,191,147,80, + 16,0,0,0,0,0,6,52,99,150,183,133,76,21,32,96,163,181,139,139,149,184, + 173,115,56,0,0,12,76,143,199,135,68,4,0,27,82,96,96,96,96,96,96,96,96, + 90,38,0,0,27,32,32,32,32,25,0,0,0,0,0,32,96,160,171,104,42,80,147,192, + 131,65,0,15,60,68,88,155,187,120,76,76,69,22,28,85,100,100,154,148,100, + 135,168,104,100,65,5,2,63,110,135,149,124,101,124,147,139,105,60,7,0, + 0,16,80,147,195,131,64,0,0,0,0,0,0,60,124,191,147,80,16,0,0,0,0,4,49, + 96,144,187,139,91,41,0,32,96,163,201,179,179,172,158,124,82,29,0,0,12, + 76,143,199,135,68,4,0,32,96,163,163,163,163,163,163,163,163,108,44,0, + 27,82,96,96,96,96,80,23,0,0,0,0,32,96,163,172,108,46,83,147,202,139,72, + 0,32,96,135,135,157,188,135,135,135,100,36,32,96,163,167,181,170,167, + 169,181,167,139,72,8,0,59,119,112,88,68,124,170,139,153,150,93,33,0,0, + 16,80,147,195,131,64,0,0,0,0,0,0,60,124,191,147,80,16,0,0,0,1,46,94,142, + 187,142,94,48,1,0,32,96,163,179,112,112,108,95,72,37,0,0,0,12,76,143, + 199,135,68,4,0,32,96,151,151,151,151,151,151,151,151,108,44,0,32,96,163, + 163,163,159,92,28,0,0,0,0,26,87,151,190,135,98,113,167,207,143,76,0,32, + 96,163,171,179,202,171,171,167,100,36,32,96,135,135,179,135,135,168,142, + 135,135,72,8,0,31,67,53,29,80,147,139,79,111,173,108,44,0,0,16,80,147, + 195,131,64,60,60,32,6,45,52,60,124,191,147,80,52,51,20,0,43,91,139,184, + 142,94,49,40,39,14,32,96,163,179,112,48,44,34,14,0,0,6,45,52,76,143,199, + 135,68,52,42,22,73,84,84,84,84,84,84,84,84,79,33,0,32,96,163,163,124, + 124,91,28,0,0,0,0,9,69,124,178,183,163,170,155,197,143,76,0,29,88,104, + 104,155,187,120,104,104,91,33,15,60,75,139,164,100,116,179,120,68,68, + 46,0,0,0,3,0,13,76,139,153,110,131,164,102,40,0,0,12,75,139,201,153,124, + 124,122,60,31,93,116,116,124,191,147,116,116,111,51,29,88,136,181,142, + 104,104,104,104,102,52,32,96,163,179,112,48,0,0,0,0,0,31,93,116,116,143, + 199,135,116,116,86,32,95,124,124,124,124,124,124,124,124,107,44,0,32, + 96,163,163,96,60,51,7,0,0,0,0,0,37,85,124,151,155,140,124,191,139,72, + 0,0,34,40,88,155,187,120,56,40,36,1,0,29,91,154,148,85,133,169,106,44, + 4,0,0,0,0,0,0,0,53,105,151,174,164,124,76,21,0,0,0,57,113,158,175,179, + 179,124,60,32,96,163,183,183,207,187,183,183,116,52,32,96,163,205,171, + 171,171,171,171,120,56,32,96,163,179,112,48,0,0,0,0,0,32,96,163,183,186, + 207,184,183,155,88,32,96,163,187,187,187,187,187,187,175,108,44,0,32, + 96,163,163,96,32,0,0,0,0,0,0,0,26,59,69,85,88,78,139,188,124,63,0,0,0, + 24,88,155,187,120,56,0,0,0,0,40,104,131,131,84,131,131,91,29,0,0,0,0, + 0,0,0,0,15,60,93,108,102,76,34,0,0,0,0,23,68,97,108,112,112,111,58,32, + 96,143,143,143,143,143,143,143,116,52,32,96,155,155,155,155,155,155,155, + 120,56,32,96,139,139,112,48,0,0,0,0,0,32,96,143,143,143,143,143,143,143, + 88,32,95,120,120,120,120,120,120,120,120,106,43,0,32,96,163,163,96,32, + 0,0,0,0,0,0,0,52,115,102,83,84,113,165,167,106,45,0,0,0,24,88,155,187, + 120,56,0,0,0,0,19,59,64,64,50,64,64,52,6,0,0,0,0,0,0,0,0,0,8,34,44,40, + 21,0,0,0,0,0,0,13,36,45,48,48,48,23,19,67,76,76,76,76,76,76,76,74,36, + 24,76,88,88,88,88,88,88,88,87,45,17,63,72,72,69,30,0,0,0,0,0,19,67,76, + 76,76,76,76,76,76,62,8,49,56,56,56,56,56,56,56,56,53,17,0,32,96,163,163, + 96,32,0,0,0,0,0,0,0,52,116,163,147,148,169,181,133,79,22,0,0,0,24,88, + 155,187,120,56,0,0,0,0,0,0,0,0,0,15,32,32,32,19,0,0,0,24,32,32,32,10, + 0,3,31,32,32,28,0,0,27,32,32,25,0,0,0,8,32,32,32,15,0,0,0,0,0,17,32,32, + 32,21,0,0,0,27,32,32,32,32,29,19,1,0,0,0,0,27,32,32,32,32,32,32,32,32, + 30,0,0,0,0,0,0,0,27,32,32,19,0,0,0,0,0,0,0,0,32,96,163,163,96,32,0,0, + 0,0,0,0,0,52,116,153,164,165,153,124,88,42,0,0,0,0,24,88,155,187,120, + 56,0,0,0,0,0,0,0,0,0,60,96,96,96,67,0,0,19,76,96,96,95,54,0,44,92,96, + 96,85,30,27,82,96,96,80,23,0,0,51,95,96,96,60,0,0,0,0,9,63,96,96,96,70, + 11,0,27,82,96,96,96,96,92,82,60,26,0,0,27,82,96,96,96,96,96,96,96,96, + 90,38,0,0,0,0,0,27,82,96,96,67,0,0,0,0,0,0,0,0,32,96,163,163,96,32,0, + 0,0,0,0,0,0,33,70,90,100,100,91,69,39,0,0,0,0,0,24,88,155,171,120,56, + 0,0,0,0,0,0,0,0,4,68,135,163,143,76,0,0,19,78,135,163,144,86,31,76,133, + 163,145,88,30,30,92,159,163,96,34,0,0,60,124,163,131,67,0,0,0,0,43,97, + 153,163,147,80,16,0,32,96,163,163,163,163,159,144,115,71,20,0,32,96,163, + 163,163,163,163,163,163,163,108,44,0,0,0,0,0,32,96,163,143,76,0,0,0,0, + 0,0,0,0,32,96,163,163,96,32,0,0,0,0,0,0,0,0,10,27,36,36,28,11,0,0,0,0, + 0,0,21,81,104,104,102,52,0,0,0,0,0,0,4,19,20,68,135,199,143,76,0,0,0, + 45,101,158,175,119,63,108,165,169,111,57,2,22,84,151,168,104,40,32,32, + 66,131,187,120,59,0,0,0,24,78,133,186,211,147,80,16,0,32,96,163,186,155, + 155,164,198,163,106,47,0,32,96,159,159,159,179,185,159,159,159,108,44, + 0,0,0,0,0,32,96,163,143,76,0,0,0,0,0,0,0,0,32,96,163,163,96,32,0,0,0, + 0,0,0,0,27,32,32,32,32,32,15,0,0,0,0,0,0,0,31,40,40,39,14,0,0,0,0,0,30, + 63,81,84,68,135,199,143,76,0,0,0,14,69,124,181,151,94,142,192,136,80, + 25,0,15,77,143,175,108,88,96,96,72,135,179,115,52,0,0,5,59,111,167,136, + 188,147,80,16,0,32,96,163,179,112,88,105,162,188,124,61,0,25,80,92,92, + 100,167,175,108,92,92,86,36,0,0,0,0,0,32,96,163,143,76,0,0,0,0,0,0,0, + 0,32,96,163,163,96,32,0,0,0,0,0,0,27,82,96,96,96,96,96,60,0,0,0,0,0,0, + 0,13,30,32,22,16,16,16,6,0,28,77,119,145,149,124,135,199,143,76,0,0,0, + 0,37,92,149,183,124,172,160,102,49,0,0,7,69,135,181,116,112,163,151,86, + 143,172,108,44,0,0,39,93,147,154,120,187,147,80,16,0,32,96,163,179,112, + 48,84,151,195,131,64,0,0,23,28,36,100,167,175,108,44,28,26,0,0,0,0,0, + 0,32,96,163,143,76,0,0,0,0,0,0,0,0,32,96,163,163,96,44,36,0,0,0,0,0,32, + 96,163,163,163,163,135,68,4,0,0,0,0,0,37,72,92,96,81,80,80,80,60,0,58, + 115,170,193,168,173,135,199,143,76,0,0,0,0,5,60,115,172,183,184,131,72, + 17,0,0,0,62,124,187,120,124,187,163,99,147,165,100,36,0,19,73,131,174, + 119,120,187,147,80,16,0,32,96,163,179,112,88,106,162,179,119,57,0,0,0, + 0,36,100,167,175,108,44,0,0,0,0,0,0,0,0,32,96,163,143,76,0,0,0,0,0,0, + 0,0,32,96,163,163,108,108,86,26,0,0,0,0,32,96,143,143,150,199,135,68, + 4,0,0,0,0,31,82,124,156,162,140,131,147,147,80,18,80,143,202,149,104, + 115,167,207,143,76,0,0,0,0,0,28,83,140,200,153,95,40,0,0,0,0,54,116,183, + 131,136,147,173,112,151,159,92,30,0,54,108,163,140,84,120,187,147,80, + 16,0,32,96,163,186,155,155,164,165,139,91,35,0,0,0,0,36,100,167,175,108, + 44,0,0,0,0,0,0,0,0,32,96,163,143,76,0,0,0,0,0,0,0,0,32,96,163,179,175, + 159,92,28,0,0,0,0,19,67,76,76,143,199,135,68,4,0,0,0,3,62,119,173,181, + 152,158,144,197,147,80,28,92,157,184,120,61,79,143,204,143,76,0,0,0,0, + 0,45,101,158,213,170,113,58,2,0,0,0,47,108,175,135,147,135,160,124,155, + 151,85,23,29,88,144,159,104,84,120,187,147,84,76,26,32,96,163,190,163, + 168,188,144,96,46,1,0,0,0,0,36,100,167,175,108,44,0,0,0,0,0,0,0,0,32, + 96,163,143,76,0,0,0,0,0,0,0,0,31,92,112,112,112,112,88,27,0,0,0,0,0,8, + 12,76,143,199,135,68,4,0,0,0,20,83,145,198,140,91,102,156,211,147,80, + 32,96,163,179,112,48,68,135,199,143,76,0,0,0,0,22,78,135,190,152,187, + 145,88,33,0,0,0,39,101,167,143,159,120,147,140,160,143,79,16,32,96,163, + 154,151,151,151,192,159,151,100,36,32,96,163,179,112,108,158,185,131, + 70,13,0,0,0,0,36,100,167,175,108,44,0,0,0,0,0,0,0,0,32,96,163,143,76, + 0,0,0,0,0,0,0,0,3,42,48,48,48,48,40,0,0,0,0,0,0,0,12,76,143,199,135,68, + 4,0,0,0,31,92,159,181,116,55,72,135,199,147,80,32,96,160,179,112,51,70, + 135,199,143,76,0,0,0,0,54,110,167,167,110,156,177,120,65,10,0,0,31,93, + 159,148,171,107,133,154,169,135,72,8,32,96,163,171,171,171,171,202,176, + 167,100,36,32,96,163,179,112,68,124,183,158,99,42,0,0,0,0,36,100,167, + 175,108,44,0,0,0,0,0,0,0,0,32,96,163,143,76,0,0,0,0,0,0,0,0,0,0,0,18, + 30,32,30,20,5,0,0,0,0,0,12,76,143,199,135,68,4,0,0,0,32,96,163,179,112, + 48,64,131,195,147,80,25,88,152,190,131,72,90,149,207,143,76,0,0,0,31, + 86,144,190,135,78,122,179,154,97,42,0,0,23,86,151,198,159,95,116,182, + 191,131,64,0,29,88,104,104,104,104,120,187,147,104,91,33,32,96,163,179, + 112,48,97,156,186,131,70,13,0,0,0,36,100,167,175,108,44,0,0,0,0,0,0,0, + 0,32,96,163,143,76,0,0,0,0,0,0,0,0,0,12,51,78,92,96,92,83,66,29,0,0,0, + 0,12,76,143,199,135,68,4,0,0,0,30,92,159,183,119,58,74,139,200,147,80, + 11,72,133,190,164,131,136,160,206,143,76,0,0,8,63,119,175,158,101,45, + 90,147,186,131,74,19,0,16,79,143,203,145,81,104,168,185,120,56,0,0,34, + 40,40,40,56,120,187,147,80,36,1,32,96,163,179,112,48,69,124,186,158,99, + 42,0,0,0,36,100,167,175,108,44,0,0,0,0,0,0,0,0,32,96,163,143,76,0,0,0, + 0,0,0,0,0,1,56,102,139,158,163,159,147,116,52,0,0,0,0,12,76,143,199,135, + 68,4,0,0,0,19,81,143,201,145,97,108,160,211,147,80,0,45,99,150,181,183, + 153,135,171,143,76,0,0,28,91,139,139,124,70,15,59,113,139,139,103,40, + 0,8,71,135,139,133,68,91,139,139,112,49,0,0,0,0,0,0,56,120,143,143,80, + 16,0,32,96,139,139,112,48,42,99,139,139,131,67,0,0,0,36,100,139,139,108, + 44,0,0,0,0,0,0,0,0,32,96,163,143,76,0,0,0,0,0,0,0,0,24,85,145,192,151, + 139,143,160,116,52,0,0,0,0,12,76,143,199,135,68,4,4,0,0,0,58,115,167, + 187,160,165,140,196,147,80,0,11,57,95,116,119,99,104,104,104,70,0,0,13, + 61,72,72,71,37,0,27,68,72,72,67,24,0,0,46,72,72,72,43,59,72,72,69,30, + 0,0,0,0,0,0,39,75,76,76,57,4,0,17,63,72,72,69,30,13,61,72,72,72,46,0, + 0,0,20,65,72,72,68,27,0,0,0,0,0,0,0,0,32,96,163,143,76,0,0,0,0,0,0,0, + 0,32,96,163,171,104,72,79,99,115,52,0,0,0,0,11,73,139,201,139,78,68,68, + 53,0,0,26,74,116,145,151,133,131,195,147,80,0,0,8,38,54,56,42,40,40,40, + 26,0,0,0,0,0,0,0,18,29,32,32,22,0,0,0,0,25,32,32,32,8,0,19,32,32,32,19, + 0,0,0,0,21,32,32,22,2,0,0,0,0,27,32,32,31,3,0,0,0,0,0,0,0,27,32,32,32, + 32,32,23,5,0,0,0,0,27,32,32,27,0,32,96,163,143,76,0,0,0,0,0,0,0,0,28, + 91,154,192,153,131,112,93,63,26,0,0,0,0,1,63,124,184,170,139,135,135, + 84,0,0,34,93,97,80,84,83,140,201,139,74,0,0,0,0,10,27,32,31,19,0,0,0, + 0,0,0,0,9,52,79,92,96,96,73,0,0,0,23,80,96,96,95,51,8,67,96,96,96,67, + 0,0,18,54,82,95,96,83,59,23,0,0,27,82,96,96,92,42,0,0,0,0,0,0,27,82,96, + 96,96,96,95,85,65,32,0,0,27,82,96,96,82,27,32,96,163,143,76,0,0,0,0,0, + 0,0,0,10,67,116,156,178,190,176,153,111,61,4,0,0,0,0,40,94,142,165,171, + 171,151,84,0,0,36,100,157,139,135,142,175,177,120,59,0,0,3,41,70,88,96, + 93,81,58,23,0,0,0,0,0,42,97,140,158,163,151,84,0,0,0,25,85,145,163,135, + 72,28,88,151,163,131,69,0,11,63,108,143,159,160,145,111,68,18,0,32,96, + 163,163,112,48,0,0,0,0,0,0,32,96,163,163,163,163,159,148,120,80,29,0, + 32,96,163,163,96,32,32,96,163,143,76,0,0,0,0,0,0,0,0,0,42,68,95,115,131, + 153,195,148,86,23,0,0,0,0,6,51,83,100,104,104,104,78,0,0,36,100,160,172, + 179,175,163,133,88,35,0,0,49,93,131,152,163,159,143,113,58,0,0,0,0,0, + 62,124,186,156,124,124,83,0,0,0,2,62,120,182,156,93,48,108,170,168,106, + 47,0,44,99,153,198,168,165,193,160,106,51,0,32,96,163,179,112,48,4,8, + 8,8,0,0,32,96,163,181,151,151,155,184,172,116,57,0,32,96,163,163,96,32, + 27,82,96,96,67,0,0,0,0,0,0,0,0,23,86,106,81,65,68,108,175,159,92,28,0, + 0,0,0,0,0,24,38,40,40,40,29,0,0,26,76,96,108,112,111,100,78,43,0,0,35, + 88,142,184,183,164,164,181,124,60,0,0,0,0,4,68,135,196,135,68,60,47,0, + 0,0,0,38,98,160,176,115,68,131,190,145,85,24,7,67,131,188,156,108,102, + 150,194,135,74,13,32,96,163,179,112,48,63,72,72,72,54,3,32,96,163,175, + 108,84,92,145,198,135,69,7,32,96,163,163,96,32,0,27,32,32,19,0,0,0,0, + 0,0,0,0,24,88,155,143,131,124,144,190,147,85,23,0,0,0,0,9,26,32,30,18, + 0,0,0,0,0,0,19,34,44,48,48,38,20,0,0,2,61,120,177,173,124,100,100,122, + 124,60,0,0,0,0,4,68,135,195,131,64,0,0,0,0,0,0,15,74,136,195,136,88,151, + 183,120,62,2,20,83,147,196,135,70,63,124,188,154,91,28,32,96,163,179, + 112,63,110,139,139,133,79,16,32,96,163,175,108,60,75,139,196,135,68,6, + 32,96,163,163,96,32,0,0,0,0,17,32,32,31,6,0,0,0,0,24,88,145,162,171,175, + 168,151,111,60,4,0,0,0,34,67,87,96,92,79,52,15,0,0,0,27,32,32,31,3,0, + 0,0,0,0,18,80,143,203,143,83,38,38,71,107,57,0,0,0,0,4,68,135,195,131, + 64,0,0,0,0,0,0,0,52,111,172,158,108,170,160,99,39,0,28,92,158,187,120, + 58,50,112,179,164,100,36,32,96,163,179,112,105,156,178,133,85,43,0,32, + 96,163,175,124,124,131,164,162,111,54,0,32,96,163,163,96,32,0,0,0,14, + 63,96,96,93,48,0,0,0,0,10,60,83,97,104,108,104,90,61,20,0,0,0,32,82,122, + 151,163,159,140,104,58,6,0,27,82,96,96,92,42,0,0,0,0,0,28,91,155,188, + 124,62,56,56,56,56,45,0,0,6,45,52,77,139,192,131,64,0,0,0,0,0,0,0,29, + 88,149,179,131,190,139,77,18,0,32,96,163,183,116,52,44,108,175,171,104, + 40,32,96,163,179,112,150,178,133,85,40,0,0,32,96,163,204,187,187,189, + 131,113,81,37,0,32,95,159,159,95,32,0,0,3,52,102,156,163,139,88,37,0, + 0,0,0,4,21,35,43,44,40,29,6,0,0,0,3,63,120,174,173,151,158,192,149,92, + 32,0,32,96,163,163,112,48,0,0,0,0,0,32,96,163,183,116,75,120,120,120, + 120,87,0,0,31,93,116,124,165,167,113,53,0,0,0,0,0,0,0,5,65,124,185,187, + 176,115,54,0,0,32,96,163,183,116,52,44,108,175,171,104,40,32,96,163,182, + 147,192,133,85,40,0,0,0,32,96,163,175,120,120,124,153,172,124,70,11,24, + 88,155,155,88,25,0,0,42,92,144,187,164,178,124,77,26,0,0,0,27,32,32,31, + 3,31,32,32,27,0,0,16,79,143,186,124,87,101,156,174,108,47,0,32,96,163, + 179,112,48,20,14,0,0,0,32,96,163,183,116,76,143,187,187,155,88,0,0,32, + 96,163,177,157,120,85,33,0,0,0,0,0,0,0,0,42,101,162,213,153,92,33,0,0, + 28,92,159,187,120,57,49,112,179,167,100,36,32,96,163,221,179,176,156, + 101,47,0,0,0,32,96,163,175,108,56,63,119,182,154,91,28,19,82,147,148, + 84,20,0,31,81,133,183,142,108,156,167,116,66,15,0,27,82,96,96,92,42,92, + 96,96,82,27,0,16,80,147,179,112,50,81,147,177,112,48,0,32,96,163,179, + 112,76,84,76,50,9,0,28,92,156,188,124,76,131,131,168,155,88,0,0,29,88, + 104,115,159,176,116,56,0,0,0,0,0,0,0,8,19,78,139,190,131,69,10,0,0,21, + 83,147,194,133,69,62,124,187,155,91,29,32,96,163,182,131,139,190,136, + 81,28,0,0,32,96,163,175,108,44,51,113,179,163,96,32,15,65,88,88,65,15, + 17,70,119,172,139,94,63,108,153,156,105,54,0,32,96,163,163,112,48,112, + 163,163,96,32,0,7,67,124,178,139,106,116,165,156,97,37,0,32,96,163,179, + 112,139,151,139,99,50,0,19,81,144,202,142,81,64,100,167,155,88,0,0,0, + 34,40,73,139,193,131,64,0,0,0,0,0,0,40,72,72,102,162,169,107,48,0,0,0, + 8,68,131,189,154,102,99,147,196,139,76,14,32,96,163,179,112,105,162,171, + 115,61,8,0,32,96,163,175,108,104,108,139,193,154,91,28,32,96,135,135, + 96,32,27,90,116,116,91,48,18,60,105,116,116,74,0,32,96,163,179,112,48, + 112,179,163,96,32,0,0,38,85,124,167,171,177,144,110,65,12,0,32,96,163, + 179,139,163,176,192,139,77,16,3,62,120,179,171,122,95,100,167,155,88, + 0,0,0,0,4,68,135,195,131,64,0,0,0,0,0,0,60,124,139,151,192,142,83,25, + 0,0,0,0,45,102,156,195,163,162,190,162,108,53,0,32,96,163,179,112,73, + 131,185,151,95,42,0,32,96,163,192,171,171,173,192,171,124,70,11,32,96, + 163,163,96,32,2,44,52,52,42,1,0,15,49,52,52,36,0,32,96,163,179,112,48, + 112,179,163,96,32,0,6,62,113,159,164,143,149,176,142,92,38,0,32,96,163, + 193,136,96,131,188,156,92,28,0,37,91,144,187,177,159,163,189,155,88,0, + 0,0,0,4,68,135,195,131,64,12,4,0,0,0,0,60,124,167,167,149,105,53,0,0, + 0,0,0,14,66,111,147,163,164,149,115,71,20,0,32,96,163,171,112,48,96,153, + 171,131,76,20,32,96,143,143,143,143,142,133,113,80,36,0,32,96,139,139, + 96,32,0,27,32,32,25,27,32,32,25,0,0,0,0,32,96,163,179,112,48,112,179, + 163,96,32,0,26,87,149,173,115,78,90,140,182,120,61,0,32,96,163,179,113, + 52,112,179,163,96,32,0,2,51,96,135,157,167,163,145,113,74,0,0,0,0,4,68, + 135,196,135,80,76,60,0,0,0,0,54,99,100,100,90,58,15,0,0,0,0,0,0,20,59, + 86,99,100,88,63,26,0,0,29,88,104,104,99,44,65,104,104,104,84,25,19,67, + 76,76,76,76,76,68,53,28,0,0,17,63,72,72,63,17,27,82,96,96,80,82,96,96, + 80,23,0,0,0,32,96,163,179,112,48,112,179,163,96,32,0,32,96,163,163,96, + 32,60,124,191,135,68,0,32,96,163,179,112,48,112,179,163,96,32,0,0,6,45, + 74,93,100,96,83,58,25,0,0,0,0,0,59,120,179,167,143,143,84,0,0,0,0,14, + 36,36,36,29,4,0,0,0,0,0,0,0,0,3,25,36,36,27,6,0,0,0,0,34,40,40,38,9,21, + 40,40,40,33,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32,96,163,159,92,96, + 163,159,92,28,0,0,0,32,96,163,179,112,52,115,179,163,96,32,0,30,92,157, + 173,115,78,90,142,192,131,65,0,32,96,163,179,112,48,112,179,163,96,32, + 0,0,0,0,15,31,36,34,23,1,0,0,0,0,0,0,35,88,124,143,147,147,84,0,0,0,0, + 27,32,32,32,19,13,32,32,32,31,3,0,27,32,32,31,3,0,15,32,32,32,19,0,0, + 0,0,0,0,0,24,32,32,22,0,25,32,32,21,0,0,0,0,0,0,0,8,32,32,32,30,0,0,32, + 96,163,159,92,96,163,159,92,28,0,0,0,31,93,159,185,122,88,135,192,163, + 96,32,0,15,76,135,187,164,143,149,181,164,108,49,0,32,96,163,179,112, + 48,112,179,163,96,32,0,0,0,0,10,27,32,32,21,2,0,0,0,0,0,0,0,39,65,76, + 80,80,63,0,0,0,27,82,96,96,96,68,56,96,96,96,92,42,27,82,96,96,92,42, + 2,60,96,96,96,67,0,0,0,0,0,0,20,76,96,96,73,23,80,96,96,70,13,0,0,0,0, + 0,0,49,95,96,96,90,38,0,32,96,163,159,92,96,163,159,92,28,0,0,0,20,82, + 143,198,169,155,140,179,163,96,32,0,0,45,94,136,160,171,167,152,119,74, + 22,0,32,96,163,179,112,48,112,179,163,96,32,0,0,4,42,70,88,96,95,82,60, + 20,0,0,0,0,0,0,21,32,32,32,13,0,0,0,0,32,96,163,163,152,88,74,139,163, + 163,112,48,28,90,154,163,120,59,15,77,142,163,135,71,0,0,0,0,0,0,47,104, + 163,135,76,24,83,142,158,97,40,0,0,0,0,0,0,56,120,163,163,108,44,0,32, + 96,163,159,92,96,163,159,92,28,0,0,0,0,56,105,147,159,145,112,147,147, + 96,32,0,0,4,45,78,97,104,102,90,65,29,0,0,32,96,163,171,112,48,112,171, + 163,96,32,0,0,49,94,131,153,163,159,145,107,44,0,0,0,0,0,11,70,96,96, + 96,56,0,0,0,0,32,96,163,195,168,104,91,154,189,179,112,48,13,75,139,197, + 135,71,28,91,155,182,119,57,0,0,0,0,0,15,74,133,165,106,49,0,56,113,174, + 124,67,9,0,0,0,0,0,56,120,187,175,108,44,0,31,93,116,116,90,93,116,116, + 90,27,0,0,0,0,15,58,85,92,83,77,80,80,70,21,0,0,0,0,18,35,40,39,29,8, + 0,0,0,29,88,104,104,99,44,99,104,104,88,29,0,35,90,142,184,181,163,167, + 175,108,44,0,0,0,0,0,16,80,147,163,131,64,0,0,0,0,32,96,163,159,158,120, + 107,170,143,179,112,48,0,61,122,186,148,84,41,104,168,168,104,41,0,0, + 0,0,0,42,101,160,139,79,22,0,29,86,147,153,93,36,0,0,0,0,0,56,120,151, + 151,108,44,0,6,45,52,52,44,45,52,52,44,2,0,0,0,0,0,3,23,28,22,15,16,16, + 11,0,0,0,0,0,3,24,32,31,18,0,0,0,0,0,34,40,40,38,9,38,40,40,34,0,2,62, + 120,179,173,124,99,102,131,108,44,0,0,0,0,0,16,80,147,195,131,64,0,0, + 0,0,32,96,163,159,143,140,124,159,143,179,112,48,0,46,108,172,162,97, + 55,116,180,153,88,27,0,0,0,0,12,69,131,170,110,53,0,0,3,60,119,177,120, + 63,4,0,0,0,0,43,83,84,84,79,33,0,0,27,32,32,32,32,32,32,32,32,32,32,15, + 0,15,20,20,19,26,32,27,4,0,0,0,0,0,23,60,86,96,93,78,48,6,0,0,0,0,0,15, + 31,32,19,20,20,20,8,18,80,143,203,144,84,38,42,77,93,39,0,0,0,0,13,16, + 80,139,139,131,64,0,0,0,0,32,96,163,159,124,157,142,144,143,179,112,48, + 0,31,93,157,174,111,67,131,193,139,74,13,0,0,0,0,38,95,156,144,83,26, + 0,0,0,33,92,151,149,90,31,0,0,0,0,32,63,64,64,61,22,0,27,82,96,96,96, + 96,96,96,96,96,96,96,60,22,73,84,84,81,87,96,88,61,18,0,0,0,17,68,113, + 147,163,159,136,96,49,0,0,0,0,40,74,93,96,78,84,84,84,60,28,92,156,188, + 124,63,0,0,26,34,3,0,0,0,24,72,80,80,80,80,80,48,0,0,0,0,32,96,163,159, + 111,174,164,131,143,179,112,48,0,16,79,143,187,124,80,144,185,120,59, + 0,0,0,0,8,65,124,174,115,56,0,0,0,0,6,65,122,176,116,58,1,0,0,0,56,120, + 131,131,108,44,0,32,96,163,163,163,163,163,163,163,163,163,135,68,32, + 96,151,151,112,149,163,149,108,56,0,0,0,47,104,159,187,156,163,189,140, + 83,25,0,0,35,85,131,158,160,136,135,151,143,76,32,96,163,183,116,53,0, + 0,0,0,0,0,0,0,36,100,147,147,147,147,131,64,0,0,0,0,32,96,163,159,96, + 160,176,112,143,179,112,48,0,2,64,124,189,139,93,158,170,107,45,0,0,0, + 0,35,92,152,147,88,29,0,0,0,0,0,38,95,154,145,85,28,0,0,0,56,120,187, + 175,108,44,0,32,95,124,124,124,124,124,124,124,124,124,124,68,32,96,163, + 181,144,151,165,199,143,81,19,0,9,69,131,190,145,94,111,169,169,107,46, + 0,4,63,122,177,181,152,158,139,200,143,76,32,96,163,183,116,52,0,0,0, + 0,0,0,0,0,36,100,159,159,165,195,131,64,0,0,0,0,32,96,163,159,92,120, + 120,97,143,179,112,48,0,0,49,111,175,151,107,170,156,92,31,0,0,0,3,62, + 119,177,119,62,3,0,0,0,0,0,10,69,124,172,111,54,0,0,0,58,120,187,172, + 108,44,0,10,53,60,60,60,60,60,60,60,60,60,60,37,32,96,163,189,131,85, + 122,185,159,92,28,0,22,84,148,188,124,62,86,149,187,124,60,0,21,83,147, + 197,140,90,102,158,207,143,76,28,92,157,188,124,61,0,0,22,30,0,0,0,0, + 29,82,92,92,147,195,131,64,0,0,0,0,32,96,163,159,92,56,56,76,143,179, + 112,48,0,0,34,96,160,164,120,183,142,78,15,0,0,0,30,88,147,151,92,34, + 0,0,0,0,0,0,0,42,99,160,140,81,24,0,8,70,135,196,144,85,28,0,0,0,30,32, + 32,30,0,0,0,0,0,0,0,32,96,163,179,112,49,112,179,163,96,32,0,28,92,159, + 179,116,91,83,142,197,135,68,0,31,92,159,181,116,55,74,139,201,143,76, + 19,81,144,202,142,81,33,38,74,90,38,0,0,0,0,24,28,80,147,195,131,64,0, + 0,0,0,32,96,163,159,92,28,12,76,143,179,112,48,0,0,20,82,145,177,135, + 188,124,63,1,0,0,0,58,115,174,122,65,8,0,0,0,0,0,0,0,15,72,133,168,108, + 51,0,20,83,147,170,111,54,0,0,0,38,90,96,96,90,38,0,0,0,0,0,0,32,96,163, + 179,112,48,112,179,163,96,32,0,32,96,163,179,112,153,136,139,203,139, + 72,0,32,96,163,179,112,48,68,135,199,143,76,3,63,122,181,171,122,95,98, + 124,108,44,0,0,0,0,0,16,80,147,195,131,64,0,0,0,0,32,96,163,159,92,28, + 12,76,143,179,112,48,0,0,6,67,131,192,184,174,110,48,0,0,0,26,85,144, + 156,95,38,0,0,0,0,0,0,0,0,0,45,103,163,136,78,19,32,95,135,135,83,26, + 0,0,0,44,108,163,163,108,44,0,0,0,0,0,0,32,96,163,179,112,48,112,179, + 163,96,32,0,32,96,163,179,112,153,136,139,203,139,72,0,32,95,159,180, + 116,54,74,139,200,143,76,0,37,92,144,188,177,159,162,175,108,44,0,0,0, + 0,0,16,80,147,195,131,64,0,0,0,0,32,96,139,139,92,28,12,76,139,139,112, + 48,0,0,0,53,115,143,143,143,95,34,0,0,0,53,111,170,131,69,12,0,0,0,0, + 0,0,0,0,0,19,77,136,163,104,45,15,60,68,68,48,0,0,0,0,44,108,175,175, + 108,44,0,0,0,0,0,0,32,96,163,179,112,48,112,179,163,96,32,0,28,92,159, + 179,115,91,83,140,198,135,68,0,23,85,149,196,139,86,99,156,207,143,76, + 0,3,51,96,135,157,167,163,149,108,44,0,0,0,0,0,16,80,147,195,131,64,0, + 0,0,0,17,63,72,72,61,13,0,51,72,72,69,30,0,0,0,32,73,76,76,76,65,15,0, + 0,22,79,140,160,101,42,0,0,0,0,0,0,0,0,0,0,0,49,108,167,133,73,0,0,0, + 0,0,0,0,0,0,54,116,179,158,99,40,0,0,0,0,0,0,32,96,163,179,112,48,112, + 179,163,96,32,0,22,84,149,187,124,61,85,148,188,124,61,0,7,67,124,182, + 178,148,154,149,202,143,76,0,0,6,45,74,92,100,98,86,63,22,0,0,0,0,0,16, + 80,147,195,131,64,0,0,0,0,0,27,32,32,31,3,6,31,32,32,25,0,0,27,32,32, + 31,3,0,29,32,32,32,10,30,90,108,108,72,15,0,0,0,0,0,0,0,0,0,0,0,23,81, + 108,108,83,0,0,0,0,0,0,0,0,9,70,135,186,131,70,13,0,0,0,0,0,0,32,96,159, + 159,112,48,112,159,159,96,32,0,10,70,133,192,144,91,108,167,170,108,47, + 0,0,39,91,139,165,168,142,135,199,143,76,0,0,0,0,15,31,36,36,25,5,0,0, + 0,0,0,0,16,80,147,195,131,64,0,0,0,0,27,82,96,96,92,42,45,93,96,96,80, + 23,27,82,96,96,92,42,40,88,96,96,95,53,0,38,44,44,29,0,0,0,0,0,0,0,0, + 0,0,0,0,0,33,44,44,35,0,0,0,0,0,0,0,0,24,86,149,156,97,42,0,0,0,0,0,0, + 0,25,80,92,92,88,40,88,92,92,80,25,0,0,49,106,161,184,152,160,192,142, + 85,27,0,0,1,46,81,100,104,86,135,199,143,76,0,0,0,10,27,32,32,22,5,0, + 0,0,0,8,49,56,56,86,151,190,124,60,0,0,0,0,32,96,163,163,112,48,52,116, + 163,159,92,28,32,96,163,163,112,48,80,131,163,156,105,53,0,27,32,32,28, + 15,0,0,0,0,0,0,22,32,32,32,32,32,32,32,32,27,0,0,27,32,32,32,32,24,24, + 82,100,100,69,12,0,0,0,0,0,0,0,0,23,28,28,27,0,27,28,28,23,0,0,0,19,71, + 116,151,167,163,140,99,51,0,0,0,0,0,23,38,40,68,135,199,143,76,0,0,39, + 70,88,96,95,83,66,42,0,0,0,32,95,120,120,131,172,177,115,52,0,0,0,0,32, + 96,163,179,112,48,52,116,183,159,92,28,32,96,163,179,112,68,119,170,167, + 113,65,15,27,82,96,96,91,76,45,0,0,0,0,15,73,96,96,96,96,96,96,96,96, + 82,27,27,82,96,96,96,96,76,0,29,36,36,22,0,0,0,0,0,0,0,0,0,0,0,14,27, + 32,32,27,11,0,0,0,0,0,26,63,90,100,97,81,51,9,0,0,0,0,0,0,0,4,68,135, + 179,143,76,0,40,88,124,153,163,159,147,124,88,27,0,0,32,96,163,183,183, + 174,142,90,33,0,0,0,0,32,96,163,179,112,48,52,116,183,159,92,28,32,96, + 163,179,112,108,159,175,124,74,25,0,32,96,163,163,155,135,88,31,0,0,0, + 20,84,151,163,163,163,163,163,163,163,96,32,32,96,163,163,163,155,88, + 0,27,32,32,32,32,32,24,0,0,0,0,0,0,17,56,76,88,96,96,88,72,42,1,0,0,0, + 0,6,28,36,35,22,0,0,0,0,0,0,0,0,0,3,66,112,112,112,73,14,72,131,181,176, + 156,156,170,159,92,28,0,0,31,93,116,116,116,111,88,51,2,0,0,0,0,32,96, + 163,179,112,48,52,116,183,159,92,28,32,96,163,179,112,147,186,136,85, + 35,0,0,32,95,124,131,165,174,112,50,0,0,0,20,84,151,163,163,163,163,169, + 219,163,96,32,32,95,124,124,171,155,88,27,82,96,96,96,96,96,76,0,0,0, + 0,0,0,40,103,139,154,163,163,153,131,91,39,0,0,27,32,32,31,3,0,25,32, + 32,31,6,0,0,0,0,0,0,28,48,48,48,32,29,92,156,183,124,92,92,108,139,92, + 28,0,0,6,45,52,52,52,48,31,2,0,0,0,0,0,32,96,163,179,112,48,52,116,183, + 159,92,28,32,96,163,179,139,187,148,94,45,0,0,0,10,53,60,80,145,187,120, + 56,0,0,0,15,73,96,96,96,96,105,160,187,135,81,25,10,53,60,104,171,155, + 88,32,96,163,163,163,163,155,88,0,0,0,0,0,0,40,104,170,151,139,140,162, + 182,124,67,0,27,82,96,96,92,42,24,80,96,96,93,45,0,0,0,0,19,30,32,27, + 11,0,0,32,96,163,179,113,67,40,51,83,77,22,0,0,0,15,20,20,28,32,17,27, + 32,23,0,0,0,32,96,163,179,112,48,52,116,183,159,92,28,32,96,163,210,192, + 189,173,115,60,3,0,0,0,0,12,76,143,187,120,56,0,0,0,0,22,32,32,36,88, + 144,196,150,96,45,0,0,0,40,104,171,155,88,32,96,163,179,179,179,155,88, + 0,0,0,0,0,0,40,104,110,87,80,80,122,187,147,82,0,28,88,151,163,122,61, + 41,102,163,163,108,48,0,0,20,54,79,92,96,88,72,45,2,27,88,152,202,156, + 124,101,78,49,22,0,0,0,22,73,84,84,90,96,74,88,96,83,46,0,0,32,96,163, + 179,112,48,52,116,183,159,92,28,32,96,163,213,164,139,193,147,90,33,0, + 0,0,0,12,76,143,187,120,56,0,0,0,0,0,0,19,72,124,179,167,113,60,8,0,0, + 0,40,104,171,155,88,31,92,112,112,112,112,112,85,0,0,0,0,0,0,40,85,119, + 139,147,147,147,190,155,88,0,9,69,131,192,140,77,58,120,182,152,88,28, + 0,19,66,108,142,159,163,153,133,90,27,8,65,116,160,192,185,162,136,102, + 60,10,0,0,32,96,151,139,149,160,122,147,163,139,86,27,0,32,96,163,179, + 112,48,52,116,183,159,92,28,32,96,163,181,122,106,165,177,119,63,8,0, + 0,0,12,76,142,191,124,66,52,40,0,0,0,2,54,108,162,182,131,76,24,0,0,0, + 0,40,104,171,155,88,3,42,48,48,48,48,48,38,0,0,0,0,0,17,76,133,176,182, + 160,155,155,193,155,88,0,0,51,111,173,157,95,75,139,193,131,69,9,0,53, + 108,159,193,162,151,157,159,92,28,0,26,70,104,133,157,179,192,151,99, + 42,0,0,32,96,163,165,143,171,163,145,159,169,104,43,0,30,92,159,179,116, + 56,61,120,185,152,88,24,32,96,163,179,112,76,135,192,151,93,38,0,0,0, + 3,65,124,174,156,122,116,82,0,0,0,38,91,144,197,145,92,40,0,0,0,0,0,40, + 104,171,155,88,0,27,32,32,25,0,0,27,32,32,32,15,0,31,92,158,194,136,96, + 88,120,187,155,88,0,0,31,92,154,174,111,91,155,173,111,51,0,17,78,139, + 197,149,102,84,95,122,92,28,0,25,29,47,73,95,122,167,186,124,62,0,0,32, + 96,163,153,88,149,168,104,135,179,112,48,0,20,82,145,201,147,112,113, + 153,199,139,77,15,32,96,163,179,112,48,102,162,181,124,68,12,0,0,0,43, + 94,124,168,175,151,84,0,0,20,73,124,181,162,108,56,4,0,0,0,0,0,40,104, + 171,155,88,27,82,96,96,80,23,27,82,96,96,96,60,0,32,96,163,187,120,58, + 78,135,196,155,88,0,0,11,72,135,190,131,108,172,154,92,32,0,28,92,157, + 183,120,60,21,35,70,65,15,23,80,88,53,28,36,79,143,199,135,68,0,0,32, + 96,163,151,84,147,167,100,131,183,116,52,0,2,62,116,170,197,176,177,201, + 167,113,56,0,32,96,163,179,112,48,74,131,188,156,97,42,0,0,6,67,131,184, + 149,111,104,78,0,4,57,108,163,177,124,71,52,52,52,48,12,0,0,40,104,171, + 155,88,32,96,163,159,92,28,32,96,163,163,135,68,0,24,86,147,201,150,116, + 131,168,199,155,88,0,0,0,53,113,176,147,124,188,135,73,11,0,32,96,163, + 179,112,48,0,0,10,7,0,28,92,142,110,88,80,97,152,192,131,65,0,0,32,96, + 163,151,84,147,167,100,131,183,116,52,0,0,29,77,116,143,155,154,142,113, + 74,25,0,32,96,139,139,112,48,44,101,139,139,131,67,0,0,12,76,143,188, + 124,62,40,29,0,31,92,147,199,142,116,116,116,116,116,101,39,0,0,40,104, + 171,155,88,32,96,163,159,92,28,32,96,163,199,135,68,0,3,59,111,151,171, + 172,153,120,159,155,88,0,0,0,34,95,157,163,143,177,115,53,0,0,31,92,159, + 181,116,55,9,24,59,52,7,28,92,159,170,153,147,157,189,165,108,51,0,0, + 32,96,163,151,84,147,167,100,131,183,116,52,0,0,0,29,60,80,88,88,79,58, + 26,0,0,17,63,72,72,69,30,15,61,72,72,72,46,0,0,12,76,143,187,120,56,0, + 0,0,32,96,163,207,185,183,183,183,183,171,104,40,0,0,40,104,171,155,88, + 32,96,163,159,92,28,32,96,151,151,135,68,0,0,20,62,92,107,108,93,91,92, + 92,74,0,0,0,15,76,139,193,183,158,95,34,0,0,20,82,144,199,142,92,72,82, + 111,91,28,27,90,131,153,167,171,165,151,119,74,22,0,0,32,96,163,151,84, + 147,167,100,131,183,116,52,0,0,25,32,32,31,3,0,0,0,0,0,0,0,0,9,24,28, + 22,4,0,0,19,26,0,0,8,12,76,143,187,120,56,0,0,0,32,96,143,143,143,143, + 143,143,143,143,104,40,0,38,44,104,171,155,88,32,96,163,159,92,28,22, + 73,84,84,84,53,0,0,0,6,32,44,44,33,28,28,28,20,0,0,0,0,57,116,147,147, + 139,76,15,0,0,1,60,115,169,184,151,139,144,159,92,28,2,45,70,90,100,104, + 100,88,63,29,0,0,0,32,96,163,151,84,147,167,100,131,183,116,52,0,23,80, + 96,96,92,45,0,0,0,0,0,0,0,37,67,87,92,83,63,39,39,72,86,36,19,67,76,85, + 147,184,120,56,0,0,0,19,67,76,76,76,76,76,76,76,76,70,26,30,90,108,108, + 171,155,88,31,93,116,116,90,27,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,35,77,80,80,80,51,0,0,0,0,27,77,119,154,171,175,165,144,92,28,0, + 0,10,28,38,40,37,27,6,0,0,0,0,32,96,159,151,84,147,159,100,131,159,116, + 52,0,23,80,124,163,136,82,32,0,0,0,0,0,28,85,124,151,159,147,120,100, + 100,124,108,44,32,96,143,147,175,169,108,47,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,32,96,163,175,179,155,88,6,45,52,52,44,2,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,30,67,92,104,108,101,85,56, + 9,0,0,0,0,0,0,0,0,0,0,0,0,0,25,80,92,92,71,92,92,82,92,92,90,44,0,0,34, + 80,124,173,120,70,19,0,0,0,0,32,96,163,151,147,160,181,164,164,173,108, + 44,32,96,147,147,140,120,79,24,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,31,92,112, + 112,112,112,85,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,10,32,43,44,39,24,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,23,28,28,19,28,28,24,28,28,27,2,0,0,0,34,80,124,155,108,52,0,0, + 0,0,32,96,116,88,81,97,120,140,139,116,82,33,21,70,80,80,76,61,32,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,42,48,48,48,48,38,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37,81,88, + 87,45,0,0,0,0,17,63,65,29,19,38,62,76,74,58,29,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 255 +}; + +#endif /* HEADER_SIGNED_DISTANCE_FONT_XXX */ diff --git a/external/Chipmunk/LICENSE.txt b/external/Chipmunk/LICENSE.txt new file mode 100644 index 0000000..804ebe8 --- /dev/null +++ b/external/Chipmunk/LICENSE.txt @@ -0,0 +1,19 @@ +Copyright (c) 2007-2013 Scott Lembcke and Howling Moon Software + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/external/Chipmunk/README.textile b/external/Chipmunk/README.textile new file mode 100644 index 0000000..26a3478 --- /dev/null +++ b/external/Chipmunk/README.textile @@ -0,0 +1,71 @@ +!http://files.slembcke.net/chipmunk/logo/logo1_med.png! + +h2. NOTE! + +The master branch is the in progress Chipmunk2D 7.0. The documentation on Chipmunk2D's website may not completely match. While the code should be pretty stable (there are some unit tests), the API is still evolving. You can check out the 6.2.x branch if you want the last released version. + +h2. ABOUT: + +Chipmunk2D is a simple, lightweight, fast and portable 2D rigid body physics library written in C. It's licensed under the unrestrictive, OSI approved MIT license. My aim is to give 2D developers access to the same quality of physics you find in newer 3D games. I hope you enjoy using Chipmunk2D, and please consider donating to help make it worth our time to continue to support Chipmunk2D with great new features. + +h2. FEATURES: + +* Designed specifically for 2D video games. +* Circle, convex polygon, and beveled line segment collision primitives. +* Multiple collision primitives can be attached to a single rigid body. +* Fast broad phase collision detection by using a bounding box tree with great temporal coherence or a spatial hash. +* Extremely fast impulse solving by utilizing Erin Catto's contact persistence algorithm. +* Supports sleeping objects that have come to rest to reduce the CPU load. +* Support for collision event callbacks based on user definable object types types. +* Flexible collision filtering system with layers, exclusion groups and callbacks. +** Can be used to create all sorts of effects like one way platforms or buoyancy areas. (Examples included) +* Supports nearest point, segment (raycasting), shape and bounding box queries to the collision detection system. +* Collision impulses amounts can be retrieved for gameplay effects, sound effects, etc. +* Large variety of joints - easily make vehicles, ragdolls, and more. +* Joint callbacks. +** Can be used to easily implement breakable or animated joints. (Examples included) +* Maintains a contact graph of all colliding objects. +* Lightweight C99 implementation with no external dependencies outside of the Std. C library. +* "Many language bindings available":http://chipmunk2d.net/bindingsAndPorts.php. +* Simple, read the "documentation":http://chipmunk2d.net/documentation.php and see! +* Unrestrictive MIT license + + +h2. CHIPMUNK PRO: + +We also make a bunch of extra for Chipmunk called "Chipmunk Pro":http://chipmunk2d.net/chipmunkPro.php. It offers features such as auto-geometry for creating collision shapes from images or implicit functions and also multithreading/SIMD optimizations. Check out the link above for more information! + + +h2. CONTRACTING: + +Howling Moon Software (my company) is available for contracting if you want to make the physics in your game really stand out. Given our unique experience with the library, we can help you use Chipmunk to it's fullest potential. Feel free to contact us through our webpage: http://howlingmoonsoftware.com/contracting.php + + +h2. BUILDING: + +Mac OS X: There is an included XCode project file for building the static library and demo application. Alternatively you could use the CMake files or the macstatic.command script to build a static lib and package up the headers for you. + +iPhone: If you want a native Objective-C API, check out Chipmunk Pro on the Chipmunk website. It is inexpensive to license and will save you a lot of time. Otherwise, the XCode project can build a static library with all the proper compiler settings. Alternatively, you can just run iphonestatic.command in the macosx/ directory. It will build you a fat library compiled as release for the device and debug for the simulator. After running it, you can simply drop the Chipmunk-iPhone directory into your iPhone project! + +UNIXes: A forum user was kind enough to make a set of CMake files for Chipmunk. This will require you to have CMake installed. To build run 'cmake .' then 'make'. This should build a dynamic library, a static library, and the demo application. A number of people have had build errors on Ubuntu due to not having GLUT or libxmu installed. + +Windows: Visual Studio projects are included in the msvc/ directory. While I try to make sure the MSVC 10 project is up to date, I don't have MSVC 9 to keep that project updated regularly. It may not work. I'd appreciate a hand fixing it if that's the case. + + +h2. GET UP TO DATE: + +If you got the source from a point release download, you might want to consider getting the latest source from GitHub. Bugs are fixed and new features are added regularly. Big changes are done in branches and tested before merging them in it's rare for the point release downloads to be better or more bug free than the latest code. + +Head on over to "GitHub":https://github.com/slembcke/Chipmunk2D and experience the future TODAY! (Okay, so maybe it's not that exciting.) + + +h2. GETTING STARTED: + +First of all, you can find the C API documentation in the doc/ directory. + +A good starting point is to take a look at the included Demo application. The demos all just set up a Chipmunk simulation space and the demo app draws the graphics directly out of that. This makes it easy to see how the Chipmunk API works without worrying about the graphics code. You are free to use the demo drawing routines in your own projects, though it is certainly not the recommended way of drawing Chipmunk objects as it pokes around at the undocumented/private APIs of Chipmunk. + + +h2. SUPPORT: + +The best way to get support is to visit the "Chipmunk Forums":http://chipmunk2d.net/forum/. There are plenty of people around using Chipmunk on the just about every platform I've ever heard of. If you are working on a commercial project and want some more direct help, Howling Moon Software is also available for "contracting":http://howlingmoonsoftware.com/contracting.php. diff --git a/external/Chipmunk/TODO.txt b/external/Chipmunk/TODO.txt new file mode 100644 index 0000000..2136472 --- /dev/null +++ b/external/Chipmunk/TODO.txt @@ -0,0 +1,58 @@ +Priorities: + Basics tutorial. + Simple top down player controls. + * test tiny omega bug in cpvslerp(). + User definable default winding. + User definable fast collision filtering. + Assertion (or warning?) for destroying a body with things still attached + Bilinearly sampled image sampler function. (override the sample method to always take bilinear samples) + RGB Image Sampler class. + Reorganize Chimpnuk Pro directory structure. Too flat and confusing. + Improve the ACD splitting plane algorithm. + Fishing game + Motorcycle in a spinning cage + Squid thingy like TomorrowPlusX. + + Investigate getting better PhysicsEditor support. + +Unordered + Fix solver issues with the groove joint. + Use a slop tolerance on joint boundaries. + +Website things + -Google analytics + Rename to Chipmunk2D + Make it so people can upgrade license versions + upgrade to new version + Coupon codes (unlimited use) + log purchase IP for fraud + Don't make any mistakes: http://www.gamasutra.com/view/feature/185773/the_top_10_mistakes_tool_.php + Several people want a Chipmunk Facebook page. + figure out and redo front page. Chipmunk js examples. + +Future things to think about: + breakable object support functions? + Serialization + Tests for the query methods + Building bodies from shape collections. + Per body iterations and timestep? + Per body damping and gravity coefs? + Easy callback programable joint? + Top down racing game. (Need the callback constraint) + cpBodyActivateStatic() should also activate joints? + +Chipmunk 7: + Speculative contacts + User definable constraint + Custom contact constraint with rolling friction and per contact surface v. + Serialization + API changes, different body/shape instantiation. + Collision handler objects with additional callbacks. + Calculate contact anchors to get rid of contact pos. (needed for speculative contacts anyway) + Mass property calculation changes. + Change apply force/impulse and point velocity functions. + Separate doxygen docs for Objective-C parts and C parts. + Cocos2D xcode templates. + Custom contacts using cpArbiter user data. + Built in transform type. + \ No newline at end of file diff --git a/external/Chipmunk/VERSION.txt b/external/Chipmunk/VERSION.txt new file mode 100644 index 0000000..15de531 --- /dev/null +++ b/external/Chipmunk/VERSION.txt @@ -0,0 +1,248 @@ +What's new in 6.2.0: +* Collision detection now primarily uses the GJK and EPA algorithms instead of SAT. Internally this was a rather huge change. o_O +* Improved collision point quality and better collision point identification. +* All shape types can now be given a rounding radius. +* Collisions are now guaranteed to have a maximum of 2 collision points. +* Poly to poly collision performance is slightly better when they have a radius. Slightly worse with none. +* Implemented smoothed segment collisions to prevent colliding with the "cracks" between segment shapes. +* API: (Officially) added cpSegmentShapeSetNeighbors() used to enable smoothed line collisions. +* API: Added cpBBCenter() to get the center of a bounding box. +* API: Added cpPolyShapeInit2() and cpPolyShapeNew2() to create poly shapes with a radius. (Horrible names yes, but it will go away in Chipmunk 7) +* API: Added cpBoxShapeInit3() and cpBoxShapeNew3() to create boxes with a radius. +* API: Added cpPolyShapeGetRadius() and cpPolyShapeSetRadius() (the latter only in chipmunk_unsafe.h). +* API: Added cpNearestPointQueryInfo.g which returns the gradient of the signed distance field for the shape. +* BUG: cpMomentForPoly() will now return a correct value for degenerate 2 vertex polygons. +* BUG: Fixed an issue where certain segment query calls would return a t value of 0 instead of 1 for a missed query. +* MISC: Passing cpvzero to cpvnormalize() will now return cpvzero. No need to worry about NaNs or cpvnormalize_safe(). +* MISC: Demo app now uses GLFW instead of GLUT, and has improved drawing and text rendering routines. + +What's new in 6.1.5: +* API: Added cpArbiter*SurfaceVelocity() to allow for custom surface velocity calculation. +* API: Added cpArbiteSetContactPointSet() to allow changing the contact geometry on the fly. +* API: Added cpSpaceConvertBodyToStatic() and cpSpaceConvertBodyToDynamic(). +* API: Added [ChipmunkBody velocityAt*Point:] methods to wrap their C equivalents. (Pro only) +* API: Added overridable [ChipmunkBody updateVelocity:...] and [ChipmunkBody updatePosition:] methods. (Pro only) +* API: Added .space properties to ChipmunkBody, ChipmunkShape and ChipmunkConstaint to wrap their C equivalents. (Pro only) +* API: Added overridable [ChipmunkConstraint preSolve:] and [ChipmunkConstraint postSolve:] methods. (Pro only) +* API: Added an ChipmunkMultiGrab.grabSort property that allows you to prioritize which shape is grabbed when there is overlap. (Pro only) +* MISC: Segment queries started inside of a shape now return t=0 and n=cpvzero instead of being undefined. +* MISC: Cleaned up a lot of common assertion messages to be more clear. +* MISC: Added a new demo called Shatter. +* MISC: Added a crushing force estimation example to the ContactGraph demo and a static/dynamic conversion example to Plink. +* MISC: Modified the Sticky demo to use the new cpArbiteSetContactPointSet() to avoid the use of unnecessary sensor shapes. +* MISC: [ChipmunkSpace addBounds:...] now returns a NSArray of the bounding segments. (Pro only) + +What's new in 6.1.4: +* MISC: Fixed a build script issue that was preventing the documentation from being generated. + +What's new in 6.1.3: +* BUG: Fixed a couple of very specific but fatal bugs that occur when sleeping is enabled and filtering collisions. +* BUG: Fixed an issue with cpvslerp() between very similar vectors. +* BUG: Fixed an issue with grab friction in ChipmunkMultiGrab. (Pro only) +* MISC: Implemented the cpConstraintGetImpulse() functionality for spring joints. +* MISC: Added more functions to chipmunk_ffi.h + +What's new in 6.1.2: +* API: Added a cpArbiter.data pointer. Now you can tag collisions with custom persistent data. +* API: Added segment to segment collisions (thanks to LegoCylon) +* API: cpSpaceAddPostStepCallback() now returns false if the callback was a duplicate. +* API: Added the ChipmunkAbstractSampler.marchThreshold property instead of hardcoding it to 0.5. +* API: Added ChipmunkGrooveJoint properties for the groove and joint anchors. +* API: ChipmunkMultiGrab now returns information about grabbed shapes. +* BUG: Fixed a minor (non-crashing, non-leaking) memory pooling issue with reindexing lots of static shapes. +* BUG: Fixed an issue with the slerp functions that would cause them to return incorrect results when given non-unit length input. +* BUG: Fixed a precision bug with the ChipmunkImage sampler classes that could cause artifacts or miss small features. +* BUG: Fixed a number of properties in Objective-Chipmunk that should have been nonatomic. +* BUG: Fixed a number of types in Objective-Chipmunk that were incorrectly id that should have been cpGroup, cpCollisionType etc. It's now possible to redefine them at compile time if you wish. +* MISC: Dropped armv6 support in favor of armv7s on iOS. (You can switch it back easily if you need.) +* MISC: Updated iOS build scripts to guess the latest SDK. +* MISC: Added the "Sticky Surfaces" demo as a cpArbiter.data example. +* MISC: Updated Objective-Chipmunk build scripts to always use the latest iOS SDK. + +What's new in 6.1.1: +* API: Renamed the new block based iterators as soon as possible to match the Apple convention ("_b" suffix). + +What's new in 6.1.0: +* API: Added a pthread based, multi-threaded solver to accelerate the game on multi-core systems. (Pro only) +* API: Added cpConvexHull() and CP_CONVEX_HULL() for generating convex hulls. +* API: Added cpPolylineConvexDecomposition_BETA() to generate an approximate concave decomposition of a polyline. (Pro only) +* API: Added [ChipmunkPolyline toConvexHull:] to generate approximate convex hulls. (Pro only). +* API: Added [ChipmunkPolylineSet toConvexHulls_BETA:]. (Pro only) +* API: Added nearest point queries. +* API: Added a push mode to ChipmunkMultiGrab so touches can interact with the scene even if they didn't initially touch a shape. (Pro only) +* API: Added optional block based iterators. +* API: Added a space property to cpBody, cpShape and cpConstraint types. +* BUG: Fixed an issue with changing the floating point and vector type on OS X. +* BUG: Fixed a pixel offset in ChipmunkImageSampler that could cause minor sampling artifacts. (Pro only) +* BUG: Fixed an issue where cpShape and cpConstraint structs could have garbage space pointers if cpcalloc() was redefined. +* BUG: Fixed assertions in cpArbiter getters to correctly reflect a contact count of 0 from separate() callbacks. +* BUG: Fixed a regression relating to registering post-step() callbacks from other post-step() callbacks. +* BUG: Fixed a minor memory leak for sleeping bodies when destroying a space. +* MISC: Point queries are now deprecated in preference to point queries. +* MISC: cpSpatialIndexPointQuery() was redundant and has been removed. Use cpSpatialIndexQuery() instead. +* MISC: cpShape*Query() functions now accept a NULL info pointer if you don't want detailed query info. +* MISC: The enableContactGraph property of cpSpace is deprecated and always be true. +* MISC: Added a new demos of the convex hull functions and a self balancing Unicycle. + +What's new in 6.0.3: +* API: Added a cpBBForCircle() convenience function. +* API: Added cpBBSegmentQuery() to check where a segment hits a cpBB. +* API: Added cpBodyGetVelAtWorldPoint() and cpBodyGetVelAtLocalPoint() to get point velocities on a body. +* API: Added cpArbiterTotalKE() to calculate the energy lost due to a collision. Great for calculating damage accurately. +* API: Added methods to get an ObjC pointer from a C chipmunk struct. +* API: Added a CHIPMUNK_ARBITER_GET_BODIES() macro for Objective-Chipmunk. +* API: The Objective-Chipmunk headers are now ARC compatible. +* API: Added a [ChipmunkSpace contains:] method to check if a ChipmunkObject has been added to the space or not. +* API: Added a cpBBNewForCircle() function. +* API: Added a cpBBSegmentQuery() function for raycasting againsts AABBs. +* BUG: Fixed a regression with ChipmunkSpace.bodies and ChipmunkSpace.shapes that caused crashes. +* BUG: Fixed a rare bug with postStep() callbacks and iterators. +* BUG: Fixed a border case in cpBBIntersectsSegment() that could cause missed segment queries. +* MISC: Added some new assertions for error conditions that were previously uncaught. +* MISC: Accelerated segment queries in cpBBTree by sorting the nodes. +* MISC: Added a new "Slice" demo that lets you cut up a polygon. +* MISC: Added NEON optimizations for Chipmunk Pro. Expect running on most ARM platforms to be 25-35% faster for contact heavy simulations. +* MISC: All ChipmunkObject instances added to a space are now retained, even composite ones. + +What's new in 6.0.2: +* API: Added cpSpaceIsLocked() to check if you are in a callback or not. +* API: Removed the long deprecated [ChipmunkSpace addShapeAHandler:] and [ChipmunkSpace addShapeBHandler:] methods. +* API: The ChipmunkObject protocol now can return any id object instead of just an NSSet. +* API: The largely useless [ChipmunkSpace addBaseObjects:] and [ChipmunkSpace removeBaseObjects:] methods were removed. +* API: Added [ChipmunkSpace smartAdd:] and [ChipmunkSpace smartRemove:] methods for a consistent API to remove objects inside and out of callbacks. +* API: Added [ChipmunkSpace addPostStepBlock:key:] to complement [ChipmunkSpace addPostStepCallback:selector:key:]. +* API: Added [ChipmunkSpace addPostStepAddition:]. +* API: Objective-Chipmunk collision handlers no longer retain their target to avoid reference cycles. +* API: Added callbacks to joints. +* BUG: Soft errors (only checked when debug mode is enabled) and warnings were disabled. Whoops. +* BUG: cpShapeIsSensor() was incorrectly named in chipmunk_ffi.h. +* BUG: It should be safe to call cpActivateBody() from an space iterator callback now. +* MISC: Very nice bouyancy demo added based on callbacks. +* MISC: Breakable Joints demo showing how to use the new joint callbacks. +* MISC: Player demo updated and greatly enhanced by Chipmunk 6 features. +* MISC: Changed adding a static body to a space from a warning to a hard error. +* MISC: cpGroup and cpCollisionType now default to uintptr_t so you can safely use pointers instead of ints for these types. +* MISC: Updated the MSVC10 project file. +* MISC: Updated the FFI defs. + +What's new in 6.0.1: +* BUG: Calling cpBodySetPos() on a sleeping body was delaying the Separate() handler callback if one existed. +* BUG: Fixed a bug where Separate() handler callbacks were not occuring when removing shapes. +* BUG: Calling cpBodyApplyForce() or cpBodyResetForces() was not activating sleeping bodies. +* API: Added cpSpaceEachConstraint(). +* API: Added a "CurrentTimeStep" property to cpSpace to retrieve the current (or most recent) timestep. +* MISC: Got rid of anonymous unions so that it is C99 clean again. + +What's new in 6.0.0: +Chipmunk 6.x's API is not quite 100% compatible with 5.x. Make sure you read the list of changes carefully. +Keep in mind that this is a x.0.0 release and that it's likely there are still some bugs I don't know about yet. I've spent a lot of effort rewritting the collision detection, sleeping, and contact graph algorithms that have required large changes and cleanup to the 5.x codebase. I've ironed out all the bugs that I know of, and the beta test went well. So it's finally time for 6! + +* API: Chipmunk now has hard runtime assertions that aren't disabled in release mode for many error conditions. Most people have been using release builds of Chipmunk during development and were missing out on very important error checking. +* API: Access to the private API has been disabled by default now and much of the private API has changed. I've added official APIs for all the uses of the private API I knew of. +* API: Added accessor functions for every property on every type. As Chipmunk's complexity has grown, it's become more difficult to ignore accessors. You are encouraged to use them, but are not required to. +* API: Added cpSpaceEachBody() and cpSpaceEachShape() to iterate bodies/shapes in a space. +* API: Added cpSpaceReindexShapesForBody() to reindex all the shapes attached to a particular body. +* API: Added a 'data' pointer to spaces now too. +* API: cpSpace.staticBody is a pointer to the static body instead of a static reference. +* API: The globals cp_bias_coef, cp_collision_slop, cp_contact_persistence have been moved to properties of a space. (collisionBias, collisionSlop, collisionPersistence respectively) +* API: Added cpBodyActivateStatic() to wake up bodies touching a static body with an optional shape filter parameter. +* API: Added cpBodyEachShape() and cpBodyEachConstraint() iterators to iterate the active shapes/constraints attached to a body. +* API: Added cpBodyEeachArbiter() to iterate the collision pairs a body is involved in. This makes it easy to perform grounding checks or find how much collision force is being applied to an object. +* API: The error correction applied by the collision bias and joint bias is now timestep independent and the units have completely changed. +* FIX: Units of damping for springs are correct regardless of the number of iterations. Previously they were only correct if you had 1 or 2 iterations. +* MISC: Numerous changes to help make Chipmunk work better with variable timesteps. Use of constant timesteps is still highly recommended, but it is now easier to change the time scale without introducing artifacts. +* MISC: Performance! Chipmunk 6 should be way faster than Chipmunk 5 for almost any game. +* MISC: Chipmunk supports multiple spatial indexes and uses a bounding box tree similar to the one found in the Bullet physics library by default. This should provide much better performance for scenes with objects of differening size and works without any tuning for any scale. + + +What's new in 5.3.5 +* FIX: Fixed spelling of cpArbiterGetDepth(). Was cpArbiteGetDepth() before. Apparently nobody ever used this function. +* FIX: Added defines for M_PI and M_E. Apparently these values were never part of the C standard math library. Who knew!? +* FIX: Added a guard to cpBodyActivate() so that it's a noop for rouge bodies. +* FIX: Shape queries now work with (and against) sensor shapes. +* FIX: Fixed an issue where removing a collision handler while a separate() callback was waiting to fire the next step would cause crashes. +* FIX: Fixed an issue where the default callback would not be called for sensor shapes. +* FIX: Resetting or applying forces or impulses on a body causes it to wake up now. +* MISC: Added a check that a space was not locked when adding or removing a callback. +* MISC: Removed cpmalloc from the API and replaced all occurences with cpcalloc +* MISC: Added a benchmarking mode to the demo app. -trial runs it in time trial mode and -bench makes it run some benchmarking demos. + +What's new in 5.3.4: +* FIX: cpBodyActivate() can now be called from collision and query callbacks. This way you can use the setter functions to change properties without indirectly calling cpBodyActivate() and causing an assertion. +* FIX: cpArbiterGetContactPointSet() was returning the collision points for the normals. +* FIX: cpSpaceEachBody() now includes sleeping bodies. +* FIX: Shapes attached to static rogue bodies created with cpBodyNewStatic() are added as static shapes. +* MISC: Applied a user patch to update the MSVC project and add a .def file. + +What's new in 5.3.3: +* API: Added cpArbiteGetCount() to return the number of contact points. +* API: Added helper functions for calculating areas of Chipmunk shapes as well as calculating polygon centroids and centering polygons on their centroid. +* API: Shape queries. Query a shape to test for collisions if it were to be inserted into a space. +* API: cpBodyInitStatic() and cpBodyNewStatic() for creating additional static (rogue) bodies. +* API: cpBodySleepWithGroup() to allow you to create groups of sleeping objects that are woken up together. +* API: Added overloaded *, +, - and == operators for C++ users. +* API: Added cpSpaceActivateShapesTouchingShape() to query for and activate any shapes touching a given shape. Useful if you ever need to move a static body. +* FIX: Fixed an extremely rare memory bug in the collision cache. +* FIX: Fixed a memory leak in Objective-Chipmunk that could cause ChipmunkSpace objects to be leaked. +* MISC: C struct fields and function that are considered private have been explicitly marked as such. Defining CP_ALLOW_PRIVATE_ACCESS to 0 in Chipmunk.h will let you test which parts of the private API that you are using and give me feedback about how to build proper APIs in Chipmunk 6 for what you are trying to do. +* MISC: Allow CGPoints to be used as cpVect on Mac OS X as well as iOS. + + +What's new in 5.3.2: +* FIX: Collision begin callbacks were being called continuously for sensors or collisions rejected from the pre-solve callback. +* FIX: Plugged a nasty memory leak when adding post-step callbacks. +* FIX: Shapes were being added to the spatial hash using an uninitialized bounding box in some cases. +* FIX: Perfectly aligned circle shapes now push each other apart. +* FIX: cpBody setter functions now call cpBodyActivate(). +* FIX: Collision handler targets are released in Objective-Chipmunk when they are no longer needed instead of waiting for the space to be deallocated. +* API: cpSpaceSegmentQuery() no longer returns a boolean. Use cpSpaceSegmentQueryFirst() instead as it's more efficient. +* NEW: cpSpaceRehashShape() Rehash an individual shape, active or static. +* NEW: cpBodySleep() Force a body to fall asleep immediately. +* NEW: cpConstraintGetImpulse() Return the most recent impulse applied by a constraint. +* NEW: Added setter functions for the groove joint endpoints. +* MISC: A number of other minor optimizations and fixes. + +What's new in 5.3.1: + * NEW: Added a brand new tutorial for Objective-Chipmunk: SimpleObjectiveChipmunk that can be found in the Objective-Chipmunk folder. + * NEW: Proper API docs for Objective-Chipmunk. + * NEW: Updated the included Objective-Chipmunk library. + * FIX: Fixed a rare memory crash in the sensor demo. + * FIX: Fixed some warnings that users submitted. + +What's new in 5.3.0: + * FIX: Fixed the source so it can compile as C, C++, Objective-C, and Objective-C++. + * FIX: Fixed cp_contact_persistence. It was broken so that it would forget collision solutions after 1 frame instead of respecting the value set. + * OPTIMIZATION: Several minor optimizations have been added. Though performance should only differ by a few percent. + * OPTIMIZATION: Chipmunk now supports putting bodies to sleep when they become inactive. + * API: Elastic iterations are now deprecated as they should no longer be necessary. + * API: Added API elements to support body sleeping. + * API: Added a statically allocated static body to each space for attaching static shapes to. + * API: Static shapes attached to the space's static body can simply be added to the space using cpSpaceAddShape(). + * NEW: New MSVC projects. + * NEW: Added boolean and time stamp types for clarity. + +What's new in 5.2.0: + * OPTIMIZATION: Chipmunk structs used within the solver are now allocated linearly in large blocks. This is much more CPU cache friendly. Programs have seen up to 50% performance improvements though 15-20% should be expected. + * API: Shape references in cpArbiter structs changed to private_a and private_b to discourage accessing the fields directly and getting them out of order. You should be using cpArbiterGetShapes() or CP_ARBITER_GET_SHAPES() to access the shapes in the correct order. + * API: Added assertion error messages as well as warnings and covered many new assertion cases. + * FIX: separate() callbacks are called before shapes are removed from the space to prevent dangling pointers. + * NEW: Added convenience functions for creating box shapes and calculating moments. + + +What's new in 5.1.0: + * FIX: fixed a NaN issue that was causing raycasts for horizontal or vertical lines to end up in an infinite loop + * FIX: fixed a number of memory leaks + * FIX: fixed warnings for various compiler/OS combinations + * API: Rejecting a collision from a begin() callback permanently rejects the collision until separation + * API: Erroneous collision type parameterns removed from cpSpaceDefaulteCollisionHandler() + * MOVE: FFI declarations of inlined functions into their own header + * MOVE: Rearranged the project structure to separate out the header files into a separate include/ directory. + * NEW: Added a static library target for the iPhone. + * NEW: Type changes when building on the iPhone to make it friendlier to other iPhone APIs + * NEW: Added an AABB query to complement point and segment queries + * NEW: CP_NO_GROUP and CP_ALL_LAYERS constants + +What's new in 5.0.0: + * Brand new Joint/Constraint API: New constraints can be added easily and are much more flexible than the old joint system + * Efficient Segment Queries - Like raycasting, but with line segments. + * Brand new collision callback API: Collision begin/separate events, API for removal of objects within callbacks, more programable control over collision handling. \ No newline at end of file diff --git a/external/Chipmunk/android/Android.mk b/external/Chipmunk/android/Android.mk new file mode 100644 index 0000000..defb992 --- /dev/null +++ b/external/Chipmunk/android/Android.mk @@ -0,0 +1,86 @@ +# Copyright (C) PlayControl Software, LLC. +# Eric Wing +# +# This is a "Prebuilt" Android Makefile provided as an example/template (or direct use if no tweaking is required). +# The idea is that you have already built the chipmunk .so and .a libraries using CMake. +# Now you want to use those prebuilt libraries in your own project. +# Android support prebuilt exteneral modules through its ndk-build system, but you need to have all the pieces setup and in the right place. This is one of those pieces. +# +# This file assumes you built all your chipmunk libs and put things into a directory structure like so: +# +# Android.mk (this file) +# libs/armeabi/libchipmunk.a +# libs/armeabi/libchipmunk.a +# libs/armeabi-v7a/libchipmunk.a +# libs/armeabi-v7a/libchipmunk.a +# libs/x86/libchipmunk.a +# libs/x86/libchipmunk.a +# +# include/chipmunk/chipmunk.h +# ... (the other header files here) +# +# Note that this file is copied into the directory above libs and include. +# Below is the code you need to make this Makefile export the correct headers, libraries, and flags for both dynamic and static versions. + +# LOCAL_PATH needs to be before include +LOCAL_PATH := $(call my-dir) + +# For the dynamic library +include $(CLEAR_VARS) +# This is the name of module the caller will use in LOCAL_SHARED_LIBRARIES +LOCAL_MODULE := chipmunk_shared +LOCAL_SRC_FILES := libs/$(TARGET_ARCH_ABI)/libchipmunk.so +LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include/chipmunk +# Use LOCAL_EXPORT_CFLAGS to automatically export the correct flags (as necessary) to the calling module so the caller doesn't need to know the details. +#LOCAL_EXPORT_CFLAGS := -DFOO=1 -DCP_USE_DOUBLES=1 -DCP_USE_CGPOINTS=0 +# The .so is already linked so we don't really need to export this. +#LOCAL_EXPORT_LDLIBS := -lm +include $(PREBUILT_SHARED_LIBRARY) + +# For the static library +include $(CLEAR_VARS) +# This is the name of module the caller will use in LOCAL_STATIC_LIBRARIES +LOCAL_MODULE := chipmunk_static +LOCAL_SRC_FILES := libs/$(TARGET_ARCH_ABI)/libchipmunk.a +# Use LOCAL_EXPORT_CFLAGS to automatically export the correct flags (as necessary) to the calling module so the caller doesn't need to know the details. +#LOCAL_EXPORT_CFLAGS := -DFOO=1 -DCP_USE_DOUBLES=1 -DCP_USE_CGPOINTS=0 +# Since the .a isn't linked, it's link dependencies must be passed on to the calling project. +LOCAL_EXPORT_LDLIBS := -lm +LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include/chipmunk +include $(PREBUILT_STATIC_LIBRARY) + + + +# Two other pieces are needed to make this work which fall outside the scope of this file. +# First, you must have a directory convention for the calling makefile. +# So let's say we put all the above in a directory called Chipmunk2D. The layout looks like this: +# Chipmunk2D/ +# Android.mk (this file) +# libs/armeabi/libchipmunk.a +# libs/armeabi/libchipmunk.a +# libs/armeabi-v7a/libchipmunk.a +# libs/armeabi-v7a/libchipmunk.a +# libs/x86/libchipmunk.a +# libs/x86/libchipmunk.a +# +# include/chipmunk/chipmunk.h +# ... (the other header files here) + +# So the calling makefile looks something like: +# LOCAL_PATH := $(call my-dir) +# include $(CLEAR_VARS) +# LOCAL_MODULE := hello-jni +# LOCAL_SRC_FILES := hello-jni.c +# These are the LOCAL_MODULE names as defined in the prebuilt module's Android.mk. Define either shared or static, but not both. If you use dynamic, don't forget you need to do a System.loadLibrary("chipmunk") in your Java code. +# #LOCAL_SHARED_LIBRARIES := chipmunk_shared +# LOCAL_STATIC_LIBRARIES := chipmunk_static +# include $(BUILD_SHARED_LIBRARY) +# Android build system will look for folder `Chipmunk2D` in all import paths: +# $(call import-module,Chipmunk2D) +# ------ end ----- + +# Second, you need to set the environmental variable NDK_MODULE_PATH to list the directory containing Chipmunk2D. +# So if Chipmunk2D is in /Library/Frameworks/Android/PrebuiltModules +# export NDK_MODULE_PATH=/Library/Frameworks/Android/PrebuiltModules +# Note that NDK_MODULE_PATH may contain multiple directories like the PATH environmental variable. + diff --git a/external/Chipmunk/doc-src/MakeDocs.rb b/external/Chipmunk/doc-src/MakeDocs.rb new file mode 100644 index 0000000..c6554d5 --- /dev/null +++ b/external/Chipmunk/doc-src/MakeDocs.rb @@ -0,0 +1,106 @@ +require 'rubygems' +require 'redcloth' +require 'erb' +require 'uri/common' + + +class Node + attr_reader :anchor + attr_reader :children + + def initialize(title, anchor, parent) + @title = title + @anchor = (parent.anchor ? "#{parent.anchor}-#{anchor}" : anchor) + + @children = [] + parent.children << self + end + + def outline(level) + children = "" + if level == 1 + children = "
    #{@children.map{|child| child.outline(level + 1).join}}
" + end + + ["
  • #{@title}#{children}
  • "] + end + + Root = Struct.new(:anchor, :children).new(nil, []) + def Root.outline + "
      #{self.children.map{|child| child.outline(1)}.join}
    " + end +end + +def pop_open_div(name) + return %{
    Hide/Show #{name}
    + +<%= h 1, "Chipmunk2D 6.2.0", "Intro" %> + +First of all, Chipmunk2D is a 2D rigid body physics library distributed under the MIT license. It is intended to be blazingly fast, portable, numerically stable, and easy to use. For this reason it's been used in hundreds of games across just about every system you can name. This includes top quality titles such as Night Sky for the Wii and many #1 sellers on the iPhone App Store! I've put thousands of hours of work over many years to make Chipmunk2D what it is today. If you find Chipmunk2D has saved you a lot of time, please consider "donating":https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=6666552. You'll make an indie game developer very happy! + +First of all, I would like to give a Erin Catto a big thank you, as Chipmunk2D's impulse solver was directly inspired by his example code way back in 2006. (Now a full fledged physics engine all it's own: "Box2D.org":http://www.box2d.org/). His contact persistence idea allows for stable stacks of objects with very few iterations of the solver. My previous solver produced mushy piles of objects or required a large amount of CPU to operate stably. + + +<%= h 2, "Why a C Library?", "WhyC" %> + +A lot of people ask me why I wrote Chipmunk2D in C instead of _pick your favorite language here_. I tend to get really excited about different programming languages. Depending on the month, take your pick of Scheme, OCaml, Ruby, Objective-C, ooc, Lua, Io... the list goes on. The one common factor between most any language is that they are usually dead simple to make bindings to C code. I also wanted Chipmunk2D to be fast, portable, easy to optimize and easy to debug. Writing Chipmunk2D in C made it simpler to achieve all of those goals. + +That said, I've never developed a whole game in C and I probably never will. There are much more interesting and fun languages than C with all sorts of nice features like garbage collection, closures and all sorts of unique object oriented runtimes. Check out the "Bindings and Ports":http://chipmunk2d.net/bindingsAndPorts.php page to see if you can use Chipmunk2D from your language of choice. Because Chipmunk2D is written in a subset of C99 it compiles cleanly as C, C++, Objective-C and Objective-C++ code, making it easy to integrate into projects in those languages. + + +<%= h 2, "Limitations of a C API:", "Limitations" %> + +Chipmunk does provide overloaded operators for @*@, @+@, and @-@ (unary and binary) if you are using C++, but falls back to using functions such as @cpvadd()@ and @cpvsub()@ for C code. This is a little harder to read, but works OK once you get used to it. Most of the interesting vector operations that are possible don't have a symbol for them anyway (at least not on a keyboard). + +Another problem for a C API is access restriction. There are many structs, fields and functions in Chipmunk that are only meant to be used internally. To work around this, I have a separate header full of Chipmunk's private API, @chipmunk_private.h@. I also use a macro, @CP_PRIVATE()@ to mangle names in public structures. While you can feel free to include this header or use the macro in your own code to access the private API, be aware that the fields and functions may be renamed or disappear without warning and I have no plans to document or support usage of the private API. + + +<%= h 2, "Chipmunk2D Pro", "ChipmunkPro" %> + +We also sell an extended version of Chipmunk2D called Chipmunk2D Pro. The main features of that are ARM NEON and multithreading optimizations, an Objective-C wrapper for iOS/Mac development and the Autogeometry tools. The solver optimizations are mostly focused on mobile performance, but the multithreading works anywhere you can use pthreads. The Objective-C wrapper allows you to integrate seamlessly into Objective-C frameworks such a Cocos2D or UIKit while taking advantage of native memory management (including ARC). It also has a number of very nice API enhancements. Autogeometry is a set of tools that allows you to generate and work with geometry extracted from image data or procedural functions. + +Additionally, selling Chipmunk2D Pro is how we make part of our living while being able to give Chipmunk2D away as open source software. Donations are nice, but this way you can get something out of it too. + + +<%= h 2, "Get it, Compile it:", "Compiling" %> + +If you haven't downloaded it yet, you can always download the newest version of Chipmunk2D "here":http://chipmunk-physics.net/release/ChipmunkLatest.tgz. Inside you'll find a command line build script that works with "CMake":http://www.cmake.org/, a XCode project and project files for Visual Studio '09 and '10. + + +<%= h 3, "Debug or Release?", "DebugRelease" %> + +Debug mode might be slightly slower, but will include a lot of error checking assertions that can help you find bugs quicker such as removing objects twice or doing things that might cause unsolvable collisions. I highly recommend you use a debug build until you are ready to ship the game and only then switch to a release build. + + +<%= h 3, "XCode (Mac/iPhone)", "XCode" %> + +The included XCode project has targets for building a static library for the Mac or iOS. Additionally, you might want to just run the @macosx/iphonestatic.command@ or @macosx/macstatic.command@ to build you a directory with the headers and debug/release static libraries that you can just drop right into your projects. Including Chipmunk in your project with all the correct compiler flags applied couldn't be simpler. The iPhone script generates a "fat" library that can be used with both the iOS simulator and devices. The device version is compiled as release, and the simulator version is compiled as debug. + + +<%= h 3, "MSVC", "MSVC" %> + +I rarely use MSVC, but others have chipped in to help me maintain Visual Studio project files. The MSVC 10 project should work, as I usually remember to test that before making a stable release. The MSVC 9 project may not as I don't have access to that version. Let me know if there are any issues. + + +<%= h 3, "Command Line", "CommandLine" %> + +The CMake build script should work on any system (Unix/Win/Mac) as long as you have CMake installed. It can even generate XCode or MSVC projects if you want (see CMake's documentation for more information). + +To compile a Chipmunk debug build on the command line, all you need to do is run: + +
    cmake -D CMAKE_BUILD_TYPE=Debug .
    +make
    + +If the @-D CMAKE_BUILD_TYPE=Debug@ option is left out, it will make a release build instead. + +Why CMake? Somebody was kind enough to make the build scripts for me originally and it seems to handle a lot of the cross-platform issues nicely. I know some people really hate having to install some random non-make build system in order to compile things, but it has saved me a lot of time and effort. + +<%= h 2, "Hello Chipmunk (World)", "HelloChipmunk" %> + +Hello world Chipmunk style. Create a simple simulation where a ball falls onto a static line segment, then rolls off. Print out the coordinates of the ball. + +<%= pop_open_example "Hello Chipmunk" %> + + +<%= h 2, "Support:", "Support" %> + +The best way to get support is to visit the "Chipmunk Forums":http://www.slembcke.net/forums/viewforum.php?f=1. There are plenty of people around using Chipmunk on the just about every platform I've ever heard of. If you are working on a commercial project, Howling Moon Software (my company) is "available for contracting":http://howlingmoonsoftware.com/contracting.php. We can help with implementing custom Chipmunk behaviors, as well as priority bug fixes and performance tuning. + + +<%= h 2, "Contact:", "ContactUS" %> + +If you find any bugs in Chipmunk, errors or broken links in this document, or have a question or comment about Chipmunk you can contact me at slembcke(at)gmail(dot)com. (email or GTalk) + + +<%= h 2, "License:", "License" %> + +Chipmunk is licensed under the MIT license. + +
    +Copyright (c) 2007-2013 Scott Lembcke and Howling Moon Software
    +
    +Permission is hereby granted, free of charge, to any person obtaining a copy
    +of this software and associated documentation files (the "Software"), to deal
    +in the Software without restriction, including without limitation the rights
    +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
    +copies of the Software, and to permit persons to whom the Software is
    +furnished to do so, subject to the following conditions:
    +
    +The above copyright notice and this permission notice shall be included in
    +all copies or substantial portions of the Software.
    +
    +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
    +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
    +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
    +SOFTWARE.
    +
    + +This means that you do not have to buy a license or pay to use Chipmunk in commercial projects. (Though we really appreciate donations) + + +<%= h 2, "Links:", "Links" %> + +* "Chipmunk Forums":http://chipmunk2d.net/forum - The official forum Chipmunk2D forum. +* "Howling Moon Software":http://howlingmoonsoftware.com/ - The software company I cofounded. (We are available for contract work!) +* "Chipmunk2D Pro":http://chipmunk2d.net/chipmunkPro.php - An enhanced version of Chipmunk that we maintain with some specific optimizations for ARM or multi-core platforms, automatic geometry manipulation from images or procedural data, and API wrappers for Objective-C. +* "Games":http://chipmunk2d.net/games.php - A small list of games done with Chipmunk. At least a few of the ones we know of. + + +<%= h 1, "Chipmunk2D Basics:", "Basics" %> + +<%= h 2, "Overview:", "Overview" %> + +There are 4 basic object types you will use in Chipmunk. + +* *Rigid Bodies:* A rigid body holds the physical properties of an object. (mass, position, rotation, velocity, etc.) It does not have a shape until you attach one or more collision shapes to it. If you’ve done physics with particles before, rigid bodies differ in that they are able to rotate. Rigid bodies generally tend to have a 1:1 correlation to sprites in a game. You should structure your game so that you use the position and rotation of the rigid body for drawing your sprite. +* *Collision Shapes:* By attaching shapes to bodies, you can define the a body’s shape. You can attach as many shapes to a single body as you need to in order to define a complex shape. Shapes contain the surface properties of an object such as how much friction or elasticity it has. +* *Constraints/Joints:* Constraints and joints describe how bodies are attached to each other. +* *Spaces:* Spaces are containers for simulating objects in Chipmunk. You add bodies, shapes and joints to a space and then update the space as a whole. They control how all the rigid bodies, shapes, and constraints interact together. + +There is often confusion between rigid bodies and their collision shapes in Chipmunk and how they relate to sprites. A sprite would be a visual representation of an object, while a collision shape is an invisible property that defines how objects should collide. Both the sprite's and the collision shape's position and rotation are controlled by the motion of a rigid body. Generally you want to create a game object type that ties these things all together. + + +<%= h 2, "Memory Management the Chipmunk way:", "Memory" %> + +For most of the structures you will use, Chipmunk uses a more or less standard and straightforward set of memory management functions. Take the "cpSpace":#cpSpace struct for example: + +* @cpSpaceNew()@ - Allocates and initializes a @cpSpace@ struct. It calls @cpSpaceAlloc()@ then @cpSpaceInit()@. +* @cpSpaceFree(cpSpace *space)@ - Destroys and frees the @cpSpace@ struct. + +You are responsible for freeing any structs that you allocate. Chipmunk does not do reference counting or garbage collection. If you call a @new@ function, you must call the matching @free@ function or you will leak memory. + +Additionally if you need more control over allocation and initialization because you are allocating temporary structs on the stack, writting a language binding, or working in a low memory environment you can also use the following functions. _Most people will never have any need to use these functions._ + +* @cpSpaceAlloc()@ - Allocates but does not initialize a @cpSpace@ struct. All allocation functions look more or less like this: @return (cpSpace *)cpcalloc(1, sizeof(cpSpace));@ You can write your own allocation functions if you want. It is not a requirement that the memory be zeroed. +* @cpSpaceInit(cpSpace *space)@ - Initializes a @cpSpace@ struct. +* @cpSpaceDestroy(cpSpace *space)@ - Frees all memory allocated by @cpSpaceInit()@, but does not free the @cpSpace@ struct itself. + +Like calls to the @new@ and @free@ functions. Any memory allocated by an @alloc@ function must be freed by @cpfree()@ or similar. Any call to an @init@ function must be matched with it's @destroy@ function. + +To further ease integration with garbage collectors or other memory management constraints, Chipmunk has a number of compile time defines (@cpcalloc()@, @cprealloc()@, and @cpfree()@) that can be overriden. If you aren't using Chipmunk from a garbage collected language, I'd highly recommend using libGC. It provides nearly transparent garbage collection for C based languages. + +<%= h 2, "Basic Types:", "Types" %> + +@chipmunk_types.h@ defines a number of basic types that Chipmunk uses. These can be changed at compile time to better suit your needs: +* @cpFloat@: Floating point type. Defaults to @double@. +* @cpVect@: 2D vector type. "cpVect documentation":#cpVect +* @cpBool@: Like every good C library that wants good cross language compatibility, you end up defining your own boolean type. :-\ Defaults to @int@. +* @cpDataPointer@: Pointer type defined for callbacks and the user definable data pointer on most Chipmunk structs. Defaults to @void*@. +* @cpCollisionType@: Unique identifier for collision shape types. Defaults to @unsigned int@. Defined type must support the @==@ operator. +* @cpGroup@: Unique identifier for collision groups. Defaults to @unsigned int@. A @CP_NO_GROUP@ value is defined that can be used when you don't want to specify a group. Defined type must support the equality @==@ operator. +* @cpLayers@: Type used as the layers bitmask. Defaults to @unsigned int@. A @CP_ALL_LAYERS@ value is defined that has all layer bits set. Defined type must support the bitwise AND @&@ operator. + +If you are writting a game engine or language binding on top of Chipmunk, you might want to choose to use object references instead of integers for collision type and group. I often use class pointers for collision types and game object pointers for groups. It's much simpler than keeping a table of enumerations around. + +*Note:* On the iPhone, @cpFloat@ is defined as @float@ and @cpVect@ is an alias for @CGPoint@ for performance and compatibility reasons. + +<%= h 2, "Math the Chipmunk way:", "Math" %> + +First of all, Chipmunk uses double precision floating point numbers throughout it's calculations by default. This is likely to be faster on most modern desktop processors, and means you have to worry less about floating point round off errors. You can change the floating point type used by Chipmunk when compiling the library. Look in @chipmunk_types.h@. + +Chipmunk defines a number of aliases for common math functions so that you can choose to use floats or doubles for Chipmunk's floating point type. In your own code, there probably isn't a strong reason to use these aliases unless you expect you might want to change Chipmunk's floating point type later and a 2% performance hit from using the wrong float/double version of math functions will matter. + +There are a few unique functions you will probably find very useful: + +* @cpFloat cpfclamp(cpFloat f, cpFloat min, cpFloat max)@ - Clamp @f@ to be between @min@ and @max@. +* @cpFloat cpflerp(cpFloat f1, cpFloat f2, cpFloat t)@ - Linearly interpolate between @f1@ and @f2@. +* @cpFloat cpflerpconst(cpFloat f1, cpFloat f2, cpFloat d)@ - Linearly interpolate from @f1@ towards @f2@ by no more than @d@. + +Floating point infinity is defined as @INFINITY@. This is defined by many math libraries, but is not actually part of the C standard library. + +<%= h 1, "Chipmunk Vectors: @cpVect@", "cpVect" %> + +<%= h 2, "Struct Definition, Constants and Constructors:", "Basics" %> + +
    typedef struct cpVect{
    +	cpFloat x, y;
    +} cpVect
    + +p(expl). 2D vector packed into a struct. No surprises here. + +
    static const cpVect cpvzero = {0.0f,0.0f};
    + +p(expl). Constant for the zero vector. + +
    cpVect cpv(const cpFloat x, const cpFloat y)
    + +p(expl). Convenience constructor for creating new @cpVect@ structs. + +<%= h 2, "Operations:", "Operations" %> + +* @cpBool cpveql(const cpVect v1, const cpVect v2)@ - Check if two vectors are equal. Chipmunk provides an overloaded @==@ operator when used in C++ programs. _(Be careful when comparing floating point numbers!)_ +* @cpVect cpvadd(const cpVect v1, const cpVect v2)@ - Add two vectors. Chipmunk provides an overloaded @+@ operator when used in C++ programs. +* @cpVect cpvsub(const cpVect v1, const cpVect v2)@ - Subtract two vectors. Chipmunk provides an overloaded @-@ operator when used in C++ programs. +* @cpVect cpvneg(const cpVect v)@ - Negate a vector. Chipmunk provides an overloaded unary negation operator @-@ when used in C++ programs. +* @cpVect cpvmult(const cpVect v, const cpFloat s)@ - Scalar multiplication. Chipmunk provides an overloaded @*@ operator when used in C++ programs. +* @cpFloat cpvdot(const cpVect v1, const cpVect v2)@ - Vector dot product. +* @cpFloat cpvcross(const cpVect v1, const cpVect v2)@ - 2D vector cross product analog. The cross product of 2D vectors results in a 3D vector with only a z component. This function returns the value along the z-axis. +* @cpVect cpvperp(const cpVect v)@ - Returns a perpendicular vector. (90 degree rotation) +* @cpVect cpvrperp(const cpVect v)@ - Returns a perpendicular vector. (-90 degree rotation) +* @cpVect cpvproject(const cpVect v1, const cpVect v2)@ - Returns the vector projection of @v1@ onto @v2@. +* @cpVect cpvrotate(const cpVect v1, const cpVect v2)@ - Uses complex multiplication to rotate @v1@ by @v2@. Scaling will occur if @v1@ is not a unit vector. +* @cpVect cpvunrotate(const cpVect v1, const cpVect v2)@ - Inverse of @cpvrotate()@. +* @cpFloat cpvlength(const cpVect v)@ - Returns the length of @v@. +* @cpFloat cpvlengthsq(const cpVect v)@ - Returns the squared length of @v@. Faster than @cpvlength()@ when you only need to compare lengths. +* @cpVect cpvlerp(const cpVect v1, const cpVect v2, const cpFloat t)@ - Linearly interpolate between @v1@ and @v2@. +* @cpVect cpvlerpconst(cpVect v1, cpVect v2, cpFloat d)@ - Linearly interpolate between @v1@ towards @v2@ by distance @d@. +* @cpVect cpvslerp(const cpVect v1, const cpVect v2, const cpFloat t)@ - Spherical linearly interpolate between @v1@ and @v2@. +* @cpVect cpvslerpconst(const cpVect v1, const cpVect v2, const cpFloat a)@ - Spherical linearly interpolate between @v1@ towards @v2@ by no more than angle @a@ in radians. +* @cpVect cpvnormalize(const cpVect v)@ - Returns a normalized copy of @v@. As a special case, it returns @cpvzero@ when called on @cpvzero@. +* @cpVect cpvclamp(const cpVect v, const cpFloat len)@ - Clamp @v@ to length @len@. +* @cpFloat cpvdist(const cpVect v1, const cpVect v2)@ - Returns the distance between @v1@ and @v2@. +* @cpFloat cpvdistsq(const cpVect v1, const cpVect v2)@ - Returns the squared distance between @v1@ and @v2@. Faster than @cpvdist()@ when you only need to compare distances. +* @cpBool cpvnear(const cpVect v1, const cpVect v2, const cpFloat dist)@ - Returns true if the distance between @v1@ and @v2@ is less than @dist@. +* @cpVect cpvforangle(const cpFloat a)@ - Returns the unit length vector for the given angle (in radians). +* @cpFloat cpvtoangle(const cpVect v)@ - Returns the angular direction @v@ is pointing in (in radians). + + +<%= h 1, "Chipmunk Axis Aligned Bounding Boxes: @cpBB@", "cpBB" %> + +<%= h 2, "Struct Definition and Constructors:", "Basics" %> + +
    typedef struct cpBB{
    +	cpFloat l, b, r ,t;
    +} cpBB
    + +p(expl). Simple bounding box struct. Stored as left, bottom, right, top values. + +
    cpBB cpBBNew(const cpFloat l, const cpFloat b, const cpFloat r, const cpFloat t)
    + +p(expl). Convenience constructor for @cpBB@ structs. Like @cpv()@ this function returns a copy and not a malloced pointer. + +
    cpBB cpBBNewForCircle(const cpVect p, const cpFloat r)
    + +p(expl). Convenience constructor for making a @cpBB@ fitting a circle at position @p@ with radius @r@. + + +<%= h 2, "Operations:", "Operations" %> + +* @cpBool cpBBIntersects(const cpBB a, const cpBB b)@ - Returns true if the bounding boxes intersect. +* @cpBool cpBBContainsBB(const cpBB bb, const cpBB other)@ - Returns true if @bb@ completely contains @other@. +* @cpBool cpBBContainsVect(const cpBB bb, const cpVect v)@ - Returns true if @bb@ contains @v@. +* @cpBB cpBBMerge(const cpBB a, const cpBB b)@ - Return the minimal bounding box that contains both @a@ and @b@. +* @cpBB cpBBExpand(const cpBB bb, const cpVect v)@ - Return the minimal bounding box that contains both @bb@ and @v@. +* @cpVect cpBBCenter(const cpBB bb)@ - Return the center of @bb@. +* @cpFloat cpBBArea(cpBB bb)@ - Return the area of @bb@. +* @cpFloat cpBBMergedArea(cpBB a, cpBB b)@ - Merges @a@ and @b@ then returns the area of the merged bounding box. +* @cpFloat cpBBSegmentQuery(cpBB bb, cpVect a, cpVect b)@ - Returns the fraction along the segment query the cpBB is hit. Returns INFINITY if it doesn't hit. +* @cpBool cpBBIntersectsSegment(cpBB bb, cpVect a, cpVect b)@ - Returns true if the segment defined by endpoints @a@ and @b@ intersect @bb@. +* @cpVect cpBBClampVect(const cpBB bb, const cpVect v)@ - Returns a copy of @v@ clamped to the bounding box. +* @cpVect cpBBWrapVect(const cpBB bb, const cpVect v)@ - Returns a copy of @v@ wrapped to the bounding box. + + +<%= h 1, "Chipmunk Rigid Bodies: @cpBody@", "cpBody" %> + +<%= h 2, "Rogue and Static Bodies:", "RougeStatic" %> + +Normally when you create a rigid body, you add it to a space so the space will start simulating it. This means it will update it's position and velocity, apply forces to it, be affected by gravity, etc. A body that isn't added to a space (and not simulated) is called a _rogue body_. The most important use for rogue bodies are as static bodies, but you can also use them to implement directly controlled objects such as moving platforms. + +Static bodies are rogue bodies, but with a special flag set on them to let Chipmunk know that they never move unless you tell it. Static bodies have two purposes. Originally they were added for the sleeping feature. Because static bodies don't move, Chipmunk knows that it's safe to let objects that are touching or jointed to them fall asleep. Objects touching or jointed to regular rogue bodies are never allowed to sleep. The second purpose for static bodies is that Chipmunk knows shapes attached to them never need to have their collision detection data updated. Chipmunk also doesn't need to bother checking for collisions between static objects. Generally all of your level geometry will be attached to a static body except for things like moving platforms or doors. + +In previous versions of Chipmunk before 5.3 you would create an infinite mass rogue body to attach static shapes to using @cpSpaceAddStaticShape()@. You don't need to do any of that anymore, and shouldn't if you want to use the sleeping feature. Each space has a dedicated static body that you can use to attach your static shapes to. Chipmunk also automatically adds shapes attached to static bodies as static shapes. + + +<%= h 2, "Memory Management Functions:", "Memory" %> + +
    cpBody *cpBodyAlloc(void)
    +cpBody *cpBodyInit(cpBody *body, cpFloat m, cpFloat i)
    +cpBody *cpBodyNew(cpFloat m, cpFloat i)
    +
    +void cpBodyDestroy(cpBody *body)
    +void cpBodyFree(cpBody *body)
    + +p(expl). Standard set of Chipmunk memory management functions. @m@ and @i@ are the mass and moment of inertia for the body. Guessing the mass for a body is usually fine, but guessing a moment of inertia can lead to a very poor simulation. Be careful not to free a body before any shapes or constraints attached to it have been removed from a space. + + +<%= h 2, "Creating Additional Static Bodies:", "StaticBodies" %> + +While every cpSpace has a built in static body that you can use, it can be convenient to make your own as well. One potential use is in a level editor. By attaching chunks of your level to static bodies, you can still move and rotate the chunks independently of each other. Then all you have to do is call @cpSpaceRehashStatic()@ to rebuild the static collision detection data when you are done. + +For more information on rogue and static bodies, see "Chipmunk Spaces":#cpSpace. + +
    cpBody *cpBodyAlloc(void);
    +cpBody *cpBodyInitStatic(cpBody *body)
    +cpBody *cpBodyNewStatic()
    + +p(expl). Create additional static bodies with infinite mass and moment of inertia. + + +<%= h 2, "Properties:", "Properties" %> + +Chipmunk provides getter/setter functions for a number of properties on rigid bodies. Setting most properties automatically wakes the rigid bodies up if they were sleeping. You can also set the fields directly on the cpBody struct if you wish. They are documented in the headers. + +
    cpFloat cpBodyGetMass(const cpBody *body)
    +void cpBodySetMass(cpBody *body, cpFloat m)
    + +p(expl). Mass of the body. + +
    cpFloat cpBodyGetMoment(const cpBody *body)
    +void cpBodySetMoment(cpBody *body, cpFloat i)
    + +p(expl). Moment of inertia (MoI or sometimes just moment) of the body. The moment is like the rotational mass of a body. See below for function to help calculate the moment. + +
    cpVect cpBodyGetPosition(const cpBody *body)
    +void cpBodySetPosition(cpBody *body, cpVect pos)
    + +p(expl). Position of the center of gravity of the body. When changing the position you may also want to call @cpSpaceReindexShapesForBody()@ to update the collision detection information for the attached shapes if plan to make any queries against the space. + +
    cpVect cpBodyGetVel(const cpBody *body)
    +void cpBodySetVelocity(cpBody *body, const cpVect value)
    + +p(expl). Linear velocity of the center of gravity of the body. + +
    cpVect cpBodyGetForce(const cpBody *body)
    +void cpBodySetForce(cpBody *body, const cpVect value)
    + +p(expl). Force applied to the center of gravity of the body. + +
    cpFloat cpBodyGetAngle(const cpBody *body)
    +void cpBodySetAngle(cpBody *body, cpFloat a)
    + +p(expl). Rotation of the body in radians. When changing the rotation you may also want to call @cpSpaceReindexShapesForBody()@ to update the collision detection information for the attached shapes if plan to make any queries against the space. + +
    cpFloat cpBodyGetAngularVelocity(const cpBody *body)
    +void cpBodySetAngularVelocity(cpBody *body, const cpFloat value)
    + +p(expl). The angular velocity of the body in radians per second. + +
    cpFloat cpBodyGetTorque(const cpBody *body)
    +void cpBodySetTorque(cpBody *body, const cpFloat value)
    + +p(expl). The torque applied to the body. + +
    cpVect cpBodyGetRotation(const cpBody *body)
    + +p(expl). The rotation vector for the body. Can be used with @cpvrotate()@ or @cpvunrotate()@ to perform fast rotations. + +
    cpFloat cpBodyGetVelLimit(const cpBody *body)
    +void cpBodySetVelocityLimit(cpBody *body, const cpFloat value)
    + +p(expl). Velocity limit of the body. Defaults to @INFINITY@ unless you set it specifically. Can be used to limit falling speeds, etc. + +
    cpFloat cpBodyGetAngularVelocityLimit(const cpBody *body)
    +void cpBodySetAngularVelocityLimit(cpBody *body, const cpFloat value)
    + +p(expl). Angular velocity limit of the body in radians per second. Defaults to @INFINITY@ unless you set it specifically. + +
    cpSpace* cpBodyGetSpace(const cpBody *body)
    + +p(expl). Get the @cpSpace@ that @body@ has been added to. + +
    cpDataPointer cpBodyGetUserData(const cpBody *body)
    +void cpBodySetUserData(cpBody *body, const cpDataPointer value)
    + +p(expl). User data pointer. Use this pointer to get a reference to the game object that owns this body from callbacks. + + +<%= h 2, "Moment of Inertia and Area Helper Functions:", "Helpers" %> + +Use the following functions to approximate the moment of inertia for your body, adding the results together if you want to use more than one. + +* @cpFloat cpMomentForCircle(cpFloat m, cpFloat r1, cpFloat r2, cpVect offset)@ - Calculate the moment of inertia for a hollow circle, @r1@ and @r2@ are the inner and outer diameters in no particular order. _(A solid circle has an inner diameter of 0)_ +* @cpFloat cpMomentForSegment(cpFloat m, cpVect a, cpVect b)@ - Calculate the moment of inertia for a line segment. The endpoints @a@ and @b@ are relative to the body. +* @cpFloat cpMomentForPoly(cpFloat m, int count, const cpVect *verts, cpVect offset)@ - Calculate the moment of inertia for a solid polygon shape assuming it's center of gravity is at it's centroid. The offset is added to each vertex. +* @cpFloat cpMomentForBox(cpFloat m, cpFloat width, cpFloat height)@ - Calculate the moment of inertia for a solid box centered on the body. + + + +<%= pop_open_example "Moments" %> + +Use the following functions to get the area for common Chipmunk shapes if you want to approximate masses or density or whatnot. + +* @cpFloat cpAreaForCircle(cpFloat r1, cpFloat r2)@ - Area of a hollow circle. +* @cpFloat cpAreaForSegment(cpVect a, cpVect b, cpFloat r)@ - Area of a beveled segment. _(Will always be zero if radius is zero)_ +* @cpFloat cpAreaForPoly(const int count, const cpVect *verts)@ - Signed area of a polygon shape. Returns a negative number for polygons with a backwards winding. + + +<%= h 2, "Coordinate Conversion Functions:", "CoordinateConversion" %> + +Many things are defined in coordinates local to a body meaning that the (0,0) is at the center of gravity of the body and the axis rotate along with the body. + +* @cpVect cpBodyLocalToWorld(const cpBody *body, const cpVect v)@ - Convert from body local coordinates to world space coordinates. +* @cpVect cpBodyWorldToLocal(const cpBody *body, const cpVect v)@ - Convert from world space coordinates to body local coordinates. + + +<%= h 2, "Applying Forces and Torques:", "Forces" %> + +People are sometimes confused by the difference between a force and an impulse. An impulse is basically a very large force applied over a very short period of time, like a ball hitting a wall or cannon firing. Chipmunk treats impulses as if they occur instantaneously by simply adding directly to the velocity of an object. Both impulses and forces are affected the mass of an object. Double the mass of the object and halve the effect. + +* @void cpBodyResetForces(cpBody *body)@ - Zero both the forces and torques currently applied to the body. +* @void cpBodyApplyForce(cpBody *body, const cpVect f, const cpVect r)@ - Add the force @f@ to @body@ at a relative offset @r@ from the center of gravity. +* @void cpBodyApplyImpulse(cpBody *body, const cpVect j, const cpVect r)@ - Add the impulse @j@ to @body@ at a relative offset @r@ from the center of gravity. + +*Note:* Both the @cpBodyApplyForce()@ @cpBodyApplyImpulse()@ functions take a force or impulse in absolute coordinates and applies it at a relative offset in absolute coordinates. (The offset is relative to the center of gravity, but is _not_ rotated with the body) + + +<%= h 2, "Sleeping Functions:", "Sleeping" %> + +Chipmunk supports a sleeping feature so that it stops using CPU time simulating groups of objects that stop moving. Read more about it in the "cpSpace section":#cpSpace-Sleeping. + +* @cpBool cpBodyIsSleeping(const cpBody *body)@ - Returns true if @body@ is sleeping. +* @void cpBodyActivate(cpBody *body)@ - Reset the idle timer on a body. If it was sleeping, wake it and any other bodies it was touching. +* @void cpBodySleep(cpBody *body)@ - Forces a body to fall asleep immediately even if it's in midair. Cannot be called from a callback. +* @void cpBodyActivateStatic(cpBody *body, cpShape *filter)@ - Similar in function to @cpBodyActivate()@. Activates all bodies touching @body@. If @filter@ is not @NULL@, then only bodies touching through @filter@ will be awoken. + +
    void cpBodySleepWithGroup(cpBody *body, cpBody *group)
    + +p(expl). When objects in Chipmunk sleep, they sleep as a group of all objects that are touching or jointed together. When an object is woken up, all of the objects in it's group are woken up. @cpBodySleepWithGroup()@ allows you group sleeping objects together. It acts identically to @cpBodySleep()@ if you pass @NULL@ as @group@ by starting a new group. If you pass a sleeping body for @group@, @body@ will be awoken when @group@ is awoken. You can use this to initialize levels and start stacks of objects in a pre-sleeping state. + +<%= pop_open_example "Sleeping" %> + +<%= h 2, "Iterators", "Iterators" %> + +
    typedef void (*cpBodyShapeIteratorFunc)(cpBody *body, cpShape *shape, void *data)
    +void cpBodyEachShape(cpBody *body, cpBodyShapeIteratorFunc func, void *data)
    + +p(expl). Call @func@ once for each shape that is attached to @body@ and added to a space. @data@ is passed along as a context value. It is safe to remove shapes using these callbacks. + +
    typedef void (*cpBodyConstraintIteratorFunc)(cpBody *body, cpConstraint *constraint, void *data)
    +void cpBodyEachConstraint(cpBody *body, cpBodyConstraintIteratorFunc func, void *data)
    + +p(expl). Call @func@ once for each constraint that is attached to @body@ and added to a space. @data@ is passed along as a context value. It is safe to remove constraints using thes callbacks. + +
    typedef void (*cpBodyArbiterIteratorFunc)(cpBody *body, cpArbiter *arbiter, void *data)
    +void cpBodyEachArbiter(cpBody *body, cpBodyArbiterIteratorFunc func, void *data)
    + +p(expl). This one is more interesting. Calls @func@ once for each collision pair that @body@ is involved in. Calling @cpArbiterGet[Bodies|Shapes]()@ or @CP_ARBITER_GET_[BODIES|SHAPES]()@ will return the body or shape for @body@ as the first argument. You can use this to check all sorts of collision information for a body like if it's touching the ground, another particular object, how much collision force is being applied to an object, etc. Sensor shapes and arbiters that have been rejected by a collision handler callback or @cpArbiterIgnore()@ are not tracked by the contact graph. + +*Note:* If your compiler supports blocks (such as Clang), there are an alternate set of functions you can call. @cpBodyEachShape_b()@, etc. See @chipmunk.h@ for more information. + +<%= pop_open_example "Crushing" %> + + +<%= h 2, "Integration Callbacks:", "Integration Callbacks" %> + +This section is a stub. For now you can look at the Planet demo for an example of how to use integration callbacks to implement planetary gravity. + + + +<%= h 2, "Misc Functions:", "Misc" %> + +* @cpBool cpBodyIsStatic(const cpBody *body)@ - Returns true if @body@ is a static body. Either @cpSpace.staticBody@, a body created with @cpBodyNewStatic()@ or @cpBodyInitStatic()@. +* @cpBool cpBodyIsRogue(const cpBody *body)@ - Returns true if @body@ has never been added to a space. + + +<%= h 2, "Notes:", "Notes" %> + +* Use forces to modify the rigid bodies if possible. This will be the most stable. +* Modifying a body's velocity shouldn't necessarily be avoided, but applying large changes every frame can cause strange results in the simulation. Experiment freely, but be warned. +* *Don't* modify a body's position every step unless you really know what you are doing. Otherwise you're likely to get the position/velocity badly out of sync. +* If you free a body before calling @cpSpaceRemoveShape()@ on the shapes attached to it, you *will* cause crashes. + +<%= h 1, "Chipmunk Collision Shapes: @cpShape@", "cpShape" %> + +There are currently 3 collision shape types: + +* *Circles*: Fastest and simplest collision shape. +* *Line segments*: Meant mainly as a static shape. Can be beveled in order to give them a thickness. +* *Convex polygons*: Slowest, but most flexible collision shape. + +You can add as many shapes to a body as you wish. That is why the two types are separate. This should give you the flexibility to make any shape you want as well providing different areas of the same object with different friction, elasticity or callback values. + +When creating different types of shapes, you will always be given a @cpShape*@ pointer back. This is because Chipmunk shapes are meant to be opaque types. Think of the specific collision types such as @cpCircleShape@, @cpSegmentShape@ and @cpPolyShape@ as private subclasses of @cpShape@. You can still read some properties from them using the getter functions, but you are not intended to cast @cpShape@ pointers to their specific types. + +<%= h 2, "Notes:", "Notes" %> + +* Chipmunk didn't support segment/segment collisions until v6.1.2. For compatibility reasons, you must explicitly and globally enable them by calling @cpEnableSegmentToSegmentCollisions()@. (Thanks to LegoCylon for his help with this) + + +<%= h 2, "Properties:", "Properties" %> + +Chipmunk provides getter/setter functions for a number of properties on collision shapes. Setting most properties automatically wakes the rigid body they are attached to up if it was sleeping. You can also set some of the fields directly on the cpShape struct if you wish. They are documented in the headers. + +
    cpBody * cpShapeGetBody(const cpShape *shape)
    +void cpShapeSetBody(cpShape *shape, cpBody *body)
    + +p(expl). The rigid body the shape is attached to. Can only be set when the shape is not added to a space. + +
    cpBB cpShapeGetBB(const cpShape *shape)
    + +p(expl). The bounding box of the shape. Only guaranteed to be valid after @cpShapeCacheBB()@ or @cpSpaceStep()@ is called. Moving a body that a shape is connected to does not update it's bounding box. For shapes used for queries that aren't attached to bodies, you can also use @cpShapeUpdate()@. + +
    cpBool cpShapeGetSensor(const cpShape *shape)
    +void cpShapeSetSensor(cpShape *shape, cpBool value)
    + +p(expl). A boolean value if this shape is a sensor or not. Sensors only call collision callbacks, and never generate real collisions. + +
    cpFloat cpShapeGetElasticity(const cpShape *shape)
    +void cpShapeSetElasticity(cpShape *shape, cpFloat value)
    + +p(expl). Elasticity of the shape. A value of 0.0 gives no bounce, while a value of 1.0 will give a "perfect" bounce. However due to inaccuracies in the simulation using 1.0 or greater is not recommended however. The elasticity for a collision is found by multiplying the elasticity of the individual shapes together. + +
    cpFloat cpShapeGetFriction(const cpShape *shape)
    +void cpShapeSetFriction(cpShape *shape, cpFloat value)
    + +p(expl). Friction coefficient. Chipmunk uses the Coulomb friction model, a value of 0.0 is frictionless. The friction for a collision is found by multiplying the friction of the individual shapes together. "Tables of friction coefficients":http://www.roymech.co.uk/Useful_Tables/Tribology/co_of_frict.htm. + +
    cpVect cpShapeGetSurfaceVelocity(const cpShape *shape)
    +void cpShapeSetSurfaceVelocity(cpShape *shape, cpVect value)
    + +p(expl). The surface velocity of the object. Useful for creating conveyor belts or players that move around. This value is only used when calculating friction, not resolving the collision. + +
    cpCollisionType cpShapeGetCollisionType(const cpShape *shape)
    +void cpShapeSetCollisionType(cpShape *shape, cpCollisionType value)
    + +p(expl). You can assign types to Chipmunk collision shapes that trigger callbacks when objects of certain types touch. See the "callbacks section":#Callbacks-Handlers for more information. + +
    cpGroup cpShapeGetGroup(const cpShape *shape)
    +void cpShapeSetGroup(cpShape *shape, cpGroup value)
    + +p(expl). Shapes in the same non-zero group do not generate collisions. Useful when creating an object out of many shapes that you don't want to self collide. Defaults to @CP_NO_GROUP@. + +
    cpLayers cpShapeGetLayers(const cpShape *shape)
    +void cpShapeSetLayers(cpShape *shape, cpLayers value)
    + +p(expl). Shapes only collide if they are in the same bit-planes. i.e. @(a->layers & b->layers) != 0@ By default, a shape occupies all bit-planes. "Wikipedia":http://en.wikipedia.org/wiki/Mask_(computing)#top has a nice article on bitmasks if you are unfamiliar with how to use them. Defaults to @CP_ALL_LAYERS@. + +
    cpSpace* cpShapeGetSpace(const cpShape *shape)
    + +p(expl). Get the @cpSpace@ that @shape@ has been added to. + +
    cpDataPointer cpShapeGetUserData(const cpShape *shape)
    +void cpShapeSetUserData(cpShape *shape, cpDataPointer value)
    + +p(expl). A user definable data pointer. If you set this to point at the game object the shapes is for, then you can access your game object from Chipmunk callbacks. + + +<%= h 2, "Filtering Collisions:", "Filtering" %> + +Chipmunk has two primary means of ignoring collisions: groups and layers. + +*Groups* are meant to ignore collisions between parts on a complex object. A ragdoll is a good example. When jointing an arm onto the torso, you'll want them to allow them to overlap. Groups allow you to do exactly that. Shapes that have the same group don't generate collisions. So by placing all of the shapes in a ragdoll in the same group, you'll prevent it from colliding against other parts of itself. + +*Layers* allow you to separate collision shapes into mutually exclusive planes. Shapes can be in more than one layer, and shapes only collide with other shapes that are in at least one of the same layers. As a simple example, say shape A is in layer 1, shape B is in layer 2, and shape C is in layer 1 and 2. Shape A and B won't collide with each other, but shape C will collide with both A and B. + +Layers can also be used to set up rule based collisions. Say you have four types of shapes in your game. The player, the enemies, player bullets and enemy bullets. The are that the player should collide with enemies, and bullets shouldn't collide with the type (player or enemy) that fired them. Making a chart would look like this: + +| | Player | Enemy | Player Bullet | Enemy Bullet | +| Player | - | (1) | | (2) | +| Enemy | - | - | (3) | | +| Player Bullet | - | - | - | | +| Enemy Bullet | - | - | - | - | + +The '-'s are for redundant spots in the chart, and the numbers are spots where types should collide. You can use a layer for each rule that you want to define. Then add the layers to each type: The player should be in layers 1 and 2, the enemy should be in layers 1 and 3, the player bullets should be in layer 3, and the enemy bullets should be in layer 2. Treating layers as rules this way, you can define up to 32 rules. The default @cpLayers@ type is @unsigned int@ which has a resolution of 32 bits on most systems. You can redefine the @cpLayers@ type in @chipmunk_types.h@ if you need more bits to work with. + +There is one last way of filtering collisions using collision handlers. See the "section on callbacks":#Callbacks for more information. While collision handlers can be more flexible, they are also the slowest method. So you try to use groups or layers first. + +<%= h 2, "Memory Management Functions:", "Memory" %> + +
    void cpShapeDestroy(cpShape *shape)
    +void cpShapeFree(cpShape *shape)
    + +p(expl). @Destroy@ and @Free@ functions are shared by all shape types. Allocation and initialization functions are specific to each shape type. See below. + +<%= h 2, "Misc Functions:", "Misc" %> + +* @cpBB cpShapeCacheBB(cpShape *shape)@ - Synchronizes @shape@ with the body its attached to. +* @cpBB cpShapeUpdate(cpShape *shape, cpVect pos, cpVect rot)@ - Sets the position and rotation of the shape to +* @void cpResetShapeIdCounter(void)@ - Chipmunk keeps a counter so that every new shape is given a unique hash value to be used in the spatial index. Because this affects the order in which the collisions are found and handled, you can reset the shape counter every time you populate a space with new shapes. If you don't, there might be (very) slight differences in the simulation. + +<%= h 2, "Working With Circle Shapes:", "Circles" %> + +
    cpCircleShape *cpCircleShapeAlloc(void)
    +cpCircleShape *cpCircleShapeInit(cpCircleShape *circle, cpBody *body, cpFloat radius, cpVect offset)
    +cpShape *cpCircleShapeNew(cpBody *body, cpFloat radius, cpVect offset)
    + +p(expl). @body@ is the body to attach the circle to, @offset@ is the offset from the body's center of gravity in body local coordinates. + +
    cpVect cpCircleShapeGetOffset(cpShape *circleShape)
    +cpFloat cpCircleShapeGetRadius(cpShape *circleShape)
    + +p(expl). Getters for circle shape properties. Passing as non-circle shape will throw an assertion. + +<%= h 2, "Working With Segment Shapes:", "Segments" %> + +
    cpSegmentShape* cpSegmentShapeAlloc(void)
    +cpSegmentShape* cpSegmentShapeInit(cpSegmentShape *seg, cpBody *body, cpVect a, cpVect b, cpFloat radius)
    +cpShape* cpSegmentShapeNew(cpBody *body, cpVect a, cpVect b, cpFloat radius)
    + +p(expl). @body@ is the body to attach the segment to, @a@ and @b@ are the endpoints, and @radius@ is the thickness of the segment. + +
    cpVect cpSegmentShapeGetA(cpShape *shape)
    +cpVect cpSegmentShapeGetA(cpShape *shape)
    +cpVect cpSegmentShapeGetNormal(cpShape *shape)
    +cpFloat cpSegmentShapeGetRadius(cpShape *shape)
    + +p(expl). Getters for segment shape properties. Passing a non-segment shape will throw an assertion. + +
    void cpSegmentShapeSetNeighbors(cpShape *shape, cpVect prev, cpVect next)
    + +p(expl). When you have a number of segment shapes that are all joined together, things can still collide with the "cracks" between the segments. By setting the neighbor segment endpoints you can tell Chipmunk to avoid colliding with the inner parts of the crack. + +<%= h 2, "Working With Polygon Shapes:", "Polys" %> + +
    cpPolyShape *cpPolyShapeAlloc(void)
    +cpPolyShape *cpPolyShapeInit(cpPolyShape *poly, cpBody *body, int count, cpVect *verts, cpVect offset)
    +cpShape *cpPolyShapeNew(cpBody *body, int count, cpVect *verts, cpVect offset)
    + +p(expl). @body@ is the body to attach the poly to, @verts@ is an array of @cpVect@ structs defining a convex hull with a clockwise winding, @offset@ is the offset from the body's center of gravity in body local coordinates. An assertion will be thrown the vertexes are not convex or do not have a clockwise winding. + +
    cpPolyShape *cpPolyShapeInit2(cpPolyShape *poly, cpBody *body, int numVerts, const cpVect *verts, cpVect offset, cpFloat radius)
    +cpShape *cpPolyShapeNew2(cpBody *body, int numVerts, cpVect *verts, cpVect offset, cpFloat radius)
    + +p(expl). Same as above, but allows you to create a polygon shape with a radius. _(I know the naming is sort of dumb. It will be cleaned up in Chipmunk 7)_ + +
    int cpPolyShapeGetNumVerts(cpShape *shape)
    +cpVect cpPolyShapeGetVert(cpShape *shape, int index)
    +cpFloat cpPolyShapeGetRadius()
    + +p(expl). Getters for poly shape properties. Passing a non-poly shape or an index that does not exist will throw an assertion. + +<%= h 3, "Boxes:", "Boxes" %> + +Because boxes are so common in physics games, Chipmunk provides shortcuts to create box shaped polygons. The boxes will always be centered at the center of gravity of the body you are attaching them to. If you want to create an off-center box, you will need to use @cpPolyShapeNew()@ or @cpPolyShapeInit()@. + +
    cpPolyShape *cpBoxShapeInit(cpPolyShape *poly, cpBody *body, cpFloat width, cpFloat height)
    +cpPolyShape *cpBoxShapeInit2(cpPolyShape *poly, cpBody *body, cpBB box)
    +cpPolyShape *cpBoxShapeInit3(cpPolyShape *poly, cpBody *body, cpBB box, cpFloat radius)
    +
    +cpShape *cpBoxShapeNew(cpBody *body, cpFloat width, cpFloat height)
    +cpShape *cpBoxShapeNew2(cpBody *body, cpBB box)
    +cpShape *cpBoxShapeNew3(cpBody *body, cpBB box, cpFloat radius)
    + +<%= h 3, "Poly Shape Helper Functions:", "PolyHelpers" %> + +* @cpBool cpPolyValidate(const cpVect *verts, const int count)@ - Check if a vertex array is convex and with the correct winding. +* @cpVect cpCentroidForPoly(const int count, const cpVect *verts)@ - Calculate the centroid for a polygon. +* @void cpRecenterPoly(const int count, cpVect *verts)@ - Center a polygon to (0,0). Subtracts the centroid from each vertex. + +<%= h 3, "Convex Hull Helper Functions:", "ConvexHelpers" %> + +
    int cpConvexHull(int count, cpVect *verts, cpVect *result, int *first, cpFloat tol)
    + +p(expl). Calculate the convex hull of a given set of points. Returns the count of points in the hull. @result@ must be a pointer to a @cpVect@ array with at least @count@ elements. If @result@ is @NULL@, then @verts@ array wil be reduced instead. @first@ is an optional pointer to an integer to store where the first vertex in the hull came from (i.e. @verts[first] == result[0]@) @tol@ is the allowed amount to shrink the hull when simplifying it. A tolerance of 0.0 creates an exact hull. + +
    #define CP_CONVEX_HULL(inputCount, inputVerts, outputCount_varName, outputVerts_varName)
    + +p(expl). Convenience macro for using @cpConvexHull()@. Creates an array on the stack using @alloca()@ and then calls @cpConvexHull()@. Because the output array is created on the stack it doesn't need to be freed. + +<%= pop_open_example "cpConvexHull" %> + + +<%= h 2, "Modifying cpShapes:", "Modifing" %> + +The short answer is that you can't because the changes would be only picked up as a change to the position of the shape's surface, but not it's velocity. The long answer is that you can using the "unsafe" API as long as you realize that doing so will not result in realistic physical behavior. These extra functions are defined in a separate header @chipmunk_unsafe.h@. + +<%= h 2, "Notes:", "Notes" %> + +* You can attach multiple collision shapes to a rigid body. This should allow you to create almost any shape you could possibly need. +* Shapes attached to the same rigid body will never generate collisions. You don't have to worry about overlap when attaching multiple shapes to a rigid body. +* Make sure you add both the body and it's collision shapes to a space. The exception is when you want to have an externally body or a body that you integrate yourself. In that case, only add the shape. + +<%= h 1, "Chipmunk Spaces: @cpSpace@", "cpSpace" %> + +Spaces in Chipmunk are the basic unit of simulation. You add rigid bodies, shapes and constraints to it and then step them all forward through time together. + +<%= h 2, "What Are Iterations, and Why Should I care?", "Iterations" %> + +Chipmunk uses an iterative solver to figure out the forces between objects in the space. What this means is that it builds a big list of all of the collisions, joints, and other constraints between the bodies and makes several passes over the list considering each one individually. The number of passes it makes is the iteration count, and each iteration makes the solution more accurate. If you use too many iterations, the physics should look nice and solid, but may use up too much CPU time. If you use too few iterations, the simulation may seem mushy or bouncy when the objects should be solid. Setting the number of iterations lets you balance between CPU usage and the accuracy of the physics. Chipmunk's default of 10 iterations is sufficient for most simple games. + +<%= h 2, "Sleeping", "Sleeping" %> + +New in Chipmunk 5.3 is the ability of spaces to disable entire groups of objects that have stopped moving to save CPU time as well as battery life. In order to use this feature you must do 2 things. The first is that you must attach all your static geometry to static bodies. Objects cannot fall asleep if they are touching a non-static rogue body even if it's shapes were added as static shapes. The second is that you must enable sleeping explicitly by choosing a time threshold value for @cpSpace.sleepTimeThreshold@. If you do not set @cpSpace.idleSpeedThreshold@ explicitly, a value will be chosen automatically based on the current amount of gravity. + +<%= h 2, "Properties:", "Properties" %> + +
    int cpSpaceGetIterations(const cpSpace *space)
    +void cpSpaceSetIterations(cpSpace *space, int value)
    + +p(expl). Iterations allow you to control the accuracy of the solver. Defaults to 10. See "above":#cpSpace-Iterations for more information. + +
    cpVect cpSpaceGetGravity(const cpSpace *space)
    +void cpSpaceSetGravity(cpSpace *space, cpVect value)
    + +p(expl). Global gravity applied to the space. Defaults to @cpvzero@. Can be overridden on a per body basis by writing custom integration functions. + +
    cpFloat cpSpaceGetDamping(const cpSpace *space)
    +void cpSpaceSetDamping(cpSpace *space, cpFloat value)
    + +p(expl). Amount of simple damping to apply to the space. A value of 0.9 means that each body will lose 10% of it's velocity per second. Defaults to 1. Like @gravity@ can be overridden on a per body basis. + +
    cpFloat cpSpaceGetIdleSpeedThreshold(const cpSpace *space)
    +void cpSpaceSetIdleSpeedThreshold(cpSpace *space, cpFloat value)
    + +p(expl). Speed threshold for a body to be considered idle. The default value of 0 means to let the space guess a good threshold based on gravity. + +
    cpFloat cpSpaceGetSleepTimeThreshold(const cpSpace *space)
    +void cpSpaceSetSleepTimeThreshold(cpSpace *space, cpFloat value)
    + +p(expl). Time a group of bodies must remain idle in order to fall asleep. The default value of @INFINITY@ disables the sleeping feature. + +
    cpFloat cpSpaceGetCollisionSlop(const cpSpace *space)
    +void cpSpaceSetCollisionSlop(cpSpace *space, cpFloat value)
    + +p(expl). Amount of overlap between shapes that is allowed. It's encouraged to set this as high as you can without noticable overlapping as it improves the stability. It defaults to 0.1. + +
    cpFloat cpSpaceGetCollisionBias(const cpSpace *space)
    +void cpSpaceSetCollisionBias(cpSpace *space, cpFloat value)
    + +p(expl). Chipmunk allows fast moving objects to overlap, then fixes the overlap over time. Overlapping objects are unavoidable even if swept collisions are supported, and this is an efficient and stable way to deal with overlapping objects. The bias value controls what percentage of overlap remains unfixed after a second and defaults to ~0.2%. Valid values are in the range from 0 to 1, but using 0 is not recommended for stability reasons. The default value is calculated as @cpfpow(1.0f - 0.1f, 60.0f)@ meaning that Chipmunk attempts to correct 10% of error ever 1/60th of a second. *Note:* Very very few games will need to change this value. + +
    cpTimestamp cpSpaceGetCollisionPersistence(const cpSpace *space)
    +void cpSpaceSetCollisionPersistence(cpSpace *space, cpTimestamp value)
    + +p(expl). The number of frames the space keeps collision solutions around for. Helps prevent jittering contacts from getting worse. This defaults to 3 and very very _very_ few games will need to change this value. + +
    cpFloat cpSpaceGetCurrentTimeStep(const cpSpace *space)
    + +p(expl). Retrieves the current (if you are in a callback from @cpSpaceStep()@) or most recent (outside of a @cpSpaceStep()@ call) timestep. + +
    cpFloat cpSpaceIsLocked(const cpSpace *space)
    + +p(expl). Returns true when in a callback meaning that you cannot add/remove objects from the space. Can be used to choose to create a post-step callback instead. + +
    cpDataPointer cpSpaceGetUserData(const cpSpace *space)
    +void cpSpaceSetUserData(cpSpace *space, cpDataPointer value)
    + +p(expl). A user definable data pointer. It's useful to point this at the gamestate object or scene management object that owns the space. + +
    cpBody * cpSpaceGetStaticBody(const cpSpace *space)
    + +p(expl). A dedicated static body for the space. You don't have to use it, but because it's memory is managed automatically with the space it's very convenient. You can set its user data pointer to something helpful if you want for callbacks. + + +<%= h 2, "Memory Management Functions:", "Memory" %> + +
    cpSpace* cpSpaceAlloc(void)
    +cpSpace* cpSpaceInit(cpSpace *space)
    +cpSpace* cpSpaceNew()
    +
    +void cpSpaceDestroy(cpSpace *space)
    +void cpSpaceFree(cpSpace *space)
    + +p(expl). More standard Chipmunk memory functions. + +
    void cpSpaceFreeChildren(cpSpace *space)
    + +p(expl). This function will free all of the shapes, bodies and joints that have been added to @space@. Does not free @space@. You will still need to call @cpSpaceFree()@ on your own. You will probably never use this in a real game, as your gamestate or game controller should manage removing and freeing objects from the space. + +<%= h 2, "Operations:", "Operations" %> + +
    cpShape *cpSpaceAddShape(cpSpace *space, cpShape *shape)
    +cpShape *cpSpaceAddStaticShape(cpSpace *space, cpShape *shape)
    +cpBody *cpSpaceAddBody(cpSpace *space, cpBody *body)
    +cpConstraint *cpSpaceAddConstraint(cpSpace *space, cpConstraint *constraint)
    +
    +void cpSpaceRemoveShape(cpSpace *space, cpShape *shape)
    +void cpSpaceRemoveBody(cpSpace *space, cpBody *body)
    +void cpSpaceRemoveConstraint(cpSpace *space, cpConstraint *constraint)
    +
    +cpBool cpSpaceContainsShape(cpSpace *space, cpShape *shape)
    +cpBool cpSpaceContainsBody(cpSpace *space, cpBody *body)
    +cpBool cpSpaceContainsConstraint(cpSpace *space, cpConstraint *constraint)
    + +p(expl). These functions add and remove shapes, bodies and constraints from @space@. The add/remove functions cannot be called from within a callback other than a @postStep()@ callback _(which is different than a postSolve() callback!)_. Attempting to add or remove objects from the space while @cpSpaceStep()@ is still executing will throw an assertion. See the "callbacks section":#Callbacks for more information. The add functions return the thing being added so that you can create and add something in one line. Be careful not to free bodies before removing shapes and constraints attached to them or you will cause crashes.. The contains functions allow you to check if an object has been added to the space or not. + + +<%= h 2, "Static ↔ Dynamic conversion Functions:", "Static <-> Dynamic Conversion" %> + +
    void cpSpaceConvertBodyToStatic(cpSpace *space, cpBody *body)
    + +p(expl). Convert a body to a static one. It's mass and moment will be set to infinity and it's velocity to 0. The old mass, moment and velocity are not saved. This will effectively freeze a body and it's shapes into place. This cannot be called on an active body, so you may need to call @cpSpaceRemoveBody()@ first. Also, because it modifies collision detection data structures, you must use a post step callback if you want to use it from another callback or iterator. + +
    void cpSpaceConvertBodyToDynamic(cpSpace *space, cpBody *body, cpFloat mass, cpFloat moment)
    + +p(expl). Convert a static to a dynamic one. This does not call @cpSpaceAddBody()@ to make the body active, so you will need to do that explicitly if you need it. Also, because it modifies collision detection data structures, you must use a post step callback if you want to use it from another callback or iterator. + +<%= pop_open_example "DynamicStatic" %> + + +<%= h 3, "Deprecated:", "Deprecated" %> + +
    cpShape *cpSpaceAddStaticShape(cpSpace *space, cpShape *shape)
    +void cpSpaceRemoveStaticShape(cpSpace *space, cpShape *shape)
    + +p(expl). Shapes attached to static bodies are automatically treated as static. There isn't really a good reason to explicitly add static shapes anymore. + +* @void cpSpaceActivateShapesTouchingShape(cpSpace *space, cpShape *shape)@ - Use @cpBodyActivateStatic()@ instead. + + +<%= h 2, "Spatial Indexing:", "SpatialIndexing" %> + +Chipmunk 6 officially supports 2 spatial indexes. The default is an axis-aligned bounding box tree inspired by the one used in the Bullet Physics library, but extended with my own collision pair caching to give the tree very good temporal coherence. The tree requires no tuning, and most games will find that they get much better performance using it. The other available index available is a spatial hash, which can be much faster when you have a very large number (1000s) of objects that are all the same size. + +Occasionally, you might want to update the collision detection data for a shape. If you move a static shape or a static body you *must* do this to let Chipmunk know it needs to have it's collision detection data updated. You may also want to manually update the collision data for normal shapes if you move them and still want to perform queries. + +* @void cpSpaceReindexShape(cpSpace *space, cpShape *shape)@ - Reindex a specific shape. +* @void cpSpaceReindexShapesForBody(cpSpace *space, cpBody *body)@ - Reindex all the shapes for a certain body. +* @void cpSpaceReindexStatic(cpSpace *space)@ - Reindex all static shapes. Generally updating only the shapes that changed is faster. + + +<%= h 2, "Iterators:", "Iterators" %> + +
    typedef void (*cpSpaceBodyIteratorFunc)(cpBody *body, void *data)
    +void cpSpaceEachBody(cpSpace *space, cpSpaceBodyIteratorFunc func, void *data)
    + +p(expl). Call @func@ for each body in the space also passing along your data pointer. Sleeping bodies are included, but static and rogue bodies are not as they aren't added to the space. + +<%= pop_open_example "cpSpaceEachBody" %> + +
    typedef void (*cpSpaceShapeIteratorFunc)(cpShape *shape, void *data)
    +void cpSpaceEachShape(cpSpace *space, cpSpaceShapeIteratorFunc func, void *data)
    + +p(expl). Call @func@ for each shape in the space also passing along your data pointer. Sleeping and static shapes are included. + +
    typedef void (*cpSpaceConstraintIteratorFunc)(cpConstraint *constraint, void *data)
    +void cpSpaceEachConstraint(cpSpace *space, cpSpaceConstraintIteratorFunc func, void *data)
    + +p(expl). Call @func@ for each constraint in the space also passing along your data pointer. + +*Note:* If your compiler supports blocks (such as Clang), there are an alternate set of functions you can call. @cpSpaceEachBody_b()@, etc. See @chipmunk.h@ for more information. + +<%= h 2, "Simulating the Space:", "Simulating" %> + +
    void cpSpaceStep(cpSpace *space, cpFloat dt)
    + +p(expl). Update the space for the given time step. Using a fixed time step is _highly_ recommended. Doing so can greatly increase the quality of the simulation. The easiest way to do constant timesteps is to simple step forward by 1/60th of a second (or whatever your target framerate is) for each frame regardless of how long it took to render. This works fine for many games, but a better way to do it is to separate your physics timestep and rendering. "This":http://gafferongames.com/game-physics/fix-your-timestep/ is a good article on how to do that. + + +<%= h 2, "Enabling and Tuning the Spatial Hash:", "SpatialHash" %> + +If you have thousands of objects that are all approximately the same size, the spatial hash may be for you. + +
    void cpSpaceUseSpatialHash(cpSpace *space, cpFloat dim, int count)
    + +p(expl). Switch the space to use a spatial hash instead of the bounding box tree. + +The spatial hash data is fairly size sensitive. @dim@ is the size of the hash cells. Setting @dim@ to the average collision shape size is likely to give the best performance. Setting @dim@ too small will cause the shape to be inserted into many cells, setting it too low will cause too many objects into the same hash slot. + +@count@ is the _suggested_ minimum number of cells in the hash table. If there are too few cells, the spatial hash will return many false positives. Too many cells will be hard on the cache and waste memory. the Setting @count@ to ~10x the number of objects in the space is probably a good starting point. Tune from there if necessary. + +Using the spatial has visualization in the demo program you can see what I mean. The grey squares represent cells in the spatial hash. The darker the cell, the more objects have been mapped into that cell. A good @dim@ size is when your objects fit nicely into the grid: + +!images/hash_just_right.png! + +Notice the light grey meaning that each cell doesn't have too many objects mapped onto it. + +When you use too small a size, Chipmunk has to insert each object into a lot of cells. This can get expensive. + +!images/hash_too_small.png! + +Notice that the grey cells are very small compared to the collision shapes. + +When you use too big of a size, a lot of shapes will fit into each cell. Each shape has to be checked against every other shape in the cell, so this makes for a lot of unnecessary collision checks. + +!images/hash_too_big.png! + +Notice the dark grey cells meaning that many objects are mapped onto them. + + +Chipmunk 6 also has an experimental single axis sort and sweep implementation. It can be very efficient on mobile games if your world is very long and flat like a racing game. See the code for @cpSpaceUseSpatialHash()@ if you want to try enabling it. + + +<%= h 2, "Notes:", "Notes" %> + +* When removing objects from the space, make sure you remove any other objects that reference it. For instance, when you remove a body, remove the joints and shapes attached to it. +* The number of iterations, and the size of the time step determine the quality of the simulation. More iterations, or smaller time steps increase the quality. Keep in mind that higher quality also means higher CPU usage. +* Because static shapes are only rehashed when you request it, it's possible to use a much higher @count@ argument to @cpHashResizeStaticHash()@ than to @cpSpaceResizeActiveHash()@. Doing so will use more memory but can improve performance if you have a lot of static shapes. + + +<%= h 1, "Chipmunk Constraints: @cpConstraint@", "cpConstraint" %> + +A constraint is something that describes how two bodies interact with each other. (how they constrain each other) Constraints can be simple joints that allow bodies to pivot around each other like the bones in your body, or they can be more abstract like the gear joint or motors. + +<%= h 2, "What constraints are and what they are not:", "WhatIs" %> + +Constraints in Chipmunk are all velocity based constraints. This means that they act primarily by synchronizing the velocity of two bodies. A pivot joint holds two anchor points on two separate bodies together by defining equations that say that the velocity of the anchor points must be the same and calculating impulses to apply to the bodies to try and keep it that way. A constraint takes a velocity as it's primary input and produces a velocity change as it's output. Some constraints, (joints in particular) apply velocity changes to correct differences in positions. More about this in the next section. + +A spring connected between two bodies is not a constraint. It's very constraint-like as it creates forces that affect the velocities of the two bodies, but a spring takes distances as input and produces forces as it's output. If a spring is not a constraint, then why do I have two varieties of spring constraints you ask? The reason is because they are _damped springs_. The damping associated with the spring is a true constraint that creates velocity changes based on the relative velocities of the two bodies it links. As it is convenient to put a damper and a spring together most of the time, I figured I might as well just apply the spring force as part of the constraint instead of having a damper constraint and having the user calculate and apply their own spring forces separately. + +<%= h 2, "Properties:", "Properties" %> + +
    cpBody * cpConstraintGetA(const cpConstraint *constraint)
    +cpBody * cpConstraintGetB(const cpConstraint *constraint)
    + +p(expl). Getters for the two bodies the constraint is attached to. + +
    cpFloat cpConstraintGetMaxForce(const cpConstraint *constraint)
    +void cpConstraintSetMaxForce(cpConstraint *constraint, cpFloat value)
    + +p(expl). The maximum force that the constraint can use to act on the two bodies. Defaults to INFINITY. + +
    cpFloat cpConstraintGetErrorBias(const cpConstraint *constraint)
    +void cpConstraintSetErrorBias(cpConstraint *constraint, cpFloat value)
    + +p(expl). The percentage of joint error that remains unfixed after a second. This works exactly the same as the collision bias property of a space, but applies to fixing error (stretching) of joints instead of overlapping collisions. + +
    cpFloat cpConstraintGetMaxBias(const cpConstraint *constraint)
    +void cpConstraintSetMaxBias(cpConstraint *constraint, cpFloat value)
    + +p(expl). The maximum speed at which the constraint can apply error correction. Defaults to INFINITY. + +
    cpSpace* cpConstraintGetSpace(const cpConstraint *constraint)
    + +p(expl). Get the @cpSpace@ that @constraint@ has been added to. + +
    cpDataPointer cpConstraintGetUserData(const cpConstraint *constraint)
    +void cpConstraintSetUserData(cpConstraint *constraint, cpDataPointer value)
    + +p(expl). User data pointer. Use this pointer to get a reference to the game object that owns this constraint from callbacks. + +
    cpFloat cpConstraintGetImpulse(cpConstraint *constraint)
    + +p(expl). The most recent impulse that @constraint@ applied. To convert this to a force, divide by the timestep passed to @cpSpaceStep()@. You can use this to implement breakable joints to check if the force they attempted to apply exceeded a certain threshold. + +<%= pop_open_example "BreakableJoint" %> + +To access properties of specific joint types, use the getter and setter functions provided (ex: @cpPinJointGetAnchr1()@). See the lists of properties for more information. + +<%= h 2, "Error correction by Feedback:", "ErrorCorrection" %> + +Joints in Chipmunk are not perfect. A pin joint can't maintain the exact correct distance between it's anchor points, nor can a pivot joint hold it's anchor points completely together. Instead, they are designed to deal with this by correcting themselves over time. In Chipmunk 5, you have a fair amount of extra control over how joints correct themselves and can even use this ability to create physical effects that allow you to use joints in unique ways: + +* Servo motors - Ex: open/close doors or rotate things without going over a maximum force. +* Winches - Pull one object towards another at a constant speed without going over a maximum force. +* Mouse manipulation - Interact with objects smoothly given coarse/shaky mouse input. + +There are three properties of cpConstraint structs that control the error correction, @maxForce@, @maxBias@, and @biasCoef@. @maxForce@ is pretty self explanatory, a joint or constraint will not be able to use more than this amount of force in order to function. If it needs more force to be able to hold itself together, it will fall apart. @maxBias@ is the maximum speed at which error correction can be applied. If you change a property on a joint so that the joint will have to correct itself, it normally does so very quickly. By setting a maxSpeed you can make the joint work like a servo, correcting itself at a constant rate over a longer period of time. Lastly, @biasCoef@ is the percentage of error corrected every step before clamping to a maximum speed. You can use this to make joints correct themselves smoothly instead of at a constant speed, but is probably the least useful of the three properties by far. + + + +<%= pop_open_example "JointRecipies" %> + +<%= h 2, "Constraints and Collision Shapes:", "Shapes" %> + +Neither constraints or collision shapes have any knowledge of the other. When connecting joints to a body the anchor points don't need to be inside of any shapes attached to the body and it often makes sense that they shouldn't. Also, adding a constraint between two bodies doesn't prevent their collision shapes from colliding. In fact, this is the primary reason that the collision group property exists. + +<%= h 2, "Video Tour of Current Joint Types. (Requires connection to YouTube)", "Video" %> + + + +<%= h 2, "Shared Memory Management Functions:", "Memory" %> + +
    void cpConstraintDestroy(cpConstraint *constraint)
    +void cpConstraintFree(cpConstraint *constraint)
    + +p(expl). @Destroy@ and @Free@ functions are shared by all joint types. Allocation and initialization functions are specific to each joint type. + +<%= h 1, "Constraint Types:", "ConstraintTypes" %> + +<%= h 2, "Pin Joints:", "cpPinJoint" %> + +
    cpPinJoint *cpPinJointAlloc(void)
    +cpPinJoint *cpPinJointInit(cpPinJoint *joint, cpBody *a, cpBody *b, cpVect anchr1, cpVect anchr2)
    +cpConstraint *cpPinJointNew(cpBody *a, cpBody *b, cpVect anchr1, cpVect anchr2)
    + +p(expl). @a@ and @b@ are the two bodies to connect, and @anchr1@ and @anchr2@ are the anchor points on those bodies. The distance between the two anchor points is measured when the joint is created. If you want to set a specific distance, use the setter function to override it. + +<%= h 3, "Properties", "Properties" %> + +* @cpVect cpPinJointGetAnchr1(const cpConstraint *constraint)@ +* @void cpPinJointSetAnchr1(cpConstraint *constraint, cpVect value)@ +* @cpVect cpPinJointGetAnchr2(const cpConstraint *constraint)@ +* @void cpPinJointSetAnchr2(cpConstraint *constraint, cpVect value)@ +* @cpFloat cpPinJointGetDist(const cpConstraint *constraint)@ +* @void cpPinJointSetDist(cpConstraint *constraint, cpFloat value)@ + +<%= h 2, "Slide Joints:", "cpSlideJoint" %> + +
    cpSlideJoint *cpSlideJointAlloc(void)
    +
    +cpSlideJoint *cpSlideJointInit(
    +	cpSlideJoint *joint, cpBody *a, cpBody *b,
    +	cpVect anchr1, cpVect anchr2, cpFloat min, cpFloat max
    +)
    +
    +cpConstraint *cpSlideJointNew(cpBody *a, cpBody *b, cpVect anchr1, cpVect anchr2, cpFloat min, cpFloat max)
    + +p(expl). @a@ and @b@ are the two bodies to connect, @anchr1@ and @anchr2@ are the anchor points on those bodies, and @min@ and @max@ define the allowed distances of the anchor points. + +<%= h 3, "Properties", "Properties" %> + +* @cpVect cpSlideJointGetAnchr1(const cpConstraint *constraint)@ +* @void cpSlideJointSetAnchr1(cpConstraint *constraint, cpVect value)@ +* @cpVect cpSlideJointGetAnchr2(const cpConstraint *constraint)@ +* @void cpSlideJointSetAnchr2(cpConstraint *constraint, cpVect value)@ +* @cpFloat cpSlideJointGetMin(const cpConstraint *constraint)@ +* @void cpSlideJointSetMin(cpConstraint *constraint, cpFloat value)@ +* @cpFloat cpSlideJointGetMax(const cpConstraint *constraint)@ +* @void cpSlideJointSetMax(cpConstraint *constraint, cpFloat value)@ + +<%= h 2, "Pivot Joints:", "cpPivotJoint" %> + +
    cpPivotJoint *cpPivotJointAlloc(void)
    +cpPivotJoint *cpPivotJointInit(cpPivotJoint *joint, cpBody *a, cpBody *b, cpVect pivot)
    +cpConstraint *cpPivotJointNew(cpBody *a, cpBody *b, cpVect pivot)
    +cpConstraint *cpPivotJointNew2(cpBody *a, cpBody *b, cpVect anchr1, cpVect anchr2)
    + +p(expl). @a@ and @b@ are the two bodies to connect, and @pivot@ is the point in world coordinates of the pivot. Because the pivot location is given in world coordinates, you must have the bodies moved into the correct positions already. Alternatively you can specify the joint based on a pair of anchor points, but make sure you have the bodies in the right place as the joint will fix itself as soon as you start simulating the space. + +<%= h 3, "Properties", "Properties" %> + +* @cpVect cpPivotJointGetAnchr1(const cpConstraint *constraint)@ +* @void cpPivotJointSetAnchr1(cpConstraint *constraint, cpVect value)@ +* @cpVect cpPivotJointGetAnchr2(const cpConstraint *constraint)@ +* @void cpPivotJointSetAnchr2(cpConstraint *constraint, cpVect value)@ + +<%= h 2, "Groove Joint:", "cpGrooveJoint" %> + +
    cpGrooveJoint *cpGrooveJointAlloc(void)
    +
    +cpGrooveJoint *cpGrooveJointInit(
    +	cpGrooveJoint *joint, cpBody *a, cpBody *b,
    +	cpVect groove_a, cpVect groove_b, cpVect anchr2
    +)
    +
    +cpConstraint *cpGrooveJointNew(cpBody *a, cpBody *b, cpVect groove_a, cpVect groove_b, cpVect anchr2)
    + +p(expl). The groove goes from @groov_a@ to @groove_b@ on body @a@, and the pivot is attached to @anchr2@ on body @b@. All coordinates are body local. + +<%= h 3, "Properties", "Properties" %> + +* @cpVect cpGrooveJointGetGrooveA(const cpConstraint *constraint)@ +* @void cpGrooveJointSetGrooveA(cpConstraint *constraint, cpVect value)@ +* @cpVect cpGrooveJointGetGrooveB(const cpConstraint *constraint)@ +* @void cpGrooveJointSetGrooveB(cpConstraint *constraint, cpVect value)@ +* @cpVect cpGrooveJointGetAnchr2(const cpConstraint *constraint)@ +* @void cpGrooveJointSetAnchr2(cpConstraint *constraint, cpVect value)@ + +<%= h 2, "Damped Spring:", "cpDampedSpring" %> + +
    cpDampedSpring *cpDampedSpringAlloc(void)
    +
    +cpDampedSpring *cpDampedSpringInit(
    +	cpDampedSpring *joint, cpBody *a, cpBody *b, cpVect anchr1, cpVect anchr2,
    +	cpFloat restLength, cpFloat stiffness, cpFloat damping
    +)
    +
    +cpConstraint *cpDampedSpringNew(
    +	cpBody *a, cpBody *b, cpVect anchr1, cpVect anchr2,
    +	cpFloat restLength, cpFloat stiffness, cpFloat damping
    +)
    + +p(expl). Defined much like a slide joint. @restLength@ is the distance the spring wants to be, @stiffness@ is the spring constant ("Young's modulus":http://en.wikipedia.org/wiki/Young's_modulus), and @damping@ is how soft to make the damping of the spring. + +<%= h 3, "Properties", "Properties" %> + +* @cpVect cpDampedSpringGetAnchr1(const cpConstraint *constraint)@ +* @void cpDampedSpringSetAnchr1(cpConstraint *constraint, cpVect value)@ +* @cpVect cpDampedSpringGetAnchr2(const cpConstraint *constraint)@ +* @void cpDampedSpringSetAnchr2(cpConstraint *constraint, cpVect value)@ +* @cpFloat cpDampedSpringGetRestLength(const cpConstraint *constraint)@ +* @void cpDampedSpringSetRestLength(cpConstraint *constraint, cpFloat value)@ +* @cpFloat cpDampedSpringGetStiffness(const cpConstraint *constraint)@ +* @void cpDampedSpringSetStiffness(cpConstraint *constraint, cpFloat value)@ +* @cpFloat cpDampedSpringGetDamping(const cpConstraint *constraint)@ +* @void cpDampedSpringSetDamping(cpConstraint *constraint, cpFloat value)@ + +<%= h 2, "Damped Rotary Spring:", "cpDampedRotarySpring" %> + +
    cpDampedRotarySpring *cpDampedRotarySpringAlloc(void)
    +
    +cpDampedRotarySpring *cpDampedRotarySpringInit(
    +	cpDampedRotarySpring *joint, cpBody *a, cpBody *b,
    +	cpFloat restAngle, cpFloat stiffness, cpFloat damping
    +)
    +
    +cpConstraint *cpDampedRotarySpringNew(cpBody *a, cpBody *b, cpFloat restAngle, cpFloat stiffness, cpFloat damping)
    + +p(expl). Like a damped spring, but works in an angular fashion. @restAngle@ is the relative angle in radians that the bodies want to have, @stiffness@ and @damping@ work basically the same as on a damped spring. + +<%= h 3, "Properties", "Properties" %> + +* @cpFloat cpDampedRotarySpringGetRestAngle(const cpConstraint *constraint)@ +* @void cpDampedRotarySpringSetRestAngle(cpConstraint *constraint, cpFloat value)@ +* @cpFloat cpDampedRotarySpringGetStiffness(const cpConstraint *constraint)@ +* @void cpDampedRotarySpringSetStiffness(cpConstraint *constraint, cpFloat value)@ +* @cpFloat cpDampedRotarySpringGetDamping(const cpConstraint *constraint)@ +* @void cpDampedRotarySpringSetDamping(cpConstraint *constraint, cpFloat value)@ + +<%= h 2, "Rotary Limit Joint:", "cpRotaryLimitJoint" %> + +
    cpRotaryLimitJoint *cpRotaryLimitJointAlloc(void)
    +cpRotaryLimitJoint *cpRotaryLimitJointInit(cpRotaryLimitJoint *joint, cpBody *a, cpBody *b, cpFloat min, cpFloat max)
    +cpConstraint *cpRotaryLimitJointNew(cpBody *a, cpBody *b, cpFloat min, cpFloat max)
    + +p(expl). Constrains the relative rotations of two bodies. @min@ and @max@ are the angular limits in radians. It is implemented so that it's possible to for the range to be greater than a full revolution. + +<%= h 3, "Properties", "Properties" %> + +* @cpFloat cpRotaryLimitJointGetMin(const cpConstraint *constraint)@ +* @void cpRotaryLimitJointSetMin(cpConstraint *constraint, cpFloat value)@ +* @cpFloat cpRotaryLimitJointGetMax(const cpConstraint *constraint)@ +* @void cpRotaryLimitJointSetMax(cpConstraint *constraint, cpFloat value)@ + +<%= h 2, "Ratchet Joint:", "cpRatchetJoint" %> + +
    cpRatchetJoint *cpRatchetJointAlloc(void);
    +cpRatchetJoint *cpRatchetJointInit(cpRatchetJoint *joint, cpBody *a, cpBody *b, cpFloat phase, cpFloat ratchet);
    +cpConstraint *cpRatchetJointNew(cpBody *a, cpBody *b, cpFloat phase, cpFloat ratchet);
    + +p(expl). Works like a socket wrench. @ratchet@ is the distance between "clicks", @phase@ is the initial offset to use when deciding where the ratchet angles are. + +<%= h 3, "Properties", "Properties" %> + +* @cpFloat cpRatchetJointGetAngle(const cpConstraint *constraint)@ +* @void cpRatchetJointSetAngle(cpConstraint *constraint, cpFloat value)@ +* @cpFloat cpRatchetJointGetPhase(const cpConstraint *constraint)@ +* @void cpRatchetJointSetPhase(cpConstraint *constraint, cpFloat value)@ +* @cpFloat cpRatchetJointGetRatchet(const cpConstraint *constraint)@ +* @void cpRatchetJointSetRatchet(cpConstraint *constraint, cpFloat value)@ + +<%= h 2, "Gear Joint:", "cpGearJoint" %> + +
    cpGearJoint *cpGearJointAlloc(void);
    +cpGearJoint *cpGearJointInit(cpGearJoint *joint, cpBody *a, cpBody *b, cpFloat phase, cpFloat ratio);
    +cpConstraint *cpGearJointNew(cpBody *a, cpBody *b, cpFloat phase, cpFloat ratio);
    + +p(expl). Keeps the angular velocity ratio of a pair of bodies constant. @ratio@ is always measured in absolute terms. It is currently not possible to set the ratio in relation to a third body's angular velocity. @phase@ is the initial angular offset of the two bodies. + +<%= h 3, "Properties", "Properties" %> + +* @cpFloat cpGearJointGetPhase(const cpConstraint *constraint)@ +* @void cpGearJointSetPhase(cpConstraint *constraint, cpFloat value)@ +* @cpFloat cpGearJointGetRatio(const cpConstraint *constraint)@ +* @void cpGearJointSetRatio(cpConstraint *constraint, cpFloat value)@ + +<%= h 2, "Simple Motor:", "cpSimpleMotor" %> + +
    cpSimpleMotor *cpSimpleMotorAlloc(void);
    +cpSimpleMotor *cpSimpleMotorInit(cpSimpleMotor *joint, cpBody *a, cpBody *b, cpFloat rate);
    +cpConstraint *cpSimpleMotorNew(cpBody *a, cpBody *b, cpFloat rate);
    + +p(expl). Keeps the relative angular velocity of a pair of bodies constant. @rate@ is the desired relative angular velocity. You will usually want to set an force (torque) maximum for motors as otherwise they will be able to apply a nearly infinite torque to keep the bodies moving. + +<%= h 3, "Properties", "Properties" %> + +* @cpFloat cpSimpleMotorGetRate(const cpConstraint *constraint)@ +* @void cpSimpleMotorSetRate(cpConstraint *constraint, cpFloat value)@ + + +<%= h 2, "Notes:", "Notes" %> + +* You can add multiple joints between two bodies, but make sure that they don't fight. Doing so can cause the bodies jitter or spin violently. + + +<%= h 1, "Overview of Collision Detection in Chipmunk:", "CollisionDetection" %> + +In order to make collision detection in Chipmunk as fast as possible, the process is broken down into several stages. While I've tried to keep it conceptually simple, the implementation can be a bit daunting. Fortunately as a user of the library, you don't need to understand everything about how it works. Though if you are trying to squeeze every ounce of performance out of Chipmunk, understanding this section can be helpful. + +<%= h 2, "Spatial Indexing:", "SpatialIndexing" %> + +A for loop that checks every object against every other object in the scene would be _very_ slow. So the first stage of the collision detection (or broadphase as it is commonly called), is to use a high level spatial algorithm to figure out which objects should be even be checked for collisions. Currently Chipmunk supports two spatial indexes, an axis-aligned bounding box tree and a spatial hash. These spatial indexes are able to quickly identify which shapes are near each other and should be checked for a collision. + +<%= h 2, "Collision Filtering:", "Filtering" %> + +After the spatial index figures out which pairs of shapes are likely to be near each other, it passes them back to the space to perform some additional filtering on the pairs. Before doing anything else, Chipmunk performs a few quick tests to check if shapes should collide. + +* *Bounding Box Test:* The shapes are not colliding if their bounding boxes are not overlapping. Objects like diagonal line segments can trigger a lot of false positives here, but it's unlikely to be something you should worry about. +* *Layer Test:* The shapes are not colliding if they don't occupy any of the same layers. (the bitwise AND of their layer masks is 0) +* *Group Test:* Shapes shouldn't collide with other shapes in the same non-zero group. + +<%= h 2, "Primitive Shape to Shape Collision Detection:", "PrimitiveTest" %> + +The most expensive test is to actually check for overlap based on their geometry. Circle to circle and circle to line collisions are pretty quick. Poly to poly collisions get more expensive as the number of vertexes increases. Simpler shapes make for faster collisions (and more importantly fewer collision points for the solver to run). Chipmunk uses a small dispatch table to figure out which function to use to check if the shapes overlap. + +<%= h 2, "Collision Handler Filtering:", "HandlerFiltering" %> + +After checking if two shapes overlap Chipmunk will look to see if you have defined a collision handler for the collision types of the shapes. This is vital to process collisions events for the gameplay, but also gives you a very flexible way to filter out collisions. The return value of the @begin()@ and @preSolve()@ callbacks determines whether or not the colliding pair of shapes is discarded or not. Returning true will keep the pair, false will discard it. Rejecting a collision from a @begin()@ callback is permanent, rejecting it from the @preSolve()@ only applies to the step it occured in. If you don't define a handler for the given collision_types, Chipmunk will call the space's default handler, which by default is defined to simply accept all collisions. + +While using callbacks to filter collisions is the most flexible way, keep in mind that by the time your callback is called all of the most expensive collision detection has already been done. For simulations with a lot of colliding objects each frame, the time spent finding collisions is small compared to the time spent solving the physics for them so it may not be a big deal. Still, use layers or groups first if you can. + +<%= h 1, "Collision Callbacks:", "CollisionCallbacks" %> + +A physics library without any events or feedback would not be very useful for games. How would you know when the player bumped into an enemy so that you could take some health points away? How would you know how hard the car hit something so you don't play a loud crash noise when a pebble hits it? What if you need to decide if a collision should be ignored based on specific conditions, like implementing one way platforms? Chipmunk has a number of powerful callback systems that you can plug into to accomplish all of that. + +<%= h 2, "Collision Handlers:", "Handlers" %> + +A collision handler is a set of 4 function callbacks for the different collision events that Chipmunk recognizes. The event types are: +* @begin()@: Two shapes just started touching for the first time this step. Return true from the callback to process the collision normally or false to cause Chipmunk to ignore the collision entirely. If you return false, the @preSolve()@ and @postSolve()@ callbacks will never be run, but you will still recieve a separate event when the shapes stop overlapping. +* @preSolve()@: Two shapes are touching during this step. Return false from the callback to make Chipmunk ignore the collision this step or true to process it normally. Additionally, you may override collision values using @cpArbiterSetFriction()@, @cpArbiterSetElasticity()@ or @cpArbiterSetSurfaceVelocity()@ to provide custom friction, elasticity, or surface velocity values. See "cpArbiter":#cpArbiter for more info. +* @postSolve()@: Two shapes are touching and their collision response has been processed. You can retrieve the collision impulse or kinetic energy at this time if you want to use it to calculate sound volumes or damage amounts. See "cpArbiter":#cpArbiter for more info. +* @separate()@: Two shapes have just stopped touching for the first time this step. To ensure that begin()/separate() are always called in balanced pairs, it will also be called when removing a shape while its in contact with something or when deallocating the space. + +Collision callbacks are closely associated with "cpArbiter":#cpArbiter structs. You should familiarize yourself with those as well. + +*Note:* Shapes tagged as sensors (@cpShape.sensor == true@) never generate collisions that get processed so collisions between sensors shapes and other shapes will never call the @postSolve()@ callback. They still generate @begin()@, and @separate()@ callbacks, and the @preSolve()@ callback is also called every frame even though there is no real collision. + +*Note #2:* @preSolve()@ callbacks are called before the sleeping algorithm runs. If an object falls asleep, it's @postSolve()@ callback won't be called until it's reawoken. + +<%= h 2, "Collision Handler API:", "HandlerAPI" %> + +
    typedef int (*cpCollisionBeginFunc)(cpArbiter *arb, struct cpSpace *space, void *data)
    +typedef int (*cpCollisionPreSolveFunc)(cpArbiter *arb, cpSpace *space, void *data)
    +typedef void (*cpCollisionPostSolveFunc)(cpArbiter *arb, cpSpace *space, void *data)
    +typedef void (*cpCollisionSeparateFunc)(cpArbiter *arb, cpSpace *space, void *data)
    + +p(expl). Collision handler function types. While all of them take an arbiter, space, and a user data pointer, only the @begin()@ and @preSolve()@ callbacks return a value. See above for more information. + +
    void cpSpaceAddCollisionHandler(
    +	cpSpace *space,
    +	cpCollisionType a, cpCollisionType b,
    +	cpCollisionBeginFunc begin,
    +	cpCollisionPreSolveFunc preSolve,
    +	cpCollisionPostSolveFunc postSolve,
    +	cpCollisionSeparateFunc separate,
    +	void *data
    +)
    + +p(expl). Add a collision handler for given collision type pair. Whenever a shapes with collision type (@cpShape.collision_type@) @a@ and collision type @b@ collide, these callbacks will be used to process the collision. @data@ is a user definable context pointer that is passed to each of the callbacks. NULL can be provided for callbacks you do not wish to implement, however Chipmunk will call it's own default versions for these and not the default ones you've set up for the space. If you need to fall back on the space's default callbacks, you'll have to provide them individually to each handler definition. + +
    void cpSpaceRemoveCollisionHandler(cpSpace *space, cpCollisionType a, cpCollisionType b)
    + +p(expl). Remove a collision handler for a given collision type pair. + +
    void cpSpaceSetDefaultCollisionHandler(
    +	cpSpace *space,
    +	cpCollisionBeginFunc begin,
    +	cpCollisionPreSolveFunc preSolve,
    +	cpCollisionPostSolveFunc postSolve,
    +	cpCollisionSeparateFunc separate,
    +	void *data
    +)
    + +p(expl). Register a default collision handler to be used when no specific collision handler is found. The space is given a default handler when created that returns true for all collisions in @begin()@ and @preSolve()@ and does nothing in the @postSolve()@ and @separate()@ callbacks. + +<%= h 2, "Post-Step Callbacks:", "PostStep" %> + +Post-step callbacks are the one place where you can break the rules about adding or removing objects from within a callback. In fact, their primary function is to help you safely remove objects from the space that you wanted to disable or destroy in a collision or query callback. + +Post step callbacks are registered as a function and a pointer that is used as a key. You can only register one @postStep()@ callback per key. This prevents you from accidentally removing an object more than once. For instance, say that you get a collision callback between a bullet and object A. You want to destroy both the bullet and object A, so you register a @postStep()@ callback to safely remove them from your game. Then you get a second collision callback between the bullet and object B. You register a @postStep()@ callback to remove object B, and a second @postStep()@ callback to remove the bullet. Because you can only register one callback per key, the @postStep()@ callback for the bullet will only be called once and you can't accidentally try to remove it twice. + +
    typedef void (*cpPostStepFunc)(cpSpace *space, void *obj, void *data)
    + +p(expl). Function type used for @postStep()@ callbacks. @space@ is the space the callback was registered on, @obj@ is the pointer value you supplied as the key, and @data@ is a user definable pointer you can use to pass in as a context value. + +
    cpBool cpSpaceAddPostStepCallback(cpSpace *space, cpPostStepFunc func, void *key, void *data);
    + +p(expl). Add @func@ to be called before @cpSpaceStep()@ returns. @key@ and @data@ will be passed to your function. Only the first callback registered for any unique value of @key@ will be recorded. It returns @true@ if the callback is scheduled and @false@ when the @key@ has already been used. You can add @postStep()@ callbacks from outside of other callback functions, but there isn't a good reason to and they won't be called until the next time @cpSpaceStep()@ is finishing. + +*Note:* Post-step callbacks are not run in any particular order. If you need to sequence a number of events, you'll need to put them in a single callback. + +<%= h 2, "Examples:", "Examples" %> + +See the "callback examples":examples.html#CollisionCallbacks for more information. + +<%= h 1, "Chipmunk Collision Pairs: @cpArbiter@", "cpArbiter" %> + +Chipmunk's @cpArbiter@ struct encapsulates a pair of colliding shapes and all of the data about their collision. + +Why are they called arbiters? The short answer is that I kept using the word "arbitrates" to describe the way that collisions were resolved and then I saw that Box2D actually called them arbiters way back in 2006 when I was looking at its solver. An arbiter is like a judge, a person that has authority to settle disputes between two people. It was a fun, fitting name and was shorter to type than CollisionPair which I had been using. It was originally meant to be a private internal structure only, but evolved to be useful from callbacks. + +<%= h 2, "Memory Management:", "Memory" %> + +You will never need to create or free an arbiter. More importantly, because they are entirely managed by the space you should *never* store a reference to an arbiter as you don't know when they will be freed or reused. Use them within the callback where they are given to you and then forget about them or copy out the information you need. + +<%= h 2, "Properties:", "Properties" %> + +
    cpFloat cpArbiterGetElasticity(const cpArbiter *arb)
    +void cpArbiterSetElasticity(cpArbiter *arb, cpFloat value)
    + +p(expl). The calculated elasticity for this collision pair. Setting the value in a @preSolve()@ callback will override the value calculated by the space. The default calculation multiplies the elasticity of the two shapes together. + +
    cpFloat cpArbiterGetFriction(const cpArbiter *arb)
    +void cpArbiterSetFriction(cpArbiter *arb, cpFloat value)
    + +p(expl). The calculated friction for this collision pair. Setting the value in a @preSolve()@ callback will override the value calculated by the space. The default calculation multiplies the friction of the two shapes together. + +
    cpVect cpArbiterGetSurfaceVelocity(const cpArbiter *arb)
    +void cpArbiterSetSurfaceVelocity(cpArbiter *arb, cpVect value)
    + +p(expl). The calculated surface velocity for this collision pair. Setting the value in a @preSolve()@ callback will override the value calculated by the space. the default calculation subtracts the surface velocity of the second shape from the first and then projects that onto the tangent of the collision. This is so that only friction is affected by default calculation. Using a custom calculation, you can make something that responds like a pinball bumper, or where the surface velocity is dependent on the location of the contact point. + +*NOTE:* Unfortunately there is an old bug where the surface velocity is calculated backwards (negative). I didn't really notice this for a long time. It will be fixed in Chipmunk 7, but for now I've left it alone for backwards compatibility reasons. + +
    cpDataPointer cpArbiterGetUserData(const cpArbiter *arb)
    +void cpArbiterSetUserData(cpArbiter *arb, cpDataPointer data)
    + +p(expl). A user definable pointer. The value will persist for the pair of shapes until the @separate()@ callback is called. + +*NOTE:* If you need to clean up this pointer, you should implement the @separate()@ callback to do it. Also be careful when destroying the space as there may be active collisions still. In order to trigger the @separate()@ callbacks, youll need to remove all the shapes from the space before disposing of it. This is something I'd suggest doing anyway. See ChipmunkDemo.c:ChipmunkDemoFreeSpaceChildren() for an example of how to do it easily. + + +
    int cpArbiterGetCount(const cpArbiter *arb)
    +cpVect cpArbiterGetNormal(const cpArbiter *arb, int i)
    +cpVect cpArbiterGetPoint(const cpArbiter *arb, int i)
    +cpFloat cpArbiterGetDepth(const cpArbiter *arb, int i)
    + +p(expl). Get the number of contacts tracked by this arbiter or the specific collision point, collision normal or penetration depth of a collision point. + +
    cpBool cpArbiterIsFirstContact(const cpArbiter *arb)
    + +p(expl). Returns true if this is the first step the two shapes started touching. This can be useful for sound effects for instance. If it's the first frame for a certain collision, check the energy of the collision in a @postStep()@ callbock and use that to determine the volume of a sound effect to play. + +
    void cpArbiterGetShapes(const cpArbiter *arb, cpShape **a, cpShape **b)
    +void cpArbiterGetBodies(const cpArbiter *arb, cpBody **a, cpBody **b)
    + +p(expl). Get the shapes or bodies in the order that they were defined in the collision handler associated with this arbiter. If you defined the handler as @cpSpaceAddCollisionHandler(space, 1, 2, ...)@, you you will find that @a->collision_type == 1@ and @b->collision_type == 2@. + +<%= pop_open_example "CollisionCallback" %> + +<%= h 2, "Contact Point Sets:", "HelperFunctions" %> + +Contact point sets make getting contact information simpler. + +
    cpContactPointSet cpArbiterGetContactPointSet(const cpArbiter *arb)
    + +p(expl). Get a contact point set struct from an arbiter. + +You might do something like the following to get and process a contact point set: + +
    cpContactPointSet set = cpArbiterGetContactPointSet(arbiter);
    +for(int i=0; i
    + +
    void cpArbiterSetContactPointSet(cpArbiter *arb, cpContactPointSet *set)
    + +p(expl). Replace the contact point set of an Arbiter. You cannot change the number of contacts, but can change the location, normal or penetration distance. The "Sticky" demo uses this to allow objects to overlap an extra amount. You could also use it in a Pong style game to modify the normal of the collision based on the x-position of the collision even though the paddle is a flat shape. + +<%= h 2, "Helper Functions:", "HelperFunctions" %> + +
    void cpArbiterGetShapes(cpArbiter *arb, cpShape **a, cpShape **b)
    +void cpArbiterGetBodies(const cpArbiter *arb, cpBody **a, cpBody **b)
    + +p(expl). Get the shapes (or their bodies) in the order that they were defined in the collision handler associated with this arbiter. If you defined the handler as @cpSpaceAddCollisionHandler(space, 1, 2, ...)@, you you will find that @a->collision_type == 1@ and @b->collision_type == 2@. The convenience macro defines and initializes the two shape variables for you. The default collision handler doesn't use collision types so the order is undefined. + +
    #define CP_ARBITER_GET_SHAPES(arb, a, b) cpShape *a, *b; cpArbiterGetShapes(arb, &a, &b)
    +#define CP_ARBITER_GET_BODIES(arb, a, b) cpBody *a, *b; cpArbiterGetBodies(arb, &a, &b);
    + +p(expl). Shortcut macros for defining variables for and retrieving the shapes/bodies for an arbiter. + +
    cpVect cpArbiterTotalImpulseWithFriction(cpArbiter *arb);
    +cpVect cpArbiterTotalImpulse(cpArbiter *arb);
    + +p(expl). Returns the impulse that was applied this step to resolve the collision. These functions should only be called from a @postStep()@ or @cpBodyEachArbiter()@ callback, otherwise the result is undefined. If in doubt which function to use, use @cpArbiterTotalImpulseWithFriction()@. + +
    cpFloat cpArbiterTotalKE(const cpArbiter *arb);
    + +p(expl). Calculate the amount of energy lost in a collision including static, but not dynamic friction. This function should only be called from a @postSolve()@, @postStep()@ or @cpBodyEachArbiter()@ callback. + +<%= h 1, "Queries:", "Queries" %> + +Chipmunk spaces support four kinds of spatial queries, nearest point, segment, shape and fast bounding box queries. Any type can be performed efficiently against an entire space, and point and segment queries can be performed against individual shapes. All types of queries take a collision group and layer that are used to filter matches out using the same rules used for filtering collisions between shapes. See "cpShape":#cpShape for more information. If you don't want to filter out any matches, use @CP_ALL_LAYERS@ for the layers and @CP_NO_GROUP@ as the group. + +<%= h 2, "Nearest Point Queries:", "PointQueries" %> + +Point queries are useful for things like mouse picking and simple sensors. They allow you to check if there are shapes within a certain distance of a point, find the closest point on a shape to a given point or find the closest shape to a point. + +
    typedef struct cpPointQueryInfo {
    +	/// The nearest shape, NULL if no shape was within range.
    +	cpShape *shape;
    +	/// The closest point on the shape's surface. (in world space coordinates)
    +	cpVect p;
    +	/// The distance to the point. The distance is negative if the point is inside the shape.
    +	cpFloat d;
    +	/// The gradient of the distance function.
    +	/// The same as info.p/info.d, but accurate even for very small values of info.d.
    +	cpVect g;
    +} cpPointQueryInfo;
    + +p(expl). Nearest point queries return the point on the surface of the shape as well as the distance from the query point to the surface point. + +
    cpFloat cpShapeNearestPointQuery(cpShape *shape, cpVect p, cpPointQueryInfo *out)
    + +p(expl). Find the distance from @point@ to @shape@. If the point is inside of the shape, the distance will be negative and equal to the depth of the point. + +
    typedef void (*cpSpaceNearestPointQueryFunc)(cpShape *shape, cpFloat distance, cpVect point, void *data);
    +
    +void cpSpaceNearestPointQuery(
    +	cpSpace *space, cpVect point, cpFloat maxDistance,
    +	cpLayers layers, cpGroup group,
    +	cpSpaceNearestPointQueryFunc func, void *data
    +)
    + +p(expl). Query @space@ at @point@ for shapes within the given distance range filtering out matches with the given @layers@ and @group@. @func@ is called for each shape found along with the distance to the closest point on the shape's surface, the distance to that point and the @data@ argument passed to @cpSpaceNearestPointQuery()@. Sensor shapes are included. If a @maxDistance@ of @0.0@ is used, the point must lie inside a shape. Negative @maxDistance@ is also allowed meaning that the point must be a under a certain depth within a shape to be considered a match. + +
    cpShape *cpSpaceNearestPointQueryNearest(cpSpace *space, cpVect point, cpFloat maxDistance, cpLayers layers, cpGroup group, cpPointQueryInfo *out)
    + +p(expl). Query @space@ at @point@ and return the closest shape within @maxDistance@ units of distance. @out@ is an optional pointer to a @cpPointQueryInfo@ if you want additional information about the match. + +<%= h 2, "Segment Queries:", "SegmentQueries" %> + +Segment queries are like ray casting, but because not all spatial indexes allow processing infinitely long ray queries it is limited to segments. In practice this is still very fast and you don't need to worry too much about the performance as long as you aren't using extremely long segments for your queries. + +
    typedef struct cpSegmentQueryInfo {
    +	/// The shape that was hit, NULL if no collision occured.
    +	cpShape *shape;
    +	/// The normalized distance along the query segment in the range [0, 1].
    +	cpFloat t;
    +	/// The normal of the surface hit.
    +	cpVect n;
    +} cpSegmentQueryInfo;
    + +p(expl). Segment queries return more information than just a simple yes or no, they also return where a shape was hit and it's surface normal at the hit point. @t@ is the percentage between the query start and end points. If you need the hit point in world space or the absolute distance from start, see the segment query helper functions farther down. If a segment query starts within a shape it will have @t = 0@ and @n = cpvzero@. + +
    cpBool cpShapeSegmentQuery(cpShape *shape, cpVect a, cpVect b, cpSegmentQueryInfo *info)
    + +p(expl). Perform a segment query from @a@ to @b@ against a single shape @shape@. @info@ must be a valid pointer to a @cpSegmentQueryInfo@ structure which will be initialized with the raycast info. + +
    typedef void (*cpSpaceSegmentQueryFunc)(cpShape *shape, cpFloat t, cpVect n, void *data)
    +
    +void cpSpaceSegmentQuery(
    +	cpSpace *space, cpVect start, cpVect end,
    +	cpLayers layers, cpGroup group,
    +	cpSpaceSegmentQueryFunc func, void *data
    +)
    + +p(expl). Query @space@ along the line segment from @start@ to @end@ filtering out matches with the given @layers@ and @group@. @func@ is called with the normalized distance along the line and surface normal for each shape found along with the @data@ argument passed to @cpSpacePointQuery()@. Sensor shapes are included. + +
    cpShape *cpSpaceSegmentQueryFirst(
    +	cpSpace *space, cpVect start, cpVect end,
    +	cpLayers layers, cpGroup group,
    +	cpSegmentQueryInfo *info
    +)
    + +p(expl). Query @space@ along the line segment from @start@ to @end@ filtering out matches with the given @layers@ and @group@. Only the first shape encountered is returned and the search is short circuited. Returns @NULL@ if no shape was found. The info struct pointed to by @info@ will be initialized with the raycast info unless @info@ is NULL. Sensor shapes are ignored. + +<%= h 3, "Segment Query Helper Functions:", "HelperFunctions" %> + +
    cpVect cpSegmentQueryHitPoint(cpVect start, cpVect end, cpSegmentQueryInfo info)
    + +p(expl). Return the hit point in world coordinates where the segment first intersected with the shape. + +
    cpFloat cpSegmentQueryHitDist(cpVect start, cpVect end, cpSegmentQueryInfo info)
    + +p(expl). Return the absolute distance where the segment first hit the shape. + + +<%= h 2, "AABB Queries:", "AABBQueries" %> + +AABB queries give you a fast way to check roughly which shapes are in an area. + +
    typedef void (*cpSpaceBBQueryFunc)(cpShape *shape, void *data)
    +
    +void cpSpaceBBQuery(
    +	cpSpace *space, cpBB bb,
    +	cpLayers layers, cpGroup group,
    +	cpSpaceBBQueryFunc func, void *data
    +)
    + +p(expl). Query @space@ to find all shapes near @bb@ filtering out matches with the given @layers@ and @group@. @func@ is called for each shape whose bounding box overlaps @bb@ along with the @data@ argument passed to @cpSpaceBBQuery()@. Sensor shapes are included. + +<%= h 2, "Shape Queries:", "ShapeQueries" %> + +Shape queries allow you to check if shapes in a space are overlapping a specific area. You can use this to check if an object already exists at a location you want to add another shape, or to use as sensor queries for AI. + +You can either create a body/shape pair before querying, or you can create a shape passing @NULL@ for the body and position the shape using @cpShapeUpdate()@ to set the position and rotation of the shape. + +
    typedef void (*cpSpaceShapeQueryFunc)(cpShape *shape, cpContactPointSet *points, void *data);
    +
    +cpBool cpSpaceShapeQuery(cpSpace *space, cpShape *shape, cpSpaceShapeQueryFunc func, void *data);
    + +p(expl). Query @space@ to find all shapes overlapping @shape@. Matches are filtered using the layers and group of @shape@. @func@ is called for each overlapping shape along with a pointer to a temporary cpContactPointSet and the @data@ argument passed to @cpSpaceBBQuery()@. Sensor shapes are included. + +<%= h 2, "Blocks:", "Blocks" %> + +If your compiler supports blocks (such as Clang), there are an alternate set of functions you can call. @cpSpaceNearestPointQuery_b()@, etc. See @chipmunk.h@ for more information. + +<%= h 2, "Examples:", "Examples" %> + +See the "query examples":examples.html#Query for more information. diff --git a/external/Chipmunk/doc-src/upload_docs.sh b/external/Chipmunk/doc-src/upload_docs.sh new file mode 100644 index 0000000..d01fbfb --- /dev/null +++ b/external/Chipmunk/doc-src/upload_docs.sh @@ -0,0 +1 @@ +rsync -r --exclude=".*" ../ slembcke.net:files.slembcke.net/chipmunk/release/Chipmunk-5.x/Chipmunk-Docs/ diff --git a/external/Chipmunk/doc/examples.html b/external/Chipmunk/doc/examples.html new file mode 100644 index 0000000..23dd1d4 --- /dev/null +++ b/external/Chipmunk/doc/examples.html @@ -0,0 +1,119 @@ + + + + + Chipmunk Game Dynamics Documentation + + + + +

    Example Code Snippets:

    + + + +

    Getting a Transformation from a Rigid Body:

    + +

    You can quickly and easily build a transformation matrix from a Chipmunk body. The following code is for OpenGL, but it should be trivial to modify for DirectX or affine transforms. (Note that OpenGL matrices are column-major)

    + +
    cpVect pos = body->p;
    +cpVect rot = body->rot;
    +
    +GLFloat matrix[16] = {
    +   rot.x, rot.y, 0.0f, 0.0f,
    +  -rot.y, rot.x, 0.0f, 0.0f,
    +   0.0f,   0.0f, 1.0f, 0.0f,
    +   pos.x, pos.y, 0.0f, 1.0f,
    +};
    +
    +glMultMatrixf(matrix.farr);
    +
    + + +
    +

    Collision Callbacks:

    + +

    This snippet demonstrates several Chipmunk collision callback features. It defines a collision handler that is called when collision shapes start touching and also a post-step callback to remove the collision shape and body.

    + +
    static void
    +postStepRemove(cpSpace *space, cpShape *shape, void *unused)
    +{
    +  cpSpaceRemoveBody(space, shape->body);
    +  cpBodyFree(shape->body);
    +  
    +  cpSpaceRemoveShape(space, shape);
    +  cpShapeFree(shape);
    +}
    +
    +static int
    +begin(cpArbiter *arb, cpSpace *space, void *unused)
    +{
    +  // Get the cpShapes involved in the collision
    +  // The order will be the same as you defined in the handler definition
    +  // a->collision_type will be BULLET_TYPE and b->collision_type will be MONSTER_TYPE
    +  cpShape *a, *b; cpArbiterGetShapes(arb, &a, &b);
    +  
    +  // Alternatively you can use the CP_ARBITER_GET_SHAPES() macro
    +  // It defines and sets the variables for you.
    +  //CP_ARBITER_GET_SHAPES(arb, a, b);
    +  
    +  // Add a post step callback to safely remove the body and shape from the space.
    +  // Calling cpSpaceRemove*() directly from a collision handler callback can cause crashes.
    +  cpSpaceAddPostStepCallback(space, (cpPostStepFunc)postStepRemove, b, NULL);
    +  
    +  // The object is dead, don’t process the collision further
    +  return 0;
    +}
    +
    +#define BULLET_TYPE 1
    +#define MONSTER_TYPE 2
    +
    +// Define a collision handler for bullets and monsters
    +// Kill the monster by removing it’s shape and body from the space as soon as it’s hit by a bullet 
    +cpSpaceAddCollisionHandler(space, BULLET_TYPE, MONSTER_TYPE, begin, NULL, NULL, NULL, NULL);
    + +

    For more callback examples, see the One Way Platform Demo, Sensors Demo, or the Player Demo.

    + + + +

    Query Examples:

    + +

    The following example is taken directly from ChipmunkDemo.c. When the mouse is clicked, a point query is performed to see if there is a shape under the mouse. If there is, it adds a joint to the body that links it to the mouse's movement.

    + +
    static void
    +click(int button, int state, int x, int y)
    +{
    +  if(button == GLUT_LEFT_BUTTON){
    +    if(state == GLUT_DOWN){
    +      cpVect point = mouseToSpace(x, y);
    +    
    +      cpShape *shape = cpSpacePointQueryFirst(space, point, GRABABLE_MASK_BIT, 0);
    +      if(shape){
    +        cpBody *body = shape->body;
    +        mouseJoint = cpPivotJointNew2(mouseBody, body, cpvzero, cpBodyWorld2Local(body, point));
    +        mouseJoint->maxForce = 50000.0f;
    +        mouseJoint->biasCoef = 0.15f;
    +        cpSpaceAddConstraint(space, mouseJoint);
    +      }
    +    } else if(mouseJoint){
    +      cpSpaceRemoveConstraint(space, mouseJoint);
    +      cpConstraintFree(mouseJoint);
    +      mouseJoint = NULL;
    +    }
    +  }
    +}
    + +

    Perform a segment query to see if a laser beam hits a shape. We want to draw particles at both the position where the beam enters and exits the shape.

    + +
    cpVect a = cpv(...), b = cpv(...);
    +
    +cpSegmentQueryInfo info = {};
    +if(cpSpaceSegmentQueryFirst(space, a, b, -1, 0, &info)){
    +  cpSegmentQueryInfo info2;
    +  cpShapeSegmentQuery(info.shape, b, a, &info2);
    +  
    +  cpVect enterPoint = cpSegmentQueryHitPoint(a, b, info);
    +  cpVect exitPoint = cpSegmentQueryHitPoint(b, a, info2);
    +}
    + + + diff --git a/external/Chipmunk/doc/examples/BreakableJoint.html b/external/Chipmunk/doc/examples/BreakableJoint.html new file mode 100644 index 0000000..a526b9a --- /dev/null +++ b/external/Chipmunk/doc/examples/BreakableJoint.html @@ -0,0 +1,22 @@ +
    // Create the joint and set it's max force property.
    +breakableJoint = cpSpaceAddConstraint(space, cpPinJointNew(body1, body2, cpv(15,0), cpv(-15,0)));
    +cpConstraintSetMaxForce(breakableJoint, 4000);
    +
    +
    +// In your update function:
    +// Step your space normally...
    +cpFloat dt = 1.0/60.0;
    +cpSpaceStep(space, dt);
    +
    +if(breakableJoint){
    +  // Convert the impulse to a force by dividing it by the timestep.
    +  cpFloat force = cpConstraintGetImpulse(breakableJoint)/dt;
    +  cpFloat maxForce = cpConstraintGetMaxForce(breakableJoint);
    +
    +  // If the force is almost as big as the joint's max force, break it.
    +  if(force > 0.9*maxForce){
    +    cpSpaceRemoveConstraint(space, breakableJoint);
    +    breakableJoint = NULL;
    +  }
    +}
    +
    \ No newline at end of file diff --git a/external/Chipmunk/doc/examples/CollisionCallback.html b/external/Chipmunk/doc/examples/CollisionCallback.html new file mode 100644 index 0000000..bfed41b --- /dev/null +++ b/external/Chipmunk/doc/examples/CollisionCallback.html @@ -0,0 +1,36 @@ +
    static void
    +postStepRemove(cpSpace *space, cpShape *shape, void *unused)
    +{
    +  cpSpaceRemoveShape(space, shape);
    +  cpSpaceRemoveBody(space, shape->body);
    +  
    +  cpShapeFree(shape);
    +  cpBodyFree(shape->body);
    +}
    +
    +static int
    +begin(cpArbiter *arb, cpSpace *space, void *unused)
    +{
    +  // Get the cpShapes involved in the collision
    +  // The order will be the same as you defined in the handler definition
    +  // a->collision_type will be BULLET_TYPE and b->collision_type will be MONSTER_TYPE
    +  CP_ARBITER_GET_SHAPES(arb, a, b);
    +  
    +  // The macro expands exactly as if you had typed this:
    +  // cpShape *a, *b; cpArbiterGetShapes(arb, &a, &b);
    +  
    +  // Add a post step callback to safely remove the body and shape from the space.
    +  // Calling cpSpaceRemove*() directly from a collision handler callback can cause crashes.
    +  cpSpaceAddPostStepCallback(space, (cpPostStepFunc)postStepRemove, b, NULL);
    +  
    +  // The object is dead, don’t process the collision further
    +  return 0;
    +}
    +
    +#define BULLET_TYPE 1
    +#define MONSTER_TYPE 2
    +
    +// Define a collision handler for bullets and monsters
    +// Kill the monster by removing it’s shape and body from the space as soon as it’s hit by a bullet 
    +cpSpaceAddCollisionHandler(space, BULLET_TYPE, MONSTER_TYPE, begin, NULL, NULL, NULL, NULL);
    +
    \ No newline at end of file diff --git a/external/Chipmunk/doc/examples/Crushing.html b/external/Chipmunk/doc/examples/Crushing.html new file mode 100644 index 0000000..e16e251 --- /dev/null +++ b/external/Chipmunk/doc/examples/Crushing.html @@ -0,0 +1,23 @@ +
    struct CrushingContext {
    +  cpFloat magnitudeSum;
    +  cpVect vectorSum;
    +};
    +
    +static void
    +EstimateCrushingHelper(cpBody *body, cpArbiter *arb, struct CrushingContext *context)
    +{
    +  cpVect j = cpArbiterTotalImpulseWithFriction(arb);
    +  context->magnitudeSum += cpvlength(j);
    +  context->vectorSum = cpvadd(context->vectorSum, j);
    +}
    +
    +cpFloat
    +EstimateCrushForce(cpBody *body, cpFloat dt)
    +{
    +  struct CrushingContext crush = {0.0f, cpvzero};
    +  cpBodyEachArbiter(body, (cpBodyArbiterIteratorFunc)EstimateCrushingHelper, &crush);
    +  
    +  // Compare the vector sum magnitude and magnitude sum to see if
    +  // how much the collision forces oppose one another.
    +  cpFloat crushForce = (crush.magnitudeSum - cpvlength(crush.vectorSum))*dt;
    +}
    \ No newline at end of file diff --git a/external/Chipmunk/doc/examples/DynamicStatic.html b/external/Chipmunk/doc/examples/DynamicStatic.html new file mode 100644 index 0000000..9938298 --- /dev/null +++ b/external/Chipmunk/doc/examples/DynamicStatic.html @@ -0,0 +1,18 @@ +
    // This example is pulled from the Plink demo.
    +if(ChipmunkDemoRightDown){
    +  // Find the shape under the mouse.
    +  cpShape *nearest = cpSpaceNearestPointQueryNearest(space, ChipmunkDemoMouse, 0.0, GRABABLE_MASK_BIT, CP_NO_GROUP, NULL);
    +  if(nearest){
    +    cpBody *body = cpShapeGetBody(nearest);
    +    if(cpBodyIsStatic(body)){
    +      // If the body is static, convert it to dynamic and add it to the space.
    +      cpSpaceConvertBodyToDynamic(space, body, pentagon_mass, pentagon_moment);
    +      cpSpaceAddBody(space, body);
    +    } else {
    +      // If the body is dynamic, remove it from the space and convert it to static.
    +      cpSpaceRemoveBody(space, body);
    +      cpSpaceConvertBodyToStatic(space, body);
    +    }
    +  }
    +}
    +
    \ No newline at end of file diff --git a/external/Chipmunk/doc/examples/Hello Chipmunk.html b/external/Chipmunk/doc/examples/Hello Chipmunk.html new file mode 100644 index 0000000..614a3fd --- /dev/null +++ b/external/Chipmunk/doc/examples/Hello Chipmunk.html @@ -0,0 +1,64 @@ +
    #include <stdio.h>
    +#include <chipmunk.h>
    +
    +int main(void){
    +  // cpVect is a 2D vector and cpv() is a shortcut for initializing them.
    +  cpVect gravity = cpv(0, -100);
    +  
    +  // Create an empty space.
    +  cpSpace *space = cpSpaceNew();
    +  cpSpaceSetGravity(space, gravity);
    +  
    +  // Add a static line segment shape for the ground.
    +  // We'll make it slightly tilted so the ball will roll off.
    +  // We attach it to space->staticBody to tell Chipmunk it shouldn't be movable.
    +  cpShape *ground = cpSegmentShapeNew(space->staticBody, cpv(-20, 5), cpv(20, -5), 0);
    +  cpShapeSetFriction(ground, 1);
    +  cpSpaceAddShape(space, ground);
    +  
    +  // Now let's make a ball that falls onto the line and rolls off.
    +  // First we need to make a cpBody to hold the physical properties of the object.
    +  // These include the mass, position, velocity, angle, etc. of the object.
    +  // Then we attach collision shapes to the cpBody to give it a size and shape.
    +  
    +  cpFloat radius = 5;
    +  cpFloat mass = 1;
    +  
    +  // The moment of inertia is like mass for rotation
    +  // Use the cpMomentFor*() functions to help you approximate it.
    +  cpFloat moment = cpMomentForCircle(mass, 0, radius, cpvzero);
    +  
    +  // The cpSpaceAdd*() functions return the thing that you are adding.
    +  // It's convenient to create and add an object in one line.
    +  cpBody *ballBody = cpSpaceAddBody(space, cpBodyNew(mass, moment));
    +  cpBodySetPos(ballBody, cpv(0, 15));
    +  
    +  // Now we create the collision shape for the ball.
    +  // You can create multiple collision shapes that point to the same body.
    +  // They will all be attached to the body and move around to follow it.
    +  cpShape *ballShape = cpSpaceAddShape(space, cpCircleShapeNew(ballBody, radius, cpvzero));
    +  cpShapeSetFriction(ballShape, 0.7);
    +  
    +  // Now that it's all set up, we simulate all the objects in the space by
    +  // stepping forward through time in small increments called steps.
    +  // It is *highly* recommended to use a fixed size time step.
    +  cpFloat timeStep = 1.0/60.0;
    +  for(cpFloat time = 0; time < 2; time += timeStep){
    +    cpVect pos = cpBodyGetPos(ballBody);
    +    cpVect vel = cpBodyGetVel(ballBody);
    +    printf(
    +      "Time is %5.2f. ballBody is at (%5.2f, %5.2f). It's velocity is (%5.2f, %5.2f)\n",
    +      time, pos.x, pos.y, vel.x, vel.y
    +    );
    +    
    +    cpSpaceStep(space, timeStep);
    +  }
    +  
    +  // Clean up our objects and exit!
    +  cpShapeFree(ballShape);
    +  cpBodyFree(ballBody);
    +  cpShapeFree(ground);
    +  cpSpaceFree(space);
    +  
    +  return 0;
    +}
    \ No newline at end of file diff --git a/external/Chipmunk/doc/examples/JointRecipies.html b/external/Chipmunk/doc/examples/JointRecipies.html new file mode 100644 index 0000000..d908e14 --- /dev/null +++ b/external/Chipmunk/doc/examples/JointRecipies.html @@ -0,0 +1,17 @@ +
    // Faked top down friction.
    +
    +// A pivot joint configured this way will calculate friction against the ground for games with a top down perspective.
    +// Because the joint correction is disabled, the joint will not recenter itself and only apply to the velocity.
    +// The force the joint applies when changing the velocity will be clamped by the max force
    +// and this causes it to work exactly like friction!
    +cpConstraint *pivot = cpSpaceAddConstraint(space, cpPivotJointNew2(staticBody, body, cpvzero, cpvzero));
    +pivot->maxBias = 0.0f; // disable joint correction
    +pivot->maxForce = 1000.0f;
    +
    +// The pivot joint doesn't apply rotational forces, use a gear joint with a ratio of 1.0 for that.
    +cpConstraint *gear = cpSpaceAddConstraint(space, cpGearJointNew(staticBody, body, 0.0f, 1.0f));
    +gear->maxBias = 0.0f; // disable joint correction
    +gear->maxForce = 5000.0f;
    +
    +// Also, instead of connecting the joints to a static body, you can connect them to an infinite mass rogue body.
    +// You can then use the rogue body as a control body to the connected body. See the Tank demo as an example.
    \ No newline at end of file diff --git a/external/Chipmunk/doc/examples/Moments.html b/external/Chipmunk/doc/examples/Moments.html new file mode 100644 index 0000000..8d0622c --- /dev/null +++ b/external/Chipmunk/doc/examples/Moments.html @@ -0,0 +1,14 @@ +
    // Moment for a solid circle with a mass of 2 and radius 5.
    +cpFloat circle1 = cpMomentForCircle(2, 0, 5, cpvzero);
    +
    +// Moment for a hollow circle with a mass of 1, inner radius of 2 and outer radius of 6.
    +cpFloat circle2 = cpMomentForCircle(1, 2, 6, cpvzero);
    +
    +// Moment for a solid circle with a mass of 1, radius of 3 and
    +// centered 3 units along the x axis from the center of gravity.
    +cpFloat circle3 = cpMomentForCircle(2, 0, 5, cpv(3, 0));
    +
    +// Composite object. 1x4 box centered on the center of gravity and a circle sitting on top.
    +// Just add the moments together.
    +cpFloat composite = cpMomentForBox(boxMass, 1, 4) + cpMomentForCircle(circleMass, 0, 1, cpv(0, 3));
    +
    \ No newline at end of file diff --git a/external/Chipmunk/doc/examples/Sleeping.html b/external/Chipmunk/doc/examples/Sleeping.html new file mode 100644 index 0000000..32af5bd --- /dev/null +++ b/external/Chipmunk/doc/examples/Sleeping.html @@ -0,0 +1,25 @@ +
    // Construct a pile of boxes.
    +// Force them to sleep until the first time they are touched.
    +// Group them together so that touching any box wakes all of them.
    +cpFloat size = 20;
    +cpFloat mass = 1;
    +cpFloat moment = cpMomentForBox(mass, size, size);
    +
    +cpBody *lastBody = NULL;
    +
    +for(int i=0; i<5; i++){
    +  cpBody *body = cpSpaceAddBody(space, cpBodyNew(mass, moment));
    +  cpBodySetPos(body, cpv(0, i*size));
    +  
    +  cpShape *shape = cpSpaceAddShape(space, cpBoxShapeNew(body, size, size));
    +  cpShapeSetFriction(shape, 0.7);
    +  
    +  // You can use any sleeping body as a group identifier.
    +  // Here we just keep a reference to the last body we initialized.
    +  // Passing NULL as the group starts a new sleeping group.
    +  // You MUST do this after completely initializing the object.
    +  // Attaching shapes or calling setter functions will wake the body back up.
    +  cpBodySleepWithGroup(body, lastBody);
    +  lastBody = body;
    +}
    +
    \ No newline at end of file diff --git a/external/Chipmunk/doc/examples/cpConvexHull.html b/external/Chipmunk/doc/examples/cpConvexHull.html new file mode 100644 index 0000000..b58de19 --- /dev/null +++ b/external/Chipmunk/doc/examples/cpConvexHull.html @@ -0,0 +1,25 @@ +
    int first = 0;
    +
    +// Create space to store the convex hull.
    +// An alloca(), or a variable length array would be a better, but not always portable choice.
    +cpVect *hullVerts = (cpVect *)calloc(vertCount, sizeof(cpVect));
    +int hullCount = cpConvexHull(vertCount, verts, hullVerts, &first, 0.0);
    +
    +// hullVerts[0] will be equal to verts[first] here.
    +// If you don't care, pass NULL instead of the 'first' pointer.
    +
    +cpBody *body = cpBodyNew(mass, cpMomentForPoly(mass, hullCount, hullVerts, cpvzero));
    +cpShape *shape = cpPolyShapeNew(body, hullCount, hullVerts, cpvzero);
    +
    +free(hullVerts);
    +
    +// *********
    +// Altenatively you can use the CP_CONVEX_HULL() macro to save yourself a little work
    +
    +// The macro will declare the hullCount and hullVerts variables.
    +// hullVerts is allocated on the stack and does not need to be freed.
    +CP_CONVEX_HULL(count, verts, hullCount, hullVerts)
    +
    +cpBody *body = cpBodyNew(mass, cpMomentForPoly(mass, hullCount, hullVerts, cpvzero));
    +cpShape *shape = cpPolyShapeNew(body, hullCount, hullVerts, cpvzero);
    +
    \ No newline at end of file diff --git a/external/Chipmunk/doc/examples/cpSpaceEachBody.html b/external/Chipmunk/doc/examples/cpSpaceEachBody.html new file mode 100644 index 0000000..5933c0e --- /dev/null +++ b/external/Chipmunk/doc/examples/cpSpaceEachBody.html @@ -0,0 +1,12 @@ +
    // Code snippet to check if all bodies in the space are sleeping
    +
    +// This function is called once for each body in the space.
    +static void EachBody(cpBody *body, cpBool *allSleeping){
    +  if(!cpBodyIsSleeping(body)) *allSleeping = cpFalse;
    +}
    +
    +// Then in your tick method, do this:
    +cpBool allSleeping = true;
    +cpSpaceEachBody(space, (cpSpaceBodyIteratorFunc)EachBody, &allSleeping);
    +printf("All are sleeping: %s\n", allSleeping ? "true" : "false");
    +
    \ No newline at end of file diff --git a/external/Chipmunk/doc/images/hash_just_right.png b/external/Chipmunk/doc/images/hash_just_right.png new file mode 100644 index 0000000..e567fd5 Binary files /dev/null and b/external/Chipmunk/doc/images/hash_just_right.png differ diff --git a/external/Chipmunk/doc/images/hash_too_big.png b/external/Chipmunk/doc/images/hash_too_big.png new file mode 100644 index 0000000..434e3d7 Binary files /dev/null and b/external/Chipmunk/doc/images/hash_too_big.png differ diff --git a/external/Chipmunk/doc/images/hash_too_small.png b/external/Chipmunk/doc/images/hash_too_small.png new file mode 100644 index 0000000..ca9f8e9 Binary files /dev/null and b/external/Chipmunk/doc/images/hash_too_small.png differ diff --git a/external/Chipmunk/doc/images/hms_logo.png b/external/Chipmunk/doc/images/hms_logo.png new file mode 100644 index 0000000..c0b338d Binary files /dev/null and b/external/Chipmunk/doc/images/hms_logo.png differ diff --git a/external/Chipmunk/doc/images/logo1_med.png b/external/Chipmunk/doc/images/logo1_med.png new file mode 100644 index 0000000..01634a0 Binary files /dev/null and b/external/Chipmunk/doc/images/logo1_med.png differ diff --git a/external/Chipmunk/doc/stylesheet.css b/external/Chipmunk/doc/stylesheet.css new file mode 100644 index 0000000..b0d0b1d --- /dev/null +++ b/external/Chipmunk/doc/stylesheet.css @@ -0,0 +1,72 @@ +h1, h2 { + padding: 0.25em; + border-radius: 0.25em; +} + +h1 { + background-color: #89b4cb; +} + +h2 { + background-color: lightGrey; +} + +p { + margin-left: 1em; +} + +p.expl { + margin-left: 2em; +} + +code { + color: #191970 +} + +.HideShow { + background-color: lightGrey; + padding: 0.5em; + border-radius: 1em; + border: 2px grey solid; +} + +.PopOpen { + border-radius: 1em; + border: 1px grey solid; +} + +pre { + border-radius: 0.75em; + background-color: #F0F0F0; + padding: 0.5em; + margin-left: 1em; +} + +/*ul { + border-radius: 0.75em; + background-color: #F0F0F0; + margin-left: 1em; +}*/ + +table { + border: 2px solid black; + border-collapse: collapse; + margin-left: 1em; +} + +table td, th { + border: 1px black solid; + padding: 0.5em; +} + +h1 a:link, h2 a:link, h3 a:link, h1 a:visited, h2 a:visited, h3 a:visited { + text-decoration:none; + color:black; + background-color:transparent +} + +h1 a:hover, h2 a:hover, h3 a:hover, h1 a:active, h2 a:active, h3 a:active { + text-decoration:underline; + color:black; + background-color:transparent +} diff --git a/external/Chipmunk/doxygen_generator.rb b/external/Chipmunk/doxygen_generator.rb new file mode 100644 index 0000000..4b91ef7 --- /dev/null +++ b/external/Chipmunk/doxygen_generator.rb @@ -0,0 +1,178 @@ +DOC_FILE = open("generated_docs", "w") + +FUNCS = {} +IO.readlines("|ruby extract_protos.rb").each{|line| + func = eval(line) + FUNCS[func[:name]] = func +} + +SKIP = Object.new + +GETTER_DOCS = { + "cpArbiterGetBodies" => SKIP, + "cpArbiterGetContactPointSet" => SKIP, + "cpArbiterGetCount" => SKIP, + "cpArbiterGetDepth" => SKIP, + "cpArbiterGetElasticity" => "Get the elasticity for this cpArbiter", + "cpArbiterGetFriction" => "Get the friction for this cpArbiter", + "cpArbiterGetNormal" => SKIP, + "cpArbiterGetPoint" => SKIP, + "cpArbiterGetShapes" => SKIP, + "cpArbiterGetSurfaceVelocity" => "Get the surface velocity used by the contact calculation for this cpArbiter", + + "cpBodyGetAngVel" => "Get the angular velocity of this cpBody", + "cpBodyGetAngVelLimit" => "Get the angular velocity limit of this cpBody", + "cpBodyGetAngle" => "Get the angle of this cpBody", + "cpBodyGetForce" => "Get the force applied to this cpBody", + "cpBodyGetMass" => "Get the mass of this cpBody", + "cpBodyGetMoment" => "Get the moment of inertia of this cpBody", + "cpBodyGetPos" => "Get the position of this cpBody", + "cpBodyGetRot" => "Get the rotation vector of this cpBody", + "cpBodyGetTorque" => "Get the torque applied to this cpBody", + "cpBodyGetUserData" => "Get the userdata pointer for this cpBody", + "cpBodyGetVel" => "Get the velocity of this cpBody", + "cpBodyGetVelLimit" => "Get the velocity limit of this cpBody", + + "cpCircleShapeGetOffset" => "Get the offset of this cpCircleShape", + "cpCircleShapeGetRadius" => "Get the radius of this cpCircleShape", + + "cpConstraintGetA" => "Get the first of the two bodies this cpConstraint is connected to.", + "cpConstraintGetB" => "Get the second of the two bodies this cpConstraint is connected to.", + "cpConstraintGetErrorBias" => "Get the percentage of constraint error that remains unfixed after each second.", + "cpConstraintGetImpulse" => SKIP, + "cpConstraintGetMaxBias" => "Get the maximum rate this cpConstraint can apply to correct itself at.", + "cpConstraintGetMaxForce" => "Get the maximum force this cpConstraint can apply to correct itself.", + "cpConstraintGetPostSolveFunc" => "Get the function callback that is called each step after the solver runs.", + "cpConstraintGetPreSolveFunc" => "Get the function callback that is called each step before the solver runs.", + "cpConstraintGetUserData" => "Get the user data pointer for this cpConstraint.", + + "cpDampedRotarySpringGetDamping" => "Get the damping of this cpDampedRotarySpring.", + "cpDampedRotarySpringGetRestAngle" => "Get the restangle of this cpDampedRotarySpring.", + "cpDampedRotarySpringGetSpringTorqueFunc" => "Get the springtorquefunc of this cpDampedRotarySpring.", + "cpDampedRotarySpringGetStiffness" => "Get the stiffness of this cpDampedRotarySpring.", + + "cpDampedSpringGetAnchr1" => "Get the anchr1 of this cpDampedSpring.", + "cpDampedSpringGetAnchr2" => "Get the anchr2 of this cpDampedSpring.", + "cpDampedSpringGetDamping" => "Get the damping of this cpDampedSpring.", + "cpDampedSpringGetRestLength" => "Get the rest length of this cpDampedSpring.", + "cpDampedSpringGetSpringForceFunc" => "Get the spring force callback function of this cpDampedSpring.", + "cpDampedSpringGetStiffness" => "Get the stiffness of this cpDampedSpring.", + + "cpGearJointGetPhase" => "Get the phase of this cpGearJoint.", + "cpGearJointGetRatio" => "Get the ratio of this cpGearJoint.", + + "cpGrooveJointGetAnchr2" => "Get the anchr2 of this cpGrooveJoint.", + "cpGrooveJointGetGrooveA" => "Get the groovea of this cpGrooveJoint.", + "cpGrooveJointGetGrooveB" => "Get the grooveb of this cpGrooveJoint.", + + "cpPinJointGetAnchr1" => "Get the anchr1 of this cpPinJoint.", + "cpPinJointGetAnchr2" => "Get the anchr2 of this cpPinJoint.", + "cpPinJointGetDist" => "Get the dist between the anchor points of this cpPinJoint.", + + "cpPivotJointGetAnchr1" => "Get the anchr1 of this cpPivotJoint.", + "cpPivotJointGetAnchr2" => "Get the anchr2 of this cpPivotJoint.", + + "cpPolyShapeGetNumVerts" => SKIP, + "cpPolyShapeGetVert" => SKIP, + + "cpRatchetJointGetAngle" => "Get the angle of this cpRatchetJoint.", + "cpRatchetJointGetPhase" => "Get the phase of this cpRatchetJoint.", + "cpRatchetJointGetRatchet" => "Get the ratchet angular distance of this cpRatchetJoint.", + + "cpRotaryLimitJointGetMax" => "Get the max delta angle of this cpRotaryLimitJoint.", + "cpRotaryLimitJointGetMin" => "Get the min delta angle of this cpRotaryLimitJoint.", + + "cpSegmentShapeGetA" => "Get the first endpoint of this cpSegmentShape.", + "cpSegmentShapeGetB" => "Get the second endpoint of this cpSegmentShape.", + "cpSegmentShapeGetNormal" => "Get the normal of this cpSegmentShape.", + "cpSegmentShapeGetRadius" => "Get the radius of this cpSegmentShape.", + + "cpShapeGetBB" => "Get the bounding box of this cpShape.", + "cpShapeGetBody" => "Get the body this cpShape is attached to.", + "cpShapeGetCollisionType" => "Get the collision type of this cpShape.", + "cpShapeGetElasticity" => "Get the elasticity of this cpShape.", + "cpShapeGetFriction" => "Get the friction of this cpShape.", + "cpShapeGetGroup" => "Get the group of this cpShape.", + "cpShapeGetLayers" => "Get the layer bitmask of this cpShape.", + "cpShapeGetSensor" => "Get the sensor flag of this cpShape.", + "cpShapeGetSurfaceVelocity" => "Get the surface velocity of this cpShape.", + "cpShapeGetUserData" => "Get the user data pointer of this cpShape.", + + "cpSimpleMotorGetRate" => "Get the rate of this cpSimpleMotor.", + + "cpSlideJointGetAnchr1" => "Get the anchr1 of this cpSlideJoint.", + "cpSlideJointGetAnchr2" => "Get the anchr2 of this cpSlideJoint.", + "cpSlideJointGetMax" => "Get the max distance between the anchors of this cpSlideJoint.", + "cpSlideJointGetMin" => "Get the min distance between the anchors of this cpSlideJoint.", + + "cpSpaceGetCollisionBias" => "Get the collision bias of this cpSpace.", + "cpSpaceGetCollisionPersistence" => "Get the collision persistence of this cpSpace.", + "cpSpaceGetCollisionSlop" => "Get the collision slop of this cpSpace.", + "cpSpaceGetCurrentTimeStep" => "Get the most recent timestep used with this cpSpace.", + "cpSpaceGetDamping" => "Get the damping of this cpSpace.", + "cpSpaceGetEnableContactGraph" => "Get the enable contact graph flag of this cpSpace.", + "cpSpaceGetGravity" => "Get the gravity of this cpSpace.", + "cpSpaceGetIdleSpeedThreshold" => "Get the idle speed threshold of this cpSpace.", + "cpSpaceGetIterations" => "Get the number of solver iterations of this cpSpace.", + "cpSpaceGetSleepTimeThreshold" => "Get the sleep time threshold of this cpSpace.", + "cpSpaceGetStaticBody" => "Get the static body of this cpSpace.", + "cpSpaceGetUserData" => "Get the user data pointer of this cpSpace.", +} + +def output_getter(func) + name = func[:name] + + doc = GETTER_DOCS[name] + return if doc == SKIP + + struct, property = */(cp\w*)Get(.+)/.match(name).captures + + if doc + prototype = "#{func[:inline] ? "static inline " : ""}#{func[:return]} #{name}(#{func[:args]})" + +DOC_FILE.puts <<-EOF +/// @addtogroup #{struct} +/// @{ +/// @fn #{prototype}; +/// @brief #{doc} +#{prototype}; +/// @} + +EOF + else + puts %{\t"#{name}" => "Get the #{property.downcase} of this #{struct}.",} + end +end + + +def output_setter(func) + name = func[:name] + + doc = GETTER_DOCS[name.gsub("Set", "Get")] + return if doc == SKIP + + struct, property = */(cp\w*)Set(.+)/.match(name).captures + + if doc + prototype = "static inline void #{name}(#{func[:args]})" + +DOC_FILE.puts <<-EOF +/// @addtogroup #{struct} +/// @{ +/// @fn #{prototype}; +/// @brief #{doc.gsub("Get", "Set")} +#{prototype}; +/// @}" + +EOF + else + puts %{\t"#{name}" => "Set the #{property.downcase} of this #{struct}.",} + end +end + + +getters = FUNCS.keys.find_all{|name| /(cp\w*)Get(.+)/.match(name)}.sort +FUNCS.values_at(*getters).each{|func| output_getter(func)} + +setters = FUNCS.keys.find_all{|name| /(cp\w*)Set(.+)/.match(name)}.sort +FUNCS.values_at(*setters).each{|func| output_setter(func)} diff --git a/external/Chipmunk/extract_protos.rb b/external/Chipmunk/extract_protos.rb new file mode 100644 index 0000000..e51856b --- /dev/null +++ b/external/Chipmunk/extract_protos.rb @@ -0,0 +1,22 @@ +# match 0 is the whole function proto +# match 1 is either "static inline " or nil +# match 2 is the return type +# match 3 is the function symbol name +# match 4 is the arguments +PATTERN = /.*?((static inline )?(\w*\*?)\s(cp\w*)\((.*?)\))/ + +IO.readlines("|gcc -DNDEBUG -E include/chipmunk/chipmunk.h").each do|line| + str = line + + while match = PATTERN.match(str) + str = match.post_match + + proto, inline, ret, name, args = match.captures.values_at(0, 1, 2, 3, 4) + next if ret == "return" || ret == "" + + inline = !!inline + + p({:inline => inline, :return => ret, :name => name, :args => args}) +# puts "#{name} - #{inline ? "static inline " : ""}#{ret} #{name}(#{args})" + end +end diff --git a/external/Chipmunk/include/chipmunk/chipmunk.h b/external/Chipmunk/include/chipmunk/chipmunk.h new file mode 100644 index 0000000..1c0b783 --- /dev/null +++ b/external/Chipmunk/include/chipmunk/chipmunk.h @@ -0,0 +1,224 @@ +/* Copyright (c) 2007 Scott Lembcke + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +#ifndef CHIPMUNK_H +#define CHIPMUNK_H + +#ifdef _MSC_VER + #define _USE_MATH_DEFINES +#endif + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +// NUKE +#ifndef CP_ALLOW_PRIVATE_ACCESS + #define CP_ALLOW_PRIVATE_ACCESS 0 +#endif + +#if CP_ALLOW_PRIVATE_ACCESS == 1 + #define CP_PRIVATE(__symbol__) __symbol__ +#else + #define CP_PRIVATE(__symbol__) __symbol__##_private +#endif + +void cpMessage(const char *condition, const char *file, int line, int isError, int isHardError, const char *message, ...); +#ifdef NDEBUG + #define cpAssertWarn(__condition__, ...) +#else + #define cpAssertWarn(__condition__, ...) if(!(__condition__)) cpMessage(#__condition__, __FILE__, __LINE__, 0, 0, __VA_ARGS__) +#endif + +#ifdef NDEBUG + #define cpAssertSoft(__condition__, ...) +#else + #define cpAssertSoft(__condition__, ...) if(!(__condition__)) cpMessage(#__condition__, __FILE__, __LINE__, 1, 0, __VA_ARGS__) +#endif + +// Hard assertions are important and cheap to execute. They are not disabled by compiling as debug. +#define cpAssertHard(__condition__, ...) if(!(__condition__)) cpMessage(#__condition__, __FILE__, __LINE__, 1, 1, __VA_ARGS__) + + +#include "chipmunk_types.h" + +/// @defgroup misc Misc +/// @{ + +/// Allocated size for various Chipmunk buffers +#ifndef CP_BUFFER_BYTES + #define CP_BUFFER_BYTES (32*1024) +#endif + +#ifndef cpcalloc + /// Chipmunk calloc() alias. + #define cpcalloc calloc +#endif + +#ifndef cprealloc + /// Chipmunk realloc() alias. + #define cprealloc realloc +#endif + +#ifndef cpfree + /// Chipmunk free() alias. + #define cpfree free +#endif + +typedef struct cpArray cpArray; +typedef struct cpHashSet cpHashSet; + +typedef struct cpBody cpBody; +typedef struct cpShape cpShape; +typedef struct cpConstraint cpConstraint; + +typedef struct cpCollisionHandler cpCollisionHandler; +typedef struct cpContactPointSet cpContactPointSet; +typedef struct cpArbiter cpArbiter; + +typedef struct cpSpace cpSpace; + +#include "cpVect.h" +#include "cpBB.h" +#include "cpTransform.h" +#include "cpSpatialIndex.h" + +#include "cpBody.h" +#include "cpShape.h" +#include "cpPolyShape.h" + +#include "cpArbiter.h" +#include "cpConstraint.h" + +#include "cpSpace.h" + +// Chipmunk 7.0.0 +#define CP_VERSION_MAJOR 7 +#define CP_VERSION_MINOR 0 +#define CP_VERSION_RELEASE 0 + +/// Version string. +extern const char *cpVersionString; + +/// Calculate the moment of inertia for a circle. +/// @c r1 and @c r2 are the inner and outer diameters. A solid circle has an inner diameter of 0. +cpFloat cpMomentForCircle(cpFloat m, cpFloat r1, cpFloat r2, cpVect offset); + +/// Calculate area of a hollow circle. +/// @c r1 and @c r2 are the inner and outer diameters. A solid circle has an inner diameter of 0. +cpFloat cpAreaForCircle(cpFloat r1, cpFloat r2); + +/// Calculate the moment of inertia for a line segment. +/// Beveling radius is not supported. +cpFloat cpMomentForSegment(cpFloat m, cpVect a, cpVect b, cpFloat radius); + +/// Calculate the area of a fattened (capsule shaped) line segment. +cpFloat cpAreaForSegment(cpVect a, cpVect b, cpFloat radius); + +/// Calculate the moment of inertia for a solid polygon shape assuming it's center of gravity is at it's centroid. The offset is added to each vertex. +cpFloat cpMomentForPoly(cpFloat m, int count, const cpVect *verts, cpVect offset, cpFloat radius); + +/// Calculate the signed area of a polygon. A Clockwise winding gives positive area. +/// This is probably backwards from what you expect, but matches Chipmunk's the winding for poly shapes. +cpFloat cpAreaForPoly(const int count, const cpVect *verts, cpFloat radius); + +/// Calculate the natural centroid of a polygon. +cpVect cpCentroidForPoly(const int count, const cpVect *verts); + +/// Calculate the moment of inertia for a solid box. +cpFloat cpMomentForBox(cpFloat m, cpFloat width, cpFloat height); + +/// Calculate the moment of inertia for a solid box. +cpFloat cpMomentForBox2(cpFloat m, cpBB box); + +/// Calculate the convex hull of a given set of points. Returns the count of points in the hull. +/// @c result must be a pointer to a @c cpVect array with at least @c count elements. If @c verts == @c result, then @c verts will be reduced inplace. +/// @c first is an optional pointer to an integer to store where the first vertex in the hull came from (i.e. verts[first] == result[0]) +/// @c tol is the allowed amount to shrink the hull when simplifying it. A tolerance of 0.0 creates an exact hull. +int cpConvexHull(int count, const cpVect *verts, cpVect *result, int *first, cpFloat tol); + +#ifdef _MSC_VER +#include "malloc.h" +#endif + +/// Convenience macro to work with cpConvexHull. +/// @c count and @c verts is the input array passed to cpConvexHull(). +/// @c count_var and @c verts_var are the names of the variables the macro creates to store the result. +/// The output vertex array is allocated on the stack using alloca() so it will be freed automatically, but cannot be returned from the current scope. +#define CP_CONVEX_HULL(__count__, __verts__, __count_var__, __verts_var__) \ +cpVect *__verts_var__ = (cpVect *)alloca(__count__*sizeof(cpVect)); \ +int __count_var__ = cpConvexHull(__count__, __verts__, __verts_var__, NULL, 0.0); \ + +/// Returns the closest point on the line segment ab, to the point p. +static inline cpVect +cpClosetPointOnSegment(const cpVect p, const cpVect a, const cpVect b) +{ + cpVect delta = cpvsub(a, b); + cpFloat t = cpfclamp01(cpvdot(delta, cpvsub(p, b))/cpvlengthsq(delta)); + return cpvadd(b, cpvmult(delta, t)); +} + +#if defined(__has_extension) +#if __has_extension(blocks) +// Define alternate block based alternatives for a few of the callback heavy functions. +// Collision handlers are post-step callbacks are not included to avoid memory management issues. +// If you want to use blocks for those and are aware of how to correctly manage the memory, the implementation is trivial. + +void cpSpaceEachBody_b(cpSpace *space, void (^block)(cpBody *body)); +void cpSpaceEachShape_b(cpSpace *space, void (^block)(cpShape *shape)); +void cpSpaceEachConstraint_b(cpSpace *space, void (^block)(cpConstraint *constraint)); + +void cpBodyEachShape_b(cpBody *body, void (^block)(cpShape *shape)); +void cpBodyEachConstraint_b(cpBody *body, void (^block)(cpConstraint *constraint)); +void cpBodyEachArbiter_b(cpBody *body, void (^block)(cpArbiter *arbiter)); + +typedef void (^cpSpacePointQueryBlock)(cpShape *shape, cpVect point, cpFloat distance, cpVect gradient); +void cpSpacePointQuery_b(cpSpace *space, cpVect point, cpFloat maxDistance, cpShapeFilter filter, cpSpacePointQueryBlock block); + +typedef void (^cpSpaceSegmentQueryBlock)(cpShape *shape, cpVect point, cpVect normal, cpFloat alpha); +void cpSpaceSegmentQuery_b(cpSpace *space, cpVect start, cpVect end, cpFloat radius, cpShapeFilter filter, cpSpaceSegmentQueryBlock block); + +typedef void (^cpSpaceBBQueryBlock)(cpShape *shape); +void cpSpaceBBQuery_b(cpSpace *space, cpBB bb, cpShapeFilter filter, cpSpaceBBQueryBlock block); + +typedef void (^cpSpaceShapeQueryBlock)(cpShape *shape, cpContactPointSet *points); +cpBool cpSpaceShapeQuery_b(cpSpace *space, cpShape *shape, cpSpaceShapeQueryBlock block); + +#endif +#endif + + +//@} + +#ifdef __cplusplus +} + +static inline cpVect operator *(const cpVect v, const cpFloat s){return cpvmult(v, s);} +static inline cpVect operator +(const cpVect v1, const cpVect v2){return cpvadd(v1, v2);} +static inline cpVect operator -(const cpVect v1, const cpVect v2){return cpvsub(v1, v2);} +static inline cpBool operator ==(const cpVect v1, const cpVect v2){return cpveql(v1, v2);} +static inline cpVect operator -(const cpVect v){return cpvneg(v);} + +#endif +#endif diff --git a/external/Chipmunk/include/chipmunk/chipmunk_ffi.h b/external/Chipmunk/include/chipmunk/chipmunk_ffi.h new file mode 100644 index 0000000..f95bf32 --- /dev/null +++ b/external/Chipmunk/include/chipmunk/chipmunk_ffi.h @@ -0,0 +1,174 @@ +#ifdef CHIPMUNK_FFI + +// Create non static inlined copies of Chipmunk functions, useful for working with dynamic FFIs +// This file should only be included in chipmunk.c + +// TODO: get rid of the reliance on static inlines. +// They make a mess for FFIs. + +#ifdef _MSC_VER + #if _MSC_VER >= 1600 + #define MAKE_REF(name) decltype(name) *_##name = name + #else + #define MAKE_REF(name) + #endif +#else + #define MAKE_REF(name) __typeof__(name) *_##name = name +#endif + +#define MAKE_PROPERTIES_REF(struct, property) \ + MAKE_REF(struct##Get##property); MAKE_REF(struct##Set##property) + +MAKE_REF(cpv); // makes a variable named _cpv that contains the function pointer for cpv() +MAKE_REF(cpveql); +MAKE_REF(cpvadd); +MAKE_REF(cpvneg); +MAKE_REF(cpvsub); +MAKE_REF(cpvmult); +MAKE_REF(cpvdot); +MAKE_REF(cpvcross); +MAKE_REF(cpvperp); +MAKE_REF(cpvrperp); +MAKE_REF(cpvproject); +MAKE_REF(cpvforangle); +MAKE_REF(cpvtoangle); +MAKE_REF(cpvrotate); +MAKE_REF(cpvunrotate); +MAKE_REF(cpvlengthsq); +MAKE_REF(cpvlength); +MAKE_REF(cpvlerp); +MAKE_REF(cpvnormalize); +MAKE_REF(cpvclamp); +MAKE_REF(cpvlerpconst); +MAKE_REF(cpvdist); +MAKE_REF(cpvdistsq); +MAKE_REF(cpvnear); + +MAKE_REF(cpfmax); +MAKE_REF(cpfmin); +MAKE_REF(cpfabs); +MAKE_REF(cpfclamp); +MAKE_REF(cpflerp); +MAKE_REF(cpflerpconst); + +MAKE_REF(cpBBNew); +MAKE_REF(cpBBNewForCircle); +MAKE_REF(cpBBIntersects); +MAKE_REF(cpBBContainsBB); +MAKE_REF(cpBBContainsVect); +MAKE_REF(cpBBMerge); +MAKE_REF(cpBBExpand); +MAKE_REF(cpBBArea); +MAKE_REF(cpBBMergedArea); +MAKE_REF(cpBBSegmentQuery); +MAKE_REF(cpBBIntersectsSegment); +MAKE_REF(cpBBClampVect); + +MAKE_REF(cpBodyGetMass); +MAKE_REF(cpBodyGetMoment); +MAKE_REF(cpBodyGetPosition); +MAKE_REF(cpBodyGetAngle); +MAKE_REF(cpBodyGetRotation); +MAKE_PROPERTIES_REF(cpBody, Velocity); +MAKE_PROPERTIES_REF(cpBody, Force); +MAKE_PROPERTIES_REF(cpBody, AngularVelocity); +MAKE_PROPERTIES_REF(cpBody, Torque); +MAKE_PROPERTIES_REF(cpBody, VelocityLimit); +MAKE_PROPERTIES_REF(cpBody, AngularVelocityLimit); +MAKE_PROPERTIES_REF(cpBody, UserData); +MAKE_REF(cpBodyIsSleeping); +MAKE_REF(cpBodyIsStatic); +//MAKE_REF(cpBodyIsRogue); +MAKE_REF(cpBodyLocalToWorld); +MAKE_REF(cpBodyWorldToLocal); +MAKE_REF(cpBodyKineticEnergy); + +MAKE_REF(cpShapeGetBB); +MAKE_PROPERTIES_REF(cpShape, Body); +MAKE_PROPERTIES_REF(cpShape, Sensor); +MAKE_PROPERTIES_REF(cpShape, Elasticity); +MAKE_PROPERTIES_REF(cpShape, Friction); +MAKE_PROPERTIES_REF(cpShape, SurfaceVelocity); +MAKE_PROPERTIES_REF(cpShape, UserData); +MAKE_PROPERTIES_REF(cpShape, CollisionType); +MAKE_PROPERTIES_REF(cpShape, Filter); + +MAKE_REF(cpArbiterGetShapes); +MAKE_REF(cpArbiterGetBodies); +MAKE_REF(cpArbiterIsFirstContact); +MAKE_REF(cpArbiterGetCount); + +MAKE_REF(cpConstraintGetA); +MAKE_REF(cpConstraintGetB); +MAKE_PROPERTIES_REF(cpConstraint, MaxForce); +MAKE_PROPERTIES_REF(cpConstraint, ErrorBias); +MAKE_PROPERTIES_REF(cpConstraint, MaxBias); +MAKE_PROPERTIES_REF(cpConstraint, UserData); +MAKE_REF(cpConstraintGetImpulse); + +MAKE_PROPERTIES_REF(cpDampedRotarySpring, RestAngle); +MAKE_PROPERTIES_REF(cpDampedRotarySpring, Stiffness); +MAKE_PROPERTIES_REF(cpDampedRotarySpring, Damping); +//MAKE_PROPERTIES_REF(cpDampedRotarySpring, SpringTorqueFunc); + +MAKE_PROPERTIES_REF(cpDampedSpring, Anchr1); +MAKE_PROPERTIES_REF(cpDampedSpring, Anchr2); +MAKE_PROPERTIES_REF(cpDampedSpring, RestLength); +MAKE_PROPERTIES_REF(cpDampedSpring, Stiffness); +MAKE_PROPERTIES_REF(cpDampedSpring, Damping); +//MAKE_PROPERTIES_REF(cpDampedSpring, SpringForceFunc); + +MAKE_PROPERTIES_REF(cpGearJoint, Phase); +MAKE_REF(cpGearJointGetRatio); + +MAKE_PROPERTIES_REF(cpGrooveJoint, Anchr2); +MAKE_REF(cpGrooveJointGetGrooveA); +MAKE_REF(cpGrooveJointGetGrooveB); + +MAKE_PROPERTIES_REF(cpPinJoint, Anchr1); +MAKE_PROPERTIES_REF(cpPinJoint, Anchr2); +MAKE_PROPERTIES_REF(cpPinJoint, Dist); + +MAKE_PROPERTIES_REF(cpPivotJoint, Anchr1); +MAKE_PROPERTIES_REF(cpPivotJoint, Anchr2); + +MAKE_PROPERTIES_REF(cpRatchetJoint, Angle); +MAKE_PROPERTIES_REF(cpRatchetJoint, Phase); +MAKE_PROPERTIES_REF(cpRatchetJoint, Ratchet); + +MAKE_PROPERTIES_REF(cpRotaryLimitJoint, Min); +MAKE_PROPERTIES_REF(cpRotaryLimitJoint, Max); + +MAKE_PROPERTIES_REF(cpSimpleMotor, Rate); + +MAKE_PROPERTIES_REF(cpSlideJoint, Anchr1); +MAKE_PROPERTIES_REF(cpSlideJoint, Anchr2); +MAKE_PROPERTIES_REF(cpSlideJoint, Min); +MAKE_PROPERTIES_REF(cpSlideJoint, Max); + +MAKE_REF(cpSpatialIndexDestroy); +MAKE_REF(cpSpatialIndexCount); +MAKE_REF(cpSpatialIndexEach); +MAKE_REF(cpSpatialIndexContains); +MAKE_REF(cpSpatialIndexInsert); +MAKE_REF(cpSpatialIndexRemove); +MAKE_REF(cpSpatialIndexReindex); +MAKE_REF(cpSpatialIndexReindexObject); +MAKE_REF(cpSpatialIndexSegmentQuery); +MAKE_REF(cpSpatialIndexQuery); +MAKE_REF(cpSpatialIndexReindexQuery); + +MAKE_PROPERTIES_REF(cpSpace, Iterations); +MAKE_PROPERTIES_REF(cpSpace, Gravity); +MAKE_PROPERTIES_REF(cpSpace, Damping); +MAKE_PROPERTIES_REF(cpSpace, IdleSpeedThreshold); +MAKE_PROPERTIES_REF(cpSpace, SleepTimeThreshold); +MAKE_PROPERTIES_REF(cpSpace, CollisionSlop); +MAKE_PROPERTIES_REF(cpSpace, CollisionBias); +MAKE_PROPERTIES_REF(cpSpace, CollisionPersistence); +MAKE_PROPERTIES_REF(cpSpace, UserData); +MAKE_REF(cpSpaceGetStaticBody); +MAKE_REF(cpSpaceGetCurrentTimeStep); +MAKE_REF(cpSpaceIsLocked); + +#endif diff --git a/external/Chipmunk/include/chipmunk/chipmunk_private.h b/external/Chipmunk/include/chipmunk/chipmunk_private.h new file mode 100644 index 0000000..afea074 --- /dev/null +++ b/external/Chipmunk/include/chipmunk/chipmunk_private.h @@ -0,0 +1,411 @@ +/* Copyright (c) 2007 Scott Lembcke + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +#ifdef CHIPMUNK_H +#error Cannot include chipmunk_private.h after chipmunk.h. +#endif + +#ifndef CHIPMUNK_PRIVATE_H +#define CHIPMUNK_PRIVATE_H + +#define CP_ALLOW_PRIVATE_ACCESS 1 +#include "chipmunk.h" + +#define CP_HASH_COEF (3344921057ul) +#define CP_HASH_PAIR(A, B) ((cpHashValue)(A)*CP_HASH_COEF ^ (cpHashValue)(B)*CP_HASH_COEF) + +// TODO: Eww. Magic numbers. +#define MAGIC_EPSILON 1e-5 + +//MARK: cpArray + +struct cpArray { + int num, max; + void **arr; +}; + +cpArray *cpArrayNew(int size); + +void cpArrayFree(cpArray *arr); + +void cpArrayPush(cpArray *arr, void *object); +void *cpArrayPop(cpArray *arr); +void cpArrayDeleteObj(cpArray *arr, void *obj); +cpBool cpArrayContains(cpArray *arr, void *ptr); + +void cpArrayFreeEach(cpArray *arr, void (freeFunc)(void*)); + + +//MARK: cpHashSet + +typedef cpBool (*cpHashSetEqlFunc)(void *ptr, void *elt); +typedef void *(*cpHashSetTransFunc)(void *ptr, void *data); + +cpHashSet *cpHashSetNew(int size, cpHashSetEqlFunc eqlFunc); +void cpHashSetSetDefaultValue(cpHashSet *set, void *default_value); + +void cpHashSetFree(cpHashSet *set); + +int cpHashSetCount(cpHashSet *set); +void *cpHashSetInsert(cpHashSet *set, cpHashValue hash, void *ptr, cpHashSetTransFunc trans, void *data); +void *cpHashSetRemove(cpHashSet *set, cpHashValue hash, void *ptr); +void *cpHashSetFind(cpHashSet *set, cpHashValue hash, void *ptr); + +typedef void (*cpHashSetIteratorFunc)(void *elt, void *data); +void cpHashSetEach(cpHashSet *set, cpHashSetIteratorFunc func, void *data); + +typedef cpBool (*cpHashSetFilterFunc)(void *elt, void *data); +void cpHashSetFilter(cpHashSet *set, cpHashSetFilterFunc func, void *data); + + +//MARK: Body Functions + +static inline cpBool cpBodyIsDynamic(cpBody *body){return (cpBodyGetType(body) == CP_BODY_TYPE_DYNAMIC);} +static inline cpBool cpBodyIsKinematic(cpBody *body){return (cpBodyGetType(body) == CP_BODY_TYPE_KINEMATIC);} +static inline cpBool cpBodyIsStatic(cpBody *body){return (cpBodyGetType(body) == CP_BODY_TYPE_STATIC);} + +void cpBodyAddShape(cpBody *body, cpShape *shape); +void cpBodyRemoveShape(cpBody *body, cpShape *shape); + +//void cpBodyAccumulateMassForShape(cpBody *body, cpShape *shape); +void cpBodyAccumulateMassFromShapes(cpBody *body); + +void cpBodyRemoveConstraint(cpBody *body, cpConstraint *constraint); + + +//MARK: Spatial Index Functions + +cpSpatialIndex *cpSpatialIndexInit(cpSpatialIndex *index, cpSpatialIndexClass *klass, cpSpatialIndexBBFunc bbfunc, cpSpatialIndex *staticIndex); + + +//MARK: Arbiters + +enum cpArbiterState { + // Arbiter is active and its the first collision. + CP_ARBITER_STATE_FIRST_COLLISION, + // Arbiter is active and its not the first collision. + CP_ARBITER_STATE_NORMAL, + // Collision has been explicitly ignored. + // Either by returning false from a begin collision handler or calling cpArbiterIgnore(). + CP_ARBITER_STATE_IGNORE, + // Collison is no longer active. A space will cache an arbiter for up to cpSpace.collisionPersistence more steps. + CP_ARBITER_STATE_CACHED, + // Collison arbiter is invalid because one of the shapes was removed. + CP_ARBITER_STATE_INVALIDATED, +}; + +struct cpArbiterThread { + struct cpArbiter *next, *prev; +}; + +struct cpContact { + cpVect r1, r2; + + cpFloat nMass, tMass; + cpFloat bounce; // TODO: look for an alternate bounce solution. + + cpFloat jnAcc, jtAcc, jBias; + cpFloat bias; + + cpHashValue hash; +}; + +struct cpCollisionInfo { + const cpShape *a, *b; + cpCollisionID id; + + cpVect n; + + int count; + // TODO Should this be a unique struct type? + struct cpContact *arr; +}; + +struct cpArbiter { + cpFloat e; + cpFloat u; + cpVect surface_vr; + + cpDataPointer data; + + const cpShape *a, *b; + cpBody *body_a, *body_b; + struct cpArbiterThread thread_a, thread_b; + + int count; + struct cpContact *contacts; + cpVect n; + + // Regular, wildcard A and wildcard B collision handlers. + cpCollisionHandler *handler, *handlerA, *handlerB; + cpBool swapped; + + cpTimestamp stamp; + enum cpArbiterState state; +}; + +cpArbiter* cpArbiterInit(cpArbiter *arb, cpShape *a, cpShape *b); + +static inline struct cpArbiterThread * +cpArbiterThreadForBody(cpArbiter *arb, cpBody *body) +{ + return (arb->body_a == body ? &arb->thread_a : &arb->thread_b); +} + +void cpArbiterUnthread(cpArbiter *arb); + +void cpArbiterUpdate(cpArbiter *arb, struct cpCollisionInfo *info, cpSpace *space); +void cpArbiterPreStep(cpArbiter *arb, cpFloat dt, cpFloat bias, cpFloat slop); +void cpArbiterApplyCachedImpulse(cpArbiter *arb, cpFloat dt_coef); +void cpArbiterApplyImpulse(cpArbiter *arb); + + +//MARK: Shape/Collision Functions + +cpShape *cpShapeInit(cpShape *shape, const cpShapeClass *klass, cpBody *body, struct cpShapeMassInfo massInfo); + +static inline cpBool +cpShapeActive(cpShape *shape) +{ + return shape->prev || (shape->body && shape->body->shapeList == shape); +} + +// Note: This function returns contact points with r1/r2 in absolute coordinates, not body relative. +struct cpCollisionInfo cpCollide(const cpShape *a, const cpShape *b, cpCollisionID id, struct cpContact *contacts); + +static inline void +CircleSegmentQuery(cpShape *shape, cpVect center, cpFloat r1, cpVect a, cpVect b, cpFloat r2, cpSegmentQueryInfo *info) +{ + cpVect da = cpvsub(a, center); + cpVect db = cpvsub(b, center); + cpFloat rsum = r1 + r2; + + cpFloat qa = cpvdot(da, da) - 2.0f*cpvdot(da, db) + cpvdot(db, db); + cpFloat qb = cpvdot(da, db) - cpvdot(da, da); + cpFloat det = qb*qb - qa*(cpvdot(da, da) - rsum*rsum); + + if(det >= 0.0f){ + cpFloat t = (-qb - cpfsqrt(det))/(qa); + if(0.0f<= t && t <= 1.0f){ + cpVect n = cpvnormalize(cpvlerp(da, db, t)); + + info->shape = shape; + info->point = cpvsub(cpvlerp(a, b, t), cpvmult(n, r2)); + info->normal = n; + info->alpha = t; + } + } +} + +static inline cpBool +cpShapeFilterReject(cpShapeFilter a, cpShapeFilter b) +{ + // Reject the collision if: + return ( + // They are in the same non-zero group. + (a.group != 0 && a.group == b.group) || + // One of the category/mask combinations fails. + (a.categories & b.mask) == 0 || + (b.categories & a.mask) == 0 + ); +} + + +//MARK: Constraint Functions +// TODO naming conventions here + +#define CP_DefineClassGetter(t) const cpConstraintClass * t##GetClass(void){return (cpConstraintClass *)&klass;} + +void cpConstraintInit(cpConstraint *constraint, const cpConstraintClass *klass, cpBody *a, cpBody *b); + +static inline cpVect +relative_velocity(cpBody *a, cpBody *b, cpVect r1, cpVect r2){ + cpVect v1_sum = cpvadd(a->CP_PRIVATE(v), cpvmult(cpvperp(r1), a->CP_PRIVATE(w))); + cpVect v2_sum = cpvadd(b->CP_PRIVATE(v), cpvmult(cpvperp(r2), b->CP_PRIVATE(w))); + + return cpvsub(v2_sum, v1_sum); +} + +static inline cpFloat +normal_relative_velocity(cpBody *a, cpBody *b, cpVect r1, cpVect r2, cpVect n){ + return cpvdot(relative_velocity(a, b, r1, r2), n); +} + +static inline void +apply_impulse(cpBody *body, cpVect j, cpVect r){ + body->CP_PRIVATE(v) = cpvadd(body->CP_PRIVATE(v), cpvmult(j, body->CP_PRIVATE(m_inv))); + body->CP_PRIVATE(w) += body->CP_PRIVATE(i_inv)*cpvcross(r, j); +} + +static inline void +apply_impulses(cpBody *a , cpBody *b, cpVect r1, cpVect r2, cpVect j) +{ + apply_impulse(a, cpvneg(j), r1); + apply_impulse(b, j, r2); +} + +static inline void +apply_bias_impulse(cpBody *body, cpVect j, cpVect r) +{ + body->CP_PRIVATE(v_bias) = cpvadd(body->CP_PRIVATE(v_bias), cpvmult(j, body->CP_PRIVATE(m_inv))); + body->CP_PRIVATE(w_bias) += body->CP_PRIVATE(i_inv)*cpvcross(r, j); +} + +static inline void +apply_bias_impulses(cpBody *a , cpBody *b, cpVect r1, cpVect r2, cpVect j) +{ + apply_bias_impulse(a, cpvneg(j), r1); + apply_bias_impulse(b, j, r2); +} + +static inline cpFloat +k_scalar_body(cpBody *body, cpVect r, cpVect n) +{ + cpFloat rcn = cpvcross(r, n); + return body->CP_PRIVATE(m_inv) + body->CP_PRIVATE(i_inv)*rcn*rcn; +} + +static inline cpFloat +k_scalar(cpBody *a, cpBody *b, cpVect r1, cpVect r2, cpVect n) +{ + cpFloat value = k_scalar_body(a, r1, n) + k_scalar_body(b, r2, n); + cpAssertSoft(value != 0.0, "Unsolvable collision or constraint."); + + return value; +} + +static inline cpMat2x2 +k_tensor(cpBody *a, cpBody *b, cpVect r1, cpVect r2) +{ + cpFloat m_sum = a->CP_PRIVATE(m_inv) + b->CP_PRIVATE(m_inv); + + // start with Identity*m_sum + cpFloat k11 = m_sum, k12 = 0.0f; + cpFloat k21 = 0.0f, k22 = m_sum; + + // add the influence from r1 + cpFloat a_i_inv = a->CP_PRIVATE(i_inv); + cpFloat r1xsq = r1.x * r1.x * a_i_inv; + cpFloat r1ysq = r1.y * r1.y * a_i_inv; + cpFloat r1nxy = -r1.x * r1.y * a_i_inv; + k11 += r1ysq; k12 += r1nxy; + k21 += r1nxy; k22 += r1xsq; + + // add the influnce from r2 + cpFloat b_i_inv = b->CP_PRIVATE(i_inv); + cpFloat r2xsq = r2.x * r2.x * b_i_inv; + cpFloat r2ysq = r2.y * r2.y * b_i_inv; + cpFloat r2nxy = -r2.x * r2.y * b_i_inv; + k11 += r2ysq; k12 += r2nxy; + k21 += r2nxy; k22 += r2xsq; + + // invert + cpFloat det = k11*k22 - k12*k21; + cpAssertSoft(det != 0.0, "Unsolvable constraint."); + + cpFloat det_inv = 1.0f/det; + return cpMat2x2New( + k22*det_inv, -k12*det_inv, + -k21*det_inv, k11*det_inv + ); +} + +static inline cpFloat +bias_coef(cpFloat errorBias, cpFloat dt) +{ + return 1.0f - cpfpow(errorBias, dt); +} + + +//MARK: Space Functions + +#define cpAssertSpaceUnlocked(space) \ + cpAssertHard(!space->locked, \ + "This operation cannot be done safely during a call to cpSpaceStep() or during a query. " \ + "Put these calls into a post-step callback." \ + ); + +void cpSpaceSetStaticBody(cpSpace *space, cpBody *body); + +extern cpCollisionHandler cpCollisionHandlerDoNothing; + +void cpSpaceProcessComponents(cpSpace *space, cpFloat dt); + +void cpSpacePushFreshContactBuffer(cpSpace *space); +struct cpContact *cpContactBufferGetArray(cpSpace *space); +void cpSpacePushContacts(cpSpace *space, int count); + +typedef struct cpPostStepCallback { + cpPostStepFunc func; + void *key; + void *data; +} cpPostStepCallback; + +cpPostStepCallback *cpSpaceGetPostStepCallback(cpSpace *space, void *key); + +cpBool cpSpaceArbiterSetFilter(cpArbiter *arb, cpSpace *space); +void cpSpaceFilterArbiters(cpSpace *space, cpBody *body, cpShape *filter); + +void cpSpaceActivateBody(cpSpace *space, cpBody *body); +void cpSpaceLock(cpSpace *space); +void cpSpaceUnlock(cpSpace *space, cpBool runPostStep); + +static inline void +cpSpaceUncacheArbiter(cpSpace *space, cpArbiter *arb) +{ + const cpShape *a = arb->a, *b = arb->b; + const cpShape *shape_pair[] = {a, b}; + cpHashValue arbHashID = CP_HASH_PAIR((cpHashValue)a, (cpHashValue)b); + cpHashSetRemove(space->cachedArbiters, arbHashID, shape_pair); + cpArrayDeleteObj(space->arbiters, arb); +} + +void cpShapeUpdateFunc(cpShape *shape, void *unused); +cpCollisionID cpSpaceCollideShapes(cpShape *a, cpShape *b, cpCollisionID id, cpSpace *space); + + +//MARK: Foreach loops + +static inline cpConstraint * +cpConstraintNext(cpConstraint *node, cpBody *body) +{ + return (node->a == body ? node->next_a : node->next_b); +} + +#define CP_BODY_FOREACH_CONSTRAINT(bdy, var)\ + for(cpConstraint *var = bdy->constraintList; var; var = cpConstraintNext(var, bdy)) + +static inline cpArbiter * +cpArbiterNext(cpArbiter *node, cpBody *body) +{ + return (node->body_a == body ? node->thread_a.next : node->thread_b.next); +} + +#define CP_BODY_FOREACH_ARBITER(bdy, var)\ + for(cpArbiter *var = bdy->arbiterList; var; var = cpArbiterNext(var, bdy)) + +#define CP_BODY_FOREACH_SHAPE(body, var)\ + for(cpShape *var = body->shapeList; var; var = var->next) + +#define CP_BODY_FOREACH_COMPONENT(root, var)\ + for(cpBody *var = root; var; var = var->node.next) + +#endif diff --git a/external/Chipmunk/include/chipmunk/chipmunk_types.h b/external/Chipmunk/include/chipmunk/chipmunk_types.h new file mode 100644 index 0000000..41ff031 --- /dev/null +++ b/external/Chipmunk/include/chipmunk/chipmunk_types.h @@ -0,0 +1,245 @@ +#ifndef CHIPMUNK_TYPES_H +#define CHIPMUNK_TYPES_H + +#include +#include +#include + +#ifdef __APPLE__ + #include "TargetConditionals.h" +#endif + +#if ((TARGET_OS_IPHONE == 1) || (TARGET_OS_MAC == 1)) && (!defined CP_USE_CGTYPES) + #define CP_USE_CGTYPES 1 +#endif + +#if CP_USE_CGTYPES == 1 + #if TARGET_OS_IPHONE + #import + #import + #elif TARGET_OS_MAC + #include + #endif + + #if defined(__LP64__) && __LP64__ + #define CP_USE_DOUBLES 1 + #else + #define CP_USE_DOUBLES 0 + #endif +#endif + +#ifndef CP_USE_DOUBLES + // use doubles by default for higher precision + #define CP_USE_DOUBLES 1 +#endif + +/// @defgroup basicTypes Basic Types +/// Most of these types can be configured at compile time. +/// @{ + +#if CP_USE_DOUBLES +/// Chipmunk's floating point type. +/// Can be reconfigured at compile time. + typedef double cpFloat; + #define cpfsqrt sqrt + #define cpfsin sin + #define cpfcos cos + #define cpfacos acos + #define cpfatan2 atan2 + #define cpfmod fmod + #define cpfexp exp + #define cpfpow pow + #define cpffloor floor + #define cpfceil ceil + #define CPFLOAT_MIN DBL_MIN +#else + typedef float cpFloat; + #define cpfsqrt sqrtf + #define cpfsin sinf + #define cpfcos cosf + #define cpfacos acosf + #define cpfatan2 atan2f + #define cpfmod fmodf + #define cpfexp expf + #define cpfpow powf + #define cpffloor floorf + #define cpfceil ceilf + #define CPFLOAT_MIN FLT_MIN +#endif + +#ifndef INFINITY + #ifdef _MSC_VER + union MSVC_EVIL_FLOAT_HACK + { + unsigned __int8 Bytes[4]; + float Value; + }; + static union MSVC_EVIL_FLOAT_HACK INFINITY_HACK = {{0x00, 0x00, 0x80, 0x7F}}; + #define INFINITY (INFINITY_HACK.Value) + #endif + + #ifdef __GNUC__ + #define INFINITY (__builtin_inf()) + #endif + + #ifndef INFINITY + #define INFINITY (1e1000) + #endif +#endif + +#ifndef M_PI + #define M_PI 3.14159265358979323846264338327950288 +#endif + +#ifndef M_E + #define M_E 2.71828182845904523536028747135266250 +#endif + + +/// Return the max of two cpFloats. +static inline cpFloat cpfmax(cpFloat a, cpFloat b) +{ + return (a > b) ? a : b; +} + +/// Return the min of two cpFloats. +static inline cpFloat cpfmin(cpFloat a, cpFloat b) +{ + return (a < b) ? a : b; +} + +/// Return the absolute value of a cpFloat. +static inline cpFloat cpfabs(cpFloat f) +{ + return (f < 0) ? -f : f; +} + +/// Clamp @c f to be between @c min and @c max. +static inline cpFloat cpfclamp(cpFloat f, cpFloat min, cpFloat max) +{ + return cpfmin(cpfmax(f, min), max); +} + +/// Clamp @c f to be between 0 and 1. +static inline cpFloat cpfclamp01(cpFloat f) +{ + return cpfmax(0.0f, cpfmin(f, 1.0f)); +} + + + +/// Linearly interpolate (or extrapolate) between @c f1 and @c f2 by @c t percent. +static inline cpFloat cpflerp(cpFloat f1, cpFloat f2, cpFloat t) +{ + return f1*(1.0f - t) + f2*t; +} + +/// Linearly interpolate from @c f1 to @c f2 by no more than @c d. +static inline cpFloat cpflerpconst(cpFloat f1, cpFloat f2, cpFloat d) +{ + return f1 + cpfclamp(f2 - f1, -d, d); +} + +/// Hash value type. +typedef uintptr_t cpHashValue; + +/// Type used internally to cache colliding object info for cpCollideShapes(). +/// Should be at least 32 bits. +typedef uint32_t cpCollisionID; + +// Oh C, how we love to define our own boolean types to get compiler compatibility +/// Chipmunk's boolean type. +#ifdef CP_BOOL_TYPE + typedef CP_BOOL_TYPE cpBool; +#else + typedef unsigned char cpBool; +#endif + +#ifndef cpTrue +/// true value. + #define cpTrue 1 +#endif + +#ifndef cpFalse +/// false value. + #define cpFalse 0 +#endif + +#ifdef CP_DATA_POINTER_TYPE + typedef CP_DATA_POINTER_TYPE cpDataPointer; +#else +/// Type used for user data pointers. + typedef void * cpDataPointer; +#endif + +#ifdef CP_COLLISION_TYPE_TYPE + typedef CP_COLLISION_TYPE_TYPE cpCollisionType; +#else +/// Type used for cpSpace.collision_type. + typedef uintptr_t cpCollisionType; +#endif + +#ifdef CP_GROUP_TYPE + typedef CP_GROUP_TYPE cpGroup; +#else +/// Type used for cpShape.group. + typedef uintptr_t cpGroup; +#endif + +#ifdef CP_BITMASK_TYPE + typedef CP_BITMASK_TYPE cpLayers; +#else +/// Type used for cpShapeFilter category and mask. + typedef unsigned int cpBitmask; +#endif + +#ifdef CP_TIMESTAMP_TYPE + typedef CP_TIMESTAMP_TYPE cpTimestamp; +#else +/// Type used for various timestamps in Chipmunk. + typedef unsigned int cpTimestamp; +#endif + +#ifndef CP_NO_GROUP +/// Value for cpShape.group signifying that a shape is in no group. + #define CP_NO_GROUP ((cpGroup)0) +#endif + +#ifndef CP_ALL_CATEGORIES +/// Value for cpShape.layers signifying that a shape is in every layer. + #define CP_ALL_CATEGORIES (~(cpBitmask)0) +#endif + +#ifndef CP_WILDCARD_COLLISION_TYPE +/// cpCollisionType value internally reserved for hashing wildcard handlers. + #define CP_WILDCARD_COLLISION_TYPE (~(cpCollisionType)0) +#endif + +/// @} + +// CGPoints are structurally the same, and allow +// easy interoperability with other Cocoa libraries +#if CP_USE_CGTYPES + typedef CGPoint cpVect; +#else +/// Chipmunk's 2D vector type. +/// @addtogroup cpVect + typedef struct cpVect{cpFloat x,y;} cpVect; +#endif + +#if CP_USE_CGTYPES + typedef CGAffineTransform cpTransform; +#else + /// Column major affine transform. + typedef struct cpTransform { + cpFloat a, b, c, d, tx, ty; + } cpTransform; +#endif + +// NUKE +typedef struct cpMat2x2 { + // Row major [[a, b][c d]] + cpFloat a, b, c, d; +} cpMat2x2; + +#endif diff --git a/external/Chipmunk/include/chipmunk/chipmunk_unsafe.h b/external/Chipmunk/include/chipmunk/chipmunk_unsafe.h new file mode 100644 index 0000000..6b3b6db --- /dev/null +++ b/external/Chipmunk/include/chipmunk/chipmunk_unsafe.h @@ -0,0 +1,66 @@ +/* Copyright (c) 2007 Scott Lembcke + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +/* This header defines a number of "unsafe" operations on Chipmunk objects. + * In this case "unsafe" is referring to operations which may reduce the + * physical accuracy or numerical stability of the simulation, but will not + * cause crashes. + * + * The prime example is mutating collision shapes. Chipmunk does not support + * this directly. Mutating shapes using this API will caused objects in contact + * to be pushed apart using Chipmunk's overlap solver, but not using real + * persistent velocities. Probably not what you meant, but perhaps close enough. + */ + +/// @defgroup unsafe Chipmunk Unsafe Shape Operations +/// These functions are used for mutating collision shapes. +/// Chipmunk does not have any way to get velocity information on changing shapes, +/// so the results will be unrealistic. You must explicity include the chipmunk_unsafe.h header to use them. +/// @{ + +#ifndef CHIPMUNK_UNSAFE_H +#define CHIPMUNK_UNSAFE_H + +#ifdef __cplusplus +extern "C" { +#endif + +/// Set the radius of a circle shape. +void cpCircleShapeSetRadius(cpShape *shape, cpFloat radius); +/// Set the offset of a circle shape. +void cpCircleShapeSetOffset(cpShape *shape, cpVect offset); + +/// Set the endpoints of a segment shape. +void cpSegmentShapeSetEndpoints(cpShape *shape, cpVect a, cpVect b); +/// Set the radius of a segment shape. +void cpSegmentShapeSetRadius(cpShape *shape, cpFloat radius); + +/// Set the vertexes of a poly shape. +void cpPolyShapeSetVerts(cpShape *shape, int count, cpVect *verts, cpTransform transform); +void cpPolyShapeSetVertsRaw(cpShape *shape, int count, cpVect *verts); +/// Set the radius of a poly shape. +void cpPolyShapeSetRadius(cpShape *shape, cpFloat radius); + +#ifdef __cplusplus +} +#endif +#endif +/// @} diff --git a/external/Chipmunk/include/chipmunk/cpArbiter.h b/external/Chipmunk/include/chipmunk/cpArbiter.h new file mode 100644 index 0000000..8d29073 --- /dev/null +++ b/external/Chipmunk/include/chipmunk/cpArbiter.h @@ -0,0 +1,130 @@ +/* Copyright (c) 2007 Scott Lembcke + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +/// @defgroup cpArbiter cpArbiter +/// The cpArbiter struct controls pairs of colliding shapes. +/// They are also used in conjuction with collision handler callbacks +/// allowing you to retrieve information on the collision and control it. +/// @{ + +#define CP_MAX_CONTACTS_PER_ARBITER 2 + +// TODO: Document +cpFloat cpArbiterGetRestitution(const cpArbiter *arb); +void cpArbiterSetRestitution(cpArbiter *arb, cpFloat restitution); +cpFloat cpArbiterGetFriction(const cpArbiter *arb); +void cpArbiterSetFriction(cpArbiter *arb, cpFloat friction); + +// Get the relative surface velocity of the two shapes in contact. +cpVect cpArbiterGetSurfaceVelocity(cpArbiter *arb); + +// Override the relative surface velocity of the two shapes in contact. +// By default this is calculated to be the difference of the two +// surface velocities clamped to the tangent plane. +void cpArbiterSetSurfaceVelocity(cpArbiter *arb, cpVect vr); + +cpDataPointer cpArbiterGetUserData(const cpArbiter *arb); +void cpArbiterSetUserData(cpArbiter *arb, cpDataPointer userData); + +/// Calculate the total impulse including the friction that was applied by this arbiter. +/// This function should only be called from a post-solve, post-step or cpBodyEachArbiter callback. +cpVect cpArbiterTotalImpulse(const cpArbiter *arb); +/// Calculate the amount of energy lost in a collision including static, but not dynamic friction. +/// This function should only be called from a post-solve, post-step or cpBodyEachArbiter callback. +cpFloat cpArbiterTotalKE(const cpArbiter *arb); + + +cpBool cpArbiterIgnore(cpArbiter *arb); + +/// Return the colliding shapes involved for this arbiter. +/// The order of their cpSpace.collision_type values will match +/// the order set when the collision handler was registered. +void cpArbiterGetShapes(const cpArbiter *arb, cpShape **a, cpShape **b); + +/// A macro shortcut for defining and retrieving the shapes from an arbiter. +#define CP_ARBITER_GET_SHAPES(__arb__, __a__, __b__) cpShape *__a__, *__b__; cpArbiterGetShapes(__arb__, &__a__, &__b__); + +/// Return the colliding bodies involved for this arbiter. +/// The order of the cpSpace.collision_type the bodies are associated with values will match +/// the order set when the collision handler was registered. +static inline void cpArbiterGetBodies(const cpArbiter *arb, cpBody **a, cpBody **b) +{ + CP_ARBITER_GET_SHAPES(arb, shape_a, shape_b); + (*a) = shape_a->CP_PRIVATE(body); + (*b) = shape_b->CP_PRIVATE(body); +} +/// A macro shortcut for defining and retrieving the bodies from an arbiter. +#define CP_ARBITER_GET_BODIES(__arb__, __a__, __b__) cpBody *__a__, *__b__; cpArbiterGetBodies(__arb__, &__a__, &__b__); + +/// A struct that wraps up the important collision data for an arbiter. +struct cpContactPointSet { + /// The number of contact points in the set. + int count; + + /// The normal of the collision. + cpVect normal; + + /// The array of contact points. + struct { + /// The position of the contact on the surface of each shape. + cpVect point1, point2; + /// Penetration distance of the two shapes. Overlapping means it will be negative. + /// This value is calculated as cpvdot(cpvsub(point2, point1), normal) and is ignored by cpArbiterSetContactPointSet(). + cpFloat distance; + } points[CP_MAX_CONTACTS_PER_ARBITER]; +}; + +/// Return a contact set from an arbiter. +cpContactPointSet cpArbiterGetContactPointSet(const cpArbiter *arb); + +/// Replace the contact point set for an arbiter. +/// This can be a very powerful feature, but use it with caution! +void cpArbiterSetContactPointSet(cpArbiter *arb, cpContactPointSet *set); + +/// Returns true if this is the first step a pair of objects started colliding. +cpBool cpArbiterIsFirstContact(const cpArbiter *arb); +/// Returns true if in separate callback due to a shape being removed from the space. +cpBool cpArbiterIsRemoval(const cpArbiter *arb); + +/// Get the number of contact points for this arbiter. +int cpArbiterGetCount(const cpArbiter *arb); +/// Get the normal of the collision. +cpVect cpArbiterGetNormal(const cpArbiter *arb); +/// Get the position of the @c ith contact point on the surface of the first shape. +cpVect cpArbiterGetPoint1(const cpArbiter *arb, int i); +/// Get the position of the @c ith contact point on the surface of the second shape. +cpVect cpArbiterGetPoint2(const cpArbiter *arb, int i); +/// Get the depth of the @c ith contact point. +cpFloat cpArbiterGetDepth(const cpArbiter *arb, int i); + +cpBool cpArbiterCallWildcardBeginA(cpArbiter *arb, cpSpace *space); +cpBool cpArbiterCallWildcardBeginB(cpArbiter *arb, cpSpace *space); + +cpBool cpArbiterCallWildcardPreSolveA(cpArbiter *arb, cpSpace *space); +cpBool cpArbiterCallWildcardPreSolveB(cpArbiter *arb, cpSpace *space); + +void cpArbiterCallWildcardPostSolveA(cpArbiter *arb, cpSpace *space); +void cpArbiterCallWildcardPostSolveB(cpArbiter *arb, cpSpace *space); + +void cpArbiterCallWildcardSeparateA(cpArbiter *arb, cpSpace *space); +void cpArbiterCallWildcardSeparateB(cpArbiter *arb, cpSpace *space); + +/// @} diff --git a/external/Chipmunk/include/chipmunk/cpBB.h b/external/Chipmunk/include/chipmunk/cpBB.h new file mode 100644 index 0000000..4561d8d --- /dev/null +++ b/external/Chipmunk/include/chipmunk/cpBB.h @@ -0,0 +1,169 @@ +/* Copyright (c) 2007 Scott Lembcke + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +#ifndef CHIPMUNK_BB_H +#define CHIPMUNK_BB_H + +#include "chipmunk_types.h" +#include "cpVect.h" + +/// @defgroup cpBBB cpBB +/// Chipmunk's axis-aligned 2D bounding box type along with a few handy routines. +/// @{ + +/// Chipmunk's axis-aligned 2D bounding box type. (left, bottom, right, top) +typedef struct cpBB{ + cpFloat l, b, r ,t; +} cpBB; + +/// Convenience constructor for cpBB structs. +static inline cpBB cpBBNew(const cpFloat l, const cpFloat b, const cpFloat r, const cpFloat t) +{ + cpBB bb = {l, b, r, t}; + return bb; +} + +/// Constructs a cpBB centered on a point with the given extents (half sizes). +static inline cpBB +cpBBNewForExtents(const cpVect c, const cpFloat hw, const cpFloat hh) +{ + return cpBBNew(c.x - hw, c.y - hh, c.x + hw, c.y + hh); +} + +/// Constructs a cpBB for a circle with the given position and radius. +static inline cpBB cpBBNewForCircle(const cpVect p, const cpFloat r) +{ + return cpBBNewForExtents(p, r, r); +} + +/// Returns true if @c a and @c b intersect. +static inline cpBool cpBBIntersects(const cpBB a, const cpBB b) +{ + return (a.l <= b.r && b.l <= a.r && a.b <= b.t && b.b <= a.t); +} + +/// Returns true if @c other lies completely within @c bb. +static inline cpBool cpBBContainsBB(const cpBB bb, const cpBB other) +{ + return (bb.l <= other.l && bb.r >= other.r && bb.b <= other.b && bb.t >= other.t); +} + +/// Returns true if @c bb contains @c v. +static inline cpBool cpBBContainsVect(const cpBB bb, const cpVect v) +{ + return (bb.l <= v.x && bb.r >= v.x && bb.b <= v.y && bb.t >= v.y); +} + +/// Returns a bounding box that holds both bounding boxes. +static inline cpBB cpBBMerge(const cpBB a, const cpBB b){ + return cpBBNew( + cpfmin(a.l, b.l), + cpfmin(a.b, b.b), + cpfmax(a.r, b.r), + cpfmax(a.t, b.t) + ); +} + +/// Returns a bounding box that holds both @c bb and @c v. +static inline cpBB cpBBExpand(const cpBB bb, const cpVect v){ + return cpBBNew( + cpfmin(bb.l, v.x), + cpfmin(bb.b, v.y), + cpfmax(bb.r, v.x), + cpfmax(bb.t, v.y) + ); +} + +/// Returns the center of a bounding box. +static inline cpVect +cpBBCenter(cpBB bb) +{ + return cpvlerp(cpv(bb.l, bb.b), cpv(bb.r, bb.t), 0.5f); +} + +/// Returns the area of the bounding box. +static inline cpFloat cpBBArea(cpBB bb) +{ + return (bb.r - bb.l)*(bb.t - bb.b); +} + +/// Merges @c a and @c b and returns the area of the merged bounding box. +static inline cpFloat cpBBMergedArea(cpBB a, cpBB b) +{ + return (cpfmax(a.r, b.r) - cpfmin(a.l, b.l))*(cpfmax(a.t, b.t) - cpfmin(a.b, b.b)); +} + +/// Returns the fraction along the segment query the cpBB is hit. Returns INFINITY if it doesn't hit. +static inline cpFloat cpBBSegmentQuery(cpBB bb, cpVect a, cpVect b) +{ + cpFloat idx = 1.0f/(b.x - a.x); + cpFloat tx1 = (bb.l == a.x ? -INFINITY : (bb.l - a.x)*idx); + cpFloat tx2 = (bb.r == a.x ? INFINITY : (bb.r - a.x)*idx); + cpFloat txmin = cpfmin(tx1, tx2); + cpFloat txmax = cpfmax(tx1, tx2); + + cpFloat idy = 1.0f/(b.y - a.y); + cpFloat ty1 = (bb.b == a.y ? -INFINITY : (bb.b - a.y)*idy); + cpFloat ty2 = (bb.t == a.y ? INFINITY : (bb.t - a.y)*idy); + cpFloat tymin = cpfmin(ty1, ty2); + cpFloat tymax = cpfmax(ty1, ty2); + + if(tymin <= txmax && txmin <= tymax){ + cpFloat min = cpfmax(txmin, tymin); + cpFloat max = cpfmin(txmax, tymax); + + if(0.0 <= max && min <= 1.0) return cpfmax(min, 0.0); + } + + return INFINITY; +} + +/// Return true if the bounding box intersects the line segment with ends @c a and @c b. +static inline cpBool cpBBIntersectsSegment(cpBB bb, cpVect a, cpVect b) +{ + return (cpBBSegmentQuery(bb, a, b) != INFINITY); +} + +/// Clamp a vector to a bounding box. +static inline cpVect +cpBBClampVect(const cpBB bb, const cpVect v) +{ + return cpv(cpfclamp(v.x, bb.l, bb.r), cpfclamp(v.y, bb.b, bb.t)); +} + +/// Wrap a vector to a bounding box. +static inline cpVect +cpBBWrapVect(const cpBB bb, const cpVect v) +{ + cpFloat dx = cpfabs(bb.r - bb.l); + cpFloat modx = cpfmod(v.x - bb.l, dx); + cpFloat x = (modx > 0.0f) ? modx : modx + dx; + + cpFloat dy = cpfabs(bb.t - bb.b); + cpFloat mody = cpfmod(v.y - bb.b, dy); + cpFloat y = (mody > 0.0f) ? mody : mody + dy; + + return cpv(x + bb.l, y + bb.b); +} + +///@} + +#endif diff --git a/external/Chipmunk/include/chipmunk/cpBody.h b/external/Chipmunk/include/chipmunk/cpBody.h new file mode 100644 index 0000000..bc39db0 --- /dev/null +++ b/external/Chipmunk/include/chipmunk/cpBody.h @@ -0,0 +1,271 @@ +/* Copyright (c) 2007 Scott Lembcke + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +/// @defgroup cpBody cpBody +/// Chipmunk's rigid body type. Rigid bodies hold the physical properties of an object like +/// it's mass, and position and velocity of it's center of gravity. They don't have an shape on their own. +/// They are given a shape by creating collision shapes (cpShape) that point to the body. +/// @{ + +typedef enum cpBodyType { + CP_BODY_TYPE_DYNAMIC, + CP_BODY_TYPE_KINEMATIC, + CP_BODY_TYPE_STATIC, +} cpBodyType; + +/// Rigid body velocity update function type. +typedef void (*cpBodyVelocityFunc)(cpBody *body, cpVect gravity, cpFloat damping, cpFloat dt); +/// Rigid body position update function type. +typedef void (*cpBodyPositionFunc)(cpBody *body, cpFloat dt); + +/// Used internally to track information on the collision graph. +/// @private +typedef struct cpComponentNode { + cpBody *root; + cpBody *next; + cpFloat idleTime; +} cpComponentNode; + +/// Chipmunk's rigid body struct. +struct cpBody { + /// Function that is called to integrate the body's velocity. (Defaults to cpBodyUpdateVelocity) + cpBodyVelocityFunc velocity_func; + + /// Function that is called to integrate the body's position. (Defaults to cpBodyUpdatePosition) + cpBodyPositionFunc position_func; + + /// Mass of the body. + /// Must agree with cpBody.m_inv! Use cpBodySetMass() when changing the mass for this reason. + CP_PRIVATE(cpFloat m); + /// Mass inverse. + CP_PRIVATE(cpFloat m_inv); + + /// Moment of inertia of the body. + /// Must agree with cpBody.i_inv! Use cpBodySetMoment() when changing the moment for this reason. + CP_PRIVATE(cpFloat i); + /// Moment of inertia inverse. + CP_PRIVATE(cpFloat i_inv); + + /// Offset of the center of gravity from the body's anchor. + /// Defaults to cpvzero. + CP_PRIVATE(cpVect cog); + + /// Position of the rigid body's center of gravity. + CP_PRIVATE(cpVect p); + /// Velocity of the rigid body's center of gravity. + CP_PRIVATE(cpVect v); + /// Force acting on the rigid body's center of gravity. + CP_PRIVATE(cpVect f); + + /// Rotation of the body around it's center of gravity in radians. + /// Must agree with cpBody.rot! Use cpBodySetAngle() when changing the angle for this reason. + CP_PRIVATE(cpFloat a); + /// Angular velocity of the body around it's center of gravity in radians/second. + CP_PRIVATE(cpFloat w); + /// Torque applied to the body around it's center of gravity. + CP_PRIVATE(cpFloat t); + + CP_PRIVATE(cpTransform transform); + + /// User definable data pointer. + /// Generally this points to your the game object class so you can access it + /// when given a cpBody reference in a callback. + CP_PRIVATE(cpDataPointer userData); + + /// Maximum velocity allowed when updating the velocity. + CP_PRIVATE(cpFloat v_limit); + /// Maximum rotational rate (in radians/second) allowed when updating the angular velocity. + CP_PRIVATE(cpFloat w_limit); + + CP_PRIVATE(cpVect v_bias); + CP_PRIVATE(cpFloat w_bias); + + CP_PRIVATE(cpSpace *space); + + CP_PRIVATE(cpShape *shapeList); + CP_PRIVATE(cpArbiter *arbiterList); + CP_PRIVATE(cpConstraint *constraintList); + + CP_PRIVATE(cpComponentNode node); +}; + +/// Allocate a cpBody. +cpBody* cpBodyAlloc(void); +/// Initialize a cpBody. +cpBody* cpBodyInit(cpBody *body, cpFloat mass, cpFloat moment); +/// Allocate and initialize a cpBody. +cpBody* cpBodyNew(cpFloat mass, cpFloat moment); + +/// Allocate and initialize a cpBody, and set it as a kinematic body. +cpBody* cpBodyNewKinematic(void); +/// Allocate and initialize a cpBody, and set it as a static body. +cpBody* cpBodyNewStatic(void); + +/// Destroy a cpBody. +void cpBodyDestroy(cpBody *body); +/// Destroy and free a cpBody. +void cpBodyFree(cpBody *body); + +/// Check that the properties of a body is sane. (Only in debug mode) +#ifdef NDEBUG + #define cpAssertSaneBody(body) +#else + void cpBodySanityCheck(const cpBody *body); + #define cpAssertSaneBody(body) cpBodySanityCheck(body) +#endif + +// Defined in cpSpace.c +/// Wake up a sleeping or idle body. +void cpBodyActivate(cpBody *body); +/// Wake up any sleeping or idle bodies touching a static body. +void cpBodyActivateStatic(cpBody *body, cpShape *filter); + +/// Force a body to fall asleep immediately. +void cpBodySleep(cpBody *body); +/// Force a body to fall asleep immediately along with other bodies in a group. +void cpBodySleepWithGroup(cpBody *body, cpBody *group); + +/// Returns true if the body is sleeping. +static inline cpBool cpBodyIsSleeping(const cpBody *body) +{ + return (CP_PRIVATE(body->node).root != ((cpBody*)0)); +} + +static inline cpBodyType cpBodyGetType(cpBody *body) +{ + if(body->CP_PRIVATE(node).idleTime == INFINITY){ + return CP_BODY_TYPE_STATIC; + } else if(body->CP_PRIVATE(m) == INFINITY){ + return CP_BODY_TYPE_KINEMATIC; + } else { + return CP_BODY_TYPE_DYNAMIC; + } +} + +void cpBodySetType(cpBody *body, cpBodyType type); + +// TODO what to do about rogue bodies? +/// Returns true if the body has not been added to a space. +/// Note: Static bodies are a subtype of rogue bodies. +//static inline cpBool cpBodyIsRogue(const cpBody *body) +//{ +// return (body->CP_PRIVATE(space) == ((cpSpace*)0)); +//} + +/// Convert body relative/local coordinates to absolute/world coordinates. +static inline cpVect cpBodyLocalToWorld(const cpBody *body, const cpVect point) +{ + return cpTransformPoint(body->CP_PRIVATE(transform), point); +} + +/// Convert body absolute/world coordinates to relative/local coordinates. +static inline cpVect cpBodyWorldToLocal(const cpBody *body, const cpVect point) +{ + return cpTransformPoint(cpTransformRigidInverse(body->CP_PRIVATE(transform)), point); +} + +#define CP_DefineBodyStructGetter(type, member, name) \ +static inline type cpBodyGet##name(const cpBody *body){return body->CP_PRIVATE(member);} + +#define CP_DefineBodyStructSetter(type, member, name) \ +static inline void cpBodySet##name(cpBody *body, const type value){ \ + cpBodyActivate(body); \ + body->CP_PRIVATE(member) = value; \ + cpAssertSaneBody(body); \ +} + +#define CP_DefineBodyStructProperty(type, member, name) \ +CP_DefineBodyStructGetter(type, member, name) \ +CP_DefineBodyStructSetter(type, member, name) + +// TODO: add to docs +CP_DefineBodyStructGetter(cpSpace*, space, Space) + +CP_DefineBodyStructGetter(cpFloat, m, Mass) +/// Set the mass of a body. +void cpBodySetMass(cpBody *body, cpFloat m); + +CP_DefineBodyStructGetter(cpFloat, i, Moment) +/// Set the moment of a body. +void cpBodySetMoment(cpBody *body, cpFloat i); + +/// Get the position of a body. +static inline cpVect cpBodyGetPosition(const cpBody *body) +{ + return cpTransformPoint(body->CP_PRIVATE(transform), cpvzero); +} + +/// Set the position of a body. +void cpBodySetPosition(cpBody *body, cpVect pos); +CP_DefineBodyStructProperty(cpVect, cog, CenterOfGravity) +CP_DefineBodyStructProperty(cpVect, v, Velocity) +CP_DefineBodyStructProperty(cpVect, f, Force) +CP_DefineBodyStructGetter(cpFloat, a, Angle) +/// Set the angle of a body. +void cpBodySetAngle(cpBody *body, cpFloat a); +CP_DefineBodyStructProperty(cpFloat, w, AngularVelocity) +CP_DefineBodyStructProperty(cpFloat, t, Torque) +cpVect cpBodyGetRotation(const cpBody *body); // TODO remove? +CP_DefineBodyStructProperty(cpFloat, v_limit, VelocityLimit) +CP_DefineBodyStructProperty(cpFloat, w_limit, AngularVelocityLimit) +CP_DefineBodyStructProperty(cpDataPointer, userData, UserData) + +/// Default Integration functions. +void cpBodyUpdateVelocity(cpBody *body, cpVect gravity, cpFloat damping, cpFloat dt); +void cpBodyUpdatePosition(cpBody *body, cpFloat dt); + +void cpBodyApplyForceAtWorldPoint(cpBody *body, cpVect force, cpVect point); +void cpBodyApplyForceAtLocalPoint(cpBody *body, cpVect force, cpVect point); + +void cpBodyApplyImpulseAtWorldPoint(cpBody *body, cpVect impulse, cpVect point); +void cpBodyApplyImpulseAtLocalPoint(cpBody *body, cpVect impulse, cpVect point); + +/// Get the velocity on a body (in world units) at a point on the body in world coordinates. +cpVect cpBodyGetVelocityAtWorldPoint(const cpBody *body, cpVect point); +/// Get the velocity on a body (in world units) at a point on the body in local coordinates. +cpVect cpBodyGetVelocityAtLocalPoint(const cpBody *body, cpVect point); + + +/// Get the kinetic energy of a body. +static inline cpFloat cpBodyKineticEnergy(const cpBody *body) +{ + // Need to do some fudging to avoid NaNs + cpFloat vsq = cpvdot(body->CP_PRIVATE(v), body->CP_PRIVATE(v)); + cpFloat wsq = body->CP_PRIVATE(w)*body->CP_PRIVATE(w); + return (vsq ? vsq*body->CP_PRIVATE(m) : 0.0f) + (wsq ? wsq*body->CP_PRIVATE(i) : 0.0f); +} + +/// Body/shape iterator callback function type. +typedef void (*cpBodyShapeIteratorFunc)(cpBody *body, cpShape *shape, void *data); +/// Call @c func once for each shape attached to @c body and added to the space. +void cpBodyEachShape(cpBody *body, cpBodyShapeIteratorFunc func, void *data); + +/// Body/constraint iterator callback function type. +typedef void (*cpBodyConstraintIteratorFunc)(cpBody *body, cpConstraint *constraint, void *data); +/// Call @c func once for each constraint attached to @c body and added to the space. +void cpBodyEachConstraint(cpBody *body, cpBodyConstraintIteratorFunc func, void *data); + +/// Body/arbiter iterator callback function type. +typedef void (*cpBodyArbiterIteratorFunc)(cpBody *body, cpArbiter *arbiter, void *data); +/// Call @c func once for each arbiter that is currently active on the body. +void cpBodyEachArbiter(cpBody *body, cpBodyArbiterIteratorFunc func, void *data); + +///@} diff --git a/external/Chipmunk/include/chipmunk/cpConstraint.h b/external/Chipmunk/include/chipmunk/cpConstraint.h new file mode 100644 index 0000000..b66c767 --- /dev/null +++ b/external/Chipmunk/include/chipmunk/cpConstraint.h @@ -0,0 +1,167 @@ +/* Copyright (c) 2007 Scott Lembcke + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +/// @defgroup cpConstraint cpConstraint +/// @{ + +typedef struct cpConstraintClass cpConstraintClass; + +typedef void (*cpConstraintPreStepImpl)(cpConstraint *constraint, cpFloat dt); +typedef void (*cpConstraintApplyCachedImpulseImpl)(cpConstraint *constraint, cpFloat dt_coef); +typedef void (*cpConstraintApplyImpulseImpl)(cpConstraint *constraint, cpFloat dt); +typedef cpFloat (*cpConstraintGetImpulseImpl)(cpConstraint *constraint); + +/// @private +struct cpConstraintClass { + cpConstraintPreStepImpl preStep; + cpConstraintApplyCachedImpulseImpl applyCachedImpulse; + cpConstraintApplyImpulseImpl applyImpulse; + cpConstraintGetImpulseImpl getImpulse; +}; + +/// Callback function type that gets called before solving a joint. +typedef void (*cpConstraintPreSolveFunc)(cpConstraint *constraint, cpSpace *space); +/// Callback function type that gets called after solving a joint. +typedef void (*cpConstraintPostSolveFunc)(cpConstraint *constraint, cpSpace *space); + + +/// Opaque cpConstraint struct. +struct cpConstraint { + CP_PRIVATE(const cpConstraintClass *klass); + + /// The first body connected to this constraint. + cpBody *a; + /// The second body connected to this constraint. + cpBody *b; + + CP_PRIVATE(cpSpace *space); + + CP_PRIVATE(cpConstraint *next_a); + CP_PRIVATE(cpConstraint *next_b); + + /// The maximum force that this constraint is allowed to use. + /// Defaults to infinity. + cpFloat maxForce; + /// The rate at which joint error is corrected. + /// Defaults to pow(1.0 - 0.1, 60.0) meaning that it will + /// correct 10% of the error every 1/60th of a second. + cpFloat errorBias; + /// The maximum rate at which joint error is corrected. + /// Defaults to infinity. + cpFloat maxBias; + + /// Whether or not the connected bodies should checked for collisions. + /// Collisions are filtered before calling callbacks. + /// Defaults to cpTrue. + cpBool collideBodies; + + /// Function called before the solver runs. + /// Animate your joint anchors, update your motor torque, etc. + cpConstraintPreSolveFunc preSolve; + + /// Function called after the solver runs. + /// Use the applied impulse to perform effects like breakable joints. + cpConstraintPostSolveFunc postSolve; + + /// User definable data pointer. + /// Generally this points to your the game object class so you can access it + /// when given a cpConstraint reference in a callback. + cpDataPointer userData; +}; + +/// Destroy a constraint. +void cpConstraintDestroy(cpConstraint *constraint); +/// Destroy and free a constraint. +void cpConstraintFree(cpConstraint *constraint); + +/// @private +static inline void cpConstraintActivateBodies(cpConstraint *constraint) +{ + cpBody *a = constraint->a; cpBodyActivate(a); + cpBody *b = constraint->b; cpBodyActivate(b); +} + +/// @private +#define CP_DefineConstraintStructGetter(type, member, name) \ +static inline type cpConstraint##Get##name(const cpConstraint *constraint){return constraint->member;} + +/// @private +#define CP_DefineConstraintStructSetter(type, member, name) \ +static inline void cpConstraint##Set##name(cpConstraint *constraint, type value){ \ + cpConstraintActivateBodies(constraint); \ + constraint->member = value; \ +} + +/// @private +#define CP_DefineConstraintStructProperty(type, member, name) \ +CP_DefineConstraintStructGetter(type, member, name) \ +CP_DefineConstraintStructSetter(type, member, name) + +CP_DefineConstraintStructGetter(cpSpace*, CP_PRIVATE(space), Space) + +CP_DefineConstraintStructGetter(cpBody*, a, A) +CP_DefineConstraintStructGetter(cpBody*, b, B) +CP_DefineConstraintStructProperty(cpFloat, maxForce, MaxForce) +CP_DefineConstraintStructProperty(cpFloat, errorBias, ErrorBias) +CP_DefineConstraintStructProperty(cpFloat, maxBias, MaxBias) +CP_DefineConstraintStructProperty(cpBool, collideBodies, CollideBodies) +CP_DefineConstraintStructProperty(cpConstraintPreSolveFunc, preSolve, PreSolveFunc) +CP_DefineConstraintStructProperty(cpConstraintPostSolveFunc, postSolve, PostSolveFunc) +CP_DefineConstraintStructProperty(cpDataPointer, userData, UserData) + +// Get the last impulse applied by this constraint. +static inline cpFloat cpConstraintGetImpulse(cpConstraint *constraint) +{ + return constraint->CP_PRIVATE(klass)->getImpulse(constraint); +} + +/// @} + +#define cpConstraintCheckCast(constraint, struct) \ + cpAssertHard(constraint->CP_PRIVATE(klass) == struct##GetClass(), "Constraint is not a "#struct) + +#define CP_DefineConstraintGetter(struct, type, member, name) \ +static inline type struct##Get##name(const cpConstraint *constraint){ \ + cpConstraintCheckCast(constraint, struct); \ + return ((struct *)constraint)->member; \ +} + +#define CP_DefineConstraintSetter(struct, type, member, name) \ +static inline void struct##Set##name(cpConstraint *constraint, type value){ \ + cpConstraintCheckCast(constraint, struct); \ + cpConstraintActivateBodies(constraint); \ + ((struct *)constraint)->member = value; \ +} + +#define CP_DefineConstraintProperty(struct, type, member, name) \ +CP_DefineConstraintGetter(struct, type, member, name) \ +CP_DefineConstraintSetter(struct, type, member, name) + +#include "cpPinJoint.h" +#include "cpSlideJoint.h" +#include "cpPivotJoint.h" +#include "cpGrooveJoint.h" +#include "cpDampedSpring.h" +#include "cpDampedRotarySpring.h" +#include "cpRotaryLimitJoint.h" +#include "cpRatchetJoint.h" +#include "cpGearJoint.h" +#include "cpSimpleMotor.h" diff --git a/external/Chipmunk/include/chipmunk/cpDampedRotarySpring.h b/external/Chipmunk/include/chipmunk/cpDampedRotarySpring.h new file mode 100644 index 0000000..86cf915 --- /dev/null +++ b/external/Chipmunk/include/chipmunk/cpDampedRotarySpring.h @@ -0,0 +1,56 @@ +/* Copyright (c) 2007 Scott Lembcke + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +/// @defgroup cpDampedRotarySpring cpDampedRotarySpring +/// @{ + +typedef cpFloat (*cpDampedRotarySpringTorqueFunc)(struct cpConstraint *spring, cpFloat relativeAngle); + +const cpConstraintClass *cpDampedRotarySpringGetClass(void); + +/// @private +typedef struct cpDampedRotarySpring { + cpConstraint constraint; + cpFloat restAngle; + cpFloat stiffness; + cpFloat damping; + cpDampedRotarySpringTorqueFunc springTorqueFunc; + + cpFloat target_wrn; + cpFloat w_coef; + + cpFloat iSum; + cpFloat jAcc; +} cpDampedRotarySpring; + +/// Allocate a damped rotary spring. +cpDampedRotarySpring* cpDampedRotarySpringAlloc(void); +/// Initialize a damped rotary spring. +cpDampedRotarySpring* cpDampedRotarySpringInit(cpDampedRotarySpring *joint, cpBody *a, cpBody *b, cpFloat restAngle, cpFloat stiffness, cpFloat damping); +/// Allocate and initialize a damped rotary spring. +cpConstraint* cpDampedRotarySpringNew(cpBody *a, cpBody *b, cpFloat restAngle, cpFloat stiffness, cpFloat damping); + +CP_DefineConstraintProperty(cpDampedRotarySpring, cpFloat, restAngle, RestAngle) +CP_DefineConstraintProperty(cpDampedRotarySpring, cpFloat, stiffness, Stiffness) +CP_DefineConstraintProperty(cpDampedRotarySpring, cpFloat, damping, Damping) +CP_DefineConstraintProperty(cpDampedRotarySpring, cpDampedRotarySpringTorqueFunc, springTorqueFunc, SpringTorqueFunc) + +/// @} diff --git a/external/Chipmunk/include/chipmunk/cpDampedSpring.h b/external/Chipmunk/include/chipmunk/cpDampedSpring.h new file mode 100644 index 0000000..f512064 --- /dev/null +++ b/external/Chipmunk/include/chipmunk/cpDampedSpring.h @@ -0,0 +1,64 @@ +/* Copyright (c) 2007 Scott Lembcke + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +/// @defgroup cpDampedSpring cpDampedSpring +/// @{ + +typedef struct cpDampedSpring cpDampedSpring; + +typedef cpFloat (*cpDampedSpringForceFunc)(cpConstraint *spring, cpFloat dist); + +const cpConstraintClass *cpDampedSpringGetClass(void); + +/// @private +struct cpDampedSpring { + cpConstraint constraint; + cpVect anchr1, anchr2; + cpFloat restLength; + cpFloat stiffness; + cpFloat damping; + cpDampedSpringForceFunc springForceFunc; + + cpFloat target_vrn; + cpFloat v_coef; + + cpVect r1, r2; + cpFloat nMass; + cpVect n; + + cpFloat jAcc; +}; + +/// Allocate a damped spring. +cpDampedSpring* cpDampedSpringAlloc(void); +/// Initialize a damped spring. +cpDampedSpring* cpDampedSpringInit(cpDampedSpring *joint, cpBody *a, cpBody *b, cpVect anchr1, cpVect anchr2, cpFloat restLength, cpFloat stiffness, cpFloat damping); +/// Allocate and initialize a damped spring. +cpConstraint* cpDampedSpringNew(cpBody *a, cpBody *b, cpVect anchr1, cpVect anchr2, cpFloat restLength, cpFloat stiffness, cpFloat damping); + +CP_DefineConstraintProperty(cpDampedSpring, cpVect, anchr1, Anchr1) +CP_DefineConstraintProperty(cpDampedSpring, cpVect, anchr2, Anchr2) +CP_DefineConstraintProperty(cpDampedSpring, cpFloat, restLength, RestLength) +CP_DefineConstraintProperty(cpDampedSpring, cpFloat, stiffness, Stiffness) +CP_DefineConstraintProperty(cpDampedSpring, cpFloat, damping, Damping) +CP_DefineConstraintProperty(cpDampedSpring, cpDampedSpringForceFunc, springForceFunc, SpringForceFunc) + +/// @} diff --git a/external/Chipmunk/include/chipmunk/cpGearJoint.h b/external/Chipmunk/include/chipmunk/cpGearJoint.h new file mode 100644 index 0000000..c9ebf94 --- /dev/null +++ b/external/Chipmunk/include/chipmunk/cpGearJoint.h @@ -0,0 +1,51 @@ +/* Copyright (c) 2007 Scott Lembcke + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +/// @defgroup cpGearJoint cpGearJoint +/// @{ + +const cpConstraintClass *cpGearJointGetClass(void); + +/// @private +typedef struct cpGearJoint { + cpConstraint constraint; + cpFloat phase, ratio; + cpFloat ratio_inv; + + cpFloat iSum; + + cpFloat bias; + cpFloat jAcc; +} cpGearJoint; + +/// Allocate a gear joint. +cpGearJoint* cpGearJointAlloc(void); +/// Initialize a gear joint. +cpGearJoint* cpGearJointInit(cpGearJoint *joint, cpBody *a, cpBody *b, cpFloat phase, cpFloat ratio); +/// Allocate and initialize a gear joint. +cpConstraint* cpGearJointNew(cpBody *a, cpBody *b, cpFloat phase, cpFloat ratio); + +CP_DefineConstraintProperty(cpGearJoint, cpFloat, phase, Phase) +CP_DefineConstraintGetter(cpGearJoint, cpFloat, ratio, Ratio) +/// Set the ratio of a gear joint. +void cpGearJointSetRatio(cpConstraint *constraint, cpFloat value); + +/// @} diff --git a/external/Chipmunk/include/chipmunk/cpGrooveJoint.h b/external/Chipmunk/include/chipmunk/cpGrooveJoint.h new file mode 100644 index 0000000..b260218 --- /dev/null +++ b/external/Chipmunk/include/chipmunk/cpGrooveJoint.h @@ -0,0 +1,57 @@ +/* Copyright (c) 2007 Scott Lembcke + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +/// @defgroup cpGrooveJoint cpGrooveJoint +/// @{ + +const cpConstraintClass *cpGrooveJointGetClass(void); + +/// @private +typedef struct cpGrooveJoint { + cpConstraint constraint; + cpVect grv_n, grv_a, grv_b; + cpVect anchr2; + + cpVect grv_tn; + cpFloat clamp; + cpVect r1, r2; + cpMat2x2 k; + + cpVect jAcc; + cpVect bias; +} cpGrooveJoint; + +/// Allocate a groove joint. +cpGrooveJoint* cpGrooveJointAlloc(void); +/// Initialize a groove joint. +cpGrooveJoint* cpGrooveJointInit(cpGrooveJoint *joint, cpBody *a, cpBody *b, cpVect groove_a, cpVect groove_b, cpVect anchr2); +/// Allocate and initialize a groove joint. +cpConstraint* cpGrooveJointNew(cpBody *a, cpBody *b, cpVect groove_a, cpVect groove_b, cpVect anchr2); + +CP_DefineConstraintGetter(cpGrooveJoint, cpVect, grv_a, GrooveA) +/// Set endpoint a of a groove joint's groove +void cpGrooveJointSetGrooveA(cpConstraint *constraint, cpVect value); +CP_DefineConstraintGetter(cpGrooveJoint, cpVect, grv_b, GrooveB) +/// Set endpoint b of a groove joint's groove +void cpGrooveJointSetGrooveB(cpConstraint *constraint, cpVect value); +CP_DefineConstraintProperty(cpGrooveJoint, cpVect, anchr2, Anchr2) + +/// @} diff --git a/external/Chipmunk/include/chipmunk/cpPinJoint.h b/external/Chipmunk/include/chipmunk/cpPinJoint.h new file mode 100644 index 0000000..2413e84 --- /dev/null +++ b/external/Chipmunk/include/chipmunk/cpPinJoint.h @@ -0,0 +1,52 @@ +/* Copyright (c) 2007 Scott Lembcke + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +/// @defgroup cpPinJoint cpPinJoint +/// @{ + +const cpConstraintClass *cpPinJointGetClass(void); + +/// @private +typedef struct cpPinJoint { + cpConstraint constraint; + cpVect anchr1, anchr2; + cpFloat dist; + + cpVect r1, r2; + cpVect n; + cpFloat nMass; + + cpFloat jnAcc; + cpFloat bias; +} cpPinJoint; + +/// Allocate a pin joint. +cpPinJoint* cpPinJointAlloc(void); +/// Initialize a pin joint. +cpPinJoint* cpPinJointInit(cpPinJoint *joint, cpBody *a, cpBody *b, cpVect anchr1, cpVect anchr2); +/// Allocate and initialize a pin joint. +cpConstraint* cpPinJointNew(cpBody *a, cpBody *b, cpVect anchr1, cpVect anchr2); + +CP_DefineConstraintProperty(cpPinJoint, cpVect, anchr1, Anchr1) +CP_DefineConstraintProperty(cpPinJoint, cpVect, anchr2, Anchr2) +CP_DefineConstraintProperty(cpPinJoint, cpFloat, dist, Dist) + +///@} diff --git a/external/Chipmunk/include/chipmunk/cpPivotJoint.h b/external/Chipmunk/include/chipmunk/cpPivotJoint.h new file mode 100644 index 0000000..a5d3317 --- /dev/null +++ b/external/Chipmunk/include/chipmunk/cpPivotJoint.h @@ -0,0 +1,51 @@ +/* Copyright (c) 2007 Scott Lembcke + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +/// @defgroup cpPivotJoint cpPivotJoint +/// @{ + +const cpConstraintClass *cpPivotJointGetClass(void); + +/// @private +typedef struct cpPivotJoint { + cpConstraint constraint; + cpVect anchr1, anchr2; + + cpVect r1, r2; + cpMat2x2 k; + + cpVect jAcc; + cpVect bias; +} cpPivotJoint; + +/// Allocate a pivot joint +cpPivotJoint* cpPivotJointAlloc(void); +/// Initialize a pivot joint. +cpPivotJoint* cpPivotJointInit(cpPivotJoint *joint, cpBody *a, cpBody *b, cpVect anchr1, cpVect anchr2); +/// Allocate and initialize a pivot joint. +cpConstraint* cpPivotJointNew(cpBody *a, cpBody *b, cpVect pivot); +/// Allocate and initialize a pivot joint with specific anchors. +cpConstraint* cpPivotJointNew2(cpBody *a, cpBody *b, cpVect anchr1, cpVect anchr2); + +CP_DefineConstraintProperty(cpPivotJoint, cpVect, anchr1, Anchr1) +CP_DefineConstraintProperty(cpPivotJoint, cpVect, anchr2, Anchr2) + +/// @} diff --git a/external/Chipmunk/include/chipmunk/cpPolyShape.h b/external/Chipmunk/include/chipmunk/cpPolyShape.h new file mode 100644 index 0000000..8612446 --- /dev/null +++ b/external/Chipmunk/include/chipmunk/cpPolyShape.h @@ -0,0 +1,76 @@ +/* Copyright (c) 2007 Scott Lembcke + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +/// @defgroup cpPolyShape cpPolyShape +/// @{ + +/// @private +typedef struct cpSplittingPlane { + cpVect v0, n; +} cpSplittingPlane; + +#define CP_POLY_SHAPE_INLINE_ALLOC 6 + +/// @private +typedef struct cpPolyShape { + cpShape shape; + + cpFloat r; + + int count; + // The untransformed planes are appended at the end of the transformed planes. + cpSplittingPlane *planes; + + // Allocate a small number of splitting planes internally for simple poly. + cpSplittingPlane _planes[2*CP_POLY_SHAPE_INLINE_ALLOC]; +} cpPolyShape; + +// TODO: Clean up naming here. +// TODO: Use transforms. + +/// Allocate a polygon shape. +cpPolyShape* cpPolyShapeAlloc(void); +/// Initialize a polygon shape with rounded corners. +/// A convex hull will be created from the vertexes. +cpPolyShape* cpPolyShapeInit(cpPolyShape *poly, cpBody *body, int count, const cpVect *verts, cpTransform transform, cpFloat radius); +cpPolyShape* cpPolyShapeInitRaw(cpPolyShape *poly, cpBody *body, int count, const cpVect *verts, cpFloat radius); +/// Allocate and initialize a polygon shape with rounded corners. +/// A convex hull will be created from the vertexes. +cpShape* cpPolyShapeNew(cpBody *body, int count, const cpVect *verts, cpTransform transform, cpFloat radius); +cpShape* cpPolyShapeNewRaw(cpBody *body, int count, const cpVect *verts, cpFloat radius); + +/// Initialize a box shaped polygon shape with rounded corners. +cpPolyShape* cpBoxShapeInit(cpPolyShape *poly, cpBody *body, cpFloat width, cpFloat height, cpFloat radius); +/// Initialize an offset box shaped polygon shape with rounded corners. +cpPolyShape* cpBoxShapeInit2(cpPolyShape *poly, cpBody *body, cpBB box, cpFloat radius); +/// Allocate and initialize a box shaped polygon shape. +cpShape* cpBoxShapeNew(cpBody *body, cpFloat width, cpFloat height, cpFloat radius); +/// Allocate and initialize an offset box shaped polygon shape. +cpShape* cpBoxShapeNew2(cpBody *body, cpBB box, cpFloat radius); + +/// Get the number of verts in a polygon shape. +int cpPolyShapeGetCount(const cpShape *shape); +/// Get the @c ith vertex of a polygon shape. +cpVect cpPolyShapeGetVert(const cpShape *shape, int idx); +/// Get the radius of a polygon shape. +cpFloat cpPolyShapeGetRadius(const cpShape *shape); + +/// @} diff --git a/external/Chipmunk/include/chipmunk/cpRatchetJoint.h b/external/Chipmunk/include/chipmunk/cpRatchetJoint.h new file mode 100644 index 0000000..e371b10 --- /dev/null +++ b/external/Chipmunk/include/chipmunk/cpRatchetJoint.h @@ -0,0 +1,49 @@ +/* Copyright (c) 2007 Scott Lembcke + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +/// @defgroup cpRatchetJoint cpRatchetJoint +/// @{ + +const cpConstraintClass *cpRatchetJointGetClass(void); + +/// @private +typedef struct cpRatchetJoint { + cpConstraint constraint; + cpFloat angle, phase, ratchet; + + cpFloat iSum; + + cpFloat bias; + cpFloat jAcc; +} cpRatchetJoint; + +/// Allocate a ratchet joint. +cpRatchetJoint* cpRatchetJointAlloc(void); +/// Initialize a ratched joint. +cpRatchetJoint* cpRatchetJointInit(cpRatchetJoint *joint, cpBody *a, cpBody *b, cpFloat phase, cpFloat ratchet); +/// Allocate and initialize a ratchet joint. +cpConstraint* cpRatchetJointNew(cpBody *a, cpBody *b, cpFloat phase, cpFloat ratchet); + +CP_DefineConstraintProperty(cpRatchetJoint, cpFloat, angle, Angle) +CP_DefineConstraintProperty(cpRatchetJoint, cpFloat, phase, Phase) +CP_DefineConstraintProperty(cpRatchetJoint, cpFloat, ratchet, Ratchet) + +/// @} diff --git a/external/Chipmunk/include/chipmunk/cpRotaryLimitJoint.h b/external/Chipmunk/include/chipmunk/cpRotaryLimitJoint.h new file mode 100644 index 0000000..2277e40 --- /dev/null +++ b/external/Chipmunk/include/chipmunk/cpRotaryLimitJoint.h @@ -0,0 +1,48 @@ +/* Copyright (c) 2007 Scott Lembcke + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +/// @defgroup cpRotaryLimitJoint cpRotaryLimitJoint +/// @{ + +const cpConstraintClass *cpRotaryLimitJointGetClass(void); + +/// @private +typedef struct cpRotaryLimitJoint { + cpConstraint constraint; + cpFloat min, max; + + cpFloat iSum; + + cpFloat bias; + cpFloat jAcc; +} cpRotaryLimitJoint; + +/// Allocate a damped rotary limit joint. +cpRotaryLimitJoint* cpRotaryLimitJointAlloc(void); +/// Initialize a damped rotary limit joint. +cpRotaryLimitJoint* cpRotaryLimitJointInit(cpRotaryLimitJoint *joint, cpBody *a, cpBody *b, cpFloat min, cpFloat max); +/// Allocate and initialize a damped rotary limit joint. +cpConstraint* cpRotaryLimitJointNew(cpBody *a, cpBody *b, cpFloat min, cpFloat max); + +CP_DefineConstraintProperty(cpRotaryLimitJoint, cpFloat, min, Min) +CP_DefineConstraintProperty(cpRotaryLimitJoint, cpFloat, max, Max) + +/// @} diff --git a/external/Chipmunk/include/chipmunk/cpShape.h b/external/Chipmunk/include/chipmunk/cpShape.h new file mode 100644 index 0000000..3b83984 --- /dev/null +++ b/external/Chipmunk/include/chipmunk/cpShape.h @@ -0,0 +1,258 @@ +/* Copyright (c) 2007 Scott Lembcke + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +/// @defgroup cpShape cpShape +/// The cpShape struct defines the shape of a rigid body. +/// @{ + +typedef struct cpShapeClass cpShapeClass; + +/// Nearest point query info struct. +typedef struct cpPointQueryInfo { + /// The nearest shape, NULL if no shape was within range. + const cpShape *shape; + /// The closest point on the shape's surface. (in world space coordinates) + cpVect point; + /// The distance to the point. The distance is negative if the point is inside the shape. + cpFloat distance; + /// The gradient of the signed distance function. + /// The same as info.p/info.d, but accurate even for very small values of info.d. + cpVect gradient; +} cpPointQueryInfo; + +/// Segment query info struct. +typedef struct cpSegmentQueryInfo { + /// The shape that was hit, NULL if no collision occured. + const cpShape *shape; + /// The point of impact. + cpVect point; + /// The normal of the surface hit. + cpVect normal; + /// The normalized distance along the query segment in the range [0, 1]. + cpFloat alpha; +} cpSegmentQueryInfo; + +typedef struct cpShapeFilter { + cpGroup group; + cpBitmask categories; + cpBitmask mask; +} cpShapeFilter; + +static const cpShapeFilter CP_SHAPE_FILTER_ALL = {CP_NO_GROUP, CP_ALL_CATEGORIES, CP_ALL_CATEGORIES}; +static const cpShapeFilter CP_SHAPE_FILTER_NONE = {CP_NO_GROUP, ~CP_ALL_CATEGORIES, ~CP_ALL_CATEGORIES}; + +static inline cpShapeFilter +cpShapeFilterNew(cpGroup group, cpBitmask categories, cpBitmask mask) +{ + cpShapeFilter filter = {group, categories, mask}; + return filter; +} + + +/// @private +struct cpShapeMassInfo { + cpFloat m; + cpFloat i; + cpVect cog; + cpFloat area; +}; + +/// @private +typedef enum cpShapeType{ + CP_CIRCLE_SHAPE, + CP_SEGMENT_SHAPE, + CP_POLY_SHAPE, + CP_NUM_SHAPES +} cpShapeType; + +typedef cpBB (*cpShapeCacheDataImpl)(cpShape *shape, cpTransform transform); +typedef void (*cpShapeDestroyImpl)(cpShape *shape); +typedef void (*cpShapePointQueryImpl)(const cpShape *shape, cpVect p, cpPointQueryInfo *info); +typedef void (*cpShapeSegmentQueryImpl)(const cpShape *shape, cpVect a, cpVect b, cpFloat radius, cpSegmentQueryInfo *info); + +/// @private +struct cpShapeClass { + cpShapeType type; + + cpShapeCacheDataImpl cacheData; + cpShapeDestroyImpl destroy; + cpShapePointQueryImpl pointQuery; + cpShapeSegmentQueryImpl segmentQuery; +}; + +/// Opaque collision shape struct. +struct cpShape { + CP_PRIVATE(const cpShapeClass *klass); + + /// The rigid body this collision shape is attached to. + CP_PRIVATE(cpBody *body); + + // Optional mass of the shape. + CP_PRIVATE(struct cpShapeMassInfo massInfo); + + /// The current bounding box of the shape. + CP_PRIVATE(cpBB bb); + + /// Sensor flag. + /// Sensor shapes call collision callbacks but don't produce collisions. + CP_PRIVATE(cpBool sensor); + + /// Coefficient of restitution. (elasticity) + CP_PRIVATE(cpFloat e); + /// Coefficient of friction. + CP_PRIVATE(cpFloat u); + /// Surface velocity used when solving for friction. + CP_PRIVATE(cpVect surfaceV); + + /// User definable data pointer. + /// Generally this points to your the game object class so you can access it + /// when given a cpShape reference in a callback. + CP_PRIVATE(cpDataPointer userData); + + /// Collision type of this shape used when picking collision handlers. + CP_PRIVATE(cpCollisionType type); + + CP_PRIVATE(cpShapeFilter filter); + + CP_PRIVATE(cpSpace *space); + + CP_PRIVATE(cpShape *next); + CP_PRIVATE(cpShape *prev); + + CP_PRIVATE(cpHashValue hashid); +}; + +/// Destroy a shape. +void cpShapeDestroy(cpShape *shape); +/// Destroy and Free a shape. +void cpShapeFree(cpShape *shape); + +/// Update, cache and return the bounding box of a shape based on the body it's attached to. +cpBB cpShapeCacheBB(cpShape *shape); +/// Update, cache and return the bounding box of a shape with an explicit transformation. +cpBB cpShapeUpdate(cpShape *shape, cpTransform transform); + +/// Perform a nearest point query. It finds the closest point on the surface of shape to a specific point. +/// The value returned is the distance between the points. A negative distance means the point is inside the shape. +cpFloat cpShapePointQuery(const cpShape *shape, cpVect p, cpPointQueryInfo *out); + +/// Perform a segment query against a shape. @c info must be a pointer to a valid cpSegmentQueryInfo structure. +cpBool cpShapeSegmentQuery(const cpShape *shape, cpVect a, cpVect b, cpFloat radius, cpSegmentQueryInfo *info); + +/// Return contact information about two shapes. +cpContactPointSet cpShapesCollide(const cpShape *a, const cpShape *b); + + +#define CP_DefineShapeStructGetter(type, member, name) \ +static inline type cpShapeGet##name(const cpShape *shape){return shape->CP_PRIVATE(member);} + +#define CP_DefineShapeStructSetter(type, member, name, activates) \ +static inline void cpShapeSet##name(cpShape *shape, type value){ \ + if(activates) cpBodyActivate(shape->CP_PRIVATE(body)); \ + shape->CP_PRIVATE(member) = value; \ +} + +#define CP_DefineShapeStructProperty(type, member, name, activates) \ +CP_DefineShapeStructGetter(type, member, name) \ +CP_DefineShapeStructSetter(type, member, name, activates) + +CP_DefineShapeStructGetter(cpSpace*, space, Space) + +CP_DefineShapeStructGetter(cpBody*, body, Body) +void cpShapeSetBody(cpShape *shape, cpBody *body); + +cpFloat cpShapeGetMass(cpShape *shape); +void cpShapeSetMass(cpShape *shape, cpFloat mass); + +cpFloat cpShapeGetDensity(cpShape *shape); +void cpShapeSetDensity(cpShape *shape, cpFloat density); + +cpFloat cpShapeGetMoment(cpShape *shape); +cpFloat cpShapeGetArea(cpShape *shape); +cpVect cpShapeGetCenterOfGravity(cpShape *shape); + +CP_DefineShapeStructGetter(cpBB, bb, BB) +CP_DefineShapeStructProperty(cpBool, sensor, Sensor, cpTrue) +CP_DefineShapeStructProperty(cpFloat, e, Elasticity, cpFalse) +CP_DefineShapeStructProperty(cpFloat, u, Friction, cpTrue) +CP_DefineShapeStructProperty(cpVect, surfaceV, SurfaceVelocity, cpTrue) +CP_DefineShapeStructProperty(cpDataPointer, userData, UserData, cpFalse) +CP_DefineShapeStructProperty(cpCollisionType, type, CollisionType, cpTrue) +CP_DefineShapeStructProperty(cpShapeFilter, filter, Filter, cpTrue) + +/// When initializing a shape, it's hash value comes from a counter. +/// Because the hash value may affect iteration order, you can reset the shape ID counter +/// when recreating a space. This will make the simulation be deterministic. +void cpResetShapeIdCounter(void); + +#define CP_DeclareShapeGetter(struct, type, name) type struct##Get##name(const cpShape *shape) + +/// @} +/// @defgroup cpCircleShape cpCircleShape + +/// @private +typedef struct cpCircleShape { + cpShape shape; + + cpVect c, tc; + cpFloat r; +} cpCircleShape; + +/// Allocate a circle shape. +cpCircleShape* cpCircleShapeAlloc(void); +/// Initialize a circle shape. +cpCircleShape* cpCircleShapeInit(cpCircleShape *circle, cpBody *body, cpFloat radius, cpVect offset); +/// Allocate and initialize a circle shape. +cpShape* cpCircleShapeNew(cpBody *body, cpFloat radius, cpVect offset); + +CP_DeclareShapeGetter(cpCircleShape, cpVect, Offset); +CP_DeclareShapeGetter(cpCircleShape, cpFloat, Radius); + +/// @} +/// @defgroup cpSegmentShape cpSegmentShape + +/// @private +typedef struct cpSegmentShape { + cpShape shape; + + cpVect a, b, n; + cpVect ta, tb, tn; + cpFloat r; + + cpVect a_tangent, b_tangent; +} cpSegmentShape; + +/// Allocate a segment shape. +cpSegmentShape* cpSegmentShapeAlloc(void); +/// Initialize a segment shape. +cpSegmentShape* cpSegmentShapeInit(cpSegmentShape *seg, cpBody *body, cpVect a, cpVect b, cpFloat radius); +/// Allocate and initialize a segment shape. +cpShape* cpSegmentShapeNew(cpBody *body, cpVect a, cpVect b, cpFloat radius); + +/// Let Chipmunk know about the geometry of adjacent segments to avoid colliding with endcaps. +void cpSegmentShapeSetNeighbors(cpShape *shape, cpVect prev, cpVect next); + +CP_DeclareShapeGetter(cpSegmentShape, cpVect, A); +CP_DeclareShapeGetter(cpSegmentShape, cpVect, B); +CP_DeclareShapeGetter(cpSegmentShape, cpVect, Normal); +CP_DeclareShapeGetter(cpSegmentShape, cpFloat, Radius); + +/// @} diff --git a/external/Chipmunk/include/chipmunk/cpSimpleMotor.h b/external/Chipmunk/include/chipmunk/cpSimpleMotor.h new file mode 100644 index 0000000..37d28c5 --- /dev/null +++ b/external/Chipmunk/include/chipmunk/cpSimpleMotor.h @@ -0,0 +1,46 @@ +/* Copyright (c) 2007 Scott Lembcke + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +/// @defgroup cpSimpleMotor cpSimpleMotor +/// @{ + +const cpConstraintClass *cpSimpleMotorGetClass(void); + +/// @private +typedef struct cpSimpleMotor { + cpConstraint constraint; + cpFloat rate; + + cpFloat iSum; + + cpFloat jAcc; +} cpSimpleMotor; + +/// Allocate a simple motor. +cpSimpleMotor* cpSimpleMotorAlloc(void); +/// initialize a simple motor. +cpSimpleMotor* cpSimpleMotorInit(cpSimpleMotor *joint, cpBody *a, cpBody *b, cpFloat rate); +/// Allocate and initialize a simple motor. +cpConstraint* cpSimpleMotorNew(cpBody *a, cpBody *b, cpFloat rate); + +CP_DefineConstraintProperty(cpSimpleMotor, cpFloat, rate, Rate) + +/// @} diff --git a/external/Chipmunk/include/chipmunk/cpSlideJoint.h b/external/Chipmunk/include/chipmunk/cpSlideJoint.h new file mode 100644 index 0000000..40db8bb --- /dev/null +++ b/external/Chipmunk/include/chipmunk/cpSlideJoint.h @@ -0,0 +1,53 @@ +/* Copyright (c) 2007 Scott Lembcke + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +/// @defgroup cpSlideJoint cpSlideJoint +/// @{ + +const cpConstraintClass *cpSlideJointGetClass(void); + +/// @private +typedef struct cpSlideJoint { + cpConstraint constraint; + cpVect anchr1, anchr2; + cpFloat min, max; + + cpVect r1, r2; + cpVect n; + cpFloat nMass; + + cpFloat jnAcc; + cpFloat bias; +} cpSlideJoint; + +/// Allocate a slide joint. +cpSlideJoint* cpSlideJointAlloc(void); +/// Initialize a slide joint. +cpSlideJoint* cpSlideJointInit(cpSlideJoint *joint, cpBody *a, cpBody *b, cpVect anchr1, cpVect anchr2, cpFloat min, cpFloat max); +/// Allocate and initialize a slide joint. +cpConstraint* cpSlideJointNew(cpBody *a, cpBody *b, cpVect anchr1, cpVect anchr2, cpFloat min, cpFloat max); + +CP_DefineConstraintProperty(cpSlideJoint, cpVect, anchr1, Anchr1) +CP_DefineConstraintProperty(cpSlideJoint, cpVect, anchr2, Anchr2) +CP_DefineConstraintProperty(cpSlideJoint, cpFloat, min, Min) +CP_DefineConstraintProperty(cpSlideJoint, cpFloat, max, Max) + +/// @} diff --git a/external/Chipmunk/include/chipmunk/cpSpace.h b/external/Chipmunk/include/chipmunk/cpSpace.h new file mode 100644 index 0000000..973f4d3 --- /dev/null +++ b/external/Chipmunk/include/chipmunk/cpSpace.h @@ -0,0 +1,328 @@ +/* Copyright (c) 2007 Scott Lembcke + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +/// @defgroup cpSpace cpSpace +/// @{ + +//MARK: Definitions + +typedef struct cpContactBufferHeader cpContactBufferHeader; +typedef void (*cpSpaceArbiterApplyImpulseFunc)(cpArbiter *arb); + +/// Collision begin event function callback type. +/// Returning false from a begin callback causes the collision to be ignored until +/// the the separate callback is called when the objects stop colliding. +typedef cpBool (*cpCollisionBeginFunc)(cpArbiter *arb, cpSpace *space, cpDataPointer userData); +/// Collision pre-solve event function callback type. +/// Returning false from a pre-step callback causes the collision to be ignored until the next step. +typedef cpBool (*cpCollisionPreSolveFunc)(cpArbiter *arb, cpSpace *space, cpDataPointer userData); +/// Collision post-solve event function callback type. +typedef void (*cpCollisionPostSolveFunc)(cpArbiter *arb, cpSpace *space, cpDataPointer userData); +/// Collision separate event function callback type. +typedef void (*cpCollisionSeparateFunc)(cpArbiter *arb, cpSpace *space, cpDataPointer userData); + +struct cpCollisionHandler { + const cpCollisionType typeA, typeB; + cpCollisionBeginFunc beginFunc; + cpCollisionPreSolveFunc preSolveFunc; + cpCollisionPostSolveFunc postSolveFunc; + cpCollisionSeparateFunc separateFunc; + cpDataPointer userData; +}; + +/// Basic Unit of Simulation in Chipmunk +struct cpSpace { + /// Number of iterations to use in the impulse solver to solve contacts. + int iterations; + + /// Gravity to pass to rigid bodies when integrating velocity. + cpVect gravity; + + /// Damping rate expressed as the fraction of velocity bodies retain each second. + /// A value of 0.9 would mean that each body's velocity will drop 10% per second. + /// The default value is 1.0, meaning no damping is applied. + /// @note This damping value is different than those of cpDampedSpring and cpDampedRotarySpring. + cpFloat damping; + + /// Speed threshold for a body to be considered idle. + /// The default value of 0 means to let the space guess a good threshold based on gravity. + cpFloat idleSpeedThreshold; + + /// Time a group of bodies must remain idle in order to fall asleep. + /// Enabling sleeping also implicitly enables the the contact graph. + /// The default value of INFINITY disables the sleeping algorithm. + cpFloat sleepTimeThreshold; + + /// Amount of encouraged penetration between colliding shapes. + /// Used to reduce oscillating contacts and keep the collision cache warm. + /// Defaults to 0.1. If you have poor simulation quality, + /// increase this number as much as possible without allowing visible amounts of overlap. + cpFloat collisionSlop; + + /// Determines how fast overlapping shapes are pushed apart. + /// Expressed as a fraction of the error remaining after each second. + /// Defaults to pow(1.0 - 0.1, 60.0) meaning that Chipmunk fixes 10% of overlap each frame at 60Hz. + cpFloat collisionBias; + + /// Number of frames that contact information should persist. + /// Defaults to 3. There is probably never a reason to change this value. + cpTimestamp collisionPersistence; + + /// User definable data pointer. + /// Generally this points to your game's controller or game state + /// class so you can access it when given a cpSpace reference in a callback. + cpDataPointer userData; + + CP_PRIVATE(cpTimestamp stamp); + CP_PRIVATE(cpFloat curr_dt); + + CP_PRIVATE(cpArray *dynamicBodies); + CP_PRIVATE(cpArray *otherBodies); + CP_PRIVATE(cpArray *rousedBodies); + CP_PRIVATE(cpArray *sleepingComponents); + + CP_PRIVATE(cpHashValue shapeIDCounter); + CP_PRIVATE(cpSpatialIndex *staticShapes); + CP_PRIVATE(cpSpatialIndex *dynamicShapes); + + CP_PRIVATE(cpArray *constraints); + + CP_PRIVATE(cpArray *arbiters); + CP_PRIVATE(cpContactBufferHeader *contactBuffersHead); + CP_PRIVATE(cpHashSet *cachedArbiters); + CP_PRIVATE(cpArray *pooledArbiters); + + CP_PRIVATE(cpArray *allocatedBuffers); + CP_PRIVATE(unsigned int locked); + + CP_PRIVATE(cpBool usesWildcards); + CP_PRIVATE(cpHashSet *collisionHandlers); + CP_PRIVATE(cpCollisionHandler defaultHandler); + + CP_PRIVATE(cpBool skipPostStep); + CP_PRIVATE(cpArray *postStepCallbacks); + + CP_PRIVATE(cpBody *staticBody); + CP_PRIVATE(cpBody _staticBody); +}; + +// TODO: Make timestep a parameter? + + +//MARK: Memory and Initialization + +/// Allocate a cpSpace. +cpSpace* cpSpaceAlloc(void); +/// Initialize a cpSpace. +cpSpace* cpSpaceInit(cpSpace *space); +/// Allocate and initialize a cpSpace. +cpSpace* cpSpaceNew(void); + +/// Destroy a cpSpace. +void cpSpaceDestroy(cpSpace *space); +/// Destroy and free a cpSpace. +void cpSpaceFree(cpSpace *space); + + +//MARK: Properties + +#define CP_DefineSpaceStructGetter(type, member, name) \ +static inline type cpSpaceGet##name(const cpSpace *space){return space->member;} + +#define CP_DefineSpaceStructSetter(type, member, name) \ +static inline void cpSpaceSet##name(cpSpace *space, type value){space->member = value;} + +#define CP_DefineSpaceStructProperty(type, member, name) \ +CP_DefineSpaceStructGetter(type, member, name) \ +CP_DefineSpaceStructSetter(type, member, name) + +CP_DefineSpaceStructProperty(int, iterations, Iterations) +CP_DefineSpaceStructProperty(cpVect, gravity, Gravity) +CP_DefineSpaceStructProperty(cpFloat, damping, Damping) +CP_DefineSpaceStructProperty(cpFloat, idleSpeedThreshold, IdleSpeedThreshold) +CP_DefineSpaceStructProperty(cpFloat, sleepTimeThreshold, SleepTimeThreshold) +CP_DefineSpaceStructProperty(cpFloat, collisionSlop, CollisionSlop) +CP_DefineSpaceStructProperty(cpFloat, collisionBias, CollisionBias) +CP_DefineSpaceStructProperty(cpTimestamp, collisionPersistence, CollisionPersistence) +CP_DefineSpaceStructProperty(cpDataPointer, userData, UserData) +CP_DefineSpaceStructGetter(cpBody *, CP_PRIVATE(staticBody), StaticBody) +CP_DefineSpaceStructGetter(cpFloat, CP_PRIVATE(curr_dt), CurrentTimeStep) + +/// returns true from inside a callback and objects cannot be added/removed. +static inline cpBool +cpSpaceIsLocked(cpSpace *space) +{ + return space->CP_PRIVATE(locked); +} + + +//MARK: Collision Handlers + +cpCollisionHandler *cpSpaceAddDefaultCollisionHandler(cpSpace *space); +cpCollisionHandler *cpSpaceAddCollisionHandler(cpSpace *space, cpCollisionType a, cpCollisionType b); +cpCollisionHandler *cpSpaceAddWildcardHandler(cpSpace *space, cpCollisionType type); + + +//MARK: Add/Remove objects + +/// Add a collision shape to the simulation. +/// If the shape is attached to a static body, it will be added as a static shape. +cpShape* cpSpaceAddShape(cpSpace *space, cpShape *shape); +/// Add a rigid body to the simulation. +cpBody* cpSpaceAddBody(cpSpace *space, cpBody *body); +/// Add a constraint to the simulation. +cpConstraint* cpSpaceAddConstraint(cpSpace *space, cpConstraint *constraint); + +/// Remove a collision shape from the simulation. +void cpSpaceRemoveShape(cpSpace *space, cpShape *shape); +/// Remove a rigid body from the simulation. +void cpSpaceRemoveBody(cpSpace *space, cpBody *body); +/// Remove a constraint from the simulation. +void cpSpaceRemoveConstraint(cpSpace *space, cpConstraint *constraint); + +/// Test if a collision shape has been added to the space. +cpBool cpSpaceContainsShape(cpSpace *space, cpShape *shape); +/// Test if a rigid body has been added to the space. +cpBool cpSpaceContainsBody(cpSpace *space, cpBody *body); +/// Test if a constraint has been added to the space. +cpBool cpSpaceContainsConstraint(cpSpace *space, cpConstraint *constraint); + +//MARK: Post-Step Callbacks + +/// Post Step callback function type. +typedef void (*cpPostStepFunc)(cpSpace *space, void *key, void *data); +/// Schedule a post-step callback to be called when cpSpaceStep() finishes. +/// You can only register one callback per unique value for @c key. +/// Returns true only if @c key has never been scheduled before. +/// It's possible to pass @c NULL for @c func if you only want to mark @c key as being used. +cpBool cpSpaceAddPostStepCallback(cpSpace *space, cpPostStepFunc func, void *key, void *data); + + +//MARK: Queries + +// TODO: Queries and iterators should take a cpSpace parametery. +// TODO: They should also be abortable. + +/// Nearest point query callback function type. +typedef void (*cpSpacePointQueryFunc)(cpShape *shape, cpVect point, cpFloat distance, cpVect gradient, void *data); +/// Query the space at a point and call @c func for each shape found. +void cpSpacePointQuery(cpSpace *space, cpVect point, cpFloat maxDistance, cpShapeFilter filter, cpSpacePointQueryFunc func, void *data); +/// Query the space at a point and return the nearest shape found. Returns NULL if no shapes were found. +cpShape *cpSpacePointQueryNearest(cpSpace *space, cpVect point, cpFloat maxDistance, cpShapeFilter filter, cpPointQueryInfo *out); + +/// Segment query callback function type. +typedef void (*cpSpaceSegmentQueryFunc)(cpShape *shape, cpVect point, cpVect normal, cpFloat alpha, void *data); +/// Perform a directed line segment query (like a raycast) against the space calling @c func for each shape intersected. +void cpSpaceSegmentQuery(cpSpace *space, cpVect start, cpVect end, cpFloat radius, cpShapeFilter filter, cpSpaceSegmentQueryFunc func, void *data); +/// Perform a directed line segment query (like a raycast) against the space and return the first shape hit. Returns NULL if no shapes were hit. +cpShape *cpSpaceSegmentQueryFirst(cpSpace *space, cpVect start, cpVect end, cpFloat radius, cpShapeFilter filter, cpSegmentQueryInfo *out); + +/// Rectangle Query callback function type. +typedef void (*cpSpaceBBQueryFunc)(cpShape *shape, void *data); +/// Perform a fast rectangle query on the space calling @c func for each shape found. +/// Only the shape's bounding boxes are checked for overlap, not their full shape. +void cpSpaceBBQuery(cpSpace *space, cpBB bb, cpShapeFilter filter, cpSpaceBBQueryFunc func, void *data); + +/// Shape query callback function type. +typedef void (*cpSpaceShapeQueryFunc)(cpShape *shape, cpContactPointSet *points, void *data); +/// Query a space for any shapes overlapping the given shape and call @c func for each shape found. +cpBool cpSpaceShapeQuery(cpSpace *space, cpShape *shape, cpSpaceShapeQueryFunc func, void *data); + + +//MARK: Iteration + +/// Space/body iterator callback function type. +typedef void (*cpSpaceBodyIteratorFunc)(cpBody *body, void *data); +/// Call @c func for each body in the space. +void cpSpaceEachBody(cpSpace *space, cpSpaceBodyIteratorFunc func, void *data); + +/// Space/body iterator callback function type. +typedef void (*cpSpaceShapeIteratorFunc)(cpShape *shape, void *data); +/// Call @c func for each shape in the space. +void cpSpaceEachShape(cpSpace *space, cpSpaceShapeIteratorFunc func, void *data); + +/// Space/constraint iterator callback function type. +typedef void (*cpSpaceConstraintIteratorFunc)(cpConstraint *constraint, void *data); +/// Call @c func for each shape in the space. +void cpSpaceEachConstraint(cpSpace *space, cpSpaceConstraintIteratorFunc func, void *data); + + +//MARK: Indexing + +/// Update the collision detection info for the static shapes in the space. +void cpSpaceReindexStatic(cpSpace *space); +/// Update the collision detection data for a specific shape in the space. +void cpSpaceReindexShape(cpSpace *space, cpShape *shape); +/// Update the collision detection data for all shapes attached to a body. +void cpSpaceReindexShapesForBody(cpSpace *space, cpBody *body); + +/// Switch the space to use a spatial has as it's spatial index. +void cpSpaceUseSpatialHash(cpSpace *space, cpFloat dim, int count); + + +//MARK: Time Stepping + +/// Step the space forward in time by @c dt. +void cpSpaceStep(cpSpace *space, cpFloat dt); + + +//MARK: Debug API + +#ifndef CP_SPACE_DISABLE_DEBUG_API + +typedef struct cpSpaceDebugColor { + float r, g, b, a; +} cpSpaceDebugColor; + +typedef void (*cpSpaceDebugDrawCircleImpl)(cpVect pos, cpFloat angle, cpFloat radius, cpSpaceDebugColor outlineColor, cpSpaceDebugColor fillColor, cpDataPointer *data); +typedef void (*cpSpaceDebugDrawSegmentImpl)(cpVect a, cpVect b, cpSpaceDebugColor color, cpDataPointer *data); +typedef void (*cpSpaceDebugDrawFatSegmentImpl)(cpVect a, cpVect b, cpFloat radius, cpSpaceDebugColor outlineColor, cpSpaceDebugColor fillColor, cpDataPointer *data); +typedef void (*cpSpaceDebugDrawPolygonImpl)(int count, const cpVect *verts, cpFloat radius, cpSpaceDebugColor outlineColor, cpSpaceDebugColor fillColor, cpDataPointer *data); +typedef void (*cpSpaceDebugDrawDotImpl)(cpFloat size, cpVect pos, cpSpaceDebugColor color, cpDataPointer *data); +typedef cpSpaceDebugColor (*cpSpaceDebugDrawColorForShapeImpl)(cpShape *shape, cpDataPointer *data); + +typedef enum cpSpaceDebugDrawFlags { + CP_SPACE_DEBUG_DRAW_SHAPES = 1<<0, + CP_SPACE_DEBUG_DRAW_CONSTRAINTS = 1<<1, + CP_SPACE_DEBUG_DRAW_COLLISION_POINTS = 1<<2, +} cpSpaceDebugDrawFlags; + +typedef struct cpSpaceDebugDrawOptions { + cpSpaceDebugDrawCircleImpl drawCircle; + cpSpaceDebugDrawSegmentImpl drawSegment; + cpSpaceDebugDrawFatSegmentImpl drawFatSegment; + cpSpaceDebugDrawPolygonImpl drawPolygon; + cpSpaceDebugDrawDotImpl drawDot; + + cpSpaceDebugDrawFlags flags; + cpSpaceDebugColor shapeOutlineColor; + cpSpaceDebugDrawColorForShapeImpl colorForShape; + cpSpaceDebugColor constraintColor; + cpSpaceDebugColor collisionPointColor; + + cpDataPointer data; +} cpSpaceDebugDrawOptions; + +void cpSpaceDebugDraw(cpSpace *space, cpSpaceDebugDrawOptions *options); + +#endif + +/// @} diff --git a/external/Chipmunk/include/chipmunk/cpSpatialIndex.h b/external/Chipmunk/include/chipmunk/cpSpatialIndex.h new file mode 100644 index 0000000..c279cad --- /dev/null +++ b/external/Chipmunk/include/chipmunk/cpSpatialIndex.h @@ -0,0 +1,227 @@ +/* Copyright (c) 2010 Scott Lembcke + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +/** + @defgroup cpSpatialIndex cpSpatialIndex + + Spatial indexes are data structures that are used to accelerate collision detection + and spatial queries. Chipmunk provides a number of spatial index algorithms to pick from + and they are programmed in a generic way so that you can use them for holding more than + just cpShape structs. + + It works by using @c void pointers to the objects you add and using a callback to ask your code + for bounding boxes when it needs them. Several types of queries can be performed an index as well + as reindexing and full collision information. All communication to the spatial indexes is performed + through callback functions. + + Spatial indexes should be treated as opaque structs. + This meanns you shouldn't be reading any of the struct fields. + @{ +*/ + +//MARK: Spatial Index + +/// Spatial index bounding box callback function type. +/// The spatial index calls this function and passes you a pointer to an object you added +/// when it needs to get the bounding box associated with that object. +typedef cpBB (*cpSpatialIndexBBFunc)(void *obj); +/// Spatial index/object iterator callback function type. +typedef void (*cpSpatialIndexIteratorFunc)(void *obj, void *data); +/// Spatial query callback function type. +typedef cpCollisionID (*cpSpatialIndexQueryFunc)(void *obj1, void *obj2, cpCollisionID id, void *data); +/// Spatial segment query callback function type. +typedef cpFloat (*cpSpatialIndexSegmentQueryFunc)(void *obj1, void *obj2, void *data); + + +typedef struct cpSpatialIndexClass cpSpatialIndexClass; +typedef struct cpSpatialIndex cpSpatialIndex; + +/// @private +struct cpSpatialIndex { + cpSpatialIndexClass *klass; + + cpSpatialIndexBBFunc bbfunc; + + cpSpatialIndex *staticIndex, *dynamicIndex; +}; + + +//MARK: Spatial Hash + +typedef struct cpSpaceHash cpSpaceHash; + +/// Allocate a spatial hash. +cpSpaceHash* cpSpaceHashAlloc(void); +/// Initialize a spatial hash. +cpSpatialIndex* cpSpaceHashInit(cpSpaceHash *hash, cpFloat celldim, int numcells, cpSpatialIndexBBFunc bbfunc, cpSpatialIndex *staticIndex); +/// Allocate and initialize a spatial hash. +cpSpatialIndex* cpSpaceHashNew(cpFloat celldim, int cells, cpSpatialIndexBBFunc bbfunc, cpSpatialIndex *staticIndex); + +/// Change the cell dimensions and table size of the spatial hash to tune it. +/// The cell dimensions should roughly match the average size of your objects +/// and the table size should be ~10 larger than the number of objects inserted. +/// Some trial and error is required to find the optimum numbers for efficiency. +void cpSpaceHashResize(cpSpaceHash *hash, cpFloat celldim, int numcells); + +//MARK: AABB Tree + +typedef struct cpBBTree cpBBTree; + +/// Allocate a bounding box tree. +cpBBTree* cpBBTreeAlloc(void); +/// Initialize a bounding box tree. +cpSpatialIndex* cpBBTreeInit(cpBBTree *tree, cpSpatialIndexBBFunc bbfunc, cpSpatialIndex *staticIndex); +/// Allocate and initialize a bounding box tree. +cpSpatialIndex* cpBBTreeNew(cpSpatialIndexBBFunc bbfunc, cpSpatialIndex *staticIndex); + +/// Perform a static top down optimization of the tree. +void cpBBTreeOptimize(cpSpatialIndex *index); + +/// Bounding box tree velocity callback function. +/// This function should return an estimate for the object's velocity. +typedef cpVect (*cpBBTreeVelocityFunc)(void *obj); +/// Set the velocity function for the bounding box tree to enable temporal coherence. +void cpBBTreeSetVelocityFunc(cpSpatialIndex *index, cpBBTreeVelocityFunc func); + +//MARK: Single Axis Sweep + +typedef struct cpSweep1D cpSweep1D; + +/// Allocate a 1D sort and sweep broadphase. +cpSweep1D* cpSweep1DAlloc(void); +/// Initialize a 1D sort and sweep broadphase. +cpSpatialIndex* cpSweep1DInit(cpSweep1D *sweep, cpSpatialIndexBBFunc bbfunc, cpSpatialIndex *staticIndex); +/// Allocate and initialize a 1D sort and sweep broadphase. +cpSpatialIndex* cpSweep1DNew(cpSpatialIndexBBFunc bbfunc, cpSpatialIndex *staticIndex); + +//MARK: Spatial Index Implementation + +typedef void (*cpSpatialIndexDestroyImpl)(cpSpatialIndex *index); + +typedef int (*cpSpatialIndexCountImpl)(cpSpatialIndex *index); +typedef void (*cpSpatialIndexEachImpl)(cpSpatialIndex *index, cpSpatialIndexIteratorFunc func, void *data); + +typedef cpBool (*cpSpatialIndexContainsImpl)(cpSpatialIndex *index, void *obj, cpHashValue hashid); +typedef void (*cpSpatialIndexInsertImpl)(cpSpatialIndex *index, void *obj, cpHashValue hashid); +typedef void (*cpSpatialIndexRemoveImpl)(cpSpatialIndex *index, void *obj, cpHashValue hashid); + +typedef void (*cpSpatialIndexReindexImpl)(cpSpatialIndex *index); +typedef void (*cpSpatialIndexReindexObjectImpl)(cpSpatialIndex *index, void *obj, cpHashValue hashid); +typedef void (*cpSpatialIndexReindexQueryImpl)(cpSpatialIndex *index, cpSpatialIndexQueryFunc func, void *data); + +typedef void (*cpSpatialIndexQueryImpl)(cpSpatialIndex *index, void *obj, cpBB bb, cpSpatialIndexQueryFunc func, void *data); +typedef void (*cpSpatialIndexSegmentQueryImpl)(cpSpatialIndex *index, void *obj, cpVect a, cpVect b, cpFloat t_exit, cpSpatialIndexSegmentQueryFunc func, void *data); + +struct cpSpatialIndexClass { + cpSpatialIndexDestroyImpl destroy; + + cpSpatialIndexCountImpl count; + cpSpatialIndexEachImpl each; + + cpSpatialIndexContainsImpl contains; + cpSpatialIndexInsertImpl insert; + cpSpatialIndexRemoveImpl remove; + + cpSpatialIndexReindexImpl reindex; + cpSpatialIndexReindexObjectImpl reindexObject; + cpSpatialIndexReindexQueryImpl reindexQuery; + + cpSpatialIndexQueryImpl query; + cpSpatialIndexSegmentQueryImpl segmentQuery; +}; + +/// Destroy and free a spatial index. +void cpSpatialIndexFree(cpSpatialIndex *index); +/// Collide the objects in @c dynamicIndex against the objects in @c staticIndex using the query callback function. +void cpSpatialIndexCollideStatic(cpSpatialIndex *dynamicIndex, cpSpatialIndex *staticIndex, cpSpatialIndexQueryFunc func, void *data); + +/// Destroy a spatial index. +static inline void cpSpatialIndexDestroy(cpSpatialIndex *index) +{ + if(index->klass) index->klass->destroy(index); +} + +/// Get the number of objects in the spatial index. +static inline int cpSpatialIndexCount(cpSpatialIndex *index) +{ + return index->klass->count(index); +} + +/// Iterate the objects in the spatial index. @c func will be called once for each object. +static inline void cpSpatialIndexEach(cpSpatialIndex *index, cpSpatialIndexIteratorFunc func, void *data) +{ + index->klass->each(index, func, data); +} + +/// Returns true if the spatial index contains the given object. +/// Most spatial indexes use hashed storage, so you must provide a hash value too. +static inline cpBool cpSpatialIndexContains(cpSpatialIndex *index, void *obj, cpHashValue hashid) +{ + return index->klass->contains(index, obj, hashid); +} + +/// Add an object to a spatial index. +/// Most spatial indexes use hashed storage, so you must provide a hash value too. +static inline void cpSpatialIndexInsert(cpSpatialIndex *index, void *obj, cpHashValue hashid) +{ + index->klass->insert(index, obj, hashid); +} + +/// Remove an object from a spatial index. +/// Most spatial indexes use hashed storage, so you must provide a hash value too. +static inline void cpSpatialIndexRemove(cpSpatialIndex *index, void *obj, cpHashValue hashid) +{ + index->klass->remove(index, obj, hashid); +} + +/// Perform a full reindex of a spatial index. +static inline void cpSpatialIndexReindex(cpSpatialIndex *index) +{ + index->klass->reindex(index); +} + +/// Reindex a single object in the spatial index. +static inline void cpSpatialIndexReindexObject(cpSpatialIndex *index, void *obj, cpHashValue hashid) +{ + index->klass->reindexObject(index, obj, hashid); +} + +/// Perform a rectangle query against the spatial index, calling @c func for each potential match. +static inline void cpSpatialIndexQuery(cpSpatialIndex *index, void *obj, cpBB bb, cpSpatialIndexQueryFunc func, void *data) +{ + index->klass->query(index, obj, bb, func, data); +} + +/// Perform a segment query against the spatial index, calling @c func for each potential match. +static inline void cpSpatialIndexSegmentQuery(cpSpatialIndex *index, void *obj, cpVect a, cpVect b, cpFloat t_exit, cpSpatialIndexSegmentQueryFunc func, void *data) +{ + index->klass->segmentQuery(index, obj, a, b, t_exit, func, data); +} + +/// Simultaneously reindex and find all colliding objects. +/// @c func will be called once for each potentially overlapping pair of objects found. +/// If the spatial index was initialized with a static index, it will collide it's objects against that as well. +static inline void cpSpatialIndexReindexQuery(cpSpatialIndex *index, cpSpatialIndexQueryFunc func, void *data) +{ + index->klass->reindexQuery(index, func, data); +} + +///@} diff --git a/external/Chipmunk/include/chipmunk/cpTransform.h b/external/Chipmunk/include/chipmunk/cpTransform.h new file mode 100644 index 0000000..308cce1 --- /dev/null +++ b/external/Chipmunk/include/chipmunk/cpTransform.h @@ -0,0 +1,197 @@ +/* Copyright (c) 2012 Scott Lembcke and Howling Moon Software + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +#ifndef CHIPMUNK_TRANSFORM_H +#define CHIPMUNK_TRANSFORM_H + +#include "chipmunk_types.h" +#include "cpVect.h" +#include "cpBB.h" + +/// Identity transform matrix. +static const cpTransform cpTransformIdentity = {1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f}; + +/// Construct a new transform matrix. +/// (a, b) is the x basis vector. +/// (c, d) is the y basis vector. +/// (tx, ty) is the translation. +static inline cpTransform +cpTransformNew(cpFloat a, cpFloat b, cpFloat c, cpFloat d, cpFloat tx, cpFloat ty) +{ + cpTransform t = {a, b, c, d, tx, ty}; + return t; +} + +/// Construct a new transform matrix in transposed order. +static inline cpTransform +cpTransformNewTranspose(cpFloat a, cpFloat c, cpFloat tx, cpFloat b, cpFloat d, cpFloat ty) +{ + cpTransform t = {a, b, c, d, tx, ty}; + return t; +} + +/// Get the inverse of a transform matrix. +static inline cpTransform +cpTransformInverse(cpTransform t) +{ + float inv_det = 1.0/(t.a*t.d - t.c*t.b); + return cpTransformNewTranspose( + t.d*inv_det, -t.c*inv_det, (t.c*t.ty - t.tx*t.d)*inv_det, + -t.b*inv_det, t.a*inv_det, (t.tx*t.b - t.a*t.ty)*inv_det + ); +} + +/// Multiply two transformation matrices. +static inline cpTransform +cpTransformMult(cpTransform t1, cpTransform t2) +{ + return cpTransformNewTranspose( + t1.a*t2.a + t1.c*t2.b, t1.a*t2.c + t1.c*t2.d, t1.a*t2.tx + t1.c*t2.ty + t1.tx, + t1.b*t2.a + t1.d*t2.b, t1.b*t2.c + t1.d*t2.d, t1.b*t2.tx + t1.d*t2.ty + t1.ty + ); +} + +/// Transform an absolute point. (i.e. a vertex) +static inline cpVect +cpTransformPoint(cpTransform t, cpVect p) +{ + return cpv(t.a*p.x + t.c*p.y + t.tx, t.b*p.x + t.d*p.y + t.ty); +} + +/// Transform a vector (i.e. a normal) +static inline cpVect +cpTransformVect(cpTransform t, cpVect v) +{ + return cpv(t.a*v.x + t.c*v.y, t.b*v.x + t.d*v.y); +} + +/// Transform a cpBB. +static inline cpBB +cpTransformbBB(cpTransform t, cpBB bb) +{ + cpVect center = cpBBCenter(bb); + cpFloat hw = (bb.r - bb.l)*0.5; + cpFloat hh = (bb.t - bb.b)*0.5; + + cpFloat a = t.a*hw, b = t.c*hh, d = t.b*hw, e = t.d*hh; + cpFloat hw_max = cpfmax(cpfabs(a + b), cpfabs(a - b)); + cpFloat hh_max = cpfmax(cpfabs(d + e), cpfabs(d - e)); + return cpBBNewForExtents(cpTransformPoint(t, center), hw_max, hh_max); +} + +/// Create a transation matrix. +static inline cpTransform +cpTransformTranslate(cpVect translate) +{ + return cpTransformNewTranspose( + 1.0, 0.0, translate.x, + 0.0, 1.0, translate.y + ); +} + +/// Create a scale matrix. +static inline cpTransform +cpTransformScale(cpFloat scaleX, cpFloat scaleY) +{ + return cpTransformNewTranspose( + scaleX, 0.0, 0.0, + 0.0, scaleY, 0.0 + ); +} + +/// Create a rotation matrix. +static inline cpTransform +cpTransformRotate(cpFloat radians) +{ + cpVect rot = cpvforangle(radians); + return cpTransformNewTranspose( + rot.x, -rot.y, 0.0, + rot.y, rot.x, 0.0 + ); +} + +/// Create a rigid transformation matrix. (transation + rotation) +static inline cpTransform +cpTransformRigid(cpVect translate, cpFloat radians) +{ + cpVect rot = cpvforangle(radians); + return cpTransformNewTranspose( + rot.x, -rot.y, translate.x, + rot.y, rot.x, translate.y + ); +} + +/// Fast inverse of a rigid transformation matrix. +static inline cpTransform +cpTransformRigidInverse(cpTransform t) +{ + return cpTransformNewTranspose( + t.d, -t.c, (t.c*t.ty - t.tx*t.d), + -t.b, t.a, (t.tx*t.b - t.a*t.ty) + ); +} + +// Miscelaneous (but useful) transformation matrices. + +static inline cpTransform +cpTransformWrap(cpTransform outer, cpTransform inner) +{ + return cpTransformMult(cpTransformInverse(outer), cpTransformMult(inner, outer)); +} + +static inline cpTransform +cpTransformWrapInverse(cpTransform outer, cpTransform inner) +{ + return cpTransformMult(outer, cpTransformMult(inner, cpTransformInverse(outer))); +} + +static inline cpTransform +cpTransformOrtho(cpBB bb) +{ + return cpTransformNewTranspose( + 2.0/(bb.r - bb.l), 0.0, -(bb.r + bb.l)/(bb.r - bb.l), + 0.0, 2.0/(bb.t - bb.b), -(bb.t + bb.b)/(bb.t - bb.b) + ); +} + +static inline cpTransform +cpTransformBoneScale(cpVect v0, cpVect v1) +{ + cpVect d = cpvsub(v1, v0); + return cpTransformNewTranspose( + d.x, -d.y, v0.x, + d.y, d.x, v0.y + ); +} + +static inline cpTransform +cpTransformAxialScale(cpVect axis, cpVect pivot, float scale) +{ + cpFloat A = axis.x*axis.y*(scale - 1.0); + cpFloat B = cpvdot(axis, pivot)*(1.0 - scale); + + return cpTransformNewTranspose( + scale*axis.x*axis.x + axis.y*axis.y, A, axis.x*B, + A, axis.x*axis.x + scale*axis.y*axis.y, axis.y*B + ); +} + +#endif diff --git a/external/Chipmunk/include/chipmunk/cpVect.h b/external/Chipmunk/include/chipmunk/cpVect.h new file mode 100644 index 0000000..c0f24e6 --- /dev/null +++ b/external/Chipmunk/include/chipmunk/cpVect.h @@ -0,0 +1,230 @@ +/* Copyright (c) 2007 Scott Lembcke + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +#ifndef CHIPMUNK_VECT_H +#define CHIPMUNK_VECT_H + +#include "chipmunk_types.h" + +/// @defgroup cpVect cpVect +/// Chipmunk's 2D vector type along with a handy 2D vector math lib. +/// @{ + +/// Constant for the zero vector. +static const cpVect cpvzero = {0.0f,0.0f}; + +/// Convenience constructor for cpVect structs. +static inline cpVect cpv(const cpFloat x, const cpFloat y) +{ + cpVect v = {x, y}; + return v; +} + +/// Check if two vectors are equal. (Be careful when comparing floating point numbers!) +static inline cpBool cpveql(const cpVect v1, const cpVect v2) +{ + return (v1.x == v2.x && v1.y == v2.y); +} + +/// Add two vectors +static inline cpVect cpvadd(const cpVect v1, const cpVect v2) +{ + return cpv(v1.x + v2.x, v1.y + v2.y); +} + +/// Subtract two vectors. +static inline cpVect cpvsub(const cpVect v1, const cpVect v2) +{ + return cpv(v1.x - v2.x, v1.y - v2.y); +} + +/// Negate a vector. +static inline cpVect cpvneg(const cpVect v) +{ + return cpv(-v.x, -v.y); +} + +/// Scalar multiplication. +static inline cpVect cpvmult(const cpVect v, const cpFloat s) +{ + return cpv(v.x*s, v.y*s); +} + +/// Vector dot product. +static inline cpFloat cpvdot(const cpVect v1, const cpVect v2) +{ + return v1.x*v2.x + v1.y*v2.y; +} + +/// 2D vector cross product analog. +/// The cross product of 2D vectors results in a 3D vector with only a z component. +/// This function returns the magnitude of the z value. +static inline cpFloat cpvcross(const cpVect v1, const cpVect v2) +{ + return v1.x*v2.y - v1.y*v2.x; +} + +/// Returns a perpendicular vector. (90 degree rotation) +static inline cpVect cpvperp(const cpVect v) +{ + return cpv(-v.y, v.x); +} + +/// Returns a perpendicular vector. (-90 degree rotation) +static inline cpVect cpvrperp(const cpVect v) +{ + return cpv(v.y, -v.x); +} + +/// Returns the vector projection of v1 onto v2. +static inline cpVect cpvproject(const cpVect v1, const cpVect v2) +{ + return cpvmult(v2, cpvdot(v1, v2)/cpvdot(v2, v2)); +} + +/// Returns the unit length vector for the given angle (in radians). +static inline cpVect cpvforangle(const cpFloat a) +{ + return cpv(cpfcos(a), cpfsin(a)); +} + +/// Returns the angular direction v is pointing in (in radians). +static inline cpFloat cpvtoangle(const cpVect v) +{ + return cpfatan2(v.y, v.x); +} + +/// Uses complex number multiplication to rotate v1 by v2. Scaling will occur if v1 is not a unit vector. +static inline cpVect cpvrotate(const cpVect v1, const cpVect v2) +{ + return cpv(v1.x*v2.x - v1.y*v2.y, v1.x*v2.y + v1.y*v2.x); +} + +/// Inverse of cpvrotate(). +static inline cpVect cpvunrotate(const cpVect v1, const cpVect v2) +{ + return cpv(v1.x*v2.x + v1.y*v2.y, v1.y*v2.x - v1.x*v2.y); +} + +/// Returns the squared length of v. Faster than cpvlength() when you only need to compare lengths. +static inline cpFloat cpvlengthsq(const cpVect v) +{ + return cpvdot(v, v); +} + +/// Returns the length of v. +static inline cpFloat cpvlength(const cpVect v) +{ + return cpfsqrt(cpvdot(v, v)); +} + +/// Linearly interpolate between v1 and v2. +static inline cpVect cpvlerp(const cpVect v1, const cpVect v2, const cpFloat t) +{ + return cpvadd(cpvmult(v1, 1.0f - t), cpvmult(v2, t)); +} + +/// Returns a normalized copy of v. +static inline cpVect cpvnormalize(const cpVect v) +{ + // Neat trick I saw somewhere to avoid div/0. + return cpvmult(v, 1.0f/(cpvlength(v) + CPFLOAT_MIN)); +} + +/// Spherical linearly interpolate between v1 and v2. +static inline cpVect +cpvslerp(const cpVect v1, const cpVect v2, const cpFloat t) +{ + cpFloat dot = cpvdot(cpvnormalize(v1), cpvnormalize(v2)); + cpFloat omega = cpfacos(cpfclamp(dot, -1.0f, 1.0f)); + + if(omega < 1e-3){ + // If the angle between two vectors is very small, lerp instead to avoid precision issues. + return cpvlerp(v1, v2, t); + } else { + cpFloat denom = 1.0f/cpfsin(omega); + return cpvadd(cpvmult(v1, cpfsin((1.0f - t)*omega)*denom), cpvmult(v2, cpfsin(t*omega)*denom)); + } +} + +/// Spherical linearly interpolate between v1 towards v2 by no more than angle a radians +static inline cpVect +cpvslerpconst(const cpVect v1, const cpVect v2, const cpFloat a) +{ + cpFloat dot = cpvdot(cpvnormalize(v1), cpvnormalize(v2)); + cpFloat omega = cpfacos(cpfclamp(dot, -1.0f, 1.0f)); + + return cpvslerp(v1, v2, cpfmin(a, omega)/omega); +} + +/// Clamp v to length len. +static inline cpVect cpvclamp(const cpVect v, const cpFloat len) +{ + return (cpvdot(v,v) > len*len) ? cpvmult(cpvnormalize(v), len) : v; +} + +/// Linearly interpolate between v1 towards v2 by distance d. +static inline cpVect cpvlerpconst(cpVect v1, cpVect v2, cpFloat d) +{ + return cpvadd(v1, cpvclamp(cpvsub(v2, v1), d)); +} + +/// Returns the distance between v1 and v2. +static inline cpFloat cpvdist(const cpVect v1, const cpVect v2) +{ + return cpvlength(cpvsub(v1, v2)); +} + +/// Returns the squared distance between v1 and v2. Faster than cpvdist() when you only need to compare distances. +static inline cpFloat cpvdistsq(const cpVect v1, const cpVect v2) +{ + return cpvlengthsq(cpvsub(v1, v2)); +} + +/// Returns true if the distance between v1 and v2 is less than dist. +static inline cpBool cpvnear(const cpVect v1, const cpVect v2, const cpFloat dist) +{ + return cpvdistsq(v1, v2) < dist*dist; +} + +/// @} + +/// @defgroup cpMat2x2 cpMat2x2 +/// 2x2 matrix type used for tensors and such. +/// @{ + +// NUKE +static inline cpMat2x2 +cpMat2x2New(cpFloat a, cpFloat b, cpFloat c, cpFloat d) +{ + cpMat2x2 m = {a, b, c, d}; + return m; +} + +static inline cpVect +cpMat2x2Transform(cpMat2x2 m, cpVect v) +{ + return cpv(v.x*m.a + v.y*m.b, v.x*m.c + v.y*m.d); +} + +///@} + +#endif diff --git a/external/Chipmunk/msvc/glew/LICENSE.txt b/external/Chipmunk/msvc/glew/LICENSE.txt new file mode 100644 index 0000000..f707804 --- /dev/null +++ b/external/Chipmunk/msvc/glew/LICENSE.txt @@ -0,0 +1,73 @@ +The OpenGL Extension Wrangler Library +Copyright (C) 2002-2007, Milan Ikits +Copyright (C) 2002-2007, Marcelo E. Magallon +Copyright (C) 2002, Lev Povalahev +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. +* The name of the author may be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF +THE POSSIBILITY OF SUCH DAMAGE. + + +Mesa 3-D graphics library +Version: 7.0 + +Copyright (C) 1999-2007 Brian Paul All Rights Reserved. + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the "Software"), +to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, +and/or sell copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + +Copyright (c) 2007 The Khronos Group Inc. + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and/or associated documentation files (the +"Materials"), to deal in the Materials without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Materials, and to +permit persons to whom the Materials are furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Materials. + +THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. diff --git a/external/Chipmunk/msvc/glew/README.txt b/external/Chipmunk/msvc/glew/README.txt new file mode 100644 index 0000000..1b19c53 --- /dev/null +++ b/external/Chipmunk/msvc/glew/README.txt @@ -0,0 +1,18 @@ +See doc/index.html for more information. + +If you downloaded the tarball from the GLEW website, you just need to: + + Unix: + + make + + Windows: + + use the project file in build/vc6/ + +If you wish to build GLEW from scratch (update the extension data from +the net or add your own extension information), you need a Unix +environment (including wget, perl, and GNU make). The extension data +is regenerated from the top level source directory with: + + make extensions diff --git a/external/Chipmunk/msvc/glew/TODO.txt b/external/Chipmunk/msvc/glew/TODO.txt new file mode 100644 index 0000000..d2701b6 --- /dev/null +++ b/external/Chipmunk/msvc/glew/TODO.txt @@ -0,0 +1,12 @@ +Major: + - add support for windows mini-client drivers + - add windows installer (msi) + - separate build of static and shared object files (for mingw and + cygwin) + - start designing GLEW 2.0 + +Minor: + - make auto scripts work with text mode cygwin mounts + - add support for all SUN, MTX, and OML extensions + - make auto/Makefile more robust against auto/core/*~ mistakes + - web poll on separating glew, glxew and wglew diff --git a/external/Chipmunk/msvc/glew/bin/Release/Win32/glew32.dll b/external/Chipmunk/msvc/glew/bin/Release/Win32/glew32.dll new file mode 100644 index 0000000..8eaeafd Binary files /dev/null and b/external/Chipmunk/msvc/glew/bin/Release/Win32/glew32.dll differ diff --git a/external/Chipmunk/msvc/glew/include/GL/glew.h b/external/Chipmunk/msvc/glew/include/GL/glew.h new file mode 100644 index 0000000..51a29ef --- /dev/null +++ b/external/Chipmunk/msvc/glew/include/GL/glew.h @@ -0,0 +1,18062 @@ +/* +** The OpenGL Extension Wrangler Library +** Copyright (C) 2002-2008, Milan Ikits +** Copyright (C) 2002-2008, Marcelo E. Magallon +** Copyright (C) 2002, Lev Povalahev +** All rights reserved. +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are met: +** +** * Redistributions of source code must retain the above copyright notice, +** this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright notice, +** this list of conditions and the following disclaimer in the documentation +** and/or other materials provided with the distribution. +** * The name of the author may be used to endorse or promote products +** derived from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +** ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +** LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +** INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +** CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +** ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF +** THE POSSIBILITY OF SUCH DAMAGE. +*/ + +/* + * Mesa 3-D graphics library + * Version: 7.0 + * + * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN + * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +/* +** Copyright (c) 2007 The Khronos Group Inc. +** +** Permission is hereby granted, free of charge, to any person obtaining a +** copy of this software and/or associated documentation files (the +** "Materials"), to deal in the Materials without restriction, including +** without limitation the rights to use, copy, modify, merge, publish, +** distribute, sublicense, and/or sell copies of the Materials, and to +** permit persons to whom the Materials are furnished to do so, subject to +** the following conditions: +** +** The above copyright notice and this permission notice shall be included +** in all copies or substantial portions of the Materials. +** +** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. +*/ + +#ifndef __glew_h__ +#define __glew_h__ +#define __GLEW_H__ + +#if defined(__gl_h_) || defined(__GL_H__) || defined(__X_GL_H) +#error gl.h included before glew.h +#endif +#if defined(__gl2_h_) +#error gl2.h included before glew.h +#endif +#if defined(__gltypes_h_) +#error gltypes.h included before glew.h +#endif +#if defined(__REGAL_H__) +#error Regal.h included before glew.h +#endif +#if defined(__glext_h_) || defined(__GLEXT_H_) +#error glext.h included before glew.h +#endif +#if defined(__gl_ATI_h_) +#error glATI.h included before glew.h +#endif + +#define __gl_h_ +#define __gl2_h_ +#define __GL_H__ +#define __gltypes_h_ +#define __REGAL_H__ +#define __X_GL_H +#define __glext_h_ +#define __GLEXT_H_ +#define __gl_ATI_h_ + +#if defined(_WIN32) + +/* + * GLEW does not include to avoid name space pollution. + * GL needs GLAPI and GLAPIENTRY, GLU needs APIENTRY, CALLBACK, and wchar_t + * defined properly. + */ +/* */ +#ifndef APIENTRY +#define GLEW_APIENTRY_DEFINED +# if defined(__MINGW32__) || defined(__CYGWIN__) +# define APIENTRY __stdcall +# elif (_MSC_VER >= 800) || defined(_STDCALL_SUPPORTED) || defined(__BORLANDC__) +# define APIENTRY __stdcall +# else +# define APIENTRY +# endif +#endif +#ifndef GLAPI +# if defined(__MINGW32__) || defined(__CYGWIN__) +# define GLAPI extern +# endif +#endif +/* */ +#ifndef CALLBACK +#define GLEW_CALLBACK_DEFINED +# if defined(__MINGW32__) || defined(__CYGWIN__) +# define CALLBACK __attribute__ ((__stdcall__)) +# elif (defined(_M_MRX000) || defined(_M_IX86) || defined(_M_ALPHA) || defined(_M_PPC)) && !defined(MIDL_PASS) +# define CALLBACK __stdcall +# else +# define CALLBACK +# endif +#endif +/* and */ +#ifndef WINGDIAPI +#define GLEW_WINGDIAPI_DEFINED +#define WINGDIAPI __declspec(dllimport) +#endif +/* */ +#if (defined(_MSC_VER) || defined(__BORLANDC__)) && !defined(_WCHAR_T_DEFINED) +typedef unsigned short wchar_t; +# define _WCHAR_T_DEFINED +#endif +/* */ +#if !defined(_W64) +# if !defined(__midl) && (defined(_X86_) || defined(_M_IX86)) && defined(_MSC_VER) && _MSC_VER >= 1300 +# define _W64 __w64 +# else +# define _W64 +# endif +#endif +#if !defined(_PTRDIFF_T_DEFINED) && !defined(_PTRDIFF_T_) && !defined(__MINGW64__) +# ifdef _WIN64 +typedef __int64 ptrdiff_t; +# else +typedef _W64 int ptrdiff_t; +# endif +# define _PTRDIFF_T_DEFINED +# define _PTRDIFF_T_ +#endif + +#ifndef GLAPI +# if defined(__MINGW32__) || defined(__CYGWIN__) +# define GLAPI extern +# else +# define GLAPI WINGDIAPI +# endif +#endif + +#ifndef GLAPIENTRY +#define GLAPIENTRY APIENTRY +#endif + +#ifndef GLEWAPIENTRY +#define GLEWAPIENTRY APIENTRY +#endif + +/* + * GLEW_STATIC is defined for static library. + * GLEW_BUILD is defined for building the DLL library. + */ + +#ifdef GLEW_STATIC +# define GLEWAPI extern +#else +# ifdef GLEW_BUILD +# define GLEWAPI extern __declspec(dllexport) +# else +# define GLEWAPI extern __declspec(dllimport) +# endif +#endif + +#else /* _UNIX */ + +/* + * Needed for ptrdiff_t in turn needed by VBO. This is defined by ISO + * C. On my system, this amounts to _3 lines_ of included code, all of + * them pretty much harmless. If you know of a way of detecting 32 vs + * 64 _targets_ at compile time you are free to replace this with + * something that's portable. For now, _this_ is the portable solution. + * (mem, 2004-01-04) + */ + +#include + +/* SGI MIPSPro doesn't like stdint.h in C++ mode */ +/* ID: 3376260 Solaris 9 has inttypes.h, but not stdint.h */ + +#if (defined(__sgi) || defined(__sun)) && !defined(__GNUC__) +#include +#else +#include +#endif + +#define GLEW_APIENTRY_DEFINED +#define APIENTRY + +/* + * GLEW_STATIC is defined for static library. + */ + +#ifdef GLEW_STATIC +# define GLEWAPI extern +#else +# if defined(__GNUC__) && __GNUC__>=4 +# define GLEWAPI extern __attribute__ ((visibility("default"))) +# elif defined(__SUNPRO_C) || defined(__SUNPRO_CC) +# define GLEWAPI extern __global +# else +# define GLEWAPI extern +# endif +#endif + +/* */ +#ifndef GLAPI +#define GLAPI extern +#endif + +#ifndef GLAPIENTRY +#define GLAPIENTRY +#endif + +#ifndef GLEWAPIENTRY +#define GLEWAPIENTRY +#endif + +#endif /* _WIN32 */ + +#ifdef __cplusplus +extern "C" { +#endif + +/* ----------------------------- GL_VERSION_1_1 ---------------------------- */ + +#ifndef GL_VERSION_1_1 +#define GL_VERSION_1_1 1 + +typedef unsigned int GLenum; +typedef unsigned int GLbitfield; +typedef unsigned int GLuint; +typedef int GLint; +typedef int GLsizei; +typedef unsigned char GLboolean; +typedef signed char GLbyte; +typedef short GLshort; +typedef unsigned char GLubyte; +typedef unsigned short GLushort; +typedef unsigned long GLulong; +typedef float GLfloat; +typedef float GLclampf; +typedef double GLdouble; +typedef double GLclampd; +typedef void GLvoid; +#if defined(_MSC_VER) && _MSC_VER < 1400 +typedef __int64 GLint64EXT; +typedef unsigned __int64 GLuint64EXT; +#elif defined(_MSC_VER) || defined(__BORLANDC__) +typedef signed long long GLint64EXT; +typedef unsigned long long GLuint64EXT; +#else +# if defined(__MINGW32__) || defined(__CYGWIN__) +#include +# endif +typedef int64_t GLint64EXT; +typedef uint64_t GLuint64EXT; +#endif +typedef GLint64EXT GLint64; +typedef GLuint64EXT GLuint64; +typedef struct __GLsync *GLsync; + +typedef char GLchar; + +#define GL_ZERO 0 +#define GL_FALSE 0 +#define GL_LOGIC_OP 0x0BF1 +#define GL_NONE 0 +#define GL_TEXTURE_COMPONENTS 0x1003 +#define GL_NO_ERROR 0 +#define GL_POINTS 0x0000 +#define GL_CURRENT_BIT 0x00000001 +#define GL_TRUE 1 +#define GL_ONE 1 +#define GL_CLIENT_PIXEL_STORE_BIT 0x00000001 +#define GL_LINES 0x0001 +#define GL_LINE_LOOP 0x0002 +#define GL_POINT_BIT 0x00000002 +#define GL_CLIENT_VERTEX_ARRAY_BIT 0x00000002 +#define GL_LINE_STRIP 0x0003 +#define GL_LINE_BIT 0x00000004 +#define GL_TRIANGLES 0x0004 +#define GL_TRIANGLE_STRIP 0x0005 +#define GL_TRIANGLE_FAN 0x0006 +#define GL_QUADS 0x0007 +#define GL_QUAD_STRIP 0x0008 +#define GL_POLYGON_BIT 0x00000008 +#define GL_POLYGON 0x0009 +#define GL_POLYGON_STIPPLE_BIT 0x00000010 +#define GL_PIXEL_MODE_BIT 0x00000020 +#define GL_LIGHTING_BIT 0x00000040 +#define GL_FOG_BIT 0x00000080 +#define GL_DEPTH_BUFFER_BIT 0x00000100 +#define GL_ACCUM 0x0100 +#define GL_LOAD 0x0101 +#define GL_RETURN 0x0102 +#define GL_MULT 0x0103 +#define GL_ADD 0x0104 +#define GL_NEVER 0x0200 +#define GL_ACCUM_BUFFER_BIT 0x00000200 +#define GL_LESS 0x0201 +#define GL_EQUAL 0x0202 +#define GL_LEQUAL 0x0203 +#define GL_GREATER 0x0204 +#define GL_NOTEQUAL 0x0205 +#define GL_GEQUAL 0x0206 +#define GL_ALWAYS 0x0207 +#define GL_SRC_COLOR 0x0300 +#define GL_ONE_MINUS_SRC_COLOR 0x0301 +#define GL_SRC_ALPHA 0x0302 +#define GL_ONE_MINUS_SRC_ALPHA 0x0303 +#define GL_DST_ALPHA 0x0304 +#define GL_ONE_MINUS_DST_ALPHA 0x0305 +#define GL_DST_COLOR 0x0306 +#define GL_ONE_MINUS_DST_COLOR 0x0307 +#define GL_SRC_ALPHA_SATURATE 0x0308 +#define GL_STENCIL_BUFFER_BIT 0x00000400 +#define GL_FRONT_LEFT 0x0400 +#define GL_FRONT_RIGHT 0x0401 +#define GL_BACK_LEFT 0x0402 +#define GL_BACK_RIGHT 0x0403 +#define GL_FRONT 0x0404 +#define GL_BACK 0x0405 +#define GL_LEFT 0x0406 +#define GL_RIGHT 0x0407 +#define GL_FRONT_AND_BACK 0x0408 +#define GL_AUX0 0x0409 +#define GL_AUX1 0x040A +#define GL_AUX2 0x040B +#define GL_AUX3 0x040C +#define GL_INVALID_ENUM 0x0500 +#define GL_INVALID_VALUE 0x0501 +#define GL_INVALID_OPERATION 0x0502 +#define GL_STACK_OVERFLOW 0x0503 +#define GL_STACK_UNDERFLOW 0x0504 +#define GL_OUT_OF_MEMORY 0x0505 +#define GL_2D 0x0600 +#define GL_3D 0x0601 +#define GL_3D_COLOR 0x0602 +#define GL_3D_COLOR_TEXTURE 0x0603 +#define GL_4D_COLOR_TEXTURE 0x0604 +#define GL_PASS_THROUGH_TOKEN 0x0700 +#define GL_POINT_TOKEN 0x0701 +#define GL_LINE_TOKEN 0x0702 +#define GL_POLYGON_TOKEN 0x0703 +#define GL_BITMAP_TOKEN 0x0704 +#define GL_DRAW_PIXEL_TOKEN 0x0705 +#define GL_COPY_PIXEL_TOKEN 0x0706 +#define GL_LINE_RESET_TOKEN 0x0707 +#define GL_EXP 0x0800 +#define GL_VIEWPORT_BIT 0x00000800 +#define GL_EXP2 0x0801 +#define GL_CW 0x0900 +#define GL_CCW 0x0901 +#define GL_COEFF 0x0A00 +#define GL_ORDER 0x0A01 +#define GL_DOMAIN 0x0A02 +#define GL_CURRENT_COLOR 0x0B00 +#define GL_CURRENT_INDEX 0x0B01 +#define GL_CURRENT_NORMAL 0x0B02 +#define GL_CURRENT_TEXTURE_COORDS 0x0B03 +#define GL_CURRENT_RASTER_COLOR 0x0B04 +#define GL_CURRENT_RASTER_INDEX 0x0B05 +#define GL_CURRENT_RASTER_TEXTURE_COORDS 0x0B06 +#define GL_CURRENT_RASTER_POSITION 0x0B07 +#define GL_CURRENT_RASTER_POSITION_VALID 0x0B08 +#define GL_CURRENT_RASTER_DISTANCE 0x0B09 +#define GL_POINT_SMOOTH 0x0B10 +#define GL_POINT_SIZE 0x0B11 +#define GL_POINT_SIZE_RANGE 0x0B12 +#define GL_POINT_SIZE_GRANULARITY 0x0B13 +#define GL_LINE_SMOOTH 0x0B20 +#define GL_LINE_WIDTH 0x0B21 +#define GL_LINE_WIDTH_RANGE 0x0B22 +#define GL_LINE_WIDTH_GRANULARITY 0x0B23 +#define GL_LINE_STIPPLE 0x0B24 +#define GL_LINE_STIPPLE_PATTERN 0x0B25 +#define GL_LINE_STIPPLE_REPEAT 0x0B26 +#define GL_LIST_MODE 0x0B30 +#define GL_MAX_LIST_NESTING 0x0B31 +#define GL_LIST_BASE 0x0B32 +#define GL_LIST_INDEX 0x0B33 +#define GL_POLYGON_MODE 0x0B40 +#define GL_POLYGON_SMOOTH 0x0B41 +#define GL_POLYGON_STIPPLE 0x0B42 +#define GL_EDGE_FLAG 0x0B43 +#define GL_CULL_FACE 0x0B44 +#define GL_CULL_FACE_MODE 0x0B45 +#define GL_FRONT_FACE 0x0B46 +#define GL_LIGHTING 0x0B50 +#define GL_LIGHT_MODEL_LOCAL_VIEWER 0x0B51 +#define GL_LIGHT_MODEL_TWO_SIDE 0x0B52 +#define GL_LIGHT_MODEL_AMBIENT 0x0B53 +#define GL_SHADE_MODEL 0x0B54 +#define GL_COLOR_MATERIAL_FACE 0x0B55 +#define GL_COLOR_MATERIAL_PARAMETER 0x0B56 +#define GL_COLOR_MATERIAL 0x0B57 +#define GL_FOG 0x0B60 +#define GL_FOG_INDEX 0x0B61 +#define GL_FOG_DENSITY 0x0B62 +#define GL_FOG_START 0x0B63 +#define GL_FOG_END 0x0B64 +#define GL_FOG_MODE 0x0B65 +#define GL_FOG_COLOR 0x0B66 +#define GL_DEPTH_RANGE 0x0B70 +#define GL_DEPTH_TEST 0x0B71 +#define GL_DEPTH_WRITEMASK 0x0B72 +#define GL_DEPTH_CLEAR_VALUE 0x0B73 +#define GL_DEPTH_FUNC 0x0B74 +#define GL_ACCUM_CLEAR_VALUE 0x0B80 +#define GL_STENCIL_TEST 0x0B90 +#define GL_STENCIL_CLEAR_VALUE 0x0B91 +#define GL_STENCIL_FUNC 0x0B92 +#define GL_STENCIL_VALUE_MASK 0x0B93 +#define GL_STENCIL_FAIL 0x0B94 +#define GL_STENCIL_PASS_DEPTH_FAIL 0x0B95 +#define GL_STENCIL_PASS_DEPTH_PASS 0x0B96 +#define GL_STENCIL_REF 0x0B97 +#define GL_STENCIL_WRITEMASK 0x0B98 +#define GL_MATRIX_MODE 0x0BA0 +#define GL_NORMALIZE 0x0BA1 +#define GL_VIEWPORT 0x0BA2 +#define GL_MODELVIEW_STACK_DEPTH 0x0BA3 +#define GL_PROJECTION_STACK_DEPTH 0x0BA4 +#define GL_TEXTURE_STACK_DEPTH 0x0BA5 +#define GL_MODELVIEW_MATRIX 0x0BA6 +#define GL_PROJECTION_MATRIX 0x0BA7 +#define GL_TEXTURE_MATRIX 0x0BA8 +#define GL_ATTRIB_STACK_DEPTH 0x0BB0 +#define GL_CLIENT_ATTRIB_STACK_DEPTH 0x0BB1 +#define GL_ALPHA_TEST 0x0BC0 +#define GL_ALPHA_TEST_FUNC 0x0BC1 +#define GL_ALPHA_TEST_REF 0x0BC2 +#define GL_DITHER 0x0BD0 +#define GL_BLEND_DST 0x0BE0 +#define GL_BLEND_SRC 0x0BE1 +#define GL_BLEND 0x0BE2 +#define GL_LOGIC_OP_MODE 0x0BF0 +#define GL_INDEX_LOGIC_OP 0x0BF1 +#define GL_COLOR_LOGIC_OP 0x0BF2 +#define GL_AUX_BUFFERS 0x0C00 +#define GL_DRAW_BUFFER 0x0C01 +#define GL_READ_BUFFER 0x0C02 +#define GL_SCISSOR_BOX 0x0C10 +#define GL_SCISSOR_TEST 0x0C11 +#define GL_INDEX_CLEAR_VALUE 0x0C20 +#define GL_INDEX_WRITEMASK 0x0C21 +#define GL_COLOR_CLEAR_VALUE 0x0C22 +#define GL_COLOR_WRITEMASK 0x0C23 +#define GL_INDEX_MODE 0x0C30 +#define GL_RGBA_MODE 0x0C31 +#define GL_DOUBLEBUFFER 0x0C32 +#define GL_STEREO 0x0C33 +#define GL_RENDER_MODE 0x0C40 +#define GL_PERSPECTIVE_CORRECTION_HINT 0x0C50 +#define GL_POINT_SMOOTH_HINT 0x0C51 +#define GL_LINE_SMOOTH_HINT 0x0C52 +#define GL_POLYGON_SMOOTH_HINT 0x0C53 +#define GL_FOG_HINT 0x0C54 +#define GL_TEXTURE_GEN_S 0x0C60 +#define GL_TEXTURE_GEN_T 0x0C61 +#define GL_TEXTURE_GEN_R 0x0C62 +#define GL_TEXTURE_GEN_Q 0x0C63 +#define GL_PIXEL_MAP_I_TO_I 0x0C70 +#define GL_PIXEL_MAP_S_TO_S 0x0C71 +#define GL_PIXEL_MAP_I_TO_R 0x0C72 +#define GL_PIXEL_MAP_I_TO_G 0x0C73 +#define GL_PIXEL_MAP_I_TO_B 0x0C74 +#define GL_PIXEL_MAP_I_TO_A 0x0C75 +#define GL_PIXEL_MAP_R_TO_R 0x0C76 +#define GL_PIXEL_MAP_G_TO_G 0x0C77 +#define GL_PIXEL_MAP_B_TO_B 0x0C78 +#define GL_PIXEL_MAP_A_TO_A 0x0C79 +#define GL_PIXEL_MAP_I_TO_I_SIZE 0x0CB0 +#define GL_PIXEL_MAP_S_TO_S_SIZE 0x0CB1 +#define GL_PIXEL_MAP_I_TO_R_SIZE 0x0CB2 +#define GL_PIXEL_MAP_I_TO_G_SIZE 0x0CB3 +#define GL_PIXEL_MAP_I_TO_B_SIZE 0x0CB4 +#define GL_PIXEL_MAP_I_TO_A_SIZE 0x0CB5 +#define GL_PIXEL_MAP_R_TO_R_SIZE 0x0CB6 +#define GL_PIXEL_MAP_G_TO_G_SIZE 0x0CB7 +#define GL_PIXEL_MAP_B_TO_B_SIZE 0x0CB8 +#define GL_PIXEL_MAP_A_TO_A_SIZE 0x0CB9 +#define GL_UNPACK_SWAP_BYTES 0x0CF0 +#define GL_UNPACK_LSB_FIRST 0x0CF1 +#define GL_UNPACK_ROW_LENGTH 0x0CF2 +#define GL_UNPACK_SKIP_ROWS 0x0CF3 +#define GL_UNPACK_SKIP_PIXELS 0x0CF4 +#define GL_UNPACK_ALIGNMENT 0x0CF5 +#define GL_PACK_SWAP_BYTES 0x0D00 +#define GL_PACK_LSB_FIRST 0x0D01 +#define GL_PACK_ROW_LENGTH 0x0D02 +#define GL_PACK_SKIP_ROWS 0x0D03 +#define GL_PACK_SKIP_PIXELS 0x0D04 +#define GL_PACK_ALIGNMENT 0x0D05 +#define GL_MAP_COLOR 0x0D10 +#define GL_MAP_STENCIL 0x0D11 +#define GL_INDEX_SHIFT 0x0D12 +#define GL_INDEX_OFFSET 0x0D13 +#define GL_RED_SCALE 0x0D14 +#define GL_RED_BIAS 0x0D15 +#define GL_ZOOM_X 0x0D16 +#define GL_ZOOM_Y 0x0D17 +#define GL_GREEN_SCALE 0x0D18 +#define GL_GREEN_BIAS 0x0D19 +#define GL_BLUE_SCALE 0x0D1A +#define GL_BLUE_BIAS 0x0D1B +#define GL_ALPHA_SCALE 0x0D1C +#define GL_ALPHA_BIAS 0x0D1D +#define GL_DEPTH_SCALE 0x0D1E +#define GL_DEPTH_BIAS 0x0D1F +#define GL_MAX_EVAL_ORDER 0x0D30 +#define GL_MAX_LIGHTS 0x0D31 +#define GL_MAX_CLIP_PLANES 0x0D32 +#define GL_MAX_TEXTURE_SIZE 0x0D33 +#define GL_MAX_PIXEL_MAP_TABLE 0x0D34 +#define GL_MAX_ATTRIB_STACK_DEPTH 0x0D35 +#define GL_MAX_MODELVIEW_STACK_DEPTH 0x0D36 +#define GL_MAX_NAME_STACK_DEPTH 0x0D37 +#define GL_MAX_PROJECTION_STACK_DEPTH 0x0D38 +#define GL_MAX_TEXTURE_STACK_DEPTH 0x0D39 +#define GL_MAX_VIEWPORT_DIMS 0x0D3A +#define GL_MAX_CLIENT_ATTRIB_STACK_DEPTH 0x0D3B +#define GL_SUBPIXEL_BITS 0x0D50 +#define GL_INDEX_BITS 0x0D51 +#define GL_RED_BITS 0x0D52 +#define GL_GREEN_BITS 0x0D53 +#define GL_BLUE_BITS 0x0D54 +#define GL_ALPHA_BITS 0x0D55 +#define GL_DEPTH_BITS 0x0D56 +#define GL_STENCIL_BITS 0x0D57 +#define GL_ACCUM_RED_BITS 0x0D58 +#define GL_ACCUM_GREEN_BITS 0x0D59 +#define GL_ACCUM_BLUE_BITS 0x0D5A +#define GL_ACCUM_ALPHA_BITS 0x0D5B +#define GL_NAME_STACK_DEPTH 0x0D70 +#define GL_AUTO_NORMAL 0x0D80 +#define GL_MAP1_COLOR_4 0x0D90 +#define GL_MAP1_INDEX 0x0D91 +#define GL_MAP1_NORMAL 0x0D92 +#define GL_MAP1_TEXTURE_COORD_1 0x0D93 +#define GL_MAP1_TEXTURE_COORD_2 0x0D94 +#define GL_MAP1_TEXTURE_COORD_3 0x0D95 +#define GL_MAP1_TEXTURE_COORD_4 0x0D96 +#define GL_MAP1_VERTEX_3 0x0D97 +#define GL_MAP1_VERTEX_4 0x0D98 +#define GL_MAP2_COLOR_4 0x0DB0 +#define GL_MAP2_INDEX 0x0DB1 +#define GL_MAP2_NORMAL 0x0DB2 +#define GL_MAP2_TEXTURE_COORD_1 0x0DB3 +#define GL_MAP2_TEXTURE_COORD_2 0x0DB4 +#define GL_MAP2_TEXTURE_COORD_3 0x0DB5 +#define GL_MAP2_TEXTURE_COORD_4 0x0DB6 +#define GL_MAP2_VERTEX_3 0x0DB7 +#define GL_MAP2_VERTEX_4 0x0DB8 +#define GL_MAP1_GRID_DOMAIN 0x0DD0 +#define GL_MAP1_GRID_SEGMENTS 0x0DD1 +#define GL_MAP2_GRID_DOMAIN 0x0DD2 +#define GL_MAP2_GRID_SEGMENTS 0x0DD3 +#define GL_TEXTURE_1D 0x0DE0 +#define GL_TEXTURE_2D 0x0DE1 +#define GL_FEEDBACK_BUFFER_POINTER 0x0DF0 +#define GL_FEEDBACK_BUFFER_SIZE 0x0DF1 +#define GL_FEEDBACK_BUFFER_TYPE 0x0DF2 +#define GL_SELECTION_BUFFER_POINTER 0x0DF3 +#define GL_SELECTION_BUFFER_SIZE 0x0DF4 +#define GL_TEXTURE_WIDTH 0x1000 +#define GL_TRANSFORM_BIT 0x00001000 +#define GL_TEXTURE_HEIGHT 0x1001 +#define GL_TEXTURE_INTERNAL_FORMAT 0x1003 +#define GL_TEXTURE_BORDER_COLOR 0x1004 +#define GL_TEXTURE_BORDER 0x1005 +#define GL_DONT_CARE 0x1100 +#define GL_FASTEST 0x1101 +#define GL_NICEST 0x1102 +#define GL_AMBIENT 0x1200 +#define GL_DIFFUSE 0x1201 +#define GL_SPECULAR 0x1202 +#define GL_POSITION 0x1203 +#define GL_SPOT_DIRECTION 0x1204 +#define GL_SPOT_EXPONENT 0x1205 +#define GL_SPOT_CUTOFF 0x1206 +#define GL_CONSTANT_ATTENUATION 0x1207 +#define GL_LINEAR_ATTENUATION 0x1208 +#define GL_QUADRATIC_ATTENUATION 0x1209 +#define GL_COMPILE 0x1300 +#define GL_COMPILE_AND_EXECUTE 0x1301 +#define GL_BYTE 0x1400 +#define GL_UNSIGNED_BYTE 0x1401 +#define GL_SHORT 0x1402 +#define GL_UNSIGNED_SHORT 0x1403 +#define GL_INT 0x1404 +#define GL_UNSIGNED_INT 0x1405 +#define GL_FLOAT 0x1406 +#define GL_2_BYTES 0x1407 +#define GL_3_BYTES 0x1408 +#define GL_4_BYTES 0x1409 +#define GL_DOUBLE 0x140A +#define GL_CLEAR 0x1500 +#define GL_AND 0x1501 +#define GL_AND_REVERSE 0x1502 +#define GL_COPY 0x1503 +#define GL_AND_INVERTED 0x1504 +#define GL_NOOP 0x1505 +#define GL_XOR 0x1506 +#define GL_OR 0x1507 +#define GL_NOR 0x1508 +#define GL_EQUIV 0x1509 +#define GL_INVERT 0x150A +#define GL_OR_REVERSE 0x150B +#define GL_COPY_INVERTED 0x150C +#define GL_OR_INVERTED 0x150D +#define GL_NAND 0x150E +#define GL_SET 0x150F +#define GL_EMISSION 0x1600 +#define GL_SHININESS 0x1601 +#define GL_AMBIENT_AND_DIFFUSE 0x1602 +#define GL_COLOR_INDEXES 0x1603 +#define GL_MODELVIEW 0x1700 +#define GL_PROJECTION 0x1701 +#define GL_TEXTURE 0x1702 +#define GL_COLOR 0x1800 +#define GL_DEPTH 0x1801 +#define GL_STENCIL 0x1802 +#define GL_COLOR_INDEX 0x1900 +#define GL_STENCIL_INDEX 0x1901 +#define GL_DEPTH_COMPONENT 0x1902 +#define GL_RED 0x1903 +#define GL_GREEN 0x1904 +#define GL_BLUE 0x1905 +#define GL_ALPHA 0x1906 +#define GL_RGB 0x1907 +#define GL_RGBA 0x1908 +#define GL_LUMINANCE 0x1909 +#define GL_LUMINANCE_ALPHA 0x190A +#define GL_BITMAP 0x1A00 +#define GL_POINT 0x1B00 +#define GL_LINE 0x1B01 +#define GL_FILL 0x1B02 +#define GL_RENDER 0x1C00 +#define GL_FEEDBACK 0x1C01 +#define GL_SELECT 0x1C02 +#define GL_FLAT 0x1D00 +#define GL_SMOOTH 0x1D01 +#define GL_KEEP 0x1E00 +#define GL_REPLACE 0x1E01 +#define GL_INCR 0x1E02 +#define GL_DECR 0x1E03 +#define GL_VENDOR 0x1F00 +#define GL_RENDERER 0x1F01 +#define GL_VERSION 0x1F02 +#define GL_EXTENSIONS 0x1F03 +#define GL_S 0x2000 +#define GL_ENABLE_BIT 0x00002000 +#define GL_T 0x2001 +#define GL_R 0x2002 +#define GL_Q 0x2003 +#define GL_MODULATE 0x2100 +#define GL_DECAL 0x2101 +#define GL_TEXTURE_ENV_MODE 0x2200 +#define GL_TEXTURE_ENV_COLOR 0x2201 +#define GL_TEXTURE_ENV 0x2300 +#define GL_EYE_LINEAR 0x2400 +#define GL_OBJECT_LINEAR 0x2401 +#define GL_SPHERE_MAP 0x2402 +#define GL_TEXTURE_GEN_MODE 0x2500 +#define GL_OBJECT_PLANE 0x2501 +#define GL_EYE_PLANE 0x2502 +#define GL_NEAREST 0x2600 +#define GL_LINEAR 0x2601 +#define GL_NEAREST_MIPMAP_NEAREST 0x2700 +#define GL_LINEAR_MIPMAP_NEAREST 0x2701 +#define GL_NEAREST_MIPMAP_LINEAR 0x2702 +#define GL_LINEAR_MIPMAP_LINEAR 0x2703 +#define GL_TEXTURE_MAG_FILTER 0x2800 +#define GL_TEXTURE_MIN_FILTER 0x2801 +#define GL_TEXTURE_WRAP_S 0x2802 +#define GL_TEXTURE_WRAP_T 0x2803 +#define GL_CLAMP 0x2900 +#define GL_REPEAT 0x2901 +#define GL_POLYGON_OFFSET_UNITS 0x2A00 +#define GL_POLYGON_OFFSET_POINT 0x2A01 +#define GL_POLYGON_OFFSET_LINE 0x2A02 +#define GL_R3_G3_B2 0x2A10 +#define GL_V2F 0x2A20 +#define GL_V3F 0x2A21 +#define GL_C4UB_V2F 0x2A22 +#define GL_C4UB_V3F 0x2A23 +#define GL_C3F_V3F 0x2A24 +#define GL_N3F_V3F 0x2A25 +#define GL_C4F_N3F_V3F 0x2A26 +#define GL_T2F_V3F 0x2A27 +#define GL_T4F_V4F 0x2A28 +#define GL_T2F_C4UB_V3F 0x2A29 +#define GL_T2F_C3F_V3F 0x2A2A +#define GL_T2F_N3F_V3F 0x2A2B +#define GL_T2F_C4F_N3F_V3F 0x2A2C +#define GL_T4F_C4F_N3F_V4F 0x2A2D +#define GL_CLIP_PLANE0 0x3000 +#define GL_CLIP_PLANE1 0x3001 +#define GL_CLIP_PLANE2 0x3002 +#define GL_CLIP_PLANE3 0x3003 +#define GL_CLIP_PLANE4 0x3004 +#define GL_CLIP_PLANE5 0x3005 +#define GL_LIGHT0 0x4000 +#define GL_COLOR_BUFFER_BIT 0x00004000 +#define GL_LIGHT1 0x4001 +#define GL_LIGHT2 0x4002 +#define GL_LIGHT3 0x4003 +#define GL_LIGHT4 0x4004 +#define GL_LIGHT5 0x4005 +#define GL_LIGHT6 0x4006 +#define GL_LIGHT7 0x4007 +#define GL_HINT_BIT 0x00008000 +#define GL_POLYGON_OFFSET_FILL 0x8037 +#define GL_POLYGON_OFFSET_FACTOR 0x8038 +#define GL_ALPHA4 0x803B +#define GL_ALPHA8 0x803C +#define GL_ALPHA12 0x803D +#define GL_ALPHA16 0x803E +#define GL_LUMINANCE4 0x803F +#define GL_LUMINANCE8 0x8040 +#define GL_LUMINANCE12 0x8041 +#define GL_LUMINANCE16 0x8042 +#define GL_LUMINANCE4_ALPHA4 0x8043 +#define GL_LUMINANCE6_ALPHA2 0x8044 +#define GL_LUMINANCE8_ALPHA8 0x8045 +#define GL_LUMINANCE12_ALPHA4 0x8046 +#define GL_LUMINANCE12_ALPHA12 0x8047 +#define GL_LUMINANCE16_ALPHA16 0x8048 +#define GL_INTENSITY 0x8049 +#define GL_INTENSITY4 0x804A +#define GL_INTENSITY8 0x804B +#define GL_INTENSITY12 0x804C +#define GL_INTENSITY16 0x804D +#define GL_RGB4 0x804F +#define GL_RGB5 0x8050 +#define GL_RGB8 0x8051 +#define GL_RGB10 0x8052 +#define GL_RGB12 0x8053 +#define GL_RGB16 0x8054 +#define GL_RGBA2 0x8055 +#define GL_RGBA4 0x8056 +#define GL_RGB5_A1 0x8057 +#define GL_RGBA8 0x8058 +#define GL_RGB10_A2 0x8059 +#define GL_RGBA12 0x805A +#define GL_RGBA16 0x805B +#define GL_TEXTURE_RED_SIZE 0x805C +#define GL_TEXTURE_GREEN_SIZE 0x805D +#define GL_TEXTURE_BLUE_SIZE 0x805E +#define GL_TEXTURE_ALPHA_SIZE 0x805F +#define GL_TEXTURE_LUMINANCE_SIZE 0x8060 +#define GL_TEXTURE_INTENSITY_SIZE 0x8061 +#define GL_PROXY_TEXTURE_1D 0x8063 +#define GL_PROXY_TEXTURE_2D 0x8064 +#define GL_TEXTURE_PRIORITY 0x8066 +#define GL_TEXTURE_RESIDENT 0x8067 +#define GL_TEXTURE_BINDING_1D 0x8068 +#define GL_TEXTURE_BINDING_2D 0x8069 +#define GL_VERTEX_ARRAY 0x8074 +#define GL_NORMAL_ARRAY 0x8075 +#define GL_COLOR_ARRAY 0x8076 +#define GL_INDEX_ARRAY 0x8077 +#define GL_TEXTURE_COORD_ARRAY 0x8078 +#define GL_EDGE_FLAG_ARRAY 0x8079 +#define GL_VERTEX_ARRAY_SIZE 0x807A +#define GL_VERTEX_ARRAY_TYPE 0x807B +#define GL_VERTEX_ARRAY_STRIDE 0x807C +#define GL_NORMAL_ARRAY_TYPE 0x807E +#define GL_NORMAL_ARRAY_STRIDE 0x807F +#define GL_COLOR_ARRAY_SIZE 0x8081 +#define GL_COLOR_ARRAY_TYPE 0x8082 +#define GL_COLOR_ARRAY_STRIDE 0x8083 +#define GL_INDEX_ARRAY_TYPE 0x8085 +#define GL_INDEX_ARRAY_STRIDE 0x8086 +#define GL_TEXTURE_COORD_ARRAY_SIZE 0x8088 +#define GL_TEXTURE_COORD_ARRAY_TYPE 0x8089 +#define GL_TEXTURE_COORD_ARRAY_STRIDE 0x808A +#define GL_EDGE_FLAG_ARRAY_STRIDE 0x808C +#define GL_VERTEX_ARRAY_POINTER 0x808E +#define GL_NORMAL_ARRAY_POINTER 0x808F +#define GL_COLOR_ARRAY_POINTER 0x8090 +#define GL_INDEX_ARRAY_POINTER 0x8091 +#define GL_TEXTURE_COORD_ARRAY_POINTER 0x8092 +#define GL_EDGE_FLAG_ARRAY_POINTER 0x8093 +#define GL_COLOR_INDEX1_EXT 0x80E2 +#define GL_COLOR_INDEX2_EXT 0x80E3 +#define GL_COLOR_INDEX4_EXT 0x80E4 +#define GL_COLOR_INDEX8_EXT 0x80E5 +#define GL_COLOR_INDEX12_EXT 0x80E6 +#define GL_COLOR_INDEX16_EXT 0x80E7 +#define GL_EVAL_BIT 0x00010000 +#define GL_LIST_BIT 0x00020000 +#define GL_TEXTURE_BIT 0x00040000 +#define GL_SCISSOR_BIT 0x00080000 +#define GL_ALL_ATTRIB_BITS 0x000fffff +#define GL_CLIENT_ALL_ATTRIB_BITS 0xffffffff + +GLAPI void GLAPIENTRY glAccum (GLenum op, GLfloat value); +GLAPI void GLAPIENTRY glAlphaFunc (GLenum func, GLclampf ref); +GLAPI GLboolean GLAPIENTRY glAreTexturesResident (GLsizei n, const GLuint *textures, GLboolean *residences); +GLAPI void GLAPIENTRY glArrayElement (GLint i); +GLAPI void GLAPIENTRY glBegin (GLenum mode); +GLAPI void GLAPIENTRY glBindTexture (GLenum target, GLuint texture); +GLAPI void GLAPIENTRY glBitmap (GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, const GLubyte *bitmap); +GLAPI void GLAPIENTRY glBlendFunc (GLenum sfactor, GLenum dfactor); +GLAPI void GLAPIENTRY glCallList (GLuint list); +GLAPI void GLAPIENTRY glCallLists (GLsizei n, GLenum type, const GLvoid *lists); +GLAPI void GLAPIENTRY glClear (GLbitfield mask); +GLAPI void GLAPIENTRY glClearAccum (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); +GLAPI void GLAPIENTRY glClearColor (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); +GLAPI void GLAPIENTRY glClearDepth (GLclampd depth); +GLAPI void GLAPIENTRY glClearIndex (GLfloat c); +GLAPI void GLAPIENTRY glClearStencil (GLint s); +GLAPI void GLAPIENTRY glClipPlane (GLenum plane, const GLdouble *equation); +GLAPI void GLAPIENTRY glColor3b (GLbyte red, GLbyte green, GLbyte blue); +GLAPI void GLAPIENTRY glColor3bv (const GLbyte *v); +GLAPI void GLAPIENTRY glColor3d (GLdouble red, GLdouble green, GLdouble blue); +GLAPI void GLAPIENTRY glColor3dv (const GLdouble *v); +GLAPI void GLAPIENTRY glColor3f (GLfloat red, GLfloat green, GLfloat blue); +GLAPI void GLAPIENTRY glColor3fv (const GLfloat *v); +GLAPI void GLAPIENTRY glColor3i (GLint red, GLint green, GLint blue); +GLAPI void GLAPIENTRY glColor3iv (const GLint *v); +GLAPI void GLAPIENTRY glColor3s (GLshort red, GLshort green, GLshort blue); +GLAPI void GLAPIENTRY glColor3sv (const GLshort *v); +GLAPI void GLAPIENTRY glColor3ub (GLubyte red, GLubyte green, GLubyte blue); +GLAPI void GLAPIENTRY glColor3ubv (const GLubyte *v); +GLAPI void GLAPIENTRY glColor3ui (GLuint red, GLuint green, GLuint blue); +GLAPI void GLAPIENTRY glColor3uiv (const GLuint *v); +GLAPI void GLAPIENTRY glColor3us (GLushort red, GLushort green, GLushort blue); +GLAPI void GLAPIENTRY glColor3usv (const GLushort *v); +GLAPI void GLAPIENTRY glColor4b (GLbyte red, GLbyte green, GLbyte blue, GLbyte alpha); +GLAPI void GLAPIENTRY glColor4bv (const GLbyte *v); +GLAPI void GLAPIENTRY glColor4d (GLdouble red, GLdouble green, GLdouble blue, GLdouble alpha); +GLAPI void GLAPIENTRY glColor4dv (const GLdouble *v); +GLAPI void GLAPIENTRY glColor4f (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); +GLAPI void GLAPIENTRY glColor4fv (const GLfloat *v); +GLAPI void GLAPIENTRY glColor4i (GLint red, GLint green, GLint blue, GLint alpha); +GLAPI void GLAPIENTRY glColor4iv (const GLint *v); +GLAPI void GLAPIENTRY glColor4s (GLshort red, GLshort green, GLshort blue, GLshort alpha); +GLAPI void GLAPIENTRY glColor4sv (const GLshort *v); +GLAPI void GLAPIENTRY glColor4ub (GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha); +GLAPI void GLAPIENTRY glColor4ubv (const GLubyte *v); +GLAPI void GLAPIENTRY glColor4ui (GLuint red, GLuint green, GLuint blue, GLuint alpha); +GLAPI void GLAPIENTRY glColor4uiv (const GLuint *v); +GLAPI void GLAPIENTRY glColor4us (GLushort red, GLushort green, GLushort blue, GLushort alpha); +GLAPI void GLAPIENTRY glColor4usv (const GLushort *v); +GLAPI void GLAPIENTRY glColorMask (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); +GLAPI void GLAPIENTRY glColorMaterial (GLenum face, GLenum mode); +GLAPI void GLAPIENTRY glColorPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +GLAPI void GLAPIENTRY glCopyPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum type); +GLAPI void GLAPIENTRY glCopyTexImage1D (GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLint border); +GLAPI void GLAPIENTRY glCopyTexImage2D (GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); +GLAPI void GLAPIENTRY glCopyTexSubImage1D (GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); +GLAPI void GLAPIENTRY glCopyTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); +GLAPI void GLAPIENTRY glCullFace (GLenum mode); +GLAPI void GLAPIENTRY glDeleteLists (GLuint list, GLsizei range); +GLAPI void GLAPIENTRY glDeleteTextures (GLsizei n, const GLuint *textures); +GLAPI void GLAPIENTRY glDepthFunc (GLenum func); +GLAPI void GLAPIENTRY glDepthMask (GLboolean flag); +GLAPI void GLAPIENTRY glDepthRange (GLclampd zNear, GLclampd zFar); +GLAPI void GLAPIENTRY glDisable (GLenum cap); +GLAPI void GLAPIENTRY glDisableClientState (GLenum array); +GLAPI void GLAPIENTRY glDrawArrays (GLenum mode, GLint first, GLsizei count); +GLAPI void GLAPIENTRY glDrawBuffer (GLenum mode); +GLAPI void GLAPIENTRY glDrawElements (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices); +GLAPI void GLAPIENTRY glDrawPixels (GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels); +GLAPI void GLAPIENTRY glEdgeFlag (GLboolean flag); +GLAPI void GLAPIENTRY glEdgeFlagPointer (GLsizei stride, const GLvoid *pointer); +GLAPI void GLAPIENTRY glEdgeFlagv (const GLboolean *flag); +GLAPI void GLAPIENTRY glEnable (GLenum cap); +GLAPI void GLAPIENTRY glEnableClientState (GLenum array); +GLAPI void GLAPIENTRY glEnd (void); +GLAPI void GLAPIENTRY glEndList (void); +GLAPI void GLAPIENTRY glEvalCoord1d (GLdouble u); +GLAPI void GLAPIENTRY glEvalCoord1dv (const GLdouble *u); +GLAPI void GLAPIENTRY glEvalCoord1f (GLfloat u); +GLAPI void GLAPIENTRY glEvalCoord1fv (const GLfloat *u); +GLAPI void GLAPIENTRY glEvalCoord2d (GLdouble u, GLdouble v); +GLAPI void GLAPIENTRY glEvalCoord2dv (const GLdouble *u); +GLAPI void GLAPIENTRY glEvalCoord2f (GLfloat u, GLfloat v); +GLAPI void GLAPIENTRY glEvalCoord2fv (const GLfloat *u); +GLAPI void GLAPIENTRY glEvalMesh1 (GLenum mode, GLint i1, GLint i2); +GLAPI void GLAPIENTRY glEvalMesh2 (GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2); +GLAPI void GLAPIENTRY glEvalPoint1 (GLint i); +GLAPI void GLAPIENTRY glEvalPoint2 (GLint i, GLint j); +GLAPI void GLAPIENTRY glFeedbackBuffer (GLsizei size, GLenum type, GLfloat *buffer); +GLAPI void GLAPIENTRY glFinish (void); +GLAPI void GLAPIENTRY glFlush (void); +GLAPI void GLAPIENTRY glFogf (GLenum pname, GLfloat param); +GLAPI void GLAPIENTRY glFogfv (GLenum pname, const GLfloat *params); +GLAPI void GLAPIENTRY glFogi (GLenum pname, GLint param); +GLAPI void GLAPIENTRY glFogiv (GLenum pname, const GLint *params); +GLAPI void GLAPIENTRY glFrontFace (GLenum mode); +GLAPI void GLAPIENTRY glFrustum (GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); +GLAPI GLuint GLAPIENTRY glGenLists (GLsizei range); +GLAPI void GLAPIENTRY glGenTextures (GLsizei n, GLuint *textures); +GLAPI void GLAPIENTRY glGetBooleanv (GLenum pname, GLboolean *params); +GLAPI void GLAPIENTRY glGetClipPlane (GLenum plane, GLdouble *equation); +GLAPI void GLAPIENTRY glGetDoublev (GLenum pname, GLdouble *params); +GLAPI GLenum GLAPIENTRY glGetError (void); +GLAPI void GLAPIENTRY glGetFloatv (GLenum pname, GLfloat *params); +GLAPI void GLAPIENTRY glGetIntegerv (GLenum pname, GLint *params); +GLAPI void GLAPIENTRY glGetLightfv (GLenum light, GLenum pname, GLfloat *params); +GLAPI void GLAPIENTRY glGetLightiv (GLenum light, GLenum pname, GLint *params); +GLAPI void GLAPIENTRY glGetMapdv (GLenum target, GLenum query, GLdouble *v); +GLAPI void GLAPIENTRY glGetMapfv (GLenum target, GLenum query, GLfloat *v); +GLAPI void GLAPIENTRY glGetMapiv (GLenum target, GLenum query, GLint *v); +GLAPI void GLAPIENTRY glGetMaterialfv (GLenum face, GLenum pname, GLfloat *params); +GLAPI void GLAPIENTRY glGetMaterialiv (GLenum face, GLenum pname, GLint *params); +GLAPI void GLAPIENTRY glGetPixelMapfv (GLenum map, GLfloat *values); +GLAPI void GLAPIENTRY glGetPixelMapuiv (GLenum map, GLuint *values); +GLAPI void GLAPIENTRY glGetPixelMapusv (GLenum map, GLushort *values); +GLAPI void GLAPIENTRY glGetPointerv (GLenum pname, GLvoid* *params); +GLAPI void GLAPIENTRY glGetPolygonStipple (GLubyte *mask); +GLAPI const GLubyte * GLAPIENTRY glGetString (GLenum name); +GLAPI void GLAPIENTRY glGetTexEnvfv (GLenum target, GLenum pname, GLfloat *params); +GLAPI void GLAPIENTRY glGetTexEnviv (GLenum target, GLenum pname, GLint *params); +GLAPI void GLAPIENTRY glGetTexGendv (GLenum coord, GLenum pname, GLdouble *params); +GLAPI void GLAPIENTRY glGetTexGenfv (GLenum coord, GLenum pname, GLfloat *params); +GLAPI void GLAPIENTRY glGetTexGeniv (GLenum coord, GLenum pname, GLint *params); +GLAPI void GLAPIENTRY glGetTexImage (GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels); +GLAPI void GLAPIENTRY glGetTexLevelParameterfv (GLenum target, GLint level, GLenum pname, GLfloat *params); +GLAPI void GLAPIENTRY glGetTexLevelParameteriv (GLenum target, GLint level, GLenum pname, GLint *params); +GLAPI void GLAPIENTRY glGetTexParameterfv (GLenum target, GLenum pname, GLfloat *params); +GLAPI void GLAPIENTRY glGetTexParameteriv (GLenum target, GLenum pname, GLint *params); +GLAPI void GLAPIENTRY glHint (GLenum target, GLenum mode); +GLAPI void GLAPIENTRY glIndexMask (GLuint mask); +GLAPI void GLAPIENTRY glIndexPointer (GLenum type, GLsizei stride, const GLvoid *pointer); +GLAPI void GLAPIENTRY glIndexd (GLdouble c); +GLAPI void GLAPIENTRY glIndexdv (const GLdouble *c); +GLAPI void GLAPIENTRY glIndexf (GLfloat c); +GLAPI void GLAPIENTRY glIndexfv (const GLfloat *c); +GLAPI void GLAPIENTRY glIndexi (GLint c); +GLAPI void GLAPIENTRY glIndexiv (const GLint *c); +GLAPI void GLAPIENTRY glIndexs (GLshort c); +GLAPI void GLAPIENTRY glIndexsv (const GLshort *c); +GLAPI void GLAPIENTRY glIndexub (GLubyte c); +GLAPI void GLAPIENTRY glIndexubv (const GLubyte *c); +GLAPI void GLAPIENTRY glInitNames (void); +GLAPI void GLAPIENTRY glInterleavedArrays (GLenum format, GLsizei stride, const GLvoid *pointer); +GLAPI GLboolean GLAPIENTRY glIsEnabled (GLenum cap); +GLAPI GLboolean GLAPIENTRY glIsList (GLuint list); +GLAPI GLboolean GLAPIENTRY glIsTexture (GLuint texture); +GLAPI void GLAPIENTRY glLightModelf (GLenum pname, GLfloat param); +GLAPI void GLAPIENTRY glLightModelfv (GLenum pname, const GLfloat *params); +GLAPI void GLAPIENTRY glLightModeli (GLenum pname, GLint param); +GLAPI void GLAPIENTRY glLightModeliv (GLenum pname, const GLint *params); +GLAPI void GLAPIENTRY glLightf (GLenum light, GLenum pname, GLfloat param); +GLAPI void GLAPIENTRY glLightfv (GLenum light, GLenum pname, const GLfloat *params); +GLAPI void GLAPIENTRY glLighti (GLenum light, GLenum pname, GLint param); +GLAPI void GLAPIENTRY glLightiv (GLenum light, GLenum pname, const GLint *params); +GLAPI void GLAPIENTRY glLineStipple (GLint factor, GLushort pattern); +GLAPI void GLAPIENTRY glLineWidth (GLfloat width); +GLAPI void GLAPIENTRY glListBase (GLuint base); +GLAPI void GLAPIENTRY glLoadIdentity (void); +GLAPI void GLAPIENTRY glLoadMatrixd (const GLdouble *m); +GLAPI void GLAPIENTRY glLoadMatrixf (const GLfloat *m); +GLAPI void GLAPIENTRY glLoadName (GLuint name); +GLAPI void GLAPIENTRY glLogicOp (GLenum opcode); +GLAPI void GLAPIENTRY glMap1d (GLenum target, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble *points); +GLAPI void GLAPIENTRY glMap1f (GLenum target, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat *points); +GLAPI void GLAPIENTRY glMap2d (GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble *points); +GLAPI void GLAPIENTRY glMap2f (GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat *points); +GLAPI void GLAPIENTRY glMapGrid1d (GLint un, GLdouble u1, GLdouble u2); +GLAPI void GLAPIENTRY glMapGrid1f (GLint un, GLfloat u1, GLfloat u2); +GLAPI void GLAPIENTRY glMapGrid2d (GLint un, GLdouble u1, GLdouble u2, GLint vn, GLdouble v1, GLdouble v2); +GLAPI void GLAPIENTRY glMapGrid2f (GLint un, GLfloat u1, GLfloat u2, GLint vn, GLfloat v1, GLfloat v2); +GLAPI void GLAPIENTRY glMaterialf (GLenum face, GLenum pname, GLfloat param); +GLAPI void GLAPIENTRY glMaterialfv (GLenum face, GLenum pname, const GLfloat *params); +GLAPI void GLAPIENTRY glMateriali (GLenum face, GLenum pname, GLint param); +GLAPI void GLAPIENTRY glMaterialiv (GLenum face, GLenum pname, const GLint *params); +GLAPI void GLAPIENTRY glMatrixMode (GLenum mode); +GLAPI void GLAPIENTRY glMultMatrixd (const GLdouble *m); +GLAPI void GLAPIENTRY glMultMatrixf (const GLfloat *m); +GLAPI void GLAPIENTRY glNewList (GLuint list, GLenum mode); +GLAPI void GLAPIENTRY glNormal3b (GLbyte nx, GLbyte ny, GLbyte nz); +GLAPI void GLAPIENTRY glNormal3bv (const GLbyte *v); +GLAPI void GLAPIENTRY glNormal3d (GLdouble nx, GLdouble ny, GLdouble nz); +GLAPI void GLAPIENTRY glNormal3dv (const GLdouble *v); +GLAPI void GLAPIENTRY glNormal3f (GLfloat nx, GLfloat ny, GLfloat nz); +GLAPI void GLAPIENTRY glNormal3fv (const GLfloat *v); +GLAPI void GLAPIENTRY glNormal3i (GLint nx, GLint ny, GLint nz); +GLAPI void GLAPIENTRY glNormal3iv (const GLint *v); +GLAPI void GLAPIENTRY glNormal3s (GLshort nx, GLshort ny, GLshort nz); +GLAPI void GLAPIENTRY glNormal3sv (const GLshort *v); +GLAPI void GLAPIENTRY glNormalPointer (GLenum type, GLsizei stride, const GLvoid *pointer); +GLAPI void GLAPIENTRY glOrtho (GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); +GLAPI void GLAPIENTRY glPassThrough (GLfloat token); +GLAPI void GLAPIENTRY glPixelMapfv (GLenum map, GLsizei mapsize, const GLfloat *values); +GLAPI void GLAPIENTRY glPixelMapuiv (GLenum map, GLsizei mapsize, const GLuint *values); +GLAPI void GLAPIENTRY glPixelMapusv (GLenum map, GLsizei mapsize, const GLushort *values); +GLAPI void GLAPIENTRY glPixelStoref (GLenum pname, GLfloat param); +GLAPI void GLAPIENTRY glPixelStorei (GLenum pname, GLint param); +GLAPI void GLAPIENTRY glPixelTransferf (GLenum pname, GLfloat param); +GLAPI void GLAPIENTRY glPixelTransferi (GLenum pname, GLint param); +GLAPI void GLAPIENTRY glPixelZoom (GLfloat xfactor, GLfloat yfactor); +GLAPI void GLAPIENTRY glPointSize (GLfloat size); +GLAPI void GLAPIENTRY glPolygonMode (GLenum face, GLenum mode); +GLAPI void GLAPIENTRY glPolygonOffset (GLfloat factor, GLfloat units); +GLAPI void GLAPIENTRY glPolygonStipple (const GLubyte *mask); +GLAPI void GLAPIENTRY glPopAttrib (void); +GLAPI void GLAPIENTRY glPopClientAttrib (void); +GLAPI void GLAPIENTRY glPopMatrix (void); +GLAPI void GLAPIENTRY glPopName (void); +GLAPI void GLAPIENTRY glPrioritizeTextures (GLsizei n, const GLuint *textures, const GLclampf *priorities); +GLAPI void GLAPIENTRY glPushAttrib (GLbitfield mask); +GLAPI void GLAPIENTRY glPushClientAttrib (GLbitfield mask); +GLAPI void GLAPIENTRY glPushMatrix (void); +GLAPI void GLAPIENTRY glPushName (GLuint name); +GLAPI void GLAPIENTRY glRasterPos2d (GLdouble x, GLdouble y); +GLAPI void GLAPIENTRY glRasterPos2dv (const GLdouble *v); +GLAPI void GLAPIENTRY glRasterPos2f (GLfloat x, GLfloat y); +GLAPI void GLAPIENTRY glRasterPos2fv (const GLfloat *v); +GLAPI void GLAPIENTRY glRasterPos2i (GLint x, GLint y); +GLAPI void GLAPIENTRY glRasterPos2iv (const GLint *v); +GLAPI void GLAPIENTRY glRasterPos2s (GLshort x, GLshort y); +GLAPI void GLAPIENTRY glRasterPos2sv (const GLshort *v); +GLAPI void GLAPIENTRY glRasterPos3d (GLdouble x, GLdouble y, GLdouble z); +GLAPI void GLAPIENTRY glRasterPos3dv (const GLdouble *v); +GLAPI void GLAPIENTRY glRasterPos3f (GLfloat x, GLfloat y, GLfloat z); +GLAPI void GLAPIENTRY glRasterPos3fv (const GLfloat *v); +GLAPI void GLAPIENTRY glRasterPos3i (GLint x, GLint y, GLint z); +GLAPI void GLAPIENTRY glRasterPos3iv (const GLint *v); +GLAPI void GLAPIENTRY glRasterPos3s (GLshort x, GLshort y, GLshort z); +GLAPI void GLAPIENTRY glRasterPos3sv (const GLshort *v); +GLAPI void GLAPIENTRY glRasterPos4d (GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI void GLAPIENTRY glRasterPos4dv (const GLdouble *v); +GLAPI void GLAPIENTRY glRasterPos4f (GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GLAPI void GLAPIENTRY glRasterPos4fv (const GLfloat *v); +GLAPI void GLAPIENTRY glRasterPos4i (GLint x, GLint y, GLint z, GLint w); +GLAPI void GLAPIENTRY glRasterPos4iv (const GLint *v); +GLAPI void GLAPIENTRY glRasterPos4s (GLshort x, GLshort y, GLshort z, GLshort w); +GLAPI void GLAPIENTRY glRasterPos4sv (const GLshort *v); +GLAPI void GLAPIENTRY glReadBuffer (GLenum mode); +GLAPI void GLAPIENTRY glReadPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels); +GLAPI void GLAPIENTRY glRectd (GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2); +GLAPI void GLAPIENTRY glRectdv (const GLdouble *v1, const GLdouble *v2); +GLAPI void GLAPIENTRY glRectf (GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2); +GLAPI void GLAPIENTRY glRectfv (const GLfloat *v1, const GLfloat *v2); +GLAPI void GLAPIENTRY glRecti (GLint x1, GLint y1, GLint x2, GLint y2); +GLAPI void GLAPIENTRY glRectiv (const GLint *v1, const GLint *v2); +GLAPI void GLAPIENTRY glRects (GLshort x1, GLshort y1, GLshort x2, GLshort y2); +GLAPI void GLAPIENTRY glRectsv (const GLshort *v1, const GLshort *v2); +GLAPI GLint GLAPIENTRY glRenderMode (GLenum mode); +GLAPI void GLAPIENTRY glRotated (GLdouble angle, GLdouble x, GLdouble y, GLdouble z); +GLAPI void GLAPIENTRY glRotatef (GLfloat angle, GLfloat x, GLfloat y, GLfloat z); +GLAPI void GLAPIENTRY glScaled (GLdouble x, GLdouble y, GLdouble z); +GLAPI void GLAPIENTRY glScalef (GLfloat x, GLfloat y, GLfloat z); +GLAPI void GLAPIENTRY glScissor (GLint x, GLint y, GLsizei width, GLsizei height); +GLAPI void GLAPIENTRY glSelectBuffer (GLsizei size, GLuint *buffer); +GLAPI void GLAPIENTRY glShadeModel (GLenum mode); +GLAPI void GLAPIENTRY glStencilFunc (GLenum func, GLint ref, GLuint mask); +GLAPI void GLAPIENTRY glStencilMask (GLuint mask); +GLAPI void GLAPIENTRY glStencilOp (GLenum fail, GLenum zfail, GLenum zpass); +GLAPI void GLAPIENTRY glTexCoord1d (GLdouble s); +GLAPI void GLAPIENTRY glTexCoord1dv (const GLdouble *v); +GLAPI void GLAPIENTRY glTexCoord1f (GLfloat s); +GLAPI void GLAPIENTRY glTexCoord1fv (const GLfloat *v); +GLAPI void GLAPIENTRY glTexCoord1i (GLint s); +GLAPI void GLAPIENTRY glTexCoord1iv (const GLint *v); +GLAPI void GLAPIENTRY glTexCoord1s (GLshort s); +GLAPI void GLAPIENTRY glTexCoord1sv (const GLshort *v); +GLAPI void GLAPIENTRY glTexCoord2d (GLdouble s, GLdouble t); +GLAPI void GLAPIENTRY glTexCoord2dv (const GLdouble *v); +GLAPI void GLAPIENTRY glTexCoord2f (GLfloat s, GLfloat t); +GLAPI void GLAPIENTRY glTexCoord2fv (const GLfloat *v); +GLAPI void GLAPIENTRY glTexCoord2i (GLint s, GLint t); +GLAPI void GLAPIENTRY glTexCoord2iv (const GLint *v); +GLAPI void GLAPIENTRY glTexCoord2s (GLshort s, GLshort t); +GLAPI void GLAPIENTRY glTexCoord2sv (const GLshort *v); +GLAPI void GLAPIENTRY glTexCoord3d (GLdouble s, GLdouble t, GLdouble r); +GLAPI void GLAPIENTRY glTexCoord3dv (const GLdouble *v); +GLAPI void GLAPIENTRY glTexCoord3f (GLfloat s, GLfloat t, GLfloat r); +GLAPI void GLAPIENTRY glTexCoord3fv (const GLfloat *v); +GLAPI void GLAPIENTRY glTexCoord3i (GLint s, GLint t, GLint r); +GLAPI void GLAPIENTRY glTexCoord3iv (const GLint *v); +GLAPI void GLAPIENTRY glTexCoord3s (GLshort s, GLshort t, GLshort r); +GLAPI void GLAPIENTRY glTexCoord3sv (const GLshort *v); +GLAPI void GLAPIENTRY glTexCoord4d (GLdouble s, GLdouble t, GLdouble r, GLdouble q); +GLAPI void GLAPIENTRY glTexCoord4dv (const GLdouble *v); +GLAPI void GLAPIENTRY glTexCoord4f (GLfloat s, GLfloat t, GLfloat r, GLfloat q); +GLAPI void GLAPIENTRY glTexCoord4fv (const GLfloat *v); +GLAPI void GLAPIENTRY glTexCoord4i (GLint s, GLint t, GLint r, GLint q); +GLAPI void GLAPIENTRY glTexCoord4iv (const GLint *v); +GLAPI void GLAPIENTRY glTexCoord4s (GLshort s, GLshort t, GLshort r, GLshort q); +GLAPI void GLAPIENTRY glTexCoord4sv (const GLshort *v); +GLAPI void GLAPIENTRY glTexCoordPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +GLAPI void GLAPIENTRY glTexEnvf (GLenum target, GLenum pname, GLfloat param); +GLAPI void GLAPIENTRY glTexEnvfv (GLenum target, GLenum pname, const GLfloat *params); +GLAPI void GLAPIENTRY glTexEnvi (GLenum target, GLenum pname, GLint param); +GLAPI void GLAPIENTRY glTexEnviv (GLenum target, GLenum pname, const GLint *params); +GLAPI void GLAPIENTRY glTexGend (GLenum coord, GLenum pname, GLdouble param); +GLAPI void GLAPIENTRY glTexGendv (GLenum coord, GLenum pname, const GLdouble *params); +GLAPI void GLAPIENTRY glTexGenf (GLenum coord, GLenum pname, GLfloat param); +GLAPI void GLAPIENTRY glTexGenfv (GLenum coord, GLenum pname, const GLfloat *params); +GLAPI void GLAPIENTRY glTexGeni (GLenum coord, GLenum pname, GLint param); +GLAPI void GLAPIENTRY glTexGeniv (GLenum coord, GLenum pname, const GLint *params); +GLAPI void GLAPIENTRY glTexImage1D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +GLAPI void GLAPIENTRY glTexImage2D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +GLAPI void GLAPIENTRY glTexParameterf (GLenum target, GLenum pname, GLfloat param); +GLAPI void GLAPIENTRY glTexParameterfv (GLenum target, GLenum pname, const GLfloat *params); +GLAPI void GLAPIENTRY glTexParameteri (GLenum target, GLenum pname, GLint param); +GLAPI void GLAPIENTRY glTexParameteriv (GLenum target, GLenum pname, const GLint *params); +GLAPI void GLAPIENTRY glTexSubImage1D (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels); +GLAPI void GLAPIENTRY glTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels); +GLAPI void GLAPIENTRY glTranslated (GLdouble x, GLdouble y, GLdouble z); +GLAPI void GLAPIENTRY glTranslatef (GLfloat x, GLfloat y, GLfloat z); +GLAPI void GLAPIENTRY glVertex2d (GLdouble x, GLdouble y); +GLAPI void GLAPIENTRY glVertex2dv (const GLdouble *v); +GLAPI void GLAPIENTRY glVertex2f (GLfloat x, GLfloat y); +GLAPI void GLAPIENTRY glVertex2fv (const GLfloat *v); +GLAPI void GLAPIENTRY glVertex2i (GLint x, GLint y); +GLAPI void GLAPIENTRY glVertex2iv (const GLint *v); +GLAPI void GLAPIENTRY glVertex2s (GLshort x, GLshort y); +GLAPI void GLAPIENTRY glVertex2sv (const GLshort *v); +GLAPI void GLAPIENTRY glVertex3d (GLdouble x, GLdouble y, GLdouble z); +GLAPI void GLAPIENTRY glVertex3dv (const GLdouble *v); +GLAPI void GLAPIENTRY glVertex3f (GLfloat x, GLfloat y, GLfloat z); +GLAPI void GLAPIENTRY glVertex3fv (const GLfloat *v); +GLAPI void GLAPIENTRY glVertex3i (GLint x, GLint y, GLint z); +GLAPI void GLAPIENTRY glVertex3iv (const GLint *v); +GLAPI void GLAPIENTRY glVertex3s (GLshort x, GLshort y, GLshort z); +GLAPI void GLAPIENTRY glVertex3sv (const GLshort *v); +GLAPI void GLAPIENTRY glVertex4d (GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI void GLAPIENTRY glVertex4dv (const GLdouble *v); +GLAPI void GLAPIENTRY glVertex4f (GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GLAPI void GLAPIENTRY glVertex4fv (const GLfloat *v); +GLAPI void GLAPIENTRY glVertex4i (GLint x, GLint y, GLint z, GLint w); +GLAPI void GLAPIENTRY glVertex4iv (const GLint *v); +GLAPI void GLAPIENTRY glVertex4s (GLshort x, GLshort y, GLshort z, GLshort w); +GLAPI void GLAPIENTRY glVertex4sv (const GLshort *v); +GLAPI void GLAPIENTRY glVertexPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +GLAPI void GLAPIENTRY glViewport (GLint x, GLint y, GLsizei width, GLsizei height); + +#define GLEW_VERSION_1_1 GLEW_GET_VAR(__GLEW_VERSION_1_1) + +#endif /* GL_VERSION_1_1 */ + +/* ---------------------------------- GLU ---------------------------------- */ + +#ifndef GLEW_NO_GLU +/* this is where we can safely include GLU */ +# if defined(__APPLE__) && defined(__MACH__) +# include +# else +# include +# endif +#endif + +/* ----------------------------- GL_VERSION_1_2 ---------------------------- */ + +#ifndef GL_VERSION_1_2 +#define GL_VERSION_1_2 1 + +#define GL_SMOOTH_POINT_SIZE_RANGE 0x0B12 +#define GL_SMOOTH_POINT_SIZE_GRANULARITY 0x0B13 +#define GL_SMOOTH_LINE_WIDTH_RANGE 0x0B22 +#define GL_SMOOTH_LINE_WIDTH_GRANULARITY 0x0B23 +#define GL_UNSIGNED_BYTE_3_3_2 0x8032 +#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033 +#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034 +#define GL_UNSIGNED_INT_8_8_8_8 0x8035 +#define GL_UNSIGNED_INT_10_10_10_2 0x8036 +#define GL_RESCALE_NORMAL 0x803A +#define GL_TEXTURE_BINDING_3D 0x806A +#define GL_PACK_SKIP_IMAGES 0x806B +#define GL_PACK_IMAGE_HEIGHT 0x806C +#define GL_UNPACK_SKIP_IMAGES 0x806D +#define GL_UNPACK_IMAGE_HEIGHT 0x806E +#define GL_TEXTURE_3D 0x806F +#define GL_PROXY_TEXTURE_3D 0x8070 +#define GL_TEXTURE_DEPTH 0x8071 +#define GL_TEXTURE_WRAP_R 0x8072 +#define GL_MAX_3D_TEXTURE_SIZE 0x8073 +#define GL_BGR 0x80E0 +#define GL_BGRA 0x80E1 +#define GL_MAX_ELEMENTS_VERTICES 0x80E8 +#define GL_MAX_ELEMENTS_INDICES 0x80E9 +#define GL_CLAMP_TO_EDGE 0x812F +#define GL_TEXTURE_MIN_LOD 0x813A +#define GL_TEXTURE_MAX_LOD 0x813B +#define GL_TEXTURE_BASE_LEVEL 0x813C +#define GL_TEXTURE_MAX_LEVEL 0x813D +#define GL_LIGHT_MODEL_COLOR_CONTROL 0x81F8 +#define GL_SINGLE_COLOR 0x81F9 +#define GL_SEPARATE_SPECULAR_COLOR 0x81FA +#define GL_UNSIGNED_BYTE_2_3_3_REV 0x8362 +#define GL_UNSIGNED_SHORT_5_6_5 0x8363 +#define GL_UNSIGNED_SHORT_5_6_5_REV 0x8364 +#define GL_UNSIGNED_SHORT_4_4_4_4_REV 0x8365 +#define GL_UNSIGNED_SHORT_1_5_5_5_REV 0x8366 +#define GL_UNSIGNED_INT_8_8_8_8_REV 0x8367 +#define GL_ALIASED_POINT_SIZE_RANGE 0x846D +#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E + +typedef void (GLAPIENTRY * PFNGLCOPYTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLDRAWRANGEELEMENTSPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices); +typedef void (GLAPIENTRY * PFNGLTEXIMAGE3DPROC) (GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (GLAPIENTRY * PFNGLTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); + +#define glCopyTexSubImage3D GLEW_GET_FUN(__glewCopyTexSubImage3D) +#define glDrawRangeElements GLEW_GET_FUN(__glewDrawRangeElements) +#define glTexImage3D GLEW_GET_FUN(__glewTexImage3D) +#define glTexSubImage3D GLEW_GET_FUN(__glewTexSubImage3D) + +#define GLEW_VERSION_1_2 GLEW_GET_VAR(__GLEW_VERSION_1_2) + +#endif /* GL_VERSION_1_2 */ + +/* ---------------------------- GL_VERSION_1_2_1 --------------------------- */ + +#ifndef GL_VERSION_1_2_1 +#define GL_VERSION_1_2_1 1 + +#define GLEW_VERSION_1_2_1 GLEW_GET_VAR(__GLEW_VERSION_1_2_1) + +#endif /* GL_VERSION_1_2_1 */ + +/* ----------------------------- GL_VERSION_1_3 ---------------------------- */ + +#ifndef GL_VERSION_1_3 +#define GL_VERSION_1_3 1 + +#define GL_MULTISAMPLE 0x809D +#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E +#define GL_SAMPLE_ALPHA_TO_ONE 0x809F +#define GL_SAMPLE_COVERAGE 0x80A0 +#define GL_SAMPLE_BUFFERS 0x80A8 +#define GL_SAMPLES 0x80A9 +#define GL_SAMPLE_COVERAGE_VALUE 0x80AA +#define GL_SAMPLE_COVERAGE_INVERT 0x80AB +#define GL_CLAMP_TO_BORDER 0x812D +#define GL_TEXTURE0 0x84C0 +#define GL_TEXTURE1 0x84C1 +#define GL_TEXTURE2 0x84C2 +#define GL_TEXTURE3 0x84C3 +#define GL_TEXTURE4 0x84C4 +#define GL_TEXTURE5 0x84C5 +#define GL_TEXTURE6 0x84C6 +#define GL_TEXTURE7 0x84C7 +#define GL_TEXTURE8 0x84C8 +#define GL_TEXTURE9 0x84C9 +#define GL_TEXTURE10 0x84CA +#define GL_TEXTURE11 0x84CB +#define GL_TEXTURE12 0x84CC +#define GL_TEXTURE13 0x84CD +#define GL_TEXTURE14 0x84CE +#define GL_TEXTURE15 0x84CF +#define GL_TEXTURE16 0x84D0 +#define GL_TEXTURE17 0x84D1 +#define GL_TEXTURE18 0x84D2 +#define GL_TEXTURE19 0x84D3 +#define GL_TEXTURE20 0x84D4 +#define GL_TEXTURE21 0x84D5 +#define GL_TEXTURE22 0x84D6 +#define GL_TEXTURE23 0x84D7 +#define GL_TEXTURE24 0x84D8 +#define GL_TEXTURE25 0x84D9 +#define GL_TEXTURE26 0x84DA +#define GL_TEXTURE27 0x84DB +#define GL_TEXTURE28 0x84DC +#define GL_TEXTURE29 0x84DD +#define GL_TEXTURE30 0x84DE +#define GL_TEXTURE31 0x84DF +#define GL_ACTIVE_TEXTURE 0x84E0 +#define GL_CLIENT_ACTIVE_TEXTURE 0x84E1 +#define GL_MAX_TEXTURE_UNITS 0x84E2 +#define GL_TRANSPOSE_MODELVIEW_MATRIX 0x84E3 +#define GL_TRANSPOSE_PROJECTION_MATRIX 0x84E4 +#define GL_TRANSPOSE_TEXTURE_MATRIX 0x84E5 +#define GL_TRANSPOSE_COLOR_MATRIX 0x84E6 +#define GL_SUBTRACT 0x84E7 +#define GL_COMPRESSED_ALPHA 0x84E9 +#define GL_COMPRESSED_LUMINANCE 0x84EA +#define GL_COMPRESSED_LUMINANCE_ALPHA 0x84EB +#define GL_COMPRESSED_INTENSITY 0x84EC +#define GL_COMPRESSED_RGB 0x84ED +#define GL_COMPRESSED_RGBA 0x84EE +#define GL_TEXTURE_COMPRESSION_HINT 0x84EF +#define GL_NORMAL_MAP 0x8511 +#define GL_REFLECTION_MAP 0x8512 +#define GL_TEXTURE_CUBE_MAP 0x8513 +#define GL_TEXTURE_BINDING_CUBE_MAP 0x8514 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x8516 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x8517 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x8518 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A +#define GL_PROXY_TEXTURE_CUBE_MAP 0x851B +#define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C +#define GL_COMBINE 0x8570 +#define GL_COMBINE_RGB 0x8571 +#define GL_COMBINE_ALPHA 0x8572 +#define GL_RGB_SCALE 0x8573 +#define GL_ADD_SIGNED 0x8574 +#define GL_INTERPOLATE 0x8575 +#define GL_CONSTANT 0x8576 +#define GL_PRIMARY_COLOR 0x8577 +#define GL_PREVIOUS 0x8578 +#define GL_SOURCE0_RGB 0x8580 +#define GL_SOURCE1_RGB 0x8581 +#define GL_SOURCE2_RGB 0x8582 +#define GL_SOURCE0_ALPHA 0x8588 +#define GL_SOURCE1_ALPHA 0x8589 +#define GL_SOURCE2_ALPHA 0x858A +#define GL_OPERAND0_RGB 0x8590 +#define GL_OPERAND1_RGB 0x8591 +#define GL_OPERAND2_RGB 0x8592 +#define GL_OPERAND0_ALPHA 0x8598 +#define GL_OPERAND1_ALPHA 0x8599 +#define GL_OPERAND2_ALPHA 0x859A +#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE 0x86A0 +#define GL_TEXTURE_COMPRESSED 0x86A1 +#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2 +#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3 +#define GL_DOT3_RGB 0x86AE +#define GL_DOT3_RGBA 0x86AF +#define GL_MULTISAMPLE_BIT 0x20000000 + +typedef void (GLAPIENTRY * PFNGLACTIVETEXTUREPROC) (GLenum texture); +typedef void (GLAPIENTRY * PFNGLCLIENTACTIVETEXTUREPROC) (GLenum texture); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXIMAGE1DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXIMAGE3DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLGETCOMPRESSEDTEXIMAGEPROC) (GLenum target, GLint lod, GLvoid *img); +typedef void (GLAPIENTRY * PFNGLLOADTRANSPOSEMATRIXDPROC) (const GLdouble m[16]); +typedef void (GLAPIENTRY * PFNGLLOADTRANSPOSEMATRIXFPROC) (const GLfloat m[16]); +typedef void (GLAPIENTRY * PFNGLMULTTRANSPOSEMATRIXDPROC) (const GLdouble m[16]); +typedef void (GLAPIENTRY * PFNGLMULTTRANSPOSEMATRIXFPROC) (const GLfloat m[16]); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1DPROC) (GLenum target, GLdouble s); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1DVPROC) (GLenum target, const GLdouble *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1FPROC) (GLenum target, GLfloat s); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1FVPROC) (GLenum target, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1IPROC) (GLenum target, GLint s); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1IVPROC) (GLenum target, const GLint *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1SPROC) (GLenum target, GLshort s); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1SVPROC) (GLenum target, const GLshort *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2DPROC) (GLenum target, GLdouble s, GLdouble t); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2DVPROC) (GLenum target, const GLdouble *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2FPROC) (GLenum target, GLfloat s, GLfloat t); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2FVPROC) (GLenum target, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2IPROC) (GLenum target, GLint s, GLint t); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2IVPROC) (GLenum target, const GLint *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2SPROC) (GLenum target, GLshort s, GLshort t); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2SVPROC) (GLenum target, const GLshort *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3DVPROC) (GLenum target, const GLdouble *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3FVPROC) (GLenum target, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3IPROC) (GLenum target, GLint s, GLint t, GLint r); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3IVPROC) (GLenum target, const GLint *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3SPROC) (GLenum target, GLshort s, GLshort t, GLshort r); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3SVPROC) (GLenum target, const GLshort *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4DVPROC) (GLenum target, const GLdouble *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4FVPROC) (GLenum target, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4IPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4IVPROC) (GLenum target, const GLint *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4SPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4SVPROC) (GLenum target, const GLshort *v); +typedef void (GLAPIENTRY * PFNGLSAMPLECOVERAGEPROC) (GLclampf value, GLboolean invert); + +#define glActiveTexture GLEW_GET_FUN(__glewActiveTexture) +#define glClientActiveTexture GLEW_GET_FUN(__glewClientActiveTexture) +#define glCompressedTexImage1D GLEW_GET_FUN(__glewCompressedTexImage1D) +#define glCompressedTexImage2D GLEW_GET_FUN(__glewCompressedTexImage2D) +#define glCompressedTexImage3D GLEW_GET_FUN(__glewCompressedTexImage3D) +#define glCompressedTexSubImage1D GLEW_GET_FUN(__glewCompressedTexSubImage1D) +#define glCompressedTexSubImage2D GLEW_GET_FUN(__glewCompressedTexSubImage2D) +#define glCompressedTexSubImage3D GLEW_GET_FUN(__glewCompressedTexSubImage3D) +#define glGetCompressedTexImage GLEW_GET_FUN(__glewGetCompressedTexImage) +#define glLoadTransposeMatrixd GLEW_GET_FUN(__glewLoadTransposeMatrixd) +#define glLoadTransposeMatrixf GLEW_GET_FUN(__glewLoadTransposeMatrixf) +#define glMultTransposeMatrixd GLEW_GET_FUN(__glewMultTransposeMatrixd) +#define glMultTransposeMatrixf GLEW_GET_FUN(__glewMultTransposeMatrixf) +#define glMultiTexCoord1d GLEW_GET_FUN(__glewMultiTexCoord1d) +#define glMultiTexCoord1dv GLEW_GET_FUN(__glewMultiTexCoord1dv) +#define glMultiTexCoord1f GLEW_GET_FUN(__glewMultiTexCoord1f) +#define glMultiTexCoord1fv GLEW_GET_FUN(__glewMultiTexCoord1fv) +#define glMultiTexCoord1i GLEW_GET_FUN(__glewMultiTexCoord1i) +#define glMultiTexCoord1iv GLEW_GET_FUN(__glewMultiTexCoord1iv) +#define glMultiTexCoord1s GLEW_GET_FUN(__glewMultiTexCoord1s) +#define glMultiTexCoord1sv GLEW_GET_FUN(__glewMultiTexCoord1sv) +#define glMultiTexCoord2d GLEW_GET_FUN(__glewMultiTexCoord2d) +#define glMultiTexCoord2dv GLEW_GET_FUN(__glewMultiTexCoord2dv) +#define glMultiTexCoord2f GLEW_GET_FUN(__glewMultiTexCoord2f) +#define glMultiTexCoord2fv GLEW_GET_FUN(__glewMultiTexCoord2fv) +#define glMultiTexCoord2i GLEW_GET_FUN(__glewMultiTexCoord2i) +#define glMultiTexCoord2iv GLEW_GET_FUN(__glewMultiTexCoord2iv) +#define glMultiTexCoord2s GLEW_GET_FUN(__glewMultiTexCoord2s) +#define glMultiTexCoord2sv GLEW_GET_FUN(__glewMultiTexCoord2sv) +#define glMultiTexCoord3d GLEW_GET_FUN(__glewMultiTexCoord3d) +#define glMultiTexCoord3dv GLEW_GET_FUN(__glewMultiTexCoord3dv) +#define glMultiTexCoord3f GLEW_GET_FUN(__glewMultiTexCoord3f) +#define glMultiTexCoord3fv GLEW_GET_FUN(__glewMultiTexCoord3fv) +#define glMultiTexCoord3i GLEW_GET_FUN(__glewMultiTexCoord3i) +#define glMultiTexCoord3iv GLEW_GET_FUN(__glewMultiTexCoord3iv) +#define glMultiTexCoord3s GLEW_GET_FUN(__glewMultiTexCoord3s) +#define glMultiTexCoord3sv GLEW_GET_FUN(__glewMultiTexCoord3sv) +#define glMultiTexCoord4d GLEW_GET_FUN(__glewMultiTexCoord4d) +#define glMultiTexCoord4dv GLEW_GET_FUN(__glewMultiTexCoord4dv) +#define glMultiTexCoord4f GLEW_GET_FUN(__glewMultiTexCoord4f) +#define glMultiTexCoord4fv GLEW_GET_FUN(__glewMultiTexCoord4fv) +#define glMultiTexCoord4i GLEW_GET_FUN(__glewMultiTexCoord4i) +#define glMultiTexCoord4iv GLEW_GET_FUN(__glewMultiTexCoord4iv) +#define glMultiTexCoord4s GLEW_GET_FUN(__glewMultiTexCoord4s) +#define glMultiTexCoord4sv GLEW_GET_FUN(__glewMultiTexCoord4sv) +#define glSampleCoverage GLEW_GET_FUN(__glewSampleCoverage) + +#define GLEW_VERSION_1_3 GLEW_GET_VAR(__GLEW_VERSION_1_3) + +#endif /* GL_VERSION_1_3 */ + +/* ----------------------------- GL_VERSION_1_4 ---------------------------- */ + +#ifndef GL_VERSION_1_4 +#define GL_VERSION_1_4 1 + +#define GL_BLEND_DST_RGB 0x80C8 +#define GL_BLEND_SRC_RGB 0x80C9 +#define GL_BLEND_DST_ALPHA 0x80CA +#define GL_BLEND_SRC_ALPHA 0x80CB +#define GL_POINT_SIZE_MIN 0x8126 +#define GL_POINT_SIZE_MAX 0x8127 +#define GL_POINT_FADE_THRESHOLD_SIZE 0x8128 +#define GL_POINT_DISTANCE_ATTENUATION 0x8129 +#define GL_GENERATE_MIPMAP 0x8191 +#define GL_GENERATE_MIPMAP_HINT 0x8192 +#define GL_DEPTH_COMPONENT16 0x81A5 +#define GL_DEPTH_COMPONENT24 0x81A6 +#define GL_DEPTH_COMPONENT32 0x81A7 +#define GL_MIRRORED_REPEAT 0x8370 +#define GL_FOG_COORDINATE_SOURCE 0x8450 +#define GL_FOG_COORDINATE 0x8451 +#define GL_FRAGMENT_DEPTH 0x8452 +#define GL_CURRENT_FOG_COORDINATE 0x8453 +#define GL_FOG_COORDINATE_ARRAY_TYPE 0x8454 +#define GL_FOG_COORDINATE_ARRAY_STRIDE 0x8455 +#define GL_FOG_COORDINATE_ARRAY_POINTER 0x8456 +#define GL_FOG_COORDINATE_ARRAY 0x8457 +#define GL_COLOR_SUM 0x8458 +#define GL_CURRENT_SECONDARY_COLOR 0x8459 +#define GL_SECONDARY_COLOR_ARRAY_SIZE 0x845A +#define GL_SECONDARY_COLOR_ARRAY_TYPE 0x845B +#define GL_SECONDARY_COLOR_ARRAY_STRIDE 0x845C +#define GL_SECONDARY_COLOR_ARRAY_POINTER 0x845D +#define GL_SECONDARY_COLOR_ARRAY 0x845E +#define GL_MAX_TEXTURE_LOD_BIAS 0x84FD +#define GL_TEXTURE_FILTER_CONTROL 0x8500 +#define GL_TEXTURE_LOD_BIAS 0x8501 +#define GL_INCR_WRAP 0x8507 +#define GL_DECR_WRAP 0x8508 +#define GL_TEXTURE_DEPTH_SIZE 0x884A +#define GL_DEPTH_TEXTURE_MODE 0x884B +#define GL_TEXTURE_COMPARE_MODE 0x884C +#define GL_TEXTURE_COMPARE_FUNC 0x884D +#define GL_COMPARE_R_TO_TEXTURE 0x884E + +typedef void (GLAPIENTRY * PFNGLBLENDCOLORPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); +typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONPROC) (GLenum mode); +typedef void (GLAPIENTRY * PFNGLBLENDFUNCSEPARATEPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); +typedef void (GLAPIENTRY * PFNGLFOGCOORDPOINTERPROC) (GLenum type, GLsizei stride, const GLvoid *pointer); +typedef void (GLAPIENTRY * PFNGLFOGCOORDDPROC) (GLdouble coord); +typedef void (GLAPIENTRY * PFNGLFOGCOORDDVPROC) (const GLdouble *coord); +typedef void (GLAPIENTRY * PFNGLFOGCOORDFPROC) (GLfloat coord); +typedef void (GLAPIENTRY * PFNGLFOGCOORDFVPROC) (const GLfloat *coord); +typedef void (GLAPIENTRY * PFNGLMULTIDRAWARRAYSPROC) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei drawcount); +typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid **indices, GLsizei drawcount); +typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERFPROC) (GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERFVPROC) (GLenum pname, const GLfloat *params); +typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERIPROC) (GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERIVPROC) (GLenum pname, const GLint *params); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3BPROC) (GLbyte red, GLbyte green, GLbyte blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3BVPROC) (const GLbyte *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3DPROC) (GLdouble red, GLdouble green, GLdouble blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3DVPROC) (const GLdouble *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3FPROC) (GLfloat red, GLfloat green, GLfloat blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3FVPROC) (const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3IPROC) (GLint red, GLint green, GLint blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3IVPROC) (const GLint *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3SPROC) (GLshort red, GLshort green, GLshort blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3SVPROC) (const GLshort *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UBPROC) (GLubyte red, GLubyte green, GLubyte blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UBVPROC) (const GLubyte *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UIPROC) (GLuint red, GLuint green, GLuint blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UIVPROC) (const GLuint *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3USPROC) (GLushort red, GLushort green, GLushort blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3USVPROC) (const GLushort *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLORPOINTERPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2DPROC) (GLdouble x, GLdouble y); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2DVPROC) (const GLdouble *p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2FPROC) (GLfloat x, GLfloat y); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2FVPROC) (const GLfloat *p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2IPROC) (GLint x, GLint y); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2IVPROC) (const GLint *p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2SPROC) (GLshort x, GLshort y); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2SVPROC) (const GLshort *p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3DPROC) (GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3DVPROC) (const GLdouble *p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3FPROC) (GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3FVPROC) (const GLfloat *p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3IPROC) (GLint x, GLint y, GLint z); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3IVPROC) (const GLint *p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3SPROC) (GLshort x, GLshort y, GLshort z); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3SVPROC) (const GLshort *p); + +#define glBlendColor GLEW_GET_FUN(__glewBlendColor) +#define glBlendEquation GLEW_GET_FUN(__glewBlendEquation) +#define glBlendFuncSeparate GLEW_GET_FUN(__glewBlendFuncSeparate) +#define glFogCoordPointer GLEW_GET_FUN(__glewFogCoordPointer) +#define glFogCoordd GLEW_GET_FUN(__glewFogCoordd) +#define glFogCoorddv GLEW_GET_FUN(__glewFogCoorddv) +#define glFogCoordf GLEW_GET_FUN(__glewFogCoordf) +#define glFogCoordfv GLEW_GET_FUN(__glewFogCoordfv) +#define glMultiDrawArrays GLEW_GET_FUN(__glewMultiDrawArrays) +#define glMultiDrawElements GLEW_GET_FUN(__glewMultiDrawElements) +#define glPointParameterf GLEW_GET_FUN(__glewPointParameterf) +#define glPointParameterfv GLEW_GET_FUN(__glewPointParameterfv) +#define glPointParameteri GLEW_GET_FUN(__glewPointParameteri) +#define glPointParameteriv GLEW_GET_FUN(__glewPointParameteriv) +#define glSecondaryColor3b GLEW_GET_FUN(__glewSecondaryColor3b) +#define glSecondaryColor3bv GLEW_GET_FUN(__glewSecondaryColor3bv) +#define glSecondaryColor3d GLEW_GET_FUN(__glewSecondaryColor3d) +#define glSecondaryColor3dv GLEW_GET_FUN(__glewSecondaryColor3dv) +#define glSecondaryColor3f GLEW_GET_FUN(__glewSecondaryColor3f) +#define glSecondaryColor3fv GLEW_GET_FUN(__glewSecondaryColor3fv) +#define glSecondaryColor3i GLEW_GET_FUN(__glewSecondaryColor3i) +#define glSecondaryColor3iv GLEW_GET_FUN(__glewSecondaryColor3iv) +#define glSecondaryColor3s GLEW_GET_FUN(__glewSecondaryColor3s) +#define glSecondaryColor3sv GLEW_GET_FUN(__glewSecondaryColor3sv) +#define glSecondaryColor3ub GLEW_GET_FUN(__glewSecondaryColor3ub) +#define glSecondaryColor3ubv GLEW_GET_FUN(__glewSecondaryColor3ubv) +#define glSecondaryColor3ui GLEW_GET_FUN(__glewSecondaryColor3ui) +#define glSecondaryColor3uiv GLEW_GET_FUN(__glewSecondaryColor3uiv) +#define glSecondaryColor3us GLEW_GET_FUN(__glewSecondaryColor3us) +#define glSecondaryColor3usv GLEW_GET_FUN(__glewSecondaryColor3usv) +#define glSecondaryColorPointer GLEW_GET_FUN(__glewSecondaryColorPointer) +#define glWindowPos2d GLEW_GET_FUN(__glewWindowPos2d) +#define glWindowPos2dv GLEW_GET_FUN(__glewWindowPos2dv) +#define glWindowPos2f GLEW_GET_FUN(__glewWindowPos2f) +#define glWindowPos2fv GLEW_GET_FUN(__glewWindowPos2fv) +#define glWindowPos2i GLEW_GET_FUN(__glewWindowPos2i) +#define glWindowPos2iv GLEW_GET_FUN(__glewWindowPos2iv) +#define glWindowPos2s GLEW_GET_FUN(__glewWindowPos2s) +#define glWindowPos2sv GLEW_GET_FUN(__glewWindowPos2sv) +#define glWindowPos3d GLEW_GET_FUN(__glewWindowPos3d) +#define glWindowPos3dv GLEW_GET_FUN(__glewWindowPos3dv) +#define glWindowPos3f GLEW_GET_FUN(__glewWindowPos3f) +#define glWindowPos3fv GLEW_GET_FUN(__glewWindowPos3fv) +#define glWindowPos3i GLEW_GET_FUN(__glewWindowPos3i) +#define glWindowPos3iv GLEW_GET_FUN(__glewWindowPos3iv) +#define glWindowPos3s GLEW_GET_FUN(__glewWindowPos3s) +#define glWindowPos3sv GLEW_GET_FUN(__glewWindowPos3sv) + +#define GLEW_VERSION_1_4 GLEW_GET_VAR(__GLEW_VERSION_1_4) + +#endif /* GL_VERSION_1_4 */ + +/* ----------------------------- GL_VERSION_1_5 ---------------------------- */ + +#ifndef GL_VERSION_1_5 +#define GL_VERSION_1_5 1 + +#define GL_FOG_COORD_SRC GL_FOG_COORDINATE_SOURCE +#define GL_FOG_COORD GL_FOG_COORDINATE +#define GL_FOG_COORD_ARRAY GL_FOG_COORDINATE_ARRAY +#define GL_SRC0_RGB GL_SOURCE0_RGB +#define GL_FOG_COORD_ARRAY_POINTER GL_FOG_COORDINATE_ARRAY_POINTER +#define GL_FOG_COORD_ARRAY_TYPE GL_FOG_COORDINATE_ARRAY_TYPE +#define GL_SRC1_ALPHA GL_SOURCE1_ALPHA +#define GL_CURRENT_FOG_COORD GL_CURRENT_FOG_COORDINATE +#define GL_FOG_COORD_ARRAY_STRIDE GL_FOG_COORDINATE_ARRAY_STRIDE +#define GL_SRC0_ALPHA GL_SOURCE0_ALPHA +#define GL_SRC1_RGB GL_SOURCE1_RGB +#define GL_FOG_COORD_ARRAY_BUFFER_BINDING GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING +#define GL_SRC2_ALPHA GL_SOURCE2_ALPHA +#define GL_SRC2_RGB GL_SOURCE2_RGB +#define GL_BUFFER_SIZE 0x8764 +#define GL_BUFFER_USAGE 0x8765 +#define GL_QUERY_COUNTER_BITS 0x8864 +#define GL_CURRENT_QUERY 0x8865 +#define GL_QUERY_RESULT 0x8866 +#define GL_QUERY_RESULT_AVAILABLE 0x8867 +#define GL_ARRAY_BUFFER 0x8892 +#define GL_ELEMENT_ARRAY_BUFFER 0x8893 +#define GL_ARRAY_BUFFER_BINDING 0x8894 +#define GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895 +#define GL_VERTEX_ARRAY_BUFFER_BINDING 0x8896 +#define GL_NORMAL_ARRAY_BUFFER_BINDING 0x8897 +#define GL_COLOR_ARRAY_BUFFER_BINDING 0x8898 +#define GL_INDEX_ARRAY_BUFFER_BINDING 0x8899 +#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING 0x889A +#define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING 0x889B +#define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING 0x889C +#define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING 0x889D +#define GL_WEIGHT_ARRAY_BUFFER_BINDING 0x889E +#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING 0x889F +#define GL_READ_ONLY 0x88B8 +#define GL_WRITE_ONLY 0x88B9 +#define GL_READ_WRITE 0x88BA +#define GL_BUFFER_ACCESS 0x88BB +#define GL_BUFFER_MAPPED 0x88BC +#define GL_BUFFER_MAP_POINTER 0x88BD +#define GL_STREAM_DRAW 0x88E0 +#define GL_STREAM_READ 0x88E1 +#define GL_STREAM_COPY 0x88E2 +#define GL_STATIC_DRAW 0x88E4 +#define GL_STATIC_READ 0x88E5 +#define GL_STATIC_COPY 0x88E6 +#define GL_DYNAMIC_DRAW 0x88E8 +#define GL_DYNAMIC_READ 0x88E9 +#define GL_DYNAMIC_COPY 0x88EA +#define GL_SAMPLES_PASSED 0x8914 + +typedef ptrdiff_t GLintptr; +typedef ptrdiff_t GLsizeiptr; + +typedef void (GLAPIENTRY * PFNGLBEGINQUERYPROC) (GLenum target, GLuint id); +typedef void (GLAPIENTRY * PFNGLBINDBUFFERPROC) (GLenum target, GLuint buffer); +typedef void (GLAPIENTRY * PFNGLBUFFERDATAPROC) (GLenum target, GLsizeiptr size, const GLvoid* data, GLenum usage); +typedef void (GLAPIENTRY * PFNGLBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid* data); +typedef void (GLAPIENTRY * PFNGLDELETEBUFFERSPROC) (GLsizei n, const GLuint* buffers); +typedef void (GLAPIENTRY * PFNGLDELETEQUERIESPROC) (GLsizei n, const GLuint* ids); +typedef void (GLAPIENTRY * PFNGLENDQUERYPROC) (GLenum target); +typedef void (GLAPIENTRY * PFNGLGENBUFFERSPROC) (GLsizei n, GLuint* buffers); +typedef void (GLAPIENTRY * PFNGLGENQUERIESPROC) (GLsizei n, GLuint* ids); +typedef void (GLAPIENTRY * PFNGLGETBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETBUFFERPOINTERVPROC) (GLenum target, GLenum pname, GLvoid** params); +typedef void (GLAPIENTRY * PFNGLGETBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, GLvoid* data); +typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTIVPROC) (GLuint id, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTUIVPROC) (GLuint id, GLenum pname, GLuint* params); +typedef void (GLAPIENTRY * PFNGLGETQUERYIVPROC) (GLenum target, GLenum pname, GLint* params); +typedef GLboolean (GLAPIENTRY * PFNGLISBUFFERPROC) (GLuint buffer); +typedef GLboolean (GLAPIENTRY * PFNGLISQUERYPROC) (GLuint id); +typedef GLvoid* (GLAPIENTRY * PFNGLMAPBUFFERPROC) (GLenum target, GLenum access); +typedef GLboolean (GLAPIENTRY * PFNGLUNMAPBUFFERPROC) (GLenum target); + +#define glBeginQuery GLEW_GET_FUN(__glewBeginQuery) +#define glBindBuffer GLEW_GET_FUN(__glewBindBuffer) +#define glBufferData GLEW_GET_FUN(__glewBufferData) +#define glBufferSubData GLEW_GET_FUN(__glewBufferSubData) +#define glDeleteBuffers GLEW_GET_FUN(__glewDeleteBuffers) +#define glDeleteQueries GLEW_GET_FUN(__glewDeleteQueries) +#define glEndQuery GLEW_GET_FUN(__glewEndQuery) +#define glGenBuffers GLEW_GET_FUN(__glewGenBuffers) +#define glGenQueries GLEW_GET_FUN(__glewGenQueries) +#define glGetBufferParameteriv GLEW_GET_FUN(__glewGetBufferParameteriv) +#define glGetBufferPointerv GLEW_GET_FUN(__glewGetBufferPointerv) +#define glGetBufferSubData GLEW_GET_FUN(__glewGetBufferSubData) +#define glGetQueryObjectiv GLEW_GET_FUN(__glewGetQueryObjectiv) +#define glGetQueryObjectuiv GLEW_GET_FUN(__glewGetQueryObjectuiv) +#define glGetQueryiv GLEW_GET_FUN(__glewGetQueryiv) +#define glIsBuffer GLEW_GET_FUN(__glewIsBuffer) +#define glIsQuery GLEW_GET_FUN(__glewIsQuery) +#define glMapBuffer GLEW_GET_FUN(__glewMapBuffer) +#define glUnmapBuffer GLEW_GET_FUN(__glewUnmapBuffer) + +#define GLEW_VERSION_1_5 GLEW_GET_VAR(__GLEW_VERSION_1_5) + +#endif /* GL_VERSION_1_5 */ + +/* ----------------------------- GL_VERSION_2_0 ---------------------------- */ + +#ifndef GL_VERSION_2_0 +#define GL_VERSION_2_0 1 + +#define GL_BLEND_EQUATION_RGB GL_BLEND_EQUATION +#define GL_VERTEX_ATTRIB_ARRAY_ENABLED 0x8622 +#define GL_VERTEX_ATTRIB_ARRAY_SIZE 0x8623 +#define GL_VERTEX_ATTRIB_ARRAY_STRIDE 0x8624 +#define GL_VERTEX_ATTRIB_ARRAY_TYPE 0x8625 +#define GL_CURRENT_VERTEX_ATTRIB 0x8626 +#define GL_VERTEX_PROGRAM_POINT_SIZE 0x8642 +#define GL_VERTEX_PROGRAM_TWO_SIDE 0x8643 +#define GL_VERTEX_ATTRIB_ARRAY_POINTER 0x8645 +#define GL_STENCIL_BACK_FUNC 0x8800 +#define GL_STENCIL_BACK_FAIL 0x8801 +#define GL_STENCIL_BACK_PASS_DEPTH_FAIL 0x8802 +#define GL_STENCIL_BACK_PASS_DEPTH_PASS 0x8803 +#define GL_MAX_DRAW_BUFFERS 0x8824 +#define GL_DRAW_BUFFER0 0x8825 +#define GL_DRAW_BUFFER1 0x8826 +#define GL_DRAW_BUFFER2 0x8827 +#define GL_DRAW_BUFFER3 0x8828 +#define GL_DRAW_BUFFER4 0x8829 +#define GL_DRAW_BUFFER5 0x882A +#define GL_DRAW_BUFFER6 0x882B +#define GL_DRAW_BUFFER7 0x882C +#define GL_DRAW_BUFFER8 0x882D +#define GL_DRAW_BUFFER9 0x882E +#define GL_DRAW_BUFFER10 0x882F +#define GL_DRAW_BUFFER11 0x8830 +#define GL_DRAW_BUFFER12 0x8831 +#define GL_DRAW_BUFFER13 0x8832 +#define GL_DRAW_BUFFER14 0x8833 +#define GL_DRAW_BUFFER15 0x8834 +#define GL_BLEND_EQUATION_ALPHA 0x883D +#define GL_POINT_SPRITE 0x8861 +#define GL_COORD_REPLACE 0x8862 +#define GL_MAX_VERTEX_ATTRIBS 0x8869 +#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED 0x886A +#define GL_MAX_TEXTURE_COORDS 0x8871 +#define GL_MAX_TEXTURE_IMAGE_UNITS 0x8872 +#define GL_FRAGMENT_SHADER 0x8B30 +#define GL_VERTEX_SHADER 0x8B31 +#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS 0x8B49 +#define GL_MAX_VERTEX_UNIFORM_COMPONENTS 0x8B4A +#define GL_MAX_VARYING_FLOATS 0x8B4B +#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS 0x8B4C +#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS 0x8B4D +#define GL_SHADER_TYPE 0x8B4F +#define GL_FLOAT_VEC2 0x8B50 +#define GL_FLOAT_VEC3 0x8B51 +#define GL_FLOAT_VEC4 0x8B52 +#define GL_INT_VEC2 0x8B53 +#define GL_INT_VEC3 0x8B54 +#define GL_INT_VEC4 0x8B55 +#define GL_BOOL 0x8B56 +#define GL_BOOL_VEC2 0x8B57 +#define GL_BOOL_VEC3 0x8B58 +#define GL_BOOL_VEC4 0x8B59 +#define GL_FLOAT_MAT2 0x8B5A +#define GL_FLOAT_MAT3 0x8B5B +#define GL_FLOAT_MAT4 0x8B5C +#define GL_SAMPLER_1D 0x8B5D +#define GL_SAMPLER_2D 0x8B5E +#define GL_SAMPLER_3D 0x8B5F +#define GL_SAMPLER_CUBE 0x8B60 +#define GL_SAMPLER_1D_SHADOW 0x8B61 +#define GL_SAMPLER_2D_SHADOW 0x8B62 +#define GL_DELETE_STATUS 0x8B80 +#define GL_COMPILE_STATUS 0x8B81 +#define GL_LINK_STATUS 0x8B82 +#define GL_VALIDATE_STATUS 0x8B83 +#define GL_INFO_LOG_LENGTH 0x8B84 +#define GL_ATTACHED_SHADERS 0x8B85 +#define GL_ACTIVE_UNIFORMS 0x8B86 +#define GL_ACTIVE_UNIFORM_MAX_LENGTH 0x8B87 +#define GL_SHADER_SOURCE_LENGTH 0x8B88 +#define GL_ACTIVE_ATTRIBUTES 0x8B89 +#define GL_ACTIVE_ATTRIBUTE_MAX_LENGTH 0x8B8A +#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT 0x8B8B +#define GL_SHADING_LANGUAGE_VERSION 0x8B8C +#define GL_CURRENT_PROGRAM 0x8B8D +#define GL_POINT_SPRITE_COORD_ORIGIN 0x8CA0 +#define GL_LOWER_LEFT 0x8CA1 +#define GL_UPPER_LEFT 0x8CA2 +#define GL_STENCIL_BACK_REF 0x8CA3 +#define GL_STENCIL_BACK_VALUE_MASK 0x8CA4 +#define GL_STENCIL_BACK_WRITEMASK 0x8CA5 + +typedef void (GLAPIENTRY * PFNGLATTACHSHADERPROC) (GLuint program, GLuint shader); +typedef void (GLAPIENTRY * PFNGLBINDATTRIBLOCATIONPROC) (GLuint program, GLuint index, const GLchar* name); +typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONSEPARATEPROC) (GLenum, GLenum); +typedef void (GLAPIENTRY * PFNGLCOMPILESHADERPROC) (GLuint shader); +typedef GLuint (GLAPIENTRY * PFNGLCREATEPROGRAMPROC) (void); +typedef GLuint (GLAPIENTRY * PFNGLCREATESHADERPROC) (GLenum type); +typedef void (GLAPIENTRY * PFNGLDELETEPROGRAMPROC) (GLuint program); +typedef void (GLAPIENTRY * PFNGLDELETESHADERPROC) (GLuint shader); +typedef void (GLAPIENTRY * PFNGLDETACHSHADERPROC) (GLuint program, GLuint shader); +typedef void (GLAPIENTRY * PFNGLDISABLEVERTEXATTRIBARRAYPROC) (GLuint); +typedef void (GLAPIENTRY * PFNGLDRAWBUFFERSPROC) (GLsizei n, const GLenum* bufs); +typedef void (GLAPIENTRY * PFNGLENABLEVERTEXATTRIBARRAYPROC) (GLuint); +typedef void (GLAPIENTRY * PFNGLGETACTIVEATTRIBPROC) (GLuint program, GLuint index, GLsizei maxLength, GLsizei* length, GLint* size, GLenum* type, GLchar* name); +typedef void (GLAPIENTRY * PFNGLGETACTIVEUNIFORMPROC) (GLuint program, GLuint index, GLsizei maxLength, GLsizei* length, GLint* size, GLenum* type, GLchar* name); +typedef void (GLAPIENTRY * PFNGLGETATTACHEDSHADERSPROC) (GLuint program, GLsizei maxCount, GLsizei* count, GLuint* shaders); +typedef GLint (GLAPIENTRY * PFNGLGETATTRIBLOCATIONPROC) (GLuint program, const GLchar* name); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMINFOLOGPROC) (GLuint program, GLsizei bufSize, GLsizei* length, GLchar* infoLog); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMIVPROC) (GLuint program, GLenum pname, GLint* param); +typedef void (GLAPIENTRY * PFNGLGETSHADERINFOLOGPROC) (GLuint shader, GLsizei bufSize, GLsizei* length, GLchar* infoLog); +typedef void (GLAPIENTRY * PFNGLGETSHADERSOURCEPROC) (GLuint obj, GLsizei maxLength, GLsizei* length, GLchar* source); +typedef void (GLAPIENTRY * PFNGLGETSHADERIVPROC) (GLuint shader, GLenum pname, GLint* param); +typedef GLint (GLAPIENTRY * PFNGLGETUNIFORMLOCATIONPROC) (GLuint program, const GLchar* name); +typedef void (GLAPIENTRY * PFNGLGETUNIFORMFVPROC) (GLuint program, GLint location, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETUNIFORMIVPROC) (GLuint program, GLint location, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBPOINTERVPROC) (GLuint, GLenum, GLvoid**); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBDVPROC) (GLuint, GLenum, GLdouble*); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBFVPROC) (GLuint, GLenum, GLfloat*); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBIVPROC) (GLuint, GLenum, GLint*); +typedef GLboolean (GLAPIENTRY * PFNGLISPROGRAMPROC) (GLuint program); +typedef GLboolean (GLAPIENTRY * PFNGLISSHADERPROC) (GLuint shader); +typedef void (GLAPIENTRY * PFNGLLINKPROGRAMPROC) (GLuint program); +typedef void (GLAPIENTRY * PFNGLSHADERSOURCEPROC) (GLuint shader, GLsizei count, const GLchar** strings, const GLint* lengths); +typedef void (GLAPIENTRY * PFNGLSTENCILFUNCSEPARATEPROC) (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask); +typedef void (GLAPIENTRY * PFNGLSTENCILMASKSEPARATEPROC) (GLenum, GLuint); +typedef void (GLAPIENTRY * PFNGLSTENCILOPSEPARATEPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass); +typedef void (GLAPIENTRY * PFNGLUNIFORM1FPROC) (GLint location, GLfloat v0); +typedef void (GLAPIENTRY * PFNGLUNIFORM1FVPROC) (GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM1IPROC) (GLint location, GLint v0); +typedef void (GLAPIENTRY * PFNGLUNIFORM1IVPROC) (GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM2FPROC) (GLint location, GLfloat v0, GLfloat v1); +typedef void (GLAPIENTRY * PFNGLUNIFORM2FVPROC) (GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM2IPROC) (GLint location, GLint v0, GLint v1); +typedef void (GLAPIENTRY * PFNGLUNIFORM2IVPROC) (GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM3FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2); +typedef void (GLAPIENTRY * PFNGLUNIFORM3FVPROC) (GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM3IPROC) (GLint location, GLint v0, GLint v1, GLint v2); +typedef void (GLAPIENTRY * PFNGLUNIFORM3IVPROC) (GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM4FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); +typedef void (GLAPIENTRY * PFNGLUNIFORM4FVPROC) (GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM4IPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3); +typedef void (GLAPIENTRY * PFNGLUNIFORM4IVPROC) (GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUSEPROGRAMPROC) (GLuint program); +typedef void (GLAPIENTRY * PFNGLVALIDATEPROGRAMPROC) (GLuint program); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1DPROC) (GLuint index, GLdouble x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1DVPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1FPROC) (GLuint index, GLfloat x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1FVPROC) (GLuint index, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1SPROC) (GLuint index, GLshort x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1SVPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2DPROC) (GLuint index, GLdouble x, GLdouble y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2DVPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2FPROC) (GLuint index, GLfloat x, GLfloat y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2FVPROC) (GLuint index, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2SPROC) (GLuint index, GLshort x, GLshort y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2SVPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3DVPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3FVPROC) (GLuint index, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3SPROC) (GLuint index, GLshort x, GLshort y, GLshort z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3SVPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NBVPROC) (GLuint index, const GLbyte* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NIVPROC) (GLuint index, const GLint* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NSVPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUBPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUBVPROC) (GLuint index, const GLubyte* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUIVPROC) (GLuint index, const GLuint* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUSVPROC) (GLuint index, const GLushort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4BVPROC) (GLuint index, const GLbyte* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4DVPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4FVPROC) (GLuint index, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4IVPROC) (GLuint index, const GLint* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4SPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4SVPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4UBVPROC) (GLuint index, const GLubyte* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4UIVPROC) (GLuint index, const GLuint* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4USVPROC) (GLuint index, const GLushort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBPOINTERPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid* pointer); + +#define glAttachShader GLEW_GET_FUN(__glewAttachShader) +#define glBindAttribLocation GLEW_GET_FUN(__glewBindAttribLocation) +#define glBlendEquationSeparate GLEW_GET_FUN(__glewBlendEquationSeparate) +#define glCompileShader GLEW_GET_FUN(__glewCompileShader) +#define glCreateProgram GLEW_GET_FUN(__glewCreateProgram) +#define glCreateShader GLEW_GET_FUN(__glewCreateShader) +#define glDeleteProgram GLEW_GET_FUN(__glewDeleteProgram) +#define glDeleteShader GLEW_GET_FUN(__glewDeleteShader) +#define glDetachShader GLEW_GET_FUN(__glewDetachShader) +#define glDisableVertexAttribArray GLEW_GET_FUN(__glewDisableVertexAttribArray) +#define glDrawBuffers GLEW_GET_FUN(__glewDrawBuffers) +#define glEnableVertexAttribArray GLEW_GET_FUN(__glewEnableVertexAttribArray) +#define glGetActiveAttrib GLEW_GET_FUN(__glewGetActiveAttrib) +#define glGetActiveUniform GLEW_GET_FUN(__glewGetActiveUniform) +#define glGetAttachedShaders GLEW_GET_FUN(__glewGetAttachedShaders) +#define glGetAttribLocation GLEW_GET_FUN(__glewGetAttribLocation) +#define glGetProgramInfoLog GLEW_GET_FUN(__glewGetProgramInfoLog) +#define glGetProgramiv GLEW_GET_FUN(__glewGetProgramiv) +#define glGetShaderInfoLog GLEW_GET_FUN(__glewGetShaderInfoLog) +#define glGetShaderSource GLEW_GET_FUN(__glewGetShaderSource) +#define glGetShaderiv GLEW_GET_FUN(__glewGetShaderiv) +#define glGetUniformLocation GLEW_GET_FUN(__glewGetUniformLocation) +#define glGetUniformfv GLEW_GET_FUN(__glewGetUniformfv) +#define glGetUniformiv GLEW_GET_FUN(__glewGetUniformiv) +#define glGetVertexAttribPointerv GLEW_GET_FUN(__glewGetVertexAttribPointerv) +#define glGetVertexAttribdv GLEW_GET_FUN(__glewGetVertexAttribdv) +#define glGetVertexAttribfv GLEW_GET_FUN(__glewGetVertexAttribfv) +#define glGetVertexAttribiv GLEW_GET_FUN(__glewGetVertexAttribiv) +#define glIsProgram GLEW_GET_FUN(__glewIsProgram) +#define glIsShader GLEW_GET_FUN(__glewIsShader) +#define glLinkProgram GLEW_GET_FUN(__glewLinkProgram) +#define glShaderSource GLEW_GET_FUN(__glewShaderSource) +#define glStencilFuncSeparate GLEW_GET_FUN(__glewStencilFuncSeparate) +#define glStencilMaskSeparate GLEW_GET_FUN(__glewStencilMaskSeparate) +#define glStencilOpSeparate GLEW_GET_FUN(__glewStencilOpSeparate) +#define glUniform1f GLEW_GET_FUN(__glewUniform1f) +#define glUniform1fv GLEW_GET_FUN(__glewUniform1fv) +#define glUniform1i GLEW_GET_FUN(__glewUniform1i) +#define glUniform1iv GLEW_GET_FUN(__glewUniform1iv) +#define glUniform2f GLEW_GET_FUN(__glewUniform2f) +#define glUniform2fv GLEW_GET_FUN(__glewUniform2fv) +#define glUniform2i GLEW_GET_FUN(__glewUniform2i) +#define glUniform2iv GLEW_GET_FUN(__glewUniform2iv) +#define glUniform3f GLEW_GET_FUN(__glewUniform3f) +#define glUniform3fv GLEW_GET_FUN(__glewUniform3fv) +#define glUniform3i GLEW_GET_FUN(__glewUniform3i) +#define glUniform3iv GLEW_GET_FUN(__glewUniform3iv) +#define glUniform4f GLEW_GET_FUN(__glewUniform4f) +#define glUniform4fv GLEW_GET_FUN(__glewUniform4fv) +#define glUniform4i GLEW_GET_FUN(__glewUniform4i) +#define glUniform4iv GLEW_GET_FUN(__glewUniform4iv) +#define glUniformMatrix2fv GLEW_GET_FUN(__glewUniformMatrix2fv) +#define glUniformMatrix3fv GLEW_GET_FUN(__glewUniformMatrix3fv) +#define glUniformMatrix4fv GLEW_GET_FUN(__glewUniformMatrix4fv) +#define glUseProgram GLEW_GET_FUN(__glewUseProgram) +#define glValidateProgram GLEW_GET_FUN(__glewValidateProgram) +#define glVertexAttrib1d GLEW_GET_FUN(__glewVertexAttrib1d) +#define glVertexAttrib1dv GLEW_GET_FUN(__glewVertexAttrib1dv) +#define glVertexAttrib1f GLEW_GET_FUN(__glewVertexAttrib1f) +#define glVertexAttrib1fv GLEW_GET_FUN(__glewVertexAttrib1fv) +#define glVertexAttrib1s GLEW_GET_FUN(__glewVertexAttrib1s) +#define glVertexAttrib1sv GLEW_GET_FUN(__glewVertexAttrib1sv) +#define glVertexAttrib2d GLEW_GET_FUN(__glewVertexAttrib2d) +#define glVertexAttrib2dv GLEW_GET_FUN(__glewVertexAttrib2dv) +#define glVertexAttrib2f GLEW_GET_FUN(__glewVertexAttrib2f) +#define glVertexAttrib2fv GLEW_GET_FUN(__glewVertexAttrib2fv) +#define glVertexAttrib2s GLEW_GET_FUN(__glewVertexAttrib2s) +#define glVertexAttrib2sv GLEW_GET_FUN(__glewVertexAttrib2sv) +#define glVertexAttrib3d GLEW_GET_FUN(__glewVertexAttrib3d) +#define glVertexAttrib3dv GLEW_GET_FUN(__glewVertexAttrib3dv) +#define glVertexAttrib3f GLEW_GET_FUN(__glewVertexAttrib3f) +#define glVertexAttrib3fv GLEW_GET_FUN(__glewVertexAttrib3fv) +#define glVertexAttrib3s GLEW_GET_FUN(__glewVertexAttrib3s) +#define glVertexAttrib3sv GLEW_GET_FUN(__glewVertexAttrib3sv) +#define glVertexAttrib4Nbv GLEW_GET_FUN(__glewVertexAttrib4Nbv) +#define glVertexAttrib4Niv GLEW_GET_FUN(__glewVertexAttrib4Niv) +#define glVertexAttrib4Nsv GLEW_GET_FUN(__glewVertexAttrib4Nsv) +#define glVertexAttrib4Nub GLEW_GET_FUN(__glewVertexAttrib4Nub) +#define glVertexAttrib4Nubv GLEW_GET_FUN(__glewVertexAttrib4Nubv) +#define glVertexAttrib4Nuiv GLEW_GET_FUN(__glewVertexAttrib4Nuiv) +#define glVertexAttrib4Nusv GLEW_GET_FUN(__glewVertexAttrib4Nusv) +#define glVertexAttrib4bv GLEW_GET_FUN(__glewVertexAttrib4bv) +#define glVertexAttrib4d GLEW_GET_FUN(__glewVertexAttrib4d) +#define glVertexAttrib4dv GLEW_GET_FUN(__glewVertexAttrib4dv) +#define glVertexAttrib4f GLEW_GET_FUN(__glewVertexAttrib4f) +#define glVertexAttrib4fv GLEW_GET_FUN(__glewVertexAttrib4fv) +#define glVertexAttrib4iv GLEW_GET_FUN(__glewVertexAttrib4iv) +#define glVertexAttrib4s GLEW_GET_FUN(__glewVertexAttrib4s) +#define glVertexAttrib4sv GLEW_GET_FUN(__glewVertexAttrib4sv) +#define glVertexAttrib4ubv GLEW_GET_FUN(__glewVertexAttrib4ubv) +#define glVertexAttrib4uiv GLEW_GET_FUN(__glewVertexAttrib4uiv) +#define glVertexAttrib4usv GLEW_GET_FUN(__glewVertexAttrib4usv) +#define glVertexAttribPointer GLEW_GET_FUN(__glewVertexAttribPointer) + +#define GLEW_VERSION_2_0 GLEW_GET_VAR(__GLEW_VERSION_2_0) + +#endif /* GL_VERSION_2_0 */ + +/* ----------------------------- GL_VERSION_2_1 ---------------------------- */ + +#ifndef GL_VERSION_2_1 +#define GL_VERSION_2_1 1 + +#define GL_CURRENT_RASTER_SECONDARY_COLOR 0x845F +#define GL_PIXEL_PACK_BUFFER 0x88EB +#define GL_PIXEL_UNPACK_BUFFER 0x88EC +#define GL_PIXEL_PACK_BUFFER_BINDING 0x88ED +#define GL_PIXEL_UNPACK_BUFFER_BINDING 0x88EF +#define GL_FLOAT_MAT2x3 0x8B65 +#define GL_FLOAT_MAT2x4 0x8B66 +#define GL_FLOAT_MAT3x2 0x8B67 +#define GL_FLOAT_MAT3x4 0x8B68 +#define GL_FLOAT_MAT4x2 0x8B69 +#define GL_FLOAT_MAT4x3 0x8B6A +#define GL_SRGB 0x8C40 +#define GL_SRGB8 0x8C41 +#define GL_SRGB_ALPHA 0x8C42 +#define GL_SRGB8_ALPHA8 0x8C43 +#define GL_SLUMINANCE_ALPHA 0x8C44 +#define GL_SLUMINANCE8_ALPHA8 0x8C45 +#define GL_SLUMINANCE 0x8C46 +#define GL_SLUMINANCE8 0x8C47 +#define GL_COMPRESSED_SRGB 0x8C48 +#define GL_COMPRESSED_SRGB_ALPHA 0x8C49 +#define GL_COMPRESSED_SLUMINANCE 0x8C4A +#define GL_COMPRESSED_SLUMINANCE_ALPHA 0x8C4B + +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX2X3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX2X4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX3X2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX3X4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4X2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4X3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); + +#define glUniformMatrix2x3fv GLEW_GET_FUN(__glewUniformMatrix2x3fv) +#define glUniformMatrix2x4fv GLEW_GET_FUN(__glewUniformMatrix2x4fv) +#define glUniformMatrix3x2fv GLEW_GET_FUN(__glewUniformMatrix3x2fv) +#define glUniformMatrix3x4fv GLEW_GET_FUN(__glewUniformMatrix3x4fv) +#define glUniformMatrix4x2fv GLEW_GET_FUN(__glewUniformMatrix4x2fv) +#define glUniformMatrix4x3fv GLEW_GET_FUN(__glewUniformMatrix4x3fv) + +#define GLEW_VERSION_2_1 GLEW_GET_VAR(__GLEW_VERSION_2_1) + +#endif /* GL_VERSION_2_1 */ + +/* ----------------------------- GL_VERSION_3_0 ---------------------------- */ + +#ifndef GL_VERSION_3_0 +#define GL_VERSION_3_0 1 + +#define GL_MAX_CLIP_DISTANCES GL_MAX_CLIP_PLANES +#define GL_CLIP_DISTANCE5 GL_CLIP_PLANE5 +#define GL_CLIP_DISTANCE1 GL_CLIP_PLANE1 +#define GL_CLIP_DISTANCE3 GL_CLIP_PLANE3 +#define GL_COMPARE_REF_TO_TEXTURE GL_COMPARE_R_TO_TEXTURE_ARB +#define GL_CLIP_DISTANCE0 GL_CLIP_PLANE0 +#define GL_CLIP_DISTANCE4 GL_CLIP_PLANE4 +#define GL_CLIP_DISTANCE2 GL_CLIP_PLANE2 +#define GL_MAX_VARYING_COMPONENTS GL_MAX_VARYING_FLOATS +#define GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT 0x0001 +#define GL_MAJOR_VERSION 0x821B +#define GL_MINOR_VERSION 0x821C +#define GL_NUM_EXTENSIONS 0x821D +#define GL_CONTEXT_FLAGS 0x821E +#define GL_DEPTH_BUFFER 0x8223 +#define GL_STENCIL_BUFFER 0x8224 +#define GL_RGBA32F 0x8814 +#define GL_RGB32F 0x8815 +#define GL_RGBA16F 0x881A +#define GL_RGB16F 0x881B +#define GL_VERTEX_ATTRIB_ARRAY_INTEGER 0x88FD +#define GL_MAX_ARRAY_TEXTURE_LAYERS 0x88FF +#define GL_MIN_PROGRAM_TEXEL_OFFSET 0x8904 +#define GL_MAX_PROGRAM_TEXEL_OFFSET 0x8905 +#define GL_CLAMP_VERTEX_COLOR 0x891A +#define GL_CLAMP_FRAGMENT_COLOR 0x891B +#define GL_CLAMP_READ_COLOR 0x891C +#define GL_FIXED_ONLY 0x891D +#define GL_TEXTURE_RED_TYPE 0x8C10 +#define GL_TEXTURE_GREEN_TYPE 0x8C11 +#define GL_TEXTURE_BLUE_TYPE 0x8C12 +#define GL_TEXTURE_ALPHA_TYPE 0x8C13 +#define GL_TEXTURE_LUMINANCE_TYPE 0x8C14 +#define GL_TEXTURE_INTENSITY_TYPE 0x8C15 +#define GL_TEXTURE_DEPTH_TYPE 0x8C16 +#define GL_TEXTURE_1D_ARRAY 0x8C18 +#define GL_PROXY_TEXTURE_1D_ARRAY 0x8C19 +#define GL_TEXTURE_2D_ARRAY 0x8C1A +#define GL_PROXY_TEXTURE_2D_ARRAY 0x8C1B +#define GL_TEXTURE_BINDING_1D_ARRAY 0x8C1C +#define GL_TEXTURE_BINDING_2D_ARRAY 0x8C1D +#define GL_R11F_G11F_B10F 0x8C3A +#define GL_UNSIGNED_INT_10F_11F_11F_REV 0x8C3B +#define GL_RGB9_E5 0x8C3D +#define GL_UNSIGNED_INT_5_9_9_9_REV 0x8C3E +#define GL_TEXTURE_SHARED_SIZE 0x8C3F +#define GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH 0x8C76 +#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE 0x8C7F +#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS 0x8C80 +#define GL_TRANSFORM_FEEDBACK_VARYINGS 0x8C83 +#define GL_TRANSFORM_FEEDBACK_BUFFER_START 0x8C84 +#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE 0x8C85 +#define GL_PRIMITIVES_GENERATED 0x8C87 +#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN 0x8C88 +#define GL_RASTERIZER_DISCARD 0x8C89 +#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS 0x8C8A +#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS 0x8C8B +#define GL_INTERLEAVED_ATTRIBS 0x8C8C +#define GL_SEPARATE_ATTRIBS 0x8C8D +#define GL_TRANSFORM_FEEDBACK_BUFFER 0x8C8E +#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING 0x8C8F +#define GL_RGBA32UI 0x8D70 +#define GL_RGB32UI 0x8D71 +#define GL_RGBA16UI 0x8D76 +#define GL_RGB16UI 0x8D77 +#define GL_RGBA8UI 0x8D7C +#define GL_RGB8UI 0x8D7D +#define GL_RGBA32I 0x8D82 +#define GL_RGB32I 0x8D83 +#define GL_RGBA16I 0x8D88 +#define GL_RGB16I 0x8D89 +#define GL_RGBA8I 0x8D8E +#define GL_RGB8I 0x8D8F +#define GL_RED_INTEGER 0x8D94 +#define GL_GREEN_INTEGER 0x8D95 +#define GL_BLUE_INTEGER 0x8D96 +#define GL_ALPHA_INTEGER 0x8D97 +#define GL_RGB_INTEGER 0x8D98 +#define GL_RGBA_INTEGER 0x8D99 +#define GL_BGR_INTEGER 0x8D9A +#define GL_BGRA_INTEGER 0x8D9B +#define GL_SAMPLER_1D_ARRAY 0x8DC0 +#define GL_SAMPLER_2D_ARRAY 0x8DC1 +#define GL_SAMPLER_1D_ARRAY_SHADOW 0x8DC3 +#define GL_SAMPLER_2D_ARRAY_SHADOW 0x8DC4 +#define GL_SAMPLER_CUBE_SHADOW 0x8DC5 +#define GL_UNSIGNED_INT_VEC2 0x8DC6 +#define GL_UNSIGNED_INT_VEC3 0x8DC7 +#define GL_UNSIGNED_INT_VEC4 0x8DC8 +#define GL_INT_SAMPLER_1D 0x8DC9 +#define GL_INT_SAMPLER_2D 0x8DCA +#define GL_INT_SAMPLER_3D 0x8DCB +#define GL_INT_SAMPLER_CUBE 0x8DCC +#define GL_INT_SAMPLER_1D_ARRAY 0x8DCE +#define GL_INT_SAMPLER_2D_ARRAY 0x8DCF +#define GL_UNSIGNED_INT_SAMPLER_1D 0x8DD1 +#define GL_UNSIGNED_INT_SAMPLER_2D 0x8DD2 +#define GL_UNSIGNED_INT_SAMPLER_3D 0x8DD3 +#define GL_UNSIGNED_INT_SAMPLER_CUBE 0x8DD4 +#define GL_UNSIGNED_INT_SAMPLER_1D_ARRAY 0x8DD6 +#define GL_UNSIGNED_INT_SAMPLER_2D_ARRAY 0x8DD7 +#define GL_QUERY_WAIT 0x8E13 +#define GL_QUERY_NO_WAIT 0x8E14 +#define GL_QUERY_BY_REGION_WAIT 0x8E15 +#define GL_QUERY_BY_REGION_NO_WAIT 0x8E16 + +typedef void (GLAPIENTRY * PFNGLBEGINCONDITIONALRENDERPROC) (GLuint, GLenum); +typedef void (GLAPIENTRY * PFNGLBEGINTRANSFORMFEEDBACKPROC) (GLenum); +typedef void (GLAPIENTRY * PFNGLBINDFRAGDATALOCATIONPROC) (GLuint, GLuint, const GLchar*); +typedef void (GLAPIENTRY * PFNGLCLAMPCOLORPROC) (GLenum, GLenum); +typedef void (GLAPIENTRY * PFNGLCLEARBUFFERFIPROC) (GLenum, GLint, GLfloat, GLint); +typedef void (GLAPIENTRY * PFNGLCLEARBUFFERFVPROC) (GLenum, GLint, const GLfloat*); +typedef void (GLAPIENTRY * PFNGLCLEARBUFFERIVPROC) (GLenum, GLint, const GLint*); +typedef void (GLAPIENTRY * PFNGLCLEARBUFFERUIVPROC) (GLenum, GLint, const GLuint*); +typedef void (GLAPIENTRY * PFNGLCOLORMASKIPROC) (GLuint, GLboolean, GLboolean, GLboolean, GLboolean); +typedef void (GLAPIENTRY * PFNGLDISABLEIPROC) (GLenum, GLuint); +typedef void (GLAPIENTRY * PFNGLENABLEIPROC) (GLenum, GLuint); +typedef void (GLAPIENTRY * PFNGLENDCONDITIONALRENDERPROC) (void); +typedef void (GLAPIENTRY * PFNGLENDTRANSFORMFEEDBACKPROC) (void); +typedef void (GLAPIENTRY * PFNGLGETBOOLEANI_VPROC) (GLenum, GLuint, GLboolean*); +typedef GLint (GLAPIENTRY * PFNGLGETFRAGDATALOCATIONPROC) (GLuint, const GLchar*); +typedef const GLubyte* (GLAPIENTRY * PFNGLGETSTRINGIPROC) (GLenum, GLuint); +typedef void (GLAPIENTRY * PFNGLGETTEXPARAMETERIIVPROC) (GLenum, GLenum, GLint*); +typedef void (GLAPIENTRY * PFNGLGETTEXPARAMETERIUIVPROC) (GLenum, GLenum, GLuint*); +typedef void (GLAPIENTRY * PFNGLGETTRANSFORMFEEDBACKVARYINGPROC) (GLuint, GLuint, GLsizei, GLsizei *, GLsizei *, GLenum *, GLchar *); +typedef void (GLAPIENTRY * PFNGLGETUNIFORMUIVPROC) (GLuint, GLint, GLuint*); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBIIVPROC) (GLuint, GLenum, GLint*); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBIUIVPROC) (GLuint, GLenum, GLuint*); +typedef GLboolean (GLAPIENTRY * PFNGLISENABLEDIPROC) (GLenum, GLuint); +typedef void (GLAPIENTRY * PFNGLTEXPARAMETERIIVPROC) (GLenum, GLenum, const GLint*); +typedef void (GLAPIENTRY * PFNGLTEXPARAMETERIUIVPROC) (GLenum, GLenum, const GLuint*); +typedef void (GLAPIENTRY * PFNGLTRANSFORMFEEDBACKVARYINGSPROC) (GLuint, GLsizei, const GLchar **, GLenum); +typedef void (GLAPIENTRY * PFNGLUNIFORM1UIPROC) (GLint, GLuint); +typedef void (GLAPIENTRY * PFNGLUNIFORM1UIVPROC) (GLint, GLsizei, const GLuint*); +typedef void (GLAPIENTRY * PFNGLUNIFORM2UIPROC) (GLint, GLuint, GLuint); +typedef void (GLAPIENTRY * PFNGLUNIFORM2UIVPROC) (GLint, GLsizei, const GLuint*); +typedef void (GLAPIENTRY * PFNGLUNIFORM3UIPROC) (GLint, GLuint, GLuint, GLuint); +typedef void (GLAPIENTRY * PFNGLUNIFORM3UIVPROC) (GLint, GLsizei, const GLuint*); +typedef void (GLAPIENTRY * PFNGLUNIFORM4UIPROC) (GLint, GLuint, GLuint, GLuint, GLuint); +typedef void (GLAPIENTRY * PFNGLUNIFORM4UIVPROC) (GLint, GLsizei, const GLuint*); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1IPROC) (GLuint, GLint); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1IVPROC) (GLuint, const GLint*); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1UIPROC) (GLuint, GLuint); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1UIVPROC) (GLuint, const GLuint*); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2IPROC) (GLuint, GLint, GLint); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2IVPROC) (GLuint, const GLint*); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2UIPROC) (GLuint, GLuint, GLuint); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2UIVPROC) (GLuint, const GLuint*); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3IPROC) (GLuint, GLint, GLint, GLint); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3IVPROC) (GLuint, const GLint*); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3UIPROC) (GLuint, GLuint, GLuint, GLuint); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3UIVPROC) (GLuint, const GLuint*); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4BVPROC) (GLuint, const GLbyte*); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4IPROC) (GLuint, GLint, GLint, GLint, GLint); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4IVPROC) (GLuint, const GLint*); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4SVPROC) (GLuint, const GLshort*); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4UBVPROC) (GLuint, const GLubyte*); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4UIPROC) (GLuint, GLuint, GLuint, GLuint, GLuint); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4UIVPROC) (GLuint, const GLuint*); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4USVPROC) (GLuint, const GLushort*); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBIPOINTERPROC) (GLuint, GLint, GLenum, GLsizei, const GLvoid*); + +#define glBeginConditionalRender GLEW_GET_FUN(__glewBeginConditionalRender) +#define glBeginTransformFeedback GLEW_GET_FUN(__glewBeginTransformFeedback) +#define glBindFragDataLocation GLEW_GET_FUN(__glewBindFragDataLocation) +#define glClampColor GLEW_GET_FUN(__glewClampColor) +#define glClearBufferfi GLEW_GET_FUN(__glewClearBufferfi) +#define glClearBufferfv GLEW_GET_FUN(__glewClearBufferfv) +#define glClearBufferiv GLEW_GET_FUN(__glewClearBufferiv) +#define glClearBufferuiv GLEW_GET_FUN(__glewClearBufferuiv) +#define glColorMaski GLEW_GET_FUN(__glewColorMaski) +#define glDisablei GLEW_GET_FUN(__glewDisablei) +#define glEnablei GLEW_GET_FUN(__glewEnablei) +#define glEndConditionalRender GLEW_GET_FUN(__glewEndConditionalRender) +#define glEndTransformFeedback GLEW_GET_FUN(__glewEndTransformFeedback) +#define glGetBooleani_v GLEW_GET_FUN(__glewGetBooleani_v) +#define glGetFragDataLocation GLEW_GET_FUN(__glewGetFragDataLocation) +#define glGetStringi GLEW_GET_FUN(__glewGetStringi) +#define glGetTexParameterIiv GLEW_GET_FUN(__glewGetTexParameterIiv) +#define glGetTexParameterIuiv GLEW_GET_FUN(__glewGetTexParameterIuiv) +#define glGetTransformFeedbackVarying GLEW_GET_FUN(__glewGetTransformFeedbackVarying) +#define glGetUniformuiv GLEW_GET_FUN(__glewGetUniformuiv) +#define glGetVertexAttribIiv GLEW_GET_FUN(__glewGetVertexAttribIiv) +#define glGetVertexAttribIuiv GLEW_GET_FUN(__glewGetVertexAttribIuiv) +#define glIsEnabledi GLEW_GET_FUN(__glewIsEnabledi) +#define glTexParameterIiv GLEW_GET_FUN(__glewTexParameterIiv) +#define glTexParameterIuiv GLEW_GET_FUN(__glewTexParameterIuiv) +#define glTransformFeedbackVaryings GLEW_GET_FUN(__glewTransformFeedbackVaryings) +#define glUniform1ui GLEW_GET_FUN(__glewUniform1ui) +#define glUniform1uiv GLEW_GET_FUN(__glewUniform1uiv) +#define glUniform2ui GLEW_GET_FUN(__glewUniform2ui) +#define glUniform2uiv GLEW_GET_FUN(__glewUniform2uiv) +#define glUniform3ui GLEW_GET_FUN(__glewUniform3ui) +#define glUniform3uiv GLEW_GET_FUN(__glewUniform3uiv) +#define glUniform4ui GLEW_GET_FUN(__glewUniform4ui) +#define glUniform4uiv GLEW_GET_FUN(__glewUniform4uiv) +#define glVertexAttribI1i GLEW_GET_FUN(__glewVertexAttribI1i) +#define glVertexAttribI1iv GLEW_GET_FUN(__glewVertexAttribI1iv) +#define glVertexAttribI1ui GLEW_GET_FUN(__glewVertexAttribI1ui) +#define glVertexAttribI1uiv GLEW_GET_FUN(__glewVertexAttribI1uiv) +#define glVertexAttribI2i GLEW_GET_FUN(__glewVertexAttribI2i) +#define glVertexAttribI2iv GLEW_GET_FUN(__glewVertexAttribI2iv) +#define glVertexAttribI2ui GLEW_GET_FUN(__glewVertexAttribI2ui) +#define glVertexAttribI2uiv GLEW_GET_FUN(__glewVertexAttribI2uiv) +#define glVertexAttribI3i GLEW_GET_FUN(__glewVertexAttribI3i) +#define glVertexAttribI3iv GLEW_GET_FUN(__glewVertexAttribI3iv) +#define glVertexAttribI3ui GLEW_GET_FUN(__glewVertexAttribI3ui) +#define glVertexAttribI3uiv GLEW_GET_FUN(__glewVertexAttribI3uiv) +#define glVertexAttribI4bv GLEW_GET_FUN(__glewVertexAttribI4bv) +#define glVertexAttribI4i GLEW_GET_FUN(__glewVertexAttribI4i) +#define glVertexAttribI4iv GLEW_GET_FUN(__glewVertexAttribI4iv) +#define glVertexAttribI4sv GLEW_GET_FUN(__glewVertexAttribI4sv) +#define glVertexAttribI4ubv GLEW_GET_FUN(__glewVertexAttribI4ubv) +#define glVertexAttribI4ui GLEW_GET_FUN(__glewVertexAttribI4ui) +#define glVertexAttribI4uiv GLEW_GET_FUN(__glewVertexAttribI4uiv) +#define glVertexAttribI4usv GLEW_GET_FUN(__glewVertexAttribI4usv) +#define glVertexAttribIPointer GLEW_GET_FUN(__glewVertexAttribIPointer) + +#define GLEW_VERSION_3_0 GLEW_GET_VAR(__GLEW_VERSION_3_0) + +#endif /* GL_VERSION_3_0 */ + +/* ----------------------------- GL_VERSION_3_1 ---------------------------- */ + +#ifndef GL_VERSION_3_1 +#define GL_VERSION_3_1 1 + +#define GL_TEXTURE_RECTANGLE 0x84F5 +#define GL_TEXTURE_BINDING_RECTANGLE 0x84F6 +#define GL_PROXY_TEXTURE_RECTANGLE 0x84F7 +#define GL_MAX_RECTANGLE_TEXTURE_SIZE 0x84F8 +#define GL_SAMPLER_2D_RECT 0x8B63 +#define GL_SAMPLER_2D_RECT_SHADOW 0x8B64 +#define GL_TEXTURE_BUFFER 0x8C2A +#define GL_MAX_TEXTURE_BUFFER_SIZE 0x8C2B +#define GL_TEXTURE_BINDING_BUFFER 0x8C2C +#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING 0x8C2D +#define GL_TEXTURE_BUFFER_FORMAT 0x8C2E +#define GL_SAMPLER_BUFFER 0x8DC2 +#define GL_INT_SAMPLER_2D_RECT 0x8DCD +#define GL_INT_SAMPLER_BUFFER 0x8DD0 +#define GL_UNSIGNED_INT_SAMPLER_2D_RECT 0x8DD5 +#define GL_UNSIGNED_INT_SAMPLER_BUFFER 0x8DD8 +#define GL_RED_SNORM 0x8F90 +#define GL_RG_SNORM 0x8F91 +#define GL_RGB_SNORM 0x8F92 +#define GL_RGBA_SNORM 0x8F93 +#define GL_R8_SNORM 0x8F94 +#define GL_RG8_SNORM 0x8F95 +#define GL_RGB8_SNORM 0x8F96 +#define GL_RGBA8_SNORM 0x8F97 +#define GL_R16_SNORM 0x8F98 +#define GL_RG16_SNORM 0x8F99 +#define GL_RGB16_SNORM 0x8F9A +#define GL_RGBA16_SNORM 0x8F9B +#define GL_SIGNED_NORMALIZED 0x8F9C +#define GL_PRIMITIVE_RESTART 0x8F9D +#define GL_PRIMITIVE_RESTART_INDEX 0x8F9E +#define GL_BUFFER_ACCESS_FLAGS 0x911F +#define GL_BUFFER_MAP_LENGTH 0x9120 +#define GL_BUFFER_MAP_OFFSET 0x9121 + +typedef void (GLAPIENTRY * PFNGLDRAWARRAYSINSTANCEDPROC) (GLenum, GLint, GLsizei, GLsizei); +typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDPROC) (GLenum, GLsizei, GLenum, const GLvoid*, GLsizei); +typedef void (GLAPIENTRY * PFNGLPRIMITIVERESTARTINDEXPROC) (GLuint); +typedef void (GLAPIENTRY * PFNGLTEXBUFFERPROC) (GLenum, GLenum, GLuint); + +#define glDrawArraysInstanced GLEW_GET_FUN(__glewDrawArraysInstanced) +#define glDrawElementsInstanced GLEW_GET_FUN(__glewDrawElementsInstanced) +#define glPrimitiveRestartIndex GLEW_GET_FUN(__glewPrimitiveRestartIndex) +#define glTexBuffer GLEW_GET_FUN(__glewTexBuffer) + +#define GLEW_VERSION_3_1 GLEW_GET_VAR(__GLEW_VERSION_3_1) + +#endif /* GL_VERSION_3_1 */ + +/* ----------------------------- GL_VERSION_3_2 ---------------------------- */ + +#ifndef GL_VERSION_3_2 +#define GL_VERSION_3_2 1 + +#define GL_CONTEXT_CORE_PROFILE_BIT 0x00000001 +#define GL_CONTEXT_COMPATIBILITY_PROFILE_BIT 0x00000002 +#define GL_LINES_ADJACENCY 0x000A +#define GL_LINE_STRIP_ADJACENCY 0x000B +#define GL_TRIANGLES_ADJACENCY 0x000C +#define GL_TRIANGLE_STRIP_ADJACENCY 0x000D +#define GL_PROGRAM_POINT_SIZE 0x8642 +#define GL_GEOMETRY_VERTICES_OUT 0x8916 +#define GL_GEOMETRY_INPUT_TYPE 0x8917 +#define GL_GEOMETRY_OUTPUT_TYPE 0x8918 +#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS 0x8C29 +#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED 0x8DA7 +#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS 0x8DA8 +#define GL_GEOMETRY_SHADER 0x8DD9 +#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS 0x8DDF +#define GL_MAX_GEOMETRY_OUTPUT_VERTICES 0x8DE0 +#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS 0x8DE1 +#define GL_MAX_VERTEX_OUTPUT_COMPONENTS 0x9122 +#define GL_MAX_GEOMETRY_INPUT_COMPONENTS 0x9123 +#define GL_MAX_GEOMETRY_OUTPUT_COMPONENTS 0x9124 +#define GL_MAX_FRAGMENT_INPUT_COMPONENTS 0x9125 +#define GL_CONTEXT_PROFILE_MASK 0x9126 + +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTUREPROC) (GLenum, GLenum, GLuint, GLint); +typedef void (GLAPIENTRY * PFNGLGETBUFFERPARAMETERI64VPROC) (GLenum, GLenum, GLint64 *); +typedef void (GLAPIENTRY * PFNGLGETINTEGER64I_VPROC) (GLenum, GLuint, GLint64 *); + +#define glFramebufferTexture GLEW_GET_FUN(__glewFramebufferTexture) +#define glGetBufferParameteri64v GLEW_GET_FUN(__glewGetBufferParameteri64v) +#define glGetInteger64i_v GLEW_GET_FUN(__glewGetInteger64i_v) + +#define GLEW_VERSION_3_2 GLEW_GET_VAR(__GLEW_VERSION_3_2) + +#endif /* GL_VERSION_3_2 */ + +/* ----------------------------- GL_VERSION_3_3 ---------------------------- */ + +#ifndef GL_VERSION_3_3 +#define GL_VERSION_3_3 1 + +#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR 0x88FE +#define GL_RGB10_A2UI 0x906F + +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBDIVISORPROC) (GLuint index, GLuint divisor); + +#define glVertexAttribDivisor GLEW_GET_FUN(__glewVertexAttribDivisor) + +#define GLEW_VERSION_3_3 GLEW_GET_VAR(__GLEW_VERSION_3_3) + +#endif /* GL_VERSION_3_3 */ + +/* ----------------------------- GL_VERSION_4_0 ---------------------------- */ + +#ifndef GL_VERSION_4_0 +#define GL_VERSION_4_0 1 + +#define GL_SAMPLE_SHADING 0x8C36 +#define GL_MIN_SAMPLE_SHADING_VALUE 0x8C37 +#define GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET 0x8E5E +#define GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET 0x8E5F +#define GL_MAX_PROGRAM_TEXTURE_GATHER_COMPONENTS 0x8F9F +#define GL_TEXTURE_CUBE_MAP_ARRAY 0x9009 +#define GL_TEXTURE_BINDING_CUBE_MAP_ARRAY 0x900A +#define GL_PROXY_TEXTURE_CUBE_MAP_ARRAY 0x900B +#define GL_SAMPLER_CUBE_MAP_ARRAY 0x900C +#define GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW 0x900D +#define GL_INT_SAMPLER_CUBE_MAP_ARRAY 0x900E +#define GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY 0x900F + +typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONSEPARATEIPROC) (GLuint buf, GLenum modeRGB, GLenum modeAlpha); +typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONIPROC) (GLuint buf, GLenum mode); +typedef void (GLAPIENTRY * PFNGLBLENDFUNCSEPARATEIPROC) (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); +typedef void (GLAPIENTRY * PFNGLBLENDFUNCIPROC) (GLuint buf, GLenum src, GLenum dst); +typedef void (GLAPIENTRY * PFNGLMINSAMPLESHADINGPROC) (GLclampf value); + +#define glBlendEquationSeparatei GLEW_GET_FUN(__glewBlendEquationSeparatei) +#define glBlendEquationi GLEW_GET_FUN(__glewBlendEquationi) +#define glBlendFuncSeparatei GLEW_GET_FUN(__glewBlendFuncSeparatei) +#define glBlendFunci GLEW_GET_FUN(__glewBlendFunci) +#define glMinSampleShading GLEW_GET_FUN(__glewMinSampleShading) + +#define GLEW_VERSION_4_0 GLEW_GET_VAR(__GLEW_VERSION_4_0) + +#endif /* GL_VERSION_4_0 */ + +/* ----------------------------- GL_VERSION_4_1 ---------------------------- */ + +#ifndef GL_VERSION_4_1 +#define GL_VERSION_4_1 1 + +#define GLEW_VERSION_4_1 GLEW_GET_VAR(__GLEW_VERSION_4_1) + +#endif /* GL_VERSION_4_1 */ + +/* ----------------------------- GL_VERSION_4_2 ---------------------------- */ + +#ifndef GL_VERSION_4_2 +#define GL_VERSION_4_2 1 + +#define GL_COMPRESSED_RGBA_BPTC_UNORM 0x8E8C +#define GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM 0x8E8D +#define GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT 0x8E8E +#define GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT 0x8E8F + +#define GLEW_VERSION_4_2 GLEW_GET_VAR(__GLEW_VERSION_4_2) + +#endif /* GL_VERSION_4_2 */ + +/* ----------------------------- GL_VERSION_4_3 ---------------------------- */ + +#ifndef GL_VERSION_4_3 +#define GL_VERSION_4_3 1 + +#define GL_NUM_SHADING_LANGUAGE_VERSIONS 0x82E9 +#define GL_VERTEX_ATTRIB_ARRAY_LONG 0x874E + +#define GLEW_VERSION_4_3 GLEW_GET_VAR(__GLEW_VERSION_4_3) + +#endif /* GL_VERSION_4_3 */ + +/* ----------------------------- GL_VERSION_4_4 ---------------------------- */ + +#ifndef GL_VERSION_4_4 +#define GL_VERSION_4_4 1 + +#define GL_MAX_VERTEX_ATTRIB_STRIDE 0x82E5 + +#define GLEW_VERSION_4_4 GLEW_GET_VAR(__GLEW_VERSION_4_4) + +#endif /* GL_VERSION_4_4 */ + +/* -------------------------- GL_3DFX_multisample -------------------------- */ + +#ifndef GL_3DFX_multisample +#define GL_3DFX_multisample 1 + +#define GL_MULTISAMPLE_3DFX 0x86B2 +#define GL_SAMPLE_BUFFERS_3DFX 0x86B3 +#define GL_SAMPLES_3DFX 0x86B4 +#define GL_MULTISAMPLE_BIT_3DFX 0x20000000 + +#define GLEW_3DFX_multisample GLEW_GET_VAR(__GLEW_3DFX_multisample) + +#endif /* GL_3DFX_multisample */ + +/* ---------------------------- GL_3DFX_tbuffer ---------------------------- */ + +#ifndef GL_3DFX_tbuffer +#define GL_3DFX_tbuffer 1 + +typedef void (GLAPIENTRY * PFNGLTBUFFERMASK3DFXPROC) (GLuint mask); + +#define glTbufferMask3DFX GLEW_GET_FUN(__glewTbufferMask3DFX) + +#define GLEW_3DFX_tbuffer GLEW_GET_VAR(__GLEW_3DFX_tbuffer) + +#endif /* GL_3DFX_tbuffer */ + +/* -------------------- GL_3DFX_texture_compression_FXT1 ------------------- */ + +#ifndef GL_3DFX_texture_compression_FXT1 +#define GL_3DFX_texture_compression_FXT1 1 + +#define GL_COMPRESSED_RGB_FXT1_3DFX 0x86B0 +#define GL_COMPRESSED_RGBA_FXT1_3DFX 0x86B1 + +#define GLEW_3DFX_texture_compression_FXT1 GLEW_GET_VAR(__GLEW_3DFX_texture_compression_FXT1) + +#endif /* GL_3DFX_texture_compression_FXT1 */ + +/* ----------------------- GL_AMD_blend_minmax_factor ---------------------- */ + +#ifndef GL_AMD_blend_minmax_factor +#define GL_AMD_blend_minmax_factor 1 + +#define GL_FACTOR_MIN_AMD 0x901C +#define GL_FACTOR_MAX_AMD 0x901D + +#define GLEW_AMD_blend_minmax_factor GLEW_GET_VAR(__GLEW_AMD_blend_minmax_factor) + +#endif /* GL_AMD_blend_minmax_factor */ + +/* ----------------------- GL_AMD_conservative_depth ----------------------- */ + +#ifndef GL_AMD_conservative_depth +#define GL_AMD_conservative_depth 1 + +#define GLEW_AMD_conservative_depth GLEW_GET_VAR(__GLEW_AMD_conservative_depth) + +#endif /* GL_AMD_conservative_depth */ + +/* -------------------------- GL_AMD_debug_output -------------------------- */ + +#ifndef GL_AMD_debug_output +#define GL_AMD_debug_output 1 + +#define GL_MAX_DEBUG_MESSAGE_LENGTH_AMD 0x9143 +#define GL_MAX_DEBUG_LOGGED_MESSAGES_AMD 0x9144 +#define GL_DEBUG_LOGGED_MESSAGES_AMD 0x9145 +#define GL_DEBUG_SEVERITY_HIGH_AMD 0x9146 +#define GL_DEBUG_SEVERITY_MEDIUM_AMD 0x9147 +#define GL_DEBUG_SEVERITY_LOW_AMD 0x9148 +#define GL_DEBUG_CATEGORY_API_ERROR_AMD 0x9149 +#define GL_DEBUG_CATEGORY_WINDOW_SYSTEM_AMD 0x914A +#define GL_DEBUG_CATEGORY_DEPRECATION_AMD 0x914B +#define GL_DEBUG_CATEGORY_UNDEFINED_BEHAVIOR_AMD 0x914C +#define GL_DEBUG_CATEGORY_PERFORMANCE_AMD 0x914D +#define GL_DEBUG_CATEGORY_SHADER_COMPILER_AMD 0x914E +#define GL_DEBUG_CATEGORY_APPLICATION_AMD 0x914F +#define GL_DEBUG_CATEGORY_OTHER_AMD 0x9150 + +typedef void (APIENTRY *GLDEBUGPROCAMD)(GLuint id, GLenum category, GLenum severity, GLsizei length, const GLchar* message, GLvoid* userParam); + +typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGECALLBACKAMDPROC) (GLDEBUGPROCAMD callback, GLvoid *userParam); +typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGEENABLEAMDPROC) (GLenum category, GLenum severity, GLsizei count, const GLuint* ids, GLboolean enabled); +typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGEINSERTAMDPROC) (GLenum category, GLenum severity, GLuint id, GLsizei length, const GLchar* buf); +typedef GLuint (GLAPIENTRY * PFNGLGETDEBUGMESSAGELOGAMDPROC) (GLuint count, GLsizei bufsize, GLenum* categories, GLuint* severities, GLuint* ids, GLsizei* lengths, GLchar* message); + +#define glDebugMessageCallbackAMD GLEW_GET_FUN(__glewDebugMessageCallbackAMD) +#define glDebugMessageEnableAMD GLEW_GET_FUN(__glewDebugMessageEnableAMD) +#define glDebugMessageInsertAMD GLEW_GET_FUN(__glewDebugMessageInsertAMD) +#define glGetDebugMessageLogAMD GLEW_GET_FUN(__glewGetDebugMessageLogAMD) + +#define GLEW_AMD_debug_output GLEW_GET_VAR(__GLEW_AMD_debug_output) + +#endif /* GL_AMD_debug_output */ + +/* ---------------------- GL_AMD_depth_clamp_separate ---------------------- */ + +#ifndef GL_AMD_depth_clamp_separate +#define GL_AMD_depth_clamp_separate 1 + +#define GL_DEPTH_CLAMP_NEAR_AMD 0x901E +#define GL_DEPTH_CLAMP_FAR_AMD 0x901F + +#define GLEW_AMD_depth_clamp_separate GLEW_GET_VAR(__GLEW_AMD_depth_clamp_separate) + +#endif /* GL_AMD_depth_clamp_separate */ + +/* ----------------------- GL_AMD_draw_buffers_blend ----------------------- */ + +#ifndef GL_AMD_draw_buffers_blend +#define GL_AMD_draw_buffers_blend 1 + +typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONINDEXEDAMDPROC) (GLuint buf, GLenum mode); +typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONSEPARATEINDEXEDAMDPROC) (GLuint buf, GLenum modeRGB, GLenum modeAlpha); +typedef void (GLAPIENTRY * PFNGLBLENDFUNCINDEXEDAMDPROC) (GLuint buf, GLenum src, GLenum dst); +typedef void (GLAPIENTRY * PFNGLBLENDFUNCSEPARATEINDEXEDAMDPROC) (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); + +#define glBlendEquationIndexedAMD GLEW_GET_FUN(__glewBlendEquationIndexedAMD) +#define glBlendEquationSeparateIndexedAMD GLEW_GET_FUN(__glewBlendEquationSeparateIndexedAMD) +#define glBlendFuncIndexedAMD GLEW_GET_FUN(__glewBlendFuncIndexedAMD) +#define glBlendFuncSeparateIndexedAMD GLEW_GET_FUN(__glewBlendFuncSeparateIndexedAMD) + +#define GLEW_AMD_draw_buffers_blend GLEW_GET_VAR(__GLEW_AMD_draw_buffers_blend) + +#endif /* GL_AMD_draw_buffers_blend */ + +/* ---------------------- GL_AMD_interleaved_elements ---------------------- */ + +#ifndef GL_AMD_interleaved_elements +#define GL_AMD_interleaved_elements 1 + +#define GL_RED 0x1903 +#define GL_GREEN 0x1904 +#define GL_BLUE 0x1905 +#define GL_ALPHA 0x1906 +#define GL_RG8UI 0x8238 +#define GL_RG16UI 0x823A +#define GL_RGBA8UI 0x8D7C +#define GL_VERTEX_ELEMENT_SWIZZLE_AMD 0x91A4 +#define GL_VERTEX_ID_SWIZZLE_AMD 0x91A5 + +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBPARAMETERIAMDPROC) (GLuint index, GLenum pname, GLint param); + +#define glVertexAttribParameteriAMD GLEW_GET_FUN(__glewVertexAttribParameteriAMD) + +#define GLEW_AMD_interleaved_elements GLEW_GET_VAR(__GLEW_AMD_interleaved_elements) + +#endif /* GL_AMD_interleaved_elements */ + +/* ----------------------- GL_AMD_multi_draw_indirect ---------------------- */ + +#ifndef GL_AMD_multi_draw_indirect +#define GL_AMD_multi_draw_indirect 1 + +typedef void (GLAPIENTRY * PFNGLMULTIDRAWARRAYSINDIRECTAMDPROC) (GLenum mode, const GLvoid *indirect, GLsizei primcount, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSINDIRECTAMDPROC) (GLenum mode, GLenum type, const GLvoid *indirect, GLsizei primcount, GLsizei stride); + +#define glMultiDrawArraysIndirectAMD GLEW_GET_FUN(__glewMultiDrawArraysIndirectAMD) +#define glMultiDrawElementsIndirectAMD GLEW_GET_FUN(__glewMultiDrawElementsIndirectAMD) + +#define GLEW_AMD_multi_draw_indirect GLEW_GET_VAR(__GLEW_AMD_multi_draw_indirect) + +#endif /* GL_AMD_multi_draw_indirect */ + +/* ------------------------- GL_AMD_name_gen_delete ------------------------ */ + +#ifndef GL_AMD_name_gen_delete +#define GL_AMD_name_gen_delete 1 + +#define GL_DATA_BUFFER_AMD 0x9151 +#define GL_PERFORMANCE_MONITOR_AMD 0x9152 +#define GL_QUERY_OBJECT_AMD 0x9153 +#define GL_VERTEX_ARRAY_OBJECT_AMD 0x9154 +#define GL_SAMPLER_OBJECT_AMD 0x9155 + +typedef void (GLAPIENTRY * PFNGLDELETENAMESAMDPROC) (GLenum identifier, GLuint num, const GLuint* names); +typedef void (GLAPIENTRY * PFNGLGENNAMESAMDPROC) (GLenum identifier, GLuint num, GLuint* names); +typedef GLboolean (GLAPIENTRY * PFNGLISNAMEAMDPROC) (GLenum identifier, GLuint name); + +#define glDeleteNamesAMD GLEW_GET_FUN(__glewDeleteNamesAMD) +#define glGenNamesAMD GLEW_GET_FUN(__glewGenNamesAMD) +#define glIsNameAMD GLEW_GET_FUN(__glewIsNameAMD) + +#define GLEW_AMD_name_gen_delete GLEW_GET_VAR(__GLEW_AMD_name_gen_delete) + +#endif /* GL_AMD_name_gen_delete */ + +/* ----------------------- GL_AMD_performance_monitor ---------------------- */ + +#ifndef GL_AMD_performance_monitor +#define GL_AMD_performance_monitor 1 + +#define GL_COUNTER_TYPE_AMD 0x8BC0 +#define GL_COUNTER_RANGE_AMD 0x8BC1 +#define GL_UNSIGNED_INT64_AMD 0x8BC2 +#define GL_PERCENTAGE_AMD 0x8BC3 +#define GL_PERFMON_RESULT_AVAILABLE_AMD 0x8BC4 +#define GL_PERFMON_RESULT_SIZE_AMD 0x8BC5 +#define GL_PERFMON_RESULT_AMD 0x8BC6 + +typedef void (GLAPIENTRY * PFNGLBEGINPERFMONITORAMDPROC) (GLuint monitor); +typedef void (GLAPIENTRY * PFNGLDELETEPERFMONITORSAMDPROC) (GLsizei n, GLuint* monitors); +typedef void (GLAPIENTRY * PFNGLENDPERFMONITORAMDPROC) (GLuint monitor); +typedef void (GLAPIENTRY * PFNGLGENPERFMONITORSAMDPROC) (GLsizei n, GLuint* monitors); +typedef void (GLAPIENTRY * PFNGLGETPERFMONITORCOUNTERDATAAMDPROC) (GLuint monitor, GLenum pname, GLsizei dataSize, GLuint* data, GLint *bytesWritten); +typedef void (GLAPIENTRY * PFNGLGETPERFMONITORCOUNTERINFOAMDPROC) (GLuint group, GLuint counter, GLenum pname, GLvoid *data); +typedef void (GLAPIENTRY * PFNGLGETPERFMONITORCOUNTERSTRINGAMDPROC) (GLuint group, GLuint counter, GLsizei bufSize, GLsizei* length, GLchar *counterString); +typedef void (GLAPIENTRY * PFNGLGETPERFMONITORCOUNTERSAMDPROC) (GLuint group, GLint* numCounters, GLint *maxActiveCounters, GLsizei countersSize, GLuint *counters); +typedef void (GLAPIENTRY * PFNGLGETPERFMONITORGROUPSTRINGAMDPROC) (GLuint group, GLsizei bufSize, GLsizei* length, GLchar *groupString); +typedef void (GLAPIENTRY * PFNGLGETPERFMONITORGROUPSAMDPROC) (GLint* numGroups, GLsizei groupsSize, GLuint *groups); +typedef void (GLAPIENTRY * PFNGLSELECTPERFMONITORCOUNTERSAMDPROC) (GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint* counterList); + +#define glBeginPerfMonitorAMD GLEW_GET_FUN(__glewBeginPerfMonitorAMD) +#define glDeletePerfMonitorsAMD GLEW_GET_FUN(__glewDeletePerfMonitorsAMD) +#define glEndPerfMonitorAMD GLEW_GET_FUN(__glewEndPerfMonitorAMD) +#define glGenPerfMonitorsAMD GLEW_GET_FUN(__glewGenPerfMonitorsAMD) +#define glGetPerfMonitorCounterDataAMD GLEW_GET_FUN(__glewGetPerfMonitorCounterDataAMD) +#define glGetPerfMonitorCounterInfoAMD GLEW_GET_FUN(__glewGetPerfMonitorCounterInfoAMD) +#define glGetPerfMonitorCounterStringAMD GLEW_GET_FUN(__glewGetPerfMonitorCounterStringAMD) +#define glGetPerfMonitorCountersAMD GLEW_GET_FUN(__glewGetPerfMonitorCountersAMD) +#define glGetPerfMonitorGroupStringAMD GLEW_GET_FUN(__glewGetPerfMonitorGroupStringAMD) +#define glGetPerfMonitorGroupsAMD GLEW_GET_FUN(__glewGetPerfMonitorGroupsAMD) +#define glSelectPerfMonitorCountersAMD GLEW_GET_FUN(__glewSelectPerfMonitorCountersAMD) + +#define GLEW_AMD_performance_monitor GLEW_GET_VAR(__GLEW_AMD_performance_monitor) + +#endif /* GL_AMD_performance_monitor */ + +/* -------------------------- GL_AMD_pinned_memory ------------------------- */ + +#ifndef GL_AMD_pinned_memory +#define GL_AMD_pinned_memory 1 + +#define GL_EXTERNAL_VIRTUAL_MEMORY_BUFFER_AMD 0x9160 + +#define GLEW_AMD_pinned_memory GLEW_GET_VAR(__GLEW_AMD_pinned_memory) + +#endif /* GL_AMD_pinned_memory */ + +/* ----------------------- GL_AMD_query_buffer_object ---------------------- */ + +#ifndef GL_AMD_query_buffer_object +#define GL_AMD_query_buffer_object 1 + +#define GL_QUERY_BUFFER_AMD 0x9192 +#define GL_QUERY_BUFFER_BINDING_AMD 0x9193 +#define GL_QUERY_RESULT_NO_WAIT_AMD 0x9194 + +#define GLEW_AMD_query_buffer_object GLEW_GET_VAR(__GLEW_AMD_query_buffer_object) + +#endif /* GL_AMD_query_buffer_object */ + +/* ------------------------ GL_AMD_sample_positions ------------------------ */ + +#ifndef GL_AMD_sample_positions +#define GL_AMD_sample_positions 1 + +#define GL_SUBSAMPLE_DISTANCE_AMD 0x883F + +typedef void (GLAPIENTRY * PFNGLSETMULTISAMPLEFVAMDPROC) (GLenum pname, GLuint index, const GLfloat* val); + +#define glSetMultisamplefvAMD GLEW_GET_FUN(__glewSetMultisamplefvAMD) + +#define GLEW_AMD_sample_positions GLEW_GET_VAR(__GLEW_AMD_sample_positions) + +#endif /* GL_AMD_sample_positions */ + +/* ------------------ GL_AMD_seamless_cubemap_per_texture ------------------ */ + +#ifndef GL_AMD_seamless_cubemap_per_texture +#define GL_AMD_seamless_cubemap_per_texture 1 + +#define GL_TEXTURE_CUBE_MAP_SEAMLESS_ARB 0x884F + +#define GLEW_AMD_seamless_cubemap_per_texture GLEW_GET_VAR(__GLEW_AMD_seamless_cubemap_per_texture) + +#endif /* GL_AMD_seamless_cubemap_per_texture */ + +/* ---------------------- GL_AMD_shader_stencil_export --------------------- */ + +#ifndef GL_AMD_shader_stencil_export +#define GL_AMD_shader_stencil_export 1 + +#define GLEW_AMD_shader_stencil_export GLEW_GET_VAR(__GLEW_AMD_shader_stencil_export) + +#endif /* GL_AMD_shader_stencil_export */ + +/* ---------------------- GL_AMD_shader_trinary_minmax --------------------- */ + +#ifndef GL_AMD_shader_trinary_minmax +#define GL_AMD_shader_trinary_minmax 1 + +#define GLEW_AMD_shader_trinary_minmax GLEW_GET_VAR(__GLEW_AMD_shader_trinary_minmax) + +#endif /* GL_AMD_shader_trinary_minmax */ + +/* ------------------------- GL_AMD_sparse_texture ------------------------- */ + +#ifndef GL_AMD_sparse_texture +#define GL_AMD_sparse_texture 1 + +#define GL_TEXTURE_STORAGE_SPARSE_BIT_AMD 0x00000001 +#define GL_VIRTUAL_PAGE_SIZE_X_AMD 0x9195 +#define GL_VIRTUAL_PAGE_SIZE_Y_AMD 0x9196 +#define GL_VIRTUAL_PAGE_SIZE_Z_AMD 0x9197 +#define GL_MAX_SPARSE_TEXTURE_SIZE_AMD 0x9198 +#define GL_MAX_SPARSE_3D_TEXTURE_SIZE_AMD 0x9199 +#define GL_MAX_SPARSE_ARRAY_TEXTURE_LAYERS 0x919A +#define GL_MIN_SPARSE_LEVEL_AMD 0x919B +#define GL_MIN_LOD_WARNING_AMD 0x919C + +typedef void (GLAPIENTRY * PFNGLTEXSTORAGESPARSEAMDPROC) (GLenum target, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLsizei layers, GLbitfield flags); +typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGESPARSEAMDPROC) (GLuint texture, GLenum target, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLsizei layers, GLbitfield flags); + +#define glTexStorageSparseAMD GLEW_GET_FUN(__glewTexStorageSparseAMD) +#define glTextureStorageSparseAMD GLEW_GET_FUN(__glewTextureStorageSparseAMD) + +#define GLEW_AMD_sparse_texture GLEW_GET_VAR(__GLEW_AMD_sparse_texture) + +#endif /* GL_AMD_sparse_texture */ + +/* ------------------- GL_AMD_stencil_operation_extended ------------------- */ + +#ifndef GL_AMD_stencil_operation_extended +#define GL_AMD_stencil_operation_extended 1 + +#define GL_SET_AMD 0x874A +#define GL_REPLACE_VALUE_AMD 0x874B +#define GL_STENCIL_OP_VALUE_AMD 0x874C +#define GL_STENCIL_BACK_OP_VALUE_AMD 0x874D + +typedef void (GLAPIENTRY * PFNGLSTENCILOPVALUEAMDPROC) (GLenum face, GLuint value); + +#define glStencilOpValueAMD GLEW_GET_FUN(__glewStencilOpValueAMD) + +#define GLEW_AMD_stencil_operation_extended GLEW_GET_VAR(__GLEW_AMD_stencil_operation_extended) + +#endif /* GL_AMD_stencil_operation_extended */ + +/* ------------------------ GL_AMD_texture_texture4 ------------------------ */ + +#ifndef GL_AMD_texture_texture4 +#define GL_AMD_texture_texture4 1 + +#define GLEW_AMD_texture_texture4 GLEW_GET_VAR(__GLEW_AMD_texture_texture4) + +#endif /* GL_AMD_texture_texture4 */ + +/* --------------- GL_AMD_transform_feedback3_lines_triangles -------------- */ + +#ifndef GL_AMD_transform_feedback3_lines_triangles +#define GL_AMD_transform_feedback3_lines_triangles 1 + +#define GLEW_AMD_transform_feedback3_lines_triangles GLEW_GET_VAR(__GLEW_AMD_transform_feedback3_lines_triangles) + +#endif /* GL_AMD_transform_feedback3_lines_triangles */ + +/* ----------------------- GL_AMD_vertex_shader_layer ---------------------- */ + +#ifndef GL_AMD_vertex_shader_layer +#define GL_AMD_vertex_shader_layer 1 + +#define GLEW_AMD_vertex_shader_layer GLEW_GET_VAR(__GLEW_AMD_vertex_shader_layer) + +#endif /* GL_AMD_vertex_shader_layer */ + +/* -------------------- GL_AMD_vertex_shader_tessellator ------------------- */ + +#ifndef GL_AMD_vertex_shader_tessellator +#define GL_AMD_vertex_shader_tessellator 1 + +#define GL_SAMPLER_BUFFER_AMD 0x9001 +#define GL_INT_SAMPLER_BUFFER_AMD 0x9002 +#define GL_UNSIGNED_INT_SAMPLER_BUFFER_AMD 0x9003 +#define GL_TESSELLATION_MODE_AMD 0x9004 +#define GL_TESSELLATION_FACTOR_AMD 0x9005 +#define GL_DISCRETE_AMD 0x9006 +#define GL_CONTINUOUS_AMD 0x9007 + +typedef void (GLAPIENTRY * PFNGLTESSELLATIONFACTORAMDPROC) (GLfloat factor); +typedef void (GLAPIENTRY * PFNGLTESSELLATIONMODEAMDPROC) (GLenum mode); + +#define glTessellationFactorAMD GLEW_GET_FUN(__glewTessellationFactorAMD) +#define glTessellationModeAMD GLEW_GET_FUN(__glewTessellationModeAMD) + +#define GLEW_AMD_vertex_shader_tessellator GLEW_GET_VAR(__GLEW_AMD_vertex_shader_tessellator) + +#endif /* GL_AMD_vertex_shader_tessellator */ + +/* ------------------ GL_AMD_vertex_shader_viewport_index ------------------ */ + +#ifndef GL_AMD_vertex_shader_viewport_index +#define GL_AMD_vertex_shader_viewport_index 1 + +#define GLEW_AMD_vertex_shader_viewport_index GLEW_GET_VAR(__GLEW_AMD_vertex_shader_viewport_index) + +#endif /* GL_AMD_vertex_shader_viewport_index */ + +/* ------------------------- GL_ANGLE_depth_texture ------------------------ */ + +#ifndef GL_ANGLE_depth_texture +#define GL_ANGLE_depth_texture 1 + +#define GLEW_ANGLE_depth_texture GLEW_GET_VAR(__GLEW_ANGLE_depth_texture) + +#endif /* GL_ANGLE_depth_texture */ + +/* ----------------------- GL_ANGLE_framebuffer_blit ----------------------- */ + +#ifndef GL_ANGLE_framebuffer_blit +#define GL_ANGLE_framebuffer_blit 1 + +#define GL_DRAW_FRAMEBUFFER_BINDING_ANGLE 0x8CA6 +#define GL_READ_FRAMEBUFFER_ANGLE 0x8CA8 +#define GL_DRAW_FRAMEBUFFER_ANGLE 0x8CA9 +#define GL_READ_FRAMEBUFFER_BINDING_ANGLE 0x8CAA + +typedef void (GLAPIENTRY * PFNGLBLITFRAMEBUFFERANGLEPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); + +#define glBlitFramebufferANGLE GLEW_GET_FUN(__glewBlitFramebufferANGLE) + +#define GLEW_ANGLE_framebuffer_blit GLEW_GET_VAR(__GLEW_ANGLE_framebuffer_blit) + +#endif /* GL_ANGLE_framebuffer_blit */ + +/* -------------------- GL_ANGLE_framebuffer_multisample ------------------- */ + +#ifndef GL_ANGLE_framebuffer_multisample +#define GL_ANGLE_framebuffer_multisample 1 + +#define GL_RENDERBUFFER_SAMPLES_ANGLE 0x8CAB +#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_ANGLE 0x8D56 +#define GL_MAX_SAMPLES_ANGLE 0x8D57 + +typedef void (GLAPIENTRY * PFNGLRENDERBUFFERSTORAGEMULTISAMPLEANGLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); + +#define glRenderbufferStorageMultisampleANGLE GLEW_GET_FUN(__glewRenderbufferStorageMultisampleANGLE) + +#define GLEW_ANGLE_framebuffer_multisample GLEW_GET_VAR(__GLEW_ANGLE_framebuffer_multisample) + +#endif /* GL_ANGLE_framebuffer_multisample */ + +/* ----------------------- GL_ANGLE_instanced_arrays ----------------------- */ + +#ifndef GL_ANGLE_instanced_arrays +#define GL_ANGLE_instanced_arrays 1 + +#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE 0x88FE + +typedef void (GLAPIENTRY * PFNGLDRAWARRAYSINSTANCEDANGLEPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount); +typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDANGLEPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBDIVISORANGLEPROC) (GLuint index, GLuint divisor); + +#define glDrawArraysInstancedANGLE GLEW_GET_FUN(__glewDrawArraysInstancedANGLE) +#define glDrawElementsInstancedANGLE GLEW_GET_FUN(__glewDrawElementsInstancedANGLE) +#define glVertexAttribDivisorANGLE GLEW_GET_FUN(__glewVertexAttribDivisorANGLE) + +#define GLEW_ANGLE_instanced_arrays GLEW_GET_VAR(__GLEW_ANGLE_instanced_arrays) + +#endif /* GL_ANGLE_instanced_arrays */ + +/* -------------------- GL_ANGLE_pack_reverse_row_order -------------------- */ + +#ifndef GL_ANGLE_pack_reverse_row_order +#define GL_ANGLE_pack_reverse_row_order 1 + +#define GL_PACK_REVERSE_ROW_ORDER_ANGLE 0x93A4 + +#define GLEW_ANGLE_pack_reverse_row_order GLEW_GET_VAR(__GLEW_ANGLE_pack_reverse_row_order) + +#endif /* GL_ANGLE_pack_reverse_row_order */ + +/* ------------------------ GL_ANGLE_program_binary ------------------------ */ + +#ifndef GL_ANGLE_program_binary +#define GL_ANGLE_program_binary 1 + +#define GL_PROGRAM_BINARY_ANGLE 0x93A6 + +#define GLEW_ANGLE_program_binary GLEW_GET_VAR(__GLEW_ANGLE_program_binary) + +#endif /* GL_ANGLE_program_binary */ + +/* ------------------- GL_ANGLE_texture_compression_dxt1 ------------------- */ + +#ifndef GL_ANGLE_texture_compression_dxt1 +#define GL_ANGLE_texture_compression_dxt1 1 + +#define GL_COMPRESSED_RGB_S3TC_DXT1_ANGLE 0x83F0 +#define GL_COMPRESSED_RGBA_S3TC_DXT1_ANGLE 0x83F1 +#define GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE 0x83F2 +#define GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE 0x83F3 + +#define GLEW_ANGLE_texture_compression_dxt1 GLEW_GET_VAR(__GLEW_ANGLE_texture_compression_dxt1) + +#endif /* GL_ANGLE_texture_compression_dxt1 */ + +/* ------------------- GL_ANGLE_texture_compression_dxt3 ------------------- */ + +#ifndef GL_ANGLE_texture_compression_dxt3 +#define GL_ANGLE_texture_compression_dxt3 1 + +#define GL_COMPRESSED_RGB_S3TC_DXT1_ANGLE 0x83F0 +#define GL_COMPRESSED_RGBA_S3TC_DXT1_ANGLE 0x83F1 +#define GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE 0x83F2 +#define GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE 0x83F3 + +#define GLEW_ANGLE_texture_compression_dxt3 GLEW_GET_VAR(__GLEW_ANGLE_texture_compression_dxt3) + +#endif /* GL_ANGLE_texture_compression_dxt3 */ + +/* ------------------- GL_ANGLE_texture_compression_dxt5 ------------------- */ + +#ifndef GL_ANGLE_texture_compression_dxt5 +#define GL_ANGLE_texture_compression_dxt5 1 + +#define GL_COMPRESSED_RGB_S3TC_DXT1_ANGLE 0x83F0 +#define GL_COMPRESSED_RGBA_S3TC_DXT1_ANGLE 0x83F1 +#define GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE 0x83F2 +#define GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE 0x83F3 + +#define GLEW_ANGLE_texture_compression_dxt5 GLEW_GET_VAR(__GLEW_ANGLE_texture_compression_dxt5) + +#endif /* GL_ANGLE_texture_compression_dxt5 */ + +/* ------------------------- GL_ANGLE_texture_usage ------------------------ */ + +#ifndef GL_ANGLE_texture_usage +#define GL_ANGLE_texture_usage 1 + +#define GL_TEXTURE_USAGE_ANGLE 0x93A2 +#define GL_FRAMEBUFFER_ATTACHMENT_ANGLE 0x93A3 + +#define GLEW_ANGLE_texture_usage GLEW_GET_VAR(__GLEW_ANGLE_texture_usage) + +#endif /* GL_ANGLE_texture_usage */ + +/* -------------------------- GL_ANGLE_timer_query ------------------------- */ + +#ifndef GL_ANGLE_timer_query +#define GL_ANGLE_timer_query 1 + +#define GL_QUERY_COUNTER_BITS_ANGLE 0x8864 +#define GL_CURRENT_QUERY_ANGLE 0x8865 +#define GL_QUERY_RESULT_ANGLE 0x8866 +#define GL_QUERY_RESULT_AVAILABLE_ANGLE 0x8867 +#define GL_TIME_ELAPSED_ANGLE 0x88BF +#define GL_TIMESTAMP_ANGLE 0x8E28 + +typedef void (GLAPIENTRY * PFNGLBEGINQUERYANGLEPROC) (GLenum target, GLuint id); +typedef void (GLAPIENTRY * PFNGLDELETEQUERIESANGLEPROC) (GLsizei n, const GLuint* ids); +typedef void (GLAPIENTRY * PFNGLENDQUERYANGLEPROC) (GLenum target); +typedef void (GLAPIENTRY * PFNGLGENQUERIESANGLEPROC) (GLsizei n, GLuint* ids); +typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTI64VANGLEPROC) (GLuint id, GLenum pname, GLint64* params); +typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTIVANGLEPROC) (GLuint id, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTUI64VANGLEPROC) (GLuint id, GLenum pname, GLuint64* params); +typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTUIVANGLEPROC) (GLuint id, GLenum pname, GLuint* params); +typedef void (GLAPIENTRY * PFNGLGETQUERYIVANGLEPROC) (GLenum target, GLenum pname, GLint* params); +typedef GLboolean (GLAPIENTRY * PFNGLISQUERYANGLEPROC) (GLuint id); +typedef void (GLAPIENTRY * PFNGLQUERYCOUNTERANGLEPROC) (GLuint id, GLenum target); + +#define glBeginQueryANGLE GLEW_GET_FUN(__glewBeginQueryANGLE) +#define glDeleteQueriesANGLE GLEW_GET_FUN(__glewDeleteQueriesANGLE) +#define glEndQueryANGLE GLEW_GET_FUN(__glewEndQueryANGLE) +#define glGenQueriesANGLE GLEW_GET_FUN(__glewGenQueriesANGLE) +#define glGetQueryObjecti64vANGLE GLEW_GET_FUN(__glewGetQueryObjecti64vANGLE) +#define glGetQueryObjectivANGLE GLEW_GET_FUN(__glewGetQueryObjectivANGLE) +#define glGetQueryObjectui64vANGLE GLEW_GET_FUN(__glewGetQueryObjectui64vANGLE) +#define glGetQueryObjectuivANGLE GLEW_GET_FUN(__glewGetQueryObjectuivANGLE) +#define glGetQueryivANGLE GLEW_GET_FUN(__glewGetQueryivANGLE) +#define glIsQueryANGLE GLEW_GET_FUN(__glewIsQueryANGLE) +#define glQueryCounterANGLE GLEW_GET_FUN(__glewQueryCounterANGLE) + +#define GLEW_ANGLE_timer_query GLEW_GET_VAR(__GLEW_ANGLE_timer_query) + +#endif /* GL_ANGLE_timer_query */ + +/* ------------------- GL_ANGLE_translated_shader_source ------------------- */ + +#ifndef GL_ANGLE_translated_shader_source +#define GL_ANGLE_translated_shader_source 1 + +#define GL_TRANSLATED_SHADER_SOURCE_LENGTH_ANGLE 0x93A0 + +typedef void (GLAPIENTRY * PFNGLGETTRANSLATEDSHADERSOURCEANGLEPROC) (GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* source); + +#define glGetTranslatedShaderSourceANGLE GLEW_GET_FUN(__glewGetTranslatedShaderSourceANGLE) + +#define GLEW_ANGLE_translated_shader_source GLEW_GET_VAR(__GLEW_ANGLE_translated_shader_source) + +#endif /* GL_ANGLE_translated_shader_source */ + +/* ----------------------- GL_APPLE_aux_depth_stencil ---------------------- */ + +#ifndef GL_APPLE_aux_depth_stencil +#define GL_APPLE_aux_depth_stencil 1 + +#define GL_AUX_DEPTH_STENCIL_APPLE 0x8A14 + +#define GLEW_APPLE_aux_depth_stencil GLEW_GET_VAR(__GLEW_APPLE_aux_depth_stencil) + +#endif /* GL_APPLE_aux_depth_stencil */ + +/* ------------------------ GL_APPLE_client_storage ------------------------ */ + +#ifndef GL_APPLE_client_storage +#define GL_APPLE_client_storage 1 + +#define GL_UNPACK_CLIENT_STORAGE_APPLE 0x85B2 + +#define GLEW_APPLE_client_storage GLEW_GET_VAR(__GLEW_APPLE_client_storage) + +#endif /* GL_APPLE_client_storage */ + +/* ------------------------- GL_APPLE_element_array ------------------------ */ + +#ifndef GL_APPLE_element_array +#define GL_APPLE_element_array 1 + +#define GL_ELEMENT_ARRAY_APPLE 0x8A0C +#define GL_ELEMENT_ARRAY_TYPE_APPLE 0x8A0D +#define GL_ELEMENT_ARRAY_POINTER_APPLE 0x8A0E + +typedef void (GLAPIENTRY * PFNGLDRAWELEMENTARRAYAPPLEPROC) (GLenum mode, GLint first, GLsizei count); +typedef void (GLAPIENTRY * PFNGLDRAWRANGEELEMENTARRAYAPPLEPROC) (GLenum mode, GLuint start, GLuint end, GLint first, GLsizei count); +typedef void (GLAPIENTRY * PFNGLELEMENTPOINTERAPPLEPROC) (GLenum type, const GLvoid *pointer); +typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTARRAYAPPLEPROC) (GLenum mode, const GLint* first, const GLsizei *count, GLsizei primcount); +typedef void (GLAPIENTRY * PFNGLMULTIDRAWRANGEELEMENTARRAYAPPLEPROC) (GLenum mode, GLuint start, GLuint end, const GLint* first, const GLsizei *count, GLsizei primcount); + +#define glDrawElementArrayAPPLE GLEW_GET_FUN(__glewDrawElementArrayAPPLE) +#define glDrawRangeElementArrayAPPLE GLEW_GET_FUN(__glewDrawRangeElementArrayAPPLE) +#define glElementPointerAPPLE GLEW_GET_FUN(__glewElementPointerAPPLE) +#define glMultiDrawElementArrayAPPLE GLEW_GET_FUN(__glewMultiDrawElementArrayAPPLE) +#define glMultiDrawRangeElementArrayAPPLE GLEW_GET_FUN(__glewMultiDrawRangeElementArrayAPPLE) + +#define GLEW_APPLE_element_array GLEW_GET_VAR(__GLEW_APPLE_element_array) + +#endif /* GL_APPLE_element_array */ + +/* ----------------------------- GL_APPLE_fence ---------------------------- */ + +#ifndef GL_APPLE_fence +#define GL_APPLE_fence 1 + +#define GL_DRAW_PIXELS_APPLE 0x8A0A +#define GL_FENCE_APPLE 0x8A0B + +typedef void (GLAPIENTRY * PFNGLDELETEFENCESAPPLEPROC) (GLsizei n, const GLuint* fences); +typedef void (GLAPIENTRY * PFNGLFINISHFENCEAPPLEPROC) (GLuint fence); +typedef void (GLAPIENTRY * PFNGLFINISHOBJECTAPPLEPROC) (GLenum object, GLint name); +typedef void (GLAPIENTRY * PFNGLGENFENCESAPPLEPROC) (GLsizei n, GLuint* fences); +typedef GLboolean (GLAPIENTRY * PFNGLISFENCEAPPLEPROC) (GLuint fence); +typedef void (GLAPIENTRY * PFNGLSETFENCEAPPLEPROC) (GLuint fence); +typedef GLboolean (GLAPIENTRY * PFNGLTESTFENCEAPPLEPROC) (GLuint fence); +typedef GLboolean (GLAPIENTRY * PFNGLTESTOBJECTAPPLEPROC) (GLenum object, GLuint name); + +#define glDeleteFencesAPPLE GLEW_GET_FUN(__glewDeleteFencesAPPLE) +#define glFinishFenceAPPLE GLEW_GET_FUN(__glewFinishFenceAPPLE) +#define glFinishObjectAPPLE GLEW_GET_FUN(__glewFinishObjectAPPLE) +#define glGenFencesAPPLE GLEW_GET_FUN(__glewGenFencesAPPLE) +#define glIsFenceAPPLE GLEW_GET_FUN(__glewIsFenceAPPLE) +#define glSetFenceAPPLE GLEW_GET_FUN(__glewSetFenceAPPLE) +#define glTestFenceAPPLE GLEW_GET_FUN(__glewTestFenceAPPLE) +#define glTestObjectAPPLE GLEW_GET_FUN(__glewTestObjectAPPLE) + +#define GLEW_APPLE_fence GLEW_GET_VAR(__GLEW_APPLE_fence) + +#endif /* GL_APPLE_fence */ + +/* ------------------------- GL_APPLE_float_pixels ------------------------- */ + +#ifndef GL_APPLE_float_pixels +#define GL_APPLE_float_pixels 1 + +#define GL_HALF_APPLE 0x140B +#define GL_RGBA_FLOAT32_APPLE 0x8814 +#define GL_RGB_FLOAT32_APPLE 0x8815 +#define GL_ALPHA_FLOAT32_APPLE 0x8816 +#define GL_INTENSITY_FLOAT32_APPLE 0x8817 +#define GL_LUMINANCE_FLOAT32_APPLE 0x8818 +#define GL_LUMINANCE_ALPHA_FLOAT32_APPLE 0x8819 +#define GL_RGBA_FLOAT16_APPLE 0x881A +#define GL_RGB_FLOAT16_APPLE 0x881B +#define GL_ALPHA_FLOAT16_APPLE 0x881C +#define GL_INTENSITY_FLOAT16_APPLE 0x881D +#define GL_LUMINANCE_FLOAT16_APPLE 0x881E +#define GL_LUMINANCE_ALPHA_FLOAT16_APPLE 0x881F +#define GL_COLOR_FLOAT_APPLE 0x8A0F + +#define GLEW_APPLE_float_pixels GLEW_GET_VAR(__GLEW_APPLE_float_pixels) + +#endif /* GL_APPLE_float_pixels */ + +/* ---------------------- GL_APPLE_flush_buffer_range ---------------------- */ + +#ifndef GL_APPLE_flush_buffer_range +#define GL_APPLE_flush_buffer_range 1 + +#define GL_BUFFER_SERIALIZED_MODIFY_APPLE 0x8A12 +#define GL_BUFFER_FLUSHING_UNMAP_APPLE 0x8A13 + +typedef void (GLAPIENTRY * PFNGLBUFFERPARAMETERIAPPLEPROC) (GLenum target, GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLFLUSHMAPPEDBUFFERRANGEAPPLEPROC) (GLenum target, GLintptr offset, GLsizeiptr size); + +#define glBufferParameteriAPPLE GLEW_GET_FUN(__glewBufferParameteriAPPLE) +#define glFlushMappedBufferRangeAPPLE GLEW_GET_FUN(__glewFlushMappedBufferRangeAPPLE) + +#define GLEW_APPLE_flush_buffer_range GLEW_GET_VAR(__GLEW_APPLE_flush_buffer_range) + +#endif /* GL_APPLE_flush_buffer_range */ + +/* ----------------------- GL_APPLE_object_purgeable ----------------------- */ + +#ifndef GL_APPLE_object_purgeable +#define GL_APPLE_object_purgeable 1 + +#define GL_BUFFER_OBJECT_APPLE 0x85B3 +#define GL_RELEASED_APPLE 0x8A19 +#define GL_VOLATILE_APPLE 0x8A1A +#define GL_RETAINED_APPLE 0x8A1B +#define GL_UNDEFINED_APPLE 0x8A1C +#define GL_PURGEABLE_APPLE 0x8A1D + +typedef void (GLAPIENTRY * PFNGLGETOBJECTPARAMETERIVAPPLEPROC) (GLenum objectType, GLuint name, GLenum pname, GLint* params); +typedef GLenum (GLAPIENTRY * PFNGLOBJECTPURGEABLEAPPLEPROC) (GLenum objectType, GLuint name, GLenum option); +typedef GLenum (GLAPIENTRY * PFNGLOBJECTUNPURGEABLEAPPLEPROC) (GLenum objectType, GLuint name, GLenum option); + +#define glGetObjectParameterivAPPLE GLEW_GET_FUN(__glewGetObjectParameterivAPPLE) +#define glObjectPurgeableAPPLE GLEW_GET_FUN(__glewObjectPurgeableAPPLE) +#define glObjectUnpurgeableAPPLE GLEW_GET_FUN(__glewObjectUnpurgeableAPPLE) + +#define GLEW_APPLE_object_purgeable GLEW_GET_VAR(__GLEW_APPLE_object_purgeable) + +#endif /* GL_APPLE_object_purgeable */ + +/* ------------------------- GL_APPLE_pixel_buffer ------------------------- */ + +#ifndef GL_APPLE_pixel_buffer +#define GL_APPLE_pixel_buffer 1 + +#define GL_MIN_PBUFFER_VIEWPORT_DIMS_APPLE 0x8A10 + +#define GLEW_APPLE_pixel_buffer GLEW_GET_VAR(__GLEW_APPLE_pixel_buffer) + +#endif /* GL_APPLE_pixel_buffer */ + +/* ---------------------------- GL_APPLE_rgb_422 --------------------------- */ + +#ifndef GL_APPLE_rgb_422 +#define GL_APPLE_rgb_422 1 + +#define GL_UNSIGNED_SHORT_8_8_APPLE 0x85BA +#define GL_UNSIGNED_SHORT_8_8_REV_APPLE 0x85BB +#define GL_RGB_422_APPLE 0x8A1F + +#define GLEW_APPLE_rgb_422 GLEW_GET_VAR(__GLEW_APPLE_rgb_422) + +#endif /* GL_APPLE_rgb_422 */ + +/* --------------------------- GL_APPLE_row_bytes -------------------------- */ + +#ifndef GL_APPLE_row_bytes +#define GL_APPLE_row_bytes 1 + +#define GL_PACK_ROW_BYTES_APPLE 0x8A15 +#define GL_UNPACK_ROW_BYTES_APPLE 0x8A16 + +#define GLEW_APPLE_row_bytes GLEW_GET_VAR(__GLEW_APPLE_row_bytes) + +#endif /* GL_APPLE_row_bytes */ + +/* ------------------------ GL_APPLE_specular_vector ----------------------- */ + +#ifndef GL_APPLE_specular_vector +#define GL_APPLE_specular_vector 1 + +#define GL_LIGHT_MODEL_SPECULAR_VECTOR_APPLE 0x85B0 + +#define GLEW_APPLE_specular_vector GLEW_GET_VAR(__GLEW_APPLE_specular_vector) + +#endif /* GL_APPLE_specular_vector */ + +/* ------------------------- GL_APPLE_texture_range ------------------------ */ + +#ifndef GL_APPLE_texture_range +#define GL_APPLE_texture_range 1 + +#define GL_TEXTURE_RANGE_LENGTH_APPLE 0x85B7 +#define GL_TEXTURE_RANGE_POINTER_APPLE 0x85B8 +#define GL_TEXTURE_STORAGE_HINT_APPLE 0x85BC +#define GL_STORAGE_PRIVATE_APPLE 0x85BD +#define GL_STORAGE_CACHED_APPLE 0x85BE +#define GL_STORAGE_SHARED_APPLE 0x85BF + +typedef void (GLAPIENTRY * PFNGLGETTEXPARAMETERPOINTERVAPPLEPROC) (GLenum target, GLenum pname, GLvoid **params); +typedef void (GLAPIENTRY * PFNGLTEXTURERANGEAPPLEPROC) (GLenum target, GLsizei length, GLvoid *pointer); + +#define glGetTexParameterPointervAPPLE GLEW_GET_FUN(__glewGetTexParameterPointervAPPLE) +#define glTextureRangeAPPLE GLEW_GET_FUN(__glewTextureRangeAPPLE) + +#define GLEW_APPLE_texture_range GLEW_GET_VAR(__GLEW_APPLE_texture_range) + +#endif /* GL_APPLE_texture_range */ + +/* ------------------------ GL_APPLE_transform_hint ------------------------ */ + +#ifndef GL_APPLE_transform_hint +#define GL_APPLE_transform_hint 1 + +#define GL_TRANSFORM_HINT_APPLE 0x85B1 + +#define GLEW_APPLE_transform_hint GLEW_GET_VAR(__GLEW_APPLE_transform_hint) + +#endif /* GL_APPLE_transform_hint */ + +/* ---------------------- GL_APPLE_vertex_array_object --------------------- */ + +#ifndef GL_APPLE_vertex_array_object +#define GL_APPLE_vertex_array_object 1 + +#define GL_VERTEX_ARRAY_BINDING_APPLE 0x85B5 + +typedef void (GLAPIENTRY * PFNGLBINDVERTEXARRAYAPPLEPROC) (GLuint array); +typedef void (GLAPIENTRY * PFNGLDELETEVERTEXARRAYSAPPLEPROC) (GLsizei n, const GLuint* arrays); +typedef void (GLAPIENTRY * PFNGLGENVERTEXARRAYSAPPLEPROC) (GLsizei n, const GLuint* arrays); +typedef GLboolean (GLAPIENTRY * PFNGLISVERTEXARRAYAPPLEPROC) (GLuint array); + +#define glBindVertexArrayAPPLE GLEW_GET_FUN(__glewBindVertexArrayAPPLE) +#define glDeleteVertexArraysAPPLE GLEW_GET_FUN(__glewDeleteVertexArraysAPPLE) +#define glGenVertexArraysAPPLE GLEW_GET_FUN(__glewGenVertexArraysAPPLE) +#define glIsVertexArrayAPPLE GLEW_GET_FUN(__glewIsVertexArrayAPPLE) + +#define GLEW_APPLE_vertex_array_object GLEW_GET_VAR(__GLEW_APPLE_vertex_array_object) + +#endif /* GL_APPLE_vertex_array_object */ + +/* ---------------------- GL_APPLE_vertex_array_range ---------------------- */ + +#ifndef GL_APPLE_vertex_array_range +#define GL_APPLE_vertex_array_range 1 + +#define GL_VERTEX_ARRAY_RANGE_APPLE 0x851D +#define GL_VERTEX_ARRAY_RANGE_LENGTH_APPLE 0x851E +#define GL_VERTEX_ARRAY_STORAGE_HINT_APPLE 0x851F +#define GL_MAX_VERTEX_ARRAY_RANGE_ELEMENT_APPLE 0x8520 +#define GL_VERTEX_ARRAY_RANGE_POINTER_APPLE 0x8521 +#define GL_STORAGE_CLIENT_APPLE 0x85B4 +#define GL_STORAGE_CACHED_APPLE 0x85BE +#define GL_STORAGE_SHARED_APPLE 0x85BF + +typedef void (GLAPIENTRY * PFNGLFLUSHVERTEXARRAYRANGEAPPLEPROC) (GLsizei length, GLvoid *pointer); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYPARAMETERIAPPLEPROC) (GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYRANGEAPPLEPROC) (GLsizei length, GLvoid *pointer); + +#define glFlushVertexArrayRangeAPPLE GLEW_GET_FUN(__glewFlushVertexArrayRangeAPPLE) +#define glVertexArrayParameteriAPPLE GLEW_GET_FUN(__glewVertexArrayParameteriAPPLE) +#define glVertexArrayRangeAPPLE GLEW_GET_FUN(__glewVertexArrayRangeAPPLE) + +#define GLEW_APPLE_vertex_array_range GLEW_GET_VAR(__GLEW_APPLE_vertex_array_range) + +#endif /* GL_APPLE_vertex_array_range */ + +/* ------------------- GL_APPLE_vertex_program_evaluators ------------------ */ + +#ifndef GL_APPLE_vertex_program_evaluators +#define GL_APPLE_vertex_program_evaluators 1 + +#define GL_VERTEX_ATTRIB_MAP1_APPLE 0x8A00 +#define GL_VERTEX_ATTRIB_MAP2_APPLE 0x8A01 +#define GL_VERTEX_ATTRIB_MAP1_SIZE_APPLE 0x8A02 +#define GL_VERTEX_ATTRIB_MAP1_COEFF_APPLE 0x8A03 +#define GL_VERTEX_ATTRIB_MAP1_ORDER_APPLE 0x8A04 +#define GL_VERTEX_ATTRIB_MAP1_DOMAIN_APPLE 0x8A05 +#define GL_VERTEX_ATTRIB_MAP2_SIZE_APPLE 0x8A06 +#define GL_VERTEX_ATTRIB_MAP2_COEFF_APPLE 0x8A07 +#define GL_VERTEX_ATTRIB_MAP2_ORDER_APPLE 0x8A08 +#define GL_VERTEX_ATTRIB_MAP2_DOMAIN_APPLE 0x8A09 + +typedef void (GLAPIENTRY * PFNGLDISABLEVERTEXATTRIBAPPLEPROC) (GLuint index, GLenum pname); +typedef void (GLAPIENTRY * PFNGLENABLEVERTEXATTRIBAPPLEPROC) (GLuint index, GLenum pname); +typedef GLboolean (GLAPIENTRY * PFNGLISVERTEXATTRIBENABLEDAPPLEPROC) (GLuint index, GLenum pname); +typedef void (GLAPIENTRY * PFNGLMAPVERTEXATTRIB1DAPPLEPROC) (GLuint index, GLuint size, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble* points); +typedef void (GLAPIENTRY * PFNGLMAPVERTEXATTRIB1FAPPLEPROC) (GLuint index, GLuint size, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat* points); +typedef void (GLAPIENTRY * PFNGLMAPVERTEXATTRIB2DAPPLEPROC) (GLuint index, GLuint size, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble* points); +typedef void (GLAPIENTRY * PFNGLMAPVERTEXATTRIB2FAPPLEPROC) (GLuint index, GLuint size, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat* points); + +#define glDisableVertexAttribAPPLE GLEW_GET_FUN(__glewDisableVertexAttribAPPLE) +#define glEnableVertexAttribAPPLE GLEW_GET_FUN(__glewEnableVertexAttribAPPLE) +#define glIsVertexAttribEnabledAPPLE GLEW_GET_FUN(__glewIsVertexAttribEnabledAPPLE) +#define glMapVertexAttrib1dAPPLE GLEW_GET_FUN(__glewMapVertexAttrib1dAPPLE) +#define glMapVertexAttrib1fAPPLE GLEW_GET_FUN(__glewMapVertexAttrib1fAPPLE) +#define glMapVertexAttrib2dAPPLE GLEW_GET_FUN(__glewMapVertexAttrib2dAPPLE) +#define glMapVertexAttrib2fAPPLE GLEW_GET_FUN(__glewMapVertexAttrib2fAPPLE) + +#define GLEW_APPLE_vertex_program_evaluators GLEW_GET_VAR(__GLEW_APPLE_vertex_program_evaluators) + +#endif /* GL_APPLE_vertex_program_evaluators */ + +/* --------------------------- GL_APPLE_ycbcr_422 -------------------------- */ + +#ifndef GL_APPLE_ycbcr_422 +#define GL_APPLE_ycbcr_422 1 + +#define GL_YCBCR_422_APPLE 0x85B9 + +#define GLEW_APPLE_ycbcr_422 GLEW_GET_VAR(__GLEW_APPLE_ycbcr_422) + +#endif /* GL_APPLE_ycbcr_422 */ + +/* ------------------------ GL_ARB_ES2_compatibility ----------------------- */ + +#ifndef GL_ARB_ES2_compatibility +#define GL_ARB_ES2_compatibility 1 + +#define GL_FIXED 0x140C +#define GL_IMPLEMENTATION_COLOR_READ_TYPE 0x8B9A +#define GL_IMPLEMENTATION_COLOR_READ_FORMAT 0x8B9B +#define GL_RGB565 0x8D62 +#define GL_LOW_FLOAT 0x8DF0 +#define GL_MEDIUM_FLOAT 0x8DF1 +#define GL_HIGH_FLOAT 0x8DF2 +#define GL_LOW_INT 0x8DF3 +#define GL_MEDIUM_INT 0x8DF4 +#define GL_HIGH_INT 0x8DF5 +#define GL_SHADER_BINARY_FORMATS 0x8DF8 +#define GL_NUM_SHADER_BINARY_FORMATS 0x8DF9 +#define GL_SHADER_COMPILER 0x8DFA +#define GL_MAX_VERTEX_UNIFORM_VECTORS 0x8DFB +#define GL_MAX_VARYING_VECTORS 0x8DFC +#define GL_MAX_FRAGMENT_UNIFORM_VECTORS 0x8DFD + +typedef int GLfixed; + +typedef void (GLAPIENTRY * PFNGLCLEARDEPTHFPROC) (GLclampf d); +typedef void (GLAPIENTRY * PFNGLDEPTHRANGEFPROC) (GLclampf n, GLclampf f); +typedef void (GLAPIENTRY * PFNGLGETSHADERPRECISIONFORMATPROC) (GLenum shadertype, GLenum precisiontype, GLint* range, GLint *precision); +typedef void (GLAPIENTRY * PFNGLRELEASESHADERCOMPILERPROC) (void); +typedef void (GLAPIENTRY * PFNGLSHADERBINARYPROC) (GLsizei count, const GLuint* shaders, GLenum binaryformat, const GLvoid*binary, GLsizei length); + +#define glClearDepthf GLEW_GET_FUN(__glewClearDepthf) +#define glDepthRangef GLEW_GET_FUN(__glewDepthRangef) +#define glGetShaderPrecisionFormat GLEW_GET_FUN(__glewGetShaderPrecisionFormat) +#define glReleaseShaderCompiler GLEW_GET_FUN(__glewReleaseShaderCompiler) +#define glShaderBinary GLEW_GET_FUN(__glewShaderBinary) + +#define GLEW_ARB_ES2_compatibility GLEW_GET_VAR(__GLEW_ARB_ES2_compatibility) + +#endif /* GL_ARB_ES2_compatibility */ + +/* ------------------------ GL_ARB_ES3_compatibility ----------------------- */ + +#ifndef GL_ARB_ES3_compatibility +#define GL_ARB_ES3_compatibility 1 + +#define GL_TEXTURE_IMMUTABLE_LEVELS 0x82DF +#define GL_PRIMITIVE_RESTART_FIXED_INDEX 0x8D69 +#define GL_ANY_SAMPLES_PASSED_CONSERVATIVE 0x8D6A +#define GL_MAX_ELEMENT_INDEX 0x8D6B +#define GL_COMPRESSED_R11_EAC 0x9270 +#define GL_COMPRESSED_SIGNED_R11_EAC 0x9271 +#define GL_COMPRESSED_RG11_EAC 0x9272 +#define GL_COMPRESSED_SIGNED_RG11_EAC 0x9273 +#define GL_COMPRESSED_RGB8_ETC2 0x9274 +#define GL_COMPRESSED_SRGB8_ETC2 0x9275 +#define GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 0x9276 +#define GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 0x9277 +#define GL_COMPRESSED_RGBA8_ETC2_EAC 0x9278 +#define GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC 0x9279 + +#define GLEW_ARB_ES3_compatibility GLEW_GET_VAR(__GLEW_ARB_ES3_compatibility) + +#endif /* GL_ARB_ES3_compatibility */ + +/* ------------------------ GL_ARB_arrays_of_arrays ------------------------ */ + +#ifndef GL_ARB_arrays_of_arrays +#define GL_ARB_arrays_of_arrays 1 + +#define GLEW_ARB_arrays_of_arrays GLEW_GET_VAR(__GLEW_ARB_arrays_of_arrays) + +#endif /* GL_ARB_arrays_of_arrays */ + +/* -------------------------- GL_ARB_base_instance ------------------------- */ + +#ifndef GL_ARB_base_instance +#define GL_ARB_base_instance 1 + +typedef void (GLAPIENTRY * PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount, GLuint baseinstance); +typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDBASEINSTANCEPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount, GLuint baseinstance); +typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount, GLint basevertex, GLuint baseinstance); + +#define glDrawArraysInstancedBaseInstance GLEW_GET_FUN(__glewDrawArraysInstancedBaseInstance) +#define glDrawElementsInstancedBaseInstance GLEW_GET_FUN(__glewDrawElementsInstancedBaseInstance) +#define glDrawElementsInstancedBaseVertexBaseInstance GLEW_GET_FUN(__glewDrawElementsInstancedBaseVertexBaseInstance) + +#define GLEW_ARB_base_instance GLEW_GET_VAR(__GLEW_ARB_base_instance) + +#endif /* GL_ARB_base_instance */ + +/* ------------------------ GL_ARB_bindless_texture ------------------------ */ + +#ifndef GL_ARB_bindless_texture +#define GL_ARB_bindless_texture 1 + +#define GL_UNSIGNED_INT64_ARB 0x140F + +typedef GLuint64 (GLAPIENTRY * PFNGLGETIMAGEHANDLEARBPROC) (GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum format); +typedef GLuint64 (GLAPIENTRY * PFNGLGETTEXTUREHANDLEARBPROC) (GLuint texture); +typedef GLuint64 (GLAPIENTRY * PFNGLGETTEXTURESAMPLERHANDLEARBPROC) (GLuint texture, GLuint sampler); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBLUI64VARBPROC) (GLuint index, GLenum pname, GLuint64EXT* params); +typedef GLboolean (GLAPIENTRY * PFNGLISIMAGEHANDLERESIDENTARBPROC) (GLuint64 handle); +typedef GLboolean (GLAPIENTRY * PFNGLISTEXTUREHANDLERESIDENTARBPROC) (GLuint64 handle); +typedef void (GLAPIENTRY * PFNGLMAKEIMAGEHANDLENONRESIDENTARBPROC) (GLuint64 handle); +typedef void (GLAPIENTRY * PFNGLMAKEIMAGEHANDLERESIDENTARBPROC) (GLuint64 handle, GLenum access); +typedef void (GLAPIENTRY * PFNGLMAKETEXTUREHANDLENONRESIDENTARBPROC) (GLuint64 handle); +typedef void (GLAPIENTRY * PFNGLMAKETEXTUREHANDLERESIDENTARBPROC) (GLuint64 handle); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMHANDLEUI64ARBPROC) (GLuint program, GLint location, GLuint64 value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMHANDLEUI64VARBPROC) (GLuint program, GLint location, GLsizei count, const GLuint64* values); +typedef void (GLAPIENTRY * PFNGLUNIFORMHANDLEUI64ARBPROC) (GLint location, GLuint64 value); +typedef void (GLAPIENTRY * PFNGLUNIFORMHANDLEUI64VARBPROC) (GLint location, GLsizei count, const GLuint64* value); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1UI64ARBPROC) (GLuint index, GLuint64EXT x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1UI64VARBPROC) (GLuint index, const GLuint64EXT* v); + +#define glGetImageHandleARB GLEW_GET_FUN(__glewGetImageHandleARB) +#define glGetTextureHandleARB GLEW_GET_FUN(__glewGetTextureHandleARB) +#define glGetTextureSamplerHandleARB GLEW_GET_FUN(__glewGetTextureSamplerHandleARB) +#define glGetVertexAttribLui64vARB GLEW_GET_FUN(__glewGetVertexAttribLui64vARB) +#define glIsImageHandleResidentARB GLEW_GET_FUN(__glewIsImageHandleResidentARB) +#define glIsTextureHandleResidentARB GLEW_GET_FUN(__glewIsTextureHandleResidentARB) +#define glMakeImageHandleNonResidentARB GLEW_GET_FUN(__glewMakeImageHandleNonResidentARB) +#define glMakeImageHandleResidentARB GLEW_GET_FUN(__glewMakeImageHandleResidentARB) +#define glMakeTextureHandleNonResidentARB GLEW_GET_FUN(__glewMakeTextureHandleNonResidentARB) +#define glMakeTextureHandleResidentARB GLEW_GET_FUN(__glewMakeTextureHandleResidentARB) +#define glProgramUniformHandleui64ARB GLEW_GET_FUN(__glewProgramUniformHandleui64ARB) +#define glProgramUniformHandleui64vARB GLEW_GET_FUN(__glewProgramUniformHandleui64vARB) +#define glUniformHandleui64ARB GLEW_GET_FUN(__glewUniformHandleui64ARB) +#define glUniformHandleui64vARB GLEW_GET_FUN(__glewUniformHandleui64vARB) +#define glVertexAttribL1ui64ARB GLEW_GET_FUN(__glewVertexAttribL1ui64ARB) +#define glVertexAttribL1ui64vARB GLEW_GET_FUN(__glewVertexAttribL1ui64vARB) + +#define GLEW_ARB_bindless_texture GLEW_GET_VAR(__GLEW_ARB_bindless_texture) + +#endif /* GL_ARB_bindless_texture */ + +/* ----------------------- GL_ARB_blend_func_extended ---------------------- */ + +#ifndef GL_ARB_blend_func_extended +#define GL_ARB_blend_func_extended 1 + +#define GL_SRC1_COLOR 0x88F9 +#define GL_ONE_MINUS_SRC1_COLOR 0x88FA +#define GL_ONE_MINUS_SRC1_ALPHA 0x88FB +#define GL_MAX_DUAL_SOURCE_DRAW_BUFFERS 0x88FC + +typedef void (GLAPIENTRY * PFNGLBINDFRAGDATALOCATIONINDEXEDPROC) (GLuint program, GLuint colorNumber, GLuint index, const GLchar * name); +typedef GLint (GLAPIENTRY * PFNGLGETFRAGDATAINDEXPROC) (GLuint program, const GLchar * name); + +#define glBindFragDataLocationIndexed GLEW_GET_FUN(__glewBindFragDataLocationIndexed) +#define glGetFragDataIndex GLEW_GET_FUN(__glewGetFragDataIndex) + +#define GLEW_ARB_blend_func_extended GLEW_GET_VAR(__GLEW_ARB_blend_func_extended) + +#endif /* GL_ARB_blend_func_extended */ + +/* ------------------------- GL_ARB_buffer_storage ------------------------- */ + +#ifndef GL_ARB_buffer_storage +#define GL_ARB_buffer_storage 1 + +#define GL_MAP_READ_BIT 0x0001 +#define GL_MAP_WRITE_BIT 0x0002 +#define GL_MAP_PERSISTENT_BIT 0x00000040 +#define GL_MAP_COHERENT_BIT 0x00000080 +#define GL_DYNAMIC_STORAGE_BIT 0x0100 +#define GL_CLIENT_STORAGE_BIT 0x0200 +#define GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT 0x00004000 +#define GL_BUFFER_IMMUTABLE_STORAGE 0x821F +#define GL_BUFFER_STORAGE_FLAGS 0x8220 + +typedef void (GLAPIENTRY * PFNGLBUFFERSTORAGEPROC) (GLenum target, GLsizeiptr size, const GLvoid* data, GLbitfield flags); +typedef void (GLAPIENTRY * PFNGLNAMEDBUFFERSTORAGEEXTPROC) (GLuint buffer, GLsizeiptr size, const GLvoid* data, GLbitfield flags); + +#define glBufferStorage GLEW_GET_FUN(__glewBufferStorage) +#define glNamedBufferStorageEXT GLEW_GET_FUN(__glewNamedBufferStorageEXT) + +#define GLEW_ARB_buffer_storage GLEW_GET_VAR(__GLEW_ARB_buffer_storage) + +#endif /* GL_ARB_buffer_storage */ + +/* ---------------------------- GL_ARB_cl_event ---------------------------- */ + +#ifndef GL_ARB_cl_event +#define GL_ARB_cl_event 1 + +#define GL_SYNC_CL_EVENT_ARB 0x8240 +#define GL_SYNC_CL_EVENT_COMPLETE_ARB 0x8241 + +typedef struct _cl_context *cl_context; +typedef struct _cl_event *cl_event; + +typedef GLsync (GLAPIENTRY * PFNGLCREATESYNCFROMCLEVENTARBPROC) (cl_context context, cl_event event, GLbitfield flags); + +#define glCreateSyncFromCLeventARB GLEW_GET_FUN(__glewCreateSyncFromCLeventARB) + +#define GLEW_ARB_cl_event GLEW_GET_VAR(__GLEW_ARB_cl_event) + +#endif /* GL_ARB_cl_event */ + +/* ----------------------- GL_ARB_clear_buffer_object ---------------------- */ + +#ifndef GL_ARB_clear_buffer_object +#define GL_ARB_clear_buffer_object 1 + +typedef void (GLAPIENTRY * PFNGLCLEARBUFFERDATAPROC) (GLenum target, GLenum internalformat, GLenum format, GLenum type, const GLvoid* data); +typedef void (GLAPIENTRY * PFNGLCLEARBUFFERSUBDATAPROC) (GLenum target, GLenum internalformat, GLintptr offset, GLsizeiptr size, GLenum format, GLenum type, const GLvoid* data); +typedef void (GLAPIENTRY * PFNGLCLEARNAMEDBUFFERDATAEXTPROC) (GLuint buffer, GLenum internalformat, GLenum format, GLenum type, const GLvoid* data); +typedef void (GLAPIENTRY * PFNGLCLEARNAMEDBUFFERSUBDATAEXTPROC) (GLuint buffer, GLenum internalformat, GLintptr offset, GLsizeiptr size, GLenum format, GLenum type, const GLvoid* data); + +#define glClearBufferData GLEW_GET_FUN(__glewClearBufferData) +#define glClearBufferSubData GLEW_GET_FUN(__glewClearBufferSubData) +#define glClearNamedBufferDataEXT GLEW_GET_FUN(__glewClearNamedBufferDataEXT) +#define glClearNamedBufferSubDataEXT GLEW_GET_FUN(__glewClearNamedBufferSubDataEXT) + +#define GLEW_ARB_clear_buffer_object GLEW_GET_VAR(__GLEW_ARB_clear_buffer_object) + +#endif /* GL_ARB_clear_buffer_object */ + +/* -------------------------- GL_ARB_clear_texture ------------------------- */ + +#ifndef GL_ARB_clear_texture +#define GL_ARB_clear_texture 1 + +#define GL_CLEAR_TEXTURE 0x9365 + +typedef void (GLAPIENTRY * PFNGLCLEARTEXIMAGEPROC) (GLuint texture, GLint level, GLenum format, GLenum type, const GLvoid* data); +typedef void (GLAPIENTRY * PFNGLCLEARTEXSUBIMAGEPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid* data); + +#define glClearTexImage GLEW_GET_FUN(__glewClearTexImage) +#define glClearTexSubImage GLEW_GET_FUN(__glewClearTexSubImage) + +#define GLEW_ARB_clear_texture GLEW_GET_VAR(__GLEW_ARB_clear_texture) + +#endif /* GL_ARB_clear_texture */ + +/* ----------------------- GL_ARB_color_buffer_float ----------------------- */ + +#ifndef GL_ARB_color_buffer_float +#define GL_ARB_color_buffer_float 1 + +#define GL_RGBA_FLOAT_MODE_ARB 0x8820 +#define GL_CLAMP_VERTEX_COLOR_ARB 0x891A +#define GL_CLAMP_FRAGMENT_COLOR_ARB 0x891B +#define GL_CLAMP_READ_COLOR_ARB 0x891C +#define GL_FIXED_ONLY_ARB 0x891D + +typedef void (GLAPIENTRY * PFNGLCLAMPCOLORARBPROC) (GLenum target, GLenum clamp); + +#define glClampColorARB GLEW_GET_FUN(__glewClampColorARB) + +#define GLEW_ARB_color_buffer_float GLEW_GET_VAR(__GLEW_ARB_color_buffer_float) + +#endif /* GL_ARB_color_buffer_float */ + +/* -------------------------- GL_ARB_compatibility ------------------------- */ + +#ifndef GL_ARB_compatibility +#define GL_ARB_compatibility 1 + +#define GLEW_ARB_compatibility GLEW_GET_VAR(__GLEW_ARB_compatibility) + +#endif /* GL_ARB_compatibility */ + +/* ---------------- GL_ARB_compressed_texture_pixel_storage ---------------- */ + +#ifndef GL_ARB_compressed_texture_pixel_storage +#define GL_ARB_compressed_texture_pixel_storage 1 + +#define GL_UNPACK_COMPRESSED_BLOCK_WIDTH 0x9127 +#define GL_UNPACK_COMPRESSED_BLOCK_HEIGHT 0x9128 +#define GL_UNPACK_COMPRESSED_BLOCK_DEPTH 0x9129 +#define GL_UNPACK_COMPRESSED_BLOCK_SIZE 0x912A +#define GL_PACK_COMPRESSED_BLOCK_WIDTH 0x912B +#define GL_PACK_COMPRESSED_BLOCK_HEIGHT 0x912C +#define GL_PACK_COMPRESSED_BLOCK_DEPTH 0x912D +#define GL_PACK_COMPRESSED_BLOCK_SIZE 0x912E + +#define GLEW_ARB_compressed_texture_pixel_storage GLEW_GET_VAR(__GLEW_ARB_compressed_texture_pixel_storage) + +#endif /* GL_ARB_compressed_texture_pixel_storage */ + +/* ------------------------- GL_ARB_compute_shader ------------------------- */ + +#ifndef GL_ARB_compute_shader +#define GL_ARB_compute_shader 1 + +#define GL_COMPUTE_SHADER_BIT 0x00000020 +#define GL_MAX_COMPUTE_SHARED_MEMORY_SIZE 0x8262 +#define GL_MAX_COMPUTE_UNIFORM_COMPONENTS 0x8263 +#define GL_MAX_COMPUTE_ATOMIC_COUNTER_BUFFERS 0x8264 +#define GL_MAX_COMPUTE_ATOMIC_COUNTERS 0x8265 +#define GL_MAX_COMBINED_COMPUTE_UNIFORM_COMPONENTS 0x8266 +#define GL_COMPUTE_WORK_GROUP_SIZE 0x8267 +#define GL_MAX_COMPUTE_WORK_GROUP_INVOCATIONS 0x90EB +#define GL_UNIFORM_BLOCK_REFERENCED_BY_COMPUTE_SHADER 0x90EC +#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_COMPUTE_SHADER 0x90ED +#define GL_DISPATCH_INDIRECT_BUFFER 0x90EE +#define GL_DISPATCH_INDIRECT_BUFFER_BINDING 0x90EF +#define GL_COMPUTE_SHADER 0x91B9 +#define GL_MAX_COMPUTE_UNIFORM_BLOCKS 0x91BB +#define GL_MAX_COMPUTE_TEXTURE_IMAGE_UNITS 0x91BC +#define GL_MAX_COMPUTE_IMAGE_UNIFORMS 0x91BD +#define GL_MAX_COMPUTE_WORK_GROUP_COUNT 0x91BE +#define GL_MAX_COMPUTE_WORK_GROUP_SIZE 0x91BF + +typedef void (GLAPIENTRY * PFNGLDISPATCHCOMPUTEPROC) (GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z); +typedef void (GLAPIENTRY * PFNGLDISPATCHCOMPUTEINDIRECTPROC) (GLintptr indirect); + +#define glDispatchCompute GLEW_GET_FUN(__glewDispatchCompute) +#define glDispatchComputeIndirect GLEW_GET_FUN(__glewDispatchComputeIndirect) + +#define GLEW_ARB_compute_shader GLEW_GET_VAR(__GLEW_ARB_compute_shader) + +#endif /* GL_ARB_compute_shader */ + +/* ------------------- GL_ARB_compute_variable_group_size ------------------ */ + +#ifndef GL_ARB_compute_variable_group_size +#define GL_ARB_compute_variable_group_size 1 + +#define GL_MAX_COMPUTE_FIXED_GROUP_INVOCATIONS_ARB 0x90EB +#define GL_MAX_COMPUTE_FIXED_GROUP_SIZE_ARB 0x91BF +#define GL_MAX_COMPUTE_VARIABLE_GROUP_INVOCATIONS_ARB 0x9344 +#define GL_MAX_COMPUTE_VARIABLE_GROUP_SIZE_ARB 0x9345 + +typedef void (GLAPIENTRY * PFNGLDISPATCHCOMPUTEGROUPSIZEARBPROC) (GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z, GLuint group_size_x, GLuint group_size_y, GLuint group_size_z); + +#define glDispatchComputeGroupSizeARB GLEW_GET_FUN(__glewDispatchComputeGroupSizeARB) + +#define GLEW_ARB_compute_variable_group_size GLEW_GET_VAR(__GLEW_ARB_compute_variable_group_size) + +#endif /* GL_ARB_compute_variable_group_size */ + +/* ----------------------- GL_ARB_conservative_depth ----------------------- */ + +#ifndef GL_ARB_conservative_depth +#define GL_ARB_conservative_depth 1 + +#define GLEW_ARB_conservative_depth GLEW_GET_VAR(__GLEW_ARB_conservative_depth) + +#endif /* GL_ARB_conservative_depth */ + +/* --------------------------- GL_ARB_copy_buffer -------------------------- */ + +#ifndef GL_ARB_copy_buffer +#define GL_ARB_copy_buffer 1 + +#define GL_COPY_READ_BUFFER 0x8F36 +#define GL_COPY_WRITE_BUFFER 0x8F37 + +typedef void (GLAPIENTRY * PFNGLCOPYBUFFERSUBDATAPROC) (GLenum readtarget, GLenum writetarget, GLintptr readoffset, GLintptr writeoffset, GLsizeiptr size); + +#define glCopyBufferSubData GLEW_GET_FUN(__glewCopyBufferSubData) + +#define GLEW_ARB_copy_buffer GLEW_GET_VAR(__GLEW_ARB_copy_buffer) + +#endif /* GL_ARB_copy_buffer */ + +/* --------------------------- GL_ARB_copy_image --------------------------- */ + +#ifndef GL_ARB_copy_image +#define GL_ARB_copy_image 1 + +typedef void (GLAPIENTRY * PFNGLCOPYIMAGESUBDATAPROC) (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth); + +#define glCopyImageSubData GLEW_GET_FUN(__glewCopyImageSubData) + +#define GLEW_ARB_copy_image GLEW_GET_VAR(__GLEW_ARB_copy_image) + +#endif /* GL_ARB_copy_image */ + +/* -------------------------- GL_ARB_debug_output -------------------------- */ + +#ifndef GL_ARB_debug_output +#define GL_ARB_debug_output 1 + +#define GL_DEBUG_OUTPUT_SYNCHRONOUS_ARB 0x8242 +#define GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH_ARB 0x8243 +#define GL_DEBUG_CALLBACK_FUNCTION_ARB 0x8244 +#define GL_DEBUG_CALLBACK_USER_PARAM_ARB 0x8245 +#define GL_DEBUG_SOURCE_API_ARB 0x8246 +#define GL_DEBUG_SOURCE_WINDOW_SYSTEM_ARB 0x8247 +#define GL_DEBUG_SOURCE_SHADER_COMPILER_ARB 0x8248 +#define GL_DEBUG_SOURCE_THIRD_PARTY_ARB 0x8249 +#define GL_DEBUG_SOURCE_APPLICATION_ARB 0x824A +#define GL_DEBUG_SOURCE_OTHER_ARB 0x824B +#define GL_DEBUG_TYPE_ERROR_ARB 0x824C +#define GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR_ARB 0x824D +#define GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR_ARB 0x824E +#define GL_DEBUG_TYPE_PORTABILITY_ARB 0x824F +#define GL_DEBUG_TYPE_PERFORMANCE_ARB 0x8250 +#define GL_DEBUG_TYPE_OTHER_ARB 0x8251 +#define GL_MAX_DEBUG_MESSAGE_LENGTH_ARB 0x9143 +#define GL_MAX_DEBUG_LOGGED_MESSAGES_ARB 0x9144 +#define GL_DEBUG_LOGGED_MESSAGES_ARB 0x9145 +#define GL_DEBUG_SEVERITY_HIGH_ARB 0x9146 +#define GL_DEBUG_SEVERITY_MEDIUM_ARB 0x9147 +#define GL_DEBUG_SEVERITY_LOW_ARB 0x9148 + +typedef void (APIENTRY *GLDEBUGPROCARB)(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar* message, GLvoid* userParam); + +typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGECALLBACKARBPROC) (GLDEBUGPROCARB callback, const GLvoid *userParam); +typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGECONTROLARBPROC) (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint* ids, GLboolean enabled); +typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGEINSERTARBPROC) (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar* buf); +typedef GLuint (GLAPIENTRY * PFNGLGETDEBUGMESSAGELOGARBPROC) (GLuint count, GLsizei bufsize, GLenum* sources, GLenum* types, GLuint* ids, GLenum* severities, GLsizei* lengths, GLchar* messageLog); + +#define glDebugMessageCallbackARB GLEW_GET_FUN(__glewDebugMessageCallbackARB) +#define glDebugMessageControlARB GLEW_GET_FUN(__glewDebugMessageControlARB) +#define glDebugMessageInsertARB GLEW_GET_FUN(__glewDebugMessageInsertARB) +#define glGetDebugMessageLogARB GLEW_GET_FUN(__glewGetDebugMessageLogARB) + +#define GLEW_ARB_debug_output GLEW_GET_VAR(__GLEW_ARB_debug_output) + +#endif /* GL_ARB_debug_output */ + +/* ----------------------- GL_ARB_depth_buffer_float ----------------------- */ + +#ifndef GL_ARB_depth_buffer_float +#define GL_ARB_depth_buffer_float 1 + +#define GL_DEPTH_COMPONENT32F 0x8CAC +#define GL_DEPTH32F_STENCIL8 0x8CAD +#define GL_FLOAT_32_UNSIGNED_INT_24_8_REV 0x8DAD + +#define GLEW_ARB_depth_buffer_float GLEW_GET_VAR(__GLEW_ARB_depth_buffer_float) + +#endif /* GL_ARB_depth_buffer_float */ + +/* --------------------------- GL_ARB_depth_clamp -------------------------- */ + +#ifndef GL_ARB_depth_clamp +#define GL_ARB_depth_clamp 1 + +#define GL_DEPTH_CLAMP 0x864F + +#define GLEW_ARB_depth_clamp GLEW_GET_VAR(__GLEW_ARB_depth_clamp) + +#endif /* GL_ARB_depth_clamp */ + +/* -------------------------- GL_ARB_depth_texture ------------------------- */ + +#ifndef GL_ARB_depth_texture +#define GL_ARB_depth_texture 1 + +#define GL_DEPTH_COMPONENT16_ARB 0x81A5 +#define GL_DEPTH_COMPONENT24_ARB 0x81A6 +#define GL_DEPTH_COMPONENT32_ARB 0x81A7 +#define GL_TEXTURE_DEPTH_SIZE_ARB 0x884A +#define GL_DEPTH_TEXTURE_MODE_ARB 0x884B + +#define GLEW_ARB_depth_texture GLEW_GET_VAR(__GLEW_ARB_depth_texture) + +#endif /* GL_ARB_depth_texture */ + +/* -------------------------- GL_ARB_draw_buffers -------------------------- */ + +#ifndef GL_ARB_draw_buffers +#define GL_ARB_draw_buffers 1 + +#define GL_MAX_DRAW_BUFFERS_ARB 0x8824 +#define GL_DRAW_BUFFER0_ARB 0x8825 +#define GL_DRAW_BUFFER1_ARB 0x8826 +#define GL_DRAW_BUFFER2_ARB 0x8827 +#define GL_DRAW_BUFFER3_ARB 0x8828 +#define GL_DRAW_BUFFER4_ARB 0x8829 +#define GL_DRAW_BUFFER5_ARB 0x882A +#define GL_DRAW_BUFFER6_ARB 0x882B +#define GL_DRAW_BUFFER7_ARB 0x882C +#define GL_DRAW_BUFFER8_ARB 0x882D +#define GL_DRAW_BUFFER9_ARB 0x882E +#define GL_DRAW_BUFFER10_ARB 0x882F +#define GL_DRAW_BUFFER11_ARB 0x8830 +#define GL_DRAW_BUFFER12_ARB 0x8831 +#define GL_DRAW_BUFFER13_ARB 0x8832 +#define GL_DRAW_BUFFER14_ARB 0x8833 +#define GL_DRAW_BUFFER15_ARB 0x8834 + +typedef void (GLAPIENTRY * PFNGLDRAWBUFFERSARBPROC) (GLsizei n, const GLenum* bufs); + +#define glDrawBuffersARB GLEW_GET_FUN(__glewDrawBuffersARB) + +#define GLEW_ARB_draw_buffers GLEW_GET_VAR(__GLEW_ARB_draw_buffers) + +#endif /* GL_ARB_draw_buffers */ + +/* ----------------------- GL_ARB_draw_buffers_blend ----------------------- */ + +#ifndef GL_ARB_draw_buffers_blend +#define GL_ARB_draw_buffers_blend 1 + +typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONSEPARATEIARBPROC) (GLuint buf, GLenum modeRGB, GLenum modeAlpha); +typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONIARBPROC) (GLuint buf, GLenum mode); +typedef void (GLAPIENTRY * PFNGLBLENDFUNCSEPARATEIARBPROC) (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); +typedef void (GLAPIENTRY * PFNGLBLENDFUNCIARBPROC) (GLuint buf, GLenum src, GLenum dst); + +#define glBlendEquationSeparateiARB GLEW_GET_FUN(__glewBlendEquationSeparateiARB) +#define glBlendEquationiARB GLEW_GET_FUN(__glewBlendEquationiARB) +#define glBlendFuncSeparateiARB GLEW_GET_FUN(__glewBlendFuncSeparateiARB) +#define glBlendFunciARB GLEW_GET_FUN(__glewBlendFunciARB) + +#define GLEW_ARB_draw_buffers_blend GLEW_GET_VAR(__GLEW_ARB_draw_buffers_blend) + +#endif /* GL_ARB_draw_buffers_blend */ + +/* -------------------- GL_ARB_draw_elements_base_vertex ------------------- */ + +#ifndef GL_ARB_draw_elements_base_vertex +#define GL_ARB_draw_elements_base_vertex 1 + +typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSBASEVERTEXPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLint basevertex); +typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount, GLint basevertex); +typedef void (GLAPIENTRY * PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices, GLint basevertex); +typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC) (GLenum mode, const GLsizei* count, GLenum type, const GLvoid* const *indices, GLsizei primcount, const GLint *basevertex); + +#define glDrawElementsBaseVertex GLEW_GET_FUN(__glewDrawElementsBaseVertex) +#define glDrawElementsInstancedBaseVertex GLEW_GET_FUN(__glewDrawElementsInstancedBaseVertex) +#define glDrawRangeElementsBaseVertex GLEW_GET_FUN(__glewDrawRangeElementsBaseVertex) +#define glMultiDrawElementsBaseVertex GLEW_GET_FUN(__glewMultiDrawElementsBaseVertex) + +#define GLEW_ARB_draw_elements_base_vertex GLEW_GET_VAR(__GLEW_ARB_draw_elements_base_vertex) + +#endif /* GL_ARB_draw_elements_base_vertex */ + +/* -------------------------- GL_ARB_draw_indirect ------------------------- */ + +#ifndef GL_ARB_draw_indirect +#define GL_ARB_draw_indirect 1 + +#define GL_DRAW_INDIRECT_BUFFER 0x8F3F +#define GL_DRAW_INDIRECT_BUFFER_BINDING 0x8F43 + +typedef void (GLAPIENTRY * PFNGLDRAWARRAYSINDIRECTPROC) (GLenum mode, const GLvoid *indirect); +typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINDIRECTPROC) (GLenum mode, GLenum type, const GLvoid *indirect); + +#define glDrawArraysIndirect GLEW_GET_FUN(__glewDrawArraysIndirect) +#define glDrawElementsIndirect GLEW_GET_FUN(__glewDrawElementsIndirect) + +#define GLEW_ARB_draw_indirect GLEW_GET_VAR(__GLEW_ARB_draw_indirect) + +#endif /* GL_ARB_draw_indirect */ + +/* ------------------------- GL_ARB_draw_instanced ------------------------- */ + +#ifndef GL_ARB_draw_instanced +#define GL_ARB_draw_instanced 1 + +#define GLEW_ARB_draw_instanced GLEW_GET_VAR(__GLEW_ARB_draw_instanced) + +#endif /* GL_ARB_draw_instanced */ + +/* ------------------------ GL_ARB_enhanced_layouts ------------------------ */ + +#ifndef GL_ARB_enhanced_layouts +#define GL_ARB_enhanced_layouts 1 + +#define GL_LOCATION_COMPONENT 0x934A +#define GL_TRANSFORM_FEEDBACK_BUFFER_INDEX 0x934B +#define GL_TRANSFORM_FEEDBACK_BUFFER_STRIDE 0x934C + +#define GLEW_ARB_enhanced_layouts GLEW_GET_VAR(__GLEW_ARB_enhanced_layouts) + +#endif /* GL_ARB_enhanced_layouts */ + +/* -------------------- GL_ARB_explicit_attrib_location -------------------- */ + +#ifndef GL_ARB_explicit_attrib_location +#define GL_ARB_explicit_attrib_location 1 + +#define GLEW_ARB_explicit_attrib_location GLEW_GET_VAR(__GLEW_ARB_explicit_attrib_location) + +#endif /* GL_ARB_explicit_attrib_location */ + +/* -------------------- GL_ARB_explicit_uniform_location ------------------- */ + +#ifndef GL_ARB_explicit_uniform_location +#define GL_ARB_explicit_uniform_location 1 + +#define GL_MAX_UNIFORM_LOCATIONS 0x826E + +#define GLEW_ARB_explicit_uniform_location GLEW_GET_VAR(__GLEW_ARB_explicit_uniform_location) + +#endif /* GL_ARB_explicit_uniform_location */ + +/* ------------------- GL_ARB_fragment_coord_conventions ------------------- */ + +#ifndef GL_ARB_fragment_coord_conventions +#define GL_ARB_fragment_coord_conventions 1 + +#define GLEW_ARB_fragment_coord_conventions GLEW_GET_VAR(__GLEW_ARB_fragment_coord_conventions) + +#endif /* GL_ARB_fragment_coord_conventions */ + +/* --------------------- GL_ARB_fragment_layer_viewport -------------------- */ + +#ifndef GL_ARB_fragment_layer_viewport +#define GL_ARB_fragment_layer_viewport 1 + +#define GLEW_ARB_fragment_layer_viewport GLEW_GET_VAR(__GLEW_ARB_fragment_layer_viewport) + +#endif /* GL_ARB_fragment_layer_viewport */ + +/* ------------------------ GL_ARB_fragment_program ------------------------ */ + +#ifndef GL_ARB_fragment_program +#define GL_ARB_fragment_program 1 + +#define GL_FRAGMENT_PROGRAM_ARB 0x8804 +#define GL_PROGRAM_ALU_INSTRUCTIONS_ARB 0x8805 +#define GL_PROGRAM_TEX_INSTRUCTIONS_ARB 0x8806 +#define GL_PROGRAM_TEX_INDIRECTIONS_ARB 0x8807 +#define GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x8808 +#define GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x8809 +#define GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x880A +#define GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB 0x880B +#define GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB 0x880C +#define GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB 0x880D +#define GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x880E +#define GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x880F +#define GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x8810 +#define GL_MAX_TEXTURE_COORDS_ARB 0x8871 +#define GL_MAX_TEXTURE_IMAGE_UNITS_ARB 0x8872 + +#define GLEW_ARB_fragment_program GLEW_GET_VAR(__GLEW_ARB_fragment_program) + +#endif /* GL_ARB_fragment_program */ + +/* --------------------- GL_ARB_fragment_program_shadow -------------------- */ + +#ifndef GL_ARB_fragment_program_shadow +#define GL_ARB_fragment_program_shadow 1 + +#define GLEW_ARB_fragment_program_shadow GLEW_GET_VAR(__GLEW_ARB_fragment_program_shadow) + +#endif /* GL_ARB_fragment_program_shadow */ + +/* ------------------------- GL_ARB_fragment_shader ------------------------ */ + +#ifndef GL_ARB_fragment_shader +#define GL_ARB_fragment_shader 1 + +#define GL_FRAGMENT_SHADER_ARB 0x8B30 +#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB 0x8B49 +#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB 0x8B8B + +#define GLEW_ARB_fragment_shader GLEW_GET_VAR(__GLEW_ARB_fragment_shader) + +#endif /* GL_ARB_fragment_shader */ + +/* ------------------- GL_ARB_framebuffer_no_attachments ------------------- */ + +#ifndef GL_ARB_framebuffer_no_attachments +#define GL_ARB_framebuffer_no_attachments 1 + +#define GL_FRAMEBUFFER_DEFAULT_WIDTH 0x9310 +#define GL_FRAMEBUFFER_DEFAULT_HEIGHT 0x9311 +#define GL_FRAMEBUFFER_DEFAULT_LAYERS 0x9312 +#define GL_FRAMEBUFFER_DEFAULT_SAMPLES 0x9313 +#define GL_FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS 0x9314 +#define GL_MAX_FRAMEBUFFER_WIDTH 0x9315 +#define GL_MAX_FRAMEBUFFER_HEIGHT 0x9316 +#define GL_MAX_FRAMEBUFFER_LAYERS 0x9317 +#define GL_MAX_FRAMEBUFFER_SAMPLES 0x9318 + +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERPARAMETERIPROC) (GLenum target, GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLGETFRAMEBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVEXTPROC) (GLuint framebuffer, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERPARAMETERIEXTPROC) (GLuint framebuffer, GLenum pname, GLint param); + +#define glFramebufferParameteri GLEW_GET_FUN(__glewFramebufferParameteri) +#define glGetFramebufferParameteriv GLEW_GET_FUN(__glewGetFramebufferParameteriv) +#define glGetNamedFramebufferParameterivEXT GLEW_GET_FUN(__glewGetNamedFramebufferParameterivEXT) +#define glNamedFramebufferParameteriEXT GLEW_GET_FUN(__glewNamedFramebufferParameteriEXT) + +#define GLEW_ARB_framebuffer_no_attachments GLEW_GET_VAR(__GLEW_ARB_framebuffer_no_attachments) + +#endif /* GL_ARB_framebuffer_no_attachments */ + +/* ----------------------- GL_ARB_framebuffer_object ----------------------- */ + +#ifndef GL_ARB_framebuffer_object +#define GL_ARB_framebuffer_object 1 + +#define GL_INVALID_FRAMEBUFFER_OPERATION 0x0506 +#define GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING 0x8210 +#define GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE 0x8211 +#define GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE 0x8212 +#define GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE 0x8213 +#define GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE 0x8214 +#define GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE 0x8215 +#define GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE 0x8216 +#define GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE 0x8217 +#define GL_FRAMEBUFFER_DEFAULT 0x8218 +#define GL_FRAMEBUFFER_UNDEFINED 0x8219 +#define GL_DEPTH_STENCIL_ATTACHMENT 0x821A +#define GL_INDEX 0x8222 +#define GL_MAX_RENDERBUFFER_SIZE 0x84E8 +#define GL_DEPTH_STENCIL 0x84F9 +#define GL_UNSIGNED_INT_24_8 0x84FA +#define GL_DEPTH24_STENCIL8 0x88F0 +#define GL_TEXTURE_STENCIL_SIZE 0x88F1 +#define GL_UNSIGNED_NORMALIZED 0x8C17 +#define GL_SRGB 0x8C40 +#define GL_DRAW_FRAMEBUFFER_BINDING 0x8CA6 +#define GL_FRAMEBUFFER_BINDING 0x8CA6 +#define GL_RENDERBUFFER_BINDING 0x8CA7 +#define GL_READ_FRAMEBUFFER 0x8CA8 +#define GL_DRAW_FRAMEBUFFER 0x8CA9 +#define GL_READ_FRAMEBUFFER_BINDING 0x8CAA +#define GL_RENDERBUFFER_SAMPLES 0x8CAB +#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE 0x8CD0 +#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME 0x8CD1 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL 0x8CD2 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE 0x8CD3 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER 0x8CD4 +#define GL_FRAMEBUFFER_COMPLETE 0x8CD5 +#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT 0x8CD6 +#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT 0x8CD7 +#define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER 0x8CDB +#define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER 0x8CDC +#define GL_FRAMEBUFFER_UNSUPPORTED 0x8CDD +#define GL_MAX_COLOR_ATTACHMENTS 0x8CDF +#define GL_COLOR_ATTACHMENT0 0x8CE0 +#define GL_COLOR_ATTACHMENT1 0x8CE1 +#define GL_COLOR_ATTACHMENT2 0x8CE2 +#define GL_COLOR_ATTACHMENT3 0x8CE3 +#define GL_COLOR_ATTACHMENT4 0x8CE4 +#define GL_COLOR_ATTACHMENT5 0x8CE5 +#define GL_COLOR_ATTACHMENT6 0x8CE6 +#define GL_COLOR_ATTACHMENT7 0x8CE7 +#define GL_COLOR_ATTACHMENT8 0x8CE8 +#define GL_COLOR_ATTACHMENT9 0x8CE9 +#define GL_COLOR_ATTACHMENT10 0x8CEA +#define GL_COLOR_ATTACHMENT11 0x8CEB +#define GL_COLOR_ATTACHMENT12 0x8CEC +#define GL_COLOR_ATTACHMENT13 0x8CED +#define GL_COLOR_ATTACHMENT14 0x8CEE +#define GL_COLOR_ATTACHMENT15 0x8CEF +#define GL_DEPTH_ATTACHMENT 0x8D00 +#define GL_STENCIL_ATTACHMENT 0x8D20 +#define GL_FRAMEBUFFER 0x8D40 +#define GL_RENDERBUFFER 0x8D41 +#define GL_RENDERBUFFER_WIDTH 0x8D42 +#define GL_RENDERBUFFER_HEIGHT 0x8D43 +#define GL_RENDERBUFFER_INTERNAL_FORMAT 0x8D44 +#define GL_STENCIL_INDEX1 0x8D46 +#define GL_STENCIL_INDEX4 0x8D47 +#define GL_STENCIL_INDEX8 0x8D48 +#define GL_STENCIL_INDEX16 0x8D49 +#define GL_RENDERBUFFER_RED_SIZE 0x8D50 +#define GL_RENDERBUFFER_GREEN_SIZE 0x8D51 +#define GL_RENDERBUFFER_BLUE_SIZE 0x8D52 +#define GL_RENDERBUFFER_ALPHA_SIZE 0x8D53 +#define GL_RENDERBUFFER_DEPTH_SIZE 0x8D54 +#define GL_RENDERBUFFER_STENCIL_SIZE 0x8D55 +#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE 0x8D56 +#define GL_MAX_SAMPLES 0x8D57 + +typedef void (GLAPIENTRY * PFNGLBINDFRAMEBUFFERPROC) (GLenum target, GLuint framebuffer); +typedef void (GLAPIENTRY * PFNGLBINDRENDERBUFFERPROC) (GLenum target, GLuint renderbuffer); +typedef void (GLAPIENTRY * PFNGLBLITFRAMEBUFFERPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); +typedef GLenum (GLAPIENTRY * PFNGLCHECKFRAMEBUFFERSTATUSPROC) (GLenum target); +typedef void (GLAPIENTRY * PFNGLDELETEFRAMEBUFFERSPROC) (GLsizei n, const GLuint* framebuffers); +typedef void (GLAPIENTRY * PFNGLDELETERENDERBUFFERSPROC) (GLsizei n, const GLuint* renderbuffers); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERRENDERBUFFERPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURE1DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURE2DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURE3DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint layer); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURELAYERPROC) (GLenum target,GLenum attachment, GLuint texture,GLint level,GLint layer); +typedef void (GLAPIENTRY * PFNGLGENFRAMEBUFFERSPROC) (GLsizei n, GLuint* framebuffers); +typedef void (GLAPIENTRY * PFNGLGENRENDERBUFFERSPROC) (GLsizei n, GLuint* renderbuffers); +typedef void (GLAPIENTRY * PFNGLGENERATEMIPMAPPROC) (GLenum target); +typedef void (GLAPIENTRY * PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC) (GLenum target, GLenum attachment, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETRENDERBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint* params); +typedef GLboolean (GLAPIENTRY * PFNGLISFRAMEBUFFERPROC) (GLuint framebuffer); +typedef GLboolean (GLAPIENTRY * PFNGLISRENDERBUFFERPROC) (GLuint renderbuffer); +typedef void (GLAPIENTRY * PFNGLRENDERBUFFERSTORAGEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); + +#define glBindFramebuffer GLEW_GET_FUN(__glewBindFramebuffer) +#define glBindRenderbuffer GLEW_GET_FUN(__glewBindRenderbuffer) +#define glBlitFramebuffer GLEW_GET_FUN(__glewBlitFramebuffer) +#define glCheckFramebufferStatus GLEW_GET_FUN(__glewCheckFramebufferStatus) +#define glDeleteFramebuffers GLEW_GET_FUN(__glewDeleteFramebuffers) +#define glDeleteRenderbuffers GLEW_GET_FUN(__glewDeleteRenderbuffers) +#define glFramebufferRenderbuffer GLEW_GET_FUN(__glewFramebufferRenderbuffer) +#define glFramebufferTexture1D GLEW_GET_FUN(__glewFramebufferTexture1D) +#define glFramebufferTexture2D GLEW_GET_FUN(__glewFramebufferTexture2D) +#define glFramebufferTexture3D GLEW_GET_FUN(__glewFramebufferTexture3D) +#define glFramebufferTextureLayer GLEW_GET_FUN(__glewFramebufferTextureLayer) +#define glGenFramebuffers GLEW_GET_FUN(__glewGenFramebuffers) +#define glGenRenderbuffers GLEW_GET_FUN(__glewGenRenderbuffers) +#define glGenerateMipmap GLEW_GET_FUN(__glewGenerateMipmap) +#define glGetFramebufferAttachmentParameteriv GLEW_GET_FUN(__glewGetFramebufferAttachmentParameteriv) +#define glGetRenderbufferParameteriv GLEW_GET_FUN(__glewGetRenderbufferParameteriv) +#define glIsFramebuffer GLEW_GET_FUN(__glewIsFramebuffer) +#define glIsRenderbuffer GLEW_GET_FUN(__glewIsRenderbuffer) +#define glRenderbufferStorage GLEW_GET_FUN(__glewRenderbufferStorage) +#define glRenderbufferStorageMultisample GLEW_GET_FUN(__glewRenderbufferStorageMultisample) + +#define GLEW_ARB_framebuffer_object GLEW_GET_VAR(__GLEW_ARB_framebuffer_object) + +#endif /* GL_ARB_framebuffer_object */ + +/* ------------------------ GL_ARB_framebuffer_sRGB ------------------------ */ + +#ifndef GL_ARB_framebuffer_sRGB +#define GL_ARB_framebuffer_sRGB 1 + +#define GL_FRAMEBUFFER_SRGB 0x8DB9 + +#define GLEW_ARB_framebuffer_sRGB GLEW_GET_VAR(__GLEW_ARB_framebuffer_sRGB) + +#endif /* GL_ARB_framebuffer_sRGB */ + +/* ------------------------ GL_ARB_geometry_shader4 ------------------------ */ + +#ifndef GL_ARB_geometry_shader4 +#define GL_ARB_geometry_shader4 1 + +#define GL_LINES_ADJACENCY_ARB 0xA +#define GL_LINE_STRIP_ADJACENCY_ARB 0xB +#define GL_TRIANGLES_ADJACENCY_ARB 0xC +#define GL_TRIANGLE_STRIP_ADJACENCY_ARB 0xD +#define GL_PROGRAM_POINT_SIZE_ARB 0x8642 +#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_ARB 0x8C29 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER 0x8CD4 +#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED_ARB 0x8DA7 +#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_ARB 0x8DA8 +#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_ARB 0x8DA9 +#define GL_GEOMETRY_SHADER_ARB 0x8DD9 +#define GL_GEOMETRY_VERTICES_OUT_ARB 0x8DDA +#define GL_GEOMETRY_INPUT_TYPE_ARB 0x8DDB +#define GL_GEOMETRY_OUTPUT_TYPE_ARB 0x8DDC +#define GL_MAX_GEOMETRY_VARYING_COMPONENTS_ARB 0x8DDD +#define GL_MAX_VERTEX_VARYING_COMPONENTS_ARB 0x8DDE +#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_ARB 0x8DDF +#define GL_MAX_GEOMETRY_OUTPUT_VERTICES_ARB 0x8DE0 +#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_ARB 0x8DE1 + +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTUREARBPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTUREFACEARBPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURELAYERARBPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); +typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETERIARBPROC) (GLuint program, GLenum pname, GLint value); + +#define glFramebufferTextureARB GLEW_GET_FUN(__glewFramebufferTextureARB) +#define glFramebufferTextureFaceARB GLEW_GET_FUN(__glewFramebufferTextureFaceARB) +#define glFramebufferTextureLayerARB GLEW_GET_FUN(__glewFramebufferTextureLayerARB) +#define glProgramParameteriARB GLEW_GET_FUN(__glewProgramParameteriARB) + +#define GLEW_ARB_geometry_shader4 GLEW_GET_VAR(__GLEW_ARB_geometry_shader4) + +#endif /* GL_ARB_geometry_shader4 */ + +/* ----------------------- GL_ARB_get_program_binary ----------------------- */ + +#ifndef GL_ARB_get_program_binary +#define GL_ARB_get_program_binary 1 + +#define GL_PROGRAM_BINARY_RETRIEVABLE_HINT 0x8257 +#define GL_PROGRAM_BINARY_LENGTH 0x8741 +#define GL_NUM_PROGRAM_BINARY_FORMATS 0x87FE +#define GL_PROGRAM_BINARY_FORMATS 0x87FF + +typedef void (GLAPIENTRY * PFNGLGETPROGRAMBINARYPROC) (GLuint program, GLsizei bufSize, GLsizei* length, GLenum *binaryFormat, GLvoid*binary); +typedef void (GLAPIENTRY * PFNGLPROGRAMBINARYPROC) (GLuint program, GLenum binaryFormat, const GLvoid *binary, GLsizei length); +typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETERIPROC) (GLuint program, GLenum pname, GLint value); + +#define glGetProgramBinary GLEW_GET_FUN(__glewGetProgramBinary) +#define glProgramBinary GLEW_GET_FUN(__glewProgramBinary) +#define glProgramParameteri GLEW_GET_FUN(__glewProgramParameteri) + +#define GLEW_ARB_get_program_binary GLEW_GET_VAR(__GLEW_ARB_get_program_binary) + +#endif /* GL_ARB_get_program_binary */ + +/* --------------------------- GL_ARB_gpu_shader5 -------------------------- */ + +#ifndef GL_ARB_gpu_shader5 +#define GL_ARB_gpu_shader5 1 + +#define GL_GEOMETRY_SHADER_INVOCATIONS 0x887F +#define GL_MAX_GEOMETRY_SHADER_INVOCATIONS 0x8E5A +#define GL_MIN_FRAGMENT_INTERPOLATION_OFFSET 0x8E5B +#define GL_MAX_FRAGMENT_INTERPOLATION_OFFSET 0x8E5C +#define GL_FRAGMENT_INTERPOLATION_OFFSET_BITS 0x8E5D +#define GL_MAX_VERTEX_STREAMS 0x8E71 + +#define GLEW_ARB_gpu_shader5 GLEW_GET_VAR(__GLEW_ARB_gpu_shader5) + +#endif /* GL_ARB_gpu_shader5 */ + +/* ------------------------- GL_ARB_gpu_shader_fp64 ------------------------ */ + +#ifndef GL_ARB_gpu_shader_fp64 +#define GL_ARB_gpu_shader_fp64 1 + +#define GL_DOUBLE_MAT2 0x8F46 +#define GL_DOUBLE_MAT3 0x8F47 +#define GL_DOUBLE_MAT4 0x8F48 +#define GL_DOUBLE_MAT2x3 0x8F49 +#define GL_DOUBLE_MAT2x4 0x8F4A +#define GL_DOUBLE_MAT3x2 0x8F4B +#define GL_DOUBLE_MAT3x4 0x8F4C +#define GL_DOUBLE_MAT4x2 0x8F4D +#define GL_DOUBLE_MAT4x3 0x8F4E +#define GL_DOUBLE_VEC2 0x8FFC +#define GL_DOUBLE_VEC3 0x8FFD +#define GL_DOUBLE_VEC4 0x8FFE + +typedef void (GLAPIENTRY * PFNGLGETUNIFORMDVPROC) (GLuint program, GLint location, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLUNIFORM1DPROC) (GLint location, GLdouble x); +typedef void (GLAPIENTRY * PFNGLUNIFORM1DVPROC) (GLint location, GLsizei count, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM2DPROC) (GLint location, GLdouble x, GLdouble y); +typedef void (GLAPIENTRY * PFNGLUNIFORM2DVPROC) (GLint location, GLsizei count, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM3DPROC) (GLint location, GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLUNIFORM3DVPROC) (GLint location, GLsizei count, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM4DPROC) (GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (GLAPIENTRY * PFNGLUNIFORM4DVPROC) (GLint location, GLsizei count, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX2DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX2X3DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX2X4DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX3DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX3X2DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX3X4DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4X2DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4X3DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); + +#define glGetUniformdv GLEW_GET_FUN(__glewGetUniformdv) +#define glUniform1d GLEW_GET_FUN(__glewUniform1d) +#define glUniform1dv GLEW_GET_FUN(__glewUniform1dv) +#define glUniform2d GLEW_GET_FUN(__glewUniform2d) +#define glUniform2dv GLEW_GET_FUN(__glewUniform2dv) +#define glUniform3d GLEW_GET_FUN(__glewUniform3d) +#define glUniform3dv GLEW_GET_FUN(__glewUniform3dv) +#define glUniform4d GLEW_GET_FUN(__glewUniform4d) +#define glUniform4dv GLEW_GET_FUN(__glewUniform4dv) +#define glUniformMatrix2dv GLEW_GET_FUN(__glewUniformMatrix2dv) +#define glUniformMatrix2x3dv GLEW_GET_FUN(__glewUniformMatrix2x3dv) +#define glUniformMatrix2x4dv GLEW_GET_FUN(__glewUniformMatrix2x4dv) +#define glUniformMatrix3dv GLEW_GET_FUN(__glewUniformMatrix3dv) +#define glUniformMatrix3x2dv GLEW_GET_FUN(__glewUniformMatrix3x2dv) +#define glUniformMatrix3x4dv GLEW_GET_FUN(__glewUniformMatrix3x4dv) +#define glUniformMatrix4dv GLEW_GET_FUN(__glewUniformMatrix4dv) +#define glUniformMatrix4x2dv GLEW_GET_FUN(__glewUniformMatrix4x2dv) +#define glUniformMatrix4x3dv GLEW_GET_FUN(__glewUniformMatrix4x3dv) + +#define GLEW_ARB_gpu_shader_fp64 GLEW_GET_VAR(__GLEW_ARB_gpu_shader_fp64) + +#endif /* GL_ARB_gpu_shader_fp64 */ + +/* ------------------------ GL_ARB_half_float_pixel ------------------------ */ + +#ifndef GL_ARB_half_float_pixel +#define GL_ARB_half_float_pixel 1 + +#define GL_HALF_FLOAT_ARB 0x140B + +#define GLEW_ARB_half_float_pixel GLEW_GET_VAR(__GLEW_ARB_half_float_pixel) + +#endif /* GL_ARB_half_float_pixel */ + +/* ------------------------ GL_ARB_half_float_vertex ----------------------- */ + +#ifndef GL_ARB_half_float_vertex +#define GL_ARB_half_float_vertex 1 + +#define GL_HALF_FLOAT 0x140B + +#define GLEW_ARB_half_float_vertex GLEW_GET_VAR(__GLEW_ARB_half_float_vertex) + +#endif /* GL_ARB_half_float_vertex */ + +/* ----------------------------- GL_ARB_imaging ---------------------------- */ + +#ifndef GL_ARB_imaging +#define GL_ARB_imaging 1 + +#define GL_CONSTANT_COLOR 0x8001 +#define GL_ONE_MINUS_CONSTANT_COLOR 0x8002 +#define GL_CONSTANT_ALPHA 0x8003 +#define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004 +#define GL_BLEND_COLOR 0x8005 +#define GL_FUNC_ADD 0x8006 +#define GL_MIN 0x8007 +#define GL_MAX 0x8008 +#define GL_BLEND_EQUATION 0x8009 +#define GL_FUNC_SUBTRACT 0x800A +#define GL_FUNC_REVERSE_SUBTRACT 0x800B +#define GL_CONVOLUTION_1D 0x8010 +#define GL_CONVOLUTION_2D 0x8011 +#define GL_SEPARABLE_2D 0x8012 +#define GL_CONVOLUTION_BORDER_MODE 0x8013 +#define GL_CONVOLUTION_FILTER_SCALE 0x8014 +#define GL_CONVOLUTION_FILTER_BIAS 0x8015 +#define GL_REDUCE 0x8016 +#define GL_CONVOLUTION_FORMAT 0x8017 +#define GL_CONVOLUTION_WIDTH 0x8018 +#define GL_CONVOLUTION_HEIGHT 0x8019 +#define GL_MAX_CONVOLUTION_WIDTH 0x801A +#define GL_MAX_CONVOLUTION_HEIGHT 0x801B +#define GL_POST_CONVOLUTION_RED_SCALE 0x801C +#define GL_POST_CONVOLUTION_GREEN_SCALE 0x801D +#define GL_POST_CONVOLUTION_BLUE_SCALE 0x801E +#define GL_POST_CONVOLUTION_ALPHA_SCALE 0x801F +#define GL_POST_CONVOLUTION_RED_BIAS 0x8020 +#define GL_POST_CONVOLUTION_GREEN_BIAS 0x8021 +#define GL_POST_CONVOLUTION_BLUE_BIAS 0x8022 +#define GL_POST_CONVOLUTION_ALPHA_BIAS 0x8023 +#define GL_HISTOGRAM 0x8024 +#define GL_PROXY_HISTOGRAM 0x8025 +#define GL_HISTOGRAM_WIDTH 0x8026 +#define GL_HISTOGRAM_FORMAT 0x8027 +#define GL_HISTOGRAM_RED_SIZE 0x8028 +#define GL_HISTOGRAM_GREEN_SIZE 0x8029 +#define GL_HISTOGRAM_BLUE_SIZE 0x802A +#define GL_HISTOGRAM_ALPHA_SIZE 0x802B +#define GL_HISTOGRAM_LUMINANCE_SIZE 0x802C +#define GL_HISTOGRAM_SINK 0x802D +#define GL_MINMAX 0x802E +#define GL_MINMAX_FORMAT 0x802F +#define GL_MINMAX_SINK 0x8030 +#define GL_TABLE_TOO_LARGE 0x8031 +#define GL_COLOR_MATRIX 0x80B1 +#define GL_COLOR_MATRIX_STACK_DEPTH 0x80B2 +#define GL_MAX_COLOR_MATRIX_STACK_DEPTH 0x80B3 +#define GL_POST_COLOR_MATRIX_RED_SCALE 0x80B4 +#define GL_POST_COLOR_MATRIX_GREEN_SCALE 0x80B5 +#define GL_POST_COLOR_MATRIX_BLUE_SCALE 0x80B6 +#define GL_POST_COLOR_MATRIX_ALPHA_SCALE 0x80B7 +#define GL_POST_COLOR_MATRIX_RED_BIAS 0x80B8 +#define GL_POST_COLOR_MATRIX_GREEN_BIAS 0x80B9 +#define GL_POST_COLOR_MATRIX_BLUE_BIAS 0x80BA +#define GL_POST_COLOR_MATRIX_ALPHA_BIAS 0x80BB +#define GL_COLOR_TABLE 0x80D0 +#define GL_POST_CONVOLUTION_COLOR_TABLE 0x80D1 +#define GL_POST_COLOR_MATRIX_COLOR_TABLE 0x80D2 +#define GL_PROXY_COLOR_TABLE 0x80D3 +#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE 0x80D4 +#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE 0x80D5 +#define GL_COLOR_TABLE_SCALE 0x80D6 +#define GL_COLOR_TABLE_BIAS 0x80D7 +#define GL_COLOR_TABLE_FORMAT 0x80D8 +#define GL_COLOR_TABLE_WIDTH 0x80D9 +#define GL_COLOR_TABLE_RED_SIZE 0x80DA +#define GL_COLOR_TABLE_GREEN_SIZE 0x80DB +#define GL_COLOR_TABLE_BLUE_SIZE 0x80DC +#define GL_COLOR_TABLE_ALPHA_SIZE 0x80DD +#define GL_COLOR_TABLE_LUMINANCE_SIZE 0x80DE +#define GL_COLOR_TABLE_INTENSITY_SIZE 0x80DF +#define GL_IGNORE_BORDER 0x8150 +#define GL_CONSTANT_BORDER 0x8151 +#define GL_WRAP_BORDER 0x8152 +#define GL_REPLICATE_BORDER 0x8153 +#define GL_CONVOLUTION_BORDER_COLOR 0x8154 + +typedef void (GLAPIENTRY * PFNGLCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table); +typedef void (GLAPIENTRY * PFNGLCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params); +typedef void (GLAPIENTRY * PFNGLCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (GLAPIENTRY * PFNGLCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image); +typedef void (GLAPIENTRY * PFNGLCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image); +typedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERFPROC) (GLenum target, GLenum pname, GLfloat params); +typedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params); +typedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERIPROC) (GLenum target, GLenum pname, GLint params); +typedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (GLAPIENTRY * PFNGLCOPYCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); +typedef void (GLAPIENTRY * PFNGLCOPYCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +typedef void (GLAPIENTRY * PFNGLCOPYCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +typedef void (GLAPIENTRY * PFNGLCOPYCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEPROC) (GLenum target, GLenum format, GLenum type, GLvoid *table); +typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (GLAPIENTRY * PFNGLGETCONVOLUTIONFILTERPROC) (GLenum target, GLenum format, GLenum type, GLvoid *image); +typedef void (GLAPIENTRY * PFNGLGETCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (GLAPIENTRY * PFNGLGETCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (GLAPIENTRY * PFNGLGETHISTOGRAMPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); +typedef void (GLAPIENTRY * PFNGLGETHISTOGRAMPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (GLAPIENTRY * PFNGLGETHISTOGRAMPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (GLAPIENTRY * PFNGLGETMINMAXPROC) (GLenum target, GLboolean reset, GLenum format, GLenum types, GLvoid *values); +typedef void (GLAPIENTRY * PFNGLGETMINMAXPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (GLAPIENTRY * PFNGLGETMINMAXPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (GLAPIENTRY * PFNGLGETSEPARABLEFILTERPROC) (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span); +typedef void (GLAPIENTRY * PFNGLHISTOGRAMPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); +typedef void (GLAPIENTRY * PFNGLMINMAXPROC) (GLenum target, GLenum internalformat, GLboolean sink); +typedef void (GLAPIENTRY * PFNGLRESETHISTOGRAMPROC) (GLenum target); +typedef void (GLAPIENTRY * PFNGLRESETMINMAXPROC) (GLenum target); +typedef void (GLAPIENTRY * PFNGLSEPARABLEFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column); + +#define glColorSubTable GLEW_GET_FUN(__glewColorSubTable) +#define glColorTable GLEW_GET_FUN(__glewColorTable) +#define glColorTableParameterfv GLEW_GET_FUN(__glewColorTableParameterfv) +#define glColorTableParameteriv GLEW_GET_FUN(__glewColorTableParameteriv) +#define glConvolutionFilter1D GLEW_GET_FUN(__glewConvolutionFilter1D) +#define glConvolutionFilter2D GLEW_GET_FUN(__glewConvolutionFilter2D) +#define glConvolutionParameterf GLEW_GET_FUN(__glewConvolutionParameterf) +#define glConvolutionParameterfv GLEW_GET_FUN(__glewConvolutionParameterfv) +#define glConvolutionParameteri GLEW_GET_FUN(__glewConvolutionParameteri) +#define glConvolutionParameteriv GLEW_GET_FUN(__glewConvolutionParameteriv) +#define glCopyColorSubTable GLEW_GET_FUN(__glewCopyColorSubTable) +#define glCopyColorTable GLEW_GET_FUN(__glewCopyColorTable) +#define glCopyConvolutionFilter1D GLEW_GET_FUN(__glewCopyConvolutionFilter1D) +#define glCopyConvolutionFilter2D GLEW_GET_FUN(__glewCopyConvolutionFilter2D) +#define glGetColorTable GLEW_GET_FUN(__glewGetColorTable) +#define glGetColorTableParameterfv GLEW_GET_FUN(__glewGetColorTableParameterfv) +#define glGetColorTableParameteriv GLEW_GET_FUN(__glewGetColorTableParameteriv) +#define glGetConvolutionFilter GLEW_GET_FUN(__glewGetConvolutionFilter) +#define glGetConvolutionParameterfv GLEW_GET_FUN(__glewGetConvolutionParameterfv) +#define glGetConvolutionParameteriv GLEW_GET_FUN(__glewGetConvolutionParameteriv) +#define glGetHistogram GLEW_GET_FUN(__glewGetHistogram) +#define glGetHistogramParameterfv GLEW_GET_FUN(__glewGetHistogramParameterfv) +#define glGetHistogramParameteriv GLEW_GET_FUN(__glewGetHistogramParameteriv) +#define glGetMinmax GLEW_GET_FUN(__glewGetMinmax) +#define glGetMinmaxParameterfv GLEW_GET_FUN(__glewGetMinmaxParameterfv) +#define glGetMinmaxParameteriv GLEW_GET_FUN(__glewGetMinmaxParameteriv) +#define glGetSeparableFilter GLEW_GET_FUN(__glewGetSeparableFilter) +#define glHistogram GLEW_GET_FUN(__glewHistogram) +#define glMinmax GLEW_GET_FUN(__glewMinmax) +#define glResetHistogram GLEW_GET_FUN(__glewResetHistogram) +#define glResetMinmax GLEW_GET_FUN(__glewResetMinmax) +#define glSeparableFilter2D GLEW_GET_FUN(__glewSeparableFilter2D) + +#define GLEW_ARB_imaging GLEW_GET_VAR(__GLEW_ARB_imaging) + +#endif /* GL_ARB_imaging */ + +/* ----------------------- GL_ARB_indirect_parameters ---------------------- */ + +#ifndef GL_ARB_indirect_parameters +#define GL_ARB_indirect_parameters 1 + +#define GL_PARAMETER_BUFFER_ARB 0x80EE +#define GL_PARAMETER_BUFFER_BINDING_ARB 0x80EF + +typedef void (GLAPIENTRY * PFNGLMULTIDRAWARRAYSINDIRECTCOUNTARBPROC) (GLenum mode, const GLvoid *indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSINDIRECTCOUNTARBPROC) (GLenum mode, GLenum type, const GLvoid *indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride); + +#define glMultiDrawArraysIndirectCountARB GLEW_GET_FUN(__glewMultiDrawArraysIndirectCountARB) +#define glMultiDrawElementsIndirectCountARB GLEW_GET_FUN(__glewMultiDrawElementsIndirectCountARB) + +#define GLEW_ARB_indirect_parameters GLEW_GET_VAR(__GLEW_ARB_indirect_parameters) + +#endif /* GL_ARB_indirect_parameters */ + +/* ------------------------ GL_ARB_instanced_arrays ------------------------ */ + +#ifndef GL_ARB_instanced_arrays +#define GL_ARB_instanced_arrays 1 + +#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR_ARB 0x88FE + +typedef void (GLAPIENTRY * PFNGLDRAWARRAYSINSTANCEDARBPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount); +typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDARBPROC) (GLenum mode, GLsizei count, GLenum type, const void* indices, GLsizei primcount); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBDIVISORARBPROC) (GLuint index, GLuint divisor); + +#define glDrawArraysInstancedARB GLEW_GET_FUN(__glewDrawArraysInstancedARB) +#define glDrawElementsInstancedARB GLEW_GET_FUN(__glewDrawElementsInstancedARB) +#define glVertexAttribDivisorARB GLEW_GET_FUN(__glewVertexAttribDivisorARB) + +#define GLEW_ARB_instanced_arrays GLEW_GET_VAR(__GLEW_ARB_instanced_arrays) + +#endif /* GL_ARB_instanced_arrays */ + +/* ---------------------- GL_ARB_internalformat_query ---------------------- */ + +#ifndef GL_ARB_internalformat_query +#define GL_ARB_internalformat_query 1 + +#define GL_NUM_SAMPLE_COUNTS 0x9380 + +typedef void (GLAPIENTRY * PFNGLGETINTERNALFORMATIVPROC) (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint* params); + +#define glGetInternalformativ GLEW_GET_FUN(__glewGetInternalformativ) + +#define GLEW_ARB_internalformat_query GLEW_GET_VAR(__GLEW_ARB_internalformat_query) + +#endif /* GL_ARB_internalformat_query */ + +/* ---------------------- GL_ARB_internalformat_query2 --------------------- */ + +#ifndef GL_ARB_internalformat_query2 +#define GL_ARB_internalformat_query2 1 + +#define GL_INTERNALFORMAT_SUPPORTED 0x826F +#define GL_INTERNALFORMAT_PREFERRED 0x8270 +#define GL_INTERNALFORMAT_RED_SIZE 0x8271 +#define GL_INTERNALFORMAT_GREEN_SIZE 0x8272 +#define GL_INTERNALFORMAT_BLUE_SIZE 0x8273 +#define GL_INTERNALFORMAT_ALPHA_SIZE 0x8274 +#define GL_INTERNALFORMAT_DEPTH_SIZE 0x8275 +#define GL_INTERNALFORMAT_STENCIL_SIZE 0x8276 +#define GL_INTERNALFORMAT_SHARED_SIZE 0x8277 +#define GL_INTERNALFORMAT_RED_TYPE 0x8278 +#define GL_INTERNALFORMAT_GREEN_TYPE 0x8279 +#define GL_INTERNALFORMAT_BLUE_TYPE 0x827A +#define GL_INTERNALFORMAT_ALPHA_TYPE 0x827B +#define GL_INTERNALFORMAT_DEPTH_TYPE 0x827C +#define GL_INTERNALFORMAT_STENCIL_TYPE 0x827D +#define GL_MAX_WIDTH 0x827E +#define GL_MAX_HEIGHT 0x827F +#define GL_MAX_DEPTH 0x8280 +#define GL_MAX_LAYERS 0x8281 +#define GL_MAX_COMBINED_DIMENSIONS 0x8282 +#define GL_COLOR_COMPONENTS 0x8283 +#define GL_DEPTH_COMPONENTS 0x8284 +#define GL_STENCIL_COMPONENTS 0x8285 +#define GL_COLOR_RENDERABLE 0x8286 +#define GL_DEPTH_RENDERABLE 0x8287 +#define GL_STENCIL_RENDERABLE 0x8288 +#define GL_FRAMEBUFFER_RENDERABLE 0x8289 +#define GL_FRAMEBUFFER_RENDERABLE_LAYERED 0x828A +#define GL_FRAMEBUFFER_BLEND 0x828B +#define GL_READ_PIXELS 0x828C +#define GL_READ_PIXELS_FORMAT 0x828D +#define GL_READ_PIXELS_TYPE 0x828E +#define GL_TEXTURE_IMAGE_FORMAT 0x828F +#define GL_TEXTURE_IMAGE_TYPE 0x8290 +#define GL_GET_TEXTURE_IMAGE_FORMAT 0x8291 +#define GL_GET_TEXTURE_IMAGE_TYPE 0x8292 +#define GL_MIPMAP 0x8293 +#define GL_MANUAL_GENERATE_MIPMAP 0x8294 +#define GL_AUTO_GENERATE_MIPMAP 0x8295 +#define GL_COLOR_ENCODING 0x8296 +#define GL_SRGB_READ 0x8297 +#define GL_SRGB_WRITE 0x8298 +#define GL_SRGB_DECODE_ARB 0x8299 +#define GL_FILTER 0x829A +#define GL_VERTEX_TEXTURE 0x829B +#define GL_TESS_CONTROL_TEXTURE 0x829C +#define GL_TESS_EVALUATION_TEXTURE 0x829D +#define GL_GEOMETRY_TEXTURE 0x829E +#define GL_FRAGMENT_TEXTURE 0x829F +#define GL_COMPUTE_TEXTURE 0x82A0 +#define GL_TEXTURE_SHADOW 0x82A1 +#define GL_TEXTURE_GATHER 0x82A2 +#define GL_TEXTURE_GATHER_SHADOW 0x82A3 +#define GL_SHADER_IMAGE_LOAD 0x82A4 +#define GL_SHADER_IMAGE_STORE 0x82A5 +#define GL_SHADER_IMAGE_ATOMIC 0x82A6 +#define GL_IMAGE_TEXEL_SIZE 0x82A7 +#define GL_IMAGE_COMPATIBILITY_CLASS 0x82A8 +#define GL_IMAGE_PIXEL_FORMAT 0x82A9 +#define GL_IMAGE_PIXEL_TYPE 0x82AA +#define GL_SIMULTANEOUS_TEXTURE_AND_DEPTH_TEST 0x82AC +#define GL_SIMULTANEOUS_TEXTURE_AND_STENCIL_TEST 0x82AD +#define GL_SIMULTANEOUS_TEXTURE_AND_DEPTH_WRITE 0x82AE +#define GL_SIMULTANEOUS_TEXTURE_AND_STENCIL_WRITE 0x82AF +#define GL_TEXTURE_COMPRESSED_BLOCK_WIDTH 0x82B1 +#define GL_TEXTURE_COMPRESSED_BLOCK_HEIGHT 0x82B2 +#define GL_TEXTURE_COMPRESSED_BLOCK_SIZE 0x82B3 +#define GL_CLEAR_BUFFER 0x82B4 +#define GL_TEXTURE_VIEW 0x82B5 +#define GL_VIEW_COMPATIBILITY_CLASS 0x82B6 +#define GL_FULL_SUPPORT 0x82B7 +#define GL_CAVEAT_SUPPORT 0x82B8 +#define GL_IMAGE_CLASS_4_X_32 0x82B9 +#define GL_IMAGE_CLASS_2_X_32 0x82BA +#define GL_IMAGE_CLASS_1_X_32 0x82BB +#define GL_IMAGE_CLASS_4_X_16 0x82BC +#define GL_IMAGE_CLASS_2_X_16 0x82BD +#define GL_IMAGE_CLASS_1_X_16 0x82BE +#define GL_IMAGE_CLASS_4_X_8 0x82BF +#define GL_IMAGE_CLASS_2_X_8 0x82C0 +#define GL_IMAGE_CLASS_1_X_8 0x82C1 +#define GL_IMAGE_CLASS_11_11_10 0x82C2 +#define GL_IMAGE_CLASS_10_10_10_2 0x82C3 +#define GL_VIEW_CLASS_128_BITS 0x82C4 +#define GL_VIEW_CLASS_96_BITS 0x82C5 +#define GL_VIEW_CLASS_64_BITS 0x82C6 +#define GL_VIEW_CLASS_48_BITS 0x82C7 +#define GL_VIEW_CLASS_32_BITS 0x82C8 +#define GL_VIEW_CLASS_24_BITS 0x82C9 +#define GL_VIEW_CLASS_16_BITS 0x82CA +#define GL_VIEW_CLASS_8_BITS 0x82CB +#define GL_VIEW_CLASS_S3TC_DXT1_RGB 0x82CC +#define GL_VIEW_CLASS_S3TC_DXT1_RGBA 0x82CD +#define GL_VIEW_CLASS_S3TC_DXT3_RGBA 0x82CE +#define GL_VIEW_CLASS_S3TC_DXT5_RGBA 0x82CF +#define GL_VIEW_CLASS_RGTC1_RED 0x82D0 +#define GL_VIEW_CLASS_RGTC2_RG 0x82D1 +#define GL_VIEW_CLASS_BPTC_UNORM 0x82D2 +#define GL_VIEW_CLASS_BPTC_FLOAT 0x82D3 + +typedef void (GLAPIENTRY * PFNGLGETINTERNALFORMATI64VPROC) (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint64* params); + +#define glGetInternalformati64v GLEW_GET_FUN(__glewGetInternalformati64v) + +#define GLEW_ARB_internalformat_query2 GLEW_GET_VAR(__GLEW_ARB_internalformat_query2) + +#endif /* GL_ARB_internalformat_query2 */ + +/* ----------------------- GL_ARB_invalidate_subdata ----------------------- */ + +#ifndef GL_ARB_invalidate_subdata +#define GL_ARB_invalidate_subdata 1 + +typedef void (GLAPIENTRY * PFNGLINVALIDATEBUFFERDATAPROC) (GLuint buffer); +typedef void (GLAPIENTRY * PFNGLINVALIDATEBUFFERSUBDATAPROC) (GLuint buffer, GLintptr offset, GLsizeiptr length); +typedef void (GLAPIENTRY * PFNGLINVALIDATEFRAMEBUFFERPROC) (GLenum target, GLsizei numAttachments, const GLenum* attachments); +typedef void (GLAPIENTRY * PFNGLINVALIDATESUBFRAMEBUFFERPROC) (GLenum target, GLsizei numAttachments, const GLenum* attachments, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLINVALIDATETEXIMAGEPROC) (GLuint texture, GLint level); +typedef void (GLAPIENTRY * PFNGLINVALIDATETEXSUBIMAGEPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth); + +#define glInvalidateBufferData GLEW_GET_FUN(__glewInvalidateBufferData) +#define glInvalidateBufferSubData GLEW_GET_FUN(__glewInvalidateBufferSubData) +#define glInvalidateFramebuffer GLEW_GET_FUN(__glewInvalidateFramebuffer) +#define glInvalidateSubFramebuffer GLEW_GET_FUN(__glewInvalidateSubFramebuffer) +#define glInvalidateTexImage GLEW_GET_FUN(__glewInvalidateTexImage) +#define glInvalidateTexSubImage GLEW_GET_FUN(__glewInvalidateTexSubImage) + +#define GLEW_ARB_invalidate_subdata GLEW_GET_VAR(__GLEW_ARB_invalidate_subdata) + +#endif /* GL_ARB_invalidate_subdata */ + +/* ---------------------- GL_ARB_map_buffer_alignment ---------------------- */ + +#ifndef GL_ARB_map_buffer_alignment +#define GL_ARB_map_buffer_alignment 1 + +#define GL_MIN_MAP_BUFFER_ALIGNMENT 0x90BC + +#define GLEW_ARB_map_buffer_alignment GLEW_GET_VAR(__GLEW_ARB_map_buffer_alignment) + +#endif /* GL_ARB_map_buffer_alignment */ + +/* ------------------------ GL_ARB_map_buffer_range ------------------------ */ + +#ifndef GL_ARB_map_buffer_range +#define GL_ARB_map_buffer_range 1 + +#define GL_MAP_READ_BIT 0x0001 +#define GL_MAP_WRITE_BIT 0x0002 +#define GL_MAP_INVALIDATE_RANGE_BIT 0x0004 +#define GL_MAP_INVALIDATE_BUFFER_BIT 0x0008 +#define GL_MAP_FLUSH_EXPLICIT_BIT 0x0010 +#define GL_MAP_UNSYNCHRONIZED_BIT 0x0020 + +typedef void (GLAPIENTRY * PFNGLFLUSHMAPPEDBUFFERRANGEPROC) (GLenum target, GLintptr offset, GLsizeiptr length); +typedef GLvoid * (GLAPIENTRY * PFNGLMAPBUFFERRANGEPROC) (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access); + +#define glFlushMappedBufferRange GLEW_GET_FUN(__glewFlushMappedBufferRange) +#define glMapBufferRange GLEW_GET_FUN(__glewMapBufferRange) + +#define GLEW_ARB_map_buffer_range GLEW_GET_VAR(__GLEW_ARB_map_buffer_range) + +#endif /* GL_ARB_map_buffer_range */ + +/* ------------------------- GL_ARB_matrix_palette ------------------------- */ + +#ifndef GL_ARB_matrix_palette +#define GL_ARB_matrix_palette 1 + +#define GL_MATRIX_PALETTE_ARB 0x8840 +#define GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB 0x8841 +#define GL_MAX_PALETTE_MATRICES_ARB 0x8842 +#define GL_CURRENT_PALETTE_MATRIX_ARB 0x8843 +#define GL_MATRIX_INDEX_ARRAY_ARB 0x8844 +#define GL_CURRENT_MATRIX_INDEX_ARB 0x8845 +#define GL_MATRIX_INDEX_ARRAY_SIZE_ARB 0x8846 +#define GL_MATRIX_INDEX_ARRAY_TYPE_ARB 0x8847 +#define GL_MATRIX_INDEX_ARRAY_STRIDE_ARB 0x8848 +#define GL_MATRIX_INDEX_ARRAY_POINTER_ARB 0x8849 + +typedef void (GLAPIENTRY * PFNGLCURRENTPALETTEMATRIXARBPROC) (GLint index); +typedef void (GLAPIENTRY * PFNGLMATRIXINDEXPOINTERARBPROC) (GLint size, GLenum type, GLsizei stride, GLvoid *pointer); +typedef void (GLAPIENTRY * PFNGLMATRIXINDEXUBVARBPROC) (GLint size, GLubyte *indices); +typedef void (GLAPIENTRY * PFNGLMATRIXINDEXUIVARBPROC) (GLint size, GLuint *indices); +typedef void (GLAPIENTRY * PFNGLMATRIXINDEXUSVARBPROC) (GLint size, GLushort *indices); + +#define glCurrentPaletteMatrixARB GLEW_GET_FUN(__glewCurrentPaletteMatrixARB) +#define glMatrixIndexPointerARB GLEW_GET_FUN(__glewMatrixIndexPointerARB) +#define glMatrixIndexubvARB GLEW_GET_FUN(__glewMatrixIndexubvARB) +#define glMatrixIndexuivARB GLEW_GET_FUN(__glewMatrixIndexuivARB) +#define glMatrixIndexusvARB GLEW_GET_FUN(__glewMatrixIndexusvARB) + +#define GLEW_ARB_matrix_palette GLEW_GET_VAR(__GLEW_ARB_matrix_palette) + +#endif /* GL_ARB_matrix_palette */ + +/* --------------------------- GL_ARB_multi_bind --------------------------- */ + +#ifndef GL_ARB_multi_bind +#define GL_ARB_multi_bind 1 + +typedef void (GLAPIENTRY * PFNGLBINDBUFFERSBASEPROC) (GLenum target, GLuint first, GLsizei count, const GLuint* buffers); +typedef void (GLAPIENTRY * PFNGLBINDBUFFERSRANGEPROC) (GLenum target, GLuint first, GLsizei count, const GLuint* buffers, const GLintptr *offsets, const GLsizeiptr *sizes); +typedef void (GLAPIENTRY * PFNGLBINDIMAGETEXTURESPROC) (GLuint first, GLsizei count, const GLuint* textures); +typedef void (GLAPIENTRY * PFNGLBINDSAMPLERSPROC) (GLuint first, GLsizei count, const GLuint* samplers); +typedef void (GLAPIENTRY * PFNGLBINDTEXTURESPROC) (GLuint first, GLsizei count, const GLuint* textures); +typedef void (GLAPIENTRY * PFNGLBINDVERTEXBUFFERSPROC) (GLuint first, GLsizei count, const GLuint* buffers, const GLintptr *offsets, const GLsizei *strides); + +#define glBindBuffersBase GLEW_GET_FUN(__glewBindBuffersBase) +#define glBindBuffersRange GLEW_GET_FUN(__glewBindBuffersRange) +#define glBindImageTextures GLEW_GET_FUN(__glewBindImageTextures) +#define glBindSamplers GLEW_GET_FUN(__glewBindSamplers) +#define glBindTextures GLEW_GET_FUN(__glewBindTextures) +#define glBindVertexBuffers GLEW_GET_FUN(__glewBindVertexBuffers) + +#define GLEW_ARB_multi_bind GLEW_GET_VAR(__GLEW_ARB_multi_bind) + +#endif /* GL_ARB_multi_bind */ + +/* ----------------------- GL_ARB_multi_draw_indirect ---------------------- */ + +#ifndef GL_ARB_multi_draw_indirect +#define GL_ARB_multi_draw_indirect 1 + +typedef void (GLAPIENTRY * PFNGLMULTIDRAWARRAYSINDIRECTPROC) (GLenum mode, const GLvoid *indirect, GLsizei primcount, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSINDIRECTPROC) (GLenum mode, GLenum type, const GLvoid *indirect, GLsizei primcount, GLsizei stride); + +#define glMultiDrawArraysIndirect GLEW_GET_FUN(__glewMultiDrawArraysIndirect) +#define glMultiDrawElementsIndirect GLEW_GET_FUN(__glewMultiDrawElementsIndirect) + +#define GLEW_ARB_multi_draw_indirect GLEW_GET_VAR(__GLEW_ARB_multi_draw_indirect) + +#endif /* GL_ARB_multi_draw_indirect */ + +/* --------------------------- GL_ARB_multisample -------------------------- */ + +#ifndef GL_ARB_multisample +#define GL_ARB_multisample 1 + +#define GL_MULTISAMPLE_ARB 0x809D +#define GL_SAMPLE_ALPHA_TO_COVERAGE_ARB 0x809E +#define GL_SAMPLE_ALPHA_TO_ONE_ARB 0x809F +#define GL_SAMPLE_COVERAGE_ARB 0x80A0 +#define GL_SAMPLE_BUFFERS_ARB 0x80A8 +#define GL_SAMPLES_ARB 0x80A9 +#define GL_SAMPLE_COVERAGE_VALUE_ARB 0x80AA +#define GL_SAMPLE_COVERAGE_INVERT_ARB 0x80AB +#define GL_MULTISAMPLE_BIT_ARB 0x20000000 + +typedef void (GLAPIENTRY * PFNGLSAMPLECOVERAGEARBPROC) (GLclampf value, GLboolean invert); + +#define glSampleCoverageARB GLEW_GET_FUN(__glewSampleCoverageARB) + +#define GLEW_ARB_multisample GLEW_GET_VAR(__GLEW_ARB_multisample) + +#endif /* GL_ARB_multisample */ + +/* -------------------------- GL_ARB_multitexture -------------------------- */ + +#ifndef GL_ARB_multitexture +#define GL_ARB_multitexture 1 + +#define GL_TEXTURE0_ARB 0x84C0 +#define GL_TEXTURE1_ARB 0x84C1 +#define GL_TEXTURE2_ARB 0x84C2 +#define GL_TEXTURE3_ARB 0x84C3 +#define GL_TEXTURE4_ARB 0x84C4 +#define GL_TEXTURE5_ARB 0x84C5 +#define GL_TEXTURE6_ARB 0x84C6 +#define GL_TEXTURE7_ARB 0x84C7 +#define GL_TEXTURE8_ARB 0x84C8 +#define GL_TEXTURE9_ARB 0x84C9 +#define GL_TEXTURE10_ARB 0x84CA +#define GL_TEXTURE11_ARB 0x84CB +#define GL_TEXTURE12_ARB 0x84CC +#define GL_TEXTURE13_ARB 0x84CD +#define GL_TEXTURE14_ARB 0x84CE +#define GL_TEXTURE15_ARB 0x84CF +#define GL_TEXTURE16_ARB 0x84D0 +#define GL_TEXTURE17_ARB 0x84D1 +#define GL_TEXTURE18_ARB 0x84D2 +#define GL_TEXTURE19_ARB 0x84D3 +#define GL_TEXTURE20_ARB 0x84D4 +#define GL_TEXTURE21_ARB 0x84D5 +#define GL_TEXTURE22_ARB 0x84D6 +#define GL_TEXTURE23_ARB 0x84D7 +#define GL_TEXTURE24_ARB 0x84D8 +#define GL_TEXTURE25_ARB 0x84D9 +#define GL_TEXTURE26_ARB 0x84DA +#define GL_TEXTURE27_ARB 0x84DB +#define GL_TEXTURE28_ARB 0x84DC +#define GL_TEXTURE29_ARB 0x84DD +#define GL_TEXTURE30_ARB 0x84DE +#define GL_TEXTURE31_ARB 0x84DF +#define GL_ACTIVE_TEXTURE_ARB 0x84E0 +#define GL_CLIENT_ACTIVE_TEXTURE_ARB 0x84E1 +#define GL_MAX_TEXTURE_UNITS_ARB 0x84E2 + +typedef void (GLAPIENTRY * PFNGLACTIVETEXTUREARBPROC) (GLenum texture); +typedef void (GLAPIENTRY * PFNGLCLIENTACTIVETEXTUREARBPROC) (GLenum texture); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1DARBPROC) (GLenum target, GLdouble s); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1DVARBPROC) (GLenum target, const GLdouble *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1FARBPROC) (GLenum target, GLfloat s); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1FVARBPROC) (GLenum target, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1IARBPROC) (GLenum target, GLint s); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1IVARBPROC) (GLenum target, const GLint *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1SARBPROC) (GLenum target, GLshort s); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1SVARBPROC) (GLenum target, const GLshort *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2DARBPROC) (GLenum target, GLdouble s, GLdouble t); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2DVARBPROC) (GLenum target, const GLdouble *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2FARBPROC) (GLenum target, GLfloat s, GLfloat t); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2FVARBPROC) (GLenum target, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2IARBPROC) (GLenum target, GLint s, GLint t); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2IVARBPROC) (GLenum target, const GLint *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2SARBPROC) (GLenum target, GLshort s, GLshort t); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2SVARBPROC) (GLenum target, const GLshort *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3DVARBPROC) (GLenum target, const GLdouble *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3FVARBPROC) (GLenum target, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3IARBPROC) (GLenum target, GLint s, GLint t, GLint r); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3IVARBPROC) (GLenum target, const GLint *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3SVARBPROC) (GLenum target, const GLshort *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4DVARBPROC) (GLenum target, const GLdouble *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4FVARBPROC) (GLenum target, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4IARBPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4IVARBPROC) (GLenum target, const GLint *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4SVARBPROC) (GLenum target, const GLshort *v); + +#define glActiveTextureARB GLEW_GET_FUN(__glewActiveTextureARB) +#define glClientActiveTextureARB GLEW_GET_FUN(__glewClientActiveTextureARB) +#define glMultiTexCoord1dARB GLEW_GET_FUN(__glewMultiTexCoord1dARB) +#define glMultiTexCoord1dvARB GLEW_GET_FUN(__glewMultiTexCoord1dvARB) +#define glMultiTexCoord1fARB GLEW_GET_FUN(__glewMultiTexCoord1fARB) +#define glMultiTexCoord1fvARB GLEW_GET_FUN(__glewMultiTexCoord1fvARB) +#define glMultiTexCoord1iARB GLEW_GET_FUN(__glewMultiTexCoord1iARB) +#define glMultiTexCoord1ivARB GLEW_GET_FUN(__glewMultiTexCoord1ivARB) +#define glMultiTexCoord1sARB GLEW_GET_FUN(__glewMultiTexCoord1sARB) +#define glMultiTexCoord1svARB GLEW_GET_FUN(__glewMultiTexCoord1svARB) +#define glMultiTexCoord2dARB GLEW_GET_FUN(__glewMultiTexCoord2dARB) +#define glMultiTexCoord2dvARB GLEW_GET_FUN(__glewMultiTexCoord2dvARB) +#define glMultiTexCoord2fARB GLEW_GET_FUN(__glewMultiTexCoord2fARB) +#define glMultiTexCoord2fvARB GLEW_GET_FUN(__glewMultiTexCoord2fvARB) +#define glMultiTexCoord2iARB GLEW_GET_FUN(__glewMultiTexCoord2iARB) +#define glMultiTexCoord2ivARB GLEW_GET_FUN(__glewMultiTexCoord2ivARB) +#define glMultiTexCoord2sARB GLEW_GET_FUN(__glewMultiTexCoord2sARB) +#define glMultiTexCoord2svARB GLEW_GET_FUN(__glewMultiTexCoord2svARB) +#define glMultiTexCoord3dARB GLEW_GET_FUN(__glewMultiTexCoord3dARB) +#define glMultiTexCoord3dvARB GLEW_GET_FUN(__glewMultiTexCoord3dvARB) +#define glMultiTexCoord3fARB GLEW_GET_FUN(__glewMultiTexCoord3fARB) +#define glMultiTexCoord3fvARB GLEW_GET_FUN(__glewMultiTexCoord3fvARB) +#define glMultiTexCoord3iARB GLEW_GET_FUN(__glewMultiTexCoord3iARB) +#define glMultiTexCoord3ivARB GLEW_GET_FUN(__glewMultiTexCoord3ivARB) +#define glMultiTexCoord3sARB GLEW_GET_FUN(__glewMultiTexCoord3sARB) +#define glMultiTexCoord3svARB GLEW_GET_FUN(__glewMultiTexCoord3svARB) +#define glMultiTexCoord4dARB GLEW_GET_FUN(__glewMultiTexCoord4dARB) +#define glMultiTexCoord4dvARB GLEW_GET_FUN(__glewMultiTexCoord4dvARB) +#define glMultiTexCoord4fARB GLEW_GET_FUN(__glewMultiTexCoord4fARB) +#define glMultiTexCoord4fvARB GLEW_GET_FUN(__glewMultiTexCoord4fvARB) +#define glMultiTexCoord4iARB GLEW_GET_FUN(__glewMultiTexCoord4iARB) +#define glMultiTexCoord4ivARB GLEW_GET_FUN(__glewMultiTexCoord4ivARB) +#define glMultiTexCoord4sARB GLEW_GET_FUN(__glewMultiTexCoord4sARB) +#define glMultiTexCoord4svARB GLEW_GET_FUN(__glewMultiTexCoord4svARB) + +#define GLEW_ARB_multitexture GLEW_GET_VAR(__GLEW_ARB_multitexture) + +#endif /* GL_ARB_multitexture */ + +/* ------------------------- GL_ARB_occlusion_query ------------------------ */ + +#ifndef GL_ARB_occlusion_query +#define GL_ARB_occlusion_query 1 + +#define GL_QUERY_COUNTER_BITS_ARB 0x8864 +#define GL_CURRENT_QUERY_ARB 0x8865 +#define GL_QUERY_RESULT_ARB 0x8866 +#define GL_QUERY_RESULT_AVAILABLE_ARB 0x8867 +#define GL_SAMPLES_PASSED_ARB 0x8914 + +typedef void (GLAPIENTRY * PFNGLBEGINQUERYARBPROC) (GLenum target, GLuint id); +typedef void (GLAPIENTRY * PFNGLDELETEQUERIESARBPROC) (GLsizei n, const GLuint* ids); +typedef void (GLAPIENTRY * PFNGLENDQUERYARBPROC) (GLenum target); +typedef void (GLAPIENTRY * PFNGLGENQUERIESARBPROC) (GLsizei n, GLuint* ids); +typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTIVARBPROC) (GLuint id, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTUIVARBPROC) (GLuint id, GLenum pname, GLuint* params); +typedef void (GLAPIENTRY * PFNGLGETQUERYIVARBPROC) (GLenum target, GLenum pname, GLint* params); +typedef GLboolean (GLAPIENTRY * PFNGLISQUERYARBPROC) (GLuint id); + +#define glBeginQueryARB GLEW_GET_FUN(__glewBeginQueryARB) +#define glDeleteQueriesARB GLEW_GET_FUN(__glewDeleteQueriesARB) +#define glEndQueryARB GLEW_GET_FUN(__glewEndQueryARB) +#define glGenQueriesARB GLEW_GET_FUN(__glewGenQueriesARB) +#define glGetQueryObjectivARB GLEW_GET_FUN(__glewGetQueryObjectivARB) +#define glGetQueryObjectuivARB GLEW_GET_FUN(__glewGetQueryObjectuivARB) +#define glGetQueryivARB GLEW_GET_FUN(__glewGetQueryivARB) +#define glIsQueryARB GLEW_GET_FUN(__glewIsQueryARB) + +#define GLEW_ARB_occlusion_query GLEW_GET_VAR(__GLEW_ARB_occlusion_query) + +#endif /* GL_ARB_occlusion_query */ + +/* ------------------------ GL_ARB_occlusion_query2 ------------------------ */ + +#ifndef GL_ARB_occlusion_query2 +#define GL_ARB_occlusion_query2 1 + +#define GL_ANY_SAMPLES_PASSED 0x8C2F + +#define GLEW_ARB_occlusion_query2 GLEW_GET_VAR(__GLEW_ARB_occlusion_query2) + +#endif /* GL_ARB_occlusion_query2 */ + +/* ----------------------- GL_ARB_pixel_buffer_object ---------------------- */ + +#ifndef GL_ARB_pixel_buffer_object +#define GL_ARB_pixel_buffer_object 1 + +#define GL_PIXEL_PACK_BUFFER_ARB 0x88EB +#define GL_PIXEL_UNPACK_BUFFER_ARB 0x88EC +#define GL_PIXEL_PACK_BUFFER_BINDING_ARB 0x88ED +#define GL_PIXEL_UNPACK_BUFFER_BINDING_ARB 0x88EF + +#define GLEW_ARB_pixel_buffer_object GLEW_GET_VAR(__GLEW_ARB_pixel_buffer_object) + +#endif /* GL_ARB_pixel_buffer_object */ + +/* ------------------------ GL_ARB_point_parameters ------------------------ */ + +#ifndef GL_ARB_point_parameters +#define GL_ARB_point_parameters 1 + +#define GL_POINT_SIZE_MIN_ARB 0x8126 +#define GL_POINT_SIZE_MAX_ARB 0x8127 +#define GL_POINT_FADE_THRESHOLD_SIZE_ARB 0x8128 +#define GL_POINT_DISTANCE_ATTENUATION_ARB 0x8129 + +typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERFARBPROC) (GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERFVARBPROC) (GLenum pname, const GLfloat* params); + +#define glPointParameterfARB GLEW_GET_FUN(__glewPointParameterfARB) +#define glPointParameterfvARB GLEW_GET_FUN(__glewPointParameterfvARB) + +#define GLEW_ARB_point_parameters GLEW_GET_VAR(__GLEW_ARB_point_parameters) + +#endif /* GL_ARB_point_parameters */ + +/* -------------------------- GL_ARB_point_sprite -------------------------- */ + +#ifndef GL_ARB_point_sprite +#define GL_ARB_point_sprite 1 + +#define GL_POINT_SPRITE_ARB 0x8861 +#define GL_COORD_REPLACE_ARB 0x8862 + +#define GLEW_ARB_point_sprite GLEW_GET_VAR(__GLEW_ARB_point_sprite) + +#endif /* GL_ARB_point_sprite */ + +/* --------------------- GL_ARB_program_interface_query -------------------- */ + +#ifndef GL_ARB_program_interface_query +#define GL_ARB_program_interface_query 1 + +#define GL_UNIFORM 0x92E1 +#define GL_UNIFORM_BLOCK 0x92E2 +#define GL_PROGRAM_INPUT 0x92E3 +#define GL_PROGRAM_OUTPUT 0x92E4 +#define GL_BUFFER_VARIABLE 0x92E5 +#define GL_SHADER_STORAGE_BLOCK 0x92E6 +#define GL_IS_PER_PATCH 0x92E7 +#define GL_VERTEX_SUBROUTINE 0x92E8 +#define GL_TESS_CONTROL_SUBROUTINE 0x92E9 +#define GL_TESS_EVALUATION_SUBROUTINE 0x92EA +#define GL_GEOMETRY_SUBROUTINE 0x92EB +#define GL_FRAGMENT_SUBROUTINE 0x92EC +#define GL_COMPUTE_SUBROUTINE 0x92ED +#define GL_VERTEX_SUBROUTINE_UNIFORM 0x92EE +#define GL_TESS_CONTROL_SUBROUTINE_UNIFORM 0x92EF +#define GL_TESS_EVALUATION_SUBROUTINE_UNIFORM 0x92F0 +#define GL_GEOMETRY_SUBROUTINE_UNIFORM 0x92F1 +#define GL_FRAGMENT_SUBROUTINE_UNIFORM 0x92F2 +#define GL_COMPUTE_SUBROUTINE_UNIFORM 0x92F3 +#define GL_TRANSFORM_FEEDBACK_VARYING 0x92F4 +#define GL_ACTIVE_RESOURCES 0x92F5 +#define GL_MAX_NAME_LENGTH 0x92F6 +#define GL_MAX_NUM_ACTIVE_VARIABLES 0x92F7 +#define GL_MAX_NUM_COMPATIBLE_SUBROUTINES 0x92F8 +#define GL_NAME_LENGTH 0x92F9 +#define GL_TYPE 0x92FA +#define GL_ARRAY_SIZE 0x92FB +#define GL_OFFSET 0x92FC +#define GL_BLOCK_INDEX 0x92FD +#define GL_ARRAY_STRIDE 0x92FE +#define GL_MATRIX_STRIDE 0x92FF +#define GL_IS_ROW_MAJOR 0x9300 +#define GL_ATOMIC_COUNTER_BUFFER_INDEX 0x9301 +#define GL_BUFFER_BINDING 0x9302 +#define GL_BUFFER_DATA_SIZE 0x9303 +#define GL_NUM_ACTIVE_VARIABLES 0x9304 +#define GL_ACTIVE_VARIABLES 0x9305 +#define GL_REFERENCED_BY_VERTEX_SHADER 0x9306 +#define GL_REFERENCED_BY_TESS_CONTROL_SHADER 0x9307 +#define GL_REFERENCED_BY_TESS_EVALUATION_SHADER 0x9308 +#define GL_REFERENCED_BY_GEOMETRY_SHADER 0x9309 +#define GL_REFERENCED_BY_FRAGMENT_SHADER 0x930A +#define GL_REFERENCED_BY_COMPUTE_SHADER 0x930B +#define GL_TOP_LEVEL_ARRAY_SIZE 0x930C +#define GL_TOP_LEVEL_ARRAY_STRIDE 0x930D +#define GL_LOCATION 0x930E +#define GL_LOCATION_INDEX 0x930F + +typedef void (GLAPIENTRY * PFNGLGETPROGRAMINTERFACEIVPROC) (GLuint program, GLenum programInterface, GLenum pname, GLint* params); +typedef GLuint (GLAPIENTRY * PFNGLGETPROGRAMRESOURCEINDEXPROC) (GLuint program, GLenum programInterface, const GLchar* name); +typedef GLint (GLAPIENTRY * PFNGLGETPROGRAMRESOURCELOCATIONPROC) (GLuint program, GLenum programInterface, const GLchar* name); +typedef GLint (GLAPIENTRY * PFNGLGETPROGRAMRESOURCELOCATIONINDEXPROC) (GLuint program, GLenum programInterface, const GLchar* name); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMRESOURCENAMEPROC) (GLuint program, GLenum programInterface, GLuint index, GLsizei bufSize, GLsizei* length, GLchar *name); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMRESOURCEIVPROC) (GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum* props, GLsizei bufSize, GLsizei *length, GLint *params); + +#define glGetProgramInterfaceiv GLEW_GET_FUN(__glewGetProgramInterfaceiv) +#define glGetProgramResourceIndex GLEW_GET_FUN(__glewGetProgramResourceIndex) +#define glGetProgramResourceLocation GLEW_GET_FUN(__glewGetProgramResourceLocation) +#define glGetProgramResourceLocationIndex GLEW_GET_FUN(__glewGetProgramResourceLocationIndex) +#define glGetProgramResourceName GLEW_GET_FUN(__glewGetProgramResourceName) +#define glGetProgramResourceiv GLEW_GET_FUN(__glewGetProgramResourceiv) + +#define GLEW_ARB_program_interface_query GLEW_GET_VAR(__GLEW_ARB_program_interface_query) + +#endif /* GL_ARB_program_interface_query */ + +/* ------------------------ GL_ARB_provoking_vertex ------------------------ */ + +#ifndef GL_ARB_provoking_vertex +#define GL_ARB_provoking_vertex 1 + +#define GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION 0x8E4C +#define GL_FIRST_VERTEX_CONVENTION 0x8E4D +#define GL_LAST_VERTEX_CONVENTION 0x8E4E +#define GL_PROVOKING_VERTEX 0x8E4F + +typedef void (GLAPIENTRY * PFNGLPROVOKINGVERTEXPROC) (GLenum mode); + +#define glProvokingVertex GLEW_GET_FUN(__glewProvokingVertex) + +#define GLEW_ARB_provoking_vertex GLEW_GET_VAR(__GLEW_ARB_provoking_vertex) + +#endif /* GL_ARB_provoking_vertex */ + +/* ----------------------- GL_ARB_query_buffer_object ---------------------- */ + +#ifndef GL_ARB_query_buffer_object +#define GL_ARB_query_buffer_object 1 + +#define GL_QUERY_BUFFER_BARRIER_BIT 0x00008000 +#define GL_QUERY_BUFFER 0x9192 +#define GL_QUERY_BUFFER_BINDING 0x9193 +#define GL_QUERY_RESULT_NO_WAIT 0x9194 + +#define GLEW_ARB_query_buffer_object GLEW_GET_VAR(__GLEW_ARB_query_buffer_object) + +#endif /* GL_ARB_query_buffer_object */ + +/* ------------------ GL_ARB_robust_buffer_access_behavior ----------------- */ + +#ifndef GL_ARB_robust_buffer_access_behavior +#define GL_ARB_robust_buffer_access_behavior 1 + +#define GLEW_ARB_robust_buffer_access_behavior GLEW_GET_VAR(__GLEW_ARB_robust_buffer_access_behavior) + +#endif /* GL_ARB_robust_buffer_access_behavior */ + +/* --------------------------- GL_ARB_robustness --------------------------- */ + +#ifndef GL_ARB_robustness +#define GL_ARB_robustness 1 + +#define GL_CONTEXT_FLAG_ROBUST_ACCESS_BIT_ARB 0x00000004 +#define GL_LOSE_CONTEXT_ON_RESET_ARB 0x8252 +#define GL_GUILTY_CONTEXT_RESET_ARB 0x8253 +#define GL_INNOCENT_CONTEXT_RESET_ARB 0x8254 +#define GL_UNKNOWN_CONTEXT_RESET_ARB 0x8255 +#define GL_RESET_NOTIFICATION_STRATEGY_ARB 0x8256 +#define GL_NO_RESET_NOTIFICATION_ARB 0x8261 + +typedef GLenum (GLAPIENTRY * PFNGLGETGRAPHICSRESETSTATUSARBPROC) (void); +typedef void (GLAPIENTRY * PFNGLGETNCOLORTABLEARBPROC) (GLenum target, GLenum format, GLenum type, GLsizei bufSize, void* table); +typedef void (GLAPIENTRY * PFNGLGETNCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GLint lod, GLsizei bufSize, void* img); +typedef void (GLAPIENTRY * PFNGLGETNCONVOLUTIONFILTERARBPROC) (GLenum target, GLenum format, GLenum type, GLsizei bufSize, void* image); +typedef void (GLAPIENTRY * PFNGLGETNHISTOGRAMARBPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, void* values); +typedef void (GLAPIENTRY * PFNGLGETNMAPDVARBPROC) (GLenum target, GLenum query, GLsizei bufSize, GLdouble* v); +typedef void (GLAPIENTRY * PFNGLGETNMAPFVARBPROC) (GLenum target, GLenum query, GLsizei bufSize, GLfloat* v); +typedef void (GLAPIENTRY * PFNGLGETNMAPIVARBPROC) (GLenum target, GLenum query, GLsizei bufSize, GLint* v); +typedef void (GLAPIENTRY * PFNGLGETNMINMAXARBPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, void* values); +typedef void (GLAPIENTRY * PFNGLGETNPIXELMAPFVARBPROC) (GLenum map, GLsizei bufSize, GLfloat* values); +typedef void (GLAPIENTRY * PFNGLGETNPIXELMAPUIVARBPROC) (GLenum map, GLsizei bufSize, GLuint* values); +typedef void (GLAPIENTRY * PFNGLGETNPIXELMAPUSVARBPROC) (GLenum map, GLsizei bufSize, GLushort* values); +typedef void (GLAPIENTRY * PFNGLGETNPOLYGONSTIPPLEARBPROC) (GLsizei bufSize, GLubyte* pattern); +typedef void (GLAPIENTRY * PFNGLGETNSEPARABLEFILTERARBPROC) (GLenum target, GLenum format, GLenum type, GLsizei rowBufSize, void* row, GLsizei columnBufSize, GLvoid*column, GLvoid*span); +typedef void (GLAPIENTRY * PFNGLGETNTEXIMAGEARBPROC) (GLenum target, GLint level, GLenum format, GLenum type, GLsizei bufSize, void* img); +typedef void (GLAPIENTRY * PFNGLGETNUNIFORMDVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLGETNUNIFORMFVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETNUNIFORMIVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETNUNIFORMUIVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLuint* params); +typedef void (GLAPIENTRY * PFNGLREADNPIXELSARBPROC) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void* data); + +#define glGetGraphicsResetStatusARB GLEW_GET_FUN(__glewGetGraphicsResetStatusARB) +#define glGetnColorTableARB GLEW_GET_FUN(__glewGetnColorTableARB) +#define glGetnCompressedTexImageARB GLEW_GET_FUN(__glewGetnCompressedTexImageARB) +#define glGetnConvolutionFilterARB GLEW_GET_FUN(__glewGetnConvolutionFilterARB) +#define glGetnHistogramARB GLEW_GET_FUN(__glewGetnHistogramARB) +#define glGetnMapdvARB GLEW_GET_FUN(__glewGetnMapdvARB) +#define glGetnMapfvARB GLEW_GET_FUN(__glewGetnMapfvARB) +#define glGetnMapivARB GLEW_GET_FUN(__glewGetnMapivARB) +#define glGetnMinmaxARB GLEW_GET_FUN(__glewGetnMinmaxARB) +#define glGetnPixelMapfvARB GLEW_GET_FUN(__glewGetnPixelMapfvARB) +#define glGetnPixelMapuivARB GLEW_GET_FUN(__glewGetnPixelMapuivARB) +#define glGetnPixelMapusvARB GLEW_GET_FUN(__glewGetnPixelMapusvARB) +#define glGetnPolygonStippleARB GLEW_GET_FUN(__glewGetnPolygonStippleARB) +#define glGetnSeparableFilterARB GLEW_GET_FUN(__glewGetnSeparableFilterARB) +#define glGetnTexImageARB GLEW_GET_FUN(__glewGetnTexImageARB) +#define glGetnUniformdvARB GLEW_GET_FUN(__glewGetnUniformdvARB) +#define glGetnUniformfvARB GLEW_GET_FUN(__glewGetnUniformfvARB) +#define glGetnUniformivARB GLEW_GET_FUN(__glewGetnUniformivARB) +#define glGetnUniformuivARB GLEW_GET_FUN(__glewGetnUniformuivARB) +#define glReadnPixelsARB GLEW_GET_FUN(__glewReadnPixelsARB) + +#define GLEW_ARB_robustness GLEW_GET_VAR(__GLEW_ARB_robustness) + +#endif /* GL_ARB_robustness */ + +/* ---------------- GL_ARB_robustness_application_isolation ---------------- */ + +#ifndef GL_ARB_robustness_application_isolation +#define GL_ARB_robustness_application_isolation 1 + +#define GLEW_ARB_robustness_application_isolation GLEW_GET_VAR(__GLEW_ARB_robustness_application_isolation) + +#endif /* GL_ARB_robustness_application_isolation */ + +/* ---------------- GL_ARB_robustness_share_group_isolation ---------------- */ + +#ifndef GL_ARB_robustness_share_group_isolation +#define GL_ARB_robustness_share_group_isolation 1 + +#define GLEW_ARB_robustness_share_group_isolation GLEW_GET_VAR(__GLEW_ARB_robustness_share_group_isolation) + +#endif /* GL_ARB_robustness_share_group_isolation */ + +/* ------------------------- GL_ARB_sample_shading ------------------------- */ + +#ifndef GL_ARB_sample_shading +#define GL_ARB_sample_shading 1 + +#define GL_SAMPLE_SHADING_ARB 0x8C36 +#define GL_MIN_SAMPLE_SHADING_VALUE_ARB 0x8C37 + +typedef void (GLAPIENTRY * PFNGLMINSAMPLESHADINGARBPROC) (GLclampf value); + +#define glMinSampleShadingARB GLEW_GET_FUN(__glewMinSampleShadingARB) + +#define GLEW_ARB_sample_shading GLEW_GET_VAR(__GLEW_ARB_sample_shading) + +#endif /* GL_ARB_sample_shading */ + +/* ------------------------- GL_ARB_sampler_objects ------------------------ */ + +#ifndef GL_ARB_sampler_objects +#define GL_ARB_sampler_objects 1 + +#define GL_SAMPLER_BINDING 0x8919 + +typedef void (GLAPIENTRY * PFNGLBINDSAMPLERPROC) (GLuint unit, GLuint sampler); +typedef void (GLAPIENTRY * PFNGLDELETESAMPLERSPROC) (GLsizei count, const GLuint * samplers); +typedef void (GLAPIENTRY * PFNGLGENSAMPLERSPROC) (GLsizei count, GLuint* samplers); +typedef void (GLAPIENTRY * PFNGLGETSAMPLERPARAMETERIIVPROC) (GLuint sampler, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETSAMPLERPARAMETERIUIVPROC) (GLuint sampler, GLenum pname, GLuint* params); +typedef void (GLAPIENTRY * PFNGLGETSAMPLERPARAMETERFVPROC) (GLuint sampler, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETSAMPLERPARAMETERIVPROC) (GLuint sampler, GLenum pname, GLint* params); +typedef GLboolean (GLAPIENTRY * PFNGLISSAMPLERPROC) (GLuint sampler); +typedef void (GLAPIENTRY * PFNGLSAMPLERPARAMETERIIVPROC) (GLuint sampler, GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLSAMPLERPARAMETERIUIVPROC) (GLuint sampler, GLenum pname, const GLuint* params); +typedef void (GLAPIENTRY * PFNGLSAMPLERPARAMETERFPROC) (GLuint sampler, GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLSAMPLERPARAMETERFVPROC) (GLuint sampler, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLSAMPLERPARAMETERIPROC) (GLuint sampler, GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLSAMPLERPARAMETERIVPROC) (GLuint sampler, GLenum pname, const GLint* params); + +#define glBindSampler GLEW_GET_FUN(__glewBindSampler) +#define glDeleteSamplers GLEW_GET_FUN(__glewDeleteSamplers) +#define glGenSamplers GLEW_GET_FUN(__glewGenSamplers) +#define glGetSamplerParameterIiv GLEW_GET_FUN(__glewGetSamplerParameterIiv) +#define glGetSamplerParameterIuiv GLEW_GET_FUN(__glewGetSamplerParameterIuiv) +#define glGetSamplerParameterfv GLEW_GET_FUN(__glewGetSamplerParameterfv) +#define glGetSamplerParameteriv GLEW_GET_FUN(__glewGetSamplerParameteriv) +#define glIsSampler GLEW_GET_FUN(__glewIsSampler) +#define glSamplerParameterIiv GLEW_GET_FUN(__glewSamplerParameterIiv) +#define glSamplerParameterIuiv GLEW_GET_FUN(__glewSamplerParameterIuiv) +#define glSamplerParameterf GLEW_GET_FUN(__glewSamplerParameterf) +#define glSamplerParameterfv GLEW_GET_FUN(__glewSamplerParameterfv) +#define glSamplerParameteri GLEW_GET_FUN(__glewSamplerParameteri) +#define glSamplerParameteriv GLEW_GET_FUN(__glewSamplerParameteriv) + +#define GLEW_ARB_sampler_objects GLEW_GET_VAR(__GLEW_ARB_sampler_objects) + +#endif /* GL_ARB_sampler_objects */ + +/* ------------------------ GL_ARB_seamless_cube_map ----------------------- */ + +#ifndef GL_ARB_seamless_cube_map +#define GL_ARB_seamless_cube_map 1 + +#define GL_TEXTURE_CUBE_MAP_SEAMLESS 0x884F + +#define GLEW_ARB_seamless_cube_map GLEW_GET_VAR(__GLEW_ARB_seamless_cube_map) + +#endif /* GL_ARB_seamless_cube_map */ + +/* ------------------ GL_ARB_seamless_cubemap_per_texture ------------------ */ + +#ifndef GL_ARB_seamless_cubemap_per_texture +#define GL_ARB_seamless_cubemap_per_texture 1 + +#define GL_TEXTURE_CUBE_MAP_SEAMLESS 0x884F + +#define GLEW_ARB_seamless_cubemap_per_texture GLEW_GET_VAR(__GLEW_ARB_seamless_cubemap_per_texture) + +#endif /* GL_ARB_seamless_cubemap_per_texture */ + +/* --------------------- GL_ARB_separate_shader_objects -------------------- */ + +#ifndef GL_ARB_separate_shader_objects +#define GL_ARB_separate_shader_objects 1 + +#define GL_VERTEX_SHADER_BIT 0x00000001 +#define GL_FRAGMENT_SHADER_BIT 0x00000002 +#define GL_GEOMETRY_SHADER_BIT 0x00000004 +#define GL_TESS_CONTROL_SHADER_BIT 0x00000008 +#define GL_TESS_EVALUATION_SHADER_BIT 0x00000010 +#define GL_PROGRAM_SEPARABLE 0x8258 +#define GL_ACTIVE_PROGRAM 0x8259 +#define GL_PROGRAM_PIPELINE_BINDING 0x825A +#define GL_ALL_SHADER_BITS 0xFFFFFFFF + +typedef void (GLAPIENTRY * PFNGLACTIVESHADERPROGRAMPROC) (GLuint pipeline, GLuint program); +typedef void (GLAPIENTRY * PFNGLBINDPROGRAMPIPELINEPROC) (GLuint pipeline); +typedef GLuint (GLAPIENTRY * PFNGLCREATESHADERPROGRAMVPROC) (GLenum type, GLsizei count, const GLchar ** strings); +typedef void (GLAPIENTRY * PFNGLDELETEPROGRAMPIPELINESPROC) (GLsizei n, const GLuint* pipelines); +typedef void (GLAPIENTRY * PFNGLGENPROGRAMPIPELINESPROC) (GLsizei n, GLuint* pipelines); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMPIPELINEINFOLOGPROC) (GLuint pipeline, GLsizei bufSize, GLsizei* length, GLchar *infoLog); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMPIPELINEIVPROC) (GLuint pipeline, GLenum pname, GLint* params); +typedef GLboolean (GLAPIENTRY * PFNGLISPROGRAMPIPELINEPROC) (GLuint pipeline); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1DPROC) (GLuint program, GLint location, GLdouble x); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1FPROC) (GLuint program, GLint location, GLfloat x); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1IPROC) (GLuint program, GLint location, GLint x); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1IVPROC) (GLuint program, GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1UIPROC) (GLuint program, GLint location, GLuint x); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2DPROC) (GLuint program, GLint location, GLdouble x, GLdouble y); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2FPROC) (GLuint program, GLint location, GLfloat x, GLfloat y); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2IPROC) (GLuint program, GLint location, GLint x, GLint y); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2IVPROC) (GLuint program, GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2UIPROC) (GLuint program, GLint location, GLuint x, GLuint y); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3DPROC) (GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3FPROC) (GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3IPROC) (GLuint program, GLint location, GLint x, GLint y, GLint z); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3IVPROC) (GLuint program, GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3UIPROC) (GLuint program, GLint location, GLuint x, GLuint y, GLuint z); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4DPROC) (GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4FPROC) (GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4IPROC) (GLuint program, GLint location, GLint x, GLint y, GLint z, GLint w); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4IVPROC) (GLuint program, GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4UIPROC) (GLuint program, GLint location, GLuint x, GLuint y, GLuint z, GLuint w); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2X3DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2X3FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2X4DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2X4FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3X2DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3X2FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3X4DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3X4FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4X2DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4X2FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4X3DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4X3FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUSEPROGRAMSTAGESPROC) (GLuint pipeline, GLbitfield stages, GLuint program); +typedef void (GLAPIENTRY * PFNGLVALIDATEPROGRAMPIPELINEPROC) (GLuint pipeline); + +#define glActiveShaderProgram GLEW_GET_FUN(__glewActiveShaderProgram) +#define glBindProgramPipeline GLEW_GET_FUN(__glewBindProgramPipeline) +#define glCreateShaderProgramv GLEW_GET_FUN(__glewCreateShaderProgramv) +#define glDeleteProgramPipelines GLEW_GET_FUN(__glewDeleteProgramPipelines) +#define glGenProgramPipelines GLEW_GET_FUN(__glewGenProgramPipelines) +#define glGetProgramPipelineInfoLog GLEW_GET_FUN(__glewGetProgramPipelineInfoLog) +#define glGetProgramPipelineiv GLEW_GET_FUN(__glewGetProgramPipelineiv) +#define glIsProgramPipeline GLEW_GET_FUN(__glewIsProgramPipeline) +#define glProgramUniform1d GLEW_GET_FUN(__glewProgramUniform1d) +#define glProgramUniform1dv GLEW_GET_FUN(__glewProgramUniform1dv) +#define glProgramUniform1f GLEW_GET_FUN(__glewProgramUniform1f) +#define glProgramUniform1fv GLEW_GET_FUN(__glewProgramUniform1fv) +#define glProgramUniform1i GLEW_GET_FUN(__glewProgramUniform1i) +#define glProgramUniform1iv GLEW_GET_FUN(__glewProgramUniform1iv) +#define glProgramUniform1ui GLEW_GET_FUN(__glewProgramUniform1ui) +#define glProgramUniform1uiv GLEW_GET_FUN(__glewProgramUniform1uiv) +#define glProgramUniform2d GLEW_GET_FUN(__glewProgramUniform2d) +#define glProgramUniform2dv GLEW_GET_FUN(__glewProgramUniform2dv) +#define glProgramUniform2f GLEW_GET_FUN(__glewProgramUniform2f) +#define glProgramUniform2fv GLEW_GET_FUN(__glewProgramUniform2fv) +#define glProgramUniform2i GLEW_GET_FUN(__glewProgramUniform2i) +#define glProgramUniform2iv GLEW_GET_FUN(__glewProgramUniform2iv) +#define glProgramUniform2ui GLEW_GET_FUN(__glewProgramUniform2ui) +#define glProgramUniform2uiv GLEW_GET_FUN(__glewProgramUniform2uiv) +#define glProgramUniform3d GLEW_GET_FUN(__glewProgramUniform3d) +#define glProgramUniform3dv GLEW_GET_FUN(__glewProgramUniform3dv) +#define glProgramUniform3f GLEW_GET_FUN(__glewProgramUniform3f) +#define glProgramUniform3fv GLEW_GET_FUN(__glewProgramUniform3fv) +#define glProgramUniform3i GLEW_GET_FUN(__glewProgramUniform3i) +#define glProgramUniform3iv GLEW_GET_FUN(__glewProgramUniform3iv) +#define glProgramUniform3ui GLEW_GET_FUN(__glewProgramUniform3ui) +#define glProgramUniform3uiv GLEW_GET_FUN(__glewProgramUniform3uiv) +#define glProgramUniform4d GLEW_GET_FUN(__glewProgramUniform4d) +#define glProgramUniform4dv GLEW_GET_FUN(__glewProgramUniform4dv) +#define glProgramUniform4f GLEW_GET_FUN(__glewProgramUniform4f) +#define glProgramUniform4fv GLEW_GET_FUN(__glewProgramUniform4fv) +#define glProgramUniform4i GLEW_GET_FUN(__glewProgramUniform4i) +#define glProgramUniform4iv GLEW_GET_FUN(__glewProgramUniform4iv) +#define glProgramUniform4ui GLEW_GET_FUN(__glewProgramUniform4ui) +#define glProgramUniform4uiv GLEW_GET_FUN(__glewProgramUniform4uiv) +#define glProgramUniformMatrix2dv GLEW_GET_FUN(__glewProgramUniformMatrix2dv) +#define glProgramUniformMatrix2fv GLEW_GET_FUN(__glewProgramUniformMatrix2fv) +#define glProgramUniformMatrix2x3dv GLEW_GET_FUN(__glewProgramUniformMatrix2x3dv) +#define glProgramUniformMatrix2x3fv GLEW_GET_FUN(__glewProgramUniformMatrix2x3fv) +#define glProgramUniformMatrix2x4dv GLEW_GET_FUN(__glewProgramUniformMatrix2x4dv) +#define glProgramUniformMatrix2x4fv GLEW_GET_FUN(__glewProgramUniformMatrix2x4fv) +#define glProgramUniformMatrix3dv GLEW_GET_FUN(__glewProgramUniformMatrix3dv) +#define glProgramUniformMatrix3fv GLEW_GET_FUN(__glewProgramUniformMatrix3fv) +#define glProgramUniformMatrix3x2dv GLEW_GET_FUN(__glewProgramUniformMatrix3x2dv) +#define glProgramUniformMatrix3x2fv GLEW_GET_FUN(__glewProgramUniformMatrix3x2fv) +#define glProgramUniformMatrix3x4dv GLEW_GET_FUN(__glewProgramUniformMatrix3x4dv) +#define glProgramUniformMatrix3x4fv GLEW_GET_FUN(__glewProgramUniformMatrix3x4fv) +#define glProgramUniformMatrix4dv GLEW_GET_FUN(__glewProgramUniformMatrix4dv) +#define glProgramUniformMatrix4fv GLEW_GET_FUN(__glewProgramUniformMatrix4fv) +#define glProgramUniformMatrix4x2dv GLEW_GET_FUN(__glewProgramUniformMatrix4x2dv) +#define glProgramUniformMatrix4x2fv GLEW_GET_FUN(__glewProgramUniformMatrix4x2fv) +#define glProgramUniformMatrix4x3dv GLEW_GET_FUN(__glewProgramUniformMatrix4x3dv) +#define glProgramUniformMatrix4x3fv GLEW_GET_FUN(__glewProgramUniformMatrix4x3fv) +#define glUseProgramStages GLEW_GET_FUN(__glewUseProgramStages) +#define glValidateProgramPipeline GLEW_GET_FUN(__glewValidateProgramPipeline) + +#define GLEW_ARB_separate_shader_objects GLEW_GET_VAR(__GLEW_ARB_separate_shader_objects) + +#endif /* GL_ARB_separate_shader_objects */ + +/* --------------------- GL_ARB_shader_atomic_counters --------------------- */ + +#ifndef GL_ARB_shader_atomic_counters +#define GL_ARB_shader_atomic_counters 1 + +#define GL_ATOMIC_COUNTER_BUFFER 0x92C0 +#define GL_ATOMIC_COUNTER_BUFFER_BINDING 0x92C1 +#define GL_ATOMIC_COUNTER_BUFFER_START 0x92C2 +#define GL_ATOMIC_COUNTER_BUFFER_SIZE 0x92C3 +#define GL_ATOMIC_COUNTER_BUFFER_DATA_SIZE 0x92C4 +#define GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTERS 0x92C5 +#define GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTER_INDICES 0x92C6 +#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_VERTEX_SHADER 0x92C7 +#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_CONTROL_SHADER 0x92C8 +#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_EVALUATION_SHADER 0x92C9 +#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_GEOMETRY_SHADER 0x92CA +#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_FRAGMENT_SHADER 0x92CB +#define GL_MAX_VERTEX_ATOMIC_COUNTER_BUFFERS 0x92CC +#define GL_MAX_TESS_CONTROL_ATOMIC_COUNTER_BUFFERS 0x92CD +#define GL_MAX_TESS_EVALUATION_ATOMIC_COUNTER_BUFFERS 0x92CE +#define GL_MAX_GEOMETRY_ATOMIC_COUNTER_BUFFERS 0x92CF +#define GL_MAX_FRAGMENT_ATOMIC_COUNTER_BUFFERS 0x92D0 +#define GL_MAX_COMBINED_ATOMIC_COUNTER_BUFFERS 0x92D1 +#define GL_MAX_VERTEX_ATOMIC_COUNTERS 0x92D2 +#define GL_MAX_TESS_CONTROL_ATOMIC_COUNTERS 0x92D3 +#define GL_MAX_TESS_EVALUATION_ATOMIC_COUNTERS 0x92D4 +#define GL_MAX_GEOMETRY_ATOMIC_COUNTERS 0x92D5 +#define GL_MAX_FRAGMENT_ATOMIC_COUNTERS 0x92D6 +#define GL_MAX_COMBINED_ATOMIC_COUNTERS 0x92D7 +#define GL_MAX_ATOMIC_COUNTER_BUFFER_SIZE 0x92D8 +#define GL_ACTIVE_ATOMIC_COUNTER_BUFFERS 0x92D9 +#define GL_UNIFORM_ATOMIC_COUNTER_BUFFER_INDEX 0x92DA +#define GL_UNSIGNED_INT_ATOMIC_COUNTER 0x92DB +#define GL_MAX_ATOMIC_COUNTER_BUFFER_BINDINGS 0x92DC + +typedef void (GLAPIENTRY * PFNGLGETACTIVEATOMICCOUNTERBUFFERIVPROC) (GLuint program, GLuint bufferIndex, GLenum pname, GLint* params); + +#define glGetActiveAtomicCounterBufferiv GLEW_GET_FUN(__glewGetActiveAtomicCounterBufferiv) + +#define GLEW_ARB_shader_atomic_counters GLEW_GET_VAR(__GLEW_ARB_shader_atomic_counters) + +#endif /* GL_ARB_shader_atomic_counters */ + +/* ----------------------- GL_ARB_shader_bit_encoding ---------------------- */ + +#ifndef GL_ARB_shader_bit_encoding +#define GL_ARB_shader_bit_encoding 1 + +#define GLEW_ARB_shader_bit_encoding GLEW_GET_VAR(__GLEW_ARB_shader_bit_encoding) + +#endif /* GL_ARB_shader_bit_encoding */ + +/* --------------------- GL_ARB_shader_draw_parameters --------------------- */ + +#ifndef GL_ARB_shader_draw_parameters +#define GL_ARB_shader_draw_parameters 1 + +#define GLEW_ARB_shader_draw_parameters GLEW_GET_VAR(__GLEW_ARB_shader_draw_parameters) + +#endif /* GL_ARB_shader_draw_parameters */ + +/* ------------------------ GL_ARB_shader_group_vote ----------------------- */ + +#ifndef GL_ARB_shader_group_vote +#define GL_ARB_shader_group_vote 1 + +#define GLEW_ARB_shader_group_vote GLEW_GET_VAR(__GLEW_ARB_shader_group_vote) + +#endif /* GL_ARB_shader_group_vote */ + +/* --------------------- GL_ARB_shader_image_load_store -------------------- */ + +#ifndef GL_ARB_shader_image_load_store +#define GL_ARB_shader_image_load_store 1 + +#define GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT 0x00000001 +#define GL_ELEMENT_ARRAY_BARRIER_BIT 0x00000002 +#define GL_UNIFORM_BARRIER_BIT 0x00000004 +#define GL_TEXTURE_FETCH_BARRIER_BIT 0x00000008 +#define GL_SHADER_IMAGE_ACCESS_BARRIER_BIT 0x00000020 +#define GL_COMMAND_BARRIER_BIT 0x00000040 +#define GL_PIXEL_BUFFER_BARRIER_BIT 0x00000080 +#define GL_TEXTURE_UPDATE_BARRIER_BIT 0x00000100 +#define GL_BUFFER_UPDATE_BARRIER_BIT 0x00000200 +#define GL_FRAMEBUFFER_BARRIER_BIT 0x00000400 +#define GL_TRANSFORM_FEEDBACK_BARRIER_BIT 0x00000800 +#define GL_ATOMIC_COUNTER_BARRIER_BIT 0x00001000 +#define GL_MAX_IMAGE_UNITS 0x8F38 +#define GL_MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS 0x8F39 +#define GL_IMAGE_BINDING_NAME 0x8F3A +#define GL_IMAGE_BINDING_LEVEL 0x8F3B +#define GL_IMAGE_BINDING_LAYERED 0x8F3C +#define GL_IMAGE_BINDING_LAYER 0x8F3D +#define GL_IMAGE_BINDING_ACCESS 0x8F3E +#define GL_IMAGE_1D 0x904C +#define GL_IMAGE_2D 0x904D +#define GL_IMAGE_3D 0x904E +#define GL_IMAGE_2D_RECT 0x904F +#define GL_IMAGE_CUBE 0x9050 +#define GL_IMAGE_BUFFER 0x9051 +#define GL_IMAGE_1D_ARRAY 0x9052 +#define GL_IMAGE_2D_ARRAY 0x9053 +#define GL_IMAGE_CUBE_MAP_ARRAY 0x9054 +#define GL_IMAGE_2D_MULTISAMPLE 0x9055 +#define GL_IMAGE_2D_MULTISAMPLE_ARRAY 0x9056 +#define GL_INT_IMAGE_1D 0x9057 +#define GL_INT_IMAGE_2D 0x9058 +#define GL_INT_IMAGE_3D 0x9059 +#define GL_INT_IMAGE_2D_RECT 0x905A +#define GL_INT_IMAGE_CUBE 0x905B +#define GL_INT_IMAGE_BUFFER 0x905C +#define GL_INT_IMAGE_1D_ARRAY 0x905D +#define GL_INT_IMAGE_2D_ARRAY 0x905E +#define GL_INT_IMAGE_CUBE_MAP_ARRAY 0x905F +#define GL_INT_IMAGE_2D_MULTISAMPLE 0x9060 +#define GL_INT_IMAGE_2D_MULTISAMPLE_ARRAY 0x9061 +#define GL_UNSIGNED_INT_IMAGE_1D 0x9062 +#define GL_UNSIGNED_INT_IMAGE_2D 0x9063 +#define GL_UNSIGNED_INT_IMAGE_3D 0x9064 +#define GL_UNSIGNED_INT_IMAGE_2D_RECT 0x9065 +#define GL_UNSIGNED_INT_IMAGE_CUBE 0x9066 +#define GL_UNSIGNED_INT_IMAGE_BUFFER 0x9067 +#define GL_UNSIGNED_INT_IMAGE_1D_ARRAY 0x9068 +#define GL_UNSIGNED_INT_IMAGE_2D_ARRAY 0x9069 +#define GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY 0x906A +#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE 0x906B +#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY 0x906C +#define GL_MAX_IMAGE_SAMPLES 0x906D +#define GL_IMAGE_BINDING_FORMAT 0x906E +#define GL_IMAGE_FORMAT_COMPATIBILITY_TYPE 0x90C7 +#define GL_IMAGE_FORMAT_COMPATIBILITY_BY_SIZE 0x90C8 +#define GL_IMAGE_FORMAT_COMPATIBILITY_BY_CLASS 0x90C9 +#define GL_MAX_VERTEX_IMAGE_UNIFORMS 0x90CA +#define GL_MAX_TESS_CONTROL_IMAGE_UNIFORMS 0x90CB +#define GL_MAX_TESS_EVALUATION_IMAGE_UNIFORMS 0x90CC +#define GL_MAX_GEOMETRY_IMAGE_UNIFORMS 0x90CD +#define GL_MAX_FRAGMENT_IMAGE_UNIFORMS 0x90CE +#define GL_MAX_COMBINED_IMAGE_UNIFORMS 0x90CF +#define GL_ALL_BARRIER_BITS 0xFFFFFFFF + +typedef void (GLAPIENTRY * PFNGLBINDIMAGETEXTUREPROC) (GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format); +typedef void (GLAPIENTRY * PFNGLMEMORYBARRIERPROC) (GLbitfield barriers); + +#define glBindImageTexture GLEW_GET_FUN(__glewBindImageTexture) +#define glMemoryBarrier GLEW_GET_FUN(__glewMemoryBarrier) + +#define GLEW_ARB_shader_image_load_store GLEW_GET_VAR(__GLEW_ARB_shader_image_load_store) + +#endif /* GL_ARB_shader_image_load_store */ + +/* ------------------------ GL_ARB_shader_image_size ----------------------- */ + +#ifndef GL_ARB_shader_image_size +#define GL_ARB_shader_image_size 1 + +#define GLEW_ARB_shader_image_size GLEW_GET_VAR(__GLEW_ARB_shader_image_size) + +#endif /* GL_ARB_shader_image_size */ + +/* ------------------------- GL_ARB_shader_objects ------------------------- */ + +#ifndef GL_ARB_shader_objects +#define GL_ARB_shader_objects 1 + +#define GL_PROGRAM_OBJECT_ARB 0x8B40 +#define GL_SHADER_OBJECT_ARB 0x8B48 +#define GL_OBJECT_TYPE_ARB 0x8B4E +#define GL_OBJECT_SUBTYPE_ARB 0x8B4F +#define GL_FLOAT_VEC2_ARB 0x8B50 +#define GL_FLOAT_VEC3_ARB 0x8B51 +#define GL_FLOAT_VEC4_ARB 0x8B52 +#define GL_INT_VEC2_ARB 0x8B53 +#define GL_INT_VEC3_ARB 0x8B54 +#define GL_INT_VEC4_ARB 0x8B55 +#define GL_BOOL_ARB 0x8B56 +#define GL_BOOL_VEC2_ARB 0x8B57 +#define GL_BOOL_VEC3_ARB 0x8B58 +#define GL_BOOL_VEC4_ARB 0x8B59 +#define GL_FLOAT_MAT2_ARB 0x8B5A +#define GL_FLOAT_MAT3_ARB 0x8B5B +#define GL_FLOAT_MAT4_ARB 0x8B5C +#define GL_SAMPLER_1D_ARB 0x8B5D +#define GL_SAMPLER_2D_ARB 0x8B5E +#define GL_SAMPLER_3D_ARB 0x8B5F +#define GL_SAMPLER_CUBE_ARB 0x8B60 +#define GL_SAMPLER_1D_SHADOW_ARB 0x8B61 +#define GL_SAMPLER_2D_SHADOW_ARB 0x8B62 +#define GL_SAMPLER_2D_RECT_ARB 0x8B63 +#define GL_SAMPLER_2D_RECT_SHADOW_ARB 0x8B64 +#define GL_OBJECT_DELETE_STATUS_ARB 0x8B80 +#define GL_OBJECT_COMPILE_STATUS_ARB 0x8B81 +#define GL_OBJECT_LINK_STATUS_ARB 0x8B82 +#define GL_OBJECT_VALIDATE_STATUS_ARB 0x8B83 +#define GL_OBJECT_INFO_LOG_LENGTH_ARB 0x8B84 +#define GL_OBJECT_ATTACHED_OBJECTS_ARB 0x8B85 +#define GL_OBJECT_ACTIVE_UNIFORMS_ARB 0x8B86 +#define GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB 0x8B87 +#define GL_OBJECT_SHADER_SOURCE_LENGTH_ARB 0x8B88 + +typedef char GLcharARB; +typedef unsigned int GLhandleARB; + +typedef void (GLAPIENTRY * PFNGLATTACHOBJECTARBPROC) (GLhandleARB containerObj, GLhandleARB obj); +typedef void (GLAPIENTRY * PFNGLCOMPILESHADERARBPROC) (GLhandleARB shaderObj); +typedef GLhandleARB (GLAPIENTRY * PFNGLCREATEPROGRAMOBJECTARBPROC) (void); +typedef GLhandleARB (GLAPIENTRY * PFNGLCREATESHADEROBJECTARBPROC) (GLenum shaderType); +typedef void (GLAPIENTRY * PFNGLDELETEOBJECTARBPROC) (GLhandleARB obj); +typedef void (GLAPIENTRY * PFNGLDETACHOBJECTARBPROC) (GLhandleARB containerObj, GLhandleARB attachedObj); +typedef void (GLAPIENTRY * PFNGLGETACTIVEUNIFORMARBPROC) (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei* length, GLint *size, GLenum *type, GLcharARB *name); +typedef void (GLAPIENTRY * PFNGLGETATTACHEDOBJECTSARBPROC) (GLhandleARB containerObj, GLsizei maxCount, GLsizei* count, GLhandleARB *obj); +typedef GLhandleARB (GLAPIENTRY * PFNGLGETHANDLEARBPROC) (GLenum pname); +typedef void (GLAPIENTRY * PFNGLGETINFOLOGARBPROC) (GLhandleARB obj, GLsizei maxLength, GLsizei* length, GLcharARB *infoLog); +typedef void (GLAPIENTRY * PFNGLGETOBJECTPARAMETERFVARBPROC) (GLhandleARB obj, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETOBJECTPARAMETERIVARBPROC) (GLhandleARB obj, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETSHADERSOURCEARBPROC) (GLhandleARB obj, GLsizei maxLength, GLsizei* length, GLcharARB *source); +typedef GLint (GLAPIENTRY * PFNGLGETUNIFORMLOCATIONARBPROC) (GLhandleARB programObj, const GLcharARB* name); +typedef void (GLAPIENTRY * PFNGLGETUNIFORMFVARBPROC) (GLhandleARB programObj, GLint location, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETUNIFORMIVARBPROC) (GLhandleARB programObj, GLint location, GLint* params); +typedef void (GLAPIENTRY * PFNGLLINKPROGRAMARBPROC) (GLhandleARB programObj); +typedef void (GLAPIENTRY * PFNGLSHADERSOURCEARBPROC) (GLhandleARB shaderObj, GLsizei count, const GLcharARB ** string, const GLint *length); +typedef void (GLAPIENTRY * PFNGLUNIFORM1FARBPROC) (GLint location, GLfloat v0); +typedef void (GLAPIENTRY * PFNGLUNIFORM1FVARBPROC) (GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM1IARBPROC) (GLint location, GLint v0); +typedef void (GLAPIENTRY * PFNGLUNIFORM1IVARBPROC) (GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM2FARBPROC) (GLint location, GLfloat v0, GLfloat v1); +typedef void (GLAPIENTRY * PFNGLUNIFORM2FVARBPROC) (GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM2IARBPROC) (GLint location, GLint v0, GLint v1); +typedef void (GLAPIENTRY * PFNGLUNIFORM2IVARBPROC) (GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM3FARBPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2); +typedef void (GLAPIENTRY * PFNGLUNIFORM3FVARBPROC) (GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM3IARBPROC) (GLint location, GLint v0, GLint v1, GLint v2); +typedef void (GLAPIENTRY * PFNGLUNIFORM3IVARBPROC) (GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM4FARBPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); +typedef void (GLAPIENTRY * PFNGLUNIFORM4FVARBPROC) (GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM4IARBPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3); +typedef void (GLAPIENTRY * PFNGLUNIFORM4IVARBPROC) (GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX2FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX3FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUSEPROGRAMOBJECTARBPROC) (GLhandleARB programObj); +typedef void (GLAPIENTRY * PFNGLVALIDATEPROGRAMARBPROC) (GLhandleARB programObj); + +#define glAttachObjectARB GLEW_GET_FUN(__glewAttachObjectARB) +#define glCompileShaderARB GLEW_GET_FUN(__glewCompileShaderARB) +#define glCreateProgramObjectARB GLEW_GET_FUN(__glewCreateProgramObjectARB) +#define glCreateShaderObjectARB GLEW_GET_FUN(__glewCreateShaderObjectARB) +#define glDeleteObjectARB GLEW_GET_FUN(__glewDeleteObjectARB) +#define glDetachObjectARB GLEW_GET_FUN(__glewDetachObjectARB) +#define glGetActiveUniformARB GLEW_GET_FUN(__glewGetActiveUniformARB) +#define glGetAttachedObjectsARB GLEW_GET_FUN(__glewGetAttachedObjectsARB) +#define glGetHandleARB GLEW_GET_FUN(__glewGetHandleARB) +#define glGetInfoLogARB GLEW_GET_FUN(__glewGetInfoLogARB) +#define glGetObjectParameterfvARB GLEW_GET_FUN(__glewGetObjectParameterfvARB) +#define glGetObjectParameterivARB GLEW_GET_FUN(__glewGetObjectParameterivARB) +#define glGetShaderSourceARB GLEW_GET_FUN(__glewGetShaderSourceARB) +#define glGetUniformLocationARB GLEW_GET_FUN(__glewGetUniformLocationARB) +#define glGetUniformfvARB GLEW_GET_FUN(__glewGetUniformfvARB) +#define glGetUniformivARB GLEW_GET_FUN(__glewGetUniformivARB) +#define glLinkProgramARB GLEW_GET_FUN(__glewLinkProgramARB) +#define glShaderSourceARB GLEW_GET_FUN(__glewShaderSourceARB) +#define glUniform1fARB GLEW_GET_FUN(__glewUniform1fARB) +#define glUniform1fvARB GLEW_GET_FUN(__glewUniform1fvARB) +#define glUniform1iARB GLEW_GET_FUN(__glewUniform1iARB) +#define glUniform1ivARB GLEW_GET_FUN(__glewUniform1ivARB) +#define glUniform2fARB GLEW_GET_FUN(__glewUniform2fARB) +#define glUniform2fvARB GLEW_GET_FUN(__glewUniform2fvARB) +#define glUniform2iARB GLEW_GET_FUN(__glewUniform2iARB) +#define glUniform2ivARB GLEW_GET_FUN(__glewUniform2ivARB) +#define glUniform3fARB GLEW_GET_FUN(__glewUniform3fARB) +#define glUniform3fvARB GLEW_GET_FUN(__glewUniform3fvARB) +#define glUniform3iARB GLEW_GET_FUN(__glewUniform3iARB) +#define glUniform3ivARB GLEW_GET_FUN(__glewUniform3ivARB) +#define glUniform4fARB GLEW_GET_FUN(__glewUniform4fARB) +#define glUniform4fvARB GLEW_GET_FUN(__glewUniform4fvARB) +#define glUniform4iARB GLEW_GET_FUN(__glewUniform4iARB) +#define glUniform4ivARB GLEW_GET_FUN(__glewUniform4ivARB) +#define glUniformMatrix2fvARB GLEW_GET_FUN(__glewUniformMatrix2fvARB) +#define glUniformMatrix3fvARB GLEW_GET_FUN(__glewUniformMatrix3fvARB) +#define glUniformMatrix4fvARB GLEW_GET_FUN(__glewUniformMatrix4fvARB) +#define glUseProgramObjectARB GLEW_GET_FUN(__glewUseProgramObjectARB) +#define glValidateProgramARB GLEW_GET_FUN(__glewValidateProgramARB) + +#define GLEW_ARB_shader_objects GLEW_GET_VAR(__GLEW_ARB_shader_objects) + +#endif /* GL_ARB_shader_objects */ + +/* ------------------------ GL_ARB_shader_precision ------------------------ */ + +#ifndef GL_ARB_shader_precision +#define GL_ARB_shader_precision 1 + +#define GLEW_ARB_shader_precision GLEW_GET_VAR(__GLEW_ARB_shader_precision) + +#endif /* GL_ARB_shader_precision */ + +/* ---------------------- GL_ARB_shader_stencil_export --------------------- */ + +#ifndef GL_ARB_shader_stencil_export +#define GL_ARB_shader_stencil_export 1 + +#define GLEW_ARB_shader_stencil_export GLEW_GET_VAR(__GLEW_ARB_shader_stencil_export) + +#endif /* GL_ARB_shader_stencil_export */ + +/* ------------------ GL_ARB_shader_storage_buffer_object ------------------ */ + +#ifndef GL_ARB_shader_storage_buffer_object +#define GL_ARB_shader_storage_buffer_object 1 + +#define GL_SHADER_STORAGE_BARRIER_BIT 0x2000 +#define GL_MAX_COMBINED_SHADER_OUTPUT_RESOURCES 0x8F39 +#define GL_SHADER_STORAGE_BUFFER 0x90D2 +#define GL_SHADER_STORAGE_BUFFER_BINDING 0x90D3 +#define GL_SHADER_STORAGE_BUFFER_START 0x90D4 +#define GL_SHADER_STORAGE_BUFFER_SIZE 0x90D5 +#define GL_MAX_VERTEX_SHADER_STORAGE_BLOCKS 0x90D6 +#define GL_MAX_GEOMETRY_SHADER_STORAGE_BLOCKS 0x90D7 +#define GL_MAX_TESS_CONTROL_SHADER_STORAGE_BLOCKS 0x90D8 +#define GL_MAX_TESS_EVALUATION_SHADER_STORAGE_BLOCKS 0x90D9 +#define GL_MAX_FRAGMENT_SHADER_STORAGE_BLOCKS 0x90DA +#define GL_MAX_COMPUTE_SHADER_STORAGE_BLOCKS 0x90DB +#define GL_MAX_COMBINED_SHADER_STORAGE_BLOCKS 0x90DC +#define GL_MAX_SHADER_STORAGE_BUFFER_BINDINGS 0x90DD +#define GL_MAX_SHADER_STORAGE_BLOCK_SIZE 0x90DE +#define GL_SHADER_STORAGE_BUFFER_OFFSET_ALIGNMENT 0x90DF + +typedef void (GLAPIENTRY * PFNGLSHADERSTORAGEBLOCKBINDINGPROC) (GLuint program, GLuint storageBlockIndex, GLuint storageBlockBinding); + +#define glShaderStorageBlockBinding GLEW_GET_FUN(__glewShaderStorageBlockBinding) + +#define GLEW_ARB_shader_storage_buffer_object GLEW_GET_VAR(__GLEW_ARB_shader_storage_buffer_object) + +#endif /* GL_ARB_shader_storage_buffer_object */ + +/* ------------------------ GL_ARB_shader_subroutine ----------------------- */ + +#ifndef GL_ARB_shader_subroutine +#define GL_ARB_shader_subroutine 1 + +#define GL_ACTIVE_SUBROUTINES 0x8DE5 +#define GL_ACTIVE_SUBROUTINE_UNIFORMS 0x8DE6 +#define GL_MAX_SUBROUTINES 0x8DE7 +#define GL_MAX_SUBROUTINE_UNIFORM_LOCATIONS 0x8DE8 +#define GL_ACTIVE_SUBROUTINE_UNIFORM_LOCATIONS 0x8E47 +#define GL_ACTIVE_SUBROUTINE_MAX_LENGTH 0x8E48 +#define GL_ACTIVE_SUBROUTINE_UNIFORM_MAX_LENGTH 0x8E49 +#define GL_NUM_COMPATIBLE_SUBROUTINES 0x8E4A +#define GL_COMPATIBLE_SUBROUTINES 0x8E4B + +typedef void (GLAPIENTRY * PFNGLGETACTIVESUBROUTINENAMEPROC) (GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei* length, GLchar *name); +typedef void (GLAPIENTRY * PFNGLGETACTIVESUBROUTINEUNIFORMNAMEPROC) (GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei* length, GLchar *name); +typedef void (GLAPIENTRY * PFNGLGETACTIVESUBROUTINEUNIFORMIVPROC) (GLuint program, GLenum shadertype, GLuint index, GLenum pname, GLint* values); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMSTAGEIVPROC) (GLuint program, GLenum shadertype, GLenum pname, GLint* values); +typedef GLuint (GLAPIENTRY * PFNGLGETSUBROUTINEINDEXPROC) (GLuint program, GLenum shadertype, const GLchar* name); +typedef GLint (GLAPIENTRY * PFNGLGETSUBROUTINEUNIFORMLOCATIONPROC) (GLuint program, GLenum shadertype, const GLchar* name); +typedef void (GLAPIENTRY * PFNGLGETUNIFORMSUBROUTINEUIVPROC) (GLenum shadertype, GLint location, GLuint* params); +typedef void (GLAPIENTRY * PFNGLUNIFORMSUBROUTINESUIVPROC) (GLenum shadertype, GLsizei count, const GLuint* indices); + +#define glGetActiveSubroutineName GLEW_GET_FUN(__glewGetActiveSubroutineName) +#define glGetActiveSubroutineUniformName GLEW_GET_FUN(__glewGetActiveSubroutineUniformName) +#define glGetActiveSubroutineUniformiv GLEW_GET_FUN(__glewGetActiveSubroutineUniformiv) +#define glGetProgramStageiv GLEW_GET_FUN(__glewGetProgramStageiv) +#define glGetSubroutineIndex GLEW_GET_FUN(__glewGetSubroutineIndex) +#define glGetSubroutineUniformLocation GLEW_GET_FUN(__glewGetSubroutineUniformLocation) +#define glGetUniformSubroutineuiv GLEW_GET_FUN(__glewGetUniformSubroutineuiv) +#define glUniformSubroutinesuiv GLEW_GET_FUN(__glewUniformSubroutinesuiv) + +#define GLEW_ARB_shader_subroutine GLEW_GET_VAR(__GLEW_ARB_shader_subroutine) + +#endif /* GL_ARB_shader_subroutine */ + +/* ----------------------- GL_ARB_shader_texture_lod ----------------------- */ + +#ifndef GL_ARB_shader_texture_lod +#define GL_ARB_shader_texture_lod 1 + +#define GLEW_ARB_shader_texture_lod GLEW_GET_VAR(__GLEW_ARB_shader_texture_lod) + +#endif /* GL_ARB_shader_texture_lod */ + +/* ---------------------- GL_ARB_shading_language_100 ---------------------- */ + +#ifndef GL_ARB_shading_language_100 +#define GL_ARB_shading_language_100 1 + +#define GL_SHADING_LANGUAGE_VERSION_ARB 0x8B8C + +#define GLEW_ARB_shading_language_100 GLEW_GET_VAR(__GLEW_ARB_shading_language_100) + +#endif /* GL_ARB_shading_language_100 */ + +/* -------------------- GL_ARB_shading_language_420pack -------------------- */ + +#ifndef GL_ARB_shading_language_420pack +#define GL_ARB_shading_language_420pack 1 + +#define GLEW_ARB_shading_language_420pack GLEW_GET_VAR(__GLEW_ARB_shading_language_420pack) + +#endif /* GL_ARB_shading_language_420pack */ + +/* -------------------- GL_ARB_shading_language_include -------------------- */ + +#ifndef GL_ARB_shading_language_include +#define GL_ARB_shading_language_include 1 + +#define GL_SHADER_INCLUDE_ARB 0x8DAE +#define GL_NAMED_STRING_LENGTH_ARB 0x8DE9 +#define GL_NAMED_STRING_TYPE_ARB 0x8DEA + +typedef void (GLAPIENTRY * PFNGLCOMPILESHADERINCLUDEARBPROC) (GLuint shader, GLsizei count, const GLchar* const *path, const GLint *length); +typedef void (GLAPIENTRY * PFNGLDELETENAMEDSTRINGARBPROC) (GLint namelen, const GLchar* name); +typedef void (GLAPIENTRY * PFNGLGETNAMEDSTRINGARBPROC) (GLint namelen, const GLchar* name, GLsizei bufSize, GLint *stringlen, GLchar *string); +typedef void (GLAPIENTRY * PFNGLGETNAMEDSTRINGIVARBPROC) (GLint namelen, const GLchar* name, GLenum pname, GLint *params); +typedef GLboolean (GLAPIENTRY * PFNGLISNAMEDSTRINGARBPROC) (GLint namelen, const GLchar* name); +typedef void (GLAPIENTRY * PFNGLNAMEDSTRINGARBPROC) (GLenum type, GLint namelen, const GLchar* name, GLint stringlen, const GLchar *string); + +#define glCompileShaderIncludeARB GLEW_GET_FUN(__glewCompileShaderIncludeARB) +#define glDeleteNamedStringARB GLEW_GET_FUN(__glewDeleteNamedStringARB) +#define glGetNamedStringARB GLEW_GET_FUN(__glewGetNamedStringARB) +#define glGetNamedStringivARB GLEW_GET_FUN(__glewGetNamedStringivARB) +#define glIsNamedStringARB GLEW_GET_FUN(__glewIsNamedStringARB) +#define glNamedStringARB GLEW_GET_FUN(__glewNamedStringARB) + +#define GLEW_ARB_shading_language_include GLEW_GET_VAR(__GLEW_ARB_shading_language_include) + +#endif /* GL_ARB_shading_language_include */ + +/* -------------------- GL_ARB_shading_language_packing -------------------- */ + +#ifndef GL_ARB_shading_language_packing +#define GL_ARB_shading_language_packing 1 + +#define GLEW_ARB_shading_language_packing GLEW_GET_VAR(__GLEW_ARB_shading_language_packing) + +#endif /* GL_ARB_shading_language_packing */ + +/* ----------------------------- GL_ARB_shadow ----------------------------- */ + +#ifndef GL_ARB_shadow +#define GL_ARB_shadow 1 + +#define GL_TEXTURE_COMPARE_MODE_ARB 0x884C +#define GL_TEXTURE_COMPARE_FUNC_ARB 0x884D +#define GL_COMPARE_R_TO_TEXTURE_ARB 0x884E + +#define GLEW_ARB_shadow GLEW_GET_VAR(__GLEW_ARB_shadow) + +#endif /* GL_ARB_shadow */ + +/* ------------------------- GL_ARB_shadow_ambient ------------------------- */ + +#ifndef GL_ARB_shadow_ambient +#define GL_ARB_shadow_ambient 1 + +#define GL_TEXTURE_COMPARE_FAIL_VALUE_ARB 0x80BF + +#define GLEW_ARB_shadow_ambient GLEW_GET_VAR(__GLEW_ARB_shadow_ambient) + +#endif /* GL_ARB_shadow_ambient */ + +/* ------------------------- GL_ARB_sparse_texture ------------------------- */ + +#ifndef GL_ARB_sparse_texture +#define GL_ARB_sparse_texture 1 + +#define GL_VIRTUAL_PAGE_SIZE_X_ARB 0x9195 +#define GL_VIRTUAL_PAGE_SIZE_Y_ARB 0x9196 +#define GL_VIRTUAL_PAGE_SIZE_Z_ARB 0x9197 +#define GL_MAX_SPARSE_TEXTURE_SIZE_ARB 0x9198 +#define GL_MAX_SPARSE_3D_TEXTURE_SIZE_ARB 0x9199 +#define GL_MAX_SPARSE_ARRAY_TEXTURE_LAYERS_ARB 0x919A +#define GL_TEXTURE_SPARSE_ARB 0x91A6 +#define GL_VIRTUAL_PAGE_SIZE_INDEX_ARB 0x91A7 +#define GL_NUM_VIRTUAL_PAGE_SIZES_ARB 0x91A8 +#define GL_SPARSE_TEXTURE_FULL_ARRAY_CUBE_MIPMAPS_ARB 0x91A9 +#define GL_NUM_SPARSE_LEVELS_ARB 0x91AA + +typedef void (GLAPIENTRY * PFNGLTEXPAGECOMMITMENTARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLboolean commit); +typedef void (GLAPIENTRY * PFNGLTEXTUREPAGECOMMITMENTEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLboolean commit); + +#define glTexPageCommitmentARB GLEW_GET_FUN(__glewTexPageCommitmentARB) +#define glTexturePageCommitmentEXT GLEW_GET_FUN(__glewTexturePageCommitmentEXT) + +#define GLEW_ARB_sparse_texture GLEW_GET_VAR(__GLEW_ARB_sparse_texture) + +#endif /* GL_ARB_sparse_texture */ + +/* ------------------------ GL_ARB_stencil_texturing ----------------------- */ + +#ifndef GL_ARB_stencil_texturing +#define GL_ARB_stencil_texturing 1 + +#define GL_DEPTH_STENCIL_TEXTURE_MODE 0x90EA + +#define GLEW_ARB_stencil_texturing GLEW_GET_VAR(__GLEW_ARB_stencil_texturing) + +#endif /* GL_ARB_stencil_texturing */ + +/* ------------------------------ GL_ARB_sync ------------------------------ */ + +#ifndef GL_ARB_sync +#define GL_ARB_sync 1 + +#define GL_SYNC_FLUSH_COMMANDS_BIT 0x00000001 +#define GL_MAX_SERVER_WAIT_TIMEOUT 0x9111 +#define GL_OBJECT_TYPE 0x9112 +#define GL_SYNC_CONDITION 0x9113 +#define GL_SYNC_STATUS 0x9114 +#define GL_SYNC_FLAGS 0x9115 +#define GL_SYNC_FENCE 0x9116 +#define GL_SYNC_GPU_COMMANDS_COMPLETE 0x9117 +#define GL_UNSIGNALED 0x9118 +#define GL_SIGNALED 0x9119 +#define GL_ALREADY_SIGNALED 0x911A +#define GL_TIMEOUT_EXPIRED 0x911B +#define GL_CONDITION_SATISFIED 0x911C +#define GL_WAIT_FAILED 0x911D +#define GL_TIMEOUT_IGNORED 0xFFFFFFFFFFFFFFFF + +typedef GLenum (GLAPIENTRY * PFNGLCLIENTWAITSYNCPROC) (GLsync GLsync,GLbitfield flags,GLuint64 timeout); +typedef void (GLAPIENTRY * PFNGLDELETESYNCPROC) (GLsync GLsync); +typedef GLsync (GLAPIENTRY * PFNGLFENCESYNCPROC) (GLenum condition,GLbitfield flags); +typedef void (GLAPIENTRY * PFNGLGETINTEGER64VPROC) (GLenum pname, GLint64* params); +typedef void (GLAPIENTRY * PFNGLGETSYNCIVPROC) (GLsync GLsync,GLenum pname,GLsizei bufSize,GLsizei* length, GLint *values); +typedef GLboolean (GLAPIENTRY * PFNGLISSYNCPROC) (GLsync GLsync); +typedef void (GLAPIENTRY * PFNGLWAITSYNCPROC) (GLsync GLsync,GLbitfield flags,GLuint64 timeout); + +#define glClientWaitSync GLEW_GET_FUN(__glewClientWaitSync) +#define glDeleteSync GLEW_GET_FUN(__glewDeleteSync) +#define glFenceSync GLEW_GET_FUN(__glewFenceSync) +#define glGetInteger64v GLEW_GET_FUN(__glewGetInteger64v) +#define glGetSynciv GLEW_GET_FUN(__glewGetSynciv) +#define glIsSync GLEW_GET_FUN(__glewIsSync) +#define glWaitSync GLEW_GET_FUN(__glewWaitSync) + +#define GLEW_ARB_sync GLEW_GET_VAR(__GLEW_ARB_sync) + +#endif /* GL_ARB_sync */ + +/* ----------------------- GL_ARB_tessellation_shader ---------------------- */ + +#ifndef GL_ARB_tessellation_shader +#define GL_ARB_tessellation_shader 1 + +#define GL_PATCHES 0xE +#define GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_CONTROL_SHADER 0x84F0 +#define GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_EVALUATION_SHADER 0x84F1 +#define GL_MAX_TESS_CONTROL_INPUT_COMPONENTS 0x886C +#define GL_MAX_TESS_EVALUATION_INPUT_COMPONENTS 0x886D +#define GL_MAX_COMBINED_TESS_CONTROL_UNIFORM_COMPONENTS 0x8E1E +#define GL_MAX_COMBINED_TESS_EVALUATION_UNIFORM_COMPONENTS 0x8E1F +#define GL_PATCH_VERTICES 0x8E72 +#define GL_PATCH_DEFAULT_INNER_LEVEL 0x8E73 +#define GL_PATCH_DEFAULT_OUTER_LEVEL 0x8E74 +#define GL_TESS_CONTROL_OUTPUT_VERTICES 0x8E75 +#define GL_TESS_GEN_MODE 0x8E76 +#define GL_TESS_GEN_SPACING 0x8E77 +#define GL_TESS_GEN_VERTEX_ORDER 0x8E78 +#define GL_TESS_GEN_POINT_MODE 0x8E79 +#define GL_ISOLINES 0x8E7A +#define GL_FRACTIONAL_ODD 0x8E7B +#define GL_FRACTIONAL_EVEN 0x8E7C +#define GL_MAX_PATCH_VERTICES 0x8E7D +#define GL_MAX_TESS_GEN_LEVEL 0x8E7E +#define GL_MAX_TESS_CONTROL_UNIFORM_COMPONENTS 0x8E7F +#define GL_MAX_TESS_EVALUATION_UNIFORM_COMPONENTS 0x8E80 +#define GL_MAX_TESS_CONTROL_TEXTURE_IMAGE_UNITS 0x8E81 +#define GL_MAX_TESS_EVALUATION_TEXTURE_IMAGE_UNITS 0x8E82 +#define GL_MAX_TESS_CONTROL_OUTPUT_COMPONENTS 0x8E83 +#define GL_MAX_TESS_PATCH_COMPONENTS 0x8E84 +#define GL_MAX_TESS_CONTROL_TOTAL_OUTPUT_COMPONENTS 0x8E85 +#define GL_MAX_TESS_EVALUATION_OUTPUT_COMPONENTS 0x8E86 +#define GL_TESS_EVALUATION_SHADER 0x8E87 +#define GL_TESS_CONTROL_SHADER 0x8E88 +#define GL_MAX_TESS_CONTROL_UNIFORM_BLOCKS 0x8E89 +#define GL_MAX_TESS_EVALUATION_UNIFORM_BLOCKS 0x8E8A + +typedef void (GLAPIENTRY * PFNGLPATCHPARAMETERFVPROC) (GLenum pname, const GLfloat* values); +typedef void (GLAPIENTRY * PFNGLPATCHPARAMETERIPROC) (GLenum pname, GLint value); + +#define glPatchParameterfv GLEW_GET_FUN(__glewPatchParameterfv) +#define glPatchParameteri GLEW_GET_FUN(__glewPatchParameteri) + +#define GLEW_ARB_tessellation_shader GLEW_GET_VAR(__GLEW_ARB_tessellation_shader) + +#endif /* GL_ARB_tessellation_shader */ + +/* ---------------------- GL_ARB_texture_border_clamp ---------------------- */ + +#ifndef GL_ARB_texture_border_clamp +#define GL_ARB_texture_border_clamp 1 + +#define GL_CLAMP_TO_BORDER_ARB 0x812D + +#define GLEW_ARB_texture_border_clamp GLEW_GET_VAR(__GLEW_ARB_texture_border_clamp) + +#endif /* GL_ARB_texture_border_clamp */ + +/* ---------------------- GL_ARB_texture_buffer_object --------------------- */ + +#ifndef GL_ARB_texture_buffer_object +#define GL_ARB_texture_buffer_object 1 + +#define GL_TEXTURE_BUFFER_ARB 0x8C2A +#define GL_MAX_TEXTURE_BUFFER_SIZE_ARB 0x8C2B +#define GL_TEXTURE_BINDING_BUFFER_ARB 0x8C2C +#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING_ARB 0x8C2D +#define GL_TEXTURE_BUFFER_FORMAT_ARB 0x8C2E + +typedef void (GLAPIENTRY * PFNGLTEXBUFFERARBPROC) (GLenum target, GLenum internalformat, GLuint buffer); + +#define glTexBufferARB GLEW_GET_FUN(__glewTexBufferARB) + +#define GLEW_ARB_texture_buffer_object GLEW_GET_VAR(__GLEW_ARB_texture_buffer_object) + +#endif /* GL_ARB_texture_buffer_object */ + +/* ------------------- GL_ARB_texture_buffer_object_rgb32 ------------------ */ + +#ifndef GL_ARB_texture_buffer_object_rgb32 +#define GL_ARB_texture_buffer_object_rgb32 1 + +#define GLEW_ARB_texture_buffer_object_rgb32 GLEW_GET_VAR(__GLEW_ARB_texture_buffer_object_rgb32) + +#endif /* GL_ARB_texture_buffer_object_rgb32 */ + +/* ---------------------- GL_ARB_texture_buffer_range ---------------------- */ + +#ifndef GL_ARB_texture_buffer_range +#define GL_ARB_texture_buffer_range 1 + +#define GL_TEXTURE_BUFFER_OFFSET 0x919D +#define GL_TEXTURE_BUFFER_SIZE 0x919E +#define GL_TEXTURE_BUFFER_OFFSET_ALIGNMENT 0x919F + +typedef void (GLAPIENTRY * PFNGLTEXBUFFERRANGEPROC) (GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size); +typedef void (GLAPIENTRY * PFNGLTEXTUREBUFFERRANGEEXTPROC) (GLuint texture, GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size); + +#define glTexBufferRange GLEW_GET_FUN(__glewTexBufferRange) +#define glTextureBufferRangeEXT GLEW_GET_FUN(__glewTextureBufferRangeEXT) + +#define GLEW_ARB_texture_buffer_range GLEW_GET_VAR(__GLEW_ARB_texture_buffer_range) + +#endif /* GL_ARB_texture_buffer_range */ + +/* ----------------------- GL_ARB_texture_compression ---------------------- */ + +#ifndef GL_ARB_texture_compression +#define GL_ARB_texture_compression 1 + +#define GL_COMPRESSED_ALPHA_ARB 0x84E9 +#define GL_COMPRESSED_LUMINANCE_ARB 0x84EA +#define GL_COMPRESSED_LUMINANCE_ALPHA_ARB 0x84EB +#define GL_COMPRESSED_INTENSITY_ARB 0x84EC +#define GL_COMPRESSED_RGB_ARB 0x84ED +#define GL_COMPRESSED_RGBA_ARB 0x84EE +#define GL_TEXTURE_COMPRESSION_HINT_ARB 0x84EF +#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB 0x86A0 +#define GL_TEXTURE_COMPRESSED_ARB 0x86A1 +#define GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A2 +#define GL_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A3 + +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXIMAGE1DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXIMAGE2DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXIMAGE3DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLGETCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GLint lod, GLvoid *img); + +#define glCompressedTexImage1DARB GLEW_GET_FUN(__glewCompressedTexImage1DARB) +#define glCompressedTexImage2DARB GLEW_GET_FUN(__glewCompressedTexImage2DARB) +#define glCompressedTexImage3DARB GLEW_GET_FUN(__glewCompressedTexImage3DARB) +#define glCompressedTexSubImage1DARB GLEW_GET_FUN(__glewCompressedTexSubImage1DARB) +#define glCompressedTexSubImage2DARB GLEW_GET_FUN(__glewCompressedTexSubImage2DARB) +#define glCompressedTexSubImage3DARB GLEW_GET_FUN(__glewCompressedTexSubImage3DARB) +#define glGetCompressedTexImageARB GLEW_GET_FUN(__glewGetCompressedTexImageARB) + +#define GLEW_ARB_texture_compression GLEW_GET_VAR(__GLEW_ARB_texture_compression) + +#endif /* GL_ARB_texture_compression */ + +/* -------------------- GL_ARB_texture_compression_bptc -------------------- */ + +#ifndef GL_ARB_texture_compression_bptc +#define GL_ARB_texture_compression_bptc 1 + +#define GL_COMPRESSED_RGBA_BPTC_UNORM_ARB 0x8E8C +#define GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_ARB 0x8E8D +#define GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_ARB 0x8E8E +#define GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_ARB 0x8E8F + +#define GLEW_ARB_texture_compression_bptc GLEW_GET_VAR(__GLEW_ARB_texture_compression_bptc) + +#endif /* GL_ARB_texture_compression_bptc */ + +/* -------------------- GL_ARB_texture_compression_rgtc -------------------- */ + +#ifndef GL_ARB_texture_compression_rgtc +#define GL_ARB_texture_compression_rgtc 1 + +#define GL_COMPRESSED_RED_RGTC1 0x8DBB +#define GL_COMPRESSED_SIGNED_RED_RGTC1 0x8DBC +#define GL_COMPRESSED_RG_RGTC2 0x8DBD +#define GL_COMPRESSED_SIGNED_RG_RGTC2 0x8DBE + +#define GLEW_ARB_texture_compression_rgtc GLEW_GET_VAR(__GLEW_ARB_texture_compression_rgtc) + +#endif /* GL_ARB_texture_compression_rgtc */ + +/* ------------------------ GL_ARB_texture_cube_map ------------------------ */ + +#ifndef GL_ARB_texture_cube_map +#define GL_ARB_texture_cube_map 1 + +#define GL_NORMAL_MAP_ARB 0x8511 +#define GL_REFLECTION_MAP_ARB 0x8512 +#define GL_TEXTURE_CUBE_MAP_ARB 0x8513 +#define GL_TEXTURE_BINDING_CUBE_MAP_ARB 0x8514 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB 0x8515 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB 0x8516 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB 0x8517 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB 0x8518 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB 0x8519 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB 0x851A +#define GL_PROXY_TEXTURE_CUBE_MAP_ARB 0x851B +#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB 0x851C + +#define GLEW_ARB_texture_cube_map GLEW_GET_VAR(__GLEW_ARB_texture_cube_map) + +#endif /* GL_ARB_texture_cube_map */ + +/* --------------------- GL_ARB_texture_cube_map_array --------------------- */ + +#ifndef GL_ARB_texture_cube_map_array +#define GL_ARB_texture_cube_map_array 1 + +#define GL_TEXTURE_CUBE_MAP_ARRAY_ARB 0x9009 +#define GL_TEXTURE_BINDING_CUBE_MAP_ARRAY_ARB 0x900A +#define GL_PROXY_TEXTURE_CUBE_MAP_ARRAY_ARB 0x900B +#define GL_SAMPLER_CUBE_MAP_ARRAY_ARB 0x900C +#define GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW_ARB 0x900D +#define GL_INT_SAMPLER_CUBE_MAP_ARRAY_ARB 0x900E +#define GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY_ARB 0x900F + +#define GLEW_ARB_texture_cube_map_array GLEW_GET_VAR(__GLEW_ARB_texture_cube_map_array) + +#endif /* GL_ARB_texture_cube_map_array */ + +/* ------------------------- GL_ARB_texture_env_add ------------------------ */ + +#ifndef GL_ARB_texture_env_add +#define GL_ARB_texture_env_add 1 + +#define GLEW_ARB_texture_env_add GLEW_GET_VAR(__GLEW_ARB_texture_env_add) + +#endif /* GL_ARB_texture_env_add */ + +/* ----------------------- GL_ARB_texture_env_combine ---------------------- */ + +#ifndef GL_ARB_texture_env_combine +#define GL_ARB_texture_env_combine 1 + +#define GL_SUBTRACT_ARB 0x84E7 +#define GL_COMBINE_ARB 0x8570 +#define GL_COMBINE_RGB_ARB 0x8571 +#define GL_COMBINE_ALPHA_ARB 0x8572 +#define GL_RGB_SCALE_ARB 0x8573 +#define GL_ADD_SIGNED_ARB 0x8574 +#define GL_INTERPOLATE_ARB 0x8575 +#define GL_CONSTANT_ARB 0x8576 +#define GL_PRIMARY_COLOR_ARB 0x8577 +#define GL_PREVIOUS_ARB 0x8578 +#define GL_SOURCE0_RGB_ARB 0x8580 +#define GL_SOURCE1_RGB_ARB 0x8581 +#define GL_SOURCE2_RGB_ARB 0x8582 +#define GL_SOURCE0_ALPHA_ARB 0x8588 +#define GL_SOURCE1_ALPHA_ARB 0x8589 +#define GL_SOURCE2_ALPHA_ARB 0x858A +#define GL_OPERAND0_RGB_ARB 0x8590 +#define GL_OPERAND1_RGB_ARB 0x8591 +#define GL_OPERAND2_RGB_ARB 0x8592 +#define GL_OPERAND0_ALPHA_ARB 0x8598 +#define GL_OPERAND1_ALPHA_ARB 0x8599 +#define GL_OPERAND2_ALPHA_ARB 0x859A + +#define GLEW_ARB_texture_env_combine GLEW_GET_VAR(__GLEW_ARB_texture_env_combine) + +#endif /* GL_ARB_texture_env_combine */ + +/* ---------------------- GL_ARB_texture_env_crossbar ---------------------- */ + +#ifndef GL_ARB_texture_env_crossbar +#define GL_ARB_texture_env_crossbar 1 + +#define GLEW_ARB_texture_env_crossbar GLEW_GET_VAR(__GLEW_ARB_texture_env_crossbar) + +#endif /* GL_ARB_texture_env_crossbar */ + +/* ------------------------ GL_ARB_texture_env_dot3 ------------------------ */ + +#ifndef GL_ARB_texture_env_dot3 +#define GL_ARB_texture_env_dot3 1 + +#define GL_DOT3_RGB_ARB 0x86AE +#define GL_DOT3_RGBA_ARB 0x86AF + +#define GLEW_ARB_texture_env_dot3 GLEW_GET_VAR(__GLEW_ARB_texture_env_dot3) + +#endif /* GL_ARB_texture_env_dot3 */ + +/* -------------------------- GL_ARB_texture_float ------------------------- */ + +#ifndef GL_ARB_texture_float +#define GL_ARB_texture_float 1 + +#define GL_RGBA32F_ARB 0x8814 +#define GL_RGB32F_ARB 0x8815 +#define GL_ALPHA32F_ARB 0x8816 +#define GL_INTENSITY32F_ARB 0x8817 +#define GL_LUMINANCE32F_ARB 0x8818 +#define GL_LUMINANCE_ALPHA32F_ARB 0x8819 +#define GL_RGBA16F_ARB 0x881A +#define GL_RGB16F_ARB 0x881B +#define GL_ALPHA16F_ARB 0x881C +#define GL_INTENSITY16F_ARB 0x881D +#define GL_LUMINANCE16F_ARB 0x881E +#define GL_LUMINANCE_ALPHA16F_ARB 0x881F +#define GL_TEXTURE_RED_TYPE_ARB 0x8C10 +#define GL_TEXTURE_GREEN_TYPE_ARB 0x8C11 +#define GL_TEXTURE_BLUE_TYPE_ARB 0x8C12 +#define GL_TEXTURE_ALPHA_TYPE_ARB 0x8C13 +#define GL_TEXTURE_LUMINANCE_TYPE_ARB 0x8C14 +#define GL_TEXTURE_INTENSITY_TYPE_ARB 0x8C15 +#define GL_TEXTURE_DEPTH_TYPE_ARB 0x8C16 +#define GL_UNSIGNED_NORMALIZED_ARB 0x8C17 + +#define GLEW_ARB_texture_float GLEW_GET_VAR(__GLEW_ARB_texture_float) + +#endif /* GL_ARB_texture_float */ + +/* ------------------------- GL_ARB_texture_gather ------------------------- */ + +#ifndef GL_ARB_texture_gather +#define GL_ARB_texture_gather 1 + +#define GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET_ARB 0x8E5E +#define GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET_ARB 0x8E5F +#define GL_MAX_PROGRAM_TEXTURE_GATHER_COMPONENTS_ARB 0x8F9F + +#define GLEW_ARB_texture_gather GLEW_GET_VAR(__GLEW_ARB_texture_gather) + +#endif /* GL_ARB_texture_gather */ + +/* ------------------ GL_ARB_texture_mirror_clamp_to_edge ------------------ */ + +#ifndef GL_ARB_texture_mirror_clamp_to_edge +#define GL_ARB_texture_mirror_clamp_to_edge 1 + +#define GL_MIRROR_CLAMP_TO_EDGE 0x8743 + +#define GLEW_ARB_texture_mirror_clamp_to_edge GLEW_GET_VAR(__GLEW_ARB_texture_mirror_clamp_to_edge) + +#endif /* GL_ARB_texture_mirror_clamp_to_edge */ + +/* --------------------- GL_ARB_texture_mirrored_repeat -------------------- */ + +#ifndef GL_ARB_texture_mirrored_repeat +#define GL_ARB_texture_mirrored_repeat 1 + +#define GL_MIRRORED_REPEAT_ARB 0x8370 + +#define GLEW_ARB_texture_mirrored_repeat GLEW_GET_VAR(__GLEW_ARB_texture_mirrored_repeat) + +#endif /* GL_ARB_texture_mirrored_repeat */ + +/* ----------------------- GL_ARB_texture_multisample ---------------------- */ + +#ifndef GL_ARB_texture_multisample +#define GL_ARB_texture_multisample 1 + +#define GL_SAMPLE_POSITION 0x8E50 +#define GL_SAMPLE_MASK 0x8E51 +#define GL_SAMPLE_MASK_VALUE 0x8E52 +#define GL_MAX_SAMPLE_MASK_WORDS 0x8E59 +#define GL_TEXTURE_2D_MULTISAMPLE 0x9100 +#define GL_PROXY_TEXTURE_2D_MULTISAMPLE 0x9101 +#define GL_TEXTURE_2D_MULTISAMPLE_ARRAY 0x9102 +#define GL_PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY 0x9103 +#define GL_TEXTURE_BINDING_2D_MULTISAMPLE 0x9104 +#define GL_TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY 0x9105 +#define GL_TEXTURE_SAMPLES 0x9106 +#define GL_TEXTURE_FIXED_SAMPLE_LOCATIONS 0x9107 +#define GL_SAMPLER_2D_MULTISAMPLE 0x9108 +#define GL_INT_SAMPLER_2D_MULTISAMPLE 0x9109 +#define GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE 0x910A +#define GL_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910B +#define GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910C +#define GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910D +#define GL_MAX_COLOR_TEXTURE_SAMPLES 0x910E +#define GL_MAX_DEPTH_TEXTURE_SAMPLES 0x910F +#define GL_MAX_INTEGER_SAMPLES 0x9110 + +typedef void (GLAPIENTRY * PFNGLGETMULTISAMPLEFVPROC) (GLenum pname, GLuint index, GLfloat* val); +typedef void (GLAPIENTRY * PFNGLSAMPLEMASKIPROC) (GLuint index, GLbitfield mask); +typedef void (GLAPIENTRY * PFNGLTEXIMAGE2DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLint internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); +typedef void (GLAPIENTRY * PFNGLTEXIMAGE3DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); + +#define glGetMultisamplefv GLEW_GET_FUN(__glewGetMultisamplefv) +#define glSampleMaski GLEW_GET_FUN(__glewSampleMaski) +#define glTexImage2DMultisample GLEW_GET_FUN(__glewTexImage2DMultisample) +#define glTexImage3DMultisample GLEW_GET_FUN(__glewTexImage3DMultisample) + +#define GLEW_ARB_texture_multisample GLEW_GET_VAR(__GLEW_ARB_texture_multisample) + +#endif /* GL_ARB_texture_multisample */ + +/* -------------------- GL_ARB_texture_non_power_of_two -------------------- */ + +#ifndef GL_ARB_texture_non_power_of_two +#define GL_ARB_texture_non_power_of_two 1 + +#define GLEW_ARB_texture_non_power_of_two GLEW_GET_VAR(__GLEW_ARB_texture_non_power_of_two) + +#endif /* GL_ARB_texture_non_power_of_two */ + +/* ---------------------- GL_ARB_texture_query_levels ---------------------- */ + +#ifndef GL_ARB_texture_query_levels +#define GL_ARB_texture_query_levels 1 + +#define GLEW_ARB_texture_query_levels GLEW_GET_VAR(__GLEW_ARB_texture_query_levels) + +#endif /* GL_ARB_texture_query_levels */ + +/* ------------------------ GL_ARB_texture_query_lod ----------------------- */ + +#ifndef GL_ARB_texture_query_lod +#define GL_ARB_texture_query_lod 1 + +#define GLEW_ARB_texture_query_lod GLEW_GET_VAR(__GLEW_ARB_texture_query_lod) + +#endif /* GL_ARB_texture_query_lod */ + +/* ------------------------ GL_ARB_texture_rectangle ----------------------- */ + +#ifndef GL_ARB_texture_rectangle +#define GL_ARB_texture_rectangle 1 + +#define GL_TEXTURE_RECTANGLE_ARB 0x84F5 +#define GL_TEXTURE_BINDING_RECTANGLE_ARB 0x84F6 +#define GL_PROXY_TEXTURE_RECTANGLE_ARB 0x84F7 +#define GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB 0x84F8 +#define GL_SAMPLER_2D_RECT_ARB 0x8B63 +#define GL_SAMPLER_2D_RECT_SHADOW_ARB 0x8B64 + +#define GLEW_ARB_texture_rectangle GLEW_GET_VAR(__GLEW_ARB_texture_rectangle) + +#endif /* GL_ARB_texture_rectangle */ + +/* --------------------------- GL_ARB_texture_rg --------------------------- */ + +#ifndef GL_ARB_texture_rg +#define GL_ARB_texture_rg 1 + +#define GL_COMPRESSED_RED 0x8225 +#define GL_COMPRESSED_RG 0x8226 +#define GL_RG 0x8227 +#define GL_RG_INTEGER 0x8228 +#define GL_R8 0x8229 +#define GL_R16 0x822A +#define GL_RG8 0x822B +#define GL_RG16 0x822C +#define GL_R16F 0x822D +#define GL_R32F 0x822E +#define GL_RG16F 0x822F +#define GL_RG32F 0x8230 +#define GL_R8I 0x8231 +#define GL_R8UI 0x8232 +#define GL_R16I 0x8233 +#define GL_R16UI 0x8234 +#define GL_R32I 0x8235 +#define GL_R32UI 0x8236 +#define GL_RG8I 0x8237 +#define GL_RG8UI 0x8238 +#define GL_RG16I 0x8239 +#define GL_RG16UI 0x823A +#define GL_RG32I 0x823B +#define GL_RG32UI 0x823C + +#define GLEW_ARB_texture_rg GLEW_GET_VAR(__GLEW_ARB_texture_rg) + +#endif /* GL_ARB_texture_rg */ + +/* ----------------------- GL_ARB_texture_rgb10_a2ui ----------------------- */ + +#ifndef GL_ARB_texture_rgb10_a2ui +#define GL_ARB_texture_rgb10_a2ui 1 + +#define GL_RGB10_A2UI 0x906F + +#define GLEW_ARB_texture_rgb10_a2ui GLEW_GET_VAR(__GLEW_ARB_texture_rgb10_a2ui) + +#endif /* GL_ARB_texture_rgb10_a2ui */ + +/* ------------------------ GL_ARB_texture_stencil8 ------------------------ */ + +#ifndef GL_ARB_texture_stencil8 +#define GL_ARB_texture_stencil8 1 + +#define GL_STENCIL_INDEX 0x1901 +#define GL_STENCIL_INDEX8 0x8D48 + +#define GLEW_ARB_texture_stencil8 GLEW_GET_VAR(__GLEW_ARB_texture_stencil8) + +#endif /* GL_ARB_texture_stencil8 */ + +/* ------------------------- GL_ARB_texture_storage ------------------------ */ + +#ifndef GL_ARB_texture_storage +#define GL_ARB_texture_storage 1 + +#define GL_TEXTURE_IMMUTABLE_FORMAT 0x912F + +typedef void (GLAPIENTRY * PFNGLTEXSTORAGE1DPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width); +typedef void (GLAPIENTRY * PFNGLTEXSTORAGE2DPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLTEXSTORAGE3DPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); +typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGE1DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width); +typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGE2DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGE3DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); + +#define glTexStorage1D GLEW_GET_FUN(__glewTexStorage1D) +#define glTexStorage2D GLEW_GET_FUN(__glewTexStorage2D) +#define glTexStorage3D GLEW_GET_FUN(__glewTexStorage3D) +#define glTextureStorage1DEXT GLEW_GET_FUN(__glewTextureStorage1DEXT) +#define glTextureStorage2DEXT GLEW_GET_FUN(__glewTextureStorage2DEXT) +#define glTextureStorage3DEXT GLEW_GET_FUN(__glewTextureStorage3DEXT) + +#define GLEW_ARB_texture_storage GLEW_GET_VAR(__GLEW_ARB_texture_storage) + +#endif /* GL_ARB_texture_storage */ + +/* ------------------- GL_ARB_texture_storage_multisample ------------------ */ + +#ifndef GL_ARB_texture_storage_multisample +#define GL_ARB_texture_storage_multisample 1 + +typedef void (GLAPIENTRY * PFNGLTEXSTORAGE2DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); +typedef void (GLAPIENTRY * PFNGLTEXSTORAGE3DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); +typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGE2DMULTISAMPLEEXTPROC) (GLuint texture, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); +typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGE3DMULTISAMPLEEXTPROC) (GLuint texture, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); + +#define glTexStorage2DMultisample GLEW_GET_FUN(__glewTexStorage2DMultisample) +#define glTexStorage3DMultisample GLEW_GET_FUN(__glewTexStorage3DMultisample) +#define glTextureStorage2DMultisampleEXT GLEW_GET_FUN(__glewTextureStorage2DMultisampleEXT) +#define glTextureStorage3DMultisampleEXT GLEW_GET_FUN(__glewTextureStorage3DMultisampleEXT) + +#define GLEW_ARB_texture_storage_multisample GLEW_GET_VAR(__GLEW_ARB_texture_storage_multisample) + +#endif /* GL_ARB_texture_storage_multisample */ + +/* ------------------------- GL_ARB_texture_swizzle ------------------------ */ + +#ifndef GL_ARB_texture_swizzle +#define GL_ARB_texture_swizzle 1 + +#define GL_TEXTURE_SWIZZLE_R 0x8E42 +#define GL_TEXTURE_SWIZZLE_G 0x8E43 +#define GL_TEXTURE_SWIZZLE_B 0x8E44 +#define GL_TEXTURE_SWIZZLE_A 0x8E45 +#define GL_TEXTURE_SWIZZLE_RGBA 0x8E46 + +#define GLEW_ARB_texture_swizzle GLEW_GET_VAR(__GLEW_ARB_texture_swizzle) + +#endif /* GL_ARB_texture_swizzle */ + +/* -------------------------- GL_ARB_texture_view -------------------------- */ + +#ifndef GL_ARB_texture_view +#define GL_ARB_texture_view 1 + +#define GL_TEXTURE_VIEW_MIN_LEVEL 0x82DB +#define GL_TEXTURE_VIEW_NUM_LEVELS 0x82DC +#define GL_TEXTURE_VIEW_MIN_LAYER 0x82DD +#define GL_TEXTURE_VIEW_NUM_LAYERS 0x82DE +#define GL_TEXTURE_IMMUTABLE_LEVELS 0x82DF + +typedef void (GLAPIENTRY * PFNGLTEXTUREVIEWPROC) (GLuint texture, GLenum target, GLuint origtexture, GLenum internalformat, GLuint minlevel, GLuint numlevels, GLuint minlayer, GLuint numlayers); + +#define glTextureView GLEW_GET_FUN(__glewTextureView) + +#define GLEW_ARB_texture_view GLEW_GET_VAR(__GLEW_ARB_texture_view) + +#endif /* GL_ARB_texture_view */ + +/* --------------------------- GL_ARB_timer_query -------------------------- */ + +#ifndef GL_ARB_timer_query +#define GL_ARB_timer_query 1 + +#define GL_TIME_ELAPSED 0x88BF +#define GL_TIMESTAMP 0x8E28 + +typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTI64VPROC) (GLuint id, GLenum pname, GLint64* params); +typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTUI64VPROC) (GLuint id, GLenum pname, GLuint64* params); +typedef void (GLAPIENTRY * PFNGLQUERYCOUNTERPROC) (GLuint id, GLenum target); + +#define glGetQueryObjecti64v GLEW_GET_FUN(__glewGetQueryObjecti64v) +#define glGetQueryObjectui64v GLEW_GET_FUN(__glewGetQueryObjectui64v) +#define glQueryCounter GLEW_GET_FUN(__glewQueryCounter) + +#define GLEW_ARB_timer_query GLEW_GET_VAR(__GLEW_ARB_timer_query) + +#endif /* GL_ARB_timer_query */ + +/* ----------------------- GL_ARB_transform_feedback2 ---------------------- */ + +#ifndef GL_ARB_transform_feedback2 +#define GL_ARB_transform_feedback2 1 + +#define GL_TRANSFORM_FEEDBACK 0x8E22 +#define GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED 0x8E23 +#define GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE 0x8E24 +#define GL_TRANSFORM_FEEDBACK_BINDING 0x8E25 + +typedef void (GLAPIENTRY * PFNGLBINDTRANSFORMFEEDBACKPROC) (GLenum target, GLuint id); +typedef void (GLAPIENTRY * PFNGLDELETETRANSFORMFEEDBACKSPROC) (GLsizei n, const GLuint* ids); +typedef void (GLAPIENTRY * PFNGLDRAWTRANSFORMFEEDBACKPROC) (GLenum mode, GLuint id); +typedef void (GLAPIENTRY * PFNGLGENTRANSFORMFEEDBACKSPROC) (GLsizei n, GLuint* ids); +typedef GLboolean (GLAPIENTRY * PFNGLISTRANSFORMFEEDBACKPROC) (GLuint id); +typedef void (GLAPIENTRY * PFNGLPAUSETRANSFORMFEEDBACKPROC) (void); +typedef void (GLAPIENTRY * PFNGLRESUMETRANSFORMFEEDBACKPROC) (void); + +#define glBindTransformFeedback GLEW_GET_FUN(__glewBindTransformFeedback) +#define glDeleteTransformFeedbacks GLEW_GET_FUN(__glewDeleteTransformFeedbacks) +#define glDrawTransformFeedback GLEW_GET_FUN(__glewDrawTransformFeedback) +#define glGenTransformFeedbacks GLEW_GET_FUN(__glewGenTransformFeedbacks) +#define glIsTransformFeedback GLEW_GET_FUN(__glewIsTransformFeedback) +#define glPauseTransformFeedback GLEW_GET_FUN(__glewPauseTransformFeedback) +#define glResumeTransformFeedback GLEW_GET_FUN(__glewResumeTransformFeedback) + +#define GLEW_ARB_transform_feedback2 GLEW_GET_VAR(__GLEW_ARB_transform_feedback2) + +#endif /* GL_ARB_transform_feedback2 */ + +/* ----------------------- GL_ARB_transform_feedback3 ---------------------- */ + +#ifndef GL_ARB_transform_feedback3 +#define GL_ARB_transform_feedback3 1 + +#define GL_MAX_TRANSFORM_FEEDBACK_BUFFERS 0x8E70 +#define GL_MAX_VERTEX_STREAMS 0x8E71 + +typedef void (GLAPIENTRY * PFNGLBEGINQUERYINDEXEDPROC) (GLenum target, GLuint index, GLuint id); +typedef void (GLAPIENTRY * PFNGLDRAWTRANSFORMFEEDBACKSTREAMPROC) (GLenum mode, GLuint id, GLuint stream); +typedef void (GLAPIENTRY * PFNGLENDQUERYINDEXEDPROC) (GLenum target, GLuint index); +typedef void (GLAPIENTRY * PFNGLGETQUERYINDEXEDIVPROC) (GLenum target, GLuint index, GLenum pname, GLint* params); + +#define glBeginQueryIndexed GLEW_GET_FUN(__glewBeginQueryIndexed) +#define glDrawTransformFeedbackStream GLEW_GET_FUN(__glewDrawTransformFeedbackStream) +#define glEndQueryIndexed GLEW_GET_FUN(__glewEndQueryIndexed) +#define glGetQueryIndexediv GLEW_GET_FUN(__glewGetQueryIndexediv) + +#define GLEW_ARB_transform_feedback3 GLEW_GET_VAR(__GLEW_ARB_transform_feedback3) + +#endif /* GL_ARB_transform_feedback3 */ + +/* ------------------ GL_ARB_transform_feedback_instanced ------------------ */ + +#ifndef GL_ARB_transform_feedback_instanced +#define GL_ARB_transform_feedback_instanced 1 + +typedef void (GLAPIENTRY * PFNGLDRAWTRANSFORMFEEDBACKINSTANCEDPROC) (GLenum mode, GLuint id, GLsizei primcount); +typedef void (GLAPIENTRY * PFNGLDRAWTRANSFORMFEEDBACKSTREAMINSTANCEDPROC) (GLenum mode, GLuint id, GLuint stream, GLsizei primcount); + +#define glDrawTransformFeedbackInstanced GLEW_GET_FUN(__glewDrawTransformFeedbackInstanced) +#define glDrawTransformFeedbackStreamInstanced GLEW_GET_FUN(__glewDrawTransformFeedbackStreamInstanced) + +#define GLEW_ARB_transform_feedback_instanced GLEW_GET_VAR(__GLEW_ARB_transform_feedback_instanced) + +#endif /* GL_ARB_transform_feedback_instanced */ + +/* ------------------------ GL_ARB_transpose_matrix ------------------------ */ + +#ifndef GL_ARB_transpose_matrix +#define GL_ARB_transpose_matrix 1 + +#define GL_TRANSPOSE_MODELVIEW_MATRIX_ARB 0x84E3 +#define GL_TRANSPOSE_PROJECTION_MATRIX_ARB 0x84E4 +#define GL_TRANSPOSE_TEXTURE_MATRIX_ARB 0x84E5 +#define GL_TRANSPOSE_COLOR_MATRIX_ARB 0x84E6 + +typedef void (GLAPIENTRY * PFNGLLOADTRANSPOSEMATRIXDARBPROC) (GLdouble m[16]); +typedef void (GLAPIENTRY * PFNGLLOADTRANSPOSEMATRIXFARBPROC) (GLfloat m[16]); +typedef void (GLAPIENTRY * PFNGLMULTTRANSPOSEMATRIXDARBPROC) (GLdouble m[16]); +typedef void (GLAPIENTRY * PFNGLMULTTRANSPOSEMATRIXFARBPROC) (GLfloat m[16]); + +#define glLoadTransposeMatrixdARB GLEW_GET_FUN(__glewLoadTransposeMatrixdARB) +#define glLoadTransposeMatrixfARB GLEW_GET_FUN(__glewLoadTransposeMatrixfARB) +#define glMultTransposeMatrixdARB GLEW_GET_FUN(__glewMultTransposeMatrixdARB) +#define glMultTransposeMatrixfARB GLEW_GET_FUN(__glewMultTransposeMatrixfARB) + +#define GLEW_ARB_transpose_matrix GLEW_GET_VAR(__GLEW_ARB_transpose_matrix) + +#endif /* GL_ARB_transpose_matrix */ + +/* ---------------------- GL_ARB_uniform_buffer_object --------------------- */ + +#ifndef GL_ARB_uniform_buffer_object +#define GL_ARB_uniform_buffer_object 1 + +#define GL_UNIFORM_BUFFER 0x8A11 +#define GL_UNIFORM_BUFFER_BINDING 0x8A28 +#define GL_UNIFORM_BUFFER_START 0x8A29 +#define GL_UNIFORM_BUFFER_SIZE 0x8A2A +#define GL_MAX_VERTEX_UNIFORM_BLOCKS 0x8A2B +#define GL_MAX_GEOMETRY_UNIFORM_BLOCKS 0x8A2C +#define GL_MAX_FRAGMENT_UNIFORM_BLOCKS 0x8A2D +#define GL_MAX_COMBINED_UNIFORM_BLOCKS 0x8A2E +#define GL_MAX_UNIFORM_BUFFER_BINDINGS 0x8A2F +#define GL_MAX_UNIFORM_BLOCK_SIZE 0x8A30 +#define GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS 0x8A31 +#define GL_MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS 0x8A32 +#define GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS 0x8A33 +#define GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT 0x8A34 +#define GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH 0x8A35 +#define GL_ACTIVE_UNIFORM_BLOCKS 0x8A36 +#define GL_UNIFORM_TYPE 0x8A37 +#define GL_UNIFORM_SIZE 0x8A38 +#define GL_UNIFORM_NAME_LENGTH 0x8A39 +#define GL_UNIFORM_BLOCK_INDEX 0x8A3A +#define GL_UNIFORM_OFFSET 0x8A3B +#define GL_UNIFORM_ARRAY_STRIDE 0x8A3C +#define GL_UNIFORM_MATRIX_STRIDE 0x8A3D +#define GL_UNIFORM_IS_ROW_MAJOR 0x8A3E +#define GL_UNIFORM_BLOCK_BINDING 0x8A3F +#define GL_UNIFORM_BLOCK_DATA_SIZE 0x8A40 +#define GL_UNIFORM_BLOCK_NAME_LENGTH 0x8A41 +#define GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS 0x8A42 +#define GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES 0x8A43 +#define GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER 0x8A44 +#define GL_UNIFORM_BLOCK_REFERENCED_BY_GEOMETRY_SHADER 0x8A45 +#define GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER 0x8A46 +#define GL_INVALID_INDEX 0xFFFFFFFF + +typedef void (GLAPIENTRY * PFNGLBINDBUFFERBASEPROC) (GLenum target, GLuint index, GLuint buffer); +typedef void (GLAPIENTRY * PFNGLBINDBUFFERRANGEPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); +typedef void (GLAPIENTRY * PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC) (GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei* length, GLchar* uniformBlockName); +typedef void (GLAPIENTRY * PFNGLGETACTIVEUNIFORMBLOCKIVPROC) (GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETACTIVEUNIFORMNAMEPROC) (GLuint program, GLuint uniformIndex, GLsizei bufSize, GLsizei* length, GLchar* uniformName); +typedef void (GLAPIENTRY * PFNGLGETACTIVEUNIFORMSIVPROC) (GLuint program, GLsizei uniformCount, const GLuint* uniformIndices, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETINTEGERI_VPROC) (GLenum target, GLuint index, GLint* data); +typedef GLuint (GLAPIENTRY * PFNGLGETUNIFORMBLOCKINDEXPROC) (GLuint program, const GLchar* uniformBlockName); +typedef void (GLAPIENTRY * PFNGLGETUNIFORMINDICESPROC) (GLuint program, GLsizei uniformCount, const GLchar** uniformNames, GLuint* uniformIndices); +typedef void (GLAPIENTRY * PFNGLUNIFORMBLOCKBINDINGPROC) (GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding); + +#define glBindBufferBase GLEW_GET_FUN(__glewBindBufferBase) +#define glBindBufferRange GLEW_GET_FUN(__glewBindBufferRange) +#define glGetActiveUniformBlockName GLEW_GET_FUN(__glewGetActiveUniformBlockName) +#define glGetActiveUniformBlockiv GLEW_GET_FUN(__glewGetActiveUniformBlockiv) +#define glGetActiveUniformName GLEW_GET_FUN(__glewGetActiveUniformName) +#define glGetActiveUniformsiv GLEW_GET_FUN(__glewGetActiveUniformsiv) +#define glGetIntegeri_v GLEW_GET_FUN(__glewGetIntegeri_v) +#define glGetUniformBlockIndex GLEW_GET_FUN(__glewGetUniformBlockIndex) +#define glGetUniformIndices GLEW_GET_FUN(__glewGetUniformIndices) +#define glUniformBlockBinding GLEW_GET_FUN(__glewUniformBlockBinding) + +#define GLEW_ARB_uniform_buffer_object GLEW_GET_VAR(__GLEW_ARB_uniform_buffer_object) + +#endif /* GL_ARB_uniform_buffer_object */ + +/* ------------------------ GL_ARB_vertex_array_bgra ----------------------- */ + +#ifndef GL_ARB_vertex_array_bgra +#define GL_ARB_vertex_array_bgra 1 + +#define GL_BGRA 0x80E1 + +#define GLEW_ARB_vertex_array_bgra GLEW_GET_VAR(__GLEW_ARB_vertex_array_bgra) + +#endif /* GL_ARB_vertex_array_bgra */ + +/* ----------------------- GL_ARB_vertex_array_object ---------------------- */ + +#ifndef GL_ARB_vertex_array_object +#define GL_ARB_vertex_array_object 1 + +#define GL_VERTEX_ARRAY_BINDING 0x85B5 + +typedef void (GLAPIENTRY * PFNGLBINDVERTEXARRAYPROC) (GLuint array); +typedef void (GLAPIENTRY * PFNGLDELETEVERTEXARRAYSPROC) (GLsizei n, const GLuint* arrays); +typedef void (GLAPIENTRY * PFNGLGENVERTEXARRAYSPROC) (GLsizei n, GLuint* arrays); +typedef GLboolean (GLAPIENTRY * PFNGLISVERTEXARRAYPROC) (GLuint array); + +#define glBindVertexArray GLEW_GET_FUN(__glewBindVertexArray) +#define glDeleteVertexArrays GLEW_GET_FUN(__glewDeleteVertexArrays) +#define glGenVertexArrays GLEW_GET_FUN(__glewGenVertexArrays) +#define glIsVertexArray GLEW_GET_FUN(__glewIsVertexArray) + +#define GLEW_ARB_vertex_array_object GLEW_GET_VAR(__GLEW_ARB_vertex_array_object) + +#endif /* GL_ARB_vertex_array_object */ + +/* ----------------------- GL_ARB_vertex_attrib_64bit ---------------------- */ + +#ifndef GL_ARB_vertex_attrib_64bit +#define GL_ARB_vertex_attrib_64bit 1 + +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBLDVPROC) (GLuint index, GLenum pname, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1DPROC) (GLuint index, GLdouble x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1DVPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL2DPROC) (GLuint index, GLdouble x, GLdouble y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL2DVPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL3DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL3DVPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL4DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL4DVPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBLPOINTERPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const void* pointer); + +#define glGetVertexAttribLdv GLEW_GET_FUN(__glewGetVertexAttribLdv) +#define glVertexAttribL1d GLEW_GET_FUN(__glewVertexAttribL1d) +#define glVertexAttribL1dv GLEW_GET_FUN(__glewVertexAttribL1dv) +#define glVertexAttribL2d GLEW_GET_FUN(__glewVertexAttribL2d) +#define glVertexAttribL2dv GLEW_GET_FUN(__glewVertexAttribL2dv) +#define glVertexAttribL3d GLEW_GET_FUN(__glewVertexAttribL3d) +#define glVertexAttribL3dv GLEW_GET_FUN(__glewVertexAttribL3dv) +#define glVertexAttribL4d GLEW_GET_FUN(__glewVertexAttribL4d) +#define glVertexAttribL4dv GLEW_GET_FUN(__glewVertexAttribL4dv) +#define glVertexAttribLPointer GLEW_GET_FUN(__glewVertexAttribLPointer) + +#define GLEW_ARB_vertex_attrib_64bit GLEW_GET_VAR(__GLEW_ARB_vertex_attrib_64bit) + +#endif /* GL_ARB_vertex_attrib_64bit */ + +/* ---------------------- GL_ARB_vertex_attrib_binding --------------------- */ + +#ifndef GL_ARB_vertex_attrib_binding +#define GL_ARB_vertex_attrib_binding 1 + +#define GL_VERTEX_ATTRIB_BINDING 0x82D4 +#define GL_VERTEX_ATTRIB_RELATIVE_OFFSET 0x82D5 +#define GL_VERTEX_BINDING_DIVISOR 0x82D6 +#define GL_VERTEX_BINDING_OFFSET 0x82D7 +#define GL_VERTEX_BINDING_STRIDE 0x82D8 +#define GL_MAX_VERTEX_ATTRIB_RELATIVE_OFFSET 0x82D9 +#define GL_MAX_VERTEX_ATTRIB_BINDINGS 0x82DA + +typedef void (GLAPIENTRY * PFNGLBINDVERTEXBUFFERPROC) (GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBBINDINGPROC) (GLuint attribindex, GLuint bindingindex); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBFORMATPROC) (GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBIFORMATPROC) (GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBLFORMATPROC) (GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); +typedef void (GLAPIENTRY * PFNGLVERTEXBINDINGDIVISORPROC) (GLuint bindingindex, GLuint divisor); + +#define glBindVertexBuffer GLEW_GET_FUN(__glewBindVertexBuffer) +#define glVertexAttribBinding GLEW_GET_FUN(__glewVertexAttribBinding) +#define glVertexAttribFormat GLEW_GET_FUN(__glewVertexAttribFormat) +#define glVertexAttribIFormat GLEW_GET_FUN(__glewVertexAttribIFormat) +#define glVertexAttribLFormat GLEW_GET_FUN(__glewVertexAttribLFormat) +#define glVertexBindingDivisor GLEW_GET_FUN(__glewVertexBindingDivisor) + +#define GLEW_ARB_vertex_attrib_binding GLEW_GET_VAR(__GLEW_ARB_vertex_attrib_binding) + +#endif /* GL_ARB_vertex_attrib_binding */ + +/* -------------------------- GL_ARB_vertex_blend -------------------------- */ + +#ifndef GL_ARB_vertex_blend +#define GL_ARB_vertex_blend 1 + +#define GL_MODELVIEW0_ARB 0x1700 +#define GL_MODELVIEW1_ARB 0x850A +#define GL_MAX_VERTEX_UNITS_ARB 0x86A4 +#define GL_ACTIVE_VERTEX_UNITS_ARB 0x86A5 +#define GL_WEIGHT_SUM_UNITY_ARB 0x86A6 +#define GL_VERTEX_BLEND_ARB 0x86A7 +#define GL_CURRENT_WEIGHT_ARB 0x86A8 +#define GL_WEIGHT_ARRAY_TYPE_ARB 0x86A9 +#define GL_WEIGHT_ARRAY_STRIDE_ARB 0x86AA +#define GL_WEIGHT_ARRAY_SIZE_ARB 0x86AB +#define GL_WEIGHT_ARRAY_POINTER_ARB 0x86AC +#define GL_WEIGHT_ARRAY_ARB 0x86AD +#define GL_MODELVIEW2_ARB 0x8722 +#define GL_MODELVIEW3_ARB 0x8723 +#define GL_MODELVIEW4_ARB 0x8724 +#define GL_MODELVIEW5_ARB 0x8725 +#define GL_MODELVIEW6_ARB 0x8726 +#define GL_MODELVIEW7_ARB 0x8727 +#define GL_MODELVIEW8_ARB 0x8728 +#define GL_MODELVIEW9_ARB 0x8729 +#define GL_MODELVIEW10_ARB 0x872A +#define GL_MODELVIEW11_ARB 0x872B +#define GL_MODELVIEW12_ARB 0x872C +#define GL_MODELVIEW13_ARB 0x872D +#define GL_MODELVIEW14_ARB 0x872E +#define GL_MODELVIEW15_ARB 0x872F +#define GL_MODELVIEW16_ARB 0x8730 +#define GL_MODELVIEW17_ARB 0x8731 +#define GL_MODELVIEW18_ARB 0x8732 +#define GL_MODELVIEW19_ARB 0x8733 +#define GL_MODELVIEW20_ARB 0x8734 +#define GL_MODELVIEW21_ARB 0x8735 +#define GL_MODELVIEW22_ARB 0x8736 +#define GL_MODELVIEW23_ARB 0x8737 +#define GL_MODELVIEW24_ARB 0x8738 +#define GL_MODELVIEW25_ARB 0x8739 +#define GL_MODELVIEW26_ARB 0x873A +#define GL_MODELVIEW27_ARB 0x873B +#define GL_MODELVIEW28_ARB 0x873C +#define GL_MODELVIEW29_ARB 0x873D +#define GL_MODELVIEW30_ARB 0x873E +#define GL_MODELVIEW31_ARB 0x873F + +typedef void (GLAPIENTRY * PFNGLVERTEXBLENDARBPROC) (GLint count); +typedef void (GLAPIENTRY * PFNGLWEIGHTPOINTERARBPROC) (GLint size, GLenum type, GLsizei stride, GLvoid *pointer); +typedef void (GLAPIENTRY * PFNGLWEIGHTBVARBPROC) (GLint size, GLbyte *weights); +typedef void (GLAPIENTRY * PFNGLWEIGHTDVARBPROC) (GLint size, GLdouble *weights); +typedef void (GLAPIENTRY * PFNGLWEIGHTFVARBPROC) (GLint size, GLfloat *weights); +typedef void (GLAPIENTRY * PFNGLWEIGHTIVARBPROC) (GLint size, GLint *weights); +typedef void (GLAPIENTRY * PFNGLWEIGHTSVARBPROC) (GLint size, GLshort *weights); +typedef void (GLAPIENTRY * PFNGLWEIGHTUBVARBPROC) (GLint size, GLubyte *weights); +typedef void (GLAPIENTRY * PFNGLWEIGHTUIVARBPROC) (GLint size, GLuint *weights); +typedef void (GLAPIENTRY * PFNGLWEIGHTUSVARBPROC) (GLint size, GLushort *weights); + +#define glVertexBlendARB GLEW_GET_FUN(__glewVertexBlendARB) +#define glWeightPointerARB GLEW_GET_FUN(__glewWeightPointerARB) +#define glWeightbvARB GLEW_GET_FUN(__glewWeightbvARB) +#define glWeightdvARB GLEW_GET_FUN(__glewWeightdvARB) +#define glWeightfvARB GLEW_GET_FUN(__glewWeightfvARB) +#define glWeightivARB GLEW_GET_FUN(__glewWeightivARB) +#define glWeightsvARB GLEW_GET_FUN(__glewWeightsvARB) +#define glWeightubvARB GLEW_GET_FUN(__glewWeightubvARB) +#define glWeightuivARB GLEW_GET_FUN(__glewWeightuivARB) +#define glWeightusvARB GLEW_GET_FUN(__glewWeightusvARB) + +#define GLEW_ARB_vertex_blend GLEW_GET_VAR(__GLEW_ARB_vertex_blend) + +#endif /* GL_ARB_vertex_blend */ + +/* ---------------------- GL_ARB_vertex_buffer_object ---------------------- */ + +#ifndef GL_ARB_vertex_buffer_object +#define GL_ARB_vertex_buffer_object 1 + +#define GL_BUFFER_SIZE_ARB 0x8764 +#define GL_BUFFER_USAGE_ARB 0x8765 +#define GL_ARRAY_BUFFER_ARB 0x8892 +#define GL_ELEMENT_ARRAY_BUFFER_ARB 0x8893 +#define GL_ARRAY_BUFFER_BINDING_ARB 0x8894 +#define GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB 0x8895 +#define GL_VERTEX_ARRAY_BUFFER_BINDING_ARB 0x8896 +#define GL_NORMAL_ARRAY_BUFFER_BINDING_ARB 0x8897 +#define GL_COLOR_ARRAY_BUFFER_BINDING_ARB 0x8898 +#define GL_INDEX_ARRAY_BUFFER_BINDING_ARB 0x8899 +#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB 0x889A +#define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB 0x889B +#define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB 0x889C +#define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB 0x889D +#define GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB 0x889E +#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB 0x889F +#define GL_READ_ONLY_ARB 0x88B8 +#define GL_WRITE_ONLY_ARB 0x88B9 +#define GL_READ_WRITE_ARB 0x88BA +#define GL_BUFFER_ACCESS_ARB 0x88BB +#define GL_BUFFER_MAPPED_ARB 0x88BC +#define GL_BUFFER_MAP_POINTER_ARB 0x88BD +#define GL_STREAM_DRAW_ARB 0x88E0 +#define GL_STREAM_READ_ARB 0x88E1 +#define GL_STREAM_COPY_ARB 0x88E2 +#define GL_STATIC_DRAW_ARB 0x88E4 +#define GL_STATIC_READ_ARB 0x88E5 +#define GL_STATIC_COPY_ARB 0x88E6 +#define GL_DYNAMIC_DRAW_ARB 0x88E8 +#define GL_DYNAMIC_READ_ARB 0x88E9 +#define GL_DYNAMIC_COPY_ARB 0x88EA + +typedef ptrdiff_t GLintptrARB; +typedef ptrdiff_t GLsizeiptrARB; + +typedef void (GLAPIENTRY * PFNGLBINDBUFFERARBPROC) (GLenum target, GLuint buffer); +typedef void (GLAPIENTRY * PFNGLBUFFERDATAARBPROC) (GLenum target, GLsizeiptrARB size, const GLvoid *data, GLenum usage); +typedef void (GLAPIENTRY * PFNGLBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLDELETEBUFFERSARBPROC) (GLsizei n, const GLuint* buffers); +typedef void (GLAPIENTRY * PFNGLGENBUFFERSARBPROC) (GLsizei n, GLuint* buffers); +typedef void (GLAPIENTRY * PFNGLGETBUFFERPARAMETERIVARBPROC) (GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETBUFFERPOINTERVARBPROC) (GLenum target, GLenum pname, GLvoid** params); +typedef void (GLAPIENTRY * PFNGLGETBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, GLvoid *data); +typedef GLboolean (GLAPIENTRY * PFNGLISBUFFERARBPROC) (GLuint buffer); +typedef GLvoid * (GLAPIENTRY * PFNGLMAPBUFFERARBPROC) (GLenum target, GLenum access); +typedef GLboolean (GLAPIENTRY * PFNGLUNMAPBUFFERARBPROC) (GLenum target); + +#define glBindBufferARB GLEW_GET_FUN(__glewBindBufferARB) +#define glBufferDataARB GLEW_GET_FUN(__glewBufferDataARB) +#define glBufferSubDataARB GLEW_GET_FUN(__glewBufferSubDataARB) +#define glDeleteBuffersARB GLEW_GET_FUN(__glewDeleteBuffersARB) +#define glGenBuffersARB GLEW_GET_FUN(__glewGenBuffersARB) +#define glGetBufferParameterivARB GLEW_GET_FUN(__glewGetBufferParameterivARB) +#define glGetBufferPointervARB GLEW_GET_FUN(__glewGetBufferPointervARB) +#define glGetBufferSubDataARB GLEW_GET_FUN(__glewGetBufferSubDataARB) +#define glIsBufferARB GLEW_GET_FUN(__glewIsBufferARB) +#define glMapBufferARB GLEW_GET_FUN(__glewMapBufferARB) +#define glUnmapBufferARB GLEW_GET_FUN(__glewUnmapBufferARB) + +#define GLEW_ARB_vertex_buffer_object GLEW_GET_VAR(__GLEW_ARB_vertex_buffer_object) + +#endif /* GL_ARB_vertex_buffer_object */ + +/* ------------------------- GL_ARB_vertex_program ------------------------- */ + +#ifndef GL_ARB_vertex_program +#define GL_ARB_vertex_program 1 + +#define GL_COLOR_SUM_ARB 0x8458 +#define GL_VERTEX_PROGRAM_ARB 0x8620 +#define GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB 0x8622 +#define GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB 0x8623 +#define GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB 0x8624 +#define GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB 0x8625 +#define GL_CURRENT_VERTEX_ATTRIB_ARB 0x8626 +#define GL_PROGRAM_LENGTH_ARB 0x8627 +#define GL_PROGRAM_STRING_ARB 0x8628 +#define GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB 0x862E +#define GL_MAX_PROGRAM_MATRICES_ARB 0x862F +#define GL_CURRENT_MATRIX_STACK_DEPTH_ARB 0x8640 +#define GL_CURRENT_MATRIX_ARB 0x8641 +#define GL_VERTEX_PROGRAM_POINT_SIZE_ARB 0x8642 +#define GL_VERTEX_PROGRAM_TWO_SIDE_ARB 0x8643 +#define GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB 0x8645 +#define GL_PROGRAM_ERROR_POSITION_ARB 0x864B +#define GL_PROGRAM_BINDING_ARB 0x8677 +#define GL_MAX_VERTEX_ATTRIBS_ARB 0x8869 +#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB 0x886A +#define GL_PROGRAM_ERROR_STRING_ARB 0x8874 +#define GL_PROGRAM_FORMAT_ASCII_ARB 0x8875 +#define GL_PROGRAM_FORMAT_ARB 0x8876 +#define GL_PROGRAM_INSTRUCTIONS_ARB 0x88A0 +#define GL_MAX_PROGRAM_INSTRUCTIONS_ARB 0x88A1 +#define GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB 0x88A2 +#define GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB 0x88A3 +#define GL_PROGRAM_TEMPORARIES_ARB 0x88A4 +#define GL_MAX_PROGRAM_TEMPORARIES_ARB 0x88A5 +#define GL_PROGRAM_NATIVE_TEMPORARIES_ARB 0x88A6 +#define GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB 0x88A7 +#define GL_PROGRAM_PARAMETERS_ARB 0x88A8 +#define GL_MAX_PROGRAM_PARAMETERS_ARB 0x88A9 +#define GL_PROGRAM_NATIVE_PARAMETERS_ARB 0x88AA +#define GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB 0x88AB +#define GL_PROGRAM_ATTRIBS_ARB 0x88AC +#define GL_MAX_PROGRAM_ATTRIBS_ARB 0x88AD +#define GL_PROGRAM_NATIVE_ATTRIBS_ARB 0x88AE +#define GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB 0x88AF +#define GL_PROGRAM_ADDRESS_REGISTERS_ARB 0x88B0 +#define GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB 0x88B1 +#define GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB 0x88B2 +#define GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB 0x88B3 +#define GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB 0x88B4 +#define GL_MAX_PROGRAM_ENV_PARAMETERS_ARB 0x88B5 +#define GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB 0x88B6 +#define GL_TRANSPOSE_CURRENT_MATRIX_ARB 0x88B7 +#define GL_MATRIX0_ARB 0x88C0 +#define GL_MATRIX1_ARB 0x88C1 +#define GL_MATRIX2_ARB 0x88C2 +#define GL_MATRIX3_ARB 0x88C3 +#define GL_MATRIX4_ARB 0x88C4 +#define GL_MATRIX5_ARB 0x88C5 +#define GL_MATRIX6_ARB 0x88C6 +#define GL_MATRIX7_ARB 0x88C7 +#define GL_MATRIX8_ARB 0x88C8 +#define GL_MATRIX9_ARB 0x88C9 +#define GL_MATRIX10_ARB 0x88CA +#define GL_MATRIX11_ARB 0x88CB +#define GL_MATRIX12_ARB 0x88CC +#define GL_MATRIX13_ARB 0x88CD +#define GL_MATRIX14_ARB 0x88CE +#define GL_MATRIX15_ARB 0x88CF +#define GL_MATRIX16_ARB 0x88D0 +#define GL_MATRIX17_ARB 0x88D1 +#define GL_MATRIX18_ARB 0x88D2 +#define GL_MATRIX19_ARB 0x88D3 +#define GL_MATRIX20_ARB 0x88D4 +#define GL_MATRIX21_ARB 0x88D5 +#define GL_MATRIX22_ARB 0x88D6 +#define GL_MATRIX23_ARB 0x88D7 +#define GL_MATRIX24_ARB 0x88D8 +#define GL_MATRIX25_ARB 0x88D9 +#define GL_MATRIX26_ARB 0x88DA +#define GL_MATRIX27_ARB 0x88DB +#define GL_MATRIX28_ARB 0x88DC +#define GL_MATRIX29_ARB 0x88DD +#define GL_MATRIX30_ARB 0x88DE +#define GL_MATRIX31_ARB 0x88DF + +typedef void (GLAPIENTRY * PFNGLBINDPROGRAMARBPROC) (GLenum target, GLuint program); +typedef void (GLAPIENTRY * PFNGLDELETEPROGRAMSARBPROC) (GLsizei n, const GLuint* programs); +typedef void (GLAPIENTRY * PFNGLDISABLEVERTEXATTRIBARRAYARBPROC) (GLuint index); +typedef void (GLAPIENTRY * PFNGLENABLEVERTEXATTRIBARRAYARBPROC) (GLuint index); +typedef void (GLAPIENTRY * PFNGLGENPROGRAMSARBPROC) (GLsizei n, GLuint* programs); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMENVPARAMETERDVARBPROC) (GLenum target, GLuint index, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMENVPARAMETERFVARBPROC) (GLenum target, GLuint index, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC) (GLenum target, GLuint index, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC) (GLenum target, GLuint index, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMSTRINGARBPROC) (GLenum target, GLenum pname, GLvoid *string); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMIVARBPROC) (GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBPOINTERVARBPROC) (GLuint index, GLenum pname, GLvoid** pointer); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBDVARBPROC) (GLuint index, GLenum pname, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBFVARBPROC) (GLuint index, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBIVARBPROC) (GLuint index, GLenum pname, GLint* params); +typedef GLboolean (GLAPIENTRY * PFNGLISPROGRAMARBPROC) (GLuint program); +typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETER4DARBPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETER4DVARBPROC) (GLenum target, GLuint index, const GLdouble* params); +typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETER4FARBPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETER4FVARBPROC) (GLenum target, GLuint index, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETER4DARBPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETER4DVARBPROC) (GLenum target, GLuint index, const GLdouble* params); +typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETER4FARBPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETER4FVARBPROC) (GLenum target, GLuint index, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLPROGRAMSTRINGARBPROC) (GLenum target, GLenum format, GLsizei len, const GLvoid *string); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1DARBPROC) (GLuint index, GLdouble x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1DVARBPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1FARBPROC) (GLuint index, GLfloat x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1FVARBPROC) (GLuint index, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1SARBPROC) (GLuint index, GLshort x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1SVARBPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2DARBPROC) (GLuint index, GLdouble x, GLdouble y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2DVARBPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2FARBPROC) (GLuint index, GLfloat x, GLfloat y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2FVARBPROC) (GLuint index, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2SARBPROC) (GLuint index, GLshort x, GLshort y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2SVARBPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3DARBPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3DVARBPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3FARBPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3FVARBPROC) (GLuint index, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3SARBPROC) (GLuint index, GLshort x, GLshort y, GLshort z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3SVARBPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NBVARBPROC) (GLuint index, const GLbyte* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NIVARBPROC) (GLuint index, const GLint* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NSVARBPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUBARBPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUBVARBPROC) (GLuint index, const GLubyte* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUIVARBPROC) (GLuint index, const GLuint* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUSVARBPROC) (GLuint index, const GLushort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4BVARBPROC) (GLuint index, const GLbyte* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4DARBPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4DVARBPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4FARBPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4FVARBPROC) (GLuint index, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4IVARBPROC) (GLuint index, const GLint* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4SARBPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4SVARBPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4UBVARBPROC) (GLuint index, const GLubyte* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4UIVARBPROC) (GLuint index, const GLuint* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4USVARBPROC) (GLuint index, const GLushort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBPOINTERARBPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer); + +#define glBindProgramARB GLEW_GET_FUN(__glewBindProgramARB) +#define glDeleteProgramsARB GLEW_GET_FUN(__glewDeleteProgramsARB) +#define glDisableVertexAttribArrayARB GLEW_GET_FUN(__glewDisableVertexAttribArrayARB) +#define glEnableVertexAttribArrayARB GLEW_GET_FUN(__glewEnableVertexAttribArrayARB) +#define glGenProgramsARB GLEW_GET_FUN(__glewGenProgramsARB) +#define glGetProgramEnvParameterdvARB GLEW_GET_FUN(__glewGetProgramEnvParameterdvARB) +#define glGetProgramEnvParameterfvARB GLEW_GET_FUN(__glewGetProgramEnvParameterfvARB) +#define glGetProgramLocalParameterdvARB GLEW_GET_FUN(__glewGetProgramLocalParameterdvARB) +#define glGetProgramLocalParameterfvARB GLEW_GET_FUN(__glewGetProgramLocalParameterfvARB) +#define glGetProgramStringARB GLEW_GET_FUN(__glewGetProgramStringARB) +#define glGetProgramivARB GLEW_GET_FUN(__glewGetProgramivARB) +#define glGetVertexAttribPointervARB GLEW_GET_FUN(__glewGetVertexAttribPointervARB) +#define glGetVertexAttribdvARB GLEW_GET_FUN(__glewGetVertexAttribdvARB) +#define glGetVertexAttribfvARB GLEW_GET_FUN(__glewGetVertexAttribfvARB) +#define glGetVertexAttribivARB GLEW_GET_FUN(__glewGetVertexAttribivARB) +#define glIsProgramARB GLEW_GET_FUN(__glewIsProgramARB) +#define glProgramEnvParameter4dARB GLEW_GET_FUN(__glewProgramEnvParameter4dARB) +#define glProgramEnvParameter4dvARB GLEW_GET_FUN(__glewProgramEnvParameter4dvARB) +#define glProgramEnvParameter4fARB GLEW_GET_FUN(__glewProgramEnvParameter4fARB) +#define glProgramEnvParameter4fvARB GLEW_GET_FUN(__glewProgramEnvParameter4fvARB) +#define glProgramLocalParameter4dARB GLEW_GET_FUN(__glewProgramLocalParameter4dARB) +#define glProgramLocalParameter4dvARB GLEW_GET_FUN(__glewProgramLocalParameter4dvARB) +#define glProgramLocalParameter4fARB GLEW_GET_FUN(__glewProgramLocalParameter4fARB) +#define glProgramLocalParameter4fvARB GLEW_GET_FUN(__glewProgramLocalParameter4fvARB) +#define glProgramStringARB GLEW_GET_FUN(__glewProgramStringARB) +#define glVertexAttrib1dARB GLEW_GET_FUN(__glewVertexAttrib1dARB) +#define glVertexAttrib1dvARB GLEW_GET_FUN(__glewVertexAttrib1dvARB) +#define glVertexAttrib1fARB GLEW_GET_FUN(__glewVertexAttrib1fARB) +#define glVertexAttrib1fvARB GLEW_GET_FUN(__glewVertexAttrib1fvARB) +#define glVertexAttrib1sARB GLEW_GET_FUN(__glewVertexAttrib1sARB) +#define glVertexAttrib1svARB GLEW_GET_FUN(__glewVertexAttrib1svARB) +#define glVertexAttrib2dARB GLEW_GET_FUN(__glewVertexAttrib2dARB) +#define glVertexAttrib2dvARB GLEW_GET_FUN(__glewVertexAttrib2dvARB) +#define glVertexAttrib2fARB GLEW_GET_FUN(__glewVertexAttrib2fARB) +#define glVertexAttrib2fvARB GLEW_GET_FUN(__glewVertexAttrib2fvARB) +#define glVertexAttrib2sARB GLEW_GET_FUN(__glewVertexAttrib2sARB) +#define glVertexAttrib2svARB GLEW_GET_FUN(__glewVertexAttrib2svARB) +#define glVertexAttrib3dARB GLEW_GET_FUN(__glewVertexAttrib3dARB) +#define glVertexAttrib3dvARB GLEW_GET_FUN(__glewVertexAttrib3dvARB) +#define glVertexAttrib3fARB GLEW_GET_FUN(__glewVertexAttrib3fARB) +#define glVertexAttrib3fvARB GLEW_GET_FUN(__glewVertexAttrib3fvARB) +#define glVertexAttrib3sARB GLEW_GET_FUN(__glewVertexAttrib3sARB) +#define glVertexAttrib3svARB GLEW_GET_FUN(__glewVertexAttrib3svARB) +#define glVertexAttrib4NbvARB GLEW_GET_FUN(__glewVertexAttrib4NbvARB) +#define glVertexAttrib4NivARB GLEW_GET_FUN(__glewVertexAttrib4NivARB) +#define glVertexAttrib4NsvARB GLEW_GET_FUN(__glewVertexAttrib4NsvARB) +#define glVertexAttrib4NubARB GLEW_GET_FUN(__glewVertexAttrib4NubARB) +#define glVertexAttrib4NubvARB GLEW_GET_FUN(__glewVertexAttrib4NubvARB) +#define glVertexAttrib4NuivARB GLEW_GET_FUN(__glewVertexAttrib4NuivARB) +#define glVertexAttrib4NusvARB GLEW_GET_FUN(__glewVertexAttrib4NusvARB) +#define glVertexAttrib4bvARB GLEW_GET_FUN(__glewVertexAttrib4bvARB) +#define glVertexAttrib4dARB GLEW_GET_FUN(__glewVertexAttrib4dARB) +#define glVertexAttrib4dvARB GLEW_GET_FUN(__glewVertexAttrib4dvARB) +#define glVertexAttrib4fARB GLEW_GET_FUN(__glewVertexAttrib4fARB) +#define glVertexAttrib4fvARB GLEW_GET_FUN(__glewVertexAttrib4fvARB) +#define glVertexAttrib4ivARB GLEW_GET_FUN(__glewVertexAttrib4ivARB) +#define glVertexAttrib4sARB GLEW_GET_FUN(__glewVertexAttrib4sARB) +#define glVertexAttrib4svARB GLEW_GET_FUN(__glewVertexAttrib4svARB) +#define glVertexAttrib4ubvARB GLEW_GET_FUN(__glewVertexAttrib4ubvARB) +#define glVertexAttrib4uivARB GLEW_GET_FUN(__glewVertexAttrib4uivARB) +#define glVertexAttrib4usvARB GLEW_GET_FUN(__glewVertexAttrib4usvARB) +#define glVertexAttribPointerARB GLEW_GET_FUN(__glewVertexAttribPointerARB) + +#define GLEW_ARB_vertex_program GLEW_GET_VAR(__GLEW_ARB_vertex_program) + +#endif /* GL_ARB_vertex_program */ + +/* -------------------------- GL_ARB_vertex_shader ------------------------- */ + +#ifndef GL_ARB_vertex_shader +#define GL_ARB_vertex_shader 1 + +#define GL_VERTEX_SHADER_ARB 0x8B31 +#define GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB 0x8B4A +#define GL_MAX_VARYING_FLOATS_ARB 0x8B4B +#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB 0x8B4C +#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB 0x8B4D +#define GL_OBJECT_ACTIVE_ATTRIBUTES_ARB 0x8B89 +#define GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB 0x8B8A + +typedef void (GLAPIENTRY * PFNGLBINDATTRIBLOCATIONARBPROC) (GLhandleARB programObj, GLuint index, const GLcharARB* name); +typedef void (GLAPIENTRY * PFNGLGETACTIVEATTRIBARBPROC) (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei* length, GLint *size, GLenum *type, GLcharARB *name); +typedef GLint (GLAPIENTRY * PFNGLGETATTRIBLOCATIONARBPROC) (GLhandleARB programObj, const GLcharARB* name); + +#define glBindAttribLocationARB GLEW_GET_FUN(__glewBindAttribLocationARB) +#define glGetActiveAttribARB GLEW_GET_FUN(__glewGetActiveAttribARB) +#define glGetAttribLocationARB GLEW_GET_FUN(__glewGetAttribLocationARB) + +#define GLEW_ARB_vertex_shader GLEW_GET_VAR(__GLEW_ARB_vertex_shader) + +#endif /* GL_ARB_vertex_shader */ + +/* ------------------- GL_ARB_vertex_type_10f_11f_11f_rev ------------------ */ + +#ifndef GL_ARB_vertex_type_10f_11f_11f_rev +#define GL_ARB_vertex_type_10f_11f_11f_rev 1 + +#define GL_UNSIGNED_INT_10F_11F_11F_REV 0x8C3B + +#define GLEW_ARB_vertex_type_10f_11f_11f_rev GLEW_GET_VAR(__GLEW_ARB_vertex_type_10f_11f_11f_rev) + +#endif /* GL_ARB_vertex_type_10f_11f_11f_rev */ + +/* ------------------- GL_ARB_vertex_type_2_10_10_10_rev ------------------- */ + +#ifndef GL_ARB_vertex_type_2_10_10_10_rev +#define GL_ARB_vertex_type_2_10_10_10_rev 1 + +#define GL_UNSIGNED_INT_2_10_10_10_REV 0x8368 +#define GL_INT_2_10_10_10_REV 0x8D9F + +typedef void (GLAPIENTRY * PFNGLCOLORP3UIPROC) (GLenum type, GLuint color); +typedef void (GLAPIENTRY * PFNGLCOLORP3UIVPROC) (GLenum type, const GLuint* color); +typedef void (GLAPIENTRY * PFNGLCOLORP4UIPROC) (GLenum type, GLuint color); +typedef void (GLAPIENTRY * PFNGLCOLORP4UIVPROC) (GLenum type, const GLuint* color); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDP1UIPROC) (GLenum texture, GLenum type, GLuint coords); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDP1UIVPROC) (GLenum texture, GLenum type, const GLuint* coords); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDP2UIPROC) (GLenum texture, GLenum type, GLuint coords); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDP2UIVPROC) (GLenum texture, GLenum type, const GLuint* coords); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDP3UIPROC) (GLenum texture, GLenum type, GLuint coords); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDP3UIVPROC) (GLenum texture, GLenum type, const GLuint* coords); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDP4UIPROC) (GLenum texture, GLenum type, GLuint coords); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDP4UIVPROC) (GLenum texture, GLenum type, const GLuint* coords); +typedef void (GLAPIENTRY * PFNGLNORMALP3UIPROC) (GLenum type, GLuint coords); +typedef void (GLAPIENTRY * PFNGLNORMALP3UIVPROC) (GLenum type, const GLuint* coords); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLORP3UIPROC) (GLenum type, GLuint color); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLORP3UIVPROC) (GLenum type, const GLuint* color); +typedef void (GLAPIENTRY * PFNGLTEXCOORDP1UIPROC) (GLenum type, GLuint coords); +typedef void (GLAPIENTRY * PFNGLTEXCOORDP1UIVPROC) (GLenum type, const GLuint* coords); +typedef void (GLAPIENTRY * PFNGLTEXCOORDP2UIPROC) (GLenum type, GLuint coords); +typedef void (GLAPIENTRY * PFNGLTEXCOORDP2UIVPROC) (GLenum type, const GLuint* coords); +typedef void (GLAPIENTRY * PFNGLTEXCOORDP3UIPROC) (GLenum type, GLuint coords); +typedef void (GLAPIENTRY * PFNGLTEXCOORDP3UIVPROC) (GLenum type, const GLuint* coords); +typedef void (GLAPIENTRY * PFNGLTEXCOORDP4UIPROC) (GLenum type, GLuint coords); +typedef void (GLAPIENTRY * PFNGLTEXCOORDP4UIVPROC) (GLenum type, const GLuint* coords); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBP1UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBP1UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBP2UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBP2UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBP3UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBP3UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBP4UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBP4UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLVERTEXP2UIPROC) (GLenum type, GLuint value); +typedef void (GLAPIENTRY * PFNGLVERTEXP2UIVPROC) (GLenum type, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLVERTEXP3UIPROC) (GLenum type, GLuint value); +typedef void (GLAPIENTRY * PFNGLVERTEXP3UIVPROC) (GLenum type, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLVERTEXP4UIPROC) (GLenum type, GLuint value); +typedef void (GLAPIENTRY * PFNGLVERTEXP4UIVPROC) (GLenum type, const GLuint* value); + +#define glColorP3ui GLEW_GET_FUN(__glewColorP3ui) +#define glColorP3uiv GLEW_GET_FUN(__glewColorP3uiv) +#define glColorP4ui GLEW_GET_FUN(__glewColorP4ui) +#define glColorP4uiv GLEW_GET_FUN(__glewColorP4uiv) +#define glMultiTexCoordP1ui GLEW_GET_FUN(__glewMultiTexCoordP1ui) +#define glMultiTexCoordP1uiv GLEW_GET_FUN(__glewMultiTexCoordP1uiv) +#define glMultiTexCoordP2ui GLEW_GET_FUN(__glewMultiTexCoordP2ui) +#define glMultiTexCoordP2uiv GLEW_GET_FUN(__glewMultiTexCoordP2uiv) +#define glMultiTexCoordP3ui GLEW_GET_FUN(__glewMultiTexCoordP3ui) +#define glMultiTexCoordP3uiv GLEW_GET_FUN(__glewMultiTexCoordP3uiv) +#define glMultiTexCoordP4ui GLEW_GET_FUN(__glewMultiTexCoordP4ui) +#define glMultiTexCoordP4uiv GLEW_GET_FUN(__glewMultiTexCoordP4uiv) +#define glNormalP3ui GLEW_GET_FUN(__glewNormalP3ui) +#define glNormalP3uiv GLEW_GET_FUN(__glewNormalP3uiv) +#define glSecondaryColorP3ui GLEW_GET_FUN(__glewSecondaryColorP3ui) +#define glSecondaryColorP3uiv GLEW_GET_FUN(__glewSecondaryColorP3uiv) +#define glTexCoordP1ui GLEW_GET_FUN(__glewTexCoordP1ui) +#define glTexCoordP1uiv GLEW_GET_FUN(__glewTexCoordP1uiv) +#define glTexCoordP2ui GLEW_GET_FUN(__glewTexCoordP2ui) +#define glTexCoordP2uiv GLEW_GET_FUN(__glewTexCoordP2uiv) +#define glTexCoordP3ui GLEW_GET_FUN(__glewTexCoordP3ui) +#define glTexCoordP3uiv GLEW_GET_FUN(__glewTexCoordP3uiv) +#define glTexCoordP4ui GLEW_GET_FUN(__glewTexCoordP4ui) +#define glTexCoordP4uiv GLEW_GET_FUN(__glewTexCoordP4uiv) +#define glVertexAttribP1ui GLEW_GET_FUN(__glewVertexAttribP1ui) +#define glVertexAttribP1uiv GLEW_GET_FUN(__glewVertexAttribP1uiv) +#define glVertexAttribP2ui GLEW_GET_FUN(__glewVertexAttribP2ui) +#define glVertexAttribP2uiv GLEW_GET_FUN(__glewVertexAttribP2uiv) +#define glVertexAttribP3ui GLEW_GET_FUN(__glewVertexAttribP3ui) +#define glVertexAttribP3uiv GLEW_GET_FUN(__glewVertexAttribP3uiv) +#define glVertexAttribP4ui GLEW_GET_FUN(__glewVertexAttribP4ui) +#define glVertexAttribP4uiv GLEW_GET_FUN(__glewVertexAttribP4uiv) +#define glVertexP2ui GLEW_GET_FUN(__glewVertexP2ui) +#define glVertexP2uiv GLEW_GET_FUN(__glewVertexP2uiv) +#define glVertexP3ui GLEW_GET_FUN(__glewVertexP3ui) +#define glVertexP3uiv GLEW_GET_FUN(__glewVertexP3uiv) +#define glVertexP4ui GLEW_GET_FUN(__glewVertexP4ui) +#define glVertexP4uiv GLEW_GET_FUN(__glewVertexP4uiv) + +#define GLEW_ARB_vertex_type_2_10_10_10_rev GLEW_GET_VAR(__GLEW_ARB_vertex_type_2_10_10_10_rev) + +#endif /* GL_ARB_vertex_type_2_10_10_10_rev */ + +/* ------------------------- GL_ARB_viewport_array ------------------------- */ + +#ifndef GL_ARB_viewport_array +#define GL_ARB_viewport_array 1 + +#define GL_DEPTH_RANGE 0x0B70 +#define GL_VIEWPORT 0x0BA2 +#define GL_SCISSOR_BOX 0x0C10 +#define GL_SCISSOR_TEST 0x0C11 +#define GL_MAX_VIEWPORTS 0x825B +#define GL_VIEWPORT_SUBPIXEL_BITS 0x825C +#define GL_VIEWPORT_BOUNDS_RANGE 0x825D +#define GL_LAYER_PROVOKING_VERTEX 0x825E +#define GL_VIEWPORT_INDEX_PROVOKING_VERTEX 0x825F +#define GL_UNDEFINED_VERTEX 0x8260 +#define GL_FIRST_VERTEX_CONVENTION 0x8E4D +#define GL_LAST_VERTEX_CONVENTION 0x8E4E +#define GL_PROVOKING_VERTEX 0x8E4F + +typedef void (GLAPIENTRY * PFNGLDEPTHRANGEARRAYVPROC) (GLuint first, GLsizei count, const GLclampd * v); +typedef void (GLAPIENTRY * PFNGLDEPTHRANGEINDEXEDPROC) (GLuint index, GLclampd n, GLclampd f); +typedef void (GLAPIENTRY * PFNGLGETDOUBLEI_VPROC) (GLenum target, GLuint index, GLdouble* data); +typedef void (GLAPIENTRY * PFNGLGETFLOATI_VPROC) (GLenum target, GLuint index, GLfloat* data); +typedef void (GLAPIENTRY * PFNGLSCISSORARRAYVPROC) (GLuint first, GLsizei count, const GLint * v); +typedef void (GLAPIENTRY * PFNGLSCISSORINDEXEDPROC) (GLuint index, GLint left, GLint bottom, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLSCISSORINDEXEDVPROC) (GLuint index, const GLint * v); +typedef void (GLAPIENTRY * PFNGLVIEWPORTARRAYVPROC) (GLuint first, GLsizei count, const GLfloat * v); +typedef void (GLAPIENTRY * PFNGLVIEWPORTINDEXEDFPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat w, GLfloat h); +typedef void (GLAPIENTRY * PFNGLVIEWPORTINDEXEDFVPROC) (GLuint index, const GLfloat * v); + +#define glDepthRangeArrayv GLEW_GET_FUN(__glewDepthRangeArrayv) +#define glDepthRangeIndexed GLEW_GET_FUN(__glewDepthRangeIndexed) +#define glGetDoublei_v GLEW_GET_FUN(__glewGetDoublei_v) +#define glGetFloati_v GLEW_GET_FUN(__glewGetFloati_v) +#define glScissorArrayv GLEW_GET_FUN(__glewScissorArrayv) +#define glScissorIndexed GLEW_GET_FUN(__glewScissorIndexed) +#define glScissorIndexedv GLEW_GET_FUN(__glewScissorIndexedv) +#define glViewportArrayv GLEW_GET_FUN(__glewViewportArrayv) +#define glViewportIndexedf GLEW_GET_FUN(__glewViewportIndexedf) +#define glViewportIndexedfv GLEW_GET_FUN(__glewViewportIndexedfv) + +#define GLEW_ARB_viewport_array GLEW_GET_VAR(__GLEW_ARB_viewport_array) + +#endif /* GL_ARB_viewport_array */ + +/* --------------------------- GL_ARB_window_pos --------------------------- */ + +#ifndef GL_ARB_window_pos +#define GL_ARB_window_pos 1 + +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2DARBPROC) (GLdouble x, GLdouble y); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2DVARBPROC) (const GLdouble* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2FARBPROC) (GLfloat x, GLfloat y); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2FVARBPROC) (const GLfloat* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2IARBPROC) (GLint x, GLint y); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2IVARBPROC) (const GLint* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2SARBPROC) (GLshort x, GLshort y); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2SVARBPROC) (const GLshort* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3DARBPROC) (GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3DVARBPROC) (const GLdouble* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3FARBPROC) (GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3FVARBPROC) (const GLfloat* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3IARBPROC) (GLint x, GLint y, GLint z); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3IVARBPROC) (const GLint* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3SARBPROC) (GLshort x, GLshort y, GLshort z); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3SVARBPROC) (const GLshort* p); + +#define glWindowPos2dARB GLEW_GET_FUN(__glewWindowPos2dARB) +#define glWindowPos2dvARB GLEW_GET_FUN(__glewWindowPos2dvARB) +#define glWindowPos2fARB GLEW_GET_FUN(__glewWindowPos2fARB) +#define glWindowPos2fvARB GLEW_GET_FUN(__glewWindowPos2fvARB) +#define glWindowPos2iARB GLEW_GET_FUN(__glewWindowPos2iARB) +#define glWindowPos2ivARB GLEW_GET_FUN(__glewWindowPos2ivARB) +#define glWindowPos2sARB GLEW_GET_FUN(__glewWindowPos2sARB) +#define glWindowPos2svARB GLEW_GET_FUN(__glewWindowPos2svARB) +#define glWindowPos3dARB GLEW_GET_FUN(__glewWindowPos3dARB) +#define glWindowPos3dvARB GLEW_GET_FUN(__glewWindowPos3dvARB) +#define glWindowPos3fARB GLEW_GET_FUN(__glewWindowPos3fARB) +#define glWindowPos3fvARB GLEW_GET_FUN(__glewWindowPos3fvARB) +#define glWindowPos3iARB GLEW_GET_FUN(__glewWindowPos3iARB) +#define glWindowPos3ivARB GLEW_GET_FUN(__glewWindowPos3ivARB) +#define glWindowPos3sARB GLEW_GET_FUN(__glewWindowPos3sARB) +#define glWindowPos3svARB GLEW_GET_FUN(__glewWindowPos3svARB) + +#define GLEW_ARB_window_pos GLEW_GET_VAR(__GLEW_ARB_window_pos) + +#endif /* GL_ARB_window_pos */ + +/* ------------------------- GL_ATIX_point_sprites ------------------------- */ + +#ifndef GL_ATIX_point_sprites +#define GL_ATIX_point_sprites 1 + +#define GL_TEXTURE_POINT_MODE_ATIX 0x60B0 +#define GL_TEXTURE_POINT_ONE_COORD_ATIX 0x60B1 +#define GL_TEXTURE_POINT_SPRITE_ATIX 0x60B2 +#define GL_POINT_SPRITE_CULL_MODE_ATIX 0x60B3 +#define GL_POINT_SPRITE_CULL_CENTER_ATIX 0x60B4 +#define GL_POINT_SPRITE_CULL_CLIP_ATIX 0x60B5 + +#define GLEW_ATIX_point_sprites GLEW_GET_VAR(__GLEW_ATIX_point_sprites) + +#endif /* GL_ATIX_point_sprites */ + +/* ---------------------- GL_ATIX_texture_env_combine3 --------------------- */ + +#ifndef GL_ATIX_texture_env_combine3 +#define GL_ATIX_texture_env_combine3 1 + +#define GL_MODULATE_ADD_ATIX 0x8744 +#define GL_MODULATE_SIGNED_ADD_ATIX 0x8745 +#define GL_MODULATE_SUBTRACT_ATIX 0x8746 + +#define GLEW_ATIX_texture_env_combine3 GLEW_GET_VAR(__GLEW_ATIX_texture_env_combine3) + +#endif /* GL_ATIX_texture_env_combine3 */ + +/* ----------------------- GL_ATIX_texture_env_route ----------------------- */ + +#ifndef GL_ATIX_texture_env_route +#define GL_ATIX_texture_env_route 1 + +#define GL_SECONDARY_COLOR_ATIX 0x8747 +#define GL_TEXTURE_OUTPUT_RGB_ATIX 0x8748 +#define GL_TEXTURE_OUTPUT_ALPHA_ATIX 0x8749 + +#define GLEW_ATIX_texture_env_route GLEW_GET_VAR(__GLEW_ATIX_texture_env_route) + +#endif /* GL_ATIX_texture_env_route */ + +/* ---------------- GL_ATIX_vertex_shader_output_point_size ---------------- */ + +#ifndef GL_ATIX_vertex_shader_output_point_size +#define GL_ATIX_vertex_shader_output_point_size 1 + +#define GL_OUTPUT_POINT_SIZE_ATIX 0x610E + +#define GLEW_ATIX_vertex_shader_output_point_size GLEW_GET_VAR(__GLEW_ATIX_vertex_shader_output_point_size) + +#endif /* GL_ATIX_vertex_shader_output_point_size */ + +/* -------------------------- GL_ATI_draw_buffers -------------------------- */ + +#ifndef GL_ATI_draw_buffers +#define GL_ATI_draw_buffers 1 + +#define GL_MAX_DRAW_BUFFERS_ATI 0x8824 +#define GL_DRAW_BUFFER0_ATI 0x8825 +#define GL_DRAW_BUFFER1_ATI 0x8826 +#define GL_DRAW_BUFFER2_ATI 0x8827 +#define GL_DRAW_BUFFER3_ATI 0x8828 +#define GL_DRAW_BUFFER4_ATI 0x8829 +#define GL_DRAW_BUFFER5_ATI 0x882A +#define GL_DRAW_BUFFER6_ATI 0x882B +#define GL_DRAW_BUFFER7_ATI 0x882C +#define GL_DRAW_BUFFER8_ATI 0x882D +#define GL_DRAW_BUFFER9_ATI 0x882E +#define GL_DRAW_BUFFER10_ATI 0x882F +#define GL_DRAW_BUFFER11_ATI 0x8830 +#define GL_DRAW_BUFFER12_ATI 0x8831 +#define GL_DRAW_BUFFER13_ATI 0x8832 +#define GL_DRAW_BUFFER14_ATI 0x8833 +#define GL_DRAW_BUFFER15_ATI 0x8834 + +typedef void (GLAPIENTRY * PFNGLDRAWBUFFERSATIPROC) (GLsizei n, const GLenum* bufs); + +#define glDrawBuffersATI GLEW_GET_FUN(__glewDrawBuffersATI) + +#define GLEW_ATI_draw_buffers GLEW_GET_VAR(__GLEW_ATI_draw_buffers) + +#endif /* GL_ATI_draw_buffers */ + +/* -------------------------- GL_ATI_element_array ------------------------- */ + +#ifndef GL_ATI_element_array +#define GL_ATI_element_array 1 + +#define GL_ELEMENT_ARRAY_ATI 0x8768 +#define GL_ELEMENT_ARRAY_TYPE_ATI 0x8769 +#define GL_ELEMENT_ARRAY_POINTER_ATI 0x876A + +typedef void (GLAPIENTRY * PFNGLDRAWELEMENTARRAYATIPROC) (GLenum mode, GLsizei count); +typedef void (GLAPIENTRY * PFNGLDRAWRANGEELEMENTARRAYATIPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count); +typedef void (GLAPIENTRY * PFNGLELEMENTPOINTERATIPROC) (GLenum type, const GLvoid *pointer); + +#define glDrawElementArrayATI GLEW_GET_FUN(__glewDrawElementArrayATI) +#define glDrawRangeElementArrayATI GLEW_GET_FUN(__glewDrawRangeElementArrayATI) +#define glElementPointerATI GLEW_GET_FUN(__glewElementPointerATI) + +#define GLEW_ATI_element_array GLEW_GET_VAR(__GLEW_ATI_element_array) + +#endif /* GL_ATI_element_array */ + +/* ------------------------- GL_ATI_envmap_bumpmap ------------------------- */ + +#ifndef GL_ATI_envmap_bumpmap +#define GL_ATI_envmap_bumpmap 1 + +#define GL_BUMP_ROT_MATRIX_ATI 0x8775 +#define GL_BUMP_ROT_MATRIX_SIZE_ATI 0x8776 +#define GL_BUMP_NUM_TEX_UNITS_ATI 0x8777 +#define GL_BUMP_TEX_UNITS_ATI 0x8778 +#define GL_DUDV_ATI 0x8779 +#define GL_DU8DV8_ATI 0x877A +#define GL_BUMP_ENVMAP_ATI 0x877B +#define GL_BUMP_TARGET_ATI 0x877C + +typedef void (GLAPIENTRY * PFNGLGETTEXBUMPPARAMETERFVATIPROC) (GLenum pname, GLfloat *param); +typedef void (GLAPIENTRY * PFNGLGETTEXBUMPPARAMETERIVATIPROC) (GLenum pname, GLint *param); +typedef void (GLAPIENTRY * PFNGLTEXBUMPPARAMETERFVATIPROC) (GLenum pname, GLfloat *param); +typedef void (GLAPIENTRY * PFNGLTEXBUMPPARAMETERIVATIPROC) (GLenum pname, GLint *param); + +#define glGetTexBumpParameterfvATI GLEW_GET_FUN(__glewGetTexBumpParameterfvATI) +#define glGetTexBumpParameterivATI GLEW_GET_FUN(__glewGetTexBumpParameterivATI) +#define glTexBumpParameterfvATI GLEW_GET_FUN(__glewTexBumpParameterfvATI) +#define glTexBumpParameterivATI GLEW_GET_FUN(__glewTexBumpParameterivATI) + +#define GLEW_ATI_envmap_bumpmap GLEW_GET_VAR(__GLEW_ATI_envmap_bumpmap) + +#endif /* GL_ATI_envmap_bumpmap */ + +/* ------------------------- GL_ATI_fragment_shader ------------------------ */ + +#ifndef GL_ATI_fragment_shader +#define GL_ATI_fragment_shader 1 + +#define GL_RED_BIT_ATI 0x00000001 +#define GL_2X_BIT_ATI 0x00000001 +#define GL_4X_BIT_ATI 0x00000002 +#define GL_GREEN_BIT_ATI 0x00000002 +#define GL_COMP_BIT_ATI 0x00000002 +#define GL_BLUE_BIT_ATI 0x00000004 +#define GL_8X_BIT_ATI 0x00000004 +#define GL_NEGATE_BIT_ATI 0x00000004 +#define GL_BIAS_BIT_ATI 0x00000008 +#define GL_HALF_BIT_ATI 0x00000008 +#define GL_QUARTER_BIT_ATI 0x00000010 +#define GL_EIGHTH_BIT_ATI 0x00000020 +#define GL_SATURATE_BIT_ATI 0x00000040 +#define GL_FRAGMENT_SHADER_ATI 0x8920 +#define GL_REG_0_ATI 0x8921 +#define GL_REG_1_ATI 0x8922 +#define GL_REG_2_ATI 0x8923 +#define GL_REG_3_ATI 0x8924 +#define GL_REG_4_ATI 0x8925 +#define GL_REG_5_ATI 0x8926 +#define GL_CON_0_ATI 0x8941 +#define GL_CON_1_ATI 0x8942 +#define GL_CON_2_ATI 0x8943 +#define GL_CON_3_ATI 0x8944 +#define GL_CON_4_ATI 0x8945 +#define GL_CON_5_ATI 0x8946 +#define GL_CON_6_ATI 0x8947 +#define GL_CON_7_ATI 0x8948 +#define GL_MOV_ATI 0x8961 +#define GL_ADD_ATI 0x8963 +#define GL_MUL_ATI 0x8964 +#define GL_SUB_ATI 0x8965 +#define GL_DOT3_ATI 0x8966 +#define GL_DOT4_ATI 0x8967 +#define GL_MAD_ATI 0x8968 +#define GL_LERP_ATI 0x8969 +#define GL_CND_ATI 0x896A +#define GL_CND0_ATI 0x896B +#define GL_DOT2_ADD_ATI 0x896C +#define GL_SECONDARY_INTERPOLATOR_ATI 0x896D +#define GL_NUM_FRAGMENT_REGISTERS_ATI 0x896E +#define GL_NUM_FRAGMENT_CONSTANTS_ATI 0x896F +#define GL_NUM_PASSES_ATI 0x8970 +#define GL_NUM_INSTRUCTIONS_PER_PASS_ATI 0x8971 +#define GL_NUM_INSTRUCTIONS_TOTAL_ATI 0x8972 +#define GL_NUM_INPUT_INTERPOLATOR_COMPONENTS_ATI 0x8973 +#define GL_NUM_LOOPBACK_COMPONENTS_ATI 0x8974 +#define GL_COLOR_ALPHA_PAIRING_ATI 0x8975 +#define GL_SWIZZLE_STR_ATI 0x8976 +#define GL_SWIZZLE_STQ_ATI 0x8977 +#define GL_SWIZZLE_STR_DR_ATI 0x8978 +#define GL_SWIZZLE_STQ_DQ_ATI 0x8979 +#define GL_SWIZZLE_STRQ_ATI 0x897A +#define GL_SWIZZLE_STRQ_DQ_ATI 0x897B + +typedef void (GLAPIENTRY * PFNGLALPHAFRAGMENTOP1ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); +typedef void (GLAPIENTRY * PFNGLALPHAFRAGMENTOP2ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); +typedef void (GLAPIENTRY * PFNGLALPHAFRAGMENTOP3ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); +typedef void (GLAPIENTRY * PFNGLBEGINFRAGMENTSHADERATIPROC) (void); +typedef void (GLAPIENTRY * PFNGLBINDFRAGMENTSHADERATIPROC) (GLuint id); +typedef void (GLAPIENTRY * PFNGLCOLORFRAGMENTOP1ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); +typedef void (GLAPIENTRY * PFNGLCOLORFRAGMENTOP2ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); +typedef void (GLAPIENTRY * PFNGLCOLORFRAGMENTOP3ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); +typedef void (GLAPIENTRY * PFNGLDELETEFRAGMENTSHADERATIPROC) (GLuint id); +typedef void (GLAPIENTRY * PFNGLENDFRAGMENTSHADERATIPROC) (void); +typedef GLuint (GLAPIENTRY * PFNGLGENFRAGMENTSHADERSATIPROC) (GLuint range); +typedef void (GLAPIENTRY * PFNGLPASSTEXCOORDATIPROC) (GLuint dst, GLuint coord, GLenum swizzle); +typedef void (GLAPIENTRY * PFNGLSAMPLEMAPATIPROC) (GLuint dst, GLuint interp, GLenum swizzle); +typedef void (GLAPIENTRY * PFNGLSETFRAGMENTSHADERCONSTANTATIPROC) (GLuint dst, const GLfloat* value); + +#define glAlphaFragmentOp1ATI GLEW_GET_FUN(__glewAlphaFragmentOp1ATI) +#define glAlphaFragmentOp2ATI GLEW_GET_FUN(__glewAlphaFragmentOp2ATI) +#define glAlphaFragmentOp3ATI GLEW_GET_FUN(__glewAlphaFragmentOp3ATI) +#define glBeginFragmentShaderATI GLEW_GET_FUN(__glewBeginFragmentShaderATI) +#define glBindFragmentShaderATI GLEW_GET_FUN(__glewBindFragmentShaderATI) +#define glColorFragmentOp1ATI GLEW_GET_FUN(__glewColorFragmentOp1ATI) +#define glColorFragmentOp2ATI GLEW_GET_FUN(__glewColorFragmentOp2ATI) +#define glColorFragmentOp3ATI GLEW_GET_FUN(__glewColorFragmentOp3ATI) +#define glDeleteFragmentShaderATI GLEW_GET_FUN(__glewDeleteFragmentShaderATI) +#define glEndFragmentShaderATI GLEW_GET_FUN(__glewEndFragmentShaderATI) +#define glGenFragmentShadersATI GLEW_GET_FUN(__glewGenFragmentShadersATI) +#define glPassTexCoordATI GLEW_GET_FUN(__glewPassTexCoordATI) +#define glSampleMapATI GLEW_GET_FUN(__glewSampleMapATI) +#define glSetFragmentShaderConstantATI GLEW_GET_FUN(__glewSetFragmentShaderConstantATI) + +#define GLEW_ATI_fragment_shader GLEW_GET_VAR(__GLEW_ATI_fragment_shader) + +#endif /* GL_ATI_fragment_shader */ + +/* ------------------------ GL_ATI_map_object_buffer ----------------------- */ + +#ifndef GL_ATI_map_object_buffer +#define GL_ATI_map_object_buffer 1 + +typedef GLvoid * (GLAPIENTRY * PFNGLMAPOBJECTBUFFERATIPROC) (GLuint buffer); +typedef void (GLAPIENTRY * PFNGLUNMAPOBJECTBUFFERATIPROC) (GLuint buffer); + +#define glMapObjectBufferATI GLEW_GET_FUN(__glewMapObjectBufferATI) +#define glUnmapObjectBufferATI GLEW_GET_FUN(__glewUnmapObjectBufferATI) + +#define GLEW_ATI_map_object_buffer GLEW_GET_VAR(__GLEW_ATI_map_object_buffer) + +#endif /* GL_ATI_map_object_buffer */ + +/* ----------------------------- GL_ATI_meminfo ---------------------------- */ + +#ifndef GL_ATI_meminfo +#define GL_ATI_meminfo 1 + +#define GL_VBO_FREE_MEMORY_ATI 0x87FB +#define GL_TEXTURE_FREE_MEMORY_ATI 0x87FC +#define GL_RENDERBUFFER_FREE_MEMORY_ATI 0x87FD + +#define GLEW_ATI_meminfo GLEW_GET_VAR(__GLEW_ATI_meminfo) + +#endif /* GL_ATI_meminfo */ + +/* -------------------------- GL_ATI_pn_triangles -------------------------- */ + +#ifndef GL_ATI_pn_triangles +#define GL_ATI_pn_triangles 1 + +#define GL_PN_TRIANGLES_ATI 0x87F0 +#define GL_MAX_PN_TRIANGLES_TESSELATION_LEVEL_ATI 0x87F1 +#define GL_PN_TRIANGLES_POINT_MODE_ATI 0x87F2 +#define GL_PN_TRIANGLES_NORMAL_MODE_ATI 0x87F3 +#define GL_PN_TRIANGLES_TESSELATION_LEVEL_ATI 0x87F4 +#define GL_PN_TRIANGLES_POINT_MODE_LINEAR_ATI 0x87F5 +#define GL_PN_TRIANGLES_POINT_MODE_CUBIC_ATI 0x87F6 +#define GL_PN_TRIANGLES_NORMAL_MODE_LINEAR_ATI 0x87F7 +#define GL_PN_TRIANGLES_NORMAL_MODE_QUADRATIC_ATI 0x87F8 + +typedef void (GLAPIENTRY * PFNGLPNTRIANGLESFATIPROC) (GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLPNTRIANGLESIATIPROC) (GLenum pname, GLint param); + +#define glPNTrianglesfATI GLEW_GET_FUN(__glewPNTrianglesfATI) +#define glPNTrianglesiATI GLEW_GET_FUN(__glewPNTrianglesiATI) + +#define GLEW_ATI_pn_triangles GLEW_GET_VAR(__GLEW_ATI_pn_triangles) + +#endif /* GL_ATI_pn_triangles */ + +/* ------------------------ GL_ATI_separate_stencil ------------------------ */ + +#ifndef GL_ATI_separate_stencil +#define GL_ATI_separate_stencil 1 + +#define GL_STENCIL_BACK_FUNC_ATI 0x8800 +#define GL_STENCIL_BACK_FAIL_ATI 0x8801 +#define GL_STENCIL_BACK_PASS_DEPTH_FAIL_ATI 0x8802 +#define GL_STENCIL_BACK_PASS_DEPTH_PASS_ATI 0x8803 + +typedef void (GLAPIENTRY * PFNGLSTENCILFUNCSEPARATEATIPROC) (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask); +typedef void (GLAPIENTRY * PFNGLSTENCILOPSEPARATEATIPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass); + +#define glStencilFuncSeparateATI GLEW_GET_FUN(__glewStencilFuncSeparateATI) +#define glStencilOpSeparateATI GLEW_GET_FUN(__glewStencilOpSeparateATI) + +#define GLEW_ATI_separate_stencil GLEW_GET_VAR(__GLEW_ATI_separate_stencil) + +#endif /* GL_ATI_separate_stencil */ + +/* ----------------------- GL_ATI_shader_texture_lod ----------------------- */ + +#ifndef GL_ATI_shader_texture_lod +#define GL_ATI_shader_texture_lod 1 + +#define GLEW_ATI_shader_texture_lod GLEW_GET_VAR(__GLEW_ATI_shader_texture_lod) + +#endif /* GL_ATI_shader_texture_lod */ + +/* ---------------------- GL_ATI_text_fragment_shader ---------------------- */ + +#ifndef GL_ATI_text_fragment_shader +#define GL_ATI_text_fragment_shader 1 + +#define GL_TEXT_FRAGMENT_SHADER_ATI 0x8200 + +#define GLEW_ATI_text_fragment_shader GLEW_GET_VAR(__GLEW_ATI_text_fragment_shader) + +#endif /* GL_ATI_text_fragment_shader */ + +/* --------------------- GL_ATI_texture_compression_3dc -------------------- */ + +#ifndef GL_ATI_texture_compression_3dc +#define GL_ATI_texture_compression_3dc 1 + +#define GL_COMPRESSED_LUMINANCE_ALPHA_3DC_ATI 0x8837 + +#define GLEW_ATI_texture_compression_3dc GLEW_GET_VAR(__GLEW_ATI_texture_compression_3dc) + +#endif /* GL_ATI_texture_compression_3dc */ + +/* ---------------------- GL_ATI_texture_env_combine3 ---------------------- */ + +#ifndef GL_ATI_texture_env_combine3 +#define GL_ATI_texture_env_combine3 1 + +#define GL_MODULATE_ADD_ATI 0x8744 +#define GL_MODULATE_SIGNED_ADD_ATI 0x8745 +#define GL_MODULATE_SUBTRACT_ATI 0x8746 + +#define GLEW_ATI_texture_env_combine3 GLEW_GET_VAR(__GLEW_ATI_texture_env_combine3) + +#endif /* GL_ATI_texture_env_combine3 */ + +/* -------------------------- GL_ATI_texture_float ------------------------- */ + +#ifndef GL_ATI_texture_float +#define GL_ATI_texture_float 1 + +#define GL_RGBA_FLOAT32_ATI 0x8814 +#define GL_RGB_FLOAT32_ATI 0x8815 +#define GL_ALPHA_FLOAT32_ATI 0x8816 +#define GL_INTENSITY_FLOAT32_ATI 0x8817 +#define GL_LUMINANCE_FLOAT32_ATI 0x8818 +#define GL_LUMINANCE_ALPHA_FLOAT32_ATI 0x8819 +#define GL_RGBA_FLOAT16_ATI 0x881A +#define GL_RGB_FLOAT16_ATI 0x881B +#define GL_ALPHA_FLOAT16_ATI 0x881C +#define GL_INTENSITY_FLOAT16_ATI 0x881D +#define GL_LUMINANCE_FLOAT16_ATI 0x881E +#define GL_LUMINANCE_ALPHA_FLOAT16_ATI 0x881F + +#define GLEW_ATI_texture_float GLEW_GET_VAR(__GLEW_ATI_texture_float) + +#endif /* GL_ATI_texture_float */ + +/* ----------------------- GL_ATI_texture_mirror_once ---------------------- */ + +#ifndef GL_ATI_texture_mirror_once +#define GL_ATI_texture_mirror_once 1 + +#define GL_MIRROR_CLAMP_ATI 0x8742 +#define GL_MIRROR_CLAMP_TO_EDGE_ATI 0x8743 + +#define GLEW_ATI_texture_mirror_once GLEW_GET_VAR(__GLEW_ATI_texture_mirror_once) + +#endif /* GL_ATI_texture_mirror_once */ + +/* ----------------------- GL_ATI_vertex_array_object ---------------------- */ + +#ifndef GL_ATI_vertex_array_object +#define GL_ATI_vertex_array_object 1 + +#define GL_STATIC_ATI 0x8760 +#define GL_DYNAMIC_ATI 0x8761 +#define GL_PRESERVE_ATI 0x8762 +#define GL_DISCARD_ATI 0x8763 +#define GL_OBJECT_BUFFER_SIZE_ATI 0x8764 +#define GL_OBJECT_BUFFER_USAGE_ATI 0x8765 +#define GL_ARRAY_OBJECT_BUFFER_ATI 0x8766 +#define GL_ARRAY_OBJECT_OFFSET_ATI 0x8767 + +typedef void (GLAPIENTRY * PFNGLARRAYOBJECTATIPROC) (GLenum array, GLint size, GLenum type, GLsizei stride, GLuint buffer, GLuint offset); +typedef void (GLAPIENTRY * PFNGLFREEOBJECTBUFFERATIPROC) (GLuint buffer); +typedef void (GLAPIENTRY * PFNGLGETARRAYOBJECTFVATIPROC) (GLenum array, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETARRAYOBJECTIVATIPROC) (GLenum array, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETOBJECTBUFFERFVATIPROC) (GLuint buffer, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETOBJECTBUFFERIVATIPROC) (GLuint buffer, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETVARIANTARRAYOBJECTFVATIPROC) (GLuint id, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETVARIANTARRAYOBJECTIVATIPROC) (GLuint id, GLenum pname, GLint* params); +typedef GLboolean (GLAPIENTRY * PFNGLISOBJECTBUFFERATIPROC) (GLuint buffer); +typedef GLuint (GLAPIENTRY * PFNGLNEWOBJECTBUFFERATIPROC) (GLsizei size, const GLvoid *pointer, GLenum usage); +typedef void (GLAPIENTRY * PFNGLUPDATEOBJECTBUFFERATIPROC) (GLuint buffer, GLuint offset, GLsizei size, const GLvoid *pointer, GLenum preserve); +typedef void (GLAPIENTRY * PFNGLVARIANTARRAYOBJECTATIPROC) (GLuint id, GLenum type, GLsizei stride, GLuint buffer, GLuint offset); + +#define glArrayObjectATI GLEW_GET_FUN(__glewArrayObjectATI) +#define glFreeObjectBufferATI GLEW_GET_FUN(__glewFreeObjectBufferATI) +#define glGetArrayObjectfvATI GLEW_GET_FUN(__glewGetArrayObjectfvATI) +#define glGetArrayObjectivATI GLEW_GET_FUN(__glewGetArrayObjectivATI) +#define glGetObjectBufferfvATI GLEW_GET_FUN(__glewGetObjectBufferfvATI) +#define glGetObjectBufferivATI GLEW_GET_FUN(__glewGetObjectBufferivATI) +#define glGetVariantArrayObjectfvATI GLEW_GET_FUN(__glewGetVariantArrayObjectfvATI) +#define glGetVariantArrayObjectivATI GLEW_GET_FUN(__glewGetVariantArrayObjectivATI) +#define glIsObjectBufferATI GLEW_GET_FUN(__glewIsObjectBufferATI) +#define glNewObjectBufferATI GLEW_GET_FUN(__glewNewObjectBufferATI) +#define glUpdateObjectBufferATI GLEW_GET_FUN(__glewUpdateObjectBufferATI) +#define glVariantArrayObjectATI GLEW_GET_FUN(__glewVariantArrayObjectATI) + +#define GLEW_ATI_vertex_array_object GLEW_GET_VAR(__GLEW_ATI_vertex_array_object) + +#endif /* GL_ATI_vertex_array_object */ + +/* ------------------- GL_ATI_vertex_attrib_array_object ------------------- */ + +#ifndef GL_ATI_vertex_attrib_array_object +#define GL_ATI_vertex_attrib_array_object 1 + +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBARRAYOBJECTFVATIPROC) (GLuint index, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBARRAYOBJECTIVATIPROC) (GLuint index, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBARRAYOBJECTATIPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLuint buffer, GLuint offset); + +#define glGetVertexAttribArrayObjectfvATI GLEW_GET_FUN(__glewGetVertexAttribArrayObjectfvATI) +#define glGetVertexAttribArrayObjectivATI GLEW_GET_FUN(__glewGetVertexAttribArrayObjectivATI) +#define glVertexAttribArrayObjectATI GLEW_GET_FUN(__glewVertexAttribArrayObjectATI) + +#define GLEW_ATI_vertex_attrib_array_object GLEW_GET_VAR(__GLEW_ATI_vertex_attrib_array_object) + +#endif /* GL_ATI_vertex_attrib_array_object */ + +/* ------------------------- GL_ATI_vertex_streams ------------------------- */ + +#ifndef GL_ATI_vertex_streams +#define GL_ATI_vertex_streams 1 + +#define GL_MAX_VERTEX_STREAMS_ATI 0x876B +#define GL_VERTEX_SOURCE_ATI 0x876C +#define GL_VERTEX_STREAM0_ATI 0x876D +#define GL_VERTEX_STREAM1_ATI 0x876E +#define GL_VERTEX_STREAM2_ATI 0x876F +#define GL_VERTEX_STREAM3_ATI 0x8770 +#define GL_VERTEX_STREAM4_ATI 0x8771 +#define GL_VERTEX_STREAM5_ATI 0x8772 +#define GL_VERTEX_STREAM6_ATI 0x8773 +#define GL_VERTEX_STREAM7_ATI 0x8774 + +typedef void (GLAPIENTRY * PFNGLCLIENTACTIVEVERTEXSTREAMATIPROC) (GLenum stream); +typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3BATIPROC) (GLenum stream, GLbyte x, GLbyte y, GLbyte z); +typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3BVATIPROC) (GLenum stream, const GLbyte *coords); +typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3DVATIPROC) (GLenum stream, const GLdouble *coords); +typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3FVATIPROC) (GLenum stream, const GLfloat *coords); +typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3IATIPROC) (GLenum stream, GLint x, GLint y, GLint z); +typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3IVATIPROC) (GLenum stream, const GLint *coords); +typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z); +typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3SVATIPROC) (GLenum stream, const GLshort *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXBLENDENVFATIPROC) (GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLVERTEXBLENDENVIATIPROC) (GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM1DATIPROC) (GLenum stream, GLdouble x); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM1DVATIPROC) (GLenum stream, const GLdouble *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM1FATIPROC) (GLenum stream, GLfloat x); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM1FVATIPROC) (GLenum stream, const GLfloat *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM1IATIPROC) (GLenum stream, GLint x); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM1IVATIPROC) (GLenum stream, const GLint *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM1SATIPROC) (GLenum stream, GLshort x); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM1SVATIPROC) (GLenum stream, const GLshort *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2DATIPROC) (GLenum stream, GLdouble x, GLdouble y); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2DVATIPROC) (GLenum stream, const GLdouble *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2FATIPROC) (GLenum stream, GLfloat x, GLfloat y); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2FVATIPROC) (GLenum stream, const GLfloat *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2IATIPROC) (GLenum stream, GLint x, GLint y); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2IVATIPROC) (GLenum stream, const GLint *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2SATIPROC) (GLenum stream, GLshort x, GLshort y); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2SVATIPROC) (GLenum stream, const GLshort *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3DVATIPROC) (GLenum stream, const GLdouble *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3FVATIPROC) (GLenum stream, const GLfloat *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3IATIPROC) (GLenum stream, GLint x, GLint y, GLint z); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3IVATIPROC) (GLenum stream, const GLint *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3SVATIPROC) (GLenum stream, const GLshort *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4DVATIPROC) (GLenum stream, const GLdouble *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4FVATIPROC) (GLenum stream, const GLfloat *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4IATIPROC) (GLenum stream, GLint x, GLint y, GLint z, GLint w); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4IVATIPROC) (GLenum stream, const GLint *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z, GLshort w); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4SVATIPROC) (GLenum stream, const GLshort *coords); + +#define glClientActiveVertexStreamATI GLEW_GET_FUN(__glewClientActiveVertexStreamATI) +#define glNormalStream3bATI GLEW_GET_FUN(__glewNormalStream3bATI) +#define glNormalStream3bvATI GLEW_GET_FUN(__glewNormalStream3bvATI) +#define glNormalStream3dATI GLEW_GET_FUN(__glewNormalStream3dATI) +#define glNormalStream3dvATI GLEW_GET_FUN(__glewNormalStream3dvATI) +#define glNormalStream3fATI GLEW_GET_FUN(__glewNormalStream3fATI) +#define glNormalStream3fvATI GLEW_GET_FUN(__glewNormalStream3fvATI) +#define glNormalStream3iATI GLEW_GET_FUN(__glewNormalStream3iATI) +#define glNormalStream3ivATI GLEW_GET_FUN(__glewNormalStream3ivATI) +#define glNormalStream3sATI GLEW_GET_FUN(__glewNormalStream3sATI) +#define glNormalStream3svATI GLEW_GET_FUN(__glewNormalStream3svATI) +#define glVertexBlendEnvfATI GLEW_GET_FUN(__glewVertexBlendEnvfATI) +#define glVertexBlendEnviATI GLEW_GET_FUN(__glewVertexBlendEnviATI) +#define glVertexStream1dATI GLEW_GET_FUN(__glewVertexStream1dATI) +#define glVertexStream1dvATI GLEW_GET_FUN(__glewVertexStream1dvATI) +#define glVertexStream1fATI GLEW_GET_FUN(__glewVertexStream1fATI) +#define glVertexStream1fvATI GLEW_GET_FUN(__glewVertexStream1fvATI) +#define glVertexStream1iATI GLEW_GET_FUN(__glewVertexStream1iATI) +#define glVertexStream1ivATI GLEW_GET_FUN(__glewVertexStream1ivATI) +#define glVertexStream1sATI GLEW_GET_FUN(__glewVertexStream1sATI) +#define glVertexStream1svATI GLEW_GET_FUN(__glewVertexStream1svATI) +#define glVertexStream2dATI GLEW_GET_FUN(__glewVertexStream2dATI) +#define glVertexStream2dvATI GLEW_GET_FUN(__glewVertexStream2dvATI) +#define glVertexStream2fATI GLEW_GET_FUN(__glewVertexStream2fATI) +#define glVertexStream2fvATI GLEW_GET_FUN(__glewVertexStream2fvATI) +#define glVertexStream2iATI GLEW_GET_FUN(__glewVertexStream2iATI) +#define glVertexStream2ivATI GLEW_GET_FUN(__glewVertexStream2ivATI) +#define glVertexStream2sATI GLEW_GET_FUN(__glewVertexStream2sATI) +#define glVertexStream2svATI GLEW_GET_FUN(__glewVertexStream2svATI) +#define glVertexStream3dATI GLEW_GET_FUN(__glewVertexStream3dATI) +#define glVertexStream3dvATI GLEW_GET_FUN(__glewVertexStream3dvATI) +#define glVertexStream3fATI GLEW_GET_FUN(__glewVertexStream3fATI) +#define glVertexStream3fvATI GLEW_GET_FUN(__glewVertexStream3fvATI) +#define glVertexStream3iATI GLEW_GET_FUN(__glewVertexStream3iATI) +#define glVertexStream3ivATI GLEW_GET_FUN(__glewVertexStream3ivATI) +#define glVertexStream3sATI GLEW_GET_FUN(__glewVertexStream3sATI) +#define glVertexStream3svATI GLEW_GET_FUN(__glewVertexStream3svATI) +#define glVertexStream4dATI GLEW_GET_FUN(__glewVertexStream4dATI) +#define glVertexStream4dvATI GLEW_GET_FUN(__glewVertexStream4dvATI) +#define glVertexStream4fATI GLEW_GET_FUN(__glewVertexStream4fATI) +#define glVertexStream4fvATI GLEW_GET_FUN(__glewVertexStream4fvATI) +#define glVertexStream4iATI GLEW_GET_FUN(__glewVertexStream4iATI) +#define glVertexStream4ivATI GLEW_GET_FUN(__glewVertexStream4ivATI) +#define glVertexStream4sATI GLEW_GET_FUN(__glewVertexStream4sATI) +#define glVertexStream4svATI GLEW_GET_FUN(__glewVertexStream4svATI) + +#define GLEW_ATI_vertex_streams GLEW_GET_VAR(__GLEW_ATI_vertex_streams) + +#endif /* GL_ATI_vertex_streams */ + +/* --------------------------- GL_EXT_422_pixels --------------------------- */ + +#ifndef GL_EXT_422_pixels +#define GL_EXT_422_pixels 1 + +#define GL_422_EXT 0x80CC +#define GL_422_REV_EXT 0x80CD +#define GL_422_AVERAGE_EXT 0x80CE +#define GL_422_REV_AVERAGE_EXT 0x80CF + +#define GLEW_EXT_422_pixels GLEW_GET_VAR(__GLEW_EXT_422_pixels) + +#endif /* GL_EXT_422_pixels */ + +/* ---------------------------- GL_EXT_Cg_shader --------------------------- */ + +#ifndef GL_EXT_Cg_shader +#define GL_EXT_Cg_shader 1 + +#define GL_CG_VERTEX_SHADER_EXT 0x890E +#define GL_CG_FRAGMENT_SHADER_EXT 0x890F + +#define GLEW_EXT_Cg_shader GLEW_GET_VAR(__GLEW_EXT_Cg_shader) + +#endif /* GL_EXT_Cg_shader */ + +/* ------------------------------ GL_EXT_abgr ------------------------------ */ + +#ifndef GL_EXT_abgr +#define GL_EXT_abgr 1 + +#define GL_ABGR_EXT 0x8000 + +#define GLEW_EXT_abgr GLEW_GET_VAR(__GLEW_EXT_abgr) + +#endif /* GL_EXT_abgr */ + +/* ------------------------------ GL_EXT_bgra ------------------------------ */ + +#ifndef GL_EXT_bgra +#define GL_EXT_bgra 1 + +#define GL_BGR_EXT 0x80E0 +#define GL_BGRA_EXT 0x80E1 + +#define GLEW_EXT_bgra GLEW_GET_VAR(__GLEW_EXT_bgra) + +#endif /* GL_EXT_bgra */ + +/* ------------------------ GL_EXT_bindable_uniform ------------------------ */ + +#ifndef GL_EXT_bindable_uniform +#define GL_EXT_bindable_uniform 1 + +#define GL_MAX_VERTEX_BINDABLE_UNIFORMS_EXT 0x8DE2 +#define GL_MAX_FRAGMENT_BINDABLE_UNIFORMS_EXT 0x8DE3 +#define GL_MAX_GEOMETRY_BINDABLE_UNIFORMS_EXT 0x8DE4 +#define GL_MAX_BINDABLE_UNIFORM_SIZE_EXT 0x8DED +#define GL_UNIFORM_BUFFER_EXT 0x8DEE +#define GL_UNIFORM_BUFFER_BINDING_EXT 0x8DEF + +typedef GLint (GLAPIENTRY * PFNGLGETUNIFORMBUFFERSIZEEXTPROC) (GLuint program, GLint location); +typedef GLintptr (GLAPIENTRY * PFNGLGETUNIFORMOFFSETEXTPROC) (GLuint program, GLint location); +typedef void (GLAPIENTRY * PFNGLUNIFORMBUFFEREXTPROC) (GLuint program, GLint location, GLuint buffer); + +#define glGetUniformBufferSizeEXT GLEW_GET_FUN(__glewGetUniformBufferSizeEXT) +#define glGetUniformOffsetEXT GLEW_GET_FUN(__glewGetUniformOffsetEXT) +#define glUniformBufferEXT GLEW_GET_FUN(__glewUniformBufferEXT) + +#define GLEW_EXT_bindable_uniform GLEW_GET_VAR(__GLEW_EXT_bindable_uniform) + +#endif /* GL_EXT_bindable_uniform */ + +/* --------------------------- GL_EXT_blend_color -------------------------- */ + +#ifndef GL_EXT_blend_color +#define GL_EXT_blend_color 1 + +#define GL_CONSTANT_COLOR_EXT 0x8001 +#define GL_ONE_MINUS_CONSTANT_COLOR_EXT 0x8002 +#define GL_CONSTANT_ALPHA_EXT 0x8003 +#define GL_ONE_MINUS_CONSTANT_ALPHA_EXT 0x8004 +#define GL_BLEND_COLOR_EXT 0x8005 + +typedef void (GLAPIENTRY * PFNGLBLENDCOLOREXTPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); + +#define glBlendColorEXT GLEW_GET_FUN(__glewBlendColorEXT) + +#define GLEW_EXT_blend_color GLEW_GET_VAR(__GLEW_EXT_blend_color) + +#endif /* GL_EXT_blend_color */ + +/* --------------------- GL_EXT_blend_equation_separate -------------------- */ + +#ifndef GL_EXT_blend_equation_separate +#define GL_EXT_blend_equation_separate 1 + +#define GL_BLEND_EQUATION_RGB_EXT 0x8009 +#define GL_BLEND_EQUATION_ALPHA_EXT 0x883D + +typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONSEPARATEEXTPROC) (GLenum modeRGB, GLenum modeAlpha); + +#define glBlendEquationSeparateEXT GLEW_GET_FUN(__glewBlendEquationSeparateEXT) + +#define GLEW_EXT_blend_equation_separate GLEW_GET_VAR(__GLEW_EXT_blend_equation_separate) + +#endif /* GL_EXT_blend_equation_separate */ + +/* ----------------------- GL_EXT_blend_func_separate ---------------------- */ + +#ifndef GL_EXT_blend_func_separate +#define GL_EXT_blend_func_separate 1 + +#define GL_BLEND_DST_RGB_EXT 0x80C8 +#define GL_BLEND_SRC_RGB_EXT 0x80C9 +#define GL_BLEND_DST_ALPHA_EXT 0x80CA +#define GL_BLEND_SRC_ALPHA_EXT 0x80CB + +typedef void (GLAPIENTRY * PFNGLBLENDFUNCSEPARATEEXTPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); + +#define glBlendFuncSeparateEXT GLEW_GET_FUN(__glewBlendFuncSeparateEXT) + +#define GLEW_EXT_blend_func_separate GLEW_GET_VAR(__GLEW_EXT_blend_func_separate) + +#endif /* GL_EXT_blend_func_separate */ + +/* ------------------------- GL_EXT_blend_logic_op ------------------------- */ + +#ifndef GL_EXT_blend_logic_op +#define GL_EXT_blend_logic_op 1 + +#define GLEW_EXT_blend_logic_op GLEW_GET_VAR(__GLEW_EXT_blend_logic_op) + +#endif /* GL_EXT_blend_logic_op */ + +/* -------------------------- GL_EXT_blend_minmax -------------------------- */ + +#ifndef GL_EXT_blend_minmax +#define GL_EXT_blend_minmax 1 + +#define GL_FUNC_ADD_EXT 0x8006 +#define GL_MIN_EXT 0x8007 +#define GL_MAX_EXT 0x8008 +#define GL_BLEND_EQUATION_EXT 0x8009 + +typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONEXTPROC) (GLenum mode); + +#define glBlendEquationEXT GLEW_GET_FUN(__glewBlendEquationEXT) + +#define GLEW_EXT_blend_minmax GLEW_GET_VAR(__GLEW_EXT_blend_minmax) + +#endif /* GL_EXT_blend_minmax */ + +/* ------------------------- GL_EXT_blend_subtract ------------------------- */ + +#ifndef GL_EXT_blend_subtract +#define GL_EXT_blend_subtract 1 + +#define GL_FUNC_SUBTRACT_EXT 0x800A +#define GL_FUNC_REVERSE_SUBTRACT_EXT 0x800B + +#define GLEW_EXT_blend_subtract GLEW_GET_VAR(__GLEW_EXT_blend_subtract) + +#endif /* GL_EXT_blend_subtract */ + +/* ------------------------ GL_EXT_clip_volume_hint ------------------------ */ + +#ifndef GL_EXT_clip_volume_hint +#define GL_EXT_clip_volume_hint 1 + +#define GL_CLIP_VOLUME_CLIPPING_HINT_EXT 0x80F0 + +#define GLEW_EXT_clip_volume_hint GLEW_GET_VAR(__GLEW_EXT_clip_volume_hint) + +#endif /* GL_EXT_clip_volume_hint */ + +/* ------------------------------ GL_EXT_cmyka ----------------------------- */ + +#ifndef GL_EXT_cmyka +#define GL_EXT_cmyka 1 + +#define GL_CMYK_EXT 0x800C +#define GL_CMYKA_EXT 0x800D +#define GL_PACK_CMYK_HINT_EXT 0x800E +#define GL_UNPACK_CMYK_HINT_EXT 0x800F + +#define GLEW_EXT_cmyka GLEW_GET_VAR(__GLEW_EXT_cmyka) + +#endif /* GL_EXT_cmyka */ + +/* ------------------------- GL_EXT_color_subtable ------------------------- */ + +#ifndef GL_EXT_color_subtable +#define GL_EXT_color_subtable 1 + +typedef void (GLAPIENTRY * PFNGLCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLCOPYCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); + +#define glColorSubTableEXT GLEW_GET_FUN(__glewColorSubTableEXT) +#define glCopyColorSubTableEXT GLEW_GET_FUN(__glewCopyColorSubTableEXT) + +#define GLEW_EXT_color_subtable GLEW_GET_VAR(__GLEW_EXT_color_subtable) + +#endif /* GL_EXT_color_subtable */ + +/* ---------------------- GL_EXT_compiled_vertex_array --------------------- */ + +#ifndef GL_EXT_compiled_vertex_array +#define GL_EXT_compiled_vertex_array 1 + +#define GL_ARRAY_ELEMENT_LOCK_FIRST_EXT 0x81A8 +#define GL_ARRAY_ELEMENT_LOCK_COUNT_EXT 0x81A9 + +typedef void (GLAPIENTRY * PFNGLLOCKARRAYSEXTPROC) (GLint first, GLsizei count); +typedef void (GLAPIENTRY * PFNGLUNLOCKARRAYSEXTPROC) (void); + +#define glLockArraysEXT GLEW_GET_FUN(__glewLockArraysEXT) +#define glUnlockArraysEXT GLEW_GET_FUN(__glewUnlockArraysEXT) + +#define GLEW_EXT_compiled_vertex_array GLEW_GET_VAR(__GLEW_EXT_compiled_vertex_array) + +#endif /* GL_EXT_compiled_vertex_array */ + +/* --------------------------- GL_EXT_convolution -------------------------- */ + +#ifndef GL_EXT_convolution +#define GL_EXT_convolution 1 + +#define GL_CONVOLUTION_1D_EXT 0x8010 +#define GL_CONVOLUTION_2D_EXT 0x8011 +#define GL_SEPARABLE_2D_EXT 0x8012 +#define GL_CONVOLUTION_BORDER_MODE_EXT 0x8013 +#define GL_CONVOLUTION_FILTER_SCALE_EXT 0x8014 +#define GL_CONVOLUTION_FILTER_BIAS_EXT 0x8015 +#define GL_REDUCE_EXT 0x8016 +#define GL_CONVOLUTION_FORMAT_EXT 0x8017 +#define GL_CONVOLUTION_WIDTH_EXT 0x8018 +#define GL_CONVOLUTION_HEIGHT_EXT 0x8019 +#define GL_MAX_CONVOLUTION_WIDTH_EXT 0x801A +#define GL_MAX_CONVOLUTION_HEIGHT_EXT 0x801B +#define GL_POST_CONVOLUTION_RED_SCALE_EXT 0x801C +#define GL_POST_CONVOLUTION_GREEN_SCALE_EXT 0x801D +#define GL_POST_CONVOLUTION_BLUE_SCALE_EXT 0x801E +#define GL_POST_CONVOLUTION_ALPHA_SCALE_EXT 0x801F +#define GL_POST_CONVOLUTION_RED_BIAS_EXT 0x8020 +#define GL_POST_CONVOLUTION_GREEN_BIAS_EXT 0x8021 +#define GL_POST_CONVOLUTION_BLUE_BIAS_EXT 0x8022 +#define GL_POST_CONVOLUTION_ALPHA_BIAS_EXT 0x8023 + +typedef void (GLAPIENTRY * PFNGLCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image); +typedef void (GLAPIENTRY * PFNGLCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image); +typedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERFEXTPROC) (GLenum target, GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERIEXTPROC) (GLenum target, GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLCOPYCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +typedef void (GLAPIENTRY * PFNGLCOPYCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLGETCONVOLUTIONFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *image); +typedef void (GLAPIENTRY * PFNGLGETCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETSEPARABLEFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span); +typedef void (GLAPIENTRY * PFNGLSEPARABLEFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column); + +#define glConvolutionFilter1DEXT GLEW_GET_FUN(__glewConvolutionFilter1DEXT) +#define glConvolutionFilter2DEXT GLEW_GET_FUN(__glewConvolutionFilter2DEXT) +#define glConvolutionParameterfEXT GLEW_GET_FUN(__glewConvolutionParameterfEXT) +#define glConvolutionParameterfvEXT GLEW_GET_FUN(__glewConvolutionParameterfvEXT) +#define glConvolutionParameteriEXT GLEW_GET_FUN(__glewConvolutionParameteriEXT) +#define glConvolutionParameterivEXT GLEW_GET_FUN(__glewConvolutionParameterivEXT) +#define glCopyConvolutionFilter1DEXT GLEW_GET_FUN(__glewCopyConvolutionFilter1DEXT) +#define glCopyConvolutionFilter2DEXT GLEW_GET_FUN(__glewCopyConvolutionFilter2DEXT) +#define glGetConvolutionFilterEXT GLEW_GET_FUN(__glewGetConvolutionFilterEXT) +#define glGetConvolutionParameterfvEXT GLEW_GET_FUN(__glewGetConvolutionParameterfvEXT) +#define glGetConvolutionParameterivEXT GLEW_GET_FUN(__glewGetConvolutionParameterivEXT) +#define glGetSeparableFilterEXT GLEW_GET_FUN(__glewGetSeparableFilterEXT) +#define glSeparableFilter2DEXT GLEW_GET_FUN(__glewSeparableFilter2DEXT) + +#define GLEW_EXT_convolution GLEW_GET_VAR(__GLEW_EXT_convolution) + +#endif /* GL_EXT_convolution */ + +/* ------------------------ GL_EXT_coordinate_frame ------------------------ */ + +#ifndef GL_EXT_coordinate_frame +#define GL_EXT_coordinate_frame 1 + +#define GL_TANGENT_ARRAY_EXT 0x8439 +#define GL_BINORMAL_ARRAY_EXT 0x843A +#define GL_CURRENT_TANGENT_EXT 0x843B +#define GL_CURRENT_BINORMAL_EXT 0x843C +#define GL_TANGENT_ARRAY_TYPE_EXT 0x843E +#define GL_TANGENT_ARRAY_STRIDE_EXT 0x843F +#define GL_BINORMAL_ARRAY_TYPE_EXT 0x8440 +#define GL_BINORMAL_ARRAY_STRIDE_EXT 0x8441 +#define GL_TANGENT_ARRAY_POINTER_EXT 0x8442 +#define GL_BINORMAL_ARRAY_POINTER_EXT 0x8443 +#define GL_MAP1_TANGENT_EXT 0x8444 +#define GL_MAP2_TANGENT_EXT 0x8445 +#define GL_MAP1_BINORMAL_EXT 0x8446 +#define GL_MAP2_BINORMAL_EXT 0x8447 + +typedef void (GLAPIENTRY * PFNGLBINORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, GLvoid *pointer); +typedef void (GLAPIENTRY * PFNGLTANGENTPOINTEREXTPROC) (GLenum type, GLsizei stride, GLvoid *pointer); + +#define glBinormalPointerEXT GLEW_GET_FUN(__glewBinormalPointerEXT) +#define glTangentPointerEXT GLEW_GET_FUN(__glewTangentPointerEXT) + +#define GLEW_EXT_coordinate_frame GLEW_GET_VAR(__GLEW_EXT_coordinate_frame) + +#endif /* GL_EXT_coordinate_frame */ + +/* -------------------------- GL_EXT_copy_texture -------------------------- */ + +#ifndef GL_EXT_copy_texture +#define GL_EXT_copy_texture 1 + +typedef void (GLAPIENTRY * PFNGLCOPYTEXIMAGE1DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); +typedef void (GLAPIENTRY * PFNGLCOPYTEXIMAGE2DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); +typedef void (GLAPIENTRY * PFNGLCOPYTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); +typedef void (GLAPIENTRY * PFNGLCOPYTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLCOPYTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); + +#define glCopyTexImage1DEXT GLEW_GET_FUN(__glewCopyTexImage1DEXT) +#define glCopyTexImage2DEXT GLEW_GET_FUN(__glewCopyTexImage2DEXT) +#define glCopyTexSubImage1DEXT GLEW_GET_FUN(__glewCopyTexSubImage1DEXT) +#define glCopyTexSubImage2DEXT GLEW_GET_FUN(__glewCopyTexSubImage2DEXT) +#define glCopyTexSubImage3DEXT GLEW_GET_FUN(__glewCopyTexSubImage3DEXT) + +#define GLEW_EXT_copy_texture GLEW_GET_VAR(__GLEW_EXT_copy_texture) + +#endif /* GL_EXT_copy_texture */ + +/* --------------------------- GL_EXT_cull_vertex -------------------------- */ + +#ifndef GL_EXT_cull_vertex +#define GL_EXT_cull_vertex 1 + +#define GL_CULL_VERTEX_EXT 0x81AA +#define GL_CULL_VERTEX_EYE_POSITION_EXT 0x81AB +#define GL_CULL_VERTEX_OBJECT_POSITION_EXT 0x81AC + +typedef void (GLAPIENTRY * PFNGLCULLPARAMETERDVEXTPROC) (GLenum pname, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLCULLPARAMETERFVEXTPROC) (GLenum pname, GLfloat* params); + +#define glCullParameterdvEXT GLEW_GET_FUN(__glewCullParameterdvEXT) +#define glCullParameterfvEXT GLEW_GET_FUN(__glewCullParameterfvEXT) + +#define GLEW_EXT_cull_vertex GLEW_GET_VAR(__GLEW_EXT_cull_vertex) + +#endif /* GL_EXT_cull_vertex */ + +/* -------------------------- GL_EXT_debug_marker -------------------------- */ + +#ifndef GL_EXT_debug_marker +#define GL_EXT_debug_marker 1 + +typedef void (GLAPIENTRY * PFNGLINSERTEVENTMARKEREXTPROC) (GLsizei length, const GLchar* marker); +typedef void (GLAPIENTRY * PFNGLPOPGROUPMARKEREXTPROC) (void); +typedef void (GLAPIENTRY * PFNGLPUSHGROUPMARKEREXTPROC) (GLsizei length, const GLchar* marker); + +#define glInsertEventMarkerEXT GLEW_GET_FUN(__glewInsertEventMarkerEXT) +#define glPopGroupMarkerEXT GLEW_GET_FUN(__glewPopGroupMarkerEXT) +#define glPushGroupMarkerEXT GLEW_GET_FUN(__glewPushGroupMarkerEXT) + +#define GLEW_EXT_debug_marker GLEW_GET_VAR(__GLEW_EXT_debug_marker) + +#endif /* GL_EXT_debug_marker */ + +/* ------------------------ GL_EXT_depth_bounds_test ----------------------- */ + +#ifndef GL_EXT_depth_bounds_test +#define GL_EXT_depth_bounds_test 1 + +#define GL_DEPTH_BOUNDS_TEST_EXT 0x8890 +#define GL_DEPTH_BOUNDS_EXT 0x8891 + +typedef void (GLAPIENTRY * PFNGLDEPTHBOUNDSEXTPROC) (GLclampd zmin, GLclampd zmax); + +#define glDepthBoundsEXT GLEW_GET_FUN(__glewDepthBoundsEXT) + +#define GLEW_EXT_depth_bounds_test GLEW_GET_VAR(__GLEW_EXT_depth_bounds_test) + +#endif /* GL_EXT_depth_bounds_test */ + +/* ----------------------- GL_EXT_direct_state_access ---------------------- */ + +#ifndef GL_EXT_direct_state_access +#define GL_EXT_direct_state_access 1 + +#define GL_PROGRAM_MATRIX_EXT 0x8E2D +#define GL_TRANSPOSE_PROGRAM_MATRIX_EXT 0x8E2E +#define GL_PROGRAM_MATRIX_STACK_DEPTH_EXT 0x8E2F + +typedef void (GLAPIENTRY * PFNGLBINDMULTITEXTUREEXTPROC) (GLenum texunit, GLenum target, GLuint texture); +typedef GLenum (GLAPIENTRY * PFNGLCHECKNAMEDFRAMEBUFFERSTATUSEXTPROC) (GLuint framebuffer, GLenum target); +typedef void (GLAPIENTRY * PFNGLCLIENTATTRIBDEFAULTEXTPROC) (GLbitfield mask); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDMULTITEXIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDMULTITEXIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDMULTITEXIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDMULTITEXSUBIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDMULTITEXSUBIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDMULTITEXSUBIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXTUREIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXTUREIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXTUREIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXTURESUBIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXTURESUBIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXTURESUBIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLCOPYMULTITEXIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); +typedef void (GLAPIENTRY * PFNGLCOPYMULTITEXIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); +typedef void (GLAPIENTRY * PFNGLCOPYMULTITEXSUBIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); +typedef void (GLAPIENTRY * PFNGLCOPYMULTITEXSUBIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLCOPYMULTITEXSUBIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLCOPYTEXTUREIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); +typedef void (GLAPIENTRY * PFNGLCOPYTEXTUREIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); +typedef void (GLAPIENTRY * PFNGLCOPYTEXTURESUBIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); +typedef void (GLAPIENTRY * PFNGLCOPYTEXTURESUBIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLCOPYTEXTURESUBIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLDISABLECLIENTSTATEINDEXEDEXTPROC) (GLenum array, GLuint index); +typedef void (GLAPIENTRY * PFNGLDISABLECLIENTSTATEIEXTPROC) (GLenum array, GLuint index); +typedef void (GLAPIENTRY * PFNGLDISABLEVERTEXARRAYATTRIBEXTPROC) (GLuint vaobj, GLuint index); +typedef void (GLAPIENTRY * PFNGLDISABLEVERTEXARRAYEXTPROC) (GLuint vaobj, GLenum array); +typedef void (GLAPIENTRY * PFNGLENABLECLIENTSTATEINDEXEDEXTPROC) (GLenum array, GLuint index); +typedef void (GLAPIENTRY * PFNGLENABLECLIENTSTATEIEXTPROC) (GLenum array, GLuint index); +typedef void (GLAPIENTRY * PFNGLENABLEVERTEXARRAYATTRIBEXTPROC) (GLuint vaobj, GLuint index); +typedef void (GLAPIENTRY * PFNGLENABLEVERTEXARRAYEXTPROC) (GLuint vaobj, GLenum array); +typedef void (GLAPIENTRY * PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr length); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERDRAWBUFFEREXTPROC) (GLuint framebuffer, GLenum mode); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERDRAWBUFFERSEXTPROC) (GLuint framebuffer, GLsizei n, const GLenum* bufs); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERREADBUFFEREXTPROC) (GLuint framebuffer, GLenum mode); +typedef void (GLAPIENTRY * PFNGLGENERATEMULTITEXMIPMAPEXTPROC) (GLenum texunit, GLenum target); +typedef void (GLAPIENTRY * PFNGLGENERATETEXTUREMIPMAPEXTPROC) (GLuint texture, GLenum target); +typedef void (GLAPIENTRY * PFNGLGETCOMPRESSEDMULTITEXIMAGEEXTPROC) (GLenum texunit, GLenum target, GLint level, GLvoid *img); +typedef void (GLAPIENTRY * PFNGLGETCOMPRESSEDTEXTUREIMAGEEXTPROC) (GLuint texture, GLenum target, GLint level, GLvoid *img); +typedef void (GLAPIENTRY * PFNGLGETDOUBLEINDEXEDVEXTPROC) (GLenum target, GLuint index, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLGETDOUBLEI_VEXTPROC) (GLenum pname, GLuint index, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLGETFLOATINDEXEDVEXTPROC) (GLenum target, GLuint index, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETFLOATI_VEXTPROC) (GLenum pname, GLuint index, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETFRAMEBUFFERPARAMETERIVEXTPROC) (GLuint framebuffer, GLenum pname, GLint* param); +typedef void (GLAPIENTRY * PFNGLGETMULTITEXENVFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETMULTITEXENVIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETMULTITEXGENDVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLGETMULTITEXGENFVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETMULTITEXGENIVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETMULTITEXIMAGEEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels); +typedef void (GLAPIENTRY * PFNGLGETMULTITEXLEVELPARAMETERFVEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETMULTITEXLEVELPARAMETERIVEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETMULTITEXPARAMETERIIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETMULTITEXPARAMETERIUIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLuint* params); +typedef void (GLAPIENTRY * PFNGLGETMULTITEXPARAMETERFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETMULTITEXPARAMETERIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETNAMEDBUFFERPARAMETERIVEXTPROC) (GLuint buffer, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETNAMEDBUFFERPOINTERVEXTPROC) (GLuint buffer, GLenum pname, void** params); +typedef void (GLAPIENTRY * PFNGLGETNAMEDBUFFERSUBDATAEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, GLvoid *data); +typedef void (GLAPIENTRY * PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETNAMEDPROGRAMLOCALPARAMETERIIVEXTPROC) (GLuint program, GLenum target, GLuint index, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETNAMEDPROGRAMLOCALPARAMETERIUIVEXTPROC) (GLuint program, GLenum target, GLuint index, GLuint* params); +typedef void (GLAPIENTRY * PFNGLGETNAMEDPROGRAMLOCALPARAMETERDVEXTPROC) (GLuint program, GLenum target, GLuint index, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLGETNAMEDPROGRAMLOCALPARAMETERFVEXTPROC) (GLuint program, GLenum target, GLuint index, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETNAMEDPROGRAMSTRINGEXTPROC) (GLuint program, GLenum target, GLenum pname, GLvoid *string); +typedef void (GLAPIENTRY * PFNGLGETNAMEDPROGRAMIVEXTPROC) (GLuint program, GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETNAMEDRENDERBUFFERPARAMETERIVEXTPROC) (GLuint renderbuffer, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETPOINTERINDEXEDVEXTPROC) (GLenum target, GLuint index, GLvoid** params); +typedef void (GLAPIENTRY * PFNGLGETPOINTERI_VEXTPROC) (GLenum pname, GLuint index, GLvoid** params); +typedef void (GLAPIENTRY * PFNGLGETTEXTUREIMAGEEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels); +typedef void (GLAPIENTRY * PFNGLGETTEXTURELEVELPARAMETERFVEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETTEXTURELEVELPARAMETERIVEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETTEXTUREPARAMETERIIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETTEXTUREPARAMETERIUIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLuint* params); +typedef void (GLAPIENTRY * PFNGLGETTEXTUREPARAMETERFVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETTEXTUREPARAMETERIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETVERTEXARRAYINTEGERI_VEXTPROC) (GLuint vaobj, GLuint index, GLenum pname, GLint* param); +typedef void (GLAPIENTRY * PFNGLGETVERTEXARRAYINTEGERVEXTPROC) (GLuint vaobj, GLenum pname, GLint* param); +typedef void (GLAPIENTRY * PFNGLGETVERTEXARRAYPOINTERI_VEXTPROC) (GLuint vaobj, GLuint index, GLenum pname, GLvoid** param); +typedef void (GLAPIENTRY * PFNGLGETVERTEXARRAYPOINTERVEXTPROC) (GLuint vaobj, GLenum pname, GLvoid** param); +typedef GLvoid * (GLAPIENTRY * PFNGLMAPNAMEDBUFFEREXTPROC) (GLuint buffer, GLenum access); +typedef GLvoid * (GLAPIENTRY * PFNGLMAPNAMEDBUFFERRANGEEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr length, GLbitfield access); +typedef void (GLAPIENTRY * PFNGLMATRIXFRUSTUMEXTPROC) (GLenum matrixMode, GLdouble l, GLdouble r, GLdouble b, GLdouble t, GLdouble n, GLdouble f); +typedef void (GLAPIENTRY * PFNGLMATRIXLOADIDENTITYEXTPROC) (GLenum matrixMode); +typedef void (GLAPIENTRY * PFNGLMATRIXLOADTRANSPOSEDEXTPROC) (GLenum matrixMode, const GLdouble* m); +typedef void (GLAPIENTRY * PFNGLMATRIXLOADTRANSPOSEFEXTPROC) (GLenum matrixMode, const GLfloat* m); +typedef void (GLAPIENTRY * PFNGLMATRIXLOADDEXTPROC) (GLenum matrixMode, const GLdouble* m); +typedef void (GLAPIENTRY * PFNGLMATRIXLOADFEXTPROC) (GLenum matrixMode, const GLfloat* m); +typedef void (GLAPIENTRY * PFNGLMATRIXMULTTRANSPOSEDEXTPROC) (GLenum matrixMode, const GLdouble* m); +typedef void (GLAPIENTRY * PFNGLMATRIXMULTTRANSPOSEFEXTPROC) (GLenum matrixMode, const GLfloat* m); +typedef void (GLAPIENTRY * PFNGLMATRIXMULTDEXTPROC) (GLenum matrixMode, const GLdouble* m); +typedef void (GLAPIENTRY * PFNGLMATRIXMULTFEXTPROC) (GLenum matrixMode, const GLfloat* m); +typedef void (GLAPIENTRY * PFNGLMATRIXORTHOEXTPROC) (GLenum matrixMode, GLdouble l, GLdouble r, GLdouble b, GLdouble t, GLdouble n, GLdouble f); +typedef void (GLAPIENTRY * PFNGLMATRIXPOPEXTPROC) (GLenum matrixMode); +typedef void (GLAPIENTRY * PFNGLMATRIXPUSHEXTPROC) (GLenum matrixMode); +typedef void (GLAPIENTRY * PFNGLMATRIXROTATEDEXTPROC) (GLenum matrixMode, GLdouble angle, GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLMATRIXROTATEFEXTPROC) (GLenum matrixMode, GLfloat angle, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLMATRIXSCALEDEXTPROC) (GLenum matrixMode, GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLMATRIXSCALEFEXTPROC) (GLenum matrixMode, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLMATRIXTRANSLATEDEXTPROC) (GLenum matrixMode, GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLMATRIXTRANSLATEFEXTPROC) (GLenum matrixMode, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLMULTITEXBUFFEREXTPROC) (GLenum texunit, GLenum target, GLenum internalformat, GLuint buffer); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDPOINTEREXTPROC) (GLenum texunit, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +typedef void (GLAPIENTRY * PFNGLMULTITEXENVFEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLMULTITEXENVFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLMULTITEXENVIEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLMULTITEXENVIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLMULTITEXGENDEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLdouble param); +typedef void (GLAPIENTRY * PFNGLMULTITEXGENDVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, const GLdouble* params); +typedef void (GLAPIENTRY * PFNGLMULTITEXGENFEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLMULTITEXGENFVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLMULTITEXGENIEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLMULTITEXGENIVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLMULTITEXIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (GLAPIENTRY * PFNGLMULTITEXIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (GLAPIENTRY * PFNGLMULTITEXIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (GLAPIENTRY * PFNGLMULTITEXPARAMETERIIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLMULTITEXPARAMETERIUIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLuint* params); +typedef void (GLAPIENTRY * PFNGLMULTITEXPARAMETERFEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLMULTITEXPARAMETERFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLfloat* param); +typedef void (GLAPIENTRY * PFNGLMULTITEXPARAMETERIEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLMULTITEXPARAMETERIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLint* param); +typedef void (GLAPIENTRY * PFNGLMULTITEXRENDERBUFFEREXTPROC) (GLenum texunit, GLenum target, GLuint renderbuffer); +typedef void (GLAPIENTRY * PFNGLMULTITEXSUBIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (GLAPIENTRY * PFNGLMULTITEXSUBIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (GLAPIENTRY * PFNGLMULTITEXSUBIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (GLAPIENTRY * PFNGLNAMEDBUFFERDATAEXTPROC) (GLuint buffer, GLsizeiptr size, const GLvoid *data, GLenum usage); +typedef void (GLAPIENTRY * PFNGLNAMEDBUFFERSUBDATAEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLNAMEDCOPYBUFFERSUBDATAEXTPROC) (GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); +typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERRENDERBUFFEREXTPROC) (GLuint framebuffer, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); +typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERTEXTURE1DEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERTEXTURE2DEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERTEXTURE3DEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); +typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERTEXTUREEXTPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level); +typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERTEXTUREFACEEXTPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLenum face); +typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERTEXTURELAYEREXTPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLint layer); +typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETER4DEXTPROC) (GLuint program, GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETER4DVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLdouble* params); +typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETER4FEXTPROC) (GLuint program, GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETER4FVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETERI4IEXTPROC) (GLuint program, GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w); +typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETERI4IVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLint* params); +typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIEXTPROC) (GLuint program, GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); +typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLuint* params); +typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETERS4FVEXTPROC) (GLuint program, GLenum target, GLuint index, GLsizei count, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETERSI4IVEXTPROC) (GLuint program, GLenum target, GLuint index, GLsizei count, const GLint* params); +typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETERSI4UIVEXTPROC) (GLuint program, GLenum target, GLuint index, GLsizei count, const GLuint* params); +typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMSTRINGEXTPROC) (GLuint program, GLenum target, GLenum format, GLsizei len, const GLvoid *string); +typedef void (GLAPIENTRY * PFNGLNAMEDRENDERBUFFERSTORAGEEXTPROC) (GLuint renderbuffer, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLECOVERAGEEXTPROC) (GLuint renderbuffer, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) (GLuint renderbuffer, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1FEXTPROC) (GLuint program, GLint location, GLfloat v0); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1IEXTPROC) (GLuint program, GLint location, GLint v0); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1UIEXTPROC) (GLuint program, GLint location, GLuint v0); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2X3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2X4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3X2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3X4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4X2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4X3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPUSHCLIENTATTRIBDEFAULTEXTPROC) (GLbitfield mask); +typedef void (GLAPIENTRY * PFNGLTEXTUREBUFFEREXTPROC) (GLuint texture, GLenum target, GLenum internalformat, GLuint buffer); +typedef void (GLAPIENTRY * PFNGLTEXTUREIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (GLAPIENTRY * PFNGLTEXTUREIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (GLAPIENTRY * PFNGLTEXTUREIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERIIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERIUIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLuint* params); +typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERFEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERFVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLfloat* param); +typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERIEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLint* param); +typedef void (GLAPIENTRY * PFNGLTEXTURERENDERBUFFEREXTPROC) (GLuint texture, GLenum target, GLuint renderbuffer); +typedef void (GLAPIENTRY * PFNGLTEXTURESUBIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (GLAPIENTRY * PFNGLTEXTURESUBIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (GLAPIENTRY * PFNGLTEXTURESUBIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); +typedef GLboolean (GLAPIENTRY * PFNGLUNMAPNAMEDBUFFEREXTPROC) (GLuint buffer); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYCOLOROFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYEDGEFLAGOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLsizei stride, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYFOGCOORDOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLenum type, GLsizei stride, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYINDEXOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLenum type, GLsizei stride, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYMULTITEXCOORDOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLenum texunit, GLint size, GLenum type, GLsizei stride, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYNORMALOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLenum type, GLsizei stride, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYSECONDARYCOLOROFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYTEXCOORDOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYVERTEXATTRIBIOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLsizei stride, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYVERTEXATTRIBOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYVERTEXOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset); + +#define glBindMultiTextureEXT GLEW_GET_FUN(__glewBindMultiTextureEXT) +#define glCheckNamedFramebufferStatusEXT GLEW_GET_FUN(__glewCheckNamedFramebufferStatusEXT) +#define glClientAttribDefaultEXT GLEW_GET_FUN(__glewClientAttribDefaultEXT) +#define glCompressedMultiTexImage1DEXT GLEW_GET_FUN(__glewCompressedMultiTexImage1DEXT) +#define glCompressedMultiTexImage2DEXT GLEW_GET_FUN(__glewCompressedMultiTexImage2DEXT) +#define glCompressedMultiTexImage3DEXT GLEW_GET_FUN(__glewCompressedMultiTexImage3DEXT) +#define glCompressedMultiTexSubImage1DEXT GLEW_GET_FUN(__glewCompressedMultiTexSubImage1DEXT) +#define glCompressedMultiTexSubImage2DEXT GLEW_GET_FUN(__glewCompressedMultiTexSubImage2DEXT) +#define glCompressedMultiTexSubImage3DEXT GLEW_GET_FUN(__glewCompressedMultiTexSubImage3DEXT) +#define glCompressedTextureImage1DEXT GLEW_GET_FUN(__glewCompressedTextureImage1DEXT) +#define glCompressedTextureImage2DEXT GLEW_GET_FUN(__glewCompressedTextureImage2DEXT) +#define glCompressedTextureImage3DEXT GLEW_GET_FUN(__glewCompressedTextureImage3DEXT) +#define glCompressedTextureSubImage1DEXT GLEW_GET_FUN(__glewCompressedTextureSubImage1DEXT) +#define glCompressedTextureSubImage2DEXT GLEW_GET_FUN(__glewCompressedTextureSubImage2DEXT) +#define glCompressedTextureSubImage3DEXT GLEW_GET_FUN(__glewCompressedTextureSubImage3DEXT) +#define glCopyMultiTexImage1DEXT GLEW_GET_FUN(__glewCopyMultiTexImage1DEXT) +#define glCopyMultiTexImage2DEXT GLEW_GET_FUN(__glewCopyMultiTexImage2DEXT) +#define glCopyMultiTexSubImage1DEXT GLEW_GET_FUN(__glewCopyMultiTexSubImage1DEXT) +#define glCopyMultiTexSubImage2DEXT GLEW_GET_FUN(__glewCopyMultiTexSubImage2DEXT) +#define glCopyMultiTexSubImage3DEXT GLEW_GET_FUN(__glewCopyMultiTexSubImage3DEXT) +#define glCopyTextureImage1DEXT GLEW_GET_FUN(__glewCopyTextureImage1DEXT) +#define glCopyTextureImage2DEXT GLEW_GET_FUN(__glewCopyTextureImage2DEXT) +#define glCopyTextureSubImage1DEXT GLEW_GET_FUN(__glewCopyTextureSubImage1DEXT) +#define glCopyTextureSubImage2DEXT GLEW_GET_FUN(__glewCopyTextureSubImage2DEXT) +#define glCopyTextureSubImage3DEXT GLEW_GET_FUN(__glewCopyTextureSubImage3DEXT) +#define glDisableClientStateIndexedEXT GLEW_GET_FUN(__glewDisableClientStateIndexedEXT) +#define glDisableClientStateiEXT GLEW_GET_FUN(__glewDisableClientStateiEXT) +#define glDisableVertexArrayAttribEXT GLEW_GET_FUN(__glewDisableVertexArrayAttribEXT) +#define glDisableVertexArrayEXT GLEW_GET_FUN(__glewDisableVertexArrayEXT) +#define glEnableClientStateIndexedEXT GLEW_GET_FUN(__glewEnableClientStateIndexedEXT) +#define glEnableClientStateiEXT GLEW_GET_FUN(__glewEnableClientStateiEXT) +#define glEnableVertexArrayAttribEXT GLEW_GET_FUN(__glewEnableVertexArrayAttribEXT) +#define glEnableVertexArrayEXT GLEW_GET_FUN(__glewEnableVertexArrayEXT) +#define glFlushMappedNamedBufferRangeEXT GLEW_GET_FUN(__glewFlushMappedNamedBufferRangeEXT) +#define glFramebufferDrawBufferEXT GLEW_GET_FUN(__glewFramebufferDrawBufferEXT) +#define glFramebufferDrawBuffersEXT GLEW_GET_FUN(__glewFramebufferDrawBuffersEXT) +#define glFramebufferReadBufferEXT GLEW_GET_FUN(__glewFramebufferReadBufferEXT) +#define glGenerateMultiTexMipmapEXT GLEW_GET_FUN(__glewGenerateMultiTexMipmapEXT) +#define glGenerateTextureMipmapEXT GLEW_GET_FUN(__glewGenerateTextureMipmapEXT) +#define glGetCompressedMultiTexImageEXT GLEW_GET_FUN(__glewGetCompressedMultiTexImageEXT) +#define glGetCompressedTextureImageEXT GLEW_GET_FUN(__glewGetCompressedTextureImageEXT) +#define glGetDoubleIndexedvEXT GLEW_GET_FUN(__glewGetDoubleIndexedvEXT) +#define glGetDoublei_vEXT GLEW_GET_FUN(__glewGetDoublei_vEXT) +#define glGetFloatIndexedvEXT GLEW_GET_FUN(__glewGetFloatIndexedvEXT) +#define glGetFloati_vEXT GLEW_GET_FUN(__glewGetFloati_vEXT) +#define glGetFramebufferParameterivEXT GLEW_GET_FUN(__glewGetFramebufferParameterivEXT) +#define glGetMultiTexEnvfvEXT GLEW_GET_FUN(__glewGetMultiTexEnvfvEXT) +#define glGetMultiTexEnvivEXT GLEW_GET_FUN(__glewGetMultiTexEnvivEXT) +#define glGetMultiTexGendvEXT GLEW_GET_FUN(__glewGetMultiTexGendvEXT) +#define glGetMultiTexGenfvEXT GLEW_GET_FUN(__glewGetMultiTexGenfvEXT) +#define glGetMultiTexGenivEXT GLEW_GET_FUN(__glewGetMultiTexGenivEXT) +#define glGetMultiTexImageEXT GLEW_GET_FUN(__glewGetMultiTexImageEXT) +#define glGetMultiTexLevelParameterfvEXT GLEW_GET_FUN(__glewGetMultiTexLevelParameterfvEXT) +#define glGetMultiTexLevelParameterivEXT GLEW_GET_FUN(__glewGetMultiTexLevelParameterivEXT) +#define glGetMultiTexParameterIivEXT GLEW_GET_FUN(__glewGetMultiTexParameterIivEXT) +#define glGetMultiTexParameterIuivEXT GLEW_GET_FUN(__glewGetMultiTexParameterIuivEXT) +#define glGetMultiTexParameterfvEXT GLEW_GET_FUN(__glewGetMultiTexParameterfvEXT) +#define glGetMultiTexParameterivEXT GLEW_GET_FUN(__glewGetMultiTexParameterivEXT) +#define glGetNamedBufferParameterivEXT GLEW_GET_FUN(__glewGetNamedBufferParameterivEXT) +#define glGetNamedBufferPointervEXT GLEW_GET_FUN(__glewGetNamedBufferPointervEXT) +#define glGetNamedBufferSubDataEXT GLEW_GET_FUN(__glewGetNamedBufferSubDataEXT) +#define glGetNamedFramebufferAttachmentParameterivEXT GLEW_GET_FUN(__glewGetNamedFramebufferAttachmentParameterivEXT) +#define glGetNamedProgramLocalParameterIivEXT GLEW_GET_FUN(__glewGetNamedProgramLocalParameterIivEXT) +#define glGetNamedProgramLocalParameterIuivEXT GLEW_GET_FUN(__glewGetNamedProgramLocalParameterIuivEXT) +#define glGetNamedProgramLocalParameterdvEXT GLEW_GET_FUN(__glewGetNamedProgramLocalParameterdvEXT) +#define glGetNamedProgramLocalParameterfvEXT GLEW_GET_FUN(__glewGetNamedProgramLocalParameterfvEXT) +#define glGetNamedProgramStringEXT GLEW_GET_FUN(__glewGetNamedProgramStringEXT) +#define glGetNamedProgramivEXT GLEW_GET_FUN(__glewGetNamedProgramivEXT) +#define glGetNamedRenderbufferParameterivEXT GLEW_GET_FUN(__glewGetNamedRenderbufferParameterivEXT) +#define glGetPointerIndexedvEXT GLEW_GET_FUN(__glewGetPointerIndexedvEXT) +#define glGetPointeri_vEXT GLEW_GET_FUN(__glewGetPointeri_vEXT) +#define glGetTextureImageEXT GLEW_GET_FUN(__glewGetTextureImageEXT) +#define glGetTextureLevelParameterfvEXT GLEW_GET_FUN(__glewGetTextureLevelParameterfvEXT) +#define glGetTextureLevelParameterivEXT GLEW_GET_FUN(__glewGetTextureLevelParameterivEXT) +#define glGetTextureParameterIivEXT GLEW_GET_FUN(__glewGetTextureParameterIivEXT) +#define glGetTextureParameterIuivEXT GLEW_GET_FUN(__glewGetTextureParameterIuivEXT) +#define glGetTextureParameterfvEXT GLEW_GET_FUN(__glewGetTextureParameterfvEXT) +#define glGetTextureParameterivEXT GLEW_GET_FUN(__glewGetTextureParameterivEXT) +#define glGetVertexArrayIntegeri_vEXT GLEW_GET_FUN(__glewGetVertexArrayIntegeri_vEXT) +#define glGetVertexArrayIntegervEXT GLEW_GET_FUN(__glewGetVertexArrayIntegervEXT) +#define glGetVertexArrayPointeri_vEXT GLEW_GET_FUN(__glewGetVertexArrayPointeri_vEXT) +#define glGetVertexArrayPointervEXT GLEW_GET_FUN(__glewGetVertexArrayPointervEXT) +#define glMapNamedBufferEXT GLEW_GET_FUN(__glewMapNamedBufferEXT) +#define glMapNamedBufferRangeEXT GLEW_GET_FUN(__glewMapNamedBufferRangeEXT) +#define glMatrixFrustumEXT GLEW_GET_FUN(__glewMatrixFrustumEXT) +#define glMatrixLoadIdentityEXT GLEW_GET_FUN(__glewMatrixLoadIdentityEXT) +#define glMatrixLoadTransposedEXT GLEW_GET_FUN(__glewMatrixLoadTransposedEXT) +#define glMatrixLoadTransposefEXT GLEW_GET_FUN(__glewMatrixLoadTransposefEXT) +#define glMatrixLoaddEXT GLEW_GET_FUN(__glewMatrixLoaddEXT) +#define glMatrixLoadfEXT GLEW_GET_FUN(__glewMatrixLoadfEXT) +#define glMatrixMultTransposedEXT GLEW_GET_FUN(__glewMatrixMultTransposedEXT) +#define glMatrixMultTransposefEXT GLEW_GET_FUN(__glewMatrixMultTransposefEXT) +#define glMatrixMultdEXT GLEW_GET_FUN(__glewMatrixMultdEXT) +#define glMatrixMultfEXT GLEW_GET_FUN(__glewMatrixMultfEXT) +#define glMatrixOrthoEXT GLEW_GET_FUN(__glewMatrixOrthoEXT) +#define glMatrixPopEXT GLEW_GET_FUN(__glewMatrixPopEXT) +#define glMatrixPushEXT GLEW_GET_FUN(__glewMatrixPushEXT) +#define glMatrixRotatedEXT GLEW_GET_FUN(__glewMatrixRotatedEXT) +#define glMatrixRotatefEXT GLEW_GET_FUN(__glewMatrixRotatefEXT) +#define glMatrixScaledEXT GLEW_GET_FUN(__glewMatrixScaledEXT) +#define glMatrixScalefEXT GLEW_GET_FUN(__glewMatrixScalefEXT) +#define glMatrixTranslatedEXT GLEW_GET_FUN(__glewMatrixTranslatedEXT) +#define glMatrixTranslatefEXT GLEW_GET_FUN(__glewMatrixTranslatefEXT) +#define glMultiTexBufferEXT GLEW_GET_FUN(__glewMultiTexBufferEXT) +#define glMultiTexCoordPointerEXT GLEW_GET_FUN(__glewMultiTexCoordPointerEXT) +#define glMultiTexEnvfEXT GLEW_GET_FUN(__glewMultiTexEnvfEXT) +#define glMultiTexEnvfvEXT GLEW_GET_FUN(__glewMultiTexEnvfvEXT) +#define glMultiTexEnviEXT GLEW_GET_FUN(__glewMultiTexEnviEXT) +#define glMultiTexEnvivEXT GLEW_GET_FUN(__glewMultiTexEnvivEXT) +#define glMultiTexGendEXT GLEW_GET_FUN(__glewMultiTexGendEXT) +#define glMultiTexGendvEXT GLEW_GET_FUN(__glewMultiTexGendvEXT) +#define glMultiTexGenfEXT GLEW_GET_FUN(__glewMultiTexGenfEXT) +#define glMultiTexGenfvEXT GLEW_GET_FUN(__glewMultiTexGenfvEXT) +#define glMultiTexGeniEXT GLEW_GET_FUN(__glewMultiTexGeniEXT) +#define glMultiTexGenivEXT GLEW_GET_FUN(__glewMultiTexGenivEXT) +#define glMultiTexImage1DEXT GLEW_GET_FUN(__glewMultiTexImage1DEXT) +#define glMultiTexImage2DEXT GLEW_GET_FUN(__glewMultiTexImage2DEXT) +#define glMultiTexImage3DEXT GLEW_GET_FUN(__glewMultiTexImage3DEXT) +#define glMultiTexParameterIivEXT GLEW_GET_FUN(__glewMultiTexParameterIivEXT) +#define glMultiTexParameterIuivEXT GLEW_GET_FUN(__glewMultiTexParameterIuivEXT) +#define glMultiTexParameterfEXT GLEW_GET_FUN(__glewMultiTexParameterfEXT) +#define glMultiTexParameterfvEXT GLEW_GET_FUN(__glewMultiTexParameterfvEXT) +#define glMultiTexParameteriEXT GLEW_GET_FUN(__glewMultiTexParameteriEXT) +#define glMultiTexParameterivEXT GLEW_GET_FUN(__glewMultiTexParameterivEXT) +#define glMultiTexRenderbufferEXT GLEW_GET_FUN(__glewMultiTexRenderbufferEXT) +#define glMultiTexSubImage1DEXT GLEW_GET_FUN(__glewMultiTexSubImage1DEXT) +#define glMultiTexSubImage2DEXT GLEW_GET_FUN(__glewMultiTexSubImage2DEXT) +#define glMultiTexSubImage3DEXT GLEW_GET_FUN(__glewMultiTexSubImage3DEXT) +#define glNamedBufferDataEXT GLEW_GET_FUN(__glewNamedBufferDataEXT) +#define glNamedBufferSubDataEXT GLEW_GET_FUN(__glewNamedBufferSubDataEXT) +#define glNamedCopyBufferSubDataEXT GLEW_GET_FUN(__glewNamedCopyBufferSubDataEXT) +#define glNamedFramebufferRenderbufferEXT GLEW_GET_FUN(__glewNamedFramebufferRenderbufferEXT) +#define glNamedFramebufferTexture1DEXT GLEW_GET_FUN(__glewNamedFramebufferTexture1DEXT) +#define glNamedFramebufferTexture2DEXT GLEW_GET_FUN(__glewNamedFramebufferTexture2DEXT) +#define glNamedFramebufferTexture3DEXT GLEW_GET_FUN(__glewNamedFramebufferTexture3DEXT) +#define glNamedFramebufferTextureEXT GLEW_GET_FUN(__glewNamedFramebufferTextureEXT) +#define glNamedFramebufferTextureFaceEXT GLEW_GET_FUN(__glewNamedFramebufferTextureFaceEXT) +#define glNamedFramebufferTextureLayerEXT GLEW_GET_FUN(__glewNamedFramebufferTextureLayerEXT) +#define glNamedProgramLocalParameter4dEXT GLEW_GET_FUN(__glewNamedProgramLocalParameter4dEXT) +#define glNamedProgramLocalParameter4dvEXT GLEW_GET_FUN(__glewNamedProgramLocalParameter4dvEXT) +#define glNamedProgramLocalParameter4fEXT GLEW_GET_FUN(__glewNamedProgramLocalParameter4fEXT) +#define glNamedProgramLocalParameter4fvEXT GLEW_GET_FUN(__glewNamedProgramLocalParameter4fvEXT) +#define glNamedProgramLocalParameterI4iEXT GLEW_GET_FUN(__glewNamedProgramLocalParameterI4iEXT) +#define glNamedProgramLocalParameterI4ivEXT GLEW_GET_FUN(__glewNamedProgramLocalParameterI4ivEXT) +#define glNamedProgramLocalParameterI4uiEXT GLEW_GET_FUN(__glewNamedProgramLocalParameterI4uiEXT) +#define glNamedProgramLocalParameterI4uivEXT GLEW_GET_FUN(__glewNamedProgramLocalParameterI4uivEXT) +#define glNamedProgramLocalParameters4fvEXT GLEW_GET_FUN(__glewNamedProgramLocalParameters4fvEXT) +#define glNamedProgramLocalParametersI4ivEXT GLEW_GET_FUN(__glewNamedProgramLocalParametersI4ivEXT) +#define glNamedProgramLocalParametersI4uivEXT GLEW_GET_FUN(__glewNamedProgramLocalParametersI4uivEXT) +#define glNamedProgramStringEXT GLEW_GET_FUN(__glewNamedProgramStringEXT) +#define glNamedRenderbufferStorageEXT GLEW_GET_FUN(__glewNamedRenderbufferStorageEXT) +#define glNamedRenderbufferStorageMultisampleCoverageEXT GLEW_GET_FUN(__glewNamedRenderbufferStorageMultisampleCoverageEXT) +#define glNamedRenderbufferStorageMultisampleEXT GLEW_GET_FUN(__glewNamedRenderbufferStorageMultisampleEXT) +#define glProgramUniform1fEXT GLEW_GET_FUN(__glewProgramUniform1fEXT) +#define glProgramUniform1fvEXT GLEW_GET_FUN(__glewProgramUniform1fvEXT) +#define glProgramUniform1iEXT GLEW_GET_FUN(__glewProgramUniform1iEXT) +#define glProgramUniform1ivEXT GLEW_GET_FUN(__glewProgramUniform1ivEXT) +#define glProgramUniform1uiEXT GLEW_GET_FUN(__glewProgramUniform1uiEXT) +#define glProgramUniform1uivEXT GLEW_GET_FUN(__glewProgramUniform1uivEXT) +#define glProgramUniform2fEXT GLEW_GET_FUN(__glewProgramUniform2fEXT) +#define glProgramUniform2fvEXT GLEW_GET_FUN(__glewProgramUniform2fvEXT) +#define glProgramUniform2iEXT GLEW_GET_FUN(__glewProgramUniform2iEXT) +#define glProgramUniform2ivEXT GLEW_GET_FUN(__glewProgramUniform2ivEXT) +#define glProgramUniform2uiEXT GLEW_GET_FUN(__glewProgramUniform2uiEXT) +#define glProgramUniform2uivEXT GLEW_GET_FUN(__glewProgramUniform2uivEXT) +#define glProgramUniform3fEXT GLEW_GET_FUN(__glewProgramUniform3fEXT) +#define glProgramUniform3fvEXT GLEW_GET_FUN(__glewProgramUniform3fvEXT) +#define glProgramUniform3iEXT GLEW_GET_FUN(__glewProgramUniform3iEXT) +#define glProgramUniform3ivEXT GLEW_GET_FUN(__glewProgramUniform3ivEXT) +#define glProgramUniform3uiEXT GLEW_GET_FUN(__glewProgramUniform3uiEXT) +#define glProgramUniform3uivEXT GLEW_GET_FUN(__glewProgramUniform3uivEXT) +#define glProgramUniform4fEXT GLEW_GET_FUN(__glewProgramUniform4fEXT) +#define glProgramUniform4fvEXT GLEW_GET_FUN(__glewProgramUniform4fvEXT) +#define glProgramUniform4iEXT GLEW_GET_FUN(__glewProgramUniform4iEXT) +#define glProgramUniform4ivEXT GLEW_GET_FUN(__glewProgramUniform4ivEXT) +#define glProgramUniform4uiEXT GLEW_GET_FUN(__glewProgramUniform4uiEXT) +#define glProgramUniform4uivEXT GLEW_GET_FUN(__glewProgramUniform4uivEXT) +#define glProgramUniformMatrix2fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix2fvEXT) +#define glProgramUniformMatrix2x3fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix2x3fvEXT) +#define glProgramUniformMatrix2x4fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix2x4fvEXT) +#define glProgramUniformMatrix3fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix3fvEXT) +#define glProgramUniformMatrix3x2fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix3x2fvEXT) +#define glProgramUniformMatrix3x4fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix3x4fvEXT) +#define glProgramUniformMatrix4fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix4fvEXT) +#define glProgramUniformMatrix4x2fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix4x2fvEXT) +#define glProgramUniformMatrix4x3fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix4x3fvEXT) +#define glPushClientAttribDefaultEXT GLEW_GET_FUN(__glewPushClientAttribDefaultEXT) +#define glTextureBufferEXT GLEW_GET_FUN(__glewTextureBufferEXT) +#define glTextureImage1DEXT GLEW_GET_FUN(__glewTextureImage1DEXT) +#define glTextureImage2DEXT GLEW_GET_FUN(__glewTextureImage2DEXT) +#define glTextureImage3DEXT GLEW_GET_FUN(__glewTextureImage3DEXT) +#define glTextureParameterIivEXT GLEW_GET_FUN(__glewTextureParameterIivEXT) +#define glTextureParameterIuivEXT GLEW_GET_FUN(__glewTextureParameterIuivEXT) +#define glTextureParameterfEXT GLEW_GET_FUN(__glewTextureParameterfEXT) +#define glTextureParameterfvEXT GLEW_GET_FUN(__glewTextureParameterfvEXT) +#define glTextureParameteriEXT GLEW_GET_FUN(__glewTextureParameteriEXT) +#define glTextureParameterivEXT GLEW_GET_FUN(__glewTextureParameterivEXT) +#define glTextureRenderbufferEXT GLEW_GET_FUN(__glewTextureRenderbufferEXT) +#define glTextureSubImage1DEXT GLEW_GET_FUN(__glewTextureSubImage1DEXT) +#define glTextureSubImage2DEXT GLEW_GET_FUN(__glewTextureSubImage2DEXT) +#define glTextureSubImage3DEXT GLEW_GET_FUN(__glewTextureSubImage3DEXT) +#define glUnmapNamedBufferEXT GLEW_GET_FUN(__glewUnmapNamedBufferEXT) +#define glVertexArrayColorOffsetEXT GLEW_GET_FUN(__glewVertexArrayColorOffsetEXT) +#define glVertexArrayEdgeFlagOffsetEXT GLEW_GET_FUN(__glewVertexArrayEdgeFlagOffsetEXT) +#define glVertexArrayFogCoordOffsetEXT GLEW_GET_FUN(__glewVertexArrayFogCoordOffsetEXT) +#define glVertexArrayIndexOffsetEXT GLEW_GET_FUN(__glewVertexArrayIndexOffsetEXT) +#define glVertexArrayMultiTexCoordOffsetEXT GLEW_GET_FUN(__glewVertexArrayMultiTexCoordOffsetEXT) +#define glVertexArrayNormalOffsetEXT GLEW_GET_FUN(__glewVertexArrayNormalOffsetEXT) +#define glVertexArraySecondaryColorOffsetEXT GLEW_GET_FUN(__glewVertexArraySecondaryColorOffsetEXT) +#define glVertexArrayTexCoordOffsetEXT GLEW_GET_FUN(__glewVertexArrayTexCoordOffsetEXT) +#define glVertexArrayVertexAttribIOffsetEXT GLEW_GET_FUN(__glewVertexArrayVertexAttribIOffsetEXT) +#define glVertexArrayVertexAttribOffsetEXT GLEW_GET_FUN(__glewVertexArrayVertexAttribOffsetEXT) +#define glVertexArrayVertexOffsetEXT GLEW_GET_FUN(__glewVertexArrayVertexOffsetEXT) + +#define GLEW_EXT_direct_state_access GLEW_GET_VAR(__GLEW_EXT_direct_state_access) + +#endif /* GL_EXT_direct_state_access */ + +/* -------------------------- GL_EXT_draw_buffers2 ------------------------- */ + +#ifndef GL_EXT_draw_buffers2 +#define GL_EXT_draw_buffers2 1 + +typedef void (GLAPIENTRY * PFNGLCOLORMASKINDEXEDEXTPROC) (GLuint buf, GLboolean r, GLboolean g, GLboolean b, GLboolean a); +typedef void (GLAPIENTRY * PFNGLDISABLEINDEXEDEXTPROC) (GLenum target, GLuint index); +typedef void (GLAPIENTRY * PFNGLENABLEINDEXEDEXTPROC) (GLenum target, GLuint index); +typedef void (GLAPIENTRY * PFNGLGETBOOLEANINDEXEDVEXTPROC) (GLenum value, GLuint index, GLboolean* data); +typedef void (GLAPIENTRY * PFNGLGETINTEGERINDEXEDVEXTPROC) (GLenum value, GLuint index, GLint* data); +typedef GLboolean (GLAPIENTRY * PFNGLISENABLEDINDEXEDEXTPROC) (GLenum target, GLuint index); + +#define glColorMaskIndexedEXT GLEW_GET_FUN(__glewColorMaskIndexedEXT) +#define glDisableIndexedEXT GLEW_GET_FUN(__glewDisableIndexedEXT) +#define glEnableIndexedEXT GLEW_GET_FUN(__glewEnableIndexedEXT) +#define glGetBooleanIndexedvEXT GLEW_GET_FUN(__glewGetBooleanIndexedvEXT) +#define glGetIntegerIndexedvEXT GLEW_GET_FUN(__glewGetIntegerIndexedvEXT) +#define glIsEnabledIndexedEXT GLEW_GET_FUN(__glewIsEnabledIndexedEXT) + +#define GLEW_EXT_draw_buffers2 GLEW_GET_VAR(__GLEW_EXT_draw_buffers2) + +#endif /* GL_EXT_draw_buffers2 */ + +/* ------------------------- GL_EXT_draw_instanced ------------------------- */ + +#ifndef GL_EXT_draw_instanced +#define GL_EXT_draw_instanced 1 + +typedef void (GLAPIENTRY * PFNGLDRAWARRAYSINSTANCEDEXTPROC) (GLenum mode, GLint start, GLsizei count, GLsizei primcount); +typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDEXTPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount); + +#define glDrawArraysInstancedEXT GLEW_GET_FUN(__glewDrawArraysInstancedEXT) +#define glDrawElementsInstancedEXT GLEW_GET_FUN(__glewDrawElementsInstancedEXT) + +#define GLEW_EXT_draw_instanced GLEW_GET_VAR(__GLEW_EXT_draw_instanced) + +#endif /* GL_EXT_draw_instanced */ + +/* ----------------------- GL_EXT_draw_range_elements ---------------------- */ + +#ifndef GL_EXT_draw_range_elements +#define GL_EXT_draw_range_elements 1 + +#define GL_MAX_ELEMENTS_VERTICES_EXT 0x80E8 +#define GL_MAX_ELEMENTS_INDICES_EXT 0x80E9 + +typedef void (GLAPIENTRY * PFNGLDRAWRANGEELEMENTSEXTPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices); + +#define glDrawRangeElementsEXT GLEW_GET_FUN(__glewDrawRangeElementsEXT) + +#define GLEW_EXT_draw_range_elements GLEW_GET_VAR(__GLEW_EXT_draw_range_elements) + +#endif /* GL_EXT_draw_range_elements */ + +/* ---------------------------- GL_EXT_fog_coord --------------------------- */ + +#ifndef GL_EXT_fog_coord +#define GL_EXT_fog_coord 1 + +#define GL_FOG_COORDINATE_SOURCE_EXT 0x8450 +#define GL_FOG_COORDINATE_EXT 0x8451 +#define GL_FRAGMENT_DEPTH_EXT 0x8452 +#define GL_CURRENT_FOG_COORDINATE_EXT 0x8453 +#define GL_FOG_COORDINATE_ARRAY_TYPE_EXT 0x8454 +#define GL_FOG_COORDINATE_ARRAY_STRIDE_EXT 0x8455 +#define GL_FOG_COORDINATE_ARRAY_POINTER_EXT 0x8456 +#define GL_FOG_COORDINATE_ARRAY_EXT 0x8457 + +typedef void (GLAPIENTRY * PFNGLFOGCOORDPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid *pointer); +typedef void (GLAPIENTRY * PFNGLFOGCOORDDEXTPROC) (GLdouble coord); +typedef void (GLAPIENTRY * PFNGLFOGCOORDDVEXTPROC) (const GLdouble *coord); +typedef void (GLAPIENTRY * PFNGLFOGCOORDFEXTPROC) (GLfloat coord); +typedef void (GLAPIENTRY * PFNGLFOGCOORDFVEXTPROC) (const GLfloat *coord); + +#define glFogCoordPointerEXT GLEW_GET_FUN(__glewFogCoordPointerEXT) +#define glFogCoorddEXT GLEW_GET_FUN(__glewFogCoorddEXT) +#define glFogCoorddvEXT GLEW_GET_FUN(__glewFogCoorddvEXT) +#define glFogCoordfEXT GLEW_GET_FUN(__glewFogCoordfEXT) +#define glFogCoordfvEXT GLEW_GET_FUN(__glewFogCoordfvEXT) + +#define GLEW_EXT_fog_coord GLEW_GET_VAR(__GLEW_EXT_fog_coord) + +#endif /* GL_EXT_fog_coord */ + +/* ------------------------ GL_EXT_fragment_lighting ----------------------- */ + +#ifndef GL_EXT_fragment_lighting +#define GL_EXT_fragment_lighting 1 + +#define GL_FRAGMENT_LIGHTING_EXT 0x8400 +#define GL_FRAGMENT_COLOR_MATERIAL_EXT 0x8401 +#define GL_FRAGMENT_COLOR_MATERIAL_FACE_EXT 0x8402 +#define GL_FRAGMENT_COLOR_MATERIAL_PARAMETER_EXT 0x8403 +#define GL_MAX_FRAGMENT_LIGHTS_EXT 0x8404 +#define GL_MAX_ACTIVE_LIGHTS_EXT 0x8405 +#define GL_CURRENT_RASTER_NORMAL_EXT 0x8406 +#define GL_LIGHT_ENV_MODE_EXT 0x8407 +#define GL_FRAGMENT_LIGHT_MODEL_LOCAL_VIEWER_EXT 0x8408 +#define GL_FRAGMENT_LIGHT_MODEL_TWO_SIDE_EXT 0x8409 +#define GL_FRAGMENT_LIGHT_MODEL_AMBIENT_EXT 0x840A +#define GL_FRAGMENT_LIGHT_MODEL_NORMAL_INTERPOLATION_EXT 0x840B +#define GL_FRAGMENT_LIGHT0_EXT 0x840C +#define GL_FRAGMENT_LIGHT7_EXT 0x8413 + +typedef void (GLAPIENTRY * PFNGLFRAGMENTCOLORMATERIALEXTPROC) (GLenum face, GLenum mode); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELFEXTPROC) (GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELFVEXTPROC) (GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELIEXTPROC) (GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELIVEXTPROC) (GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTFEXTPROC) (GLenum light, GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTFVEXTPROC) (GLenum light, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTIEXTPROC) (GLenum light, GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTIVEXTPROC) (GLenum light, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALFEXTPROC) (GLenum face, GLenum pname, const GLfloat param); +typedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALFVEXTPROC) (GLenum face, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALIEXTPROC) (GLenum face, GLenum pname, const GLint param); +typedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALIVEXTPROC) (GLenum face, GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLGETFRAGMENTLIGHTFVEXTPROC) (GLenum light, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETFRAGMENTLIGHTIVEXTPROC) (GLenum light, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETFRAGMENTMATERIALFVEXTPROC) (GLenum face, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETFRAGMENTMATERIALIVEXTPROC) (GLenum face, GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLLIGHTENVIEXTPROC) (GLenum pname, GLint param); + +#define glFragmentColorMaterialEXT GLEW_GET_FUN(__glewFragmentColorMaterialEXT) +#define glFragmentLightModelfEXT GLEW_GET_FUN(__glewFragmentLightModelfEXT) +#define glFragmentLightModelfvEXT GLEW_GET_FUN(__glewFragmentLightModelfvEXT) +#define glFragmentLightModeliEXT GLEW_GET_FUN(__glewFragmentLightModeliEXT) +#define glFragmentLightModelivEXT GLEW_GET_FUN(__glewFragmentLightModelivEXT) +#define glFragmentLightfEXT GLEW_GET_FUN(__glewFragmentLightfEXT) +#define glFragmentLightfvEXT GLEW_GET_FUN(__glewFragmentLightfvEXT) +#define glFragmentLightiEXT GLEW_GET_FUN(__glewFragmentLightiEXT) +#define glFragmentLightivEXT GLEW_GET_FUN(__glewFragmentLightivEXT) +#define glFragmentMaterialfEXT GLEW_GET_FUN(__glewFragmentMaterialfEXT) +#define glFragmentMaterialfvEXT GLEW_GET_FUN(__glewFragmentMaterialfvEXT) +#define glFragmentMaterialiEXT GLEW_GET_FUN(__glewFragmentMaterialiEXT) +#define glFragmentMaterialivEXT GLEW_GET_FUN(__glewFragmentMaterialivEXT) +#define glGetFragmentLightfvEXT GLEW_GET_FUN(__glewGetFragmentLightfvEXT) +#define glGetFragmentLightivEXT GLEW_GET_FUN(__glewGetFragmentLightivEXT) +#define glGetFragmentMaterialfvEXT GLEW_GET_FUN(__glewGetFragmentMaterialfvEXT) +#define glGetFragmentMaterialivEXT GLEW_GET_FUN(__glewGetFragmentMaterialivEXT) +#define glLightEnviEXT GLEW_GET_FUN(__glewLightEnviEXT) + +#define GLEW_EXT_fragment_lighting GLEW_GET_VAR(__GLEW_EXT_fragment_lighting) + +#endif /* GL_EXT_fragment_lighting */ + +/* ------------------------ GL_EXT_framebuffer_blit ------------------------ */ + +#ifndef GL_EXT_framebuffer_blit +#define GL_EXT_framebuffer_blit 1 + +#define GL_DRAW_FRAMEBUFFER_BINDING_EXT 0x8CA6 +#define GL_READ_FRAMEBUFFER_EXT 0x8CA8 +#define GL_DRAW_FRAMEBUFFER_EXT 0x8CA9 +#define GL_READ_FRAMEBUFFER_BINDING_EXT 0x8CAA + +typedef void (GLAPIENTRY * PFNGLBLITFRAMEBUFFEREXTPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); + +#define glBlitFramebufferEXT GLEW_GET_FUN(__glewBlitFramebufferEXT) + +#define GLEW_EXT_framebuffer_blit GLEW_GET_VAR(__GLEW_EXT_framebuffer_blit) + +#endif /* GL_EXT_framebuffer_blit */ + +/* --------------------- GL_EXT_framebuffer_multisample -------------------- */ + +#ifndef GL_EXT_framebuffer_multisample +#define GL_EXT_framebuffer_multisample 1 + +#define GL_RENDERBUFFER_SAMPLES_EXT 0x8CAB +#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT 0x8D56 +#define GL_MAX_SAMPLES_EXT 0x8D57 + +typedef void (GLAPIENTRY * PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); + +#define glRenderbufferStorageMultisampleEXT GLEW_GET_FUN(__glewRenderbufferStorageMultisampleEXT) + +#define GLEW_EXT_framebuffer_multisample GLEW_GET_VAR(__GLEW_EXT_framebuffer_multisample) + +#endif /* GL_EXT_framebuffer_multisample */ + +/* --------------- GL_EXT_framebuffer_multisample_blit_scaled -------------- */ + +#ifndef GL_EXT_framebuffer_multisample_blit_scaled +#define GL_EXT_framebuffer_multisample_blit_scaled 1 + +#define GL_SCALED_RESOLVE_FASTEST_EXT 0x90BA +#define GL_SCALED_RESOLVE_NICEST_EXT 0x90BB + +#define GLEW_EXT_framebuffer_multisample_blit_scaled GLEW_GET_VAR(__GLEW_EXT_framebuffer_multisample_blit_scaled) + +#endif /* GL_EXT_framebuffer_multisample_blit_scaled */ + +/* ----------------------- GL_EXT_framebuffer_object ----------------------- */ + +#ifndef GL_EXT_framebuffer_object +#define GL_EXT_framebuffer_object 1 + +#define GL_INVALID_FRAMEBUFFER_OPERATION_EXT 0x0506 +#define GL_MAX_RENDERBUFFER_SIZE_EXT 0x84E8 +#define GL_FRAMEBUFFER_BINDING_EXT 0x8CA6 +#define GL_RENDERBUFFER_BINDING_EXT 0x8CA7 +#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT 0x8CD0 +#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT 0x8CD1 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT 0x8CD2 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT 0x8CD3 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT 0x8CD4 +#define GL_FRAMEBUFFER_COMPLETE_EXT 0x8CD5 +#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT 0x8CD6 +#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT 0x8CD7 +#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT 0x8CD9 +#define GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT 0x8CDA +#define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT 0x8CDB +#define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT 0x8CDC +#define GL_FRAMEBUFFER_UNSUPPORTED_EXT 0x8CDD +#define GL_MAX_COLOR_ATTACHMENTS_EXT 0x8CDF +#define GL_COLOR_ATTACHMENT0_EXT 0x8CE0 +#define GL_COLOR_ATTACHMENT1_EXT 0x8CE1 +#define GL_COLOR_ATTACHMENT2_EXT 0x8CE2 +#define GL_COLOR_ATTACHMENT3_EXT 0x8CE3 +#define GL_COLOR_ATTACHMENT4_EXT 0x8CE4 +#define GL_COLOR_ATTACHMENT5_EXT 0x8CE5 +#define GL_COLOR_ATTACHMENT6_EXT 0x8CE6 +#define GL_COLOR_ATTACHMENT7_EXT 0x8CE7 +#define GL_COLOR_ATTACHMENT8_EXT 0x8CE8 +#define GL_COLOR_ATTACHMENT9_EXT 0x8CE9 +#define GL_COLOR_ATTACHMENT10_EXT 0x8CEA +#define GL_COLOR_ATTACHMENT11_EXT 0x8CEB +#define GL_COLOR_ATTACHMENT12_EXT 0x8CEC +#define GL_COLOR_ATTACHMENT13_EXT 0x8CED +#define GL_COLOR_ATTACHMENT14_EXT 0x8CEE +#define GL_COLOR_ATTACHMENT15_EXT 0x8CEF +#define GL_DEPTH_ATTACHMENT_EXT 0x8D00 +#define GL_STENCIL_ATTACHMENT_EXT 0x8D20 +#define GL_FRAMEBUFFER_EXT 0x8D40 +#define GL_RENDERBUFFER_EXT 0x8D41 +#define GL_RENDERBUFFER_WIDTH_EXT 0x8D42 +#define GL_RENDERBUFFER_HEIGHT_EXT 0x8D43 +#define GL_RENDERBUFFER_INTERNAL_FORMAT_EXT 0x8D44 +#define GL_STENCIL_INDEX1_EXT 0x8D46 +#define GL_STENCIL_INDEX4_EXT 0x8D47 +#define GL_STENCIL_INDEX8_EXT 0x8D48 +#define GL_STENCIL_INDEX16_EXT 0x8D49 +#define GL_RENDERBUFFER_RED_SIZE_EXT 0x8D50 +#define GL_RENDERBUFFER_GREEN_SIZE_EXT 0x8D51 +#define GL_RENDERBUFFER_BLUE_SIZE_EXT 0x8D52 +#define GL_RENDERBUFFER_ALPHA_SIZE_EXT 0x8D53 +#define GL_RENDERBUFFER_DEPTH_SIZE_EXT 0x8D54 +#define GL_RENDERBUFFER_STENCIL_SIZE_EXT 0x8D55 + +typedef void (GLAPIENTRY * PFNGLBINDFRAMEBUFFEREXTPROC) (GLenum target, GLuint framebuffer); +typedef void (GLAPIENTRY * PFNGLBINDRENDERBUFFEREXTPROC) (GLenum target, GLuint renderbuffer); +typedef GLenum (GLAPIENTRY * PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC) (GLenum target); +typedef void (GLAPIENTRY * PFNGLDELETEFRAMEBUFFERSEXTPROC) (GLsizei n, const GLuint* framebuffers); +typedef void (GLAPIENTRY * PFNGLDELETERENDERBUFFERSEXTPROC) (GLsizei n, const GLuint* renderbuffers); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURE1DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURE2DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURE3DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); +typedef void (GLAPIENTRY * PFNGLGENFRAMEBUFFERSEXTPROC) (GLsizei n, GLuint* framebuffers); +typedef void (GLAPIENTRY * PFNGLGENRENDERBUFFERSEXTPROC) (GLsizei n, GLuint* renderbuffers); +typedef void (GLAPIENTRY * PFNGLGENERATEMIPMAPEXTPROC) (GLenum target); +typedef void (GLAPIENTRY * PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC) (GLenum target, GLenum attachment, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint* params); +typedef GLboolean (GLAPIENTRY * PFNGLISFRAMEBUFFEREXTPROC) (GLuint framebuffer); +typedef GLboolean (GLAPIENTRY * PFNGLISRENDERBUFFEREXTPROC) (GLuint renderbuffer); +typedef void (GLAPIENTRY * PFNGLRENDERBUFFERSTORAGEEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height); + +#define glBindFramebufferEXT GLEW_GET_FUN(__glewBindFramebufferEXT) +#define glBindRenderbufferEXT GLEW_GET_FUN(__glewBindRenderbufferEXT) +#define glCheckFramebufferStatusEXT GLEW_GET_FUN(__glewCheckFramebufferStatusEXT) +#define glDeleteFramebuffersEXT GLEW_GET_FUN(__glewDeleteFramebuffersEXT) +#define glDeleteRenderbuffersEXT GLEW_GET_FUN(__glewDeleteRenderbuffersEXT) +#define glFramebufferRenderbufferEXT GLEW_GET_FUN(__glewFramebufferRenderbufferEXT) +#define glFramebufferTexture1DEXT GLEW_GET_FUN(__glewFramebufferTexture1DEXT) +#define glFramebufferTexture2DEXT GLEW_GET_FUN(__glewFramebufferTexture2DEXT) +#define glFramebufferTexture3DEXT GLEW_GET_FUN(__glewFramebufferTexture3DEXT) +#define glGenFramebuffersEXT GLEW_GET_FUN(__glewGenFramebuffersEXT) +#define glGenRenderbuffersEXT GLEW_GET_FUN(__glewGenRenderbuffersEXT) +#define glGenerateMipmapEXT GLEW_GET_FUN(__glewGenerateMipmapEXT) +#define glGetFramebufferAttachmentParameterivEXT GLEW_GET_FUN(__glewGetFramebufferAttachmentParameterivEXT) +#define glGetRenderbufferParameterivEXT GLEW_GET_FUN(__glewGetRenderbufferParameterivEXT) +#define glIsFramebufferEXT GLEW_GET_FUN(__glewIsFramebufferEXT) +#define glIsRenderbufferEXT GLEW_GET_FUN(__glewIsRenderbufferEXT) +#define glRenderbufferStorageEXT GLEW_GET_FUN(__glewRenderbufferStorageEXT) + +#define GLEW_EXT_framebuffer_object GLEW_GET_VAR(__GLEW_EXT_framebuffer_object) + +#endif /* GL_EXT_framebuffer_object */ + +/* ------------------------ GL_EXT_framebuffer_sRGB ------------------------ */ + +#ifndef GL_EXT_framebuffer_sRGB +#define GL_EXT_framebuffer_sRGB 1 + +#define GL_FRAMEBUFFER_SRGB_EXT 0x8DB9 +#define GL_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x8DBA + +#define GLEW_EXT_framebuffer_sRGB GLEW_GET_VAR(__GLEW_EXT_framebuffer_sRGB) + +#endif /* GL_EXT_framebuffer_sRGB */ + +/* ------------------------ GL_EXT_geometry_shader4 ------------------------ */ + +#ifndef GL_EXT_geometry_shader4 +#define GL_EXT_geometry_shader4 1 + +#define GL_LINES_ADJACENCY_EXT 0xA +#define GL_LINE_STRIP_ADJACENCY_EXT 0xB +#define GL_TRIANGLES_ADJACENCY_EXT 0xC +#define GL_TRIANGLE_STRIP_ADJACENCY_EXT 0xD +#define GL_PROGRAM_POINT_SIZE_EXT 0x8642 +#define GL_MAX_VARYING_COMPONENTS_EXT 0x8B4B +#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_EXT 0x8C29 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT 0x8CD4 +#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED_EXT 0x8DA7 +#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_EXT 0x8DA8 +#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_EXT 0x8DA9 +#define GL_GEOMETRY_SHADER_EXT 0x8DD9 +#define GL_GEOMETRY_VERTICES_OUT_EXT 0x8DDA +#define GL_GEOMETRY_INPUT_TYPE_EXT 0x8DDB +#define GL_GEOMETRY_OUTPUT_TYPE_EXT 0x8DDC +#define GL_MAX_GEOMETRY_VARYING_COMPONENTS_EXT 0x8DDD +#define GL_MAX_VERTEX_VARYING_COMPONENTS_EXT 0x8DDE +#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_EXT 0x8DDF +#define GL_MAX_GEOMETRY_OUTPUT_VERTICES_EXT 0x8DE0 +#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_EXT 0x8DE1 + +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTUREEXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTUREFACEEXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face); +typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETERIEXTPROC) (GLuint program, GLenum pname, GLint value); + +#define glFramebufferTextureEXT GLEW_GET_FUN(__glewFramebufferTextureEXT) +#define glFramebufferTextureFaceEXT GLEW_GET_FUN(__glewFramebufferTextureFaceEXT) +#define glProgramParameteriEXT GLEW_GET_FUN(__glewProgramParameteriEXT) + +#define GLEW_EXT_geometry_shader4 GLEW_GET_VAR(__GLEW_EXT_geometry_shader4) + +#endif /* GL_EXT_geometry_shader4 */ + +/* --------------------- GL_EXT_gpu_program_parameters --------------------- */ + +#ifndef GL_EXT_gpu_program_parameters +#define GL_EXT_gpu_program_parameters 1 + +typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETERS4FVEXTPROC) (GLenum target, GLuint index, GLsizei count, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETERS4FVEXTPROC) (GLenum target, GLuint index, GLsizei count, const GLfloat* params); + +#define glProgramEnvParameters4fvEXT GLEW_GET_FUN(__glewProgramEnvParameters4fvEXT) +#define glProgramLocalParameters4fvEXT GLEW_GET_FUN(__glewProgramLocalParameters4fvEXT) + +#define GLEW_EXT_gpu_program_parameters GLEW_GET_VAR(__GLEW_EXT_gpu_program_parameters) + +#endif /* GL_EXT_gpu_program_parameters */ + +/* --------------------------- GL_EXT_gpu_shader4 -------------------------- */ + +#ifndef GL_EXT_gpu_shader4 +#define GL_EXT_gpu_shader4 1 + +#define GL_VERTEX_ATTRIB_ARRAY_INTEGER_EXT 0x88FD +#define GL_SAMPLER_1D_ARRAY_EXT 0x8DC0 +#define GL_SAMPLER_2D_ARRAY_EXT 0x8DC1 +#define GL_SAMPLER_BUFFER_EXT 0x8DC2 +#define GL_SAMPLER_1D_ARRAY_SHADOW_EXT 0x8DC3 +#define GL_SAMPLER_2D_ARRAY_SHADOW_EXT 0x8DC4 +#define GL_SAMPLER_CUBE_SHADOW_EXT 0x8DC5 +#define GL_UNSIGNED_INT_VEC2_EXT 0x8DC6 +#define GL_UNSIGNED_INT_VEC3_EXT 0x8DC7 +#define GL_UNSIGNED_INT_VEC4_EXT 0x8DC8 +#define GL_INT_SAMPLER_1D_EXT 0x8DC9 +#define GL_INT_SAMPLER_2D_EXT 0x8DCA +#define GL_INT_SAMPLER_3D_EXT 0x8DCB +#define GL_INT_SAMPLER_CUBE_EXT 0x8DCC +#define GL_INT_SAMPLER_2D_RECT_EXT 0x8DCD +#define GL_INT_SAMPLER_1D_ARRAY_EXT 0x8DCE +#define GL_INT_SAMPLER_2D_ARRAY_EXT 0x8DCF +#define GL_INT_SAMPLER_BUFFER_EXT 0x8DD0 +#define GL_UNSIGNED_INT_SAMPLER_1D_EXT 0x8DD1 +#define GL_UNSIGNED_INT_SAMPLER_2D_EXT 0x8DD2 +#define GL_UNSIGNED_INT_SAMPLER_3D_EXT 0x8DD3 +#define GL_UNSIGNED_INT_SAMPLER_CUBE_EXT 0x8DD4 +#define GL_UNSIGNED_INT_SAMPLER_2D_RECT_EXT 0x8DD5 +#define GL_UNSIGNED_INT_SAMPLER_1D_ARRAY_EXT 0x8DD6 +#define GL_UNSIGNED_INT_SAMPLER_2D_ARRAY_EXT 0x8DD7 +#define GL_UNSIGNED_INT_SAMPLER_BUFFER_EXT 0x8DD8 + +typedef void (GLAPIENTRY * PFNGLBINDFRAGDATALOCATIONEXTPROC) (GLuint program, GLuint color, const GLchar *name); +typedef GLint (GLAPIENTRY * PFNGLGETFRAGDATALOCATIONEXTPROC) (GLuint program, const GLchar *name); +typedef void (GLAPIENTRY * PFNGLGETUNIFORMUIVEXTPROC) (GLuint program, GLint location, GLuint *params); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBIIVEXTPROC) (GLuint index, GLenum pname, GLint *params); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBIUIVEXTPROC) (GLuint index, GLenum pname, GLuint *params); +typedef void (GLAPIENTRY * PFNGLUNIFORM1UIEXTPROC) (GLint location, GLuint v0); +typedef void (GLAPIENTRY * PFNGLUNIFORM1UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value); +typedef void (GLAPIENTRY * PFNGLUNIFORM2UIEXTPROC) (GLint location, GLuint v0, GLuint v1); +typedef void (GLAPIENTRY * PFNGLUNIFORM2UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value); +typedef void (GLAPIENTRY * PFNGLUNIFORM3UIEXTPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2); +typedef void (GLAPIENTRY * PFNGLUNIFORM3UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value); +typedef void (GLAPIENTRY * PFNGLUNIFORM4UIEXTPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); +typedef void (GLAPIENTRY * PFNGLUNIFORM4UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1IEXTPROC) (GLuint index, GLint x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1IVEXTPROC) (GLuint index, const GLint *v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1UIEXTPROC) (GLuint index, GLuint x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1UIVEXTPROC) (GLuint index, const GLuint *v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2IEXTPROC) (GLuint index, GLint x, GLint y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2IVEXTPROC) (GLuint index, const GLint *v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2UIEXTPROC) (GLuint index, GLuint x, GLuint y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2UIVEXTPROC) (GLuint index, const GLuint *v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3IEXTPROC) (GLuint index, GLint x, GLint y, GLint z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3IVEXTPROC) (GLuint index, const GLint *v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3UIEXTPROC) (GLuint index, GLuint x, GLuint y, GLuint z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3UIVEXTPROC) (GLuint index, const GLuint *v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4BVEXTPROC) (GLuint index, const GLbyte *v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4IEXTPROC) (GLuint index, GLint x, GLint y, GLint z, GLint w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4IVEXTPROC) (GLuint index, const GLint *v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4SVEXTPROC) (GLuint index, const GLshort *v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4UBVEXTPROC) (GLuint index, const GLubyte *v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4UIEXTPROC) (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4UIVEXTPROC) (GLuint index, const GLuint *v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4USVEXTPROC) (GLuint index, const GLushort *v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBIPOINTEREXTPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); + +#define glBindFragDataLocationEXT GLEW_GET_FUN(__glewBindFragDataLocationEXT) +#define glGetFragDataLocationEXT GLEW_GET_FUN(__glewGetFragDataLocationEXT) +#define glGetUniformuivEXT GLEW_GET_FUN(__glewGetUniformuivEXT) +#define glGetVertexAttribIivEXT GLEW_GET_FUN(__glewGetVertexAttribIivEXT) +#define glGetVertexAttribIuivEXT GLEW_GET_FUN(__glewGetVertexAttribIuivEXT) +#define glUniform1uiEXT GLEW_GET_FUN(__glewUniform1uiEXT) +#define glUniform1uivEXT GLEW_GET_FUN(__glewUniform1uivEXT) +#define glUniform2uiEXT GLEW_GET_FUN(__glewUniform2uiEXT) +#define glUniform2uivEXT GLEW_GET_FUN(__glewUniform2uivEXT) +#define glUniform3uiEXT GLEW_GET_FUN(__glewUniform3uiEXT) +#define glUniform3uivEXT GLEW_GET_FUN(__glewUniform3uivEXT) +#define glUniform4uiEXT GLEW_GET_FUN(__glewUniform4uiEXT) +#define glUniform4uivEXT GLEW_GET_FUN(__glewUniform4uivEXT) +#define glVertexAttribI1iEXT GLEW_GET_FUN(__glewVertexAttribI1iEXT) +#define glVertexAttribI1ivEXT GLEW_GET_FUN(__glewVertexAttribI1ivEXT) +#define glVertexAttribI1uiEXT GLEW_GET_FUN(__glewVertexAttribI1uiEXT) +#define glVertexAttribI1uivEXT GLEW_GET_FUN(__glewVertexAttribI1uivEXT) +#define glVertexAttribI2iEXT GLEW_GET_FUN(__glewVertexAttribI2iEXT) +#define glVertexAttribI2ivEXT GLEW_GET_FUN(__glewVertexAttribI2ivEXT) +#define glVertexAttribI2uiEXT GLEW_GET_FUN(__glewVertexAttribI2uiEXT) +#define glVertexAttribI2uivEXT GLEW_GET_FUN(__glewVertexAttribI2uivEXT) +#define glVertexAttribI3iEXT GLEW_GET_FUN(__glewVertexAttribI3iEXT) +#define glVertexAttribI3ivEXT GLEW_GET_FUN(__glewVertexAttribI3ivEXT) +#define glVertexAttribI3uiEXT GLEW_GET_FUN(__glewVertexAttribI3uiEXT) +#define glVertexAttribI3uivEXT GLEW_GET_FUN(__glewVertexAttribI3uivEXT) +#define glVertexAttribI4bvEXT GLEW_GET_FUN(__glewVertexAttribI4bvEXT) +#define glVertexAttribI4iEXT GLEW_GET_FUN(__glewVertexAttribI4iEXT) +#define glVertexAttribI4ivEXT GLEW_GET_FUN(__glewVertexAttribI4ivEXT) +#define glVertexAttribI4svEXT GLEW_GET_FUN(__glewVertexAttribI4svEXT) +#define glVertexAttribI4ubvEXT GLEW_GET_FUN(__glewVertexAttribI4ubvEXT) +#define glVertexAttribI4uiEXT GLEW_GET_FUN(__glewVertexAttribI4uiEXT) +#define glVertexAttribI4uivEXT GLEW_GET_FUN(__glewVertexAttribI4uivEXT) +#define glVertexAttribI4usvEXT GLEW_GET_FUN(__glewVertexAttribI4usvEXT) +#define glVertexAttribIPointerEXT GLEW_GET_FUN(__glewVertexAttribIPointerEXT) + +#define GLEW_EXT_gpu_shader4 GLEW_GET_VAR(__GLEW_EXT_gpu_shader4) + +#endif /* GL_EXT_gpu_shader4 */ + +/* ---------------------------- GL_EXT_histogram --------------------------- */ + +#ifndef GL_EXT_histogram +#define GL_EXT_histogram 1 + +#define GL_HISTOGRAM_EXT 0x8024 +#define GL_PROXY_HISTOGRAM_EXT 0x8025 +#define GL_HISTOGRAM_WIDTH_EXT 0x8026 +#define GL_HISTOGRAM_FORMAT_EXT 0x8027 +#define GL_HISTOGRAM_RED_SIZE_EXT 0x8028 +#define GL_HISTOGRAM_GREEN_SIZE_EXT 0x8029 +#define GL_HISTOGRAM_BLUE_SIZE_EXT 0x802A +#define GL_HISTOGRAM_ALPHA_SIZE_EXT 0x802B +#define GL_HISTOGRAM_LUMINANCE_SIZE_EXT 0x802C +#define GL_HISTOGRAM_SINK_EXT 0x802D +#define GL_MINMAX_EXT 0x802E +#define GL_MINMAX_FORMAT_EXT 0x802F +#define GL_MINMAX_SINK_EXT 0x8030 + +typedef void (GLAPIENTRY * PFNGLGETHISTOGRAMEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); +typedef void (GLAPIENTRY * PFNGLGETHISTOGRAMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETHISTOGRAMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETMINMAXEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); +typedef void (GLAPIENTRY * PFNGLGETMINMAXPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETMINMAXPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLHISTOGRAMEXTPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); +typedef void (GLAPIENTRY * PFNGLMINMAXEXTPROC) (GLenum target, GLenum internalformat, GLboolean sink); +typedef void (GLAPIENTRY * PFNGLRESETHISTOGRAMEXTPROC) (GLenum target); +typedef void (GLAPIENTRY * PFNGLRESETMINMAXEXTPROC) (GLenum target); + +#define glGetHistogramEXT GLEW_GET_FUN(__glewGetHistogramEXT) +#define glGetHistogramParameterfvEXT GLEW_GET_FUN(__glewGetHistogramParameterfvEXT) +#define glGetHistogramParameterivEXT GLEW_GET_FUN(__glewGetHistogramParameterivEXT) +#define glGetMinmaxEXT GLEW_GET_FUN(__glewGetMinmaxEXT) +#define glGetMinmaxParameterfvEXT GLEW_GET_FUN(__glewGetMinmaxParameterfvEXT) +#define glGetMinmaxParameterivEXT GLEW_GET_FUN(__glewGetMinmaxParameterivEXT) +#define glHistogramEXT GLEW_GET_FUN(__glewHistogramEXT) +#define glMinmaxEXT GLEW_GET_FUN(__glewMinmaxEXT) +#define glResetHistogramEXT GLEW_GET_FUN(__glewResetHistogramEXT) +#define glResetMinmaxEXT GLEW_GET_FUN(__glewResetMinmaxEXT) + +#define GLEW_EXT_histogram GLEW_GET_VAR(__GLEW_EXT_histogram) + +#endif /* GL_EXT_histogram */ + +/* ----------------------- GL_EXT_index_array_formats ---------------------- */ + +#ifndef GL_EXT_index_array_formats +#define GL_EXT_index_array_formats 1 + +#define GLEW_EXT_index_array_formats GLEW_GET_VAR(__GLEW_EXT_index_array_formats) + +#endif /* GL_EXT_index_array_formats */ + +/* --------------------------- GL_EXT_index_func --------------------------- */ + +#ifndef GL_EXT_index_func +#define GL_EXT_index_func 1 + +typedef void (GLAPIENTRY * PFNGLINDEXFUNCEXTPROC) (GLenum func, GLfloat ref); + +#define glIndexFuncEXT GLEW_GET_FUN(__glewIndexFuncEXT) + +#define GLEW_EXT_index_func GLEW_GET_VAR(__GLEW_EXT_index_func) + +#endif /* GL_EXT_index_func */ + +/* ------------------------- GL_EXT_index_material ------------------------- */ + +#ifndef GL_EXT_index_material +#define GL_EXT_index_material 1 + +typedef void (GLAPIENTRY * PFNGLINDEXMATERIALEXTPROC) (GLenum face, GLenum mode); + +#define glIndexMaterialEXT GLEW_GET_FUN(__glewIndexMaterialEXT) + +#define GLEW_EXT_index_material GLEW_GET_VAR(__GLEW_EXT_index_material) + +#endif /* GL_EXT_index_material */ + +/* -------------------------- GL_EXT_index_texture ------------------------- */ + +#ifndef GL_EXT_index_texture +#define GL_EXT_index_texture 1 + +#define GLEW_EXT_index_texture GLEW_GET_VAR(__GLEW_EXT_index_texture) + +#endif /* GL_EXT_index_texture */ + +/* -------------------------- GL_EXT_light_texture ------------------------- */ + +#ifndef GL_EXT_light_texture +#define GL_EXT_light_texture 1 + +#define GL_FRAGMENT_MATERIAL_EXT 0x8349 +#define GL_FRAGMENT_NORMAL_EXT 0x834A +#define GL_FRAGMENT_COLOR_EXT 0x834C +#define GL_ATTENUATION_EXT 0x834D +#define GL_SHADOW_ATTENUATION_EXT 0x834E +#define GL_TEXTURE_APPLICATION_MODE_EXT 0x834F +#define GL_TEXTURE_LIGHT_EXT 0x8350 +#define GL_TEXTURE_MATERIAL_FACE_EXT 0x8351 +#define GL_TEXTURE_MATERIAL_PARAMETER_EXT 0x8352 + +typedef void (GLAPIENTRY * PFNGLAPPLYTEXTUREEXTPROC) (GLenum mode); +typedef void (GLAPIENTRY * PFNGLTEXTURELIGHTEXTPROC) (GLenum pname); +typedef void (GLAPIENTRY * PFNGLTEXTUREMATERIALEXTPROC) (GLenum face, GLenum mode); + +#define glApplyTextureEXT GLEW_GET_FUN(__glewApplyTextureEXT) +#define glTextureLightEXT GLEW_GET_FUN(__glewTextureLightEXT) +#define glTextureMaterialEXT GLEW_GET_FUN(__glewTextureMaterialEXT) + +#define GLEW_EXT_light_texture GLEW_GET_VAR(__GLEW_EXT_light_texture) + +#endif /* GL_EXT_light_texture */ + +/* ------------------------- GL_EXT_misc_attribute ------------------------- */ + +#ifndef GL_EXT_misc_attribute +#define GL_EXT_misc_attribute 1 + +#define GLEW_EXT_misc_attribute GLEW_GET_VAR(__GLEW_EXT_misc_attribute) + +#endif /* GL_EXT_misc_attribute */ + +/* ------------------------ GL_EXT_multi_draw_arrays ----------------------- */ + +#ifndef GL_EXT_multi_draw_arrays +#define GL_EXT_multi_draw_arrays 1 + +typedef void (GLAPIENTRY * PFNGLMULTIDRAWARRAYSEXTPROC) (GLenum mode, const GLint* first, const GLsizei *count, GLsizei primcount); +typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSEXTPROC) (GLenum mode, GLsizei* count, GLenum type, const GLvoid * const *indices, GLsizei primcount); + +#define glMultiDrawArraysEXT GLEW_GET_FUN(__glewMultiDrawArraysEXT) +#define glMultiDrawElementsEXT GLEW_GET_FUN(__glewMultiDrawElementsEXT) + +#define GLEW_EXT_multi_draw_arrays GLEW_GET_VAR(__GLEW_EXT_multi_draw_arrays) + +#endif /* GL_EXT_multi_draw_arrays */ + +/* --------------------------- GL_EXT_multisample -------------------------- */ + +#ifndef GL_EXT_multisample +#define GL_EXT_multisample 1 + +#define GL_MULTISAMPLE_EXT 0x809D +#define GL_SAMPLE_ALPHA_TO_MASK_EXT 0x809E +#define GL_SAMPLE_ALPHA_TO_ONE_EXT 0x809F +#define GL_SAMPLE_MASK_EXT 0x80A0 +#define GL_1PASS_EXT 0x80A1 +#define GL_2PASS_0_EXT 0x80A2 +#define GL_2PASS_1_EXT 0x80A3 +#define GL_4PASS_0_EXT 0x80A4 +#define GL_4PASS_1_EXT 0x80A5 +#define GL_4PASS_2_EXT 0x80A6 +#define GL_4PASS_3_EXT 0x80A7 +#define GL_SAMPLE_BUFFERS_EXT 0x80A8 +#define GL_SAMPLES_EXT 0x80A9 +#define GL_SAMPLE_MASK_VALUE_EXT 0x80AA +#define GL_SAMPLE_MASK_INVERT_EXT 0x80AB +#define GL_SAMPLE_PATTERN_EXT 0x80AC +#define GL_MULTISAMPLE_BIT_EXT 0x20000000 + +typedef void (GLAPIENTRY * PFNGLSAMPLEMASKEXTPROC) (GLclampf value, GLboolean invert); +typedef void (GLAPIENTRY * PFNGLSAMPLEPATTERNEXTPROC) (GLenum pattern); + +#define glSampleMaskEXT GLEW_GET_FUN(__glewSampleMaskEXT) +#define glSamplePatternEXT GLEW_GET_FUN(__glewSamplePatternEXT) + +#define GLEW_EXT_multisample GLEW_GET_VAR(__GLEW_EXT_multisample) + +#endif /* GL_EXT_multisample */ + +/* ---------------------- GL_EXT_packed_depth_stencil ---------------------- */ + +#ifndef GL_EXT_packed_depth_stencil +#define GL_EXT_packed_depth_stencil 1 + +#define GL_DEPTH_STENCIL_EXT 0x84F9 +#define GL_UNSIGNED_INT_24_8_EXT 0x84FA +#define GL_DEPTH24_STENCIL8_EXT 0x88F0 +#define GL_TEXTURE_STENCIL_SIZE_EXT 0x88F1 + +#define GLEW_EXT_packed_depth_stencil GLEW_GET_VAR(__GLEW_EXT_packed_depth_stencil) + +#endif /* GL_EXT_packed_depth_stencil */ + +/* -------------------------- GL_EXT_packed_float -------------------------- */ + +#ifndef GL_EXT_packed_float +#define GL_EXT_packed_float 1 + +#define GL_R11F_G11F_B10F_EXT 0x8C3A +#define GL_UNSIGNED_INT_10F_11F_11F_REV_EXT 0x8C3B +#define GL_RGBA_SIGNED_COMPONENTS_EXT 0x8C3C + +#define GLEW_EXT_packed_float GLEW_GET_VAR(__GLEW_EXT_packed_float) + +#endif /* GL_EXT_packed_float */ + +/* -------------------------- GL_EXT_packed_pixels ------------------------- */ + +#ifndef GL_EXT_packed_pixels +#define GL_EXT_packed_pixels 1 + +#define GL_UNSIGNED_BYTE_3_3_2_EXT 0x8032 +#define GL_UNSIGNED_SHORT_4_4_4_4_EXT 0x8033 +#define GL_UNSIGNED_SHORT_5_5_5_1_EXT 0x8034 +#define GL_UNSIGNED_INT_8_8_8_8_EXT 0x8035 +#define GL_UNSIGNED_INT_10_10_10_2_EXT 0x8036 + +#define GLEW_EXT_packed_pixels GLEW_GET_VAR(__GLEW_EXT_packed_pixels) + +#endif /* GL_EXT_packed_pixels */ + +/* ------------------------ GL_EXT_paletted_texture ------------------------ */ + +#ifndef GL_EXT_paletted_texture +#define GL_EXT_paletted_texture 1 + +#define GL_TEXTURE_1D 0x0DE0 +#define GL_TEXTURE_2D 0x0DE1 +#define GL_PROXY_TEXTURE_1D 0x8063 +#define GL_PROXY_TEXTURE_2D 0x8064 +#define GL_COLOR_TABLE_FORMAT_EXT 0x80D8 +#define GL_COLOR_TABLE_WIDTH_EXT 0x80D9 +#define GL_COLOR_TABLE_RED_SIZE_EXT 0x80DA +#define GL_COLOR_TABLE_GREEN_SIZE_EXT 0x80DB +#define GL_COLOR_TABLE_BLUE_SIZE_EXT 0x80DC +#define GL_COLOR_TABLE_ALPHA_SIZE_EXT 0x80DD +#define GL_COLOR_TABLE_LUMINANCE_SIZE_EXT 0x80DE +#define GL_COLOR_TABLE_INTENSITY_SIZE_EXT 0x80DF +#define GL_COLOR_INDEX1_EXT 0x80E2 +#define GL_COLOR_INDEX2_EXT 0x80E3 +#define GL_COLOR_INDEX4_EXT 0x80E4 +#define GL_COLOR_INDEX8_EXT 0x80E5 +#define GL_COLOR_INDEX12_EXT 0x80E6 +#define GL_COLOR_INDEX16_EXT 0x80E7 +#define GL_TEXTURE_INDEX_SIZE_EXT 0x80ED +#define GL_TEXTURE_CUBE_MAP_ARB 0x8513 +#define GL_PROXY_TEXTURE_CUBE_MAP_ARB 0x851B + +typedef void (GLAPIENTRY * PFNGLCOLORTABLEEXTPROC) (GLenum target, GLenum internalFormat, GLsizei width, GLenum format, GLenum type, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEEXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *data); +typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint* params); + +#define glColorTableEXT GLEW_GET_FUN(__glewColorTableEXT) +#define glGetColorTableEXT GLEW_GET_FUN(__glewGetColorTableEXT) +#define glGetColorTableParameterfvEXT GLEW_GET_FUN(__glewGetColorTableParameterfvEXT) +#define glGetColorTableParameterivEXT GLEW_GET_FUN(__glewGetColorTableParameterivEXT) + +#define GLEW_EXT_paletted_texture GLEW_GET_VAR(__GLEW_EXT_paletted_texture) + +#endif /* GL_EXT_paletted_texture */ + +/* ----------------------- GL_EXT_pixel_buffer_object ---------------------- */ + +#ifndef GL_EXT_pixel_buffer_object +#define GL_EXT_pixel_buffer_object 1 + +#define GL_PIXEL_PACK_BUFFER_EXT 0x88EB +#define GL_PIXEL_UNPACK_BUFFER_EXT 0x88EC +#define GL_PIXEL_PACK_BUFFER_BINDING_EXT 0x88ED +#define GL_PIXEL_UNPACK_BUFFER_BINDING_EXT 0x88EF + +#define GLEW_EXT_pixel_buffer_object GLEW_GET_VAR(__GLEW_EXT_pixel_buffer_object) + +#endif /* GL_EXT_pixel_buffer_object */ + +/* ------------------------- GL_EXT_pixel_transform ------------------------ */ + +#ifndef GL_EXT_pixel_transform +#define GL_EXT_pixel_transform 1 + +#define GL_PIXEL_TRANSFORM_2D_EXT 0x8330 +#define GL_PIXEL_MAG_FILTER_EXT 0x8331 +#define GL_PIXEL_MIN_FILTER_EXT 0x8332 +#define GL_PIXEL_CUBIC_WEIGHT_EXT 0x8333 +#define GL_CUBIC_EXT 0x8334 +#define GL_AVERAGE_EXT 0x8335 +#define GL_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8336 +#define GL_MAX_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8337 +#define GL_PIXEL_TRANSFORM_2D_MATRIX_EXT 0x8338 + +typedef void (GLAPIENTRY * PFNGLGETPIXELTRANSFORMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETPIXELTRANSFORMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLPIXELTRANSFORMPARAMETERFEXTPROC) (GLenum target, GLenum pname, const GLfloat param); +typedef void (GLAPIENTRY * PFNGLPIXELTRANSFORMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLPIXELTRANSFORMPARAMETERIEXTPROC) (GLenum target, GLenum pname, const GLint param); +typedef void (GLAPIENTRY * PFNGLPIXELTRANSFORMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint* params); + +#define glGetPixelTransformParameterfvEXT GLEW_GET_FUN(__glewGetPixelTransformParameterfvEXT) +#define glGetPixelTransformParameterivEXT GLEW_GET_FUN(__glewGetPixelTransformParameterivEXT) +#define glPixelTransformParameterfEXT GLEW_GET_FUN(__glewPixelTransformParameterfEXT) +#define glPixelTransformParameterfvEXT GLEW_GET_FUN(__glewPixelTransformParameterfvEXT) +#define glPixelTransformParameteriEXT GLEW_GET_FUN(__glewPixelTransformParameteriEXT) +#define glPixelTransformParameterivEXT GLEW_GET_FUN(__glewPixelTransformParameterivEXT) + +#define GLEW_EXT_pixel_transform GLEW_GET_VAR(__GLEW_EXT_pixel_transform) + +#endif /* GL_EXT_pixel_transform */ + +/* ------------------- GL_EXT_pixel_transform_color_table ------------------ */ + +#ifndef GL_EXT_pixel_transform_color_table +#define GL_EXT_pixel_transform_color_table 1 + +#define GLEW_EXT_pixel_transform_color_table GLEW_GET_VAR(__GLEW_EXT_pixel_transform_color_table) + +#endif /* GL_EXT_pixel_transform_color_table */ + +/* ------------------------ GL_EXT_point_parameters ------------------------ */ + +#ifndef GL_EXT_point_parameters +#define GL_EXT_point_parameters 1 + +#define GL_POINT_SIZE_MIN_EXT 0x8126 +#define GL_POINT_SIZE_MAX_EXT 0x8127 +#define GL_POINT_FADE_THRESHOLD_SIZE_EXT 0x8128 +#define GL_DISTANCE_ATTENUATION_EXT 0x8129 + +typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERFEXTPROC) (GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERFVEXTPROC) (GLenum pname, const GLfloat* params); + +#define glPointParameterfEXT GLEW_GET_FUN(__glewPointParameterfEXT) +#define glPointParameterfvEXT GLEW_GET_FUN(__glewPointParameterfvEXT) + +#define GLEW_EXT_point_parameters GLEW_GET_VAR(__GLEW_EXT_point_parameters) + +#endif /* GL_EXT_point_parameters */ + +/* ------------------------- GL_EXT_polygon_offset ------------------------- */ + +#ifndef GL_EXT_polygon_offset +#define GL_EXT_polygon_offset 1 + +#define GL_POLYGON_OFFSET_EXT 0x8037 +#define GL_POLYGON_OFFSET_FACTOR_EXT 0x8038 +#define GL_POLYGON_OFFSET_BIAS_EXT 0x8039 + +typedef void (GLAPIENTRY * PFNGLPOLYGONOFFSETEXTPROC) (GLfloat factor, GLfloat bias); + +#define glPolygonOffsetEXT GLEW_GET_FUN(__glewPolygonOffsetEXT) + +#define GLEW_EXT_polygon_offset GLEW_GET_VAR(__GLEW_EXT_polygon_offset) + +#endif /* GL_EXT_polygon_offset */ + +/* ------------------------ GL_EXT_provoking_vertex ------------------------ */ + +#ifndef GL_EXT_provoking_vertex +#define GL_EXT_provoking_vertex 1 + +#define GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION_EXT 0x8E4C +#define GL_FIRST_VERTEX_CONVENTION_EXT 0x8E4D +#define GL_LAST_VERTEX_CONVENTION_EXT 0x8E4E +#define GL_PROVOKING_VERTEX_EXT 0x8E4F + +typedef void (GLAPIENTRY * PFNGLPROVOKINGVERTEXEXTPROC) (GLenum mode); + +#define glProvokingVertexEXT GLEW_GET_FUN(__glewProvokingVertexEXT) + +#define GLEW_EXT_provoking_vertex GLEW_GET_VAR(__GLEW_EXT_provoking_vertex) + +#endif /* GL_EXT_provoking_vertex */ + +/* ------------------------- GL_EXT_rescale_normal ------------------------- */ + +#ifndef GL_EXT_rescale_normal +#define GL_EXT_rescale_normal 1 + +#define GL_RESCALE_NORMAL_EXT 0x803A + +#define GLEW_EXT_rescale_normal GLEW_GET_VAR(__GLEW_EXT_rescale_normal) + +#endif /* GL_EXT_rescale_normal */ + +/* -------------------------- GL_EXT_scene_marker -------------------------- */ + +#ifndef GL_EXT_scene_marker +#define GL_EXT_scene_marker 1 + +typedef void (GLAPIENTRY * PFNGLBEGINSCENEEXTPROC) (void); +typedef void (GLAPIENTRY * PFNGLENDSCENEEXTPROC) (void); + +#define glBeginSceneEXT GLEW_GET_FUN(__glewBeginSceneEXT) +#define glEndSceneEXT GLEW_GET_FUN(__glewEndSceneEXT) + +#define GLEW_EXT_scene_marker GLEW_GET_VAR(__GLEW_EXT_scene_marker) + +#endif /* GL_EXT_scene_marker */ + +/* ------------------------- GL_EXT_secondary_color ------------------------ */ + +#ifndef GL_EXT_secondary_color +#define GL_EXT_secondary_color 1 + +#define GL_COLOR_SUM_EXT 0x8458 +#define GL_CURRENT_SECONDARY_COLOR_EXT 0x8459 +#define GL_SECONDARY_COLOR_ARRAY_SIZE_EXT 0x845A +#define GL_SECONDARY_COLOR_ARRAY_TYPE_EXT 0x845B +#define GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT 0x845C +#define GL_SECONDARY_COLOR_ARRAY_POINTER_EXT 0x845D +#define GL_SECONDARY_COLOR_ARRAY_EXT 0x845E + +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3BEXTPROC) (GLbyte red, GLbyte green, GLbyte blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3BVEXTPROC) (const GLbyte *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3DEXTPROC) (GLdouble red, GLdouble green, GLdouble blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3DVEXTPROC) (const GLdouble *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3FEXTPROC) (GLfloat red, GLfloat green, GLfloat blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3FVEXTPROC) (const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3IEXTPROC) (GLint red, GLint green, GLint blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3IVEXTPROC) (const GLint *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3SEXTPROC) (GLshort red, GLshort green, GLshort blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3SVEXTPROC) (const GLshort *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UBEXTPROC) (GLubyte red, GLubyte green, GLubyte blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UBVEXTPROC) (const GLubyte *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UIEXTPROC) (GLuint red, GLuint green, GLuint blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UIVEXTPROC) (const GLuint *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3USEXTPROC) (GLushort red, GLushort green, GLushort blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3USVEXTPROC) (const GLushort *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); + +#define glSecondaryColor3bEXT GLEW_GET_FUN(__glewSecondaryColor3bEXT) +#define glSecondaryColor3bvEXT GLEW_GET_FUN(__glewSecondaryColor3bvEXT) +#define glSecondaryColor3dEXT GLEW_GET_FUN(__glewSecondaryColor3dEXT) +#define glSecondaryColor3dvEXT GLEW_GET_FUN(__glewSecondaryColor3dvEXT) +#define glSecondaryColor3fEXT GLEW_GET_FUN(__glewSecondaryColor3fEXT) +#define glSecondaryColor3fvEXT GLEW_GET_FUN(__glewSecondaryColor3fvEXT) +#define glSecondaryColor3iEXT GLEW_GET_FUN(__glewSecondaryColor3iEXT) +#define glSecondaryColor3ivEXT GLEW_GET_FUN(__glewSecondaryColor3ivEXT) +#define glSecondaryColor3sEXT GLEW_GET_FUN(__glewSecondaryColor3sEXT) +#define glSecondaryColor3svEXT GLEW_GET_FUN(__glewSecondaryColor3svEXT) +#define glSecondaryColor3ubEXT GLEW_GET_FUN(__glewSecondaryColor3ubEXT) +#define glSecondaryColor3ubvEXT GLEW_GET_FUN(__glewSecondaryColor3ubvEXT) +#define glSecondaryColor3uiEXT GLEW_GET_FUN(__glewSecondaryColor3uiEXT) +#define glSecondaryColor3uivEXT GLEW_GET_FUN(__glewSecondaryColor3uivEXT) +#define glSecondaryColor3usEXT GLEW_GET_FUN(__glewSecondaryColor3usEXT) +#define glSecondaryColor3usvEXT GLEW_GET_FUN(__glewSecondaryColor3usvEXT) +#define glSecondaryColorPointerEXT GLEW_GET_FUN(__glewSecondaryColorPointerEXT) + +#define GLEW_EXT_secondary_color GLEW_GET_VAR(__GLEW_EXT_secondary_color) + +#endif /* GL_EXT_secondary_color */ + +/* --------------------- GL_EXT_separate_shader_objects -------------------- */ + +#ifndef GL_EXT_separate_shader_objects +#define GL_EXT_separate_shader_objects 1 + +#define GL_ACTIVE_PROGRAM_EXT 0x8B8D + +typedef void (GLAPIENTRY * PFNGLACTIVEPROGRAMEXTPROC) (GLuint program); +typedef GLuint (GLAPIENTRY * PFNGLCREATESHADERPROGRAMEXTPROC) (GLenum type, const GLchar* string); +typedef void (GLAPIENTRY * PFNGLUSESHADERPROGRAMEXTPROC) (GLenum type, GLuint program); + +#define glActiveProgramEXT GLEW_GET_FUN(__glewActiveProgramEXT) +#define glCreateShaderProgramEXT GLEW_GET_FUN(__glewCreateShaderProgramEXT) +#define glUseShaderProgramEXT GLEW_GET_FUN(__glewUseShaderProgramEXT) + +#define GLEW_EXT_separate_shader_objects GLEW_GET_VAR(__GLEW_EXT_separate_shader_objects) + +#endif /* GL_EXT_separate_shader_objects */ + +/* --------------------- GL_EXT_separate_specular_color -------------------- */ + +#ifndef GL_EXT_separate_specular_color +#define GL_EXT_separate_specular_color 1 + +#define GL_LIGHT_MODEL_COLOR_CONTROL_EXT 0x81F8 +#define GL_SINGLE_COLOR_EXT 0x81F9 +#define GL_SEPARATE_SPECULAR_COLOR_EXT 0x81FA + +#define GLEW_EXT_separate_specular_color GLEW_GET_VAR(__GLEW_EXT_separate_specular_color) + +#endif /* GL_EXT_separate_specular_color */ + +/* --------------------- GL_EXT_shader_image_load_store -------------------- */ + +#ifndef GL_EXT_shader_image_load_store +#define GL_EXT_shader_image_load_store 1 + +#define GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT_EXT 0x00000001 +#define GL_ELEMENT_ARRAY_BARRIER_BIT_EXT 0x00000002 +#define GL_UNIFORM_BARRIER_BIT_EXT 0x00000004 +#define GL_TEXTURE_FETCH_BARRIER_BIT_EXT 0x00000008 +#define GL_SHADER_IMAGE_ACCESS_BARRIER_BIT_EXT 0x00000020 +#define GL_COMMAND_BARRIER_BIT_EXT 0x00000040 +#define GL_PIXEL_BUFFER_BARRIER_BIT_EXT 0x00000080 +#define GL_TEXTURE_UPDATE_BARRIER_BIT_EXT 0x00000100 +#define GL_BUFFER_UPDATE_BARRIER_BIT_EXT 0x00000200 +#define GL_FRAMEBUFFER_BARRIER_BIT_EXT 0x00000400 +#define GL_TRANSFORM_FEEDBACK_BARRIER_BIT_EXT 0x00000800 +#define GL_ATOMIC_COUNTER_BARRIER_BIT_EXT 0x00001000 +#define GL_MAX_IMAGE_UNITS_EXT 0x8F38 +#define GL_MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS_EXT 0x8F39 +#define GL_IMAGE_BINDING_NAME_EXT 0x8F3A +#define GL_IMAGE_BINDING_LEVEL_EXT 0x8F3B +#define GL_IMAGE_BINDING_LAYERED_EXT 0x8F3C +#define GL_IMAGE_BINDING_LAYER_EXT 0x8F3D +#define GL_IMAGE_BINDING_ACCESS_EXT 0x8F3E +#define GL_IMAGE_1D_EXT 0x904C +#define GL_IMAGE_2D_EXT 0x904D +#define GL_IMAGE_3D_EXT 0x904E +#define GL_IMAGE_2D_RECT_EXT 0x904F +#define GL_IMAGE_CUBE_EXT 0x9050 +#define GL_IMAGE_BUFFER_EXT 0x9051 +#define GL_IMAGE_1D_ARRAY_EXT 0x9052 +#define GL_IMAGE_2D_ARRAY_EXT 0x9053 +#define GL_IMAGE_CUBE_MAP_ARRAY_EXT 0x9054 +#define GL_IMAGE_2D_MULTISAMPLE_EXT 0x9055 +#define GL_IMAGE_2D_MULTISAMPLE_ARRAY_EXT 0x9056 +#define GL_INT_IMAGE_1D_EXT 0x9057 +#define GL_INT_IMAGE_2D_EXT 0x9058 +#define GL_INT_IMAGE_3D_EXT 0x9059 +#define GL_INT_IMAGE_2D_RECT_EXT 0x905A +#define GL_INT_IMAGE_CUBE_EXT 0x905B +#define GL_INT_IMAGE_BUFFER_EXT 0x905C +#define GL_INT_IMAGE_1D_ARRAY_EXT 0x905D +#define GL_INT_IMAGE_2D_ARRAY_EXT 0x905E +#define GL_INT_IMAGE_CUBE_MAP_ARRAY_EXT 0x905F +#define GL_INT_IMAGE_2D_MULTISAMPLE_EXT 0x9060 +#define GL_INT_IMAGE_2D_MULTISAMPLE_ARRAY_EXT 0x9061 +#define GL_UNSIGNED_INT_IMAGE_1D_EXT 0x9062 +#define GL_UNSIGNED_INT_IMAGE_2D_EXT 0x9063 +#define GL_UNSIGNED_INT_IMAGE_3D_EXT 0x9064 +#define GL_UNSIGNED_INT_IMAGE_2D_RECT_EXT 0x9065 +#define GL_UNSIGNED_INT_IMAGE_CUBE_EXT 0x9066 +#define GL_UNSIGNED_INT_IMAGE_BUFFER_EXT 0x9067 +#define GL_UNSIGNED_INT_IMAGE_1D_ARRAY_EXT 0x9068 +#define GL_UNSIGNED_INT_IMAGE_2D_ARRAY_EXT 0x9069 +#define GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY_EXT 0x906A +#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_EXT 0x906B +#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY_EXT 0x906C +#define GL_MAX_IMAGE_SAMPLES_EXT 0x906D +#define GL_IMAGE_BINDING_FORMAT_EXT 0x906E +#define GL_ALL_BARRIER_BITS_EXT 0xFFFFFFFF + +typedef void (GLAPIENTRY * PFNGLBINDIMAGETEXTUREEXTPROC) (GLuint index, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLint format); +typedef void (GLAPIENTRY * PFNGLMEMORYBARRIEREXTPROC) (GLbitfield barriers); + +#define glBindImageTextureEXT GLEW_GET_FUN(__glewBindImageTextureEXT) +#define glMemoryBarrierEXT GLEW_GET_FUN(__glewMemoryBarrierEXT) + +#define GLEW_EXT_shader_image_load_store GLEW_GET_VAR(__GLEW_EXT_shader_image_load_store) + +#endif /* GL_EXT_shader_image_load_store */ + +/* -------------------------- GL_EXT_shadow_funcs -------------------------- */ + +#ifndef GL_EXT_shadow_funcs +#define GL_EXT_shadow_funcs 1 + +#define GLEW_EXT_shadow_funcs GLEW_GET_VAR(__GLEW_EXT_shadow_funcs) + +#endif /* GL_EXT_shadow_funcs */ + +/* --------------------- GL_EXT_shared_texture_palette --------------------- */ + +#ifndef GL_EXT_shared_texture_palette +#define GL_EXT_shared_texture_palette 1 + +#define GL_SHARED_TEXTURE_PALETTE_EXT 0x81FB + +#define GLEW_EXT_shared_texture_palette GLEW_GET_VAR(__GLEW_EXT_shared_texture_palette) + +#endif /* GL_EXT_shared_texture_palette */ + +/* ------------------------ GL_EXT_stencil_clear_tag ----------------------- */ + +#ifndef GL_EXT_stencil_clear_tag +#define GL_EXT_stencil_clear_tag 1 + +#define GL_STENCIL_TAG_BITS_EXT 0x88F2 +#define GL_STENCIL_CLEAR_TAG_VALUE_EXT 0x88F3 + +#define GLEW_EXT_stencil_clear_tag GLEW_GET_VAR(__GLEW_EXT_stencil_clear_tag) + +#endif /* GL_EXT_stencil_clear_tag */ + +/* ------------------------ GL_EXT_stencil_two_side ------------------------ */ + +#ifndef GL_EXT_stencil_two_side +#define GL_EXT_stencil_two_side 1 + +#define GL_STENCIL_TEST_TWO_SIDE_EXT 0x8910 +#define GL_ACTIVE_STENCIL_FACE_EXT 0x8911 + +typedef void (GLAPIENTRY * PFNGLACTIVESTENCILFACEEXTPROC) (GLenum face); + +#define glActiveStencilFaceEXT GLEW_GET_FUN(__glewActiveStencilFaceEXT) + +#define GLEW_EXT_stencil_two_side GLEW_GET_VAR(__GLEW_EXT_stencil_two_side) + +#endif /* GL_EXT_stencil_two_side */ + +/* -------------------------- GL_EXT_stencil_wrap -------------------------- */ + +#ifndef GL_EXT_stencil_wrap +#define GL_EXT_stencil_wrap 1 + +#define GL_INCR_WRAP_EXT 0x8507 +#define GL_DECR_WRAP_EXT 0x8508 + +#define GLEW_EXT_stencil_wrap GLEW_GET_VAR(__GLEW_EXT_stencil_wrap) + +#endif /* GL_EXT_stencil_wrap */ + +/* --------------------------- GL_EXT_subtexture --------------------------- */ + +#ifndef GL_EXT_subtexture +#define GL_EXT_subtexture 1 + +typedef void (GLAPIENTRY * PFNGLTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (GLAPIENTRY * PFNGLTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (GLAPIENTRY * PFNGLTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); + +#define glTexSubImage1DEXT GLEW_GET_FUN(__glewTexSubImage1DEXT) +#define glTexSubImage2DEXT GLEW_GET_FUN(__glewTexSubImage2DEXT) +#define glTexSubImage3DEXT GLEW_GET_FUN(__glewTexSubImage3DEXT) + +#define GLEW_EXT_subtexture GLEW_GET_VAR(__GLEW_EXT_subtexture) + +#endif /* GL_EXT_subtexture */ + +/* ----------------------------- GL_EXT_texture ---------------------------- */ + +#ifndef GL_EXT_texture +#define GL_EXT_texture 1 + +#define GL_ALPHA4_EXT 0x803B +#define GL_ALPHA8_EXT 0x803C +#define GL_ALPHA12_EXT 0x803D +#define GL_ALPHA16_EXT 0x803E +#define GL_LUMINANCE4_EXT 0x803F +#define GL_LUMINANCE8_EXT 0x8040 +#define GL_LUMINANCE12_EXT 0x8041 +#define GL_LUMINANCE16_EXT 0x8042 +#define GL_LUMINANCE4_ALPHA4_EXT 0x8043 +#define GL_LUMINANCE6_ALPHA2_EXT 0x8044 +#define GL_LUMINANCE8_ALPHA8_EXT 0x8045 +#define GL_LUMINANCE12_ALPHA4_EXT 0x8046 +#define GL_LUMINANCE12_ALPHA12_EXT 0x8047 +#define GL_LUMINANCE16_ALPHA16_EXT 0x8048 +#define GL_INTENSITY_EXT 0x8049 +#define GL_INTENSITY4_EXT 0x804A +#define GL_INTENSITY8_EXT 0x804B +#define GL_INTENSITY12_EXT 0x804C +#define GL_INTENSITY16_EXT 0x804D +#define GL_RGB2_EXT 0x804E +#define GL_RGB4_EXT 0x804F +#define GL_RGB5_EXT 0x8050 +#define GL_RGB8_EXT 0x8051 +#define GL_RGB10_EXT 0x8052 +#define GL_RGB12_EXT 0x8053 +#define GL_RGB16_EXT 0x8054 +#define GL_RGBA2_EXT 0x8055 +#define GL_RGBA4_EXT 0x8056 +#define GL_RGB5_A1_EXT 0x8057 +#define GL_RGBA8_EXT 0x8058 +#define GL_RGB10_A2_EXT 0x8059 +#define GL_RGBA12_EXT 0x805A +#define GL_RGBA16_EXT 0x805B +#define GL_TEXTURE_RED_SIZE_EXT 0x805C +#define GL_TEXTURE_GREEN_SIZE_EXT 0x805D +#define GL_TEXTURE_BLUE_SIZE_EXT 0x805E +#define GL_TEXTURE_ALPHA_SIZE_EXT 0x805F +#define GL_TEXTURE_LUMINANCE_SIZE_EXT 0x8060 +#define GL_TEXTURE_INTENSITY_SIZE_EXT 0x8061 +#define GL_REPLACE_EXT 0x8062 +#define GL_PROXY_TEXTURE_1D_EXT 0x8063 +#define GL_PROXY_TEXTURE_2D_EXT 0x8064 + +#define GLEW_EXT_texture GLEW_GET_VAR(__GLEW_EXT_texture) + +#endif /* GL_EXT_texture */ + +/* ---------------------------- GL_EXT_texture3D --------------------------- */ + +#ifndef GL_EXT_texture3D +#define GL_EXT_texture3D 1 + +#define GL_PACK_SKIP_IMAGES_EXT 0x806B +#define GL_PACK_IMAGE_HEIGHT_EXT 0x806C +#define GL_UNPACK_SKIP_IMAGES_EXT 0x806D +#define GL_UNPACK_IMAGE_HEIGHT_EXT 0x806E +#define GL_TEXTURE_3D_EXT 0x806F +#define GL_PROXY_TEXTURE_3D_EXT 0x8070 +#define GL_TEXTURE_DEPTH_EXT 0x8071 +#define GL_TEXTURE_WRAP_R_EXT 0x8072 +#define GL_MAX_3D_TEXTURE_SIZE_EXT 0x8073 + +typedef void (GLAPIENTRY * PFNGLTEXIMAGE3DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); + +#define glTexImage3DEXT GLEW_GET_FUN(__glewTexImage3DEXT) + +#define GLEW_EXT_texture3D GLEW_GET_VAR(__GLEW_EXT_texture3D) + +#endif /* GL_EXT_texture3D */ + +/* -------------------------- GL_EXT_texture_array ------------------------- */ + +#ifndef GL_EXT_texture_array +#define GL_EXT_texture_array 1 + +#define GL_COMPARE_REF_DEPTH_TO_TEXTURE_EXT 0x884E +#define GL_MAX_ARRAY_TEXTURE_LAYERS_EXT 0x88FF +#define GL_TEXTURE_1D_ARRAY_EXT 0x8C18 +#define GL_PROXY_TEXTURE_1D_ARRAY_EXT 0x8C19 +#define GL_TEXTURE_2D_ARRAY_EXT 0x8C1A +#define GL_PROXY_TEXTURE_2D_ARRAY_EXT 0x8C1B +#define GL_TEXTURE_BINDING_1D_ARRAY_EXT 0x8C1C +#define GL_TEXTURE_BINDING_2D_ARRAY_EXT 0x8C1D + +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); + +#define glFramebufferTextureLayerEXT GLEW_GET_FUN(__glewFramebufferTextureLayerEXT) + +#define GLEW_EXT_texture_array GLEW_GET_VAR(__GLEW_EXT_texture_array) + +#endif /* GL_EXT_texture_array */ + +/* ---------------------- GL_EXT_texture_buffer_object --------------------- */ + +#ifndef GL_EXT_texture_buffer_object +#define GL_EXT_texture_buffer_object 1 + +#define GL_TEXTURE_BUFFER_EXT 0x8C2A +#define GL_MAX_TEXTURE_BUFFER_SIZE_EXT 0x8C2B +#define GL_TEXTURE_BINDING_BUFFER_EXT 0x8C2C +#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING_EXT 0x8C2D +#define GL_TEXTURE_BUFFER_FORMAT_EXT 0x8C2E + +typedef void (GLAPIENTRY * PFNGLTEXBUFFEREXTPROC) (GLenum target, GLenum internalformat, GLuint buffer); + +#define glTexBufferEXT GLEW_GET_FUN(__glewTexBufferEXT) + +#define GLEW_EXT_texture_buffer_object GLEW_GET_VAR(__GLEW_EXT_texture_buffer_object) + +#endif /* GL_EXT_texture_buffer_object */ + +/* -------------------- GL_EXT_texture_compression_dxt1 -------------------- */ + +#ifndef GL_EXT_texture_compression_dxt1 +#define GL_EXT_texture_compression_dxt1 1 + +#define GLEW_EXT_texture_compression_dxt1 GLEW_GET_VAR(__GLEW_EXT_texture_compression_dxt1) + +#endif /* GL_EXT_texture_compression_dxt1 */ + +/* -------------------- GL_EXT_texture_compression_latc -------------------- */ + +#ifndef GL_EXT_texture_compression_latc +#define GL_EXT_texture_compression_latc 1 + +#define GL_COMPRESSED_LUMINANCE_LATC1_EXT 0x8C70 +#define GL_COMPRESSED_SIGNED_LUMINANCE_LATC1_EXT 0x8C71 +#define GL_COMPRESSED_LUMINANCE_ALPHA_LATC2_EXT 0x8C72 +#define GL_COMPRESSED_SIGNED_LUMINANCE_ALPHA_LATC2_EXT 0x8C73 + +#define GLEW_EXT_texture_compression_latc GLEW_GET_VAR(__GLEW_EXT_texture_compression_latc) + +#endif /* GL_EXT_texture_compression_latc */ + +/* -------------------- GL_EXT_texture_compression_rgtc -------------------- */ + +#ifndef GL_EXT_texture_compression_rgtc +#define GL_EXT_texture_compression_rgtc 1 + +#define GL_COMPRESSED_RED_RGTC1_EXT 0x8DBB +#define GL_COMPRESSED_SIGNED_RED_RGTC1_EXT 0x8DBC +#define GL_COMPRESSED_RED_GREEN_RGTC2_EXT 0x8DBD +#define GL_COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT 0x8DBE + +#define GLEW_EXT_texture_compression_rgtc GLEW_GET_VAR(__GLEW_EXT_texture_compression_rgtc) + +#endif /* GL_EXT_texture_compression_rgtc */ + +/* -------------------- GL_EXT_texture_compression_s3tc -------------------- */ + +#ifndef GL_EXT_texture_compression_s3tc +#define GL_EXT_texture_compression_s3tc 1 + +#define GL_COMPRESSED_RGB_S3TC_DXT1_EXT 0x83F0 +#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1 +#define GL_COMPRESSED_RGBA_S3TC_DXT3_EXT 0x83F2 +#define GL_COMPRESSED_RGBA_S3TC_DXT5_EXT 0x83F3 + +#define GLEW_EXT_texture_compression_s3tc GLEW_GET_VAR(__GLEW_EXT_texture_compression_s3tc) + +#endif /* GL_EXT_texture_compression_s3tc */ + +/* ------------------------ GL_EXT_texture_cube_map ------------------------ */ + +#ifndef GL_EXT_texture_cube_map +#define GL_EXT_texture_cube_map 1 + +#define GL_NORMAL_MAP_EXT 0x8511 +#define GL_REFLECTION_MAP_EXT 0x8512 +#define GL_TEXTURE_CUBE_MAP_EXT 0x8513 +#define GL_TEXTURE_BINDING_CUBE_MAP_EXT 0x8514 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_EXT 0x8515 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_EXT 0x8516 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_EXT 0x8517 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_EXT 0x8518 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_EXT 0x8519 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_EXT 0x851A +#define GL_PROXY_TEXTURE_CUBE_MAP_EXT 0x851B +#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_EXT 0x851C + +#define GLEW_EXT_texture_cube_map GLEW_GET_VAR(__GLEW_EXT_texture_cube_map) + +#endif /* GL_EXT_texture_cube_map */ + +/* ----------------------- GL_EXT_texture_edge_clamp ----------------------- */ + +#ifndef GL_EXT_texture_edge_clamp +#define GL_EXT_texture_edge_clamp 1 + +#define GL_CLAMP_TO_EDGE_EXT 0x812F + +#define GLEW_EXT_texture_edge_clamp GLEW_GET_VAR(__GLEW_EXT_texture_edge_clamp) + +#endif /* GL_EXT_texture_edge_clamp */ + +/* --------------------------- GL_EXT_texture_env -------------------------- */ + +#ifndef GL_EXT_texture_env +#define GL_EXT_texture_env 1 + +#define GLEW_EXT_texture_env GLEW_GET_VAR(__GLEW_EXT_texture_env) + +#endif /* GL_EXT_texture_env */ + +/* ------------------------- GL_EXT_texture_env_add ------------------------ */ + +#ifndef GL_EXT_texture_env_add +#define GL_EXT_texture_env_add 1 + +#define GLEW_EXT_texture_env_add GLEW_GET_VAR(__GLEW_EXT_texture_env_add) + +#endif /* GL_EXT_texture_env_add */ + +/* ----------------------- GL_EXT_texture_env_combine ---------------------- */ + +#ifndef GL_EXT_texture_env_combine +#define GL_EXT_texture_env_combine 1 + +#define GL_COMBINE_EXT 0x8570 +#define GL_COMBINE_RGB_EXT 0x8571 +#define GL_COMBINE_ALPHA_EXT 0x8572 +#define GL_RGB_SCALE_EXT 0x8573 +#define GL_ADD_SIGNED_EXT 0x8574 +#define GL_INTERPOLATE_EXT 0x8575 +#define GL_CONSTANT_EXT 0x8576 +#define GL_PRIMARY_COLOR_EXT 0x8577 +#define GL_PREVIOUS_EXT 0x8578 +#define GL_SOURCE0_RGB_EXT 0x8580 +#define GL_SOURCE1_RGB_EXT 0x8581 +#define GL_SOURCE2_RGB_EXT 0x8582 +#define GL_SOURCE0_ALPHA_EXT 0x8588 +#define GL_SOURCE1_ALPHA_EXT 0x8589 +#define GL_SOURCE2_ALPHA_EXT 0x858A +#define GL_OPERAND0_RGB_EXT 0x8590 +#define GL_OPERAND1_RGB_EXT 0x8591 +#define GL_OPERAND2_RGB_EXT 0x8592 +#define GL_OPERAND0_ALPHA_EXT 0x8598 +#define GL_OPERAND1_ALPHA_EXT 0x8599 +#define GL_OPERAND2_ALPHA_EXT 0x859A + +#define GLEW_EXT_texture_env_combine GLEW_GET_VAR(__GLEW_EXT_texture_env_combine) + +#endif /* GL_EXT_texture_env_combine */ + +/* ------------------------ GL_EXT_texture_env_dot3 ------------------------ */ + +#ifndef GL_EXT_texture_env_dot3 +#define GL_EXT_texture_env_dot3 1 + +#define GL_DOT3_RGB_EXT 0x8740 +#define GL_DOT3_RGBA_EXT 0x8741 + +#define GLEW_EXT_texture_env_dot3 GLEW_GET_VAR(__GLEW_EXT_texture_env_dot3) + +#endif /* GL_EXT_texture_env_dot3 */ + +/* ------------------- GL_EXT_texture_filter_anisotropic ------------------- */ + +#ifndef GL_EXT_texture_filter_anisotropic +#define GL_EXT_texture_filter_anisotropic 1 + +#define GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE +#define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF + +#define GLEW_EXT_texture_filter_anisotropic GLEW_GET_VAR(__GLEW_EXT_texture_filter_anisotropic) + +#endif /* GL_EXT_texture_filter_anisotropic */ + +/* ------------------------- GL_EXT_texture_integer ------------------------ */ + +#ifndef GL_EXT_texture_integer +#define GL_EXT_texture_integer 1 + +#define GL_RGBA32UI_EXT 0x8D70 +#define GL_RGB32UI_EXT 0x8D71 +#define GL_ALPHA32UI_EXT 0x8D72 +#define GL_INTENSITY32UI_EXT 0x8D73 +#define GL_LUMINANCE32UI_EXT 0x8D74 +#define GL_LUMINANCE_ALPHA32UI_EXT 0x8D75 +#define GL_RGBA16UI_EXT 0x8D76 +#define GL_RGB16UI_EXT 0x8D77 +#define GL_ALPHA16UI_EXT 0x8D78 +#define GL_INTENSITY16UI_EXT 0x8D79 +#define GL_LUMINANCE16UI_EXT 0x8D7A +#define GL_LUMINANCE_ALPHA16UI_EXT 0x8D7B +#define GL_RGBA8UI_EXT 0x8D7C +#define GL_RGB8UI_EXT 0x8D7D +#define GL_ALPHA8UI_EXT 0x8D7E +#define GL_INTENSITY8UI_EXT 0x8D7F +#define GL_LUMINANCE8UI_EXT 0x8D80 +#define GL_LUMINANCE_ALPHA8UI_EXT 0x8D81 +#define GL_RGBA32I_EXT 0x8D82 +#define GL_RGB32I_EXT 0x8D83 +#define GL_ALPHA32I_EXT 0x8D84 +#define GL_INTENSITY32I_EXT 0x8D85 +#define GL_LUMINANCE32I_EXT 0x8D86 +#define GL_LUMINANCE_ALPHA32I_EXT 0x8D87 +#define GL_RGBA16I_EXT 0x8D88 +#define GL_RGB16I_EXT 0x8D89 +#define GL_ALPHA16I_EXT 0x8D8A +#define GL_INTENSITY16I_EXT 0x8D8B +#define GL_LUMINANCE16I_EXT 0x8D8C +#define GL_LUMINANCE_ALPHA16I_EXT 0x8D8D +#define GL_RGBA8I_EXT 0x8D8E +#define GL_RGB8I_EXT 0x8D8F +#define GL_ALPHA8I_EXT 0x8D90 +#define GL_INTENSITY8I_EXT 0x8D91 +#define GL_LUMINANCE8I_EXT 0x8D92 +#define GL_LUMINANCE_ALPHA8I_EXT 0x8D93 +#define GL_RED_INTEGER_EXT 0x8D94 +#define GL_GREEN_INTEGER_EXT 0x8D95 +#define GL_BLUE_INTEGER_EXT 0x8D96 +#define GL_ALPHA_INTEGER_EXT 0x8D97 +#define GL_RGB_INTEGER_EXT 0x8D98 +#define GL_RGBA_INTEGER_EXT 0x8D99 +#define GL_BGR_INTEGER_EXT 0x8D9A +#define GL_BGRA_INTEGER_EXT 0x8D9B +#define GL_LUMINANCE_INTEGER_EXT 0x8D9C +#define GL_LUMINANCE_ALPHA_INTEGER_EXT 0x8D9D +#define GL_RGBA_INTEGER_MODE_EXT 0x8D9E + +typedef void (GLAPIENTRY * PFNGLCLEARCOLORIIEXTPROC) (GLint red, GLint green, GLint blue, GLint alpha); +typedef void (GLAPIENTRY * PFNGLCLEARCOLORIUIEXTPROC) (GLuint red, GLuint green, GLuint blue, GLuint alpha); +typedef void (GLAPIENTRY * PFNGLGETTEXPARAMETERIIVEXTPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (GLAPIENTRY * PFNGLGETTEXPARAMETERIUIVEXTPROC) (GLenum target, GLenum pname, GLuint *params); +typedef void (GLAPIENTRY * PFNGLTEXPARAMETERIIVEXTPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (GLAPIENTRY * PFNGLTEXPARAMETERIUIVEXTPROC) (GLenum target, GLenum pname, const GLuint *params); + +#define glClearColorIiEXT GLEW_GET_FUN(__glewClearColorIiEXT) +#define glClearColorIuiEXT GLEW_GET_FUN(__glewClearColorIuiEXT) +#define glGetTexParameterIivEXT GLEW_GET_FUN(__glewGetTexParameterIivEXT) +#define glGetTexParameterIuivEXT GLEW_GET_FUN(__glewGetTexParameterIuivEXT) +#define glTexParameterIivEXT GLEW_GET_FUN(__glewTexParameterIivEXT) +#define glTexParameterIuivEXT GLEW_GET_FUN(__glewTexParameterIuivEXT) + +#define GLEW_EXT_texture_integer GLEW_GET_VAR(__GLEW_EXT_texture_integer) + +#endif /* GL_EXT_texture_integer */ + +/* ------------------------ GL_EXT_texture_lod_bias ------------------------ */ + +#ifndef GL_EXT_texture_lod_bias +#define GL_EXT_texture_lod_bias 1 + +#define GL_MAX_TEXTURE_LOD_BIAS_EXT 0x84FD +#define GL_TEXTURE_FILTER_CONTROL_EXT 0x8500 +#define GL_TEXTURE_LOD_BIAS_EXT 0x8501 + +#define GLEW_EXT_texture_lod_bias GLEW_GET_VAR(__GLEW_EXT_texture_lod_bias) + +#endif /* GL_EXT_texture_lod_bias */ + +/* ---------------------- GL_EXT_texture_mirror_clamp ---------------------- */ + +#ifndef GL_EXT_texture_mirror_clamp +#define GL_EXT_texture_mirror_clamp 1 + +#define GL_MIRROR_CLAMP_EXT 0x8742 +#define GL_MIRROR_CLAMP_TO_EDGE_EXT 0x8743 +#define GL_MIRROR_CLAMP_TO_BORDER_EXT 0x8912 + +#define GLEW_EXT_texture_mirror_clamp GLEW_GET_VAR(__GLEW_EXT_texture_mirror_clamp) + +#endif /* GL_EXT_texture_mirror_clamp */ + +/* ------------------------- GL_EXT_texture_object ------------------------- */ + +#ifndef GL_EXT_texture_object +#define GL_EXT_texture_object 1 + +#define GL_TEXTURE_PRIORITY_EXT 0x8066 +#define GL_TEXTURE_RESIDENT_EXT 0x8067 +#define GL_TEXTURE_1D_BINDING_EXT 0x8068 +#define GL_TEXTURE_2D_BINDING_EXT 0x8069 +#define GL_TEXTURE_3D_BINDING_EXT 0x806A + +typedef GLboolean (GLAPIENTRY * PFNGLARETEXTURESRESIDENTEXTPROC) (GLsizei n, const GLuint* textures, GLboolean* residences); +typedef void (GLAPIENTRY * PFNGLBINDTEXTUREEXTPROC) (GLenum target, GLuint texture); +typedef void (GLAPIENTRY * PFNGLDELETETEXTURESEXTPROC) (GLsizei n, const GLuint* textures); +typedef void (GLAPIENTRY * PFNGLGENTEXTURESEXTPROC) (GLsizei n, GLuint* textures); +typedef GLboolean (GLAPIENTRY * PFNGLISTEXTUREEXTPROC) (GLuint texture); +typedef void (GLAPIENTRY * PFNGLPRIORITIZETEXTURESEXTPROC) (GLsizei n, const GLuint* textures, const GLclampf* priorities); + +#define glAreTexturesResidentEXT GLEW_GET_FUN(__glewAreTexturesResidentEXT) +#define glBindTextureEXT GLEW_GET_FUN(__glewBindTextureEXT) +#define glDeleteTexturesEXT GLEW_GET_FUN(__glewDeleteTexturesEXT) +#define glGenTexturesEXT GLEW_GET_FUN(__glewGenTexturesEXT) +#define glIsTextureEXT GLEW_GET_FUN(__glewIsTextureEXT) +#define glPrioritizeTexturesEXT GLEW_GET_FUN(__glewPrioritizeTexturesEXT) + +#define GLEW_EXT_texture_object GLEW_GET_VAR(__GLEW_EXT_texture_object) + +#endif /* GL_EXT_texture_object */ + +/* --------------------- GL_EXT_texture_perturb_normal --------------------- */ + +#ifndef GL_EXT_texture_perturb_normal +#define GL_EXT_texture_perturb_normal 1 + +#define GL_PERTURB_EXT 0x85AE +#define GL_TEXTURE_NORMAL_EXT 0x85AF + +typedef void (GLAPIENTRY * PFNGLTEXTURENORMALEXTPROC) (GLenum mode); + +#define glTextureNormalEXT GLEW_GET_FUN(__glewTextureNormalEXT) + +#define GLEW_EXT_texture_perturb_normal GLEW_GET_VAR(__GLEW_EXT_texture_perturb_normal) + +#endif /* GL_EXT_texture_perturb_normal */ + +/* ------------------------ GL_EXT_texture_rectangle ----------------------- */ + +#ifndef GL_EXT_texture_rectangle +#define GL_EXT_texture_rectangle 1 + +#define GL_TEXTURE_RECTANGLE_EXT 0x84F5 +#define GL_TEXTURE_BINDING_RECTANGLE_EXT 0x84F6 +#define GL_PROXY_TEXTURE_RECTANGLE_EXT 0x84F7 +#define GL_MAX_RECTANGLE_TEXTURE_SIZE_EXT 0x84F8 + +#define GLEW_EXT_texture_rectangle GLEW_GET_VAR(__GLEW_EXT_texture_rectangle) + +#endif /* GL_EXT_texture_rectangle */ + +/* -------------------------- GL_EXT_texture_sRGB -------------------------- */ + +#ifndef GL_EXT_texture_sRGB +#define GL_EXT_texture_sRGB 1 + +#define GL_SRGB_EXT 0x8C40 +#define GL_SRGB8_EXT 0x8C41 +#define GL_SRGB_ALPHA_EXT 0x8C42 +#define GL_SRGB8_ALPHA8_EXT 0x8C43 +#define GL_SLUMINANCE_ALPHA_EXT 0x8C44 +#define GL_SLUMINANCE8_ALPHA8_EXT 0x8C45 +#define GL_SLUMINANCE_EXT 0x8C46 +#define GL_SLUMINANCE8_EXT 0x8C47 +#define GL_COMPRESSED_SRGB_EXT 0x8C48 +#define GL_COMPRESSED_SRGB_ALPHA_EXT 0x8C49 +#define GL_COMPRESSED_SLUMINANCE_EXT 0x8C4A +#define GL_COMPRESSED_SLUMINANCE_ALPHA_EXT 0x8C4B +#define GL_COMPRESSED_SRGB_S3TC_DXT1_EXT 0x8C4C +#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT 0x8C4D +#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT 0x8C4E +#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT 0x8C4F + +#define GLEW_EXT_texture_sRGB GLEW_GET_VAR(__GLEW_EXT_texture_sRGB) + +#endif /* GL_EXT_texture_sRGB */ + +/* ----------------------- GL_EXT_texture_sRGB_decode ---------------------- */ + +#ifndef GL_EXT_texture_sRGB_decode +#define GL_EXT_texture_sRGB_decode 1 + +#define GL_TEXTURE_SRGB_DECODE_EXT 0x8A48 +#define GL_DECODE_EXT 0x8A49 +#define GL_SKIP_DECODE_EXT 0x8A4A + +#define GLEW_EXT_texture_sRGB_decode GLEW_GET_VAR(__GLEW_EXT_texture_sRGB_decode) + +#endif /* GL_EXT_texture_sRGB_decode */ + +/* --------------------- GL_EXT_texture_shared_exponent -------------------- */ + +#ifndef GL_EXT_texture_shared_exponent +#define GL_EXT_texture_shared_exponent 1 + +#define GL_RGB9_E5_EXT 0x8C3D +#define GL_UNSIGNED_INT_5_9_9_9_REV_EXT 0x8C3E +#define GL_TEXTURE_SHARED_SIZE_EXT 0x8C3F + +#define GLEW_EXT_texture_shared_exponent GLEW_GET_VAR(__GLEW_EXT_texture_shared_exponent) + +#endif /* GL_EXT_texture_shared_exponent */ + +/* -------------------------- GL_EXT_texture_snorm ------------------------- */ + +#ifndef GL_EXT_texture_snorm +#define GL_EXT_texture_snorm 1 + +#define GL_RED_SNORM 0x8F90 +#define GL_RG_SNORM 0x8F91 +#define GL_RGB_SNORM 0x8F92 +#define GL_RGBA_SNORM 0x8F93 +#define GL_R8_SNORM 0x8F94 +#define GL_RG8_SNORM 0x8F95 +#define GL_RGB8_SNORM 0x8F96 +#define GL_RGBA8_SNORM 0x8F97 +#define GL_R16_SNORM 0x8F98 +#define GL_RG16_SNORM 0x8F99 +#define GL_RGB16_SNORM 0x8F9A +#define GL_RGBA16_SNORM 0x8F9B +#define GL_SIGNED_NORMALIZED 0x8F9C +#define GL_ALPHA_SNORM 0x9010 +#define GL_LUMINANCE_SNORM 0x9011 +#define GL_LUMINANCE_ALPHA_SNORM 0x9012 +#define GL_INTENSITY_SNORM 0x9013 +#define GL_ALPHA8_SNORM 0x9014 +#define GL_LUMINANCE8_SNORM 0x9015 +#define GL_LUMINANCE8_ALPHA8_SNORM 0x9016 +#define GL_INTENSITY8_SNORM 0x9017 +#define GL_ALPHA16_SNORM 0x9018 +#define GL_LUMINANCE16_SNORM 0x9019 +#define GL_LUMINANCE16_ALPHA16_SNORM 0x901A +#define GL_INTENSITY16_SNORM 0x901B + +#define GLEW_EXT_texture_snorm GLEW_GET_VAR(__GLEW_EXT_texture_snorm) + +#endif /* GL_EXT_texture_snorm */ + +/* ------------------------- GL_EXT_texture_swizzle ------------------------ */ + +#ifndef GL_EXT_texture_swizzle +#define GL_EXT_texture_swizzle 1 + +#define GL_TEXTURE_SWIZZLE_R_EXT 0x8E42 +#define GL_TEXTURE_SWIZZLE_G_EXT 0x8E43 +#define GL_TEXTURE_SWIZZLE_B_EXT 0x8E44 +#define GL_TEXTURE_SWIZZLE_A_EXT 0x8E45 +#define GL_TEXTURE_SWIZZLE_RGBA_EXT 0x8E46 + +#define GLEW_EXT_texture_swizzle GLEW_GET_VAR(__GLEW_EXT_texture_swizzle) + +#endif /* GL_EXT_texture_swizzle */ + +/* --------------------------- GL_EXT_timer_query -------------------------- */ + +#ifndef GL_EXT_timer_query +#define GL_EXT_timer_query 1 + +#define GL_TIME_ELAPSED_EXT 0x88BF + +typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTI64VEXTPROC) (GLuint id, GLenum pname, GLint64EXT *params); +typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTUI64VEXTPROC) (GLuint id, GLenum pname, GLuint64EXT *params); + +#define glGetQueryObjecti64vEXT GLEW_GET_FUN(__glewGetQueryObjecti64vEXT) +#define glGetQueryObjectui64vEXT GLEW_GET_FUN(__glewGetQueryObjectui64vEXT) + +#define GLEW_EXT_timer_query GLEW_GET_VAR(__GLEW_EXT_timer_query) + +#endif /* GL_EXT_timer_query */ + +/* ----------------------- GL_EXT_transform_feedback ----------------------- */ + +#ifndef GL_EXT_transform_feedback +#define GL_EXT_transform_feedback 1 + +#define GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH_EXT 0x8C76 +#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE_EXT 0x8C7F +#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_EXT 0x8C80 +#define GL_TRANSFORM_FEEDBACK_VARYINGS_EXT 0x8C83 +#define GL_TRANSFORM_FEEDBACK_BUFFER_START_EXT 0x8C84 +#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE_EXT 0x8C85 +#define GL_PRIMITIVES_GENERATED_EXT 0x8C87 +#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_EXT 0x8C88 +#define GL_RASTERIZER_DISCARD_EXT 0x8C89 +#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS_EXT 0x8C8A +#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_EXT 0x8C8B +#define GL_INTERLEAVED_ATTRIBS_EXT 0x8C8C +#define GL_SEPARATE_ATTRIBS_EXT 0x8C8D +#define GL_TRANSFORM_FEEDBACK_BUFFER_EXT 0x8C8E +#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_EXT 0x8C8F + +typedef void (GLAPIENTRY * PFNGLBEGINTRANSFORMFEEDBACKEXTPROC) (GLenum primitiveMode); +typedef void (GLAPIENTRY * PFNGLBINDBUFFERBASEEXTPROC) (GLenum target, GLuint index, GLuint buffer); +typedef void (GLAPIENTRY * PFNGLBINDBUFFEROFFSETEXTPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLBINDBUFFERRANGEEXTPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); +typedef void (GLAPIENTRY * PFNGLENDTRANSFORMFEEDBACKEXTPROC) (void); +typedef void (GLAPIENTRY * PFNGLGETTRANSFORMFEEDBACKVARYINGEXTPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei* length, GLsizei *size, GLenum *type, GLchar *name); +typedef void (GLAPIENTRY * PFNGLTRANSFORMFEEDBACKVARYINGSEXTPROC) (GLuint program, GLsizei count, const GLchar * const* varyings, GLenum bufferMode); + +#define glBeginTransformFeedbackEXT GLEW_GET_FUN(__glewBeginTransformFeedbackEXT) +#define glBindBufferBaseEXT GLEW_GET_FUN(__glewBindBufferBaseEXT) +#define glBindBufferOffsetEXT GLEW_GET_FUN(__glewBindBufferOffsetEXT) +#define glBindBufferRangeEXT GLEW_GET_FUN(__glewBindBufferRangeEXT) +#define glEndTransformFeedbackEXT GLEW_GET_FUN(__glewEndTransformFeedbackEXT) +#define glGetTransformFeedbackVaryingEXT GLEW_GET_FUN(__glewGetTransformFeedbackVaryingEXT) +#define glTransformFeedbackVaryingsEXT GLEW_GET_FUN(__glewTransformFeedbackVaryingsEXT) + +#define GLEW_EXT_transform_feedback GLEW_GET_VAR(__GLEW_EXT_transform_feedback) + +#endif /* GL_EXT_transform_feedback */ + +/* -------------------------- GL_EXT_vertex_array -------------------------- */ + +#ifndef GL_EXT_vertex_array +#define GL_EXT_vertex_array 1 + +#define GL_DOUBLE_EXT 0x140A +#define GL_VERTEX_ARRAY_EXT 0x8074 +#define GL_NORMAL_ARRAY_EXT 0x8075 +#define GL_COLOR_ARRAY_EXT 0x8076 +#define GL_INDEX_ARRAY_EXT 0x8077 +#define GL_TEXTURE_COORD_ARRAY_EXT 0x8078 +#define GL_EDGE_FLAG_ARRAY_EXT 0x8079 +#define GL_VERTEX_ARRAY_SIZE_EXT 0x807A +#define GL_VERTEX_ARRAY_TYPE_EXT 0x807B +#define GL_VERTEX_ARRAY_STRIDE_EXT 0x807C +#define GL_VERTEX_ARRAY_COUNT_EXT 0x807D +#define GL_NORMAL_ARRAY_TYPE_EXT 0x807E +#define GL_NORMAL_ARRAY_STRIDE_EXT 0x807F +#define GL_NORMAL_ARRAY_COUNT_EXT 0x8080 +#define GL_COLOR_ARRAY_SIZE_EXT 0x8081 +#define GL_COLOR_ARRAY_TYPE_EXT 0x8082 +#define GL_COLOR_ARRAY_STRIDE_EXT 0x8083 +#define GL_COLOR_ARRAY_COUNT_EXT 0x8084 +#define GL_INDEX_ARRAY_TYPE_EXT 0x8085 +#define GL_INDEX_ARRAY_STRIDE_EXT 0x8086 +#define GL_INDEX_ARRAY_COUNT_EXT 0x8087 +#define GL_TEXTURE_COORD_ARRAY_SIZE_EXT 0x8088 +#define GL_TEXTURE_COORD_ARRAY_TYPE_EXT 0x8089 +#define GL_TEXTURE_COORD_ARRAY_STRIDE_EXT 0x808A +#define GL_TEXTURE_COORD_ARRAY_COUNT_EXT 0x808B +#define GL_EDGE_FLAG_ARRAY_STRIDE_EXT 0x808C +#define GL_EDGE_FLAG_ARRAY_COUNT_EXT 0x808D +#define GL_VERTEX_ARRAY_POINTER_EXT 0x808E +#define GL_NORMAL_ARRAY_POINTER_EXT 0x808F +#define GL_COLOR_ARRAY_POINTER_EXT 0x8090 +#define GL_INDEX_ARRAY_POINTER_EXT 0x8091 +#define GL_TEXTURE_COORD_ARRAY_POINTER_EXT 0x8092 +#define GL_EDGE_FLAG_ARRAY_POINTER_EXT 0x8093 + +typedef void (GLAPIENTRY * PFNGLARRAYELEMENTEXTPROC) (GLint i); +typedef void (GLAPIENTRY * PFNGLCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); +typedef void (GLAPIENTRY * PFNGLDRAWARRAYSEXTPROC) (GLenum mode, GLint first, GLsizei count); +typedef void (GLAPIENTRY * PFNGLEDGEFLAGPOINTEREXTPROC) (GLsizei stride, GLsizei count, const GLboolean* pointer); +typedef void (GLAPIENTRY * PFNGLINDEXPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); +typedef void (GLAPIENTRY * PFNGLNORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); +typedef void (GLAPIENTRY * PFNGLTEXCOORDPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); +typedef void (GLAPIENTRY * PFNGLVERTEXPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); + +#define glArrayElementEXT GLEW_GET_FUN(__glewArrayElementEXT) +#define glColorPointerEXT GLEW_GET_FUN(__glewColorPointerEXT) +#define glDrawArraysEXT GLEW_GET_FUN(__glewDrawArraysEXT) +#define glEdgeFlagPointerEXT GLEW_GET_FUN(__glewEdgeFlagPointerEXT) +#define glIndexPointerEXT GLEW_GET_FUN(__glewIndexPointerEXT) +#define glNormalPointerEXT GLEW_GET_FUN(__glewNormalPointerEXT) +#define glTexCoordPointerEXT GLEW_GET_FUN(__glewTexCoordPointerEXT) +#define glVertexPointerEXT GLEW_GET_FUN(__glewVertexPointerEXT) + +#define GLEW_EXT_vertex_array GLEW_GET_VAR(__GLEW_EXT_vertex_array) + +#endif /* GL_EXT_vertex_array */ + +/* ------------------------ GL_EXT_vertex_array_bgra ----------------------- */ + +#ifndef GL_EXT_vertex_array_bgra +#define GL_EXT_vertex_array_bgra 1 + +#define GL_BGRA 0x80E1 + +#define GLEW_EXT_vertex_array_bgra GLEW_GET_VAR(__GLEW_EXT_vertex_array_bgra) + +#endif /* GL_EXT_vertex_array_bgra */ + +/* ----------------------- GL_EXT_vertex_attrib_64bit ---------------------- */ + +#ifndef GL_EXT_vertex_attrib_64bit +#define GL_EXT_vertex_attrib_64bit 1 + +#define GL_DOUBLE_MAT2_EXT 0x8F46 +#define GL_DOUBLE_MAT3_EXT 0x8F47 +#define GL_DOUBLE_MAT4_EXT 0x8F48 +#define GL_DOUBLE_MAT2x3_EXT 0x8F49 +#define GL_DOUBLE_MAT2x4_EXT 0x8F4A +#define GL_DOUBLE_MAT3x2_EXT 0x8F4B +#define GL_DOUBLE_MAT3x4_EXT 0x8F4C +#define GL_DOUBLE_MAT4x2_EXT 0x8F4D +#define GL_DOUBLE_MAT4x3_EXT 0x8F4E +#define GL_DOUBLE_VEC2_EXT 0x8FFC +#define GL_DOUBLE_VEC3_EXT 0x8FFD +#define GL_DOUBLE_VEC4_EXT 0x8FFE + +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBLDVEXTPROC) (GLuint index, GLenum pname, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYVERTEXATTRIBLOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLsizei stride, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1DEXTPROC) (GLuint index, GLdouble x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1DVEXTPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL2DEXTPROC) (GLuint index, GLdouble x, GLdouble y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL2DVEXTPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL3DEXTPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL3DVEXTPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL4DEXTPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL4DVEXTPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBLPOINTEREXTPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); + +#define glGetVertexAttribLdvEXT GLEW_GET_FUN(__glewGetVertexAttribLdvEXT) +#define glVertexArrayVertexAttribLOffsetEXT GLEW_GET_FUN(__glewVertexArrayVertexAttribLOffsetEXT) +#define glVertexAttribL1dEXT GLEW_GET_FUN(__glewVertexAttribL1dEXT) +#define glVertexAttribL1dvEXT GLEW_GET_FUN(__glewVertexAttribL1dvEXT) +#define glVertexAttribL2dEXT GLEW_GET_FUN(__glewVertexAttribL2dEXT) +#define glVertexAttribL2dvEXT GLEW_GET_FUN(__glewVertexAttribL2dvEXT) +#define glVertexAttribL3dEXT GLEW_GET_FUN(__glewVertexAttribL3dEXT) +#define glVertexAttribL3dvEXT GLEW_GET_FUN(__glewVertexAttribL3dvEXT) +#define glVertexAttribL4dEXT GLEW_GET_FUN(__glewVertexAttribL4dEXT) +#define glVertexAttribL4dvEXT GLEW_GET_FUN(__glewVertexAttribL4dvEXT) +#define glVertexAttribLPointerEXT GLEW_GET_FUN(__glewVertexAttribLPointerEXT) + +#define GLEW_EXT_vertex_attrib_64bit GLEW_GET_VAR(__GLEW_EXT_vertex_attrib_64bit) + +#endif /* GL_EXT_vertex_attrib_64bit */ + +/* -------------------------- GL_EXT_vertex_shader ------------------------- */ + +#ifndef GL_EXT_vertex_shader +#define GL_EXT_vertex_shader 1 + +#define GL_VERTEX_SHADER_EXT 0x8780 +#define GL_VERTEX_SHADER_BINDING_EXT 0x8781 +#define GL_OP_INDEX_EXT 0x8782 +#define GL_OP_NEGATE_EXT 0x8783 +#define GL_OP_DOT3_EXT 0x8784 +#define GL_OP_DOT4_EXT 0x8785 +#define GL_OP_MUL_EXT 0x8786 +#define GL_OP_ADD_EXT 0x8787 +#define GL_OP_MADD_EXT 0x8788 +#define GL_OP_FRAC_EXT 0x8789 +#define GL_OP_MAX_EXT 0x878A +#define GL_OP_MIN_EXT 0x878B +#define GL_OP_SET_GE_EXT 0x878C +#define GL_OP_SET_LT_EXT 0x878D +#define GL_OP_CLAMP_EXT 0x878E +#define GL_OP_FLOOR_EXT 0x878F +#define GL_OP_ROUND_EXT 0x8790 +#define GL_OP_EXP_BASE_2_EXT 0x8791 +#define GL_OP_LOG_BASE_2_EXT 0x8792 +#define GL_OP_POWER_EXT 0x8793 +#define GL_OP_RECIP_EXT 0x8794 +#define GL_OP_RECIP_SQRT_EXT 0x8795 +#define GL_OP_SUB_EXT 0x8796 +#define GL_OP_CROSS_PRODUCT_EXT 0x8797 +#define GL_OP_MULTIPLY_MATRIX_EXT 0x8798 +#define GL_OP_MOV_EXT 0x8799 +#define GL_OUTPUT_VERTEX_EXT 0x879A +#define GL_OUTPUT_COLOR0_EXT 0x879B +#define GL_OUTPUT_COLOR1_EXT 0x879C +#define GL_OUTPUT_TEXTURE_COORD0_EXT 0x879D +#define GL_OUTPUT_TEXTURE_COORD1_EXT 0x879E +#define GL_OUTPUT_TEXTURE_COORD2_EXT 0x879F +#define GL_OUTPUT_TEXTURE_COORD3_EXT 0x87A0 +#define GL_OUTPUT_TEXTURE_COORD4_EXT 0x87A1 +#define GL_OUTPUT_TEXTURE_COORD5_EXT 0x87A2 +#define GL_OUTPUT_TEXTURE_COORD6_EXT 0x87A3 +#define GL_OUTPUT_TEXTURE_COORD7_EXT 0x87A4 +#define GL_OUTPUT_TEXTURE_COORD8_EXT 0x87A5 +#define GL_OUTPUT_TEXTURE_COORD9_EXT 0x87A6 +#define GL_OUTPUT_TEXTURE_COORD10_EXT 0x87A7 +#define GL_OUTPUT_TEXTURE_COORD11_EXT 0x87A8 +#define GL_OUTPUT_TEXTURE_COORD12_EXT 0x87A9 +#define GL_OUTPUT_TEXTURE_COORD13_EXT 0x87AA +#define GL_OUTPUT_TEXTURE_COORD14_EXT 0x87AB +#define GL_OUTPUT_TEXTURE_COORD15_EXT 0x87AC +#define GL_OUTPUT_TEXTURE_COORD16_EXT 0x87AD +#define GL_OUTPUT_TEXTURE_COORD17_EXT 0x87AE +#define GL_OUTPUT_TEXTURE_COORD18_EXT 0x87AF +#define GL_OUTPUT_TEXTURE_COORD19_EXT 0x87B0 +#define GL_OUTPUT_TEXTURE_COORD20_EXT 0x87B1 +#define GL_OUTPUT_TEXTURE_COORD21_EXT 0x87B2 +#define GL_OUTPUT_TEXTURE_COORD22_EXT 0x87B3 +#define GL_OUTPUT_TEXTURE_COORD23_EXT 0x87B4 +#define GL_OUTPUT_TEXTURE_COORD24_EXT 0x87B5 +#define GL_OUTPUT_TEXTURE_COORD25_EXT 0x87B6 +#define GL_OUTPUT_TEXTURE_COORD26_EXT 0x87B7 +#define GL_OUTPUT_TEXTURE_COORD27_EXT 0x87B8 +#define GL_OUTPUT_TEXTURE_COORD28_EXT 0x87B9 +#define GL_OUTPUT_TEXTURE_COORD29_EXT 0x87BA +#define GL_OUTPUT_TEXTURE_COORD30_EXT 0x87BB +#define GL_OUTPUT_TEXTURE_COORD31_EXT 0x87BC +#define GL_OUTPUT_FOG_EXT 0x87BD +#define GL_SCALAR_EXT 0x87BE +#define GL_VECTOR_EXT 0x87BF +#define GL_MATRIX_EXT 0x87C0 +#define GL_VARIANT_EXT 0x87C1 +#define GL_INVARIANT_EXT 0x87C2 +#define GL_LOCAL_CONSTANT_EXT 0x87C3 +#define GL_LOCAL_EXT 0x87C4 +#define GL_MAX_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87C5 +#define GL_MAX_VERTEX_SHADER_VARIANTS_EXT 0x87C6 +#define GL_MAX_VERTEX_SHADER_INVARIANTS_EXT 0x87C7 +#define GL_MAX_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87C8 +#define GL_MAX_VERTEX_SHADER_LOCALS_EXT 0x87C9 +#define GL_MAX_OPTIMIZED_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87CA +#define GL_MAX_OPTIMIZED_VERTEX_SHADER_VARIANTS_EXT 0x87CB +#define GL_MAX_OPTIMIZED_VERTEX_SHADER_INVARIANTS_EXT 0x87CC +#define GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87CD +#define GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCALS_EXT 0x87CE +#define GL_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87CF +#define GL_VERTEX_SHADER_VARIANTS_EXT 0x87D0 +#define GL_VERTEX_SHADER_INVARIANTS_EXT 0x87D1 +#define GL_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87D2 +#define GL_VERTEX_SHADER_LOCALS_EXT 0x87D3 +#define GL_VERTEX_SHADER_OPTIMIZED_EXT 0x87D4 +#define GL_X_EXT 0x87D5 +#define GL_Y_EXT 0x87D6 +#define GL_Z_EXT 0x87D7 +#define GL_W_EXT 0x87D8 +#define GL_NEGATIVE_X_EXT 0x87D9 +#define GL_NEGATIVE_Y_EXT 0x87DA +#define GL_NEGATIVE_Z_EXT 0x87DB +#define GL_NEGATIVE_W_EXT 0x87DC +#define GL_ZERO_EXT 0x87DD +#define GL_ONE_EXT 0x87DE +#define GL_NEGATIVE_ONE_EXT 0x87DF +#define GL_NORMALIZED_RANGE_EXT 0x87E0 +#define GL_FULL_RANGE_EXT 0x87E1 +#define GL_CURRENT_VERTEX_EXT 0x87E2 +#define GL_MVP_MATRIX_EXT 0x87E3 +#define GL_VARIANT_VALUE_EXT 0x87E4 +#define GL_VARIANT_DATATYPE_EXT 0x87E5 +#define GL_VARIANT_ARRAY_STRIDE_EXT 0x87E6 +#define GL_VARIANT_ARRAY_TYPE_EXT 0x87E7 +#define GL_VARIANT_ARRAY_EXT 0x87E8 +#define GL_VARIANT_ARRAY_POINTER_EXT 0x87E9 +#define GL_INVARIANT_VALUE_EXT 0x87EA +#define GL_INVARIANT_DATATYPE_EXT 0x87EB +#define GL_LOCAL_CONSTANT_VALUE_EXT 0x87EC +#define GL_LOCAL_CONSTANT_DATATYPE_EXT 0x87ED + +typedef void (GLAPIENTRY * PFNGLBEGINVERTEXSHADEREXTPROC) (void); +typedef GLuint (GLAPIENTRY * PFNGLBINDLIGHTPARAMETEREXTPROC) (GLenum light, GLenum value); +typedef GLuint (GLAPIENTRY * PFNGLBINDMATERIALPARAMETEREXTPROC) (GLenum face, GLenum value); +typedef GLuint (GLAPIENTRY * PFNGLBINDPARAMETEREXTPROC) (GLenum value); +typedef GLuint (GLAPIENTRY * PFNGLBINDTEXGENPARAMETEREXTPROC) (GLenum unit, GLenum coord, GLenum value); +typedef GLuint (GLAPIENTRY * PFNGLBINDTEXTUREUNITPARAMETEREXTPROC) (GLenum unit, GLenum value); +typedef void (GLAPIENTRY * PFNGLBINDVERTEXSHADEREXTPROC) (GLuint id); +typedef void (GLAPIENTRY * PFNGLDELETEVERTEXSHADEREXTPROC) (GLuint id); +typedef void (GLAPIENTRY * PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC) (GLuint id); +typedef void (GLAPIENTRY * PFNGLENABLEVARIANTCLIENTSTATEEXTPROC) (GLuint id); +typedef void (GLAPIENTRY * PFNGLENDVERTEXSHADEREXTPROC) (void); +typedef void (GLAPIENTRY * PFNGLEXTRACTCOMPONENTEXTPROC) (GLuint res, GLuint src, GLuint num); +typedef GLuint (GLAPIENTRY * PFNGLGENSYMBOLSEXTPROC) (GLenum dataType, GLenum storageType, GLenum range, GLuint components); +typedef GLuint (GLAPIENTRY * PFNGLGENVERTEXSHADERSEXTPROC) (GLuint range); +typedef void (GLAPIENTRY * PFNGLGETINVARIANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data); +typedef void (GLAPIENTRY * PFNGLGETINVARIANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data); +typedef void (GLAPIENTRY * PFNGLGETINVARIANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data); +typedef void (GLAPIENTRY * PFNGLGETLOCALCONSTANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data); +typedef void (GLAPIENTRY * PFNGLGETLOCALCONSTANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data); +typedef void (GLAPIENTRY * PFNGLGETLOCALCONSTANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data); +typedef void (GLAPIENTRY * PFNGLGETVARIANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data); +typedef void (GLAPIENTRY * PFNGLGETVARIANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data); +typedef void (GLAPIENTRY * PFNGLGETVARIANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data); +typedef void (GLAPIENTRY * PFNGLGETVARIANTPOINTERVEXTPROC) (GLuint id, GLenum value, GLvoid **data); +typedef void (GLAPIENTRY * PFNGLINSERTCOMPONENTEXTPROC) (GLuint res, GLuint src, GLuint num); +typedef GLboolean (GLAPIENTRY * PFNGLISVARIANTENABLEDEXTPROC) (GLuint id, GLenum cap); +typedef void (GLAPIENTRY * PFNGLSETINVARIANTEXTPROC) (GLuint id, GLenum type, GLvoid *addr); +typedef void (GLAPIENTRY * PFNGLSETLOCALCONSTANTEXTPROC) (GLuint id, GLenum type, GLvoid *addr); +typedef void (GLAPIENTRY * PFNGLSHADEROP1EXTPROC) (GLenum op, GLuint res, GLuint arg1); +typedef void (GLAPIENTRY * PFNGLSHADEROP2EXTPROC) (GLenum op, GLuint res, GLuint arg1, GLuint arg2); +typedef void (GLAPIENTRY * PFNGLSHADEROP3EXTPROC) (GLenum op, GLuint res, GLuint arg1, GLuint arg2, GLuint arg3); +typedef void (GLAPIENTRY * PFNGLSWIZZLEEXTPROC) (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW); +typedef void (GLAPIENTRY * PFNGLVARIANTPOINTEREXTPROC) (GLuint id, GLenum type, GLuint stride, GLvoid *addr); +typedef void (GLAPIENTRY * PFNGLVARIANTBVEXTPROC) (GLuint id, GLbyte *addr); +typedef void (GLAPIENTRY * PFNGLVARIANTDVEXTPROC) (GLuint id, GLdouble *addr); +typedef void (GLAPIENTRY * PFNGLVARIANTFVEXTPROC) (GLuint id, GLfloat *addr); +typedef void (GLAPIENTRY * PFNGLVARIANTIVEXTPROC) (GLuint id, GLint *addr); +typedef void (GLAPIENTRY * PFNGLVARIANTSVEXTPROC) (GLuint id, GLshort *addr); +typedef void (GLAPIENTRY * PFNGLVARIANTUBVEXTPROC) (GLuint id, GLubyte *addr); +typedef void (GLAPIENTRY * PFNGLVARIANTUIVEXTPROC) (GLuint id, GLuint *addr); +typedef void (GLAPIENTRY * PFNGLVARIANTUSVEXTPROC) (GLuint id, GLushort *addr); +typedef void (GLAPIENTRY * PFNGLWRITEMASKEXTPROC) (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW); + +#define glBeginVertexShaderEXT GLEW_GET_FUN(__glewBeginVertexShaderEXT) +#define glBindLightParameterEXT GLEW_GET_FUN(__glewBindLightParameterEXT) +#define glBindMaterialParameterEXT GLEW_GET_FUN(__glewBindMaterialParameterEXT) +#define glBindParameterEXT GLEW_GET_FUN(__glewBindParameterEXT) +#define glBindTexGenParameterEXT GLEW_GET_FUN(__glewBindTexGenParameterEXT) +#define glBindTextureUnitParameterEXT GLEW_GET_FUN(__glewBindTextureUnitParameterEXT) +#define glBindVertexShaderEXT GLEW_GET_FUN(__glewBindVertexShaderEXT) +#define glDeleteVertexShaderEXT GLEW_GET_FUN(__glewDeleteVertexShaderEXT) +#define glDisableVariantClientStateEXT GLEW_GET_FUN(__glewDisableVariantClientStateEXT) +#define glEnableVariantClientStateEXT GLEW_GET_FUN(__glewEnableVariantClientStateEXT) +#define glEndVertexShaderEXT GLEW_GET_FUN(__glewEndVertexShaderEXT) +#define glExtractComponentEXT GLEW_GET_FUN(__glewExtractComponentEXT) +#define glGenSymbolsEXT GLEW_GET_FUN(__glewGenSymbolsEXT) +#define glGenVertexShadersEXT GLEW_GET_FUN(__glewGenVertexShadersEXT) +#define glGetInvariantBooleanvEXT GLEW_GET_FUN(__glewGetInvariantBooleanvEXT) +#define glGetInvariantFloatvEXT GLEW_GET_FUN(__glewGetInvariantFloatvEXT) +#define glGetInvariantIntegervEXT GLEW_GET_FUN(__glewGetInvariantIntegervEXT) +#define glGetLocalConstantBooleanvEXT GLEW_GET_FUN(__glewGetLocalConstantBooleanvEXT) +#define glGetLocalConstantFloatvEXT GLEW_GET_FUN(__glewGetLocalConstantFloatvEXT) +#define glGetLocalConstantIntegervEXT GLEW_GET_FUN(__glewGetLocalConstantIntegervEXT) +#define glGetVariantBooleanvEXT GLEW_GET_FUN(__glewGetVariantBooleanvEXT) +#define glGetVariantFloatvEXT GLEW_GET_FUN(__glewGetVariantFloatvEXT) +#define glGetVariantIntegervEXT GLEW_GET_FUN(__glewGetVariantIntegervEXT) +#define glGetVariantPointervEXT GLEW_GET_FUN(__glewGetVariantPointervEXT) +#define glInsertComponentEXT GLEW_GET_FUN(__glewInsertComponentEXT) +#define glIsVariantEnabledEXT GLEW_GET_FUN(__glewIsVariantEnabledEXT) +#define glSetInvariantEXT GLEW_GET_FUN(__glewSetInvariantEXT) +#define glSetLocalConstantEXT GLEW_GET_FUN(__glewSetLocalConstantEXT) +#define glShaderOp1EXT GLEW_GET_FUN(__glewShaderOp1EXT) +#define glShaderOp2EXT GLEW_GET_FUN(__glewShaderOp2EXT) +#define glShaderOp3EXT GLEW_GET_FUN(__glewShaderOp3EXT) +#define glSwizzleEXT GLEW_GET_FUN(__glewSwizzleEXT) +#define glVariantPointerEXT GLEW_GET_FUN(__glewVariantPointerEXT) +#define glVariantbvEXT GLEW_GET_FUN(__glewVariantbvEXT) +#define glVariantdvEXT GLEW_GET_FUN(__glewVariantdvEXT) +#define glVariantfvEXT GLEW_GET_FUN(__glewVariantfvEXT) +#define glVariantivEXT GLEW_GET_FUN(__glewVariantivEXT) +#define glVariantsvEXT GLEW_GET_FUN(__glewVariantsvEXT) +#define glVariantubvEXT GLEW_GET_FUN(__glewVariantubvEXT) +#define glVariantuivEXT GLEW_GET_FUN(__glewVariantuivEXT) +#define glVariantusvEXT GLEW_GET_FUN(__glewVariantusvEXT) +#define glWriteMaskEXT GLEW_GET_FUN(__glewWriteMaskEXT) + +#define GLEW_EXT_vertex_shader GLEW_GET_VAR(__GLEW_EXT_vertex_shader) + +#endif /* GL_EXT_vertex_shader */ + +/* ------------------------ GL_EXT_vertex_weighting ------------------------ */ + +#ifndef GL_EXT_vertex_weighting +#define GL_EXT_vertex_weighting 1 + +#define GL_MODELVIEW0_STACK_DEPTH_EXT 0x0BA3 +#define GL_MODELVIEW0_MATRIX_EXT 0x0BA6 +#define GL_MODELVIEW0_EXT 0x1700 +#define GL_MODELVIEW1_STACK_DEPTH_EXT 0x8502 +#define GL_MODELVIEW1_MATRIX_EXT 0x8506 +#define GL_VERTEX_WEIGHTING_EXT 0x8509 +#define GL_MODELVIEW1_EXT 0x850A +#define GL_CURRENT_VERTEX_WEIGHT_EXT 0x850B +#define GL_VERTEX_WEIGHT_ARRAY_EXT 0x850C +#define GL_VERTEX_WEIGHT_ARRAY_SIZE_EXT 0x850D +#define GL_VERTEX_WEIGHT_ARRAY_TYPE_EXT 0x850E +#define GL_VERTEX_WEIGHT_ARRAY_STRIDE_EXT 0x850F +#define GL_VERTEX_WEIGHT_ARRAY_POINTER_EXT 0x8510 + +typedef void (GLAPIENTRY * PFNGLVERTEXWEIGHTPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLvoid *pointer); +typedef void (GLAPIENTRY * PFNGLVERTEXWEIGHTFEXTPROC) (GLfloat weight); +typedef void (GLAPIENTRY * PFNGLVERTEXWEIGHTFVEXTPROC) (GLfloat* weight); + +#define glVertexWeightPointerEXT GLEW_GET_FUN(__glewVertexWeightPointerEXT) +#define glVertexWeightfEXT GLEW_GET_FUN(__glewVertexWeightfEXT) +#define glVertexWeightfvEXT GLEW_GET_FUN(__glewVertexWeightfvEXT) + +#define GLEW_EXT_vertex_weighting GLEW_GET_VAR(__GLEW_EXT_vertex_weighting) + +#endif /* GL_EXT_vertex_weighting */ + +/* ------------------------- GL_EXT_x11_sync_object ------------------------ */ + +#ifndef GL_EXT_x11_sync_object +#define GL_EXT_x11_sync_object 1 + +#define GL_SYNC_X11_FENCE_EXT 0x90E1 + +typedef GLsync (GLAPIENTRY * PFNGLIMPORTSYNCEXTPROC) (GLenum external_sync_type, GLintptr external_sync, GLbitfield flags); + +#define glImportSyncEXT GLEW_GET_FUN(__glewImportSyncEXT) + +#define GLEW_EXT_x11_sync_object GLEW_GET_VAR(__GLEW_EXT_x11_sync_object) + +#endif /* GL_EXT_x11_sync_object */ + +/* ---------------------- GL_GREMEDY_frame_terminator ---------------------- */ + +#ifndef GL_GREMEDY_frame_terminator +#define GL_GREMEDY_frame_terminator 1 + +typedef void (GLAPIENTRY * PFNGLFRAMETERMINATORGREMEDYPROC) (void); + +#define glFrameTerminatorGREMEDY GLEW_GET_FUN(__glewFrameTerminatorGREMEDY) + +#define GLEW_GREMEDY_frame_terminator GLEW_GET_VAR(__GLEW_GREMEDY_frame_terminator) + +#endif /* GL_GREMEDY_frame_terminator */ + +/* ------------------------ GL_GREMEDY_string_marker ----------------------- */ + +#ifndef GL_GREMEDY_string_marker +#define GL_GREMEDY_string_marker 1 + +typedef void (GLAPIENTRY * PFNGLSTRINGMARKERGREMEDYPROC) (GLsizei len, const GLvoid *string); + +#define glStringMarkerGREMEDY GLEW_GET_FUN(__glewStringMarkerGREMEDY) + +#define GLEW_GREMEDY_string_marker GLEW_GET_VAR(__GLEW_GREMEDY_string_marker) + +#endif /* GL_GREMEDY_string_marker */ + +/* --------------------- GL_HP_convolution_border_modes -------------------- */ + +#ifndef GL_HP_convolution_border_modes +#define GL_HP_convolution_border_modes 1 + +#define GLEW_HP_convolution_border_modes GLEW_GET_VAR(__GLEW_HP_convolution_border_modes) + +#endif /* GL_HP_convolution_border_modes */ + +/* ------------------------- GL_HP_image_transform ------------------------- */ + +#ifndef GL_HP_image_transform +#define GL_HP_image_transform 1 + +typedef void (GLAPIENTRY * PFNGLGETIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETIMAGETRANSFORMPARAMETERIVHPPROC) (GLenum target, GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLIMAGETRANSFORMPARAMETERFHPPROC) (GLenum target, GLenum pname, const GLfloat param); +typedef void (GLAPIENTRY * PFNGLIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLIMAGETRANSFORMPARAMETERIHPPROC) (GLenum target, GLenum pname, const GLint param); +typedef void (GLAPIENTRY * PFNGLIMAGETRANSFORMPARAMETERIVHPPROC) (GLenum target, GLenum pname, const GLint* params); + +#define glGetImageTransformParameterfvHP GLEW_GET_FUN(__glewGetImageTransformParameterfvHP) +#define glGetImageTransformParameterivHP GLEW_GET_FUN(__glewGetImageTransformParameterivHP) +#define glImageTransformParameterfHP GLEW_GET_FUN(__glewImageTransformParameterfHP) +#define glImageTransformParameterfvHP GLEW_GET_FUN(__glewImageTransformParameterfvHP) +#define glImageTransformParameteriHP GLEW_GET_FUN(__glewImageTransformParameteriHP) +#define glImageTransformParameterivHP GLEW_GET_FUN(__glewImageTransformParameterivHP) + +#define GLEW_HP_image_transform GLEW_GET_VAR(__GLEW_HP_image_transform) + +#endif /* GL_HP_image_transform */ + +/* -------------------------- GL_HP_occlusion_test ------------------------- */ + +#ifndef GL_HP_occlusion_test +#define GL_HP_occlusion_test 1 + +#define GLEW_HP_occlusion_test GLEW_GET_VAR(__GLEW_HP_occlusion_test) + +#endif /* GL_HP_occlusion_test */ + +/* ------------------------- GL_HP_texture_lighting ------------------------ */ + +#ifndef GL_HP_texture_lighting +#define GL_HP_texture_lighting 1 + +#define GLEW_HP_texture_lighting GLEW_GET_VAR(__GLEW_HP_texture_lighting) + +#endif /* GL_HP_texture_lighting */ + +/* --------------------------- GL_IBM_cull_vertex -------------------------- */ + +#ifndef GL_IBM_cull_vertex +#define GL_IBM_cull_vertex 1 + +#define GL_CULL_VERTEX_IBM 103050 + +#define GLEW_IBM_cull_vertex GLEW_GET_VAR(__GLEW_IBM_cull_vertex) + +#endif /* GL_IBM_cull_vertex */ + +/* ---------------------- GL_IBM_multimode_draw_arrays --------------------- */ + +#ifndef GL_IBM_multimode_draw_arrays +#define GL_IBM_multimode_draw_arrays 1 + +typedef void (GLAPIENTRY * PFNGLMULTIMODEDRAWARRAYSIBMPROC) (const GLenum* mode, const GLint *first, const GLsizei *count, GLsizei primcount, GLint modestride); +typedef void (GLAPIENTRY * PFNGLMULTIMODEDRAWELEMENTSIBMPROC) (const GLenum* mode, const GLsizei *count, GLenum type, const GLvoid * const *indices, GLsizei primcount, GLint modestride); + +#define glMultiModeDrawArraysIBM GLEW_GET_FUN(__glewMultiModeDrawArraysIBM) +#define glMultiModeDrawElementsIBM GLEW_GET_FUN(__glewMultiModeDrawElementsIBM) + +#define GLEW_IBM_multimode_draw_arrays GLEW_GET_VAR(__GLEW_IBM_multimode_draw_arrays) + +#endif /* GL_IBM_multimode_draw_arrays */ + +/* ------------------------- GL_IBM_rasterpos_clip ------------------------- */ + +#ifndef GL_IBM_rasterpos_clip +#define GL_IBM_rasterpos_clip 1 + +#define GL_RASTER_POSITION_UNCLIPPED_IBM 103010 + +#define GLEW_IBM_rasterpos_clip GLEW_GET_VAR(__GLEW_IBM_rasterpos_clip) + +#endif /* GL_IBM_rasterpos_clip */ + +/* --------------------------- GL_IBM_static_data -------------------------- */ + +#ifndef GL_IBM_static_data +#define GL_IBM_static_data 1 + +#define GL_ALL_STATIC_DATA_IBM 103060 +#define GL_STATIC_VERTEX_ARRAY_IBM 103061 + +#define GLEW_IBM_static_data GLEW_GET_VAR(__GLEW_IBM_static_data) + +#endif /* GL_IBM_static_data */ + +/* --------------------- GL_IBM_texture_mirrored_repeat -------------------- */ + +#ifndef GL_IBM_texture_mirrored_repeat +#define GL_IBM_texture_mirrored_repeat 1 + +#define GL_MIRRORED_REPEAT_IBM 0x8370 + +#define GLEW_IBM_texture_mirrored_repeat GLEW_GET_VAR(__GLEW_IBM_texture_mirrored_repeat) + +#endif /* GL_IBM_texture_mirrored_repeat */ + +/* ----------------------- GL_IBM_vertex_array_lists ----------------------- */ + +#ifndef GL_IBM_vertex_array_lists +#define GL_IBM_vertex_array_lists 1 + +#define GL_VERTEX_ARRAY_LIST_IBM 103070 +#define GL_NORMAL_ARRAY_LIST_IBM 103071 +#define GL_COLOR_ARRAY_LIST_IBM 103072 +#define GL_INDEX_ARRAY_LIST_IBM 103073 +#define GL_TEXTURE_COORD_ARRAY_LIST_IBM 103074 +#define GL_EDGE_FLAG_ARRAY_LIST_IBM 103075 +#define GL_FOG_COORDINATE_ARRAY_LIST_IBM 103076 +#define GL_SECONDARY_COLOR_ARRAY_LIST_IBM 103077 +#define GL_VERTEX_ARRAY_LIST_STRIDE_IBM 103080 +#define GL_NORMAL_ARRAY_LIST_STRIDE_IBM 103081 +#define GL_COLOR_ARRAY_LIST_STRIDE_IBM 103082 +#define GL_INDEX_ARRAY_LIST_STRIDE_IBM 103083 +#define GL_TEXTURE_COORD_ARRAY_LIST_STRIDE_IBM 103084 +#define GL_EDGE_FLAG_ARRAY_LIST_STRIDE_IBM 103085 +#define GL_FOG_COORDINATE_ARRAY_LIST_STRIDE_IBM 103086 +#define GL_SECONDARY_COLOR_ARRAY_LIST_STRIDE_IBM 103087 + +typedef void (GLAPIENTRY * PFNGLCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid ** pointer, GLint ptrstride); +typedef void (GLAPIENTRY * PFNGLEDGEFLAGPOINTERLISTIBMPROC) (GLint stride, const GLboolean ** pointer, GLint ptrstride); +typedef void (GLAPIENTRY * PFNGLFOGCOORDPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid ** pointer, GLint ptrstride); +typedef void (GLAPIENTRY * PFNGLINDEXPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid ** pointer, GLint ptrstride); +typedef void (GLAPIENTRY * PFNGLNORMALPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid ** pointer, GLint ptrstride); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid ** pointer, GLint ptrstride); +typedef void (GLAPIENTRY * PFNGLTEXCOORDPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid ** pointer, GLint ptrstride); +typedef void (GLAPIENTRY * PFNGLVERTEXPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid ** pointer, GLint ptrstride); + +#define glColorPointerListIBM GLEW_GET_FUN(__glewColorPointerListIBM) +#define glEdgeFlagPointerListIBM GLEW_GET_FUN(__glewEdgeFlagPointerListIBM) +#define glFogCoordPointerListIBM GLEW_GET_FUN(__glewFogCoordPointerListIBM) +#define glIndexPointerListIBM GLEW_GET_FUN(__glewIndexPointerListIBM) +#define glNormalPointerListIBM GLEW_GET_FUN(__glewNormalPointerListIBM) +#define glSecondaryColorPointerListIBM GLEW_GET_FUN(__glewSecondaryColorPointerListIBM) +#define glTexCoordPointerListIBM GLEW_GET_FUN(__glewTexCoordPointerListIBM) +#define glVertexPointerListIBM GLEW_GET_FUN(__glewVertexPointerListIBM) + +#define GLEW_IBM_vertex_array_lists GLEW_GET_VAR(__GLEW_IBM_vertex_array_lists) + +#endif /* GL_IBM_vertex_array_lists */ + +/* -------------------------- GL_INGR_color_clamp -------------------------- */ + +#ifndef GL_INGR_color_clamp +#define GL_INGR_color_clamp 1 + +#define GL_RED_MIN_CLAMP_INGR 0x8560 +#define GL_GREEN_MIN_CLAMP_INGR 0x8561 +#define GL_BLUE_MIN_CLAMP_INGR 0x8562 +#define GL_ALPHA_MIN_CLAMP_INGR 0x8563 +#define GL_RED_MAX_CLAMP_INGR 0x8564 +#define GL_GREEN_MAX_CLAMP_INGR 0x8565 +#define GL_BLUE_MAX_CLAMP_INGR 0x8566 +#define GL_ALPHA_MAX_CLAMP_INGR 0x8567 + +#define GLEW_INGR_color_clamp GLEW_GET_VAR(__GLEW_INGR_color_clamp) + +#endif /* GL_INGR_color_clamp */ + +/* ------------------------- GL_INGR_interlace_read ------------------------ */ + +#ifndef GL_INGR_interlace_read +#define GL_INGR_interlace_read 1 + +#define GL_INTERLACE_READ_INGR 0x8568 + +#define GLEW_INGR_interlace_read GLEW_GET_VAR(__GLEW_INGR_interlace_read) + +#endif /* GL_INGR_interlace_read */ + +/* -------------------------- GL_INTEL_map_texture ------------------------- */ + +#ifndef GL_INTEL_map_texture +#define GL_INTEL_map_texture 1 + +#define GL_LAYOUT_DEFAULT_INTEL 0 +#define GL_LAYOUT_LINEAR_INTEL 1 +#define GL_LAYOUT_LINEAR_CPU_CACHED_INTEL 2 +#define GL_TEXTURE_MEMORY_LAYOUT_INTEL 0x83FF + +typedef GLvoid * (GLAPIENTRY * PFNGLMAPTEXTURE2DINTELPROC) (GLuint texture, GLint level, GLbitfield access, GLint* stride, GLenum *layout); +typedef void (GLAPIENTRY * PFNGLSYNCTEXTUREINTELPROC) (GLuint texture); +typedef void (GLAPIENTRY * PFNGLUNMAPTEXTURE2DINTELPROC) (GLuint texture, GLint level); + +#define glMapTexture2DINTEL GLEW_GET_FUN(__glewMapTexture2DINTEL) +#define glSyncTextureINTEL GLEW_GET_FUN(__glewSyncTextureINTEL) +#define glUnmapTexture2DINTEL GLEW_GET_FUN(__glewUnmapTexture2DINTEL) + +#define GLEW_INTEL_map_texture GLEW_GET_VAR(__GLEW_INTEL_map_texture) + +#endif /* GL_INTEL_map_texture */ + +/* ------------------------ GL_INTEL_parallel_arrays ----------------------- */ + +#ifndef GL_INTEL_parallel_arrays +#define GL_INTEL_parallel_arrays 1 + +#define GL_PARALLEL_ARRAYS_INTEL 0x83F4 +#define GL_VERTEX_ARRAY_PARALLEL_POINTERS_INTEL 0x83F5 +#define GL_NORMAL_ARRAY_PARALLEL_POINTERS_INTEL 0x83F6 +#define GL_COLOR_ARRAY_PARALLEL_POINTERS_INTEL 0x83F7 +#define GL_TEXTURE_COORD_ARRAY_PARALLEL_POINTERS_INTEL 0x83F8 + +typedef void (GLAPIENTRY * PFNGLCOLORPOINTERVINTELPROC) (GLint size, GLenum type, const void** pointer); +typedef void (GLAPIENTRY * PFNGLNORMALPOINTERVINTELPROC) (GLenum type, const void** pointer); +typedef void (GLAPIENTRY * PFNGLTEXCOORDPOINTERVINTELPROC) (GLint size, GLenum type, const void** pointer); +typedef void (GLAPIENTRY * PFNGLVERTEXPOINTERVINTELPROC) (GLint size, GLenum type, const void** pointer); + +#define glColorPointervINTEL GLEW_GET_FUN(__glewColorPointervINTEL) +#define glNormalPointervINTEL GLEW_GET_FUN(__glewNormalPointervINTEL) +#define glTexCoordPointervINTEL GLEW_GET_FUN(__glewTexCoordPointervINTEL) +#define glVertexPointervINTEL GLEW_GET_FUN(__glewVertexPointervINTEL) + +#define GLEW_INTEL_parallel_arrays GLEW_GET_VAR(__GLEW_INTEL_parallel_arrays) + +#endif /* GL_INTEL_parallel_arrays */ + +/* ------------------------ GL_INTEL_texture_scissor ----------------------- */ + +#ifndef GL_INTEL_texture_scissor +#define GL_INTEL_texture_scissor 1 + +typedef void (GLAPIENTRY * PFNGLTEXSCISSORFUNCINTELPROC) (GLenum target, GLenum lfunc, GLenum hfunc); +typedef void (GLAPIENTRY * PFNGLTEXSCISSORINTELPROC) (GLenum target, GLclampf tlow, GLclampf thigh); + +#define glTexScissorFuncINTEL GLEW_GET_FUN(__glewTexScissorFuncINTEL) +#define glTexScissorINTEL GLEW_GET_FUN(__glewTexScissorINTEL) + +#define GLEW_INTEL_texture_scissor GLEW_GET_VAR(__GLEW_INTEL_texture_scissor) + +#endif /* GL_INTEL_texture_scissor */ + +/* ------------------------------ GL_KHR_debug ----------------------------- */ + +#ifndef GL_KHR_debug +#define GL_KHR_debug 1 + +#define GL_CONTEXT_FLAG_DEBUG_BIT 0x00000002 +#define GL_STACK_OVERFLOW 0x0503 +#define GL_STACK_UNDERFLOW 0x0504 +#define GL_DEBUG_OUTPUT_SYNCHRONOUS 0x8242 +#define GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH 0x8243 +#define GL_DEBUG_CALLBACK_FUNCTION 0x8244 +#define GL_DEBUG_CALLBACK_USER_PARAM 0x8245 +#define GL_DEBUG_SOURCE_API 0x8246 +#define GL_DEBUG_SOURCE_WINDOW_SYSTEM 0x8247 +#define GL_DEBUG_SOURCE_SHADER_COMPILER 0x8248 +#define GL_DEBUG_SOURCE_THIRD_PARTY 0x8249 +#define GL_DEBUG_SOURCE_APPLICATION 0x824A +#define GL_DEBUG_SOURCE_OTHER 0x824B +#define GL_DEBUG_TYPE_ERROR 0x824C +#define GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR 0x824D +#define GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR 0x824E +#define GL_DEBUG_TYPE_PORTABILITY 0x824F +#define GL_DEBUG_TYPE_PERFORMANCE 0x8250 +#define GL_DEBUG_TYPE_OTHER 0x8251 +#define GL_DEBUG_TYPE_MARKER 0x8268 +#define GL_DEBUG_TYPE_PUSH_GROUP 0x8269 +#define GL_DEBUG_TYPE_POP_GROUP 0x826A +#define GL_DEBUG_SEVERITY_NOTIFICATION 0x826B +#define GL_MAX_DEBUG_GROUP_STACK_DEPTH 0x826C +#define GL_DEBUG_GROUP_STACK_DEPTH 0x826D +#define GL_BUFFER 0x82E0 +#define GL_SHADER 0x82E1 +#define GL_PROGRAM 0x82E2 +#define GL_QUERY 0x82E3 +#define GL_PROGRAM_PIPELINE 0x82E4 +#define GL_SAMPLER 0x82E6 +#define GL_DISPLAY_LIST 0x82E7 +#define GL_MAX_LABEL_LENGTH 0x82E8 +#define GL_MAX_DEBUG_MESSAGE_LENGTH 0x9143 +#define GL_MAX_DEBUG_LOGGED_MESSAGES 0x9144 +#define GL_DEBUG_LOGGED_MESSAGES 0x9145 +#define GL_DEBUG_SEVERITY_HIGH 0x9146 +#define GL_DEBUG_SEVERITY_MEDIUM 0x9147 +#define GL_DEBUG_SEVERITY_LOW 0x9148 +#define GL_DEBUG_OUTPUT 0x92E0 + +typedef void (APIENTRY *GLDEBUGPROC)(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar* message, GLvoid* userParam); + +typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGECALLBACKPROC) (GLDEBUGPROC callback, const GLvoid *userParam); +typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGECONTROLPROC) (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint* ids, GLboolean enabled); +typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGEINSERTPROC) (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar* buf); +typedef GLuint (GLAPIENTRY * PFNGLGETDEBUGMESSAGELOGPROC) (GLuint count, GLsizei bufsize, GLenum* sources, GLenum* types, GLuint* ids, GLenum* severities, GLsizei* lengths, GLchar* messageLog); +typedef void (GLAPIENTRY * PFNGLGETOBJECTLABELPROC) (GLenum identifier, GLuint name, GLsizei bufSize, GLsizei* length, GLchar *label); +typedef void (GLAPIENTRY * PFNGLGETOBJECTPTRLABELPROC) (void* ptr, GLsizei bufSize, GLsizei* length, GLchar *label); +typedef void (GLAPIENTRY * PFNGLOBJECTLABELPROC) (GLenum identifier, GLuint name, GLsizei length, const GLchar* label); +typedef void (GLAPIENTRY * PFNGLOBJECTPTRLABELPROC) (void* ptr, GLsizei length, const GLchar* label); +typedef void (GLAPIENTRY * PFNGLPOPDEBUGGROUPPROC) (void); +typedef void (GLAPIENTRY * PFNGLPUSHDEBUGGROUPPROC) (GLenum source, GLuint id, GLsizei length, const GLchar * message); + +#define glDebugMessageCallback GLEW_GET_FUN(__glewDebugMessageCallback) +#define glDebugMessageControl GLEW_GET_FUN(__glewDebugMessageControl) +#define glDebugMessageInsert GLEW_GET_FUN(__glewDebugMessageInsert) +#define glGetDebugMessageLog GLEW_GET_FUN(__glewGetDebugMessageLog) +#define glGetObjectLabel GLEW_GET_FUN(__glewGetObjectLabel) +#define glGetObjectPtrLabel GLEW_GET_FUN(__glewGetObjectPtrLabel) +#define glObjectLabel GLEW_GET_FUN(__glewObjectLabel) +#define glObjectPtrLabel GLEW_GET_FUN(__glewObjectPtrLabel) +#define glPopDebugGroup GLEW_GET_FUN(__glewPopDebugGroup) +#define glPushDebugGroup GLEW_GET_FUN(__glewPushDebugGroup) + +#define GLEW_KHR_debug GLEW_GET_VAR(__GLEW_KHR_debug) + +#endif /* GL_KHR_debug */ + +/* ------------------ GL_KHR_texture_compression_astc_ldr ------------------ */ + +#ifndef GL_KHR_texture_compression_astc_ldr +#define GL_KHR_texture_compression_astc_ldr 1 + +#define GL_COMPRESSED_RGBA_ASTC_4x4_KHR 0x93B0 +#define GL_COMPRESSED_RGBA_ASTC_5x4_KHR 0x93B1 +#define GL_COMPRESSED_RGBA_ASTC_5x5_KHR 0x93B2 +#define GL_COMPRESSED_RGBA_ASTC_6x5_KHR 0x93B3 +#define GL_COMPRESSED_RGBA_ASTC_6x6_KHR 0x93B4 +#define GL_COMPRESSED_RGBA_ASTC_8x5_KHR 0x93B5 +#define GL_COMPRESSED_RGBA_ASTC_8x6_KHR 0x93B6 +#define GL_COMPRESSED_RGBA_ASTC_8x8_KHR 0x93B7 +#define GL_COMPRESSED_RGBA_ASTC_10x5_KHR 0x93B8 +#define GL_COMPRESSED_RGBA_ASTC_10x6_KHR 0x93B9 +#define GL_COMPRESSED_RGBA_ASTC_10x8_KHR 0x93BA +#define GL_COMPRESSED_RGBA_ASTC_10x10_KHR 0x93BB +#define GL_COMPRESSED_RGBA_ASTC_12x10_KHR 0x93BC +#define GL_COMPRESSED_RGBA_ASTC_12x12_KHR 0x93BD +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR 0x93D0 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR 0x93D1 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR 0x93D2 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR 0x93D3 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR 0x93D4 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR 0x93D5 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR 0x93D6 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR 0x93D7 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR 0x93D8 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR 0x93D9 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR 0x93DA +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR 0x93DB +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR 0x93DC +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR 0x93DD + +#define GLEW_KHR_texture_compression_astc_ldr GLEW_GET_VAR(__GLEW_KHR_texture_compression_astc_ldr) + +#endif /* GL_KHR_texture_compression_astc_ldr */ + +/* -------------------------- GL_KTX_buffer_region ------------------------- */ + +#ifndef GL_KTX_buffer_region +#define GL_KTX_buffer_region 1 + +#define GL_KTX_FRONT_REGION 0x0 +#define GL_KTX_BACK_REGION 0x1 +#define GL_KTX_Z_REGION 0x2 +#define GL_KTX_STENCIL_REGION 0x3 + +typedef GLuint (GLAPIENTRY * PFNGLBUFFERREGIONENABLEDPROC) (void); +typedef void (GLAPIENTRY * PFNGLDELETEBUFFERREGIONPROC) (GLenum region); +typedef void (GLAPIENTRY * PFNGLDRAWBUFFERREGIONPROC) (GLuint region, GLint x, GLint y, GLsizei width, GLsizei height, GLint xDest, GLint yDest); +typedef GLuint (GLAPIENTRY * PFNGLNEWBUFFERREGIONPROC) (GLenum region); +typedef void (GLAPIENTRY * PFNGLREADBUFFERREGIONPROC) (GLuint region, GLint x, GLint y, GLsizei width, GLsizei height); + +#define glBufferRegionEnabled GLEW_GET_FUN(__glewBufferRegionEnabled) +#define glDeleteBufferRegion GLEW_GET_FUN(__glewDeleteBufferRegion) +#define glDrawBufferRegion GLEW_GET_FUN(__glewDrawBufferRegion) +#define glNewBufferRegion GLEW_GET_FUN(__glewNewBufferRegion) +#define glReadBufferRegion GLEW_GET_FUN(__glewReadBufferRegion) + +#define GLEW_KTX_buffer_region GLEW_GET_VAR(__GLEW_KTX_buffer_region) + +#endif /* GL_KTX_buffer_region */ + +/* ------------------------- GL_MESAX_texture_stack ------------------------ */ + +#ifndef GL_MESAX_texture_stack +#define GL_MESAX_texture_stack 1 + +#define GL_TEXTURE_1D_STACK_MESAX 0x8759 +#define GL_TEXTURE_2D_STACK_MESAX 0x875A +#define GL_PROXY_TEXTURE_1D_STACK_MESAX 0x875B +#define GL_PROXY_TEXTURE_2D_STACK_MESAX 0x875C +#define GL_TEXTURE_1D_STACK_BINDING_MESAX 0x875D +#define GL_TEXTURE_2D_STACK_BINDING_MESAX 0x875E + +#define GLEW_MESAX_texture_stack GLEW_GET_VAR(__GLEW_MESAX_texture_stack) + +#endif /* GL_MESAX_texture_stack */ + +/* -------------------------- GL_MESA_pack_invert -------------------------- */ + +#ifndef GL_MESA_pack_invert +#define GL_MESA_pack_invert 1 + +#define GL_PACK_INVERT_MESA 0x8758 + +#define GLEW_MESA_pack_invert GLEW_GET_VAR(__GLEW_MESA_pack_invert) + +#endif /* GL_MESA_pack_invert */ + +/* ------------------------- GL_MESA_resize_buffers ------------------------ */ + +#ifndef GL_MESA_resize_buffers +#define GL_MESA_resize_buffers 1 + +typedef void (GLAPIENTRY * PFNGLRESIZEBUFFERSMESAPROC) (void); + +#define glResizeBuffersMESA GLEW_GET_FUN(__glewResizeBuffersMESA) + +#define GLEW_MESA_resize_buffers GLEW_GET_VAR(__GLEW_MESA_resize_buffers) + +#endif /* GL_MESA_resize_buffers */ + +/* --------------------------- GL_MESA_window_pos -------------------------- */ + +#ifndef GL_MESA_window_pos +#define GL_MESA_window_pos 1 + +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2DMESAPROC) (GLdouble x, GLdouble y); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2DVMESAPROC) (const GLdouble* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2FMESAPROC) (GLfloat x, GLfloat y); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2FVMESAPROC) (const GLfloat* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2IMESAPROC) (GLint x, GLint y); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2IVMESAPROC) (const GLint* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2SMESAPROC) (GLshort x, GLshort y); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2SVMESAPROC) (const GLshort* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3DMESAPROC) (GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3DVMESAPROC) (const GLdouble* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3FMESAPROC) (GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3FVMESAPROC) (const GLfloat* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3IMESAPROC) (GLint x, GLint y, GLint z); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3IVMESAPROC) (const GLint* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3SMESAPROC) (GLshort x, GLshort y, GLshort z); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3SVMESAPROC) (const GLshort* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS4DMESAPROC) (GLdouble x, GLdouble y, GLdouble z, GLdouble); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS4DVMESAPROC) (const GLdouble* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS4FMESAPROC) (GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS4FVMESAPROC) (const GLfloat* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS4IMESAPROC) (GLint x, GLint y, GLint z, GLint w); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS4IVMESAPROC) (const GLint* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS4SMESAPROC) (GLshort x, GLshort y, GLshort z, GLshort w); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS4SVMESAPROC) (const GLshort* p); + +#define glWindowPos2dMESA GLEW_GET_FUN(__glewWindowPos2dMESA) +#define glWindowPos2dvMESA GLEW_GET_FUN(__glewWindowPos2dvMESA) +#define glWindowPos2fMESA GLEW_GET_FUN(__glewWindowPos2fMESA) +#define glWindowPos2fvMESA GLEW_GET_FUN(__glewWindowPos2fvMESA) +#define glWindowPos2iMESA GLEW_GET_FUN(__glewWindowPos2iMESA) +#define glWindowPos2ivMESA GLEW_GET_FUN(__glewWindowPos2ivMESA) +#define glWindowPos2sMESA GLEW_GET_FUN(__glewWindowPos2sMESA) +#define glWindowPos2svMESA GLEW_GET_FUN(__glewWindowPos2svMESA) +#define glWindowPos3dMESA GLEW_GET_FUN(__glewWindowPos3dMESA) +#define glWindowPos3dvMESA GLEW_GET_FUN(__glewWindowPos3dvMESA) +#define glWindowPos3fMESA GLEW_GET_FUN(__glewWindowPos3fMESA) +#define glWindowPos3fvMESA GLEW_GET_FUN(__glewWindowPos3fvMESA) +#define glWindowPos3iMESA GLEW_GET_FUN(__glewWindowPos3iMESA) +#define glWindowPos3ivMESA GLEW_GET_FUN(__glewWindowPos3ivMESA) +#define glWindowPos3sMESA GLEW_GET_FUN(__glewWindowPos3sMESA) +#define glWindowPos3svMESA GLEW_GET_FUN(__glewWindowPos3svMESA) +#define glWindowPos4dMESA GLEW_GET_FUN(__glewWindowPos4dMESA) +#define glWindowPos4dvMESA GLEW_GET_FUN(__glewWindowPos4dvMESA) +#define glWindowPos4fMESA GLEW_GET_FUN(__glewWindowPos4fMESA) +#define glWindowPos4fvMESA GLEW_GET_FUN(__glewWindowPos4fvMESA) +#define glWindowPos4iMESA GLEW_GET_FUN(__glewWindowPos4iMESA) +#define glWindowPos4ivMESA GLEW_GET_FUN(__glewWindowPos4ivMESA) +#define glWindowPos4sMESA GLEW_GET_FUN(__glewWindowPos4sMESA) +#define glWindowPos4svMESA GLEW_GET_FUN(__glewWindowPos4svMESA) + +#define GLEW_MESA_window_pos GLEW_GET_VAR(__GLEW_MESA_window_pos) + +#endif /* GL_MESA_window_pos */ + +/* ------------------------- GL_MESA_ycbcr_texture ------------------------- */ + +#ifndef GL_MESA_ycbcr_texture +#define GL_MESA_ycbcr_texture 1 + +#define GL_UNSIGNED_SHORT_8_8_MESA 0x85BA +#define GL_UNSIGNED_SHORT_8_8_REV_MESA 0x85BB +#define GL_YCBCR_MESA 0x8757 + +#define GLEW_MESA_ycbcr_texture GLEW_GET_VAR(__GLEW_MESA_ycbcr_texture) + +#endif /* GL_MESA_ycbcr_texture */ + +/* ----------------------- GL_NVX_conditional_render ----------------------- */ + +#ifndef GL_NVX_conditional_render +#define GL_NVX_conditional_render 1 + +typedef void (GLAPIENTRY * PFNGLBEGINCONDITIONALRENDERNVXPROC) (GLuint id); +typedef void (GLAPIENTRY * PFNGLENDCONDITIONALRENDERNVXPROC) (void); + +#define glBeginConditionalRenderNVX GLEW_GET_FUN(__glewBeginConditionalRenderNVX) +#define glEndConditionalRenderNVX GLEW_GET_FUN(__glewEndConditionalRenderNVX) + +#define GLEW_NVX_conditional_render GLEW_GET_VAR(__GLEW_NVX_conditional_render) + +#endif /* GL_NVX_conditional_render */ + +/* ------------------------- GL_NVX_gpu_memory_info ------------------------ */ + +#ifndef GL_NVX_gpu_memory_info +#define GL_NVX_gpu_memory_info 1 + +#define GL_GPU_MEMORY_INFO_DEDICATED_VIDMEM_NVX 0x9047 +#define GL_GPU_MEMORY_INFO_TOTAL_AVAILABLE_MEMORY_NVX 0x9048 +#define GL_GPU_MEMORY_INFO_CURRENT_AVAILABLE_VIDMEM_NVX 0x9049 +#define GL_GPU_MEMORY_INFO_EVICTION_COUNT_NVX 0x904A +#define GL_GPU_MEMORY_INFO_EVICTED_MEMORY_NVX 0x904B + +#define GLEW_NVX_gpu_memory_info GLEW_GET_VAR(__GLEW_NVX_gpu_memory_info) + +#endif /* GL_NVX_gpu_memory_info */ + +/* ------------------- GL_NV_bindless_multi_draw_indirect ------------------ */ + +#ifndef GL_NV_bindless_multi_draw_indirect +#define GL_NV_bindless_multi_draw_indirect 1 + +typedef void (GLAPIENTRY * PFNGLMULTIDRAWARRAYSINDIRECTBINDLESSNVPROC) (GLenum mode, const GLvoid *indirect, GLsizei drawCount, GLsizei stride, GLint vertexBufferCount); +typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSINDIRECTBINDLESSNVPROC) (GLenum mode, GLenum type, const GLvoid *indirect, GLsizei drawCount, GLsizei stride, GLint vertexBufferCount); + +#define glMultiDrawArraysIndirectBindlessNV GLEW_GET_FUN(__glewMultiDrawArraysIndirectBindlessNV) +#define glMultiDrawElementsIndirectBindlessNV GLEW_GET_FUN(__glewMultiDrawElementsIndirectBindlessNV) + +#define GLEW_NV_bindless_multi_draw_indirect GLEW_GET_VAR(__GLEW_NV_bindless_multi_draw_indirect) + +#endif /* GL_NV_bindless_multi_draw_indirect */ + +/* ------------------------- GL_NV_bindless_texture ------------------------ */ + +#ifndef GL_NV_bindless_texture +#define GL_NV_bindless_texture 1 + +typedef GLuint64 (GLAPIENTRY * PFNGLGETIMAGEHANDLENVPROC) (GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum format); +typedef GLuint64 (GLAPIENTRY * PFNGLGETTEXTUREHANDLENVPROC) (GLuint texture); +typedef GLuint64 (GLAPIENTRY * PFNGLGETTEXTURESAMPLERHANDLENVPROC) (GLuint texture, GLuint sampler); +typedef GLboolean (GLAPIENTRY * PFNGLISIMAGEHANDLERESIDENTNVPROC) (GLuint64 handle); +typedef GLboolean (GLAPIENTRY * PFNGLISTEXTUREHANDLERESIDENTNVPROC) (GLuint64 handle); +typedef void (GLAPIENTRY * PFNGLMAKEIMAGEHANDLENONRESIDENTNVPROC) (GLuint64 handle); +typedef void (GLAPIENTRY * PFNGLMAKEIMAGEHANDLERESIDENTNVPROC) (GLuint64 handle, GLenum access); +typedef void (GLAPIENTRY * PFNGLMAKETEXTUREHANDLENONRESIDENTNVPROC) (GLuint64 handle); +typedef void (GLAPIENTRY * PFNGLMAKETEXTUREHANDLERESIDENTNVPROC) (GLuint64 handle); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMHANDLEUI64NVPROC) (GLuint program, GLint location, GLuint64 value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMHANDLEUI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64* values); +typedef void (GLAPIENTRY * PFNGLUNIFORMHANDLEUI64NVPROC) (GLint location, GLuint64 value); +typedef void (GLAPIENTRY * PFNGLUNIFORMHANDLEUI64VNVPROC) (GLint location, GLsizei count, const GLuint64* value); + +#define glGetImageHandleNV GLEW_GET_FUN(__glewGetImageHandleNV) +#define glGetTextureHandleNV GLEW_GET_FUN(__glewGetTextureHandleNV) +#define glGetTextureSamplerHandleNV GLEW_GET_FUN(__glewGetTextureSamplerHandleNV) +#define glIsImageHandleResidentNV GLEW_GET_FUN(__glewIsImageHandleResidentNV) +#define glIsTextureHandleResidentNV GLEW_GET_FUN(__glewIsTextureHandleResidentNV) +#define glMakeImageHandleNonResidentNV GLEW_GET_FUN(__glewMakeImageHandleNonResidentNV) +#define glMakeImageHandleResidentNV GLEW_GET_FUN(__glewMakeImageHandleResidentNV) +#define glMakeTextureHandleNonResidentNV GLEW_GET_FUN(__glewMakeTextureHandleNonResidentNV) +#define glMakeTextureHandleResidentNV GLEW_GET_FUN(__glewMakeTextureHandleResidentNV) +#define glProgramUniformHandleui64NV GLEW_GET_FUN(__glewProgramUniformHandleui64NV) +#define glProgramUniformHandleui64vNV GLEW_GET_FUN(__glewProgramUniformHandleui64vNV) +#define glUniformHandleui64NV GLEW_GET_FUN(__glewUniformHandleui64NV) +#define glUniformHandleui64vNV GLEW_GET_FUN(__glewUniformHandleui64vNV) + +#define GLEW_NV_bindless_texture GLEW_GET_VAR(__GLEW_NV_bindless_texture) + +#endif /* GL_NV_bindless_texture */ + +/* --------------------- GL_NV_blend_equation_advanced --------------------- */ + +#ifndef GL_NV_blend_equation_advanced +#define GL_NV_blend_equation_advanced 1 + +#define GL_BLEND_PREMULTIPLIED_SRC_NV 0x9280 +#define GL_BLEND_OVERLAP_NV 0x9281 +#define GL_UNCORRELATED_NV 0x9282 +#define GL_DISJOINT_NV 0x9283 +#define GL_CONJOINT_NV 0x9284 +#define GL_BLEND_ADVANCED_COHERENT_NV 0x9285 +#define GL_SRC_NV 0x9286 +#define GL_DST_NV 0x9287 +#define GL_SRC_OVER_NV 0x9288 +#define GL_DST_OVER_NV 0x9289 +#define GL_SRC_IN_NV 0x928A +#define GL_DST_IN_NV 0x928B +#define GL_SRC_OUT_NV 0x928C +#define GL_DST_OUT_NV 0x928D +#define GL_SRC_ATOP_NV 0x928E +#define GL_DST_ATOP_NV 0x928F +#define GL_PLUS_NV 0x9291 +#define GL_PLUS_DARKER_NV 0x9292 +#define GL_MULTIPLY_NV 0x9294 +#define GL_SCREEN_NV 0x9295 +#define GL_OVERLAY_NV 0x9296 +#define GL_DARKEN_NV 0x9297 +#define GL_LIGHTEN_NV 0x9298 +#define GL_COLORDODGE_NV 0x9299 +#define GL_COLORBURN_NV 0x929A +#define GL_HARDLIGHT_NV 0x929B +#define GL_SOFTLIGHT_NV 0x929C +#define GL_DIFFERENCE_NV 0x929E +#define GL_MINUS_NV 0x929F +#define GL_EXCLUSION_NV 0x92A0 +#define GL_CONTRAST_NV 0x92A1 +#define GL_INVERT_RGB_NV 0x92A3 +#define GL_LINEARDODGE_NV 0x92A4 +#define GL_LINEARBURN_NV 0x92A5 +#define GL_VIVIDLIGHT_NV 0x92A6 +#define GL_LINEARLIGHT_NV 0x92A7 +#define GL_PINLIGHT_NV 0x92A8 +#define GL_HARDMIX_NV 0x92A9 +#define GL_HSL_HUE_NV 0x92AD +#define GL_HSL_SATURATION_NV 0x92AE +#define GL_HSL_COLOR_NV 0x92AF +#define GL_HSL_LUMINOSITY_NV 0x92B0 +#define GL_PLUS_CLAMPED_NV 0x92B1 +#define GL_PLUS_CLAMPED_ALPHA_NV 0x92B2 +#define GL_MINUS_CLAMPED_NV 0x92B3 +#define GL_INVERT_OVG_NV 0x92B4 + +typedef void (GLAPIENTRY * PFNGLBLENDBARRIERNVPROC) (void); +typedef void (GLAPIENTRY * PFNGLBLENDPARAMETERINVPROC) (GLenum pname, GLint value); + +#define glBlendBarrierNV GLEW_GET_FUN(__glewBlendBarrierNV) +#define glBlendParameteriNV GLEW_GET_FUN(__glewBlendParameteriNV) + +#define GLEW_NV_blend_equation_advanced GLEW_GET_VAR(__GLEW_NV_blend_equation_advanced) + +#endif /* GL_NV_blend_equation_advanced */ + +/* ----------------- GL_NV_blend_equation_advanced_coherent ---------------- */ + +#ifndef GL_NV_blend_equation_advanced_coherent +#define GL_NV_blend_equation_advanced_coherent 1 + +#define GLEW_NV_blend_equation_advanced_coherent GLEW_GET_VAR(__GLEW_NV_blend_equation_advanced_coherent) + +#endif /* GL_NV_blend_equation_advanced_coherent */ + +/* --------------------------- GL_NV_blend_square -------------------------- */ + +#ifndef GL_NV_blend_square +#define GL_NV_blend_square 1 + +#define GLEW_NV_blend_square GLEW_GET_VAR(__GLEW_NV_blend_square) + +#endif /* GL_NV_blend_square */ + +/* ------------------------- GL_NV_compute_program5 ------------------------ */ + +#ifndef GL_NV_compute_program5 +#define GL_NV_compute_program5 1 + +#define GL_COMPUTE_PROGRAM_NV 0x90FB +#define GL_COMPUTE_PROGRAM_PARAMETER_BUFFER_NV 0x90FC + +#define GLEW_NV_compute_program5 GLEW_GET_VAR(__GLEW_NV_compute_program5) + +#endif /* GL_NV_compute_program5 */ + +/* ------------------------ GL_NV_conditional_render ----------------------- */ + +#ifndef GL_NV_conditional_render +#define GL_NV_conditional_render 1 + +#define GL_QUERY_WAIT_NV 0x8E13 +#define GL_QUERY_NO_WAIT_NV 0x8E14 +#define GL_QUERY_BY_REGION_WAIT_NV 0x8E15 +#define GL_QUERY_BY_REGION_NO_WAIT_NV 0x8E16 + +typedef void (GLAPIENTRY * PFNGLBEGINCONDITIONALRENDERNVPROC) (GLuint id, GLenum mode); +typedef void (GLAPIENTRY * PFNGLENDCONDITIONALRENDERNVPROC) (void); + +#define glBeginConditionalRenderNV GLEW_GET_FUN(__glewBeginConditionalRenderNV) +#define glEndConditionalRenderNV GLEW_GET_FUN(__glewEndConditionalRenderNV) + +#define GLEW_NV_conditional_render GLEW_GET_VAR(__GLEW_NV_conditional_render) + +#endif /* GL_NV_conditional_render */ + +/* ----------------------- GL_NV_copy_depth_to_color ----------------------- */ + +#ifndef GL_NV_copy_depth_to_color +#define GL_NV_copy_depth_to_color 1 + +#define GL_DEPTH_STENCIL_TO_RGBA_NV 0x886E +#define GL_DEPTH_STENCIL_TO_BGRA_NV 0x886F + +#define GLEW_NV_copy_depth_to_color GLEW_GET_VAR(__GLEW_NV_copy_depth_to_color) + +#endif /* GL_NV_copy_depth_to_color */ + +/* ---------------------------- GL_NV_copy_image --------------------------- */ + +#ifndef GL_NV_copy_image +#define GL_NV_copy_image 1 + +typedef void (GLAPIENTRY * PFNGLCOPYIMAGESUBDATANVPROC) (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth); + +#define glCopyImageSubDataNV GLEW_GET_FUN(__glewCopyImageSubDataNV) + +#define GLEW_NV_copy_image GLEW_GET_VAR(__GLEW_NV_copy_image) + +#endif /* GL_NV_copy_image */ + +/* -------------------------- GL_NV_deep_texture3D ------------------------- */ + +#ifndef GL_NV_deep_texture3D +#define GL_NV_deep_texture3D 1 + +#define GL_MAX_DEEP_3D_TEXTURE_WIDTH_HEIGHT_NV 0x90D0 +#define GL_MAX_DEEP_3D_TEXTURE_DEPTH_NV 0x90D1 + +#define GLEW_NV_deep_texture3D GLEW_GET_VAR(__GLEW_NV_deep_texture3D) + +#endif /* GL_NV_deep_texture3D */ + +/* ------------------------ GL_NV_depth_buffer_float ----------------------- */ + +#ifndef GL_NV_depth_buffer_float +#define GL_NV_depth_buffer_float 1 + +#define GL_DEPTH_COMPONENT32F_NV 0x8DAB +#define GL_DEPTH32F_STENCIL8_NV 0x8DAC +#define GL_FLOAT_32_UNSIGNED_INT_24_8_REV_NV 0x8DAD +#define GL_DEPTH_BUFFER_FLOAT_MODE_NV 0x8DAF + +typedef void (GLAPIENTRY * PFNGLCLEARDEPTHDNVPROC) (GLdouble depth); +typedef void (GLAPIENTRY * PFNGLDEPTHBOUNDSDNVPROC) (GLdouble zmin, GLdouble zmax); +typedef void (GLAPIENTRY * PFNGLDEPTHRANGEDNVPROC) (GLdouble zNear, GLdouble zFar); + +#define glClearDepthdNV GLEW_GET_FUN(__glewClearDepthdNV) +#define glDepthBoundsdNV GLEW_GET_FUN(__glewDepthBoundsdNV) +#define glDepthRangedNV GLEW_GET_FUN(__glewDepthRangedNV) + +#define GLEW_NV_depth_buffer_float GLEW_GET_VAR(__GLEW_NV_depth_buffer_float) + +#endif /* GL_NV_depth_buffer_float */ + +/* --------------------------- GL_NV_depth_clamp --------------------------- */ + +#ifndef GL_NV_depth_clamp +#define GL_NV_depth_clamp 1 + +#define GL_DEPTH_CLAMP_NV 0x864F + +#define GLEW_NV_depth_clamp GLEW_GET_VAR(__GLEW_NV_depth_clamp) + +#endif /* GL_NV_depth_clamp */ + +/* ---------------------- GL_NV_depth_range_unclamped ---------------------- */ + +#ifndef GL_NV_depth_range_unclamped +#define GL_NV_depth_range_unclamped 1 + +#define GL_SAMPLE_COUNT_BITS_NV 0x8864 +#define GL_CURRENT_SAMPLE_COUNT_QUERY_NV 0x8865 +#define GL_QUERY_RESULT_NV 0x8866 +#define GL_QUERY_RESULT_AVAILABLE_NV 0x8867 +#define GL_SAMPLE_COUNT_NV 0x8914 + +#define GLEW_NV_depth_range_unclamped GLEW_GET_VAR(__GLEW_NV_depth_range_unclamped) + +#endif /* GL_NV_depth_range_unclamped */ + +/* --------------------------- GL_NV_draw_texture -------------------------- */ + +#ifndef GL_NV_draw_texture +#define GL_NV_draw_texture 1 + +typedef void (GLAPIENTRY * PFNGLDRAWTEXTURENVPROC) (GLuint texture, GLuint sampler, GLfloat x0, GLfloat y0, GLfloat x1, GLfloat y1, GLfloat z, GLfloat s0, GLfloat t0, GLfloat s1, GLfloat t1); + +#define glDrawTextureNV GLEW_GET_FUN(__glewDrawTextureNV) + +#define GLEW_NV_draw_texture GLEW_GET_VAR(__GLEW_NV_draw_texture) + +#endif /* GL_NV_draw_texture */ + +/* ---------------------------- GL_NV_evaluators --------------------------- */ + +#ifndef GL_NV_evaluators +#define GL_NV_evaluators 1 + +#define GL_EVAL_2D_NV 0x86C0 +#define GL_EVAL_TRIANGULAR_2D_NV 0x86C1 +#define GL_MAP_TESSELLATION_NV 0x86C2 +#define GL_MAP_ATTRIB_U_ORDER_NV 0x86C3 +#define GL_MAP_ATTRIB_V_ORDER_NV 0x86C4 +#define GL_EVAL_FRACTIONAL_TESSELLATION_NV 0x86C5 +#define GL_EVAL_VERTEX_ATTRIB0_NV 0x86C6 +#define GL_EVAL_VERTEX_ATTRIB1_NV 0x86C7 +#define GL_EVAL_VERTEX_ATTRIB2_NV 0x86C8 +#define GL_EVAL_VERTEX_ATTRIB3_NV 0x86C9 +#define GL_EVAL_VERTEX_ATTRIB4_NV 0x86CA +#define GL_EVAL_VERTEX_ATTRIB5_NV 0x86CB +#define GL_EVAL_VERTEX_ATTRIB6_NV 0x86CC +#define GL_EVAL_VERTEX_ATTRIB7_NV 0x86CD +#define GL_EVAL_VERTEX_ATTRIB8_NV 0x86CE +#define GL_EVAL_VERTEX_ATTRIB9_NV 0x86CF +#define GL_EVAL_VERTEX_ATTRIB10_NV 0x86D0 +#define GL_EVAL_VERTEX_ATTRIB11_NV 0x86D1 +#define GL_EVAL_VERTEX_ATTRIB12_NV 0x86D2 +#define GL_EVAL_VERTEX_ATTRIB13_NV 0x86D3 +#define GL_EVAL_VERTEX_ATTRIB14_NV 0x86D4 +#define GL_EVAL_VERTEX_ATTRIB15_NV 0x86D5 +#define GL_MAX_MAP_TESSELLATION_NV 0x86D6 +#define GL_MAX_RATIONAL_EVAL_ORDER_NV 0x86D7 + +typedef void (GLAPIENTRY * PFNGLEVALMAPSNVPROC) (GLenum target, GLenum mode); +typedef void (GLAPIENTRY * PFNGLGETMAPATTRIBPARAMETERFVNVPROC) (GLenum target, GLuint index, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETMAPATTRIBPARAMETERIVNVPROC) (GLenum target, GLuint index, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETMAPCONTROLPOINTSNVPROC) (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLboolean packed, GLvoid *points); +typedef void (GLAPIENTRY * PFNGLGETMAPPARAMETERFVNVPROC) (GLenum target, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETMAPPARAMETERIVNVPROC) (GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLMAPCONTROLPOINTSNVPROC) (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLint uorder, GLint vorder, GLboolean packed, const GLvoid *points); +typedef void (GLAPIENTRY * PFNGLMAPPARAMETERFVNVPROC) (GLenum target, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLMAPPARAMETERIVNVPROC) (GLenum target, GLenum pname, const GLint* params); + +#define glEvalMapsNV GLEW_GET_FUN(__glewEvalMapsNV) +#define glGetMapAttribParameterfvNV GLEW_GET_FUN(__glewGetMapAttribParameterfvNV) +#define glGetMapAttribParameterivNV GLEW_GET_FUN(__glewGetMapAttribParameterivNV) +#define glGetMapControlPointsNV GLEW_GET_FUN(__glewGetMapControlPointsNV) +#define glGetMapParameterfvNV GLEW_GET_FUN(__glewGetMapParameterfvNV) +#define glGetMapParameterivNV GLEW_GET_FUN(__glewGetMapParameterivNV) +#define glMapControlPointsNV GLEW_GET_FUN(__glewMapControlPointsNV) +#define glMapParameterfvNV GLEW_GET_FUN(__glewMapParameterfvNV) +#define glMapParameterivNV GLEW_GET_FUN(__glewMapParameterivNV) + +#define GLEW_NV_evaluators GLEW_GET_VAR(__GLEW_NV_evaluators) + +#endif /* GL_NV_evaluators */ + +/* ----------------------- GL_NV_explicit_multisample ---------------------- */ + +#ifndef GL_NV_explicit_multisample +#define GL_NV_explicit_multisample 1 + +#define GL_SAMPLE_POSITION_NV 0x8E50 +#define GL_SAMPLE_MASK_NV 0x8E51 +#define GL_SAMPLE_MASK_VALUE_NV 0x8E52 +#define GL_TEXTURE_BINDING_RENDERBUFFER_NV 0x8E53 +#define GL_TEXTURE_RENDERBUFFER_DATA_STORE_BINDING_NV 0x8E54 +#define GL_TEXTURE_RENDERBUFFER_NV 0x8E55 +#define GL_SAMPLER_RENDERBUFFER_NV 0x8E56 +#define GL_INT_SAMPLER_RENDERBUFFER_NV 0x8E57 +#define GL_UNSIGNED_INT_SAMPLER_RENDERBUFFER_NV 0x8E58 +#define GL_MAX_SAMPLE_MASK_WORDS_NV 0x8E59 + +typedef void (GLAPIENTRY * PFNGLGETMULTISAMPLEFVNVPROC) (GLenum pname, GLuint index, GLfloat* val); +typedef void (GLAPIENTRY * PFNGLSAMPLEMASKINDEXEDNVPROC) (GLuint index, GLbitfield mask); +typedef void (GLAPIENTRY * PFNGLTEXRENDERBUFFERNVPROC) (GLenum target, GLuint renderbuffer); + +#define glGetMultisamplefvNV GLEW_GET_FUN(__glewGetMultisamplefvNV) +#define glSampleMaskIndexedNV GLEW_GET_FUN(__glewSampleMaskIndexedNV) +#define glTexRenderbufferNV GLEW_GET_FUN(__glewTexRenderbufferNV) + +#define GLEW_NV_explicit_multisample GLEW_GET_VAR(__GLEW_NV_explicit_multisample) + +#endif /* GL_NV_explicit_multisample */ + +/* ------------------------------ GL_NV_fence ------------------------------ */ + +#ifndef GL_NV_fence +#define GL_NV_fence 1 + +#define GL_ALL_COMPLETED_NV 0x84F2 +#define GL_FENCE_STATUS_NV 0x84F3 +#define GL_FENCE_CONDITION_NV 0x84F4 + +typedef void (GLAPIENTRY * PFNGLDELETEFENCESNVPROC) (GLsizei n, const GLuint* fences); +typedef void (GLAPIENTRY * PFNGLFINISHFENCENVPROC) (GLuint fence); +typedef void (GLAPIENTRY * PFNGLGENFENCESNVPROC) (GLsizei n, GLuint* fences); +typedef void (GLAPIENTRY * PFNGLGETFENCEIVNVPROC) (GLuint fence, GLenum pname, GLint* params); +typedef GLboolean (GLAPIENTRY * PFNGLISFENCENVPROC) (GLuint fence); +typedef void (GLAPIENTRY * PFNGLSETFENCENVPROC) (GLuint fence, GLenum condition); +typedef GLboolean (GLAPIENTRY * PFNGLTESTFENCENVPROC) (GLuint fence); + +#define glDeleteFencesNV GLEW_GET_FUN(__glewDeleteFencesNV) +#define glFinishFenceNV GLEW_GET_FUN(__glewFinishFenceNV) +#define glGenFencesNV GLEW_GET_FUN(__glewGenFencesNV) +#define glGetFenceivNV GLEW_GET_FUN(__glewGetFenceivNV) +#define glIsFenceNV GLEW_GET_FUN(__glewIsFenceNV) +#define glSetFenceNV GLEW_GET_FUN(__glewSetFenceNV) +#define glTestFenceNV GLEW_GET_FUN(__glewTestFenceNV) + +#define GLEW_NV_fence GLEW_GET_VAR(__GLEW_NV_fence) + +#endif /* GL_NV_fence */ + +/* --------------------------- GL_NV_float_buffer -------------------------- */ + +#ifndef GL_NV_float_buffer +#define GL_NV_float_buffer 1 + +#define GL_FLOAT_R_NV 0x8880 +#define GL_FLOAT_RG_NV 0x8881 +#define GL_FLOAT_RGB_NV 0x8882 +#define GL_FLOAT_RGBA_NV 0x8883 +#define GL_FLOAT_R16_NV 0x8884 +#define GL_FLOAT_R32_NV 0x8885 +#define GL_FLOAT_RG16_NV 0x8886 +#define GL_FLOAT_RG32_NV 0x8887 +#define GL_FLOAT_RGB16_NV 0x8888 +#define GL_FLOAT_RGB32_NV 0x8889 +#define GL_FLOAT_RGBA16_NV 0x888A +#define GL_FLOAT_RGBA32_NV 0x888B +#define GL_TEXTURE_FLOAT_COMPONENTS_NV 0x888C +#define GL_FLOAT_CLEAR_COLOR_VALUE_NV 0x888D +#define GL_FLOAT_RGBA_MODE_NV 0x888E + +#define GLEW_NV_float_buffer GLEW_GET_VAR(__GLEW_NV_float_buffer) + +#endif /* GL_NV_float_buffer */ + +/* --------------------------- GL_NV_fog_distance -------------------------- */ + +#ifndef GL_NV_fog_distance +#define GL_NV_fog_distance 1 + +#define GL_FOG_DISTANCE_MODE_NV 0x855A +#define GL_EYE_RADIAL_NV 0x855B +#define GL_EYE_PLANE_ABSOLUTE_NV 0x855C + +#define GLEW_NV_fog_distance GLEW_GET_VAR(__GLEW_NV_fog_distance) + +#endif /* GL_NV_fog_distance */ + +/* ------------------------- GL_NV_fragment_program ------------------------ */ + +#ifndef GL_NV_fragment_program +#define GL_NV_fragment_program 1 + +#define GL_MAX_FRAGMENT_PROGRAM_LOCAL_PARAMETERS_NV 0x8868 +#define GL_FRAGMENT_PROGRAM_NV 0x8870 +#define GL_MAX_TEXTURE_COORDS_NV 0x8871 +#define GL_MAX_TEXTURE_IMAGE_UNITS_NV 0x8872 +#define GL_FRAGMENT_PROGRAM_BINDING_NV 0x8873 +#define GL_PROGRAM_ERROR_STRING_NV 0x8874 + +typedef void (GLAPIENTRY * PFNGLGETPROGRAMNAMEDPARAMETERDVNVPROC) (GLuint id, GLsizei len, const GLubyte* name, GLdouble *params); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMNAMEDPARAMETERFVNVPROC) (GLuint id, GLsizei len, const GLubyte* name, GLfloat *params); +typedef void (GLAPIENTRY * PFNGLPROGRAMNAMEDPARAMETER4DNVPROC) (GLuint id, GLsizei len, const GLubyte* name, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (GLAPIENTRY * PFNGLPROGRAMNAMEDPARAMETER4DVNVPROC) (GLuint id, GLsizei len, const GLubyte* name, const GLdouble v[]); +typedef void (GLAPIENTRY * PFNGLPROGRAMNAMEDPARAMETER4FNVPROC) (GLuint id, GLsizei len, const GLubyte* name, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (GLAPIENTRY * PFNGLPROGRAMNAMEDPARAMETER4FVNVPROC) (GLuint id, GLsizei len, const GLubyte* name, const GLfloat v[]); + +#define glGetProgramNamedParameterdvNV GLEW_GET_FUN(__glewGetProgramNamedParameterdvNV) +#define glGetProgramNamedParameterfvNV GLEW_GET_FUN(__glewGetProgramNamedParameterfvNV) +#define glProgramNamedParameter4dNV GLEW_GET_FUN(__glewProgramNamedParameter4dNV) +#define glProgramNamedParameter4dvNV GLEW_GET_FUN(__glewProgramNamedParameter4dvNV) +#define glProgramNamedParameter4fNV GLEW_GET_FUN(__glewProgramNamedParameter4fNV) +#define glProgramNamedParameter4fvNV GLEW_GET_FUN(__glewProgramNamedParameter4fvNV) + +#define GLEW_NV_fragment_program GLEW_GET_VAR(__GLEW_NV_fragment_program) + +#endif /* GL_NV_fragment_program */ + +/* ------------------------ GL_NV_fragment_program2 ------------------------ */ + +#ifndef GL_NV_fragment_program2 +#define GL_NV_fragment_program2 1 + +#define GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV 0x88F4 +#define GL_MAX_PROGRAM_CALL_DEPTH_NV 0x88F5 +#define GL_MAX_PROGRAM_IF_DEPTH_NV 0x88F6 +#define GL_MAX_PROGRAM_LOOP_DEPTH_NV 0x88F7 +#define GL_MAX_PROGRAM_LOOP_COUNT_NV 0x88F8 + +#define GLEW_NV_fragment_program2 GLEW_GET_VAR(__GLEW_NV_fragment_program2) + +#endif /* GL_NV_fragment_program2 */ + +/* ------------------------ GL_NV_fragment_program4 ------------------------ */ + +#ifndef GL_NV_fragment_program4 +#define GL_NV_fragment_program4 1 + +#define GLEW_NV_fragment_program4 GLEW_GET_VAR(__GLEW_NV_fragment_program4) + +#endif /* GL_NV_fragment_program4 */ + +/* --------------------- GL_NV_fragment_program_option --------------------- */ + +#ifndef GL_NV_fragment_program_option +#define GL_NV_fragment_program_option 1 + +#define GLEW_NV_fragment_program_option GLEW_GET_VAR(__GLEW_NV_fragment_program_option) + +#endif /* GL_NV_fragment_program_option */ + +/* ----------------- GL_NV_framebuffer_multisample_coverage ---------------- */ + +#ifndef GL_NV_framebuffer_multisample_coverage +#define GL_NV_framebuffer_multisample_coverage 1 + +#define GL_RENDERBUFFER_COVERAGE_SAMPLES_NV 0x8CAB +#define GL_RENDERBUFFER_COLOR_SAMPLES_NV 0x8E10 +#define GL_MAX_MULTISAMPLE_COVERAGE_MODES_NV 0x8E11 +#define GL_MULTISAMPLE_COVERAGE_MODES_NV 0x8E12 + +typedef void (GLAPIENTRY * PFNGLRENDERBUFFERSTORAGEMULTISAMPLECOVERAGENVPROC) (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height); + +#define glRenderbufferStorageMultisampleCoverageNV GLEW_GET_FUN(__glewRenderbufferStorageMultisampleCoverageNV) + +#define GLEW_NV_framebuffer_multisample_coverage GLEW_GET_VAR(__GLEW_NV_framebuffer_multisample_coverage) + +#endif /* GL_NV_framebuffer_multisample_coverage */ + +/* ------------------------ GL_NV_geometry_program4 ------------------------ */ + +#ifndef GL_NV_geometry_program4 +#define GL_NV_geometry_program4 1 + +#define GL_GEOMETRY_PROGRAM_NV 0x8C26 +#define GL_MAX_PROGRAM_OUTPUT_VERTICES_NV 0x8C27 +#define GL_MAX_PROGRAM_TOTAL_OUTPUT_COMPONENTS_NV 0x8C28 + +typedef void (GLAPIENTRY * PFNGLPROGRAMVERTEXLIMITNVPROC) (GLenum target, GLint limit); + +#define glProgramVertexLimitNV GLEW_GET_FUN(__glewProgramVertexLimitNV) + +#define GLEW_NV_geometry_program4 GLEW_GET_VAR(__GLEW_NV_geometry_program4) + +#endif /* GL_NV_geometry_program4 */ + +/* ------------------------- GL_NV_geometry_shader4 ------------------------ */ + +#ifndef GL_NV_geometry_shader4 +#define GL_NV_geometry_shader4 1 + +#define GLEW_NV_geometry_shader4 GLEW_GET_VAR(__GLEW_NV_geometry_shader4) + +#endif /* GL_NV_geometry_shader4 */ + +/* --------------------------- GL_NV_gpu_program4 -------------------------- */ + +#ifndef GL_NV_gpu_program4 +#define GL_NV_gpu_program4 1 + +#define GL_MIN_PROGRAM_TEXEL_OFFSET_NV 0x8904 +#define GL_MAX_PROGRAM_TEXEL_OFFSET_NV 0x8905 +#define GL_PROGRAM_ATTRIB_COMPONENTS_NV 0x8906 +#define GL_PROGRAM_RESULT_COMPONENTS_NV 0x8907 +#define GL_MAX_PROGRAM_ATTRIB_COMPONENTS_NV 0x8908 +#define GL_MAX_PROGRAM_RESULT_COMPONENTS_NV 0x8909 +#define GL_MAX_PROGRAM_GENERIC_ATTRIBS_NV 0x8DA5 +#define GL_MAX_PROGRAM_GENERIC_RESULTS_NV 0x8DA6 + +typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETERI4INVPROC) (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w); +typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETERI4IVNVPROC) (GLenum target, GLuint index, const GLint *params); +typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETERI4UINVPROC) (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); +typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETERI4UIVNVPROC) (GLenum target, GLuint index, const GLuint *params); +typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETERSI4IVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLint *params); +typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETERSI4UIVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLuint *params); +typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETERI4INVPROC) (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w); +typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETERI4IVNVPROC) (GLenum target, GLuint index, const GLint *params); +typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETERI4UINVPROC) (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); +typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETERI4UIVNVPROC) (GLenum target, GLuint index, const GLuint *params); +typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETERSI4IVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLint *params); +typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETERSI4UIVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLuint *params); + +#define glProgramEnvParameterI4iNV GLEW_GET_FUN(__glewProgramEnvParameterI4iNV) +#define glProgramEnvParameterI4ivNV GLEW_GET_FUN(__glewProgramEnvParameterI4ivNV) +#define glProgramEnvParameterI4uiNV GLEW_GET_FUN(__glewProgramEnvParameterI4uiNV) +#define glProgramEnvParameterI4uivNV GLEW_GET_FUN(__glewProgramEnvParameterI4uivNV) +#define glProgramEnvParametersI4ivNV GLEW_GET_FUN(__glewProgramEnvParametersI4ivNV) +#define glProgramEnvParametersI4uivNV GLEW_GET_FUN(__glewProgramEnvParametersI4uivNV) +#define glProgramLocalParameterI4iNV GLEW_GET_FUN(__glewProgramLocalParameterI4iNV) +#define glProgramLocalParameterI4ivNV GLEW_GET_FUN(__glewProgramLocalParameterI4ivNV) +#define glProgramLocalParameterI4uiNV GLEW_GET_FUN(__glewProgramLocalParameterI4uiNV) +#define glProgramLocalParameterI4uivNV GLEW_GET_FUN(__glewProgramLocalParameterI4uivNV) +#define glProgramLocalParametersI4ivNV GLEW_GET_FUN(__glewProgramLocalParametersI4ivNV) +#define glProgramLocalParametersI4uivNV GLEW_GET_FUN(__glewProgramLocalParametersI4uivNV) + +#define GLEW_NV_gpu_program4 GLEW_GET_VAR(__GLEW_NV_gpu_program4) + +#endif /* GL_NV_gpu_program4 */ + +/* --------------------------- GL_NV_gpu_program5 -------------------------- */ + +#ifndef GL_NV_gpu_program5 +#define GL_NV_gpu_program5 1 + +#define GL_MAX_GEOMETRY_PROGRAM_INVOCATIONS_NV 0x8E5A +#define GL_MIN_FRAGMENT_INTERPOLATION_OFFSET_NV 0x8E5B +#define GL_MAX_FRAGMENT_INTERPOLATION_OFFSET_NV 0x8E5C +#define GL_FRAGMENT_PROGRAM_INTERPOLATION_OFFSET_BITS_NV 0x8E5D +#define GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET_NV 0x8E5E +#define GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET_NV 0x8E5F + +#define GLEW_NV_gpu_program5 GLEW_GET_VAR(__GLEW_NV_gpu_program5) + +#endif /* GL_NV_gpu_program5 */ + +/* -------------------- GL_NV_gpu_program5_mem_extended -------------------- */ + +#ifndef GL_NV_gpu_program5_mem_extended +#define GL_NV_gpu_program5_mem_extended 1 + +#define GLEW_NV_gpu_program5_mem_extended GLEW_GET_VAR(__GLEW_NV_gpu_program5_mem_extended) + +#endif /* GL_NV_gpu_program5_mem_extended */ + +/* ------------------------- GL_NV_gpu_program_fp64 ------------------------ */ + +#ifndef GL_NV_gpu_program_fp64 +#define GL_NV_gpu_program_fp64 1 + +#define GLEW_NV_gpu_program_fp64 GLEW_GET_VAR(__GLEW_NV_gpu_program_fp64) + +#endif /* GL_NV_gpu_program_fp64 */ + +/* --------------------------- GL_NV_gpu_shader5 --------------------------- */ + +#ifndef GL_NV_gpu_shader5 +#define GL_NV_gpu_shader5 1 + +#define GL_INT64_NV 0x140E +#define GL_UNSIGNED_INT64_NV 0x140F +#define GL_INT8_NV 0x8FE0 +#define GL_INT8_VEC2_NV 0x8FE1 +#define GL_INT8_VEC3_NV 0x8FE2 +#define GL_INT8_VEC4_NV 0x8FE3 +#define GL_INT16_NV 0x8FE4 +#define GL_INT16_VEC2_NV 0x8FE5 +#define GL_INT16_VEC3_NV 0x8FE6 +#define GL_INT16_VEC4_NV 0x8FE7 +#define GL_INT64_VEC2_NV 0x8FE9 +#define GL_INT64_VEC3_NV 0x8FEA +#define GL_INT64_VEC4_NV 0x8FEB +#define GL_UNSIGNED_INT8_NV 0x8FEC +#define GL_UNSIGNED_INT8_VEC2_NV 0x8FED +#define GL_UNSIGNED_INT8_VEC3_NV 0x8FEE +#define GL_UNSIGNED_INT8_VEC4_NV 0x8FEF +#define GL_UNSIGNED_INT16_NV 0x8FF0 +#define GL_UNSIGNED_INT16_VEC2_NV 0x8FF1 +#define GL_UNSIGNED_INT16_VEC3_NV 0x8FF2 +#define GL_UNSIGNED_INT16_VEC4_NV 0x8FF3 +#define GL_UNSIGNED_INT64_VEC2_NV 0x8FF5 +#define GL_UNSIGNED_INT64_VEC3_NV 0x8FF6 +#define GL_UNSIGNED_INT64_VEC4_NV 0x8FF7 +#define GL_FLOAT16_NV 0x8FF8 +#define GL_FLOAT16_VEC2_NV 0x8FF9 +#define GL_FLOAT16_VEC3_NV 0x8FFA +#define GL_FLOAT16_VEC4_NV 0x8FFB + +typedef void (GLAPIENTRY * PFNGLGETUNIFORMI64VNVPROC) (GLuint program, GLint location, GLint64EXT* params); +typedef void (GLAPIENTRY * PFNGLGETUNIFORMUI64VNVPROC) (GLuint program, GLint location, GLuint64EXT* params); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1I64NVPROC) (GLuint program, GLint location, GLint64EXT x); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2I64NVPROC) (GLuint program, GLint location, GLint64EXT x, GLint64EXT y); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3I64NVPROC) (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4I64NVPROC) (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM1I64NVPROC) (GLint location, GLint64EXT x); +typedef void (GLAPIENTRY * PFNGLUNIFORM1I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM1UI64NVPROC) (GLint location, GLuint64EXT x); +typedef void (GLAPIENTRY * PFNGLUNIFORM1UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM2I64NVPROC) (GLint location, GLint64EXT x, GLint64EXT y); +typedef void (GLAPIENTRY * PFNGLUNIFORM2I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM2UI64NVPROC) (GLint location, GLuint64EXT x, GLuint64EXT y); +typedef void (GLAPIENTRY * PFNGLUNIFORM2UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM3I64NVPROC) (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z); +typedef void (GLAPIENTRY * PFNGLUNIFORM3I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM3UI64NVPROC) (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); +typedef void (GLAPIENTRY * PFNGLUNIFORM3UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM4I64NVPROC) (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); +typedef void (GLAPIENTRY * PFNGLUNIFORM4I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM4UI64NVPROC) (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); +typedef void (GLAPIENTRY * PFNGLUNIFORM4UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT* value); + +#define glGetUniformi64vNV GLEW_GET_FUN(__glewGetUniformi64vNV) +#define glGetUniformui64vNV GLEW_GET_FUN(__glewGetUniformui64vNV) +#define glProgramUniform1i64NV GLEW_GET_FUN(__glewProgramUniform1i64NV) +#define glProgramUniform1i64vNV GLEW_GET_FUN(__glewProgramUniform1i64vNV) +#define glProgramUniform1ui64NV GLEW_GET_FUN(__glewProgramUniform1ui64NV) +#define glProgramUniform1ui64vNV GLEW_GET_FUN(__glewProgramUniform1ui64vNV) +#define glProgramUniform2i64NV GLEW_GET_FUN(__glewProgramUniform2i64NV) +#define glProgramUniform2i64vNV GLEW_GET_FUN(__glewProgramUniform2i64vNV) +#define glProgramUniform2ui64NV GLEW_GET_FUN(__glewProgramUniform2ui64NV) +#define glProgramUniform2ui64vNV GLEW_GET_FUN(__glewProgramUniform2ui64vNV) +#define glProgramUniform3i64NV GLEW_GET_FUN(__glewProgramUniform3i64NV) +#define glProgramUniform3i64vNV GLEW_GET_FUN(__glewProgramUniform3i64vNV) +#define glProgramUniform3ui64NV GLEW_GET_FUN(__glewProgramUniform3ui64NV) +#define glProgramUniform3ui64vNV GLEW_GET_FUN(__glewProgramUniform3ui64vNV) +#define glProgramUniform4i64NV GLEW_GET_FUN(__glewProgramUniform4i64NV) +#define glProgramUniform4i64vNV GLEW_GET_FUN(__glewProgramUniform4i64vNV) +#define glProgramUniform4ui64NV GLEW_GET_FUN(__glewProgramUniform4ui64NV) +#define glProgramUniform4ui64vNV GLEW_GET_FUN(__glewProgramUniform4ui64vNV) +#define glUniform1i64NV GLEW_GET_FUN(__glewUniform1i64NV) +#define glUniform1i64vNV GLEW_GET_FUN(__glewUniform1i64vNV) +#define glUniform1ui64NV GLEW_GET_FUN(__glewUniform1ui64NV) +#define glUniform1ui64vNV GLEW_GET_FUN(__glewUniform1ui64vNV) +#define glUniform2i64NV GLEW_GET_FUN(__glewUniform2i64NV) +#define glUniform2i64vNV GLEW_GET_FUN(__glewUniform2i64vNV) +#define glUniform2ui64NV GLEW_GET_FUN(__glewUniform2ui64NV) +#define glUniform2ui64vNV GLEW_GET_FUN(__glewUniform2ui64vNV) +#define glUniform3i64NV GLEW_GET_FUN(__glewUniform3i64NV) +#define glUniform3i64vNV GLEW_GET_FUN(__glewUniform3i64vNV) +#define glUniform3ui64NV GLEW_GET_FUN(__glewUniform3ui64NV) +#define glUniform3ui64vNV GLEW_GET_FUN(__glewUniform3ui64vNV) +#define glUniform4i64NV GLEW_GET_FUN(__glewUniform4i64NV) +#define glUniform4i64vNV GLEW_GET_FUN(__glewUniform4i64vNV) +#define glUniform4ui64NV GLEW_GET_FUN(__glewUniform4ui64NV) +#define glUniform4ui64vNV GLEW_GET_FUN(__glewUniform4ui64vNV) + +#define GLEW_NV_gpu_shader5 GLEW_GET_VAR(__GLEW_NV_gpu_shader5) + +#endif /* GL_NV_gpu_shader5 */ + +/* ---------------------------- GL_NV_half_float --------------------------- */ + +#ifndef GL_NV_half_float +#define GL_NV_half_float 1 + +#define GL_HALF_FLOAT_NV 0x140B + +typedef unsigned short GLhalf; + +typedef void (GLAPIENTRY * PFNGLCOLOR3HNVPROC) (GLhalf red, GLhalf green, GLhalf blue); +typedef void (GLAPIENTRY * PFNGLCOLOR3HVNVPROC) (const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLCOLOR4HNVPROC) (GLhalf red, GLhalf green, GLhalf blue, GLhalf alpha); +typedef void (GLAPIENTRY * PFNGLCOLOR4HVNVPROC) (const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLFOGCOORDHNVPROC) (GLhalf fog); +typedef void (GLAPIENTRY * PFNGLFOGCOORDHVNVPROC) (const GLhalf* fog); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1HNVPROC) (GLenum target, GLhalf s); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1HVNVPROC) (GLenum target, const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2HNVPROC) (GLenum target, GLhalf s, GLhalf t); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2HVNVPROC) (GLenum target, const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3HNVPROC) (GLenum target, GLhalf s, GLhalf t, GLhalf r); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3HVNVPROC) (GLenum target, const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4HNVPROC) (GLenum target, GLhalf s, GLhalf t, GLhalf r, GLhalf q); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4HVNVPROC) (GLenum target, const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLNORMAL3HNVPROC) (GLhalf nx, GLhalf ny, GLhalf nz); +typedef void (GLAPIENTRY * PFNGLNORMAL3HVNVPROC) (const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3HNVPROC) (GLhalf red, GLhalf green, GLhalf blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3HVNVPROC) (const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLTEXCOORD1HNVPROC) (GLhalf s); +typedef void (GLAPIENTRY * PFNGLTEXCOORD1HVNVPROC) (const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLTEXCOORD2HNVPROC) (GLhalf s, GLhalf t); +typedef void (GLAPIENTRY * PFNGLTEXCOORD2HVNVPROC) (const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLTEXCOORD3HNVPROC) (GLhalf s, GLhalf t, GLhalf r); +typedef void (GLAPIENTRY * PFNGLTEXCOORD3HVNVPROC) (const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLTEXCOORD4HNVPROC) (GLhalf s, GLhalf t, GLhalf r, GLhalf q); +typedef void (GLAPIENTRY * PFNGLTEXCOORD4HVNVPROC) (const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLVERTEX2HNVPROC) (GLhalf x, GLhalf y); +typedef void (GLAPIENTRY * PFNGLVERTEX2HVNVPROC) (const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLVERTEX3HNVPROC) (GLhalf x, GLhalf y, GLhalf z); +typedef void (GLAPIENTRY * PFNGLVERTEX3HVNVPROC) (const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLVERTEX4HNVPROC) (GLhalf x, GLhalf y, GLhalf z, GLhalf w); +typedef void (GLAPIENTRY * PFNGLVERTEX4HVNVPROC) (const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1HNVPROC) (GLuint index, GLhalf x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1HVNVPROC) (GLuint index, const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2HNVPROC) (GLuint index, GLhalf x, GLhalf y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2HVNVPROC) (GLuint index, const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3HNVPROC) (GLuint index, GLhalf x, GLhalf y, GLhalf z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3HVNVPROC) (GLuint index, const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4HNVPROC) (GLuint index, GLhalf x, GLhalf y, GLhalf z, GLhalf w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4HVNVPROC) (GLuint index, const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS1HVNVPROC) (GLuint index, GLsizei n, const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS2HVNVPROC) (GLuint index, GLsizei n, const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS3HVNVPROC) (GLuint index, GLsizei n, const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS4HVNVPROC) (GLuint index, GLsizei n, const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLVERTEXWEIGHTHNVPROC) (GLhalf weight); +typedef void (GLAPIENTRY * PFNGLVERTEXWEIGHTHVNVPROC) (const GLhalf* weight); + +#define glColor3hNV GLEW_GET_FUN(__glewColor3hNV) +#define glColor3hvNV GLEW_GET_FUN(__glewColor3hvNV) +#define glColor4hNV GLEW_GET_FUN(__glewColor4hNV) +#define glColor4hvNV GLEW_GET_FUN(__glewColor4hvNV) +#define glFogCoordhNV GLEW_GET_FUN(__glewFogCoordhNV) +#define glFogCoordhvNV GLEW_GET_FUN(__glewFogCoordhvNV) +#define glMultiTexCoord1hNV GLEW_GET_FUN(__glewMultiTexCoord1hNV) +#define glMultiTexCoord1hvNV GLEW_GET_FUN(__glewMultiTexCoord1hvNV) +#define glMultiTexCoord2hNV GLEW_GET_FUN(__glewMultiTexCoord2hNV) +#define glMultiTexCoord2hvNV GLEW_GET_FUN(__glewMultiTexCoord2hvNV) +#define glMultiTexCoord3hNV GLEW_GET_FUN(__glewMultiTexCoord3hNV) +#define glMultiTexCoord3hvNV GLEW_GET_FUN(__glewMultiTexCoord3hvNV) +#define glMultiTexCoord4hNV GLEW_GET_FUN(__glewMultiTexCoord4hNV) +#define glMultiTexCoord4hvNV GLEW_GET_FUN(__glewMultiTexCoord4hvNV) +#define glNormal3hNV GLEW_GET_FUN(__glewNormal3hNV) +#define glNormal3hvNV GLEW_GET_FUN(__glewNormal3hvNV) +#define glSecondaryColor3hNV GLEW_GET_FUN(__glewSecondaryColor3hNV) +#define glSecondaryColor3hvNV GLEW_GET_FUN(__glewSecondaryColor3hvNV) +#define glTexCoord1hNV GLEW_GET_FUN(__glewTexCoord1hNV) +#define glTexCoord1hvNV GLEW_GET_FUN(__glewTexCoord1hvNV) +#define glTexCoord2hNV GLEW_GET_FUN(__glewTexCoord2hNV) +#define glTexCoord2hvNV GLEW_GET_FUN(__glewTexCoord2hvNV) +#define glTexCoord3hNV GLEW_GET_FUN(__glewTexCoord3hNV) +#define glTexCoord3hvNV GLEW_GET_FUN(__glewTexCoord3hvNV) +#define glTexCoord4hNV GLEW_GET_FUN(__glewTexCoord4hNV) +#define glTexCoord4hvNV GLEW_GET_FUN(__glewTexCoord4hvNV) +#define glVertex2hNV GLEW_GET_FUN(__glewVertex2hNV) +#define glVertex2hvNV GLEW_GET_FUN(__glewVertex2hvNV) +#define glVertex3hNV GLEW_GET_FUN(__glewVertex3hNV) +#define glVertex3hvNV GLEW_GET_FUN(__glewVertex3hvNV) +#define glVertex4hNV GLEW_GET_FUN(__glewVertex4hNV) +#define glVertex4hvNV GLEW_GET_FUN(__glewVertex4hvNV) +#define glVertexAttrib1hNV GLEW_GET_FUN(__glewVertexAttrib1hNV) +#define glVertexAttrib1hvNV GLEW_GET_FUN(__glewVertexAttrib1hvNV) +#define glVertexAttrib2hNV GLEW_GET_FUN(__glewVertexAttrib2hNV) +#define glVertexAttrib2hvNV GLEW_GET_FUN(__glewVertexAttrib2hvNV) +#define glVertexAttrib3hNV GLEW_GET_FUN(__glewVertexAttrib3hNV) +#define glVertexAttrib3hvNV GLEW_GET_FUN(__glewVertexAttrib3hvNV) +#define glVertexAttrib4hNV GLEW_GET_FUN(__glewVertexAttrib4hNV) +#define glVertexAttrib4hvNV GLEW_GET_FUN(__glewVertexAttrib4hvNV) +#define glVertexAttribs1hvNV GLEW_GET_FUN(__glewVertexAttribs1hvNV) +#define glVertexAttribs2hvNV GLEW_GET_FUN(__glewVertexAttribs2hvNV) +#define glVertexAttribs3hvNV GLEW_GET_FUN(__glewVertexAttribs3hvNV) +#define glVertexAttribs4hvNV GLEW_GET_FUN(__glewVertexAttribs4hvNV) +#define glVertexWeighthNV GLEW_GET_FUN(__glewVertexWeighthNV) +#define glVertexWeighthvNV GLEW_GET_FUN(__glewVertexWeighthvNV) + +#define GLEW_NV_half_float GLEW_GET_VAR(__GLEW_NV_half_float) + +#endif /* GL_NV_half_float */ + +/* ------------------------ GL_NV_light_max_exponent ----------------------- */ + +#ifndef GL_NV_light_max_exponent +#define GL_NV_light_max_exponent 1 + +#define GL_MAX_SHININESS_NV 0x8504 +#define GL_MAX_SPOT_EXPONENT_NV 0x8505 + +#define GLEW_NV_light_max_exponent GLEW_GET_VAR(__GLEW_NV_light_max_exponent) + +#endif /* GL_NV_light_max_exponent */ + +/* ----------------------- GL_NV_multisample_coverage ---------------------- */ + +#ifndef GL_NV_multisample_coverage +#define GL_NV_multisample_coverage 1 + +#define GL_COLOR_SAMPLES_NV 0x8E20 + +#define GLEW_NV_multisample_coverage GLEW_GET_VAR(__GLEW_NV_multisample_coverage) + +#endif /* GL_NV_multisample_coverage */ + +/* --------------------- GL_NV_multisample_filter_hint --------------------- */ + +#ifndef GL_NV_multisample_filter_hint +#define GL_NV_multisample_filter_hint 1 + +#define GL_MULTISAMPLE_FILTER_HINT_NV 0x8534 + +#define GLEW_NV_multisample_filter_hint GLEW_GET_VAR(__GLEW_NV_multisample_filter_hint) + +#endif /* GL_NV_multisample_filter_hint */ + +/* ------------------------- GL_NV_occlusion_query ------------------------- */ + +#ifndef GL_NV_occlusion_query +#define GL_NV_occlusion_query 1 + +#define GL_PIXEL_COUNTER_BITS_NV 0x8864 +#define GL_CURRENT_OCCLUSION_QUERY_ID_NV 0x8865 +#define GL_PIXEL_COUNT_NV 0x8866 +#define GL_PIXEL_COUNT_AVAILABLE_NV 0x8867 + +typedef void (GLAPIENTRY * PFNGLBEGINOCCLUSIONQUERYNVPROC) (GLuint id); +typedef void (GLAPIENTRY * PFNGLDELETEOCCLUSIONQUERIESNVPROC) (GLsizei n, const GLuint* ids); +typedef void (GLAPIENTRY * PFNGLENDOCCLUSIONQUERYNVPROC) (void); +typedef void (GLAPIENTRY * PFNGLGENOCCLUSIONQUERIESNVPROC) (GLsizei n, GLuint* ids); +typedef void (GLAPIENTRY * PFNGLGETOCCLUSIONQUERYIVNVPROC) (GLuint id, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETOCCLUSIONQUERYUIVNVPROC) (GLuint id, GLenum pname, GLuint* params); +typedef GLboolean (GLAPIENTRY * PFNGLISOCCLUSIONQUERYNVPROC) (GLuint id); + +#define glBeginOcclusionQueryNV GLEW_GET_FUN(__glewBeginOcclusionQueryNV) +#define glDeleteOcclusionQueriesNV GLEW_GET_FUN(__glewDeleteOcclusionQueriesNV) +#define glEndOcclusionQueryNV GLEW_GET_FUN(__glewEndOcclusionQueryNV) +#define glGenOcclusionQueriesNV GLEW_GET_FUN(__glewGenOcclusionQueriesNV) +#define glGetOcclusionQueryivNV GLEW_GET_FUN(__glewGetOcclusionQueryivNV) +#define glGetOcclusionQueryuivNV GLEW_GET_FUN(__glewGetOcclusionQueryuivNV) +#define glIsOcclusionQueryNV GLEW_GET_FUN(__glewIsOcclusionQueryNV) + +#define GLEW_NV_occlusion_query GLEW_GET_VAR(__GLEW_NV_occlusion_query) + +#endif /* GL_NV_occlusion_query */ + +/* ----------------------- GL_NV_packed_depth_stencil ---------------------- */ + +#ifndef GL_NV_packed_depth_stencil +#define GL_NV_packed_depth_stencil 1 + +#define GL_DEPTH_STENCIL_NV 0x84F9 +#define GL_UNSIGNED_INT_24_8_NV 0x84FA + +#define GLEW_NV_packed_depth_stencil GLEW_GET_VAR(__GLEW_NV_packed_depth_stencil) + +#endif /* GL_NV_packed_depth_stencil */ + +/* --------------------- GL_NV_parameter_buffer_object --------------------- */ + +#ifndef GL_NV_parameter_buffer_object +#define GL_NV_parameter_buffer_object 1 + +#define GL_MAX_PROGRAM_PARAMETER_BUFFER_BINDINGS_NV 0x8DA0 +#define GL_MAX_PROGRAM_PARAMETER_BUFFER_SIZE_NV 0x8DA1 +#define GL_VERTEX_PROGRAM_PARAMETER_BUFFER_NV 0x8DA2 +#define GL_GEOMETRY_PROGRAM_PARAMETER_BUFFER_NV 0x8DA3 +#define GL_FRAGMENT_PROGRAM_PARAMETER_BUFFER_NV 0x8DA4 + +typedef void (GLAPIENTRY * PFNGLPROGRAMBUFFERPARAMETERSIIVNVPROC) (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLint *params); +typedef void (GLAPIENTRY * PFNGLPROGRAMBUFFERPARAMETERSIUIVNVPROC) (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLuint *params); +typedef void (GLAPIENTRY * PFNGLPROGRAMBUFFERPARAMETERSFVNVPROC) (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLfloat *params); + +#define glProgramBufferParametersIivNV GLEW_GET_FUN(__glewProgramBufferParametersIivNV) +#define glProgramBufferParametersIuivNV GLEW_GET_FUN(__glewProgramBufferParametersIuivNV) +#define glProgramBufferParametersfvNV GLEW_GET_FUN(__glewProgramBufferParametersfvNV) + +#define GLEW_NV_parameter_buffer_object GLEW_GET_VAR(__GLEW_NV_parameter_buffer_object) + +#endif /* GL_NV_parameter_buffer_object */ + +/* --------------------- GL_NV_parameter_buffer_object2 -------------------- */ + +#ifndef GL_NV_parameter_buffer_object2 +#define GL_NV_parameter_buffer_object2 1 + +#define GLEW_NV_parameter_buffer_object2 GLEW_GET_VAR(__GLEW_NV_parameter_buffer_object2) + +#endif /* GL_NV_parameter_buffer_object2 */ + +/* -------------------------- GL_NV_path_rendering ------------------------- */ + +#ifndef GL_NV_path_rendering +#define GL_NV_path_rendering 1 + +#define GL_CLOSE_PATH_NV 0x00 +#define GL_BOLD_BIT_NV 0x01 +#define GL_GLYPH_WIDTH_BIT_NV 0x01 +#define GL_GLYPH_HEIGHT_BIT_NV 0x02 +#define GL_ITALIC_BIT_NV 0x02 +#define GL_MOVE_TO_NV 0x02 +#define GL_RELATIVE_MOVE_TO_NV 0x03 +#define GL_LINE_TO_NV 0x04 +#define GL_GLYPH_HORIZONTAL_BEARING_X_BIT_NV 0x04 +#define GL_RELATIVE_LINE_TO_NV 0x05 +#define GL_HORIZONTAL_LINE_TO_NV 0x06 +#define GL_RELATIVE_HORIZONTAL_LINE_TO_NV 0x07 +#define GL_GLYPH_HORIZONTAL_BEARING_Y_BIT_NV 0x08 +#define GL_VERTICAL_LINE_TO_NV 0x08 +#define GL_RELATIVE_VERTICAL_LINE_TO_NV 0x09 +#define GL_QUADRATIC_CURVE_TO_NV 0x0A +#define GL_RELATIVE_QUADRATIC_CURVE_TO_NV 0x0B +#define GL_CUBIC_CURVE_TO_NV 0x0C +#define GL_RELATIVE_CUBIC_CURVE_TO_NV 0x0D +#define GL_SMOOTH_QUADRATIC_CURVE_TO_NV 0x0E +#define GL_RELATIVE_SMOOTH_QUADRATIC_CURVE_TO_NV 0x0F +#define GL_GLYPH_HORIZONTAL_BEARING_ADVANCE_BIT_NV 0x10 +#define GL_SMOOTH_CUBIC_CURVE_TO_NV 0x10 +#define GL_RELATIVE_SMOOTH_CUBIC_CURVE_TO_NV 0x11 +#define GL_SMALL_CCW_ARC_TO_NV 0x12 +#define GL_RELATIVE_SMALL_CCW_ARC_TO_NV 0x13 +#define GL_SMALL_CW_ARC_TO_NV 0x14 +#define GL_RELATIVE_SMALL_CW_ARC_TO_NV 0x15 +#define GL_LARGE_CCW_ARC_TO_NV 0x16 +#define GL_RELATIVE_LARGE_CCW_ARC_TO_NV 0x17 +#define GL_LARGE_CW_ARC_TO_NV 0x18 +#define GL_RELATIVE_LARGE_CW_ARC_TO_NV 0x19 +#define GL_GLYPH_VERTICAL_BEARING_X_BIT_NV 0x20 +#define GL_GLYPH_VERTICAL_BEARING_Y_BIT_NV 0x40 +#define GL_GLYPH_VERTICAL_BEARING_ADVANCE_BIT_NV 0x80 +#define GL_RESTART_PATH_NV 0xF0 +#define GL_DUP_FIRST_CUBIC_CURVE_TO_NV 0xF2 +#define GL_DUP_LAST_CUBIC_CURVE_TO_NV 0xF4 +#define GL_RECT_NV 0xF6 +#define GL_CIRCULAR_CCW_ARC_TO_NV 0xF8 +#define GL_CIRCULAR_CW_ARC_TO_NV 0xFA +#define GL_CIRCULAR_TANGENT_ARC_TO_NV 0xFC +#define GL_ARC_TO_NV 0xFE +#define GL_RELATIVE_ARC_TO_NV 0xFF +#define GL_GLYPH_HAS_KERNING_BIT_NV 0x100 +#define GL_PRIMARY_COLOR 0x8577 +#define GL_PATH_FORMAT_SVG_NV 0x9070 +#define GL_PATH_FORMAT_PS_NV 0x9071 +#define GL_STANDARD_FONT_NAME_NV 0x9072 +#define GL_SYSTEM_FONT_NAME_NV 0x9073 +#define GL_FILE_NAME_NV 0x9074 +#define GL_PATH_STROKE_WIDTH_NV 0x9075 +#define GL_PATH_END_CAPS_NV 0x9076 +#define GL_PATH_INITIAL_END_CAP_NV 0x9077 +#define GL_PATH_TERMINAL_END_CAP_NV 0x9078 +#define GL_PATH_JOIN_STYLE_NV 0x9079 +#define GL_PATH_MITER_LIMIT_NV 0x907A +#define GL_PATH_DASH_CAPS_NV 0x907B +#define GL_PATH_INITIAL_DASH_CAP_NV 0x907C +#define GL_PATH_TERMINAL_DASH_CAP_NV 0x907D +#define GL_PATH_DASH_OFFSET_NV 0x907E +#define GL_PATH_CLIENT_LENGTH_NV 0x907F +#define GL_PATH_FILL_MODE_NV 0x9080 +#define GL_PATH_FILL_MASK_NV 0x9081 +#define GL_PATH_FILL_COVER_MODE_NV 0x9082 +#define GL_PATH_STROKE_COVER_MODE_NV 0x9083 +#define GL_PATH_STROKE_MASK_NV 0x9084 +#define GL_COUNT_UP_NV 0x9088 +#define GL_COUNT_DOWN_NV 0x9089 +#define GL_PATH_OBJECT_BOUNDING_BOX_NV 0x908A +#define GL_CONVEX_HULL_NV 0x908B +#define GL_BOUNDING_BOX_NV 0x908D +#define GL_TRANSLATE_X_NV 0x908E +#define GL_TRANSLATE_Y_NV 0x908F +#define GL_TRANSLATE_2D_NV 0x9090 +#define GL_TRANSLATE_3D_NV 0x9091 +#define GL_AFFINE_2D_NV 0x9092 +#define GL_AFFINE_3D_NV 0x9094 +#define GL_TRANSPOSE_AFFINE_2D_NV 0x9096 +#define GL_TRANSPOSE_AFFINE_3D_NV 0x9098 +#define GL_UTF8_NV 0x909A +#define GL_UTF16_NV 0x909B +#define GL_BOUNDING_BOX_OF_BOUNDING_BOXES_NV 0x909C +#define GL_PATH_COMMAND_COUNT_NV 0x909D +#define GL_PATH_COORD_COUNT_NV 0x909E +#define GL_PATH_DASH_ARRAY_COUNT_NV 0x909F +#define GL_PATH_COMPUTED_LENGTH_NV 0x90A0 +#define GL_PATH_FILL_BOUNDING_BOX_NV 0x90A1 +#define GL_PATH_STROKE_BOUNDING_BOX_NV 0x90A2 +#define GL_SQUARE_NV 0x90A3 +#define GL_ROUND_NV 0x90A4 +#define GL_TRIANGULAR_NV 0x90A5 +#define GL_BEVEL_NV 0x90A6 +#define GL_MITER_REVERT_NV 0x90A7 +#define GL_MITER_TRUNCATE_NV 0x90A8 +#define GL_SKIP_MISSING_GLYPH_NV 0x90A9 +#define GL_USE_MISSING_GLYPH_NV 0x90AA +#define GL_PATH_ERROR_POSITION_NV 0x90AB +#define GL_PATH_FOG_GEN_MODE_NV 0x90AC +#define GL_ACCUM_ADJACENT_PAIRS_NV 0x90AD +#define GL_ADJACENT_PAIRS_NV 0x90AE +#define GL_FIRST_TO_REST_NV 0x90AF +#define GL_PATH_GEN_MODE_NV 0x90B0 +#define GL_PATH_GEN_COEFF_NV 0x90B1 +#define GL_PATH_GEN_COLOR_FORMAT_NV 0x90B2 +#define GL_PATH_GEN_COMPONENTS_NV 0x90B3 +#define GL_PATH_DASH_OFFSET_RESET_NV 0x90B4 +#define GL_MOVE_TO_RESETS_NV 0x90B5 +#define GL_MOVE_TO_CONTINUES_NV 0x90B6 +#define GL_PATH_STENCIL_FUNC_NV 0x90B7 +#define GL_PATH_STENCIL_REF_NV 0x90B8 +#define GL_PATH_STENCIL_VALUE_MASK_NV 0x90B9 +#define GL_PATH_STENCIL_DEPTH_OFFSET_FACTOR_NV 0x90BD +#define GL_PATH_STENCIL_DEPTH_OFFSET_UNITS_NV 0x90BE +#define GL_PATH_COVER_DEPTH_FUNC_NV 0x90BF +#define GL_FONT_X_MIN_BOUNDS_BIT_NV 0x00010000 +#define GL_FONT_Y_MIN_BOUNDS_BIT_NV 0x00020000 +#define GL_FONT_X_MAX_BOUNDS_BIT_NV 0x00040000 +#define GL_FONT_Y_MAX_BOUNDS_BIT_NV 0x00080000 +#define GL_FONT_UNITS_PER_EM_BIT_NV 0x00100000 +#define GL_FONT_ASCENDER_BIT_NV 0x00200000 +#define GL_FONT_DESCENDER_BIT_NV 0x00400000 +#define GL_FONT_HEIGHT_BIT_NV 0x00800000 +#define GL_FONT_MAX_ADVANCE_WIDTH_BIT_NV 0x01000000 +#define GL_FONT_MAX_ADVANCE_HEIGHT_BIT_NV 0x02000000 +#define GL_FONT_UNDERLINE_POSITION_BIT_NV 0x04000000 +#define GL_FONT_UNDERLINE_THICKNESS_BIT_NV 0x08000000 +#define GL_FONT_HAS_KERNING_BIT_NV 0x10000000 + +typedef void (GLAPIENTRY * PFNGLCOPYPATHNVPROC) (GLuint resultPath, GLuint srcPath); +typedef void (GLAPIENTRY * PFNGLCOVERFILLPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void* paths, GLuint pathBase, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); +typedef void (GLAPIENTRY * PFNGLCOVERFILLPATHNVPROC) (GLuint path, GLenum coverMode); +typedef void (GLAPIENTRY * PFNGLCOVERSTROKEPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void* paths, GLuint pathBase, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); +typedef void (GLAPIENTRY * PFNGLCOVERSTROKEPATHNVPROC) (GLuint name, GLenum coverMode); +typedef void (GLAPIENTRY * PFNGLDELETEPATHSNVPROC) (GLuint path, GLsizei range); +typedef GLuint (GLAPIENTRY * PFNGLGENPATHSNVPROC) (GLsizei range); +typedef void (GLAPIENTRY * PFNGLGETPATHCOLORGENFVNVPROC) (GLenum color, GLenum pname, GLfloat* value); +typedef void (GLAPIENTRY * PFNGLGETPATHCOLORGENIVNVPROC) (GLenum color, GLenum pname, GLint* value); +typedef void (GLAPIENTRY * PFNGLGETPATHCOMMANDSNVPROC) (GLuint name, GLubyte* commands); +typedef void (GLAPIENTRY * PFNGLGETPATHCOORDSNVPROC) (GLuint name, GLfloat* coords); +typedef void (GLAPIENTRY * PFNGLGETPATHDASHARRAYNVPROC) (GLuint name, GLfloat* dashArray); +typedef GLfloat (GLAPIENTRY * PFNGLGETPATHLENGTHNVPROC) (GLuint path, GLsizei startSegment, GLsizei numSegments); +typedef void (GLAPIENTRY * PFNGLGETPATHMETRICRANGENVPROC) (GLbitfield metricQueryMask, GLuint fistPathName, GLsizei numPaths, GLsizei stride, GLfloat* metrics); +typedef void (GLAPIENTRY * PFNGLGETPATHMETRICSNVPROC) (GLbitfield metricQueryMask, GLsizei numPaths, GLenum pathNameType, const void* paths, GLuint pathBase, GLsizei stride, GLfloat *metrics); +typedef void (GLAPIENTRY * PFNGLGETPATHPARAMETERFVNVPROC) (GLuint name, GLenum param, GLfloat* value); +typedef void (GLAPIENTRY * PFNGLGETPATHPARAMETERIVNVPROC) (GLuint name, GLenum param, GLint* value); +typedef void (GLAPIENTRY * PFNGLGETPATHSPACINGNVPROC) (GLenum pathListMode, GLsizei numPaths, GLenum pathNameType, const void* paths, GLuint pathBase, GLfloat advanceScale, GLfloat kerningScale, GLenum transformType, GLfloat *returnedSpacing); +typedef void (GLAPIENTRY * PFNGLGETPATHTEXGENFVNVPROC) (GLenum texCoordSet, GLenum pname, GLfloat* value); +typedef void (GLAPIENTRY * PFNGLGETPATHTEXGENIVNVPROC) (GLenum texCoordSet, GLenum pname, GLint* value); +typedef void (GLAPIENTRY * PFNGLINTERPOLATEPATHSNVPROC) (GLuint resultPath, GLuint pathA, GLuint pathB, GLfloat weight); +typedef GLboolean (GLAPIENTRY * PFNGLISPATHNVPROC) (GLuint path); +typedef GLboolean (GLAPIENTRY * PFNGLISPOINTINFILLPATHNVPROC) (GLuint path, GLuint mask, GLfloat x, GLfloat y); +typedef GLboolean (GLAPIENTRY * PFNGLISPOINTINSTROKEPATHNVPROC) (GLuint path, GLfloat x, GLfloat y); +typedef void (GLAPIENTRY * PFNGLPATHCOLORGENNVPROC) (GLenum color, GLenum genMode, GLenum colorFormat, const GLfloat* coeffs); +typedef void (GLAPIENTRY * PFNGLPATHCOMMANDSNVPROC) (GLuint path, GLsizei numCommands, const GLubyte* commands, GLsizei numCoords, GLenum coordType, const GLvoid*coords); +typedef void (GLAPIENTRY * PFNGLPATHCOORDSNVPROC) (GLuint path, GLsizei numCoords, GLenum coordType, const void* coords); +typedef void (GLAPIENTRY * PFNGLPATHCOVERDEPTHFUNCNVPROC) (GLenum zfunc); +typedef void (GLAPIENTRY * PFNGLPATHDASHARRAYNVPROC) (GLuint path, GLsizei dashCount, const GLfloat* dashArray); +typedef void (GLAPIENTRY * PFNGLPATHFOGGENNVPROC) (GLenum genMode); +typedef void (GLAPIENTRY * PFNGLPATHGLYPHRANGENVPROC) (GLuint firstPathName, GLenum fontTarget, const void* fontName, GLbitfield fontStyle, GLuint firstGlyph, GLsizei numGlyphs, GLenum handleMissingGlyphs, GLuint pathParameterTemplate, GLfloat emScale); +typedef void (GLAPIENTRY * PFNGLPATHGLYPHSNVPROC) (GLuint firstPathName, GLenum fontTarget, const void* fontName, GLbitfield fontStyle, GLsizei numGlyphs, GLenum type, const GLvoid*charcodes, GLenum handleMissingGlyphs, GLuint pathParameterTemplate, GLfloat emScale); +typedef void (GLAPIENTRY * PFNGLPATHPARAMETERFNVPROC) (GLuint path, GLenum pname, GLfloat value); +typedef void (GLAPIENTRY * PFNGLPATHPARAMETERFVNVPROC) (GLuint path, GLenum pname, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPATHPARAMETERINVPROC) (GLuint path, GLenum pname, GLint value); +typedef void (GLAPIENTRY * PFNGLPATHPARAMETERIVNVPROC) (GLuint path, GLenum pname, const GLint* value); +typedef void (GLAPIENTRY * PFNGLPATHSTENCILDEPTHOFFSETNVPROC) (GLfloat factor, GLfloat units); +typedef void (GLAPIENTRY * PFNGLPATHSTENCILFUNCNVPROC) (GLenum func, GLint ref, GLuint mask); +typedef void (GLAPIENTRY * PFNGLPATHSTRINGNVPROC) (GLuint path, GLenum format, GLsizei length, const void* pathString); +typedef void (GLAPIENTRY * PFNGLPATHSUBCOMMANDSNVPROC) (GLuint path, GLsizei commandStart, GLsizei commandsToDelete, GLsizei numCommands, const GLubyte* commands, GLsizei numCoords, GLenum coordType, const GLvoid*coords); +typedef void (GLAPIENTRY * PFNGLPATHSUBCOORDSNVPROC) (GLuint path, GLsizei coordStart, GLsizei numCoords, GLenum coordType, const void* coords); +typedef void (GLAPIENTRY * PFNGLPATHTEXGENNVPROC) (GLenum texCoordSet, GLenum genMode, GLint components, const GLfloat* coeffs); +typedef GLboolean (GLAPIENTRY * PFNGLPOINTALONGPATHNVPROC) (GLuint path, GLsizei startSegment, GLsizei numSegments, GLfloat distance, GLfloat* x, GLfloat *y, GLfloat *tangentX, GLfloat *tangentY); +typedef void (GLAPIENTRY * PFNGLSTENCILFILLPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void* paths, GLuint pathBase, GLenum fillMode, GLuint mask, GLenum transformType, const GLfloat *transformValues); +typedef void (GLAPIENTRY * PFNGLSTENCILFILLPATHNVPROC) (GLuint path, GLenum fillMode, GLuint mask); +typedef void (GLAPIENTRY * PFNGLSTENCILSTROKEPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void* paths, GLuint pathBase, GLint reference, GLuint mask, GLenum transformType, const GLfloat *transformValues); +typedef void (GLAPIENTRY * PFNGLSTENCILSTROKEPATHNVPROC) (GLuint path, GLint reference, GLuint mask); +typedef void (GLAPIENTRY * PFNGLTRANSFORMPATHNVPROC) (GLuint resultPath, GLuint srcPath, GLenum transformType, const GLfloat* transformValues); +typedef void (GLAPIENTRY * PFNGLWEIGHTPATHSNVPROC) (GLuint resultPath, GLsizei numPaths, const GLuint paths[], const GLfloat weights[]); + +#define glCopyPathNV GLEW_GET_FUN(__glewCopyPathNV) +#define glCoverFillPathInstancedNV GLEW_GET_FUN(__glewCoverFillPathInstancedNV) +#define glCoverFillPathNV GLEW_GET_FUN(__glewCoverFillPathNV) +#define glCoverStrokePathInstancedNV GLEW_GET_FUN(__glewCoverStrokePathInstancedNV) +#define glCoverStrokePathNV GLEW_GET_FUN(__glewCoverStrokePathNV) +#define glDeletePathsNV GLEW_GET_FUN(__glewDeletePathsNV) +#define glGenPathsNV GLEW_GET_FUN(__glewGenPathsNV) +#define glGetPathColorGenfvNV GLEW_GET_FUN(__glewGetPathColorGenfvNV) +#define glGetPathColorGenivNV GLEW_GET_FUN(__glewGetPathColorGenivNV) +#define glGetPathCommandsNV GLEW_GET_FUN(__glewGetPathCommandsNV) +#define glGetPathCoordsNV GLEW_GET_FUN(__glewGetPathCoordsNV) +#define glGetPathDashArrayNV GLEW_GET_FUN(__glewGetPathDashArrayNV) +#define glGetPathLengthNV GLEW_GET_FUN(__glewGetPathLengthNV) +#define glGetPathMetricRangeNV GLEW_GET_FUN(__glewGetPathMetricRangeNV) +#define glGetPathMetricsNV GLEW_GET_FUN(__glewGetPathMetricsNV) +#define glGetPathParameterfvNV GLEW_GET_FUN(__glewGetPathParameterfvNV) +#define glGetPathParameterivNV GLEW_GET_FUN(__glewGetPathParameterivNV) +#define glGetPathSpacingNV GLEW_GET_FUN(__glewGetPathSpacingNV) +#define glGetPathTexGenfvNV GLEW_GET_FUN(__glewGetPathTexGenfvNV) +#define glGetPathTexGenivNV GLEW_GET_FUN(__glewGetPathTexGenivNV) +#define glInterpolatePathsNV GLEW_GET_FUN(__glewInterpolatePathsNV) +#define glIsPathNV GLEW_GET_FUN(__glewIsPathNV) +#define glIsPointInFillPathNV GLEW_GET_FUN(__glewIsPointInFillPathNV) +#define glIsPointInStrokePathNV GLEW_GET_FUN(__glewIsPointInStrokePathNV) +#define glPathColorGenNV GLEW_GET_FUN(__glewPathColorGenNV) +#define glPathCommandsNV GLEW_GET_FUN(__glewPathCommandsNV) +#define glPathCoordsNV GLEW_GET_FUN(__glewPathCoordsNV) +#define glPathCoverDepthFuncNV GLEW_GET_FUN(__glewPathCoverDepthFuncNV) +#define glPathDashArrayNV GLEW_GET_FUN(__glewPathDashArrayNV) +#define glPathFogGenNV GLEW_GET_FUN(__glewPathFogGenNV) +#define glPathGlyphRangeNV GLEW_GET_FUN(__glewPathGlyphRangeNV) +#define glPathGlyphsNV GLEW_GET_FUN(__glewPathGlyphsNV) +#define glPathParameterfNV GLEW_GET_FUN(__glewPathParameterfNV) +#define glPathParameterfvNV GLEW_GET_FUN(__glewPathParameterfvNV) +#define glPathParameteriNV GLEW_GET_FUN(__glewPathParameteriNV) +#define glPathParameterivNV GLEW_GET_FUN(__glewPathParameterivNV) +#define glPathStencilDepthOffsetNV GLEW_GET_FUN(__glewPathStencilDepthOffsetNV) +#define glPathStencilFuncNV GLEW_GET_FUN(__glewPathStencilFuncNV) +#define glPathStringNV GLEW_GET_FUN(__glewPathStringNV) +#define glPathSubCommandsNV GLEW_GET_FUN(__glewPathSubCommandsNV) +#define glPathSubCoordsNV GLEW_GET_FUN(__glewPathSubCoordsNV) +#define glPathTexGenNV GLEW_GET_FUN(__glewPathTexGenNV) +#define glPointAlongPathNV GLEW_GET_FUN(__glewPointAlongPathNV) +#define glStencilFillPathInstancedNV GLEW_GET_FUN(__glewStencilFillPathInstancedNV) +#define glStencilFillPathNV GLEW_GET_FUN(__glewStencilFillPathNV) +#define glStencilStrokePathInstancedNV GLEW_GET_FUN(__glewStencilStrokePathInstancedNV) +#define glStencilStrokePathNV GLEW_GET_FUN(__glewStencilStrokePathNV) +#define glTransformPathNV GLEW_GET_FUN(__glewTransformPathNV) +#define glWeightPathsNV GLEW_GET_FUN(__glewWeightPathsNV) + +#define GLEW_NV_path_rendering GLEW_GET_VAR(__GLEW_NV_path_rendering) + +#endif /* GL_NV_path_rendering */ + +/* ------------------------- GL_NV_pixel_data_range ------------------------ */ + +#ifndef GL_NV_pixel_data_range +#define GL_NV_pixel_data_range 1 + +#define GL_WRITE_PIXEL_DATA_RANGE_NV 0x8878 +#define GL_READ_PIXEL_DATA_RANGE_NV 0x8879 +#define GL_WRITE_PIXEL_DATA_RANGE_LENGTH_NV 0x887A +#define GL_READ_PIXEL_DATA_RANGE_LENGTH_NV 0x887B +#define GL_WRITE_PIXEL_DATA_RANGE_POINTER_NV 0x887C +#define GL_READ_PIXEL_DATA_RANGE_POINTER_NV 0x887D + +typedef void (GLAPIENTRY * PFNGLFLUSHPIXELDATARANGENVPROC) (GLenum target); +typedef void (GLAPIENTRY * PFNGLPIXELDATARANGENVPROC) (GLenum target, GLsizei length, GLvoid *pointer); + +#define glFlushPixelDataRangeNV GLEW_GET_FUN(__glewFlushPixelDataRangeNV) +#define glPixelDataRangeNV GLEW_GET_FUN(__glewPixelDataRangeNV) + +#define GLEW_NV_pixel_data_range GLEW_GET_VAR(__GLEW_NV_pixel_data_range) + +#endif /* GL_NV_pixel_data_range */ + +/* --------------------------- GL_NV_point_sprite -------------------------- */ + +#ifndef GL_NV_point_sprite +#define GL_NV_point_sprite 1 + +#define GL_POINT_SPRITE_NV 0x8861 +#define GL_COORD_REPLACE_NV 0x8862 +#define GL_POINT_SPRITE_R_MODE_NV 0x8863 + +typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERINVPROC) (GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERIVNVPROC) (GLenum pname, const GLint* params); + +#define glPointParameteriNV GLEW_GET_FUN(__glewPointParameteriNV) +#define glPointParameterivNV GLEW_GET_FUN(__glewPointParameterivNV) + +#define GLEW_NV_point_sprite GLEW_GET_VAR(__GLEW_NV_point_sprite) + +#endif /* GL_NV_point_sprite */ + +/* -------------------------- GL_NV_present_video -------------------------- */ + +#ifndef GL_NV_present_video +#define GL_NV_present_video 1 + +#define GL_FRAME_NV 0x8E26 +#define GL_FIELDS_NV 0x8E27 +#define GL_CURRENT_TIME_NV 0x8E28 +#define GL_NUM_FILL_STREAMS_NV 0x8E29 +#define GL_PRESENT_TIME_NV 0x8E2A +#define GL_PRESENT_DURATION_NV 0x8E2B + +typedef void (GLAPIENTRY * PFNGLGETVIDEOI64VNVPROC) (GLuint video_slot, GLenum pname, GLint64EXT* params); +typedef void (GLAPIENTRY * PFNGLGETVIDEOIVNVPROC) (GLuint video_slot, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETVIDEOUI64VNVPROC) (GLuint video_slot, GLenum pname, GLuint64EXT* params); +typedef void (GLAPIENTRY * PFNGLGETVIDEOUIVNVPROC) (GLuint video_slot, GLenum pname, GLuint* params); +typedef void (GLAPIENTRY * PFNGLPRESENTFRAMEDUALFILLNVPROC) (GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLenum target1, GLuint fill1, GLenum target2, GLuint fill2, GLenum target3, GLuint fill3); +typedef void (GLAPIENTRY * PFNGLPRESENTFRAMEKEYEDNVPROC) (GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLuint key0, GLenum target1, GLuint fill1, GLuint key1); + +#define glGetVideoi64vNV GLEW_GET_FUN(__glewGetVideoi64vNV) +#define glGetVideoivNV GLEW_GET_FUN(__glewGetVideoivNV) +#define glGetVideoui64vNV GLEW_GET_FUN(__glewGetVideoui64vNV) +#define glGetVideouivNV GLEW_GET_FUN(__glewGetVideouivNV) +#define glPresentFrameDualFillNV GLEW_GET_FUN(__glewPresentFrameDualFillNV) +#define glPresentFrameKeyedNV GLEW_GET_FUN(__glewPresentFrameKeyedNV) + +#define GLEW_NV_present_video GLEW_GET_VAR(__GLEW_NV_present_video) + +#endif /* GL_NV_present_video */ + +/* ------------------------ GL_NV_primitive_restart ------------------------ */ + +#ifndef GL_NV_primitive_restart +#define GL_NV_primitive_restart 1 + +#define GL_PRIMITIVE_RESTART_NV 0x8558 +#define GL_PRIMITIVE_RESTART_INDEX_NV 0x8559 + +typedef void (GLAPIENTRY * PFNGLPRIMITIVERESTARTINDEXNVPROC) (GLuint index); +typedef void (GLAPIENTRY * PFNGLPRIMITIVERESTARTNVPROC) (void); + +#define glPrimitiveRestartIndexNV GLEW_GET_FUN(__glewPrimitiveRestartIndexNV) +#define glPrimitiveRestartNV GLEW_GET_FUN(__glewPrimitiveRestartNV) + +#define GLEW_NV_primitive_restart GLEW_GET_VAR(__GLEW_NV_primitive_restart) + +#endif /* GL_NV_primitive_restart */ + +/* ------------------------ GL_NV_register_combiners ----------------------- */ + +#ifndef GL_NV_register_combiners +#define GL_NV_register_combiners 1 + +#define GL_REGISTER_COMBINERS_NV 0x8522 +#define GL_VARIABLE_A_NV 0x8523 +#define GL_VARIABLE_B_NV 0x8524 +#define GL_VARIABLE_C_NV 0x8525 +#define GL_VARIABLE_D_NV 0x8526 +#define GL_VARIABLE_E_NV 0x8527 +#define GL_VARIABLE_F_NV 0x8528 +#define GL_VARIABLE_G_NV 0x8529 +#define GL_CONSTANT_COLOR0_NV 0x852A +#define GL_CONSTANT_COLOR1_NV 0x852B +#define GL_PRIMARY_COLOR_NV 0x852C +#define GL_SECONDARY_COLOR_NV 0x852D +#define GL_SPARE0_NV 0x852E +#define GL_SPARE1_NV 0x852F +#define GL_DISCARD_NV 0x8530 +#define GL_E_TIMES_F_NV 0x8531 +#define GL_SPARE0_PLUS_SECONDARY_COLOR_NV 0x8532 +#define GL_UNSIGNED_IDENTITY_NV 0x8536 +#define GL_UNSIGNED_INVERT_NV 0x8537 +#define GL_EXPAND_NORMAL_NV 0x8538 +#define GL_EXPAND_NEGATE_NV 0x8539 +#define GL_HALF_BIAS_NORMAL_NV 0x853A +#define GL_HALF_BIAS_NEGATE_NV 0x853B +#define GL_SIGNED_IDENTITY_NV 0x853C +#define GL_SIGNED_NEGATE_NV 0x853D +#define GL_SCALE_BY_TWO_NV 0x853E +#define GL_SCALE_BY_FOUR_NV 0x853F +#define GL_SCALE_BY_ONE_HALF_NV 0x8540 +#define GL_BIAS_BY_NEGATIVE_ONE_HALF_NV 0x8541 +#define GL_COMBINER_INPUT_NV 0x8542 +#define GL_COMBINER_MAPPING_NV 0x8543 +#define GL_COMBINER_COMPONENT_USAGE_NV 0x8544 +#define GL_COMBINER_AB_DOT_PRODUCT_NV 0x8545 +#define GL_COMBINER_CD_DOT_PRODUCT_NV 0x8546 +#define GL_COMBINER_MUX_SUM_NV 0x8547 +#define GL_COMBINER_SCALE_NV 0x8548 +#define GL_COMBINER_BIAS_NV 0x8549 +#define GL_COMBINER_AB_OUTPUT_NV 0x854A +#define GL_COMBINER_CD_OUTPUT_NV 0x854B +#define GL_COMBINER_SUM_OUTPUT_NV 0x854C +#define GL_MAX_GENERAL_COMBINERS_NV 0x854D +#define GL_NUM_GENERAL_COMBINERS_NV 0x854E +#define GL_COLOR_SUM_CLAMP_NV 0x854F +#define GL_COMBINER0_NV 0x8550 +#define GL_COMBINER1_NV 0x8551 +#define GL_COMBINER2_NV 0x8552 +#define GL_COMBINER3_NV 0x8553 +#define GL_COMBINER4_NV 0x8554 +#define GL_COMBINER5_NV 0x8555 +#define GL_COMBINER6_NV 0x8556 +#define GL_COMBINER7_NV 0x8557 + +typedef void (GLAPIENTRY * PFNGLCOMBINERINPUTNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); +typedef void (GLAPIENTRY * PFNGLCOMBINEROUTPUTNVPROC) (GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum); +typedef void (GLAPIENTRY * PFNGLCOMBINERPARAMETERFNVPROC) (GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLCOMBINERPARAMETERFVNVPROC) (GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLCOMBINERPARAMETERINVPROC) (GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLCOMBINERPARAMETERIVNVPROC) (GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLFINALCOMBINERINPUTNVPROC) (GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); +typedef void (GLAPIENTRY * PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC) (GLenum variable, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC) (GLenum variable, GLenum pname, GLint* params); + +#define glCombinerInputNV GLEW_GET_FUN(__glewCombinerInputNV) +#define glCombinerOutputNV GLEW_GET_FUN(__glewCombinerOutputNV) +#define glCombinerParameterfNV GLEW_GET_FUN(__glewCombinerParameterfNV) +#define glCombinerParameterfvNV GLEW_GET_FUN(__glewCombinerParameterfvNV) +#define glCombinerParameteriNV GLEW_GET_FUN(__glewCombinerParameteriNV) +#define glCombinerParameterivNV GLEW_GET_FUN(__glewCombinerParameterivNV) +#define glFinalCombinerInputNV GLEW_GET_FUN(__glewFinalCombinerInputNV) +#define glGetCombinerInputParameterfvNV GLEW_GET_FUN(__glewGetCombinerInputParameterfvNV) +#define glGetCombinerInputParameterivNV GLEW_GET_FUN(__glewGetCombinerInputParameterivNV) +#define glGetCombinerOutputParameterfvNV GLEW_GET_FUN(__glewGetCombinerOutputParameterfvNV) +#define glGetCombinerOutputParameterivNV GLEW_GET_FUN(__glewGetCombinerOutputParameterivNV) +#define glGetFinalCombinerInputParameterfvNV GLEW_GET_FUN(__glewGetFinalCombinerInputParameterfvNV) +#define glGetFinalCombinerInputParameterivNV GLEW_GET_FUN(__glewGetFinalCombinerInputParameterivNV) + +#define GLEW_NV_register_combiners GLEW_GET_VAR(__GLEW_NV_register_combiners) + +#endif /* GL_NV_register_combiners */ + +/* ----------------------- GL_NV_register_combiners2 ----------------------- */ + +#ifndef GL_NV_register_combiners2 +#define GL_NV_register_combiners2 1 + +#define GL_PER_STAGE_CONSTANTS_NV 0x8535 + +typedef void (GLAPIENTRY * PFNGLCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage, GLenum pname, GLfloat* params); + +#define glCombinerStageParameterfvNV GLEW_GET_FUN(__glewCombinerStageParameterfvNV) +#define glGetCombinerStageParameterfvNV GLEW_GET_FUN(__glewGetCombinerStageParameterfvNV) + +#define GLEW_NV_register_combiners2 GLEW_GET_VAR(__GLEW_NV_register_combiners2) + +#endif /* GL_NV_register_combiners2 */ + +/* ---------------------- GL_NV_shader_atomic_counters --------------------- */ + +#ifndef GL_NV_shader_atomic_counters +#define GL_NV_shader_atomic_counters 1 + +#define GLEW_NV_shader_atomic_counters GLEW_GET_VAR(__GLEW_NV_shader_atomic_counters) + +#endif /* GL_NV_shader_atomic_counters */ + +/* ----------------------- GL_NV_shader_atomic_float ----------------------- */ + +#ifndef GL_NV_shader_atomic_float +#define GL_NV_shader_atomic_float 1 + +#define GLEW_NV_shader_atomic_float GLEW_GET_VAR(__GLEW_NV_shader_atomic_float) + +#endif /* GL_NV_shader_atomic_float */ + +/* ------------------------ GL_NV_shader_buffer_load ----------------------- */ + +#ifndef GL_NV_shader_buffer_load +#define GL_NV_shader_buffer_load 1 + +#define GL_BUFFER_GPU_ADDRESS_NV 0x8F1D +#define GL_GPU_ADDRESS_NV 0x8F34 +#define GL_MAX_SHADER_BUFFER_ADDRESS_NV 0x8F35 + +typedef void (GLAPIENTRY * PFNGLGETBUFFERPARAMETERUI64VNVPROC) (GLenum target, GLenum pname, GLuint64EXT* params); +typedef void (GLAPIENTRY * PFNGLGETINTEGERUI64VNVPROC) (GLenum value, GLuint64EXT* result); +typedef void (GLAPIENTRY * PFNGLGETNAMEDBUFFERPARAMETERUI64VNVPROC) (GLuint buffer, GLenum pname, GLuint64EXT* params); +typedef GLboolean (GLAPIENTRY * PFNGLISBUFFERRESIDENTNVPROC) (GLenum target); +typedef GLboolean (GLAPIENTRY * PFNGLISNAMEDBUFFERRESIDENTNVPROC) (GLuint buffer); +typedef void (GLAPIENTRY * PFNGLMAKEBUFFERNONRESIDENTNVPROC) (GLenum target); +typedef void (GLAPIENTRY * PFNGLMAKEBUFFERRESIDENTNVPROC) (GLenum target, GLenum access); +typedef void (GLAPIENTRY * PFNGLMAKENAMEDBUFFERNONRESIDENTNVPROC) (GLuint buffer); +typedef void (GLAPIENTRY * PFNGLMAKENAMEDBUFFERRESIDENTNVPROC) (GLuint buffer, GLenum access); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMUI64NVPROC) (GLuint program, GLint location, GLuint64EXT value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMUI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMUI64NVPROC) (GLint location, GLuint64EXT value); +typedef void (GLAPIENTRY * PFNGLUNIFORMUI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT* value); + +#define glGetBufferParameterui64vNV GLEW_GET_FUN(__glewGetBufferParameterui64vNV) +#define glGetIntegerui64vNV GLEW_GET_FUN(__glewGetIntegerui64vNV) +#define glGetNamedBufferParameterui64vNV GLEW_GET_FUN(__glewGetNamedBufferParameterui64vNV) +#define glIsBufferResidentNV GLEW_GET_FUN(__glewIsBufferResidentNV) +#define glIsNamedBufferResidentNV GLEW_GET_FUN(__glewIsNamedBufferResidentNV) +#define glMakeBufferNonResidentNV GLEW_GET_FUN(__glewMakeBufferNonResidentNV) +#define glMakeBufferResidentNV GLEW_GET_FUN(__glewMakeBufferResidentNV) +#define glMakeNamedBufferNonResidentNV GLEW_GET_FUN(__glewMakeNamedBufferNonResidentNV) +#define glMakeNamedBufferResidentNV GLEW_GET_FUN(__glewMakeNamedBufferResidentNV) +#define glProgramUniformui64NV GLEW_GET_FUN(__glewProgramUniformui64NV) +#define glProgramUniformui64vNV GLEW_GET_FUN(__glewProgramUniformui64vNV) +#define glUniformui64NV GLEW_GET_FUN(__glewUniformui64NV) +#define glUniformui64vNV GLEW_GET_FUN(__glewUniformui64vNV) + +#define GLEW_NV_shader_buffer_load GLEW_GET_VAR(__GLEW_NV_shader_buffer_load) + +#endif /* GL_NV_shader_buffer_load */ + +/* ------------------- GL_NV_shader_storage_buffer_object ------------------ */ + +#ifndef GL_NV_shader_storage_buffer_object +#define GL_NV_shader_storage_buffer_object 1 + +#define GLEW_NV_shader_storage_buffer_object GLEW_GET_VAR(__GLEW_NV_shader_storage_buffer_object) + +#endif /* GL_NV_shader_storage_buffer_object */ + +/* ---------------------- GL_NV_tessellation_program5 ---------------------- */ + +#ifndef GL_NV_tessellation_program5 +#define GL_NV_tessellation_program5 1 + +#define GL_MAX_PROGRAM_PATCH_ATTRIBS_NV 0x86D8 +#define GL_TESS_CONTROL_PROGRAM_NV 0x891E +#define GL_TESS_EVALUATION_PROGRAM_NV 0x891F +#define GL_TESS_CONTROL_PROGRAM_PARAMETER_BUFFER_NV 0x8C74 +#define GL_TESS_EVALUATION_PROGRAM_PARAMETER_BUFFER_NV 0x8C75 + +#define GLEW_NV_tessellation_program5 GLEW_GET_VAR(__GLEW_NV_tessellation_program5) + +#endif /* GL_NV_tessellation_program5 */ + +/* -------------------------- GL_NV_texgen_emboss -------------------------- */ + +#ifndef GL_NV_texgen_emboss +#define GL_NV_texgen_emboss 1 + +#define GL_EMBOSS_LIGHT_NV 0x855D +#define GL_EMBOSS_CONSTANT_NV 0x855E +#define GL_EMBOSS_MAP_NV 0x855F + +#define GLEW_NV_texgen_emboss GLEW_GET_VAR(__GLEW_NV_texgen_emboss) + +#endif /* GL_NV_texgen_emboss */ + +/* ------------------------ GL_NV_texgen_reflection ------------------------ */ + +#ifndef GL_NV_texgen_reflection +#define GL_NV_texgen_reflection 1 + +#define GL_NORMAL_MAP_NV 0x8511 +#define GL_REFLECTION_MAP_NV 0x8512 + +#define GLEW_NV_texgen_reflection GLEW_GET_VAR(__GLEW_NV_texgen_reflection) + +#endif /* GL_NV_texgen_reflection */ + +/* ------------------------- GL_NV_texture_barrier ------------------------- */ + +#ifndef GL_NV_texture_barrier +#define GL_NV_texture_barrier 1 + +typedef void (GLAPIENTRY * PFNGLTEXTUREBARRIERNVPROC) (void); + +#define glTextureBarrierNV GLEW_GET_FUN(__glewTextureBarrierNV) + +#define GLEW_NV_texture_barrier GLEW_GET_VAR(__GLEW_NV_texture_barrier) + +#endif /* GL_NV_texture_barrier */ + +/* --------------------- GL_NV_texture_compression_vtc --------------------- */ + +#ifndef GL_NV_texture_compression_vtc +#define GL_NV_texture_compression_vtc 1 + +#define GLEW_NV_texture_compression_vtc GLEW_GET_VAR(__GLEW_NV_texture_compression_vtc) + +#endif /* GL_NV_texture_compression_vtc */ + +/* ----------------------- GL_NV_texture_env_combine4 ---------------------- */ + +#ifndef GL_NV_texture_env_combine4 +#define GL_NV_texture_env_combine4 1 + +#define GL_COMBINE4_NV 0x8503 +#define GL_SOURCE3_RGB_NV 0x8583 +#define GL_SOURCE3_ALPHA_NV 0x858B +#define GL_OPERAND3_RGB_NV 0x8593 +#define GL_OPERAND3_ALPHA_NV 0x859B + +#define GLEW_NV_texture_env_combine4 GLEW_GET_VAR(__GLEW_NV_texture_env_combine4) + +#endif /* GL_NV_texture_env_combine4 */ + +/* ---------------------- GL_NV_texture_expand_normal ---------------------- */ + +#ifndef GL_NV_texture_expand_normal +#define GL_NV_texture_expand_normal 1 + +#define GL_TEXTURE_UNSIGNED_REMAP_MODE_NV 0x888F + +#define GLEW_NV_texture_expand_normal GLEW_GET_VAR(__GLEW_NV_texture_expand_normal) + +#endif /* GL_NV_texture_expand_normal */ + +/* ----------------------- GL_NV_texture_multisample ----------------------- */ + +#ifndef GL_NV_texture_multisample +#define GL_NV_texture_multisample 1 + +#define GL_TEXTURE_COVERAGE_SAMPLES_NV 0x9045 +#define GL_TEXTURE_COLOR_SAMPLES_NV 0x9046 + +typedef void (GLAPIENTRY * PFNGLTEXIMAGE2DMULTISAMPLECOVERAGENVPROC) (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations); +typedef void (GLAPIENTRY * PFNGLTEXIMAGE3DMULTISAMPLECOVERAGENVPROC) (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations); +typedef void (GLAPIENTRY * PFNGLTEXTUREIMAGE2DMULTISAMPLECOVERAGENVPROC) (GLuint texture, GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations); +typedef void (GLAPIENTRY * PFNGLTEXTUREIMAGE2DMULTISAMPLENVPROC) (GLuint texture, GLenum target, GLsizei samples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations); +typedef void (GLAPIENTRY * PFNGLTEXTUREIMAGE3DMULTISAMPLECOVERAGENVPROC) (GLuint texture, GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations); +typedef void (GLAPIENTRY * PFNGLTEXTUREIMAGE3DMULTISAMPLENVPROC) (GLuint texture, GLenum target, GLsizei samples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations); + +#define glTexImage2DMultisampleCoverageNV GLEW_GET_FUN(__glewTexImage2DMultisampleCoverageNV) +#define glTexImage3DMultisampleCoverageNV GLEW_GET_FUN(__glewTexImage3DMultisampleCoverageNV) +#define glTextureImage2DMultisampleCoverageNV GLEW_GET_FUN(__glewTextureImage2DMultisampleCoverageNV) +#define glTextureImage2DMultisampleNV GLEW_GET_FUN(__glewTextureImage2DMultisampleNV) +#define glTextureImage3DMultisampleCoverageNV GLEW_GET_FUN(__glewTextureImage3DMultisampleCoverageNV) +#define glTextureImage3DMultisampleNV GLEW_GET_FUN(__glewTextureImage3DMultisampleNV) + +#define GLEW_NV_texture_multisample GLEW_GET_VAR(__GLEW_NV_texture_multisample) + +#endif /* GL_NV_texture_multisample */ + +/* ------------------------ GL_NV_texture_rectangle ------------------------ */ + +#ifndef GL_NV_texture_rectangle +#define GL_NV_texture_rectangle 1 + +#define GL_TEXTURE_RECTANGLE_NV 0x84F5 +#define GL_TEXTURE_BINDING_RECTANGLE_NV 0x84F6 +#define GL_PROXY_TEXTURE_RECTANGLE_NV 0x84F7 +#define GL_MAX_RECTANGLE_TEXTURE_SIZE_NV 0x84F8 + +#define GLEW_NV_texture_rectangle GLEW_GET_VAR(__GLEW_NV_texture_rectangle) + +#endif /* GL_NV_texture_rectangle */ + +/* -------------------------- GL_NV_texture_shader ------------------------- */ + +#ifndef GL_NV_texture_shader +#define GL_NV_texture_shader 1 + +#define GL_OFFSET_TEXTURE_RECTANGLE_NV 0x864C +#define GL_OFFSET_TEXTURE_RECTANGLE_SCALE_NV 0x864D +#define GL_DOT_PRODUCT_TEXTURE_RECTANGLE_NV 0x864E +#define GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV 0x86D9 +#define GL_UNSIGNED_INT_S8_S8_8_8_NV 0x86DA +#define GL_UNSIGNED_INT_8_8_S8_S8_REV_NV 0x86DB +#define GL_DSDT_MAG_INTENSITY_NV 0x86DC +#define GL_SHADER_CONSISTENT_NV 0x86DD +#define GL_TEXTURE_SHADER_NV 0x86DE +#define GL_SHADER_OPERATION_NV 0x86DF +#define GL_CULL_MODES_NV 0x86E0 +#define GL_OFFSET_TEXTURE_2D_MATRIX_NV 0x86E1 +#define GL_OFFSET_TEXTURE_MATRIX_NV 0x86E1 +#define GL_OFFSET_TEXTURE_2D_SCALE_NV 0x86E2 +#define GL_OFFSET_TEXTURE_SCALE_NV 0x86E2 +#define GL_OFFSET_TEXTURE_BIAS_NV 0x86E3 +#define GL_OFFSET_TEXTURE_2D_BIAS_NV 0x86E3 +#define GL_PREVIOUS_TEXTURE_INPUT_NV 0x86E4 +#define GL_CONST_EYE_NV 0x86E5 +#define GL_PASS_THROUGH_NV 0x86E6 +#define GL_CULL_FRAGMENT_NV 0x86E7 +#define GL_OFFSET_TEXTURE_2D_NV 0x86E8 +#define GL_DEPENDENT_AR_TEXTURE_2D_NV 0x86E9 +#define GL_DEPENDENT_GB_TEXTURE_2D_NV 0x86EA +#define GL_DOT_PRODUCT_NV 0x86EC +#define GL_DOT_PRODUCT_DEPTH_REPLACE_NV 0x86ED +#define GL_DOT_PRODUCT_TEXTURE_2D_NV 0x86EE +#define GL_DOT_PRODUCT_TEXTURE_CUBE_MAP_NV 0x86F0 +#define GL_DOT_PRODUCT_DIFFUSE_CUBE_MAP_NV 0x86F1 +#define GL_DOT_PRODUCT_REFLECT_CUBE_MAP_NV 0x86F2 +#define GL_DOT_PRODUCT_CONST_EYE_REFLECT_CUBE_MAP_NV 0x86F3 +#define GL_HILO_NV 0x86F4 +#define GL_DSDT_NV 0x86F5 +#define GL_DSDT_MAG_NV 0x86F6 +#define GL_DSDT_MAG_VIB_NV 0x86F7 +#define GL_HILO16_NV 0x86F8 +#define GL_SIGNED_HILO_NV 0x86F9 +#define GL_SIGNED_HILO16_NV 0x86FA +#define GL_SIGNED_RGBA_NV 0x86FB +#define GL_SIGNED_RGBA8_NV 0x86FC +#define GL_SIGNED_RGB_NV 0x86FE +#define GL_SIGNED_RGB8_NV 0x86FF +#define GL_SIGNED_LUMINANCE_NV 0x8701 +#define GL_SIGNED_LUMINANCE8_NV 0x8702 +#define GL_SIGNED_LUMINANCE_ALPHA_NV 0x8703 +#define GL_SIGNED_LUMINANCE8_ALPHA8_NV 0x8704 +#define GL_SIGNED_ALPHA_NV 0x8705 +#define GL_SIGNED_ALPHA8_NV 0x8706 +#define GL_SIGNED_INTENSITY_NV 0x8707 +#define GL_SIGNED_INTENSITY8_NV 0x8708 +#define GL_DSDT8_NV 0x8709 +#define GL_DSDT8_MAG8_NV 0x870A +#define GL_DSDT8_MAG8_INTENSITY8_NV 0x870B +#define GL_SIGNED_RGB_UNSIGNED_ALPHA_NV 0x870C +#define GL_SIGNED_RGB8_UNSIGNED_ALPHA8_NV 0x870D +#define GL_HI_SCALE_NV 0x870E +#define GL_LO_SCALE_NV 0x870F +#define GL_DS_SCALE_NV 0x8710 +#define GL_DT_SCALE_NV 0x8711 +#define GL_MAGNITUDE_SCALE_NV 0x8712 +#define GL_VIBRANCE_SCALE_NV 0x8713 +#define GL_HI_BIAS_NV 0x8714 +#define GL_LO_BIAS_NV 0x8715 +#define GL_DS_BIAS_NV 0x8716 +#define GL_DT_BIAS_NV 0x8717 +#define GL_MAGNITUDE_BIAS_NV 0x8718 +#define GL_VIBRANCE_BIAS_NV 0x8719 +#define GL_TEXTURE_BORDER_VALUES_NV 0x871A +#define GL_TEXTURE_HI_SIZE_NV 0x871B +#define GL_TEXTURE_LO_SIZE_NV 0x871C +#define GL_TEXTURE_DS_SIZE_NV 0x871D +#define GL_TEXTURE_DT_SIZE_NV 0x871E +#define GL_TEXTURE_MAG_SIZE_NV 0x871F + +#define GLEW_NV_texture_shader GLEW_GET_VAR(__GLEW_NV_texture_shader) + +#endif /* GL_NV_texture_shader */ + +/* ------------------------- GL_NV_texture_shader2 ------------------------- */ + +#ifndef GL_NV_texture_shader2 +#define GL_NV_texture_shader2 1 + +#define GL_UNSIGNED_INT_S8_S8_8_8_NV 0x86DA +#define GL_UNSIGNED_INT_8_8_S8_S8_REV_NV 0x86DB +#define GL_DSDT_MAG_INTENSITY_NV 0x86DC +#define GL_DOT_PRODUCT_TEXTURE_3D_NV 0x86EF +#define GL_HILO_NV 0x86F4 +#define GL_DSDT_NV 0x86F5 +#define GL_DSDT_MAG_NV 0x86F6 +#define GL_DSDT_MAG_VIB_NV 0x86F7 +#define GL_HILO16_NV 0x86F8 +#define GL_SIGNED_HILO_NV 0x86F9 +#define GL_SIGNED_HILO16_NV 0x86FA +#define GL_SIGNED_RGBA_NV 0x86FB +#define GL_SIGNED_RGBA8_NV 0x86FC +#define GL_SIGNED_RGB_NV 0x86FE +#define GL_SIGNED_RGB8_NV 0x86FF +#define GL_SIGNED_LUMINANCE_NV 0x8701 +#define GL_SIGNED_LUMINANCE8_NV 0x8702 +#define GL_SIGNED_LUMINANCE_ALPHA_NV 0x8703 +#define GL_SIGNED_LUMINANCE8_ALPHA8_NV 0x8704 +#define GL_SIGNED_ALPHA_NV 0x8705 +#define GL_SIGNED_ALPHA8_NV 0x8706 +#define GL_SIGNED_INTENSITY_NV 0x8707 +#define GL_SIGNED_INTENSITY8_NV 0x8708 +#define GL_DSDT8_NV 0x8709 +#define GL_DSDT8_MAG8_NV 0x870A +#define GL_DSDT8_MAG8_INTENSITY8_NV 0x870B +#define GL_SIGNED_RGB_UNSIGNED_ALPHA_NV 0x870C +#define GL_SIGNED_RGB8_UNSIGNED_ALPHA8_NV 0x870D + +#define GLEW_NV_texture_shader2 GLEW_GET_VAR(__GLEW_NV_texture_shader2) + +#endif /* GL_NV_texture_shader2 */ + +/* ------------------------- GL_NV_texture_shader3 ------------------------- */ + +#ifndef GL_NV_texture_shader3 +#define GL_NV_texture_shader3 1 + +#define GL_OFFSET_PROJECTIVE_TEXTURE_2D_NV 0x8850 +#define GL_OFFSET_PROJECTIVE_TEXTURE_2D_SCALE_NV 0x8851 +#define GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_NV 0x8852 +#define GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_SCALE_NV 0x8853 +#define GL_OFFSET_HILO_TEXTURE_2D_NV 0x8854 +#define GL_OFFSET_HILO_TEXTURE_RECTANGLE_NV 0x8855 +#define GL_OFFSET_HILO_PROJECTIVE_TEXTURE_2D_NV 0x8856 +#define GL_OFFSET_HILO_PROJECTIVE_TEXTURE_RECTANGLE_NV 0x8857 +#define GL_DEPENDENT_HILO_TEXTURE_2D_NV 0x8858 +#define GL_DEPENDENT_RGB_TEXTURE_3D_NV 0x8859 +#define GL_DEPENDENT_RGB_TEXTURE_CUBE_MAP_NV 0x885A +#define GL_DOT_PRODUCT_PASS_THROUGH_NV 0x885B +#define GL_DOT_PRODUCT_TEXTURE_1D_NV 0x885C +#define GL_DOT_PRODUCT_AFFINE_DEPTH_REPLACE_NV 0x885D +#define GL_HILO8_NV 0x885E +#define GL_SIGNED_HILO8_NV 0x885F +#define GL_FORCE_BLUE_TO_ONE_NV 0x8860 + +#define GLEW_NV_texture_shader3 GLEW_GET_VAR(__GLEW_NV_texture_shader3) + +#endif /* GL_NV_texture_shader3 */ + +/* ------------------------ GL_NV_transform_feedback ----------------------- */ + +#ifndef GL_NV_transform_feedback +#define GL_NV_transform_feedback 1 + +#define GL_BACK_PRIMARY_COLOR_NV 0x8C77 +#define GL_BACK_SECONDARY_COLOR_NV 0x8C78 +#define GL_TEXTURE_COORD_NV 0x8C79 +#define GL_CLIP_DISTANCE_NV 0x8C7A +#define GL_VERTEX_ID_NV 0x8C7B +#define GL_PRIMITIVE_ID_NV 0x8C7C +#define GL_GENERIC_ATTRIB_NV 0x8C7D +#define GL_TRANSFORM_FEEDBACK_ATTRIBS_NV 0x8C7E +#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE_NV 0x8C7F +#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_NV 0x8C80 +#define GL_ACTIVE_VARYINGS_NV 0x8C81 +#define GL_ACTIVE_VARYING_MAX_LENGTH_NV 0x8C82 +#define GL_TRANSFORM_FEEDBACK_VARYINGS_NV 0x8C83 +#define GL_TRANSFORM_FEEDBACK_BUFFER_START_NV 0x8C84 +#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE_NV 0x8C85 +#define GL_TRANSFORM_FEEDBACK_RECORD_NV 0x8C86 +#define GL_PRIMITIVES_GENERATED_NV 0x8C87 +#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_NV 0x8C88 +#define GL_RASTERIZER_DISCARD_NV 0x8C89 +#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS_NV 0x8C8A +#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_NV 0x8C8B +#define GL_INTERLEAVED_ATTRIBS_NV 0x8C8C +#define GL_SEPARATE_ATTRIBS_NV 0x8C8D +#define GL_TRANSFORM_FEEDBACK_BUFFER_NV 0x8C8E +#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_NV 0x8C8F + +typedef void (GLAPIENTRY * PFNGLACTIVEVARYINGNVPROC) (GLuint program, const GLchar *name); +typedef void (GLAPIENTRY * PFNGLBEGINTRANSFORMFEEDBACKNVPROC) (GLenum primitiveMode); +typedef void (GLAPIENTRY * PFNGLBINDBUFFERBASENVPROC) (GLenum target, GLuint index, GLuint buffer); +typedef void (GLAPIENTRY * PFNGLBINDBUFFEROFFSETNVPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLBINDBUFFERRANGENVPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); +typedef void (GLAPIENTRY * PFNGLENDTRANSFORMFEEDBACKNVPROC) (void); +typedef void (GLAPIENTRY * PFNGLGETACTIVEVARYINGNVPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name); +typedef void (GLAPIENTRY * PFNGLGETTRANSFORMFEEDBACKVARYINGNVPROC) (GLuint program, GLuint index, GLint *location); +typedef GLint (GLAPIENTRY * PFNGLGETVARYINGLOCATIONNVPROC) (GLuint program, const GLchar *name); +typedef void (GLAPIENTRY * PFNGLTRANSFORMFEEDBACKATTRIBSNVPROC) (GLuint count, const GLint *attribs, GLenum bufferMode); +typedef void (GLAPIENTRY * PFNGLTRANSFORMFEEDBACKVARYINGSNVPROC) (GLuint program, GLsizei count, const GLint *locations, GLenum bufferMode); + +#define glActiveVaryingNV GLEW_GET_FUN(__glewActiveVaryingNV) +#define glBeginTransformFeedbackNV GLEW_GET_FUN(__glewBeginTransformFeedbackNV) +#define glBindBufferBaseNV GLEW_GET_FUN(__glewBindBufferBaseNV) +#define glBindBufferOffsetNV GLEW_GET_FUN(__glewBindBufferOffsetNV) +#define glBindBufferRangeNV GLEW_GET_FUN(__glewBindBufferRangeNV) +#define glEndTransformFeedbackNV GLEW_GET_FUN(__glewEndTransformFeedbackNV) +#define glGetActiveVaryingNV GLEW_GET_FUN(__glewGetActiveVaryingNV) +#define glGetTransformFeedbackVaryingNV GLEW_GET_FUN(__glewGetTransformFeedbackVaryingNV) +#define glGetVaryingLocationNV GLEW_GET_FUN(__glewGetVaryingLocationNV) +#define glTransformFeedbackAttribsNV GLEW_GET_FUN(__glewTransformFeedbackAttribsNV) +#define glTransformFeedbackVaryingsNV GLEW_GET_FUN(__glewTransformFeedbackVaryingsNV) + +#define GLEW_NV_transform_feedback GLEW_GET_VAR(__GLEW_NV_transform_feedback) + +#endif /* GL_NV_transform_feedback */ + +/* ----------------------- GL_NV_transform_feedback2 ----------------------- */ + +#ifndef GL_NV_transform_feedback2 +#define GL_NV_transform_feedback2 1 + +#define GL_TRANSFORM_FEEDBACK_NV 0x8E22 +#define GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED_NV 0x8E23 +#define GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE_NV 0x8E24 +#define GL_TRANSFORM_FEEDBACK_BINDING_NV 0x8E25 + +typedef void (GLAPIENTRY * PFNGLBINDTRANSFORMFEEDBACKNVPROC) (GLenum target, GLuint id); +typedef void (GLAPIENTRY * PFNGLDELETETRANSFORMFEEDBACKSNVPROC) (GLsizei n, const GLuint* ids); +typedef void (GLAPIENTRY * PFNGLDRAWTRANSFORMFEEDBACKNVPROC) (GLenum mode, GLuint id); +typedef void (GLAPIENTRY * PFNGLGENTRANSFORMFEEDBACKSNVPROC) (GLsizei n, GLuint* ids); +typedef GLboolean (GLAPIENTRY * PFNGLISTRANSFORMFEEDBACKNVPROC) (GLuint id); +typedef void (GLAPIENTRY * PFNGLPAUSETRANSFORMFEEDBACKNVPROC) (void); +typedef void (GLAPIENTRY * PFNGLRESUMETRANSFORMFEEDBACKNVPROC) (void); + +#define glBindTransformFeedbackNV GLEW_GET_FUN(__glewBindTransformFeedbackNV) +#define glDeleteTransformFeedbacksNV GLEW_GET_FUN(__glewDeleteTransformFeedbacksNV) +#define glDrawTransformFeedbackNV GLEW_GET_FUN(__glewDrawTransformFeedbackNV) +#define glGenTransformFeedbacksNV GLEW_GET_FUN(__glewGenTransformFeedbacksNV) +#define glIsTransformFeedbackNV GLEW_GET_FUN(__glewIsTransformFeedbackNV) +#define glPauseTransformFeedbackNV GLEW_GET_FUN(__glewPauseTransformFeedbackNV) +#define glResumeTransformFeedbackNV GLEW_GET_FUN(__glewResumeTransformFeedbackNV) + +#define GLEW_NV_transform_feedback2 GLEW_GET_VAR(__GLEW_NV_transform_feedback2) + +#endif /* GL_NV_transform_feedback2 */ + +/* -------------------------- GL_NV_vdpau_interop -------------------------- */ + +#ifndef GL_NV_vdpau_interop +#define GL_NV_vdpau_interop 1 + +#define GL_SURFACE_STATE_NV 0x86EB +#define GL_SURFACE_REGISTERED_NV 0x86FD +#define GL_SURFACE_MAPPED_NV 0x8700 +#define GL_WRITE_DISCARD_NV 0x88BE + +typedef GLintptr GLvdpauSurfaceNV; + +typedef void (GLAPIENTRY * PFNGLVDPAUFININVPROC) (void); +typedef void (GLAPIENTRY * PFNGLVDPAUGETSURFACEIVNVPROC) (GLvdpauSurfaceNV surface, GLenum pname, GLsizei bufSize, GLsizei* length, GLint *values); +typedef void (GLAPIENTRY * PFNGLVDPAUINITNVPROC) (const void* vdpDevice, const GLvoid*getProcAddress); +typedef void (GLAPIENTRY * PFNGLVDPAUISSURFACENVPROC) (GLvdpauSurfaceNV surface); +typedef void (GLAPIENTRY * PFNGLVDPAUMAPSURFACESNVPROC) (GLsizei numSurfaces, const GLvdpauSurfaceNV* surfaces); +typedef GLvdpauSurfaceNV (GLAPIENTRY * PFNGLVDPAUREGISTEROUTPUTSURFACENVPROC) (const void* vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames); +typedef GLvdpauSurfaceNV (GLAPIENTRY * PFNGLVDPAUREGISTERVIDEOSURFACENVPROC) (const void* vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames); +typedef void (GLAPIENTRY * PFNGLVDPAUSURFACEACCESSNVPROC) (GLvdpauSurfaceNV surface, GLenum access); +typedef void (GLAPIENTRY * PFNGLVDPAUUNMAPSURFACESNVPROC) (GLsizei numSurface, const GLvdpauSurfaceNV* surfaces); +typedef void (GLAPIENTRY * PFNGLVDPAUUNREGISTERSURFACENVPROC) (GLvdpauSurfaceNV surface); + +#define glVDPAUFiniNV GLEW_GET_FUN(__glewVDPAUFiniNV) +#define glVDPAUGetSurfaceivNV GLEW_GET_FUN(__glewVDPAUGetSurfaceivNV) +#define glVDPAUInitNV GLEW_GET_FUN(__glewVDPAUInitNV) +#define glVDPAUIsSurfaceNV GLEW_GET_FUN(__glewVDPAUIsSurfaceNV) +#define glVDPAUMapSurfacesNV GLEW_GET_FUN(__glewVDPAUMapSurfacesNV) +#define glVDPAURegisterOutputSurfaceNV GLEW_GET_FUN(__glewVDPAURegisterOutputSurfaceNV) +#define glVDPAURegisterVideoSurfaceNV GLEW_GET_FUN(__glewVDPAURegisterVideoSurfaceNV) +#define glVDPAUSurfaceAccessNV GLEW_GET_FUN(__glewVDPAUSurfaceAccessNV) +#define glVDPAUUnmapSurfacesNV GLEW_GET_FUN(__glewVDPAUUnmapSurfacesNV) +#define glVDPAUUnregisterSurfaceNV GLEW_GET_FUN(__glewVDPAUUnregisterSurfaceNV) + +#define GLEW_NV_vdpau_interop GLEW_GET_VAR(__GLEW_NV_vdpau_interop) + +#endif /* GL_NV_vdpau_interop */ + +/* ------------------------ GL_NV_vertex_array_range ----------------------- */ + +#ifndef GL_NV_vertex_array_range +#define GL_NV_vertex_array_range 1 + +#define GL_VERTEX_ARRAY_RANGE_NV 0x851D +#define GL_VERTEX_ARRAY_RANGE_LENGTH_NV 0x851E +#define GL_VERTEX_ARRAY_RANGE_VALID_NV 0x851F +#define GL_MAX_VERTEX_ARRAY_RANGE_ELEMENT_NV 0x8520 +#define GL_VERTEX_ARRAY_RANGE_POINTER_NV 0x8521 + +typedef void (GLAPIENTRY * PFNGLFLUSHVERTEXARRAYRANGENVPROC) (void); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYRANGENVPROC) (GLsizei length, GLvoid *pointer); + +#define glFlushVertexArrayRangeNV GLEW_GET_FUN(__glewFlushVertexArrayRangeNV) +#define glVertexArrayRangeNV GLEW_GET_FUN(__glewVertexArrayRangeNV) + +#define GLEW_NV_vertex_array_range GLEW_GET_VAR(__GLEW_NV_vertex_array_range) + +#endif /* GL_NV_vertex_array_range */ + +/* ----------------------- GL_NV_vertex_array_range2 ----------------------- */ + +#ifndef GL_NV_vertex_array_range2 +#define GL_NV_vertex_array_range2 1 + +#define GL_VERTEX_ARRAY_RANGE_WITHOUT_FLUSH_NV 0x8533 + +#define GLEW_NV_vertex_array_range2 GLEW_GET_VAR(__GLEW_NV_vertex_array_range2) + +#endif /* GL_NV_vertex_array_range2 */ + +/* ------------------- GL_NV_vertex_attrib_integer_64bit ------------------- */ + +#ifndef GL_NV_vertex_attrib_integer_64bit +#define GL_NV_vertex_attrib_integer_64bit 1 + +#define GL_INT64_NV 0x140E +#define GL_UNSIGNED_INT64_NV 0x140F + +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBLI64VNVPROC) (GLuint index, GLenum pname, GLint64EXT* params); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBLUI64VNVPROC) (GLuint index, GLenum pname, GLuint64EXT* params); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1I64NVPROC) (GLuint index, GLint64EXT x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1I64VNVPROC) (GLuint index, const GLint64EXT* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1UI64NVPROC) (GLuint index, GLuint64EXT x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1UI64VNVPROC) (GLuint index, const GLuint64EXT* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL2I64NVPROC) (GLuint index, GLint64EXT x, GLint64EXT y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL2I64VNVPROC) (GLuint index, const GLint64EXT* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL2UI64NVPROC) (GLuint index, GLuint64EXT x, GLuint64EXT y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL2UI64VNVPROC) (GLuint index, const GLuint64EXT* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL3I64NVPROC) (GLuint index, GLint64EXT x, GLint64EXT y, GLint64EXT z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL3I64VNVPROC) (GLuint index, const GLint64EXT* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL3UI64NVPROC) (GLuint index, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL3UI64VNVPROC) (GLuint index, const GLuint64EXT* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL4I64NVPROC) (GLuint index, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL4I64VNVPROC) (GLuint index, const GLint64EXT* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL4UI64NVPROC) (GLuint index, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL4UI64VNVPROC) (GLuint index, const GLuint64EXT* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBLFORMATNVPROC) (GLuint index, GLint size, GLenum type, GLsizei stride); + +#define glGetVertexAttribLi64vNV GLEW_GET_FUN(__glewGetVertexAttribLi64vNV) +#define glGetVertexAttribLui64vNV GLEW_GET_FUN(__glewGetVertexAttribLui64vNV) +#define glVertexAttribL1i64NV GLEW_GET_FUN(__glewVertexAttribL1i64NV) +#define glVertexAttribL1i64vNV GLEW_GET_FUN(__glewVertexAttribL1i64vNV) +#define glVertexAttribL1ui64NV GLEW_GET_FUN(__glewVertexAttribL1ui64NV) +#define glVertexAttribL1ui64vNV GLEW_GET_FUN(__glewVertexAttribL1ui64vNV) +#define glVertexAttribL2i64NV GLEW_GET_FUN(__glewVertexAttribL2i64NV) +#define glVertexAttribL2i64vNV GLEW_GET_FUN(__glewVertexAttribL2i64vNV) +#define glVertexAttribL2ui64NV GLEW_GET_FUN(__glewVertexAttribL2ui64NV) +#define glVertexAttribL2ui64vNV GLEW_GET_FUN(__glewVertexAttribL2ui64vNV) +#define glVertexAttribL3i64NV GLEW_GET_FUN(__glewVertexAttribL3i64NV) +#define glVertexAttribL3i64vNV GLEW_GET_FUN(__glewVertexAttribL3i64vNV) +#define glVertexAttribL3ui64NV GLEW_GET_FUN(__glewVertexAttribL3ui64NV) +#define glVertexAttribL3ui64vNV GLEW_GET_FUN(__glewVertexAttribL3ui64vNV) +#define glVertexAttribL4i64NV GLEW_GET_FUN(__glewVertexAttribL4i64NV) +#define glVertexAttribL4i64vNV GLEW_GET_FUN(__glewVertexAttribL4i64vNV) +#define glVertexAttribL4ui64NV GLEW_GET_FUN(__glewVertexAttribL4ui64NV) +#define glVertexAttribL4ui64vNV GLEW_GET_FUN(__glewVertexAttribL4ui64vNV) +#define glVertexAttribLFormatNV GLEW_GET_FUN(__glewVertexAttribLFormatNV) + +#define GLEW_NV_vertex_attrib_integer_64bit GLEW_GET_VAR(__GLEW_NV_vertex_attrib_integer_64bit) + +#endif /* GL_NV_vertex_attrib_integer_64bit */ + +/* ------------------- GL_NV_vertex_buffer_unified_memory ------------------ */ + +#ifndef GL_NV_vertex_buffer_unified_memory +#define GL_NV_vertex_buffer_unified_memory 1 + +#define GL_VERTEX_ATTRIB_ARRAY_UNIFIED_NV 0x8F1E +#define GL_ELEMENT_ARRAY_UNIFIED_NV 0x8F1F +#define GL_VERTEX_ATTRIB_ARRAY_ADDRESS_NV 0x8F20 +#define GL_VERTEX_ARRAY_ADDRESS_NV 0x8F21 +#define GL_NORMAL_ARRAY_ADDRESS_NV 0x8F22 +#define GL_COLOR_ARRAY_ADDRESS_NV 0x8F23 +#define GL_INDEX_ARRAY_ADDRESS_NV 0x8F24 +#define GL_TEXTURE_COORD_ARRAY_ADDRESS_NV 0x8F25 +#define GL_EDGE_FLAG_ARRAY_ADDRESS_NV 0x8F26 +#define GL_SECONDARY_COLOR_ARRAY_ADDRESS_NV 0x8F27 +#define GL_FOG_COORD_ARRAY_ADDRESS_NV 0x8F28 +#define GL_ELEMENT_ARRAY_ADDRESS_NV 0x8F29 +#define GL_VERTEX_ATTRIB_ARRAY_LENGTH_NV 0x8F2A +#define GL_VERTEX_ARRAY_LENGTH_NV 0x8F2B +#define GL_NORMAL_ARRAY_LENGTH_NV 0x8F2C +#define GL_COLOR_ARRAY_LENGTH_NV 0x8F2D +#define GL_INDEX_ARRAY_LENGTH_NV 0x8F2E +#define GL_TEXTURE_COORD_ARRAY_LENGTH_NV 0x8F2F +#define GL_EDGE_FLAG_ARRAY_LENGTH_NV 0x8F30 +#define GL_SECONDARY_COLOR_ARRAY_LENGTH_NV 0x8F31 +#define GL_FOG_COORD_ARRAY_LENGTH_NV 0x8F32 +#define GL_ELEMENT_ARRAY_LENGTH_NV 0x8F33 +#define GL_DRAW_INDIRECT_UNIFIED_NV 0x8F40 +#define GL_DRAW_INDIRECT_ADDRESS_NV 0x8F41 +#define GL_DRAW_INDIRECT_LENGTH_NV 0x8F42 + +typedef void (GLAPIENTRY * PFNGLBUFFERADDRESSRANGENVPROC) (GLenum pname, GLuint index, GLuint64EXT address, GLsizeiptr length); +typedef void (GLAPIENTRY * PFNGLCOLORFORMATNVPROC) (GLint size, GLenum type, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLEDGEFLAGFORMATNVPROC) (GLsizei stride); +typedef void (GLAPIENTRY * PFNGLFOGCOORDFORMATNVPROC) (GLenum type, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLGETINTEGERUI64I_VNVPROC) (GLenum value, GLuint index, GLuint64EXT result[]); +typedef void (GLAPIENTRY * PFNGLINDEXFORMATNVPROC) (GLenum type, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLNORMALFORMATNVPROC) (GLenum type, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLORFORMATNVPROC) (GLint size, GLenum type, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLTEXCOORDFORMATNVPROC) (GLint size, GLenum type, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBFORMATNVPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBIFORMATNVPROC) (GLuint index, GLint size, GLenum type, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLVERTEXFORMATNVPROC) (GLint size, GLenum type, GLsizei stride); + +#define glBufferAddressRangeNV GLEW_GET_FUN(__glewBufferAddressRangeNV) +#define glColorFormatNV GLEW_GET_FUN(__glewColorFormatNV) +#define glEdgeFlagFormatNV GLEW_GET_FUN(__glewEdgeFlagFormatNV) +#define glFogCoordFormatNV GLEW_GET_FUN(__glewFogCoordFormatNV) +#define glGetIntegerui64i_vNV GLEW_GET_FUN(__glewGetIntegerui64i_vNV) +#define glIndexFormatNV GLEW_GET_FUN(__glewIndexFormatNV) +#define glNormalFormatNV GLEW_GET_FUN(__glewNormalFormatNV) +#define glSecondaryColorFormatNV GLEW_GET_FUN(__glewSecondaryColorFormatNV) +#define glTexCoordFormatNV GLEW_GET_FUN(__glewTexCoordFormatNV) +#define glVertexAttribFormatNV GLEW_GET_FUN(__glewVertexAttribFormatNV) +#define glVertexAttribIFormatNV GLEW_GET_FUN(__glewVertexAttribIFormatNV) +#define glVertexFormatNV GLEW_GET_FUN(__glewVertexFormatNV) + +#define GLEW_NV_vertex_buffer_unified_memory GLEW_GET_VAR(__GLEW_NV_vertex_buffer_unified_memory) + +#endif /* GL_NV_vertex_buffer_unified_memory */ + +/* -------------------------- GL_NV_vertex_program ------------------------- */ + +#ifndef GL_NV_vertex_program +#define GL_NV_vertex_program 1 + +#define GL_VERTEX_PROGRAM_NV 0x8620 +#define GL_VERTEX_STATE_PROGRAM_NV 0x8621 +#define GL_ATTRIB_ARRAY_SIZE_NV 0x8623 +#define GL_ATTRIB_ARRAY_STRIDE_NV 0x8624 +#define GL_ATTRIB_ARRAY_TYPE_NV 0x8625 +#define GL_CURRENT_ATTRIB_NV 0x8626 +#define GL_PROGRAM_LENGTH_NV 0x8627 +#define GL_PROGRAM_STRING_NV 0x8628 +#define GL_MODELVIEW_PROJECTION_NV 0x8629 +#define GL_IDENTITY_NV 0x862A +#define GL_INVERSE_NV 0x862B +#define GL_TRANSPOSE_NV 0x862C +#define GL_INVERSE_TRANSPOSE_NV 0x862D +#define GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV 0x862E +#define GL_MAX_TRACK_MATRICES_NV 0x862F +#define GL_MATRIX0_NV 0x8630 +#define GL_MATRIX1_NV 0x8631 +#define GL_MATRIX2_NV 0x8632 +#define GL_MATRIX3_NV 0x8633 +#define GL_MATRIX4_NV 0x8634 +#define GL_MATRIX5_NV 0x8635 +#define GL_MATRIX6_NV 0x8636 +#define GL_MATRIX7_NV 0x8637 +#define GL_CURRENT_MATRIX_STACK_DEPTH_NV 0x8640 +#define GL_CURRENT_MATRIX_NV 0x8641 +#define GL_VERTEX_PROGRAM_POINT_SIZE_NV 0x8642 +#define GL_VERTEX_PROGRAM_TWO_SIDE_NV 0x8643 +#define GL_PROGRAM_PARAMETER_NV 0x8644 +#define GL_ATTRIB_ARRAY_POINTER_NV 0x8645 +#define GL_PROGRAM_TARGET_NV 0x8646 +#define GL_PROGRAM_RESIDENT_NV 0x8647 +#define GL_TRACK_MATRIX_NV 0x8648 +#define GL_TRACK_MATRIX_TRANSFORM_NV 0x8649 +#define GL_VERTEX_PROGRAM_BINDING_NV 0x864A +#define GL_PROGRAM_ERROR_POSITION_NV 0x864B +#define GL_VERTEX_ATTRIB_ARRAY0_NV 0x8650 +#define GL_VERTEX_ATTRIB_ARRAY1_NV 0x8651 +#define GL_VERTEX_ATTRIB_ARRAY2_NV 0x8652 +#define GL_VERTEX_ATTRIB_ARRAY3_NV 0x8653 +#define GL_VERTEX_ATTRIB_ARRAY4_NV 0x8654 +#define GL_VERTEX_ATTRIB_ARRAY5_NV 0x8655 +#define GL_VERTEX_ATTRIB_ARRAY6_NV 0x8656 +#define GL_VERTEX_ATTRIB_ARRAY7_NV 0x8657 +#define GL_VERTEX_ATTRIB_ARRAY8_NV 0x8658 +#define GL_VERTEX_ATTRIB_ARRAY9_NV 0x8659 +#define GL_VERTEX_ATTRIB_ARRAY10_NV 0x865A +#define GL_VERTEX_ATTRIB_ARRAY11_NV 0x865B +#define GL_VERTEX_ATTRIB_ARRAY12_NV 0x865C +#define GL_VERTEX_ATTRIB_ARRAY13_NV 0x865D +#define GL_VERTEX_ATTRIB_ARRAY14_NV 0x865E +#define GL_VERTEX_ATTRIB_ARRAY15_NV 0x865F +#define GL_MAP1_VERTEX_ATTRIB0_4_NV 0x8660 +#define GL_MAP1_VERTEX_ATTRIB1_4_NV 0x8661 +#define GL_MAP1_VERTEX_ATTRIB2_4_NV 0x8662 +#define GL_MAP1_VERTEX_ATTRIB3_4_NV 0x8663 +#define GL_MAP1_VERTEX_ATTRIB4_4_NV 0x8664 +#define GL_MAP1_VERTEX_ATTRIB5_4_NV 0x8665 +#define GL_MAP1_VERTEX_ATTRIB6_4_NV 0x8666 +#define GL_MAP1_VERTEX_ATTRIB7_4_NV 0x8667 +#define GL_MAP1_VERTEX_ATTRIB8_4_NV 0x8668 +#define GL_MAP1_VERTEX_ATTRIB9_4_NV 0x8669 +#define GL_MAP1_VERTEX_ATTRIB10_4_NV 0x866A +#define GL_MAP1_VERTEX_ATTRIB11_4_NV 0x866B +#define GL_MAP1_VERTEX_ATTRIB12_4_NV 0x866C +#define GL_MAP1_VERTEX_ATTRIB13_4_NV 0x866D +#define GL_MAP1_VERTEX_ATTRIB14_4_NV 0x866E +#define GL_MAP1_VERTEX_ATTRIB15_4_NV 0x866F +#define GL_MAP2_VERTEX_ATTRIB0_4_NV 0x8670 +#define GL_MAP2_VERTEX_ATTRIB1_4_NV 0x8671 +#define GL_MAP2_VERTEX_ATTRIB2_4_NV 0x8672 +#define GL_MAP2_VERTEX_ATTRIB3_4_NV 0x8673 +#define GL_MAP2_VERTEX_ATTRIB4_4_NV 0x8674 +#define GL_MAP2_VERTEX_ATTRIB5_4_NV 0x8675 +#define GL_MAP2_VERTEX_ATTRIB6_4_NV 0x8676 +#define GL_MAP2_VERTEX_ATTRIB7_4_NV 0x8677 +#define GL_MAP2_VERTEX_ATTRIB8_4_NV 0x8678 +#define GL_MAP2_VERTEX_ATTRIB9_4_NV 0x8679 +#define GL_MAP2_VERTEX_ATTRIB10_4_NV 0x867A +#define GL_MAP2_VERTEX_ATTRIB11_4_NV 0x867B +#define GL_MAP2_VERTEX_ATTRIB12_4_NV 0x867C +#define GL_MAP2_VERTEX_ATTRIB13_4_NV 0x867D +#define GL_MAP2_VERTEX_ATTRIB14_4_NV 0x867E +#define GL_MAP2_VERTEX_ATTRIB15_4_NV 0x867F + +typedef GLboolean (GLAPIENTRY * PFNGLAREPROGRAMSRESIDENTNVPROC) (GLsizei n, const GLuint* ids, GLboolean *residences); +typedef void (GLAPIENTRY * PFNGLBINDPROGRAMNVPROC) (GLenum target, GLuint id); +typedef void (GLAPIENTRY * PFNGLDELETEPROGRAMSNVPROC) (GLsizei n, const GLuint* ids); +typedef void (GLAPIENTRY * PFNGLEXECUTEPROGRAMNVPROC) (GLenum target, GLuint id, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGENPROGRAMSNVPROC) (GLsizei n, GLuint* ids); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMPARAMETERDVNVPROC) (GLenum target, GLuint index, GLenum pname, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMPARAMETERFVNVPROC) (GLenum target, GLuint index, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMSTRINGNVPROC) (GLuint id, GLenum pname, GLubyte* program); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMIVNVPROC) (GLuint id, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETTRACKMATRIXIVNVPROC) (GLenum target, GLuint address, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBPOINTERVNVPROC) (GLuint index, GLenum pname, GLvoid** pointer); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBDVNVPROC) (GLuint index, GLenum pname, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBFVNVPROC) (GLuint index, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBIVNVPROC) (GLuint index, GLenum pname, GLint* params); +typedef GLboolean (GLAPIENTRY * PFNGLISPROGRAMNVPROC) (GLuint id); +typedef void (GLAPIENTRY * PFNGLLOADPROGRAMNVPROC) (GLenum target, GLuint id, GLsizei len, const GLubyte* program); +typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETER4DNVPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETER4DVNVPROC) (GLenum target, GLuint index, const GLdouble* params); +typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETER4FNVPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETER4FVNVPROC) (GLenum target, GLuint index, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETERS4DVNVPROC) (GLenum target, GLuint index, GLsizei num, const GLdouble* params); +typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETERS4FVNVPROC) (GLenum target, GLuint index, GLsizei num, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLREQUESTRESIDENTPROGRAMSNVPROC) (GLsizei n, GLuint* ids); +typedef void (GLAPIENTRY * PFNGLTRACKMATRIXNVPROC) (GLenum target, GLuint address, GLenum matrix, GLenum transform); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1DNVPROC) (GLuint index, GLdouble x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1DVNVPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1FNVPROC) (GLuint index, GLfloat x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1FVNVPROC) (GLuint index, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1SNVPROC) (GLuint index, GLshort x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1SVNVPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2DNVPROC) (GLuint index, GLdouble x, GLdouble y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2DVNVPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2FNVPROC) (GLuint index, GLfloat x, GLfloat y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2FVNVPROC) (GLuint index, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2SNVPROC) (GLuint index, GLshort x, GLshort y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2SVNVPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3DVNVPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3FVNVPROC) (GLuint index, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3SVNVPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4DVNVPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4FVNVPROC) (GLuint index, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4SVNVPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4UBNVPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4UBVNVPROC) (GLuint index, const GLubyte* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBPOINTERNVPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS1DVNVPROC) (GLuint index, GLsizei n, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS1FVNVPROC) (GLuint index, GLsizei n, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS1SVNVPROC) (GLuint index, GLsizei n, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS2DVNVPROC) (GLuint index, GLsizei n, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS2FVNVPROC) (GLuint index, GLsizei n, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS2SVNVPROC) (GLuint index, GLsizei n, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS3DVNVPROC) (GLuint index, GLsizei n, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS3FVNVPROC) (GLuint index, GLsizei n, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS3SVNVPROC) (GLuint index, GLsizei n, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS4DVNVPROC) (GLuint index, GLsizei n, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS4FVNVPROC) (GLuint index, GLsizei n, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS4SVNVPROC) (GLuint index, GLsizei n, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS4UBVNVPROC) (GLuint index, GLsizei n, const GLubyte* v); + +#define glAreProgramsResidentNV GLEW_GET_FUN(__glewAreProgramsResidentNV) +#define glBindProgramNV GLEW_GET_FUN(__glewBindProgramNV) +#define glDeleteProgramsNV GLEW_GET_FUN(__glewDeleteProgramsNV) +#define glExecuteProgramNV GLEW_GET_FUN(__glewExecuteProgramNV) +#define glGenProgramsNV GLEW_GET_FUN(__glewGenProgramsNV) +#define glGetProgramParameterdvNV GLEW_GET_FUN(__glewGetProgramParameterdvNV) +#define glGetProgramParameterfvNV GLEW_GET_FUN(__glewGetProgramParameterfvNV) +#define glGetProgramStringNV GLEW_GET_FUN(__glewGetProgramStringNV) +#define glGetProgramivNV GLEW_GET_FUN(__glewGetProgramivNV) +#define glGetTrackMatrixivNV GLEW_GET_FUN(__glewGetTrackMatrixivNV) +#define glGetVertexAttribPointervNV GLEW_GET_FUN(__glewGetVertexAttribPointervNV) +#define glGetVertexAttribdvNV GLEW_GET_FUN(__glewGetVertexAttribdvNV) +#define glGetVertexAttribfvNV GLEW_GET_FUN(__glewGetVertexAttribfvNV) +#define glGetVertexAttribivNV GLEW_GET_FUN(__glewGetVertexAttribivNV) +#define glIsProgramNV GLEW_GET_FUN(__glewIsProgramNV) +#define glLoadProgramNV GLEW_GET_FUN(__glewLoadProgramNV) +#define glProgramParameter4dNV GLEW_GET_FUN(__glewProgramParameter4dNV) +#define glProgramParameter4dvNV GLEW_GET_FUN(__glewProgramParameter4dvNV) +#define glProgramParameter4fNV GLEW_GET_FUN(__glewProgramParameter4fNV) +#define glProgramParameter4fvNV GLEW_GET_FUN(__glewProgramParameter4fvNV) +#define glProgramParameters4dvNV GLEW_GET_FUN(__glewProgramParameters4dvNV) +#define glProgramParameters4fvNV GLEW_GET_FUN(__glewProgramParameters4fvNV) +#define glRequestResidentProgramsNV GLEW_GET_FUN(__glewRequestResidentProgramsNV) +#define glTrackMatrixNV GLEW_GET_FUN(__glewTrackMatrixNV) +#define glVertexAttrib1dNV GLEW_GET_FUN(__glewVertexAttrib1dNV) +#define glVertexAttrib1dvNV GLEW_GET_FUN(__glewVertexAttrib1dvNV) +#define glVertexAttrib1fNV GLEW_GET_FUN(__glewVertexAttrib1fNV) +#define glVertexAttrib1fvNV GLEW_GET_FUN(__glewVertexAttrib1fvNV) +#define glVertexAttrib1sNV GLEW_GET_FUN(__glewVertexAttrib1sNV) +#define glVertexAttrib1svNV GLEW_GET_FUN(__glewVertexAttrib1svNV) +#define glVertexAttrib2dNV GLEW_GET_FUN(__glewVertexAttrib2dNV) +#define glVertexAttrib2dvNV GLEW_GET_FUN(__glewVertexAttrib2dvNV) +#define glVertexAttrib2fNV GLEW_GET_FUN(__glewVertexAttrib2fNV) +#define glVertexAttrib2fvNV GLEW_GET_FUN(__glewVertexAttrib2fvNV) +#define glVertexAttrib2sNV GLEW_GET_FUN(__glewVertexAttrib2sNV) +#define glVertexAttrib2svNV GLEW_GET_FUN(__glewVertexAttrib2svNV) +#define glVertexAttrib3dNV GLEW_GET_FUN(__glewVertexAttrib3dNV) +#define glVertexAttrib3dvNV GLEW_GET_FUN(__glewVertexAttrib3dvNV) +#define glVertexAttrib3fNV GLEW_GET_FUN(__glewVertexAttrib3fNV) +#define glVertexAttrib3fvNV GLEW_GET_FUN(__glewVertexAttrib3fvNV) +#define glVertexAttrib3sNV GLEW_GET_FUN(__glewVertexAttrib3sNV) +#define glVertexAttrib3svNV GLEW_GET_FUN(__glewVertexAttrib3svNV) +#define glVertexAttrib4dNV GLEW_GET_FUN(__glewVertexAttrib4dNV) +#define glVertexAttrib4dvNV GLEW_GET_FUN(__glewVertexAttrib4dvNV) +#define glVertexAttrib4fNV GLEW_GET_FUN(__glewVertexAttrib4fNV) +#define glVertexAttrib4fvNV GLEW_GET_FUN(__glewVertexAttrib4fvNV) +#define glVertexAttrib4sNV GLEW_GET_FUN(__glewVertexAttrib4sNV) +#define glVertexAttrib4svNV GLEW_GET_FUN(__glewVertexAttrib4svNV) +#define glVertexAttrib4ubNV GLEW_GET_FUN(__glewVertexAttrib4ubNV) +#define glVertexAttrib4ubvNV GLEW_GET_FUN(__glewVertexAttrib4ubvNV) +#define glVertexAttribPointerNV GLEW_GET_FUN(__glewVertexAttribPointerNV) +#define glVertexAttribs1dvNV GLEW_GET_FUN(__glewVertexAttribs1dvNV) +#define glVertexAttribs1fvNV GLEW_GET_FUN(__glewVertexAttribs1fvNV) +#define glVertexAttribs1svNV GLEW_GET_FUN(__glewVertexAttribs1svNV) +#define glVertexAttribs2dvNV GLEW_GET_FUN(__glewVertexAttribs2dvNV) +#define glVertexAttribs2fvNV GLEW_GET_FUN(__glewVertexAttribs2fvNV) +#define glVertexAttribs2svNV GLEW_GET_FUN(__glewVertexAttribs2svNV) +#define glVertexAttribs3dvNV GLEW_GET_FUN(__glewVertexAttribs3dvNV) +#define glVertexAttribs3fvNV GLEW_GET_FUN(__glewVertexAttribs3fvNV) +#define glVertexAttribs3svNV GLEW_GET_FUN(__glewVertexAttribs3svNV) +#define glVertexAttribs4dvNV GLEW_GET_FUN(__glewVertexAttribs4dvNV) +#define glVertexAttribs4fvNV GLEW_GET_FUN(__glewVertexAttribs4fvNV) +#define glVertexAttribs4svNV GLEW_GET_FUN(__glewVertexAttribs4svNV) +#define glVertexAttribs4ubvNV GLEW_GET_FUN(__glewVertexAttribs4ubvNV) + +#define GLEW_NV_vertex_program GLEW_GET_VAR(__GLEW_NV_vertex_program) + +#endif /* GL_NV_vertex_program */ + +/* ------------------------ GL_NV_vertex_program1_1 ------------------------ */ + +#ifndef GL_NV_vertex_program1_1 +#define GL_NV_vertex_program1_1 1 + +#define GLEW_NV_vertex_program1_1 GLEW_GET_VAR(__GLEW_NV_vertex_program1_1) + +#endif /* GL_NV_vertex_program1_1 */ + +/* ------------------------- GL_NV_vertex_program2 ------------------------- */ + +#ifndef GL_NV_vertex_program2 +#define GL_NV_vertex_program2 1 + +#define GLEW_NV_vertex_program2 GLEW_GET_VAR(__GLEW_NV_vertex_program2) + +#endif /* GL_NV_vertex_program2 */ + +/* ---------------------- GL_NV_vertex_program2_option --------------------- */ + +#ifndef GL_NV_vertex_program2_option +#define GL_NV_vertex_program2_option 1 + +#define GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV 0x88F4 +#define GL_MAX_PROGRAM_CALL_DEPTH_NV 0x88F5 + +#define GLEW_NV_vertex_program2_option GLEW_GET_VAR(__GLEW_NV_vertex_program2_option) + +#endif /* GL_NV_vertex_program2_option */ + +/* ------------------------- GL_NV_vertex_program3 ------------------------- */ + +#ifndef GL_NV_vertex_program3 +#define GL_NV_vertex_program3 1 + +#define MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB 0x8B4C + +#define GLEW_NV_vertex_program3 GLEW_GET_VAR(__GLEW_NV_vertex_program3) + +#endif /* GL_NV_vertex_program3 */ + +/* ------------------------- GL_NV_vertex_program4 ------------------------- */ + +#ifndef GL_NV_vertex_program4 +#define GL_NV_vertex_program4 1 + +#define GL_VERTEX_ATTRIB_ARRAY_INTEGER_NV 0x88FD + +#define GLEW_NV_vertex_program4 GLEW_GET_VAR(__GLEW_NV_vertex_program4) + +#endif /* GL_NV_vertex_program4 */ + +/* -------------------------- GL_NV_video_capture -------------------------- */ + +#ifndef GL_NV_video_capture +#define GL_NV_video_capture 1 + +#define GL_VIDEO_BUFFER_NV 0x9020 +#define GL_VIDEO_BUFFER_BINDING_NV 0x9021 +#define GL_FIELD_UPPER_NV 0x9022 +#define GL_FIELD_LOWER_NV 0x9023 +#define GL_NUM_VIDEO_CAPTURE_STREAMS_NV 0x9024 +#define GL_NEXT_VIDEO_CAPTURE_BUFFER_STATUS_NV 0x9025 +#define GL_VIDEO_CAPTURE_TO_422_SUPPORTED_NV 0x9026 +#define GL_LAST_VIDEO_CAPTURE_STATUS_NV 0x9027 +#define GL_VIDEO_BUFFER_PITCH_NV 0x9028 +#define GL_VIDEO_COLOR_CONVERSION_MATRIX_NV 0x9029 +#define GL_VIDEO_COLOR_CONVERSION_MAX_NV 0x902A +#define GL_VIDEO_COLOR_CONVERSION_MIN_NV 0x902B +#define GL_VIDEO_COLOR_CONVERSION_OFFSET_NV 0x902C +#define GL_VIDEO_BUFFER_INTERNAL_FORMAT_NV 0x902D +#define GL_PARTIAL_SUCCESS_NV 0x902E +#define GL_SUCCESS_NV 0x902F +#define GL_FAILURE_NV 0x9030 +#define GL_YCBYCR8_422_NV 0x9031 +#define GL_YCBAYCR8A_4224_NV 0x9032 +#define GL_Z6Y10Z6CB10Z6Y10Z6CR10_422_NV 0x9033 +#define GL_Z6Y10Z6CB10Z6A10Z6Y10Z6CR10Z6A10_4224_NV 0x9034 +#define GL_Z4Y12Z4CB12Z4Y12Z4CR12_422_NV 0x9035 +#define GL_Z4Y12Z4CB12Z4A12Z4Y12Z4CR12Z4A12_4224_NV 0x9036 +#define GL_Z4Y12Z4CB12Z4CR12_444_NV 0x9037 +#define GL_VIDEO_CAPTURE_FRAME_WIDTH_NV 0x9038 +#define GL_VIDEO_CAPTURE_FRAME_HEIGHT_NV 0x9039 +#define GL_VIDEO_CAPTURE_FIELD_UPPER_HEIGHT_NV 0x903A +#define GL_VIDEO_CAPTURE_FIELD_LOWER_HEIGHT_NV 0x903B +#define GL_VIDEO_CAPTURE_SURFACE_ORIGIN_NV 0x903C + +typedef void (GLAPIENTRY * PFNGLBEGINVIDEOCAPTURENVPROC) (GLuint video_capture_slot); +typedef void (GLAPIENTRY * PFNGLBINDVIDEOCAPTURESTREAMBUFFERNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLintptrARB offset); +typedef void (GLAPIENTRY * PFNGLBINDVIDEOCAPTURESTREAMTEXTURENVPROC) (GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLenum target, GLuint texture); +typedef void (GLAPIENTRY * PFNGLENDVIDEOCAPTURENVPROC) (GLuint video_capture_slot); +typedef void (GLAPIENTRY * PFNGLGETVIDEOCAPTURESTREAMDVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLGETVIDEOCAPTURESTREAMFVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETVIDEOCAPTURESTREAMIVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETVIDEOCAPTUREIVNVPROC) (GLuint video_capture_slot, GLenum pname, GLint* params); +typedef GLenum (GLAPIENTRY * PFNGLVIDEOCAPTURENVPROC) (GLuint video_capture_slot, GLuint* sequence_num, GLuint64EXT *capture_time); +typedef void (GLAPIENTRY * PFNGLVIDEOCAPTURESTREAMPARAMETERDVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLdouble* params); +typedef void (GLAPIENTRY * PFNGLVIDEOCAPTURESTREAMPARAMETERFVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLVIDEOCAPTURESTREAMPARAMETERIVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLint* params); + +#define glBeginVideoCaptureNV GLEW_GET_FUN(__glewBeginVideoCaptureNV) +#define glBindVideoCaptureStreamBufferNV GLEW_GET_FUN(__glewBindVideoCaptureStreamBufferNV) +#define glBindVideoCaptureStreamTextureNV GLEW_GET_FUN(__glewBindVideoCaptureStreamTextureNV) +#define glEndVideoCaptureNV GLEW_GET_FUN(__glewEndVideoCaptureNV) +#define glGetVideoCaptureStreamdvNV GLEW_GET_FUN(__glewGetVideoCaptureStreamdvNV) +#define glGetVideoCaptureStreamfvNV GLEW_GET_FUN(__glewGetVideoCaptureStreamfvNV) +#define glGetVideoCaptureStreamivNV GLEW_GET_FUN(__glewGetVideoCaptureStreamivNV) +#define glGetVideoCaptureivNV GLEW_GET_FUN(__glewGetVideoCaptureivNV) +#define glVideoCaptureNV GLEW_GET_FUN(__glewVideoCaptureNV) +#define glVideoCaptureStreamParameterdvNV GLEW_GET_FUN(__glewVideoCaptureStreamParameterdvNV) +#define glVideoCaptureStreamParameterfvNV GLEW_GET_FUN(__glewVideoCaptureStreamParameterfvNV) +#define glVideoCaptureStreamParameterivNV GLEW_GET_FUN(__glewVideoCaptureStreamParameterivNV) + +#define GLEW_NV_video_capture GLEW_GET_VAR(__GLEW_NV_video_capture) + +#endif /* GL_NV_video_capture */ + +/* ------------------------ GL_OES_byte_coordinates ------------------------ */ + +#ifndef GL_OES_byte_coordinates +#define GL_OES_byte_coordinates 1 + +#define GLEW_OES_byte_coordinates GLEW_GET_VAR(__GLEW_OES_byte_coordinates) + +#endif /* GL_OES_byte_coordinates */ + +/* ------------------- GL_OES_compressed_paletted_texture ------------------ */ + +#ifndef GL_OES_compressed_paletted_texture +#define GL_OES_compressed_paletted_texture 1 + +#define GL_PALETTE4_RGB8_OES 0x8B90 +#define GL_PALETTE4_RGBA8_OES 0x8B91 +#define GL_PALETTE4_R5_G6_B5_OES 0x8B92 +#define GL_PALETTE4_RGBA4_OES 0x8B93 +#define GL_PALETTE4_RGB5_A1_OES 0x8B94 +#define GL_PALETTE8_RGB8_OES 0x8B95 +#define GL_PALETTE8_RGBA8_OES 0x8B96 +#define GL_PALETTE8_R5_G6_B5_OES 0x8B97 +#define GL_PALETTE8_RGBA4_OES 0x8B98 +#define GL_PALETTE8_RGB5_A1_OES 0x8B99 + +#define GLEW_OES_compressed_paletted_texture GLEW_GET_VAR(__GLEW_OES_compressed_paletted_texture) + +#endif /* GL_OES_compressed_paletted_texture */ + +/* --------------------------- GL_OES_read_format -------------------------- */ + +#ifndef GL_OES_read_format +#define GL_OES_read_format 1 + +#define GL_IMPLEMENTATION_COLOR_READ_TYPE_OES 0x8B9A +#define GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES 0x8B9B + +#define GLEW_OES_read_format GLEW_GET_VAR(__GLEW_OES_read_format) + +#endif /* GL_OES_read_format */ + +/* ------------------------ GL_OES_single_precision ------------------------ */ + +#ifndef GL_OES_single_precision +#define GL_OES_single_precision 1 + +typedef void (GLAPIENTRY * PFNGLCLEARDEPTHFOESPROC) (GLclampd depth); +typedef void (GLAPIENTRY * PFNGLCLIPPLANEFOESPROC) (GLenum plane, const GLfloat* equation); +typedef void (GLAPIENTRY * PFNGLDEPTHRANGEFOESPROC) (GLclampf n, GLclampf f); +typedef void (GLAPIENTRY * PFNGLFRUSTUMFOESPROC) (GLfloat l, GLfloat r, GLfloat b, GLfloat t, GLfloat n, GLfloat f); +typedef void (GLAPIENTRY * PFNGLGETCLIPPLANEFOESPROC) (GLenum plane, GLfloat* equation); +typedef void (GLAPIENTRY * PFNGLORTHOFOESPROC) (GLfloat l, GLfloat r, GLfloat b, GLfloat t, GLfloat n, GLfloat f); + +#define glClearDepthfOES GLEW_GET_FUN(__glewClearDepthfOES) +#define glClipPlanefOES GLEW_GET_FUN(__glewClipPlanefOES) +#define glDepthRangefOES GLEW_GET_FUN(__glewDepthRangefOES) +#define glFrustumfOES GLEW_GET_FUN(__glewFrustumfOES) +#define glGetClipPlanefOES GLEW_GET_FUN(__glewGetClipPlanefOES) +#define glOrthofOES GLEW_GET_FUN(__glewOrthofOES) + +#define GLEW_OES_single_precision GLEW_GET_VAR(__GLEW_OES_single_precision) + +#endif /* GL_OES_single_precision */ + +/* ---------------------------- GL_OML_interlace --------------------------- */ + +#ifndef GL_OML_interlace +#define GL_OML_interlace 1 + +#define GL_INTERLACE_OML 0x8980 +#define GL_INTERLACE_READ_OML 0x8981 + +#define GLEW_OML_interlace GLEW_GET_VAR(__GLEW_OML_interlace) + +#endif /* GL_OML_interlace */ + +/* ---------------------------- GL_OML_resample ---------------------------- */ + +#ifndef GL_OML_resample +#define GL_OML_resample 1 + +#define GL_PACK_RESAMPLE_OML 0x8984 +#define GL_UNPACK_RESAMPLE_OML 0x8985 +#define GL_RESAMPLE_REPLICATE_OML 0x8986 +#define GL_RESAMPLE_ZERO_FILL_OML 0x8987 +#define GL_RESAMPLE_AVERAGE_OML 0x8988 +#define GL_RESAMPLE_DECIMATE_OML 0x8989 + +#define GLEW_OML_resample GLEW_GET_VAR(__GLEW_OML_resample) + +#endif /* GL_OML_resample */ + +/* ---------------------------- GL_OML_subsample --------------------------- */ + +#ifndef GL_OML_subsample +#define GL_OML_subsample 1 + +#define GL_FORMAT_SUBSAMPLE_24_24_OML 0x8982 +#define GL_FORMAT_SUBSAMPLE_244_244_OML 0x8983 + +#define GLEW_OML_subsample GLEW_GET_VAR(__GLEW_OML_subsample) + +#endif /* GL_OML_subsample */ + +/* --------------------------- GL_PGI_misc_hints --------------------------- */ + +#ifndef GL_PGI_misc_hints +#define GL_PGI_misc_hints 1 + +#define GL_PREFER_DOUBLEBUFFER_HINT_PGI 107000 +#define GL_CONSERVE_MEMORY_HINT_PGI 107005 +#define GL_RECLAIM_MEMORY_HINT_PGI 107006 +#define GL_NATIVE_GRAPHICS_HANDLE_PGI 107010 +#define GL_NATIVE_GRAPHICS_BEGIN_HINT_PGI 107011 +#define GL_NATIVE_GRAPHICS_END_HINT_PGI 107012 +#define GL_ALWAYS_FAST_HINT_PGI 107020 +#define GL_ALWAYS_SOFT_HINT_PGI 107021 +#define GL_ALLOW_DRAW_OBJ_HINT_PGI 107022 +#define GL_ALLOW_DRAW_WIN_HINT_PGI 107023 +#define GL_ALLOW_DRAW_FRG_HINT_PGI 107024 +#define GL_ALLOW_DRAW_MEM_HINT_PGI 107025 +#define GL_STRICT_DEPTHFUNC_HINT_PGI 107030 +#define GL_STRICT_LIGHTING_HINT_PGI 107031 +#define GL_STRICT_SCISSOR_HINT_PGI 107032 +#define GL_FULL_STIPPLE_HINT_PGI 107033 +#define GL_CLIP_NEAR_HINT_PGI 107040 +#define GL_CLIP_FAR_HINT_PGI 107041 +#define GL_WIDE_LINE_HINT_PGI 107042 +#define GL_BACK_NORMALS_HINT_PGI 107043 + +#define GLEW_PGI_misc_hints GLEW_GET_VAR(__GLEW_PGI_misc_hints) + +#endif /* GL_PGI_misc_hints */ + +/* -------------------------- GL_PGI_vertex_hints -------------------------- */ + +#ifndef GL_PGI_vertex_hints +#define GL_PGI_vertex_hints 1 + +#define GL_VERTEX23_BIT_PGI 0x00000004 +#define GL_VERTEX4_BIT_PGI 0x00000008 +#define GL_COLOR3_BIT_PGI 0x00010000 +#define GL_COLOR4_BIT_PGI 0x00020000 +#define GL_EDGEFLAG_BIT_PGI 0x00040000 +#define GL_INDEX_BIT_PGI 0x00080000 +#define GL_MAT_AMBIENT_BIT_PGI 0x00100000 +#define GL_VERTEX_DATA_HINT_PGI 107050 +#define GL_VERTEX_CONSISTENT_HINT_PGI 107051 +#define GL_MATERIAL_SIDE_HINT_PGI 107052 +#define GL_MAX_VERTEX_HINT_PGI 107053 +#define GL_MAT_AMBIENT_AND_DIFFUSE_BIT_PGI 0x00200000 +#define GL_MAT_DIFFUSE_BIT_PGI 0x00400000 +#define GL_MAT_EMISSION_BIT_PGI 0x00800000 +#define GL_MAT_COLOR_INDEXES_BIT_PGI 0x01000000 +#define GL_MAT_SHININESS_BIT_PGI 0x02000000 +#define GL_MAT_SPECULAR_BIT_PGI 0x04000000 +#define GL_NORMAL_BIT_PGI 0x08000000 +#define GL_TEXCOORD1_BIT_PGI 0x10000000 +#define GL_TEXCOORD2_BIT_PGI 0x20000000 +#define GL_TEXCOORD3_BIT_PGI 0x40000000 +#define GL_TEXCOORD4_BIT_PGI 0x80000000 + +#define GLEW_PGI_vertex_hints GLEW_GET_VAR(__GLEW_PGI_vertex_hints) + +#endif /* GL_PGI_vertex_hints */ + +/* ---------------------- GL_REGAL_ES1_0_compatibility --------------------- */ + +#ifndef GL_REGAL_ES1_0_compatibility +#define GL_REGAL_ES1_0_compatibility 1 + +typedef int GLclampx; + +typedef void (GLAPIENTRY * PFNGLALPHAFUNCXPROC) (GLenum func, GLclampx ref); +typedef void (GLAPIENTRY * PFNGLCLEARCOLORXPROC) (GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha); +typedef void (GLAPIENTRY * PFNGLCLEARDEPTHXPROC) (GLclampx depth); +typedef void (GLAPIENTRY * PFNGLCOLOR4XPROC) (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha); +typedef void (GLAPIENTRY * PFNGLDEPTHRANGEXPROC) (GLclampx zNear, GLclampx zFar); +typedef void (GLAPIENTRY * PFNGLFOGXPROC) (GLenum pname, GLfixed param); +typedef void (GLAPIENTRY * PFNGLFOGXVPROC) (GLenum pname, const GLfixed* params); +typedef void (GLAPIENTRY * PFNGLFRUSTUMFPROC) (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar); +typedef void (GLAPIENTRY * PFNGLFRUSTUMXPROC) (GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar); +typedef void (GLAPIENTRY * PFNGLLIGHTMODELXPROC) (GLenum pname, GLfixed param); +typedef void (GLAPIENTRY * PFNGLLIGHTMODELXVPROC) (GLenum pname, const GLfixed* params); +typedef void (GLAPIENTRY * PFNGLLIGHTXPROC) (GLenum light, GLenum pname, GLfixed param); +typedef void (GLAPIENTRY * PFNGLLIGHTXVPROC) (GLenum light, GLenum pname, const GLfixed* params); +typedef void (GLAPIENTRY * PFNGLLINEWIDTHXPROC) (GLfixed width); +typedef void (GLAPIENTRY * PFNGLLOADMATRIXXPROC) (const GLfixed* m); +typedef void (GLAPIENTRY * PFNGLMATERIALXPROC) (GLenum face, GLenum pname, GLfixed param); +typedef void (GLAPIENTRY * PFNGLMATERIALXVPROC) (GLenum face, GLenum pname, const GLfixed* params); +typedef void (GLAPIENTRY * PFNGLMULTMATRIXXPROC) (const GLfixed* m); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4XPROC) (GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q); +typedef void (GLAPIENTRY * PFNGLNORMAL3XPROC) (GLfixed nx, GLfixed ny, GLfixed nz); +typedef void (GLAPIENTRY * PFNGLORTHOFPROC) (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar); +typedef void (GLAPIENTRY * PFNGLORTHOXPROC) (GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar); +typedef void (GLAPIENTRY * PFNGLPOINTSIZEXPROC) (GLfixed size); +typedef void (GLAPIENTRY * PFNGLPOLYGONOFFSETXPROC) (GLfixed factor, GLfixed units); +typedef void (GLAPIENTRY * PFNGLROTATEXPROC) (GLfixed angle, GLfixed x, GLfixed y, GLfixed z); +typedef void (GLAPIENTRY * PFNGLSAMPLECOVERAGEXPROC) (GLclampx value, GLboolean invert); +typedef void (GLAPIENTRY * PFNGLSCALEXPROC) (GLfixed x, GLfixed y, GLfixed z); +typedef void (GLAPIENTRY * PFNGLTEXENVXPROC) (GLenum target, GLenum pname, GLfixed param); +typedef void (GLAPIENTRY * PFNGLTEXENVXVPROC) (GLenum target, GLenum pname, const GLfixed* params); +typedef void (GLAPIENTRY * PFNGLTEXPARAMETERXPROC) (GLenum target, GLenum pname, GLfixed param); +typedef void (GLAPIENTRY * PFNGLTRANSLATEXPROC) (GLfixed x, GLfixed y, GLfixed z); + +#define glAlphaFuncx GLEW_GET_FUN(__glewAlphaFuncx) +#define glClearColorx GLEW_GET_FUN(__glewClearColorx) +#define glClearDepthx GLEW_GET_FUN(__glewClearDepthx) +#define glColor4x GLEW_GET_FUN(__glewColor4x) +#define glDepthRangex GLEW_GET_FUN(__glewDepthRangex) +#define glFogx GLEW_GET_FUN(__glewFogx) +#define glFogxv GLEW_GET_FUN(__glewFogxv) +#define glFrustumf GLEW_GET_FUN(__glewFrustumf) +#define glFrustumx GLEW_GET_FUN(__glewFrustumx) +#define glLightModelx GLEW_GET_FUN(__glewLightModelx) +#define glLightModelxv GLEW_GET_FUN(__glewLightModelxv) +#define glLightx GLEW_GET_FUN(__glewLightx) +#define glLightxv GLEW_GET_FUN(__glewLightxv) +#define glLineWidthx GLEW_GET_FUN(__glewLineWidthx) +#define glLoadMatrixx GLEW_GET_FUN(__glewLoadMatrixx) +#define glMaterialx GLEW_GET_FUN(__glewMaterialx) +#define glMaterialxv GLEW_GET_FUN(__glewMaterialxv) +#define glMultMatrixx GLEW_GET_FUN(__glewMultMatrixx) +#define glMultiTexCoord4x GLEW_GET_FUN(__glewMultiTexCoord4x) +#define glNormal3x GLEW_GET_FUN(__glewNormal3x) +#define glOrthof GLEW_GET_FUN(__glewOrthof) +#define glOrthox GLEW_GET_FUN(__glewOrthox) +#define glPointSizex GLEW_GET_FUN(__glewPointSizex) +#define glPolygonOffsetx GLEW_GET_FUN(__glewPolygonOffsetx) +#define glRotatex GLEW_GET_FUN(__glewRotatex) +#define glSampleCoveragex GLEW_GET_FUN(__glewSampleCoveragex) +#define glScalex GLEW_GET_FUN(__glewScalex) +#define glTexEnvx GLEW_GET_FUN(__glewTexEnvx) +#define glTexEnvxv GLEW_GET_FUN(__glewTexEnvxv) +#define glTexParameterx GLEW_GET_FUN(__glewTexParameterx) +#define glTranslatex GLEW_GET_FUN(__glewTranslatex) + +#define GLEW_REGAL_ES1_0_compatibility GLEW_GET_VAR(__GLEW_REGAL_ES1_0_compatibility) + +#endif /* GL_REGAL_ES1_0_compatibility */ + +/* ---------------------- GL_REGAL_ES1_1_compatibility --------------------- */ + +#ifndef GL_REGAL_ES1_1_compatibility +#define GL_REGAL_ES1_1_compatibility 1 + +typedef void (GLAPIENTRY * PFNGLCLIPPLANEFPROC) (GLenum plane, const GLfloat* equation); +typedef void (GLAPIENTRY * PFNGLCLIPPLANEXPROC) (GLenum plane, const GLfixed* equation); +typedef void (GLAPIENTRY * PFNGLGETCLIPPLANEFPROC) (GLenum pname, GLfloat eqn[4]); +typedef void (GLAPIENTRY * PFNGLGETCLIPPLANEXPROC) (GLenum pname, GLfixed eqn[4]); +typedef void (GLAPIENTRY * PFNGLGETFIXEDVPROC) (GLenum pname, GLfixed* params); +typedef void (GLAPIENTRY * PFNGLGETLIGHTXVPROC) (GLenum light, GLenum pname, GLfixed* params); +typedef void (GLAPIENTRY * PFNGLGETMATERIALXVPROC) (GLenum face, GLenum pname, GLfixed* params); +typedef void (GLAPIENTRY * PFNGLGETTEXENVXVPROC) (GLenum env, GLenum pname, GLfixed* params); +typedef void (GLAPIENTRY * PFNGLGETTEXPARAMETERXVPROC) (GLenum target, GLenum pname, GLfixed* params); +typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERXPROC) (GLenum pname, GLfixed param); +typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERXVPROC) (GLenum pname, const GLfixed* params); +typedef void (GLAPIENTRY * PFNGLPOINTSIZEPOINTEROESPROC) (GLenum type, GLsizei stride, const GLvoid* pointer); +typedef void (GLAPIENTRY * PFNGLTEXPARAMETERXVPROC) (GLenum target, GLenum pname, const GLfixed* params); + +#define glClipPlanef GLEW_GET_FUN(__glewClipPlanef) +#define glClipPlanex GLEW_GET_FUN(__glewClipPlanex) +#define glGetClipPlanef GLEW_GET_FUN(__glewGetClipPlanef) +#define glGetClipPlanex GLEW_GET_FUN(__glewGetClipPlanex) +#define glGetFixedv GLEW_GET_FUN(__glewGetFixedv) +#define glGetLightxv GLEW_GET_FUN(__glewGetLightxv) +#define glGetMaterialxv GLEW_GET_FUN(__glewGetMaterialxv) +#define glGetTexEnvxv GLEW_GET_FUN(__glewGetTexEnvxv) +#define glGetTexParameterxv GLEW_GET_FUN(__glewGetTexParameterxv) +#define glPointParameterx GLEW_GET_FUN(__glewPointParameterx) +#define glPointParameterxv GLEW_GET_FUN(__glewPointParameterxv) +#define glPointSizePointerOES GLEW_GET_FUN(__glewPointSizePointerOES) +#define glTexParameterxv GLEW_GET_FUN(__glewTexParameterxv) + +#define GLEW_REGAL_ES1_1_compatibility GLEW_GET_VAR(__GLEW_REGAL_ES1_1_compatibility) + +#endif /* GL_REGAL_ES1_1_compatibility */ + +/* ---------------------------- GL_REGAL_enable ---------------------------- */ + +#ifndef GL_REGAL_enable +#define GL_REGAL_enable 1 + +#define GL_ERROR_REGAL 0x9322 +#define GL_DEBUG_REGAL 0x9323 +#define GL_LOG_REGAL 0x9324 +#define GL_EMULATION_REGAL 0x9325 +#define GL_DRIVER_REGAL 0x9326 +#define GL_MISSING_REGAL 0x9360 +#define GL_TRACE_REGAL 0x9361 +#define GL_CACHE_REGAL 0x9362 +#define GL_CODE_REGAL 0x9363 +#define GL_STATISTICS_REGAL 0x9364 + +#define GLEW_REGAL_enable GLEW_GET_VAR(__GLEW_REGAL_enable) + +#endif /* GL_REGAL_enable */ + +/* ------------------------- GL_REGAL_error_string ------------------------- */ + +#ifndef GL_REGAL_error_string +#define GL_REGAL_error_string 1 + +typedef const GLchar* (GLAPIENTRY * PFNGLERRORSTRINGREGALPROC) (GLenum error); + +#define glErrorStringREGAL GLEW_GET_FUN(__glewErrorStringREGAL) + +#define GLEW_REGAL_error_string GLEW_GET_VAR(__GLEW_REGAL_error_string) + +#endif /* GL_REGAL_error_string */ + +/* ------------------------ GL_REGAL_extension_query ----------------------- */ + +#ifndef GL_REGAL_extension_query +#define GL_REGAL_extension_query 1 + +typedef GLboolean (GLAPIENTRY * PFNGLGETEXTENSIONREGALPROC) (const GLchar* ext); +typedef GLboolean (GLAPIENTRY * PFNGLISSUPPORTEDREGALPROC) (const GLchar* ext); + +#define glGetExtensionREGAL GLEW_GET_FUN(__glewGetExtensionREGAL) +#define glIsSupportedREGAL GLEW_GET_FUN(__glewIsSupportedREGAL) + +#define GLEW_REGAL_extension_query GLEW_GET_VAR(__GLEW_REGAL_extension_query) + +#endif /* GL_REGAL_extension_query */ + +/* ------------------------------ GL_REGAL_log ----------------------------- */ + +#ifndef GL_REGAL_log +#define GL_REGAL_log 1 + +#define GL_LOG_ERROR_REGAL 0x9319 +#define GL_LOG_WARNING_REGAL 0x931A +#define GL_LOG_INFO_REGAL 0x931B +#define GL_LOG_APP_REGAL 0x931C +#define GL_LOG_DRIVER_REGAL 0x931D +#define GL_LOG_INTERNAL_REGAL 0x931E +#define GL_LOG_DEBUG_REGAL 0x931F +#define GL_LOG_STATUS_REGAL 0x9320 +#define GL_LOG_HTTP_REGAL 0x9321 + +typedef void (APIENTRY *GLLOGPROCREGAL)(GLenum stream, GLsizei length, const GLchar *message, GLvoid *context); + +typedef void (GLAPIENTRY * PFNGLLOGMESSAGECALLBACKREGALPROC) (GLLOGPROCREGAL callback); + +#define glLogMessageCallbackREGAL GLEW_GET_FUN(__glewLogMessageCallbackREGAL) + +#define GLEW_REGAL_log GLEW_GET_VAR(__GLEW_REGAL_log) + +#endif /* GL_REGAL_log */ + +/* ----------------------- GL_REND_screen_coordinates ---------------------- */ + +#ifndef GL_REND_screen_coordinates +#define GL_REND_screen_coordinates 1 + +#define GL_SCREEN_COORDINATES_REND 0x8490 +#define GL_INVERTED_SCREEN_W_REND 0x8491 + +#define GLEW_REND_screen_coordinates GLEW_GET_VAR(__GLEW_REND_screen_coordinates) + +#endif /* GL_REND_screen_coordinates */ + +/* ------------------------------- GL_S3_s3tc ------------------------------ */ + +#ifndef GL_S3_s3tc +#define GL_S3_s3tc 1 + +#define GL_RGB_S3TC 0x83A0 +#define GL_RGB4_S3TC 0x83A1 +#define GL_RGBA_S3TC 0x83A2 +#define GL_RGBA4_S3TC 0x83A3 +#define GL_RGBA_DXT5_S3TC 0x83A4 +#define GL_RGBA4_DXT5_S3TC 0x83A5 + +#define GLEW_S3_s3tc GLEW_GET_VAR(__GLEW_S3_s3tc) + +#endif /* GL_S3_s3tc */ + +/* -------------------------- GL_SGIS_color_range -------------------------- */ + +#ifndef GL_SGIS_color_range +#define GL_SGIS_color_range 1 + +#define GL_EXTENDED_RANGE_SGIS 0x85A5 +#define GL_MIN_RED_SGIS 0x85A6 +#define GL_MAX_RED_SGIS 0x85A7 +#define GL_MIN_GREEN_SGIS 0x85A8 +#define GL_MAX_GREEN_SGIS 0x85A9 +#define GL_MIN_BLUE_SGIS 0x85AA +#define GL_MAX_BLUE_SGIS 0x85AB +#define GL_MIN_ALPHA_SGIS 0x85AC +#define GL_MAX_ALPHA_SGIS 0x85AD + +#define GLEW_SGIS_color_range GLEW_GET_VAR(__GLEW_SGIS_color_range) + +#endif /* GL_SGIS_color_range */ + +/* ------------------------- GL_SGIS_detail_texture ------------------------ */ + +#ifndef GL_SGIS_detail_texture +#define GL_SGIS_detail_texture 1 + +typedef void (GLAPIENTRY * PFNGLDETAILTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat* points); +typedef void (GLAPIENTRY * PFNGLGETDETAILTEXFUNCSGISPROC) (GLenum target, GLfloat* points); + +#define glDetailTexFuncSGIS GLEW_GET_FUN(__glewDetailTexFuncSGIS) +#define glGetDetailTexFuncSGIS GLEW_GET_FUN(__glewGetDetailTexFuncSGIS) + +#define GLEW_SGIS_detail_texture GLEW_GET_VAR(__GLEW_SGIS_detail_texture) + +#endif /* GL_SGIS_detail_texture */ + +/* -------------------------- GL_SGIS_fog_function ------------------------- */ + +#ifndef GL_SGIS_fog_function +#define GL_SGIS_fog_function 1 + +typedef void (GLAPIENTRY * PFNGLFOGFUNCSGISPROC) (GLsizei n, const GLfloat* points); +typedef void (GLAPIENTRY * PFNGLGETFOGFUNCSGISPROC) (GLfloat* points); + +#define glFogFuncSGIS GLEW_GET_FUN(__glewFogFuncSGIS) +#define glGetFogFuncSGIS GLEW_GET_FUN(__glewGetFogFuncSGIS) + +#define GLEW_SGIS_fog_function GLEW_GET_VAR(__GLEW_SGIS_fog_function) + +#endif /* GL_SGIS_fog_function */ + +/* ------------------------ GL_SGIS_generate_mipmap ------------------------ */ + +#ifndef GL_SGIS_generate_mipmap +#define GL_SGIS_generate_mipmap 1 + +#define GL_GENERATE_MIPMAP_SGIS 0x8191 +#define GL_GENERATE_MIPMAP_HINT_SGIS 0x8192 + +#define GLEW_SGIS_generate_mipmap GLEW_GET_VAR(__GLEW_SGIS_generate_mipmap) + +#endif /* GL_SGIS_generate_mipmap */ + +/* -------------------------- GL_SGIS_multisample -------------------------- */ + +#ifndef GL_SGIS_multisample +#define GL_SGIS_multisample 1 + +#define GL_MULTISAMPLE_SGIS 0x809D +#define GL_SAMPLE_ALPHA_TO_MASK_SGIS 0x809E +#define GL_SAMPLE_ALPHA_TO_ONE_SGIS 0x809F +#define GL_SAMPLE_MASK_SGIS 0x80A0 +#define GL_1PASS_SGIS 0x80A1 +#define GL_2PASS_0_SGIS 0x80A2 +#define GL_2PASS_1_SGIS 0x80A3 +#define GL_4PASS_0_SGIS 0x80A4 +#define GL_4PASS_1_SGIS 0x80A5 +#define GL_4PASS_2_SGIS 0x80A6 +#define GL_4PASS_3_SGIS 0x80A7 +#define GL_SAMPLE_BUFFERS_SGIS 0x80A8 +#define GL_SAMPLES_SGIS 0x80A9 +#define GL_SAMPLE_MASK_VALUE_SGIS 0x80AA +#define GL_SAMPLE_MASK_INVERT_SGIS 0x80AB +#define GL_SAMPLE_PATTERN_SGIS 0x80AC + +typedef void (GLAPIENTRY * PFNGLSAMPLEMASKSGISPROC) (GLclampf value, GLboolean invert); +typedef void (GLAPIENTRY * PFNGLSAMPLEPATTERNSGISPROC) (GLenum pattern); + +#define glSampleMaskSGIS GLEW_GET_FUN(__glewSampleMaskSGIS) +#define glSamplePatternSGIS GLEW_GET_FUN(__glewSamplePatternSGIS) + +#define GLEW_SGIS_multisample GLEW_GET_VAR(__GLEW_SGIS_multisample) + +#endif /* GL_SGIS_multisample */ + +/* ------------------------- GL_SGIS_pixel_texture ------------------------- */ + +#ifndef GL_SGIS_pixel_texture +#define GL_SGIS_pixel_texture 1 + +#define GLEW_SGIS_pixel_texture GLEW_GET_VAR(__GLEW_SGIS_pixel_texture) + +#endif /* GL_SGIS_pixel_texture */ + +/* ----------------------- GL_SGIS_point_line_texgen ----------------------- */ + +#ifndef GL_SGIS_point_line_texgen +#define GL_SGIS_point_line_texgen 1 + +#define GL_EYE_DISTANCE_TO_POINT_SGIS 0x81F0 +#define GL_OBJECT_DISTANCE_TO_POINT_SGIS 0x81F1 +#define GL_EYE_DISTANCE_TO_LINE_SGIS 0x81F2 +#define GL_OBJECT_DISTANCE_TO_LINE_SGIS 0x81F3 +#define GL_EYE_POINT_SGIS 0x81F4 +#define GL_OBJECT_POINT_SGIS 0x81F5 +#define GL_EYE_LINE_SGIS 0x81F6 +#define GL_OBJECT_LINE_SGIS 0x81F7 + +#define GLEW_SGIS_point_line_texgen GLEW_GET_VAR(__GLEW_SGIS_point_line_texgen) + +#endif /* GL_SGIS_point_line_texgen */ + +/* ------------------------ GL_SGIS_sharpen_texture ------------------------ */ + +#ifndef GL_SGIS_sharpen_texture +#define GL_SGIS_sharpen_texture 1 + +typedef void (GLAPIENTRY * PFNGLGETSHARPENTEXFUNCSGISPROC) (GLenum target, GLfloat* points); +typedef void (GLAPIENTRY * PFNGLSHARPENTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat* points); + +#define glGetSharpenTexFuncSGIS GLEW_GET_FUN(__glewGetSharpenTexFuncSGIS) +#define glSharpenTexFuncSGIS GLEW_GET_FUN(__glewSharpenTexFuncSGIS) + +#define GLEW_SGIS_sharpen_texture GLEW_GET_VAR(__GLEW_SGIS_sharpen_texture) + +#endif /* GL_SGIS_sharpen_texture */ + +/* --------------------------- GL_SGIS_texture4D --------------------------- */ + +#ifndef GL_SGIS_texture4D +#define GL_SGIS_texture4D 1 + +typedef void (GLAPIENTRY * PFNGLTEXIMAGE4DSGISPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLsizei extent, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (GLAPIENTRY * PFNGLTEXSUBIMAGE4DSGISPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint woffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei extent, GLenum format, GLenum type, const GLvoid *pixels); + +#define glTexImage4DSGIS GLEW_GET_FUN(__glewTexImage4DSGIS) +#define glTexSubImage4DSGIS GLEW_GET_FUN(__glewTexSubImage4DSGIS) + +#define GLEW_SGIS_texture4D GLEW_GET_VAR(__GLEW_SGIS_texture4D) + +#endif /* GL_SGIS_texture4D */ + +/* ---------------------- GL_SGIS_texture_border_clamp --------------------- */ + +#ifndef GL_SGIS_texture_border_clamp +#define GL_SGIS_texture_border_clamp 1 + +#define GL_CLAMP_TO_BORDER_SGIS 0x812D + +#define GLEW_SGIS_texture_border_clamp GLEW_GET_VAR(__GLEW_SGIS_texture_border_clamp) + +#endif /* GL_SGIS_texture_border_clamp */ + +/* ----------------------- GL_SGIS_texture_edge_clamp ---------------------- */ + +#ifndef GL_SGIS_texture_edge_clamp +#define GL_SGIS_texture_edge_clamp 1 + +#define GL_CLAMP_TO_EDGE_SGIS 0x812F + +#define GLEW_SGIS_texture_edge_clamp GLEW_GET_VAR(__GLEW_SGIS_texture_edge_clamp) + +#endif /* GL_SGIS_texture_edge_clamp */ + +/* ------------------------ GL_SGIS_texture_filter4 ------------------------ */ + +#ifndef GL_SGIS_texture_filter4 +#define GL_SGIS_texture_filter4 1 + +typedef void (GLAPIENTRY * PFNGLGETTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLfloat* weights); +typedef void (GLAPIENTRY * PFNGLTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLsizei n, const GLfloat* weights); + +#define glGetTexFilterFuncSGIS GLEW_GET_FUN(__glewGetTexFilterFuncSGIS) +#define glTexFilterFuncSGIS GLEW_GET_FUN(__glewTexFilterFuncSGIS) + +#define GLEW_SGIS_texture_filter4 GLEW_GET_VAR(__GLEW_SGIS_texture_filter4) + +#endif /* GL_SGIS_texture_filter4 */ + +/* -------------------------- GL_SGIS_texture_lod -------------------------- */ + +#ifndef GL_SGIS_texture_lod +#define GL_SGIS_texture_lod 1 + +#define GL_TEXTURE_MIN_LOD_SGIS 0x813A +#define GL_TEXTURE_MAX_LOD_SGIS 0x813B +#define GL_TEXTURE_BASE_LEVEL_SGIS 0x813C +#define GL_TEXTURE_MAX_LEVEL_SGIS 0x813D + +#define GLEW_SGIS_texture_lod GLEW_GET_VAR(__GLEW_SGIS_texture_lod) + +#endif /* GL_SGIS_texture_lod */ + +/* ------------------------- GL_SGIS_texture_select ------------------------ */ + +#ifndef GL_SGIS_texture_select +#define GL_SGIS_texture_select 1 + +#define GLEW_SGIS_texture_select GLEW_GET_VAR(__GLEW_SGIS_texture_select) + +#endif /* GL_SGIS_texture_select */ + +/* ----------------------------- GL_SGIX_async ----------------------------- */ + +#ifndef GL_SGIX_async +#define GL_SGIX_async 1 + +#define GL_ASYNC_MARKER_SGIX 0x8329 + +typedef void (GLAPIENTRY * PFNGLASYNCMARKERSGIXPROC) (GLuint marker); +typedef void (GLAPIENTRY * PFNGLDELETEASYNCMARKERSSGIXPROC) (GLuint marker, GLsizei range); +typedef GLint (GLAPIENTRY * PFNGLFINISHASYNCSGIXPROC) (GLuint* markerp); +typedef GLuint (GLAPIENTRY * PFNGLGENASYNCMARKERSSGIXPROC) (GLsizei range); +typedef GLboolean (GLAPIENTRY * PFNGLISASYNCMARKERSGIXPROC) (GLuint marker); +typedef GLint (GLAPIENTRY * PFNGLPOLLASYNCSGIXPROC) (GLuint* markerp); + +#define glAsyncMarkerSGIX GLEW_GET_FUN(__glewAsyncMarkerSGIX) +#define glDeleteAsyncMarkersSGIX GLEW_GET_FUN(__glewDeleteAsyncMarkersSGIX) +#define glFinishAsyncSGIX GLEW_GET_FUN(__glewFinishAsyncSGIX) +#define glGenAsyncMarkersSGIX GLEW_GET_FUN(__glewGenAsyncMarkersSGIX) +#define glIsAsyncMarkerSGIX GLEW_GET_FUN(__glewIsAsyncMarkerSGIX) +#define glPollAsyncSGIX GLEW_GET_FUN(__glewPollAsyncSGIX) + +#define GLEW_SGIX_async GLEW_GET_VAR(__GLEW_SGIX_async) + +#endif /* GL_SGIX_async */ + +/* ------------------------ GL_SGIX_async_histogram ------------------------ */ + +#ifndef GL_SGIX_async_histogram +#define GL_SGIX_async_histogram 1 + +#define GL_ASYNC_HISTOGRAM_SGIX 0x832C +#define GL_MAX_ASYNC_HISTOGRAM_SGIX 0x832D + +#define GLEW_SGIX_async_histogram GLEW_GET_VAR(__GLEW_SGIX_async_histogram) + +#endif /* GL_SGIX_async_histogram */ + +/* -------------------------- GL_SGIX_async_pixel -------------------------- */ + +#ifndef GL_SGIX_async_pixel +#define GL_SGIX_async_pixel 1 + +#define GL_ASYNC_TEX_IMAGE_SGIX 0x835C +#define GL_ASYNC_DRAW_PIXELS_SGIX 0x835D +#define GL_ASYNC_READ_PIXELS_SGIX 0x835E +#define GL_MAX_ASYNC_TEX_IMAGE_SGIX 0x835F +#define GL_MAX_ASYNC_DRAW_PIXELS_SGIX 0x8360 +#define GL_MAX_ASYNC_READ_PIXELS_SGIX 0x8361 + +#define GLEW_SGIX_async_pixel GLEW_GET_VAR(__GLEW_SGIX_async_pixel) + +#endif /* GL_SGIX_async_pixel */ + +/* ----------------------- GL_SGIX_blend_alpha_minmax ---------------------- */ + +#ifndef GL_SGIX_blend_alpha_minmax +#define GL_SGIX_blend_alpha_minmax 1 + +#define GL_ALPHA_MIN_SGIX 0x8320 +#define GL_ALPHA_MAX_SGIX 0x8321 + +#define GLEW_SGIX_blend_alpha_minmax GLEW_GET_VAR(__GLEW_SGIX_blend_alpha_minmax) + +#endif /* GL_SGIX_blend_alpha_minmax */ + +/* ---------------------------- GL_SGIX_clipmap ---------------------------- */ + +#ifndef GL_SGIX_clipmap +#define GL_SGIX_clipmap 1 + +#define GLEW_SGIX_clipmap GLEW_GET_VAR(__GLEW_SGIX_clipmap) + +#endif /* GL_SGIX_clipmap */ + +/* ---------------------- GL_SGIX_convolution_accuracy --------------------- */ + +#ifndef GL_SGIX_convolution_accuracy +#define GL_SGIX_convolution_accuracy 1 + +#define GL_CONVOLUTION_HINT_SGIX 0x8316 + +#define GLEW_SGIX_convolution_accuracy GLEW_GET_VAR(__GLEW_SGIX_convolution_accuracy) + +#endif /* GL_SGIX_convolution_accuracy */ + +/* ------------------------- GL_SGIX_depth_texture ------------------------- */ + +#ifndef GL_SGIX_depth_texture +#define GL_SGIX_depth_texture 1 + +#define GL_DEPTH_COMPONENT16_SGIX 0x81A5 +#define GL_DEPTH_COMPONENT24_SGIX 0x81A6 +#define GL_DEPTH_COMPONENT32_SGIX 0x81A7 + +#define GLEW_SGIX_depth_texture GLEW_GET_VAR(__GLEW_SGIX_depth_texture) + +#endif /* GL_SGIX_depth_texture */ + +/* -------------------------- GL_SGIX_flush_raster ------------------------- */ + +#ifndef GL_SGIX_flush_raster +#define GL_SGIX_flush_raster 1 + +typedef void (GLAPIENTRY * PFNGLFLUSHRASTERSGIXPROC) (void); + +#define glFlushRasterSGIX GLEW_GET_FUN(__glewFlushRasterSGIX) + +#define GLEW_SGIX_flush_raster GLEW_GET_VAR(__GLEW_SGIX_flush_raster) + +#endif /* GL_SGIX_flush_raster */ + +/* --------------------------- GL_SGIX_fog_offset -------------------------- */ + +#ifndef GL_SGIX_fog_offset +#define GL_SGIX_fog_offset 1 + +#define GL_FOG_OFFSET_SGIX 0x8198 +#define GL_FOG_OFFSET_VALUE_SGIX 0x8199 + +#define GLEW_SGIX_fog_offset GLEW_GET_VAR(__GLEW_SGIX_fog_offset) + +#endif /* GL_SGIX_fog_offset */ + +/* -------------------------- GL_SGIX_fog_texture -------------------------- */ + +#ifndef GL_SGIX_fog_texture +#define GL_SGIX_fog_texture 1 + +#define GL_TEXTURE_FOG_SGIX 0 +#define GL_FOG_PATCHY_FACTOR_SGIX 0 +#define GL_FRAGMENT_FOG_SGIX 0 + +typedef void (GLAPIENTRY * PFNGLTEXTUREFOGSGIXPROC) (GLenum pname); + +#define glTextureFogSGIX GLEW_GET_FUN(__glewTextureFogSGIX) + +#define GLEW_SGIX_fog_texture GLEW_GET_VAR(__GLEW_SGIX_fog_texture) + +#endif /* GL_SGIX_fog_texture */ + +/* ------------------- GL_SGIX_fragment_specular_lighting ------------------ */ + +#ifndef GL_SGIX_fragment_specular_lighting +#define GL_SGIX_fragment_specular_lighting 1 + +typedef void (GLAPIENTRY * PFNGLFRAGMENTCOLORMATERIALSGIXPROC) (GLenum face, GLenum mode); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELFSGIXPROC) (GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELFVSGIXPROC) (GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELISGIXPROC) (GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELIVSGIXPROC) (GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTFSGIXPROC) (GLenum light, GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTISGIXPROC) (GLenum light, GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALFSGIXPROC) (GLenum face, GLenum pname, const GLfloat param); +typedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALISGIXPROC) (GLenum face, GLenum pname, const GLint param); +typedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLGETFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum value, GLfloat* data); +typedef void (GLAPIENTRY * PFNGLGETFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum value, GLint* data); +typedef void (GLAPIENTRY * PFNGLGETFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, const GLfloat* data); +typedef void (GLAPIENTRY * PFNGLGETFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, const GLint* data); + +#define glFragmentColorMaterialSGIX GLEW_GET_FUN(__glewFragmentColorMaterialSGIX) +#define glFragmentLightModelfSGIX GLEW_GET_FUN(__glewFragmentLightModelfSGIX) +#define glFragmentLightModelfvSGIX GLEW_GET_FUN(__glewFragmentLightModelfvSGIX) +#define glFragmentLightModeliSGIX GLEW_GET_FUN(__glewFragmentLightModeliSGIX) +#define glFragmentLightModelivSGIX GLEW_GET_FUN(__glewFragmentLightModelivSGIX) +#define glFragmentLightfSGIX GLEW_GET_FUN(__glewFragmentLightfSGIX) +#define glFragmentLightfvSGIX GLEW_GET_FUN(__glewFragmentLightfvSGIX) +#define glFragmentLightiSGIX GLEW_GET_FUN(__glewFragmentLightiSGIX) +#define glFragmentLightivSGIX GLEW_GET_FUN(__glewFragmentLightivSGIX) +#define glFragmentMaterialfSGIX GLEW_GET_FUN(__glewFragmentMaterialfSGIX) +#define glFragmentMaterialfvSGIX GLEW_GET_FUN(__glewFragmentMaterialfvSGIX) +#define glFragmentMaterialiSGIX GLEW_GET_FUN(__glewFragmentMaterialiSGIX) +#define glFragmentMaterialivSGIX GLEW_GET_FUN(__glewFragmentMaterialivSGIX) +#define glGetFragmentLightfvSGIX GLEW_GET_FUN(__glewGetFragmentLightfvSGIX) +#define glGetFragmentLightivSGIX GLEW_GET_FUN(__glewGetFragmentLightivSGIX) +#define glGetFragmentMaterialfvSGIX GLEW_GET_FUN(__glewGetFragmentMaterialfvSGIX) +#define glGetFragmentMaterialivSGIX GLEW_GET_FUN(__glewGetFragmentMaterialivSGIX) + +#define GLEW_SGIX_fragment_specular_lighting GLEW_GET_VAR(__GLEW_SGIX_fragment_specular_lighting) + +#endif /* GL_SGIX_fragment_specular_lighting */ + +/* --------------------------- GL_SGIX_framezoom --------------------------- */ + +#ifndef GL_SGIX_framezoom +#define GL_SGIX_framezoom 1 + +typedef void (GLAPIENTRY * PFNGLFRAMEZOOMSGIXPROC) (GLint factor); + +#define glFrameZoomSGIX GLEW_GET_FUN(__glewFrameZoomSGIX) + +#define GLEW_SGIX_framezoom GLEW_GET_VAR(__GLEW_SGIX_framezoom) + +#endif /* GL_SGIX_framezoom */ + +/* --------------------------- GL_SGIX_interlace --------------------------- */ + +#ifndef GL_SGIX_interlace +#define GL_SGIX_interlace 1 + +#define GL_INTERLACE_SGIX 0x8094 + +#define GLEW_SGIX_interlace GLEW_GET_VAR(__GLEW_SGIX_interlace) + +#endif /* GL_SGIX_interlace */ + +/* ------------------------- GL_SGIX_ir_instrument1 ------------------------ */ + +#ifndef GL_SGIX_ir_instrument1 +#define GL_SGIX_ir_instrument1 1 + +#define GLEW_SGIX_ir_instrument1 GLEW_GET_VAR(__GLEW_SGIX_ir_instrument1) + +#endif /* GL_SGIX_ir_instrument1 */ + +/* ------------------------- GL_SGIX_list_priority ------------------------- */ + +#ifndef GL_SGIX_list_priority +#define GL_SGIX_list_priority 1 + +#define GLEW_SGIX_list_priority GLEW_GET_VAR(__GLEW_SGIX_list_priority) + +#endif /* GL_SGIX_list_priority */ + +/* ------------------------- GL_SGIX_pixel_texture ------------------------- */ + +#ifndef GL_SGIX_pixel_texture +#define GL_SGIX_pixel_texture 1 + +typedef void (GLAPIENTRY * PFNGLPIXELTEXGENSGIXPROC) (GLenum mode); + +#define glPixelTexGenSGIX GLEW_GET_FUN(__glewPixelTexGenSGIX) + +#define GLEW_SGIX_pixel_texture GLEW_GET_VAR(__GLEW_SGIX_pixel_texture) + +#endif /* GL_SGIX_pixel_texture */ + +/* ----------------------- GL_SGIX_pixel_texture_bits ---------------------- */ + +#ifndef GL_SGIX_pixel_texture_bits +#define GL_SGIX_pixel_texture_bits 1 + +#define GLEW_SGIX_pixel_texture_bits GLEW_GET_VAR(__GLEW_SGIX_pixel_texture_bits) + +#endif /* GL_SGIX_pixel_texture_bits */ + +/* ------------------------ GL_SGIX_reference_plane ------------------------ */ + +#ifndef GL_SGIX_reference_plane +#define GL_SGIX_reference_plane 1 + +typedef void (GLAPIENTRY * PFNGLREFERENCEPLANESGIXPROC) (const GLdouble* equation); + +#define glReferencePlaneSGIX GLEW_GET_FUN(__glewReferencePlaneSGIX) + +#define GLEW_SGIX_reference_plane GLEW_GET_VAR(__GLEW_SGIX_reference_plane) + +#endif /* GL_SGIX_reference_plane */ + +/* ---------------------------- GL_SGIX_resample --------------------------- */ + +#ifndef GL_SGIX_resample +#define GL_SGIX_resample 1 + +#define GL_PACK_RESAMPLE_SGIX 0x842E +#define GL_UNPACK_RESAMPLE_SGIX 0x842F +#define GL_RESAMPLE_DECIMATE_SGIX 0x8430 +#define GL_RESAMPLE_REPLICATE_SGIX 0x8433 +#define GL_RESAMPLE_ZERO_FILL_SGIX 0x8434 + +#define GLEW_SGIX_resample GLEW_GET_VAR(__GLEW_SGIX_resample) + +#endif /* GL_SGIX_resample */ + +/* ----------------------------- GL_SGIX_shadow ---------------------------- */ + +#ifndef GL_SGIX_shadow +#define GL_SGIX_shadow 1 + +#define GL_TEXTURE_COMPARE_SGIX 0x819A +#define GL_TEXTURE_COMPARE_OPERATOR_SGIX 0x819B +#define GL_TEXTURE_LEQUAL_R_SGIX 0x819C +#define GL_TEXTURE_GEQUAL_R_SGIX 0x819D + +#define GLEW_SGIX_shadow GLEW_GET_VAR(__GLEW_SGIX_shadow) + +#endif /* GL_SGIX_shadow */ + +/* ------------------------- GL_SGIX_shadow_ambient ------------------------ */ + +#ifndef GL_SGIX_shadow_ambient +#define GL_SGIX_shadow_ambient 1 + +#define GL_SHADOW_AMBIENT_SGIX 0x80BF + +#define GLEW_SGIX_shadow_ambient GLEW_GET_VAR(__GLEW_SGIX_shadow_ambient) + +#endif /* GL_SGIX_shadow_ambient */ + +/* ----------------------------- GL_SGIX_sprite ---------------------------- */ + +#ifndef GL_SGIX_sprite +#define GL_SGIX_sprite 1 + +typedef void (GLAPIENTRY * PFNGLSPRITEPARAMETERFSGIXPROC) (GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLSPRITEPARAMETERFVSGIXPROC) (GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLSPRITEPARAMETERISGIXPROC) (GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLSPRITEPARAMETERIVSGIXPROC) (GLenum pname, GLint* params); + +#define glSpriteParameterfSGIX GLEW_GET_FUN(__glewSpriteParameterfSGIX) +#define glSpriteParameterfvSGIX GLEW_GET_FUN(__glewSpriteParameterfvSGIX) +#define glSpriteParameteriSGIX GLEW_GET_FUN(__glewSpriteParameteriSGIX) +#define glSpriteParameterivSGIX GLEW_GET_FUN(__glewSpriteParameterivSGIX) + +#define GLEW_SGIX_sprite GLEW_GET_VAR(__GLEW_SGIX_sprite) + +#endif /* GL_SGIX_sprite */ + +/* ----------------------- GL_SGIX_tag_sample_buffer ----------------------- */ + +#ifndef GL_SGIX_tag_sample_buffer +#define GL_SGIX_tag_sample_buffer 1 + +typedef void (GLAPIENTRY * PFNGLTAGSAMPLEBUFFERSGIXPROC) (void); + +#define glTagSampleBufferSGIX GLEW_GET_FUN(__glewTagSampleBufferSGIX) + +#define GLEW_SGIX_tag_sample_buffer GLEW_GET_VAR(__GLEW_SGIX_tag_sample_buffer) + +#endif /* GL_SGIX_tag_sample_buffer */ + +/* ------------------------ GL_SGIX_texture_add_env ------------------------ */ + +#ifndef GL_SGIX_texture_add_env +#define GL_SGIX_texture_add_env 1 + +#define GLEW_SGIX_texture_add_env GLEW_GET_VAR(__GLEW_SGIX_texture_add_env) + +#endif /* GL_SGIX_texture_add_env */ + +/* -------------------- GL_SGIX_texture_coordinate_clamp ------------------- */ + +#ifndef GL_SGIX_texture_coordinate_clamp +#define GL_SGIX_texture_coordinate_clamp 1 + +#define GL_TEXTURE_MAX_CLAMP_S_SGIX 0x8369 +#define GL_TEXTURE_MAX_CLAMP_T_SGIX 0x836A +#define GL_TEXTURE_MAX_CLAMP_R_SGIX 0x836B + +#define GLEW_SGIX_texture_coordinate_clamp GLEW_GET_VAR(__GLEW_SGIX_texture_coordinate_clamp) + +#endif /* GL_SGIX_texture_coordinate_clamp */ + +/* ------------------------ GL_SGIX_texture_lod_bias ----------------------- */ + +#ifndef GL_SGIX_texture_lod_bias +#define GL_SGIX_texture_lod_bias 1 + +#define GLEW_SGIX_texture_lod_bias GLEW_GET_VAR(__GLEW_SGIX_texture_lod_bias) + +#endif /* GL_SGIX_texture_lod_bias */ + +/* ---------------------- GL_SGIX_texture_multi_buffer --------------------- */ + +#ifndef GL_SGIX_texture_multi_buffer +#define GL_SGIX_texture_multi_buffer 1 + +#define GL_TEXTURE_MULTI_BUFFER_HINT_SGIX 0x812E + +#define GLEW_SGIX_texture_multi_buffer GLEW_GET_VAR(__GLEW_SGIX_texture_multi_buffer) + +#endif /* GL_SGIX_texture_multi_buffer */ + +/* ------------------------- GL_SGIX_texture_range ------------------------- */ + +#ifndef GL_SGIX_texture_range +#define GL_SGIX_texture_range 1 + +#define GL_RGB_SIGNED_SGIX 0x85E0 +#define GL_RGBA_SIGNED_SGIX 0x85E1 +#define GL_ALPHA_SIGNED_SGIX 0x85E2 +#define GL_LUMINANCE_SIGNED_SGIX 0x85E3 +#define GL_INTENSITY_SIGNED_SGIX 0x85E4 +#define GL_LUMINANCE_ALPHA_SIGNED_SGIX 0x85E5 +#define GL_RGB16_SIGNED_SGIX 0x85E6 +#define GL_RGBA16_SIGNED_SGIX 0x85E7 +#define GL_ALPHA16_SIGNED_SGIX 0x85E8 +#define GL_LUMINANCE16_SIGNED_SGIX 0x85E9 +#define GL_INTENSITY16_SIGNED_SGIX 0x85EA +#define GL_LUMINANCE16_ALPHA16_SIGNED_SGIX 0x85EB +#define GL_RGB_EXTENDED_RANGE_SGIX 0x85EC +#define GL_RGBA_EXTENDED_RANGE_SGIX 0x85ED +#define GL_ALPHA_EXTENDED_RANGE_SGIX 0x85EE +#define GL_LUMINANCE_EXTENDED_RANGE_SGIX 0x85EF +#define GL_INTENSITY_EXTENDED_RANGE_SGIX 0x85F0 +#define GL_LUMINANCE_ALPHA_EXTENDED_RANGE_SGIX 0x85F1 +#define GL_RGB16_EXTENDED_RANGE_SGIX 0x85F2 +#define GL_RGBA16_EXTENDED_RANGE_SGIX 0x85F3 +#define GL_ALPHA16_EXTENDED_RANGE_SGIX 0x85F4 +#define GL_LUMINANCE16_EXTENDED_RANGE_SGIX 0x85F5 +#define GL_INTENSITY16_EXTENDED_RANGE_SGIX 0x85F6 +#define GL_LUMINANCE16_ALPHA16_EXTENDED_RANGE_SGIX 0x85F7 +#define GL_MIN_LUMINANCE_SGIS 0x85F8 +#define GL_MAX_LUMINANCE_SGIS 0x85F9 +#define GL_MIN_INTENSITY_SGIS 0x85FA +#define GL_MAX_INTENSITY_SGIS 0x85FB + +#define GLEW_SGIX_texture_range GLEW_GET_VAR(__GLEW_SGIX_texture_range) + +#endif /* GL_SGIX_texture_range */ + +/* ----------------------- GL_SGIX_texture_scale_bias ---------------------- */ + +#ifndef GL_SGIX_texture_scale_bias +#define GL_SGIX_texture_scale_bias 1 + +#define GL_POST_TEXTURE_FILTER_BIAS_SGIX 0x8179 +#define GL_POST_TEXTURE_FILTER_SCALE_SGIX 0x817A +#define GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX 0x817B +#define GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX 0x817C + +#define GLEW_SGIX_texture_scale_bias GLEW_GET_VAR(__GLEW_SGIX_texture_scale_bias) + +#endif /* GL_SGIX_texture_scale_bias */ + +/* ------------------------- GL_SGIX_vertex_preclip ------------------------ */ + +#ifndef GL_SGIX_vertex_preclip +#define GL_SGIX_vertex_preclip 1 + +#define GL_VERTEX_PRECLIP_SGIX 0x83EE +#define GL_VERTEX_PRECLIP_HINT_SGIX 0x83EF + +#define GLEW_SGIX_vertex_preclip GLEW_GET_VAR(__GLEW_SGIX_vertex_preclip) + +#endif /* GL_SGIX_vertex_preclip */ + +/* ---------------------- GL_SGIX_vertex_preclip_hint ---------------------- */ + +#ifndef GL_SGIX_vertex_preclip_hint +#define GL_SGIX_vertex_preclip_hint 1 + +#define GL_VERTEX_PRECLIP_SGIX 0x83EE +#define GL_VERTEX_PRECLIP_HINT_SGIX 0x83EF + +#define GLEW_SGIX_vertex_preclip_hint GLEW_GET_VAR(__GLEW_SGIX_vertex_preclip_hint) + +#endif /* GL_SGIX_vertex_preclip_hint */ + +/* ----------------------------- GL_SGIX_ycrcb ----------------------------- */ + +#ifndef GL_SGIX_ycrcb +#define GL_SGIX_ycrcb 1 + +#define GLEW_SGIX_ycrcb GLEW_GET_VAR(__GLEW_SGIX_ycrcb) + +#endif /* GL_SGIX_ycrcb */ + +/* -------------------------- GL_SGI_color_matrix -------------------------- */ + +#ifndef GL_SGI_color_matrix +#define GL_SGI_color_matrix 1 + +#define GL_COLOR_MATRIX_SGI 0x80B1 +#define GL_COLOR_MATRIX_STACK_DEPTH_SGI 0x80B2 +#define GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI 0x80B3 +#define GL_POST_COLOR_MATRIX_RED_SCALE_SGI 0x80B4 +#define GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI 0x80B5 +#define GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI 0x80B6 +#define GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI 0x80B7 +#define GL_POST_COLOR_MATRIX_RED_BIAS_SGI 0x80B8 +#define GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI 0x80B9 +#define GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI 0x80BA +#define GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI 0x80BB + +#define GLEW_SGI_color_matrix GLEW_GET_VAR(__GLEW_SGI_color_matrix) + +#endif /* GL_SGI_color_matrix */ + +/* --------------------------- GL_SGI_color_table -------------------------- */ + +#ifndef GL_SGI_color_table +#define GL_SGI_color_table 1 + +#define GL_COLOR_TABLE_SGI 0x80D0 +#define GL_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D1 +#define GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D2 +#define GL_PROXY_COLOR_TABLE_SGI 0x80D3 +#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D4 +#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D5 +#define GL_COLOR_TABLE_SCALE_SGI 0x80D6 +#define GL_COLOR_TABLE_BIAS_SGI 0x80D7 +#define GL_COLOR_TABLE_FORMAT_SGI 0x80D8 +#define GL_COLOR_TABLE_WIDTH_SGI 0x80D9 +#define GL_COLOR_TABLE_RED_SIZE_SGI 0x80DA +#define GL_COLOR_TABLE_GREEN_SIZE_SGI 0x80DB +#define GL_COLOR_TABLE_BLUE_SIZE_SGI 0x80DC +#define GL_COLOR_TABLE_ALPHA_SIZE_SGI 0x80DD +#define GL_COLOR_TABLE_LUMINANCE_SIZE_SGI 0x80DE +#define GL_COLOR_TABLE_INTENSITY_SIZE_SGI 0x80DF + +typedef void (GLAPIENTRY * PFNGLCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table); +typedef void (GLAPIENTRY * PFNGLCOPYCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETCOLORTABLESGIPROC) (GLenum target, GLenum format, GLenum type, GLvoid *table); + +#define glColorTableParameterfvSGI GLEW_GET_FUN(__glewColorTableParameterfvSGI) +#define glColorTableParameterivSGI GLEW_GET_FUN(__glewColorTableParameterivSGI) +#define glColorTableSGI GLEW_GET_FUN(__glewColorTableSGI) +#define glCopyColorTableSGI GLEW_GET_FUN(__glewCopyColorTableSGI) +#define glGetColorTableParameterfvSGI GLEW_GET_FUN(__glewGetColorTableParameterfvSGI) +#define glGetColorTableParameterivSGI GLEW_GET_FUN(__glewGetColorTableParameterivSGI) +#define glGetColorTableSGI GLEW_GET_FUN(__glewGetColorTableSGI) + +#define GLEW_SGI_color_table GLEW_GET_VAR(__GLEW_SGI_color_table) + +#endif /* GL_SGI_color_table */ + +/* ----------------------- GL_SGI_texture_color_table ---------------------- */ + +#ifndef GL_SGI_texture_color_table +#define GL_SGI_texture_color_table 1 + +#define GL_TEXTURE_COLOR_TABLE_SGI 0x80BC +#define GL_PROXY_TEXTURE_COLOR_TABLE_SGI 0x80BD + +#define GLEW_SGI_texture_color_table GLEW_GET_VAR(__GLEW_SGI_texture_color_table) + +#endif /* GL_SGI_texture_color_table */ + +/* ------------------------- GL_SUNX_constant_data ------------------------- */ + +#ifndef GL_SUNX_constant_data +#define GL_SUNX_constant_data 1 + +#define GL_UNPACK_CONSTANT_DATA_SUNX 0x81D5 +#define GL_TEXTURE_CONSTANT_DATA_SUNX 0x81D6 + +typedef void (GLAPIENTRY * PFNGLFINISHTEXTURESUNXPROC) (void); + +#define glFinishTextureSUNX GLEW_GET_FUN(__glewFinishTextureSUNX) + +#define GLEW_SUNX_constant_data GLEW_GET_VAR(__GLEW_SUNX_constant_data) + +#endif /* GL_SUNX_constant_data */ + +/* -------------------- GL_SUN_convolution_border_modes -------------------- */ + +#ifndef GL_SUN_convolution_border_modes +#define GL_SUN_convolution_border_modes 1 + +#define GL_WRAP_BORDER_SUN 0x81D4 + +#define GLEW_SUN_convolution_border_modes GLEW_GET_VAR(__GLEW_SUN_convolution_border_modes) + +#endif /* GL_SUN_convolution_border_modes */ + +/* -------------------------- GL_SUN_global_alpha -------------------------- */ + +#ifndef GL_SUN_global_alpha +#define GL_SUN_global_alpha 1 + +#define GL_GLOBAL_ALPHA_SUN 0x81D9 +#define GL_GLOBAL_ALPHA_FACTOR_SUN 0x81DA + +typedef void (GLAPIENTRY * PFNGLGLOBALALPHAFACTORBSUNPROC) (GLbyte factor); +typedef void (GLAPIENTRY * PFNGLGLOBALALPHAFACTORDSUNPROC) (GLdouble factor); +typedef void (GLAPIENTRY * PFNGLGLOBALALPHAFACTORFSUNPROC) (GLfloat factor); +typedef void (GLAPIENTRY * PFNGLGLOBALALPHAFACTORISUNPROC) (GLint factor); +typedef void (GLAPIENTRY * PFNGLGLOBALALPHAFACTORSSUNPROC) (GLshort factor); +typedef void (GLAPIENTRY * PFNGLGLOBALALPHAFACTORUBSUNPROC) (GLubyte factor); +typedef void (GLAPIENTRY * PFNGLGLOBALALPHAFACTORUISUNPROC) (GLuint factor); +typedef void (GLAPIENTRY * PFNGLGLOBALALPHAFACTORUSSUNPROC) (GLushort factor); + +#define glGlobalAlphaFactorbSUN GLEW_GET_FUN(__glewGlobalAlphaFactorbSUN) +#define glGlobalAlphaFactordSUN GLEW_GET_FUN(__glewGlobalAlphaFactordSUN) +#define glGlobalAlphaFactorfSUN GLEW_GET_FUN(__glewGlobalAlphaFactorfSUN) +#define glGlobalAlphaFactoriSUN GLEW_GET_FUN(__glewGlobalAlphaFactoriSUN) +#define glGlobalAlphaFactorsSUN GLEW_GET_FUN(__glewGlobalAlphaFactorsSUN) +#define glGlobalAlphaFactorubSUN GLEW_GET_FUN(__glewGlobalAlphaFactorubSUN) +#define glGlobalAlphaFactoruiSUN GLEW_GET_FUN(__glewGlobalAlphaFactoruiSUN) +#define glGlobalAlphaFactorusSUN GLEW_GET_FUN(__glewGlobalAlphaFactorusSUN) + +#define GLEW_SUN_global_alpha GLEW_GET_VAR(__GLEW_SUN_global_alpha) + +#endif /* GL_SUN_global_alpha */ + +/* --------------------------- GL_SUN_mesh_array --------------------------- */ + +#ifndef GL_SUN_mesh_array +#define GL_SUN_mesh_array 1 + +#define GL_QUAD_MESH_SUN 0x8614 +#define GL_TRIANGLE_MESH_SUN 0x8615 + +#define GLEW_SUN_mesh_array GLEW_GET_VAR(__GLEW_SUN_mesh_array) + +#endif /* GL_SUN_mesh_array */ + +/* ------------------------ GL_SUN_read_video_pixels ----------------------- */ + +#ifndef GL_SUN_read_video_pixels +#define GL_SUN_read_video_pixels 1 + +typedef void (GLAPIENTRY * PFNGLREADVIDEOPIXELSSUNPROC) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid* pixels); + +#define glReadVideoPixelsSUN GLEW_GET_FUN(__glewReadVideoPixelsSUN) + +#define GLEW_SUN_read_video_pixels GLEW_GET_VAR(__GLEW_SUN_read_video_pixels) + +#endif /* GL_SUN_read_video_pixels */ + +/* --------------------------- GL_SUN_slice_accum -------------------------- */ + +#ifndef GL_SUN_slice_accum +#define GL_SUN_slice_accum 1 + +#define GL_SLICE_ACCUM_SUN 0x85CC + +#define GLEW_SUN_slice_accum GLEW_GET_VAR(__GLEW_SUN_slice_accum) + +#endif /* GL_SUN_slice_accum */ + +/* -------------------------- GL_SUN_triangle_list ------------------------- */ + +#ifndef GL_SUN_triangle_list +#define GL_SUN_triangle_list 1 + +#define GL_RESTART_SUN 0x01 +#define GL_REPLACE_MIDDLE_SUN 0x02 +#define GL_REPLACE_OLDEST_SUN 0x03 +#define GL_TRIANGLE_LIST_SUN 0x81D7 +#define GL_REPLACEMENT_CODE_SUN 0x81D8 +#define GL_REPLACEMENT_CODE_ARRAY_SUN 0x85C0 +#define GL_REPLACEMENT_CODE_ARRAY_TYPE_SUN 0x85C1 +#define GL_REPLACEMENT_CODE_ARRAY_STRIDE_SUN 0x85C2 +#define GL_REPLACEMENT_CODE_ARRAY_POINTER_SUN 0x85C3 +#define GL_R1UI_V3F_SUN 0x85C4 +#define GL_R1UI_C4UB_V3F_SUN 0x85C5 +#define GL_R1UI_C3F_V3F_SUN 0x85C6 +#define GL_R1UI_N3F_V3F_SUN 0x85C7 +#define GL_R1UI_C4F_N3F_V3F_SUN 0x85C8 +#define GL_R1UI_T2F_V3F_SUN 0x85C9 +#define GL_R1UI_T2F_N3F_V3F_SUN 0x85CA +#define GL_R1UI_T2F_C4F_N3F_V3F_SUN 0x85CB + +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEPOINTERSUNPROC) (GLenum type, GLsizei stride, const GLvoid *pointer); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUBSUNPROC) (GLubyte code); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUBVSUNPROC) (const GLubyte* code); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUISUNPROC) (GLuint code); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUIVSUNPROC) (const GLuint* code); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUSSUNPROC) (GLushort code); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUSVSUNPROC) (const GLushort* code); + +#define glReplacementCodePointerSUN GLEW_GET_FUN(__glewReplacementCodePointerSUN) +#define glReplacementCodeubSUN GLEW_GET_FUN(__glewReplacementCodeubSUN) +#define glReplacementCodeubvSUN GLEW_GET_FUN(__glewReplacementCodeubvSUN) +#define glReplacementCodeuiSUN GLEW_GET_FUN(__glewReplacementCodeuiSUN) +#define glReplacementCodeuivSUN GLEW_GET_FUN(__glewReplacementCodeuivSUN) +#define glReplacementCodeusSUN GLEW_GET_FUN(__glewReplacementCodeusSUN) +#define glReplacementCodeusvSUN GLEW_GET_FUN(__glewReplacementCodeusvSUN) + +#define GLEW_SUN_triangle_list GLEW_GET_VAR(__GLEW_SUN_triangle_list) + +#endif /* GL_SUN_triangle_list */ + +/* ----------------------------- GL_SUN_vertex ----------------------------- */ + +#ifndef GL_SUN_vertex +#define GL_SUN_vertex 1 + +typedef void (GLAPIENTRY * PFNGLCOLOR3FVERTEX3FSUNPROC) (GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLCOLOR3FVERTEX3FVSUNPROC) (const GLfloat* c, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat* c, const GLfloat *n, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLCOLOR4UBVERTEX2FSUNPROC) (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y); +typedef void (GLAPIENTRY * PFNGLCOLOR4UBVERTEX2FVSUNPROC) (const GLubyte* c, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLCOLOR4UBVERTEX3FSUNPROC) (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLCOLOR4UBVERTEX3FVSUNPROC) (const GLubyte* c, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLNORMAL3FVERTEX3FSUNPROC) (GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLNORMAL3FVERTEX3FVSUNPROC) (const GLfloat* n, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FSUNPROC) (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FVSUNPROC) (const GLuint* rc, const GLfloat *c, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLuint* rc, const GLfloat *c, const GLfloat *n, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FSUNPROC) (GLuint rc, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FVSUNPROC) (const GLuint* rc, const GLubyte *c, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FVSUNPROC) (const GLuint* rc, const GLfloat *n, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLuint* rc, const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FVSUNPROC) (const GLuint* rc, const GLfloat *tc, const GLfloat *n, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FVSUNPROC) (const GLuint* rc, const GLfloat *tc, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUIVERTEX3FSUNPROC) (GLuint rc, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUIVERTEX3FVSUNPROC) (const GLuint* rc, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLTEXCOORD2FCOLOR3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLTEXCOORD2FCOLOR3FVERTEX3FVSUNPROC) (const GLfloat* tc, const GLfloat *c, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat* tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLTEXCOORD2FCOLOR4UBVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLTEXCOORD2FCOLOR4UBVERTEX3FVSUNPROC) (const GLfloat* tc, const GLubyte *c, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLTEXCOORD2FNORMAL3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLTEXCOORD2FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat* tc, const GLfloat *n, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLTEXCOORD2FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLTEXCOORD2FVERTEX3FVSUNPROC) (const GLfloat* tc, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FSUNPROC) (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (GLAPIENTRY * PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FVSUNPROC) (const GLfloat* tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLTEXCOORD4FVERTEX4FSUNPROC) (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (GLAPIENTRY * PFNGLTEXCOORD4FVERTEX4FVSUNPROC) (const GLfloat* tc, const GLfloat *v); + +#define glColor3fVertex3fSUN GLEW_GET_FUN(__glewColor3fVertex3fSUN) +#define glColor3fVertex3fvSUN GLEW_GET_FUN(__glewColor3fVertex3fvSUN) +#define glColor4fNormal3fVertex3fSUN GLEW_GET_FUN(__glewColor4fNormal3fVertex3fSUN) +#define glColor4fNormal3fVertex3fvSUN GLEW_GET_FUN(__glewColor4fNormal3fVertex3fvSUN) +#define glColor4ubVertex2fSUN GLEW_GET_FUN(__glewColor4ubVertex2fSUN) +#define glColor4ubVertex2fvSUN GLEW_GET_FUN(__glewColor4ubVertex2fvSUN) +#define glColor4ubVertex3fSUN GLEW_GET_FUN(__glewColor4ubVertex3fSUN) +#define glColor4ubVertex3fvSUN GLEW_GET_FUN(__glewColor4ubVertex3fvSUN) +#define glNormal3fVertex3fSUN GLEW_GET_FUN(__glewNormal3fVertex3fSUN) +#define glNormal3fVertex3fvSUN GLEW_GET_FUN(__glewNormal3fVertex3fvSUN) +#define glReplacementCodeuiColor3fVertex3fSUN GLEW_GET_FUN(__glewReplacementCodeuiColor3fVertex3fSUN) +#define glReplacementCodeuiColor3fVertex3fvSUN GLEW_GET_FUN(__glewReplacementCodeuiColor3fVertex3fvSUN) +#define glReplacementCodeuiColor4fNormal3fVertex3fSUN GLEW_GET_FUN(__glewReplacementCodeuiColor4fNormal3fVertex3fSUN) +#define glReplacementCodeuiColor4fNormal3fVertex3fvSUN GLEW_GET_FUN(__glewReplacementCodeuiColor4fNormal3fVertex3fvSUN) +#define glReplacementCodeuiColor4ubVertex3fSUN GLEW_GET_FUN(__glewReplacementCodeuiColor4ubVertex3fSUN) +#define glReplacementCodeuiColor4ubVertex3fvSUN GLEW_GET_FUN(__glewReplacementCodeuiColor4ubVertex3fvSUN) +#define glReplacementCodeuiNormal3fVertex3fSUN GLEW_GET_FUN(__glewReplacementCodeuiNormal3fVertex3fSUN) +#define glReplacementCodeuiNormal3fVertex3fvSUN GLEW_GET_FUN(__glewReplacementCodeuiNormal3fVertex3fvSUN) +#define glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN GLEW_GET_FUN(__glewReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN) +#define glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN GLEW_GET_FUN(__glewReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN) +#define glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN GLEW_GET_FUN(__glewReplacementCodeuiTexCoord2fNormal3fVertex3fSUN) +#define glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN GLEW_GET_FUN(__glewReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN) +#define glReplacementCodeuiTexCoord2fVertex3fSUN GLEW_GET_FUN(__glewReplacementCodeuiTexCoord2fVertex3fSUN) +#define glReplacementCodeuiTexCoord2fVertex3fvSUN GLEW_GET_FUN(__glewReplacementCodeuiTexCoord2fVertex3fvSUN) +#define glReplacementCodeuiVertex3fSUN GLEW_GET_FUN(__glewReplacementCodeuiVertex3fSUN) +#define glReplacementCodeuiVertex3fvSUN GLEW_GET_FUN(__glewReplacementCodeuiVertex3fvSUN) +#define glTexCoord2fColor3fVertex3fSUN GLEW_GET_FUN(__glewTexCoord2fColor3fVertex3fSUN) +#define glTexCoord2fColor3fVertex3fvSUN GLEW_GET_FUN(__glewTexCoord2fColor3fVertex3fvSUN) +#define glTexCoord2fColor4fNormal3fVertex3fSUN GLEW_GET_FUN(__glewTexCoord2fColor4fNormal3fVertex3fSUN) +#define glTexCoord2fColor4fNormal3fVertex3fvSUN GLEW_GET_FUN(__glewTexCoord2fColor4fNormal3fVertex3fvSUN) +#define glTexCoord2fColor4ubVertex3fSUN GLEW_GET_FUN(__glewTexCoord2fColor4ubVertex3fSUN) +#define glTexCoord2fColor4ubVertex3fvSUN GLEW_GET_FUN(__glewTexCoord2fColor4ubVertex3fvSUN) +#define glTexCoord2fNormal3fVertex3fSUN GLEW_GET_FUN(__glewTexCoord2fNormal3fVertex3fSUN) +#define glTexCoord2fNormal3fVertex3fvSUN GLEW_GET_FUN(__glewTexCoord2fNormal3fVertex3fvSUN) +#define glTexCoord2fVertex3fSUN GLEW_GET_FUN(__glewTexCoord2fVertex3fSUN) +#define glTexCoord2fVertex3fvSUN GLEW_GET_FUN(__glewTexCoord2fVertex3fvSUN) +#define glTexCoord4fColor4fNormal3fVertex4fSUN GLEW_GET_FUN(__glewTexCoord4fColor4fNormal3fVertex4fSUN) +#define glTexCoord4fColor4fNormal3fVertex4fvSUN GLEW_GET_FUN(__glewTexCoord4fColor4fNormal3fVertex4fvSUN) +#define glTexCoord4fVertex4fSUN GLEW_GET_FUN(__glewTexCoord4fVertex4fSUN) +#define glTexCoord4fVertex4fvSUN GLEW_GET_FUN(__glewTexCoord4fVertex4fvSUN) + +#define GLEW_SUN_vertex GLEW_GET_VAR(__GLEW_SUN_vertex) + +#endif /* GL_SUN_vertex */ + +/* -------------------------- GL_WIN_phong_shading ------------------------- */ + +#ifndef GL_WIN_phong_shading +#define GL_WIN_phong_shading 1 + +#define GL_PHONG_WIN 0x80EA +#define GL_PHONG_HINT_WIN 0x80EB + +#define GLEW_WIN_phong_shading GLEW_GET_VAR(__GLEW_WIN_phong_shading) + +#endif /* GL_WIN_phong_shading */ + +/* -------------------------- GL_WIN_specular_fog -------------------------- */ + +#ifndef GL_WIN_specular_fog +#define GL_WIN_specular_fog 1 + +#define GL_FOG_SPECULAR_TEXTURE_WIN 0x80EC + +#define GLEW_WIN_specular_fog GLEW_GET_VAR(__GLEW_WIN_specular_fog) + +#endif /* GL_WIN_specular_fog */ + +/* ---------------------------- GL_WIN_swap_hint --------------------------- */ + +#ifndef GL_WIN_swap_hint +#define GL_WIN_swap_hint 1 + +typedef void (GLAPIENTRY * PFNGLADDSWAPHINTRECTWINPROC) (GLint x, GLint y, GLsizei width, GLsizei height); + +#define glAddSwapHintRectWIN GLEW_GET_FUN(__glewAddSwapHintRectWIN) + +#define GLEW_WIN_swap_hint GLEW_GET_VAR(__GLEW_WIN_swap_hint) + +#endif /* GL_WIN_swap_hint */ + +/* ------------------------------------------------------------------------- */ + +#if defined(GLEW_MX) && defined(_WIN32) +#define GLEW_FUN_EXPORT +#else +#define GLEW_FUN_EXPORT GLEWAPI +#endif /* GLEW_MX */ + +#if defined(GLEW_MX) +#define GLEW_VAR_EXPORT +#else +#define GLEW_VAR_EXPORT GLEWAPI +#endif /* GLEW_MX */ + +#if defined(GLEW_MX) && defined(_WIN32) +struct GLEWContextStruct +{ +#endif /* GLEW_MX */ + +GLEW_FUN_EXPORT PFNGLCOPYTEXSUBIMAGE3DPROC __glewCopyTexSubImage3D; +GLEW_FUN_EXPORT PFNGLDRAWRANGEELEMENTSPROC __glewDrawRangeElements; +GLEW_FUN_EXPORT PFNGLTEXIMAGE3DPROC __glewTexImage3D; +GLEW_FUN_EXPORT PFNGLTEXSUBIMAGE3DPROC __glewTexSubImage3D; + +GLEW_FUN_EXPORT PFNGLACTIVETEXTUREPROC __glewActiveTexture; +GLEW_FUN_EXPORT PFNGLCLIENTACTIVETEXTUREPROC __glewClientActiveTexture; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXIMAGE1DPROC __glewCompressedTexImage1D; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXIMAGE2DPROC __glewCompressedTexImage2D; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXIMAGE3DPROC __glewCompressedTexImage3D; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC __glewCompressedTexSubImage1D; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC __glewCompressedTexSubImage2D; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC __glewCompressedTexSubImage3D; +GLEW_FUN_EXPORT PFNGLGETCOMPRESSEDTEXIMAGEPROC __glewGetCompressedTexImage; +GLEW_FUN_EXPORT PFNGLLOADTRANSPOSEMATRIXDPROC __glewLoadTransposeMatrixd; +GLEW_FUN_EXPORT PFNGLLOADTRANSPOSEMATRIXFPROC __glewLoadTransposeMatrixf; +GLEW_FUN_EXPORT PFNGLMULTTRANSPOSEMATRIXDPROC __glewMultTransposeMatrixd; +GLEW_FUN_EXPORT PFNGLMULTTRANSPOSEMATRIXFPROC __glewMultTransposeMatrixf; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1DPROC __glewMultiTexCoord1d; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1DVPROC __glewMultiTexCoord1dv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1FPROC __glewMultiTexCoord1f; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1FVPROC __glewMultiTexCoord1fv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1IPROC __glewMultiTexCoord1i; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1IVPROC __glewMultiTexCoord1iv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1SPROC __glewMultiTexCoord1s; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1SVPROC __glewMultiTexCoord1sv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2DPROC __glewMultiTexCoord2d; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2DVPROC __glewMultiTexCoord2dv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2FPROC __glewMultiTexCoord2f; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2FVPROC __glewMultiTexCoord2fv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2IPROC __glewMultiTexCoord2i; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2IVPROC __glewMultiTexCoord2iv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2SPROC __glewMultiTexCoord2s; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2SVPROC __glewMultiTexCoord2sv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3DPROC __glewMultiTexCoord3d; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3DVPROC __glewMultiTexCoord3dv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3FPROC __glewMultiTexCoord3f; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3FVPROC __glewMultiTexCoord3fv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3IPROC __glewMultiTexCoord3i; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3IVPROC __glewMultiTexCoord3iv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3SPROC __glewMultiTexCoord3s; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3SVPROC __glewMultiTexCoord3sv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4DPROC __glewMultiTexCoord4d; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4DVPROC __glewMultiTexCoord4dv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4FPROC __glewMultiTexCoord4f; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4FVPROC __glewMultiTexCoord4fv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4IPROC __glewMultiTexCoord4i; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4IVPROC __glewMultiTexCoord4iv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4SPROC __glewMultiTexCoord4s; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4SVPROC __glewMultiTexCoord4sv; +GLEW_FUN_EXPORT PFNGLSAMPLECOVERAGEPROC __glewSampleCoverage; + +GLEW_FUN_EXPORT PFNGLBLENDCOLORPROC __glewBlendColor; +GLEW_FUN_EXPORT PFNGLBLENDEQUATIONPROC __glewBlendEquation; +GLEW_FUN_EXPORT PFNGLBLENDFUNCSEPARATEPROC __glewBlendFuncSeparate; +GLEW_FUN_EXPORT PFNGLFOGCOORDPOINTERPROC __glewFogCoordPointer; +GLEW_FUN_EXPORT PFNGLFOGCOORDDPROC __glewFogCoordd; +GLEW_FUN_EXPORT PFNGLFOGCOORDDVPROC __glewFogCoorddv; +GLEW_FUN_EXPORT PFNGLFOGCOORDFPROC __glewFogCoordf; +GLEW_FUN_EXPORT PFNGLFOGCOORDFVPROC __glewFogCoordfv; +GLEW_FUN_EXPORT PFNGLMULTIDRAWARRAYSPROC __glewMultiDrawArrays; +GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTSPROC __glewMultiDrawElements; +GLEW_FUN_EXPORT PFNGLPOINTPARAMETERFPROC __glewPointParameterf; +GLEW_FUN_EXPORT PFNGLPOINTPARAMETERFVPROC __glewPointParameterfv; +GLEW_FUN_EXPORT PFNGLPOINTPARAMETERIPROC __glewPointParameteri; +GLEW_FUN_EXPORT PFNGLPOINTPARAMETERIVPROC __glewPointParameteriv; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3BPROC __glewSecondaryColor3b; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3BVPROC __glewSecondaryColor3bv; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3DPROC __glewSecondaryColor3d; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3DVPROC __glewSecondaryColor3dv; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3FPROC __glewSecondaryColor3f; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3FVPROC __glewSecondaryColor3fv; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3IPROC __glewSecondaryColor3i; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3IVPROC __glewSecondaryColor3iv; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3SPROC __glewSecondaryColor3s; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3SVPROC __glewSecondaryColor3sv; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UBPROC __glewSecondaryColor3ub; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UBVPROC __glewSecondaryColor3ubv; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UIPROC __glewSecondaryColor3ui; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UIVPROC __glewSecondaryColor3uiv; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3USPROC __glewSecondaryColor3us; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3USVPROC __glewSecondaryColor3usv; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLORPOINTERPROC __glewSecondaryColorPointer; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2DPROC __glewWindowPos2d; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2DVPROC __glewWindowPos2dv; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2FPROC __glewWindowPos2f; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2FVPROC __glewWindowPos2fv; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2IPROC __glewWindowPos2i; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2IVPROC __glewWindowPos2iv; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2SPROC __glewWindowPos2s; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2SVPROC __glewWindowPos2sv; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3DPROC __glewWindowPos3d; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3DVPROC __glewWindowPos3dv; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3FPROC __glewWindowPos3f; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3FVPROC __glewWindowPos3fv; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3IPROC __glewWindowPos3i; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3IVPROC __glewWindowPos3iv; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3SPROC __glewWindowPos3s; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3SVPROC __glewWindowPos3sv; + +GLEW_FUN_EXPORT PFNGLBEGINQUERYPROC __glewBeginQuery; +GLEW_FUN_EXPORT PFNGLBINDBUFFERPROC __glewBindBuffer; +GLEW_FUN_EXPORT PFNGLBUFFERDATAPROC __glewBufferData; +GLEW_FUN_EXPORT PFNGLBUFFERSUBDATAPROC __glewBufferSubData; +GLEW_FUN_EXPORT PFNGLDELETEBUFFERSPROC __glewDeleteBuffers; +GLEW_FUN_EXPORT PFNGLDELETEQUERIESPROC __glewDeleteQueries; +GLEW_FUN_EXPORT PFNGLENDQUERYPROC __glewEndQuery; +GLEW_FUN_EXPORT PFNGLGENBUFFERSPROC __glewGenBuffers; +GLEW_FUN_EXPORT PFNGLGENQUERIESPROC __glewGenQueries; +GLEW_FUN_EXPORT PFNGLGETBUFFERPARAMETERIVPROC __glewGetBufferParameteriv; +GLEW_FUN_EXPORT PFNGLGETBUFFERPOINTERVPROC __glewGetBufferPointerv; +GLEW_FUN_EXPORT PFNGLGETBUFFERSUBDATAPROC __glewGetBufferSubData; +GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTIVPROC __glewGetQueryObjectiv; +GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTUIVPROC __glewGetQueryObjectuiv; +GLEW_FUN_EXPORT PFNGLGETQUERYIVPROC __glewGetQueryiv; +GLEW_FUN_EXPORT PFNGLISBUFFERPROC __glewIsBuffer; +GLEW_FUN_EXPORT PFNGLISQUERYPROC __glewIsQuery; +GLEW_FUN_EXPORT PFNGLMAPBUFFERPROC __glewMapBuffer; +GLEW_FUN_EXPORT PFNGLUNMAPBUFFERPROC __glewUnmapBuffer; + +GLEW_FUN_EXPORT PFNGLATTACHSHADERPROC __glewAttachShader; +GLEW_FUN_EXPORT PFNGLBINDATTRIBLOCATIONPROC __glewBindAttribLocation; +GLEW_FUN_EXPORT PFNGLBLENDEQUATIONSEPARATEPROC __glewBlendEquationSeparate; +GLEW_FUN_EXPORT PFNGLCOMPILESHADERPROC __glewCompileShader; +GLEW_FUN_EXPORT PFNGLCREATEPROGRAMPROC __glewCreateProgram; +GLEW_FUN_EXPORT PFNGLCREATESHADERPROC __glewCreateShader; +GLEW_FUN_EXPORT PFNGLDELETEPROGRAMPROC __glewDeleteProgram; +GLEW_FUN_EXPORT PFNGLDELETESHADERPROC __glewDeleteShader; +GLEW_FUN_EXPORT PFNGLDETACHSHADERPROC __glewDetachShader; +GLEW_FUN_EXPORT PFNGLDISABLEVERTEXATTRIBARRAYPROC __glewDisableVertexAttribArray; +GLEW_FUN_EXPORT PFNGLDRAWBUFFERSPROC __glewDrawBuffers; +GLEW_FUN_EXPORT PFNGLENABLEVERTEXATTRIBARRAYPROC __glewEnableVertexAttribArray; +GLEW_FUN_EXPORT PFNGLGETACTIVEATTRIBPROC __glewGetActiveAttrib; +GLEW_FUN_EXPORT PFNGLGETACTIVEUNIFORMPROC __glewGetActiveUniform; +GLEW_FUN_EXPORT PFNGLGETATTACHEDSHADERSPROC __glewGetAttachedShaders; +GLEW_FUN_EXPORT PFNGLGETATTRIBLOCATIONPROC __glewGetAttribLocation; +GLEW_FUN_EXPORT PFNGLGETPROGRAMINFOLOGPROC __glewGetProgramInfoLog; +GLEW_FUN_EXPORT PFNGLGETPROGRAMIVPROC __glewGetProgramiv; +GLEW_FUN_EXPORT PFNGLGETSHADERINFOLOGPROC __glewGetShaderInfoLog; +GLEW_FUN_EXPORT PFNGLGETSHADERSOURCEPROC __glewGetShaderSource; +GLEW_FUN_EXPORT PFNGLGETSHADERIVPROC __glewGetShaderiv; +GLEW_FUN_EXPORT PFNGLGETUNIFORMLOCATIONPROC __glewGetUniformLocation; +GLEW_FUN_EXPORT PFNGLGETUNIFORMFVPROC __glewGetUniformfv; +GLEW_FUN_EXPORT PFNGLGETUNIFORMIVPROC __glewGetUniformiv; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBPOINTERVPROC __glewGetVertexAttribPointerv; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBDVPROC __glewGetVertexAttribdv; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBFVPROC __glewGetVertexAttribfv; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBIVPROC __glewGetVertexAttribiv; +GLEW_FUN_EXPORT PFNGLISPROGRAMPROC __glewIsProgram; +GLEW_FUN_EXPORT PFNGLISSHADERPROC __glewIsShader; +GLEW_FUN_EXPORT PFNGLLINKPROGRAMPROC __glewLinkProgram; +GLEW_FUN_EXPORT PFNGLSHADERSOURCEPROC __glewShaderSource; +GLEW_FUN_EXPORT PFNGLSTENCILFUNCSEPARATEPROC __glewStencilFuncSeparate; +GLEW_FUN_EXPORT PFNGLSTENCILMASKSEPARATEPROC __glewStencilMaskSeparate; +GLEW_FUN_EXPORT PFNGLSTENCILOPSEPARATEPROC __glewStencilOpSeparate; +GLEW_FUN_EXPORT PFNGLUNIFORM1FPROC __glewUniform1f; +GLEW_FUN_EXPORT PFNGLUNIFORM1FVPROC __glewUniform1fv; +GLEW_FUN_EXPORT PFNGLUNIFORM1IPROC __glewUniform1i; +GLEW_FUN_EXPORT PFNGLUNIFORM1IVPROC __glewUniform1iv; +GLEW_FUN_EXPORT PFNGLUNIFORM2FPROC __glewUniform2f; +GLEW_FUN_EXPORT PFNGLUNIFORM2FVPROC __glewUniform2fv; +GLEW_FUN_EXPORT PFNGLUNIFORM2IPROC __glewUniform2i; +GLEW_FUN_EXPORT PFNGLUNIFORM2IVPROC __glewUniform2iv; +GLEW_FUN_EXPORT PFNGLUNIFORM3FPROC __glewUniform3f; +GLEW_FUN_EXPORT PFNGLUNIFORM3FVPROC __glewUniform3fv; +GLEW_FUN_EXPORT PFNGLUNIFORM3IPROC __glewUniform3i; +GLEW_FUN_EXPORT PFNGLUNIFORM3IVPROC __glewUniform3iv; +GLEW_FUN_EXPORT PFNGLUNIFORM4FPROC __glewUniform4f; +GLEW_FUN_EXPORT PFNGLUNIFORM4FVPROC __glewUniform4fv; +GLEW_FUN_EXPORT PFNGLUNIFORM4IPROC __glewUniform4i; +GLEW_FUN_EXPORT PFNGLUNIFORM4IVPROC __glewUniform4iv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX2FVPROC __glewUniformMatrix2fv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX3FVPROC __glewUniformMatrix3fv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX4FVPROC __glewUniformMatrix4fv; +GLEW_FUN_EXPORT PFNGLUSEPROGRAMPROC __glewUseProgram; +GLEW_FUN_EXPORT PFNGLVALIDATEPROGRAMPROC __glewValidateProgram; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1DPROC __glewVertexAttrib1d; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1DVPROC __glewVertexAttrib1dv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1FPROC __glewVertexAttrib1f; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1FVPROC __glewVertexAttrib1fv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1SPROC __glewVertexAttrib1s; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1SVPROC __glewVertexAttrib1sv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2DPROC __glewVertexAttrib2d; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2DVPROC __glewVertexAttrib2dv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2FPROC __glewVertexAttrib2f; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2FVPROC __glewVertexAttrib2fv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2SPROC __glewVertexAttrib2s; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2SVPROC __glewVertexAttrib2sv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3DPROC __glewVertexAttrib3d; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3DVPROC __glewVertexAttrib3dv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3FPROC __glewVertexAttrib3f; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3FVPROC __glewVertexAttrib3fv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3SPROC __glewVertexAttrib3s; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3SVPROC __glewVertexAttrib3sv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NBVPROC __glewVertexAttrib4Nbv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NIVPROC __glewVertexAttrib4Niv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NSVPROC __glewVertexAttrib4Nsv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUBPROC __glewVertexAttrib4Nub; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUBVPROC __glewVertexAttrib4Nubv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUIVPROC __glewVertexAttrib4Nuiv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUSVPROC __glewVertexAttrib4Nusv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4BVPROC __glewVertexAttrib4bv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4DPROC __glewVertexAttrib4d; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4DVPROC __glewVertexAttrib4dv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4FPROC __glewVertexAttrib4f; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4FVPROC __glewVertexAttrib4fv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4IVPROC __glewVertexAttrib4iv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4SPROC __glewVertexAttrib4s; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4SVPROC __glewVertexAttrib4sv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4UBVPROC __glewVertexAttrib4ubv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4UIVPROC __glewVertexAttrib4uiv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4USVPROC __glewVertexAttrib4usv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBPOINTERPROC __glewVertexAttribPointer; + +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX2X3FVPROC __glewUniformMatrix2x3fv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX2X4FVPROC __glewUniformMatrix2x4fv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX3X2FVPROC __glewUniformMatrix3x2fv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX3X4FVPROC __glewUniformMatrix3x4fv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX4X2FVPROC __glewUniformMatrix4x2fv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX4X3FVPROC __glewUniformMatrix4x3fv; + +GLEW_FUN_EXPORT PFNGLBEGINCONDITIONALRENDERPROC __glewBeginConditionalRender; +GLEW_FUN_EXPORT PFNGLBEGINTRANSFORMFEEDBACKPROC __glewBeginTransformFeedback; +GLEW_FUN_EXPORT PFNGLBINDFRAGDATALOCATIONPROC __glewBindFragDataLocation; +GLEW_FUN_EXPORT PFNGLCLAMPCOLORPROC __glewClampColor; +GLEW_FUN_EXPORT PFNGLCLEARBUFFERFIPROC __glewClearBufferfi; +GLEW_FUN_EXPORT PFNGLCLEARBUFFERFVPROC __glewClearBufferfv; +GLEW_FUN_EXPORT PFNGLCLEARBUFFERIVPROC __glewClearBufferiv; +GLEW_FUN_EXPORT PFNGLCLEARBUFFERUIVPROC __glewClearBufferuiv; +GLEW_FUN_EXPORT PFNGLCOLORMASKIPROC __glewColorMaski; +GLEW_FUN_EXPORT PFNGLDISABLEIPROC __glewDisablei; +GLEW_FUN_EXPORT PFNGLENABLEIPROC __glewEnablei; +GLEW_FUN_EXPORT PFNGLENDCONDITIONALRENDERPROC __glewEndConditionalRender; +GLEW_FUN_EXPORT PFNGLENDTRANSFORMFEEDBACKPROC __glewEndTransformFeedback; +GLEW_FUN_EXPORT PFNGLGETBOOLEANI_VPROC __glewGetBooleani_v; +GLEW_FUN_EXPORT PFNGLGETFRAGDATALOCATIONPROC __glewGetFragDataLocation; +GLEW_FUN_EXPORT PFNGLGETSTRINGIPROC __glewGetStringi; +GLEW_FUN_EXPORT PFNGLGETTEXPARAMETERIIVPROC __glewGetTexParameterIiv; +GLEW_FUN_EXPORT PFNGLGETTEXPARAMETERIUIVPROC __glewGetTexParameterIuiv; +GLEW_FUN_EXPORT PFNGLGETTRANSFORMFEEDBACKVARYINGPROC __glewGetTransformFeedbackVarying; +GLEW_FUN_EXPORT PFNGLGETUNIFORMUIVPROC __glewGetUniformuiv; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBIIVPROC __glewGetVertexAttribIiv; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBIUIVPROC __glewGetVertexAttribIuiv; +GLEW_FUN_EXPORT PFNGLISENABLEDIPROC __glewIsEnabledi; +GLEW_FUN_EXPORT PFNGLTEXPARAMETERIIVPROC __glewTexParameterIiv; +GLEW_FUN_EXPORT PFNGLTEXPARAMETERIUIVPROC __glewTexParameterIuiv; +GLEW_FUN_EXPORT PFNGLTRANSFORMFEEDBACKVARYINGSPROC __glewTransformFeedbackVaryings; +GLEW_FUN_EXPORT PFNGLUNIFORM1UIPROC __glewUniform1ui; +GLEW_FUN_EXPORT PFNGLUNIFORM1UIVPROC __glewUniform1uiv; +GLEW_FUN_EXPORT PFNGLUNIFORM2UIPROC __glewUniform2ui; +GLEW_FUN_EXPORT PFNGLUNIFORM2UIVPROC __glewUniform2uiv; +GLEW_FUN_EXPORT PFNGLUNIFORM3UIPROC __glewUniform3ui; +GLEW_FUN_EXPORT PFNGLUNIFORM3UIVPROC __glewUniform3uiv; +GLEW_FUN_EXPORT PFNGLUNIFORM4UIPROC __glewUniform4ui; +GLEW_FUN_EXPORT PFNGLUNIFORM4UIVPROC __glewUniform4uiv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI1IPROC __glewVertexAttribI1i; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI1IVPROC __glewVertexAttribI1iv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI1UIPROC __glewVertexAttribI1ui; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI1UIVPROC __glewVertexAttribI1uiv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI2IPROC __glewVertexAttribI2i; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI2IVPROC __glewVertexAttribI2iv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI2UIPROC __glewVertexAttribI2ui; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI2UIVPROC __glewVertexAttribI2uiv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI3IPROC __glewVertexAttribI3i; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI3IVPROC __glewVertexAttribI3iv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI3UIPROC __glewVertexAttribI3ui; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI3UIVPROC __glewVertexAttribI3uiv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4BVPROC __glewVertexAttribI4bv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4IPROC __glewVertexAttribI4i; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4IVPROC __glewVertexAttribI4iv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4SVPROC __glewVertexAttribI4sv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4UBVPROC __glewVertexAttribI4ubv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4UIPROC __glewVertexAttribI4ui; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4UIVPROC __glewVertexAttribI4uiv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4USVPROC __glewVertexAttribI4usv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBIPOINTERPROC __glewVertexAttribIPointer; + +GLEW_FUN_EXPORT PFNGLDRAWARRAYSINSTANCEDPROC __glewDrawArraysInstanced; +GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDPROC __glewDrawElementsInstanced; +GLEW_FUN_EXPORT PFNGLPRIMITIVERESTARTINDEXPROC __glewPrimitiveRestartIndex; +GLEW_FUN_EXPORT PFNGLTEXBUFFERPROC __glewTexBuffer; + +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTUREPROC __glewFramebufferTexture; +GLEW_FUN_EXPORT PFNGLGETBUFFERPARAMETERI64VPROC __glewGetBufferParameteri64v; +GLEW_FUN_EXPORT PFNGLGETINTEGER64I_VPROC __glewGetInteger64i_v; + +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBDIVISORPROC __glewVertexAttribDivisor; + +GLEW_FUN_EXPORT PFNGLBLENDEQUATIONSEPARATEIPROC __glewBlendEquationSeparatei; +GLEW_FUN_EXPORT PFNGLBLENDEQUATIONIPROC __glewBlendEquationi; +GLEW_FUN_EXPORT PFNGLBLENDFUNCSEPARATEIPROC __glewBlendFuncSeparatei; +GLEW_FUN_EXPORT PFNGLBLENDFUNCIPROC __glewBlendFunci; +GLEW_FUN_EXPORT PFNGLMINSAMPLESHADINGPROC __glewMinSampleShading; + +GLEW_FUN_EXPORT PFNGLTBUFFERMASK3DFXPROC __glewTbufferMask3DFX; + +GLEW_FUN_EXPORT PFNGLDEBUGMESSAGECALLBACKAMDPROC __glewDebugMessageCallbackAMD; +GLEW_FUN_EXPORT PFNGLDEBUGMESSAGEENABLEAMDPROC __glewDebugMessageEnableAMD; +GLEW_FUN_EXPORT PFNGLDEBUGMESSAGEINSERTAMDPROC __glewDebugMessageInsertAMD; +GLEW_FUN_EXPORT PFNGLGETDEBUGMESSAGELOGAMDPROC __glewGetDebugMessageLogAMD; + +GLEW_FUN_EXPORT PFNGLBLENDEQUATIONINDEXEDAMDPROC __glewBlendEquationIndexedAMD; +GLEW_FUN_EXPORT PFNGLBLENDEQUATIONSEPARATEINDEXEDAMDPROC __glewBlendEquationSeparateIndexedAMD; +GLEW_FUN_EXPORT PFNGLBLENDFUNCINDEXEDAMDPROC __glewBlendFuncIndexedAMD; +GLEW_FUN_EXPORT PFNGLBLENDFUNCSEPARATEINDEXEDAMDPROC __glewBlendFuncSeparateIndexedAMD; + +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBPARAMETERIAMDPROC __glewVertexAttribParameteriAMD; + +GLEW_FUN_EXPORT PFNGLMULTIDRAWARRAYSINDIRECTAMDPROC __glewMultiDrawArraysIndirectAMD; +GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTSINDIRECTAMDPROC __glewMultiDrawElementsIndirectAMD; + +GLEW_FUN_EXPORT PFNGLDELETENAMESAMDPROC __glewDeleteNamesAMD; +GLEW_FUN_EXPORT PFNGLGENNAMESAMDPROC __glewGenNamesAMD; +GLEW_FUN_EXPORT PFNGLISNAMEAMDPROC __glewIsNameAMD; + +GLEW_FUN_EXPORT PFNGLBEGINPERFMONITORAMDPROC __glewBeginPerfMonitorAMD; +GLEW_FUN_EXPORT PFNGLDELETEPERFMONITORSAMDPROC __glewDeletePerfMonitorsAMD; +GLEW_FUN_EXPORT PFNGLENDPERFMONITORAMDPROC __glewEndPerfMonitorAMD; +GLEW_FUN_EXPORT PFNGLGENPERFMONITORSAMDPROC __glewGenPerfMonitorsAMD; +GLEW_FUN_EXPORT PFNGLGETPERFMONITORCOUNTERDATAAMDPROC __glewGetPerfMonitorCounterDataAMD; +GLEW_FUN_EXPORT PFNGLGETPERFMONITORCOUNTERINFOAMDPROC __glewGetPerfMonitorCounterInfoAMD; +GLEW_FUN_EXPORT PFNGLGETPERFMONITORCOUNTERSTRINGAMDPROC __glewGetPerfMonitorCounterStringAMD; +GLEW_FUN_EXPORT PFNGLGETPERFMONITORCOUNTERSAMDPROC __glewGetPerfMonitorCountersAMD; +GLEW_FUN_EXPORT PFNGLGETPERFMONITORGROUPSTRINGAMDPROC __glewGetPerfMonitorGroupStringAMD; +GLEW_FUN_EXPORT PFNGLGETPERFMONITORGROUPSAMDPROC __glewGetPerfMonitorGroupsAMD; +GLEW_FUN_EXPORT PFNGLSELECTPERFMONITORCOUNTERSAMDPROC __glewSelectPerfMonitorCountersAMD; + +GLEW_FUN_EXPORT PFNGLSETMULTISAMPLEFVAMDPROC __glewSetMultisamplefvAMD; + +GLEW_FUN_EXPORT PFNGLTEXSTORAGESPARSEAMDPROC __glewTexStorageSparseAMD; +GLEW_FUN_EXPORT PFNGLTEXTURESTORAGESPARSEAMDPROC __glewTextureStorageSparseAMD; + +GLEW_FUN_EXPORT PFNGLSTENCILOPVALUEAMDPROC __glewStencilOpValueAMD; + +GLEW_FUN_EXPORT PFNGLTESSELLATIONFACTORAMDPROC __glewTessellationFactorAMD; +GLEW_FUN_EXPORT PFNGLTESSELLATIONMODEAMDPROC __glewTessellationModeAMD; + +GLEW_FUN_EXPORT PFNGLBLITFRAMEBUFFERANGLEPROC __glewBlitFramebufferANGLE; + +GLEW_FUN_EXPORT PFNGLRENDERBUFFERSTORAGEMULTISAMPLEANGLEPROC __glewRenderbufferStorageMultisampleANGLE; + +GLEW_FUN_EXPORT PFNGLDRAWARRAYSINSTANCEDANGLEPROC __glewDrawArraysInstancedANGLE; +GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDANGLEPROC __glewDrawElementsInstancedANGLE; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBDIVISORANGLEPROC __glewVertexAttribDivisorANGLE; + +GLEW_FUN_EXPORT PFNGLBEGINQUERYANGLEPROC __glewBeginQueryANGLE; +GLEW_FUN_EXPORT PFNGLDELETEQUERIESANGLEPROC __glewDeleteQueriesANGLE; +GLEW_FUN_EXPORT PFNGLENDQUERYANGLEPROC __glewEndQueryANGLE; +GLEW_FUN_EXPORT PFNGLGENQUERIESANGLEPROC __glewGenQueriesANGLE; +GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTI64VANGLEPROC __glewGetQueryObjecti64vANGLE; +GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTIVANGLEPROC __glewGetQueryObjectivANGLE; +GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTUI64VANGLEPROC __glewGetQueryObjectui64vANGLE; +GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTUIVANGLEPROC __glewGetQueryObjectuivANGLE; +GLEW_FUN_EXPORT PFNGLGETQUERYIVANGLEPROC __glewGetQueryivANGLE; +GLEW_FUN_EXPORT PFNGLISQUERYANGLEPROC __glewIsQueryANGLE; +GLEW_FUN_EXPORT PFNGLQUERYCOUNTERANGLEPROC __glewQueryCounterANGLE; + +GLEW_FUN_EXPORT PFNGLGETTRANSLATEDSHADERSOURCEANGLEPROC __glewGetTranslatedShaderSourceANGLE; + +GLEW_FUN_EXPORT PFNGLDRAWELEMENTARRAYAPPLEPROC __glewDrawElementArrayAPPLE; +GLEW_FUN_EXPORT PFNGLDRAWRANGEELEMENTARRAYAPPLEPROC __glewDrawRangeElementArrayAPPLE; +GLEW_FUN_EXPORT PFNGLELEMENTPOINTERAPPLEPROC __glewElementPointerAPPLE; +GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTARRAYAPPLEPROC __glewMultiDrawElementArrayAPPLE; +GLEW_FUN_EXPORT PFNGLMULTIDRAWRANGEELEMENTARRAYAPPLEPROC __glewMultiDrawRangeElementArrayAPPLE; + +GLEW_FUN_EXPORT PFNGLDELETEFENCESAPPLEPROC __glewDeleteFencesAPPLE; +GLEW_FUN_EXPORT PFNGLFINISHFENCEAPPLEPROC __glewFinishFenceAPPLE; +GLEW_FUN_EXPORT PFNGLFINISHOBJECTAPPLEPROC __glewFinishObjectAPPLE; +GLEW_FUN_EXPORT PFNGLGENFENCESAPPLEPROC __glewGenFencesAPPLE; +GLEW_FUN_EXPORT PFNGLISFENCEAPPLEPROC __glewIsFenceAPPLE; +GLEW_FUN_EXPORT PFNGLSETFENCEAPPLEPROC __glewSetFenceAPPLE; +GLEW_FUN_EXPORT PFNGLTESTFENCEAPPLEPROC __glewTestFenceAPPLE; +GLEW_FUN_EXPORT PFNGLTESTOBJECTAPPLEPROC __glewTestObjectAPPLE; + +GLEW_FUN_EXPORT PFNGLBUFFERPARAMETERIAPPLEPROC __glewBufferParameteriAPPLE; +GLEW_FUN_EXPORT PFNGLFLUSHMAPPEDBUFFERRANGEAPPLEPROC __glewFlushMappedBufferRangeAPPLE; + +GLEW_FUN_EXPORT PFNGLGETOBJECTPARAMETERIVAPPLEPROC __glewGetObjectParameterivAPPLE; +GLEW_FUN_EXPORT PFNGLOBJECTPURGEABLEAPPLEPROC __glewObjectPurgeableAPPLE; +GLEW_FUN_EXPORT PFNGLOBJECTUNPURGEABLEAPPLEPROC __glewObjectUnpurgeableAPPLE; + +GLEW_FUN_EXPORT PFNGLGETTEXPARAMETERPOINTERVAPPLEPROC __glewGetTexParameterPointervAPPLE; +GLEW_FUN_EXPORT PFNGLTEXTURERANGEAPPLEPROC __glewTextureRangeAPPLE; + +GLEW_FUN_EXPORT PFNGLBINDVERTEXARRAYAPPLEPROC __glewBindVertexArrayAPPLE; +GLEW_FUN_EXPORT PFNGLDELETEVERTEXARRAYSAPPLEPROC __glewDeleteVertexArraysAPPLE; +GLEW_FUN_EXPORT PFNGLGENVERTEXARRAYSAPPLEPROC __glewGenVertexArraysAPPLE; +GLEW_FUN_EXPORT PFNGLISVERTEXARRAYAPPLEPROC __glewIsVertexArrayAPPLE; + +GLEW_FUN_EXPORT PFNGLFLUSHVERTEXARRAYRANGEAPPLEPROC __glewFlushVertexArrayRangeAPPLE; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYPARAMETERIAPPLEPROC __glewVertexArrayParameteriAPPLE; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYRANGEAPPLEPROC __glewVertexArrayRangeAPPLE; + +GLEW_FUN_EXPORT PFNGLDISABLEVERTEXATTRIBAPPLEPROC __glewDisableVertexAttribAPPLE; +GLEW_FUN_EXPORT PFNGLENABLEVERTEXATTRIBAPPLEPROC __glewEnableVertexAttribAPPLE; +GLEW_FUN_EXPORT PFNGLISVERTEXATTRIBENABLEDAPPLEPROC __glewIsVertexAttribEnabledAPPLE; +GLEW_FUN_EXPORT PFNGLMAPVERTEXATTRIB1DAPPLEPROC __glewMapVertexAttrib1dAPPLE; +GLEW_FUN_EXPORT PFNGLMAPVERTEXATTRIB1FAPPLEPROC __glewMapVertexAttrib1fAPPLE; +GLEW_FUN_EXPORT PFNGLMAPVERTEXATTRIB2DAPPLEPROC __glewMapVertexAttrib2dAPPLE; +GLEW_FUN_EXPORT PFNGLMAPVERTEXATTRIB2FAPPLEPROC __glewMapVertexAttrib2fAPPLE; + +GLEW_FUN_EXPORT PFNGLCLEARDEPTHFPROC __glewClearDepthf; +GLEW_FUN_EXPORT PFNGLDEPTHRANGEFPROC __glewDepthRangef; +GLEW_FUN_EXPORT PFNGLGETSHADERPRECISIONFORMATPROC __glewGetShaderPrecisionFormat; +GLEW_FUN_EXPORT PFNGLRELEASESHADERCOMPILERPROC __glewReleaseShaderCompiler; +GLEW_FUN_EXPORT PFNGLSHADERBINARYPROC __glewShaderBinary; + +GLEW_FUN_EXPORT PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEPROC __glewDrawArraysInstancedBaseInstance; +GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDBASEINSTANCEPROC __glewDrawElementsInstancedBaseInstance; +GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEPROC __glewDrawElementsInstancedBaseVertexBaseInstance; + +GLEW_FUN_EXPORT PFNGLGETIMAGEHANDLEARBPROC __glewGetImageHandleARB; +GLEW_FUN_EXPORT PFNGLGETTEXTUREHANDLEARBPROC __glewGetTextureHandleARB; +GLEW_FUN_EXPORT PFNGLGETTEXTURESAMPLERHANDLEARBPROC __glewGetTextureSamplerHandleARB; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBLUI64VARBPROC __glewGetVertexAttribLui64vARB; +GLEW_FUN_EXPORT PFNGLISIMAGEHANDLERESIDENTARBPROC __glewIsImageHandleResidentARB; +GLEW_FUN_EXPORT PFNGLISTEXTUREHANDLERESIDENTARBPROC __glewIsTextureHandleResidentARB; +GLEW_FUN_EXPORT PFNGLMAKEIMAGEHANDLENONRESIDENTARBPROC __glewMakeImageHandleNonResidentARB; +GLEW_FUN_EXPORT PFNGLMAKEIMAGEHANDLERESIDENTARBPROC __glewMakeImageHandleResidentARB; +GLEW_FUN_EXPORT PFNGLMAKETEXTUREHANDLENONRESIDENTARBPROC __glewMakeTextureHandleNonResidentARB; +GLEW_FUN_EXPORT PFNGLMAKETEXTUREHANDLERESIDENTARBPROC __glewMakeTextureHandleResidentARB; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMHANDLEUI64ARBPROC __glewProgramUniformHandleui64ARB; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMHANDLEUI64VARBPROC __glewProgramUniformHandleui64vARB; +GLEW_FUN_EXPORT PFNGLUNIFORMHANDLEUI64ARBPROC __glewUniformHandleui64ARB; +GLEW_FUN_EXPORT PFNGLUNIFORMHANDLEUI64VARBPROC __glewUniformHandleui64vARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1UI64ARBPROC __glewVertexAttribL1ui64ARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1UI64VARBPROC __glewVertexAttribL1ui64vARB; + +GLEW_FUN_EXPORT PFNGLBINDFRAGDATALOCATIONINDEXEDPROC __glewBindFragDataLocationIndexed; +GLEW_FUN_EXPORT PFNGLGETFRAGDATAINDEXPROC __glewGetFragDataIndex; + +GLEW_FUN_EXPORT PFNGLBUFFERSTORAGEPROC __glewBufferStorage; +GLEW_FUN_EXPORT PFNGLNAMEDBUFFERSTORAGEEXTPROC __glewNamedBufferStorageEXT; + +GLEW_FUN_EXPORT PFNGLCREATESYNCFROMCLEVENTARBPROC __glewCreateSyncFromCLeventARB; + +GLEW_FUN_EXPORT PFNGLCLEARBUFFERDATAPROC __glewClearBufferData; +GLEW_FUN_EXPORT PFNGLCLEARBUFFERSUBDATAPROC __glewClearBufferSubData; +GLEW_FUN_EXPORT PFNGLCLEARNAMEDBUFFERDATAEXTPROC __glewClearNamedBufferDataEXT; +GLEW_FUN_EXPORT PFNGLCLEARNAMEDBUFFERSUBDATAEXTPROC __glewClearNamedBufferSubDataEXT; + +GLEW_FUN_EXPORT PFNGLCLEARTEXIMAGEPROC __glewClearTexImage; +GLEW_FUN_EXPORT PFNGLCLEARTEXSUBIMAGEPROC __glewClearTexSubImage; + +GLEW_FUN_EXPORT PFNGLCLAMPCOLORARBPROC __glewClampColorARB; + +GLEW_FUN_EXPORT PFNGLDISPATCHCOMPUTEPROC __glewDispatchCompute; +GLEW_FUN_EXPORT PFNGLDISPATCHCOMPUTEINDIRECTPROC __glewDispatchComputeIndirect; + +GLEW_FUN_EXPORT PFNGLDISPATCHCOMPUTEGROUPSIZEARBPROC __glewDispatchComputeGroupSizeARB; + +GLEW_FUN_EXPORT PFNGLCOPYBUFFERSUBDATAPROC __glewCopyBufferSubData; + +GLEW_FUN_EXPORT PFNGLCOPYIMAGESUBDATAPROC __glewCopyImageSubData; + +GLEW_FUN_EXPORT PFNGLDEBUGMESSAGECALLBACKARBPROC __glewDebugMessageCallbackARB; +GLEW_FUN_EXPORT PFNGLDEBUGMESSAGECONTROLARBPROC __glewDebugMessageControlARB; +GLEW_FUN_EXPORT PFNGLDEBUGMESSAGEINSERTARBPROC __glewDebugMessageInsertARB; +GLEW_FUN_EXPORT PFNGLGETDEBUGMESSAGELOGARBPROC __glewGetDebugMessageLogARB; + +GLEW_FUN_EXPORT PFNGLDRAWBUFFERSARBPROC __glewDrawBuffersARB; + +GLEW_FUN_EXPORT PFNGLBLENDEQUATIONSEPARATEIARBPROC __glewBlendEquationSeparateiARB; +GLEW_FUN_EXPORT PFNGLBLENDEQUATIONIARBPROC __glewBlendEquationiARB; +GLEW_FUN_EXPORT PFNGLBLENDFUNCSEPARATEIARBPROC __glewBlendFuncSeparateiARB; +GLEW_FUN_EXPORT PFNGLBLENDFUNCIARBPROC __glewBlendFunciARB; + +GLEW_FUN_EXPORT PFNGLDRAWELEMENTSBASEVERTEXPROC __glewDrawElementsBaseVertex; +GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC __glewDrawElementsInstancedBaseVertex; +GLEW_FUN_EXPORT PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC __glewDrawRangeElementsBaseVertex; +GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC __glewMultiDrawElementsBaseVertex; + +GLEW_FUN_EXPORT PFNGLDRAWARRAYSINDIRECTPROC __glewDrawArraysIndirect; +GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINDIRECTPROC __glewDrawElementsIndirect; + +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERPARAMETERIPROC __glewFramebufferParameteri; +GLEW_FUN_EXPORT PFNGLGETFRAMEBUFFERPARAMETERIVPROC __glewGetFramebufferParameteriv; +GLEW_FUN_EXPORT PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVEXTPROC __glewGetNamedFramebufferParameterivEXT; +GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERPARAMETERIEXTPROC __glewNamedFramebufferParameteriEXT; + +GLEW_FUN_EXPORT PFNGLBINDFRAMEBUFFERPROC __glewBindFramebuffer; +GLEW_FUN_EXPORT PFNGLBINDRENDERBUFFERPROC __glewBindRenderbuffer; +GLEW_FUN_EXPORT PFNGLBLITFRAMEBUFFERPROC __glewBlitFramebuffer; +GLEW_FUN_EXPORT PFNGLCHECKFRAMEBUFFERSTATUSPROC __glewCheckFramebufferStatus; +GLEW_FUN_EXPORT PFNGLDELETEFRAMEBUFFERSPROC __glewDeleteFramebuffers; +GLEW_FUN_EXPORT PFNGLDELETERENDERBUFFERSPROC __glewDeleteRenderbuffers; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERRENDERBUFFERPROC __glewFramebufferRenderbuffer; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURE1DPROC __glewFramebufferTexture1D; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURE2DPROC __glewFramebufferTexture2D; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURE3DPROC __glewFramebufferTexture3D; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURELAYERPROC __glewFramebufferTextureLayer; +GLEW_FUN_EXPORT PFNGLGENFRAMEBUFFERSPROC __glewGenFramebuffers; +GLEW_FUN_EXPORT PFNGLGENRENDERBUFFERSPROC __glewGenRenderbuffers; +GLEW_FUN_EXPORT PFNGLGENERATEMIPMAPPROC __glewGenerateMipmap; +GLEW_FUN_EXPORT PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC __glewGetFramebufferAttachmentParameteriv; +GLEW_FUN_EXPORT PFNGLGETRENDERBUFFERPARAMETERIVPROC __glewGetRenderbufferParameteriv; +GLEW_FUN_EXPORT PFNGLISFRAMEBUFFERPROC __glewIsFramebuffer; +GLEW_FUN_EXPORT PFNGLISRENDERBUFFERPROC __glewIsRenderbuffer; +GLEW_FUN_EXPORT PFNGLRENDERBUFFERSTORAGEPROC __glewRenderbufferStorage; +GLEW_FUN_EXPORT PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC __glewRenderbufferStorageMultisample; + +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTUREARBPROC __glewFramebufferTextureARB; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTUREFACEARBPROC __glewFramebufferTextureFaceARB; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURELAYERARBPROC __glewFramebufferTextureLayerARB; +GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETERIARBPROC __glewProgramParameteriARB; + +GLEW_FUN_EXPORT PFNGLGETPROGRAMBINARYPROC __glewGetProgramBinary; +GLEW_FUN_EXPORT PFNGLPROGRAMBINARYPROC __glewProgramBinary; +GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETERIPROC __glewProgramParameteri; + +GLEW_FUN_EXPORT PFNGLGETUNIFORMDVPROC __glewGetUniformdv; +GLEW_FUN_EXPORT PFNGLUNIFORM1DPROC __glewUniform1d; +GLEW_FUN_EXPORT PFNGLUNIFORM1DVPROC __glewUniform1dv; +GLEW_FUN_EXPORT PFNGLUNIFORM2DPROC __glewUniform2d; +GLEW_FUN_EXPORT PFNGLUNIFORM2DVPROC __glewUniform2dv; +GLEW_FUN_EXPORT PFNGLUNIFORM3DPROC __glewUniform3d; +GLEW_FUN_EXPORT PFNGLUNIFORM3DVPROC __glewUniform3dv; +GLEW_FUN_EXPORT PFNGLUNIFORM4DPROC __glewUniform4d; +GLEW_FUN_EXPORT PFNGLUNIFORM4DVPROC __glewUniform4dv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX2DVPROC __glewUniformMatrix2dv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX2X3DVPROC __glewUniformMatrix2x3dv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX2X4DVPROC __glewUniformMatrix2x4dv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX3DVPROC __glewUniformMatrix3dv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX3X2DVPROC __glewUniformMatrix3x2dv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX3X4DVPROC __glewUniformMatrix3x4dv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX4DVPROC __glewUniformMatrix4dv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX4X2DVPROC __glewUniformMatrix4x2dv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX4X3DVPROC __glewUniformMatrix4x3dv; + +GLEW_FUN_EXPORT PFNGLCOLORSUBTABLEPROC __glewColorSubTable; +GLEW_FUN_EXPORT PFNGLCOLORTABLEPROC __glewColorTable; +GLEW_FUN_EXPORT PFNGLCOLORTABLEPARAMETERFVPROC __glewColorTableParameterfv; +GLEW_FUN_EXPORT PFNGLCOLORTABLEPARAMETERIVPROC __glewColorTableParameteriv; +GLEW_FUN_EXPORT PFNGLCONVOLUTIONFILTER1DPROC __glewConvolutionFilter1D; +GLEW_FUN_EXPORT PFNGLCONVOLUTIONFILTER2DPROC __glewConvolutionFilter2D; +GLEW_FUN_EXPORT PFNGLCONVOLUTIONPARAMETERFPROC __glewConvolutionParameterf; +GLEW_FUN_EXPORT PFNGLCONVOLUTIONPARAMETERFVPROC __glewConvolutionParameterfv; +GLEW_FUN_EXPORT PFNGLCONVOLUTIONPARAMETERIPROC __glewConvolutionParameteri; +GLEW_FUN_EXPORT PFNGLCONVOLUTIONPARAMETERIVPROC __glewConvolutionParameteriv; +GLEW_FUN_EXPORT PFNGLCOPYCOLORSUBTABLEPROC __glewCopyColorSubTable; +GLEW_FUN_EXPORT PFNGLCOPYCOLORTABLEPROC __glewCopyColorTable; +GLEW_FUN_EXPORT PFNGLCOPYCONVOLUTIONFILTER1DPROC __glewCopyConvolutionFilter1D; +GLEW_FUN_EXPORT PFNGLCOPYCONVOLUTIONFILTER2DPROC __glewCopyConvolutionFilter2D; +GLEW_FUN_EXPORT PFNGLGETCOLORTABLEPROC __glewGetColorTable; +GLEW_FUN_EXPORT PFNGLGETCOLORTABLEPARAMETERFVPROC __glewGetColorTableParameterfv; +GLEW_FUN_EXPORT PFNGLGETCOLORTABLEPARAMETERIVPROC __glewGetColorTableParameteriv; +GLEW_FUN_EXPORT PFNGLGETCONVOLUTIONFILTERPROC __glewGetConvolutionFilter; +GLEW_FUN_EXPORT PFNGLGETCONVOLUTIONPARAMETERFVPROC __glewGetConvolutionParameterfv; +GLEW_FUN_EXPORT PFNGLGETCONVOLUTIONPARAMETERIVPROC __glewGetConvolutionParameteriv; +GLEW_FUN_EXPORT PFNGLGETHISTOGRAMPROC __glewGetHistogram; +GLEW_FUN_EXPORT PFNGLGETHISTOGRAMPARAMETERFVPROC __glewGetHistogramParameterfv; +GLEW_FUN_EXPORT PFNGLGETHISTOGRAMPARAMETERIVPROC __glewGetHistogramParameteriv; +GLEW_FUN_EXPORT PFNGLGETMINMAXPROC __glewGetMinmax; +GLEW_FUN_EXPORT PFNGLGETMINMAXPARAMETERFVPROC __glewGetMinmaxParameterfv; +GLEW_FUN_EXPORT PFNGLGETMINMAXPARAMETERIVPROC __glewGetMinmaxParameteriv; +GLEW_FUN_EXPORT PFNGLGETSEPARABLEFILTERPROC __glewGetSeparableFilter; +GLEW_FUN_EXPORT PFNGLHISTOGRAMPROC __glewHistogram; +GLEW_FUN_EXPORT PFNGLMINMAXPROC __glewMinmax; +GLEW_FUN_EXPORT PFNGLRESETHISTOGRAMPROC __glewResetHistogram; +GLEW_FUN_EXPORT PFNGLRESETMINMAXPROC __glewResetMinmax; +GLEW_FUN_EXPORT PFNGLSEPARABLEFILTER2DPROC __glewSeparableFilter2D; + +GLEW_FUN_EXPORT PFNGLMULTIDRAWARRAYSINDIRECTCOUNTARBPROC __glewMultiDrawArraysIndirectCountARB; +GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTSINDIRECTCOUNTARBPROC __glewMultiDrawElementsIndirectCountARB; + +GLEW_FUN_EXPORT PFNGLDRAWARRAYSINSTANCEDARBPROC __glewDrawArraysInstancedARB; +GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDARBPROC __glewDrawElementsInstancedARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBDIVISORARBPROC __glewVertexAttribDivisorARB; + +GLEW_FUN_EXPORT PFNGLGETINTERNALFORMATIVPROC __glewGetInternalformativ; + +GLEW_FUN_EXPORT PFNGLGETINTERNALFORMATI64VPROC __glewGetInternalformati64v; + +GLEW_FUN_EXPORT PFNGLINVALIDATEBUFFERDATAPROC __glewInvalidateBufferData; +GLEW_FUN_EXPORT PFNGLINVALIDATEBUFFERSUBDATAPROC __glewInvalidateBufferSubData; +GLEW_FUN_EXPORT PFNGLINVALIDATEFRAMEBUFFERPROC __glewInvalidateFramebuffer; +GLEW_FUN_EXPORT PFNGLINVALIDATESUBFRAMEBUFFERPROC __glewInvalidateSubFramebuffer; +GLEW_FUN_EXPORT PFNGLINVALIDATETEXIMAGEPROC __glewInvalidateTexImage; +GLEW_FUN_EXPORT PFNGLINVALIDATETEXSUBIMAGEPROC __glewInvalidateTexSubImage; + +GLEW_FUN_EXPORT PFNGLFLUSHMAPPEDBUFFERRANGEPROC __glewFlushMappedBufferRange; +GLEW_FUN_EXPORT PFNGLMAPBUFFERRANGEPROC __glewMapBufferRange; + +GLEW_FUN_EXPORT PFNGLCURRENTPALETTEMATRIXARBPROC __glewCurrentPaletteMatrixARB; +GLEW_FUN_EXPORT PFNGLMATRIXINDEXPOINTERARBPROC __glewMatrixIndexPointerARB; +GLEW_FUN_EXPORT PFNGLMATRIXINDEXUBVARBPROC __glewMatrixIndexubvARB; +GLEW_FUN_EXPORT PFNGLMATRIXINDEXUIVARBPROC __glewMatrixIndexuivARB; +GLEW_FUN_EXPORT PFNGLMATRIXINDEXUSVARBPROC __glewMatrixIndexusvARB; + +GLEW_FUN_EXPORT PFNGLBINDBUFFERSBASEPROC __glewBindBuffersBase; +GLEW_FUN_EXPORT PFNGLBINDBUFFERSRANGEPROC __glewBindBuffersRange; +GLEW_FUN_EXPORT PFNGLBINDIMAGETEXTURESPROC __glewBindImageTextures; +GLEW_FUN_EXPORT PFNGLBINDSAMPLERSPROC __glewBindSamplers; +GLEW_FUN_EXPORT PFNGLBINDTEXTURESPROC __glewBindTextures; +GLEW_FUN_EXPORT PFNGLBINDVERTEXBUFFERSPROC __glewBindVertexBuffers; + +GLEW_FUN_EXPORT PFNGLMULTIDRAWARRAYSINDIRECTPROC __glewMultiDrawArraysIndirect; +GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTSINDIRECTPROC __glewMultiDrawElementsIndirect; + +GLEW_FUN_EXPORT PFNGLSAMPLECOVERAGEARBPROC __glewSampleCoverageARB; + +GLEW_FUN_EXPORT PFNGLACTIVETEXTUREARBPROC __glewActiveTextureARB; +GLEW_FUN_EXPORT PFNGLCLIENTACTIVETEXTUREARBPROC __glewClientActiveTextureARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1DARBPROC __glewMultiTexCoord1dARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1DVARBPROC __glewMultiTexCoord1dvARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1FARBPROC __glewMultiTexCoord1fARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1FVARBPROC __glewMultiTexCoord1fvARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1IARBPROC __glewMultiTexCoord1iARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1IVARBPROC __glewMultiTexCoord1ivARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1SARBPROC __glewMultiTexCoord1sARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1SVARBPROC __glewMultiTexCoord1svARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2DARBPROC __glewMultiTexCoord2dARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2DVARBPROC __glewMultiTexCoord2dvARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2FARBPROC __glewMultiTexCoord2fARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2FVARBPROC __glewMultiTexCoord2fvARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2IARBPROC __glewMultiTexCoord2iARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2IVARBPROC __glewMultiTexCoord2ivARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2SARBPROC __glewMultiTexCoord2sARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2SVARBPROC __glewMultiTexCoord2svARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3DARBPROC __glewMultiTexCoord3dARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3DVARBPROC __glewMultiTexCoord3dvARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3FARBPROC __glewMultiTexCoord3fARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3FVARBPROC __glewMultiTexCoord3fvARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3IARBPROC __glewMultiTexCoord3iARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3IVARBPROC __glewMultiTexCoord3ivARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3SARBPROC __glewMultiTexCoord3sARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3SVARBPROC __glewMultiTexCoord3svARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4DARBPROC __glewMultiTexCoord4dARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4DVARBPROC __glewMultiTexCoord4dvARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4FARBPROC __glewMultiTexCoord4fARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4FVARBPROC __glewMultiTexCoord4fvARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4IARBPROC __glewMultiTexCoord4iARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4IVARBPROC __glewMultiTexCoord4ivARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4SARBPROC __glewMultiTexCoord4sARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4SVARBPROC __glewMultiTexCoord4svARB; + +GLEW_FUN_EXPORT PFNGLBEGINQUERYARBPROC __glewBeginQueryARB; +GLEW_FUN_EXPORT PFNGLDELETEQUERIESARBPROC __glewDeleteQueriesARB; +GLEW_FUN_EXPORT PFNGLENDQUERYARBPROC __glewEndQueryARB; +GLEW_FUN_EXPORT PFNGLGENQUERIESARBPROC __glewGenQueriesARB; +GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTIVARBPROC __glewGetQueryObjectivARB; +GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTUIVARBPROC __glewGetQueryObjectuivARB; +GLEW_FUN_EXPORT PFNGLGETQUERYIVARBPROC __glewGetQueryivARB; +GLEW_FUN_EXPORT PFNGLISQUERYARBPROC __glewIsQueryARB; + +GLEW_FUN_EXPORT PFNGLPOINTPARAMETERFARBPROC __glewPointParameterfARB; +GLEW_FUN_EXPORT PFNGLPOINTPARAMETERFVARBPROC __glewPointParameterfvARB; + +GLEW_FUN_EXPORT PFNGLGETPROGRAMINTERFACEIVPROC __glewGetProgramInterfaceiv; +GLEW_FUN_EXPORT PFNGLGETPROGRAMRESOURCEINDEXPROC __glewGetProgramResourceIndex; +GLEW_FUN_EXPORT PFNGLGETPROGRAMRESOURCELOCATIONPROC __glewGetProgramResourceLocation; +GLEW_FUN_EXPORT PFNGLGETPROGRAMRESOURCELOCATIONINDEXPROC __glewGetProgramResourceLocationIndex; +GLEW_FUN_EXPORT PFNGLGETPROGRAMRESOURCENAMEPROC __glewGetProgramResourceName; +GLEW_FUN_EXPORT PFNGLGETPROGRAMRESOURCEIVPROC __glewGetProgramResourceiv; + +GLEW_FUN_EXPORT PFNGLPROVOKINGVERTEXPROC __glewProvokingVertex; + +GLEW_FUN_EXPORT PFNGLGETGRAPHICSRESETSTATUSARBPROC __glewGetGraphicsResetStatusARB; +GLEW_FUN_EXPORT PFNGLGETNCOLORTABLEARBPROC __glewGetnColorTableARB; +GLEW_FUN_EXPORT PFNGLGETNCOMPRESSEDTEXIMAGEARBPROC __glewGetnCompressedTexImageARB; +GLEW_FUN_EXPORT PFNGLGETNCONVOLUTIONFILTERARBPROC __glewGetnConvolutionFilterARB; +GLEW_FUN_EXPORT PFNGLGETNHISTOGRAMARBPROC __glewGetnHistogramARB; +GLEW_FUN_EXPORT PFNGLGETNMAPDVARBPROC __glewGetnMapdvARB; +GLEW_FUN_EXPORT PFNGLGETNMAPFVARBPROC __glewGetnMapfvARB; +GLEW_FUN_EXPORT PFNGLGETNMAPIVARBPROC __glewGetnMapivARB; +GLEW_FUN_EXPORT PFNGLGETNMINMAXARBPROC __glewGetnMinmaxARB; +GLEW_FUN_EXPORT PFNGLGETNPIXELMAPFVARBPROC __glewGetnPixelMapfvARB; +GLEW_FUN_EXPORT PFNGLGETNPIXELMAPUIVARBPROC __glewGetnPixelMapuivARB; +GLEW_FUN_EXPORT PFNGLGETNPIXELMAPUSVARBPROC __glewGetnPixelMapusvARB; +GLEW_FUN_EXPORT PFNGLGETNPOLYGONSTIPPLEARBPROC __glewGetnPolygonStippleARB; +GLEW_FUN_EXPORT PFNGLGETNSEPARABLEFILTERARBPROC __glewGetnSeparableFilterARB; +GLEW_FUN_EXPORT PFNGLGETNTEXIMAGEARBPROC __glewGetnTexImageARB; +GLEW_FUN_EXPORT PFNGLGETNUNIFORMDVARBPROC __glewGetnUniformdvARB; +GLEW_FUN_EXPORT PFNGLGETNUNIFORMFVARBPROC __glewGetnUniformfvARB; +GLEW_FUN_EXPORT PFNGLGETNUNIFORMIVARBPROC __glewGetnUniformivARB; +GLEW_FUN_EXPORT PFNGLGETNUNIFORMUIVARBPROC __glewGetnUniformuivARB; +GLEW_FUN_EXPORT PFNGLREADNPIXELSARBPROC __glewReadnPixelsARB; + +GLEW_FUN_EXPORT PFNGLMINSAMPLESHADINGARBPROC __glewMinSampleShadingARB; + +GLEW_FUN_EXPORT PFNGLBINDSAMPLERPROC __glewBindSampler; +GLEW_FUN_EXPORT PFNGLDELETESAMPLERSPROC __glewDeleteSamplers; +GLEW_FUN_EXPORT PFNGLGENSAMPLERSPROC __glewGenSamplers; +GLEW_FUN_EXPORT PFNGLGETSAMPLERPARAMETERIIVPROC __glewGetSamplerParameterIiv; +GLEW_FUN_EXPORT PFNGLGETSAMPLERPARAMETERIUIVPROC __glewGetSamplerParameterIuiv; +GLEW_FUN_EXPORT PFNGLGETSAMPLERPARAMETERFVPROC __glewGetSamplerParameterfv; +GLEW_FUN_EXPORT PFNGLGETSAMPLERPARAMETERIVPROC __glewGetSamplerParameteriv; +GLEW_FUN_EXPORT PFNGLISSAMPLERPROC __glewIsSampler; +GLEW_FUN_EXPORT PFNGLSAMPLERPARAMETERIIVPROC __glewSamplerParameterIiv; +GLEW_FUN_EXPORT PFNGLSAMPLERPARAMETERIUIVPROC __glewSamplerParameterIuiv; +GLEW_FUN_EXPORT PFNGLSAMPLERPARAMETERFPROC __glewSamplerParameterf; +GLEW_FUN_EXPORT PFNGLSAMPLERPARAMETERFVPROC __glewSamplerParameterfv; +GLEW_FUN_EXPORT PFNGLSAMPLERPARAMETERIPROC __glewSamplerParameteri; +GLEW_FUN_EXPORT PFNGLSAMPLERPARAMETERIVPROC __glewSamplerParameteriv; + +GLEW_FUN_EXPORT PFNGLACTIVESHADERPROGRAMPROC __glewActiveShaderProgram; +GLEW_FUN_EXPORT PFNGLBINDPROGRAMPIPELINEPROC __glewBindProgramPipeline; +GLEW_FUN_EXPORT PFNGLCREATESHADERPROGRAMVPROC __glewCreateShaderProgramv; +GLEW_FUN_EXPORT PFNGLDELETEPROGRAMPIPELINESPROC __glewDeleteProgramPipelines; +GLEW_FUN_EXPORT PFNGLGENPROGRAMPIPELINESPROC __glewGenProgramPipelines; +GLEW_FUN_EXPORT PFNGLGETPROGRAMPIPELINEINFOLOGPROC __glewGetProgramPipelineInfoLog; +GLEW_FUN_EXPORT PFNGLGETPROGRAMPIPELINEIVPROC __glewGetProgramPipelineiv; +GLEW_FUN_EXPORT PFNGLISPROGRAMPIPELINEPROC __glewIsProgramPipeline; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1DPROC __glewProgramUniform1d; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1DVPROC __glewProgramUniform1dv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1FPROC __glewProgramUniform1f; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1FVPROC __glewProgramUniform1fv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1IPROC __glewProgramUniform1i; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1IVPROC __glewProgramUniform1iv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1UIPROC __glewProgramUniform1ui; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1UIVPROC __glewProgramUniform1uiv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2DPROC __glewProgramUniform2d; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2DVPROC __glewProgramUniform2dv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2FPROC __glewProgramUniform2f; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2FVPROC __glewProgramUniform2fv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2IPROC __glewProgramUniform2i; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2IVPROC __glewProgramUniform2iv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2UIPROC __glewProgramUniform2ui; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2UIVPROC __glewProgramUniform2uiv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3DPROC __glewProgramUniform3d; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3DVPROC __glewProgramUniform3dv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3FPROC __glewProgramUniform3f; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3FVPROC __glewProgramUniform3fv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3IPROC __glewProgramUniform3i; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3IVPROC __glewProgramUniform3iv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3UIPROC __glewProgramUniform3ui; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3UIVPROC __glewProgramUniform3uiv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4DPROC __glewProgramUniform4d; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4DVPROC __glewProgramUniform4dv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4FPROC __glewProgramUniform4f; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4FVPROC __glewProgramUniform4fv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4IPROC __glewProgramUniform4i; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4IVPROC __glewProgramUniform4iv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4UIPROC __glewProgramUniform4ui; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4UIVPROC __glewProgramUniform4uiv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2DVPROC __glewProgramUniformMatrix2dv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2FVPROC __glewProgramUniformMatrix2fv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2X3DVPROC __glewProgramUniformMatrix2x3dv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2X3FVPROC __glewProgramUniformMatrix2x3fv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2X4DVPROC __glewProgramUniformMatrix2x4dv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2X4FVPROC __glewProgramUniformMatrix2x4fv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3DVPROC __glewProgramUniformMatrix3dv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3FVPROC __glewProgramUniformMatrix3fv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3X2DVPROC __glewProgramUniformMatrix3x2dv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3X2FVPROC __glewProgramUniformMatrix3x2fv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3X4DVPROC __glewProgramUniformMatrix3x4dv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3X4FVPROC __glewProgramUniformMatrix3x4fv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4DVPROC __glewProgramUniformMatrix4dv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4FVPROC __glewProgramUniformMatrix4fv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4X2DVPROC __glewProgramUniformMatrix4x2dv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4X2FVPROC __glewProgramUniformMatrix4x2fv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4X3DVPROC __glewProgramUniformMatrix4x3dv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4X3FVPROC __glewProgramUniformMatrix4x3fv; +GLEW_FUN_EXPORT PFNGLUSEPROGRAMSTAGESPROC __glewUseProgramStages; +GLEW_FUN_EXPORT PFNGLVALIDATEPROGRAMPIPELINEPROC __glewValidateProgramPipeline; + +GLEW_FUN_EXPORT PFNGLGETACTIVEATOMICCOUNTERBUFFERIVPROC __glewGetActiveAtomicCounterBufferiv; + +GLEW_FUN_EXPORT PFNGLBINDIMAGETEXTUREPROC __glewBindImageTexture; +GLEW_FUN_EXPORT PFNGLMEMORYBARRIERPROC __glewMemoryBarrier; + +GLEW_FUN_EXPORT PFNGLATTACHOBJECTARBPROC __glewAttachObjectARB; +GLEW_FUN_EXPORT PFNGLCOMPILESHADERARBPROC __glewCompileShaderARB; +GLEW_FUN_EXPORT PFNGLCREATEPROGRAMOBJECTARBPROC __glewCreateProgramObjectARB; +GLEW_FUN_EXPORT PFNGLCREATESHADEROBJECTARBPROC __glewCreateShaderObjectARB; +GLEW_FUN_EXPORT PFNGLDELETEOBJECTARBPROC __glewDeleteObjectARB; +GLEW_FUN_EXPORT PFNGLDETACHOBJECTARBPROC __glewDetachObjectARB; +GLEW_FUN_EXPORT PFNGLGETACTIVEUNIFORMARBPROC __glewGetActiveUniformARB; +GLEW_FUN_EXPORT PFNGLGETATTACHEDOBJECTSARBPROC __glewGetAttachedObjectsARB; +GLEW_FUN_EXPORT PFNGLGETHANDLEARBPROC __glewGetHandleARB; +GLEW_FUN_EXPORT PFNGLGETINFOLOGARBPROC __glewGetInfoLogARB; +GLEW_FUN_EXPORT PFNGLGETOBJECTPARAMETERFVARBPROC __glewGetObjectParameterfvARB; +GLEW_FUN_EXPORT PFNGLGETOBJECTPARAMETERIVARBPROC __glewGetObjectParameterivARB; +GLEW_FUN_EXPORT PFNGLGETSHADERSOURCEARBPROC __glewGetShaderSourceARB; +GLEW_FUN_EXPORT PFNGLGETUNIFORMLOCATIONARBPROC __glewGetUniformLocationARB; +GLEW_FUN_EXPORT PFNGLGETUNIFORMFVARBPROC __glewGetUniformfvARB; +GLEW_FUN_EXPORT PFNGLGETUNIFORMIVARBPROC __glewGetUniformivARB; +GLEW_FUN_EXPORT PFNGLLINKPROGRAMARBPROC __glewLinkProgramARB; +GLEW_FUN_EXPORT PFNGLSHADERSOURCEARBPROC __glewShaderSourceARB; +GLEW_FUN_EXPORT PFNGLUNIFORM1FARBPROC __glewUniform1fARB; +GLEW_FUN_EXPORT PFNGLUNIFORM1FVARBPROC __glewUniform1fvARB; +GLEW_FUN_EXPORT PFNGLUNIFORM1IARBPROC __glewUniform1iARB; +GLEW_FUN_EXPORT PFNGLUNIFORM1IVARBPROC __glewUniform1ivARB; +GLEW_FUN_EXPORT PFNGLUNIFORM2FARBPROC __glewUniform2fARB; +GLEW_FUN_EXPORT PFNGLUNIFORM2FVARBPROC __glewUniform2fvARB; +GLEW_FUN_EXPORT PFNGLUNIFORM2IARBPROC __glewUniform2iARB; +GLEW_FUN_EXPORT PFNGLUNIFORM2IVARBPROC __glewUniform2ivARB; +GLEW_FUN_EXPORT PFNGLUNIFORM3FARBPROC __glewUniform3fARB; +GLEW_FUN_EXPORT PFNGLUNIFORM3FVARBPROC __glewUniform3fvARB; +GLEW_FUN_EXPORT PFNGLUNIFORM3IARBPROC __glewUniform3iARB; +GLEW_FUN_EXPORT PFNGLUNIFORM3IVARBPROC __glewUniform3ivARB; +GLEW_FUN_EXPORT PFNGLUNIFORM4FARBPROC __glewUniform4fARB; +GLEW_FUN_EXPORT PFNGLUNIFORM4FVARBPROC __glewUniform4fvARB; +GLEW_FUN_EXPORT PFNGLUNIFORM4IARBPROC __glewUniform4iARB; +GLEW_FUN_EXPORT PFNGLUNIFORM4IVARBPROC __glewUniform4ivARB; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX2FVARBPROC __glewUniformMatrix2fvARB; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX3FVARBPROC __glewUniformMatrix3fvARB; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX4FVARBPROC __glewUniformMatrix4fvARB; +GLEW_FUN_EXPORT PFNGLUSEPROGRAMOBJECTARBPROC __glewUseProgramObjectARB; +GLEW_FUN_EXPORT PFNGLVALIDATEPROGRAMARBPROC __glewValidateProgramARB; + +GLEW_FUN_EXPORT PFNGLSHADERSTORAGEBLOCKBINDINGPROC __glewShaderStorageBlockBinding; + +GLEW_FUN_EXPORT PFNGLGETACTIVESUBROUTINENAMEPROC __glewGetActiveSubroutineName; +GLEW_FUN_EXPORT PFNGLGETACTIVESUBROUTINEUNIFORMNAMEPROC __glewGetActiveSubroutineUniformName; +GLEW_FUN_EXPORT PFNGLGETACTIVESUBROUTINEUNIFORMIVPROC __glewGetActiveSubroutineUniformiv; +GLEW_FUN_EXPORT PFNGLGETPROGRAMSTAGEIVPROC __glewGetProgramStageiv; +GLEW_FUN_EXPORT PFNGLGETSUBROUTINEINDEXPROC __glewGetSubroutineIndex; +GLEW_FUN_EXPORT PFNGLGETSUBROUTINEUNIFORMLOCATIONPROC __glewGetSubroutineUniformLocation; +GLEW_FUN_EXPORT PFNGLGETUNIFORMSUBROUTINEUIVPROC __glewGetUniformSubroutineuiv; +GLEW_FUN_EXPORT PFNGLUNIFORMSUBROUTINESUIVPROC __glewUniformSubroutinesuiv; + +GLEW_FUN_EXPORT PFNGLCOMPILESHADERINCLUDEARBPROC __glewCompileShaderIncludeARB; +GLEW_FUN_EXPORT PFNGLDELETENAMEDSTRINGARBPROC __glewDeleteNamedStringARB; +GLEW_FUN_EXPORT PFNGLGETNAMEDSTRINGARBPROC __glewGetNamedStringARB; +GLEW_FUN_EXPORT PFNGLGETNAMEDSTRINGIVARBPROC __glewGetNamedStringivARB; +GLEW_FUN_EXPORT PFNGLISNAMEDSTRINGARBPROC __glewIsNamedStringARB; +GLEW_FUN_EXPORT PFNGLNAMEDSTRINGARBPROC __glewNamedStringARB; + +GLEW_FUN_EXPORT PFNGLTEXPAGECOMMITMENTARBPROC __glewTexPageCommitmentARB; +GLEW_FUN_EXPORT PFNGLTEXTUREPAGECOMMITMENTEXTPROC __glewTexturePageCommitmentEXT; + +GLEW_FUN_EXPORT PFNGLCLIENTWAITSYNCPROC __glewClientWaitSync; +GLEW_FUN_EXPORT PFNGLDELETESYNCPROC __glewDeleteSync; +GLEW_FUN_EXPORT PFNGLFENCESYNCPROC __glewFenceSync; +GLEW_FUN_EXPORT PFNGLGETINTEGER64VPROC __glewGetInteger64v; +GLEW_FUN_EXPORT PFNGLGETSYNCIVPROC __glewGetSynciv; +GLEW_FUN_EXPORT PFNGLISSYNCPROC __glewIsSync; +GLEW_FUN_EXPORT PFNGLWAITSYNCPROC __glewWaitSync; + +GLEW_FUN_EXPORT PFNGLPATCHPARAMETERFVPROC __glewPatchParameterfv; +GLEW_FUN_EXPORT PFNGLPATCHPARAMETERIPROC __glewPatchParameteri; + +GLEW_FUN_EXPORT PFNGLTEXBUFFERARBPROC __glewTexBufferARB; + +GLEW_FUN_EXPORT PFNGLTEXBUFFERRANGEPROC __glewTexBufferRange; +GLEW_FUN_EXPORT PFNGLTEXTUREBUFFERRANGEEXTPROC __glewTextureBufferRangeEXT; + +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXIMAGE1DARBPROC __glewCompressedTexImage1DARB; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXIMAGE2DARBPROC __glewCompressedTexImage2DARB; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXIMAGE3DARBPROC __glewCompressedTexImage3DARB; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC __glewCompressedTexSubImage1DARB; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC __glewCompressedTexSubImage2DARB; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC __glewCompressedTexSubImage3DARB; +GLEW_FUN_EXPORT PFNGLGETCOMPRESSEDTEXIMAGEARBPROC __glewGetCompressedTexImageARB; + +GLEW_FUN_EXPORT PFNGLGETMULTISAMPLEFVPROC __glewGetMultisamplefv; +GLEW_FUN_EXPORT PFNGLSAMPLEMASKIPROC __glewSampleMaski; +GLEW_FUN_EXPORT PFNGLTEXIMAGE2DMULTISAMPLEPROC __glewTexImage2DMultisample; +GLEW_FUN_EXPORT PFNGLTEXIMAGE3DMULTISAMPLEPROC __glewTexImage3DMultisample; + +GLEW_FUN_EXPORT PFNGLTEXSTORAGE1DPROC __glewTexStorage1D; +GLEW_FUN_EXPORT PFNGLTEXSTORAGE2DPROC __glewTexStorage2D; +GLEW_FUN_EXPORT PFNGLTEXSTORAGE3DPROC __glewTexStorage3D; +GLEW_FUN_EXPORT PFNGLTEXTURESTORAGE1DEXTPROC __glewTextureStorage1DEXT; +GLEW_FUN_EXPORT PFNGLTEXTURESTORAGE2DEXTPROC __glewTextureStorage2DEXT; +GLEW_FUN_EXPORT PFNGLTEXTURESTORAGE3DEXTPROC __glewTextureStorage3DEXT; + +GLEW_FUN_EXPORT PFNGLTEXSTORAGE2DMULTISAMPLEPROC __glewTexStorage2DMultisample; +GLEW_FUN_EXPORT PFNGLTEXSTORAGE3DMULTISAMPLEPROC __glewTexStorage3DMultisample; +GLEW_FUN_EXPORT PFNGLTEXTURESTORAGE2DMULTISAMPLEEXTPROC __glewTextureStorage2DMultisampleEXT; +GLEW_FUN_EXPORT PFNGLTEXTURESTORAGE3DMULTISAMPLEEXTPROC __glewTextureStorage3DMultisampleEXT; + +GLEW_FUN_EXPORT PFNGLTEXTUREVIEWPROC __glewTextureView; + +GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTI64VPROC __glewGetQueryObjecti64v; +GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTUI64VPROC __glewGetQueryObjectui64v; +GLEW_FUN_EXPORT PFNGLQUERYCOUNTERPROC __glewQueryCounter; + +GLEW_FUN_EXPORT PFNGLBINDTRANSFORMFEEDBACKPROC __glewBindTransformFeedback; +GLEW_FUN_EXPORT PFNGLDELETETRANSFORMFEEDBACKSPROC __glewDeleteTransformFeedbacks; +GLEW_FUN_EXPORT PFNGLDRAWTRANSFORMFEEDBACKPROC __glewDrawTransformFeedback; +GLEW_FUN_EXPORT PFNGLGENTRANSFORMFEEDBACKSPROC __glewGenTransformFeedbacks; +GLEW_FUN_EXPORT PFNGLISTRANSFORMFEEDBACKPROC __glewIsTransformFeedback; +GLEW_FUN_EXPORT PFNGLPAUSETRANSFORMFEEDBACKPROC __glewPauseTransformFeedback; +GLEW_FUN_EXPORT PFNGLRESUMETRANSFORMFEEDBACKPROC __glewResumeTransformFeedback; + +GLEW_FUN_EXPORT PFNGLBEGINQUERYINDEXEDPROC __glewBeginQueryIndexed; +GLEW_FUN_EXPORT PFNGLDRAWTRANSFORMFEEDBACKSTREAMPROC __glewDrawTransformFeedbackStream; +GLEW_FUN_EXPORT PFNGLENDQUERYINDEXEDPROC __glewEndQueryIndexed; +GLEW_FUN_EXPORT PFNGLGETQUERYINDEXEDIVPROC __glewGetQueryIndexediv; + +GLEW_FUN_EXPORT PFNGLDRAWTRANSFORMFEEDBACKINSTANCEDPROC __glewDrawTransformFeedbackInstanced; +GLEW_FUN_EXPORT PFNGLDRAWTRANSFORMFEEDBACKSTREAMINSTANCEDPROC __glewDrawTransformFeedbackStreamInstanced; + +GLEW_FUN_EXPORT PFNGLLOADTRANSPOSEMATRIXDARBPROC __glewLoadTransposeMatrixdARB; +GLEW_FUN_EXPORT PFNGLLOADTRANSPOSEMATRIXFARBPROC __glewLoadTransposeMatrixfARB; +GLEW_FUN_EXPORT PFNGLMULTTRANSPOSEMATRIXDARBPROC __glewMultTransposeMatrixdARB; +GLEW_FUN_EXPORT PFNGLMULTTRANSPOSEMATRIXFARBPROC __glewMultTransposeMatrixfARB; + +GLEW_FUN_EXPORT PFNGLBINDBUFFERBASEPROC __glewBindBufferBase; +GLEW_FUN_EXPORT PFNGLBINDBUFFERRANGEPROC __glewBindBufferRange; +GLEW_FUN_EXPORT PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC __glewGetActiveUniformBlockName; +GLEW_FUN_EXPORT PFNGLGETACTIVEUNIFORMBLOCKIVPROC __glewGetActiveUniformBlockiv; +GLEW_FUN_EXPORT PFNGLGETACTIVEUNIFORMNAMEPROC __glewGetActiveUniformName; +GLEW_FUN_EXPORT PFNGLGETACTIVEUNIFORMSIVPROC __glewGetActiveUniformsiv; +GLEW_FUN_EXPORT PFNGLGETINTEGERI_VPROC __glewGetIntegeri_v; +GLEW_FUN_EXPORT PFNGLGETUNIFORMBLOCKINDEXPROC __glewGetUniformBlockIndex; +GLEW_FUN_EXPORT PFNGLGETUNIFORMINDICESPROC __glewGetUniformIndices; +GLEW_FUN_EXPORT PFNGLUNIFORMBLOCKBINDINGPROC __glewUniformBlockBinding; + +GLEW_FUN_EXPORT PFNGLBINDVERTEXARRAYPROC __glewBindVertexArray; +GLEW_FUN_EXPORT PFNGLDELETEVERTEXARRAYSPROC __glewDeleteVertexArrays; +GLEW_FUN_EXPORT PFNGLGENVERTEXARRAYSPROC __glewGenVertexArrays; +GLEW_FUN_EXPORT PFNGLISVERTEXARRAYPROC __glewIsVertexArray; + +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBLDVPROC __glewGetVertexAttribLdv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1DPROC __glewVertexAttribL1d; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1DVPROC __glewVertexAttribL1dv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL2DPROC __glewVertexAttribL2d; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL2DVPROC __glewVertexAttribL2dv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL3DPROC __glewVertexAttribL3d; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL3DVPROC __glewVertexAttribL3dv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL4DPROC __glewVertexAttribL4d; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL4DVPROC __glewVertexAttribL4dv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBLPOINTERPROC __glewVertexAttribLPointer; + +GLEW_FUN_EXPORT PFNGLBINDVERTEXBUFFERPROC __glewBindVertexBuffer; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBBINDINGPROC __glewVertexAttribBinding; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBFORMATPROC __glewVertexAttribFormat; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBIFORMATPROC __glewVertexAttribIFormat; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBLFORMATPROC __glewVertexAttribLFormat; +GLEW_FUN_EXPORT PFNGLVERTEXBINDINGDIVISORPROC __glewVertexBindingDivisor; + +GLEW_FUN_EXPORT PFNGLVERTEXBLENDARBPROC __glewVertexBlendARB; +GLEW_FUN_EXPORT PFNGLWEIGHTPOINTERARBPROC __glewWeightPointerARB; +GLEW_FUN_EXPORT PFNGLWEIGHTBVARBPROC __glewWeightbvARB; +GLEW_FUN_EXPORT PFNGLWEIGHTDVARBPROC __glewWeightdvARB; +GLEW_FUN_EXPORT PFNGLWEIGHTFVARBPROC __glewWeightfvARB; +GLEW_FUN_EXPORT PFNGLWEIGHTIVARBPROC __glewWeightivARB; +GLEW_FUN_EXPORT PFNGLWEIGHTSVARBPROC __glewWeightsvARB; +GLEW_FUN_EXPORT PFNGLWEIGHTUBVARBPROC __glewWeightubvARB; +GLEW_FUN_EXPORT PFNGLWEIGHTUIVARBPROC __glewWeightuivARB; +GLEW_FUN_EXPORT PFNGLWEIGHTUSVARBPROC __glewWeightusvARB; + +GLEW_FUN_EXPORT PFNGLBINDBUFFERARBPROC __glewBindBufferARB; +GLEW_FUN_EXPORT PFNGLBUFFERDATAARBPROC __glewBufferDataARB; +GLEW_FUN_EXPORT PFNGLBUFFERSUBDATAARBPROC __glewBufferSubDataARB; +GLEW_FUN_EXPORT PFNGLDELETEBUFFERSARBPROC __glewDeleteBuffersARB; +GLEW_FUN_EXPORT PFNGLGENBUFFERSARBPROC __glewGenBuffersARB; +GLEW_FUN_EXPORT PFNGLGETBUFFERPARAMETERIVARBPROC __glewGetBufferParameterivARB; +GLEW_FUN_EXPORT PFNGLGETBUFFERPOINTERVARBPROC __glewGetBufferPointervARB; +GLEW_FUN_EXPORT PFNGLGETBUFFERSUBDATAARBPROC __glewGetBufferSubDataARB; +GLEW_FUN_EXPORT PFNGLISBUFFERARBPROC __glewIsBufferARB; +GLEW_FUN_EXPORT PFNGLMAPBUFFERARBPROC __glewMapBufferARB; +GLEW_FUN_EXPORT PFNGLUNMAPBUFFERARBPROC __glewUnmapBufferARB; + +GLEW_FUN_EXPORT PFNGLBINDPROGRAMARBPROC __glewBindProgramARB; +GLEW_FUN_EXPORT PFNGLDELETEPROGRAMSARBPROC __glewDeleteProgramsARB; +GLEW_FUN_EXPORT PFNGLDISABLEVERTEXATTRIBARRAYARBPROC __glewDisableVertexAttribArrayARB; +GLEW_FUN_EXPORT PFNGLENABLEVERTEXATTRIBARRAYARBPROC __glewEnableVertexAttribArrayARB; +GLEW_FUN_EXPORT PFNGLGENPROGRAMSARBPROC __glewGenProgramsARB; +GLEW_FUN_EXPORT PFNGLGETPROGRAMENVPARAMETERDVARBPROC __glewGetProgramEnvParameterdvARB; +GLEW_FUN_EXPORT PFNGLGETPROGRAMENVPARAMETERFVARBPROC __glewGetProgramEnvParameterfvARB; +GLEW_FUN_EXPORT PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC __glewGetProgramLocalParameterdvARB; +GLEW_FUN_EXPORT PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC __glewGetProgramLocalParameterfvARB; +GLEW_FUN_EXPORT PFNGLGETPROGRAMSTRINGARBPROC __glewGetProgramStringARB; +GLEW_FUN_EXPORT PFNGLGETPROGRAMIVARBPROC __glewGetProgramivARB; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBPOINTERVARBPROC __glewGetVertexAttribPointervARB; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBDVARBPROC __glewGetVertexAttribdvARB; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBFVARBPROC __glewGetVertexAttribfvARB; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBIVARBPROC __glewGetVertexAttribivARB; +GLEW_FUN_EXPORT PFNGLISPROGRAMARBPROC __glewIsProgramARB; +GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETER4DARBPROC __glewProgramEnvParameter4dARB; +GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETER4DVARBPROC __glewProgramEnvParameter4dvARB; +GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETER4FARBPROC __glewProgramEnvParameter4fARB; +GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETER4FVARBPROC __glewProgramEnvParameter4fvARB; +GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETER4DARBPROC __glewProgramLocalParameter4dARB; +GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETER4DVARBPROC __glewProgramLocalParameter4dvARB; +GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETER4FARBPROC __glewProgramLocalParameter4fARB; +GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETER4FVARBPROC __glewProgramLocalParameter4fvARB; +GLEW_FUN_EXPORT PFNGLPROGRAMSTRINGARBPROC __glewProgramStringARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1DARBPROC __glewVertexAttrib1dARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1DVARBPROC __glewVertexAttrib1dvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1FARBPROC __glewVertexAttrib1fARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1FVARBPROC __glewVertexAttrib1fvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1SARBPROC __glewVertexAttrib1sARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1SVARBPROC __glewVertexAttrib1svARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2DARBPROC __glewVertexAttrib2dARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2DVARBPROC __glewVertexAttrib2dvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2FARBPROC __glewVertexAttrib2fARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2FVARBPROC __glewVertexAttrib2fvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2SARBPROC __glewVertexAttrib2sARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2SVARBPROC __glewVertexAttrib2svARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3DARBPROC __glewVertexAttrib3dARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3DVARBPROC __glewVertexAttrib3dvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3FARBPROC __glewVertexAttrib3fARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3FVARBPROC __glewVertexAttrib3fvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3SARBPROC __glewVertexAttrib3sARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3SVARBPROC __glewVertexAttrib3svARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NBVARBPROC __glewVertexAttrib4NbvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NIVARBPROC __glewVertexAttrib4NivARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NSVARBPROC __glewVertexAttrib4NsvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUBARBPROC __glewVertexAttrib4NubARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUBVARBPROC __glewVertexAttrib4NubvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUIVARBPROC __glewVertexAttrib4NuivARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUSVARBPROC __glewVertexAttrib4NusvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4BVARBPROC __glewVertexAttrib4bvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4DARBPROC __glewVertexAttrib4dARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4DVARBPROC __glewVertexAttrib4dvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4FARBPROC __glewVertexAttrib4fARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4FVARBPROC __glewVertexAttrib4fvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4IVARBPROC __glewVertexAttrib4ivARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4SARBPROC __glewVertexAttrib4sARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4SVARBPROC __glewVertexAttrib4svARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4UBVARBPROC __glewVertexAttrib4ubvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4UIVARBPROC __glewVertexAttrib4uivARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4USVARBPROC __glewVertexAttrib4usvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBPOINTERARBPROC __glewVertexAttribPointerARB; + +GLEW_FUN_EXPORT PFNGLBINDATTRIBLOCATIONARBPROC __glewBindAttribLocationARB; +GLEW_FUN_EXPORT PFNGLGETACTIVEATTRIBARBPROC __glewGetActiveAttribARB; +GLEW_FUN_EXPORT PFNGLGETATTRIBLOCATIONARBPROC __glewGetAttribLocationARB; + +GLEW_FUN_EXPORT PFNGLCOLORP3UIPROC __glewColorP3ui; +GLEW_FUN_EXPORT PFNGLCOLORP3UIVPROC __glewColorP3uiv; +GLEW_FUN_EXPORT PFNGLCOLORP4UIPROC __glewColorP4ui; +GLEW_FUN_EXPORT PFNGLCOLORP4UIVPROC __glewColorP4uiv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORDP1UIPROC __glewMultiTexCoordP1ui; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORDP1UIVPROC __glewMultiTexCoordP1uiv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORDP2UIPROC __glewMultiTexCoordP2ui; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORDP2UIVPROC __glewMultiTexCoordP2uiv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORDP3UIPROC __glewMultiTexCoordP3ui; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORDP3UIVPROC __glewMultiTexCoordP3uiv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORDP4UIPROC __glewMultiTexCoordP4ui; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORDP4UIVPROC __glewMultiTexCoordP4uiv; +GLEW_FUN_EXPORT PFNGLNORMALP3UIPROC __glewNormalP3ui; +GLEW_FUN_EXPORT PFNGLNORMALP3UIVPROC __glewNormalP3uiv; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLORP3UIPROC __glewSecondaryColorP3ui; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLORP3UIVPROC __glewSecondaryColorP3uiv; +GLEW_FUN_EXPORT PFNGLTEXCOORDP1UIPROC __glewTexCoordP1ui; +GLEW_FUN_EXPORT PFNGLTEXCOORDP1UIVPROC __glewTexCoordP1uiv; +GLEW_FUN_EXPORT PFNGLTEXCOORDP2UIPROC __glewTexCoordP2ui; +GLEW_FUN_EXPORT PFNGLTEXCOORDP2UIVPROC __glewTexCoordP2uiv; +GLEW_FUN_EXPORT PFNGLTEXCOORDP3UIPROC __glewTexCoordP3ui; +GLEW_FUN_EXPORT PFNGLTEXCOORDP3UIVPROC __glewTexCoordP3uiv; +GLEW_FUN_EXPORT PFNGLTEXCOORDP4UIPROC __glewTexCoordP4ui; +GLEW_FUN_EXPORT PFNGLTEXCOORDP4UIVPROC __glewTexCoordP4uiv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBP1UIPROC __glewVertexAttribP1ui; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBP1UIVPROC __glewVertexAttribP1uiv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBP2UIPROC __glewVertexAttribP2ui; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBP2UIVPROC __glewVertexAttribP2uiv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBP3UIPROC __glewVertexAttribP3ui; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBP3UIVPROC __glewVertexAttribP3uiv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBP4UIPROC __glewVertexAttribP4ui; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBP4UIVPROC __glewVertexAttribP4uiv; +GLEW_FUN_EXPORT PFNGLVERTEXP2UIPROC __glewVertexP2ui; +GLEW_FUN_EXPORT PFNGLVERTEXP2UIVPROC __glewVertexP2uiv; +GLEW_FUN_EXPORT PFNGLVERTEXP3UIPROC __glewVertexP3ui; +GLEW_FUN_EXPORT PFNGLVERTEXP3UIVPROC __glewVertexP3uiv; +GLEW_FUN_EXPORT PFNGLVERTEXP4UIPROC __glewVertexP4ui; +GLEW_FUN_EXPORT PFNGLVERTEXP4UIVPROC __glewVertexP4uiv; + +GLEW_FUN_EXPORT PFNGLDEPTHRANGEARRAYVPROC __glewDepthRangeArrayv; +GLEW_FUN_EXPORT PFNGLDEPTHRANGEINDEXEDPROC __glewDepthRangeIndexed; +GLEW_FUN_EXPORT PFNGLGETDOUBLEI_VPROC __glewGetDoublei_v; +GLEW_FUN_EXPORT PFNGLGETFLOATI_VPROC __glewGetFloati_v; +GLEW_FUN_EXPORT PFNGLSCISSORARRAYVPROC __glewScissorArrayv; +GLEW_FUN_EXPORT PFNGLSCISSORINDEXEDPROC __glewScissorIndexed; +GLEW_FUN_EXPORT PFNGLSCISSORINDEXEDVPROC __glewScissorIndexedv; +GLEW_FUN_EXPORT PFNGLVIEWPORTARRAYVPROC __glewViewportArrayv; +GLEW_FUN_EXPORT PFNGLVIEWPORTINDEXEDFPROC __glewViewportIndexedf; +GLEW_FUN_EXPORT PFNGLVIEWPORTINDEXEDFVPROC __glewViewportIndexedfv; + +GLEW_FUN_EXPORT PFNGLWINDOWPOS2DARBPROC __glewWindowPos2dARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2DVARBPROC __glewWindowPos2dvARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2FARBPROC __glewWindowPos2fARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2FVARBPROC __glewWindowPos2fvARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2IARBPROC __glewWindowPos2iARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2IVARBPROC __glewWindowPos2ivARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2SARBPROC __glewWindowPos2sARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2SVARBPROC __glewWindowPos2svARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3DARBPROC __glewWindowPos3dARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3DVARBPROC __glewWindowPos3dvARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3FARBPROC __glewWindowPos3fARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3FVARBPROC __glewWindowPos3fvARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3IARBPROC __glewWindowPos3iARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3IVARBPROC __glewWindowPos3ivARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3SARBPROC __glewWindowPos3sARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3SVARBPROC __glewWindowPos3svARB; + +GLEW_FUN_EXPORT PFNGLDRAWBUFFERSATIPROC __glewDrawBuffersATI; + +GLEW_FUN_EXPORT PFNGLDRAWELEMENTARRAYATIPROC __glewDrawElementArrayATI; +GLEW_FUN_EXPORT PFNGLDRAWRANGEELEMENTARRAYATIPROC __glewDrawRangeElementArrayATI; +GLEW_FUN_EXPORT PFNGLELEMENTPOINTERATIPROC __glewElementPointerATI; + +GLEW_FUN_EXPORT PFNGLGETTEXBUMPPARAMETERFVATIPROC __glewGetTexBumpParameterfvATI; +GLEW_FUN_EXPORT PFNGLGETTEXBUMPPARAMETERIVATIPROC __glewGetTexBumpParameterivATI; +GLEW_FUN_EXPORT PFNGLTEXBUMPPARAMETERFVATIPROC __glewTexBumpParameterfvATI; +GLEW_FUN_EXPORT PFNGLTEXBUMPPARAMETERIVATIPROC __glewTexBumpParameterivATI; + +GLEW_FUN_EXPORT PFNGLALPHAFRAGMENTOP1ATIPROC __glewAlphaFragmentOp1ATI; +GLEW_FUN_EXPORT PFNGLALPHAFRAGMENTOP2ATIPROC __glewAlphaFragmentOp2ATI; +GLEW_FUN_EXPORT PFNGLALPHAFRAGMENTOP3ATIPROC __glewAlphaFragmentOp3ATI; +GLEW_FUN_EXPORT PFNGLBEGINFRAGMENTSHADERATIPROC __glewBeginFragmentShaderATI; +GLEW_FUN_EXPORT PFNGLBINDFRAGMENTSHADERATIPROC __glewBindFragmentShaderATI; +GLEW_FUN_EXPORT PFNGLCOLORFRAGMENTOP1ATIPROC __glewColorFragmentOp1ATI; +GLEW_FUN_EXPORT PFNGLCOLORFRAGMENTOP2ATIPROC __glewColorFragmentOp2ATI; +GLEW_FUN_EXPORT PFNGLCOLORFRAGMENTOP3ATIPROC __glewColorFragmentOp3ATI; +GLEW_FUN_EXPORT PFNGLDELETEFRAGMENTSHADERATIPROC __glewDeleteFragmentShaderATI; +GLEW_FUN_EXPORT PFNGLENDFRAGMENTSHADERATIPROC __glewEndFragmentShaderATI; +GLEW_FUN_EXPORT PFNGLGENFRAGMENTSHADERSATIPROC __glewGenFragmentShadersATI; +GLEW_FUN_EXPORT PFNGLPASSTEXCOORDATIPROC __glewPassTexCoordATI; +GLEW_FUN_EXPORT PFNGLSAMPLEMAPATIPROC __glewSampleMapATI; +GLEW_FUN_EXPORT PFNGLSETFRAGMENTSHADERCONSTANTATIPROC __glewSetFragmentShaderConstantATI; + +GLEW_FUN_EXPORT PFNGLMAPOBJECTBUFFERATIPROC __glewMapObjectBufferATI; +GLEW_FUN_EXPORT PFNGLUNMAPOBJECTBUFFERATIPROC __glewUnmapObjectBufferATI; + +GLEW_FUN_EXPORT PFNGLPNTRIANGLESFATIPROC __glewPNTrianglesfATI; +GLEW_FUN_EXPORT PFNGLPNTRIANGLESIATIPROC __glewPNTrianglesiATI; + +GLEW_FUN_EXPORT PFNGLSTENCILFUNCSEPARATEATIPROC __glewStencilFuncSeparateATI; +GLEW_FUN_EXPORT PFNGLSTENCILOPSEPARATEATIPROC __glewStencilOpSeparateATI; + +GLEW_FUN_EXPORT PFNGLARRAYOBJECTATIPROC __glewArrayObjectATI; +GLEW_FUN_EXPORT PFNGLFREEOBJECTBUFFERATIPROC __glewFreeObjectBufferATI; +GLEW_FUN_EXPORT PFNGLGETARRAYOBJECTFVATIPROC __glewGetArrayObjectfvATI; +GLEW_FUN_EXPORT PFNGLGETARRAYOBJECTIVATIPROC __glewGetArrayObjectivATI; +GLEW_FUN_EXPORT PFNGLGETOBJECTBUFFERFVATIPROC __glewGetObjectBufferfvATI; +GLEW_FUN_EXPORT PFNGLGETOBJECTBUFFERIVATIPROC __glewGetObjectBufferivATI; +GLEW_FUN_EXPORT PFNGLGETVARIANTARRAYOBJECTFVATIPROC __glewGetVariantArrayObjectfvATI; +GLEW_FUN_EXPORT PFNGLGETVARIANTARRAYOBJECTIVATIPROC __glewGetVariantArrayObjectivATI; +GLEW_FUN_EXPORT PFNGLISOBJECTBUFFERATIPROC __glewIsObjectBufferATI; +GLEW_FUN_EXPORT PFNGLNEWOBJECTBUFFERATIPROC __glewNewObjectBufferATI; +GLEW_FUN_EXPORT PFNGLUPDATEOBJECTBUFFERATIPROC __glewUpdateObjectBufferATI; +GLEW_FUN_EXPORT PFNGLVARIANTARRAYOBJECTATIPROC __glewVariantArrayObjectATI; + +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBARRAYOBJECTFVATIPROC __glewGetVertexAttribArrayObjectfvATI; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBARRAYOBJECTIVATIPROC __glewGetVertexAttribArrayObjectivATI; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBARRAYOBJECTATIPROC __glewVertexAttribArrayObjectATI; + +GLEW_FUN_EXPORT PFNGLCLIENTACTIVEVERTEXSTREAMATIPROC __glewClientActiveVertexStreamATI; +GLEW_FUN_EXPORT PFNGLNORMALSTREAM3BATIPROC __glewNormalStream3bATI; +GLEW_FUN_EXPORT PFNGLNORMALSTREAM3BVATIPROC __glewNormalStream3bvATI; +GLEW_FUN_EXPORT PFNGLNORMALSTREAM3DATIPROC __glewNormalStream3dATI; +GLEW_FUN_EXPORT PFNGLNORMALSTREAM3DVATIPROC __glewNormalStream3dvATI; +GLEW_FUN_EXPORT PFNGLNORMALSTREAM3FATIPROC __glewNormalStream3fATI; +GLEW_FUN_EXPORT PFNGLNORMALSTREAM3FVATIPROC __glewNormalStream3fvATI; +GLEW_FUN_EXPORT PFNGLNORMALSTREAM3IATIPROC __glewNormalStream3iATI; +GLEW_FUN_EXPORT PFNGLNORMALSTREAM3IVATIPROC __glewNormalStream3ivATI; +GLEW_FUN_EXPORT PFNGLNORMALSTREAM3SATIPROC __glewNormalStream3sATI; +GLEW_FUN_EXPORT PFNGLNORMALSTREAM3SVATIPROC __glewNormalStream3svATI; +GLEW_FUN_EXPORT PFNGLVERTEXBLENDENVFATIPROC __glewVertexBlendEnvfATI; +GLEW_FUN_EXPORT PFNGLVERTEXBLENDENVIATIPROC __glewVertexBlendEnviATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM1DATIPROC __glewVertexStream1dATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM1DVATIPROC __glewVertexStream1dvATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM1FATIPROC __glewVertexStream1fATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM1FVATIPROC __glewVertexStream1fvATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM1IATIPROC __glewVertexStream1iATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM1IVATIPROC __glewVertexStream1ivATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM1SATIPROC __glewVertexStream1sATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM1SVATIPROC __glewVertexStream1svATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM2DATIPROC __glewVertexStream2dATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM2DVATIPROC __glewVertexStream2dvATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM2FATIPROC __glewVertexStream2fATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM2FVATIPROC __glewVertexStream2fvATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM2IATIPROC __glewVertexStream2iATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM2IVATIPROC __glewVertexStream2ivATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM2SATIPROC __glewVertexStream2sATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM2SVATIPROC __glewVertexStream2svATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM3DATIPROC __glewVertexStream3dATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM3DVATIPROC __glewVertexStream3dvATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM3FATIPROC __glewVertexStream3fATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM3FVATIPROC __glewVertexStream3fvATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM3IATIPROC __glewVertexStream3iATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM3IVATIPROC __glewVertexStream3ivATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM3SATIPROC __glewVertexStream3sATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM3SVATIPROC __glewVertexStream3svATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM4DATIPROC __glewVertexStream4dATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM4DVATIPROC __glewVertexStream4dvATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM4FATIPROC __glewVertexStream4fATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM4FVATIPROC __glewVertexStream4fvATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM4IATIPROC __glewVertexStream4iATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM4IVATIPROC __glewVertexStream4ivATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM4SATIPROC __glewVertexStream4sATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM4SVATIPROC __glewVertexStream4svATI; + +GLEW_FUN_EXPORT PFNGLGETUNIFORMBUFFERSIZEEXTPROC __glewGetUniformBufferSizeEXT; +GLEW_FUN_EXPORT PFNGLGETUNIFORMOFFSETEXTPROC __glewGetUniformOffsetEXT; +GLEW_FUN_EXPORT PFNGLUNIFORMBUFFEREXTPROC __glewUniformBufferEXT; + +GLEW_FUN_EXPORT PFNGLBLENDCOLOREXTPROC __glewBlendColorEXT; + +GLEW_FUN_EXPORT PFNGLBLENDEQUATIONSEPARATEEXTPROC __glewBlendEquationSeparateEXT; + +GLEW_FUN_EXPORT PFNGLBLENDFUNCSEPARATEEXTPROC __glewBlendFuncSeparateEXT; + +GLEW_FUN_EXPORT PFNGLBLENDEQUATIONEXTPROC __glewBlendEquationEXT; + +GLEW_FUN_EXPORT PFNGLCOLORSUBTABLEEXTPROC __glewColorSubTableEXT; +GLEW_FUN_EXPORT PFNGLCOPYCOLORSUBTABLEEXTPROC __glewCopyColorSubTableEXT; + +GLEW_FUN_EXPORT PFNGLLOCKARRAYSEXTPROC __glewLockArraysEXT; +GLEW_FUN_EXPORT PFNGLUNLOCKARRAYSEXTPROC __glewUnlockArraysEXT; + +GLEW_FUN_EXPORT PFNGLCONVOLUTIONFILTER1DEXTPROC __glewConvolutionFilter1DEXT; +GLEW_FUN_EXPORT PFNGLCONVOLUTIONFILTER2DEXTPROC __glewConvolutionFilter2DEXT; +GLEW_FUN_EXPORT PFNGLCONVOLUTIONPARAMETERFEXTPROC __glewConvolutionParameterfEXT; +GLEW_FUN_EXPORT PFNGLCONVOLUTIONPARAMETERFVEXTPROC __glewConvolutionParameterfvEXT; +GLEW_FUN_EXPORT PFNGLCONVOLUTIONPARAMETERIEXTPROC __glewConvolutionParameteriEXT; +GLEW_FUN_EXPORT PFNGLCONVOLUTIONPARAMETERIVEXTPROC __glewConvolutionParameterivEXT; +GLEW_FUN_EXPORT PFNGLCOPYCONVOLUTIONFILTER1DEXTPROC __glewCopyConvolutionFilter1DEXT; +GLEW_FUN_EXPORT PFNGLCOPYCONVOLUTIONFILTER2DEXTPROC __glewCopyConvolutionFilter2DEXT; +GLEW_FUN_EXPORT PFNGLGETCONVOLUTIONFILTEREXTPROC __glewGetConvolutionFilterEXT; +GLEW_FUN_EXPORT PFNGLGETCONVOLUTIONPARAMETERFVEXTPROC __glewGetConvolutionParameterfvEXT; +GLEW_FUN_EXPORT PFNGLGETCONVOLUTIONPARAMETERIVEXTPROC __glewGetConvolutionParameterivEXT; +GLEW_FUN_EXPORT PFNGLGETSEPARABLEFILTEREXTPROC __glewGetSeparableFilterEXT; +GLEW_FUN_EXPORT PFNGLSEPARABLEFILTER2DEXTPROC __glewSeparableFilter2DEXT; + +GLEW_FUN_EXPORT PFNGLBINORMALPOINTEREXTPROC __glewBinormalPointerEXT; +GLEW_FUN_EXPORT PFNGLTANGENTPOINTEREXTPROC __glewTangentPointerEXT; + +GLEW_FUN_EXPORT PFNGLCOPYTEXIMAGE1DEXTPROC __glewCopyTexImage1DEXT; +GLEW_FUN_EXPORT PFNGLCOPYTEXIMAGE2DEXTPROC __glewCopyTexImage2DEXT; +GLEW_FUN_EXPORT PFNGLCOPYTEXSUBIMAGE1DEXTPROC __glewCopyTexSubImage1DEXT; +GLEW_FUN_EXPORT PFNGLCOPYTEXSUBIMAGE2DEXTPROC __glewCopyTexSubImage2DEXT; +GLEW_FUN_EXPORT PFNGLCOPYTEXSUBIMAGE3DEXTPROC __glewCopyTexSubImage3DEXT; + +GLEW_FUN_EXPORT PFNGLCULLPARAMETERDVEXTPROC __glewCullParameterdvEXT; +GLEW_FUN_EXPORT PFNGLCULLPARAMETERFVEXTPROC __glewCullParameterfvEXT; + +GLEW_FUN_EXPORT PFNGLINSERTEVENTMARKEREXTPROC __glewInsertEventMarkerEXT; +GLEW_FUN_EXPORT PFNGLPOPGROUPMARKEREXTPROC __glewPopGroupMarkerEXT; +GLEW_FUN_EXPORT PFNGLPUSHGROUPMARKEREXTPROC __glewPushGroupMarkerEXT; + +GLEW_FUN_EXPORT PFNGLDEPTHBOUNDSEXTPROC __glewDepthBoundsEXT; + +GLEW_FUN_EXPORT PFNGLBINDMULTITEXTUREEXTPROC __glewBindMultiTextureEXT; +GLEW_FUN_EXPORT PFNGLCHECKNAMEDFRAMEBUFFERSTATUSEXTPROC __glewCheckNamedFramebufferStatusEXT; +GLEW_FUN_EXPORT PFNGLCLIENTATTRIBDEFAULTEXTPROC __glewClientAttribDefaultEXT; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDMULTITEXIMAGE1DEXTPROC __glewCompressedMultiTexImage1DEXT; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDMULTITEXIMAGE2DEXTPROC __glewCompressedMultiTexImage2DEXT; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDMULTITEXIMAGE3DEXTPROC __glewCompressedMultiTexImage3DEXT; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDMULTITEXSUBIMAGE1DEXTPROC __glewCompressedMultiTexSubImage1DEXT; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDMULTITEXSUBIMAGE2DEXTPROC __glewCompressedMultiTexSubImage2DEXT; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDMULTITEXSUBIMAGE3DEXTPROC __glewCompressedMultiTexSubImage3DEXT; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXTUREIMAGE1DEXTPROC __glewCompressedTextureImage1DEXT; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXTUREIMAGE2DEXTPROC __glewCompressedTextureImage2DEXT; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXTUREIMAGE3DEXTPROC __glewCompressedTextureImage3DEXT; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXTURESUBIMAGE1DEXTPROC __glewCompressedTextureSubImage1DEXT; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXTURESUBIMAGE2DEXTPROC __glewCompressedTextureSubImage2DEXT; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXTURESUBIMAGE3DEXTPROC __glewCompressedTextureSubImage3DEXT; +GLEW_FUN_EXPORT PFNGLCOPYMULTITEXIMAGE1DEXTPROC __glewCopyMultiTexImage1DEXT; +GLEW_FUN_EXPORT PFNGLCOPYMULTITEXIMAGE2DEXTPROC __glewCopyMultiTexImage2DEXT; +GLEW_FUN_EXPORT PFNGLCOPYMULTITEXSUBIMAGE1DEXTPROC __glewCopyMultiTexSubImage1DEXT; +GLEW_FUN_EXPORT PFNGLCOPYMULTITEXSUBIMAGE2DEXTPROC __glewCopyMultiTexSubImage2DEXT; +GLEW_FUN_EXPORT PFNGLCOPYMULTITEXSUBIMAGE3DEXTPROC __glewCopyMultiTexSubImage3DEXT; +GLEW_FUN_EXPORT PFNGLCOPYTEXTUREIMAGE1DEXTPROC __glewCopyTextureImage1DEXT; +GLEW_FUN_EXPORT PFNGLCOPYTEXTUREIMAGE2DEXTPROC __glewCopyTextureImage2DEXT; +GLEW_FUN_EXPORT PFNGLCOPYTEXTURESUBIMAGE1DEXTPROC __glewCopyTextureSubImage1DEXT; +GLEW_FUN_EXPORT PFNGLCOPYTEXTURESUBIMAGE2DEXTPROC __glewCopyTextureSubImage2DEXT; +GLEW_FUN_EXPORT PFNGLCOPYTEXTURESUBIMAGE3DEXTPROC __glewCopyTextureSubImage3DEXT; +GLEW_FUN_EXPORT PFNGLDISABLECLIENTSTATEINDEXEDEXTPROC __glewDisableClientStateIndexedEXT; +GLEW_FUN_EXPORT PFNGLDISABLECLIENTSTATEIEXTPROC __glewDisableClientStateiEXT; +GLEW_FUN_EXPORT PFNGLDISABLEVERTEXARRAYATTRIBEXTPROC __glewDisableVertexArrayAttribEXT; +GLEW_FUN_EXPORT PFNGLDISABLEVERTEXARRAYEXTPROC __glewDisableVertexArrayEXT; +GLEW_FUN_EXPORT PFNGLENABLECLIENTSTATEINDEXEDEXTPROC __glewEnableClientStateIndexedEXT; +GLEW_FUN_EXPORT PFNGLENABLECLIENTSTATEIEXTPROC __glewEnableClientStateiEXT; +GLEW_FUN_EXPORT PFNGLENABLEVERTEXARRAYATTRIBEXTPROC __glewEnableVertexArrayAttribEXT; +GLEW_FUN_EXPORT PFNGLENABLEVERTEXARRAYEXTPROC __glewEnableVertexArrayEXT; +GLEW_FUN_EXPORT PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEEXTPROC __glewFlushMappedNamedBufferRangeEXT; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERDRAWBUFFEREXTPROC __glewFramebufferDrawBufferEXT; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERDRAWBUFFERSEXTPROC __glewFramebufferDrawBuffersEXT; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERREADBUFFEREXTPROC __glewFramebufferReadBufferEXT; +GLEW_FUN_EXPORT PFNGLGENERATEMULTITEXMIPMAPEXTPROC __glewGenerateMultiTexMipmapEXT; +GLEW_FUN_EXPORT PFNGLGENERATETEXTUREMIPMAPEXTPROC __glewGenerateTextureMipmapEXT; +GLEW_FUN_EXPORT PFNGLGETCOMPRESSEDMULTITEXIMAGEEXTPROC __glewGetCompressedMultiTexImageEXT; +GLEW_FUN_EXPORT PFNGLGETCOMPRESSEDTEXTUREIMAGEEXTPROC __glewGetCompressedTextureImageEXT; +GLEW_FUN_EXPORT PFNGLGETDOUBLEINDEXEDVEXTPROC __glewGetDoubleIndexedvEXT; +GLEW_FUN_EXPORT PFNGLGETDOUBLEI_VEXTPROC __glewGetDoublei_vEXT; +GLEW_FUN_EXPORT PFNGLGETFLOATINDEXEDVEXTPROC __glewGetFloatIndexedvEXT; +GLEW_FUN_EXPORT PFNGLGETFLOATI_VEXTPROC __glewGetFloati_vEXT; +GLEW_FUN_EXPORT PFNGLGETFRAMEBUFFERPARAMETERIVEXTPROC __glewGetFramebufferParameterivEXT; +GLEW_FUN_EXPORT PFNGLGETMULTITEXENVFVEXTPROC __glewGetMultiTexEnvfvEXT; +GLEW_FUN_EXPORT PFNGLGETMULTITEXENVIVEXTPROC __glewGetMultiTexEnvivEXT; +GLEW_FUN_EXPORT PFNGLGETMULTITEXGENDVEXTPROC __glewGetMultiTexGendvEXT; +GLEW_FUN_EXPORT PFNGLGETMULTITEXGENFVEXTPROC __glewGetMultiTexGenfvEXT; +GLEW_FUN_EXPORT PFNGLGETMULTITEXGENIVEXTPROC __glewGetMultiTexGenivEXT; +GLEW_FUN_EXPORT PFNGLGETMULTITEXIMAGEEXTPROC __glewGetMultiTexImageEXT; +GLEW_FUN_EXPORT PFNGLGETMULTITEXLEVELPARAMETERFVEXTPROC __glewGetMultiTexLevelParameterfvEXT; +GLEW_FUN_EXPORT PFNGLGETMULTITEXLEVELPARAMETERIVEXTPROC __glewGetMultiTexLevelParameterivEXT; +GLEW_FUN_EXPORT PFNGLGETMULTITEXPARAMETERIIVEXTPROC __glewGetMultiTexParameterIivEXT; +GLEW_FUN_EXPORT PFNGLGETMULTITEXPARAMETERIUIVEXTPROC __glewGetMultiTexParameterIuivEXT; +GLEW_FUN_EXPORT PFNGLGETMULTITEXPARAMETERFVEXTPROC __glewGetMultiTexParameterfvEXT; +GLEW_FUN_EXPORT PFNGLGETMULTITEXPARAMETERIVEXTPROC __glewGetMultiTexParameterivEXT; +GLEW_FUN_EXPORT PFNGLGETNAMEDBUFFERPARAMETERIVEXTPROC __glewGetNamedBufferParameterivEXT; +GLEW_FUN_EXPORT PFNGLGETNAMEDBUFFERPOINTERVEXTPROC __glewGetNamedBufferPointervEXT; +GLEW_FUN_EXPORT PFNGLGETNAMEDBUFFERSUBDATAEXTPROC __glewGetNamedBufferSubDataEXT; +GLEW_FUN_EXPORT PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC __glewGetNamedFramebufferAttachmentParameterivEXT; +GLEW_FUN_EXPORT PFNGLGETNAMEDPROGRAMLOCALPARAMETERIIVEXTPROC __glewGetNamedProgramLocalParameterIivEXT; +GLEW_FUN_EXPORT PFNGLGETNAMEDPROGRAMLOCALPARAMETERIUIVEXTPROC __glewGetNamedProgramLocalParameterIuivEXT; +GLEW_FUN_EXPORT PFNGLGETNAMEDPROGRAMLOCALPARAMETERDVEXTPROC __glewGetNamedProgramLocalParameterdvEXT; +GLEW_FUN_EXPORT PFNGLGETNAMEDPROGRAMLOCALPARAMETERFVEXTPROC __glewGetNamedProgramLocalParameterfvEXT; +GLEW_FUN_EXPORT PFNGLGETNAMEDPROGRAMSTRINGEXTPROC __glewGetNamedProgramStringEXT; +GLEW_FUN_EXPORT PFNGLGETNAMEDPROGRAMIVEXTPROC __glewGetNamedProgramivEXT; +GLEW_FUN_EXPORT PFNGLGETNAMEDRENDERBUFFERPARAMETERIVEXTPROC __glewGetNamedRenderbufferParameterivEXT; +GLEW_FUN_EXPORT PFNGLGETPOINTERINDEXEDVEXTPROC __glewGetPointerIndexedvEXT; +GLEW_FUN_EXPORT PFNGLGETPOINTERI_VEXTPROC __glewGetPointeri_vEXT; +GLEW_FUN_EXPORT PFNGLGETTEXTUREIMAGEEXTPROC __glewGetTextureImageEXT; +GLEW_FUN_EXPORT PFNGLGETTEXTURELEVELPARAMETERFVEXTPROC __glewGetTextureLevelParameterfvEXT; +GLEW_FUN_EXPORT PFNGLGETTEXTURELEVELPARAMETERIVEXTPROC __glewGetTextureLevelParameterivEXT; +GLEW_FUN_EXPORT PFNGLGETTEXTUREPARAMETERIIVEXTPROC __glewGetTextureParameterIivEXT; +GLEW_FUN_EXPORT PFNGLGETTEXTUREPARAMETERIUIVEXTPROC __glewGetTextureParameterIuivEXT; +GLEW_FUN_EXPORT PFNGLGETTEXTUREPARAMETERFVEXTPROC __glewGetTextureParameterfvEXT; +GLEW_FUN_EXPORT PFNGLGETTEXTUREPARAMETERIVEXTPROC __glewGetTextureParameterivEXT; +GLEW_FUN_EXPORT PFNGLGETVERTEXARRAYINTEGERI_VEXTPROC __glewGetVertexArrayIntegeri_vEXT; +GLEW_FUN_EXPORT PFNGLGETVERTEXARRAYINTEGERVEXTPROC __glewGetVertexArrayIntegervEXT; +GLEW_FUN_EXPORT PFNGLGETVERTEXARRAYPOINTERI_VEXTPROC __glewGetVertexArrayPointeri_vEXT; +GLEW_FUN_EXPORT PFNGLGETVERTEXARRAYPOINTERVEXTPROC __glewGetVertexArrayPointervEXT; +GLEW_FUN_EXPORT PFNGLMAPNAMEDBUFFEREXTPROC __glewMapNamedBufferEXT; +GLEW_FUN_EXPORT PFNGLMAPNAMEDBUFFERRANGEEXTPROC __glewMapNamedBufferRangeEXT; +GLEW_FUN_EXPORT PFNGLMATRIXFRUSTUMEXTPROC __glewMatrixFrustumEXT; +GLEW_FUN_EXPORT PFNGLMATRIXLOADIDENTITYEXTPROC __glewMatrixLoadIdentityEXT; +GLEW_FUN_EXPORT PFNGLMATRIXLOADTRANSPOSEDEXTPROC __glewMatrixLoadTransposedEXT; +GLEW_FUN_EXPORT PFNGLMATRIXLOADTRANSPOSEFEXTPROC __glewMatrixLoadTransposefEXT; +GLEW_FUN_EXPORT PFNGLMATRIXLOADDEXTPROC __glewMatrixLoaddEXT; +GLEW_FUN_EXPORT PFNGLMATRIXLOADFEXTPROC __glewMatrixLoadfEXT; +GLEW_FUN_EXPORT PFNGLMATRIXMULTTRANSPOSEDEXTPROC __glewMatrixMultTransposedEXT; +GLEW_FUN_EXPORT PFNGLMATRIXMULTTRANSPOSEFEXTPROC __glewMatrixMultTransposefEXT; +GLEW_FUN_EXPORT PFNGLMATRIXMULTDEXTPROC __glewMatrixMultdEXT; +GLEW_FUN_EXPORT PFNGLMATRIXMULTFEXTPROC __glewMatrixMultfEXT; +GLEW_FUN_EXPORT PFNGLMATRIXORTHOEXTPROC __glewMatrixOrthoEXT; +GLEW_FUN_EXPORT PFNGLMATRIXPOPEXTPROC __glewMatrixPopEXT; +GLEW_FUN_EXPORT PFNGLMATRIXPUSHEXTPROC __glewMatrixPushEXT; +GLEW_FUN_EXPORT PFNGLMATRIXROTATEDEXTPROC __glewMatrixRotatedEXT; +GLEW_FUN_EXPORT PFNGLMATRIXROTATEFEXTPROC __glewMatrixRotatefEXT; +GLEW_FUN_EXPORT PFNGLMATRIXSCALEDEXTPROC __glewMatrixScaledEXT; +GLEW_FUN_EXPORT PFNGLMATRIXSCALEFEXTPROC __glewMatrixScalefEXT; +GLEW_FUN_EXPORT PFNGLMATRIXTRANSLATEDEXTPROC __glewMatrixTranslatedEXT; +GLEW_FUN_EXPORT PFNGLMATRIXTRANSLATEFEXTPROC __glewMatrixTranslatefEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXBUFFEREXTPROC __glewMultiTexBufferEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORDPOINTEREXTPROC __glewMultiTexCoordPointerEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXENVFEXTPROC __glewMultiTexEnvfEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXENVFVEXTPROC __glewMultiTexEnvfvEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXENVIEXTPROC __glewMultiTexEnviEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXENVIVEXTPROC __glewMultiTexEnvivEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXGENDEXTPROC __glewMultiTexGendEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXGENDVEXTPROC __glewMultiTexGendvEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXGENFEXTPROC __glewMultiTexGenfEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXGENFVEXTPROC __glewMultiTexGenfvEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXGENIEXTPROC __glewMultiTexGeniEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXGENIVEXTPROC __glewMultiTexGenivEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXIMAGE1DEXTPROC __glewMultiTexImage1DEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXIMAGE2DEXTPROC __glewMultiTexImage2DEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXIMAGE3DEXTPROC __glewMultiTexImage3DEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXPARAMETERIIVEXTPROC __glewMultiTexParameterIivEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXPARAMETERIUIVEXTPROC __glewMultiTexParameterIuivEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXPARAMETERFEXTPROC __glewMultiTexParameterfEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXPARAMETERFVEXTPROC __glewMultiTexParameterfvEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXPARAMETERIEXTPROC __glewMultiTexParameteriEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXPARAMETERIVEXTPROC __glewMultiTexParameterivEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXRENDERBUFFEREXTPROC __glewMultiTexRenderbufferEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXSUBIMAGE1DEXTPROC __glewMultiTexSubImage1DEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXSUBIMAGE2DEXTPROC __glewMultiTexSubImage2DEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXSUBIMAGE3DEXTPROC __glewMultiTexSubImage3DEXT; +GLEW_FUN_EXPORT PFNGLNAMEDBUFFERDATAEXTPROC __glewNamedBufferDataEXT; +GLEW_FUN_EXPORT PFNGLNAMEDBUFFERSUBDATAEXTPROC __glewNamedBufferSubDataEXT; +GLEW_FUN_EXPORT PFNGLNAMEDCOPYBUFFERSUBDATAEXTPROC __glewNamedCopyBufferSubDataEXT; +GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERRENDERBUFFEREXTPROC __glewNamedFramebufferRenderbufferEXT; +GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERTEXTURE1DEXTPROC __glewNamedFramebufferTexture1DEXT; +GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERTEXTURE2DEXTPROC __glewNamedFramebufferTexture2DEXT; +GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERTEXTURE3DEXTPROC __glewNamedFramebufferTexture3DEXT; +GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERTEXTUREEXTPROC __glewNamedFramebufferTextureEXT; +GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERTEXTUREFACEEXTPROC __glewNamedFramebufferTextureFaceEXT; +GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERTEXTURELAYEREXTPROC __glewNamedFramebufferTextureLayerEXT; +GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETER4DEXTPROC __glewNamedProgramLocalParameter4dEXT; +GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETER4DVEXTPROC __glewNamedProgramLocalParameter4dvEXT; +GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETER4FEXTPROC __glewNamedProgramLocalParameter4fEXT; +GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETER4FVEXTPROC __glewNamedProgramLocalParameter4fvEXT; +GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETERI4IEXTPROC __glewNamedProgramLocalParameterI4iEXT; +GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETERI4IVEXTPROC __glewNamedProgramLocalParameterI4ivEXT; +GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIEXTPROC __glewNamedProgramLocalParameterI4uiEXT; +GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIVEXTPROC __glewNamedProgramLocalParameterI4uivEXT; +GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETERS4FVEXTPROC __glewNamedProgramLocalParameters4fvEXT; +GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETERSI4IVEXTPROC __glewNamedProgramLocalParametersI4ivEXT; +GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETERSI4UIVEXTPROC __glewNamedProgramLocalParametersI4uivEXT; +GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMSTRINGEXTPROC __glewNamedProgramStringEXT; +GLEW_FUN_EXPORT PFNGLNAMEDRENDERBUFFERSTORAGEEXTPROC __glewNamedRenderbufferStorageEXT; +GLEW_FUN_EXPORT PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLECOVERAGEEXTPROC __glewNamedRenderbufferStorageMultisampleCoverageEXT; +GLEW_FUN_EXPORT PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC __glewNamedRenderbufferStorageMultisampleEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1FEXTPROC __glewProgramUniform1fEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1FVEXTPROC __glewProgramUniform1fvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1IEXTPROC __glewProgramUniform1iEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1IVEXTPROC __glewProgramUniform1ivEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1UIEXTPROC __glewProgramUniform1uiEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1UIVEXTPROC __glewProgramUniform1uivEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2FEXTPROC __glewProgramUniform2fEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2FVEXTPROC __glewProgramUniform2fvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2IEXTPROC __glewProgramUniform2iEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2IVEXTPROC __glewProgramUniform2ivEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2UIEXTPROC __glewProgramUniform2uiEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2UIVEXTPROC __glewProgramUniform2uivEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3FEXTPROC __glewProgramUniform3fEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3FVEXTPROC __glewProgramUniform3fvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3IEXTPROC __glewProgramUniform3iEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3IVEXTPROC __glewProgramUniform3ivEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3UIEXTPROC __glewProgramUniform3uiEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3UIVEXTPROC __glewProgramUniform3uivEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4FEXTPROC __glewProgramUniform4fEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4FVEXTPROC __glewProgramUniform4fvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4IEXTPROC __glewProgramUniform4iEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4IVEXTPROC __glewProgramUniform4ivEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4UIEXTPROC __glewProgramUniform4uiEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4UIVEXTPROC __glewProgramUniform4uivEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC __glewProgramUniformMatrix2fvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2X3FVEXTPROC __glewProgramUniformMatrix2x3fvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2X4FVEXTPROC __glewProgramUniformMatrix2x4fvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC __glewProgramUniformMatrix3fvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3X2FVEXTPROC __glewProgramUniformMatrix3x2fvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3X4FVEXTPROC __glewProgramUniformMatrix3x4fvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC __glewProgramUniformMatrix4fvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4X2FVEXTPROC __glewProgramUniformMatrix4x2fvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4X3FVEXTPROC __glewProgramUniformMatrix4x3fvEXT; +GLEW_FUN_EXPORT PFNGLPUSHCLIENTATTRIBDEFAULTEXTPROC __glewPushClientAttribDefaultEXT; +GLEW_FUN_EXPORT PFNGLTEXTUREBUFFEREXTPROC __glewTextureBufferEXT; +GLEW_FUN_EXPORT PFNGLTEXTUREIMAGE1DEXTPROC __glewTextureImage1DEXT; +GLEW_FUN_EXPORT PFNGLTEXTUREIMAGE2DEXTPROC __glewTextureImage2DEXT; +GLEW_FUN_EXPORT PFNGLTEXTUREIMAGE3DEXTPROC __glewTextureImage3DEXT; +GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERIIVEXTPROC __glewTextureParameterIivEXT; +GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERIUIVEXTPROC __glewTextureParameterIuivEXT; +GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERFEXTPROC __glewTextureParameterfEXT; +GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERFVEXTPROC __glewTextureParameterfvEXT; +GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERIEXTPROC __glewTextureParameteriEXT; +GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERIVEXTPROC __glewTextureParameterivEXT; +GLEW_FUN_EXPORT PFNGLTEXTURERENDERBUFFEREXTPROC __glewTextureRenderbufferEXT; +GLEW_FUN_EXPORT PFNGLTEXTURESUBIMAGE1DEXTPROC __glewTextureSubImage1DEXT; +GLEW_FUN_EXPORT PFNGLTEXTURESUBIMAGE2DEXTPROC __glewTextureSubImage2DEXT; +GLEW_FUN_EXPORT PFNGLTEXTURESUBIMAGE3DEXTPROC __glewTextureSubImage3DEXT; +GLEW_FUN_EXPORT PFNGLUNMAPNAMEDBUFFEREXTPROC __glewUnmapNamedBufferEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYCOLOROFFSETEXTPROC __glewVertexArrayColorOffsetEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYEDGEFLAGOFFSETEXTPROC __glewVertexArrayEdgeFlagOffsetEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYFOGCOORDOFFSETEXTPROC __glewVertexArrayFogCoordOffsetEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYINDEXOFFSETEXTPROC __glewVertexArrayIndexOffsetEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYMULTITEXCOORDOFFSETEXTPROC __glewVertexArrayMultiTexCoordOffsetEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYNORMALOFFSETEXTPROC __glewVertexArrayNormalOffsetEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYSECONDARYCOLOROFFSETEXTPROC __glewVertexArraySecondaryColorOffsetEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYTEXCOORDOFFSETEXTPROC __glewVertexArrayTexCoordOffsetEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYVERTEXATTRIBIOFFSETEXTPROC __glewVertexArrayVertexAttribIOffsetEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYVERTEXATTRIBOFFSETEXTPROC __glewVertexArrayVertexAttribOffsetEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYVERTEXOFFSETEXTPROC __glewVertexArrayVertexOffsetEXT; + +GLEW_FUN_EXPORT PFNGLCOLORMASKINDEXEDEXTPROC __glewColorMaskIndexedEXT; +GLEW_FUN_EXPORT PFNGLDISABLEINDEXEDEXTPROC __glewDisableIndexedEXT; +GLEW_FUN_EXPORT PFNGLENABLEINDEXEDEXTPROC __glewEnableIndexedEXT; +GLEW_FUN_EXPORT PFNGLGETBOOLEANINDEXEDVEXTPROC __glewGetBooleanIndexedvEXT; +GLEW_FUN_EXPORT PFNGLGETINTEGERINDEXEDVEXTPROC __glewGetIntegerIndexedvEXT; +GLEW_FUN_EXPORT PFNGLISENABLEDINDEXEDEXTPROC __glewIsEnabledIndexedEXT; + +GLEW_FUN_EXPORT PFNGLDRAWARRAYSINSTANCEDEXTPROC __glewDrawArraysInstancedEXT; +GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDEXTPROC __glewDrawElementsInstancedEXT; + +GLEW_FUN_EXPORT PFNGLDRAWRANGEELEMENTSEXTPROC __glewDrawRangeElementsEXT; + +GLEW_FUN_EXPORT PFNGLFOGCOORDPOINTEREXTPROC __glewFogCoordPointerEXT; +GLEW_FUN_EXPORT PFNGLFOGCOORDDEXTPROC __glewFogCoorddEXT; +GLEW_FUN_EXPORT PFNGLFOGCOORDDVEXTPROC __glewFogCoorddvEXT; +GLEW_FUN_EXPORT PFNGLFOGCOORDFEXTPROC __glewFogCoordfEXT; +GLEW_FUN_EXPORT PFNGLFOGCOORDFVEXTPROC __glewFogCoordfvEXT; + +GLEW_FUN_EXPORT PFNGLFRAGMENTCOLORMATERIALEXTPROC __glewFragmentColorMaterialEXT; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELFEXTPROC __glewFragmentLightModelfEXT; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELFVEXTPROC __glewFragmentLightModelfvEXT; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELIEXTPROC __glewFragmentLightModeliEXT; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELIVEXTPROC __glewFragmentLightModelivEXT; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTFEXTPROC __glewFragmentLightfEXT; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTFVEXTPROC __glewFragmentLightfvEXT; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTIEXTPROC __glewFragmentLightiEXT; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTIVEXTPROC __glewFragmentLightivEXT; +GLEW_FUN_EXPORT PFNGLFRAGMENTMATERIALFEXTPROC __glewFragmentMaterialfEXT; +GLEW_FUN_EXPORT PFNGLFRAGMENTMATERIALFVEXTPROC __glewFragmentMaterialfvEXT; +GLEW_FUN_EXPORT PFNGLFRAGMENTMATERIALIEXTPROC __glewFragmentMaterialiEXT; +GLEW_FUN_EXPORT PFNGLFRAGMENTMATERIALIVEXTPROC __glewFragmentMaterialivEXT; +GLEW_FUN_EXPORT PFNGLGETFRAGMENTLIGHTFVEXTPROC __glewGetFragmentLightfvEXT; +GLEW_FUN_EXPORT PFNGLGETFRAGMENTLIGHTIVEXTPROC __glewGetFragmentLightivEXT; +GLEW_FUN_EXPORT PFNGLGETFRAGMENTMATERIALFVEXTPROC __glewGetFragmentMaterialfvEXT; +GLEW_FUN_EXPORT PFNGLGETFRAGMENTMATERIALIVEXTPROC __glewGetFragmentMaterialivEXT; +GLEW_FUN_EXPORT PFNGLLIGHTENVIEXTPROC __glewLightEnviEXT; + +GLEW_FUN_EXPORT PFNGLBLITFRAMEBUFFEREXTPROC __glewBlitFramebufferEXT; + +GLEW_FUN_EXPORT PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC __glewRenderbufferStorageMultisampleEXT; + +GLEW_FUN_EXPORT PFNGLBINDFRAMEBUFFEREXTPROC __glewBindFramebufferEXT; +GLEW_FUN_EXPORT PFNGLBINDRENDERBUFFEREXTPROC __glewBindRenderbufferEXT; +GLEW_FUN_EXPORT PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC __glewCheckFramebufferStatusEXT; +GLEW_FUN_EXPORT PFNGLDELETEFRAMEBUFFERSEXTPROC __glewDeleteFramebuffersEXT; +GLEW_FUN_EXPORT PFNGLDELETERENDERBUFFERSEXTPROC __glewDeleteRenderbuffersEXT; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC __glewFramebufferRenderbufferEXT; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURE1DEXTPROC __glewFramebufferTexture1DEXT; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURE2DEXTPROC __glewFramebufferTexture2DEXT; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURE3DEXTPROC __glewFramebufferTexture3DEXT; +GLEW_FUN_EXPORT PFNGLGENFRAMEBUFFERSEXTPROC __glewGenFramebuffersEXT; +GLEW_FUN_EXPORT PFNGLGENRENDERBUFFERSEXTPROC __glewGenRenderbuffersEXT; +GLEW_FUN_EXPORT PFNGLGENERATEMIPMAPEXTPROC __glewGenerateMipmapEXT; +GLEW_FUN_EXPORT PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC __glewGetFramebufferAttachmentParameterivEXT; +GLEW_FUN_EXPORT PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC __glewGetRenderbufferParameterivEXT; +GLEW_FUN_EXPORT PFNGLISFRAMEBUFFEREXTPROC __glewIsFramebufferEXT; +GLEW_FUN_EXPORT PFNGLISRENDERBUFFEREXTPROC __glewIsRenderbufferEXT; +GLEW_FUN_EXPORT PFNGLRENDERBUFFERSTORAGEEXTPROC __glewRenderbufferStorageEXT; + +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTUREEXTPROC __glewFramebufferTextureEXT; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTUREFACEEXTPROC __glewFramebufferTextureFaceEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETERIEXTPROC __glewProgramParameteriEXT; + +GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETERS4FVEXTPROC __glewProgramEnvParameters4fvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETERS4FVEXTPROC __glewProgramLocalParameters4fvEXT; + +GLEW_FUN_EXPORT PFNGLBINDFRAGDATALOCATIONEXTPROC __glewBindFragDataLocationEXT; +GLEW_FUN_EXPORT PFNGLGETFRAGDATALOCATIONEXTPROC __glewGetFragDataLocationEXT; +GLEW_FUN_EXPORT PFNGLGETUNIFORMUIVEXTPROC __glewGetUniformuivEXT; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBIIVEXTPROC __glewGetVertexAttribIivEXT; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBIUIVEXTPROC __glewGetVertexAttribIuivEXT; +GLEW_FUN_EXPORT PFNGLUNIFORM1UIEXTPROC __glewUniform1uiEXT; +GLEW_FUN_EXPORT PFNGLUNIFORM1UIVEXTPROC __glewUniform1uivEXT; +GLEW_FUN_EXPORT PFNGLUNIFORM2UIEXTPROC __glewUniform2uiEXT; +GLEW_FUN_EXPORT PFNGLUNIFORM2UIVEXTPROC __glewUniform2uivEXT; +GLEW_FUN_EXPORT PFNGLUNIFORM3UIEXTPROC __glewUniform3uiEXT; +GLEW_FUN_EXPORT PFNGLUNIFORM3UIVEXTPROC __glewUniform3uivEXT; +GLEW_FUN_EXPORT PFNGLUNIFORM4UIEXTPROC __glewUniform4uiEXT; +GLEW_FUN_EXPORT PFNGLUNIFORM4UIVEXTPROC __glewUniform4uivEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI1IEXTPROC __glewVertexAttribI1iEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI1IVEXTPROC __glewVertexAttribI1ivEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI1UIEXTPROC __glewVertexAttribI1uiEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI1UIVEXTPROC __glewVertexAttribI1uivEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI2IEXTPROC __glewVertexAttribI2iEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI2IVEXTPROC __glewVertexAttribI2ivEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI2UIEXTPROC __glewVertexAttribI2uiEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI2UIVEXTPROC __glewVertexAttribI2uivEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI3IEXTPROC __glewVertexAttribI3iEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI3IVEXTPROC __glewVertexAttribI3ivEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI3UIEXTPROC __glewVertexAttribI3uiEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI3UIVEXTPROC __glewVertexAttribI3uivEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4BVEXTPROC __glewVertexAttribI4bvEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4IEXTPROC __glewVertexAttribI4iEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4IVEXTPROC __glewVertexAttribI4ivEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4SVEXTPROC __glewVertexAttribI4svEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4UBVEXTPROC __glewVertexAttribI4ubvEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4UIEXTPROC __glewVertexAttribI4uiEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4UIVEXTPROC __glewVertexAttribI4uivEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4USVEXTPROC __glewVertexAttribI4usvEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBIPOINTEREXTPROC __glewVertexAttribIPointerEXT; + +GLEW_FUN_EXPORT PFNGLGETHISTOGRAMEXTPROC __glewGetHistogramEXT; +GLEW_FUN_EXPORT PFNGLGETHISTOGRAMPARAMETERFVEXTPROC __glewGetHistogramParameterfvEXT; +GLEW_FUN_EXPORT PFNGLGETHISTOGRAMPARAMETERIVEXTPROC __glewGetHistogramParameterivEXT; +GLEW_FUN_EXPORT PFNGLGETMINMAXEXTPROC __glewGetMinmaxEXT; +GLEW_FUN_EXPORT PFNGLGETMINMAXPARAMETERFVEXTPROC __glewGetMinmaxParameterfvEXT; +GLEW_FUN_EXPORT PFNGLGETMINMAXPARAMETERIVEXTPROC __glewGetMinmaxParameterivEXT; +GLEW_FUN_EXPORT PFNGLHISTOGRAMEXTPROC __glewHistogramEXT; +GLEW_FUN_EXPORT PFNGLMINMAXEXTPROC __glewMinmaxEXT; +GLEW_FUN_EXPORT PFNGLRESETHISTOGRAMEXTPROC __glewResetHistogramEXT; +GLEW_FUN_EXPORT PFNGLRESETMINMAXEXTPROC __glewResetMinmaxEXT; + +GLEW_FUN_EXPORT PFNGLINDEXFUNCEXTPROC __glewIndexFuncEXT; + +GLEW_FUN_EXPORT PFNGLINDEXMATERIALEXTPROC __glewIndexMaterialEXT; + +GLEW_FUN_EXPORT PFNGLAPPLYTEXTUREEXTPROC __glewApplyTextureEXT; +GLEW_FUN_EXPORT PFNGLTEXTURELIGHTEXTPROC __glewTextureLightEXT; +GLEW_FUN_EXPORT PFNGLTEXTUREMATERIALEXTPROC __glewTextureMaterialEXT; + +GLEW_FUN_EXPORT PFNGLMULTIDRAWARRAYSEXTPROC __glewMultiDrawArraysEXT; +GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTSEXTPROC __glewMultiDrawElementsEXT; + +GLEW_FUN_EXPORT PFNGLSAMPLEMASKEXTPROC __glewSampleMaskEXT; +GLEW_FUN_EXPORT PFNGLSAMPLEPATTERNEXTPROC __glewSamplePatternEXT; + +GLEW_FUN_EXPORT PFNGLCOLORTABLEEXTPROC __glewColorTableEXT; +GLEW_FUN_EXPORT PFNGLGETCOLORTABLEEXTPROC __glewGetColorTableEXT; +GLEW_FUN_EXPORT PFNGLGETCOLORTABLEPARAMETERFVEXTPROC __glewGetColorTableParameterfvEXT; +GLEW_FUN_EXPORT PFNGLGETCOLORTABLEPARAMETERIVEXTPROC __glewGetColorTableParameterivEXT; + +GLEW_FUN_EXPORT PFNGLGETPIXELTRANSFORMPARAMETERFVEXTPROC __glewGetPixelTransformParameterfvEXT; +GLEW_FUN_EXPORT PFNGLGETPIXELTRANSFORMPARAMETERIVEXTPROC __glewGetPixelTransformParameterivEXT; +GLEW_FUN_EXPORT PFNGLPIXELTRANSFORMPARAMETERFEXTPROC __glewPixelTransformParameterfEXT; +GLEW_FUN_EXPORT PFNGLPIXELTRANSFORMPARAMETERFVEXTPROC __glewPixelTransformParameterfvEXT; +GLEW_FUN_EXPORT PFNGLPIXELTRANSFORMPARAMETERIEXTPROC __glewPixelTransformParameteriEXT; +GLEW_FUN_EXPORT PFNGLPIXELTRANSFORMPARAMETERIVEXTPROC __glewPixelTransformParameterivEXT; + +GLEW_FUN_EXPORT PFNGLPOINTPARAMETERFEXTPROC __glewPointParameterfEXT; +GLEW_FUN_EXPORT PFNGLPOINTPARAMETERFVEXTPROC __glewPointParameterfvEXT; + +GLEW_FUN_EXPORT PFNGLPOLYGONOFFSETEXTPROC __glewPolygonOffsetEXT; + +GLEW_FUN_EXPORT PFNGLPROVOKINGVERTEXEXTPROC __glewProvokingVertexEXT; + +GLEW_FUN_EXPORT PFNGLBEGINSCENEEXTPROC __glewBeginSceneEXT; +GLEW_FUN_EXPORT PFNGLENDSCENEEXTPROC __glewEndSceneEXT; + +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3BEXTPROC __glewSecondaryColor3bEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3BVEXTPROC __glewSecondaryColor3bvEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3DEXTPROC __glewSecondaryColor3dEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3DVEXTPROC __glewSecondaryColor3dvEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3FEXTPROC __glewSecondaryColor3fEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3FVEXTPROC __glewSecondaryColor3fvEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3IEXTPROC __glewSecondaryColor3iEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3IVEXTPROC __glewSecondaryColor3ivEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3SEXTPROC __glewSecondaryColor3sEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3SVEXTPROC __glewSecondaryColor3svEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UBEXTPROC __glewSecondaryColor3ubEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UBVEXTPROC __glewSecondaryColor3ubvEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UIEXTPROC __glewSecondaryColor3uiEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UIVEXTPROC __glewSecondaryColor3uivEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3USEXTPROC __glewSecondaryColor3usEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3USVEXTPROC __glewSecondaryColor3usvEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLORPOINTEREXTPROC __glewSecondaryColorPointerEXT; + +GLEW_FUN_EXPORT PFNGLACTIVEPROGRAMEXTPROC __glewActiveProgramEXT; +GLEW_FUN_EXPORT PFNGLCREATESHADERPROGRAMEXTPROC __glewCreateShaderProgramEXT; +GLEW_FUN_EXPORT PFNGLUSESHADERPROGRAMEXTPROC __glewUseShaderProgramEXT; + +GLEW_FUN_EXPORT PFNGLBINDIMAGETEXTUREEXTPROC __glewBindImageTextureEXT; +GLEW_FUN_EXPORT PFNGLMEMORYBARRIEREXTPROC __glewMemoryBarrierEXT; + +GLEW_FUN_EXPORT PFNGLACTIVESTENCILFACEEXTPROC __glewActiveStencilFaceEXT; + +GLEW_FUN_EXPORT PFNGLTEXSUBIMAGE1DEXTPROC __glewTexSubImage1DEXT; +GLEW_FUN_EXPORT PFNGLTEXSUBIMAGE2DEXTPROC __glewTexSubImage2DEXT; +GLEW_FUN_EXPORT PFNGLTEXSUBIMAGE3DEXTPROC __glewTexSubImage3DEXT; + +GLEW_FUN_EXPORT PFNGLTEXIMAGE3DEXTPROC __glewTexImage3DEXT; + +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC __glewFramebufferTextureLayerEXT; + +GLEW_FUN_EXPORT PFNGLTEXBUFFEREXTPROC __glewTexBufferEXT; + +GLEW_FUN_EXPORT PFNGLCLEARCOLORIIEXTPROC __glewClearColorIiEXT; +GLEW_FUN_EXPORT PFNGLCLEARCOLORIUIEXTPROC __glewClearColorIuiEXT; +GLEW_FUN_EXPORT PFNGLGETTEXPARAMETERIIVEXTPROC __glewGetTexParameterIivEXT; +GLEW_FUN_EXPORT PFNGLGETTEXPARAMETERIUIVEXTPROC __glewGetTexParameterIuivEXT; +GLEW_FUN_EXPORT PFNGLTEXPARAMETERIIVEXTPROC __glewTexParameterIivEXT; +GLEW_FUN_EXPORT PFNGLTEXPARAMETERIUIVEXTPROC __glewTexParameterIuivEXT; + +GLEW_FUN_EXPORT PFNGLARETEXTURESRESIDENTEXTPROC __glewAreTexturesResidentEXT; +GLEW_FUN_EXPORT PFNGLBINDTEXTUREEXTPROC __glewBindTextureEXT; +GLEW_FUN_EXPORT PFNGLDELETETEXTURESEXTPROC __glewDeleteTexturesEXT; +GLEW_FUN_EXPORT PFNGLGENTEXTURESEXTPROC __glewGenTexturesEXT; +GLEW_FUN_EXPORT PFNGLISTEXTUREEXTPROC __glewIsTextureEXT; +GLEW_FUN_EXPORT PFNGLPRIORITIZETEXTURESEXTPROC __glewPrioritizeTexturesEXT; + +GLEW_FUN_EXPORT PFNGLTEXTURENORMALEXTPROC __glewTextureNormalEXT; + +GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTI64VEXTPROC __glewGetQueryObjecti64vEXT; +GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTUI64VEXTPROC __glewGetQueryObjectui64vEXT; + +GLEW_FUN_EXPORT PFNGLBEGINTRANSFORMFEEDBACKEXTPROC __glewBeginTransformFeedbackEXT; +GLEW_FUN_EXPORT PFNGLBINDBUFFERBASEEXTPROC __glewBindBufferBaseEXT; +GLEW_FUN_EXPORT PFNGLBINDBUFFEROFFSETEXTPROC __glewBindBufferOffsetEXT; +GLEW_FUN_EXPORT PFNGLBINDBUFFERRANGEEXTPROC __glewBindBufferRangeEXT; +GLEW_FUN_EXPORT PFNGLENDTRANSFORMFEEDBACKEXTPROC __glewEndTransformFeedbackEXT; +GLEW_FUN_EXPORT PFNGLGETTRANSFORMFEEDBACKVARYINGEXTPROC __glewGetTransformFeedbackVaryingEXT; +GLEW_FUN_EXPORT PFNGLTRANSFORMFEEDBACKVARYINGSEXTPROC __glewTransformFeedbackVaryingsEXT; + +GLEW_FUN_EXPORT PFNGLARRAYELEMENTEXTPROC __glewArrayElementEXT; +GLEW_FUN_EXPORT PFNGLCOLORPOINTEREXTPROC __glewColorPointerEXT; +GLEW_FUN_EXPORT PFNGLDRAWARRAYSEXTPROC __glewDrawArraysEXT; +GLEW_FUN_EXPORT PFNGLEDGEFLAGPOINTEREXTPROC __glewEdgeFlagPointerEXT; +GLEW_FUN_EXPORT PFNGLINDEXPOINTEREXTPROC __glewIndexPointerEXT; +GLEW_FUN_EXPORT PFNGLNORMALPOINTEREXTPROC __glewNormalPointerEXT; +GLEW_FUN_EXPORT PFNGLTEXCOORDPOINTEREXTPROC __glewTexCoordPointerEXT; +GLEW_FUN_EXPORT PFNGLVERTEXPOINTEREXTPROC __glewVertexPointerEXT; + +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBLDVEXTPROC __glewGetVertexAttribLdvEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYVERTEXATTRIBLOFFSETEXTPROC __glewVertexArrayVertexAttribLOffsetEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1DEXTPROC __glewVertexAttribL1dEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1DVEXTPROC __glewVertexAttribL1dvEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL2DEXTPROC __glewVertexAttribL2dEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL2DVEXTPROC __glewVertexAttribL2dvEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL3DEXTPROC __glewVertexAttribL3dEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL3DVEXTPROC __glewVertexAttribL3dvEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL4DEXTPROC __glewVertexAttribL4dEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL4DVEXTPROC __glewVertexAttribL4dvEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBLPOINTEREXTPROC __glewVertexAttribLPointerEXT; + +GLEW_FUN_EXPORT PFNGLBEGINVERTEXSHADEREXTPROC __glewBeginVertexShaderEXT; +GLEW_FUN_EXPORT PFNGLBINDLIGHTPARAMETEREXTPROC __glewBindLightParameterEXT; +GLEW_FUN_EXPORT PFNGLBINDMATERIALPARAMETEREXTPROC __glewBindMaterialParameterEXT; +GLEW_FUN_EXPORT PFNGLBINDPARAMETEREXTPROC __glewBindParameterEXT; +GLEW_FUN_EXPORT PFNGLBINDTEXGENPARAMETEREXTPROC __glewBindTexGenParameterEXT; +GLEW_FUN_EXPORT PFNGLBINDTEXTUREUNITPARAMETEREXTPROC __glewBindTextureUnitParameterEXT; +GLEW_FUN_EXPORT PFNGLBINDVERTEXSHADEREXTPROC __glewBindVertexShaderEXT; +GLEW_FUN_EXPORT PFNGLDELETEVERTEXSHADEREXTPROC __glewDeleteVertexShaderEXT; +GLEW_FUN_EXPORT PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC __glewDisableVariantClientStateEXT; +GLEW_FUN_EXPORT PFNGLENABLEVARIANTCLIENTSTATEEXTPROC __glewEnableVariantClientStateEXT; +GLEW_FUN_EXPORT PFNGLENDVERTEXSHADEREXTPROC __glewEndVertexShaderEXT; +GLEW_FUN_EXPORT PFNGLEXTRACTCOMPONENTEXTPROC __glewExtractComponentEXT; +GLEW_FUN_EXPORT PFNGLGENSYMBOLSEXTPROC __glewGenSymbolsEXT; +GLEW_FUN_EXPORT PFNGLGENVERTEXSHADERSEXTPROC __glewGenVertexShadersEXT; +GLEW_FUN_EXPORT PFNGLGETINVARIANTBOOLEANVEXTPROC __glewGetInvariantBooleanvEXT; +GLEW_FUN_EXPORT PFNGLGETINVARIANTFLOATVEXTPROC __glewGetInvariantFloatvEXT; +GLEW_FUN_EXPORT PFNGLGETINVARIANTINTEGERVEXTPROC __glewGetInvariantIntegervEXT; +GLEW_FUN_EXPORT PFNGLGETLOCALCONSTANTBOOLEANVEXTPROC __glewGetLocalConstantBooleanvEXT; +GLEW_FUN_EXPORT PFNGLGETLOCALCONSTANTFLOATVEXTPROC __glewGetLocalConstantFloatvEXT; +GLEW_FUN_EXPORT PFNGLGETLOCALCONSTANTINTEGERVEXTPROC __glewGetLocalConstantIntegervEXT; +GLEW_FUN_EXPORT PFNGLGETVARIANTBOOLEANVEXTPROC __glewGetVariantBooleanvEXT; +GLEW_FUN_EXPORT PFNGLGETVARIANTFLOATVEXTPROC __glewGetVariantFloatvEXT; +GLEW_FUN_EXPORT PFNGLGETVARIANTINTEGERVEXTPROC __glewGetVariantIntegervEXT; +GLEW_FUN_EXPORT PFNGLGETVARIANTPOINTERVEXTPROC __glewGetVariantPointervEXT; +GLEW_FUN_EXPORT PFNGLINSERTCOMPONENTEXTPROC __glewInsertComponentEXT; +GLEW_FUN_EXPORT PFNGLISVARIANTENABLEDEXTPROC __glewIsVariantEnabledEXT; +GLEW_FUN_EXPORT PFNGLSETINVARIANTEXTPROC __glewSetInvariantEXT; +GLEW_FUN_EXPORT PFNGLSETLOCALCONSTANTEXTPROC __glewSetLocalConstantEXT; +GLEW_FUN_EXPORT PFNGLSHADEROP1EXTPROC __glewShaderOp1EXT; +GLEW_FUN_EXPORT PFNGLSHADEROP2EXTPROC __glewShaderOp2EXT; +GLEW_FUN_EXPORT PFNGLSHADEROP3EXTPROC __glewShaderOp3EXT; +GLEW_FUN_EXPORT PFNGLSWIZZLEEXTPROC __glewSwizzleEXT; +GLEW_FUN_EXPORT PFNGLVARIANTPOINTEREXTPROC __glewVariantPointerEXT; +GLEW_FUN_EXPORT PFNGLVARIANTBVEXTPROC __glewVariantbvEXT; +GLEW_FUN_EXPORT PFNGLVARIANTDVEXTPROC __glewVariantdvEXT; +GLEW_FUN_EXPORT PFNGLVARIANTFVEXTPROC __glewVariantfvEXT; +GLEW_FUN_EXPORT PFNGLVARIANTIVEXTPROC __glewVariantivEXT; +GLEW_FUN_EXPORT PFNGLVARIANTSVEXTPROC __glewVariantsvEXT; +GLEW_FUN_EXPORT PFNGLVARIANTUBVEXTPROC __glewVariantubvEXT; +GLEW_FUN_EXPORT PFNGLVARIANTUIVEXTPROC __glewVariantuivEXT; +GLEW_FUN_EXPORT PFNGLVARIANTUSVEXTPROC __glewVariantusvEXT; +GLEW_FUN_EXPORT PFNGLWRITEMASKEXTPROC __glewWriteMaskEXT; + +GLEW_FUN_EXPORT PFNGLVERTEXWEIGHTPOINTEREXTPROC __glewVertexWeightPointerEXT; +GLEW_FUN_EXPORT PFNGLVERTEXWEIGHTFEXTPROC __glewVertexWeightfEXT; +GLEW_FUN_EXPORT PFNGLVERTEXWEIGHTFVEXTPROC __glewVertexWeightfvEXT; + +GLEW_FUN_EXPORT PFNGLIMPORTSYNCEXTPROC __glewImportSyncEXT; + +GLEW_FUN_EXPORT PFNGLFRAMETERMINATORGREMEDYPROC __glewFrameTerminatorGREMEDY; + +GLEW_FUN_EXPORT PFNGLSTRINGMARKERGREMEDYPROC __glewStringMarkerGREMEDY; + +GLEW_FUN_EXPORT PFNGLGETIMAGETRANSFORMPARAMETERFVHPPROC __glewGetImageTransformParameterfvHP; +GLEW_FUN_EXPORT PFNGLGETIMAGETRANSFORMPARAMETERIVHPPROC __glewGetImageTransformParameterivHP; +GLEW_FUN_EXPORT PFNGLIMAGETRANSFORMPARAMETERFHPPROC __glewImageTransformParameterfHP; +GLEW_FUN_EXPORT PFNGLIMAGETRANSFORMPARAMETERFVHPPROC __glewImageTransformParameterfvHP; +GLEW_FUN_EXPORT PFNGLIMAGETRANSFORMPARAMETERIHPPROC __glewImageTransformParameteriHP; +GLEW_FUN_EXPORT PFNGLIMAGETRANSFORMPARAMETERIVHPPROC __glewImageTransformParameterivHP; + +GLEW_FUN_EXPORT PFNGLMULTIMODEDRAWARRAYSIBMPROC __glewMultiModeDrawArraysIBM; +GLEW_FUN_EXPORT PFNGLMULTIMODEDRAWELEMENTSIBMPROC __glewMultiModeDrawElementsIBM; + +GLEW_FUN_EXPORT PFNGLCOLORPOINTERLISTIBMPROC __glewColorPointerListIBM; +GLEW_FUN_EXPORT PFNGLEDGEFLAGPOINTERLISTIBMPROC __glewEdgeFlagPointerListIBM; +GLEW_FUN_EXPORT PFNGLFOGCOORDPOINTERLISTIBMPROC __glewFogCoordPointerListIBM; +GLEW_FUN_EXPORT PFNGLINDEXPOINTERLISTIBMPROC __glewIndexPointerListIBM; +GLEW_FUN_EXPORT PFNGLNORMALPOINTERLISTIBMPROC __glewNormalPointerListIBM; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLORPOINTERLISTIBMPROC __glewSecondaryColorPointerListIBM; +GLEW_FUN_EXPORT PFNGLTEXCOORDPOINTERLISTIBMPROC __glewTexCoordPointerListIBM; +GLEW_FUN_EXPORT PFNGLVERTEXPOINTERLISTIBMPROC __glewVertexPointerListIBM; + +GLEW_FUN_EXPORT PFNGLMAPTEXTURE2DINTELPROC __glewMapTexture2DINTEL; +GLEW_FUN_EXPORT PFNGLSYNCTEXTUREINTELPROC __glewSyncTextureINTEL; +GLEW_FUN_EXPORT PFNGLUNMAPTEXTURE2DINTELPROC __glewUnmapTexture2DINTEL; + +GLEW_FUN_EXPORT PFNGLCOLORPOINTERVINTELPROC __glewColorPointervINTEL; +GLEW_FUN_EXPORT PFNGLNORMALPOINTERVINTELPROC __glewNormalPointervINTEL; +GLEW_FUN_EXPORT PFNGLTEXCOORDPOINTERVINTELPROC __glewTexCoordPointervINTEL; +GLEW_FUN_EXPORT PFNGLVERTEXPOINTERVINTELPROC __glewVertexPointervINTEL; + +GLEW_FUN_EXPORT PFNGLTEXSCISSORFUNCINTELPROC __glewTexScissorFuncINTEL; +GLEW_FUN_EXPORT PFNGLTEXSCISSORINTELPROC __glewTexScissorINTEL; + +GLEW_FUN_EXPORT PFNGLDEBUGMESSAGECALLBACKPROC __glewDebugMessageCallback; +GLEW_FUN_EXPORT PFNGLDEBUGMESSAGECONTROLPROC __glewDebugMessageControl; +GLEW_FUN_EXPORT PFNGLDEBUGMESSAGEINSERTPROC __glewDebugMessageInsert; +GLEW_FUN_EXPORT PFNGLGETDEBUGMESSAGELOGPROC __glewGetDebugMessageLog; +GLEW_FUN_EXPORT PFNGLGETOBJECTLABELPROC __glewGetObjectLabel; +GLEW_FUN_EXPORT PFNGLGETOBJECTPTRLABELPROC __glewGetObjectPtrLabel; +GLEW_FUN_EXPORT PFNGLOBJECTLABELPROC __glewObjectLabel; +GLEW_FUN_EXPORT PFNGLOBJECTPTRLABELPROC __glewObjectPtrLabel; +GLEW_FUN_EXPORT PFNGLPOPDEBUGGROUPPROC __glewPopDebugGroup; +GLEW_FUN_EXPORT PFNGLPUSHDEBUGGROUPPROC __glewPushDebugGroup; + +GLEW_FUN_EXPORT PFNGLBUFFERREGIONENABLEDPROC __glewBufferRegionEnabled; +GLEW_FUN_EXPORT PFNGLDELETEBUFFERREGIONPROC __glewDeleteBufferRegion; +GLEW_FUN_EXPORT PFNGLDRAWBUFFERREGIONPROC __glewDrawBufferRegion; +GLEW_FUN_EXPORT PFNGLNEWBUFFERREGIONPROC __glewNewBufferRegion; +GLEW_FUN_EXPORT PFNGLREADBUFFERREGIONPROC __glewReadBufferRegion; + +GLEW_FUN_EXPORT PFNGLRESIZEBUFFERSMESAPROC __glewResizeBuffersMESA; + +GLEW_FUN_EXPORT PFNGLWINDOWPOS2DMESAPROC __glewWindowPos2dMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2DVMESAPROC __glewWindowPos2dvMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2FMESAPROC __glewWindowPos2fMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2FVMESAPROC __glewWindowPos2fvMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2IMESAPROC __glewWindowPos2iMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2IVMESAPROC __glewWindowPos2ivMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2SMESAPROC __glewWindowPos2sMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2SVMESAPROC __glewWindowPos2svMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3DMESAPROC __glewWindowPos3dMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3DVMESAPROC __glewWindowPos3dvMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3FMESAPROC __glewWindowPos3fMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3FVMESAPROC __glewWindowPos3fvMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3IMESAPROC __glewWindowPos3iMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3IVMESAPROC __glewWindowPos3ivMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3SMESAPROC __glewWindowPos3sMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3SVMESAPROC __glewWindowPos3svMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS4DMESAPROC __glewWindowPos4dMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS4DVMESAPROC __glewWindowPos4dvMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS4FMESAPROC __glewWindowPos4fMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS4FVMESAPROC __glewWindowPos4fvMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS4IMESAPROC __glewWindowPos4iMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS4IVMESAPROC __glewWindowPos4ivMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS4SMESAPROC __glewWindowPos4sMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS4SVMESAPROC __glewWindowPos4svMESA; + +GLEW_FUN_EXPORT PFNGLBEGINCONDITIONALRENDERNVXPROC __glewBeginConditionalRenderNVX; +GLEW_FUN_EXPORT PFNGLENDCONDITIONALRENDERNVXPROC __glewEndConditionalRenderNVX; + +GLEW_FUN_EXPORT PFNGLMULTIDRAWARRAYSINDIRECTBINDLESSNVPROC __glewMultiDrawArraysIndirectBindlessNV; +GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTSINDIRECTBINDLESSNVPROC __glewMultiDrawElementsIndirectBindlessNV; + +GLEW_FUN_EXPORT PFNGLGETIMAGEHANDLENVPROC __glewGetImageHandleNV; +GLEW_FUN_EXPORT PFNGLGETTEXTUREHANDLENVPROC __glewGetTextureHandleNV; +GLEW_FUN_EXPORT PFNGLGETTEXTURESAMPLERHANDLENVPROC __glewGetTextureSamplerHandleNV; +GLEW_FUN_EXPORT PFNGLISIMAGEHANDLERESIDENTNVPROC __glewIsImageHandleResidentNV; +GLEW_FUN_EXPORT PFNGLISTEXTUREHANDLERESIDENTNVPROC __glewIsTextureHandleResidentNV; +GLEW_FUN_EXPORT PFNGLMAKEIMAGEHANDLENONRESIDENTNVPROC __glewMakeImageHandleNonResidentNV; +GLEW_FUN_EXPORT PFNGLMAKEIMAGEHANDLERESIDENTNVPROC __glewMakeImageHandleResidentNV; +GLEW_FUN_EXPORT PFNGLMAKETEXTUREHANDLENONRESIDENTNVPROC __glewMakeTextureHandleNonResidentNV; +GLEW_FUN_EXPORT PFNGLMAKETEXTUREHANDLERESIDENTNVPROC __glewMakeTextureHandleResidentNV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMHANDLEUI64NVPROC __glewProgramUniformHandleui64NV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMHANDLEUI64VNVPROC __glewProgramUniformHandleui64vNV; +GLEW_FUN_EXPORT PFNGLUNIFORMHANDLEUI64NVPROC __glewUniformHandleui64NV; +GLEW_FUN_EXPORT PFNGLUNIFORMHANDLEUI64VNVPROC __glewUniformHandleui64vNV; + +GLEW_FUN_EXPORT PFNGLBLENDBARRIERNVPROC __glewBlendBarrierNV; +GLEW_FUN_EXPORT PFNGLBLENDPARAMETERINVPROC __glewBlendParameteriNV; + +GLEW_FUN_EXPORT PFNGLBEGINCONDITIONALRENDERNVPROC __glewBeginConditionalRenderNV; +GLEW_FUN_EXPORT PFNGLENDCONDITIONALRENDERNVPROC __glewEndConditionalRenderNV; + +GLEW_FUN_EXPORT PFNGLCOPYIMAGESUBDATANVPROC __glewCopyImageSubDataNV; + +GLEW_FUN_EXPORT PFNGLCLEARDEPTHDNVPROC __glewClearDepthdNV; +GLEW_FUN_EXPORT PFNGLDEPTHBOUNDSDNVPROC __glewDepthBoundsdNV; +GLEW_FUN_EXPORT PFNGLDEPTHRANGEDNVPROC __glewDepthRangedNV; + +GLEW_FUN_EXPORT PFNGLDRAWTEXTURENVPROC __glewDrawTextureNV; + +GLEW_FUN_EXPORT PFNGLEVALMAPSNVPROC __glewEvalMapsNV; +GLEW_FUN_EXPORT PFNGLGETMAPATTRIBPARAMETERFVNVPROC __glewGetMapAttribParameterfvNV; +GLEW_FUN_EXPORT PFNGLGETMAPATTRIBPARAMETERIVNVPROC __glewGetMapAttribParameterivNV; +GLEW_FUN_EXPORT PFNGLGETMAPCONTROLPOINTSNVPROC __glewGetMapControlPointsNV; +GLEW_FUN_EXPORT PFNGLGETMAPPARAMETERFVNVPROC __glewGetMapParameterfvNV; +GLEW_FUN_EXPORT PFNGLGETMAPPARAMETERIVNVPROC __glewGetMapParameterivNV; +GLEW_FUN_EXPORT PFNGLMAPCONTROLPOINTSNVPROC __glewMapControlPointsNV; +GLEW_FUN_EXPORT PFNGLMAPPARAMETERFVNVPROC __glewMapParameterfvNV; +GLEW_FUN_EXPORT PFNGLMAPPARAMETERIVNVPROC __glewMapParameterivNV; + +GLEW_FUN_EXPORT PFNGLGETMULTISAMPLEFVNVPROC __glewGetMultisamplefvNV; +GLEW_FUN_EXPORT PFNGLSAMPLEMASKINDEXEDNVPROC __glewSampleMaskIndexedNV; +GLEW_FUN_EXPORT PFNGLTEXRENDERBUFFERNVPROC __glewTexRenderbufferNV; + +GLEW_FUN_EXPORT PFNGLDELETEFENCESNVPROC __glewDeleteFencesNV; +GLEW_FUN_EXPORT PFNGLFINISHFENCENVPROC __glewFinishFenceNV; +GLEW_FUN_EXPORT PFNGLGENFENCESNVPROC __glewGenFencesNV; +GLEW_FUN_EXPORT PFNGLGETFENCEIVNVPROC __glewGetFenceivNV; +GLEW_FUN_EXPORT PFNGLISFENCENVPROC __glewIsFenceNV; +GLEW_FUN_EXPORT PFNGLSETFENCENVPROC __glewSetFenceNV; +GLEW_FUN_EXPORT PFNGLTESTFENCENVPROC __glewTestFenceNV; + +GLEW_FUN_EXPORT PFNGLGETPROGRAMNAMEDPARAMETERDVNVPROC __glewGetProgramNamedParameterdvNV; +GLEW_FUN_EXPORT PFNGLGETPROGRAMNAMEDPARAMETERFVNVPROC __glewGetProgramNamedParameterfvNV; +GLEW_FUN_EXPORT PFNGLPROGRAMNAMEDPARAMETER4DNVPROC __glewProgramNamedParameter4dNV; +GLEW_FUN_EXPORT PFNGLPROGRAMNAMEDPARAMETER4DVNVPROC __glewProgramNamedParameter4dvNV; +GLEW_FUN_EXPORT PFNGLPROGRAMNAMEDPARAMETER4FNVPROC __glewProgramNamedParameter4fNV; +GLEW_FUN_EXPORT PFNGLPROGRAMNAMEDPARAMETER4FVNVPROC __glewProgramNamedParameter4fvNV; + +GLEW_FUN_EXPORT PFNGLRENDERBUFFERSTORAGEMULTISAMPLECOVERAGENVPROC __glewRenderbufferStorageMultisampleCoverageNV; + +GLEW_FUN_EXPORT PFNGLPROGRAMVERTEXLIMITNVPROC __glewProgramVertexLimitNV; + +GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETERI4INVPROC __glewProgramEnvParameterI4iNV; +GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETERI4IVNVPROC __glewProgramEnvParameterI4ivNV; +GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETERI4UINVPROC __glewProgramEnvParameterI4uiNV; +GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETERI4UIVNVPROC __glewProgramEnvParameterI4uivNV; +GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETERSI4IVNVPROC __glewProgramEnvParametersI4ivNV; +GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETERSI4UIVNVPROC __glewProgramEnvParametersI4uivNV; +GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETERI4INVPROC __glewProgramLocalParameterI4iNV; +GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETERI4IVNVPROC __glewProgramLocalParameterI4ivNV; +GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETERI4UINVPROC __glewProgramLocalParameterI4uiNV; +GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETERI4UIVNVPROC __glewProgramLocalParameterI4uivNV; +GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETERSI4IVNVPROC __glewProgramLocalParametersI4ivNV; +GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETERSI4UIVNVPROC __glewProgramLocalParametersI4uivNV; + +GLEW_FUN_EXPORT PFNGLGETUNIFORMI64VNVPROC __glewGetUniformi64vNV; +GLEW_FUN_EXPORT PFNGLGETUNIFORMUI64VNVPROC __glewGetUniformui64vNV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1I64NVPROC __glewProgramUniform1i64NV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1I64VNVPROC __glewProgramUniform1i64vNV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1UI64NVPROC __glewProgramUniform1ui64NV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1UI64VNVPROC __glewProgramUniform1ui64vNV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2I64NVPROC __glewProgramUniform2i64NV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2I64VNVPROC __glewProgramUniform2i64vNV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2UI64NVPROC __glewProgramUniform2ui64NV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2UI64VNVPROC __glewProgramUniform2ui64vNV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3I64NVPROC __glewProgramUniform3i64NV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3I64VNVPROC __glewProgramUniform3i64vNV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3UI64NVPROC __glewProgramUniform3ui64NV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3UI64VNVPROC __glewProgramUniform3ui64vNV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4I64NVPROC __glewProgramUniform4i64NV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4I64VNVPROC __glewProgramUniform4i64vNV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4UI64NVPROC __glewProgramUniform4ui64NV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4UI64VNVPROC __glewProgramUniform4ui64vNV; +GLEW_FUN_EXPORT PFNGLUNIFORM1I64NVPROC __glewUniform1i64NV; +GLEW_FUN_EXPORT PFNGLUNIFORM1I64VNVPROC __glewUniform1i64vNV; +GLEW_FUN_EXPORT PFNGLUNIFORM1UI64NVPROC __glewUniform1ui64NV; +GLEW_FUN_EXPORT PFNGLUNIFORM1UI64VNVPROC __glewUniform1ui64vNV; +GLEW_FUN_EXPORT PFNGLUNIFORM2I64NVPROC __glewUniform2i64NV; +GLEW_FUN_EXPORT PFNGLUNIFORM2I64VNVPROC __glewUniform2i64vNV; +GLEW_FUN_EXPORT PFNGLUNIFORM2UI64NVPROC __glewUniform2ui64NV; +GLEW_FUN_EXPORT PFNGLUNIFORM2UI64VNVPROC __glewUniform2ui64vNV; +GLEW_FUN_EXPORT PFNGLUNIFORM3I64NVPROC __glewUniform3i64NV; +GLEW_FUN_EXPORT PFNGLUNIFORM3I64VNVPROC __glewUniform3i64vNV; +GLEW_FUN_EXPORT PFNGLUNIFORM3UI64NVPROC __glewUniform3ui64NV; +GLEW_FUN_EXPORT PFNGLUNIFORM3UI64VNVPROC __glewUniform3ui64vNV; +GLEW_FUN_EXPORT PFNGLUNIFORM4I64NVPROC __glewUniform4i64NV; +GLEW_FUN_EXPORT PFNGLUNIFORM4I64VNVPROC __glewUniform4i64vNV; +GLEW_FUN_EXPORT PFNGLUNIFORM4UI64NVPROC __glewUniform4ui64NV; +GLEW_FUN_EXPORT PFNGLUNIFORM4UI64VNVPROC __glewUniform4ui64vNV; + +GLEW_FUN_EXPORT PFNGLCOLOR3HNVPROC __glewColor3hNV; +GLEW_FUN_EXPORT PFNGLCOLOR3HVNVPROC __glewColor3hvNV; +GLEW_FUN_EXPORT PFNGLCOLOR4HNVPROC __glewColor4hNV; +GLEW_FUN_EXPORT PFNGLCOLOR4HVNVPROC __glewColor4hvNV; +GLEW_FUN_EXPORT PFNGLFOGCOORDHNVPROC __glewFogCoordhNV; +GLEW_FUN_EXPORT PFNGLFOGCOORDHVNVPROC __glewFogCoordhvNV; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1HNVPROC __glewMultiTexCoord1hNV; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1HVNVPROC __glewMultiTexCoord1hvNV; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2HNVPROC __glewMultiTexCoord2hNV; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2HVNVPROC __glewMultiTexCoord2hvNV; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3HNVPROC __glewMultiTexCoord3hNV; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3HVNVPROC __glewMultiTexCoord3hvNV; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4HNVPROC __glewMultiTexCoord4hNV; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4HVNVPROC __glewMultiTexCoord4hvNV; +GLEW_FUN_EXPORT PFNGLNORMAL3HNVPROC __glewNormal3hNV; +GLEW_FUN_EXPORT PFNGLNORMAL3HVNVPROC __glewNormal3hvNV; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3HNVPROC __glewSecondaryColor3hNV; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3HVNVPROC __glewSecondaryColor3hvNV; +GLEW_FUN_EXPORT PFNGLTEXCOORD1HNVPROC __glewTexCoord1hNV; +GLEW_FUN_EXPORT PFNGLTEXCOORD1HVNVPROC __glewTexCoord1hvNV; +GLEW_FUN_EXPORT PFNGLTEXCOORD2HNVPROC __glewTexCoord2hNV; +GLEW_FUN_EXPORT PFNGLTEXCOORD2HVNVPROC __glewTexCoord2hvNV; +GLEW_FUN_EXPORT PFNGLTEXCOORD3HNVPROC __glewTexCoord3hNV; +GLEW_FUN_EXPORT PFNGLTEXCOORD3HVNVPROC __glewTexCoord3hvNV; +GLEW_FUN_EXPORT PFNGLTEXCOORD4HNVPROC __glewTexCoord4hNV; +GLEW_FUN_EXPORT PFNGLTEXCOORD4HVNVPROC __glewTexCoord4hvNV; +GLEW_FUN_EXPORT PFNGLVERTEX2HNVPROC __glewVertex2hNV; +GLEW_FUN_EXPORT PFNGLVERTEX2HVNVPROC __glewVertex2hvNV; +GLEW_FUN_EXPORT PFNGLVERTEX3HNVPROC __glewVertex3hNV; +GLEW_FUN_EXPORT PFNGLVERTEX3HVNVPROC __glewVertex3hvNV; +GLEW_FUN_EXPORT PFNGLVERTEX4HNVPROC __glewVertex4hNV; +GLEW_FUN_EXPORT PFNGLVERTEX4HVNVPROC __glewVertex4hvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1HNVPROC __glewVertexAttrib1hNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1HVNVPROC __glewVertexAttrib1hvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2HNVPROC __glewVertexAttrib2hNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2HVNVPROC __glewVertexAttrib2hvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3HNVPROC __glewVertexAttrib3hNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3HVNVPROC __glewVertexAttrib3hvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4HNVPROC __glewVertexAttrib4hNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4HVNVPROC __glewVertexAttrib4hvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS1HVNVPROC __glewVertexAttribs1hvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS2HVNVPROC __glewVertexAttribs2hvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS3HVNVPROC __glewVertexAttribs3hvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS4HVNVPROC __glewVertexAttribs4hvNV; +GLEW_FUN_EXPORT PFNGLVERTEXWEIGHTHNVPROC __glewVertexWeighthNV; +GLEW_FUN_EXPORT PFNGLVERTEXWEIGHTHVNVPROC __glewVertexWeighthvNV; + +GLEW_FUN_EXPORT PFNGLBEGINOCCLUSIONQUERYNVPROC __glewBeginOcclusionQueryNV; +GLEW_FUN_EXPORT PFNGLDELETEOCCLUSIONQUERIESNVPROC __glewDeleteOcclusionQueriesNV; +GLEW_FUN_EXPORT PFNGLENDOCCLUSIONQUERYNVPROC __glewEndOcclusionQueryNV; +GLEW_FUN_EXPORT PFNGLGENOCCLUSIONQUERIESNVPROC __glewGenOcclusionQueriesNV; +GLEW_FUN_EXPORT PFNGLGETOCCLUSIONQUERYIVNVPROC __glewGetOcclusionQueryivNV; +GLEW_FUN_EXPORT PFNGLGETOCCLUSIONQUERYUIVNVPROC __glewGetOcclusionQueryuivNV; +GLEW_FUN_EXPORT PFNGLISOCCLUSIONQUERYNVPROC __glewIsOcclusionQueryNV; + +GLEW_FUN_EXPORT PFNGLPROGRAMBUFFERPARAMETERSIIVNVPROC __glewProgramBufferParametersIivNV; +GLEW_FUN_EXPORT PFNGLPROGRAMBUFFERPARAMETERSIUIVNVPROC __glewProgramBufferParametersIuivNV; +GLEW_FUN_EXPORT PFNGLPROGRAMBUFFERPARAMETERSFVNVPROC __glewProgramBufferParametersfvNV; + +GLEW_FUN_EXPORT PFNGLCOPYPATHNVPROC __glewCopyPathNV; +GLEW_FUN_EXPORT PFNGLCOVERFILLPATHINSTANCEDNVPROC __glewCoverFillPathInstancedNV; +GLEW_FUN_EXPORT PFNGLCOVERFILLPATHNVPROC __glewCoverFillPathNV; +GLEW_FUN_EXPORT PFNGLCOVERSTROKEPATHINSTANCEDNVPROC __glewCoverStrokePathInstancedNV; +GLEW_FUN_EXPORT PFNGLCOVERSTROKEPATHNVPROC __glewCoverStrokePathNV; +GLEW_FUN_EXPORT PFNGLDELETEPATHSNVPROC __glewDeletePathsNV; +GLEW_FUN_EXPORT PFNGLGENPATHSNVPROC __glewGenPathsNV; +GLEW_FUN_EXPORT PFNGLGETPATHCOLORGENFVNVPROC __glewGetPathColorGenfvNV; +GLEW_FUN_EXPORT PFNGLGETPATHCOLORGENIVNVPROC __glewGetPathColorGenivNV; +GLEW_FUN_EXPORT PFNGLGETPATHCOMMANDSNVPROC __glewGetPathCommandsNV; +GLEW_FUN_EXPORT PFNGLGETPATHCOORDSNVPROC __glewGetPathCoordsNV; +GLEW_FUN_EXPORT PFNGLGETPATHDASHARRAYNVPROC __glewGetPathDashArrayNV; +GLEW_FUN_EXPORT PFNGLGETPATHLENGTHNVPROC __glewGetPathLengthNV; +GLEW_FUN_EXPORT PFNGLGETPATHMETRICRANGENVPROC __glewGetPathMetricRangeNV; +GLEW_FUN_EXPORT PFNGLGETPATHMETRICSNVPROC __glewGetPathMetricsNV; +GLEW_FUN_EXPORT PFNGLGETPATHPARAMETERFVNVPROC __glewGetPathParameterfvNV; +GLEW_FUN_EXPORT PFNGLGETPATHPARAMETERIVNVPROC __glewGetPathParameterivNV; +GLEW_FUN_EXPORT PFNGLGETPATHSPACINGNVPROC __glewGetPathSpacingNV; +GLEW_FUN_EXPORT PFNGLGETPATHTEXGENFVNVPROC __glewGetPathTexGenfvNV; +GLEW_FUN_EXPORT PFNGLGETPATHTEXGENIVNVPROC __glewGetPathTexGenivNV; +GLEW_FUN_EXPORT PFNGLINTERPOLATEPATHSNVPROC __glewInterpolatePathsNV; +GLEW_FUN_EXPORT PFNGLISPATHNVPROC __glewIsPathNV; +GLEW_FUN_EXPORT PFNGLISPOINTINFILLPATHNVPROC __glewIsPointInFillPathNV; +GLEW_FUN_EXPORT PFNGLISPOINTINSTROKEPATHNVPROC __glewIsPointInStrokePathNV; +GLEW_FUN_EXPORT PFNGLPATHCOLORGENNVPROC __glewPathColorGenNV; +GLEW_FUN_EXPORT PFNGLPATHCOMMANDSNVPROC __glewPathCommandsNV; +GLEW_FUN_EXPORT PFNGLPATHCOORDSNVPROC __glewPathCoordsNV; +GLEW_FUN_EXPORT PFNGLPATHCOVERDEPTHFUNCNVPROC __glewPathCoverDepthFuncNV; +GLEW_FUN_EXPORT PFNGLPATHDASHARRAYNVPROC __glewPathDashArrayNV; +GLEW_FUN_EXPORT PFNGLPATHFOGGENNVPROC __glewPathFogGenNV; +GLEW_FUN_EXPORT PFNGLPATHGLYPHRANGENVPROC __glewPathGlyphRangeNV; +GLEW_FUN_EXPORT PFNGLPATHGLYPHSNVPROC __glewPathGlyphsNV; +GLEW_FUN_EXPORT PFNGLPATHPARAMETERFNVPROC __glewPathParameterfNV; +GLEW_FUN_EXPORT PFNGLPATHPARAMETERFVNVPROC __glewPathParameterfvNV; +GLEW_FUN_EXPORT PFNGLPATHPARAMETERINVPROC __glewPathParameteriNV; +GLEW_FUN_EXPORT PFNGLPATHPARAMETERIVNVPROC __glewPathParameterivNV; +GLEW_FUN_EXPORT PFNGLPATHSTENCILDEPTHOFFSETNVPROC __glewPathStencilDepthOffsetNV; +GLEW_FUN_EXPORT PFNGLPATHSTENCILFUNCNVPROC __glewPathStencilFuncNV; +GLEW_FUN_EXPORT PFNGLPATHSTRINGNVPROC __glewPathStringNV; +GLEW_FUN_EXPORT PFNGLPATHSUBCOMMANDSNVPROC __glewPathSubCommandsNV; +GLEW_FUN_EXPORT PFNGLPATHSUBCOORDSNVPROC __glewPathSubCoordsNV; +GLEW_FUN_EXPORT PFNGLPATHTEXGENNVPROC __glewPathTexGenNV; +GLEW_FUN_EXPORT PFNGLPOINTALONGPATHNVPROC __glewPointAlongPathNV; +GLEW_FUN_EXPORT PFNGLSTENCILFILLPATHINSTANCEDNVPROC __glewStencilFillPathInstancedNV; +GLEW_FUN_EXPORT PFNGLSTENCILFILLPATHNVPROC __glewStencilFillPathNV; +GLEW_FUN_EXPORT PFNGLSTENCILSTROKEPATHINSTANCEDNVPROC __glewStencilStrokePathInstancedNV; +GLEW_FUN_EXPORT PFNGLSTENCILSTROKEPATHNVPROC __glewStencilStrokePathNV; +GLEW_FUN_EXPORT PFNGLTRANSFORMPATHNVPROC __glewTransformPathNV; +GLEW_FUN_EXPORT PFNGLWEIGHTPATHSNVPROC __glewWeightPathsNV; + +GLEW_FUN_EXPORT PFNGLFLUSHPIXELDATARANGENVPROC __glewFlushPixelDataRangeNV; +GLEW_FUN_EXPORT PFNGLPIXELDATARANGENVPROC __glewPixelDataRangeNV; + +GLEW_FUN_EXPORT PFNGLPOINTPARAMETERINVPROC __glewPointParameteriNV; +GLEW_FUN_EXPORT PFNGLPOINTPARAMETERIVNVPROC __glewPointParameterivNV; + +GLEW_FUN_EXPORT PFNGLGETVIDEOI64VNVPROC __glewGetVideoi64vNV; +GLEW_FUN_EXPORT PFNGLGETVIDEOIVNVPROC __glewGetVideoivNV; +GLEW_FUN_EXPORT PFNGLGETVIDEOUI64VNVPROC __glewGetVideoui64vNV; +GLEW_FUN_EXPORT PFNGLGETVIDEOUIVNVPROC __glewGetVideouivNV; +GLEW_FUN_EXPORT PFNGLPRESENTFRAMEDUALFILLNVPROC __glewPresentFrameDualFillNV; +GLEW_FUN_EXPORT PFNGLPRESENTFRAMEKEYEDNVPROC __glewPresentFrameKeyedNV; + +GLEW_FUN_EXPORT PFNGLPRIMITIVERESTARTINDEXNVPROC __glewPrimitiveRestartIndexNV; +GLEW_FUN_EXPORT PFNGLPRIMITIVERESTARTNVPROC __glewPrimitiveRestartNV; + +GLEW_FUN_EXPORT PFNGLCOMBINERINPUTNVPROC __glewCombinerInputNV; +GLEW_FUN_EXPORT PFNGLCOMBINEROUTPUTNVPROC __glewCombinerOutputNV; +GLEW_FUN_EXPORT PFNGLCOMBINERPARAMETERFNVPROC __glewCombinerParameterfNV; +GLEW_FUN_EXPORT PFNGLCOMBINERPARAMETERFVNVPROC __glewCombinerParameterfvNV; +GLEW_FUN_EXPORT PFNGLCOMBINERPARAMETERINVPROC __glewCombinerParameteriNV; +GLEW_FUN_EXPORT PFNGLCOMBINERPARAMETERIVNVPROC __glewCombinerParameterivNV; +GLEW_FUN_EXPORT PFNGLFINALCOMBINERINPUTNVPROC __glewFinalCombinerInputNV; +GLEW_FUN_EXPORT PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC __glewGetCombinerInputParameterfvNV; +GLEW_FUN_EXPORT PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC __glewGetCombinerInputParameterivNV; +GLEW_FUN_EXPORT PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC __glewGetCombinerOutputParameterfvNV; +GLEW_FUN_EXPORT PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC __glewGetCombinerOutputParameterivNV; +GLEW_FUN_EXPORT PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC __glewGetFinalCombinerInputParameterfvNV; +GLEW_FUN_EXPORT PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC __glewGetFinalCombinerInputParameterivNV; + +GLEW_FUN_EXPORT PFNGLCOMBINERSTAGEPARAMETERFVNVPROC __glewCombinerStageParameterfvNV; +GLEW_FUN_EXPORT PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC __glewGetCombinerStageParameterfvNV; + +GLEW_FUN_EXPORT PFNGLGETBUFFERPARAMETERUI64VNVPROC __glewGetBufferParameterui64vNV; +GLEW_FUN_EXPORT PFNGLGETINTEGERUI64VNVPROC __glewGetIntegerui64vNV; +GLEW_FUN_EXPORT PFNGLGETNAMEDBUFFERPARAMETERUI64VNVPROC __glewGetNamedBufferParameterui64vNV; +GLEW_FUN_EXPORT PFNGLISBUFFERRESIDENTNVPROC __glewIsBufferResidentNV; +GLEW_FUN_EXPORT PFNGLISNAMEDBUFFERRESIDENTNVPROC __glewIsNamedBufferResidentNV; +GLEW_FUN_EXPORT PFNGLMAKEBUFFERNONRESIDENTNVPROC __glewMakeBufferNonResidentNV; +GLEW_FUN_EXPORT PFNGLMAKEBUFFERRESIDENTNVPROC __glewMakeBufferResidentNV; +GLEW_FUN_EXPORT PFNGLMAKENAMEDBUFFERNONRESIDENTNVPROC __glewMakeNamedBufferNonResidentNV; +GLEW_FUN_EXPORT PFNGLMAKENAMEDBUFFERRESIDENTNVPROC __glewMakeNamedBufferResidentNV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMUI64NVPROC __glewProgramUniformui64NV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMUI64VNVPROC __glewProgramUniformui64vNV; +GLEW_FUN_EXPORT PFNGLUNIFORMUI64NVPROC __glewUniformui64NV; +GLEW_FUN_EXPORT PFNGLUNIFORMUI64VNVPROC __glewUniformui64vNV; + +GLEW_FUN_EXPORT PFNGLTEXTUREBARRIERNVPROC __glewTextureBarrierNV; + +GLEW_FUN_EXPORT PFNGLTEXIMAGE2DMULTISAMPLECOVERAGENVPROC __glewTexImage2DMultisampleCoverageNV; +GLEW_FUN_EXPORT PFNGLTEXIMAGE3DMULTISAMPLECOVERAGENVPROC __glewTexImage3DMultisampleCoverageNV; +GLEW_FUN_EXPORT PFNGLTEXTUREIMAGE2DMULTISAMPLECOVERAGENVPROC __glewTextureImage2DMultisampleCoverageNV; +GLEW_FUN_EXPORT PFNGLTEXTUREIMAGE2DMULTISAMPLENVPROC __glewTextureImage2DMultisampleNV; +GLEW_FUN_EXPORT PFNGLTEXTUREIMAGE3DMULTISAMPLECOVERAGENVPROC __glewTextureImage3DMultisampleCoverageNV; +GLEW_FUN_EXPORT PFNGLTEXTUREIMAGE3DMULTISAMPLENVPROC __glewTextureImage3DMultisampleNV; + +GLEW_FUN_EXPORT PFNGLACTIVEVARYINGNVPROC __glewActiveVaryingNV; +GLEW_FUN_EXPORT PFNGLBEGINTRANSFORMFEEDBACKNVPROC __glewBeginTransformFeedbackNV; +GLEW_FUN_EXPORT PFNGLBINDBUFFERBASENVPROC __glewBindBufferBaseNV; +GLEW_FUN_EXPORT PFNGLBINDBUFFEROFFSETNVPROC __glewBindBufferOffsetNV; +GLEW_FUN_EXPORT PFNGLBINDBUFFERRANGENVPROC __glewBindBufferRangeNV; +GLEW_FUN_EXPORT PFNGLENDTRANSFORMFEEDBACKNVPROC __glewEndTransformFeedbackNV; +GLEW_FUN_EXPORT PFNGLGETACTIVEVARYINGNVPROC __glewGetActiveVaryingNV; +GLEW_FUN_EXPORT PFNGLGETTRANSFORMFEEDBACKVARYINGNVPROC __glewGetTransformFeedbackVaryingNV; +GLEW_FUN_EXPORT PFNGLGETVARYINGLOCATIONNVPROC __glewGetVaryingLocationNV; +GLEW_FUN_EXPORT PFNGLTRANSFORMFEEDBACKATTRIBSNVPROC __glewTransformFeedbackAttribsNV; +GLEW_FUN_EXPORT PFNGLTRANSFORMFEEDBACKVARYINGSNVPROC __glewTransformFeedbackVaryingsNV; + +GLEW_FUN_EXPORT PFNGLBINDTRANSFORMFEEDBACKNVPROC __glewBindTransformFeedbackNV; +GLEW_FUN_EXPORT PFNGLDELETETRANSFORMFEEDBACKSNVPROC __glewDeleteTransformFeedbacksNV; +GLEW_FUN_EXPORT PFNGLDRAWTRANSFORMFEEDBACKNVPROC __glewDrawTransformFeedbackNV; +GLEW_FUN_EXPORT PFNGLGENTRANSFORMFEEDBACKSNVPROC __glewGenTransformFeedbacksNV; +GLEW_FUN_EXPORT PFNGLISTRANSFORMFEEDBACKNVPROC __glewIsTransformFeedbackNV; +GLEW_FUN_EXPORT PFNGLPAUSETRANSFORMFEEDBACKNVPROC __glewPauseTransformFeedbackNV; +GLEW_FUN_EXPORT PFNGLRESUMETRANSFORMFEEDBACKNVPROC __glewResumeTransformFeedbackNV; + +GLEW_FUN_EXPORT PFNGLVDPAUFININVPROC __glewVDPAUFiniNV; +GLEW_FUN_EXPORT PFNGLVDPAUGETSURFACEIVNVPROC __glewVDPAUGetSurfaceivNV; +GLEW_FUN_EXPORT PFNGLVDPAUINITNVPROC __glewVDPAUInitNV; +GLEW_FUN_EXPORT PFNGLVDPAUISSURFACENVPROC __glewVDPAUIsSurfaceNV; +GLEW_FUN_EXPORT PFNGLVDPAUMAPSURFACESNVPROC __glewVDPAUMapSurfacesNV; +GLEW_FUN_EXPORT PFNGLVDPAUREGISTEROUTPUTSURFACENVPROC __glewVDPAURegisterOutputSurfaceNV; +GLEW_FUN_EXPORT PFNGLVDPAUREGISTERVIDEOSURFACENVPROC __glewVDPAURegisterVideoSurfaceNV; +GLEW_FUN_EXPORT PFNGLVDPAUSURFACEACCESSNVPROC __glewVDPAUSurfaceAccessNV; +GLEW_FUN_EXPORT PFNGLVDPAUUNMAPSURFACESNVPROC __glewVDPAUUnmapSurfacesNV; +GLEW_FUN_EXPORT PFNGLVDPAUUNREGISTERSURFACENVPROC __glewVDPAUUnregisterSurfaceNV; + +GLEW_FUN_EXPORT PFNGLFLUSHVERTEXARRAYRANGENVPROC __glewFlushVertexArrayRangeNV; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYRANGENVPROC __glewVertexArrayRangeNV; + +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBLI64VNVPROC __glewGetVertexAttribLi64vNV; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBLUI64VNVPROC __glewGetVertexAttribLui64vNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1I64NVPROC __glewVertexAttribL1i64NV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1I64VNVPROC __glewVertexAttribL1i64vNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1UI64NVPROC __glewVertexAttribL1ui64NV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1UI64VNVPROC __glewVertexAttribL1ui64vNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL2I64NVPROC __glewVertexAttribL2i64NV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL2I64VNVPROC __glewVertexAttribL2i64vNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL2UI64NVPROC __glewVertexAttribL2ui64NV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL2UI64VNVPROC __glewVertexAttribL2ui64vNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL3I64NVPROC __glewVertexAttribL3i64NV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL3I64VNVPROC __glewVertexAttribL3i64vNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL3UI64NVPROC __glewVertexAttribL3ui64NV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL3UI64VNVPROC __glewVertexAttribL3ui64vNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL4I64NVPROC __glewVertexAttribL4i64NV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL4I64VNVPROC __glewVertexAttribL4i64vNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL4UI64NVPROC __glewVertexAttribL4ui64NV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL4UI64VNVPROC __glewVertexAttribL4ui64vNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBLFORMATNVPROC __glewVertexAttribLFormatNV; + +GLEW_FUN_EXPORT PFNGLBUFFERADDRESSRANGENVPROC __glewBufferAddressRangeNV; +GLEW_FUN_EXPORT PFNGLCOLORFORMATNVPROC __glewColorFormatNV; +GLEW_FUN_EXPORT PFNGLEDGEFLAGFORMATNVPROC __glewEdgeFlagFormatNV; +GLEW_FUN_EXPORT PFNGLFOGCOORDFORMATNVPROC __glewFogCoordFormatNV; +GLEW_FUN_EXPORT PFNGLGETINTEGERUI64I_VNVPROC __glewGetIntegerui64i_vNV; +GLEW_FUN_EXPORT PFNGLINDEXFORMATNVPROC __glewIndexFormatNV; +GLEW_FUN_EXPORT PFNGLNORMALFORMATNVPROC __glewNormalFormatNV; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLORFORMATNVPROC __glewSecondaryColorFormatNV; +GLEW_FUN_EXPORT PFNGLTEXCOORDFORMATNVPROC __glewTexCoordFormatNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBFORMATNVPROC __glewVertexAttribFormatNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBIFORMATNVPROC __glewVertexAttribIFormatNV; +GLEW_FUN_EXPORT PFNGLVERTEXFORMATNVPROC __glewVertexFormatNV; + +GLEW_FUN_EXPORT PFNGLAREPROGRAMSRESIDENTNVPROC __glewAreProgramsResidentNV; +GLEW_FUN_EXPORT PFNGLBINDPROGRAMNVPROC __glewBindProgramNV; +GLEW_FUN_EXPORT PFNGLDELETEPROGRAMSNVPROC __glewDeleteProgramsNV; +GLEW_FUN_EXPORT PFNGLEXECUTEPROGRAMNVPROC __glewExecuteProgramNV; +GLEW_FUN_EXPORT PFNGLGENPROGRAMSNVPROC __glewGenProgramsNV; +GLEW_FUN_EXPORT PFNGLGETPROGRAMPARAMETERDVNVPROC __glewGetProgramParameterdvNV; +GLEW_FUN_EXPORT PFNGLGETPROGRAMPARAMETERFVNVPROC __glewGetProgramParameterfvNV; +GLEW_FUN_EXPORT PFNGLGETPROGRAMSTRINGNVPROC __glewGetProgramStringNV; +GLEW_FUN_EXPORT PFNGLGETPROGRAMIVNVPROC __glewGetProgramivNV; +GLEW_FUN_EXPORT PFNGLGETTRACKMATRIXIVNVPROC __glewGetTrackMatrixivNV; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBPOINTERVNVPROC __glewGetVertexAttribPointervNV; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBDVNVPROC __glewGetVertexAttribdvNV; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBFVNVPROC __glewGetVertexAttribfvNV; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBIVNVPROC __glewGetVertexAttribivNV; +GLEW_FUN_EXPORT PFNGLISPROGRAMNVPROC __glewIsProgramNV; +GLEW_FUN_EXPORT PFNGLLOADPROGRAMNVPROC __glewLoadProgramNV; +GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETER4DNVPROC __glewProgramParameter4dNV; +GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETER4DVNVPROC __glewProgramParameter4dvNV; +GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETER4FNVPROC __glewProgramParameter4fNV; +GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETER4FVNVPROC __glewProgramParameter4fvNV; +GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETERS4DVNVPROC __glewProgramParameters4dvNV; +GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETERS4FVNVPROC __glewProgramParameters4fvNV; +GLEW_FUN_EXPORT PFNGLREQUESTRESIDENTPROGRAMSNVPROC __glewRequestResidentProgramsNV; +GLEW_FUN_EXPORT PFNGLTRACKMATRIXNVPROC __glewTrackMatrixNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1DNVPROC __glewVertexAttrib1dNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1DVNVPROC __glewVertexAttrib1dvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1FNVPROC __glewVertexAttrib1fNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1FVNVPROC __glewVertexAttrib1fvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1SNVPROC __glewVertexAttrib1sNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1SVNVPROC __glewVertexAttrib1svNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2DNVPROC __glewVertexAttrib2dNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2DVNVPROC __glewVertexAttrib2dvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2FNVPROC __glewVertexAttrib2fNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2FVNVPROC __glewVertexAttrib2fvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2SNVPROC __glewVertexAttrib2sNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2SVNVPROC __glewVertexAttrib2svNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3DNVPROC __glewVertexAttrib3dNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3DVNVPROC __glewVertexAttrib3dvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3FNVPROC __glewVertexAttrib3fNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3FVNVPROC __glewVertexAttrib3fvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3SNVPROC __glewVertexAttrib3sNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3SVNVPROC __glewVertexAttrib3svNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4DNVPROC __glewVertexAttrib4dNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4DVNVPROC __glewVertexAttrib4dvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4FNVPROC __glewVertexAttrib4fNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4FVNVPROC __glewVertexAttrib4fvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4SNVPROC __glewVertexAttrib4sNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4SVNVPROC __glewVertexAttrib4svNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4UBNVPROC __glewVertexAttrib4ubNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4UBVNVPROC __glewVertexAttrib4ubvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBPOINTERNVPROC __glewVertexAttribPointerNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS1DVNVPROC __glewVertexAttribs1dvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS1FVNVPROC __glewVertexAttribs1fvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS1SVNVPROC __glewVertexAttribs1svNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS2DVNVPROC __glewVertexAttribs2dvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS2FVNVPROC __glewVertexAttribs2fvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS2SVNVPROC __glewVertexAttribs2svNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS3DVNVPROC __glewVertexAttribs3dvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS3FVNVPROC __glewVertexAttribs3fvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS3SVNVPROC __glewVertexAttribs3svNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS4DVNVPROC __glewVertexAttribs4dvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS4FVNVPROC __glewVertexAttribs4fvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS4SVNVPROC __glewVertexAttribs4svNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS4UBVNVPROC __glewVertexAttribs4ubvNV; + +GLEW_FUN_EXPORT PFNGLBEGINVIDEOCAPTURENVPROC __glewBeginVideoCaptureNV; +GLEW_FUN_EXPORT PFNGLBINDVIDEOCAPTURESTREAMBUFFERNVPROC __glewBindVideoCaptureStreamBufferNV; +GLEW_FUN_EXPORT PFNGLBINDVIDEOCAPTURESTREAMTEXTURENVPROC __glewBindVideoCaptureStreamTextureNV; +GLEW_FUN_EXPORT PFNGLENDVIDEOCAPTURENVPROC __glewEndVideoCaptureNV; +GLEW_FUN_EXPORT PFNGLGETVIDEOCAPTURESTREAMDVNVPROC __glewGetVideoCaptureStreamdvNV; +GLEW_FUN_EXPORT PFNGLGETVIDEOCAPTURESTREAMFVNVPROC __glewGetVideoCaptureStreamfvNV; +GLEW_FUN_EXPORT PFNGLGETVIDEOCAPTURESTREAMIVNVPROC __glewGetVideoCaptureStreamivNV; +GLEW_FUN_EXPORT PFNGLGETVIDEOCAPTUREIVNVPROC __glewGetVideoCaptureivNV; +GLEW_FUN_EXPORT PFNGLVIDEOCAPTURENVPROC __glewVideoCaptureNV; +GLEW_FUN_EXPORT PFNGLVIDEOCAPTURESTREAMPARAMETERDVNVPROC __glewVideoCaptureStreamParameterdvNV; +GLEW_FUN_EXPORT PFNGLVIDEOCAPTURESTREAMPARAMETERFVNVPROC __glewVideoCaptureStreamParameterfvNV; +GLEW_FUN_EXPORT PFNGLVIDEOCAPTURESTREAMPARAMETERIVNVPROC __glewVideoCaptureStreamParameterivNV; + +GLEW_FUN_EXPORT PFNGLCLEARDEPTHFOESPROC __glewClearDepthfOES; +GLEW_FUN_EXPORT PFNGLCLIPPLANEFOESPROC __glewClipPlanefOES; +GLEW_FUN_EXPORT PFNGLDEPTHRANGEFOESPROC __glewDepthRangefOES; +GLEW_FUN_EXPORT PFNGLFRUSTUMFOESPROC __glewFrustumfOES; +GLEW_FUN_EXPORT PFNGLGETCLIPPLANEFOESPROC __glewGetClipPlanefOES; +GLEW_FUN_EXPORT PFNGLORTHOFOESPROC __glewOrthofOES; + +GLEW_FUN_EXPORT PFNGLALPHAFUNCXPROC __glewAlphaFuncx; +GLEW_FUN_EXPORT PFNGLCLEARCOLORXPROC __glewClearColorx; +GLEW_FUN_EXPORT PFNGLCLEARDEPTHXPROC __glewClearDepthx; +GLEW_FUN_EXPORT PFNGLCOLOR4XPROC __glewColor4x; +GLEW_FUN_EXPORT PFNGLDEPTHRANGEXPROC __glewDepthRangex; +GLEW_FUN_EXPORT PFNGLFOGXPROC __glewFogx; +GLEW_FUN_EXPORT PFNGLFOGXVPROC __glewFogxv; +GLEW_FUN_EXPORT PFNGLFRUSTUMFPROC __glewFrustumf; +GLEW_FUN_EXPORT PFNGLFRUSTUMXPROC __glewFrustumx; +GLEW_FUN_EXPORT PFNGLLIGHTMODELXPROC __glewLightModelx; +GLEW_FUN_EXPORT PFNGLLIGHTMODELXVPROC __glewLightModelxv; +GLEW_FUN_EXPORT PFNGLLIGHTXPROC __glewLightx; +GLEW_FUN_EXPORT PFNGLLIGHTXVPROC __glewLightxv; +GLEW_FUN_EXPORT PFNGLLINEWIDTHXPROC __glewLineWidthx; +GLEW_FUN_EXPORT PFNGLLOADMATRIXXPROC __glewLoadMatrixx; +GLEW_FUN_EXPORT PFNGLMATERIALXPROC __glewMaterialx; +GLEW_FUN_EXPORT PFNGLMATERIALXVPROC __glewMaterialxv; +GLEW_FUN_EXPORT PFNGLMULTMATRIXXPROC __glewMultMatrixx; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4XPROC __glewMultiTexCoord4x; +GLEW_FUN_EXPORT PFNGLNORMAL3XPROC __glewNormal3x; +GLEW_FUN_EXPORT PFNGLORTHOFPROC __glewOrthof; +GLEW_FUN_EXPORT PFNGLORTHOXPROC __glewOrthox; +GLEW_FUN_EXPORT PFNGLPOINTSIZEXPROC __glewPointSizex; +GLEW_FUN_EXPORT PFNGLPOLYGONOFFSETXPROC __glewPolygonOffsetx; +GLEW_FUN_EXPORT PFNGLROTATEXPROC __glewRotatex; +GLEW_FUN_EXPORT PFNGLSAMPLECOVERAGEXPROC __glewSampleCoveragex; +GLEW_FUN_EXPORT PFNGLSCALEXPROC __glewScalex; +GLEW_FUN_EXPORT PFNGLTEXENVXPROC __glewTexEnvx; +GLEW_FUN_EXPORT PFNGLTEXENVXVPROC __glewTexEnvxv; +GLEW_FUN_EXPORT PFNGLTEXPARAMETERXPROC __glewTexParameterx; +GLEW_FUN_EXPORT PFNGLTRANSLATEXPROC __glewTranslatex; + +GLEW_FUN_EXPORT PFNGLCLIPPLANEFPROC __glewClipPlanef; +GLEW_FUN_EXPORT PFNGLCLIPPLANEXPROC __glewClipPlanex; +GLEW_FUN_EXPORT PFNGLGETCLIPPLANEFPROC __glewGetClipPlanef; +GLEW_FUN_EXPORT PFNGLGETCLIPPLANEXPROC __glewGetClipPlanex; +GLEW_FUN_EXPORT PFNGLGETFIXEDVPROC __glewGetFixedv; +GLEW_FUN_EXPORT PFNGLGETLIGHTXVPROC __glewGetLightxv; +GLEW_FUN_EXPORT PFNGLGETMATERIALXVPROC __glewGetMaterialxv; +GLEW_FUN_EXPORT PFNGLGETTEXENVXVPROC __glewGetTexEnvxv; +GLEW_FUN_EXPORT PFNGLGETTEXPARAMETERXVPROC __glewGetTexParameterxv; +GLEW_FUN_EXPORT PFNGLPOINTPARAMETERXPROC __glewPointParameterx; +GLEW_FUN_EXPORT PFNGLPOINTPARAMETERXVPROC __glewPointParameterxv; +GLEW_FUN_EXPORT PFNGLPOINTSIZEPOINTEROESPROC __glewPointSizePointerOES; +GLEW_FUN_EXPORT PFNGLTEXPARAMETERXVPROC __glewTexParameterxv; + +GLEW_FUN_EXPORT PFNGLERRORSTRINGREGALPROC __glewErrorStringREGAL; + +GLEW_FUN_EXPORT PFNGLGETEXTENSIONREGALPROC __glewGetExtensionREGAL; +GLEW_FUN_EXPORT PFNGLISSUPPORTEDREGALPROC __glewIsSupportedREGAL; + +GLEW_FUN_EXPORT PFNGLLOGMESSAGECALLBACKREGALPROC __glewLogMessageCallbackREGAL; + +GLEW_FUN_EXPORT PFNGLDETAILTEXFUNCSGISPROC __glewDetailTexFuncSGIS; +GLEW_FUN_EXPORT PFNGLGETDETAILTEXFUNCSGISPROC __glewGetDetailTexFuncSGIS; + +GLEW_FUN_EXPORT PFNGLFOGFUNCSGISPROC __glewFogFuncSGIS; +GLEW_FUN_EXPORT PFNGLGETFOGFUNCSGISPROC __glewGetFogFuncSGIS; + +GLEW_FUN_EXPORT PFNGLSAMPLEMASKSGISPROC __glewSampleMaskSGIS; +GLEW_FUN_EXPORT PFNGLSAMPLEPATTERNSGISPROC __glewSamplePatternSGIS; + +GLEW_FUN_EXPORT PFNGLGETSHARPENTEXFUNCSGISPROC __glewGetSharpenTexFuncSGIS; +GLEW_FUN_EXPORT PFNGLSHARPENTEXFUNCSGISPROC __glewSharpenTexFuncSGIS; + +GLEW_FUN_EXPORT PFNGLTEXIMAGE4DSGISPROC __glewTexImage4DSGIS; +GLEW_FUN_EXPORT PFNGLTEXSUBIMAGE4DSGISPROC __glewTexSubImage4DSGIS; + +GLEW_FUN_EXPORT PFNGLGETTEXFILTERFUNCSGISPROC __glewGetTexFilterFuncSGIS; +GLEW_FUN_EXPORT PFNGLTEXFILTERFUNCSGISPROC __glewTexFilterFuncSGIS; + +GLEW_FUN_EXPORT PFNGLASYNCMARKERSGIXPROC __glewAsyncMarkerSGIX; +GLEW_FUN_EXPORT PFNGLDELETEASYNCMARKERSSGIXPROC __glewDeleteAsyncMarkersSGIX; +GLEW_FUN_EXPORT PFNGLFINISHASYNCSGIXPROC __glewFinishAsyncSGIX; +GLEW_FUN_EXPORT PFNGLGENASYNCMARKERSSGIXPROC __glewGenAsyncMarkersSGIX; +GLEW_FUN_EXPORT PFNGLISASYNCMARKERSGIXPROC __glewIsAsyncMarkerSGIX; +GLEW_FUN_EXPORT PFNGLPOLLASYNCSGIXPROC __glewPollAsyncSGIX; + +GLEW_FUN_EXPORT PFNGLFLUSHRASTERSGIXPROC __glewFlushRasterSGIX; + +GLEW_FUN_EXPORT PFNGLTEXTUREFOGSGIXPROC __glewTextureFogSGIX; + +GLEW_FUN_EXPORT PFNGLFRAGMENTCOLORMATERIALSGIXPROC __glewFragmentColorMaterialSGIX; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELFSGIXPROC __glewFragmentLightModelfSGIX; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELFVSGIXPROC __glewFragmentLightModelfvSGIX; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELISGIXPROC __glewFragmentLightModeliSGIX; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELIVSGIXPROC __glewFragmentLightModelivSGIX; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTFSGIXPROC __glewFragmentLightfSGIX; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTFVSGIXPROC __glewFragmentLightfvSGIX; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTISGIXPROC __glewFragmentLightiSGIX; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTIVSGIXPROC __glewFragmentLightivSGIX; +GLEW_FUN_EXPORT PFNGLFRAGMENTMATERIALFSGIXPROC __glewFragmentMaterialfSGIX; +GLEW_FUN_EXPORT PFNGLFRAGMENTMATERIALFVSGIXPROC __glewFragmentMaterialfvSGIX; +GLEW_FUN_EXPORT PFNGLFRAGMENTMATERIALISGIXPROC __glewFragmentMaterialiSGIX; +GLEW_FUN_EXPORT PFNGLFRAGMENTMATERIALIVSGIXPROC __glewFragmentMaterialivSGIX; +GLEW_FUN_EXPORT PFNGLGETFRAGMENTLIGHTFVSGIXPROC __glewGetFragmentLightfvSGIX; +GLEW_FUN_EXPORT PFNGLGETFRAGMENTLIGHTIVSGIXPROC __glewGetFragmentLightivSGIX; +GLEW_FUN_EXPORT PFNGLGETFRAGMENTMATERIALFVSGIXPROC __glewGetFragmentMaterialfvSGIX; +GLEW_FUN_EXPORT PFNGLGETFRAGMENTMATERIALIVSGIXPROC __glewGetFragmentMaterialivSGIX; + +GLEW_FUN_EXPORT PFNGLFRAMEZOOMSGIXPROC __glewFrameZoomSGIX; + +GLEW_FUN_EXPORT PFNGLPIXELTEXGENSGIXPROC __glewPixelTexGenSGIX; + +GLEW_FUN_EXPORT PFNGLREFERENCEPLANESGIXPROC __glewReferencePlaneSGIX; + +GLEW_FUN_EXPORT PFNGLSPRITEPARAMETERFSGIXPROC __glewSpriteParameterfSGIX; +GLEW_FUN_EXPORT PFNGLSPRITEPARAMETERFVSGIXPROC __glewSpriteParameterfvSGIX; +GLEW_FUN_EXPORT PFNGLSPRITEPARAMETERISGIXPROC __glewSpriteParameteriSGIX; +GLEW_FUN_EXPORT PFNGLSPRITEPARAMETERIVSGIXPROC __glewSpriteParameterivSGIX; + +GLEW_FUN_EXPORT PFNGLTAGSAMPLEBUFFERSGIXPROC __glewTagSampleBufferSGIX; + +GLEW_FUN_EXPORT PFNGLCOLORTABLEPARAMETERFVSGIPROC __glewColorTableParameterfvSGI; +GLEW_FUN_EXPORT PFNGLCOLORTABLEPARAMETERIVSGIPROC __glewColorTableParameterivSGI; +GLEW_FUN_EXPORT PFNGLCOLORTABLESGIPROC __glewColorTableSGI; +GLEW_FUN_EXPORT PFNGLCOPYCOLORTABLESGIPROC __glewCopyColorTableSGI; +GLEW_FUN_EXPORT PFNGLGETCOLORTABLEPARAMETERFVSGIPROC __glewGetColorTableParameterfvSGI; +GLEW_FUN_EXPORT PFNGLGETCOLORTABLEPARAMETERIVSGIPROC __glewGetColorTableParameterivSGI; +GLEW_FUN_EXPORT PFNGLGETCOLORTABLESGIPROC __glewGetColorTableSGI; + +GLEW_FUN_EXPORT PFNGLFINISHTEXTURESUNXPROC __glewFinishTextureSUNX; + +GLEW_FUN_EXPORT PFNGLGLOBALALPHAFACTORBSUNPROC __glewGlobalAlphaFactorbSUN; +GLEW_FUN_EXPORT PFNGLGLOBALALPHAFACTORDSUNPROC __glewGlobalAlphaFactordSUN; +GLEW_FUN_EXPORT PFNGLGLOBALALPHAFACTORFSUNPROC __glewGlobalAlphaFactorfSUN; +GLEW_FUN_EXPORT PFNGLGLOBALALPHAFACTORISUNPROC __glewGlobalAlphaFactoriSUN; +GLEW_FUN_EXPORT PFNGLGLOBALALPHAFACTORSSUNPROC __glewGlobalAlphaFactorsSUN; +GLEW_FUN_EXPORT PFNGLGLOBALALPHAFACTORUBSUNPROC __glewGlobalAlphaFactorubSUN; +GLEW_FUN_EXPORT PFNGLGLOBALALPHAFACTORUISUNPROC __glewGlobalAlphaFactoruiSUN; +GLEW_FUN_EXPORT PFNGLGLOBALALPHAFACTORUSSUNPROC __glewGlobalAlphaFactorusSUN; + +GLEW_FUN_EXPORT PFNGLREADVIDEOPIXELSSUNPROC __glewReadVideoPixelsSUN; + +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEPOINTERSUNPROC __glewReplacementCodePointerSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUBSUNPROC __glewReplacementCodeubSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUBVSUNPROC __glewReplacementCodeubvSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUISUNPROC __glewReplacementCodeuiSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUIVSUNPROC __glewReplacementCodeuivSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUSSUNPROC __glewReplacementCodeusSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUSVSUNPROC __glewReplacementCodeusvSUN; + +GLEW_FUN_EXPORT PFNGLCOLOR3FVERTEX3FSUNPROC __glewColor3fVertex3fSUN; +GLEW_FUN_EXPORT PFNGLCOLOR3FVERTEX3FVSUNPROC __glewColor3fVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLCOLOR4FNORMAL3FVERTEX3FSUNPROC __glewColor4fNormal3fVertex3fSUN; +GLEW_FUN_EXPORT PFNGLCOLOR4FNORMAL3FVERTEX3FVSUNPROC __glewColor4fNormal3fVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLCOLOR4UBVERTEX2FSUNPROC __glewColor4ubVertex2fSUN; +GLEW_FUN_EXPORT PFNGLCOLOR4UBVERTEX2FVSUNPROC __glewColor4ubVertex2fvSUN; +GLEW_FUN_EXPORT PFNGLCOLOR4UBVERTEX3FSUNPROC __glewColor4ubVertex3fSUN; +GLEW_FUN_EXPORT PFNGLCOLOR4UBVERTEX3FVSUNPROC __glewColor4ubVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLNORMAL3FVERTEX3FSUNPROC __glewNormal3fVertex3fSUN; +GLEW_FUN_EXPORT PFNGLNORMAL3FVERTEX3FVSUNPROC __glewNormal3fVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FSUNPROC __glewReplacementCodeuiColor3fVertex3fSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FVSUNPROC __glewReplacementCodeuiColor3fVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FSUNPROC __glewReplacementCodeuiColor4fNormal3fVertex3fSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FVSUNPROC __glewReplacementCodeuiColor4fNormal3fVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FSUNPROC __glewReplacementCodeuiColor4ubVertex3fSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FVSUNPROC __glewReplacementCodeuiColor4ubVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FSUNPROC __glewReplacementCodeuiNormal3fVertex3fSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FVSUNPROC __glewReplacementCodeuiNormal3fVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC __glewReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC __glewReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FSUNPROC __glewReplacementCodeuiTexCoord2fNormal3fVertex3fSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FVSUNPROC __glewReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FSUNPROC __glewReplacementCodeuiTexCoord2fVertex3fSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FVSUNPROC __glewReplacementCodeuiTexCoord2fVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUIVERTEX3FSUNPROC __glewReplacementCodeuiVertex3fSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUIVERTEX3FVSUNPROC __glewReplacementCodeuiVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD2FCOLOR3FVERTEX3FSUNPROC __glewTexCoord2fColor3fVertex3fSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD2FCOLOR3FVERTEX3FVSUNPROC __glewTexCoord2fColor3fVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC __glewTexCoord2fColor4fNormal3fVertex3fSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC __glewTexCoord2fColor4fNormal3fVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD2FCOLOR4UBVERTEX3FSUNPROC __glewTexCoord2fColor4ubVertex3fSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD2FCOLOR4UBVERTEX3FVSUNPROC __glewTexCoord2fColor4ubVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD2FNORMAL3FVERTEX3FSUNPROC __glewTexCoord2fNormal3fVertex3fSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD2FNORMAL3FVERTEX3FVSUNPROC __glewTexCoord2fNormal3fVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD2FVERTEX3FSUNPROC __glewTexCoord2fVertex3fSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD2FVERTEX3FVSUNPROC __glewTexCoord2fVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FSUNPROC __glewTexCoord4fColor4fNormal3fVertex4fSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FVSUNPROC __glewTexCoord4fColor4fNormal3fVertex4fvSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD4FVERTEX4FSUNPROC __glewTexCoord4fVertex4fSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD4FVERTEX4FVSUNPROC __glewTexCoord4fVertex4fvSUN; + +GLEW_FUN_EXPORT PFNGLADDSWAPHINTRECTWINPROC __glewAddSwapHintRectWIN; + +#if defined(GLEW_MX) && !defined(_WIN32) +struct GLEWContextStruct +{ +#endif /* GLEW_MX */ + +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_1_1; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_1_2; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_1_2_1; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_1_3; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_1_4; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_1_5; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_2_0; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_2_1; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_3_0; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_3_1; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_3_2; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_3_3; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_4_0; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_4_1; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_4_2; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_4_3; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_4_4; +GLEW_VAR_EXPORT GLboolean __GLEW_3DFX_multisample; +GLEW_VAR_EXPORT GLboolean __GLEW_3DFX_tbuffer; +GLEW_VAR_EXPORT GLboolean __GLEW_3DFX_texture_compression_FXT1; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_blend_minmax_factor; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_conservative_depth; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_debug_output; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_depth_clamp_separate; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_draw_buffers_blend; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_interleaved_elements; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_multi_draw_indirect; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_name_gen_delete; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_performance_monitor; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_pinned_memory; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_query_buffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_sample_positions; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_seamless_cubemap_per_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_shader_stencil_export; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_shader_trinary_minmax; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_sparse_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_stencil_operation_extended; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_texture_texture4; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_transform_feedback3_lines_triangles; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_vertex_shader_layer; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_vertex_shader_tessellator; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_vertex_shader_viewport_index; +GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_depth_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_framebuffer_blit; +GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_framebuffer_multisample; +GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_instanced_arrays; +GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_pack_reverse_row_order; +GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_program_binary; +GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_texture_compression_dxt1; +GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_texture_compression_dxt3; +GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_texture_compression_dxt5; +GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_texture_usage; +GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_timer_query; +GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_translated_shader_source; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_aux_depth_stencil; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_client_storage; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_element_array; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_fence; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_float_pixels; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_flush_buffer_range; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_object_purgeable; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_pixel_buffer; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_rgb_422; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_row_bytes; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_specular_vector; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_texture_range; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_transform_hint; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_vertex_array_object; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_vertex_array_range; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_vertex_program_evaluators; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_ycbcr_422; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_ES2_compatibility; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_ES3_compatibility; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_arrays_of_arrays; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_base_instance; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_bindless_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_blend_func_extended; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_buffer_storage; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_cl_event; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_clear_buffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_clear_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_color_buffer_float; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_compatibility; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_compressed_texture_pixel_storage; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_compute_shader; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_compute_variable_group_size; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_conservative_depth; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_copy_buffer; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_copy_image; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_debug_output; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_depth_buffer_float; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_depth_clamp; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_depth_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_draw_buffers; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_draw_buffers_blend; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_draw_elements_base_vertex; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_draw_indirect; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_draw_instanced; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_enhanced_layouts; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_explicit_attrib_location; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_explicit_uniform_location; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_fragment_coord_conventions; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_fragment_layer_viewport; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_fragment_program; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_fragment_program_shadow; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_fragment_shader; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_framebuffer_no_attachments; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_framebuffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_framebuffer_sRGB; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_geometry_shader4; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_get_program_binary; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_gpu_shader5; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_gpu_shader_fp64; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_half_float_pixel; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_half_float_vertex; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_imaging; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_indirect_parameters; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_instanced_arrays; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_internalformat_query; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_internalformat_query2; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_invalidate_subdata; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_map_buffer_alignment; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_map_buffer_range; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_matrix_palette; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_multi_bind; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_multi_draw_indirect; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_multisample; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_multitexture; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_occlusion_query; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_occlusion_query2; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_pixel_buffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_point_parameters; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_point_sprite; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_program_interface_query; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_provoking_vertex; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_query_buffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_robust_buffer_access_behavior; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_robustness; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_robustness_application_isolation; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_robustness_share_group_isolation; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_sample_shading; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_sampler_objects; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_seamless_cube_map; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_seamless_cubemap_per_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_separate_shader_objects; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_atomic_counters; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_bit_encoding; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_draw_parameters; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_group_vote; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_image_load_store; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_image_size; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_objects; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_precision; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_stencil_export; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_storage_buffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_subroutine; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_texture_lod; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shading_language_100; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shading_language_420pack; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shading_language_include; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shading_language_packing; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shadow; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shadow_ambient; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_sparse_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_stencil_texturing; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_sync; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_tessellation_shader; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_border_clamp; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_buffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_buffer_object_rgb32; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_buffer_range; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_compression; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_compression_bptc; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_compression_rgtc; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_cube_map; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_cube_map_array; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_env_add; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_env_combine; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_env_crossbar; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_env_dot3; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_float; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_gather; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_mirror_clamp_to_edge; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_mirrored_repeat; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_multisample; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_non_power_of_two; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_query_levels; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_query_lod; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_rectangle; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_rg; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_rgb10_a2ui; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_stencil8; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_storage; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_storage_multisample; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_swizzle; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_view; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_timer_query; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_transform_feedback2; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_transform_feedback3; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_transform_feedback_instanced; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_transpose_matrix; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_uniform_buffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_array_bgra; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_array_object; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_attrib_64bit; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_attrib_binding; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_blend; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_buffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_program; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_shader; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_type_10f_11f_11f_rev; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_type_2_10_10_10_rev; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_viewport_array; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_window_pos; +GLEW_VAR_EXPORT GLboolean __GLEW_ATIX_point_sprites; +GLEW_VAR_EXPORT GLboolean __GLEW_ATIX_texture_env_combine3; +GLEW_VAR_EXPORT GLboolean __GLEW_ATIX_texture_env_route; +GLEW_VAR_EXPORT GLboolean __GLEW_ATIX_vertex_shader_output_point_size; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_draw_buffers; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_element_array; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_envmap_bumpmap; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_fragment_shader; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_map_object_buffer; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_meminfo; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_pn_triangles; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_separate_stencil; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_shader_texture_lod; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_text_fragment_shader; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_texture_compression_3dc; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_texture_env_combine3; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_texture_float; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_texture_mirror_once; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_vertex_array_object; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_vertex_attrib_array_object; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_vertex_streams; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_422_pixels; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_Cg_shader; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_abgr; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_bgra; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_bindable_uniform; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_blend_color; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_blend_equation_separate; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_blend_func_separate; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_blend_logic_op; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_blend_minmax; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_blend_subtract; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_clip_volume_hint; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_cmyka; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_color_subtable; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_compiled_vertex_array; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_convolution; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_coordinate_frame; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_copy_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_cull_vertex; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_debug_marker; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_depth_bounds_test; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_direct_state_access; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_draw_buffers2; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_draw_instanced; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_draw_range_elements; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_fog_coord; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_fragment_lighting; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_framebuffer_blit; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_framebuffer_multisample; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_framebuffer_multisample_blit_scaled; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_framebuffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_framebuffer_sRGB; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_geometry_shader4; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_gpu_program_parameters; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_gpu_shader4; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_histogram; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_index_array_formats; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_index_func; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_index_material; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_index_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_light_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_misc_attribute; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_multi_draw_arrays; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_multisample; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_packed_depth_stencil; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_packed_float; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_packed_pixels; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_paletted_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_pixel_buffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_pixel_transform; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_pixel_transform_color_table; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_point_parameters; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_polygon_offset; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_provoking_vertex; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_rescale_normal; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_scene_marker; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_secondary_color; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_separate_shader_objects; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_separate_specular_color; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_shader_image_load_store; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_shadow_funcs; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_shared_texture_palette; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_stencil_clear_tag; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_stencil_two_side; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_stencil_wrap; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_subtexture; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture3D; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_array; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_buffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_compression_dxt1; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_compression_latc; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_compression_rgtc; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_compression_s3tc; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_cube_map; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_edge_clamp; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_env; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_env_add; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_env_combine; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_env_dot3; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_filter_anisotropic; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_integer; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_lod_bias; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_mirror_clamp; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_object; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_perturb_normal; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_rectangle; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_sRGB; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_sRGB_decode; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_shared_exponent; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_snorm; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_swizzle; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_timer_query; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_transform_feedback; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_vertex_array; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_vertex_array_bgra; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_vertex_attrib_64bit; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_vertex_shader; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_vertex_weighting; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_x11_sync_object; +GLEW_VAR_EXPORT GLboolean __GLEW_GREMEDY_frame_terminator; +GLEW_VAR_EXPORT GLboolean __GLEW_GREMEDY_string_marker; +GLEW_VAR_EXPORT GLboolean __GLEW_HP_convolution_border_modes; +GLEW_VAR_EXPORT GLboolean __GLEW_HP_image_transform; +GLEW_VAR_EXPORT GLboolean __GLEW_HP_occlusion_test; +GLEW_VAR_EXPORT GLboolean __GLEW_HP_texture_lighting; +GLEW_VAR_EXPORT GLboolean __GLEW_IBM_cull_vertex; +GLEW_VAR_EXPORT GLboolean __GLEW_IBM_multimode_draw_arrays; +GLEW_VAR_EXPORT GLboolean __GLEW_IBM_rasterpos_clip; +GLEW_VAR_EXPORT GLboolean __GLEW_IBM_static_data; +GLEW_VAR_EXPORT GLboolean __GLEW_IBM_texture_mirrored_repeat; +GLEW_VAR_EXPORT GLboolean __GLEW_IBM_vertex_array_lists; +GLEW_VAR_EXPORT GLboolean __GLEW_INGR_color_clamp; +GLEW_VAR_EXPORT GLboolean __GLEW_INGR_interlace_read; +GLEW_VAR_EXPORT GLboolean __GLEW_INTEL_map_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_INTEL_parallel_arrays; +GLEW_VAR_EXPORT GLboolean __GLEW_INTEL_texture_scissor; +GLEW_VAR_EXPORT GLboolean __GLEW_KHR_debug; +GLEW_VAR_EXPORT GLboolean __GLEW_KHR_texture_compression_astc_ldr; +GLEW_VAR_EXPORT GLboolean __GLEW_KTX_buffer_region; +GLEW_VAR_EXPORT GLboolean __GLEW_MESAX_texture_stack; +GLEW_VAR_EXPORT GLboolean __GLEW_MESA_pack_invert; +GLEW_VAR_EXPORT GLboolean __GLEW_MESA_resize_buffers; +GLEW_VAR_EXPORT GLboolean __GLEW_MESA_window_pos; +GLEW_VAR_EXPORT GLboolean __GLEW_MESA_ycbcr_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_NVX_conditional_render; +GLEW_VAR_EXPORT GLboolean __GLEW_NVX_gpu_memory_info; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_bindless_multi_draw_indirect; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_bindless_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_blend_equation_advanced; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_blend_equation_advanced_coherent; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_blend_square; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_compute_program5; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_conditional_render; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_copy_depth_to_color; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_copy_image; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_deep_texture3D; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_depth_buffer_float; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_depth_clamp; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_depth_range_unclamped; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_draw_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_evaluators; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_explicit_multisample; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_fence; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_float_buffer; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_fog_distance; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_fragment_program; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_fragment_program2; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_fragment_program4; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_fragment_program_option; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_framebuffer_multisample_coverage; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_geometry_program4; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_geometry_shader4; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_gpu_program4; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_gpu_program5; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_gpu_program5_mem_extended; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_gpu_program_fp64; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_gpu_shader5; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_half_float; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_light_max_exponent; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_multisample_coverage; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_multisample_filter_hint; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_occlusion_query; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_packed_depth_stencil; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_parameter_buffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_parameter_buffer_object2; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_path_rendering; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_pixel_data_range; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_point_sprite; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_present_video; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_primitive_restart; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_register_combiners; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_register_combiners2; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_shader_atomic_counters; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_shader_atomic_float; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_shader_buffer_load; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_shader_storage_buffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_tessellation_program5; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texgen_emboss; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texgen_reflection; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_barrier; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_compression_vtc; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_env_combine4; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_expand_normal; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_multisample; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_rectangle; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_shader; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_shader2; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_shader3; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_transform_feedback; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_transform_feedback2; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_vdpau_interop; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_array_range; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_array_range2; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_attrib_integer_64bit; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_buffer_unified_memory; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_program; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_program1_1; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_program2; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_program2_option; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_program3; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_program4; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_video_capture; +GLEW_VAR_EXPORT GLboolean __GLEW_OES_byte_coordinates; +GLEW_VAR_EXPORT GLboolean __GLEW_OES_compressed_paletted_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_OES_read_format; +GLEW_VAR_EXPORT GLboolean __GLEW_OES_single_precision; +GLEW_VAR_EXPORT GLboolean __GLEW_OML_interlace; +GLEW_VAR_EXPORT GLboolean __GLEW_OML_resample; +GLEW_VAR_EXPORT GLboolean __GLEW_OML_subsample; +GLEW_VAR_EXPORT GLboolean __GLEW_PGI_misc_hints; +GLEW_VAR_EXPORT GLboolean __GLEW_PGI_vertex_hints; +GLEW_VAR_EXPORT GLboolean __GLEW_REGAL_ES1_0_compatibility; +GLEW_VAR_EXPORT GLboolean __GLEW_REGAL_ES1_1_compatibility; +GLEW_VAR_EXPORT GLboolean __GLEW_REGAL_enable; +GLEW_VAR_EXPORT GLboolean __GLEW_REGAL_error_string; +GLEW_VAR_EXPORT GLboolean __GLEW_REGAL_extension_query; +GLEW_VAR_EXPORT GLboolean __GLEW_REGAL_log; +GLEW_VAR_EXPORT GLboolean __GLEW_REND_screen_coordinates; +GLEW_VAR_EXPORT GLboolean __GLEW_S3_s3tc; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_color_range; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_detail_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_fog_function; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_generate_mipmap; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_multisample; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_pixel_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_point_line_texgen; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_sharpen_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_texture4D; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_texture_border_clamp; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_texture_edge_clamp; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_texture_filter4; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_texture_lod; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_texture_select; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_async; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_async_histogram; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_async_pixel; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_blend_alpha_minmax; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_clipmap; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_convolution_accuracy; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_depth_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_flush_raster; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_fog_offset; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_fog_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_fragment_specular_lighting; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_framezoom; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_interlace; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_ir_instrument1; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_list_priority; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_pixel_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_pixel_texture_bits; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_reference_plane; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_resample; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_shadow; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_shadow_ambient; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_sprite; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_tag_sample_buffer; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_texture_add_env; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_texture_coordinate_clamp; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_texture_lod_bias; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_texture_multi_buffer; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_texture_range; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_texture_scale_bias; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_vertex_preclip; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_vertex_preclip_hint; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_ycrcb; +GLEW_VAR_EXPORT GLboolean __GLEW_SGI_color_matrix; +GLEW_VAR_EXPORT GLboolean __GLEW_SGI_color_table; +GLEW_VAR_EXPORT GLboolean __GLEW_SGI_texture_color_table; +GLEW_VAR_EXPORT GLboolean __GLEW_SUNX_constant_data; +GLEW_VAR_EXPORT GLboolean __GLEW_SUN_convolution_border_modes; +GLEW_VAR_EXPORT GLboolean __GLEW_SUN_global_alpha; +GLEW_VAR_EXPORT GLboolean __GLEW_SUN_mesh_array; +GLEW_VAR_EXPORT GLboolean __GLEW_SUN_read_video_pixels; +GLEW_VAR_EXPORT GLboolean __GLEW_SUN_slice_accum; +GLEW_VAR_EXPORT GLboolean __GLEW_SUN_triangle_list; +GLEW_VAR_EXPORT GLboolean __GLEW_SUN_vertex; +GLEW_VAR_EXPORT GLboolean __GLEW_WIN_phong_shading; +GLEW_VAR_EXPORT GLboolean __GLEW_WIN_specular_fog; +GLEW_VAR_EXPORT GLboolean __GLEW_WIN_swap_hint; + +#ifdef GLEW_MX +}; /* GLEWContextStruct */ +#endif /* GLEW_MX */ + +/* ------------------------------------------------------------------------- */ + +/* error codes */ +#define GLEW_OK 0 +#define GLEW_NO_ERROR 0 +#define GLEW_ERROR_NO_GL_VERSION 1 /* missing GL version */ +#define GLEW_ERROR_GL_VERSION_10_ONLY 2 /* Need at least OpenGL 1.1 */ +#define GLEW_ERROR_GLX_VERSION_11_ONLY 3 /* Need at least GLX 1.2 */ + +/* string codes */ +#define GLEW_VERSION 1 +#define GLEW_VERSION_MAJOR 2 +#define GLEW_VERSION_MINOR 3 +#define GLEW_VERSION_MICRO 4 + +/* API */ +#ifdef GLEW_MX + +typedef struct GLEWContextStruct GLEWContext; +GLEWAPI GLenum GLEWAPIENTRY glewContextInit (GLEWContext *ctx); +GLEWAPI GLboolean GLEWAPIENTRY glewContextIsSupported (const GLEWContext *ctx, const char *name); + +#define glewInit() glewContextInit(glewGetContext()) +#define glewIsSupported(x) glewContextIsSupported(glewGetContext(), x) +#define glewIsExtensionSupported(x) glewIsSupported(x) + +#define GLEW_GET_VAR(x) (*(const GLboolean*)&(glewGetContext()->x)) +#ifdef _WIN32 +# define GLEW_GET_FUN(x) glewGetContext()->x +#else +# define GLEW_GET_FUN(x) x +#endif + +#else /* GLEW_MX */ + +GLEWAPI GLenum GLEWAPIENTRY glewInit (void); +GLEWAPI GLboolean GLEWAPIENTRY glewIsSupported (const char *name); +#define glewIsExtensionSupported(x) glewIsSupported(x) + +#define GLEW_GET_VAR(x) (*(const GLboolean*)&x) +#define GLEW_GET_FUN(x) x + +#endif /* GLEW_MX */ + +GLEWAPI GLboolean glewExperimental; +GLEWAPI GLboolean GLEWAPIENTRY glewGetExtension (const char *name); +GLEWAPI const GLubyte * GLEWAPIENTRY glewGetErrorString (GLenum error); +GLEWAPI const GLubyte * GLEWAPIENTRY glewGetString (GLenum name); + +#ifdef __cplusplus +} +#endif + +#ifdef GLEW_APIENTRY_DEFINED +#undef GLEW_APIENTRY_DEFINED +#undef APIENTRY +#undef GLAPIENTRY +#define GLAPIENTRY +#endif + +#ifdef GLEW_CALLBACK_DEFINED +#undef GLEW_CALLBACK_DEFINED +#undef CALLBACK +#endif + +#ifdef GLEW_WINGDIAPI_DEFINED +#undef GLEW_WINGDIAPI_DEFINED +#undef WINGDIAPI +#endif + +#undef GLAPI +/* #undef GLEWAPI */ + +#endif /* __glew_h__ */ diff --git a/external/Chipmunk/msvc/glew/include/GL/glxew.h b/external/Chipmunk/msvc/glew/include/GL/glxew.h new file mode 100644 index 0000000..76a5f0d --- /dev/null +++ b/external/Chipmunk/msvc/glew/include/GL/glxew.h @@ -0,0 +1,1669 @@ +/* +** The OpenGL Extension Wrangler Library +** Copyright (C) 2002-2008, Milan Ikits +** Copyright (C) 2002-2008, Marcelo E. Magallon +** Copyright (C) 2002, Lev Povalahev +** All rights reserved. +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are met: +** +** * Redistributions of source code must retain the above copyright notice, +** this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright notice, +** this list of conditions and the following disclaimer in the documentation +** and/or other materials provided with the distribution. +** * The name of the author may be used to endorse or promote products +** derived from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +** ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +** LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +** INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +** CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +** ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF +** THE POSSIBILITY OF SUCH DAMAGE. +*/ + +/* + * Mesa 3-D graphics library + * Version: 7.0 + * + * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN + * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +/* +** Copyright (c) 2007 The Khronos Group Inc. +** +** Permission is hereby granted, free of charge, to any person obtaining a +** copy of this software and/or associated documentation files (the +** "Materials"), to deal in the Materials without restriction, including +** without limitation the rights to use, copy, modify, merge, publish, +** distribute, sublicense, and/or sell copies of the Materials, and to +** permit persons to whom the Materials are furnished to do so, subject to +** the following conditions: +** +** The above copyright notice and this permission notice shall be included +** in all copies or substantial portions of the Materials. +** +** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. +*/ + +#ifndef __glxew_h__ +#define __glxew_h__ +#define __GLXEW_H__ + +#ifdef __glxext_h_ +#error glxext.h included before glxew.h +#endif + +#if defined(GLX_H) || defined(__GLX_glx_h__) || defined(__glx_h__) +#error glx.h included before glxew.h +#endif + +#define __glxext_h_ + +#define GLX_H +#define __GLX_glx_h__ +#define __glx_h__ + +#include +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* ---------------------------- GLX_VERSION_1_0 --------------------------- */ + +#ifndef GLX_VERSION_1_0 +#define GLX_VERSION_1_0 1 + +#define GLX_USE_GL 1 +#define GLX_BUFFER_SIZE 2 +#define GLX_LEVEL 3 +#define GLX_RGBA 4 +#define GLX_DOUBLEBUFFER 5 +#define GLX_STEREO 6 +#define GLX_AUX_BUFFERS 7 +#define GLX_RED_SIZE 8 +#define GLX_GREEN_SIZE 9 +#define GLX_BLUE_SIZE 10 +#define GLX_ALPHA_SIZE 11 +#define GLX_DEPTH_SIZE 12 +#define GLX_STENCIL_SIZE 13 +#define GLX_ACCUM_RED_SIZE 14 +#define GLX_ACCUM_GREEN_SIZE 15 +#define GLX_ACCUM_BLUE_SIZE 16 +#define GLX_ACCUM_ALPHA_SIZE 17 +#define GLX_BAD_SCREEN 1 +#define GLX_BAD_ATTRIBUTE 2 +#define GLX_NO_EXTENSION 3 +#define GLX_BAD_VISUAL 4 +#define GLX_BAD_CONTEXT 5 +#define GLX_BAD_VALUE 6 +#define GLX_BAD_ENUM 7 + +typedef XID GLXDrawable; +typedef XID GLXPixmap; +#ifdef __sun +typedef struct __glXContextRec *GLXContext; +#else +typedef struct __GLXcontextRec *GLXContext; +#endif + +typedef unsigned int GLXVideoDeviceNV; + +extern Bool glXQueryExtension (Display *dpy, int *errorBase, int *eventBase); +extern Bool glXQueryVersion (Display *dpy, int *major, int *minor); +extern int glXGetConfig (Display *dpy, XVisualInfo *vis, int attrib, int *value); +extern XVisualInfo* glXChooseVisual (Display *dpy, int screen, int *attribList); +extern GLXPixmap glXCreateGLXPixmap (Display *dpy, XVisualInfo *vis, Pixmap pixmap); +extern void glXDestroyGLXPixmap (Display *dpy, GLXPixmap pix); +extern GLXContext glXCreateContext (Display *dpy, XVisualInfo *vis, GLXContext shareList, Bool direct); +extern void glXDestroyContext (Display *dpy, GLXContext ctx); +extern Bool glXIsDirect (Display *dpy, GLXContext ctx); +extern void glXCopyContext (Display *dpy, GLXContext src, GLXContext dst, GLulong mask); +extern Bool glXMakeCurrent (Display *dpy, GLXDrawable drawable, GLXContext ctx); +extern GLXContext glXGetCurrentContext (void); +extern GLXDrawable glXGetCurrentDrawable (void); +extern void glXWaitGL (void); +extern void glXWaitX (void); +extern void glXSwapBuffers (Display *dpy, GLXDrawable drawable); +extern void glXUseXFont (Font font, int first, int count, int listBase); + +#define GLXEW_VERSION_1_0 GLXEW_GET_VAR(__GLXEW_VERSION_1_0) + +#endif /* GLX_VERSION_1_0 */ + +/* ---------------------------- GLX_VERSION_1_1 --------------------------- */ + +#ifndef GLX_VERSION_1_1 +#define GLX_VERSION_1_1 + +#define GLX_VENDOR 0x1 +#define GLX_VERSION 0x2 +#define GLX_EXTENSIONS 0x3 + +extern const char* glXQueryExtensionsString (Display *dpy, int screen); +extern const char* glXGetClientString (Display *dpy, int name); +extern const char* glXQueryServerString (Display *dpy, int screen, int name); + +#define GLXEW_VERSION_1_1 GLXEW_GET_VAR(__GLXEW_VERSION_1_1) + +#endif /* GLX_VERSION_1_1 */ + +/* ---------------------------- GLX_VERSION_1_2 ---------------------------- */ + +#ifndef GLX_VERSION_1_2 +#define GLX_VERSION_1_2 1 + +typedef Display* ( * PFNGLXGETCURRENTDISPLAYPROC) (void); + +#define glXGetCurrentDisplay GLXEW_GET_FUN(__glewXGetCurrentDisplay) + +#define GLXEW_VERSION_1_2 GLXEW_GET_VAR(__GLXEW_VERSION_1_2) + +#endif /* GLX_VERSION_1_2 */ + +/* ---------------------------- GLX_VERSION_1_3 ---------------------------- */ + +#ifndef GLX_VERSION_1_3 +#define GLX_VERSION_1_3 1 + +#define GLX_RGBA_BIT 0x00000001 +#define GLX_FRONT_LEFT_BUFFER_BIT 0x00000001 +#define GLX_WINDOW_BIT 0x00000001 +#define GLX_COLOR_INDEX_BIT 0x00000002 +#define GLX_PIXMAP_BIT 0x00000002 +#define GLX_FRONT_RIGHT_BUFFER_BIT 0x00000002 +#define GLX_BACK_LEFT_BUFFER_BIT 0x00000004 +#define GLX_PBUFFER_BIT 0x00000004 +#define GLX_BACK_RIGHT_BUFFER_BIT 0x00000008 +#define GLX_AUX_BUFFERS_BIT 0x00000010 +#define GLX_CONFIG_CAVEAT 0x20 +#define GLX_DEPTH_BUFFER_BIT 0x00000020 +#define GLX_X_VISUAL_TYPE 0x22 +#define GLX_TRANSPARENT_TYPE 0x23 +#define GLX_TRANSPARENT_INDEX_VALUE 0x24 +#define GLX_TRANSPARENT_RED_VALUE 0x25 +#define GLX_TRANSPARENT_GREEN_VALUE 0x26 +#define GLX_TRANSPARENT_BLUE_VALUE 0x27 +#define GLX_TRANSPARENT_ALPHA_VALUE 0x28 +#define GLX_STENCIL_BUFFER_BIT 0x00000040 +#define GLX_ACCUM_BUFFER_BIT 0x00000080 +#define GLX_NONE 0x8000 +#define GLX_SLOW_CONFIG 0x8001 +#define GLX_TRUE_COLOR 0x8002 +#define GLX_DIRECT_COLOR 0x8003 +#define GLX_PSEUDO_COLOR 0x8004 +#define GLX_STATIC_COLOR 0x8005 +#define GLX_GRAY_SCALE 0x8006 +#define GLX_STATIC_GRAY 0x8007 +#define GLX_TRANSPARENT_RGB 0x8008 +#define GLX_TRANSPARENT_INDEX 0x8009 +#define GLX_VISUAL_ID 0x800B +#define GLX_SCREEN 0x800C +#define GLX_NON_CONFORMANT_CONFIG 0x800D +#define GLX_DRAWABLE_TYPE 0x8010 +#define GLX_RENDER_TYPE 0x8011 +#define GLX_X_RENDERABLE 0x8012 +#define GLX_FBCONFIG_ID 0x8013 +#define GLX_RGBA_TYPE 0x8014 +#define GLX_COLOR_INDEX_TYPE 0x8015 +#define GLX_MAX_PBUFFER_WIDTH 0x8016 +#define GLX_MAX_PBUFFER_HEIGHT 0x8017 +#define GLX_MAX_PBUFFER_PIXELS 0x8018 +#define GLX_PRESERVED_CONTENTS 0x801B +#define GLX_LARGEST_PBUFFER 0x801C +#define GLX_WIDTH 0x801D +#define GLX_HEIGHT 0x801E +#define GLX_EVENT_MASK 0x801F +#define GLX_DAMAGED 0x8020 +#define GLX_SAVED 0x8021 +#define GLX_WINDOW 0x8022 +#define GLX_PBUFFER 0x8023 +#define GLX_PBUFFER_HEIGHT 0x8040 +#define GLX_PBUFFER_WIDTH 0x8041 +#define GLX_PBUFFER_CLOBBER_MASK 0x08000000 +#define GLX_DONT_CARE 0xFFFFFFFF + +typedef XID GLXFBConfigID; +typedef XID GLXPbuffer; +typedef XID GLXWindow; +typedef struct __GLXFBConfigRec *GLXFBConfig; + +typedef struct { + int event_type; + int draw_type; + unsigned long serial; + Bool send_event; + Display *display; + GLXDrawable drawable; + unsigned int buffer_mask; + unsigned int aux_buffer; + int x, y; + int width, height; + int count; +} GLXPbufferClobberEvent; +typedef union __GLXEvent { + GLXPbufferClobberEvent glxpbufferclobber; + long pad[24]; +} GLXEvent; + +typedef GLXFBConfig* ( * PFNGLXCHOOSEFBCONFIGPROC) (Display *dpy, int screen, const int *attrib_list, int *nelements); +typedef GLXContext ( * PFNGLXCREATENEWCONTEXTPROC) (Display *dpy, GLXFBConfig config, int render_type, GLXContext share_list, Bool direct); +typedef GLXPbuffer ( * PFNGLXCREATEPBUFFERPROC) (Display *dpy, GLXFBConfig config, const int *attrib_list); +typedef GLXPixmap ( * PFNGLXCREATEPIXMAPPROC) (Display *dpy, GLXFBConfig config, Pixmap pixmap, const int *attrib_list); +typedef GLXWindow ( * PFNGLXCREATEWINDOWPROC) (Display *dpy, GLXFBConfig config, Window win, const int *attrib_list); +typedef void ( * PFNGLXDESTROYPBUFFERPROC) (Display *dpy, GLXPbuffer pbuf); +typedef void ( * PFNGLXDESTROYPIXMAPPROC) (Display *dpy, GLXPixmap pixmap); +typedef void ( * PFNGLXDESTROYWINDOWPROC) (Display *dpy, GLXWindow win); +typedef GLXDrawable ( * PFNGLXGETCURRENTREADDRAWABLEPROC) (void); +typedef int ( * PFNGLXGETFBCONFIGATTRIBPROC) (Display *dpy, GLXFBConfig config, int attribute, int *value); +typedef GLXFBConfig* ( * PFNGLXGETFBCONFIGSPROC) (Display *dpy, int screen, int *nelements); +typedef void ( * PFNGLXGETSELECTEDEVENTPROC) (Display *dpy, GLXDrawable draw, unsigned long *event_mask); +typedef XVisualInfo* ( * PFNGLXGETVISUALFROMFBCONFIGPROC) (Display *dpy, GLXFBConfig config); +typedef Bool ( * PFNGLXMAKECONTEXTCURRENTPROC) (Display *display, GLXDrawable draw, GLXDrawable read, GLXContext ctx); +typedef int ( * PFNGLXQUERYCONTEXTPROC) (Display *dpy, GLXContext ctx, int attribute, int *value); +typedef void ( * PFNGLXQUERYDRAWABLEPROC) (Display *dpy, GLXDrawable draw, int attribute, unsigned int *value); +typedef void ( * PFNGLXSELECTEVENTPROC) (Display *dpy, GLXDrawable draw, unsigned long event_mask); + +#define glXChooseFBConfig GLXEW_GET_FUN(__glewXChooseFBConfig) +#define glXCreateNewContext GLXEW_GET_FUN(__glewXCreateNewContext) +#define glXCreatePbuffer GLXEW_GET_FUN(__glewXCreatePbuffer) +#define glXCreatePixmap GLXEW_GET_FUN(__glewXCreatePixmap) +#define glXCreateWindow GLXEW_GET_FUN(__glewXCreateWindow) +#define glXDestroyPbuffer GLXEW_GET_FUN(__glewXDestroyPbuffer) +#define glXDestroyPixmap GLXEW_GET_FUN(__glewXDestroyPixmap) +#define glXDestroyWindow GLXEW_GET_FUN(__glewXDestroyWindow) +#define glXGetCurrentReadDrawable GLXEW_GET_FUN(__glewXGetCurrentReadDrawable) +#define glXGetFBConfigAttrib GLXEW_GET_FUN(__glewXGetFBConfigAttrib) +#define glXGetFBConfigs GLXEW_GET_FUN(__glewXGetFBConfigs) +#define glXGetSelectedEvent GLXEW_GET_FUN(__glewXGetSelectedEvent) +#define glXGetVisualFromFBConfig GLXEW_GET_FUN(__glewXGetVisualFromFBConfig) +#define glXMakeContextCurrent GLXEW_GET_FUN(__glewXMakeContextCurrent) +#define glXQueryContext GLXEW_GET_FUN(__glewXQueryContext) +#define glXQueryDrawable GLXEW_GET_FUN(__glewXQueryDrawable) +#define glXSelectEvent GLXEW_GET_FUN(__glewXSelectEvent) + +#define GLXEW_VERSION_1_3 GLXEW_GET_VAR(__GLXEW_VERSION_1_3) + +#endif /* GLX_VERSION_1_3 */ + +/* ---------------------------- GLX_VERSION_1_4 ---------------------------- */ + +#ifndef GLX_VERSION_1_4 +#define GLX_VERSION_1_4 1 + +#define GLX_SAMPLE_BUFFERS 100000 +#define GLX_SAMPLES 100001 + +extern void ( * glXGetProcAddress (const GLubyte *procName)) (void); + +#define GLXEW_VERSION_1_4 GLXEW_GET_VAR(__GLXEW_VERSION_1_4) + +#endif /* GLX_VERSION_1_4 */ + +/* -------------------------- GLX_3DFX_multisample ------------------------- */ + +#ifndef GLX_3DFX_multisample +#define GLX_3DFX_multisample 1 + +#define GLX_SAMPLE_BUFFERS_3DFX 0x8050 +#define GLX_SAMPLES_3DFX 0x8051 + +#define GLXEW_3DFX_multisample GLXEW_GET_VAR(__GLXEW_3DFX_multisample) + +#endif /* GLX_3DFX_multisample */ + +/* ------------------------ GLX_AMD_gpu_association ------------------------ */ + +#ifndef GLX_AMD_gpu_association +#define GLX_AMD_gpu_association 1 + +#define GLX_GPU_VENDOR_AMD 0x1F00 +#define GLX_GPU_RENDERER_STRING_AMD 0x1F01 +#define GLX_GPU_OPENGL_VERSION_STRING_AMD 0x1F02 +#define GLX_GPU_FASTEST_TARGET_GPUS_AMD 0x21A2 +#define GLX_GPU_RAM_AMD 0x21A3 +#define GLX_GPU_CLOCK_AMD 0x21A4 +#define GLX_GPU_NUM_PIPES_AMD 0x21A5 +#define GLX_GPU_NUM_SIMD_AMD 0x21A6 +#define GLX_GPU_NUM_RB_AMD 0x21A7 +#define GLX_GPU_NUM_SPI_AMD 0x21A8 + +typedef void ( * PFNGLXBLITCONTEXTFRAMEBUFFERAMDPROC) (GLXContext dstCtx, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); +typedef GLXContext ( * PFNGLXCREATEASSOCIATEDCONTEXTAMDPROC) (unsigned int id, GLXContext share_list); +typedef GLXContext ( * PFNGLXCREATEASSOCIATEDCONTEXTATTRIBSAMDPROC) (unsigned int id, GLXContext share_context, const int* attribList); +typedef Bool ( * PFNGLXDELETEASSOCIATEDCONTEXTAMDPROC) (GLXContext ctx); +typedef unsigned int ( * PFNGLXGETCONTEXTGPUIDAMDPROC) (GLXContext ctx); +typedef GLXContext ( * PFNGLXGETCURRENTASSOCIATEDCONTEXTAMDPROC) (void); +typedef unsigned int ( * PFNGLXGETGPUIDSAMDPROC) (unsigned int maxCount, unsigned int* ids); +typedef int ( * PFNGLXGETGPUINFOAMDPROC) (unsigned int id, int property, GLenum dataType, unsigned int size, void* data); +typedef Bool ( * PFNGLXMAKEASSOCIATEDCONTEXTCURRENTAMDPROC) (GLXContext ctx); + +#define glXBlitContextFramebufferAMD GLXEW_GET_FUN(__glewXBlitContextFramebufferAMD) +#define glXCreateAssociatedContextAMD GLXEW_GET_FUN(__glewXCreateAssociatedContextAMD) +#define glXCreateAssociatedContextAttribsAMD GLXEW_GET_FUN(__glewXCreateAssociatedContextAttribsAMD) +#define glXDeleteAssociatedContextAMD GLXEW_GET_FUN(__glewXDeleteAssociatedContextAMD) +#define glXGetContextGPUIDAMD GLXEW_GET_FUN(__glewXGetContextGPUIDAMD) +#define glXGetCurrentAssociatedContextAMD GLXEW_GET_FUN(__glewXGetCurrentAssociatedContextAMD) +#define glXGetGPUIDsAMD GLXEW_GET_FUN(__glewXGetGPUIDsAMD) +#define glXGetGPUInfoAMD GLXEW_GET_FUN(__glewXGetGPUInfoAMD) +#define glXMakeAssociatedContextCurrentAMD GLXEW_GET_FUN(__glewXMakeAssociatedContextCurrentAMD) + +#define GLXEW_AMD_gpu_association GLXEW_GET_VAR(__GLXEW_AMD_gpu_association) + +#endif /* GLX_AMD_gpu_association */ + +/* ------------------------- GLX_ARB_create_context ------------------------ */ + +#ifndef GLX_ARB_create_context +#define GLX_ARB_create_context 1 + +#define GLX_CONTEXT_DEBUG_BIT_ARB 0x0001 +#define GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB 0x0002 +#define GLX_CONTEXT_MAJOR_VERSION_ARB 0x2091 +#define GLX_CONTEXT_MINOR_VERSION_ARB 0x2092 +#define GLX_CONTEXT_FLAGS_ARB 0x2094 + +typedef GLXContext ( * PFNGLXCREATECONTEXTATTRIBSARBPROC) (Display* dpy, GLXFBConfig config, GLXContext share_context, Bool direct, const int *attrib_list); + +#define glXCreateContextAttribsARB GLXEW_GET_FUN(__glewXCreateContextAttribsARB) + +#define GLXEW_ARB_create_context GLXEW_GET_VAR(__GLXEW_ARB_create_context) + +#endif /* GLX_ARB_create_context */ + +/* --------------------- GLX_ARB_create_context_profile -------------------- */ + +#ifndef GLX_ARB_create_context_profile +#define GLX_ARB_create_context_profile 1 + +#define GLX_CONTEXT_CORE_PROFILE_BIT_ARB 0x00000001 +#define GLX_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB 0x00000002 +#define GLX_CONTEXT_PROFILE_MASK_ARB 0x9126 + +#define GLXEW_ARB_create_context_profile GLXEW_GET_VAR(__GLXEW_ARB_create_context_profile) + +#endif /* GLX_ARB_create_context_profile */ + +/* ------------------- GLX_ARB_create_context_robustness ------------------- */ + +#ifndef GLX_ARB_create_context_robustness +#define GLX_ARB_create_context_robustness 1 + +#define GLX_CONTEXT_ROBUST_ACCESS_BIT_ARB 0x00000004 +#define GLX_LOSE_CONTEXT_ON_RESET_ARB 0x8252 +#define GLX_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB 0x8256 +#define GLX_NO_RESET_NOTIFICATION_ARB 0x8261 + +#define GLXEW_ARB_create_context_robustness GLXEW_GET_VAR(__GLXEW_ARB_create_context_robustness) + +#endif /* GLX_ARB_create_context_robustness */ + +/* ------------------------- GLX_ARB_fbconfig_float ------------------------ */ + +#ifndef GLX_ARB_fbconfig_float +#define GLX_ARB_fbconfig_float 1 + +#define GLX_RGBA_FLOAT_BIT 0x00000004 +#define GLX_RGBA_FLOAT_TYPE 0x20B9 + +#define GLXEW_ARB_fbconfig_float GLXEW_GET_VAR(__GLXEW_ARB_fbconfig_float) + +#endif /* GLX_ARB_fbconfig_float */ + +/* ------------------------ GLX_ARB_framebuffer_sRGB ----------------------- */ + +#ifndef GLX_ARB_framebuffer_sRGB +#define GLX_ARB_framebuffer_sRGB 1 + +#define GLX_FRAMEBUFFER_SRGB_CAPABLE_ARB 0x20B2 + +#define GLXEW_ARB_framebuffer_sRGB GLXEW_GET_VAR(__GLXEW_ARB_framebuffer_sRGB) + +#endif /* GLX_ARB_framebuffer_sRGB */ + +/* ------------------------ GLX_ARB_get_proc_address ----------------------- */ + +#ifndef GLX_ARB_get_proc_address +#define GLX_ARB_get_proc_address 1 + +extern void ( * glXGetProcAddressARB (const GLubyte *procName)) (void); + +#define GLXEW_ARB_get_proc_address GLXEW_GET_VAR(__GLXEW_ARB_get_proc_address) + +#endif /* GLX_ARB_get_proc_address */ + +/* -------------------------- GLX_ARB_multisample -------------------------- */ + +#ifndef GLX_ARB_multisample +#define GLX_ARB_multisample 1 + +#define GLX_SAMPLE_BUFFERS_ARB 100000 +#define GLX_SAMPLES_ARB 100001 + +#define GLXEW_ARB_multisample GLXEW_GET_VAR(__GLXEW_ARB_multisample) + +#endif /* GLX_ARB_multisample */ + +/* ---------------- GLX_ARB_robustness_application_isolation --------------- */ + +#ifndef GLX_ARB_robustness_application_isolation +#define GLX_ARB_robustness_application_isolation 1 + +#define GLX_CONTEXT_RESET_ISOLATION_BIT_ARB 0x00000008 + +#define GLXEW_ARB_robustness_application_isolation GLXEW_GET_VAR(__GLXEW_ARB_robustness_application_isolation) + +#endif /* GLX_ARB_robustness_application_isolation */ + +/* ---------------- GLX_ARB_robustness_share_group_isolation --------------- */ + +#ifndef GLX_ARB_robustness_share_group_isolation +#define GLX_ARB_robustness_share_group_isolation 1 + +#define GLX_CONTEXT_RESET_ISOLATION_BIT_ARB 0x00000008 + +#define GLXEW_ARB_robustness_share_group_isolation GLXEW_GET_VAR(__GLXEW_ARB_robustness_share_group_isolation) + +#endif /* GLX_ARB_robustness_share_group_isolation */ + +/* ---------------------- GLX_ARB_vertex_buffer_object --------------------- */ + +#ifndef GLX_ARB_vertex_buffer_object +#define GLX_ARB_vertex_buffer_object 1 + +#define GLX_CONTEXT_ALLOW_BUFFER_BYTE_ORDER_MISMATCH_ARB 0x2095 + +#define GLXEW_ARB_vertex_buffer_object GLXEW_GET_VAR(__GLXEW_ARB_vertex_buffer_object) + +#endif /* GLX_ARB_vertex_buffer_object */ + +/* ----------------------- GLX_ATI_pixel_format_float ---------------------- */ + +#ifndef GLX_ATI_pixel_format_float +#define GLX_ATI_pixel_format_float 1 + +#define GLX_RGBA_FLOAT_ATI_BIT 0x00000100 + +#define GLXEW_ATI_pixel_format_float GLXEW_GET_VAR(__GLXEW_ATI_pixel_format_float) + +#endif /* GLX_ATI_pixel_format_float */ + +/* ------------------------- GLX_ATI_render_texture ------------------------ */ + +#ifndef GLX_ATI_render_texture +#define GLX_ATI_render_texture 1 + +#define GLX_BIND_TO_TEXTURE_RGB_ATI 0x9800 +#define GLX_BIND_TO_TEXTURE_RGBA_ATI 0x9801 +#define GLX_TEXTURE_FORMAT_ATI 0x9802 +#define GLX_TEXTURE_TARGET_ATI 0x9803 +#define GLX_MIPMAP_TEXTURE_ATI 0x9804 +#define GLX_TEXTURE_RGB_ATI 0x9805 +#define GLX_TEXTURE_RGBA_ATI 0x9806 +#define GLX_NO_TEXTURE_ATI 0x9807 +#define GLX_TEXTURE_CUBE_MAP_ATI 0x9808 +#define GLX_TEXTURE_1D_ATI 0x9809 +#define GLX_TEXTURE_2D_ATI 0x980A +#define GLX_MIPMAP_LEVEL_ATI 0x980B +#define GLX_CUBE_MAP_FACE_ATI 0x980C +#define GLX_TEXTURE_CUBE_MAP_POSITIVE_X_ATI 0x980D +#define GLX_TEXTURE_CUBE_MAP_NEGATIVE_X_ATI 0x980E +#define GLX_TEXTURE_CUBE_MAP_POSITIVE_Y_ATI 0x980F +#define GLX_TEXTURE_CUBE_MAP_NEGATIVE_Y_ATI 0x9810 +#define GLX_TEXTURE_CUBE_MAP_POSITIVE_Z_ATI 0x9811 +#define GLX_TEXTURE_CUBE_MAP_NEGATIVE_Z_ATI 0x9812 +#define GLX_FRONT_LEFT_ATI 0x9813 +#define GLX_FRONT_RIGHT_ATI 0x9814 +#define GLX_BACK_LEFT_ATI 0x9815 +#define GLX_BACK_RIGHT_ATI 0x9816 +#define GLX_AUX0_ATI 0x9817 +#define GLX_AUX1_ATI 0x9818 +#define GLX_AUX2_ATI 0x9819 +#define GLX_AUX3_ATI 0x981A +#define GLX_AUX4_ATI 0x981B +#define GLX_AUX5_ATI 0x981C +#define GLX_AUX6_ATI 0x981D +#define GLX_AUX7_ATI 0x981E +#define GLX_AUX8_ATI 0x981F +#define GLX_AUX9_ATI 0x9820 +#define GLX_BIND_TO_TEXTURE_LUMINANCE_ATI 0x9821 +#define GLX_BIND_TO_TEXTURE_INTENSITY_ATI 0x9822 + +typedef void ( * PFNGLXBINDTEXIMAGEATIPROC) (Display *dpy, GLXPbuffer pbuf, int buffer); +typedef void ( * PFNGLXDRAWABLEATTRIBATIPROC) (Display *dpy, GLXDrawable draw, const int *attrib_list); +typedef void ( * PFNGLXRELEASETEXIMAGEATIPROC) (Display *dpy, GLXPbuffer pbuf, int buffer); + +#define glXBindTexImageATI GLXEW_GET_FUN(__glewXBindTexImageATI) +#define glXDrawableAttribATI GLXEW_GET_FUN(__glewXDrawableAttribATI) +#define glXReleaseTexImageATI GLXEW_GET_FUN(__glewXReleaseTexImageATI) + +#define GLXEW_ATI_render_texture GLXEW_GET_VAR(__GLXEW_ATI_render_texture) + +#endif /* GLX_ATI_render_texture */ + +/* --------------------------- GLX_EXT_buffer_age -------------------------- */ + +#ifndef GLX_EXT_buffer_age +#define GLX_EXT_buffer_age 1 + +#define GLX_BACK_BUFFER_AGE_EXT 0x20F4 + +#define GLXEW_EXT_buffer_age GLXEW_GET_VAR(__GLXEW_EXT_buffer_age) + +#endif /* GLX_EXT_buffer_age */ + +/* ------------------- GLX_EXT_create_context_es2_profile ------------------ */ + +#ifndef GLX_EXT_create_context_es2_profile +#define GLX_EXT_create_context_es2_profile 1 + +#define GLX_CONTEXT_ES2_PROFILE_BIT_EXT 0x00000004 + +#define GLXEW_EXT_create_context_es2_profile GLXEW_GET_VAR(__GLXEW_EXT_create_context_es2_profile) + +#endif /* GLX_EXT_create_context_es2_profile */ + +/* ------------------- GLX_EXT_create_context_es_profile ------------------- */ + +#ifndef GLX_EXT_create_context_es_profile +#define GLX_EXT_create_context_es_profile 1 + +#define GLX_CONTEXT_ES_PROFILE_BIT_EXT 0x00000004 + +#define GLXEW_EXT_create_context_es_profile GLXEW_GET_VAR(__GLXEW_EXT_create_context_es_profile) + +#endif /* GLX_EXT_create_context_es_profile */ + +/* --------------------- GLX_EXT_fbconfig_packed_float --------------------- */ + +#ifndef GLX_EXT_fbconfig_packed_float +#define GLX_EXT_fbconfig_packed_float 1 + +#define GLX_RGBA_UNSIGNED_FLOAT_BIT_EXT 0x00000008 +#define GLX_RGBA_UNSIGNED_FLOAT_TYPE_EXT 0x20B1 + +#define GLXEW_EXT_fbconfig_packed_float GLXEW_GET_VAR(__GLXEW_EXT_fbconfig_packed_float) + +#endif /* GLX_EXT_fbconfig_packed_float */ + +/* ------------------------ GLX_EXT_framebuffer_sRGB ----------------------- */ + +#ifndef GLX_EXT_framebuffer_sRGB +#define GLX_EXT_framebuffer_sRGB 1 + +#define GLX_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x20B2 + +#define GLXEW_EXT_framebuffer_sRGB GLXEW_GET_VAR(__GLXEW_EXT_framebuffer_sRGB) + +#endif /* GLX_EXT_framebuffer_sRGB */ + +/* ------------------------- GLX_EXT_import_context ------------------------ */ + +#ifndef GLX_EXT_import_context +#define GLX_EXT_import_context 1 + +#define GLX_SHARE_CONTEXT_EXT 0x800A +#define GLX_VISUAL_ID_EXT 0x800B +#define GLX_SCREEN_EXT 0x800C + +typedef XID GLXContextID; + +typedef void ( * PFNGLXFREECONTEXTEXTPROC) (Display* dpy, GLXContext context); +typedef GLXContextID ( * PFNGLXGETCONTEXTIDEXTPROC) (const GLXContext context); +typedef GLXContext ( * PFNGLXIMPORTCONTEXTEXTPROC) (Display* dpy, GLXContextID contextID); +typedef int ( * PFNGLXQUERYCONTEXTINFOEXTPROC) (Display* dpy, GLXContext context, int attribute,int *value); + +#define glXFreeContextEXT GLXEW_GET_FUN(__glewXFreeContextEXT) +#define glXGetContextIDEXT GLXEW_GET_FUN(__glewXGetContextIDEXT) +#define glXImportContextEXT GLXEW_GET_FUN(__glewXImportContextEXT) +#define glXQueryContextInfoEXT GLXEW_GET_FUN(__glewXQueryContextInfoEXT) + +#define GLXEW_EXT_import_context GLXEW_GET_VAR(__GLXEW_EXT_import_context) + +#endif /* GLX_EXT_import_context */ + +/* -------------------------- GLX_EXT_scene_marker ------------------------- */ + +#ifndef GLX_EXT_scene_marker +#define GLX_EXT_scene_marker 1 + +#define GLXEW_EXT_scene_marker GLXEW_GET_VAR(__GLXEW_EXT_scene_marker) + +#endif /* GLX_EXT_scene_marker */ + +/* -------------------------- GLX_EXT_swap_control ------------------------- */ + +#ifndef GLX_EXT_swap_control +#define GLX_EXT_swap_control 1 + +#define GLX_SWAP_INTERVAL_EXT 0x20F1 +#define GLX_MAX_SWAP_INTERVAL_EXT 0x20F2 + +typedef void ( * PFNGLXSWAPINTERVALEXTPROC) (Display* dpy, GLXDrawable drawable, int interval); + +#define glXSwapIntervalEXT GLXEW_GET_FUN(__glewXSwapIntervalEXT) + +#define GLXEW_EXT_swap_control GLXEW_GET_VAR(__GLXEW_EXT_swap_control) + +#endif /* GLX_EXT_swap_control */ + +/* ----------------------- GLX_EXT_swap_control_tear ----------------------- */ + +#ifndef GLX_EXT_swap_control_tear +#define GLX_EXT_swap_control_tear 1 + +#define GLX_LATE_SWAPS_TEAR_EXT 0x20F3 + +#define GLXEW_EXT_swap_control_tear GLXEW_GET_VAR(__GLXEW_EXT_swap_control_tear) + +#endif /* GLX_EXT_swap_control_tear */ + +/* ---------------------- GLX_EXT_texture_from_pixmap ---------------------- */ + +#ifndef GLX_EXT_texture_from_pixmap +#define GLX_EXT_texture_from_pixmap 1 + +#define GLX_TEXTURE_1D_BIT_EXT 0x00000001 +#define GLX_TEXTURE_2D_BIT_EXT 0x00000002 +#define GLX_TEXTURE_RECTANGLE_BIT_EXT 0x00000004 +#define GLX_BIND_TO_TEXTURE_RGB_EXT 0x20D0 +#define GLX_BIND_TO_TEXTURE_RGBA_EXT 0x20D1 +#define GLX_BIND_TO_MIPMAP_TEXTURE_EXT 0x20D2 +#define GLX_BIND_TO_TEXTURE_TARGETS_EXT 0x20D3 +#define GLX_Y_INVERTED_EXT 0x20D4 +#define GLX_TEXTURE_FORMAT_EXT 0x20D5 +#define GLX_TEXTURE_TARGET_EXT 0x20D6 +#define GLX_MIPMAP_TEXTURE_EXT 0x20D7 +#define GLX_TEXTURE_FORMAT_NONE_EXT 0x20D8 +#define GLX_TEXTURE_FORMAT_RGB_EXT 0x20D9 +#define GLX_TEXTURE_FORMAT_RGBA_EXT 0x20DA +#define GLX_TEXTURE_1D_EXT 0x20DB +#define GLX_TEXTURE_2D_EXT 0x20DC +#define GLX_TEXTURE_RECTANGLE_EXT 0x20DD +#define GLX_FRONT_LEFT_EXT 0x20DE +#define GLX_FRONT_RIGHT_EXT 0x20DF +#define GLX_BACK_LEFT_EXT 0x20E0 +#define GLX_BACK_RIGHT_EXT 0x20E1 +#define GLX_AUX0_EXT 0x20E2 +#define GLX_AUX1_EXT 0x20E3 +#define GLX_AUX2_EXT 0x20E4 +#define GLX_AUX3_EXT 0x20E5 +#define GLX_AUX4_EXT 0x20E6 +#define GLX_AUX5_EXT 0x20E7 +#define GLX_AUX6_EXT 0x20E8 +#define GLX_AUX7_EXT 0x20E9 +#define GLX_AUX8_EXT 0x20EA +#define GLX_AUX9_EXT 0x20EB + +typedef void ( * PFNGLXBINDTEXIMAGEEXTPROC) (Display* display, GLXDrawable drawable, int buffer, const int *attrib_list); +typedef void ( * PFNGLXRELEASETEXIMAGEEXTPROC) (Display* display, GLXDrawable drawable, int buffer); + +#define glXBindTexImageEXT GLXEW_GET_FUN(__glewXBindTexImageEXT) +#define glXReleaseTexImageEXT GLXEW_GET_FUN(__glewXReleaseTexImageEXT) + +#define GLXEW_EXT_texture_from_pixmap GLXEW_GET_VAR(__GLXEW_EXT_texture_from_pixmap) + +#endif /* GLX_EXT_texture_from_pixmap */ + +/* -------------------------- GLX_EXT_visual_info -------------------------- */ + +#ifndef GLX_EXT_visual_info +#define GLX_EXT_visual_info 1 + +#define GLX_X_VISUAL_TYPE_EXT 0x22 +#define GLX_TRANSPARENT_TYPE_EXT 0x23 +#define GLX_TRANSPARENT_INDEX_VALUE_EXT 0x24 +#define GLX_TRANSPARENT_RED_VALUE_EXT 0x25 +#define GLX_TRANSPARENT_GREEN_VALUE_EXT 0x26 +#define GLX_TRANSPARENT_BLUE_VALUE_EXT 0x27 +#define GLX_TRANSPARENT_ALPHA_VALUE_EXT 0x28 +#define GLX_NONE_EXT 0x8000 +#define GLX_TRUE_COLOR_EXT 0x8002 +#define GLX_DIRECT_COLOR_EXT 0x8003 +#define GLX_PSEUDO_COLOR_EXT 0x8004 +#define GLX_STATIC_COLOR_EXT 0x8005 +#define GLX_GRAY_SCALE_EXT 0x8006 +#define GLX_STATIC_GRAY_EXT 0x8007 +#define GLX_TRANSPARENT_RGB_EXT 0x8008 +#define GLX_TRANSPARENT_INDEX_EXT 0x8009 + +#define GLXEW_EXT_visual_info GLXEW_GET_VAR(__GLXEW_EXT_visual_info) + +#endif /* GLX_EXT_visual_info */ + +/* ------------------------- GLX_EXT_visual_rating ------------------------- */ + +#ifndef GLX_EXT_visual_rating +#define GLX_EXT_visual_rating 1 + +#define GLX_VISUAL_CAVEAT_EXT 0x20 +#define GLX_SLOW_VISUAL_EXT 0x8001 +#define GLX_NON_CONFORMANT_VISUAL_EXT 0x800D + +#define GLXEW_EXT_visual_rating GLXEW_GET_VAR(__GLXEW_EXT_visual_rating) + +#endif /* GLX_EXT_visual_rating */ + +/* -------------------------- GLX_INTEL_swap_event ------------------------- */ + +#ifndef GLX_INTEL_swap_event +#define GLX_INTEL_swap_event 1 + +#define GLX_EXCHANGE_COMPLETE_INTEL 0x8180 +#define GLX_COPY_COMPLETE_INTEL 0x8181 +#define GLX_FLIP_COMPLETE_INTEL 0x8182 +#define GLX_BUFFER_SWAP_COMPLETE_INTEL_MASK 0x04000000 + +#define GLXEW_INTEL_swap_event GLXEW_GET_VAR(__GLXEW_INTEL_swap_event) + +#endif /* GLX_INTEL_swap_event */ + +/* -------------------------- GLX_MESA_agp_offset -------------------------- */ + +#ifndef GLX_MESA_agp_offset +#define GLX_MESA_agp_offset 1 + +typedef unsigned int ( * PFNGLXGETAGPOFFSETMESAPROC) (const void* pointer); + +#define glXGetAGPOffsetMESA GLXEW_GET_FUN(__glewXGetAGPOffsetMESA) + +#define GLXEW_MESA_agp_offset GLXEW_GET_VAR(__GLXEW_MESA_agp_offset) + +#endif /* GLX_MESA_agp_offset */ + +/* ------------------------ GLX_MESA_copy_sub_buffer ----------------------- */ + +#ifndef GLX_MESA_copy_sub_buffer +#define GLX_MESA_copy_sub_buffer 1 + +typedef void ( * PFNGLXCOPYSUBBUFFERMESAPROC) (Display* dpy, GLXDrawable drawable, int x, int y, int width, int height); + +#define glXCopySubBufferMESA GLXEW_GET_FUN(__glewXCopySubBufferMESA) + +#define GLXEW_MESA_copy_sub_buffer GLXEW_GET_VAR(__GLXEW_MESA_copy_sub_buffer) + +#endif /* GLX_MESA_copy_sub_buffer */ + +/* ------------------------ GLX_MESA_pixmap_colormap ----------------------- */ + +#ifndef GLX_MESA_pixmap_colormap +#define GLX_MESA_pixmap_colormap 1 + +typedef GLXPixmap ( * PFNGLXCREATEGLXPIXMAPMESAPROC) (Display* dpy, XVisualInfo *visual, Pixmap pixmap, Colormap cmap); + +#define glXCreateGLXPixmapMESA GLXEW_GET_FUN(__glewXCreateGLXPixmapMESA) + +#define GLXEW_MESA_pixmap_colormap GLXEW_GET_VAR(__GLXEW_MESA_pixmap_colormap) + +#endif /* GLX_MESA_pixmap_colormap */ + +/* ------------------------ GLX_MESA_release_buffers ----------------------- */ + +#ifndef GLX_MESA_release_buffers +#define GLX_MESA_release_buffers 1 + +typedef Bool ( * PFNGLXRELEASEBUFFERSMESAPROC) (Display* dpy, GLXDrawable d); + +#define glXReleaseBuffersMESA GLXEW_GET_FUN(__glewXReleaseBuffersMESA) + +#define GLXEW_MESA_release_buffers GLXEW_GET_VAR(__GLXEW_MESA_release_buffers) + +#endif /* GLX_MESA_release_buffers */ + +/* ------------------------- GLX_MESA_set_3dfx_mode ------------------------ */ + +#ifndef GLX_MESA_set_3dfx_mode +#define GLX_MESA_set_3dfx_mode 1 + +#define GLX_3DFX_WINDOW_MODE_MESA 0x1 +#define GLX_3DFX_FULLSCREEN_MODE_MESA 0x2 + +typedef GLboolean ( * PFNGLXSET3DFXMODEMESAPROC) (GLint mode); + +#define glXSet3DfxModeMESA GLXEW_GET_FUN(__glewXSet3DfxModeMESA) + +#define GLXEW_MESA_set_3dfx_mode GLXEW_GET_VAR(__GLXEW_MESA_set_3dfx_mode) + +#endif /* GLX_MESA_set_3dfx_mode */ + +/* ------------------------- GLX_MESA_swap_control ------------------------- */ + +#ifndef GLX_MESA_swap_control +#define GLX_MESA_swap_control 1 + +typedef int ( * PFNGLXGETSWAPINTERVALMESAPROC) (void); +typedef int ( * PFNGLXSWAPINTERVALMESAPROC) (unsigned int interval); + +#define glXGetSwapIntervalMESA GLXEW_GET_FUN(__glewXGetSwapIntervalMESA) +#define glXSwapIntervalMESA GLXEW_GET_FUN(__glewXSwapIntervalMESA) + +#define GLXEW_MESA_swap_control GLXEW_GET_VAR(__GLXEW_MESA_swap_control) + +#endif /* GLX_MESA_swap_control */ + +/* --------------------------- GLX_NV_copy_image --------------------------- */ + +#ifndef GLX_NV_copy_image +#define GLX_NV_copy_image 1 + +typedef void ( * PFNGLXCOPYIMAGESUBDATANVPROC) (Display *dpy, GLXContext srcCtx, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLXContext dstCtx, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth); + +#define glXCopyImageSubDataNV GLXEW_GET_FUN(__glewXCopyImageSubDataNV) + +#define GLXEW_NV_copy_image GLXEW_GET_VAR(__GLXEW_NV_copy_image) + +#endif /* GLX_NV_copy_image */ + +/* -------------------------- GLX_NV_float_buffer -------------------------- */ + +#ifndef GLX_NV_float_buffer +#define GLX_NV_float_buffer 1 + +#define GLX_FLOAT_COMPONENTS_NV 0x20B0 + +#define GLXEW_NV_float_buffer GLXEW_GET_VAR(__GLXEW_NV_float_buffer) + +#endif /* GLX_NV_float_buffer */ + +/* ---------------------- GLX_NV_multisample_coverage ---------------------- */ + +#ifndef GLX_NV_multisample_coverage +#define GLX_NV_multisample_coverage 1 + +#define GLX_COLOR_SAMPLES_NV 0x20B3 +#define GLX_COVERAGE_SAMPLES_NV 100001 + +#define GLXEW_NV_multisample_coverage GLXEW_GET_VAR(__GLXEW_NV_multisample_coverage) + +#endif /* GLX_NV_multisample_coverage */ + +/* -------------------------- GLX_NV_present_video ------------------------- */ + +#ifndef GLX_NV_present_video +#define GLX_NV_present_video 1 + +#define GLX_NUM_VIDEO_SLOTS_NV 0x20F0 + +typedef int ( * PFNGLXBINDVIDEODEVICENVPROC) (Display* dpy, unsigned int video_slot, unsigned int video_device, const int *attrib_list); +typedef unsigned int* ( * PFNGLXENUMERATEVIDEODEVICESNVPROC) (Display *dpy, int screen, int *nelements); + +#define glXBindVideoDeviceNV GLXEW_GET_FUN(__glewXBindVideoDeviceNV) +#define glXEnumerateVideoDevicesNV GLXEW_GET_FUN(__glewXEnumerateVideoDevicesNV) + +#define GLXEW_NV_present_video GLXEW_GET_VAR(__GLXEW_NV_present_video) + +#endif /* GLX_NV_present_video */ + +/* --------------------------- GLX_NV_swap_group --------------------------- */ + +#ifndef GLX_NV_swap_group +#define GLX_NV_swap_group 1 + +typedef Bool ( * PFNGLXBINDSWAPBARRIERNVPROC) (Display* dpy, GLuint group, GLuint barrier); +typedef Bool ( * PFNGLXJOINSWAPGROUPNVPROC) (Display* dpy, GLXDrawable drawable, GLuint group); +typedef Bool ( * PFNGLXQUERYFRAMECOUNTNVPROC) (Display* dpy, int screen, GLuint *count); +typedef Bool ( * PFNGLXQUERYMAXSWAPGROUPSNVPROC) (Display* dpy, int screen, GLuint *maxGroups, GLuint *maxBarriers); +typedef Bool ( * PFNGLXQUERYSWAPGROUPNVPROC) (Display* dpy, GLXDrawable drawable, GLuint *group, GLuint *barrier); +typedef Bool ( * PFNGLXRESETFRAMECOUNTNVPROC) (Display* dpy, int screen); + +#define glXBindSwapBarrierNV GLXEW_GET_FUN(__glewXBindSwapBarrierNV) +#define glXJoinSwapGroupNV GLXEW_GET_FUN(__glewXJoinSwapGroupNV) +#define glXQueryFrameCountNV GLXEW_GET_FUN(__glewXQueryFrameCountNV) +#define glXQueryMaxSwapGroupsNV GLXEW_GET_FUN(__glewXQueryMaxSwapGroupsNV) +#define glXQuerySwapGroupNV GLXEW_GET_FUN(__glewXQuerySwapGroupNV) +#define glXResetFrameCountNV GLXEW_GET_FUN(__glewXResetFrameCountNV) + +#define GLXEW_NV_swap_group GLXEW_GET_VAR(__GLXEW_NV_swap_group) + +#endif /* GLX_NV_swap_group */ + +/* ----------------------- GLX_NV_vertex_array_range ----------------------- */ + +#ifndef GLX_NV_vertex_array_range +#define GLX_NV_vertex_array_range 1 + +typedef void * ( * PFNGLXALLOCATEMEMORYNVPROC) (GLsizei size, GLfloat readFrequency, GLfloat writeFrequency, GLfloat priority); +typedef void ( * PFNGLXFREEMEMORYNVPROC) (void *pointer); + +#define glXAllocateMemoryNV GLXEW_GET_FUN(__glewXAllocateMemoryNV) +#define glXFreeMemoryNV GLXEW_GET_FUN(__glewXFreeMemoryNV) + +#define GLXEW_NV_vertex_array_range GLXEW_GET_VAR(__GLXEW_NV_vertex_array_range) + +#endif /* GLX_NV_vertex_array_range */ + +/* -------------------------- GLX_NV_video_capture ------------------------- */ + +#ifndef GLX_NV_video_capture +#define GLX_NV_video_capture 1 + +#define GLX_DEVICE_ID_NV 0x20CD +#define GLX_UNIQUE_ID_NV 0x20CE +#define GLX_NUM_VIDEO_CAPTURE_SLOTS_NV 0x20CF + +typedef XID GLXVideoCaptureDeviceNV; + +typedef int ( * PFNGLXBINDVIDEOCAPTUREDEVICENVPROC) (Display* dpy, unsigned int video_capture_slot, GLXVideoCaptureDeviceNV device); +typedef GLXVideoCaptureDeviceNV * ( * PFNGLXENUMERATEVIDEOCAPTUREDEVICESNVPROC) (Display* dpy, int screen, int *nelements); +typedef void ( * PFNGLXLOCKVIDEOCAPTUREDEVICENVPROC) (Display* dpy, GLXVideoCaptureDeviceNV device); +typedef int ( * PFNGLXQUERYVIDEOCAPTUREDEVICENVPROC) (Display* dpy, GLXVideoCaptureDeviceNV device, int attribute, int *value); +typedef void ( * PFNGLXRELEASEVIDEOCAPTUREDEVICENVPROC) (Display* dpy, GLXVideoCaptureDeviceNV device); + +#define glXBindVideoCaptureDeviceNV GLXEW_GET_FUN(__glewXBindVideoCaptureDeviceNV) +#define glXEnumerateVideoCaptureDevicesNV GLXEW_GET_FUN(__glewXEnumerateVideoCaptureDevicesNV) +#define glXLockVideoCaptureDeviceNV GLXEW_GET_FUN(__glewXLockVideoCaptureDeviceNV) +#define glXQueryVideoCaptureDeviceNV GLXEW_GET_FUN(__glewXQueryVideoCaptureDeviceNV) +#define glXReleaseVideoCaptureDeviceNV GLXEW_GET_FUN(__glewXReleaseVideoCaptureDeviceNV) + +#define GLXEW_NV_video_capture GLXEW_GET_VAR(__GLXEW_NV_video_capture) + +#endif /* GLX_NV_video_capture */ + +/* -------------------------- GLX_NV_video_output -------------------------- */ + +#ifndef GLX_NV_video_output +#define GLX_NV_video_output 1 + +#define GLX_VIDEO_OUT_COLOR_NV 0x20C3 +#define GLX_VIDEO_OUT_ALPHA_NV 0x20C4 +#define GLX_VIDEO_OUT_DEPTH_NV 0x20C5 +#define GLX_VIDEO_OUT_COLOR_AND_ALPHA_NV 0x20C6 +#define GLX_VIDEO_OUT_COLOR_AND_DEPTH_NV 0x20C7 +#define GLX_VIDEO_OUT_FRAME_NV 0x20C8 +#define GLX_VIDEO_OUT_FIELD_1_NV 0x20C9 +#define GLX_VIDEO_OUT_FIELD_2_NV 0x20CA +#define GLX_VIDEO_OUT_STACKED_FIELDS_1_2_NV 0x20CB +#define GLX_VIDEO_OUT_STACKED_FIELDS_2_1_NV 0x20CC + +typedef int ( * PFNGLXBINDVIDEOIMAGENVPROC) (Display* dpy, GLXVideoDeviceNV VideoDevice, GLXPbuffer pbuf, int iVideoBuffer); +typedef int ( * PFNGLXGETVIDEODEVICENVPROC) (Display* dpy, int screen, int numVideoDevices, GLXVideoDeviceNV *pVideoDevice); +typedef int ( * PFNGLXGETVIDEOINFONVPROC) (Display* dpy, int screen, GLXVideoDeviceNV VideoDevice, unsigned long *pulCounterOutputPbuffer, unsigned long *pulCounterOutputVideo); +typedef int ( * PFNGLXRELEASEVIDEODEVICENVPROC) (Display* dpy, int screen, GLXVideoDeviceNV VideoDevice); +typedef int ( * PFNGLXRELEASEVIDEOIMAGENVPROC) (Display* dpy, GLXPbuffer pbuf); +typedef int ( * PFNGLXSENDPBUFFERTOVIDEONVPROC) (Display* dpy, GLXPbuffer pbuf, int iBufferType, unsigned long *pulCounterPbuffer, GLboolean bBlock); + +#define glXBindVideoImageNV GLXEW_GET_FUN(__glewXBindVideoImageNV) +#define glXGetVideoDeviceNV GLXEW_GET_FUN(__glewXGetVideoDeviceNV) +#define glXGetVideoInfoNV GLXEW_GET_FUN(__glewXGetVideoInfoNV) +#define glXReleaseVideoDeviceNV GLXEW_GET_FUN(__glewXReleaseVideoDeviceNV) +#define glXReleaseVideoImageNV GLXEW_GET_FUN(__glewXReleaseVideoImageNV) +#define glXSendPbufferToVideoNV GLXEW_GET_FUN(__glewXSendPbufferToVideoNV) + +#define GLXEW_NV_video_output GLXEW_GET_VAR(__GLXEW_NV_video_output) + +#endif /* GLX_NV_video_output */ + +/* -------------------------- GLX_OML_swap_method -------------------------- */ + +#ifndef GLX_OML_swap_method +#define GLX_OML_swap_method 1 + +#define GLX_SWAP_METHOD_OML 0x8060 +#define GLX_SWAP_EXCHANGE_OML 0x8061 +#define GLX_SWAP_COPY_OML 0x8062 +#define GLX_SWAP_UNDEFINED_OML 0x8063 + +#define GLXEW_OML_swap_method GLXEW_GET_VAR(__GLXEW_OML_swap_method) + +#endif /* GLX_OML_swap_method */ + +/* -------------------------- GLX_OML_sync_control ------------------------- */ + +#ifndef GLX_OML_sync_control +#define GLX_OML_sync_control 1 + +typedef Bool ( * PFNGLXGETMSCRATEOMLPROC) (Display* dpy, GLXDrawable drawable, int32_t* numerator, int32_t* denominator); +typedef Bool ( * PFNGLXGETSYNCVALUESOMLPROC) (Display* dpy, GLXDrawable drawable, int64_t* ust, int64_t* msc, int64_t* sbc); +typedef int64_t ( * PFNGLXSWAPBUFFERSMSCOMLPROC) (Display* dpy, GLXDrawable drawable, int64_t target_msc, int64_t divisor, int64_t remainder); +typedef Bool ( * PFNGLXWAITFORMSCOMLPROC) (Display* dpy, GLXDrawable drawable, int64_t target_msc, int64_t divisor, int64_t remainder, int64_t* ust, int64_t* msc, int64_t* sbc); +typedef Bool ( * PFNGLXWAITFORSBCOMLPROC) (Display* dpy, GLXDrawable drawable, int64_t target_sbc, int64_t* ust, int64_t* msc, int64_t* sbc); + +#define glXGetMscRateOML GLXEW_GET_FUN(__glewXGetMscRateOML) +#define glXGetSyncValuesOML GLXEW_GET_FUN(__glewXGetSyncValuesOML) +#define glXSwapBuffersMscOML GLXEW_GET_FUN(__glewXSwapBuffersMscOML) +#define glXWaitForMscOML GLXEW_GET_FUN(__glewXWaitForMscOML) +#define glXWaitForSbcOML GLXEW_GET_FUN(__glewXWaitForSbcOML) + +#define GLXEW_OML_sync_control GLXEW_GET_VAR(__GLXEW_OML_sync_control) + +#endif /* GLX_OML_sync_control */ + +/* ------------------------ GLX_SGIS_blended_overlay ----------------------- */ + +#ifndef GLX_SGIS_blended_overlay +#define GLX_SGIS_blended_overlay 1 + +#define GLX_BLENDED_RGBA_SGIS 0x8025 + +#define GLXEW_SGIS_blended_overlay GLXEW_GET_VAR(__GLXEW_SGIS_blended_overlay) + +#endif /* GLX_SGIS_blended_overlay */ + +/* -------------------------- GLX_SGIS_color_range ------------------------- */ + +#ifndef GLX_SGIS_color_range +#define GLX_SGIS_color_range 1 + +#define GLXEW_SGIS_color_range GLXEW_GET_VAR(__GLXEW_SGIS_color_range) + +#endif /* GLX_SGIS_color_range */ + +/* -------------------------- GLX_SGIS_multisample ------------------------- */ + +#ifndef GLX_SGIS_multisample +#define GLX_SGIS_multisample 1 + +#define GLX_SAMPLE_BUFFERS_SGIS 100000 +#define GLX_SAMPLES_SGIS 100001 + +#define GLXEW_SGIS_multisample GLXEW_GET_VAR(__GLXEW_SGIS_multisample) + +#endif /* GLX_SGIS_multisample */ + +/* ---------------------- GLX_SGIS_shared_multisample ---------------------- */ + +#ifndef GLX_SGIS_shared_multisample +#define GLX_SGIS_shared_multisample 1 + +#define GLX_MULTISAMPLE_SUB_RECT_WIDTH_SGIS 0x8026 +#define GLX_MULTISAMPLE_SUB_RECT_HEIGHT_SGIS 0x8027 + +#define GLXEW_SGIS_shared_multisample GLXEW_GET_VAR(__GLXEW_SGIS_shared_multisample) + +#endif /* GLX_SGIS_shared_multisample */ + +/* --------------------------- GLX_SGIX_fbconfig --------------------------- */ + +#ifndef GLX_SGIX_fbconfig +#define GLX_SGIX_fbconfig 1 + +#define GLX_WINDOW_BIT_SGIX 0x00000001 +#define GLX_RGBA_BIT_SGIX 0x00000001 +#define GLX_PIXMAP_BIT_SGIX 0x00000002 +#define GLX_COLOR_INDEX_BIT_SGIX 0x00000002 +#define GLX_SCREEN_EXT 0x800C +#define GLX_DRAWABLE_TYPE_SGIX 0x8010 +#define GLX_RENDER_TYPE_SGIX 0x8011 +#define GLX_X_RENDERABLE_SGIX 0x8012 +#define GLX_FBCONFIG_ID_SGIX 0x8013 +#define GLX_RGBA_TYPE_SGIX 0x8014 +#define GLX_COLOR_INDEX_TYPE_SGIX 0x8015 + +typedef XID GLXFBConfigIDSGIX; +typedef struct __GLXFBConfigRec *GLXFBConfigSGIX; + +typedef GLXFBConfigSGIX* ( * PFNGLXCHOOSEFBCONFIGSGIXPROC) (Display *dpy, int screen, const int *attrib_list, int *nelements); +typedef GLXContext ( * PFNGLXCREATECONTEXTWITHCONFIGSGIXPROC) (Display* dpy, GLXFBConfig config, int render_type, GLXContext share_list, Bool direct); +typedef GLXPixmap ( * PFNGLXCREATEGLXPIXMAPWITHCONFIGSGIXPROC) (Display* dpy, GLXFBConfig config, Pixmap pixmap); +typedef int ( * PFNGLXGETFBCONFIGATTRIBSGIXPROC) (Display* dpy, GLXFBConfigSGIX config, int attribute, int *value); +typedef GLXFBConfigSGIX ( * PFNGLXGETFBCONFIGFROMVISUALSGIXPROC) (Display* dpy, XVisualInfo *vis); +typedef XVisualInfo* ( * PFNGLXGETVISUALFROMFBCONFIGSGIXPROC) (Display *dpy, GLXFBConfig config); + +#define glXChooseFBConfigSGIX GLXEW_GET_FUN(__glewXChooseFBConfigSGIX) +#define glXCreateContextWithConfigSGIX GLXEW_GET_FUN(__glewXCreateContextWithConfigSGIX) +#define glXCreateGLXPixmapWithConfigSGIX GLXEW_GET_FUN(__glewXCreateGLXPixmapWithConfigSGIX) +#define glXGetFBConfigAttribSGIX GLXEW_GET_FUN(__glewXGetFBConfigAttribSGIX) +#define glXGetFBConfigFromVisualSGIX GLXEW_GET_FUN(__glewXGetFBConfigFromVisualSGIX) +#define glXGetVisualFromFBConfigSGIX GLXEW_GET_FUN(__glewXGetVisualFromFBConfigSGIX) + +#define GLXEW_SGIX_fbconfig GLXEW_GET_VAR(__GLXEW_SGIX_fbconfig) + +#endif /* GLX_SGIX_fbconfig */ + +/* --------------------------- GLX_SGIX_hyperpipe -------------------------- */ + +#ifndef GLX_SGIX_hyperpipe +#define GLX_SGIX_hyperpipe 1 + +#define GLX_HYPERPIPE_DISPLAY_PIPE_SGIX 0x00000001 +#define GLX_PIPE_RECT_SGIX 0x00000001 +#define GLX_PIPE_RECT_LIMITS_SGIX 0x00000002 +#define GLX_HYPERPIPE_RENDER_PIPE_SGIX 0x00000002 +#define GLX_HYPERPIPE_STEREO_SGIX 0x00000003 +#define GLX_HYPERPIPE_PIXEL_AVERAGE_SGIX 0x00000004 +#define GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX 80 +#define GLX_BAD_HYPERPIPE_CONFIG_SGIX 91 +#define GLX_BAD_HYPERPIPE_SGIX 92 +#define GLX_HYPERPIPE_ID_SGIX 0x8030 + +typedef struct { + char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX]; + int networkId; +} GLXHyperpipeNetworkSGIX; +typedef struct { + char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX]; + int XOrigin; + int YOrigin; + int maxHeight; + int maxWidth; +} GLXPipeRectLimits; +typedef struct { + char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX]; + int channel; + unsigned int participationType; + int timeSlice; +} GLXHyperpipeConfigSGIX; +typedef struct { + char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX]; + int srcXOrigin; + int srcYOrigin; + int srcWidth; + int srcHeight; + int destXOrigin; + int destYOrigin; + int destWidth; + int destHeight; +} GLXPipeRect; + +typedef int ( * PFNGLXBINDHYPERPIPESGIXPROC) (Display *dpy, int hpId); +typedef int ( * PFNGLXDESTROYHYPERPIPECONFIGSGIXPROC) (Display *dpy, int hpId); +typedef int ( * PFNGLXHYPERPIPEATTRIBSGIXPROC) (Display *dpy, int timeSlice, int attrib, int size, void *attribList); +typedef int ( * PFNGLXHYPERPIPECONFIGSGIXPROC) (Display *dpy, int networkId, int npipes, GLXHyperpipeConfigSGIX *cfg, int *hpId); +typedef int ( * PFNGLXQUERYHYPERPIPEATTRIBSGIXPROC) (Display *dpy, int timeSlice, int attrib, int size, void *returnAttribList); +typedef int ( * PFNGLXQUERYHYPERPIPEBESTATTRIBSGIXPROC) (Display *dpy, int timeSlice, int attrib, int size, void *attribList, void *returnAttribList); +typedef GLXHyperpipeConfigSGIX * ( * PFNGLXQUERYHYPERPIPECONFIGSGIXPROC) (Display *dpy, int hpId, int *npipes); +typedef GLXHyperpipeNetworkSGIX * ( * PFNGLXQUERYHYPERPIPENETWORKSGIXPROC) (Display *dpy, int *npipes); + +#define glXBindHyperpipeSGIX GLXEW_GET_FUN(__glewXBindHyperpipeSGIX) +#define glXDestroyHyperpipeConfigSGIX GLXEW_GET_FUN(__glewXDestroyHyperpipeConfigSGIX) +#define glXHyperpipeAttribSGIX GLXEW_GET_FUN(__glewXHyperpipeAttribSGIX) +#define glXHyperpipeConfigSGIX GLXEW_GET_FUN(__glewXHyperpipeConfigSGIX) +#define glXQueryHyperpipeAttribSGIX GLXEW_GET_FUN(__glewXQueryHyperpipeAttribSGIX) +#define glXQueryHyperpipeBestAttribSGIX GLXEW_GET_FUN(__glewXQueryHyperpipeBestAttribSGIX) +#define glXQueryHyperpipeConfigSGIX GLXEW_GET_FUN(__glewXQueryHyperpipeConfigSGIX) +#define glXQueryHyperpipeNetworkSGIX GLXEW_GET_FUN(__glewXQueryHyperpipeNetworkSGIX) + +#define GLXEW_SGIX_hyperpipe GLXEW_GET_VAR(__GLXEW_SGIX_hyperpipe) + +#endif /* GLX_SGIX_hyperpipe */ + +/* ---------------------------- GLX_SGIX_pbuffer --------------------------- */ + +#ifndef GLX_SGIX_pbuffer +#define GLX_SGIX_pbuffer 1 + +#define GLX_FRONT_LEFT_BUFFER_BIT_SGIX 0x00000001 +#define GLX_FRONT_RIGHT_BUFFER_BIT_SGIX 0x00000002 +#define GLX_PBUFFER_BIT_SGIX 0x00000004 +#define GLX_BACK_LEFT_BUFFER_BIT_SGIX 0x00000004 +#define GLX_BACK_RIGHT_BUFFER_BIT_SGIX 0x00000008 +#define GLX_AUX_BUFFERS_BIT_SGIX 0x00000010 +#define GLX_DEPTH_BUFFER_BIT_SGIX 0x00000020 +#define GLX_STENCIL_BUFFER_BIT_SGIX 0x00000040 +#define GLX_ACCUM_BUFFER_BIT_SGIX 0x00000080 +#define GLX_SAMPLE_BUFFERS_BIT_SGIX 0x00000100 +#define GLX_MAX_PBUFFER_WIDTH_SGIX 0x8016 +#define GLX_MAX_PBUFFER_HEIGHT_SGIX 0x8017 +#define GLX_MAX_PBUFFER_PIXELS_SGIX 0x8018 +#define GLX_OPTIMAL_PBUFFER_WIDTH_SGIX 0x8019 +#define GLX_OPTIMAL_PBUFFER_HEIGHT_SGIX 0x801A +#define GLX_PRESERVED_CONTENTS_SGIX 0x801B +#define GLX_LARGEST_PBUFFER_SGIX 0x801C +#define GLX_WIDTH_SGIX 0x801D +#define GLX_HEIGHT_SGIX 0x801E +#define GLX_EVENT_MASK_SGIX 0x801F +#define GLX_DAMAGED_SGIX 0x8020 +#define GLX_SAVED_SGIX 0x8021 +#define GLX_WINDOW_SGIX 0x8022 +#define GLX_PBUFFER_SGIX 0x8023 +#define GLX_BUFFER_CLOBBER_MASK_SGIX 0x08000000 + +typedef XID GLXPbufferSGIX; +typedef struct { int type; unsigned long serial; Bool send_event; Display *display; GLXDrawable drawable; int event_type; int draw_type; unsigned int mask; int x, y; int width, height; int count; } GLXBufferClobberEventSGIX; + +typedef GLXPbuffer ( * PFNGLXCREATEGLXPBUFFERSGIXPROC) (Display* dpy, GLXFBConfig config, unsigned int width, unsigned int height, int *attrib_list); +typedef void ( * PFNGLXDESTROYGLXPBUFFERSGIXPROC) (Display* dpy, GLXPbuffer pbuf); +typedef void ( * PFNGLXGETSELECTEDEVENTSGIXPROC) (Display* dpy, GLXDrawable drawable, unsigned long *mask); +typedef void ( * PFNGLXQUERYGLXPBUFFERSGIXPROC) (Display* dpy, GLXPbuffer pbuf, int attribute, unsigned int *value); +typedef void ( * PFNGLXSELECTEVENTSGIXPROC) (Display* dpy, GLXDrawable drawable, unsigned long mask); + +#define glXCreateGLXPbufferSGIX GLXEW_GET_FUN(__glewXCreateGLXPbufferSGIX) +#define glXDestroyGLXPbufferSGIX GLXEW_GET_FUN(__glewXDestroyGLXPbufferSGIX) +#define glXGetSelectedEventSGIX GLXEW_GET_FUN(__glewXGetSelectedEventSGIX) +#define glXQueryGLXPbufferSGIX GLXEW_GET_FUN(__glewXQueryGLXPbufferSGIX) +#define glXSelectEventSGIX GLXEW_GET_FUN(__glewXSelectEventSGIX) + +#define GLXEW_SGIX_pbuffer GLXEW_GET_VAR(__GLXEW_SGIX_pbuffer) + +#endif /* GLX_SGIX_pbuffer */ + +/* ------------------------- GLX_SGIX_swap_barrier ------------------------- */ + +#ifndef GLX_SGIX_swap_barrier +#define GLX_SGIX_swap_barrier 1 + +typedef void ( * PFNGLXBINDSWAPBARRIERSGIXPROC) (Display *dpy, GLXDrawable drawable, int barrier); +typedef Bool ( * PFNGLXQUERYMAXSWAPBARRIERSSGIXPROC) (Display *dpy, int screen, int *max); + +#define glXBindSwapBarrierSGIX GLXEW_GET_FUN(__glewXBindSwapBarrierSGIX) +#define glXQueryMaxSwapBarriersSGIX GLXEW_GET_FUN(__glewXQueryMaxSwapBarriersSGIX) + +#define GLXEW_SGIX_swap_barrier GLXEW_GET_VAR(__GLXEW_SGIX_swap_barrier) + +#endif /* GLX_SGIX_swap_barrier */ + +/* -------------------------- GLX_SGIX_swap_group -------------------------- */ + +#ifndef GLX_SGIX_swap_group +#define GLX_SGIX_swap_group 1 + +typedef void ( * PFNGLXJOINSWAPGROUPSGIXPROC) (Display *dpy, GLXDrawable drawable, GLXDrawable member); + +#define glXJoinSwapGroupSGIX GLXEW_GET_FUN(__glewXJoinSwapGroupSGIX) + +#define GLXEW_SGIX_swap_group GLXEW_GET_VAR(__GLXEW_SGIX_swap_group) + +#endif /* GLX_SGIX_swap_group */ + +/* ------------------------- GLX_SGIX_video_resize ------------------------- */ + +#ifndef GLX_SGIX_video_resize +#define GLX_SGIX_video_resize 1 + +#define GLX_SYNC_FRAME_SGIX 0x00000000 +#define GLX_SYNC_SWAP_SGIX 0x00000001 + +typedef int ( * PFNGLXBINDCHANNELTOWINDOWSGIXPROC) (Display* display, int screen, int channel, Window window); +typedef int ( * PFNGLXCHANNELRECTSGIXPROC) (Display* display, int screen, int channel, int x, int y, int w, int h); +typedef int ( * PFNGLXCHANNELRECTSYNCSGIXPROC) (Display* display, int screen, int channel, GLenum synctype); +typedef int ( * PFNGLXQUERYCHANNELDELTASSGIXPROC) (Display* display, int screen, int channel, int *x, int *y, int *w, int *h); +typedef int ( * PFNGLXQUERYCHANNELRECTSGIXPROC) (Display* display, int screen, int channel, int *dx, int *dy, int *dw, int *dh); + +#define glXBindChannelToWindowSGIX GLXEW_GET_FUN(__glewXBindChannelToWindowSGIX) +#define glXChannelRectSGIX GLXEW_GET_FUN(__glewXChannelRectSGIX) +#define glXChannelRectSyncSGIX GLXEW_GET_FUN(__glewXChannelRectSyncSGIX) +#define glXQueryChannelDeltasSGIX GLXEW_GET_FUN(__glewXQueryChannelDeltasSGIX) +#define glXQueryChannelRectSGIX GLXEW_GET_FUN(__glewXQueryChannelRectSGIX) + +#define GLXEW_SGIX_video_resize GLXEW_GET_VAR(__GLXEW_SGIX_video_resize) + +#endif /* GLX_SGIX_video_resize */ + +/* ---------------------- GLX_SGIX_visual_select_group --------------------- */ + +#ifndef GLX_SGIX_visual_select_group +#define GLX_SGIX_visual_select_group 1 + +#define GLX_VISUAL_SELECT_GROUP_SGIX 0x8028 + +#define GLXEW_SGIX_visual_select_group GLXEW_GET_VAR(__GLXEW_SGIX_visual_select_group) + +#endif /* GLX_SGIX_visual_select_group */ + +/* ---------------------------- GLX_SGI_cushion ---------------------------- */ + +#ifndef GLX_SGI_cushion +#define GLX_SGI_cushion 1 + +typedef void ( * PFNGLXCUSHIONSGIPROC) (Display* dpy, Window window, float cushion); + +#define glXCushionSGI GLXEW_GET_FUN(__glewXCushionSGI) + +#define GLXEW_SGI_cushion GLXEW_GET_VAR(__GLXEW_SGI_cushion) + +#endif /* GLX_SGI_cushion */ + +/* ----------------------- GLX_SGI_make_current_read ----------------------- */ + +#ifndef GLX_SGI_make_current_read +#define GLX_SGI_make_current_read 1 + +typedef GLXDrawable ( * PFNGLXGETCURRENTREADDRAWABLESGIPROC) (void); +typedef Bool ( * PFNGLXMAKECURRENTREADSGIPROC) (Display* dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx); + +#define glXGetCurrentReadDrawableSGI GLXEW_GET_FUN(__glewXGetCurrentReadDrawableSGI) +#define glXMakeCurrentReadSGI GLXEW_GET_FUN(__glewXMakeCurrentReadSGI) + +#define GLXEW_SGI_make_current_read GLXEW_GET_VAR(__GLXEW_SGI_make_current_read) + +#endif /* GLX_SGI_make_current_read */ + +/* -------------------------- GLX_SGI_swap_control ------------------------- */ + +#ifndef GLX_SGI_swap_control +#define GLX_SGI_swap_control 1 + +typedef int ( * PFNGLXSWAPINTERVALSGIPROC) (int interval); + +#define glXSwapIntervalSGI GLXEW_GET_FUN(__glewXSwapIntervalSGI) + +#define GLXEW_SGI_swap_control GLXEW_GET_VAR(__GLXEW_SGI_swap_control) + +#endif /* GLX_SGI_swap_control */ + +/* --------------------------- GLX_SGI_video_sync -------------------------- */ + +#ifndef GLX_SGI_video_sync +#define GLX_SGI_video_sync 1 + +typedef int ( * PFNGLXGETVIDEOSYNCSGIPROC) (unsigned int* count); +typedef int ( * PFNGLXWAITVIDEOSYNCSGIPROC) (int divisor, int remainder, unsigned int* count); + +#define glXGetVideoSyncSGI GLXEW_GET_FUN(__glewXGetVideoSyncSGI) +#define glXWaitVideoSyncSGI GLXEW_GET_FUN(__glewXWaitVideoSyncSGI) + +#define GLXEW_SGI_video_sync GLXEW_GET_VAR(__GLXEW_SGI_video_sync) + +#endif /* GLX_SGI_video_sync */ + +/* --------------------- GLX_SUN_get_transparent_index --------------------- */ + +#ifndef GLX_SUN_get_transparent_index +#define GLX_SUN_get_transparent_index 1 + +typedef Status ( * PFNGLXGETTRANSPARENTINDEXSUNPROC) (Display* dpy, Window overlay, Window underlay, unsigned long *pTransparentIndex); + +#define glXGetTransparentIndexSUN GLXEW_GET_FUN(__glewXGetTransparentIndexSUN) + +#define GLXEW_SUN_get_transparent_index GLXEW_GET_VAR(__GLXEW_SUN_get_transparent_index) + +#endif /* GLX_SUN_get_transparent_index */ + +/* -------------------------- GLX_SUN_video_resize ------------------------- */ + +#ifndef GLX_SUN_video_resize +#define GLX_SUN_video_resize 1 + +#define GLX_VIDEO_RESIZE_SUN 0x8171 +#define GL_VIDEO_RESIZE_COMPENSATION_SUN 0x85CD + +typedef int ( * PFNGLXGETVIDEORESIZESUNPROC) (Display* display, GLXDrawable window, float* factor); +typedef int ( * PFNGLXVIDEORESIZESUNPROC) (Display* display, GLXDrawable window, float factor); + +#define glXGetVideoResizeSUN GLXEW_GET_FUN(__glewXGetVideoResizeSUN) +#define glXVideoResizeSUN GLXEW_GET_FUN(__glewXVideoResizeSUN) + +#define GLXEW_SUN_video_resize GLXEW_GET_VAR(__GLXEW_SUN_video_resize) + +#endif /* GLX_SUN_video_resize */ + +/* ------------------------------------------------------------------------- */ + +#ifdef GLEW_MX +#define GLXEW_FUN_EXPORT GLEW_FUN_EXPORT +#define GLXEW_VAR_EXPORT +#else +#define GLXEW_FUN_EXPORT GLEW_FUN_EXPORT +#define GLXEW_VAR_EXPORT GLEW_VAR_EXPORT +#endif /* GLEW_MX */ + +GLXEW_FUN_EXPORT PFNGLXGETCURRENTDISPLAYPROC __glewXGetCurrentDisplay; + +GLXEW_FUN_EXPORT PFNGLXCHOOSEFBCONFIGPROC __glewXChooseFBConfig; +GLXEW_FUN_EXPORT PFNGLXCREATENEWCONTEXTPROC __glewXCreateNewContext; +GLXEW_FUN_EXPORT PFNGLXCREATEPBUFFERPROC __glewXCreatePbuffer; +GLXEW_FUN_EXPORT PFNGLXCREATEPIXMAPPROC __glewXCreatePixmap; +GLXEW_FUN_EXPORT PFNGLXCREATEWINDOWPROC __glewXCreateWindow; +GLXEW_FUN_EXPORT PFNGLXDESTROYPBUFFERPROC __glewXDestroyPbuffer; +GLXEW_FUN_EXPORT PFNGLXDESTROYPIXMAPPROC __glewXDestroyPixmap; +GLXEW_FUN_EXPORT PFNGLXDESTROYWINDOWPROC __glewXDestroyWindow; +GLXEW_FUN_EXPORT PFNGLXGETCURRENTREADDRAWABLEPROC __glewXGetCurrentReadDrawable; +GLXEW_FUN_EXPORT PFNGLXGETFBCONFIGATTRIBPROC __glewXGetFBConfigAttrib; +GLXEW_FUN_EXPORT PFNGLXGETFBCONFIGSPROC __glewXGetFBConfigs; +GLXEW_FUN_EXPORT PFNGLXGETSELECTEDEVENTPROC __glewXGetSelectedEvent; +GLXEW_FUN_EXPORT PFNGLXGETVISUALFROMFBCONFIGPROC __glewXGetVisualFromFBConfig; +GLXEW_FUN_EXPORT PFNGLXMAKECONTEXTCURRENTPROC __glewXMakeContextCurrent; +GLXEW_FUN_EXPORT PFNGLXQUERYCONTEXTPROC __glewXQueryContext; +GLXEW_FUN_EXPORT PFNGLXQUERYDRAWABLEPROC __glewXQueryDrawable; +GLXEW_FUN_EXPORT PFNGLXSELECTEVENTPROC __glewXSelectEvent; + +GLXEW_FUN_EXPORT PFNGLXBLITCONTEXTFRAMEBUFFERAMDPROC __glewXBlitContextFramebufferAMD; +GLXEW_FUN_EXPORT PFNGLXCREATEASSOCIATEDCONTEXTAMDPROC __glewXCreateAssociatedContextAMD; +GLXEW_FUN_EXPORT PFNGLXCREATEASSOCIATEDCONTEXTATTRIBSAMDPROC __glewXCreateAssociatedContextAttribsAMD; +GLXEW_FUN_EXPORT PFNGLXDELETEASSOCIATEDCONTEXTAMDPROC __glewXDeleteAssociatedContextAMD; +GLXEW_FUN_EXPORT PFNGLXGETCONTEXTGPUIDAMDPROC __glewXGetContextGPUIDAMD; +GLXEW_FUN_EXPORT PFNGLXGETCURRENTASSOCIATEDCONTEXTAMDPROC __glewXGetCurrentAssociatedContextAMD; +GLXEW_FUN_EXPORT PFNGLXGETGPUIDSAMDPROC __glewXGetGPUIDsAMD; +GLXEW_FUN_EXPORT PFNGLXGETGPUINFOAMDPROC __glewXGetGPUInfoAMD; +GLXEW_FUN_EXPORT PFNGLXMAKEASSOCIATEDCONTEXTCURRENTAMDPROC __glewXMakeAssociatedContextCurrentAMD; + +GLXEW_FUN_EXPORT PFNGLXCREATECONTEXTATTRIBSARBPROC __glewXCreateContextAttribsARB; + +GLXEW_FUN_EXPORT PFNGLXBINDTEXIMAGEATIPROC __glewXBindTexImageATI; +GLXEW_FUN_EXPORT PFNGLXDRAWABLEATTRIBATIPROC __glewXDrawableAttribATI; +GLXEW_FUN_EXPORT PFNGLXRELEASETEXIMAGEATIPROC __glewXReleaseTexImageATI; + +GLXEW_FUN_EXPORT PFNGLXFREECONTEXTEXTPROC __glewXFreeContextEXT; +GLXEW_FUN_EXPORT PFNGLXGETCONTEXTIDEXTPROC __glewXGetContextIDEXT; +GLXEW_FUN_EXPORT PFNGLXIMPORTCONTEXTEXTPROC __glewXImportContextEXT; +GLXEW_FUN_EXPORT PFNGLXQUERYCONTEXTINFOEXTPROC __glewXQueryContextInfoEXT; + +GLXEW_FUN_EXPORT PFNGLXSWAPINTERVALEXTPROC __glewXSwapIntervalEXT; + +GLXEW_FUN_EXPORT PFNGLXBINDTEXIMAGEEXTPROC __glewXBindTexImageEXT; +GLXEW_FUN_EXPORT PFNGLXRELEASETEXIMAGEEXTPROC __glewXReleaseTexImageEXT; + +GLXEW_FUN_EXPORT PFNGLXGETAGPOFFSETMESAPROC __glewXGetAGPOffsetMESA; + +GLXEW_FUN_EXPORT PFNGLXCOPYSUBBUFFERMESAPROC __glewXCopySubBufferMESA; + +GLXEW_FUN_EXPORT PFNGLXCREATEGLXPIXMAPMESAPROC __glewXCreateGLXPixmapMESA; + +GLXEW_FUN_EXPORT PFNGLXRELEASEBUFFERSMESAPROC __glewXReleaseBuffersMESA; + +GLXEW_FUN_EXPORT PFNGLXSET3DFXMODEMESAPROC __glewXSet3DfxModeMESA; + +GLXEW_FUN_EXPORT PFNGLXGETSWAPINTERVALMESAPROC __glewXGetSwapIntervalMESA; +GLXEW_FUN_EXPORT PFNGLXSWAPINTERVALMESAPROC __glewXSwapIntervalMESA; + +GLXEW_FUN_EXPORT PFNGLXCOPYIMAGESUBDATANVPROC __glewXCopyImageSubDataNV; + +GLXEW_FUN_EXPORT PFNGLXBINDVIDEODEVICENVPROC __glewXBindVideoDeviceNV; +GLXEW_FUN_EXPORT PFNGLXENUMERATEVIDEODEVICESNVPROC __glewXEnumerateVideoDevicesNV; + +GLXEW_FUN_EXPORT PFNGLXBINDSWAPBARRIERNVPROC __glewXBindSwapBarrierNV; +GLXEW_FUN_EXPORT PFNGLXJOINSWAPGROUPNVPROC __glewXJoinSwapGroupNV; +GLXEW_FUN_EXPORT PFNGLXQUERYFRAMECOUNTNVPROC __glewXQueryFrameCountNV; +GLXEW_FUN_EXPORT PFNGLXQUERYMAXSWAPGROUPSNVPROC __glewXQueryMaxSwapGroupsNV; +GLXEW_FUN_EXPORT PFNGLXQUERYSWAPGROUPNVPROC __glewXQuerySwapGroupNV; +GLXEW_FUN_EXPORT PFNGLXRESETFRAMECOUNTNVPROC __glewXResetFrameCountNV; + +GLXEW_FUN_EXPORT PFNGLXALLOCATEMEMORYNVPROC __glewXAllocateMemoryNV; +GLXEW_FUN_EXPORT PFNGLXFREEMEMORYNVPROC __glewXFreeMemoryNV; + +GLXEW_FUN_EXPORT PFNGLXBINDVIDEOCAPTUREDEVICENVPROC __glewXBindVideoCaptureDeviceNV; +GLXEW_FUN_EXPORT PFNGLXENUMERATEVIDEOCAPTUREDEVICESNVPROC __glewXEnumerateVideoCaptureDevicesNV; +GLXEW_FUN_EXPORT PFNGLXLOCKVIDEOCAPTUREDEVICENVPROC __glewXLockVideoCaptureDeviceNV; +GLXEW_FUN_EXPORT PFNGLXQUERYVIDEOCAPTUREDEVICENVPROC __glewXQueryVideoCaptureDeviceNV; +GLXEW_FUN_EXPORT PFNGLXRELEASEVIDEOCAPTUREDEVICENVPROC __glewXReleaseVideoCaptureDeviceNV; + +GLXEW_FUN_EXPORT PFNGLXBINDVIDEOIMAGENVPROC __glewXBindVideoImageNV; +GLXEW_FUN_EXPORT PFNGLXGETVIDEODEVICENVPROC __glewXGetVideoDeviceNV; +GLXEW_FUN_EXPORT PFNGLXGETVIDEOINFONVPROC __glewXGetVideoInfoNV; +GLXEW_FUN_EXPORT PFNGLXRELEASEVIDEODEVICENVPROC __glewXReleaseVideoDeviceNV; +GLXEW_FUN_EXPORT PFNGLXRELEASEVIDEOIMAGENVPROC __glewXReleaseVideoImageNV; +GLXEW_FUN_EXPORT PFNGLXSENDPBUFFERTOVIDEONVPROC __glewXSendPbufferToVideoNV; + +GLXEW_FUN_EXPORT PFNGLXGETMSCRATEOMLPROC __glewXGetMscRateOML; +GLXEW_FUN_EXPORT PFNGLXGETSYNCVALUESOMLPROC __glewXGetSyncValuesOML; +GLXEW_FUN_EXPORT PFNGLXSWAPBUFFERSMSCOMLPROC __glewXSwapBuffersMscOML; +GLXEW_FUN_EXPORT PFNGLXWAITFORMSCOMLPROC __glewXWaitForMscOML; +GLXEW_FUN_EXPORT PFNGLXWAITFORSBCOMLPROC __glewXWaitForSbcOML; + +GLXEW_FUN_EXPORT PFNGLXCHOOSEFBCONFIGSGIXPROC __glewXChooseFBConfigSGIX; +GLXEW_FUN_EXPORT PFNGLXCREATECONTEXTWITHCONFIGSGIXPROC __glewXCreateContextWithConfigSGIX; +GLXEW_FUN_EXPORT PFNGLXCREATEGLXPIXMAPWITHCONFIGSGIXPROC __glewXCreateGLXPixmapWithConfigSGIX; +GLXEW_FUN_EXPORT PFNGLXGETFBCONFIGATTRIBSGIXPROC __glewXGetFBConfigAttribSGIX; +GLXEW_FUN_EXPORT PFNGLXGETFBCONFIGFROMVISUALSGIXPROC __glewXGetFBConfigFromVisualSGIX; +GLXEW_FUN_EXPORT PFNGLXGETVISUALFROMFBCONFIGSGIXPROC __glewXGetVisualFromFBConfigSGIX; + +GLXEW_FUN_EXPORT PFNGLXBINDHYPERPIPESGIXPROC __glewXBindHyperpipeSGIX; +GLXEW_FUN_EXPORT PFNGLXDESTROYHYPERPIPECONFIGSGIXPROC __glewXDestroyHyperpipeConfigSGIX; +GLXEW_FUN_EXPORT PFNGLXHYPERPIPEATTRIBSGIXPROC __glewXHyperpipeAttribSGIX; +GLXEW_FUN_EXPORT PFNGLXHYPERPIPECONFIGSGIXPROC __glewXHyperpipeConfigSGIX; +GLXEW_FUN_EXPORT PFNGLXQUERYHYPERPIPEATTRIBSGIXPROC __glewXQueryHyperpipeAttribSGIX; +GLXEW_FUN_EXPORT PFNGLXQUERYHYPERPIPEBESTATTRIBSGIXPROC __glewXQueryHyperpipeBestAttribSGIX; +GLXEW_FUN_EXPORT PFNGLXQUERYHYPERPIPECONFIGSGIXPROC __glewXQueryHyperpipeConfigSGIX; +GLXEW_FUN_EXPORT PFNGLXQUERYHYPERPIPENETWORKSGIXPROC __glewXQueryHyperpipeNetworkSGIX; + +GLXEW_FUN_EXPORT PFNGLXCREATEGLXPBUFFERSGIXPROC __glewXCreateGLXPbufferSGIX; +GLXEW_FUN_EXPORT PFNGLXDESTROYGLXPBUFFERSGIXPROC __glewXDestroyGLXPbufferSGIX; +GLXEW_FUN_EXPORT PFNGLXGETSELECTEDEVENTSGIXPROC __glewXGetSelectedEventSGIX; +GLXEW_FUN_EXPORT PFNGLXQUERYGLXPBUFFERSGIXPROC __glewXQueryGLXPbufferSGIX; +GLXEW_FUN_EXPORT PFNGLXSELECTEVENTSGIXPROC __glewXSelectEventSGIX; + +GLXEW_FUN_EXPORT PFNGLXBINDSWAPBARRIERSGIXPROC __glewXBindSwapBarrierSGIX; +GLXEW_FUN_EXPORT PFNGLXQUERYMAXSWAPBARRIERSSGIXPROC __glewXQueryMaxSwapBarriersSGIX; + +GLXEW_FUN_EXPORT PFNGLXJOINSWAPGROUPSGIXPROC __glewXJoinSwapGroupSGIX; + +GLXEW_FUN_EXPORT PFNGLXBINDCHANNELTOWINDOWSGIXPROC __glewXBindChannelToWindowSGIX; +GLXEW_FUN_EXPORT PFNGLXCHANNELRECTSGIXPROC __glewXChannelRectSGIX; +GLXEW_FUN_EXPORT PFNGLXCHANNELRECTSYNCSGIXPROC __glewXChannelRectSyncSGIX; +GLXEW_FUN_EXPORT PFNGLXQUERYCHANNELDELTASSGIXPROC __glewXQueryChannelDeltasSGIX; +GLXEW_FUN_EXPORT PFNGLXQUERYCHANNELRECTSGIXPROC __glewXQueryChannelRectSGIX; + +GLXEW_FUN_EXPORT PFNGLXCUSHIONSGIPROC __glewXCushionSGI; + +GLXEW_FUN_EXPORT PFNGLXGETCURRENTREADDRAWABLESGIPROC __glewXGetCurrentReadDrawableSGI; +GLXEW_FUN_EXPORT PFNGLXMAKECURRENTREADSGIPROC __glewXMakeCurrentReadSGI; + +GLXEW_FUN_EXPORT PFNGLXSWAPINTERVALSGIPROC __glewXSwapIntervalSGI; + +GLXEW_FUN_EXPORT PFNGLXGETVIDEOSYNCSGIPROC __glewXGetVideoSyncSGI; +GLXEW_FUN_EXPORT PFNGLXWAITVIDEOSYNCSGIPROC __glewXWaitVideoSyncSGI; + +GLXEW_FUN_EXPORT PFNGLXGETTRANSPARENTINDEXSUNPROC __glewXGetTransparentIndexSUN; + +GLXEW_FUN_EXPORT PFNGLXGETVIDEORESIZESUNPROC __glewXGetVideoResizeSUN; +GLXEW_FUN_EXPORT PFNGLXVIDEORESIZESUNPROC __glewXVideoResizeSUN; + +#if defined(GLEW_MX) +struct GLXEWContextStruct +{ +#endif /* GLEW_MX */ + +GLXEW_VAR_EXPORT GLboolean __GLXEW_VERSION_1_0; +GLXEW_VAR_EXPORT GLboolean __GLXEW_VERSION_1_1; +GLXEW_VAR_EXPORT GLboolean __GLXEW_VERSION_1_2; +GLXEW_VAR_EXPORT GLboolean __GLXEW_VERSION_1_3; +GLXEW_VAR_EXPORT GLboolean __GLXEW_VERSION_1_4; +GLXEW_VAR_EXPORT GLboolean __GLXEW_3DFX_multisample; +GLXEW_VAR_EXPORT GLboolean __GLXEW_AMD_gpu_association; +GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_create_context; +GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_create_context_profile; +GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_create_context_robustness; +GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_fbconfig_float; +GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_framebuffer_sRGB; +GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_get_proc_address; +GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_multisample; +GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_robustness_application_isolation; +GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_robustness_share_group_isolation; +GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_vertex_buffer_object; +GLXEW_VAR_EXPORT GLboolean __GLXEW_ATI_pixel_format_float; +GLXEW_VAR_EXPORT GLboolean __GLXEW_ATI_render_texture; +GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_buffer_age; +GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_create_context_es2_profile; +GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_create_context_es_profile; +GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_fbconfig_packed_float; +GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_framebuffer_sRGB; +GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_import_context; +GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_scene_marker; +GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_swap_control; +GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_swap_control_tear; +GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_texture_from_pixmap; +GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_visual_info; +GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_visual_rating; +GLXEW_VAR_EXPORT GLboolean __GLXEW_INTEL_swap_event; +GLXEW_VAR_EXPORT GLboolean __GLXEW_MESA_agp_offset; +GLXEW_VAR_EXPORT GLboolean __GLXEW_MESA_copy_sub_buffer; +GLXEW_VAR_EXPORT GLboolean __GLXEW_MESA_pixmap_colormap; +GLXEW_VAR_EXPORT GLboolean __GLXEW_MESA_release_buffers; +GLXEW_VAR_EXPORT GLboolean __GLXEW_MESA_set_3dfx_mode; +GLXEW_VAR_EXPORT GLboolean __GLXEW_MESA_swap_control; +GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_copy_image; +GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_float_buffer; +GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_multisample_coverage; +GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_present_video; +GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_swap_group; +GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_vertex_array_range; +GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_video_capture; +GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_video_output; +GLXEW_VAR_EXPORT GLboolean __GLXEW_OML_swap_method; +GLXEW_VAR_EXPORT GLboolean __GLXEW_OML_sync_control; +GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIS_blended_overlay; +GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIS_color_range; +GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIS_multisample; +GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIS_shared_multisample; +GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIX_fbconfig; +GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIX_hyperpipe; +GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIX_pbuffer; +GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIX_swap_barrier; +GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIX_swap_group; +GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIX_video_resize; +GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIX_visual_select_group; +GLXEW_VAR_EXPORT GLboolean __GLXEW_SGI_cushion; +GLXEW_VAR_EXPORT GLboolean __GLXEW_SGI_make_current_read; +GLXEW_VAR_EXPORT GLboolean __GLXEW_SGI_swap_control; +GLXEW_VAR_EXPORT GLboolean __GLXEW_SGI_video_sync; +GLXEW_VAR_EXPORT GLboolean __GLXEW_SUN_get_transparent_index; +GLXEW_VAR_EXPORT GLboolean __GLXEW_SUN_video_resize; + +#ifdef GLEW_MX +}; /* GLXEWContextStruct */ +#endif /* GLEW_MX */ + +/* ------------------------------------------------------------------------ */ + +#ifdef GLEW_MX + +typedef struct GLXEWContextStruct GLXEWContext; +GLEWAPI GLenum GLEWAPIENTRY glxewContextInit (GLXEWContext *ctx); +GLEWAPI GLboolean GLEWAPIENTRY glxewContextIsSupported (const GLXEWContext *ctx, const char *name); + +#define glxewInit() glxewContextInit(glxewGetContext()) +#define glxewIsSupported(x) glxewContextIsSupported(glxewGetContext(), x) + +#define GLXEW_GET_VAR(x) (*(const GLboolean*)&(glxewGetContext()->x)) +#define GLXEW_GET_FUN(x) x + +#else /* GLEW_MX */ + +#define GLXEW_GET_VAR(x) (*(const GLboolean*)&x) +#define GLXEW_GET_FUN(x) x + +GLEWAPI GLboolean GLEWAPIENTRY glxewIsSupported (const char *name); + +#endif /* GLEW_MX */ + +GLEWAPI GLboolean GLEWAPIENTRY glxewGetExtension (const char *name); + +#ifdef __cplusplus +} +#endif + +#endif /* __glxew_h__ */ diff --git a/external/Chipmunk/msvc/glew/include/GL/wglew.h b/external/Chipmunk/msvc/glew/include/GL/wglew.h new file mode 100644 index 0000000..8659841 --- /dev/null +++ b/external/Chipmunk/msvc/glew/include/GL/wglew.h @@ -0,0 +1,1421 @@ +/* +** The OpenGL Extension Wrangler Library +** Copyright (C) 2002-2008, Milan Ikits +** Copyright (C) 2002-2008, Marcelo E. Magallon +** Copyright (C) 2002, Lev Povalahev +** All rights reserved. +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are met: +** +** * Redistributions of source code must retain the above copyright notice, +** this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright notice, +** this list of conditions and the following disclaimer in the documentation +** and/or other materials provided with the distribution. +** * The name of the author may be used to endorse or promote products +** derived from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +** ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +** LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +** INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +** CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +** ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF +** THE POSSIBILITY OF SUCH DAMAGE. +*/ + +/* +** Copyright (c) 2007 The Khronos Group Inc. +** +** Permission is hereby granted, free of charge, to any person obtaining a +** copy of this software and/or associated documentation files (the +** "Materials"), to deal in the Materials without restriction, including +** without limitation the rights to use, copy, modify, merge, publish, +** distribute, sublicense, and/or sell copies of the Materials, and to +** permit persons to whom the Materials are furnished to do so, subject to +** the following conditions: +** +** The above copyright notice and this permission notice shall be included +** in all copies or substantial portions of the Materials. +** +** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. +*/ + +#ifndef __wglew_h__ +#define __wglew_h__ +#define __WGLEW_H__ + +#ifdef __wglext_h_ +#error wglext.h included before wglew.h +#endif + +#define __wglext_h_ + +#if !defined(WINAPI) +# ifndef WIN32_LEAN_AND_MEAN +# define WIN32_LEAN_AND_MEAN 1 +# endif +#include +# undef WIN32_LEAN_AND_MEAN +#endif + +/* + * GLEW_STATIC needs to be set when using the static version. + * GLEW_BUILD is set when building the DLL version. + */ +#ifdef GLEW_STATIC +# define GLEWAPI extern +#else +# ifdef GLEW_BUILD +# define GLEWAPI extern __declspec(dllexport) +# else +# define GLEWAPI extern __declspec(dllimport) +# endif +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/* -------------------------- WGL_3DFX_multisample ------------------------- */ + +#ifndef WGL_3DFX_multisample +#define WGL_3DFX_multisample 1 + +#define WGL_SAMPLE_BUFFERS_3DFX 0x2060 +#define WGL_SAMPLES_3DFX 0x2061 + +#define WGLEW_3DFX_multisample WGLEW_GET_VAR(__WGLEW_3DFX_multisample) + +#endif /* WGL_3DFX_multisample */ + +/* ------------------------- WGL_3DL_stereo_control ------------------------ */ + +#ifndef WGL_3DL_stereo_control +#define WGL_3DL_stereo_control 1 + +#define WGL_STEREO_EMITTER_ENABLE_3DL 0x2055 +#define WGL_STEREO_EMITTER_DISABLE_3DL 0x2056 +#define WGL_STEREO_POLARITY_NORMAL_3DL 0x2057 +#define WGL_STEREO_POLARITY_INVERT_3DL 0x2058 + +typedef BOOL (WINAPI * PFNWGLSETSTEREOEMITTERSTATE3DLPROC) (HDC hDC, UINT uState); + +#define wglSetStereoEmitterState3DL WGLEW_GET_FUN(__wglewSetStereoEmitterState3DL) + +#define WGLEW_3DL_stereo_control WGLEW_GET_VAR(__WGLEW_3DL_stereo_control) + +#endif /* WGL_3DL_stereo_control */ + +/* ------------------------ WGL_AMD_gpu_association ------------------------ */ + +#ifndef WGL_AMD_gpu_association +#define WGL_AMD_gpu_association 1 + +#define WGL_GPU_VENDOR_AMD 0x1F00 +#define WGL_GPU_RENDERER_STRING_AMD 0x1F01 +#define WGL_GPU_OPENGL_VERSION_STRING_AMD 0x1F02 +#define WGL_GPU_FASTEST_TARGET_GPUS_AMD 0x21A2 +#define WGL_GPU_RAM_AMD 0x21A3 +#define WGL_GPU_CLOCK_AMD 0x21A4 +#define WGL_GPU_NUM_PIPES_AMD 0x21A5 +#define WGL_GPU_NUM_SIMD_AMD 0x21A6 +#define WGL_GPU_NUM_RB_AMD 0x21A7 +#define WGL_GPU_NUM_SPI_AMD 0x21A8 + +typedef VOID (WINAPI * PFNWGLBLITCONTEXTFRAMEBUFFERAMDPROC) (HGLRC dstCtx, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); +typedef HGLRC (WINAPI * PFNWGLCREATEASSOCIATEDCONTEXTAMDPROC) (UINT id); +typedef HGLRC (WINAPI * PFNWGLCREATEASSOCIATEDCONTEXTATTRIBSAMDPROC) (UINT id, HGLRC hShareContext, const int* attribList); +typedef BOOL (WINAPI * PFNWGLDELETEASSOCIATEDCONTEXTAMDPROC) (HGLRC hglrc); +typedef UINT (WINAPI * PFNWGLGETCONTEXTGPUIDAMDPROC) (HGLRC hglrc); +typedef HGLRC (WINAPI * PFNWGLGETCURRENTASSOCIATEDCONTEXTAMDPROC) (void); +typedef UINT (WINAPI * PFNWGLGETGPUIDSAMDPROC) (UINT maxCount, UINT* ids); +typedef INT (WINAPI * PFNWGLGETGPUINFOAMDPROC) (UINT id, INT property, GLenum dataType, UINT size, void* data); +typedef BOOL (WINAPI * PFNWGLMAKEASSOCIATEDCONTEXTCURRENTAMDPROC) (HGLRC hglrc); + +#define wglBlitContextFramebufferAMD WGLEW_GET_FUN(__wglewBlitContextFramebufferAMD) +#define wglCreateAssociatedContextAMD WGLEW_GET_FUN(__wglewCreateAssociatedContextAMD) +#define wglCreateAssociatedContextAttribsAMD WGLEW_GET_FUN(__wglewCreateAssociatedContextAttribsAMD) +#define wglDeleteAssociatedContextAMD WGLEW_GET_FUN(__wglewDeleteAssociatedContextAMD) +#define wglGetContextGPUIDAMD WGLEW_GET_FUN(__wglewGetContextGPUIDAMD) +#define wglGetCurrentAssociatedContextAMD WGLEW_GET_FUN(__wglewGetCurrentAssociatedContextAMD) +#define wglGetGPUIDsAMD WGLEW_GET_FUN(__wglewGetGPUIDsAMD) +#define wglGetGPUInfoAMD WGLEW_GET_FUN(__wglewGetGPUInfoAMD) +#define wglMakeAssociatedContextCurrentAMD WGLEW_GET_FUN(__wglewMakeAssociatedContextCurrentAMD) + +#define WGLEW_AMD_gpu_association WGLEW_GET_VAR(__WGLEW_AMD_gpu_association) + +#endif /* WGL_AMD_gpu_association */ + +/* ------------------------- WGL_ARB_buffer_region ------------------------- */ + +#ifndef WGL_ARB_buffer_region +#define WGL_ARB_buffer_region 1 + +#define WGL_FRONT_COLOR_BUFFER_BIT_ARB 0x00000001 +#define WGL_BACK_COLOR_BUFFER_BIT_ARB 0x00000002 +#define WGL_DEPTH_BUFFER_BIT_ARB 0x00000004 +#define WGL_STENCIL_BUFFER_BIT_ARB 0x00000008 + +typedef HANDLE (WINAPI * PFNWGLCREATEBUFFERREGIONARBPROC) (HDC hDC, int iLayerPlane, UINT uType); +typedef VOID (WINAPI * PFNWGLDELETEBUFFERREGIONARBPROC) (HANDLE hRegion); +typedef BOOL (WINAPI * PFNWGLRESTOREBUFFERREGIONARBPROC) (HANDLE hRegion, int x, int y, int width, int height, int xSrc, int ySrc); +typedef BOOL (WINAPI * PFNWGLSAVEBUFFERREGIONARBPROC) (HANDLE hRegion, int x, int y, int width, int height); + +#define wglCreateBufferRegionARB WGLEW_GET_FUN(__wglewCreateBufferRegionARB) +#define wglDeleteBufferRegionARB WGLEW_GET_FUN(__wglewDeleteBufferRegionARB) +#define wglRestoreBufferRegionARB WGLEW_GET_FUN(__wglewRestoreBufferRegionARB) +#define wglSaveBufferRegionARB WGLEW_GET_FUN(__wglewSaveBufferRegionARB) + +#define WGLEW_ARB_buffer_region WGLEW_GET_VAR(__WGLEW_ARB_buffer_region) + +#endif /* WGL_ARB_buffer_region */ + +/* ------------------------- WGL_ARB_create_context ------------------------ */ + +#ifndef WGL_ARB_create_context +#define WGL_ARB_create_context 1 + +#define WGL_CONTEXT_DEBUG_BIT_ARB 0x0001 +#define WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB 0x0002 +#define WGL_CONTEXT_MAJOR_VERSION_ARB 0x2091 +#define WGL_CONTEXT_MINOR_VERSION_ARB 0x2092 +#define WGL_CONTEXT_LAYER_PLANE_ARB 0x2093 +#define WGL_CONTEXT_FLAGS_ARB 0x2094 +#define ERROR_INVALID_VERSION_ARB 0x2095 +#define ERROR_INVALID_PROFILE_ARB 0x2096 + +typedef HGLRC (WINAPI * PFNWGLCREATECONTEXTATTRIBSARBPROC) (HDC hDC, HGLRC hShareContext, const int* attribList); + +#define wglCreateContextAttribsARB WGLEW_GET_FUN(__wglewCreateContextAttribsARB) + +#define WGLEW_ARB_create_context WGLEW_GET_VAR(__WGLEW_ARB_create_context) + +#endif /* WGL_ARB_create_context */ + +/* --------------------- WGL_ARB_create_context_profile -------------------- */ + +#ifndef WGL_ARB_create_context_profile +#define WGL_ARB_create_context_profile 1 + +#define WGL_CONTEXT_CORE_PROFILE_BIT_ARB 0x00000001 +#define WGL_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB 0x00000002 +#define WGL_CONTEXT_PROFILE_MASK_ARB 0x9126 + +#define WGLEW_ARB_create_context_profile WGLEW_GET_VAR(__WGLEW_ARB_create_context_profile) + +#endif /* WGL_ARB_create_context_profile */ + +/* ------------------- WGL_ARB_create_context_robustness ------------------- */ + +#ifndef WGL_ARB_create_context_robustness +#define WGL_ARB_create_context_robustness 1 + +#define WGL_CONTEXT_ROBUST_ACCESS_BIT_ARB 0x00000004 +#define WGL_LOSE_CONTEXT_ON_RESET_ARB 0x8252 +#define WGL_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB 0x8256 +#define WGL_NO_RESET_NOTIFICATION_ARB 0x8261 + +#define WGLEW_ARB_create_context_robustness WGLEW_GET_VAR(__WGLEW_ARB_create_context_robustness) + +#endif /* WGL_ARB_create_context_robustness */ + +/* ----------------------- WGL_ARB_extensions_string ----------------------- */ + +#ifndef WGL_ARB_extensions_string +#define WGL_ARB_extensions_string 1 + +typedef const char* (WINAPI * PFNWGLGETEXTENSIONSSTRINGARBPROC) (HDC hdc); + +#define wglGetExtensionsStringARB WGLEW_GET_FUN(__wglewGetExtensionsStringARB) + +#define WGLEW_ARB_extensions_string WGLEW_GET_VAR(__WGLEW_ARB_extensions_string) + +#endif /* WGL_ARB_extensions_string */ + +/* ------------------------ WGL_ARB_framebuffer_sRGB ----------------------- */ + +#ifndef WGL_ARB_framebuffer_sRGB +#define WGL_ARB_framebuffer_sRGB 1 + +#define WGL_FRAMEBUFFER_SRGB_CAPABLE_ARB 0x20A9 + +#define WGLEW_ARB_framebuffer_sRGB WGLEW_GET_VAR(__WGLEW_ARB_framebuffer_sRGB) + +#endif /* WGL_ARB_framebuffer_sRGB */ + +/* ----------------------- WGL_ARB_make_current_read ----------------------- */ + +#ifndef WGL_ARB_make_current_read +#define WGL_ARB_make_current_read 1 + +#define ERROR_INVALID_PIXEL_TYPE_ARB 0x2043 +#define ERROR_INCOMPATIBLE_DEVICE_CONTEXTS_ARB 0x2054 + +typedef HDC (WINAPI * PFNWGLGETCURRENTREADDCARBPROC) (VOID); +typedef BOOL (WINAPI * PFNWGLMAKECONTEXTCURRENTARBPROC) (HDC hDrawDC, HDC hReadDC, HGLRC hglrc); + +#define wglGetCurrentReadDCARB WGLEW_GET_FUN(__wglewGetCurrentReadDCARB) +#define wglMakeContextCurrentARB WGLEW_GET_FUN(__wglewMakeContextCurrentARB) + +#define WGLEW_ARB_make_current_read WGLEW_GET_VAR(__WGLEW_ARB_make_current_read) + +#endif /* WGL_ARB_make_current_read */ + +/* -------------------------- WGL_ARB_multisample -------------------------- */ + +#ifndef WGL_ARB_multisample +#define WGL_ARB_multisample 1 + +#define WGL_SAMPLE_BUFFERS_ARB 0x2041 +#define WGL_SAMPLES_ARB 0x2042 + +#define WGLEW_ARB_multisample WGLEW_GET_VAR(__WGLEW_ARB_multisample) + +#endif /* WGL_ARB_multisample */ + +/* ---------------------------- WGL_ARB_pbuffer ---------------------------- */ + +#ifndef WGL_ARB_pbuffer +#define WGL_ARB_pbuffer 1 + +#define WGL_DRAW_TO_PBUFFER_ARB 0x202D +#define WGL_MAX_PBUFFER_PIXELS_ARB 0x202E +#define WGL_MAX_PBUFFER_WIDTH_ARB 0x202F +#define WGL_MAX_PBUFFER_HEIGHT_ARB 0x2030 +#define WGL_PBUFFER_LARGEST_ARB 0x2033 +#define WGL_PBUFFER_WIDTH_ARB 0x2034 +#define WGL_PBUFFER_HEIGHT_ARB 0x2035 +#define WGL_PBUFFER_LOST_ARB 0x2036 + +DECLARE_HANDLE(HPBUFFERARB); + +typedef HPBUFFERARB (WINAPI * PFNWGLCREATEPBUFFERARBPROC) (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int* piAttribList); +typedef BOOL (WINAPI * PFNWGLDESTROYPBUFFERARBPROC) (HPBUFFERARB hPbuffer); +typedef HDC (WINAPI * PFNWGLGETPBUFFERDCARBPROC) (HPBUFFERARB hPbuffer); +typedef BOOL (WINAPI * PFNWGLQUERYPBUFFERARBPROC) (HPBUFFERARB hPbuffer, int iAttribute, int* piValue); +typedef int (WINAPI * PFNWGLRELEASEPBUFFERDCARBPROC) (HPBUFFERARB hPbuffer, HDC hDC); + +#define wglCreatePbufferARB WGLEW_GET_FUN(__wglewCreatePbufferARB) +#define wglDestroyPbufferARB WGLEW_GET_FUN(__wglewDestroyPbufferARB) +#define wglGetPbufferDCARB WGLEW_GET_FUN(__wglewGetPbufferDCARB) +#define wglQueryPbufferARB WGLEW_GET_FUN(__wglewQueryPbufferARB) +#define wglReleasePbufferDCARB WGLEW_GET_FUN(__wglewReleasePbufferDCARB) + +#define WGLEW_ARB_pbuffer WGLEW_GET_VAR(__WGLEW_ARB_pbuffer) + +#endif /* WGL_ARB_pbuffer */ + +/* -------------------------- WGL_ARB_pixel_format ------------------------- */ + +#ifndef WGL_ARB_pixel_format +#define WGL_ARB_pixel_format 1 + +#define WGL_NUMBER_PIXEL_FORMATS_ARB 0x2000 +#define WGL_DRAW_TO_WINDOW_ARB 0x2001 +#define WGL_DRAW_TO_BITMAP_ARB 0x2002 +#define WGL_ACCELERATION_ARB 0x2003 +#define WGL_NEED_PALETTE_ARB 0x2004 +#define WGL_NEED_SYSTEM_PALETTE_ARB 0x2005 +#define WGL_SWAP_LAYER_BUFFERS_ARB 0x2006 +#define WGL_SWAP_METHOD_ARB 0x2007 +#define WGL_NUMBER_OVERLAYS_ARB 0x2008 +#define WGL_NUMBER_UNDERLAYS_ARB 0x2009 +#define WGL_TRANSPARENT_ARB 0x200A +#define WGL_SHARE_DEPTH_ARB 0x200C +#define WGL_SHARE_STENCIL_ARB 0x200D +#define WGL_SHARE_ACCUM_ARB 0x200E +#define WGL_SUPPORT_GDI_ARB 0x200F +#define WGL_SUPPORT_OPENGL_ARB 0x2010 +#define WGL_DOUBLE_BUFFER_ARB 0x2011 +#define WGL_STEREO_ARB 0x2012 +#define WGL_PIXEL_TYPE_ARB 0x2013 +#define WGL_COLOR_BITS_ARB 0x2014 +#define WGL_RED_BITS_ARB 0x2015 +#define WGL_RED_SHIFT_ARB 0x2016 +#define WGL_GREEN_BITS_ARB 0x2017 +#define WGL_GREEN_SHIFT_ARB 0x2018 +#define WGL_BLUE_BITS_ARB 0x2019 +#define WGL_BLUE_SHIFT_ARB 0x201A +#define WGL_ALPHA_BITS_ARB 0x201B +#define WGL_ALPHA_SHIFT_ARB 0x201C +#define WGL_ACCUM_BITS_ARB 0x201D +#define WGL_ACCUM_RED_BITS_ARB 0x201E +#define WGL_ACCUM_GREEN_BITS_ARB 0x201F +#define WGL_ACCUM_BLUE_BITS_ARB 0x2020 +#define WGL_ACCUM_ALPHA_BITS_ARB 0x2021 +#define WGL_DEPTH_BITS_ARB 0x2022 +#define WGL_STENCIL_BITS_ARB 0x2023 +#define WGL_AUX_BUFFERS_ARB 0x2024 +#define WGL_NO_ACCELERATION_ARB 0x2025 +#define WGL_GENERIC_ACCELERATION_ARB 0x2026 +#define WGL_FULL_ACCELERATION_ARB 0x2027 +#define WGL_SWAP_EXCHANGE_ARB 0x2028 +#define WGL_SWAP_COPY_ARB 0x2029 +#define WGL_SWAP_UNDEFINED_ARB 0x202A +#define WGL_TYPE_RGBA_ARB 0x202B +#define WGL_TYPE_COLORINDEX_ARB 0x202C +#define WGL_TRANSPARENT_RED_VALUE_ARB 0x2037 +#define WGL_TRANSPARENT_GREEN_VALUE_ARB 0x2038 +#define WGL_TRANSPARENT_BLUE_VALUE_ARB 0x2039 +#define WGL_TRANSPARENT_ALPHA_VALUE_ARB 0x203A +#define WGL_TRANSPARENT_INDEX_VALUE_ARB 0x203B + +typedef BOOL (WINAPI * PFNWGLCHOOSEPIXELFORMATARBPROC) (HDC hdc, const int* piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats); +typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBFVARBPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int* piAttributes, FLOAT *pfValues); +typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBIVARBPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int* piAttributes, int *piValues); + +#define wglChoosePixelFormatARB WGLEW_GET_FUN(__wglewChoosePixelFormatARB) +#define wglGetPixelFormatAttribfvARB WGLEW_GET_FUN(__wglewGetPixelFormatAttribfvARB) +#define wglGetPixelFormatAttribivARB WGLEW_GET_FUN(__wglewGetPixelFormatAttribivARB) + +#define WGLEW_ARB_pixel_format WGLEW_GET_VAR(__WGLEW_ARB_pixel_format) + +#endif /* WGL_ARB_pixel_format */ + +/* ----------------------- WGL_ARB_pixel_format_float ---------------------- */ + +#ifndef WGL_ARB_pixel_format_float +#define WGL_ARB_pixel_format_float 1 + +#define WGL_TYPE_RGBA_FLOAT_ARB 0x21A0 + +#define WGLEW_ARB_pixel_format_float WGLEW_GET_VAR(__WGLEW_ARB_pixel_format_float) + +#endif /* WGL_ARB_pixel_format_float */ + +/* ------------------------- WGL_ARB_render_texture ------------------------ */ + +#ifndef WGL_ARB_render_texture +#define WGL_ARB_render_texture 1 + +#define WGL_BIND_TO_TEXTURE_RGB_ARB 0x2070 +#define WGL_BIND_TO_TEXTURE_RGBA_ARB 0x2071 +#define WGL_TEXTURE_FORMAT_ARB 0x2072 +#define WGL_TEXTURE_TARGET_ARB 0x2073 +#define WGL_MIPMAP_TEXTURE_ARB 0x2074 +#define WGL_TEXTURE_RGB_ARB 0x2075 +#define WGL_TEXTURE_RGBA_ARB 0x2076 +#define WGL_NO_TEXTURE_ARB 0x2077 +#define WGL_TEXTURE_CUBE_MAP_ARB 0x2078 +#define WGL_TEXTURE_1D_ARB 0x2079 +#define WGL_TEXTURE_2D_ARB 0x207A +#define WGL_MIPMAP_LEVEL_ARB 0x207B +#define WGL_CUBE_MAP_FACE_ARB 0x207C +#define WGL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB 0x207D +#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB 0x207E +#define WGL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB 0x207F +#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB 0x2080 +#define WGL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB 0x2081 +#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB 0x2082 +#define WGL_FRONT_LEFT_ARB 0x2083 +#define WGL_FRONT_RIGHT_ARB 0x2084 +#define WGL_BACK_LEFT_ARB 0x2085 +#define WGL_BACK_RIGHT_ARB 0x2086 +#define WGL_AUX0_ARB 0x2087 +#define WGL_AUX1_ARB 0x2088 +#define WGL_AUX2_ARB 0x2089 +#define WGL_AUX3_ARB 0x208A +#define WGL_AUX4_ARB 0x208B +#define WGL_AUX5_ARB 0x208C +#define WGL_AUX6_ARB 0x208D +#define WGL_AUX7_ARB 0x208E +#define WGL_AUX8_ARB 0x208F +#define WGL_AUX9_ARB 0x2090 + +typedef BOOL (WINAPI * PFNWGLBINDTEXIMAGEARBPROC) (HPBUFFERARB hPbuffer, int iBuffer); +typedef BOOL (WINAPI * PFNWGLRELEASETEXIMAGEARBPROC) (HPBUFFERARB hPbuffer, int iBuffer); +typedef BOOL (WINAPI * PFNWGLSETPBUFFERATTRIBARBPROC) (HPBUFFERARB hPbuffer, const int* piAttribList); + +#define wglBindTexImageARB WGLEW_GET_FUN(__wglewBindTexImageARB) +#define wglReleaseTexImageARB WGLEW_GET_FUN(__wglewReleaseTexImageARB) +#define wglSetPbufferAttribARB WGLEW_GET_FUN(__wglewSetPbufferAttribARB) + +#define WGLEW_ARB_render_texture WGLEW_GET_VAR(__WGLEW_ARB_render_texture) + +#endif /* WGL_ARB_render_texture */ + +/* ---------------- WGL_ARB_robustness_application_isolation --------------- */ + +#ifndef WGL_ARB_robustness_application_isolation +#define WGL_ARB_robustness_application_isolation 1 + +#define WGL_CONTEXT_RESET_ISOLATION_BIT_ARB 0x00000008 + +#define WGLEW_ARB_robustness_application_isolation WGLEW_GET_VAR(__WGLEW_ARB_robustness_application_isolation) + +#endif /* WGL_ARB_robustness_application_isolation */ + +/* ---------------- WGL_ARB_robustness_share_group_isolation --------------- */ + +#ifndef WGL_ARB_robustness_share_group_isolation +#define WGL_ARB_robustness_share_group_isolation 1 + +#define WGL_CONTEXT_RESET_ISOLATION_BIT_ARB 0x00000008 + +#define WGLEW_ARB_robustness_share_group_isolation WGLEW_GET_VAR(__WGLEW_ARB_robustness_share_group_isolation) + +#endif /* WGL_ARB_robustness_share_group_isolation */ + +/* ----------------------- WGL_ATI_pixel_format_float ---------------------- */ + +#ifndef WGL_ATI_pixel_format_float +#define WGL_ATI_pixel_format_float 1 + +#define WGL_TYPE_RGBA_FLOAT_ATI 0x21A0 +#define GL_RGBA_FLOAT_MODE_ATI 0x8820 +#define GL_COLOR_CLEAR_UNCLAMPED_VALUE_ATI 0x8835 + +#define WGLEW_ATI_pixel_format_float WGLEW_GET_VAR(__WGLEW_ATI_pixel_format_float) + +#endif /* WGL_ATI_pixel_format_float */ + +/* -------------------- WGL_ATI_render_texture_rectangle ------------------- */ + +#ifndef WGL_ATI_render_texture_rectangle +#define WGL_ATI_render_texture_rectangle 1 + +#define WGL_TEXTURE_RECTANGLE_ATI 0x21A5 + +#define WGLEW_ATI_render_texture_rectangle WGLEW_GET_VAR(__WGLEW_ATI_render_texture_rectangle) + +#endif /* WGL_ATI_render_texture_rectangle */ + +/* ------------------- WGL_EXT_create_context_es2_profile ------------------ */ + +#ifndef WGL_EXT_create_context_es2_profile +#define WGL_EXT_create_context_es2_profile 1 + +#define WGL_CONTEXT_ES2_PROFILE_BIT_EXT 0x00000004 + +#define WGLEW_EXT_create_context_es2_profile WGLEW_GET_VAR(__WGLEW_EXT_create_context_es2_profile) + +#endif /* WGL_EXT_create_context_es2_profile */ + +/* ------------------- WGL_EXT_create_context_es_profile ------------------- */ + +#ifndef WGL_EXT_create_context_es_profile +#define WGL_EXT_create_context_es_profile 1 + +#define WGL_CONTEXT_ES_PROFILE_BIT_EXT 0x00000004 + +#define WGLEW_EXT_create_context_es_profile WGLEW_GET_VAR(__WGLEW_EXT_create_context_es_profile) + +#endif /* WGL_EXT_create_context_es_profile */ + +/* -------------------------- WGL_EXT_depth_float -------------------------- */ + +#ifndef WGL_EXT_depth_float +#define WGL_EXT_depth_float 1 + +#define WGL_DEPTH_FLOAT_EXT 0x2040 + +#define WGLEW_EXT_depth_float WGLEW_GET_VAR(__WGLEW_EXT_depth_float) + +#endif /* WGL_EXT_depth_float */ + +/* ---------------------- WGL_EXT_display_color_table ---------------------- */ + +#ifndef WGL_EXT_display_color_table +#define WGL_EXT_display_color_table 1 + +typedef GLboolean (WINAPI * PFNWGLBINDDISPLAYCOLORTABLEEXTPROC) (GLushort id); +typedef GLboolean (WINAPI * PFNWGLCREATEDISPLAYCOLORTABLEEXTPROC) (GLushort id); +typedef void (WINAPI * PFNWGLDESTROYDISPLAYCOLORTABLEEXTPROC) (GLushort id); +typedef GLboolean (WINAPI * PFNWGLLOADDISPLAYCOLORTABLEEXTPROC) (GLushort* table, GLuint length); + +#define wglBindDisplayColorTableEXT WGLEW_GET_FUN(__wglewBindDisplayColorTableEXT) +#define wglCreateDisplayColorTableEXT WGLEW_GET_FUN(__wglewCreateDisplayColorTableEXT) +#define wglDestroyDisplayColorTableEXT WGLEW_GET_FUN(__wglewDestroyDisplayColorTableEXT) +#define wglLoadDisplayColorTableEXT WGLEW_GET_FUN(__wglewLoadDisplayColorTableEXT) + +#define WGLEW_EXT_display_color_table WGLEW_GET_VAR(__WGLEW_EXT_display_color_table) + +#endif /* WGL_EXT_display_color_table */ + +/* ----------------------- WGL_EXT_extensions_string ----------------------- */ + +#ifndef WGL_EXT_extensions_string +#define WGL_EXT_extensions_string 1 + +typedef const char* (WINAPI * PFNWGLGETEXTENSIONSSTRINGEXTPROC) (void); + +#define wglGetExtensionsStringEXT WGLEW_GET_FUN(__wglewGetExtensionsStringEXT) + +#define WGLEW_EXT_extensions_string WGLEW_GET_VAR(__WGLEW_EXT_extensions_string) + +#endif /* WGL_EXT_extensions_string */ + +/* ------------------------ WGL_EXT_framebuffer_sRGB ----------------------- */ + +#ifndef WGL_EXT_framebuffer_sRGB +#define WGL_EXT_framebuffer_sRGB 1 + +#define WGL_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x20A9 + +#define WGLEW_EXT_framebuffer_sRGB WGLEW_GET_VAR(__WGLEW_EXT_framebuffer_sRGB) + +#endif /* WGL_EXT_framebuffer_sRGB */ + +/* ----------------------- WGL_EXT_make_current_read ----------------------- */ + +#ifndef WGL_EXT_make_current_read +#define WGL_EXT_make_current_read 1 + +#define ERROR_INVALID_PIXEL_TYPE_EXT 0x2043 + +typedef HDC (WINAPI * PFNWGLGETCURRENTREADDCEXTPROC) (VOID); +typedef BOOL (WINAPI * PFNWGLMAKECONTEXTCURRENTEXTPROC) (HDC hDrawDC, HDC hReadDC, HGLRC hglrc); + +#define wglGetCurrentReadDCEXT WGLEW_GET_FUN(__wglewGetCurrentReadDCEXT) +#define wglMakeContextCurrentEXT WGLEW_GET_FUN(__wglewMakeContextCurrentEXT) + +#define WGLEW_EXT_make_current_read WGLEW_GET_VAR(__WGLEW_EXT_make_current_read) + +#endif /* WGL_EXT_make_current_read */ + +/* -------------------------- WGL_EXT_multisample -------------------------- */ + +#ifndef WGL_EXT_multisample +#define WGL_EXT_multisample 1 + +#define WGL_SAMPLE_BUFFERS_EXT 0x2041 +#define WGL_SAMPLES_EXT 0x2042 + +#define WGLEW_EXT_multisample WGLEW_GET_VAR(__WGLEW_EXT_multisample) + +#endif /* WGL_EXT_multisample */ + +/* ---------------------------- WGL_EXT_pbuffer ---------------------------- */ + +#ifndef WGL_EXT_pbuffer +#define WGL_EXT_pbuffer 1 + +#define WGL_DRAW_TO_PBUFFER_EXT 0x202D +#define WGL_MAX_PBUFFER_PIXELS_EXT 0x202E +#define WGL_MAX_PBUFFER_WIDTH_EXT 0x202F +#define WGL_MAX_PBUFFER_HEIGHT_EXT 0x2030 +#define WGL_OPTIMAL_PBUFFER_WIDTH_EXT 0x2031 +#define WGL_OPTIMAL_PBUFFER_HEIGHT_EXT 0x2032 +#define WGL_PBUFFER_LARGEST_EXT 0x2033 +#define WGL_PBUFFER_WIDTH_EXT 0x2034 +#define WGL_PBUFFER_HEIGHT_EXT 0x2035 + +DECLARE_HANDLE(HPBUFFEREXT); + +typedef HPBUFFEREXT (WINAPI * PFNWGLCREATEPBUFFEREXTPROC) (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int* piAttribList); +typedef BOOL (WINAPI * PFNWGLDESTROYPBUFFEREXTPROC) (HPBUFFEREXT hPbuffer); +typedef HDC (WINAPI * PFNWGLGETPBUFFERDCEXTPROC) (HPBUFFEREXT hPbuffer); +typedef BOOL (WINAPI * PFNWGLQUERYPBUFFEREXTPROC) (HPBUFFEREXT hPbuffer, int iAttribute, int* piValue); +typedef int (WINAPI * PFNWGLRELEASEPBUFFERDCEXTPROC) (HPBUFFEREXT hPbuffer, HDC hDC); + +#define wglCreatePbufferEXT WGLEW_GET_FUN(__wglewCreatePbufferEXT) +#define wglDestroyPbufferEXT WGLEW_GET_FUN(__wglewDestroyPbufferEXT) +#define wglGetPbufferDCEXT WGLEW_GET_FUN(__wglewGetPbufferDCEXT) +#define wglQueryPbufferEXT WGLEW_GET_FUN(__wglewQueryPbufferEXT) +#define wglReleasePbufferDCEXT WGLEW_GET_FUN(__wglewReleasePbufferDCEXT) + +#define WGLEW_EXT_pbuffer WGLEW_GET_VAR(__WGLEW_EXT_pbuffer) + +#endif /* WGL_EXT_pbuffer */ + +/* -------------------------- WGL_EXT_pixel_format ------------------------- */ + +#ifndef WGL_EXT_pixel_format +#define WGL_EXT_pixel_format 1 + +#define WGL_NUMBER_PIXEL_FORMATS_EXT 0x2000 +#define WGL_DRAW_TO_WINDOW_EXT 0x2001 +#define WGL_DRAW_TO_BITMAP_EXT 0x2002 +#define WGL_ACCELERATION_EXT 0x2003 +#define WGL_NEED_PALETTE_EXT 0x2004 +#define WGL_NEED_SYSTEM_PALETTE_EXT 0x2005 +#define WGL_SWAP_LAYER_BUFFERS_EXT 0x2006 +#define WGL_SWAP_METHOD_EXT 0x2007 +#define WGL_NUMBER_OVERLAYS_EXT 0x2008 +#define WGL_NUMBER_UNDERLAYS_EXT 0x2009 +#define WGL_TRANSPARENT_EXT 0x200A +#define WGL_TRANSPARENT_VALUE_EXT 0x200B +#define WGL_SHARE_DEPTH_EXT 0x200C +#define WGL_SHARE_STENCIL_EXT 0x200D +#define WGL_SHARE_ACCUM_EXT 0x200E +#define WGL_SUPPORT_GDI_EXT 0x200F +#define WGL_SUPPORT_OPENGL_EXT 0x2010 +#define WGL_DOUBLE_BUFFER_EXT 0x2011 +#define WGL_STEREO_EXT 0x2012 +#define WGL_PIXEL_TYPE_EXT 0x2013 +#define WGL_COLOR_BITS_EXT 0x2014 +#define WGL_RED_BITS_EXT 0x2015 +#define WGL_RED_SHIFT_EXT 0x2016 +#define WGL_GREEN_BITS_EXT 0x2017 +#define WGL_GREEN_SHIFT_EXT 0x2018 +#define WGL_BLUE_BITS_EXT 0x2019 +#define WGL_BLUE_SHIFT_EXT 0x201A +#define WGL_ALPHA_BITS_EXT 0x201B +#define WGL_ALPHA_SHIFT_EXT 0x201C +#define WGL_ACCUM_BITS_EXT 0x201D +#define WGL_ACCUM_RED_BITS_EXT 0x201E +#define WGL_ACCUM_GREEN_BITS_EXT 0x201F +#define WGL_ACCUM_BLUE_BITS_EXT 0x2020 +#define WGL_ACCUM_ALPHA_BITS_EXT 0x2021 +#define WGL_DEPTH_BITS_EXT 0x2022 +#define WGL_STENCIL_BITS_EXT 0x2023 +#define WGL_AUX_BUFFERS_EXT 0x2024 +#define WGL_NO_ACCELERATION_EXT 0x2025 +#define WGL_GENERIC_ACCELERATION_EXT 0x2026 +#define WGL_FULL_ACCELERATION_EXT 0x2027 +#define WGL_SWAP_EXCHANGE_EXT 0x2028 +#define WGL_SWAP_COPY_EXT 0x2029 +#define WGL_SWAP_UNDEFINED_EXT 0x202A +#define WGL_TYPE_RGBA_EXT 0x202B +#define WGL_TYPE_COLORINDEX_EXT 0x202C + +typedef BOOL (WINAPI * PFNWGLCHOOSEPIXELFORMATEXTPROC) (HDC hdc, const int* piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats); +typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBFVEXTPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int* piAttributes, FLOAT *pfValues); +typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBIVEXTPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int* piAttributes, int *piValues); + +#define wglChoosePixelFormatEXT WGLEW_GET_FUN(__wglewChoosePixelFormatEXT) +#define wglGetPixelFormatAttribfvEXT WGLEW_GET_FUN(__wglewGetPixelFormatAttribfvEXT) +#define wglGetPixelFormatAttribivEXT WGLEW_GET_FUN(__wglewGetPixelFormatAttribivEXT) + +#define WGLEW_EXT_pixel_format WGLEW_GET_VAR(__WGLEW_EXT_pixel_format) + +#endif /* WGL_EXT_pixel_format */ + +/* ------------------- WGL_EXT_pixel_format_packed_float ------------------- */ + +#ifndef WGL_EXT_pixel_format_packed_float +#define WGL_EXT_pixel_format_packed_float 1 + +#define WGL_TYPE_RGBA_UNSIGNED_FLOAT_EXT 0x20A8 + +#define WGLEW_EXT_pixel_format_packed_float WGLEW_GET_VAR(__WGLEW_EXT_pixel_format_packed_float) + +#endif /* WGL_EXT_pixel_format_packed_float */ + +/* -------------------------- WGL_EXT_swap_control ------------------------- */ + +#ifndef WGL_EXT_swap_control +#define WGL_EXT_swap_control 1 + +typedef int (WINAPI * PFNWGLGETSWAPINTERVALEXTPROC) (void); +typedef BOOL (WINAPI * PFNWGLSWAPINTERVALEXTPROC) (int interval); + +#define wglGetSwapIntervalEXT WGLEW_GET_FUN(__wglewGetSwapIntervalEXT) +#define wglSwapIntervalEXT WGLEW_GET_FUN(__wglewSwapIntervalEXT) + +#define WGLEW_EXT_swap_control WGLEW_GET_VAR(__WGLEW_EXT_swap_control) + +#endif /* WGL_EXT_swap_control */ + +/* ----------------------- WGL_EXT_swap_control_tear ----------------------- */ + +#ifndef WGL_EXT_swap_control_tear +#define WGL_EXT_swap_control_tear 1 + +#define WGLEW_EXT_swap_control_tear WGLEW_GET_VAR(__WGLEW_EXT_swap_control_tear) + +#endif /* WGL_EXT_swap_control_tear */ + +/* --------------------- WGL_I3D_digital_video_control --------------------- */ + +#ifndef WGL_I3D_digital_video_control +#define WGL_I3D_digital_video_control 1 + +#define WGL_DIGITAL_VIDEO_CURSOR_ALPHA_FRAMEBUFFER_I3D 0x2050 +#define WGL_DIGITAL_VIDEO_CURSOR_ALPHA_VALUE_I3D 0x2051 +#define WGL_DIGITAL_VIDEO_CURSOR_INCLUDED_I3D 0x2052 +#define WGL_DIGITAL_VIDEO_GAMMA_CORRECTED_I3D 0x2053 + +typedef BOOL (WINAPI * PFNWGLGETDIGITALVIDEOPARAMETERSI3DPROC) (HDC hDC, int iAttribute, int* piValue); +typedef BOOL (WINAPI * PFNWGLSETDIGITALVIDEOPARAMETERSI3DPROC) (HDC hDC, int iAttribute, const int* piValue); + +#define wglGetDigitalVideoParametersI3D WGLEW_GET_FUN(__wglewGetDigitalVideoParametersI3D) +#define wglSetDigitalVideoParametersI3D WGLEW_GET_FUN(__wglewSetDigitalVideoParametersI3D) + +#define WGLEW_I3D_digital_video_control WGLEW_GET_VAR(__WGLEW_I3D_digital_video_control) + +#endif /* WGL_I3D_digital_video_control */ + +/* ----------------------------- WGL_I3D_gamma ----------------------------- */ + +#ifndef WGL_I3D_gamma +#define WGL_I3D_gamma 1 + +#define WGL_GAMMA_TABLE_SIZE_I3D 0x204E +#define WGL_GAMMA_EXCLUDE_DESKTOP_I3D 0x204F + +typedef BOOL (WINAPI * PFNWGLGETGAMMATABLEI3DPROC) (HDC hDC, int iEntries, USHORT* puRed, USHORT *puGreen, USHORT *puBlue); +typedef BOOL (WINAPI * PFNWGLGETGAMMATABLEPARAMETERSI3DPROC) (HDC hDC, int iAttribute, int* piValue); +typedef BOOL (WINAPI * PFNWGLSETGAMMATABLEI3DPROC) (HDC hDC, int iEntries, const USHORT* puRed, const USHORT *puGreen, const USHORT *puBlue); +typedef BOOL (WINAPI * PFNWGLSETGAMMATABLEPARAMETERSI3DPROC) (HDC hDC, int iAttribute, const int* piValue); + +#define wglGetGammaTableI3D WGLEW_GET_FUN(__wglewGetGammaTableI3D) +#define wglGetGammaTableParametersI3D WGLEW_GET_FUN(__wglewGetGammaTableParametersI3D) +#define wglSetGammaTableI3D WGLEW_GET_FUN(__wglewSetGammaTableI3D) +#define wglSetGammaTableParametersI3D WGLEW_GET_FUN(__wglewSetGammaTableParametersI3D) + +#define WGLEW_I3D_gamma WGLEW_GET_VAR(__WGLEW_I3D_gamma) + +#endif /* WGL_I3D_gamma */ + +/* ---------------------------- WGL_I3D_genlock ---------------------------- */ + +#ifndef WGL_I3D_genlock +#define WGL_I3D_genlock 1 + +#define WGL_GENLOCK_SOURCE_MULTIVIEW_I3D 0x2044 +#define WGL_GENLOCK_SOURCE_EXTERNAL_SYNC_I3D 0x2045 +#define WGL_GENLOCK_SOURCE_EXTERNAL_FIELD_I3D 0x2046 +#define WGL_GENLOCK_SOURCE_EXTERNAL_TTL_I3D 0x2047 +#define WGL_GENLOCK_SOURCE_DIGITAL_SYNC_I3D 0x2048 +#define WGL_GENLOCK_SOURCE_DIGITAL_FIELD_I3D 0x2049 +#define WGL_GENLOCK_SOURCE_EDGE_FALLING_I3D 0x204A +#define WGL_GENLOCK_SOURCE_EDGE_RISING_I3D 0x204B +#define WGL_GENLOCK_SOURCE_EDGE_BOTH_I3D 0x204C + +typedef BOOL (WINAPI * PFNWGLDISABLEGENLOCKI3DPROC) (HDC hDC); +typedef BOOL (WINAPI * PFNWGLENABLEGENLOCKI3DPROC) (HDC hDC); +typedef BOOL (WINAPI * PFNWGLGENLOCKSAMPLERATEI3DPROC) (HDC hDC, UINT uRate); +typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEDELAYI3DPROC) (HDC hDC, UINT uDelay); +typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEEDGEI3DPROC) (HDC hDC, UINT uEdge); +typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEI3DPROC) (HDC hDC, UINT uSource); +typedef BOOL (WINAPI * PFNWGLGETGENLOCKSAMPLERATEI3DPROC) (HDC hDC, UINT* uRate); +typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEDELAYI3DPROC) (HDC hDC, UINT* uDelay); +typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEEDGEI3DPROC) (HDC hDC, UINT* uEdge); +typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEI3DPROC) (HDC hDC, UINT* uSource); +typedef BOOL (WINAPI * PFNWGLISENABLEDGENLOCKI3DPROC) (HDC hDC, BOOL* pFlag); +typedef BOOL (WINAPI * PFNWGLQUERYGENLOCKMAXSOURCEDELAYI3DPROC) (HDC hDC, UINT* uMaxLineDelay, UINT *uMaxPixelDelay); + +#define wglDisableGenlockI3D WGLEW_GET_FUN(__wglewDisableGenlockI3D) +#define wglEnableGenlockI3D WGLEW_GET_FUN(__wglewEnableGenlockI3D) +#define wglGenlockSampleRateI3D WGLEW_GET_FUN(__wglewGenlockSampleRateI3D) +#define wglGenlockSourceDelayI3D WGLEW_GET_FUN(__wglewGenlockSourceDelayI3D) +#define wglGenlockSourceEdgeI3D WGLEW_GET_FUN(__wglewGenlockSourceEdgeI3D) +#define wglGenlockSourceI3D WGLEW_GET_FUN(__wglewGenlockSourceI3D) +#define wglGetGenlockSampleRateI3D WGLEW_GET_FUN(__wglewGetGenlockSampleRateI3D) +#define wglGetGenlockSourceDelayI3D WGLEW_GET_FUN(__wglewGetGenlockSourceDelayI3D) +#define wglGetGenlockSourceEdgeI3D WGLEW_GET_FUN(__wglewGetGenlockSourceEdgeI3D) +#define wglGetGenlockSourceI3D WGLEW_GET_FUN(__wglewGetGenlockSourceI3D) +#define wglIsEnabledGenlockI3D WGLEW_GET_FUN(__wglewIsEnabledGenlockI3D) +#define wglQueryGenlockMaxSourceDelayI3D WGLEW_GET_FUN(__wglewQueryGenlockMaxSourceDelayI3D) + +#define WGLEW_I3D_genlock WGLEW_GET_VAR(__WGLEW_I3D_genlock) + +#endif /* WGL_I3D_genlock */ + +/* -------------------------- WGL_I3D_image_buffer ------------------------- */ + +#ifndef WGL_I3D_image_buffer +#define WGL_I3D_image_buffer 1 + +#define WGL_IMAGE_BUFFER_MIN_ACCESS_I3D 0x00000001 +#define WGL_IMAGE_BUFFER_LOCK_I3D 0x00000002 + +typedef BOOL (WINAPI * PFNWGLASSOCIATEIMAGEBUFFEREVENTSI3DPROC) (HDC hdc, HANDLE* pEvent, LPVOID *pAddress, DWORD *pSize, UINT count); +typedef LPVOID (WINAPI * PFNWGLCREATEIMAGEBUFFERI3DPROC) (HDC hDC, DWORD dwSize, UINT uFlags); +typedef BOOL (WINAPI * PFNWGLDESTROYIMAGEBUFFERI3DPROC) (HDC hDC, LPVOID pAddress); +typedef BOOL (WINAPI * PFNWGLRELEASEIMAGEBUFFEREVENTSI3DPROC) (HDC hdc, LPVOID* pAddress, UINT count); + +#define wglAssociateImageBufferEventsI3D WGLEW_GET_FUN(__wglewAssociateImageBufferEventsI3D) +#define wglCreateImageBufferI3D WGLEW_GET_FUN(__wglewCreateImageBufferI3D) +#define wglDestroyImageBufferI3D WGLEW_GET_FUN(__wglewDestroyImageBufferI3D) +#define wglReleaseImageBufferEventsI3D WGLEW_GET_FUN(__wglewReleaseImageBufferEventsI3D) + +#define WGLEW_I3D_image_buffer WGLEW_GET_VAR(__WGLEW_I3D_image_buffer) + +#endif /* WGL_I3D_image_buffer */ + +/* ------------------------ WGL_I3D_swap_frame_lock ------------------------ */ + +#ifndef WGL_I3D_swap_frame_lock +#define WGL_I3D_swap_frame_lock 1 + +typedef BOOL (WINAPI * PFNWGLDISABLEFRAMELOCKI3DPROC) (VOID); +typedef BOOL (WINAPI * PFNWGLENABLEFRAMELOCKI3DPROC) (VOID); +typedef BOOL (WINAPI * PFNWGLISENABLEDFRAMELOCKI3DPROC) (BOOL* pFlag); +typedef BOOL (WINAPI * PFNWGLQUERYFRAMELOCKMASTERI3DPROC) (BOOL* pFlag); + +#define wglDisableFrameLockI3D WGLEW_GET_FUN(__wglewDisableFrameLockI3D) +#define wglEnableFrameLockI3D WGLEW_GET_FUN(__wglewEnableFrameLockI3D) +#define wglIsEnabledFrameLockI3D WGLEW_GET_FUN(__wglewIsEnabledFrameLockI3D) +#define wglQueryFrameLockMasterI3D WGLEW_GET_FUN(__wglewQueryFrameLockMasterI3D) + +#define WGLEW_I3D_swap_frame_lock WGLEW_GET_VAR(__WGLEW_I3D_swap_frame_lock) + +#endif /* WGL_I3D_swap_frame_lock */ + +/* ------------------------ WGL_I3D_swap_frame_usage ----------------------- */ + +#ifndef WGL_I3D_swap_frame_usage +#define WGL_I3D_swap_frame_usage 1 + +typedef BOOL (WINAPI * PFNWGLBEGINFRAMETRACKINGI3DPROC) (void); +typedef BOOL (WINAPI * PFNWGLENDFRAMETRACKINGI3DPROC) (void); +typedef BOOL (WINAPI * PFNWGLGETFRAMEUSAGEI3DPROC) (float* pUsage); +typedef BOOL (WINAPI * PFNWGLQUERYFRAMETRACKINGI3DPROC) (DWORD* pFrameCount, DWORD *pMissedFrames, float *pLastMissedUsage); + +#define wglBeginFrameTrackingI3D WGLEW_GET_FUN(__wglewBeginFrameTrackingI3D) +#define wglEndFrameTrackingI3D WGLEW_GET_FUN(__wglewEndFrameTrackingI3D) +#define wglGetFrameUsageI3D WGLEW_GET_FUN(__wglewGetFrameUsageI3D) +#define wglQueryFrameTrackingI3D WGLEW_GET_FUN(__wglewQueryFrameTrackingI3D) + +#define WGLEW_I3D_swap_frame_usage WGLEW_GET_VAR(__WGLEW_I3D_swap_frame_usage) + +#endif /* WGL_I3D_swap_frame_usage */ + +/* --------------------------- WGL_NV_DX_interop --------------------------- */ + +#ifndef WGL_NV_DX_interop +#define WGL_NV_DX_interop 1 + +#define WGL_ACCESS_READ_ONLY_NV 0x0000 +#define WGL_ACCESS_READ_WRITE_NV 0x0001 +#define WGL_ACCESS_WRITE_DISCARD_NV 0x0002 + +typedef BOOL (WINAPI * PFNWGLDXCLOSEDEVICENVPROC) (HANDLE hDevice); +typedef BOOL (WINAPI * PFNWGLDXLOCKOBJECTSNVPROC) (HANDLE hDevice, GLint count, HANDLE* hObjects); +typedef BOOL (WINAPI * PFNWGLDXOBJECTACCESSNVPROC) (HANDLE hObject, GLenum access); +typedef HANDLE (WINAPI * PFNWGLDXOPENDEVICENVPROC) (void* dxDevice); +typedef HANDLE (WINAPI * PFNWGLDXREGISTEROBJECTNVPROC) (HANDLE hDevice, void* dxObject, GLuint name, GLenum type, GLenum access); +typedef BOOL (WINAPI * PFNWGLDXSETRESOURCESHAREHANDLENVPROC) (void* dxObject, HANDLE shareHandle); +typedef BOOL (WINAPI * PFNWGLDXUNLOCKOBJECTSNVPROC) (HANDLE hDevice, GLint count, HANDLE* hObjects); +typedef BOOL (WINAPI * PFNWGLDXUNREGISTEROBJECTNVPROC) (HANDLE hDevice, HANDLE hObject); + +#define wglDXCloseDeviceNV WGLEW_GET_FUN(__wglewDXCloseDeviceNV) +#define wglDXLockObjectsNV WGLEW_GET_FUN(__wglewDXLockObjectsNV) +#define wglDXObjectAccessNV WGLEW_GET_FUN(__wglewDXObjectAccessNV) +#define wglDXOpenDeviceNV WGLEW_GET_FUN(__wglewDXOpenDeviceNV) +#define wglDXRegisterObjectNV WGLEW_GET_FUN(__wglewDXRegisterObjectNV) +#define wglDXSetResourceShareHandleNV WGLEW_GET_FUN(__wglewDXSetResourceShareHandleNV) +#define wglDXUnlockObjectsNV WGLEW_GET_FUN(__wglewDXUnlockObjectsNV) +#define wglDXUnregisterObjectNV WGLEW_GET_FUN(__wglewDXUnregisterObjectNV) + +#define WGLEW_NV_DX_interop WGLEW_GET_VAR(__WGLEW_NV_DX_interop) + +#endif /* WGL_NV_DX_interop */ + +/* --------------------------- WGL_NV_DX_interop2 -------------------------- */ + +#ifndef WGL_NV_DX_interop2 +#define WGL_NV_DX_interop2 1 + +#define WGLEW_NV_DX_interop2 WGLEW_GET_VAR(__WGLEW_NV_DX_interop2) + +#endif /* WGL_NV_DX_interop2 */ + +/* --------------------------- WGL_NV_copy_image --------------------------- */ + +#ifndef WGL_NV_copy_image +#define WGL_NV_copy_image 1 + +typedef BOOL (WINAPI * PFNWGLCOPYIMAGESUBDATANVPROC) (HGLRC hSrcRC, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, HGLRC hDstRC, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth); + +#define wglCopyImageSubDataNV WGLEW_GET_FUN(__wglewCopyImageSubDataNV) + +#define WGLEW_NV_copy_image WGLEW_GET_VAR(__WGLEW_NV_copy_image) + +#endif /* WGL_NV_copy_image */ + +/* -------------------------- WGL_NV_float_buffer -------------------------- */ + +#ifndef WGL_NV_float_buffer +#define WGL_NV_float_buffer 1 + +#define WGL_FLOAT_COMPONENTS_NV 0x20B0 +#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_R_NV 0x20B1 +#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RG_NV 0x20B2 +#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGB_NV 0x20B3 +#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGBA_NV 0x20B4 +#define WGL_TEXTURE_FLOAT_R_NV 0x20B5 +#define WGL_TEXTURE_FLOAT_RG_NV 0x20B6 +#define WGL_TEXTURE_FLOAT_RGB_NV 0x20B7 +#define WGL_TEXTURE_FLOAT_RGBA_NV 0x20B8 + +#define WGLEW_NV_float_buffer WGLEW_GET_VAR(__WGLEW_NV_float_buffer) + +#endif /* WGL_NV_float_buffer */ + +/* -------------------------- WGL_NV_gpu_affinity -------------------------- */ + +#ifndef WGL_NV_gpu_affinity +#define WGL_NV_gpu_affinity 1 + +#define WGL_ERROR_INCOMPATIBLE_AFFINITY_MASKS_NV 0x20D0 +#define WGL_ERROR_MISSING_AFFINITY_MASK_NV 0x20D1 + +DECLARE_HANDLE(HGPUNV); +typedef struct _GPU_DEVICE { + DWORD cb; + CHAR DeviceName[32]; + CHAR DeviceString[128]; + DWORD Flags; + RECT rcVirtualScreen; +} GPU_DEVICE, *PGPU_DEVICE; + +typedef HDC (WINAPI * PFNWGLCREATEAFFINITYDCNVPROC) (const HGPUNV *phGpuList); +typedef BOOL (WINAPI * PFNWGLDELETEDCNVPROC) (HDC hdc); +typedef BOOL (WINAPI * PFNWGLENUMGPUDEVICESNVPROC) (HGPUNV hGpu, UINT iDeviceIndex, PGPU_DEVICE lpGpuDevice); +typedef BOOL (WINAPI * PFNWGLENUMGPUSFROMAFFINITYDCNVPROC) (HDC hAffinityDC, UINT iGpuIndex, HGPUNV *hGpu); +typedef BOOL (WINAPI * PFNWGLENUMGPUSNVPROC) (UINT iGpuIndex, HGPUNV *phGpu); + +#define wglCreateAffinityDCNV WGLEW_GET_FUN(__wglewCreateAffinityDCNV) +#define wglDeleteDCNV WGLEW_GET_FUN(__wglewDeleteDCNV) +#define wglEnumGpuDevicesNV WGLEW_GET_FUN(__wglewEnumGpuDevicesNV) +#define wglEnumGpusFromAffinityDCNV WGLEW_GET_FUN(__wglewEnumGpusFromAffinityDCNV) +#define wglEnumGpusNV WGLEW_GET_FUN(__wglewEnumGpusNV) + +#define WGLEW_NV_gpu_affinity WGLEW_GET_VAR(__WGLEW_NV_gpu_affinity) + +#endif /* WGL_NV_gpu_affinity */ + +/* ---------------------- WGL_NV_multisample_coverage ---------------------- */ + +#ifndef WGL_NV_multisample_coverage +#define WGL_NV_multisample_coverage 1 + +#define WGL_COVERAGE_SAMPLES_NV 0x2042 +#define WGL_COLOR_SAMPLES_NV 0x20B9 + +#define WGLEW_NV_multisample_coverage WGLEW_GET_VAR(__WGLEW_NV_multisample_coverage) + +#endif /* WGL_NV_multisample_coverage */ + +/* -------------------------- WGL_NV_present_video ------------------------- */ + +#ifndef WGL_NV_present_video +#define WGL_NV_present_video 1 + +#define WGL_NUM_VIDEO_SLOTS_NV 0x20F0 + +DECLARE_HANDLE(HVIDEOOUTPUTDEVICENV); + +typedef BOOL (WINAPI * PFNWGLBINDVIDEODEVICENVPROC) (HDC hDc, unsigned int uVideoSlot, HVIDEOOUTPUTDEVICENV hVideoDevice, const int* piAttribList); +typedef int (WINAPI * PFNWGLENUMERATEVIDEODEVICESNVPROC) (HDC hDc, HVIDEOOUTPUTDEVICENV* phDeviceList); +typedef BOOL (WINAPI * PFNWGLQUERYCURRENTCONTEXTNVPROC) (int iAttribute, int* piValue); + +#define wglBindVideoDeviceNV WGLEW_GET_FUN(__wglewBindVideoDeviceNV) +#define wglEnumerateVideoDevicesNV WGLEW_GET_FUN(__wglewEnumerateVideoDevicesNV) +#define wglQueryCurrentContextNV WGLEW_GET_FUN(__wglewQueryCurrentContextNV) + +#define WGLEW_NV_present_video WGLEW_GET_VAR(__WGLEW_NV_present_video) + +#endif /* WGL_NV_present_video */ + +/* ---------------------- WGL_NV_render_depth_texture ---------------------- */ + +#ifndef WGL_NV_render_depth_texture +#define WGL_NV_render_depth_texture 1 + +#define WGL_NO_TEXTURE_ARB 0x2077 +#define WGL_BIND_TO_TEXTURE_DEPTH_NV 0x20A3 +#define WGL_BIND_TO_TEXTURE_RECTANGLE_DEPTH_NV 0x20A4 +#define WGL_DEPTH_TEXTURE_FORMAT_NV 0x20A5 +#define WGL_TEXTURE_DEPTH_COMPONENT_NV 0x20A6 +#define WGL_DEPTH_COMPONENT_NV 0x20A7 + +#define WGLEW_NV_render_depth_texture WGLEW_GET_VAR(__WGLEW_NV_render_depth_texture) + +#endif /* WGL_NV_render_depth_texture */ + +/* -------------------- WGL_NV_render_texture_rectangle -------------------- */ + +#ifndef WGL_NV_render_texture_rectangle +#define WGL_NV_render_texture_rectangle 1 + +#define WGL_BIND_TO_TEXTURE_RECTANGLE_RGB_NV 0x20A0 +#define WGL_BIND_TO_TEXTURE_RECTANGLE_RGBA_NV 0x20A1 +#define WGL_TEXTURE_RECTANGLE_NV 0x20A2 + +#define WGLEW_NV_render_texture_rectangle WGLEW_GET_VAR(__WGLEW_NV_render_texture_rectangle) + +#endif /* WGL_NV_render_texture_rectangle */ + +/* --------------------------- WGL_NV_swap_group --------------------------- */ + +#ifndef WGL_NV_swap_group +#define WGL_NV_swap_group 1 + +typedef BOOL (WINAPI * PFNWGLBINDSWAPBARRIERNVPROC) (GLuint group, GLuint barrier); +typedef BOOL (WINAPI * PFNWGLJOINSWAPGROUPNVPROC) (HDC hDC, GLuint group); +typedef BOOL (WINAPI * PFNWGLQUERYFRAMECOUNTNVPROC) (HDC hDC, GLuint* count); +typedef BOOL (WINAPI * PFNWGLQUERYMAXSWAPGROUPSNVPROC) (HDC hDC, GLuint* maxGroups, GLuint *maxBarriers); +typedef BOOL (WINAPI * PFNWGLQUERYSWAPGROUPNVPROC) (HDC hDC, GLuint* group, GLuint *barrier); +typedef BOOL (WINAPI * PFNWGLRESETFRAMECOUNTNVPROC) (HDC hDC); + +#define wglBindSwapBarrierNV WGLEW_GET_FUN(__wglewBindSwapBarrierNV) +#define wglJoinSwapGroupNV WGLEW_GET_FUN(__wglewJoinSwapGroupNV) +#define wglQueryFrameCountNV WGLEW_GET_FUN(__wglewQueryFrameCountNV) +#define wglQueryMaxSwapGroupsNV WGLEW_GET_FUN(__wglewQueryMaxSwapGroupsNV) +#define wglQuerySwapGroupNV WGLEW_GET_FUN(__wglewQuerySwapGroupNV) +#define wglResetFrameCountNV WGLEW_GET_FUN(__wglewResetFrameCountNV) + +#define WGLEW_NV_swap_group WGLEW_GET_VAR(__WGLEW_NV_swap_group) + +#endif /* WGL_NV_swap_group */ + +/* ----------------------- WGL_NV_vertex_array_range ----------------------- */ + +#ifndef WGL_NV_vertex_array_range +#define WGL_NV_vertex_array_range 1 + +typedef void * (WINAPI * PFNWGLALLOCATEMEMORYNVPROC) (GLsizei size, GLfloat readFrequency, GLfloat writeFrequency, GLfloat priority); +typedef void (WINAPI * PFNWGLFREEMEMORYNVPROC) (void *pointer); + +#define wglAllocateMemoryNV WGLEW_GET_FUN(__wglewAllocateMemoryNV) +#define wglFreeMemoryNV WGLEW_GET_FUN(__wglewFreeMemoryNV) + +#define WGLEW_NV_vertex_array_range WGLEW_GET_VAR(__WGLEW_NV_vertex_array_range) + +#endif /* WGL_NV_vertex_array_range */ + +/* -------------------------- WGL_NV_video_capture ------------------------- */ + +#ifndef WGL_NV_video_capture +#define WGL_NV_video_capture 1 + +#define WGL_UNIQUE_ID_NV 0x20CE +#define WGL_NUM_VIDEO_CAPTURE_SLOTS_NV 0x20CF + +DECLARE_HANDLE(HVIDEOINPUTDEVICENV); + +typedef BOOL (WINAPI * PFNWGLBINDVIDEOCAPTUREDEVICENVPROC) (UINT uVideoSlot, HVIDEOINPUTDEVICENV hDevice); +typedef UINT (WINAPI * PFNWGLENUMERATEVIDEOCAPTUREDEVICESNVPROC) (HDC hDc, HVIDEOINPUTDEVICENV* phDeviceList); +typedef BOOL (WINAPI * PFNWGLLOCKVIDEOCAPTUREDEVICENVPROC) (HDC hDc, HVIDEOINPUTDEVICENV hDevice); +typedef BOOL (WINAPI * PFNWGLQUERYVIDEOCAPTUREDEVICENVPROC) (HDC hDc, HVIDEOINPUTDEVICENV hDevice, int iAttribute, int* piValue); +typedef BOOL (WINAPI * PFNWGLRELEASEVIDEOCAPTUREDEVICENVPROC) (HDC hDc, HVIDEOINPUTDEVICENV hDevice); + +#define wglBindVideoCaptureDeviceNV WGLEW_GET_FUN(__wglewBindVideoCaptureDeviceNV) +#define wglEnumerateVideoCaptureDevicesNV WGLEW_GET_FUN(__wglewEnumerateVideoCaptureDevicesNV) +#define wglLockVideoCaptureDeviceNV WGLEW_GET_FUN(__wglewLockVideoCaptureDeviceNV) +#define wglQueryVideoCaptureDeviceNV WGLEW_GET_FUN(__wglewQueryVideoCaptureDeviceNV) +#define wglReleaseVideoCaptureDeviceNV WGLEW_GET_FUN(__wglewReleaseVideoCaptureDeviceNV) + +#define WGLEW_NV_video_capture WGLEW_GET_VAR(__WGLEW_NV_video_capture) + +#endif /* WGL_NV_video_capture */ + +/* -------------------------- WGL_NV_video_output -------------------------- */ + +#ifndef WGL_NV_video_output +#define WGL_NV_video_output 1 + +#define WGL_BIND_TO_VIDEO_RGB_NV 0x20C0 +#define WGL_BIND_TO_VIDEO_RGBA_NV 0x20C1 +#define WGL_BIND_TO_VIDEO_RGB_AND_DEPTH_NV 0x20C2 +#define WGL_VIDEO_OUT_COLOR_NV 0x20C3 +#define WGL_VIDEO_OUT_ALPHA_NV 0x20C4 +#define WGL_VIDEO_OUT_DEPTH_NV 0x20C5 +#define WGL_VIDEO_OUT_COLOR_AND_ALPHA_NV 0x20C6 +#define WGL_VIDEO_OUT_COLOR_AND_DEPTH_NV 0x20C7 +#define WGL_VIDEO_OUT_FRAME 0x20C8 +#define WGL_VIDEO_OUT_FIELD_1 0x20C9 +#define WGL_VIDEO_OUT_FIELD_2 0x20CA +#define WGL_VIDEO_OUT_STACKED_FIELDS_1_2 0x20CB +#define WGL_VIDEO_OUT_STACKED_FIELDS_2_1 0x20CC + +DECLARE_HANDLE(HPVIDEODEV); + +typedef BOOL (WINAPI * PFNWGLBINDVIDEOIMAGENVPROC) (HPVIDEODEV hVideoDevice, HPBUFFERARB hPbuffer, int iVideoBuffer); +typedef BOOL (WINAPI * PFNWGLGETVIDEODEVICENVPROC) (HDC hDC, int numDevices, HPVIDEODEV* hVideoDevice); +typedef BOOL (WINAPI * PFNWGLGETVIDEOINFONVPROC) (HPVIDEODEV hpVideoDevice, unsigned long* pulCounterOutputPbuffer, unsigned long *pulCounterOutputVideo); +typedef BOOL (WINAPI * PFNWGLRELEASEVIDEODEVICENVPROC) (HPVIDEODEV hVideoDevice); +typedef BOOL (WINAPI * PFNWGLRELEASEVIDEOIMAGENVPROC) (HPBUFFERARB hPbuffer, int iVideoBuffer); +typedef BOOL (WINAPI * PFNWGLSENDPBUFFERTOVIDEONVPROC) (HPBUFFERARB hPbuffer, int iBufferType, unsigned long* pulCounterPbuffer, BOOL bBlock); + +#define wglBindVideoImageNV WGLEW_GET_FUN(__wglewBindVideoImageNV) +#define wglGetVideoDeviceNV WGLEW_GET_FUN(__wglewGetVideoDeviceNV) +#define wglGetVideoInfoNV WGLEW_GET_FUN(__wglewGetVideoInfoNV) +#define wglReleaseVideoDeviceNV WGLEW_GET_FUN(__wglewReleaseVideoDeviceNV) +#define wglReleaseVideoImageNV WGLEW_GET_FUN(__wglewReleaseVideoImageNV) +#define wglSendPbufferToVideoNV WGLEW_GET_FUN(__wglewSendPbufferToVideoNV) + +#define WGLEW_NV_video_output WGLEW_GET_VAR(__WGLEW_NV_video_output) + +#endif /* WGL_NV_video_output */ + +/* -------------------------- WGL_OML_sync_control ------------------------- */ + +#ifndef WGL_OML_sync_control +#define WGL_OML_sync_control 1 + +typedef BOOL (WINAPI * PFNWGLGETMSCRATEOMLPROC) (HDC hdc, INT32* numerator, INT32 *denominator); +typedef BOOL (WINAPI * PFNWGLGETSYNCVALUESOMLPROC) (HDC hdc, INT64* ust, INT64 *msc, INT64 *sbc); +typedef INT64 (WINAPI * PFNWGLSWAPBUFFERSMSCOMLPROC) (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder); +typedef INT64 (WINAPI * PFNWGLSWAPLAYERBUFFERSMSCOMLPROC) (HDC hdc, INT fuPlanes, INT64 target_msc, INT64 divisor, INT64 remainder); +typedef BOOL (WINAPI * PFNWGLWAITFORMSCOMLPROC) (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder, INT64* ust, INT64 *msc, INT64 *sbc); +typedef BOOL (WINAPI * PFNWGLWAITFORSBCOMLPROC) (HDC hdc, INT64 target_sbc, INT64* ust, INT64 *msc, INT64 *sbc); + +#define wglGetMscRateOML WGLEW_GET_FUN(__wglewGetMscRateOML) +#define wglGetSyncValuesOML WGLEW_GET_FUN(__wglewGetSyncValuesOML) +#define wglSwapBuffersMscOML WGLEW_GET_FUN(__wglewSwapBuffersMscOML) +#define wglSwapLayerBuffersMscOML WGLEW_GET_FUN(__wglewSwapLayerBuffersMscOML) +#define wglWaitForMscOML WGLEW_GET_FUN(__wglewWaitForMscOML) +#define wglWaitForSbcOML WGLEW_GET_FUN(__wglewWaitForSbcOML) + +#define WGLEW_OML_sync_control WGLEW_GET_VAR(__WGLEW_OML_sync_control) + +#endif /* WGL_OML_sync_control */ + +/* ------------------------------------------------------------------------- */ + +#ifdef GLEW_MX +#define WGLEW_FUN_EXPORT +#define WGLEW_VAR_EXPORT +#else +#define WGLEW_FUN_EXPORT GLEW_FUN_EXPORT +#define WGLEW_VAR_EXPORT GLEW_VAR_EXPORT +#endif /* GLEW_MX */ + +#ifdef GLEW_MX +struct WGLEWContextStruct +{ +#endif /* GLEW_MX */ + +WGLEW_FUN_EXPORT PFNWGLSETSTEREOEMITTERSTATE3DLPROC __wglewSetStereoEmitterState3DL; + +WGLEW_FUN_EXPORT PFNWGLBLITCONTEXTFRAMEBUFFERAMDPROC __wglewBlitContextFramebufferAMD; +WGLEW_FUN_EXPORT PFNWGLCREATEASSOCIATEDCONTEXTAMDPROC __wglewCreateAssociatedContextAMD; +WGLEW_FUN_EXPORT PFNWGLCREATEASSOCIATEDCONTEXTATTRIBSAMDPROC __wglewCreateAssociatedContextAttribsAMD; +WGLEW_FUN_EXPORT PFNWGLDELETEASSOCIATEDCONTEXTAMDPROC __wglewDeleteAssociatedContextAMD; +WGLEW_FUN_EXPORT PFNWGLGETCONTEXTGPUIDAMDPROC __wglewGetContextGPUIDAMD; +WGLEW_FUN_EXPORT PFNWGLGETCURRENTASSOCIATEDCONTEXTAMDPROC __wglewGetCurrentAssociatedContextAMD; +WGLEW_FUN_EXPORT PFNWGLGETGPUIDSAMDPROC __wglewGetGPUIDsAMD; +WGLEW_FUN_EXPORT PFNWGLGETGPUINFOAMDPROC __wglewGetGPUInfoAMD; +WGLEW_FUN_EXPORT PFNWGLMAKEASSOCIATEDCONTEXTCURRENTAMDPROC __wglewMakeAssociatedContextCurrentAMD; + +WGLEW_FUN_EXPORT PFNWGLCREATEBUFFERREGIONARBPROC __wglewCreateBufferRegionARB; +WGLEW_FUN_EXPORT PFNWGLDELETEBUFFERREGIONARBPROC __wglewDeleteBufferRegionARB; +WGLEW_FUN_EXPORT PFNWGLRESTOREBUFFERREGIONARBPROC __wglewRestoreBufferRegionARB; +WGLEW_FUN_EXPORT PFNWGLSAVEBUFFERREGIONARBPROC __wglewSaveBufferRegionARB; + +WGLEW_FUN_EXPORT PFNWGLCREATECONTEXTATTRIBSARBPROC __wglewCreateContextAttribsARB; + +WGLEW_FUN_EXPORT PFNWGLGETEXTENSIONSSTRINGARBPROC __wglewGetExtensionsStringARB; + +WGLEW_FUN_EXPORT PFNWGLGETCURRENTREADDCARBPROC __wglewGetCurrentReadDCARB; +WGLEW_FUN_EXPORT PFNWGLMAKECONTEXTCURRENTARBPROC __wglewMakeContextCurrentARB; + +WGLEW_FUN_EXPORT PFNWGLCREATEPBUFFERARBPROC __wglewCreatePbufferARB; +WGLEW_FUN_EXPORT PFNWGLDESTROYPBUFFERARBPROC __wglewDestroyPbufferARB; +WGLEW_FUN_EXPORT PFNWGLGETPBUFFERDCARBPROC __wglewGetPbufferDCARB; +WGLEW_FUN_EXPORT PFNWGLQUERYPBUFFERARBPROC __wglewQueryPbufferARB; +WGLEW_FUN_EXPORT PFNWGLRELEASEPBUFFERDCARBPROC __wglewReleasePbufferDCARB; + +WGLEW_FUN_EXPORT PFNWGLCHOOSEPIXELFORMATARBPROC __wglewChoosePixelFormatARB; +WGLEW_FUN_EXPORT PFNWGLGETPIXELFORMATATTRIBFVARBPROC __wglewGetPixelFormatAttribfvARB; +WGLEW_FUN_EXPORT PFNWGLGETPIXELFORMATATTRIBIVARBPROC __wglewGetPixelFormatAttribivARB; + +WGLEW_FUN_EXPORT PFNWGLBINDTEXIMAGEARBPROC __wglewBindTexImageARB; +WGLEW_FUN_EXPORT PFNWGLRELEASETEXIMAGEARBPROC __wglewReleaseTexImageARB; +WGLEW_FUN_EXPORT PFNWGLSETPBUFFERATTRIBARBPROC __wglewSetPbufferAttribARB; + +WGLEW_FUN_EXPORT PFNWGLBINDDISPLAYCOLORTABLEEXTPROC __wglewBindDisplayColorTableEXT; +WGLEW_FUN_EXPORT PFNWGLCREATEDISPLAYCOLORTABLEEXTPROC __wglewCreateDisplayColorTableEXT; +WGLEW_FUN_EXPORT PFNWGLDESTROYDISPLAYCOLORTABLEEXTPROC __wglewDestroyDisplayColorTableEXT; +WGLEW_FUN_EXPORT PFNWGLLOADDISPLAYCOLORTABLEEXTPROC __wglewLoadDisplayColorTableEXT; + +WGLEW_FUN_EXPORT PFNWGLGETEXTENSIONSSTRINGEXTPROC __wglewGetExtensionsStringEXT; + +WGLEW_FUN_EXPORT PFNWGLGETCURRENTREADDCEXTPROC __wglewGetCurrentReadDCEXT; +WGLEW_FUN_EXPORT PFNWGLMAKECONTEXTCURRENTEXTPROC __wglewMakeContextCurrentEXT; + +WGLEW_FUN_EXPORT PFNWGLCREATEPBUFFEREXTPROC __wglewCreatePbufferEXT; +WGLEW_FUN_EXPORT PFNWGLDESTROYPBUFFEREXTPROC __wglewDestroyPbufferEXT; +WGLEW_FUN_EXPORT PFNWGLGETPBUFFERDCEXTPROC __wglewGetPbufferDCEXT; +WGLEW_FUN_EXPORT PFNWGLQUERYPBUFFEREXTPROC __wglewQueryPbufferEXT; +WGLEW_FUN_EXPORT PFNWGLRELEASEPBUFFERDCEXTPROC __wglewReleasePbufferDCEXT; + +WGLEW_FUN_EXPORT PFNWGLCHOOSEPIXELFORMATEXTPROC __wglewChoosePixelFormatEXT; +WGLEW_FUN_EXPORT PFNWGLGETPIXELFORMATATTRIBFVEXTPROC __wglewGetPixelFormatAttribfvEXT; +WGLEW_FUN_EXPORT PFNWGLGETPIXELFORMATATTRIBIVEXTPROC __wglewGetPixelFormatAttribivEXT; + +WGLEW_FUN_EXPORT PFNWGLGETSWAPINTERVALEXTPROC __wglewGetSwapIntervalEXT; +WGLEW_FUN_EXPORT PFNWGLSWAPINTERVALEXTPROC __wglewSwapIntervalEXT; + +WGLEW_FUN_EXPORT PFNWGLGETDIGITALVIDEOPARAMETERSI3DPROC __wglewGetDigitalVideoParametersI3D; +WGLEW_FUN_EXPORT PFNWGLSETDIGITALVIDEOPARAMETERSI3DPROC __wglewSetDigitalVideoParametersI3D; + +WGLEW_FUN_EXPORT PFNWGLGETGAMMATABLEI3DPROC __wglewGetGammaTableI3D; +WGLEW_FUN_EXPORT PFNWGLGETGAMMATABLEPARAMETERSI3DPROC __wglewGetGammaTableParametersI3D; +WGLEW_FUN_EXPORT PFNWGLSETGAMMATABLEI3DPROC __wglewSetGammaTableI3D; +WGLEW_FUN_EXPORT PFNWGLSETGAMMATABLEPARAMETERSI3DPROC __wglewSetGammaTableParametersI3D; + +WGLEW_FUN_EXPORT PFNWGLDISABLEGENLOCKI3DPROC __wglewDisableGenlockI3D; +WGLEW_FUN_EXPORT PFNWGLENABLEGENLOCKI3DPROC __wglewEnableGenlockI3D; +WGLEW_FUN_EXPORT PFNWGLGENLOCKSAMPLERATEI3DPROC __wglewGenlockSampleRateI3D; +WGLEW_FUN_EXPORT PFNWGLGENLOCKSOURCEDELAYI3DPROC __wglewGenlockSourceDelayI3D; +WGLEW_FUN_EXPORT PFNWGLGENLOCKSOURCEEDGEI3DPROC __wglewGenlockSourceEdgeI3D; +WGLEW_FUN_EXPORT PFNWGLGENLOCKSOURCEI3DPROC __wglewGenlockSourceI3D; +WGLEW_FUN_EXPORT PFNWGLGETGENLOCKSAMPLERATEI3DPROC __wglewGetGenlockSampleRateI3D; +WGLEW_FUN_EXPORT PFNWGLGETGENLOCKSOURCEDELAYI3DPROC __wglewGetGenlockSourceDelayI3D; +WGLEW_FUN_EXPORT PFNWGLGETGENLOCKSOURCEEDGEI3DPROC __wglewGetGenlockSourceEdgeI3D; +WGLEW_FUN_EXPORT PFNWGLGETGENLOCKSOURCEI3DPROC __wglewGetGenlockSourceI3D; +WGLEW_FUN_EXPORT PFNWGLISENABLEDGENLOCKI3DPROC __wglewIsEnabledGenlockI3D; +WGLEW_FUN_EXPORT PFNWGLQUERYGENLOCKMAXSOURCEDELAYI3DPROC __wglewQueryGenlockMaxSourceDelayI3D; + +WGLEW_FUN_EXPORT PFNWGLASSOCIATEIMAGEBUFFEREVENTSI3DPROC __wglewAssociateImageBufferEventsI3D; +WGLEW_FUN_EXPORT PFNWGLCREATEIMAGEBUFFERI3DPROC __wglewCreateImageBufferI3D; +WGLEW_FUN_EXPORT PFNWGLDESTROYIMAGEBUFFERI3DPROC __wglewDestroyImageBufferI3D; +WGLEW_FUN_EXPORT PFNWGLRELEASEIMAGEBUFFEREVENTSI3DPROC __wglewReleaseImageBufferEventsI3D; + +WGLEW_FUN_EXPORT PFNWGLDISABLEFRAMELOCKI3DPROC __wglewDisableFrameLockI3D; +WGLEW_FUN_EXPORT PFNWGLENABLEFRAMELOCKI3DPROC __wglewEnableFrameLockI3D; +WGLEW_FUN_EXPORT PFNWGLISENABLEDFRAMELOCKI3DPROC __wglewIsEnabledFrameLockI3D; +WGLEW_FUN_EXPORT PFNWGLQUERYFRAMELOCKMASTERI3DPROC __wglewQueryFrameLockMasterI3D; + +WGLEW_FUN_EXPORT PFNWGLBEGINFRAMETRACKINGI3DPROC __wglewBeginFrameTrackingI3D; +WGLEW_FUN_EXPORT PFNWGLENDFRAMETRACKINGI3DPROC __wglewEndFrameTrackingI3D; +WGLEW_FUN_EXPORT PFNWGLGETFRAMEUSAGEI3DPROC __wglewGetFrameUsageI3D; +WGLEW_FUN_EXPORT PFNWGLQUERYFRAMETRACKINGI3DPROC __wglewQueryFrameTrackingI3D; + +WGLEW_FUN_EXPORT PFNWGLDXCLOSEDEVICENVPROC __wglewDXCloseDeviceNV; +WGLEW_FUN_EXPORT PFNWGLDXLOCKOBJECTSNVPROC __wglewDXLockObjectsNV; +WGLEW_FUN_EXPORT PFNWGLDXOBJECTACCESSNVPROC __wglewDXObjectAccessNV; +WGLEW_FUN_EXPORT PFNWGLDXOPENDEVICENVPROC __wglewDXOpenDeviceNV; +WGLEW_FUN_EXPORT PFNWGLDXREGISTEROBJECTNVPROC __wglewDXRegisterObjectNV; +WGLEW_FUN_EXPORT PFNWGLDXSETRESOURCESHAREHANDLENVPROC __wglewDXSetResourceShareHandleNV; +WGLEW_FUN_EXPORT PFNWGLDXUNLOCKOBJECTSNVPROC __wglewDXUnlockObjectsNV; +WGLEW_FUN_EXPORT PFNWGLDXUNREGISTEROBJECTNVPROC __wglewDXUnregisterObjectNV; + +WGLEW_FUN_EXPORT PFNWGLCOPYIMAGESUBDATANVPROC __wglewCopyImageSubDataNV; + +WGLEW_FUN_EXPORT PFNWGLCREATEAFFINITYDCNVPROC __wglewCreateAffinityDCNV; +WGLEW_FUN_EXPORT PFNWGLDELETEDCNVPROC __wglewDeleteDCNV; +WGLEW_FUN_EXPORT PFNWGLENUMGPUDEVICESNVPROC __wglewEnumGpuDevicesNV; +WGLEW_FUN_EXPORT PFNWGLENUMGPUSFROMAFFINITYDCNVPROC __wglewEnumGpusFromAffinityDCNV; +WGLEW_FUN_EXPORT PFNWGLENUMGPUSNVPROC __wglewEnumGpusNV; + +WGLEW_FUN_EXPORT PFNWGLBINDVIDEODEVICENVPROC __wglewBindVideoDeviceNV; +WGLEW_FUN_EXPORT PFNWGLENUMERATEVIDEODEVICESNVPROC __wglewEnumerateVideoDevicesNV; +WGLEW_FUN_EXPORT PFNWGLQUERYCURRENTCONTEXTNVPROC __wglewQueryCurrentContextNV; + +WGLEW_FUN_EXPORT PFNWGLBINDSWAPBARRIERNVPROC __wglewBindSwapBarrierNV; +WGLEW_FUN_EXPORT PFNWGLJOINSWAPGROUPNVPROC __wglewJoinSwapGroupNV; +WGLEW_FUN_EXPORT PFNWGLQUERYFRAMECOUNTNVPROC __wglewQueryFrameCountNV; +WGLEW_FUN_EXPORT PFNWGLQUERYMAXSWAPGROUPSNVPROC __wglewQueryMaxSwapGroupsNV; +WGLEW_FUN_EXPORT PFNWGLQUERYSWAPGROUPNVPROC __wglewQuerySwapGroupNV; +WGLEW_FUN_EXPORT PFNWGLRESETFRAMECOUNTNVPROC __wglewResetFrameCountNV; + +WGLEW_FUN_EXPORT PFNWGLALLOCATEMEMORYNVPROC __wglewAllocateMemoryNV; +WGLEW_FUN_EXPORT PFNWGLFREEMEMORYNVPROC __wglewFreeMemoryNV; + +WGLEW_FUN_EXPORT PFNWGLBINDVIDEOCAPTUREDEVICENVPROC __wglewBindVideoCaptureDeviceNV; +WGLEW_FUN_EXPORT PFNWGLENUMERATEVIDEOCAPTUREDEVICESNVPROC __wglewEnumerateVideoCaptureDevicesNV; +WGLEW_FUN_EXPORT PFNWGLLOCKVIDEOCAPTUREDEVICENVPROC __wglewLockVideoCaptureDeviceNV; +WGLEW_FUN_EXPORT PFNWGLQUERYVIDEOCAPTUREDEVICENVPROC __wglewQueryVideoCaptureDeviceNV; +WGLEW_FUN_EXPORT PFNWGLRELEASEVIDEOCAPTUREDEVICENVPROC __wglewReleaseVideoCaptureDeviceNV; + +WGLEW_FUN_EXPORT PFNWGLBINDVIDEOIMAGENVPROC __wglewBindVideoImageNV; +WGLEW_FUN_EXPORT PFNWGLGETVIDEODEVICENVPROC __wglewGetVideoDeviceNV; +WGLEW_FUN_EXPORT PFNWGLGETVIDEOINFONVPROC __wglewGetVideoInfoNV; +WGLEW_FUN_EXPORT PFNWGLRELEASEVIDEODEVICENVPROC __wglewReleaseVideoDeviceNV; +WGLEW_FUN_EXPORT PFNWGLRELEASEVIDEOIMAGENVPROC __wglewReleaseVideoImageNV; +WGLEW_FUN_EXPORT PFNWGLSENDPBUFFERTOVIDEONVPROC __wglewSendPbufferToVideoNV; + +WGLEW_FUN_EXPORT PFNWGLGETMSCRATEOMLPROC __wglewGetMscRateOML; +WGLEW_FUN_EXPORT PFNWGLGETSYNCVALUESOMLPROC __wglewGetSyncValuesOML; +WGLEW_FUN_EXPORT PFNWGLSWAPBUFFERSMSCOMLPROC __wglewSwapBuffersMscOML; +WGLEW_FUN_EXPORT PFNWGLSWAPLAYERBUFFERSMSCOMLPROC __wglewSwapLayerBuffersMscOML; +WGLEW_FUN_EXPORT PFNWGLWAITFORMSCOMLPROC __wglewWaitForMscOML; +WGLEW_FUN_EXPORT PFNWGLWAITFORSBCOMLPROC __wglewWaitForSbcOML; +WGLEW_VAR_EXPORT GLboolean __WGLEW_3DFX_multisample; +WGLEW_VAR_EXPORT GLboolean __WGLEW_3DL_stereo_control; +WGLEW_VAR_EXPORT GLboolean __WGLEW_AMD_gpu_association; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_buffer_region; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_create_context; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_create_context_profile; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_create_context_robustness; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_extensions_string; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_framebuffer_sRGB; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_make_current_read; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_multisample; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_pbuffer; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_pixel_format; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_pixel_format_float; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_render_texture; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_robustness_application_isolation; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_robustness_share_group_isolation; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ATI_pixel_format_float; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ATI_render_texture_rectangle; +WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_create_context_es2_profile; +WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_create_context_es_profile; +WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_depth_float; +WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_display_color_table; +WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_extensions_string; +WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_framebuffer_sRGB; +WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_make_current_read; +WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_multisample; +WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_pbuffer; +WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_pixel_format; +WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_pixel_format_packed_float; +WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_swap_control; +WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_swap_control_tear; +WGLEW_VAR_EXPORT GLboolean __WGLEW_I3D_digital_video_control; +WGLEW_VAR_EXPORT GLboolean __WGLEW_I3D_gamma; +WGLEW_VAR_EXPORT GLboolean __WGLEW_I3D_genlock; +WGLEW_VAR_EXPORT GLboolean __WGLEW_I3D_image_buffer; +WGLEW_VAR_EXPORT GLboolean __WGLEW_I3D_swap_frame_lock; +WGLEW_VAR_EXPORT GLboolean __WGLEW_I3D_swap_frame_usage; +WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_DX_interop; +WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_DX_interop2; +WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_copy_image; +WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_float_buffer; +WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_gpu_affinity; +WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_multisample_coverage; +WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_present_video; +WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_render_depth_texture; +WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_render_texture_rectangle; +WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_swap_group; +WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_vertex_array_range; +WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_video_capture; +WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_video_output; +WGLEW_VAR_EXPORT GLboolean __WGLEW_OML_sync_control; + +#ifdef GLEW_MX +}; /* WGLEWContextStruct */ +#endif /* GLEW_MX */ + +/* ------------------------------------------------------------------------- */ + +#ifdef GLEW_MX + +typedef struct WGLEWContextStruct WGLEWContext; +GLEWAPI GLenum GLEWAPIENTRY wglewContextInit (WGLEWContext *ctx); +GLEWAPI GLboolean GLEWAPIENTRY wglewContextIsSupported (const WGLEWContext *ctx, const char *name); + +#define wglewInit() wglewContextInit(wglewGetContext()) +#define wglewIsSupported(x) wglewContextIsSupported(wglewGetContext(), x) + +#define WGLEW_GET_VAR(x) (*(const GLboolean*)&(wglewGetContext()->x)) +#define WGLEW_GET_FUN(x) wglewGetContext()->x + +#else /* GLEW_MX */ + +#define WGLEW_GET_VAR(x) (*(const GLboolean*)&x) +#define WGLEW_GET_FUN(x) x + +GLEWAPI GLboolean GLEWAPIENTRY wglewIsSupported (const char *name); + +#endif /* GLEW_MX */ + +GLEWAPI GLboolean GLEWAPIENTRY wglewGetExtension (const char *name); + +#ifdef __cplusplus +} +#endif + +#undef GLEWAPI + +#endif /* __wglew_h__ */ diff --git a/external/Chipmunk/msvc/glew/lib/Release/Win32/glew32.lib b/external/Chipmunk/msvc/glew/lib/Release/Win32/glew32.lib new file mode 100644 index 0000000..f6feeae Binary files /dev/null and b/external/Chipmunk/msvc/glew/lib/Release/Win32/glew32.lib differ diff --git a/external/Chipmunk/msvc/glfw/COPYING.txt b/external/Chipmunk/msvc/glfw/COPYING.txt new file mode 100644 index 0000000..b30c701 --- /dev/null +++ b/external/Chipmunk/msvc/glfw/COPYING.txt @@ -0,0 +1,22 @@ +Copyright (c) 2002-2006 Marcus Geelnard +Copyright (c) 2006-2010 Camilla Berglund + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would + be appreciated but is not required. + +2. Altered source versions must be plainly marked as such, and must not + be misrepresented as being the original software. + +3. This notice may not be removed or altered from any source + distribution. + diff --git a/external/Chipmunk/msvc/glfw/include/GL/glfw.h b/external/Chipmunk/msvc/glfw/include/GL/glfw.h new file mode 100644 index 0000000..bdaa126 --- /dev/null +++ b/external/Chipmunk/msvc/glfw/include/GL/glfw.h @@ -0,0 +1,518 @@ +/************************************************************************ + * GLFW - An OpenGL framework + * API version: 2.7 + * WWW: http://www.glfw.org/ + *------------------------------------------------------------------------ + * Copyright (c) 2002-2006 Marcus Geelnard + * Copyright (c) 2006-2010 Camilla Berglund + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would + * be appreciated but is not required. + * + * 2. Altered source versions must be plainly marked as such, and must not + * be misrepresented as being the original software. + * + * 3. This notice may not be removed or altered from any source + * distribution. + * + *************************************************************************/ + +#ifndef __glfw_h_ +#define __glfw_h_ + +#ifdef __cplusplus +extern "C" { +#endif + + +/************************************************************************* + * Global definitions + *************************************************************************/ + +/* We need a NULL pointer from time to time */ +#ifndef NULL + #ifdef __cplusplus + #define NULL 0 + #else + #define NULL ((void *)0) + #endif +#endif /* NULL */ + + +/* ------------------- BEGIN SYSTEM/COMPILER SPECIFIC -------------------- */ + +/* Please report any probles that you find with your compiler, which may + * be solved in this section! There are several compilers that I have not + * been able to test this file with yet. + * + * First: If we are we on Windows, we want a single define for it (_WIN32) + * (Note: For Cygwin the compiler flag -mwin32 should be used, but to + * make sure that things run smoothly for Cygwin users, we add __CYGWIN__ + * to the list of "valid Win32 identifiers", which removes the need for + * -mwin32) + */ +#if !defined(_WIN32) && (defined(__WIN32__) || defined(WIN32) || defined(__CYGWIN__)) + #define _WIN32 +#endif /* _WIN32 */ + +/* In order for extension support to be portable, we need to define an + * OpenGL function call method. We use the keyword APIENTRY, which is + * defined for Win32. (Note: Windows also needs this for ) + */ +#ifndef APIENTRY + #ifdef _WIN32 + #define APIENTRY __stdcall + #else + #define APIENTRY + #endif + #define GL_APIENTRY_DEFINED +#endif /* APIENTRY */ + + +/* The following three defines are here solely to make some Windows-based + * files happy. Theoretically we could include , but + * it has the major drawback of severely polluting our namespace. + */ + +/* Under Windows, we need WINGDIAPI defined */ +#if !defined(WINGDIAPI) && defined(_WIN32) + #if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__POCC__) + /* Microsoft Visual C++, Borland C++ Builder and Pelles C */ + #define WINGDIAPI __declspec(dllimport) + #elif defined(__LCC__) + /* LCC-Win32 */ + #define WINGDIAPI __stdcall + #else + /* Others (e.g. MinGW, Cygwin) */ + #define WINGDIAPI extern + #endif + #define GL_WINGDIAPI_DEFINED +#endif /* WINGDIAPI */ + +/* Some files also need CALLBACK defined */ +#if !defined(CALLBACK) && defined(_WIN32) + #if defined(_MSC_VER) + /* Microsoft Visual C++ */ + #if (defined(_M_MRX000) || defined(_M_IX86) || defined(_M_ALPHA) || defined(_M_PPC)) && !defined(MIDL_PASS) + #define CALLBACK __stdcall + #else + #define CALLBACK + #endif + #else + /* Other Windows compilers */ + #define CALLBACK __stdcall + #endif + #define GLU_CALLBACK_DEFINED +#endif /* CALLBACK */ + +/* Microsoft Visual C++, Borland C++ and Pelles C needs wchar_t */ +#if defined(_WIN32) && (defined(_MSC_VER) || defined(__BORLANDC__) || defined(__POCC__)) && !defined(_WCHAR_T_DEFINED) + typedef unsigned short wchar_t; + #define _WCHAR_T_DEFINED +#endif /* _WCHAR_T_DEFINED */ + + +/* ---------------- GLFW related system specific defines ----------------- */ + +#if defined(_WIN32) && defined(GLFW_BUILD_DLL) + + /* We are building a Win32 DLL */ + #define GLFWAPI __declspec(dllexport) + #define GLFWAPIENTRY __stdcall + #define GLFWCALL __stdcall + +#elif defined(_WIN32) && defined(GLFW_DLL) + + /* We are calling a Win32 DLL */ + #if defined(__LCC__) + #define GLFWAPI extern + #else + #define GLFWAPI __declspec(dllimport) + #endif + #define GLFWAPIENTRY __stdcall + #define GLFWCALL __stdcall + +#else + + /* We are either building/calling a static lib or we are non-win32 */ + #define GLFWAPIENTRY + #define GLFWAPI + #define GLFWCALL + +#endif + +/* -------------------- END SYSTEM/COMPILER SPECIFIC --------------------- */ + +/* Include standard OpenGL headers: GLFW uses GL_FALSE/GL_TRUE, and it is + * convenient for the user to only have to include . This also + * solves the problem with Windows and needing some + * special defines which normally requires the user to include + * (which is not a nice solution for portable programs). + */ +#if defined(__APPLE_CC__) + #if defined(GLFW_INCLUDE_GL3) + #include + #else + #define GL_GLEXT_LEGACY + #include + #endif + #ifndef GLFW_NO_GLU + #include + #endif +#else + #if defined(GLFW_INCLUDE_GL3) + #include + #else + #include + #endif + #ifndef GLFW_NO_GLU + #include + #endif +#endif + + +/************************************************************************* + * GLFW version + *************************************************************************/ + +#define GLFW_VERSION_MAJOR 2 +#define GLFW_VERSION_MINOR 7 +#define GLFW_VERSION_REVISION 9 + + +/************************************************************************* + * Input handling definitions + *************************************************************************/ + +/* Key and button state/action definitions */ +#define GLFW_RELEASE 0 +#define GLFW_PRESS 1 + +/* Keyboard key definitions: 8-bit ISO-8859-1 (Latin 1) encoding is used + * for printable keys (such as A-Z, 0-9 etc), and values above 256 + * represent special (non-printable) keys (e.g. F1, Page Up etc). + */ +#define GLFW_KEY_UNKNOWN -1 +#define GLFW_KEY_SPACE 32 +#define GLFW_KEY_SPECIAL 256 +#define GLFW_KEY_ESC (GLFW_KEY_SPECIAL+1) +#define GLFW_KEY_F1 (GLFW_KEY_SPECIAL+2) +#define GLFW_KEY_F2 (GLFW_KEY_SPECIAL+3) +#define GLFW_KEY_F3 (GLFW_KEY_SPECIAL+4) +#define GLFW_KEY_F4 (GLFW_KEY_SPECIAL+5) +#define GLFW_KEY_F5 (GLFW_KEY_SPECIAL+6) +#define GLFW_KEY_F6 (GLFW_KEY_SPECIAL+7) +#define GLFW_KEY_F7 (GLFW_KEY_SPECIAL+8) +#define GLFW_KEY_F8 (GLFW_KEY_SPECIAL+9) +#define GLFW_KEY_F9 (GLFW_KEY_SPECIAL+10) +#define GLFW_KEY_F10 (GLFW_KEY_SPECIAL+11) +#define GLFW_KEY_F11 (GLFW_KEY_SPECIAL+12) +#define GLFW_KEY_F12 (GLFW_KEY_SPECIAL+13) +#define GLFW_KEY_F13 (GLFW_KEY_SPECIAL+14) +#define GLFW_KEY_F14 (GLFW_KEY_SPECIAL+15) +#define GLFW_KEY_F15 (GLFW_KEY_SPECIAL+16) +#define GLFW_KEY_F16 (GLFW_KEY_SPECIAL+17) +#define GLFW_KEY_F17 (GLFW_KEY_SPECIAL+18) +#define GLFW_KEY_F18 (GLFW_KEY_SPECIAL+19) +#define GLFW_KEY_F19 (GLFW_KEY_SPECIAL+20) +#define GLFW_KEY_F20 (GLFW_KEY_SPECIAL+21) +#define GLFW_KEY_F21 (GLFW_KEY_SPECIAL+22) +#define GLFW_KEY_F22 (GLFW_KEY_SPECIAL+23) +#define GLFW_KEY_F23 (GLFW_KEY_SPECIAL+24) +#define GLFW_KEY_F24 (GLFW_KEY_SPECIAL+25) +#define GLFW_KEY_F25 (GLFW_KEY_SPECIAL+26) +#define GLFW_KEY_UP (GLFW_KEY_SPECIAL+27) +#define GLFW_KEY_DOWN (GLFW_KEY_SPECIAL+28) +#define GLFW_KEY_LEFT (GLFW_KEY_SPECIAL+29) +#define GLFW_KEY_RIGHT (GLFW_KEY_SPECIAL+30) +#define GLFW_KEY_LSHIFT (GLFW_KEY_SPECIAL+31) +#define GLFW_KEY_RSHIFT (GLFW_KEY_SPECIAL+32) +#define GLFW_KEY_LCTRL (GLFW_KEY_SPECIAL+33) +#define GLFW_KEY_RCTRL (GLFW_KEY_SPECIAL+34) +#define GLFW_KEY_LALT (GLFW_KEY_SPECIAL+35) +#define GLFW_KEY_RALT (GLFW_KEY_SPECIAL+36) +#define GLFW_KEY_TAB (GLFW_KEY_SPECIAL+37) +#define GLFW_KEY_ENTER (GLFW_KEY_SPECIAL+38) +#define GLFW_KEY_BACKSPACE (GLFW_KEY_SPECIAL+39) +#define GLFW_KEY_INSERT (GLFW_KEY_SPECIAL+40) +#define GLFW_KEY_DEL (GLFW_KEY_SPECIAL+41) +#define GLFW_KEY_PAGEUP (GLFW_KEY_SPECIAL+42) +#define GLFW_KEY_PAGEDOWN (GLFW_KEY_SPECIAL+43) +#define GLFW_KEY_HOME (GLFW_KEY_SPECIAL+44) +#define GLFW_KEY_END (GLFW_KEY_SPECIAL+45) +#define GLFW_KEY_KP_0 (GLFW_KEY_SPECIAL+46) +#define GLFW_KEY_KP_1 (GLFW_KEY_SPECIAL+47) +#define GLFW_KEY_KP_2 (GLFW_KEY_SPECIAL+48) +#define GLFW_KEY_KP_3 (GLFW_KEY_SPECIAL+49) +#define GLFW_KEY_KP_4 (GLFW_KEY_SPECIAL+50) +#define GLFW_KEY_KP_5 (GLFW_KEY_SPECIAL+51) +#define GLFW_KEY_KP_6 (GLFW_KEY_SPECIAL+52) +#define GLFW_KEY_KP_7 (GLFW_KEY_SPECIAL+53) +#define GLFW_KEY_KP_8 (GLFW_KEY_SPECIAL+54) +#define GLFW_KEY_KP_9 (GLFW_KEY_SPECIAL+55) +#define GLFW_KEY_KP_DIVIDE (GLFW_KEY_SPECIAL+56) +#define GLFW_KEY_KP_MULTIPLY (GLFW_KEY_SPECIAL+57) +#define GLFW_KEY_KP_SUBTRACT (GLFW_KEY_SPECIAL+58) +#define GLFW_KEY_KP_ADD (GLFW_KEY_SPECIAL+59) +#define GLFW_KEY_KP_DECIMAL (GLFW_KEY_SPECIAL+60) +#define GLFW_KEY_KP_EQUAL (GLFW_KEY_SPECIAL+61) +#define GLFW_KEY_KP_ENTER (GLFW_KEY_SPECIAL+62) +#define GLFW_KEY_KP_NUM_LOCK (GLFW_KEY_SPECIAL+63) +#define GLFW_KEY_CAPS_LOCK (GLFW_KEY_SPECIAL+64) +#define GLFW_KEY_SCROLL_LOCK (GLFW_KEY_SPECIAL+65) +#define GLFW_KEY_PAUSE (GLFW_KEY_SPECIAL+66) +#define GLFW_KEY_LSUPER (GLFW_KEY_SPECIAL+67) +#define GLFW_KEY_RSUPER (GLFW_KEY_SPECIAL+68) +#define GLFW_KEY_MENU (GLFW_KEY_SPECIAL+69) +#define GLFW_KEY_LAST GLFW_KEY_MENU + +/* Mouse button definitions */ +#define GLFW_MOUSE_BUTTON_1 0 +#define GLFW_MOUSE_BUTTON_2 1 +#define GLFW_MOUSE_BUTTON_3 2 +#define GLFW_MOUSE_BUTTON_4 3 +#define GLFW_MOUSE_BUTTON_5 4 +#define GLFW_MOUSE_BUTTON_6 5 +#define GLFW_MOUSE_BUTTON_7 6 +#define GLFW_MOUSE_BUTTON_8 7 +#define GLFW_MOUSE_BUTTON_LAST GLFW_MOUSE_BUTTON_8 + +/* Mouse button aliases */ +#define GLFW_MOUSE_BUTTON_LEFT GLFW_MOUSE_BUTTON_1 +#define GLFW_MOUSE_BUTTON_RIGHT GLFW_MOUSE_BUTTON_2 +#define GLFW_MOUSE_BUTTON_MIDDLE GLFW_MOUSE_BUTTON_3 + + +/* Joystick identifiers */ +#define GLFW_JOYSTICK_1 0 +#define GLFW_JOYSTICK_2 1 +#define GLFW_JOYSTICK_3 2 +#define GLFW_JOYSTICK_4 3 +#define GLFW_JOYSTICK_5 4 +#define GLFW_JOYSTICK_6 5 +#define GLFW_JOYSTICK_7 6 +#define GLFW_JOYSTICK_8 7 +#define GLFW_JOYSTICK_9 8 +#define GLFW_JOYSTICK_10 9 +#define GLFW_JOYSTICK_11 10 +#define GLFW_JOYSTICK_12 11 +#define GLFW_JOYSTICK_13 12 +#define GLFW_JOYSTICK_14 13 +#define GLFW_JOYSTICK_15 14 +#define GLFW_JOYSTICK_16 15 +#define GLFW_JOYSTICK_LAST GLFW_JOYSTICK_16 + + +/************************************************************************* + * Other definitions + *************************************************************************/ + +/* glfwOpenWindow modes */ +#define GLFW_WINDOW 0x00010001 +#define GLFW_FULLSCREEN 0x00010002 + +/* glfwGetWindowParam tokens */ +#define GLFW_OPENED 0x00020001 +#define GLFW_ACTIVE 0x00020002 +#define GLFW_ICONIFIED 0x00020003 +#define GLFW_ACCELERATED 0x00020004 +#define GLFW_RED_BITS 0x00020005 +#define GLFW_GREEN_BITS 0x00020006 +#define GLFW_BLUE_BITS 0x00020007 +#define GLFW_ALPHA_BITS 0x00020008 +#define GLFW_DEPTH_BITS 0x00020009 +#define GLFW_STENCIL_BITS 0x0002000A + +/* The following constants are used for both glfwGetWindowParam + * and glfwOpenWindowHint + */ +#define GLFW_REFRESH_RATE 0x0002000B +#define GLFW_ACCUM_RED_BITS 0x0002000C +#define GLFW_ACCUM_GREEN_BITS 0x0002000D +#define GLFW_ACCUM_BLUE_BITS 0x0002000E +#define GLFW_ACCUM_ALPHA_BITS 0x0002000F +#define GLFW_AUX_BUFFERS 0x00020010 +#define GLFW_STEREO 0x00020011 +#define GLFW_WINDOW_NO_RESIZE 0x00020012 +#define GLFW_FSAA_SAMPLES 0x00020013 +#define GLFW_OPENGL_VERSION_MAJOR 0x00020014 +#define GLFW_OPENGL_VERSION_MINOR 0x00020015 +#define GLFW_OPENGL_FORWARD_COMPAT 0x00020016 +#define GLFW_OPENGL_DEBUG_CONTEXT 0x00020017 +#define GLFW_OPENGL_PROFILE 0x00020018 + +/* GLFW_OPENGL_PROFILE tokens */ +#define GLFW_OPENGL_CORE_PROFILE 0x00050001 +#define GLFW_OPENGL_COMPAT_PROFILE 0x00050002 + +/* glfwEnable/glfwDisable tokens */ +#define GLFW_MOUSE_CURSOR 0x00030001 +#define GLFW_STICKY_KEYS 0x00030002 +#define GLFW_STICKY_MOUSE_BUTTONS 0x00030003 +#define GLFW_SYSTEM_KEYS 0x00030004 +#define GLFW_KEY_REPEAT 0x00030005 +#define GLFW_AUTO_POLL_EVENTS 0x00030006 + +/* glfwWaitThread wait modes */ +#define GLFW_WAIT 0x00040001 +#define GLFW_NOWAIT 0x00040002 + +/* glfwGetJoystickParam tokens */ +#define GLFW_PRESENT 0x00050001 +#define GLFW_AXES 0x00050002 +#define GLFW_BUTTONS 0x00050003 + +/* glfwReadImage/glfwLoadTexture2D flags */ +#define GLFW_NO_RESCALE_BIT 0x00000001 /* Only for glfwReadImage */ +#define GLFW_ORIGIN_UL_BIT 0x00000002 +#define GLFW_BUILD_MIPMAPS_BIT 0x00000004 /* Only for glfwLoadTexture2D */ +#define GLFW_ALPHA_MAP_BIT 0x00000008 + +/* Time spans longer than this (seconds) are considered to be infinity */ +#define GLFW_INFINITY 100000.0 + + +/************************************************************************* + * Typedefs + *************************************************************************/ + +/* The video mode structure used by glfwGetVideoModes() */ +typedef struct { + int Width, Height; + int RedBits, BlueBits, GreenBits; +} GLFWvidmode; + +/* Image/texture information */ +typedef struct { + int Width, Height; + int Format; + int BytesPerPixel; + unsigned char *Data; +} GLFWimage; + +/* Thread ID */ +typedef int GLFWthread; + +/* Mutex object */ +typedef void * GLFWmutex; + +/* Condition variable object */ +typedef void * GLFWcond; + +/* Function pointer types */ +typedef void (GLFWCALL * GLFWwindowsizefun)(int,int); +typedef int (GLFWCALL * GLFWwindowclosefun)(void); +typedef void (GLFWCALL * GLFWwindowrefreshfun)(void); +typedef void (GLFWCALL * GLFWmousebuttonfun)(int,int); +typedef void (GLFWCALL * GLFWmouseposfun)(int,int); +typedef void (GLFWCALL * GLFWmousewheelfun)(int); +typedef void (GLFWCALL * GLFWkeyfun)(int,int); +typedef void (GLFWCALL * GLFWcharfun)(int,int); +typedef void (GLFWCALL * GLFWthreadfun)(void *); + + +/************************************************************************* + * Prototypes + *************************************************************************/ + +/* GLFW initialization, termination and version querying */ +GLFWAPI int GLFWAPIENTRY glfwInit( void ); +GLFWAPI void GLFWAPIENTRY glfwTerminate( void ); +GLFWAPI void GLFWAPIENTRY glfwGetVersion( int *major, int *minor, int *rev ); + +/* Window handling */ +GLFWAPI int GLFWAPIENTRY glfwOpenWindow( int width, int height, int redbits, int greenbits, int bluebits, int alphabits, int depthbits, int stencilbits, int mode ); +GLFWAPI void GLFWAPIENTRY glfwOpenWindowHint( int target, int hint ); +GLFWAPI void GLFWAPIENTRY glfwCloseWindow( void ); +GLFWAPI void GLFWAPIENTRY glfwSetWindowTitle( const char *title ); +GLFWAPI void GLFWAPIENTRY glfwGetWindowSize( int *width, int *height ); +GLFWAPI void GLFWAPIENTRY glfwSetWindowSize( int width, int height ); +GLFWAPI void GLFWAPIENTRY glfwSetWindowPos( int x, int y ); +GLFWAPI void GLFWAPIENTRY glfwIconifyWindow( void ); +GLFWAPI void GLFWAPIENTRY glfwRestoreWindow( void ); +GLFWAPI void GLFWAPIENTRY glfwSwapBuffers( void ); +GLFWAPI void GLFWAPIENTRY glfwSwapInterval( int interval ); +GLFWAPI int GLFWAPIENTRY glfwGetWindowParam( int param ); +GLFWAPI void GLFWAPIENTRY glfwSetWindowSizeCallback( GLFWwindowsizefun cbfun ); +GLFWAPI void GLFWAPIENTRY glfwSetWindowCloseCallback( GLFWwindowclosefun cbfun ); +GLFWAPI void GLFWAPIENTRY glfwSetWindowRefreshCallback( GLFWwindowrefreshfun cbfun ); + +/* Video mode functions */ +GLFWAPI int GLFWAPIENTRY glfwGetVideoModes( GLFWvidmode *list, int maxcount ); +GLFWAPI void GLFWAPIENTRY glfwGetDesktopMode( GLFWvidmode *mode ); + +/* Input handling */ +GLFWAPI void GLFWAPIENTRY glfwPollEvents( void ); +GLFWAPI void GLFWAPIENTRY glfwWaitEvents( void ); +GLFWAPI int GLFWAPIENTRY glfwGetKey( int key ); +GLFWAPI int GLFWAPIENTRY glfwGetMouseButton( int button ); +GLFWAPI void GLFWAPIENTRY glfwGetMousePos( int *xpos, int *ypos ); +GLFWAPI void GLFWAPIENTRY glfwSetMousePos( int xpos, int ypos ); +GLFWAPI int GLFWAPIENTRY glfwGetMouseWheel( void ); +GLFWAPI void GLFWAPIENTRY glfwSetMouseWheel( int pos ); +GLFWAPI void GLFWAPIENTRY glfwSetKeyCallback( GLFWkeyfun cbfun ); +GLFWAPI void GLFWAPIENTRY glfwSetCharCallback( GLFWcharfun cbfun ); +GLFWAPI void GLFWAPIENTRY glfwSetMouseButtonCallback( GLFWmousebuttonfun cbfun ); +GLFWAPI void GLFWAPIENTRY glfwSetMousePosCallback( GLFWmouseposfun cbfun ); +GLFWAPI void GLFWAPIENTRY glfwSetMouseWheelCallback( GLFWmousewheelfun cbfun ); + +/* Joystick input */ +GLFWAPI int GLFWAPIENTRY glfwGetJoystickParam( int joy, int param ); +GLFWAPI int GLFWAPIENTRY glfwGetJoystickPos( int joy, float *pos, int numaxes ); +GLFWAPI int GLFWAPIENTRY glfwGetJoystickButtons( int joy, unsigned char *buttons, int numbuttons ); + +/* Time */ +GLFWAPI double GLFWAPIENTRY glfwGetTime( void ); +GLFWAPI void GLFWAPIENTRY glfwSetTime( double time ); +GLFWAPI void GLFWAPIENTRY glfwSleep( double time ); + +/* Extension support */ +GLFWAPI int GLFWAPIENTRY glfwExtensionSupported( const char *extension ); +GLFWAPI void* GLFWAPIENTRY glfwGetProcAddress( const char *procname ); +GLFWAPI void GLFWAPIENTRY glfwGetGLVersion( int *major, int *minor, int *rev ); + +/* Threading support */ +GLFWAPI GLFWthread GLFWAPIENTRY glfwCreateThread( GLFWthreadfun fun, void *arg ); +GLFWAPI void GLFWAPIENTRY glfwDestroyThread( GLFWthread ID ); +GLFWAPI int GLFWAPIENTRY glfwWaitThread( GLFWthread ID, int waitmode ); +GLFWAPI GLFWthread GLFWAPIENTRY glfwGetThreadID( void ); +GLFWAPI GLFWmutex GLFWAPIENTRY glfwCreateMutex( void ); +GLFWAPI void GLFWAPIENTRY glfwDestroyMutex( GLFWmutex mutex ); +GLFWAPI void GLFWAPIENTRY glfwLockMutex( GLFWmutex mutex ); +GLFWAPI void GLFWAPIENTRY glfwUnlockMutex( GLFWmutex mutex ); +GLFWAPI GLFWcond GLFWAPIENTRY glfwCreateCond( void ); +GLFWAPI void GLFWAPIENTRY glfwDestroyCond( GLFWcond cond ); +GLFWAPI void GLFWAPIENTRY glfwWaitCond( GLFWcond cond, GLFWmutex mutex, double timeout ); +GLFWAPI void GLFWAPIENTRY glfwSignalCond( GLFWcond cond ); +GLFWAPI void GLFWAPIENTRY glfwBroadcastCond( GLFWcond cond ); +GLFWAPI int GLFWAPIENTRY glfwGetNumberOfProcessors( void ); + +/* Enable/disable functions */ +GLFWAPI void GLFWAPIENTRY glfwEnable( int token ); +GLFWAPI void GLFWAPIENTRY glfwDisable( int token ); + +/* Image/texture I/O support */ +GLFWAPI int GLFWAPIENTRY glfwReadImage( const char *name, GLFWimage *img, int flags ); +GLFWAPI int GLFWAPIENTRY glfwReadMemoryImage( const void *data, long size, GLFWimage *img, int flags ); +GLFWAPI void GLFWAPIENTRY glfwFreeImage( GLFWimage *img ); +GLFWAPI int GLFWAPIENTRY glfwLoadTexture2D( const char *name, int flags ); +GLFWAPI int GLFWAPIENTRY glfwLoadMemoryTexture2D( const void *data, long size, int flags ); +GLFWAPI int GLFWAPIENTRY glfwLoadTextureImage2D( GLFWimage *img, int flags ); + + +#ifdef __cplusplus +} +#endif + +#endif /* __glfw_h_ */ + diff --git a/external/Chipmunk/msvc/glfw/lib-msvc100/GLFW.dll b/external/Chipmunk/msvc/glfw/lib-msvc100/GLFW.dll new file mode 100644 index 0000000..09e643b Binary files /dev/null and b/external/Chipmunk/msvc/glfw/lib-msvc100/GLFW.dll differ diff --git a/external/Chipmunk/msvc/glfw/lib-msvc100/GLFW.lib b/external/Chipmunk/msvc/glfw/lib-msvc100/GLFW.lib new file mode 100644 index 0000000..6040f43 Binary files /dev/null and b/external/Chipmunk/msvc/glfw/lib-msvc100/GLFW.lib differ diff --git a/external/Chipmunk/msvc/glfw/lib-msvc100/GLFWDLL.lib b/external/Chipmunk/msvc/glfw/lib-msvc100/GLFWDLL.lib new file mode 100644 index 0000000..c19954a Binary files /dev/null and b/external/Chipmunk/msvc/glfw/lib-msvc100/GLFWDLL.lib differ diff --git a/external/Chipmunk/msvc/glfw/readme.html b/external/Chipmunk/msvc/glfw/readme.html new file mode 100644 index 0000000..08499dd --- /dev/null +++ b/external/Chipmunk/msvc/glfw/readme.html @@ -0,0 +1,465 @@ + + + + + GLFW Readme File + + + + +

    GLFW 2.7.9 Win32 binary distribution

    + +
      +
    1. Introduction
    2. +
    3. Using GLFW
    4. +
    5. Version history
    6. +
    7. Directory structure of the GLFW distribution
    8. +
    9. Contacting the project
    10. +
    11. Acknowledgements
    12. +
    + + +

    1. Introduction

    + +

    Welcome to version 2.7.9 of the GLFW library. GLFW is a free, Open Source, +multi-platform library for OpenGL application development that provides a +powerful API for handling operating system specific tasks such as opening an +OpenGL window, reading keyboard, mouse, joystick and time input, creating +threads, and more.

    + +

    GLFW 2.7 is expected to be the last major release of the 2.x series, with +most development now being done on what will become version 3.0.

    + +

    This release adds fixes for multiple cursor motion bugs on Windows and fixes +support for the LFLAGS environment variable on OS X.

    + +

    For a full list of changes, see the +version history.

    + +

    Please note that this is the Windows 32-bit binary only distribution +of GLFW. It contains static, dynamic and link libraries built with and using +the runtimes of a number of common Windows compilers. More specifically, it +contains files for the following compilers:

    + +
      +
    • MinGW
    • +
    • Visual C++ 2008 (release runtime)
    • +
    • Visual C++ 2010 (release runtime)
    • +
    • Visual C++ 2012 (release runtime)
    • +
    + +

    For the full source distribition, go to the +GLFW website or to the +project page on SF.net.

    + + + +

    2. Using GLFW

    + +

    There are two aspects to using GLFW:

    + +
      +
    1. How does the GLFW API work
    2. +
    3. How to compile programs that use GLFW
    4. +
    + +

    The first point is covered in the +GLFW Users Guide and the +GLFW Reference Manual, and we suggest that you +read at least the Users Guide, since it's a good introduction to the GLFW +API.

    + +

    Designing and compiling programs that use GLFW is not very difficult. +A few rules for successfully designing GLFW-based programs are presented +in the following sections.

    + +

    2.1 Include the GLFW header file

    + +

    In the files of your program where you use OpenGL or GLFW, you should +include the GL/glfw.h header file, i.e.:

    + +
    #include <GL/glfw.h>
    + +

    This defines all the constants, types and function prototypes of the GLFW +API. It also includes the OpenGL and GLU header files, and defines all the +necessary constants and types that are necessary for these headers to work on +that particular platform.

    + +

    For example, under Microsoft Windows you are normally required to include +windows.h before you include GL/gl.h. This would +however make your code dependent on the Windows platform, or at least require +your program to check which platform it is being compiled on.

    + +

    The GLFW header file takes care of this for you, not by including +windows.h, but rather by itself duplicating the necessary parts of +it. This way, the namespace won't be cluttered by the entire Windows API.

    + +

    By default, the regular gl.h OpenGL header is included. If you +wish to include the draft gl3.h header instead, define +GLFW_INCLUDE_GL3 before the inclusion of the GLFW header.

    + +

    By default, the glu.h GLU header is included. If you wish to +avoid this, define GLFW_NO_GLU before the inclusion of the GLFW +header.

    + +

    In other words: +

      +
    • Do not include gl.h or glu.h + yourself, as GLFW does this for you
    • +
    • Do not include windows.h unless you need + direct access to the Windows API
    • +
    • If you do include windows.h, do it + before including GL/glfw.h. The GLFW header will + detect this and act appropriately.
    • +
    + +

    Also note that if you are using an OpenGL extension loading library such as +GLEW, you should include the GLEW +header before the GLFW one. The GLEW header defines macros that +disable any gl.h that the GLFW header includes and GLEW will work +as expected.

    + + + +

    2.2 Link with the right libraries

    + +

    2.2.1 Windows static library

    + +

    If you link with the static version of GLFW, it is also necessary to +link with some system libraries that GLFW uses.

    + +

    When linking a program under Windows that uses the static version of GLFW, +you must also link with the following libraries: opengl32, +user32 and kernel32. Some of these libraries may be +linked with by default by your compiler. In the table below you can see the +minimum required link options for each supported Windows compiler (you may want +to add other libraries as well, such as glu32):

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    CompilerLink options
    Borland C++ Builderglfw.lib opengl32.lib
    CygwinSee Unix static library below
    LCC-Win32glfw.lib opengl32.lib
    Microsoft Visual C++glfw.lib opengl32.lib
    MinGW and MinGW-w64-lglfw -lopengl32
    OpenWatcomglfw.lib opengl32.lib user32.lib
    + + +

    2.2.2 Windows DLL

    + +

    To compile a program that uses the DLL version of GLFW, you need to +define the GLFW_DLL constant. This can either be done with a +compiler switch, typically by adding -DGLFW_DLL to the list of +compiler options. You can also do it by adding the following line to all your +source files before including the GLFW header file:

    + +
    #define GLFW_DLL
    + +

    When linking a program under Windows that uses the DLL version of GLFW, +the only library you need to link with for GLFW to work is glfwdll. +In the table below you can see the minimum required link options for each +supported Windows compiler (you may want to add other libraries as well, +such as opengl32 and glu32):

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    CompilerLink options
    Borland C++ Builderglfwdll.lib
    Cygwin-lglfwdll
    LCC-Win32glfwdll.lib
    Microsoft Visual C++glfwdll.lib
    MinGW and MinGW-w64-lglfwdll
    OpenWatcomglfwdll.lib
    + + + +

    2.2.3 Unix static library

    + +

    GLFW supports +pkg-config, +and a libglfw.pc file is generated and installed when you install +the library. For systems that do not provide pkg-config, you should look in +this file for the proper compile and link flags for your system, as determined +by compile.sh at compile time.

    + +

    A typical compile and link command-line when using the GLFW static library +may look like this:

    + +
    cc `pkg-config --cflags libglfw` -o myprog myprog.c `pkg-config --static --libs libglfw`
    + +

    When using the GLFW sharedd library it may look like this:

    + +
    cc `pkg-config --cflags libglfw` -o myprog myprog.c `pkg-config --libs libglfw`
    + +

    If you use GLU functions in your program you should also add +-lGLU to your link flags.

    + + + +

    2.2.5 Mac OS X static library

    + +

    When compiling and linking a program under Mac OS X that uses GLFW, you +must also link with Cocoa and OpenGL frameworks. + +

    If you are using Xcode, you simply add the GLFW library libglfw.a and +these frameworks to your project. If, however, you are building your program +from the command-line, there are two methods for correctly linking your GLFW +program.

    + +

    GLFW supports +pkg-config, and a +libglfw.pc file is generated and installed when you install the library. You +can find pkg-config in most packaging systems, such as +Fink and +MacPorts, so if you have one of them +installed, simply install pkg-config. Once you have pkg-config available, the +command-line for compiling and linking your program is:

    + +
    cc `pkg-config --cflags libglfw` -o myprog myprog.c `pkg-config --libs libglfw`
    + +

    If you do not wish to use pkg-config, you will need to add the required +frameworks and libraries to your command-line using the -l and +-framework switches, i.e.:

    + +
    cc -o myprog myprog.c -lglfw -framework Cocoa -framework OpenGL -framework IOKit
    + +

    Note that you do not add the .framework extension to a framework when adding +it from the command-line.

    + +

    These frameworks contain all OpenGL and GLU functions, so there is no need to +add additional libraries or frameworks when using GLU functionality. Also note +that even though your machine may have Unix-style OpenGL libraries, they are for +use with the X Window System, and will not work with the Mac OS X native +version of GLFW.

    + + +

    3. Version history

    + +

    v2.7.9

    +
      +
    • [Cocoa] Bugfix: The dynamic library makefile rule did not use LFLAGS
    • +
    • [Win32] Bugfix: Enabling or disabling the cursor for an inactive window did nothing (backported from 3.0)
    • +
    • [Win32] Bugfix: The locked cursor was re-centered when the window was inactive (backported from 3.0)
    • +
    • [Win32] Bugfix: The cursor clip rectangle included the title bar (backported from 3.0)
    • +
    + + + +

    4. Directory structure of the GLFW distribution

    + +

    Here is an overview of the directory structure of the GLFW distribution:

    + + + + + + + + + +
    docsGLFW manuals in PDF format
    include 
       GLThe GLFW C/C++ include file
    lib-mingwBinaries for MinGW
    lib-msvc90Binaries for Visual C++ 2008 release configuration
    lib-msvc100Binaries for Visual C++ 2010 release configuration
    lib-msvc110Binaries for Visual C++ 2012 release configuration
    + + + +

    5. Contacting the project

    + +

    The official website for GLFW is glfw.org. +It contains the latest version of GLFW, news and other information that is +useful for OpenGL development.

    + +

    If you have questions related to the use of GLFW, we have a +user's web forum, +and the registered IRC channel #glfw on +Freenode.

    + +

    If you have a bug to report, a patch to submit or a feature you'd like to +request, please file an issue in the +issue trackers.

    + +Finally, if you're interested in helping out with the development of +GLFW or porting it to your favorite platform, we have a +developer's mailing list, +or you could join us on #glfw. + + + +

    6. Acknowledgements

    + +

    GLFW exists because people around the world donated their time and lent +their skills. Special thanks go out to:

    + +
      + +
    • artblanc, for a patch replacing a deprecated Core Graphics call
    • + +
    • Bobyshev Alexander and Martins Mozeiko, for the original proposal of + an FSAA hint and their work on the Win32 implementation of FSAA
    • + +
    • Keith Bauer, for his invaluable help with porting and maintaining GLFW on + Mac OS X, and for his many ideas
    • + +
    • Jarrod Davis, for the Delphi port of GLFW
    • + +
    • Olivier Delannoy, for the initial implementation of FSAA support on + X11, cross-compiling support for MinGW and general extreme usefulness
    • + +
    • Paul R. Deppe, who helped with Cygwin support, and made an + adaption of PLIB + so that it can use GLFW (instead of GLUT)
    • + +
    • Jonathan Dummer, for submitting a patch fixing an input bug on Win32 and + adding logic for the GLFW_ICON resource
    • + +
    • Gerald Franz, who made GLFW compile under IRIX, and supplied patches + for the X11 keyboard translation routine
    • + +
    • Marcus Geelnard, the original author and long-time maintainer of GLFW, + without whose brilliant work none of this would have happened
    • + +
    • Stefan Gustavson, for quick and thorough testing of GLFW on many and + varied operating systems and hardware configurations
    • + +
    • Sylvain Hellegouarch, for support, bug reports and testing
    • + +
    • Alex Holkner, for writing the code from which the Compiz/Intel fix was + stolen
    • + +
    • Toni Jovanoski, for helping with the MASM32 port of GLFW, and + supplying the example program and fixed OpenGL and GLU bindings for + MASM32
    • + +
    • Cameron King, for reporting a hidden cursor mouse bug on X11
    • + +
    • Peter Knut, for his many and detailed reports of difficult to find input + bugs
    • + +
    • Robin Leffmann, for his work on Mac OS X and other platforms, and his + invaluable support
    • + +
    • Glenn Lewis, for helping out with support for the D programming + language
    • + +
    • Shane Liesegang, for providing a bug fix relating to Cocoa window + restoration and reporting several Cocoa bugs
    • + +
    • Tristam MacDonald, for his bug reports and feedback on the Cocoa port
    • + +
    • David Medlock, for doing the initial Lua port
    • + +
    • Kenneth Miller, for his many and detailed bug reports on Win32
    • + +
    • Jeff Molofee, the author of the excellent OpenGL tutorials at NeHe Productions. + Much of the Windows code of GLFW was originally based on Jeff's + code
    • + +
    • Douglas C. Schmidt and Irfan Pyarali, for their excellent article + Strategies for Implementing POSIX Condition Variables on Win32
    • + +
    • Sebastian Schuberth, for the OpenWatcom makefiles
    • + +
    • Matt Sealey, for helping with the MorphOS port
    • + +
    • Steve Sexton, for reporting an input bug in the Carbon port
    • + +
    • Dmitri Shuralyov, for support, bug reports, bug fixes and testing
    • + +
    • Daniel Skorupski, for reporting a bug in the Win32 DEF file
    • + +
    • Bradley Smith, for his updates of the D support and his ports of the + remaining examples to the D language
    • + +
    • Julian Squires, for submitting a patch for a bug in the key repeat logic on X11
    • + +
    • Liam Staskawicz, for finding a bug in the termination logic of the OS X port
    • + +
    • Johannes Stein, for maintaining the Pascal bindings
    • + +
    • Cort Stratton, for reporting two bugs related to the creation of debug + contexts
    • + +
    • Sergey Tikhomirov, for the initial implementation of joystick support on + Mac OS X
    • + +
    • Samuli Tuomola, for support, bug reports and testing
    • + +
    • Frank Wille, for helping with the AmigaOS port and making GLFW + compile under IRIX 5.3
    • + +
    • Yaniel, for fixing a bug with fullscreen windows using OpenGL 3.0 contexts on Cocoa
    • + +
    • Santi Zupancic, for support, bug reports and testing
    • + +
    • Lasse Öörni, for submitting patches for the input code of the Win32 and X11 ports
    • + +
    • Дмитри Малышев, for the idea of a GLFW_NO_GLU macro
    • + +
    • blanco, for submitting a patch for a deprecation bug in the Cocoa port
    • + +
    • heromyth, for reporting a bug in the D bindings
    • + +
    • Ozzy @ Orkysquad, + for his dedication to GLFW, for debugging my source, and for his + valuable experience with game development
    • + +
    • Peoro, for reporting a bug in the _NET_WM_PING response
    • + +
    • TTK-Bandit, for submitting a number of input patches adding many missing + keys to the Win32 and X11 ports
    • + +
    • yuriks, for reporting a bug in Win32 context creation
    • + +
    • All the unmentioned and anonymous contributors in the GLFW community, for + bug reports, patches, feedback and encouragement
    • + +
    • OpenGL.org, and all the people on + the discussion forums there that have provided help during the development of + GLFW
    • + +
    + + + diff --git a/external/Chipmunk/msvc/readme.txt b/external/Chipmunk/msvc/readme.txt new file mode 100644 index 0000000..bf5d458 --- /dev/null +++ b/external/Chipmunk/msvc/readme.txt @@ -0,0 +1,17 @@ +This subdirectory contains project and solution files for building the Chipmunk +Physics library and its demo suite with Microsoft Visual C++ 2010. + +The demo suite uses the external GLUT (OpenGL Utility Toolkit) library, +included in the glut subdirectory. + +Here's how the Chipmunk and C runtime libraries are linked for each of the +available configurations: + + Chipmunk C Runtime + + Debug Static Dynamic + Debug DLL Dynamic Dynamic + Debug SCRT Static Static + Release Static Dynamic + Release DLL Dynamic Dynamic + Release SCRT Static Static diff --git a/external/Chipmunk/msvc/vc10/chipmunk/chipmunk.def b/external/Chipmunk/msvc/vc10/chipmunk/chipmunk.def new file mode 100644 index 0000000..38d79db --- /dev/null +++ b/external/Chipmunk/msvc/vc10/chipmunk/chipmunk.def @@ -0,0 +1,171 @@ +LIBRARY chipmunk +EXPORTS + + cpArbiterGetContactPointSet + cpArbiterGetCount + cpArbiterGetDepth + cpArbiterGetNormal + cpArbiterGetPoint + cpArbiterIgnore + cpArbiterIsFirstContact + cpArbiterTotalImpulse + cpArbiterTotalImpulseWithFriction + cpArbiterTotalKE + + cpAreaForPoly + + cpBBTreeAlloc + cpBBTreeInit + cpBBTreeNew + cpBBTreeOptimize + cpBBTreeSetVelocityFunc + + cpBBWrapVect + + cpBodyActivate + cpBodyActivateStatic + cpBodyAlloc + cpBodyDestroy + cpBodyEachArbiter + cpBodyFree + cpBodyGetVelAtWorldPoint + cpBodyInit + cpBodyInitStatic + cpBodyNew + cpBodyNewStatic + cpBodySanityCheck + cpBodySetAngle + cpBodySetMass + cpBodySetMoment + cpBodySetPos + cpBodySleep + cpBodySleepWithGroup + cpBodyUpdatePosition + cpBodyUpdateVelocity + + cpBoxShapeInit + cpBoxShapeInit2 + cpBoxShapeNew + cpBoxShapeNew2 + + cpCentroidForPoly + + cpCircleShapeAlloc + cpCircleShapeInit + cpCircleShapeNew + + cpConstraintFree + + cpConvexHull + + cpDampedRotarySpringNew + cpDampedSpringGetClass + cpDampedSpringNew + + cpGearJointNew + + cpGrooveJointGetClass + cpGrooveJointNew + + cpMessage + + cpMomentForBox + cpMomentForBox2 + cpMomentForCircle + cpMomentForPoly + cpMomentForSegment + + cpPinJointGetClass + cpPinJointNew + + cpPivotJointGetClass + cpPivotJointNew + cpPivotJointNew2 + + cpPolyShapeAlloc + cpPolyShapeGetNumVerts + cpPolyShapeGetVert + cpPolyShapeInit + cpPolyShapeNew + cpPolyShapeSetVerts + cpPolyValidate + + cpRatchetJointNew + + cpResetShapeIdCounter + + cpRotaryLimitJointNew + + cpSegmentShapeAlloc + cpSegmentShapeInit + cpSegmentShapeNew + cpSegmentShapeSetNeighbors + + cpShapeCacheBB + cpShapeDestroy + cpShapeFree + cpShapeNearestPointQuery + cpShapePointQuery + cpShapeSegmentQuery + cpShapeSetBody + cpShapeUpdate + + cpSimpleMotorGetClass + cpSimpleMotorNew + + cpSlideJointGetClass + cpSlideJointNew + + cpSpaceActivateShapesTouchingShape + cpSpaceAddBody + cpSpaceAddCollisionHandler + cpSpaceAddConstraint + cpSpaceAddPostStepCallback + cpSpaceAddShape + cpSpaceAddStaticShape + cpSpaceAlloc + cpSpaceBBQuery + cpSpaceContainsBody + cpSpaceContainsConstraint + cpSpaceContainsShape + cpSpaceDestroy + cpSpaceEachBody + cpSpaceEachConstraint + cpSpaceEachShape + cpSpaceFree + cpSpaceInit + cpSpaceNearestPointQuery + cpSpaceNearestPointQueryNearest + cpSpaceNew + cpSpacePointQuery + cpSpacePointQueryFirst + cpSpaceReindexShape + cpSpaceReindexShapesForBody + cpSpaceReindexStatic + cpSpaceRemoveBody + cpSpaceRemoveCollisionHandler + cpSpaceRemoveConstraint + cpSpaceRemoveShape + cpSpaceRemoveStaticShape + cpSpaceSegmentQuery + cpSpaceSegmentQueryFirst + cpSpaceSetDefaultCollisionHandler + cpSpaceShapeQuery + cpSpaceStep + cpSpaceUseSpatialHash + + cpSpaceHashAlloc + cpSpaceHashInit + cpSpaceHashNew + cpSpaceHashResize + + cpSpatialIndexCollideStatic + cpSpatialIndexFree + + cpSweep1DAlloc + cpSweep1DInit + cpSweep1DNew + + cpvslerp + cpvslerpconst + cpvstr diff --git a/external/Chipmunk/msvc/vc10/chipmunk/chipmunk.vcxproj b/external/Chipmunk/msvc/vc10/chipmunk/chipmunk.vcxproj new file mode 100644 index 0000000..7ab4f2b --- /dev/null +++ b/external/Chipmunk/msvc/vc10/chipmunk/chipmunk.vcxproj @@ -0,0 +1,263 @@ + + + + + Debug SCRT + Win32 + + + Debug DLL + Win32 + + + Debug + Win32 + + + Release SCRT + Win32 + + + Release DLL + Win32 + + + Release + Win32 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {C1ACE86E-5A14-490A-9678-104BA2546723} + Win32Proj + chipmunk + + + + StaticLibrary + true + + + StaticLibrary + true + + + DynamicLibrary + true + + + StaticLibrary + false + true + + + StaticLibrary + false + true + + + DynamicLibrary + false + true + + + + + + + + + + + + + + + + + + + + + + + + + $(PlatformName)\$(Configuration)\ + $(PlatformName)\$(Configuration)\ + + + $(PlatformName)\$(Configuration)\ + $(PlatformName)\$(Configuration)\ + + + $(PlatformName)\$(Configuration)\ + $(PlatformName)\$(Configuration)\ + + + $(PlatformName)\$(Configuration)\ + $(PlatformName)\$(Configuration)\ + + + $(PlatformName)\$(Configuration)\ + $(PlatformName)\$(Configuration)\ + + + $(PlatformName)\$(Configuration)\ + $(PlatformName)\$(Configuration)\ + + + + Level3 + Disabled + _CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions) + ..\..\..\include\chipmunk + CompileAsCpp + + + Windows + true + + + + + Level3 + Disabled + _CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions) + ..\..\..\include\chipmunk + MultiThreadedDebug + CompileAsCpp + + + Windows + true + + + + + Level3 + Disabled + _CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions) + ..\..\..\include\chipmunk + CompileAsCpp + + + Windows + true + chipmunk.def + + + + + Level3 + MaxSpeed + true + _CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) + ..\..\..\include\chipmunk + CompileAsCpp + + + Windows + true + true + true + + + + + Level3 + MaxSpeed + true + _CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) + ..\..\..\include\chipmunk + MultiThreaded + CompileAsCpp + + + Windows + true + true + true + + + + + Level3 + MaxSpeed + true + _CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) + ..\..\..\include\chipmunk + CompileAsCpp + + + Windows + true + true + true + chipmunk.def + + + + + + \ No newline at end of file diff --git a/external/Chipmunk/msvc/vc10/chipmunk/chipmunk.vcxproj.filters b/external/Chipmunk/msvc/vc10/chipmunk/chipmunk.vcxproj.filters new file mode 100644 index 0000000..403a3dc --- /dev/null +++ b/external/Chipmunk/msvc/vc10/chipmunk/chipmunk.vcxproj.filters @@ -0,0 +1,190 @@ + + + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + + + + + {2af6495e-94a8-4200-8b69-e531cfdb9518} + + + {23a179d1-3a41-426c-8528-edba78d4969c} + + + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include\constraints + + + include\constraints + + + include\constraints + + + include\constraints + + + include\constraints + + + include\constraints + + + include\constraints + + + include\constraints + + + include\constraints + + + include\constraints + + + include\constraints + + + include\constraints + + + src + + + include + + + + + src + + + src + + + src + + + src + + + src + + + src + + + src + + + src + + + src + + + src + + + src + + + src + + + src\constraints + + + src\constraints + + + src\constraints + + + src\constraints + + + src\constraints + + + src\constraints + + + src\constraints + + + src\constraints + + + src\constraints + + + src\constraints + + + src\constraints + + + src + + + src + + + src + + + src + + + src + + + src + + + + + + \ No newline at end of file diff --git a/external/Chipmunk/msvc/vc10/demo/demo.sln b/external/Chipmunk/msvc/vc10/demo/demo.sln new file mode 100644 index 0000000..fd08b64 --- /dev/null +++ b/external/Chipmunk/msvc/vc10/demo/demo.sln @@ -0,0 +1,46 @@ + +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual C++ Express 2010 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "demo", "demo.vcxproj", "{659CE82A-959E-46C0-ACCC-A3BE0A0CB860}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "chipmunk", "..\chipmunk\chipmunk.vcxproj", "{C1ACE86E-5A14-490A-9678-104BA2546723}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug DLL|Win32 = Debug DLL|Win32 + Debug SCRT|Win32 = Debug SCRT|Win32 + Debug|Win32 = Debug|Win32 + Release DLL|Win32 = Release DLL|Win32 + Release SCRT|Win32 = Release SCRT|Win32 + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {659CE82A-959E-46C0-ACCC-A3BE0A0CB860}.Debug DLL|Win32.ActiveCfg = Debug DLL|Win32 + {659CE82A-959E-46C0-ACCC-A3BE0A0CB860}.Debug DLL|Win32.Build.0 = Debug DLL|Win32 + {659CE82A-959E-46C0-ACCC-A3BE0A0CB860}.Debug SCRT|Win32.ActiveCfg = Debug SCRT|Win32 + {659CE82A-959E-46C0-ACCC-A3BE0A0CB860}.Debug SCRT|Win32.Build.0 = Debug SCRT|Win32 + {659CE82A-959E-46C0-ACCC-A3BE0A0CB860}.Debug|Win32.ActiveCfg = Debug|Win32 + {659CE82A-959E-46C0-ACCC-A3BE0A0CB860}.Debug|Win32.Build.0 = Debug|Win32 + {659CE82A-959E-46C0-ACCC-A3BE0A0CB860}.Release DLL|Win32.ActiveCfg = Release DLL|Win32 + {659CE82A-959E-46C0-ACCC-A3BE0A0CB860}.Release DLL|Win32.Build.0 = Release DLL|Win32 + {659CE82A-959E-46C0-ACCC-A3BE0A0CB860}.Release SCRT|Win32.ActiveCfg = Release SCRT|Win32 + {659CE82A-959E-46C0-ACCC-A3BE0A0CB860}.Release SCRT|Win32.Build.0 = Release SCRT|Win32 + {659CE82A-959E-46C0-ACCC-A3BE0A0CB860}.Release|Win32.ActiveCfg = Release|Win32 + {659CE82A-959E-46C0-ACCC-A3BE0A0CB860}.Release|Win32.Build.0 = Release|Win32 + {C1ACE86E-5A14-490A-9678-104BA2546723}.Debug DLL|Win32.ActiveCfg = Debug DLL|Win32 + {C1ACE86E-5A14-490A-9678-104BA2546723}.Debug DLL|Win32.Build.0 = Debug DLL|Win32 + {C1ACE86E-5A14-490A-9678-104BA2546723}.Debug SCRT|Win32.ActiveCfg = Debug SCRT|Win32 + {C1ACE86E-5A14-490A-9678-104BA2546723}.Debug SCRT|Win32.Build.0 = Debug SCRT|Win32 + {C1ACE86E-5A14-490A-9678-104BA2546723}.Debug|Win32.ActiveCfg = Debug|Win32 + {C1ACE86E-5A14-490A-9678-104BA2546723}.Debug|Win32.Build.0 = Debug|Win32 + {C1ACE86E-5A14-490A-9678-104BA2546723}.Release DLL|Win32.ActiveCfg = Release DLL|Win32 + {C1ACE86E-5A14-490A-9678-104BA2546723}.Release DLL|Win32.Build.0 = Release DLL|Win32 + {C1ACE86E-5A14-490A-9678-104BA2546723}.Release SCRT|Win32.ActiveCfg = Release SCRT|Win32 + {C1ACE86E-5A14-490A-9678-104BA2546723}.Release SCRT|Win32.Build.0 = Release SCRT|Win32 + {C1ACE86E-5A14-490A-9678-104BA2546723}.Release|Win32.ActiveCfg = Release|Win32 + {C1ACE86E-5A14-490A-9678-104BA2546723}.Release|Win32.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/external/Chipmunk/msvc/vc10/demo/demo.vcxproj b/external/Chipmunk/msvc/vc10/demo/demo.vcxproj new file mode 100644 index 0000000..a7d8cae --- /dev/null +++ b/external/Chipmunk/msvc/vc10/demo/demo.vcxproj @@ -0,0 +1,232 @@ + + + + + Debug SCRT + Win32 + + + Debug DLL + Win32 + + + Debug + Win32 + + + Release SCRT + Win32 + + + Release DLL + Win32 + + + Release + Win32 + + + + {659CE82A-959E-46C0-ACCC-A3BE0A0CB860} + Win32Proj + demo + + + + true + + + true + + + true + + + false + true + + + false + true + + + false + true + + + + + + + true + $(PlatformName)\$(Configuration)\ + $(PlatformName)\$(Configuration)\ + + + true + $(PlatformName)\$(Configuration)\ + $(PlatformName)\$(Configuration)\ + + + true + $(PlatformName)\$(Configuration)\ + $(PlatformName)\$(Configuration)\ + + + false + $(PlatformName)\$(Configuration)\ + $(PlatformName)\$(Configuration)\ + + + false + $(PlatformName)\$(Configuration)\ + $(PlatformName)\$(Configuration)\ + + + false + $(PlatformName)\$(Configuration)\ + $(PlatformName)\$(Configuration)\ + + + + Level3 + Disabled + _CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + ..\..\..\include\chipmunk;..\..\glew\include;..\..\glfw\include + CompileAsCpp + + + Console + true + ..\..\glut\lib;..\..\glfw\lib-msvc100;..\..\glew\lib\Release\Win32 + glew32.lib;GLFW.lib;OpenGL32.lib;Glu32.lib;%(AdditionalDependencies) + + + + + Level3 + Disabled + _CRT_SECURE_NO_WARNINGS;_USE_MATH_DEFINES;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + ..\..\..\include\chipmunk;..\..\glew\include;..\..\glfw\include + MultiThreadedDebug + CompileAsCpp + + + Console + true + ..\..\glut\lib;..\..\glfw\lib-msvc100;..\..\glew\lib\Release\Win32 + + + + + Level3 + Disabled + _CRT_SECURE_NO_WARNINGS;_USE_MATH_DEFINES;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + ..\..\..\include\chipmunk;..\..\glew\include;..\..\glfw\include + CompileAsCpp + + + Console + true + ..\..\glut\lib;..\..\glfw\lib-msvc100;..\..\glew\lib\Release\Win32 + + + + + Level3 + MaxSpeed + true + _CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + ..\..\..\include\chipmunk;..\..\glew\include;..\..\glfw\include + CompileAsCpp + + + Console + true + true + ..\..\glut\lib;..\..\glfw\lib-msvc100;..\..\glew\lib\Release\Win32 + true + glew32.lib;GLFW.lib;OpenGL32.lib;Glu32.lib;%(AdditionalDependencies) + + + + + + Level3 + MaxSpeed + true + _CRT_SECURE_NO_WARNINGS;_USE_MATH_DEFINES;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + ..\..\..\include\chipmunk;..\..\glew\include;..\..\glfw\include + MultiThreaded + CompileAsCpp + + + Console + true + true + ..\..\glut\lib;..\..\glfw\lib-msvc100;..\..\glew\lib\Release\Win32 + true + + + + + + Level3 + MaxSpeed + true + _CRT_SECURE_NO_WARNINGS;_USE_MATH_DEFINES;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + ..\..\..\include\chipmunk;..\..\glew\include;..\..\glfw\include + CompileAsCpp + + + Console + true + true + ..\..\glut\lib;..\..\glfw\lib-msvc100;..\..\glew\lib\Release\Win32 + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {c1ace86e-5a14-490a-9678-104ba2546723} + + + + + + \ No newline at end of file diff --git a/external/Chipmunk/msvc/vc10/demo/demo.vcxproj.filters b/external/Chipmunk/msvc/vc10/demo/demo.vcxproj.filters new file mode 100644 index 0000000..0badbf9 --- /dev/null +++ b/external/Chipmunk/msvc/vc10/demo/demo.vcxproj.filters @@ -0,0 +1,107 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + + + Header Files + + + Header Files + + + \ No newline at end of file diff --git a/external/Chipmunk/msvc/vc12/chipmunk/chipmunk.def b/external/Chipmunk/msvc/vc12/chipmunk/chipmunk.def new file mode 100644 index 0000000..38d79db --- /dev/null +++ b/external/Chipmunk/msvc/vc12/chipmunk/chipmunk.def @@ -0,0 +1,171 @@ +LIBRARY chipmunk +EXPORTS + + cpArbiterGetContactPointSet + cpArbiterGetCount + cpArbiterGetDepth + cpArbiterGetNormal + cpArbiterGetPoint + cpArbiterIgnore + cpArbiterIsFirstContact + cpArbiterTotalImpulse + cpArbiterTotalImpulseWithFriction + cpArbiterTotalKE + + cpAreaForPoly + + cpBBTreeAlloc + cpBBTreeInit + cpBBTreeNew + cpBBTreeOptimize + cpBBTreeSetVelocityFunc + + cpBBWrapVect + + cpBodyActivate + cpBodyActivateStatic + cpBodyAlloc + cpBodyDestroy + cpBodyEachArbiter + cpBodyFree + cpBodyGetVelAtWorldPoint + cpBodyInit + cpBodyInitStatic + cpBodyNew + cpBodyNewStatic + cpBodySanityCheck + cpBodySetAngle + cpBodySetMass + cpBodySetMoment + cpBodySetPos + cpBodySleep + cpBodySleepWithGroup + cpBodyUpdatePosition + cpBodyUpdateVelocity + + cpBoxShapeInit + cpBoxShapeInit2 + cpBoxShapeNew + cpBoxShapeNew2 + + cpCentroidForPoly + + cpCircleShapeAlloc + cpCircleShapeInit + cpCircleShapeNew + + cpConstraintFree + + cpConvexHull + + cpDampedRotarySpringNew + cpDampedSpringGetClass + cpDampedSpringNew + + cpGearJointNew + + cpGrooveJointGetClass + cpGrooveJointNew + + cpMessage + + cpMomentForBox + cpMomentForBox2 + cpMomentForCircle + cpMomentForPoly + cpMomentForSegment + + cpPinJointGetClass + cpPinJointNew + + cpPivotJointGetClass + cpPivotJointNew + cpPivotJointNew2 + + cpPolyShapeAlloc + cpPolyShapeGetNumVerts + cpPolyShapeGetVert + cpPolyShapeInit + cpPolyShapeNew + cpPolyShapeSetVerts + cpPolyValidate + + cpRatchetJointNew + + cpResetShapeIdCounter + + cpRotaryLimitJointNew + + cpSegmentShapeAlloc + cpSegmentShapeInit + cpSegmentShapeNew + cpSegmentShapeSetNeighbors + + cpShapeCacheBB + cpShapeDestroy + cpShapeFree + cpShapeNearestPointQuery + cpShapePointQuery + cpShapeSegmentQuery + cpShapeSetBody + cpShapeUpdate + + cpSimpleMotorGetClass + cpSimpleMotorNew + + cpSlideJointGetClass + cpSlideJointNew + + cpSpaceActivateShapesTouchingShape + cpSpaceAddBody + cpSpaceAddCollisionHandler + cpSpaceAddConstraint + cpSpaceAddPostStepCallback + cpSpaceAddShape + cpSpaceAddStaticShape + cpSpaceAlloc + cpSpaceBBQuery + cpSpaceContainsBody + cpSpaceContainsConstraint + cpSpaceContainsShape + cpSpaceDestroy + cpSpaceEachBody + cpSpaceEachConstraint + cpSpaceEachShape + cpSpaceFree + cpSpaceInit + cpSpaceNearestPointQuery + cpSpaceNearestPointQueryNearest + cpSpaceNew + cpSpacePointQuery + cpSpacePointQueryFirst + cpSpaceReindexShape + cpSpaceReindexShapesForBody + cpSpaceReindexStatic + cpSpaceRemoveBody + cpSpaceRemoveCollisionHandler + cpSpaceRemoveConstraint + cpSpaceRemoveShape + cpSpaceRemoveStaticShape + cpSpaceSegmentQuery + cpSpaceSegmentQueryFirst + cpSpaceSetDefaultCollisionHandler + cpSpaceShapeQuery + cpSpaceStep + cpSpaceUseSpatialHash + + cpSpaceHashAlloc + cpSpaceHashInit + cpSpaceHashNew + cpSpaceHashResize + + cpSpatialIndexCollideStatic + cpSpatialIndexFree + + cpSweep1DAlloc + cpSweep1DInit + cpSweep1DNew + + cpvslerp + cpvslerpconst + cpvstr diff --git a/external/Chipmunk/msvc/vc12/chipmunk/chipmunk.vcxproj b/external/Chipmunk/msvc/vc12/chipmunk/chipmunk.vcxproj new file mode 100644 index 0000000..8e8dee7 --- /dev/null +++ b/external/Chipmunk/msvc/vc12/chipmunk/chipmunk.vcxproj @@ -0,0 +1,269 @@ + + + + + Debug SCRT + Win32 + + + Debug DLL + Win32 + + + Debug + Win32 + + + Release SCRT + Win32 + + + Release DLL + Win32 + + + Release + Win32 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {C1ACE86E-5A14-490A-9678-104BA2546723} + Win32Proj + chipmunk + + + + StaticLibrary + true + v110 + + + StaticLibrary + true + v110 + + + DynamicLibrary + true + v110 + + + StaticLibrary + false + true + v110 + + + StaticLibrary + false + true + v110 + + + DynamicLibrary + false + true + v110 + + + + + + + + + + + + + + + + + + + + + + + + + $(PlatformName)\$(Configuration)\ + $(PlatformName)\$(Configuration)\ + + + $(PlatformName)\$(Configuration)\ + $(PlatformName)\$(Configuration)\ + + + $(PlatformName)\$(Configuration)\ + $(PlatformName)\$(Configuration)\ + + + $(PlatformName)\$(Configuration)\ + $(PlatformName)\$(Configuration)\ + + + $(PlatformName)\$(Configuration)\ + $(PlatformName)\$(Configuration)\ + + + $(PlatformName)\$(Configuration)\ + $(PlatformName)\$(Configuration)\ + + + + Level3 + Disabled + _CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions) + ..\..\..\include\chipmunk + CompileAsCpp + + + Windows + true + + + + + Level3 + Disabled + _CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions) + ..\..\..\include\chipmunk + MultiThreadedDebug + CompileAsCpp + + + Windows + true + + + + + Level3 + Disabled + _CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions) + ..\..\..\include\chipmunk + CompileAsCpp + + + Windows + true + chipmunk.def + + + + + Level3 + MaxSpeed + true + _CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) + ..\..\..\include\chipmunk + CompileAsCpp + + + Windows + true + true + true + + + + + Level3 + MaxSpeed + true + _CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) + ..\..\..\include\chipmunk + MultiThreaded + CompileAsCpp + + + Windows + true + true + true + + + + + Level3 + MaxSpeed + true + _CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) + ..\..\..\include\chipmunk + CompileAsCpp + + + Windows + true + true + true + chipmunk.def + + + + + + \ No newline at end of file diff --git a/external/Chipmunk/msvc/vc12/chipmunk/chipmunk.vcxproj.filters b/external/Chipmunk/msvc/vc12/chipmunk/chipmunk.vcxproj.filters new file mode 100644 index 0000000..6be6d2a --- /dev/null +++ b/external/Chipmunk/msvc/vc12/chipmunk/chipmunk.vcxproj.filters @@ -0,0 +1,190 @@ + + + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + + + + + {2af6495e-94a8-4200-8b69-e531cfdb9518} + + + {23a179d1-3a41-426c-8528-edba78d4969c} + + + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include\constraints + + + include\constraints + + + include\constraints + + + include\constraints + + + include\constraints + + + include\constraints + + + include\constraints + + + include\constraints + + + include\constraints + + + include\constraints + + + include\constraints + + + include\constraints + + + src + + + include + + + + + src + + + src + + + src + + + src + + + src + + + src + + + src + + + src + + + src + + + src + + + src + + + src + + + src\constraints + + + src\constraints + + + src\constraints + + + src\constraints + + + src\constraints + + + src\constraints + + + src\constraints + + + src\constraints + + + src\constraints + + + src\constraints + + + src\constraints + + + src + + + src + + + src + + + src + + + src + + + src + + + + + + \ No newline at end of file diff --git a/external/Chipmunk/msvc/vc12/demo/demo.sln b/external/Chipmunk/msvc/vc12/demo/demo.sln new file mode 100644 index 0000000..fd08b64 --- /dev/null +++ b/external/Chipmunk/msvc/vc12/demo/demo.sln @@ -0,0 +1,46 @@ + +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual C++ Express 2010 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "demo", "demo.vcxproj", "{659CE82A-959E-46C0-ACCC-A3BE0A0CB860}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "chipmunk", "..\chipmunk\chipmunk.vcxproj", "{C1ACE86E-5A14-490A-9678-104BA2546723}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug DLL|Win32 = Debug DLL|Win32 + Debug SCRT|Win32 = Debug SCRT|Win32 + Debug|Win32 = Debug|Win32 + Release DLL|Win32 = Release DLL|Win32 + Release SCRT|Win32 = Release SCRT|Win32 + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {659CE82A-959E-46C0-ACCC-A3BE0A0CB860}.Debug DLL|Win32.ActiveCfg = Debug DLL|Win32 + {659CE82A-959E-46C0-ACCC-A3BE0A0CB860}.Debug DLL|Win32.Build.0 = Debug DLL|Win32 + {659CE82A-959E-46C0-ACCC-A3BE0A0CB860}.Debug SCRT|Win32.ActiveCfg = Debug SCRT|Win32 + {659CE82A-959E-46C0-ACCC-A3BE0A0CB860}.Debug SCRT|Win32.Build.0 = Debug SCRT|Win32 + {659CE82A-959E-46C0-ACCC-A3BE0A0CB860}.Debug|Win32.ActiveCfg = Debug|Win32 + {659CE82A-959E-46C0-ACCC-A3BE0A0CB860}.Debug|Win32.Build.0 = Debug|Win32 + {659CE82A-959E-46C0-ACCC-A3BE0A0CB860}.Release DLL|Win32.ActiveCfg = Release DLL|Win32 + {659CE82A-959E-46C0-ACCC-A3BE0A0CB860}.Release DLL|Win32.Build.0 = Release DLL|Win32 + {659CE82A-959E-46C0-ACCC-A3BE0A0CB860}.Release SCRT|Win32.ActiveCfg = Release SCRT|Win32 + {659CE82A-959E-46C0-ACCC-A3BE0A0CB860}.Release SCRT|Win32.Build.0 = Release SCRT|Win32 + {659CE82A-959E-46C0-ACCC-A3BE0A0CB860}.Release|Win32.ActiveCfg = Release|Win32 + {659CE82A-959E-46C0-ACCC-A3BE0A0CB860}.Release|Win32.Build.0 = Release|Win32 + {C1ACE86E-5A14-490A-9678-104BA2546723}.Debug DLL|Win32.ActiveCfg = Debug DLL|Win32 + {C1ACE86E-5A14-490A-9678-104BA2546723}.Debug DLL|Win32.Build.0 = Debug DLL|Win32 + {C1ACE86E-5A14-490A-9678-104BA2546723}.Debug SCRT|Win32.ActiveCfg = Debug SCRT|Win32 + {C1ACE86E-5A14-490A-9678-104BA2546723}.Debug SCRT|Win32.Build.0 = Debug SCRT|Win32 + {C1ACE86E-5A14-490A-9678-104BA2546723}.Debug|Win32.ActiveCfg = Debug|Win32 + {C1ACE86E-5A14-490A-9678-104BA2546723}.Debug|Win32.Build.0 = Debug|Win32 + {C1ACE86E-5A14-490A-9678-104BA2546723}.Release DLL|Win32.ActiveCfg = Release DLL|Win32 + {C1ACE86E-5A14-490A-9678-104BA2546723}.Release DLL|Win32.Build.0 = Release DLL|Win32 + {C1ACE86E-5A14-490A-9678-104BA2546723}.Release SCRT|Win32.ActiveCfg = Release SCRT|Win32 + {C1ACE86E-5A14-490A-9678-104BA2546723}.Release SCRT|Win32.Build.0 = Release SCRT|Win32 + {C1ACE86E-5A14-490A-9678-104BA2546723}.Release|Win32.ActiveCfg = Release|Win32 + {C1ACE86E-5A14-490A-9678-104BA2546723}.Release|Win32.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/external/Chipmunk/msvc/vc12/demo/demo.vcxproj b/external/Chipmunk/msvc/vc12/demo/demo.vcxproj new file mode 100644 index 0000000..2e5d1da --- /dev/null +++ b/external/Chipmunk/msvc/vc12/demo/demo.vcxproj @@ -0,0 +1,240 @@ + + + + + Debug SCRT + Win32 + + + Debug DLL + Win32 + + + Debug + Win32 + + + Release SCRT + Win32 + + + Release DLL + Win32 + + + Release + Win32 + + + + {659CE82A-959E-46C0-ACCC-A3BE0A0CB860} + Win32Proj + demo + + + + true + v110 + + + true + v110 + + + true + v110 + + + false + true + v110 + + + false + true + v110 + + + false + true + v110 + + + + + + + true + $(PlatformName)\$(Configuration)\ + $(PlatformName)\$(Configuration)\ + + + true + $(PlatformName)\$(Configuration)\ + $(PlatformName)\$(Configuration)\ + + + true + $(PlatformName)\$(Configuration)\ + $(PlatformName)\$(Configuration)\ + + + false + $(PlatformName)\$(Configuration)\ + $(PlatformName)\$(Configuration)\ + + + false + $(PlatformName)\$(Configuration)\ + $(PlatformName)\$(Configuration)\ + + + false + $(PlatformName)\$(Configuration)\ + $(PlatformName)\$(Configuration)\ + + + + Level3 + Disabled + _CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + ..\..\..\include\chipmunk;..\..\glew\include;..\..\glfw\include + CompileAsCpp + EditAndContinue + EnableFastChecks + + + Console + true + ..\..\glut\lib;..\..\glfw\lib-msvc100;..\..\glew\lib\Release\Win32 + glew32.lib;GLFW.lib;OpenGL32.lib;Glu32.lib;%(AdditionalDependencies) + + + + + Level3 + Disabled + _CRT_SECURE_NO_WARNINGS;_USE_MATH_DEFINES;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + ..\..\..\include\chipmunk;..\..\glew\include;..\..\glfw\include + MultiThreadedDebug + CompileAsCpp + + + Console + true + ..\..\glut\lib;..\..\glfw\lib-msvc100;..\..\glew\lib\Release\Win32 + + + + + Level3 + Disabled + _CRT_SECURE_NO_WARNINGS;_USE_MATH_DEFINES;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + ..\..\..\include\chipmunk;..\..\glew\include;..\..\glfw\include + CompileAsCpp + + + Console + true + ..\..\glut\lib;..\..\glfw\lib-msvc100;..\..\glew\lib\Release\Win32 + + + + + Level3 + MaxSpeed + true + _CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + ..\..\..\include\chipmunk;..\..\glew\include;..\..\glfw\include + CompileAsCpp + + + Console + true + true + ..\..\glut\lib;..\..\glfw\lib-msvc100;..\..\glew\lib\Release\Win32 + true + glew32.lib;GLFW.lib;OpenGL32.lib;Glu32.lib;%(AdditionalDependencies) + + + + + + Level3 + MaxSpeed + true + _CRT_SECURE_NO_WARNINGS;_USE_MATH_DEFINES;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + ..\..\..\include\chipmunk;..\..\glew\include;..\..\glfw\include + MultiThreaded + CompileAsCpp + + + Console + true + true + ..\..\glut\lib;..\..\glfw\lib-msvc100;..\..\glew\lib\Release\Win32 + true + + + + + + Level3 + MaxSpeed + true + _CRT_SECURE_NO_WARNINGS;_USE_MATH_DEFINES;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + ..\..\..\include\chipmunk;..\..\glew\include;..\..\glfw\include + CompileAsCpp + + + Console + true + true + ..\..\glut\lib;..\..\glfw\lib-msvc100;..\..\glew\lib\Release\Win32 + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {c1ace86e-5a14-490a-9678-104ba2546723} + + + + + + \ No newline at end of file diff --git a/external/Chipmunk/msvc/vc12/demo/demo.vcxproj.filters b/external/Chipmunk/msvc/vc12/demo/demo.vcxproj.filters new file mode 100644 index 0000000..0badbf9 --- /dev/null +++ b/external/Chipmunk/msvc/vc12/demo/demo.vcxproj.filters @@ -0,0 +1,107 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + + + Header Files + + + Header Files + + + \ No newline at end of file diff --git a/external/Chipmunk/objectivec/include/ObjectiveChipmunk/ChipmunkBody.h b/external/Chipmunk/objectivec/include/ObjectiveChipmunk/ChipmunkBody.h new file mode 100644 index 0000000..ad588b2 --- /dev/null +++ b/external/Chipmunk/objectivec/include/ObjectiveChipmunk/ChipmunkBody.h @@ -0,0 +1,181 @@ +// Copyright 2013 Howling Moon Software. All rights reserved. +// See http://chipmunk2d.net/legal.php for more information. + +@class ChipmunkShape; +@class ChipmunkConstraint; + +/** + Rigid bodies are the basic unit of simulation in Chipmunk. + They hold the physical properties of an object (mass, position, rotation, velocity, etc.). After creating a ChipmunkBody object, you can attach collision shapes (ChipmunkShape) and joints (ChipmunkConstraint) to it. +*/ +@interface ChipmunkBody : NSObject { +@private + cpBody _body; + id _userData; +} + +/// Get the ChipmunkBody object associciated with a cpBody pointer. +/// Undefined if the cpBody wasn't created using Objective-Chipmunk. ++(ChipmunkBody *)bodyFromCPBody:(cpBody *)body; + +/** + Create an autoreleased rigid body with the given mass and moment. + Guessing the moment of inertia is usually a bad idea. Use the moment estimation functions (cpMomentFor*()). +*/ ++ (id)bodyWithMass:(cpFloat)mass andMoment:(cpFloat)moment; + +/** + Create an autoreleased static body. +*/ ++ (id)staticBody; + +/** + Create an autoreleased kinematic body. +*/ ++ (id)kinematicBody; + +/** + Initialize a rigid body with the given mass and moment of inertia. + Guessing the moment of inertia is usually a bad idea. Use the moment estimation functions (cpMomentFor*()). +*/ +- (id)initWithMass:(cpFloat)mass andMoment:(cpFloat)moment; + +/// Type of the body (dynamic, kinematic, static). +@property(nonatomic, assign) cpBodyType type; + +/// Mass of the rigid body. Mass does not have to be expressed in any particular units, but relative masses should be consistent. +@property(nonatomic, assign) cpFloat mass; + +/// Moment of inertia of the body. The mass tells you how hard it is to push an object, the MoI tells you how hard it is to spin the object. Don't try to guess the MoI, use the cpMomentFor*() functions to try and estimate it. +@property(nonatomic, assign) cpFloat moment; + +/// The position of the rigid body's center of gravity. +@property(nonatomic, assign) cpVect position; + +/// The linear velocity of the rigid body. +@property(nonatomic, assign) cpVect velocity; + +/// The linear force applied to the rigid body. Unlike in some physics engines, the force does not reset itself during each step. Make sure that you are reseting the force between frames if that is what you intended. +@property(nonatomic, assign) cpVect force; + +/// The rotation angle of the rigid body in radians. +@property(nonatomic, assign) cpFloat angle; + +/// The angular velocity of the rigid body in radians per second. +@property(nonatomic, assign) cpFloat angularVelocity; + +/// The torque being applied to the rigid body. Like force, this property is not reset every frame. +@property(nonatomic, assign) cpFloat torque; + +/// The rigid transform of the body. +@property(nonatomic, readonly) cpTransform transform; + +/// Returns a pointer to the underlying cpBody C struct. +@property(nonatomic, readonly) cpBody *body; + +/** + An object that this constraint is associated with. You can use this get a reference to your game object or controller object from within callbacks. + @attention Like most @c delegate properties this is a weak reference and does not call @c retain. This prevents reference cycles from occuring. +*/ +@property(nonatomic, assign) id userData; + +/// Maximum velocity allowed for this body. Defaults to @c INFINITY. +@property(nonatomic, assign) cpFloat velocityLimit; + +/// Maximum angular velocity allowed for this body. Defaults to @c INFINITY. +@property(nonatomic, assign) cpFloat angularVelocityLimit; + +/// Has the body been put to sleep by the space? +@property(nonatomic, readonly) bool isSleeping; + +/// Get the kinetic energy of this body. +@property(nonatomic, readonly) cpFloat kineticEnergy; + +/// Get the space the body is added to. +@property(nonatomic, readonly) ChipmunkSpace *space; + +/** + Convert from body local to world coordinates. + Convert a point in world (absolute) coordinates to body local coordinates affected by the position and rotation of the rigid body. +*/ +- (cpVect)localToWorld:(cpVect)v; + +/** + Convert from world to body local Coordinates. + Convert a point in body local coordinates coordinates to world (absolute) coordinates. +*/ +- (cpVect)worldToLocal:(cpVect)v; + +/** + Get the velocity of a point on a body. + Get the world (absolute) velocity of a point on a rigid body specified in body local coordinates. +*/ +- (cpVect)velocityAtLocalPoint:(cpVect)p; + +/** + Get the velocity of a point on a body. + Get the world (absolute) velocity of a point on a rigid body specified in world coordinates. +*/ +- (cpVect)velocityAtWorldPoint:(cpVect)p; + +/** + Apply a force to a rigid body. An offset of cpvzero is equivalent to adding directly to the force property. + @param force A force in expressed in absolute (word) coordinates. + @param offset An offset expressed in world coordinates. Note that it is still an offset, meaning that it's position is relative, but the rotation is not. +*/ +- (void)applyForce:(cpVect)force atLocalPoint:(cpVect)point; +- (void)applyForce:(cpVect)force atWorldPoint:(cpVect)point; + +/** + Apply an impulse to a rigid body. + @param impulse An impulse in expressed in absolute (word) coordinates. + @param offset An offset expressed in world coordinates. Note that it is still an offset, meaning that it's position is relative, but the rotation is not. +*/ +- (void)applyImpulse:(cpVect)impulse atLocalPoint:(cpVect)point; +- (void)applyImpulse:(cpVect)impulse atWorldPoint:(cpVect)point; + +/// Wake up the body if it's sleeping, or reset the idle timer if it's active. +- (void)activate; + +/// Wake up any bodies touching a static body through shape @c filter Pass @c nil for @c filter to away all touching bodies. +- (void)activateStatic:(ChipmunkShape *)filter; + +/** + Force the body to sleep immediately. The body will be added to the same group as @c group. When any object in a group is woken up, all of the bodies are woken up with it. + If @c group is nil, then a new group is created and the body is added to it. It is an error pass a non-sleeping body as @c group. + This is useful if you want an object to be inactive until something hits it such as a pile of boxes you want the player to plow through or a stalactite hanging from a cave ceiling. + Make sure the body is fully set up before you call this. Adding this body or any shapes or constraints attached to it to a space, or modifying any of their properties automatically wake a body up. +*/ +- (void)sleepWithGroup:(ChipmunkBody *)group; + +/** + Equivalent to [ChipmunkBody sleepWithGroup:nil]. That is the object is forced to sleep immediately, but is not grouped with any other sleeping bodies. +*/ +- (void)sleep; + +/// Get a list of shapes that are attached to this body and currently added to a space. +- (NSArray *)shapes; + +/// Get a list of constraints that are attached to this body and currently added to a space. +- (NSArray *)constraints; + +/// Body/arbiter iterator callback block type. +typedef void (^ChipmunkBodyArbiterIteratorBlock)(cpArbiter *arbiter); + +/// Call @c block once for each arbiter that is currently active on the body. +- (void)eachArbiter:(ChipmunkBodyArbiterIteratorBlock)block; + +/// Implements the ChipmunkBaseObject protocol, not particularly useful outside of the library code +- (void)addToSpace:(ChipmunkSpace *)space; +/// Implements the ChipmunkBaseObject protocol, not particularly useful outside of the library code +- (void)removeFromSpace:(ChipmunkSpace *)space; + +/// Override this to change the way that the body's velocity is integrated. +/// You should either understand how the cpBodyUpdateVelocity() function works, or use the super method. +-(void)updateVelocity:(cpFloat)dt gravity:(cpVect)gravity damping:(cpFloat)damping; + +/// OVerride this to change the way that the body's position is intgrated. +/// You should either understand how the cpBodyUpdatePosition() function works, or use the super method. +-(void)updatePosition:(cpFloat)dt; + +@end diff --git a/external/Chipmunk/objectivec/include/ObjectiveChipmunk/ChipmunkConstraint.h b/external/Chipmunk/objectivec/include/ObjectiveChipmunk/ChipmunkConstraint.h new file mode 100644 index 0000000..034a6b6 --- /dev/null +++ b/external/Chipmunk/objectivec/include/ObjectiveChipmunk/ChipmunkConstraint.h @@ -0,0 +1,417 @@ +// Copyright 2013 Howling Moon Software. All rights reserved. +// See http://chipmunk2d.net/legal.php for more information. + +/** + Constraints connect two ChipmunkBody objects together. Most often constraints are simple joints, but can also be things like motors, friction generators or servos. + + @htmlonly + + + + + + @endhtmlonly +*/ +@interface ChipmunkConstraint : NSObject { +@private + id _userData; +} + +/// Returns a pointer to the underlying cpConstraint C struct. +@property(nonatomic, readonly) cpConstraint *constraint; + +/// The first ChipmunkBody the constraint controls. +@property(nonatomic, readonly) ChipmunkBody *bodyA; + +/// The second ChipmunkBody the constraint controls. +@property(nonatomic, readonly) ChipmunkBody *bodyB; + +/// Get the ChipmunkConstraint object associciated with a cpConstraint pointer. +/// Undefined if the cpConstraint wasn't created using Objective-Chipmunk. ++(ChipmunkConstraint *)constraintFromCPConstraint:(cpConstraint *)constraint; + +/** + Maximum force this constraint is allowed to use (defalts to infinity). + This allows joints to be pulled apart if too much force is applied to them. + It also allows you to use constraints as force or friction generators for controlling bodies. +*/ +@property(nonatomic, assign) cpFloat maxForce; + +/** + The rate at which joint error is corrected. + Defaults to pow(1.0 - 0.1, 60.0) meaning that it will correct 10% of the error every 1/60th of a second. +*/ +@property(nonatomic, assign) cpFloat errorBias; + +/** + Maximum rate (speed) that a joint can be corrected at (defaults to infinity). + Setting this value to a finite value allows you to control a joint like a servo motor. +*/ +@property(nonatomic, assign) cpFloat maxBias; + +/** + Whether or not the connected bodies should checked for collisions. + Collisions are filtered before calling callbacks. + Defaults to TRUE. +*/ +@property(nonatomic, assign) BOOL collideBodies; + +/// Get the most recent impulse applied by this constraint. +@property(nonatomic, readonly) cpFloat impulse; + +/// Get the space the body is added to. +@property(nonatomic, readonly) ChipmunkSpace *space; + +/** + An object that this constraint is associated with. You can use this get a reference to your game object or controller object from within callbacks. + @attention Like most @c delegate properties this is a weak reference and does not call @c retain. This prevents reference cycles from occuring. +*/ +@property(nonatomic, assign) id userData; + +/// Override this method to update a constraints parameters just before running the physics each step. +-(void)preSolve:(ChipmunkSpace *)space; + +/// Override this method to poll values from a constraint each frame after the physics runs. +/// This can be used to implement breakable joints for instance. +-(void)postSolve:(ChipmunkSpace *)space; + +@end + + +/** + Pin joints hold a set distance between points on two bodies. + Think of them as connecting a solid pin or rod between the two anchor points. +*/ +@interface ChipmunkPinJoint : ChipmunkConstraint { +@private + cpPinJoint _constraint; +} + +/** + Create an autoreleased pin joint between the two bodies with the given anchor points. + The distance is calculated when the joint is initialized. It can be set explicitly using the property. +*/ ++ (ChipmunkPinJoint *)pinJointWithBodyA:(ChipmunkBody *)a bodyB:(ChipmunkBody *)b anchr1:(cpVect)anchr1 anchr2:(cpVect)anchr2; + +/** + Initialize a pin joint between the two bodies with the given anchor points. + The distance is calculated when the joint is initialized. It can be set explicitly using the property. +*/ +- (id)initWithBodyA:(ChipmunkBody *)a bodyB:(ChipmunkBody *)b anchr1:(cpVect)anchr1 anchr2:(cpVect)anchr2; + +/// The anchor point on the first body. +@property(nonatomic, assign) cpVect anchr1; + +/// The anchor point on the second body. +@property(nonatomic, assign) cpVect anchr2; + +/// The distance between the two anchor points that the joint keeps. +@property(nonatomic, assign) cpFloat dist; + +@end + + +/** + Slide joints hold the distance between points on two bodies between a minimum and a maximum. + Think of them as a telescoping ChipmunkPinJoint. +*/ +@interface ChipmunkSlideJoint : ChipmunkConstraint { +@private + cpSlideJoint _constraint; +} + +/** + Create an autoreleased slide joint between the two bodies with the given anchor points and distance range. +*/ ++ (ChipmunkSlideJoint *)slideJointWithBodyA:(ChipmunkBody *)a bodyB:(ChipmunkBody *)b anchr1:(cpVect)anchr1 anchr2:(cpVect)anchr2 min:(cpFloat)min max:(cpFloat)max; + +/** + Initialize a slide joint between the two bodies with the given anchor points and distance range. +*/ +- (id)initWithBodyA:(ChipmunkBody *)a bodyB:(ChipmunkBody *)b anchr1:(cpVect)anchr1 anchr2:(cpVect)anchr2 min:(cpFloat)min max:(cpFloat)max; + +/// The anchor point on the first body. +@property(nonatomic, assign) cpVect anchr1; + +/// The anchor point on the second body. +@property(nonatomic, assign) cpVect anchr2; + +/// The minimum allowed distance between anchor points. +@property(nonatomic, assign) cpFloat min; + +/// The maximum allowed distance between anchor points. +@property(nonatomic, assign) cpFloat max; + +@end + + +/** + Pivot joints hold two points on two bodies together allowing them to rotate freely around the pivot. +*/ +@interface ChipmunkPivotJoint : ChipmunkConstraint { +@private + cpPivotJoint _constraint; +} + +/** + Create an autoreleased pivot joint between the two bodies with the two anchor points. + Make sure you have the bodies in the right place as the joint will fix itself as soon as you start simulating the space. +*/ ++ (ChipmunkPivotJoint *)pivotJointWithBodyA:(ChipmunkBody *)a bodyB:(ChipmunkBody *)b anchr1:(cpVect)anchr1 anchr2:(cpVect)anchr2; + +/** + Create an autoreleased pivot joint between the two bodies by calculating the anchor points from the pivot point given in absolute coordinates. +*/ ++ (ChipmunkPivotJoint *)pivotJointWithBodyA:(ChipmunkBody *)a bodyB:(ChipmunkBody *)b pivot:(cpVect)pivot; + +/** + Initialize a pivot joint between the two bodies with the two anchor points. + Make sure you have the bodies in the right place as the joint will fix itself as soon as you start simulating the space. +*/ +- (id)initWithBodyA:(ChipmunkBody *)a bodyB:(ChipmunkBody *)b anchr1:(cpVect)anchr1 anchr2:(cpVect)anchr2; + +/** + Initialize a pivot joint between the two bodies by calculating the anchor points from the pivot point given in absolute coordinates. +*/ +- (id)initWithBodyA:(ChipmunkBody *)a bodyB:(ChipmunkBody *)b pivot:(cpVect)pivot; + +/// The anchor point on the first body. +@property(nonatomic, assign) cpVect anchr1; + +/// The anchor point on the second body. +@property(nonatomic, assign) cpVect anchr2; + +@end + + +/** + Groove joints hold a pivot point on one body to line along a line segment on another like a pin in a groove. +*/ +@interface ChipmunkGrooveJoint : ChipmunkConstraint { +@private + cpGrooveJoint _constraint; +} + +/** + Create an autoreleased groove joint between the two bodies. + Make sure you have the bodies in the right place as the joint will snap into shape as soon as you start simulating the space. + @param groove_a The start of the line segment on the first body. + @param groove_b The end of the line segment on the first body. + @param anchr2 The anchor point on the second body that is held to the line segment on the first. +*/ ++ (ChipmunkGrooveJoint *)grooveJointWithBodyA:(ChipmunkBody *)a bodyB:(ChipmunkBody *)b groove_a:(cpVect)groove_a groove_b:(cpVect)groove_b anchr2:(cpVect)anchr2; + +/** + Initialize a groove joint between the two bodies. + Make sure you have the bodies in the right place as the joint will snap into shape as soon as you start simulating the space. + @param groove_a The start of the line segment on the first body. + @param groove_b The end of the line segment on the first body. + @param anchr2 The anchor point on the second body that is held to the line segment on the first. +*/ +- (id)initWithBodyA:(ChipmunkBody *)a bodyB:(ChipmunkBody *)b groove_a:(cpVect)groove_a groove_b:(cpVect)groove_b anchr2:(cpVect)anchr2; + +/// The start point of the groove on the first body. +@property(nonatomic, assign) cpVect grooveA; +/// The end point of the groove on the first body. +@property(nonatomic, assign) cpVect grooveB; + +/// The anchor point on the second body. +@property(nonatomic, assign) cpVect anchr2; + +@end + + +/** + A spring with a damper. + While a spring is not technically a constraint, the damper is. The spring forces are simply a convenience. +*/ +@interface ChipmunkDampedSpring : ChipmunkConstraint { +@private + cpDampedSpring _constraint; +} + +/** + Create an autoreleased damped spring between two bodies at the given anchor points. + @param restLength The length the spring wants to contract or expand to. + @param stiffness The young's modulus of the spring. + @param damping The amount of viscous damping to apply. +*/ ++ (ChipmunkDampedSpring *)dampedSpringWithBodyA:(ChipmunkBody *)a bodyB:(ChipmunkBody *)b anchr1:(cpVect)anchr1 anchr2:(cpVect)anchr2 restLength:(cpFloat)restLength stiffness:(cpFloat)stiffness damping:(cpFloat)damping; + +/** + Initialize a damped spring between two bodies at the given anchor points. + @param restLength The length the spring wants to contract or expand to. + @param stiffness The young's modulus of the spring. + @param damping The amount of viscous damping to apply. +*/ +- (id)initWithBodyA:(ChipmunkBody *)a bodyB:(ChipmunkBody *)b anchr1:(cpVect)anchr1 anchr2:(cpVect)anchr2 restLength:(cpFloat)restLength stiffness:(cpFloat)stiffness damping:(cpFloat)damping; + +/// The anchor point on the first body. +@property(nonatomic, assign) cpVect anchr1; + +/// The anchor point on the second body. +@property(nonatomic, assign) cpVect anchr2; + +/// The length the spring wants to contract or expand to. +@property(nonatomic, assign) cpFloat restLength; + +/// The young's modulus of the spring. +@property(nonatomic, assign) cpFloat stiffness; + +/// The amount of viscous damping to apply. +@property(nonatomic, assign) cpFloat damping; + +@end + + +/** + Like a ChipmunkDampedSpring, but operates in a rotational fashion. +*/ +@interface ChipmunkDampedRotarySpring : ChipmunkConstraint { +@private + cpDampedRotarySpring _constraint; +} + + +/** + Create an autoreleased damped rotary spring between the given bodies. + @param restAngle The angular offset in radians the spring attempts to keep between the two bodies. + @param stiffness The young's modulus of the spring. + @param damping The amount of viscous damping to apply. +*/ ++ (ChipmunkDampedRotarySpring *)dampedRotarySpringWithBodyA:(ChipmunkBody *)a bodyB:(ChipmunkBody *)b restAngle:(cpFloat)restAngle stiffness:(cpFloat)stiffness damping:(cpFloat)damping; + +/** + Initialize a damped rotary spring between the given bodies. + @param restAngle The angular offset in radians the spring attempts to keep between the two bodies. + @param stiffness The young's modulus of the spring. + @param damping The amount of viscous damping to apply. +*/ +- (id)initWithBodyA:(ChipmunkBody *)a bodyB:(ChipmunkBody *)b restAngle:(cpFloat)restAngle stiffness:(cpFloat)stiffness damping:(cpFloat)damping; + +/// The angular offset the spring attempts to keep between the two bodies. +@property(nonatomic, assign) cpFloat restAngle; + +/// The young's modulus of the spring. +@property(nonatomic, assign) cpFloat stiffness; + +/// The amount of viscous damping to apply. +@property(nonatomic, assign) cpFloat damping; + +@end + + +/** + Constrains the angle between two bodies. + This joint is often used in conjuction with a separate ChipmunkPivotJoint in order to limit the rotation around the pivot. +*/ +@interface ChipmunkRotaryLimitJoint : ChipmunkConstraint { +@private + cpRotaryLimitJoint _constraint; +} + +/** + Create an autoreleased rotary limit joint between the two bodies and angular range in radians. + Make sure you have the bodies in the right place as the joint will snap into shape as soon as you start simulating the space. +*/ ++ (ChipmunkRotaryLimitJoint *)rotaryLimitJointWithBodyA:(ChipmunkBody *)a bodyB:(ChipmunkBody *)b min:(cpFloat)min max:(cpFloat)max; + +/** + Create an autoreleased rotary limit joint between the two bodies and angular range in radians. + Make sure you have the bodies in the right place as the joint will snap into shape as soon as you start simulating the space. +*/ +- (id)initWithBodyA:(ChipmunkBody *)a bodyB:(ChipmunkBody *)b min:(cpFloat)min max:(cpFloat)max; + +/// The minimum angular delta of the joint in radians. +@property(nonatomic, assign) cpFloat min; + +/// The maximum angular delta of the joint in radians. +@property(nonatomic, assign) cpFloat max; + +@end + + +/** + Simple motors make two objects spin relative to each other. + They are most often used with the ChipmunkConstraint.maxForce property set to a finite value. +*/ +@interface ChipmunkSimpleMotor : ChipmunkConstraint { +@private + cpSimpleMotor _constraint; +} + +/// Create an autoreleased simple motor between the given bodies and relative rotation rate in radians per second. ++ (ChipmunkSimpleMotor *)simpleMotorWithBodyA:(ChipmunkBody *)a bodyB:(ChipmunkBody *)b rate:(cpFloat)rate; + +/// Initialize a simple motor between the given bodies and relative rotation rate in radians per second. +- (id)initWithBodyA:(ChipmunkBody *)a bodyB:(ChipmunkBody *)b rate:(cpFloat)rate; + +/// The relative rotation speed of the two bodies in radians per second. +@property(nonatomic, assign) cpFloat rate; + +@end + + +/** + Gear joints constrain the rotational speed of one body to another. + A ratio of 1.0 will lock the rotation of two bodies together, and negative ratios will cause them to spin in opposite directions. + You can also use gear joints as rotary servos by setting ChipmunkConstraint.maxForce and ChipmunkConstraint.maxBias to finite values and changing the ChipmunkGearJoint.phase property. +*/ +@interface ChipmunkGearJoint : ChipmunkConstraint { +@private + cpGearJoint _constraint; +} + +/** + Create an autoreleased gear joint between the given bodies. + @param phase The angular offset. + @param ratio The ratio of the rotational speeds. +*/ ++ (ChipmunkGearJoint *)gearJointWithBodyA:(ChipmunkBody *)a bodyB:(ChipmunkBody *)b phase:(cpFloat)phase ratio:(cpFloat)ratio; + +/** + Initialize a gear joint between the given bodies. + @param phase The angular offset in radians. + @param ratio The ratio of the rotational speeds. +*/ +- (id)initWithBodyA:(ChipmunkBody *)a bodyB:(ChipmunkBody *)b phase:(cpFloat)phase ratio:(cpFloat)ratio; + +/// The angular offset in radians. +@property(nonatomic, assign) cpFloat phase; +/// The ratio of the rotational speeds. +@property(nonatomic, assign) cpFloat ratio; + +@end + +/** + Ratchet joints create rotary ratches similar to a socket wrench. +*/ +@interface ChipmunkRatchetJoint : ChipmunkConstraint { +@private + cpRatchetJoint _constraint; +} + +/** + Create an autoreleased ratchet joint between the given bodies. + @param phase The angular offset of the ratchet positions in radians. + @param ratchet The angle in radians of each ratchet position. Negative values cause the ratchet to operate in the opposite direction. +*/ ++ (ChipmunkRatchetJoint *)ratchetJointWithBodyA:(ChipmunkBody *)a bodyB:(ChipmunkBody *)b phase:(cpFloat)phase ratchet:(cpFloat)ratchet; + +/** + Initialize a ratchet joint between the given bodies. + @param phase The angular offset of the ratchet positions in radians. + @param ratchet The angle in radians of each ratchet position. Negative values cause the ratchet to operate in the opposite direction. +*/ +- (id)initWithBodyA:(ChipmunkBody *)a bodyB:(ChipmunkBody *)b phase:(cpFloat)phase ratchet:(cpFloat)ratchet; + +/// The current ratchet position in radians. +@property(nonatomic, assign) cpFloat angle; + +/// The angular offset of the ratchet positions in radians +@property(nonatomic, assign) cpFloat phase; + +/// The angle in radians of each ratchet position. Negative values cause the ratchet to operate in the opposite direction. +@property(nonatomic, assign) cpFloat ratchet; + +@end diff --git a/external/Chipmunk/objectivec/include/ObjectiveChipmunk/ChipmunkExtras.h b/external/Chipmunk/objectivec/include/ObjectiveChipmunk/ChipmunkExtras.h new file mode 100644 index 0000000..99d9e2f --- /dev/null +++ b/external/Chipmunk/objectivec/include/ObjectiveChipmunk/ChipmunkExtras.h @@ -0,0 +1,5 @@ +// Copyright 2013 Howling Moon Software. All rights reserved. +// See http://chipmunk2d.net/legal.php for more information. + +//#define ChipmunkGetObject(s) s->data +//#define ChipmunkGetData(s) [s->data data] diff --git a/external/Chipmunk/objectivec/include/ObjectiveChipmunk/ChipmunkMultiGrab.h b/external/Chipmunk/objectivec/include/ObjectiveChipmunk/ChipmunkMultiGrab.h new file mode 100644 index 0000000..2830848 --- /dev/null +++ b/external/Chipmunk/objectivec/include/ObjectiveChipmunk/ChipmunkMultiGrab.h @@ -0,0 +1,118 @@ +// Copyright 2013 Howling Moon Software. All rights reserved. +// See http://chipmunk2d.net/legal.php for more information. + +#import "ObjectiveChipmunk.h" + +@interface ChipmunkGrab : NSObject { + NSArray *_chipmunkObjects; + + cpVect _pos; + cpFloat _smoothing; + + ChipmunkShape *_grabbedShape; + + id _data; +} + +/// Last touch location of the grab. +@property(nonatomic, readonly) cpVect pos; + +/// The ChipmunkShape that this grab was created for. +@property(nonatomic, readonly) ChipmunkShape *grabbedShape; + +/// User definable pointer +@property(nonatomic, retain) id data; + +@end + + +/// Simple class to implement multitouch grabbing of physics objects. +@interface ChipmunkMultiGrab : NSObject { + ChipmunkSpace *_space; + NSMutableArray *_grabs; + + cpFloat _smoothing; + cpFloat _grabForce; + + cpFloat _grabFriction; + cpFloat _grabRotaryFriction; + cpFloat _grabRadius; + + cpShapeFilter filter; + bool (^_grabFilter)(ChipmunkShape *shape); + cpFloat (^_grabSort)(ChipmunkShape *shape, cpFloat depth); + + bool _pushMode, _pullMode; + + cpFloat _pushMass; + cpFloat _pushFriction; + cpFloat _pushElasticity; + cpCollisionType _pushCollisionType; +} + +@property(nonatomic, assign) cpFloat smoothing; +@property(nonatomic, assign) cpFloat grabForce; + +/// Layers used for the point query when grabbing objects. +@property(nonatomic, assign) cpShapeFilter filter; + +/// Group used for the point query when grabbing objects +@property(nonatomic, assign) cpGroup group; + +/// Gives you the opportunity to further filter shapes. Return FALSE to ignore a shape. +/// The default implementation always returns TRUE. +@property(nonatomic, copy) bool (^grabFilter)(ChipmunkShape *shape); + +/// When clicking on a spot where two shapes overlap, the default behavior is to grab the shape that +/// overlaps the grab point the most. It's possible to use a custom sorting order instead however. +/// The block is called with each shape and the grab depth. +/// It should return a positive float. The shape with the highest value is grabbed. +/// The block is only called if the touch location is within a shape. +@property(nonatomic, copy) cpFloat (^grabSort)(ChipmunkShape *shape, cpFloat depth); + +/// Amount of friction applied by the touch. +/// Should be less than the grabForce. Defaults to 0.0. +@property(nonatomic, assign) cpFloat grabFriction; + +/// The amount torque to apply to the grab to keep it from spinning. +/// Defaults to 0.0. +@property(nonatomic, assign) cpFloat grabRotaryFriction; + +/// On a touch screen, a single point query can make it really hard to grab small objects with a fat finger. +/// By providing a radius, it will make it much easier for users to grab objects. +/// Defaults to 0.0. +@property(nonatomic, assign) cpFloat grabRadius; + +@property(nonatomic, assign) bool pullMode; +@property(nonatomic, assign) bool pushMode; + +@property(nonatomic, assign) cpFloat pushMass; +@property(nonatomic, assign) cpFloat pushFriction; +@property(nonatomic, assign) cpFloat pushElasticity; +@property(nonatomic, assign) cpCollisionType pushCollisionType; + +@property(nonatomic, readonly) NSArray *grabs; + + +/** + @c space is the space to grab shapes in. + @c smoothing is the amount of mouse smoothing to apply as percentage of remaining error per second. + cpfpow(0.8, 60) is a good starting point that provides fast response, but smooth mouse updates. + @c force is the force the grab points can apply. +*/ +-(id)initForSpace:(ChipmunkSpace *)space withSmoothing:(cpFloat)smoothing withGrabForce:(cpFloat)grabForce; + +/// Start tracking a new grab point +/// Returns the ChipmunkGrab that is tracking the touch, but only if a shape was grabbed. +/// Returns nil when creating a push shape (if push mode is enabled), or when no shape is grabbed. +-(ChipmunkGrab *)beginLocation:(cpVect)pos; + +/// Update a grab point. +/// Returns the ChipmunkGrab that is tracking the touch, but only if the grab is tracking a shape. +-(ChipmunkGrab *)updateLocation:(cpVect)pos; + +/// End a grab point. +/// Returns the ChipmunkGrab that was tracking the touch, but only if the grab was tracking a shape. +-(ChipmunkGrab *)endLocation:(cpVect)pos; + +@end diff --git a/external/Chipmunk/objectivec/include/ObjectiveChipmunk/ChipmunkShape.h b/external/Chipmunk/objectivec/include/ObjectiveChipmunk/ChipmunkShape.h new file mode 100644 index 0000000..0a4f5ea --- /dev/null +++ b/external/Chipmunk/objectivec/include/ObjectiveChipmunk/ChipmunkShape.h @@ -0,0 +1,243 @@ +// Copyright 2013 Howling Moon Software. All rights reserved. +// See http://chipmunk2d.net/legal.php for more information. + +@class ChipmunkPointQueryInfo; +@class ChipmunkSegmentQueryInfo; + + +/// Abstract base class for collsion shape types. +@interface ChipmunkShape : NSObject { +@private + id _userData; +} + +/// Get the ChipmunkShape object associciated with a cpShape pointer. +/// Undefined if the cpShape wasn't created using Objective-Chipmunk. ++(ChipmunkShape *)shapeFromCPShape:(cpShape *)shape; + +/// Returns a pointer to the underlying cpShape C struct. +@property(nonatomic, readonly) cpShape *shape; + +/// The ChipmunkBody that this shape is attached to. +@property(nonatomic, retain) ChipmunkBody *body; + +// TODO doc +@property(nonatomic, assign) cpFloat mass; +@property(nonatomic, assign) cpFloat density; +@property(nonatomic, readonly) cpFloat moment; +@property(nonatomic, readonly) cpFloat area; +@property(nonatomic, readonly) cpVect centerOfGravity; + +/// The axis-aligned bounding box for this shape. +@property(nonatomic, readonly) cpBB bb; + +/// Sensor shapes send collision callback messages, but don't create a collision response. +@property(nonatomic, assign) BOOL sensor; + +/// How bouncy this shape is. +@property(nonatomic, assign) cpFloat elasticity; + +/// How much friction this shape has. +@property(nonatomic, assign) cpFloat friction; + +/** + The velocity of the shape's surface. + This velocity is used in the collision response when calculating the friction only. +*/ +@property(nonatomic, assign) cpVect surfaceVelocity; + +/** + An object reference used as a collision type identifier. This is used when defining collision handlers. + @attention Like most @c delegate properties this is a weak reference and does not call @c retain. +*/ +@property(nonatomic, assign) cpCollisionType collisionType; + +/** + An object reference used as a collision group identifier. Shapes with the same group do not collide. + @attention Like most @c delegate properties this is a weak reference and does not call @c retain. +*/ +@property(nonatomic, assign) cpGroup group; + +@property(nonatomic, assign) cpShapeFilter filter; + +/// Get the space the body is added to. +@property(nonatomic, readonly) ChipmunkSpace *space; + +/** + An object that this shape is associated with. You can use this get a reference to your game object or controller object from within callbacks. + @attention Like most @c delegate properties this is a weak reference and does not call @c retain. This prevents reference cycles from occuring. +*/ +@property(nonatomic, assign) id userData; + +/// Update and cache the axis-aligned bounding box for this shape. +- (cpBB)cacheBB; + +- (ChipmunkPointQueryInfo *)pointQuery:(cpVect)point; +- (ChipmunkSegmentQueryInfo *)segmentQueryFrom:(cpVect)start to:(cpVect)end radius:(cpFloat)radius; + +@end + + +@interface ChipmunkPointQueryInfo : NSObject { + @private + cpPointQueryInfo _info; +} + +- (id)initWithInfo:(cpPointQueryInfo *)info; + +/// Returns a pointer to the underlying cpNearestPointQueryInfo C struct. +@property(nonatomic, readonly) cpPointQueryInfo *info; + +/// The ChipmunkShape found. +@property(nonatomic, readonly) ChipmunkShape *shape; + +/// The closest point on the surface of the shape to the point. +@property(nonatomic, readonly) cpVect point; + +/// The distance between the point and the surface of the shape. +/// Negative distances mean that the point is that depth inside the shape. +@property(nonatomic, readonly) cpFloat distance; + +/// The gradient of the signed distance function. +/// The same as info.point/info.dist, but accurate even for very small values of info.dist. +@property(nonatomic, readonly) cpVect gradient; + +@end + + +/// Holds collision information from segment queries. You should never need to create one. +@interface ChipmunkSegmentQueryInfo : NSObject { +@private + cpSegmentQueryInfo _info; + cpVect _start, _end; +} + +- (id)initWithInfo:(cpSegmentQueryInfo *)info start:(cpVect)start end:(cpVect)end; + +/// Returns a pointer to the underlying cpSegmentQueryInfo C struct. +@property(nonatomic, readonly) cpSegmentQueryInfo *info; + +/// The ChipmunkShape found. +@property(nonatomic, readonly) ChipmunkShape *shape; + +/// The percentage between the start and end points where the collision occurred. +@property(nonatomic, readonly) cpFloat t; + +/// The normal of the collision with the shape. +@property(nonatomic, readonly) cpVect normal; + +/// The point of the collision in absolute (world) coordinates. +@property(nonatomic, readonly) cpVect point; + +/// The distance from the start point where the collision occurred. +@property(nonatomic, readonly) cpFloat dist; + +/// The start point. +@property(nonatomic, readonly) cpVect start; + +/// The end point. +@property(nonatomic, readonly) cpVect end; + +@end + + +/// Holds collision information from segment queries. You should never need to create one. +@interface ChipmunkShapeQueryInfo : NSObject { +@private + ChipmunkShape *_shape; + cpContactPointSet _contactPoints; +} + +- (id)initWithShape:(ChipmunkShape *)shape andPoints:(cpContactPointSet *)set; + +@property(nonatomic, readonly) ChipmunkShape *shape; +@property(nonatomic, readonly) cpContactPointSet *contactPoints; + +@end + + +/// A perfect circle shape. +@interface ChipmunkCircleShape : ChipmunkShape { +@private + cpCircleShape _shape; +} + +/// Create an autoreleased circle shape with the given radius and offset from the center of gravity. ++ (id)circleWithBody:(ChipmunkBody *)body radius:(cpFloat)radius offset:(cpVect)offset; + +/// Initialize a circle shape with the given radius and offset from the center of gravity. +- (id)initWithBody:(ChipmunkBody *)body radius:(cpFloat)radius offset:(cpVect)offset; + +/// The radius of the circle. +@property(nonatomic, readonly) cpFloat radius; + +/// The offset from the center of gravity. +@property(nonatomic, readonly) cpVect offset; + +@end + + +/// A beveled (rounded) segment shape. +@interface ChipmunkSegmentShape : ChipmunkShape { +@private + cpSegmentShape _shape; +} + +/// Create an autoreleased segment shape with the given endpoints and radius. ++ (id)segmentWithBody:(ChipmunkBody *)body from:(cpVect)a to:(cpVect)b radius:(cpFloat)radius; + +/// Initialize a segment shape with the given endpoints and radius. +- (id)initWithBody:(ChipmunkBody *)body from:(cpVect)a to:(cpVect)b radius:(cpFloat)radius; + +/// Let Chipmunk know about the geometry of adjacent segments to avoid colliding with endcaps. +- (void)setPrevNeighbor:(cpVect)prev nextNeighbor:(cpVect)next; + +/// The start of the segment shape. +@property(nonatomic, readonly) cpVect a; + +/// The end of the segment shape. +@property(nonatomic, readonly) cpVect b; + +/// The normal of the segment shape. +@property(nonatomic, readonly) cpVect normal; + +/// The beveling radius of the segment shape. +@property(nonatomic, readonly) cpFloat radius; + +@end + + +/// A convex polygon shape. +@interface ChipmunkPolyShape : ChipmunkShape { +@private + cpPolyShape _shape; +} + +/// Create an autoreleased polygon shape from the given vertexes after applying the transform and with the given rounding radius. ++ (id)polyWithBody:(ChipmunkBody *)body count:(int)count verts:(const cpVect *)verts transform:(cpTransform)transform radius:(cpFloat)radius; + +/// Create an autoreleased box shape centered on the center of gravity. ++ (id)boxWithBody:(ChipmunkBody *)body width:(cpFloat)width height:(cpFloat)height radius:(cpFloat)radius; + +/// Create an autoreleased box shape with the given bounding box in body local coordinates and rounding radius. ++ (id)boxWithBody:(ChipmunkBody *)body bb:(cpBB)bb radius:(cpFloat)radius; + +/// Initialize a polygon shape from the given vertexes after applying the transform and with the given rounding radius. +- (id)initWithBody:(ChipmunkBody *)body count:(int)count verts:(const cpVect *)verts transform:(cpTransform)transform radius:(cpFloat)radius; + +/// Initialize a box shape centered on the center of gravity. +- (id)initBoxWithBody:(ChipmunkBody *)body width:(cpFloat)width height:(cpFloat)height radius:(cpFloat)radius; + +/// Initialize a box shape with the given bounding box in body local coordinates and rounding radius. +- (id)initBoxWithBody:(ChipmunkBody *)body bb:(cpBB)bb radius:(cpFloat)radius; + +/// The number of vertexes in this polygon. +@property(nonatomic, readonly) int count; + +/// Get the rounding radius of the polygon. +@property(nonatomic, readonly) cpFloat radius; + +/// Access the vertexes of this polygon. +- (cpVect)getVertex:(int)index; + +@end diff --git a/external/Chipmunk/objectivec/include/ObjectiveChipmunk/ChipmunkSpace.h b/external/Chipmunk/objectivec/include/ObjectiveChipmunk/ChipmunkSpace.h new file mode 100644 index 0000000..c532db7 --- /dev/null +++ b/external/Chipmunk/objectivec/include/ObjectiveChipmunk/ChipmunkSpace.h @@ -0,0 +1,269 @@ +// Copyright 2013 Howling Moon Software. All rights reserved. +// See http://chipmunk2d.net/legal.php for more information. + +/** + Chipmunk spaces are simulation containers. You add a bunch of physics objects to a space (rigid bodies, collision shapes, and joints) and step the entire space forward through time as a whole. + If you have Chipmunk Pro, you'll want to use the ChipmunkHastySpace subclass instead as it has iPhone specific optimizations. + Unfortunately because of how Objective-C code is linked I can't dynamically substitute a ChipmunkHastySpace from a static library. +*/ + +struct cpSpace; + +@interface ChipmunkSpace : NSObject { +@protected + struct cpSpace *_space; + ChipmunkBody *_staticBody; + + NSMutableSet *_children; + NSMutableArray *_handlers; + + id _userData; +} + +/** + The iteration count is how many solver passes the space should use when solving collisions and joints (default is 10). + Fewer iterations mean less CPU usage, but lower quality (mushy looking) physics. +*/ +@property(nonatomic, assign) int iterations; + +/// Global gravity value to use for all rigid bodies in this space (default value is @c cpvzero). +@property(nonatomic, assign) cpVect gravity; + +/** + Global viscous damping value to use for all rigid bodies in this space (default value is 1.0 which disables damping). + This value is the fraction of velocity a body should have after 1 second. + A value of 0.9 would mean that each second, a body would have 80% of the velocity it had the previous second. +*/ +@property(nonatomic, assign) cpFloat damping; + +/// If a body is moving slower than this speed, it is considered idle. The default value is 0, which signals that the space should guess a good value based on the current gravity. +@property(nonatomic, assign) cpFloat idleSpeedThreshold; + +/** + Elapsed time before a group of idle bodies is put to sleep (defaults to infinity which disables sleeping). + If an entire group of touching or jointed bodies has been idle for at least this long, the space will put all of the bodies into a sleeping state where they consume very little CPU. +*/ +@property(nonatomic, assign) cpFloat sleepTimeThreshold; + +/** + Amount of encouraged penetration between colliding shapes.. + Used to reduce oscillating contacts and keep the collision cache warm. + Defaults to 0.1. If you have poor simulation quality, + increase this number as much as possible without allowing visible amounts of overlap. +*/ +@property(nonatomic, assign) cpFloat collisionSlop; + +/** + Determines how fast overlapping shapes are pushed apart. + Expressed as a fraction of the error remaining after each second. + Defaults to pow(1.0 - 0.1, 60.0) meaning that Chipmunk fixes 10% of overlap each frame at 60Hz. +*/ +@property(nonatomic, assign) cpFloat collisionBias; + +/** + Number of frames that contact information should persist. + Defaults to 3. There is probably never a reason to change this value. +*/ +@property(nonatomic, assign) cpTimestamp collisionPersistence; + +/** + @deprecated 6.0.4 + Does nothing, and is a no-op. The contact graph is always enabled now. +*/ +@property(nonatomic, assign) bool enableContactGraph +__attribute__((__deprecated__)); + +/// Returns a pointer to the underlying cpSpace C struct +@property(nonatomic, readonly) cpSpace *space; + +/** + The space's designated static body. + Collision shapes added to the body will automatically be marked as static shapes, and rigid bodies that come to rest while touching or jointed to this body will fall asleep. +*/ +@property(nonatomic, readonly) ChipmunkBody *staticBody; + +/** + Retrieves the current (if you are in a callback from [ChipmunkSpace step:]) or most recent (outside of a [ChipmunkSpace step:] call) timestep. +*/ +@property(nonatomic, readonly) cpFloat currentTimeStep; + +/** + An object that this space is associated with. You can use this get a reference to your game state or controller object from within callbacks. + @attention Like most @c delegate properties this is a weak reference and does not call @c retain. This prevents reference cycles from occuring. +*/ +@property(nonatomic, assign) id userData; + +/// Get the ChipmunkSpace object associciated with a cpSpace pointer. +/// Undefined if the cpSpace wasn't created using Objective-Chipmunk. ++(ChipmunkSpace *)spaceFromCPSpace:(cpSpace *)space; + +/** + Set the default collision handler. + The default handler is used for all collisions when a specific collision handler cannot be found. + + The expected method selectors are as follows: + @code +- (bool)begin:(cpArbiter *)arbiter space:(ChipmunkSpace*)space +- (bool)preSolve:(cpArbiter *)arbiter space:(ChipmunkSpace*)space +- (void)postSolve:(cpArbiter *)arbiter space:(ChipmunkSpace*)space +- (void)separate:(cpArbiter *)arbiter space:(ChipmunkSpace*)space + @endcode +*/ +// TODO + +/** + Set a collision handler to handle specific collision types. + The methods are called only when shapes with the specified collisionTypes collide. + + @c typeA and @c typeB should be the same object references set to ChipmunkShape.collisionType. They can be any uniquely identifying object. + Class and global NSString objects work well as collision types as they are easy to get a reference to and do not require you to allocate any objects. + + The expected method selectors are as follows: + @code +- (bool)begin:(cpArbiter *)arbiter space:(ChipmunkSpace*)space +- (bool)preSolve:(cpArbiter *)arbiter space:(ChipmunkSpace*)space +- (void)postSolve:(cpArbiter *)arbiter space:(ChipmunkSpace*)space +- (void)separate:(cpArbiter *)arbiter space:(ChipmunkSpace*)space + @endcode +*/ +// TODO + +/** + Add an object to the space. + This can be any object that implements the ChipmunkObject protocol. + This includes all the basic types such as ChipmunkBody, ChipmunkShape and ChipmunkConstraint as well as any composite game objects you may define that implement the protocol. + @warning This method may not be called from a collision handler callback. See smartAdd: or ChipmunkSpace.addPostStepCallback:selector:context: for information on how to do that. +*/ +-(id)add:(NSObject *)obj; + +/** + Remove an object from the space. + This can be any object that implements the ChipmunkObject protocol. + This includes all the basic types such as ChipmunkBody, ChipmunkShape and ChipmunkConstraint as well as any composite game objects you may define that implement the protocol. + @warning This method may not be called from a collision handler callback. See smartRemove: or ChipmunkSpace.addPostStepCallback:selector:context: for information on how to do that. +*/ +-(id)remove:(NSObject *)obj; + +/// Check if a space already contains a particular object: +-(BOOL)contains:(NSObject *)obj; + +/// If the space is locked and it's unsafe to call add: it will call addPostStepAddition: instead. +- (id)smartAdd:(NSObject *)obj; + +/// If the space is locked and it's unsafe to call remove: it will call addPostStepRemoval: instead. +- (id)smartRemove:(NSObject *)obj; + +/// Handy utility method to add a border of collision segments around a box. See ChipmunkShape for more information on the other parameters. +/// Returns an NSArray of the shapes. Since NSArray implements the ChipmunkObject protocol, you can use the [ChipmunkSpace remove:] method to remove the bounds. +- (NSArray *)addBounds:(CGRect)bounds thickness:(cpFloat)radius + elasticity:(cpFloat)elasticity friction:(cpFloat)friction + filter:(cpShapeFilter)filter collisionType:(id)collisionType; + + +/** + Define a callback to be run just before [ChipmunkSpace step:] finishes. + The main reason you want to define post-step callbacks is to get around the restriction that you cannot call the add/remove methods from a collision handler callback. + Post-step callbacks run right before the next (or current) call to ChipmunkSpace.step: returns when it is safe to add and remove objects. + You can only schedule one post-step callback per key value, this prevents you from accidentally removing an object twice. Registering a second callback for the same key is a no-op. + + The method signature of the method should be: + @code +- (void)postStepCallback:(id)key
    + @endcode + + This makes it easy to call a removal method on your game controller to remove a game object that died or was destroyed as the result of a collision: + @code +[space addPostStepCallback:gameController selector:@selector(remove:) key:gameObject]; + @endcode + + @attention Not to be confused with post-solve collision handler callbacks. + @warning @c target and @c object cannot be retained by the ChipmunkSpace. If you need to release either after registering the callback, use autorelease to ensure that they won't be deallocated until after [ChipmunkSpace step:] returns. + @see ChipmunkSpace.addPostStepRemoval: +*/ +- (BOOL)addPostStepCallback:(id)target selector:(SEL)selector key:(id)key; + +/// Block type used with [ChipmunkSpace addPostStepBlock:] +typedef void (^ChipmunkPostStepBlock)(void); + +/// Same as [ChipmunkSpace addPostStepCallback:] but with a block. The block is copied. +- (BOOL)addPostStepBlock:(ChipmunkPostStepBlock)block key:(id)key; + +/// Add the Chipmunk Object to the space at the end of the step. +- (void)addPostStepAddition:(NSObject *)obj; + +/// Remove the Chipmunk Object from the space at the end of the step. +- (void)addPostStepRemoval:(NSObject *)obj; + +/// Return an array of ChipmunkNearestPointQueryInfo objects for shapes within @c maxDistance of @c point. +/// The point is treated as having the given group and layers. +- (NSArray *)pointQueryAll:(cpVect)point maxDistance:(cpFloat)maxDistance filter:(cpShapeFilter)filter; + +/// Find the closest shape to a point that is within @c maxDistance of @c point. +/// The point is treated as having the given layers and group. +- (ChipmunkPointQueryInfo *)pointQueryNearest:(cpVect)point maxDistance:(cpFloat)maxDistance filter:(cpShapeFilter)filter; + +/// Return a NSArray of ChipmunkSegmentQueryInfo objects for all the shapes that overlap the segment. The objects are unsorted. +- (NSArray *)segmentQueryAllFrom:(cpVect)start to:(cpVect)end radius:(cpFloat)radius filter:(cpShapeFilter)filter; + +/// Returns the first shape that overlaps the given segment. The segment is treated as having the given group and layers. +- (ChipmunkSegmentQueryInfo *)segmentQueryFirstFrom:(cpVect)start to:(cpVect)end radius:(cpFloat)radius filter:(cpShapeFilter)filter; + +/// Returns a NSArray of all shapes whose bounding boxes overlap the given bounding box. The box is treated as having the given group and layers. +- (NSArray *)bbQueryAll:(cpBB)bb filter:(cpShapeFilter)filter; + +/// Returns a NSArray of ChipmunkShapeQueryInfo objects for all the shapes that overlap @c shape. +- (NSArray *)shapeQueryAll:(ChipmunkShape *)shape; + +/// Returns true if the shape overlaps anything in the space. +- (BOOL)shapeTest:(ChipmunkShape *)shape; + +/// Get a copy of the list of all the bodies in the space. +- (NSArray *)bodies; + +/// Get a copy of the list of all the shapes in the space +- (NSArray *)shapes; + +/// Get a copy of the list of all the constraints in the space +- (NSArray *)constraints; + +/// Update all the static shapes. +- (void)reindexStatic; + +/// Update the collision info for a single shape. +/// Can be used to update individual static shapes that were moved or active shapes that were moved that you want to query against. +- (void)reindexShape:(ChipmunkShape *)shape; + +/// Update the collision info for all shapes attached to a body. +- (void)reindexShapesForBody:(ChipmunkBody *)body; + +/// Step time forward. While variable timesteps may be used, a constant timestep will allow you to reduce CPU usage by using fewer iterations. +- (void)step:(cpFloat)dt; + +@end + +//MARK: Misc + +/** + A macro that defines and initializes shape variables for you in a collision callback. + They are initialized in the order that they were defined in the collision handler associated with the arbiter. + If you defined the handler as: + + @code + [space addCollisionHandler:target typeA:foo typeB:bar ...] + @endcode + + You you will find that @code a->collision_type == 1 @endcode and @code b->collision_type == 2 @endcode. +*/ +#define CHIPMUNK_ARBITER_GET_SHAPES(__arb__, __a__, __b__) ChipmunkShape *__a__, *__b__; { \ + cpShape *__shapeA__, *__shapeB__; \ + cpArbiterGetShapes(__arb__, &__shapeA__, &__shapeB__); \ + __a__ = cpShapeGetUserData(__shapeA__); __b__ = cpShapeGetUserData(__shapeB__); \ +} + +#define CHIPMUNK_ARBITER_GET_BODIES(__arb__, __a__, __b__) ChipmunkBody *__a__, *__b__; { \ + cpBody *__bodyA__, *__bodyB__; \ + cpArbiterGetBodies(__arb__, &__bodyA__, &__bodyB__); \ + __a__ = cpBodyGetUserData(__bodyA__); __b__ = cpBodyGetUserData(__bodyB__); \ +} + + diff --git a/external/Chipmunk/objectivec/include/ObjectiveChipmunk/ObjectiveChipmunk.h b/external/Chipmunk/objectivec/include/ObjectiveChipmunk/ObjectiveChipmunk.h new file mode 100644 index 0000000..bb5648d --- /dev/null +++ b/external/Chipmunk/objectivec/include/ObjectiveChipmunk/ObjectiveChipmunk.h @@ -0,0 +1,80 @@ +/* Copyright (c) 2013 Scott Lembcke + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +#import + +// Override some Chipmunk types for Objective-Chipmunk +#define CP_USE_CGTYPES 1 + +#if __has_feature(objc_arc) + #define CP_DATA_POINTER_TYPE __unsafe_unretained id + #define CP_GROUP_TYPE __unsafe_unretained id + #define CP_COLLISION_TYPE_TYPE __unsafe_unretained id +#else + #define CP_DATA_POINTER_TYPE id + #define CP_GROUP_TYPE id + #define CP_COLLISION_TYPE_TYPE id +#endif + +#ifdef CP_ALLOW_PRIVATE_ACCESS + #undef CP_ALLOW_PRIVATE_ACCESS + #import "chipmunk/chipmunk_private.h" +#else + #import "chipmunk/chipmunk.h" +#endif + +/** + Allows you to add composite objects to a space in a single method call. + The easiest way to implement the ChipmunkObject protocol is to add a @c chipmunkObjects instance variable with a type of @c NSArray* to your class, + create a synthesized property for it, and initialize it with the ChipmunkObjectFlatten() function. +*/ +@protocol ChipmunkObject + +/// Returns a list of ChipmunkBaseObject objects. +- (id )chipmunkObjects; + +@end + + +/// A category to have NSArray implement the ChipmunkObject protocol. +/// They make for very easy containers. +@interface NSArray(ChipmunkObject) +@end + + +@class ChipmunkSpace; + +/** + This protocol is implemented by objects that know how to add themselves to a space. + It's used internally as part of the ChipmunkObject protocol. You should never need to implement it yourself. +*/ +@protocol ChipmunkBaseObject + +- (void)addToSpace:(ChipmunkSpace *)space; +- (void)removeFromSpace:(ChipmunkSpace *)space; + +@end + +#import "ChipmunkBody.h" +#import "ChipmunkShape.h" +#import "ChipmunkConstraint.h" +#import "ChipmunkSpace.h" +#import "ChipmunkMultiGrab.h" diff --git a/external/Chipmunk/objectivec/src/ChipmunkBody.m b/external/Chipmunk/objectivec/src/ChipmunkBody.m new file mode 100644 index 0000000..9b46e24 --- /dev/null +++ b/external/Chipmunk/objectivec/src/ChipmunkBody.m @@ -0,0 +1,186 @@ +// Copyright 2013 Howling Moon Software. All rights reserved. +// See http://chipmunk2d.net/legal.php for more information. + +#define CP_ALLOW_PRIVATE_ACCESS 1 +#import "ObjectiveChipmunk.h" + +@interface ChipmunkSpace(DoubleDispatch) + +- (ChipmunkBody *)addBody:(ChipmunkBody *)obj; +- (ChipmunkBody *)removeBody:(ChipmunkBody *)obj; + +@end + +@implementation ChipmunkBody + +// MARK: Integration Helpers + +-(void)updateVelocity:(cpFloat)dt gravity:(cpVect)gravity damping:(cpFloat)damping +{ + cpBodyUpdateVelocity(&_body, gravity, damping, dt); +} + +-(void)updatePosition:(cpFloat)dt +{ + cpBodyUpdatePosition(&_body, dt); +} + +static void +VelocityFunction +(cpBody *body, cpVect gravity, cpFloat damping, cpFloat dt) +{ + [(ChipmunkBody *)body->userData updateVelocity:dt gravity:gravity damping:damping]; +} + +static void +PositionFunction +(cpBody *body, cpFloat dt) +{ + [(ChipmunkBody *)body->userData updatePosition:dt]; +} + +// Check if the method was overridden. +// No reason to add the extra method overhead if it's not needed. +-(BOOL)methodIsOverriden:(SEL)selector +{ + return ([self methodForSelector:selector] != [[ChipmunkBody class] instanceMethodForSelector:selector]); +} + +// MARK: Constructors + ++(ChipmunkBody *)bodyFromCPBody:(cpBody *)body +{ + ChipmunkBody *obj = body->userData; + cpAssertHard([obj isKindOfClass:[ChipmunkBody class]], "'body->data' is not a pointer to a ChipmunkBody object."); + + return obj; +} + ++ (id)bodyWithMass:(cpFloat)mass andMoment:(cpFloat)moment +{ + return [[[self alloc] initWithMass:mass andMoment:moment] autorelease]; +} + ++ (id)staticBody +{ + ChipmunkBody *body = [[self alloc] initWithMass:0.0f andMoment:0.0f]; + body.type = CP_BODY_TYPE_STATIC; + + return [body autorelease]; +} + ++ (id)kinematicBody +{ + ChipmunkBody *body = [[self alloc] initWithMass:0.0f andMoment:0.0f]; + body.type = CP_BODY_TYPE_KINEMATIC; + + return [body autorelease]; +} + +- (id)initWithMass:(cpFloat)mass andMoment:(cpFloat)moment +{ + if((self = [super init])){ + cpBodyInit(&_body, mass, moment); + _body.userData = self; + + // Setup integration callbacks if necessary. + if([self methodIsOverriden:@selector(updateVelocity:gravity:damping:)]){ + _body.velocity_func = VelocityFunction; + } + + if([self methodIsOverriden:@selector(updatePosition:)]){ + _body.position_func = PositionFunction; + } + } + + return self; +} + +- (void) dealloc +{ + cpBodyDestroy(&_body); + [super dealloc]; +} + +- (cpTransform)transform {return _body.transform;} +- (cpBody *)body {return &_body;} + + +@synthesize userData = _userData; + +// accessor macros +#define getter(type, lower, upper) \ +- (type)lower {return cpBodyGet##upper(&_body);} +#define setter(type, lower, upper) \ +- (void)set##upper:(type)value {cpBodySet##upper(&_body, value);}; +#define both(type, lower, upper) \ +getter(type, lower, upper) \ +setter(type, lower, upper) + + +both(cpBodyType, type, Type) +both(cpFloat, mass, Mass) +both(cpFloat, moment, Moment) +both(cpVect, position, Position) +both(cpVect, velocity, Velocity) +both(cpVect, force, Force) +both(cpFloat, angle, Angle) +both(cpFloat, angularVelocity, AngularVelocity) +both(cpFloat, torque, Torque) +both(cpFloat, velocityLimit, VelocityLimit); +both(cpFloat, angularVelocityLimit, AngularVelocityLimit); + +-(ChipmunkSpace *)space { + cpSpace *space = cpBodyGetSpace(&_body); + return (ChipmunkSpace *)(space ? cpSpaceGetUserData(space) : nil); +} + +- (cpFloat)kineticEnergy {return cpBodyKineticEnergy(&_body);} + +- (cpVect)localToWorld:(cpVect)v {return cpBodyLocalToWorld(&_body, v);} +- (cpVect)worldToLocal:(cpVect)v {return cpBodyWorldToLocal(&_body, v);} + +- (cpVect)velocityAtLocalPoint:(cpVect)p {return cpBodyGetVelocityAtLocalPoint(&_body, p);} +- (cpVect)velocityAtWorldPoint:(cpVect)p {return cpBodyGetVelocityAtWorldPoint(&_body, p);} + +- (void)applyForce:(cpVect)force atLocalPoint:(cpVect)point {cpBodyApplyForceAtLocalPoint(&_body, force, point);} +- (void)applyForce:(cpVect)force atWorldPoint:(cpVect)point {cpBodyApplyForceAtWorldPoint(&_body, force, point);} +- (void)applyImpulse:(cpVect)impulse atLocalPoint:(cpVect)point {cpBodyApplyImpulseAtLocalPoint(&_body, impulse, point);} +- (void)applyImpulse:(cpVect)impulse atWorldPoint:(cpVect)point {cpBodyApplyImpulseAtWorldPoint(&_body, impulse, point);} + +- (bool)isSleeping {return cpBodyIsSleeping(&_body);} + +- (void)activate {cpBodyActivate(&_body);} +- (void)activateStatic:(ChipmunkShape *)filter {cpBodyActivateStatic(&_body, filter.shape);} +- (void)sleepWithGroup:(ChipmunkBody *)group {cpBodySleepWithGroup(&_body, group.body);} +- (void)sleep {cpBodySleep(&_body);} + +- (NSArray *)chipmunkObjects {return [NSArray arrayWithObject:self];} +- (void)addToSpace:(ChipmunkSpace *)space {[space addBody:self];} +- (void)removeFromSpace:(ChipmunkSpace *)space {[space removeBody:self];} + +static void PushShape(cpBody *ignored, cpShape *shape, NSMutableArray *arr){[arr addObject:shape->userData];} +- (NSArray *)shapes +{ + NSMutableArray *arr = [NSMutableArray array]; + cpBodyEachShape(&_body, (cpBodyShapeIteratorFunc)PushShape, arr); + + return arr; +} + +static void PushConstraint(cpBody *ignored, cpConstraint *constraint, NSMutableArray *arr){[arr addObject:constraint->userData];} +- (NSArray *)constraints +{ + NSMutableArray *arr = [NSMutableArray array]; + cpBodyEachConstraint(&_body, (cpBodyConstraintIteratorFunc)PushConstraint, arr); + + return arr; +} + +static void CallArbiterBlock(cpBody *body, cpArbiter *arbiter, ChipmunkBodyArbiterIteratorBlock block){block(arbiter);} +- (void)eachArbiter:(ChipmunkBodyArbiterIteratorBlock)block +{ + cpBodyEachArbiter(&_body, (cpBodyArbiterIteratorFunc)CallArbiterBlock, block); +} + +@end diff --git a/external/Chipmunk/objectivec/src/ChipmunkConstraint.m b/external/Chipmunk/objectivec/src/ChipmunkConstraint.m new file mode 100644 index 0000000..21a6e7c --- /dev/null +++ b/external/Chipmunk/objectivec/src/ChipmunkConstraint.m @@ -0,0 +1,443 @@ +// Copyright 2013 Howling Moon Software. All rights reserved. +// See http://chipmunk2d.net/legal.php for more information. + +#define CP_ALLOW_PRIVATE_ACCESS 1 +#import "ObjectiveChipmunk.h" + +@interface ChipmunkSpace(DoubleDispatch) + +- (ChipmunkConstraint *)addConstraint:(ChipmunkConstraint *)obj; +- (ChipmunkConstraint *)removeConstraint:(ChipmunkConstraint *)obj; + +@end + +@implementation ChipmunkConstraint + +@synthesize userData = _userData; + ++(ChipmunkConstraint *)constraintFromCPConstraint:(cpConstraint *)constraint +{ + ChipmunkConstraint *obj = constraint->userData; + cpAssertHard([obj isKindOfClass:[ChipmunkConstraint class]], "'constraint->data' is not a pointer to a ChipmunkConstraint object."); + + return obj; +} + +- (void) dealloc +{ + cpConstraint *constraint = self.constraint; + [self.bodyA release]; + [self.bodyB release]; + cpConstraintDestroy(constraint); + + [super dealloc]; +} + +- (cpConstraint *)constraint +{ + [self doesNotRecognizeSelector:_cmd]; + return nil; +} + +// accessor macros +#define getter(type, lower, upper) \ +- (type)lower {return self.constraint->lower;} +#define setter(type, lower, upper) \ +- (void)set##upper:(type)value {self.constraint->lower = value;}; +#define both(type, lower, upper) \ +getter(type, lower, upper) \ +setter(type, lower, upper) + +both(cpFloat, maxForce, MaxForce) +both(cpFloat, errorBias, ErrorBias) +both(cpFloat, maxBias, MaxBias) + +-(cpFloat)impulse {return cpConstraintGetImpulse(self.constraint);} + +-(ChipmunkSpace *)space { + cpSpace *space = cpConstraintGetSpace(self.constraint); + return (ChipmunkSpace *)(space ? cpSpaceGetUserData(space) : nil); +} + +- (ChipmunkBody *)bodyA +{ + cpBody *body = self.constraint->a; + return (body ? body->userData : nil); +} + +//- (void)setBodyA:(ChipmunkBody *)value { +// if(self.bodyA != value){ +// [self.bodyA release]; +// self.constraint->a = [[value retain] body]; +// } +//} + +- (ChipmunkBody *)bodyB +{ + cpBody *body = self.constraint->b; + return (body ? body->userData : nil); +} + +//- (void)setBodyB:(ChipmunkBody *)value { +// if(self.bodyB != value){ +// [self.bodyB release]; +// self.constraint->b = [[value retain] body]; +// } +//} + +- (NSArray *)chipmunkObjects {return [NSArray arrayWithObject:self];} +- (void)addToSpace:(ChipmunkSpace *)space {[space addConstraint:self];} +- (void)removeFromSpace:(ChipmunkSpace *)space {[space removeConstraint:self];} + +-(void)preSolve:(ChipmunkSpace *)space {} +-(void)postSolve:(ChipmunkSpace *)space {} + +// MARK: Callbacks +static void +PreSolve(cpConstraint *constraint, cpSpace *space) +{ + [(ChipmunkConstraint *)constraint->userData preSolve:(ChipmunkSpace *)space->userData]; +} + +static void +PostSolve(cpConstraint *constraint, cpSpace *space) +{ + [(ChipmunkConstraint *)constraint->userData postSolve:(ChipmunkSpace *)space->userData]; +} + +// Check if the method was overridden. +// No reason to add the extra method overhead if it's not needed. +-(BOOL)methodIsOverriden:(SEL)selector +{ + return ([self methodForSelector:selector] != [[ChipmunkConstraint class] instanceMethodForSelector:selector]); +} + +-(void)setupCallbacks +{ + if([self methodIsOverriden:@selector(preSolve:)]){ + cpConstraintSetPreSolveFunc(self.constraint, PreSolve); + } + + if([self methodIsOverriden:@selector(postSolve:)]){ + cpConstraintSetPostSolveFunc(self.constraint, PostSolve); + } +} + +@end + +// accessor macros +#define getter2(type, struct, lower, upper) \ +- (type)lower {return struct##Get##upper((cpConstraint *)&_constraint);} +#define setter2(type, struct, lower, upper) \ +- (void)set##upper:(type)value {struct##Set##upper((cpConstraint *)&_constraint, value);}; +#define both2(type, struct, lower, upper) \ +getter2(type, struct, lower, upper) \ +setter2(type, struct, lower, upper) + + +@implementation ChipmunkPinJoint + ++ (id)pinJointWithBodyA:(ChipmunkBody *)a bodyB:(ChipmunkBody *)b anchr1:(cpVect)anchr1 anchr2:(cpVect)anchr2 +{ + return [[[self alloc] initWithBodyA:a bodyB:b anchr1:anchr1 anchr2:anchr2] autorelease]; +} + +- (cpConstraint *)constraint {return (cpConstraint *)&_constraint;} + +- (id)initWithBodyA:(ChipmunkBody *)a bodyB:(ChipmunkBody *)b anchr1:(cpVect)anchr1 anchr2:(cpVect)anchr2 +{ + if((self = [super init])){ + [a retain]; + [b retain]; + cpPinJointInit(&_constraint, a.body, b.body, anchr1, anchr2); + self.constraint->userData = self; + + [self setupCallbacks]; + } + + return self; +} + +both2(cpVect, cpPinJoint, anchr1, Anchr1) +both2(cpVect, cpPinJoint, anchr2, Anchr2) +both2(cpFloat, cpPinJoint, dist, Dist) + +@end + + +@implementation ChipmunkSlideJoint + ++ (id)slideJointWithBodyA:(ChipmunkBody *)a bodyB:(ChipmunkBody *)b anchr1:(cpVect)anchr1 anchr2:(cpVect)anchr2 min:(cpFloat)min max:(cpFloat)max +{ + return [[[self alloc] initWithBodyA:a bodyB:b anchr1:anchr1 anchr2:anchr2 min:min max:max] autorelease]; +} + +- (cpConstraint *)constraint {return (cpConstraint *)&_constraint;} + +- (id)initWithBodyA:(ChipmunkBody *)a bodyB:(ChipmunkBody *)b anchr1:(cpVect)anchr1 anchr2:(cpVect)anchr2 min:(cpFloat)min max:(cpFloat)max +{ + if((self = [super init])){ + [a retain]; + [b retain]; + cpSlideJointInit(&_constraint, a.body, b.body, anchr1, anchr2, min, max); + self.constraint->userData = self; + + [self setupCallbacks]; + } + + return self; +} + +both2(cpVect, cpSlideJoint, anchr1, Anchr1) +both2(cpVect, cpSlideJoint, anchr2, Anchr2) +both2(cpFloat, cpSlideJoint, min, Min) +both2(cpFloat, cpSlideJoint, max, Max) + +@end + + +@implementation ChipmunkPivotJoint + ++ (id)pivotJointWithBodyA:(ChipmunkBody *)a bodyB:(ChipmunkBody *)b anchr1:(cpVect)anchr1 anchr2:(cpVect)anchr2 +{ + return [[[self alloc] initWithBodyA:a bodyB:b anchr1:anchr1 anchr2:anchr2] autorelease]; +} + ++ (id)pivotJointWithBodyA:(ChipmunkBody *)a bodyB:(ChipmunkBody *)b pivot:(cpVect)pivot +{ + return [[[self alloc] initWithBodyA:a bodyB:b pivot:pivot] autorelease]; +} + +- (cpConstraint *)constraint {return (cpConstraint *)&_constraint;} + +- (id)initWithBodyA:(ChipmunkBody *)a bodyB:(ChipmunkBody *)b anchr1:(cpVect)anchr1 anchr2:(cpVect)anchr2 +{ + if((self = [super init])){ + [a retain]; + [b retain]; + cpPivotJointInit(&_constraint, a.body, b.body, anchr1, anchr2); + self.constraint->userData = self; + + [self setupCallbacks]; + } + + return self; +} + +- (id)initWithBodyA:(ChipmunkBody *)a bodyB:(ChipmunkBody *)b pivot:(cpVect)pivot +{ + return [self initWithBodyA:a bodyB:b anchr1:[a worldToLocal:pivot] anchr2:[b worldToLocal:pivot]]; +} + +both2(cpVect, cpPivotJoint, anchr1, Anchr1) +both2(cpVect, cpPivotJoint, anchr2, Anchr2) + +@end + + +@implementation ChipmunkGrooveJoint + ++ (id)grooveJointWithBodyA:(ChipmunkBody *)a bodyB:(ChipmunkBody *)b groove_a:(cpVect)groove_a groove_b:(cpVect)groove_b anchr2:(cpVect)anchr2 +{ + return [[[self alloc] initWithBodyA:a bodyB:b groove_a:groove_a groove_b:groove_b anchr2:anchr2] autorelease]; +} + +- (cpConstraint *)constraint {return (cpConstraint *)&_constraint;} + +- (id)initWithBodyA:(ChipmunkBody *)a bodyB:(ChipmunkBody *)b groove_a:(cpVect)groove_a groove_b:(cpVect)groove_b anchr2:(cpVect)anchr2 +{ + if((self = [super init])){ + [a retain]; + [b retain]; + cpGrooveJointInit(&_constraint, a.body, b.body, groove_a, groove_b, anchr2); + self.constraint->userData = self; + + [self setupCallbacks]; + } + + return self; +} + +both2(cpVect, cpGrooveJoint, grooveA, GrooveA) +both2(cpVect, cpGrooveJoint, grooveB, GrooveB) +both2(cpVect, cpPivotJoint, anchr2, Anchr2) + +@end + + +@implementation ChipmunkDampedSpring + ++ (id)dampedSpringWithBodyA:(ChipmunkBody *)a bodyB:(ChipmunkBody *)b anchr1:(cpVect)anchr1 anchr2:(cpVect)anchr2 restLength:(cpFloat)restLength stiffness:(cpFloat)stiffness damping:(cpFloat)damping +{ + return [[[self alloc] initWithBodyA:a bodyB:b anchr1:anchr1 anchr2:anchr2 restLength:restLength stiffness:stiffness damping:damping] autorelease]; +} + +- (cpConstraint *)constraint {return (cpConstraint *)&_constraint;} + +- (id)initWithBodyA:(ChipmunkBody *)a bodyB:(ChipmunkBody *)b anchr1:(cpVect)anchr1 anchr2:(cpVect)anchr2 restLength:(cpFloat)restLength stiffness:(cpFloat)stiffness damping:(cpFloat)damping +{ + if((self = [super init])){ + [a retain]; + [b retain]; + cpDampedSpringInit(&_constraint, a.body, b.body, anchr1, anchr2, restLength, stiffness, damping); + self.constraint->userData = self; + + [self setupCallbacks]; + } + + return self; +} + +both2(cpVect, cpDampedSpring, anchr1, Anchr1) +both2(cpVect, cpDampedSpring, anchr2, Anchr2) +both2(cpFloat, cpDampedSpring, restLength, RestLength) +both2(cpFloat, cpDampedSpring, stiffness, Stiffness) +both2(cpFloat, cpDampedSpring, damping, Damping) + +@end + + +@implementation ChipmunkDampedRotarySpring + ++ (id)dampedRotarySpringWithBodyA:(ChipmunkBody *)a bodyB:(ChipmunkBody *)b restAngle:(cpFloat)restAngle stiffness:(cpFloat)stiffness damping:(cpFloat)damping +{ + return [[[self alloc] initWithBodyA:a bodyB:b restAngle:restAngle stiffness:stiffness damping:damping] autorelease]; +} + +- (cpConstraint *)constraint {return (cpConstraint *)&_constraint;} + +- (id)initWithBodyA:(ChipmunkBody *)a bodyB:(ChipmunkBody *)b restAngle:(cpFloat)restAngle stiffness:(cpFloat)stiffness damping:(cpFloat)damping +{ + if((self = [super init])){ + [a retain]; + [b retain]; + cpDampedRotarySpringInit(&_constraint, a.body, b.body, restAngle, stiffness, damping); + self.constraint->userData = self; + + [self setupCallbacks]; + } + + return self; +} + +both2(cpFloat, cpDampedRotarySpring, restAngle, RestAngle) +both2(cpFloat, cpDampedRotarySpring, stiffness, Stiffness) +both2(cpFloat, cpDampedRotarySpring, damping, Damping) + +@end + + +@implementation ChipmunkRotaryLimitJoint + ++ (id)rotaryLimitJointWithBodyA:(ChipmunkBody *)a bodyB:(ChipmunkBody *)b min:(cpFloat)min max:(cpFloat)max +{ + return [[[self alloc] initWithBodyA:a bodyB:b min:min max:max] autorelease]; +} + +- (cpConstraint *)constraint {return (cpConstraint *)&_constraint;} + +- (id)initWithBodyA:(ChipmunkBody *)a bodyB:(ChipmunkBody *)b min:(cpFloat)min max:(cpFloat)max +{ + if((self = [super init])){ + [a retain]; + [b retain]; + cpRotaryLimitJointInit(&_constraint, a.body, b.body, min, max); + self.constraint->userData = self; + + [self setupCallbacks]; + } + + return self; +} + +both2(cpFloat, cpRotaryLimitJoint, min, Min) +both2(cpFloat, cpRotaryLimitJoint, max, Max) + +@end + + +@implementation ChipmunkSimpleMotor + ++ (id)simpleMotorWithBodyA:(ChipmunkBody *)a bodyB:(ChipmunkBody *)b rate:(cpFloat)rate +{ + return [[[self alloc] initWithBodyA:a bodyB:b rate:rate] autorelease]; +} + +- (cpConstraint *)constraint {return (cpConstraint *)&_constraint;} + +- (id)initWithBodyA:(ChipmunkBody *)a bodyB:(ChipmunkBody *)b rate:(cpFloat)rate +{ + if((self = [super init])){ + [a retain]; + [b retain]; + cpSimpleMotorInit(&_constraint, a.body, b.body, rate); + self.constraint->userData = self; + + [self setupCallbacks]; + } + + return self; +} + +both2(cpFloat, cpSimpleMotor, rate, Rate) + +@end + + +@implementation ChipmunkGearJoint + ++ (id)gearJointWithBodyA:(ChipmunkBody *)a bodyB:(ChipmunkBody *)b phase:(cpFloat)phase ratio:(cpFloat)ratio +{ + return [[[self alloc] initWithBodyA:a bodyB:b phase:phase ratio:ratio] autorelease]; +} + +- (cpConstraint *)constraint {return (cpConstraint *)&_constraint;} + +- (id)initWithBodyA:(ChipmunkBody *)a bodyB:(ChipmunkBody *)b phase:(cpFloat)phase ratio:(cpFloat)ratio +{ + if((self = [super init])){ + [a retain]; + [b retain]; + cpGearJointInit(&_constraint, a.body, b.body, phase, ratio); + self.constraint->userData = self; + + [self setupCallbacks]; + } + + return self; +} + +both2(cpFloat, cpGearJoint, phase, Phase) +both2(cpFloat, cpGearJoint, ratio, Ratio) + +@end + + +@implementation ChipmunkRatchetJoint + ++ (id)ratchetJointWithBodyA:(ChipmunkBody *)a bodyB:(ChipmunkBody *)b phase:(cpFloat)phase ratchet:(cpFloat)ratchet +{ + return [[[self alloc] initWithBodyA:a bodyB:b phase:phase ratchet:ratchet] autorelease]; +} + +- (cpConstraint *)constraint {return (cpConstraint *)&_constraint;} + +- (id)initWithBodyA:(ChipmunkBody *)a bodyB:(ChipmunkBody *)b phase:(cpFloat)phase ratchet:(cpFloat)ratchet +{ + if((self = [super init])){ + [a retain]; + [b retain]; + cpRatchetJointInit(&_constraint, a.body, b.body, phase, ratchet); + self.constraint->userData = self; + + [self setupCallbacks]; + } + + return self; +} + +both2(cpFloat, cpRatchetJoint, angle, Angle) +both2(cpFloat, cpRatchetJoint, phase, Phase) +both2(cpFloat, cpRatchetJoint, ratchet, Ratchet) + +@end diff --git a/external/Chipmunk/objectivec/src/ChipmunkMultiGrab.m b/external/Chipmunk/objectivec/src/ChipmunkMultiGrab.m new file mode 100644 index 0000000..16a0a2b --- /dev/null +++ b/external/Chipmunk/objectivec/src/ChipmunkMultiGrab.m @@ -0,0 +1,246 @@ +// Copyright 2013 Howling Moon Software. All rights reserved. +// See http://chipmunk2d.net/legal.php for more information. + +#import "ChipmunkMultiGrab.h" + + +// A constraint subclass that tracks a grab point +@interface ChipmunkGrab() + +@property(nonatomic, readwrite) cpVect pos; +@property(nonatomic, readonly) NSArray *chipmunkObjects; + +@end + + +@implementation ChipmunkGrab + +@synthesize pos = _pos; +@synthesize chipmunkObjects = _chipmunkObjects; +@synthesize grabbedShape = _grabbedShape; +@synthesize data = _data; + +static void +GrabPreSolve(cpConstraint *constraint, cpSpace *space) +{ + cpBody *grabBody = cpConstraintGetA(constraint); + ChipmunkGrab *grab = [ChipmunkConstraint constraintFromCPConstraint:constraint].userData; + cpFloat dt = cpSpaceGetCurrentTimeStep(space); + cpFloat coef = cpfpow(grab->_smoothing, dt); + + // Smooth out the mouse position. + cpVect pos = cpvlerp(grab->_pos, cpBodyGetPosition(grabBody), coef); + cpBodySetVelocity(grabBody, cpvmult(cpvsub(pos, cpBodyGetPosition(grabBody)), 1.0/dt)); + cpBodySetPosition(grabBody, pos); +} + +// Body will be nil if no object was grabbed. +-(id)initWithMultiGrab:(ChipmunkMultiGrab *)multiGrab pos:(cpVect)pos nearest:(cpVect)nearest + body:(ChipmunkBody *)body grabbedShape:(ChipmunkShape *)grabbedShape + chipmunkObjects:(NSArray *)chipmunkObjects +{ + ChipmunkBody *grabBody = [ChipmunkBody kinematicBody]; + grabBody.position = pos; + // TODO the repeated appending is a little silly here. + chipmunkObjects = [chipmunkObjects arrayByAddingObject:grabBody]; + + if((self = [super init])){ + _pos = pos; + _smoothing = multiGrab.smoothing; + _grabbedShape = grabbedShape; + + if(body){ + ChipmunkPivotJoint *pivot = [ChipmunkPivotJoint pivotJointWithBodyA:grabBody bodyB:body anchr1:cpvzero anchr2:[body worldToLocal:nearest]]; + pivot.maxForce = multiGrab.grabForce; + pivot.userData = self; + cpConstraintSetPreSolveFunc(pivot.constraint, GrabPreSolve); + chipmunkObjects = [chipmunkObjects arrayByAddingObject:pivot]; + + if(grabbedShape){ + cpFloat frictionForce = multiGrab.grabFriction; + if(frictionForce > 0.0 && (1.0/body.mass + 1.0/grabBody.mass != 0.0)){ + ChipmunkPivotJoint *friction = [ChipmunkPivotJoint pivotJointWithBodyA:grabBody bodyB:body anchr1:cpvzero anchr2:[body worldToLocal:nearest]]; + friction.maxForce = frictionForce; + friction.maxBias = 0.0; + chipmunkObjects = [chipmunkObjects arrayByAddingObject:friction]; + } + + cpFloat rotaryFriction = multiGrab.grabRotaryFriction; + if(rotaryFriction > 0.0 && (1.0/body.moment + 1.0/grabBody.moment != 0.0)){ + ChipmunkGearJoint *friction = [ChipmunkGearJoint gearJointWithBodyA:grabBody bodyB:body phase:0.0 ratio:1.0]; + friction.maxForce = rotaryFriction; + friction.maxBias = 0.0; + chipmunkObjects = [chipmunkObjects arrayByAddingObject:friction]; + } + } + + _chipmunkObjects = [chipmunkObjects retain]; + } + } + + return self; +} + +-(void)dealloc +{ + [_chipmunkObjects release]; _chipmunkObjects = nil; + [super dealloc]; +} + +@end + + +@implementation ChipmunkMultiGrab + +@synthesize grabForce = _grabForce; +@synthesize smoothing = _smoothing; + +@synthesize filter = _filter; +@synthesize grabFilter = _grabFilter; +@synthesize grabSort = _grabSort; + +@synthesize grabFriction = _grabFriction, grabRotaryFriction = _grabRotaryFriction; +@synthesize grabRadius = _grabRadius; + +@synthesize pullMode = _pullMode, pushMode = _pushMode; + +@synthesize pushMass = _pushMass; +@synthesize pushFriction = _pushFriction, pushElasticity = _pushElasticity; +@synthesize pushCollisionType = _pushCollisionType; + +-(id)initForSpace:(ChipmunkSpace *)space withSmoothing:(cpFloat)smoothing withGrabForce:(cpFloat)grabForce +{ + if((self = [super init])){ + _space = [space retain]; + _grabs = [[NSMutableArray alloc] init]; + + _smoothing = smoothing; + _grabForce = grabForce; + + _filter = CP_SHAPE_FILTER_ALL; + + _grabFilter = ^(ChipmunkShape *shape){return (bool)TRUE;}; + _grabSort = ^(ChipmunkShape *shape, cpFloat depth){return depth;}; + + _pullMode = TRUE; + _pushMode = FALSE; + } + + return self; +} + +-(void)dealloc +{ + [_space release]; + [_grabs release]; + + [super dealloc]; +} + +// Don't integrate push bodies. +static void PushBodyVelocityUpdate(cpBody *body, cpVect gravity, cpFloat damping, cpFloat dt){} + +-(ChipmunkGrab *)beginLocation:(cpVect)pos +{ + __block cpFloat min = INFINITY; + __block cpVect nearest = pos; + __block ChipmunkShape *grabbedShape = nil; + + if(_pullMode){ + cpSpacePointQuery_b(_space.space, pos, _grabRadius, _filter, ^(cpShape *c_shape, cpVect point, cpFloat dist, cpVect gradient){ + ChipmunkShape *shape = [ChipmunkShape shapeFromCPShape:c_shape]; + cpFloat sort = dist; + + // Call the sorting callback if dist is negative. + // Otherwise just take the nearest shape. + if(dist <= 0.0f){ + sort = -_grabSort(shape, -dist); + cpAssertWarn(sort <= 0.0f, "You must return a positive value from the sorting callback."); + } + + if(sort < min && cpBodyGetMass(cpShapeGetBody(c_shape)) != INFINITY){ + if(_grabFilter(shape)){ + min = sort; + nearest = (dist > 0.0 ? point : pos); + grabbedShape = shape; + } + } + }); + } + + ChipmunkBody *pushBody = nil; + NSArray *chipmunkObjects = [NSArray array]; + + if(!grabbedShape && _pushMode){ + pushBody = [ChipmunkBody bodyWithMass:_pushMass andMoment:INFINITY]; + pushBody.position = pos; + pushBody.body->velocity_func = PushBodyVelocityUpdate; + + ChipmunkShape *pushShape = [ChipmunkCircleShape circleWithBody:pushBody radius:_grabRadius offset:cpvzero]; + pushShape.friction = _pushFriction; + pushShape.elasticity = _pushElasticity; + pushShape.filter = _filter; + pushShape.collisionType = _pushCollisionType; + + chipmunkObjects = [NSArray arrayWithObjects:pushBody, pushShape, nil]; + } + + ChipmunkBody *grabBody = (grabbedShape ? grabbedShape.body : pushBody); + ChipmunkGrab *grab = [[ChipmunkGrab alloc] initWithMultiGrab:self pos:pos nearest:nearest body:grabBody grabbedShape:grabbedShape chipmunkObjects:chipmunkObjects]; + + [_grabs addObject:grab]; + [_space add:grab]; + [grab release]; + + return (grab.grabbedShape ? grab : nil); +} + +static ChipmunkGrab * +BestGrab(NSArray *grabs, cpVect pos) +{ + ChipmunkGrab *match = nil; + cpFloat best = INFINITY; + + for(ChipmunkGrab *grab in grabs){ + cpFloat dist = cpvdistsq(pos, grab.pos); + if(dist < best){ + match = grab; + best = dist; + } + } + + return match; +} + +-(ChipmunkGrab *)updateLocation:(cpVect)pos +{ + ChipmunkGrab *grab = BestGrab(_grabs, pos); + grab.pos = pos; + + return (grab.grabbedShape ? grab : nil); +} + +-(ChipmunkGrab *)endLocation:(cpVect)pos +{ + cpAssertHard([_grabs count] != 0, "Grab set is already empty!"); + ChipmunkGrab *grab = BestGrab(_grabs, pos); + [grab retain]; + + [_space remove:grab]; + [_grabs removeObject:grab]; + + [grab autorelease]; + return (grab.grabbedShape ? grab : nil); +} + +-(NSArray *)grabs +{ + NSMutableArray *grabs = [NSMutableArray array]; + for(ChipmunkGrab *grab in _grabs){ + if(grab.grabbedShape) [grabs addObject:grab]; + } + + return grabs; +} + +@end diff --git a/external/Chipmunk/objectivec/src/ChipmunkShape.m b/external/Chipmunk/objectivec/src/ChipmunkShape.m new file mode 100644 index 0000000..6d0bc57 --- /dev/null +++ b/external/Chipmunk/objectivec/src/ChipmunkShape.m @@ -0,0 +1,306 @@ +// Copyright 2013 Howling Moon Software. All rights reserved. +// See http://chipmunk2d.net/legal.php for more information. + +#define CP_ALLOW_PRIVATE_ACCESS 1 +#import "ObjectiveChipmunk.h" + +@interface ChipmunkSpace(DoubleDispatch) + +- (ChipmunkShape *)addShape:(ChipmunkShape *)obj; +- (ChipmunkShape *)removeShape:(ChipmunkShape *)obj; + +@end + +@implementation ChipmunkShape + +@synthesize userData = _userData; + ++(ChipmunkShape *)shapeFromCPShape:(cpShape *)shape +{ + ChipmunkShape *obj = shape->userData; + cpAssertHard([obj isKindOfClass:[ChipmunkShape class]], "'shape->data' is not a pointer to a ChipmunkShape object."); + + return obj; +} + +- (void) dealloc { + [self.body release]; + cpShapeDestroy(self.shape); + [super dealloc]; +} + + +- (cpShape *)shape { + [self doesNotRecognizeSelector:_cmd]; + return nil; +} + +- (ChipmunkBody *)body { + cpBody *body = self.shape->body; + return (body ? body->userData : nil); +} + +- (void)setBody:(ChipmunkBody *)value { + if(self.body != value){ + [self.body release]; + self.shape->body = [[value retain] body]; + } +} + +-(cpFloat)mass {return cpShapeGetMass(self.shape);} +-(void)setMass:(cpFloat)mass {cpShapeSetMass(self.shape, mass);} + +-(cpFloat)density {return cpShapeGetDensity(self.shape);} +-(void)setDensity:(cpFloat)density {cpShapeSetDensity(self.shape, density);} + +-(cpFloat)moment {return cpShapeGetMoment(self.shape);} +-(cpFloat)area {return cpShapeGetArea(self.shape);} +-(cpVect)centerOfGravity {return cpShapeGetCenterOfGravity(self.shape);} + +// accessor macros +#define getter(type, lower, upper, member) \ +- (type)lower {return self.shape->member;} +#define setter(type, lower, upper, member) \ +- (void)set##upper:(type)value {self.shape->member = value;}; +#define both(type, lower, upper, member) \ +getter(type, lower, upper, member) \ +setter(type, lower, upper, member) + +getter(cpBB, bb, BB, bb) +both(BOOL, sensor, Sensor, sensor) +both(cpFloat, elasticity, Elasticity, e) +both(cpFloat, friction, Friction, u) +both(cpVect, surfaceVelocity, SurfaceVelocity, surfaceV) +both(cpCollisionType, collisionType, CollisionType, type) +both(cpShapeFilter, filter, Filter, filter) + +-(ChipmunkSpace *)space { + cpSpace *space = cpShapeGetSpace(self.shape); + return (ChipmunkSpace *)(space ? cpSpaceGetUserData(space) : nil); +} + +- (cpBB)cacheBB {return cpShapeCacheBB(self.shape);} + +- (ChipmunkPointQueryInfo *)pointQuery:(cpVect)point +{ + cpPointQueryInfo info; + cpShapePointQuery(self.shape, point, &info); + return (info.shape ? [[[ChipmunkPointQueryInfo alloc] initWithInfo:&info] autorelease] : nil); +} + +- (ChipmunkSegmentQueryInfo *)segmentQueryFrom:(cpVect)start to:(cpVect)end radius:(cpFloat)radius +{ + cpSegmentQueryInfo info; + if(cpShapeSegmentQuery(self.shape, start, end, radius, &info)){ + return [[[ChipmunkSegmentQueryInfo alloc] initWithInfo:&info start:start end:end] autorelease]; + } else { + return nil; + } +} + + +- (NSArray *)chipmunkObjects {return [NSArray arrayWithObject:self];} +- (void)addToSpace:(ChipmunkSpace *)space {[space addShape:self];} +- (void)removeFromSpace:(ChipmunkSpace *)space {[space removeShape:self];} + +@end + + +@implementation ChipmunkPointQueryInfo + +- (id)initWithInfo:(cpPointQueryInfo *)info +{ + if((self = [super init])){ + _info = (*info); + [self.shape retain]; + } + + return self; +} + +- (cpPointQueryInfo *)info {return &_info;} +- (ChipmunkShape *)shape {return (_info.shape ? _info.shape->userData : nil);} +- (cpVect)point {return _info.point;} +- (cpFloat)distance {return _info.distance;} +- (cpVect)gradient {return _info.gradient;} + +- (void)dealloc +{ + [self.shape release]; + [super dealloc]; +} + + +@end + + +@implementation ChipmunkSegmentQueryInfo + +- (id)initWithInfo:(cpSegmentQueryInfo *)info start:(cpVect)start end:(cpVect)end +{ + if((self = [super init])){ + _info = (*info); + _start = start; + _end = end; + + [self.shape retain]; + } + + return self; +} + +- (cpSegmentQueryInfo *)info {return &_info;} +- (ChipmunkShape *)shape {return (_info.shape ? _info.shape->userData : nil);} +- (cpFloat)t {return _info.alpha;} +- (cpVect)normal {return _info.normal;} +- (cpVect)point {return _info.point;} +- (cpFloat)dist {return cpvdist(_start, _end)*_info.alpha;} +- (cpVect)start {return _start;} +- (cpVect)end {return _end;} + +- (void)dealloc +{ + [self.shape release]; + [super dealloc]; +} + + +@end + + +@implementation ChipmunkShapeQueryInfo + +@synthesize shape = _shape; +- (cpContactPointSet *)contactPoints {return &_contactPoints;} + +- (id)initWithShape:(ChipmunkShape *)shape andPoints:(cpContactPointSet *)set +{ + if((self = [super init])){ + _shape = [shape retain]; + _contactPoints = *set; + } + + return self; +} + +- (void)dealloc { + [_shape release]; + [super dealloc]; +} + +@end + +@implementation ChipmunkCircleShape + ++ (ChipmunkCircleShape *)circleWithBody:(ChipmunkBody *)body radius:(cpFloat)radius offset:(cpVect)offset +{ + return [[[self alloc] initWithBody:body radius:radius offset:offset] autorelease]; +} + +- (cpShape *)shape {return (cpShape *)&_shape;} + +- (id)initWithBody:(ChipmunkBody *)body radius:(cpFloat)radius offset:(cpVect)offset { + if((self = [super init])){ + [body retain]; + cpCircleShapeInit(&_shape, body.body, radius, offset); + self.shape->userData = self; + } + + return self; +} + +- (cpFloat)radius {return cpCircleShapeGetRadius((cpShape *)&_shape);} +- (cpVect)offset {return cpCircleShapeGetOffset((cpShape *)&_shape);} + +@end + + +@implementation ChipmunkSegmentShape + ++ (ChipmunkSegmentShape *)segmentWithBody:(ChipmunkBody *)body from:(cpVect)a to:(cpVect)b radius:(cpFloat)radius +{ + return [[[self alloc] initWithBody:body from:a to:b radius:radius] autorelease]; +} + +- (cpShape *)shape {return (cpShape *)&_shape;} + +- (id)initWithBody:(ChipmunkBody *)body from:(cpVect)a to:(cpVect)b radius:(cpFloat)radius { + if((self = [super init])){ + [body retain]; + cpSegmentShapeInit(&_shape, body.body, a, b, radius); + self.shape->userData = self; + } + + return self; +} + +- (void)setPrevNeighbor:(cpVect)prev nextNeighbor:(cpVect)next +{ + cpSegmentShapeSetNeighbors((cpShape *)&_shape, prev, next); +} + +- (cpVect)a {return cpSegmentShapeGetA((cpShape *)&_shape);} +- (cpVect)b {return cpSegmentShapeGetB((cpShape *)&_shape);} +- (cpVect)normal {return cpSegmentShapeGetNormal((cpShape *)&_shape);} +- (cpFloat)radius {return cpSegmentShapeGetRadius((cpShape *)&_shape);} + +@end + + +@implementation ChipmunkPolyShape + ++ (id)polyWithBody:(ChipmunkBody *)body count:(int)count verts:(const cpVect *)verts transform:(cpTransform)transform radius:(cpFloat)radius +{ + return [[[self alloc] initWithBody:body count:count verts:verts transform:transform radius:radius] autorelease]; +} + ++ (id)boxWithBody:(ChipmunkBody *)body width:(cpFloat)width height:(cpFloat)height radius:(cpFloat)radius +{ + return [[[self alloc] initBoxWithBody:body width:width height:height radius:radius] autorelease]; +} + ++ (id)boxWithBody:(ChipmunkBody *)body bb:(cpBB)bb radius:(cpFloat)radius +{ + return [[[self alloc] initBoxWithBody:body bb:bb radius:radius] autorelease]; +} + +- (cpShape *)shape {return (cpShape *)&_shape;} + +- (id)initWithBody:(ChipmunkBody *)body count:(int)count verts:(const cpVect *)verts transform:(cpTransform)transform radius:(cpFloat)radius +{ + if((self = [super init])){ + [body retain]; + cpPolyShapeInit(&_shape, body.body, count, verts, transform, radius); + self.shape->userData = self; + } + + return self; +} + +- (id)initBoxWithBody:(ChipmunkBody *)body width:(cpFloat)width height:(cpFloat)height radius:(cpFloat)radius +{ + if((self = [super init])){ + [body retain]; + cpBoxShapeInit(&_shape, body.body, width, height, radius); + self.shape->userData = self; + } + + return self; +} + +- (id)initBoxWithBody:(ChipmunkBody *)body bb:(cpBB)bb radius:(cpFloat)radius +{ + if((self = [super init])){ + [body retain]; + cpBoxShapeInit2(&_shape, body.body, bb, radius); + self.shape->userData = self; + } + + return self; +} + +- (int)count {return cpPolyShapeGetCount((cpShape *)&_shape);} +- (cpFloat)radius {return cpPolyShapeGetRadius((cpShape *)&_shape);} +- (cpVect)getVertex:(int)index {return cpPolyShapeGetVert((cpShape *)&_shape, index);} + +@end diff --git a/external/Chipmunk/objectivec/src/ChipmunkSpace.m b/external/Chipmunk/objectivec/src/ChipmunkSpace.m new file mode 100644 index 0000000..19eef11 --- /dev/null +++ b/external/Chipmunk/objectivec/src/ChipmunkSpace.m @@ -0,0 +1,611 @@ +// Copyright 2013 Howling Moon Software. All rights reserved. +// See http://chipmunk2d.net/legal.php for more information. + +#define CP_ALLOW_PRIVATE_ACCESS +#import "ObjectiveChipmunk.h" + +#import + +#ifdef CHIPMUNK_PRO_TRIAL +#if TARGET_OS_IPHONE == 1 + #import +#else + #import +#endif +#endif + +// Just in case the user doesn't have -ObjC in their linker flags. +// Annoyingly, this is the case more often than not. +@interface NSArrayChipmunkObject : NSArray + +@property(nonatomic, retain) NSArray *chipmunkObjects; + +@end + +@implementation NSArrayChipmunkObject + +@synthesize chipmunkObjects = _chipmunkObjects; + +-(id)initWithArray:(NSArray *)objects { + if((self = [super init])){ + self.chipmunkObjects = objects; + } + + return self; +} + +-(NSUInteger)count +{ + return [_chipmunkObjects count]; +} + +-(id)objectAtIndex:(NSUInteger)index +{ + return [_chipmunkObjects objectAtIndex:index]; +} + +@end + +@implementation NSArray(ChipmunkObject) + +-(id)chipmunkObjects +{ + return self; +} + +@end + + +// Private class used to wrap the statically allocated staticBody attached to each space. +@interface _ChipmunkStaticBodySingleton : ChipmunkBody { + cpBody *_bodyPtr; + ChipmunkSpace *space; // weak ref +} + +@end + +typedef struct handlerContext { + id delegate; + ChipmunkSpace *space; + cpCollisionType typeA, typeB; + SEL beginSelector; + bool (*beginFunc)(id self, SEL selector, cpArbiter *arb, ChipmunkSpace *space); + SEL preSolveSelector; + bool (*preSolveFunc)(id self, SEL selector, cpArbiter *arb, ChipmunkSpace *space); + SEL postSolveSelector; + void (*postSolveFunc)(id self, SEL selector, cpArbiter *arb, ChipmunkSpace *space); + SEL separateSelector; + void (*separateFunc)(id self, SEL selector, cpArbiter *arb, ChipmunkSpace *space); +} handlerContext; + +@implementation ChipmunkSpace + +#ifdef CHIPMUNK_PRO_TRIAL +static NSString *dialogTitle = @"Chipmunk Pro Trial"; +static NSString *dialogMessage = @"This copy of Chipmunk Pro is a trial, please consider purchasing if you continue using it."; + ++(void)initialize +{ + [super initialize]; + + static BOOL done = FALSE; + if(done) return; else done = TRUE; + +#if TARGET_OS_IPHONE == 1 + UIAlertView *alert = [[UIAlertView alloc] + initWithTitle:dialogTitle + message:dialogMessage + delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil + ]; + + [alert show]; + [alert release]; +#else + [self performSelectorOnMainThread:@selector(dialog) withObject:nil waitUntilDone:FALSE]; +#endif + +} + +#if TARGET_OS_IPHONE != 1 ++(void)dialog +{ + [NSApplication sharedApplication]; + [[NSAlert + alertWithMessageText:dialogTitle + defaultButton:@"OK" + alternateButton:nil + otherButton:nil + informativeTextWithFormat:dialogMessage + ] runModal]; +} +#endif + +#endif + ++(ChipmunkSpace *)spaceFromCPSpace:(cpSpace *)space +{ + ChipmunkSpace *obj = space->userData; + cpAssertHard([obj isKindOfClass:[ChipmunkSpace class]], "'space->data' is not a pointer to a ChipmunkSpace object."); + + return obj; +} + +- (id)initWithSpace:(cpSpace *)space +{ + if((self = [super init])){ + _children = [[NSMutableSet alloc] init]; + _handlers = [[NSMutableArray alloc] init]; + + _space = space; + cpSpaceSetUserData(_space, self); + + _staticBody = [[ChipmunkBody alloc] initWithMass:0.0f andMoment:0.0f]; + _staticBody.type = CP_BODY_TYPE_STATIC; + cpSpaceSetStaticBody(_space, _staticBody.body); + } + + return self; +} + +- (id)init { + // Use a fast space instead if the class is available. + // However if you don't specify -ObjC as a linker flag the dynamic substitution won't work. + Class hastySpace = NSClassFromString(@"ChipmunkHastySpace"); + if(hastySpace && [self isMemberOfClass:[ChipmunkSpace class]]){ + [self release]; + return [[hastySpace alloc] init]; + } else { + return [self initWithSpace:cpSpaceNew()]; + } +} + +-(void)freeSpace +{ + cpSpaceFree(_space); +} + +- (void) dealloc { + [self freeSpace]; + [_staticBody release]; + + [_children release]; + [_handlers release]; + + [super dealloc]; +} + +- (cpSpace *)space {return _space;} + +@synthesize userData = _userData; + +// accessor macros +#define getter(type, lower, upper) \ +- (type)lower {return cpSpaceGet##upper(_space);} +#define setter(type, lower, upper) \ +- (void)set##upper:(type)value {cpSpaceSet##upper(_space, value);}; +#define both(type, lower, upper) \ +getter(type, lower, upper) \ +setter(type, lower, upper) + +both(int, iterations, Iterations); +both(cpVect, gravity, Gravity); +both(cpFloat, damping, Damping); +both(cpFloat, idleSpeedThreshold, IdleSpeedThreshold); +both(cpFloat, sleepTimeThreshold, SleepTimeThreshold); +both(cpFloat, collisionSlop, CollisionSlop); +both(cpFloat, collisionBias, CollisionBias); +both(cpTimestamp, collisionPersistence, CollisionPersistence); +getter(cpFloat, currentTimeStep, CurrentTimeStep); + +- (ChipmunkBody *)staticBody {return _staticBody;} + +//static bool Begin(cpArbiter *arb, struct cpSpace *space, handlerContext *ctx){return ctx->beginFunc(ctx->delegate, ctx->beginSelector, arb, ctx->space);} +//static bool PreSolve(cpArbiter *arb, struct cpSpace *space, handlerContext *ctx){return ctx->preSolveFunc(ctx->delegate, ctx->preSolveSelector, arb, ctx->space);} +//static void PostSolve(cpArbiter *arb, struct cpSpace *space, handlerContext *ctx){return ctx->postSolveFunc(ctx->delegate, ctx->postSolveSelector, arb, ctx->space);} +//static void Separate(cpArbiter *arb, struct cpSpace *space, handlerContext *ctx){return ctx->separateFunc(ctx->delegate, ctx->separateSelector, arb, ctx->space);} +// +// +////#define HFUNC(fname, Fname) (fname ? (cpCollision##Fname##Func)fname : NULL) +////#define HFUNCS() \ +////HFUNC(begin, Begin), \ +////HFUNC(preSolve, PreSolve), \ +////HFUNC(postSolve, PostSolve), \ +////HFUNC(separate, Separate) +// +//// Free collision handler delegates for the given type pair +//static void +//FilterHandlers(NSMutableArray **handlers, cpCollisionType typeA, cpCollisionType typeB) +//{ +// NSMutableArray *newHandlers = [[NSMutableArray alloc] initWithCapacity:[(*handlers) count]]; +// +// for(NSData *data in (*handlers)){ +// const handlerContext *context = [data bytes]; +// if( +// !(context->typeA == typeA && context->typeB == typeB) && +// !(context->typeA == typeB && context->typeB == typeA) +// ){ +// [newHandlers addObject:data]; +// } +// } +// +// [(*handlers) release]; +// (*handlers) = newHandlers; +//} +// +//- (void)setDefaultCollisionHandler:(id)delegate +// begin:(SEL)begin +// preSolve:(SEL)preSolve +// postSolve:(SEL)postSolve +// separate:(SEL)separate +//{ +// cpCollisionType sentinel = (cpCollisionType)@"DEFAULT"; +// FilterHandlers(&_handlers, sentinel, sentinel); +// +// handlerContext handler = { +// delegate, self, sentinel, sentinel, +// begin, (void *)(begin ? [delegate methodForSelector:begin] : NULL), +// preSolve, (void *)(preSolve ? [delegate methodForSelector:preSolve] : NULL), +// postSolve, (void *)(postSolve ? [delegate methodForSelector:postSolve] : NULL), +// separate, (void *)(separate ? [delegate methodForSelector:separate] : NULL), +// }; +// NSData *data = [NSData dataWithBytes:&handler length:sizeof(handler)]; +// [_handlers addObject:data]; +// +// cpSpaceSetDefaultCollisionHandler(_space, +// (begin ? (cpCollisionBeginFunc)Begin : NULL), +// (preSolve ? (cpCollisionPreSolveFunc)PreSolve : NULL), +// (postSolve ? (cpCollisionPostSolveFunc)PostSolve : NULL), +// (separate ? (cpCollisionSeparateFunc)Separate : NULL), +// (void *)[data bytes] +// ); +//} +// +//- (void)addCollisionHandler:(id)delegate +// typeA:(cpCollisionType)a typeB:(cpCollisionType)b +// begin:(SEL)begin +// preSolve:(SEL)preSolve +// postSolve:(SEL)postSolve +// separate:(SEL)separate +//{ +// [self removeCollisionHandlerForTypeA:a andB:b]; +// +// handlerContext handler = { +// delegate, self, a, b, +// begin, (void *)(begin ? [delegate methodForSelector:begin] : NULL), +// preSolve, (void *)(preSolve ? [delegate methodForSelector:preSolve] : NULL), +// postSolve, (void *)(postSolve ? [delegate methodForSelector:postSolve] : NULL), +// separate, (void *)(separate ? [delegate methodForSelector:separate] : NULL), +// }; +// NSData *data = [NSData dataWithBytes:&handler length:sizeof(handler)]; +// +// cpSpaceAddCollisionHandler( +// _space, a, b, +// (begin ? (cpCollisionBeginFunc)Begin : NULL), +// (preSolve ? (cpCollisionPreSolveFunc)PreSolve : NULL), +// (postSolve ? (cpCollisionPostSolveFunc)PostSolve : NULL), +// (separate ? (cpCollisionSeparateFunc)Separate : NULL), +// (void *)[data bytes] +// ); +// +// [_handlers addObject:data]; +//} + +- (id)add:(NSObject *)obj +{ + if([obj conformsToProtocol:@protocol(ChipmunkBaseObject)]){ + [(NSObject *)obj addToSpace:self]; + } else if([obj conformsToProtocol:@protocol(ChipmunkObject)]){ + for(NSObject *child in [obj chipmunkObjects]) [self add:child]; + } else { + [NSException raise:@"NSArgumentError" format:@"Attempted to add an object of type %@ to a ChipmunkSpace.", [obj class]]; + } + + [_children addObject:obj]; + return obj; +} + +- (id)remove:(NSObject *)obj +{ + if([obj conformsToProtocol:@protocol(ChipmunkBaseObject)]){ + [(NSObject *)obj removeFromSpace:self]; + } else if([obj conformsToProtocol:@protocol(ChipmunkObject)]){ + for(NSObject *child in [obj chipmunkObjects]) [self remove:child]; + } else { + [NSException raise:@"NSArgumentError" format:@"Attempted to remove an object of type %@ from a ChipmunkSpace.", [obj class]]; + } + + [_children removeObject:obj]; + return obj; +} + +-(BOOL)contains:(NSObject *)obj +{ + return [_children containsObject:obj]; +} + +- (NSObject *)smartAdd:(NSObject *)obj +{ + if(cpSpaceIsLocked(_space)){ + [self addPostStepAddition:obj]; + } else { + [self add:obj]; + } + + return obj; +} + +- (NSObject *)smartRemove:(NSObject *)obj +{ + if(cpSpaceIsLocked(_space)){ + [self addPostStepRemoval:obj]; + } else { + [self remove:obj]; + } + + return obj; +} + +struct PostStepTargetContext { + id target; + SEL selector; +}; + +static void +postStepPerform(cpSpace *unused, id key, struct PostStepTargetContext *context) +{ + [context->target performSelector:context->selector withObject:key]; + + [context->target release]; + cpfree(context); + [key release]; +} + +- (BOOL)addPostStepCallback:(id)target selector:(SEL)selector key:(id)key +{ + if(!cpSpaceGetPostStepCallback(_space, key)){ + struct PostStepTargetContext *context = cpcalloc(1, sizeof(struct PostStepTargetContext)); + (*context) = (struct PostStepTargetContext){target, selector}; + cpSpaceAddPostStepCallback(_space, (cpPostStepFunc)postStepPerform, key, context); + + [target retain]; + [key retain]; + + return TRUE; + } else { + return FALSE; + } +} + +static void +postStepPerformBlock(cpSpace *unused, id key, ChipmunkPostStepBlock block) +{ + block(); + + [block release]; + [key release]; +} + +- (BOOL)addPostStepBlock:(ChipmunkPostStepBlock)block key:(id)key +{ + if(!cpSpaceGetPostStepCallback(_space, key)){ + cpSpaceAddPostStepCallback(_space, (cpPostStepFunc)postStepPerformBlock, key, [block copy]); + + [key retain]; + + return TRUE; + } else { + return FALSE; + } +} + +- (void)addPostStepAddition:(NSObject *)obj +{ + [self addPostStepCallback:self selector:@selector(add:) key:obj]; +} + +- (void)addPostStepRemoval:(NSObject *)obj +{ + [self addPostStepCallback:self selector:@selector(remove:) key:obj]; +} + +- (NSArray *)pointQueryAll:(cpVect)point maxDistance:(cpFloat)maxDistance filter:(cpShapeFilter)filter +{ + NSMutableArray *array = [NSMutableArray array]; + cpSpacePointQuery_b(_space, point, maxDistance, filter, ^(cpShape *shape, cpVect p, cpFloat d, cpVect g){ + ChipmunkPointQueryInfo *info = [[ChipmunkPointQueryInfo alloc] initWithInfo:&(cpPointQueryInfo){shape, p, d, g}]; + [array addObject:info]; + [info release]; + }); + + return array; +} + +- (ChipmunkShape *)pointQueryNearest:(cpVect)point maxDistance:(cpFloat)maxDistance filter:(cpShapeFilter)filter +{ + cpPointQueryInfo info; + cpShape *shape = cpSpacePointQueryNearest(_space, point, maxDistance, filter, &info); + return (shape ? shape->userData : nil); +} + +typedef struct segmentQueryContext { + cpVect start, end; + NSMutableArray *array; +} segmentQueryContext; + +- (NSArray *)segmentQueryAllFrom:(cpVect)start to:(cpVect)end radius:(cpFloat)radius filter:(cpShapeFilter)filter +{ + NSMutableArray *array = [NSMutableArray array]; + cpSpaceSegmentQuery_b(_space, start, end, radius, filter, ^(cpShape *shape, cpVect p, cpVect n, cpFloat t){ + // TODO point + ChipmunkSegmentQueryInfo *info = [[ChipmunkSegmentQueryInfo alloc] initWithInfo:&(cpSegmentQueryInfo){shape, p, n, t} start:start end:end]; + [array addObject:info]; + [info release]; + }); + + return array; +} + +- (ChipmunkSegmentQueryInfo *)segmentQueryFirstFrom:(cpVect)start to:(cpVect)end radius:(cpFloat)radius filter:(cpShapeFilter)filter +{ + cpSegmentQueryInfo info; + cpSpaceSegmentQueryFirst(_space, start, end, radius, filter, &info); + + return [[[ChipmunkSegmentQueryInfo alloc] initWithInfo:&info start:start end:end] autorelease]; +} + +- (NSArray *)bbQueryAll:(cpBB)bb filter:(cpShapeFilter)filter +{ + NSMutableArray *array = [NSMutableArray array]; + cpSpaceBBQuery_b(_space, bb, filter, ^(cpShape *shape){ + [array addObject:shape->userData]; + }); + + return array; +} + +//static void +//shapeQueryAll(cpShape *shape, cpContactPointSet *points, NSMutableArray *array) +//{ +// ChipmunkShapeQueryInfo *info = [[ChipmunkShapeQueryInfo alloc] initWithShape:shape->userData andPoints:points]; +// [array addObject:info]; +// [info release]; +//} + +- (NSArray *)shapeQueryAll:(ChipmunkShape *)shape +{ + NSMutableArray *array = [NSMutableArray array]; + cpSpaceShapeQuery_b(_space, shape.shape, ^(cpShape *shape, cpContactPointSet *points){ + ChipmunkShapeQueryInfo *info = [[ChipmunkShapeQueryInfo alloc] initWithShape:shape->userData andPoints:points]; + [array addObject:info]; + [info release]; + }); + + return array; +} + +- (BOOL)shapeTest:(ChipmunkShape *)shape +{ + return cpSpaceShapeQuery(_space, shape.shape, NULL, NULL); +} + +static void PushBody(cpBody *body, NSMutableArray *arr){[arr addObject:body->userData];} +- (NSArray *)bodies +{ + NSMutableArray *arr = [NSMutableArray array]; + cpSpaceEachBody(_space, (cpSpaceBodyIteratorFunc)PushBody, arr); + + return arr; +} + +static void PushShape(cpShape *shape, NSMutableArray *arr){[arr addObject:shape->userData];} +- (NSArray *)shapes +{ + NSMutableArray *arr = [NSMutableArray array]; + cpSpaceEachShape(_space, (cpSpaceShapeIteratorFunc)PushShape, arr); + + return arr; +} + +static void PushConstraint(cpConstraint *constraint, NSMutableArray *arr){[arr addObject:constraint->userData];} +- (NSArray *)constraints +{ + NSMutableArray *arr = [NSMutableArray array]; + cpSpaceEachConstraint(_space, (cpSpaceConstraintIteratorFunc)PushConstraint, arr); + + return arr; +} + + +- (void)reindexStatic +{ + cpSpaceReindexStatic(_space); +} + +- (void)reindexShape:(ChipmunkShape *)shape +{ + cpSpaceReindexShape(_space, shape.shape); +} + +- (void)reindexShapesForBody:(ChipmunkBody *)body +{ + cpSpaceReindexShapesForBody(_space, body.body); +} + +- (void)step:(cpFloat)dt +{ + cpSpaceStep(_space, dt); +} + +//MARK: Extras + +- (ChipmunkBody *)addBody:(ChipmunkBody *)obj { + cpSpaceAddBody(_space, obj.body); + [_children addObject:obj]; + return obj; +} + +- (ChipmunkBody *)removeBody:(ChipmunkBody *)obj { + cpSpaceRemoveBody(_space, obj.body); + [_children removeObject:obj]; + return obj; +} + + +- (ChipmunkShape *)addShape:(ChipmunkShape *)obj { + cpSpaceAddShape(_space, obj.shape); + [_children addObject:obj]; + return obj; +} + +- (ChipmunkShape *)removeShape:(ChipmunkShape *)obj { + cpSpaceRemoveShape(_space, obj.shape); + [_children removeObject:obj]; + return obj; +} + +- (ChipmunkConstraint *)addConstraint:(ChipmunkConstraint *)obj { + cpSpaceAddConstraint(_space, obj.constraint); + [_children addObject:obj]; + return obj; +} + +- (ChipmunkConstraint *)removeConstraint:(ChipmunkConstraint *)obj { + cpSpaceRemoveConstraint(_space, obj.constraint); + [_children removeObject:obj]; + return obj; +} + +static ChipmunkSegmentShape * +boundSeg(ChipmunkBody *body, cpVect a, cpVect b, cpFloat radius, cpFloat elasticity,cpFloat friction, cpShapeFilter filter, cpCollisionType collisionType) +{ + ChipmunkSegmentShape *seg = [ChipmunkSegmentShape segmentWithBody:body from:a to:b radius:radius]; + seg.elasticity = elasticity; + seg.friction = friction; + seg.filter = filter; + seg.collisionType = collisionType; + + return seg; +} + +- (NSArray *)addBounds:(CGRect)bounds thickness:(cpFloat)radius + elasticity:(cpFloat)elasticity friction:(cpFloat)friction + filter:(cpShapeFilter)filter collisionType:(cpCollisionType)collisionType +{ + cpFloat l = bounds.origin.x - radius; + cpFloat r = bounds.origin.x + bounds.size.width + radius; + cpFloat b = bounds.origin.y - radius; + cpFloat t = bounds.origin.y + bounds.size.height + radius; + + NSArray *segs = [[NSArrayChipmunkObject alloc] initWithArray:[NSArray arrayWithObjects: + boundSeg(_staticBody, cpv(l,b), cpv(l,t), radius, elasticity, friction, filter, collisionType), + boundSeg(_staticBody, cpv(l,t), cpv(r,t), radius, elasticity, friction, filter, collisionType), + boundSeg(_staticBody, cpv(r,t), cpv(r,b), radius, elasticity, friction, filter, collisionType), + boundSeg(_staticBody, cpv(r,b), cpv(l,b), radius, elasticity, friction, filter, collisionType), + nil + ]]; + + [self add:segs]; + return segs; +} + +@end diff --git a/external/Chipmunk/src/CMakeLists.txt b/external/Chipmunk/src/CMakeLists.txt new file mode 100644 index 0000000..9db3d07 --- /dev/null +++ b/external/Chipmunk/src/CMakeLists.txt @@ -0,0 +1,48 @@ +file(GLOB chipmunk_source_files "*.c" "constraints/*.c") +file(GLOB chipmunk_public_header "${chipmunk_SOURCE_DIR}/include/chipmunk/*.h") +file(GLOB chipmunk_constraint_header "${chipmunk_SOURCE_DIR}/include/chipmunk/constraints/*.h") + +include_directories(${chipmunk_SOURCE_DIR}/include/chipmunk) + +if(BUILD_SHARED) + add_library(chipmunk SHARED + ${chipmunk_source_files} + ) + # Tell MSVC to compile the code as C++. + if(MSVC) + set_source_files_properties(${chipmunk_source_files} PROPERTIES LANGUAGE CXX) + set_target_properties(chipmunk PROPERTIES LINKER_LANGUAGE CXX) + endif(MSVC) + # set the lib's version number + # But avoid on Android because symlinks to version numbered .so's don't work with Android's Java-side loadLibrary. + if(NOT ANDROID) + set_target_properties(chipmunk PROPERTIES VERSION 6.2.0) + endif(NOT ANDROID) + if(ANDROID) + # need to explicitly link to the math library because the CMake/Android toolchains may not do it automatically + target_link_libraries(chipmunk m) + endif(ANDROID) + install(TARGETS chipmunk RUNTIME DESTINATION lib LIBRARY DESTINATION lib) +endif(BUILD_SHARED) + +if(BUILD_STATIC) + add_library(chipmunk_static STATIC + ${chipmunk_source_files} + ) + # Tell MSVC to compile the code as C++. + if(MSVC) + set_source_files_properties(${chipmunk_source_files} PROPERTIES LANGUAGE CXX) + set_target_properties(chipmunk_static PROPERTIES LINKER_LANGUAGE CXX) + endif(MSVC) + # Sets chipmunk_static to output "libchipmunk.a" not "libchipmunk_static.a" + set_target_properties(chipmunk_static PROPERTIES OUTPUT_NAME chipmunk) + if(INSTALL_STATIC) + install(TARGETS chipmunk_static ARCHIVE DESTINATION lib) + endif(INSTALL_STATIC) +endif(BUILD_STATIC) + +if(BUILD_SHARED OR INSTALL_STATIC) + # FIXME: change to PUBLIC_HEADER to allow building frameworks + install(FILES ${chipmunk_public_header} DESTINATION include/chipmunk) + install(FILES ${chipmunk_constraint_header} DESTINATION include/chipmunk/constraints) +endif(BUILD_SHARED OR INSTALL_STATIC) diff --git a/external/Chipmunk/src/chipmunk.c b/external/Chipmunk/src/chipmunk.c new file mode 100644 index 0000000..02bd7bf --- /dev/null +++ b/external/Chipmunk/src/chipmunk.c @@ -0,0 +1,314 @@ +/* Copyright (c) 2007 Scott Lembcke + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +#include +#include +#include + +#include "chipmunk/chipmunk_private.h" + +void +cpMessage(const char *condition, const char *file, int line, int isError, int isHardError, const char *message, ...) +{ + fprintf(stderr, (isError ? "Aborting due to Chipmunk error: " : "Chipmunk warning: ")); + + va_list vargs; + va_start(vargs, message); { + vfprintf(stderr, message, vargs); + fprintf(stderr, "\n"); + } va_end(vargs); + + fprintf(stderr, "\tFailed condition: %s\n", condition); + fprintf(stderr, "\tSource:%s:%d\n", file, line); + + if(isError) abort(); +} + +#define STR(s) #s +#define XSTR(s) STR(s) + +const char *cpVersionString = XSTR(CP_VERSION_MAJOR)"."XSTR(CP_VERSION_MINOR)"."XSTR(CP_VERSION_RELEASE); + +//MARK: Misc Functions + +cpFloat +cpMomentForCircle(cpFloat m, cpFloat r1, cpFloat r2, cpVect offset) +{ + return m*(0.5f*(r1*r1 + r2*r2) + cpvlengthsq(offset)); +} + +cpFloat +cpAreaForCircle(cpFloat r1, cpFloat r2) +{ + return (cpFloat)M_PI*cpfabs(r1*r1 - r2*r2); +} + +cpFloat +cpMomentForSegment(cpFloat m, cpVect a, cpVect b, cpFloat radius) +{ + // TODO account for radius + cpVect offset = cpvmult(cpvadd(a, b), 0.5f); + return m*(cpvdistsq(b, a)/12.0f + cpvlengthsq(offset)); +} + +cpFloat +cpAreaForSegment(cpVect a, cpVect b, cpFloat r) +{ + return r*((cpFloat)M_PI*r + 2.0f*cpvdist(a, b)); +} + +cpFloat +cpMomentForPoly(cpFloat m, const int count, const cpVect *verts, cpVect offset, cpFloat radius) +{ + if(count == 2) return cpMomentForSegment(m, verts[0], verts[1], radius); + + cpFloat sum1 = 0.0f; + cpFloat sum2 = 0.0f; + for(int i=0; i max.x || (v.x == max.x && v.y > max.y)){ + max = v; + (*end) = i; + } + } +} + +#define SWAP(__A__, __B__) {cpVect __TMP__ = __A__; __A__ = __B__; __B__ = __TMP__;} + +static int +QHullPartition(cpVect *verts, int count, cpVect a, cpVect b, cpFloat tol) +{ + if(count == 0) return 0; + + cpFloat max = 0; + int pivot = 0; + + cpVect delta = cpvsub(b, a); + cpFloat valueTol = tol*cpvlength(delta); + + int head = 0; + for(int tail = count-1; head <= tail;){ + cpFloat value = cpvcross(cpvsub(verts[head], a), delta); + if(value > valueTol){ + if(value > max){ + max = value; + pivot = head; + } + + head++; + } else { + SWAP(verts[head], verts[tail]); + tail--; + } + } + + // move the new pivot to the front if it's not already there. + if(pivot != 0) SWAP(verts[0], verts[pivot]); + return head; +} + +static int +QHullReduce(cpFloat tol, cpVect *verts, int count, cpVect a, cpVect pivot, cpVect b, cpVect *result) +{ + if(count < 0){ + return 0; + } else if(count == 0) { + result[0] = pivot; + return 1; + } else { + int left_count = QHullPartition(verts, count, a, pivot, tol); + int index = QHullReduce(tol, verts + 1, left_count - 1, a, verts[0], pivot, result); + + result[index++] = pivot; + + int right_count = QHullPartition(verts + left_count, count - left_count, pivot, b, tol); + return index + QHullReduce(tol, verts + left_count + 1, right_count - 1, pivot, verts[left_count], b, result + index); + } +} + +// QuickHull seemed like a neat algorithm, and efficient-ish for large input sets. +// My implementation performs an in place reduction using the result array as scratch space. +int +cpConvexHull(int count, const cpVect *verts, cpVect *result, int *first, cpFloat tol) +{ + if(verts != result){ + // Copy the line vertexes into the empty part of the result polyline to use as a scratch buffer. + memcpy(result, verts, count*sizeof(cpVect)); + } + + // Degenerate case, all points are the same. + int start, end; + cpLoopIndexes(verts, count, &start, &end); + if(start == end){ + if(first) (*first) = 0; + return 1; + } + + SWAP(result[0], result[start]); + SWAP(result[1], result[end == 0 ? start : end]); + + cpVect a = result[0]; + cpVect b = result[1]; + + if(first) (*first) = start; + return QHullReduce(tol, result + 2, count - 2, a, b, a, result + 1) + 1; +} + +//MARK: Alternate Block Iterators + +#if defined(__has_extension) +#if __has_extension(blocks) + +static void IteratorFunc(void *ptr, void (^block)(void *ptr)){block(ptr);} + +void cpSpaceEachBody_b(cpSpace *space, void (^block)(cpBody *body)){ + cpSpaceEachBody(space, (cpSpaceBodyIteratorFunc)IteratorFunc, block); +} + +void cpSpaceEachShape_b(cpSpace *space, void (^block)(cpShape *shape)){ + cpSpaceEachShape(space, (cpSpaceShapeIteratorFunc)IteratorFunc, block); +} + +void cpSpaceEachConstraint_b(cpSpace *space, void (^block)(cpConstraint *constraint)){ + cpSpaceEachConstraint(space, (cpSpaceConstraintIteratorFunc)IteratorFunc, block); +} + +static void BodyIteratorFunc(cpBody *body, void *ptr, void (^block)(void *ptr)){block(ptr);} + +void cpBodyEachShape_b(cpBody *body, void (^block)(cpShape *shape)){ + cpBodyEachShape(body, (cpBodyShapeIteratorFunc)BodyIteratorFunc, block); +} + +void cpBodyEachConstraint_b(cpBody *body, void (^block)(cpConstraint *constraint)){ + cpBodyEachConstraint(body, (cpBodyConstraintIteratorFunc)BodyIteratorFunc, block); +} + +void cpBodyEachArbiter_b(cpBody *body, void (^block)(cpArbiter *arbiter)){ + cpBodyEachArbiter(body, (cpBodyArbiterIteratorFunc)BodyIteratorFunc, block); +} + +static void PointQueryIteratorFunc(cpShape *shape, cpVect p, cpFloat d, cpVect g, cpSpacePointQueryBlock block){block(shape, p, d, g);} +void cpSpacePointQuery_b(cpSpace *space, cpVect point, cpFloat maxDistance, cpShapeFilter filter, cpSpacePointQueryBlock block){ + cpSpacePointQuery(space, point, maxDistance, filter, (cpSpacePointQueryFunc)PointQueryIteratorFunc, block); +} + +static void SegmentQueryIteratorFunc(cpShape *shape, cpVect p, cpVect n, cpFloat t, cpSpaceSegmentQueryBlock block){block(shape, p, n, t);} +void cpSpaceSegmentQuery_b(cpSpace *space, cpVect start, cpVect end, cpFloat radius, cpShapeFilter filter, cpSpaceSegmentQueryBlock block){ + cpSpaceSegmentQuery(space, start, end, radius, filter, (cpSpaceSegmentQueryFunc)SegmentQueryIteratorFunc, block); +} + +void cpSpaceBBQuery_b(cpSpace *space, cpBB bb, cpShapeFilter filter, cpSpaceBBQueryBlock block){ + cpSpaceBBQuery(space, bb, filter, (cpSpaceBBQueryFunc)IteratorFunc, block); +} + +static void ShapeQueryIteratorFunc(cpShape *shape, cpContactPointSet *points, cpSpaceShapeQueryBlock block){block(shape, points);} +cpBool cpSpaceShapeQuery_b(cpSpace *space, cpShape *shape, cpSpaceShapeQueryBlock block){ + return cpSpaceShapeQuery(space, shape, (cpSpaceShapeQueryFunc)ShapeQueryIteratorFunc, block); +} + +#endif +#endif + +#include "chipmunk_ffi.h" diff --git a/external/Chipmunk/src/cpArbiter.c b/external/Chipmunk/src/cpArbiter.c new file mode 100644 index 0000000..a859c5f --- /dev/null +++ b/external/Chipmunk/src/cpArbiter.c @@ -0,0 +1,489 @@ +/* Copyright (c) 2007 Scott Lembcke + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +#include "chipmunk/chipmunk_private.h" + +// TODO: make this generic so I can reuse it for constraints also. +static inline void +unthreadHelper(cpArbiter *arb, cpBody *body) +{ + struct cpArbiterThread *thread = cpArbiterThreadForBody(arb, body); + cpArbiter *prev = thread->prev; + cpArbiter *next = thread->next; + + if(prev){ + cpArbiterThreadForBody(prev, body)->next = next; + } else if(body->arbiterList == arb) { + // IFF prev is NULL and body->arbiterList == arb, is arb at the head of the list. + // This function may be called for an arbiter that was never in a list. + // In that case, we need to protect it from wiping out the body->arbiterList pointer. + body->arbiterList = next; + } + + if(next) cpArbiterThreadForBody(next, body)->prev = prev; + + thread->prev = NULL; + thread->next = NULL; +} + +void +cpArbiterUnthread(cpArbiter *arb) +{ + unthreadHelper(arb, arb->body_a); + unthreadHelper(arb, arb->body_b); +} + +cpBool cpArbiterIsFirstContact(const cpArbiter *arb) +{ + return arb->CP_PRIVATE(state) == CP_ARBITER_STATE_FIRST_COLLISION; +} + +cpBool cpArbiterIsRemoval(const cpArbiter *arb) +{ + return arb->CP_PRIVATE(state) == CP_ARBITER_STATE_INVALIDATED; +} + +int cpArbiterGetCount(const cpArbiter *arb) +{ + // Return 0 contacts if we are in a separate callback. + return (arb->state < CP_ARBITER_STATE_CACHED ? arb->count : 0); +} + +cpVect +cpArbiterGetNormal(const cpArbiter *arb) +{ + return cpvmult(arb->n, arb->swapped ? -1.0f : 1.0); +} + +cpVect +cpArbiterGetPoint1(const cpArbiter *arb, int i) +{ + cpAssertHard(0 <= i && i < cpArbiterGetCount(arb), "Index error: The specified contact index is invalid for this arbiter"); + return cpvadd(arb->body_a->p, arb->contacts[i].r1); +} + +cpVect +cpArbiterGetPoint2(const cpArbiter *arb, int i) +{ + cpAssertHard(0 <= i && i < cpArbiterGetCount(arb), "Index error: The specified contact index is invalid for this arbiter"); + return cpvadd(arb->body_a->p, arb->contacts[i].r2); +} + +cpFloat +cpArbiterGetDepth(const cpArbiter *arb, int i) +{ + cpAssertHard(0 <= i && i < cpArbiterGetCount(arb), "Index error: The specified contact index is invalid for this arbiter"); + + struct cpContact *con = &arb->contacts[i]; + return cpvdot(cpvadd(cpvsub(con->r2, con->r1), cpvsub(arb->body_b->p, arb->body_a->p)), arb->n); +} + +cpContactPointSet +cpArbiterGetContactPointSet(const cpArbiter *arb) +{ + cpContactPointSet set; + set.count = cpArbiterGetCount(arb); + + cpBool swapped = arb->swapped; + cpVect n = arb->n; + set.normal = (swapped ? cpvneg(n) : n); + + for(int i=0; ibody_a->p, arb->contacts[i].r1); + cpVect p2 = cpvadd(arb->body_b->p, arb->contacts[i].r2); + + set.points[i].point1 = (swapped ? p2 : p1); + set.points[i].point2 = (swapped ? p1 : p2); + set.points[i].distance = cpvdot(cpvsub(p2, p1), n); + } + + return set; +} + +void +cpArbiterSetContactPointSet(cpArbiter *arb, cpContactPointSet *set) +{ + int count = set->count; + cpAssertHard(count == arb->count, "The number of contact points cannot be changed."); + + cpBool swapped = arb->swapped; + arb->n = (swapped ? cpvneg(set->normal) : set->normal); + + for(int i=0; ipoints[i].point1; + cpVect p2 = set->points[i].point2; + + arb->contacts[i].r1 = cpvsub(swapped ? p2 : p1, arb->body_a->p); + arb->contacts[i].r2 = cpvsub(swapped ? p1 : p2, arb->body_b->p); + } +} + +cpVect +cpArbiterTotalImpulse(const cpArbiter *arb) +{ + struct cpContact *contacts = arb->contacts; + cpVect n = arb->n; + cpVect sum = cpvzero; + + for(int i=0, count=cpArbiterGetCount(arb); ijnAcc, con->jtAcc))); + } + + return (arb->swapped ? sum : cpvneg(sum)); + return cpvzero; +} + +cpFloat +cpArbiterTotalKE(const cpArbiter *arb) +{ + cpFloat eCoef = (1 - arb->e)/(1 + arb->e); + cpFloat sum = 0.0; + + struct cpContact *contacts = arb->contacts; + for(int i=0, count=cpArbiterGetCount(arb); ijnAcc; + cpFloat jtAcc = con->jtAcc; + + sum += eCoef*jnAcc*jnAcc/con->nMass + jtAcc*jtAcc/con->tMass; + } + + return sum; +} + +cpBool +cpArbiterIgnore(cpArbiter *arb) +{ + arb->state = CP_ARBITER_STATE_IGNORE; + return cpFalse; +} + +cpFloat +cpArbiterGetRestitution(const cpArbiter *arb) +{ + return arb->e; +} + +void +cpArbiterSetRestitution(cpArbiter *arb, cpFloat restitution) +{ + arb->e = restitution; +} + +cpFloat +cpArbiterGetFriction(const cpArbiter *arb) +{ + return arb->u; +} + +void +cpArbiterSetFriction(cpArbiter *arb, cpFloat friction) +{ + arb->u = friction; +} + +cpVect +cpArbiterGetSurfaceVelocity(cpArbiter *arb) +{ + return cpvmult(arb->surface_vr, arb->swapped ? -1.0f : 1.0); +} + +void +cpArbiterSetSurfaceVelocity(cpArbiter *arb, cpVect vr) +{ + arb->surface_vr = cpvmult(vr, arb->swapped ? -1.0f : 1.0); +} + +cpDataPointer +cpArbiterGetUserData(const cpArbiter *arb) +{ + return arb->data; +} + +void +cpArbiterSetUserData(cpArbiter *arb, cpDataPointer userData) +{ + arb->data = userData; +} + +void +cpArbiterGetShapes(const cpArbiter *arb, cpShape **a, cpShape **b) +{ + if(arb->swapped){ + (*a) = (cpShape *)arb->b, (*b) = (cpShape *)arb->a; + } else { + (*a) = (cpShape *)arb->a, (*b) = (cpShape *)arb->b; + } +} + +cpBool +cpArbiterCallWildcardBeginA(cpArbiter *arb, cpSpace *space) +{ + cpCollisionHandler *handler = arb->handlerA; + return handler->beginFunc(arb, space, handler->userData); +} + +cpBool +cpArbiterCallWildcardBeginB(cpArbiter *arb, cpSpace *space) +{ + cpCollisionHandler *handler = arb->handlerB; + arb->swapped = !arb->swapped; + cpBool retval = handler->beginFunc(arb, space, handler->userData); + arb->swapped = !arb->swapped; + return retval; +} + +cpBool +cpArbiterCallWildcardPreSolveA(cpArbiter *arb, cpSpace *space) +{ + cpCollisionHandler *handler = arb->handlerA; + return handler->preSolveFunc(arb, space, handler->userData); +} + +cpBool +cpArbiterCallWildcardPreSolveB(cpArbiter *arb, cpSpace *space) +{ + cpCollisionHandler *handler = arb->handlerB; + arb->swapped = !arb->swapped; + cpBool retval = handler->preSolveFunc(arb, space, handler->userData); + arb->swapped = !arb->swapped; + return retval; +} + +void +cpArbiterCallWildcardPostSolveA(cpArbiter *arb, cpSpace *space) +{ + cpCollisionHandler *handler = arb->handlerA; + handler->postSolveFunc(arb, space, handler->userData); +} + +void +cpArbiterCallWildcardPostSolveB(cpArbiter *arb, cpSpace *space) +{ + cpCollisionHandler *handler = arb->handlerB; + arb->swapped = !arb->swapped; + handler->postSolveFunc(arb, space, handler->userData); + arb->swapped = !arb->swapped; +} + +void +cpArbiterCallWildcardSeparateA(cpArbiter *arb, cpSpace *space) +{ + cpCollisionHandler *handler = arb->handlerA; + handler->separateFunc(arb, space, handler->userData); +} + +void +cpArbiterCallWildcardSeparateB(cpArbiter *arb, cpSpace *space) +{ + cpCollisionHandler *handler = arb->handlerB; + arb->swapped = !arb->swapped; + handler->separateFunc(arb, space, handler->userData); + arb->swapped = !arb->swapped; +} + +cpArbiter* +cpArbiterInit(cpArbiter *arb, cpShape *a, cpShape *b) +{ + arb->handler = NULL; + arb->swapped = cpFalse; + + arb->handler = NULL; + arb->handlerA = NULL; + arb->handlerB = NULL; + + arb->e = 0.0f; + arb->u = 0.0f; + arb->surface_vr = cpvzero; + + arb->count = 0; + arb->contacts = NULL; + + arb->a = a; arb->body_a = a->body; + arb->b = b; arb->body_b = b->body; + + arb->thread_a.next = NULL; + arb->thread_b.next = NULL; + arb->thread_a.prev = NULL; + arb->thread_b.prev = NULL; + + arb->stamp = 0; + arb->state = CP_ARBITER_STATE_FIRST_COLLISION; + + arb->data = NULL; + + return arb; +} + +static inline cpCollisionHandler * +cpSpaceLookupHandler(cpSpace *space, cpCollisionType a, cpCollisionType b, cpCollisionHandler *defaultValue) +{ + cpCollisionType types[] = {a, b}; + cpCollisionHandler *handler = (cpCollisionHandler *)cpHashSetFind(space->collisionHandlers, CP_HASH_PAIR(a, b), types); + return (handler ? handler : defaultValue); +} + +void +cpArbiterUpdate(cpArbiter *arb, struct cpCollisionInfo *info, cpSpace *space) +{ + const cpShape *a = info->a, *b = info->b; + + // For collisions between two similar primitive types, the order could have been swapped since the last frame. + arb->a = a; arb->body_a = a->body; + arb->b = b; arb->body_b = b->body; + + // Iterate over the possible pairs to look for hash value matches. + for(int i=0; icount; i++){ + struct cpContact *con = &info->arr[i]; + + // r1 and r2 store absolute offsets at init time. + // Need to convert them to relative offsets. + con->r1 = cpvsub(con->r1, a->body->p); + con->r2 = cpvsub(con->r2, b->body->p); + + // Cached impulses are not zeroed at init time. + con->jnAcc = con->jtAcc = 0.0f; + + for(int j=0; jcount; j++){ + struct cpContact *old = &arb->contacts[j]; + + // This could trigger false positives, but is fairly unlikely nor serious if it does. + if(con->hash == old->hash){ + // Copy the persistant contact information. + con->jnAcc = old->jnAcc; + con->jtAcc = old->jtAcc; + } + } + } + + arb->contacts = info->arr; + arb->count = info->count; + arb->n = info->n; + + arb->e = a->e * b->e; + arb->u = a->u * b->u; + + cpVect surface_vr = cpvsub(b->surfaceV, a->surfaceV); + arb->surface_vr = cpvsub(surface_vr, cpvmult(info->n, cpvdot(surface_vr, info->n))); + + cpCollisionType typeA = info->a->type, typeB = info->b->type; + cpCollisionHandler *defaultHandler = &space->defaultHandler; + cpCollisionHandler *handler = arb->handler = cpSpaceLookupHandler(space, typeA, typeB, defaultHandler); + + // Check if the types match, but don't swap for a default handler which use the wildcard for type A. + cpBool swapped = arb->swapped = (typeA != handler->typeA && handler->typeA != CP_WILDCARD_COLLISION_TYPE); + + if(handler != defaultHandler || space->usesWildcards){ + // The order of the main handler swaps the wildcard handlers too. Uffda. + arb->handlerA = cpSpaceLookupHandler(space, (swapped ? typeB : typeA), CP_WILDCARD_COLLISION_TYPE, &cpCollisionHandlerDoNothing); + arb->handlerB = cpSpaceLookupHandler(space, (swapped ? typeA : typeB), CP_WILDCARD_COLLISION_TYPE, &cpCollisionHandlerDoNothing); + } + + // mark it as new if it's been cached + if(arb->state == CP_ARBITER_STATE_CACHED) arb->state = CP_ARBITER_STATE_FIRST_COLLISION; +} + +void +cpArbiterPreStep(cpArbiter *arb, cpFloat dt, cpFloat slop, cpFloat bias) +{ + cpBody *a = arb->body_a; + cpBody *b = arb->body_b; + cpVect n = arb->n; + cpVect body_delta = cpvsub(b->p, a->p); + + for(int i=0; icount; i++){ + struct cpContact *con = &arb->contacts[i]; + + // Calculate the mass normal and mass tangent. + con->nMass = 1.0f/k_scalar(a, b, con->r1, con->r2, n); + con->tMass = 1.0f/k_scalar(a, b, con->r1, con->r2, cpvperp(n)); + + // Calculate the target bias velocity. + cpFloat dist = cpvdot(cpvadd(cpvsub(con->r2, con->r1), body_delta), n); + con->bias = -bias*cpfmin(0.0f, dist + slop)/dt; + con->jBias = 0.0f; + + // Calculate the target bounce velocity. + con->bounce = normal_relative_velocity(a, b, con->r1, con->r2, n)*arb->e; + } +} + +void +cpArbiterApplyCachedImpulse(cpArbiter *arb, cpFloat dt_coef) +{ + if(cpArbiterIsFirstContact(arb)) return; + + cpBody *a = arb->body_a; + cpBody *b = arb->body_b; + cpVect n = arb->n; + + for(int i=0; icount; i++){ + struct cpContact *con = &arb->contacts[i]; + cpVect j = cpvrotate(n, cpv(con->jnAcc, con->jtAcc)); + apply_impulses(a, b, con->r1, con->r2, cpvmult(j, dt_coef)); + } +} + +// TODO: is it worth splitting velocity/position correction? + +void +cpArbiterApplyImpulse(cpArbiter *arb) +{ + cpBody *a = arb->body_a; + cpBody *b = arb->body_b; + cpVect n = arb->n; + cpVect surface_vr = arb->surface_vr; + cpFloat friction = arb->u; + + for(int i=0; icount; i++){ + struct cpContact *con = &arb->contacts[i]; + cpFloat nMass = con->nMass; + cpVect r1 = con->r1; + cpVect r2 = con->r2; + + cpVect vb1 = cpvadd(a->v_bias, cpvmult(cpvperp(r1), a->w_bias)); + cpVect vb2 = cpvadd(b->v_bias, cpvmult(cpvperp(r2), b->w_bias)); + cpVect vr = cpvadd(relative_velocity(a, b, r1, r2), surface_vr); + + cpFloat vbn = cpvdot(cpvsub(vb2, vb1), n); + cpFloat vrn = cpvdot(vr, n); + cpFloat vrt = cpvdot(vr, cpvperp(n)); + + cpFloat jbn = (con->bias - vbn)*nMass; + cpFloat jbnOld = con->jBias; + con->jBias = cpfmax(jbnOld + jbn, 0.0f); + + cpFloat jn = -(con->bounce + vrn)*nMass; + cpFloat jnOld = con->jnAcc; + con->jnAcc = cpfmax(jnOld + jn, 0.0f); + + cpFloat jtMax = friction*con->jnAcc; + cpFloat jt = -vrt*con->tMass; + cpFloat jtOld = con->jtAcc; + con->jtAcc = cpfclamp(jtOld + jt, -jtMax, jtMax); + + apply_bias_impulses(a, b, r1, r2, cpvmult(n, con->jBias - jbnOld)); + apply_impulses(a, b, r1, r2, cpvrotate(n, cpv(con->jnAcc - jnOld, con->jtAcc - jtOld))); + } +} diff --git a/external/Chipmunk/src/cpArray.c b/external/Chipmunk/src/cpArray.c new file mode 100644 index 0000000..ce4f633 --- /dev/null +++ b/external/Chipmunk/src/cpArray.c @@ -0,0 +1,101 @@ +/* Copyright (c) 2007 Scott Lembcke + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +#include + +#include "chipmunk/chipmunk_private.h" + + +cpArray * +cpArrayNew(int size) +{ + cpArray *arr = (cpArray *)cpcalloc(1, sizeof(cpArray)); + + arr->num = 0; + arr->max = (size ? size : 4); + arr->arr = (void **)cpcalloc(arr->max, sizeof(void**)); + + return arr; +} + +void +cpArrayFree(cpArray *arr) +{ + if(arr){ + cpfree(arr->arr); + arr->arr = NULL; + + cpfree(arr); + } +} + +void +cpArrayPush(cpArray *arr, void *object) +{ + if(arr->num == arr->max){ + arr->max *= 2; + arr->arr = (void **)cprealloc(arr->arr, arr->max*sizeof(void**)); + } + + arr->arr[arr->num] = object; + arr->num++; +} + +void * +cpArrayPop(cpArray *arr) +{ + arr->num--; + + void *value = arr->arr[arr->num]; + arr->arr[arr->num] = NULL; + + return value; +} + +void +cpArrayDeleteObj(cpArray *arr, void *obj) +{ + for(int i=0; inum; i++){ + if(arr->arr[i] == obj){ + arr->num--; + + arr->arr[i] = arr->arr[arr->num]; + arr->arr[arr->num] = NULL; + + return; + } + } +} + +void +cpArrayFreeEach(cpArray *arr, void (freeFunc)(void*)) +{ + for(int i=0; inum; i++) freeFunc(arr->arr[i]); +} + +cpBool +cpArrayContains(cpArray *arr, void *ptr) +{ + for(int i=0; inum; i++) + if(arr->arr[i] == ptr) return cpTrue; + + return cpFalse; +} diff --git a/external/Chipmunk/src/cpBBTree.c b/external/Chipmunk/src/cpBBTree.c new file mode 100644 index 0000000..2603147 --- /dev/null +++ b/external/Chipmunk/src/cpBBTree.c @@ -0,0 +1,894 @@ +/* Copyright (c) 2009 Scott Lembcke + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +#include "stdlib.h" +#include "stdio.h" + +#include "chipmunk/chipmunk_private.h" + +static inline cpSpatialIndexClass *Klass(); + +typedef struct Node Node; +typedef struct Pair Pair; + +struct cpBBTree { + cpSpatialIndex spatialIndex; + cpBBTreeVelocityFunc velocityFunc; + + cpHashSet *leaves; + Node *root; + + Node *pooledNodes; + Pair *pooledPairs; + cpArray *allocatedBuffers; + + cpTimestamp stamp; +}; + +struct Node { + void *obj; + cpBB bb; + Node *parent; + + union { + // Internal nodes + struct { Node *a, *b; } children; + + // Leaves + struct { + cpTimestamp stamp; + Pair *pairs; + } leaf; + } node; +}; + +// Can't use anonymous unions and still get good x-compiler compatability +#define A node.children.a +#define B node.children.b +#define STAMP node.leaf.stamp +#define PAIRS node.leaf.pairs + +typedef struct Thread { + Pair *prev; + Node *leaf; + Pair *next; +} Thread; + +struct Pair { + Thread a, b; + cpCollisionID id; +}; + +//MARK: Misc Functions + +static inline cpBB +GetBB(cpBBTree *tree, void *obj) +{ + cpBB bb = tree->spatialIndex.bbfunc(obj); + + cpBBTreeVelocityFunc velocityFunc = tree->velocityFunc; + if(velocityFunc){ + cpFloat coef = 0.1f; + cpFloat x = (bb.r - bb.l)*coef; + cpFloat y = (bb.t - bb.b)*coef; + + cpVect v = cpvmult(velocityFunc(obj), 0.1f); + return cpBBNew(bb.l + cpfmin(-x, v.x), bb.b + cpfmin(-y, v.y), bb.r + cpfmax(x, v.x), bb.t + cpfmax(y, v.y)); + } else { + return bb; + } +} + +static inline cpBBTree * +GetTree(cpSpatialIndex *index) +{ + return (index && index->klass == Klass() ? (cpBBTree *)index : NULL); +} + +static inline Node * +GetRootIfTree(cpSpatialIndex *index){ + return (index && index->klass == Klass() ? ((cpBBTree *)index)->root : NULL); +} + +static inline cpBBTree * +GetMasterTree(cpBBTree *tree) +{ + cpBBTree *dynamicTree = GetTree(tree->spatialIndex.dynamicIndex); + return (dynamicTree ? dynamicTree : tree); +} + +static inline void +IncrementStamp(cpBBTree *tree) +{ + cpBBTree *dynamicTree = GetTree(tree->spatialIndex.dynamicIndex); + if(dynamicTree){ + dynamicTree->stamp++; + } else { + tree->stamp++; + } +} + +//MARK: Pair/Thread Functions + +static void +PairRecycle(cpBBTree *tree, Pair *pair) +{ + // Share the pool of the master tree. + // TODO: would be lovely to move the pairs stuff into an external data structure. + tree = GetMasterTree(tree); + + pair->a.next = tree->pooledPairs; + tree->pooledPairs = pair; +} + +static Pair * +PairFromPool(cpBBTree *tree) +{ + // Share the pool of the master tree. + // TODO: would be lovely to move the pairs stuff into an external data structure. + tree = GetMasterTree(tree); + + Pair *pair = tree->pooledPairs; + + if(pair){ + tree->pooledPairs = pair->a.next; + return pair; + } else { + // Pool is exhausted, make more + int count = CP_BUFFER_BYTES/sizeof(Pair); + cpAssertHard(count, "Internal Error: Buffer size is too small."); + + Pair *buffer = (Pair *)cpcalloc(1, CP_BUFFER_BYTES); + cpArrayPush(tree->allocatedBuffers, buffer); + + // push all but the first one, return the first instead + for(int i=1; ia.leaf == thread.leaf) next->a.prev = prev; else next->b.prev = prev; + } + + if(prev){ + if(prev->a.leaf == thread.leaf) prev->a.next = next; else prev->b.next = next; + } else { + thread.leaf->PAIRS = next; + } +} + +static void +PairsClear(Node *leaf, cpBBTree *tree) +{ + Pair *pair = leaf->PAIRS; + leaf->PAIRS = NULL; + + while(pair){ + if(pair->a.leaf == leaf){ + Pair *next = pair->a.next; + ThreadUnlink(pair->b); + PairRecycle(tree, pair); + pair = next; + } else { + Pair *next = pair->b.next; + ThreadUnlink(pair->a); + PairRecycle(tree, pair); + pair = next; + } + } +} + +static void +PairInsert(Node *a, Node *b, cpBBTree *tree) +{ + Pair *nextA = a->PAIRS, *nextB = b->PAIRS; + Pair *pair = PairFromPool(tree); + Pair temp = {{NULL, a, nextA},{NULL, b, nextB}, 0}; + + a->PAIRS = b->PAIRS = pair; + *pair = temp; + + if(nextA){ + if(nextA->a.leaf == a) nextA->a.prev = pair; else nextA->b.prev = pair; + } + + if(nextB){ + if(nextB->a.leaf == b) nextB->a.prev = pair; else nextB->b.prev = pair; + } +} + + +//MARK: Node Functions + +static void +NodeRecycle(cpBBTree *tree, Node *node) +{ + node->parent = tree->pooledNodes; + tree->pooledNodes = node; +} + +static Node * +NodeFromPool(cpBBTree *tree) +{ + Node *node = tree->pooledNodes; + + if(node){ + tree->pooledNodes = node->parent; + return node; + } else { + // Pool is exhausted, make more + int count = CP_BUFFER_BYTES/sizeof(Node); + cpAssertHard(count, "Internal Error: Buffer size is too small."); + + Node *buffer = (Node *)cpcalloc(1, CP_BUFFER_BYTES); + cpArrayPush(tree->allocatedBuffers, buffer); + + // push all but the first one, return the first instead + for(int i=1; iA = value; + value->parent = node; +} + +static inline void +NodeSetB(Node *node, Node *value) +{ + node->B = value; + value->parent = node; +} + +static Node * +NodeNew(cpBBTree *tree, Node *a, Node *b) +{ + Node *node = NodeFromPool(tree); + + node->obj = NULL; + node->bb = cpBBMerge(a->bb, b->bb); + node->parent = NULL; + + NodeSetA(node, a); + NodeSetB(node, b); + + return node; +} + +static inline cpBool +NodeIsLeaf(Node *node) +{ + return (node->obj != NULL); +} + +static inline Node * +NodeOther(Node *node, Node *child) +{ + return (node->A == child ? node->B : node->A); +} + +static inline void +NodeReplaceChild(Node *parent, Node *child, Node *value, cpBBTree *tree) +{ + cpAssertSoft(!NodeIsLeaf(parent), "Internal Error: Cannot replace child of a leaf."); + cpAssertSoft(child == parent->A || child == parent->B, "Internal Error: Node is not a child of parent."); + + if(parent->A == child){ + NodeRecycle(tree, parent->A); + NodeSetA(parent, value); + } else { + NodeRecycle(tree, parent->B); + NodeSetB(parent, value); + } + + for(Node *node=parent; node; node = node->parent){ + node->bb = cpBBMerge(node->A->bb, node->B->bb); + } +} + +//MARK: Subtree Functions + +static inline cpFloat +cpBBProximity(cpBB a, cpBB b) +{ + return cpfabs(a.l + a.r - b.l - b.r) + cpfabs(a.b + a.t - b.b - b.t); +} + +static Node * +SubtreeInsert(Node *subtree, Node *leaf, cpBBTree *tree) +{ + if(subtree == NULL){ + return leaf; + } else if(NodeIsLeaf(subtree)){ + return NodeNew(tree, leaf, subtree); + } else { + cpFloat cost_a = cpBBArea(subtree->B->bb) + cpBBMergedArea(subtree->A->bb, leaf->bb); + cpFloat cost_b = cpBBArea(subtree->A->bb) + cpBBMergedArea(subtree->B->bb, leaf->bb); + + if(cost_a == cost_b){ + cost_a = cpBBProximity(subtree->A->bb, leaf->bb); + cost_b = cpBBProximity(subtree->B->bb, leaf->bb); + } + + if(cost_b < cost_a){ + NodeSetB(subtree, SubtreeInsert(subtree->B, leaf, tree)); + } else { + NodeSetA(subtree, SubtreeInsert(subtree->A, leaf, tree)); + } + + subtree->bb = cpBBMerge(subtree->bb, leaf->bb); + return subtree; + } +} + +static void +SubtreeQuery(Node *subtree, void *obj, cpBB bb, cpSpatialIndexQueryFunc func, void *data) +{ + if(cpBBIntersects(subtree->bb, bb)){ + if(NodeIsLeaf(subtree)){ + func(obj, subtree->obj, 0, data); + } else { + SubtreeQuery(subtree->A, obj, bb, func, data); + SubtreeQuery(subtree->B, obj, bb, func, data); + } + } +} + + +static cpFloat +SubtreeSegmentQuery(Node *subtree, void *obj, cpVect a, cpVect b, cpFloat t_exit, cpSpatialIndexSegmentQueryFunc func, void *data) +{ + if(NodeIsLeaf(subtree)){ + return func(obj, subtree->obj, data); + } else { + cpFloat t_a = cpBBSegmentQuery(subtree->A->bb, a, b); + cpFloat t_b = cpBBSegmentQuery(subtree->B->bb, a, b); + + if(t_a < t_b){ + if(t_a < t_exit) t_exit = cpfmin(t_exit, SubtreeSegmentQuery(subtree->A, obj, a, b, t_exit, func, data)); + if(t_b < t_exit) t_exit = cpfmin(t_exit, SubtreeSegmentQuery(subtree->B, obj, a, b, t_exit, func, data)); + } else { + if(t_b < t_exit) t_exit = cpfmin(t_exit, SubtreeSegmentQuery(subtree->B, obj, a, b, t_exit, func, data)); + if(t_a < t_exit) t_exit = cpfmin(t_exit, SubtreeSegmentQuery(subtree->A, obj, a, b, t_exit, func, data)); + } + + return t_exit; + } +} + +static void +SubtreeRecycle(cpBBTree *tree, Node *node) +{ + if(!NodeIsLeaf(node)){ + SubtreeRecycle(tree, node->A); + SubtreeRecycle(tree, node->B); + NodeRecycle(tree, node); + } +} + +static inline Node * +SubtreeRemove(Node *subtree, Node *leaf, cpBBTree *tree) +{ + if(leaf == subtree){ + return NULL; + } else { + Node *parent = leaf->parent; + if(parent == subtree){ + Node *other = NodeOther(subtree, leaf); + other->parent = subtree->parent; + NodeRecycle(tree, subtree); + return other; + } else { + NodeReplaceChild(parent->parent, parent, NodeOther(parent, leaf), tree); + return subtree; + } + } +} + +//MARK: Marking Functions + +typedef struct MarkContext { + cpBBTree *tree; + Node *staticRoot; + cpSpatialIndexQueryFunc func; + void *data; +} MarkContext; + +static void +MarkLeafQuery(Node *subtree, Node *leaf, cpBool left, MarkContext *context) +{ + if(cpBBIntersects(leaf->bb, subtree->bb)){ + if(NodeIsLeaf(subtree)){ + if(left){ + PairInsert(leaf, subtree, context->tree); + } else { + if(subtree->STAMP < leaf->STAMP) PairInsert(subtree, leaf, context->tree); + context->func(leaf->obj, subtree->obj, 0, context->data); + } + } else { + MarkLeafQuery(subtree->A, leaf, left, context); + MarkLeafQuery(subtree->B, leaf, left, context); + } + } +} + +static void +MarkLeaf(Node *leaf, MarkContext *context) +{ + cpBBTree *tree = context->tree; + if(leaf->STAMP == GetMasterTree(tree)->stamp){ + Node *staticRoot = context->staticRoot; + if(staticRoot) MarkLeafQuery(staticRoot, leaf, cpFalse, context); + + for(Node *node = leaf; node->parent; node = node->parent){ + if(node == node->parent->A){ + MarkLeafQuery(node->parent->B, leaf, cpTrue, context); + } else { + MarkLeafQuery(node->parent->A, leaf, cpFalse, context); + } + } + } else { + Pair *pair = leaf->PAIRS; + while(pair){ + if(leaf == pair->b.leaf){ + pair->id = context->func(pair->a.leaf->obj, leaf->obj, pair->id, context->data); + pair = pair->b.next; + } else { + pair = pair->a.next; + } + } + } +} + +static void +MarkSubtree(Node *subtree, MarkContext *context) +{ + if(NodeIsLeaf(subtree)){ + MarkLeaf(subtree, context); + } else { + MarkSubtree(subtree->A, context); + MarkSubtree(subtree->B, context); // TODO: Force TCO here? + } +} + +//MARK: Leaf Functions + +static Node * +LeafNew(cpBBTree *tree, void *obj, cpBB bb) +{ + Node *node = NodeFromPool(tree); + node->obj = obj; + node->bb = GetBB(tree, obj); + + node->parent = NULL; + node->STAMP = 0; + node->PAIRS = NULL; + + return node; +} + +static cpBool +LeafUpdate(Node *leaf, cpBBTree *tree) +{ + Node *root = tree->root; + cpBB bb = tree->spatialIndex.bbfunc(leaf->obj); + + if(!cpBBContainsBB(leaf->bb, bb)){ + leaf->bb = GetBB(tree, leaf->obj); + + root = SubtreeRemove(root, leaf, tree); + tree->root = SubtreeInsert(root, leaf, tree); + + PairsClear(leaf, tree); + leaf->STAMP = GetMasterTree(tree)->stamp; + + return cpTrue; + } else { + return cpFalse; + } +} + +static cpCollisionID VoidQueryFunc(void *obj1, void *obj2, cpCollisionID id, void *data){return id;} + +static void +LeafAddPairs(Node *leaf, cpBBTree *tree) +{ + cpSpatialIndex *dynamicIndex = tree->spatialIndex.dynamicIndex; + if(dynamicIndex){ + Node *dynamicRoot = GetRootIfTree(dynamicIndex); + if(dynamicRoot){ + cpBBTree *dynamicTree = GetTree(dynamicIndex); + MarkContext context = {dynamicTree, NULL, NULL, NULL}; + MarkLeafQuery(dynamicRoot, leaf, cpTrue, &context); + } + } else { + Node *staticRoot = GetRootIfTree(tree->spatialIndex.staticIndex); + MarkContext context = {tree, staticRoot, VoidQueryFunc, NULL}; + MarkLeaf(leaf, &context); + } +} + +//MARK: Memory Management Functions + +cpBBTree * +cpBBTreeAlloc(void) +{ + return (cpBBTree *)cpcalloc(1, sizeof(cpBBTree)); +} + +static int +leafSetEql(void *obj, Node *node) +{ + return (obj == node->obj); +} + +static void * +leafSetTrans(void *obj, cpBBTree *tree) +{ + return LeafNew(tree, obj, tree->spatialIndex.bbfunc(obj)); +} + +cpSpatialIndex * +cpBBTreeInit(cpBBTree *tree, cpSpatialIndexBBFunc bbfunc, cpSpatialIndex *staticIndex) +{ + cpSpatialIndexInit((cpSpatialIndex *)tree, Klass(), bbfunc, staticIndex); + + tree->velocityFunc = NULL; + + tree->leaves = cpHashSetNew(0, (cpHashSetEqlFunc)leafSetEql); + tree->root = NULL; + + tree->pooledNodes = NULL; + tree->allocatedBuffers = cpArrayNew(0); + + tree->stamp = 0; + + return (cpSpatialIndex *)tree; +} + +void +cpBBTreeSetVelocityFunc(cpSpatialIndex *index, cpBBTreeVelocityFunc func) +{ + if(index->klass != Klass()){ + cpAssertWarn(cpFalse, "Ignoring cpBBTreeSetVelocityFunc() call to non-tree spatial index."); + return; + } + + ((cpBBTree *)index)->velocityFunc = func; +} + +cpSpatialIndex * +cpBBTreeNew(cpSpatialIndexBBFunc bbfunc, cpSpatialIndex *staticIndex) +{ + return cpBBTreeInit(cpBBTreeAlloc(), bbfunc, staticIndex); +} + +static void +cpBBTreeDestroy(cpBBTree *tree) +{ + cpHashSetFree(tree->leaves); + + if(tree->allocatedBuffers) cpArrayFreeEach(tree->allocatedBuffers, cpfree); + cpArrayFree(tree->allocatedBuffers); +} + +//MARK: Insert/Remove + +static void +cpBBTreeInsert(cpBBTree *tree, void *obj, cpHashValue hashid) +{ + Node *leaf = (Node *)cpHashSetInsert(tree->leaves, hashid, obj, (cpHashSetTransFunc)leafSetTrans, tree); + + Node *root = tree->root; + tree->root = SubtreeInsert(root, leaf, tree); + + leaf->STAMP = GetMasterTree(tree)->stamp; + LeafAddPairs(leaf, tree); + IncrementStamp(tree); +} + +static void +cpBBTreeRemove(cpBBTree *tree, void *obj, cpHashValue hashid) +{ + Node *leaf = (Node *)cpHashSetRemove(tree->leaves, hashid, obj); + + tree->root = SubtreeRemove(tree->root, leaf, tree); + PairsClear(leaf, tree); + NodeRecycle(tree, leaf); +} + +static cpBool +cpBBTreeContains(cpBBTree *tree, void *obj, cpHashValue hashid) +{ + return (cpHashSetFind(tree->leaves, hashid, obj) != NULL); +} + +//MARK: Reindex + +static void +cpBBTreeReindexQuery(cpBBTree *tree, cpSpatialIndexQueryFunc func, void *data) +{ + if(!tree->root) return; + + // LeafUpdate() may modify tree->root. Don't cache it. + cpHashSetEach(tree->leaves, (cpHashSetIteratorFunc)LeafUpdate, tree); + + cpSpatialIndex *staticIndex = tree->spatialIndex.staticIndex; + Node *staticRoot = (staticIndex && staticIndex->klass == Klass() ? ((cpBBTree *)staticIndex)->root : NULL); + + MarkContext context = {tree, staticRoot, func, data}; + MarkSubtree(tree->root, &context); + if(staticIndex && !staticRoot) cpSpatialIndexCollideStatic((cpSpatialIndex *)tree, staticIndex, func, data); + + IncrementStamp(tree); +} + +static void +cpBBTreeReindex(cpBBTree *tree) +{ + cpBBTreeReindexQuery(tree, VoidQueryFunc, NULL); +} + +static void +cpBBTreeReindexObject(cpBBTree *tree, void *obj, cpHashValue hashid) +{ + Node *leaf = (Node *)cpHashSetFind(tree->leaves, hashid, obj); + if(leaf){ + if(LeafUpdate(leaf, tree)) LeafAddPairs(leaf, tree); + IncrementStamp(tree); + } +} + +//MARK: Query + +static void +cpBBTreeSegmentQuery(cpBBTree *tree, void *obj, cpVect a, cpVect b, cpFloat t_exit, cpSpatialIndexSegmentQueryFunc func, void *data) +{ + Node *root = tree->root; + if(root) SubtreeSegmentQuery(root, obj, a, b, t_exit, func, data); +} + +static void +cpBBTreeQuery(cpBBTree *tree, void *obj, cpBB bb, cpSpatialIndexQueryFunc func, void *data) +{ + if(tree->root) SubtreeQuery(tree->root, obj, bb, func, data); +} + +//MARK: Misc + +static int +cpBBTreeCount(cpBBTree *tree) +{ + return cpHashSetCount(tree->leaves); +} + +typedef struct eachContext { + cpSpatialIndexIteratorFunc func; + void *data; +} eachContext; + +static void each_helper(Node *node, eachContext *context){context->func(node->obj, context->data);} + +static void +cpBBTreeEach(cpBBTree *tree, cpSpatialIndexIteratorFunc func, void *data) +{ + eachContext context = {func, data}; + cpHashSetEach(tree->leaves, (cpHashSetIteratorFunc)each_helper, &context); +} + +static cpSpatialIndexClass klass = { + (cpSpatialIndexDestroyImpl)cpBBTreeDestroy, + + (cpSpatialIndexCountImpl)cpBBTreeCount, + (cpSpatialIndexEachImpl)cpBBTreeEach, + + (cpSpatialIndexContainsImpl)cpBBTreeContains, + (cpSpatialIndexInsertImpl)cpBBTreeInsert, + (cpSpatialIndexRemoveImpl)cpBBTreeRemove, + + (cpSpatialIndexReindexImpl)cpBBTreeReindex, + (cpSpatialIndexReindexObjectImpl)cpBBTreeReindexObject, + (cpSpatialIndexReindexQueryImpl)cpBBTreeReindexQuery, + + (cpSpatialIndexQueryImpl)cpBBTreeQuery, + (cpSpatialIndexSegmentQueryImpl)cpBBTreeSegmentQuery, +}; + +static inline cpSpatialIndexClass *Klass(){return &klass;} + + +//MARK: Tree Optimization + +static int +cpfcompare(const cpFloat *a, const cpFloat *b){ + return (*a < *b ? -1 : (*b < *a ? 1 : 0)); +} + +static void +fillNodeArray(Node *node, Node ***cursor){ + (**cursor) = node; + (*cursor)++; +} + +static Node * +partitionNodes(cpBBTree *tree, Node **nodes, int count) +{ + if(count == 1){ + return nodes[0]; + } else if(count == 2) { + return NodeNew(tree, nodes[0], nodes[1]); + } + + // Find the AABB for these nodes + cpBB bb = nodes[0]->bb; + for(int i=1; ibb); + + // Split it on it's longest axis + cpBool splitWidth = (bb.r - bb.l > bb.t - bb.b); + + // Sort the bounds and use the median as the splitting point + cpFloat *bounds = (cpFloat *)cpcalloc(count*2, sizeof(cpFloat)); + if(splitWidth){ + for(int i=0; ibb.l; + bounds[2*i + 1] = nodes[i]->bb.r; + } + } else { + for(int i=0; ibb.b; + bounds[2*i + 1] = nodes[i]->bb.t; + } + } + + qsort(bounds, count*2, sizeof(cpFloat), (int (*)(const void *, const void *))cpfcompare); + cpFloat split = (bounds[count - 1] + bounds[count])*0.5f; // use the medain as the split + cpfree(bounds); + + // Generate the child BBs + cpBB a = bb, b = bb; + if(splitWidth) a.r = b.l = split; else a.t = b.b = split; + + // Partition the nodes + int right = count; + for(int left=0; left < right;){ + Node *node = nodes[left]; + if(cpBBMergedArea(node->bb, b) < cpBBMergedArea(node->bb, a)){ +// if(cpBBProximity(node->bb, b) < cpBBProximity(node->bb, a)){ + right--; + nodes[left] = nodes[right]; + nodes[right] = node; + } else { + left++; + } + } + + if(right == count){ + Node *node = NULL; + for(int i=0; iroot; +// Node *node = root; +// int bit = 0; +// unsigned int path = tree->opath; +// +// while(!NodeIsLeaf(node)){ +// node = (path&(1<a : node->b); +// bit = (bit + 1)&(sizeof(unsigned int)*8 - 1); +// } +// +// root = subtreeRemove(root, node, tree); +// tree->root = subtreeInsert(root, node, tree); +// } +//} + +void +cpBBTreeOptimize(cpSpatialIndex *index) +{ + if(index->klass != &klass){ + cpAssertWarn(cpFalse, "Ignoring cpBBTreeOptimize() call to non-tree spatial index."); + return; + } + + cpBBTree *tree = (cpBBTree *)index; + Node *root = tree->root; + if(!root) return; + + int count = cpBBTreeCount(tree); + Node **nodes = (Node **)cpcalloc(count, sizeof(Node *)); + Node **cursor = nodes; + + cpHashSetEach(tree->leaves, (cpHashSetIteratorFunc)fillNodeArray, &cursor); + + SubtreeRecycle(tree, root); + tree->root = partitionNodes(tree, nodes, count); + cpfree(nodes); +} + +//MARK: Debug Draw + +//#define CP_BBTREE_DEBUG_DRAW +#ifdef CP_BBTREE_DEBUG_DRAW +#include "OpenGL/gl.h" +#include "OpenGL/glu.h" +#include + +static void +NodeRender(Node *node, int depth) +{ + if(!NodeIsLeaf(node) && depth <= 10){ + NodeRender(node->a, depth + 1); + NodeRender(node->b, depth + 1); + } + + cpBB bb = node->bb; + +// GLfloat v = depth/2.0f; +// glColor3f(1.0f - v, v, 0.0f); + glLineWidth(cpfmax(5.0f - depth, 1.0f)); + glBegin(GL_LINES); { + glVertex2f(bb.l, bb.b); + glVertex2f(bb.l, bb.t); + + glVertex2f(bb.l, bb.t); + glVertex2f(bb.r, bb.t); + + glVertex2f(bb.r, bb.t); + glVertex2f(bb.r, bb.b); + + glVertex2f(bb.r, bb.b); + glVertex2f(bb.l, bb.b); + }; glEnd(); +} + +void +cpBBTreeRenderDebug(cpSpatialIndex *index){ + if(index->klass != &klass){ + cpAssertWarn(cpFalse, "Ignoring cpBBTreeRenderDebug() call to non-tree spatial index."); + return; + } + + cpBBTree *tree = (cpBBTree *)index; + if(tree->root) NodeRender(tree->root, 0); +} +#endif diff --git a/external/Chipmunk/src/cpBody.c b/external/Chipmunk/src/cpBody.c new file mode 100644 index 0000000..5621682 --- /dev/null +++ b/external/Chipmunk/src/cpBody.c @@ -0,0 +1,469 @@ +/* Copyright (c) 2007 Scott Lembcke + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +#include +#include + +#include "chipmunk/chipmunk_private.h" + +cpBody* +cpBodyAlloc(void) +{ + return (cpBody *)cpcalloc(1, sizeof(cpBody)); +} + +cpBody * +cpBodyInit(cpBody *body, cpFloat mass, cpFloat moment) +{ + body->space = NULL; + body->shapeList = NULL; + body->arbiterList = NULL; + body->constraintList = NULL; + + body->velocity_func = cpBodyUpdateVelocity; + body->position_func = cpBodyUpdatePosition; + + cpComponentNode node = {NULL, NULL, 0.0f}; + body->node = node; + + body->p = cpvzero; + body->v = cpvzero; + body->f = cpvzero; + + body->w = 0.0f; + body->t = 0.0f; + + body->v_bias = cpvzero; + body->w_bias = 0.0f; + + body->v_limit = (cpFloat)INFINITY; + body->w_limit = (cpFloat)INFINITY; + + body->userData = NULL; + + // Setters must be called after full initialization so the sanity checks don't assert on garbage data. + cpBodySetMass(body, mass); + cpBodySetMoment(body, moment); + cpBodySetAngle(body, 0.0f); + + return body; +} + +cpBody* +cpBodyNew(cpFloat mass, cpFloat moment) +{ + return cpBodyInit(cpBodyAlloc(), mass, moment); +} + +cpBody* +cpBodyNewKinematic() +{ + cpBody *body = cpBodyNew(0.0f, 0.0f); + cpBodySetType(body, CP_BODY_TYPE_KINEMATIC); + + return body; +} + +cpBody* +cpBodyNewStatic() +{ + cpBody *body = cpBodyNew(0.0f, 0.0f); + cpBodySetType(body, CP_BODY_TYPE_STATIC); + + return body; +} + +void cpBodyDestroy(cpBody *body){} + +void +cpBodyFree(cpBody *body) +{ + if(body){ + cpBodyDestroy(body); + cpfree(body); + } +} + +static void cpv_assert_nan(cpVect v, char *message){cpAssertHard(v.x == v.x && v.y == v.y, message);} +static void cpv_assert_infinite(cpVect v, char *message){cpAssertHard(cpfabs(v.x) != INFINITY && cpfabs(v.y) != INFINITY, message);} +static void cpv_assert_sane(cpVect v, char *message){cpv_assert_nan(v, message); cpv_assert_infinite(v, message);} + +#ifdef __cplusplus +extern "C" { +#endif + +void +cpBodySanityCheck(const cpBody *body) +{ + cpAssertHard(body->m == body->m && body->m_inv == body->m_inv, "Body's mass is NaN."); + cpAssertHard(body->i == body->i && body->i_inv == body->i_inv, "Body's moment is NaN."); + cpAssertHard(body->m >= 0.0f, "Body's mass is negative."); + cpAssertHard(body->i >= 0.0f, "Body's moment is negative."); + + cpv_assert_sane(body->p, "Body's position is invalid."); + cpv_assert_sane(body->v, "Body's velocity is invalid."); + cpv_assert_sane(body->f, "Body's force is invalid."); + + cpAssertHard(body->a == body->a && cpfabs(body->a) != INFINITY, "Body's angle is invalid."); + cpAssertHard(body->w == body->w && cpfabs(body->w) != INFINITY, "Body's angular velocity is invalid."); + cpAssertHard(body->t == body->t && cpfabs(body->t) != INFINITY, "Body's torque is invalid."); + + cpAssertHard(body->v_limit == body->v_limit, "Body's velocity limit is invalid."); + cpAssertHard(body->w_limit == body->w_limit, "Body's angular velocity limit is invalid."); +} + +#ifdef __cplusplus +} +#endif + + +void +cpBodySetType(cpBody *body, cpBodyType type) +{ + cpBodyType oldType = cpBodyGetType(body); + if(oldType == type) return; + + // Static bodies have their idle timers set to infinity. + // Non-static bodies should have their idle timer reset. + body->node.idleTime = (type == CP_BODY_TYPE_STATIC ? INFINITY : 0.0f); + + if(type == CP_BODY_TYPE_DYNAMIC){ + body->m = body->i = 0.0f; + body->m_inv = body->i_inv = INFINITY; + + cpBodyAccumulateMassFromShapes(body); + } else { + body->m = body->i = INFINITY; + body->m_inv = body->i_inv = 0.0f; + + body->v = cpvzero; + body->w = 0.0f; + } + + // If the body is added to a space already, we'll need to update some space data structures. + cpSpace *space = cpBodyGetSpace(body); + if(space != NULL){ + cpAssertSpaceUnlocked(space); + + if(oldType == CP_BODY_TYPE_STATIC){ + // TODO This is probably not necessary +// cpBodyActivateStatic(body, NULL); + } else { + cpBodyActivate(body); + } + + // Move the bodies to the correct array. + cpArray *fromArray = (oldType == CP_BODY_TYPE_DYNAMIC ? space->dynamicBodies : space->otherBodies); + cpArray *toArray = (type == CP_BODY_TYPE_DYNAMIC ? space->dynamicBodies : space->otherBodies); + if(fromArray != toArray){ + cpArrayDeleteObj(fromArray, body); + cpArrayPush(toArray, body); + } + + // Move the body's shapes to the correct spatial index. + cpSpatialIndex *fromIndex = (oldType == CP_BODY_TYPE_STATIC ? space->staticShapes : space->dynamicShapes); + cpSpatialIndex *toIndex = (type == CP_BODY_TYPE_STATIC ? space->staticShapes : space->dynamicShapes); + if(fromIndex != toIndex){ + CP_BODY_FOREACH_SHAPE(body, shape){ + cpSpatialIndexRemove(fromIndex, shape, shape->hashid); + cpSpatialIndexInsert(toIndex, shape, shape->hashid); + } + } + } +} + + +// Should *only* be called when shapes with mass info are modified, added or removed. +void +cpBodyAccumulateMassFromShapes(cpBody *body) +{ + if(body == NULL || !cpBodyIsDynamic(body)) return; + + // Reset the body's mass data. + body->m = body->i = 0.0f; + body->cog = cpvzero; + + // Cache the position to realign it at the end. + cpVect pos = cpBodyGetPosition(body); + + // Accumulate mass from shapes. + CP_BODY_FOREACH_SHAPE(body, shape){ + struct cpShapeMassInfo *info = &shape->massInfo; + cpFloat m = info->m; + + if(m > 0.0f){ + cpFloat msum = body->m + m; + + body->i += m*info->i + cpvdistsq(body->cog, info->cog)*(m*body->m)/msum; + body->cog = cpvlerp(body->cog, info->cog, m/msum); + body->m = msum; + } + } + + // Recalculate the inverses. + body->m_inv = 1.0f/body->m; + body->i_inv = 1.0f/body->i; + + // Realign the body since the CoG has probably moved. + cpBodySetPosition(body, pos); + cpAssertSaneBody(body); +} + +void +cpBodySetMass(cpBody *body, cpFloat mass) +{ + cpAssertHard(cpBodyGetType(body) == CP_BODY_TYPE_DYNAMIC, "You cannot set the mass of kinematic or static bodies."); + cpAssertHard(0.0f <= mass && mass < INFINITY, "Mass must be positive and finite."); + + cpBodyActivate(body); + body->m = mass; + body->m_inv = 1.0f/mass; + cpAssertSaneBody(body); +} + +void +cpBodySetMoment(cpBody *body, cpFloat moment) +{ + cpAssertHard(moment >= 0.0f, "Moment of Inertia must be positive."); + + cpBodyActivate(body); + body->i = moment; + body->i_inv = 1.0f/moment; + cpAssertSaneBody(body); +} + +cpVect +cpBodyGetRotation(const cpBody *body) +{ + return cpv(body->transform.a, body->transform.b); +} + +void +cpBodyAddShape(cpBody *body, cpShape *shape) +{ + cpShape *next = body->shapeList; + if(next) next->prev = shape; + + shape->next = next; + body->shapeList = shape; + + if(shape->massInfo.m > 0.0f){ + cpBodyAccumulateMassFromShapes(body); + } +} + +void +cpBodyRemoveShape(cpBody *body, cpShape *shape) +{ + cpShape *prev = shape->prev; + cpShape *next = shape->next; + + if(prev){ + prev->next = next; + } else { + body->shapeList = next; + } + + if(next){ + next->prev = prev; + } + + shape->prev = NULL; + shape->next = NULL; + + if(cpBodyIsDynamic(body) && shape->massInfo.m > 0.0f){ + cpBodyAccumulateMassFromShapes(body); + } +} + +static cpConstraint * +filterConstraints(cpConstraint *node, cpBody *body, cpConstraint *filter) +{ + if(node == filter){ + return cpConstraintNext(node, body); + } else if(node->a == body){ + node->next_a = filterConstraints(node->next_a, body, filter); + } else { + node->next_b = filterConstraints(node->next_b, body, filter); + } + + return node; +} + +void +cpBodyRemoveConstraint(cpBody *body, cpConstraint *constraint) +{ + body->constraintList = filterConstraints(body->constraintList, body, constraint); +} + +// 'p' is the position of the CoG +void +SetTransform(cpBody *body, cpVect p, cpFloat a) +{ + cpVect rot = cpvforangle(a); + cpVect c = body->cog; + + body->transform = cpTransformNewTranspose( + rot.x, -rot.y, p.x - (c.x*rot.x - c.y*rot.y), + rot.y, rot.x, p.y - (c.x*rot.y + c.y*rot.x) + ); +} + +static inline cpFloat +SetAngle(cpBody *body, cpFloat a) +{ + body->a = a; + cpAssertSaneBody(body); + + return a; +} + +void +cpBodySetPosition(cpBody *body, cpVect position) +{ + cpBodyActivate(body); + cpVect p = body->p = cpvadd(cpTransformVect(body->transform, body->cog), position); + cpAssertSaneBody(body); + + SetTransform(body, p, body->a); +} + +void +cpBodySetAngle(cpBody *body, cpFloat angle) +{ + cpBodyActivate(body); + SetAngle(body, angle); + + SetTransform(body, body->p, angle); +} + +void +cpBodyUpdateVelocity(cpBody *body, cpVect gravity, cpFloat damping, cpFloat dt) +{ + cpAssertSoft(body->m > 0.0f && body->i > 0.0f, "Body's mass and moment must be positive to simulate. (Mass: %f Moment: %f)", body->m, body->i); + + body->v = cpvclamp(cpvadd(cpvmult(body->v, damping), cpvmult(cpvadd(gravity, cpvmult(body->f, body->m_inv)), dt)), body->v_limit); + + cpFloat w_limit = body->w_limit; + body->w = cpfclamp(body->w*damping + body->t*body->i_inv*dt, -w_limit, w_limit); + + // Reset forces. + body->f = cpvzero; + body->t = 0.0f; + + cpAssertSaneBody(body); +} + +void +cpBodyUpdatePosition(cpBody *body, cpFloat dt) +{ + cpVect p = body->p = cpvadd(body->p, cpvmult(cpvadd(body->v, body->v_bias), dt)); + cpFloat a = SetAngle(body, body->a + (body->w + body->w_bias)*dt); + SetTransform(body, p, a); + + body->v_bias = cpvzero; + body->w_bias = 0.0f; + + cpAssertSaneBody(body); +} + +void +cpBodyApplyForceAtWorldPoint(cpBody *body, cpVect force, cpVect point) +{ + cpBodyActivate(body); + body->f = cpvadd(body->f, force); + + cpVect r = cpvsub(point, cpTransformPoint(body->transform, body->cog)); + body->t += cpvcross(r, force); +} + +void +cpBodyApplyForceAtLocalPoint(cpBody *body, cpVect force, cpVect point) +{ + cpBodyApplyForceAtWorldPoint(body, cpTransformVect(body->transform, force), cpTransformPoint(body->transform, point)); +} + +void +cpBodyApplyImpulseAtWorldPoint(cpBody *body, cpVect impulse, cpVect point) +{ + cpBodyActivate(body); + + cpVect r = cpvsub(point, cpTransformPoint(body->transform, body->cog)); + apply_impulse(body, impulse, r); +} + +void +cpBodyApplyImpulseAtLocalPoint(cpBody *body, cpVect impulse, cpVect point) +{ + cpBodyApplyImpulseAtWorldPoint(body, cpTransformVect(body->transform, impulse), cpTransformPoint(body->transform, point)); +} + +cpVect +cpBodyGetVelocityAtLocalPoint(const cpBody *body, cpVect point) +{ + cpVect r = cpTransformVect(body->transform, cpvsub(point, body->cog)); + return cpvadd(body->v, cpvmult(cpvperp(r), body->w)); +} + +cpVect +cpBodyGetVelocityAtWorldPoint(const cpBody *body, cpVect point) +{ + cpVect r = cpvsub(point, cpTransformPoint(body->transform, body->cog)); + return cpvadd(body->v, cpvmult(cpvperp(r), body->w)); +} + +void +cpBodyEachShape(cpBody *body, cpBodyShapeIteratorFunc func, void *data) +{ + cpShape *shape = body->shapeList; + while(shape){ + cpShape *next = shape->next; + func(body, shape, data); + shape = next; + } +} + +void +cpBodyEachConstraint(cpBody *body, cpBodyConstraintIteratorFunc func, void *data) +{ + cpConstraint *constraint = body->constraintList; + while(constraint){ + cpConstraint *next = cpConstraintNext(constraint, body); + func(body, constraint, data); + constraint = next; + } +} + +void +cpBodyEachArbiter(cpBody *body, cpBodyArbiterIteratorFunc func, void *data) +{ + cpArbiter *arb = body->arbiterList; + while(arb){ + cpArbiter *next = cpArbiterNext(arb, body); + + cpBool swapped = arb->swapped; { + arb->swapped = (body == arb->body_b); + func(body, arb, data); + } arb->swapped = swapped; + + arb = next; + } +} diff --git a/external/Chipmunk/src/cpCollision.c b/external/Chipmunk/src/cpCollision.c new file mode 100644 index 0000000..572267e --- /dev/null +++ b/external/Chipmunk/src/cpCollision.c @@ -0,0 +1,675 @@ +/* Copyright (c) 2007 Scott Lembcke + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +#include +#include + +#include "chipmunk/chipmunk_private.h" + +#if DEBUG && 0 +#include "ChipmunkDemo.h" +#define DRAW_ALL 0 +#define DRAW_GJK (0 || DRAW_ALL) +#define DRAW_EPA (0 || DRAW_ALL) +#define DRAW_CLOSEST (0 || DRAW_ALL) +#define DRAW_CLIP (0 || DRAW_ALL) + +#define PRINT_LOG 0 +#endif + +#define ENABLE_CACHING 1 + +#define MAX_GJK_ITERATIONS 30 +#define MAX_EPA_ITERATIONS 30 +#define WARN_GJK_ITERATIONS 20 +#define WARN_EPA_ITERATIONS 20 + +static inline void +cpCollisionInfoPushContact(struct cpCollisionInfo *info, cpVect p1, cpVect p2, cpHashValue hash) +{ + cpAssertSoft(info->count <= CP_MAX_CONTACTS_PER_ARBITER, "Internal error: Tried to push too many contacts."); + + struct cpContact *con = &info->arr[info->count]; + con->r1 = p1; + con->r2 = p2; + con->hash = hash; + + info->count++; +} + +//MARK: Support Points and Edges: + +static inline int +PolySupportPointIndex(const int count, const cpSplittingPlane *planes, const cpVect n) +{ + cpFloat max = -INFINITY; + int index = 0; + + for(int i=0; i max){ + max = d; + index = i; + } + } + + return index; +} + +struct SupportPoint { + cpVect p; + cpCollisionID id; +}; + +static inline struct SupportPoint +SupportPointNew(cpVect p, cpCollisionID id) +{ + struct SupportPoint point = {p, id}; + return point; +} + +typedef struct SupportPoint (*SupportPointFunc)(const cpShape *shape, const cpVect n); + +static inline struct SupportPoint +CircleSupportPoint(const cpCircleShape *circle, const cpVect n) +{ + return SupportPointNew(circle->tc, 0); +} + +static inline struct SupportPoint +SegmentSupportPoint(const cpSegmentShape *seg, const cpVect n) +{ + if(cpvdot(seg->ta, n) > cpvdot(seg->tb, n)){ + return SupportPointNew(seg->ta, 0); + } else { + return SupportPointNew(seg->tb, 1); + } +} + +static inline struct SupportPoint +PolySupportPoint(const cpPolyShape *poly, const cpVect n) +{ + const cpSplittingPlane *planes = poly->planes; + int i = PolySupportPointIndex(poly->count, planes, n); + return SupportPointNew(planes[i].v0, i); +} + +struct MinkowskiPoint { + cpVect a, b; + cpVect ab; + cpCollisionID id; +}; + +static inline struct MinkowskiPoint +MinkowskiPointNew(const struct SupportPoint a, const struct SupportPoint b) +{ + struct MinkowskiPoint point = {a.p, b.p, cpvsub(b.p, a.p), (a.id & 0xFF)<<8 | (b.id & 0xFF)}; + return point; +} + +struct SupportContext { + const cpShape *shape1, *shape2; + SupportPointFunc func1, func2; +}; + +static inline struct MinkowskiPoint +Support(const struct SupportContext *ctx, const cpVect n) +{ + struct SupportPoint a = ctx->func1(ctx->shape1, cpvneg(n)); + struct SupportPoint b = ctx->func2(ctx->shape2, n); + return MinkowskiPointNew(a, b); +} + +struct EdgePoint { + cpVect p; + cpHashValue hash; +}; + +struct Edge { + struct EdgePoint a, b; + cpFloat r; + cpVect n; +}; + +static struct Edge +SupportEdgeForPoly(const cpPolyShape *poly, const cpVect n) +{ + int count = poly->count; + int i1 = PolySupportPointIndex(poly->count, poly->planes, n); + + // TODO: get rid of mod eventually, very expensive on ARM + int i0 = (i1 - 1 + count)%count; + int i2 = (i1 + 1)%count; + + cpSplittingPlane *planes = poly->planes; + cpHashValue hashid = poly->shape.hashid; + if(cpvdot(n, planes[i1].n) > cpvdot(n, planes[i2].n)){ + struct Edge edge = {{planes[i0].v0, CP_HASH_PAIR(hashid, i0)}, {planes[i1].v0, CP_HASH_PAIR(hashid, i1)}, poly->r, planes[i1].n}; + return edge; + } else { + struct Edge edge = {{planes[i1].v0, CP_HASH_PAIR(hashid, i1)}, {planes[i2].v0, CP_HASH_PAIR(hashid, i2)}, poly->r, planes[i2].n}; + return edge; + } +} + +static struct Edge +SupportEdgeForSegment(const cpSegmentShape *seg, const cpVect n) +{ + cpHashValue hashid = seg->shape.hashid; + if(cpvdot(seg->tn, n) > 0.0){ + struct Edge edge = {{seg->ta, CP_HASH_PAIR(hashid, 0)}, {seg->tb, CP_HASH_PAIR(hashid, 1)}, seg->r, seg->tn}; + return edge; + } else { + struct Edge edge = {{seg->tb, CP_HASH_PAIR(hashid, 1)}, {seg->ta, CP_HASH_PAIR(hashid, 0)}, seg->r, cpvneg(seg->tn)}; + return edge; + } +} + +static inline cpFloat +ClosestT(const cpVect a, const cpVect b) +{ + cpVect delta = cpvsub(b, a); + return -cpfclamp(cpvdot(delta, cpvadd(a, b))/cpvlengthsq(delta), -1.0f, 1.0f); +} + +static inline cpVect +LerpT(const cpVect a, const cpVect b, const cpFloat t) +{ + cpFloat ht = 0.5f*t; + return cpvadd(cpvmult(a, 0.5f - ht), cpvmult(b, 0.5f + ht)); +} + +struct ClosestPoints { + cpVect a, b; + cpVect n; + cpFloat d; + cpCollisionID id; +}; + +static inline struct ClosestPoints +ClosestPointsNew(const struct MinkowskiPoint v0, const struct MinkowskiPoint v1) +{ + cpFloat t = ClosestT(v0.ab, v1.ab); + cpVect p = LerpT(v0.ab, v1.ab, t); + + cpVect pa = LerpT(v0.a, v1.a, t); + cpVect pb = LerpT(v0.b, v1.b, t); + cpCollisionID id = (v0.id & 0xFFFF)<<16 | (v1.id & 0xFFFF); + + cpVect delta = cpvsub(v1.ab, v0.ab); + cpVect n = cpvnormalize(cpvperp(delta)); + cpFloat d = -cpvdot(n, p); + + if(d <= 0.0f || (0.0f < t && t < 1.0f)){ + struct ClosestPoints points = {pa, pb, cpvneg(n), d, id}; + return points; + } else { + cpFloat d2 = cpvlength(p); + cpVect n = cpvmult(p, 1.0f/(d2 + CPFLOAT_MIN)); + + struct ClosestPoints points = {pa, pb, n, d2, id}; + return points; + } +} + +//MARK: EPA Functions + +static inline cpFloat +ClosestDist(const cpVect v0,const cpVect v1) +{ + return cpvlengthsq(LerpT(v0, v1, ClosestT(v0, v1))); +} + +static struct ClosestPoints +EPARecurse(const struct SupportContext *ctx, const int count, const struct MinkowskiPoint *hull, const int iteration) +{ + int mini = 0; + cpFloat minDist = INFINITY; + + // TODO: precalculate this when building the hull and save a step. + for(int j=0, i=count-1; j 0.0f && iteration < MAX_EPA_ITERATIONS){ + int count2 = 1; + struct MinkowskiPoint *hull2 = (struct MinkowskiPoint *)alloca((count + 1)*sizeof(struct MinkowskiPoint)); + hull2[0] = p; + + for(int i=0; i 0.0f){ + hull2[count2] = hull[index]; + count2++; + } + } + + return EPARecurse(ctx, count2, hull2, iteration + 1); + } else { + cpAssertWarn(iteration < WARN_EPA_ITERATIONS, "High EPA iterations: %d", iteration); + return ClosestPointsNew(v0, v1); + } +} + +static struct ClosestPoints +EPA(const struct SupportContext *ctx, const struct MinkowskiPoint v0, const struct MinkowskiPoint v1, const struct MinkowskiPoint v2) +{ + // TODO: allocate a NxM array here and do an in place convex hull reduction in EPARecurse + struct MinkowskiPoint hull[3] = {v0, v1, v2}; + return EPARecurse(ctx, 3, hull, 1); +} + +//MARK: GJK Functions. + +static inline struct ClosestPoints +GJKRecurse(const struct SupportContext *ctx, const struct MinkowskiPoint v0, const struct MinkowskiPoint v1, const int iteration) +{ + if(iteration > MAX_GJK_ITERATIONS){ + cpAssertWarn(iteration < WARN_GJK_ITERATIONS, "High GJK iterations: %d", iteration); + return ClosestPointsNew(v0, v1); + } + + cpVect delta = cpvsub(v1.ab, v0.ab); + if(cpvcross(delta, cpvadd(v0.ab, v1.ab)) > 0.0f){ + // Origin is behind axis. Flip and try again. + return GJKRecurse(ctx, v1, v0, iteration + 1); + } else { + cpFloat t = ClosestT(v0.ab, v1.ab); + cpVect n = (-1.0f < t && t < 1.0f ? cpvperp(delta) : cpvneg(LerpT(v0.ab, v1.ab, t))); + struct MinkowskiPoint p = Support(ctx, n); + +#if DRAW_GJK + ChipmunkDebugDrawSegment(v0.ab, v1.ab, RGBAColor(1, 1, 1, 1)); + cpVect c = cpvlerp(v0.ab, v1.ab, 0.5); + ChipmunkDebugDrawSegment(c, cpvadd(c, cpvmult(cpvnormalize(n), 5.0)), RGBAColor(1, 0, 0, 1)); + + ChipmunkDebugDrawDot(5.0, p.ab, LAColor(1, 1)); +#endif + + if( + cpvcross(cpvsub(v1.ab, p.ab), cpvadd(v1.ab, p.ab)) > 0.0f && + cpvcross(cpvsub(v0.ab, p.ab), cpvadd(v0.ab, p.ab)) < 0.0f + ){ + cpAssertWarn(iteration < WARN_GJK_ITERATIONS, "High GJK->EPA iterations: %d", iteration); + // The triangle v0, p, v1 contains the origin. Use EPA to find the MSA. + return EPA(ctx, v0, p, v1); + } else { + // The new point must be farther along the normal than the existing points. + if(cpvdot(p.ab, n) <= cpfmax(cpvdot(v0.ab, n), cpvdot(v1.ab, n))){ + cpAssertWarn(iteration < WARN_GJK_ITERATIONS, "High GJK iterations: %d", iteration); + return ClosestPointsNew(v0, v1); + } else { + if(ClosestDist(v0.ab, p.ab) < ClosestDist(p.ab, v1.ab)){ + return GJKRecurse(ctx, v0, p, iteration + 1); + } else { + return GJKRecurse(ctx, p, v1, iteration + 1); + } + } + } + } +} + +static struct SupportPoint +ShapePoint(const cpShape *shape, const int i) +{ + switch(shape->klass->type){ + case CP_CIRCLE_SHAPE: { + return SupportPointNew(((cpCircleShape *)shape)->tc, 0); + } case CP_SEGMENT_SHAPE: { + cpSegmentShape *seg = (cpSegmentShape *)shape; + return SupportPointNew(i == 0 ? seg->ta : seg->tb, i); + } case CP_POLY_SHAPE: { + cpPolyShape *poly = (cpPolyShape *)shape; + // Poly shapes may change vertex count. + int index = (i < poly->count ? i : 0); + return SupportPointNew(poly->planes[index].v0, index); + } default: { + return SupportPointNew(cpvzero, 0); + } + } +} + +static struct ClosestPoints +GJK(const struct SupportContext *ctx, cpCollisionID *id) +{ +#if DRAW_GJK || DRAW_EPA + int count1 = 1; + int count2 = 1; + + switch(ctx->shape1->klass->type){ + case CP_SEGMENT_SHAPE: count1 = 2; break; + case CP_POLY_SHAPE: count1 = ((cpPolyShape *)ctx->shape1)->count; break; + default: break; + } + + switch(ctx->shape2->klass->type){ + case CP_SEGMENT_SHAPE: count1 = 2; break; + case CP_POLY_SHAPE: count2 = ((cpPolyShape *)ctx->shape2)->count; break; + default: break; + } + + + // draw the minkowski difference origin + cpVect origin = cpvzero; + ChipmunkDebugDrawDot(5.0, origin, RGBAColor(1,0,0,1)); + + int mdiffCount = count1*count2; + cpVect *mdiffVerts = alloca(mdiffCount*sizeof(cpVect)); + + for(int i=0; ishape2, j).p, ShapePoint(ctx->shape1, i).p); + mdiffVerts[i*count2 + j] = v; + ChipmunkDebugDrawDot(2.0, v, RGBAColor(1, 0, 0, 1)); + } + } + + cpVect *hullVerts = alloca(mdiffCount*sizeof(cpVect)); + int hullCount = cpConvexHull(mdiffCount, mdiffVerts, hullVerts, NULL, 0.0); + + ChipmunkDebugDrawPolygon(hullCount, hullVerts, 0.0, RGBAColor(1, 0, 0, 1), RGBAColor(1, 0, 0, 0.25)); +#endif + + struct MinkowskiPoint v0, v1; + if(*id && ENABLE_CACHING){ + v0 = MinkowskiPointNew(ShapePoint(ctx->shape1, (*id>>24)&0xFF), ShapePoint(ctx->shape2, (*id>>16)&0xFF)); + v1 = MinkowskiPointNew(ShapePoint(ctx->shape1, (*id>> 8)&0xFF), ShapePoint(ctx->shape2, (*id )&0xFF)); + } else { + cpVect axis = cpvperp(cpvsub(cpBBCenter(ctx->shape1->bb), cpBBCenter(ctx->shape2->bb))); + v0 = Support(ctx, axis); + v1 = Support(ctx, cpvneg(axis)); + } + + struct ClosestPoints points = GJKRecurse(ctx, v0, v1, 1); + *id = points.id; + return points; +} + +//MARK: Contact Clipping + +static inline void +ContactPoints(const struct Edge e1, const struct Edge e2, const struct ClosestPoints points, struct cpCollisionInfo *info) +{ + cpFloat mindist = e1.r + e2.r; + if(points.d <= mindist){ +#ifdef DRAW_CLIP + ChipmunkDebugDrawFatSegment(e1.a.p, e1.b.p, e1.r, RGBAColor(0, 1, 0, 1), LAColor(0, 0)); + ChipmunkDebugDrawFatSegment(e2.a.p, e2.b.p, e2.r, RGBAColor(1, 0, 0, 1), LAColor(0, 0)); +#endif + cpVect n = info->n = points.n; + + // Distances along the axis parallel to n + cpFloat d_e1_a = cpvcross(e1.a.p, n); + cpFloat d_e1_b = cpvcross(e1.b.p, n); + cpFloat d_e2_a = cpvcross(e2.a.p, n); + cpFloat d_e2_b = cpvcross(e2.b.p, n); + + cpFloat e1_denom = 1.0f/(d_e1_b - d_e1_a); + cpFloat e2_denom = 1.0f/(d_e2_b - d_e2_a); + + { + cpVect p1 = cpvadd(cpvmult(n, e1.r), cpvlerp(e1.a.p, e1.b.p, cpfclamp01((d_e2_b - d_e1_a)*e1_denom))); + cpVect p2 = cpvadd(cpvmult(n, -e2.r), cpvlerp(e2.a.p, e2.b.p, cpfclamp01((d_e1_a - d_e2_a)*e2_denom))); + cpFloat dist = cpvdot(cpvsub(p2, p1), n); + if(dist <= 0.0f){ + cpHashValue hash_1a2b = CP_HASH_PAIR(e1.a.hash, e2.b.hash); + cpCollisionInfoPushContact(info, p1, p2, hash_1a2b); + } + }{ + cpVect p1 = cpvadd(cpvmult(n, e1.r), cpvlerp(e1.a.p, e1.b.p, cpfclamp01((d_e2_a - d_e1_a)*e1_denom))); + cpVect p2 = cpvadd(cpvmult(n, -e2.r), cpvlerp(e2.a.p, e2.b.p, cpfclamp01((d_e1_b - d_e2_a)*e2_denom))); + cpFloat dist = cpvdot(cpvsub(p2, p1), n); + if(dist <= 0.0f){ + cpHashValue hash_1b2a = CP_HASH_PAIR(e1.b.hash, e2.a.hash); + cpCollisionInfoPushContact(info, p1, p2, hash_1b2a); + } + } + } +} + +//MARK: Collision Functions + +typedef void (*CollisionFunc)(const cpShape *a, const cpShape *b, struct cpCollisionInfo *info); + +// Collide circle shapes. +static void +CircleToCircle(const cpCircleShape *c1, const cpCircleShape *c2, struct cpCollisionInfo *info) +{ + cpFloat mindist = c1->r + c2->r; + cpVect delta = cpvsub(c2->tc, c1->tc); + cpFloat distsq = cpvlengthsq(delta); + + if(distsq < mindist*mindist){ + cpFloat dist = cpfsqrt(distsq); + cpVect n = info->n = (dist ? cpvmult(delta, 1.0f/dist) : cpv(1.0f, 0.0f)); + cpCollisionInfoPushContact(info, cpvadd(c1->tc, cpvmult(n, c1->r)), cpvadd(c2->tc, cpvmult(n, -c2->r)), 0); + } +} + +static void +CircleToSegment(const cpCircleShape *circle, const cpSegmentShape *segment, struct cpCollisionInfo *info) +{ + cpVect seg_a = segment->ta; + cpVect seg_b = segment->tb; + cpVect center = circle->tc; + + cpVect seg_delta = cpvsub(seg_b, seg_a); + cpFloat closest_t = cpfclamp01(cpvdot(seg_delta, cpvsub(center, seg_a))/cpvlengthsq(seg_delta)); + cpVect closest = cpvadd(seg_a, cpvmult(seg_delta, closest_t)); + + cpFloat mindist = circle->r + segment->r; + cpVect delta = cpvsub(closest, center); + cpFloat distsq = cpvlengthsq(delta); + if(distsq < mindist*mindist){ + cpFloat dist = cpfsqrt(distsq); + cpVect n = info->n = (dist ? cpvmult(delta, 1.0f/dist) : cpv(1.0f, 0.0f)); + + // Reject endcap collisions if tangents are provided. + cpVect rot = cpBodyGetRotation(segment->shape.body); + if( + (closest_t != 0.0f || cpvdot(n, cpvrotate(segment->a_tangent, rot)) >= 0.0) && + (closest_t != 1.0f || cpvdot(n, cpvrotate(segment->b_tangent, rot)) >= 0.0) + ){ + cpCollisionInfoPushContact(info, cpvadd(center, cpvmult(n, circle->r)), cpvadd(closest, cpvmult(n, -segment->r)), 0); + } + } +} + +static void +SegmentToSegment(const cpSegmentShape *seg1, const cpSegmentShape *seg2, struct cpCollisionInfo *info) +{ + struct SupportContext context = {(cpShape *)seg1, (cpShape *)seg2, (SupportPointFunc)SegmentSupportPoint, (SupportPointFunc)SegmentSupportPoint}; + struct ClosestPoints points = GJK(&context, &info->id); + +#if DRAW_CLOSEST +#if PRINT_LOG +// ChipmunkDemoPrintString("Distance: %.2f\n", points.d); +#endif + + ChipmunkDebugDrawDot(6.0, points.a, RGBAColor(1, 1, 1, 1)); + ChipmunkDebugDrawDot(6.0, points.b, RGBAColor(1, 1, 1, 1)); + ChipmunkDebugDrawSegment(points.a, points.b, RGBAColor(1, 1, 1, 1)); + ChipmunkDebugDrawSegment(points.a, cpvadd(points.a, cpvmult(points.n, 10.0)), RGBAColor(1, 0, 0, 1)); +#endif + + cpVect n = points.n; + cpVect rot1 = cpBodyGetRotation(seg1->shape.body); + cpVect rot2 = cpBodyGetRotation(seg2->shape.body); + if( + points.d <= (seg1->r + seg2->r) && + ( + (!cpveql(points.a, seg1->ta) || cpvdot(n, cpvrotate(seg1->a_tangent, rot1)) <= 0.0) && + (!cpveql(points.a, seg1->tb) || cpvdot(n, cpvrotate(seg1->b_tangent, rot1)) <= 0.0) && + (!cpveql(points.b, seg2->ta) || cpvdot(n, cpvrotate(seg2->a_tangent, rot2)) >= 0.0) && + (!cpveql(points.b, seg2->tb) || cpvdot(n, cpvrotate(seg2->b_tangent, rot2)) >= 0.0) + ) + ){ + ContactPoints(SupportEdgeForSegment(seg1, n), SupportEdgeForSegment(seg2, cpvneg(n)), points, info); + } +} + +static void +PolyToPoly(const cpPolyShape *poly1, const cpPolyShape *poly2, struct cpCollisionInfo *info) +{ + struct SupportContext context = {(cpShape *)poly1, (cpShape *)poly2, (SupportPointFunc)PolySupportPoint, (SupportPointFunc)PolySupportPoint}; + struct ClosestPoints points = GJK(&context, &info->id); + +#if DRAW_CLOSEST +#if PRINT_LOG +// ChipmunkDemoPrintString("Distance: %.2f\n", points.d); +#endif + + ChipmunkDebugDrawDot(3.0, points.a, RGBAColor(1, 1, 1, 1)); + ChipmunkDebugDrawDot(3.0, points.b, RGBAColor(1, 1, 1, 1)); + ChipmunkDebugDrawSegment(points.a, points.b, RGBAColor(1, 1, 1, 1)); + ChipmunkDebugDrawSegment(points.a, cpvadd(points.a, cpvmult(points.n, 10.0)), RGBAColor(1, 0, 0, 1)); +#endif + + if(points.d - poly1->r - poly2->r <= 0.0){ + ContactPoints(SupportEdgeForPoly(poly1, points.n), SupportEdgeForPoly(poly2, cpvneg(points.n)), points, info); + } +} + +static void +SegmentToPoly(const cpSegmentShape *seg, const cpPolyShape *poly, struct cpCollisionInfo *info) +{ + struct SupportContext context = {(cpShape *)seg, (cpShape *)poly, (SupportPointFunc)SegmentSupportPoint, (SupportPointFunc)PolySupportPoint}; + struct ClosestPoints points = GJK(&context, &info->id); + +#if DRAW_CLOSEST +#if PRINT_LOG +// ChipmunkDemoPrintString("Distance: %.2f\n", points.d); +#endif + + ChipmunkDebugDrawDot(3.0, points.a, RGBAColor(1, 1, 1, 1)); + ChipmunkDebugDrawDot(3.0, points.b, RGBAColor(1, 1, 1, 1)); + ChipmunkDebugDrawSegment(points.a, points.b, RGBAColor(1, 1, 1, 1)); + ChipmunkDebugDrawSegment(points.a, cpvadd(points.a, cpvmult(points.n, 10.0)), RGBAColor(1, 0, 0, 1)); +#endif + + // Reject endcap collisions if tangents are provided. + cpVect n = points.n; + cpVect rot = cpBodyGetRotation(seg->shape.body); + if( + points.d - seg->r - poly->r <= 0.0 && + ( + (!cpveql(points.a, seg->ta) || cpvdot(n, cpvrotate(seg->a_tangent, rot)) <= 0.0) && + (!cpveql(points.a, seg->tb) || cpvdot(n, cpvrotate(seg->b_tangent, rot)) <= 0.0) + ) + ){ + ContactPoints(SupportEdgeForSegment(seg, n), SupportEdgeForPoly(poly, cpvneg(n)), points, info); + } +} + +static void +CircleToPoly(const cpCircleShape *circle, const cpPolyShape *poly, struct cpCollisionInfo *info) +{ + struct SupportContext context = {(cpShape *)circle, (cpShape *)poly, (SupportPointFunc)CircleSupportPoint, (SupportPointFunc)PolySupportPoint}; + struct ClosestPoints points = GJK(&context, &info->id); + +#if DRAW_CLOSEST + ChipmunkDebugDrawDot(3.0, points.a, RGBAColor(1, 1, 1, 1)); + ChipmunkDebugDrawDot(3.0, points.b, RGBAColor(1, 1, 1, 1)); + ChipmunkDebugDrawSegment(points.a, points.b, RGBAColor(1, 1, 1, 1)); + ChipmunkDebugDrawSegment(points.a, cpvadd(points.a, cpvmult(points.n, 10.0)), RGBAColor(1, 0, 0, 1)); +#endif + + cpFloat mindist = circle->r + poly->r; + if(points.d - mindist <= 0.0){ + cpVect n = info->n = points.n; + cpCollisionInfoPushContact(info, cpvadd(points.a, cpvmult(n, circle->r)), cpvadd(points.b, cpvmult(n, poly->r)), 0); + } +} + +static void +CollisionError(const cpShape *circle, const cpShape *poly, struct cpCollisionInfo *info) +{ + cpAssertHard(cpFalse, "Internal Error: Shape types are not sorted."); +} + + +static const CollisionFunc BuiltinCollisionFuncs[9] = { + (CollisionFunc)CircleToCircle, + CollisionError, + CollisionError, + (CollisionFunc)CircleToSegment, + (CollisionFunc)SegmentToSegment, + CollisionError, + (CollisionFunc)CircleToPoly, + (CollisionFunc)SegmentToPoly, + (CollisionFunc)PolyToPoly, +}; +static const CollisionFunc *CollisionFuncs = BuiltinCollisionFuncs; + +struct cpCollisionInfo +cpCollide(const cpShape *a, const cpShape *b, cpCollisionID id, struct cpContact *contacts) +{ + struct cpCollisionInfo info = {a, b, id, cpvzero, 0, contacts}; + + // Make sure the shape types are in order. + if(a->klass->type > b->klass->type){ + info.a = b; + info.b = a; + } + + CollisionFuncs[info.a->klass->type + info.b->klass->type*CP_NUM_SHAPES](info.a, info.b, &info); + +// if(0){ +// for(int i=0; iklass = klass; + + constraint->a = a; + constraint->b = b; + constraint->space = NULL; + + constraint->next_a = NULL; + constraint->next_b = NULL; + + constraint->maxForce = (cpFloat)INFINITY; + constraint->errorBias = cpfpow(1.0f - 0.1f, 60.0f); + constraint->maxBias = (cpFloat)INFINITY; + + constraint->preSolve = NULL; + constraint->postSolve = NULL; +} diff --git a/external/Chipmunk/src/cpDampedRotarySpring.c b/external/Chipmunk/src/cpDampedRotarySpring.c new file mode 100644 index 0000000..72a9dde --- /dev/null +++ b/external/Chipmunk/src/cpDampedRotarySpring.c @@ -0,0 +1,113 @@ +/* Copyright (c) 2007 Scott Lembcke + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +#include "chipmunk/chipmunk_private.h" + +static cpFloat +defaultSpringTorque(cpDampedRotarySpring *spring, cpFloat relativeAngle){ + return (relativeAngle - spring->restAngle)*spring->stiffness; +} + +static void +preStep(cpDampedRotarySpring *spring, cpFloat dt) +{ + cpBody *a = spring->constraint.a; + cpBody *b = spring->constraint.b; + + cpFloat moment = a->i_inv + b->i_inv; + cpAssertSoft(moment != 0.0, "Unsolvable spring."); + spring->iSum = 1.0f/moment; + + spring->w_coef = 1.0f - cpfexp(-spring->damping*dt*moment); + spring->target_wrn = 0.0f; + + // apply spring torque + cpFloat j_spring = spring->springTorqueFunc((cpConstraint *)spring, a->a - b->a)*dt; + spring->jAcc = j_spring; + + a->w -= j_spring*a->i_inv; + b->w += j_spring*b->i_inv; +} + +static void applyCachedImpulse(cpDampedRotarySpring *spring, cpFloat dt_coef){} + +static void +applyImpulse(cpDampedRotarySpring *spring, cpFloat dt) +{ + cpBody *a = spring->constraint.a; + cpBody *b = spring->constraint.b; + + // compute relative velocity + cpFloat wrn = a->w - b->w;//normal_relative_velocity(a, b, r1, r2, n) - spring->target_vrn; + + // compute velocity loss from drag + // not 100% certain this is derived correctly, though it makes sense + cpFloat w_damp = (spring->target_wrn - wrn)*spring->w_coef; + spring->target_wrn = wrn + w_damp; + + //apply_impulses(a, b, spring->r1, spring->r2, cpvmult(spring->n, v_damp*spring->nMass)); + cpFloat j_damp = w_damp*spring->iSum; + spring->jAcc += j_damp; + + a->w += j_damp*a->i_inv; + b->w -= j_damp*b->i_inv; +} + +static cpFloat +getImpulse(cpDampedRotarySpring *spring) +{ + return spring->jAcc; +} + +static const cpConstraintClass klass = { + (cpConstraintPreStepImpl)preStep, + (cpConstraintApplyCachedImpulseImpl)applyCachedImpulse, + (cpConstraintApplyImpulseImpl)applyImpulse, + (cpConstraintGetImpulseImpl)getImpulse, +}; +CP_DefineClassGetter(cpDampedRotarySpring) + +cpDampedRotarySpring * +cpDampedRotarySpringAlloc(void) +{ + return (cpDampedRotarySpring *)cpcalloc(1, sizeof(cpDampedRotarySpring)); +} + +cpDampedRotarySpring * +cpDampedRotarySpringInit(cpDampedRotarySpring *spring, cpBody *a, cpBody *b, cpFloat restAngle, cpFloat stiffness, cpFloat damping) +{ + cpConstraintInit((cpConstraint *)spring, &klass, a, b); + + spring->restAngle = restAngle; + spring->stiffness = stiffness; + spring->damping = damping; + spring->springTorqueFunc = (cpDampedRotarySpringTorqueFunc)defaultSpringTorque; + + spring->jAcc = 0.0f; + + return spring; +} + +cpConstraint * +cpDampedRotarySpringNew(cpBody *a, cpBody *b, cpFloat restAngle, cpFloat stiffness, cpFloat damping) +{ + return (cpConstraint *)cpDampedRotarySpringInit(cpDampedRotarySpringAlloc(), a, b, restAngle, stiffness, damping); +} diff --git a/external/Chipmunk/src/cpDampedSpring.c b/external/Chipmunk/src/cpDampedSpring.c new file mode 100644 index 0000000..c0b1f5e --- /dev/null +++ b/external/Chipmunk/src/cpDampedSpring.c @@ -0,0 +1,121 @@ +/* Copyright (c) 2007 Scott Lembcke + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +#include "chipmunk/chipmunk_private.h" + +static cpFloat +defaultSpringForce(cpDampedSpring *spring, cpFloat dist){ + return (spring->restLength - dist)*spring->stiffness; +} + +static void +preStep(cpDampedSpring *spring, cpFloat dt) +{ + cpBody *a = spring->constraint.a; + cpBody *b = spring->constraint.b; + + spring->r1 = cpTransformVect(a->transform, cpvsub(spring->anchr1, a->cog)); + spring->r2 = cpTransformVect(b->transform, cpvsub(spring->anchr2, b->cog)); + + cpVect delta = cpvsub(cpvadd(b->p, spring->r2), cpvadd(a->p, spring->r1)); + cpFloat dist = cpvlength(delta); + spring->n = cpvmult(delta, 1.0f/(dist ? dist : INFINITY)); + + cpFloat k = k_scalar(a, b, spring->r1, spring->r2, spring->n); + cpAssertSoft(k != 0.0, "Unsolvable spring."); + spring->nMass = 1.0f/k; + + spring->target_vrn = 0.0f; + spring->v_coef = 1.0f - cpfexp(-spring->damping*dt*k); + + // apply spring force + cpFloat f_spring = spring->springForceFunc((cpConstraint *)spring, dist); + cpFloat j_spring = spring->jAcc = f_spring*dt; + apply_impulses(a, b, spring->r1, spring->r2, cpvmult(spring->n, j_spring)); +} + +static void applyCachedImpulse(cpDampedSpring *spring, cpFloat dt_coef){} + +static void +applyImpulse(cpDampedSpring *spring, cpFloat dt) +{ + cpBody *a = spring->constraint.a; + cpBody *b = spring->constraint.b; + + cpVect n = spring->n; + cpVect r1 = spring->r1; + cpVect r2 = spring->r2; + + // compute relative velocity + cpFloat vrn = normal_relative_velocity(a, b, r1, r2, n); + + // compute velocity loss from drag + cpFloat v_damp = (spring->target_vrn - vrn)*spring->v_coef; + spring->target_vrn = vrn + v_damp; + + cpFloat j_damp = v_damp*spring->nMass; + spring->jAcc += j_damp; + apply_impulses(a, b, spring->r1, spring->r2, cpvmult(spring->n, j_damp)); +} + +static cpFloat +getImpulse(cpDampedSpring *spring) +{ + return spring->jAcc; +} + +static const cpConstraintClass klass = { + (cpConstraintPreStepImpl)preStep, + (cpConstraintApplyCachedImpulseImpl)applyCachedImpulse, + (cpConstraintApplyImpulseImpl)applyImpulse, + (cpConstraintGetImpulseImpl)getImpulse, +}; +CP_DefineClassGetter(cpDampedSpring) + +cpDampedSpring * +cpDampedSpringAlloc(void) +{ + return (cpDampedSpring *)cpcalloc(1, sizeof(cpDampedSpring)); +} + +cpDampedSpring * +cpDampedSpringInit(cpDampedSpring *spring, cpBody *a, cpBody *b, cpVect anchr1, cpVect anchr2, cpFloat restLength, cpFloat stiffness, cpFloat damping) +{ + cpConstraintInit((cpConstraint *)spring, cpDampedSpringGetClass(), a, b); + + spring->anchr1 = anchr1; + spring->anchr2 = anchr2; + + spring->restLength = restLength; + spring->stiffness = stiffness; + spring->damping = damping; + spring->springForceFunc = (cpDampedSpringForceFunc)defaultSpringForce; + + spring->jAcc = 0.0f; + + return spring; +} + +cpConstraint * +cpDampedSpringNew(cpBody *a, cpBody *b, cpVect anchr1, cpVect anchr2, cpFloat restLength, cpFloat stiffness, cpFloat damping) +{ + return (cpConstraint *)cpDampedSpringInit(cpDampedSpringAlloc(), a, b, anchr1, anchr2, restLength, stiffness, damping); +} diff --git a/external/Chipmunk/src/cpGearJoint.c b/external/Chipmunk/src/cpGearJoint.c new file mode 100644 index 0000000..7053ad7 --- /dev/null +++ b/external/Chipmunk/src/cpGearJoint.c @@ -0,0 +1,118 @@ +/* Copyright (c) 2007 Scott Lembcke + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +#include "chipmunk/chipmunk_private.h" + +static void +preStep(cpGearJoint *joint, cpFloat dt) +{ + cpBody *a = joint->constraint.a; + cpBody *b = joint->constraint.b; + + // calculate moment of inertia coefficient. + joint->iSum = 1.0f/(a->i_inv*joint->ratio_inv + joint->ratio*b->i_inv); + + // calculate bias velocity + cpFloat maxBias = joint->constraint.maxBias; + joint->bias = cpfclamp(-bias_coef(joint->constraint.errorBias, dt)*(b->a*joint->ratio - a->a - joint->phase)/dt, -maxBias, maxBias); +} + +static void +applyCachedImpulse(cpGearJoint *joint, cpFloat dt_coef) +{ + cpBody *a = joint->constraint.a; + cpBody *b = joint->constraint.b; + + cpFloat j = joint->jAcc*dt_coef; + a->w -= j*a->i_inv*joint->ratio_inv; + b->w += j*b->i_inv; +} + +static void +applyImpulse(cpGearJoint *joint, cpFloat dt) +{ + cpBody *a = joint->constraint.a; + cpBody *b = joint->constraint.b; + + // compute relative rotational velocity + cpFloat wr = b->w*joint->ratio - a->w; + + cpFloat jMax = joint->constraint.maxForce*dt; + + // compute normal impulse + cpFloat j = (joint->bias - wr)*joint->iSum; + cpFloat jOld = joint->jAcc; + joint->jAcc = cpfclamp(jOld + j, -jMax, jMax); + j = joint->jAcc - jOld; + + // apply impulse + a->w -= j*a->i_inv*joint->ratio_inv; + b->w += j*b->i_inv; +} + +static cpFloat +getImpulse(cpGearJoint *joint) +{ + return cpfabs(joint->jAcc); +} + +static const cpConstraintClass klass = { + (cpConstraintPreStepImpl)preStep, + (cpConstraintApplyCachedImpulseImpl)applyCachedImpulse, + (cpConstraintApplyImpulseImpl)applyImpulse, + (cpConstraintGetImpulseImpl)getImpulse, +}; +CP_DefineClassGetter(cpGearJoint) + +cpGearJoint * +cpGearJointAlloc(void) +{ + return (cpGearJoint *)cpcalloc(1, sizeof(cpGearJoint)); +} + +cpGearJoint * +cpGearJointInit(cpGearJoint *joint, cpBody *a, cpBody *b, cpFloat phase, cpFloat ratio) +{ + cpConstraintInit((cpConstraint *)joint, &klass, a, b); + + joint->phase = phase; + joint->ratio = ratio; + joint->ratio_inv = 1.0f/ratio; + + joint->jAcc = 0.0f; + + return joint; +} + +cpConstraint * +cpGearJointNew(cpBody *a, cpBody *b, cpFloat phase, cpFloat ratio) +{ + return (cpConstraint *)cpGearJointInit(cpGearJointAlloc(), a, b, phase, ratio); +} + +void +cpGearJointSetRatio(cpConstraint *constraint, cpFloat value) +{ + cpConstraintCheckCast(constraint, cpGearJoint); + ((cpGearJoint *)constraint)->ratio = value; + ((cpGearJoint *)constraint)->ratio_inv = 1.0f/value; + cpConstraintActivateBodies(constraint); +} diff --git a/external/Chipmunk/src/cpGrooveJoint.c b/external/Chipmunk/src/cpGrooveJoint.c new file mode 100644 index 0000000..c343d8f --- /dev/null +++ b/external/Chipmunk/src/cpGrooveJoint.c @@ -0,0 +1,164 @@ +/* Copyright (c) 2007 Scott Lembcke + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +#include "chipmunk/chipmunk_private.h" + +static void +preStep(cpGrooveJoint *joint, cpFloat dt) +{ + cpBody *a = joint->constraint.a; + cpBody *b = joint->constraint.b; + + // calculate endpoints in worldspace + cpVect ta = cpTransformPoint(a->transform, joint->grv_a); + cpVect tb = cpTransformPoint(a->transform, joint->grv_b); + + // calculate axis + cpVect n = cpTransformVect(a->transform, joint->grv_n); + cpFloat d = cpvdot(ta, n); + + joint->grv_tn = n; + joint->r2 = cpTransformVect(b->transform, cpvsub(joint->anchr2, b->cog)); + + // calculate tangential distance along the axis of r2 + cpFloat td = cpvcross(cpvadd(b->p, joint->r2), n); + // calculate clamping factor and r2 + if(td <= cpvcross(ta, n)){ + joint->clamp = 1.0f; + joint->r1 = cpvsub(ta, a->p); + } else if(td >= cpvcross(tb, n)){ + joint->clamp = -1.0f; + joint->r1 = cpvsub(tb, a->p); + } else { + joint->clamp = 0.0f; + joint->r1 = cpvsub(cpvadd(cpvmult(cpvperp(n), -td), cpvmult(n, d)), a->p); + } + + // Calculate mass tensor + joint->k = k_tensor(a, b, joint->r1, joint->r2); + + // calculate bias velocity + cpVect delta = cpvsub(cpvadd(b->p, joint->r2), cpvadd(a->p, joint->r1)); + joint->bias = cpvclamp(cpvmult(delta, -bias_coef(joint->constraint.errorBias, dt)/dt), joint->constraint.maxBias); +} + +static void +applyCachedImpulse(cpGrooveJoint *joint, cpFloat dt_coef) +{ + cpBody *a = joint->constraint.a; + cpBody *b = joint->constraint.b; + + apply_impulses(a, b, joint->r1, joint->r2, cpvmult(joint->jAcc, dt_coef)); +} + +static inline cpVect +grooveConstrain(cpGrooveJoint *joint, cpVect j, cpFloat dt){ + cpVect n = joint->grv_tn; + cpVect jClamp = (joint->clamp*cpvcross(j, n) > 0.0f) ? j : cpvproject(j, n); + return cpvclamp(jClamp, joint->constraint.maxForce*dt); +} + +static void +applyImpulse(cpGrooveJoint *joint, cpFloat dt) +{ + cpBody *a = joint->constraint.a; + cpBody *b = joint->constraint.b; + + cpVect r1 = joint->r1; + cpVect r2 = joint->r2; + + // compute impulse + cpVect vr = relative_velocity(a, b, r1, r2); + + cpVect j = cpMat2x2Transform(joint->k, cpvsub(joint->bias, vr)); + cpVect jOld = joint->jAcc; + joint->jAcc = grooveConstrain(joint, cpvadd(jOld, j), dt); + j = cpvsub(joint->jAcc, jOld); + + // apply impulse + apply_impulses(a, b, joint->r1, joint->r2, j); +} + +static cpFloat +getImpulse(cpGrooveJoint *joint) +{ + return cpvlength(joint->jAcc); +} + +static const cpConstraintClass klass = { + (cpConstraintPreStepImpl)preStep, + (cpConstraintApplyCachedImpulseImpl)applyCachedImpulse, + (cpConstraintApplyImpulseImpl)applyImpulse, + (cpConstraintGetImpulseImpl)getImpulse, +}; +CP_DefineClassGetter(cpGrooveJoint) + +cpGrooveJoint * +cpGrooveJointAlloc(void) +{ + return (cpGrooveJoint *)cpcalloc(1, sizeof(cpGrooveJoint)); +} + +cpGrooveJoint * +cpGrooveJointInit(cpGrooveJoint *joint, cpBody *a, cpBody *b, cpVect groove_a, cpVect groove_b, cpVect anchr2) +{ + cpConstraintInit((cpConstraint *)joint, &klass, a, b); + + joint->grv_a = groove_a; + joint->grv_b = groove_b; + joint->grv_n = cpvperp(cpvnormalize(cpvsub(groove_b, groove_a))); + joint->anchr2 = anchr2; + + joint->jAcc = cpvzero; + + return joint; +} + +cpConstraint * +cpGrooveJointNew(cpBody *a, cpBody *b, cpVect groove_a, cpVect groove_b, cpVect anchr2) +{ + return (cpConstraint *)cpGrooveJointInit(cpGrooveJointAlloc(), a, b, groove_a, groove_b, anchr2); +} + +void +cpGrooveJointSetGrooveA(cpConstraint *constraint, cpVect value) +{ + cpGrooveJoint *g = (cpGrooveJoint *)constraint; + cpConstraintCheckCast(constraint, cpGrooveJoint); + + g->grv_a = value; + g->grv_n = cpvperp(cpvnormalize(cpvsub(g->grv_b, value))); + + cpConstraintActivateBodies(constraint); +} + +void +cpGrooveJointSetGrooveB(cpConstraint *constraint, cpVect value) +{ + cpGrooveJoint *g = (cpGrooveJoint *)constraint; + cpConstraintCheckCast(constraint, cpGrooveJoint); + + g->grv_b = value; + g->grv_n = cpvperp(cpvnormalize(cpvsub(value, g->grv_a))); + + cpConstraintActivateBodies(constraint); +} + diff --git a/external/Chipmunk/src/cpHashSet.c b/external/Chipmunk/src/cpHashSet.c new file mode 100644 index 0000000..4f36e66 --- /dev/null +++ b/external/Chipmunk/src/cpHashSet.c @@ -0,0 +1,253 @@ +/* Copyright (c) 2007 Scott Lembcke + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +#include "chipmunk/chipmunk_private.h" +#include "prime.h" + +typedef struct cpHashSetBin { + void *elt; + cpHashValue hash; + struct cpHashSetBin *next; +} cpHashSetBin; + +struct cpHashSet { + unsigned int entries, size; + + cpHashSetEqlFunc eql; + void *default_value; + + cpHashSetBin **table; + cpHashSetBin *pooledBins; + + cpArray *allocatedBuffers; +}; + +void +cpHashSetFree(cpHashSet *set) +{ + if(set){ + cpfree(set->table); + + cpArrayFreeEach(set->allocatedBuffers, cpfree); + cpArrayFree(set->allocatedBuffers); + + cpfree(set); + } +} + +cpHashSet * +cpHashSetNew(int size, cpHashSetEqlFunc eqlFunc) +{ + cpHashSet *set = (cpHashSet *)cpcalloc(1, sizeof(cpHashSet)); + + set->size = next_prime(size); + set->entries = 0; + + set->eql = eqlFunc; + set->default_value = NULL; + + set->table = (cpHashSetBin **)cpcalloc(set->size, sizeof(cpHashSetBin *)); + set->pooledBins = NULL; + + set->allocatedBuffers = cpArrayNew(0); + + return set; +} + +void +cpHashSetSetDefaultValue(cpHashSet *set, void *default_value) +{ + set->default_value = default_value; +} + +static int +setIsFull(cpHashSet *set) +{ + return (set->entries >= set->size); +} + +static void +cpHashSetResize(cpHashSet *set) +{ + // Get the next approximate doubled prime. + unsigned int newSize = next_prime(set->size + 1); + // Allocate a new table. + cpHashSetBin **newTable = (cpHashSetBin **)cpcalloc(newSize, sizeof(cpHashSetBin *)); + + // Iterate over the chains. + for(unsigned int i=0; isize; i++){ + // Rehash the bins into the new table. + cpHashSetBin *bin = set->table[i]; + while(bin){ + cpHashSetBin *next = bin->next; + + cpHashValue idx = bin->hash%newSize; + bin->next = newTable[idx]; + newTable[idx] = bin; + + bin = next; + } + } + + cpfree(set->table); + + set->table = newTable; + set->size = newSize; +} + +static inline void +recycleBin(cpHashSet *set, cpHashSetBin *bin) +{ + bin->next = set->pooledBins; + set->pooledBins = bin; + bin->elt = NULL; +} + +static cpHashSetBin * +getUnusedBin(cpHashSet *set) +{ + cpHashSetBin *bin = set->pooledBins; + + if(bin){ + set->pooledBins = bin->next; + return bin; + } else { + // Pool is exhausted, make more + int count = CP_BUFFER_BYTES/sizeof(cpHashSetBin); + cpAssertHard(count, "Internal Error: Buffer size is too small."); + + cpHashSetBin *buffer = (cpHashSetBin *)cpcalloc(1, CP_BUFFER_BYTES); + cpArrayPush(set->allocatedBuffers, buffer); + + // push all but the first one, return it instead + for(int i=1; ientries; +} + +void * +cpHashSetInsert(cpHashSet *set, cpHashValue hash, void *ptr, cpHashSetTransFunc trans, void *data) +{ + cpHashValue idx = hash%set->size; + + // Find the bin with the matching element. + cpHashSetBin *bin = set->table[idx]; + while(bin && !set->eql(ptr, bin->elt)) + bin = bin->next; + + // Create it if necessary. + if(!bin){ + bin = getUnusedBin(set); + bin->hash = hash; + bin->elt = (trans ? trans(ptr, data) : data); + + bin->next = set->table[idx]; + set->table[idx] = bin; + + set->entries++; + if(setIsFull(set)) cpHashSetResize(set); + } + + return bin->elt; +} + +void * +cpHashSetRemove(cpHashSet *set, cpHashValue hash, void *ptr) +{ + cpHashValue idx = hash%set->size; + + cpHashSetBin **prev_ptr = &set->table[idx]; + cpHashSetBin *bin = set->table[idx]; + + // Find the bin + while(bin && !set->eql(ptr, bin->elt)){ + prev_ptr = &bin->next; + bin = bin->next; + } + + // Remove it if it exists. + if(bin){ + // Update the previous linked list pointer + (*prev_ptr) = bin->next; + set->entries--; + + void *elt = bin->elt; + recycleBin(set, bin); + + return elt; + } + + return NULL; +} + +void * +cpHashSetFind(cpHashSet *set, cpHashValue hash, void *ptr) +{ + cpHashValue idx = hash%set->size; + cpHashSetBin *bin = set->table[idx]; + while(bin && !set->eql(ptr, bin->elt)) + bin = bin->next; + + return (bin ? bin->elt : set->default_value); +} + +void +cpHashSetEach(cpHashSet *set, cpHashSetIteratorFunc func, void *data) +{ + for(unsigned int i=0; isize; i++){ + cpHashSetBin *bin = set->table[i]; + while(bin){ + cpHashSetBin *next = bin->next; + func(bin->elt, data); + bin = next; + } + } +} + +void +cpHashSetFilter(cpHashSet *set, cpHashSetFilterFunc func, void *data) +{ + for(unsigned int i=0; isize; i++){ + // The rest works similarly to cpHashSetRemove() above. + cpHashSetBin **prev_ptr = &set->table[i]; + cpHashSetBin *bin = set->table[i]; + while(bin){ + cpHashSetBin *next = bin->next; + + if(func(bin->elt, data)){ + prev_ptr = &bin->next; + } else { + (*prev_ptr) = next; + + set->entries--; + recycleBin(set, bin); + } + + bin = next; + } + } +} diff --git a/external/Chipmunk/src/cpPinJoint.c b/external/Chipmunk/src/cpPinJoint.c new file mode 100644 index 0000000..aa3f666 --- /dev/null +++ b/external/Chipmunk/src/cpPinJoint.c @@ -0,0 +1,122 @@ +/* Copyright (c) 2007 Scott Lembcke + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +#include "chipmunk/chipmunk_private.h" + +static void +preStep(cpPinJoint *joint, cpFloat dt) +{ + cpBody *a = joint->constraint.a; + cpBody *b = joint->constraint.b; + + joint->r1 = cpTransformVect(a->transform, cpvsub(joint->anchr1, a->cog)); + joint->r2 = cpTransformVect(b->transform, cpvsub(joint->anchr2, b->cog)); + + cpVect delta = cpvsub(cpvadd(b->p, joint->r2), cpvadd(a->p, joint->r1)); + cpFloat dist = cpvlength(delta); + joint->n = cpvmult(delta, 1.0f/(dist ? dist : (cpFloat)INFINITY)); + + // calculate mass normal + joint->nMass = 1.0f/k_scalar(a, b, joint->r1, joint->r2, joint->n); + + // calculate bias velocity + cpFloat maxBias = joint->constraint.maxBias; + joint->bias = cpfclamp(-bias_coef(joint->constraint.errorBias, dt)*(dist - joint->dist)/dt, -maxBias, maxBias); +} + +static void +applyCachedImpulse(cpPinJoint *joint, cpFloat dt_coef) +{ + cpBody *a = joint->constraint.a; + cpBody *b = joint->constraint.b; + + cpVect j = cpvmult(joint->n, joint->jnAcc*dt_coef); + apply_impulses(a, b, joint->r1, joint->r2, j); +} + +static void +applyImpulse(cpPinJoint *joint, cpFloat dt) +{ + cpBody *a = joint->constraint.a; + cpBody *b = joint->constraint.b; + cpVect n = joint->n; + + // compute relative velocity + cpFloat vrn = normal_relative_velocity(a, b, joint->r1, joint->r2, n); + + cpFloat jnMax = joint->constraint.maxForce*dt; + + // compute normal impulse + cpFloat jn = (joint->bias - vrn)*joint->nMass; + cpFloat jnOld = joint->jnAcc; + joint->jnAcc = cpfclamp(jnOld + jn, -jnMax, jnMax); + jn = joint->jnAcc - jnOld; + + // apply impulse + apply_impulses(a, b, joint->r1, joint->r2, cpvmult(n, jn)); +} + +static cpFloat +getImpulse(cpPinJoint *joint) +{ + return cpfabs(joint->jnAcc); +} + +static const cpConstraintClass klass = { + (cpConstraintPreStepImpl)preStep, + (cpConstraintApplyCachedImpulseImpl)applyCachedImpulse, + (cpConstraintApplyImpulseImpl)applyImpulse, + (cpConstraintGetImpulseImpl)getImpulse, +}; +CP_DefineClassGetter(cpPinJoint) + + +cpPinJoint * +cpPinJointAlloc(void) +{ + return (cpPinJoint *)cpcalloc(1, sizeof(cpPinJoint)); +} + +cpPinJoint * +cpPinJointInit(cpPinJoint *joint, cpBody *a, cpBody *b, cpVect anchr1, cpVect anchr2) +{ + cpConstraintInit((cpConstraint *)joint, &klass, a, b); + + joint->anchr1 = anchr1; + joint->anchr2 = anchr2; + + // STATIC_BODY_CHECK + cpVect p1 = (a ? cpTransformPoint(a->transform, anchr1) : anchr1); + cpVect p2 = (b ? cpTransformPoint(b->transform, anchr2) : anchr2); + joint->dist = cpvlength(cpvsub(p2, p1)); + + cpAssertWarn(joint->dist > 0.0, "You created a 0 length pin joint. A pivot joint will be much more stable."); + + joint->jnAcc = 0.0f; + + return joint; +} + +cpConstraint * +cpPinJointNew(cpBody *a, cpBody *b, cpVect anchr1, cpVect anchr2) +{ + return (cpConstraint *)cpPinJointInit(cpPinJointAlloc(), a, b, anchr1, anchr2); +} diff --git a/external/Chipmunk/src/cpPivotJoint.c b/external/Chipmunk/src/cpPivotJoint.c new file mode 100644 index 0000000..5763357 --- /dev/null +++ b/external/Chipmunk/src/cpPivotJoint.c @@ -0,0 +1,117 @@ +/* Copyright (c) 2007 Scott Lembcke + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +#include "chipmunk/chipmunk_private.h" + +static void +preStep(cpPivotJoint *joint, cpFloat dt) +{ + cpBody *a = joint->constraint.a; + cpBody *b = joint->constraint.b; + + joint->r1 = cpTransformVect(a->transform, cpvsub(joint->anchr1, a->cog)); + joint->r2 = cpTransformVect(b->transform, cpvsub(joint->anchr2, b->cog)); + + // Calculate mass tensor + joint-> k = k_tensor(a, b, joint->r1, joint->r2); + + // calculate bias velocity + cpVect delta = cpvsub(cpvadd(b->p, joint->r2), cpvadd(a->p, joint->r1)); + joint->bias = cpvclamp(cpvmult(delta, -bias_coef(joint->constraint.errorBias, dt)/dt), joint->constraint.maxBias); +} + +static void +applyCachedImpulse(cpPivotJoint *joint, cpFloat dt_coef) +{ + cpBody *a = joint->constraint.a; + cpBody *b = joint->constraint.b; + + apply_impulses(a, b, joint->r1, joint->r2, cpvmult(joint->jAcc, dt_coef)); +} + +static void +applyImpulse(cpPivotJoint *joint, cpFloat dt) +{ + cpBody *a = joint->constraint.a; + cpBody *b = joint->constraint.b; + + cpVect r1 = joint->r1; + cpVect r2 = joint->r2; + + // compute relative velocity + cpVect vr = relative_velocity(a, b, r1, r2); + + // compute normal impulse + cpVect j = cpMat2x2Transform(joint->k, cpvsub(joint->bias, vr)); + cpVect jOld = joint->jAcc; + joint->jAcc = cpvclamp(cpvadd(joint->jAcc, j), joint->constraint.maxForce*dt); + j = cpvsub(joint->jAcc, jOld); + + // apply impulse + apply_impulses(a, b, joint->r1, joint->r2, j); +} + +static cpFloat +getImpulse(cpConstraint *joint) +{ + return cpvlength(((cpPivotJoint *)joint)->jAcc); +} + +static const cpConstraintClass klass = { + (cpConstraintPreStepImpl)preStep, + (cpConstraintApplyCachedImpulseImpl)applyCachedImpulse, + (cpConstraintApplyImpulseImpl)applyImpulse, + (cpConstraintGetImpulseImpl)getImpulse, +}; +CP_DefineClassGetter(cpPivotJoint) + +cpPivotJoint * +cpPivotJointAlloc(void) +{ + return (cpPivotJoint *)cpcalloc(1, sizeof(cpPivotJoint)); +} + +cpPivotJoint * +cpPivotJointInit(cpPivotJoint *joint, cpBody *a, cpBody *b, cpVect anchr1, cpVect anchr2) +{ + cpConstraintInit((cpConstraint *)joint, &klass, a, b); + + joint->anchr1 = anchr1; + joint->anchr2 = anchr2; + + joint->jAcc = cpvzero; + + return joint; +} + +cpConstraint * +cpPivotJointNew2(cpBody *a, cpBody *b, cpVect anchr1, cpVect anchr2) +{ + return (cpConstraint *)cpPivotJointInit(cpPivotJointAlloc(), a, b, anchr1, anchr2); +} + +cpConstraint * +cpPivotJointNew(cpBody *a, cpBody *b, cpVect pivot) +{ + cpVect anchr1 = (a ? cpBodyWorldToLocal(a, pivot) : pivot); + cpVect anchr2 = (b ? cpBodyWorldToLocal(b, pivot) : pivot); + return cpPivotJointNew2(a, b, anchr1, anchr2); +} diff --git a/external/Chipmunk/src/cpPolyShape.c b/external/Chipmunk/src/cpPolyShape.c new file mode 100644 index 0000000..912c420 --- /dev/null +++ b/external/Chipmunk/src/cpPolyShape.c @@ -0,0 +1,335 @@ +/* Copyright (c) 2007 Scott Lembcke + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +#include "chipmunk/chipmunk_private.h" +#include "chipmunk_unsafe.h" + +cpPolyShape * +cpPolyShapeAlloc(void) +{ + return (cpPolyShape *)cpcalloc(1, sizeof(cpPolyShape)); +} + +static void +cpPolyShapeDestroy(cpPolyShape *poly) +{ + if(poly->count > CP_POLY_SHAPE_INLINE_ALLOC){ + cpfree(poly->planes); + } +} + +static cpBB +cpPolyShapeCacheData(cpPolyShape *poly, cpTransform transform) +{ + int count = poly->count; + cpSplittingPlane *dst = poly->planes; + cpSplittingPlane *src = dst + count; + + cpFloat l = (cpFloat)INFINITY, r = -(cpFloat)INFINITY; + cpFloat b = (cpFloat)INFINITY, t = -(cpFloat)INFINITY; + + for(int i=0; ir; + return (poly->shape.bb = cpBBNew(l - radius, b - radius, r + radius, t + radius)); +} + +static void +cpPolyShapePointQuery(cpPolyShape *poly, cpVect p, cpPointQueryInfo *info){ + int count = poly->count; + cpSplittingPlane *planes = poly->planes; + cpFloat r = poly->r; + + cpVect v0 = planes[count - 1].v0; + cpFloat minDist = INFINITY; + cpVect closestPoint = cpvzero; + cpVect closestNormal = cpvzero; + cpBool outside = cpFalse; + + for(int i=0; i 0.0f) outside = cpTrue; + + cpVect closest = cpClosetPointOnSegment(p, v0, v1); + + cpFloat dist = cpvdist(p, closest); + if(dist < minDist){ + minDist = dist; + closestPoint = closest; + closestNormal = planes[i].n; + } + + v0 = v1; + } + + cpFloat dist = (outside ? minDist : -minDist); + cpVect g = cpvmult(cpvsub(p, closestPoint), 1.0f/dist); + + info->shape = (cpShape *)poly; + info->point = cpvadd(closestPoint, cpvmult(g, r)); + info->distance = dist - r; + + // Use the normal of the closest segment if the distance is small. + info->gradient = (minDist > MAGIC_EPSILON ? g : closestNormal); +} + +static void +cpPolyShapeSegmentQuery(cpPolyShape *poly, cpVect a, cpVect b, cpFloat r2, cpSegmentQueryInfo *info) +{ + cpSplittingPlane *planes = poly->planes; + int count = poly->count; + cpFloat r = poly->r; + cpFloat rsum = r + r2; + + for(int i=0; ishape = (cpShape *)poly; + info->point = cpvsub(cpvlerp(a, b, t), cpvmult(n, r2)); + info->normal = n; + info->alpha = t; + } + } + + // Also check against the beveled vertexes. + if(rsum > 0.0f){ + for(int i=0; ishape, planes[i].v0, r, a, b, r2, &circle_info); + if(circle_info.alpha < info->alpha) (*info) = circle_info; + } + } +} + +cpBool +cpPolyValidate(const cpVect *verts, const int count) +{ + for(int i=0; icount = count; + if(count <= CP_POLY_SHAPE_INLINE_ALLOC){ + poly->planes = poly->_planes; + } else { + poly->planes = (cpSplittingPlane *)cpcalloc(2*count, sizeof(cpSplittingPlane)); + } + + for(int i=0; iplanes[i + count].v0 = b; + poly->planes[i + count].n = n; + } +} + +static struct cpShapeMassInfo +cpPolyShapeMassInfo(cpFloat mass, int count, const cpVect *verts, cpFloat radius) +{ + // TODO moment is approximate due to radius. + + cpVect centroid = cpCentroidForPoly(count, verts); + struct cpShapeMassInfo info = { + mass, cpMomentForPoly(1.0f, count, verts, cpvneg(centroid), radius), + centroid, + cpAreaForPoly(count, verts, radius), + }; + + return info; +} + +static const cpShapeClass polyClass = { + CP_POLY_SHAPE, + (cpShapeCacheDataImpl)cpPolyShapeCacheData, + (cpShapeDestroyImpl)cpPolyShapeDestroy, + (cpShapePointQueryImpl)cpPolyShapePointQuery, + (cpShapeSegmentQueryImpl)cpPolyShapeSegmentQuery, +}; + +cpPolyShape * +cpPolyShapeInit(cpPolyShape *poly, cpBody *body, int count, const cpVect *verts, cpTransform transform, cpFloat radius) +{ + cpVect *hullVerts = (cpVect *)alloca(count*sizeof(cpVect)); + + // Transform the verts before building the hull in case of a negative scale. + for(int i=0; ir = radius; + + return poly; +} + + + +cpShape * +cpPolyShapeNew(cpBody *body, int count, const cpVect *verts, cpTransform transform, cpFloat radius) +{ + return (cpShape *)cpPolyShapeInit(cpPolyShapeAlloc(), body, count, verts, transform, radius); +} + +cpPolyShape * +cpBoxShapeInit(cpPolyShape *poly, cpBody *body, cpFloat width, cpFloat height, cpFloat radius) +{ + cpFloat hw = width/2.0f; + cpFloat hh = height/2.0f; + + return cpBoxShapeInit2(poly, body, cpBBNew(-hw, -hh, hw, hh), radius); +} + +cpPolyShape * +cpBoxShapeInit2(cpPolyShape *poly, cpBody *body, cpBB box, cpFloat radius) +{ + cpVect verts[] = { + cpv(box.r, box.b), + cpv(box.r, box.t), + cpv(box.l, box.t), + cpv(box.l, box.b), + }; + + return cpPolyShapeInitRaw(poly, body, 4, verts, radius); +} + +cpShape * +cpBoxShapeNew(cpBody *body, cpFloat width, cpFloat height, cpFloat radius) +{ + return (cpShape *)cpBoxShapeInit(cpPolyShapeAlloc(), body, width, height, radius); +} + +cpShape * +cpBoxShapeNew2(cpBody *body, cpBB box, cpFloat radius) +{ + return (cpShape *)cpBoxShapeInit2(cpPolyShapeAlloc(), body, box, radius); +} + +int +cpPolyShapeGetCount(const cpShape *shape) +{ + cpAssertHard(shape->klass == &polyClass, "Shape is not a poly shape."); + return ((cpPolyShape *)shape)->count; +} + +cpVect +cpPolyShapeGetVert(const cpShape *shape, int i) +{ + cpAssertHard(shape->klass == &polyClass, "Shape is not a poly shape."); + + int count = cpPolyShapeGetCount(shape); + cpAssertHard(0 <= i && i < count, "Index out of range."); + + return ((cpPolyShape *)shape)->planes[i + count].v0; +} + +cpFloat +cpPolyShapeGetRadius(const cpShape *shape) +{ + cpAssertHard(shape->klass == &polyClass, "Shape is not a poly shape."); + return ((cpPolyShape *)shape)->r; +} + +// Unsafe API (chipmunk_unsafe.h) + +void +cpPolyShapeSetVerts(cpShape *shape, int count, cpVect *verts, cpTransform transform) +{ + cpVect *hullVerts = (cpVect *)alloca(count*sizeof(cpVect)); + + // Transform the verts before building the hull in case of a negative scale. + for(int i=0; iklass == &polyClass, "Shape is not a poly shape."); + cpPolyShape *poly = (cpPolyShape *)shape; + cpPolyShapeDestroy(poly); + + SetVerts(poly, count, verts); + + cpFloat mass = shape->massInfo.m; +// shape->massInfo = cpPolyShapeMassInfo(shape->massInfo.m, poly->count, poly->verts, poly->r); +// if(mass > 0.0f) cpBodyAccumulateMassFromShapes(shape->body); + cpAssertHard(mass == 0.0, "Not Yet Implemented."); // TODO +} + +void +cpPolyShapeSetRadius(cpShape *shape, cpFloat radius) +{ + cpAssertHard(shape->klass == &polyClass, "Shape is not a poly shape."); + cpPolyShape *poly = (cpPolyShape *)shape; + poly->r = radius; + + cpFloat mass = shape->massInfo.m; +// shape->massInfo = cpPolyShapeMassInfo(shape->massInfo.m, poly->count, poly->verts, poly->r); +// if(mass > 0.0f) cpBodyAccumulateMassFromShapes(shape->body); + cpAssertHard(mass == 0.0, "Not Yet Implemented."); // TODO +} diff --git a/external/Chipmunk/src/cpRatchetJoint.c b/external/Chipmunk/src/cpRatchetJoint.c new file mode 100644 index 0000000..02420cf --- /dev/null +++ b/external/Chipmunk/src/cpRatchetJoint.c @@ -0,0 +1,130 @@ +/* Copyright (c) 2007 Scott Lembcke + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +#include "chipmunk/chipmunk_private.h" + +static void +preStep(cpRatchetJoint *joint, cpFloat dt) +{ + cpBody *a = joint->constraint.a; + cpBody *b = joint->constraint.b; + + cpFloat angle = joint->angle; + cpFloat phase = joint->phase; + cpFloat ratchet = joint->ratchet; + + cpFloat delta = b->a - a->a; + cpFloat diff = angle - delta; + cpFloat pdist = 0.0f; + + if(diff*ratchet > 0.0f){ + pdist = diff; + } else { + joint->angle = cpffloor((delta - phase)/ratchet)*ratchet + phase; + } + + // calculate moment of inertia coefficient. + joint->iSum = 1.0f/(a->i_inv + b->i_inv); + + // calculate bias velocity + cpFloat maxBias = joint->constraint.maxBias; + joint->bias = cpfclamp(-bias_coef(joint->constraint.errorBias, dt)*pdist/dt, -maxBias, maxBias); + + // If the bias is 0, the joint is not at a limit. Reset the impulse. + if(!joint->bias) joint->jAcc = 0.0f; +} + +static void +applyCachedImpulse(cpRatchetJoint *joint, cpFloat dt_coef) +{ + cpBody *a = joint->constraint.a; + cpBody *b = joint->constraint.b; + + cpFloat j = joint->jAcc*dt_coef; + a->w -= j*a->i_inv; + b->w += j*b->i_inv; +} + +static void +applyImpulse(cpRatchetJoint *joint, cpFloat dt) +{ + if(!joint->bias) return; // early exit + + cpBody *a = joint->constraint.a; + cpBody *b = joint->constraint.b; + + // compute relative rotational velocity + cpFloat wr = b->w - a->w; + cpFloat ratchet = joint->ratchet; + + cpFloat jMax = joint->constraint.maxForce*dt; + + // compute normal impulse + cpFloat j = -(joint->bias + wr)*joint->iSum; + cpFloat jOld = joint->jAcc; + joint->jAcc = cpfclamp((jOld + j)*ratchet, 0.0f, jMax*cpfabs(ratchet))/ratchet; + j = joint->jAcc - jOld; + + // apply impulse + a->w -= j*a->i_inv; + b->w += j*b->i_inv; +} + +static cpFloat +getImpulse(cpRatchetJoint *joint) +{ + return cpfabs(joint->jAcc); +} + +static const cpConstraintClass klass = { + (cpConstraintPreStepImpl)preStep, + (cpConstraintApplyCachedImpulseImpl)applyCachedImpulse, + (cpConstraintApplyImpulseImpl)applyImpulse, + (cpConstraintGetImpulseImpl)getImpulse, +}; +CP_DefineClassGetter(cpRatchetJoint) + +cpRatchetJoint * +cpRatchetJointAlloc(void) +{ + return (cpRatchetJoint *)cpcalloc(1, sizeof(cpRatchetJoint)); +} + +cpRatchetJoint * +cpRatchetJointInit(cpRatchetJoint *joint, cpBody *a, cpBody *b, cpFloat phase, cpFloat ratchet) +{ + cpConstraintInit((cpConstraint *)joint, &klass, a, b); + + joint->angle = 0.0f; + joint->phase = phase; + joint->ratchet = ratchet; + + // STATIC_BODY_CHECK + joint->angle = (b ? b->a : 0.0f) - (a ? a->a : 0.0f); + + return joint; +} + +cpConstraint * +cpRatchetJointNew(cpBody *a, cpBody *b, cpFloat phase, cpFloat ratchet) +{ + return (cpConstraint *)cpRatchetJointInit(cpRatchetJointAlloc(), a, b, phase, ratchet); +} diff --git a/external/Chipmunk/src/cpRotaryLimitJoint.c b/external/Chipmunk/src/cpRotaryLimitJoint.c new file mode 100644 index 0000000..2ce7df6 --- /dev/null +++ b/external/Chipmunk/src/cpRotaryLimitJoint.c @@ -0,0 +1,125 @@ +/* Copyright (c) 2007 Scott Lembcke + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +#include "chipmunk/chipmunk_private.h" + +static void +preStep(cpRotaryLimitJoint *joint, cpFloat dt) +{ + cpBody *a = joint->constraint.a; + cpBody *b = joint->constraint.b; + + cpFloat dist = b->a - a->a; + cpFloat pdist = 0.0f; + if(dist > joint->max) { + pdist = joint->max - dist; + } else if(dist < joint->min) { + pdist = joint->min - dist; + } + + // calculate moment of inertia coefficient. + joint->iSum = 1.0f/(a->i_inv + b->i_inv); + + // calculate bias velocity + cpFloat maxBias = joint->constraint.maxBias; + joint->bias = cpfclamp(-bias_coef(joint->constraint.errorBias, dt)*pdist/dt, -maxBias, maxBias); + + // If the bias is 0, the joint is not at a limit. Reset the impulse. + if(!joint->bias) joint->jAcc = 0.0f; +} + +static void +applyCachedImpulse(cpRotaryLimitJoint *joint, cpFloat dt_coef) +{ + cpBody *a = joint->constraint.a; + cpBody *b = joint->constraint.b; + + cpFloat j = joint->jAcc*dt_coef; + a->w -= j*a->i_inv; + b->w += j*b->i_inv; +} + +static void +applyImpulse(cpRotaryLimitJoint *joint, cpFloat dt) +{ + if(!joint->bias) return; // early exit + + cpBody *a = joint->constraint.a; + cpBody *b = joint->constraint.b; + + // compute relative rotational velocity + cpFloat wr = b->w - a->w; + + cpFloat jMax = joint->constraint.maxForce*dt; + + // compute normal impulse + cpFloat j = -(joint->bias + wr)*joint->iSum; + cpFloat jOld = joint->jAcc; + if(joint->bias < 0.0f){ + joint->jAcc = cpfclamp(jOld + j, 0.0f, jMax); + } else { + joint->jAcc = cpfclamp(jOld + j, -jMax, 0.0f); + } + j = joint->jAcc - jOld; + + // apply impulse + a->w -= j*a->i_inv; + b->w += j*b->i_inv; +} + +static cpFloat +getImpulse(cpRotaryLimitJoint *joint) +{ + return cpfabs(joint->jAcc); +} + +static const cpConstraintClass klass = { + (cpConstraintPreStepImpl)preStep, + (cpConstraintApplyCachedImpulseImpl)applyCachedImpulse, + (cpConstraintApplyImpulseImpl)applyImpulse, + (cpConstraintGetImpulseImpl)getImpulse, +}; +CP_DefineClassGetter(cpRotaryLimitJoint) + +cpRotaryLimitJoint * +cpRotaryLimitJointAlloc(void) +{ + return (cpRotaryLimitJoint *)cpcalloc(1, sizeof(cpRotaryLimitJoint)); +} + +cpRotaryLimitJoint * +cpRotaryLimitJointInit(cpRotaryLimitJoint *joint, cpBody *a, cpBody *b, cpFloat min, cpFloat max) +{ + cpConstraintInit((cpConstraint *)joint, &klass, a, b); + + joint->min = min; + joint->max = max; + + joint->jAcc = 0.0f; + + return joint; +} + +cpConstraint * +cpRotaryLimitJointNew(cpBody *a, cpBody *b, cpFloat min, cpFloat max) +{ + return (cpConstraint *)cpRotaryLimitJointInit(cpRotaryLimitJointAlloc(), a, b, min, max); +} diff --git a/external/Chipmunk/src/cpShape.c b/external/Chipmunk/src/cpShape.c new file mode 100644 index 0000000..b8a0e10 --- /dev/null +++ b/external/Chipmunk/src/cpShape.c @@ -0,0 +1,460 @@ +/* Copyright (c) 2007 Scott Lembcke + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +#include "chipmunk/chipmunk_private.h" +#include "chipmunk_unsafe.h" + +#define CP_DefineShapeGetter(struct, type, member, name) \ +CP_DeclareShapeGetter(struct, type, name){ \ + cpAssertHard(shape->klass == &struct##Class, "shape is not a "#struct); \ + return ((struct *)shape)->member; \ +} + +cpShape * +cpShapeInit(cpShape *shape, const cpShapeClass *klass, cpBody *body, struct cpShapeMassInfo massInfo) +{ + shape->klass = klass; + + shape->body = body; + shape->massInfo = massInfo; + + shape->sensor = 0; + + shape->e = 0.0f; + shape->u = 0.0f; + shape->surfaceV = cpvzero; + + shape->type = 0; + shape->filter.group = CP_NO_GROUP; + shape->filter.categories = CP_ALL_CATEGORIES; + shape->filter.mask = CP_ALL_CATEGORIES; + + shape->userData = NULL; + + shape->space = NULL; + + shape->next = NULL; + shape->prev = NULL; + + return shape; +} + +void +cpShapeDestroy(cpShape *shape) +{ + if(shape->klass && shape->klass->destroy) shape->klass->destroy(shape); +} + +void +cpShapeFree(cpShape *shape) +{ + if(shape){ + cpShapeDestroy(shape); + cpfree(shape); + } +} + +void +cpShapeSetBody(cpShape *shape, cpBody *body) +{ + cpAssertHard(!cpShapeActive(shape), "You cannot change the body on an active shape. You must remove the shape from the space before changing the body."); + shape->body = body; +} + +cpFloat cpShapeGetMass(cpShape *shape){ return shape->massInfo.m; } + +void +cpShapeSetMass(cpShape *shape, cpFloat mass){ + cpBody *body = shape->body; + cpBodyActivate(body); + + shape->massInfo.m = mass; + cpBodyAccumulateMassFromShapes(body); +} + +cpFloat cpShapeGetDensity(cpShape *shape){ return shape->massInfo.m/shape->massInfo.area; } +void cpShapeSetDensity(cpShape *shape, cpFloat density){ cpShapeSetMass(shape, density*shape->massInfo.area); } + +cpFloat cpShapeGetMoment(cpShape *shape){ return shape->massInfo.m*shape->massInfo.i; } +cpFloat cpShapeGetArea(cpShape *shape){ return shape->massInfo.area; } +cpVect cpShapeGetCenterOfGravity(cpShape *shape) { return shape->massInfo.cog; } + + +cpBB +cpShapeCacheBB(cpShape *shape) +{ + return cpShapeUpdate(shape, shape->body->transform); +} + +cpBB +cpShapeUpdate(cpShape *shape, cpTransform transform) +{ + return (shape->bb = shape->klass->cacheData(shape, transform)); +} + +cpFloat +cpShapePointQuery(const cpShape *shape, cpVect p, cpPointQueryInfo *info) +{ + cpPointQueryInfo blank = {NULL, cpvzero, INFINITY, cpvzero}; + if(info){ + (*info) = blank; + } else { + info = ␣ + } + + shape->klass->pointQuery(shape, p, info); + return info->distance; +} + + +cpBool +cpShapeSegmentQuery(const cpShape *shape, cpVect a, cpVect b, cpFloat radius, cpSegmentQueryInfo *info){ + cpSegmentQueryInfo blank = {NULL, b, cpvzero, 1.0f}; + if(info){ + (*info) = blank; + } else { + info = ␣ + } + + cpPointQueryInfo nearest; + shape->klass->pointQuery(shape, a, &nearest); + if(nearest.distance <= radius){ + info->shape = shape; + info->alpha = 0.0; + info->normal = cpvnormalize(cpvsub(a, nearest.point)); + } else { + shape->klass->segmentQuery(shape, a, b, radius, info); + } + + return (info->shape != NULL); +} + +cpContactPointSet +cpShapesCollide(const cpShape *a, const cpShape *b) +{ + struct cpContact contacts[CP_MAX_CONTACTS_PER_ARBITER]; + struct cpCollisionInfo info = cpCollide(a, b, 0, contacts); + + cpContactPointSet set; + set.count = info.count; + + // cpCollideShapes() may have swapped the contact order. Flip the normal. + cpBool swapped = (a != info.a); + set.normal = (swapped ? cpvneg(info.n) : info.n); + + for(int i=0; itc = cpTransformPoint(transform, circle->c); + return cpBBNewForCircle(c, circle->r); +} + +static void +cpCircleShapePointQuery(cpCircleShape *circle, cpVect p, cpPointQueryInfo *info) +{ + cpVect delta = cpvsub(p, circle->tc); + cpFloat d = cpvlength(delta); + cpFloat r = circle->r; + + info->shape = (cpShape *)circle; + info->point = cpvadd(circle->tc, cpvmult(delta, r/d)); // TODO: div/0 + info->distance = d - r; + + // Use up for the gradient if the distance is very small. + info->gradient = (d > MAGIC_EPSILON ? cpvmult(delta, 1.0f/d) : cpv(0.0f, 1.0f)); +} + +static void +cpCircleShapeSegmentQuery(cpCircleShape *circle, cpVect a, cpVect b, cpFloat radius, cpSegmentQueryInfo *info) +{ + CircleSegmentQuery((cpShape *)circle, circle->tc, circle->r, a, b, radius, info); +} + +static struct cpShapeMassInfo +cpCircleShapeMassInfo(cpFloat mass, cpFloat radius, cpVect center) +{ + struct cpShapeMassInfo info = { + mass, cpMomentForCircle(1.0f, 0.0f, radius, cpvzero), + center, + cpAreaForCircle(0.0f, radius), + }; + + return info; +} + +static const cpShapeClass cpCircleShapeClass = { + CP_CIRCLE_SHAPE, + (cpShapeCacheDataImpl)cpCircleShapeCacheData, + NULL, + (cpShapePointQueryImpl)cpCircleShapePointQuery, + (cpShapeSegmentQueryImpl)cpCircleShapeSegmentQuery, +}; + +cpCircleShape * +cpCircleShapeInit(cpCircleShape *circle, cpBody *body, cpFloat radius, cpVect offset) +{ + circle->c = offset; + circle->r = radius; + + cpShapeInit((cpShape *)circle, &cpCircleShapeClass, body, cpCircleShapeMassInfo(0.0f, radius, offset)); + + return circle; +} + +cpShape * +cpCircleShapeNew(cpBody *body, cpFloat radius, cpVect offset) +{ + return (cpShape *)cpCircleShapeInit(cpCircleShapeAlloc(), body, radius, offset); +} + +CP_DefineShapeGetter(cpCircleShape, cpVect, c, Offset) +CP_DefineShapeGetter(cpCircleShape, cpFloat, r, Radius) + +cpSegmentShape * +cpSegmentShapeAlloc(void) +{ + return (cpSegmentShape *)cpcalloc(1, sizeof(cpSegmentShape)); +} + +static cpBB +cpSegmentShapeCacheData(cpSegmentShape *seg, cpTransform transform) +{ + seg->ta = cpTransformPoint(transform, seg->a); + seg->tb = cpTransformPoint(transform, seg->b); + seg->tn = cpTransformVect(transform, seg->n); + + cpFloat l,r,b,t; + + if(seg->ta.x < seg->tb.x){ + l = seg->ta.x; + r = seg->tb.x; + } else { + l = seg->tb.x; + r = seg->ta.x; + } + + if(seg->ta.y < seg->tb.y){ + b = seg->ta.y; + t = seg->tb.y; + } else { + b = seg->tb.y; + t = seg->ta.y; + } + + cpFloat rad = seg->r; + return cpBBNew(l - rad, b - rad, r + rad, t + rad); +} + +static void +cpSegmentShapePointQuery(cpSegmentShape *seg, cpVect p, cpPointQueryInfo *info) +{ + cpVect closest = cpClosetPointOnSegment(p, seg->ta, seg->tb); + + cpVect delta = cpvsub(p, closest); + cpFloat d = cpvlength(delta); + cpFloat r = seg->r; + cpVect g = cpvmult(delta, 1.0f/d); + + info->shape = (cpShape *)seg; + info->point = (d ? cpvadd(closest, cpvmult(g, r)) : closest); + info->distance = d - r; + + // Use the segment's normal if the distance is very small. + info->gradient = (d > MAGIC_EPSILON ? g : seg->n); +} + +static void +cpSegmentShapeSegmentQuery(cpSegmentShape *seg, cpVect a, cpVect b, cpFloat r2, cpSegmentQueryInfo *info) +{ + cpVect n = seg->tn; + cpFloat d = cpvdot(cpvsub(seg->ta, a), n); + cpFloat r = seg->r + r2; + + cpVect flipped_n = (d > 0.0f ? cpvneg(n) : n); + cpVect seg_offset = cpvsub(cpvmult(flipped_n, r), a); + + // Make the endpoints relative to 'a' and move them by the thickness of the segment. + cpVect seg_a = cpvadd(seg->ta, seg_offset); + cpVect seg_b = cpvadd(seg->tb, seg_offset); + cpVect delta = cpvsub(b, a); + + if(cpvcross(delta, seg_a)*cpvcross(delta, seg_b) <= 0.0f){ + cpFloat d_offset = d + (d > 0.0f ? -r : r); + cpFloat ad = -d_offset; + cpFloat bd = cpvdot(delta, n) - d_offset; + + if(ad*bd < 0.0f){ + cpFloat t = ad/(ad - bd); + + info->shape = (cpShape *)seg; + info->point = cpvsub(cpvlerp(a, b, t), cpvmult(flipped_n, r2)); + info->normal = flipped_n; + info->alpha = t; + } + } else if(r != 0.0f){ + cpSegmentQueryInfo info1 = {NULL, b, cpvzero, 1.0f}; + cpSegmentQueryInfo info2 = {NULL, b, cpvzero, 1.0f}; + CircleSegmentQuery((cpShape *)seg, seg->ta, seg->r, a, b, r2, &info1); + CircleSegmentQuery((cpShape *)seg, seg->tb, seg->r, a, b, r2, &info2); + + if(info1.alpha < info2.alpha){ + (*info) = info1; + } else { + (*info) = info2; + } + } +} + +static struct cpShapeMassInfo +cpSegmentShapeMassInfo(cpFloat mass, cpVect a, cpVect b, cpFloat r) +{ + cpFloat w = 2.0f*r; + struct cpShapeMassInfo info = { + mass, cpMomentForBox(1.0f, cpvdist(a, b) + w, w), // TODO is an approximation. + cpvlerp(a, b, 0.5f), + cpAreaForSegment(a, b, r), + }; + + return info; +} + +static const cpShapeClass cpSegmentShapeClass = { + CP_SEGMENT_SHAPE, + (cpShapeCacheDataImpl)cpSegmentShapeCacheData, + NULL, + (cpShapePointQueryImpl)cpSegmentShapePointQuery, + (cpShapeSegmentQueryImpl)cpSegmentShapeSegmentQuery, +}; + +cpSegmentShape * +cpSegmentShapeInit(cpSegmentShape *seg, cpBody *body, cpVect a, cpVect b, cpFloat r) +{ + seg->a = a; + seg->b = b; + seg->n = cpvrperp(cpvnormalize(cpvsub(b, a))); + + seg->r = r; + + seg->a_tangent = cpvzero; + seg->b_tangent = cpvzero; + + cpShapeInit((cpShape *)seg, &cpSegmentShapeClass, body, cpSegmentShapeMassInfo(0.0f, a, b, r)); + + return seg; +} + +cpShape* +cpSegmentShapeNew(cpBody *body, cpVect a, cpVect b, cpFloat r) +{ + return (cpShape *)cpSegmentShapeInit(cpSegmentShapeAlloc(), body, a, b, r); +} + +CP_DefineShapeGetter(cpSegmentShape, cpVect, a, A) +CP_DefineShapeGetter(cpSegmentShape, cpVect, b, B) +CP_DefineShapeGetter(cpSegmentShape, cpVect, n, Normal) +CP_DefineShapeGetter(cpSegmentShape, cpFloat, r, Radius) + +void +cpSegmentShapeSetNeighbors(cpShape *shape, cpVect prev, cpVect next) +{ + cpAssertHard(shape->klass == &cpSegmentShapeClass, "Shape is not a segment shape."); + cpSegmentShape *seg = (cpSegmentShape *)shape; + + seg->a_tangent = cpvsub(prev, seg->a); + seg->b_tangent = cpvsub(next, seg->b); +} + +// Unsafe API (chipmunk_unsafe.h) + +// TODO setters should wake the shape up? + +void +cpCircleShapeSetRadius(cpShape *shape, cpFloat radius) +{ + cpAssertHard(shape->klass == &cpCircleShapeClass, "Shape is not a circle shape."); + cpCircleShape *circle = (cpCircleShape *)shape; + + circle->r = radius; + + cpFloat mass = shape->massInfo.m; + shape->massInfo = cpCircleShapeMassInfo(mass, circle->r, circle->c); + if(mass > 0.0f) cpBodyAccumulateMassFromShapes(shape->body); +} + +void +cpCircleShapeSetOffset(cpShape *shape, cpVect offset) +{ + cpAssertHard(shape->klass == &cpCircleShapeClass, "Shape is not a circle shape."); + cpCircleShape *circle = (cpCircleShape *)shape; + + circle->c = offset; + + cpFloat mass = shape->massInfo.m; + shape->massInfo = cpCircleShapeMassInfo(shape->massInfo.m, circle->r, circle->c); + if(mass > 0.0f) cpBodyAccumulateMassFromShapes(shape->body); +} + +void +cpSegmentShapeSetEndpoints(cpShape *shape, cpVect a, cpVect b) +{ + cpAssertHard(shape->klass == &cpSegmentShapeClass, "Shape is not a segment shape."); + cpSegmentShape *seg = (cpSegmentShape *)shape; + + seg->a = a; + seg->b = b; + seg->n = cpvperp(cpvnormalize(cpvsub(b, a))); + + cpFloat mass = shape->massInfo.m; + shape->massInfo = cpSegmentShapeMassInfo(shape->massInfo.m, seg->a, seg->b, seg->r); + if(mass > 0.0f) cpBodyAccumulateMassFromShapes(shape->body); +} + +void +cpSegmentShapeSetRadius(cpShape *shape, cpFloat radius) +{ + cpAssertHard(shape->klass == &cpSegmentShapeClass, "Shape is not a segment shape."); + cpSegmentShape *seg = (cpSegmentShape *)shape; + + seg->r = radius; + + cpFloat mass = shape->massInfo.m; + shape->massInfo = cpSegmentShapeMassInfo(shape->massInfo.m, seg->a, seg->b, seg->r); + if(mass > 0.0f) cpBodyAccumulateMassFromShapes(shape->body); +} diff --git a/external/Chipmunk/src/cpSimpleMotor.c b/external/Chipmunk/src/cpSimpleMotor.c new file mode 100644 index 0000000..d5b86ff --- /dev/null +++ b/external/Chipmunk/src/cpSimpleMotor.c @@ -0,0 +1,103 @@ +/* Copyright (c) 2007 Scott Lembcke + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +#include "chipmunk/chipmunk_private.h" + +static void +preStep(cpSimpleMotor *joint, cpFloat dt) +{ + cpBody *a = joint->constraint.a; + cpBody *b = joint->constraint.b; + + // calculate moment of inertia coefficient. + joint->iSum = 1.0f/(a->i_inv + b->i_inv); +} + +static void +applyCachedImpulse(cpSimpleMotor *joint, cpFloat dt_coef) +{ + cpBody *a = joint->constraint.a; + cpBody *b = joint->constraint.b; + + cpFloat j = joint->jAcc*dt_coef; + a->w -= j*a->i_inv; + b->w += j*b->i_inv; +} + +static void +applyImpulse(cpSimpleMotor *joint, cpFloat dt) +{ + cpBody *a = joint->constraint.a; + cpBody *b = joint->constraint.b; + + // compute relative rotational velocity + cpFloat wr = b->w - a->w + joint->rate; + + cpFloat jMax = joint->constraint.maxForce*dt; + + // compute normal impulse + cpFloat j = -wr*joint->iSum; + cpFloat jOld = joint->jAcc; + joint->jAcc = cpfclamp(jOld + j, -jMax, jMax); + j = joint->jAcc - jOld; + + // apply impulse + a->w -= j*a->i_inv; + b->w += j*b->i_inv; +} + +static cpFloat +getImpulse(cpSimpleMotor *joint) +{ + return cpfabs(joint->jAcc); +} + +static const cpConstraintClass klass = { + (cpConstraintPreStepImpl)preStep, + (cpConstraintApplyCachedImpulseImpl)applyCachedImpulse, + (cpConstraintApplyImpulseImpl)applyImpulse, + (cpConstraintGetImpulseImpl)getImpulse, +}; +CP_DefineClassGetter(cpSimpleMotor) + +cpSimpleMotor * +cpSimpleMotorAlloc(void) +{ + return (cpSimpleMotor *)cpcalloc(1, sizeof(cpSimpleMotor)); +} + +cpSimpleMotor * +cpSimpleMotorInit(cpSimpleMotor *joint, cpBody *a, cpBody *b, cpFloat rate) +{ + cpConstraintInit((cpConstraint *)joint, &klass, a, b); + + joint->rate = rate; + + joint->jAcc = 0.0f; + + return joint; +} + +cpConstraint * +cpSimpleMotorNew(cpBody *a, cpBody *b, cpFloat rate) +{ + return (cpConstraint *)cpSimpleMotorInit(cpSimpleMotorAlloc(), a, b, rate); +} diff --git a/external/Chipmunk/src/cpSlideJoint.c b/external/Chipmunk/src/cpSlideJoint.c new file mode 100644 index 0000000..766eca3 --- /dev/null +++ b/external/Chipmunk/src/cpSlideJoint.c @@ -0,0 +1,130 @@ +/* Copyright (c) 2007 Scott Lembcke + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +#include "chipmunk/chipmunk_private.h" + +static void +preStep(cpSlideJoint *joint, cpFloat dt) +{ + cpBody *a = joint->constraint.a; + cpBody *b = joint->constraint.b; + + joint->r1 = cpTransformVect(a->transform, cpvsub(joint->anchr1, a->cog)); + joint->r2 = cpTransformVect(b->transform, cpvsub(joint->anchr2, b->cog)); + + cpVect delta = cpvsub(cpvadd(b->p, joint->r2), cpvadd(a->p, joint->r1)); + cpFloat dist = cpvlength(delta); + cpFloat pdist = 0.0f; + if(dist > joint->max) { + pdist = dist - joint->max; + joint->n = cpvnormalize(delta); + } else if(dist < joint->min) { + pdist = joint->min - dist; + joint->n = cpvneg(cpvnormalize(delta)); + } else { + joint->n = cpvzero; + joint->jnAcc = 0.0f; + } + + // calculate mass normal + joint->nMass = 1.0f/k_scalar(a, b, joint->r1, joint->r2, joint->n); + + // calculate bias velocity + cpFloat maxBias = joint->constraint.maxBias; + joint->bias = cpfclamp(-bias_coef(joint->constraint.errorBias, dt)*pdist/dt, -maxBias, maxBias); +} + +static void +applyCachedImpulse(cpSlideJoint *joint, cpFloat dt_coef) +{ + cpBody *a = joint->constraint.a; + cpBody *b = joint->constraint.b; + + cpVect j = cpvmult(joint->n, joint->jnAcc*dt_coef); + apply_impulses(a, b, joint->r1, joint->r2, j); +} + +static void +applyImpulse(cpSlideJoint *joint, cpFloat dt) +{ + if(cpveql(joint->n, cpvzero)) return; // early exit + + cpBody *a = joint->constraint.a; + cpBody *b = joint->constraint.b; + + cpVect n = joint->n; + cpVect r1 = joint->r1; + cpVect r2 = joint->r2; + + // compute relative velocity + cpVect vr = relative_velocity(a, b, r1, r2); + cpFloat vrn = cpvdot(vr, n); + + // compute normal impulse + cpFloat jn = (joint->bias - vrn)*joint->nMass; + cpFloat jnOld = joint->jnAcc; + joint->jnAcc = cpfclamp(jnOld + jn, -joint->constraint.maxForce*dt, 0.0f); + jn = joint->jnAcc - jnOld; + + // apply impulse + apply_impulses(a, b, joint->r1, joint->r2, cpvmult(n, jn)); +} + +static cpFloat +getImpulse(cpConstraint *joint) +{ + return cpfabs(((cpSlideJoint *)joint)->jnAcc); +} + +static const cpConstraintClass klass = { + (cpConstraintPreStepImpl)preStep, + (cpConstraintApplyCachedImpulseImpl)applyCachedImpulse, + (cpConstraintApplyImpulseImpl)applyImpulse, + (cpConstraintGetImpulseImpl)getImpulse, +}; +CP_DefineClassGetter(cpSlideJoint) + +cpSlideJoint * +cpSlideJointAlloc(void) +{ + return (cpSlideJoint *)cpcalloc(1, sizeof(cpSlideJoint)); +} + +cpSlideJoint * +cpSlideJointInit(cpSlideJoint *joint, cpBody *a, cpBody *b, cpVect anchr1, cpVect anchr2, cpFloat min, cpFloat max) +{ + cpConstraintInit((cpConstraint *)joint, &klass, a, b); + + joint->anchr1 = anchr1; + joint->anchr2 = anchr2; + joint->min = min; + joint->max = max; + + joint->jnAcc = 0.0f; + + return joint; +} + +cpConstraint * +cpSlideJointNew(cpBody *a, cpBody *b, cpVect anchr1, cpVect anchr2, cpFloat min, cpFloat max) +{ + return (cpConstraint *)cpSlideJointInit(cpSlideJointAlloc(), a, b, anchr1, anchr2, min, max); +} diff --git a/external/Chipmunk/src/cpSpace.c b/external/Chipmunk/src/cpSpace.c new file mode 100644 index 0000000..049874a --- /dev/null +++ b/external/Chipmunk/src/cpSpace.c @@ -0,0 +1,571 @@ +/* Copyright (c) 2007 Scott Lembcke + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +#include +#include + +#include "chipmunk/chipmunk_private.h" + +//MARK: Contact Set Helpers + +// Equal function for arbiterSet. +static cpBool +arbiterSetEql(cpShape **shapes, cpArbiter *arb) +{ + cpShape *a = shapes[0]; + cpShape *b = shapes[1]; + + return ((a == arb->a && b == arb->b) || (b == arb->a && a == arb->b)); +} + +//MARK: Collision Handler Set HelperFunctions + +// Equals function for collisionHandlers. +static cpBool +handlerSetEql(cpCollisionHandler *check, cpCollisionHandler *pair) +{ + return ( + (check->typeA == pair->typeA && check->typeB == pair->typeB) || + (check->typeB == pair->typeA && check->typeA == pair->typeB) + ); +} + +// Transformation function for collisionHandlers. +static void * +handlerSetTrans(cpCollisionHandler *handler, void *unused) +{ + cpCollisionHandler *copy = (cpCollisionHandler *)cpcalloc(1, sizeof(cpCollisionHandler)); + (*copy) = (*handler); + + return copy; +} + +//MARK: Misc Helper Funcs + +// Default collision functions. + +static cpBool +DefaultBegin(cpArbiter *arb, cpSpace *space, void *data){ + cpBool retA = cpArbiterCallWildcardBeginA(arb, space); + cpBool retB = cpArbiterCallWildcardBeginB(arb, space); + return retA && retB; +} + +static cpBool +DefaultPreSolve(cpArbiter *arb, cpSpace *space, void *data){ + cpBool retA = cpArbiterCallWildcardPreSolveA(arb, space); + cpBool retB = cpArbiterCallWildcardPreSolveB(arb, space); + return retA && retB; +} + +static void +DefaultPostSolve(cpArbiter *arb, cpSpace *space, void *data){ + cpArbiterCallWildcardPostSolveA(arb, space); + cpArbiterCallWildcardPostSolveB(arb, space); +} + +static void +DefaultSeparate(cpArbiter *arb, cpSpace *space, void *data){ + cpArbiterCallWildcardSeparateA(arb, space); + cpArbiterCallWildcardSeparateB(arb, space); +} + +// Use the wildcard identifier since the default handler should never match any type pair. +static cpCollisionHandler cpCollisionHandlerDefault = { + CP_WILDCARD_COLLISION_TYPE, CP_WILDCARD_COLLISION_TYPE, + DefaultBegin, DefaultPreSolve, DefaultPostSolve, DefaultSeparate, NULL +}; + +static cpBool AlwaysCollide(cpArbiter *arb, cpSpace *space, void *data){return cpTrue;} +static void DoNothing(cpArbiter *arb, cpSpace *space, void *data){} + +cpCollisionHandler cpCollisionHandlerDoNothing = { + CP_WILDCARD_COLLISION_TYPE, CP_WILDCARD_COLLISION_TYPE, + AlwaysCollide, AlwaysCollide, DoNothing, DoNothing, NULL +}; + +// function to get the estimated velocity of a shape for the cpBBTree. +static cpVect ShapeVelocityFunc(cpShape *shape){return shape->body->v;} + +// Used for disposing of collision handlers. +static void FreeWrap(void *ptr, void *unused){cpfree(ptr);} + +//MARK: Memory Management Functions + +cpSpace * +cpSpaceAlloc(void) +{ + return (cpSpace *)cpcalloc(1, sizeof(cpSpace)); +} + +cpSpace* +cpSpaceInit(cpSpace *space) +{ +#ifndef NDEBUG + static cpBool done = cpFalse; + if(!done){ + printf("Initializing cpSpace - Chipmunk v%s (Debug Enabled)\n", cpVersionString); + printf("Compile with -DNDEBUG defined to disable debug mode and runtime assertion checks\n"); + done = cpTrue; + } +#endif + + space->iterations = 10; + + space->gravity = cpvzero; + space->damping = 1.0f; + + space->collisionSlop = 0.1f; + space->collisionBias = cpfpow(1.0f - 0.1f, 60.0f); + space->collisionPersistence = 3; + + space->locked = 0; + space->stamp = 0; + + space->shapeIDCounter = 0; + space->staticShapes = cpBBTreeNew((cpSpatialIndexBBFunc)cpShapeGetBB, NULL); + space->dynamicShapes = cpBBTreeNew((cpSpatialIndexBBFunc)cpShapeGetBB, space->staticShapes); + cpBBTreeSetVelocityFunc(space->dynamicShapes, (cpBBTreeVelocityFunc)ShapeVelocityFunc); + + space->allocatedBuffers = cpArrayNew(0); + + space->dynamicBodies = cpArrayNew(0); + space->otherBodies = cpArrayNew(0); + space->sleepingComponents = cpArrayNew(0); + space->rousedBodies = cpArrayNew(0); + + space->sleepTimeThreshold = INFINITY; + space->idleSpeedThreshold = 0.0f; + + space->arbiters = cpArrayNew(0); + space->pooledArbiters = cpArrayNew(0); + + space->contactBuffersHead = NULL; + space->cachedArbiters = cpHashSetNew(0, (cpHashSetEqlFunc)arbiterSetEql); + + space->constraints = cpArrayNew(0); + + space->usesWildcards = cpFalse; + space->defaultHandler = cpCollisionHandlerDoNothing; + space->collisionHandlers = cpHashSetNew(0, (cpHashSetEqlFunc)handlerSetEql); + + space->postStepCallbacks = cpArrayNew(0); + space->skipPostStep = cpFalse; + + cpBody *staticBody = cpBodyInit(&space->_staticBody, 0.0f, 0.0f); + cpBodySetType(staticBody, CP_BODY_TYPE_STATIC); + cpSpaceSetStaticBody(space, staticBody); + + return space; +} + +cpSpace* +cpSpaceNew(void) +{ + return cpSpaceInit(cpSpaceAlloc()); +} + +void +cpSpaceDestroy(cpSpace *space) +{ + cpSpaceEachBody(space, (cpSpaceBodyIteratorFunc)cpBodyActivate, NULL); + + cpSpatialIndexFree(space->staticShapes); + cpSpatialIndexFree(space->dynamicShapes); + + cpArrayFree(space->dynamicBodies); + cpArrayFree(space->otherBodies); + cpArrayFree(space->sleepingComponents); + cpArrayFree(space->rousedBodies); + + cpArrayFree(space->constraints); + + cpHashSetFree(space->cachedArbiters); + + cpArrayFree(space->arbiters); + cpArrayFree(space->pooledArbiters); + + if(space->allocatedBuffers){ + cpArrayFreeEach(space->allocatedBuffers, cpfree); + cpArrayFree(space->allocatedBuffers); + } + + if(space->postStepCallbacks){ + cpArrayFreeEach(space->postStepCallbacks, cpfree); + cpArrayFree(space->postStepCallbacks); + } + + if(space->collisionHandlers) cpHashSetEach(space->collisionHandlers, FreeWrap, NULL); + cpHashSetFree(space->collisionHandlers); +} + +void +cpSpaceFree(cpSpace *space) +{ + if(space){ + cpSpaceDestroy(space); + cpfree(space); + } +} + + +//MARK: Basic properties: + +void +cpSpaceSetStaticBody(cpSpace *space, cpBody *body) +{ + if(space->staticBody != NULL){ + cpAssertHard(space->staticBody->shapeList == NULL, "Internal Error: Changing the designated static body while the old one still had shapes attached."); + space->staticBody->space = NULL; + } + + space->staticBody = body; + body->space = space; +} + +//MARK: Collision Handler Function Management + +static void +cpSpaceUseWildcardDefaultHandler(cpSpace *space) +{ + // Spaces default to using the slightly faster "do nothing" default handler until wildcards are potentially needed. + if(!space->usesWildcards){ + space->usesWildcards = cpTrue; + space->defaultHandler = cpCollisionHandlerDefault; + } +} + +cpCollisionHandler *cpSpaceAddDefaultCollisionHandler(cpSpace *space) +{ + cpSpaceUseWildcardDefaultHandler(space); + return &space->defaultHandler; +} + +cpCollisionHandler *cpSpaceAddCollisionHandler(cpSpace *space, cpCollisionType a, cpCollisionType b) +{ + cpHashValue hash = CP_HASH_PAIR(a, b); + // TODO should use space->defaultHandler values instead? + cpCollisionHandler temp = {a, b, DefaultBegin, DefaultPreSolve, DefaultPostSolve, DefaultSeparate, NULL}; + + cpHashSet *handlers = space->collisionHandlers; + cpCollisionHandler *handler = cpHashSetFind(handlers, hash, &temp); + return (handler ? handler : cpHashSetInsert(handlers, hash, &temp, (cpHashSetTransFunc)handlerSetTrans, NULL)); +} + +cpCollisionHandler * +cpSpaceAddWildcardHandler(cpSpace *space, cpCollisionType type) +{ + cpSpaceUseWildcardDefaultHandler(space); + + cpHashValue hash = CP_HASH_PAIR(type, CP_WILDCARD_COLLISION_TYPE); + cpCollisionHandler temp = {type, CP_WILDCARD_COLLISION_TYPE, AlwaysCollide, AlwaysCollide, DoNothing, DoNothing, NULL}; + + cpHashSet *handlers = space->collisionHandlers; + cpCollisionHandler *handler = cpHashSetFind(handlers, hash, &temp); + return (handler ? handler : cpHashSetInsert(handlers, hash, &temp, (cpHashSetTransFunc)handlerSetTrans, NULL)); +} + + +//MARK: Body, Shape, and Joint Management +cpShape * +cpSpaceAddShape(cpSpace *space, cpShape *shape) +{ + cpBody *body = shape->body; + + cpAssertHard(shape->space != space, "You have already added this shape to this space. You must not add it a second time."); + cpAssertHard(!shape->space, "You have already added this shape to another space. You cannot add it to a second."); +// cpAssertHard(body->space == space, "The shape's body must be added to the space before the shape."); + cpAssertSpaceUnlocked(space); + + cpBool isStatic = cpBodyIsStatic(body); + if(!isStatic) cpBodyActivate(body); + cpBodyAddShape(body, shape); + + shape->hashid = space->shapeIDCounter++; + cpShapeUpdate(shape, body->transform); + cpSpatialIndexInsert(isStatic ? space->staticShapes : space->dynamicShapes, shape, shape->hashid); + shape->space = space; + + return shape; +} + +cpBody * +cpSpaceAddBody(cpSpace *space, cpBody *body) +{ + cpAssertHard(body->space != space, "You have already added this body to this space. You must not add it a second time."); + cpAssertHard(!body->space, "You have already added this body to another space. You cannot add it to a second."); + cpAssertSpaceUnlocked(space); + + cpArrayPush(cpBodyIsDynamic(body) ? space->dynamicBodies : space->otherBodies, body); + body->space = space; + + return body; +} + +cpConstraint * +cpSpaceAddConstraint(cpSpace *space, cpConstraint *constraint) +{ + cpAssertHard(constraint->space != space, "You have already added this constraint to this space. You must not add it a second time."); + cpAssertHard(!constraint->space, "You have already added this constraint to another space. You cannot add it to a second."); + cpAssertSpaceUnlocked(space); + + cpBody *a = constraint->a, *b = constraint->b; + cpAssertHard(a != NULL && b != NULL, "Constraint is attached to a NULL body."); +// cpAssertHard(a->space == space && b->space == space, "The constraint's bodies must be added to the space before the constraint."); + + cpBodyActivate(a); + cpBodyActivate(b); + cpArrayPush(space->constraints, constraint); + + // Push onto the heads of the bodies' constraint lists + constraint->next_a = a->constraintList; a->constraintList = constraint; + constraint->next_b = b->constraintList; b->constraintList = constraint; + constraint->space = space; + + return constraint; +} + +struct arbiterFilterContext { + cpSpace *space; + cpBody *body; + cpShape *shape; +}; + +static cpBool +cachedArbitersFilter(cpArbiter *arb, struct arbiterFilterContext *context) +{ + cpShape *shape = context->shape; + cpBody *body = context->body; + + + // Match on the filter shape, or if it's NULL the filter body + if( + (body == arb->body_a && (shape == arb->a || shape == NULL)) || + (body == arb->body_b && (shape == arb->b || shape == NULL)) + ){ + // Call separate when removing shapes. + if(shape && arb->state != CP_ARBITER_STATE_CACHED){ + // Invalidate the arbiter since one of the shapes was removed. + arb->state = CP_ARBITER_STATE_INVALIDATED; + + cpCollisionHandler *handler = arb->handler; + handler->separateFunc(arb, context->space, handler->userData); + } + + cpArbiterUnthread(arb); + cpArrayDeleteObj(context->space->arbiters, arb); + cpArrayPush(context->space->pooledArbiters, arb); + + return cpFalse; + } + + return cpTrue; +} + +void +cpSpaceFilterArbiters(cpSpace *space, cpBody *body, cpShape *filter) +{ + cpSpaceLock(space); { + struct arbiterFilterContext context = {space, body, filter}; + cpHashSetFilter(space->cachedArbiters, (cpHashSetFilterFunc)cachedArbitersFilter, &context); + } cpSpaceUnlock(space, cpTrue); +} + +void +cpSpaceRemoveShape(cpSpace *space, cpShape *shape) +{ + cpBody *body = shape->body; + cpAssertHard(cpSpaceContainsShape(space, shape), "Cannot remove a shape that was not added to the space. (Removed twice maybe?)"); + cpAssertSpaceUnlocked(space); + + cpBool isStatic = cpBodyIsStatic(body); + if(isStatic){ + cpBodyActivateStatic(body, shape); + } else { + cpBodyActivate(body); + } + + cpBodyRemoveShape(body, shape); + cpSpaceFilterArbiters(space, body, shape); + cpSpatialIndexRemove(isStatic ? space->staticShapes : space->dynamicShapes, shape, shape->hashid); + shape->space = NULL; + shape->hashid = 0; +} + +void +cpSpaceRemoveBody(cpSpace *space, cpBody *body) +{ + cpAssertHard(body != cpSpaceGetStaticBody(space), "Cannot remove the designated static body for the space."); + cpAssertHard(cpSpaceContainsBody(space, body), "Cannot remove a body that was not added to the space. (Removed twice maybe?)"); +// cpAssertHard(body->shapeList == NULL, "Cannot remove a body from the space before removing the bodies attached to it."); +// cpAssertHard(body->constraintList == NULL, "Cannot remove a body from the space before removing the constraints attached to it."); + cpAssertSpaceUnlocked(space); + + cpBodyActivate(body); +// cpSpaceFilterArbiters(space, body, NULL); + cpArrayDeleteObj(cpBodyIsDynamic(body) ? space->dynamicBodies : space->otherBodies, body); + body->space = NULL; +} + +void +cpSpaceRemoveConstraint(cpSpace *space, cpConstraint *constraint) +{ + cpAssertHard(cpSpaceContainsConstraint(space, constraint), "Cannot remove a constraint that was not added to the space. (Removed twice maybe?)"); + cpAssertSpaceUnlocked(space); + + cpBodyActivate(constraint->a); + cpBodyActivate(constraint->b); + cpArrayDeleteObj(space->constraints, constraint); + + cpBodyRemoveConstraint(constraint->a, constraint); + cpBodyRemoveConstraint(constraint->b, constraint); + constraint->space = NULL; +} + +cpBool cpSpaceContainsShape(cpSpace *space, cpShape *shape) +{ + return (shape->space == space); +} + +cpBool cpSpaceContainsBody(cpSpace *space, cpBody *body) +{ + return (body->space == space); +} + +cpBool cpSpaceContainsConstraint(cpSpace *space, cpConstraint *constraint) +{ + return (constraint->space == space); +} + +//MARK: Iteration + +void +cpSpaceEachBody(cpSpace *space, cpSpaceBodyIteratorFunc func, void *data) +{ + cpSpaceLock(space); { + cpArray *bodies = space->dynamicBodies; + for(int i=0; inum; i++){ + func((cpBody *)bodies->arr[i], data); + } + + cpArray *otherBodies = space->otherBodies; + for(int i=0; inum; i++){ + func((cpBody *)otherBodies->arr[i], data); + } + + cpArray *components = space->sleepingComponents; + for(int i=0; inum; i++){ + cpBody *root = (cpBody *)components->arr[i]; + + cpBody *body = root; + while(body){ + cpBody *next = body->node.next; + func(body, data); + body = next; + } + } + } cpSpaceUnlock(space, cpTrue); +} + +typedef struct spaceShapeContext { + cpSpaceShapeIteratorFunc func; + void *data; +} spaceShapeContext; + +static void +spaceEachShapeIterator(cpShape *shape, spaceShapeContext *context) +{ + context->func(shape, context->data); +} + +void +cpSpaceEachShape(cpSpace *space, cpSpaceShapeIteratorFunc func, void *data) +{ + cpSpaceLock(space); { + spaceShapeContext context = {func, data}; + cpSpatialIndexEach(space->dynamicShapes, (cpSpatialIndexIteratorFunc)spaceEachShapeIterator, &context); + cpSpatialIndexEach(space->staticShapes, (cpSpatialIndexIteratorFunc)spaceEachShapeIterator, &context); + } cpSpaceUnlock(space, cpTrue); +} + +void +cpSpaceEachConstraint(cpSpace *space, cpSpaceConstraintIteratorFunc func, void *data) +{ + cpSpaceLock(space); { + cpArray *constraints = space->constraints; + + for(int i=0; inum; i++){ + func((cpConstraint *)constraints->arr[i], data); + } + } cpSpaceUnlock(space, cpTrue); +} + +//MARK: Spatial Index Management + +void +cpSpaceReindexStatic(cpSpace *space) +{ + cpAssertHard(!space->locked, "You cannot manually reindex objects while the space is locked. Wait until the current query or step is complete."); + + cpSpatialIndexEach(space->staticShapes, (cpSpatialIndexIteratorFunc)&cpShapeUpdateFunc, NULL); + cpSpatialIndexReindex(space->staticShapes); +} + +void +cpSpaceReindexShape(cpSpace *space, cpShape *shape) +{ + cpAssertHard(!space->locked, "You cannot manually reindex objects while the space is locked. Wait until the current query or step is complete."); + + cpShapeCacheBB(shape); + + // attempt to rehash the shape in both hashes + cpSpatialIndexReindexObject(space->dynamicShapes, shape, shape->hashid); + cpSpatialIndexReindexObject(space->staticShapes, shape, shape->hashid); +} + +void +cpSpaceReindexShapesForBody(cpSpace *space, cpBody *body) +{ + CP_BODY_FOREACH_SHAPE(body, shape) cpSpaceReindexShape(space, shape); +} + + +static void +copyShapes(cpShape *shape, cpSpatialIndex *index) +{ + cpSpatialIndexInsert(index, shape, shape->hashid); +} + +void +cpSpaceUseSpatialHash(cpSpace *space, cpFloat dim, int count) +{ + cpSpatialIndex *staticShapes = cpSpaceHashNew(dim, count, (cpSpatialIndexBBFunc)cpShapeGetBB, NULL); + cpSpatialIndex *dynamicShapes = cpSpaceHashNew(dim, count, (cpSpatialIndexBBFunc)cpShapeGetBB, staticShapes); + + cpSpatialIndexEach(space->staticShapes, (cpSpatialIndexIteratorFunc)copyShapes, staticShapes); + cpSpatialIndexEach(space->dynamicShapes, (cpSpatialIndexIteratorFunc)copyShapes, dynamicShapes); + + cpSpatialIndexFree(space->staticShapes); + cpSpatialIndexFree(space->dynamicShapes); + + space->staticShapes = staticShapes; + space->dynamicShapes = dynamicShapes; +} diff --git a/external/Chipmunk/src/cpSpaceComponent.c b/external/Chipmunk/src/cpSpaceComponent.c new file mode 100644 index 0000000..8299109 --- /dev/null +++ b/external/Chipmunk/src/cpSpaceComponent.c @@ -0,0 +1,343 @@ +/* Copyright (c) 2007 Scott Lembcke + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +#include + +#include "chipmunk/chipmunk_private.h" + +//MARK: Sleeping Functions + +void +cpSpaceActivateBody(cpSpace *space, cpBody *body) +{ + cpAssertHard(cpBodyIsDynamic(body), "Internal error: Attempting to activate a non-dynamic body."); + + if(space->locked){ + // cpSpaceActivateBody() is called again once the space is unlocked + if(!cpArrayContains(space->rousedBodies, body)) cpArrayPush(space->rousedBodies, body); + } else { + cpAssertSoft(body->node.root == NULL && body->node.next == NULL, "Internal error: Activating body non-NULL node pointers."); + cpArrayPush(space->dynamicBodies, body); + + CP_BODY_FOREACH_SHAPE(body, shape){ + cpSpatialIndexRemove(space->staticShapes, shape, shape->hashid); + cpSpatialIndexInsert(space->dynamicShapes, shape, shape->hashid); + } + + CP_BODY_FOREACH_ARBITER(body, arb){ + cpBody *bodyA = arb->body_a; + + // Arbiters are shared between two bodies that are always woken up together. + // You only want to restore the arbiter once, so bodyA is arbitrarily chosen to own the arbiter. + // The edge case is when static bodies are involved as the static bodies never actually sleep. + // If the static body is bodyB then all is good. If the static body is bodyA, that can easily be checked. + if(body == bodyA || cpBodyIsStatic(bodyA)){ + int numContacts = arb->count; + struct cpContact *contacts = arb->contacts; + + // Restore contact values back to the space's contact buffer memory + arb->contacts = cpContactBufferGetArray(space); + memcpy(arb->contacts, contacts, numContacts*sizeof(struct cpContact)); + cpSpacePushContacts(space, numContacts); + + // Reinsert the arbiter into the arbiter cache + const cpShape *a = arb->a, *b = arb->b; + const cpShape *shape_pair[] = {a, b}; + cpHashValue arbHashID = CP_HASH_PAIR((cpHashValue)a, (cpHashValue)b); + cpHashSetInsert(space->cachedArbiters, arbHashID, shape_pair, NULL, arb); + + // Update the arbiter's state + arb->stamp = space->stamp; + cpArrayPush(space->arbiters, arb); + + cpfree(contacts); + } + } + + CP_BODY_FOREACH_CONSTRAINT(body, constraint){ + cpBody *bodyA = constraint->a; + if(body == bodyA || cpBodyIsStatic(bodyA)) cpArrayPush(space->constraints, constraint); + } + } +} + +static void +cpSpaceDeactivateBody(cpSpace *space, cpBody *body) +{ + cpAssertHard(cpBodyIsDynamic(body), "Internal error: Attempting to deactivate a non-dynamic body."); + + cpArrayDeleteObj(space->dynamicBodies, body); + + CP_BODY_FOREACH_SHAPE(body, shape){ + cpSpatialIndexRemove(space->dynamicShapes, shape, shape->hashid); + cpSpatialIndexInsert(space->staticShapes, shape, shape->hashid); + } + + CP_BODY_FOREACH_ARBITER(body, arb){ + cpBody *bodyA = arb->body_a; + if(body == bodyA || cpBodyIsStatic(bodyA)){ + cpSpaceUncacheArbiter(space, arb); + + // Save contact values to a new block of memory so they won't time out + size_t bytes = arb->count*sizeof(struct cpContact); + struct cpContact *contacts = (struct cpContact *)cpcalloc(1, bytes); + memcpy(contacts, arb->contacts, bytes); + arb->contacts = contacts; + } + } + + CP_BODY_FOREACH_CONSTRAINT(body, constraint){ + cpBody *bodyA = constraint->a; + if(body == bodyA || cpBodyIsStatic(bodyA)) cpArrayDeleteObj(space->constraints, constraint); + } +} + +static inline cpBody * +ComponentRoot(cpBody *body) +{ + return (body ? body->node.root : NULL); +} + +void +cpBodyActivate(cpBody *body) +{ + if(body != NULL && cpBodyIsDynamic(body)){ + body->node.idleTime = 0.0f; + + cpBody *root = ComponentRoot(body); + if(root && cpBodyIsSleeping(root)){ + // TODO should cpBodyIsSleeping(root) be an assertion? + cpAssertSoft(cpBodyIsDynamic(root), "Internal Error: Non-dynamic body component root detected."); + + cpSpace *space = root->space; + cpBody *body = root; + while(body){ + cpBody *next = body->node.next; + + body->node.idleTime = 0.0f; + body->node.root = NULL; + body->node.next = NULL; + cpSpaceActivateBody(space, body); + + body = next; + } + + cpArrayDeleteObj(space->sleepingComponents, root); + } + + CP_BODY_FOREACH_ARBITER(body, arb){ + // Reset the idle timer of things the body is touching as well. + // That way things don't get left hanging in the air. + cpBody *other = (arb->body_a == body ? arb->body_b : arb->body_a); + if(!cpBodyIsStatic(other)) other->node.idleTime = 0.0f; + } + } +} + +void +cpBodyActivateStatic(cpBody *body, cpShape *filter) +{ + cpAssertHard(cpBodyIsStatic(body), "cpBodyActivateStatic() called on a non-static body."); + + CP_BODY_FOREACH_ARBITER(body, arb){ + if(!filter || filter == arb->a || filter == arb->b){ + cpBodyActivate(arb->body_a == body ? arb->body_b : arb->body_a); + } + } + + // TODO: should also activate joints? +} + +static inline void +cpBodyPushArbiter(cpBody *body, cpArbiter *arb) +{ + cpAssertSoft(cpArbiterThreadForBody(arb, body)->next == NULL, "Internal Error: Dangling contact graph pointers detected. (A)"); + cpAssertSoft(cpArbiterThreadForBody(arb, body)->prev == NULL, "Internal Error: Dangling contact graph pointers detected. (B)"); + + cpArbiter *next = body->arbiterList; + cpAssertSoft(next == NULL || cpArbiterThreadForBody(next, body)->prev == NULL, "Internal Error: Dangling contact graph pointers detected. (C)"); + cpArbiterThreadForBody(arb, body)->next = next; + + if(next) cpArbiterThreadForBody(next, body)->prev = arb; + body->arbiterList = arb; +} + +static inline void +ComponentAdd(cpBody *root, cpBody *body){ + body->node.root = root; + + if(body != root){ + body->node.next = root->node.next; + root->node.next = body; + } +} + +static inline void +FloodFillComponent(cpBody *root, cpBody *body) +{ + // Kinematic bodies cannot be put to sleep and prevent bodies they are touching from sleeping. + // Static bodies are effectively sleeping all the time. + if(cpBodyIsDynamic(body)){ + cpBody *other_root = ComponentRoot(body); + if(other_root == NULL){ + ComponentAdd(root, body); + CP_BODY_FOREACH_ARBITER(body, arb) FloodFillComponent(root, (body == arb->body_a ? arb->body_b : arb->body_a)); + CP_BODY_FOREACH_CONSTRAINT(body, constraint) FloodFillComponent(root, (body == constraint->a ? constraint->b : constraint->a)); + } else { + cpAssertSoft(other_root == root, "Internal Error: Inconsistency dectected in the contact graph."); + } + } +} + +static inline cpBool +ComponentActive(cpBody *root, cpFloat threshold) +{ + CP_BODY_FOREACH_COMPONENT(root, body){ + if(body->node.idleTime < threshold) return cpTrue; + } + + return cpFalse; +} + +void +cpSpaceProcessComponents(cpSpace *space, cpFloat dt) +{ + cpBool sleep = (space->sleepTimeThreshold != INFINITY); + cpArray *bodies = space->dynamicBodies; + +#ifndef NDEBUG + for(int i=0; inum; i++){ + cpBody *body = (cpBody*)bodies->arr[i]; + + cpAssertSoft(body->node.next == NULL, "Internal Error: Dangling next pointer detected in contact graph."); + cpAssertSoft(body->node.root == NULL, "Internal Error: Dangling root pointer detected in contact graph."); + } +#endif + + // Calculate the kinetic energy of all the bodies. + if(sleep){ + cpFloat dv = space->idleSpeedThreshold; + cpFloat dvsq = (dv ? dv*dv : cpvlengthsq(space->gravity)*dt*dt); + + // update idling and reset component nodes + for(int i=0; inum; i++){ + cpBody *body = (cpBody*)bodies->arr[i]; + + // Need to deal with infinite mass objects + cpFloat keThreshold = (dvsq ? body->m*dvsq : 0.0f); + body->node.idleTime = (cpBodyKineticEnergy(body) > keThreshold ? 0.0f : body->node.idleTime + dt); + } + } + + // Awaken any sleeping bodies found and then push arbiters to the bodies' lists. + cpArray *arbiters = space->arbiters; + for(int i=0, count=arbiters->num; iarr[i]; + cpBody *a = arb->body_a, *b = arb->body_b; + + if(sleep){ + // TODO checking cpBodyIsSleepin() redundant? + if(cpBodyIsKinematic(b) || cpBodyIsSleeping(a)) cpBodyActivate(a); + if(cpBodyIsKinematic(a) || cpBodyIsSleeping(b)) cpBodyActivate(b); + } + + cpBodyPushArbiter(a, arb); + cpBodyPushArbiter(b, arb); + } + + if(sleep){ + // Bodies should be held active if connected by a joint to a kinematic. + cpArray *constraints = space->constraints; + for(int i=0; inum; i++){ + cpConstraint *constraint = (cpConstraint *)constraints->arr[i]; + cpBody *a = constraint->a, *b = constraint->b; + + if(cpBodyIsKinematic(b)) cpBodyActivate(a); + if(cpBodyIsKinematic(a)) cpBodyActivate(b); + } + + // Generate components and deactivate sleeping ones + for(int i=0; inum;){ + cpBody *body = (cpBody*)bodies->arr[i]; + + if(ComponentRoot(body) == NULL){ + // Body not in a component yet. Perform a DFS to flood fill mark + // the component in the contact graph using this body as the root. + FloodFillComponent(body, body); + + // Check if the component should be put to sleep. + if(!ComponentActive(body, space->sleepTimeThreshold)){ + cpArrayPush(space->sleepingComponents, body); + CP_BODY_FOREACH_COMPONENT(body, other) cpSpaceDeactivateBody(space, other); + + // cpSpaceDeactivateBody() removed the current body from the list. + // Skip incrementing the index counter. + continue; + } + } + + i++; + + // Only sleeping bodies retain their component node pointers. + body->node.root = NULL; + body->node.next = NULL; + } + } +} + +void +cpBodySleep(cpBody *body) +{ + cpBodySleepWithGroup(body, NULL); +} + +void +cpBodySleepWithGroup(cpBody *body, cpBody *group){ + cpAssertHard(cpBodyIsDynamic(body), "Non-dynamic bodies cannot be put to sleep."); + + cpSpace *space = body->space; + cpAssertHard(!space->locked, "Bodies cannot be put to sleep during a query or a call to cpSpaceStep(). Put these calls into a post-step callback."); + cpAssertHard(group == NULL || cpBodyIsSleeping(group), "Cannot use a non-sleeping body as a group identifier."); + + if(cpBodyIsSleeping(body)){ + cpAssertHard(ComponentRoot(body) == ComponentRoot(group), "The body is already sleeping and it's group cannot be reassigned."); + return; + } + + CP_BODY_FOREACH_SHAPE(body, shape) cpShapeCacheBB(shape); + cpSpaceDeactivateBody(space, body); + + if(group){ + cpBody *root = ComponentRoot(group); + + cpComponentNode node = {root, root->node.next, 0.0f}; + body->node = node; + + root->node.next = body; + } else { + cpComponentNode node = {body, NULL, 0.0f}; + body->node = node; + + cpArrayPush(space->sleepingComponents, body); + } + + cpArrayDeleteObj(space->dynamicBodies, body); +} diff --git a/external/Chipmunk/src/cpSpaceDebug.c b/external/Chipmunk/src/cpSpaceDebug.c new file mode 100644 index 0000000..76f2ff0 --- /dev/null +++ b/external/Chipmunk/src/cpSpaceDebug.c @@ -0,0 +1,190 @@ +/* Copyright (c) 2013 Scott Lembcke + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +#include "chipmunk/chipmunk_private.h" + +#ifndef CP_SPACE_DISABLE_DEBUG_API + +static void +cpSpaceDebugDrawShape(cpShape *shape, cpSpaceDebugDrawOptions *options) +{ + cpBody *body = shape->body; + cpDataPointer *data = options->data; + + cpSpaceDebugColor outline_color = options->shapeOutlineColor; + cpSpaceDebugColor fill_color = options->colorForShape(shape, data); + + switch(shape->klass->type){ + case CP_CIRCLE_SHAPE: { + cpCircleShape *circle = (cpCircleShape *)shape; + options->drawCircle(circle->tc, body->a, circle->r, outline_color, fill_color, data); + break; + } + case CP_SEGMENT_SHAPE: { + cpSegmentShape *seg = (cpSegmentShape *)shape; + options->drawFatSegment(seg->ta, seg->tb, seg->r, outline_color, fill_color, data); + break; + } + case CP_POLY_SHAPE: { + cpPolyShape *poly = (cpPolyShape *)shape; + + int count = poly->count; + cpSplittingPlane *planes = poly->planes; + cpVect *verts = (cpVect *)alloca(count*sizeof(cpVect)); + + for(int i=0; idrawPolygon(count, verts, poly->r, outline_color, fill_color, data); + break; + } + default: break; + } +} + +static const cpVect spring_verts[] = { + {0.00f, 0.0f}, + {0.20f, 0.0f}, + {0.25f, 3.0f}, + {0.30f,-6.0f}, + {0.35f, 6.0f}, + {0.40f,-6.0f}, + {0.45f, 6.0f}, + {0.50f,-6.0f}, + {0.55f, 6.0f}, + {0.60f,-6.0f}, + {0.65f, 6.0f}, + {0.70f,-3.0f}, + {0.75f, 6.0f}, + {0.80f, 0.0f}, + {1.00f, 0.0f}, +}; +static const int spring_count = sizeof(spring_verts)/sizeof(cpVect); + +static void +cpSpaceDebugDrawConstraint(cpConstraint *constraint, cpSpaceDebugDrawOptions *options) +{ + cpDataPointer *data = options->data; + cpSpaceDebugColor color = options->constraintColor; + + cpBody *body_a = constraint->a; + cpBody *body_b = constraint->b; + + const cpConstraintClass *klass = constraint->klass; + if(klass == cpPinJointGetClass()){ + cpPinJoint *joint = (cpPinJoint *)constraint; + + cpVect a = cpTransformPoint(body_a->transform, joint->anchr1); + cpVect b = cpTransformPoint(body_b->transform, joint->anchr2); + + options->drawDot(5, a, color, data); + options->drawDot(5, b, color, data); + options->drawSegment(a, b, color, data); + } else if(klass == cpSlideJointGetClass()){ + cpSlideJoint *joint = (cpSlideJoint *)constraint; + + cpVect a = cpTransformPoint(body_a->transform, joint->anchr1); + cpVect b = cpTransformPoint(body_b->transform, joint->anchr2); + + options->drawDot(5, a, color, data); + options->drawDot(5, b, color, data); + options->drawSegment(a, b, color, data); + } else if(klass == cpPivotJointGetClass()){ + cpPivotJoint *joint = (cpPivotJoint *)constraint; + + cpVect a = cpTransformPoint(body_a->transform, joint->anchr1); + cpVect b = cpTransformPoint(body_b->transform, joint->anchr2); + + options->drawDot(5, a, color, data); + options->drawDot(5, b, color, data); + } else if(klass == cpGrooveJointGetClass()){ + cpGrooveJoint *joint = (cpGrooveJoint *)constraint; + + cpVect a = cpTransformPoint(body_a->transform, joint->grv_a); + cpVect b = cpTransformPoint(body_a->transform, joint->grv_b); + cpVect c = cpTransformPoint(body_b->transform, joint->anchr2); + + options->drawDot(5, c, color, data); + options->drawSegment(a, b, color, data); + } else if(klass == cpDampedSpringGetClass()){ + cpDampedSpring *spring = (cpDampedSpring *)constraint; + cpDataPointer *data = options->data; + cpSpaceDebugColor color = options->constraintColor; + + cpVect a = cpTransformPoint(body_a->transform, spring->anchr1); + cpVect b = cpTransformPoint(body_b->transform, spring->anchr2); + + options->drawDot(5, a, color, data); + options->drawDot(5, b, color, data); + + cpVect delta = cpvsub(b, a); + cpFloat cos = delta.x; + cpFloat sin = delta.y; + cpFloat s = 1.0f/cpvlength(delta); + + cpVect r1 = cpv(cos, -sin*s); + cpVect r2 = cpv(sin, cos*s); + + cpVect *verts = (cpVect *)alloca(spring_count*sizeof(cpVect)); + for(int i=0; idrawSegment(verts[i], verts[i + 1], color, data); + } + } +} + +void +cpSpaceDebugDraw(cpSpace *space, cpSpaceDebugDrawOptions *options) +{ + if(options->flags & CP_SPACE_DEBUG_DRAW_SHAPES){ + cpSpaceEachShape(space, (cpSpaceShapeIteratorFunc)cpSpaceDebugDrawShape, options); + } + + if(options->flags & CP_SPACE_DEBUG_DRAW_CONSTRAINTS){ + cpSpaceEachConstraint(space, (cpSpaceConstraintIteratorFunc)cpSpaceDebugDrawConstraint, options); + } + + if(options->flags & CP_SPACE_DEBUG_DRAW_COLLISION_POINTS){ + cpArray *arbiters = space->arbiters; + cpSpaceDebugColor color = options->collisionPointColor; + cpSpaceDebugDrawSegmentImpl draw_seg = options->drawSegment; + cpDataPointer *data = options->data; + + for(int i=0; inum; i++){ + cpArbiter *arb = (cpArbiter*)arbiters->arr[i]; + cpVect n = arb->n; + + for(int j=0; jcount; j++){ + cpVect p1 = cpvadd(arb->body_a->p, arb->contacts[j].r1); + cpVect p2 = cpvadd(arb->body_b->p, arb->contacts[j].r2); + + cpFloat d = 2.0f; + cpVect a = cpvadd(p1, cpvmult(n, -d)); + cpVect b = cpvadd(p2, cpvmult(n, d)); + draw_seg(a, b, color, data); + } + } + } +} + +#endif diff --git a/external/Chipmunk/src/cpSpaceHash.c b/external/Chipmunk/src/cpSpaceHash.c new file mode 100644 index 0000000..62b5a48 --- /dev/null +++ b/external/Chipmunk/src/cpSpaceHash.c @@ -0,0 +1,634 @@ +/* Copyright (c) 2007 Scott Lembcke + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +#include "chipmunk/chipmunk_private.h" +#include "prime.h" + +typedef struct cpSpaceHashBin cpSpaceHashBin; +typedef struct cpHandle cpHandle; + +struct cpSpaceHash { + cpSpatialIndex spatialIndex; + + int numcells; + cpFloat celldim; + + cpSpaceHashBin **table; + cpHashSet *handleSet; + + cpSpaceHashBin *pooledBins; + cpArray *pooledHandles; + cpArray *allocatedBuffers; + + cpTimestamp stamp; +}; + + +//MARK: Handle Functions + +struct cpHandle { + void *obj; + int retain; + cpTimestamp stamp; +}; + +static cpHandle* +cpHandleInit(cpHandle *hand, void *obj) +{ + hand->obj = obj; + hand->retain = 0; + hand->stamp = 0; + + return hand; +} + +static inline void cpHandleRetain(cpHandle *hand){hand->retain++;} + +static inline void +cpHandleRelease(cpHandle *hand, cpArray *pooledHandles) +{ + hand->retain--; + if(hand->retain == 0) cpArrayPush(pooledHandles, hand); +} + +static int handleSetEql(void *obj, cpHandle *hand){return (obj == hand->obj);} + +static void * +handleSetTrans(void *obj, cpSpaceHash *hash) +{ + if(hash->pooledHandles->num == 0){ + // handle pool is exhausted, make more + int count = CP_BUFFER_BYTES/sizeof(cpHandle); + cpAssertHard(count, "Internal Error: Buffer size is too small."); + + cpHandle *buffer = (cpHandle *)cpcalloc(1, CP_BUFFER_BYTES); + cpArrayPush(hash->allocatedBuffers, buffer); + + for(int i=0; ipooledHandles, buffer + i); + } + + cpHandle *hand = cpHandleInit((cpHandle *)cpArrayPop(hash->pooledHandles), obj); + cpHandleRetain(hand); + + return hand; +} + +//MARK: Bin Functions + +struct cpSpaceHashBin { + cpHandle *handle; + cpSpaceHashBin *next; +}; + +static inline void +recycleBin(cpSpaceHash *hash, cpSpaceHashBin *bin) +{ + bin->next = hash->pooledBins; + hash->pooledBins = bin; +} + +static inline void +clearTableCell(cpSpaceHash *hash, int idx) +{ + cpSpaceHashBin *bin = hash->table[idx]; + while(bin){ + cpSpaceHashBin *next = bin->next; + + cpHandleRelease(bin->handle, hash->pooledHandles); + recycleBin(hash, bin); + + bin = next; + } + + hash->table[idx] = NULL; +} + +static void +clearTable(cpSpaceHash *hash) +{ + for(int i=0; inumcells; i++) clearTableCell(hash, i); +} + +// Get a recycled or new bin. +static inline cpSpaceHashBin * +getEmptyBin(cpSpaceHash *hash) +{ + cpSpaceHashBin *bin = hash->pooledBins; + + if(bin){ + hash->pooledBins = bin->next; + return bin; + } else { + // Pool is exhausted, make more + int count = CP_BUFFER_BYTES/sizeof(cpSpaceHashBin); + cpAssertHard(count, "Internal Error: Buffer size is too small."); + + cpSpaceHashBin *buffer = (cpSpaceHashBin *)cpcalloc(1, CP_BUFFER_BYTES); + cpArrayPush(hash->allocatedBuffers, buffer); + + // push all but the first one, return the first instead + for(int i=1; itable); + + hash->numcells = numcells; + hash->table = (cpSpaceHashBin **)cpcalloc(numcells, sizeof(cpSpaceHashBin *)); +} + +static inline cpSpatialIndexClass *Klass(); + +cpSpatialIndex * +cpSpaceHashInit(cpSpaceHash *hash, cpFloat celldim, int numcells, cpSpatialIndexBBFunc bbfunc, cpSpatialIndex *staticIndex) +{ + cpSpatialIndexInit((cpSpatialIndex *)hash, Klass(), bbfunc, staticIndex); + + cpSpaceHashAllocTable(hash, next_prime(numcells)); + hash->celldim = celldim; + + hash->handleSet = cpHashSetNew(0, (cpHashSetEqlFunc)handleSetEql); + + hash->pooledHandles = cpArrayNew(0); + + hash->pooledBins = NULL; + hash->allocatedBuffers = cpArrayNew(0); + + hash->stamp = 1; + + return (cpSpatialIndex *)hash; +} + +cpSpatialIndex * +cpSpaceHashNew(cpFloat celldim, int cells, cpSpatialIndexBBFunc bbfunc, cpSpatialIndex *staticIndex) +{ + return cpSpaceHashInit(cpSpaceHashAlloc(), celldim, cells, bbfunc, staticIndex); +} + +static void +cpSpaceHashDestroy(cpSpaceHash *hash) +{ + if(hash->table) clearTable(hash); + cpfree(hash->table); + + cpHashSetFree(hash->handleSet); + + cpArrayFreeEach(hash->allocatedBuffers, cpfree); + cpArrayFree(hash->allocatedBuffers); + cpArrayFree(hash->pooledHandles); +} + +//MARK: Helper Functions + +static inline cpBool +containsHandle(cpSpaceHashBin *bin, cpHandle *hand) +{ + while(bin){ + if(bin->handle == hand) return cpTrue; + bin = bin->next; + } + + return cpFalse; +} + +// The hash function itself. +static inline cpHashValue +hash_func(cpHashValue x, cpHashValue y, cpHashValue n) +{ + return (x*1640531513ul ^ y*2654435789ul) % n; +} + +// Much faster than (int)floor(f) +// Profiling showed floor() to be a sizable performance hog +static inline int +floor_int(cpFloat f) +{ + int i = (int)f; + return (f < 0.0f && f != i ? i - 1 : i); +} + +static inline void +hashHandle(cpSpaceHash *hash, cpHandle *hand, cpBB bb) +{ + // Find the dimensions in cell coordinates. + cpFloat dim = hash->celldim; + int l = floor_int(bb.l/dim); // Fix by ShiftZ + int r = floor_int(bb.r/dim); + int b = floor_int(bb.b/dim); + int t = floor_int(bb.t/dim); + + int n = hash->numcells; + for(int i=l; i<=r; i++){ + for(int j=b; j<=t; j++){ + cpHashValue idx = hash_func(i,j,n); + cpSpaceHashBin *bin = hash->table[idx]; + + // Don't add an object twice to the same cell. + if(containsHandle(bin, hand)) continue; + + cpHandleRetain(hand); + // Insert a new bin for the handle in this cell. + cpSpaceHashBin *newBin = getEmptyBin(hash); + newBin->handle = hand; + newBin->next = bin; + hash->table[idx] = newBin; + } + } +} + +//MARK: Basic Operations + +static void +cpSpaceHashInsert(cpSpaceHash *hash, void *obj, cpHashValue hashid) +{ + cpHandle *hand = (cpHandle *)cpHashSetInsert(hash->handleSet, hashid, obj, (cpHashSetTransFunc)handleSetTrans, hash); + hashHandle(hash, hand, hash->spatialIndex.bbfunc(obj)); +} + +static void +cpSpaceHashRehashObject(cpSpaceHash *hash, void *obj, cpHashValue hashid) +{ + cpHandle *hand = (cpHandle *)cpHashSetRemove(hash->handleSet, hashid, obj); + + if(hand){ + hand->obj = NULL; + cpHandleRelease(hand, hash->pooledHandles); + + cpSpaceHashInsert(hash, obj, hashid); + } +} + +static void +rehash_helper(cpHandle *hand, cpSpaceHash *hash) +{ + hashHandle(hash, hand, hash->spatialIndex.bbfunc(hand->obj)); +} + +static void +cpSpaceHashRehash(cpSpaceHash *hash) +{ + clearTable(hash); + cpHashSetEach(hash->handleSet, (cpHashSetIteratorFunc)rehash_helper, hash); +} + +static void +cpSpaceHashRemove(cpSpaceHash *hash, void *obj, cpHashValue hashid) +{ + cpHandle *hand = (cpHandle *)cpHashSetRemove(hash->handleSet, hashid, obj); + + if(hand){ + hand->obj = NULL; + cpHandleRelease(hand, hash->pooledHandles); + } +} + +typedef struct eachContext { + cpSpatialIndexIteratorFunc func; + void *data; +} eachContext; + +static void eachHelper(cpHandle *hand, eachContext *context){context->func(hand->obj, context->data);} + +static void +cpSpaceHashEach(cpSpaceHash *hash, cpSpatialIndexIteratorFunc func, void *data) +{ + eachContext context = {func, data}; + cpHashSetEach(hash->handleSet, (cpHashSetIteratorFunc)eachHelper, &context); +} + +static void +remove_orphaned_handles(cpSpaceHash *hash, cpSpaceHashBin **bin_ptr) +{ + cpSpaceHashBin *bin = *bin_ptr; + while(bin){ + cpHandle *hand = bin->handle; + cpSpaceHashBin *next = bin->next; + + if(!hand->obj){ + // orphaned handle, unlink and recycle the bin + (*bin_ptr) = bin->next; + recycleBin(hash, bin); + + cpHandleRelease(hand, hash->pooledHandles); + } else { + bin_ptr = &bin->next; + } + + bin = next; + } +} + +//MARK: Query Functions + +static inline void +query_helper(cpSpaceHash *hash, cpSpaceHashBin **bin_ptr, void *obj, cpSpatialIndexQueryFunc func, void *data) +{ + restart: + for(cpSpaceHashBin *bin = *bin_ptr; bin; bin = bin->next){ + cpHandle *hand = bin->handle; + void *other = hand->obj; + + if(hand->stamp == hash->stamp || obj == other){ + continue; + } else if(other){ + func(obj, other, 0, data); + hand->stamp = hash->stamp; + } else { + // The object for this handle has been removed + // cleanup this cell and restart the query + remove_orphaned_handles(hash, bin_ptr); + goto restart; // GCC not smart enough/able to tail call an inlined function. + } + } +} + +static void +cpSpaceHashQuery(cpSpaceHash *hash, void *obj, cpBB bb, cpSpatialIndexQueryFunc func, void *data) +{ + // Get the dimensions in cell coordinates. + cpFloat dim = hash->celldim; + int l = floor_int(bb.l/dim); // Fix by ShiftZ + int r = floor_int(bb.r/dim); + int b = floor_int(bb.b/dim); + int t = floor_int(bb.t/dim); + + int n = hash->numcells; + cpSpaceHashBin **table = hash->table; + + // Iterate over the cells and query them. + for(int i=l; i<=r; i++){ + for(int j=b; j<=t; j++){ + query_helper(hash, &table[hash_func(i,j,n)], obj, func, data); + } + } + + hash->stamp++; +} + +// Similar to struct eachPair above. +typedef struct queryRehashContext { + cpSpaceHash *hash; + cpSpatialIndexQueryFunc func; + void *data; +} queryRehashContext; + +// Hashset iterator func used with cpSpaceHashQueryRehash(). +static void +queryRehash_helper(cpHandle *hand, queryRehashContext *context) +{ + cpSpaceHash *hash = context->hash; + cpSpatialIndexQueryFunc func = context->func; + void *data = context->data; + + cpFloat dim = hash->celldim; + int n = hash->numcells; + + void *obj = hand->obj; + cpBB bb = hash->spatialIndex.bbfunc(obj); + + int l = floor_int(bb.l/dim); + int r = floor_int(bb.r/dim); + int b = floor_int(bb.b/dim); + int t = floor_int(bb.t/dim); + + cpSpaceHashBin **table = hash->table; + + for(int i=l; i<=r; i++){ + for(int j=b; j<=t; j++){ + cpHashValue idx = hash_func(i,j,n); + cpSpaceHashBin *bin = table[idx]; + + if(containsHandle(bin, hand)) continue; + + cpHandleRetain(hand); // this MUST be done first in case the object is removed in func() + query_helper(hash, &bin, obj, func, data); + + cpSpaceHashBin *newBin = getEmptyBin(hash); + newBin->handle = hand; + newBin->next = bin; + table[idx] = newBin; + } + } + + // Increment the stamp for each object hashed. + hash->stamp++; +} + +static void +cpSpaceHashReindexQuery(cpSpaceHash *hash, cpSpatialIndexQueryFunc func, void *data) +{ + clearTable(hash); + + queryRehashContext context = {hash, func, data}; + cpHashSetEach(hash->handleSet, (cpHashSetIteratorFunc)queryRehash_helper, &context); + + cpSpatialIndexCollideStatic((cpSpatialIndex *)hash, hash->spatialIndex.staticIndex, func, data); +} + +static inline cpFloat +segmentQuery_helper(cpSpaceHash *hash, cpSpaceHashBin **bin_ptr, void *obj, cpSpatialIndexSegmentQueryFunc func, void *data) +{ + cpFloat t = 1.0f; + + restart: + for(cpSpaceHashBin *bin = *bin_ptr; bin; bin = bin->next){ + cpHandle *hand = bin->handle; + void *other = hand->obj; + + // Skip over certain conditions + if(hand->stamp == hash->stamp){ + continue; + } else if(other){ + t = cpfmin(t, func(obj, other, data)); + hand->stamp = hash->stamp; + } else { + // The object for this handle has been removed + // cleanup this cell and restart the query + remove_orphaned_handles(hash, bin_ptr); + goto restart; // GCC not smart enough/able to tail call an inlined function. + } + } + + return t; +} + +// modified from http://playtechs.blogspot.com/2007/03/raytracing-on-grid.html +static void +cpSpaceHashSegmentQuery(cpSpaceHash *hash, void *obj, cpVect a, cpVect b, cpFloat t_exit, cpSpatialIndexSegmentQueryFunc func, void *data) +{ + a = cpvmult(a, 1.0f/hash->celldim); + b = cpvmult(b, 1.0f/hash->celldim); + + int cell_x = floor_int(a.x), cell_y = floor_int(a.y); + + cpFloat t = 0; + + int x_inc, y_inc; + cpFloat temp_v, temp_h; + + if (b.x > a.x){ + x_inc = 1; + temp_h = (cpffloor(a.x + 1.0f) - a.x); + } else { + x_inc = -1; + temp_h = (a.x - cpffloor(a.x)); + } + + if (b.y > a.y){ + y_inc = 1; + temp_v = (cpffloor(a.y + 1.0f) - a.y); + } else { + y_inc = -1; + temp_v = (a.y - cpffloor(a.y)); + } + + // Division by zero is *very* slow on ARM + cpFloat dx = cpfabs(b.x - a.x), dy = cpfabs(b.y - a.y); + cpFloat dt_dx = (dx ? 1.0f/dx : INFINITY), dt_dy = (dy ? 1.0f/dy : INFINITY); + + // fix NANs in horizontal directions + cpFloat next_h = (temp_h ? temp_h*dt_dx : dt_dx); + cpFloat next_v = (temp_v ? temp_v*dt_dy : dt_dy); + + int n = hash->numcells; + cpSpaceHashBin **table = hash->table; + + while(t < t_exit){ + cpHashValue idx = hash_func(cell_x, cell_y, n); + t_exit = cpfmin(t_exit, segmentQuery_helper(hash, &table[idx], obj, func, data)); + + if (next_v < next_h){ + cell_y += y_inc; + t = next_v; + next_v += dt_dy; + } else { + cell_x += x_inc; + t = next_h; + next_h += dt_dx; + } + } + + hash->stamp++; +} + +//MARK: Misc + +void +cpSpaceHashResize(cpSpaceHash *hash, cpFloat celldim, int numcells) +{ + if(hash->spatialIndex.klass != Klass()){ + cpAssertWarn(cpFalse, "Ignoring cpSpaceHashResize() call to non-cpSpaceHash spatial index."); + return; + } + + clearTable(hash); + + hash->celldim = celldim; + cpSpaceHashAllocTable(hash, next_prime(numcells)); +} + +static int +cpSpaceHashCount(cpSpaceHash *hash) +{ + return cpHashSetCount(hash->handleSet); +} + +static int +cpSpaceHashContains(cpSpaceHash *hash, void *obj, cpHashValue hashid) +{ + return cpHashSetFind(hash->handleSet, hashid, obj) != NULL; +} + +static cpSpatialIndexClass klass = { + (cpSpatialIndexDestroyImpl)cpSpaceHashDestroy, + + (cpSpatialIndexCountImpl)cpSpaceHashCount, + (cpSpatialIndexEachImpl)cpSpaceHashEach, + (cpSpatialIndexContainsImpl)cpSpaceHashContains, + + (cpSpatialIndexInsertImpl)cpSpaceHashInsert, + (cpSpatialIndexRemoveImpl)cpSpaceHashRemove, + + (cpSpatialIndexReindexImpl)cpSpaceHashRehash, + (cpSpatialIndexReindexObjectImpl)cpSpaceHashRehashObject, + (cpSpatialIndexReindexQueryImpl)cpSpaceHashReindexQuery, + + (cpSpatialIndexQueryImpl)cpSpaceHashQuery, + (cpSpatialIndexSegmentQueryImpl)cpSpaceHashSegmentQuery, +}; + +static inline cpSpatialIndexClass *Klass(){return &klass;} + +//MARK: Debug Drawing + +//#define CP_BBTREE_DEBUG_DRAW +#ifdef CP_BBTREE_DEBUG_DRAW +#include "OpenGL/gl.h" +#include "OpenGL/glu.h" +#include + +void +cpSpaceHashRenderDebug(cpSpatialIndex *index) +{ + if(index->klass != &klass){ + cpAssertWarn(cpFalse, "Ignoring cpSpaceHashRenderDebug() call to non-spatial hash spatial index."); + return; + } + + cpSpaceHash *hash = (cpSpaceHash *)index; + cpBB bb = cpBBNew(-320, -240, 320, 240); + + cpFloat dim = hash->celldim; + int n = hash->numcells; + + int l = (int)floor(bb.l/dim); + int r = (int)floor(bb.r/dim); + int b = (int)floor(bb.b/dim); + int t = (int)floor(bb.t/dim); + + for(int i=l; i<=r; i++){ + for(int j=b; j<=t; j++){ + int cell_count = 0; + + int index = hash_func(i,j,n); + for(cpSpaceHashBin *bin = hash->table[index]; bin; bin = bin->next) + cell_count++; + + GLfloat v = 1.0f - (GLfloat)cell_count/10.0f; + glColor3f(v,v,v); + glRectf(i*dim, j*dim, (i + 1)*dim, (j + 1)*dim); + } + } +} +#endif diff --git a/external/Chipmunk/src/cpSpaceQuery.c b/external/Chipmunk/src/cpSpaceQuery.c new file mode 100644 index 0000000..0c9fad3 --- /dev/null +++ b/external/Chipmunk/src/cpSpaceQuery.c @@ -0,0 +1,246 @@ +/* Copyright (c) 2007 Scott Lembcke + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +#include "chipmunk/chipmunk_private.h" + +//MARK: Nearest Point Query Functions + +struct PointQueryContext { + cpVect point; + cpFloat maxDistance; + cpShapeFilter filter; + cpSpacePointQueryFunc func; +}; + +static cpCollisionID +NearestPointQuery(struct PointQueryContext *context, cpShape *shape, cpCollisionID id, void *data) +{ + if( + !cpShapeFilterReject(shape->filter, context->filter) + ){ + cpPointQueryInfo info; + cpShapePointQuery(shape, context->point, &info); + + if(info.shape && info.distance < context->maxDistance) context->func(shape, info.point, info.distance, info.gradient, data); + } + + return id; +} + +void +cpSpacePointQuery(cpSpace *space, cpVect point, cpFloat maxDistance, cpShapeFilter filter, cpSpacePointQueryFunc func, void *data) +{ + struct PointQueryContext context = {point, maxDistance, filter, func}; + cpBB bb = cpBBNewForCircle(point, cpfmax(maxDistance, 0.0f)); + + cpSpaceLock(space); { + cpSpatialIndexQuery(space->dynamicShapes, &context, bb, (cpSpatialIndexQueryFunc)NearestPointQuery, data); + cpSpatialIndexQuery(space->staticShapes, &context, bb, (cpSpatialIndexQueryFunc)NearestPointQuery, data); + } cpSpaceUnlock(space, cpTrue); +} + +static cpCollisionID +NearestPointQueryNearest(struct PointQueryContext *context, cpShape *shape, cpCollisionID id, cpPointQueryInfo *out) +{ + if( + !cpShapeFilterReject(shape->filter, context->filter) && !shape->sensor + ){ + cpPointQueryInfo info; + cpShapePointQuery(shape, context->point, &info); + + if(info.distance < out->distance) (*out) = info; + } + + return id; +} + +cpShape * +cpSpacePointQueryNearest(cpSpace *space, cpVect point, cpFloat maxDistance, cpShapeFilter filter, cpPointQueryInfo *out) +{ + cpPointQueryInfo info = {NULL, cpvzero, maxDistance, cpvzero}; + if(out){ + (*out) = info; + } else { + out = &info; + } + + struct PointQueryContext context = { + point, maxDistance, + filter, + NULL + }; + + cpBB bb = cpBBNewForCircle(point, cpfmax(maxDistance, 0.0f)); + cpSpatialIndexQuery(space->dynamicShapes, &context, bb, (cpSpatialIndexQueryFunc)NearestPointQueryNearest, out); + cpSpatialIndexQuery(space->staticShapes, &context, bb, (cpSpatialIndexQueryFunc)NearestPointQueryNearest, out); + + return (cpShape *)out->shape; +} + + +//MARK: Segment Query Functions + +struct SegmentQueryContext { + cpVect start, end; + cpFloat radius; + cpShapeFilter filter; + cpSpaceSegmentQueryFunc func; +}; + +static cpFloat +SegmentQuery(struct SegmentQueryContext *context, cpShape *shape, void *data) +{ + cpSegmentQueryInfo info; + + if( + !cpShapeFilterReject(shape->filter, context->filter) && + cpShapeSegmentQuery(shape, context->start, context->end, context->radius, &info) + ){ + context->func(shape, info.point, info.normal, info.alpha, data); + } + + return 1.0f; +} + +void +cpSpaceSegmentQuery(cpSpace *space, cpVect start, cpVect end, cpFloat radius, cpShapeFilter filter, cpSpaceSegmentQueryFunc func, void *data) +{ + struct SegmentQueryContext context = { + start, end, + radius, + filter, + func, + }; + + cpSpaceLock(space); { + cpSpatialIndexSegmentQuery(space->staticShapes, &context, start, end, 1.0f, (cpSpatialIndexSegmentQueryFunc)SegmentQuery, data); + cpSpatialIndexSegmentQuery(space->dynamicShapes, &context, start, end, 1.0f, (cpSpatialIndexSegmentQueryFunc)SegmentQuery, data); + } cpSpaceUnlock(space, cpTrue); +} + +static cpFloat +SegmentQueryFirst(struct SegmentQueryContext *context, cpShape *shape, cpSegmentQueryInfo *out) +{ + cpSegmentQueryInfo info; + + if( + !cpShapeFilterReject(shape->filter, context->filter) && !shape->sensor && + cpShapeSegmentQuery(shape, context->start, context->end, context->radius, &info) && + info.alpha < out->alpha + ){ + (*out) = info; + } + + return out->alpha; +} + +cpShape * +cpSpaceSegmentQueryFirst(cpSpace *space, cpVect start, cpVect end, cpFloat radius, cpShapeFilter filter, cpSegmentQueryInfo *out) +{ + cpSegmentQueryInfo info = {NULL, end, cpvzero, 1.0f}; + if(out){ + (*out) = info; + } else { + out = &info; + } + + struct SegmentQueryContext context = { + start, end, + radius, + filter, + NULL + }; + + cpSpatialIndexSegmentQuery(space->staticShapes, &context, start, end, 1.0f, (cpSpatialIndexSegmentQueryFunc)SegmentQueryFirst, out); + cpSpatialIndexSegmentQuery(space->dynamicShapes, &context, start, end, out->alpha, (cpSpatialIndexSegmentQueryFunc)SegmentQueryFirst, out); + + return (cpShape *)out->shape; +} + +//MARK: BB Query Functions + +struct BBQueryContext { + cpBB bb; + cpShapeFilter filter; + cpSpaceBBQueryFunc func; +}; + +static cpCollisionID +BBQuery(struct BBQueryContext *context, cpShape *shape, cpCollisionID id, void *data) +{ + if( + !cpShapeFilterReject(shape->filter, context->filter) && + cpBBIntersects(context->bb, shape->bb) + ){ + context->func(shape, data); + } + + return id; +} + +void +cpSpaceBBQuery(cpSpace *space, cpBB bb, cpShapeFilter filter, cpSpaceBBQueryFunc func, void *data) +{ + struct BBQueryContext context = {bb, filter, func}; + + cpSpaceLock(space); { + cpSpatialIndexQuery(space->dynamicShapes, &context, bb, (cpSpatialIndexQueryFunc)BBQuery, data); + cpSpatialIndexQuery(space->staticShapes, &context, bb, (cpSpatialIndexQueryFunc)BBQuery, data); + } cpSpaceUnlock(space, cpTrue); +} + +//MARK: Shape Query Functions + +struct ShapeQueryContext { + cpSpaceShapeQueryFunc func; + void *data; + cpBool anyCollision; +}; + +// Callback from the spatial hash. +static cpCollisionID +ShapeQuery(cpShape *a, cpShape *b, cpCollisionID id, struct ShapeQueryContext *context) +{ + if(cpShapeFilterReject(a->filter, b->filter) || a == b) return id; + + cpContactPointSet set = cpShapesCollide(a, b); + if(set.count){ + if(context->func) context->func(b, &set, context->data); + context->anyCollision = !(a->sensor || b->sensor); + } + + return id; +} + +cpBool +cpSpaceShapeQuery(cpSpace *space, cpShape *shape, cpSpaceShapeQueryFunc func, void *data) +{ + cpBody *body = shape->body; + cpBB bb = (body ? cpShapeUpdate(shape, body->transform) : shape->bb); + struct ShapeQueryContext context = {func, data, cpFalse}; + + cpSpaceLock(space); { + cpSpatialIndexQuery(space->dynamicShapes, shape, bb, (cpSpatialIndexQueryFunc)ShapeQuery, &context); + cpSpatialIndexQuery(space->staticShapes, shape, bb, (cpSpatialIndexQueryFunc)ShapeQuery, &context); + } cpSpaceUnlock(space, cpTrue); + + return context.anyCollision; +} diff --git a/external/Chipmunk/src/cpSpaceStep.c b/external/Chipmunk/src/cpSpaceStep.c new file mode 100644 index 0000000..78668b6 --- /dev/null +++ b/external/Chipmunk/src/cpSpaceStep.c @@ -0,0 +1,444 @@ +/* Copyright (c) 2007 Scott Lembcke + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +#include "chipmunk/chipmunk_private.h" + +//MARK: Post Step Callback Functions + +cpPostStepCallback * +cpSpaceGetPostStepCallback(cpSpace *space, void *key) +{ + cpArray *arr = space->postStepCallbacks; + for(int i=0; inum; i++){ + cpPostStepCallback *callback = (cpPostStepCallback *)arr->arr[i]; + if(callback && callback->key == key) return callback; + } + + return NULL; +} + +static void PostStepDoNothing(cpSpace *space, void *obj, void *data){} + +cpBool +cpSpaceAddPostStepCallback(cpSpace *space, cpPostStepFunc func, void *key, void *data) +{ + cpAssertWarn(space->locked, + "Adding a post-step callback when the space is not locked is unnecessary. " + "Post-step callbacks will not called until the end of the next call to cpSpaceStep() or the next query."); + + if(!cpSpaceGetPostStepCallback(space, key)){ + cpPostStepCallback *callback = (cpPostStepCallback *)cpcalloc(1, sizeof(cpPostStepCallback)); + callback->func = (func ? func : PostStepDoNothing); + callback->key = key; + callback->data = data; + + cpArrayPush(space->postStepCallbacks, callback); + return cpTrue; + } else { + return cpFalse; + } +} + +//MARK: Locking Functions + +void +cpSpaceLock(cpSpace *space) +{ + space->locked++; +} + +void +cpSpaceUnlock(cpSpace *space, cpBool runPostStep) +{ + space->locked--; + cpAssertHard(space->locked >= 0, "Internal Error: Space lock underflow."); + + if(space->locked == 0){ + cpArray *waking = space->rousedBodies; + + for(int i=0, count=waking->num; iarr[i]); + waking->arr[i] = NULL; + } + + waking->num = 0; + + if(space->locked == 0 && runPostStep && !space->skipPostStep){ + space->skipPostStep = cpTrue; + + cpArray *arr = space->postStepCallbacks; + for(int i=0; inum; i++){ + cpPostStepCallback *callback = (cpPostStepCallback *)arr->arr[i]; + cpPostStepFunc func = callback->func; + + // Mark the func as NULL in case calling it calls cpSpaceRunPostStepCallbacks() again. + // TODO: need more tests around this case I think. + callback->func = NULL; + if(func) func(space, callback->key, callback->data); + + arr->arr[i] = NULL; + cpfree(callback); + } + + arr->num = 0; + space->skipPostStep = cpFalse; + } + } +} + +//MARK: Contact Buffer Functions + +struct cpContactBufferHeader { + cpTimestamp stamp; + cpContactBufferHeader *next; + unsigned int numContacts; +}; + +#define CP_CONTACTS_BUFFER_SIZE ((CP_BUFFER_BYTES - sizeof(cpContactBufferHeader))/sizeof(struct cpContact)) +typedef struct cpContactBuffer { + cpContactBufferHeader header; + struct cpContact contacts[CP_CONTACTS_BUFFER_SIZE]; +} cpContactBuffer; + +static cpContactBufferHeader * +cpSpaceAllocContactBuffer(cpSpace *space) +{ + cpContactBuffer *buffer = (cpContactBuffer *)cpcalloc(1, sizeof(cpContactBuffer)); + cpArrayPush(space->allocatedBuffers, buffer); + return (cpContactBufferHeader *)buffer; +} + +static cpContactBufferHeader * +cpContactBufferHeaderInit(cpContactBufferHeader *header, cpTimestamp stamp, cpContactBufferHeader *splice) +{ + header->stamp = stamp; + header->next = (splice ? splice->next : header); + header->numContacts = 0; + + return header; +} + +void +cpSpacePushFreshContactBuffer(cpSpace *space) +{ + cpTimestamp stamp = space->stamp; + + cpContactBufferHeader *head = space->contactBuffersHead; + + if(!head){ + // No buffers have been allocated, make one + space->contactBuffersHead = cpContactBufferHeaderInit(cpSpaceAllocContactBuffer(space), stamp, NULL); + } else if(stamp - head->next->stamp > space->collisionPersistence){ + // The tail buffer is available, rotate the ring + cpContactBufferHeader *tail = head->next; + space->contactBuffersHead = cpContactBufferHeaderInit(tail, stamp, tail); + } else { + // Allocate a new buffer and push it into the ring + cpContactBufferHeader *buffer = cpContactBufferHeaderInit(cpSpaceAllocContactBuffer(space), stamp, head); + space->contactBuffersHead = head->next = buffer; + } +} + + +struct cpContact * +cpContactBufferGetArray(cpSpace *space) +{ + if(space->contactBuffersHead->numContacts + CP_MAX_CONTACTS_PER_ARBITER > CP_CONTACTS_BUFFER_SIZE){ + // contact buffer could overflow on the next collision, push a fresh one. + cpSpacePushFreshContactBuffer(space); + } + + cpContactBufferHeader *head = space->contactBuffersHead; + return ((cpContactBuffer *)head)->contacts + head->numContacts; +} + +void +cpSpacePushContacts(cpSpace *space, int count) +{ + cpAssertHard(count <= CP_MAX_CONTACTS_PER_ARBITER, "Internal Error: Contact buffer overflow!"); + space->contactBuffersHead->numContacts += count; +} + +static void +cpSpacePopContacts(cpSpace *space, int count){ + space->contactBuffersHead->numContacts -= count; +} + +//MARK: Collision Detection Functions + +static void * +cpSpaceArbiterSetTrans(cpShape **shapes, cpSpace *space) +{ + if(space->pooledArbiters->num == 0){ + // arbiter pool is exhausted, make more + int count = CP_BUFFER_BYTES/sizeof(cpArbiter); + cpAssertHard(count, "Internal Error: Buffer size too small."); + + cpArbiter *buffer = (cpArbiter *)cpcalloc(1, CP_BUFFER_BYTES); + cpArrayPush(space->allocatedBuffers, buffer); + + for(int i=0; ipooledArbiters, buffer + i); + } + + return cpArbiterInit((cpArbiter *)cpArrayPop(space->pooledArbiters), shapes[0], shapes[1]); +} + +static inline cpBool +QueryRejectConstraint(cpBody *a, cpBody *b) +{ + CP_BODY_FOREACH_CONSTRAINT(a, constraint){ + if( + !constraint->collideBodies && ( + (constraint->a == a && constraint->b == b) || + (constraint->a == b && constraint->b == a) + ) + ) return cpTrue; + } + + return cpFalse; +} + +static inline cpBool +QueryReject(cpShape *a, cpShape *b) +{ + return ( + // BBoxes must overlap + !cpBBIntersects(a->bb, b->bb) + // Don't collide shapes attached to the same body. + || a->body == b->body + // Don't collide shapes that are filtered. + || cpShapeFilterReject(a->filter, b->filter) + // Don't collide bodies if they have a constraint with collideBodies == cpFalse. + || QueryRejectConstraint(a->body, b->body) + ); +} + +// Callback from the spatial hash. +cpCollisionID +cpSpaceCollideShapes(cpShape *a, cpShape *b, cpCollisionID id, cpSpace *space) +{ + // Reject any of the simple cases + if(QueryReject(a,b)) return id; + + // Narrow-phase collision detection. + struct cpCollisionInfo info = cpCollide(a, b, id, cpContactBufferGetArray(space)); + + if(info.count == 0) return info.id; // Shapes are not colliding. + cpSpacePushContacts(space, info.count); + + // Get an arbiter from space->arbiterSet for the two shapes. + // This is where the persistant contact magic comes from. + const cpShape *shape_pair[] = {info.a, info.b}; + cpHashValue arbHashID = CP_HASH_PAIR((cpHashValue)info.a, (cpHashValue)info.b); + cpArbiter *arb = (cpArbiter *)cpHashSetInsert(space->cachedArbiters, arbHashID, shape_pair, (cpHashSetTransFunc)cpSpaceArbiterSetTrans, space); + cpArbiterUpdate(arb, &info, space); + + cpCollisionHandler *handler = arb->handler; + + // Call the begin function first if it's the first step + if(arb->state == CP_ARBITER_STATE_FIRST_COLLISION && !handler->beginFunc(arb, space, handler->userData)){ + cpArbiterIgnore(arb); // permanently ignore the collision until separation + } + + if( + // Ignore the arbiter if it has been flagged + (arb->state != CP_ARBITER_STATE_IGNORE) && + // Call preSolve + handler->preSolveFunc(arb, space, handler->userData) && + // Check (again) in case the pre-solve() callback called cpArbiterIgnored(). + arb->state != CP_ARBITER_STATE_IGNORE && + // Process, but don't add collisions for sensors. + !(a->sensor || b->sensor) && + // Don't process collisions between two infinite mass bodies. + !(a->body->m == INFINITY && b->body->m == INFINITY) + ){ + cpArrayPush(space->arbiters, arb); + } else { + cpSpacePopContacts(space, info.count); + + arb->contacts = NULL; + arb->count = 0; + + // Normally arbiters are set as used after calling the post-solve callback. + // However, post-solve() callbacks are not called for sensors or arbiters rejected from pre-solve. + if(arb->state != CP_ARBITER_STATE_IGNORE) arb->state = CP_ARBITER_STATE_NORMAL; + } + + // Time stamp the arbiter so we know it was used recently. + arb->stamp = space->stamp; + return info.id; +} + +// Hashset filter func to throw away old arbiters. +cpBool +cpSpaceArbiterSetFilter(cpArbiter *arb, cpSpace *space) +{ + cpTimestamp ticks = space->stamp - arb->stamp; + + cpBody *a = arb->body_a, *b = arb->body_b; + + // TODO: should make an arbiter state for this so it doesn't require filtering arbiters for dangling body pointers on body removal. + // Preserve arbiters on sensors and rejected arbiters for sleeping objects. + // This prevents errant separate callbacks from happenening. + if( + (cpBodyIsStatic(a) || cpBodyIsSleeping(a)) && + (cpBodyIsStatic(b) || cpBodyIsSleeping(b)) + ){ + return cpTrue; + } + + // Arbiter was used last frame, but not this one + if(ticks >= 1 && arb->state != CP_ARBITER_STATE_CACHED){ + arb->state = CP_ARBITER_STATE_CACHED; + cpCollisionHandler *handler = arb->handler; + handler->separateFunc(arb, space, handler->userData); + } + + if(ticks >= space->collisionPersistence){ + arb->contacts = NULL; + arb->count = 0; + + cpArrayPush(space->pooledArbiters, arb); + return cpFalse; + } + + return cpTrue; +} + +//MARK: All Important cpSpaceStep() Function + + void +cpShapeUpdateFunc(cpShape *shape, void *unused) +{ + cpShapeCacheBB(shape); +} + +void +cpSpaceStep(cpSpace *space, cpFloat dt) +{ + // don't step if the timestep is 0! + if(dt == 0.0f) return; + + space->stamp++; + + cpFloat prev_dt = space->curr_dt; + space->curr_dt = dt; + + cpArray *bodies = space->dynamicBodies; + cpArray *constraints = space->constraints; + cpArray *arbiters = space->arbiters; + + // Reset and empty the arbiter lists. + for(int i=0; inum; i++){ + cpArbiter *arb = (cpArbiter *)arbiters->arr[i]; + arb->state = CP_ARBITER_STATE_NORMAL; + + // If both bodies are awake, unthread the arbiter from the contact graph. + if(!cpBodyIsSleeping(arb->body_a) && !cpBodyIsSleeping(arb->body_b)){ + cpArbiterUnthread(arb); + } + } + arbiters->num = 0; + + cpSpaceLock(space); { + // Integrate positions + for(int i=0; inum; i++){ + cpBody *body = (cpBody *)bodies->arr[i]; + body->position_func(body, dt); + } + + // Find colliding pairs. + cpSpacePushFreshContactBuffer(space); + cpSpatialIndexEach(space->dynamicShapes, (cpSpatialIndexIteratorFunc)cpShapeUpdateFunc, NULL); + cpSpatialIndexReindexQuery(space->dynamicShapes, (cpSpatialIndexQueryFunc)cpSpaceCollideShapes, space); + } cpSpaceUnlock(space, cpFalse); + + // Rebuild the contact graph (and detect sleeping components if sleeping is enabled) + cpSpaceProcessComponents(space, dt); + + cpSpaceLock(space); { + // Clear out old cached arbiters and call separate callbacks + cpHashSetFilter(space->cachedArbiters, (cpHashSetFilterFunc)cpSpaceArbiterSetFilter, space); + + // Prestep the arbiters and constraints. + cpFloat slop = space->collisionSlop; + cpFloat biasCoef = 1.0f - cpfpow(space->collisionBias, dt); + for(int i=0; inum; i++){ + cpArbiterPreStep((cpArbiter *)arbiters->arr[i], dt, slop, biasCoef); + } + + for(int i=0; inum; i++){ + cpConstraint *constraint = (cpConstraint *)constraints->arr[i]; + + cpConstraintPreSolveFunc preSolve = constraint->preSolve; + if(preSolve) preSolve(constraint, space); + + constraint->klass->preStep(constraint, dt); + } + + // Integrate velocities. + cpFloat damping = cpfpow(space->damping, dt); + cpVect gravity = space->gravity; + for(int i=0; inum; i++){ + cpBody *body = (cpBody *)bodies->arr[i]; + body->velocity_func(body, gravity, damping, dt); + } + + // Apply cached impulses + cpFloat dt_coef = (prev_dt == 0.0f ? 0.0f : dt/prev_dt); + for(int i=0; inum; i++){ + cpArbiterApplyCachedImpulse((cpArbiter *)arbiters->arr[i], dt_coef); + } + + for(int i=0; inum; i++){ + cpConstraint *constraint = (cpConstraint *)constraints->arr[i]; + constraint->klass->applyCachedImpulse(constraint, dt_coef); + } + + // Run the impulse solver. + for(int i=0; iiterations; i++){ + for(int j=0; jnum; j++){ + cpArbiterApplyImpulse((cpArbiter *)arbiters->arr[j]); + } + + for(int j=0; jnum; j++){ + cpConstraint *constraint = (cpConstraint *)constraints->arr[j]; + constraint->klass->applyImpulse(constraint, dt); + } + } + + // Run the constraint post-solve callbacks + for(int i=0; inum; i++){ + cpConstraint *constraint = (cpConstraint *)constraints->arr[i]; + + cpConstraintPostSolveFunc postSolve = constraint->postSolve; + if(postSolve) postSolve(constraint, space); + } + + // run the post-solve callbacks + for(int i=0; inum; i++){ + cpArbiter *arb = (cpArbiter *) arbiters->arr[i]; + + cpCollisionHandler *handler = arb->handler; + handler->postSolveFunc(arb, space, handler->userData); + } + } cpSpaceUnlock(space, cpTrue); +} diff --git a/external/Chipmunk/src/cpSpatialIndex.c b/external/Chipmunk/src/cpSpatialIndex.c new file mode 100644 index 0000000..1fb74e2 --- /dev/null +++ b/external/Chipmunk/src/cpSpatialIndex.c @@ -0,0 +1,69 @@ +/* Copyright (c) 2010 Scott Lembcke + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +#include "chipmunk/chipmunk_private.h" + +void +cpSpatialIndexFree(cpSpatialIndex *index) +{ + if(index){ + cpSpatialIndexDestroy(index); + cpfree(index); + } +} + +cpSpatialIndex * +cpSpatialIndexInit(cpSpatialIndex *index, cpSpatialIndexClass *klass, cpSpatialIndexBBFunc bbfunc, cpSpatialIndex *staticIndex) +{ + index->klass = klass; + index->bbfunc = bbfunc; + index->staticIndex = staticIndex; + + if(staticIndex){ + cpAssertHard(!staticIndex->dynamicIndex, "This static index is already associated with a dynamic index."); + staticIndex->dynamicIndex = index; + } + + return index; +} + +typedef struct dynamicToStaticContext { + cpSpatialIndexBBFunc bbfunc; + cpSpatialIndex *staticIndex; + cpSpatialIndexQueryFunc queryFunc; + void *data; +} dynamicToStaticContext; + +static void +dynamicToStaticIter(void *obj, dynamicToStaticContext *context) +{ + cpSpatialIndexQuery(context->staticIndex, obj, context->bbfunc(obj), context->queryFunc, context->data); +} + +void +cpSpatialIndexCollideStatic(cpSpatialIndex *dynamicIndex, cpSpatialIndex *staticIndex, cpSpatialIndexQueryFunc func, void *data) +{ + if(staticIndex && cpSpatialIndexCount(staticIndex) > 0){ + dynamicToStaticContext context = {dynamicIndex->bbfunc, staticIndex, func, data}; + cpSpatialIndexEach(dynamicIndex, (cpSpatialIndexIteratorFunc)dynamicToStaticIter, &context); + } +} + diff --git a/external/Chipmunk/src/cpSweep1D.c b/external/Chipmunk/src/cpSweep1D.c new file mode 100644 index 0000000..6594c82 --- /dev/null +++ b/external/Chipmunk/src/cpSweep1D.c @@ -0,0 +1,254 @@ +/* Copyright (c) 2010 Scott Lembcke + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +#include "chipmunk/chipmunk_private.h" + +static inline cpSpatialIndexClass *Klass(); + +//MARK: Basic Structures + +typedef struct Bounds { + cpFloat min, max; +} Bounds; + +typedef struct TableCell { + void *obj; + Bounds bounds; +} TableCell; + +struct cpSweep1D +{ + cpSpatialIndex spatialIndex; + + int num; + int max; + TableCell *table; +}; + +static inline cpBool +BoundsOverlap(Bounds a, Bounds b) +{ + return (a.min <= b.max && b.min <= a.max); +} + +static inline Bounds +BBToBounds(cpSweep1D *sweep, cpBB bb) +{ + Bounds bounds = {bb.l, bb.r}; + return bounds; +} + +static inline TableCell +MakeTableCell(cpSweep1D *sweep, void *obj) +{ + TableCell cell = {obj, BBToBounds(sweep, sweep->spatialIndex.bbfunc(obj))}; + return cell; +} + +//MARK: Memory Management Functions + +cpSweep1D * +cpSweep1DAlloc(void) +{ + return (cpSweep1D *)cpcalloc(1, sizeof(cpSweep1D)); +} + +static void +ResizeTable(cpSweep1D *sweep, int size) +{ + sweep->max = size; + sweep->table = (TableCell *)cprealloc(sweep->table, size*sizeof(TableCell)); +} + +cpSpatialIndex * +cpSweep1DInit(cpSweep1D *sweep, cpSpatialIndexBBFunc bbfunc, cpSpatialIndex *staticIndex) +{ + cpSpatialIndexInit((cpSpatialIndex *)sweep, Klass(), bbfunc, staticIndex); + + sweep->num = 0; + ResizeTable(sweep, 32); + + return (cpSpatialIndex *)sweep; +} + +cpSpatialIndex * +cpSweep1DNew(cpSpatialIndexBBFunc bbfunc, cpSpatialIndex *staticIndex) +{ + return cpSweep1DInit(cpSweep1DAlloc(), bbfunc, staticIndex); +} + +static void +cpSweep1DDestroy(cpSweep1D *sweep) +{ + cpfree(sweep->table); + sweep->table = NULL; +} + +//MARK: Misc + +static int +cpSweep1DCount(cpSweep1D *sweep) +{ + return sweep->num; +} + +static void +cpSweep1DEach(cpSweep1D *sweep, cpSpatialIndexIteratorFunc func, void *data) +{ + TableCell *table = sweep->table; + for(int i=0, count=sweep->num; itable; + for(int i=0, count=sweep->num; inum == sweep->max) ResizeTable(sweep, sweep->max*2); + + sweep->table[sweep->num] = MakeTableCell(sweep, obj); + sweep->num++; +} + +static void +cpSweep1DRemove(cpSweep1D *sweep, void *obj, cpHashValue hashid) +{ + TableCell *table = sweep->table; + for(int i=0, count=sweep->num; inum; + + table[i] = table[num]; + table[num].obj = NULL; + + return; + } + } +} + +//MARK: Reindexing Functions + +static void +cpSweep1DReindexObject(cpSweep1D *sweep, void *obj, cpHashValue hashid) +{ + // Nothing to do here +} + +static void +cpSweep1DReindex(cpSweep1D *sweep) +{ + // Nothing to do here + // Could perform a sort, but queries are not accelerated anyway. +} + +//MARK: Query Functions + +static void +cpSweep1DQuery(cpSweep1D *sweep, void *obj, cpBB bb, cpSpatialIndexQueryFunc func, void *data) +{ + // Implementing binary search here would allow you to find an upper limit + // but not a lower limit. Probably not worth the hassle. + + Bounds bounds = BBToBounds(sweep, bb); + + TableCell *table = sweep->table; + for(int i=0, count=sweep->num; itable; + for(int i=0, count=sweep->num; ibounds.min < b->bounds.min ? -1 : (a->bounds.min > b->bounds.min ? 1 : 0)); +} + +static void +cpSweep1DReindexQuery(cpSweep1D *sweep, cpSpatialIndexQueryFunc func, void *data) +{ + TableCell *table = sweep->table; + int count = sweep->num; + + // Update bounds and sort + for(int i=0; ispatialIndex.staticIndex, func, data); +} + +static cpSpatialIndexClass klass = { + (cpSpatialIndexDestroyImpl)cpSweep1DDestroy, + + (cpSpatialIndexCountImpl)cpSweep1DCount, + (cpSpatialIndexEachImpl)cpSweep1DEach, + (cpSpatialIndexContainsImpl)cpSweep1DContains, + + (cpSpatialIndexInsertImpl)cpSweep1DInsert, + (cpSpatialIndexRemoveImpl)cpSweep1DRemove, + + (cpSpatialIndexReindexImpl)cpSweep1DReindex, + (cpSpatialIndexReindexObjectImpl)cpSweep1DReindexObject, + (cpSpatialIndexReindexQueryImpl)cpSweep1DReindexQuery, + + (cpSpatialIndexQueryImpl)cpSweep1DQuery, + (cpSpatialIndexSegmentQueryImpl)cpSweep1DSegmentQuery, +}; + +static inline cpSpatialIndexClass *Klass(){return &klass;} + diff --git a/external/Chipmunk/src/prime.h b/external/Chipmunk/src/prime.h new file mode 100644 index 0000000..419bdb8 --- /dev/null +++ b/external/Chipmunk/src/prime.h @@ -0,0 +1,68 @@ +/* Copyright (c) 2007 Scott Lembcke + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +// Used for resizing hash tables. +// Values approximately double. +// http://planetmath.org/encyclopedia/GoodHashTablePrimes.html +static int primes[] = { + 5, + 13, + 23, + 47, + 97, + 193, + 389, + 769, + 1543, + 3079, + 6151, + 12289, + 24593, + 49157, + 98317, + 196613, + 393241, + 786433, + 1572869, + 3145739, + 6291469, + 12582917, + 25165843, + 50331653, + 100663319, + 201326611, + 402653189, + 805306457, + 1610612741, + 0, +}; + +static inline int +next_prime(int n) +{ + int i = 0; + while(n > primes[i]){ + i++; + cpAssertHard(primes[i], "Tried to resize a hash table to a size greater than 1610612741 O_o"); // realistically this should never happen + } + + return primes[i]; +} diff --git a/external/Chipmunk/xcode/Benchmark/Benchmark-Info.plist b/external/Chipmunk/xcode/Benchmark/Benchmark-Info.plist new file mode 100644 index 0000000..7ff8f9e --- /dev/null +++ b/external/Chipmunk/xcode/Benchmark/Benchmark-Info.plist @@ -0,0 +1,45 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + net.Chipmunk2D..${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/external/Chipmunk/xcode/Benchmark/iPhoneBenchmarkMain.m b/external/Chipmunk/xcode/Benchmark/iPhoneBenchmarkMain.m new file mode 100644 index 0000000..a110941 --- /dev/null +++ b/external/Chipmunk/xcode/Benchmark/iPhoneBenchmarkMain.m @@ -0,0 +1,107 @@ +/* Copyright (c) 20013 Scott Lembcke + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +#import +#import +#import "chipmunk.h" + +#import "ChipmunkDemo.h" + +static void shapeFreeWrap(cpSpace *space, cpShape *shape, void *unused){ + cpSpaceRemoveShape(space, shape); + cpShapeFree(shape); +} + +static void postShapeFree(cpShape *shape, cpSpace *space){ + cpSpaceAddPostStepCallback(space, (cpPostStepFunc)shapeFreeWrap, shape, NULL); +} + +static void constraintFreeWrap(cpSpace *space, cpConstraint *constraint, void *unused){ + cpSpaceRemoveConstraint(space, constraint); + cpConstraintFree(constraint); +} + +static void postConstraintFree(cpConstraint *constraint, cpSpace *space){ + cpSpaceAddPostStepCallback(space, (cpPostStepFunc)constraintFreeWrap, constraint, NULL); +} + +static void bodyFreeWrap(cpSpace *space, cpBody *body, void *unused){ + cpSpaceRemoveBody(space, body); + cpBodyFree(body); +} + +static void postBodyFree(cpBody *body, cpSpace *space){ + cpSpaceAddPostStepCallback(space, (cpPostStepFunc)bodyFreeWrap, body, NULL); +} + +// Safe and future proof way to remove and free all objects that have been added to the space. +void +ChipmunkDemoFreeSpaceChildren(cpSpace *space) +{ + // Must remove these BEFORE freeing the body or you will access dangling pointers. + cpSpaceEachShape(space, (cpSpaceShapeIteratorFunc)postShapeFree, space); + cpSpaceEachConstraint(space, (cpSpaceConstraintIteratorFunc)postConstraintFree, space); + + cpSpaceEachBody(space, (cpSpaceBodyIteratorFunc)postBodyFree, space); +} + +void ChipmunkDemoDefaultDrawImpl(cpSpace *space){} + + +extern ChipmunkDemo bench_list[]; +extern int bench_count; + +#include +#include + +static double GetMilliseconds(){ + struct timeval time; + gettimeofday(&time, NULL); + + return (time.tv_sec*1000.0 + time.tv_usec/1000.0); +} + +static void time_trial(int index, int count) +{ + cpSpace *space = bench_list[index].initFunc(); + + double start_time = GetMilliseconds(); + + for(int i=0; i + + + + + + + + + + diff --git a/external/Chipmunk/xcode/Chipmunk7.xcodeproj/xcshareddata/xcdebugger/Breakpoints_v2.xcbkptlist b/external/Chipmunk/xcode/Chipmunk7.xcodeproj/xcshareddata/xcdebugger/Breakpoints_v2.xcbkptlist new file mode 100644 index 0000000..da42bb6 --- /dev/null +++ b/external/Chipmunk/xcode/Chipmunk7.xcodeproj/xcshareddata/xcdebugger/Breakpoints_v2.xcbkptlist @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + diff --git a/external/Chipmunk/xcode/ObjectiveChipmunkTests/BodyTest.m b/external/Chipmunk/xcode/ObjectiveChipmunkTests/BodyTest.m new file mode 100644 index 0000000..d085d89 --- /dev/null +++ b/external/Chipmunk/xcode/ObjectiveChipmunkTests/BodyTest.m @@ -0,0 +1,122 @@ +#import +#import "ObjectiveChipmunk.h" + +@interface UpdateTestBody : ChipmunkBody + +@property(nonatomic, assign) BOOL velocityUpdated; +@property(nonatomic, assign) BOOL positionUpdated; + +@end + + +@implementation UpdateTestBody + +-(void)updateVelocity:(cpFloat)dt gravity:(cpVect)gravity damping:(cpFloat)damping +{ + self.velocityUpdated = TRUE; +} + +-(void)updatePosition:(cpFloat)dt +{ + self.positionUpdated = TRUE; +} + +@end + + +@interface BodyTest : XCTestCase {} +@end + +@implementation BodyTest + +#define TestAccessors(o, p, v) o.p = v; XCTAssertEqual(o.p, v, @""); + +-(void)testProperties { + ChipmunkBody *body = [ChipmunkBody bodyWithMass:123 andMoment:123]; + XCTAssertEqual(body.mass, (cpFloat)123, @""); + XCTAssertEqual(body.moment, (cpFloat)123, @""); + + XCTAssertNotEqual(body.body, NULL, @""); + XCTAssertNil(body.userData, @""); + + TestAccessors(body, userData, @"object"); + TestAccessors(body, mass, (cpFloat)5); + TestAccessors(body, moment, (cpFloat)5); + TestAccessors(body, position, cpv(5,6)); + TestAccessors(body, velocity, cpv(5,6)); + TestAccessors(body, force, cpv(5,6)); + TestAccessors(body, angle, (cpFloat)5); + TestAccessors(body, angularVelocity, (cpFloat)5); + TestAccessors(body, torque, (cpFloat)5); + + body.angle = 0; + body.angle = M_PI; + body.angle = M_PI_2; + // TODO transform tests + + XCTAssertFalse(body.isSleeping, @""); + XCTAssertEqual(body.type, CP_BODY_TYPE_DYNAMIC, @""); +} + +-(void)testBasic { + ChipmunkBody *body = [ChipmunkBody bodyWithMass:1 andMoment:1]; + + [body applyForce:cpv(0,1) atWorldPoint:cpv(1,0)]; + XCTAssertTrue(body.force.y > 0, @""); + XCTAssertTrue(body.force.x == 0, @""); + XCTAssertTrue(body.torque > 0, @""); + + body.force = cpvzero; + body.torque = 0.0f; + XCTAssertEqual(body.force, cpvzero, @""); + XCTAssertEqual(body.torque, (cpFloat)0, @""); + + [body applyImpulse:cpv(0,1) atWorldPoint:cpv(1,0)]; + XCTAssertTrue(body.velocity.y > 0, @""); + XCTAssertTrue(body.velocity.x == 0, @""); + XCTAssertTrue(body.angularVelocity > 0, @""); +} + +-(void)testMisc { + ChipmunkBody *staticBody = [ChipmunkBody staticBody]; + XCTAssertFalse(staticBody.isSleeping, @""); + XCTAssertEqual(staticBody.type, CP_BODY_TYPE_STATIC, @""); + + ChipmunkSpace *space = [[ChipmunkSpace alloc] init]; + ChipmunkBody *body = [ChipmunkBody bodyWithMass:1 andMoment:1]; + [space add:body]; + XCTAssertFalse(body.isSleeping, @""); + XCTAssertEqual(body.type, CP_BODY_TYPE_DYNAMIC, @""); + + [body sleep]; + XCTAssertTrue(body.isSleeping, @""); + [space release]; +} + +-(void)testUpdate { + ChipmunkSpace *space = [[ChipmunkSpace alloc] init]; + UpdateTestBody *body = [space add:[UpdateTestBody bodyWithMass:1.0 andMoment:1.0]]; + + XCTAssertTrue(body.body->velocity_func != cpBodyUpdateVelocity, @"Did not set velocity integration callback."); + XCTAssertTrue(body.body->position_func != cpBodyUpdatePosition, @"Did not set position integration callback."); + + [space step:1.0]; + XCTAssertTrue(body.velocityUpdated, @"Did not call velocity integration callback."); + XCTAssertTrue(body.positionUpdated, @"Did not call position integration callback."); + + [space release]; +} + +-(void)testSpace { + ChipmunkSpace *space = [[ChipmunkSpace alloc] init]; + ChipmunkBody *body = [ChipmunkBody bodyWithMass:1.0 andMoment:1.0]; + + XCTAssertNil(body.space, @"body.space should be nil."); + + [space add:body]; + XCTAssertEqual(body.space, space, @"body.space should be nil."); + + [space release]; +} + +@end diff --git a/external/Chipmunk/xcode/ObjectiveChipmunkTests/CallbacksTest.m b/external/Chipmunk/xcode/ObjectiveChipmunkTests/CallbacksTest.m new file mode 100644 index 0000000..1b7a82c --- /dev/null +++ b/external/Chipmunk/xcode/ObjectiveChipmunkTests/CallbacksTest.m @@ -0,0 +1,476 @@ +#import +#import "ObjectiveChipmunk.h" + +@interface CallbacksTest : XCTestCase {} +@end + +@implementation CallbacksTest + +// TODO test callbacks trigger +// TODO test reject from begin +// TODO test reject from pre-solve +// TODO test sensors +// TODO test first collision +// TODO test post-step callbacks + +static cpBool +Begin(cpArbiter *arb, cpSpace *space, NSMutableString *string){ + [string appendString:@"Begin-"]; + + return cpTrue; +} + +static cpBool +PreSolve(cpArbiter *arb, cpSpace *space, NSMutableString *string){ + [string appendString:@"PreSolve-"]; + + return cpTrue; +} + +static void +PostSolve(cpArbiter *arb, cpSpace *space, NSMutableString *string){ + [string appendString:@"PostSolve-"]; +} + +static void +Separate(cpArbiter *arb, cpSpace *space, NSMutableString *string){ + [string appendString:@"Separate-"]; +} + +static void +testHandlersHelper(id self, bool separateByRemove, bool enableContactGraph){ + ChipmunkSpace *space = [[ChipmunkSpace alloc] init]; + space.collisionBias = 1.0f; + + cpFloat radius = 5; + + ChipmunkBody *body1 = [space add:[ChipmunkBody bodyWithMass:1 andMoment:1]]; + body1.position = cpv(0*radius*1.5,0); + + [space add:[ChipmunkCircleShape circleWithBody:body1 radius:radius offset:cpvzero]]; + + ChipmunkBody *body2 = [space add:[ChipmunkBody bodyWithMass:1 andMoment:1]]; + body2.position = cpv(1*radius*1.5,0); + + ChipmunkShape *shape2 = [space add:[ChipmunkCircleShape circleWithBody:body2 radius:radius offset:cpvzero]]; + + NSMutableString *string = [NSMutableString string]; + + cpCollisionHandler *handler = cpSpaceAddCollisionHandler(space.space, nil, nil); + handler->beginFunc = (cpCollisionBeginFunc)Begin, + handler->preSolveFunc = (cpCollisionPreSolveFunc)PreSolve, + handler->postSolveFunc = (cpCollisionPostSolveFunc)PostSolve, + handler->separateFunc = (cpCollisionSeparateFunc)Separate, + handler->userData = string; + + // Test for separate callback when moving: + [space step:0.1]; + XCTAssertEqualObjects(string, @"Begin-PreSolve-PostSolve-", @""); + + [space step:0.1]; + XCTAssertEqualObjects(string, @"Begin-PreSolve-PostSolve-PreSolve-PostSolve-", @""); + + if(separateByRemove){ + [space remove:shape2]; + } else { + body2.position = cpv(100, 100); + [space step:0.1]; + } + + XCTAssertEqualObjects(string, @"Begin-PreSolve-PostSolve-PreSolve-PostSolve-Separate-", @""); + + // Step once more to check for dangling pointers + [space step:0.1]; + + // Cleanup + [space release]; +} + +-(void)testHandlers { + testHandlersHelper(self, true, true); + testHandlersHelper(self, false, true); + testHandlersHelper(self, false, false); + testHandlersHelper(self, true, false); +} + +static void +testHandlersSleepingHelper(id self, int wakeRemoveType){ + ChipmunkSpace *space = [[ChipmunkSpace alloc] init]; + space.collisionBias = 1.0f; + space.sleepTimeThreshold = 0.15; + + NSString *type = @"type"; + cpFloat radius = 5; + + ChipmunkBody *body1 = [space add:[ChipmunkBody bodyWithMass:1 andMoment:1]]; + body1.position = cpv(0*radius*1.5,0); + + ChipmunkShape *shape1 = [space add:[ChipmunkCircleShape circleWithBody:body1 radius:radius offset:cpvzero]]; + shape1.collisionType = type; + + ChipmunkBody *body2 = [space add:[ChipmunkBody bodyWithMass:1 andMoment:1]]; + body2.position = cpv(1*radius*1.5,0); + + ChipmunkShape *shape2 = [space add:[ChipmunkCircleShape circleWithBody:body2 radius:radius offset:cpvzero]]; + shape2.collisionType = type; + + NSMutableString *string = [NSMutableString string]; + + cpCollisionHandler *handler = cpSpaceAddCollisionHandler(space.space, type, type); + handler->beginFunc = (cpCollisionBeginFunc)Begin, + handler->preSolveFunc = (cpCollisionPreSolveFunc)PreSolve, + handler->postSolveFunc = (cpCollisionPostSolveFunc)PostSolve, + handler->separateFunc = (cpCollisionSeparateFunc)Separate, + handler->userData = string; + + // Test for separate callback when moving: + [space step:0.1]; + XCTAssertEqualObjects(string, @"Begin-PreSolve-PostSolve-", @""); + + [space step:0.1]; + XCTAssertEqualObjects(string, @"Begin-PreSolve-PostSolve-PreSolve-", @""); + + [space step:0.1]; + XCTAssertEqualObjects(string, @"Begin-PreSolve-PostSolve-PreSolve-", @""); + + switch(wakeRemoveType){ + case 0: + // Separate by removal + [space remove:shape2]; + XCTAssertEqualObjects(string, @"Begin-PreSolve-PostSolve-PreSolve-Separate-", @""); + break; + case 1: + // Separate by move + body2.position = cpv(100, 100); + [space step:0.1]; + XCTAssertEqualObjects(string, @"Begin-PreSolve-PostSolve-PreSolve-Separate-", @""); + break; + + default:break; + } + + // Step once more to check for dangling pointers + [space step:0.1]; + + // Cleanup + [space release]; +} + +-(void)testHandlersSleeping { + testHandlersSleepingHelper(self, 0); + testHandlersSleepingHelper(self, 1); + + // BUG if the time threshold is less than dt the bodies fall asleep the same frame after being awoken + // Separate is not called because of the short circuit in cpSpaceArbiterSetFilter(). + // This is a weird edge case though as it's a really bad idea to use such a small threshold +} + +static void +testSleepingSensorCallbacksHelper(id self, int wakeRemoveType){ + ChipmunkSpace *space = [[ChipmunkSpace alloc] init]; + space.collisionBias = 1.0f; + space.sleepTimeThreshold = 0.15; + + cpFloat radius = 5; + + ChipmunkBody *body1 = [space add:[ChipmunkBody bodyWithMass:1 andMoment:1]]; + body1.position = cpv(0*radius*1.5,0); + + [space add:[ChipmunkCircleShape circleWithBody:body1 radius:radius offset:cpvzero]]; + + ChipmunkBody *body2 = [space add:[ChipmunkBody staticBody]]; + body2.position = cpv(1*radius*1.5,0); + + ChipmunkShape *shape2 = [space add:[ChipmunkCircleShape circleWithBody:body2 radius:radius offset:cpvzero]]; + shape2.sensor = true; + + NSMutableString *string = [NSMutableString string]; + + cpCollisionHandler *handler = cpSpaceAddCollisionHandler(space.space, nil, nil); + handler->beginFunc = (cpCollisionBeginFunc)Begin, + handler->preSolveFunc = (cpCollisionPreSolveFunc)PreSolve, + handler->postSolveFunc = (cpCollisionPostSolveFunc)PostSolve, + handler->separateFunc = (cpCollisionSeparateFunc)Separate, + handler->userData = string; + + // Test for separate callback when moving: + [space step:0.1]; + XCTAssertEqualObjects(string, @"Begin-PreSolve-", @""); + + [space step:0.1]; + XCTAssertEqualObjects(string, @"Begin-PreSolve-PreSolve-", @""); + + [space step:0.1]; + XCTAssertEqualObjects(string, @"Begin-PreSolve-PreSolve-", @""); + + switch(wakeRemoveType){ + case 0: + // Separate by removal + [space remove:shape2]; + XCTAssertEqualObjects(string, @"Begin-PreSolve-PreSolve-Separate-", @""); + break; + case 1: + // Separate by move + body1.position = cpv(100, 100); + [space step:0.1]; + XCTAssertEqualObjects(string, @"Begin-PreSolve-PreSolve-Separate-", @""); + break; + + default:break; + } + + // Step once more to check for dangling pointers + [space step:0.1]; + + // Cleanup + [space release]; +} + +-(void)testSleepingSensorCallbacks { + testSleepingSensorCallbacksHelper(self, 0); + testSleepingSensorCallbacksHelper(self, 1); +} + +static cpBool CallBlock(cpArbiter *arb, cpSpace *space, cpBool (^block)(cpArbiter *arb)){return block(arb);} + +-(void)testPostStepRemoval { + NSString *ballType = @"ballType"; + NSString *barType = @"barType"; + + ChipmunkSpace *space = [[ChipmunkSpace alloc] init]; + space.gravity = cpv(0, -100); + + // TODO + cpCollisionHandler *handler = cpSpaceAddCollisionHandler(space.space, ballType, barType); + handler->beginFunc = (cpCollisionBeginFunc)CallBlock, + handler->userData = ^(cpArbiter *arb){ + CHIPMUNK_ARBITER_GET_SHAPES(arb, ballShape, barShape); + [space addPostStepRemoval:barShape]; + + return TRUE; + }; + + ChipmunkShape *shape; + + // The ball will stop on this bar + shape = [space add:[ChipmunkSegmentShape segmentWithBody:space.staticBody from:cpv(-10,0) to:cpv(10,0) radius:1]]; + + // but remove this one + shape = [space add:[ChipmunkSegmentShape segmentWithBody:space.staticBody from:cpv(-10,2) to:cpv(10,2) radius:1]]; + shape.collisionType = barType; + + ChipmunkBody *ball = [space add:[ChipmunkBody bodyWithMass:1 andMoment:cpMomentForCircle(1, 0, 1, cpvzero)]]; + ball.position = cpv(0, 10); + + shape = [space add:[ChipmunkCircleShape circleWithBody:ball radius:1 offset:cpvzero]]; + shape.collisionType = ballType; + + for(int i=0; i<100; i++) [space step:0.01]; + + XCTAssertEqualWithAccuracy(ball.position.y, (cpFloat)2, 1.1*space.collisionSlop, @""); + + [space release]; +} + +// Make sure that adding a post step callback from inside a post step callback works correctly. +-(void)testPostStepFromPostStep +{ + ChipmunkSpace *space = [[ChipmunkSpace alloc] init]; + + ChipmunkShape *staticShape = [space add:[ChipmunkCircleShape circleWithBody:space.staticBody radius:1.0 offset:cpvzero]]; + staticShape.collisionType = staticShape; + + ChipmunkBody *body1 = [space add:[ChipmunkBody kinematicBody]]; + ChipmunkShape *shape1 = [space add:[ChipmunkCircleShape circleWithBody:body1 radius:1.0 offset:cpvzero]]; + shape1.collisionType = shape1; + shape1.sensor = TRUE; + + ChipmunkBody *body2 = [space add:[ChipmunkBody kinematicBody]]; + ChipmunkShape *shape2 = [space add:[ChipmunkCircleShape circleWithBody:body2 radius:10.0 offset:cpvzero]]; + shape2.collisionType = shape2; + shape2.sensor = TRUE; + + __block bool trigger1 = FALSE; + __block bool trigger2 = FALSE; + __block bool trigger3 = FALSE; + __block bool trigger4 = FALSE; + __block bool trigger5 = FALSE; + __block bool trigger6 = FALSE; + __block bool trigger7 = FALSE; + + cpCollisionHandler *handler1 = cpSpaceAddCollisionHandler(space.space, staticShape, shape1); + handler1->separateFunc = (cpCollisionSeparateFunc)CallBlock, + handler1->userData = ^(cpArbiter *arb){ + XCTAssertTrue(cpSpaceIsLocked(space.space), @""); + + // When body1 moves it will trigger the first separate callback. + [space addPostStepBlock:^{ + XCTAssertFalse(cpSpaceIsLocked(space.space), @""); + + // Calling remove will immediately trigger the next separate callback. + [space remove:shape1]; + + trigger2 = TRUE; + } key:shape1]; + + trigger1 = TRUE; + }; + + cpCollisionHandler *handler2 = cpSpaceAddCollisionHandler(space.space, shape1, shape2); + handler2->separateFunc = (cpCollisionSeparateFunc)CallBlock, + handler2->userData = ^(cpArbiter *arb){ + XCTAssertTrue(cpSpaceIsLocked(space.space), @""); + + // schedule a second post step callback within the old one with the same key. + // This one shouldn't be called. + [space addPostStepBlock:^{trigger4 = TRUE;} key:shape1]; + + trigger3 = TRUE; + }; + + cpCollisionHandler *handler3 = cpSpaceAddCollisionHandler(space.space, staticShape, shape2); + handler3->separateFunc = (cpCollisionSeparateFunc)CallBlock, + handler3->userData = ^(cpArbiter *arb){ + XCTAssertTrue(cpSpaceIsLocked(space.space), @""); + + [space addPostStepBlock:^{ + [space addPostStepBlock:^{trigger7 = TRUE;} key:shape2]; + + trigger6 = TRUE; + } key:shape2]; + + trigger5 = TRUE; + }; + + [space step:1.0]; + body1.position = cpv(10, 0); + [space step:1.0]; + + XCTAssertTrue(trigger1, @""); + XCTAssertTrue(trigger2, @""); + XCTAssertTrue(trigger3, @""); + XCTAssertFalse(trigger4, @""); + + [space remove:shape2]; + + XCTAssertTrue(trigger5, @""); + XCTAssertTrue(trigger6, @""); + XCTAssertFalse(trigger7, @""); + + [space release]; +} + +-(void)testBlockIterators { + ChipmunkSpace *space = [[ChipmunkSpace alloc] init]; + + ChipmunkShape *_staticShape = [ChipmunkCircleShape circleWithBody:space.staticBody radius:1.0 offset:cpvzero]; + + ChipmunkBody *_body = [ChipmunkBody bodyWithMass:1.0 andMoment:1.0]; + ChipmunkShape *_shape = [ChipmunkCircleShape circleWithBody:_body radius:1.0 offset:cpvzero]; + ChipmunkConstraint *_constraint = [ChipmunkPivotJoint pivotJointWithBodyA:space.staticBody bodyB:_body pivot:cpvzero]; + + { + __block int counter = 0; + + cpSpaceEachBody_b(space.space, ^(cpBody *body){ + XCTAssertEqual(body, _body, @""); + counter++; + }); + + cpSpaceEachShape_b(space.space, ^(cpShape *shape){ + if(cpBodyGetType(cpShapeGetBody(shape)) == CP_BODY_TYPE_STATIC){ + XCTAssertEqual(shape, _staticShape.shape, @""); + } else { + XCTAssertEqual(shape, _shape.shape, @""); + } + + counter++; + }); + + cpSpaceEachConstraint_b(space.space, ^(cpConstraint *constraint){ + XCTAssertEqual(constraint, _constraint.constraint, @""); + counter++; + }); + + + cpBodyEachShape_b(space.staticBody.body, ^(cpShape *shape){ + XCTAssertEqual(shape, _staticShape.shape, @""); + counter++; + }); + + cpBodyEachConstraint_b(space.staticBody.body, ^(cpConstraint *constraint){ + XCTAssertEqual(constraint, _constraint.constraint, @""); + counter++; + }); + + + cpBodyEachShape_b(_body.body, ^(cpShape *shape){ + XCTAssertEqual(shape, _shape.shape, @""); + counter++; + }); + + cpBodyEachConstraint_b(_body.body, ^(cpConstraint *constraint){ + XCTAssertEqual(constraint, _constraint.constraint, @""); + counter++; + }); + + XCTAssertEqual(counter, 0, @""); + } + + [space add:_staticShape]; + [space add:_body]; + [space add:_shape]; + [space add:_constraint]; + + { + __block int counter = 0; + + cpSpaceEachBody_b(space.space, ^(cpBody *body){ + XCTAssertEqual(body, _body.body, @""); + counter++; + }); + + cpSpaceEachShape_b(space.space, ^(cpShape *shape){ + if(cpBodyGetType(cpShapeGetBody(shape)) == CP_BODY_TYPE_STATIC){ + XCTAssertEqual(shape, _staticShape.shape, @""); + } else { + XCTAssertEqual(shape, _shape.shape, @""); + } + + counter++; + }); + + cpSpaceEachConstraint_b(space.space, ^(cpConstraint *constraint){ + XCTAssertEqual(constraint, _constraint.constraint, @""); + counter++; + }); + + + cpBodyEachShape_b(space.staticBody.body, ^(cpShape *shape){ + XCTAssertEqual(shape, _staticShape.shape, @""); + counter++; + }); + + cpBodyEachConstraint_b(space.staticBody.body, ^(cpConstraint *constraint){ + XCTAssertEqual(constraint, _constraint.constraint, @""); + counter++; + }); + + + cpBodyEachShape_b(_body.body, ^(cpShape *shape){ + XCTAssertEqual(shape, _shape.shape, @""); + counter++; + }); + + cpBodyEachConstraint_b(_body.body, ^(cpConstraint *constraint){ + XCTAssertEqual(constraint, _constraint.constraint, @""); + counter++; + }); + + XCTAssertEqual(counter, 8, @""); + } + + [space release]; +} + +@end diff --git a/external/Chipmunk/xcode/ObjectiveChipmunkTests/ConvexTest.m b/external/Chipmunk/xcode/ObjectiveChipmunkTests/ConvexTest.m new file mode 100644 index 0000000..ca6fd6b --- /dev/null +++ b/external/Chipmunk/xcode/ObjectiveChipmunkTests/ConvexTest.m @@ -0,0 +1,222 @@ +#import +#import "ObjectiveChipmunk.h" + +@interface ConvexTest : XCTestCase {} +@end + +@implementation ConvexTest + +//MARK: QuickHull tests + +static inline cpFloat frand(void){return (cpFloat)rand()/(cpFloat)RAND_MAX;} + +static int +FirstExpected(int expectedCount, cpVect *expectedVerts, cpVect *verts) +{ + for(int i=0; i= 0.0f, @""); + XCTAssertTrue(cpAreaForPoly(resultCount, resultVerts, 0.0f) >= 0.0f, @""); + + XCTAssertEqual(resultVerts[0], rotated[first], @""); + + AssertExpected(self, resultVerts, expectedCount, expectedVerts); + AssertHullsEqual(self, resultCount, resultVerts); + } +} + +static void +AssertRandomHull(id self, int count) +{ + cpVect verts[count]; + for(int i=0; i 0.0f, @""); +} + +-(void)testConvexHull +{ + { + // Trivial cases, reversed windings up to a square. + cpVect verts[] = {{0,0}, {1,0}}; + cpVect expected[] = {{0,0}, {1,0}}; + + AssertHull(self, 1, verts, 1, expected); + AssertHull(self, 2, verts, 2, expected); + } + + { + cpVect verts[] = {{0,0}, {1,1}, {1,0}}; + cpVect expected[] = {{0,0}, {1,0}, {1,1}}; + + AssertHull(self, 3, verts, 3, expected); + } + + { + cpVect verts[] = {{0,0}, {0,1}, {1,1}, {1,0}}; + cpVect expected[] = {{0,0}, {1,0}, {1,1}, {0,1}}; + + AssertHull(self, 4, verts, 4, expected); + } + + { + // Degenerate hourglass shaped square. + cpVect verts[] = {{0,0}, {1,0}, {0,1}, {1,1}}; + cpVect expected[] = {{0,0}, {1,0}, {1,1}, {0,1}}; + + AssertHull(self, 4, verts, 4, expected); + } + + { + // A unit square and a bunch of random vertexes inside it. + cpVect verts[] = { + {0.9, 0.5}, {0.2, 0.3}, {1.0, 0.0}, {0.8, 0.6}, {0.8, 0.4}, {0.1, 0.4}, + {0.4, 0.1}, {0.0, 0.0}, {0.1, 0.9}, {0.9, 0.6}, {0.6, 0.2}, {0.7, 0.3}, + {0.1, 0.3}, {0.1, 0.5}, {0.8, 0.3}, {0.3, 0.8}, {0.0, 1.0}, {0.6, 0.7}, + {1.0, 1.0}, {0.6, 0.8}, {0.1, 0.7}, {0.7, 0.9}, {0.9, 0.2}, {0.1, 0.1} + }; + cpVect expected[] = {{0,0}, {1,0}, {1,1}, {0,1}}; + + AssertHull(self, 24, verts, 4, expected); + } + + { + // A bunch of colinear points on X + cpVect verts[] = {{0,0}, {0,1}, {0,2}, {0,3}, {0,4}, {0,5}}; + cpVect expected[] = {{0,0}, {0,5}}; + + AssertHull(self, 6, verts, 2, expected); + } + + { + // A bunch of colinear points on Y + cpVect verts[] = {{0,0}, {1,0}, {2,0}, {3,0}, {4,0}, {5,0}}; + cpVect expected[] = {{0,0}, {5,0}}; + + AssertHull(self, 6, verts, 2, expected); + } + + { + // A bunch of colinear points on XY + cpVect verts[] = {{0,0}, {1,1}, {2,2}, {3,3}, {4,4}, {5,5}}; + cpVect expected[] = {{0,0}, {5,5}}; + + AssertHull(self, 6, verts, 2, expected); + } + + { + // A bunch of equivalent points + cpVect verts[] = {{0,0}, {0,0}, {0,0}, {0,0}, {0,0}}; + cpVect expected[] = {{0,0}}; + + AssertHull(self, 1, verts, 1, expected); + AssertHull(self, 2, verts, 1, expected); + AssertHull(self, 3, verts, 1, expected); + AssertHull(self, 4, verts, 1, expected); + AssertHull(self, 5, verts, 1, expected); + } + + { + // Unit square with reversed winding and colinear face points. + cpVect verts[] = { + {1.0f, 0.0f}, {1.0f, 0.5f}, {1.0f, 1.0f}, {0.5f, 1.0f}, + {0.0f, 1.0f}, {0.0f, 0.5f}, {0.0f, 0.0f}, {0.5f, 0.0f}, + }; + cpVect expected[] = {{0,0}, {1,0}, {1,1}, {0,1}}; + + AssertHull(self, 8, verts, 4, expected); + } + + { + // Unit square with duplicate vertexes. + cpVect verts1[] = {{0,0}, {0,1}, {1,1}, {1,0}, {0,0}, {0,1}, {1,1}, {1,0}}; + cpVect verts2[] = {{0,0}, {0,0}, {0,1}, {0,1}, {1,1}, {1,1}, {1,0}, {1,0}}; + cpVect expected[] = {{0,0}, {1,0}, {1,1}, {0,1}}; + + AssertHull(self, 8, verts1, 4, expected); + AssertHull(self, 8, verts2, 4, expected); + } + + // Check that a convex hull returns itself using (seeded) random hulls. + srand(5594); + AssertRandomHull(self, 100); + AssertRandomHull(self, 1000); + AssertRandomHull(self, 10000); + + // TODO Need tolerance tests. +} + +-(void)testValidate +{ + cpVect a = cpv(3.354, 2.546); + cpVect b = cpv(55.213, 77.1232); + + int numVerts = 113; +// cpVect verts[] = {a, cpvadd(cpvlerp(a, b, 0.5), cpv(0, -1e-7)), b}; + + cpVect verts[numVerts]; + for(int i=0; i= 0.0f, @""); +} + +@end diff --git a/external/Chipmunk/xcode/ObjectiveChipmunkTests/MemoryTest.m b/external/Chipmunk/xcode/ObjectiveChipmunkTests/MemoryTest.m new file mode 100644 index 0000000..a6aa3db --- /dev/null +++ b/external/Chipmunk/xcode/ObjectiveChipmunkTests/MemoryTest.m @@ -0,0 +1,158 @@ +#import + +#define CP_ALLOW_PRIVATE_ACCESS 1 +#import "ObjectiveChipmunk.h" + +#define AssertRetainCount(obj, count) XCTAssertEqual([obj retainCount], (NSUInteger)count, @"") + +@interface MemoryTest : XCTestCase {} +@end + +@implementation MemoryTest + +-(void)testBasic { + ChipmunkSpace *space = [[ChipmunkSpace alloc] init]; + + ChipmunkBody *body1 = [[ChipmunkBody alloc] initWithMass:1 andMoment:1]; + ChipmunkBody *body2 = [[ChipmunkBody alloc] initWithMass:1 andMoment:1]; + + ChipmunkShape *shape1 = [[ChipmunkCircleShape alloc] initWithBody:body1 radius:1 offset:cpvzero]; + ChipmunkShape *shape2 = [[ChipmunkCircleShape alloc] initWithBody:body2 radius:1 offset:cpvzero]; + + ChipmunkConstraint *joint1 = [[ChipmunkPivotJoint alloc] initWithBodyA:body1 bodyB:body2 pivot:cpvzero]; + ChipmunkConstraint *joint2 = [[ChipmunkPivotJoint alloc] initWithBodyA:body1 bodyB:body2 pivot:cpvzero]; + + [space add:body1]; + [space add:body2]; + [space add:shape1]; + [space add:shape2]; + [space add:joint1]; + [space add:joint2]; + + AssertRetainCount(body1, 5); + AssertRetainCount(body2, 5); + AssertRetainCount(shape1, 2); + AssertRetainCount(shape2, 2); + AssertRetainCount(joint1, 2); + AssertRetainCount(joint2, 2); + + [space remove:shape1]; + [space remove:joint1]; + + AssertRetainCount(body1, 5); + AssertRetainCount(body2, 5); + AssertRetainCount(shape1, 1); + AssertRetainCount(shape2, 2); + AssertRetainCount(joint1, 1); + AssertRetainCount(joint2, 2); + + [space release]; + + AssertRetainCount(body1, 4); + AssertRetainCount(body2, 4); + AssertRetainCount(shape1, 1); + AssertRetainCount(shape2, 1); + AssertRetainCount(joint1, 1); + AssertRetainCount(joint2, 1); + + [joint1 release]; + [joint2 release]; + + AssertRetainCount(body1, 2); + AssertRetainCount(body2, 2); + + [shape1 release]; + [shape2 release]; + + AssertRetainCount(body1, 1); + AssertRetainCount(body2, 1); + + [body1 release]; + [body2 release]; +} + +-(void)testStaticBody { + ChipmunkSpace *space = [[ChipmunkSpace alloc] init]; + ChipmunkBody *staticBody = space.staticBody; + + AssertRetainCount(staticBody, 1); + + ChipmunkShape *shape = [[ChipmunkCircleShape alloc] initWithBody:space.staticBody radius:1 offset:cpvzero]; + AssertRetainCount(staticBody, 2); + + [space add:shape]; + AssertRetainCount(shape, 2); + AssertRetainCount(staticBody, 2); + + [space release]; + AssertRetainCount(shape, 1); + AssertRetainCount(staticBody, 1); + + [shape release]; +} + +-(void)testSetters { + ChipmunkBody *body = [[ChipmunkBody alloc] initWithMass:1.0 andMoment:1.0]; + + + ChipmunkShape *shape = [ChipmunkCircleShape circleWithBody:nil radius:1 offset:cpvzero]; + shape.body = body; + AssertRetainCount(body, 2); + + shape.body = body; + AssertRetainCount(body, 2); + + shape.body = nil; + AssertRetainCount(body, 1); + + +// ChipmunkConstraint *joint = [ChipmunkPivotJoint pivotJointWithBodyA:nil bodyB:nil pivot:cpvzero]; +// joint.bodyA = body; joint.bodyB = body; +// AssertRetainCount(body, 3); +// +// joint.bodyA = body; joint.bodyB = body; +// AssertRetainCount(body, 3); +// +// joint.bodyA = nil; joint.bodyB = nil; +// AssertRetainCount(body, 1); +} + +-(void)testPostStepCallbacks { + ChipmunkSpace *space = [[ChipmunkSpace alloc] init]; + NSObject *obj1 = [[NSObject alloc] init]; + NSObject *obj2 = [[NSObject alloc] init]; + + // Lock the space to avoid triggering warnings. + cpSpaceLock(space.space); + + // Registering the callback should retain the object twice + XCTAssertTrue([space addPostStepCallback:obj1 selector:@selector(isEqual:) key:obj1], @""); + AssertRetainCount(obj1, 3); + + // Registering the same callback a second time should not add more retains + XCTAssertFalse([space addPostStepCallback:obj1 selector:@selector(isEqual:) key:obj1], @""); + AssertRetainCount(obj1, 3); + + // A key can only be registered once to prevent double removals. + // Registering a second target with the same key is a no-op. + XCTAssertFalse([space addPostStepCallback:obj2 selector:@selector(isEqual:) key:obj1], @""); + AssertRetainCount(obj1, 3); + AssertRetainCount(obj2, 1); + + XCTAssertTrue([space addPostStepCallback:obj1 selector:@selector(isEqual:) key:obj2], @""); + AssertRetainCount(obj1, 4); + AssertRetainCount(obj2, 2); + + cpSpaceUnlock(space.space, FALSE); + + // Stepping the space should release the callback handler and both objects + [space step:1]; + AssertRetainCount(obj1, 1); + AssertRetainCount(obj2, 1); + + [space release]; + [obj1 release]; + [obj2 release]; +} + +@end diff --git a/external/Chipmunk/xcode/ObjectiveChipmunkTests/MiscTest.m b/external/Chipmunk/xcode/ObjectiveChipmunkTests/MiscTest.m new file mode 100644 index 0000000..384293a --- /dev/null +++ b/external/Chipmunk/xcode/ObjectiveChipmunkTests/MiscTest.m @@ -0,0 +1,142 @@ +#import +#import "ObjectiveChipmunk.h" + + +@interface MiscTest : XCTestCase {} +@end + +@implementation MiscTest + +#define AssertNearlyZero(__exp__) XCTAssertTrue((__exp__) < 1e-5, @"") + +-(void)testSlerp { + { + cpVect a = cpvmult(cpvforangle(0.0), 1.0); + cpVect b = cpvmult(cpvforangle(1.0), 1.0); + cpVect c = a; + cpVect v = cpvslerp(a, b, 0.0); + AssertNearlyZero(cpvdist(v, c)); + } + + { + cpVect a = cpvmult(cpvforangle(0.0), 1.0); + cpVect b = cpvmult(cpvforangle(1.0), 1.0); + cpVect c = b; + cpVect v = cpvslerp(a, b, 1.0); + AssertNearlyZero(cpvdist(v, c)); + } + + { + cpVect a = cpvmult(cpvforangle(0.0), 1.0); + cpVect b = cpvmult(cpvforangle(1.0), 1.0); + cpVect c = cpvmult(cpvforangle(0.5), 1.0); + cpVect v = cpvslerp(a, b, 0.5); + AssertNearlyZero(cpvdist(v, c)); + } + + { + cpVect a = cpvmult(cpvforangle(-1.0), 1.0); + cpVect b = cpvmult(cpvforangle( 1.0), 1.0); + cpVect c = cpvmult(cpvforangle( 0.0), 1.0); + cpVect v = cpvslerp(a, b, 0.5); + AssertNearlyZero(cpvdist(v, c)); + } + + { + cpVect a = cpvmult(cpvforangle(0.0), 1.0); + cpVect b = cpvmult(cpvforangle(M_PI/2.0), 2.0); + cpVect c = cpvadd(cpvmult(a, cpfcos(M_PI/4.0)), cpvmult(b, cpfsin(M_PI/4.0))); + cpVect v = cpvslerp(a, b, 0.5); + AssertNearlyZero(cpvdist(v, c)); + } + + { + cpVect a = cpvmult(cpvforangle(0.0), 1.0); + cpVect b = a; + cpVect c = a; + cpVect v = cpvslerp(a, b, 0.5); + AssertNearlyZero(cpvdist(v, c)); + } + + // TODO should it handle this? +// { +// cpVect a = cpv( 1.0, 0.01); +// cpVect b = cpv(-1.0, 0.0); +// cpVect v = cpvslerp(a, b, 0.5); +// GHAssertLessThan(cpvdot(a, v)); +// GHAssertLessThan(cpvdot(b, v)); +// GHAssertLessThan(cpvlength(v) - 1.0); +// } + + // Slerp const + { + cpVect a = cpvmult(cpvforangle(0.0), 1.0); + cpVect b = cpvmult(cpvforangle(M_PI/2.0), 1.0); + cpVect c = cpvadd(cpvmult(a, cpfcos(M_PI/4.0)), cpvmult(b, cpfsin(M_PI/4.0))); + cpVect v = cpvslerpconst(a, b, M_PI/4.0); + AssertNearlyZero(cpvdist(v, c)); + } + + { + cpVect a = cpvmult(cpvforangle(0.0), 1.0); + cpVect b = cpvmult(cpvforangle(M_PI/2.0), 1.0); + cpVect c = b; + cpVect v = cpvslerpconst(a, b, M_PI/2.0); + AssertNearlyZero(cpvdist(v, c)); + } + + { + cpVect a = cpvmult(cpvforangle(0.0), 1.0); + cpVect b = cpvmult(cpvforangle(M_PI/2.0), 1.0); + cpVect c = b; + cpVect v = cpvslerpconst(a, b, INFINITY); + AssertNearlyZero(cpvdist(v, c)); + } + + { + cpVect a = cpvmult(cpvforangle(0.0), 1.0); + cpVect b = cpvmult(cpvforangle(M_PI/2.0), 1.0); + cpVect c = a; + cpVect v = cpvslerpconst(a, b, 0); + AssertNearlyZero(cpvdist(v, c)); + } + + { + cpVect a = cpvmult(cpvforangle(0.0), 1.0); + cpVect b = cpvmult(cpvforangle(M_PI/2.0), 1.0); + cpVect c = cpvmult(cpvforangle(M_PI/4.0), 1.0); + cpVect v = cpvslerpconst(a, b, M_PI/4.0); + AssertNearlyZero(cpvdist(v, c)); + } +} + +-(void)testMultiGrabSort +{ + ChipmunkSpace *space = [[ChipmunkSpace alloc] init]; + ChipmunkMultiGrab *multiGrab = [[ChipmunkMultiGrab alloc] initForSpace:space withSmoothing:0.0 withGrabForce:1.0]; + + ChipmunkBody *body = [space add:[ChipmunkBody bodyWithMass:1.0 andMoment:1.0]]; + ChipmunkShape *big = [space add:[ChipmunkCircleShape circleWithBody:body radius:10.0 offset:cpvzero]]; + ChipmunkShape *small = [space add:[ChipmunkCircleShape circleWithBody:body radius:5.0 offset:cpvzero]]; + + // Used for the custom sorting orders. + big.userData = @0; + small.userData = @1; + + ChipmunkGrab *grab1 = [multiGrab beginLocation:cpvzero]; + XCTAssertEqual(grab1.grabbedShape, big, @"Should have grabbed 'big' since it has the largest penetration depth."); + + multiGrab.grabSort = ^(ChipmunkShape *shape, cpFloat depth){ + NSNumber *n = shape.userData; + return (cpFloat)n.floatValue; + }; + + // Should grab small since it's sorting order will be the largest; + ChipmunkGrab *grab2 = [multiGrab beginLocation:cpvzero]; + XCTAssertEqual(grab2.grabbedShape, small, @"Should have grabbed 'small' since it has the highest custom sort value."); + + [multiGrab release]; + [space release]; +} + +@end diff --git a/external/Chipmunk/xcode/ObjectiveChipmunkTests/ObjectiveChipmunkTests-Info.plist b/external/Chipmunk/xcode/ObjectiveChipmunkTests/ObjectiveChipmunkTests-Info.plist new file mode 100644 index 0000000..f51daef --- /dev/null +++ b/external/Chipmunk/xcode/ObjectiveChipmunkTests/ObjectiveChipmunkTests-Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + net.Chipmunk2D..${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/external/Chipmunk/xcode/ObjectiveChipmunkTests/ShapeTest.m b/external/Chipmunk/xcode/ObjectiveChipmunkTests/ShapeTest.m new file mode 100644 index 0000000..c859de8 --- /dev/null +++ b/external/Chipmunk/xcode/ObjectiveChipmunkTests/ShapeTest.m @@ -0,0 +1,75 @@ +#import +#import "ObjectiveChipmunk.h" + +@interface ShapeTest : XCTestCase {} +@end + +@implementation ShapeTest + +#define TestAccessors(o, p, v) o.p = v; XCTAssertEqual(o.p, v, @""); + +static void +testPropertiesHelper(id self, ChipmunkBody *body, ChipmunkShape *shape) +{ + XCTAssertNotEqual(shape.shape, NULL, @""); + XCTAssertEqual(body, shape.body, @""); + XCTAssertNil(shape.userData, @""); + XCTAssertFalse(shape.sensor, @""); + XCTAssertEqual(shape.elasticity, (cpFloat)0, @""); + XCTAssertEqual(shape.friction, (cpFloat)0, @""); + XCTAssertEqual(shape.surfaceVelocity, cpvzero, @""); + XCTAssertNil(shape.collisionType, @""); + XCTAssertNil(shape.group, @""); + XCTAssertEqual(shape.filter, CP_SHAPE_FILTER_ALL, @""); + + cpBB bb = [shape cacheBB]; + XCTAssertEqual(shape.bb, bb, @""); + + TestAccessors(shape, userData, @"object"); + TestAccessors(shape, sensor, YES); + TestAccessors(shape, elasticity, (cpFloat)0); + TestAccessors(shape, friction, (cpFloat)0); + TestAccessors(shape, surfaceVelocity, cpv(5,6)); + TestAccessors(shape, collisionType, @"type"); + cpShapeFilter f = {@"group", 456, 789}; + TestAccessors(shape, filter, f); +} + +-(void)testProperties { + ChipmunkBody *body = [ChipmunkBody bodyWithMass:1 andMoment:1]; + + ChipmunkCircleShape *circle = [ChipmunkCircleShape circleWithBody:body radius:1 offset:cpv(1,2)]; + testPropertiesHelper(self, body, circle); + XCTAssertEqual(circle.radius, (cpFloat)1, @""); + XCTAssertEqual(circle.offset, cpv(1,2), @""); + + XCTAssertTrue([circle pointQuery:cpv(1,2)].distance <= 0.0f, @""); + XCTAssertTrue([circle pointQuery:cpv(1,2.9)].distance <= 0.0f, @""); + XCTAssertFalse([circle pointQuery:cpv(1,3.1)].distance <= 0.0f, @""); + + + ChipmunkSegmentShape *segment = [ChipmunkSegmentShape segmentWithBody:body from:cpvzero to:cpv(1,0) radius:1]; + testPropertiesHelper(self, body, segment); + XCTAssertEqual(segment.a, cpvzero, @""); + XCTAssertEqual(segment.b, cpv(1,0), @""); + XCTAssertEqual(segment.normal, cpv(0,-1), @""); + + XCTAssertTrue([segment pointQuery:cpvzero].distance <= 0.0f, @""); + XCTAssertTrue([segment pointQuery:cpv(1,0)].distance <= 0.0f, @""); + XCTAssertTrue([segment pointQuery:cpv(0.5, 0.5)].distance <= 0.0f, @""); + XCTAssertFalse([segment pointQuery:cpv(0,3)].distance <= 0.0f, @""); + + ChipmunkPolyShape *poly = [ChipmunkPolyShape boxWithBody:body width:10 height:10 radius:0.0f]; + testPropertiesHelper(self, body, poly); + XCTAssertTrue([poly pointQuery:cpv(0,0)].distance <= 0.0f, @""); + XCTAssertTrue([poly pointQuery:cpv(3,3)].distance <= 0.0f, @""); + XCTAssertFalse([poly pointQuery:cpv(-10,0)].distance <= 0.0f, @""); + + // TODO should add segment query tests +} + +-(void)testSpace { + // TODO +} + +@end diff --git a/external/Chipmunk/xcode/ObjectiveChipmunkTests/SpaceTest.m b/external/Chipmunk/xcode/ObjectiveChipmunkTests/SpaceTest.m new file mode 100644 index 0000000..b4e3d59 --- /dev/null +++ b/external/Chipmunk/xcode/ObjectiveChipmunkTests/SpaceTest.m @@ -0,0 +1,386 @@ +#import + +#define CP_ALLOW_PRIVATE_ACCESS 1 +#import "ObjectiveChipmunk.h" + +@interface SpaceTest : XCTestCase {} +@end + +@implementation SpaceTest + +#define TestAccessors(o, p, v) o.p = v; XCTAssertEqual(o.p, v, @""); +#define AssertRetainCount(obj, count) XCTAssertEqual([obj retainCount], (NSUInteger)count, @"") + +-(void)testProperties { + ChipmunkSpace *space = [[ChipmunkSpace alloc] init]; + XCTAssertEqual(space.gravity, cpvzero, @""); + XCTAssertEqual(space.damping, (cpFloat)1.0, @""); + XCTAssertEqual(space.idleSpeedThreshold, (cpFloat)0, @""); + XCTAssertEqual(space.sleepTimeThreshold, (cpFloat)INFINITY, @""); + + XCTAssertNotEqual(space.space, NULL, @""); + XCTAssertNotNil(space.staticBody, @""); + + TestAccessors(space, iterations, 50); + TestAccessors(space, gravity, cpv(1,2)); + TestAccessors(space, damping, (cpFloat)5); + TestAccessors(space, idleSpeedThreshold, (cpFloat)5); + TestAccessors(space, sleepTimeThreshold, (cpFloat)5); + + [space release]; +} + +static NSSet * +pointQueryInfoToShapes(NSArray *arr) +{ + NSMutableSet *set = [NSMutableSet setWithCapacity:[arr count]]; + for(ChipmunkPointQueryInfo *info in arr)[set addObject:info.shape]; + return set; +} + +static NSSet * +segmentQueryInfoToShapes(NSArray *arr) +{ + NSMutableSet *set = [NSMutableSet setWithCapacity:[arr count]]; + for(ChipmunkSegmentQueryInfo *info in arr)[set addObject:info.shape]; + return set; +} + +static NSSet * +shapeQueryInfoToShapes(NSArray *arr) +{ + NSMutableSet *set = [NSMutableSet setWithCapacity:[arr count]]; + for(ChipmunkShapeQueryInfo *info in arr)[set addObject:info.shape]; + return set; +} + +static void +testPointQueries_helper(id self, ChipmunkSpace *space, ChipmunkBody *body) +{ + ChipmunkShape *circle = [space add:[[ChipmunkCircleShape alloc] initWithBody:body radius:1 offset:cpv(1,1)]]; + ChipmunkShape *segment = [space add:[[ChipmunkSegmentShape alloc] initWithBody:body from:cpvzero to:cpv(1,1) radius:1]]; + ChipmunkShape *box = [space add:[[ChipmunkPolyShape alloc] initBoxWithBody:body width:1 height:1 radius:0]]; + + NSSet *set; + NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; + + // Point queries + set = pointQueryInfoToShapes([space pointQueryAll:cpvzero maxDistance:0.0 filter:CP_SHAPE_FILTER_ALL]); + XCTAssertEqualObjects(set, ([NSSet setWithObjects:segment, box, nil]), @""); + + set = pointQueryInfoToShapes([space pointQueryAll:cpv(1,1) maxDistance:0.0 filter:CP_SHAPE_FILTER_ALL]); + XCTAssertEqualObjects(set, ([NSSet setWithObjects:circle, segment, nil]), @""); + + set = pointQueryInfoToShapes([space pointQueryAll:cpv(0.4, 0.4) maxDistance:0.0 filter:CP_SHAPE_FILTER_ALL]); + XCTAssertEqualObjects(set, ([NSSet setWithObjects:circle, segment, box, nil]), @""); + + set = pointQueryInfoToShapes([space pointQueryAll:cpv(-0.5, -0.5) maxDistance:0.0 filter:CP_SHAPE_FILTER_ALL]); + XCTAssertEqualObjects(set, ([NSSet setWithObjects:segment, nil]), @""); + + set = pointQueryInfoToShapes([space pointQueryAll:cpv(-1,-1) maxDistance:0.0 filter:CP_SHAPE_FILTER_ALL]); + XCTAssertEqualObjects(set, ([NSSet setWithObjects:nil]), @""); + + cpSpacePointQuery_b(space.space, cpv(-0.6, -0.6), 0.0, CP_SHAPE_FILTER_ALL, ^(cpShape *shape, cpVect p, cpFloat d, cpVect g){ + XCTAssertEqual(shape, segment.shape, @""); + XCTAssertEqualWithAccuracy(cpvdist(p, cpvnormalize(cpv(-1, -1))), (cpFloat)0.0, 1e-5, @""); + XCTAssertEqualWithAccuracy(d, cpfsqrt(2*0.6*0.6) - 1.0f, 1e-5, @""); + }); + + // Segment queries + set = segmentQueryInfoToShapes([space segmentQueryAllFrom:cpv(-2,-2) to:cpv(4,4) radius:0.0 filter:CP_SHAPE_FILTER_ALL]); + XCTAssertEqualObjects(set, ([NSSet setWithObjects:circle, segment, box, nil]), @""); + + set = segmentQueryInfoToShapes([space segmentQueryAllFrom:cpv(2,-2) to:cpv(-2,2) radius:0.0 filter:CP_SHAPE_FILTER_ALL]); + XCTAssertEqualObjects(set, ([NSSet setWithObjects:segment, box, nil]), @""); + + set = segmentQueryInfoToShapes([space segmentQueryAllFrom:cpv(3,-1) to:cpv(-1,3) radius:0.0 filter:CP_SHAPE_FILTER_ALL]); + XCTAssertEqualObjects(set, ([NSSet setWithObjects:circle, segment, nil]), @""); + + set = segmentQueryInfoToShapes([space segmentQueryAllFrom:cpv(2.4,-1.6) to:cpv(-1.6,2.4) radius:0.0 filter:CP_SHAPE_FILTER_ALL]); + XCTAssertEqualObjects(set, ([NSSet setWithObjects:circle, segment, box, nil]), @""); + + set = segmentQueryInfoToShapes([space segmentQueryAllFrom:cpv(2,2) to:cpv(3,3) radius:0.0 filter:CP_SHAPE_FILTER_ALL]); + XCTAssertEqualObjects(set, ([NSSet setWithObjects:nil]), @""); + + ChipmunkSegmentQueryInfo *info; + info = [space segmentQueryFirstFrom:cpv(-2,-2) to:cpv(1,1) radius:0.0 filter:CP_SHAPE_FILTER_ALL]; + XCTAssertEqual(info.shape, segment, @""); + + info = [space segmentQueryFirstFrom:cpv(-2,-2) to:cpv(-1,-1) radius:0.0 filter:CP_SHAPE_FILTER_ALL]; + XCTAssertEqualObjects(info.shape, nil, @""); + + cpSpaceSegmentQuery_b(space.space, cpv(-1.0, -0.6), cpv(1.0, -0.6), 0.0f, CP_SHAPE_FILTER_ALL, ^(cpShape *shape, cpVect p, cpVect n, cpFloat t){ + XCTAssertEqual(shape, segment.shape, @""); + XCTAssertEqualWithAccuracy(cpvlength(n), 1.0f, 1e-5, @""); + XCTAssertEqualWithAccuracy(n.y, -0.6f, 1e-5, @""); + XCTAssertEqualWithAccuracy(cpvdist(cpv(-1.0, -0.6), n)/2.0f, t, 1e-5, @""); + }); + + // Segment queries starting from inside a shape + info = [space segmentQueryFirstFrom:cpvzero to:cpv(1,1) radius:0.0 filter:CP_SHAPE_FILTER_ALL]; + XCTAssertEqual(info.t, 0.0f, @"Starting inside a shape should return t=0."); + + info = [space segmentQueryFirstFrom:cpv(1,1) to:cpvzero radius:0.0 filter:CP_SHAPE_FILTER_ALL]; + XCTAssertEqual(info.t, 0.0f, @"Starting inside a shape should return t=0."); + + info = [space segmentQueryFirstFrom:cpv(-0.6, -0.6) to:cpvzero radius:0.0 filter:CP_SHAPE_FILTER_ALL]; + XCTAssertEqual(info.t, 0.0f, @"Starting inside a shape should return t=0."); + XCTAssertEqual(info.shape, segment, @"Should have picked the segment shape."); + + // Shape queries + ChipmunkBody *queryBody = [ChipmunkBody bodyWithMass:1 andMoment:1]; + ChipmunkShape *queryShape = [ChipmunkCircleShape circleWithBody:queryBody radius:1 offset:cpvzero]; + + queryBody.position = cpvzero; + set = shapeQueryInfoToShapes([space shapeQueryAll:queryShape]); + XCTAssertEqualObjects(set, ([NSSet setWithObjects:circle, segment, box, nil]), @""); + + queryBody.position = cpv(1,1); + set = shapeQueryInfoToShapes([space shapeQueryAll:queryShape]); + XCTAssertEqualObjects(set, ([NSSet setWithObjects:circle, segment, box, nil]), @""); + + queryBody.position = cpv(0,-1); + set = shapeQueryInfoToShapes([space shapeQueryAll:queryShape]); + XCTAssertEqualObjects(set, ([NSSet setWithObjects:segment, box, nil]), @""); + + queryBody.position = cpv(0,-1.6); + set = shapeQueryInfoToShapes([space shapeQueryAll:queryShape]); + XCTAssertEqualObjects(set, ([NSSet setWithObjects:segment, nil]), @""); + + cpSpaceShapeQuery_b(space.space, queryShape.shape, ^(cpShape *shape, cpContactPointSet *points){ + XCTAssertEqual(shape, segment.shape, @""); + XCTAssertEqual(points->count, 1, @""); + }); + + queryBody.position = cpv(2,2); + set = shapeQueryInfoToShapes([space shapeQueryAll:queryShape]); + XCTAssertEqualObjects(set, ([NSSet setWithObjects:circle, segment, nil]), @""); + + queryBody.position = cpv(4,4); + set = shapeQueryInfoToShapes([space shapeQueryAll:queryShape]); + XCTAssertEqualObjects(set, ([NSSet setWithObjects:nil]), @""); + + [space remove:circle]; + [space remove:segment]; + [space remove:box]; + [pool release]; + + AssertRetainCount(circle, 1); + AssertRetainCount(segment, 1); + AssertRetainCount(box, 1); + + [circle release]; + [segment release]; + [box release]; +} + +-(void)testPointQueries { + ChipmunkSpace *space = [[ChipmunkSpace alloc] init]; + + // With static bodies + testPointQueries_helper(self, space, space.staticBody); + testPointQueries_helper(self, space, [ChipmunkBody staticBody]); + + // With regular bodies. + testPointQueries_helper(self, space, [ChipmunkBody bodyWithMass:1 andMoment:1]); + testPointQueries_helper(self, space, [space add:[ChipmunkBody bodyWithMass:1 andMoment:1]]); + + [space release]; +} + +-(void)testShapes { + ChipmunkSpace *space = [[ChipmunkSpace alloc] init]; + ChipmunkShape *shape; + + // Check that static shapes get added correctly + shape = [space add:[ChipmunkCircleShape circleWithBody:space.staticBody radius:1 offset:cpvzero]]; + XCTAssertTrue(cpSpatialIndexContains(space.space->staticShapes, shape.shape, shape.shape->hashid), @""); + + shape = [space add:[ChipmunkCircleShape circleWithBody:[ChipmunkBody staticBody] radius:1 offset:cpvzero]]; + XCTAssertTrue(cpSpatialIndexContains(space.space->staticShapes, shape.shape, shape.shape->hashid), @""); + + // Check that normal shapes get added correctly + ChipmunkBody *rogue = [ChipmunkBody bodyWithMass:1 andMoment:1]; + shape = [space add:[ChipmunkCircleShape circleWithBody:rogue radius:1 offset:cpvzero]]; + XCTAssertTrue(cpSpatialIndexContains(space.space->dynamicShapes, shape.shape, shape.shape->hashid), @""); + + ChipmunkBody *normal = [space add:[ChipmunkBody bodyWithMass:1 andMoment:1]]; + shape = [space add:[ChipmunkCircleShape circleWithBody:normal radius:1 offset:cpvzero]]; + XCTAssertTrue(cpSpatialIndexContains(space.space->dynamicShapes, shape.shape, shape.shape->hashid), @""); + + [space release]; +} + +-(void)testBasicSimulation { + ChipmunkSpace *space = [[ChipmunkSpace alloc] init]; + space.gravity = cpv(0, -100); + + [space addBounds:CGRectMake(-50, 0, 100, 100) thickness:1 elasticity:1 friction:1 filter:CP_SHAPE_FILTER_ALL collisionType:nil]; + + ChipmunkBody *ball = [space add:[ChipmunkBody bodyWithMass:1 andMoment:cpMomentForCircle(1, 0, 1, cpvzero)]]; + ball.position = cpv(-10, 10); + [space add:[ChipmunkCircleShape circleWithBody:ball radius:1 offset:cpvzero]]; + + ChipmunkBody *box = [space add:[ChipmunkBody bodyWithMass:1 andMoment:cpMomentForBox(1, 2, 2)]]; + box.position = cpv(10, 10); + [space add:[ChipmunkPolyShape boxWithBody:box width:2 height:2 radius:0]]; + + for(int i=0; i<100; i++) [space step:0.01]; + + XCTAssertTrue(cpfabs(ball.position.y - 1) < 1.1*space.collisionSlop, @""); + XCTAssertTrue(cpfabs(box.position.y - 1) < 1.1*space.collisionSlop, @""); + + [space release]; +} + +- (void)testInitialSleepingObjects +{ + // http://www.cocos2d-iphone.org/forum/topic/28896#post-142428 + ChipmunkSpace *space = [[ChipmunkSpace alloc] init]; + space.sleepTimeThreshold = 10.0; + + ChipmunkBody *body1 = [space add:[ChipmunkBody bodyWithMass:1.0 andMoment:1.0]]; + [space add:[ChipmunkCircleShape circleWithBody:body1 radius:1.0 offset:cpvzero]]; + + ChipmunkBody *body2 = [space add:[ChipmunkBody bodyWithMass:1.0 andMoment:1.0]]; + [space add:[ChipmunkCircleShape circleWithBody:body2 radius:1.0 offset:cpvzero]]; + + [body1 sleep]; + [space step:1.0]; + + XCTAssertFalse(body1.isSleeping, @""); + XCTAssertFalse(body2.isSleeping, @""); + + [space release]; +} + +-(void)testInitStepFree +{ + // This was crashing on GCC. + // Possible uninitialized field? + cpSpace *space = cpSpaceNew(); + cpSpaceStep(space, 1); + cpSpaceFree(space); +} + +static cpBool CallBlock(cpArbiter *arb, cpSpace *space, cpBool (^block)(cpArbiter *arb)){return block(arb);} + +static void +VerifyContactGraph(id self, ChipmunkBody *body1, ChipmunkBody *body2) +{ + __block int counter = 0; + + [body1 eachArbiter:^(cpArbiter *arb){ + CHIPMUNK_ARBITER_GET_BODIES(arb, a, b); + XCTAssertTrue(a == body1 && b == body2, @"Unexpected contact graph"); + counter++; + }]; + + [body2 eachArbiter:^(cpArbiter *arb){ + CHIPMUNK_ARBITER_GET_BODIES(arb, a, b); + XCTAssertTrue(a == body2 && b == body1, @"Unexpected contact graph"); + counter++; + }]; + + XCTAssertEqual(counter, 2, @"Wrong number of arbiters in contact graph."); +} + +// This one was a doozy to find. :-\ +// http://chipmunk-physics.net/forum/viewtopic.php?f=1&t=2472&start=40#p10924 +-(void)testSleepSensorRemoveBug +{ + ChipmunkSpace *space = [[ChipmunkSpace alloc] init]; + space.sleepTimeThreshold = 0.1; + + ChipmunkBody *body1 = [space add:[ChipmunkBody bodyWithMass:1 andMoment:INFINITY]]; + [space add:[ChipmunkCircleShape circleWithBody:body1 radius:1 offset:cpvzero]]; + + ChipmunkBody *body2 = [space add:[ChipmunkBody bodyWithMass:1 andMoment:INFINITY]]; + [space add:[ChipmunkCircleShape circleWithBody:body2 radius:1 offset:cpvzero]]; + body2.position = cpv(0, 1.9); + + for(int i=0; !body1.isSleeping; i++){ + [space step:0.01]; + XCTAssertTrue(i < 100, @"body1 failed to fall asleep"); + } + + XCTAssertTrue(body2.isSleeping, @"body2 is not sleeping"); + VerifyContactGraph(self, body1, body2); + + // Objects are now sleeping and have their contact graph data all set up carefully. + + NSString *type = @"woo"; + ChipmunkBody *body3 = [space add:[ChipmunkBody bodyWithMass:1 andMoment:INFINITY]]; + ChipmunkShape *shape = [space add:[ChipmunkCircleShape circleWithBody:body3 radius:1 offset:cpv(-0.5, 0)]]; + shape.collisionType = type; + + // TODO +// [space addCollisionHandler:self typeA:nil typeB:type begin:@selector(beginSleepSensorRemoveBug:space:) preSolve:nil postSolve:nil separate:nil]; + cpCollisionHandler *handler = cpSpaceAddCollisionHandler(space.space, nil, type); + handler->beginFunc = (cpCollisionBeginFunc)CallBlock, + handler->userData = ^(cpArbiter *arb){ + // 'b' is the shape we are using to trigger the callback. + CHIPMUNK_ARBITER_GET_SHAPES(arb, a, b); + [space addPostStepRemoval:b]; + + return FALSE; + }; + + // Now step again and shape should get removed. + [space step:0.01]; + + XCTAssertFalse([space contains:shape], @"'shape' did not get removed."); + VerifyContactGraph(self, body1, body2); +} + +-(bool)beginSleepActivateOnImpact:(cpArbiter *)arb space:(ChipmunkSpace*)space +{ + // 'b' is the shape we are using to trigger the callback. + CHIPMUNK_ARBITER_GET_BODIES(arb, sleeping, awake); + + XCTAssertTrue(sleeping.isSleeping, @"Body 'sleeping' should be sleeping."); + XCTAssertFalse(awake.isSleeping, @"Body 'awake' should not be sleeping."); + + [sleeping activate]; + + return TRUE; +} + +// Causing a sleeping body to be activated from a pre-solve callback causes issues with the deffered waking. +// http://chipmunk-physics.net/forum/viewtopic.php?f=1&t=2477 +-(void)testSleepActivateOnImpact +{ + NSString *sleepType = @"sleeping"; + NSString *awakeType = @"awake"; + + ChipmunkSpace *space = [[ChipmunkSpace alloc] init]; + space.sleepTimeThreshold = 0.1; + + ChipmunkBody *body1 = [space add:[ChipmunkBody bodyWithMass:1 andMoment:INFINITY]]; + ChipmunkShape *shape1 = [space add:[ChipmunkCircleShape circleWithBody:body1 radius:1 offset:cpvzero]]; + shape1.collisionType = sleepType; + [body1 sleep]; + + ChipmunkBody *body2 = [space add:[ChipmunkBody bodyWithMass:1 andMoment:INFINITY]]; + ChipmunkShape *shape2 = [space add:[ChipmunkCircleShape circleWithBody:body2 radius:1 offset:cpvzero]]; + shape2.collisionType = awakeType; + +// [space addCollisionHandler:self typeA:sleepType typeB:awakeType begin:@selector(beginSleepActivateOnImpact:space:) preSolve:nil postSolve:nil separate:nil]; + [space step:0.01]; + + XCTAssertFalse(body1.isSleeping, @"body1 did not awake."); + XCTAssertFalse(body2.isSleeping, @"body2 did not awake."); +} + + +-(void)testAddBounds +{ + ChipmunkSpace *space = [[ChipmunkSpace alloc] init]; + NSArray *objs = [space addBounds:CGRectMake(0, 0, 10, 10) thickness:5 elasticity:0 friction:1 filter:CP_SHAPE_FILTER_ALL collisionType:nil]; + XCTAssertTrue([space contains:objs], @""); + + [space release]; +} +// TODO more sleeping tests + +@end diff --git a/external/Chipmunk/xcode/ObjectiveChipmunkTests/en.lproj/InfoPlist.strings b/external/Chipmunk/xcode/ObjectiveChipmunkTests/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/external/Chipmunk/xcode/ObjectiveChipmunkTests/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/external/Chipmunk/xcode/bench.rb b/external/Chipmunk/xcode/bench.rb new file mode 100644 index 0000000..78912f3 --- /dev/null +++ b/external/Chipmunk/xcode/bench.rb @@ -0,0 +1,12 @@ +results = [] + +cmd = "|build/Release/ChipmunkDemo.app/Contents/MacOS/ChipmunkDemo -bench -trial" +open(cmd) do|io| + while str = io.gets do + puts str + results << str.split[2] + end +end + +puts "Placing results in paste buffer." +open("|pbcopy", "w"){|io| io.puts results} diff --git a/external/Chipmunk/xcode/bench2.rb b/external/Chipmunk/xcode/bench2.rb new file mode 100644 index 0000000..c14c3d9 --- /dev/null +++ b/external/Chipmunk/xcode/bench2.rb @@ -0,0 +1,12 @@ +results = [] + +cmd = "|pbpaste" +open(cmd) do|io| + while str = io.gets do + puts str + results << str.split[2] + end +end + +puts "Placing results in paste buffer." +open("|pbcopy", "w"){|io| io.puts results} diff --git a/external/Chipmunk/xcode/iphonestatic.command b/external/Chipmunk/xcode/iphonestatic.command new file mode 100755 index 0000000..4e6156d --- /dev/null +++ b/external/Chipmunk/xcode/iphonestatic.command @@ -0,0 +1,59 @@ +#! /usr/bin/ruby + +Dir.chdir(File.dirname($0)) + +require 'Tempfile' +BUILD_LOG = Tempfile.new("Chipmunk-") +BUILD_LOG_PATH = BUILD_LOG.path + +def log(string) + puts string + open(BUILD_LOG_PATH, 'a'){|f| f.puts string} +end + +def latest_sdk() + sdks = `xcodebuild -showsdks`.split("\n") + + versions = sdks.map do|elt| + # Match only lines with "iphoneos" in them. + m = elt.match(/iphoneos(\d\.\d)/) + (m ? m.captures[0] : "0.0") + end + + return versions.max +end + +# Or you can pick a specific version string (ex: "5.1") +IOS_SDK_VERSION = latest_sdk() + +log("Building using iOS SDK #{IOS_SDK_VERSION}") + +VERBOSE = (not ARGV.include?("--quiet")) + +def system(command) + log "> #{command}" + + result = Kernel.system(VERBOSE ? "#{command} | tee -a #{BUILD_LOG_PATH}; exit ${PIPESTATUS[0]}" : "#{command} >> #{BUILD_LOG_PATH}") + unless $? == 0 + log "===========================================" + log "Command failed with status #{$?}: #{command}" + log "Build errors encountered. Aborting build script" + log "Check the build log for more information: #{BUILD_LOG_PATH}" + raise + end +end + +OUTPUT_DIR_NAME = "Chipmunk-iPhone" +system "rm -rf #{OUTPUT_DIR_NAME}" +system "mkdir #{OUTPUT_DIR_NAME}" + +system "xcodebuild -project Chipmunk7.xcodeproj -sdk iphoneos#{IOS_SDK_VERSION} -configuration Release -target ChipmunkStatic-iPhone" +system "xcodebuild -project Chipmunk7.xcodeproj -sdk iphonesimulator#{IOS_SDK_VERSION} -arch i386 -configuration Debug -target ChipmunkStatic-iPhone" +system "lipo build/Debug-iphonesimulator/libChipmunk-iPhone.a build/Release-iphoneos/libChipmunk-iPhone.a -create -output #{OUTPUT_DIR_NAME}/libChipmunk-iPhone.a" + +system "rsync -r --exclude='.*' ../include/chipmunk/ #{OUTPUT_DIR_NAME}" +system "open #{OUTPUT_DIR_NAME}" + +puts "Copy #{OUTPUT_DIR_NAME} into your project and enjoy." + +BUILD_LOG.delete diff --git a/external/Chipmunk/xcode/libGLEW/LICENSE.txt b/external/Chipmunk/xcode/libGLEW/LICENSE.txt new file mode 100644 index 0000000..f707804 --- /dev/null +++ b/external/Chipmunk/xcode/libGLEW/LICENSE.txt @@ -0,0 +1,73 @@ +The OpenGL Extension Wrangler Library +Copyright (C) 2002-2007, Milan Ikits +Copyright (C) 2002-2007, Marcelo E. Magallon +Copyright (C) 2002, Lev Povalahev +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. +* The name of the author may be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF +THE POSSIBILITY OF SUCH DAMAGE. + + +Mesa 3-D graphics library +Version: 7.0 + +Copyright (C) 1999-2007 Brian Paul All Rights Reserved. + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the "Software"), +to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, +and/or sell copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + +Copyright (c) 2007 The Khronos Group Inc. + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and/or associated documentation files (the +"Materials"), to deal in the Materials without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Materials, and to +permit persons to whom the Materials are furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Materials. + +THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. diff --git a/external/Chipmunk/xcode/libGLEW/include/GL/glew.h b/external/Chipmunk/xcode/libGLEW/include/GL/glew.h new file mode 100644 index 0000000..51a29ef --- /dev/null +++ b/external/Chipmunk/xcode/libGLEW/include/GL/glew.h @@ -0,0 +1,18062 @@ +/* +** The OpenGL Extension Wrangler Library +** Copyright (C) 2002-2008, Milan Ikits +** Copyright (C) 2002-2008, Marcelo E. Magallon +** Copyright (C) 2002, Lev Povalahev +** All rights reserved. +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are met: +** +** * Redistributions of source code must retain the above copyright notice, +** this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright notice, +** this list of conditions and the following disclaimer in the documentation +** and/or other materials provided with the distribution. +** * The name of the author may be used to endorse or promote products +** derived from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +** ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +** LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +** INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +** CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +** ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF +** THE POSSIBILITY OF SUCH DAMAGE. +*/ + +/* + * Mesa 3-D graphics library + * Version: 7.0 + * + * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN + * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +/* +** Copyright (c) 2007 The Khronos Group Inc. +** +** Permission is hereby granted, free of charge, to any person obtaining a +** copy of this software and/or associated documentation files (the +** "Materials"), to deal in the Materials without restriction, including +** without limitation the rights to use, copy, modify, merge, publish, +** distribute, sublicense, and/or sell copies of the Materials, and to +** permit persons to whom the Materials are furnished to do so, subject to +** the following conditions: +** +** The above copyright notice and this permission notice shall be included +** in all copies or substantial portions of the Materials. +** +** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. +*/ + +#ifndef __glew_h__ +#define __glew_h__ +#define __GLEW_H__ + +#if defined(__gl_h_) || defined(__GL_H__) || defined(__X_GL_H) +#error gl.h included before glew.h +#endif +#if defined(__gl2_h_) +#error gl2.h included before glew.h +#endif +#if defined(__gltypes_h_) +#error gltypes.h included before glew.h +#endif +#if defined(__REGAL_H__) +#error Regal.h included before glew.h +#endif +#if defined(__glext_h_) || defined(__GLEXT_H_) +#error glext.h included before glew.h +#endif +#if defined(__gl_ATI_h_) +#error glATI.h included before glew.h +#endif + +#define __gl_h_ +#define __gl2_h_ +#define __GL_H__ +#define __gltypes_h_ +#define __REGAL_H__ +#define __X_GL_H +#define __glext_h_ +#define __GLEXT_H_ +#define __gl_ATI_h_ + +#if defined(_WIN32) + +/* + * GLEW does not include to avoid name space pollution. + * GL needs GLAPI and GLAPIENTRY, GLU needs APIENTRY, CALLBACK, and wchar_t + * defined properly. + */ +/* */ +#ifndef APIENTRY +#define GLEW_APIENTRY_DEFINED +# if defined(__MINGW32__) || defined(__CYGWIN__) +# define APIENTRY __stdcall +# elif (_MSC_VER >= 800) || defined(_STDCALL_SUPPORTED) || defined(__BORLANDC__) +# define APIENTRY __stdcall +# else +# define APIENTRY +# endif +#endif +#ifndef GLAPI +# if defined(__MINGW32__) || defined(__CYGWIN__) +# define GLAPI extern +# endif +#endif +/* */ +#ifndef CALLBACK +#define GLEW_CALLBACK_DEFINED +# if defined(__MINGW32__) || defined(__CYGWIN__) +# define CALLBACK __attribute__ ((__stdcall__)) +# elif (defined(_M_MRX000) || defined(_M_IX86) || defined(_M_ALPHA) || defined(_M_PPC)) && !defined(MIDL_PASS) +# define CALLBACK __stdcall +# else +# define CALLBACK +# endif +#endif +/* and */ +#ifndef WINGDIAPI +#define GLEW_WINGDIAPI_DEFINED +#define WINGDIAPI __declspec(dllimport) +#endif +/* */ +#if (defined(_MSC_VER) || defined(__BORLANDC__)) && !defined(_WCHAR_T_DEFINED) +typedef unsigned short wchar_t; +# define _WCHAR_T_DEFINED +#endif +/* */ +#if !defined(_W64) +# if !defined(__midl) && (defined(_X86_) || defined(_M_IX86)) && defined(_MSC_VER) && _MSC_VER >= 1300 +# define _W64 __w64 +# else +# define _W64 +# endif +#endif +#if !defined(_PTRDIFF_T_DEFINED) && !defined(_PTRDIFF_T_) && !defined(__MINGW64__) +# ifdef _WIN64 +typedef __int64 ptrdiff_t; +# else +typedef _W64 int ptrdiff_t; +# endif +# define _PTRDIFF_T_DEFINED +# define _PTRDIFF_T_ +#endif + +#ifndef GLAPI +# if defined(__MINGW32__) || defined(__CYGWIN__) +# define GLAPI extern +# else +# define GLAPI WINGDIAPI +# endif +#endif + +#ifndef GLAPIENTRY +#define GLAPIENTRY APIENTRY +#endif + +#ifndef GLEWAPIENTRY +#define GLEWAPIENTRY APIENTRY +#endif + +/* + * GLEW_STATIC is defined for static library. + * GLEW_BUILD is defined for building the DLL library. + */ + +#ifdef GLEW_STATIC +# define GLEWAPI extern +#else +# ifdef GLEW_BUILD +# define GLEWAPI extern __declspec(dllexport) +# else +# define GLEWAPI extern __declspec(dllimport) +# endif +#endif + +#else /* _UNIX */ + +/* + * Needed for ptrdiff_t in turn needed by VBO. This is defined by ISO + * C. On my system, this amounts to _3 lines_ of included code, all of + * them pretty much harmless. If you know of a way of detecting 32 vs + * 64 _targets_ at compile time you are free to replace this with + * something that's portable. For now, _this_ is the portable solution. + * (mem, 2004-01-04) + */ + +#include + +/* SGI MIPSPro doesn't like stdint.h in C++ mode */ +/* ID: 3376260 Solaris 9 has inttypes.h, but not stdint.h */ + +#if (defined(__sgi) || defined(__sun)) && !defined(__GNUC__) +#include +#else +#include +#endif + +#define GLEW_APIENTRY_DEFINED +#define APIENTRY + +/* + * GLEW_STATIC is defined for static library. + */ + +#ifdef GLEW_STATIC +# define GLEWAPI extern +#else +# if defined(__GNUC__) && __GNUC__>=4 +# define GLEWAPI extern __attribute__ ((visibility("default"))) +# elif defined(__SUNPRO_C) || defined(__SUNPRO_CC) +# define GLEWAPI extern __global +# else +# define GLEWAPI extern +# endif +#endif + +/* */ +#ifndef GLAPI +#define GLAPI extern +#endif + +#ifndef GLAPIENTRY +#define GLAPIENTRY +#endif + +#ifndef GLEWAPIENTRY +#define GLEWAPIENTRY +#endif + +#endif /* _WIN32 */ + +#ifdef __cplusplus +extern "C" { +#endif + +/* ----------------------------- GL_VERSION_1_1 ---------------------------- */ + +#ifndef GL_VERSION_1_1 +#define GL_VERSION_1_1 1 + +typedef unsigned int GLenum; +typedef unsigned int GLbitfield; +typedef unsigned int GLuint; +typedef int GLint; +typedef int GLsizei; +typedef unsigned char GLboolean; +typedef signed char GLbyte; +typedef short GLshort; +typedef unsigned char GLubyte; +typedef unsigned short GLushort; +typedef unsigned long GLulong; +typedef float GLfloat; +typedef float GLclampf; +typedef double GLdouble; +typedef double GLclampd; +typedef void GLvoid; +#if defined(_MSC_VER) && _MSC_VER < 1400 +typedef __int64 GLint64EXT; +typedef unsigned __int64 GLuint64EXT; +#elif defined(_MSC_VER) || defined(__BORLANDC__) +typedef signed long long GLint64EXT; +typedef unsigned long long GLuint64EXT; +#else +# if defined(__MINGW32__) || defined(__CYGWIN__) +#include +# endif +typedef int64_t GLint64EXT; +typedef uint64_t GLuint64EXT; +#endif +typedef GLint64EXT GLint64; +typedef GLuint64EXT GLuint64; +typedef struct __GLsync *GLsync; + +typedef char GLchar; + +#define GL_ZERO 0 +#define GL_FALSE 0 +#define GL_LOGIC_OP 0x0BF1 +#define GL_NONE 0 +#define GL_TEXTURE_COMPONENTS 0x1003 +#define GL_NO_ERROR 0 +#define GL_POINTS 0x0000 +#define GL_CURRENT_BIT 0x00000001 +#define GL_TRUE 1 +#define GL_ONE 1 +#define GL_CLIENT_PIXEL_STORE_BIT 0x00000001 +#define GL_LINES 0x0001 +#define GL_LINE_LOOP 0x0002 +#define GL_POINT_BIT 0x00000002 +#define GL_CLIENT_VERTEX_ARRAY_BIT 0x00000002 +#define GL_LINE_STRIP 0x0003 +#define GL_LINE_BIT 0x00000004 +#define GL_TRIANGLES 0x0004 +#define GL_TRIANGLE_STRIP 0x0005 +#define GL_TRIANGLE_FAN 0x0006 +#define GL_QUADS 0x0007 +#define GL_QUAD_STRIP 0x0008 +#define GL_POLYGON_BIT 0x00000008 +#define GL_POLYGON 0x0009 +#define GL_POLYGON_STIPPLE_BIT 0x00000010 +#define GL_PIXEL_MODE_BIT 0x00000020 +#define GL_LIGHTING_BIT 0x00000040 +#define GL_FOG_BIT 0x00000080 +#define GL_DEPTH_BUFFER_BIT 0x00000100 +#define GL_ACCUM 0x0100 +#define GL_LOAD 0x0101 +#define GL_RETURN 0x0102 +#define GL_MULT 0x0103 +#define GL_ADD 0x0104 +#define GL_NEVER 0x0200 +#define GL_ACCUM_BUFFER_BIT 0x00000200 +#define GL_LESS 0x0201 +#define GL_EQUAL 0x0202 +#define GL_LEQUAL 0x0203 +#define GL_GREATER 0x0204 +#define GL_NOTEQUAL 0x0205 +#define GL_GEQUAL 0x0206 +#define GL_ALWAYS 0x0207 +#define GL_SRC_COLOR 0x0300 +#define GL_ONE_MINUS_SRC_COLOR 0x0301 +#define GL_SRC_ALPHA 0x0302 +#define GL_ONE_MINUS_SRC_ALPHA 0x0303 +#define GL_DST_ALPHA 0x0304 +#define GL_ONE_MINUS_DST_ALPHA 0x0305 +#define GL_DST_COLOR 0x0306 +#define GL_ONE_MINUS_DST_COLOR 0x0307 +#define GL_SRC_ALPHA_SATURATE 0x0308 +#define GL_STENCIL_BUFFER_BIT 0x00000400 +#define GL_FRONT_LEFT 0x0400 +#define GL_FRONT_RIGHT 0x0401 +#define GL_BACK_LEFT 0x0402 +#define GL_BACK_RIGHT 0x0403 +#define GL_FRONT 0x0404 +#define GL_BACK 0x0405 +#define GL_LEFT 0x0406 +#define GL_RIGHT 0x0407 +#define GL_FRONT_AND_BACK 0x0408 +#define GL_AUX0 0x0409 +#define GL_AUX1 0x040A +#define GL_AUX2 0x040B +#define GL_AUX3 0x040C +#define GL_INVALID_ENUM 0x0500 +#define GL_INVALID_VALUE 0x0501 +#define GL_INVALID_OPERATION 0x0502 +#define GL_STACK_OVERFLOW 0x0503 +#define GL_STACK_UNDERFLOW 0x0504 +#define GL_OUT_OF_MEMORY 0x0505 +#define GL_2D 0x0600 +#define GL_3D 0x0601 +#define GL_3D_COLOR 0x0602 +#define GL_3D_COLOR_TEXTURE 0x0603 +#define GL_4D_COLOR_TEXTURE 0x0604 +#define GL_PASS_THROUGH_TOKEN 0x0700 +#define GL_POINT_TOKEN 0x0701 +#define GL_LINE_TOKEN 0x0702 +#define GL_POLYGON_TOKEN 0x0703 +#define GL_BITMAP_TOKEN 0x0704 +#define GL_DRAW_PIXEL_TOKEN 0x0705 +#define GL_COPY_PIXEL_TOKEN 0x0706 +#define GL_LINE_RESET_TOKEN 0x0707 +#define GL_EXP 0x0800 +#define GL_VIEWPORT_BIT 0x00000800 +#define GL_EXP2 0x0801 +#define GL_CW 0x0900 +#define GL_CCW 0x0901 +#define GL_COEFF 0x0A00 +#define GL_ORDER 0x0A01 +#define GL_DOMAIN 0x0A02 +#define GL_CURRENT_COLOR 0x0B00 +#define GL_CURRENT_INDEX 0x0B01 +#define GL_CURRENT_NORMAL 0x0B02 +#define GL_CURRENT_TEXTURE_COORDS 0x0B03 +#define GL_CURRENT_RASTER_COLOR 0x0B04 +#define GL_CURRENT_RASTER_INDEX 0x0B05 +#define GL_CURRENT_RASTER_TEXTURE_COORDS 0x0B06 +#define GL_CURRENT_RASTER_POSITION 0x0B07 +#define GL_CURRENT_RASTER_POSITION_VALID 0x0B08 +#define GL_CURRENT_RASTER_DISTANCE 0x0B09 +#define GL_POINT_SMOOTH 0x0B10 +#define GL_POINT_SIZE 0x0B11 +#define GL_POINT_SIZE_RANGE 0x0B12 +#define GL_POINT_SIZE_GRANULARITY 0x0B13 +#define GL_LINE_SMOOTH 0x0B20 +#define GL_LINE_WIDTH 0x0B21 +#define GL_LINE_WIDTH_RANGE 0x0B22 +#define GL_LINE_WIDTH_GRANULARITY 0x0B23 +#define GL_LINE_STIPPLE 0x0B24 +#define GL_LINE_STIPPLE_PATTERN 0x0B25 +#define GL_LINE_STIPPLE_REPEAT 0x0B26 +#define GL_LIST_MODE 0x0B30 +#define GL_MAX_LIST_NESTING 0x0B31 +#define GL_LIST_BASE 0x0B32 +#define GL_LIST_INDEX 0x0B33 +#define GL_POLYGON_MODE 0x0B40 +#define GL_POLYGON_SMOOTH 0x0B41 +#define GL_POLYGON_STIPPLE 0x0B42 +#define GL_EDGE_FLAG 0x0B43 +#define GL_CULL_FACE 0x0B44 +#define GL_CULL_FACE_MODE 0x0B45 +#define GL_FRONT_FACE 0x0B46 +#define GL_LIGHTING 0x0B50 +#define GL_LIGHT_MODEL_LOCAL_VIEWER 0x0B51 +#define GL_LIGHT_MODEL_TWO_SIDE 0x0B52 +#define GL_LIGHT_MODEL_AMBIENT 0x0B53 +#define GL_SHADE_MODEL 0x0B54 +#define GL_COLOR_MATERIAL_FACE 0x0B55 +#define GL_COLOR_MATERIAL_PARAMETER 0x0B56 +#define GL_COLOR_MATERIAL 0x0B57 +#define GL_FOG 0x0B60 +#define GL_FOG_INDEX 0x0B61 +#define GL_FOG_DENSITY 0x0B62 +#define GL_FOG_START 0x0B63 +#define GL_FOG_END 0x0B64 +#define GL_FOG_MODE 0x0B65 +#define GL_FOG_COLOR 0x0B66 +#define GL_DEPTH_RANGE 0x0B70 +#define GL_DEPTH_TEST 0x0B71 +#define GL_DEPTH_WRITEMASK 0x0B72 +#define GL_DEPTH_CLEAR_VALUE 0x0B73 +#define GL_DEPTH_FUNC 0x0B74 +#define GL_ACCUM_CLEAR_VALUE 0x0B80 +#define GL_STENCIL_TEST 0x0B90 +#define GL_STENCIL_CLEAR_VALUE 0x0B91 +#define GL_STENCIL_FUNC 0x0B92 +#define GL_STENCIL_VALUE_MASK 0x0B93 +#define GL_STENCIL_FAIL 0x0B94 +#define GL_STENCIL_PASS_DEPTH_FAIL 0x0B95 +#define GL_STENCIL_PASS_DEPTH_PASS 0x0B96 +#define GL_STENCIL_REF 0x0B97 +#define GL_STENCIL_WRITEMASK 0x0B98 +#define GL_MATRIX_MODE 0x0BA0 +#define GL_NORMALIZE 0x0BA1 +#define GL_VIEWPORT 0x0BA2 +#define GL_MODELVIEW_STACK_DEPTH 0x0BA3 +#define GL_PROJECTION_STACK_DEPTH 0x0BA4 +#define GL_TEXTURE_STACK_DEPTH 0x0BA5 +#define GL_MODELVIEW_MATRIX 0x0BA6 +#define GL_PROJECTION_MATRIX 0x0BA7 +#define GL_TEXTURE_MATRIX 0x0BA8 +#define GL_ATTRIB_STACK_DEPTH 0x0BB0 +#define GL_CLIENT_ATTRIB_STACK_DEPTH 0x0BB1 +#define GL_ALPHA_TEST 0x0BC0 +#define GL_ALPHA_TEST_FUNC 0x0BC1 +#define GL_ALPHA_TEST_REF 0x0BC2 +#define GL_DITHER 0x0BD0 +#define GL_BLEND_DST 0x0BE0 +#define GL_BLEND_SRC 0x0BE1 +#define GL_BLEND 0x0BE2 +#define GL_LOGIC_OP_MODE 0x0BF0 +#define GL_INDEX_LOGIC_OP 0x0BF1 +#define GL_COLOR_LOGIC_OP 0x0BF2 +#define GL_AUX_BUFFERS 0x0C00 +#define GL_DRAW_BUFFER 0x0C01 +#define GL_READ_BUFFER 0x0C02 +#define GL_SCISSOR_BOX 0x0C10 +#define GL_SCISSOR_TEST 0x0C11 +#define GL_INDEX_CLEAR_VALUE 0x0C20 +#define GL_INDEX_WRITEMASK 0x0C21 +#define GL_COLOR_CLEAR_VALUE 0x0C22 +#define GL_COLOR_WRITEMASK 0x0C23 +#define GL_INDEX_MODE 0x0C30 +#define GL_RGBA_MODE 0x0C31 +#define GL_DOUBLEBUFFER 0x0C32 +#define GL_STEREO 0x0C33 +#define GL_RENDER_MODE 0x0C40 +#define GL_PERSPECTIVE_CORRECTION_HINT 0x0C50 +#define GL_POINT_SMOOTH_HINT 0x0C51 +#define GL_LINE_SMOOTH_HINT 0x0C52 +#define GL_POLYGON_SMOOTH_HINT 0x0C53 +#define GL_FOG_HINT 0x0C54 +#define GL_TEXTURE_GEN_S 0x0C60 +#define GL_TEXTURE_GEN_T 0x0C61 +#define GL_TEXTURE_GEN_R 0x0C62 +#define GL_TEXTURE_GEN_Q 0x0C63 +#define GL_PIXEL_MAP_I_TO_I 0x0C70 +#define GL_PIXEL_MAP_S_TO_S 0x0C71 +#define GL_PIXEL_MAP_I_TO_R 0x0C72 +#define GL_PIXEL_MAP_I_TO_G 0x0C73 +#define GL_PIXEL_MAP_I_TO_B 0x0C74 +#define GL_PIXEL_MAP_I_TO_A 0x0C75 +#define GL_PIXEL_MAP_R_TO_R 0x0C76 +#define GL_PIXEL_MAP_G_TO_G 0x0C77 +#define GL_PIXEL_MAP_B_TO_B 0x0C78 +#define GL_PIXEL_MAP_A_TO_A 0x0C79 +#define GL_PIXEL_MAP_I_TO_I_SIZE 0x0CB0 +#define GL_PIXEL_MAP_S_TO_S_SIZE 0x0CB1 +#define GL_PIXEL_MAP_I_TO_R_SIZE 0x0CB2 +#define GL_PIXEL_MAP_I_TO_G_SIZE 0x0CB3 +#define GL_PIXEL_MAP_I_TO_B_SIZE 0x0CB4 +#define GL_PIXEL_MAP_I_TO_A_SIZE 0x0CB5 +#define GL_PIXEL_MAP_R_TO_R_SIZE 0x0CB6 +#define GL_PIXEL_MAP_G_TO_G_SIZE 0x0CB7 +#define GL_PIXEL_MAP_B_TO_B_SIZE 0x0CB8 +#define GL_PIXEL_MAP_A_TO_A_SIZE 0x0CB9 +#define GL_UNPACK_SWAP_BYTES 0x0CF0 +#define GL_UNPACK_LSB_FIRST 0x0CF1 +#define GL_UNPACK_ROW_LENGTH 0x0CF2 +#define GL_UNPACK_SKIP_ROWS 0x0CF3 +#define GL_UNPACK_SKIP_PIXELS 0x0CF4 +#define GL_UNPACK_ALIGNMENT 0x0CF5 +#define GL_PACK_SWAP_BYTES 0x0D00 +#define GL_PACK_LSB_FIRST 0x0D01 +#define GL_PACK_ROW_LENGTH 0x0D02 +#define GL_PACK_SKIP_ROWS 0x0D03 +#define GL_PACK_SKIP_PIXELS 0x0D04 +#define GL_PACK_ALIGNMENT 0x0D05 +#define GL_MAP_COLOR 0x0D10 +#define GL_MAP_STENCIL 0x0D11 +#define GL_INDEX_SHIFT 0x0D12 +#define GL_INDEX_OFFSET 0x0D13 +#define GL_RED_SCALE 0x0D14 +#define GL_RED_BIAS 0x0D15 +#define GL_ZOOM_X 0x0D16 +#define GL_ZOOM_Y 0x0D17 +#define GL_GREEN_SCALE 0x0D18 +#define GL_GREEN_BIAS 0x0D19 +#define GL_BLUE_SCALE 0x0D1A +#define GL_BLUE_BIAS 0x0D1B +#define GL_ALPHA_SCALE 0x0D1C +#define GL_ALPHA_BIAS 0x0D1D +#define GL_DEPTH_SCALE 0x0D1E +#define GL_DEPTH_BIAS 0x0D1F +#define GL_MAX_EVAL_ORDER 0x0D30 +#define GL_MAX_LIGHTS 0x0D31 +#define GL_MAX_CLIP_PLANES 0x0D32 +#define GL_MAX_TEXTURE_SIZE 0x0D33 +#define GL_MAX_PIXEL_MAP_TABLE 0x0D34 +#define GL_MAX_ATTRIB_STACK_DEPTH 0x0D35 +#define GL_MAX_MODELVIEW_STACK_DEPTH 0x0D36 +#define GL_MAX_NAME_STACK_DEPTH 0x0D37 +#define GL_MAX_PROJECTION_STACK_DEPTH 0x0D38 +#define GL_MAX_TEXTURE_STACK_DEPTH 0x0D39 +#define GL_MAX_VIEWPORT_DIMS 0x0D3A +#define GL_MAX_CLIENT_ATTRIB_STACK_DEPTH 0x0D3B +#define GL_SUBPIXEL_BITS 0x0D50 +#define GL_INDEX_BITS 0x0D51 +#define GL_RED_BITS 0x0D52 +#define GL_GREEN_BITS 0x0D53 +#define GL_BLUE_BITS 0x0D54 +#define GL_ALPHA_BITS 0x0D55 +#define GL_DEPTH_BITS 0x0D56 +#define GL_STENCIL_BITS 0x0D57 +#define GL_ACCUM_RED_BITS 0x0D58 +#define GL_ACCUM_GREEN_BITS 0x0D59 +#define GL_ACCUM_BLUE_BITS 0x0D5A +#define GL_ACCUM_ALPHA_BITS 0x0D5B +#define GL_NAME_STACK_DEPTH 0x0D70 +#define GL_AUTO_NORMAL 0x0D80 +#define GL_MAP1_COLOR_4 0x0D90 +#define GL_MAP1_INDEX 0x0D91 +#define GL_MAP1_NORMAL 0x0D92 +#define GL_MAP1_TEXTURE_COORD_1 0x0D93 +#define GL_MAP1_TEXTURE_COORD_2 0x0D94 +#define GL_MAP1_TEXTURE_COORD_3 0x0D95 +#define GL_MAP1_TEXTURE_COORD_4 0x0D96 +#define GL_MAP1_VERTEX_3 0x0D97 +#define GL_MAP1_VERTEX_4 0x0D98 +#define GL_MAP2_COLOR_4 0x0DB0 +#define GL_MAP2_INDEX 0x0DB1 +#define GL_MAP2_NORMAL 0x0DB2 +#define GL_MAP2_TEXTURE_COORD_1 0x0DB3 +#define GL_MAP2_TEXTURE_COORD_2 0x0DB4 +#define GL_MAP2_TEXTURE_COORD_3 0x0DB5 +#define GL_MAP2_TEXTURE_COORD_4 0x0DB6 +#define GL_MAP2_VERTEX_3 0x0DB7 +#define GL_MAP2_VERTEX_4 0x0DB8 +#define GL_MAP1_GRID_DOMAIN 0x0DD0 +#define GL_MAP1_GRID_SEGMENTS 0x0DD1 +#define GL_MAP2_GRID_DOMAIN 0x0DD2 +#define GL_MAP2_GRID_SEGMENTS 0x0DD3 +#define GL_TEXTURE_1D 0x0DE0 +#define GL_TEXTURE_2D 0x0DE1 +#define GL_FEEDBACK_BUFFER_POINTER 0x0DF0 +#define GL_FEEDBACK_BUFFER_SIZE 0x0DF1 +#define GL_FEEDBACK_BUFFER_TYPE 0x0DF2 +#define GL_SELECTION_BUFFER_POINTER 0x0DF3 +#define GL_SELECTION_BUFFER_SIZE 0x0DF4 +#define GL_TEXTURE_WIDTH 0x1000 +#define GL_TRANSFORM_BIT 0x00001000 +#define GL_TEXTURE_HEIGHT 0x1001 +#define GL_TEXTURE_INTERNAL_FORMAT 0x1003 +#define GL_TEXTURE_BORDER_COLOR 0x1004 +#define GL_TEXTURE_BORDER 0x1005 +#define GL_DONT_CARE 0x1100 +#define GL_FASTEST 0x1101 +#define GL_NICEST 0x1102 +#define GL_AMBIENT 0x1200 +#define GL_DIFFUSE 0x1201 +#define GL_SPECULAR 0x1202 +#define GL_POSITION 0x1203 +#define GL_SPOT_DIRECTION 0x1204 +#define GL_SPOT_EXPONENT 0x1205 +#define GL_SPOT_CUTOFF 0x1206 +#define GL_CONSTANT_ATTENUATION 0x1207 +#define GL_LINEAR_ATTENUATION 0x1208 +#define GL_QUADRATIC_ATTENUATION 0x1209 +#define GL_COMPILE 0x1300 +#define GL_COMPILE_AND_EXECUTE 0x1301 +#define GL_BYTE 0x1400 +#define GL_UNSIGNED_BYTE 0x1401 +#define GL_SHORT 0x1402 +#define GL_UNSIGNED_SHORT 0x1403 +#define GL_INT 0x1404 +#define GL_UNSIGNED_INT 0x1405 +#define GL_FLOAT 0x1406 +#define GL_2_BYTES 0x1407 +#define GL_3_BYTES 0x1408 +#define GL_4_BYTES 0x1409 +#define GL_DOUBLE 0x140A +#define GL_CLEAR 0x1500 +#define GL_AND 0x1501 +#define GL_AND_REVERSE 0x1502 +#define GL_COPY 0x1503 +#define GL_AND_INVERTED 0x1504 +#define GL_NOOP 0x1505 +#define GL_XOR 0x1506 +#define GL_OR 0x1507 +#define GL_NOR 0x1508 +#define GL_EQUIV 0x1509 +#define GL_INVERT 0x150A +#define GL_OR_REVERSE 0x150B +#define GL_COPY_INVERTED 0x150C +#define GL_OR_INVERTED 0x150D +#define GL_NAND 0x150E +#define GL_SET 0x150F +#define GL_EMISSION 0x1600 +#define GL_SHININESS 0x1601 +#define GL_AMBIENT_AND_DIFFUSE 0x1602 +#define GL_COLOR_INDEXES 0x1603 +#define GL_MODELVIEW 0x1700 +#define GL_PROJECTION 0x1701 +#define GL_TEXTURE 0x1702 +#define GL_COLOR 0x1800 +#define GL_DEPTH 0x1801 +#define GL_STENCIL 0x1802 +#define GL_COLOR_INDEX 0x1900 +#define GL_STENCIL_INDEX 0x1901 +#define GL_DEPTH_COMPONENT 0x1902 +#define GL_RED 0x1903 +#define GL_GREEN 0x1904 +#define GL_BLUE 0x1905 +#define GL_ALPHA 0x1906 +#define GL_RGB 0x1907 +#define GL_RGBA 0x1908 +#define GL_LUMINANCE 0x1909 +#define GL_LUMINANCE_ALPHA 0x190A +#define GL_BITMAP 0x1A00 +#define GL_POINT 0x1B00 +#define GL_LINE 0x1B01 +#define GL_FILL 0x1B02 +#define GL_RENDER 0x1C00 +#define GL_FEEDBACK 0x1C01 +#define GL_SELECT 0x1C02 +#define GL_FLAT 0x1D00 +#define GL_SMOOTH 0x1D01 +#define GL_KEEP 0x1E00 +#define GL_REPLACE 0x1E01 +#define GL_INCR 0x1E02 +#define GL_DECR 0x1E03 +#define GL_VENDOR 0x1F00 +#define GL_RENDERER 0x1F01 +#define GL_VERSION 0x1F02 +#define GL_EXTENSIONS 0x1F03 +#define GL_S 0x2000 +#define GL_ENABLE_BIT 0x00002000 +#define GL_T 0x2001 +#define GL_R 0x2002 +#define GL_Q 0x2003 +#define GL_MODULATE 0x2100 +#define GL_DECAL 0x2101 +#define GL_TEXTURE_ENV_MODE 0x2200 +#define GL_TEXTURE_ENV_COLOR 0x2201 +#define GL_TEXTURE_ENV 0x2300 +#define GL_EYE_LINEAR 0x2400 +#define GL_OBJECT_LINEAR 0x2401 +#define GL_SPHERE_MAP 0x2402 +#define GL_TEXTURE_GEN_MODE 0x2500 +#define GL_OBJECT_PLANE 0x2501 +#define GL_EYE_PLANE 0x2502 +#define GL_NEAREST 0x2600 +#define GL_LINEAR 0x2601 +#define GL_NEAREST_MIPMAP_NEAREST 0x2700 +#define GL_LINEAR_MIPMAP_NEAREST 0x2701 +#define GL_NEAREST_MIPMAP_LINEAR 0x2702 +#define GL_LINEAR_MIPMAP_LINEAR 0x2703 +#define GL_TEXTURE_MAG_FILTER 0x2800 +#define GL_TEXTURE_MIN_FILTER 0x2801 +#define GL_TEXTURE_WRAP_S 0x2802 +#define GL_TEXTURE_WRAP_T 0x2803 +#define GL_CLAMP 0x2900 +#define GL_REPEAT 0x2901 +#define GL_POLYGON_OFFSET_UNITS 0x2A00 +#define GL_POLYGON_OFFSET_POINT 0x2A01 +#define GL_POLYGON_OFFSET_LINE 0x2A02 +#define GL_R3_G3_B2 0x2A10 +#define GL_V2F 0x2A20 +#define GL_V3F 0x2A21 +#define GL_C4UB_V2F 0x2A22 +#define GL_C4UB_V3F 0x2A23 +#define GL_C3F_V3F 0x2A24 +#define GL_N3F_V3F 0x2A25 +#define GL_C4F_N3F_V3F 0x2A26 +#define GL_T2F_V3F 0x2A27 +#define GL_T4F_V4F 0x2A28 +#define GL_T2F_C4UB_V3F 0x2A29 +#define GL_T2F_C3F_V3F 0x2A2A +#define GL_T2F_N3F_V3F 0x2A2B +#define GL_T2F_C4F_N3F_V3F 0x2A2C +#define GL_T4F_C4F_N3F_V4F 0x2A2D +#define GL_CLIP_PLANE0 0x3000 +#define GL_CLIP_PLANE1 0x3001 +#define GL_CLIP_PLANE2 0x3002 +#define GL_CLIP_PLANE3 0x3003 +#define GL_CLIP_PLANE4 0x3004 +#define GL_CLIP_PLANE5 0x3005 +#define GL_LIGHT0 0x4000 +#define GL_COLOR_BUFFER_BIT 0x00004000 +#define GL_LIGHT1 0x4001 +#define GL_LIGHT2 0x4002 +#define GL_LIGHT3 0x4003 +#define GL_LIGHT4 0x4004 +#define GL_LIGHT5 0x4005 +#define GL_LIGHT6 0x4006 +#define GL_LIGHT7 0x4007 +#define GL_HINT_BIT 0x00008000 +#define GL_POLYGON_OFFSET_FILL 0x8037 +#define GL_POLYGON_OFFSET_FACTOR 0x8038 +#define GL_ALPHA4 0x803B +#define GL_ALPHA8 0x803C +#define GL_ALPHA12 0x803D +#define GL_ALPHA16 0x803E +#define GL_LUMINANCE4 0x803F +#define GL_LUMINANCE8 0x8040 +#define GL_LUMINANCE12 0x8041 +#define GL_LUMINANCE16 0x8042 +#define GL_LUMINANCE4_ALPHA4 0x8043 +#define GL_LUMINANCE6_ALPHA2 0x8044 +#define GL_LUMINANCE8_ALPHA8 0x8045 +#define GL_LUMINANCE12_ALPHA4 0x8046 +#define GL_LUMINANCE12_ALPHA12 0x8047 +#define GL_LUMINANCE16_ALPHA16 0x8048 +#define GL_INTENSITY 0x8049 +#define GL_INTENSITY4 0x804A +#define GL_INTENSITY8 0x804B +#define GL_INTENSITY12 0x804C +#define GL_INTENSITY16 0x804D +#define GL_RGB4 0x804F +#define GL_RGB5 0x8050 +#define GL_RGB8 0x8051 +#define GL_RGB10 0x8052 +#define GL_RGB12 0x8053 +#define GL_RGB16 0x8054 +#define GL_RGBA2 0x8055 +#define GL_RGBA4 0x8056 +#define GL_RGB5_A1 0x8057 +#define GL_RGBA8 0x8058 +#define GL_RGB10_A2 0x8059 +#define GL_RGBA12 0x805A +#define GL_RGBA16 0x805B +#define GL_TEXTURE_RED_SIZE 0x805C +#define GL_TEXTURE_GREEN_SIZE 0x805D +#define GL_TEXTURE_BLUE_SIZE 0x805E +#define GL_TEXTURE_ALPHA_SIZE 0x805F +#define GL_TEXTURE_LUMINANCE_SIZE 0x8060 +#define GL_TEXTURE_INTENSITY_SIZE 0x8061 +#define GL_PROXY_TEXTURE_1D 0x8063 +#define GL_PROXY_TEXTURE_2D 0x8064 +#define GL_TEXTURE_PRIORITY 0x8066 +#define GL_TEXTURE_RESIDENT 0x8067 +#define GL_TEXTURE_BINDING_1D 0x8068 +#define GL_TEXTURE_BINDING_2D 0x8069 +#define GL_VERTEX_ARRAY 0x8074 +#define GL_NORMAL_ARRAY 0x8075 +#define GL_COLOR_ARRAY 0x8076 +#define GL_INDEX_ARRAY 0x8077 +#define GL_TEXTURE_COORD_ARRAY 0x8078 +#define GL_EDGE_FLAG_ARRAY 0x8079 +#define GL_VERTEX_ARRAY_SIZE 0x807A +#define GL_VERTEX_ARRAY_TYPE 0x807B +#define GL_VERTEX_ARRAY_STRIDE 0x807C +#define GL_NORMAL_ARRAY_TYPE 0x807E +#define GL_NORMAL_ARRAY_STRIDE 0x807F +#define GL_COLOR_ARRAY_SIZE 0x8081 +#define GL_COLOR_ARRAY_TYPE 0x8082 +#define GL_COLOR_ARRAY_STRIDE 0x8083 +#define GL_INDEX_ARRAY_TYPE 0x8085 +#define GL_INDEX_ARRAY_STRIDE 0x8086 +#define GL_TEXTURE_COORD_ARRAY_SIZE 0x8088 +#define GL_TEXTURE_COORD_ARRAY_TYPE 0x8089 +#define GL_TEXTURE_COORD_ARRAY_STRIDE 0x808A +#define GL_EDGE_FLAG_ARRAY_STRIDE 0x808C +#define GL_VERTEX_ARRAY_POINTER 0x808E +#define GL_NORMAL_ARRAY_POINTER 0x808F +#define GL_COLOR_ARRAY_POINTER 0x8090 +#define GL_INDEX_ARRAY_POINTER 0x8091 +#define GL_TEXTURE_COORD_ARRAY_POINTER 0x8092 +#define GL_EDGE_FLAG_ARRAY_POINTER 0x8093 +#define GL_COLOR_INDEX1_EXT 0x80E2 +#define GL_COLOR_INDEX2_EXT 0x80E3 +#define GL_COLOR_INDEX4_EXT 0x80E4 +#define GL_COLOR_INDEX8_EXT 0x80E5 +#define GL_COLOR_INDEX12_EXT 0x80E6 +#define GL_COLOR_INDEX16_EXT 0x80E7 +#define GL_EVAL_BIT 0x00010000 +#define GL_LIST_BIT 0x00020000 +#define GL_TEXTURE_BIT 0x00040000 +#define GL_SCISSOR_BIT 0x00080000 +#define GL_ALL_ATTRIB_BITS 0x000fffff +#define GL_CLIENT_ALL_ATTRIB_BITS 0xffffffff + +GLAPI void GLAPIENTRY glAccum (GLenum op, GLfloat value); +GLAPI void GLAPIENTRY glAlphaFunc (GLenum func, GLclampf ref); +GLAPI GLboolean GLAPIENTRY glAreTexturesResident (GLsizei n, const GLuint *textures, GLboolean *residences); +GLAPI void GLAPIENTRY glArrayElement (GLint i); +GLAPI void GLAPIENTRY glBegin (GLenum mode); +GLAPI void GLAPIENTRY glBindTexture (GLenum target, GLuint texture); +GLAPI void GLAPIENTRY glBitmap (GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, const GLubyte *bitmap); +GLAPI void GLAPIENTRY glBlendFunc (GLenum sfactor, GLenum dfactor); +GLAPI void GLAPIENTRY glCallList (GLuint list); +GLAPI void GLAPIENTRY glCallLists (GLsizei n, GLenum type, const GLvoid *lists); +GLAPI void GLAPIENTRY glClear (GLbitfield mask); +GLAPI void GLAPIENTRY glClearAccum (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); +GLAPI void GLAPIENTRY glClearColor (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); +GLAPI void GLAPIENTRY glClearDepth (GLclampd depth); +GLAPI void GLAPIENTRY glClearIndex (GLfloat c); +GLAPI void GLAPIENTRY glClearStencil (GLint s); +GLAPI void GLAPIENTRY glClipPlane (GLenum plane, const GLdouble *equation); +GLAPI void GLAPIENTRY glColor3b (GLbyte red, GLbyte green, GLbyte blue); +GLAPI void GLAPIENTRY glColor3bv (const GLbyte *v); +GLAPI void GLAPIENTRY glColor3d (GLdouble red, GLdouble green, GLdouble blue); +GLAPI void GLAPIENTRY glColor3dv (const GLdouble *v); +GLAPI void GLAPIENTRY glColor3f (GLfloat red, GLfloat green, GLfloat blue); +GLAPI void GLAPIENTRY glColor3fv (const GLfloat *v); +GLAPI void GLAPIENTRY glColor3i (GLint red, GLint green, GLint blue); +GLAPI void GLAPIENTRY glColor3iv (const GLint *v); +GLAPI void GLAPIENTRY glColor3s (GLshort red, GLshort green, GLshort blue); +GLAPI void GLAPIENTRY glColor3sv (const GLshort *v); +GLAPI void GLAPIENTRY glColor3ub (GLubyte red, GLubyte green, GLubyte blue); +GLAPI void GLAPIENTRY glColor3ubv (const GLubyte *v); +GLAPI void GLAPIENTRY glColor3ui (GLuint red, GLuint green, GLuint blue); +GLAPI void GLAPIENTRY glColor3uiv (const GLuint *v); +GLAPI void GLAPIENTRY glColor3us (GLushort red, GLushort green, GLushort blue); +GLAPI void GLAPIENTRY glColor3usv (const GLushort *v); +GLAPI void GLAPIENTRY glColor4b (GLbyte red, GLbyte green, GLbyte blue, GLbyte alpha); +GLAPI void GLAPIENTRY glColor4bv (const GLbyte *v); +GLAPI void GLAPIENTRY glColor4d (GLdouble red, GLdouble green, GLdouble blue, GLdouble alpha); +GLAPI void GLAPIENTRY glColor4dv (const GLdouble *v); +GLAPI void GLAPIENTRY glColor4f (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); +GLAPI void GLAPIENTRY glColor4fv (const GLfloat *v); +GLAPI void GLAPIENTRY glColor4i (GLint red, GLint green, GLint blue, GLint alpha); +GLAPI void GLAPIENTRY glColor4iv (const GLint *v); +GLAPI void GLAPIENTRY glColor4s (GLshort red, GLshort green, GLshort blue, GLshort alpha); +GLAPI void GLAPIENTRY glColor4sv (const GLshort *v); +GLAPI void GLAPIENTRY glColor4ub (GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha); +GLAPI void GLAPIENTRY glColor4ubv (const GLubyte *v); +GLAPI void GLAPIENTRY glColor4ui (GLuint red, GLuint green, GLuint blue, GLuint alpha); +GLAPI void GLAPIENTRY glColor4uiv (const GLuint *v); +GLAPI void GLAPIENTRY glColor4us (GLushort red, GLushort green, GLushort blue, GLushort alpha); +GLAPI void GLAPIENTRY glColor4usv (const GLushort *v); +GLAPI void GLAPIENTRY glColorMask (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); +GLAPI void GLAPIENTRY glColorMaterial (GLenum face, GLenum mode); +GLAPI void GLAPIENTRY glColorPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +GLAPI void GLAPIENTRY glCopyPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum type); +GLAPI void GLAPIENTRY glCopyTexImage1D (GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLint border); +GLAPI void GLAPIENTRY glCopyTexImage2D (GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); +GLAPI void GLAPIENTRY glCopyTexSubImage1D (GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); +GLAPI void GLAPIENTRY glCopyTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); +GLAPI void GLAPIENTRY glCullFace (GLenum mode); +GLAPI void GLAPIENTRY glDeleteLists (GLuint list, GLsizei range); +GLAPI void GLAPIENTRY glDeleteTextures (GLsizei n, const GLuint *textures); +GLAPI void GLAPIENTRY glDepthFunc (GLenum func); +GLAPI void GLAPIENTRY glDepthMask (GLboolean flag); +GLAPI void GLAPIENTRY glDepthRange (GLclampd zNear, GLclampd zFar); +GLAPI void GLAPIENTRY glDisable (GLenum cap); +GLAPI void GLAPIENTRY glDisableClientState (GLenum array); +GLAPI void GLAPIENTRY glDrawArrays (GLenum mode, GLint first, GLsizei count); +GLAPI void GLAPIENTRY glDrawBuffer (GLenum mode); +GLAPI void GLAPIENTRY glDrawElements (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices); +GLAPI void GLAPIENTRY glDrawPixels (GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels); +GLAPI void GLAPIENTRY glEdgeFlag (GLboolean flag); +GLAPI void GLAPIENTRY glEdgeFlagPointer (GLsizei stride, const GLvoid *pointer); +GLAPI void GLAPIENTRY glEdgeFlagv (const GLboolean *flag); +GLAPI void GLAPIENTRY glEnable (GLenum cap); +GLAPI void GLAPIENTRY glEnableClientState (GLenum array); +GLAPI void GLAPIENTRY glEnd (void); +GLAPI void GLAPIENTRY glEndList (void); +GLAPI void GLAPIENTRY glEvalCoord1d (GLdouble u); +GLAPI void GLAPIENTRY glEvalCoord1dv (const GLdouble *u); +GLAPI void GLAPIENTRY glEvalCoord1f (GLfloat u); +GLAPI void GLAPIENTRY glEvalCoord1fv (const GLfloat *u); +GLAPI void GLAPIENTRY glEvalCoord2d (GLdouble u, GLdouble v); +GLAPI void GLAPIENTRY glEvalCoord2dv (const GLdouble *u); +GLAPI void GLAPIENTRY glEvalCoord2f (GLfloat u, GLfloat v); +GLAPI void GLAPIENTRY glEvalCoord2fv (const GLfloat *u); +GLAPI void GLAPIENTRY glEvalMesh1 (GLenum mode, GLint i1, GLint i2); +GLAPI void GLAPIENTRY glEvalMesh2 (GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2); +GLAPI void GLAPIENTRY glEvalPoint1 (GLint i); +GLAPI void GLAPIENTRY glEvalPoint2 (GLint i, GLint j); +GLAPI void GLAPIENTRY glFeedbackBuffer (GLsizei size, GLenum type, GLfloat *buffer); +GLAPI void GLAPIENTRY glFinish (void); +GLAPI void GLAPIENTRY glFlush (void); +GLAPI void GLAPIENTRY glFogf (GLenum pname, GLfloat param); +GLAPI void GLAPIENTRY glFogfv (GLenum pname, const GLfloat *params); +GLAPI void GLAPIENTRY glFogi (GLenum pname, GLint param); +GLAPI void GLAPIENTRY glFogiv (GLenum pname, const GLint *params); +GLAPI void GLAPIENTRY glFrontFace (GLenum mode); +GLAPI void GLAPIENTRY glFrustum (GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); +GLAPI GLuint GLAPIENTRY glGenLists (GLsizei range); +GLAPI void GLAPIENTRY glGenTextures (GLsizei n, GLuint *textures); +GLAPI void GLAPIENTRY glGetBooleanv (GLenum pname, GLboolean *params); +GLAPI void GLAPIENTRY glGetClipPlane (GLenum plane, GLdouble *equation); +GLAPI void GLAPIENTRY glGetDoublev (GLenum pname, GLdouble *params); +GLAPI GLenum GLAPIENTRY glGetError (void); +GLAPI void GLAPIENTRY glGetFloatv (GLenum pname, GLfloat *params); +GLAPI void GLAPIENTRY glGetIntegerv (GLenum pname, GLint *params); +GLAPI void GLAPIENTRY glGetLightfv (GLenum light, GLenum pname, GLfloat *params); +GLAPI void GLAPIENTRY glGetLightiv (GLenum light, GLenum pname, GLint *params); +GLAPI void GLAPIENTRY glGetMapdv (GLenum target, GLenum query, GLdouble *v); +GLAPI void GLAPIENTRY glGetMapfv (GLenum target, GLenum query, GLfloat *v); +GLAPI void GLAPIENTRY glGetMapiv (GLenum target, GLenum query, GLint *v); +GLAPI void GLAPIENTRY glGetMaterialfv (GLenum face, GLenum pname, GLfloat *params); +GLAPI void GLAPIENTRY glGetMaterialiv (GLenum face, GLenum pname, GLint *params); +GLAPI void GLAPIENTRY glGetPixelMapfv (GLenum map, GLfloat *values); +GLAPI void GLAPIENTRY glGetPixelMapuiv (GLenum map, GLuint *values); +GLAPI void GLAPIENTRY glGetPixelMapusv (GLenum map, GLushort *values); +GLAPI void GLAPIENTRY glGetPointerv (GLenum pname, GLvoid* *params); +GLAPI void GLAPIENTRY glGetPolygonStipple (GLubyte *mask); +GLAPI const GLubyte * GLAPIENTRY glGetString (GLenum name); +GLAPI void GLAPIENTRY glGetTexEnvfv (GLenum target, GLenum pname, GLfloat *params); +GLAPI void GLAPIENTRY glGetTexEnviv (GLenum target, GLenum pname, GLint *params); +GLAPI void GLAPIENTRY glGetTexGendv (GLenum coord, GLenum pname, GLdouble *params); +GLAPI void GLAPIENTRY glGetTexGenfv (GLenum coord, GLenum pname, GLfloat *params); +GLAPI void GLAPIENTRY glGetTexGeniv (GLenum coord, GLenum pname, GLint *params); +GLAPI void GLAPIENTRY glGetTexImage (GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels); +GLAPI void GLAPIENTRY glGetTexLevelParameterfv (GLenum target, GLint level, GLenum pname, GLfloat *params); +GLAPI void GLAPIENTRY glGetTexLevelParameteriv (GLenum target, GLint level, GLenum pname, GLint *params); +GLAPI void GLAPIENTRY glGetTexParameterfv (GLenum target, GLenum pname, GLfloat *params); +GLAPI void GLAPIENTRY glGetTexParameteriv (GLenum target, GLenum pname, GLint *params); +GLAPI void GLAPIENTRY glHint (GLenum target, GLenum mode); +GLAPI void GLAPIENTRY glIndexMask (GLuint mask); +GLAPI void GLAPIENTRY glIndexPointer (GLenum type, GLsizei stride, const GLvoid *pointer); +GLAPI void GLAPIENTRY glIndexd (GLdouble c); +GLAPI void GLAPIENTRY glIndexdv (const GLdouble *c); +GLAPI void GLAPIENTRY glIndexf (GLfloat c); +GLAPI void GLAPIENTRY glIndexfv (const GLfloat *c); +GLAPI void GLAPIENTRY glIndexi (GLint c); +GLAPI void GLAPIENTRY glIndexiv (const GLint *c); +GLAPI void GLAPIENTRY glIndexs (GLshort c); +GLAPI void GLAPIENTRY glIndexsv (const GLshort *c); +GLAPI void GLAPIENTRY glIndexub (GLubyte c); +GLAPI void GLAPIENTRY glIndexubv (const GLubyte *c); +GLAPI void GLAPIENTRY glInitNames (void); +GLAPI void GLAPIENTRY glInterleavedArrays (GLenum format, GLsizei stride, const GLvoid *pointer); +GLAPI GLboolean GLAPIENTRY glIsEnabled (GLenum cap); +GLAPI GLboolean GLAPIENTRY glIsList (GLuint list); +GLAPI GLboolean GLAPIENTRY glIsTexture (GLuint texture); +GLAPI void GLAPIENTRY glLightModelf (GLenum pname, GLfloat param); +GLAPI void GLAPIENTRY glLightModelfv (GLenum pname, const GLfloat *params); +GLAPI void GLAPIENTRY glLightModeli (GLenum pname, GLint param); +GLAPI void GLAPIENTRY glLightModeliv (GLenum pname, const GLint *params); +GLAPI void GLAPIENTRY glLightf (GLenum light, GLenum pname, GLfloat param); +GLAPI void GLAPIENTRY glLightfv (GLenum light, GLenum pname, const GLfloat *params); +GLAPI void GLAPIENTRY glLighti (GLenum light, GLenum pname, GLint param); +GLAPI void GLAPIENTRY glLightiv (GLenum light, GLenum pname, const GLint *params); +GLAPI void GLAPIENTRY glLineStipple (GLint factor, GLushort pattern); +GLAPI void GLAPIENTRY glLineWidth (GLfloat width); +GLAPI void GLAPIENTRY glListBase (GLuint base); +GLAPI void GLAPIENTRY glLoadIdentity (void); +GLAPI void GLAPIENTRY glLoadMatrixd (const GLdouble *m); +GLAPI void GLAPIENTRY glLoadMatrixf (const GLfloat *m); +GLAPI void GLAPIENTRY glLoadName (GLuint name); +GLAPI void GLAPIENTRY glLogicOp (GLenum opcode); +GLAPI void GLAPIENTRY glMap1d (GLenum target, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble *points); +GLAPI void GLAPIENTRY glMap1f (GLenum target, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat *points); +GLAPI void GLAPIENTRY glMap2d (GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble *points); +GLAPI void GLAPIENTRY glMap2f (GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat *points); +GLAPI void GLAPIENTRY glMapGrid1d (GLint un, GLdouble u1, GLdouble u2); +GLAPI void GLAPIENTRY glMapGrid1f (GLint un, GLfloat u1, GLfloat u2); +GLAPI void GLAPIENTRY glMapGrid2d (GLint un, GLdouble u1, GLdouble u2, GLint vn, GLdouble v1, GLdouble v2); +GLAPI void GLAPIENTRY glMapGrid2f (GLint un, GLfloat u1, GLfloat u2, GLint vn, GLfloat v1, GLfloat v2); +GLAPI void GLAPIENTRY glMaterialf (GLenum face, GLenum pname, GLfloat param); +GLAPI void GLAPIENTRY glMaterialfv (GLenum face, GLenum pname, const GLfloat *params); +GLAPI void GLAPIENTRY glMateriali (GLenum face, GLenum pname, GLint param); +GLAPI void GLAPIENTRY glMaterialiv (GLenum face, GLenum pname, const GLint *params); +GLAPI void GLAPIENTRY glMatrixMode (GLenum mode); +GLAPI void GLAPIENTRY glMultMatrixd (const GLdouble *m); +GLAPI void GLAPIENTRY glMultMatrixf (const GLfloat *m); +GLAPI void GLAPIENTRY glNewList (GLuint list, GLenum mode); +GLAPI void GLAPIENTRY glNormal3b (GLbyte nx, GLbyte ny, GLbyte nz); +GLAPI void GLAPIENTRY glNormal3bv (const GLbyte *v); +GLAPI void GLAPIENTRY glNormal3d (GLdouble nx, GLdouble ny, GLdouble nz); +GLAPI void GLAPIENTRY glNormal3dv (const GLdouble *v); +GLAPI void GLAPIENTRY glNormal3f (GLfloat nx, GLfloat ny, GLfloat nz); +GLAPI void GLAPIENTRY glNormal3fv (const GLfloat *v); +GLAPI void GLAPIENTRY glNormal3i (GLint nx, GLint ny, GLint nz); +GLAPI void GLAPIENTRY glNormal3iv (const GLint *v); +GLAPI void GLAPIENTRY glNormal3s (GLshort nx, GLshort ny, GLshort nz); +GLAPI void GLAPIENTRY glNormal3sv (const GLshort *v); +GLAPI void GLAPIENTRY glNormalPointer (GLenum type, GLsizei stride, const GLvoid *pointer); +GLAPI void GLAPIENTRY glOrtho (GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); +GLAPI void GLAPIENTRY glPassThrough (GLfloat token); +GLAPI void GLAPIENTRY glPixelMapfv (GLenum map, GLsizei mapsize, const GLfloat *values); +GLAPI void GLAPIENTRY glPixelMapuiv (GLenum map, GLsizei mapsize, const GLuint *values); +GLAPI void GLAPIENTRY glPixelMapusv (GLenum map, GLsizei mapsize, const GLushort *values); +GLAPI void GLAPIENTRY glPixelStoref (GLenum pname, GLfloat param); +GLAPI void GLAPIENTRY glPixelStorei (GLenum pname, GLint param); +GLAPI void GLAPIENTRY glPixelTransferf (GLenum pname, GLfloat param); +GLAPI void GLAPIENTRY glPixelTransferi (GLenum pname, GLint param); +GLAPI void GLAPIENTRY glPixelZoom (GLfloat xfactor, GLfloat yfactor); +GLAPI void GLAPIENTRY glPointSize (GLfloat size); +GLAPI void GLAPIENTRY glPolygonMode (GLenum face, GLenum mode); +GLAPI void GLAPIENTRY glPolygonOffset (GLfloat factor, GLfloat units); +GLAPI void GLAPIENTRY glPolygonStipple (const GLubyte *mask); +GLAPI void GLAPIENTRY glPopAttrib (void); +GLAPI void GLAPIENTRY glPopClientAttrib (void); +GLAPI void GLAPIENTRY glPopMatrix (void); +GLAPI void GLAPIENTRY glPopName (void); +GLAPI void GLAPIENTRY glPrioritizeTextures (GLsizei n, const GLuint *textures, const GLclampf *priorities); +GLAPI void GLAPIENTRY glPushAttrib (GLbitfield mask); +GLAPI void GLAPIENTRY glPushClientAttrib (GLbitfield mask); +GLAPI void GLAPIENTRY glPushMatrix (void); +GLAPI void GLAPIENTRY glPushName (GLuint name); +GLAPI void GLAPIENTRY glRasterPos2d (GLdouble x, GLdouble y); +GLAPI void GLAPIENTRY glRasterPos2dv (const GLdouble *v); +GLAPI void GLAPIENTRY glRasterPos2f (GLfloat x, GLfloat y); +GLAPI void GLAPIENTRY glRasterPos2fv (const GLfloat *v); +GLAPI void GLAPIENTRY glRasterPos2i (GLint x, GLint y); +GLAPI void GLAPIENTRY glRasterPos2iv (const GLint *v); +GLAPI void GLAPIENTRY glRasterPos2s (GLshort x, GLshort y); +GLAPI void GLAPIENTRY glRasterPos2sv (const GLshort *v); +GLAPI void GLAPIENTRY glRasterPos3d (GLdouble x, GLdouble y, GLdouble z); +GLAPI void GLAPIENTRY glRasterPos3dv (const GLdouble *v); +GLAPI void GLAPIENTRY glRasterPos3f (GLfloat x, GLfloat y, GLfloat z); +GLAPI void GLAPIENTRY glRasterPos3fv (const GLfloat *v); +GLAPI void GLAPIENTRY glRasterPos3i (GLint x, GLint y, GLint z); +GLAPI void GLAPIENTRY glRasterPos3iv (const GLint *v); +GLAPI void GLAPIENTRY glRasterPos3s (GLshort x, GLshort y, GLshort z); +GLAPI void GLAPIENTRY glRasterPos3sv (const GLshort *v); +GLAPI void GLAPIENTRY glRasterPos4d (GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI void GLAPIENTRY glRasterPos4dv (const GLdouble *v); +GLAPI void GLAPIENTRY glRasterPos4f (GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GLAPI void GLAPIENTRY glRasterPos4fv (const GLfloat *v); +GLAPI void GLAPIENTRY glRasterPos4i (GLint x, GLint y, GLint z, GLint w); +GLAPI void GLAPIENTRY glRasterPos4iv (const GLint *v); +GLAPI void GLAPIENTRY glRasterPos4s (GLshort x, GLshort y, GLshort z, GLshort w); +GLAPI void GLAPIENTRY glRasterPos4sv (const GLshort *v); +GLAPI void GLAPIENTRY glReadBuffer (GLenum mode); +GLAPI void GLAPIENTRY glReadPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels); +GLAPI void GLAPIENTRY glRectd (GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2); +GLAPI void GLAPIENTRY glRectdv (const GLdouble *v1, const GLdouble *v2); +GLAPI void GLAPIENTRY glRectf (GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2); +GLAPI void GLAPIENTRY glRectfv (const GLfloat *v1, const GLfloat *v2); +GLAPI void GLAPIENTRY glRecti (GLint x1, GLint y1, GLint x2, GLint y2); +GLAPI void GLAPIENTRY glRectiv (const GLint *v1, const GLint *v2); +GLAPI void GLAPIENTRY glRects (GLshort x1, GLshort y1, GLshort x2, GLshort y2); +GLAPI void GLAPIENTRY glRectsv (const GLshort *v1, const GLshort *v2); +GLAPI GLint GLAPIENTRY glRenderMode (GLenum mode); +GLAPI void GLAPIENTRY glRotated (GLdouble angle, GLdouble x, GLdouble y, GLdouble z); +GLAPI void GLAPIENTRY glRotatef (GLfloat angle, GLfloat x, GLfloat y, GLfloat z); +GLAPI void GLAPIENTRY glScaled (GLdouble x, GLdouble y, GLdouble z); +GLAPI void GLAPIENTRY glScalef (GLfloat x, GLfloat y, GLfloat z); +GLAPI void GLAPIENTRY glScissor (GLint x, GLint y, GLsizei width, GLsizei height); +GLAPI void GLAPIENTRY glSelectBuffer (GLsizei size, GLuint *buffer); +GLAPI void GLAPIENTRY glShadeModel (GLenum mode); +GLAPI void GLAPIENTRY glStencilFunc (GLenum func, GLint ref, GLuint mask); +GLAPI void GLAPIENTRY glStencilMask (GLuint mask); +GLAPI void GLAPIENTRY glStencilOp (GLenum fail, GLenum zfail, GLenum zpass); +GLAPI void GLAPIENTRY glTexCoord1d (GLdouble s); +GLAPI void GLAPIENTRY glTexCoord1dv (const GLdouble *v); +GLAPI void GLAPIENTRY glTexCoord1f (GLfloat s); +GLAPI void GLAPIENTRY glTexCoord1fv (const GLfloat *v); +GLAPI void GLAPIENTRY glTexCoord1i (GLint s); +GLAPI void GLAPIENTRY glTexCoord1iv (const GLint *v); +GLAPI void GLAPIENTRY glTexCoord1s (GLshort s); +GLAPI void GLAPIENTRY glTexCoord1sv (const GLshort *v); +GLAPI void GLAPIENTRY glTexCoord2d (GLdouble s, GLdouble t); +GLAPI void GLAPIENTRY glTexCoord2dv (const GLdouble *v); +GLAPI void GLAPIENTRY glTexCoord2f (GLfloat s, GLfloat t); +GLAPI void GLAPIENTRY glTexCoord2fv (const GLfloat *v); +GLAPI void GLAPIENTRY glTexCoord2i (GLint s, GLint t); +GLAPI void GLAPIENTRY glTexCoord2iv (const GLint *v); +GLAPI void GLAPIENTRY glTexCoord2s (GLshort s, GLshort t); +GLAPI void GLAPIENTRY glTexCoord2sv (const GLshort *v); +GLAPI void GLAPIENTRY glTexCoord3d (GLdouble s, GLdouble t, GLdouble r); +GLAPI void GLAPIENTRY glTexCoord3dv (const GLdouble *v); +GLAPI void GLAPIENTRY glTexCoord3f (GLfloat s, GLfloat t, GLfloat r); +GLAPI void GLAPIENTRY glTexCoord3fv (const GLfloat *v); +GLAPI void GLAPIENTRY glTexCoord3i (GLint s, GLint t, GLint r); +GLAPI void GLAPIENTRY glTexCoord3iv (const GLint *v); +GLAPI void GLAPIENTRY glTexCoord3s (GLshort s, GLshort t, GLshort r); +GLAPI void GLAPIENTRY glTexCoord3sv (const GLshort *v); +GLAPI void GLAPIENTRY glTexCoord4d (GLdouble s, GLdouble t, GLdouble r, GLdouble q); +GLAPI void GLAPIENTRY glTexCoord4dv (const GLdouble *v); +GLAPI void GLAPIENTRY glTexCoord4f (GLfloat s, GLfloat t, GLfloat r, GLfloat q); +GLAPI void GLAPIENTRY glTexCoord4fv (const GLfloat *v); +GLAPI void GLAPIENTRY glTexCoord4i (GLint s, GLint t, GLint r, GLint q); +GLAPI void GLAPIENTRY glTexCoord4iv (const GLint *v); +GLAPI void GLAPIENTRY glTexCoord4s (GLshort s, GLshort t, GLshort r, GLshort q); +GLAPI void GLAPIENTRY glTexCoord4sv (const GLshort *v); +GLAPI void GLAPIENTRY glTexCoordPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +GLAPI void GLAPIENTRY glTexEnvf (GLenum target, GLenum pname, GLfloat param); +GLAPI void GLAPIENTRY glTexEnvfv (GLenum target, GLenum pname, const GLfloat *params); +GLAPI void GLAPIENTRY glTexEnvi (GLenum target, GLenum pname, GLint param); +GLAPI void GLAPIENTRY glTexEnviv (GLenum target, GLenum pname, const GLint *params); +GLAPI void GLAPIENTRY glTexGend (GLenum coord, GLenum pname, GLdouble param); +GLAPI void GLAPIENTRY glTexGendv (GLenum coord, GLenum pname, const GLdouble *params); +GLAPI void GLAPIENTRY glTexGenf (GLenum coord, GLenum pname, GLfloat param); +GLAPI void GLAPIENTRY glTexGenfv (GLenum coord, GLenum pname, const GLfloat *params); +GLAPI void GLAPIENTRY glTexGeni (GLenum coord, GLenum pname, GLint param); +GLAPI void GLAPIENTRY glTexGeniv (GLenum coord, GLenum pname, const GLint *params); +GLAPI void GLAPIENTRY glTexImage1D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +GLAPI void GLAPIENTRY glTexImage2D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +GLAPI void GLAPIENTRY glTexParameterf (GLenum target, GLenum pname, GLfloat param); +GLAPI void GLAPIENTRY glTexParameterfv (GLenum target, GLenum pname, const GLfloat *params); +GLAPI void GLAPIENTRY glTexParameteri (GLenum target, GLenum pname, GLint param); +GLAPI void GLAPIENTRY glTexParameteriv (GLenum target, GLenum pname, const GLint *params); +GLAPI void GLAPIENTRY glTexSubImage1D (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels); +GLAPI void GLAPIENTRY glTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels); +GLAPI void GLAPIENTRY glTranslated (GLdouble x, GLdouble y, GLdouble z); +GLAPI void GLAPIENTRY glTranslatef (GLfloat x, GLfloat y, GLfloat z); +GLAPI void GLAPIENTRY glVertex2d (GLdouble x, GLdouble y); +GLAPI void GLAPIENTRY glVertex2dv (const GLdouble *v); +GLAPI void GLAPIENTRY glVertex2f (GLfloat x, GLfloat y); +GLAPI void GLAPIENTRY glVertex2fv (const GLfloat *v); +GLAPI void GLAPIENTRY glVertex2i (GLint x, GLint y); +GLAPI void GLAPIENTRY glVertex2iv (const GLint *v); +GLAPI void GLAPIENTRY glVertex2s (GLshort x, GLshort y); +GLAPI void GLAPIENTRY glVertex2sv (const GLshort *v); +GLAPI void GLAPIENTRY glVertex3d (GLdouble x, GLdouble y, GLdouble z); +GLAPI void GLAPIENTRY glVertex3dv (const GLdouble *v); +GLAPI void GLAPIENTRY glVertex3f (GLfloat x, GLfloat y, GLfloat z); +GLAPI void GLAPIENTRY glVertex3fv (const GLfloat *v); +GLAPI void GLAPIENTRY glVertex3i (GLint x, GLint y, GLint z); +GLAPI void GLAPIENTRY glVertex3iv (const GLint *v); +GLAPI void GLAPIENTRY glVertex3s (GLshort x, GLshort y, GLshort z); +GLAPI void GLAPIENTRY glVertex3sv (const GLshort *v); +GLAPI void GLAPIENTRY glVertex4d (GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI void GLAPIENTRY glVertex4dv (const GLdouble *v); +GLAPI void GLAPIENTRY glVertex4f (GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GLAPI void GLAPIENTRY glVertex4fv (const GLfloat *v); +GLAPI void GLAPIENTRY glVertex4i (GLint x, GLint y, GLint z, GLint w); +GLAPI void GLAPIENTRY glVertex4iv (const GLint *v); +GLAPI void GLAPIENTRY glVertex4s (GLshort x, GLshort y, GLshort z, GLshort w); +GLAPI void GLAPIENTRY glVertex4sv (const GLshort *v); +GLAPI void GLAPIENTRY glVertexPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +GLAPI void GLAPIENTRY glViewport (GLint x, GLint y, GLsizei width, GLsizei height); + +#define GLEW_VERSION_1_1 GLEW_GET_VAR(__GLEW_VERSION_1_1) + +#endif /* GL_VERSION_1_1 */ + +/* ---------------------------------- GLU ---------------------------------- */ + +#ifndef GLEW_NO_GLU +/* this is where we can safely include GLU */ +# if defined(__APPLE__) && defined(__MACH__) +# include +# else +# include +# endif +#endif + +/* ----------------------------- GL_VERSION_1_2 ---------------------------- */ + +#ifndef GL_VERSION_1_2 +#define GL_VERSION_1_2 1 + +#define GL_SMOOTH_POINT_SIZE_RANGE 0x0B12 +#define GL_SMOOTH_POINT_SIZE_GRANULARITY 0x0B13 +#define GL_SMOOTH_LINE_WIDTH_RANGE 0x0B22 +#define GL_SMOOTH_LINE_WIDTH_GRANULARITY 0x0B23 +#define GL_UNSIGNED_BYTE_3_3_2 0x8032 +#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033 +#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034 +#define GL_UNSIGNED_INT_8_8_8_8 0x8035 +#define GL_UNSIGNED_INT_10_10_10_2 0x8036 +#define GL_RESCALE_NORMAL 0x803A +#define GL_TEXTURE_BINDING_3D 0x806A +#define GL_PACK_SKIP_IMAGES 0x806B +#define GL_PACK_IMAGE_HEIGHT 0x806C +#define GL_UNPACK_SKIP_IMAGES 0x806D +#define GL_UNPACK_IMAGE_HEIGHT 0x806E +#define GL_TEXTURE_3D 0x806F +#define GL_PROXY_TEXTURE_3D 0x8070 +#define GL_TEXTURE_DEPTH 0x8071 +#define GL_TEXTURE_WRAP_R 0x8072 +#define GL_MAX_3D_TEXTURE_SIZE 0x8073 +#define GL_BGR 0x80E0 +#define GL_BGRA 0x80E1 +#define GL_MAX_ELEMENTS_VERTICES 0x80E8 +#define GL_MAX_ELEMENTS_INDICES 0x80E9 +#define GL_CLAMP_TO_EDGE 0x812F +#define GL_TEXTURE_MIN_LOD 0x813A +#define GL_TEXTURE_MAX_LOD 0x813B +#define GL_TEXTURE_BASE_LEVEL 0x813C +#define GL_TEXTURE_MAX_LEVEL 0x813D +#define GL_LIGHT_MODEL_COLOR_CONTROL 0x81F8 +#define GL_SINGLE_COLOR 0x81F9 +#define GL_SEPARATE_SPECULAR_COLOR 0x81FA +#define GL_UNSIGNED_BYTE_2_3_3_REV 0x8362 +#define GL_UNSIGNED_SHORT_5_6_5 0x8363 +#define GL_UNSIGNED_SHORT_5_6_5_REV 0x8364 +#define GL_UNSIGNED_SHORT_4_4_4_4_REV 0x8365 +#define GL_UNSIGNED_SHORT_1_5_5_5_REV 0x8366 +#define GL_UNSIGNED_INT_8_8_8_8_REV 0x8367 +#define GL_ALIASED_POINT_SIZE_RANGE 0x846D +#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E + +typedef void (GLAPIENTRY * PFNGLCOPYTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLDRAWRANGEELEMENTSPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices); +typedef void (GLAPIENTRY * PFNGLTEXIMAGE3DPROC) (GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (GLAPIENTRY * PFNGLTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); + +#define glCopyTexSubImage3D GLEW_GET_FUN(__glewCopyTexSubImage3D) +#define glDrawRangeElements GLEW_GET_FUN(__glewDrawRangeElements) +#define glTexImage3D GLEW_GET_FUN(__glewTexImage3D) +#define glTexSubImage3D GLEW_GET_FUN(__glewTexSubImage3D) + +#define GLEW_VERSION_1_2 GLEW_GET_VAR(__GLEW_VERSION_1_2) + +#endif /* GL_VERSION_1_2 */ + +/* ---------------------------- GL_VERSION_1_2_1 --------------------------- */ + +#ifndef GL_VERSION_1_2_1 +#define GL_VERSION_1_2_1 1 + +#define GLEW_VERSION_1_2_1 GLEW_GET_VAR(__GLEW_VERSION_1_2_1) + +#endif /* GL_VERSION_1_2_1 */ + +/* ----------------------------- GL_VERSION_1_3 ---------------------------- */ + +#ifndef GL_VERSION_1_3 +#define GL_VERSION_1_3 1 + +#define GL_MULTISAMPLE 0x809D +#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E +#define GL_SAMPLE_ALPHA_TO_ONE 0x809F +#define GL_SAMPLE_COVERAGE 0x80A0 +#define GL_SAMPLE_BUFFERS 0x80A8 +#define GL_SAMPLES 0x80A9 +#define GL_SAMPLE_COVERAGE_VALUE 0x80AA +#define GL_SAMPLE_COVERAGE_INVERT 0x80AB +#define GL_CLAMP_TO_BORDER 0x812D +#define GL_TEXTURE0 0x84C0 +#define GL_TEXTURE1 0x84C1 +#define GL_TEXTURE2 0x84C2 +#define GL_TEXTURE3 0x84C3 +#define GL_TEXTURE4 0x84C4 +#define GL_TEXTURE5 0x84C5 +#define GL_TEXTURE6 0x84C6 +#define GL_TEXTURE7 0x84C7 +#define GL_TEXTURE8 0x84C8 +#define GL_TEXTURE9 0x84C9 +#define GL_TEXTURE10 0x84CA +#define GL_TEXTURE11 0x84CB +#define GL_TEXTURE12 0x84CC +#define GL_TEXTURE13 0x84CD +#define GL_TEXTURE14 0x84CE +#define GL_TEXTURE15 0x84CF +#define GL_TEXTURE16 0x84D0 +#define GL_TEXTURE17 0x84D1 +#define GL_TEXTURE18 0x84D2 +#define GL_TEXTURE19 0x84D3 +#define GL_TEXTURE20 0x84D4 +#define GL_TEXTURE21 0x84D5 +#define GL_TEXTURE22 0x84D6 +#define GL_TEXTURE23 0x84D7 +#define GL_TEXTURE24 0x84D8 +#define GL_TEXTURE25 0x84D9 +#define GL_TEXTURE26 0x84DA +#define GL_TEXTURE27 0x84DB +#define GL_TEXTURE28 0x84DC +#define GL_TEXTURE29 0x84DD +#define GL_TEXTURE30 0x84DE +#define GL_TEXTURE31 0x84DF +#define GL_ACTIVE_TEXTURE 0x84E0 +#define GL_CLIENT_ACTIVE_TEXTURE 0x84E1 +#define GL_MAX_TEXTURE_UNITS 0x84E2 +#define GL_TRANSPOSE_MODELVIEW_MATRIX 0x84E3 +#define GL_TRANSPOSE_PROJECTION_MATRIX 0x84E4 +#define GL_TRANSPOSE_TEXTURE_MATRIX 0x84E5 +#define GL_TRANSPOSE_COLOR_MATRIX 0x84E6 +#define GL_SUBTRACT 0x84E7 +#define GL_COMPRESSED_ALPHA 0x84E9 +#define GL_COMPRESSED_LUMINANCE 0x84EA +#define GL_COMPRESSED_LUMINANCE_ALPHA 0x84EB +#define GL_COMPRESSED_INTENSITY 0x84EC +#define GL_COMPRESSED_RGB 0x84ED +#define GL_COMPRESSED_RGBA 0x84EE +#define GL_TEXTURE_COMPRESSION_HINT 0x84EF +#define GL_NORMAL_MAP 0x8511 +#define GL_REFLECTION_MAP 0x8512 +#define GL_TEXTURE_CUBE_MAP 0x8513 +#define GL_TEXTURE_BINDING_CUBE_MAP 0x8514 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x8516 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x8517 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x8518 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A +#define GL_PROXY_TEXTURE_CUBE_MAP 0x851B +#define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C +#define GL_COMBINE 0x8570 +#define GL_COMBINE_RGB 0x8571 +#define GL_COMBINE_ALPHA 0x8572 +#define GL_RGB_SCALE 0x8573 +#define GL_ADD_SIGNED 0x8574 +#define GL_INTERPOLATE 0x8575 +#define GL_CONSTANT 0x8576 +#define GL_PRIMARY_COLOR 0x8577 +#define GL_PREVIOUS 0x8578 +#define GL_SOURCE0_RGB 0x8580 +#define GL_SOURCE1_RGB 0x8581 +#define GL_SOURCE2_RGB 0x8582 +#define GL_SOURCE0_ALPHA 0x8588 +#define GL_SOURCE1_ALPHA 0x8589 +#define GL_SOURCE2_ALPHA 0x858A +#define GL_OPERAND0_RGB 0x8590 +#define GL_OPERAND1_RGB 0x8591 +#define GL_OPERAND2_RGB 0x8592 +#define GL_OPERAND0_ALPHA 0x8598 +#define GL_OPERAND1_ALPHA 0x8599 +#define GL_OPERAND2_ALPHA 0x859A +#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE 0x86A0 +#define GL_TEXTURE_COMPRESSED 0x86A1 +#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2 +#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3 +#define GL_DOT3_RGB 0x86AE +#define GL_DOT3_RGBA 0x86AF +#define GL_MULTISAMPLE_BIT 0x20000000 + +typedef void (GLAPIENTRY * PFNGLACTIVETEXTUREPROC) (GLenum texture); +typedef void (GLAPIENTRY * PFNGLCLIENTACTIVETEXTUREPROC) (GLenum texture); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXIMAGE1DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXIMAGE3DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLGETCOMPRESSEDTEXIMAGEPROC) (GLenum target, GLint lod, GLvoid *img); +typedef void (GLAPIENTRY * PFNGLLOADTRANSPOSEMATRIXDPROC) (const GLdouble m[16]); +typedef void (GLAPIENTRY * PFNGLLOADTRANSPOSEMATRIXFPROC) (const GLfloat m[16]); +typedef void (GLAPIENTRY * PFNGLMULTTRANSPOSEMATRIXDPROC) (const GLdouble m[16]); +typedef void (GLAPIENTRY * PFNGLMULTTRANSPOSEMATRIXFPROC) (const GLfloat m[16]); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1DPROC) (GLenum target, GLdouble s); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1DVPROC) (GLenum target, const GLdouble *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1FPROC) (GLenum target, GLfloat s); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1FVPROC) (GLenum target, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1IPROC) (GLenum target, GLint s); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1IVPROC) (GLenum target, const GLint *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1SPROC) (GLenum target, GLshort s); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1SVPROC) (GLenum target, const GLshort *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2DPROC) (GLenum target, GLdouble s, GLdouble t); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2DVPROC) (GLenum target, const GLdouble *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2FPROC) (GLenum target, GLfloat s, GLfloat t); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2FVPROC) (GLenum target, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2IPROC) (GLenum target, GLint s, GLint t); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2IVPROC) (GLenum target, const GLint *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2SPROC) (GLenum target, GLshort s, GLshort t); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2SVPROC) (GLenum target, const GLshort *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3DVPROC) (GLenum target, const GLdouble *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3FVPROC) (GLenum target, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3IPROC) (GLenum target, GLint s, GLint t, GLint r); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3IVPROC) (GLenum target, const GLint *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3SPROC) (GLenum target, GLshort s, GLshort t, GLshort r); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3SVPROC) (GLenum target, const GLshort *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4DVPROC) (GLenum target, const GLdouble *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4FVPROC) (GLenum target, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4IPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4IVPROC) (GLenum target, const GLint *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4SPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4SVPROC) (GLenum target, const GLshort *v); +typedef void (GLAPIENTRY * PFNGLSAMPLECOVERAGEPROC) (GLclampf value, GLboolean invert); + +#define glActiveTexture GLEW_GET_FUN(__glewActiveTexture) +#define glClientActiveTexture GLEW_GET_FUN(__glewClientActiveTexture) +#define glCompressedTexImage1D GLEW_GET_FUN(__glewCompressedTexImage1D) +#define glCompressedTexImage2D GLEW_GET_FUN(__glewCompressedTexImage2D) +#define glCompressedTexImage3D GLEW_GET_FUN(__glewCompressedTexImage3D) +#define glCompressedTexSubImage1D GLEW_GET_FUN(__glewCompressedTexSubImage1D) +#define glCompressedTexSubImage2D GLEW_GET_FUN(__glewCompressedTexSubImage2D) +#define glCompressedTexSubImage3D GLEW_GET_FUN(__glewCompressedTexSubImage3D) +#define glGetCompressedTexImage GLEW_GET_FUN(__glewGetCompressedTexImage) +#define glLoadTransposeMatrixd GLEW_GET_FUN(__glewLoadTransposeMatrixd) +#define glLoadTransposeMatrixf GLEW_GET_FUN(__glewLoadTransposeMatrixf) +#define glMultTransposeMatrixd GLEW_GET_FUN(__glewMultTransposeMatrixd) +#define glMultTransposeMatrixf GLEW_GET_FUN(__glewMultTransposeMatrixf) +#define glMultiTexCoord1d GLEW_GET_FUN(__glewMultiTexCoord1d) +#define glMultiTexCoord1dv GLEW_GET_FUN(__glewMultiTexCoord1dv) +#define glMultiTexCoord1f GLEW_GET_FUN(__glewMultiTexCoord1f) +#define glMultiTexCoord1fv GLEW_GET_FUN(__glewMultiTexCoord1fv) +#define glMultiTexCoord1i GLEW_GET_FUN(__glewMultiTexCoord1i) +#define glMultiTexCoord1iv GLEW_GET_FUN(__glewMultiTexCoord1iv) +#define glMultiTexCoord1s GLEW_GET_FUN(__glewMultiTexCoord1s) +#define glMultiTexCoord1sv GLEW_GET_FUN(__glewMultiTexCoord1sv) +#define glMultiTexCoord2d GLEW_GET_FUN(__glewMultiTexCoord2d) +#define glMultiTexCoord2dv GLEW_GET_FUN(__glewMultiTexCoord2dv) +#define glMultiTexCoord2f GLEW_GET_FUN(__glewMultiTexCoord2f) +#define glMultiTexCoord2fv GLEW_GET_FUN(__glewMultiTexCoord2fv) +#define glMultiTexCoord2i GLEW_GET_FUN(__glewMultiTexCoord2i) +#define glMultiTexCoord2iv GLEW_GET_FUN(__glewMultiTexCoord2iv) +#define glMultiTexCoord2s GLEW_GET_FUN(__glewMultiTexCoord2s) +#define glMultiTexCoord2sv GLEW_GET_FUN(__glewMultiTexCoord2sv) +#define glMultiTexCoord3d GLEW_GET_FUN(__glewMultiTexCoord3d) +#define glMultiTexCoord3dv GLEW_GET_FUN(__glewMultiTexCoord3dv) +#define glMultiTexCoord3f GLEW_GET_FUN(__glewMultiTexCoord3f) +#define glMultiTexCoord3fv GLEW_GET_FUN(__glewMultiTexCoord3fv) +#define glMultiTexCoord3i GLEW_GET_FUN(__glewMultiTexCoord3i) +#define glMultiTexCoord3iv GLEW_GET_FUN(__glewMultiTexCoord3iv) +#define glMultiTexCoord3s GLEW_GET_FUN(__glewMultiTexCoord3s) +#define glMultiTexCoord3sv GLEW_GET_FUN(__glewMultiTexCoord3sv) +#define glMultiTexCoord4d GLEW_GET_FUN(__glewMultiTexCoord4d) +#define glMultiTexCoord4dv GLEW_GET_FUN(__glewMultiTexCoord4dv) +#define glMultiTexCoord4f GLEW_GET_FUN(__glewMultiTexCoord4f) +#define glMultiTexCoord4fv GLEW_GET_FUN(__glewMultiTexCoord4fv) +#define glMultiTexCoord4i GLEW_GET_FUN(__glewMultiTexCoord4i) +#define glMultiTexCoord4iv GLEW_GET_FUN(__glewMultiTexCoord4iv) +#define glMultiTexCoord4s GLEW_GET_FUN(__glewMultiTexCoord4s) +#define glMultiTexCoord4sv GLEW_GET_FUN(__glewMultiTexCoord4sv) +#define glSampleCoverage GLEW_GET_FUN(__glewSampleCoverage) + +#define GLEW_VERSION_1_3 GLEW_GET_VAR(__GLEW_VERSION_1_3) + +#endif /* GL_VERSION_1_3 */ + +/* ----------------------------- GL_VERSION_1_4 ---------------------------- */ + +#ifndef GL_VERSION_1_4 +#define GL_VERSION_1_4 1 + +#define GL_BLEND_DST_RGB 0x80C8 +#define GL_BLEND_SRC_RGB 0x80C9 +#define GL_BLEND_DST_ALPHA 0x80CA +#define GL_BLEND_SRC_ALPHA 0x80CB +#define GL_POINT_SIZE_MIN 0x8126 +#define GL_POINT_SIZE_MAX 0x8127 +#define GL_POINT_FADE_THRESHOLD_SIZE 0x8128 +#define GL_POINT_DISTANCE_ATTENUATION 0x8129 +#define GL_GENERATE_MIPMAP 0x8191 +#define GL_GENERATE_MIPMAP_HINT 0x8192 +#define GL_DEPTH_COMPONENT16 0x81A5 +#define GL_DEPTH_COMPONENT24 0x81A6 +#define GL_DEPTH_COMPONENT32 0x81A7 +#define GL_MIRRORED_REPEAT 0x8370 +#define GL_FOG_COORDINATE_SOURCE 0x8450 +#define GL_FOG_COORDINATE 0x8451 +#define GL_FRAGMENT_DEPTH 0x8452 +#define GL_CURRENT_FOG_COORDINATE 0x8453 +#define GL_FOG_COORDINATE_ARRAY_TYPE 0x8454 +#define GL_FOG_COORDINATE_ARRAY_STRIDE 0x8455 +#define GL_FOG_COORDINATE_ARRAY_POINTER 0x8456 +#define GL_FOG_COORDINATE_ARRAY 0x8457 +#define GL_COLOR_SUM 0x8458 +#define GL_CURRENT_SECONDARY_COLOR 0x8459 +#define GL_SECONDARY_COLOR_ARRAY_SIZE 0x845A +#define GL_SECONDARY_COLOR_ARRAY_TYPE 0x845B +#define GL_SECONDARY_COLOR_ARRAY_STRIDE 0x845C +#define GL_SECONDARY_COLOR_ARRAY_POINTER 0x845D +#define GL_SECONDARY_COLOR_ARRAY 0x845E +#define GL_MAX_TEXTURE_LOD_BIAS 0x84FD +#define GL_TEXTURE_FILTER_CONTROL 0x8500 +#define GL_TEXTURE_LOD_BIAS 0x8501 +#define GL_INCR_WRAP 0x8507 +#define GL_DECR_WRAP 0x8508 +#define GL_TEXTURE_DEPTH_SIZE 0x884A +#define GL_DEPTH_TEXTURE_MODE 0x884B +#define GL_TEXTURE_COMPARE_MODE 0x884C +#define GL_TEXTURE_COMPARE_FUNC 0x884D +#define GL_COMPARE_R_TO_TEXTURE 0x884E + +typedef void (GLAPIENTRY * PFNGLBLENDCOLORPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); +typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONPROC) (GLenum mode); +typedef void (GLAPIENTRY * PFNGLBLENDFUNCSEPARATEPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); +typedef void (GLAPIENTRY * PFNGLFOGCOORDPOINTERPROC) (GLenum type, GLsizei stride, const GLvoid *pointer); +typedef void (GLAPIENTRY * PFNGLFOGCOORDDPROC) (GLdouble coord); +typedef void (GLAPIENTRY * PFNGLFOGCOORDDVPROC) (const GLdouble *coord); +typedef void (GLAPIENTRY * PFNGLFOGCOORDFPROC) (GLfloat coord); +typedef void (GLAPIENTRY * PFNGLFOGCOORDFVPROC) (const GLfloat *coord); +typedef void (GLAPIENTRY * PFNGLMULTIDRAWARRAYSPROC) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei drawcount); +typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid **indices, GLsizei drawcount); +typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERFPROC) (GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERFVPROC) (GLenum pname, const GLfloat *params); +typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERIPROC) (GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERIVPROC) (GLenum pname, const GLint *params); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3BPROC) (GLbyte red, GLbyte green, GLbyte blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3BVPROC) (const GLbyte *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3DPROC) (GLdouble red, GLdouble green, GLdouble blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3DVPROC) (const GLdouble *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3FPROC) (GLfloat red, GLfloat green, GLfloat blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3FVPROC) (const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3IPROC) (GLint red, GLint green, GLint blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3IVPROC) (const GLint *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3SPROC) (GLshort red, GLshort green, GLshort blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3SVPROC) (const GLshort *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UBPROC) (GLubyte red, GLubyte green, GLubyte blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UBVPROC) (const GLubyte *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UIPROC) (GLuint red, GLuint green, GLuint blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UIVPROC) (const GLuint *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3USPROC) (GLushort red, GLushort green, GLushort blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3USVPROC) (const GLushort *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLORPOINTERPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2DPROC) (GLdouble x, GLdouble y); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2DVPROC) (const GLdouble *p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2FPROC) (GLfloat x, GLfloat y); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2FVPROC) (const GLfloat *p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2IPROC) (GLint x, GLint y); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2IVPROC) (const GLint *p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2SPROC) (GLshort x, GLshort y); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2SVPROC) (const GLshort *p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3DPROC) (GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3DVPROC) (const GLdouble *p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3FPROC) (GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3FVPROC) (const GLfloat *p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3IPROC) (GLint x, GLint y, GLint z); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3IVPROC) (const GLint *p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3SPROC) (GLshort x, GLshort y, GLshort z); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3SVPROC) (const GLshort *p); + +#define glBlendColor GLEW_GET_FUN(__glewBlendColor) +#define glBlendEquation GLEW_GET_FUN(__glewBlendEquation) +#define glBlendFuncSeparate GLEW_GET_FUN(__glewBlendFuncSeparate) +#define glFogCoordPointer GLEW_GET_FUN(__glewFogCoordPointer) +#define glFogCoordd GLEW_GET_FUN(__glewFogCoordd) +#define glFogCoorddv GLEW_GET_FUN(__glewFogCoorddv) +#define glFogCoordf GLEW_GET_FUN(__glewFogCoordf) +#define glFogCoordfv GLEW_GET_FUN(__glewFogCoordfv) +#define glMultiDrawArrays GLEW_GET_FUN(__glewMultiDrawArrays) +#define glMultiDrawElements GLEW_GET_FUN(__glewMultiDrawElements) +#define glPointParameterf GLEW_GET_FUN(__glewPointParameterf) +#define glPointParameterfv GLEW_GET_FUN(__glewPointParameterfv) +#define glPointParameteri GLEW_GET_FUN(__glewPointParameteri) +#define glPointParameteriv GLEW_GET_FUN(__glewPointParameteriv) +#define glSecondaryColor3b GLEW_GET_FUN(__glewSecondaryColor3b) +#define glSecondaryColor3bv GLEW_GET_FUN(__glewSecondaryColor3bv) +#define glSecondaryColor3d GLEW_GET_FUN(__glewSecondaryColor3d) +#define glSecondaryColor3dv GLEW_GET_FUN(__glewSecondaryColor3dv) +#define glSecondaryColor3f GLEW_GET_FUN(__glewSecondaryColor3f) +#define glSecondaryColor3fv GLEW_GET_FUN(__glewSecondaryColor3fv) +#define glSecondaryColor3i GLEW_GET_FUN(__glewSecondaryColor3i) +#define glSecondaryColor3iv GLEW_GET_FUN(__glewSecondaryColor3iv) +#define glSecondaryColor3s GLEW_GET_FUN(__glewSecondaryColor3s) +#define glSecondaryColor3sv GLEW_GET_FUN(__glewSecondaryColor3sv) +#define glSecondaryColor3ub GLEW_GET_FUN(__glewSecondaryColor3ub) +#define glSecondaryColor3ubv GLEW_GET_FUN(__glewSecondaryColor3ubv) +#define glSecondaryColor3ui GLEW_GET_FUN(__glewSecondaryColor3ui) +#define glSecondaryColor3uiv GLEW_GET_FUN(__glewSecondaryColor3uiv) +#define glSecondaryColor3us GLEW_GET_FUN(__glewSecondaryColor3us) +#define glSecondaryColor3usv GLEW_GET_FUN(__glewSecondaryColor3usv) +#define glSecondaryColorPointer GLEW_GET_FUN(__glewSecondaryColorPointer) +#define glWindowPos2d GLEW_GET_FUN(__glewWindowPos2d) +#define glWindowPos2dv GLEW_GET_FUN(__glewWindowPos2dv) +#define glWindowPos2f GLEW_GET_FUN(__glewWindowPos2f) +#define glWindowPos2fv GLEW_GET_FUN(__glewWindowPos2fv) +#define glWindowPos2i GLEW_GET_FUN(__glewWindowPos2i) +#define glWindowPos2iv GLEW_GET_FUN(__glewWindowPos2iv) +#define glWindowPos2s GLEW_GET_FUN(__glewWindowPos2s) +#define glWindowPos2sv GLEW_GET_FUN(__glewWindowPos2sv) +#define glWindowPos3d GLEW_GET_FUN(__glewWindowPos3d) +#define glWindowPos3dv GLEW_GET_FUN(__glewWindowPos3dv) +#define glWindowPos3f GLEW_GET_FUN(__glewWindowPos3f) +#define glWindowPos3fv GLEW_GET_FUN(__glewWindowPos3fv) +#define glWindowPos3i GLEW_GET_FUN(__glewWindowPos3i) +#define glWindowPos3iv GLEW_GET_FUN(__glewWindowPos3iv) +#define glWindowPos3s GLEW_GET_FUN(__glewWindowPos3s) +#define glWindowPos3sv GLEW_GET_FUN(__glewWindowPos3sv) + +#define GLEW_VERSION_1_4 GLEW_GET_VAR(__GLEW_VERSION_1_4) + +#endif /* GL_VERSION_1_4 */ + +/* ----------------------------- GL_VERSION_1_5 ---------------------------- */ + +#ifndef GL_VERSION_1_5 +#define GL_VERSION_1_5 1 + +#define GL_FOG_COORD_SRC GL_FOG_COORDINATE_SOURCE +#define GL_FOG_COORD GL_FOG_COORDINATE +#define GL_FOG_COORD_ARRAY GL_FOG_COORDINATE_ARRAY +#define GL_SRC0_RGB GL_SOURCE0_RGB +#define GL_FOG_COORD_ARRAY_POINTER GL_FOG_COORDINATE_ARRAY_POINTER +#define GL_FOG_COORD_ARRAY_TYPE GL_FOG_COORDINATE_ARRAY_TYPE +#define GL_SRC1_ALPHA GL_SOURCE1_ALPHA +#define GL_CURRENT_FOG_COORD GL_CURRENT_FOG_COORDINATE +#define GL_FOG_COORD_ARRAY_STRIDE GL_FOG_COORDINATE_ARRAY_STRIDE +#define GL_SRC0_ALPHA GL_SOURCE0_ALPHA +#define GL_SRC1_RGB GL_SOURCE1_RGB +#define GL_FOG_COORD_ARRAY_BUFFER_BINDING GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING +#define GL_SRC2_ALPHA GL_SOURCE2_ALPHA +#define GL_SRC2_RGB GL_SOURCE2_RGB +#define GL_BUFFER_SIZE 0x8764 +#define GL_BUFFER_USAGE 0x8765 +#define GL_QUERY_COUNTER_BITS 0x8864 +#define GL_CURRENT_QUERY 0x8865 +#define GL_QUERY_RESULT 0x8866 +#define GL_QUERY_RESULT_AVAILABLE 0x8867 +#define GL_ARRAY_BUFFER 0x8892 +#define GL_ELEMENT_ARRAY_BUFFER 0x8893 +#define GL_ARRAY_BUFFER_BINDING 0x8894 +#define GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895 +#define GL_VERTEX_ARRAY_BUFFER_BINDING 0x8896 +#define GL_NORMAL_ARRAY_BUFFER_BINDING 0x8897 +#define GL_COLOR_ARRAY_BUFFER_BINDING 0x8898 +#define GL_INDEX_ARRAY_BUFFER_BINDING 0x8899 +#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING 0x889A +#define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING 0x889B +#define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING 0x889C +#define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING 0x889D +#define GL_WEIGHT_ARRAY_BUFFER_BINDING 0x889E +#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING 0x889F +#define GL_READ_ONLY 0x88B8 +#define GL_WRITE_ONLY 0x88B9 +#define GL_READ_WRITE 0x88BA +#define GL_BUFFER_ACCESS 0x88BB +#define GL_BUFFER_MAPPED 0x88BC +#define GL_BUFFER_MAP_POINTER 0x88BD +#define GL_STREAM_DRAW 0x88E0 +#define GL_STREAM_READ 0x88E1 +#define GL_STREAM_COPY 0x88E2 +#define GL_STATIC_DRAW 0x88E4 +#define GL_STATIC_READ 0x88E5 +#define GL_STATIC_COPY 0x88E6 +#define GL_DYNAMIC_DRAW 0x88E8 +#define GL_DYNAMIC_READ 0x88E9 +#define GL_DYNAMIC_COPY 0x88EA +#define GL_SAMPLES_PASSED 0x8914 + +typedef ptrdiff_t GLintptr; +typedef ptrdiff_t GLsizeiptr; + +typedef void (GLAPIENTRY * PFNGLBEGINQUERYPROC) (GLenum target, GLuint id); +typedef void (GLAPIENTRY * PFNGLBINDBUFFERPROC) (GLenum target, GLuint buffer); +typedef void (GLAPIENTRY * PFNGLBUFFERDATAPROC) (GLenum target, GLsizeiptr size, const GLvoid* data, GLenum usage); +typedef void (GLAPIENTRY * PFNGLBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid* data); +typedef void (GLAPIENTRY * PFNGLDELETEBUFFERSPROC) (GLsizei n, const GLuint* buffers); +typedef void (GLAPIENTRY * PFNGLDELETEQUERIESPROC) (GLsizei n, const GLuint* ids); +typedef void (GLAPIENTRY * PFNGLENDQUERYPROC) (GLenum target); +typedef void (GLAPIENTRY * PFNGLGENBUFFERSPROC) (GLsizei n, GLuint* buffers); +typedef void (GLAPIENTRY * PFNGLGENQUERIESPROC) (GLsizei n, GLuint* ids); +typedef void (GLAPIENTRY * PFNGLGETBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETBUFFERPOINTERVPROC) (GLenum target, GLenum pname, GLvoid** params); +typedef void (GLAPIENTRY * PFNGLGETBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, GLvoid* data); +typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTIVPROC) (GLuint id, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTUIVPROC) (GLuint id, GLenum pname, GLuint* params); +typedef void (GLAPIENTRY * PFNGLGETQUERYIVPROC) (GLenum target, GLenum pname, GLint* params); +typedef GLboolean (GLAPIENTRY * PFNGLISBUFFERPROC) (GLuint buffer); +typedef GLboolean (GLAPIENTRY * PFNGLISQUERYPROC) (GLuint id); +typedef GLvoid* (GLAPIENTRY * PFNGLMAPBUFFERPROC) (GLenum target, GLenum access); +typedef GLboolean (GLAPIENTRY * PFNGLUNMAPBUFFERPROC) (GLenum target); + +#define glBeginQuery GLEW_GET_FUN(__glewBeginQuery) +#define glBindBuffer GLEW_GET_FUN(__glewBindBuffer) +#define glBufferData GLEW_GET_FUN(__glewBufferData) +#define glBufferSubData GLEW_GET_FUN(__glewBufferSubData) +#define glDeleteBuffers GLEW_GET_FUN(__glewDeleteBuffers) +#define glDeleteQueries GLEW_GET_FUN(__glewDeleteQueries) +#define glEndQuery GLEW_GET_FUN(__glewEndQuery) +#define glGenBuffers GLEW_GET_FUN(__glewGenBuffers) +#define glGenQueries GLEW_GET_FUN(__glewGenQueries) +#define glGetBufferParameteriv GLEW_GET_FUN(__glewGetBufferParameteriv) +#define glGetBufferPointerv GLEW_GET_FUN(__glewGetBufferPointerv) +#define glGetBufferSubData GLEW_GET_FUN(__glewGetBufferSubData) +#define glGetQueryObjectiv GLEW_GET_FUN(__glewGetQueryObjectiv) +#define glGetQueryObjectuiv GLEW_GET_FUN(__glewGetQueryObjectuiv) +#define glGetQueryiv GLEW_GET_FUN(__glewGetQueryiv) +#define glIsBuffer GLEW_GET_FUN(__glewIsBuffer) +#define glIsQuery GLEW_GET_FUN(__glewIsQuery) +#define glMapBuffer GLEW_GET_FUN(__glewMapBuffer) +#define glUnmapBuffer GLEW_GET_FUN(__glewUnmapBuffer) + +#define GLEW_VERSION_1_5 GLEW_GET_VAR(__GLEW_VERSION_1_5) + +#endif /* GL_VERSION_1_5 */ + +/* ----------------------------- GL_VERSION_2_0 ---------------------------- */ + +#ifndef GL_VERSION_2_0 +#define GL_VERSION_2_0 1 + +#define GL_BLEND_EQUATION_RGB GL_BLEND_EQUATION +#define GL_VERTEX_ATTRIB_ARRAY_ENABLED 0x8622 +#define GL_VERTEX_ATTRIB_ARRAY_SIZE 0x8623 +#define GL_VERTEX_ATTRIB_ARRAY_STRIDE 0x8624 +#define GL_VERTEX_ATTRIB_ARRAY_TYPE 0x8625 +#define GL_CURRENT_VERTEX_ATTRIB 0x8626 +#define GL_VERTEX_PROGRAM_POINT_SIZE 0x8642 +#define GL_VERTEX_PROGRAM_TWO_SIDE 0x8643 +#define GL_VERTEX_ATTRIB_ARRAY_POINTER 0x8645 +#define GL_STENCIL_BACK_FUNC 0x8800 +#define GL_STENCIL_BACK_FAIL 0x8801 +#define GL_STENCIL_BACK_PASS_DEPTH_FAIL 0x8802 +#define GL_STENCIL_BACK_PASS_DEPTH_PASS 0x8803 +#define GL_MAX_DRAW_BUFFERS 0x8824 +#define GL_DRAW_BUFFER0 0x8825 +#define GL_DRAW_BUFFER1 0x8826 +#define GL_DRAW_BUFFER2 0x8827 +#define GL_DRAW_BUFFER3 0x8828 +#define GL_DRAW_BUFFER4 0x8829 +#define GL_DRAW_BUFFER5 0x882A +#define GL_DRAW_BUFFER6 0x882B +#define GL_DRAW_BUFFER7 0x882C +#define GL_DRAW_BUFFER8 0x882D +#define GL_DRAW_BUFFER9 0x882E +#define GL_DRAW_BUFFER10 0x882F +#define GL_DRAW_BUFFER11 0x8830 +#define GL_DRAW_BUFFER12 0x8831 +#define GL_DRAW_BUFFER13 0x8832 +#define GL_DRAW_BUFFER14 0x8833 +#define GL_DRAW_BUFFER15 0x8834 +#define GL_BLEND_EQUATION_ALPHA 0x883D +#define GL_POINT_SPRITE 0x8861 +#define GL_COORD_REPLACE 0x8862 +#define GL_MAX_VERTEX_ATTRIBS 0x8869 +#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED 0x886A +#define GL_MAX_TEXTURE_COORDS 0x8871 +#define GL_MAX_TEXTURE_IMAGE_UNITS 0x8872 +#define GL_FRAGMENT_SHADER 0x8B30 +#define GL_VERTEX_SHADER 0x8B31 +#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS 0x8B49 +#define GL_MAX_VERTEX_UNIFORM_COMPONENTS 0x8B4A +#define GL_MAX_VARYING_FLOATS 0x8B4B +#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS 0x8B4C +#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS 0x8B4D +#define GL_SHADER_TYPE 0x8B4F +#define GL_FLOAT_VEC2 0x8B50 +#define GL_FLOAT_VEC3 0x8B51 +#define GL_FLOAT_VEC4 0x8B52 +#define GL_INT_VEC2 0x8B53 +#define GL_INT_VEC3 0x8B54 +#define GL_INT_VEC4 0x8B55 +#define GL_BOOL 0x8B56 +#define GL_BOOL_VEC2 0x8B57 +#define GL_BOOL_VEC3 0x8B58 +#define GL_BOOL_VEC4 0x8B59 +#define GL_FLOAT_MAT2 0x8B5A +#define GL_FLOAT_MAT3 0x8B5B +#define GL_FLOAT_MAT4 0x8B5C +#define GL_SAMPLER_1D 0x8B5D +#define GL_SAMPLER_2D 0x8B5E +#define GL_SAMPLER_3D 0x8B5F +#define GL_SAMPLER_CUBE 0x8B60 +#define GL_SAMPLER_1D_SHADOW 0x8B61 +#define GL_SAMPLER_2D_SHADOW 0x8B62 +#define GL_DELETE_STATUS 0x8B80 +#define GL_COMPILE_STATUS 0x8B81 +#define GL_LINK_STATUS 0x8B82 +#define GL_VALIDATE_STATUS 0x8B83 +#define GL_INFO_LOG_LENGTH 0x8B84 +#define GL_ATTACHED_SHADERS 0x8B85 +#define GL_ACTIVE_UNIFORMS 0x8B86 +#define GL_ACTIVE_UNIFORM_MAX_LENGTH 0x8B87 +#define GL_SHADER_SOURCE_LENGTH 0x8B88 +#define GL_ACTIVE_ATTRIBUTES 0x8B89 +#define GL_ACTIVE_ATTRIBUTE_MAX_LENGTH 0x8B8A +#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT 0x8B8B +#define GL_SHADING_LANGUAGE_VERSION 0x8B8C +#define GL_CURRENT_PROGRAM 0x8B8D +#define GL_POINT_SPRITE_COORD_ORIGIN 0x8CA0 +#define GL_LOWER_LEFT 0x8CA1 +#define GL_UPPER_LEFT 0x8CA2 +#define GL_STENCIL_BACK_REF 0x8CA3 +#define GL_STENCIL_BACK_VALUE_MASK 0x8CA4 +#define GL_STENCIL_BACK_WRITEMASK 0x8CA5 + +typedef void (GLAPIENTRY * PFNGLATTACHSHADERPROC) (GLuint program, GLuint shader); +typedef void (GLAPIENTRY * PFNGLBINDATTRIBLOCATIONPROC) (GLuint program, GLuint index, const GLchar* name); +typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONSEPARATEPROC) (GLenum, GLenum); +typedef void (GLAPIENTRY * PFNGLCOMPILESHADERPROC) (GLuint shader); +typedef GLuint (GLAPIENTRY * PFNGLCREATEPROGRAMPROC) (void); +typedef GLuint (GLAPIENTRY * PFNGLCREATESHADERPROC) (GLenum type); +typedef void (GLAPIENTRY * PFNGLDELETEPROGRAMPROC) (GLuint program); +typedef void (GLAPIENTRY * PFNGLDELETESHADERPROC) (GLuint shader); +typedef void (GLAPIENTRY * PFNGLDETACHSHADERPROC) (GLuint program, GLuint shader); +typedef void (GLAPIENTRY * PFNGLDISABLEVERTEXATTRIBARRAYPROC) (GLuint); +typedef void (GLAPIENTRY * PFNGLDRAWBUFFERSPROC) (GLsizei n, const GLenum* bufs); +typedef void (GLAPIENTRY * PFNGLENABLEVERTEXATTRIBARRAYPROC) (GLuint); +typedef void (GLAPIENTRY * PFNGLGETACTIVEATTRIBPROC) (GLuint program, GLuint index, GLsizei maxLength, GLsizei* length, GLint* size, GLenum* type, GLchar* name); +typedef void (GLAPIENTRY * PFNGLGETACTIVEUNIFORMPROC) (GLuint program, GLuint index, GLsizei maxLength, GLsizei* length, GLint* size, GLenum* type, GLchar* name); +typedef void (GLAPIENTRY * PFNGLGETATTACHEDSHADERSPROC) (GLuint program, GLsizei maxCount, GLsizei* count, GLuint* shaders); +typedef GLint (GLAPIENTRY * PFNGLGETATTRIBLOCATIONPROC) (GLuint program, const GLchar* name); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMINFOLOGPROC) (GLuint program, GLsizei bufSize, GLsizei* length, GLchar* infoLog); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMIVPROC) (GLuint program, GLenum pname, GLint* param); +typedef void (GLAPIENTRY * PFNGLGETSHADERINFOLOGPROC) (GLuint shader, GLsizei bufSize, GLsizei* length, GLchar* infoLog); +typedef void (GLAPIENTRY * PFNGLGETSHADERSOURCEPROC) (GLuint obj, GLsizei maxLength, GLsizei* length, GLchar* source); +typedef void (GLAPIENTRY * PFNGLGETSHADERIVPROC) (GLuint shader, GLenum pname, GLint* param); +typedef GLint (GLAPIENTRY * PFNGLGETUNIFORMLOCATIONPROC) (GLuint program, const GLchar* name); +typedef void (GLAPIENTRY * PFNGLGETUNIFORMFVPROC) (GLuint program, GLint location, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETUNIFORMIVPROC) (GLuint program, GLint location, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBPOINTERVPROC) (GLuint, GLenum, GLvoid**); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBDVPROC) (GLuint, GLenum, GLdouble*); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBFVPROC) (GLuint, GLenum, GLfloat*); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBIVPROC) (GLuint, GLenum, GLint*); +typedef GLboolean (GLAPIENTRY * PFNGLISPROGRAMPROC) (GLuint program); +typedef GLboolean (GLAPIENTRY * PFNGLISSHADERPROC) (GLuint shader); +typedef void (GLAPIENTRY * PFNGLLINKPROGRAMPROC) (GLuint program); +typedef void (GLAPIENTRY * PFNGLSHADERSOURCEPROC) (GLuint shader, GLsizei count, const GLchar** strings, const GLint* lengths); +typedef void (GLAPIENTRY * PFNGLSTENCILFUNCSEPARATEPROC) (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask); +typedef void (GLAPIENTRY * PFNGLSTENCILMASKSEPARATEPROC) (GLenum, GLuint); +typedef void (GLAPIENTRY * PFNGLSTENCILOPSEPARATEPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass); +typedef void (GLAPIENTRY * PFNGLUNIFORM1FPROC) (GLint location, GLfloat v0); +typedef void (GLAPIENTRY * PFNGLUNIFORM1FVPROC) (GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM1IPROC) (GLint location, GLint v0); +typedef void (GLAPIENTRY * PFNGLUNIFORM1IVPROC) (GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM2FPROC) (GLint location, GLfloat v0, GLfloat v1); +typedef void (GLAPIENTRY * PFNGLUNIFORM2FVPROC) (GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM2IPROC) (GLint location, GLint v0, GLint v1); +typedef void (GLAPIENTRY * PFNGLUNIFORM2IVPROC) (GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM3FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2); +typedef void (GLAPIENTRY * PFNGLUNIFORM3FVPROC) (GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM3IPROC) (GLint location, GLint v0, GLint v1, GLint v2); +typedef void (GLAPIENTRY * PFNGLUNIFORM3IVPROC) (GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM4FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); +typedef void (GLAPIENTRY * PFNGLUNIFORM4FVPROC) (GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM4IPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3); +typedef void (GLAPIENTRY * PFNGLUNIFORM4IVPROC) (GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUSEPROGRAMPROC) (GLuint program); +typedef void (GLAPIENTRY * PFNGLVALIDATEPROGRAMPROC) (GLuint program); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1DPROC) (GLuint index, GLdouble x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1DVPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1FPROC) (GLuint index, GLfloat x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1FVPROC) (GLuint index, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1SPROC) (GLuint index, GLshort x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1SVPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2DPROC) (GLuint index, GLdouble x, GLdouble y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2DVPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2FPROC) (GLuint index, GLfloat x, GLfloat y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2FVPROC) (GLuint index, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2SPROC) (GLuint index, GLshort x, GLshort y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2SVPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3DVPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3FVPROC) (GLuint index, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3SPROC) (GLuint index, GLshort x, GLshort y, GLshort z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3SVPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NBVPROC) (GLuint index, const GLbyte* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NIVPROC) (GLuint index, const GLint* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NSVPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUBPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUBVPROC) (GLuint index, const GLubyte* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUIVPROC) (GLuint index, const GLuint* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUSVPROC) (GLuint index, const GLushort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4BVPROC) (GLuint index, const GLbyte* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4DVPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4FVPROC) (GLuint index, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4IVPROC) (GLuint index, const GLint* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4SPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4SVPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4UBVPROC) (GLuint index, const GLubyte* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4UIVPROC) (GLuint index, const GLuint* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4USVPROC) (GLuint index, const GLushort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBPOINTERPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid* pointer); + +#define glAttachShader GLEW_GET_FUN(__glewAttachShader) +#define glBindAttribLocation GLEW_GET_FUN(__glewBindAttribLocation) +#define glBlendEquationSeparate GLEW_GET_FUN(__glewBlendEquationSeparate) +#define glCompileShader GLEW_GET_FUN(__glewCompileShader) +#define glCreateProgram GLEW_GET_FUN(__glewCreateProgram) +#define glCreateShader GLEW_GET_FUN(__glewCreateShader) +#define glDeleteProgram GLEW_GET_FUN(__glewDeleteProgram) +#define glDeleteShader GLEW_GET_FUN(__glewDeleteShader) +#define glDetachShader GLEW_GET_FUN(__glewDetachShader) +#define glDisableVertexAttribArray GLEW_GET_FUN(__glewDisableVertexAttribArray) +#define glDrawBuffers GLEW_GET_FUN(__glewDrawBuffers) +#define glEnableVertexAttribArray GLEW_GET_FUN(__glewEnableVertexAttribArray) +#define glGetActiveAttrib GLEW_GET_FUN(__glewGetActiveAttrib) +#define glGetActiveUniform GLEW_GET_FUN(__glewGetActiveUniform) +#define glGetAttachedShaders GLEW_GET_FUN(__glewGetAttachedShaders) +#define glGetAttribLocation GLEW_GET_FUN(__glewGetAttribLocation) +#define glGetProgramInfoLog GLEW_GET_FUN(__glewGetProgramInfoLog) +#define glGetProgramiv GLEW_GET_FUN(__glewGetProgramiv) +#define glGetShaderInfoLog GLEW_GET_FUN(__glewGetShaderInfoLog) +#define glGetShaderSource GLEW_GET_FUN(__glewGetShaderSource) +#define glGetShaderiv GLEW_GET_FUN(__glewGetShaderiv) +#define glGetUniformLocation GLEW_GET_FUN(__glewGetUniformLocation) +#define glGetUniformfv GLEW_GET_FUN(__glewGetUniformfv) +#define glGetUniformiv GLEW_GET_FUN(__glewGetUniformiv) +#define glGetVertexAttribPointerv GLEW_GET_FUN(__glewGetVertexAttribPointerv) +#define glGetVertexAttribdv GLEW_GET_FUN(__glewGetVertexAttribdv) +#define glGetVertexAttribfv GLEW_GET_FUN(__glewGetVertexAttribfv) +#define glGetVertexAttribiv GLEW_GET_FUN(__glewGetVertexAttribiv) +#define glIsProgram GLEW_GET_FUN(__glewIsProgram) +#define glIsShader GLEW_GET_FUN(__glewIsShader) +#define glLinkProgram GLEW_GET_FUN(__glewLinkProgram) +#define glShaderSource GLEW_GET_FUN(__glewShaderSource) +#define glStencilFuncSeparate GLEW_GET_FUN(__glewStencilFuncSeparate) +#define glStencilMaskSeparate GLEW_GET_FUN(__glewStencilMaskSeparate) +#define glStencilOpSeparate GLEW_GET_FUN(__glewStencilOpSeparate) +#define glUniform1f GLEW_GET_FUN(__glewUniform1f) +#define glUniform1fv GLEW_GET_FUN(__glewUniform1fv) +#define glUniform1i GLEW_GET_FUN(__glewUniform1i) +#define glUniform1iv GLEW_GET_FUN(__glewUniform1iv) +#define glUniform2f GLEW_GET_FUN(__glewUniform2f) +#define glUniform2fv GLEW_GET_FUN(__glewUniform2fv) +#define glUniform2i GLEW_GET_FUN(__glewUniform2i) +#define glUniform2iv GLEW_GET_FUN(__glewUniform2iv) +#define glUniform3f GLEW_GET_FUN(__glewUniform3f) +#define glUniform3fv GLEW_GET_FUN(__glewUniform3fv) +#define glUniform3i GLEW_GET_FUN(__glewUniform3i) +#define glUniform3iv GLEW_GET_FUN(__glewUniform3iv) +#define glUniform4f GLEW_GET_FUN(__glewUniform4f) +#define glUniform4fv GLEW_GET_FUN(__glewUniform4fv) +#define glUniform4i GLEW_GET_FUN(__glewUniform4i) +#define glUniform4iv GLEW_GET_FUN(__glewUniform4iv) +#define glUniformMatrix2fv GLEW_GET_FUN(__glewUniformMatrix2fv) +#define glUniformMatrix3fv GLEW_GET_FUN(__glewUniformMatrix3fv) +#define glUniformMatrix4fv GLEW_GET_FUN(__glewUniformMatrix4fv) +#define glUseProgram GLEW_GET_FUN(__glewUseProgram) +#define glValidateProgram GLEW_GET_FUN(__glewValidateProgram) +#define glVertexAttrib1d GLEW_GET_FUN(__glewVertexAttrib1d) +#define glVertexAttrib1dv GLEW_GET_FUN(__glewVertexAttrib1dv) +#define glVertexAttrib1f GLEW_GET_FUN(__glewVertexAttrib1f) +#define glVertexAttrib1fv GLEW_GET_FUN(__glewVertexAttrib1fv) +#define glVertexAttrib1s GLEW_GET_FUN(__glewVertexAttrib1s) +#define glVertexAttrib1sv GLEW_GET_FUN(__glewVertexAttrib1sv) +#define glVertexAttrib2d GLEW_GET_FUN(__glewVertexAttrib2d) +#define glVertexAttrib2dv GLEW_GET_FUN(__glewVertexAttrib2dv) +#define glVertexAttrib2f GLEW_GET_FUN(__glewVertexAttrib2f) +#define glVertexAttrib2fv GLEW_GET_FUN(__glewVertexAttrib2fv) +#define glVertexAttrib2s GLEW_GET_FUN(__glewVertexAttrib2s) +#define glVertexAttrib2sv GLEW_GET_FUN(__glewVertexAttrib2sv) +#define glVertexAttrib3d GLEW_GET_FUN(__glewVertexAttrib3d) +#define glVertexAttrib3dv GLEW_GET_FUN(__glewVertexAttrib3dv) +#define glVertexAttrib3f GLEW_GET_FUN(__glewVertexAttrib3f) +#define glVertexAttrib3fv GLEW_GET_FUN(__glewVertexAttrib3fv) +#define glVertexAttrib3s GLEW_GET_FUN(__glewVertexAttrib3s) +#define glVertexAttrib3sv GLEW_GET_FUN(__glewVertexAttrib3sv) +#define glVertexAttrib4Nbv GLEW_GET_FUN(__glewVertexAttrib4Nbv) +#define glVertexAttrib4Niv GLEW_GET_FUN(__glewVertexAttrib4Niv) +#define glVertexAttrib4Nsv GLEW_GET_FUN(__glewVertexAttrib4Nsv) +#define glVertexAttrib4Nub GLEW_GET_FUN(__glewVertexAttrib4Nub) +#define glVertexAttrib4Nubv GLEW_GET_FUN(__glewVertexAttrib4Nubv) +#define glVertexAttrib4Nuiv GLEW_GET_FUN(__glewVertexAttrib4Nuiv) +#define glVertexAttrib4Nusv GLEW_GET_FUN(__glewVertexAttrib4Nusv) +#define glVertexAttrib4bv GLEW_GET_FUN(__glewVertexAttrib4bv) +#define glVertexAttrib4d GLEW_GET_FUN(__glewVertexAttrib4d) +#define glVertexAttrib4dv GLEW_GET_FUN(__glewVertexAttrib4dv) +#define glVertexAttrib4f GLEW_GET_FUN(__glewVertexAttrib4f) +#define glVertexAttrib4fv GLEW_GET_FUN(__glewVertexAttrib4fv) +#define glVertexAttrib4iv GLEW_GET_FUN(__glewVertexAttrib4iv) +#define glVertexAttrib4s GLEW_GET_FUN(__glewVertexAttrib4s) +#define glVertexAttrib4sv GLEW_GET_FUN(__glewVertexAttrib4sv) +#define glVertexAttrib4ubv GLEW_GET_FUN(__glewVertexAttrib4ubv) +#define glVertexAttrib4uiv GLEW_GET_FUN(__glewVertexAttrib4uiv) +#define glVertexAttrib4usv GLEW_GET_FUN(__glewVertexAttrib4usv) +#define glVertexAttribPointer GLEW_GET_FUN(__glewVertexAttribPointer) + +#define GLEW_VERSION_2_0 GLEW_GET_VAR(__GLEW_VERSION_2_0) + +#endif /* GL_VERSION_2_0 */ + +/* ----------------------------- GL_VERSION_2_1 ---------------------------- */ + +#ifndef GL_VERSION_2_1 +#define GL_VERSION_2_1 1 + +#define GL_CURRENT_RASTER_SECONDARY_COLOR 0x845F +#define GL_PIXEL_PACK_BUFFER 0x88EB +#define GL_PIXEL_UNPACK_BUFFER 0x88EC +#define GL_PIXEL_PACK_BUFFER_BINDING 0x88ED +#define GL_PIXEL_UNPACK_BUFFER_BINDING 0x88EF +#define GL_FLOAT_MAT2x3 0x8B65 +#define GL_FLOAT_MAT2x4 0x8B66 +#define GL_FLOAT_MAT3x2 0x8B67 +#define GL_FLOAT_MAT3x4 0x8B68 +#define GL_FLOAT_MAT4x2 0x8B69 +#define GL_FLOAT_MAT4x3 0x8B6A +#define GL_SRGB 0x8C40 +#define GL_SRGB8 0x8C41 +#define GL_SRGB_ALPHA 0x8C42 +#define GL_SRGB8_ALPHA8 0x8C43 +#define GL_SLUMINANCE_ALPHA 0x8C44 +#define GL_SLUMINANCE8_ALPHA8 0x8C45 +#define GL_SLUMINANCE 0x8C46 +#define GL_SLUMINANCE8 0x8C47 +#define GL_COMPRESSED_SRGB 0x8C48 +#define GL_COMPRESSED_SRGB_ALPHA 0x8C49 +#define GL_COMPRESSED_SLUMINANCE 0x8C4A +#define GL_COMPRESSED_SLUMINANCE_ALPHA 0x8C4B + +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX2X3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX2X4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX3X2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX3X4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4X2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4X3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); + +#define glUniformMatrix2x3fv GLEW_GET_FUN(__glewUniformMatrix2x3fv) +#define glUniformMatrix2x4fv GLEW_GET_FUN(__glewUniformMatrix2x4fv) +#define glUniformMatrix3x2fv GLEW_GET_FUN(__glewUniformMatrix3x2fv) +#define glUniformMatrix3x4fv GLEW_GET_FUN(__glewUniformMatrix3x4fv) +#define glUniformMatrix4x2fv GLEW_GET_FUN(__glewUniformMatrix4x2fv) +#define glUniformMatrix4x3fv GLEW_GET_FUN(__glewUniformMatrix4x3fv) + +#define GLEW_VERSION_2_1 GLEW_GET_VAR(__GLEW_VERSION_2_1) + +#endif /* GL_VERSION_2_1 */ + +/* ----------------------------- GL_VERSION_3_0 ---------------------------- */ + +#ifndef GL_VERSION_3_0 +#define GL_VERSION_3_0 1 + +#define GL_MAX_CLIP_DISTANCES GL_MAX_CLIP_PLANES +#define GL_CLIP_DISTANCE5 GL_CLIP_PLANE5 +#define GL_CLIP_DISTANCE1 GL_CLIP_PLANE1 +#define GL_CLIP_DISTANCE3 GL_CLIP_PLANE3 +#define GL_COMPARE_REF_TO_TEXTURE GL_COMPARE_R_TO_TEXTURE_ARB +#define GL_CLIP_DISTANCE0 GL_CLIP_PLANE0 +#define GL_CLIP_DISTANCE4 GL_CLIP_PLANE4 +#define GL_CLIP_DISTANCE2 GL_CLIP_PLANE2 +#define GL_MAX_VARYING_COMPONENTS GL_MAX_VARYING_FLOATS +#define GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT 0x0001 +#define GL_MAJOR_VERSION 0x821B +#define GL_MINOR_VERSION 0x821C +#define GL_NUM_EXTENSIONS 0x821D +#define GL_CONTEXT_FLAGS 0x821E +#define GL_DEPTH_BUFFER 0x8223 +#define GL_STENCIL_BUFFER 0x8224 +#define GL_RGBA32F 0x8814 +#define GL_RGB32F 0x8815 +#define GL_RGBA16F 0x881A +#define GL_RGB16F 0x881B +#define GL_VERTEX_ATTRIB_ARRAY_INTEGER 0x88FD +#define GL_MAX_ARRAY_TEXTURE_LAYERS 0x88FF +#define GL_MIN_PROGRAM_TEXEL_OFFSET 0x8904 +#define GL_MAX_PROGRAM_TEXEL_OFFSET 0x8905 +#define GL_CLAMP_VERTEX_COLOR 0x891A +#define GL_CLAMP_FRAGMENT_COLOR 0x891B +#define GL_CLAMP_READ_COLOR 0x891C +#define GL_FIXED_ONLY 0x891D +#define GL_TEXTURE_RED_TYPE 0x8C10 +#define GL_TEXTURE_GREEN_TYPE 0x8C11 +#define GL_TEXTURE_BLUE_TYPE 0x8C12 +#define GL_TEXTURE_ALPHA_TYPE 0x8C13 +#define GL_TEXTURE_LUMINANCE_TYPE 0x8C14 +#define GL_TEXTURE_INTENSITY_TYPE 0x8C15 +#define GL_TEXTURE_DEPTH_TYPE 0x8C16 +#define GL_TEXTURE_1D_ARRAY 0x8C18 +#define GL_PROXY_TEXTURE_1D_ARRAY 0x8C19 +#define GL_TEXTURE_2D_ARRAY 0x8C1A +#define GL_PROXY_TEXTURE_2D_ARRAY 0x8C1B +#define GL_TEXTURE_BINDING_1D_ARRAY 0x8C1C +#define GL_TEXTURE_BINDING_2D_ARRAY 0x8C1D +#define GL_R11F_G11F_B10F 0x8C3A +#define GL_UNSIGNED_INT_10F_11F_11F_REV 0x8C3B +#define GL_RGB9_E5 0x8C3D +#define GL_UNSIGNED_INT_5_9_9_9_REV 0x8C3E +#define GL_TEXTURE_SHARED_SIZE 0x8C3F +#define GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH 0x8C76 +#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE 0x8C7F +#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS 0x8C80 +#define GL_TRANSFORM_FEEDBACK_VARYINGS 0x8C83 +#define GL_TRANSFORM_FEEDBACK_BUFFER_START 0x8C84 +#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE 0x8C85 +#define GL_PRIMITIVES_GENERATED 0x8C87 +#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN 0x8C88 +#define GL_RASTERIZER_DISCARD 0x8C89 +#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS 0x8C8A +#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS 0x8C8B +#define GL_INTERLEAVED_ATTRIBS 0x8C8C +#define GL_SEPARATE_ATTRIBS 0x8C8D +#define GL_TRANSFORM_FEEDBACK_BUFFER 0x8C8E +#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING 0x8C8F +#define GL_RGBA32UI 0x8D70 +#define GL_RGB32UI 0x8D71 +#define GL_RGBA16UI 0x8D76 +#define GL_RGB16UI 0x8D77 +#define GL_RGBA8UI 0x8D7C +#define GL_RGB8UI 0x8D7D +#define GL_RGBA32I 0x8D82 +#define GL_RGB32I 0x8D83 +#define GL_RGBA16I 0x8D88 +#define GL_RGB16I 0x8D89 +#define GL_RGBA8I 0x8D8E +#define GL_RGB8I 0x8D8F +#define GL_RED_INTEGER 0x8D94 +#define GL_GREEN_INTEGER 0x8D95 +#define GL_BLUE_INTEGER 0x8D96 +#define GL_ALPHA_INTEGER 0x8D97 +#define GL_RGB_INTEGER 0x8D98 +#define GL_RGBA_INTEGER 0x8D99 +#define GL_BGR_INTEGER 0x8D9A +#define GL_BGRA_INTEGER 0x8D9B +#define GL_SAMPLER_1D_ARRAY 0x8DC0 +#define GL_SAMPLER_2D_ARRAY 0x8DC1 +#define GL_SAMPLER_1D_ARRAY_SHADOW 0x8DC3 +#define GL_SAMPLER_2D_ARRAY_SHADOW 0x8DC4 +#define GL_SAMPLER_CUBE_SHADOW 0x8DC5 +#define GL_UNSIGNED_INT_VEC2 0x8DC6 +#define GL_UNSIGNED_INT_VEC3 0x8DC7 +#define GL_UNSIGNED_INT_VEC4 0x8DC8 +#define GL_INT_SAMPLER_1D 0x8DC9 +#define GL_INT_SAMPLER_2D 0x8DCA +#define GL_INT_SAMPLER_3D 0x8DCB +#define GL_INT_SAMPLER_CUBE 0x8DCC +#define GL_INT_SAMPLER_1D_ARRAY 0x8DCE +#define GL_INT_SAMPLER_2D_ARRAY 0x8DCF +#define GL_UNSIGNED_INT_SAMPLER_1D 0x8DD1 +#define GL_UNSIGNED_INT_SAMPLER_2D 0x8DD2 +#define GL_UNSIGNED_INT_SAMPLER_3D 0x8DD3 +#define GL_UNSIGNED_INT_SAMPLER_CUBE 0x8DD4 +#define GL_UNSIGNED_INT_SAMPLER_1D_ARRAY 0x8DD6 +#define GL_UNSIGNED_INT_SAMPLER_2D_ARRAY 0x8DD7 +#define GL_QUERY_WAIT 0x8E13 +#define GL_QUERY_NO_WAIT 0x8E14 +#define GL_QUERY_BY_REGION_WAIT 0x8E15 +#define GL_QUERY_BY_REGION_NO_WAIT 0x8E16 + +typedef void (GLAPIENTRY * PFNGLBEGINCONDITIONALRENDERPROC) (GLuint, GLenum); +typedef void (GLAPIENTRY * PFNGLBEGINTRANSFORMFEEDBACKPROC) (GLenum); +typedef void (GLAPIENTRY * PFNGLBINDFRAGDATALOCATIONPROC) (GLuint, GLuint, const GLchar*); +typedef void (GLAPIENTRY * PFNGLCLAMPCOLORPROC) (GLenum, GLenum); +typedef void (GLAPIENTRY * PFNGLCLEARBUFFERFIPROC) (GLenum, GLint, GLfloat, GLint); +typedef void (GLAPIENTRY * PFNGLCLEARBUFFERFVPROC) (GLenum, GLint, const GLfloat*); +typedef void (GLAPIENTRY * PFNGLCLEARBUFFERIVPROC) (GLenum, GLint, const GLint*); +typedef void (GLAPIENTRY * PFNGLCLEARBUFFERUIVPROC) (GLenum, GLint, const GLuint*); +typedef void (GLAPIENTRY * PFNGLCOLORMASKIPROC) (GLuint, GLboolean, GLboolean, GLboolean, GLboolean); +typedef void (GLAPIENTRY * PFNGLDISABLEIPROC) (GLenum, GLuint); +typedef void (GLAPIENTRY * PFNGLENABLEIPROC) (GLenum, GLuint); +typedef void (GLAPIENTRY * PFNGLENDCONDITIONALRENDERPROC) (void); +typedef void (GLAPIENTRY * PFNGLENDTRANSFORMFEEDBACKPROC) (void); +typedef void (GLAPIENTRY * PFNGLGETBOOLEANI_VPROC) (GLenum, GLuint, GLboolean*); +typedef GLint (GLAPIENTRY * PFNGLGETFRAGDATALOCATIONPROC) (GLuint, const GLchar*); +typedef const GLubyte* (GLAPIENTRY * PFNGLGETSTRINGIPROC) (GLenum, GLuint); +typedef void (GLAPIENTRY * PFNGLGETTEXPARAMETERIIVPROC) (GLenum, GLenum, GLint*); +typedef void (GLAPIENTRY * PFNGLGETTEXPARAMETERIUIVPROC) (GLenum, GLenum, GLuint*); +typedef void (GLAPIENTRY * PFNGLGETTRANSFORMFEEDBACKVARYINGPROC) (GLuint, GLuint, GLsizei, GLsizei *, GLsizei *, GLenum *, GLchar *); +typedef void (GLAPIENTRY * PFNGLGETUNIFORMUIVPROC) (GLuint, GLint, GLuint*); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBIIVPROC) (GLuint, GLenum, GLint*); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBIUIVPROC) (GLuint, GLenum, GLuint*); +typedef GLboolean (GLAPIENTRY * PFNGLISENABLEDIPROC) (GLenum, GLuint); +typedef void (GLAPIENTRY * PFNGLTEXPARAMETERIIVPROC) (GLenum, GLenum, const GLint*); +typedef void (GLAPIENTRY * PFNGLTEXPARAMETERIUIVPROC) (GLenum, GLenum, const GLuint*); +typedef void (GLAPIENTRY * PFNGLTRANSFORMFEEDBACKVARYINGSPROC) (GLuint, GLsizei, const GLchar **, GLenum); +typedef void (GLAPIENTRY * PFNGLUNIFORM1UIPROC) (GLint, GLuint); +typedef void (GLAPIENTRY * PFNGLUNIFORM1UIVPROC) (GLint, GLsizei, const GLuint*); +typedef void (GLAPIENTRY * PFNGLUNIFORM2UIPROC) (GLint, GLuint, GLuint); +typedef void (GLAPIENTRY * PFNGLUNIFORM2UIVPROC) (GLint, GLsizei, const GLuint*); +typedef void (GLAPIENTRY * PFNGLUNIFORM3UIPROC) (GLint, GLuint, GLuint, GLuint); +typedef void (GLAPIENTRY * PFNGLUNIFORM3UIVPROC) (GLint, GLsizei, const GLuint*); +typedef void (GLAPIENTRY * PFNGLUNIFORM4UIPROC) (GLint, GLuint, GLuint, GLuint, GLuint); +typedef void (GLAPIENTRY * PFNGLUNIFORM4UIVPROC) (GLint, GLsizei, const GLuint*); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1IPROC) (GLuint, GLint); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1IVPROC) (GLuint, const GLint*); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1UIPROC) (GLuint, GLuint); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1UIVPROC) (GLuint, const GLuint*); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2IPROC) (GLuint, GLint, GLint); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2IVPROC) (GLuint, const GLint*); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2UIPROC) (GLuint, GLuint, GLuint); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2UIVPROC) (GLuint, const GLuint*); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3IPROC) (GLuint, GLint, GLint, GLint); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3IVPROC) (GLuint, const GLint*); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3UIPROC) (GLuint, GLuint, GLuint, GLuint); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3UIVPROC) (GLuint, const GLuint*); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4BVPROC) (GLuint, const GLbyte*); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4IPROC) (GLuint, GLint, GLint, GLint, GLint); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4IVPROC) (GLuint, const GLint*); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4SVPROC) (GLuint, const GLshort*); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4UBVPROC) (GLuint, const GLubyte*); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4UIPROC) (GLuint, GLuint, GLuint, GLuint, GLuint); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4UIVPROC) (GLuint, const GLuint*); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4USVPROC) (GLuint, const GLushort*); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBIPOINTERPROC) (GLuint, GLint, GLenum, GLsizei, const GLvoid*); + +#define glBeginConditionalRender GLEW_GET_FUN(__glewBeginConditionalRender) +#define glBeginTransformFeedback GLEW_GET_FUN(__glewBeginTransformFeedback) +#define glBindFragDataLocation GLEW_GET_FUN(__glewBindFragDataLocation) +#define glClampColor GLEW_GET_FUN(__glewClampColor) +#define glClearBufferfi GLEW_GET_FUN(__glewClearBufferfi) +#define glClearBufferfv GLEW_GET_FUN(__glewClearBufferfv) +#define glClearBufferiv GLEW_GET_FUN(__glewClearBufferiv) +#define glClearBufferuiv GLEW_GET_FUN(__glewClearBufferuiv) +#define glColorMaski GLEW_GET_FUN(__glewColorMaski) +#define glDisablei GLEW_GET_FUN(__glewDisablei) +#define glEnablei GLEW_GET_FUN(__glewEnablei) +#define glEndConditionalRender GLEW_GET_FUN(__glewEndConditionalRender) +#define glEndTransformFeedback GLEW_GET_FUN(__glewEndTransformFeedback) +#define glGetBooleani_v GLEW_GET_FUN(__glewGetBooleani_v) +#define glGetFragDataLocation GLEW_GET_FUN(__glewGetFragDataLocation) +#define glGetStringi GLEW_GET_FUN(__glewGetStringi) +#define glGetTexParameterIiv GLEW_GET_FUN(__glewGetTexParameterIiv) +#define glGetTexParameterIuiv GLEW_GET_FUN(__glewGetTexParameterIuiv) +#define glGetTransformFeedbackVarying GLEW_GET_FUN(__glewGetTransformFeedbackVarying) +#define glGetUniformuiv GLEW_GET_FUN(__glewGetUniformuiv) +#define glGetVertexAttribIiv GLEW_GET_FUN(__glewGetVertexAttribIiv) +#define glGetVertexAttribIuiv GLEW_GET_FUN(__glewGetVertexAttribIuiv) +#define glIsEnabledi GLEW_GET_FUN(__glewIsEnabledi) +#define glTexParameterIiv GLEW_GET_FUN(__glewTexParameterIiv) +#define glTexParameterIuiv GLEW_GET_FUN(__glewTexParameterIuiv) +#define glTransformFeedbackVaryings GLEW_GET_FUN(__glewTransformFeedbackVaryings) +#define glUniform1ui GLEW_GET_FUN(__glewUniform1ui) +#define glUniform1uiv GLEW_GET_FUN(__glewUniform1uiv) +#define glUniform2ui GLEW_GET_FUN(__glewUniform2ui) +#define glUniform2uiv GLEW_GET_FUN(__glewUniform2uiv) +#define glUniform3ui GLEW_GET_FUN(__glewUniform3ui) +#define glUniform3uiv GLEW_GET_FUN(__glewUniform3uiv) +#define glUniform4ui GLEW_GET_FUN(__glewUniform4ui) +#define glUniform4uiv GLEW_GET_FUN(__glewUniform4uiv) +#define glVertexAttribI1i GLEW_GET_FUN(__glewVertexAttribI1i) +#define glVertexAttribI1iv GLEW_GET_FUN(__glewVertexAttribI1iv) +#define glVertexAttribI1ui GLEW_GET_FUN(__glewVertexAttribI1ui) +#define glVertexAttribI1uiv GLEW_GET_FUN(__glewVertexAttribI1uiv) +#define glVertexAttribI2i GLEW_GET_FUN(__glewVertexAttribI2i) +#define glVertexAttribI2iv GLEW_GET_FUN(__glewVertexAttribI2iv) +#define glVertexAttribI2ui GLEW_GET_FUN(__glewVertexAttribI2ui) +#define glVertexAttribI2uiv GLEW_GET_FUN(__glewVertexAttribI2uiv) +#define glVertexAttribI3i GLEW_GET_FUN(__glewVertexAttribI3i) +#define glVertexAttribI3iv GLEW_GET_FUN(__glewVertexAttribI3iv) +#define glVertexAttribI3ui GLEW_GET_FUN(__glewVertexAttribI3ui) +#define glVertexAttribI3uiv GLEW_GET_FUN(__glewVertexAttribI3uiv) +#define glVertexAttribI4bv GLEW_GET_FUN(__glewVertexAttribI4bv) +#define glVertexAttribI4i GLEW_GET_FUN(__glewVertexAttribI4i) +#define glVertexAttribI4iv GLEW_GET_FUN(__glewVertexAttribI4iv) +#define glVertexAttribI4sv GLEW_GET_FUN(__glewVertexAttribI4sv) +#define glVertexAttribI4ubv GLEW_GET_FUN(__glewVertexAttribI4ubv) +#define glVertexAttribI4ui GLEW_GET_FUN(__glewVertexAttribI4ui) +#define glVertexAttribI4uiv GLEW_GET_FUN(__glewVertexAttribI4uiv) +#define glVertexAttribI4usv GLEW_GET_FUN(__glewVertexAttribI4usv) +#define glVertexAttribIPointer GLEW_GET_FUN(__glewVertexAttribIPointer) + +#define GLEW_VERSION_3_0 GLEW_GET_VAR(__GLEW_VERSION_3_0) + +#endif /* GL_VERSION_3_0 */ + +/* ----------------------------- GL_VERSION_3_1 ---------------------------- */ + +#ifndef GL_VERSION_3_1 +#define GL_VERSION_3_1 1 + +#define GL_TEXTURE_RECTANGLE 0x84F5 +#define GL_TEXTURE_BINDING_RECTANGLE 0x84F6 +#define GL_PROXY_TEXTURE_RECTANGLE 0x84F7 +#define GL_MAX_RECTANGLE_TEXTURE_SIZE 0x84F8 +#define GL_SAMPLER_2D_RECT 0x8B63 +#define GL_SAMPLER_2D_RECT_SHADOW 0x8B64 +#define GL_TEXTURE_BUFFER 0x8C2A +#define GL_MAX_TEXTURE_BUFFER_SIZE 0x8C2B +#define GL_TEXTURE_BINDING_BUFFER 0x8C2C +#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING 0x8C2D +#define GL_TEXTURE_BUFFER_FORMAT 0x8C2E +#define GL_SAMPLER_BUFFER 0x8DC2 +#define GL_INT_SAMPLER_2D_RECT 0x8DCD +#define GL_INT_SAMPLER_BUFFER 0x8DD0 +#define GL_UNSIGNED_INT_SAMPLER_2D_RECT 0x8DD5 +#define GL_UNSIGNED_INT_SAMPLER_BUFFER 0x8DD8 +#define GL_RED_SNORM 0x8F90 +#define GL_RG_SNORM 0x8F91 +#define GL_RGB_SNORM 0x8F92 +#define GL_RGBA_SNORM 0x8F93 +#define GL_R8_SNORM 0x8F94 +#define GL_RG8_SNORM 0x8F95 +#define GL_RGB8_SNORM 0x8F96 +#define GL_RGBA8_SNORM 0x8F97 +#define GL_R16_SNORM 0x8F98 +#define GL_RG16_SNORM 0x8F99 +#define GL_RGB16_SNORM 0x8F9A +#define GL_RGBA16_SNORM 0x8F9B +#define GL_SIGNED_NORMALIZED 0x8F9C +#define GL_PRIMITIVE_RESTART 0x8F9D +#define GL_PRIMITIVE_RESTART_INDEX 0x8F9E +#define GL_BUFFER_ACCESS_FLAGS 0x911F +#define GL_BUFFER_MAP_LENGTH 0x9120 +#define GL_BUFFER_MAP_OFFSET 0x9121 + +typedef void (GLAPIENTRY * PFNGLDRAWARRAYSINSTANCEDPROC) (GLenum, GLint, GLsizei, GLsizei); +typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDPROC) (GLenum, GLsizei, GLenum, const GLvoid*, GLsizei); +typedef void (GLAPIENTRY * PFNGLPRIMITIVERESTARTINDEXPROC) (GLuint); +typedef void (GLAPIENTRY * PFNGLTEXBUFFERPROC) (GLenum, GLenum, GLuint); + +#define glDrawArraysInstanced GLEW_GET_FUN(__glewDrawArraysInstanced) +#define glDrawElementsInstanced GLEW_GET_FUN(__glewDrawElementsInstanced) +#define glPrimitiveRestartIndex GLEW_GET_FUN(__glewPrimitiveRestartIndex) +#define glTexBuffer GLEW_GET_FUN(__glewTexBuffer) + +#define GLEW_VERSION_3_1 GLEW_GET_VAR(__GLEW_VERSION_3_1) + +#endif /* GL_VERSION_3_1 */ + +/* ----------------------------- GL_VERSION_3_2 ---------------------------- */ + +#ifndef GL_VERSION_3_2 +#define GL_VERSION_3_2 1 + +#define GL_CONTEXT_CORE_PROFILE_BIT 0x00000001 +#define GL_CONTEXT_COMPATIBILITY_PROFILE_BIT 0x00000002 +#define GL_LINES_ADJACENCY 0x000A +#define GL_LINE_STRIP_ADJACENCY 0x000B +#define GL_TRIANGLES_ADJACENCY 0x000C +#define GL_TRIANGLE_STRIP_ADJACENCY 0x000D +#define GL_PROGRAM_POINT_SIZE 0x8642 +#define GL_GEOMETRY_VERTICES_OUT 0x8916 +#define GL_GEOMETRY_INPUT_TYPE 0x8917 +#define GL_GEOMETRY_OUTPUT_TYPE 0x8918 +#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS 0x8C29 +#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED 0x8DA7 +#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS 0x8DA8 +#define GL_GEOMETRY_SHADER 0x8DD9 +#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS 0x8DDF +#define GL_MAX_GEOMETRY_OUTPUT_VERTICES 0x8DE0 +#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS 0x8DE1 +#define GL_MAX_VERTEX_OUTPUT_COMPONENTS 0x9122 +#define GL_MAX_GEOMETRY_INPUT_COMPONENTS 0x9123 +#define GL_MAX_GEOMETRY_OUTPUT_COMPONENTS 0x9124 +#define GL_MAX_FRAGMENT_INPUT_COMPONENTS 0x9125 +#define GL_CONTEXT_PROFILE_MASK 0x9126 + +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTUREPROC) (GLenum, GLenum, GLuint, GLint); +typedef void (GLAPIENTRY * PFNGLGETBUFFERPARAMETERI64VPROC) (GLenum, GLenum, GLint64 *); +typedef void (GLAPIENTRY * PFNGLGETINTEGER64I_VPROC) (GLenum, GLuint, GLint64 *); + +#define glFramebufferTexture GLEW_GET_FUN(__glewFramebufferTexture) +#define glGetBufferParameteri64v GLEW_GET_FUN(__glewGetBufferParameteri64v) +#define glGetInteger64i_v GLEW_GET_FUN(__glewGetInteger64i_v) + +#define GLEW_VERSION_3_2 GLEW_GET_VAR(__GLEW_VERSION_3_2) + +#endif /* GL_VERSION_3_2 */ + +/* ----------------------------- GL_VERSION_3_3 ---------------------------- */ + +#ifndef GL_VERSION_3_3 +#define GL_VERSION_3_3 1 + +#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR 0x88FE +#define GL_RGB10_A2UI 0x906F + +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBDIVISORPROC) (GLuint index, GLuint divisor); + +#define glVertexAttribDivisor GLEW_GET_FUN(__glewVertexAttribDivisor) + +#define GLEW_VERSION_3_3 GLEW_GET_VAR(__GLEW_VERSION_3_3) + +#endif /* GL_VERSION_3_3 */ + +/* ----------------------------- GL_VERSION_4_0 ---------------------------- */ + +#ifndef GL_VERSION_4_0 +#define GL_VERSION_4_0 1 + +#define GL_SAMPLE_SHADING 0x8C36 +#define GL_MIN_SAMPLE_SHADING_VALUE 0x8C37 +#define GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET 0x8E5E +#define GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET 0x8E5F +#define GL_MAX_PROGRAM_TEXTURE_GATHER_COMPONENTS 0x8F9F +#define GL_TEXTURE_CUBE_MAP_ARRAY 0x9009 +#define GL_TEXTURE_BINDING_CUBE_MAP_ARRAY 0x900A +#define GL_PROXY_TEXTURE_CUBE_MAP_ARRAY 0x900B +#define GL_SAMPLER_CUBE_MAP_ARRAY 0x900C +#define GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW 0x900D +#define GL_INT_SAMPLER_CUBE_MAP_ARRAY 0x900E +#define GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY 0x900F + +typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONSEPARATEIPROC) (GLuint buf, GLenum modeRGB, GLenum modeAlpha); +typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONIPROC) (GLuint buf, GLenum mode); +typedef void (GLAPIENTRY * PFNGLBLENDFUNCSEPARATEIPROC) (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); +typedef void (GLAPIENTRY * PFNGLBLENDFUNCIPROC) (GLuint buf, GLenum src, GLenum dst); +typedef void (GLAPIENTRY * PFNGLMINSAMPLESHADINGPROC) (GLclampf value); + +#define glBlendEquationSeparatei GLEW_GET_FUN(__glewBlendEquationSeparatei) +#define glBlendEquationi GLEW_GET_FUN(__glewBlendEquationi) +#define glBlendFuncSeparatei GLEW_GET_FUN(__glewBlendFuncSeparatei) +#define glBlendFunci GLEW_GET_FUN(__glewBlendFunci) +#define glMinSampleShading GLEW_GET_FUN(__glewMinSampleShading) + +#define GLEW_VERSION_4_0 GLEW_GET_VAR(__GLEW_VERSION_4_0) + +#endif /* GL_VERSION_4_0 */ + +/* ----------------------------- GL_VERSION_4_1 ---------------------------- */ + +#ifndef GL_VERSION_4_1 +#define GL_VERSION_4_1 1 + +#define GLEW_VERSION_4_1 GLEW_GET_VAR(__GLEW_VERSION_4_1) + +#endif /* GL_VERSION_4_1 */ + +/* ----------------------------- GL_VERSION_4_2 ---------------------------- */ + +#ifndef GL_VERSION_4_2 +#define GL_VERSION_4_2 1 + +#define GL_COMPRESSED_RGBA_BPTC_UNORM 0x8E8C +#define GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM 0x8E8D +#define GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT 0x8E8E +#define GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT 0x8E8F + +#define GLEW_VERSION_4_2 GLEW_GET_VAR(__GLEW_VERSION_4_2) + +#endif /* GL_VERSION_4_2 */ + +/* ----------------------------- GL_VERSION_4_3 ---------------------------- */ + +#ifndef GL_VERSION_4_3 +#define GL_VERSION_4_3 1 + +#define GL_NUM_SHADING_LANGUAGE_VERSIONS 0x82E9 +#define GL_VERTEX_ATTRIB_ARRAY_LONG 0x874E + +#define GLEW_VERSION_4_3 GLEW_GET_VAR(__GLEW_VERSION_4_3) + +#endif /* GL_VERSION_4_3 */ + +/* ----------------------------- GL_VERSION_4_4 ---------------------------- */ + +#ifndef GL_VERSION_4_4 +#define GL_VERSION_4_4 1 + +#define GL_MAX_VERTEX_ATTRIB_STRIDE 0x82E5 + +#define GLEW_VERSION_4_4 GLEW_GET_VAR(__GLEW_VERSION_4_4) + +#endif /* GL_VERSION_4_4 */ + +/* -------------------------- GL_3DFX_multisample -------------------------- */ + +#ifndef GL_3DFX_multisample +#define GL_3DFX_multisample 1 + +#define GL_MULTISAMPLE_3DFX 0x86B2 +#define GL_SAMPLE_BUFFERS_3DFX 0x86B3 +#define GL_SAMPLES_3DFX 0x86B4 +#define GL_MULTISAMPLE_BIT_3DFX 0x20000000 + +#define GLEW_3DFX_multisample GLEW_GET_VAR(__GLEW_3DFX_multisample) + +#endif /* GL_3DFX_multisample */ + +/* ---------------------------- GL_3DFX_tbuffer ---------------------------- */ + +#ifndef GL_3DFX_tbuffer +#define GL_3DFX_tbuffer 1 + +typedef void (GLAPIENTRY * PFNGLTBUFFERMASK3DFXPROC) (GLuint mask); + +#define glTbufferMask3DFX GLEW_GET_FUN(__glewTbufferMask3DFX) + +#define GLEW_3DFX_tbuffer GLEW_GET_VAR(__GLEW_3DFX_tbuffer) + +#endif /* GL_3DFX_tbuffer */ + +/* -------------------- GL_3DFX_texture_compression_FXT1 ------------------- */ + +#ifndef GL_3DFX_texture_compression_FXT1 +#define GL_3DFX_texture_compression_FXT1 1 + +#define GL_COMPRESSED_RGB_FXT1_3DFX 0x86B0 +#define GL_COMPRESSED_RGBA_FXT1_3DFX 0x86B1 + +#define GLEW_3DFX_texture_compression_FXT1 GLEW_GET_VAR(__GLEW_3DFX_texture_compression_FXT1) + +#endif /* GL_3DFX_texture_compression_FXT1 */ + +/* ----------------------- GL_AMD_blend_minmax_factor ---------------------- */ + +#ifndef GL_AMD_blend_minmax_factor +#define GL_AMD_blend_minmax_factor 1 + +#define GL_FACTOR_MIN_AMD 0x901C +#define GL_FACTOR_MAX_AMD 0x901D + +#define GLEW_AMD_blend_minmax_factor GLEW_GET_VAR(__GLEW_AMD_blend_minmax_factor) + +#endif /* GL_AMD_blend_minmax_factor */ + +/* ----------------------- GL_AMD_conservative_depth ----------------------- */ + +#ifndef GL_AMD_conservative_depth +#define GL_AMD_conservative_depth 1 + +#define GLEW_AMD_conservative_depth GLEW_GET_VAR(__GLEW_AMD_conservative_depth) + +#endif /* GL_AMD_conservative_depth */ + +/* -------------------------- GL_AMD_debug_output -------------------------- */ + +#ifndef GL_AMD_debug_output +#define GL_AMD_debug_output 1 + +#define GL_MAX_DEBUG_MESSAGE_LENGTH_AMD 0x9143 +#define GL_MAX_DEBUG_LOGGED_MESSAGES_AMD 0x9144 +#define GL_DEBUG_LOGGED_MESSAGES_AMD 0x9145 +#define GL_DEBUG_SEVERITY_HIGH_AMD 0x9146 +#define GL_DEBUG_SEVERITY_MEDIUM_AMD 0x9147 +#define GL_DEBUG_SEVERITY_LOW_AMD 0x9148 +#define GL_DEBUG_CATEGORY_API_ERROR_AMD 0x9149 +#define GL_DEBUG_CATEGORY_WINDOW_SYSTEM_AMD 0x914A +#define GL_DEBUG_CATEGORY_DEPRECATION_AMD 0x914B +#define GL_DEBUG_CATEGORY_UNDEFINED_BEHAVIOR_AMD 0x914C +#define GL_DEBUG_CATEGORY_PERFORMANCE_AMD 0x914D +#define GL_DEBUG_CATEGORY_SHADER_COMPILER_AMD 0x914E +#define GL_DEBUG_CATEGORY_APPLICATION_AMD 0x914F +#define GL_DEBUG_CATEGORY_OTHER_AMD 0x9150 + +typedef void (APIENTRY *GLDEBUGPROCAMD)(GLuint id, GLenum category, GLenum severity, GLsizei length, const GLchar* message, GLvoid* userParam); + +typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGECALLBACKAMDPROC) (GLDEBUGPROCAMD callback, GLvoid *userParam); +typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGEENABLEAMDPROC) (GLenum category, GLenum severity, GLsizei count, const GLuint* ids, GLboolean enabled); +typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGEINSERTAMDPROC) (GLenum category, GLenum severity, GLuint id, GLsizei length, const GLchar* buf); +typedef GLuint (GLAPIENTRY * PFNGLGETDEBUGMESSAGELOGAMDPROC) (GLuint count, GLsizei bufsize, GLenum* categories, GLuint* severities, GLuint* ids, GLsizei* lengths, GLchar* message); + +#define glDebugMessageCallbackAMD GLEW_GET_FUN(__glewDebugMessageCallbackAMD) +#define glDebugMessageEnableAMD GLEW_GET_FUN(__glewDebugMessageEnableAMD) +#define glDebugMessageInsertAMD GLEW_GET_FUN(__glewDebugMessageInsertAMD) +#define glGetDebugMessageLogAMD GLEW_GET_FUN(__glewGetDebugMessageLogAMD) + +#define GLEW_AMD_debug_output GLEW_GET_VAR(__GLEW_AMD_debug_output) + +#endif /* GL_AMD_debug_output */ + +/* ---------------------- GL_AMD_depth_clamp_separate ---------------------- */ + +#ifndef GL_AMD_depth_clamp_separate +#define GL_AMD_depth_clamp_separate 1 + +#define GL_DEPTH_CLAMP_NEAR_AMD 0x901E +#define GL_DEPTH_CLAMP_FAR_AMD 0x901F + +#define GLEW_AMD_depth_clamp_separate GLEW_GET_VAR(__GLEW_AMD_depth_clamp_separate) + +#endif /* GL_AMD_depth_clamp_separate */ + +/* ----------------------- GL_AMD_draw_buffers_blend ----------------------- */ + +#ifndef GL_AMD_draw_buffers_blend +#define GL_AMD_draw_buffers_blend 1 + +typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONINDEXEDAMDPROC) (GLuint buf, GLenum mode); +typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONSEPARATEINDEXEDAMDPROC) (GLuint buf, GLenum modeRGB, GLenum modeAlpha); +typedef void (GLAPIENTRY * PFNGLBLENDFUNCINDEXEDAMDPROC) (GLuint buf, GLenum src, GLenum dst); +typedef void (GLAPIENTRY * PFNGLBLENDFUNCSEPARATEINDEXEDAMDPROC) (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); + +#define glBlendEquationIndexedAMD GLEW_GET_FUN(__glewBlendEquationIndexedAMD) +#define glBlendEquationSeparateIndexedAMD GLEW_GET_FUN(__glewBlendEquationSeparateIndexedAMD) +#define glBlendFuncIndexedAMD GLEW_GET_FUN(__glewBlendFuncIndexedAMD) +#define glBlendFuncSeparateIndexedAMD GLEW_GET_FUN(__glewBlendFuncSeparateIndexedAMD) + +#define GLEW_AMD_draw_buffers_blend GLEW_GET_VAR(__GLEW_AMD_draw_buffers_blend) + +#endif /* GL_AMD_draw_buffers_blend */ + +/* ---------------------- GL_AMD_interleaved_elements ---------------------- */ + +#ifndef GL_AMD_interleaved_elements +#define GL_AMD_interleaved_elements 1 + +#define GL_RED 0x1903 +#define GL_GREEN 0x1904 +#define GL_BLUE 0x1905 +#define GL_ALPHA 0x1906 +#define GL_RG8UI 0x8238 +#define GL_RG16UI 0x823A +#define GL_RGBA8UI 0x8D7C +#define GL_VERTEX_ELEMENT_SWIZZLE_AMD 0x91A4 +#define GL_VERTEX_ID_SWIZZLE_AMD 0x91A5 + +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBPARAMETERIAMDPROC) (GLuint index, GLenum pname, GLint param); + +#define glVertexAttribParameteriAMD GLEW_GET_FUN(__glewVertexAttribParameteriAMD) + +#define GLEW_AMD_interleaved_elements GLEW_GET_VAR(__GLEW_AMD_interleaved_elements) + +#endif /* GL_AMD_interleaved_elements */ + +/* ----------------------- GL_AMD_multi_draw_indirect ---------------------- */ + +#ifndef GL_AMD_multi_draw_indirect +#define GL_AMD_multi_draw_indirect 1 + +typedef void (GLAPIENTRY * PFNGLMULTIDRAWARRAYSINDIRECTAMDPROC) (GLenum mode, const GLvoid *indirect, GLsizei primcount, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSINDIRECTAMDPROC) (GLenum mode, GLenum type, const GLvoid *indirect, GLsizei primcount, GLsizei stride); + +#define glMultiDrawArraysIndirectAMD GLEW_GET_FUN(__glewMultiDrawArraysIndirectAMD) +#define glMultiDrawElementsIndirectAMD GLEW_GET_FUN(__glewMultiDrawElementsIndirectAMD) + +#define GLEW_AMD_multi_draw_indirect GLEW_GET_VAR(__GLEW_AMD_multi_draw_indirect) + +#endif /* GL_AMD_multi_draw_indirect */ + +/* ------------------------- GL_AMD_name_gen_delete ------------------------ */ + +#ifndef GL_AMD_name_gen_delete +#define GL_AMD_name_gen_delete 1 + +#define GL_DATA_BUFFER_AMD 0x9151 +#define GL_PERFORMANCE_MONITOR_AMD 0x9152 +#define GL_QUERY_OBJECT_AMD 0x9153 +#define GL_VERTEX_ARRAY_OBJECT_AMD 0x9154 +#define GL_SAMPLER_OBJECT_AMD 0x9155 + +typedef void (GLAPIENTRY * PFNGLDELETENAMESAMDPROC) (GLenum identifier, GLuint num, const GLuint* names); +typedef void (GLAPIENTRY * PFNGLGENNAMESAMDPROC) (GLenum identifier, GLuint num, GLuint* names); +typedef GLboolean (GLAPIENTRY * PFNGLISNAMEAMDPROC) (GLenum identifier, GLuint name); + +#define glDeleteNamesAMD GLEW_GET_FUN(__glewDeleteNamesAMD) +#define glGenNamesAMD GLEW_GET_FUN(__glewGenNamesAMD) +#define glIsNameAMD GLEW_GET_FUN(__glewIsNameAMD) + +#define GLEW_AMD_name_gen_delete GLEW_GET_VAR(__GLEW_AMD_name_gen_delete) + +#endif /* GL_AMD_name_gen_delete */ + +/* ----------------------- GL_AMD_performance_monitor ---------------------- */ + +#ifndef GL_AMD_performance_monitor +#define GL_AMD_performance_monitor 1 + +#define GL_COUNTER_TYPE_AMD 0x8BC0 +#define GL_COUNTER_RANGE_AMD 0x8BC1 +#define GL_UNSIGNED_INT64_AMD 0x8BC2 +#define GL_PERCENTAGE_AMD 0x8BC3 +#define GL_PERFMON_RESULT_AVAILABLE_AMD 0x8BC4 +#define GL_PERFMON_RESULT_SIZE_AMD 0x8BC5 +#define GL_PERFMON_RESULT_AMD 0x8BC6 + +typedef void (GLAPIENTRY * PFNGLBEGINPERFMONITORAMDPROC) (GLuint monitor); +typedef void (GLAPIENTRY * PFNGLDELETEPERFMONITORSAMDPROC) (GLsizei n, GLuint* monitors); +typedef void (GLAPIENTRY * PFNGLENDPERFMONITORAMDPROC) (GLuint monitor); +typedef void (GLAPIENTRY * PFNGLGENPERFMONITORSAMDPROC) (GLsizei n, GLuint* monitors); +typedef void (GLAPIENTRY * PFNGLGETPERFMONITORCOUNTERDATAAMDPROC) (GLuint monitor, GLenum pname, GLsizei dataSize, GLuint* data, GLint *bytesWritten); +typedef void (GLAPIENTRY * PFNGLGETPERFMONITORCOUNTERINFOAMDPROC) (GLuint group, GLuint counter, GLenum pname, GLvoid *data); +typedef void (GLAPIENTRY * PFNGLGETPERFMONITORCOUNTERSTRINGAMDPROC) (GLuint group, GLuint counter, GLsizei bufSize, GLsizei* length, GLchar *counterString); +typedef void (GLAPIENTRY * PFNGLGETPERFMONITORCOUNTERSAMDPROC) (GLuint group, GLint* numCounters, GLint *maxActiveCounters, GLsizei countersSize, GLuint *counters); +typedef void (GLAPIENTRY * PFNGLGETPERFMONITORGROUPSTRINGAMDPROC) (GLuint group, GLsizei bufSize, GLsizei* length, GLchar *groupString); +typedef void (GLAPIENTRY * PFNGLGETPERFMONITORGROUPSAMDPROC) (GLint* numGroups, GLsizei groupsSize, GLuint *groups); +typedef void (GLAPIENTRY * PFNGLSELECTPERFMONITORCOUNTERSAMDPROC) (GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint* counterList); + +#define glBeginPerfMonitorAMD GLEW_GET_FUN(__glewBeginPerfMonitorAMD) +#define glDeletePerfMonitorsAMD GLEW_GET_FUN(__glewDeletePerfMonitorsAMD) +#define glEndPerfMonitorAMD GLEW_GET_FUN(__glewEndPerfMonitorAMD) +#define glGenPerfMonitorsAMD GLEW_GET_FUN(__glewGenPerfMonitorsAMD) +#define glGetPerfMonitorCounterDataAMD GLEW_GET_FUN(__glewGetPerfMonitorCounterDataAMD) +#define glGetPerfMonitorCounterInfoAMD GLEW_GET_FUN(__glewGetPerfMonitorCounterInfoAMD) +#define glGetPerfMonitorCounterStringAMD GLEW_GET_FUN(__glewGetPerfMonitorCounterStringAMD) +#define glGetPerfMonitorCountersAMD GLEW_GET_FUN(__glewGetPerfMonitorCountersAMD) +#define glGetPerfMonitorGroupStringAMD GLEW_GET_FUN(__glewGetPerfMonitorGroupStringAMD) +#define glGetPerfMonitorGroupsAMD GLEW_GET_FUN(__glewGetPerfMonitorGroupsAMD) +#define glSelectPerfMonitorCountersAMD GLEW_GET_FUN(__glewSelectPerfMonitorCountersAMD) + +#define GLEW_AMD_performance_monitor GLEW_GET_VAR(__GLEW_AMD_performance_monitor) + +#endif /* GL_AMD_performance_monitor */ + +/* -------------------------- GL_AMD_pinned_memory ------------------------- */ + +#ifndef GL_AMD_pinned_memory +#define GL_AMD_pinned_memory 1 + +#define GL_EXTERNAL_VIRTUAL_MEMORY_BUFFER_AMD 0x9160 + +#define GLEW_AMD_pinned_memory GLEW_GET_VAR(__GLEW_AMD_pinned_memory) + +#endif /* GL_AMD_pinned_memory */ + +/* ----------------------- GL_AMD_query_buffer_object ---------------------- */ + +#ifndef GL_AMD_query_buffer_object +#define GL_AMD_query_buffer_object 1 + +#define GL_QUERY_BUFFER_AMD 0x9192 +#define GL_QUERY_BUFFER_BINDING_AMD 0x9193 +#define GL_QUERY_RESULT_NO_WAIT_AMD 0x9194 + +#define GLEW_AMD_query_buffer_object GLEW_GET_VAR(__GLEW_AMD_query_buffer_object) + +#endif /* GL_AMD_query_buffer_object */ + +/* ------------------------ GL_AMD_sample_positions ------------------------ */ + +#ifndef GL_AMD_sample_positions +#define GL_AMD_sample_positions 1 + +#define GL_SUBSAMPLE_DISTANCE_AMD 0x883F + +typedef void (GLAPIENTRY * PFNGLSETMULTISAMPLEFVAMDPROC) (GLenum pname, GLuint index, const GLfloat* val); + +#define glSetMultisamplefvAMD GLEW_GET_FUN(__glewSetMultisamplefvAMD) + +#define GLEW_AMD_sample_positions GLEW_GET_VAR(__GLEW_AMD_sample_positions) + +#endif /* GL_AMD_sample_positions */ + +/* ------------------ GL_AMD_seamless_cubemap_per_texture ------------------ */ + +#ifndef GL_AMD_seamless_cubemap_per_texture +#define GL_AMD_seamless_cubemap_per_texture 1 + +#define GL_TEXTURE_CUBE_MAP_SEAMLESS_ARB 0x884F + +#define GLEW_AMD_seamless_cubemap_per_texture GLEW_GET_VAR(__GLEW_AMD_seamless_cubemap_per_texture) + +#endif /* GL_AMD_seamless_cubemap_per_texture */ + +/* ---------------------- GL_AMD_shader_stencil_export --------------------- */ + +#ifndef GL_AMD_shader_stencil_export +#define GL_AMD_shader_stencil_export 1 + +#define GLEW_AMD_shader_stencil_export GLEW_GET_VAR(__GLEW_AMD_shader_stencil_export) + +#endif /* GL_AMD_shader_stencil_export */ + +/* ---------------------- GL_AMD_shader_trinary_minmax --------------------- */ + +#ifndef GL_AMD_shader_trinary_minmax +#define GL_AMD_shader_trinary_minmax 1 + +#define GLEW_AMD_shader_trinary_minmax GLEW_GET_VAR(__GLEW_AMD_shader_trinary_minmax) + +#endif /* GL_AMD_shader_trinary_minmax */ + +/* ------------------------- GL_AMD_sparse_texture ------------------------- */ + +#ifndef GL_AMD_sparse_texture +#define GL_AMD_sparse_texture 1 + +#define GL_TEXTURE_STORAGE_SPARSE_BIT_AMD 0x00000001 +#define GL_VIRTUAL_PAGE_SIZE_X_AMD 0x9195 +#define GL_VIRTUAL_PAGE_SIZE_Y_AMD 0x9196 +#define GL_VIRTUAL_PAGE_SIZE_Z_AMD 0x9197 +#define GL_MAX_SPARSE_TEXTURE_SIZE_AMD 0x9198 +#define GL_MAX_SPARSE_3D_TEXTURE_SIZE_AMD 0x9199 +#define GL_MAX_SPARSE_ARRAY_TEXTURE_LAYERS 0x919A +#define GL_MIN_SPARSE_LEVEL_AMD 0x919B +#define GL_MIN_LOD_WARNING_AMD 0x919C + +typedef void (GLAPIENTRY * PFNGLTEXSTORAGESPARSEAMDPROC) (GLenum target, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLsizei layers, GLbitfield flags); +typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGESPARSEAMDPROC) (GLuint texture, GLenum target, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLsizei layers, GLbitfield flags); + +#define glTexStorageSparseAMD GLEW_GET_FUN(__glewTexStorageSparseAMD) +#define glTextureStorageSparseAMD GLEW_GET_FUN(__glewTextureStorageSparseAMD) + +#define GLEW_AMD_sparse_texture GLEW_GET_VAR(__GLEW_AMD_sparse_texture) + +#endif /* GL_AMD_sparse_texture */ + +/* ------------------- GL_AMD_stencil_operation_extended ------------------- */ + +#ifndef GL_AMD_stencil_operation_extended +#define GL_AMD_stencil_operation_extended 1 + +#define GL_SET_AMD 0x874A +#define GL_REPLACE_VALUE_AMD 0x874B +#define GL_STENCIL_OP_VALUE_AMD 0x874C +#define GL_STENCIL_BACK_OP_VALUE_AMD 0x874D + +typedef void (GLAPIENTRY * PFNGLSTENCILOPVALUEAMDPROC) (GLenum face, GLuint value); + +#define glStencilOpValueAMD GLEW_GET_FUN(__glewStencilOpValueAMD) + +#define GLEW_AMD_stencil_operation_extended GLEW_GET_VAR(__GLEW_AMD_stencil_operation_extended) + +#endif /* GL_AMD_stencil_operation_extended */ + +/* ------------------------ GL_AMD_texture_texture4 ------------------------ */ + +#ifndef GL_AMD_texture_texture4 +#define GL_AMD_texture_texture4 1 + +#define GLEW_AMD_texture_texture4 GLEW_GET_VAR(__GLEW_AMD_texture_texture4) + +#endif /* GL_AMD_texture_texture4 */ + +/* --------------- GL_AMD_transform_feedback3_lines_triangles -------------- */ + +#ifndef GL_AMD_transform_feedback3_lines_triangles +#define GL_AMD_transform_feedback3_lines_triangles 1 + +#define GLEW_AMD_transform_feedback3_lines_triangles GLEW_GET_VAR(__GLEW_AMD_transform_feedback3_lines_triangles) + +#endif /* GL_AMD_transform_feedback3_lines_triangles */ + +/* ----------------------- GL_AMD_vertex_shader_layer ---------------------- */ + +#ifndef GL_AMD_vertex_shader_layer +#define GL_AMD_vertex_shader_layer 1 + +#define GLEW_AMD_vertex_shader_layer GLEW_GET_VAR(__GLEW_AMD_vertex_shader_layer) + +#endif /* GL_AMD_vertex_shader_layer */ + +/* -------------------- GL_AMD_vertex_shader_tessellator ------------------- */ + +#ifndef GL_AMD_vertex_shader_tessellator +#define GL_AMD_vertex_shader_tessellator 1 + +#define GL_SAMPLER_BUFFER_AMD 0x9001 +#define GL_INT_SAMPLER_BUFFER_AMD 0x9002 +#define GL_UNSIGNED_INT_SAMPLER_BUFFER_AMD 0x9003 +#define GL_TESSELLATION_MODE_AMD 0x9004 +#define GL_TESSELLATION_FACTOR_AMD 0x9005 +#define GL_DISCRETE_AMD 0x9006 +#define GL_CONTINUOUS_AMD 0x9007 + +typedef void (GLAPIENTRY * PFNGLTESSELLATIONFACTORAMDPROC) (GLfloat factor); +typedef void (GLAPIENTRY * PFNGLTESSELLATIONMODEAMDPROC) (GLenum mode); + +#define glTessellationFactorAMD GLEW_GET_FUN(__glewTessellationFactorAMD) +#define glTessellationModeAMD GLEW_GET_FUN(__glewTessellationModeAMD) + +#define GLEW_AMD_vertex_shader_tessellator GLEW_GET_VAR(__GLEW_AMD_vertex_shader_tessellator) + +#endif /* GL_AMD_vertex_shader_tessellator */ + +/* ------------------ GL_AMD_vertex_shader_viewport_index ------------------ */ + +#ifndef GL_AMD_vertex_shader_viewport_index +#define GL_AMD_vertex_shader_viewport_index 1 + +#define GLEW_AMD_vertex_shader_viewport_index GLEW_GET_VAR(__GLEW_AMD_vertex_shader_viewport_index) + +#endif /* GL_AMD_vertex_shader_viewport_index */ + +/* ------------------------- GL_ANGLE_depth_texture ------------------------ */ + +#ifndef GL_ANGLE_depth_texture +#define GL_ANGLE_depth_texture 1 + +#define GLEW_ANGLE_depth_texture GLEW_GET_VAR(__GLEW_ANGLE_depth_texture) + +#endif /* GL_ANGLE_depth_texture */ + +/* ----------------------- GL_ANGLE_framebuffer_blit ----------------------- */ + +#ifndef GL_ANGLE_framebuffer_blit +#define GL_ANGLE_framebuffer_blit 1 + +#define GL_DRAW_FRAMEBUFFER_BINDING_ANGLE 0x8CA6 +#define GL_READ_FRAMEBUFFER_ANGLE 0x8CA8 +#define GL_DRAW_FRAMEBUFFER_ANGLE 0x8CA9 +#define GL_READ_FRAMEBUFFER_BINDING_ANGLE 0x8CAA + +typedef void (GLAPIENTRY * PFNGLBLITFRAMEBUFFERANGLEPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); + +#define glBlitFramebufferANGLE GLEW_GET_FUN(__glewBlitFramebufferANGLE) + +#define GLEW_ANGLE_framebuffer_blit GLEW_GET_VAR(__GLEW_ANGLE_framebuffer_blit) + +#endif /* GL_ANGLE_framebuffer_blit */ + +/* -------------------- GL_ANGLE_framebuffer_multisample ------------------- */ + +#ifndef GL_ANGLE_framebuffer_multisample +#define GL_ANGLE_framebuffer_multisample 1 + +#define GL_RENDERBUFFER_SAMPLES_ANGLE 0x8CAB +#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_ANGLE 0x8D56 +#define GL_MAX_SAMPLES_ANGLE 0x8D57 + +typedef void (GLAPIENTRY * PFNGLRENDERBUFFERSTORAGEMULTISAMPLEANGLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); + +#define glRenderbufferStorageMultisampleANGLE GLEW_GET_FUN(__glewRenderbufferStorageMultisampleANGLE) + +#define GLEW_ANGLE_framebuffer_multisample GLEW_GET_VAR(__GLEW_ANGLE_framebuffer_multisample) + +#endif /* GL_ANGLE_framebuffer_multisample */ + +/* ----------------------- GL_ANGLE_instanced_arrays ----------------------- */ + +#ifndef GL_ANGLE_instanced_arrays +#define GL_ANGLE_instanced_arrays 1 + +#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE 0x88FE + +typedef void (GLAPIENTRY * PFNGLDRAWARRAYSINSTANCEDANGLEPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount); +typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDANGLEPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBDIVISORANGLEPROC) (GLuint index, GLuint divisor); + +#define glDrawArraysInstancedANGLE GLEW_GET_FUN(__glewDrawArraysInstancedANGLE) +#define glDrawElementsInstancedANGLE GLEW_GET_FUN(__glewDrawElementsInstancedANGLE) +#define glVertexAttribDivisorANGLE GLEW_GET_FUN(__glewVertexAttribDivisorANGLE) + +#define GLEW_ANGLE_instanced_arrays GLEW_GET_VAR(__GLEW_ANGLE_instanced_arrays) + +#endif /* GL_ANGLE_instanced_arrays */ + +/* -------------------- GL_ANGLE_pack_reverse_row_order -------------------- */ + +#ifndef GL_ANGLE_pack_reverse_row_order +#define GL_ANGLE_pack_reverse_row_order 1 + +#define GL_PACK_REVERSE_ROW_ORDER_ANGLE 0x93A4 + +#define GLEW_ANGLE_pack_reverse_row_order GLEW_GET_VAR(__GLEW_ANGLE_pack_reverse_row_order) + +#endif /* GL_ANGLE_pack_reverse_row_order */ + +/* ------------------------ GL_ANGLE_program_binary ------------------------ */ + +#ifndef GL_ANGLE_program_binary +#define GL_ANGLE_program_binary 1 + +#define GL_PROGRAM_BINARY_ANGLE 0x93A6 + +#define GLEW_ANGLE_program_binary GLEW_GET_VAR(__GLEW_ANGLE_program_binary) + +#endif /* GL_ANGLE_program_binary */ + +/* ------------------- GL_ANGLE_texture_compression_dxt1 ------------------- */ + +#ifndef GL_ANGLE_texture_compression_dxt1 +#define GL_ANGLE_texture_compression_dxt1 1 + +#define GL_COMPRESSED_RGB_S3TC_DXT1_ANGLE 0x83F0 +#define GL_COMPRESSED_RGBA_S3TC_DXT1_ANGLE 0x83F1 +#define GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE 0x83F2 +#define GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE 0x83F3 + +#define GLEW_ANGLE_texture_compression_dxt1 GLEW_GET_VAR(__GLEW_ANGLE_texture_compression_dxt1) + +#endif /* GL_ANGLE_texture_compression_dxt1 */ + +/* ------------------- GL_ANGLE_texture_compression_dxt3 ------------------- */ + +#ifndef GL_ANGLE_texture_compression_dxt3 +#define GL_ANGLE_texture_compression_dxt3 1 + +#define GL_COMPRESSED_RGB_S3TC_DXT1_ANGLE 0x83F0 +#define GL_COMPRESSED_RGBA_S3TC_DXT1_ANGLE 0x83F1 +#define GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE 0x83F2 +#define GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE 0x83F3 + +#define GLEW_ANGLE_texture_compression_dxt3 GLEW_GET_VAR(__GLEW_ANGLE_texture_compression_dxt3) + +#endif /* GL_ANGLE_texture_compression_dxt3 */ + +/* ------------------- GL_ANGLE_texture_compression_dxt5 ------------------- */ + +#ifndef GL_ANGLE_texture_compression_dxt5 +#define GL_ANGLE_texture_compression_dxt5 1 + +#define GL_COMPRESSED_RGB_S3TC_DXT1_ANGLE 0x83F0 +#define GL_COMPRESSED_RGBA_S3TC_DXT1_ANGLE 0x83F1 +#define GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE 0x83F2 +#define GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE 0x83F3 + +#define GLEW_ANGLE_texture_compression_dxt5 GLEW_GET_VAR(__GLEW_ANGLE_texture_compression_dxt5) + +#endif /* GL_ANGLE_texture_compression_dxt5 */ + +/* ------------------------- GL_ANGLE_texture_usage ------------------------ */ + +#ifndef GL_ANGLE_texture_usage +#define GL_ANGLE_texture_usage 1 + +#define GL_TEXTURE_USAGE_ANGLE 0x93A2 +#define GL_FRAMEBUFFER_ATTACHMENT_ANGLE 0x93A3 + +#define GLEW_ANGLE_texture_usage GLEW_GET_VAR(__GLEW_ANGLE_texture_usage) + +#endif /* GL_ANGLE_texture_usage */ + +/* -------------------------- GL_ANGLE_timer_query ------------------------- */ + +#ifndef GL_ANGLE_timer_query +#define GL_ANGLE_timer_query 1 + +#define GL_QUERY_COUNTER_BITS_ANGLE 0x8864 +#define GL_CURRENT_QUERY_ANGLE 0x8865 +#define GL_QUERY_RESULT_ANGLE 0x8866 +#define GL_QUERY_RESULT_AVAILABLE_ANGLE 0x8867 +#define GL_TIME_ELAPSED_ANGLE 0x88BF +#define GL_TIMESTAMP_ANGLE 0x8E28 + +typedef void (GLAPIENTRY * PFNGLBEGINQUERYANGLEPROC) (GLenum target, GLuint id); +typedef void (GLAPIENTRY * PFNGLDELETEQUERIESANGLEPROC) (GLsizei n, const GLuint* ids); +typedef void (GLAPIENTRY * PFNGLENDQUERYANGLEPROC) (GLenum target); +typedef void (GLAPIENTRY * PFNGLGENQUERIESANGLEPROC) (GLsizei n, GLuint* ids); +typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTI64VANGLEPROC) (GLuint id, GLenum pname, GLint64* params); +typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTIVANGLEPROC) (GLuint id, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTUI64VANGLEPROC) (GLuint id, GLenum pname, GLuint64* params); +typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTUIVANGLEPROC) (GLuint id, GLenum pname, GLuint* params); +typedef void (GLAPIENTRY * PFNGLGETQUERYIVANGLEPROC) (GLenum target, GLenum pname, GLint* params); +typedef GLboolean (GLAPIENTRY * PFNGLISQUERYANGLEPROC) (GLuint id); +typedef void (GLAPIENTRY * PFNGLQUERYCOUNTERANGLEPROC) (GLuint id, GLenum target); + +#define glBeginQueryANGLE GLEW_GET_FUN(__glewBeginQueryANGLE) +#define glDeleteQueriesANGLE GLEW_GET_FUN(__glewDeleteQueriesANGLE) +#define glEndQueryANGLE GLEW_GET_FUN(__glewEndQueryANGLE) +#define glGenQueriesANGLE GLEW_GET_FUN(__glewGenQueriesANGLE) +#define glGetQueryObjecti64vANGLE GLEW_GET_FUN(__glewGetQueryObjecti64vANGLE) +#define glGetQueryObjectivANGLE GLEW_GET_FUN(__glewGetQueryObjectivANGLE) +#define glGetQueryObjectui64vANGLE GLEW_GET_FUN(__glewGetQueryObjectui64vANGLE) +#define glGetQueryObjectuivANGLE GLEW_GET_FUN(__glewGetQueryObjectuivANGLE) +#define glGetQueryivANGLE GLEW_GET_FUN(__glewGetQueryivANGLE) +#define glIsQueryANGLE GLEW_GET_FUN(__glewIsQueryANGLE) +#define glQueryCounterANGLE GLEW_GET_FUN(__glewQueryCounterANGLE) + +#define GLEW_ANGLE_timer_query GLEW_GET_VAR(__GLEW_ANGLE_timer_query) + +#endif /* GL_ANGLE_timer_query */ + +/* ------------------- GL_ANGLE_translated_shader_source ------------------- */ + +#ifndef GL_ANGLE_translated_shader_source +#define GL_ANGLE_translated_shader_source 1 + +#define GL_TRANSLATED_SHADER_SOURCE_LENGTH_ANGLE 0x93A0 + +typedef void (GLAPIENTRY * PFNGLGETTRANSLATEDSHADERSOURCEANGLEPROC) (GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* source); + +#define glGetTranslatedShaderSourceANGLE GLEW_GET_FUN(__glewGetTranslatedShaderSourceANGLE) + +#define GLEW_ANGLE_translated_shader_source GLEW_GET_VAR(__GLEW_ANGLE_translated_shader_source) + +#endif /* GL_ANGLE_translated_shader_source */ + +/* ----------------------- GL_APPLE_aux_depth_stencil ---------------------- */ + +#ifndef GL_APPLE_aux_depth_stencil +#define GL_APPLE_aux_depth_stencil 1 + +#define GL_AUX_DEPTH_STENCIL_APPLE 0x8A14 + +#define GLEW_APPLE_aux_depth_stencil GLEW_GET_VAR(__GLEW_APPLE_aux_depth_stencil) + +#endif /* GL_APPLE_aux_depth_stencil */ + +/* ------------------------ GL_APPLE_client_storage ------------------------ */ + +#ifndef GL_APPLE_client_storage +#define GL_APPLE_client_storage 1 + +#define GL_UNPACK_CLIENT_STORAGE_APPLE 0x85B2 + +#define GLEW_APPLE_client_storage GLEW_GET_VAR(__GLEW_APPLE_client_storage) + +#endif /* GL_APPLE_client_storage */ + +/* ------------------------- GL_APPLE_element_array ------------------------ */ + +#ifndef GL_APPLE_element_array +#define GL_APPLE_element_array 1 + +#define GL_ELEMENT_ARRAY_APPLE 0x8A0C +#define GL_ELEMENT_ARRAY_TYPE_APPLE 0x8A0D +#define GL_ELEMENT_ARRAY_POINTER_APPLE 0x8A0E + +typedef void (GLAPIENTRY * PFNGLDRAWELEMENTARRAYAPPLEPROC) (GLenum mode, GLint first, GLsizei count); +typedef void (GLAPIENTRY * PFNGLDRAWRANGEELEMENTARRAYAPPLEPROC) (GLenum mode, GLuint start, GLuint end, GLint first, GLsizei count); +typedef void (GLAPIENTRY * PFNGLELEMENTPOINTERAPPLEPROC) (GLenum type, const GLvoid *pointer); +typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTARRAYAPPLEPROC) (GLenum mode, const GLint* first, const GLsizei *count, GLsizei primcount); +typedef void (GLAPIENTRY * PFNGLMULTIDRAWRANGEELEMENTARRAYAPPLEPROC) (GLenum mode, GLuint start, GLuint end, const GLint* first, const GLsizei *count, GLsizei primcount); + +#define glDrawElementArrayAPPLE GLEW_GET_FUN(__glewDrawElementArrayAPPLE) +#define glDrawRangeElementArrayAPPLE GLEW_GET_FUN(__glewDrawRangeElementArrayAPPLE) +#define glElementPointerAPPLE GLEW_GET_FUN(__glewElementPointerAPPLE) +#define glMultiDrawElementArrayAPPLE GLEW_GET_FUN(__glewMultiDrawElementArrayAPPLE) +#define glMultiDrawRangeElementArrayAPPLE GLEW_GET_FUN(__glewMultiDrawRangeElementArrayAPPLE) + +#define GLEW_APPLE_element_array GLEW_GET_VAR(__GLEW_APPLE_element_array) + +#endif /* GL_APPLE_element_array */ + +/* ----------------------------- GL_APPLE_fence ---------------------------- */ + +#ifndef GL_APPLE_fence +#define GL_APPLE_fence 1 + +#define GL_DRAW_PIXELS_APPLE 0x8A0A +#define GL_FENCE_APPLE 0x8A0B + +typedef void (GLAPIENTRY * PFNGLDELETEFENCESAPPLEPROC) (GLsizei n, const GLuint* fences); +typedef void (GLAPIENTRY * PFNGLFINISHFENCEAPPLEPROC) (GLuint fence); +typedef void (GLAPIENTRY * PFNGLFINISHOBJECTAPPLEPROC) (GLenum object, GLint name); +typedef void (GLAPIENTRY * PFNGLGENFENCESAPPLEPROC) (GLsizei n, GLuint* fences); +typedef GLboolean (GLAPIENTRY * PFNGLISFENCEAPPLEPROC) (GLuint fence); +typedef void (GLAPIENTRY * PFNGLSETFENCEAPPLEPROC) (GLuint fence); +typedef GLboolean (GLAPIENTRY * PFNGLTESTFENCEAPPLEPROC) (GLuint fence); +typedef GLboolean (GLAPIENTRY * PFNGLTESTOBJECTAPPLEPROC) (GLenum object, GLuint name); + +#define glDeleteFencesAPPLE GLEW_GET_FUN(__glewDeleteFencesAPPLE) +#define glFinishFenceAPPLE GLEW_GET_FUN(__glewFinishFenceAPPLE) +#define glFinishObjectAPPLE GLEW_GET_FUN(__glewFinishObjectAPPLE) +#define glGenFencesAPPLE GLEW_GET_FUN(__glewGenFencesAPPLE) +#define glIsFenceAPPLE GLEW_GET_FUN(__glewIsFenceAPPLE) +#define glSetFenceAPPLE GLEW_GET_FUN(__glewSetFenceAPPLE) +#define glTestFenceAPPLE GLEW_GET_FUN(__glewTestFenceAPPLE) +#define glTestObjectAPPLE GLEW_GET_FUN(__glewTestObjectAPPLE) + +#define GLEW_APPLE_fence GLEW_GET_VAR(__GLEW_APPLE_fence) + +#endif /* GL_APPLE_fence */ + +/* ------------------------- GL_APPLE_float_pixels ------------------------- */ + +#ifndef GL_APPLE_float_pixels +#define GL_APPLE_float_pixels 1 + +#define GL_HALF_APPLE 0x140B +#define GL_RGBA_FLOAT32_APPLE 0x8814 +#define GL_RGB_FLOAT32_APPLE 0x8815 +#define GL_ALPHA_FLOAT32_APPLE 0x8816 +#define GL_INTENSITY_FLOAT32_APPLE 0x8817 +#define GL_LUMINANCE_FLOAT32_APPLE 0x8818 +#define GL_LUMINANCE_ALPHA_FLOAT32_APPLE 0x8819 +#define GL_RGBA_FLOAT16_APPLE 0x881A +#define GL_RGB_FLOAT16_APPLE 0x881B +#define GL_ALPHA_FLOAT16_APPLE 0x881C +#define GL_INTENSITY_FLOAT16_APPLE 0x881D +#define GL_LUMINANCE_FLOAT16_APPLE 0x881E +#define GL_LUMINANCE_ALPHA_FLOAT16_APPLE 0x881F +#define GL_COLOR_FLOAT_APPLE 0x8A0F + +#define GLEW_APPLE_float_pixels GLEW_GET_VAR(__GLEW_APPLE_float_pixels) + +#endif /* GL_APPLE_float_pixels */ + +/* ---------------------- GL_APPLE_flush_buffer_range ---------------------- */ + +#ifndef GL_APPLE_flush_buffer_range +#define GL_APPLE_flush_buffer_range 1 + +#define GL_BUFFER_SERIALIZED_MODIFY_APPLE 0x8A12 +#define GL_BUFFER_FLUSHING_UNMAP_APPLE 0x8A13 + +typedef void (GLAPIENTRY * PFNGLBUFFERPARAMETERIAPPLEPROC) (GLenum target, GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLFLUSHMAPPEDBUFFERRANGEAPPLEPROC) (GLenum target, GLintptr offset, GLsizeiptr size); + +#define glBufferParameteriAPPLE GLEW_GET_FUN(__glewBufferParameteriAPPLE) +#define glFlushMappedBufferRangeAPPLE GLEW_GET_FUN(__glewFlushMappedBufferRangeAPPLE) + +#define GLEW_APPLE_flush_buffer_range GLEW_GET_VAR(__GLEW_APPLE_flush_buffer_range) + +#endif /* GL_APPLE_flush_buffer_range */ + +/* ----------------------- GL_APPLE_object_purgeable ----------------------- */ + +#ifndef GL_APPLE_object_purgeable +#define GL_APPLE_object_purgeable 1 + +#define GL_BUFFER_OBJECT_APPLE 0x85B3 +#define GL_RELEASED_APPLE 0x8A19 +#define GL_VOLATILE_APPLE 0x8A1A +#define GL_RETAINED_APPLE 0x8A1B +#define GL_UNDEFINED_APPLE 0x8A1C +#define GL_PURGEABLE_APPLE 0x8A1D + +typedef void (GLAPIENTRY * PFNGLGETOBJECTPARAMETERIVAPPLEPROC) (GLenum objectType, GLuint name, GLenum pname, GLint* params); +typedef GLenum (GLAPIENTRY * PFNGLOBJECTPURGEABLEAPPLEPROC) (GLenum objectType, GLuint name, GLenum option); +typedef GLenum (GLAPIENTRY * PFNGLOBJECTUNPURGEABLEAPPLEPROC) (GLenum objectType, GLuint name, GLenum option); + +#define glGetObjectParameterivAPPLE GLEW_GET_FUN(__glewGetObjectParameterivAPPLE) +#define glObjectPurgeableAPPLE GLEW_GET_FUN(__glewObjectPurgeableAPPLE) +#define glObjectUnpurgeableAPPLE GLEW_GET_FUN(__glewObjectUnpurgeableAPPLE) + +#define GLEW_APPLE_object_purgeable GLEW_GET_VAR(__GLEW_APPLE_object_purgeable) + +#endif /* GL_APPLE_object_purgeable */ + +/* ------------------------- GL_APPLE_pixel_buffer ------------------------- */ + +#ifndef GL_APPLE_pixel_buffer +#define GL_APPLE_pixel_buffer 1 + +#define GL_MIN_PBUFFER_VIEWPORT_DIMS_APPLE 0x8A10 + +#define GLEW_APPLE_pixel_buffer GLEW_GET_VAR(__GLEW_APPLE_pixel_buffer) + +#endif /* GL_APPLE_pixel_buffer */ + +/* ---------------------------- GL_APPLE_rgb_422 --------------------------- */ + +#ifndef GL_APPLE_rgb_422 +#define GL_APPLE_rgb_422 1 + +#define GL_UNSIGNED_SHORT_8_8_APPLE 0x85BA +#define GL_UNSIGNED_SHORT_8_8_REV_APPLE 0x85BB +#define GL_RGB_422_APPLE 0x8A1F + +#define GLEW_APPLE_rgb_422 GLEW_GET_VAR(__GLEW_APPLE_rgb_422) + +#endif /* GL_APPLE_rgb_422 */ + +/* --------------------------- GL_APPLE_row_bytes -------------------------- */ + +#ifndef GL_APPLE_row_bytes +#define GL_APPLE_row_bytes 1 + +#define GL_PACK_ROW_BYTES_APPLE 0x8A15 +#define GL_UNPACK_ROW_BYTES_APPLE 0x8A16 + +#define GLEW_APPLE_row_bytes GLEW_GET_VAR(__GLEW_APPLE_row_bytes) + +#endif /* GL_APPLE_row_bytes */ + +/* ------------------------ GL_APPLE_specular_vector ----------------------- */ + +#ifndef GL_APPLE_specular_vector +#define GL_APPLE_specular_vector 1 + +#define GL_LIGHT_MODEL_SPECULAR_VECTOR_APPLE 0x85B0 + +#define GLEW_APPLE_specular_vector GLEW_GET_VAR(__GLEW_APPLE_specular_vector) + +#endif /* GL_APPLE_specular_vector */ + +/* ------------------------- GL_APPLE_texture_range ------------------------ */ + +#ifndef GL_APPLE_texture_range +#define GL_APPLE_texture_range 1 + +#define GL_TEXTURE_RANGE_LENGTH_APPLE 0x85B7 +#define GL_TEXTURE_RANGE_POINTER_APPLE 0x85B8 +#define GL_TEXTURE_STORAGE_HINT_APPLE 0x85BC +#define GL_STORAGE_PRIVATE_APPLE 0x85BD +#define GL_STORAGE_CACHED_APPLE 0x85BE +#define GL_STORAGE_SHARED_APPLE 0x85BF + +typedef void (GLAPIENTRY * PFNGLGETTEXPARAMETERPOINTERVAPPLEPROC) (GLenum target, GLenum pname, GLvoid **params); +typedef void (GLAPIENTRY * PFNGLTEXTURERANGEAPPLEPROC) (GLenum target, GLsizei length, GLvoid *pointer); + +#define glGetTexParameterPointervAPPLE GLEW_GET_FUN(__glewGetTexParameterPointervAPPLE) +#define glTextureRangeAPPLE GLEW_GET_FUN(__glewTextureRangeAPPLE) + +#define GLEW_APPLE_texture_range GLEW_GET_VAR(__GLEW_APPLE_texture_range) + +#endif /* GL_APPLE_texture_range */ + +/* ------------------------ GL_APPLE_transform_hint ------------------------ */ + +#ifndef GL_APPLE_transform_hint +#define GL_APPLE_transform_hint 1 + +#define GL_TRANSFORM_HINT_APPLE 0x85B1 + +#define GLEW_APPLE_transform_hint GLEW_GET_VAR(__GLEW_APPLE_transform_hint) + +#endif /* GL_APPLE_transform_hint */ + +/* ---------------------- GL_APPLE_vertex_array_object --------------------- */ + +#ifndef GL_APPLE_vertex_array_object +#define GL_APPLE_vertex_array_object 1 + +#define GL_VERTEX_ARRAY_BINDING_APPLE 0x85B5 + +typedef void (GLAPIENTRY * PFNGLBINDVERTEXARRAYAPPLEPROC) (GLuint array); +typedef void (GLAPIENTRY * PFNGLDELETEVERTEXARRAYSAPPLEPROC) (GLsizei n, const GLuint* arrays); +typedef void (GLAPIENTRY * PFNGLGENVERTEXARRAYSAPPLEPROC) (GLsizei n, const GLuint* arrays); +typedef GLboolean (GLAPIENTRY * PFNGLISVERTEXARRAYAPPLEPROC) (GLuint array); + +#define glBindVertexArrayAPPLE GLEW_GET_FUN(__glewBindVertexArrayAPPLE) +#define glDeleteVertexArraysAPPLE GLEW_GET_FUN(__glewDeleteVertexArraysAPPLE) +#define glGenVertexArraysAPPLE GLEW_GET_FUN(__glewGenVertexArraysAPPLE) +#define glIsVertexArrayAPPLE GLEW_GET_FUN(__glewIsVertexArrayAPPLE) + +#define GLEW_APPLE_vertex_array_object GLEW_GET_VAR(__GLEW_APPLE_vertex_array_object) + +#endif /* GL_APPLE_vertex_array_object */ + +/* ---------------------- GL_APPLE_vertex_array_range ---------------------- */ + +#ifndef GL_APPLE_vertex_array_range +#define GL_APPLE_vertex_array_range 1 + +#define GL_VERTEX_ARRAY_RANGE_APPLE 0x851D +#define GL_VERTEX_ARRAY_RANGE_LENGTH_APPLE 0x851E +#define GL_VERTEX_ARRAY_STORAGE_HINT_APPLE 0x851F +#define GL_MAX_VERTEX_ARRAY_RANGE_ELEMENT_APPLE 0x8520 +#define GL_VERTEX_ARRAY_RANGE_POINTER_APPLE 0x8521 +#define GL_STORAGE_CLIENT_APPLE 0x85B4 +#define GL_STORAGE_CACHED_APPLE 0x85BE +#define GL_STORAGE_SHARED_APPLE 0x85BF + +typedef void (GLAPIENTRY * PFNGLFLUSHVERTEXARRAYRANGEAPPLEPROC) (GLsizei length, GLvoid *pointer); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYPARAMETERIAPPLEPROC) (GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYRANGEAPPLEPROC) (GLsizei length, GLvoid *pointer); + +#define glFlushVertexArrayRangeAPPLE GLEW_GET_FUN(__glewFlushVertexArrayRangeAPPLE) +#define glVertexArrayParameteriAPPLE GLEW_GET_FUN(__glewVertexArrayParameteriAPPLE) +#define glVertexArrayRangeAPPLE GLEW_GET_FUN(__glewVertexArrayRangeAPPLE) + +#define GLEW_APPLE_vertex_array_range GLEW_GET_VAR(__GLEW_APPLE_vertex_array_range) + +#endif /* GL_APPLE_vertex_array_range */ + +/* ------------------- GL_APPLE_vertex_program_evaluators ------------------ */ + +#ifndef GL_APPLE_vertex_program_evaluators +#define GL_APPLE_vertex_program_evaluators 1 + +#define GL_VERTEX_ATTRIB_MAP1_APPLE 0x8A00 +#define GL_VERTEX_ATTRIB_MAP2_APPLE 0x8A01 +#define GL_VERTEX_ATTRIB_MAP1_SIZE_APPLE 0x8A02 +#define GL_VERTEX_ATTRIB_MAP1_COEFF_APPLE 0x8A03 +#define GL_VERTEX_ATTRIB_MAP1_ORDER_APPLE 0x8A04 +#define GL_VERTEX_ATTRIB_MAP1_DOMAIN_APPLE 0x8A05 +#define GL_VERTEX_ATTRIB_MAP2_SIZE_APPLE 0x8A06 +#define GL_VERTEX_ATTRIB_MAP2_COEFF_APPLE 0x8A07 +#define GL_VERTEX_ATTRIB_MAP2_ORDER_APPLE 0x8A08 +#define GL_VERTEX_ATTRIB_MAP2_DOMAIN_APPLE 0x8A09 + +typedef void (GLAPIENTRY * PFNGLDISABLEVERTEXATTRIBAPPLEPROC) (GLuint index, GLenum pname); +typedef void (GLAPIENTRY * PFNGLENABLEVERTEXATTRIBAPPLEPROC) (GLuint index, GLenum pname); +typedef GLboolean (GLAPIENTRY * PFNGLISVERTEXATTRIBENABLEDAPPLEPROC) (GLuint index, GLenum pname); +typedef void (GLAPIENTRY * PFNGLMAPVERTEXATTRIB1DAPPLEPROC) (GLuint index, GLuint size, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble* points); +typedef void (GLAPIENTRY * PFNGLMAPVERTEXATTRIB1FAPPLEPROC) (GLuint index, GLuint size, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat* points); +typedef void (GLAPIENTRY * PFNGLMAPVERTEXATTRIB2DAPPLEPROC) (GLuint index, GLuint size, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble* points); +typedef void (GLAPIENTRY * PFNGLMAPVERTEXATTRIB2FAPPLEPROC) (GLuint index, GLuint size, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat* points); + +#define glDisableVertexAttribAPPLE GLEW_GET_FUN(__glewDisableVertexAttribAPPLE) +#define glEnableVertexAttribAPPLE GLEW_GET_FUN(__glewEnableVertexAttribAPPLE) +#define glIsVertexAttribEnabledAPPLE GLEW_GET_FUN(__glewIsVertexAttribEnabledAPPLE) +#define glMapVertexAttrib1dAPPLE GLEW_GET_FUN(__glewMapVertexAttrib1dAPPLE) +#define glMapVertexAttrib1fAPPLE GLEW_GET_FUN(__glewMapVertexAttrib1fAPPLE) +#define glMapVertexAttrib2dAPPLE GLEW_GET_FUN(__glewMapVertexAttrib2dAPPLE) +#define glMapVertexAttrib2fAPPLE GLEW_GET_FUN(__glewMapVertexAttrib2fAPPLE) + +#define GLEW_APPLE_vertex_program_evaluators GLEW_GET_VAR(__GLEW_APPLE_vertex_program_evaluators) + +#endif /* GL_APPLE_vertex_program_evaluators */ + +/* --------------------------- GL_APPLE_ycbcr_422 -------------------------- */ + +#ifndef GL_APPLE_ycbcr_422 +#define GL_APPLE_ycbcr_422 1 + +#define GL_YCBCR_422_APPLE 0x85B9 + +#define GLEW_APPLE_ycbcr_422 GLEW_GET_VAR(__GLEW_APPLE_ycbcr_422) + +#endif /* GL_APPLE_ycbcr_422 */ + +/* ------------------------ GL_ARB_ES2_compatibility ----------------------- */ + +#ifndef GL_ARB_ES2_compatibility +#define GL_ARB_ES2_compatibility 1 + +#define GL_FIXED 0x140C +#define GL_IMPLEMENTATION_COLOR_READ_TYPE 0x8B9A +#define GL_IMPLEMENTATION_COLOR_READ_FORMAT 0x8B9B +#define GL_RGB565 0x8D62 +#define GL_LOW_FLOAT 0x8DF0 +#define GL_MEDIUM_FLOAT 0x8DF1 +#define GL_HIGH_FLOAT 0x8DF2 +#define GL_LOW_INT 0x8DF3 +#define GL_MEDIUM_INT 0x8DF4 +#define GL_HIGH_INT 0x8DF5 +#define GL_SHADER_BINARY_FORMATS 0x8DF8 +#define GL_NUM_SHADER_BINARY_FORMATS 0x8DF9 +#define GL_SHADER_COMPILER 0x8DFA +#define GL_MAX_VERTEX_UNIFORM_VECTORS 0x8DFB +#define GL_MAX_VARYING_VECTORS 0x8DFC +#define GL_MAX_FRAGMENT_UNIFORM_VECTORS 0x8DFD + +typedef int GLfixed; + +typedef void (GLAPIENTRY * PFNGLCLEARDEPTHFPROC) (GLclampf d); +typedef void (GLAPIENTRY * PFNGLDEPTHRANGEFPROC) (GLclampf n, GLclampf f); +typedef void (GLAPIENTRY * PFNGLGETSHADERPRECISIONFORMATPROC) (GLenum shadertype, GLenum precisiontype, GLint* range, GLint *precision); +typedef void (GLAPIENTRY * PFNGLRELEASESHADERCOMPILERPROC) (void); +typedef void (GLAPIENTRY * PFNGLSHADERBINARYPROC) (GLsizei count, const GLuint* shaders, GLenum binaryformat, const GLvoid*binary, GLsizei length); + +#define glClearDepthf GLEW_GET_FUN(__glewClearDepthf) +#define glDepthRangef GLEW_GET_FUN(__glewDepthRangef) +#define glGetShaderPrecisionFormat GLEW_GET_FUN(__glewGetShaderPrecisionFormat) +#define glReleaseShaderCompiler GLEW_GET_FUN(__glewReleaseShaderCompiler) +#define glShaderBinary GLEW_GET_FUN(__glewShaderBinary) + +#define GLEW_ARB_ES2_compatibility GLEW_GET_VAR(__GLEW_ARB_ES2_compatibility) + +#endif /* GL_ARB_ES2_compatibility */ + +/* ------------------------ GL_ARB_ES3_compatibility ----------------------- */ + +#ifndef GL_ARB_ES3_compatibility +#define GL_ARB_ES3_compatibility 1 + +#define GL_TEXTURE_IMMUTABLE_LEVELS 0x82DF +#define GL_PRIMITIVE_RESTART_FIXED_INDEX 0x8D69 +#define GL_ANY_SAMPLES_PASSED_CONSERVATIVE 0x8D6A +#define GL_MAX_ELEMENT_INDEX 0x8D6B +#define GL_COMPRESSED_R11_EAC 0x9270 +#define GL_COMPRESSED_SIGNED_R11_EAC 0x9271 +#define GL_COMPRESSED_RG11_EAC 0x9272 +#define GL_COMPRESSED_SIGNED_RG11_EAC 0x9273 +#define GL_COMPRESSED_RGB8_ETC2 0x9274 +#define GL_COMPRESSED_SRGB8_ETC2 0x9275 +#define GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 0x9276 +#define GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 0x9277 +#define GL_COMPRESSED_RGBA8_ETC2_EAC 0x9278 +#define GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC 0x9279 + +#define GLEW_ARB_ES3_compatibility GLEW_GET_VAR(__GLEW_ARB_ES3_compatibility) + +#endif /* GL_ARB_ES3_compatibility */ + +/* ------------------------ GL_ARB_arrays_of_arrays ------------------------ */ + +#ifndef GL_ARB_arrays_of_arrays +#define GL_ARB_arrays_of_arrays 1 + +#define GLEW_ARB_arrays_of_arrays GLEW_GET_VAR(__GLEW_ARB_arrays_of_arrays) + +#endif /* GL_ARB_arrays_of_arrays */ + +/* -------------------------- GL_ARB_base_instance ------------------------- */ + +#ifndef GL_ARB_base_instance +#define GL_ARB_base_instance 1 + +typedef void (GLAPIENTRY * PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount, GLuint baseinstance); +typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDBASEINSTANCEPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount, GLuint baseinstance); +typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount, GLint basevertex, GLuint baseinstance); + +#define glDrawArraysInstancedBaseInstance GLEW_GET_FUN(__glewDrawArraysInstancedBaseInstance) +#define glDrawElementsInstancedBaseInstance GLEW_GET_FUN(__glewDrawElementsInstancedBaseInstance) +#define glDrawElementsInstancedBaseVertexBaseInstance GLEW_GET_FUN(__glewDrawElementsInstancedBaseVertexBaseInstance) + +#define GLEW_ARB_base_instance GLEW_GET_VAR(__GLEW_ARB_base_instance) + +#endif /* GL_ARB_base_instance */ + +/* ------------------------ GL_ARB_bindless_texture ------------------------ */ + +#ifndef GL_ARB_bindless_texture +#define GL_ARB_bindless_texture 1 + +#define GL_UNSIGNED_INT64_ARB 0x140F + +typedef GLuint64 (GLAPIENTRY * PFNGLGETIMAGEHANDLEARBPROC) (GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum format); +typedef GLuint64 (GLAPIENTRY * PFNGLGETTEXTUREHANDLEARBPROC) (GLuint texture); +typedef GLuint64 (GLAPIENTRY * PFNGLGETTEXTURESAMPLERHANDLEARBPROC) (GLuint texture, GLuint sampler); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBLUI64VARBPROC) (GLuint index, GLenum pname, GLuint64EXT* params); +typedef GLboolean (GLAPIENTRY * PFNGLISIMAGEHANDLERESIDENTARBPROC) (GLuint64 handle); +typedef GLboolean (GLAPIENTRY * PFNGLISTEXTUREHANDLERESIDENTARBPROC) (GLuint64 handle); +typedef void (GLAPIENTRY * PFNGLMAKEIMAGEHANDLENONRESIDENTARBPROC) (GLuint64 handle); +typedef void (GLAPIENTRY * PFNGLMAKEIMAGEHANDLERESIDENTARBPROC) (GLuint64 handle, GLenum access); +typedef void (GLAPIENTRY * PFNGLMAKETEXTUREHANDLENONRESIDENTARBPROC) (GLuint64 handle); +typedef void (GLAPIENTRY * PFNGLMAKETEXTUREHANDLERESIDENTARBPROC) (GLuint64 handle); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMHANDLEUI64ARBPROC) (GLuint program, GLint location, GLuint64 value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMHANDLEUI64VARBPROC) (GLuint program, GLint location, GLsizei count, const GLuint64* values); +typedef void (GLAPIENTRY * PFNGLUNIFORMHANDLEUI64ARBPROC) (GLint location, GLuint64 value); +typedef void (GLAPIENTRY * PFNGLUNIFORMHANDLEUI64VARBPROC) (GLint location, GLsizei count, const GLuint64* value); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1UI64ARBPROC) (GLuint index, GLuint64EXT x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1UI64VARBPROC) (GLuint index, const GLuint64EXT* v); + +#define glGetImageHandleARB GLEW_GET_FUN(__glewGetImageHandleARB) +#define glGetTextureHandleARB GLEW_GET_FUN(__glewGetTextureHandleARB) +#define glGetTextureSamplerHandleARB GLEW_GET_FUN(__glewGetTextureSamplerHandleARB) +#define glGetVertexAttribLui64vARB GLEW_GET_FUN(__glewGetVertexAttribLui64vARB) +#define glIsImageHandleResidentARB GLEW_GET_FUN(__glewIsImageHandleResidentARB) +#define glIsTextureHandleResidentARB GLEW_GET_FUN(__glewIsTextureHandleResidentARB) +#define glMakeImageHandleNonResidentARB GLEW_GET_FUN(__glewMakeImageHandleNonResidentARB) +#define glMakeImageHandleResidentARB GLEW_GET_FUN(__glewMakeImageHandleResidentARB) +#define glMakeTextureHandleNonResidentARB GLEW_GET_FUN(__glewMakeTextureHandleNonResidentARB) +#define glMakeTextureHandleResidentARB GLEW_GET_FUN(__glewMakeTextureHandleResidentARB) +#define glProgramUniformHandleui64ARB GLEW_GET_FUN(__glewProgramUniformHandleui64ARB) +#define glProgramUniformHandleui64vARB GLEW_GET_FUN(__glewProgramUniformHandleui64vARB) +#define glUniformHandleui64ARB GLEW_GET_FUN(__glewUniformHandleui64ARB) +#define glUniformHandleui64vARB GLEW_GET_FUN(__glewUniformHandleui64vARB) +#define glVertexAttribL1ui64ARB GLEW_GET_FUN(__glewVertexAttribL1ui64ARB) +#define glVertexAttribL1ui64vARB GLEW_GET_FUN(__glewVertexAttribL1ui64vARB) + +#define GLEW_ARB_bindless_texture GLEW_GET_VAR(__GLEW_ARB_bindless_texture) + +#endif /* GL_ARB_bindless_texture */ + +/* ----------------------- GL_ARB_blend_func_extended ---------------------- */ + +#ifndef GL_ARB_blend_func_extended +#define GL_ARB_blend_func_extended 1 + +#define GL_SRC1_COLOR 0x88F9 +#define GL_ONE_MINUS_SRC1_COLOR 0x88FA +#define GL_ONE_MINUS_SRC1_ALPHA 0x88FB +#define GL_MAX_DUAL_SOURCE_DRAW_BUFFERS 0x88FC + +typedef void (GLAPIENTRY * PFNGLBINDFRAGDATALOCATIONINDEXEDPROC) (GLuint program, GLuint colorNumber, GLuint index, const GLchar * name); +typedef GLint (GLAPIENTRY * PFNGLGETFRAGDATAINDEXPROC) (GLuint program, const GLchar * name); + +#define glBindFragDataLocationIndexed GLEW_GET_FUN(__glewBindFragDataLocationIndexed) +#define glGetFragDataIndex GLEW_GET_FUN(__glewGetFragDataIndex) + +#define GLEW_ARB_blend_func_extended GLEW_GET_VAR(__GLEW_ARB_blend_func_extended) + +#endif /* GL_ARB_blend_func_extended */ + +/* ------------------------- GL_ARB_buffer_storage ------------------------- */ + +#ifndef GL_ARB_buffer_storage +#define GL_ARB_buffer_storage 1 + +#define GL_MAP_READ_BIT 0x0001 +#define GL_MAP_WRITE_BIT 0x0002 +#define GL_MAP_PERSISTENT_BIT 0x00000040 +#define GL_MAP_COHERENT_BIT 0x00000080 +#define GL_DYNAMIC_STORAGE_BIT 0x0100 +#define GL_CLIENT_STORAGE_BIT 0x0200 +#define GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT 0x00004000 +#define GL_BUFFER_IMMUTABLE_STORAGE 0x821F +#define GL_BUFFER_STORAGE_FLAGS 0x8220 + +typedef void (GLAPIENTRY * PFNGLBUFFERSTORAGEPROC) (GLenum target, GLsizeiptr size, const GLvoid* data, GLbitfield flags); +typedef void (GLAPIENTRY * PFNGLNAMEDBUFFERSTORAGEEXTPROC) (GLuint buffer, GLsizeiptr size, const GLvoid* data, GLbitfield flags); + +#define glBufferStorage GLEW_GET_FUN(__glewBufferStorage) +#define glNamedBufferStorageEXT GLEW_GET_FUN(__glewNamedBufferStorageEXT) + +#define GLEW_ARB_buffer_storage GLEW_GET_VAR(__GLEW_ARB_buffer_storage) + +#endif /* GL_ARB_buffer_storage */ + +/* ---------------------------- GL_ARB_cl_event ---------------------------- */ + +#ifndef GL_ARB_cl_event +#define GL_ARB_cl_event 1 + +#define GL_SYNC_CL_EVENT_ARB 0x8240 +#define GL_SYNC_CL_EVENT_COMPLETE_ARB 0x8241 + +typedef struct _cl_context *cl_context; +typedef struct _cl_event *cl_event; + +typedef GLsync (GLAPIENTRY * PFNGLCREATESYNCFROMCLEVENTARBPROC) (cl_context context, cl_event event, GLbitfield flags); + +#define glCreateSyncFromCLeventARB GLEW_GET_FUN(__glewCreateSyncFromCLeventARB) + +#define GLEW_ARB_cl_event GLEW_GET_VAR(__GLEW_ARB_cl_event) + +#endif /* GL_ARB_cl_event */ + +/* ----------------------- GL_ARB_clear_buffer_object ---------------------- */ + +#ifndef GL_ARB_clear_buffer_object +#define GL_ARB_clear_buffer_object 1 + +typedef void (GLAPIENTRY * PFNGLCLEARBUFFERDATAPROC) (GLenum target, GLenum internalformat, GLenum format, GLenum type, const GLvoid* data); +typedef void (GLAPIENTRY * PFNGLCLEARBUFFERSUBDATAPROC) (GLenum target, GLenum internalformat, GLintptr offset, GLsizeiptr size, GLenum format, GLenum type, const GLvoid* data); +typedef void (GLAPIENTRY * PFNGLCLEARNAMEDBUFFERDATAEXTPROC) (GLuint buffer, GLenum internalformat, GLenum format, GLenum type, const GLvoid* data); +typedef void (GLAPIENTRY * PFNGLCLEARNAMEDBUFFERSUBDATAEXTPROC) (GLuint buffer, GLenum internalformat, GLintptr offset, GLsizeiptr size, GLenum format, GLenum type, const GLvoid* data); + +#define glClearBufferData GLEW_GET_FUN(__glewClearBufferData) +#define glClearBufferSubData GLEW_GET_FUN(__glewClearBufferSubData) +#define glClearNamedBufferDataEXT GLEW_GET_FUN(__glewClearNamedBufferDataEXT) +#define glClearNamedBufferSubDataEXT GLEW_GET_FUN(__glewClearNamedBufferSubDataEXT) + +#define GLEW_ARB_clear_buffer_object GLEW_GET_VAR(__GLEW_ARB_clear_buffer_object) + +#endif /* GL_ARB_clear_buffer_object */ + +/* -------------------------- GL_ARB_clear_texture ------------------------- */ + +#ifndef GL_ARB_clear_texture +#define GL_ARB_clear_texture 1 + +#define GL_CLEAR_TEXTURE 0x9365 + +typedef void (GLAPIENTRY * PFNGLCLEARTEXIMAGEPROC) (GLuint texture, GLint level, GLenum format, GLenum type, const GLvoid* data); +typedef void (GLAPIENTRY * PFNGLCLEARTEXSUBIMAGEPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid* data); + +#define glClearTexImage GLEW_GET_FUN(__glewClearTexImage) +#define glClearTexSubImage GLEW_GET_FUN(__glewClearTexSubImage) + +#define GLEW_ARB_clear_texture GLEW_GET_VAR(__GLEW_ARB_clear_texture) + +#endif /* GL_ARB_clear_texture */ + +/* ----------------------- GL_ARB_color_buffer_float ----------------------- */ + +#ifndef GL_ARB_color_buffer_float +#define GL_ARB_color_buffer_float 1 + +#define GL_RGBA_FLOAT_MODE_ARB 0x8820 +#define GL_CLAMP_VERTEX_COLOR_ARB 0x891A +#define GL_CLAMP_FRAGMENT_COLOR_ARB 0x891B +#define GL_CLAMP_READ_COLOR_ARB 0x891C +#define GL_FIXED_ONLY_ARB 0x891D + +typedef void (GLAPIENTRY * PFNGLCLAMPCOLORARBPROC) (GLenum target, GLenum clamp); + +#define glClampColorARB GLEW_GET_FUN(__glewClampColorARB) + +#define GLEW_ARB_color_buffer_float GLEW_GET_VAR(__GLEW_ARB_color_buffer_float) + +#endif /* GL_ARB_color_buffer_float */ + +/* -------------------------- GL_ARB_compatibility ------------------------- */ + +#ifndef GL_ARB_compatibility +#define GL_ARB_compatibility 1 + +#define GLEW_ARB_compatibility GLEW_GET_VAR(__GLEW_ARB_compatibility) + +#endif /* GL_ARB_compatibility */ + +/* ---------------- GL_ARB_compressed_texture_pixel_storage ---------------- */ + +#ifndef GL_ARB_compressed_texture_pixel_storage +#define GL_ARB_compressed_texture_pixel_storage 1 + +#define GL_UNPACK_COMPRESSED_BLOCK_WIDTH 0x9127 +#define GL_UNPACK_COMPRESSED_BLOCK_HEIGHT 0x9128 +#define GL_UNPACK_COMPRESSED_BLOCK_DEPTH 0x9129 +#define GL_UNPACK_COMPRESSED_BLOCK_SIZE 0x912A +#define GL_PACK_COMPRESSED_BLOCK_WIDTH 0x912B +#define GL_PACK_COMPRESSED_BLOCK_HEIGHT 0x912C +#define GL_PACK_COMPRESSED_BLOCK_DEPTH 0x912D +#define GL_PACK_COMPRESSED_BLOCK_SIZE 0x912E + +#define GLEW_ARB_compressed_texture_pixel_storage GLEW_GET_VAR(__GLEW_ARB_compressed_texture_pixel_storage) + +#endif /* GL_ARB_compressed_texture_pixel_storage */ + +/* ------------------------- GL_ARB_compute_shader ------------------------- */ + +#ifndef GL_ARB_compute_shader +#define GL_ARB_compute_shader 1 + +#define GL_COMPUTE_SHADER_BIT 0x00000020 +#define GL_MAX_COMPUTE_SHARED_MEMORY_SIZE 0x8262 +#define GL_MAX_COMPUTE_UNIFORM_COMPONENTS 0x8263 +#define GL_MAX_COMPUTE_ATOMIC_COUNTER_BUFFERS 0x8264 +#define GL_MAX_COMPUTE_ATOMIC_COUNTERS 0x8265 +#define GL_MAX_COMBINED_COMPUTE_UNIFORM_COMPONENTS 0x8266 +#define GL_COMPUTE_WORK_GROUP_SIZE 0x8267 +#define GL_MAX_COMPUTE_WORK_GROUP_INVOCATIONS 0x90EB +#define GL_UNIFORM_BLOCK_REFERENCED_BY_COMPUTE_SHADER 0x90EC +#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_COMPUTE_SHADER 0x90ED +#define GL_DISPATCH_INDIRECT_BUFFER 0x90EE +#define GL_DISPATCH_INDIRECT_BUFFER_BINDING 0x90EF +#define GL_COMPUTE_SHADER 0x91B9 +#define GL_MAX_COMPUTE_UNIFORM_BLOCKS 0x91BB +#define GL_MAX_COMPUTE_TEXTURE_IMAGE_UNITS 0x91BC +#define GL_MAX_COMPUTE_IMAGE_UNIFORMS 0x91BD +#define GL_MAX_COMPUTE_WORK_GROUP_COUNT 0x91BE +#define GL_MAX_COMPUTE_WORK_GROUP_SIZE 0x91BF + +typedef void (GLAPIENTRY * PFNGLDISPATCHCOMPUTEPROC) (GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z); +typedef void (GLAPIENTRY * PFNGLDISPATCHCOMPUTEINDIRECTPROC) (GLintptr indirect); + +#define glDispatchCompute GLEW_GET_FUN(__glewDispatchCompute) +#define glDispatchComputeIndirect GLEW_GET_FUN(__glewDispatchComputeIndirect) + +#define GLEW_ARB_compute_shader GLEW_GET_VAR(__GLEW_ARB_compute_shader) + +#endif /* GL_ARB_compute_shader */ + +/* ------------------- GL_ARB_compute_variable_group_size ------------------ */ + +#ifndef GL_ARB_compute_variable_group_size +#define GL_ARB_compute_variable_group_size 1 + +#define GL_MAX_COMPUTE_FIXED_GROUP_INVOCATIONS_ARB 0x90EB +#define GL_MAX_COMPUTE_FIXED_GROUP_SIZE_ARB 0x91BF +#define GL_MAX_COMPUTE_VARIABLE_GROUP_INVOCATIONS_ARB 0x9344 +#define GL_MAX_COMPUTE_VARIABLE_GROUP_SIZE_ARB 0x9345 + +typedef void (GLAPIENTRY * PFNGLDISPATCHCOMPUTEGROUPSIZEARBPROC) (GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z, GLuint group_size_x, GLuint group_size_y, GLuint group_size_z); + +#define glDispatchComputeGroupSizeARB GLEW_GET_FUN(__glewDispatchComputeGroupSizeARB) + +#define GLEW_ARB_compute_variable_group_size GLEW_GET_VAR(__GLEW_ARB_compute_variable_group_size) + +#endif /* GL_ARB_compute_variable_group_size */ + +/* ----------------------- GL_ARB_conservative_depth ----------------------- */ + +#ifndef GL_ARB_conservative_depth +#define GL_ARB_conservative_depth 1 + +#define GLEW_ARB_conservative_depth GLEW_GET_VAR(__GLEW_ARB_conservative_depth) + +#endif /* GL_ARB_conservative_depth */ + +/* --------------------------- GL_ARB_copy_buffer -------------------------- */ + +#ifndef GL_ARB_copy_buffer +#define GL_ARB_copy_buffer 1 + +#define GL_COPY_READ_BUFFER 0x8F36 +#define GL_COPY_WRITE_BUFFER 0x8F37 + +typedef void (GLAPIENTRY * PFNGLCOPYBUFFERSUBDATAPROC) (GLenum readtarget, GLenum writetarget, GLintptr readoffset, GLintptr writeoffset, GLsizeiptr size); + +#define glCopyBufferSubData GLEW_GET_FUN(__glewCopyBufferSubData) + +#define GLEW_ARB_copy_buffer GLEW_GET_VAR(__GLEW_ARB_copy_buffer) + +#endif /* GL_ARB_copy_buffer */ + +/* --------------------------- GL_ARB_copy_image --------------------------- */ + +#ifndef GL_ARB_copy_image +#define GL_ARB_copy_image 1 + +typedef void (GLAPIENTRY * PFNGLCOPYIMAGESUBDATAPROC) (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth); + +#define glCopyImageSubData GLEW_GET_FUN(__glewCopyImageSubData) + +#define GLEW_ARB_copy_image GLEW_GET_VAR(__GLEW_ARB_copy_image) + +#endif /* GL_ARB_copy_image */ + +/* -------------------------- GL_ARB_debug_output -------------------------- */ + +#ifndef GL_ARB_debug_output +#define GL_ARB_debug_output 1 + +#define GL_DEBUG_OUTPUT_SYNCHRONOUS_ARB 0x8242 +#define GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH_ARB 0x8243 +#define GL_DEBUG_CALLBACK_FUNCTION_ARB 0x8244 +#define GL_DEBUG_CALLBACK_USER_PARAM_ARB 0x8245 +#define GL_DEBUG_SOURCE_API_ARB 0x8246 +#define GL_DEBUG_SOURCE_WINDOW_SYSTEM_ARB 0x8247 +#define GL_DEBUG_SOURCE_SHADER_COMPILER_ARB 0x8248 +#define GL_DEBUG_SOURCE_THIRD_PARTY_ARB 0x8249 +#define GL_DEBUG_SOURCE_APPLICATION_ARB 0x824A +#define GL_DEBUG_SOURCE_OTHER_ARB 0x824B +#define GL_DEBUG_TYPE_ERROR_ARB 0x824C +#define GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR_ARB 0x824D +#define GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR_ARB 0x824E +#define GL_DEBUG_TYPE_PORTABILITY_ARB 0x824F +#define GL_DEBUG_TYPE_PERFORMANCE_ARB 0x8250 +#define GL_DEBUG_TYPE_OTHER_ARB 0x8251 +#define GL_MAX_DEBUG_MESSAGE_LENGTH_ARB 0x9143 +#define GL_MAX_DEBUG_LOGGED_MESSAGES_ARB 0x9144 +#define GL_DEBUG_LOGGED_MESSAGES_ARB 0x9145 +#define GL_DEBUG_SEVERITY_HIGH_ARB 0x9146 +#define GL_DEBUG_SEVERITY_MEDIUM_ARB 0x9147 +#define GL_DEBUG_SEVERITY_LOW_ARB 0x9148 + +typedef void (APIENTRY *GLDEBUGPROCARB)(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar* message, GLvoid* userParam); + +typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGECALLBACKARBPROC) (GLDEBUGPROCARB callback, const GLvoid *userParam); +typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGECONTROLARBPROC) (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint* ids, GLboolean enabled); +typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGEINSERTARBPROC) (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar* buf); +typedef GLuint (GLAPIENTRY * PFNGLGETDEBUGMESSAGELOGARBPROC) (GLuint count, GLsizei bufsize, GLenum* sources, GLenum* types, GLuint* ids, GLenum* severities, GLsizei* lengths, GLchar* messageLog); + +#define glDebugMessageCallbackARB GLEW_GET_FUN(__glewDebugMessageCallbackARB) +#define glDebugMessageControlARB GLEW_GET_FUN(__glewDebugMessageControlARB) +#define glDebugMessageInsertARB GLEW_GET_FUN(__glewDebugMessageInsertARB) +#define glGetDebugMessageLogARB GLEW_GET_FUN(__glewGetDebugMessageLogARB) + +#define GLEW_ARB_debug_output GLEW_GET_VAR(__GLEW_ARB_debug_output) + +#endif /* GL_ARB_debug_output */ + +/* ----------------------- GL_ARB_depth_buffer_float ----------------------- */ + +#ifndef GL_ARB_depth_buffer_float +#define GL_ARB_depth_buffer_float 1 + +#define GL_DEPTH_COMPONENT32F 0x8CAC +#define GL_DEPTH32F_STENCIL8 0x8CAD +#define GL_FLOAT_32_UNSIGNED_INT_24_8_REV 0x8DAD + +#define GLEW_ARB_depth_buffer_float GLEW_GET_VAR(__GLEW_ARB_depth_buffer_float) + +#endif /* GL_ARB_depth_buffer_float */ + +/* --------------------------- GL_ARB_depth_clamp -------------------------- */ + +#ifndef GL_ARB_depth_clamp +#define GL_ARB_depth_clamp 1 + +#define GL_DEPTH_CLAMP 0x864F + +#define GLEW_ARB_depth_clamp GLEW_GET_VAR(__GLEW_ARB_depth_clamp) + +#endif /* GL_ARB_depth_clamp */ + +/* -------------------------- GL_ARB_depth_texture ------------------------- */ + +#ifndef GL_ARB_depth_texture +#define GL_ARB_depth_texture 1 + +#define GL_DEPTH_COMPONENT16_ARB 0x81A5 +#define GL_DEPTH_COMPONENT24_ARB 0x81A6 +#define GL_DEPTH_COMPONENT32_ARB 0x81A7 +#define GL_TEXTURE_DEPTH_SIZE_ARB 0x884A +#define GL_DEPTH_TEXTURE_MODE_ARB 0x884B + +#define GLEW_ARB_depth_texture GLEW_GET_VAR(__GLEW_ARB_depth_texture) + +#endif /* GL_ARB_depth_texture */ + +/* -------------------------- GL_ARB_draw_buffers -------------------------- */ + +#ifndef GL_ARB_draw_buffers +#define GL_ARB_draw_buffers 1 + +#define GL_MAX_DRAW_BUFFERS_ARB 0x8824 +#define GL_DRAW_BUFFER0_ARB 0x8825 +#define GL_DRAW_BUFFER1_ARB 0x8826 +#define GL_DRAW_BUFFER2_ARB 0x8827 +#define GL_DRAW_BUFFER3_ARB 0x8828 +#define GL_DRAW_BUFFER4_ARB 0x8829 +#define GL_DRAW_BUFFER5_ARB 0x882A +#define GL_DRAW_BUFFER6_ARB 0x882B +#define GL_DRAW_BUFFER7_ARB 0x882C +#define GL_DRAW_BUFFER8_ARB 0x882D +#define GL_DRAW_BUFFER9_ARB 0x882E +#define GL_DRAW_BUFFER10_ARB 0x882F +#define GL_DRAW_BUFFER11_ARB 0x8830 +#define GL_DRAW_BUFFER12_ARB 0x8831 +#define GL_DRAW_BUFFER13_ARB 0x8832 +#define GL_DRAW_BUFFER14_ARB 0x8833 +#define GL_DRAW_BUFFER15_ARB 0x8834 + +typedef void (GLAPIENTRY * PFNGLDRAWBUFFERSARBPROC) (GLsizei n, const GLenum* bufs); + +#define glDrawBuffersARB GLEW_GET_FUN(__glewDrawBuffersARB) + +#define GLEW_ARB_draw_buffers GLEW_GET_VAR(__GLEW_ARB_draw_buffers) + +#endif /* GL_ARB_draw_buffers */ + +/* ----------------------- GL_ARB_draw_buffers_blend ----------------------- */ + +#ifndef GL_ARB_draw_buffers_blend +#define GL_ARB_draw_buffers_blend 1 + +typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONSEPARATEIARBPROC) (GLuint buf, GLenum modeRGB, GLenum modeAlpha); +typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONIARBPROC) (GLuint buf, GLenum mode); +typedef void (GLAPIENTRY * PFNGLBLENDFUNCSEPARATEIARBPROC) (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); +typedef void (GLAPIENTRY * PFNGLBLENDFUNCIARBPROC) (GLuint buf, GLenum src, GLenum dst); + +#define glBlendEquationSeparateiARB GLEW_GET_FUN(__glewBlendEquationSeparateiARB) +#define glBlendEquationiARB GLEW_GET_FUN(__glewBlendEquationiARB) +#define glBlendFuncSeparateiARB GLEW_GET_FUN(__glewBlendFuncSeparateiARB) +#define glBlendFunciARB GLEW_GET_FUN(__glewBlendFunciARB) + +#define GLEW_ARB_draw_buffers_blend GLEW_GET_VAR(__GLEW_ARB_draw_buffers_blend) + +#endif /* GL_ARB_draw_buffers_blend */ + +/* -------------------- GL_ARB_draw_elements_base_vertex ------------------- */ + +#ifndef GL_ARB_draw_elements_base_vertex +#define GL_ARB_draw_elements_base_vertex 1 + +typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSBASEVERTEXPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLint basevertex); +typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount, GLint basevertex); +typedef void (GLAPIENTRY * PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices, GLint basevertex); +typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC) (GLenum mode, const GLsizei* count, GLenum type, const GLvoid* const *indices, GLsizei primcount, const GLint *basevertex); + +#define glDrawElementsBaseVertex GLEW_GET_FUN(__glewDrawElementsBaseVertex) +#define glDrawElementsInstancedBaseVertex GLEW_GET_FUN(__glewDrawElementsInstancedBaseVertex) +#define glDrawRangeElementsBaseVertex GLEW_GET_FUN(__glewDrawRangeElementsBaseVertex) +#define glMultiDrawElementsBaseVertex GLEW_GET_FUN(__glewMultiDrawElementsBaseVertex) + +#define GLEW_ARB_draw_elements_base_vertex GLEW_GET_VAR(__GLEW_ARB_draw_elements_base_vertex) + +#endif /* GL_ARB_draw_elements_base_vertex */ + +/* -------------------------- GL_ARB_draw_indirect ------------------------- */ + +#ifndef GL_ARB_draw_indirect +#define GL_ARB_draw_indirect 1 + +#define GL_DRAW_INDIRECT_BUFFER 0x8F3F +#define GL_DRAW_INDIRECT_BUFFER_BINDING 0x8F43 + +typedef void (GLAPIENTRY * PFNGLDRAWARRAYSINDIRECTPROC) (GLenum mode, const GLvoid *indirect); +typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINDIRECTPROC) (GLenum mode, GLenum type, const GLvoid *indirect); + +#define glDrawArraysIndirect GLEW_GET_FUN(__glewDrawArraysIndirect) +#define glDrawElementsIndirect GLEW_GET_FUN(__glewDrawElementsIndirect) + +#define GLEW_ARB_draw_indirect GLEW_GET_VAR(__GLEW_ARB_draw_indirect) + +#endif /* GL_ARB_draw_indirect */ + +/* ------------------------- GL_ARB_draw_instanced ------------------------- */ + +#ifndef GL_ARB_draw_instanced +#define GL_ARB_draw_instanced 1 + +#define GLEW_ARB_draw_instanced GLEW_GET_VAR(__GLEW_ARB_draw_instanced) + +#endif /* GL_ARB_draw_instanced */ + +/* ------------------------ GL_ARB_enhanced_layouts ------------------------ */ + +#ifndef GL_ARB_enhanced_layouts +#define GL_ARB_enhanced_layouts 1 + +#define GL_LOCATION_COMPONENT 0x934A +#define GL_TRANSFORM_FEEDBACK_BUFFER_INDEX 0x934B +#define GL_TRANSFORM_FEEDBACK_BUFFER_STRIDE 0x934C + +#define GLEW_ARB_enhanced_layouts GLEW_GET_VAR(__GLEW_ARB_enhanced_layouts) + +#endif /* GL_ARB_enhanced_layouts */ + +/* -------------------- GL_ARB_explicit_attrib_location -------------------- */ + +#ifndef GL_ARB_explicit_attrib_location +#define GL_ARB_explicit_attrib_location 1 + +#define GLEW_ARB_explicit_attrib_location GLEW_GET_VAR(__GLEW_ARB_explicit_attrib_location) + +#endif /* GL_ARB_explicit_attrib_location */ + +/* -------------------- GL_ARB_explicit_uniform_location ------------------- */ + +#ifndef GL_ARB_explicit_uniform_location +#define GL_ARB_explicit_uniform_location 1 + +#define GL_MAX_UNIFORM_LOCATIONS 0x826E + +#define GLEW_ARB_explicit_uniform_location GLEW_GET_VAR(__GLEW_ARB_explicit_uniform_location) + +#endif /* GL_ARB_explicit_uniform_location */ + +/* ------------------- GL_ARB_fragment_coord_conventions ------------------- */ + +#ifndef GL_ARB_fragment_coord_conventions +#define GL_ARB_fragment_coord_conventions 1 + +#define GLEW_ARB_fragment_coord_conventions GLEW_GET_VAR(__GLEW_ARB_fragment_coord_conventions) + +#endif /* GL_ARB_fragment_coord_conventions */ + +/* --------------------- GL_ARB_fragment_layer_viewport -------------------- */ + +#ifndef GL_ARB_fragment_layer_viewport +#define GL_ARB_fragment_layer_viewport 1 + +#define GLEW_ARB_fragment_layer_viewport GLEW_GET_VAR(__GLEW_ARB_fragment_layer_viewport) + +#endif /* GL_ARB_fragment_layer_viewport */ + +/* ------------------------ GL_ARB_fragment_program ------------------------ */ + +#ifndef GL_ARB_fragment_program +#define GL_ARB_fragment_program 1 + +#define GL_FRAGMENT_PROGRAM_ARB 0x8804 +#define GL_PROGRAM_ALU_INSTRUCTIONS_ARB 0x8805 +#define GL_PROGRAM_TEX_INSTRUCTIONS_ARB 0x8806 +#define GL_PROGRAM_TEX_INDIRECTIONS_ARB 0x8807 +#define GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x8808 +#define GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x8809 +#define GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x880A +#define GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB 0x880B +#define GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB 0x880C +#define GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB 0x880D +#define GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x880E +#define GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x880F +#define GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x8810 +#define GL_MAX_TEXTURE_COORDS_ARB 0x8871 +#define GL_MAX_TEXTURE_IMAGE_UNITS_ARB 0x8872 + +#define GLEW_ARB_fragment_program GLEW_GET_VAR(__GLEW_ARB_fragment_program) + +#endif /* GL_ARB_fragment_program */ + +/* --------------------- GL_ARB_fragment_program_shadow -------------------- */ + +#ifndef GL_ARB_fragment_program_shadow +#define GL_ARB_fragment_program_shadow 1 + +#define GLEW_ARB_fragment_program_shadow GLEW_GET_VAR(__GLEW_ARB_fragment_program_shadow) + +#endif /* GL_ARB_fragment_program_shadow */ + +/* ------------------------- GL_ARB_fragment_shader ------------------------ */ + +#ifndef GL_ARB_fragment_shader +#define GL_ARB_fragment_shader 1 + +#define GL_FRAGMENT_SHADER_ARB 0x8B30 +#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB 0x8B49 +#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB 0x8B8B + +#define GLEW_ARB_fragment_shader GLEW_GET_VAR(__GLEW_ARB_fragment_shader) + +#endif /* GL_ARB_fragment_shader */ + +/* ------------------- GL_ARB_framebuffer_no_attachments ------------------- */ + +#ifndef GL_ARB_framebuffer_no_attachments +#define GL_ARB_framebuffer_no_attachments 1 + +#define GL_FRAMEBUFFER_DEFAULT_WIDTH 0x9310 +#define GL_FRAMEBUFFER_DEFAULT_HEIGHT 0x9311 +#define GL_FRAMEBUFFER_DEFAULT_LAYERS 0x9312 +#define GL_FRAMEBUFFER_DEFAULT_SAMPLES 0x9313 +#define GL_FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS 0x9314 +#define GL_MAX_FRAMEBUFFER_WIDTH 0x9315 +#define GL_MAX_FRAMEBUFFER_HEIGHT 0x9316 +#define GL_MAX_FRAMEBUFFER_LAYERS 0x9317 +#define GL_MAX_FRAMEBUFFER_SAMPLES 0x9318 + +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERPARAMETERIPROC) (GLenum target, GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLGETFRAMEBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVEXTPROC) (GLuint framebuffer, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERPARAMETERIEXTPROC) (GLuint framebuffer, GLenum pname, GLint param); + +#define glFramebufferParameteri GLEW_GET_FUN(__glewFramebufferParameteri) +#define glGetFramebufferParameteriv GLEW_GET_FUN(__glewGetFramebufferParameteriv) +#define glGetNamedFramebufferParameterivEXT GLEW_GET_FUN(__glewGetNamedFramebufferParameterivEXT) +#define glNamedFramebufferParameteriEXT GLEW_GET_FUN(__glewNamedFramebufferParameteriEXT) + +#define GLEW_ARB_framebuffer_no_attachments GLEW_GET_VAR(__GLEW_ARB_framebuffer_no_attachments) + +#endif /* GL_ARB_framebuffer_no_attachments */ + +/* ----------------------- GL_ARB_framebuffer_object ----------------------- */ + +#ifndef GL_ARB_framebuffer_object +#define GL_ARB_framebuffer_object 1 + +#define GL_INVALID_FRAMEBUFFER_OPERATION 0x0506 +#define GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING 0x8210 +#define GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE 0x8211 +#define GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE 0x8212 +#define GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE 0x8213 +#define GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE 0x8214 +#define GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE 0x8215 +#define GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE 0x8216 +#define GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE 0x8217 +#define GL_FRAMEBUFFER_DEFAULT 0x8218 +#define GL_FRAMEBUFFER_UNDEFINED 0x8219 +#define GL_DEPTH_STENCIL_ATTACHMENT 0x821A +#define GL_INDEX 0x8222 +#define GL_MAX_RENDERBUFFER_SIZE 0x84E8 +#define GL_DEPTH_STENCIL 0x84F9 +#define GL_UNSIGNED_INT_24_8 0x84FA +#define GL_DEPTH24_STENCIL8 0x88F0 +#define GL_TEXTURE_STENCIL_SIZE 0x88F1 +#define GL_UNSIGNED_NORMALIZED 0x8C17 +#define GL_SRGB 0x8C40 +#define GL_DRAW_FRAMEBUFFER_BINDING 0x8CA6 +#define GL_FRAMEBUFFER_BINDING 0x8CA6 +#define GL_RENDERBUFFER_BINDING 0x8CA7 +#define GL_READ_FRAMEBUFFER 0x8CA8 +#define GL_DRAW_FRAMEBUFFER 0x8CA9 +#define GL_READ_FRAMEBUFFER_BINDING 0x8CAA +#define GL_RENDERBUFFER_SAMPLES 0x8CAB +#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE 0x8CD0 +#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME 0x8CD1 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL 0x8CD2 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE 0x8CD3 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER 0x8CD4 +#define GL_FRAMEBUFFER_COMPLETE 0x8CD5 +#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT 0x8CD6 +#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT 0x8CD7 +#define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER 0x8CDB +#define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER 0x8CDC +#define GL_FRAMEBUFFER_UNSUPPORTED 0x8CDD +#define GL_MAX_COLOR_ATTACHMENTS 0x8CDF +#define GL_COLOR_ATTACHMENT0 0x8CE0 +#define GL_COLOR_ATTACHMENT1 0x8CE1 +#define GL_COLOR_ATTACHMENT2 0x8CE2 +#define GL_COLOR_ATTACHMENT3 0x8CE3 +#define GL_COLOR_ATTACHMENT4 0x8CE4 +#define GL_COLOR_ATTACHMENT5 0x8CE5 +#define GL_COLOR_ATTACHMENT6 0x8CE6 +#define GL_COLOR_ATTACHMENT7 0x8CE7 +#define GL_COLOR_ATTACHMENT8 0x8CE8 +#define GL_COLOR_ATTACHMENT9 0x8CE9 +#define GL_COLOR_ATTACHMENT10 0x8CEA +#define GL_COLOR_ATTACHMENT11 0x8CEB +#define GL_COLOR_ATTACHMENT12 0x8CEC +#define GL_COLOR_ATTACHMENT13 0x8CED +#define GL_COLOR_ATTACHMENT14 0x8CEE +#define GL_COLOR_ATTACHMENT15 0x8CEF +#define GL_DEPTH_ATTACHMENT 0x8D00 +#define GL_STENCIL_ATTACHMENT 0x8D20 +#define GL_FRAMEBUFFER 0x8D40 +#define GL_RENDERBUFFER 0x8D41 +#define GL_RENDERBUFFER_WIDTH 0x8D42 +#define GL_RENDERBUFFER_HEIGHT 0x8D43 +#define GL_RENDERBUFFER_INTERNAL_FORMAT 0x8D44 +#define GL_STENCIL_INDEX1 0x8D46 +#define GL_STENCIL_INDEX4 0x8D47 +#define GL_STENCIL_INDEX8 0x8D48 +#define GL_STENCIL_INDEX16 0x8D49 +#define GL_RENDERBUFFER_RED_SIZE 0x8D50 +#define GL_RENDERBUFFER_GREEN_SIZE 0x8D51 +#define GL_RENDERBUFFER_BLUE_SIZE 0x8D52 +#define GL_RENDERBUFFER_ALPHA_SIZE 0x8D53 +#define GL_RENDERBUFFER_DEPTH_SIZE 0x8D54 +#define GL_RENDERBUFFER_STENCIL_SIZE 0x8D55 +#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE 0x8D56 +#define GL_MAX_SAMPLES 0x8D57 + +typedef void (GLAPIENTRY * PFNGLBINDFRAMEBUFFERPROC) (GLenum target, GLuint framebuffer); +typedef void (GLAPIENTRY * PFNGLBINDRENDERBUFFERPROC) (GLenum target, GLuint renderbuffer); +typedef void (GLAPIENTRY * PFNGLBLITFRAMEBUFFERPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); +typedef GLenum (GLAPIENTRY * PFNGLCHECKFRAMEBUFFERSTATUSPROC) (GLenum target); +typedef void (GLAPIENTRY * PFNGLDELETEFRAMEBUFFERSPROC) (GLsizei n, const GLuint* framebuffers); +typedef void (GLAPIENTRY * PFNGLDELETERENDERBUFFERSPROC) (GLsizei n, const GLuint* renderbuffers); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERRENDERBUFFERPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURE1DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURE2DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURE3DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint layer); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURELAYERPROC) (GLenum target,GLenum attachment, GLuint texture,GLint level,GLint layer); +typedef void (GLAPIENTRY * PFNGLGENFRAMEBUFFERSPROC) (GLsizei n, GLuint* framebuffers); +typedef void (GLAPIENTRY * PFNGLGENRENDERBUFFERSPROC) (GLsizei n, GLuint* renderbuffers); +typedef void (GLAPIENTRY * PFNGLGENERATEMIPMAPPROC) (GLenum target); +typedef void (GLAPIENTRY * PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC) (GLenum target, GLenum attachment, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETRENDERBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint* params); +typedef GLboolean (GLAPIENTRY * PFNGLISFRAMEBUFFERPROC) (GLuint framebuffer); +typedef GLboolean (GLAPIENTRY * PFNGLISRENDERBUFFERPROC) (GLuint renderbuffer); +typedef void (GLAPIENTRY * PFNGLRENDERBUFFERSTORAGEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); + +#define glBindFramebuffer GLEW_GET_FUN(__glewBindFramebuffer) +#define glBindRenderbuffer GLEW_GET_FUN(__glewBindRenderbuffer) +#define glBlitFramebuffer GLEW_GET_FUN(__glewBlitFramebuffer) +#define glCheckFramebufferStatus GLEW_GET_FUN(__glewCheckFramebufferStatus) +#define glDeleteFramebuffers GLEW_GET_FUN(__glewDeleteFramebuffers) +#define glDeleteRenderbuffers GLEW_GET_FUN(__glewDeleteRenderbuffers) +#define glFramebufferRenderbuffer GLEW_GET_FUN(__glewFramebufferRenderbuffer) +#define glFramebufferTexture1D GLEW_GET_FUN(__glewFramebufferTexture1D) +#define glFramebufferTexture2D GLEW_GET_FUN(__glewFramebufferTexture2D) +#define glFramebufferTexture3D GLEW_GET_FUN(__glewFramebufferTexture3D) +#define glFramebufferTextureLayer GLEW_GET_FUN(__glewFramebufferTextureLayer) +#define glGenFramebuffers GLEW_GET_FUN(__glewGenFramebuffers) +#define glGenRenderbuffers GLEW_GET_FUN(__glewGenRenderbuffers) +#define glGenerateMipmap GLEW_GET_FUN(__glewGenerateMipmap) +#define glGetFramebufferAttachmentParameteriv GLEW_GET_FUN(__glewGetFramebufferAttachmentParameteriv) +#define glGetRenderbufferParameteriv GLEW_GET_FUN(__glewGetRenderbufferParameteriv) +#define glIsFramebuffer GLEW_GET_FUN(__glewIsFramebuffer) +#define glIsRenderbuffer GLEW_GET_FUN(__glewIsRenderbuffer) +#define glRenderbufferStorage GLEW_GET_FUN(__glewRenderbufferStorage) +#define glRenderbufferStorageMultisample GLEW_GET_FUN(__glewRenderbufferStorageMultisample) + +#define GLEW_ARB_framebuffer_object GLEW_GET_VAR(__GLEW_ARB_framebuffer_object) + +#endif /* GL_ARB_framebuffer_object */ + +/* ------------------------ GL_ARB_framebuffer_sRGB ------------------------ */ + +#ifndef GL_ARB_framebuffer_sRGB +#define GL_ARB_framebuffer_sRGB 1 + +#define GL_FRAMEBUFFER_SRGB 0x8DB9 + +#define GLEW_ARB_framebuffer_sRGB GLEW_GET_VAR(__GLEW_ARB_framebuffer_sRGB) + +#endif /* GL_ARB_framebuffer_sRGB */ + +/* ------------------------ GL_ARB_geometry_shader4 ------------------------ */ + +#ifndef GL_ARB_geometry_shader4 +#define GL_ARB_geometry_shader4 1 + +#define GL_LINES_ADJACENCY_ARB 0xA +#define GL_LINE_STRIP_ADJACENCY_ARB 0xB +#define GL_TRIANGLES_ADJACENCY_ARB 0xC +#define GL_TRIANGLE_STRIP_ADJACENCY_ARB 0xD +#define GL_PROGRAM_POINT_SIZE_ARB 0x8642 +#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_ARB 0x8C29 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER 0x8CD4 +#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED_ARB 0x8DA7 +#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_ARB 0x8DA8 +#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_ARB 0x8DA9 +#define GL_GEOMETRY_SHADER_ARB 0x8DD9 +#define GL_GEOMETRY_VERTICES_OUT_ARB 0x8DDA +#define GL_GEOMETRY_INPUT_TYPE_ARB 0x8DDB +#define GL_GEOMETRY_OUTPUT_TYPE_ARB 0x8DDC +#define GL_MAX_GEOMETRY_VARYING_COMPONENTS_ARB 0x8DDD +#define GL_MAX_VERTEX_VARYING_COMPONENTS_ARB 0x8DDE +#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_ARB 0x8DDF +#define GL_MAX_GEOMETRY_OUTPUT_VERTICES_ARB 0x8DE0 +#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_ARB 0x8DE1 + +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTUREARBPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTUREFACEARBPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURELAYERARBPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); +typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETERIARBPROC) (GLuint program, GLenum pname, GLint value); + +#define glFramebufferTextureARB GLEW_GET_FUN(__glewFramebufferTextureARB) +#define glFramebufferTextureFaceARB GLEW_GET_FUN(__glewFramebufferTextureFaceARB) +#define glFramebufferTextureLayerARB GLEW_GET_FUN(__glewFramebufferTextureLayerARB) +#define glProgramParameteriARB GLEW_GET_FUN(__glewProgramParameteriARB) + +#define GLEW_ARB_geometry_shader4 GLEW_GET_VAR(__GLEW_ARB_geometry_shader4) + +#endif /* GL_ARB_geometry_shader4 */ + +/* ----------------------- GL_ARB_get_program_binary ----------------------- */ + +#ifndef GL_ARB_get_program_binary +#define GL_ARB_get_program_binary 1 + +#define GL_PROGRAM_BINARY_RETRIEVABLE_HINT 0x8257 +#define GL_PROGRAM_BINARY_LENGTH 0x8741 +#define GL_NUM_PROGRAM_BINARY_FORMATS 0x87FE +#define GL_PROGRAM_BINARY_FORMATS 0x87FF + +typedef void (GLAPIENTRY * PFNGLGETPROGRAMBINARYPROC) (GLuint program, GLsizei bufSize, GLsizei* length, GLenum *binaryFormat, GLvoid*binary); +typedef void (GLAPIENTRY * PFNGLPROGRAMBINARYPROC) (GLuint program, GLenum binaryFormat, const GLvoid *binary, GLsizei length); +typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETERIPROC) (GLuint program, GLenum pname, GLint value); + +#define glGetProgramBinary GLEW_GET_FUN(__glewGetProgramBinary) +#define glProgramBinary GLEW_GET_FUN(__glewProgramBinary) +#define glProgramParameteri GLEW_GET_FUN(__glewProgramParameteri) + +#define GLEW_ARB_get_program_binary GLEW_GET_VAR(__GLEW_ARB_get_program_binary) + +#endif /* GL_ARB_get_program_binary */ + +/* --------------------------- GL_ARB_gpu_shader5 -------------------------- */ + +#ifndef GL_ARB_gpu_shader5 +#define GL_ARB_gpu_shader5 1 + +#define GL_GEOMETRY_SHADER_INVOCATIONS 0x887F +#define GL_MAX_GEOMETRY_SHADER_INVOCATIONS 0x8E5A +#define GL_MIN_FRAGMENT_INTERPOLATION_OFFSET 0x8E5B +#define GL_MAX_FRAGMENT_INTERPOLATION_OFFSET 0x8E5C +#define GL_FRAGMENT_INTERPOLATION_OFFSET_BITS 0x8E5D +#define GL_MAX_VERTEX_STREAMS 0x8E71 + +#define GLEW_ARB_gpu_shader5 GLEW_GET_VAR(__GLEW_ARB_gpu_shader5) + +#endif /* GL_ARB_gpu_shader5 */ + +/* ------------------------- GL_ARB_gpu_shader_fp64 ------------------------ */ + +#ifndef GL_ARB_gpu_shader_fp64 +#define GL_ARB_gpu_shader_fp64 1 + +#define GL_DOUBLE_MAT2 0x8F46 +#define GL_DOUBLE_MAT3 0x8F47 +#define GL_DOUBLE_MAT4 0x8F48 +#define GL_DOUBLE_MAT2x3 0x8F49 +#define GL_DOUBLE_MAT2x4 0x8F4A +#define GL_DOUBLE_MAT3x2 0x8F4B +#define GL_DOUBLE_MAT3x4 0x8F4C +#define GL_DOUBLE_MAT4x2 0x8F4D +#define GL_DOUBLE_MAT4x3 0x8F4E +#define GL_DOUBLE_VEC2 0x8FFC +#define GL_DOUBLE_VEC3 0x8FFD +#define GL_DOUBLE_VEC4 0x8FFE + +typedef void (GLAPIENTRY * PFNGLGETUNIFORMDVPROC) (GLuint program, GLint location, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLUNIFORM1DPROC) (GLint location, GLdouble x); +typedef void (GLAPIENTRY * PFNGLUNIFORM1DVPROC) (GLint location, GLsizei count, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM2DPROC) (GLint location, GLdouble x, GLdouble y); +typedef void (GLAPIENTRY * PFNGLUNIFORM2DVPROC) (GLint location, GLsizei count, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM3DPROC) (GLint location, GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLUNIFORM3DVPROC) (GLint location, GLsizei count, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM4DPROC) (GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (GLAPIENTRY * PFNGLUNIFORM4DVPROC) (GLint location, GLsizei count, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX2DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX2X3DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX2X4DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX3DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX3X2DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX3X4DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4X2DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4X3DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); + +#define glGetUniformdv GLEW_GET_FUN(__glewGetUniformdv) +#define glUniform1d GLEW_GET_FUN(__glewUniform1d) +#define glUniform1dv GLEW_GET_FUN(__glewUniform1dv) +#define glUniform2d GLEW_GET_FUN(__glewUniform2d) +#define glUniform2dv GLEW_GET_FUN(__glewUniform2dv) +#define glUniform3d GLEW_GET_FUN(__glewUniform3d) +#define glUniform3dv GLEW_GET_FUN(__glewUniform3dv) +#define glUniform4d GLEW_GET_FUN(__glewUniform4d) +#define glUniform4dv GLEW_GET_FUN(__glewUniform4dv) +#define glUniformMatrix2dv GLEW_GET_FUN(__glewUniformMatrix2dv) +#define glUniformMatrix2x3dv GLEW_GET_FUN(__glewUniformMatrix2x3dv) +#define glUniformMatrix2x4dv GLEW_GET_FUN(__glewUniformMatrix2x4dv) +#define glUniformMatrix3dv GLEW_GET_FUN(__glewUniformMatrix3dv) +#define glUniformMatrix3x2dv GLEW_GET_FUN(__glewUniformMatrix3x2dv) +#define glUniformMatrix3x4dv GLEW_GET_FUN(__glewUniformMatrix3x4dv) +#define glUniformMatrix4dv GLEW_GET_FUN(__glewUniformMatrix4dv) +#define glUniformMatrix4x2dv GLEW_GET_FUN(__glewUniformMatrix4x2dv) +#define glUniformMatrix4x3dv GLEW_GET_FUN(__glewUniformMatrix4x3dv) + +#define GLEW_ARB_gpu_shader_fp64 GLEW_GET_VAR(__GLEW_ARB_gpu_shader_fp64) + +#endif /* GL_ARB_gpu_shader_fp64 */ + +/* ------------------------ GL_ARB_half_float_pixel ------------------------ */ + +#ifndef GL_ARB_half_float_pixel +#define GL_ARB_half_float_pixel 1 + +#define GL_HALF_FLOAT_ARB 0x140B + +#define GLEW_ARB_half_float_pixel GLEW_GET_VAR(__GLEW_ARB_half_float_pixel) + +#endif /* GL_ARB_half_float_pixel */ + +/* ------------------------ GL_ARB_half_float_vertex ----------------------- */ + +#ifndef GL_ARB_half_float_vertex +#define GL_ARB_half_float_vertex 1 + +#define GL_HALF_FLOAT 0x140B + +#define GLEW_ARB_half_float_vertex GLEW_GET_VAR(__GLEW_ARB_half_float_vertex) + +#endif /* GL_ARB_half_float_vertex */ + +/* ----------------------------- GL_ARB_imaging ---------------------------- */ + +#ifndef GL_ARB_imaging +#define GL_ARB_imaging 1 + +#define GL_CONSTANT_COLOR 0x8001 +#define GL_ONE_MINUS_CONSTANT_COLOR 0x8002 +#define GL_CONSTANT_ALPHA 0x8003 +#define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004 +#define GL_BLEND_COLOR 0x8005 +#define GL_FUNC_ADD 0x8006 +#define GL_MIN 0x8007 +#define GL_MAX 0x8008 +#define GL_BLEND_EQUATION 0x8009 +#define GL_FUNC_SUBTRACT 0x800A +#define GL_FUNC_REVERSE_SUBTRACT 0x800B +#define GL_CONVOLUTION_1D 0x8010 +#define GL_CONVOLUTION_2D 0x8011 +#define GL_SEPARABLE_2D 0x8012 +#define GL_CONVOLUTION_BORDER_MODE 0x8013 +#define GL_CONVOLUTION_FILTER_SCALE 0x8014 +#define GL_CONVOLUTION_FILTER_BIAS 0x8015 +#define GL_REDUCE 0x8016 +#define GL_CONVOLUTION_FORMAT 0x8017 +#define GL_CONVOLUTION_WIDTH 0x8018 +#define GL_CONVOLUTION_HEIGHT 0x8019 +#define GL_MAX_CONVOLUTION_WIDTH 0x801A +#define GL_MAX_CONVOLUTION_HEIGHT 0x801B +#define GL_POST_CONVOLUTION_RED_SCALE 0x801C +#define GL_POST_CONVOLUTION_GREEN_SCALE 0x801D +#define GL_POST_CONVOLUTION_BLUE_SCALE 0x801E +#define GL_POST_CONVOLUTION_ALPHA_SCALE 0x801F +#define GL_POST_CONVOLUTION_RED_BIAS 0x8020 +#define GL_POST_CONVOLUTION_GREEN_BIAS 0x8021 +#define GL_POST_CONVOLUTION_BLUE_BIAS 0x8022 +#define GL_POST_CONVOLUTION_ALPHA_BIAS 0x8023 +#define GL_HISTOGRAM 0x8024 +#define GL_PROXY_HISTOGRAM 0x8025 +#define GL_HISTOGRAM_WIDTH 0x8026 +#define GL_HISTOGRAM_FORMAT 0x8027 +#define GL_HISTOGRAM_RED_SIZE 0x8028 +#define GL_HISTOGRAM_GREEN_SIZE 0x8029 +#define GL_HISTOGRAM_BLUE_SIZE 0x802A +#define GL_HISTOGRAM_ALPHA_SIZE 0x802B +#define GL_HISTOGRAM_LUMINANCE_SIZE 0x802C +#define GL_HISTOGRAM_SINK 0x802D +#define GL_MINMAX 0x802E +#define GL_MINMAX_FORMAT 0x802F +#define GL_MINMAX_SINK 0x8030 +#define GL_TABLE_TOO_LARGE 0x8031 +#define GL_COLOR_MATRIX 0x80B1 +#define GL_COLOR_MATRIX_STACK_DEPTH 0x80B2 +#define GL_MAX_COLOR_MATRIX_STACK_DEPTH 0x80B3 +#define GL_POST_COLOR_MATRIX_RED_SCALE 0x80B4 +#define GL_POST_COLOR_MATRIX_GREEN_SCALE 0x80B5 +#define GL_POST_COLOR_MATRIX_BLUE_SCALE 0x80B6 +#define GL_POST_COLOR_MATRIX_ALPHA_SCALE 0x80B7 +#define GL_POST_COLOR_MATRIX_RED_BIAS 0x80B8 +#define GL_POST_COLOR_MATRIX_GREEN_BIAS 0x80B9 +#define GL_POST_COLOR_MATRIX_BLUE_BIAS 0x80BA +#define GL_POST_COLOR_MATRIX_ALPHA_BIAS 0x80BB +#define GL_COLOR_TABLE 0x80D0 +#define GL_POST_CONVOLUTION_COLOR_TABLE 0x80D1 +#define GL_POST_COLOR_MATRIX_COLOR_TABLE 0x80D2 +#define GL_PROXY_COLOR_TABLE 0x80D3 +#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE 0x80D4 +#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE 0x80D5 +#define GL_COLOR_TABLE_SCALE 0x80D6 +#define GL_COLOR_TABLE_BIAS 0x80D7 +#define GL_COLOR_TABLE_FORMAT 0x80D8 +#define GL_COLOR_TABLE_WIDTH 0x80D9 +#define GL_COLOR_TABLE_RED_SIZE 0x80DA +#define GL_COLOR_TABLE_GREEN_SIZE 0x80DB +#define GL_COLOR_TABLE_BLUE_SIZE 0x80DC +#define GL_COLOR_TABLE_ALPHA_SIZE 0x80DD +#define GL_COLOR_TABLE_LUMINANCE_SIZE 0x80DE +#define GL_COLOR_TABLE_INTENSITY_SIZE 0x80DF +#define GL_IGNORE_BORDER 0x8150 +#define GL_CONSTANT_BORDER 0x8151 +#define GL_WRAP_BORDER 0x8152 +#define GL_REPLICATE_BORDER 0x8153 +#define GL_CONVOLUTION_BORDER_COLOR 0x8154 + +typedef void (GLAPIENTRY * PFNGLCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table); +typedef void (GLAPIENTRY * PFNGLCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params); +typedef void (GLAPIENTRY * PFNGLCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (GLAPIENTRY * PFNGLCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image); +typedef void (GLAPIENTRY * PFNGLCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image); +typedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERFPROC) (GLenum target, GLenum pname, GLfloat params); +typedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params); +typedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERIPROC) (GLenum target, GLenum pname, GLint params); +typedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (GLAPIENTRY * PFNGLCOPYCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); +typedef void (GLAPIENTRY * PFNGLCOPYCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +typedef void (GLAPIENTRY * PFNGLCOPYCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +typedef void (GLAPIENTRY * PFNGLCOPYCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEPROC) (GLenum target, GLenum format, GLenum type, GLvoid *table); +typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (GLAPIENTRY * PFNGLGETCONVOLUTIONFILTERPROC) (GLenum target, GLenum format, GLenum type, GLvoid *image); +typedef void (GLAPIENTRY * PFNGLGETCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (GLAPIENTRY * PFNGLGETCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (GLAPIENTRY * PFNGLGETHISTOGRAMPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); +typedef void (GLAPIENTRY * PFNGLGETHISTOGRAMPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (GLAPIENTRY * PFNGLGETHISTOGRAMPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (GLAPIENTRY * PFNGLGETMINMAXPROC) (GLenum target, GLboolean reset, GLenum format, GLenum types, GLvoid *values); +typedef void (GLAPIENTRY * PFNGLGETMINMAXPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (GLAPIENTRY * PFNGLGETMINMAXPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (GLAPIENTRY * PFNGLGETSEPARABLEFILTERPROC) (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span); +typedef void (GLAPIENTRY * PFNGLHISTOGRAMPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); +typedef void (GLAPIENTRY * PFNGLMINMAXPROC) (GLenum target, GLenum internalformat, GLboolean sink); +typedef void (GLAPIENTRY * PFNGLRESETHISTOGRAMPROC) (GLenum target); +typedef void (GLAPIENTRY * PFNGLRESETMINMAXPROC) (GLenum target); +typedef void (GLAPIENTRY * PFNGLSEPARABLEFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column); + +#define glColorSubTable GLEW_GET_FUN(__glewColorSubTable) +#define glColorTable GLEW_GET_FUN(__glewColorTable) +#define glColorTableParameterfv GLEW_GET_FUN(__glewColorTableParameterfv) +#define glColorTableParameteriv GLEW_GET_FUN(__glewColorTableParameteriv) +#define glConvolutionFilter1D GLEW_GET_FUN(__glewConvolutionFilter1D) +#define glConvolutionFilter2D GLEW_GET_FUN(__glewConvolutionFilter2D) +#define glConvolutionParameterf GLEW_GET_FUN(__glewConvolutionParameterf) +#define glConvolutionParameterfv GLEW_GET_FUN(__glewConvolutionParameterfv) +#define glConvolutionParameteri GLEW_GET_FUN(__glewConvolutionParameteri) +#define glConvolutionParameteriv GLEW_GET_FUN(__glewConvolutionParameteriv) +#define glCopyColorSubTable GLEW_GET_FUN(__glewCopyColorSubTable) +#define glCopyColorTable GLEW_GET_FUN(__glewCopyColorTable) +#define glCopyConvolutionFilter1D GLEW_GET_FUN(__glewCopyConvolutionFilter1D) +#define glCopyConvolutionFilter2D GLEW_GET_FUN(__glewCopyConvolutionFilter2D) +#define glGetColorTable GLEW_GET_FUN(__glewGetColorTable) +#define glGetColorTableParameterfv GLEW_GET_FUN(__glewGetColorTableParameterfv) +#define glGetColorTableParameteriv GLEW_GET_FUN(__glewGetColorTableParameteriv) +#define glGetConvolutionFilter GLEW_GET_FUN(__glewGetConvolutionFilter) +#define glGetConvolutionParameterfv GLEW_GET_FUN(__glewGetConvolutionParameterfv) +#define glGetConvolutionParameteriv GLEW_GET_FUN(__glewGetConvolutionParameteriv) +#define glGetHistogram GLEW_GET_FUN(__glewGetHistogram) +#define glGetHistogramParameterfv GLEW_GET_FUN(__glewGetHistogramParameterfv) +#define glGetHistogramParameteriv GLEW_GET_FUN(__glewGetHistogramParameteriv) +#define glGetMinmax GLEW_GET_FUN(__glewGetMinmax) +#define glGetMinmaxParameterfv GLEW_GET_FUN(__glewGetMinmaxParameterfv) +#define glGetMinmaxParameteriv GLEW_GET_FUN(__glewGetMinmaxParameteriv) +#define glGetSeparableFilter GLEW_GET_FUN(__glewGetSeparableFilter) +#define glHistogram GLEW_GET_FUN(__glewHistogram) +#define glMinmax GLEW_GET_FUN(__glewMinmax) +#define glResetHistogram GLEW_GET_FUN(__glewResetHistogram) +#define glResetMinmax GLEW_GET_FUN(__glewResetMinmax) +#define glSeparableFilter2D GLEW_GET_FUN(__glewSeparableFilter2D) + +#define GLEW_ARB_imaging GLEW_GET_VAR(__GLEW_ARB_imaging) + +#endif /* GL_ARB_imaging */ + +/* ----------------------- GL_ARB_indirect_parameters ---------------------- */ + +#ifndef GL_ARB_indirect_parameters +#define GL_ARB_indirect_parameters 1 + +#define GL_PARAMETER_BUFFER_ARB 0x80EE +#define GL_PARAMETER_BUFFER_BINDING_ARB 0x80EF + +typedef void (GLAPIENTRY * PFNGLMULTIDRAWARRAYSINDIRECTCOUNTARBPROC) (GLenum mode, const GLvoid *indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSINDIRECTCOUNTARBPROC) (GLenum mode, GLenum type, const GLvoid *indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride); + +#define glMultiDrawArraysIndirectCountARB GLEW_GET_FUN(__glewMultiDrawArraysIndirectCountARB) +#define glMultiDrawElementsIndirectCountARB GLEW_GET_FUN(__glewMultiDrawElementsIndirectCountARB) + +#define GLEW_ARB_indirect_parameters GLEW_GET_VAR(__GLEW_ARB_indirect_parameters) + +#endif /* GL_ARB_indirect_parameters */ + +/* ------------------------ GL_ARB_instanced_arrays ------------------------ */ + +#ifndef GL_ARB_instanced_arrays +#define GL_ARB_instanced_arrays 1 + +#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR_ARB 0x88FE + +typedef void (GLAPIENTRY * PFNGLDRAWARRAYSINSTANCEDARBPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount); +typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDARBPROC) (GLenum mode, GLsizei count, GLenum type, const void* indices, GLsizei primcount); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBDIVISORARBPROC) (GLuint index, GLuint divisor); + +#define glDrawArraysInstancedARB GLEW_GET_FUN(__glewDrawArraysInstancedARB) +#define glDrawElementsInstancedARB GLEW_GET_FUN(__glewDrawElementsInstancedARB) +#define glVertexAttribDivisorARB GLEW_GET_FUN(__glewVertexAttribDivisorARB) + +#define GLEW_ARB_instanced_arrays GLEW_GET_VAR(__GLEW_ARB_instanced_arrays) + +#endif /* GL_ARB_instanced_arrays */ + +/* ---------------------- GL_ARB_internalformat_query ---------------------- */ + +#ifndef GL_ARB_internalformat_query +#define GL_ARB_internalformat_query 1 + +#define GL_NUM_SAMPLE_COUNTS 0x9380 + +typedef void (GLAPIENTRY * PFNGLGETINTERNALFORMATIVPROC) (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint* params); + +#define glGetInternalformativ GLEW_GET_FUN(__glewGetInternalformativ) + +#define GLEW_ARB_internalformat_query GLEW_GET_VAR(__GLEW_ARB_internalformat_query) + +#endif /* GL_ARB_internalformat_query */ + +/* ---------------------- GL_ARB_internalformat_query2 --------------------- */ + +#ifndef GL_ARB_internalformat_query2 +#define GL_ARB_internalformat_query2 1 + +#define GL_INTERNALFORMAT_SUPPORTED 0x826F +#define GL_INTERNALFORMAT_PREFERRED 0x8270 +#define GL_INTERNALFORMAT_RED_SIZE 0x8271 +#define GL_INTERNALFORMAT_GREEN_SIZE 0x8272 +#define GL_INTERNALFORMAT_BLUE_SIZE 0x8273 +#define GL_INTERNALFORMAT_ALPHA_SIZE 0x8274 +#define GL_INTERNALFORMAT_DEPTH_SIZE 0x8275 +#define GL_INTERNALFORMAT_STENCIL_SIZE 0x8276 +#define GL_INTERNALFORMAT_SHARED_SIZE 0x8277 +#define GL_INTERNALFORMAT_RED_TYPE 0x8278 +#define GL_INTERNALFORMAT_GREEN_TYPE 0x8279 +#define GL_INTERNALFORMAT_BLUE_TYPE 0x827A +#define GL_INTERNALFORMAT_ALPHA_TYPE 0x827B +#define GL_INTERNALFORMAT_DEPTH_TYPE 0x827C +#define GL_INTERNALFORMAT_STENCIL_TYPE 0x827D +#define GL_MAX_WIDTH 0x827E +#define GL_MAX_HEIGHT 0x827F +#define GL_MAX_DEPTH 0x8280 +#define GL_MAX_LAYERS 0x8281 +#define GL_MAX_COMBINED_DIMENSIONS 0x8282 +#define GL_COLOR_COMPONENTS 0x8283 +#define GL_DEPTH_COMPONENTS 0x8284 +#define GL_STENCIL_COMPONENTS 0x8285 +#define GL_COLOR_RENDERABLE 0x8286 +#define GL_DEPTH_RENDERABLE 0x8287 +#define GL_STENCIL_RENDERABLE 0x8288 +#define GL_FRAMEBUFFER_RENDERABLE 0x8289 +#define GL_FRAMEBUFFER_RENDERABLE_LAYERED 0x828A +#define GL_FRAMEBUFFER_BLEND 0x828B +#define GL_READ_PIXELS 0x828C +#define GL_READ_PIXELS_FORMAT 0x828D +#define GL_READ_PIXELS_TYPE 0x828E +#define GL_TEXTURE_IMAGE_FORMAT 0x828F +#define GL_TEXTURE_IMAGE_TYPE 0x8290 +#define GL_GET_TEXTURE_IMAGE_FORMAT 0x8291 +#define GL_GET_TEXTURE_IMAGE_TYPE 0x8292 +#define GL_MIPMAP 0x8293 +#define GL_MANUAL_GENERATE_MIPMAP 0x8294 +#define GL_AUTO_GENERATE_MIPMAP 0x8295 +#define GL_COLOR_ENCODING 0x8296 +#define GL_SRGB_READ 0x8297 +#define GL_SRGB_WRITE 0x8298 +#define GL_SRGB_DECODE_ARB 0x8299 +#define GL_FILTER 0x829A +#define GL_VERTEX_TEXTURE 0x829B +#define GL_TESS_CONTROL_TEXTURE 0x829C +#define GL_TESS_EVALUATION_TEXTURE 0x829D +#define GL_GEOMETRY_TEXTURE 0x829E +#define GL_FRAGMENT_TEXTURE 0x829F +#define GL_COMPUTE_TEXTURE 0x82A0 +#define GL_TEXTURE_SHADOW 0x82A1 +#define GL_TEXTURE_GATHER 0x82A2 +#define GL_TEXTURE_GATHER_SHADOW 0x82A3 +#define GL_SHADER_IMAGE_LOAD 0x82A4 +#define GL_SHADER_IMAGE_STORE 0x82A5 +#define GL_SHADER_IMAGE_ATOMIC 0x82A6 +#define GL_IMAGE_TEXEL_SIZE 0x82A7 +#define GL_IMAGE_COMPATIBILITY_CLASS 0x82A8 +#define GL_IMAGE_PIXEL_FORMAT 0x82A9 +#define GL_IMAGE_PIXEL_TYPE 0x82AA +#define GL_SIMULTANEOUS_TEXTURE_AND_DEPTH_TEST 0x82AC +#define GL_SIMULTANEOUS_TEXTURE_AND_STENCIL_TEST 0x82AD +#define GL_SIMULTANEOUS_TEXTURE_AND_DEPTH_WRITE 0x82AE +#define GL_SIMULTANEOUS_TEXTURE_AND_STENCIL_WRITE 0x82AF +#define GL_TEXTURE_COMPRESSED_BLOCK_WIDTH 0x82B1 +#define GL_TEXTURE_COMPRESSED_BLOCK_HEIGHT 0x82B2 +#define GL_TEXTURE_COMPRESSED_BLOCK_SIZE 0x82B3 +#define GL_CLEAR_BUFFER 0x82B4 +#define GL_TEXTURE_VIEW 0x82B5 +#define GL_VIEW_COMPATIBILITY_CLASS 0x82B6 +#define GL_FULL_SUPPORT 0x82B7 +#define GL_CAVEAT_SUPPORT 0x82B8 +#define GL_IMAGE_CLASS_4_X_32 0x82B9 +#define GL_IMAGE_CLASS_2_X_32 0x82BA +#define GL_IMAGE_CLASS_1_X_32 0x82BB +#define GL_IMAGE_CLASS_4_X_16 0x82BC +#define GL_IMAGE_CLASS_2_X_16 0x82BD +#define GL_IMAGE_CLASS_1_X_16 0x82BE +#define GL_IMAGE_CLASS_4_X_8 0x82BF +#define GL_IMAGE_CLASS_2_X_8 0x82C0 +#define GL_IMAGE_CLASS_1_X_8 0x82C1 +#define GL_IMAGE_CLASS_11_11_10 0x82C2 +#define GL_IMAGE_CLASS_10_10_10_2 0x82C3 +#define GL_VIEW_CLASS_128_BITS 0x82C4 +#define GL_VIEW_CLASS_96_BITS 0x82C5 +#define GL_VIEW_CLASS_64_BITS 0x82C6 +#define GL_VIEW_CLASS_48_BITS 0x82C7 +#define GL_VIEW_CLASS_32_BITS 0x82C8 +#define GL_VIEW_CLASS_24_BITS 0x82C9 +#define GL_VIEW_CLASS_16_BITS 0x82CA +#define GL_VIEW_CLASS_8_BITS 0x82CB +#define GL_VIEW_CLASS_S3TC_DXT1_RGB 0x82CC +#define GL_VIEW_CLASS_S3TC_DXT1_RGBA 0x82CD +#define GL_VIEW_CLASS_S3TC_DXT3_RGBA 0x82CE +#define GL_VIEW_CLASS_S3TC_DXT5_RGBA 0x82CF +#define GL_VIEW_CLASS_RGTC1_RED 0x82D0 +#define GL_VIEW_CLASS_RGTC2_RG 0x82D1 +#define GL_VIEW_CLASS_BPTC_UNORM 0x82D2 +#define GL_VIEW_CLASS_BPTC_FLOAT 0x82D3 + +typedef void (GLAPIENTRY * PFNGLGETINTERNALFORMATI64VPROC) (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint64* params); + +#define glGetInternalformati64v GLEW_GET_FUN(__glewGetInternalformati64v) + +#define GLEW_ARB_internalformat_query2 GLEW_GET_VAR(__GLEW_ARB_internalformat_query2) + +#endif /* GL_ARB_internalformat_query2 */ + +/* ----------------------- GL_ARB_invalidate_subdata ----------------------- */ + +#ifndef GL_ARB_invalidate_subdata +#define GL_ARB_invalidate_subdata 1 + +typedef void (GLAPIENTRY * PFNGLINVALIDATEBUFFERDATAPROC) (GLuint buffer); +typedef void (GLAPIENTRY * PFNGLINVALIDATEBUFFERSUBDATAPROC) (GLuint buffer, GLintptr offset, GLsizeiptr length); +typedef void (GLAPIENTRY * PFNGLINVALIDATEFRAMEBUFFERPROC) (GLenum target, GLsizei numAttachments, const GLenum* attachments); +typedef void (GLAPIENTRY * PFNGLINVALIDATESUBFRAMEBUFFERPROC) (GLenum target, GLsizei numAttachments, const GLenum* attachments, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLINVALIDATETEXIMAGEPROC) (GLuint texture, GLint level); +typedef void (GLAPIENTRY * PFNGLINVALIDATETEXSUBIMAGEPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth); + +#define glInvalidateBufferData GLEW_GET_FUN(__glewInvalidateBufferData) +#define glInvalidateBufferSubData GLEW_GET_FUN(__glewInvalidateBufferSubData) +#define glInvalidateFramebuffer GLEW_GET_FUN(__glewInvalidateFramebuffer) +#define glInvalidateSubFramebuffer GLEW_GET_FUN(__glewInvalidateSubFramebuffer) +#define glInvalidateTexImage GLEW_GET_FUN(__glewInvalidateTexImage) +#define glInvalidateTexSubImage GLEW_GET_FUN(__glewInvalidateTexSubImage) + +#define GLEW_ARB_invalidate_subdata GLEW_GET_VAR(__GLEW_ARB_invalidate_subdata) + +#endif /* GL_ARB_invalidate_subdata */ + +/* ---------------------- GL_ARB_map_buffer_alignment ---------------------- */ + +#ifndef GL_ARB_map_buffer_alignment +#define GL_ARB_map_buffer_alignment 1 + +#define GL_MIN_MAP_BUFFER_ALIGNMENT 0x90BC + +#define GLEW_ARB_map_buffer_alignment GLEW_GET_VAR(__GLEW_ARB_map_buffer_alignment) + +#endif /* GL_ARB_map_buffer_alignment */ + +/* ------------------------ GL_ARB_map_buffer_range ------------------------ */ + +#ifndef GL_ARB_map_buffer_range +#define GL_ARB_map_buffer_range 1 + +#define GL_MAP_READ_BIT 0x0001 +#define GL_MAP_WRITE_BIT 0x0002 +#define GL_MAP_INVALIDATE_RANGE_BIT 0x0004 +#define GL_MAP_INVALIDATE_BUFFER_BIT 0x0008 +#define GL_MAP_FLUSH_EXPLICIT_BIT 0x0010 +#define GL_MAP_UNSYNCHRONIZED_BIT 0x0020 + +typedef void (GLAPIENTRY * PFNGLFLUSHMAPPEDBUFFERRANGEPROC) (GLenum target, GLintptr offset, GLsizeiptr length); +typedef GLvoid * (GLAPIENTRY * PFNGLMAPBUFFERRANGEPROC) (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access); + +#define glFlushMappedBufferRange GLEW_GET_FUN(__glewFlushMappedBufferRange) +#define glMapBufferRange GLEW_GET_FUN(__glewMapBufferRange) + +#define GLEW_ARB_map_buffer_range GLEW_GET_VAR(__GLEW_ARB_map_buffer_range) + +#endif /* GL_ARB_map_buffer_range */ + +/* ------------------------- GL_ARB_matrix_palette ------------------------- */ + +#ifndef GL_ARB_matrix_palette +#define GL_ARB_matrix_palette 1 + +#define GL_MATRIX_PALETTE_ARB 0x8840 +#define GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB 0x8841 +#define GL_MAX_PALETTE_MATRICES_ARB 0x8842 +#define GL_CURRENT_PALETTE_MATRIX_ARB 0x8843 +#define GL_MATRIX_INDEX_ARRAY_ARB 0x8844 +#define GL_CURRENT_MATRIX_INDEX_ARB 0x8845 +#define GL_MATRIX_INDEX_ARRAY_SIZE_ARB 0x8846 +#define GL_MATRIX_INDEX_ARRAY_TYPE_ARB 0x8847 +#define GL_MATRIX_INDEX_ARRAY_STRIDE_ARB 0x8848 +#define GL_MATRIX_INDEX_ARRAY_POINTER_ARB 0x8849 + +typedef void (GLAPIENTRY * PFNGLCURRENTPALETTEMATRIXARBPROC) (GLint index); +typedef void (GLAPIENTRY * PFNGLMATRIXINDEXPOINTERARBPROC) (GLint size, GLenum type, GLsizei stride, GLvoid *pointer); +typedef void (GLAPIENTRY * PFNGLMATRIXINDEXUBVARBPROC) (GLint size, GLubyte *indices); +typedef void (GLAPIENTRY * PFNGLMATRIXINDEXUIVARBPROC) (GLint size, GLuint *indices); +typedef void (GLAPIENTRY * PFNGLMATRIXINDEXUSVARBPROC) (GLint size, GLushort *indices); + +#define glCurrentPaletteMatrixARB GLEW_GET_FUN(__glewCurrentPaletteMatrixARB) +#define glMatrixIndexPointerARB GLEW_GET_FUN(__glewMatrixIndexPointerARB) +#define glMatrixIndexubvARB GLEW_GET_FUN(__glewMatrixIndexubvARB) +#define glMatrixIndexuivARB GLEW_GET_FUN(__glewMatrixIndexuivARB) +#define glMatrixIndexusvARB GLEW_GET_FUN(__glewMatrixIndexusvARB) + +#define GLEW_ARB_matrix_palette GLEW_GET_VAR(__GLEW_ARB_matrix_palette) + +#endif /* GL_ARB_matrix_palette */ + +/* --------------------------- GL_ARB_multi_bind --------------------------- */ + +#ifndef GL_ARB_multi_bind +#define GL_ARB_multi_bind 1 + +typedef void (GLAPIENTRY * PFNGLBINDBUFFERSBASEPROC) (GLenum target, GLuint first, GLsizei count, const GLuint* buffers); +typedef void (GLAPIENTRY * PFNGLBINDBUFFERSRANGEPROC) (GLenum target, GLuint first, GLsizei count, const GLuint* buffers, const GLintptr *offsets, const GLsizeiptr *sizes); +typedef void (GLAPIENTRY * PFNGLBINDIMAGETEXTURESPROC) (GLuint first, GLsizei count, const GLuint* textures); +typedef void (GLAPIENTRY * PFNGLBINDSAMPLERSPROC) (GLuint first, GLsizei count, const GLuint* samplers); +typedef void (GLAPIENTRY * PFNGLBINDTEXTURESPROC) (GLuint first, GLsizei count, const GLuint* textures); +typedef void (GLAPIENTRY * PFNGLBINDVERTEXBUFFERSPROC) (GLuint first, GLsizei count, const GLuint* buffers, const GLintptr *offsets, const GLsizei *strides); + +#define glBindBuffersBase GLEW_GET_FUN(__glewBindBuffersBase) +#define glBindBuffersRange GLEW_GET_FUN(__glewBindBuffersRange) +#define glBindImageTextures GLEW_GET_FUN(__glewBindImageTextures) +#define glBindSamplers GLEW_GET_FUN(__glewBindSamplers) +#define glBindTextures GLEW_GET_FUN(__glewBindTextures) +#define glBindVertexBuffers GLEW_GET_FUN(__glewBindVertexBuffers) + +#define GLEW_ARB_multi_bind GLEW_GET_VAR(__GLEW_ARB_multi_bind) + +#endif /* GL_ARB_multi_bind */ + +/* ----------------------- GL_ARB_multi_draw_indirect ---------------------- */ + +#ifndef GL_ARB_multi_draw_indirect +#define GL_ARB_multi_draw_indirect 1 + +typedef void (GLAPIENTRY * PFNGLMULTIDRAWARRAYSINDIRECTPROC) (GLenum mode, const GLvoid *indirect, GLsizei primcount, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSINDIRECTPROC) (GLenum mode, GLenum type, const GLvoid *indirect, GLsizei primcount, GLsizei stride); + +#define glMultiDrawArraysIndirect GLEW_GET_FUN(__glewMultiDrawArraysIndirect) +#define glMultiDrawElementsIndirect GLEW_GET_FUN(__glewMultiDrawElementsIndirect) + +#define GLEW_ARB_multi_draw_indirect GLEW_GET_VAR(__GLEW_ARB_multi_draw_indirect) + +#endif /* GL_ARB_multi_draw_indirect */ + +/* --------------------------- GL_ARB_multisample -------------------------- */ + +#ifndef GL_ARB_multisample +#define GL_ARB_multisample 1 + +#define GL_MULTISAMPLE_ARB 0x809D +#define GL_SAMPLE_ALPHA_TO_COVERAGE_ARB 0x809E +#define GL_SAMPLE_ALPHA_TO_ONE_ARB 0x809F +#define GL_SAMPLE_COVERAGE_ARB 0x80A0 +#define GL_SAMPLE_BUFFERS_ARB 0x80A8 +#define GL_SAMPLES_ARB 0x80A9 +#define GL_SAMPLE_COVERAGE_VALUE_ARB 0x80AA +#define GL_SAMPLE_COVERAGE_INVERT_ARB 0x80AB +#define GL_MULTISAMPLE_BIT_ARB 0x20000000 + +typedef void (GLAPIENTRY * PFNGLSAMPLECOVERAGEARBPROC) (GLclampf value, GLboolean invert); + +#define glSampleCoverageARB GLEW_GET_FUN(__glewSampleCoverageARB) + +#define GLEW_ARB_multisample GLEW_GET_VAR(__GLEW_ARB_multisample) + +#endif /* GL_ARB_multisample */ + +/* -------------------------- GL_ARB_multitexture -------------------------- */ + +#ifndef GL_ARB_multitexture +#define GL_ARB_multitexture 1 + +#define GL_TEXTURE0_ARB 0x84C0 +#define GL_TEXTURE1_ARB 0x84C1 +#define GL_TEXTURE2_ARB 0x84C2 +#define GL_TEXTURE3_ARB 0x84C3 +#define GL_TEXTURE4_ARB 0x84C4 +#define GL_TEXTURE5_ARB 0x84C5 +#define GL_TEXTURE6_ARB 0x84C6 +#define GL_TEXTURE7_ARB 0x84C7 +#define GL_TEXTURE8_ARB 0x84C8 +#define GL_TEXTURE9_ARB 0x84C9 +#define GL_TEXTURE10_ARB 0x84CA +#define GL_TEXTURE11_ARB 0x84CB +#define GL_TEXTURE12_ARB 0x84CC +#define GL_TEXTURE13_ARB 0x84CD +#define GL_TEXTURE14_ARB 0x84CE +#define GL_TEXTURE15_ARB 0x84CF +#define GL_TEXTURE16_ARB 0x84D0 +#define GL_TEXTURE17_ARB 0x84D1 +#define GL_TEXTURE18_ARB 0x84D2 +#define GL_TEXTURE19_ARB 0x84D3 +#define GL_TEXTURE20_ARB 0x84D4 +#define GL_TEXTURE21_ARB 0x84D5 +#define GL_TEXTURE22_ARB 0x84D6 +#define GL_TEXTURE23_ARB 0x84D7 +#define GL_TEXTURE24_ARB 0x84D8 +#define GL_TEXTURE25_ARB 0x84D9 +#define GL_TEXTURE26_ARB 0x84DA +#define GL_TEXTURE27_ARB 0x84DB +#define GL_TEXTURE28_ARB 0x84DC +#define GL_TEXTURE29_ARB 0x84DD +#define GL_TEXTURE30_ARB 0x84DE +#define GL_TEXTURE31_ARB 0x84DF +#define GL_ACTIVE_TEXTURE_ARB 0x84E0 +#define GL_CLIENT_ACTIVE_TEXTURE_ARB 0x84E1 +#define GL_MAX_TEXTURE_UNITS_ARB 0x84E2 + +typedef void (GLAPIENTRY * PFNGLACTIVETEXTUREARBPROC) (GLenum texture); +typedef void (GLAPIENTRY * PFNGLCLIENTACTIVETEXTUREARBPROC) (GLenum texture); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1DARBPROC) (GLenum target, GLdouble s); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1DVARBPROC) (GLenum target, const GLdouble *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1FARBPROC) (GLenum target, GLfloat s); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1FVARBPROC) (GLenum target, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1IARBPROC) (GLenum target, GLint s); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1IVARBPROC) (GLenum target, const GLint *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1SARBPROC) (GLenum target, GLshort s); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1SVARBPROC) (GLenum target, const GLshort *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2DARBPROC) (GLenum target, GLdouble s, GLdouble t); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2DVARBPROC) (GLenum target, const GLdouble *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2FARBPROC) (GLenum target, GLfloat s, GLfloat t); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2FVARBPROC) (GLenum target, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2IARBPROC) (GLenum target, GLint s, GLint t); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2IVARBPROC) (GLenum target, const GLint *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2SARBPROC) (GLenum target, GLshort s, GLshort t); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2SVARBPROC) (GLenum target, const GLshort *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3DVARBPROC) (GLenum target, const GLdouble *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3FVARBPROC) (GLenum target, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3IARBPROC) (GLenum target, GLint s, GLint t, GLint r); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3IVARBPROC) (GLenum target, const GLint *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3SVARBPROC) (GLenum target, const GLshort *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4DVARBPROC) (GLenum target, const GLdouble *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4FVARBPROC) (GLenum target, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4IARBPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4IVARBPROC) (GLenum target, const GLint *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4SVARBPROC) (GLenum target, const GLshort *v); + +#define glActiveTextureARB GLEW_GET_FUN(__glewActiveTextureARB) +#define glClientActiveTextureARB GLEW_GET_FUN(__glewClientActiveTextureARB) +#define glMultiTexCoord1dARB GLEW_GET_FUN(__glewMultiTexCoord1dARB) +#define glMultiTexCoord1dvARB GLEW_GET_FUN(__glewMultiTexCoord1dvARB) +#define glMultiTexCoord1fARB GLEW_GET_FUN(__glewMultiTexCoord1fARB) +#define glMultiTexCoord1fvARB GLEW_GET_FUN(__glewMultiTexCoord1fvARB) +#define glMultiTexCoord1iARB GLEW_GET_FUN(__glewMultiTexCoord1iARB) +#define glMultiTexCoord1ivARB GLEW_GET_FUN(__glewMultiTexCoord1ivARB) +#define glMultiTexCoord1sARB GLEW_GET_FUN(__glewMultiTexCoord1sARB) +#define glMultiTexCoord1svARB GLEW_GET_FUN(__glewMultiTexCoord1svARB) +#define glMultiTexCoord2dARB GLEW_GET_FUN(__glewMultiTexCoord2dARB) +#define glMultiTexCoord2dvARB GLEW_GET_FUN(__glewMultiTexCoord2dvARB) +#define glMultiTexCoord2fARB GLEW_GET_FUN(__glewMultiTexCoord2fARB) +#define glMultiTexCoord2fvARB GLEW_GET_FUN(__glewMultiTexCoord2fvARB) +#define glMultiTexCoord2iARB GLEW_GET_FUN(__glewMultiTexCoord2iARB) +#define glMultiTexCoord2ivARB GLEW_GET_FUN(__glewMultiTexCoord2ivARB) +#define glMultiTexCoord2sARB GLEW_GET_FUN(__glewMultiTexCoord2sARB) +#define glMultiTexCoord2svARB GLEW_GET_FUN(__glewMultiTexCoord2svARB) +#define glMultiTexCoord3dARB GLEW_GET_FUN(__glewMultiTexCoord3dARB) +#define glMultiTexCoord3dvARB GLEW_GET_FUN(__glewMultiTexCoord3dvARB) +#define glMultiTexCoord3fARB GLEW_GET_FUN(__glewMultiTexCoord3fARB) +#define glMultiTexCoord3fvARB GLEW_GET_FUN(__glewMultiTexCoord3fvARB) +#define glMultiTexCoord3iARB GLEW_GET_FUN(__glewMultiTexCoord3iARB) +#define glMultiTexCoord3ivARB GLEW_GET_FUN(__glewMultiTexCoord3ivARB) +#define glMultiTexCoord3sARB GLEW_GET_FUN(__glewMultiTexCoord3sARB) +#define glMultiTexCoord3svARB GLEW_GET_FUN(__glewMultiTexCoord3svARB) +#define glMultiTexCoord4dARB GLEW_GET_FUN(__glewMultiTexCoord4dARB) +#define glMultiTexCoord4dvARB GLEW_GET_FUN(__glewMultiTexCoord4dvARB) +#define glMultiTexCoord4fARB GLEW_GET_FUN(__glewMultiTexCoord4fARB) +#define glMultiTexCoord4fvARB GLEW_GET_FUN(__glewMultiTexCoord4fvARB) +#define glMultiTexCoord4iARB GLEW_GET_FUN(__glewMultiTexCoord4iARB) +#define glMultiTexCoord4ivARB GLEW_GET_FUN(__glewMultiTexCoord4ivARB) +#define glMultiTexCoord4sARB GLEW_GET_FUN(__glewMultiTexCoord4sARB) +#define glMultiTexCoord4svARB GLEW_GET_FUN(__glewMultiTexCoord4svARB) + +#define GLEW_ARB_multitexture GLEW_GET_VAR(__GLEW_ARB_multitexture) + +#endif /* GL_ARB_multitexture */ + +/* ------------------------- GL_ARB_occlusion_query ------------------------ */ + +#ifndef GL_ARB_occlusion_query +#define GL_ARB_occlusion_query 1 + +#define GL_QUERY_COUNTER_BITS_ARB 0x8864 +#define GL_CURRENT_QUERY_ARB 0x8865 +#define GL_QUERY_RESULT_ARB 0x8866 +#define GL_QUERY_RESULT_AVAILABLE_ARB 0x8867 +#define GL_SAMPLES_PASSED_ARB 0x8914 + +typedef void (GLAPIENTRY * PFNGLBEGINQUERYARBPROC) (GLenum target, GLuint id); +typedef void (GLAPIENTRY * PFNGLDELETEQUERIESARBPROC) (GLsizei n, const GLuint* ids); +typedef void (GLAPIENTRY * PFNGLENDQUERYARBPROC) (GLenum target); +typedef void (GLAPIENTRY * PFNGLGENQUERIESARBPROC) (GLsizei n, GLuint* ids); +typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTIVARBPROC) (GLuint id, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTUIVARBPROC) (GLuint id, GLenum pname, GLuint* params); +typedef void (GLAPIENTRY * PFNGLGETQUERYIVARBPROC) (GLenum target, GLenum pname, GLint* params); +typedef GLboolean (GLAPIENTRY * PFNGLISQUERYARBPROC) (GLuint id); + +#define glBeginQueryARB GLEW_GET_FUN(__glewBeginQueryARB) +#define glDeleteQueriesARB GLEW_GET_FUN(__glewDeleteQueriesARB) +#define glEndQueryARB GLEW_GET_FUN(__glewEndQueryARB) +#define glGenQueriesARB GLEW_GET_FUN(__glewGenQueriesARB) +#define glGetQueryObjectivARB GLEW_GET_FUN(__glewGetQueryObjectivARB) +#define glGetQueryObjectuivARB GLEW_GET_FUN(__glewGetQueryObjectuivARB) +#define glGetQueryivARB GLEW_GET_FUN(__glewGetQueryivARB) +#define glIsQueryARB GLEW_GET_FUN(__glewIsQueryARB) + +#define GLEW_ARB_occlusion_query GLEW_GET_VAR(__GLEW_ARB_occlusion_query) + +#endif /* GL_ARB_occlusion_query */ + +/* ------------------------ GL_ARB_occlusion_query2 ------------------------ */ + +#ifndef GL_ARB_occlusion_query2 +#define GL_ARB_occlusion_query2 1 + +#define GL_ANY_SAMPLES_PASSED 0x8C2F + +#define GLEW_ARB_occlusion_query2 GLEW_GET_VAR(__GLEW_ARB_occlusion_query2) + +#endif /* GL_ARB_occlusion_query2 */ + +/* ----------------------- GL_ARB_pixel_buffer_object ---------------------- */ + +#ifndef GL_ARB_pixel_buffer_object +#define GL_ARB_pixel_buffer_object 1 + +#define GL_PIXEL_PACK_BUFFER_ARB 0x88EB +#define GL_PIXEL_UNPACK_BUFFER_ARB 0x88EC +#define GL_PIXEL_PACK_BUFFER_BINDING_ARB 0x88ED +#define GL_PIXEL_UNPACK_BUFFER_BINDING_ARB 0x88EF + +#define GLEW_ARB_pixel_buffer_object GLEW_GET_VAR(__GLEW_ARB_pixel_buffer_object) + +#endif /* GL_ARB_pixel_buffer_object */ + +/* ------------------------ GL_ARB_point_parameters ------------------------ */ + +#ifndef GL_ARB_point_parameters +#define GL_ARB_point_parameters 1 + +#define GL_POINT_SIZE_MIN_ARB 0x8126 +#define GL_POINT_SIZE_MAX_ARB 0x8127 +#define GL_POINT_FADE_THRESHOLD_SIZE_ARB 0x8128 +#define GL_POINT_DISTANCE_ATTENUATION_ARB 0x8129 + +typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERFARBPROC) (GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERFVARBPROC) (GLenum pname, const GLfloat* params); + +#define glPointParameterfARB GLEW_GET_FUN(__glewPointParameterfARB) +#define glPointParameterfvARB GLEW_GET_FUN(__glewPointParameterfvARB) + +#define GLEW_ARB_point_parameters GLEW_GET_VAR(__GLEW_ARB_point_parameters) + +#endif /* GL_ARB_point_parameters */ + +/* -------------------------- GL_ARB_point_sprite -------------------------- */ + +#ifndef GL_ARB_point_sprite +#define GL_ARB_point_sprite 1 + +#define GL_POINT_SPRITE_ARB 0x8861 +#define GL_COORD_REPLACE_ARB 0x8862 + +#define GLEW_ARB_point_sprite GLEW_GET_VAR(__GLEW_ARB_point_sprite) + +#endif /* GL_ARB_point_sprite */ + +/* --------------------- GL_ARB_program_interface_query -------------------- */ + +#ifndef GL_ARB_program_interface_query +#define GL_ARB_program_interface_query 1 + +#define GL_UNIFORM 0x92E1 +#define GL_UNIFORM_BLOCK 0x92E2 +#define GL_PROGRAM_INPUT 0x92E3 +#define GL_PROGRAM_OUTPUT 0x92E4 +#define GL_BUFFER_VARIABLE 0x92E5 +#define GL_SHADER_STORAGE_BLOCK 0x92E6 +#define GL_IS_PER_PATCH 0x92E7 +#define GL_VERTEX_SUBROUTINE 0x92E8 +#define GL_TESS_CONTROL_SUBROUTINE 0x92E9 +#define GL_TESS_EVALUATION_SUBROUTINE 0x92EA +#define GL_GEOMETRY_SUBROUTINE 0x92EB +#define GL_FRAGMENT_SUBROUTINE 0x92EC +#define GL_COMPUTE_SUBROUTINE 0x92ED +#define GL_VERTEX_SUBROUTINE_UNIFORM 0x92EE +#define GL_TESS_CONTROL_SUBROUTINE_UNIFORM 0x92EF +#define GL_TESS_EVALUATION_SUBROUTINE_UNIFORM 0x92F0 +#define GL_GEOMETRY_SUBROUTINE_UNIFORM 0x92F1 +#define GL_FRAGMENT_SUBROUTINE_UNIFORM 0x92F2 +#define GL_COMPUTE_SUBROUTINE_UNIFORM 0x92F3 +#define GL_TRANSFORM_FEEDBACK_VARYING 0x92F4 +#define GL_ACTIVE_RESOURCES 0x92F5 +#define GL_MAX_NAME_LENGTH 0x92F6 +#define GL_MAX_NUM_ACTIVE_VARIABLES 0x92F7 +#define GL_MAX_NUM_COMPATIBLE_SUBROUTINES 0x92F8 +#define GL_NAME_LENGTH 0x92F9 +#define GL_TYPE 0x92FA +#define GL_ARRAY_SIZE 0x92FB +#define GL_OFFSET 0x92FC +#define GL_BLOCK_INDEX 0x92FD +#define GL_ARRAY_STRIDE 0x92FE +#define GL_MATRIX_STRIDE 0x92FF +#define GL_IS_ROW_MAJOR 0x9300 +#define GL_ATOMIC_COUNTER_BUFFER_INDEX 0x9301 +#define GL_BUFFER_BINDING 0x9302 +#define GL_BUFFER_DATA_SIZE 0x9303 +#define GL_NUM_ACTIVE_VARIABLES 0x9304 +#define GL_ACTIVE_VARIABLES 0x9305 +#define GL_REFERENCED_BY_VERTEX_SHADER 0x9306 +#define GL_REFERENCED_BY_TESS_CONTROL_SHADER 0x9307 +#define GL_REFERENCED_BY_TESS_EVALUATION_SHADER 0x9308 +#define GL_REFERENCED_BY_GEOMETRY_SHADER 0x9309 +#define GL_REFERENCED_BY_FRAGMENT_SHADER 0x930A +#define GL_REFERENCED_BY_COMPUTE_SHADER 0x930B +#define GL_TOP_LEVEL_ARRAY_SIZE 0x930C +#define GL_TOP_LEVEL_ARRAY_STRIDE 0x930D +#define GL_LOCATION 0x930E +#define GL_LOCATION_INDEX 0x930F + +typedef void (GLAPIENTRY * PFNGLGETPROGRAMINTERFACEIVPROC) (GLuint program, GLenum programInterface, GLenum pname, GLint* params); +typedef GLuint (GLAPIENTRY * PFNGLGETPROGRAMRESOURCEINDEXPROC) (GLuint program, GLenum programInterface, const GLchar* name); +typedef GLint (GLAPIENTRY * PFNGLGETPROGRAMRESOURCELOCATIONPROC) (GLuint program, GLenum programInterface, const GLchar* name); +typedef GLint (GLAPIENTRY * PFNGLGETPROGRAMRESOURCELOCATIONINDEXPROC) (GLuint program, GLenum programInterface, const GLchar* name); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMRESOURCENAMEPROC) (GLuint program, GLenum programInterface, GLuint index, GLsizei bufSize, GLsizei* length, GLchar *name); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMRESOURCEIVPROC) (GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum* props, GLsizei bufSize, GLsizei *length, GLint *params); + +#define glGetProgramInterfaceiv GLEW_GET_FUN(__glewGetProgramInterfaceiv) +#define glGetProgramResourceIndex GLEW_GET_FUN(__glewGetProgramResourceIndex) +#define glGetProgramResourceLocation GLEW_GET_FUN(__glewGetProgramResourceLocation) +#define glGetProgramResourceLocationIndex GLEW_GET_FUN(__glewGetProgramResourceLocationIndex) +#define glGetProgramResourceName GLEW_GET_FUN(__glewGetProgramResourceName) +#define glGetProgramResourceiv GLEW_GET_FUN(__glewGetProgramResourceiv) + +#define GLEW_ARB_program_interface_query GLEW_GET_VAR(__GLEW_ARB_program_interface_query) + +#endif /* GL_ARB_program_interface_query */ + +/* ------------------------ GL_ARB_provoking_vertex ------------------------ */ + +#ifndef GL_ARB_provoking_vertex +#define GL_ARB_provoking_vertex 1 + +#define GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION 0x8E4C +#define GL_FIRST_VERTEX_CONVENTION 0x8E4D +#define GL_LAST_VERTEX_CONVENTION 0x8E4E +#define GL_PROVOKING_VERTEX 0x8E4F + +typedef void (GLAPIENTRY * PFNGLPROVOKINGVERTEXPROC) (GLenum mode); + +#define glProvokingVertex GLEW_GET_FUN(__glewProvokingVertex) + +#define GLEW_ARB_provoking_vertex GLEW_GET_VAR(__GLEW_ARB_provoking_vertex) + +#endif /* GL_ARB_provoking_vertex */ + +/* ----------------------- GL_ARB_query_buffer_object ---------------------- */ + +#ifndef GL_ARB_query_buffer_object +#define GL_ARB_query_buffer_object 1 + +#define GL_QUERY_BUFFER_BARRIER_BIT 0x00008000 +#define GL_QUERY_BUFFER 0x9192 +#define GL_QUERY_BUFFER_BINDING 0x9193 +#define GL_QUERY_RESULT_NO_WAIT 0x9194 + +#define GLEW_ARB_query_buffer_object GLEW_GET_VAR(__GLEW_ARB_query_buffer_object) + +#endif /* GL_ARB_query_buffer_object */ + +/* ------------------ GL_ARB_robust_buffer_access_behavior ----------------- */ + +#ifndef GL_ARB_robust_buffer_access_behavior +#define GL_ARB_robust_buffer_access_behavior 1 + +#define GLEW_ARB_robust_buffer_access_behavior GLEW_GET_VAR(__GLEW_ARB_robust_buffer_access_behavior) + +#endif /* GL_ARB_robust_buffer_access_behavior */ + +/* --------------------------- GL_ARB_robustness --------------------------- */ + +#ifndef GL_ARB_robustness +#define GL_ARB_robustness 1 + +#define GL_CONTEXT_FLAG_ROBUST_ACCESS_BIT_ARB 0x00000004 +#define GL_LOSE_CONTEXT_ON_RESET_ARB 0x8252 +#define GL_GUILTY_CONTEXT_RESET_ARB 0x8253 +#define GL_INNOCENT_CONTEXT_RESET_ARB 0x8254 +#define GL_UNKNOWN_CONTEXT_RESET_ARB 0x8255 +#define GL_RESET_NOTIFICATION_STRATEGY_ARB 0x8256 +#define GL_NO_RESET_NOTIFICATION_ARB 0x8261 + +typedef GLenum (GLAPIENTRY * PFNGLGETGRAPHICSRESETSTATUSARBPROC) (void); +typedef void (GLAPIENTRY * PFNGLGETNCOLORTABLEARBPROC) (GLenum target, GLenum format, GLenum type, GLsizei bufSize, void* table); +typedef void (GLAPIENTRY * PFNGLGETNCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GLint lod, GLsizei bufSize, void* img); +typedef void (GLAPIENTRY * PFNGLGETNCONVOLUTIONFILTERARBPROC) (GLenum target, GLenum format, GLenum type, GLsizei bufSize, void* image); +typedef void (GLAPIENTRY * PFNGLGETNHISTOGRAMARBPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, void* values); +typedef void (GLAPIENTRY * PFNGLGETNMAPDVARBPROC) (GLenum target, GLenum query, GLsizei bufSize, GLdouble* v); +typedef void (GLAPIENTRY * PFNGLGETNMAPFVARBPROC) (GLenum target, GLenum query, GLsizei bufSize, GLfloat* v); +typedef void (GLAPIENTRY * PFNGLGETNMAPIVARBPROC) (GLenum target, GLenum query, GLsizei bufSize, GLint* v); +typedef void (GLAPIENTRY * PFNGLGETNMINMAXARBPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, void* values); +typedef void (GLAPIENTRY * PFNGLGETNPIXELMAPFVARBPROC) (GLenum map, GLsizei bufSize, GLfloat* values); +typedef void (GLAPIENTRY * PFNGLGETNPIXELMAPUIVARBPROC) (GLenum map, GLsizei bufSize, GLuint* values); +typedef void (GLAPIENTRY * PFNGLGETNPIXELMAPUSVARBPROC) (GLenum map, GLsizei bufSize, GLushort* values); +typedef void (GLAPIENTRY * PFNGLGETNPOLYGONSTIPPLEARBPROC) (GLsizei bufSize, GLubyte* pattern); +typedef void (GLAPIENTRY * PFNGLGETNSEPARABLEFILTERARBPROC) (GLenum target, GLenum format, GLenum type, GLsizei rowBufSize, void* row, GLsizei columnBufSize, GLvoid*column, GLvoid*span); +typedef void (GLAPIENTRY * PFNGLGETNTEXIMAGEARBPROC) (GLenum target, GLint level, GLenum format, GLenum type, GLsizei bufSize, void* img); +typedef void (GLAPIENTRY * PFNGLGETNUNIFORMDVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLGETNUNIFORMFVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETNUNIFORMIVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETNUNIFORMUIVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLuint* params); +typedef void (GLAPIENTRY * PFNGLREADNPIXELSARBPROC) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void* data); + +#define glGetGraphicsResetStatusARB GLEW_GET_FUN(__glewGetGraphicsResetStatusARB) +#define glGetnColorTableARB GLEW_GET_FUN(__glewGetnColorTableARB) +#define glGetnCompressedTexImageARB GLEW_GET_FUN(__glewGetnCompressedTexImageARB) +#define glGetnConvolutionFilterARB GLEW_GET_FUN(__glewGetnConvolutionFilterARB) +#define glGetnHistogramARB GLEW_GET_FUN(__glewGetnHistogramARB) +#define glGetnMapdvARB GLEW_GET_FUN(__glewGetnMapdvARB) +#define glGetnMapfvARB GLEW_GET_FUN(__glewGetnMapfvARB) +#define glGetnMapivARB GLEW_GET_FUN(__glewGetnMapivARB) +#define glGetnMinmaxARB GLEW_GET_FUN(__glewGetnMinmaxARB) +#define glGetnPixelMapfvARB GLEW_GET_FUN(__glewGetnPixelMapfvARB) +#define glGetnPixelMapuivARB GLEW_GET_FUN(__glewGetnPixelMapuivARB) +#define glGetnPixelMapusvARB GLEW_GET_FUN(__glewGetnPixelMapusvARB) +#define glGetnPolygonStippleARB GLEW_GET_FUN(__glewGetnPolygonStippleARB) +#define glGetnSeparableFilterARB GLEW_GET_FUN(__glewGetnSeparableFilterARB) +#define glGetnTexImageARB GLEW_GET_FUN(__glewGetnTexImageARB) +#define glGetnUniformdvARB GLEW_GET_FUN(__glewGetnUniformdvARB) +#define glGetnUniformfvARB GLEW_GET_FUN(__glewGetnUniformfvARB) +#define glGetnUniformivARB GLEW_GET_FUN(__glewGetnUniformivARB) +#define glGetnUniformuivARB GLEW_GET_FUN(__glewGetnUniformuivARB) +#define glReadnPixelsARB GLEW_GET_FUN(__glewReadnPixelsARB) + +#define GLEW_ARB_robustness GLEW_GET_VAR(__GLEW_ARB_robustness) + +#endif /* GL_ARB_robustness */ + +/* ---------------- GL_ARB_robustness_application_isolation ---------------- */ + +#ifndef GL_ARB_robustness_application_isolation +#define GL_ARB_robustness_application_isolation 1 + +#define GLEW_ARB_robustness_application_isolation GLEW_GET_VAR(__GLEW_ARB_robustness_application_isolation) + +#endif /* GL_ARB_robustness_application_isolation */ + +/* ---------------- GL_ARB_robustness_share_group_isolation ---------------- */ + +#ifndef GL_ARB_robustness_share_group_isolation +#define GL_ARB_robustness_share_group_isolation 1 + +#define GLEW_ARB_robustness_share_group_isolation GLEW_GET_VAR(__GLEW_ARB_robustness_share_group_isolation) + +#endif /* GL_ARB_robustness_share_group_isolation */ + +/* ------------------------- GL_ARB_sample_shading ------------------------- */ + +#ifndef GL_ARB_sample_shading +#define GL_ARB_sample_shading 1 + +#define GL_SAMPLE_SHADING_ARB 0x8C36 +#define GL_MIN_SAMPLE_SHADING_VALUE_ARB 0x8C37 + +typedef void (GLAPIENTRY * PFNGLMINSAMPLESHADINGARBPROC) (GLclampf value); + +#define glMinSampleShadingARB GLEW_GET_FUN(__glewMinSampleShadingARB) + +#define GLEW_ARB_sample_shading GLEW_GET_VAR(__GLEW_ARB_sample_shading) + +#endif /* GL_ARB_sample_shading */ + +/* ------------------------- GL_ARB_sampler_objects ------------------------ */ + +#ifndef GL_ARB_sampler_objects +#define GL_ARB_sampler_objects 1 + +#define GL_SAMPLER_BINDING 0x8919 + +typedef void (GLAPIENTRY * PFNGLBINDSAMPLERPROC) (GLuint unit, GLuint sampler); +typedef void (GLAPIENTRY * PFNGLDELETESAMPLERSPROC) (GLsizei count, const GLuint * samplers); +typedef void (GLAPIENTRY * PFNGLGENSAMPLERSPROC) (GLsizei count, GLuint* samplers); +typedef void (GLAPIENTRY * PFNGLGETSAMPLERPARAMETERIIVPROC) (GLuint sampler, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETSAMPLERPARAMETERIUIVPROC) (GLuint sampler, GLenum pname, GLuint* params); +typedef void (GLAPIENTRY * PFNGLGETSAMPLERPARAMETERFVPROC) (GLuint sampler, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETSAMPLERPARAMETERIVPROC) (GLuint sampler, GLenum pname, GLint* params); +typedef GLboolean (GLAPIENTRY * PFNGLISSAMPLERPROC) (GLuint sampler); +typedef void (GLAPIENTRY * PFNGLSAMPLERPARAMETERIIVPROC) (GLuint sampler, GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLSAMPLERPARAMETERIUIVPROC) (GLuint sampler, GLenum pname, const GLuint* params); +typedef void (GLAPIENTRY * PFNGLSAMPLERPARAMETERFPROC) (GLuint sampler, GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLSAMPLERPARAMETERFVPROC) (GLuint sampler, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLSAMPLERPARAMETERIPROC) (GLuint sampler, GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLSAMPLERPARAMETERIVPROC) (GLuint sampler, GLenum pname, const GLint* params); + +#define glBindSampler GLEW_GET_FUN(__glewBindSampler) +#define glDeleteSamplers GLEW_GET_FUN(__glewDeleteSamplers) +#define glGenSamplers GLEW_GET_FUN(__glewGenSamplers) +#define glGetSamplerParameterIiv GLEW_GET_FUN(__glewGetSamplerParameterIiv) +#define glGetSamplerParameterIuiv GLEW_GET_FUN(__glewGetSamplerParameterIuiv) +#define glGetSamplerParameterfv GLEW_GET_FUN(__glewGetSamplerParameterfv) +#define glGetSamplerParameteriv GLEW_GET_FUN(__glewGetSamplerParameteriv) +#define glIsSampler GLEW_GET_FUN(__glewIsSampler) +#define glSamplerParameterIiv GLEW_GET_FUN(__glewSamplerParameterIiv) +#define glSamplerParameterIuiv GLEW_GET_FUN(__glewSamplerParameterIuiv) +#define glSamplerParameterf GLEW_GET_FUN(__glewSamplerParameterf) +#define glSamplerParameterfv GLEW_GET_FUN(__glewSamplerParameterfv) +#define glSamplerParameteri GLEW_GET_FUN(__glewSamplerParameteri) +#define glSamplerParameteriv GLEW_GET_FUN(__glewSamplerParameteriv) + +#define GLEW_ARB_sampler_objects GLEW_GET_VAR(__GLEW_ARB_sampler_objects) + +#endif /* GL_ARB_sampler_objects */ + +/* ------------------------ GL_ARB_seamless_cube_map ----------------------- */ + +#ifndef GL_ARB_seamless_cube_map +#define GL_ARB_seamless_cube_map 1 + +#define GL_TEXTURE_CUBE_MAP_SEAMLESS 0x884F + +#define GLEW_ARB_seamless_cube_map GLEW_GET_VAR(__GLEW_ARB_seamless_cube_map) + +#endif /* GL_ARB_seamless_cube_map */ + +/* ------------------ GL_ARB_seamless_cubemap_per_texture ------------------ */ + +#ifndef GL_ARB_seamless_cubemap_per_texture +#define GL_ARB_seamless_cubemap_per_texture 1 + +#define GL_TEXTURE_CUBE_MAP_SEAMLESS 0x884F + +#define GLEW_ARB_seamless_cubemap_per_texture GLEW_GET_VAR(__GLEW_ARB_seamless_cubemap_per_texture) + +#endif /* GL_ARB_seamless_cubemap_per_texture */ + +/* --------------------- GL_ARB_separate_shader_objects -------------------- */ + +#ifndef GL_ARB_separate_shader_objects +#define GL_ARB_separate_shader_objects 1 + +#define GL_VERTEX_SHADER_BIT 0x00000001 +#define GL_FRAGMENT_SHADER_BIT 0x00000002 +#define GL_GEOMETRY_SHADER_BIT 0x00000004 +#define GL_TESS_CONTROL_SHADER_BIT 0x00000008 +#define GL_TESS_EVALUATION_SHADER_BIT 0x00000010 +#define GL_PROGRAM_SEPARABLE 0x8258 +#define GL_ACTIVE_PROGRAM 0x8259 +#define GL_PROGRAM_PIPELINE_BINDING 0x825A +#define GL_ALL_SHADER_BITS 0xFFFFFFFF + +typedef void (GLAPIENTRY * PFNGLACTIVESHADERPROGRAMPROC) (GLuint pipeline, GLuint program); +typedef void (GLAPIENTRY * PFNGLBINDPROGRAMPIPELINEPROC) (GLuint pipeline); +typedef GLuint (GLAPIENTRY * PFNGLCREATESHADERPROGRAMVPROC) (GLenum type, GLsizei count, const GLchar ** strings); +typedef void (GLAPIENTRY * PFNGLDELETEPROGRAMPIPELINESPROC) (GLsizei n, const GLuint* pipelines); +typedef void (GLAPIENTRY * PFNGLGENPROGRAMPIPELINESPROC) (GLsizei n, GLuint* pipelines); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMPIPELINEINFOLOGPROC) (GLuint pipeline, GLsizei bufSize, GLsizei* length, GLchar *infoLog); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMPIPELINEIVPROC) (GLuint pipeline, GLenum pname, GLint* params); +typedef GLboolean (GLAPIENTRY * PFNGLISPROGRAMPIPELINEPROC) (GLuint pipeline); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1DPROC) (GLuint program, GLint location, GLdouble x); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1FPROC) (GLuint program, GLint location, GLfloat x); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1IPROC) (GLuint program, GLint location, GLint x); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1IVPROC) (GLuint program, GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1UIPROC) (GLuint program, GLint location, GLuint x); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2DPROC) (GLuint program, GLint location, GLdouble x, GLdouble y); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2FPROC) (GLuint program, GLint location, GLfloat x, GLfloat y); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2IPROC) (GLuint program, GLint location, GLint x, GLint y); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2IVPROC) (GLuint program, GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2UIPROC) (GLuint program, GLint location, GLuint x, GLuint y); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3DPROC) (GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3FPROC) (GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3IPROC) (GLuint program, GLint location, GLint x, GLint y, GLint z); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3IVPROC) (GLuint program, GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3UIPROC) (GLuint program, GLint location, GLuint x, GLuint y, GLuint z); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4DPROC) (GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4FPROC) (GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4IPROC) (GLuint program, GLint location, GLint x, GLint y, GLint z, GLint w); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4IVPROC) (GLuint program, GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4UIPROC) (GLuint program, GLint location, GLuint x, GLuint y, GLuint z, GLuint w); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2X3DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2X3FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2X4DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2X4FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3X2DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3X2FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3X4DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3X4FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4X2DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4X2FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4X3DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4X3FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUSEPROGRAMSTAGESPROC) (GLuint pipeline, GLbitfield stages, GLuint program); +typedef void (GLAPIENTRY * PFNGLVALIDATEPROGRAMPIPELINEPROC) (GLuint pipeline); + +#define glActiveShaderProgram GLEW_GET_FUN(__glewActiveShaderProgram) +#define glBindProgramPipeline GLEW_GET_FUN(__glewBindProgramPipeline) +#define glCreateShaderProgramv GLEW_GET_FUN(__glewCreateShaderProgramv) +#define glDeleteProgramPipelines GLEW_GET_FUN(__glewDeleteProgramPipelines) +#define glGenProgramPipelines GLEW_GET_FUN(__glewGenProgramPipelines) +#define glGetProgramPipelineInfoLog GLEW_GET_FUN(__glewGetProgramPipelineInfoLog) +#define glGetProgramPipelineiv GLEW_GET_FUN(__glewGetProgramPipelineiv) +#define glIsProgramPipeline GLEW_GET_FUN(__glewIsProgramPipeline) +#define glProgramUniform1d GLEW_GET_FUN(__glewProgramUniform1d) +#define glProgramUniform1dv GLEW_GET_FUN(__glewProgramUniform1dv) +#define glProgramUniform1f GLEW_GET_FUN(__glewProgramUniform1f) +#define glProgramUniform1fv GLEW_GET_FUN(__glewProgramUniform1fv) +#define glProgramUniform1i GLEW_GET_FUN(__glewProgramUniform1i) +#define glProgramUniform1iv GLEW_GET_FUN(__glewProgramUniform1iv) +#define glProgramUniform1ui GLEW_GET_FUN(__glewProgramUniform1ui) +#define glProgramUniform1uiv GLEW_GET_FUN(__glewProgramUniform1uiv) +#define glProgramUniform2d GLEW_GET_FUN(__glewProgramUniform2d) +#define glProgramUniform2dv GLEW_GET_FUN(__glewProgramUniform2dv) +#define glProgramUniform2f GLEW_GET_FUN(__glewProgramUniform2f) +#define glProgramUniform2fv GLEW_GET_FUN(__glewProgramUniform2fv) +#define glProgramUniform2i GLEW_GET_FUN(__glewProgramUniform2i) +#define glProgramUniform2iv GLEW_GET_FUN(__glewProgramUniform2iv) +#define glProgramUniform2ui GLEW_GET_FUN(__glewProgramUniform2ui) +#define glProgramUniform2uiv GLEW_GET_FUN(__glewProgramUniform2uiv) +#define glProgramUniform3d GLEW_GET_FUN(__glewProgramUniform3d) +#define glProgramUniform3dv GLEW_GET_FUN(__glewProgramUniform3dv) +#define glProgramUniform3f GLEW_GET_FUN(__glewProgramUniform3f) +#define glProgramUniform3fv GLEW_GET_FUN(__glewProgramUniform3fv) +#define glProgramUniform3i GLEW_GET_FUN(__glewProgramUniform3i) +#define glProgramUniform3iv GLEW_GET_FUN(__glewProgramUniform3iv) +#define glProgramUniform3ui GLEW_GET_FUN(__glewProgramUniform3ui) +#define glProgramUniform3uiv GLEW_GET_FUN(__glewProgramUniform3uiv) +#define glProgramUniform4d GLEW_GET_FUN(__glewProgramUniform4d) +#define glProgramUniform4dv GLEW_GET_FUN(__glewProgramUniform4dv) +#define glProgramUniform4f GLEW_GET_FUN(__glewProgramUniform4f) +#define glProgramUniform4fv GLEW_GET_FUN(__glewProgramUniform4fv) +#define glProgramUniform4i GLEW_GET_FUN(__glewProgramUniform4i) +#define glProgramUniform4iv GLEW_GET_FUN(__glewProgramUniform4iv) +#define glProgramUniform4ui GLEW_GET_FUN(__glewProgramUniform4ui) +#define glProgramUniform4uiv GLEW_GET_FUN(__glewProgramUniform4uiv) +#define glProgramUniformMatrix2dv GLEW_GET_FUN(__glewProgramUniformMatrix2dv) +#define glProgramUniformMatrix2fv GLEW_GET_FUN(__glewProgramUniformMatrix2fv) +#define glProgramUniformMatrix2x3dv GLEW_GET_FUN(__glewProgramUniformMatrix2x3dv) +#define glProgramUniformMatrix2x3fv GLEW_GET_FUN(__glewProgramUniformMatrix2x3fv) +#define glProgramUniformMatrix2x4dv GLEW_GET_FUN(__glewProgramUniformMatrix2x4dv) +#define glProgramUniformMatrix2x4fv GLEW_GET_FUN(__glewProgramUniformMatrix2x4fv) +#define glProgramUniformMatrix3dv GLEW_GET_FUN(__glewProgramUniformMatrix3dv) +#define glProgramUniformMatrix3fv GLEW_GET_FUN(__glewProgramUniformMatrix3fv) +#define glProgramUniformMatrix3x2dv GLEW_GET_FUN(__glewProgramUniformMatrix3x2dv) +#define glProgramUniformMatrix3x2fv GLEW_GET_FUN(__glewProgramUniformMatrix3x2fv) +#define glProgramUniformMatrix3x4dv GLEW_GET_FUN(__glewProgramUniformMatrix3x4dv) +#define glProgramUniformMatrix3x4fv GLEW_GET_FUN(__glewProgramUniformMatrix3x4fv) +#define glProgramUniformMatrix4dv GLEW_GET_FUN(__glewProgramUniformMatrix4dv) +#define glProgramUniformMatrix4fv GLEW_GET_FUN(__glewProgramUniformMatrix4fv) +#define glProgramUniformMatrix4x2dv GLEW_GET_FUN(__glewProgramUniformMatrix4x2dv) +#define glProgramUniformMatrix4x2fv GLEW_GET_FUN(__glewProgramUniformMatrix4x2fv) +#define glProgramUniformMatrix4x3dv GLEW_GET_FUN(__glewProgramUniformMatrix4x3dv) +#define glProgramUniformMatrix4x3fv GLEW_GET_FUN(__glewProgramUniformMatrix4x3fv) +#define glUseProgramStages GLEW_GET_FUN(__glewUseProgramStages) +#define glValidateProgramPipeline GLEW_GET_FUN(__glewValidateProgramPipeline) + +#define GLEW_ARB_separate_shader_objects GLEW_GET_VAR(__GLEW_ARB_separate_shader_objects) + +#endif /* GL_ARB_separate_shader_objects */ + +/* --------------------- GL_ARB_shader_atomic_counters --------------------- */ + +#ifndef GL_ARB_shader_atomic_counters +#define GL_ARB_shader_atomic_counters 1 + +#define GL_ATOMIC_COUNTER_BUFFER 0x92C0 +#define GL_ATOMIC_COUNTER_BUFFER_BINDING 0x92C1 +#define GL_ATOMIC_COUNTER_BUFFER_START 0x92C2 +#define GL_ATOMIC_COUNTER_BUFFER_SIZE 0x92C3 +#define GL_ATOMIC_COUNTER_BUFFER_DATA_SIZE 0x92C4 +#define GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTERS 0x92C5 +#define GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTER_INDICES 0x92C6 +#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_VERTEX_SHADER 0x92C7 +#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_CONTROL_SHADER 0x92C8 +#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_EVALUATION_SHADER 0x92C9 +#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_GEOMETRY_SHADER 0x92CA +#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_FRAGMENT_SHADER 0x92CB +#define GL_MAX_VERTEX_ATOMIC_COUNTER_BUFFERS 0x92CC +#define GL_MAX_TESS_CONTROL_ATOMIC_COUNTER_BUFFERS 0x92CD +#define GL_MAX_TESS_EVALUATION_ATOMIC_COUNTER_BUFFERS 0x92CE +#define GL_MAX_GEOMETRY_ATOMIC_COUNTER_BUFFERS 0x92CF +#define GL_MAX_FRAGMENT_ATOMIC_COUNTER_BUFFERS 0x92D0 +#define GL_MAX_COMBINED_ATOMIC_COUNTER_BUFFERS 0x92D1 +#define GL_MAX_VERTEX_ATOMIC_COUNTERS 0x92D2 +#define GL_MAX_TESS_CONTROL_ATOMIC_COUNTERS 0x92D3 +#define GL_MAX_TESS_EVALUATION_ATOMIC_COUNTERS 0x92D4 +#define GL_MAX_GEOMETRY_ATOMIC_COUNTERS 0x92D5 +#define GL_MAX_FRAGMENT_ATOMIC_COUNTERS 0x92D6 +#define GL_MAX_COMBINED_ATOMIC_COUNTERS 0x92D7 +#define GL_MAX_ATOMIC_COUNTER_BUFFER_SIZE 0x92D8 +#define GL_ACTIVE_ATOMIC_COUNTER_BUFFERS 0x92D9 +#define GL_UNIFORM_ATOMIC_COUNTER_BUFFER_INDEX 0x92DA +#define GL_UNSIGNED_INT_ATOMIC_COUNTER 0x92DB +#define GL_MAX_ATOMIC_COUNTER_BUFFER_BINDINGS 0x92DC + +typedef void (GLAPIENTRY * PFNGLGETACTIVEATOMICCOUNTERBUFFERIVPROC) (GLuint program, GLuint bufferIndex, GLenum pname, GLint* params); + +#define glGetActiveAtomicCounterBufferiv GLEW_GET_FUN(__glewGetActiveAtomicCounterBufferiv) + +#define GLEW_ARB_shader_atomic_counters GLEW_GET_VAR(__GLEW_ARB_shader_atomic_counters) + +#endif /* GL_ARB_shader_atomic_counters */ + +/* ----------------------- GL_ARB_shader_bit_encoding ---------------------- */ + +#ifndef GL_ARB_shader_bit_encoding +#define GL_ARB_shader_bit_encoding 1 + +#define GLEW_ARB_shader_bit_encoding GLEW_GET_VAR(__GLEW_ARB_shader_bit_encoding) + +#endif /* GL_ARB_shader_bit_encoding */ + +/* --------------------- GL_ARB_shader_draw_parameters --------------------- */ + +#ifndef GL_ARB_shader_draw_parameters +#define GL_ARB_shader_draw_parameters 1 + +#define GLEW_ARB_shader_draw_parameters GLEW_GET_VAR(__GLEW_ARB_shader_draw_parameters) + +#endif /* GL_ARB_shader_draw_parameters */ + +/* ------------------------ GL_ARB_shader_group_vote ----------------------- */ + +#ifndef GL_ARB_shader_group_vote +#define GL_ARB_shader_group_vote 1 + +#define GLEW_ARB_shader_group_vote GLEW_GET_VAR(__GLEW_ARB_shader_group_vote) + +#endif /* GL_ARB_shader_group_vote */ + +/* --------------------- GL_ARB_shader_image_load_store -------------------- */ + +#ifndef GL_ARB_shader_image_load_store +#define GL_ARB_shader_image_load_store 1 + +#define GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT 0x00000001 +#define GL_ELEMENT_ARRAY_BARRIER_BIT 0x00000002 +#define GL_UNIFORM_BARRIER_BIT 0x00000004 +#define GL_TEXTURE_FETCH_BARRIER_BIT 0x00000008 +#define GL_SHADER_IMAGE_ACCESS_BARRIER_BIT 0x00000020 +#define GL_COMMAND_BARRIER_BIT 0x00000040 +#define GL_PIXEL_BUFFER_BARRIER_BIT 0x00000080 +#define GL_TEXTURE_UPDATE_BARRIER_BIT 0x00000100 +#define GL_BUFFER_UPDATE_BARRIER_BIT 0x00000200 +#define GL_FRAMEBUFFER_BARRIER_BIT 0x00000400 +#define GL_TRANSFORM_FEEDBACK_BARRIER_BIT 0x00000800 +#define GL_ATOMIC_COUNTER_BARRIER_BIT 0x00001000 +#define GL_MAX_IMAGE_UNITS 0x8F38 +#define GL_MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS 0x8F39 +#define GL_IMAGE_BINDING_NAME 0x8F3A +#define GL_IMAGE_BINDING_LEVEL 0x8F3B +#define GL_IMAGE_BINDING_LAYERED 0x8F3C +#define GL_IMAGE_BINDING_LAYER 0x8F3D +#define GL_IMAGE_BINDING_ACCESS 0x8F3E +#define GL_IMAGE_1D 0x904C +#define GL_IMAGE_2D 0x904D +#define GL_IMAGE_3D 0x904E +#define GL_IMAGE_2D_RECT 0x904F +#define GL_IMAGE_CUBE 0x9050 +#define GL_IMAGE_BUFFER 0x9051 +#define GL_IMAGE_1D_ARRAY 0x9052 +#define GL_IMAGE_2D_ARRAY 0x9053 +#define GL_IMAGE_CUBE_MAP_ARRAY 0x9054 +#define GL_IMAGE_2D_MULTISAMPLE 0x9055 +#define GL_IMAGE_2D_MULTISAMPLE_ARRAY 0x9056 +#define GL_INT_IMAGE_1D 0x9057 +#define GL_INT_IMAGE_2D 0x9058 +#define GL_INT_IMAGE_3D 0x9059 +#define GL_INT_IMAGE_2D_RECT 0x905A +#define GL_INT_IMAGE_CUBE 0x905B +#define GL_INT_IMAGE_BUFFER 0x905C +#define GL_INT_IMAGE_1D_ARRAY 0x905D +#define GL_INT_IMAGE_2D_ARRAY 0x905E +#define GL_INT_IMAGE_CUBE_MAP_ARRAY 0x905F +#define GL_INT_IMAGE_2D_MULTISAMPLE 0x9060 +#define GL_INT_IMAGE_2D_MULTISAMPLE_ARRAY 0x9061 +#define GL_UNSIGNED_INT_IMAGE_1D 0x9062 +#define GL_UNSIGNED_INT_IMAGE_2D 0x9063 +#define GL_UNSIGNED_INT_IMAGE_3D 0x9064 +#define GL_UNSIGNED_INT_IMAGE_2D_RECT 0x9065 +#define GL_UNSIGNED_INT_IMAGE_CUBE 0x9066 +#define GL_UNSIGNED_INT_IMAGE_BUFFER 0x9067 +#define GL_UNSIGNED_INT_IMAGE_1D_ARRAY 0x9068 +#define GL_UNSIGNED_INT_IMAGE_2D_ARRAY 0x9069 +#define GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY 0x906A +#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE 0x906B +#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY 0x906C +#define GL_MAX_IMAGE_SAMPLES 0x906D +#define GL_IMAGE_BINDING_FORMAT 0x906E +#define GL_IMAGE_FORMAT_COMPATIBILITY_TYPE 0x90C7 +#define GL_IMAGE_FORMAT_COMPATIBILITY_BY_SIZE 0x90C8 +#define GL_IMAGE_FORMAT_COMPATIBILITY_BY_CLASS 0x90C9 +#define GL_MAX_VERTEX_IMAGE_UNIFORMS 0x90CA +#define GL_MAX_TESS_CONTROL_IMAGE_UNIFORMS 0x90CB +#define GL_MAX_TESS_EVALUATION_IMAGE_UNIFORMS 0x90CC +#define GL_MAX_GEOMETRY_IMAGE_UNIFORMS 0x90CD +#define GL_MAX_FRAGMENT_IMAGE_UNIFORMS 0x90CE +#define GL_MAX_COMBINED_IMAGE_UNIFORMS 0x90CF +#define GL_ALL_BARRIER_BITS 0xFFFFFFFF + +typedef void (GLAPIENTRY * PFNGLBINDIMAGETEXTUREPROC) (GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format); +typedef void (GLAPIENTRY * PFNGLMEMORYBARRIERPROC) (GLbitfield barriers); + +#define glBindImageTexture GLEW_GET_FUN(__glewBindImageTexture) +#define glMemoryBarrier GLEW_GET_FUN(__glewMemoryBarrier) + +#define GLEW_ARB_shader_image_load_store GLEW_GET_VAR(__GLEW_ARB_shader_image_load_store) + +#endif /* GL_ARB_shader_image_load_store */ + +/* ------------------------ GL_ARB_shader_image_size ----------------------- */ + +#ifndef GL_ARB_shader_image_size +#define GL_ARB_shader_image_size 1 + +#define GLEW_ARB_shader_image_size GLEW_GET_VAR(__GLEW_ARB_shader_image_size) + +#endif /* GL_ARB_shader_image_size */ + +/* ------------------------- GL_ARB_shader_objects ------------------------- */ + +#ifndef GL_ARB_shader_objects +#define GL_ARB_shader_objects 1 + +#define GL_PROGRAM_OBJECT_ARB 0x8B40 +#define GL_SHADER_OBJECT_ARB 0x8B48 +#define GL_OBJECT_TYPE_ARB 0x8B4E +#define GL_OBJECT_SUBTYPE_ARB 0x8B4F +#define GL_FLOAT_VEC2_ARB 0x8B50 +#define GL_FLOAT_VEC3_ARB 0x8B51 +#define GL_FLOAT_VEC4_ARB 0x8B52 +#define GL_INT_VEC2_ARB 0x8B53 +#define GL_INT_VEC3_ARB 0x8B54 +#define GL_INT_VEC4_ARB 0x8B55 +#define GL_BOOL_ARB 0x8B56 +#define GL_BOOL_VEC2_ARB 0x8B57 +#define GL_BOOL_VEC3_ARB 0x8B58 +#define GL_BOOL_VEC4_ARB 0x8B59 +#define GL_FLOAT_MAT2_ARB 0x8B5A +#define GL_FLOAT_MAT3_ARB 0x8B5B +#define GL_FLOAT_MAT4_ARB 0x8B5C +#define GL_SAMPLER_1D_ARB 0x8B5D +#define GL_SAMPLER_2D_ARB 0x8B5E +#define GL_SAMPLER_3D_ARB 0x8B5F +#define GL_SAMPLER_CUBE_ARB 0x8B60 +#define GL_SAMPLER_1D_SHADOW_ARB 0x8B61 +#define GL_SAMPLER_2D_SHADOW_ARB 0x8B62 +#define GL_SAMPLER_2D_RECT_ARB 0x8B63 +#define GL_SAMPLER_2D_RECT_SHADOW_ARB 0x8B64 +#define GL_OBJECT_DELETE_STATUS_ARB 0x8B80 +#define GL_OBJECT_COMPILE_STATUS_ARB 0x8B81 +#define GL_OBJECT_LINK_STATUS_ARB 0x8B82 +#define GL_OBJECT_VALIDATE_STATUS_ARB 0x8B83 +#define GL_OBJECT_INFO_LOG_LENGTH_ARB 0x8B84 +#define GL_OBJECT_ATTACHED_OBJECTS_ARB 0x8B85 +#define GL_OBJECT_ACTIVE_UNIFORMS_ARB 0x8B86 +#define GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB 0x8B87 +#define GL_OBJECT_SHADER_SOURCE_LENGTH_ARB 0x8B88 + +typedef char GLcharARB; +typedef unsigned int GLhandleARB; + +typedef void (GLAPIENTRY * PFNGLATTACHOBJECTARBPROC) (GLhandleARB containerObj, GLhandleARB obj); +typedef void (GLAPIENTRY * PFNGLCOMPILESHADERARBPROC) (GLhandleARB shaderObj); +typedef GLhandleARB (GLAPIENTRY * PFNGLCREATEPROGRAMOBJECTARBPROC) (void); +typedef GLhandleARB (GLAPIENTRY * PFNGLCREATESHADEROBJECTARBPROC) (GLenum shaderType); +typedef void (GLAPIENTRY * PFNGLDELETEOBJECTARBPROC) (GLhandleARB obj); +typedef void (GLAPIENTRY * PFNGLDETACHOBJECTARBPROC) (GLhandleARB containerObj, GLhandleARB attachedObj); +typedef void (GLAPIENTRY * PFNGLGETACTIVEUNIFORMARBPROC) (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei* length, GLint *size, GLenum *type, GLcharARB *name); +typedef void (GLAPIENTRY * PFNGLGETATTACHEDOBJECTSARBPROC) (GLhandleARB containerObj, GLsizei maxCount, GLsizei* count, GLhandleARB *obj); +typedef GLhandleARB (GLAPIENTRY * PFNGLGETHANDLEARBPROC) (GLenum pname); +typedef void (GLAPIENTRY * PFNGLGETINFOLOGARBPROC) (GLhandleARB obj, GLsizei maxLength, GLsizei* length, GLcharARB *infoLog); +typedef void (GLAPIENTRY * PFNGLGETOBJECTPARAMETERFVARBPROC) (GLhandleARB obj, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETOBJECTPARAMETERIVARBPROC) (GLhandleARB obj, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETSHADERSOURCEARBPROC) (GLhandleARB obj, GLsizei maxLength, GLsizei* length, GLcharARB *source); +typedef GLint (GLAPIENTRY * PFNGLGETUNIFORMLOCATIONARBPROC) (GLhandleARB programObj, const GLcharARB* name); +typedef void (GLAPIENTRY * PFNGLGETUNIFORMFVARBPROC) (GLhandleARB programObj, GLint location, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETUNIFORMIVARBPROC) (GLhandleARB programObj, GLint location, GLint* params); +typedef void (GLAPIENTRY * PFNGLLINKPROGRAMARBPROC) (GLhandleARB programObj); +typedef void (GLAPIENTRY * PFNGLSHADERSOURCEARBPROC) (GLhandleARB shaderObj, GLsizei count, const GLcharARB ** string, const GLint *length); +typedef void (GLAPIENTRY * PFNGLUNIFORM1FARBPROC) (GLint location, GLfloat v0); +typedef void (GLAPIENTRY * PFNGLUNIFORM1FVARBPROC) (GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM1IARBPROC) (GLint location, GLint v0); +typedef void (GLAPIENTRY * PFNGLUNIFORM1IVARBPROC) (GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM2FARBPROC) (GLint location, GLfloat v0, GLfloat v1); +typedef void (GLAPIENTRY * PFNGLUNIFORM2FVARBPROC) (GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM2IARBPROC) (GLint location, GLint v0, GLint v1); +typedef void (GLAPIENTRY * PFNGLUNIFORM2IVARBPROC) (GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM3FARBPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2); +typedef void (GLAPIENTRY * PFNGLUNIFORM3FVARBPROC) (GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM3IARBPROC) (GLint location, GLint v0, GLint v1, GLint v2); +typedef void (GLAPIENTRY * PFNGLUNIFORM3IVARBPROC) (GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM4FARBPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); +typedef void (GLAPIENTRY * PFNGLUNIFORM4FVARBPROC) (GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM4IARBPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3); +typedef void (GLAPIENTRY * PFNGLUNIFORM4IVARBPROC) (GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX2FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX3FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUSEPROGRAMOBJECTARBPROC) (GLhandleARB programObj); +typedef void (GLAPIENTRY * PFNGLVALIDATEPROGRAMARBPROC) (GLhandleARB programObj); + +#define glAttachObjectARB GLEW_GET_FUN(__glewAttachObjectARB) +#define glCompileShaderARB GLEW_GET_FUN(__glewCompileShaderARB) +#define glCreateProgramObjectARB GLEW_GET_FUN(__glewCreateProgramObjectARB) +#define glCreateShaderObjectARB GLEW_GET_FUN(__glewCreateShaderObjectARB) +#define glDeleteObjectARB GLEW_GET_FUN(__glewDeleteObjectARB) +#define glDetachObjectARB GLEW_GET_FUN(__glewDetachObjectARB) +#define glGetActiveUniformARB GLEW_GET_FUN(__glewGetActiveUniformARB) +#define glGetAttachedObjectsARB GLEW_GET_FUN(__glewGetAttachedObjectsARB) +#define glGetHandleARB GLEW_GET_FUN(__glewGetHandleARB) +#define glGetInfoLogARB GLEW_GET_FUN(__glewGetInfoLogARB) +#define glGetObjectParameterfvARB GLEW_GET_FUN(__glewGetObjectParameterfvARB) +#define glGetObjectParameterivARB GLEW_GET_FUN(__glewGetObjectParameterivARB) +#define glGetShaderSourceARB GLEW_GET_FUN(__glewGetShaderSourceARB) +#define glGetUniformLocationARB GLEW_GET_FUN(__glewGetUniformLocationARB) +#define glGetUniformfvARB GLEW_GET_FUN(__glewGetUniformfvARB) +#define glGetUniformivARB GLEW_GET_FUN(__glewGetUniformivARB) +#define glLinkProgramARB GLEW_GET_FUN(__glewLinkProgramARB) +#define glShaderSourceARB GLEW_GET_FUN(__glewShaderSourceARB) +#define glUniform1fARB GLEW_GET_FUN(__glewUniform1fARB) +#define glUniform1fvARB GLEW_GET_FUN(__glewUniform1fvARB) +#define glUniform1iARB GLEW_GET_FUN(__glewUniform1iARB) +#define glUniform1ivARB GLEW_GET_FUN(__glewUniform1ivARB) +#define glUniform2fARB GLEW_GET_FUN(__glewUniform2fARB) +#define glUniform2fvARB GLEW_GET_FUN(__glewUniform2fvARB) +#define glUniform2iARB GLEW_GET_FUN(__glewUniform2iARB) +#define glUniform2ivARB GLEW_GET_FUN(__glewUniform2ivARB) +#define glUniform3fARB GLEW_GET_FUN(__glewUniform3fARB) +#define glUniform3fvARB GLEW_GET_FUN(__glewUniform3fvARB) +#define glUniform3iARB GLEW_GET_FUN(__glewUniform3iARB) +#define glUniform3ivARB GLEW_GET_FUN(__glewUniform3ivARB) +#define glUniform4fARB GLEW_GET_FUN(__glewUniform4fARB) +#define glUniform4fvARB GLEW_GET_FUN(__glewUniform4fvARB) +#define glUniform4iARB GLEW_GET_FUN(__glewUniform4iARB) +#define glUniform4ivARB GLEW_GET_FUN(__glewUniform4ivARB) +#define glUniformMatrix2fvARB GLEW_GET_FUN(__glewUniformMatrix2fvARB) +#define glUniformMatrix3fvARB GLEW_GET_FUN(__glewUniformMatrix3fvARB) +#define glUniformMatrix4fvARB GLEW_GET_FUN(__glewUniformMatrix4fvARB) +#define glUseProgramObjectARB GLEW_GET_FUN(__glewUseProgramObjectARB) +#define glValidateProgramARB GLEW_GET_FUN(__glewValidateProgramARB) + +#define GLEW_ARB_shader_objects GLEW_GET_VAR(__GLEW_ARB_shader_objects) + +#endif /* GL_ARB_shader_objects */ + +/* ------------------------ GL_ARB_shader_precision ------------------------ */ + +#ifndef GL_ARB_shader_precision +#define GL_ARB_shader_precision 1 + +#define GLEW_ARB_shader_precision GLEW_GET_VAR(__GLEW_ARB_shader_precision) + +#endif /* GL_ARB_shader_precision */ + +/* ---------------------- GL_ARB_shader_stencil_export --------------------- */ + +#ifndef GL_ARB_shader_stencil_export +#define GL_ARB_shader_stencil_export 1 + +#define GLEW_ARB_shader_stencil_export GLEW_GET_VAR(__GLEW_ARB_shader_stencil_export) + +#endif /* GL_ARB_shader_stencil_export */ + +/* ------------------ GL_ARB_shader_storage_buffer_object ------------------ */ + +#ifndef GL_ARB_shader_storage_buffer_object +#define GL_ARB_shader_storage_buffer_object 1 + +#define GL_SHADER_STORAGE_BARRIER_BIT 0x2000 +#define GL_MAX_COMBINED_SHADER_OUTPUT_RESOURCES 0x8F39 +#define GL_SHADER_STORAGE_BUFFER 0x90D2 +#define GL_SHADER_STORAGE_BUFFER_BINDING 0x90D3 +#define GL_SHADER_STORAGE_BUFFER_START 0x90D4 +#define GL_SHADER_STORAGE_BUFFER_SIZE 0x90D5 +#define GL_MAX_VERTEX_SHADER_STORAGE_BLOCKS 0x90D6 +#define GL_MAX_GEOMETRY_SHADER_STORAGE_BLOCKS 0x90D7 +#define GL_MAX_TESS_CONTROL_SHADER_STORAGE_BLOCKS 0x90D8 +#define GL_MAX_TESS_EVALUATION_SHADER_STORAGE_BLOCKS 0x90D9 +#define GL_MAX_FRAGMENT_SHADER_STORAGE_BLOCKS 0x90DA +#define GL_MAX_COMPUTE_SHADER_STORAGE_BLOCKS 0x90DB +#define GL_MAX_COMBINED_SHADER_STORAGE_BLOCKS 0x90DC +#define GL_MAX_SHADER_STORAGE_BUFFER_BINDINGS 0x90DD +#define GL_MAX_SHADER_STORAGE_BLOCK_SIZE 0x90DE +#define GL_SHADER_STORAGE_BUFFER_OFFSET_ALIGNMENT 0x90DF + +typedef void (GLAPIENTRY * PFNGLSHADERSTORAGEBLOCKBINDINGPROC) (GLuint program, GLuint storageBlockIndex, GLuint storageBlockBinding); + +#define glShaderStorageBlockBinding GLEW_GET_FUN(__glewShaderStorageBlockBinding) + +#define GLEW_ARB_shader_storage_buffer_object GLEW_GET_VAR(__GLEW_ARB_shader_storage_buffer_object) + +#endif /* GL_ARB_shader_storage_buffer_object */ + +/* ------------------------ GL_ARB_shader_subroutine ----------------------- */ + +#ifndef GL_ARB_shader_subroutine +#define GL_ARB_shader_subroutine 1 + +#define GL_ACTIVE_SUBROUTINES 0x8DE5 +#define GL_ACTIVE_SUBROUTINE_UNIFORMS 0x8DE6 +#define GL_MAX_SUBROUTINES 0x8DE7 +#define GL_MAX_SUBROUTINE_UNIFORM_LOCATIONS 0x8DE8 +#define GL_ACTIVE_SUBROUTINE_UNIFORM_LOCATIONS 0x8E47 +#define GL_ACTIVE_SUBROUTINE_MAX_LENGTH 0x8E48 +#define GL_ACTIVE_SUBROUTINE_UNIFORM_MAX_LENGTH 0x8E49 +#define GL_NUM_COMPATIBLE_SUBROUTINES 0x8E4A +#define GL_COMPATIBLE_SUBROUTINES 0x8E4B + +typedef void (GLAPIENTRY * PFNGLGETACTIVESUBROUTINENAMEPROC) (GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei* length, GLchar *name); +typedef void (GLAPIENTRY * PFNGLGETACTIVESUBROUTINEUNIFORMNAMEPROC) (GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei* length, GLchar *name); +typedef void (GLAPIENTRY * PFNGLGETACTIVESUBROUTINEUNIFORMIVPROC) (GLuint program, GLenum shadertype, GLuint index, GLenum pname, GLint* values); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMSTAGEIVPROC) (GLuint program, GLenum shadertype, GLenum pname, GLint* values); +typedef GLuint (GLAPIENTRY * PFNGLGETSUBROUTINEINDEXPROC) (GLuint program, GLenum shadertype, const GLchar* name); +typedef GLint (GLAPIENTRY * PFNGLGETSUBROUTINEUNIFORMLOCATIONPROC) (GLuint program, GLenum shadertype, const GLchar* name); +typedef void (GLAPIENTRY * PFNGLGETUNIFORMSUBROUTINEUIVPROC) (GLenum shadertype, GLint location, GLuint* params); +typedef void (GLAPIENTRY * PFNGLUNIFORMSUBROUTINESUIVPROC) (GLenum shadertype, GLsizei count, const GLuint* indices); + +#define glGetActiveSubroutineName GLEW_GET_FUN(__glewGetActiveSubroutineName) +#define glGetActiveSubroutineUniformName GLEW_GET_FUN(__glewGetActiveSubroutineUniformName) +#define glGetActiveSubroutineUniformiv GLEW_GET_FUN(__glewGetActiveSubroutineUniformiv) +#define glGetProgramStageiv GLEW_GET_FUN(__glewGetProgramStageiv) +#define glGetSubroutineIndex GLEW_GET_FUN(__glewGetSubroutineIndex) +#define glGetSubroutineUniformLocation GLEW_GET_FUN(__glewGetSubroutineUniformLocation) +#define glGetUniformSubroutineuiv GLEW_GET_FUN(__glewGetUniformSubroutineuiv) +#define glUniformSubroutinesuiv GLEW_GET_FUN(__glewUniformSubroutinesuiv) + +#define GLEW_ARB_shader_subroutine GLEW_GET_VAR(__GLEW_ARB_shader_subroutine) + +#endif /* GL_ARB_shader_subroutine */ + +/* ----------------------- GL_ARB_shader_texture_lod ----------------------- */ + +#ifndef GL_ARB_shader_texture_lod +#define GL_ARB_shader_texture_lod 1 + +#define GLEW_ARB_shader_texture_lod GLEW_GET_VAR(__GLEW_ARB_shader_texture_lod) + +#endif /* GL_ARB_shader_texture_lod */ + +/* ---------------------- GL_ARB_shading_language_100 ---------------------- */ + +#ifndef GL_ARB_shading_language_100 +#define GL_ARB_shading_language_100 1 + +#define GL_SHADING_LANGUAGE_VERSION_ARB 0x8B8C + +#define GLEW_ARB_shading_language_100 GLEW_GET_VAR(__GLEW_ARB_shading_language_100) + +#endif /* GL_ARB_shading_language_100 */ + +/* -------------------- GL_ARB_shading_language_420pack -------------------- */ + +#ifndef GL_ARB_shading_language_420pack +#define GL_ARB_shading_language_420pack 1 + +#define GLEW_ARB_shading_language_420pack GLEW_GET_VAR(__GLEW_ARB_shading_language_420pack) + +#endif /* GL_ARB_shading_language_420pack */ + +/* -------------------- GL_ARB_shading_language_include -------------------- */ + +#ifndef GL_ARB_shading_language_include +#define GL_ARB_shading_language_include 1 + +#define GL_SHADER_INCLUDE_ARB 0x8DAE +#define GL_NAMED_STRING_LENGTH_ARB 0x8DE9 +#define GL_NAMED_STRING_TYPE_ARB 0x8DEA + +typedef void (GLAPIENTRY * PFNGLCOMPILESHADERINCLUDEARBPROC) (GLuint shader, GLsizei count, const GLchar* const *path, const GLint *length); +typedef void (GLAPIENTRY * PFNGLDELETENAMEDSTRINGARBPROC) (GLint namelen, const GLchar* name); +typedef void (GLAPIENTRY * PFNGLGETNAMEDSTRINGARBPROC) (GLint namelen, const GLchar* name, GLsizei bufSize, GLint *stringlen, GLchar *string); +typedef void (GLAPIENTRY * PFNGLGETNAMEDSTRINGIVARBPROC) (GLint namelen, const GLchar* name, GLenum pname, GLint *params); +typedef GLboolean (GLAPIENTRY * PFNGLISNAMEDSTRINGARBPROC) (GLint namelen, const GLchar* name); +typedef void (GLAPIENTRY * PFNGLNAMEDSTRINGARBPROC) (GLenum type, GLint namelen, const GLchar* name, GLint stringlen, const GLchar *string); + +#define glCompileShaderIncludeARB GLEW_GET_FUN(__glewCompileShaderIncludeARB) +#define glDeleteNamedStringARB GLEW_GET_FUN(__glewDeleteNamedStringARB) +#define glGetNamedStringARB GLEW_GET_FUN(__glewGetNamedStringARB) +#define glGetNamedStringivARB GLEW_GET_FUN(__glewGetNamedStringivARB) +#define glIsNamedStringARB GLEW_GET_FUN(__glewIsNamedStringARB) +#define glNamedStringARB GLEW_GET_FUN(__glewNamedStringARB) + +#define GLEW_ARB_shading_language_include GLEW_GET_VAR(__GLEW_ARB_shading_language_include) + +#endif /* GL_ARB_shading_language_include */ + +/* -------------------- GL_ARB_shading_language_packing -------------------- */ + +#ifndef GL_ARB_shading_language_packing +#define GL_ARB_shading_language_packing 1 + +#define GLEW_ARB_shading_language_packing GLEW_GET_VAR(__GLEW_ARB_shading_language_packing) + +#endif /* GL_ARB_shading_language_packing */ + +/* ----------------------------- GL_ARB_shadow ----------------------------- */ + +#ifndef GL_ARB_shadow +#define GL_ARB_shadow 1 + +#define GL_TEXTURE_COMPARE_MODE_ARB 0x884C +#define GL_TEXTURE_COMPARE_FUNC_ARB 0x884D +#define GL_COMPARE_R_TO_TEXTURE_ARB 0x884E + +#define GLEW_ARB_shadow GLEW_GET_VAR(__GLEW_ARB_shadow) + +#endif /* GL_ARB_shadow */ + +/* ------------------------- GL_ARB_shadow_ambient ------------------------- */ + +#ifndef GL_ARB_shadow_ambient +#define GL_ARB_shadow_ambient 1 + +#define GL_TEXTURE_COMPARE_FAIL_VALUE_ARB 0x80BF + +#define GLEW_ARB_shadow_ambient GLEW_GET_VAR(__GLEW_ARB_shadow_ambient) + +#endif /* GL_ARB_shadow_ambient */ + +/* ------------------------- GL_ARB_sparse_texture ------------------------- */ + +#ifndef GL_ARB_sparse_texture +#define GL_ARB_sparse_texture 1 + +#define GL_VIRTUAL_PAGE_SIZE_X_ARB 0x9195 +#define GL_VIRTUAL_PAGE_SIZE_Y_ARB 0x9196 +#define GL_VIRTUAL_PAGE_SIZE_Z_ARB 0x9197 +#define GL_MAX_SPARSE_TEXTURE_SIZE_ARB 0x9198 +#define GL_MAX_SPARSE_3D_TEXTURE_SIZE_ARB 0x9199 +#define GL_MAX_SPARSE_ARRAY_TEXTURE_LAYERS_ARB 0x919A +#define GL_TEXTURE_SPARSE_ARB 0x91A6 +#define GL_VIRTUAL_PAGE_SIZE_INDEX_ARB 0x91A7 +#define GL_NUM_VIRTUAL_PAGE_SIZES_ARB 0x91A8 +#define GL_SPARSE_TEXTURE_FULL_ARRAY_CUBE_MIPMAPS_ARB 0x91A9 +#define GL_NUM_SPARSE_LEVELS_ARB 0x91AA + +typedef void (GLAPIENTRY * PFNGLTEXPAGECOMMITMENTARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLboolean commit); +typedef void (GLAPIENTRY * PFNGLTEXTUREPAGECOMMITMENTEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLboolean commit); + +#define glTexPageCommitmentARB GLEW_GET_FUN(__glewTexPageCommitmentARB) +#define glTexturePageCommitmentEXT GLEW_GET_FUN(__glewTexturePageCommitmentEXT) + +#define GLEW_ARB_sparse_texture GLEW_GET_VAR(__GLEW_ARB_sparse_texture) + +#endif /* GL_ARB_sparse_texture */ + +/* ------------------------ GL_ARB_stencil_texturing ----------------------- */ + +#ifndef GL_ARB_stencil_texturing +#define GL_ARB_stencil_texturing 1 + +#define GL_DEPTH_STENCIL_TEXTURE_MODE 0x90EA + +#define GLEW_ARB_stencil_texturing GLEW_GET_VAR(__GLEW_ARB_stencil_texturing) + +#endif /* GL_ARB_stencil_texturing */ + +/* ------------------------------ GL_ARB_sync ------------------------------ */ + +#ifndef GL_ARB_sync +#define GL_ARB_sync 1 + +#define GL_SYNC_FLUSH_COMMANDS_BIT 0x00000001 +#define GL_MAX_SERVER_WAIT_TIMEOUT 0x9111 +#define GL_OBJECT_TYPE 0x9112 +#define GL_SYNC_CONDITION 0x9113 +#define GL_SYNC_STATUS 0x9114 +#define GL_SYNC_FLAGS 0x9115 +#define GL_SYNC_FENCE 0x9116 +#define GL_SYNC_GPU_COMMANDS_COMPLETE 0x9117 +#define GL_UNSIGNALED 0x9118 +#define GL_SIGNALED 0x9119 +#define GL_ALREADY_SIGNALED 0x911A +#define GL_TIMEOUT_EXPIRED 0x911B +#define GL_CONDITION_SATISFIED 0x911C +#define GL_WAIT_FAILED 0x911D +#define GL_TIMEOUT_IGNORED 0xFFFFFFFFFFFFFFFF + +typedef GLenum (GLAPIENTRY * PFNGLCLIENTWAITSYNCPROC) (GLsync GLsync,GLbitfield flags,GLuint64 timeout); +typedef void (GLAPIENTRY * PFNGLDELETESYNCPROC) (GLsync GLsync); +typedef GLsync (GLAPIENTRY * PFNGLFENCESYNCPROC) (GLenum condition,GLbitfield flags); +typedef void (GLAPIENTRY * PFNGLGETINTEGER64VPROC) (GLenum pname, GLint64* params); +typedef void (GLAPIENTRY * PFNGLGETSYNCIVPROC) (GLsync GLsync,GLenum pname,GLsizei bufSize,GLsizei* length, GLint *values); +typedef GLboolean (GLAPIENTRY * PFNGLISSYNCPROC) (GLsync GLsync); +typedef void (GLAPIENTRY * PFNGLWAITSYNCPROC) (GLsync GLsync,GLbitfield flags,GLuint64 timeout); + +#define glClientWaitSync GLEW_GET_FUN(__glewClientWaitSync) +#define glDeleteSync GLEW_GET_FUN(__glewDeleteSync) +#define glFenceSync GLEW_GET_FUN(__glewFenceSync) +#define glGetInteger64v GLEW_GET_FUN(__glewGetInteger64v) +#define glGetSynciv GLEW_GET_FUN(__glewGetSynciv) +#define glIsSync GLEW_GET_FUN(__glewIsSync) +#define glWaitSync GLEW_GET_FUN(__glewWaitSync) + +#define GLEW_ARB_sync GLEW_GET_VAR(__GLEW_ARB_sync) + +#endif /* GL_ARB_sync */ + +/* ----------------------- GL_ARB_tessellation_shader ---------------------- */ + +#ifndef GL_ARB_tessellation_shader +#define GL_ARB_tessellation_shader 1 + +#define GL_PATCHES 0xE +#define GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_CONTROL_SHADER 0x84F0 +#define GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_EVALUATION_SHADER 0x84F1 +#define GL_MAX_TESS_CONTROL_INPUT_COMPONENTS 0x886C +#define GL_MAX_TESS_EVALUATION_INPUT_COMPONENTS 0x886D +#define GL_MAX_COMBINED_TESS_CONTROL_UNIFORM_COMPONENTS 0x8E1E +#define GL_MAX_COMBINED_TESS_EVALUATION_UNIFORM_COMPONENTS 0x8E1F +#define GL_PATCH_VERTICES 0x8E72 +#define GL_PATCH_DEFAULT_INNER_LEVEL 0x8E73 +#define GL_PATCH_DEFAULT_OUTER_LEVEL 0x8E74 +#define GL_TESS_CONTROL_OUTPUT_VERTICES 0x8E75 +#define GL_TESS_GEN_MODE 0x8E76 +#define GL_TESS_GEN_SPACING 0x8E77 +#define GL_TESS_GEN_VERTEX_ORDER 0x8E78 +#define GL_TESS_GEN_POINT_MODE 0x8E79 +#define GL_ISOLINES 0x8E7A +#define GL_FRACTIONAL_ODD 0x8E7B +#define GL_FRACTIONAL_EVEN 0x8E7C +#define GL_MAX_PATCH_VERTICES 0x8E7D +#define GL_MAX_TESS_GEN_LEVEL 0x8E7E +#define GL_MAX_TESS_CONTROL_UNIFORM_COMPONENTS 0x8E7F +#define GL_MAX_TESS_EVALUATION_UNIFORM_COMPONENTS 0x8E80 +#define GL_MAX_TESS_CONTROL_TEXTURE_IMAGE_UNITS 0x8E81 +#define GL_MAX_TESS_EVALUATION_TEXTURE_IMAGE_UNITS 0x8E82 +#define GL_MAX_TESS_CONTROL_OUTPUT_COMPONENTS 0x8E83 +#define GL_MAX_TESS_PATCH_COMPONENTS 0x8E84 +#define GL_MAX_TESS_CONTROL_TOTAL_OUTPUT_COMPONENTS 0x8E85 +#define GL_MAX_TESS_EVALUATION_OUTPUT_COMPONENTS 0x8E86 +#define GL_TESS_EVALUATION_SHADER 0x8E87 +#define GL_TESS_CONTROL_SHADER 0x8E88 +#define GL_MAX_TESS_CONTROL_UNIFORM_BLOCKS 0x8E89 +#define GL_MAX_TESS_EVALUATION_UNIFORM_BLOCKS 0x8E8A + +typedef void (GLAPIENTRY * PFNGLPATCHPARAMETERFVPROC) (GLenum pname, const GLfloat* values); +typedef void (GLAPIENTRY * PFNGLPATCHPARAMETERIPROC) (GLenum pname, GLint value); + +#define glPatchParameterfv GLEW_GET_FUN(__glewPatchParameterfv) +#define glPatchParameteri GLEW_GET_FUN(__glewPatchParameteri) + +#define GLEW_ARB_tessellation_shader GLEW_GET_VAR(__GLEW_ARB_tessellation_shader) + +#endif /* GL_ARB_tessellation_shader */ + +/* ---------------------- GL_ARB_texture_border_clamp ---------------------- */ + +#ifndef GL_ARB_texture_border_clamp +#define GL_ARB_texture_border_clamp 1 + +#define GL_CLAMP_TO_BORDER_ARB 0x812D + +#define GLEW_ARB_texture_border_clamp GLEW_GET_VAR(__GLEW_ARB_texture_border_clamp) + +#endif /* GL_ARB_texture_border_clamp */ + +/* ---------------------- GL_ARB_texture_buffer_object --------------------- */ + +#ifndef GL_ARB_texture_buffer_object +#define GL_ARB_texture_buffer_object 1 + +#define GL_TEXTURE_BUFFER_ARB 0x8C2A +#define GL_MAX_TEXTURE_BUFFER_SIZE_ARB 0x8C2B +#define GL_TEXTURE_BINDING_BUFFER_ARB 0x8C2C +#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING_ARB 0x8C2D +#define GL_TEXTURE_BUFFER_FORMAT_ARB 0x8C2E + +typedef void (GLAPIENTRY * PFNGLTEXBUFFERARBPROC) (GLenum target, GLenum internalformat, GLuint buffer); + +#define glTexBufferARB GLEW_GET_FUN(__glewTexBufferARB) + +#define GLEW_ARB_texture_buffer_object GLEW_GET_VAR(__GLEW_ARB_texture_buffer_object) + +#endif /* GL_ARB_texture_buffer_object */ + +/* ------------------- GL_ARB_texture_buffer_object_rgb32 ------------------ */ + +#ifndef GL_ARB_texture_buffer_object_rgb32 +#define GL_ARB_texture_buffer_object_rgb32 1 + +#define GLEW_ARB_texture_buffer_object_rgb32 GLEW_GET_VAR(__GLEW_ARB_texture_buffer_object_rgb32) + +#endif /* GL_ARB_texture_buffer_object_rgb32 */ + +/* ---------------------- GL_ARB_texture_buffer_range ---------------------- */ + +#ifndef GL_ARB_texture_buffer_range +#define GL_ARB_texture_buffer_range 1 + +#define GL_TEXTURE_BUFFER_OFFSET 0x919D +#define GL_TEXTURE_BUFFER_SIZE 0x919E +#define GL_TEXTURE_BUFFER_OFFSET_ALIGNMENT 0x919F + +typedef void (GLAPIENTRY * PFNGLTEXBUFFERRANGEPROC) (GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size); +typedef void (GLAPIENTRY * PFNGLTEXTUREBUFFERRANGEEXTPROC) (GLuint texture, GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size); + +#define glTexBufferRange GLEW_GET_FUN(__glewTexBufferRange) +#define glTextureBufferRangeEXT GLEW_GET_FUN(__glewTextureBufferRangeEXT) + +#define GLEW_ARB_texture_buffer_range GLEW_GET_VAR(__GLEW_ARB_texture_buffer_range) + +#endif /* GL_ARB_texture_buffer_range */ + +/* ----------------------- GL_ARB_texture_compression ---------------------- */ + +#ifndef GL_ARB_texture_compression +#define GL_ARB_texture_compression 1 + +#define GL_COMPRESSED_ALPHA_ARB 0x84E9 +#define GL_COMPRESSED_LUMINANCE_ARB 0x84EA +#define GL_COMPRESSED_LUMINANCE_ALPHA_ARB 0x84EB +#define GL_COMPRESSED_INTENSITY_ARB 0x84EC +#define GL_COMPRESSED_RGB_ARB 0x84ED +#define GL_COMPRESSED_RGBA_ARB 0x84EE +#define GL_TEXTURE_COMPRESSION_HINT_ARB 0x84EF +#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB 0x86A0 +#define GL_TEXTURE_COMPRESSED_ARB 0x86A1 +#define GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A2 +#define GL_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A3 + +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXIMAGE1DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXIMAGE2DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXIMAGE3DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLGETCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GLint lod, GLvoid *img); + +#define glCompressedTexImage1DARB GLEW_GET_FUN(__glewCompressedTexImage1DARB) +#define glCompressedTexImage2DARB GLEW_GET_FUN(__glewCompressedTexImage2DARB) +#define glCompressedTexImage3DARB GLEW_GET_FUN(__glewCompressedTexImage3DARB) +#define glCompressedTexSubImage1DARB GLEW_GET_FUN(__glewCompressedTexSubImage1DARB) +#define glCompressedTexSubImage2DARB GLEW_GET_FUN(__glewCompressedTexSubImage2DARB) +#define glCompressedTexSubImage3DARB GLEW_GET_FUN(__glewCompressedTexSubImage3DARB) +#define glGetCompressedTexImageARB GLEW_GET_FUN(__glewGetCompressedTexImageARB) + +#define GLEW_ARB_texture_compression GLEW_GET_VAR(__GLEW_ARB_texture_compression) + +#endif /* GL_ARB_texture_compression */ + +/* -------------------- GL_ARB_texture_compression_bptc -------------------- */ + +#ifndef GL_ARB_texture_compression_bptc +#define GL_ARB_texture_compression_bptc 1 + +#define GL_COMPRESSED_RGBA_BPTC_UNORM_ARB 0x8E8C +#define GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_ARB 0x8E8D +#define GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_ARB 0x8E8E +#define GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_ARB 0x8E8F + +#define GLEW_ARB_texture_compression_bptc GLEW_GET_VAR(__GLEW_ARB_texture_compression_bptc) + +#endif /* GL_ARB_texture_compression_bptc */ + +/* -------------------- GL_ARB_texture_compression_rgtc -------------------- */ + +#ifndef GL_ARB_texture_compression_rgtc +#define GL_ARB_texture_compression_rgtc 1 + +#define GL_COMPRESSED_RED_RGTC1 0x8DBB +#define GL_COMPRESSED_SIGNED_RED_RGTC1 0x8DBC +#define GL_COMPRESSED_RG_RGTC2 0x8DBD +#define GL_COMPRESSED_SIGNED_RG_RGTC2 0x8DBE + +#define GLEW_ARB_texture_compression_rgtc GLEW_GET_VAR(__GLEW_ARB_texture_compression_rgtc) + +#endif /* GL_ARB_texture_compression_rgtc */ + +/* ------------------------ GL_ARB_texture_cube_map ------------------------ */ + +#ifndef GL_ARB_texture_cube_map +#define GL_ARB_texture_cube_map 1 + +#define GL_NORMAL_MAP_ARB 0x8511 +#define GL_REFLECTION_MAP_ARB 0x8512 +#define GL_TEXTURE_CUBE_MAP_ARB 0x8513 +#define GL_TEXTURE_BINDING_CUBE_MAP_ARB 0x8514 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB 0x8515 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB 0x8516 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB 0x8517 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB 0x8518 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB 0x8519 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB 0x851A +#define GL_PROXY_TEXTURE_CUBE_MAP_ARB 0x851B +#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB 0x851C + +#define GLEW_ARB_texture_cube_map GLEW_GET_VAR(__GLEW_ARB_texture_cube_map) + +#endif /* GL_ARB_texture_cube_map */ + +/* --------------------- GL_ARB_texture_cube_map_array --------------------- */ + +#ifndef GL_ARB_texture_cube_map_array +#define GL_ARB_texture_cube_map_array 1 + +#define GL_TEXTURE_CUBE_MAP_ARRAY_ARB 0x9009 +#define GL_TEXTURE_BINDING_CUBE_MAP_ARRAY_ARB 0x900A +#define GL_PROXY_TEXTURE_CUBE_MAP_ARRAY_ARB 0x900B +#define GL_SAMPLER_CUBE_MAP_ARRAY_ARB 0x900C +#define GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW_ARB 0x900D +#define GL_INT_SAMPLER_CUBE_MAP_ARRAY_ARB 0x900E +#define GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY_ARB 0x900F + +#define GLEW_ARB_texture_cube_map_array GLEW_GET_VAR(__GLEW_ARB_texture_cube_map_array) + +#endif /* GL_ARB_texture_cube_map_array */ + +/* ------------------------- GL_ARB_texture_env_add ------------------------ */ + +#ifndef GL_ARB_texture_env_add +#define GL_ARB_texture_env_add 1 + +#define GLEW_ARB_texture_env_add GLEW_GET_VAR(__GLEW_ARB_texture_env_add) + +#endif /* GL_ARB_texture_env_add */ + +/* ----------------------- GL_ARB_texture_env_combine ---------------------- */ + +#ifndef GL_ARB_texture_env_combine +#define GL_ARB_texture_env_combine 1 + +#define GL_SUBTRACT_ARB 0x84E7 +#define GL_COMBINE_ARB 0x8570 +#define GL_COMBINE_RGB_ARB 0x8571 +#define GL_COMBINE_ALPHA_ARB 0x8572 +#define GL_RGB_SCALE_ARB 0x8573 +#define GL_ADD_SIGNED_ARB 0x8574 +#define GL_INTERPOLATE_ARB 0x8575 +#define GL_CONSTANT_ARB 0x8576 +#define GL_PRIMARY_COLOR_ARB 0x8577 +#define GL_PREVIOUS_ARB 0x8578 +#define GL_SOURCE0_RGB_ARB 0x8580 +#define GL_SOURCE1_RGB_ARB 0x8581 +#define GL_SOURCE2_RGB_ARB 0x8582 +#define GL_SOURCE0_ALPHA_ARB 0x8588 +#define GL_SOURCE1_ALPHA_ARB 0x8589 +#define GL_SOURCE2_ALPHA_ARB 0x858A +#define GL_OPERAND0_RGB_ARB 0x8590 +#define GL_OPERAND1_RGB_ARB 0x8591 +#define GL_OPERAND2_RGB_ARB 0x8592 +#define GL_OPERAND0_ALPHA_ARB 0x8598 +#define GL_OPERAND1_ALPHA_ARB 0x8599 +#define GL_OPERAND2_ALPHA_ARB 0x859A + +#define GLEW_ARB_texture_env_combine GLEW_GET_VAR(__GLEW_ARB_texture_env_combine) + +#endif /* GL_ARB_texture_env_combine */ + +/* ---------------------- GL_ARB_texture_env_crossbar ---------------------- */ + +#ifndef GL_ARB_texture_env_crossbar +#define GL_ARB_texture_env_crossbar 1 + +#define GLEW_ARB_texture_env_crossbar GLEW_GET_VAR(__GLEW_ARB_texture_env_crossbar) + +#endif /* GL_ARB_texture_env_crossbar */ + +/* ------------------------ GL_ARB_texture_env_dot3 ------------------------ */ + +#ifndef GL_ARB_texture_env_dot3 +#define GL_ARB_texture_env_dot3 1 + +#define GL_DOT3_RGB_ARB 0x86AE +#define GL_DOT3_RGBA_ARB 0x86AF + +#define GLEW_ARB_texture_env_dot3 GLEW_GET_VAR(__GLEW_ARB_texture_env_dot3) + +#endif /* GL_ARB_texture_env_dot3 */ + +/* -------------------------- GL_ARB_texture_float ------------------------- */ + +#ifndef GL_ARB_texture_float +#define GL_ARB_texture_float 1 + +#define GL_RGBA32F_ARB 0x8814 +#define GL_RGB32F_ARB 0x8815 +#define GL_ALPHA32F_ARB 0x8816 +#define GL_INTENSITY32F_ARB 0x8817 +#define GL_LUMINANCE32F_ARB 0x8818 +#define GL_LUMINANCE_ALPHA32F_ARB 0x8819 +#define GL_RGBA16F_ARB 0x881A +#define GL_RGB16F_ARB 0x881B +#define GL_ALPHA16F_ARB 0x881C +#define GL_INTENSITY16F_ARB 0x881D +#define GL_LUMINANCE16F_ARB 0x881E +#define GL_LUMINANCE_ALPHA16F_ARB 0x881F +#define GL_TEXTURE_RED_TYPE_ARB 0x8C10 +#define GL_TEXTURE_GREEN_TYPE_ARB 0x8C11 +#define GL_TEXTURE_BLUE_TYPE_ARB 0x8C12 +#define GL_TEXTURE_ALPHA_TYPE_ARB 0x8C13 +#define GL_TEXTURE_LUMINANCE_TYPE_ARB 0x8C14 +#define GL_TEXTURE_INTENSITY_TYPE_ARB 0x8C15 +#define GL_TEXTURE_DEPTH_TYPE_ARB 0x8C16 +#define GL_UNSIGNED_NORMALIZED_ARB 0x8C17 + +#define GLEW_ARB_texture_float GLEW_GET_VAR(__GLEW_ARB_texture_float) + +#endif /* GL_ARB_texture_float */ + +/* ------------------------- GL_ARB_texture_gather ------------------------- */ + +#ifndef GL_ARB_texture_gather +#define GL_ARB_texture_gather 1 + +#define GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET_ARB 0x8E5E +#define GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET_ARB 0x8E5F +#define GL_MAX_PROGRAM_TEXTURE_GATHER_COMPONENTS_ARB 0x8F9F + +#define GLEW_ARB_texture_gather GLEW_GET_VAR(__GLEW_ARB_texture_gather) + +#endif /* GL_ARB_texture_gather */ + +/* ------------------ GL_ARB_texture_mirror_clamp_to_edge ------------------ */ + +#ifndef GL_ARB_texture_mirror_clamp_to_edge +#define GL_ARB_texture_mirror_clamp_to_edge 1 + +#define GL_MIRROR_CLAMP_TO_EDGE 0x8743 + +#define GLEW_ARB_texture_mirror_clamp_to_edge GLEW_GET_VAR(__GLEW_ARB_texture_mirror_clamp_to_edge) + +#endif /* GL_ARB_texture_mirror_clamp_to_edge */ + +/* --------------------- GL_ARB_texture_mirrored_repeat -------------------- */ + +#ifndef GL_ARB_texture_mirrored_repeat +#define GL_ARB_texture_mirrored_repeat 1 + +#define GL_MIRRORED_REPEAT_ARB 0x8370 + +#define GLEW_ARB_texture_mirrored_repeat GLEW_GET_VAR(__GLEW_ARB_texture_mirrored_repeat) + +#endif /* GL_ARB_texture_mirrored_repeat */ + +/* ----------------------- GL_ARB_texture_multisample ---------------------- */ + +#ifndef GL_ARB_texture_multisample +#define GL_ARB_texture_multisample 1 + +#define GL_SAMPLE_POSITION 0x8E50 +#define GL_SAMPLE_MASK 0x8E51 +#define GL_SAMPLE_MASK_VALUE 0x8E52 +#define GL_MAX_SAMPLE_MASK_WORDS 0x8E59 +#define GL_TEXTURE_2D_MULTISAMPLE 0x9100 +#define GL_PROXY_TEXTURE_2D_MULTISAMPLE 0x9101 +#define GL_TEXTURE_2D_MULTISAMPLE_ARRAY 0x9102 +#define GL_PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY 0x9103 +#define GL_TEXTURE_BINDING_2D_MULTISAMPLE 0x9104 +#define GL_TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY 0x9105 +#define GL_TEXTURE_SAMPLES 0x9106 +#define GL_TEXTURE_FIXED_SAMPLE_LOCATIONS 0x9107 +#define GL_SAMPLER_2D_MULTISAMPLE 0x9108 +#define GL_INT_SAMPLER_2D_MULTISAMPLE 0x9109 +#define GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE 0x910A +#define GL_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910B +#define GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910C +#define GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910D +#define GL_MAX_COLOR_TEXTURE_SAMPLES 0x910E +#define GL_MAX_DEPTH_TEXTURE_SAMPLES 0x910F +#define GL_MAX_INTEGER_SAMPLES 0x9110 + +typedef void (GLAPIENTRY * PFNGLGETMULTISAMPLEFVPROC) (GLenum pname, GLuint index, GLfloat* val); +typedef void (GLAPIENTRY * PFNGLSAMPLEMASKIPROC) (GLuint index, GLbitfield mask); +typedef void (GLAPIENTRY * PFNGLTEXIMAGE2DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLint internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); +typedef void (GLAPIENTRY * PFNGLTEXIMAGE3DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); + +#define glGetMultisamplefv GLEW_GET_FUN(__glewGetMultisamplefv) +#define glSampleMaski GLEW_GET_FUN(__glewSampleMaski) +#define glTexImage2DMultisample GLEW_GET_FUN(__glewTexImage2DMultisample) +#define glTexImage3DMultisample GLEW_GET_FUN(__glewTexImage3DMultisample) + +#define GLEW_ARB_texture_multisample GLEW_GET_VAR(__GLEW_ARB_texture_multisample) + +#endif /* GL_ARB_texture_multisample */ + +/* -------------------- GL_ARB_texture_non_power_of_two -------------------- */ + +#ifndef GL_ARB_texture_non_power_of_two +#define GL_ARB_texture_non_power_of_two 1 + +#define GLEW_ARB_texture_non_power_of_two GLEW_GET_VAR(__GLEW_ARB_texture_non_power_of_two) + +#endif /* GL_ARB_texture_non_power_of_two */ + +/* ---------------------- GL_ARB_texture_query_levels ---------------------- */ + +#ifndef GL_ARB_texture_query_levels +#define GL_ARB_texture_query_levels 1 + +#define GLEW_ARB_texture_query_levels GLEW_GET_VAR(__GLEW_ARB_texture_query_levels) + +#endif /* GL_ARB_texture_query_levels */ + +/* ------------------------ GL_ARB_texture_query_lod ----------------------- */ + +#ifndef GL_ARB_texture_query_lod +#define GL_ARB_texture_query_lod 1 + +#define GLEW_ARB_texture_query_lod GLEW_GET_VAR(__GLEW_ARB_texture_query_lod) + +#endif /* GL_ARB_texture_query_lod */ + +/* ------------------------ GL_ARB_texture_rectangle ----------------------- */ + +#ifndef GL_ARB_texture_rectangle +#define GL_ARB_texture_rectangle 1 + +#define GL_TEXTURE_RECTANGLE_ARB 0x84F5 +#define GL_TEXTURE_BINDING_RECTANGLE_ARB 0x84F6 +#define GL_PROXY_TEXTURE_RECTANGLE_ARB 0x84F7 +#define GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB 0x84F8 +#define GL_SAMPLER_2D_RECT_ARB 0x8B63 +#define GL_SAMPLER_2D_RECT_SHADOW_ARB 0x8B64 + +#define GLEW_ARB_texture_rectangle GLEW_GET_VAR(__GLEW_ARB_texture_rectangle) + +#endif /* GL_ARB_texture_rectangle */ + +/* --------------------------- GL_ARB_texture_rg --------------------------- */ + +#ifndef GL_ARB_texture_rg +#define GL_ARB_texture_rg 1 + +#define GL_COMPRESSED_RED 0x8225 +#define GL_COMPRESSED_RG 0x8226 +#define GL_RG 0x8227 +#define GL_RG_INTEGER 0x8228 +#define GL_R8 0x8229 +#define GL_R16 0x822A +#define GL_RG8 0x822B +#define GL_RG16 0x822C +#define GL_R16F 0x822D +#define GL_R32F 0x822E +#define GL_RG16F 0x822F +#define GL_RG32F 0x8230 +#define GL_R8I 0x8231 +#define GL_R8UI 0x8232 +#define GL_R16I 0x8233 +#define GL_R16UI 0x8234 +#define GL_R32I 0x8235 +#define GL_R32UI 0x8236 +#define GL_RG8I 0x8237 +#define GL_RG8UI 0x8238 +#define GL_RG16I 0x8239 +#define GL_RG16UI 0x823A +#define GL_RG32I 0x823B +#define GL_RG32UI 0x823C + +#define GLEW_ARB_texture_rg GLEW_GET_VAR(__GLEW_ARB_texture_rg) + +#endif /* GL_ARB_texture_rg */ + +/* ----------------------- GL_ARB_texture_rgb10_a2ui ----------------------- */ + +#ifndef GL_ARB_texture_rgb10_a2ui +#define GL_ARB_texture_rgb10_a2ui 1 + +#define GL_RGB10_A2UI 0x906F + +#define GLEW_ARB_texture_rgb10_a2ui GLEW_GET_VAR(__GLEW_ARB_texture_rgb10_a2ui) + +#endif /* GL_ARB_texture_rgb10_a2ui */ + +/* ------------------------ GL_ARB_texture_stencil8 ------------------------ */ + +#ifndef GL_ARB_texture_stencil8 +#define GL_ARB_texture_stencil8 1 + +#define GL_STENCIL_INDEX 0x1901 +#define GL_STENCIL_INDEX8 0x8D48 + +#define GLEW_ARB_texture_stencil8 GLEW_GET_VAR(__GLEW_ARB_texture_stencil8) + +#endif /* GL_ARB_texture_stencil8 */ + +/* ------------------------- GL_ARB_texture_storage ------------------------ */ + +#ifndef GL_ARB_texture_storage +#define GL_ARB_texture_storage 1 + +#define GL_TEXTURE_IMMUTABLE_FORMAT 0x912F + +typedef void (GLAPIENTRY * PFNGLTEXSTORAGE1DPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width); +typedef void (GLAPIENTRY * PFNGLTEXSTORAGE2DPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLTEXSTORAGE3DPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); +typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGE1DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width); +typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGE2DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGE3DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); + +#define glTexStorage1D GLEW_GET_FUN(__glewTexStorage1D) +#define glTexStorage2D GLEW_GET_FUN(__glewTexStorage2D) +#define glTexStorage3D GLEW_GET_FUN(__glewTexStorage3D) +#define glTextureStorage1DEXT GLEW_GET_FUN(__glewTextureStorage1DEXT) +#define glTextureStorage2DEXT GLEW_GET_FUN(__glewTextureStorage2DEXT) +#define glTextureStorage3DEXT GLEW_GET_FUN(__glewTextureStorage3DEXT) + +#define GLEW_ARB_texture_storage GLEW_GET_VAR(__GLEW_ARB_texture_storage) + +#endif /* GL_ARB_texture_storage */ + +/* ------------------- GL_ARB_texture_storage_multisample ------------------ */ + +#ifndef GL_ARB_texture_storage_multisample +#define GL_ARB_texture_storage_multisample 1 + +typedef void (GLAPIENTRY * PFNGLTEXSTORAGE2DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); +typedef void (GLAPIENTRY * PFNGLTEXSTORAGE3DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); +typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGE2DMULTISAMPLEEXTPROC) (GLuint texture, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); +typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGE3DMULTISAMPLEEXTPROC) (GLuint texture, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); + +#define glTexStorage2DMultisample GLEW_GET_FUN(__glewTexStorage2DMultisample) +#define glTexStorage3DMultisample GLEW_GET_FUN(__glewTexStorage3DMultisample) +#define glTextureStorage2DMultisampleEXT GLEW_GET_FUN(__glewTextureStorage2DMultisampleEXT) +#define glTextureStorage3DMultisampleEXT GLEW_GET_FUN(__glewTextureStorage3DMultisampleEXT) + +#define GLEW_ARB_texture_storage_multisample GLEW_GET_VAR(__GLEW_ARB_texture_storage_multisample) + +#endif /* GL_ARB_texture_storage_multisample */ + +/* ------------------------- GL_ARB_texture_swizzle ------------------------ */ + +#ifndef GL_ARB_texture_swizzle +#define GL_ARB_texture_swizzle 1 + +#define GL_TEXTURE_SWIZZLE_R 0x8E42 +#define GL_TEXTURE_SWIZZLE_G 0x8E43 +#define GL_TEXTURE_SWIZZLE_B 0x8E44 +#define GL_TEXTURE_SWIZZLE_A 0x8E45 +#define GL_TEXTURE_SWIZZLE_RGBA 0x8E46 + +#define GLEW_ARB_texture_swizzle GLEW_GET_VAR(__GLEW_ARB_texture_swizzle) + +#endif /* GL_ARB_texture_swizzle */ + +/* -------------------------- GL_ARB_texture_view -------------------------- */ + +#ifndef GL_ARB_texture_view +#define GL_ARB_texture_view 1 + +#define GL_TEXTURE_VIEW_MIN_LEVEL 0x82DB +#define GL_TEXTURE_VIEW_NUM_LEVELS 0x82DC +#define GL_TEXTURE_VIEW_MIN_LAYER 0x82DD +#define GL_TEXTURE_VIEW_NUM_LAYERS 0x82DE +#define GL_TEXTURE_IMMUTABLE_LEVELS 0x82DF + +typedef void (GLAPIENTRY * PFNGLTEXTUREVIEWPROC) (GLuint texture, GLenum target, GLuint origtexture, GLenum internalformat, GLuint minlevel, GLuint numlevels, GLuint minlayer, GLuint numlayers); + +#define glTextureView GLEW_GET_FUN(__glewTextureView) + +#define GLEW_ARB_texture_view GLEW_GET_VAR(__GLEW_ARB_texture_view) + +#endif /* GL_ARB_texture_view */ + +/* --------------------------- GL_ARB_timer_query -------------------------- */ + +#ifndef GL_ARB_timer_query +#define GL_ARB_timer_query 1 + +#define GL_TIME_ELAPSED 0x88BF +#define GL_TIMESTAMP 0x8E28 + +typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTI64VPROC) (GLuint id, GLenum pname, GLint64* params); +typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTUI64VPROC) (GLuint id, GLenum pname, GLuint64* params); +typedef void (GLAPIENTRY * PFNGLQUERYCOUNTERPROC) (GLuint id, GLenum target); + +#define glGetQueryObjecti64v GLEW_GET_FUN(__glewGetQueryObjecti64v) +#define glGetQueryObjectui64v GLEW_GET_FUN(__glewGetQueryObjectui64v) +#define glQueryCounter GLEW_GET_FUN(__glewQueryCounter) + +#define GLEW_ARB_timer_query GLEW_GET_VAR(__GLEW_ARB_timer_query) + +#endif /* GL_ARB_timer_query */ + +/* ----------------------- GL_ARB_transform_feedback2 ---------------------- */ + +#ifndef GL_ARB_transform_feedback2 +#define GL_ARB_transform_feedback2 1 + +#define GL_TRANSFORM_FEEDBACK 0x8E22 +#define GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED 0x8E23 +#define GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE 0x8E24 +#define GL_TRANSFORM_FEEDBACK_BINDING 0x8E25 + +typedef void (GLAPIENTRY * PFNGLBINDTRANSFORMFEEDBACKPROC) (GLenum target, GLuint id); +typedef void (GLAPIENTRY * PFNGLDELETETRANSFORMFEEDBACKSPROC) (GLsizei n, const GLuint* ids); +typedef void (GLAPIENTRY * PFNGLDRAWTRANSFORMFEEDBACKPROC) (GLenum mode, GLuint id); +typedef void (GLAPIENTRY * PFNGLGENTRANSFORMFEEDBACKSPROC) (GLsizei n, GLuint* ids); +typedef GLboolean (GLAPIENTRY * PFNGLISTRANSFORMFEEDBACKPROC) (GLuint id); +typedef void (GLAPIENTRY * PFNGLPAUSETRANSFORMFEEDBACKPROC) (void); +typedef void (GLAPIENTRY * PFNGLRESUMETRANSFORMFEEDBACKPROC) (void); + +#define glBindTransformFeedback GLEW_GET_FUN(__glewBindTransformFeedback) +#define glDeleteTransformFeedbacks GLEW_GET_FUN(__glewDeleteTransformFeedbacks) +#define glDrawTransformFeedback GLEW_GET_FUN(__glewDrawTransformFeedback) +#define glGenTransformFeedbacks GLEW_GET_FUN(__glewGenTransformFeedbacks) +#define glIsTransformFeedback GLEW_GET_FUN(__glewIsTransformFeedback) +#define glPauseTransformFeedback GLEW_GET_FUN(__glewPauseTransformFeedback) +#define glResumeTransformFeedback GLEW_GET_FUN(__glewResumeTransformFeedback) + +#define GLEW_ARB_transform_feedback2 GLEW_GET_VAR(__GLEW_ARB_transform_feedback2) + +#endif /* GL_ARB_transform_feedback2 */ + +/* ----------------------- GL_ARB_transform_feedback3 ---------------------- */ + +#ifndef GL_ARB_transform_feedback3 +#define GL_ARB_transform_feedback3 1 + +#define GL_MAX_TRANSFORM_FEEDBACK_BUFFERS 0x8E70 +#define GL_MAX_VERTEX_STREAMS 0x8E71 + +typedef void (GLAPIENTRY * PFNGLBEGINQUERYINDEXEDPROC) (GLenum target, GLuint index, GLuint id); +typedef void (GLAPIENTRY * PFNGLDRAWTRANSFORMFEEDBACKSTREAMPROC) (GLenum mode, GLuint id, GLuint stream); +typedef void (GLAPIENTRY * PFNGLENDQUERYINDEXEDPROC) (GLenum target, GLuint index); +typedef void (GLAPIENTRY * PFNGLGETQUERYINDEXEDIVPROC) (GLenum target, GLuint index, GLenum pname, GLint* params); + +#define glBeginQueryIndexed GLEW_GET_FUN(__glewBeginQueryIndexed) +#define glDrawTransformFeedbackStream GLEW_GET_FUN(__glewDrawTransformFeedbackStream) +#define glEndQueryIndexed GLEW_GET_FUN(__glewEndQueryIndexed) +#define glGetQueryIndexediv GLEW_GET_FUN(__glewGetQueryIndexediv) + +#define GLEW_ARB_transform_feedback3 GLEW_GET_VAR(__GLEW_ARB_transform_feedback3) + +#endif /* GL_ARB_transform_feedback3 */ + +/* ------------------ GL_ARB_transform_feedback_instanced ------------------ */ + +#ifndef GL_ARB_transform_feedback_instanced +#define GL_ARB_transform_feedback_instanced 1 + +typedef void (GLAPIENTRY * PFNGLDRAWTRANSFORMFEEDBACKINSTANCEDPROC) (GLenum mode, GLuint id, GLsizei primcount); +typedef void (GLAPIENTRY * PFNGLDRAWTRANSFORMFEEDBACKSTREAMINSTANCEDPROC) (GLenum mode, GLuint id, GLuint stream, GLsizei primcount); + +#define glDrawTransformFeedbackInstanced GLEW_GET_FUN(__glewDrawTransformFeedbackInstanced) +#define glDrawTransformFeedbackStreamInstanced GLEW_GET_FUN(__glewDrawTransformFeedbackStreamInstanced) + +#define GLEW_ARB_transform_feedback_instanced GLEW_GET_VAR(__GLEW_ARB_transform_feedback_instanced) + +#endif /* GL_ARB_transform_feedback_instanced */ + +/* ------------------------ GL_ARB_transpose_matrix ------------------------ */ + +#ifndef GL_ARB_transpose_matrix +#define GL_ARB_transpose_matrix 1 + +#define GL_TRANSPOSE_MODELVIEW_MATRIX_ARB 0x84E3 +#define GL_TRANSPOSE_PROJECTION_MATRIX_ARB 0x84E4 +#define GL_TRANSPOSE_TEXTURE_MATRIX_ARB 0x84E5 +#define GL_TRANSPOSE_COLOR_MATRIX_ARB 0x84E6 + +typedef void (GLAPIENTRY * PFNGLLOADTRANSPOSEMATRIXDARBPROC) (GLdouble m[16]); +typedef void (GLAPIENTRY * PFNGLLOADTRANSPOSEMATRIXFARBPROC) (GLfloat m[16]); +typedef void (GLAPIENTRY * PFNGLMULTTRANSPOSEMATRIXDARBPROC) (GLdouble m[16]); +typedef void (GLAPIENTRY * PFNGLMULTTRANSPOSEMATRIXFARBPROC) (GLfloat m[16]); + +#define glLoadTransposeMatrixdARB GLEW_GET_FUN(__glewLoadTransposeMatrixdARB) +#define glLoadTransposeMatrixfARB GLEW_GET_FUN(__glewLoadTransposeMatrixfARB) +#define glMultTransposeMatrixdARB GLEW_GET_FUN(__glewMultTransposeMatrixdARB) +#define glMultTransposeMatrixfARB GLEW_GET_FUN(__glewMultTransposeMatrixfARB) + +#define GLEW_ARB_transpose_matrix GLEW_GET_VAR(__GLEW_ARB_transpose_matrix) + +#endif /* GL_ARB_transpose_matrix */ + +/* ---------------------- GL_ARB_uniform_buffer_object --------------------- */ + +#ifndef GL_ARB_uniform_buffer_object +#define GL_ARB_uniform_buffer_object 1 + +#define GL_UNIFORM_BUFFER 0x8A11 +#define GL_UNIFORM_BUFFER_BINDING 0x8A28 +#define GL_UNIFORM_BUFFER_START 0x8A29 +#define GL_UNIFORM_BUFFER_SIZE 0x8A2A +#define GL_MAX_VERTEX_UNIFORM_BLOCKS 0x8A2B +#define GL_MAX_GEOMETRY_UNIFORM_BLOCKS 0x8A2C +#define GL_MAX_FRAGMENT_UNIFORM_BLOCKS 0x8A2D +#define GL_MAX_COMBINED_UNIFORM_BLOCKS 0x8A2E +#define GL_MAX_UNIFORM_BUFFER_BINDINGS 0x8A2F +#define GL_MAX_UNIFORM_BLOCK_SIZE 0x8A30 +#define GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS 0x8A31 +#define GL_MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS 0x8A32 +#define GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS 0x8A33 +#define GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT 0x8A34 +#define GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH 0x8A35 +#define GL_ACTIVE_UNIFORM_BLOCKS 0x8A36 +#define GL_UNIFORM_TYPE 0x8A37 +#define GL_UNIFORM_SIZE 0x8A38 +#define GL_UNIFORM_NAME_LENGTH 0x8A39 +#define GL_UNIFORM_BLOCK_INDEX 0x8A3A +#define GL_UNIFORM_OFFSET 0x8A3B +#define GL_UNIFORM_ARRAY_STRIDE 0x8A3C +#define GL_UNIFORM_MATRIX_STRIDE 0x8A3D +#define GL_UNIFORM_IS_ROW_MAJOR 0x8A3E +#define GL_UNIFORM_BLOCK_BINDING 0x8A3F +#define GL_UNIFORM_BLOCK_DATA_SIZE 0x8A40 +#define GL_UNIFORM_BLOCK_NAME_LENGTH 0x8A41 +#define GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS 0x8A42 +#define GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES 0x8A43 +#define GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER 0x8A44 +#define GL_UNIFORM_BLOCK_REFERENCED_BY_GEOMETRY_SHADER 0x8A45 +#define GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER 0x8A46 +#define GL_INVALID_INDEX 0xFFFFFFFF + +typedef void (GLAPIENTRY * PFNGLBINDBUFFERBASEPROC) (GLenum target, GLuint index, GLuint buffer); +typedef void (GLAPIENTRY * PFNGLBINDBUFFERRANGEPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); +typedef void (GLAPIENTRY * PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC) (GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei* length, GLchar* uniformBlockName); +typedef void (GLAPIENTRY * PFNGLGETACTIVEUNIFORMBLOCKIVPROC) (GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETACTIVEUNIFORMNAMEPROC) (GLuint program, GLuint uniformIndex, GLsizei bufSize, GLsizei* length, GLchar* uniformName); +typedef void (GLAPIENTRY * PFNGLGETACTIVEUNIFORMSIVPROC) (GLuint program, GLsizei uniformCount, const GLuint* uniformIndices, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETINTEGERI_VPROC) (GLenum target, GLuint index, GLint* data); +typedef GLuint (GLAPIENTRY * PFNGLGETUNIFORMBLOCKINDEXPROC) (GLuint program, const GLchar* uniformBlockName); +typedef void (GLAPIENTRY * PFNGLGETUNIFORMINDICESPROC) (GLuint program, GLsizei uniformCount, const GLchar** uniformNames, GLuint* uniformIndices); +typedef void (GLAPIENTRY * PFNGLUNIFORMBLOCKBINDINGPROC) (GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding); + +#define glBindBufferBase GLEW_GET_FUN(__glewBindBufferBase) +#define glBindBufferRange GLEW_GET_FUN(__glewBindBufferRange) +#define glGetActiveUniformBlockName GLEW_GET_FUN(__glewGetActiveUniformBlockName) +#define glGetActiveUniformBlockiv GLEW_GET_FUN(__glewGetActiveUniformBlockiv) +#define glGetActiveUniformName GLEW_GET_FUN(__glewGetActiveUniformName) +#define glGetActiveUniformsiv GLEW_GET_FUN(__glewGetActiveUniformsiv) +#define glGetIntegeri_v GLEW_GET_FUN(__glewGetIntegeri_v) +#define glGetUniformBlockIndex GLEW_GET_FUN(__glewGetUniformBlockIndex) +#define glGetUniformIndices GLEW_GET_FUN(__glewGetUniformIndices) +#define glUniformBlockBinding GLEW_GET_FUN(__glewUniformBlockBinding) + +#define GLEW_ARB_uniform_buffer_object GLEW_GET_VAR(__GLEW_ARB_uniform_buffer_object) + +#endif /* GL_ARB_uniform_buffer_object */ + +/* ------------------------ GL_ARB_vertex_array_bgra ----------------------- */ + +#ifndef GL_ARB_vertex_array_bgra +#define GL_ARB_vertex_array_bgra 1 + +#define GL_BGRA 0x80E1 + +#define GLEW_ARB_vertex_array_bgra GLEW_GET_VAR(__GLEW_ARB_vertex_array_bgra) + +#endif /* GL_ARB_vertex_array_bgra */ + +/* ----------------------- GL_ARB_vertex_array_object ---------------------- */ + +#ifndef GL_ARB_vertex_array_object +#define GL_ARB_vertex_array_object 1 + +#define GL_VERTEX_ARRAY_BINDING 0x85B5 + +typedef void (GLAPIENTRY * PFNGLBINDVERTEXARRAYPROC) (GLuint array); +typedef void (GLAPIENTRY * PFNGLDELETEVERTEXARRAYSPROC) (GLsizei n, const GLuint* arrays); +typedef void (GLAPIENTRY * PFNGLGENVERTEXARRAYSPROC) (GLsizei n, GLuint* arrays); +typedef GLboolean (GLAPIENTRY * PFNGLISVERTEXARRAYPROC) (GLuint array); + +#define glBindVertexArray GLEW_GET_FUN(__glewBindVertexArray) +#define glDeleteVertexArrays GLEW_GET_FUN(__glewDeleteVertexArrays) +#define glGenVertexArrays GLEW_GET_FUN(__glewGenVertexArrays) +#define glIsVertexArray GLEW_GET_FUN(__glewIsVertexArray) + +#define GLEW_ARB_vertex_array_object GLEW_GET_VAR(__GLEW_ARB_vertex_array_object) + +#endif /* GL_ARB_vertex_array_object */ + +/* ----------------------- GL_ARB_vertex_attrib_64bit ---------------------- */ + +#ifndef GL_ARB_vertex_attrib_64bit +#define GL_ARB_vertex_attrib_64bit 1 + +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBLDVPROC) (GLuint index, GLenum pname, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1DPROC) (GLuint index, GLdouble x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1DVPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL2DPROC) (GLuint index, GLdouble x, GLdouble y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL2DVPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL3DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL3DVPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL4DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL4DVPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBLPOINTERPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const void* pointer); + +#define glGetVertexAttribLdv GLEW_GET_FUN(__glewGetVertexAttribLdv) +#define glVertexAttribL1d GLEW_GET_FUN(__glewVertexAttribL1d) +#define glVertexAttribL1dv GLEW_GET_FUN(__glewVertexAttribL1dv) +#define glVertexAttribL2d GLEW_GET_FUN(__glewVertexAttribL2d) +#define glVertexAttribL2dv GLEW_GET_FUN(__glewVertexAttribL2dv) +#define glVertexAttribL3d GLEW_GET_FUN(__glewVertexAttribL3d) +#define glVertexAttribL3dv GLEW_GET_FUN(__glewVertexAttribL3dv) +#define glVertexAttribL4d GLEW_GET_FUN(__glewVertexAttribL4d) +#define glVertexAttribL4dv GLEW_GET_FUN(__glewVertexAttribL4dv) +#define glVertexAttribLPointer GLEW_GET_FUN(__glewVertexAttribLPointer) + +#define GLEW_ARB_vertex_attrib_64bit GLEW_GET_VAR(__GLEW_ARB_vertex_attrib_64bit) + +#endif /* GL_ARB_vertex_attrib_64bit */ + +/* ---------------------- GL_ARB_vertex_attrib_binding --------------------- */ + +#ifndef GL_ARB_vertex_attrib_binding +#define GL_ARB_vertex_attrib_binding 1 + +#define GL_VERTEX_ATTRIB_BINDING 0x82D4 +#define GL_VERTEX_ATTRIB_RELATIVE_OFFSET 0x82D5 +#define GL_VERTEX_BINDING_DIVISOR 0x82D6 +#define GL_VERTEX_BINDING_OFFSET 0x82D7 +#define GL_VERTEX_BINDING_STRIDE 0x82D8 +#define GL_MAX_VERTEX_ATTRIB_RELATIVE_OFFSET 0x82D9 +#define GL_MAX_VERTEX_ATTRIB_BINDINGS 0x82DA + +typedef void (GLAPIENTRY * PFNGLBINDVERTEXBUFFERPROC) (GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBBINDINGPROC) (GLuint attribindex, GLuint bindingindex); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBFORMATPROC) (GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBIFORMATPROC) (GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBLFORMATPROC) (GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); +typedef void (GLAPIENTRY * PFNGLVERTEXBINDINGDIVISORPROC) (GLuint bindingindex, GLuint divisor); + +#define glBindVertexBuffer GLEW_GET_FUN(__glewBindVertexBuffer) +#define glVertexAttribBinding GLEW_GET_FUN(__glewVertexAttribBinding) +#define glVertexAttribFormat GLEW_GET_FUN(__glewVertexAttribFormat) +#define glVertexAttribIFormat GLEW_GET_FUN(__glewVertexAttribIFormat) +#define glVertexAttribLFormat GLEW_GET_FUN(__glewVertexAttribLFormat) +#define glVertexBindingDivisor GLEW_GET_FUN(__glewVertexBindingDivisor) + +#define GLEW_ARB_vertex_attrib_binding GLEW_GET_VAR(__GLEW_ARB_vertex_attrib_binding) + +#endif /* GL_ARB_vertex_attrib_binding */ + +/* -------------------------- GL_ARB_vertex_blend -------------------------- */ + +#ifndef GL_ARB_vertex_blend +#define GL_ARB_vertex_blend 1 + +#define GL_MODELVIEW0_ARB 0x1700 +#define GL_MODELVIEW1_ARB 0x850A +#define GL_MAX_VERTEX_UNITS_ARB 0x86A4 +#define GL_ACTIVE_VERTEX_UNITS_ARB 0x86A5 +#define GL_WEIGHT_SUM_UNITY_ARB 0x86A6 +#define GL_VERTEX_BLEND_ARB 0x86A7 +#define GL_CURRENT_WEIGHT_ARB 0x86A8 +#define GL_WEIGHT_ARRAY_TYPE_ARB 0x86A9 +#define GL_WEIGHT_ARRAY_STRIDE_ARB 0x86AA +#define GL_WEIGHT_ARRAY_SIZE_ARB 0x86AB +#define GL_WEIGHT_ARRAY_POINTER_ARB 0x86AC +#define GL_WEIGHT_ARRAY_ARB 0x86AD +#define GL_MODELVIEW2_ARB 0x8722 +#define GL_MODELVIEW3_ARB 0x8723 +#define GL_MODELVIEW4_ARB 0x8724 +#define GL_MODELVIEW5_ARB 0x8725 +#define GL_MODELVIEW6_ARB 0x8726 +#define GL_MODELVIEW7_ARB 0x8727 +#define GL_MODELVIEW8_ARB 0x8728 +#define GL_MODELVIEW9_ARB 0x8729 +#define GL_MODELVIEW10_ARB 0x872A +#define GL_MODELVIEW11_ARB 0x872B +#define GL_MODELVIEW12_ARB 0x872C +#define GL_MODELVIEW13_ARB 0x872D +#define GL_MODELVIEW14_ARB 0x872E +#define GL_MODELVIEW15_ARB 0x872F +#define GL_MODELVIEW16_ARB 0x8730 +#define GL_MODELVIEW17_ARB 0x8731 +#define GL_MODELVIEW18_ARB 0x8732 +#define GL_MODELVIEW19_ARB 0x8733 +#define GL_MODELVIEW20_ARB 0x8734 +#define GL_MODELVIEW21_ARB 0x8735 +#define GL_MODELVIEW22_ARB 0x8736 +#define GL_MODELVIEW23_ARB 0x8737 +#define GL_MODELVIEW24_ARB 0x8738 +#define GL_MODELVIEW25_ARB 0x8739 +#define GL_MODELVIEW26_ARB 0x873A +#define GL_MODELVIEW27_ARB 0x873B +#define GL_MODELVIEW28_ARB 0x873C +#define GL_MODELVIEW29_ARB 0x873D +#define GL_MODELVIEW30_ARB 0x873E +#define GL_MODELVIEW31_ARB 0x873F + +typedef void (GLAPIENTRY * PFNGLVERTEXBLENDARBPROC) (GLint count); +typedef void (GLAPIENTRY * PFNGLWEIGHTPOINTERARBPROC) (GLint size, GLenum type, GLsizei stride, GLvoid *pointer); +typedef void (GLAPIENTRY * PFNGLWEIGHTBVARBPROC) (GLint size, GLbyte *weights); +typedef void (GLAPIENTRY * PFNGLWEIGHTDVARBPROC) (GLint size, GLdouble *weights); +typedef void (GLAPIENTRY * PFNGLWEIGHTFVARBPROC) (GLint size, GLfloat *weights); +typedef void (GLAPIENTRY * PFNGLWEIGHTIVARBPROC) (GLint size, GLint *weights); +typedef void (GLAPIENTRY * PFNGLWEIGHTSVARBPROC) (GLint size, GLshort *weights); +typedef void (GLAPIENTRY * PFNGLWEIGHTUBVARBPROC) (GLint size, GLubyte *weights); +typedef void (GLAPIENTRY * PFNGLWEIGHTUIVARBPROC) (GLint size, GLuint *weights); +typedef void (GLAPIENTRY * PFNGLWEIGHTUSVARBPROC) (GLint size, GLushort *weights); + +#define glVertexBlendARB GLEW_GET_FUN(__glewVertexBlendARB) +#define glWeightPointerARB GLEW_GET_FUN(__glewWeightPointerARB) +#define glWeightbvARB GLEW_GET_FUN(__glewWeightbvARB) +#define glWeightdvARB GLEW_GET_FUN(__glewWeightdvARB) +#define glWeightfvARB GLEW_GET_FUN(__glewWeightfvARB) +#define glWeightivARB GLEW_GET_FUN(__glewWeightivARB) +#define glWeightsvARB GLEW_GET_FUN(__glewWeightsvARB) +#define glWeightubvARB GLEW_GET_FUN(__glewWeightubvARB) +#define glWeightuivARB GLEW_GET_FUN(__glewWeightuivARB) +#define glWeightusvARB GLEW_GET_FUN(__glewWeightusvARB) + +#define GLEW_ARB_vertex_blend GLEW_GET_VAR(__GLEW_ARB_vertex_blend) + +#endif /* GL_ARB_vertex_blend */ + +/* ---------------------- GL_ARB_vertex_buffer_object ---------------------- */ + +#ifndef GL_ARB_vertex_buffer_object +#define GL_ARB_vertex_buffer_object 1 + +#define GL_BUFFER_SIZE_ARB 0x8764 +#define GL_BUFFER_USAGE_ARB 0x8765 +#define GL_ARRAY_BUFFER_ARB 0x8892 +#define GL_ELEMENT_ARRAY_BUFFER_ARB 0x8893 +#define GL_ARRAY_BUFFER_BINDING_ARB 0x8894 +#define GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB 0x8895 +#define GL_VERTEX_ARRAY_BUFFER_BINDING_ARB 0x8896 +#define GL_NORMAL_ARRAY_BUFFER_BINDING_ARB 0x8897 +#define GL_COLOR_ARRAY_BUFFER_BINDING_ARB 0x8898 +#define GL_INDEX_ARRAY_BUFFER_BINDING_ARB 0x8899 +#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB 0x889A +#define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB 0x889B +#define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB 0x889C +#define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB 0x889D +#define GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB 0x889E +#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB 0x889F +#define GL_READ_ONLY_ARB 0x88B8 +#define GL_WRITE_ONLY_ARB 0x88B9 +#define GL_READ_WRITE_ARB 0x88BA +#define GL_BUFFER_ACCESS_ARB 0x88BB +#define GL_BUFFER_MAPPED_ARB 0x88BC +#define GL_BUFFER_MAP_POINTER_ARB 0x88BD +#define GL_STREAM_DRAW_ARB 0x88E0 +#define GL_STREAM_READ_ARB 0x88E1 +#define GL_STREAM_COPY_ARB 0x88E2 +#define GL_STATIC_DRAW_ARB 0x88E4 +#define GL_STATIC_READ_ARB 0x88E5 +#define GL_STATIC_COPY_ARB 0x88E6 +#define GL_DYNAMIC_DRAW_ARB 0x88E8 +#define GL_DYNAMIC_READ_ARB 0x88E9 +#define GL_DYNAMIC_COPY_ARB 0x88EA + +typedef ptrdiff_t GLintptrARB; +typedef ptrdiff_t GLsizeiptrARB; + +typedef void (GLAPIENTRY * PFNGLBINDBUFFERARBPROC) (GLenum target, GLuint buffer); +typedef void (GLAPIENTRY * PFNGLBUFFERDATAARBPROC) (GLenum target, GLsizeiptrARB size, const GLvoid *data, GLenum usage); +typedef void (GLAPIENTRY * PFNGLBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLDELETEBUFFERSARBPROC) (GLsizei n, const GLuint* buffers); +typedef void (GLAPIENTRY * PFNGLGENBUFFERSARBPROC) (GLsizei n, GLuint* buffers); +typedef void (GLAPIENTRY * PFNGLGETBUFFERPARAMETERIVARBPROC) (GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETBUFFERPOINTERVARBPROC) (GLenum target, GLenum pname, GLvoid** params); +typedef void (GLAPIENTRY * PFNGLGETBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, GLvoid *data); +typedef GLboolean (GLAPIENTRY * PFNGLISBUFFERARBPROC) (GLuint buffer); +typedef GLvoid * (GLAPIENTRY * PFNGLMAPBUFFERARBPROC) (GLenum target, GLenum access); +typedef GLboolean (GLAPIENTRY * PFNGLUNMAPBUFFERARBPROC) (GLenum target); + +#define glBindBufferARB GLEW_GET_FUN(__glewBindBufferARB) +#define glBufferDataARB GLEW_GET_FUN(__glewBufferDataARB) +#define glBufferSubDataARB GLEW_GET_FUN(__glewBufferSubDataARB) +#define glDeleteBuffersARB GLEW_GET_FUN(__glewDeleteBuffersARB) +#define glGenBuffersARB GLEW_GET_FUN(__glewGenBuffersARB) +#define glGetBufferParameterivARB GLEW_GET_FUN(__glewGetBufferParameterivARB) +#define glGetBufferPointervARB GLEW_GET_FUN(__glewGetBufferPointervARB) +#define glGetBufferSubDataARB GLEW_GET_FUN(__glewGetBufferSubDataARB) +#define glIsBufferARB GLEW_GET_FUN(__glewIsBufferARB) +#define glMapBufferARB GLEW_GET_FUN(__glewMapBufferARB) +#define glUnmapBufferARB GLEW_GET_FUN(__glewUnmapBufferARB) + +#define GLEW_ARB_vertex_buffer_object GLEW_GET_VAR(__GLEW_ARB_vertex_buffer_object) + +#endif /* GL_ARB_vertex_buffer_object */ + +/* ------------------------- GL_ARB_vertex_program ------------------------- */ + +#ifndef GL_ARB_vertex_program +#define GL_ARB_vertex_program 1 + +#define GL_COLOR_SUM_ARB 0x8458 +#define GL_VERTEX_PROGRAM_ARB 0x8620 +#define GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB 0x8622 +#define GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB 0x8623 +#define GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB 0x8624 +#define GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB 0x8625 +#define GL_CURRENT_VERTEX_ATTRIB_ARB 0x8626 +#define GL_PROGRAM_LENGTH_ARB 0x8627 +#define GL_PROGRAM_STRING_ARB 0x8628 +#define GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB 0x862E +#define GL_MAX_PROGRAM_MATRICES_ARB 0x862F +#define GL_CURRENT_MATRIX_STACK_DEPTH_ARB 0x8640 +#define GL_CURRENT_MATRIX_ARB 0x8641 +#define GL_VERTEX_PROGRAM_POINT_SIZE_ARB 0x8642 +#define GL_VERTEX_PROGRAM_TWO_SIDE_ARB 0x8643 +#define GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB 0x8645 +#define GL_PROGRAM_ERROR_POSITION_ARB 0x864B +#define GL_PROGRAM_BINDING_ARB 0x8677 +#define GL_MAX_VERTEX_ATTRIBS_ARB 0x8869 +#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB 0x886A +#define GL_PROGRAM_ERROR_STRING_ARB 0x8874 +#define GL_PROGRAM_FORMAT_ASCII_ARB 0x8875 +#define GL_PROGRAM_FORMAT_ARB 0x8876 +#define GL_PROGRAM_INSTRUCTIONS_ARB 0x88A0 +#define GL_MAX_PROGRAM_INSTRUCTIONS_ARB 0x88A1 +#define GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB 0x88A2 +#define GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB 0x88A3 +#define GL_PROGRAM_TEMPORARIES_ARB 0x88A4 +#define GL_MAX_PROGRAM_TEMPORARIES_ARB 0x88A5 +#define GL_PROGRAM_NATIVE_TEMPORARIES_ARB 0x88A6 +#define GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB 0x88A7 +#define GL_PROGRAM_PARAMETERS_ARB 0x88A8 +#define GL_MAX_PROGRAM_PARAMETERS_ARB 0x88A9 +#define GL_PROGRAM_NATIVE_PARAMETERS_ARB 0x88AA +#define GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB 0x88AB +#define GL_PROGRAM_ATTRIBS_ARB 0x88AC +#define GL_MAX_PROGRAM_ATTRIBS_ARB 0x88AD +#define GL_PROGRAM_NATIVE_ATTRIBS_ARB 0x88AE +#define GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB 0x88AF +#define GL_PROGRAM_ADDRESS_REGISTERS_ARB 0x88B0 +#define GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB 0x88B1 +#define GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB 0x88B2 +#define GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB 0x88B3 +#define GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB 0x88B4 +#define GL_MAX_PROGRAM_ENV_PARAMETERS_ARB 0x88B5 +#define GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB 0x88B6 +#define GL_TRANSPOSE_CURRENT_MATRIX_ARB 0x88B7 +#define GL_MATRIX0_ARB 0x88C0 +#define GL_MATRIX1_ARB 0x88C1 +#define GL_MATRIX2_ARB 0x88C2 +#define GL_MATRIX3_ARB 0x88C3 +#define GL_MATRIX4_ARB 0x88C4 +#define GL_MATRIX5_ARB 0x88C5 +#define GL_MATRIX6_ARB 0x88C6 +#define GL_MATRIX7_ARB 0x88C7 +#define GL_MATRIX8_ARB 0x88C8 +#define GL_MATRIX9_ARB 0x88C9 +#define GL_MATRIX10_ARB 0x88CA +#define GL_MATRIX11_ARB 0x88CB +#define GL_MATRIX12_ARB 0x88CC +#define GL_MATRIX13_ARB 0x88CD +#define GL_MATRIX14_ARB 0x88CE +#define GL_MATRIX15_ARB 0x88CF +#define GL_MATRIX16_ARB 0x88D0 +#define GL_MATRIX17_ARB 0x88D1 +#define GL_MATRIX18_ARB 0x88D2 +#define GL_MATRIX19_ARB 0x88D3 +#define GL_MATRIX20_ARB 0x88D4 +#define GL_MATRIX21_ARB 0x88D5 +#define GL_MATRIX22_ARB 0x88D6 +#define GL_MATRIX23_ARB 0x88D7 +#define GL_MATRIX24_ARB 0x88D8 +#define GL_MATRIX25_ARB 0x88D9 +#define GL_MATRIX26_ARB 0x88DA +#define GL_MATRIX27_ARB 0x88DB +#define GL_MATRIX28_ARB 0x88DC +#define GL_MATRIX29_ARB 0x88DD +#define GL_MATRIX30_ARB 0x88DE +#define GL_MATRIX31_ARB 0x88DF + +typedef void (GLAPIENTRY * PFNGLBINDPROGRAMARBPROC) (GLenum target, GLuint program); +typedef void (GLAPIENTRY * PFNGLDELETEPROGRAMSARBPROC) (GLsizei n, const GLuint* programs); +typedef void (GLAPIENTRY * PFNGLDISABLEVERTEXATTRIBARRAYARBPROC) (GLuint index); +typedef void (GLAPIENTRY * PFNGLENABLEVERTEXATTRIBARRAYARBPROC) (GLuint index); +typedef void (GLAPIENTRY * PFNGLGENPROGRAMSARBPROC) (GLsizei n, GLuint* programs); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMENVPARAMETERDVARBPROC) (GLenum target, GLuint index, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMENVPARAMETERFVARBPROC) (GLenum target, GLuint index, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC) (GLenum target, GLuint index, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC) (GLenum target, GLuint index, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMSTRINGARBPROC) (GLenum target, GLenum pname, GLvoid *string); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMIVARBPROC) (GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBPOINTERVARBPROC) (GLuint index, GLenum pname, GLvoid** pointer); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBDVARBPROC) (GLuint index, GLenum pname, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBFVARBPROC) (GLuint index, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBIVARBPROC) (GLuint index, GLenum pname, GLint* params); +typedef GLboolean (GLAPIENTRY * PFNGLISPROGRAMARBPROC) (GLuint program); +typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETER4DARBPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETER4DVARBPROC) (GLenum target, GLuint index, const GLdouble* params); +typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETER4FARBPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETER4FVARBPROC) (GLenum target, GLuint index, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETER4DARBPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETER4DVARBPROC) (GLenum target, GLuint index, const GLdouble* params); +typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETER4FARBPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETER4FVARBPROC) (GLenum target, GLuint index, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLPROGRAMSTRINGARBPROC) (GLenum target, GLenum format, GLsizei len, const GLvoid *string); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1DARBPROC) (GLuint index, GLdouble x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1DVARBPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1FARBPROC) (GLuint index, GLfloat x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1FVARBPROC) (GLuint index, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1SARBPROC) (GLuint index, GLshort x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1SVARBPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2DARBPROC) (GLuint index, GLdouble x, GLdouble y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2DVARBPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2FARBPROC) (GLuint index, GLfloat x, GLfloat y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2FVARBPROC) (GLuint index, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2SARBPROC) (GLuint index, GLshort x, GLshort y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2SVARBPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3DARBPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3DVARBPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3FARBPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3FVARBPROC) (GLuint index, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3SARBPROC) (GLuint index, GLshort x, GLshort y, GLshort z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3SVARBPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NBVARBPROC) (GLuint index, const GLbyte* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NIVARBPROC) (GLuint index, const GLint* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NSVARBPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUBARBPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUBVARBPROC) (GLuint index, const GLubyte* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUIVARBPROC) (GLuint index, const GLuint* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUSVARBPROC) (GLuint index, const GLushort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4BVARBPROC) (GLuint index, const GLbyte* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4DARBPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4DVARBPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4FARBPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4FVARBPROC) (GLuint index, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4IVARBPROC) (GLuint index, const GLint* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4SARBPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4SVARBPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4UBVARBPROC) (GLuint index, const GLubyte* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4UIVARBPROC) (GLuint index, const GLuint* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4USVARBPROC) (GLuint index, const GLushort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBPOINTERARBPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer); + +#define glBindProgramARB GLEW_GET_FUN(__glewBindProgramARB) +#define glDeleteProgramsARB GLEW_GET_FUN(__glewDeleteProgramsARB) +#define glDisableVertexAttribArrayARB GLEW_GET_FUN(__glewDisableVertexAttribArrayARB) +#define glEnableVertexAttribArrayARB GLEW_GET_FUN(__glewEnableVertexAttribArrayARB) +#define glGenProgramsARB GLEW_GET_FUN(__glewGenProgramsARB) +#define glGetProgramEnvParameterdvARB GLEW_GET_FUN(__glewGetProgramEnvParameterdvARB) +#define glGetProgramEnvParameterfvARB GLEW_GET_FUN(__glewGetProgramEnvParameterfvARB) +#define glGetProgramLocalParameterdvARB GLEW_GET_FUN(__glewGetProgramLocalParameterdvARB) +#define glGetProgramLocalParameterfvARB GLEW_GET_FUN(__glewGetProgramLocalParameterfvARB) +#define glGetProgramStringARB GLEW_GET_FUN(__glewGetProgramStringARB) +#define glGetProgramivARB GLEW_GET_FUN(__glewGetProgramivARB) +#define glGetVertexAttribPointervARB GLEW_GET_FUN(__glewGetVertexAttribPointervARB) +#define glGetVertexAttribdvARB GLEW_GET_FUN(__glewGetVertexAttribdvARB) +#define glGetVertexAttribfvARB GLEW_GET_FUN(__glewGetVertexAttribfvARB) +#define glGetVertexAttribivARB GLEW_GET_FUN(__glewGetVertexAttribivARB) +#define glIsProgramARB GLEW_GET_FUN(__glewIsProgramARB) +#define glProgramEnvParameter4dARB GLEW_GET_FUN(__glewProgramEnvParameter4dARB) +#define glProgramEnvParameter4dvARB GLEW_GET_FUN(__glewProgramEnvParameter4dvARB) +#define glProgramEnvParameter4fARB GLEW_GET_FUN(__glewProgramEnvParameter4fARB) +#define glProgramEnvParameter4fvARB GLEW_GET_FUN(__glewProgramEnvParameter4fvARB) +#define glProgramLocalParameter4dARB GLEW_GET_FUN(__glewProgramLocalParameter4dARB) +#define glProgramLocalParameter4dvARB GLEW_GET_FUN(__glewProgramLocalParameter4dvARB) +#define glProgramLocalParameter4fARB GLEW_GET_FUN(__glewProgramLocalParameter4fARB) +#define glProgramLocalParameter4fvARB GLEW_GET_FUN(__glewProgramLocalParameter4fvARB) +#define glProgramStringARB GLEW_GET_FUN(__glewProgramStringARB) +#define glVertexAttrib1dARB GLEW_GET_FUN(__glewVertexAttrib1dARB) +#define glVertexAttrib1dvARB GLEW_GET_FUN(__glewVertexAttrib1dvARB) +#define glVertexAttrib1fARB GLEW_GET_FUN(__glewVertexAttrib1fARB) +#define glVertexAttrib1fvARB GLEW_GET_FUN(__glewVertexAttrib1fvARB) +#define glVertexAttrib1sARB GLEW_GET_FUN(__glewVertexAttrib1sARB) +#define glVertexAttrib1svARB GLEW_GET_FUN(__glewVertexAttrib1svARB) +#define glVertexAttrib2dARB GLEW_GET_FUN(__glewVertexAttrib2dARB) +#define glVertexAttrib2dvARB GLEW_GET_FUN(__glewVertexAttrib2dvARB) +#define glVertexAttrib2fARB GLEW_GET_FUN(__glewVertexAttrib2fARB) +#define glVertexAttrib2fvARB GLEW_GET_FUN(__glewVertexAttrib2fvARB) +#define glVertexAttrib2sARB GLEW_GET_FUN(__glewVertexAttrib2sARB) +#define glVertexAttrib2svARB GLEW_GET_FUN(__glewVertexAttrib2svARB) +#define glVertexAttrib3dARB GLEW_GET_FUN(__glewVertexAttrib3dARB) +#define glVertexAttrib3dvARB GLEW_GET_FUN(__glewVertexAttrib3dvARB) +#define glVertexAttrib3fARB GLEW_GET_FUN(__glewVertexAttrib3fARB) +#define glVertexAttrib3fvARB GLEW_GET_FUN(__glewVertexAttrib3fvARB) +#define glVertexAttrib3sARB GLEW_GET_FUN(__glewVertexAttrib3sARB) +#define glVertexAttrib3svARB GLEW_GET_FUN(__glewVertexAttrib3svARB) +#define glVertexAttrib4NbvARB GLEW_GET_FUN(__glewVertexAttrib4NbvARB) +#define glVertexAttrib4NivARB GLEW_GET_FUN(__glewVertexAttrib4NivARB) +#define glVertexAttrib4NsvARB GLEW_GET_FUN(__glewVertexAttrib4NsvARB) +#define glVertexAttrib4NubARB GLEW_GET_FUN(__glewVertexAttrib4NubARB) +#define glVertexAttrib4NubvARB GLEW_GET_FUN(__glewVertexAttrib4NubvARB) +#define glVertexAttrib4NuivARB GLEW_GET_FUN(__glewVertexAttrib4NuivARB) +#define glVertexAttrib4NusvARB GLEW_GET_FUN(__glewVertexAttrib4NusvARB) +#define glVertexAttrib4bvARB GLEW_GET_FUN(__glewVertexAttrib4bvARB) +#define glVertexAttrib4dARB GLEW_GET_FUN(__glewVertexAttrib4dARB) +#define glVertexAttrib4dvARB GLEW_GET_FUN(__glewVertexAttrib4dvARB) +#define glVertexAttrib4fARB GLEW_GET_FUN(__glewVertexAttrib4fARB) +#define glVertexAttrib4fvARB GLEW_GET_FUN(__glewVertexAttrib4fvARB) +#define glVertexAttrib4ivARB GLEW_GET_FUN(__glewVertexAttrib4ivARB) +#define glVertexAttrib4sARB GLEW_GET_FUN(__glewVertexAttrib4sARB) +#define glVertexAttrib4svARB GLEW_GET_FUN(__glewVertexAttrib4svARB) +#define glVertexAttrib4ubvARB GLEW_GET_FUN(__glewVertexAttrib4ubvARB) +#define glVertexAttrib4uivARB GLEW_GET_FUN(__glewVertexAttrib4uivARB) +#define glVertexAttrib4usvARB GLEW_GET_FUN(__glewVertexAttrib4usvARB) +#define glVertexAttribPointerARB GLEW_GET_FUN(__glewVertexAttribPointerARB) + +#define GLEW_ARB_vertex_program GLEW_GET_VAR(__GLEW_ARB_vertex_program) + +#endif /* GL_ARB_vertex_program */ + +/* -------------------------- GL_ARB_vertex_shader ------------------------- */ + +#ifndef GL_ARB_vertex_shader +#define GL_ARB_vertex_shader 1 + +#define GL_VERTEX_SHADER_ARB 0x8B31 +#define GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB 0x8B4A +#define GL_MAX_VARYING_FLOATS_ARB 0x8B4B +#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB 0x8B4C +#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB 0x8B4D +#define GL_OBJECT_ACTIVE_ATTRIBUTES_ARB 0x8B89 +#define GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB 0x8B8A + +typedef void (GLAPIENTRY * PFNGLBINDATTRIBLOCATIONARBPROC) (GLhandleARB programObj, GLuint index, const GLcharARB* name); +typedef void (GLAPIENTRY * PFNGLGETACTIVEATTRIBARBPROC) (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei* length, GLint *size, GLenum *type, GLcharARB *name); +typedef GLint (GLAPIENTRY * PFNGLGETATTRIBLOCATIONARBPROC) (GLhandleARB programObj, const GLcharARB* name); + +#define glBindAttribLocationARB GLEW_GET_FUN(__glewBindAttribLocationARB) +#define glGetActiveAttribARB GLEW_GET_FUN(__glewGetActiveAttribARB) +#define glGetAttribLocationARB GLEW_GET_FUN(__glewGetAttribLocationARB) + +#define GLEW_ARB_vertex_shader GLEW_GET_VAR(__GLEW_ARB_vertex_shader) + +#endif /* GL_ARB_vertex_shader */ + +/* ------------------- GL_ARB_vertex_type_10f_11f_11f_rev ------------------ */ + +#ifndef GL_ARB_vertex_type_10f_11f_11f_rev +#define GL_ARB_vertex_type_10f_11f_11f_rev 1 + +#define GL_UNSIGNED_INT_10F_11F_11F_REV 0x8C3B + +#define GLEW_ARB_vertex_type_10f_11f_11f_rev GLEW_GET_VAR(__GLEW_ARB_vertex_type_10f_11f_11f_rev) + +#endif /* GL_ARB_vertex_type_10f_11f_11f_rev */ + +/* ------------------- GL_ARB_vertex_type_2_10_10_10_rev ------------------- */ + +#ifndef GL_ARB_vertex_type_2_10_10_10_rev +#define GL_ARB_vertex_type_2_10_10_10_rev 1 + +#define GL_UNSIGNED_INT_2_10_10_10_REV 0x8368 +#define GL_INT_2_10_10_10_REV 0x8D9F + +typedef void (GLAPIENTRY * PFNGLCOLORP3UIPROC) (GLenum type, GLuint color); +typedef void (GLAPIENTRY * PFNGLCOLORP3UIVPROC) (GLenum type, const GLuint* color); +typedef void (GLAPIENTRY * PFNGLCOLORP4UIPROC) (GLenum type, GLuint color); +typedef void (GLAPIENTRY * PFNGLCOLORP4UIVPROC) (GLenum type, const GLuint* color); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDP1UIPROC) (GLenum texture, GLenum type, GLuint coords); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDP1UIVPROC) (GLenum texture, GLenum type, const GLuint* coords); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDP2UIPROC) (GLenum texture, GLenum type, GLuint coords); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDP2UIVPROC) (GLenum texture, GLenum type, const GLuint* coords); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDP3UIPROC) (GLenum texture, GLenum type, GLuint coords); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDP3UIVPROC) (GLenum texture, GLenum type, const GLuint* coords); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDP4UIPROC) (GLenum texture, GLenum type, GLuint coords); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDP4UIVPROC) (GLenum texture, GLenum type, const GLuint* coords); +typedef void (GLAPIENTRY * PFNGLNORMALP3UIPROC) (GLenum type, GLuint coords); +typedef void (GLAPIENTRY * PFNGLNORMALP3UIVPROC) (GLenum type, const GLuint* coords); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLORP3UIPROC) (GLenum type, GLuint color); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLORP3UIVPROC) (GLenum type, const GLuint* color); +typedef void (GLAPIENTRY * PFNGLTEXCOORDP1UIPROC) (GLenum type, GLuint coords); +typedef void (GLAPIENTRY * PFNGLTEXCOORDP1UIVPROC) (GLenum type, const GLuint* coords); +typedef void (GLAPIENTRY * PFNGLTEXCOORDP2UIPROC) (GLenum type, GLuint coords); +typedef void (GLAPIENTRY * PFNGLTEXCOORDP2UIVPROC) (GLenum type, const GLuint* coords); +typedef void (GLAPIENTRY * PFNGLTEXCOORDP3UIPROC) (GLenum type, GLuint coords); +typedef void (GLAPIENTRY * PFNGLTEXCOORDP3UIVPROC) (GLenum type, const GLuint* coords); +typedef void (GLAPIENTRY * PFNGLTEXCOORDP4UIPROC) (GLenum type, GLuint coords); +typedef void (GLAPIENTRY * PFNGLTEXCOORDP4UIVPROC) (GLenum type, const GLuint* coords); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBP1UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBP1UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBP2UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBP2UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBP3UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBP3UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBP4UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBP4UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLVERTEXP2UIPROC) (GLenum type, GLuint value); +typedef void (GLAPIENTRY * PFNGLVERTEXP2UIVPROC) (GLenum type, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLVERTEXP3UIPROC) (GLenum type, GLuint value); +typedef void (GLAPIENTRY * PFNGLVERTEXP3UIVPROC) (GLenum type, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLVERTEXP4UIPROC) (GLenum type, GLuint value); +typedef void (GLAPIENTRY * PFNGLVERTEXP4UIVPROC) (GLenum type, const GLuint* value); + +#define glColorP3ui GLEW_GET_FUN(__glewColorP3ui) +#define glColorP3uiv GLEW_GET_FUN(__glewColorP3uiv) +#define glColorP4ui GLEW_GET_FUN(__glewColorP4ui) +#define glColorP4uiv GLEW_GET_FUN(__glewColorP4uiv) +#define glMultiTexCoordP1ui GLEW_GET_FUN(__glewMultiTexCoordP1ui) +#define glMultiTexCoordP1uiv GLEW_GET_FUN(__glewMultiTexCoordP1uiv) +#define glMultiTexCoordP2ui GLEW_GET_FUN(__glewMultiTexCoordP2ui) +#define glMultiTexCoordP2uiv GLEW_GET_FUN(__glewMultiTexCoordP2uiv) +#define glMultiTexCoordP3ui GLEW_GET_FUN(__glewMultiTexCoordP3ui) +#define glMultiTexCoordP3uiv GLEW_GET_FUN(__glewMultiTexCoordP3uiv) +#define glMultiTexCoordP4ui GLEW_GET_FUN(__glewMultiTexCoordP4ui) +#define glMultiTexCoordP4uiv GLEW_GET_FUN(__glewMultiTexCoordP4uiv) +#define glNormalP3ui GLEW_GET_FUN(__glewNormalP3ui) +#define glNormalP3uiv GLEW_GET_FUN(__glewNormalP3uiv) +#define glSecondaryColorP3ui GLEW_GET_FUN(__glewSecondaryColorP3ui) +#define glSecondaryColorP3uiv GLEW_GET_FUN(__glewSecondaryColorP3uiv) +#define glTexCoordP1ui GLEW_GET_FUN(__glewTexCoordP1ui) +#define glTexCoordP1uiv GLEW_GET_FUN(__glewTexCoordP1uiv) +#define glTexCoordP2ui GLEW_GET_FUN(__glewTexCoordP2ui) +#define glTexCoordP2uiv GLEW_GET_FUN(__glewTexCoordP2uiv) +#define glTexCoordP3ui GLEW_GET_FUN(__glewTexCoordP3ui) +#define glTexCoordP3uiv GLEW_GET_FUN(__glewTexCoordP3uiv) +#define glTexCoordP4ui GLEW_GET_FUN(__glewTexCoordP4ui) +#define glTexCoordP4uiv GLEW_GET_FUN(__glewTexCoordP4uiv) +#define glVertexAttribP1ui GLEW_GET_FUN(__glewVertexAttribP1ui) +#define glVertexAttribP1uiv GLEW_GET_FUN(__glewVertexAttribP1uiv) +#define glVertexAttribP2ui GLEW_GET_FUN(__glewVertexAttribP2ui) +#define glVertexAttribP2uiv GLEW_GET_FUN(__glewVertexAttribP2uiv) +#define glVertexAttribP3ui GLEW_GET_FUN(__glewVertexAttribP3ui) +#define glVertexAttribP3uiv GLEW_GET_FUN(__glewVertexAttribP3uiv) +#define glVertexAttribP4ui GLEW_GET_FUN(__glewVertexAttribP4ui) +#define glVertexAttribP4uiv GLEW_GET_FUN(__glewVertexAttribP4uiv) +#define glVertexP2ui GLEW_GET_FUN(__glewVertexP2ui) +#define glVertexP2uiv GLEW_GET_FUN(__glewVertexP2uiv) +#define glVertexP3ui GLEW_GET_FUN(__glewVertexP3ui) +#define glVertexP3uiv GLEW_GET_FUN(__glewVertexP3uiv) +#define glVertexP4ui GLEW_GET_FUN(__glewVertexP4ui) +#define glVertexP4uiv GLEW_GET_FUN(__glewVertexP4uiv) + +#define GLEW_ARB_vertex_type_2_10_10_10_rev GLEW_GET_VAR(__GLEW_ARB_vertex_type_2_10_10_10_rev) + +#endif /* GL_ARB_vertex_type_2_10_10_10_rev */ + +/* ------------------------- GL_ARB_viewport_array ------------------------- */ + +#ifndef GL_ARB_viewport_array +#define GL_ARB_viewport_array 1 + +#define GL_DEPTH_RANGE 0x0B70 +#define GL_VIEWPORT 0x0BA2 +#define GL_SCISSOR_BOX 0x0C10 +#define GL_SCISSOR_TEST 0x0C11 +#define GL_MAX_VIEWPORTS 0x825B +#define GL_VIEWPORT_SUBPIXEL_BITS 0x825C +#define GL_VIEWPORT_BOUNDS_RANGE 0x825D +#define GL_LAYER_PROVOKING_VERTEX 0x825E +#define GL_VIEWPORT_INDEX_PROVOKING_VERTEX 0x825F +#define GL_UNDEFINED_VERTEX 0x8260 +#define GL_FIRST_VERTEX_CONVENTION 0x8E4D +#define GL_LAST_VERTEX_CONVENTION 0x8E4E +#define GL_PROVOKING_VERTEX 0x8E4F + +typedef void (GLAPIENTRY * PFNGLDEPTHRANGEARRAYVPROC) (GLuint first, GLsizei count, const GLclampd * v); +typedef void (GLAPIENTRY * PFNGLDEPTHRANGEINDEXEDPROC) (GLuint index, GLclampd n, GLclampd f); +typedef void (GLAPIENTRY * PFNGLGETDOUBLEI_VPROC) (GLenum target, GLuint index, GLdouble* data); +typedef void (GLAPIENTRY * PFNGLGETFLOATI_VPROC) (GLenum target, GLuint index, GLfloat* data); +typedef void (GLAPIENTRY * PFNGLSCISSORARRAYVPROC) (GLuint first, GLsizei count, const GLint * v); +typedef void (GLAPIENTRY * PFNGLSCISSORINDEXEDPROC) (GLuint index, GLint left, GLint bottom, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLSCISSORINDEXEDVPROC) (GLuint index, const GLint * v); +typedef void (GLAPIENTRY * PFNGLVIEWPORTARRAYVPROC) (GLuint first, GLsizei count, const GLfloat * v); +typedef void (GLAPIENTRY * PFNGLVIEWPORTINDEXEDFPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat w, GLfloat h); +typedef void (GLAPIENTRY * PFNGLVIEWPORTINDEXEDFVPROC) (GLuint index, const GLfloat * v); + +#define glDepthRangeArrayv GLEW_GET_FUN(__glewDepthRangeArrayv) +#define glDepthRangeIndexed GLEW_GET_FUN(__glewDepthRangeIndexed) +#define glGetDoublei_v GLEW_GET_FUN(__glewGetDoublei_v) +#define glGetFloati_v GLEW_GET_FUN(__glewGetFloati_v) +#define glScissorArrayv GLEW_GET_FUN(__glewScissorArrayv) +#define glScissorIndexed GLEW_GET_FUN(__glewScissorIndexed) +#define glScissorIndexedv GLEW_GET_FUN(__glewScissorIndexedv) +#define glViewportArrayv GLEW_GET_FUN(__glewViewportArrayv) +#define glViewportIndexedf GLEW_GET_FUN(__glewViewportIndexedf) +#define glViewportIndexedfv GLEW_GET_FUN(__glewViewportIndexedfv) + +#define GLEW_ARB_viewport_array GLEW_GET_VAR(__GLEW_ARB_viewport_array) + +#endif /* GL_ARB_viewport_array */ + +/* --------------------------- GL_ARB_window_pos --------------------------- */ + +#ifndef GL_ARB_window_pos +#define GL_ARB_window_pos 1 + +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2DARBPROC) (GLdouble x, GLdouble y); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2DVARBPROC) (const GLdouble* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2FARBPROC) (GLfloat x, GLfloat y); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2FVARBPROC) (const GLfloat* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2IARBPROC) (GLint x, GLint y); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2IVARBPROC) (const GLint* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2SARBPROC) (GLshort x, GLshort y); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2SVARBPROC) (const GLshort* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3DARBPROC) (GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3DVARBPROC) (const GLdouble* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3FARBPROC) (GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3FVARBPROC) (const GLfloat* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3IARBPROC) (GLint x, GLint y, GLint z); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3IVARBPROC) (const GLint* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3SARBPROC) (GLshort x, GLshort y, GLshort z); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3SVARBPROC) (const GLshort* p); + +#define glWindowPos2dARB GLEW_GET_FUN(__glewWindowPos2dARB) +#define glWindowPos2dvARB GLEW_GET_FUN(__glewWindowPos2dvARB) +#define glWindowPos2fARB GLEW_GET_FUN(__glewWindowPos2fARB) +#define glWindowPos2fvARB GLEW_GET_FUN(__glewWindowPos2fvARB) +#define glWindowPos2iARB GLEW_GET_FUN(__glewWindowPos2iARB) +#define glWindowPos2ivARB GLEW_GET_FUN(__glewWindowPos2ivARB) +#define glWindowPos2sARB GLEW_GET_FUN(__glewWindowPos2sARB) +#define glWindowPos2svARB GLEW_GET_FUN(__glewWindowPos2svARB) +#define glWindowPos3dARB GLEW_GET_FUN(__glewWindowPos3dARB) +#define glWindowPos3dvARB GLEW_GET_FUN(__glewWindowPos3dvARB) +#define glWindowPos3fARB GLEW_GET_FUN(__glewWindowPos3fARB) +#define glWindowPos3fvARB GLEW_GET_FUN(__glewWindowPos3fvARB) +#define glWindowPos3iARB GLEW_GET_FUN(__glewWindowPos3iARB) +#define glWindowPos3ivARB GLEW_GET_FUN(__glewWindowPos3ivARB) +#define glWindowPos3sARB GLEW_GET_FUN(__glewWindowPos3sARB) +#define glWindowPos3svARB GLEW_GET_FUN(__glewWindowPos3svARB) + +#define GLEW_ARB_window_pos GLEW_GET_VAR(__GLEW_ARB_window_pos) + +#endif /* GL_ARB_window_pos */ + +/* ------------------------- GL_ATIX_point_sprites ------------------------- */ + +#ifndef GL_ATIX_point_sprites +#define GL_ATIX_point_sprites 1 + +#define GL_TEXTURE_POINT_MODE_ATIX 0x60B0 +#define GL_TEXTURE_POINT_ONE_COORD_ATIX 0x60B1 +#define GL_TEXTURE_POINT_SPRITE_ATIX 0x60B2 +#define GL_POINT_SPRITE_CULL_MODE_ATIX 0x60B3 +#define GL_POINT_SPRITE_CULL_CENTER_ATIX 0x60B4 +#define GL_POINT_SPRITE_CULL_CLIP_ATIX 0x60B5 + +#define GLEW_ATIX_point_sprites GLEW_GET_VAR(__GLEW_ATIX_point_sprites) + +#endif /* GL_ATIX_point_sprites */ + +/* ---------------------- GL_ATIX_texture_env_combine3 --------------------- */ + +#ifndef GL_ATIX_texture_env_combine3 +#define GL_ATIX_texture_env_combine3 1 + +#define GL_MODULATE_ADD_ATIX 0x8744 +#define GL_MODULATE_SIGNED_ADD_ATIX 0x8745 +#define GL_MODULATE_SUBTRACT_ATIX 0x8746 + +#define GLEW_ATIX_texture_env_combine3 GLEW_GET_VAR(__GLEW_ATIX_texture_env_combine3) + +#endif /* GL_ATIX_texture_env_combine3 */ + +/* ----------------------- GL_ATIX_texture_env_route ----------------------- */ + +#ifndef GL_ATIX_texture_env_route +#define GL_ATIX_texture_env_route 1 + +#define GL_SECONDARY_COLOR_ATIX 0x8747 +#define GL_TEXTURE_OUTPUT_RGB_ATIX 0x8748 +#define GL_TEXTURE_OUTPUT_ALPHA_ATIX 0x8749 + +#define GLEW_ATIX_texture_env_route GLEW_GET_VAR(__GLEW_ATIX_texture_env_route) + +#endif /* GL_ATIX_texture_env_route */ + +/* ---------------- GL_ATIX_vertex_shader_output_point_size ---------------- */ + +#ifndef GL_ATIX_vertex_shader_output_point_size +#define GL_ATIX_vertex_shader_output_point_size 1 + +#define GL_OUTPUT_POINT_SIZE_ATIX 0x610E + +#define GLEW_ATIX_vertex_shader_output_point_size GLEW_GET_VAR(__GLEW_ATIX_vertex_shader_output_point_size) + +#endif /* GL_ATIX_vertex_shader_output_point_size */ + +/* -------------------------- GL_ATI_draw_buffers -------------------------- */ + +#ifndef GL_ATI_draw_buffers +#define GL_ATI_draw_buffers 1 + +#define GL_MAX_DRAW_BUFFERS_ATI 0x8824 +#define GL_DRAW_BUFFER0_ATI 0x8825 +#define GL_DRAW_BUFFER1_ATI 0x8826 +#define GL_DRAW_BUFFER2_ATI 0x8827 +#define GL_DRAW_BUFFER3_ATI 0x8828 +#define GL_DRAW_BUFFER4_ATI 0x8829 +#define GL_DRAW_BUFFER5_ATI 0x882A +#define GL_DRAW_BUFFER6_ATI 0x882B +#define GL_DRAW_BUFFER7_ATI 0x882C +#define GL_DRAW_BUFFER8_ATI 0x882D +#define GL_DRAW_BUFFER9_ATI 0x882E +#define GL_DRAW_BUFFER10_ATI 0x882F +#define GL_DRAW_BUFFER11_ATI 0x8830 +#define GL_DRAW_BUFFER12_ATI 0x8831 +#define GL_DRAW_BUFFER13_ATI 0x8832 +#define GL_DRAW_BUFFER14_ATI 0x8833 +#define GL_DRAW_BUFFER15_ATI 0x8834 + +typedef void (GLAPIENTRY * PFNGLDRAWBUFFERSATIPROC) (GLsizei n, const GLenum* bufs); + +#define glDrawBuffersATI GLEW_GET_FUN(__glewDrawBuffersATI) + +#define GLEW_ATI_draw_buffers GLEW_GET_VAR(__GLEW_ATI_draw_buffers) + +#endif /* GL_ATI_draw_buffers */ + +/* -------------------------- GL_ATI_element_array ------------------------- */ + +#ifndef GL_ATI_element_array +#define GL_ATI_element_array 1 + +#define GL_ELEMENT_ARRAY_ATI 0x8768 +#define GL_ELEMENT_ARRAY_TYPE_ATI 0x8769 +#define GL_ELEMENT_ARRAY_POINTER_ATI 0x876A + +typedef void (GLAPIENTRY * PFNGLDRAWELEMENTARRAYATIPROC) (GLenum mode, GLsizei count); +typedef void (GLAPIENTRY * PFNGLDRAWRANGEELEMENTARRAYATIPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count); +typedef void (GLAPIENTRY * PFNGLELEMENTPOINTERATIPROC) (GLenum type, const GLvoid *pointer); + +#define glDrawElementArrayATI GLEW_GET_FUN(__glewDrawElementArrayATI) +#define glDrawRangeElementArrayATI GLEW_GET_FUN(__glewDrawRangeElementArrayATI) +#define glElementPointerATI GLEW_GET_FUN(__glewElementPointerATI) + +#define GLEW_ATI_element_array GLEW_GET_VAR(__GLEW_ATI_element_array) + +#endif /* GL_ATI_element_array */ + +/* ------------------------- GL_ATI_envmap_bumpmap ------------------------- */ + +#ifndef GL_ATI_envmap_bumpmap +#define GL_ATI_envmap_bumpmap 1 + +#define GL_BUMP_ROT_MATRIX_ATI 0x8775 +#define GL_BUMP_ROT_MATRIX_SIZE_ATI 0x8776 +#define GL_BUMP_NUM_TEX_UNITS_ATI 0x8777 +#define GL_BUMP_TEX_UNITS_ATI 0x8778 +#define GL_DUDV_ATI 0x8779 +#define GL_DU8DV8_ATI 0x877A +#define GL_BUMP_ENVMAP_ATI 0x877B +#define GL_BUMP_TARGET_ATI 0x877C + +typedef void (GLAPIENTRY * PFNGLGETTEXBUMPPARAMETERFVATIPROC) (GLenum pname, GLfloat *param); +typedef void (GLAPIENTRY * PFNGLGETTEXBUMPPARAMETERIVATIPROC) (GLenum pname, GLint *param); +typedef void (GLAPIENTRY * PFNGLTEXBUMPPARAMETERFVATIPROC) (GLenum pname, GLfloat *param); +typedef void (GLAPIENTRY * PFNGLTEXBUMPPARAMETERIVATIPROC) (GLenum pname, GLint *param); + +#define glGetTexBumpParameterfvATI GLEW_GET_FUN(__glewGetTexBumpParameterfvATI) +#define glGetTexBumpParameterivATI GLEW_GET_FUN(__glewGetTexBumpParameterivATI) +#define glTexBumpParameterfvATI GLEW_GET_FUN(__glewTexBumpParameterfvATI) +#define glTexBumpParameterivATI GLEW_GET_FUN(__glewTexBumpParameterivATI) + +#define GLEW_ATI_envmap_bumpmap GLEW_GET_VAR(__GLEW_ATI_envmap_bumpmap) + +#endif /* GL_ATI_envmap_bumpmap */ + +/* ------------------------- GL_ATI_fragment_shader ------------------------ */ + +#ifndef GL_ATI_fragment_shader +#define GL_ATI_fragment_shader 1 + +#define GL_RED_BIT_ATI 0x00000001 +#define GL_2X_BIT_ATI 0x00000001 +#define GL_4X_BIT_ATI 0x00000002 +#define GL_GREEN_BIT_ATI 0x00000002 +#define GL_COMP_BIT_ATI 0x00000002 +#define GL_BLUE_BIT_ATI 0x00000004 +#define GL_8X_BIT_ATI 0x00000004 +#define GL_NEGATE_BIT_ATI 0x00000004 +#define GL_BIAS_BIT_ATI 0x00000008 +#define GL_HALF_BIT_ATI 0x00000008 +#define GL_QUARTER_BIT_ATI 0x00000010 +#define GL_EIGHTH_BIT_ATI 0x00000020 +#define GL_SATURATE_BIT_ATI 0x00000040 +#define GL_FRAGMENT_SHADER_ATI 0x8920 +#define GL_REG_0_ATI 0x8921 +#define GL_REG_1_ATI 0x8922 +#define GL_REG_2_ATI 0x8923 +#define GL_REG_3_ATI 0x8924 +#define GL_REG_4_ATI 0x8925 +#define GL_REG_5_ATI 0x8926 +#define GL_CON_0_ATI 0x8941 +#define GL_CON_1_ATI 0x8942 +#define GL_CON_2_ATI 0x8943 +#define GL_CON_3_ATI 0x8944 +#define GL_CON_4_ATI 0x8945 +#define GL_CON_5_ATI 0x8946 +#define GL_CON_6_ATI 0x8947 +#define GL_CON_7_ATI 0x8948 +#define GL_MOV_ATI 0x8961 +#define GL_ADD_ATI 0x8963 +#define GL_MUL_ATI 0x8964 +#define GL_SUB_ATI 0x8965 +#define GL_DOT3_ATI 0x8966 +#define GL_DOT4_ATI 0x8967 +#define GL_MAD_ATI 0x8968 +#define GL_LERP_ATI 0x8969 +#define GL_CND_ATI 0x896A +#define GL_CND0_ATI 0x896B +#define GL_DOT2_ADD_ATI 0x896C +#define GL_SECONDARY_INTERPOLATOR_ATI 0x896D +#define GL_NUM_FRAGMENT_REGISTERS_ATI 0x896E +#define GL_NUM_FRAGMENT_CONSTANTS_ATI 0x896F +#define GL_NUM_PASSES_ATI 0x8970 +#define GL_NUM_INSTRUCTIONS_PER_PASS_ATI 0x8971 +#define GL_NUM_INSTRUCTIONS_TOTAL_ATI 0x8972 +#define GL_NUM_INPUT_INTERPOLATOR_COMPONENTS_ATI 0x8973 +#define GL_NUM_LOOPBACK_COMPONENTS_ATI 0x8974 +#define GL_COLOR_ALPHA_PAIRING_ATI 0x8975 +#define GL_SWIZZLE_STR_ATI 0x8976 +#define GL_SWIZZLE_STQ_ATI 0x8977 +#define GL_SWIZZLE_STR_DR_ATI 0x8978 +#define GL_SWIZZLE_STQ_DQ_ATI 0x8979 +#define GL_SWIZZLE_STRQ_ATI 0x897A +#define GL_SWIZZLE_STRQ_DQ_ATI 0x897B + +typedef void (GLAPIENTRY * PFNGLALPHAFRAGMENTOP1ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); +typedef void (GLAPIENTRY * PFNGLALPHAFRAGMENTOP2ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); +typedef void (GLAPIENTRY * PFNGLALPHAFRAGMENTOP3ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); +typedef void (GLAPIENTRY * PFNGLBEGINFRAGMENTSHADERATIPROC) (void); +typedef void (GLAPIENTRY * PFNGLBINDFRAGMENTSHADERATIPROC) (GLuint id); +typedef void (GLAPIENTRY * PFNGLCOLORFRAGMENTOP1ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); +typedef void (GLAPIENTRY * PFNGLCOLORFRAGMENTOP2ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); +typedef void (GLAPIENTRY * PFNGLCOLORFRAGMENTOP3ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); +typedef void (GLAPIENTRY * PFNGLDELETEFRAGMENTSHADERATIPROC) (GLuint id); +typedef void (GLAPIENTRY * PFNGLENDFRAGMENTSHADERATIPROC) (void); +typedef GLuint (GLAPIENTRY * PFNGLGENFRAGMENTSHADERSATIPROC) (GLuint range); +typedef void (GLAPIENTRY * PFNGLPASSTEXCOORDATIPROC) (GLuint dst, GLuint coord, GLenum swizzle); +typedef void (GLAPIENTRY * PFNGLSAMPLEMAPATIPROC) (GLuint dst, GLuint interp, GLenum swizzle); +typedef void (GLAPIENTRY * PFNGLSETFRAGMENTSHADERCONSTANTATIPROC) (GLuint dst, const GLfloat* value); + +#define glAlphaFragmentOp1ATI GLEW_GET_FUN(__glewAlphaFragmentOp1ATI) +#define glAlphaFragmentOp2ATI GLEW_GET_FUN(__glewAlphaFragmentOp2ATI) +#define glAlphaFragmentOp3ATI GLEW_GET_FUN(__glewAlphaFragmentOp3ATI) +#define glBeginFragmentShaderATI GLEW_GET_FUN(__glewBeginFragmentShaderATI) +#define glBindFragmentShaderATI GLEW_GET_FUN(__glewBindFragmentShaderATI) +#define glColorFragmentOp1ATI GLEW_GET_FUN(__glewColorFragmentOp1ATI) +#define glColorFragmentOp2ATI GLEW_GET_FUN(__glewColorFragmentOp2ATI) +#define glColorFragmentOp3ATI GLEW_GET_FUN(__glewColorFragmentOp3ATI) +#define glDeleteFragmentShaderATI GLEW_GET_FUN(__glewDeleteFragmentShaderATI) +#define glEndFragmentShaderATI GLEW_GET_FUN(__glewEndFragmentShaderATI) +#define glGenFragmentShadersATI GLEW_GET_FUN(__glewGenFragmentShadersATI) +#define glPassTexCoordATI GLEW_GET_FUN(__glewPassTexCoordATI) +#define glSampleMapATI GLEW_GET_FUN(__glewSampleMapATI) +#define glSetFragmentShaderConstantATI GLEW_GET_FUN(__glewSetFragmentShaderConstantATI) + +#define GLEW_ATI_fragment_shader GLEW_GET_VAR(__GLEW_ATI_fragment_shader) + +#endif /* GL_ATI_fragment_shader */ + +/* ------------------------ GL_ATI_map_object_buffer ----------------------- */ + +#ifndef GL_ATI_map_object_buffer +#define GL_ATI_map_object_buffer 1 + +typedef GLvoid * (GLAPIENTRY * PFNGLMAPOBJECTBUFFERATIPROC) (GLuint buffer); +typedef void (GLAPIENTRY * PFNGLUNMAPOBJECTBUFFERATIPROC) (GLuint buffer); + +#define glMapObjectBufferATI GLEW_GET_FUN(__glewMapObjectBufferATI) +#define glUnmapObjectBufferATI GLEW_GET_FUN(__glewUnmapObjectBufferATI) + +#define GLEW_ATI_map_object_buffer GLEW_GET_VAR(__GLEW_ATI_map_object_buffer) + +#endif /* GL_ATI_map_object_buffer */ + +/* ----------------------------- GL_ATI_meminfo ---------------------------- */ + +#ifndef GL_ATI_meminfo +#define GL_ATI_meminfo 1 + +#define GL_VBO_FREE_MEMORY_ATI 0x87FB +#define GL_TEXTURE_FREE_MEMORY_ATI 0x87FC +#define GL_RENDERBUFFER_FREE_MEMORY_ATI 0x87FD + +#define GLEW_ATI_meminfo GLEW_GET_VAR(__GLEW_ATI_meminfo) + +#endif /* GL_ATI_meminfo */ + +/* -------------------------- GL_ATI_pn_triangles -------------------------- */ + +#ifndef GL_ATI_pn_triangles +#define GL_ATI_pn_triangles 1 + +#define GL_PN_TRIANGLES_ATI 0x87F0 +#define GL_MAX_PN_TRIANGLES_TESSELATION_LEVEL_ATI 0x87F1 +#define GL_PN_TRIANGLES_POINT_MODE_ATI 0x87F2 +#define GL_PN_TRIANGLES_NORMAL_MODE_ATI 0x87F3 +#define GL_PN_TRIANGLES_TESSELATION_LEVEL_ATI 0x87F4 +#define GL_PN_TRIANGLES_POINT_MODE_LINEAR_ATI 0x87F5 +#define GL_PN_TRIANGLES_POINT_MODE_CUBIC_ATI 0x87F6 +#define GL_PN_TRIANGLES_NORMAL_MODE_LINEAR_ATI 0x87F7 +#define GL_PN_TRIANGLES_NORMAL_MODE_QUADRATIC_ATI 0x87F8 + +typedef void (GLAPIENTRY * PFNGLPNTRIANGLESFATIPROC) (GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLPNTRIANGLESIATIPROC) (GLenum pname, GLint param); + +#define glPNTrianglesfATI GLEW_GET_FUN(__glewPNTrianglesfATI) +#define glPNTrianglesiATI GLEW_GET_FUN(__glewPNTrianglesiATI) + +#define GLEW_ATI_pn_triangles GLEW_GET_VAR(__GLEW_ATI_pn_triangles) + +#endif /* GL_ATI_pn_triangles */ + +/* ------------------------ GL_ATI_separate_stencil ------------------------ */ + +#ifndef GL_ATI_separate_stencil +#define GL_ATI_separate_stencil 1 + +#define GL_STENCIL_BACK_FUNC_ATI 0x8800 +#define GL_STENCIL_BACK_FAIL_ATI 0x8801 +#define GL_STENCIL_BACK_PASS_DEPTH_FAIL_ATI 0x8802 +#define GL_STENCIL_BACK_PASS_DEPTH_PASS_ATI 0x8803 + +typedef void (GLAPIENTRY * PFNGLSTENCILFUNCSEPARATEATIPROC) (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask); +typedef void (GLAPIENTRY * PFNGLSTENCILOPSEPARATEATIPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass); + +#define glStencilFuncSeparateATI GLEW_GET_FUN(__glewStencilFuncSeparateATI) +#define glStencilOpSeparateATI GLEW_GET_FUN(__glewStencilOpSeparateATI) + +#define GLEW_ATI_separate_stencil GLEW_GET_VAR(__GLEW_ATI_separate_stencil) + +#endif /* GL_ATI_separate_stencil */ + +/* ----------------------- GL_ATI_shader_texture_lod ----------------------- */ + +#ifndef GL_ATI_shader_texture_lod +#define GL_ATI_shader_texture_lod 1 + +#define GLEW_ATI_shader_texture_lod GLEW_GET_VAR(__GLEW_ATI_shader_texture_lod) + +#endif /* GL_ATI_shader_texture_lod */ + +/* ---------------------- GL_ATI_text_fragment_shader ---------------------- */ + +#ifndef GL_ATI_text_fragment_shader +#define GL_ATI_text_fragment_shader 1 + +#define GL_TEXT_FRAGMENT_SHADER_ATI 0x8200 + +#define GLEW_ATI_text_fragment_shader GLEW_GET_VAR(__GLEW_ATI_text_fragment_shader) + +#endif /* GL_ATI_text_fragment_shader */ + +/* --------------------- GL_ATI_texture_compression_3dc -------------------- */ + +#ifndef GL_ATI_texture_compression_3dc +#define GL_ATI_texture_compression_3dc 1 + +#define GL_COMPRESSED_LUMINANCE_ALPHA_3DC_ATI 0x8837 + +#define GLEW_ATI_texture_compression_3dc GLEW_GET_VAR(__GLEW_ATI_texture_compression_3dc) + +#endif /* GL_ATI_texture_compression_3dc */ + +/* ---------------------- GL_ATI_texture_env_combine3 ---------------------- */ + +#ifndef GL_ATI_texture_env_combine3 +#define GL_ATI_texture_env_combine3 1 + +#define GL_MODULATE_ADD_ATI 0x8744 +#define GL_MODULATE_SIGNED_ADD_ATI 0x8745 +#define GL_MODULATE_SUBTRACT_ATI 0x8746 + +#define GLEW_ATI_texture_env_combine3 GLEW_GET_VAR(__GLEW_ATI_texture_env_combine3) + +#endif /* GL_ATI_texture_env_combine3 */ + +/* -------------------------- GL_ATI_texture_float ------------------------- */ + +#ifndef GL_ATI_texture_float +#define GL_ATI_texture_float 1 + +#define GL_RGBA_FLOAT32_ATI 0x8814 +#define GL_RGB_FLOAT32_ATI 0x8815 +#define GL_ALPHA_FLOAT32_ATI 0x8816 +#define GL_INTENSITY_FLOAT32_ATI 0x8817 +#define GL_LUMINANCE_FLOAT32_ATI 0x8818 +#define GL_LUMINANCE_ALPHA_FLOAT32_ATI 0x8819 +#define GL_RGBA_FLOAT16_ATI 0x881A +#define GL_RGB_FLOAT16_ATI 0x881B +#define GL_ALPHA_FLOAT16_ATI 0x881C +#define GL_INTENSITY_FLOAT16_ATI 0x881D +#define GL_LUMINANCE_FLOAT16_ATI 0x881E +#define GL_LUMINANCE_ALPHA_FLOAT16_ATI 0x881F + +#define GLEW_ATI_texture_float GLEW_GET_VAR(__GLEW_ATI_texture_float) + +#endif /* GL_ATI_texture_float */ + +/* ----------------------- GL_ATI_texture_mirror_once ---------------------- */ + +#ifndef GL_ATI_texture_mirror_once +#define GL_ATI_texture_mirror_once 1 + +#define GL_MIRROR_CLAMP_ATI 0x8742 +#define GL_MIRROR_CLAMP_TO_EDGE_ATI 0x8743 + +#define GLEW_ATI_texture_mirror_once GLEW_GET_VAR(__GLEW_ATI_texture_mirror_once) + +#endif /* GL_ATI_texture_mirror_once */ + +/* ----------------------- GL_ATI_vertex_array_object ---------------------- */ + +#ifndef GL_ATI_vertex_array_object +#define GL_ATI_vertex_array_object 1 + +#define GL_STATIC_ATI 0x8760 +#define GL_DYNAMIC_ATI 0x8761 +#define GL_PRESERVE_ATI 0x8762 +#define GL_DISCARD_ATI 0x8763 +#define GL_OBJECT_BUFFER_SIZE_ATI 0x8764 +#define GL_OBJECT_BUFFER_USAGE_ATI 0x8765 +#define GL_ARRAY_OBJECT_BUFFER_ATI 0x8766 +#define GL_ARRAY_OBJECT_OFFSET_ATI 0x8767 + +typedef void (GLAPIENTRY * PFNGLARRAYOBJECTATIPROC) (GLenum array, GLint size, GLenum type, GLsizei stride, GLuint buffer, GLuint offset); +typedef void (GLAPIENTRY * PFNGLFREEOBJECTBUFFERATIPROC) (GLuint buffer); +typedef void (GLAPIENTRY * PFNGLGETARRAYOBJECTFVATIPROC) (GLenum array, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETARRAYOBJECTIVATIPROC) (GLenum array, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETOBJECTBUFFERFVATIPROC) (GLuint buffer, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETOBJECTBUFFERIVATIPROC) (GLuint buffer, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETVARIANTARRAYOBJECTFVATIPROC) (GLuint id, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETVARIANTARRAYOBJECTIVATIPROC) (GLuint id, GLenum pname, GLint* params); +typedef GLboolean (GLAPIENTRY * PFNGLISOBJECTBUFFERATIPROC) (GLuint buffer); +typedef GLuint (GLAPIENTRY * PFNGLNEWOBJECTBUFFERATIPROC) (GLsizei size, const GLvoid *pointer, GLenum usage); +typedef void (GLAPIENTRY * PFNGLUPDATEOBJECTBUFFERATIPROC) (GLuint buffer, GLuint offset, GLsizei size, const GLvoid *pointer, GLenum preserve); +typedef void (GLAPIENTRY * PFNGLVARIANTARRAYOBJECTATIPROC) (GLuint id, GLenum type, GLsizei stride, GLuint buffer, GLuint offset); + +#define glArrayObjectATI GLEW_GET_FUN(__glewArrayObjectATI) +#define glFreeObjectBufferATI GLEW_GET_FUN(__glewFreeObjectBufferATI) +#define glGetArrayObjectfvATI GLEW_GET_FUN(__glewGetArrayObjectfvATI) +#define glGetArrayObjectivATI GLEW_GET_FUN(__glewGetArrayObjectivATI) +#define glGetObjectBufferfvATI GLEW_GET_FUN(__glewGetObjectBufferfvATI) +#define glGetObjectBufferivATI GLEW_GET_FUN(__glewGetObjectBufferivATI) +#define glGetVariantArrayObjectfvATI GLEW_GET_FUN(__glewGetVariantArrayObjectfvATI) +#define glGetVariantArrayObjectivATI GLEW_GET_FUN(__glewGetVariantArrayObjectivATI) +#define glIsObjectBufferATI GLEW_GET_FUN(__glewIsObjectBufferATI) +#define glNewObjectBufferATI GLEW_GET_FUN(__glewNewObjectBufferATI) +#define glUpdateObjectBufferATI GLEW_GET_FUN(__glewUpdateObjectBufferATI) +#define glVariantArrayObjectATI GLEW_GET_FUN(__glewVariantArrayObjectATI) + +#define GLEW_ATI_vertex_array_object GLEW_GET_VAR(__GLEW_ATI_vertex_array_object) + +#endif /* GL_ATI_vertex_array_object */ + +/* ------------------- GL_ATI_vertex_attrib_array_object ------------------- */ + +#ifndef GL_ATI_vertex_attrib_array_object +#define GL_ATI_vertex_attrib_array_object 1 + +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBARRAYOBJECTFVATIPROC) (GLuint index, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBARRAYOBJECTIVATIPROC) (GLuint index, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBARRAYOBJECTATIPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLuint buffer, GLuint offset); + +#define glGetVertexAttribArrayObjectfvATI GLEW_GET_FUN(__glewGetVertexAttribArrayObjectfvATI) +#define glGetVertexAttribArrayObjectivATI GLEW_GET_FUN(__glewGetVertexAttribArrayObjectivATI) +#define glVertexAttribArrayObjectATI GLEW_GET_FUN(__glewVertexAttribArrayObjectATI) + +#define GLEW_ATI_vertex_attrib_array_object GLEW_GET_VAR(__GLEW_ATI_vertex_attrib_array_object) + +#endif /* GL_ATI_vertex_attrib_array_object */ + +/* ------------------------- GL_ATI_vertex_streams ------------------------- */ + +#ifndef GL_ATI_vertex_streams +#define GL_ATI_vertex_streams 1 + +#define GL_MAX_VERTEX_STREAMS_ATI 0x876B +#define GL_VERTEX_SOURCE_ATI 0x876C +#define GL_VERTEX_STREAM0_ATI 0x876D +#define GL_VERTEX_STREAM1_ATI 0x876E +#define GL_VERTEX_STREAM2_ATI 0x876F +#define GL_VERTEX_STREAM3_ATI 0x8770 +#define GL_VERTEX_STREAM4_ATI 0x8771 +#define GL_VERTEX_STREAM5_ATI 0x8772 +#define GL_VERTEX_STREAM6_ATI 0x8773 +#define GL_VERTEX_STREAM7_ATI 0x8774 + +typedef void (GLAPIENTRY * PFNGLCLIENTACTIVEVERTEXSTREAMATIPROC) (GLenum stream); +typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3BATIPROC) (GLenum stream, GLbyte x, GLbyte y, GLbyte z); +typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3BVATIPROC) (GLenum stream, const GLbyte *coords); +typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3DVATIPROC) (GLenum stream, const GLdouble *coords); +typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3FVATIPROC) (GLenum stream, const GLfloat *coords); +typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3IATIPROC) (GLenum stream, GLint x, GLint y, GLint z); +typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3IVATIPROC) (GLenum stream, const GLint *coords); +typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z); +typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3SVATIPROC) (GLenum stream, const GLshort *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXBLENDENVFATIPROC) (GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLVERTEXBLENDENVIATIPROC) (GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM1DATIPROC) (GLenum stream, GLdouble x); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM1DVATIPROC) (GLenum stream, const GLdouble *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM1FATIPROC) (GLenum stream, GLfloat x); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM1FVATIPROC) (GLenum stream, const GLfloat *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM1IATIPROC) (GLenum stream, GLint x); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM1IVATIPROC) (GLenum stream, const GLint *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM1SATIPROC) (GLenum stream, GLshort x); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM1SVATIPROC) (GLenum stream, const GLshort *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2DATIPROC) (GLenum stream, GLdouble x, GLdouble y); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2DVATIPROC) (GLenum stream, const GLdouble *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2FATIPROC) (GLenum stream, GLfloat x, GLfloat y); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2FVATIPROC) (GLenum stream, const GLfloat *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2IATIPROC) (GLenum stream, GLint x, GLint y); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2IVATIPROC) (GLenum stream, const GLint *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2SATIPROC) (GLenum stream, GLshort x, GLshort y); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2SVATIPROC) (GLenum stream, const GLshort *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3DVATIPROC) (GLenum stream, const GLdouble *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3FVATIPROC) (GLenum stream, const GLfloat *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3IATIPROC) (GLenum stream, GLint x, GLint y, GLint z); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3IVATIPROC) (GLenum stream, const GLint *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3SVATIPROC) (GLenum stream, const GLshort *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4DVATIPROC) (GLenum stream, const GLdouble *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4FVATIPROC) (GLenum stream, const GLfloat *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4IATIPROC) (GLenum stream, GLint x, GLint y, GLint z, GLint w); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4IVATIPROC) (GLenum stream, const GLint *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z, GLshort w); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4SVATIPROC) (GLenum stream, const GLshort *coords); + +#define glClientActiveVertexStreamATI GLEW_GET_FUN(__glewClientActiveVertexStreamATI) +#define glNormalStream3bATI GLEW_GET_FUN(__glewNormalStream3bATI) +#define glNormalStream3bvATI GLEW_GET_FUN(__glewNormalStream3bvATI) +#define glNormalStream3dATI GLEW_GET_FUN(__glewNormalStream3dATI) +#define glNormalStream3dvATI GLEW_GET_FUN(__glewNormalStream3dvATI) +#define glNormalStream3fATI GLEW_GET_FUN(__glewNormalStream3fATI) +#define glNormalStream3fvATI GLEW_GET_FUN(__glewNormalStream3fvATI) +#define glNormalStream3iATI GLEW_GET_FUN(__glewNormalStream3iATI) +#define glNormalStream3ivATI GLEW_GET_FUN(__glewNormalStream3ivATI) +#define glNormalStream3sATI GLEW_GET_FUN(__glewNormalStream3sATI) +#define glNormalStream3svATI GLEW_GET_FUN(__glewNormalStream3svATI) +#define glVertexBlendEnvfATI GLEW_GET_FUN(__glewVertexBlendEnvfATI) +#define glVertexBlendEnviATI GLEW_GET_FUN(__glewVertexBlendEnviATI) +#define glVertexStream1dATI GLEW_GET_FUN(__glewVertexStream1dATI) +#define glVertexStream1dvATI GLEW_GET_FUN(__glewVertexStream1dvATI) +#define glVertexStream1fATI GLEW_GET_FUN(__glewVertexStream1fATI) +#define glVertexStream1fvATI GLEW_GET_FUN(__glewVertexStream1fvATI) +#define glVertexStream1iATI GLEW_GET_FUN(__glewVertexStream1iATI) +#define glVertexStream1ivATI GLEW_GET_FUN(__glewVertexStream1ivATI) +#define glVertexStream1sATI GLEW_GET_FUN(__glewVertexStream1sATI) +#define glVertexStream1svATI GLEW_GET_FUN(__glewVertexStream1svATI) +#define glVertexStream2dATI GLEW_GET_FUN(__glewVertexStream2dATI) +#define glVertexStream2dvATI GLEW_GET_FUN(__glewVertexStream2dvATI) +#define glVertexStream2fATI GLEW_GET_FUN(__glewVertexStream2fATI) +#define glVertexStream2fvATI GLEW_GET_FUN(__glewVertexStream2fvATI) +#define glVertexStream2iATI GLEW_GET_FUN(__glewVertexStream2iATI) +#define glVertexStream2ivATI GLEW_GET_FUN(__glewVertexStream2ivATI) +#define glVertexStream2sATI GLEW_GET_FUN(__glewVertexStream2sATI) +#define glVertexStream2svATI GLEW_GET_FUN(__glewVertexStream2svATI) +#define glVertexStream3dATI GLEW_GET_FUN(__glewVertexStream3dATI) +#define glVertexStream3dvATI GLEW_GET_FUN(__glewVertexStream3dvATI) +#define glVertexStream3fATI GLEW_GET_FUN(__glewVertexStream3fATI) +#define glVertexStream3fvATI GLEW_GET_FUN(__glewVertexStream3fvATI) +#define glVertexStream3iATI GLEW_GET_FUN(__glewVertexStream3iATI) +#define glVertexStream3ivATI GLEW_GET_FUN(__glewVertexStream3ivATI) +#define glVertexStream3sATI GLEW_GET_FUN(__glewVertexStream3sATI) +#define glVertexStream3svATI GLEW_GET_FUN(__glewVertexStream3svATI) +#define glVertexStream4dATI GLEW_GET_FUN(__glewVertexStream4dATI) +#define glVertexStream4dvATI GLEW_GET_FUN(__glewVertexStream4dvATI) +#define glVertexStream4fATI GLEW_GET_FUN(__glewVertexStream4fATI) +#define glVertexStream4fvATI GLEW_GET_FUN(__glewVertexStream4fvATI) +#define glVertexStream4iATI GLEW_GET_FUN(__glewVertexStream4iATI) +#define glVertexStream4ivATI GLEW_GET_FUN(__glewVertexStream4ivATI) +#define glVertexStream4sATI GLEW_GET_FUN(__glewVertexStream4sATI) +#define glVertexStream4svATI GLEW_GET_FUN(__glewVertexStream4svATI) + +#define GLEW_ATI_vertex_streams GLEW_GET_VAR(__GLEW_ATI_vertex_streams) + +#endif /* GL_ATI_vertex_streams */ + +/* --------------------------- GL_EXT_422_pixels --------------------------- */ + +#ifndef GL_EXT_422_pixels +#define GL_EXT_422_pixels 1 + +#define GL_422_EXT 0x80CC +#define GL_422_REV_EXT 0x80CD +#define GL_422_AVERAGE_EXT 0x80CE +#define GL_422_REV_AVERAGE_EXT 0x80CF + +#define GLEW_EXT_422_pixels GLEW_GET_VAR(__GLEW_EXT_422_pixels) + +#endif /* GL_EXT_422_pixels */ + +/* ---------------------------- GL_EXT_Cg_shader --------------------------- */ + +#ifndef GL_EXT_Cg_shader +#define GL_EXT_Cg_shader 1 + +#define GL_CG_VERTEX_SHADER_EXT 0x890E +#define GL_CG_FRAGMENT_SHADER_EXT 0x890F + +#define GLEW_EXT_Cg_shader GLEW_GET_VAR(__GLEW_EXT_Cg_shader) + +#endif /* GL_EXT_Cg_shader */ + +/* ------------------------------ GL_EXT_abgr ------------------------------ */ + +#ifndef GL_EXT_abgr +#define GL_EXT_abgr 1 + +#define GL_ABGR_EXT 0x8000 + +#define GLEW_EXT_abgr GLEW_GET_VAR(__GLEW_EXT_abgr) + +#endif /* GL_EXT_abgr */ + +/* ------------------------------ GL_EXT_bgra ------------------------------ */ + +#ifndef GL_EXT_bgra +#define GL_EXT_bgra 1 + +#define GL_BGR_EXT 0x80E0 +#define GL_BGRA_EXT 0x80E1 + +#define GLEW_EXT_bgra GLEW_GET_VAR(__GLEW_EXT_bgra) + +#endif /* GL_EXT_bgra */ + +/* ------------------------ GL_EXT_bindable_uniform ------------------------ */ + +#ifndef GL_EXT_bindable_uniform +#define GL_EXT_bindable_uniform 1 + +#define GL_MAX_VERTEX_BINDABLE_UNIFORMS_EXT 0x8DE2 +#define GL_MAX_FRAGMENT_BINDABLE_UNIFORMS_EXT 0x8DE3 +#define GL_MAX_GEOMETRY_BINDABLE_UNIFORMS_EXT 0x8DE4 +#define GL_MAX_BINDABLE_UNIFORM_SIZE_EXT 0x8DED +#define GL_UNIFORM_BUFFER_EXT 0x8DEE +#define GL_UNIFORM_BUFFER_BINDING_EXT 0x8DEF + +typedef GLint (GLAPIENTRY * PFNGLGETUNIFORMBUFFERSIZEEXTPROC) (GLuint program, GLint location); +typedef GLintptr (GLAPIENTRY * PFNGLGETUNIFORMOFFSETEXTPROC) (GLuint program, GLint location); +typedef void (GLAPIENTRY * PFNGLUNIFORMBUFFEREXTPROC) (GLuint program, GLint location, GLuint buffer); + +#define glGetUniformBufferSizeEXT GLEW_GET_FUN(__glewGetUniformBufferSizeEXT) +#define glGetUniformOffsetEXT GLEW_GET_FUN(__glewGetUniformOffsetEXT) +#define glUniformBufferEXT GLEW_GET_FUN(__glewUniformBufferEXT) + +#define GLEW_EXT_bindable_uniform GLEW_GET_VAR(__GLEW_EXT_bindable_uniform) + +#endif /* GL_EXT_bindable_uniform */ + +/* --------------------------- GL_EXT_blend_color -------------------------- */ + +#ifndef GL_EXT_blend_color +#define GL_EXT_blend_color 1 + +#define GL_CONSTANT_COLOR_EXT 0x8001 +#define GL_ONE_MINUS_CONSTANT_COLOR_EXT 0x8002 +#define GL_CONSTANT_ALPHA_EXT 0x8003 +#define GL_ONE_MINUS_CONSTANT_ALPHA_EXT 0x8004 +#define GL_BLEND_COLOR_EXT 0x8005 + +typedef void (GLAPIENTRY * PFNGLBLENDCOLOREXTPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); + +#define glBlendColorEXT GLEW_GET_FUN(__glewBlendColorEXT) + +#define GLEW_EXT_blend_color GLEW_GET_VAR(__GLEW_EXT_blend_color) + +#endif /* GL_EXT_blend_color */ + +/* --------------------- GL_EXT_blend_equation_separate -------------------- */ + +#ifndef GL_EXT_blend_equation_separate +#define GL_EXT_blend_equation_separate 1 + +#define GL_BLEND_EQUATION_RGB_EXT 0x8009 +#define GL_BLEND_EQUATION_ALPHA_EXT 0x883D + +typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONSEPARATEEXTPROC) (GLenum modeRGB, GLenum modeAlpha); + +#define glBlendEquationSeparateEXT GLEW_GET_FUN(__glewBlendEquationSeparateEXT) + +#define GLEW_EXT_blend_equation_separate GLEW_GET_VAR(__GLEW_EXT_blend_equation_separate) + +#endif /* GL_EXT_blend_equation_separate */ + +/* ----------------------- GL_EXT_blend_func_separate ---------------------- */ + +#ifndef GL_EXT_blend_func_separate +#define GL_EXT_blend_func_separate 1 + +#define GL_BLEND_DST_RGB_EXT 0x80C8 +#define GL_BLEND_SRC_RGB_EXT 0x80C9 +#define GL_BLEND_DST_ALPHA_EXT 0x80CA +#define GL_BLEND_SRC_ALPHA_EXT 0x80CB + +typedef void (GLAPIENTRY * PFNGLBLENDFUNCSEPARATEEXTPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); + +#define glBlendFuncSeparateEXT GLEW_GET_FUN(__glewBlendFuncSeparateEXT) + +#define GLEW_EXT_blend_func_separate GLEW_GET_VAR(__GLEW_EXT_blend_func_separate) + +#endif /* GL_EXT_blend_func_separate */ + +/* ------------------------- GL_EXT_blend_logic_op ------------------------- */ + +#ifndef GL_EXT_blend_logic_op +#define GL_EXT_blend_logic_op 1 + +#define GLEW_EXT_blend_logic_op GLEW_GET_VAR(__GLEW_EXT_blend_logic_op) + +#endif /* GL_EXT_blend_logic_op */ + +/* -------------------------- GL_EXT_blend_minmax -------------------------- */ + +#ifndef GL_EXT_blend_minmax +#define GL_EXT_blend_minmax 1 + +#define GL_FUNC_ADD_EXT 0x8006 +#define GL_MIN_EXT 0x8007 +#define GL_MAX_EXT 0x8008 +#define GL_BLEND_EQUATION_EXT 0x8009 + +typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONEXTPROC) (GLenum mode); + +#define glBlendEquationEXT GLEW_GET_FUN(__glewBlendEquationEXT) + +#define GLEW_EXT_blend_minmax GLEW_GET_VAR(__GLEW_EXT_blend_minmax) + +#endif /* GL_EXT_blend_minmax */ + +/* ------------------------- GL_EXT_blend_subtract ------------------------- */ + +#ifndef GL_EXT_blend_subtract +#define GL_EXT_blend_subtract 1 + +#define GL_FUNC_SUBTRACT_EXT 0x800A +#define GL_FUNC_REVERSE_SUBTRACT_EXT 0x800B + +#define GLEW_EXT_blend_subtract GLEW_GET_VAR(__GLEW_EXT_blend_subtract) + +#endif /* GL_EXT_blend_subtract */ + +/* ------------------------ GL_EXT_clip_volume_hint ------------------------ */ + +#ifndef GL_EXT_clip_volume_hint +#define GL_EXT_clip_volume_hint 1 + +#define GL_CLIP_VOLUME_CLIPPING_HINT_EXT 0x80F0 + +#define GLEW_EXT_clip_volume_hint GLEW_GET_VAR(__GLEW_EXT_clip_volume_hint) + +#endif /* GL_EXT_clip_volume_hint */ + +/* ------------------------------ GL_EXT_cmyka ----------------------------- */ + +#ifndef GL_EXT_cmyka +#define GL_EXT_cmyka 1 + +#define GL_CMYK_EXT 0x800C +#define GL_CMYKA_EXT 0x800D +#define GL_PACK_CMYK_HINT_EXT 0x800E +#define GL_UNPACK_CMYK_HINT_EXT 0x800F + +#define GLEW_EXT_cmyka GLEW_GET_VAR(__GLEW_EXT_cmyka) + +#endif /* GL_EXT_cmyka */ + +/* ------------------------- GL_EXT_color_subtable ------------------------- */ + +#ifndef GL_EXT_color_subtable +#define GL_EXT_color_subtable 1 + +typedef void (GLAPIENTRY * PFNGLCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLCOPYCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); + +#define glColorSubTableEXT GLEW_GET_FUN(__glewColorSubTableEXT) +#define glCopyColorSubTableEXT GLEW_GET_FUN(__glewCopyColorSubTableEXT) + +#define GLEW_EXT_color_subtable GLEW_GET_VAR(__GLEW_EXT_color_subtable) + +#endif /* GL_EXT_color_subtable */ + +/* ---------------------- GL_EXT_compiled_vertex_array --------------------- */ + +#ifndef GL_EXT_compiled_vertex_array +#define GL_EXT_compiled_vertex_array 1 + +#define GL_ARRAY_ELEMENT_LOCK_FIRST_EXT 0x81A8 +#define GL_ARRAY_ELEMENT_LOCK_COUNT_EXT 0x81A9 + +typedef void (GLAPIENTRY * PFNGLLOCKARRAYSEXTPROC) (GLint first, GLsizei count); +typedef void (GLAPIENTRY * PFNGLUNLOCKARRAYSEXTPROC) (void); + +#define glLockArraysEXT GLEW_GET_FUN(__glewLockArraysEXT) +#define glUnlockArraysEXT GLEW_GET_FUN(__glewUnlockArraysEXT) + +#define GLEW_EXT_compiled_vertex_array GLEW_GET_VAR(__GLEW_EXT_compiled_vertex_array) + +#endif /* GL_EXT_compiled_vertex_array */ + +/* --------------------------- GL_EXT_convolution -------------------------- */ + +#ifndef GL_EXT_convolution +#define GL_EXT_convolution 1 + +#define GL_CONVOLUTION_1D_EXT 0x8010 +#define GL_CONVOLUTION_2D_EXT 0x8011 +#define GL_SEPARABLE_2D_EXT 0x8012 +#define GL_CONVOLUTION_BORDER_MODE_EXT 0x8013 +#define GL_CONVOLUTION_FILTER_SCALE_EXT 0x8014 +#define GL_CONVOLUTION_FILTER_BIAS_EXT 0x8015 +#define GL_REDUCE_EXT 0x8016 +#define GL_CONVOLUTION_FORMAT_EXT 0x8017 +#define GL_CONVOLUTION_WIDTH_EXT 0x8018 +#define GL_CONVOLUTION_HEIGHT_EXT 0x8019 +#define GL_MAX_CONVOLUTION_WIDTH_EXT 0x801A +#define GL_MAX_CONVOLUTION_HEIGHT_EXT 0x801B +#define GL_POST_CONVOLUTION_RED_SCALE_EXT 0x801C +#define GL_POST_CONVOLUTION_GREEN_SCALE_EXT 0x801D +#define GL_POST_CONVOLUTION_BLUE_SCALE_EXT 0x801E +#define GL_POST_CONVOLUTION_ALPHA_SCALE_EXT 0x801F +#define GL_POST_CONVOLUTION_RED_BIAS_EXT 0x8020 +#define GL_POST_CONVOLUTION_GREEN_BIAS_EXT 0x8021 +#define GL_POST_CONVOLUTION_BLUE_BIAS_EXT 0x8022 +#define GL_POST_CONVOLUTION_ALPHA_BIAS_EXT 0x8023 + +typedef void (GLAPIENTRY * PFNGLCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image); +typedef void (GLAPIENTRY * PFNGLCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image); +typedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERFEXTPROC) (GLenum target, GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERIEXTPROC) (GLenum target, GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLCOPYCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +typedef void (GLAPIENTRY * PFNGLCOPYCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLGETCONVOLUTIONFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *image); +typedef void (GLAPIENTRY * PFNGLGETCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETSEPARABLEFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span); +typedef void (GLAPIENTRY * PFNGLSEPARABLEFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column); + +#define glConvolutionFilter1DEXT GLEW_GET_FUN(__glewConvolutionFilter1DEXT) +#define glConvolutionFilter2DEXT GLEW_GET_FUN(__glewConvolutionFilter2DEXT) +#define glConvolutionParameterfEXT GLEW_GET_FUN(__glewConvolutionParameterfEXT) +#define glConvolutionParameterfvEXT GLEW_GET_FUN(__glewConvolutionParameterfvEXT) +#define glConvolutionParameteriEXT GLEW_GET_FUN(__glewConvolutionParameteriEXT) +#define glConvolutionParameterivEXT GLEW_GET_FUN(__glewConvolutionParameterivEXT) +#define glCopyConvolutionFilter1DEXT GLEW_GET_FUN(__glewCopyConvolutionFilter1DEXT) +#define glCopyConvolutionFilter2DEXT GLEW_GET_FUN(__glewCopyConvolutionFilter2DEXT) +#define glGetConvolutionFilterEXT GLEW_GET_FUN(__glewGetConvolutionFilterEXT) +#define glGetConvolutionParameterfvEXT GLEW_GET_FUN(__glewGetConvolutionParameterfvEXT) +#define glGetConvolutionParameterivEXT GLEW_GET_FUN(__glewGetConvolutionParameterivEXT) +#define glGetSeparableFilterEXT GLEW_GET_FUN(__glewGetSeparableFilterEXT) +#define glSeparableFilter2DEXT GLEW_GET_FUN(__glewSeparableFilter2DEXT) + +#define GLEW_EXT_convolution GLEW_GET_VAR(__GLEW_EXT_convolution) + +#endif /* GL_EXT_convolution */ + +/* ------------------------ GL_EXT_coordinate_frame ------------------------ */ + +#ifndef GL_EXT_coordinate_frame +#define GL_EXT_coordinate_frame 1 + +#define GL_TANGENT_ARRAY_EXT 0x8439 +#define GL_BINORMAL_ARRAY_EXT 0x843A +#define GL_CURRENT_TANGENT_EXT 0x843B +#define GL_CURRENT_BINORMAL_EXT 0x843C +#define GL_TANGENT_ARRAY_TYPE_EXT 0x843E +#define GL_TANGENT_ARRAY_STRIDE_EXT 0x843F +#define GL_BINORMAL_ARRAY_TYPE_EXT 0x8440 +#define GL_BINORMAL_ARRAY_STRIDE_EXT 0x8441 +#define GL_TANGENT_ARRAY_POINTER_EXT 0x8442 +#define GL_BINORMAL_ARRAY_POINTER_EXT 0x8443 +#define GL_MAP1_TANGENT_EXT 0x8444 +#define GL_MAP2_TANGENT_EXT 0x8445 +#define GL_MAP1_BINORMAL_EXT 0x8446 +#define GL_MAP2_BINORMAL_EXT 0x8447 + +typedef void (GLAPIENTRY * PFNGLBINORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, GLvoid *pointer); +typedef void (GLAPIENTRY * PFNGLTANGENTPOINTEREXTPROC) (GLenum type, GLsizei stride, GLvoid *pointer); + +#define glBinormalPointerEXT GLEW_GET_FUN(__glewBinormalPointerEXT) +#define glTangentPointerEXT GLEW_GET_FUN(__glewTangentPointerEXT) + +#define GLEW_EXT_coordinate_frame GLEW_GET_VAR(__GLEW_EXT_coordinate_frame) + +#endif /* GL_EXT_coordinate_frame */ + +/* -------------------------- GL_EXT_copy_texture -------------------------- */ + +#ifndef GL_EXT_copy_texture +#define GL_EXT_copy_texture 1 + +typedef void (GLAPIENTRY * PFNGLCOPYTEXIMAGE1DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); +typedef void (GLAPIENTRY * PFNGLCOPYTEXIMAGE2DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); +typedef void (GLAPIENTRY * PFNGLCOPYTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); +typedef void (GLAPIENTRY * PFNGLCOPYTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLCOPYTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); + +#define glCopyTexImage1DEXT GLEW_GET_FUN(__glewCopyTexImage1DEXT) +#define glCopyTexImage2DEXT GLEW_GET_FUN(__glewCopyTexImage2DEXT) +#define glCopyTexSubImage1DEXT GLEW_GET_FUN(__glewCopyTexSubImage1DEXT) +#define glCopyTexSubImage2DEXT GLEW_GET_FUN(__glewCopyTexSubImage2DEXT) +#define glCopyTexSubImage3DEXT GLEW_GET_FUN(__glewCopyTexSubImage3DEXT) + +#define GLEW_EXT_copy_texture GLEW_GET_VAR(__GLEW_EXT_copy_texture) + +#endif /* GL_EXT_copy_texture */ + +/* --------------------------- GL_EXT_cull_vertex -------------------------- */ + +#ifndef GL_EXT_cull_vertex +#define GL_EXT_cull_vertex 1 + +#define GL_CULL_VERTEX_EXT 0x81AA +#define GL_CULL_VERTEX_EYE_POSITION_EXT 0x81AB +#define GL_CULL_VERTEX_OBJECT_POSITION_EXT 0x81AC + +typedef void (GLAPIENTRY * PFNGLCULLPARAMETERDVEXTPROC) (GLenum pname, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLCULLPARAMETERFVEXTPROC) (GLenum pname, GLfloat* params); + +#define glCullParameterdvEXT GLEW_GET_FUN(__glewCullParameterdvEXT) +#define glCullParameterfvEXT GLEW_GET_FUN(__glewCullParameterfvEXT) + +#define GLEW_EXT_cull_vertex GLEW_GET_VAR(__GLEW_EXT_cull_vertex) + +#endif /* GL_EXT_cull_vertex */ + +/* -------------------------- GL_EXT_debug_marker -------------------------- */ + +#ifndef GL_EXT_debug_marker +#define GL_EXT_debug_marker 1 + +typedef void (GLAPIENTRY * PFNGLINSERTEVENTMARKEREXTPROC) (GLsizei length, const GLchar* marker); +typedef void (GLAPIENTRY * PFNGLPOPGROUPMARKEREXTPROC) (void); +typedef void (GLAPIENTRY * PFNGLPUSHGROUPMARKEREXTPROC) (GLsizei length, const GLchar* marker); + +#define glInsertEventMarkerEXT GLEW_GET_FUN(__glewInsertEventMarkerEXT) +#define glPopGroupMarkerEXT GLEW_GET_FUN(__glewPopGroupMarkerEXT) +#define glPushGroupMarkerEXT GLEW_GET_FUN(__glewPushGroupMarkerEXT) + +#define GLEW_EXT_debug_marker GLEW_GET_VAR(__GLEW_EXT_debug_marker) + +#endif /* GL_EXT_debug_marker */ + +/* ------------------------ GL_EXT_depth_bounds_test ----------------------- */ + +#ifndef GL_EXT_depth_bounds_test +#define GL_EXT_depth_bounds_test 1 + +#define GL_DEPTH_BOUNDS_TEST_EXT 0x8890 +#define GL_DEPTH_BOUNDS_EXT 0x8891 + +typedef void (GLAPIENTRY * PFNGLDEPTHBOUNDSEXTPROC) (GLclampd zmin, GLclampd zmax); + +#define glDepthBoundsEXT GLEW_GET_FUN(__glewDepthBoundsEXT) + +#define GLEW_EXT_depth_bounds_test GLEW_GET_VAR(__GLEW_EXT_depth_bounds_test) + +#endif /* GL_EXT_depth_bounds_test */ + +/* ----------------------- GL_EXT_direct_state_access ---------------------- */ + +#ifndef GL_EXT_direct_state_access +#define GL_EXT_direct_state_access 1 + +#define GL_PROGRAM_MATRIX_EXT 0x8E2D +#define GL_TRANSPOSE_PROGRAM_MATRIX_EXT 0x8E2E +#define GL_PROGRAM_MATRIX_STACK_DEPTH_EXT 0x8E2F + +typedef void (GLAPIENTRY * PFNGLBINDMULTITEXTUREEXTPROC) (GLenum texunit, GLenum target, GLuint texture); +typedef GLenum (GLAPIENTRY * PFNGLCHECKNAMEDFRAMEBUFFERSTATUSEXTPROC) (GLuint framebuffer, GLenum target); +typedef void (GLAPIENTRY * PFNGLCLIENTATTRIBDEFAULTEXTPROC) (GLbitfield mask); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDMULTITEXIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDMULTITEXIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDMULTITEXIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDMULTITEXSUBIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDMULTITEXSUBIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDMULTITEXSUBIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXTUREIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXTUREIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXTUREIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXTURESUBIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXTURESUBIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXTURESUBIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLCOPYMULTITEXIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); +typedef void (GLAPIENTRY * PFNGLCOPYMULTITEXIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); +typedef void (GLAPIENTRY * PFNGLCOPYMULTITEXSUBIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); +typedef void (GLAPIENTRY * PFNGLCOPYMULTITEXSUBIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLCOPYMULTITEXSUBIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLCOPYTEXTUREIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); +typedef void (GLAPIENTRY * PFNGLCOPYTEXTUREIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); +typedef void (GLAPIENTRY * PFNGLCOPYTEXTURESUBIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); +typedef void (GLAPIENTRY * PFNGLCOPYTEXTURESUBIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLCOPYTEXTURESUBIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLDISABLECLIENTSTATEINDEXEDEXTPROC) (GLenum array, GLuint index); +typedef void (GLAPIENTRY * PFNGLDISABLECLIENTSTATEIEXTPROC) (GLenum array, GLuint index); +typedef void (GLAPIENTRY * PFNGLDISABLEVERTEXARRAYATTRIBEXTPROC) (GLuint vaobj, GLuint index); +typedef void (GLAPIENTRY * PFNGLDISABLEVERTEXARRAYEXTPROC) (GLuint vaobj, GLenum array); +typedef void (GLAPIENTRY * PFNGLENABLECLIENTSTATEINDEXEDEXTPROC) (GLenum array, GLuint index); +typedef void (GLAPIENTRY * PFNGLENABLECLIENTSTATEIEXTPROC) (GLenum array, GLuint index); +typedef void (GLAPIENTRY * PFNGLENABLEVERTEXARRAYATTRIBEXTPROC) (GLuint vaobj, GLuint index); +typedef void (GLAPIENTRY * PFNGLENABLEVERTEXARRAYEXTPROC) (GLuint vaobj, GLenum array); +typedef void (GLAPIENTRY * PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr length); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERDRAWBUFFEREXTPROC) (GLuint framebuffer, GLenum mode); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERDRAWBUFFERSEXTPROC) (GLuint framebuffer, GLsizei n, const GLenum* bufs); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERREADBUFFEREXTPROC) (GLuint framebuffer, GLenum mode); +typedef void (GLAPIENTRY * PFNGLGENERATEMULTITEXMIPMAPEXTPROC) (GLenum texunit, GLenum target); +typedef void (GLAPIENTRY * PFNGLGENERATETEXTUREMIPMAPEXTPROC) (GLuint texture, GLenum target); +typedef void (GLAPIENTRY * PFNGLGETCOMPRESSEDMULTITEXIMAGEEXTPROC) (GLenum texunit, GLenum target, GLint level, GLvoid *img); +typedef void (GLAPIENTRY * PFNGLGETCOMPRESSEDTEXTUREIMAGEEXTPROC) (GLuint texture, GLenum target, GLint level, GLvoid *img); +typedef void (GLAPIENTRY * PFNGLGETDOUBLEINDEXEDVEXTPROC) (GLenum target, GLuint index, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLGETDOUBLEI_VEXTPROC) (GLenum pname, GLuint index, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLGETFLOATINDEXEDVEXTPROC) (GLenum target, GLuint index, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETFLOATI_VEXTPROC) (GLenum pname, GLuint index, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETFRAMEBUFFERPARAMETERIVEXTPROC) (GLuint framebuffer, GLenum pname, GLint* param); +typedef void (GLAPIENTRY * PFNGLGETMULTITEXENVFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETMULTITEXENVIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETMULTITEXGENDVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLGETMULTITEXGENFVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETMULTITEXGENIVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETMULTITEXIMAGEEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels); +typedef void (GLAPIENTRY * PFNGLGETMULTITEXLEVELPARAMETERFVEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETMULTITEXLEVELPARAMETERIVEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETMULTITEXPARAMETERIIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETMULTITEXPARAMETERIUIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLuint* params); +typedef void (GLAPIENTRY * PFNGLGETMULTITEXPARAMETERFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETMULTITEXPARAMETERIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETNAMEDBUFFERPARAMETERIVEXTPROC) (GLuint buffer, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETNAMEDBUFFERPOINTERVEXTPROC) (GLuint buffer, GLenum pname, void** params); +typedef void (GLAPIENTRY * PFNGLGETNAMEDBUFFERSUBDATAEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, GLvoid *data); +typedef void (GLAPIENTRY * PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETNAMEDPROGRAMLOCALPARAMETERIIVEXTPROC) (GLuint program, GLenum target, GLuint index, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETNAMEDPROGRAMLOCALPARAMETERIUIVEXTPROC) (GLuint program, GLenum target, GLuint index, GLuint* params); +typedef void (GLAPIENTRY * PFNGLGETNAMEDPROGRAMLOCALPARAMETERDVEXTPROC) (GLuint program, GLenum target, GLuint index, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLGETNAMEDPROGRAMLOCALPARAMETERFVEXTPROC) (GLuint program, GLenum target, GLuint index, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETNAMEDPROGRAMSTRINGEXTPROC) (GLuint program, GLenum target, GLenum pname, GLvoid *string); +typedef void (GLAPIENTRY * PFNGLGETNAMEDPROGRAMIVEXTPROC) (GLuint program, GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETNAMEDRENDERBUFFERPARAMETERIVEXTPROC) (GLuint renderbuffer, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETPOINTERINDEXEDVEXTPROC) (GLenum target, GLuint index, GLvoid** params); +typedef void (GLAPIENTRY * PFNGLGETPOINTERI_VEXTPROC) (GLenum pname, GLuint index, GLvoid** params); +typedef void (GLAPIENTRY * PFNGLGETTEXTUREIMAGEEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels); +typedef void (GLAPIENTRY * PFNGLGETTEXTURELEVELPARAMETERFVEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETTEXTURELEVELPARAMETERIVEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETTEXTUREPARAMETERIIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETTEXTUREPARAMETERIUIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLuint* params); +typedef void (GLAPIENTRY * PFNGLGETTEXTUREPARAMETERFVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETTEXTUREPARAMETERIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETVERTEXARRAYINTEGERI_VEXTPROC) (GLuint vaobj, GLuint index, GLenum pname, GLint* param); +typedef void (GLAPIENTRY * PFNGLGETVERTEXARRAYINTEGERVEXTPROC) (GLuint vaobj, GLenum pname, GLint* param); +typedef void (GLAPIENTRY * PFNGLGETVERTEXARRAYPOINTERI_VEXTPROC) (GLuint vaobj, GLuint index, GLenum pname, GLvoid** param); +typedef void (GLAPIENTRY * PFNGLGETVERTEXARRAYPOINTERVEXTPROC) (GLuint vaobj, GLenum pname, GLvoid** param); +typedef GLvoid * (GLAPIENTRY * PFNGLMAPNAMEDBUFFEREXTPROC) (GLuint buffer, GLenum access); +typedef GLvoid * (GLAPIENTRY * PFNGLMAPNAMEDBUFFERRANGEEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr length, GLbitfield access); +typedef void (GLAPIENTRY * PFNGLMATRIXFRUSTUMEXTPROC) (GLenum matrixMode, GLdouble l, GLdouble r, GLdouble b, GLdouble t, GLdouble n, GLdouble f); +typedef void (GLAPIENTRY * PFNGLMATRIXLOADIDENTITYEXTPROC) (GLenum matrixMode); +typedef void (GLAPIENTRY * PFNGLMATRIXLOADTRANSPOSEDEXTPROC) (GLenum matrixMode, const GLdouble* m); +typedef void (GLAPIENTRY * PFNGLMATRIXLOADTRANSPOSEFEXTPROC) (GLenum matrixMode, const GLfloat* m); +typedef void (GLAPIENTRY * PFNGLMATRIXLOADDEXTPROC) (GLenum matrixMode, const GLdouble* m); +typedef void (GLAPIENTRY * PFNGLMATRIXLOADFEXTPROC) (GLenum matrixMode, const GLfloat* m); +typedef void (GLAPIENTRY * PFNGLMATRIXMULTTRANSPOSEDEXTPROC) (GLenum matrixMode, const GLdouble* m); +typedef void (GLAPIENTRY * PFNGLMATRIXMULTTRANSPOSEFEXTPROC) (GLenum matrixMode, const GLfloat* m); +typedef void (GLAPIENTRY * PFNGLMATRIXMULTDEXTPROC) (GLenum matrixMode, const GLdouble* m); +typedef void (GLAPIENTRY * PFNGLMATRIXMULTFEXTPROC) (GLenum matrixMode, const GLfloat* m); +typedef void (GLAPIENTRY * PFNGLMATRIXORTHOEXTPROC) (GLenum matrixMode, GLdouble l, GLdouble r, GLdouble b, GLdouble t, GLdouble n, GLdouble f); +typedef void (GLAPIENTRY * PFNGLMATRIXPOPEXTPROC) (GLenum matrixMode); +typedef void (GLAPIENTRY * PFNGLMATRIXPUSHEXTPROC) (GLenum matrixMode); +typedef void (GLAPIENTRY * PFNGLMATRIXROTATEDEXTPROC) (GLenum matrixMode, GLdouble angle, GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLMATRIXROTATEFEXTPROC) (GLenum matrixMode, GLfloat angle, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLMATRIXSCALEDEXTPROC) (GLenum matrixMode, GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLMATRIXSCALEFEXTPROC) (GLenum matrixMode, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLMATRIXTRANSLATEDEXTPROC) (GLenum matrixMode, GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLMATRIXTRANSLATEFEXTPROC) (GLenum matrixMode, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLMULTITEXBUFFEREXTPROC) (GLenum texunit, GLenum target, GLenum internalformat, GLuint buffer); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDPOINTEREXTPROC) (GLenum texunit, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +typedef void (GLAPIENTRY * PFNGLMULTITEXENVFEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLMULTITEXENVFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLMULTITEXENVIEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLMULTITEXENVIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLMULTITEXGENDEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLdouble param); +typedef void (GLAPIENTRY * PFNGLMULTITEXGENDVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, const GLdouble* params); +typedef void (GLAPIENTRY * PFNGLMULTITEXGENFEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLMULTITEXGENFVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLMULTITEXGENIEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLMULTITEXGENIVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLMULTITEXIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (GLAPIENTRY * PFNGLMULTITEXIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (GLAPIENTRY * PFNGLMULTITEXIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (GLAPIENTRY * PFNGLMULTITEXPARAMETERIIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLMULTITEXPARAMETERIUIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLuint* params); +typedef void (GLAPIENTRY * PFNGLMULTITEXPARAMETERFEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLMULTITEXPARAMETERFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLfloat* param); +typedef void (GLAPIENTRY * PFNGLMULTITEXPARAMETERIEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLMULTITEXPARAMETERIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLint* param); +typedef void (GLAPIENTRY * PFNGLMULTITEXRENDERBUFFEREXTPROC) (GLenum texunit, GLenum target, GLuint renderbuffer); +typedef void (GLAPIENTRY * PFNGLMULTITEXSUBIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (GLAPIENTRY * PFNGLMULTITEXSUBIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (GLAPIENTRY * PFNGLMULTITEXSUBIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (GLAPIENTRY * PFNGLNAMEDBUFFERDATAEXTPROC) (GLuint buffer, GLsizeiptr size, const GLvoid *data, GLenum usage); +typedef void (GLAPIENTRY * PFNGLNAMEDBUFFERSUBDATAEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLNAMEDCOPYBUFFERSUBDATAEXTPROC) (GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); +typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERRENDERBUFFEREXTPROC) (GLuint framebuffer, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); +typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERTEXTURE1DEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERTEXTURE2DEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERTEXTURE3DEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); +typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERTEXTUREEXTPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level); +typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERTEXTUREFACEEXTPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLenum face); +typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERTEXTURELAYEREXTPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLint layer); +typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETER4DEXTPROC) (GLuint program, GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETER4DVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLdouble* params); +typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETER4FEXTPROC) (GLuint program, GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETER4FVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETERI4IEXTPROC) (GLuint program, GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w); +typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETERI4IVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLint* params); +typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIEXTPROC) (GLuint program, GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); +typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLuint* params); +typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETERS4FVEXTPROC) (GLuint program, GLenum target, GLuint index, GLsizei count, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETERSI4IVEXTPROC) (GLuint program, GLenum target, GLuint index, GLsizei count, const GLint* params); +typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETERSI4UIVEXTPROC) (GLuint program, GLenum target, GLuint index, GLsizei count, const GLuint* params); +typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMSTRINGEXTPROC) (GLuint program, GLenum target, GLenum format, GLsizei len, const GLvoid *string); +typedef void (GLAPIENTRY * PFNGLNAMEDRENDERBUFFERSTORAGEEXTPROC) (GLuint renderbuffer, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLECOVERAGEEXTPROC) (GLuint renderbuffer, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) (GLuint renderbuffer, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1FEXTPROC) (GLuint program, GLint location, GLfloat v0); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1IEXTPROC) (GLuint program, GLint location, GLint v0); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1UIEXTPROC) (GLuint program, GLint location, GLuint v0); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2X3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2X4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3X2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3X4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4X2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4X3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPUSHCLIENTATTRIBDEFAULTEXTPROC) (GLbitfield mask); +typedef void (GLAPIENTRY * PFNGLTEXTUREBUFFEREXTPROC) (GLuint texture, GLenum target, GLenum internalformat, GLuint buffer); +typedef void (GLAPIENTRY * PFNGLTEXTUREIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (GLAPIENTRY * PFNGLTEXTUREIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (GLAPIENTRY * PFNGLTEXTUREIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERIIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERIUIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLuint* params); +typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERFEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERFVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLfloat* param); +typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERIEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLint* param); +typedef void (GLAPIENTRY * PFNGLTEXTURERENDERBUFFEREXTPROC) (GLuint texture, GLenum target, GLuint renderbuffer); +typedef void (GLAPIENTRY * PFNGLTEXTURESUBIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (GLAPIENTRY * PFNGLTEXTURESUBIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (GLAPIENTRY * PFNGLTEXTURESUBIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); +typedef GLboolean (GLAPIENTRY * PFNGLUNMAPNAMEDBUFFEREXTPROC) (GLuint buffer); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYCOLOROFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYEDGEFLAGOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLsizei stride, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYFOGCOORDOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLenum type, GLsizei stride, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYINDEXOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLenum type, GLsizei stride, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYMULTITEXCOORDOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLenum texunit, GLint size, GLenum type, GLsizei stride, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYNORMALOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLenum type, GLsizei stride, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYSECONDARYCOLOROFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYTEXCOORDOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYVERTEXATTRIBIOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLsizei stride, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYVERTEXATTRIBOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYVERTEXOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset); + +#define glBindMultiTextureEXT GLEW_GET_FUN(__glewBindMultiTextureEXT) +#define glCheckNamedFramebufferStatusEXT GLEW_GET_FUN(__glewCheckNamedFramebufferStatusEXT) +#define glClientAttribDefaultEXT GLEW_GET_FUN(__glewClientAttribDefaultEXT) +#define glCompressedMultiTexImage1DEXT GLEW_GET_FUN(__glewCompressedMultiTexImage1DEXT) +#define glCompressedMultiTexImage2DEXT GLEW_GET_FUN(__glewCompressedMultiTexImage2DEXT) +#define glCompressedMultiTexImage3DEXT GLEW_GET_FUN(__glewCompressedMultiTexImage3DEXT) +#define glCompressedMultiTexSubImage1DEXT GLEW_GET_FUN(__glewCompressedMultiTexSubImage1DEXT) +#define glCompressedMultiTexSubImage2DEXT GLEW_GET_FUN(__glewCompressedMultiTexSubImage2DEXT) +#define glCompressedMultiTexSubImage3DEXT GLEW_GET_FUN(__glewCompressedMultiTexSubImage3DEXT) +#define glCompressedTextureImage1DEXT GLEW_GET_FUN(__glewCompressedTextureImage1DEXT) +#define glCompressedTextureImage2DEXT GLEW_GET_FUN(__glewCompressedTextureImage2DEXT) +#define glCompressedTextureImage3DEXT GLEW_GET_FUN(__glewCompressedTextureImage3DEXT) +#define glCompressedTextureSubImage1DEXT GLEW_GET_FUN(__glewCompressedTextureSubImage1DEXT) +#define glCompressedTextureSubImage2DEXT GLEW_GET_FUN(__glewCompressedTextureSubImage2DEXT) +#define glCompressedTextureSubImage3DEXT GLEW_GET_FUN(__glewCompressedTextureSubImage3DEXT) +#define glCopyMultiTexImage1DEXT GLEW_GET_FUN(__glewCopyMultiTexImage1DEXT) +#define glCopyMultiTexImage2DEXT GLEW_GET_FUN(__glewCopyMultiTexImage2DEXT) +#define glCopyMultiTexSubImage1DEXT GLEW_GET_FUN(__glewCopyMultiTexSubImage1DEXT) +#define glCopyMultiTexSubImage2DEXT GLEW_GET_FUN(__glewCopyMultiTexSubImage2DEXT) +#define glCopyMultiTexSubImage3DEXT GLEW_GET_FUN(__glewCopyMultiTexSubImage3DEXT) +#define glCopyTextureImage1DEXT GLEW_GET_FUN(__glewCopyTextureImage1DEXT) +#define glCopyTextureImage2DEXT GLEW_GET_FUN(__glewCopyTextureImage2DEXT) +#define glCopyTextureSubImage1DEXT GLEW_GET_FUN(__glewCopyTextureSubImage1DEXT) +#define glCopyTextureSubImage2DEXT GLEW_GET_FUN(__glewCopyTextureSubImage2DEXT) +#define glCopyTextureSubImage3DEXT GLEW_GET_FUN(__glewCopyTextureSubImage3DEXT) +#define glDisableClientStateIndexedEXT GLEW_GET_FUN(__glewDisableClientStateIndexedEXT) +#define glDisableClientStateiEXT GLEW_GET_FUN(__glewDisableClientStateiEXT) +#define glDisableVertexArrayAttribEXT GLEW_GET_FUN(__glewDisableVertexArrayAttribEXT) +#define glDisableVertexArrayEXT GLEW_GET_FUN(__glewDisableVertexArrayEXT) +#define glEnableClientStateIndexedEXT GLEW_GET_FUN(__glewEnableClientStateIndexedEXT) +#define glEnableClientStateiEXT GLEW_GET_FUN(__glewEnableClientStateiEXT) +#define glEnableVertexArrayAttribEXT GLEW_GET_FUN(__glewEnableVertexArrayAttribEXT) +#define glEnableVertexArrayEXT GLEW_GET_FUN(__glewEnableVertexArrayEXT) +#define glFlushMappedNamedBufferRangeEXT GLEW_GET_FUN(__glewFlushMappedNamedBufferRangeEXT) +#define glFramebufferDrawBufferEXT GLEW_GET_FUN(__glewFramebufferDrawBufferEXT) +#define glFramebufferDrawBuffersEXT GLEW_GET_FUN(__glewFramebufferDrawBuffersEXT) +#define glFramebufferReadBufferEXT GLEW_GET_FUN(__glewFramebufferReadBufferEXT) +#define glGenerateMultiTexMipmapEXT GLEW_GET_FUN(__glewGenerateMultiTexMipmapEXT) +#define glGenerateTextureMipmapEXT GLEW_GET_FUN(__glewGenerateTextureMipmapEXT) +#define glGetCompressedMultiTexImageEXT GLEW_GET_FUN(__glewGetCompressedMultiTexImageEXT) +#define glGetCompressedTextureImageEXT GLEW_GET_FUN(__glewGetCompressedTextureImageEXT) +#define glGetDoubleIndexedvEXT GLEW_GET_FUN(__glewGetDoubleIndexedvEXT) +#define glGetDoublei_vEXT GLEW_GET_FUN(__glewGetDoublei_vEXT) +#define glGetFloatIndexedvEXT GLEW_GET_FUN(__glewGetFloatIndexedvEXT) +#define glGetFloati_vEXT GLEW_GET_FUN(__glewGetFloati_vEXT) +#define glGetFramebufferParameterivEXT GLEW_GET_FUN(__glewGetFramebufferParameterivEXT) +#define glGetMultiTexEnvfvEXT GLEW_GET_FUN(__glewGetMultiTexEnvfvEXT) +#define glGetMultiTexEnvivEXT GLEW_GET_FUN(__glewGetMultiTexEnvivEXT) +#define glGetMultiTexGendvEXT GLEW_GET_FUN(__glewGetMultiTexGendvEXT) +#define glGetMultiTexGenfvEXT GLEW_GET_FUN(__glewGetMultiTexGenfvEXT) +#define glGetMultiTexGenivEXT GLEW_GET_FUN(__glewGetMultiTexGenivEXT) +#define glGetMultiTexImageEXT GLEW_GET_FUN(__glewGetMultiTexImageEXT) +#define glGetMultiTexLevelParameterfvEXT GLEW_GET_FUN(__glewGetMultiTexLevelParameterfvEXT) +#define glGetMultiTexLevelParameterivEXT GLEW_GET_FUN(__glewGetMultiTexLevelParameterivEXT) +#define glGetMultiTexParameterIivEXT GLEW_GET_FUN(__glewGetMultiTexParameterIivEXT) +#define glGetMultiTexParameterIuivEXT GLEW_GET_FUN(__glewGetMultiTexParameterIuivEXT) +#define glGetMultiTexParameterfvEXT GLEW_GET_FUN(__glewGetMultiTexParameterfvEXT) +#define glGetMultiTexParameterivEXT GLEW_GET_FUN(__glewGetMultiTexParameterivEXT) +#define glGetNamedBufferParameterivEXT GLEW_GET_FUN(__glewGetNamedBufferParameterivEXT) +#define glGetNamedBufferPointervEXT GLEW_GET_FUN(__glewGetNamedBufferPointervEXT) +#define glGetNamedBufferSubDataEXT GLEW_GET_FUN(__glewGetNamedBufferSubDataEXT) +#define glGetNamedFramebufferAttachmentParameterivEXT GLEW_GET_FUN(__glewGetNamedFramebufferAttachmentParameterivEXT) +#define glGetNamedProgramLocalParameterIivEXT GLEW_GET_FUN(__glewGetNamedProgramLocalParameterIivEXT) +#define glGetNamedProgramLocalParameterIuivEXT GLEW_GET_FUN(__glewGetNamedProgramLocalParameterIuivEXT) +#define glGetNamedProgramLocalParameterdvEXT GLEW_GET_FUN(__glewGetNamedProgramLocalParameterdvEXT) +#define glGetNamedProgramLocalParameterfvEXT GLEW_GET_FUN(__glewGetNamedProgramLocalParameterfvEXT) +#define glGetNamedProgramStringEXT GLEW_GET_FUN(__glewGetNamedProgramStringEXT) +#define glGetNamedProgramivEXT GLEW_GET_FUN(__glewGetNamedProgramivEXT) +#define glGetNamedRenderbufferParameterivEXT GLEW_GET_FUN(__glewGetNamedRenderbufferParameterivEXT) +#define glGetPointerIndexedvEXT GLEW_GET_FUN(__glewGetPointerIndexedvEXT) +#define glGetPointeri_vEXT GLEW_GET_FUN(__glewGetPointeri_vEXT) +#define glGetTextureImageEXT GLEW_GET_FUN(__glewGetTextureImageEXT) +#define glGetTextureLevelParameterfvEXT GLEW_GET_FUN(__glewGetTextureLevelParameterfvEXT) +#define glGetTextureLevelParameterivEXT GLEW_GET_FUN(__glewGetTextureLevelParameterivEXT) +#define glGetTextureParameterIivEXT GLEW_GET_FUN(__glewGetTextureParameterIivEXT) +#define glGetTextureParameterIuivEXT GLEW_GET_FUN(__glewGetTextureParameterIuivEXT) +#define glGetTextureParameterfvEXT GLEW_GET_FUN(__glewGetTextureParameterfvEXT) +#define glGetTextureParameterivEXT GLEW_GET_FUN(__glewGetTextureParameterivEXT) +#define glGetVertexArrayIntegeri_vEXT GLEW_GET_FUN(__glewGetVertexArrayIntegeri_vEXT) +#define glGetVertexArrayIntegervEXT GLEW_GET_FUN(__glewGetVertexArrayIntegervEXT) +#define glGetVertexArrayPointeri_vEXT GLEW_GET_FUN(__glewGetVertexArrayPointeri_vEXT) +#define glGetVertexArrayPointervEXT GLEW_GET_FUN(__glewGetVertexArrayPointervEXT) +#define glMapNamedBufferEXT GLEW_GET_FUN(__glewMapNamedBufferEXT) +#define glMapNamedBufferRangeEXT GLEW_GET_FUN(__glewMapNamedBufferRangeEXT) +#define glMatrixFrustumEXT GLEW_GET_FUN(__glewMatrixFrustumEXT) +#define glMatrixLoadIdentityEXT GLEW_GET_FUN(__glewMatrixLoadIdentityEXT) +#define glMatrixLoadTransposedEXT GLEW_GET_FUN(__glewMatrixLoadTransposedEXT) +#define glMatrixLoadTransposefEXT GLEW_GET_FUN(__glewMatrixLoadTransposefEXT) +#define glMatrixLoaddEXT GLEW_GET_FUN(__glewMatrixLoaddEXT) +#define glMatrixLoadfEXT GLEW_GET_FUN(__glewMatrixLoadfEXT) +#define glMatrixMultTransposedEXT GLEW_GET_FUN(__glewMatrixMultTransposedEXT) +#define glMatrixMultTransposefEXT GLEW_GET_FUN(__glewMatrixMultTransposefEXT) +#define glMatrixMultdEXT GLEW_GET_FUN(__glewMatrixMultdEXT) +#define glMatrixMultfEXT GLEW_GET_FUN(__glewMatrixMultfEXT) +#define glMatrixOrthoEXT GLEW_GET_FUN(__glewMatrixOrthoEXT) +#define glMatrixPopEXT GLEW_GET_FUN(__glewMatrixPopEXT) +#define glMatrixPushEXT GLEW_GET_FUN(__glewMatrixPushEXT) +#define glMatrixRotatedEXT GLEW_GET_FUN(__glewMatrixRotatedEXT) +#define glMatrixRotatefEXT GLEW_GET_FUN(__glewMatrixRotatefEXT) +#define glMatrixScaledEXT GLEW_GET_FUN(__glewMatrixScaledEXT) +#define glMatrixScalefEXT GLEW_GET_FUN(__glewMatrixScalefEXT) +#define glMatrixTranslatedEXT GLEW_GET_FUN(__glewMatrixTranslatedEXT) +#define glMatrixTranslatefEXT GLEW_GET_FUN(__glewMatrixTranslatefEXT) +#define glMultiTexBufferEXT GLEW_GET_FUN(__glewMultiTexBufferEXT) +#define glMultiTexCoordPointerEXT GLEW_GET_FUN(__glewMultiTexCoordPointerEXT) +#define glMultiTexEnvfEXT GLEW_GET_FUN(__glewMultiTexEnvfEXT) +#define glMultiTexEnvfvEXT GLEW_GET_FUN(__glewMultiTexEnvfvEXT) +#define glMultiTexEnviEXT GLEW_GET_FUN(__glewMultiTexEnviEXT) +#define glMultiTexEnvivEXT GLEW_GET_FUN(__glewMultiTexEnvivEXT) +#define glMultiTexGendEXT GLEW_GET_FUN(__glewMultiTexGendEXT) +#define glMultiTexGendvEXT GLEW_GET_FUN(__glewMultiTexGendvEXT) +#define glMultiTexGenfEXT GLEW_GET_FUN(__glewMultiTexGenfEXT) +#define glMultiTexGenfvEXT GLEW_GET_FUN(__glewMultiTexGenfvEXT) +#define glMultiTexGeniEXT GLEW_GET_FUN(__glewMultiTexGeniEXT) +#define glMultiTexGenivEXT GLEW_GET_FUN(__glewMultiTexGenivEXT) +#define glMultiTexImage1DEXT GLEW_GET_FUN(__glewMultiTexImage1DEXT) +#define glMultiTexImage2DEXT GLEW_GET_FUN(__glewMultiTexImage2DEXT) +#define glMultiTexImage3DEXT GLEW_GET_FUN(__glewMultiTexImage3DEXT) +#define glMultiTexParameterIivEXT GLEW_GET_FUN(__glewMultiTexParameterIivEXT) +#define glMultiTexParameterIuivEXT GLEW_GET_FUN(__glewMultiTexParameterIuivEXT) +#define glMultiTexParameterfEXT GLEW_GET_FUN(__glewMultiTexParameterfEXT) +#define glMultiTexParameterfvEXT GLEW_GET_FUN(__glewMultiTexParameterfvEXT) +#define glMultiTexParameteriEXT GLEW_GET_FUN(__glewMultiTexParameteriEXT) +#define glMultiTexParameterivEXT GLEW_GET_FUN(__glewMultiTexParameterivEXT) +#define glMultiTexRenderbufferEXT GLEW_GET_FUN(__glewMultiTexRenderbufferEXT) +#define glMultiTexSubImage1DEXT GLEW_GET_FUN(__glewMultiTexSubImage1DEXT) +#define glMultiTexSubImage2DEXT GLEW_GET_FUN(__glewMultiTexSubImage2DEXT) +#define glMultiTexSubImage3DEXT GLEW_GET_FUN(__glewMultiTexSubImage3DEXT) +#define glNamedBufferDataEXT GLEW_GET_FUN(__glewNamedBufferDataEXT) +#define glNamedBufferSubDataEXT GLEW_GET_FUN(__glewNamedBufferSubDataEXT) +#define glNamedCopyBufferSubDataEXT GLEW_GET_FUN(__glewNamedCopyBufferSubDataEXT) +#define glNamedFramebufferRenderbufferEXT GLEW_GET_FUN(__glewNamedFramebufferRenderbufferEXT) +#define glNamedFramebufferTexture1DEXT GLEW_GET_FUN(__glewNamedFramebufferTexture1DEXT) +#define glNamedFramebufferTexture2DEXT GLEW_GET_FUN(__glewNamedFramebufferTexture2DEXT) +#define glNamedFramebufferTexture3DEXT GLEW_GET_FUN(__glewNamedFramebufferTexture3DEXT) +#define glNamedFramebufferTextureEXT GLEW_GET_FUN(__glewNamedFramebufferTextureEXT) +#define glNamedFramebufferTextureFaceEXT GLEW_GET_FUN(__glewNamedFramebufferTextureFaceEXT) +#define glNamedFramebufferTextureLayerEXT GLEW_GET_FUN(__glewNamedFramebufferTextureLayerEXT) +#define glNamedProgramLocalParameter4dEXT GLEW_GET_FUN(__glewNamedProgramLocalParameter4dEXT) +#define glNamedProgramLocalParameter4dvEXT GLEW_GET_FUN(__glewNamedProgramLocalParameter4dvEXT) +#define glNamedProgramLocalParameter4fEXT GLEW_GET_FUN(__glewNamedProgramLocalParameter4fEXT) +#define glNamedProgramLocalParameter4fvEXT GLEW_GET_FUN(__glewNamedProgramLocalParameter4fvEXT) +#define glNamedProgramLocalParameterI4iEXT GLEW_GET_FUN(__glewNamedProgramLocalParameterI4iEXT) +#define glNamedProgramLocalParameterI4ivEXT GLEW_GET_FUN(__glewNamedProgramLocalParameterI4ivEXT) +#define glNamedProgramLocalParameterI4uiEXT GLEW_GET_FUN(__glewNamedProgramLocalParameterI4uiEXT) +#define glNamedProgramLocalParameterI4uivEXT GLEW_GET_FUN(__glewNamedProgramLocalParameterI4uivEXT) +#define glNamedProgramLocalParameters4fvEXT GLEW_GET_FUN(__glewNamedProgramLocalParameters4fvEXT) +#define glNamedProgramLocalParametersI4ivEXT GLEW_GET_FUN(__glewNamedProgramLocalParametersI4ivEXT) +#define glNamedProgramLocalParametersI4uivEXT GLEW_GET_FUN(__glewNamedProgramLocalParametersI4uivEXT) +#define glNamedProgramStringEXT GLEW_GET_FUN(__glewNamedProgramStringEXT) +#define glNamedRenderbufferStorageEXT GLEW_GET_FUN(__glewNamedRenderbufferStorageEXT) +#define glNamedRenderbufferStorageMultisampleCoverageEXT GLEW_GET_FUN(__glewNamedRenderbufferStorageMultisampleCoverageEXT) +#define glNamedRenderbufferStorageMultisampleEXT GLEW_GET_FUN(__glewNamedRenderbufferStorageMultisampleEXT) +#define glProgramUniform1fEXT GLEW_GET_FUN(__glewProgramUniform1fEXT) +#define glProgramUniform1fvEXT GLEW_GET_FUN(__glewProgramUniform1fvEXT) +#define glProgramUniform1iEXT GLEW_GET_FUN(__glewProgramUniform1iEXT) +#define glProgramUniform1ivEXT GLEW_GET_FUN(__glewProgramUniform1ivEXT) +#define glProgramUniform1uiEXT GLEW_GET_FUN(__glewProgramUniform1uiEXT) +#define glProgramUniform1uivEXT GLEW_GET_FUN(__glewProgramUniform1uivEXT) +#define glProgramUniform2fEXT GLEW_GET_FUN(__glewProgramUniform2fEXT) +#define glProgramUniform2fvEXT GLEW_GET_FUN(__glewProgramUniform2fvEXT) +#define glProgramUniform2iEXT GLEW_GET_FUN(__glewProgramUniform2iEXT) +#define glProgramUniform2ivEXT GLEW_GET_FUN(__glewProgramUniform2ivEXT) +#define glProgramUniform2uiEXT GLEW_GET_FUN(__glewProgramUniform2uiEXT) +#define glProgramUniform2uivEXT GLEW_GET_FUN(__glewProgramUniform2uivEXT) +#define glProgramUniform3fEXT GLEW_GET_FUN(__glewProgramUniform3fEXT) +#define glProgramUniform3fvEXT GLEW_GET_FUN(__glewProgramUniform3fvEXT) +#define glProgramUniform3iEXT GLEW_GET_FUN(__glewProgramUniform3iEXT) +#define glProgramUniform3ivEXT GLEW_GET_FUN(__glewProgramUniform3ivEXT) +#define glProgramUniform3uiEXT GLEW_GET_FUN(__glewProgramUniform3uiEXT) +#define glProgramUniform3uivEXT GLEW_GET_FUN(__glewProgramUniform3uivEXT) +#define glProgramUniform4fEXT GLEW_GET_FUN(__glewProgramUniform4fEXT) +#define glProgramUniform4fvEXT GLEW_GET_FUN(__glewProgramUniform4fvEXT) +#define glProgramUniform4iEXT GLEW_GET_FUN(__glewProgramUniform4iEXT) +#define glProgramUniform4ivEXT GLEW_GET_FUN(__glewProgramUniform4ivEXT) +#define glProgramUniform4uiEXT GLEW_GET_FUN(__glewProgramUniform4uiEXT) +#define glProgramUniform4uivEXT GLEW_GET_FUN(__glewProgramUniform4uivEXT) +#define glProgramUniformMatrix2fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix2fvEXT) +#define glProgramUniformMatrix2x3fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix2x3fvEXT) +#define glProgramUniformMatrix2x4fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix2x4fvEXT) +#define glProgramUniformMatrix3fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix3fvEXT) +#define glProgramUniformMatrix3x2fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix3x2fvEXT) +#define glProgramUniformMatrix3x4fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix3x4fvEXT) +#define glProgramUniformMatrix4fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix4fvEXT) +#define glProgramUniformMatrix4x2fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix4x2fvEXT) +#define glProgramUniformMatrix4x3fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix4x3fvEXT) +#define glPushClientAttribDefaultEXT GLEW_GET_FUN(__glewPushClientAttribDefaultEXT) +#define glTextureBufferEXT GLEW_GET_FUN(__glewTextureBufferEXT) +#define glTextureImage1DEXT GLEW_GET_FUN(__glewTextureImage1DEXT) +#define glTextureImage2DEXT GLEW_GET_FUN(__glewTextureImage2DEXT) +#define glTextureImage3DEXT GLEW_GET_FUN(__glewTextureImage3DEXT) +#define glTextureParameterIivEXT GLEW_GET_FUN(__glewTextureParameterIivEXT) +#define glTextureParameterIuivEXT GLEW_GET_FUN(__glewTextureParameterIuivEXT) +#define glTextureParameterfEXT GLEW_GET_FUN(__glewTextureParameterfEXT) +#define glTextureParameterfvEXT GLEW_GET_FUN(__glewTextureParameterfvEXT) +#define glTextureParameteriEXT GLEW_GET_FUN(__glewTextureParameteriEXT) +#define glTextureParameterivEXT GLEW_GET_FUN(__glewTextureParameterivEXT) +#define glTextureRenderbufferEXT GLEW_GET_FUN(__glewTextureRenderbufferEXT) +#define glTextureSubImage1DEXT GLEW_GET_FUN(__glewTextureSubImage1DEXT) +#define glTextureSubImage2DEXT GLEW_GET_FUN(__glewTextureSubImage2DEXT) +#define glTextureSubImage3DEXT GLEW_GET_FUN(__glewTextureSubImage3DEXT) +#define glUnmapNamedBufferEXT GLEW_GET_FUN(__glewUnmapNamedBufferEXT) +#define glVertexArrayColorOffsetEXT GLEW_GET_FUN(__glewVertexArrayColorOffsetEXT) +#define glVertexArrayEdgeFlagOffsetEXT GLEW_GET_FUN(__glewVertexArrayEdgeFlagOffsetEXT) +#define glVertexArrayFogCoordOffsetEXT GLEW_GET_FUN(__glewVertexArrayFogCoordOffsetEXT) +#define glVertexArrayIndexOffsetEXT GLEW_GET_FUN(__glewVertexArrayIndexOffsetEXT) +#define glVertexArrayMultiTexCoordOffsetEXT GLEW_GET_FUN(__glewVertexArrayMultiTexCoordOffsetEXT) +#define glVertexArrayNormalOffsetEXT GLEW_GET_FUN(__glewVertexArrayNormalOffsetEXT) +#define glVertexArraySecondaryColorOffsetEXT GLEW_GET_FUN(__glewVertexArraySecondaryColorOffsetEXT) +#define glVertexArrayTexCoordOffsetEXT GLEW_GET_FUN(__glewVertexArrayTexCoordOffsetEXT) +#define glVertexArrayVertexAttribIOffsetEXT GLEW_GET_FUN(__glewVertexArrayVertexAttribIOffsetEXT) +#define glVertexArrayVertexAttribOffsetEXT GLEW_GET_FUN(__glewVertexArrayVertexAttribOffsetEXT) +#define glVertexArrayVertexOffsetEXT GLEW_GET_FUN(__glewVertexArrayVertexOffsetEXT) + +#define GLEW_EXT_direct_state_access GLEW_GET_VAR(__GLEW_EXT_direct_state_access) + +#endif /* GL_EXT_direct_state_access */ + +/* -------------------------- GL_EXT_draw_buffers2 ------------------------- */ + +#ifndef GL_EXT_draw_buffers2 +#define GL_EXT_draw_buffers2 1 + +typedef void (GLAPIENTRY * PFNGLCOLORMASKINDEXEDEXTPROC) (GLuint buf, GLboolean r, GLboolean g, GLboolean b, GLboolean a); +typedef void (GLAPIENTRY * PFNGLDISABLEINDEXEDEXTPROC) (GLenum target, GLuint index); +typedef void (GLAPIENTRY * PFNGLENABLEINDEXEDEXTPROC) (GLenum target, GLuint index); +typedef void (GLAPIENTRY * PFNGLGETBOOLEANINDEXEDVEXTPROC) (GLenum value, GLuint index, GLboolean* data); +typedef void (GLAPIENTRY * PFNGLGETINTEGERINDEXEDVEXTPROC) (GLenum value, GLuint index, GLint* data); +typedef GLboolean (GLAPIENTRY * PFNGLISENABLEDINDEXEDEXTPROC) (GLenum target, GLuint index); + +#define glColorMaskIndexedEXT GLEW_GET_FUN(__glewColorMaskIndexedEXT) +#define glDisableIndexedEXT GLEW_GET_FUN(__glewDisableIndexedEXT) +#define glEnableIndexedEXT GLEW_GET_FUN(__glewEnableIndexedEXT) +#define glGetBooleanIndexedvEXT GLEW_GET_FUN(__glewGetBooleanIndexedvEXT) +#define glGetIntegerIndexedvEXT GLEW_GET_FUN(__glewGetIntegerIndexedvEXT) +#define glIsEnabledIndexedEXT GLEW_GET_FUN(__glewIsEnabledIndexedEXT) + +#define GLEW_EXT_draw_buffers2 GLEW_GET_VAR(__GLEW_EXT_draw_buffers2) + +#endif /* GL_EXT_draw_buffers2 */ + +/* ------------------------- GL_EXT_draw_instanced ------------------------- */ + +#ifndef GL_EXT_draw_instanced +#define GL_EXT_draw_instanced 1 + +typedef void (GLAPIENTRY * PFNGLDRAWARRAYSINSTANCEDEXTPROC) (GLenum mode, GLint start, GLsizei count, GLsizei primcount); +typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDEXTPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount); + +#define glDrawArraysInstancedEXT GLEW_GET_FUN(__glewDrawArraysInstancedEXT) +#define glDrawElementsInstancedEXT GLEW_GET_FUN(__glewDrawElementsInstancedEXT) + +#define GLEW_EXT_draw_instanced GLEW_GET_VAR(__GLEW_EXT_draw_instanced) + +#endif /* GL_EXT_draw_instanced */ + +/* ----------------------- GL_EXT_draw_range_elements ---------------------- */ + +#ifndef GL_EXT_draw_range_elements +#define GL_EXT_draw_range_elements 1 + +#define GL_MAX_ELEMENTS_VERTICES_EXT 0x80E8 +#define GL_MAX_ELEMENTS_INDICES_EXT 0x80E9 + +typedef void (GLAPIENTRY * PFNGLDRAWRANGEELEMENTSEXTPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices); + +#define glDrawRangeElementsEXT GLEW_GET_FUN(__glewDrawRangeElementsEXT) + +#define GLEW_EXT_draw_range_elements GLEW_GET_VAR(__GLEW_EXT_draw_range_elements) + +#endif /* GL_EXT_draw_range_elements */ + +/* ---------------------------- GL_EXT_fog_coord --------------------------- */ + +#ifndef GL_EXT_fog_coord +#define GL_EXT_fog_coord 1 + +#define GL_FOG_COORDINATE_SOURCE_EXT 0x8450 +#define GL_FOG_COORDINATE_EXT 0x8451 +#define GL_FRAGMENT_DEPTH_EXT 0x8452 +#define GL_CURRENT_FOG_COORDINATE_EXT 0x8453 +#define GL_FOG_COORDINATE_ARRAY_TYPE_EXT 0x8454 +#define GL_FOG_COORDINATE_ARRAY_STRIDE_EXT 0x8455 +#define GL_FOG_COORDINATE_ARRAY_POINTER_EXT 0x8456 +#define GL_FOG_COORDINATE_ARRAY_EXT 0x8457 + +typedef void (GLAPIENTRY * PFNGLFOGCOORDPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid *pointer); +typedef void (GLAPIENTRY * PFNGLFOGCOORDDEXTPROC) (GLdouble coord); +typedef void (GLAPIENTRY * PFNGLFOGCOORDDVEXTPROC) (const GLdouble *coord); +typedef void (GLAPIENTRY * PFNGLFOGCOORDFEXTPROC) (GLfloat coord); +typedef void (GLAPIENTRY * PFNGLFOGCOORDFVEXTPROC) (const GLfloat *coord); + +#define glFogCoordPointerEXT GLEW_GET_FUN(__glewFogCoordPointerEXT) +#define glFogCoorddEXT GLEW_GET_FUN(__glewFogCoorddEXT) +#define glFogCoorddvEXT GLEW_GET_FUN(__glewFogCoorddvEXT) +#define glFogCoordfEXT GLEW_GET_FUN(__glewFogCoordfEXT) +#define glFogCoordfvEXT GLEW_GET_FUN(__glewFogCoordfvEXT) + +#define GLEW_EXT_fog_coord GLEW_GET_VAR(__GLEW_EXT_fog_coord) + +#endif /* GL_EXT_fog_coord */ + +/* ------------------------ GL_EXT_fragment_lighting ----------------------- */ + +#ifndef GL_EXT_fragment_lighting +#define GL_EXT_fragment_lighting 1 + +#define GL_FRAGMENT_LIGHTING_EXT 0x8400 +#define GL_FRAGMENT_COLOR_MATERIAL_EXT 0x8401 +#define GL_FRAGMENT_COLOR_MATERIAL_FACE_EXT 0x8402 +#define GL_FRAGMENT_COLOR_MATERIAL_PARAMETER_EXT 0x8403 +#define GL_MAX_FRAGMENT_LIGHTS_EXT 0x8404 +#define GL_MAX_ACTIVE_LIGHTS_EXT 0x8405 +#define GL_CURRENT_RASTER_NORMAL_EXT 0x8406 +#define GL_LIGHT_ENV_MODE_EXT 0x8407 +#define GL_FRAGMENT_LIGHT_MODEL_LOCAL_VIEWER_EXT 0x8408 +#define GL_FRAGMENT_LIGHT_MODEL_TWO_SIDE_EXT 0x8409 +#define GL_FRAGMENT_LIGHT_MODEL_AMBIENT_EXT 0x840A +#define GL_FRAGMENT_LIGHT_MODEL_NORMAL_INTERPOLATION_EXT 0x840B +#define GL_FRAGMENT_LIGHT0_EXT 0x840C +#define GL_FRAGMENT_LIGHT7_EXT 0x8413 + +typedef void (GLAPIENTRY * PFNGLFRAGMENTCOLORMATERIALEXTPROC) (GLenum face, GLenum mode); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELFEXTPROC) (GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELFVEXTPROC) (GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELIEXTPROC) (GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELIVEXTPROC) (GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTFEXTPROC) (GLenum light, GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTFVEXTPROC) (GLenum light, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTIEXTPROC) (GLenum light, GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTIVEXTPROC) (GLenum light, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALFEXTPROC) (GLenum face, GLenum pname, const GLfloat param); +typedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALFVEXTPROC) (GLenum face, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALIEXTPROC) (GLenum face, GLenum pname, const GLint param); +typedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALIVEXTPROC) (GLenum face, GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLGETFRAGMENTLIGHTFVEXTPROC) (GLenum light, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETFRAGMENTLIGHTIVEXTPROC) (GLenum light, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETFRAGMENTMATERIALFVEXTPROC) (GLenum face, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETFRAGMENTMATERIALIVEXTPROC) (GLenum face, GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLLIGHTENVIEXTPROC) (GLenum pname, GLint param); + +#define glFragmentColorMaterialEXT GLEW_GET_FUN(__glewFragmentColorMaterialEXT) +#define glFragmentLightModelfEXT GLEW_GET_FUN(__glewFragmentLightModelfEXT) +#define glFragmentLightModelfvEXT GLEW_GET_FUN(__glewFragmentLightModelfvEXT) +#define glFragmentLightModeliEXT GLEW_GET_FUN(__glewFragmentLightModeliEXT) +#define glFragmentLightModelivEXT GLEW_GET_FUN(__glewFragmentLightModelivEXT) +#define glFragmentLightfEXT GLEW_GET_FUN(__glewFragmentLightfEXT) +#define glFragmentLightfvEXT GLEW_GET_FUN(__glewFragmentLightfvEXT) +#define glFragmentLightiEXT GLEW_GET_FUN(__glewFragmentLightiEXT) +#define glFragmentLightivEXT GLEW_GET_FUN(__glewFragmentLightivEXT) +#define glFragmentMaterialfEXT GLEW_GET_FUN(__glewFragmentMaterialfEXT) +#define glFragmentMaterialfvEXT GLEW_GET_FUN(__glewFragmentMaterialfvEXT) +#define glFragmentMaterialiEXT GLEW_GET_FUN(__glewFragmentMaterialiEXT) +#define glFragmentMaterialivEXT GLEW_GET_FUN(__glewFragmentMaterialivEXT) +#define glGetFragmentLightfvEXT GLEW_GET_FUN(__glewGetFragmentLightfvEXT) +#define glGetFragmentLightivEXT GLEW_GET_FUN(__glewGetFragmentLightivEXT) +#define glGetFragmentMaterialfvEXT GLEW_GET_FUN(__glewGetFragmentMaterialfvEXT) +#define glGetFragmentMaterialivEXT GLEW_GET_FUN(__glewGetFragmentMaterialivEXT) +#define glLightEnviEXT GLEW_GET_FUN(__glewLightEnviEXT) + +#define GLEW_EXT_fragment_lighting GLEW_GET_VAR(__GLEW_EXT_fragment_lighting) + +#endif /* GL_EXT_fragment_lighting */ + +/* ------------------------ GL_EXT_framebuffer_blit ------------------------ */ + +#ifndef GL_EXT_framebuffer_blit +#define GL_EXT_framebuffer_blit 1 + +#define GL_DRAW_FRAMEBUFFER_BINDING_EXT 0x8CA6 +#define GL_READ_FRAMEBUFFER_EXT 0x8CA8 +#define GL_DRAW_FRAMEBUFFER_EXT 0x8CA9 +#define GL_READ_FRAMEBUFFER_BINDING_EXT 0x8CAA + +typedef void (GLAPIENTRY * PFNGLBLITFRAMEBUFFEREXTPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); + +#define glBlitFramebufferEXT GLEW_GET_FUN(__glewBlitFramebufferEXT) + +#define GLEW_EXT_framebuffer_blit GLEW_GET_VAR(__GLEW_EXT_framebuffer_blit) + +#endif /* GL_EXT_framebuffer_blit */ + +/* --------------------- GL_EXT_framebuffer_multisample -------------------- */ + +#ifndef GL_EXT_framebuffer_multisample +#define GL_EXT_framebuffer_multisample 1 + +#define GL_RENDERBUFFER_SAMPLES_EXT 0x8CAB +#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT 0x8D56 +#define GL_MAX_SAMPLES_EXT 0x8D57 + +typedef void (GLAPIENTRY * PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); + +#define glRenderbufferStorageMultisampleEXT GLEW_GET_FUN(__glewRenderbufferStorageMultisampleEXT) + +#define GLEW_EXT_framebuffer_multisample GLEW_GET_VAR(__GLEW_EXT_framebuffer_multisample) + +#endif /* GL_EXT_framebuffer_multisample */ + +/* --------------- GL_EXT_framebuffer_multisample_blit_scaled -------------- */ + +#ifndef GL_EXT_framebuffer_multisample_blit_scaled +#define GL_EXT_framebuffer_multisample_blit_scaled 1 + +#define GL_SCALED_RESOLVE_FASTEST_EXT 0x90BA +#define GL_SCALED_RESOLVE_NICEST_EXT 0x90BB + +#define GLEW_EXT_framebuffer_multisample_blit_scaled GLEW_GET_VAR(__GLEW_EXT_framebuffer_multisample_blit_scaled) + +#endif /* GL_EXT_framebuffer_multisample_blit_scaled */ + +/* ----------------------- GL_EXT_framebuffer_object ----------------------- */ + +#ifndef GL_EXT_framebuffer_object +#define GL_EXT_framebuffer_object 1 + +#define GL_INVALID_FRAMEBUFFER_OPERATION_EXT 0x0506 +#define GL_MAX_RENDERBUFFER_SIZE_EXT 0x84E8 +#define GL_FRAMEBUFFER_BINDING_EXT 0x8CA6 +#define GL_RENDERBUFFER_BINDING_EXT 0x8CA7 +#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT 0x8CD0 +#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT 0x8CD1 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT 0x8CD2 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT 0x8CD3 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT 0x8CD4 +#define GL_FRAMEBUFFER_COMPLETE_EXT 0x8CD5 +#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT 0x8CD6 +#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT 0x8CD7 +#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT 0x8CD9 +#define GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT 0x8CDA +#define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT 0x8CDB +#define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT 0x8CDC +#define GL_FRAMEBUFFER_UNSUPPORTED_EXT 0x8CDD +#define GL_MAX_COLOR_ATTACHMENTS_EXT 0x8CDF +#define GL_COLOR_ATTACHMENT0_EXT 0x8CE0 +#define GL_COLOR_ATTACHMENT1_EXT 0x8CE1 +#define GL_COLOR_ATTACHMENT2_EXT 0x8CE2 +#define GL_COLOR_ATTACHMENT3_EXT 0x8CE3 +#define GL_COLOR_ATTACHMENT4_EXT 0x8CE4 +#define GL_COLOR_ATTACHMENT5_EXT 0x8CE5 +#define GL_COLOR_ATTACHMENT6_EXT 0x8CE6 +#define GL_COLOR_ATTACHMENT7_EXT 0x8CE7 +#define GL_COLOR_ATTACHMENT8_EXT 0x8CE8 +#define GL_COLOR_ATTACHMENT9_EXT 0x8CE9 +#define GL_COLOR_ATTACHMENT10_EXT 0x8CEA +#define GL_COLOR_ATTACHMENT11_EXT 0x8CEB +#define GL_COLOR_ATTACHMENT12_EXT 0x8CEC +#define GL_COLOR_ATTACHMENT13_EXT 0x8CED +#define GL_COLOR_ATTACHMENT14_EXT 0x8CEE +#define GL_COLOR_ATTACHMENT15_EXT 0x8CEF +#define GL_DEPTH_ATTACHMENT_EXT 0x8D00 +#define GL_STENCIL_ATTACHMENT_EXT 0x8D20 +#define GL_FRAMEBUFFER_EXT 0x8D40 +#define GL_RENDERBUFFER_EXT 0x8D41 +#define GL_RENDERBUFFER_WIDTH_EXT 0x8D42 +#define GL_RENDERBUFFER_HEIGHT_EXT 0x8D43 +#define GL_RENDERBUFFER_INTERNAL_FORMAT_EXT 0x8D44 +#define GL_STENCIL_INDEX1_EXT 0x8D46 +#define GL_STENCIL_INDEX4_EXT 0x8D47 +#define GL_STENCIL_INDEX8_EXT 0x8D48 +#define GL_STENCIL_INDEX16_EXT 0x8D49 +#define GL_RENDERBUFFER_RED_SIZE_EXT 0x8D50 +#define GL_RENDERBUFFER_GREEN_SIZE_EXT 0x8D51 +#define GL_RENDERBUFFER_BLUE_SIZE_EXT 0x8D52 +#define GL_RENDERBUFFER_ALPHA_SIZE_EXT 0x8D53 +#define GL_RENDERBUFFER_DEPTH_SIZE_EXT 0x8D54 +#define GL_RENDERBUFFER_STENCIL_SIZE_EXT 0x8D55 + +typedef void (GLAPIENTRY * PFNGLBINDFRAMEBUFFEREXTPROC) (GLenum target, GLuint framebuffer); +typedef void (GLAPIENTRY * PFNGLBINDRENDERBUFFEREXTPROC) (GLenum target, GLuint renderbuffer); +typedef GLenum (GLAPIENTRY * PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC) (GLenum target); +typedef void (GLAPIENTRY * PFNGLDELETEFRAMEBUFFERSEXTPROC) (GLsizei n, const GLuint* framebuffers); +typedef void (GLAPIENTRY * PFNGLDELETERENDERBUFFERSEXTPROC) (GLsizei n, const GLuint* renderbuffers); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURE1DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURE2DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURE3DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); +typedef void (GLAPIENTRY * PFNGLGENFRAMEBUFFERSEXTPROC) (GLsizei n, GLuint* framebuffers); +typedef void (GLAPIENTRY * PFNGLGENRENDERBUFFERSEXTPROC) (GLsizei n, GLuint* renderbuffers); +typedef void (GLAPIENTRY * PFNGLGENERATEMIPMAPEXTPROC) (GLenum target); +typedef void (GLAPIENTRY * PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC) (GLenum target, GLenum attachment, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint* params); +typedef GLboolean (GLAPIENTRY * PFNGLISFRAMEBUFFEREXTPROC) (GLuint framebuffer); +typedef GLboolean (GLAPIENTRY * PFNGLISRENDERBUFFEREXTPROC) (GLuint renderbuffer); +typedef void (GLAPIENTRY * PFNGLRENDERBUFFERSTORAGEEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height); + +#define glBindFramebufferEXT GLEW_GET_FUN(__glewBindFramebufferEXT) +#define glBindRenderbufferEXT GLEW_GET_FUN(__glewBindRenderbufferEXT) +#define glCheckFramebufferStatusEXT GLEW_GET_FUN(__glewCheckFramebufferStatusEXT) +#define glDeleteFramebuffersEXT GLEW_GET_FUN(__glewDeleteFramebuffersEXT) +#define glDeleteRenderbuffersEXT GLEW_GET_FUN(__glewDeleteRenderbuffersEXT) +#define glFramebufferRenderbufferEXT GLEW_GET_FUN(__glewFramebufferRenderbufferEXT) +#define glFramebufferTexture1DEXT GLEW_GET_FUN(__glewFramebufferTexture1DEXT) +#define glFramebufferTexture2DEXT GLEW_GET_FUN(__glewFramebufferTexture2DEXT) +#define glFramebufferTexture3DEXT GLEW_GET_FUN(__glewFramebufferTexture3DEXT) +#define glGenFramebuffersEXT GLEW_GET_FUN(__glewGenFramebuffersEXT) +#define glGenRenderbuffersEXT GLEW_GET_FUN(__glewGenRenderbuffersEXT) +#define glGenerateMipmapEXT GLEW_GET_FUN(__glewGenerateMipmapEXT) +#define glGetFramebufferAttachmentParameterivEXT GLEW_GET_FUN(__glewGetFramebufferAttachmentParameterivEXT) +#define glGetRenderbufferParameterivEXT GLEW_GET_FUN(__glewGetRenderbufferParameterivEXT) +#define glIsFramebufferEXT GLEW_GET_FUN(__glewIsFramebufferEXT) +#define glIsRenderbufferEXT GLEW_GET_FUN(__glewIsRenderbufferEXT) +#define glRenderbufferStorageEXT GLEW_GET_FUN(__glewRenderbufferStorageEXT) + +#define GLEW_EXT_framebuffer_object GLEW_GET_VAR(__GLEW_EXT_framebuffer_object) + +#endif /* GL_EXT_framebuffer_object */ + +/* ------------------------ GL_EXT_framebuffer_sRGB ------------------------ */ + +#ifndef GL_EXT_framebuffer_sRGB +#define GL_EXT_framebuffer_sRGB 1 + +#define GL_FRAMEBUFFER_SRGB_EXT 0x8DB9 +#define GL_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x8DBA + +#define GLEW_EXT_framebuffer_sRGB GLEW_GET_VAR(__GLEW_EXT_framebuffer_sRGB) + +#endif /* GL_EXT_framebuffer_sRGB */ + +/* ------------------------ GL_EXT_geometry_shader4 ------------------------ */ + +#ifndef GL_EXT_geometry_shader4 +#define GL_EXT_geometry_shader4 1 + +#define GL_LINES_ADJACENCY_EXT 0xA +#define GL_LINE_STRIP_ADJACENCY_EXT 0xB +#define GL_TRIANGLES_ADJACENCY_EXT 0xC +#define GL_TRIANGLE_STRIP_ADJACENCY_EXT 0xD +#define GL_PROGRAM_POINT_SIZE_EXT 0x8642 +#define GL_MAX_VARYING_COMPONENTS_EXT 0x8B4B +#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_EXT 0x8C29 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT 0x8CD4 +#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED_EXT 0x8DA7 +#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_EXT 0x8DA8 +#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_EXT 0x8DA9 +#define GL_GEOMETRY_SHADER_EXT 0x8DD9 +#define GL_GEOMETRY_VERTICES_OUT_EXT 0x8DDA +#define GL_GEOMETRY_INPUT_TYPE_EXT 0x8DDB +#define GL_GEOMETRY_OUTPUT_TYPE_EXT 0x8DDC +#define GL_MAX_GEOMETRY_VARYING_COMPONENTS_EXT 0x8DDD +#define GL_MAX_VERTEX_VARYING_COMPONENTS_EXT 0x8DDE +#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_EXT 0x8DDF +#define GL_MAX_GEOMETRY_OUTPUT_VERTICES_EXT 0x8DE0 +#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_EXT 0x8DE1 + +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTUREEXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTUREFACEEXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face); +typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETERIEXTPROC) (GLuint program, GLenum pname, GLint value); + +#define glFramebufferTextureEXT GLEW_GET_FUN(__glewFramebufferTextureEXT) +#define glFramebufferTextureFaceEXT GLEW_GET_FUN(__glewFramebufferTextureFaceEXT) +#define glProgramParameteriEXT GLEW_GET_FUN(__glewProgramParameteriEXT) + +#define GLEW_EXT_geometry_shader4 GLEW_GET_VAR(__GLEW_EXT_geometry_shader4) + +#endif /* GL_EXT_geometry_shader4 */ + +/* --------------------- GL_EXT_gpu_program_parameters --------------------- */ + +#ifndef GL_EXT_gpu_program_parameters +#define GL_EXT_gpu_program_parameters 1 + +typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETERS4FVEXTPROC) (GLenum target, GLuint index, GLsizei count, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETERS4FVEXTPROC) (GLenum target, GLuint index, GLsizei count, const GLfloat* params); + +#define glProgramEnvParameters4fvEXT GLEW_GET_FUN(__glewProgramEnvParameters4fvEXT) +#define glProgramLocalParameters4fvEXT GLEW_GET_FUN(__glewProgramLocalParameters4fvEXT) + +#define GLEW_EXT_gpu_program_parameters GLEW_GET_VAR(__GLEW_EXT_gpu_program_parameters) + +#endif /* GL_EXT_gpu_program_parameters */ + +/* --------------------------- GL_EXT_gpu_shader4 -------------------------- */ + +#ifndef GL_EXT_gpu_shader4 +#define GL_EXT_gpu_shader4 1 + +#define GL_VERTEX_ATTRIB_ARRAY_INTEGER_EXT 0x88FD +#define GL_SAMPLER_1D_ARRAY_EXT 0x8DC0 +#define GL_SAMPLER_2D_ARRAY_EXT 0x8DC1 +#define GL_SAMPLER_BUFFER_EXT 0x8DC2 +#define GL_SAMPLER_1D_ARRAY_SHADOW_EXT 0x8DC3 +#define GL_SAMPLER_2D_ARRAY_SHADOW_EXT 0x8DC4 +#define GL_SAMPLER_CUBE_SHADOW_EXT 0x8DC5 +#define GL_UNSIGNED_INT_VEC2_EXT 0x8DC6 +#define GL_UNSIGNED_INT_VEC3_EXT 0x8DC7 +#define GL_UNSIGNED_INT_VEC4_EXT 0x8DC8 +#define GL_INT_SAMPLER_1D_EXT 0x8DC9 +#define GL_INT_SAMPLER_2D_EXT 0x8DCA +#define GL_INT_SAMPLER_3D_EXT 0x8DCB +#define GL_INT_SAMPLER_CUBE_EXT 0x8DCC +#define GL_INT_SAMPLER_2D_RECT_EXT 0x8DCD +#define GL_INT_SAMPLER_1D_ARRAY_EXT 0x8DCE +#define GL_INT_SAMPLER_2D_ARRAY_EXT 0x8DCF +#define GL_INT_SAMPLER_BUFFER_EXT 0x8DD0 +#define GL_UNSIGNED_INT_SAMPLER_1D_EXT 0x8DD1 +#define GL_UNSIGNED_INT_SAMPLER_2D_EXT 0x8DD2 +#define GL_UNSIGNED_INT_SAMPLER_3D_EXT 0x8DD3 +#define GL_UNSIGNED_INT_SAMPLER_CUBE_EXT 0x8DD4 +#define GL_UNSIGNED_INT_SAMPLER_2D_RECT_EXT 0x8DD5 +#define GL_UNSIGNED_INT_SAMPLER_1D_ARRAY_EXT 0x8DD6 +#define GL_UNSIGNED_INT_SAMPLER_2D_ARRAY_EXT 0x8DD7 +#define GL_UNSIGNED_INT_SAMPLER_BUFFER_EXT 0x8DD8 + +typedef void (GLAPIENTRY * PFNGLBINDFRAGDATALOCATIONEXTPROC) (GLuint program, GLuint color, const GLchar *name); +typedef GLint (GLAPIENTRY * PFNGLGETFRAGDATALOCATIONEXTPROC) (GLuint program, const GLchar *name); +typedef void (GLAPIENTRY * PFNGLGETUNIFORMUIVEXTPROC) (GLuint program, GLint location, GLuint *params); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBIIVEXTPROC) (GLuint index, GLenum pname, GLint *params); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBIUIVEXTPROC) (GLuint index, GLenum pname, GLuint *params); +typedef void (GLAPIENTRY * PFNGLUNIFORM1UIEXTPROC) (GLint location, GLuint v0); +typedef void (GLAPIENTRY * PFNGLUNIFORM1UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value); +typedef void (GLAPIENTRY * PFNGLUNIFORM2UIEXTPROC) (GLint location, GLuint v0, GLuint v1); +typedef void (GLAPIENTRY * PFNGLUNIFORM2UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value); +typedef void (GLAPIENTRY * PFNGLUNIFORM3UIEXTPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2); +typedef void (GLAPIENTRY * PFNGLUNIFORM3UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value); +typedef void (GLAPIENTRY * PFNGLUNIFORM4UIEXTPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); +typedef void (GLAPIENTRY * PFNGLUNIFORM4UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1IEXTPROC) (GLuint index, GLint x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1IVEXTPROC) (GLuint index, const GLint *v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1UIEXTPROC) (GLuint index, GLuint x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1UIVEXTPROC) (GLuint index, const GLuint *v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2IEXTPROC) (GLuint index, GLint x, GLint y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2IVEXTPROC) (GLuint index, const GLint *v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2UIEXTPROC) (GLuint index, GLuint x, GLuint y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2UIVEXTPROC) (GLuint index, const GLuint *v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3IEXTPROC) (GLuint index, GLint x, GLint y, GLint z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3IVEXTPROC) (GLuint index, const GLint *v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3UIEXTPROC) (GLuint index, GLuint x, GLuint y, GLuint z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3UIVEXTPROC) (GLuint index, const GLuint *v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4BVEXTPROC) (GLuint index, const GLbyte *v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4IEXTPROC) (GLuint index, GLint x, GLint y, GLint z, GLint w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4IVEXTPROC) (GLuint index, const GLint *v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4SVEXTPROC) (GLuint index, const GLshort *v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4UBVEXTPROC) (GLuint index, const GLubyte *v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4UIEXTPROC) (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4UIVEXTPROC) (GLuint index, const GLuint *v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4USVEXTPROC) (GLuint index, const GLushort *v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBIPOINTEREXTPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); + +#define glBindFragDataLocationEXT GLEW_GET_FUN(__glewBindFragDataLocationEXT) +#define glGetFragDataLocationEXT GLEW_GET_FUN(__glewGetFragDataLocationEXT) +#define glGetUniformuivEXT GLEW_GET_FUN(__glewGetUniformuivEXT) +#define glGetVertexAttribIivEXT GLEW_GET_FUN(__glewGetVertexAttribIivEXT) +#define glGetVertexAttribIuivEXT GLEW_GET_FUN(__glewGetVertexAttribIuivEXT) +#define glUniform1uiEXT GLEW_GET_FUN(__glewUniform1uiEXT) +#define glUniform1uivEXT GLEW_GET_FUN(__glewUniform1uivEXT) +#define glUniform2uiEXT GLEW_GET_FUN(__glewUniform2uiEXT) +#define glUniform2uivEXT GLEW_GET_FUN(__glewUniform2uivEXT) +#define glUniform3uiEXT GLEW_GET_FUN(__glewUniform3uiEXT) +#define glUniform3uivEXT GLEW_GET_FUN(__glewUniform3uivEXT) +#define glUniform4uiEXT GLEW_GET_FUN(__glewUniform4uiEXT) +#define glUniform4uivEXT GLEW_GET_FUN(__glewUniform4uivEXT) +#define glVertexAttribI1iEXT GLEW_GET_FUN(__glewVertexAttribI1iEXT) +#define glVertexAttribI1ivEXT GLEW_GET_FUN(__glewVertexAttribI1ivEXT) +#define glVertexAttribI1uiEXT GLEW_GET_FUN(__glewVertexAttribI1uiEXT) +#define glVertexAttribI1uivEXT GLEW_GET_FUN(__glewVertexAttribI1uivEXT) +#define glVertexAttribI2iEXT GLEW_GET_FUN(__glewVertexAttribI2iEXT) +#define glVertexAttribI2ivEXT GLEW_GET_FUN(__glewVertexAttribI2ivEXT) +#define glVertexAttribI2uiEXT GLEW_GET_FUN(__glewVertexAttribI2uiEXT) +#define glVertexAttribI2uivEXT GLEW_GET_FUN(__glewVertexAttribI2uivEXT) +#define glVertexAttribI3iEXT GLEW_GET_FUN(__glewVertexAttribI3iEXT) +#define glVertexAttribI3ivEXT GLEW_GET_FUN(__glewVertexAttribI3ivEXT) +#define glVertexAttribI3uiEXT GLEW_GET_FUN(__glewVertexAttribI3uiEXT) +#define glVertexAttribI3uivEXT GLEW_GET_FUN(__glewVertexAttribI3uivEXT) +#define glVertexAttribI4bvEXT GLEW_GET_FUN(__glewVertexAttribI4bvEXT) +#define glVertexAttribI4iEXT GLEW_GET_FUN(__glewVertexAttribI4iEXT) +#define glVertexAttribI4ivEXT GLEW_GET_FUN(__glewVertexAttribI4ivEXT) +#define glVertexAttribI4svEXT GLEW_GET_FUN(__glewVertexAttribI4svEXT) +#define glVertexAttribI4ubvEXT GLEW_GET_FUN(__glewVertexAttribI4ubvEXT) +#define glVertexAttribI4uiEXT GLEW_GET_FUN(__glewVertexAttribI4uiEXT) +#define glVertexAttribI4uivEXT GLEW_GET_FUN(__glewVertexAttribI4uivEXT) +#define glVertexAttribI4usvEXT GLEW_GET_FUN(__glewVertexAttribI4usvEXT) +#define glVertexAttribIPointerEXT GLEW_GET_FUN(__glewVertexAttribIPointerEXT) + +#define GLEW_EXT_gpu_shader4 GLEW_GET_VAR(__GLEW_EXT_gpu_shader4) + +#endif /* GL_EXT_gpu_shader4 */ + +/* ---------------------------- GL_EXT_histogram --------------------------- */ + +#ifndef GL_EXT_histogram +#define GL_EXT_histogram 1 + +#define GL_HISTOGRAM_EXT 0x8024 +#define GL_PROXY_HISTOGRAM_EXT 0x8025 +#define GL_HISTOGRAM_WIDTH_EXT 0x8026 +#define GL_HISTOGRAM_FORMAT_EXT 0x8027 +#define GL_HISTOGRAM_RED_SIZE_EXT 0x8028 +#define GL_HISTOGRAM_GREEN_SIZE_EXT 0x8029 +#define GL_HISTOGRAM_BLUE_SIZE_EXT 0x802A +#define GL_HISTOGRAM_ALPHA_SIZE_EXT 0x802B +#define GL_HISTOGRAM_LUMINANCE_SIZE_EXT 0x802C +#define GL_HISTOGRAM_SINK_EXT 0x802D +#define GL_MINMAX_EXT 0x802E +#define GL_MINMAX_FORMAT_EXT 0x802F +#define GL_MINMAX_SINK_EXT 0x8030 + +typedef void (GLAPIENTRY * PFNGLGETHISTOGRAMEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); +typedef void (GLAPIENTRY * PFNGLGETHISTOGRAMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETHISTOGRAMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETMINMAXEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); +typedef void (GLAPIENTRY * PFNGLGETMINMAXPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETMINMAXPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLHISTOGRAMEXTPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); +typedef void (GLAPIENTRY * PFNGLMINMAXEXTPROC) (GLenum target, GLenum internalformat, GLboolean sink); +typedef void (GLAPIENTRY * PFNGLRESETHISTOGRAMEXTPROC) (GLenum target); +typedef void (GLAPIENTRY * PFNGLRESETMINMAXEXTPROC) (GLenum target); + +#define glGetHistogramEXT GLEW_GET_FUN(__glewGetHistogramEXT) +#define glGetHistogramParameterfvEXT GLEW_GET_FUN(__glewGetHistogramParameterfvEXT) +#define glGetHistogramParameterivEXT GLEW_GET_FUN(__glewGetHistogramParameterivEXT) +#define glGetMinmaxEXT GLEW_GET_FUN(__glewGetMinmaxEXT) +#define glGetMinmaxParameterfvEXT GLEW_GET_FUN(__glewGetMinmaxParameterfvEXT) +#define glGetMinmaxParameterivEXT GLEW_GET_FUN(__glewGetMinmaxParameterivEXT) +#define glHistogramEXT GLEW_GET_FUN(__glewHistogramEXT) +#define glMinmaxEXT GLEW_GET_FUN(__glewMinmaxEXT) +#define glResetHistogramEXT GLEW_GET_FUN(__glewResetHistogramEXT) +#define glResetMinmaxEXT GLEW_GET_FUN(__glewResetMinmaxEXT) + +#define GLEW_EXT_histogram GLEW_GET_VAR(__GLEW_EXT_histogram) + +#endif /* GL_EXT_histogram */ + +/* ----------------------- GL_EXT_index_array_formats ---------------------- */ + +#ifndef GL_EXT_index_array_formats +#define GL_EXT_index_array_formats 1 + +#define GLEW_EXT_index_array_formats GLEW_GET_VAR(__GLEW_EXT_index_array_formats) + +#endif /* GL_EXT_index_array_formats */ + +/* --------------------------- GL_EXT_index_func --------------------------- */ + +#ifndef GL_EXT_index_func +#define GL_EXT_index_func 1 + +typedef void (GLAPIENTRY * PFNGLINDEXFUNCEXTPROC) (GLenum func, GLfloat ref); + +#define glIndexFuncEXT GLEW_GET_FUN(__glewIndexFuncEXT) + +#define GLEW_EXT_index_func GLEW_GET_VAR(__GLEW_EXT_index_func) + +#endif /* GL_EXT_index_func */ + +/* ------------------------- GL_EXT_index_material ------------------------- */ + +#ifndef GL_EXT_index_material +#define GL_EXT_index_material 1 + +typedef void (GLAPIENTRY * PFNGLINDEXMATERIALEXTPROC) (GLenum face, GLenum mode); + +#define glIndexMaterialEXT GLEW_GET_FUN(__glewIndexMaterialEXT) + +#define GLEW_EXT_index_material GLEW_GET_VAR(__GLEW_EXT_index_material) + +#endif /* GL_EXT_index_material */ + +/* -------------------------- GL_EXT_index_texture ------------------------- */ + +#ifndef GL_EXT_index_texture +#define GL_EXT_index_texture 1 + +#define GLEW_EXT_index_texture GLEW_GET_VAR(__GLEW_EXT_index_texture) + +#endif /* GL_EXT_index_texture */ + +/* -------------------------- GL_EXT_light_texture ------------------------- */ + +#ifndef GL_EXT_light_texture +#define GL_EXT_light_texture 1 + +#define GL_FRAGMENT_MATERIAL_EXT 0x8349 +#define GL_FRAGMENT_NORMAL_EXT 0x834A +#define GL_FRAGMENT_COLOR_EXT 0x834C +#define GL_ATTENUATION_EXT 0x834D +#define GL_SHADOW_ATTENUATION_EXT 0x834E +#define GL_TEXTURE_APPLICATION_MODE_EXT 0x834F +#define GL_TEXTURE_LIGHT_EXT 0x8350 +#define GL_TEXTURE_MATERIAL_FACE_EXT 0x8351 +#define GL_TEXTURE_MATERIAL_PARAMETER_EXT 0x8352 + +typedef void (GLAPIENTRY * PFNGLAPPLYTEXTUREEXTPROC) (GLenum mode); +typedef void (GLAPIENTRY * PFNGLTEXTURELIGHTEXTPROC) (GLenum pname); +typedef void (GLAPIENTRY * PFNGLTEXTUREMATERIALEXTPROC) (GLenum face, GLenum mode); + +#define glApplyTextureEXT GLEW_GET_FUN(__glewApplyTextureEXT) +#define glTextureLightEXT GLEW_GET_FUN(__glewTextureLightEXT) +#define glTextureMaterialEXT GLEW_GET_FUN(__glewTextureMaterialEXT) + +#define GLEW_EXT_light_texture GLEW_GET_VAR(__GLEW_EXT_light_texture) + +#endif /* GL_EXT_light_texture */ + +/* ------------------------- GL_EXT_misc_attribute ------------------------- */ + +#ifndef GL_EXT_misc_attribute +#define GL_EXT_misc_attribute 1 + +#define GLEW_EXT_misc_attribute GLEW_GET_VAR(__GLEW_EXT_misc_attribute) + +#endif /* GL_EXT_misc_attribute */ + +/* ------------------------ GL_EXT_multi_draw_arrays ----------------------- */ + +#ifndef GL_EXT_multi_draw_arrays +#define GL_EXT_multi_draw_arrays 1 + +typedef void (GLAPIENTRY * PFNGLMULTIDRAWARRAYSEXTPROC) (GLenum mode, const GLint* first, const GLsizei *count, GLsizei primcount); +typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSEXTPROC) (GLenum mode, GLsizei* count, GLenum type, const GLvoid * const *indices, GLsizei primcount); + +#define glMultiDrawArraysEXT GLEW_GET_FUN(__glewMultiDrawArraysEXT) +#define glMultiDrawElementsEXT GLEW_GET_FUN(__glewMultiDrawElementsEXT) + +#define GLEW_EXT_multi_draw_arrays GLEW_GET_VAR(__GLEW_EXT_multi_draw_arrays) + +#endif /* GL_EXT_multi_draw_arrays */ + +/* --------------------------- GL_EXT_multisample -------------------------- */ + +#ifndef GL_EXT_multisample +#define GL_EXT_multisample 1 + +#define GL_MULTISAMPLE_EXT 0x809D +#define GL_SAMPLE_ALPHA_TO_MASK_EXT 0x809E +#define GL_SAMPLE_ALPHA_TO_ONE_EXT 0x809F +#define GL_SAMPLE_MASK_EXT 0x80A0 +#define GL_1PASS_EXT 0x80A1 +#define GL_2PASS_0_EXT 0x80A2 +#define GL_2PASS_1_EXT 0x80A3 +#define GL_4PASS_0_EXT 0x80A4 +#define GL_4PASS_1_EXT 0x80A5 +#define GL_4PASS_2_EXT 0x80A6 +#define GL_4PASS_3_EXT 0x80A7 +#define GL_SAMPLE_BUFFERS_EXT 0x80A8 +#define GL_SAMPLES_EXT 0x80A9 +#define GL_SAMPLE_MASK_VALUE_EXT 0x80AA +#define GL_SAMPLE_MASK_INVERT_EXT 0x80AB +#define GL_SAMPLE_PATTERN_EXT 0x80AC +#define GL_MULTISAMPLE_BIT_EXT 0x20000000 + +typedef void (GLAPIENTRY * PFNGLSAMPLEMASKEXTPROC) (GLclampf value, GLboolean invert); +typedef void (GLAPIENTRY * PFNGLSAMPLEPATTERNEXTPROC) (GLenum pattern); + +#define glSampleMaskEXT GLEW_GET_FUN(__glewSampleMaskEXT) +#define glSamplePatternEXT GLEW_GET_FUN(__glewSamplePatternEXT) + +#define GLEW_EXT_multisample GLEW_GET_VAR(__GLEW_EXT_multisample) + +#endif /* GL_EXT_multisample */ + +/* ---------------------- GL_EXT_packed_depth_stencil ---------------------- */ + +#ifndef GL_EXT_packed_depth_stencil +#define GL_EXT_packed_depth_stencil 1 + +#define GL_DEPTH_STENCIL_EXT 0x84F9 +#define GL_UNSIGNED_INT_24_8_EXT 0x84FA +#define GL_DEPTH24_STENCIL8_EXT 0x88F0 +#define GL_TEXTURE_STENCIL_SIZE_EXT 0x88F1 + +#define GLEW_EXT_packed_depth_stencil GLEW_GET_VAR(__GLEW_EXT_packed_depth_stencil) + +#endif /* GL_EXT_packed_depth_stencil */ + +/* -------------------------- GL_EXT_packed_float -------------------------- */ + +#ifndef GL_EXT_packed_float +#define GL_EXT_packed_float 1 + +#define GL_R11F_G11F_B10F_EXT 0x8C3A +#define GL_UNSIGNED_INT_10F_11F_11F_REV_EXT 0x8C3B +#define GL_RGBA_SIGNED_COMPONENTS_EXT 0x8C3C + +#define GLEW_EXT_packed_float GLEW_GET_VAR(__GLEW_EXT_packed_float) + +#endif /* GL_EXT_packed_float */ + +/* -------------------------- GL_EXT_packed_pixels ------------------------- */ + +#ifndef GL_EXT_packed_pixels +#define GL_EXT_packed_pixels 1 + +#define GL_UNSIGNED_BYTE_3_3_2_EXT 0x8032 +#define GL_UNSIGNED_SHORT_4_4_4_4_EXT 0x8033 +#define GL_UNSIGNED_SHORT_5_5_5_1_EXT 0x8034 +#define GL_UNSIGNED_INT_8_8_8_8_EXT 0x8035 +#define GL_UNSIGNED_INT_10_10_10_2_EXT 0x8036 + +#define GLEW_EXT_packed_pixels GLEW_GET_VAR(__GLEW_EXT_packed_pixels) + +#endif /* GL_EXT_packed_pixels */ + +/* ------------------------ GL_EXT_paletted_texture ------------------------ */ + +#ifndef GL_EXT_paletted_texture +#define GL_EXT_paletted_texture 1 + +#define GL_TEXTURE_1D 0x0DE0 +#define GL_TEXTURE_2D 0x0DE1 +#define GL_PROXY_TEXTURE_1D 0x8063 +#define GL_PROXY_TEXTURE_2D 0x8064 +#define GL_COLOR_TABLE_FORMAT_EXT 0x80D8 +#define GL_COLOR_TABLE_WIDTH_EXT 0x80D9 +#define GL_COLOR_TABLE_RED_SIZE_EXT 0x80DA +#define GL_COLOR_TABLE_GREEN_SIZE_EXT 0x80DB +#define GL_COLOR_TABLE_BLUE_SIZE_EXT 0x80DC +#define GL_COLOR_TABLE_ALPHA_SIZE_EXT 0x80DD +#define GL_COLOR_TABLE_LUMINANCE_SIZE_EXT 0x80DE +#define GL_COLOR_TABLE_INTENSITY_SIZE_EXT 0x80DF +#define GL_COLOR_INDEX1_EXT 0x80E2 +#define GL_COLOR_INDEX2_EXT 0x80E3 +#define GL_COLOR_INDEX4_EXT 0x80E4 +#define GL_COLOR_INDEX8_EXT 0x80E5 +#define GL_COLOR_INDEX12_EXT 0x80E6 +#define GL_COLOR_INDEX16_EXT 0x80E7 +#define GL_TEXTURE_INDEX_SIZE_EXT 0x80ED +#define GL_TEXTURE_CUBE_MAP_ARB 0x8513 +#define GL_PROXY_TEXTURE_CUBE_MAP_ARB 0x851B + +typedef void (GLAPIENTRY * PFNGLCOLORTABLEEXTPROC) (GLenum target, GLenum internalFormat, GLsizei width, GLenum format, GLenum type, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEEXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *data); +typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint* params); + +#define glColorTableEXT GLEW_GET_FUN(__glewColorTableEXT) +#define glGetColorTableEXT GLEW_GET_FUN(__glewGetColorTableEXT) +#define glGetColorTableParameterfvEXT GLEW_GET_FUN(__glewGetColorTableParameterfvEXT) +#define glGetColorTableParameterivEXT GLEW_GET_FUN(__glewGetColorTableParameterivEXT) + +#define GLEW_EXT_paletted_texture GLEW_GET_VAR(__GLEW_EXT_paletted_texture) + +#endif /* GL_EXT_paletted_texture */ + +/* ----------------------- GL_EXT_pixel_buffer_object ---------------------- */ + +#ifndef GL_EXT_pixel_buffer_object +#define GL_EXT_pixel_buffer_object 1 + +#define GL_PIXEL_PACK_BUFFER_EXT 0x88EB +#define GL_PIXEL_UNPACK_BUFFER_EXT 0x88EC +#define GL_PIXEL_PACK_BUFFER_BINDING_EXT 0x88ED +#define GL_PIXEL_UNPACK_BUFFER_BINDING_EXT 0x88EF + +#define GLEW_EXT_pixel_buffer_object GLEW_GET_VAR(__GLEW_EXT_pixel_buffer_object) + +#endif /* GL_EXT_pixel_buffer_object */ + +/* ------------------------- GL_EXT_pixel_transform ------------------------ */ + +#ifndef GL_EXT_pixel_transform +#define GL_EXT_pixel_transform 1 + +#define GL_PIXEL_TRANSFORM_2D_EXT 0x8330 +#define GL_PIXEL_MAG_FILTER_EXT 0x8331 +#define GL_PIXEL_MIN_FILTER_EXT 0x8332 +#define GL_PIXEL_CUBIC_WEIGHT_EXT 0x8333 +#define GL_CUBIC_EXT 0x8334 +#define GL_AVERAGE_EXT 0x8335 +#define GL_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8336 +#define GL_MAX_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8337 +#define GL_PIXEL_TRANSFORM_2D_MATRIX_EXT 0x8338 + +typedef void (GLAPIENTRY * PFNGLGETPIXELTRANSFORMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETPIXELTRANSFORMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLPIXELTRANSFORMPARAMETERFEXTPROC) (GLenum target, GLenum pname, const GLfloat param); +typedef void (GLAPIENTRY * PFNGLPIXELTRANSFORMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLPIXELTRANSFORMPARAMETERIEXTPROC) (GLenum target, GLenum pname, const GLint param); +typedef void (GLAPIENTRY * PFNGLPIXELTRANSFORMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint* params); + +#define glGetPixelTransformParameterfvEXT GLEW_GET_FUN(__glewGetPixelTransformParameterfvEXT) +#define glGetPixelTransformParameterivEXT GLEW_GET_FUN(__glewGetPixelTransformParameterivEXT) +#define glPixelTransformParameterfEXT GLEW_GET_FUN(__glewPixelTransformParameterfEXT) +#define glPixelTransformParameterfvEXT GLEW_GET_FUN(__glewPixelTransformParameterfvEXT) +#define glPixelTransformParameteriEXT GLEW_GET_FUN(__glewPixelTransformParameteriEXT) +#define glPixelTransformParameterivEXT GLEW_GET_FUN(__glewPixelTransformParameterivEXT) + +#define GLEW_EXT_pixel_transform GLEW_GET_VAR(__GLEW_EXT_pixel_transform) + +#endif /* GL_EXT_pixel_transform */ + +/* ------------------- GL_EXT_pixel_transform_color_table ------------------ */ + +#ifndef GL_EXT_pixel_transform_color_table +#define GL_EXT_pixel_transform_color_table 1 + +#define GLEW_EXT_pixel_transform_color_table GLEW_GET_VAR(__GLEW_EXT_pixel_transform_color_table) + +#endif /* GL_EXT_pixel_transform_color_table */ + +/* ------------------------ GL_EXT_point_parameters ------------------------ */ + +#ifndef GL_EXT_point_parameters +#define GL_EXT_point_parameters 1 + +#define GL_POINT_SIZE_MIN_EXT 0x8126 +#define GL_POINT_SIZE_MAX_EXT 0x8127 +#define GL_POINT_FADE_THRESHOLD_SIZE_EXT 0x8128 +#define GL_DISTANCE_ATTENUATION_EXT 0x8129 + +typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERFEXTPROC) (GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERFVEXTPROC) (GLenum pname, const GLfloat* params); + +#define glPointParameterfEXT GLEW_GET_FUN(__glewPointParameterfEXT) +#define glPointParameterfvEXT GLEW_GET_FUN(__glewPointParameterfvEXT) + +#define GLEW_EXT_point_parameters GLEW_GET_VAR(__GLEW_EXT_point_parameters) + +#endif /* GL_EXT_point_parameters */ + +/* ------------------------- GL_EXT_polygon_offset ------------------------- */ + +#ifndef GL_EXT_polygon_offset +#define GL_EXT_polygon_offset 1 + +#define GL_POLYGON_OFFSET_EXT 0x8037 +#define GL_POLYGON_OFFSET_FACTOR_EXT 0x8038 +#define GL_POLYGON_OFFSET_BIAS_EXT 0x8039 + +typedef void (GLAPIENTRY * PFNGLPOLYGONOFFSETEXTPROC) (GLfloat factor, GLfloat bias); + +#define glPolygonOffsetEXT GLEW_GET_FUN(__glewPolygonOffsetEXT) + +#define GLEW_EXT_polygon_offset GLEW_GET_VAR(__GLEW_EXT_polygon_offset) + +#endif /* GL_EXT_polygon_offset */ + +/* ------------------------ GL_EXT_provoking_vertex ------------------------ */ + +#ifndef GL_EXT_provoking_vertex +#define GL_EXT_provoking_vertex 1 + +#define GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION_EXT 0x8E4C +#define GL_FIRST_VERTEX_CONVENTION_EXT 0x8E4D +#define GL_LAST_VERTEX_CONVENTION_EXT 0x8E4E +#define GL_PROVOKING_VERTEX_EXT 0x8E4F + +typedef void (GLAPIENTRY * PFNGLPROVOKINGVERTEXEXTPROC) (GLenum mode); + +#define glProvokingVertexEXT GLEW_GET_FUN(__glewProvokingVertexEXT) + +#define GLEW_EXT_provoking_vertex GLEW_GET_VAR(__GLEW_EXT_provoking_vertex) + +#endif /* GL_EXT_provoking_vertex */ + +/* ------------------------- GL_EXT_rescale_normal ------------------------- */ + +#ifndef GL_EXT_rescale_normal +#define GL_EXT_rescale_normal 1 + +#define GL_RESCALE_NORMAL_EXT 0x803A + +#define GLEW_EXT_rescale_normal GLEW_GET_VAR(__GLEW_EXT_rescale_normal) + +#endif /* GL_EXT_rescale_normal */ + +/* -------------------------- GL_EXT_scene_marker -------------------------- */ + +#ifndef GL_EXT_scene_marker +#define GL_EXT_scene_marker 1 + +typedef void (GLAPIENTRY * PFNGLBEGINSCENEEXTPROC) (void); +typedef void (GLAPIENTRY * PFNGLENDSCENEEXTPROC) (void); + +#define glBeginSceneEXT GLEW_GET_FUN(__glewBeginSceneEXT) +#define glEndSceneEXT GLEW_GET_FUN(__glewEndSceneEXT) + +#define GLEW_EXT_scene_marker GLEW_GET_VAR(__GLEW_EXT_scene_marker) + +#endif /* GL_EXT_scene_marker */ + +/* ------------------------- GL_EXT_secondary_color ------------------------ */ + +#ifndef GL_EXT_secondary_color +#define GL_EXT_secondary_color 1 + +#define GL_COLOR_SUM_EXT 0x8458 +#define GL_CURRENT_SECONDARY_COLOR_EXT 0x8459 +#define GL_SECONDARY_COLOR_ARRAY_SIZE_EXT 0x845A +#define GL_SECONDARY_COLOR_ARRAY_TYPE_EXT 0x845B +#define GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT 0x845C +#define GL_SECONDARY_COLOR_ARRAY_POINTER_EXT 0x845D +#define GL_SECONDARY_COLOR_ARRAY_EXT 0x845E + +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3BEXTPROC) (GLbyte red, GLbyte green, GLbyte blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3BVEXTPROC) (const GLbyte *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3DEXTPROC) (GLdouble red, GLdouble green, GLdouble blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3DVEXTPROC) (const GLdouble *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3FEXTPROC) (GLfloat red, GLfloat green, GLfloat blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3FVEXTPROC) (const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3IEXTPROC) (GLint red, GLint green, GLint blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3IVEXTPROC) (const GLint *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3SEXTPROC) (GLshort red, GLshort green, GLshort blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3SVEXTPROC) (const GLshort *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UBEXTPROC) (GLubyte red, GLubyte green, GLubyte blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UBVEXTPROC) (const GLubyte *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UIEXTPROC) (GLuint red, GLuint green, GLuint blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UIVEXTPROC) (const GLuint *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3USEXTPROC) (GLushort red, GLushort green, GLushort blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3USVEXTPROC) (const GLushort *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); + +#define glSecondaryColor3bEXT GLEW_GET_FUN(__glewSecondaryColor3bEXT) +#define glSecondaryColor3bvEXT GLEW_GET_FUN(__glewSecondaryColor3bvEXT) +#define glSecondaryColor3dEXT GLEW_GET_FUN(__glewSecondaryColor3dEXT) +#define glSecondaryColor3dvEXT GLEW_GET_FUN(__glewSecondaryColor3dvEXT) +#define glSecondaryColor3fEXT GLEW_GET_FUN(__glewSecondaryColor3fEXT) +#define glSecondaryColor3fvEXT GLEW_GET_FUN(__glewSecondaryColor3fvEXT) +#define glSecondaryColor3iEXT GLEW_GET_FUN(__glewSecondaryColor3iEXT) +#define glSecondaryColor3ivEXT GLEW_GET_FUN(__glewSecondaryColor3ivEXT) +#define glSecondaryColor3sEXT GLEW_GET_FUN(__glewSecondaryColor3sEXT) +#define glSecondaryColor3svEXT GLEW_GET_FUN(__glewSecondaryColor3svEXT) +#define glSecondaryColor3ubEXT GLEW_GET_FUN(__glewSecondaryColor3ubEXT) +#define glSecondaryColor3ubvEXT GLEW_GET_FUN(__glewSecondaryColor3ubvEXT) +#define glSecondaryColor3uiEXT GLEW_GET_FUN(__glewSecondaryColor3uiEXT) +#define glSecondaryColor3uivEXT GLEW_GET_FUN(__glewSecondaryColor3uivEXT) +#define glSecondaryColor3usEXT GLEW_GET_FUN(__glewSecondaryColor3usEXT) +#define glSecondaryColor3usvEXT GLEW_GET_FUN(__glewSecondaryColor3usvEXT) +#define glSecondaryColorPointerEXT GLEW_GET_FUN(__glewSecondaryColorPointerEXT) + +#define GLEW_EXT_secondary_color GLEW_GET_VAR(__GLEW_EXT_secondary_color) + +#endif /* GL_EXT_secondary_color */ + +/* --------------------- GL_EXT_separate_shader_objects -------------------- */ + +#ifndef GL_EXT_separate_shader_objects +#define GL_EXT_separate_shader_objects 1 + +#define GL_ACTIVE_PROGRAM_EXT 0x8B8D + +typedef void (GLAPIENTRY * PFNGLACTIVEPROGRAMEXTPROC) (GLuint program); +typedef GLuint (GLAPIENTRY * PFNGLCREATESHADERPROGRAMEXTPROC) (GLenum type, const GLchar* string); +typedef void (GLAPIENTRY * PFNGLUSESHADERPROGRAMEXTPROC) (GLenum type, GLuint program); + +#define glActiveProgramEXT GLEW_GET_FUN(__glewActiveProgramEXT) +#define glCreateShaderProgramEXT GLEW_GET_FUN(__glewCreateShaderProgramEXT) +#define glUseShaderProgramEXT GLEW_GET_FUN(__glewUseShaderProgramEXT) + +#define GLEW_EXT_separate_shader_objects GLEW_GET_VAR(__GLEW_EXT_separate_shader_objects) + +#endif /* GL_EXT_separate_shader_objects */ + +/* --------------------- GL_EXT_separate_specular_color -------------------- */ + +#ifndef GL_EXT_separate_specular_color +#define GL_EXT_separate_specular_color 1 + +#define GL_LIGHT_MODEL_COLOR_CONTROL_EXT 0x81F8 +#define GL_SINGLE_COLOR_EXT 0x81F9 +#define GL_SEPARATE_SPECULAR_COLOR_EXT 0x81FA + +#define GLEW_EXT_separate_specular_color GLEW_GET_VAR(__GLEW_EXT_separate_specular_color) + +#endif /* GL_EXT_separate_specular_color */ + +/* --------------------- GL_EXT_shader_image_load_store -------------------- */ + +#ifndef GL_EXT_shader_image_load_store +#define GL_EXT_shader_image_load_store 1 + +#define GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT_EXT 0x00000001 +#define GL_ELEMENT_ARRAY_BARRIER_BIT_EXT 0x00000002 +#define GL_UNIFORM_BARRIER_BIT_EXT 0x00000004 +#define GL_TEXTURE_FETCH_BARRIER_BIT_EXT 0x00000008 +#define GL_SHADER_IMAGE_ACCESS_BARRIER_BIT_EXT 0x00000020 +#define GL_COMMAND_BARRIER_BIT_EXT 0x00000040 +#define GL_PIXEL_BUFFER_BARRIER_BIT_EXT 0x00000080 +#define GL_TEXTURE_UPDATE_BARRIER_BIT_EXT 0x00000100 +#define GL_BUFFER_UPDATE_BARRIER_BIT_EXT 0x00000200 +#define GL_FRAMEBUFFER_BARRIER_BIT_EXT 0x00000400 +#define GL_TRANSFORM_FEEDBACK_BARRIER_BIT_EXT 0x00000800 +#define GL_ATOMIC_COUNTER_BARRIER_BIT_EXT 0x00001000 +#define GL_MAX_IMAGE_UNITS_EXT 0x8F38 +#define GL_MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS_EXT 0x8F39 +#define GL_IMAGE_BINDING_NAME_EXT 0x8F3A +#define GL_IMAGE_BINDING_LEVEL_EXT 0x8F3B +#define GL_IMAGE_BINDING_LAYERED_EXT 0x8F3C +#define GL_IMAGE_BINDING_LAYER_EXT 0x8F3D +#define GL_IMAGE_BINDING_ACCESS_EXT 0x8F3E +#define GL_IMAGE_1D_EXT 0x904C +#define GL_IMAGE_2D_EXT 0x904D +#define GL_IMAGE_3D_EXT 0x904E +#define GL_IMAGE_2D_RECT_EXT 0x904F +#define GL_IMAGE_CUBE_EXT 0x9050 +#define GL_IMAGE_BUFFER_EXT 0x9051 +#define GL_IMAGE_1D_ARRAY_EXT 0x9052 +#define GL_IMAGE_2D_ARRAY_EXT 0x9053 +#define GL_IMAGE_CUBE_MAP_ARRAY_EXT 0x9054 +#define GL_IMAGE_2D_MULTISAMPLE_EXT 0x9055 +#define GL_IMAGE_2D_MULTISAMPLE_ARRAY_EXT 0x9056 +#define GL_INT_IMAGE_1D_EXT 0x9057 +#define GL_INT_IMAGE_2D_EXT 0x9058 +#define GL_INT_IMAGE_3D_EXT 0x9059 +#define GL_INT_IMAGE_2D_RECT_EXT 0x905A +#define GL_INT_IMAGE_CUBE_EXT 0x905B +#define GL_INT_IMAGE_BUFFER_EXT 0x905C +#define GL_INT_IMAGE_1D_ARRAY_EXT 0x905D +#define GL_INT_IMAGE_2D_ARRAY_EXT 0x905E +#define GL_INT_IMAGE_CUBE_MAP_ARRAY_EXT 0x905F +#define GL_INT_IMAGE_2D_MULTISAMPLE_EXT 0x9060 +#define GL_INT_IMAGE_2D_MULTISAMPLE_ARRAY_EXT 0x9061 +#define GL_UNSIGNED_INT_IMAGE_1D_EXT 0x9062 +#define GL_UNSIGNED_INT_IMAGE_2D_EXT 0x9063 +#define GL_UNSIGNED_INT_IMAGE_3D_EXT 0x9064 +#define GL_UNSIGNED_INT_IMAGE_2D_RECT_EXT 0x9065 +#define GL_UNSIGNED_INT_IMAGE_CUBE_EXT 0x9066 +#define GL_UNSIGNED_INT_IMAGE_BUFFER_EXT 0x9067 +#define GL_UNSIGNED_INT_IMAGE_1D_ARRAY_EXT 0x9068 +#define GL_UNSIGNED_INT_IMAGE_2D_ARRAY_EXT 0x9069 +#define GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY_EXT 0x906A +#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_EXT 0x906B +#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY_EXT 0x906C +#define GL_MAX_IMAGE_SAMPLES_EXT 0x906D +#define GL_IMAGE_BINDING_FORMAT_EXT 0x906E +#define GL_ALL_BARRIER_BITS_EXT 0xFFFFFFFF + +typedef void (GLAPIENTRY * PFNGLBINDIMAGETEXTUREEXTPROC) (GLuint index, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLint format); +typedef void (GLAPIENTRY * PFNGLMEMORYBARRIEREXTPROC) (GLbitfield barriers); + +#define glBindImageTextureEXT GLEW_GET_FUN(__glewBindImageTextureEXT) +#define glMemoryBarrierEXT GLEW_GET_FUN(__glewMemoryBarrierEXT) + +#define GLEW_EXT_shader_image_load_store GLEW_GET_VAR(__GLEW_EXT_shader_image_load_store) + +#endif /* GL_EXT_shader_image_load_store */ + +/* -------------------------- GL_EXT_shadow_funcs -------------------------- */ + +#ifndef GL_EXT_shadow_funcs +#define GL_EXT_shadow_funcs 1 + +#define GLEW_EXT_shadow_funcs GLEW_GET_VAR(__GLEW_EXT_shadow_funcs) + +#endif /* GL_EXT_shadow_funcs */ + +/* --------------------- GL_EXT_shared_texture_palette --------------------- */ + +#ifndef GL_EXT_shared_texture_palette +#define GL_EXT_shared_texture_palette 1 + +#define GL_SHARED_TEXTURE_PALETTE_EXT 0x81FB + +#define GLEW_EXT_shared_texture_palette GLEW_GET_VAR(__GLEW_EXT_shared_texture_palette) + +#endif /* GL_EXT_shared_texture_palette */ + +/* ------------------------ GL_EXT_stencil_clear_tag ----------------------- */ + +#ifndef GL_EXT_stencil_clear_tag +#define GL_EXT_stencil_clear_tag 1 + +#define GL_STENCIL_TAG_BITS_EXT 0x88F2 +#define GL_STENCIL_CLEAR_TAG_VALUE_EXT 0x88F3 + +#define GLEW_EXT_stencil_clear_tag GLEW_GET_VAR(__GLEW_EXT_stencil_clear_tag) + +#endif /* GL_EXT_stencil_clear_tag */ + +/* ------------------------ GL_EXT_stencil_two_side ------------------------ */ + +#ifndef GL_EXT_stencil_two_side +#define GL_EXT_stencil_two_side 1 + +#define GL_STENCIL_TEST_TWO_SIDE_EXT 0x8910 +#define GL_ACTIVE_STENCIL_FACE_EXT 0x8911 + +typedef void (GLAPIENTRY * PFNGLACTIVESTENCILFACEEXTPROC) (GLenum face); + +#define glActiveStencilFaceEXT GLEW_GET_FUN(__glewActiveStencilFaceEXT) + +#define GLEW_EXT_stencil_two_side GLEW_GET_VAR(__GLEW_EXT_stencil_two_side) + +#endif /* GL_EXT_stencil_two_side */ + +/* -------------------------- GL_EXT_stencil_wrap -------------------------- */ + +#ifndef GL_EXT_stencil_wrap +#define GL_EXT_stencil_wrap 1 + +#define GL_INCR_WRAP_EXT 0x8507 +#define GL_DECR_WRAP_EXT 0x8508 + +#define GLEW_EXT_stencil_wrap GLEW_GET_VAR(__GLEW_EXT_stencil_wrap) + +#endif /* GL_EXT_stencil_wrap */ + +/* --------------------------- GL_EXT_subtexture --------------------------- */ + +#ifndef GL_EXT_subtexture +#define GL_EXT_subtexture 1 + +typedef void (GLAPIENTRY * PFNGLTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (GLAPIENTRY * PFNGLTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (GLAPIENTRY * PFNGLTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); + +#define glTexSubImage1DEXT GLEW_GET_FUN(__glewTexSubImage1DEXT) +#define glTexSubImage2DEXT GLEW_GET_FUN(__glewTexSubImage2DEXT) +#define glTexSubImage3DEXT GLEW_GET_FUN(__glewTexSubImage3DEXT) + +#define GLEW_EXT_subtexture GLEW_GET_VAR(__GLEW_EXT_subtexture) + +#endif /* GL_EXT_subtexture */ + +/* ----------------------------- GL_EXT_texture ---------------------------- */ + +#ifndef GL_EXT_texture +#define GL_EXT_texture 1 + +#define GL_ALPHA4_EXT 0x803B +#define GL_ALPHA8_EXT 0x803C +#define GL_ALPHA12_EXT 0x803D +#define GL_ALPHA16_EXT 0x803E +#define GL_LUMINANCE4_EXT 0x803F +#define GL_LUMINANCE8_EXT 0x8040 +#define GL_LUMINANCE12_EXT 0x8041 +#define GL_LUMINANCE16_EXT 0x8042 +#define GL_LUMINANCE4_ALPHA4_EXT 0x8043 +#define GL_LUMINANCE6_ALPHA2_EXT 0x8044 +#define GL_LUMINANCE8_ALPHA8_EXT 0x8045 +#define GL_LUMINANCE12_ALPHA4_EXT 0x8046 +#define GL_LUMINANCE12_ALPHA12_EXT 0x8047 +#define GL_LUMINANCE16_ALPHA16_EXT 0x8048 +#define GL_INTENSITY_EXT 0x8049 +#define GL_INTENSITY4_EXT 0x804A +#define GL_INTENSITY8_EXT 0x804B +#define GL_INTENSITY12_EXT 0x804C +#define GL_INTENSITY16_EXT 0x804D +#define GL_RGB2_EXT 0x804E +#define GL_RGB4_EXT 0x804F +#define GL_RGB5_EXT 0x8050 +#define GL_RGB8_EXT 0x8051 +#define GL_RGB10_EXT 0x8052 +#define GL_RGB12_EXT 0x8053 +#define GL_RGB16_EXT 0x8054 +#define GL_RGBA2_EXT 0x8055 +#define GL_RGBA4_EXT 0x8056 +#define GL_RGB5_A1_EXT 0x8057 +#define GL_RGBA8_EXT 0x8058 +#define GL_RGB10_A2_EXT 0x8059 +#define GL_RGBA12_EXT 0x805A +#define GL_RGBA16_EXT 0x805B +#define GL_TEXTURE_RED_SIZE_EXT 0x805C +#define GL_TEXTURE_GREEN_SIZE_EXT 0x805D +#define GL_TEXTURE_BLUE_SIZE_EXT 0x805E +#define GL_TEXTURE_ALPHA_SIZE_EXT 0x805F +#define GL_TEXTURE_LUMINANCE_SIZE_EXT 0x8060 +#define GL_TEXTURE_INTENSITY_SIZE_EXT 0x8061 +#define GL_REPLACE_EXT 0x8062 +#define GL_PROXY_TEXTURE_1D_EXT 0x8063 +#define GL_PROXY_TEXTURE_2D_EXT 0x8064 + +#define GLEW_EXT_texture GLEW_GET_VAR(__GLEW_EXT_texture) + +#endif /* GL_EXT_texture */ + +/* ---------------------------- GL_EXT_texture3D --------------------------- */ + +#ifndef GL_EXT_texture3D +#define GL_EXT_texture3D 1 + +#define GL_PACK_SKIP_IMAGES_EXT 0x806B +#define GL_PACK_IMAGE_HEIGHT_EXT 0x806C +#define GL_UNPACK_SKIP_IMAGES_EXT 0x806D +#define GL_UNPACK_IMAGE_HEIGHT_EXT 0x806E +#define GL_TEXTURE_3D_EXT 0x806F +#define GL_PROXY_TEXTURE_3D_EXT 0x8070 +#define GL_TEXTURE_DEPTH_EXT 0x8071 +#define GL_TEXTURE_WRAP_R_EXT 0x8072 +#define GL_MAX_3D_TEXTURE_SIZE_EXT 0x8073 + +typedef void (GLAPIENTRY * PFNGLTEXIMAGE3DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); + +#define glTexImage3DEXT GLEW_GET_FUN(__glewTexImage3DEXT) + +#define GLEW_EXT_texture3D GLEW_GET_VAR(__GLEW_EXT_texture3D) + +#endif /* GL_EXT_texture3D */ + +/* -------------------------- GL_EXT_texture_array ------------------------- */ + +#ifndef GL_EXT_texture_array +#define GL_EXT_texture_array 1 + +#define GL_COMPARE_REF_DEPTH_TO_TEXTURE_EXT 0x884E +#define GL_MAX_ARRAY_TEXTURE_LAYERS_EXT 0x88FF +#define GL_TEXTURE_1D_ARRAY_EXT 0x8C18 +#define GL_PROXY_TEXTURE_1D_ARRAY_EXT 0x8C19 +#define GL_TEXTURE_2D_ARRAY_EXT 0x8C1A +#define GL_PROXY_TEXTURE_2D_ARRAY_EXT 0x8C1B +#define GL_TEXTURE_BINDING_1D_ARRAY_EXT 0x8C1C +#define GL_TEXTURE_BINDING_2D_ARRAY_EXT 0x8C1D + +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); + +#define glFramebufferTextureLayerEXT GLEW_GET_FUN(__glewFramebufferTextureLayerEXT) + +#define GLEW_EXT_texture_array GLEW_GET_VAR(__GLEW_EXT_texture_array) + +#endif /* GL_EXT_texture_array */ + +/* ---------------------- GL_EXT_texture_buffer_object --------------------- */ + +#ifndef GL_EXT_texture_buffer_object +#define GL_EXT_texture_buffer_object 1 + +#define GL_TEXTURE_BUFFER_EXT 0x8C2A +#define GL_MAX_TEXTURE_BUFFER_SIZE_EXT 0x8C2B +#define GL_TEXTURE_BINDING_BUFFER_EXT 0x8C2C +#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING_EXT 0x8C2D +#define GL_TEXTURE_BUFFER_FORMAT_EXT 0x8C2E + +typedef void (GLAPIENTRY * PFNGLTEXBUFFEREXTPROC) (GLenum target, GLenum internalformat, GLuint buffer); + +#define glTexBufferEXT GLEW_GET_FUN(__glewTexBufferEXT) + +#define GLEW_EXT_texture_buffer_object GLEW_GET_VAR(__GLEW_EXT_texture_buffer_object) + +#endif /* GL_EXT_texture_buffer_object */ + +/* -------------------- GL_EXT_texture_compression_dxt1 -------------------- */ + +#ifndef GL_EXT_texture_compression_dxt1 +#define GL_EXT_texture_compression_dxt1 1 + +#define GLEW_EXT_texture_compression_dxt1 GLEW_GET_VAR(__GLEW_EXT_texture_compression_dxt1) + +#endif /* GL_EXT_texture_compression_dxt1 */ + +/* -------------------- GL_EXT_texture_compression_latc -------------------- */ + +#ifndef GL_EXT_texture_compression_latc +#define GL_EXT_texture_compression_latc 1 + +#define GL_COMPRESSED_LUMINANCE_LATC1_EXT 0x8C70 +#define GL_COMPRESSED_SIGNED_LUMINANCE_LATC1_EXT 0x8C71 +#define GL_COMPRESSED_LUMINANCE_ALPHA_LATC2_EXT 0x8C72 +#define GL_COMPRESSED_SIGNED_LUMINANCE_ALPHA_LATC2_EXT 0x8C73 + +#define GLEW_EXT_texture_compression_latc GLEW_GET_VAR(__GLEW_EXT_texture_compression_latc) + +#endif /* GL_EXT_texture_compression_latc */ + +/* -------------------- GL_EXT_texture_compression_rgtc -------------------- */ + +#ifndef GL_EXT_texture_compression_rgtc +#define GL_EXT_texture_compression_rgtc 1 + +#define GL_COMPRESSED_RED_RGTC1_EXT 0x8DBB +#define GL_COMPRESSED_SIGNED_RED_RGTC1_EXT 0x8DBC +#define GL_COMPRESSED_RED_GREEN_RGTC2_EXT 0x8DBD +#define GL_COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT 0x8DBE + +#define GLEW_EXT_texture_compression_rgtc GLEW_GET_VAR(__GLEW_EXT_texture_compression_rgtc) + +#endif /* GL_EXT_texture_compression_rgtc */ + +/* -------------------- GL_EXT_texture_compression_s3tc -------------------- */ + +#ifndef GL_EXT_texture_compression_s3tc +#define GL_EXT_texture_compression_s3tc 1 + +#define GL_COMPRESSED_RGB_S3TC_DXT1_EXT 0x83F0 +#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1 +#define GL_COMPRESSED_RGBA_S3TC_DXT3_EXT 0x83F2 +#define GL_COMPRESSED_RGBA_S3TC_DXT5_EXT 0x83F3 + +#define GLEW_EXT_texture_compression_s3tc GLEW_GET_VAR(__GLEW_EXT_texture_compression_s3tc) + +#endif /* GL_EXT_texture_compression_s3tc */ + +/* ------------------------ GL_EXT_texture_cube_map ------------------------ */ + +#ifndef GL_EXT_texture_cube_map +#define GL_EXT_texture_cube_map 1 + +#define GL_NORMAL_MAP_EXT 0x8511 +#define GL_REFLECTION_MAP_EXT 0x8512 +#define GL_TEXTURE_CUBE_MAP_EXT 0x8513 +#define GL_TEXTURE_BINDING_CUBE_MAP_EXT 0x8514 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_EXT 0x8515 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_EXT 0x8516 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_EXT 0x8517 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_EXT 0x8518 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_EXT 0x8519 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_EXT 0x851A +#define GL_PROXY_TEXTURE_CUBE_MAP_EXT 0x851B +#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_EXT 0x851C + +#define GLEW_EXT_texture_cube_map GLEW_GET_VAR(__GLEW_EXT_texture_cube_map) + +#endif /* GL_EXT_texture_cube_map */ + +/* ----------------------- GL_EXT_texture_edge_clamp ----------------------- */ + +#ifndef GL_EXT_texture_edge_clamp +#define GL_EXT_texture_edge_clamp 1 + +#define GL_CLAMP_TO_EDGE_EXT 0x812F + +#define GLEW_EXT_texture_edge_clamp GLEW_GET_VAR(__GLEW_EXT_texture_edge_clamp) + +#endif /* GL_EXT_texture_edge_clamp */ + +/* --------------------------- GL_EXT_texture_env -------------------------- */ + +#ifndef GL_EXT_texture_env +#define GL_EXT_texture_env 1 + +#define GLEW_EXT_texture_env GLEW_GET_VAR(__GLEW_EXT_texture_env) + +#endif /* GL_EXT_texture_env */ + +/* ------------------------- GL_EXT_texture_env_add ------------------------ */ + +#ifndef GL_EXT_texture_env_add +#define GL_EXT_texture_env_add 1 + +#define GLEW_EXT_texture_env_add GLEW_GET_VAR(__GLEW_EXT_texture_env_add) + +#endif /* GL_EXT_texture_env_add */ + +/* ----------------------- GL_EXT_texture_env_combine ---------------------- */ + +#ifndef GL_EXT_texture_env_combine +#define GL_EXT_texture_env_combine 1 + +#define GL_COMBINE_EXT 0x8570 +#define GL_COMBINE_RGB_EXT 0x8571 +#define GL_COMBINE_ALPHA_EXT 0x8572 +#define GL_RGB_SCALE_EXT 0x8573 +#define GL_ADD_SIGNED_EXT 0x8574 +#define GL_INTERPOLATE_EXT 0x8575 +#define GL_CONSTANT_EXT 0x8576 +#define GL_PRIMARY_COLOR_EXT 0x8577 +#define GL_PREVIOUS_EXT 0x8578 +#define GL_SOURCE0_RGB_EXT 0x8580 +#define GL_SOURCE1_RGB_EXT 0x8581 +#define GL_SOURCE2_RGB_EXT 0x8582 +#define GL_SOURCE0_ALPHA_EXT 0x8588 +#define GL_SOURCE1_ALPHA_EXT 0x8589 +#define GL_SOURCE2_ALPHA_EXT 0x858A +#define GL_OPERAND0_RGB_EXT 0x8590 +#define GL_OPERAND1_RGB_EXT 0x8591 +#define GL_OPERAND2_RGB_EXT 0x8592 +#define GL_OPERAND0_ALPHA_EXT 0x8598 +#define GL_OPERAND1_ALPHA_EXT 0x8599 +#define GL_OPERAND2_ALPHA_EXT 0x859A + +#define GLEW_EXT_texture_env_combine GLEW_GET_VAR(__GLEW_EXT_texture_env_combine) + +#endif /* GL_EXT_texture_env_combine */ + +/* ------------------------ GL_EXT_texture_env_dot3 ------------------------ */ + +#ifndef GL_EXT_texture_env_dot3 +#define GL_EXT_texture_env_dot3 1 + +#define GL_DOT3_RGB_EXT 0x8740 +#define GL_DOT3_RGBA_EXT 0x8741 + +#define GLEW_EXT_texture_env_dot3 GLEW_GET_VAR(__GLEW_EXT_texture_env_dot3) + +#endif /* GL_EXT_texture_env_dot3 */ + +/* ------------------- GL_EXT_texture_filter_anisotropic ------------------- */ + +#ifndef GL_EXT_texture_filter_anisotropic +#define GL_EXT_texture_filter_anisotropic 1 + +#define GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE +#define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF + +#define GLEW_EXT_texture_filter_anisotropic GLEW_GET_VAR(__GLEW_EXT_texture_filter_anisotropic) + +#endif /* GL_EXT_texture_filter_anisotropic */ + +/* ------------------------- GL_EXT_texture_integer ------------------------ */ + +#ifndef GL_EXT_texture_integer +#define GL_EXT_texture_integer 1 + +#define GL_RGBA32UI_EXT 0x8D70 +#define GL_RGB32UI_EXT 0x8D71 +#define GL_ALPHA32UI_EXT 0x8D72 +#define GL_INTENSITY32UI_EXT 0x8D73 +#define GL_LUMINANCE32UI_EXT 0x8D74 +#define GL_LUMINANCE_ALPHA32UI_EXT 0x8D75 +#define GL_RGBA16UI_EXT 0x8D76 +#define GL_RGB16UI_EXT 0x8D77 +#define GL_ALPHA16UI_EXT 0x8D78 +#define GL_INTENSITY16UI_EXT 0x8D79 +#define GL_LUMINANCE16UI_EXT 0x8D7A +#define GL_LUMINANCE_ALPHA16UI_EXT 0x8D7B +#define GL_RGBA8UI_EXT 0x8D7C +#define GL_RGB8UI_EXT 0x8D7D +#define GL_ALPHA8UI_EXT 0x8D7E +#define GL_INTENSITY8UI_EXT 0x8D7F +#define GL_LUMINANCE8UI_EXT 0x8D80 +#define GL_LUMINANCE_ALPHA8UI_EXT 0x8D81 +#define GL_RGBA32I_EXT 0x8D82 +#define GL_RGB32I_EXT 0x8D83 +#define GL_ALPHA32I_EXT 0x8D84 +#define GL_INTENSITY32I_EXT 0x8D85 +#define GL_LUMINANCE32I_EXT 0x8D86 +#define GL_LUMINANCE_ALPHA32I_EXT 0x8D87 +#define GL_RGBA16I_EXT 0x8D88 +#define GL_RGB16I_EXT 0x8D89 +#define GL_ALPHA16I_EXT 0x8D8A +#define GL_INTENSITY16I_EXT 0x8D8B +#define GL_LUMINANCE16I_EXT 0x8D8C +#define GL_LUMINANCE_ALPHA16I_EXT 0x8D8D +#define GL_RGBA8I_EXT 0x8D8E +#define GL_RGB8I_EXT 0x8D8F +#define GL_ALPHA8I_EXT 0x8D90 +#define GL_INTENSITY8I_EXT 0x8D91 +#define GL_LUMINANCE8I_EXT 0x8D92 +#define GL_LUMINANCE_ALPHA8I_EXT 0x8D93 +#define GL_RED_INTEGER_EXT 0x8D94 +#define GL_GREEN_INTEGER_EXT 0x8D95 +#define GL_BLUE_INTEGER_EXT 0x8D96 +#define GL_ALPHA_INTEGER_EXT 0x8D97 +#define GL_RGB_INTEGER_EXT 0x8D98 +#define GL_RGBA_INTEGER_EXT 0x8D99 +#define GL_BGR_INTEGER_EXT 0x8D9A +#define GL_BGRA_INTEGER_EXT 0x8D9B +#define GL_LUMINANCE_INTEGER_EXT 0x8D9C +#define GL_LUMINANCE_ALPHA_INTEGER_EXT 0x8D9D +#define GL_RGBA_INTEGER_MODE_EXT 0x8D9E + +typedef void (GLAPIENTRY * PFNGLCLEARCOLORIIEXTPROC) (GLint red, GLint green, GLint blue, GLint alpha); +typedef void (GLAPIENTRY * PFNGLCLEARCOLORIUIEXTPROC) (GLuint red, GLuint green, GLuint blue, GLuint alpha); +typedef void (GLAPIENTRY * PFNGLGETTEXPARAMETERIIVEXTPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (GLAPIENTRY * PFNGLGETTEXPARAMETERIUIVEXTPROC) (GLenum target, GLenum pname, GLuint *params); +typedef void (GLAPIENTRY * PFNGLTEXPARAMETERIIVEXTPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (GLAPIENTRY * PFNGLTEXPARAMETERIUIVEXTPROC) (GLenum target, GLenum pname, const GLuint *params); + +#define glClearColorIiEXT GLEW_GET_FUN(__glewClearColorIiEXT) +#define glClearColorIuiEXT GLEW_GET_FUN(__glewClearColorIuiEXT) +#define glGetTexParameterIivEXT GLEW_GET_FUN(__glewGetTexParameterIivEXT) +#define glGetTexParameterIuivEXT GLEW_GET_FUN(__glewGetTexParameterIuivEXT) +#define glTexParameterIivEXT GLEW_GET_FUN(__glewTexParameterIivEXT) +#define glTexParameterIuivEXT GLEW_GET_FUN(__glewTexParameterIuivEXT) + +#define GLEW_EXT_texture_integer GLEW_GET_VAR(__GLEW_EXT_texture_integer) + +#endif /* GL_EXT_texture_integer */ + +/* ------------------------ GL_EXT_texture_lod_bias ------------------------ */ + +#ifndef GL_EXT_texture_lod_bias +#define GL_EXT_texture_lod_bias 1 + +#define GL_MAX_TEXTURE_LOD_BIAS_EXT 0x84FD +#define GL_TEXTURE_FILTER_CONTROL_EXT 0x8500 +#define GL_TEXTURE_LOD_BIAS_EXT 0x8501 + +#define GLEW_EXT_texture_lod_bias GLEW_GET_VAR(__GLEW_EXT_texture_lod_bias) + +#endif /* GL_EXT_texture_lod_bias */ + +/* ---------------------- GL_EXT_texture_mirror_clamp ---------------------- */ + +#ifndef GL_EXT_texture_mirror_clamp +#define GL_EXT_texture_mirror_clamp 1 + +#define GL_MIRROR_CLAMP_EXT 0x8742 +#define GL_MIRROR_CLAMP_TO_EDGE_EXT 0x8743 +#define GL_MIRROR_CLAMP_TO_BORDER_EXT 0x8912 + +#define GLEW_EXT_texture_mirror_clamp GLEW_GET_VAR(__GLEW_EXT_texture_mirror_clamp) + +#endif /* GL_EXT_texture_mirror_clamp */ + +/* ------------------------- GL_EXT_texture_object ------------------------- */ + +#ifndef GL_EXT_texture_object +#define GL_EXT_texture_object 1 + +#define GL_TEXTURE_PRIORITY_EXT 0x8066 +#define GL_TEXTURE_RESIDENT_EXT 0x8067 +#define GL_TEXTURE_1D_BINDING_EXT 0x8068 +#define GL_TEXTURE_2D_BINDING_EXT 0x8069 +#define GL_TEXTURE_3D_BINDING_EXT 0x806A + +typedef GLboolean (GLAPIENTRY * PFNGLARETEXTURESRESIDENTEXTPROC) (GLsizei n, const GLuint* textures, GLboolean* residences); +typedef void (GLAPIENTRY * PFNGLBINDTEXTUREEXTPROC) (GLenum target, GLuint texture); +typedef void (GLAPIENTRY * PFNGLDELETETEXTURESEXTPROC) (GLsizei n, const GLuint* textures); +typedef void (GLAPIENTRY * PFNGLGENTEXTURESEXTPROC) (GLsizei n, GLuint* textures); +typedef GLboolean (GLAPIENTRY * PFNGLISTEXTUREEXTPROC) (GLuint texture); +typedef void (GLAPIENTRY * PFNGLPRIORITIZETEXTURESEXTPROC) (GLsizei n, const GLuint* textures, const GLclampf* priorities); + +#define glAreTexturesResidentEXT GLEW_GET_FUN(__glewAreTexturesResidentEXT) +#define glBindTextureEXT GLEW_GET_FUN(__glewBindTextureEXT) +#define glDeleteTexturesEXT GLEW_GET_FUN(__glewDeleteTexturesEXT) +#define glGenTexturesEXT GLEW_GET_FUN(__glewGenTexturesEXT) +#define glIsTextureEXT GLEW_GET_FUN(__glewIsTextureEXT) +#define glPrioritizeTexturesEXT GLEW_GET_FUN(__glewPrioritizeTexturesEXT) + +#define GLEW_EXT_texture_object GLEW_GET_VAR(__GLEW_EXT_texture_object) + +#endif /* GL_EXT_texture_object */ + +/* --------------------- GL_EXT_texture_perturb_normal --------------------- */ + +#ifndef GL_EXT_texture_perturb_normal +#define GL_EXT_texture_perturb_normal 1 + +#define GL_PERTURB_EXT 0x85AE +#define GL_TEXTURE_NORMAL_EXT 0x85AF + +typedef void (GLAPIENTRY * PFNGLTEXTURENORMALEXTPROC) (GLenum mode); + +#define glTextureNormalEXT GLEW_GET_FUN(__glewTextureNormalEXT) + +#define GLEW_EXT_texture_perturb_normal GLEW_GET_VAR(__GLEW_EXT_texture_perturb_normal) + +#endif /* GL_EXT_texture_perturb_normal */ + +/* ------------------------ GL_EXT_texture_rectangle ----------------------- */ + +#ifndef GL_EXT_texture_rectangle +#define GL_EXT_texture_rectangle 1 + +#define GL_TEXTURE_RECTANGLE_EXT 0x84F5 +#define GL_TEXTURE_BINDING_RECTANGLE_EXT 0x84F6 +#define GL_PROXY_TEXTURE_RECTANGLE_EXT 0x84F7 +#define GL_MAX_RECTANGLE_TEXTURE_SIZE_EXT 0x84F8 + +#define GLEW_EXT_texture_rectangle GLEW_GET_VAR(__GLEW_EXT_texture_rectangle) + +#endif /* GL_EXT_texture_rectangle */ + +/* -------------------------- GL_EXT_texture_sRGB -------------------------- */ + +#ifndef GL_EXT_texture_sRGB +#define GL_EXT_texture_sRGB 1 + +#define GL_SRGB_EXT 0x8C40 +#define GL_SRGB8_EXT 0x8C41 +#define GL_SRGB_ALPHA_EXT 0x8C42 +#define GL_SRGB8_ALPHA8_EXT 0x8C43 +#define GL_SLUMINANCE_ALPHA_EXT 0x8C44 +#define GL_SLUMINANCE8_ALPHA8_EXT 0x8C45 +#define GL_SLUMINANCE_EXT 0x8C46 +#define GL_SLUMINANCE8_EXT 0x8C47 +#define GL_COMPRESSED_SRGB_EXT 0x8C48 +#define GL_COMPRESSED_SRGB_ALPHA_EXT 0x8C49 +#define GL_COMPRESSED_SLUMINANCE_EXT 0x8C4A +#define GL_COMPRESSED_SLUMINANCE_ALPHA_EXT 0x8C4B +#define GL_COMPRESSED_SRGB_S3TC_DXT1_EXT 0x8C4C +#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT 0x8C4D +#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT 0x8C4E +#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT 0x8C4F + +#define GLEW_EXT_texture_sRGB GLEW_GET_VAR(__GLEW_EXT_texture_sRGB) + +#endif /* GL_EXT_texture_sRGB */ + +/* ----------------------- GL_EXT_texture_sRGB_decode ---------------------- */ + +#ifndef GL_EXT_texture_sRGB_decode +#define GL_EXT_texture_sRGB_decode 1 + +#define GL_TEXTURE_SRGB_DECODE_EXT 0x8A48 +#define GL_DECODE_EXT 0x8A49 +#define GL_SKIP_DECODE_EXT 0x8A4A + +#define GLEW_EXT_texture_sRGB_decode GLEW_GET_VAR(__GLEW_EXT_texture_sRGB_decode) + +#endif /* GL_EXT_texture_sRGB_decode */ + +/* --------------------- GL_EXT_texture_shared_exponent -------------------- */ + +#ifndef GL_EXT_texture_shared_exponent +#define GL_EXT_texture_shared_exponent 1 + +#define GL_RGB9_E5_EXT 0x8C3D +#define GL_UNSIGNED_INT_5_9_9_9_REV_EXT 0x8C3E +#define GL_TEXTURE_SHARED_SIZE_EXT 0x8C3F + +#define GLEW_EXT_texture_shared_exponent GLEW_GET_VAR(__GLEW_EXT_texture_shared_exponent) + +#endif /* GL_EXT_texture_shared_exponent */ + +/* -------------------------- GL_EXT_texture_snorm ------------------------- */ + +#ifndef GL_EXT_texture_snorm +#define GL_EXT_texture_snorm 1 + +#define GL_RED_SNORM 0x8F90 +#define GL_RG_SNORM 0x8F91 +#define GL_RGB_SNORM 0x8F92 +#define GL_RGBA_SNORM 0x8F93 +#define GL_R8_SNORM 0x8F94 +#define GL_RG8_SNORM 0x8F95 +#define GL_RGB8_SNORM 0x8F96 +#define GL_RGBA8_SNORM 0x8F97 +#define GL_R16_SNORM 0x8F98 +#define GL_RG16_SNORM 0x8F99 +#define GL_RGB16_SNORM 0x8F9A +#define GL_RGBA16_SNORM 0x8F9B +#define GL_SIGNED_NORMALIZED 0x8F9C +#define GL_ALPHA_SNORM 0x9010 +#define GL_LUMINANCE_SNORM 0x9011 +#define GL_LUMINANCE_ALPHA_SNORM 0x9012 +#define GL_INTENSITY_SNORM 0x9013 +#define GL_ALPHA8_SNORM 0x9014 +#define GL_LUMINANCE8_SNORM 0x9015 +#define GL_LUMINANCE8_ALPHA8_SNORM 0x9016 +#define GL_INTENSITY8_SNORM 0x9017 +#define GL_ALPHA16_SNORM 0x9018 +#define GL_LUMINANCE16_SNORM 0x9019 +#define GL_LUMINANCE16_ALPHA16_SNORM 0x901A +#define GL_INTENSITY16_SNORM 0x901B + +#define GLEW_EXT_texture_snorm GLEW_GET_VAR(__GLEW_EXT_texture_snorm) + +#endif /* GL_EXT_texture_snorm */ + +/* ------------------------- GL_EXT_texture_swizzle ------------------------ */ + +#ifndef GL_EXT_texture_swizzle +#define GL_EXT_texture_swizzle 1 + +#define GL_TEXTURE_SWIZZLE_R_EXT 0x8E42 +#define GL_TEXTURE_SWIZZLE_G_EXT 0x8E43 +#define GL_TEXTURE_SWIZZLE_B_EXT 0x8E44 +#define GL_TEXTURE_SWIZZLE_A_EXT 0x8E45 +#define GL_TEXTURE_SWIZZLE_RGBA_EXT 0x8E46 + +#define GLEW_EXT_texture_swizzle GLEW_GET_VAR(__GLEW_EXT_texture_swizzle) + +#endif /* GL_EXT_texture_swizzle */ + +/* --------------------------- GL_EXT_timer_query -------------------------- */ + +#ifndef GL_EXT_timer_query +#define GL_EXT_timer_query 1 + +#define GL_TIME_ELAPSED_EXT 0x88BF + +typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTI64VEXTPROC) (GLuint id, GLenum pname, GLint64EXT *params); +typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTUI64VEXTPROC) (GLuint id, GLenum pname, GLuint64EXT *params); + +#define glGetQueryObjecti64vEXT GLEW_GET_FUN(__glewGetQueryObjecti64vEXT) +#define glGetQueryObjectui64vEXT GLEW_GET_FUN(__glewGetQueryObjectui64vEXT) + +#define GLEW_EXT_timer_query GLEW_GET_VAR(__GLEW_EXT_timer_query) + +#endif /* GL_EXT_timer_query */ + +/* ----------------------- GL_EXT_transform_feedback ----------------------- */ + +#ifndef GL_EXT_transform_feedback +#define GL_EXT_transform_feedback 1 + +#define GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH_EXT 0x8C76 +#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE_EXT 0x8C7F +#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_EXT 0x8C80 +#define GL_TRANSFORM_FEEDBACK_VARYINGS_EXT 0x8C83 +#define GL_TRANSFORM_FEEDBACK_BUFFER_START_EXT 0x8C84 +#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE_EXT 0x8C85 +#define GL_PRIMITIVES_GENERATED_EXT 0x8C87 +#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_EXT 0x8C88 +#define GL_RASTERIZER_DISCARD_EXT 0x8C89 +#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS_EXT 0x8C8A +#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_EXT 0x8C8B +#define GL_INTERLEAVED_ATTRIBS_EXT 0x8C8C +#define GL_SEPARATE_ATTRIBS_EXT 0x8C8D +#define GL_TRANSFORM_FEEDBACK_BUFFER_EXT 0x8C8E +#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_EXT 0x8C8F + +typedef void (GLAPIENTRY * PFNGLBEGINTRANSFORMFEEDBACKEXTPROC) (GLenum primitiveMode); +typedef void (GLAPIENTRY * PFNGLBINDBUFFERBASEEXTPROC) (GLenum target, GLuint index, GLuint buffer); +typedef void (GLAPIENTRY * PFNGLBINDBUFFEROFFSETEXTPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLBINDBUFFERRANGEEXTPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); +typedef void (GLAPIENTRY * PFNGLENDTRANSFORMFEEDBACKEXTPROC) (void); +typedef void (GLAPIENTRY * PFNGLGETTRANSFORMFEEDBACKVARYINGEXTPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei* length, GLsizei *size, GLenum *type, GLchar *name); +typedef void (GLAPIENTRY * PFNGLTRANSFORMFEEDBACKVARYINGSEXTPROC) (GLuint program, GLsizei count, const GLchar * const* varyings, GLenum bufferMode); + +#define glBeginTransformFeedbackEXT GLEW_GET_FUN(__glewBeginTransformFeedbackEXT) +#define glBindBufferBaseEXT GLEW_GET_FUN(__glewBindBufferBaseEXT) +#define glBindBufferOffsetEXT GLEW_GET_FUN(__glewBindBufferOffsetEXT) +#define glBindBufferRangeEXT GLEW_GET_FUN(__glewBindBufferRangeEXT) +#define glEndTransformFeedbackEXT GLEW_GET_FUN(__glewEndTransformFeedbackEXT) +#define glGetTransformFeedbackVaryingEXT GLEW_GET_FUN(__glewGetTransformFeedbackVaryingEXT) +#define glTransformFeedbackVaryingsEXT GLEW_GET_FUN(__glewTransformFeedbackVaryingsEXT) + +#define GLEW_EXT_transform_feedback GLEW_GET_VAR(__GLEW_EXT_transform_feedback) + +#endif /* GL_EXT_transform_feedback */ + +/* -------------------------- GL_EXT_vertex_array -------------------------- */ + +#ifndef GL_EXT_vertex_array +#define GL_EXT_vertex_array 1 + +#define GL_DOUBLE_EXT 0x140A +#define GL_VERTEX_ARRAY_EXT 0x8074 +#define GL_NORMAL_ARRAY_EXT 0x8075 +#define GL_COLOR_ARRAY_EXT 0x8076 +#define GL_INDEX_ARRAY_EXT 0x8077 +#define GL_TEXTURE_COORD_ARRAY_EXT 0x8078 +#define GL_EDGE_FLAG_ARRAY_EXT 0x8079 +#define GL_VERTEX_ARRAY_SIZE_EXT 0x807A +#define GL_VERTEX_ARRAY_TYPE_EXT 0x807B +#define GL_VERTEX_ARRAY_STRIDE_EXT 0x807C +#define GL_VERTEX_ARRAY_COUNT_EXT 0x807D +#define GL_NORMAL_ARRAY_TYPE_EXT 0x807E +#define GL_NORMAL_ARRAY_STRIDE_EXT 0x807F +#define GL_NORMAL_ARRAY_COUNT_EXT 0x8080 +#define GL_COLOR_ARRAY_SIZE_EXT 0x8081 +#define GL_COLOR_ARRAY_TYPE_EXT 0x8082 +#define GL_COLOR_ARRAY_STRIDE_EXT 0x8083 +#define GL_COLOR_ARRAY_COUNT_EXT 0x8084 +#define GL_INDEX_ARRAY_TYPE_EXT 0x8085 +#define GL_INDEX_ARRAY_STRIDE_EXT 0x8086 +#define GL_INDEX_ARRAY_COUNT_EXT 0x8087 +#define GL_TEXTURE_COORD_ARRAY_SIZE_EXT 0x8088 +#define GL_TEXTURE_COORD_ARRAY_TYPE_EXT 0x8089 +#define GL_TEXTURE_COORD_ARRAY_STRIDE_EXT 0x808A +#define GL_TEXTURE_COORD_ARRAY_COUNT_EXT 0x808B +#define GL_EDGE_FLAG_ARRAY_STRIDE_EXT 0x808C +#define GL_EDGE_FLAG_ARRAY_COUNT_EXT 0x808D +#define GL_VERTEX_ARRAY_POINTER_EXT 0x808E +#define GL_NORMAL_ARRAY_POINTER_EXT 0x808F +#define GL_COLOR_ARRAY_POINTER_EXT 0x8090 +#define GL_INDEX_ARRAY_POINTER_EXT 0x8091 +#define GL_TEXTURE_COORD_ARRAY_POINTER_EXT 0x8092 +#define GL_EDGE_FLAG_ARRAY_POINTER_EXT 0x8093 + +typedef void (GLAPIENTRY * PFNGLARRAYELEMENTEXTPROC) (GLint i); +typedef void (GLAPIENTRY * PFNGLCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); +typedef void (GLAPIENTRY * PFNGLDRAWARRAYSEXTPROC) (GLenum mode, GLint first, GLsizei count); +typedef void (GLAPIENTRY * PFNGLEDGEFLAGPOINTEREXTPROC) (GLsizei stride, GLsizei count, const GLboolean* pointer); +typedef void (GLAPIENTRY * PFNGLINDEXPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); +typedef void (GLAPIENTRY * PFNGLNORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); +typedef void (GLAPIENTRY * PFNGLTEXCOORDPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); +typedef void (GLAPIENTRY * PFNGLVERTEXPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); + +#define glArrayElementEXT GLEW_GET_FUN(__glewArrayElementEXT) +#define glColorPointerEXT GLEW_GET_FUN(__glewColorPointerEXT) +#define glDrawArraysEXT GLEW_GET_FUN(__glewDrawArraysEXT) +#define glEdgeFlagPointerEXT GLEW_GET_FUN(__glewEdgeFlagPointerEXT) +#define glIndexPointerEXT GLEW_GET_FUN(__glewIndexPointerEXT) +#define glNormalPointerEXT GLEW_GET_FUN(__glewNormalPointerEXT) +#define glTexCoordPointerEXT GLEW_GET_FUN(__glewTexCoordPointerEXT) +#define glVertexPointerEXT GLEW_GET_FUN(__glewVertexPointerEXT) + +#define GLEW_EXT_vertex_array GLEW_GET_VAR(__GLEW_EXT_vertex_array) + +#endif /* GL_EXT_vertex_array */ + +/* ------------------------ GL_EXT_vertex_array_bgra ----------------------- */ + +#ifndef GL_EXT_vertex_array_bgra +#define GL_EXT_vertex_array_bgra 1 + +#define GL_BGRA 0x80E1 + +#define GLEW_EXT_vertex_array_bgra GLEW_GET_VAR(__GLEW_EXT_vertex_array_bgra) + +#endif /* GL_EXT_vertex_array_bgra */ + +/* ----------------------- GL_EXT_vertex_attrib_64bit ---------------------- */ + +#ifndef GL_EXT_vertex_attrib_64bit +#define GL_EXT_vertex_attrib_64bit 1 + +#define GL_DOUBLE_MAT2_EXT 0x8F46 +#define GL_DOUBLE_MAT3_EXT 0x8F47 +#define GL_DOUBLE_MAT4_EXT 0x8F48 +#define GL_DOUBLE_MAT2x3_EXT 0x8F49 +#define GL_DOUBLE_MAT2x4_EXT 0x8F4A +#define GL_DOUBLE_MAT3x2_EXT 0x8F4B +#define GL_DOUBLE_MAT3x4_EXT 0x8F4C +#define GL_DOUBLE_MAT4x2_EXT 0x8F4D +#define GL_DOUBLE_MAT4x3_EXT 0x8F4E +#define GL_DOUBLE_VEC2_EXT 0x8FFC +#define GL_DOUBLE_VEC3_EXT 0x8FFD +#define GL_DOUBLE_VEC4_EXT 0x8FFE + +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBLDVEXTPROC) (GLuint index, GLenum pname, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYVERTEXATTRIBLOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLsizei stride, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1DEXTPROC) (GLuint index, GLdouble x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1DVEXTPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL2DEXTPROC) (GLuint index, GLdouble x, GLdouble y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL2DVEXTPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL3DEXTPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL3DVEXTPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL4DEXTPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL4DVEXTPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBLPOINTEREXTPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); + +#define glGetVertexAttribLdvEXT GLEW_GET_FUN(__glewGetVertexAttribLdvEXT) +#define glVertexArrayVertexAttribLOffsetEXT GLEW_GET_FUN(__glewVertexArrayVertexAttribLOffsetEXT) +#define glVertexAttribL1dEXT GLEW_GET_FUN(__glewVertexAttribL1dEXT) +#define glVertexAttribL1dvEXT GLEW_GET_FUN(__glewVertexAttribL1dvEXT) +#define glVertexAttribL2dEXT GLEW_GET_FUN(__glewVertexAttribL2dEXT) +#define glVertexAttribL2dvEXT GLEW_GET_FUN(__glewVertexAttribL2dvEXT) +#define glVertexAttribL3dEXT GLEW_GET_FUN(__glewVertexAttribL3dEXT) +#define glVertexAttribL3dvEXT GLEW_GET_FUN(__glewVertexAttribL3dvEXT) +#define glVertexAttribL4dEXT GLEW_GET_FUN(__glewVertexAttribL4dEXT) +#define glVertexAttribL4dvEXT GLEW_GET_FUN(__glewVertexAttribL4dvEXT) +#define glVertexAttribLPointerEXT GLEW_GET_FUN(__glewVertexAttribLPointerEXT) + +#define GLEW_EXT_vertex_attrib_64bit GLEW_GET_VAR(__GLEW_EXT_vertex_attrib_64bit) + +#endif /* GL_EXT_vertex_attrib_64bit */ + +/* -------------------------- GL_EXT_vertex_shader ------------------------- */ + +#ifndef GL_EXT_vertex_shader +#define GL_EXT_vertex_shader 1 + +#define GL_VERTEX_SHADER_EXT 0x8780 +#define GL_VERTEX_SHADER_BINDING_EXT 0x8781 +#define GL_OP_INDEX_EXT 0x8782 +#define GL_OP_NEGATE_EXT 0x8783 +#define GL_OP_DOT3_EXT 0x8784 +#define GL_OP_DOT4_EXT 0x8785 +#define GL_OP_MUL_EXT 0x8786 +#define GL_OP_ADD_EXT 0x8787 +#define GL_OP_MADD_EXT 0x8788 +#define GL_OP_FRAC_EXT 0x8789 +#define GL_OP_MAX_EXT 0x878A +#define GL_OP_MIN_EXT 0x878B +#define GL_OP_SET_GE_EXT 0x878C +#define GL_OP_SET_LT_EXT 0x878D +#define GL_OP_CLAMP_EXT 0x878E +#define GL_OP_FLOOR_EXT 0x878F +#define GL_OP_ROUND_EXT 0x8790 +#define GL_OP_EXP_BASE_2_EXT 0x8791 +#define GL_OP_LOG_BASE_2_EXT 0x8792 +#define GL_OP_POWER_EXT 0x8793 +#define GL_OP_RECIP_EXT 0x8794 +#define GL_OP_RECIP_SQRT_EXT 0x8795 +#define GL_OP_SUB_EXT 0x8796 +#define GL_OP_CROSS_PRODUCT_EXT 0x8797 +#define GL_OP_MULTIPLY_MATRIX_EXT 0x8798 +#define GL_OP_MOV_EXT 0x8799 +#define GL_OUTPUT_VERTEX_EXT 0x879A +#define GL_OUTPUT_COLOR0_EXT 0x879B +#define GL_OUTPUT_COLOR1_EXT 0x879C +#define GL_OUTPUT_TEXTURE_COORD0_EXT 0x879D +#define GL_OUTPUT_TEXTURE_COORD1_EXT 0x879E +#define GL_OUTPUT_TEXTURE_COORD2_EXT 0x879F +#define GL_OUTPUT_TEXTURE_COORD3_EXT 0x87A0 +#define GL_OUTPUT_TEXTURE_COORD4_EXT 0x87A1 +#define GL_OUTPUT_TEXTURE_COORD5_EXT 0x87A2 +#define GL_OUTPUT_TEXTURE_COORD6_EXT 0x87A3 +#define GL_OUTPUT_TEXTURE_COORD7_EXT 0x87A4 +#define GL_OUTPUT_TEXTURE_COORD8_EXT 0x87A5 +#define GL_OUTPUT_TEXTURE_COORD9_EXT 0x87A6 +#define GL_OUTPUT_TEXTURE_COORD10_EXT 0x87A7 +#define GL_OUTPUT_TEXTURE_COORD11_EXT 0x87A8 +#define GL_OUTPUT_TEXTURE_COORD12_EXT 0x87A9 +#define GL_OUTPUT_TEXTURE_COORD13_EXT 0x87AA +#define GL_OUTPUT_TEXTURE_COORD14_EXT 0x87AB +#define GL_OUTPUT_TEXTURE_COORD15_EXT 0x87AC +#define GL_OUTPUT_TEXTURE_COORD16_EXT 0x87AD +#define GL_OUTPUT_TEXTURE_COORD17_EXT 0x87AE +#define GL_OUTPUT_TEXTURE_COORD18_EXT 0x87AF +#define GL_OUTPUT_TEXTURE_COORD19_EXT 0x87B0 +#define GL_OUTPUT_TEXTURE_COORD20_EXT 0x87B1 +#define GL_OUTPUT_TEXTURE_COORD21_EXT 0x87B2 +#define GL_OUTPUT_TEXTURE_COORD22_EXT 0x87B3 +#define GL_OUTPUT_TEXTURE_COORD23_EXT 0x87B4 +#define GL_OUTPUT_TEXTURE_COORD24_EXT 0x87B5 +#define GL_OUTPUT_TEXTURE_COORD25_EXT 0x87B6 +#define GL_OUTPUT_TEXTURE_COORD26_EXT 0x87B7 +#define GL_OUTPUT_TEXTURE_COORD27_EXT 0x87B8 +#define GL_OUTPUT_TEXTURE_COORD28_EXT 0x87B9 +#define GL_OUTPUT_TEXTURE_COORD29_EXT 0x87BA +#define GL_OUTPUT_TEXTURE_COORD30_EXT 0x87BB +#define GL_OUTPUT_TEXTURE_COORD31_EXT 0x87BC +#define GL_OUTPUT_FOG_EXT 0x87BD +#define GL_SCALAR_EXT 0x87BE +#define GL_VECTOR_EXT 0x87BF +#define GL_MATRIX_EXT 0x87C0 +#define GL_VARIANT_EXT 0x87C1 +#define GL_INVARIANT_EXT 0x87C2 +#define GL_LOCAL_CONSTANT_EXT 0x87C3 +#define GL_LOCAL_EXT 0x87C4 +#define GL_MAX_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87C5 +#define GL_MAX_VERTEX_SHADER_VARIANTS_EXT 0x87C6 +#define GL_MAX_VERTEX_SHADER_INVARIANTS_EXT 0x87C7 +#define GL_MAX_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87C8 +#define GL_MAX_VERTEX_SHADER_LOCALS_EXT 0x87C9 +#define GL_MAX_OPTIMIZED_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87CA +#define GL_MAX_OPTIMIZED_VERTEX_SHADER_VARIANTS_EXT 0x87CB +#define GL_MAX_OPTIMIZED_VERTEX_SHADER_INVARIANTS_EXT 0x87CC +#define GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87CD +#define GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCALS_EXT 0x87CE +#define GL_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87CF +#define GL_VERTEX_SHADER_VARIANTS_EXT 0x87D0 +#define GL_VERTEX_SHADER_INVARIANTS_EXT 0x87D1 +#define GL_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87D2 +#define GL_VERTEX_SHADER_LOCALS_EXT 0x87D3 +#define GL_VERTEX_SHADER_OPTIMIZED_EXT 0x87D4 +#define GL_X_EXT 0x87D5 +#define GL_Y_EXT 0x87D6 +#define GL_Z_EXT 0x87D7 +#define GL_W_EXT 0x87D8 +#define GL_NEGATIVE_X_EXT 0x87D9 +#define GL_NEGATIVE_Y_EXT 0x87DA +#define GL_NEGATIVE_Z_EXT 0x87DB +#define GL_NEGATIVE_W_EXT 0x87DC +#define GL_ZERO_EXT 0x87DD +#define GL_ONE_EXT 0x87DE +#define GL_NEGATIVE_ONE_EXT 0x87DF +#define GL_NORMALIZED_RANGE_EXT 0x87E0 +#define GL_FULL_RANGE_EXT 0x87E1 +#define GL_CURRENT_VERTEX_EXT 0x87E2 +#define GL_MVP_MATRIX_EXT 0x87E3 +#define GL_VARIANT_VALUE_EXT 0x87E4 +#define GL_VARIANT_DATATYPE_EXT 0x87E5 +#define GL_VARIANT_ARRAY_STRIDE_EXT 0x87E6 +#define GL_VARIANT_ARRAY_TYPE_EXT 0x87E7 +#define GL_VARIANT_ARRAY_EXT 0x87E8 +#define GL_VARIANT_ARRAY_POINTER_EXT 0x87E9 +#define GL_INVARIANT_VALUE_EXT 0x87EA +#define GL_INVARIANT_DATATYPE_EXT 0x87EB +#define GL_LOCAL_CONSTANT_VALUE_EXT 0x87EC +#define GL_LOCAL_CONSTANT_DATATYPE_EXT 0x87ED + +typedef void (GLAPIENTRY * PFNGLBEGINVERTEXSHADEREXTPROC) (void); +typedef GLuint (GLAPIENTRY * PFNGLBINDLIGHTPARAMETEREXTPROC) (GLenum light, GLenum value); +typedef GLuint (GLAPIENTRY * PFNGLBINDMATERIALPARAMETEREXTPROC) (GLenum face, GLenum value); +typedef GLuint (GLAPIENTRY * PFNGLBINDPARAMETEREXTPROC) (GLenum value); +typedef GLuint (GLAPIENTRY * PFNGLBINDTEXGENPARAMETEREXTPROC) (GLenum unit, GLenum coord, GLenum value); +typedef GLuint (GLAPIENTRY * PFNGLBINDTEXTUREUNITPARAMETEREXTPROC) (GLenum unit, GLenum value); +typedef void (GLAPIENTRY * PFNGLBINDVERTEXSHADEREXTPROC) (GLuint id); +typedef void (GLAPIENTRY * PFNGLDELETEVERTEXSHADEREXTPROC) (GLuint id); +typedef void (GLAPIENTRY * PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC) (GLuint id); +typedef void (GLAPIENTRY * PFNGLENABLEVARIANTCLIENTSTATEEXTPROC) (GLuint id); +typedef void (GLAPIENTRY * PFNGLENDVERTEXSHADEREXTPROC) (void); +typedef void (GLAPIENTRY * PFNGLEXTRACTCOMPONENTEXTPROC) (GLuint res, GLuint src, GLuint num); +typedef GLuint (GLAPIENTRY * PFNGLGENSYMBOLSEXTPROC) (GLenum dataType, GLenum storageType, GLenum range, GLuint components); +typedef GLuint (GLAPIENTRY * PFNGLGENVERTEXSHADERSEXTPROC) (GLuint range); +typedef void (GLAPIENTRY * PFNGLGETINVARIANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data); +typedef void (GLAPIENTRY * PFNGLGETINVARIANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data); +typedef void (GLAPIENTRY * PFNGLGETINVARIANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data); +typedef void (GLAPIENTRY * PFNGLGETLOCALCONSTANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data); +typedef void (GLAPIENTRY * PFNGLGETLOCALCONSTANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data); +typedef void (GLAPIENTRY * PFNGLGETLOCALCONSTANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data); +typedef void (GLAPIENTRY * PFNGLGETVARIANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data); +typedef void (GLAPIENTRY * PFNGLGETVARIANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data); +typedef void (GLAPIENTRY * PFNGLGETVARIANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data); +typedef void (GLAPIENTRY * PFNGLGETVARIANTPOINTERVEXTPROC) (GLuint id, GLenum value, GLvoid **data); +typedef void (GLAPIENTRY * PFNGLINSERTCOMPONENTEXTPROC) (GLuint res, GLuint src, GLuint num); +typedef GLboolean (GLAPIENTRY * PFNGLISVARIANTENABLEDEXTPROC) (GLuint id, GLenum cap); +typedef void (GLAPIENTRY * PFNGLSETINVARIANTEXTPROC) (GLuint id, GLenum type, GLvoid *addr); +typedef void (GLAPIENTRY * PFNGLSETLOCALCONSTANTEXTPROC) (GLuint id, GLenum type, GLvoid *addr); +typedef void (GLAPIENTRY * PFNGLSHADEROP1EXTPROC) (GLenum op, GLuint res, GLuint arg1); +typedef void (GLAPIENTRY * PFNGLSHADEROP2EXTPROC) (GLenum op, GLuint res, GLuint arg1, GLuint arg2); +typedef void (GLAPIENTRY * PFNGLSHADEROP3EXTPROC) (GLenum op, GLuint res, GLuint arg1, GLuint arg2, GLuint arg3); +typedef void (GLAPIENTRY * PFNGLSWIZZLEEXTPROC) (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW); +typedef void (GLAPIENTRY * PFNGLVARIANTPOINTEREXTPROC) (GLuint id, GLenum type, GLuint stride, GLvoid *addr); +typedef void (GLAPIENTRY * PFNGLVARIANTBVEXTPROC) (GLuint id, GLbyte *addr); +typedef void (GLAPIENTRY * PFNGLVARIANTDVEXTPROC) (GLuint id, GLdouble *addr); +typedef void (GLAPIENTRY * PFNGLVARIANTFVEXTPROC) (GLuint id, GLfloat *addr); +typedef void (GLAPIENTRY * PFNGLVARIANTIVEXTPROC) (GLuint id, GLint *addr); +typedef void (GLAPIENTRY * PFNGLVARIANTSVEXTPROC) (GLuint id, GLshort *addr); +typedef void (GLAPIENTRY * PFNGLVARIANTUBVEXTPROC) (GLuint id, GLubyte *addr); +typedef void (GLAPIENTRY * PFNGLVARIANTUIVEXTPROC) (GLuint id, GLuint *addr); +typedef void (GLAPIENTRY * PFNGLVARIANTUSVEXTPROC) (GLuint id, GLushort *addr); +typedef void (GLAPIENTRY * PFNGLWRITEMASKEXTPROC) (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW); + +#define glBeginVertexShaderEXT GLEW_GET_FUN(__glewBeginVertexShaderEXT) +#define glBindLightParameterEXT GLEW_GET_FUN(__glewBindLightParameterEXT) +#define glBindMaterialParameterEXT GLEW_GET_FUN(__glewBindMaterialParameterEXT) +#define glBindParameterEXT GLEW_GET_FUN(__glewBindParameterEXT) +#define glBindTexGenParameterEXT GLEW_GET_FUN(__glewBindTexGenParameterEXT) +#define glBindTextureUnitParameterEXT GLEW_GET_FUN(__glewBindTextureUnitParameterEXT) +#define glBindVertexShaderEXT GLEW_GET_FUN(__glewBindVertexShaderEXT) +#define glDeleteVertexShaderEXT GLEW_GET_FUN(__glewDeleteVertexShaderEXT) +#define glDisableVariantClientStateEXT GLEW_GET_FUN(__glewDisableVariantClientStateEXT) +#define glEnableVariantClientStateEXT GLEW_GET_FUN(__glewEnableVariantClientStateEXT) +#define glEndVertexShaderEXT GLEW_GET_FUN(__glewEndVertexShaderEXT) +#define glExtractComponentEXT GLEW_GET_FUN(__glewExtractComponentEXT) +#define glGenSymbolsEXT GLEW_GET_FUN(__glewGenSymbolsEXT) +#define glGenVertexShadersEXT GLEW_GET_FUN(__glewGenVertexShadersEXT) +#define glGetInvariantBooleanvEXT GLEW_GET_FUN(__glewGetInvariantBooleanvEXT) +#define glGetInvariantFloatvEXT GLEW_GET_FUN(__glewGetInvariantFloatvEXT) +#define glGetInvariantIntegervEXT GLEW_GET_FUN(__glewGetInvariantIntegervEXT) +#define glGetLocalConstantBooleanvEXT GLEW_GET_FUN(__glewGetLocalConstantBooleanvEXT) +#define glGetLocalConstantFloatvEXT GLEW_GET_FUN(__glewGetLocalConstantFloatvEXT) +#define glGetLocalConstantIntegervEXT GLEW_GET_FUN(__glewGetLocalConstantIntegervEXT) +#define glGetVariantBooleanvEXT GLEW_GET_FUN(__glewGetVariantBooleanvEXT) +#define glGetVariantFloatvEXT GLEW_GET_FUN(__glewGetVariantFloatvEXT) +#define glGetVariantIntegervEXT GLEW_GET_FUN(__glewGetVariantIntegervEXT) +#define glGetVariantPointervEXT GLEW_GET_FUN(__glewGetVariantPointervEXT) +#define glInsertComponentEXT GLEW_GET_FUN(__glewInsertComponentEXT) +#define glIsVariantEnabledEXT GLEW_GET_FUN(__glewIsVariantEnabledEXT) +#define glSetInvariantEXT GLEW_GET_FUN(__glewSetInvariantEXT) +#define glSetLocalConstantEXT GLEW_GET_FUN(__glewSetLocalConstantEXT) +#define glShaderOp1EXT GLEW_GET_FUN(__glewShaderOp1EXT) +#define glShaderOp2EXT GLEW_GET_FUN(__glewShaderOp2EXT) +#define glShaderOp3EXT GLEW_GET_FUN(__glewShaderOp3EXT) +#define glSwizzleEXT GLEW_GET_FUN(__glewSwizzleEXT) +#define glVariantPointerEXT GLEW_GET_FUN(__glewVariantPointerEXT) +#define glVariantbvEXT GLEW_GET_FUN(__glewVariantbvEXT) +#define glVariantdvEXT GLEW_GET_FUN(__glewVariantdvEXT) +#define glVariantfvEXT GLEW_GET_FUN(__glewVariantfvEXT) +#define glVariantivEXT GLEW_GET_FUN(__glewVariantivEXT) +#define glVariantsvEXT GLEW_GET_FUN(__glewVariantsvEXT) +#define glVariantubvEXT GLEW_GET_FUN(__glewVariantubvEXT) +#define glVariantuivEXT GLEW_GET_FUN(__glewVariantuivEXT) +#define glVariantusvEXT GLEW_GET_FUN(__glewVariantusvEXT) +#define glWriteMaskEXT GLEW_GET_FUN(__glewWriteMaskEXT) + +#define GLEW_EXT_vertex_shader GLEW_GET_VAR(__GLEW_EXT_vertex_shader) + +#endif /* GL_EXT_vertex_shader */ + +/* ------------------------ GL_EXT_vertex_weighting ------------------------ */ + +#ifndef GL_EXT_vertex_weighting +#define GL_EXT_vertex_weighting 1 + +#define GL_MODELVIEW0_STACK_DEPTH_EXT 0x0BA3 +#define GL_MODELVIEW0_MATRIX_EXT 0x0BA6 +#define GL_MODELVIEW0_EXT 0x1700 +#define GL_MODELVIEW1_STACK_DEPTH_EXT 0x8502 +#define GL_MODELVIEW1_MATRIX_EXT 0x8506 +#define GL_VERTEX_WEIGHTING_EXT 0x8509 +#define GL_MODELVIEW1_EXT 0x850A +#define GL_CURRENT_VERTEX_WEIGHT_EXT 0x850B +#define GL_VERTEX_WEIGHT_ARRAY_EXT 0x850C +#define GL_VERTEX_WEIGHT_ARRAY_SIZE_EXT 0x850D +#define GL_VERTEX_WEIGHT_ARRAY_TYPE_EXT 0x850E +#define GL_VERTEX_WEIGHT_ARRAY_STRIDE_EXT 0x850F +#define GL_VERTEX_WEIGHT_ARRAY_POINTER_EXT 0x8510 + +typedef void (GLAPIENTRY * PFNGLVERTEXWEIGHTPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLvoid *pointer); +typedef void (GLAPIENTRY * PFNGLVERTEXWEIGHTFEXTPROC) (GLfloat weight); +typedef void (GLAPIENTRY * PFNGLVERTEXWEIGHTFVEXTPROC) (GLfloat* weight); + +#define glVertexWeightPointerEXT GLEW_GET_FUN(__glewVertexWeightPointerEXT) +#define glVertexWeightfEXT GLEW_GET_FUN(__glewVertexWeightfEXT) +#define glVertexWeightfvEXT GLEW_GET_FUN(__glewVertexWeightfvEXT) + +#define GLEW_EXT_vertex_weighting GLEW_GET_VAR(__GLEW_EXT_vertex_weighting) + +#endif /* GL_EXT_vertex_weighting */ + +/* ------------------------- GL_EXT_x11_sync_object ------------------------ */ + +#ifndef GL_EXT_x11_sync_object +#define GL_EXT_x11_sync_object 1 + +#define GL_SYNC_X11_FENCE_EXT 0x90E1 + +typedef GLsync (GLAPIENTRY * PFNGLIMPORTSYNCEXTPROC) (GLenum external_sync_type, GLintptr external_sync, GLbitfield flags); + +#define glImportSyncEXT GLEW_GET_FUN(__glewImportSyncEXT) + +#define GLEW_EXT_x11_sync_object GLEW_GET_VAR(__GLEW_EXT_x11_sync_object) + +#endif /* GL_EXT_x11_sync_object */ + +/* ---------------------- GL_GREMEDY_frame_terminator ---------------------- */ + +#ifndef GL_GREMEDY_frame_terminator +#define GL_GREMEDY_frame_terminator 1 + +typedef void (GLAPIENTRY * PFNGLFRAMETERMINATORGREMEDYPROC) (void); + +#define glFrameTerminatorGREMEDY GLEW_GET_FUN(__glewFrameTerminatorGREMEDY) + +#define GLEW_GREMEDY_frame_terminator GLEW_GET_VAR(__GLEW_GREMEDY_frame_terminator) + +#endif /* GL_GREMEDY_frame_terminator */ + +/* ------------------------ GL_GREMEDY_string_marker ----------------------- */ + +#ifndef GL_GREMEDY_string_marker +#define GL_GREMEDY_string_marker 1 + +typedef void (GLAPIENTRY * PFNGLSTRINGMARKERGREMEDYPROC) (GLsizei len, const GLvoid *string); + +#define glStringMarkerGREMEDY GLEW_GET_FUN(__glewStringMarkerGREMEDY) + +#define GLEW_GREMEDY_string_marker GLEW_GET_VAR(__GLEW_GREMEDY_string_marker) + +#endif /* GL_GREMEDY_string_marker */ + +/* --------------------- GL_HP_convolution_border_modes -------------------- */ + +#ifndef GL_HP_convolution_border_modes +#define GL_HP_convolution_border_modes 1 + +#define GLEW_HP_convolution_border_modes GLEW_GET_VAR(__GLEW_HP_convolution_border_modes) + +#endif /* GL_HP_convolution_border_modes */ + +/* ------------------------- GL_HP_image_transform ------------------------- */ + +#ifndef GL_HP_image_transform +#define GL_HP_image_transform 1 + +typedef void (GLAPIENTRY * PFNGLGETIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETIMAGETRANSFORMPARAMETERIVHPPROC) (GLenum target, GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLIMAGETRANSFORMPARAMETERFHPPROC) (GLenum target, GLenum pname, const GLfloat param); +typedef void (GLAPIENTRY * PFNGLIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLIMAGETRANSFORMPARAMETERIHPPROC) (GLenum target, GLenum pname, const GLint param); +typedef void (GLAPIENTRY * PFNGLIMAGETRANSFORMPARAMETERIVHPPROC) (GLenum target, GLenum pname, const GLint* params); + +#define glGetImageTransformParameterfvHP GLEW_GET_FUN(__glewGetImageTransformParameterfvHP) +#define glGetImageTransformParameterivHP GLEW_GET_FUN(__glewGetImageTransformParameterivHP) +#define glImageTransformParameterfHP GLEW_GET_FUN(__glewImageTransformParameterfHP) +#define glImageTransformParameterfvHP GLEW_GET_FUN(__glewImageTransformParameterfvHP) +#define glImageTransformParameteriHP GLEW_GET_FUN(__glewImageTransformParameteriHP) +#define glImageTransformParameterivHP GLEW_GET_FUN(__glewImageTransformParameterivHP) + +#define GLEW_HP_image_transform GLEW_GET_VAR(__GLEW_HP_image_transform) + +#endif /* GL_HP_image_transform */ + +/* -------------------------- GL_HP_occlusion_test ------------------------- */ + +#ifndef GL_HP_occlusion_test +#define GL_HP_occlusion_test 1 + +#define GLEW_HP_occlusion_test GLEW_GET_VAR(__GLEW_HP_occlusion_test) + +#endif /* GL_HP_occlusion_test */ + +/* ------------------------- GL_HP_texture_lighting ------------------------ */ + +#ifndef GL_HP_texture_lighting +#define GL_HP_texture_lighting 1 + +#define GLEW_HP_texture_lighting GLEW_GET_VAR(__GLEW_HP_texture_lighting) + +#endif /* GL_HP_texture_lighting */ + +/* --------------------------- GL_IBM_cull_vertex -------------------------- */ + +#ifndef GL_IBM_cull_vertex +#define GL_IBM_cull_vertex 1 + +#define GL_CULL_VERTEX_IBM 103050 + +#define GLEW_IBM_cull_vertex GLEW_GET_VAR(__GLEW_IBM_cull_vertex) + +#endif /* GL_IBM_cull_vertex */ + +/* ---------------------- GL_IBM_multimode_draw_arrays --------------------- */ + +#ifndef GL_IBM_multimode_draw_arrays +#define GL_IBM_multimode_draw_arrays 1 + +typedef void (GLAPIENTRY * PFNGLMULTIMODEDRAWARRAYSIBMPROC) (const GLenum* mode, const GLint *first, const GLsizei *count, GLsizei primcount, GLint modestride); +typedef void (GLAPIENTRY * PFNGLMULTIMODEDRAWELEMENTSIBMPROC) (const GLenum* mode, const GLsizei *count, GLenum type, const GLvoid * const *indices, GLsizei primcount, GLint modestride); + +#define glMultiModeDrawArraysIBM GLEW_GET_FUN(__glewMultiModeDrawArraysIBM) +#define glMultiModeDrawElementsIBM GLEW_GET_FUN(__glewMultiModeDrawElementsIBM) + +#define GLEW_IBM_multimode_draw_arrays GLEW_GET_VAR(__GLEW_IBM_multimode_draw_arrays) + +#endif /* GL_IBM_multimode_draw_arrays */ + +/* ------------------------- GL_IBM_rasterpos_clip ------------------------- */ + +#ifndef GL_IBM_rasterpos_clip +#define GL_IBM_rasterpos_clip 1 + +#define GL_RASTER_POSITION_UNCLIPPED_IBM 103010 + +#define GLEW_IBM_rasterpos_clip GLEW_GET_VAR(__GLEW_IBM_rasterpos_clip) + +#endif /* GL_IBM_rasterpos_clip */ + +/* --------------------------- GL_IBM_static_data -------------------------- */ + +#ifndef GL_IBM_static_data +#define GL_IBM_static_data 1 + +#define GL_ALL_STATIC_DATA_IBM 103060 +#define GL_STATIC_VERTEX_ARRAY_IBM 103061 + +#define GLEW_IBM_static_data GLEW_GET_VAR(__GLEW_IBM_static_data) + +#endif /* GL_IBM_static_data */ + +/* --------------------- GL_IBM_texture_mirrored_repeat -------------------- */ + +#ifndef GL_IBM_texture_mirrored_repeat +#define GL_IBM_texture_mirrored_repeat 1 + +#define GL_MIRRORED_REPEAT_IBM 0x8370 + +#define GLEW_IBM_texture_mirrored_repeat GLEW_GET_VAR(__GLEW_IBM_texture_mirrored_repeat) + +#endif /* GL_IBM_texture_mirrored_repeat */ + +/* ----------------------- GL_IBM_vertex_array_lists ----------------------- */ + +#ifndef GL_IBM_vertex_array_lists +#define GL_IBM_vertex_array_lists 1 + +#define GL_VERTEX_ARRAY_LIST_IBM 103070 +#define GL_NORMAL_ARRAY_LIST_IBM 103071 +#define GL_COLOR_ARRAY_LIST_IBM 103072 +#define GL_INDEX_ARRAY_LIST_IBM 103073 +#define GL_TEXTURE_COORD_ARRAY_LIST_IBM 103074 +#define GL_EDGE_FLAG_ARRAY_LIST_IBM 103075 +#define GL_FOG_COORDINATE_ARRAY_LIST_IBM 103076 +#define GL_SECONDARY_COLOR_ARRAY_LIST_IBM 103077 +#define GL_VERTEX_ARRAY_LIST_STRIDE_IBM 103080 +#define GL_NORMAL_ARRAY_LIST_STRIDE_IBM 103081 +#define GL_COLOR_ARRAY_LIST_STRIDE_IBM 103082 +#define GL_INDEX_ARRAY_LIST_STRIDE_IBM 103083 +#define GL_TEXTURE_COORD_ARRAY_LIST_STRIDE_IBM 103084 +#define GL_EDGE_FLAG_ARRAY_LIST_STRIDE_IBM 103085 +#define GL_FOG_COORDINATE_ARRAY_LIST_STRIDE_IBM 103086 +#define GL_SECONDARY_COLOR_ARRAY_LIST_STRIDE_IBM 103087 + +typedef void (GLAPIENTRY * PFNGLCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid ** pointer, GLint ptrstride); +typedef void (GLAPIENTRY * PFNGLEDGEFLAGPOINTERLISTIBMPROC) (GLint stride, const GLboolean ** pointer, GLint ptrstride); +typedef void (GLAPIENTRY * PFNGLFOGCOORDPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid ** pointer, GLint ptrstride); +typedef void (GLAPIENTRY * PFNGLINDEXPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid ** pointer, GLint ptrstride); +typedef void (GLAPIENTRY * PFNGLNORMALPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid ** pointer, GLint ptrstride); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid ** pointer, GLint ptrstride); +typedef void (GLAPIENTRY * PFNGLTEXCOORDPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid ** pointer, GLint ptrstride); +typedef void (GLAPIENTRY * PFNGLVERTEXPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid ** pointer, GLint ptrstride); + +#define glColorPointerListIBM GLEW_GET_FUN(__glewColorPointerListIBM) +#define glEdgeFlagPointerListIBM GLEW_GET_FUN(__glewEdgeFlagPointerListIBM) +#define glFogCoordPointerListIBM GLEW_GET_FUN(__glewFogCoordPointerListIBM) +#define glIndexPointerListIBM GLEW_GET_FUN(__glewIndexPointerListIBM) +#define glNormalPointerListIBM GLEW_GET_FUN(__glewNormalPointerListIBM) +#define glSecondaryColorPointerListIBM GLEW_GET_FUN(__glewSecondaryColorPointerListIBM) +#define glTexCoordPointerListIBM GLEW_GET_FUN(__glewTexCoordPointerListIBM) +#define glVertexPointerListIBM GLEW_GET_FUN(__glewVertexPointerListIBM) + +#define GLEW_IBM_vertex_array_lists GLEW_GET_VAR(__GLEW_IBM_vertex_array_lists) + +#endif /* GL_IBM_vertex_array_lists */ + +/* -------------------------- GL_INGR_color_clamp -------------------------- */ + +#ifndef GL_INGR_color_clamp +#define GL_INGR_color_clamp 1 + +#define GL_RED_MIN_CLAMP_INGR 0x8560 +#define GL_GREEN_MIN_CLAMP_INGR 0x8561 +#define GL_BLUE_MIN_CLAMP_INGR 0x8562 +#define GL_ALPHA_MIN_CLAMP_INGR 0x8563 +#define GL_RED_MAX_CLAMP_INGR 0x8564 +#define GL_GREEN_MAX_CLAMP_INGR 0x8565 +#define GL_BLUE_MAX_CLAMP_INGR 0x8566 +#define GL_ALPHA_MAX_CLAMP_INGR 0x8567 + +#define GLEW_INGR_color_clamp GLEW_GET_VAR(__GLEW_INGR_color_clamp) + +#endif /* GL_INGR_color_clamp */ + +/* ------------------------- GL_INGR_interlace_read ------------------------ */ + +#ifndef GL_INGR_interlace_read +#define GL_INGR_interlace_read 1 + +#define GL_INTERLACE_READ_INGR 0x8568 + +#define GLEW_INGR_interlace_read GLEW_GET_VAR(__GLEW_INGR_interlace_read) + +#endif /* GL_INGR_interlace_read */ + +/* -------------------------- GL_INTEL_map_texture ------------------------- */ + +#ifndef GL_INTEL_map_texture +#define GL_INTEL_map_texture 1 + +#define GL_LAYOUT_DEFAULT_INTEL 0 +#define GL_LAYOUT_LINEAR_INTEL 1 +#define GL_LAYOUT_LINEAR_CPU_CACHED_INTEL 2 +#define GL_TEXTURE_MEMORY_LAYOUT_INTEL 0x83FF + +typedef GLvoid * (GLAPIENTRY * PFNGLMAPTEXTURE2DINTELPROC) (GLuint texture, GLint level, GLbitfield access, GLint* stride, GLenum *layout); +typedef void (GLAPIENTRY * PFNGLSYNCTEXTUREINTELPROC) (GLuint texture); +typedef void (GLAPIENTRY * PFNGLUNMAPTEXTURE2DINTELPROC) (GLuint texture, GLint level); + +#define glMapTexture2DINTEL GLEW_GET_FUN(__glewMapTexture2DINTEL) +#define glSyncTextureINTEL GLEW_GET_FUN(__glewSyncTextureINTEL) +#define glUnmapTexture2DINTEL GLEW_GET_FUN(__glewUnmapTexture2DINTEL) + +#define GLEW_INTEL_map_texture GLEW_GET_VAR(__GLEW_INTEL_map_texture) + +#endif /* GL_INTEL_map_texture */ + +/* ------------------------ GL_INTEL_parallel_arrays ----------------------- */ + +#ifndef GL_INTEL_parallel_arrays +#define GL_INTEL_parallel_arrays 1 + +#define GL_PARALLEL_ARRAYS_INTEL 0x83F4 +#define GL_VERTEX_ARRAY_PARALLEL_POINTERS_INTEL 0x83F5 +#define GL_NORMAL_ARRAY_PARALLEL_POINTERS_INTEL 0x83F6 +#define GL_COLOR_ARRAY_PARALLEL_POINTERS_INTEL 0x83F7 +#define GL_TEXTURE_COORD_ARRAY_PARALLEL_POINTERS_INTEL 0x83F8 + +typedef void (GLAPIENTRY * PFNGLCOLORPOINTERVINTELPROC) (GLint size, GLenum type, const void** pointer); +typedef void (GLAPIENTRY * PFNGLNORMALPOINTERVINTELPROC) (GLenum type, const void** pointer); +typedef void (GLAPIENTRY * PFNGLTEXCOORDPOINTERVINTELPROC) (GLint size, GLenum type, const void** pointer); +typedef void (GLAPIENTRY * PFNGLVERTEXPOINTERVINTELPROC) (GLint size, GLenum type, const void** pointer); + +#define glColorPointervINTEL GLEW_GET_FUN(__glewColorPointervINTEL) +#define glNormalPointervINTEL GLEW_GET_FUN(__glewNormalPointervINTEL) +#define glTexCoordPointervINTEL GLEW_GET_FUN(__glewTexCoordPointervINTEL) +#define glVertexPointervINTEL GLEW_GET_FUN(__glewVertexPointervINTEL) + +#define GLEW_INTEL_parallel_arrays GLEW_GET_VAR(__GLEW_INTEL_parallel_arrays) + +#endif /* GL_INTEL_parallel_arrays */ + +/* ------------------------ GL_INTEL_texture_scissor ----------------------- */ + +#ifndef GL_INTEL_texture_scissor +#define GL_INTEL_texture_scissor 1 + +typedef void (GLAPIENTRY * PFNGLTEXSCISSORFUNCINTELPROC) (GLenum target, GLenum lfunc, GLenum hfunc); +typedef void (GLAPIENTRY * PFNGLTEXSCISSORINTELPROC) (GLenum target, GLclampf tlow, GLclampf thigh); + +#define glTexScissorFuncINTEL GLEW_GET_FUN(__glewTexScissorFuncINTEL) +#define glTexScissorINTEL GLEW_GET_FUN(__glewTexScissorINTEL) + +#define GLEW_INTEL_texture_scissor GLEW_GET_VAR(__GLEW_INTEL_texture_scissor) + +#endif /* GL_INTEL_texture_scissor */ + +/* ------------------------------ GL_KHR_debug ----------------------------- */ + +#ifndef GL_KHR_debug +#define GL_KHR_debug 1 + +#define GL_CONTEXT_FLAG_DEBUG_BIT 0x00000002 +#define GL_STACK_OVERFLOW 0x0503 +#define GL_STACK_UNDERFLOW 0x0504 +#define GL_DEBUG_OUTPUT_SYNCHRONOUS 0x8242 +#define GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH 0x8243 +#define GL_DEBUG_CALLBACK_FUNCTION 0x8244 +#define GL_DEBUG_CALLBACK_USER_PARAM 0x8245 +#define GL_DEBUG_SOURCE_API 0x8246 +#define GL_DEBUG_SOURCE_WINDOW_SYSTEM 0x8247 +#define GL_DEBUG_SOURCE_SHADER_COMPILER 0x8248 +#define GL_DEBUG_SOURCE_THIRD_PARTY 0x8249 +#define GL_DEBUG_SOURCE_APPLICATION 0x824A +#define GL_DEBUG_SOURCE_OTHER 0x824B +#define GL_DEBUG_TYPE_ERROR 0x824C +#define GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR 0x824D +#define GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR 0x824E +#define GL_DEBUG_TYPE_PORTABILITY 0x824F +#define GL_DEBUG_TYPE_PERFORMANCE 0x8250 +#define GL_DEBUG_TYPE_OTHER 0x8251 +#define GL_DEBUG_TYPE_MARKER 0x8268 +#define GL_DEBUG_TYPE_PUSH_GROUP 0x8269 +#define GL_DEBUG_TYPE_POP_GROUP 0x826A +#define GL_DEBUG_SEVERITY_NOTIFICATION 0x826B +#define GL_MAX_DEBUG_GROUP_STACK_DEPTH 0x826C +#define GL_DEBUG_GROUP_STACK_DEPTH 0x826D +#define GL_BUFFER 0x82E0 +#define GL_SHADER 0x82E1 +#define GL_PROGRAM 0x82E2 +#define GL_QUERY 0x82E3 +#define GL_PROGRAM_PIPELINE 0x82E4 +#define GL_SAMPLER 0x82E6 +#define GL_DISPLAY_LIST 0x82E7 +#define GL_MAX_LABEL_LENGTH 0x82E8 +#define GL_MAX_DEBUG_MESSAGE_LENGTH 0x9143 +#define GL_MAX_DEBUG_LOGGED_MESSAGES 0x9144 +#define GL_DEBUG_LOGGED_MESSAGES 0x9145 +#define GL_DEBUG_SEVERITY_HIGH 0x9146 +#define GL_DEBUG_SEVERITY_MEDIUM 0x9147 +#define GL_DEBUG_SEVERITY_LOW 0x9148 +#define GL_DEBUG_OUTPUT 0x92E0 + +typedef void (APIENTRY *GLDEBUGPROC)(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar* message, GLvoid* userParam); + +typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGECALLBACKPROC) (GLDEBUGPROC callback, const GLvoid *userParam); +typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGECONTROLPROC) (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint* ids, GLboolean enabled); +typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGEINSERTPROC) (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar* buf); +typedef GLuint (GLAPIENTRY * PFNGLGETDEBUGMESSAGELOGPROC) (GLuint count, GLsizei bufsize, GLenum* sources, GLenum* types, GLuint* ids, GLenum* severities, GLsizei* lengths, GLchar* messageLog); +typedef void (GLAPIENTRY * PFNGLGETOBJECTLABELPROC) (GLenum identifier, GLuint name, GLsizei bufSize, GLsizei* length, GLchar *label); +typedef void (GLAPIENTRY * PFNGLGETOBJECTPTRLABELPROC) (void* ptr, GLsizei bufSize, GLsizei* length, GLchar *label); +typedef void (GLAPIENTRY * PFNGLOBJECTLABELPROC) (GLenum identifier, GLuint name, GLsizei length, const GLchar* label); +typedef void (GLAPIENTRY * PFNGLOBJECTPTRLABELPROC) (void* ptr, GLsizei length, const GLchar* label); +typedef void (GLAPIENTRY * PFNGLPOPDEBUGGROUPPROC) (void); +typedef void (GLAPIENTRY * PFNGLPUSHDEBUGGROUPPROC) (GLenum source, GLuint id, GLsizei length, const GLchar * message); + +#define glDebugMessageCallback GLEW_GET_FUN(__glewDebugMessageCallback) +#define glDebugMessageControl GLEW_GET_FUN(__glewDebugMessageControl) +#define glDebugMessageInsert GLEW_GET_FUN(__glewDebugMessageInsert) +#define glGetDebugMessageLog GLEW_GET_FUN(__glewGetDebugMessageLog) +#define glGetObjectLabel GLEW_GET_FUN(__glewGetObjectLabel) +#define glGetObjectPtrLabel GLEW_GET_FUN(__glewGetObjectPtrLabel) +#define glObjectLabel GLEW_GET_FUN(__glewObjectLabel) +#define glObjectPtrLabel GLEW_GET_FUN(__glewObjectPtrLabel) +#define glPopDebugGroup GLEW_GET_FUN(__glewPopDebugGroup) +#define glPushDebugGroup GLEW_GET_FUN(__glewPushDebugGroup) + +#define GLEW_KHR_debug GLEW_GET_VAR(__GLEW_KHR_debug) + +#endif /* GL_KHR_debug */ + +/* ------------------ GL_KHR_texture_compression_astc_ldr ------------------ */ + +#ifndef GL_KHR_texture_compression_astc_ldr +#define GL_KHR_texture_compression_astc_ldr 1 + +#define GL_COMPRESSED_RGBA_ASTC_4x4_KHR 0x93B0 +#define GL_COMPRESSED_RGBA_ASTC_5x4_KHR 0x93B1 +#define GL_COMPRESSED_RGBA_ASTC_5x5_KHR 0x93B2 +#define GL_COMPRESSED_RGBA_ASTC_6x5_KHR 0x93B3 +#define GL_COMPRESSED_RGBA_ASTC_6x6_KHR 0x93B4 +#define GL_COMPRESSED_RGBA_ASTC_8x5_KHR 0x93B5 +#define GL_COMPRESSED_RGBA_ASTC_8x6_KHR 0x93B6 +#define GL_COMPRESSED_RGBA_ASTC_8x8_KHR 0x93B7 +#define GL_COMPRESSED_RGBA_ASTC_10x5_KHR 0x93B8 +#define GL_COMPRESSED_RGBA_ASTC_10x6_KHR 0x93B9 +#define GL_COMPRESSED_RGBA_ASTC_10x8_KHR 0x93BA +#define GL_COMPRESSED_RGBA_ASTC_10x10_KHR 0x93BB +#define GL_COMPRESSED_RGBA_ASTC_12x10_KHR 0x93BC +#define GL_COMPRESSED_RGBA_ASTC_12x12_KHR 0x93BD +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR 0x93D0 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR 0x93D1 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR 0x93D2 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR 0x93D3 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR 0x93D4 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR 0x93D5 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR 0x93D6 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR 0x93D7 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR 0x93D8 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR 0x93D9 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR 0x93DA +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR 0x93DB +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR 0x93DC +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR 0x93DD + +#define GLEW_KHR_texture_compression_astc_ldr GLEW_GET_VAR(__GLEW_KHR_texture_compression_astc_ldr) + +#endif /* GL_KHR_texture_compression_astc_ldr */ + +/* -------------------------- GL_KTX_buffer_region ------------------------- */ + +#ifndef GL_KTX_buffer_region +#define GL_KTX_buffer_region 1 + +#define GL_KTX_FRONT_REGION 0x0 +#define GL_KTX_BACK_REGION 0x1 +#define GL_KTX_Z_REGION 0x2 +#define GL_KTX_STENCIL_REGION 0x3 + +typedef GLuint (GLAPIENTRY * PFNGLBUFFERREGIONENABLEDPROC) (void); +typedef void (GLAPIENTRY * PFNGLDELETEBUFFERREGIONPROC) (GLenum region); +typedef void (GLAPIENTRY * PFNGLDRAWBUFFERREGIONPROC) (GLuint region, GLint x, GLint y, GLsizei width, GLsizei height, GLint xDest, GLint yDest); +typedef GLuint (GLAPIENTRY * PFNGLNEWBUFFERREGIONPROC) (GLenum region); +typedef void (GLAPIENTRY * PFNGLREADBUFFERREGIONPROC) (GLuint region, GLint x, GLint y, GLsizei width, GLsizei height); + +#define glBufferRegionEnabled GLEW_GET_FUN(__glewBufferRegionEnabled) +#define glDeleteBufferRegion GLEW_GET_FUN(__glewDeleteBufferRegion) +#define glDrawBufferRegion GLEW_GET_FUN(__glewDrawBufferRegion) +#define glNewBufferRegion GLEW_GET_FUN(__glewNewBufferRegion) +#define glReadBufferRegion GLEW_GET_FUN(__glewReadBufferRegion) + +#define GLEW_KTX_buffer_region GLEW_GET_VAR(__GLEW_KTX_buffer_region) + +#endif /* GL_KTX_buffer_region */ + +/* ------------------------- GL_MESAX_texture_stack ------------------------ */ + +#ifndef GL_MESAX_texture_stack +#define GL_MESAX_texture_stack 1 + +#define GL_TEXTURE_1D_STACK_MESAX 0x8759 +#define GL_TEXTURE_2D_STACK_MESAX 0x875A +#define GL_PROXY_TEXTURE_1D_STACK_MESAX 0x875B +#define GL_PROXY_TEXTURE_2D_STACK_MESAX 0x875C +#define GL_TEXTURE_1D_STACK_BINDING_MESAX 0x875D +#define GL_TEXTURE_2D_STACK_BINDING_MESAX 0x875E + +#define GLEW_MESAX_texture_stack GLEW_GET_VAR(__GLEW_MESAX_texture_stack) + +#endif /* GL_MESAX_texture_stack */ + +/* -------------------------- GL_MESA_pack_invert -------------------------- */ + +#ifndef GL_MESA_pack_invert +#define GL_MESA_pack_invert 1 + +#define GL_PACK_INVERT_MESA 0x8758 + +#define GLEW_MESA_pack_invert GLEW_GET_VAR(__GLEW_MESA_pack_invert) + +#endif /* GL_MESA_pack_invert */ + +/* ------------------------- GL_MESA_resize_buffers ------------------------ */ + +#ifndef GL_MESA_resize_buffers +#define GL_MESA_resize_buffers 1 + +typedef void (GLAPIENTRY * PFNGLRESIZEBUFFERSMESAPROC) (void); + +#define glResizeBuffersMESA GLEW_GET_FUN(__glewResizeBuffersMESA) + +#define GLEW_MESA_resize_buffers GLEW_GET_VAR(__GLEW_MESA_resize_buffers) + +#endif /* GL_MESA_resize_buffers */ + +/* --------------------------- GL_MESA_window_pos -------------------------- */ + +#ifndef GL_MESA_window_pos +#define GL_MESA_window_pos 1 + +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2DMESAPROC) (GLdouble x, GLdouble y); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2DVMESAPROC) (const GLdouble* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2FMESAPROC) (GLfloat x, GLfloat y); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2FVMESAPROC) (const GLfloat* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2IMESAPROC) (GLint x, GLint y); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2IVMESAPROC) (const GLint* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2SMESAPROC) (GLshort x, GLshort y); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2SVMESAPROC) (const GLshort* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3DMESAPROC) (GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3DVMESAPROC) (const GLdouble* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3FMESAPROC) (GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3FVMESAPROC) (const GLfloat* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3IMESAPROC) (GLint x, GLint y, GLint z); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3IVMESAPROC) (const GLint* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3SMESAPROC) (GLshort x, GLshort y, GLshort z); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3SVMESAPROC) (const GLshort* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS4DMESAPROC) (GLdouble x, GLdouble y, GLdouble z, GLdouble); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS4DVMESAPROC) (const GLdouble* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS4FMESAPROC) (GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS4FVMESAPROC) (const GLfloat* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS4IMESAPROC) (GLint x, GLint y, GLint z, GLint w); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS4IVMESAPROC) (const GLint* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS4SMESAPROC) (GLshort x, GLshort y, GLshort z, GLshort w); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS4SVMESAPROC) (const GLshort* p); + +#define glWindowPos2dMESA GLEW_GET_FUN(__glewWindowPos2dMESA) +#define glWindowPos2dvMESA GLEW_GET_FUN(__glewWindowPos2dvMESA) +#define glWindowPos2fMESA GLEW_GET_FUN(__glewWindowPos2fMESA) +#define glWindowPos2fvMESA GLEW_GET_FUN(__glewWindowPos2fvMESA) +#define glWindowPos2iMESA GLEW_GET_FUN(__glewWindowPos2iMESA) +#define glWindowPos2ivMESA GLEW_GET_FUN(__glewWindowPos2ivMESA) +#define glWindowPos2sMESA GLEW_GET_FUN(__glewWindowPos2sMESA) +#define glWindowPos2svMESA GLEW_GET_FUN(__glewWindowPos2svMESA) +#define glWindowPos3dMESA GLEW_GET_FUN(__glewWindowPos3dMESA) +#define glWindowPos3dvMESA GLEW_GET_FUN(__glewWindowPos3dvMESA) +#define glWindowPos3fMESA GLEW_GET_FUN(__glewWindowPos3fMESA) +#define glWindowPos3fvMESA GLEW_GET_FUN(__glewWindowPos3fvMESA) +#define glWindowPos3iMESA GLEW_GET_FUN(__glewWindowPos3iMESA) +#define glWindowPos3ivMESA GLEW_GET_FUN(__glewWindowPos3ivMESA) +#define glWindowPos3sMESA GLEW_GET_FUN(__glewWindowPos3sMESA) +#define glWindowPos3svMESA GLEW_GET_FUN(__glewWindowPos3svMESA) +#define glWindowPos4dMESA GLEW_GET_FUN(__glewWindowPos4dMESA) +#define glWindowPos4dvMESA GLEW_GET_FUN(__glewWindowPos4dvMESA) +#define glWindowPos4fMESA GLEW_GET_FUN(__glewWindowPos4fMESA) +#define glWindowPos4fvMESA GLEW_GET_FUN(__glewWindowPos4fvMESA) +#define glWindowPos4iMESA GLEW_GET_FUN(__glewWindowPos4iMESA) +#define glWindowPos4ivMESA GLEW_GET_FUN(__glewWindowPos4ivMESA) +#define glWindowPos4sMESA GLEW_GET_FUN(__glewWindowPos4sMESA) +#define glWindowPos4svMESA GLEW_GET_FUN(__glewWindowPos4svMESA) + +#define GLEW_MESA_window_pos GLEW_GET_VAR(__GLEW_MESA_window_pos) + +#endif /* GL_MESA_window_pos */ + +/* ------------------------- GL_MESA_ycbcr_texture ------------------------- */ + +#ifndef GL_MESA_ycbcr_texture +#define GL_MESA_ycbcr_texture 1 + +#define GL_UNSIGNED_SHORT_8_8_MESA 0x85BA +#define GL_UNSIGNED_SHORT_8_8_REV_MESA 0x85BB +#define GL_YCBCR_MESA 0x8757 + +#define GLEW_MESA_ycbcr_texture GLEW_GET_VAR(__GLEW_MESA_ycbcr_texture) + +#endif /* GL_MESA_ycbcr_texture */ + +/* ----------------------- GL_NVX_conditional_render ----------------------- */ + +#ifndef GL_NVX_conditional_render +#define GL_NVX_conditional_render 1 + +typedef void (GLAPIENTRY * PFNGLBEGINCONDITIONALRENDERNVXPROC) (GLuint id); +typedef void (GLAPIENTRY * PFNGLENDCONDITIONALRENDERNVXPROC) (void); + +#define glBeginConditionalRenderNVX GLEW_GET_FUN(__glewBeginConditionalRenderNVX) +#define glEndConditionalRenderNVX GLEW_GET_FUN(__glewEndConditionalRenderNVX) + +#define GLEW_NVX_conditional_render GLEW_GET_VAR(__GLEW_NVX_conditional_render) + +#endif /* GL_NVX_conditional_render */ + +/* ------------------------- GL_NVX_gpu_memory_info ------------------------ */ + +#ifndef GL_NVX_gpu_memory_info +#define GL_NVX_gpu_memory_info 1 + +#define GL_GPU_MEMORY_INFO_DEDICATED_VIDMEM_NVX 0x9047 +#define GL_GPU_MEMORY_INFO_TOTAL_AVAILABLE_MEMORY_NVX 0x9048 +#define GL_GPU_MEMORY_INFO_CURRENT_AVAILABLE_VIDMEM_NVX 0x9049 +#define GL_GPU_MEMORY_INFO_EVICTION_COUNT_NVX 0x904A +#define GL_GPU_MEMORY_INFO_EVICTED_MEMORY_NVX 0x904B + +#define GLEW_NVX_gpu_memory_info GLEW_GET_VAR(__GLEW_NVX_gpu_memory_info) + +#endif /* GL_NVX_gpu_memory_info */ + +/* ------------------- GL_NV_bindless_multi_draw_indirect ------------------ */ + +#ifndef GL_NV_bindless_multi_draw_indirect +#define GL_NV_bindless_multi_draw_indirect 1 + +typedef void (GLAPIENTRY * PFNGLMULTIDRAWARRAYSINDIRECTBINDLESSNVPROC) (GLenum mode, const GLvoid *indirect, GLsizei drawCount, GLsizei stride, GLint vertexBufferCount); +typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSINDIRECTBINDLESSNVPROC) (GLenum mode, GLenum type, const GLvoid *indirect, GLsizei drawCount, GLsizei stride, GLint vertexBufferCount); + +#define glMultiDrawArraysIndirectBindlessNV GLEW_GET_FUN(__glewMultiDrawArraysIndirectBindlessNV) +#define glMultiDrawElementsIndirectBindlessNV GLEW_GET_FUN(__glewMultiDrawElementsIndirectBindlessNV) + +#define GLEW_NV_bindless_multi_draw_indirect GLEW_GET_VAR(__GLEW_NV_bindless_multi_draw_indirect) + +#endif /* GL_NV_bindless_multi_draw_indirect */ + +/* ------------------------- GL_NV_bindless_texture ------------------------ */ + +#ifndef GL_NV_bindless_texture +#define GL_NV_bindless_texture 1 + +typedef GLuint64 (GLAPIENTRY * PFNGLGETIMAGEHANDLENVPROC) (GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum format); +typedef GLuint64 (GLAPIENTRY * PFNGLGETTEXTUREHANDLENVPROC) (GLuint texture); +typedef GLuint64 (GLAPIENTRY * PFNGLGETTEXTURESAMPLERHANDLENVPROC) (GLuint texture, GLuint sampler); +typedef GLboolean (GLAPIENTRY * PFNGLISIMAGEHANDLERESIDENTNVPROC) (GLuint64 handle); +typedef GLboolean (GLAPIENTRY * PFNGLISTEXTUREHANDLERESIDENTNVPROC) (GLuint64 handle); +typedef void (GLAPIENTRY * PFNGLMAKEIMAGEHANDLENONRESIDENTNVPROC) (GLuint64 handle); +typedef void (GLAPIENTRY * PFNGLMAKEIMAGEHANDLERESIDENTNVPROC) (GLuint64 handle, GLenum access); +typedef void (GLAPIENTRY * PFNGLMAKETEXTUREHANDLENONRESIDENTNVPROC) (GLuint64 handle); +typedef void (GLAPIENTRY * PFNGLMAKETEXTUREHANDLERESIDENTNVPROC) (GLuint64 handle); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMHANDLEUI64NVPROC) (GLuint program, GLint location, GLuint64 value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMHANDLEUI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64* values); +typedef void (GLAPIENTRY * PFNGLUNIFORMHANDLEUI64NVPROC) (GLint location, GLuint64 value); +typedef void (GLAPIENTRY * PFNGLUNIFORMHANDLEUI64VNVPROC) (GLint location, GLsizei count, const GLuint64* value); + +#define glGetImageHandleNV GLEW_GET_FUN(__glewGetImageHandleNV) +#define glGetTextureHandleNV GLEW_GET_FUN(__glewGetTextureHandleNV) +#define glGetTextureSamplerHandleNV GLEW_GET_FUN(__glewGetTextureSamplerHandleNV) +#define glIsImageHandleResidentNV GLEW_GET_FUN(__glewIsImageHandleResidentNV) +#define glIsTextureHandleResidentNV GLEW_GET_FUN(__glewIsTextureHandleResidentNV) +#define glMakeImageHandleNonResidentNV GLEW_GET_FUN(__glewMakeImageHandleNonResidentNV) +#define glMakeImageHandleResidentNV GLEW_GET_FUN(__glewMakeImageHandleResidentNV) +#define glMakeTextureHandleNonResidentNV GLEW_GET_FUN(__glewMakeTextureHandleNonResidentNV) +#define glMakeTextureHandleResidentNV GLEW_GET_FUN(__glewMakeTextureHandleResidentNV) +#define glProgramUniformHandleui64NV GLEW_GET_FUN(__glewProgramUniformHandleui64NV) +#define glProgramUniformHandleui64vNV GLEW_GET_FUN(__glewProgramUniformHandleui64vNV) +#define glUniformHandleui64NV GLEW_GET_FUN(__glewUniformHandleui64NV) +#define glUniformHandleui64vNV GLEW_GET_FUN(__glewUniformHandleui64vNV) + +#define GLEW_NV_bindless_texture GLEW_GET_VAR(__GLEW_NV_bindless_texture) + +#endif /* GL_NV_bindless_texture */ + +/* --------------------- GL_NV_blend_equation_advanced --------------------- */ + +#ifndef GL_NV_blend_equation_advanced +#define GL_NV_blend_equation_advanced 1 + +#define GL_BLEND_PREMULTIPLIED_SRC_NV 0x9280 +#define GL_BLEND_OVERLAP_NV 0x9281 +#define GL_UNCORRELATED_NV 0x9282 +#define GL_DISJOINT_NV 0x9283 +#define GL_CONJOINT_NV 0x9284 +#define GL_BLEND_ADVANCED_COHERENT_NV 0x9285 +#define GL_SRC_NV 0x9286 +#define GL_DST_NV 0x9287 +#define GL_SRC_OVER_NV 0x9288 +#define GL_DST_OVER_NV 0x9289 +#define GL_SRC_IN_NV 0x928A +#define GL_DST_IN_NV 0x928B +#define GL_SRC_OUT_NV 0x928C +#define GL_DST_OUT_NV 0x928D +#define GL_SRC_ATOP_NV 0x928E +#define GL_DST_ATOP_NV 0x928F +#define GL_PLUS_NV 0x9291 +#define GL_PLUS_DARKER_NV 0x9292 +#define GL_MULTIPLY_NV 0x9294 +#define GL_SCREEN_NV 0x9295 +#define GL_OVERLAY_NV 0x9296 +#define GL_DARKEN_NV 0x9297 +#define GL_LIGHTEN_NV 0x9298 +#define GL_COLORDODGE_NV 0x9299 +#define GL_COLORBURN_NV 0x929A +#define GL_HARDLIGHT_NV 0x929B +#define GL_SOFTLIGHT_NV 0x929C +#define GL_DIFFERENCE_NV 0x929E +#define GL_MINUS_NV 0x929F +#define GL_EXCLUSION_NV 0x92A0 +#define GL_CONTRAST_NV 0x92A1 +#define GL_INVERT_RGB_NV 0x92A3 +#define GL_LINEARDODGE_NV 0x92A4 +#define GL_LINEARBURN_NV 0x92A5 +#define GL_VIVIDLIGHT_NV 0x92A6 +#define GL_LINEARLIGHT_NV 0x92A7 +#define GL_PINLIGHT_NV 0x92A8 +#define GL_HARDMIX_NV 0x92A9 +#define GL_HSL_HUE_NV 0x92AD +#define GL_HSL_SATURATION_NV 0x92AE +#define GL_HSL_COLOR_NV 0x92AF +#define GL_HSL_LUMINOSITY_NV 0x92B0 +#define GL_PLUS_CLAMPED_NV 0x92B1 +#define GL_PLUS_CLAMPED_ALPHA_NV 0x92B2 +#define GL_MINUS_CLAMPED_NV 0x92B3 +#define GL_INVERT_OVG_NV 0x92B4 + +typedef void (GLAPIENTRY * PFNGLBLENDBARRIERNVPROC) (void); +typedef void (GLAPIENTRY * PFNGLBLENDPARAMETERINVPROC) (GLenum pname, GLint value); + +#define glBlendBarrierNV GLEW_GET_FUN(__glewBlendBarrierNV) +#define glBlendParameteriNV GLEW_GET_FUN(__glewBlendParameteriNV) + +#define GLEW_NV_blend_equation_advanced GLEW_GET_VAR(__GLEW_NV_blend_equation_advanced) + +#endif /* GL_NV_blend_equation_advanced */ + +/* ----------------- GL_NV_blend_equation_advanced_coherent ---------------- */ + +#ifndef GL_NV_blend_equation_advanced_coherent +#define GL_NV_blend_equation_advanced_coherent 1 + +#define GLEW_NV_blend_equation_advanced_coherent GLEW_GET_VAR(__GLEW_NV_blend_equation_advanced_coherent) + +#endif /* GL_NV_blend_equation_advanced_coherent */ + +/* --------------------------- GL_NV_blend_square -------------------------- */ + +#ifndef GL_NV_blend_square +#define GL_NV_blend_square 1 + +#define GLEW_NV_blend_square GLEW_GET_VAR(__GLEW_NV_blend_square) + +#endif /* GL_NV_blend_square */ + +/* ------------------------- GL_NV_compute_program5 ------------------------ */ + +#ifndef GL_NV_compute_program5 +#define GL_NV_compute_program5 1 + +#define GL_COMPUTE_PROGRAM_NV 0x90FB +#define GL_COMPUTE_PROGRAM_PARAMETER_BUFFER_NV 0x90FC + +#define GLEW_NV_compute_program5 GLEW_GET_VAR(__GLEW_NV_compute_program5) + +#endif /* GL_NV_compute_program5 */ + +/* ------------------------ GL_NV_conditional_render ----------------------- */ + +#ifndef GL_NV_conditional_render +#define GL_NV_conditional_render 1 + +#define GL_QUERY_WAIT_NV 0x8E13 +#define GL_QUERY_NO_WAIT_NV 0x8E14 +#define GL_QUERY_BY_REGION_WAIT_NV 0x8E15 +#define GL_QUERY_BY_REGION_NO_WAIT_NV 0x8E16 + +typedef void (GLAPIENTRY * PFNGLBEGINCONDITIONALRENDERNVPROC) (GLuint id, GLenum mode); +typedef void (GLAPIENTRY * PFNGLENDCONDITIONALRENDERNVPROC) (void); + +#define glBeginConditionalRenderNV GLEW_GET_FUN(__glewBeginConditionalRenderNV) +#define glEndConditionalRenderNV GLEW_GET_FUN(__glewEndConditionalRenderNV) + +#define GLEW_NV_conditional_render GLEW_GET_VAR(__GLEW_NV_conditional_render) + +#endif /* GL_NV_conditional_render */ + +/* ----------------------- GL_NV_copy_depth_to_color ----------------------- */ + +#ifndef GL_NV_copy_depth_to_color +#define GL_NV_copy_depth_to_color 1 + +#define GL_DEPTH_STENCIL_TO_RGBA_NV 0x886E +#define GL_DEPTH_STENCIL_TO_BGRA_NV 0x886F + +#define GLEW_NV_copy_depth_to_color GLEW_GET_VAR(__GLEW_NV_copy_depth_to_color) + +#endif /* GL_NV_copy_depth_to_color */ + +/* ---------------------------- GL_NV_copy_image --------------------------- */ + +#ifndef GL_NV_copy_image +#define GL_NV_copy_image 1 + +typedef void (GLAPIENTRY * PFNGLCOPYIMAGESUBDATANVPROC) (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth); + +#define glCopyImageSubDataNV GLEW_GET_FUN(__glewCopyImageSubDataNV) + +#define GLEW_NV_copy_image GLEW_GET_VAR(__GLEW_NV_copy_image) + +#endif /* GL_NV_copy_image */ + +/* -------------------------- GL_NV_deep_texture3D ------------------------- */ + +#ifndef GL_NV_deep_texture3D +#define GL_NV_deep_texture3D 1 + +#define GL_MAX_DEEP_3D_TEXTURE_WIDTH_HEIGHT_NV 0x90D0 +#define GL_MAX_DEEP_3D_TEXTURE_DEPTH_NV 0x90D1 + +#define GLEW_NV_deep_texture3D GLEW_GET_VAR(__GLEW_NV_deep_texture3D) + +#endif /* GL_NV_deep_texture3D */ + +/* ------------------------ GL_NV_depth_buffer_float ----------------------- */ + +#ifndef GL_NV_depth_buffer_float +#define GL_NV_depth_buffer_float 1 + +#define GL_DEPTH_COMPONENT32F_NV 0x8DAB +#define GL_DEPTH32F_STENCIL8_NV 0x8DAC +#define GL_FLOAT_32_UNSIGNED_INT_24_8_REV_NV 0x8DAD +#define GL_DEPTH_BUFFER_FLOAT_MODE_NV 0x8DAF + +typedef void (GLAPIENTRY * PFNGLCLEARDEPTHDNVPROC) (GLdouble depth); +typedef void (GLAPIENTRY * PFNGLDEPTHBOUNDSDNVPROC) (GLdouble zmin, GLdouble zmax); +typedef void (GLAPIENTRY * PFNGLDEPTHRANGEDNVPROC) (GLdouble zNear, GLdouble zFar); + +#define glClearDepthdNV GLEW_GET_FUN(__glewClearDepthdNV) +#define glDepthBoundsdNV GLEW_GET_FUN(__glewDepthBoundsdNV) +#define glDepthRangedNV GLEW_GET_FUN(__glewDepthRangedNV) + +#define GLEW_NV_depth_buffer_float GLEW_GET_VAR(__GLEW_NV_depth_buffer_float) + +#endif /* GL_NV_depth_buffer_float */ + +/* --------------------------- GL_NV_depth_clamp --------------------------- */ + +#ifndef GL_NV_depth_clamp +#define GL_NV_depth_clamp 1 + +#define GL_DEPTH_CLAMP_NV 0x864F + +#define GLEW_NV_depth_clamp GLEW_GET_VAR(__GLEW_NV_depth_clamp) + +#endif /* GL_NV_depth_clamp */ + +/* ---------------------- GL_NV_depth_range_unclamped ---------------------- */ + +#ifndef GL_NV_depth_range_unclamped +#define GL_NV_depth_range_unclamped 1 + +#define GL_SAMPLE_COUNT_BITS_NV 0x8864 +#define GL_CURRENT_SAMPLE_COUNT_QUERY_NV 0x8865 +#define GL_QUERY_RESULT_NV 0x8866 +#define GL_QUERY_RESULT_AVAILABLE_NV 0x8867 +#define GL_SAMPLE_COUNT_NV 0x8914 + +#define GLEW_NV_depth_range_unclamped GLEW_GET_VAR(__GLEW_NV_depth_range_unclamped) + +#endif /* GL_NV_depth_range_unclamped */ + +/* --------------------------- GL_NV_draw_texture -------------------------- */ + +#ifndef GL_NV_draw_texture +#define GL_NV_draw_texture 1 + +typedef void (GLAPIENTRY * PFNGLDRAWTEXTURENVPROC) (GLuint texture, GLuint sampler, GLfloat x0, GLfloat y0, GLfloat x1, GLfloat y1, GLfloat z, GLfloat s0, GLfloat t0, GLfloat s1, GLfloat t1); + +#define glDrawTextureNV GLEW_GET_FUN(__glewDrawTextureNV) + +#define GLEW_NV_draw_texture GLEW_GET_VAR(__GLEW_NV_draw_texture) + +#endif /* GL_NV_draw_texture */ + +/* ---------------------------- GL_NV_evaluators --------------------------- */ + +#ifndef GL_NV_evaluators +#define GL_NV_evaluators 1 + +#define GL_EVAL_2D_NV 0x86C0 +#define GL_EVAL_TRIANGULAR_2D_NV 0x86C1 +#define GL_MAP_TESSELLATION_NV 0x86C2 +#define GL_MAP_ATTRIB_U_ORDER_NV 0x86C3 +#define GL_MAP_ATTRIB_V_ORDER_NV 0x86C4 +#define GL_EVAL_FRACTIONAL_TESSELLATION_NV 0x86C5 +#define GL_EVAL_VERTEX_ATTRIB0_NV 0x86C6 +#define GL_EVAL_VERTEX_ATTRIB1_NV 0x86C7 +#define GL_EVAL_VERTEX_ATTRIB2_NV 0x86C8 +#define GL_EVAL_VERTEX_ATTRIB3_NV 0x86C9 +#define GL_EVAL_VERTEX_ATTRIB4_NV 0x86CA +#define GL_EVAL_VERTEX_ATTRIB5_NV 0x86CB +#define GL_EVAL_VERTEX_ATTRIB6_NV 0x86CC +#define GL_EVAL_VERTEX_ATTRIB7_NV 0x86CD +#define GL_EVAL_VERTEX_ATTRIB8_NV 0x86CE +#define GL_EVAL_VERTEX_ATTRIB9_NV 0x86CF +#define GL_EVAL_VERTEX_ATTRIB10_NV 0x86D0 +#define GL_EVAL_VERTEX_ATTRIB11_NV 0x86D1 +#define GL_EVAL_VERTEX_ATTRIB12_NV 0x86D2 +#define GL_EVAL_VERTEX_ATTRIB13_NV 0x86D3 +#define GL_EVAL_VERTEX_ATTRIB14_NV 0x86D4 +#define GL_EVAL_VERTEX_ATTRIB15_NV 0x86D5 +#define GL_MAX_MAP_TESSELLATION_NV 0x86D6 +#define GL_MAX_RATIONAL_EVAL_ORDER_NV 0x86D7 + +typedef void (GLAPIENTRY * PFNGLEVALMAPSNVPROC) (GLenum target, GLenum mode); +typedef void (GLAPIENTRY * PFNGLGETMAPATTRIBPARAMETERFVNVPROC) (GLenum target, GLuint index, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETMAPATTRIBPARAMETERIVNVPROC) (GLenum target, GLuint index, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETMAPCONTROLPOINTSNVPROC) (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLboolean packed, GLvoid *points); +typedef void (GLAPIENTRY * PFNGLGETMAPPARAMETERFVNVPROC) (GLenum target, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETMAPPARAMETERIVNVPROC) (GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLMAPCONTROLPOINTSNVPROC) (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLint uorder, GLint vorder, GLboolean packed, const GLvoid *points); +typedef void (GLAPIENTRY * PFNGLMAPPARAMETERFVNVPROC) (GLenum target, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLMAPPARAMETERIVNVPROC) (GLenum target, GLenum pname, const GLint* params); + +#define glEvalMapsNV GLEW_GET_FUN(__glewEvalMapsNV) +#define glGetMapAttribParameterfvNV GLEW_GET_FUN(__glewGetMapAttribParameterfvNV) +#define glGetMapAttribParameterivNV GLEW_GET_FUN(__glewGetMapAttribParameterivNV) +#define glGetMapControlPointsNV GLEW_GET_FUN(__glewGetMapControlPointsNV) +#define glGetMapParameterfvNV GLEW_GET_FUN(__glewGetMapParameterfvNV) +#define glGetMapParameterivNV GLEW_GET_FUN(__glewGetMapParameterivNV) +#define glMapControlPointsNV GLEW_GET_FUN(__glewMapControlPointsNV) +#define glMapParameterfvNV GLEW_GET_FUN(__glewMapParameterfvNV) +#define glMapParameterivNV GLEW_GET_FUN(__glewMapParameterivNV) + +#define GLEW_NV_evaluators GLEW_GET_VAR(__GLEW_NV_evaluators) + +#endif /* GL_NV_evaluators */ + +/* ----------------------- GL_NV_explicit_multisample ---------------------- */ + +#ifndef GL_NV_explicit_multisample +#define GL_NV_explicit_multisample 1 + +#define GL_SAMPLE_POSITION_NV 0x8E50 +#define GL_SAMPLE_MASK_NV 0x8E51 +#define GL_SAMPLE_MASK_VALUE_NV 0x8E52 +#define GL_TEXTURE_BINDING_RENDERBUFFER_NV 0x8E53 +#define GL_TEXTURE_RENDERBUFFER_DATA_STORE_BINDING_NV 0x8E54 +#define GL_TEXTURE_RENDERBUFFER_NV 0x8E55 +#define GL_SAMPLER_RENDERBUFFER_NV 0x8E56 +#define GL_INT_SAMPLER_RENDERBUFFER_NV 0x8E57 +#define GL_UNSIGNED_INT_SAMPLER_RENDERBUFFER_NV 0x8E58 +#define GL_MAX_SAMPLE_MASK_WORDS_NV 0x8E59 + +typedef void (GLAPIENTRY * PFNGLGETMULTISAMPLEFVNVPROC) (GLenum pname, GLuint index, GLfloat* val); +typedef void (GLAPIENTRY * PFNGLSAMPLEMASKINDEXEDNVPROC) (GLuint index, GLbitfield mask); +typedef void (GLAPIENTRY * PFNGLTEXRENDERBUFFERNVPROC) (GLenum target, GLuint renderbuffer); + +#define glGetMultisamplefvNV GLEW_GET_FUN(__glewGetMultisamplefvNV) +#define glSampleMaskIndexedNV GLEW_GET_FUN(__glewSampleMaskIndexedNV) +#define glTexRenderbufferNV GLEW_GET_FUN(__glewTexRenderbufferNV) + +#define GLEW_NV_explicit_multisample GLEW_GET_VAR(__GLEW_NV_explicit_multisample) + +#endif /* GL_NV_explicit_multisample */ + +/* ------------------------------ GL_NV_fence ------------------------------ */ + +#ifndef GL_NV_fence +#define GL_NV_fence 1 + +#define GL_ALL_COMPLETED_NV 0x84F2 +#define GL_FENCE_STATUS_NV 0x84F3 +#define GL_FENCE_CONDITION_NV 0x84F4 + +typedef void (GLAPIENTRY * PFNGLDELETEFENCESNVPROC) (GLsizei n, const GLuint* fences); +typedef void (GLAPIENTRY * PFNGLFINISHFENCENVPROC) (GLuint fence); +typedef void (GLAPIENTRY * PFNGLGENFENCESNVPROC) (GLsizei n, GLuint* fences); +typedef void (GLAPIENTRY * PFNGLGETFENCEIVNVPROC) (GLuint fence, GLenum pname, GLint* params); +typedef GLboolean (GLAPIENTRY * PFNGLISFENCENVPROC) (GLuint fence); +typedef void (GLAPIENTRY * PFNGLSETFENCENVPROC) (GLuint fence, GLenum condition); +typedef GLboolean (GLAPIENTRY * PFNGLTESTFENCENVPROC) (GLuint fence); + +#define glDeleteFencesNV GLEW_GET_FUN(__glewDeleteFencesNV) +#define glFinishFenceNV GLEW_GET_FUN(__glewFinishFenceNV) +#define glGenFencesNV GLEW_GET_FUN(__glewGenFencesNV) +#define glGetFenceivNV GLEW_GET_FUN(__glewGetFenceivNV) +#define glIsFenceNV GLEW_GET_FUN(__glewIsFenceNV) +#define glSetFenceNV GLEW_GET_FUN(__glewSetFenceNV) +#define glTestFenceNV GLEW_GET_FUN(__glewTestFenceNV) + +#define GLEW_NV_fence GLEW_GET_VAR(__GLEW_NV_fence) + +#endif /* GL_NV_fence */ + +/* --------------------------- GL_NV_float_buffer -------------------------- */ + +#ifndef GL_NV_float_buffer +#define GL_NV_float_buffer 1 + +#define GL_FLOAT_R_NV 0x8880 +#define GL_FLOAT_RG_NV 0x8881 +#define GL_FLOAT_RGB_NV 0x8882 +#define GL_FLOAT_RGBA_NV 0x8883 +#define GL_FLOAT_R16_NV 0x8884 +#define GL_FLOAT_R32_NV 0x8885 +#define GL_FLOAT_RG16_NV 0x8886 +#define GL_FLOAT_RG32_NV 0x8887 +#define GL_FLOAT_RGB16_NV 0x8888 +#define GL_FLOAT_RGB32_NV 0x8889 +#define GL_FLOAT_RGBA16_NV 0x888A +#define GL_FLOAT_RGBA32_NV 0x888B +#define GL_TEXTURE_FLOAT_COMPONENTS_NV 0x888C +#define GL_FLOAT_CLEAR_COLOR_VALUE_NV 0x888D +#define GL_FLOAT_RGBA_MODE_NV 0x888E + +#define GLEW_NV_float_buffer GLEW_GET_VAR(__GLEW_NV_float_buffer) + +#endif /* GL_NV_float_buffer */ + +/* --------------------------- GL_NV_fog_distance -------------------------- */ + +#ifndef GL_NV_fog_distance +#define GL_NV_fog_distance 1 + +#define GL_FOG_DISTANCE_MODE_NV 0x855A +#define GL_EYE_RADIAL_NV 0x855B +#define GL_EYE_PLANE_ABSOLUTE_NV 0x855C + +#define GLEW_NV_fog_distance GLEW_GET_VAR(__GLEW_NV_fog_distance) + +#endif /* GL_NV_fog_distance */ + +/* ------------------------- GL_NV_fragment_program ------------------------ */ + +#ifndef GL_NV_fragment_program +#define GL_NV_fragment_program 1 + +#define GL_MAX_FRAGMENT_PROGRAM_LOCAL_PARAMETERS_NV 0x8868 +#define GL_FRAGMENT_PROGRAM_NV 0x8870 +#define GL_MAX_TEXTURE_COORDS_NV 0x8871 +#define GL_MAX_TEXTURE_IMAGE_UNITS_NV 0x8872 +#define GL_FRAGMENT_PROGRAM_BINDING_NV 0x8873 +#define GL_PROGRAM_ERROR_STRING_NV 0x8874 + +typedef void (GLAPIENTRY * PFNGLGETPROGRAMNAMEDPARAMETERDVNVPROC) (GLuint id, GLsizei len, const GLubyte* name, GLdouble *params); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMNAMEDPARAMETERFVNVPROC) (GLuint id, GLsizei len, const GLubyte* name, GLfloat *params); +typedef void (GLAPIENTRY * PFNGLPROGRAMNAMEDPARAMETER4DNVPROC) (GLuint id, GLsizei len, const GLubyte* name, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (GLAPIENTRY * PFNGLPROGRAMNAMEDPARAMETER4DVNVPROC) (GLuint id, GLsizei len, const GLubyte* name, const GLdouble v[]); +typedef void (GLAPIENTRY * PFNGLPROGRAMNAMEDPARAMETER4FNVPROC) (GLuint id, GLsizei len, const GLubyte* name, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (GLAPIENTRY * PFNGLPROGRAMNAMEDPARAMETER4FVNVPROC) (GLuint id, GLsizei len, const GLubyte* name, const GLfloat v[]); + +#define glGetProgramNamedParameterdvNV GLEW_GET_FUN(__glewGetProgramNamedParameterdvNV) +#define glGetProgramNamedParameterfvNV GLEW_GET_FUN(__glewGetProgramNamedParameterfvNV) +#define glProgramNamedParameter4dNV GLEW_GET_FUN(__glewProgramNamedParameter4dNV) +#define glProgramNamedParameter4dvNV GLEW_GET_FUN(__glewProgramNamedParameter4dvNV) +#define glProgramNamedParameter4fNV GLEW_GET_FUN(__glewProgramNamedParameter4fNV) +#define glProgramNamedParameter4fvNV GLEW_GET_FUN(__glewProgramNamedParameter4fvNV) + +#define GLEW_NV_fragment_program GLEW_GET_VAR(__GLEW_NV_fragment_program) + +#endif /* GL_NV_fragment_program */ + +/* ------------------------ GL_NV_fragment_program2 ------------------------ */ + +#ifndef GL_NV_fragment_program2 +#define GL_NV_fragment_program2 1 + +#define GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV 0x88F4 +#define GL_MAX_PROGRAM_CALL_DEPTH_NV 0x88F5 +#define GL_MAX_PROGRAM_IF_DEPTH_NV 0x88F6 +#define GL_MAX_PROGRAM_LOOP_DEPTH_NV 0x88F7 +#define GL_MAX_PROGRAM_LOOP_COUNT_NV 0x88F8 + +#define GLEW_NV_fragment_program2 GLEW_GET_VAR(__GLEW_NV_fragment_program2) + +#endif /* GL_NV_fragment_program2 */ + +/* ------------------------ GL_NV_fragment_program4 ------------------------ */ + +#ifndef GL_NV_fragment_program4 +#define GL_NV_fragment_program4 1 + +#define GLEW_NV_fragment_program4 GLEW_GET_VAR(__GLEW_NV_fragment_program4) + +#endif /* GL_NV_fragment_program4 */ + +/* --------------------- GL_NV_fragment_program_option --------------------- */ + +#ifndef GL_NV_fragment_program_option +#define GL_NV_fragment_program_option 1 + +#define GLEW_NV_fragment_program_option GLEW_GET_VAR(__GLEW_NV_fragment_program_option) + +#endif /* GL_NV_fragment_program_option */ + +/* ----------------- GL_NV_framebuffer_multisample_coverage ---------------- */ + +#ifndef GL_NV_framebuffer_multisample_coverage +#define GL_NV_framebuffer_multisample_coverage 1 + +#define GL_RENDERBUFFER_COVERAGE_SAMPLES_NV 0x8CAB +#define GL_RENDERBUFFER_COLOR_SAMPLES_NV 0x8E10 +#define GL_MAX_MULTISAMPLE_COVERAGE_MODES_NV 0x8E11 +#define GL_MULTISAMPLE_COVERAGE_MODES_NV 0x8E12 + +typedef void (GLAPIENTRY * PFNGLRENDERBUFFERSTORAGEMULTISAMPLECOVERAGENVPROC) (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height); + +#define glRenderbufferStorageMultisampleCoverageNV GLEW_GET_FUN(__glewRenderbufferStorageMultisampleCoverageNV) + +#define GLEW_NV_framebuffer_multisample_coverage GLEW_GET_VAR(__GLEW_NV_framebuffer_multisample_coverage) + +#endif /* GL_NV_framebuffer_multisample_coverage */ + +/* ------------------------ GL_NV_geometry_program4 ------------------------ */ + +#ifndef GL_NV_geometry_program4 +#define GL_NV_geometry_program4 1 + +#define GL_GEOMETRY_PROGRAM_NV 0x8C26 +#define GL_MAX_PROGRAM_OUTPUT_VERTICES_NV 0x8C27 +#define GL_MAX_PROGRAM_TOTAL_OUTPUT_COMPONENTS_NV 0x8C28 + +typedef void (GLAPIENTRY * PFNGLPROGRAMVERTEXLIMITNVPROC) (GLenum target, GLint limit); + +#define glProgramVertexLimitNV GLEW_GET_FUN(__glewProgramVertexLimitNV) + +#define GLEW_NV_geometry_program4 GLEW_GET_VAR(__GLEW_NV_geometry_program4) + +#endif /* GL_NV_geometry_program4 */ + +/* ------------------------- GL_NV_geometry_shader4 ------------------------ */ + +#ifndef GL_NV_geometry_shader4 +#define GL_NV_geometry_shader4 1 + +#define GLEW_NV_geometry_shader4 GLEW_GET_VAR(__GLEW_NV_geometry_shader4) + +#endif /* GL_NV_geometry_shader4 */ + +/* --------------------------- GL_NV_gpu_program4 -------------------------- */ + +#ifndef GL_NV_gpu_program4 +#define GL_NV_gpu_program4 1 + +#define GL_MIN_PROGRAM_TEXEL_OFFSET_NV 0x8904 +#define GL_MAX_PROGRAM_TEXEL_OFFSET_NV 0x8905 +#define GL_PROGRAM_ATTRIB_COMPONENTS_NV 0x8906 +#define GL_PROGRAM_RESULT_COMPONENTS_NV 0x8907 +#define GL_MAX_PROGRAM_ATTRIB_COMPONENTS_NV 0x8908 +#define GL_MAX_PROGRAM_RESULT_COMPONENTS_NV 0x8909 +#define GL_MAX_PROGRAM_GENERIC_ATTRIBS_NV 0x8DA5 +#define GL_MAX_PROGRAM_GENERIC_RESULTS_NV 0x8DA6 + +typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETERI4INVPROC) (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w); +typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETERI4IVNVPROC) (GLenum target, GLuint index, const GLint *params); +typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETERI4UINVPROC) (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); +typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETERI4UIVNVPROC) (GLenum target, GLuint index, const GLuint *params); +typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETERSI4IVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLint *params); +typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETERSI4UIVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLuint *params); +typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETERI4INVPROC) (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w); +typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETERI4IVNVPROC) (GLenum target, GLuint index, const GLint *params); +typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETERI4UINVPROC) (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); +typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETERI4UIVNVPROC) (GLenum target, GLuint index, const GLuint *params); +typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETERSI4IVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLint *params); +typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETERSI4UIVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLuint *params); + +#define glProgramEnvParameterI4iNV GLEW_GET_FUN(__glewProgramEnvParameterI4iNV) +#define glProgramEnvParameterI4ivNV GLEW_GET_FUN(__glewProgramEnvParameterI4ivNV) +#define glProgramEnvParameterI4uiNV GLEW_GET_FUN(__glewProgramEnvParameterI4uiNV) +#define glProgramEnvParameterI4uivNV GLEW_GET_FUN(__glewProgramEnvParameterI4uivNV) +#define glProgramEnvParametersI4ivNV GLEW_GET_FUN(__glewProgramEnvParametersI4ivNV) +#define glProgramEnvParametersI4uivNV GLEW_GET_FUN(__glewProgramEnvParametersI4uivNV) +#define glProgramLocalParameterI4iNV GLEW_GET_FUN(__glewProgramLocalParameterI4iNV) +#define glProgramLocalParameterI4ivNV GLEW_GET_FUN(__glewProgramLocalParameterI4ivNV) +#define glProgramLocalParameterI4uiNV GLEW_GET_FUN(__glewProgramLocalParameterI4uiNV) +#define glProgramLocalParameterI4uivNV GLEW_GET_FUN(__glewProgramLocalParameterI4uivNV) +#define glProgramLocalParametersI4ivNV GLEW_GET_FUN(__glewProgramLocalParametersI4ivNV) +#define glProgramLocalParametersI4uivNV GLEW_GET_FUN(__glewProgramLocalParametersI4uivNV) + +#define GLEW_NV_gpu_program4 GLEW_GET_VAR(__GLEW_NV_gpu_program4) + +#endif /* GL_NV_gpu_program4 */ + +/* --------------------------- GL_NV_gpu_program5 -------------------------- */ + +#ifndef GL_NV_gpu_program5 +#define GL_NV_gpu_program5 1 + +#define GL_MAX_GEOMETRY_PROGRAM_INVOCATIONS_NV 0x8E5A +#define GL_MIN_FRAGMENT_INTERPOLATION_OFFSET_NV 0x8E5B +#define GL_MAX_FRAGMENT_INTERPOLATION_OFFSET_NV 0x8E5C +#define GL_FRAGMENT_PROGRAM_INTERPOLATION_OFFSET_BITS_NV 0x8E5D +#define GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET_NV 0x8E5E +#define GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET_NV 0x8E5F + +#define GLEW_NV_gpu_program5 GLEW_GET_VAR(__GLEW_NV_gpu_program5) + +#endif /* GL_NV_gpu_program5 */ + +/* -------------------- GL_NV_gpu_program5_mem_extended -------------------- */ + +#ifndef GL_NV_gpu_program5_mem_extended +#define GL_NV_gpu_program5_mem_extended 1 + +#define GLEW_NV_gpu_program5_mem_extended GLEW_GET_VAR(__GLEW_NV_gpu_program5_mem_extended) + +#endif /* GL_NV_gpu_program5_mem_extended */ + +/* ------------------------- GL_NV_gpu_program_fp64 ------------------------ */ + +#ifndef GL_NV_gpu_program_fp64 +#define GL_NV_gpu_program_fp64 1 + +#define GLEW_NV_gpu_program_fp64 GLEW_GET_VAR(__GLEW_NV_gpu_program_fp64) + +#endif /* GL_NV_gpu_program_fp64 */ + +/* --------------------------- GL_NV_gpu_shader5 --------------------------- */ + +#ifndef GL_NV_gpu_shader5 +#define GL_NV_gpu_shader5 1 + +#define GL_INT64_NV 0x140E +#define GL_UNSIGNED_INT64_NV 0x140F +#define GL_INT8_NV 0x8FE0 +#define GL_INT8_VEC2_NV 0x8FE1 +#define GL_INT8_VEC3_NV 0x8FE2 +#define GL_INT8_VEC4_NV 0x8FE3 +#define GL_INT16_NV 0x8FE4 +#define GL_INT16_VEC2_NV 0x8FE5 +#define GL_INT16_VEC3_NV 0x8FE6 +#define GL_INT16_VEC4_NV 0x8FE7 +#define GL_INT64_VEC2_NV 0x8FE9 +#define GL_INT64_VEC3_NV 0x8FEA +#define GL_INT64_VEC4_NV 0x8FEB +#define GL_UNSIGNED_INT8_NV 0x8FEC +#define GL_UNSIGNED_INT8_VEC2_NV 0x8FED +#define GL_UNSIGNED_INT8_VEC3_NV 0x8FEE +#define GL_UNSIGNED_INT8_VEC4_NV 0x8FEF +#define GL_UNSIGNED_INT16_NV 0x8FF0 +#define GL_UNSIGNED_INT16_VEC2_NV 0x8FF1 +#define GL_UNSIGNED_INT16_VEC3_NV 0x8FF2 +#define GL_UNSIGNED_INT16_VEC4_NV 0x8FF3 +#define GL_UNSIGNED_INT64_VEC2_NV 0x8FF5 +#define GL_UNSIGNED_INT64_VEC3_NV 0x8FF6 +#define GL_UNSIGNED_INT64_VEC4_NV 0x8FF7 +#define GL_FLOAT16_NV 0x8FF8 +#define GL_FLOAT16_VEC2_NV 0x8FF9 +#define GL_FLOAT16_VEC3_NV 0x8FFA +#define GL_FLOAT16_VEC4_NV 0x8FFB + +typedef void (GLAPIENTRY * PFNGLGETUNIFORMI64VNVPROC) (GLuint program, GLint location, GLint64EXT* params); +typedef void (GLAPIENTRY * PFNGLGETUNIFORMUI64VNVPROC) (GLuint program, GLint location, GLuint64EXT* params); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1I64NVPROC) (GLuint program, GLint location, GLint64EXT x); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2I64NVPROC) (GLuint program, GLint location, GLint64EXT x, GLint64EXT y); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3I64NVPROC) (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4I64NVPROC) (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM1I64NVPROC) (GLint location, GLint64EXT x); +typedef void (GLAPIENTRY * PFNGLUNIFORM1I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM1UI64NVPROC) (GLint location, GLuint64EXT x); +typedef void (GLAPIENTRY * PFNGLUNIFORM1UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM2I64NVPROC) (GLint location, GLint64EXT x, GLint64EXT y); +typedef void (GLAPIENTRY * PFNGLUNIFORM2I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM2UI64NVPROC) (GLint location, GLuint64EXT x, GLuint64EXT y); +typedef void (GLAPIENTRY * PFNGLUNIFORM2UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM3I64NVPROC) (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z); +typedef void (GLAPIENTRY * PFNGLUNIFORM3I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM3UI64NVPROC) (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); +typedef void (GLAPIENTRY * PFNGLUNIFORM3UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM4I64NVPROC) (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); +typedef void (GLAPIENTRY * PFNGLUNIFORM4I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM4UI64NVPROC) (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); +typedef void (GLAPIENTRY * PFNGLUNIFORM4UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT* value); + +#define glGetUniformi64vNV GLEW_GET_FUN(__glewGetUniformi64vNV) +#define glGetUniformui64vNV GLEW_GET_FUN(__glewGetUniformui64vNV) +#define glProgramUniform1i64NV GLEW_GET_FUN(__glewProgramUniform1i64NV) +#define glProgramUniform1i64vNV GLEW_GET_FUN(__glewProgramUniform1i64vNV) +#define glProgramUniform1ui64NV GLEW_GET_FUN(__glewProgramUniform1ui64NV) +#define glProgramUniform1ui64vNV GLEW_GET_FUN(__glewProgramUniform1ui64vNV) +#define glProgramUniform2i64NV GLEW_GET_FUN(__glewProgramUniform2i64NV) +#define glProgramUniform2i64vNV GLEW_GET_FUN(__glewProgramUniform2i64vNV) +#define glProgramUniform2ui64NV GLEW_GET_FUN(__glewProgramUniform2ui64NV) +#define glProgramUniform2ui64vNV GLEW_GET_FUN(__glewProgramUniform2ui64vNV) +#define glProgramUniform3i64NV GLEW_GET_FUN(__glewProgramUniform3i64NV) +#define glProgramUniform3i64vNV GLEW_GET_FUN(__glewProgramUniform3i64vNV) +#define glProgramUniform3ui64NV GLEW_GET_FUN(__glewProgramUniform3ui64NV) +#define glProgramUniform3ui64vNV GLEW_GET_FUN(__glewProgramUniform3ui64vNV) +#define glProgramUniform4i64NV GLEW_GET_FUN(__glewProgramUniform4i64NV) +#define glProgramUniform4i64vNV GLEW_GET_FUN(__glewProgramUniform4i64vNV) +#define glProgramUniform4ui64NV GLEW_GET_FUN(__glewProgramUniform4ui64NV) +#define glProgramUniform4ui64vNV GLEW_GET_FUN(__glewProgramUniform4ui64vNV) +#define glUniform1i64NV GLEW_GET_FUN(__glewUniform1i64NV) +#define glUniform1i64vNV GLEW_GET_FUN(__glewUniform1i64vNV) +#define glUniform1ui64NV GLEW_GET_FUN(__glewUniform1ui64NV) +#define glUniform1ui64vNV GLEW_GET_FUN(__glewUniform1ui64vNV) +#define glUniform2i64NV GLEW_GET_FUN(__glewUniform2i64NV) +#define glUniform2i64vNV GLEW_GET_FUN(__glewUniform2i64vNV) +#define glUniform2ui64NV GLEW_GET_FUN(__glewUniform2ui64NV) +#define glUniform2ui64vNV GLEW_GET_FUN(__glewUniform2ui64vNV) +#define glUniform3i64NV GLEW_GET_FUN(__glewUniform3i64NV) +#define glUniform3i64vNV GLEW_GET_FUN(__glewUniform3i64vNV) +#define glUniform3ui64NV GLEW_GET_FUN(__glewUniform3ui64NV) +#define glUniform3ui64vNV GLEW_GET_FUN(__glewUniform3ui64vNV) +#define glUniform4i64NV GLEW_GET_FUN(__glewUniform4i64NV) +#define glUniform4i64vNV GLEW_GET_FUN(__glewUniform4i64vNV) +#define glUniform4ui64NV GLEW_GET_FUN(__glewUniform4ui64NV) +#define glUniform4ui64vNV GLEW_GET_FUN(__glewUniform4ui64vNV) + +#define GLEW_NV_gpu_shader5 GLEW_GET_VAR(__GLEW_NV_gpu_shader5) + +#endif /* GL_NV_gpu_shader5 */ + +/* ---------------------------- GL_NV_half_float --------------------------- */ + +#ifndef GL_NV_half_float +#define GL_NV_half_float 1 + +#define GL_HALF_FLOAT_NV 0x140B + +typedef unsigned short GLhalf; + +typedef void (GLAPIENTRY * PFNGLCOLOR3HNVPROC) (GLhalf red, GLhalf green, GLhalf blue); +typedef void (GLAPIENTRY * PFNGLCOLOR3HVNVPROC) (const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLCOLOR4HNVPROC) (GLhalf red, GLhalf green, GLhalf blue, GLhalf alpha); +typedef void (GLAPIENTRY * PFNGLCOLOR4HVNVPROC) (const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLFOGCOORDHNVPROC) (GLhalf fog); +typedef void (GLAPIENTRY * PFNGLFOGCOORDHVNVPROC) (const GLhalf* fog); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1HNVPROC) (GLenum target, GLhalf s); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1HVNVPROC) (GLenum target, const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2HNVPROC) (GLenum target, GLhalf s, GLhalf t); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2HVNVPROC) (GLenum target, const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3HNVPROC) (GLenum target, GLhalf s, GLhalf t, GLhalf r); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3HVNVPROC) (GLenum target, const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4HNVPROC) (GLenum target, GLhalf s, GLhalf t, GLhalf r, GLhalf q); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4HVNVPROC) (GLenum target, const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLNORMAL3HNVPROC) (GLhalf nx, GLhalf ny, GLhalf nz); +typedef void (GLAPIENTRY * PFNGLNORMAL3HVNVPROC) (const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3HNVPROC) (GLhalf red, GLhalf green, GLhalf blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3HVNVPROC) (const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLTEXCOORD1HNVPROC) (GLhalf s); +typedef void (GLAPIENTRY * PFNGLTEXCOORD1HVNVPROC) (const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLTEXCOORD2HNVPROC) (GLhalf s, GLhalf t); +typedef void (GLAPIENTRY * PFNGLTEXCOORD2HVNVPROC) (const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLTEXCOORD3HNVPROC) (GLhalf s, GLhalf t, GLhalf r); +typedef void (GLAPIENTRY * PFNGLTEXCOORD3HVNVPROC) (const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLTEXCOORD4HNVPROC) (GLhalf s, GLhalf t, GLhalf r, GLhalf q); +typedef void (GLAPIENTRY * PFNGLTEXCOORD4HVNVPROC) (const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLVERTEX2HNVPROC) (GLhalf x, GLhalf y); +typedef void (GLAPIENTRY * PFNGLVERTEX2HVNVPROC) (const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLVERTEX3HNVPROC) (GLhalf x, GLhalf y, GLhalf z); +typedef void (GLAPIENTRY * PFNGLVERTEX3HVNVPROC) (const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLVERTEX4HNVPROC) (GLhalf x, GLhalf y, GLhalf z, GLhalf w); +typedef void (GLAPIENTRY * PFNGLVERTEX4HVNVPROC) (const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1HNVPROC) (GLuint index, GLhalf x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1HVNVPROC) (GLuint index, const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2HNVPROC) (GLuint index, GLhalf x, GLhalf y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2HVNVPROC) (GLuint index, const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3HNVPROC) (GLuint index, GLhalf x, GLhalf y, GLhalf z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3HVNVPROC) (GLuint index, const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4HNVPROC) (GLuint index, GLhalf x, GLhalf y, GLhalf z, GLhalf w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4HVNVPROC) (GLuint index, const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS1HVNVPROC) (GLuint index, GLsizei n, const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS2HVNVPROC) (GLuint index, GLsizei n, const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS3HVNVPROC) (GLuint index, GLsizei n, const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS4HVNVPROC) (GLuint index, GLsizei n, const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLVERTEXWEIGHTHNVPROC) (GLhalf weight); +typedef void (GLAPIENTRY * PFNGLVERTEXWEIGHTHVNVPROC) (const GLhalf* weight); + +#define glColor3hNV GLEW_GET_FUN(__glewColor3hNV) +#define glColor3hvNV GLEW_GET_FUN(__glewColor3hvNV) +#define glColor4hNV GLEW_GET_FUN(__glewColor4hNV) +#define glColor4hvNV GLEW_GET_FUN(__glewColor4hvNV) +#define glFogCoordhNV GLEW_GET_FUN(__glewFogCoordhNV) +#define glFogCoordhvNV GLEW_GET_FUN(__glewFogCoordhvNV) +#define glMultiTexCoord1hNV GLEW_GET_FUN(__glewMultiTexCoord1hNV) +#define glMultiTexCoord1hvNV GLEW_GET_FUN(__glewMultiTexCoord1hvNV) +#define glMultiTexCoord2hNV GLEW_GET_FUN(__glewMultiTexCoord2hNV) +#define glMultiTexCoord2hvNV GLEW_GET_FUN(__glewMultiTexCoord2hvNV) +#define glMultiTexCoord3hNV GLEW_GET_FUN(__glewMultiTexCoord3hNV) +#define glMultiTexCoord3hvNV GLEW_GET_FUN(__glewMultiTexCoord3hvNV) +#define glMultiTexCoord4hNV GLEW_GET_FUN(__glewMultiTexCoord4hNV) +#define glMultiTexCoord4hvNV GLEW_GET_FUN(__glewMultiTexCoord4hvNV) +#define glNormal3hNV GLEW_GET_FUN(__glewNormal3hNV) +#define glNormal3hvNV GLEW_GET_FUN(__glewNormal3hvNV) +#define glSecondaryColor3hNV GLEW_GET_FUN(__glewSecondaryColor3hNV) +#define glSecondaryColor3hvNV GLEW_GET_FUN(__glewSecondaryColor3hvNV) +#define glTexCoord1hNV GLEW_GET_FUN(__glewTexCoord1hNV) +#define glTexCoord1hvNV GLEW_GET_FUN(__glewTexCoord1hvNV) +#define glTexCoord2hNV GLEW_GET_FUN(__glewTexCoord2hNV) +#define glTexCoord2hvNV GLEW_GET_FUN(__glewTexCoord2hvNV) +#define glTexCoord3hNV GLEW_GET_FUN(__glewTexCoord3hNV) +#define glTexCoord3hvNV GLEW_GET_FUN(__glewTexCoord3hvNV) +#define glTexCoord4hNV GLEW_GET_FUN(__glewTexCoord4hNV) +#define glTexCoord4hvNV GLEW_GET_FUN(__glewTexCoord4hvNV) +#define glVertex2hNV GLEW_GET_FUN(__glewVertex2hNV) +#define glVertex2hvNV GLEW_GET_FUN(__glewVertex2hvNV) +#define glVertex3hNV GLEW_GET_FUN(__glewVertex3hNV) +#define glVertex3hvNV GLEW_GET_FUN(__glewVertex3hvNV) +#define glVertex4hNV GLEW_GET_FUN(__glewVertex4hNV) +#define glVertex4hvNV GLEW_GET_FUN(__glewVertex4hvNV) +#define glVertexAttrib1hNV GLEW_GET_FUN(__glewVertexAttrib1hNV) +#define glVertexAttrib1hvNV GLEW_GET_FUN(__glewVertexAttrib1hvNV) +#define glVertexAttrib2hNV GLEW_GET_FUN(__glewVertexAttrib2hNV) +#define glVertexAttrib2hvNV GLEW_GET_FUN(__glewVertexAttrib2hvNV) +#define glVertexAttrib3hNV GLEW_GET_FUN(__glewVertexAttrib3hNV) +#define glVertexAttrib3hvNV GLEW_GET_FUN(__glewVertexAttrib3hvNV) +#define glVertexAttrib4hNV GLEW_GET_FUN(__glewVertexAttrib4hNV) +#define glVertexAttrib4hvNV GLEW_GET_FUN(__glewVertexAttrib4hvNV) +#define glVertexAttribs1hvNV GLEW_GET_FUN(__glewVertexAttribs1hvNV) +#define glVertexAttribs2hvNV GLEW_GET_FUN(__glewVertexAttribs2hvNV) +#define glVertexAttribs3hvNV GLEW_GET_FUN(__glewVertexAttribs3hvNV) +#define glVertexAttribs4hvNV GLEW_GET_FUN(__glewVertexAttribs4hvNV) +#define glVertexWeighthNV GLEW_GET_FUN(__glewVertexWeighthNV) +#define glVertexWeighthvNV GLEW_GET_FUN(__glewVertexWeighthvNV) + +#define GLEW_NV_half_float GLEW_GET_VAR(__GLEW_NV_half_float) + +#endif /* GL_NV_half_float */ + +/* ------------------------ GL_NV_light_max_exponent ----------------------- */ + +#ifndef GL_NV_light_max_exponent +#define GL_NV_light_max_exponent 1 + +#define GL_MAX_SHININESS_NV 0x8504 +#define GL_MAX_SPOT_EXPONENT_NV 0x8505 + +#define GLEW_NV_light_max_exponent GLEW_GET_VAR(__GLEW_NV_light_max_exponent) + +#endif /* GL_NV_light_max_exponent */ + +/* ----------------------- GL_NV_multisample_coverage ---------------------- */ + +#ifndef GL_NV_multisample_coverage +#define GL_NV_multisample_coverage 1 + +#define GL_COLOR_SAMPLES_NV 0x8E20 + +#define GLEW_NV_multisample_coverage GLEW_GET_VAR(__GLEW_NV_multisample_coverage) + +#endif /* GL_NV_multisample_coverage */ + +/* --------------------- GL_NV_multisample_filter_hint --------------------- */ + +#ifndef GL_NV_multisample_filter_hint +#define GL_NV_multisample_filter_hint 1 + +#define GL_MULTISAMPLE_FILTER_HINT_NV 0x8534 + +#define GLEW_NV_multisample_filter_hint GLEW_GET_VAR(__GLEW_NV_multisample_filter_hint) + +#endif /* GL_NV_multisample_filter_hint */ + +/* ------------------------- GL_NV_occlusion_query ------------------------- */ + +#ifndef GL_NV_occlusion_query +#define GL_NV_occlusion_query 1 + +#define GL_PIXEL_COUNTER_BITS_NV 0x8864 +#define GL_CURRENT_OCCLUSION_QUERY_ID_NV 0x8865 +#define GL_PIXEL_COUNT_NV 0x8866 +#define GL_PIXEL_COUNT_AVAILABLE_NV 0x8867 + +typedef void (GLAPIENTRY * PFNGLBEGINOCCLUSIONQUERYNVPROC) (GLuint id); +typedef void (GLAPIENTRY * PFNGLDELETEOCCLUSIONQUERIESNVPROC) (GLsizei n, const GLuint* ids); +typedef void (GLAPIENTRY * PFNGLENDOCCLUSIONQUERYNVPROC) (void); +typedef void (GLAPIENTRY * PFNGLGENOCCLUSIONQUERIESNVPROC) (GLsizei n, GLuint* ids); +typedef void (GLAPIENTRY * PFNGLGETOCCLUSIONQUERYIVNVPROC) (GLuint id, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETOCCLUSIONQUERYUIVNVPROC) (GLuint id, GLenum pname, GLuint* params); +typedef GLboolean (GLAPIENTRY * PFNGLISOCCLUSIONQUERYNVPROC) (GLuint id); + +#define glBeginOcclusionQueryNV GLEW_GET_FUN(__glewBeginOcclusionQueryNV) +#define glDeleteOcclusionQueriesNV GLEW_GET_FUN(__glewDeleteOcclusionQueriesNV) +#define glEndOcclusionQueryNV GLEW_GET_FUN(__glewEndOcclusionQueryNV) +#define glGenOcclusionQueriesNV GLEW_GET_FUN(__glewGenOcclusionQueriesNV) +#define glGetOcclusionQueryivNV GLEW_GET_FUN(__glewGetOcclusionQueryivNV) +#define glGetOcclusionQueryuivNV GLEW_GET_FUN(__glewGetOcclusionQueryuivNV) +#define glIsOcclusionQueryNV GLEW_GET_FUN(__glewIsOcclusionQueryNV) + +#define GLEW_NV_occlusion_query GLEW_GET_VAR(__GLEW_NV_occlusion_query) + +#endif /* GL_NV_occlusion_query */ + +/* ----------------------- GL_NV_packed_depth_stencil ---------------------- */ + +#ifndef GL_NV_packed_depth_stencil +#define GL_NV_packed_depth_stencil 1 + +#define GL_DEPTH_STENCIL_NV 0x84F9 +#define GL_UNSIGNED_INT_24_8_NV 0x84FA + +#define GLEW_NV_packed_depth_stencil GLEW_GET_VAR(__GLEW_NV_packed_depth_stencil) + +#endif /* GL_NV_packed_depth_stencil */ + +/* --------------------- GL_NV_parameter_buffer_object --------------------- */ + +#ifndef GL_NV_parameter_buffer_object +#define GL_NV_parameter_buffer_object 1 + +#define GL_MAX_PROGRAM_PARAMETER_BUFFER_BINDINGS_NV 0x8DA0 +#define GL_MAX_PROGRAM_PARAMETER_BUFFER_SIZE_NV 0x8DA1 +#define GL_VERTEX_PROGRAM_PARAMETER_BUFFER_NV 0x8DA2 +#define GL_GEOMETRY_PROGRAM_PARAMETER_BUFFER_NV 0x8DA3 +#define GL_FRAGMENT_PROGRAM_PARAMETER_BUFFER_NV 0x8DA4 + +typedef void (GLAPIENTRY * PFNGLPROGRAMBUFFERPARAMETERSIIVNVPROC) (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLint *params); +typedef void (GLAPIENTRY * PFNGLPROGRAMBUFFERPARAMETERSIUIVNVPROC) (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLuint *params); +typedef void (GLAPIENTRY * PFNGLPROGRAMBUFFERPARAMETERSFVNVPROC) (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLfloat *params); + +#define glProgramBufferParametersIivNV GLEW_GET_FUN(__glewProgramBufferParametersIivNV) +#define glProgramBufferParametersIuivNV GLEW_GET_FUN(__glewProgramBufferParametersIuivNV) +#define glProgramBufferParametersfvNV GLEW_GET_FUN(__glewProgramBufferParametersfvNV) + +#define GLEW_NV_parameter_buffer_object GLEW_GET_VAR(__GLEW_NV_parameter_buffer_object) + +#endif /* GL_NV_parameter_buffer_object */ + +/* --------------------- GL_NV_parameter_buffer_object2 -------------------- */ + +#ifndef GL_NV_parameter_buffer_object2 +#define GL_NV_parameter_buffer_object2 1 + +#define GLEW_NV_parameter_buffer_object2 GLEW_GET_VAR(__GLEW_NV_parameter_buffer_object2) + +#endif /* GL_NV_parameter_buffer_object2 */ + +/* -------------------------- GL_NV_path_rendering ------------------------- */ + +#ifndef GL_NV_path_rendering +#define GL_NV_path_rendering 1 + +#define GL_CLOSE_PATH_NV 0x00 +#define GL_BOLD_BIT_NV 0x01 +#define GL_GLYPH_WIDTH_BIT_NV 0x01 +#define GL_GLYPH_HEIGHT_BIT_NV 0x02 +#define GL_ITALIC_BIT_NV 0x02 +#define GL_MOVE_TO_NV 0x02 +#define GL_RELATIVE_MOVE_TO_NV 0x03 +#define GL_LINE_TO_NV 0x04 +#define GL_GLYPH_HORIZONTAL_BEARING_X_BIT_NV 0x04 +#define GL_RELATIVE_LINE_TO_NV 0x05 +#define GL_HORIZONTAL_LINE_TO_NV 0x06 +#define GL_RELATIVE_HORIZONTAL_LINE_TO_NV 0x07 +#define GL_GLYPH_HORIZONTAL_BEARING_Y_BIT_NV 0x08 +#define GL_VERTICAL_LINE_TO_NV 0x08 +#define GL_RELATIVE_VERTICAL_LINE_TO_NV 0x09 +#define GL_QUADRATIC_CURVE_TO_NV 0x0A +#define GL_RELATIVE_QUADRATIC_CURVE_TO_NV 0x0B +#define GL_CUBIC_CURVE_TO_NV 0x0C +#define GL_RELATIVE_CUBIC_CURVE_TO_NV 0x0D +#define GL_SMOOTH_QUADRATIC_CURVE_TO_NV 0x0E +#define GL_RELATIVE_SMOOTH_QUADRATIC_CURVE_TO_NV 0x0F +#define GL_GLYPH_HORIZONTAL_BEARING_ADVANCE_BIT_NV 0x10 +#define GL_SMOOTH_CUBIC_CURVE_TO_NV 0x10 +#define GL_RELATIVE_SMOOTH_CUBIC_CURVE_TO_NV 0x11 +#define GL_SMALL_CCW_ARC_TO_NV 0x12 +#define GL_RELATIVE_SMALL_CCW_ARC_TO_NV 0x13 +#define GL_SMALL_CW_ARC_TO_NV 0x14 +#define GL_RELATIVE_SMALL_CW_ARC_TO_NV 0x15 +#define GL_LARGE_CCW_ARC_TO_NV 0x16 +#define GL_RELATIVE_LARGE_CCW_ARC_TO_NV 0x17 +#define GL_LARGE_CW_ARC_TO_NV 0x18 +#define GL_RELATIVE_LARGE_CW_ARC_TO_NV 0x19 +#define GL_GLYPH_VERTICAL_BEARING_X_BIT_NV 0x20 +#define GL_GLYPH_VERTICAL_BEARING_Y_BIT_NV 0x40 +#define GL_GLYPH_VERTICAL_BEARING_ADVANCE_BIT_NV 0x80 +#define GL_RESTART_PATH_NV 0xF0 +#define GL_DUP_FIRST_CUBIC_CURVE_TO_NV 0xF2 +#define GL_DUP_LAST_CUBIC_CURVE_TO_NV 0xF4 +#define GL_RECT_NV 0xF6 +#define GL_CIRCULAR_CCW_ARC_TO_NV 0xF8 +#define GL_CIRCULAR_CW_ARC_TO_NV 0xFA +#define GL_CIRCULAR_TANGENT_ARC_TO_NV 0xFC +#define GL_ARC_TO_NV 0xFE +#define GL_RELATIVE_ARC_TO_NV 0xFF +#define GL_GLYPH_HAS_KERNING_BIT_NV 0x100 +#define GL_PRIMARY_COLOR 0x8577 +#define GL_PATH_FORMAT_SVG_NV 0x9070 +#define GL_PATH_FORMAT_PS_NV 0x9071 +#define GL_STANDARD_FONT_NAME_NV 0x9072 +#define GL_SYSTEM_FONT_NAME_NV 0x9073 +#define GL_FILE_NAME_NV 0x9074 +#define GL_PATH_STROKE_WIDTH_NV 0x9075 +#define GL_PATH_END_CAPS_NV 0x9076 +#define GL_PATH_INITIAL_END_CAP_NV 0x9077 +#define GL_PATH_TERMINAL_END_CAP_NV 0x9078 +#define GL_PATH_JOIN_STYLE_NV 0x9079 +#define GL_PATH_MITER_LIMIT_NV 0x907A +#define GL_PATH_DASH_CAPS_NV 0x907B +#define GL_PATH_INITIAL_DASH_CAP_NV 0x907C +#define GL_PATH_TERMINAL_DASH_CAP_NV 0x907D +#define GL_PATH_DASH_OFFSET_NV 0x907E +#define GL_PATH_CLIENT_LENGTH_NV 0x907F +#define GL_PATH_FILL_MODE_NV 0x9080 +#define GL_PATH_FILL_MASK_NV 0x9081 +#define GL_PATH_FILL_COVER_MODE_NV 0x9082 +#define GL_PATH_STROKE_COVER_MODE_NV 0x9083 +#define GL_PATH_STROKE_MASK_NV 0x9084 +#define GL_COUNT_UP_NV 0x9088 +#define GL_COUNT_DOWN_NV 0x9089 +#define GL_PATH_OBJECT_BOUNDING_BOX_NV 0x908A +#define GL_CONVEX_HULL_NV 0x908B +#define GL_BOUNDING_BOX_NV 0x908D +#define GL_TRANSLATE_X_NV 0x908E +#define GL_TRANSLATE_Y_NV 0x908F +#define GL_TRANSLATE_2D_NV 0x9090 +#define GL_TRANSLATE_3D_NV 0x9091 +#define GL_AFFINE_2D_NV 0x9092 +#define GL_AFFINE_3D_NV 0x9094 +#define GL_TRANSPOSE_AFFINE_2D_NV 0x9096 +#define GL_TRANSPOSE_AFFINE_3D_NV 0x9098 +#define GL_UTF8_NV 0x909A +#define GL_UTF16_NV 0x909B +#define GL_BOUNDING_BOX_OF_BOUNDING_BOXES_NV 0x909C +#define GL_PATH_COMMAND_COUNT_NV 0x909D +#define GL_PATH_COORD_COUNT_NV 0x909E +#define GL_PATH_DASH_ARRAY_COUNT_NV 0x909F +#define GL_PATH_COMPUTED_LENGTH_NV 0x90A0 +#define GL_PATH_FILL_BOUNDING_BOX_NV 0x90A1 +#define GL_PATH_STROKE_BOUNDING_BOX_NV 0x90A2 +#define GL_SQUARE_NV 0x90A3 +#define GL_ROUND_NV 0x90A4 +#define GL_TRIANGULAR_NV 0x90A5 +#define GL_BEVEL_NV 0x90A6 +#define GL_MITER_REVERT_NV 0x90A7 +#define GL_MITER_TRUNCATE_NV 0x90A8 +#define GL_SKIP_MISSING_GLYPH_NV 0x90A9 +#define GL_USE_MISSING_GLYPH_NV 0x90AA +#define GL_PATH_ERROR_POSITION_NV 0x90AB +#define GL_PATH_FOG_GEN_MODE_NV 0x90AC +#define GL_ACCUM_ADJACENT_PAIRS_NV 0x90AD +#define GL_ADJACENT_PAIRS_NV 0x90AE +#define GL_FIRST_TO_REST_NV 0x90AF +#define GL_PATH_GEN_MODE_NV 0x90B0 +#define GL_PATH_GEN_COEFF_NV 0x90B1 +#define GL_PATH_GEN_COLOR_FORMAT_NV 0x90B2 +#define GL_PATH_GEN_COMPONENTS_NV 0x90B3 +#define GL_PATH_DASH_OFFSET_RESET_NV 0x90B4 +#define GL_MOVE_TO_RESETS_NV 0x90B5 +#define GL_MOVE_TO_CONTINUES_NV 0x90B6 +#define GL_PATH_STENCIL_FUNC_NV 0x90B7 +#define GL_PATH_STENCIL_REF_NV 0x90B8 +#define GL_PATH_STENCIL_VALUE_MASK_NV 0x90B9 +#define GL_PATH_STENCIL_DEPTH_OFFSET_FACTOR_NV 0x90BD +#define GL_PATH_STENCIL_DEPTH_OFFSET_UNITS_NV 0x90BE +#define GL_PATH_COVER_DEPTH_FUNC_NV 0x90BF +#define GL_FONT_X_MIN_BOUNDS_BIT_NV 0x00010000 +#define GL_FONT_Y_MIN_BOUNDS_BIT_NV 0x00020000 +#define GL_FONT_X_MAX_BOUNDS_BIT_NV 0x00040000 +#define GL_FONT_Y_MAX_BOUNDS_BIT_NV 0x00080000 +#define GL_FONT_UNITS_PER_EM_BIT_NV 0x00100000 +#define GL_FONT_ASCENDER_BIT_NV 0x00200000 +#define GL_FONT_DESCENDER_BIT_NV 0x00400000 +#define GL_FONT_HEIGHT_BIT_NV 0x00800000 +#define GL_FONT_MAX_ADVANCE_WIDTH_BIT_NV 0x01000000 +#define GL_FONT_MAX_ADVANCE_HEIGHT_BIT_NV 0x02000000 +#define GL_FONT_UNDERLINE_POSITION_BIT_NV 0x04000000 +#define GL_FONT_UNDERLINE_THICKNESS_BIT_NV 0x08000000 +#define GL_FONT_HAS_KERNING_BIT_NV 0x10000000 + +typedef void (GLAPIENTRY * PFNGLCOPYPATHNVPROC) (GLuint resultPath, GLuint srcPath); +typedef void (GLAPIENTRY * PFNGLCOVERFILLPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void* paths, GLuint pathBase, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); +typedef void (GLAPIENTRY * PFNGLCOVERFILLPATHNVPROC) (GLuint path, GLenum coverMode); +typedef void (GLAPIENTRY * PFNGLCOVERSTROKEPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void* paths, GLuint pathBase, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); +typedef void (GLAPIENTRY * PFNGLCOVERSTROKEPATHNVPROC) (GLuint name, GLenum coverMode); +typedef void (GLAPIENTRY * PFNGLDELETEPATHSNVPROC) (GLuint path, GLsizei range); +typedef GLuint (GLAPIENTRY * PFNGLGENPATHSNVPROC) (GLsizei range); +typedef void (GLAPIENTRY * PFNGLGETPATHCOLORGENFVNVPROC) (GLenum color, GLenum pname, GLfloat* value); +typedef void (GLAPIENTRY * PFNGLGETPATHCOLORGENIVNVPROC) (GLenum color, GLenum pname, GLint* value); +typedef void (GLAPIENTRY * PFNGLGETPATHCOMMANDSNVPROC) (GLuint name, GLubyte* commands); +typedef void (GLAPIENTRY * PFNGLGETPATHCOORDSNVPROC) (GLuint name, GLfloat* coords); +typedef void (GLAPIENTRY * PFNGLGETPATHDASHARRAYNVPROC) (GLuint name, GLfloat* dashArray); +typedef GLfloat (GLAPIENTRY * PFNGLGETPATHLENGTHNVPROC) (GLuint path, GLsizei startSegment, GLsizei numSegments); +typedef void (GLAPIENTRY * PFNGLGETPATHMETRICRANGENVPROC) (GLbitfield metricQueryMask, GLuint fistPathName, GLsizei numPaths, GLsizei stride, GLfloat* metrics); +typedef void (GLAPIENTRY * PFNGLGETPATHMETRICSNVPROC) (GLbitfield metricQueryMask, GLsizei numPaths, GLenum pathNameType, const void* paths, GLuint pathBase, GLsizei stride, GLfloat *metrics); +typedef void (GLAPIENTRY * PFNGLGETPATHPARAMETERFVNVPROC) (GLuint name, GLenum param, GLfloat* value); +typedef void (GLAPIENTRY * PFNGLGETPATHPARAMETERIVNVPROC) (GLuint name, GLenum param, GLint* value); +typedef void (GLAPIENTRY * PFNGLGETPATHSPACINGNVPROC) (GLenum pathListMode, GLsizei numPaths, GLenum pathNameType, const void* paths, GLuint pathBase, GLfloat advanceScale, GLfloat kerningScale, GLenum transformType, GLfloat *returnedSpacing); +typedef void (GLAPIENTRY * PFNGLGETPATHTEXGENFVNVPROC) (GLenum texCoordSet, GLenum pname, GLfloat* value); +typedef void (GLAPIENTRY * PFNGLGETPATHTEXGENIVNVPROC) (GLenum texCoordSet, GLenum pname, GLint* value); +typedef void (GLAPIENTRY * PFNGLINTERPOLATEPATHSNVPROC) (GLuint resultPath, GLuint pathA, GLuint pathB, GLfloat weight); +typedef GLboolean (GLAPIENTRY * PFNGLISPATHNVPROC) (GLuint path); +typedef GLboolean (GLAPIENTRY * PFNGLISPOINTINFILLPATHNVPROC) (GLuint path, GLuint mask, GLfloat x, GLfloat y); +typedef GLboolean (GLAPIENTRY * PFNGLISPOINTINSTROKEPATHNVPROC) (GLuint path, GLfloat x, GLfloat y); +typedef void (GLAPIENTRY * PFNGLPATHCOLORGENNVPROC) (GLenum color, GLenum genMode, GLenum colorFormat, const GLfloat* coeffs); +typedef void (GLAPIENTRY * PFNGLPATHCOMMANDSNVPROC) (GLuint path, GLsizei numCommands, const GLubyte* commands, GLsizei numCoords, GLenum coordType, const GLvoid*coords); +typedef void (GLAPIENTRY * PFNGLPATHCOORDSNVPROC) (GLuint path, GLsizei numCoords, GLenum coordType, const void* coords); +typedef void (GLAPIENTRY * PFNGLPATHCOVERDEPTHFUNCNVPROC) (GLenum zfunc); +typedef void (GLAPIENTRY * PFNGLPATHDASHARRAYNVPROC) (GLuint path, GLsizei dashCount, const GLfloat* dashArray); +typedef void (GLAPIENTRY * PFNGLPATHFOGGENNVPROC) (GLenum genMode); +typedef void (GLAPIENTRY * PFNGLPATHGLYPHRANGENVPROC) (GLuint firstPathName, GLenum fontTarget, const void* fontName, GLbitfield fontStyle, GLuint firstGlyph, GLsizei numGlyphs, GLenum handleMissingGlyphs, GLuint pathParameterTemplate, GLfloat emScale); +typedef void (GLAPIENTRY * PFNGLPATHGLYPHSNVPROC) (GLuint firstPathName, GLenum fontTarget, const void* fontName, GLbitfield fontStyle, GLsizei numGlyphs, GLenum type, const GLvoid*charcodes, GLenum handleMissingGlyphs, GLuint pathParameterTemplate, GLfloat emScale); +typedef void (GLAPIENTRY * PFNGLPATHPARAMETERFNVPROC) (GLuint path, GLenum pname, GLfloat value); +typedef void (GLAPIENTRY * PFNGLPATHPARAMETERFVNVPROC) (GLuint path, GLenum pname, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPATHPARAMETERINVPROC) (GLuint path, GLenum pname, GLint value); +typedef void (GLAPIENTRY * PFNGLPATHPARAMETERIVNVPROC) (GLuint path, GLenum pname, const GLint* value); +typedef void (GLAPIENTRY * PFNGLPATHSTENCILDEPTHOFFSETNVPROC) (GLfloat factor, GLfloat units); +typedef void (GLAPIENTRY * PFNGLPATHSTENCILFUNCNVPROC) (GLenum func, GLint ref, GLuint mask); +typedef void (GLAPIENTRY * PFNGLPATHSTRINGNVPROC) (GLuint path, GLenum format, GLsizei length, const void* pathString); +typedef void (GLAPIENTRY * PFNGLPATHSUBCOMMANDSNVPROC) (GLuint path, GLsizei commandStart, GLsizei commandsToDelete, GLsizei numCommands, const GLubyte* commands, GLsizei numCoords, GLenum coordType, const GLvoid*coords); +typedef void (GLAPIENTRY * PFNGLPATHSUBCOORDSNVPROC) (GLuint path, GLsizei coordStart, GLsizei numCoords, GLenum coordType, const void* coords); +typedef void (GLAPIENTRY * PFNGLPATHTEXGENNVPROC) (GLenum texCoordSet, GLenum genMode, GLint components, const GLfloat* coeffs); +typedef GLboolean (GLAPIENTRY * PFNGLPOINTALONGPATHNVPROC) (GLuint path, GLsizei startSegment, GLsizei numSegments, GLfloat distance, GLfloat* x, GLfloat *y, GLfloat *tangentX, GLfloat *tangentY); +typedef void (GLAPIENTRY * PFNGLSTENCILFILLPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void* paths, GLuint pathBase, GLenum fillMode, GLuint mask, GLenum transformType, const GLfloat *transformValues); +typedef void (GLAPIENTRY * PFNGLSTENCILFILLPATHNVPROC) (GLuint path, GLenum fillMode, GLuint mask); +typedef void (GLAPIENTRY * PFNGLSTENCILSTROKEPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void* paths, GLuint pathBase, GLint reference, GLuint mask, GLenum transformType, const GLfloat *transformValues); +typedef void (GLAPIENTRY * PFNGLSTENCILSTROKEPATHNVPROC) (GLuint path, GLint reference, GLuint mask); +typedef void (GLAPIENTRY * PFNGLTRANSFORMPATHNVPROC) (GLuint resultPath, GLuint srcPath, GLenum transformType, const GLfloat* transformValues); +typedef void (GLAPIENTRY * PFNGLWEIGHTPATHSNVPROC) (GLuint resultPath, GLsizei numPaths, const GLuint paths[], const GLfloat weights[]); + +#define glCopyPathNV GLEW_GET_FUN(__glewCopyPathNV) +#define glCoverFillPathInstancedNV GLEW_GET_FUN(__glewCoverFillPathInstancedNV) +#define glCoverFillPathNV GLEW_GET_FUN(__glewCoverFillPathNV) +#define glCoverStrokePathInstancedNV GLEW_GET_FUN(__glewCoverStrokePathInstancedNV) +#define glCoverStrokePathNV GLEW_GET_FUN(__glewCoverStrokePathNV) +#define glDeletePathsNV GLEW_GET_FUN(__glewDeletePathsNV) +#define glGenPathsNV GLEW_GET_FUN(__glewGenPathsNV) +#define glGetPathColorGenfvNV GLEW_GET_FUN(__glewGetPathColorGenfvNV) +#define glGetPathColorGenivNV GLEW_GET_FUN(__glewGetPathColorGenivNV) +#define glGetPathCommandsNV GLEW_GET_FUN(__glewGetPathCommandsNV) +#define glGetPathCoordsNV GLEW_GET_FUN(__glewGetPathCoordsNV) +#define glGetPathDashArrayNV GLEW_GET_FUN(__glewGetPathDashArrayNV) +#define glGetPathLengthNV GLEW_GET_FUN(__glewGetPathLengthNV) +#define glGetPathMetricRangeNV GLEW_GET_FUN(__glewGetPathMetricRangeNV) +#define glGetPathMetricsNV GLEW_GET_FUN(__glewGetPathMetricsNV) +#define glGetPathParameterfvNV GLEW_GET_FUN(__glewGetPathParameterfvNV) +#define glGetPathParameterivNV GLEW_GET_FUN(__glewGetPathParameterivNV) +#define glGetPathSpacingNV GLEW_GET_FUN(__glewGetPathSpacingNV) +#define glGetPathTexGenfvNV GLEW_GET_FUN(__glewGetPathTexGenfvNV) +#define glGetPathTexGenivNV GLEW_GET_FUN(__glewGetPathTexGenivNV) +#define glInterpolatePathsNV GLEW_GET_FUN(__glewInterpolatePathsNV) +#define glIsPathNV GLEW_GET_FUN(__glewIsPathNV) +#define glIsPointInFillPathNV GLEW_GET_FUN(__glewIsPointInFillPathNV) +#define glIsPointInStrokePathNV GLEW_GET_FUN(__glewIsPointInStrokePathNV) +#define glPathColorGenNV GLEW_GET_FUN(__glewPathColorGenNV) +#define glPathCommandsNV GLEW_GET_FUN(__glewPathCommandsNV) +#define glPathCoordsNV GLEW_GET_FUN(__glewPathCoordsNV) +#define glPathCoverDepthFuncNV GLEW_GET_FUN(__glewPathCoverDepthFuncNV) +#define glPathDashArrayNV GLEW_GET_FUN(__glewPathDashArrayNV) +#define glPathFogGenNV GLEW_GET_FUN(__glewPathFogGenNV) +#define glPathGlyphRangeNV GLEW_GET_FUN(__glewPathGlyphRangeNV) +#define glPathGlyphsNV GLEW_GET_FUN(__glewPathGlyphsNV) +#define glPathParameterfNV GLEW_GET_FUN(__glewPathParameterfNV) +#define glPathParameterfvNV GLEW_GET_FUN(__glewPathParameterfvNV) +#define glPathParameteriNV GLEW_GET_FUN(__glewPathParameteriNV) +#define glPathParameterivNV GLEW_GET_FUN(__glewPathParameterivNV) +#define glPathStencilDepthOffsetNV GLEW_GET_FUN(__glewPathStencilDepthOffsetNV) +#define glPathStencilFuncNV GLEW_GET_FUN(__glewPathStencilFuncNV) +#define glPathStringNV GLEW_GET_FUN(__glewPathStringNV) +#define glPathSubCommandsNV GLEW_GET_FUN(__glewPathSubCommandsNV) +#define glPathSubCoordsNV GLEW_GET_FUN(__glewPathSubCoordsNV) +#define glPathTexGenNV GLEW_GET_FUN(__glewPathTexGenNV) +#define glPointAlongPathNV GLEW_GET_FUN(__glewPointAlongPathNV) +#define glStencilFillPathInstancedNV GLEW_GET_FUN(__glewStencilFillPathInstancedNV) +#define glStencilFillPathNV GLEW_GET_FUN(__glewStencilFillPathNV) +#define glStencilStrokePathInstancedNV GLEW_GET_FUN(__glewStencilStrokePathInstancedNV) +#define glStencilStrokePathNV GLEW_GET_FUN(__glewStencilStrokePathNV) +#define glTransformPathNV GLEW_GET_FUN(__glewTransformPathNV) +#define glWeightPathsNV GLEW_GET_FUN(__glewWeightPathsNV) + +#define GLEW_NV_path_rendering GLEW_GET_VAR(__GLEW_NV_path_rendering) + +#endif /* GL_NV_path_rendering */ + +/* ------------------------- GL_NV_pixel_data_range ------------------------ */ + +#ifndef GL_NV_pixel_data_range +#define GL_NV_pixel_data_range 1 + +#define GL_WRITE_PIXEL_DATA_RANGE_NV 0x8878 +#define GL_READ_PIXEL_DATA_RANGE_NV 0x8879 +#define GL_WRITE_PIXEL_DATA_RANGE_LENGTH_NV 0x887A +#define GL_READ_PIXEL_DATA_RANGE_LENGTH_NV 0x887B +#define GL_WRITE_PIXEL_DATA_RANGE_POINTER_NV 0x887C +#define GL_READ_PIXEL_DATA_RANGE_POINTER_NV 0x887D + +typedef void (GLAPIENTRY * PFNGLFLUSHPIXELDATARANGENVPROC) (GLenum target); +typedef void (GLAPIENTRY * PFNGLPIXELDATARANGENVPROC) (GLenum target, GLsizei length, GLvoid *pointer); + +#define glFlushPixelDataRangeNV GLEW_GET_FUN(__glewFlushPixelDataRangeNV) +#define glPixelDataRangeNV GLEW_GET_FUN(__glewPixelDataRangeNV) + +#define GLEW_NV_pixel_data_range GLEW_GET_VAR(__GLEW_NV_pixel_data_range) + +#endif /* GL_NV_pixel_data_range */ + +/* --------------------------- GL_NV_point_sprite -------------------------- */ + +#ifndef GL_NV_point_sprite +#define GL_NV_point_sprite 1 + +#define GL_POINT_SPRITE_NV 0x8861 +#define GL_COORD_REPLACE_NV 0x8862 +#define GL_POINT_SPRITE_R_MODE_NV 0x8863 + +typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERINVPROC) (GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERIVNVPROC) (GLenum pname, const GLint* params); + +#define glPointParameteriNV GLEW_GET_FUN(__glewPointParameteriNV) +#define glPointParameterivNV GLEW_GET_FUN(__glewPointParameterivNV) + +#define GLEW_NV_point_sprite GLEW_GET_VAR(__GLEW_NV_point_sprite) + +#endif /* GL_NV_point_sprite */ + +/* -------------------------- GL_NV_present_video -------------------------- */ + +#ifndef GL_NV_present_video +#define GL_NV_present_video 1 + +#define GL_FRAME_NV 0x8E26 +#define GL_FIELDS_NV 0x8E27 +#define GL_CURRENT_TIME_NV 0x8E28 +#define GL_NUM_FILL_STREAMS_NV 0x8E29 +#define GL_PRESENT_TIME_NV 0x8E2A +#define GL_PRESENT_DURATION_NV 0x8E2B + +typedef void (GLAPIENTRY * PFNGLGETVIDEOI64VNVPROC) (GLuint video_slot, GLenum pname, GLint64EXT* params); +typedef void (GLAPIENTRY * PFNGLGETVIDEOIVNVPROC) (GLuint video_slot, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETVIDEOUI64VNVPROC) (GLuint video_slot, GLenum pname, GLuint64EXT* params); +typedef void (GLAPIENTRY * PFNGLGETVIDEOUIVNVPROC) (GLuint video_slot, GLenum pname, GLuint* params); +typedef void (GLAPIENTRY * PFNGLPRESENTFRAMEDUALFILLNVPROC) (GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLenum target1, GLuint fill1, GLenum target2, GLuint fill2, GLenum target3, GLuint fill3); +typedef void (GLAPIENTRY * PFNGLPRESENTFRAMEKEYEDNVPROC) (GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLuint key0, GLenum target1, GLuint fill1, GLuint key1); + +#define glGetVideoi64vNV GLEW_GET_FUN(__glewGetVideoi64vNV) +#define glGetVideoivNV GLEW_GET_FUN(__glewGetVideoivNV) +#define glGetVideoui64vNV GLEW_GET_FUN(__glewGetVideoui64vNV) +#define glGetVideouivNV GLEW_GET_FUN(__glewGetVideouivNV) +#define glPresentFrameDualFillNV GLEW_GET_FUN(__glewPresentFrameDualFillNV) +#define glPresentFrameKeyedNV GLEW_GET_FUN(__glewPresentFrameKeyedNV) + +#define GLEW_NV_present_video GLEW_GET_VAR(__GLEW_NV_present_video) + +#endif /* GL_NV_present_video */ + +/* ------------------------ GL_NV_primitive_restart ------------------------ */ + +#ifndef GL_NV_primitive_restart +#define GL_NV_primitive_restart 1 + +#define GL_PRIMITIVE_RESTART_NV 0x8558 +#define GL_PRIMITIVE_RESTART_INDEX_NV 0x8559 + +typedef void (GLAPIENTRY * PFNGLPRIMITIVERESTARTINDEXNVPROC) (GLuint index); +typedef void (GLAPIENTRY * PFNGLPRIMITIVERESTARTNVPROC) (void); + +#define glPrimitiveRestartIndexNV GLEW_GET_FUN(__glewPrimitiveRestartIndexNV) +#define glPrimitiveRestartNV GLEW_GET_FUN(__glewPrimitiveRestartNV) + +#define GLEW_NV_primitive_restart GLEW_GET_VAR(__GLEW_NV_primitive_restart) + +#endif /* GL_NV_primitive_restart */ + +/* ------------------------ GL_NV_register_combiners ----------------------- */ + +#ifndef GL_NV_register_combiners +#define GL_NV_register_combiners 1 + +#define GL_REGISTER_COMBINERS_NV 0x8522 +#define GL_VARIABLE_A_NV 0x8523 +#define GL_VARIABLE_B_NV 0x8524 +#define GL_VARIABLE_C_NV 0x8525 +#define GL_VARIABLE_D_NV 0x8526 +#define GL_VARIABLE_E_NV 0x8527 +#define GL_VARIABLE_F_NV 0x8528 +#define GL_VARIABLE_G_NV 0x8529 +#define GL_CONSTANT_COLOR0_NV 0x852A +#define GL_CONSTANT_COLOR1_NV 0x852B +#define GL_PRIMARY_COLOR_NV 0x852C +#define GL_SECONDARY_COLOR_NV 0x852D +#define GL_SPARE0_NV 0x852E +#define GL_SPARE1_NV 0x852F +#define GL_DISCARD_NV 0x8530 +#define GL_E_TIMES_F_NV 0x8531 +#define GL_SPARE0_PLUS_SECONDARY_COLOR_NV 0x8532 +#define GL_UNSIGNED_IDENTITY_NV 0x8536 +#define GL_UNSIGNED_INVERT_NV 0x8537 +#define GL_EXPAND_NORMAL_NV 0x8538 +#define GL_EXPAND_NEGATE_NV 0x8539 +#define GL_HALF_BIAS_NORMAL_NV 0x853A +#define GL_HALF_BIAS_NEGATE_NV 0x853B +#define GL_SIGNED_IDENTITY_NV 0x853C +#define GL_SIGNED_NEGATE_NV 0x853D +#define GL_SCALE_BY_TWO_NV 0x853E +#define GL_SCALE_BY_FOUR_NV 0x853F +#define GL_SCALE_BY_ONE_HALF_NV 0x8540 +#define GL_BIAS_BY_NEGATIVE_ONE_HALF_NV 0x8541 +#define GL_COMBINER_INPUT_NV 0x8542 +#define GL_COMBINER_MAPPING_NV 0x8543 +#define GL_COMBINER_COMPONENT_USAGE_NV 0x8544 +#define GL_COMBINER_AB_DOT_PRODUCT_NV 0x8545 +#define GL_COMBINER_CD_DOT_PRODUCT_NV 0x8546 +#define GL_COMBINER_MUX_SUM_NV 0x8547 +#define GL_COMBINER_SCALE_NV 0x8548 +#define GL_COMBINER_BIAS_NV 0x8549 +#define GL_COMBINER_AB_OUTPUT_NV 0x854A +#define GL_COMBINER_CD_OUTPUT_NV 0x854B +#define GL_COMBINER_SUM_OUTPUT_NV 0x854C +#define GL_MAX_GENERAL_COMBINERS_NV 0x854D +#define GL_NUM_GENERAL_COMBINERS_NV 0x854E +#define GL_COLOR_SUM_CLAMP_NV 0x854F +#define GL_COMBINER0_NV 0x8550 +#define GL_COMBINER1_NV 0x8551 +#define GL_COMBINER2_NV 0x8552 +#define GL_COMBINER3_NV 0x8553 +#define GL_COMBINER4_NV 0x8554 +#define GL_COMBINER5_NV 0x8555 +#define GL_COMBINER6_NV 0x8556 +#define GL_COMBINER7_NV 0x8557 + +typedef void (GLAPIENTRY * PFNGLCOMBINERINPUTNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); +typedef void (GLAPIENTRY * PFNGLCOMBINEROUTPUTNVPROC) (GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum); +typedef void (GLAPIENTRY * PFNGLCOMBINERPARAMETERFNVPROC) (GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLCOMBINERPARAMETERFVNVPROC) (GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLCOMBINERPARAMETERINVPROC) (GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLCOMBINERPARAMETERIVNVPROC) (GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLFINALCOMBINERINPUTNVPROC) (GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); +typedef void (GLAPIENTRY * PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC) (GLenum variable, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC) (GLenum variable, GLenum pname, GLint* params); + +#define glCombinerInputNV GLEW_GET_FUN(__glewCombinerInputNV) +#define glCombinerOutputNV GLEW_GET_FUN(__glewCombinerOutputNV) +#define glCombinerParameterfNV GLEW_GET_FUN(__glewCombinerParameterfNV) +#define glCombinerParameterfvNV GLEW_GET_FUN(__glewCombinerParameterfvNV) +#define glCombinerParameteriNV GLEW_GET_FUN(__glewCombinerParameteriNV) +#define glCombinerParameterivNV GLEW_GET_FUN(__glewCombinerParameterivNV) +#define glFinalCombinerInputNV GLEW_GET_FUN(__glewFinalCombinerInputNV) +#define glGetCombinerInputParameterfvNV GLEW_GET_FUN(__glewGetCombinerInputParameterfvNV) +#define glGetCombinerInputParameterivNV GLEW_GET_FUN(__glewGetCombinerInputParameterivNV) +#define glGetCombinerOutputParameterfvNV GLEW_GET_FUN(__glewGetCombinerOutputParameterfvNV) +#define glGetCombinerOutputParameterivNV GLEW_GET_FUN(__glewGetCombinerOutputParameterivNV) +#define glGetFinalCombinerInputParameterfvNV GLEW_GET_FUN(__glewGetFinalCombinerInputParameterfvNV) +#define glGetFinalCombinerInputParameterivNV GLEW_GET_FUN(__glewGetFinalCombinerInputParameterivNV) + +#define GLEW_NV_register_combiners GLEW_GET_VAR(__GLEW_NV_register_combiners) + +#endif /* GL_NV_register_combiners */ + +/* ----------------------- GL_NV_register_combiners2 ----------------------- */ + +#ifndef GL_NV_register_combiners2 +#define GL_NV_register_combiners2 1 + +#define GL_PER_STAGE_CONSTANTS_NV 0x8535 + +typedef void (GLAPIENTRY * PFNGLCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage, GLenum pname, GLfloat* params); + +#define glCombinerStageParameterfvNV GLEW_GET_FUN(__glewCombinerStageParameterfvNV) +#define glGetCombinerStageParameterfvNV GLEW_GET_FUN(__glewGetCombinerStageParameterfvNV) + +#define GLEW_NV_register_combiners2 GLEW_GET_VAR(__GLEW_NV_register_combiners2) + +#endif /* GL_NV_register_combiners2 */ + +/* ---------------------- GL_NV_shader_atomic_counters --------------------- */ + +#ifndef GL_NV_shader_atomic_counters +#define GL_NV_shader_atomic_counters 1 + +#define GLEW_NV_shader_atomic_counters GLEW_GET_VAR(__GLEW_NV_shader_atomic_counters) + +#endif /* GL_NV_shader_atomic_counters */ + +/* ----------------------- GL_NV_shader_atomic_float ----------------------- */ + +#ifndef GL_NV_shader_atomic_float +#define GL_NV_shader_atomic_float 1 + +#define GLEW_NV_shader_atomic_float GLEW_GET_VAR(__GLEW_NV_shader_atomic_float) + +#endif /* GL_NV_shader_atomic_float */ + +/* ------------------------ GL_NV_shader_buffer_load ----------------------- */ + +#ifndef GL_NV_shader_buffer_load +#define GL_NV_shader_buffer_load 1 + +#define GL_BUFFER_GPU_ADDRESS_NV 0x8F1D +#define GL_GPU_ADDRESS_NV 0x8F34 +#define GL_MAX_SHADER_BUFFER_ADDRESS_NV 0x8F35 + +typedef void (GLAPIENTRY * PFNGLGETBUFFERPARAMETERUI64VNVPROC) (GLenum target, GLenum pname, GLuint64EXT* params); +typedef void (GLAPIENTRY * PFNGLGETINTEGERUI64VNVPROC) (GLenum value, GLuint64EXT* result); +typedef void (GLAPIENTRY * PFNGLGETNAMEDBUFFERPARAMETERUI64VNVPROC) (GLuint buffer, GLenum pname, GLuint64EXT* params); +typedef GLboolean (GLAPIENTRY * PFNGLISBUFFERRESIDENTNVPROC) (GLenum target); +typedef GLboolean (GLAPIENTRY * PFNGLISNAMEDBUFFERRESIDENTNVPROC) (GLuint buffer); +typedef void (GLAPIENTRY * PFNGLMAKEBUFFERNONRESIDENTNVPROC) (GLenum target); +typedef void (GLAPIENTRY * PFNGLMAKEBUFFERRESIDENTNVPROC) (GLenum target, GLenum access); +typedef void (GLAPIENTRY * PFNGLMAKENAMEDBUFFERNONRESIDENTNVPROC) (GLuint buffer); +typedef void (GLAPIENTRY * PFNGLMAKENAMEDBUFFERRESIDENTNVPROC) (GLuint buffer, GLenum access); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMUI64NVPROC) (GLuint program, GLint location, GLuint64EXT value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMUI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMUI64NVPROC) (GLint location, GLuint64EXT value); +typedef void (GLAPIENTRY * PFNGLUNIFORMUI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT* value); + +#define glGetBufferParameterui64vNV GLEW_GET_FUN(__glewGetBufferParameterui64vNV) +#define glGetIntegerui64vNV GLEW_GET_FUN(__glewGetIntegerui64vNV) +#define glGetNamedBufferParameterui64vNV GLEW_GET_FUN(__glewGetNamedBufferParameterui64vNV) +#define glIsBufferResidentNV GLEW_GET_FUN(__glewIsBufferResidentNV) +#define glIsNamedBufferResidentNV GLEW_GET_FUN(__glewIsNamedBufferResidentNV) +#define glMakeBufferNonResidentNV GLEW_GET_FUN(__glewMakeBufferNonResidentNV) +#define glMakeBufferResidentNV GLEW_GET_FUN(__glewMakeBufferResidentNV) +#define glMakeNamedBufferNonResidentNV GLEW_GET_FUN(__glewMakeNamedBufferNonResidentNV) +#define glMakeNamedBufferResidentNV GLEW_GET_FUN(__glewMakeNamedBufferResidentNV) +#define glProgramUniformui64NV GLEW_GET_FUN(__glewProgramUniformui64NV) +#define glProgramUniformui64vNV GLEW_GET_FUN(__glewProgramUniformui64vNV) +#define glUniformui64NV GLEW_GET_FUN(__glewUniformui64NV) +#define glUniformui64vNV GLEW_GET_FUN(__glewUniformui64vNV) + +#define GLEW_NV_shader_buffer_load GLEW_GET_VAR(__GLEW_NV_shader_buffer_load) + +#endif /* GL_NV_shader_buffer_load */ + +/* ------------------- GL_NV_shader_storage_buffer_object ------------------ */ + +#ifndef GL_NV_shader_storage_buffer_object +#define GL_NV_shader_storage_buffer_object 1 + +#define GLEW_NV_shader_storage_buffer_object GLEW_GET_VAR(__GLEW_NV_shader_storage_buffer_object) + +#endif /* GL_NV_shader_storage_buffer_object */ + +/* ---------------------- GL_NV_tessellation_program5 ---------------------- */ + +#ifndef GL_NV_tessellation_program5 +#define GL_NV_tessellation_program5 1 + +#define GL_MAX_PROGRAM_PATCH_ATTRIBS_NV 0x86D8 +#define GL_TESS_CONTROL_PROGRAM_NV 0x891E +#define GL_TESS_EVALUATION_PROGRAM_NV 0x891F +#define GL_TESS_CONTROL_PROGRAM_PARAMETER_BUFFER_NV 0x8C74 +#define GL_TESS_EVALUATION_PROGRAM_PARAMETER_BUFFER_NV 0x8C75 + +#define GLEW_NV_tessellation_program5 GLEW_GET_VAR(__GLEW_NV_tessellation_program5) + +#endif /* GL_NV_tessellation_program5 */ + +/* -------------------------- GL_NV_texgen_emboss -------------------------- */ + +#ifndef GL_NV_texgen_emboss +#define GL_NV_texgen_emboss 1 + +#define GL_EMBOSS_LIGHT_NV 0x855D +#define GL_EMBOSS_CONSTANT_NV 0x855E +#define GL_EMBOSS_MAP_NV 0x855F + +#define GLEW_NV_texgen_emboss GLEW_GET_VAR(__GLEW_NV_texgen_emboss) + +#endif /* GL_NV_texgen_emboss */ + +/* ------------------------ GL_NV_texgen_reflection ------------------------ */ + +#ifndef GL_NV_texgen_reflection +#define GL_NV_texgen_reflection 1 + +#define GL_NORMAL_MAP_NV 0x8511 +#define GL_REFLECTION_MAP_NV 0x8512 + +#define GLEW_NV_texgen_reflection GLEW_GET_VAR(__GLEW_NV_texgen_reflection) + +#endif /* GL_NV_texgen_reflection */ + +/* ------------------------- GL_NV_texture_barrier ------------------------- */ + +#ifndef GL_NV_texture_barrier +#define GL_NV_texture_barrier 1 + +typedef void (GLAPIENTRY * PFNGLTEXTUREBARRIERNVPROC) (void); + +#define glTextureBarrierNV GLEW_GET_FUN(__glewTextureBarrierNV) + +#define GLEW_NV_texture_barrier GLEW_GET_VAR(__GLEW_NV_texture_barrier) + +#endif /* GL_NV_texture_barrier */ + +/* --------------------- GL_NV_texture_compression_vtc --------------------- */ + +#ifndef GL_NV_texture_compression_vtc +#define GL_NV_texture_compression_vtc 1 + +#define GLEW_NV_texture_compression_vtc GLEW_GET_VAR(__GLEW_NV_texture_compression_vtc) + +#endif /* GL_NV_texture_compression_vtc */ + +/* ----------------------- GL_NV_texture_env_combine4 ---------------------- */ + +#ifndef GL_NV_texture_env_combine4 +#define GL_NV_texture_env_combine4 1 + +#define GL_COMBINE4_NV 0x8503 +#define GL_SOURCE3_RGB_NV 0x8583 +#define GL_SOURCE3_ALPHA_NV 0x858B +#define GL_OPERAND3_RGB_NV 0x8593 +#define GL_OPERAND3_ALPHA_NV 0x859B + +#define GLEW_NV_texture_env_combine4 GLEW_GET_VAR(__GLEW_NV_texture_env_combine4) + +#endif /* GL_NV_texture_env_combine4 */ + +/* ---------------------- GL_NV_texture_expand_normal ---------------------- */ + +#ifndef GL_NV_texture_expand_normal +#define GL_NV_texture_expand_normal 1 + +#define GL_TEXTURE_UNSIGNED_REMAP_MODE_NV 0x888F + +#define GLEW_NV_texture_expand_normal GLEW_GET_VAR(__GLEW_NV_texture_expand_normal) + +#endif /* GL_NV_texture_expand_normal */ + +/* ----------------------- GL_NV_texture_multisample ----------------------- */ + +#ifndef GL_NV_texture_multisample +#define GL_NV_texture_multisample 1 + +#define GL_TEXTURE_COVERAGE_SAMPLES_NV 0x9045 +#define GL_TEXTURE_COLOR_SAMPLES_NV 0x9046 + +typedef void (GLAPIENTRY * PFNGLTEXIMAGE2DMULTISAMPLECOVERAGENVPROC) (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations); +typedef void (GLAPIENTRY * PFNGLTEXIMAGE3DMULTISAMPLECOVERAGENVPROC) (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations); +typedef void (GLAPIENTRY * PFNGLTEXTUREIMAGE2DMULTISAMPLECOVERAGENVPROC) (GLuint texture, GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations); +typedef void (GLAPIENTRY * PFNGLTEXTUREIMAGE2DMULTISAMPLENVPROC) (GLuint texture, GLenum target, GLsizei samples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations); +typedef void (GLAPIENTRY * PFNGLTEXTUREIMAGE3DMULTISAMPLECOVERAGENVPROC) (GLuint texture, GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations); +typedef void (GLAPIENTRY * PFNGLTEXTUREIMAGE3DMULTISAMPLENVPROC) (GLuint texture, GLenum target, GLsizei samples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations); + +#define glTexImage2DMultisampleCoverageNV GLEW_GET_FUN(__glewTexImage2DMultisampleCoverageNV) +#define glTexImage3DMultisampleCoverageNV GLEW_GET_FUN(__glewTexImage3DMultisampleCoverageNV) +#define glTextureImage2DMultisampleCoverageNV GLEW_GET_FUN(__glewTextureImage2DMultisampleCoverageNV) +#define glTextureImage2DMultisampleNV GLEW_GET_FUN(__glewTextureImage2DMultisampleNV) +#define glTextureImage3DMultisampleCoverageNV GLEW_GET_FUN(__glewTextureImage3DMultisampleCoverageNV) +#define glTextureImage3DMultisampleNV GLEW_GET_FUN(__glewTextureImage3DMultisampleNV) + +#define GLEW_NV_texture_multisample GLEW_GET_VAR(__GLEW_NV_texture_multisample) + +#endif /* GL_NV_texture_multisample */ + +/* ------------------------ GL_NV_texture_rectangle ------------------------ */ + +#ifndef GL_NV_texture_rectangle +#define GL_NV_texture_rectangle 1 + +#define GL_TEXTURE_RECTANGLE_NV 0x84F5 +#define GL_TEXTURE_BINDING_RECTANGLE_NV 0x84F6 +#define GL_PROXY_TEXTURE_RECTANGLE_NV 0x84F7 +#define GL_MAX_RECTANGLE_TEXTURE_SIZE_NV 0x84F8 + +#define GLEW_NV_texture_rectangle GLEW_GET_VAR(__GLEW_NV_texture_rectangle) + +#endif /* GL_NV_texture_rectangle */ + +/* -------------------------- GL_NV_texture_shader ------------------------- */ + +#ifndef GL_NV_texture_shader +#define GL_NV_texture_shader 1 + +#define GL_OFFSET_TEXTURE_RECTANGLE_NV 0x864C +#define GL_OFFSET_TEXTURE_RECTANGLE_SCALE_NV 0x864D +#define GL_DOT_PRODUCT_TEXTURE_RECTANGLE_NV 0x864E +#define GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV 0x86D9 +#define GL_UNSIGNED_INT_S8_S8_8_8_NV 0x86DA +#define GL_UNSIGNED_INT_8_8_S8_S8_REV_NV 0x86DB +#define GL_DSDT_MAG_INTENSITY_NV 0x86DC +#define GL_SHADER_CONSISTENT_NV 0x86DD +#define GL_TEXTURE_SHADER_NV 0x86DE +#define GL_SHADER_OPERATION_NV 0x86DF +#define GL_CULL_MODES_NV 0x86E0 +#define GL_OFFSET_TEXTURE_2D_MATRIX_NV 0x86E1 +#define GL_OFFSET_TEXTURE_MATRIX_NV 0x86E1 +#define GL_OFFSET_TEXTURE_2D_SCALE_NV 0x86E2 +#define GL_OFFSET_TEXTURE_SCALE_NV 0x86E2 +#define GL_OFFSET_TEXTURE_BIAS_NV 0x86E3 +#define GL_OFFSET_TEXTURE_2D_BIAS_NV 0x86E3 +#define GL_PREVIOUS_TEXTURE_INPUT_NV 0x86E4 +#define GL_CONST_EYE_NV 0x86E5 +#define GL_PASS_THROUGH_NV 0x86E6 +#define GL_CULL_FRAGMENT_NV 0x86E7 +#define GL_OFFSET_TEXTURE_2D_NV 0x86E8 +#define GL_DEPENDENT_AR_TEXTURE_2D_NV 0x86E9 +#define GL_DEPENDENT_GB_TEXTURE_2D_NV 0x86EA +#define GL_DOT_PRODUCT_NV 0x86EC +#define GL_DOT_PRODUCT_DEPTH_REPLACE_NV 0x86ED +#define GL_DOT_PRODUCT_TEXTURE_2D_NV 0x86EE +#define GL_DOT_PRODUCT_TEXTURE_CUBE_MAP_NV 0x86F0 +#define GL_DOT_PRODUCT_DIFFUSE_CUBE_MAP_NV 0x86F1 +#define GL_DOT_PRODUCT_REFLECT_CUBE_MAP_NV 0x86F2 +#define GL_DOT_PRODUCT_CONST_EYE_REFLECT_CUBE_MAP_NV 0x86F3 +#define GL_HILO_NV 0x86F4 +#define GL_DSDT_NV 0x86F5 +#define GL_DSDT_MAG_NV 0x86F6 +#define GL_DSDT_MAG_VIB_NV 0x86F7 +#define GL_HILO16_NV 0x86F8 +#define GL_SIGNED_HILO_NV 0x86F9 +#define GL_SIGNED_HILO16_NV 0x86FA +#define GL_SIGNED_RGBA_NV 0x86FB +#define GL_SIGNED_RGBA8_NV 0x86FC +#define GL_SIGNED_RGB_NV 0x86FE +#define GL_SIGNED_RGB8_NV 0x86FF +#define GL_SIGNED_LUMINANCE_NV 0x8701 +#define GL_SIGNED_LUMINANCE8_NV 0x8702 +#define GL_SIGNED_LUMINANCE_ALPHA_NV 0x8703 +#define GL_SIGNED_LUMINANCE8_ALPHA8_NV 0x8704 +#define GL_SIGNED_ALPHA_NV 0x8705 +#define GL_SIGNED_ALPHA8_NV 0x8706 +#define GL_SIGNED_INTENSITY_NV 0x8707 +#define GL_SIGNED_INTENSITY8_NV 0x8708 +#define GL_DSDT8_NV 0x8709 +#define GL_DSDT8_MAG8_NV 0x870A +#define GL_DSDT8_MAG8_INTENSITY8_NV 0x870B +#define GL_SIGNED_RGB_UNSIGNED_ALPHA_NV 0x870C +#define GL_SIGNED_RGB8_UNSIGNED_ALPHA8_NV 0x870D +#define GL_HI_SCALE_NV 0x870E +#define GL_LO_SCALE_NV 0x870F +#define GL_DS_SCALE_NV 0x8710 +#define GL_DT_SCALE_NV 0x8711 +#define GL_MAGNITUDE_SCALE_NV 0x8712 +#define GL_VIBRANCE_SCALE_NV 0x8713 +#define GL_HI_BIAS_NV 0x8714 +#define GL_LO_BIAS_NV 0x8715 +#define GL_DS_BIAS_NV 0x8716 +#define GL_DT_BIAS_NV 0x8717 +#define GL_MAGNITUDE_BIAS_NV 0x8718 +#define GL_VIBRANCE_BIAS_NV 0x8719 +#define GL_TEXTURE_BORDER_VALUES_NV 0x871A +#define GL_TEXTURE_HI_SIZE_NV 0x871B +#define GL_TEXTURE_LO_SIZE_NV 0x871C +#define GL_TEXTURE_DS_SIZE_NV 0x871D +#define GL_TEXTURE_DT_SIZE_NV 0x871E +#define GL_TEXTURE_MAG_SIZE_NV 0x871F + +#define GLEW_NV_texture_shader GLEW_GET_VAR(__GLEW_NV_texture_shader) + +#endif /* GL_NV_texture_shader */ + +/* ------------------------- GL_NV_texture_shader2 ------------------------- */ + +#ifndef GL_NV_texture_shader2 +#define GL_NV_texture_shader2 1 + +#define GL_UNSIGNED_INT_S8_S8_8_8_NV 0x86DA +#define GL_UNSIGNED_INT_8_8_S8_S8_REV_NV 0x86DB +#define GL_DSDT_MAG_INTENSITY_NV 0x86DC +#define GL_DOT_PRODUCT_TEXTURE_3D_NV 0x86EF +#define GL_HILO_NV 0x86F4 +#define GL_DSDT_NV 0x86F5 +#define GL_DSDT_MAG_NV 0x86F6 +#define GL_DSDT_MAG_VIB_NV 0x86F7 +#define GL_HILO16_NV 0x86F8 +#define GL_SIGNED_HILO_NV 0x86F9 +#define GL_SIGNED_HILO16_NV 0x86FA +#define GL_SIGNED_RGBA_NV 0x86FB +#define GL_SIGNED_RGBA8_NV 0x86FC +#define GL_SIGNED_RGB_NV 0x86FE +#define GL_SIGNED_RGB8_NV 0x86FF +#define GL_SIGNED_LUMINANCE_NV 0x8701 +#define GL_SIGNED_LUMINANCE8_NV 0x8702 +#define GL_SIGNED_LUMINANCE_ALPHA_NV 0x8703 +#define GL_SIGNED_LUMINANCE8_ALPHA8_NV 0x8704 +#define GL_SIGNED_ALPHA_NV 0x8705 +#define GL_SIGNED_ALPHA8_NV 0x8706 +#define GL_SIGNED_INTENSITY_NV 0x8707 +#define GL_SIGNED_INTENSITY8_NV 0x8708 +#define GL_DSDT8_NV 0x8709 +#define GL_DSDT8_MAG8_NV 0x870A +#define GL_DSDT8_MAG8_INTENSITY8_NV 0x870B +#define GL_SIGNED_RGB_UNSIGNED_ALPHA_NV 0x870C +#define GL_SIGNED_RGB8_UNSIGNED_ALPHA8_NV 0x870D + +#define GLEW_NV_texture_shader2 GLEW_GET_VAR(__GLEW_NV_texture_shader2) + +#endif /* GL_NV_texture_shader2 */ + +/* ------------------------- GL_NV_texture_shader3 ------------------------- */ + +#ifndef GL_NV_texture_shader3 +#define GL_NV_texture_shader3 1 + +#define GL_OFFSET_PROJECTIVE_TEXTURE_2D_NV 0x8850 +#define GL_OFFSET_PROJECTIVE_TEXTURE_2D_SCALE_NV 0x8851 +#define GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_NV 0x8852 +#define GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_SCALE_NV 0x8853 +#define GL_OFFSET_HILO_TEXTURE_2D_NV 0x8854 +#define GL_OFFSET_HILO_TEXTURE_RECTANGLE_NV 0x8855 +#define GL_OFFSET_HILO_PROJECTIVE_TEXTURE_2D_NV 0x8856 +#define GL_OFFSET_HILO_PROJECTIVE_TEXTURE_RECTANGLE_NV 0x8857 +#define GL_DEPENDENT_HILO_TEXTURE_2D_NV 0x8858 +#define GL_DEPENDENT_RGB_TEXTURE_3D_NV 0x8859 +#define GL_DEPENDENT_RGB_TEXTURE_CUBE_MAP_NV 0x885A +#define GL_DOT_PRODUCT_PASS_THROUGH_NV 0x885B +#define GL_DOT_PRODUCT_TEXTURE_1D_NV 0x885C +#define GL_DOT_PRODUCT_AFFINE_DEPTH_REPLACE_NV 0x885D +#define GL_HILO8_NV 0x885E +#define GL_SIGNED_HILO8_NV 0x885F +#define GL_FORCE_BLUE_TO_ONE_NV 0x8860 + +#define GLEW_NV_texture_shader3 GLEW_GET_VAR(__GLEW_NV_texture_shader3) + +#endif /* GL_NV_texture_shader3 */ + +/* ------------------------ GL_NV_transform_feedback ----------------------- */ + +#ifndef GL_NV_transform_feedback +#define GL_NV_transform_feedback 1 + +#define GL_BACK_PRIMARY_COLOR_NV 0x8C77 +#define GL_BACK_SECONDARY_COLOR_NV 0x8C78 +#define GL_TEXTURE_COORD_NV 0x8C79 +#define GL_CLIP_DISTANCE_NV 0x8C7A +#define GL_VERTEX_ID_NV 0x8C7B +#define GL_PRIMITIVE_ID_NV 0x8C7C +#define GL_GENERIC_ATTRIB_NV 0x8C7D +#define GL_TRANSFORM_FEEDBACK_ATTRIBS_NV 0x8C7E +#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE_NV 0x8C7F +#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_NV 0x8C80 +#define GL_ACTIVE_VARYINGS_NV 0x8C81 +#define GL_ACTIVE_VARYING_MAX_LENGTH_NV 0x8C82 +#define GL_TRANSFORM_FEEDBACK_VARYINGS_NV 0x8C83 +#define GL_TRANSFORM_FEEDBACK_BUFFER_START_NV 0x8C84 +#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE_NV 0x8C85 +#define GL_TRANSFORM_FEEDBACK_RECORD_NV 0x8C86 +#define GL_PRIMITIVES_GENERATED_NV 0x8C87 +#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_NV 0x8C88 +#define GL_RASTERIZER_DISCARD_NV 0x8C89 +#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS_NV 0x8C8A +#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_NV 0x8C8B +#define GL_INTERLEAVED_ATTRIBS_NV 0x8C8C +#define GL_SEPARATE_ATTRIBS_NV 0x8C8D +#define GL_TRANSFORM_FEEDBACK_BUFFER_NV 0x8C8E +#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_NV 0x8C8F + +typedef void (GLAPIENTRY * PFNGLACTIVEVARYINGNVPROC) (GLuint program, const GLchar *name); +typedef void (GLAPIENTRY * PFNGLBEGINTRANSFORMFEEDBACKNVPROC) (GLenum primitiveMode); +typedef void (GLAPIENTRY * PFNGLBINDBUFFERBASENVPROC) (GLenum target, GLuint index, GLuint buffer); +typedef void (GLAPIENTRY * PFNGLBINDBUFFEROFFSETNVPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLBINDBUFFERRANGENVPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); +typedef void (GLAPIENTRY * PFNGLENDTRANSFORMFEEDBACKNVPROC) (void); +typedef void (GLAPIENTRY * PFNGLGETACTIVEVARYINGNVPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name); +typedef void (GLAPIENTRY * PFNGLGETTRANSFORMFEEDBACKVARYINGNVPROC) (GLuint program, GLuint index, GLint *location); +typedef GLint (GLAPIENTRY * PFNGLGETVARYINGLOCATIONNVPROC) (GLuint program, const GLchar *name); +typedef void (GLAPIENTRY * PFNGLTRANSFORMFEEDBACKATTRIBSNVPROC) (GLuint count, const GLint *attribs, GLenum bufferMode); +typedef void (GLAPIENTRY * PFNGLTRANSFORMFEEDBACKVARYINGSNVPROC) (GLuint program, GLsizei count, const GLint *locations, GLenum bufferMode); + +#define glActiveVaryingNV GLEW_GET_FUN(__glewActiveVaryingNV) +#define glBeginTransformFeedbackNV GLEW_GET_FUN(__glewBeginTransformFeedbackNV) +#define glBindBufferBaseNV GLEW_GET_FUN(__glewBindBufferBaseNV) +#define glBindBufferOffsetNV GLEW_GET_FUN(__glewBindBufferOffsetNV) +#define glBindBufferRangeNV GLEW_GET_FUN(__glewBindBufferRangeNV) +#define glEndTransformFeedbackNV GLEW_GET_FUN(__glewEndTransformFeedbackNV) +#define glGetActiveVaryingNV GLEW_GET_FUN(__glewGetActiveVaryingNV) +#define glGetTransformFeedbackVaryingNV GLEW_GET_FUN(__glewGetTransformFeedbackVaryingNV) +#define glGetVaryingLocationNV GLEW_GET_FUN(__glewGetVaryingLocationNV) +#define glTransformFeedbackAttribsNV GLEW_GET_FUN(__glewTransformFeedbackAttribsNV) +#define glTransformFeedbackVaryingsNV GLEW_GET_FUN(__glewTransformFeedbackVaryingsNV) + +#define GLEW_NV_transform_feedback GLEW_GET_VAR(__GLEW_NV_transform_feedback) + +#endif /* GL_NV_transform_feedback */ + +/* ----------------------- GL_NV_transform_feedback2 ----------------------- */ + +#ifndef GL_NV_transform_feedback2 +#define GL_NV_transform_feedback2 1 + +#define GL_TRANSFORM_FEEDBACK_NV 0x8E22 +#define GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED_NV 0x8E23 +#define GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE_NV 0x8E24 +#define GL_TRANSFORM_FEEDBACK_BINDING_NV 0x8E25 + +typedef void (GLAPIENTRY * PFNGLBINDTRANSFORMFEEDBACKNVPROC) (GLenum target, GLuint id); +typedef void (GLAPIENTRY * PFNGLDELETETRANSFORMFEEDBACKSNVPROC) (GLsizei n, const GLuint* ids); +typedef void (GLAPIENTRY * PFNGLDRAWTRANSFORMFEEDBACKNVPROC) (GLenum mode, GLuint id); +typedef void (GLAPIENTRY * PFNGLGENTRANSFORMFEEDBACKSNVPROC) (GLsizei n, GLuint* ids); +typedef GLboolean (GLAPIENTRY * PFNGLISTRANSFORMFEEDBACKNVPROC) (GLuint id); +typedef void (GLAPIENTRY * PFNGLPAUSETRANSFORMFEEDBACKNVPROC) (void); +typedef void (GLAPIENTRY * PFNGLRESUMETRANSFORMFEEDBACKNVPROC) (void); + +#define glBindTransformFeedbackNV GLEW_GET_FUN(__glewBindTransformFeedbackNV) +#define glDeleteTransformFeedbacksNV GLEW_GET_FUN(__glewDeleteTransformFeedbacksNV) +#define glDrawTransformFeedbackNV GLEW_GET_FUN(__glewDrawTransformFeedbackNV) +#define glGenTransformFeedbacksNV GLEW_GET_FUN(__glewGenTransformFeedbacksNV) +#define glIsTransformFeedbackNV GLEW_GET_FUN(__glewIsTransformFeedbackNV) +#define glPauseTransformFeedbackNV GLEW_GET_FUN(__glewPauseTransformFeedbackNV) +#define glResumeTransformFeedbackNV GLEW_GET_FUN(__glewResumeTransformFeedbackNV) + +#define GLEW_NV_transform_feedback2 GLEW_GET_VAR(__GLEW_NV_transform_feedback2) + +#endif /* GL_NV_transform_feedback2 */ + +/* -------------------------- GL_NV_vdpau_interop -------------------------- */ + +#ifndef GL_NV_vdpau_interop +#define GL_NV_vdpau_interop 1 + +#define GL_SURFACE_STATE_NV 0x86EB +#define GL_SURFACE_REGISTERED_NV 0x86FD +#define GL_SURFACE_MAPPED_NV 0x8700 +#define GL_WRITE_DISCARD_NV 0x88BE + +typedef GLintptr GLvdpauSurfaceNV; + +typedef void (GLAPIENTRY * PFNGLVDPAUFININVPROC) (void); +typedef void (GLAPIENTRY * PFNGLVDPAUGETSURFACEIVNVPROC) (GLvdpauSurfaceNV surface, GLenum pname, GLsizei bufSize, GLsizei* length, GLint *values); +typedef void (GLAPIENTRY * PFNGLVDPAUINITNVPROC) (const void* vdpDevice, const GLvoid*getProcAddress); +typedef void (GLAPIENTRY * PFNGLVDPAUISSURFACENVPROC) (GLvdpauSurfaceNV surface); +typedef void (GLAPIENTRY * PFNGLVDPAUMAPSURFACESNVPROC) (GLsizei numSurfaces, const GLvdpauSurfaceNV* surfaces); +typedef GLvdpauSurfaceNV (GLAPIENTRY * PFNGLVDPAUREGISTEROUTPUTSURFACENVPROC) (const void* vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames); +typedef GLvdpauSurfaceNV (GLAPIENTRY * PFNGLVDPAUREGISTERVIDEOSURFACENVPROC) (const void* vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames); +typedef void (GLAPIENTRY * PFNGLVDPAUSURFACEACCESSNVPROC) (GLvdpauSurfaceNV surface, GLenum access); +typedef void (GLAPIENTRY * PFNGLVDPAUUNMAPSURFACESNVPROC) (GLsizei numSurface, const GLvdpauSurfaceNV* surfaces); +typedef void (GLAPIENTRY * PFNGLVDPAUUNREGISTERSURFACENVPROC) (GLvdpauSurfaceNV surface); + +#define glVDPAUFiniNV GLEW_GET_FUN(__glewVDPAUFiniNV) +#define glVDPAUGetSurfaceivNV GLEW_GET_FUN(__glewVDPAUGetSurfaceivNV) +#define glVDPAUInitNV GLEW_GET_FUN(__glewVDPAUInitNV) +#define glVDPAUIsSurfaceNV GLEW_GET_FUN(__glewVDPAUIsSurfaceNV) +#define glVDPAUMapSurfacesNV GLEW_GET_FUN(__glewVDPAUMapSurfacesNV) +#define glVDPAURegisterOutputSurfaceNV GLEW_GET_FUN(__glewVDPAURegisterOutputSurfaceNV) +#define glVDPAURegisterVideoSurfaceNV GLEW_GET_FUN(__glewVDPAURegisterVideoSurfaceNV) +#define glVDPAUSurfaceAccessNV GLEW_GET_FUN(__glewVDPAUSurfaceAccessNV) +#define glVDPAUUnmapSurfacesNV GLEW_GET_FUN(__glewVDPAUUnmapSurfacesNV) +#define glVDPAUUnregisterSurfaceNV GLEW_GET_FUN(__glewVDPAUUnregisterSurfaceNV) + +#define GLEW_NV_vdpau_interop GLEW_GET_VAR(__GLEW_NV_vdpau_interop) + +#endif /* GL_NV_vdpau_interop */ + +/* ------------------------ GL_NV_vertex_array_range ----------------------- */ + +#ifndef GL_NV_vertex_array_range +#define GL_NV_vertex_array_range 1 + +#define GL_VERTEX_ARRAY_RANGE_NV 0x851D +#define GL_VERTEX_ARRAY_RANGE_LENGTH_NV 0x851E +#define GL_VERTEX_ARRAY_RANGE_VALID_NV 0x851F +#define GL_MAX_VERTEX_ARRAY_RANGE_ELEMENT_NV 0x8520 +#define GL_VERTEX_ARRAY_RANGE_POINTER_NV 0x8521 + +typedef void (GLAPIENTRY * PFNGLFLUSHVERTEXARRAYRANGENVPROC) (void); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYRANGENVPROC) (GLsizei length, GLvoid *pointer); + +#define glFlushVertexArrayRangeNV GLEW_GET_FUN(__glewFlushVertexArrayRangeNV) +#define glVertexArrayRangeNV GLEW_GET_FUN(__glewVertexArrayRangeNV) + +#define GLEW_NV_vertex_array_range GLEW_GET_VAR(__GLEW_NV_vertex_array_range) + +#endif /* GL_NV_vertex_array_range */ + +/* ----------------------- GL_NV_vertex_array_range2 ----------------------- */ + +#ifndef GL_NV_vertex_array_range2 +#define GL_NV_vertex_array_range2 1 + +#define GL_VERTEX_ARRAY_RANGE_WITHOUT_FLUSH_NV 0x8533 + +#define GLEW_NV_vertex_array_range2 GLEW_GET_VAR(__GLEW_NV_vertex_array_range2) + +#endif /* GL_NV_vertex_array_range2 */ + +/* ------------------- GL_NV_vertex_attrib_integer_64bit ------------------- */ + +#ifndef GL_NV_vertex_attrib_integer_64bit +#define GL_NV_vertex_attrib_integer_64bit 1 + +#define GL_INT64_NV 0x140E +#define GL_UNSIGNED_INT64_NV 0x140F + +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBLI64VNVPROC) (GLuint index, GLenum pname, GLint64EXT* params); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBLUI64VNVPROC) (GLuint index, GLenum pname, GLuint64EXT* params); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1I64NVPROC) (GLuint index, GLint64EXT x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1I64VNVPROC) (GLuint index, const GLint64EXT* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1UI64NVPROC) (GLuint index, GLuint64EXT x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1UI64VNVPROC) (GLuint index, const GLuint64EXT* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL2I64NVPROC) (GLuint index, GLint64EXT x, GLint64EXT y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL2I64VNVPROC) (GLuint index, const GLint64EXT* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL2UI64NVPROC) (GLuint index, GLuint64EXT x, GLuint64EXT y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL2UI64VNVPROC) (GLuint index, const GLuint64EXT* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL3I64NVPROC) (GLuint index, GLint64EXT x, GLint64EXT y, GLint64EXT z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL3I64VNVPROC) (GLuint index, const GLint64EXT* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL3UI64NVPROC) (GLuint index, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL3UI64VNVPROC) (GLuint index, const GLuint64EXT* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL4I64NVPROC) (GLuint index, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL4I64VNVPROC) (GLuint index, const GLint64EXT* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL4UI64NVPROC) (GLuint index, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL4UI64VNVPROC) (GLuint index, const GLuint64EXT* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBLFORMATNVPROC) (GLuint index, GLint size, GLenum type, GLsizei stride); + +#define glGetVertexAttribLi64vNV GLEW_GET_FUN(__glewGetVertexAttribLi64vNV) +#define glGetVertexAttribLui64vNV GLEW_GET_FUN(__glewGetVertexAttribLui64vNV) +#define glVertexAttribL1i64NV GLEW_GET_FUN(__glewVertexAttribL1i64NV) +#define glVertexAttribL1i64vNV GLEW_GET_FUN(__glewVertexAttribL1i64vNV) +#define glVertexAttribL1ui64NV GLEW_GET_FUN(__glewVertexAttribL1ui64NV) +#define glVertexAttribL1ui64vNV GLEW_GET_FUN(__glewVertexAttribL1ui64vNV) +#define glVertexAttribL2i64NV GLEW_GET_FUN(__glewVertexAttribL2i64NV) +#define glVertexAttribL2i64vNV GLEW_GET_FUN(__glewVertexAttribL2i64vNV) +#define glVertexAttribL2ui64NV GLEW_GET_FUN(__glewVertexAttribL2ui64NV) +#define glVertexAttribL2ui64vNV GLEW_GET_FUN(__glewVertexAttribL2ui64vNV) +#define glVertexAttribL3i64NV GLEW_GET_FUN(__glewVertexAttribL3i64NV) +#define glVertexAttribL3i64vNV GLEW_GET_FUN(__glewVertexAttribL3i64vNV) +#define glVertexAttribL3ui64NV GLEW_GET_FUN(__glewVertexAttribL3ui64NV) +#define glVertexAttribL3ui64vNV GLEW_GET_FUN(__glewVertexAttribL3ui64vNV) +#define glVertexAttribL4i64NV GLEW_GET_FUN(__glewVertexAttribL4i64NV) +#define glVertexAttribL4i64vNV GLEW_GET_FUN(__glewVertexAttribL4i64vNV) +#define glVertexAttribL4ui64NV GLEW_GET_FUN(__glewVertexAttribL4ui64NV) +#define glVertexAttribL4ui64vNV GLEW_GET_FUN(__glewVertexAttribL4ui64vNV) +#define glVertexAttribLFormatNV GLEW_GET_FUN(__glewVertexAttribLFormatNV) + +#define GLEW_NV_vertex_attrib_integer_64bit GLEW_GET_VAR(__GLEW_NV_vertex_attrib_integer_64bit) + +#endif /* GL_NV_vertex_attrib_integer_64bit */ + +/* ------------------- GL_NV_vertex_buffer_unified_memory ------------------ */ + +#ifndef GL_NV_vertex_buffer_unified_memory +#define GL_NV_vertex_buffer_unified_memory 1 + +#define GL_VERTEX_ATTRIB_ARRAY_UNIFIED_NV 0x8F1E +#define GL_ELEMENT_ARRAY_UNIFIED_NV 0x8F1F +#define GL_VERTEX_ATTRIB_ARRAY_ADDRESS_NV 0x8F20 +#define GL_VERTEX_ARRAY_ADDRESS_NV 0x8F21 +#define GL_NORMAL_ARRAY_ADDRESS_NV 0x8F22 +#define GL_COLOR_ARRAY_ADDRESS_NV 0x8F23 +#define GL_INDEX_ARRAY_ADDRESS_NV 0x8F24 +#define GL_TEXTURE_COORD_ARRAY_ADDRESS_NV 0x8F25 +#define GL_EDGE_FLAG_ARRAY_ADDRESS_NV 0x8F26 +#define GL_SECONDARY_COLOR_ARRAY_ADDRESS_NV 0x8F27 +#define GL_FOG_COORD_ARRAY_ADDRESS_NV 0x8F28 +#define GL_ELEMENT_ARRAY_ADDRESS_NV 0x8F29 +#define GL_VERTEX_ATTRIB_ARRAY_LENGTH_NV 0x8F2A +#define GL_VERTEX_ARRAY_LENGTH_NV 0x8F2B +#define GL_NORMAL_ARRAY_LENGTH_NV 0x8F2C +#define GL_COLOR_ARRAY_LENGTH_NV 0x8F2D +#define GL_INDEX_ARRAY_LENGTH_NV 0x8F2E +#define GL_TEXTURE_COORD_ARRAY_LENGTH_NV 0x8F2F +#define GL_EDGE_FLAG_ARRAY_LENGTH_NV 0x8F30 +#define GL_SECONDARY_COLOR_ARRAY_LENGTH_NV 0x8F31 +#define GL_FOG_COORD_ARRAY_LENGTH_NV 0x8F32 +#define GL_ELEMENT_ARRAY_LENGTH_NV 0x8F33 +#define GL_DRAW_INDIRECT_UNIFIED_NV 0x8F40 +#define GL_DRAW_INDIRECT_ADDRESS_NV 0x8F41 +#define GL_DRAW_INDIRECT_LENGTH_NV 0x8F42 + +typedef void (GLAPIENTRY * PFNGLBUFFERADDRESSRANGENVPROC) (GLenum pname, GLuint index, GLuint64EXT address, GLsizeiptr length); +typedef void (GLAPIENTRY * PFNGLCOLORFORMATNVPROC) (GLint size, GLenum type, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLEDGEFLAGFORMATNVPROC) (GLsizei stride); +typedef void (GLAPIENTRY * PFNGLFOGCOORDFORMATNVPROC) (GLenum type, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLGETINTEGERUI64I_VNVPROC) (GLenum value, GLuint index, GLuint64EXT result[]); +typedef void (GLAPIENTRY * PFNGLINDEXFORMATNVPROC) (GLenum type, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLNORMALFORMATNVPROC) (GLenum type, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLORFORMATNVPROC) (GLint size, GLenum type, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLTEXCOORDFORMATNVPROC) (GLint size, GLenum type, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBFORMATNVPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBIFORMATNVPROC) (GLuint index, GLint size, GLenum type, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLVERTEXFORMATNVPROC) (GLint size, GLenum type, GLsizei stride); + +#define glBufferAddressRangeNV GLEW_GET_FUN(__glewBufferAddressRangeNV) +#define glColorFormatNV GLEW_GET_FUN(__glewColorFormatNV) +#define glEdgeFlagFormatNV GLEW_GET_FUN(__glewEdgeFlagFormatNV) +#define glFogCoordFormatNV GLEW_GET_FUN(__glewFogCoordFormatNV) +#define glGetIntegerui64i_vNV GLEW_GET_FUN(__glewGetIntegerui64i_vNV) +#define glIndexFormatNV GLEW_GET_FUN(__glewIndexFormatNV) +#define glNormalFormatNV GLEW_GET_FUN(__glewNormalFormatNV) +#define glSecondaryColorFormatNV GLEW_GET_FUN(__glewSecondaryColorFormatNV) +#define glTexCoordFormatNV GLEW_GET_FUN(__glewTexCoordFormatNV) +#define glVertexAttribFormatNV GLEW_GET_FUN(__glewVertexAttribFormatNV) +#define glVertexAttribIFormatNV GLEW_GET_FUN(__glewVertexAttribIFormatNV) +#define glVertexFormatNV GLEW_GET_FUN(__glewVertexFormatNV) + +#define GLEW_NV_vertex_buffer_unified_memory GLEW_GET_VAR(__GLEW_NV_vertex_buffer_unified_memory) + +#endif /* GL_NV_vertex_buffer_unified_memory */ + +/* -------------------------- GL_NV_vertex_program ------------------------- */ + +#ifndef GL_NV_vertex_program +#define GL_NV_vertex_program 1 + +#define GL_VERTEX_PROGRAM_NV 0x8620 +#define GL_VERTEX_STATE_PROGRAM_NV 0x8621 +#define GL_ATTRIB_ARRAY_SIZE_NV 0x8623 +#define GL_ATTRIB_ARRAY_STRIDE_NV 0x8624 +#define GL_ATTRIB_ARRAY_TYPE_NV 0x8625 +#define GL_CURRENT_ATTRIB_NV 0x8626 +#define GL_PROGRAM_LENGTH_NV 0x8627 +#define GL_PROGRAM_STRING_NV 0x8628 +#define GL_MODELVIEW_PROJECTION_NV 0x8629 +#define GL_IDENTITY_NV 0x862A +#define GL_INVERSE_NV 0x862B +#define GL_TRANSPOSE_NV 0x862C +#define GL_INVERSE_TRANSPOSE_NV 0x862D +#define GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV 0x862E +#define GL_MAX_TRACK_MATRICES_NV 0x862F +#define GL_MATRIX0_NV 0x8630 +#define GL_MATRIX1_NV 0x8631 +#define GL_MATRIX2_NV 0x8632 +#define GL_MATRIX3_NV 0x8633 +#define GL_MATRIX4_NV 0x8634 +#define GL_MATRIX5_NV 0x8635 +#define GL_MATRIX6_NV 0x8636 +#define GL_MATRIX7_NV 0x8637 +#define GL_CURRENT_MATRIX_STACK_DEPTH_NV 0x8640 +#define GL_CURRENT_MATRIX_NV 0x8641 +#define GL_VERTEX_PROGRAM_POINT_SIZE_NV 0x8642 +#define GL_VERTEX_PROGRAM_TWO_SIDE_NV 0x8643 +#define GL_PROGRAM_PARAMETER_NV 0x8644 +#define GL_ATTRIB_ARRAY_POINTER_NV 0x8645 +#define GL_PROGRAM_TARGET_NV 0x8646 +#define GL_PROGRAM_RESIDENT_NV 0x8647 +#define GL_TRACK_MATRIX_NV 0x8648 +#define GL_TRACK_MATRIX_TRANSFORM_NV 0x8649 +#define GL_VERTEX_PROGRAM_BINDING_NV 0x864A +#define GL_PROGRAM_ERROR_POSITION_NV 0x864B +#define GL_VERTEX_ATTRIB_ARRAY0_NV 0x8650 +#define GL_VERTEX_ATTRIB_ARRAY1_NV 0x8651 +#define GL_VERTEX_ATTRIB_ARRAY2_NV 0x8652 +#define GL_VERTEX_ATTRIB_ARRAY3_NV 0x8653 +#define GL_VERTEX_ATTRIB_ARRAY4_NV 0x8654 +#define GL_VERTEX_ATTRIB_ARRAY5_NV 0x8655 +#define GL_VERTEX_ATTRIB_ARRAY6_NV 0x8656 +#define GL_VERTEX_ATTRIB_ARRAY7_NV 0x8657 +#define GL_VERTEX_ATTRIB_ARRAY8_NV 0x8658 +#define GL_VERTEX_ATTRIB_ARRAY9_NV 0x8659 +#define GL_VERTEX_ATTRIB_ARRAY10_NV 0x865A +#define GL_VERTEX_ATTRIB_ARRAY11_NV 0x865B +#define GL_VERTEX_ATTRIB_ARRAY12_NV 0x865C +#define GL_VERTEX_ATTRIB_ARRAY13_NV 0x865D +#define GL_VERTEX_ATTRIB_ARRAY14_NV 0x865E +#define GL_VERTEX_ATTRIB_ARRAY15_NV 0x865F +#define GL_MAP1_VERTEX_ATTRIB0_4_NV 0x8660 +#define GL_MAP1_VERTEX_ATTRIB1_4_NV 0x8661 +#define GL_MAP1_VERTEX_ATTRIB2_4_NV 0x8662 +#define GL_MAP1_VERTEX_ATTRIB3_4_NV 0x8663 +#define GL_MAP1_VERTEX_ATTRIB4_4_NV 0x8664 +#define GL_MAP1_VERTEX_ATTRIB5_4_NV 0x8665 +#define GL_MAP1_VERTEX_ATTRIB6_4_NV 0x8666 +#define GL_MAP1_VERTEX_ATTRIB7_4_NV 0x8667 +#define GL_MAP1_VERTEX_ATTRIB8_4_NV 0x8668 +#define GL_MAP1_VERTEX_ATTRIB9_4_NV 0x8669 +#define GL_MAP1_VERTEX_ATTRIB10_4_NV 0x866A +#define GL_MAP1_VERTEX_ATTRIB11_4_NV 0x866B +#define GL_MAP1_VERTEX_ATTRIB12_4_NV 0x866C +#define GL_MAP1_VERTEX_ATTRIB13_4_NV 0x866D +#define GL_MAP1_VERTEX_ATTRIB14_4_NV 0x866E +#define GL_MAP1_VERTEX_ATTRIB15_4_NV 0x866F +#define GL_MAP2_VERTEX_ATTRIB0_4_NV 0x8670 +#define GL_MAP2_VERTEX_ATTRIB1_4_NV 0x8671 +#define GL_MAP2_VERTEX_ATTRIB2_4_NV 0x8672 +#define GL_MAP2_VERTEX_ATTRIB3_4_NV 0x8673 +#define GL_MAP2_VERTEX_ATTRIB4_4_NV 0x8674 +#define GL_MAP2_VERTEX_ATTRIB5_4_NV 0x8675 +#define GL_MAP2_VERTEX_ATTRIB6_4_NV 0x8676 +#define GL_MAP2_VERTEX_ATTRIB7_4_NV 0x8677 +#define GL_MAP2_VERTEX_ATTRIB8_4_NV 0x8678 +#define GL_MAP2_VERTEX_ATTRIB9_4_NV 0x8679 +#define GL_MAP2_VERTEX_ATTRIB10_4_NV 0x867A +#define GL_MAP2_VERTEX_ATTRIB11_4_NV 0x867B +#define GL_MAP2_VERTEX_ATTRIB12_4_NV 0x867C +#define GL_MAP2_VERTEX_ATTRIB13_4_NV 0x867D +#define GL_MAP2_VERTEX_ATTRIB14_4_NV 0x867E +#define GL_MAP2_VERTEX_ATTRIB15_4_NV 0x867F + +typedef GLboolean (GLAPIENTRY * PFNGLAREPROGRAMSRESIDENTNVPROC) (GLsizei n, const GLuint* ids, GLboolean *residences); +typedef void (GLAPIENTRY * PFNGLBINDPROGRAMNVPROC) (GLenum target, GLuint id); +typedef void (GLAPIENTRY * PFNGLDELETEPROGRAMSNVPROC) (GLsizei n, const GLuint* ids); +typedef void (GLAPIENTRY * PFNGLEXECUTEPROGRAMNVPROC) (GLenum target, GLuint id, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGENPROGRAMSNVPROC) (GLsizei n, GLuint* ids); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMPARAMETERDVNVPROC) (GLenum target, GLuint index, GLenum pname, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMPARAMETERFVNVPROC) (GLenum target, GLuint index, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMSTRINGNVPROC) (GLuint id, GLenum pname, GLubyte* program); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMIVNVPROC) (GLuint id, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETTRACKMATRIXIVNVPROC) (GLenum target, GLuint address, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBPOINTERVNVPROC) (GLuint index, GLenum pname, GLvoid** pointer); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBDVNVPROC) (GLuint index, GLenum pname, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBFVNVPROC) (GLuint index, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBIVNVPROC) (GLuint index, GLenum pname, GLint* params); +typedef GLboolean (GLAPIENTRY * PFNGLISPROGRAMNVPROC) (GLuint id); +typedef void (GLAPIENTRY * PFNGLLOADPROGRAMNVPROC) (GLenum target, GLuint id, GLsizei len, const GLubyte* program); +typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETER4DNVPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETER4DVNVPROC) (GLenum target, GLuint index, const GLdouble* params); +typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETER4FNVPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETER4FVNVPROC) (GLenum target, GLuint index, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETERS4DVNVPROC) (GLenum target, GLuint index, GLsizei num, const GLdouble* params); +typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETERS4FVNVPROC) (GLenum target, GLuint index, GLsizei num, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLREQUESTRESIDENTPROGRAMSNVPROC) (GLsizei n, GLuint* ids); +typedef void (GLAPIENTRY * PFNGLTRACKMATRIXNVPROC) (GLenum target, GLuint address, GLenum matrix, GLenum transform); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1DNVPROC) (GLuint index, GLdouble x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1DVNVPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1FNVPROC) (GLuint index, GLfloat x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1FVNVPROC) (GLuint index, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1SNVPROC) (GLuint index, GLshort x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1SVNVPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2DNVPROC) (GLuint index, GLdouble x, GLdouble y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2DVNVPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2FNVPROC) (GLuint index, GLfloat x, GLfloat y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2FVNVPROC) (GLuint index, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2SNVPROC) (GLuint index, GLshort x, GLshort y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2SVNVPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3DVNVPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3FVNVPROC) (GLuint index, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3SVNVPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4DVNVPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4FVNVPROC) (GLuint index, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4SVNVPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4UBNVPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4UBVNVPROC) (GLuint index, const GLubyte* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBPOINTERNVPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS1DVNVPROC) (GLuint index, GLsizei n, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS1FVNVPROC) (GLuint index, GLsizei n, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS1SVNVPROC) (GLuint index, GLsizei n, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS2DVNVPROC) (GLuint index, GLsizei n, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS2FVNVPROC) (GLuint index, GLsizei n, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS2SVNVPROC) (GLuint index, GLsizei n, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS3DVNVPROC) (GLuint index, GLsizei n, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS3FVNVPROC) (GLuint index, GLsizei n, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS3SVNVPROC) (GLuint index, GLsizei n, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS4DVNVPROC) (GLuint index, GLsizei n, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS4FVNVPROC) (GLuint index, GLsizei n, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS4SVNVPROC) (GLuint index, GLsizei n, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS4UBVNVPROC) (GLuint index, GLsizei n, const GLubyte* v); + +#define glAreProgramsResidentNV GLEW_GET_FUN(__glewAreProgramsResidentNV) +#define glBindProgramNV GLEW_GET_FUN(__glewBindProgramNV) +#define glDeleteProgramsNV GLEW_GET_FUN(__glewDeleteProgramsNV) +#define glExecuteProgramNV GLEW_GET_FUN(__glewExecuteProgramNV) +#define glGenProgramsNV GLEW_GET_FUN(__glewGenProgramsNV) +#define glGetProgramParameterdvNV GLEW_GET_FUN(__glewGetProgramParameterdvNV) +#define glGetProgramParameterfvNV GLEW_GET_FUN(__glewGetProgramParameterfvNV) +#define glGetProgramStringNV GLEW_GET_FUN(__glewGetProgramStringNV) +#define glGetProgramivNV GLEW_GET_FUN(__glewGetProgramivNV) +#define glGetTrackMatrixivNV GLEW_GET_FUN(__glewGetTrackMatrixivNV) +#define glGetVertexAttribPointervNV GLEW_GET_FUN(__glewGetVertexAttribPointervNV) +#define glGetVertexAttribdvNV GLEW_GET_FUN(__glewGetVertexAttribdvNV) +#define glGetVertexAttribfvNV GLEW_GET_FUN(__glewGetVertexAttribfvNV) +#define glGetVertexAttribivNV GLEW_GET_FUN(__glewGetVertexAttribivNV) +#define glIsProgramNV GLEW_GET_FUN(__glewIsProgramNV) +#define glLoadProgramNV GLEW_GET_FUN(__glewLoadProgramNV) +#define glProgramParameter4dNV GLEW_GET_FUN(__glewProgramParameter4dNV) +#define glProgramParameter4dvNV GLEW_GET_FUN(__glewProgramParameter4dvNV) +#define glProgramParameter4fNV GLEW_GET_FUN(__glewProgramParameter4fNV) +#define glProgramParameter4fvNV GLEW_GET_FUN(__glewProgramParameter4fvNV) +#define glProgramParameters4dvNV GLEW_GET_FUN(__glewProgramParameters4dvNV) +#define glProgramParameters4fvNV GLEW_GET_FUN(__glewProgramParameters4fvNV) +#define glRequestResidentProgramsNV GLEW_GET_FUN(__glewRequestResidentProgramsNV) +#define glTrackMatrixNV GLEW_GET_FUN(__glewTrackMatrixNV) +#define glVertexAttrib1dNV GLEW_GET_FUN(__glewVertexAttrib1dNV) +#define glVertexAttrib1dvNV GLEW_GET_FUN(__glewVertexAttrib1dvNV) +#define glVertexAttrib1fNV GLEW_GET_FUN(__glewVertexAttrib1fNV) +#define glVertexAttrib1fvNV GLEW_GET_FUN(__glewVertexAttrib1fvNV) +#define glVertexAttrib1sNV GLEW_GET_FUN(__glewVertexAttrib1sNV) +#define glVertexAttrib1svNV GLEW_GET_FUN(__glewVertexAttrib1svNV) +#define glVertexAttrib2dNV GLEW_GET_FUN(__glewVertexAttrib2dNV) +#define glVertexAttrib2dvNV GLEW_GET_FUN(__glewVertexAttrib2dvNV) +#define glVertexAttrib2fNV GLEW_GET_FUN(__glewVertexAttrib2fNV) +#define glVertexAttrib2fvNV GLEW_GET_FUN(__glewVertexAttrib2fvNV) +#define glVertexAttrib2sNV GLEW_GET_FUN(__glewVertexAttrib2sNV) +#define glVertexAttrib2svNV GLEW_GET_FUN(__glewVertexAttrib2svNV) +#define glVertexAttrib3dNV GLEW_GET_FUN(__glewVertexAttrib3dNV) +#define glVertexAttrib3dvNV GLEW_GET_FUN(__glewVertexAttrib3dvNV) +#define glVertexAttrib3fNV GLEW_GET_FUN(__glewVertexAttrib3fNV) +#define glVertexAttrib3fvNV GLEW_GET_FUN(__glewVertexAttrib3fvNV) +#define glVertexAttrib3sNV GLEW_GET_FUN(__glewVertexAttrib3sNV) +#define glVertexAttrib3svNV GLEW_GET_FUN(__glewVertexAttrib3svNV) +#define glVertexAttrib4dNV GLEW_GET_FUN(__glewVertexAttrib4dNV) +#define glVertexAttrib4dvNV GLEW_GET_FUN(__glewVertexAttrib4dvNV) +#define glVertexAttrib4fNV GLEW_GET_FUN(__glewVertexAttrib4fNV) +#define glVertexAttrib4fvNV GLEW_GET_FUN(__glewVertexAttrib4fvNV) +#define glVertexAttrib4sNV GLEW_GET_FUN(__glewVertexAttrib4sNV) +#define glVertexAttrib4svNV GLEW_GET_FUN(__glewVertexAttrib4svNV) +#define glVertexAttrib4ubNV GLEW_GET_FUN(__glewVertexAttrib4ubNV) +#define glVertexAttrib4ubvNV GLEW_GET_FUN(__glewVertexAttrib4ubvNV) +#define glVertexAttribPointerNV GLEW_GET_FUN(__glewVertexAttribPointerNV) +#define glVertexAttribs1dvNV GLEW_GET_FUN(__glewVertexAttribs1dvNV) +#define glVertexAttribs1fvNV GLEW_GET_FUN(__glewVertexAttribs1fvNV) +#define glVertexAttribs1svNV GLEW_GET_FUN(__glewVertexAttribs1svNV) +#define glVertexAttribs2dvNV GLEW_GET_FUN(__glewVertexAttribs2dvNV) +#define glVertexAttribs2fvNV GLEW_GET_FUN(__glewVertexAttribs2fvNV) +#define glVertexAttribs2svNV GLEW_GET_FUN(__glewVertexAttribs2svNV) +#define glVertexAttribs3dvNV GLEW_GET_FUN(__glewVertexAttribs3dvNV) +#define glVertexAttribs3fvNV GLEW_GET_FUN(__glewVertexAttribs3fvNV) +#define glVertexAttribs3svNV GLEW_GET_FUN(__glewVertexAttribs3svNV) +#define glVertexAttribs4dvNV GLEW_GET_FUN(__glewVertexAttribs4dvNV) +#define glVertexAttribs4fvNV GLEW_GET_FUN(__glewVertexAttribs4fvNV) +#define glVertexAttribs4svNV GLEW_GET_FUN(__glewVertexAttribs4svNV) +#define glVertexAttribs4ubvNV GLEW_GET_FUN(__glewVertexAttribs4ubvNV) + +#define GLEW_NV_vertex_program GLEW_GET_VAR(__GLEW_NV_vertex_program) + +#endif /* GL_NV_vertex_program */ + +/* ------------------------ GL_NV_vertex_program1_1 ------------------------ */ + +#ifndef GL_NV_vertex_program1_1 +#define GL_NV_vertex_program1_1 1 + +#define GLEW_NV_vertex_program1_1 GLEW_GET_VAR(__GLEW_NV_vertex_program1_1) + +#endif /* GL_NV_vertex_program1_1 */ + +/* ------------------------- GL_NV_vertex_program2 ------------------------- */ + +#ifndef GL_NV_vertex_program2 +#define GL_NV_vertex_program2 1 + +#define GLEW_NV_vertex_program2 GLEW_GET_VAR(__GLEW_NV_vertex_program2) + +#endif /* GL_NV_vertex_program2 */ + +/* ---------------------- GL_NV_vertex_program2_option --------------------- */ + +#ifndef GL_NV_vertex_program2_option +#define GL_NV_vertex_program2_option 1 + +#define GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV 0x88F4 +#define GL_MAX_PROGRAM_CALL_DEPTH_NV 0x88F5 + +#define GLEW_NV_vertex_program2_option GLEW_GET_VAR(__GLEW_NV_vertex_program2_option) + +#endif /* GL_NV_vertex_program2_option */ + +/* ------------------------- GL_NV_vertex_program3 ------------------------- */ + +#ifndef GL_NV_vertex_program3 +#define GL_NV_vertex_program3 1 + +#define MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB 0x8B4C + +#define GLEW_NV_vertex_program3 GLEW_GET_VAR(__GLEW_NV_vertex_program3) + +#endif /* GL_NV_vertex_program3 */ + +/* ------------------------- GL_NV_vertex_program4 ------------------------- */ + +#ifndef GL_NV_vertex_program4 +#define GL_NV_vertex_program4 1 + +#define GL_VERTEX_ATTRIB_ARRAY_INTEGER_NV 0x88FD + +#define GLEW_NV_vertex_program4 GLEW_GET_VAR(__GLEW_NV_vertex_program4) + +#endif /* GL_NV_vertex_program4 */ + +/* -------------------------- GL_NV_video_capture -------------------------- */ + +#ifndef GL_NV_video_capture +#define GL_NV_video_capture 1 + +#define GL_VIDEO_BUFFER_NV 0x9020 +#define GL_VIDEO_BUFFER_BINDING_NV 0x9021 +#define GL_FIELD_UPPER_NV 0x9022 +#define GL_FIELD_LOWER_NV 0x9023 +#define GL_NUM_VIDEO_CAPTURE_STREAMS_NV 0x9024 +#define GL_NEXT_VIDEO_CAPTURE_BUFFER_STATUS_NV 0x9025 +#define GL_VIDEO_CAPTURE_TO_422_SUPPORTED_NV 0x9026 +#define GL_LAST_VIDEO_CAPTURE_STATUS_NV 0x9027 +#define GL_VIDEO_BUFFER_PITCH_NV 0x9028 +#define GL_VIDEO_COLOR_CONVERSION_MATRIX_NV 0x9029 +#define GL_VIDEO_COLOR_CONVERSION_MAX_NV 0x902A +#define GL_VIDEO_COLOR_CONVERSION_MIN_NV 0x902B +#define GL_VIDEO_COLOR_CONVERSION_OFFSET_NV 0x902C +#define GL_VIDEO_BUFFER_INTERNAL_FORMAT_NV 0x902D +#define GL_PARTIAL_SUCCESS_NV 0x902E +#define GL_SUCCESS_NV 0x902F +#define GL_FAILURE_NV 0x9030 +#define GL_YCBYCR8_422_NV 0x9031 +#define GL_YCBAYCR8A_4224_NV 0x9032 +#define GL_Z6Y10Z6CB10Z6Y10Z6CR10_422_NV 0x9033 +#define GL_Z6Y10Z6CB10Z6A10Z6Y10Z6CR10Z6A10_4224_NV 0x9034 +#define GL_Z4Y12Z4CB12Z4Y12Z4CR12_422_NV 0x9035 +#define GL_Z4Y12Z4CB12Z4A12Z4Y12Z4CR12Z4A12_4224_NV 0x9036 +#define GL_Z4Y12Z4CB12Z4CR12_444_NV 0x9037 +#define GL_VIDEO_CAPTURE_FRAME_WIDTH_NV 0x9038 +#define GL_VIDEO_CAPTURE_FRAME_HEIGHT_NV 0x9039 +#define GL_VIDEO_CAPTURE_FIELD_UPPER_HEIGHT_NV 0x903A +#define GL_VIDEO_CAPTURE_FIELD_LOWER_HEIGHT_NV 0x903B +#define GL_VIDEO_CAPTURE_SURFACE_ORIGIN_NV 0x903C + +typedef void (GLAPIENTRY * PFNGLBEGINVIDEOCAPTURENVPROC) (GLuint video_capture_slot); +typedef void (GLAPIENTRY * PFNGLBINDVIDEOCAPTURESTREAMBUFFERNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLintptrARB offset); +typedef void (GLAPIENTRY * PFNGLBINDVIDEOCAPTURESTREAMTEXTURENVPROC) (GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLenum target, GLuint texture); +typedef void (GLAPIENTRY * PFNGLENDVIDEOCAPTURENVPROC) (GLuint video_capture_slot); +typedef void (GLAPIENTRY * PFNGLGETVIDEOCAPTURESTREAMDVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLGETVIDEOCAPTURESTREAMFVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETVIDEOCAPTURESTREAMIVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETVIDEOCAPTUREIVNVPROC) (GLuint video_capture_slot, GLenum pname, GLint* params); +typedef GLenum (GLAPIENTRY * PFNGLVIDEOCAPTURENVPROC) (GLuint video_capture_slot, GLuint* sequence_num, GLuint64EXT *capture_time); +typedef void (GLAPIENTRY * PFNGLVIDEOCAPTURESTREAMPARAMETERDVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLdouble* params); +typedef void (GLAPIENTRY * PFNGLVIDEOCAPTURESTREAMPARAMETERFVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLVIDEOCAPTURESTREAMPARAMETERIVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLint* params); + +#define glBeginVideoCaptureNV GLEW_GET_FUN(__glewBeginVideoCaptureNV) +#define glBindVideoCaptureStreamBufferNV GLEW_GET_FUN(__glewBindVideoCaptureStreamBufferNV) +#define glBindVideoCaptureStreamTextureNV GLEW_GET_FUN(__glewBindVideoCaptureStreamTextureNV) +#define glEndVideoCaptureNV GLEW_GET_FUN(__glewEndVideoCaptureNV) +#define glGetVideoCaptureStreamdvNV GLEW_GET_FUN(__glewGetVideoCaptureStreamdvNV) +#define glGetVideoCaptureStreamfvNV GLEW_GET_FUN(__glewGetVideoCaptureStreamfvNV) +#define glGetVideoCaptureStreamivNV GLEW_GET_FUN(__glewGetVideoCaptureStreamivNV) +#define glGetVideoCaptureivNV GLEW_GET_FUN(__glewGetVideoCaptureivNV) +#define glVideoCaptureNV GLEW_GET_FUN(__glewVideoCaptureNV) +#define glVideoCaptureStreamParameterdvNV GLEW_GET_FUN(__glewVideoCaptureStreamParameterdvNV) +#define glVideoCaptureStreamParameterfvNV GLEW_GET_FUN(__glewVideoCaptureStreamParameterfvNV) +#define glVideoCaptureStreamParameterivNV GLEW_GET_FUN(__glewVideoCaptureStreamParameterivNV) + +#define GLEW_NV_video_capture GLEW_GET_VAR(__GLEW_NV_video_capture) + +#endif /* GL_NV_video_capture */ + +/* ------------------------ GL_OES_byte_coordinates ------------------------ */ + +#ifndef GL_OES_byte_coordinates +#define GL_OES_byte_coordinates 1 + +#define GLEW_OES_byte_coordinates GLEW_GET_VAR(__GLEW_OES_byte_coordinates) + +#endif /* GL_OES_byte_coordinates */ + +/* ------------------- GL_OES_compressed_paletted_texture ------------------ */ + +#ifndef GL_OES_compressed_paletted_texture +#define GL_OES_compressed_paletted_texture 1 + +#define GL_PALETTE4_RGB8_OES 0x8B90 +#define GL_PALETTE4_RGBA8_OES 0x8B91 +#define GL_PALETTE4_R5_G6_B5_OES 0x8B92 +#define GL_PALETTE4_RGBA4_OES 0x8B93 +#define GL_PALETTE4_RGB5_A1_OES 0x8B94 +#define GL_PALETTE8_RGB8_OES 0x8B95 +#define GL_PALETTE8_RGBA8_OES 0x8B96 +#define GL_PALETTE8_R5_G6_B5_OES 0x8B97 +#define GL_PALETTE8_RGBA4_OES 0x8B98 +#define GL_PALETTE8_RGB5_A1_OES 0x8B99 + +#define GLEW_OES_compressed_paletted_texture GLEW_GET_VAR(__GLEW_OES_compressed_paletted_texture) + +#endif /* GL_OES_compressed_paletted_texture */ + +/* --------------------------- GL_OES_read_format -------------------------- */ + +#ifndef GL_OES_read_format +#define GL_OES_read_format 1 + +#define GL_IMPLEMENTATION_COLOR_READ_TYPE_OES 0x8B9A +#define GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES 0x8B9B + +#define GLEW_OES_read_format GLEW_GET_VAR(__GLEW_OES_read_format) + +#endif /* GL_OES_read_format */ + +/* ------------------------ GL_OES_single_precision ------------------------ */ + +#ifndef GL_OES_single_precision +#define GL_OES_single_precision 1 + +typedef void (GLAPIENTRY * PFNGLCLEARDEPTHFOESPROC) (GLclampd depth); +typedef void (GLAPIENTRY * PFNGLCLIPPLANEFOESPROC) (GLenum plane, const GLfloat* equation); +typedef void (GLAPIENTRY * PFNGLDEPTHRANGEFOESPROC) (GLclampf n, GLclampf f); +typedef void (GLAPIENTRY * PFNGLFRUSTUMFOESPROC) (GLfloat l, GLfloat r, GLfloat b, GLfloat t, GLfloat n, GLfloat f); +typedef void (GLAPIENTRY * PFNGLGETCLIPPLANEFOESPROC) (GLenum plane, GLfloat* equation); +typedef void (GLAPIENTRY * PFNGLORTHOFOESPROC) (GLfloat l, GLfloat r, GLfloat b, GLfloat t, GLfloat n, GLfloat f); + +#define glClearDepthfOES GLEW_GET_FUN(__glewClearDepthfOES) +#define glClipPlanefOES GLEW_GET_FUN(__glewClipPlanefOES) +#define glDepthRangefOES GLEW_GET_FUN(__glewDepthRangefOES) +#define glFrustumfOES GLEW_GET_FUN(__glewFrustumfOES) +#define glGetClipPlanefOES GLEW_GET_FUN(__glewGetClipPlanefOES) +#define glOrthofOES GLEW_GET_FUN(__glewOrthofOES) + +#define GLEW_OES_single_precision GLEW_GET_VAR(__GLEW_OES_single_precision) + +#endif /* GL_OES_single_precision */ + +/* ---------------------------- GL_OML_interlace --------------------------- */ + +#ifndef GL_OML_interlace +#define GL_OML_interlace 1 + +#define GL_INTERLACE_OML 0x8980 +#define GL_INTERLACE_READ_OML 0x8981 + +#define GLEW_OML_interlace GLEW_GET_VAR(__GLEW_OML_interlace) + +#endif /* GL_OML_interlace */ + +/* ---------------------------- GL_OML_resample ---------------------------- */ + +#ifndef GL_OML_resample +#define GL_OML_resample 1 + +#define GL_PACK_RESAMPLE_OML 0x8984 +#define GL_UNPACK_RESAMPLE_OML 0x8985 +#define GL_RESAMPLE_REPLICATE_OML 0x8986 +#define GL_RESAMPLE_ZERO_FILL_OML 0x8987 +#define GL_RESAMPLE_AVERAGE_OML 0x8988 +#define GL_RESAMPLE_DECIMATE_OML 0x8989 + +#define GLEW_OML_resample GLEW_GET_VAR(__GLEW_OML_resample) + +#endif /* GL_OML_resample */ + +/* ---------------------------- GL_OML_subsample --------------------------- */ + +#ifndef GL_OML_subsample +#define GL_OML_subsample 1 + +#define GL_FORMAT_SUBSAMPLE_24_24_OML 0x8982 +#define GL_FORMAT_SUBSAMPLE_244_244_OML 0x8983 + +#define GLEW_OML_subsample GLEW_GET_VAR(__GLEW_OML_subsample) + +#endif /* GL_OML_subsample */ + +/* --------------------------- GL_PGI_misc_hints --------------------------- */ + +#ifndef GL_PGI_misc_hints +#define GL_PGI_misc_hints 1 + +#define GL_PREFER_DOUBLEBUFFER_HINT_PGI 107000 +#define GL_CONSERVE_MEMORY_HINT_PGI 107005 +#define GL_RECLAIM_MEMORY_HINT_PGI 107006 +#define GL_NATIVE_GRAPHICS_HANDLE_PGI 107010 +#define GL_NATIVE_GRAPHICS_BEGIN_HINT_PGI 107011 +#define GL_NATIVE_GRAPHICS_END_HINT_PGI 107012 +#define GL_ALWAYS_FAST_HINT_PGI 107020 +#define GL_ALWAYS_SOFT_HINT_PGI 107021 +#define GL_ALLOW_DRAW_OBJ_HINT_PGI 107022 +#define GL_ALLOW_DRAW_WIN_HINT_PGI 107023 +#define GL_ALLOW_DRAW_FRG_HINT_PGI 107024 +#define GL_ALLOW_DRAW_MEM_HINT_PGI 107025 +#define GL_STRICT_DEPTHFUNC_HINT_PGI 107030 +#define GL_STRICT_LIGHTING_HINT_PGI 107031 +#define GL_STRICT_SCISSOR_HINT_PGI 107032 +#define GL_FULL_STIPPLE_HINT_PGI 107033 +#define GL_CLIP_NEAR_HINT_PGI 107040 +#define GL_CLIP_FAR_HINT_PGI 107041 +#define GL_WIDE_LINE_HINT_PGI 107042 +#define GL_BACK_NORMALS_HINT_PGI 107043 + +#define GLEW_PGI_misc_hints GLEW_GET_VAR(__GLEW_PGI_misc_hints) + +#endif /* GL_PGI_misc_hints */ + +/* -------------------------- GL_PGI_vertex_hints -------------------------- */ + +#ifndef GL_PGI_vertex_hints +#define GL_PGI_vertex_hints 1 + +#define GL_VERTEX23_BIT_PGI 0x00000004 +#define GL_VERTEX4_BIT_PGI 0x00000008 +#define GL_COLOR3_BIT_PGI 0x00010000 +#define GL_COLOR4_BIT_PGI 0x00020000 +#define GL_EDGEFLAG_BIT_PGI 0x00040000 +#define GL_INDEX_BIT_PGI 0x00080000 +#define GL_MAT_AMBIENT_BIT_PGI 0x00100000 +#define GL_VERTEX_DATA_HINT_PGI 107050 +#define GL_VERTEX_CONSISTENT_HINT_PGI 107051 +#define GL_MATERIAL_SIDE_HINT_PGI 107052 +#define GL_MAX_VERTEX_HINT_PGI 107053 +#define GL_MAT_AMBIENT_AND_DIFFUSE_BIT_PGI 0x00200000 +#define GL_MAT_DIFFUSE_BIT_PGI 0x00400000 +#define GL_MAT_EMISSION_BIT_PGI 0x00800000 +#define GL_MAT_COLOR_INDEXES_BIT_PGI 0x01000000 +#define GL_MAT_SHININESS_BIT_PGI 0x02000000 +#define GL_MAT_SPECULAR_BIT_PGI 0x04000000 +#define GL_NORMAL_BIT_PGI 0x08000000 +#define GL_TEXCOORD1_BIT_PGI 0x10000000 +#define GL_TEXCOORD2_BIT_PGI 0x20000000 +#define GL_TEXCOORD3_BIT_PGI 0x40000000 +#define GL_TEXCOORD4_BIT_PGI 0x80000000 + +#define GLEW_PGI_vertex_hints GLEW_GET_VAR(__GLEW_PGI_vertex_hints) + +#endif /* GL_PGI_vertex_hints */ + +/* ---------------------- GL_REGAL_ES1_0_compatibility --------------------- */ + +#ifndef GL_REGAL_ES1_0_compatibility +#define GL_REGAL_ES1_0_compatibility 1 + +typedef int GLclampx; + +typedef void (GLAPIENTRY * PFNGLALPHAFUNCXPROC) (GLenum func, GLclampx ref); +typedef void (GLAPIENTRY * PFNGLCLEARCOLORXPROC) (GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha); +typedef void (GLAPIENTRY * PFNGLCLEARDEPTHXPROC) (GLclampx depth); +typedef void (GLAPIENTRY * PFNGLCOLOR4XPROC) (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha); +typedef void (GLAPIENTRY * PFNGLDEPTHRANGEXPROC) (GLclampx zNear, GLclampx zFar); +typedef void (GLAPIENTRY * PFNGLFOGXPROC) (GLenum pname, GLfixed param); +typedef void (GLAPIENTRY * PFNGLFOGXVPROC) (GLenum pname, const GLfixed* params); +typedef void (GLAPIENTRY * PFNGLFRUSTUMFPROC) (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar); +typedef void (GLAPIENTRY * PFNGLFRUSTUMXPROC) (GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar); +typedef void (GLAPIENTRY * PFNGLLIGHTMODELXPROC) (GLenum pname, GLfixed param); +typedef void (GLAPIENTRY * PFNGLLIGHTMODELXVPROC) (GLenum pname, const GLfixed* params); +typedef void (GLAPIENTRY * PFNGLLIGHTXPROC) (GLenum light, GLenum pname, GLfixed param); +typedef void (GLAPIENTRY * PFNGLLIGHTXVPROC) (GLenum light, GLenum pname, const GLfixed* params); +typedef void (GLAPIENTRY * PFNGLLINEWIDTHXPROC) (GLfixed width); +typedef void (GLAPIENTRY * PFNGLLOADMATRIXXPROC) (const GLfixed* m); +typedef void (GLAPIENTRY * PFNGLMATERIALXPROC) (GLenum face, GLenum pname, GLfixed param); +typedef void (GLAPIENTRY * PFNGLMATERIALXVPROC) (GLenum face, GLenum pname, const GLfixed* params); +typedef void (GLAPIENTRY * PFNGLMULTMATRIXXPROC) (const GLfixed* m); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4XPROC) (GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q); +typedef void (GLAPIENTRY * PFNGLNORMAL3XPROC) (GLfixed nx, GLfixed ny, GLfixed nz); +typedef void (GLAPIENTRY * PFNGLORTHOFPROC) (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar); +typedef void (GLAPIENTRY * PFNGLORTHOXPROC) (GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar); +typedef void (GLAPIENTRY * PFNGLPOINTSIZEXPROC) (GLfixed size); +typedef void (GLAPIENTRY * PFNGLPOLYGONOFFSETXPROC) (GLfixed factor, GLfixed units); +typedef void (GLAPIENTRY * PFNGLROTATEXPROC) (GLfixed angle, GLfixed x, GLfixed y, GLfixed z); +typedef void (GLAPIENTRY * PFNGLSAMPLECOVERAGEXPROC) (GLclampx value, GLboolean invert); +typedef void (GLAPIENTRY * PFNGLSCALEXPROC) (GLfixed x, GLfixed y, GLfixed z); +typedef void (GLAPIENTRY * PFNGLTEXENVXPROC) (GLenum target, GLenum pname, GLfixed param); +typedef void (GLAPIENTRY * PFNGLTEXENVXVPROC) (GLenum target, GLenum pname, const GLfixed* params); +typedef void (GLAPIENTRY * PFNGLTEXPARAMETERXPROC) (GLenum target, GLenum pname, GLfixed param); +typedef void (GLAPIENTRY * PFNGLTRANSLATEXPROC) (GLfixed x, GLfixed y, GLfixed z); + +#define glAlphaFuncx GLEW_GET_FUN(__glewAlphaFuncx) +#define glClearColorx GLEW_GET_FUN(__glewClearColorx) +#define glClearDepthx GLEW_GET_FUN(__glewClearDepthx) +#define glColor4x GLEW_GET_FUN(__glewColor4x) +#define glDepthRangex GLEW_GET_FUN(__glewDepthRangex) +#define glFogx GLEW_GET_FUN(__glewFogx) +#define glFogxv GLEW_GET_FUN(__glewFogxv) +#define glFrustumf GLEW_GET_FUN(__glewFrustumf) +#define glFrustumx GLEW_GET_FUN(__glewFrustumx) +#define glLightModelx GLEW_GET_FUN(__glewLightModelx) +#define glLightModelxv GLEW_GET_FUN(__glewLightModelxv) +#define glLightx GLEW_GET_FUN(__glewLightx) +#define glLightxv GLEW_GET_FUN(__glewLightxv) +#define glLineWidthx GLEW_GET_FUN(__glewLineWidthx) +#define glLoadMatrixx GLEW_GET_FUN(__glewLoadMatrixx) +#define glMaterialx GLEW_GET_FUN(__glewMaterialx) +#define glMaterialxv GLEW_GET_FUN(__glewMaterialxv) +#define glMultMatrixx GLEW_GET_FUN(__glewMultMatrixx) +#define glMultiTexCoord4x GLEW_GET_FUN(__glewMultiTexCoord4x) +#define glNormal3x GLEW_GET_FUN(__glewNormal3x) +#define glOrthof GLEW_GET_FUN(__glewOrthof) +#define glOrthox GLEW_GET_FUN(__glewOrthox) +#define glPointSizex GLEW_GET_FUN(__glewPointSizex) +#define glPolygonOffsetx GLEW_GET_FUN(__glewPolygonOffsetx) +#define glRotatex GLEW_GET_FUN(__glewRotatex) +#define glSampleCoveragex GLEW_GET_FUN(__glewSampleCoveragex) +#define glScalex GLEW_GET_FUN(__glewScalex) +#define glTexEnvx GLEW_GET_FUN(__glewTexEnvx) +#define glTexEnvxv GLEW_GET_FUN(__glewTexEnvxv) +#define glTexParameterx GLEW_GET_FUN(__glewTexParameterx) +#define glTranslatex GLEW_GET_FUN(__glewTranslatex) + +#define GLEW_REGAL_ES1_0_compatibility GLEW_GET_VAR(__GLEW_REGAL_ES1_0_compatibility) + +#endif /* GL_REGAL_ES1_0_compatibility */ + +/* ---------------------- GL_REGAL_ES1_1_compatibility --------------------- */ + +#ifndef GL_REGAL_ES1_1_compatibility +#define GL_REGAL_ES1_1_compatibility 1 + +typedef void (GLAPIENTRY * PFNGLCLIPPLANEFPROC) (GLenum plane, const GLfloat* equation); +typedef void (GLAPIENTRY * PFNGLCLIPPLANEXPROC) (GLenum plane, const GLfixed* equation); +typedef void (GLAPIENTRY * PFNGLGETCLIPPLANEFPROC) (GLenum pname, GLfloat eqn[4]); +typedef void (GLAPIENTRY * PFNGLGETCLIPPLANEXPROC) (GLenum pname, GLfixed eqn[4]); +typedef void (GLAPIENTRY * PFNGLGETFIXEDVPROC) (GLenum pname, GLfixed* params); +typedef void (GLAPIENTRY * PFNGLGETLIGHTXVPROC) (GLenum light, GLenum pname, GLfixed* params); +typedef void (GLAPIENTRY * PFNGLGETMATERIALXVPROC) (GLenum face, GLenum pname, GLfixed* params); +typedef void (GLAPIENTRY * PFNGLGETTEXENVXVPROC) (GLenum env, GLenum pname, GLfixed* params); +typedef void (GLAPIENTRY * PFNGLGETTEXPARAMETERXVPROC) (GLenum target, GLenum pname, GLfixed* params); +typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERXPROC) (GLenum pname, GLfixed param); +typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERXVPROC) (GLenum pname, const GLfixed* params); +typedef void (GLAPIENTRY * PFNGLPOINTSIZEPOINTEROESPROC) (GLenum type, GLsizei stride, const GLvoid* pointer); +typedef void (GLAPIENTRY * PFNGLTEXPARAMETERXVPROC) (GLenum target, GLenum pname, const GLfixed* params); + +#define glClipPlanef GLEW_GET_FUN(__glewClipPlanef) +#define glClipPlanex GLEW_GET_FUN(__glewClipPlanex) +#define glGetClipPlanef GLEW_GET_FUN(__glewGetClipPlanef) +#define glGetClipPlanex GLEW_GET_FUN(__glewGetClipPlanex) +#define glGetFixedv GLEW_GET_FUN(__glewGetFixedv) +#define glGetLightxv GLEW_GET_FUN(__glewGetLightxv) +#define glGetMaterialxv GLEW_GET_FUN(__glewGetMaterialxv) +#define glGetTexEnvxv GLEW_GET_FUN(__glewGetTexEnvxv) +#define glGetTexParameterxv GLEW_GET_FUN(__glewGetTexParameterxv) +#define glPointParameterx GLEW_GET_FUN(__glewPointParameterx) +#define glPointParameterxv GLEW_GET_FUN(__glewPointParameterxv) +#define glPointSizePointerOES GLEW_GET_FUN(__glewPointSizePointerOES) +#define glTexParameterxv GLEW_GET_FUN(__glewTexParameterxv) + +#define GLEW_REGAL_ES1_1_compatibility GLEW_GET_VAR(__GLEW_REGAL_ES1_1_compatibility) + +#endif /* GL_REGAL_ES1_1_compatibility */ + +/* ---------------------------- GL_REGAL_enable ---------------------------- */ + +#ifndef GL_REGAL_enable +#define GL_REGAL_enable 1 + +#define GL_ERROR_REGAL 0x9322 +#define GL_DEBUG_REGAL 0x9323 +#define GL_LOG_REGAL 0x9324 +#define GL_EMULATION_REGAL 0x9325 +#define GL_DRIVER_REGAL 0x9326 +#define GL_MISSING_REGAL 0x9360 +#define GL_TRACE_REGAL 0x9361 +#define GL_CACHE_REGAL 0x9362 +#define GL_CODE_REGAL 0x9363 +#define GL_STATISTICS_REGAL 0x9364 + +#define GLEW_REGAL_enable GLEW_GET_VAR(__GLEW_REGAL_enable) + +#endif /* GL_REGAL_enable */ + +/* ------------------------- GL_REGAL_error_string ------------------------- */ + +#ifndef GL_REGAL_error_string +#define GL_REGAL_error_string 1 + +typedef const GLchar* (GLAPIENTRY * PFNGLERRORSTRINGREGALPROC) (GLenum error); + +#define glErrorStringREGAL GLEW_GET_FUN(__glewErrorStringREGAL) + +#define GLEW_REGAL_error_string GLEW_GET_VAR(__GLEW_REGAL_error_string) + +#endif /* GL_REGAL_error_string */ + +/* ------------------------ GL_REGAL_extension_query ----------------------- */ + +#ifndef GL_REGAL_extension_query +#define GL_REGAL_extension_query 1 + +typedef GLboolean (GLAPIENTRY * PFNGLGETEXTENSIONREGALPROC) (const GLchar* ext); +typedef GLboolean (GLAPIENTRY * PFNGLISSUPPORTEDREGALPROC) (const GLchar* ext); + +#define glGetExtensionREGAL GLEW_GET_FUN(__glewGetExtensionREGAL) +#define glIsSupportedREGAL GLEW_GET_FUN(__glewIsSupportedREGAL) + +#define GLEW_REGAL_extension_query GLEW_GET_VAR(__GLEW_REGAL_extension_query) + +#endif /* GL_REGAL_extension_query */ + +/* ------------------------------ GL_REGAL_log ----------------------------- */ + +#ifndef GL_REGAL_log +#define GL_REGAL_log 1 + +#define GL_LOG_ERROR_REGAL 0x9319 +#define GL_LOG_WARNING_REGAL 0x931A +#define GL_LOG_INFO_REGAL 0x931B +#define GL_LOG_APP_REGAL 0x931C +#define GL_LOG_DRIVER_REGAL 0x931D +#define GL_LOG_INTERNAL_REGAL 0x931E +#define GL_LOG_DEBUG_REGAL 0x931F +#define GL_LOG_STATUS_REGAL 0x9320 +#define GL_LOG_HTTP_REGAL 0x9321 + +typedef void (APIENTRY *GLLOGPROCREGAL)(GLenum stream, GLsizei length, const GLchar *message, GLvoid *context); + +typedef void (GLAPIENTRY * PFNGLLOGMESSAGECALLBACKREGALPROC) (GLLOGPROCREGAL callback); + +#define glLogMessageCallbackREGAL GLEW_GET_FUN(__glewLogMessageCallbackREGAL) + +#define GLEW_REGAL_log GLEW_GET_VAR(__GLEW_REGAL_log) + +#endif /* GL_REGAL_log */ + +/* ----------------------- GL_REND_screen_coordinates ---------------------- */ + +#ifndef GL_REND_screen_coordinates +#define GL_REND_screen_coordinates 1 + +#define GL_SCREEN_COORDINATES_REND 0x8490 +#define GL_INVERTED_SCREEN_W_REND 0x8491 + +#define GLEW_REND_screen_coordinates GLEW_GET_VAR(__GLEW_REND_screen_coordinates) + +#endif /* GL_REND_screen_coordinates */ + +/* ------------------------------- GL_S3_s3tc ------------------------------ */ + +#ifndef GL_S3_s3tc +#define GL_S3_s3tc 1 + +#define GL_RGB_S3TC 0x83A0 +#define GL_RGB4_S3TC 0x83A1 +#define GL_RGBA_S3TC 0x83A2 +#define GL_RGBA4_S3TC 0x83A3 +#define GL_RGBA_DXT5_S3TC 0x83A4 +#define GL_RGBA4_DXT5_S3TC 0x83A5 + +#define GLEW_S3_s3tc GLEW_GET_VAR(__GLEW_S3_s3tc) + +#endif /* GL_S3_s3tc */ + +/* -------------------------- GL_SGIS_color_range -------------------------- */ + +#ifndef GL_SGIS_color_range +#define GL_SGIS_color_range 1 + +#define GL_EXTENDED_RANGE_SGIS 0x85A5 +#define GL_MIN_RED_SGIS 0x85A6 +#define GL_MAX_RED_SGIS 0x85A7 +#define GL_MIN_GREEN_SGIS 0x85A8 +#define GL_MAX_GREEN_SGIS 0x85A9 +#define GL_MIN_BLUE_SGIS 0x85AA +#define GL_MAX_BLUE_SGIS 0x85AB +#define GL_MIN_ALPHA_SGIS 0x85AC +#define GL_MAX_ALPHA_SGIS 0x85AD + +#define GLEW_SGIS_color_range GLEW_GET_VAR(__GLEW_SGIS_color_range) + +#endif /* GL_SGIS_color_range */ + +/* ------------------------- GL_SGIS_detail_texture ------------------------ */ + +#ifndef GL_SGIS_detail_texture +#define GL_SGIS_detail_texture 1 + +typedef void (GLAPIENTRY * PFNGLDETAILTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat* points); +typedef void (GLAPIENTRY * PFNGLGETDETAILTEXFUNCSGISPROC) (GLenum target, GLfloat* points); + +#define glDetailTexFuncSGIS GLEW_GET_FUN(__glewDetailTexFuncSGIS) +#define glGetDetailTexFuncSGIS GLEW_GET_FUN(__glewGetDetailTexFuncSGIS) + +#define GLEW_SGIS_detail_texture GLEW_GET_VAR(__GLEW_SGIS_detail_texture) + +#endif /* GL_SGIS_detail_texture */ + +/* -------------------------- GL_SGIS_fog_function ------------------------- */ + +#ifndef GL_SGIS_fog_function +#define GL_SGIS_fog_function 1 + +typedef void (GLAPIENTRY * PFNGLFOGFUNCSGISPROC) (GLsizei n, const GLfloat* points); +typedef void (GLAPIENTRY * PFNGLGETFOGFUNCSGISPROC) (GLfloat* points); + +#define glFogFuncSGIS GLEW_GET_FUN(__glewFogFuncSGIS) +#define glGetFogFuncSGIS GLEW_GET_FUN(__glewGetFogFuncSGIS) + +#define GLEW_SGIS_fog_function GLEW_GET_VAR(__GLEW_SGIS_fog_function) + +#endif /* GL_SGIS_fog_function */ + +/* ------------------------ GL_SGIS_generate_mipmap ------------------------ */ + +#ifndef GL_SGIS_generate_mipmap +#define GL_SGIS_generate_mipmap 1 + +#define GL_GENERATE_MIPMAP_SGIS 0x8191 +#define GL_GENERATE_MIPMAP_HINT_SGIS 0x8192 + +#define GLEW_SGIS_generate_mipmap GLEW_GET_VAR(__GLEW_SGIS_generate_mipmap) + +#endif /* GL_SGIS_generate_mipmap */ + +/* -------------------------- GL_SGIS_multisample -------------------------- */ + +#ifndef GL_SGIS_multisample +#define GL_SGIS_multisample 1 + +#define GL_MULTISAMPLE_SGIS 0x809D +#define GL_SAMPLE_ALPHA_TO_MASK_SGIS 0x809E +#define GL_SAMPLE_ALPHA_TO_ONE_SGIS 0x809F +#define GL_SAMPLE_MASK_SGIS 0x80A0 +#define GL_1PASS_SGIS 0x80A1 +#define GL_2PASS_0_SGIS 0x80A2 +#define GL_2PASS_1_SGIS 0x80A3 +#define GL_4PASS_0_SGIS 0x80A4 +#define GL_4PASS_1_SGIS 0x80A5 +#define GL_4PASS_2_SGIS 0x80A6 +#define GL_4PASS_3_SGIS 0x80A7 +#define GL_SAMPLE_BUFFERS_SGIS 0x80A8 +#define GL_SAMPLES_SGIS 0x80A9 +#define GL_SAMPLE_MASK_VALUE_SGIS 0x80AA +#define GL_SAMPLE_MASK_INVERT_SGIS 0x80AB +#define GL_SAMPLE_PATTERN_SGIS 0x80AC + +typedef void (GLAPIENTRY * PFNGLSAMPLEMASKSGISPROC) (GLclampf value, GLboolean invert); +typedef void (GLAPIENTRY * PFNGLSAMPLEPATTERNSGISPROC) (GLenum pattern); + +#define glSampleMaskSGIS GLEW_GET_FUN(__glewSampleMaskSGIS) +#define glSamplePatternSGIS GLEW_GET_FUN(__glewSamplePatternSGIS) + +#define GLEW_SGIS_multisample GLEW_GET_VAR(__GLEW_SGIS_multisample) + +#endif /* GL_SGIS_multisample */ + +/* ------------------------- GL_SGIS_pixel_texture ------------------------- */ + +#ifndef GL_SGIS_pixel_texture +#define GL_SGIS_pixel_texture 1 + +#define GLEW_SGIS_pixel_texture GLEW_GET_VAR(__GLEW_SGIS_pixel_texture) + +#endif /* GL_SGIS_pixel_texture */ + +/* ----------------------- GL_SGIS_point_line_texgen ----------------------- */ + +#ifndef GL_SGIS_point_line_texgen +#define GL_SGIS_point_line_texgen 1 + +#define GL_EYE_DISTANCE_TO_POINT_SGIS 0x81F0 +#define GL_OBJECT_DISTANCE_TO_POINT_SGIS 0x81F1 +#define GL_EYE_DISTANCE_TO_LINE_SGIS 0x81F2 +#define GL_OBJECT_DISTANCE_TO_LINE_SGIS 0x81F3 +#define GL_EYE_POINT_SGIS 0x81F4 +#define GL_OBJECT_POINT_SGIS 0x81F5 +#define GL_EYE_LINE_SGIS 0x81F6 +#define GL_OBJECT_LINE_SGIS 0x81F7 + +#define GLEW_SGIS_point_line_texgen GLEW_GET_VAR(__GLEW_SGIS_point_line_texgen) + +#endif /* GL_SGIS_point_line_texgen */ + +/* ------------------------ GL_SGIS_sharpen_texture ------------------------ */ + +#ifndef GL_SGIS_sharpen_texture +#define GL_SGIS_sharpen_texture 1 + +typedef void (GLAPIENTRY * PFNGLGETSHARPENTEXFUNCSGISPROC) (GLenum target, GLfloat* points); +typedef void (GLAPIENTRY * PFNGLSHARPENTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat* points); + +#define glGetSharpenTexFuncSGIS GLEW_GET_FUN(__glewGetSharpenTexFuncSGIS) +#define glSharpenTexFuncSGIS GLEW_GET_FUN(__glewSharpenTexFuncSGIS) + +#define GLEW_SGIS_sharpen_texture GLEW_GET_VAR(__GLEW_SGIS_sharpen_texture) + +#endif /* GL_SGIS_sharpen_texture */ + +/* --------------------------- GL_SGIS_texture4D --------------------------- */ + +#ifndef GL_SGIS_texture4D +#define GL_SGIS_texture4D 1 + +typedef void (GLAPIENTRY * PFNGLTEXIMAGE4DSGISPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLsizei extent, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (GLAPIENTRY * PFNGLTEXSUBIMAGE4DSGISPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint woffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei extent, GLenum format, GLenum type, const GLvoid *pixels); + +#define glTexImage4DSGIS GLEW_GET_FUN(__glewTexImage4DSGIS) +#define glTexSubImage4DSGIS GLEW_GET_FUN(__glewTexSubImage4DSGIS) + +#define GLEW_SGIS_texture4D GLEW_GET_VAR(__GLEW_SGIS_texture4D) + +#endif /* GL_SGIS_texture4D */ + +/* ---------------------- GL_SGIS_texture_border_clamp --------------------- */ + +#ifndef GL_SGIS_texture_border_clamp +#define GL_SGIS_texture_border_clamp 1 + +#define GL_CLAMP_TO_BORDER_SGIS 0x812D + +#define GLEW_SGIS_texture_border_clamp GLEW_GET_VAR(__GLEW_SGIS_texture_border_clamp) + +#endif /* GL_SGIS_texture_border_clamp */ + +/* ----------------------- GL_SGIS_texture_edge_clamp ---------------------- */ + +#ifndef GL_SGIS_texture_edge_clamp +#define GL_SGIS_texture_edge_clamp 1 + +#define GL_CLAMP_TO_EDGE_SGIS 0x812F + +#define GLEW_SGIS_texture_edge_clamp GLEW_GET_VAR(__GLEW_SGIS_texture_edge_clamp) + +#endif /* GL_SGIS_texture_edge_clamp */ + +/* ------------------------ GL_SGIS_texture_filter4 ------------------------ */ + +#ifndef GL_SGIS_texture_filter4 +#define GL_SGIS_texture_filter4 1 + +typedef void (GLAPIENTRY * PFNGLGETTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLfloat* weights); +typedef void (GLAPIENTRY * PFNGLTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLsizei n, const GLfloat* weights); + +#define glGetTexFilterFuncSGIS GLEW_GET_FUN(__glewGetTexFilterFuncSGIS) +#define glTexFilterFuncSGIS GLEW_GET_FUN(__glewTexFilterFuncSGIS) + +#define GLEW_SGIS_texture_filter4 GLEW_GET_VAR(__GLEW_SGIS_texture_filter4) + +#endif /* GL_SGIS_texture_filter4 */ + +/* -------------------------- GL_SGIS_texture_lod -------------------------- */ + +#ifndef GL_SGIS_texture_lod +#define GL_SGIS_texture_lod 1 + +#define GL_TEXTURE_MIN_LOD_SGIS 0x813A +#define GL_TEXTURE_MAX_LOD_SGIS 0x813B +#define GL_TEXTURE_BASE_LEVEL_SGIS 0x813C +#define GL_TEXTURE_MAX_LEVEL_SGIS 0x813D + +#define GLEW_SGIS_texture_lod GLEW_GET_VAR(__GLEW_SGIS_texture_lod) + +#endif /* GL_SGIS_texture_lod */ + +/* ------------------------- GL_SGIS_texture_select ------------------------ */ + +#ifndef GL_SGIS_texture_select +#define GL_SGIS_texture_select 1 + +#define GLEW_SGIS_texture_select GLEW_GET_VAR(__GLEW_SGIS_texture_select) + +#endif /* GL_SGIS_texture_select */ + +/* ----------------------------- GL_SGIX_async ----------------------------- */ + +#ifndef GL_SGIX_async +#define GL_SGIX_async 1 + +#define GL_ASYNC_MARKER_SGIX 0x8329 + +typedef void (GLAPIENTRY * PFNGLASYNCMARKERSGIXPROC) (GLuint marker); +typedef void (GLAPIENTRY * PFNGLDELETEASYNCMARKERSSGIXPROC) (GLuint marker, GLsizei range); +typedef GLint (GLAPIENTRY * PFNGLFINISHASYNCSGIXPROC) (GLuint* markerp); +typedef GLuint (GLAPIENTRY * PFNGLGENASYNCMARKERSSGIXPROC) (GLsizei range); +typedef GLboolean (GLAPIENTRY * PFNGLISASYNCMARKERSGIXPROC) (GLuint marker); +typedef GLint (GLAPIENTRY * PFNGLPOLLASYNCSGIXPROC) (GLuint* markerp); + +#define glAsyncMarkerSGIX GLEW_GET_FUN(__glewAsyncMarkerSGIX) +#define glDeleteAsyncMarkersSGIX GLEW_GET_FUN(__glewDeleteAsyncMarkersSGIX) +#define glFinishAsyncSGIX GLEW_GET_FUN(__glewFinishAsyncSGIX) +#define glGenAsyncMarkersSGIX GLEW_GET_FUN(__glewGenAsyncMarkersSGIX) +#define glIsAsyncMarkerSGIX GLEW_GET_FUN(__glewIsAsyncMarkerSGIX) +#define glPollAsyncSGIX GLEW_GET_FUN(__glewPollAsyncSGIX) + +#define GLEW_SGIX_async GLEW_GET_VAR(__GLEW_SGIX_async) + +#endif /* GL_SGIX_async */ + +/* ------------------------ GL_SGIX_async_histogram ------------------------ */ + +#ifndef GL_SGIX_async_histogram +#define GL_SGIX_async_histogram 1 + +#define GL_ASYNC_HISTOGRAM_SGIX 0x832C +#define GL_MAX_ASYNC_HISTOGRAM_SGIX 0x832D + +#define GLEW_SGIX_async_histogram GLEW_GET_VAR(__GLEW_SGIX_async_histogram) + +#endif /* GL_SGIX_async_histogram */ + +/* -------------------------- GL_SGIX_async_pixel -------------------------- */ + +#ifndef GL_SGIX_async_pixel +#define GL_SGIX_async_pixel 1 + +#define GL_ASYNC_TEX_IMAGE_SGIX 0x835C +#define GL_ASYNC_DRAW_PIXELS_SGIX 0x835D +#define GL_ASYNC_READ_PIXELS_SGIX 0x835E +#define GL_MAX_ASYNC_TEX_IMAGE_SGIX 0x835F +#define GL_MAX_ASYNC_DRAW_PIXELS_SGIX 0x8360 +#define GL_MAX_ASYNC_READ_PIXELS_SGIX 0x8361 + +#define GLEW_SGIX_async_pixel GLEW_GET_VAR(__GLEW_SGIX_async_pixel) + +#endif /* GL_SGIX_async_pixel */ + +/* ----------------------- GL_SGIX_blend_alpha_minmax ---------------------- */ + +#ifndef GL_SGIX_blend_alpha_minmax +#define GL_SGIX_blend_alpha_minmax 1 + +#define GL_ALPHA_MIN_SGIX 0x8320 +#define GL_ALPHA_MAX_SGIX 0x8321 + +#define GLEW_SGIX_blend_alpha_minmax GLEW_GET_VAR(__GLEW_SGIX_blend_alpha_minmax) + +#endif /* GL_SGIX_blend_alpha_minmax */ + +/* ---------------------------- GL_SGIX_clipmap ---------------------------- */ + +#ifndef GL_SGIX_clipmap +#define GL_SGIX_clipmap 1 + +#define GLEW_SGIX_clipmap GLEW_GET_VAR(__GLEW_SGIX_clipmap) + +#endif /* GL_SGIX_clipmap */ + +/* ---------------------- GL_SGIX_convolution_accuracy --------------------- */ + +#ifndef GL_SGIX_convolution_accuracy +#define GL_SGIX_convolution_accuracy 1 + +#define GL_CONVOLUTION_HINT_SGIX 0x8316 + +#define GLEW_SGIX_convolution_accuracy GLEW_GET_VAR(__GLEW_SGIX_convolution_accuracy) + +#endif /* GL_SGIX_convolution_accuracy */ + +/* ------------------------- GL_SGIX_depth_texture ------------------------- */ + +#ifndef GL_SGIX_depth_texture +#define GL_SGIX_depth_texture 1 + +#define GL_DEPTH_COMPONENT16_SGIX 0x81A5 +#define GL_DEPTH_COMPONENT24_SGIX 0x81A6 +#define GL_DEPTH_COMPONENT32_SGIX 0x81A7 + +#define GLEW_SGIX_depth_texture GLEW_GET_VAR(__GLEW_SGIX_depth_texture) + +#endif /* GL_SGIX_depth_texture */ + +/* -------------------------- GL_SGIX_flush_raster ------------------------- */ + +#ifndef GL_SGIX_flush_raster +#define GL_SGIX_flush_raster 1 + +typedef void (GLAPIENTRY * PFNGLFLUSHRASTERSGIXPROC) (void); + +#define glFlushRasterSGIX GLEW_GET_FUN(__glewFlushRasterSGIX) + +#define GLEW_SGIX_flush_raster GLEW_GET_VAR(__GLEW_SGIX_flush_raster) + +#endif /* GL_SGIX_flush_raster */ + +/* --------------------------- GL_SGIX_fog_offset -------------------------- */ + +#ifndef GL_SGIX_fog_offset +#define GL_SGIX_fog_offset 1 + +#define GL_FOG_OFFSET_SGIX 0x8198 +#define GL_FOG_OFFSET_VALUE_SGIX 0x8199 + +#define GLEW_SGIX_fog_offset GLEW_GET_VAR(__GLEW_SGIX_fog_offset) + +#endif /* GL_SGIX_fog_offset */ + +/* -------------------------- GL_SGIX_fog_texture -------------------------- */ + +#ifndef GL_SGIX_fog_texture +#define GL_SGIX_fog_texture 1 + +#define GL_TEXTURE_FOG_SGIX 0 +#define GL_FOG_PATCHY_FACTOR_SGIX 0 +#define GL_FRAGMENT_FOG_SGIX 0 + +typedef void (GLAPIENTRY * PFNGLTEXTUREFOGSGIXPROC) (GLenum pname); + +#define glTextureFogSGIX GLEW_GET_FUN(__glewTextureFogSGIX) + +#define GLEW_SGIX_fog_texture GLEW_GET_VAR(__GLEW_SGIX_fog_texture) + +#endif /* GL_SGIX_fog_texture */ + +/* ------------------- GL_SGIX_fragment_specular_lighting ------------------ */ + +#ifndef GL_SGIX_fragment_specular_lighting +#define GL_SGIX_fragment_specular_lighting 1 + +typedef void (GLAPIENTRY * PFNGLFRAGMENTCOLORMATERIALSGIXPROC) (GLenum face, GLenum mode); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELFSGIXPROC) (GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELFVSGIXPROC) (GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELISGIXPROC) (GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELIVSGIXPROC) (GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTFSGIXPROC) (GLenum light, GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTISGIXPROC) (GLenum light, GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALFSGIXPROC) (GLenum face, GLenum pname, const GLfloat param); +typedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALISGIXPROC) (GLenum face, GLenum pname, const GLint param); +typedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLGETFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum value, GLfloat* data); +typedef void (GLAPIENTRY * PFNGLGETFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum value, GLint* data); +typedef void (GLAPIENTRY * PFNGLGETFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, const GLfloat* data); +typedef void (GLAPIENTRY * PFNGLGETFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, const GLint* data); + +#define glFragmentColorMaterialSGIX GLEW_GET_FUN(__glewFragmentColorMaterialSGIX) +#define glFragmentLightModelfSGIX GLEW_GET_FUN(__glewFragmentLightModelfSGIX) +#define glFragmentLightModelfvSGIX GLEW_GET_FUN(__glewFragmentLightModelfvSGIX) +#define glFragmentLightModeliSGIX GLEW_GET_FUN(__glewFragmentLightModeliSGIX) +#define glFragmentLightModelivSGIX GLEW_GET_FUN(__glewFragmentLightModelivSGIX) +#define glFragmentLightfSGIX GLEW_GET_FUN(__glewFragmentLightfSGIX) +#define glFragmentLightfvSGIX GLEW_GET_FUN(__glewFragmentLightfvSGIX) +#define glFragmentLightiSGIX GLEW_GET_FUN(__glewFragmentLightiSGIX) +#define glFragmentLightivSGIX GLEW_GET_FUN(__glewFragmentLightivSGIX) +#define glFragmentMaterialfSGIX GLEW_GET_FUN(__glewFragmentMaterialfSGIX) +#define glFragmentMaterialfvSGIX GLEW_GET_FUN(__glewFragmentMaterialfvSGIX) +#define glFragmentMaterialiSGIX GLEW_GET_FUN(__glewFragmentMaterialiSGIX) +#define glFragmentMaterialivSGIX GLEW_GET_FUN(__glewFragmentMaterialivSGIX) +#define glGetFragmentLightfvSGIX GLEW_GET_FUN(__glewGetFragmentLightfvSGIX) +#define glGetFragmentLightivSGIX GLEW_GET_FUN(__glewGetFragmentLightivSGIX) +#define glGetFragmentMaterialfvSGIX GLEW_GET_FUN(__glewGetFragmentMaterialfvSGIX) +#define glGetFragmentMaterialivSGIX GLEW_GET_FUN(__glewGetFragmentMaterialivSGIX) + +#define GLEW_SGIX_fragment_specular_lighting GLEW_GET_VAR(__GLEW_SGIX_fragment_specular_lighting) + +#endif /* GL_SGIX_fragment_specular_lighting */ + +/* --------------------------- GL_SGIX_framezoom --------------------------- */ + +#ifndef GL_SGIX_framezoom +#define GL_SGIX_framezoom 1 + +typedef void (GLAPIENTRY * PFNGLFRAMEZOOMSGIXPROC) (GLint factor); + +#define glFrameZoomSGIX GLEW_GET_FUN(__glewFrameZoomSGIX) + +#define GLEW_SGIX_framezoom GLEW_GET_VAR(__GLEW_SGIX_framezoom) + +#endif /* GL_SGIX_framezoom */ + +/* --------------------------- GL_SGIX_interlace --------------------------- */ + +#ifndef GL_SGIX_interlace +#define GL_SGIX_interlace 1 + +#define GL_INTERLACE_SGIX 0x8094 + +#define GLEW_SGIX_interlace GLEW_GET_VAR(__GLEW_SGIX_interlace) + +#endif /* GL_SGIX_interlace */ + +/* ------------------------- GL_SGIX_ir_instrument1 ------------------------ */ + +#ifndef GL_SGIX_ir_instrument1 +#define GL_SGIX_ir_instrument1 1 + +#define GLEW_SGIX_ir_instrument1 GLEW_GET_VAR(__GLEW_SGIX_ir_instrument1) + +#endif /* GL_SGIX_ir_instrument1 */ + +/* ------------------------- GL_SGIX_list_priority ------------------------- */ + +#ifndef GL_SGIX_list_priority +#define GL_SGIX_list_priority 1 + +#define GLEW_SGIX_list_priority GLEW_GET_VAR(__GLEW_SGIX_list_priority) + +#endif /* GL_SGIX_list_priority */ + +/* ------------------------- GL_SGIX_pixel_texture ------------------------- */ + +#ifndef GL_SGIX_pixel_texture +#define GL_SGIX_pixel_texture 1 + +typedef void (GLAPIENTRY * PFNGLPIXELTEXGENSGIXPROC) (GLenum mode); + +#define glPixelTexGenSGIX GLEW_GET_FUN(__glewPixelTexGenSGIX) + +#define GLEW_SGIX_pixel_texture GLEW_GET_VAR(__GLEW_SGIX_pixel_texture) + +#endif /* GL_SGIX_pixel_texture */ + +/* ----------------------- GL_SGIX_pixel_texture_bits ---------------------- */ + +#ifndef GL_SGIX_pixel_texture_bits +#define GL_SGIX_pixel_texture_bits 1 + +#define GLEW_SGIX_pixel_texture_bits GLEW_GET_VAR(__GLEW_SGIX_pixel_texture_bits) + +#endif /* GL_SGIX_pixel_texture_bits */ + +/* ------------------------ GL_SGIX_reference_plane ------------------------ */ + +#ifndef GL_SGIX_reference_plane +#define GL_SGIX_reference_plane 1 + +typedef void (GLAPIENTRY * PFNGLREFERENCEPLANESGIXPROC) (const GLdouble* equation); + +#define glReferencePlaneSGIX GLEW_GET_FUN(__glewReferencePlaneSGIX) + +#define GLEW_SGIX_reference_plane GLEW_GET_VAR(__GLEW_SGIX_reference_plane) + +#endif /* GL_SGIX_reference_plane */ + +/* ---------------------------- GL_SGIX_resample --------------------------- */ + +#ifndef GL_SGIX_resample +#define GL_SGIX_resample 1 + +#define GL_PACK_RESAMPLE_SGIX 0x842E +#define GL_UNPACK_RESAMPLE_SGIX 0x842F +#define GL_RESAMPLE_DECIMATE_SGIX 0x8430 +#define GL_RESAMPLE_REPLICATE_SGIX 0x8433 +#define GL_RESAMPLE_ZERO_FILL_SGIX 0x8434 + +#define GLEW_SGIX_resample GLEW_GET_VAR(__GLEW_SGIX_resample) + +#endif /* GL_SGIX_resample */ + +/* ----------------------------- GL_SGIX_shadow ---------------------------- */ + +#ifndef GL_SGIX_shadow +#define GL_SGIX_shadow 1 + +#define GL_TEXTURE_COMPARE_SGIX 0x819A +#define GL_TEXTURE_COMPARE_OPERATOR_SGIX 0x819B +#define GL_TEXTURE_LEQUAL_R_SGIX 0x819C +#define GL_TEXTURE_GEQUAL_R_SGIX 0x819D + +#define GLEW_SGIX_shadow GLEW_GET_VAR(__GLEW_SGIX_shadow) + +#endif /* GL_SGIX_shadow */ + +/* ------------------------- GL_SGIX_shadow_ambient ------------------------ */ + +#ifndef GL_SGIX_shadow_ambient +#define GL_SGIX_shadow_ambient 1 + +#define GL_SHADOW_AMBIENT_SGIX 0x80BF + +#define GLEW_SGIX_shadow_ambient GLEW_GET_VAR(__GLEW_SGIX_shadow_ambient) + +#endif /* GL_SGIX_shadow_ambient */ + +/* ----------------------------- GL_SGIX_sprite ---------------------------- */ + +#ifndef GL_SGIX_sprite +#define GL_SGIX_sprite 1 + +typedef void (GLAPIENTRY * PFNGLSPRITEPARAMETERFSGIXPROC) (GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLSPRITEPARAMETERFVSGIXPROC) (GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLSPRITEPARAMETERISGIXPROC) (GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLSPRITEPARAMETERIVSGIXPROC) (GLenum pname, GLint* params); + +#define glSpriteParameterfSGIX GLEW_GET_FUN(__glewSpriteParameterfSGIX) +#define glSpriteParameterfvSGIX GLEW_GET_FUN(__glewSpriteParameterfvSGIX) +#define glSpriteParameteriSGIX GLEW_GET_FUN(__glewSpriteParameteriSGIX) +#define glSpriteParameterivSGIX GLEW_GET_FUN(__glewSpriteParameterivSGIX) + +#define GLEW_SGIX_sprite GLEW_GET_VAR(__GLEW_SGIX_sprite) + +#endif /* GL_SGIX_sprite */ + +/* ----------------------- GL_SGIX_tag_sample_buffer ----------------------- */ + +#ifndef GL_SGIX_tag_sample_buffer +#define GL_SGIX_tag_sample_buffer 1 + +typedef void (GLAPIENTRY * PFNGLTAGSAMPLEBUFFERSGIXPROC) (void); + +#define glTagSampleBufferSGIX GLEW_GET_FUN(__glewTagSampleBufferSGIX) + +#define GLEW_SGIX_tag_sample_buffer GLEW_GET_VAR(__GLEW_SGIX_tag_sample_buffer) + +#endif /* GL_SGIX_tag_sample_buffer */ + +/* ------------------------ GL_SGIX_texture_add_env ------------------------ */ + +#ifndef GL_SGIX_texture_add_env +#define GL_SGIX_texture_add_env 1 + +#define GLEW_SGIX_texture_add_env GLEW_GET_VAR(__GLEW_SGIX_texture_add_env) + +#endif /* GL_SGIX_texture_add_env */ + +/* -------------------- GL_SGIX_texture_coordinate_clamp ------------------- */ + +#ifndef GL_SGIX_texture_coordinate_clamp +#define GL_SGIX_texture_coordinate_clamp 1 + +#define GL_TEXTURE_MAX_CLAMP_S_SGIX 0x8369 +#define GL_TEXTURE_MAX_CLAMP_T_SGIX 0x836A +#define GL_TEXTURE_MAX_CLAMP_R_SGIX 0x836B + +#define GLEW_SGIX_texture_coordinate_clamp GLEW_GET_VAR(__GLEW_SGIX_texture_coordinate_clamp) + +#endif /* GL_SGIX_texture_coordinate_clamp */ + +/* ------------------------ GL_SGIX_texture_lod_bias ----------------------- */ + +#ifndef GL_SGIX_texture_lod_bias +#define GL_SGIX_texture_lod_bias 1 + +#define GLEW_SGIX_texture_lod_bias GLEW_GET_VAR(__GLEW_SGIX_texture_lod_bias) + +#endif /* GL_SGIX_texture_lod_bias */ + +/* ---------------------- GL_SGIX_texture_multi_buffer --------------------- */ + +#ifndef GL_SGIX_texture_multi_buffer +#define GL_SGIX_texture_multi_buffer 1 + +#define GL_TEXTURE_MULTI_BUFFER_HINT_SGIX 0x812E + +#define GLEW_SGIX_texture_multi_buffer GLEW_GET_VAR(__GLEW_SGIX_texture_multi_buffer) + +#endif /* GL_SGIX_texture_multi_buffer */ + +/* ------------------------- GL_SGIX_texture_range ------------------------- */ + +#ifndef GL_SGIX_texture_range +#define GL_SGIX_texture_range 1 + +#define GL_RGB_SIGNED_SGIX 0x85E0 +#define GL_RGBA_SIGNED_SGIX 0x85E1 +#define GL_ALPHA_SIGNED_SGIX 0x85E2 +#define GL_LUMINANCE_SIGNED_SGIX 0x85E3 +#define GL_INTENSITY_SIGNED_SGIX 0x85E4 +#define GL_LUMINANCE_ALPHA_SIGNED_SGIX 0x85E5 +#define GL_RGB16_SIGNED_SGIX 0x85E6 +#define GL_RGBA16_SIGNED_SGIX 0x85E7 +#define GL_ALPHA16_SIGNED_SGIX 0x85E8 +#define GL_LUMINANCE16_SIGNED_SGIX 0x85E9 +#define GL_INTENSITY16_SIGNED_SGIX 0x85EA +#define GL_LUMINANCE16_ALPHA16_SIGNED_SGIX 0x85EB +#define GL_RGB_EXTENDED_RANGE_SGIX 0x85EC +#define GL_RGBA_EXTENDED_RANGE_SGIX 0x85ED +#define GL_ALPHA_EXTENDED_RANGE_SGIX 0x85EE +#define GL_LUMINANCE_EXTENDED_RANGE_SGIX 0x85EF +#define GL_INTENSITY_EXTENDED_RANGE_SGIX 0x85F0 +#define GL_LUMINANCE_ALPHA_EXTENDED_RANGE_SGIX 0x85F1 +#define GL_RGB16_EXTENDED_RANGE_SGIX 0x85F2 +#define GL_RGBA16_EXTENDED_RANGE_SGIX 0x85F3 +#define GL_ALPHA16_EXTENDED_RANGE_SGIX 0x85F4 +#define GL_LUMINANCE16_EXTENDED_RANGE_SGIX 0x85F5 +#define GL_INTENSITY16_EXTENDED_RANGE_SGIX 0x85F6 +#define GL_LUMINANCE16_ALPHA16_EXTENDED_RANGE_SGIX 0x85F7 +#define GL_MIN_LUMINANCE_SGIS 0x85F8 +#define GL_MAX_LUMINANCE_SGIS 0x85F9 +#define GL_MIN_INTENSITY_SGIS 0x85FA +#define GL_MAX_INTENSITY_SGIS 0x85FB + +#define GLEW_SGIX_texture_range GLEW_GET_VAR(__GLEW_SGIX_texture_range) + +#endif /* GL_SGIX_texture_range */ + +/* ----------------------- GL_SGIX_texture_scale_bias ---------------------- */ + +#ifndef GL_SGIX_texture_scale_bias +#define GL_SGIX_texture_scale_bias 1 + +#define GL_POST_TEXTURE_FILTER_BIAS_SGIX 0x8179 +#define GL_POST_TEXTURE_FILTER_SCALE_SGIX 0x817A +#define GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX 0x817B +#define GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX 0x817C + +#define GLEW_SGIX_texture_scale_bias GLEW_GET_VAR(__GLEW_SGIX_texture_scale_bias) + +#endif /* GL_SGIX_texture_scale_bias */ + +/* ------------------------- GL_SGIX_vertex_preclip ------------------------ */ + +#ifndef GL_SGIX_vertex_preclip +#define GL_SGIX_vertex_preclip 1 + +#define GL_VERTEX_PRECLIP_SGIX 0x83EE +#define GL_VERTEX_PRECLIP_HINT_SGIX 0x83EF + +#define GLEW_SGIX_vertex_preclip GLEW_GET_VAR(__GLEW_SGIX_vertex_preclip) + +#endif /* GL_SGIX_vertex_preclip */ + +/* ---------------------- GL_SGIX_vertex_preclip_hint ---------------------- */ + +#ifndef GL_SGIX_vertex_preclip_hint +#define GL_SGIX_vertex_preclip_hint 1 + +#define GL_VERTEX_PRECLIP_SGIX 0x83EE +#define GL_VERTEX_PRECLIP_HINT_SGIX 0x83EF + +#define GLEW_SGIX_vertex_preclip_hint GLEW_GET_VAR(__GLEW_SGIX_vertex_preclip_hint) + +#endif /* GL_SGIX_vertex_preclip_hint */ + +/* ----------------------------- GL_SGIX_ycrcb ----------------------------- */ + +#ifndef GL_SGIX_ycrcb +#define GL_SGIX_ycrcb 1 + +#define GLEW_SGIX_ycrcb GLEW_GET_VAR(__GLEW_SGIX_ycrcb) + +#endif /* GL_SGIX_ycrcb */ + +/* -------------------------- GL_SGI_color_matrix -------------------------- */ + +#ifndef GL_SGI_color_matrix +#define GL_SGI_color_matrix 1 + +#define GL_COLOR_MATRIX_SGI 0x80B1 +#define GL_COLOR_MATRIX_STACK_DEPTH_SGI 0x80B2 +#define GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI 0x80B3 +#define GL_POST_COLOR_MATRIX_RED_SCALE_SGI 0x80B4 +#define GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI 0x80B5 +#define GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI 0x80B6 +#define GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI 0x80B7 +#define GL_POST_COLOR_MATRIX_RED_BIAS_SGI 0x80B8 +#define GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI 0x80B9 +#define GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI 0x80BA +#define GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI 0x80BB + +#define GLEW_SGI_color_matrix GLEW_GET_VAR(__GLEW_SGI_color_matrix) + +#endif /* GL_SGI_color_matrix */ + +/* --------------------------- GL_SGI_color_table -------------------------- */ + +#ifndef GL_SGI_color_table +#define GL_SGI_color_table 1 + +#define GL_COLOR_TABLE_SGI 0x80D0 +#define GL_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D1 +#define GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D2 +#define GL_PROXY_COLOR_TABLE_SGI 0x80D3 +#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D4 +#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D5 +#define GL_COLOR_TABLE_SCALE_SGI 0x80D6 +#define GL_COLOR_TABLE_BIAS_SGI 0x80D7 +#define GL_COLOR_TABLE_FORMAT_SGI 0x80D8 +#define GL_COLOR_TABLE_WIDTH_SGI 0x80D9 +#define GL_COLOR_TABLE_RED_SIZE_SGI 0x80DA +#define GL_COLOR_TABLE_GREEN_SIZE_SGI 0x80DB +#define GL_COLOR_TABLE_BLUE_SIZE_SGI 0x80DC +#define GL_COLOR_TABLE_ALPHA_SIZE_SGI 0x80DD +#define GL_COLOR_TABLE_LUMINANCE_SIZE_SGI 0x80DE +#define GL_COLOR_TABLE_INTENSITY_SIZE_SGI 0x80DF + +typedef void (GLAPIENTRY * PFNGLCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table); +typedef void (GLAPIENTRY * PFNGLCOPYCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETCOLORTABLESGIPROC) (GLenum target, GLenum format, GLenum type, GLvoid *table); + +#define glColorTableParameterfvSGI GLEW_GET_FUN(__glewColorTableParameterfvSGI) +#define glColorTableParameterivSGI GLEW_GET_FUN(__glewColorTableParameterivSGI) +#define glColorTableSGI GLEW_GET_FUN(__glewColorTableSGI) +#define glCopyColorTableSGI GLEW_GET_FUN(__glewCopyColorTableSGI) +#define glGetColorTableParameterfvSGI GLEW_GET_FUN(__glewGetColorTableParameterfvSGI) +#define glGetColorTableParameterivSGI GLEW_GET_FUN(__glewGetColorTableParameterivSGI) +#define glGetColorTableSGI GLEW_GET_FUN(__glewGetColorTableSGI) + +#define GLEW_SGI_color_table GLEW_GET_VAR(__GLEW_SGI_color_table) + +#endif /* GL_SGI_color_table */ + +/* ----------------------- GL_SGI_texture_color_table ---------------------- */ + +#ifndef GL_SGI_texture_color_table +#define GL_SGI_texture_color_table 1 + +#define GL_TEXTURE_COLOR_TABLE_SGI 0x80BC +#define GL_PROXY_TEXTURE_COLOR_TABLE_SGI 0x80BD + +#define GLEW_SGI_texture_color_table GLEW_GET_VAR(__GLEW_SGI_texture_color_table) + +#endif /* GL_SGI_texture_color_table */ + +/* ------------------------- GL_SUNX_constant_data ------------------------- */ + +#ifndef GL_SUNX_constant_data +#define GL_SUNX_constant_data 1 + +#define GL_UNPACK_CONSTANT_DATA_SUNX 0x81D5 +#define GL_TEXTURE_CONSTANT_DATA_SUNX 0x81D6 + +typedef void (GLAPIENTRY * PFNGLFINISHTEXTURESUNXPROC) (void); + +#define glFinishTextureSUNX GLEW_GET_FUN(__glewFinishTextureSUNX) + +#define GLEW_SUNX_constant_data GLEW_GET_VAR(__GLEW_SUNX_constant_data) + +#endif /* GL_SUNX_constant_data */ + +/* -------------------- GL_SUN_convolution_border_modes -------------------- */ + +#ifndef GL_SUN_convolution_border_modes +#define GL_SUN_convolution_border_modes 1 + +#define GL_WRAP_BORDER_SUN 0x81D4 + +#define GLEW_SUN_convolution_border_modes GLEW_GET_VAR(__GLEW_SUN_convolution_border_modes) + +#endif /* GL_SUN_convolution_border_modes */ + +/* -------------------------- GL_SUN_global_alpha -------------------------- */ + +#ifndef GL_SUN_global_alpha +#define GL_SUN_global_alpha 1 + +#define GL_GLOBAL_ALPHA_SUN 0x81D9 +#define GL_GLOBAL_ALPHA_FACTOR_SUN 0x81DA + +typedef void (GLAPIENTRY * PFNGLGLOBALALPHAFACTORBSUNPROC) (GLbyte factor); +typedef void (GLAPIENTRY * PFNGLGLOBALALPHAFACTORDSUNPROC) (GLdouble factor); +typedef void (GLAPIENTRY * PFNGLGLOBALALPHAFACTORFSUNPROC) (GLfloat factor); +typedef void (GLAPIENTRY * PFNGLGLOBALALPHAFACTORISUNPROC) (GLint factor); +typedef void (GLAPIENTRY * PFNGLGLOBALALPHAFACTORSSUNPROC) (GLshort factor); +typedef void (GLAPIENTRY * PFNGLGLOBALALPHAFACTORUBSUNPROC) (GLubyte factor); +typedef void (GLAPIENTRY * PFNGLGLOBALALPHAFACTORUISUNPROC) (GLuint factor); +typedef void (GLAPIENTRY * PFNGLGLOBALALPHAFACTORUSSUNPROC) (GLushort factor); + +#define glGlobalAlphaFactorbSUN GLEW_GET_FUN(__glewGlobalAlphaFactorbSUN) +#define glGlobalAlphaFactordSUN GLEW_GET_FUN(__glewGlobalAlphaFactordSUN) +#define glGlobalAlphaFactorfSUN GLEW_GET_FUN(__glewGlobalAlphaFactorfSUN) +#define glGlobalAlphaFactoriSUN GLEW_GET_FUN(__glewGlobalAlphaFactoriSUN) +#define glGlobalAlphaFactorsSUN GLEW_GET_FUN(__glewGlobalAlphaFactorsSUN) +#define glGlobalAlphaFactorubSUN GLEW_GET_FUN(__glewGlobalAlphaFactorubSUN) +#define glGlobalAlphaFactoruiSUN GLEW_GET_FUN(__glewGlobalAlphaFactoruiSUN) +#define glGlobalAlphaFactorusSUN GLEW_GET_FUN(__glewGlobalAlphaFactorusSUN) + +#define GLEW_SUN_global_alpha GLEW_GET_VAR(__GLEW_SUN_global_alpha) + +#endif /* GL_SUN_global_alpha */ + +/* --------------------------- GL_SUN_mesh_array --------------------------- */ + +#ifndef GL_SUN_mesh_array +#define GL_SUN_mesh_array 1 + +#define GL_QUAD_MESH_SUN 0x8614 +#define GL_TRIANGLE_MESH_SUN 0x8615 + +#define GLEW_SUN_mesh_array GLEW_GET_VAR(__GLEW_SUN_mesh_array) + +#endif /* GL_SUN_mesh_array */ + +/* ------------------------ GL_SUN_read_video_pixels ----------------------- */ + +#ifndef GL_SUN_read_video_pixels +#define GL_SUN_read_video_pixels 1 + +typedef void (GLAPIENTRY * PFNGLREADVIDEOPIXELSSUNPROC) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid* pixels); + +#define glReadVideoPixelsSUN GLEW_GET_FUN(__glewReadVideoPixelsSUN) + +#define GLEW_SUN_read_video_pixels GLEW_GET_VAR(__GLEW_SUN_read_video_pixels) + +#endif /* GL_SUN_read_video_pixels */ + +/* --------------------------- GL_SUN_slice_accum -------------------------- */ + +#ifndef GL_SUN_slice_accum +#define GL_SUN_slice_accum 1 + +#define GL_SLICE_ACCUM_SUN 0x85CC + +#define GLEW_SUN_slice_accum GLEW_GET_VAR(__GLEW_SUN_slice_accum) + +#endif /* GL_SUN_slice_accum */ + +/* -------------------------- GL_SUN_triangle_list ------------------------- */ + +#ifndef GL_SUN_triangle_list +#define GL_SUN_triangle_list 1 + +#define GL_RESTART_SUN 0x01 +#define GL_REPLACE_MIDDLE_SUN 0x02 +#define GL_REPLACE_OLDEST_SUN 0x03 +#define GL_TRIANGLE_LIST_SUN 0x81D7 +#define GL_REPLACEMENT_CODE_SUN 0x81D8 +#define GL_REPLACEMENT_CODE_ARRAY_SUN 0x85C0 +#define GL_REPLACEMENT_CODE_ARRAY_TYPE_SUN 0x85C1 +#define GL_REPLACEMENT_CODE_ARRAY_STRIDE_SUN 0x85C2 +#define GL_REPLACEMENT_CODE_ARRAY_POINTER_SUN 0x85C3 +#define GL_R1UI_V3F_SUN 0x85C4 +#define GL_R1UI_C4UB_V3F_SUN 0x85C5 +#define GL_R1UI_C3F_V3F_SUN 0x85C6 +#define GL_R1UI_N3F_V3F_SUN 0x85C7 +#define GL_R1UI_C4F_N3F_V3F_SUN 0x85C8 +#define GL_R1UI_T2F_V3F_SUN 0x85C9 +#define GL_R1UI_T2F_N3F_V3F_SUN 0x85CA +#define GL_R1UI_T2F_C4F_N3F_V3F_SUN 0x85CB + +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEPOINTERSUNPROC) (GLenum type, GLsizei stride, const GLvoid *pointer); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUBSUNPROC) (GLubyte code); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUBVSUNPROC) (const GLubyte* code); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUISUNPROC) (GLuint code); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUIVSUNPROC) (const GLuint* code); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUSSUNPROC) (GLushort code); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUSVSUNPROC) (const GLushort* code); + +#define glReplacementCodePointerSUN GLEW_GET_FUN(__glewReplacementCodePointerSUN) +#define glReplacementCodeubSUN GLEW_GET_FUN(__glewReplacementCodeubSUN) +#define glReplacementCodeubvSUN GLEW_GET_FUN(__glewReplacementCodeubvSUN) +#define glReplacementCodeuiSUN GLEW_GET_FUN(__glewReplacementCodeuiSUN) +#define glReplacementCodeuivSUN GLEW_GET_FUN(__glewReplacementCodeuivSUN) +#define glReplacementCodeusSUN GLEW_GET_FUN(__glewReplacementCodeusSUN) +#define glReplacementCodeusvSUN GLEW_GET_FUN(__glewReplacementCodeusvSUN) + +#define GLEW_SUN_triangle_list GLEW_GET_VAR(__GLEW_SUN_triangle_list) + +#endif /* GL_SUN_triangle_list */ + +/* ----------------------------- GL_SUN_vertex ----------------------------- */ + +#ifndef GL_SUN_vertex +#define GL_SUN_vertex 1 + +typedef void (GLAPIENTRY * PFNGLCOLOR3FVERTEX3FSUNPROC) (GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLCOLOR3FVERTEX3FVSUNPROC) (const GLfloat* c, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat* c, const GLfloat *n, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLCOLOR4UBVERTEX2FSUNPROC) (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y); +typedef void (GLAPIENTRY * PFNGLCOLOR4UBVERTEX2FVSUNPROC) (const GLubyte* c, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLCOLOR4UBVERTEX3FSUNPROC) (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLCOLOR4UBVERTEX3FVSUNPROC) (const GLubyte* c, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLNORMAL3FVERTEX3FSUNPROC) (GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLNORMAL3FVERTEX3FVSUNPROC) (const GLfloat* n, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FSUNPROC) (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FVSUNPROC) (const GLuint* rc, const GLfloat *c, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLuint* rc, const GLfloat *c, const GLfloat *n, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FSUNPROC) (GLuint rc, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FVSUNPROC) (const GLuint* rc, const GLubyte *c, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FVSUNPROC) (const GLuint* rc, const GLfloat *n, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLuint* rc, const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FVSUNPROC) (const GLuint* rc, const GLfloat *tc, const GLfloat *n, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FVSUNPROC) (const GLuint* rc, const GLfloat *tc, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUIVERTEX3FSUNPROC) (GLuint rc, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUIVERTEX3FVSUNPROC) (const GLuint* rc, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLTEXCOORD2FCOLOR3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLTEXCOORD2FCOLOR3FVERTEX3FVSUNPROC) (const GLfloat* tc, const GLfloat *c, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat* tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLTEXCOORD2FCOLOR4UBVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLTEXCOORD2FCOLOR4UBVERTEX3FVSUNPROC) (const GLfloat* tc, const GLubyte *c, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLTEXCOORD2FNORMAL3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLTEXCOORD2FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat* tc, const GLfloat *n, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLTEXCOORD2FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLTEXCOORD2FVERTEX3FVSUNPROC) (const GLfloat* tc, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FSUNPROC) (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (GLAPIENTRY * PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FVSUNPROC) (const GLfloat* tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLTEXCOORD4FVERTEX4FSUNPROC) (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (GLAPIENTRY * PFNGLTEXCOORD4FVERTEX4FVSUNPROC) (const GLfloat* tc, const GLfloat *v); + +#define glColor3fVertex3fSUN GLEW_GET_FUN(__glewColor3fVertex3fSUN) +#define glColor3fVertex3fvSUN GLEW_GET_FUN(__glewColor3fVertex3fvSUN) +#define glColor4fNormal3fVertex3fSUN GLEW_GET_FUN(__glewColor4fNormal3fVertex3fSUN) +#define glColor4fNormal3fVertex3fvSUN GLEW_GET_FUN(__glewColor4fNormal3fVertex3fvSUN) +#define glColor4ubVertex2fSUN GLEW_GET_FUN(__glewColor4ubVertex2fSUN) +#define glColor4ubVertex2fvSUN GLEW_GET_FUN(__glewColor4ubVertex2fvSUN) +#define glColor4ubVertex3fSUN GLEW_GET_FUN(__glewColor4ubVertex3fSUN) +#define glColor4ubVertex3fvSUN GLEW_GET_FUN(__glewColor4ubVertex3fvSUN) +#define glNormal3fVertex3fSUN GLEW_GET_FUN(__glewNormal3fVertex3fSUN) +#define glNormal3fVertex3fvSUN GLEW_GET_FUN(__glewNormal3fVertex3fvSUN) +#define glReplacementCodeuiColor3fVertex3fSUN GLEW_GET_FUN(__glewReplacementCodeuiColor3fVertex3fSUN) +#define glReplacementCodeuiColor3fVertex3fvSUN GLEW_GET_FUN(__glewReplacementCodeuiColor3fVertex3fvSUN) +#define glReplacementCodeuiColor4fNormal3fVertex3fSUN GLEW_GET_FUN(__glewReplacementCodeuiColor4fNormal3fVertex3fSUN) +#define glReplacementCodeuiColor4fNormal3fVertex3fvSUN GLEW_GET_FUN(__glewReplacementCodeuiColor4fNormal3fVertex3fvSUN) +#define glReplacementCodeuiColor4ubVertex3fSUN GLEW_GET_FUN(__glewReplacementCodeuiColor4ubVertex3fSUN) +#define glReplacementCodeuiColor4ubVertex3fvSUN GLEW_GET_FUN(__glewReplacementCodeuiColor4ubVertex3fvSUN) +#define glReplacementCodeuiNormal3fVertex3fSUN GLEW_GET_FUN(__glewReplacementCodeuiNormal3fVertex3fSUN) +#define glReplacementCodeuiNormal3fVertex3fvSUN GLEW_GET_FUN(__glewReplacementCodeuiNormal3fVertex3fvSUN) +#define glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN GLEW_GET_FUN(__glewReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN) +#define glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN GLEW_GET_FUN(__glewReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN) +#define glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN GLEW_GET_FUN(__glewReplacementCodeuiTexCoord2fNormal3fVertex3fSUN) +#define glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN GLEW_GET_FUN(__glewReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN) +#define glReplacementCodeuiTexCoord2fVertex3fSUN GLEW_GET_FUN(__glewReplacementCodeuiTexCoord2fVertex3fSUN) +#define glReplacementCodeuiTexCoord2fVertex3fvSUN GLEW_GET_FUN(__glewReplacementCodeuiTexCoord2fVertex3fvSUN) +#define glReplacementCodeuiVertex3fSUN GLEW_GET_FUN(__glewReplacementCodeuiVertex3fSUN) +#define glReplacementCodeuiVertex3fvSUN GLEW_GET_FUN(__glewReplacementCodeuiVertex3fvSUN) +#define glTexCoord2fColor3fVertex3fSUN GLEW_GET_FUN(__glewTexCoord2fColor3fVertex3fSUN) +#define glTexCoord2fColor3fVertex3fvSUN GLEW_GET_FUN(__glewTexCoord2fColor3fVertex3fvSUN) +#define glTexCoord2fColor4fNormal3fVertex3fSUN GLEW_GET_FUN(__glewTexCoord2fColor4fNormal3fVertex3fSUN) +#define glTexCoord2fColor4fNormal3fVertex3fvSUN GLEW_GET_FUN(__glewTexCoord2fColor4fNormal3fVertex3fvSUN) +#define glTexCoord2fColor4ubVertex3fSUN GLEW_GET_FUN(__glewTexCoord2fColor4ubVertex3fSUN) +#define glTexCoord2fColor4ubVertex3fvSUN GLEW_GET_FUN(__glewTexCoord2fColor4ubVertex3fvSUN) +#define glTexCoord2fNormal3fVertex3fSUN GLEW_GET_FUN(__glewTexCoord2fNormal3fVertex3fSUN) +#define glTexCoord2fNormal3fVertex3fvSUN GLEW_GET_FUN(__glewTexCoord2fNormal3fVertex3fvSUN) +#define glTexCoord2fVertex3fSUN GLEW_GET_FUN(__glewTexCoord2fVertex3fSUN) +#define glTexCoord2fVertex3fvSUN GLEW_GET_FUN(__glewTexCoord2fVertex3fvSUN) +#define glTexCoord4fColor4fNormal3fVertex4fSUN GLEW_GET_FUN(__glewTexCoord4fColor4fNormal3fVertex4fSUN) +#define glTexCoord4fColor4fNormal3fVertex4fvSUN GLEW_GET_FUN(__glewTexCoord4fColor4fNormal3fVertex4fvSUN) +#define glTexCoord4fVertex4fSUN GLEW_GET_FUN(__glewTexCoord4fVertex4fSUN) +#define glTexCoord4fVertex4fvSUN GLEW_GET_FUN(__glewTexCoord4fVertex4fvSUN) + +#define GLEW_SUN_vertex GLEW_GET_VAR(__GLEW_SUN_vertex) + +#endif /* GL_SUN_vertex */ + +/* -------------------------- GL_WIN_phong_shading ------------------------- */ + +#ifndef GL_WIN_phong_shading +#define GL_WIN_phong_shading 1 + +#define GL_PHONG_WIN 0x80EA +#define GL_PHONG_HINT_WIN 0x80EB + +#define GLEW_WIN_phong_shading GLEW_GET_VAR(__GLEW_WIN_phong_shading) + +#endif /* GL_WIN_phong_shading */ + +/* -------------------------- GL_WIN_specular_fog -------------------------- */ + +#ifndef GL_WIN_specular_fog +#define GL_WIN_specular_fog 1 + +#define GL_FOG_SPECULAR_TEXTURE_WIN 0x80EC + +#define GLEW_WIN_specular_fog GLEW_GET_VAR(__GLEW_WIN_specular_fog) + +#endif /* GL_WIN_specular_fog */ + +/* ---------------------------- GL_WIN_swap_hint --------------------------- */ + +#ifndef GL_WIN_swap_hint +#define GL_WIN_swap_hint 1 + +typedef void (GLAPIENTRY * PFNGLADDSWAPHINTRECTWINPROC) (GLint x, GLint y, GLsizei width, GLsizei height); + +#define glAddSwapHintRectWIN GLEW_GET_FUN(__glewAddSwapHintRectWIN) + +#define GLEW_WIN_swap_hint GLEW_GET_VAR(__GLEW_WIN_swap_hint) + +#endif /* GL_WIN_swap_hint */ + +/* ------------------------------------------------------------------------- */ + +#if defined(GLEW_MX) && defined(_WIN32) +#define GLEW_FUN_EXPORT +#else +#define GLEW_FUN_EXPORT GLEWAPI +#endif /* GLEW_MX */ + +#if defined(GLEW_MX) +#define GLEW_VAR_EXPORT +#else +#define GLEW_VAR_EXPORT GLEWAPI +#endif /* GLEW_MX */ + +#if defined(GLEW_MX) && defined(_WIN32) +struct GLEWContextStruct +{ +#endif /* GLEW_MX */ + +GLEW_FUN_EXPORT PFNGLCOPYTEXSUBIMAGE3DPROC __glewCopyTexSubImage3D; +GLEW_FUN_EXPORT PFNGLDRAWRANGEELEMENTSPROC __glewDrawRangeElements; +GLEW_FUN_EXPORT PFNGLTEXIMAGE3DPROC __glewTexImage3D; +GLEW_FUN_EXPORT PFNGLTEXSUBIMAGE3DPROC __glewTexSubImage3D; + +GLEW_FUN_EXPORT PFNGLACTIVETEXTUREPROC __glewActiveTexture; +GLEW_FUN_EXPORT PFNGLCLIENTACTIVETEXTUREPROC __glewClientActiveTexture; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXIMAGE1DPROC __glewCompressedTexImage1D; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXIMAGE2DPROC __glewCompressedTexImage2D; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXIMAGE3DPROC __glewCompressedTexImage3D; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC __glewCompressedTexSubImage1D; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC __glewCompressedTexSubImage2D; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC __glewCompressedTexSubImage3D; +GLEW_FUN_EXPORT PFNGLGETCOMPRESSEDTEXIMAGEPROC __glewGetCompressedTexImage; +GLEW_FUN_EXPORT PFNGLLOADTRANSPOSEMATRIXDPROC __glewLoadTransposeMatrixd; +GLEW_FUN_EXPORT PFNGLLOADTRANSPOSEMATRIXFPROC __glewLoadTransposeMatrixf; +GLEW_FUN_EXPORT PFNGLMULTTRANSPOSEMATRIXDPROC __glewMultTransposeMatrixd; +GLEW_FUN_EXPORT PFNGLMULTTRANSPOSEMATRIXFPROC __glewMultTransposeMatrixf; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1DPROC __glewMultiTexCoord1d; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1DVPROC __glewMultiTexCoord1dv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1FPROC __glewMultiTexCoord1f; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1FVPROC __glewMultiTexCoord1fv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1IPROC __glewMultiTexCoord1i; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1IVPROC __glewMultiTexCoord1iv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1SPROC __glewMultiTexCoord1s; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1SVPROC __glewMultiTexCoord1sv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2DPROC __glewMultiTexCoord2d; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2DVPROC __glewMultiTexCoord2dv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2FPROC __glewMultiTexCoord2f; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2FVPROC __glewMultiTexCoord2fv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2IPROC __glewMultiTexCoord2i; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2IVPROC __glewMultiTexCoord2iv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2SPROC __glewMultiTexCoord2s; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2SVPROC __glewMultiTexCoord2sv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3DPROC __glewMultiTexCoord3d; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3DVPROC __glewMultiTexCoord3dv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3FPROC __glewMultiTexCoord3f; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3FVPROC __glewMultiTexCoord3fv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3IPROC __glewMultiTexCoord3i; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3IVPROC __glewMultiTexCoord3iv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3SPROC __glewMultiTexCoord3s; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3SVPROC __glewMultiTexCoord3sv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4DPROC __glewMultiTexCoord4d; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4DVPROC __glewMultiTexCoord4dv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4FPROC __glewMultiTexCoord4f; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4FVPROC __glewMultiTexCoord4fv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4IPROC __glewMultiTexCoord4i; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4IVPROC __glewMultiTexCoord4iv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4SPROC __glewMultiTexCoord4s; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4SVPROC __glewMultiTexCoord4sv; +GLEW_FUN_EXPORT PFNGLSAMPLECOVERAGEPROC __glewSampleCoverage; + +GLEW_FUN_EXPORT PFNGLBLENDCOLORPROC __glewBlendColor; +GLEW_FUN_EXPORT PFNGLBLENDEQUATIONPROC __glewBlendEquation; +GLEW_FUN_EXPORT PFNGLBLENDFUNCSEPARATEPROC __glewBlendFuncSeparate; +GLEW_FUN_EXPORT PFNGLFOGCOORDPOINTERPROC __glewFogCoordPointer; +GLEW_FUN_EXPORT PFNGLFOGCOORDDPROC __glewFogCoordd; +GLEW_FUN_EXPORT PFNGLFOGCOORDDVPROC __glewFogCoorddv; +GLEW_FUN_EXPORT PFNGLFOGCOORDFPROC __glewFogCoordf; +GLEW_FUN_EXPORT PFNGLFOGCOORDFVPROC __glewFogCoordfv; +GLEW_FUN_EXPORT PFNGLMULTIDRAWARRAYSPROC __glewMultiDrawArrays; +GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTSPROC __glewMultiDrawElements; +GLEW_FUN_EXPORT PFNGLPOINTPARAMETERFPROC __glewPointParameterf; +GLEW_FUN_EXPORT PFNGLPOINTPARAMETERFVPROC __glewPointParameterfv; +GLEW_FUN_EXPORT PFNGLPOINTPARAMETERIPROC __glewPointParameteri; +GLEW_FUN_EXPORT PFNGLPOINTPARAMETERIVPROC __glewPointParameteriv; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3BPROC __glewSecondaryColor3b; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3BVPROC __glewSecondaryColor3bv; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3DPROC __glewSecondaryColor3d; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3DVPROC __glewSecondaryColor3dv; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3FPROC __glewSecondaryColor3f; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3FVPROC __glewSecondaryColor3fv; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3IPROC __glewSecondaryColor3i; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3IVPROC __glewSecondaryColor3iv; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3SPROC __glewSecondaryColor3s; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3SVPROC __glewSecondaryColor3sv; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UBPROC __glewSecondaryColor3ub; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UBVPROC __glewSecondaryColor3ubv; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UIPROC __glewSecondaryColor3ui; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UIVPROC __glewSecondaryColor3uiv; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3USPROC __glewSecondaryColor3us; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3USVPROC __glewSecondaryColor3usv; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLORPOINTERPROC __glewSecondaryColorPointer; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2DPROC __glewWindowPos2d; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2DVPROC __glewWindowPos2dv; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2FPROC __glewWindowPos2f; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2FVPROC __glewWindowPos2fv; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2IPROC __glewWindowPos2i; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2IVPROC __glewWindowPos2iv; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2SPROC __glewWindowPos2s; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2SVPROC __glewWindowPos2sv; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3DPROC __glewWindowPos3d; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3DVPROC __glewWindowPos3dv; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3FPROC __glewWindowPos3f; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3FVPROC __glewWindowPos3fv; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3IPROC __glewWindowPos3i; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3IVPROC __glewWindowPos3iv; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3SPROC __glewWindowPos3s; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3SVPROC __glewWindowPos3sv; + +GLEW_FUN_EXPORT PFNGLBEGINQUERYPROC __glewBeginQuery; +GLEW_FUN_EXPORT PFNGLBINDBUFFERPROC __glewBindBuffer; +GLEW_FUN_EXPORT PFNGLBUFFERDATAPROC __glewBufferData; +GLEW_FUN_EXPORT PFNGLBUFFERSUBDATAPROC __glewBufferSubData; +GLEW_FUN_EXPORT PFNGLDELETEBUFFERSPROC __glewDeleteBuffers; +GLEW_FUN_EXPORT PFNGLDELETEQUERIESPROC __glewDeleteQueries; +GLEW_FUN_EXPORT PFNGLENDQUERYPROC __glewEndQuery; +GLEW_FUN_EXPORT PFNGLGENBUFFERSPROC __glewGenBuffers; +GLEW_FUN_EXPORT PFNGLGENQUERIESPROC __glewGenQueries; +GLEW_FUN_EXPORT PFNGLGETBUFFERPARAMETERIVPROC __glewGetBufferParameteriv; +GLEW_FUN_EXPORT PFNGLGETBUFFERPOINTERVPROC __glewGetBufferPointerv; +GLEW_FUN_EXPORT PFNGLGETBUFFERSUBDATAPROC __glewGetBufferSubData; +GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTIVPROC __glewGetQueryObjectiv; +GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTUIVPROC __glewGetQueryObjectuiv; +GLEW_FUN_EXPORT PFNGLGETQUERYIVPROC __glewGetQueryiv; +GLEW_FUN_EXPORT PFNGLISBUFFERPROC __glewIsBuffer; +GLEW_FUN_EXPORT PFNGLISQUERYPROC __glewIsQuery; +GLEW_FUN_EXPORT PFNGLMAPBUFFERPROC __glewMapBuffer; +GLEW_FUN_EXPORT PFNGLUNMAPBUFFERPROC __glewUnmapBuffer; + +GLEW_FUN_EXPORT PFNGLATTACHSHADERPROC __glewAttachShader; +GLEW_FUN_EXPORT PFNGLBINDATTRIBLOCATIONPROC __glewBindAttribLocation; +GLEW_FUN_EXPORT PFNGLBLENDEQUATIONSEPARATEPROC __glewBlendEquationSeparate; +GLEW_FUN_EXPORT PFNGLCOMPILESHADERPROC __glewCompileShader; +GLEW_FUN_EXPORT PFNGLCREATEPROGRAMPROC __glewCreateProgram; +GLEW_FUN_EXPORT PFNGLCREATESHADERPROC __glewCreateShader; +GLEW_FUN_EXPORT PFNGLDELETEPROGRAMPROC __glewDeleteProgram; +GLEW_FUN_EXPORT PFNGLDELETESHADERPROC __glewDeleteShader; +GLEW_FUN_EXPORT PFNGLDETACHSHADERPROC __glewDetachShader; +GLEW_FUN_EXPORT PFNGLDISABLEVERTEXATTRIBARRAYPROC __glewDisableVertexAttribArray; +GLEW_FUN_EXPORT PFNGLDRAWBUFFERSPROC __glewDrawBuffers; +GLEW_FUN_EXPORT PFNGLENABLEVERTEXATTRIBARRAYPROC __glewEnableVertexAttribArray; +GLEW_FUN_EXPORT PFNGLGETACTIVEATTRIBPROC __glewGetActiveAttrib; +GLEW_FUN_EXPORT PFNGLGETACTIVEUNIFORMPROC __glewGetActiveUniform; +GLEW_FUN_EXPORT PFNGLGETATTACHEDSHADERSPROC __glewGetAttachedShaders; +GLEW_FUN_EXPORT PFNGLGETATTRIBLOCATIONPROC __glewGetAttribLocation; +GLEW_FUN_EXPORT PFNGLGETPROGRAMINFOLOGPROC __glewGetProgramInfoLog; +GLEW_FUN_EXPORT PFNGLGETPROGRAMIVPROC __glewGetProgramiv; +GLEW_FUN_EXPORT PFNGLGETSHADERINFOLOGPROC __glewGetShaderInfoLog; +GLEW_FUN_EXPORT PFNGLGETSHADERSOURCEPROC __glewGetShaderSource; +GLEW_FUN_EXPORT PFNGLGETSHADERIVPROC __glewGetShaderiv; +GLEW_FUN_EXPORT PFNGLGETUNIFORMLOCATIONPROC __glewGetUniformLocation; +GLEW_FUN_EXPORT PFNGLGETUNIFORMFVPROC __glewGetUniformfv; +GLEW_FUN_EXPORT PFNGLGETUNIFORMIVPROC __glewGetUniformiv; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBPOINTERVPROC __glewGetVertexAttribPointerv; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBDVPROC __glewGetVertexAttribdv; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBFVPROC __glewGetVertexAttribfv; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBIVPROC __glewGetVertexAttribiv; +GLEW_FUN_EXPORT PFNGLISPROGRAMPROC __glewIsProgram; +GLEW_FUN_EXPORT PFNGLISSHADERPROC __glewIsShader; +GLEW_FUN_EXPORT PFNGLLINKPROGRAMPROC __glewLinkProgram; +GLEW_FUN_EXPORT PFNGLSHADERSOURCEPROC __glewShaderSource; +GLEW_FUN_EXPORT PFNGLSTENCILFUNCSEPARATEPROC __glewStencilFuncSeparate; +GLEW_FUN_EXPORT PFNGLSTENCILMASKSEPARATEPROC __glewStencilMaskSeparate; +GLEW_FUN_EXPORT PFNGLSTENCILOPSEPARATEPROC __glewStencilOpSeparate; +GLEW_FUN_EXPORT PFNGLUNIFORM1FPROC __glewUniform1f; +GLEW_FUN_EXPORT PFNGLUNIFORM1FVPROC __glewUniform1fv; +GLEW_FUN_EXPORT PFNGLUNIFORM1IPROC __glewUniform1i; +GLEW_FUN_EXPORT PFNGLUNIFORM1IVPROC __glewUniform1iv; +GLEW_FUN_EXPORT PFNGLUNIFORM2FPROC __glewUniform2f; +GLEW_FUN_EXPORT PFNGLUNIFORM2FVPROC __glewUniform2fv; +GLEW_FUN_EXPORT PFNGLUNIFORM2IPROC __glewUniform2i; +GLEW_FUN_EXPORT PFNGLUNIFORM2IVPROC __glewUniform2iv; +GLEW_FUN_EXPORT PFNGLUNIFORM3FPROC __glewUniform3f; +GLEW_FUN_EXPORT PFNGLUNIFORM3FVPROC __glewUniform3fv; +GLEW_FUN_EXPORT PFNGLUNIFORM3IPROC __glewUniform3i; +GLEW_FUN_EXPORT PFNGLUNIFORM3IVPROC __glewUniform3iv; +GLEW_FUN_EXPORT PFNGLUNIFORM4FPROC __glewUniform4f; +GLEW_FUN_EXPORT PFNGLUNIFORM4FVPROC __glewUniform4fv; +GLEW_FUN_EXPORT PFNGLUNIFORM4IPROC __glewUniform4i; +GLEW_FUN_EXPORT PFNGLUNIFORM4IVPROC __glewUniform4iv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX2FVPROC __glewUniformMatrix2fv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX3FVPROC __glewUniformMatrix3fv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX4FVPROC __glewUniformMatrix4fv; +GLEW_FUN_EXPORT PFNGLUSEPROGRAMPROC __glewUseProgram; +GLEW_FUN_EXPORT PFNGLVALIDATEPROGRAMPROC __glewValidateProgram; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1DPROC __glewVertexAttrib1d; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1DVPROC __glewVertexAttrib1dv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1FPROC __glewVertexAttrib1f; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1FVPROC __glewVertexAttrib1fv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1SPROC __glewVertexAttrib1s; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1SVPROC __glewVertexAttrib1sv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2DPROC __glewVertexAttrib2d; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2DVPROC __glewVertexAttrib2dv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2FPROC __glewVertexAttrib2f; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2FVPROC __glewVertexAttrib2fv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2SPROC __glewVertexAttrib2s; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2SVPROC __glewVertexAttrib2sv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3DPROC __glewVertexAttrib3d; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3DVPROC __glewVertexAttrib3dv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3FPROC __glewVertexAttrib3f; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3FVPROC __glewVertexAttrib3fv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3SPROC __glewVertexAttrib3s; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3SVPROC __glewVertexAttrib3sv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NBVPROC __glewVertexAttrib4Nbv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NIVPROC __glewVertexAttrib4Niv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NSVPROC __glewVertexAttrib4Nsv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUBPROC __glewVertexAttrib4Nub; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUBVPROC __glewVertexAttrib4Nubv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUIVPROC __glewVertexAttrib4Nuiv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUSVPROC __glewVertexAttrib4Nusv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4BVPROC __glewVertexAttrib4bv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4DPROC __glewVertexAttrib4d; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4DVPROC __glewVertexAttrib4dv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4FPROC __glewVertexAttrib4f; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4FVPROC __glewVertexAttrib4fv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4IVPROC __glewVertexAttrib4iv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4SPROC __glewVertexAttrib4s; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4SVPROC __glewVertexAttrib4sv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4UBVPROC __glewVertexAttrib4ubv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4UIVPROC __glewVertexAttrib4uiv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4USVPROC __glewVertexAttrib4usv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBPOINTERPROC __glewVertexAttribPointer; + +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX2X3FVPROC __glewUniformMatrix2x3fv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX2X4FVPROC __glewUniformMatrix2x4fv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX3X2FVPROC __glewUniformMatrix3x2fv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX3X4FVPROC __glewUniformMatrix3x4fv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX4X2FVPROC __glewUniformMatrix4x2fv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX4X3FVPROC __glewUniformMatrix4x3fv; + +GLEW_FUN_EXPORT PFNGLBEGINCONDITIONALRENDERPROC __glewBeginConditionalRender; +GLEW_FUN_EXPORT PFNGLBEGINTRANSFORMFEEDBACKPROC __glewBeginTransformFeedback; +GLEW_FUN_EXPORT PFNGLBINDFRAGDATALOCATIONPROC __glewBindFragDataLocation; +GLEW_FUN_EXPORT PFNGLCLAMPCOLORPROC __glewClampColor; +GLEW_FUN_EXPORT PFNGLCLEARBUFFERFIPROC __glewClearBufferfi; +GLEW_FUN_EXPORT PFNGLCLEARBUFFERFVPROC __glewClearBufferfv; +GLEW_FUN_EXPORT PFNGLCLEARBUFFERIVPROC __glewClearBufferiv; +GLEW_FUN_EXPORT PFNGLCLEARBUFFERUIVPROC __glewClearBufferuiv; +GLEW_FUN_EXPORT PFNGLCOLORMASKIPROC __glewColorMaski; +GLEW_FUN_EXPORT PFNGLDISABLEIPROC __glewDisablei; +GLEW_FUN_EXPORT PFNGLENABLEIPROC __glewEnablei; +GLEW_FUN_EXPORT PFNGLENDCONDITIONALRENDERPROC __glewEndConditionalRender; +GLEW_FUN_EXPORT PFNGLENDTRANSFORMFEEDBACKPROC __glewEndTransformFeedback; +GLEW_FUN_EXPORT PFNGLGETBOOLEANI_VPROC __glewGetBooleani_v; +GLEW_FUN_EXPORT PFNGLGETFRAGDATALOCATIONPROC __glewGetFragDataLocation; +GLEW_FUN_EXPORT PFNGLGETSTRINGIPROC __glewGetStringi; +GLEW_FUN_EXPORT PFNGLGETTEXPARAMETERIIVPROC __glewGetTexParameterIiv; +GLEW_FUN_EXPORT PFNGLGETTEXPARAMETERIUIVPROC __glewGetTexParameterIuiv; +GLEW_FUN_EXPORT PFNGLGETTRANSFORMFEEDBACKVARYINGPROC __glewGetTransformFeedbackVarying; +GLEW_FUN_EXPORT PFNGLGETUNIFORMUIVPROC __glewGetUniformuiv; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBIIVPROC __glewGetVertexAttribIiv; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBIUIVPROC __glewGetVertexAttribIuiv; +GLEW_FUN_EXPORT PFNGLISENABLEDIPROC __glewIsEnabledi; +GLEW_FUN_EXPORT PFNGLTEXPARAMETERIIVPROC __glewTexParameterIiv; +GLEW_FUN_EXPORT PFNGLTEXPARAMETERIUIVPROC __glewTexParameterIuiv; +GLEW_FUN_EXPORT PFNGLTRANSFORMFEEDBACKVARYINGSPROC __glewTransformFeedbackVaryings; +GLEW_FUN_EXPORT PFNGLUNIFORM1UIPROC __glewUniform1ui; +GLEW_FUN_EXPORT PFNGLUNIFORM1UIVPROC __glewUniform1uiv; +GLEW_FUN_EXPORT PFNGLUNIFORM2UIPROC __glewUniform2ui; +GLEW_FUN_EXPORT PFNGLUNIFORM2UIVPROC __glewUniform2uiv; +GLEW_FUN_EXPORT PFNGLUNIFORM3UIPROC __glewUniform3ui; +GLEW_FUN_EXPORT PFNGLUNIFORM3UIVPROC __glewUniform3uiv; +GLEW_FUN_EXPORT PFNGLUNIFORM4UIPROC __glewUniform4ui; +GLEW_FUN_EXPORT PFNGLUNIFORM4UIVPROC __glewUniform4uiv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI1IPROC __glewVertexAttribI1i; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI1IVPROC __glewVertexAttribI1iv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI1UIPROC __glewVertexAttribI1ui; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI1UIVPROC __glewVertexAttribI1uiv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI2IPROC __glewVertexAttribI2i; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI2IVPROC __glewVertexAttribI2iv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI2UIPROC __glewVertexAttribI2ui; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI2UIVPROC __glewVertexAttribI2uiv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI3IPROC __glewVertexAttribI3i; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI3IVPROC __glewVertexAttribI3iv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI3UIPROC __glewVertexAttribI3ui; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI3UIVPROC __glewVertexAttribI3uiv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4BVPROC __glewVertexAttribI4bv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4IPROC __glewVertexAttribI4i; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4IVPROC __glewVertexAttribI4iv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4SVPROC __glewVertexAttribI4sv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4UBVPROC __glewVertexAttribI4ubv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4UIPROC __glewVertexAttribI4ui; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4UIVPROC __glewVertexAttribI4uiv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4USVPROC __glewVertexAttribI4usv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBIPOINTERPROC __glewVertexAttribIPointer; + +GLEW_FUN_EXPORT PFNGLDRAWARRAYSINSTANCEDPROC __glewDrawArraysInstanced; +GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDPROC __glewDrawElementsInstanced; +GLEW_FUN_EXPORT PFNGLPRIMITIVERESTARTINDEXPROC __glewPrimitiveRestartIndex; +GLEW_FUN_EXPORT PFNGLTEXBUFFERPROC __glewTexBuffer; + +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTUREPROC __glewFramebufferTexture; +GLEW_FUN_EXPORT PFNGLGETBUFFERPARAMETERI64VPROC __glewGetBufferParameteri64v; +GLEW_FUN_EXPORT PFNGLGETINTEGER64I_VPROC __glewGetInteger64i_v; + +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBDIVISORPROC __glewVertexAttribDivisor; + +GLEW_FUN_EXPORT PFNGLBLENDEQUATIONSEPARATEIPROC __glewBlendEquationSeparatei; +GLEW_FUN_EXPORT PFNGLBLENDEQUATIONIPROC __glewBlendEquationi; +GLEW_FUN_EXPORT PFNGLBLENDFUNCSEPARATEIPROC __glewBlendFuncSeparatei; +GLEW_FUN_EXPORT PFNGLBLENDFUNCIPROC __glewBlendFunci; +GLEW_FUN_EXPORT PFNGLMINSAMPLESHADINGPROC __glewMinSampleShading; + +GLEW_FUN_EXPORT PFNGLTBUFFERMASK3DFXPROC __glewTbufferMask3DFX; + +GLEW_FUN_EXPORT PFNGLDEBUGMESSAGECALLBACKAMDPROC __glewDebugMessageCallbackAMD; +GLEW_FUN_EXPORT PFNGLDEBUGMESSAGEENABLEAMDPROC __glewDebugMessageEnableAMD; +GLEW_FUN_EXPORT PFNGLDEBUGMESSAGEINSERTAMDPROC __glewDebugMessageInsertAMD; +GLEW_FUN_EXPORT PFNGLGETDEBUGMESSAGELOGAMDPROC __glewGetDebugMessageLogAMD; + +GLEW_FUN_EXPORT PFNGLBLENDEQUATIONINDEXEDAMDPROC __glewBlendEquationIndexedAMD; +GLEW_FUN_EXPORT PFNGLBLENDEQUATIONSEPARATEINDEXEDAMDPROC __glewBlendEquationSeparateIndexedAMD; +GLEW_FUN_EXPORT PFNGLBLENDFUNCINDEXEDAMDPROC __glewBlendFuncIndexedAMD; +GLEW_FUN_EXPORT PFNGLBLENDFUNCSEPARATEINDEXEDAMDPROC __glewBlendFuncSeparateIndexedAMD; + +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBPARAMETERIAMDPROC __glewVertexAttribParameteriAMD; + +GLEW_FUN_EXPORT PFNGLMULTIDRAWARRAYSINDIRECTAMDPROC __glewMultiDrawArraysIndirectAMD; +GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTSINDIRECTAMDPROC __glewMultiDrawElementsIndirectAMD; + +GLEW_FUN_EXPORT PFNGLDELETENAMESAMDPROC __glewDeleteNamesAMD; +GLEW_FUN_EXPORT PFNGLGENNAMESAMDPROC __glewGenNamesAMD; +GLEW_FUN_EXPORT PFNGLISNAMEAMDPROC __glewIsNameAMD; + +GLEW_FUN_EXPORT PFNGLBEGINPERFMONITORAMDPROC __glewBeginPerfMonitorAMD; +GLEW_FUN_EXPORT PFNGLDELETEPERFMONITORSAMDPROC __glewDeletePerfMonitorsAMD; +GLEW_FUN_EXPORT PFNGLENDPERFMONITORAMDPROC __glewEndPerfMonitorAMD; +GLEW_FUN_EXPORT PFNGLGENPERFMONITORSAMDPROC __glewGenPerfMonitorsAMD; +GLEW_FUN_EXPORT PFNGLGETPERFMONITORCOUNTERDATAAMDPROC __glewGetPerfMonitorCounterDataAMD; +GLEW_FUN_EXPORT PFNGLGETPERFMONITORCOUNTERINFOAMDPROC __glewGetPerfMonitorCounterInfoAMD; +GLEW_FUN_EXPORT PFNGLGETPERFMONITORCOUNTERSTRINGAMDPROC __glewGetPerfMonitorCounterStringAMD; +GLEW_FUN_EXPORT PFNGLGETPERFMONITORCOUNTERSAMDPROC __glewGetPerfMonitorCountersAMD; +GLEW_FUN_EXPORT PFNGLGETPERFMONITORGROUPSTRINGAMDPROC __glewGetPerfMonitorGroupStringAMD; +GLEW_FUN_EXPORT PFNGLGETPERFMONITORGROUPSAMDPROC __glewGetPerfMonitorGroupsAMD; +GLEW_FUN_EXPORT PFNGLSELECTPERFMONITORCOUNTERSAMDPROC __glewSelectPerfMonitorCountersAMD; + +GLEW_FUN_EXPORT PFNGLSETMULTISAMPLEFVAMDPROC __glewSetMultisamplefvAMD; + +GLEW_FUN_EXPORT PFNGLTEXSTORAGESPARSEAMDPROC __glewTexStorageSparseAMD; +GLEW_FUN_EXPORT PFNGLTEXTURESTORAGESPARSEAMDPROC __glewTextureStorageSparseAMD; + +GLEW_FUN_EXPORT PFNGLSTENCILOPVALUEAMDPROC __glewStencilOpValueAMD; + +GLEW_FUN_EXPORT PFNGLTESSELLATIONFACTORAMDPROC __glewTessellationFactorAMD; +GLEW_FUN_EXPORT PFNGLTESSELLATIONMODEAMDPROC __glewTessellationModeAMD; + +GLEW_FUN_EXPORT PFNGLBLITFRAMEBUFFERANGLEPROC __glewBlitFramebufferANGLE; + +GLEW_FUN_EXPORT PFNGLRENDERBUFFERSTORAGEMULTISAMPLEANGLEPROC __glewRenderbufferStorageMultisampleANGLE; + +GLEW_FUN_EXPORT PFNGLDRAWARRAYSINSTANCEDANGLEPROC __glewDrawArraysInstancedANGLE; +GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDANGLEPROC __glewDrawElementsInstancedANGLE; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBDIVISORANGLEPROC __glewVertexAttribDivisorANGLE; + +GLEW_FUN_EXPORT PFNGLBEGINQUERYANGLEPROC __glewBeginQueryANGLE; +GLEW_FUN_EXPORT PFNGLDELETEQUERIESANGLEPROC __glewDeleteQueriesANGLE; +GLEW_FUN_EXPORT PFNGLENDQUERYANGLEPROC __glewEndQueryANGLE; +GLEW_FUN_EXPORT PFNGLGENQUERIESANGLEPROC __glewGenQueriesANGLE; +GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTI64VANGLEPROC __glewGetQueryObjecti64vANGLE; +GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTIVANGLEPROC __glewGetQueryObjectivANGLE; +GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTUI64VANGLEPROC __glewGetQueryObjectui64vANGLE; +GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTUIVANGLEPROC __glewGetQueryObjectuivANGLE; +GLEW_FUN_EXPORT PFNGLGETQUERYIVANGLEPROC __glewGetQueryivANGLE; +GLEW_FUN_EXPORT PFNGLISQUERYANGLEPROC __glewIsQueryANGLE; +GLEW_FUN_EXPORT PFNGLQUERYCOUNTERANGLEPROC __glewQueryCounterANGLE; + +GLEW_FUN_EXPORT PFNGLGETTRANSLATEDSHADERSOURCEANGLEPROC __glewGetTranslatedShaderSourceANGLE; + +GLEW_FUN_EXPORT PFNGLDRAWELEMENTARRAYAPPLEPROC __glewDrawElementArrayAPPLE; +GLEW_FUN_EXPORT PFNGLDRAWRANGEELEMENTARRAYAPPLEPROC __glewDrawRangeElementArrayAPPLE; +GLEW_FUN_EXPORT PFNGLELEMENTPOINTERAPPLEPROC __glewElementPointerAPPLE; +GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTARRAYAPPLEPROC __glewMultiDrawElementArrayAPPLE; +GLEW_FUN_EXPORT PFNGLMULTIDRAWRANGEELEMENTARRAYAPPLEPROC __glewMultiDrawRangeElementArrayAPPLE; + +GLEW_FUN_EXPORT PFNGLDELETEFENCESAPPLEPROC __glewDeleteFencesAPPLE; +GLEW_FUN_EXPORT PFNGLFINISHFENCEAPPLEPROC __glewFinishFenceAPPLE; +GLEW_FUN_EXPORT PFNGLFINISHOBJECTAPPLEPROC __glewFinishObjectAPPLE; +GLEW_FUN_EXPORT PFNGLGENFENCESAPPLEPROC __glewGenFencesAPPLE; +GLEW_FUN_EXPORT PFNGLISFENCEAPPLEPROC __glewIsFenceAPPLE; +GLEW_FUN_EXPORT PFNGLSETFENCEAPPLEPROC __glewSetFenceAPPLE; +GLEW_FUN_EXPORT PFNGLTESTFENCEAPPLEPROC __glewTestFenceAPPLE; +GLEW_FUN_EXPORT PFNGLTESTOBJECTAPPLEPROC __glewTestObjectAPPLE; + +GLEW_FUN_EXPORT PFNGLBUFFERPARAMETERIAPPLEPROC __glewBufferParameteriAPPLE; +GLEW_FUN_EXPORT PFNGLFLUSHMAPPEDBUFFERRANGEAPPLEPROC __glewFlushMappedBufferRangeAPPLE; + +GLEW_FUN_EXPORT PFNGLGETOBJECTPARAMETERIVAPPLEPROC __glewGetObjectParameterivAPPLE; +GLEW_FUN_EXPORT PFNGLOBJECTPURGEABLEAPPLEPROC __glewObjectPurgeableAPPLE; +GLEW_FUN_EXPORT PFNGLOBJECTUNPURGEABLEAPPLEPROC __glewObjectUnpurgeableAPPLE; + +GLEW_FUN_EXPORT PFNGLGETTEXPARAMETERPOINTERVAPPLEPROC __glewGetTexParameterPointervAPPLE; +GLEW_FUN_EXPORT PFNGLTEXTURERANGEAPPLEPROC __glewTextureRangeAPPLE; + +GLEW_FUN_EXPORT PFNGLBINDVERTEXARRAYAPPLEPROC __glewBindVertexArrayAPPLE; +GLEW_FUN_EXPORT PFNGLDELETEVERTEXARRAYSAPPLEPROC __glewDeleteVertexArraysAPPLE; +GLEW_FUN_EXPORT PFNGLGENVERTEXARRAYSAPPLEPROC __glewGenVertexArraysAPPLE; +GLEW_FUN_EXPORT PFNGLISVERTEXARRAYAPPLEPROC __glewIsVertexArrayAPPLE; + +GLEW_FUN_EXPORT PFNGLFLUSHVERTEXARRAYRANGEAPPLEPROC __glewFlushVertexArrayRangeAPPLE; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYPARAMETERIAPPLEPROC __glewVertexArrayParameteriAPPLE; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYRANGEAPPLEPROC __glewVertexArrayRangeAPPLE; + +GLEW_FUN_EXPORT PFNGLDISABLEVERTEXATTRIBAPPLEPROC __glewDisableVertexAttribAPPLE; +GLEW_FUN_EXPORT PFNGLENABLEVERTEXATTRIBAPPLEPROC __glewEnableVertexAttribAPPLE; +GLEW_FUN_EXPORT PFNGLISVERTEXATTRIBENABLEDAPPLEPROC __glewIsVertexAttribEnabledAPPLE; +GLEW_FUN_EXPORT PFNGLMAPVERTEXATTRIB1DAPPLEPROC __glewMapVertexAttrib1dAPPLE; +GLEW_FUN_EXPORT PFNGLMAPVERTEXATTRIB1FAPPLEPROC __glewMapVertexAttrib1fAPPLE; +GLEW_FUN_EXPORT PFNGLMAPVERTEXATTRIB2DAPPLEPROC __glewMapVertexAttrib2dAPPLE; +GLEW_FUN_EXPORT PFNGLMAPVERTEXATTRIB2FAPPLEPROC __glewMapVertexAttrib2fAPPLE; + +GLEW_FUN_EXPORT PFNGLCLEARDEPTHFPROC __glewClearDepthf; +GLEW_FUN_EXPORT PFNGLDEPTHRANGEFPROC __glewDepthRangef; +GLEW_FUN_EXPORT PFNGLGETSHADERPRECISIONFORMATPROC __glewGetShaderPrecisionFormat; +GLEW_FUN_EXPORT PFNGLRELEASESHADERCOMPILERPROC __glewReleaseShaderCompiler; +GLEW_FUN_EXPORT PFNGLSHADERBINARYPROC __glewShaderBinary; + +GLEW_FUN_EXPORT PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEPROC __glewDrawArraysInstancedBaseInstance; +GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDBASEINSTANCEPROC __glewDrawElementsInstancedBaseInstance; +GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEPROC __glewDrawElementsInstancedBaseVertexBaseInstance; + +GLEW_FUN_EXPORT PFNGLGETIMAGEHANDLEARBPROC __glewGetImageHandleARB; +GLEW_FUN_EXPORT PFNGLGETTEXTUREHANDLEARBPROC __glewGetTextureHandleARB; +GLEW_FUN_EXPORT PFNGLGETTEXTURESAMPLERHANDLEARBPROC __glewGetTextureSamplerHandleARB; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBLUI64VARBPROC __glewGetVertexAttribLui64vARB; +GLEW_FUN_EXPORT PFNGLISIMAGEHANDLERESIDENTARBPROC __glewIsImageHandleResidentARB; +GLEW_FUN_EXPORT PFNGLISTEXTUREHANDLERESIDENTARBPROC __glewIsTextureHandleResidentARB; +GLEW_FUN_EXPORT PFNGLMAKEIMAGEHANDLENONRESIDENTARBPROC __glewMakeImageHandleNonResidentARB; +GLEW_FUN_EXPORT PFNGLMAKEIMAGEHANDLERESIDENTARBPROC __glewMakeImageHandleResidentARB; +GLEW_FUN_EXPORT PFNGLMAKETEXTUREHANDLENONRESIDENTARBPROC __glewMakeTextureHandleNonResidentARB; +GLEW_FUN_EXPORT PFNGLMAKETEXTUREHANDLERESIDENTARBPROC __glewMakeTextureHandleResidentARB; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMHANDLEUI64ARBPROC __glewProgramUniformHandleui64ARB; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMHANDLEUI64VARBPROC __glewProgramUniformHandleui64vARB; +GLEW_FUN_EXPORT PFNGLUNIFORMHANDLEUI64ARBPROC __glewUniformHandleui64ARB; +GLEW_FUN_EXPORT PFNGLUNIFORMHANDLEUI64VARBPROC __glewUniformHandleui64vARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1UI64ARBPROC __glewVertexAttribL1ui64ARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1UI64VARBPROC __glewVertexAttribL1ui64vARB; + +GLEW_FUN_EXPORT PFNGLBINDFRAGDATALOCATIONINDEXEDPROC __glewBindFragDataLocationIndexed; +GLEW_FUN_EXPORT PFNGLGETFRAGDATAINDEXPROC __glewGetFragDataIndex; + +GLEW_FUN_EXPORT PFNGLBUFFERSTORAGEPROC __glewBufferStorage; +GLEW_FUN_EXPORT PFNGLNAMEDBUFFERSTORAGEEXTPROC __glewNamedBufferStorageEXT; + +GLEW_FUN_EXPORT PFNGLCREATESYNCFROMCLEVENTARBPROC __glewCreateSyncFromCLeventARB; + +GLEW_FUN_EXPORT PFNGLCLEARBUFFERDATAPROC __glewClearBufferData; +GLEW_FUN_EXPORT PFNGLCLEARBUFFERSUBDATAPROC __glewClearBufferSubData; +GLEW_FUN_EXPORT PFNGLCLEARNAMEDBUFFERDATAEXTPROC __glewClearNamedBufferDataEXT; +GLEW_FUN_EXPORT PFNGLCLEARNAMEDBUFFERSUBDATAEXTPROC __glewClearNamedBufferSubDataEXT; + +GLEW_FUN_EXPORT PFNGLCLEARTEXIMAGEPROC __glewClearTexImage; +GLEW_FUN_EXPORT PFNGLCLEARTEXSUBIMAGEPROC __glewClearTexSubImage; + +GLEW_FUN_EXPORT PFNGLCLAMPCOLORARBPROC __glewClampColorARB; + +GLEW_FUN_EXPORT PFNGLDISPATCHCOMPUTEPROC __glewDispatchCompute; +GLEW_FUN_EXPORT PFNGLDISPATCHCOMPUTEINDIRECTPROC __glewDispatchComputeIndirect; + +GLEW_FUN_EXPORT PFNGLDISPATCHCOMPUTEGROUPSIZEARBPROC __glewDispatchComputeGroupSizeARB; + +GLEW_FUN_EXPORT PFNGLCOPYBUFFERSUBDATAPROC __glewCopyBufferSubData; + +GLEW_FUN_EXPORT PFNGLCOPYIMAGESUBDATAPROC __glewCopyImageSubData; + +GLEW_FUN_EXPORT PFNGLDEBUGMESSAGECALLBACKARBPROC __glewDebugMessageCallbackARB; +GLEW_FUN_EXPORT PFNGLDEBUGMESSAGECONTROLARBPROC __glewDebugMessageControlARB; +GLEW_FUN_EXPORT PFNGLDEBUGMESSAGEINSERTARBPROC __glewDebugMessageInsertARB; +GLEW_FUN_EXPORT PFNGLGETDEBUGMESSAGELOGARBPROC __glewGetDebugMessageLogARB; + +GLEW_FUN_EXPORT PFNGLDRAWBUFFERSARBPROC __glewDrawBuffersARB; + +GLEW_FUN_EXPORT PFNGLBLENDEQUATIONSEPARATEIARBPROC __glewBlendEquationSeparateiARB; +GLEW_FUN_EXPORT PFNGLBLENDEQUATIONIARBPROC __glewBlendEquationiARB; +GLEW_FUN_EXPORT PFNGLBLENDFUNCSEPARATEIARBPROC __glewBlendFuncSeparateiARB; +GLEW_FUN_EXPORT PFNGLBLENDFUNCIARBPROC __glewBlendFunciARB; + +GLEW_FUN_EXPORT PFNGLDRAWELEMENTSBASEVERTEXPROC __glewDrawElementsBaseVertex; +GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC __glewDrawElementsInstancedBaseVertex; +GLEW_FUN_EXPORT PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC __glewDrawRangeElementsBaseVertex; +GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC __glewMultiDrawElementsBaseVertex; + +GLEW_FUN_EXPORT PFNGLDRAWARRAYSINDIRECTPROC __glewDrawArraysIndirect; +GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINDIRECTPROC __glewDrawElementsIndirect; + +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERPARAMETERIPROC __glewFramebufferParameteri; +GLEW_FUN_EXPORT PFNGLGETFRAMEBUFFERPARAMETERIVPROC __glewGetFramebufferParameteriv; +GLEW_FUN_EXPORT PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVEXTPROC __glewGetNamedFramebufferParameterivEXT; +GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERPARAMETERIEXTPROC __glewNamedFramebufferParameteriEXT; + +GLEW_FUN_EXPORT PFNGLBINDFRAMEBUFFERPROC __glewBindFramebuffer; +GLEW_FUN_EXPORT PFNGLBINDRENDERBUFFERPROC __glewBindRenderbuffer; +GLEW_FUN_EXPORT PFNGLBLITFRAMEBUFFERPROC __glewBlitFramebuffer; +GLEW_FUN_EXPORT PFNGLCHECKFRAMEBUFFERSTATUSPROC __glewCheckFramebufferStatus; +GLEW_FUN_EXPORT PFNGLDELETEFRAMEBUFFERSPROC __glewDeleteFramebuffers; +GLEW_FUN_EXPORT PFNGLDELETERENDERBUFFERSPROC __glewDeleteRenderbuffers; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERRENDERBUFFERPROC __glewFramebufferRenderbuffer; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURE1DPROC __glewFramebufferTexture1D; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURE2DPROC __glewFramebufferTexture2D; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURE3DPROC __glewFramebufferTexture3D; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURELAYERPROC __glewFramebufferTextureLayer; +GLEW_FUN_EXPORT PFNGLGENFRAMEBUFFERSPROC __glewGenFramebuffers; +GLEW_FUN_EXPORT PFNGLGENRENDERBUFFERSPROC __glewGenRenderbuffers; +GLEW_FUN_EXPORT PFNGLGENERATEMIPMAPPROC __glewGenerateMipmap; +GLEW_FUN_EXPORT PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC __glewGetFramebufferAttachmentParameteriv; +GLEW_FUN_EXPORT PFNGLGETRENDERBUFFERPARAMETERIVPROC __glewGetRenderbufferParameteriv; +GLEW_FUN_EXPORT PFNGLISFRAMEBUFFERPROC __glewIsFramebuffer; +GLEW_FUN_EXPORT PFNGLISRENDERBUFFERPROC __glewIsRenderbuffer; +GLEW_FUN_EXPORT PFNGLRENDERBUFFERSTORAGEPROC __glewRenderbufferStorage; +GLEW_FUN_EXPORT PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC __glewRenderbufferStorageMultisample; + +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTUREARBPROC __glewFramebufferTextureARB; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTUREFACEARBPROC __glewFramebufferTextureFaceARB; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURELAYERARBPROC __glewFramebufferTextureLayerARB; +GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETERIARBPROC __glewProgramParameteriARB; + +GLEW_FUN_EXPORT PFNGLGETPROGRAMBINARYPROC __glewGetProgramBinary; +GLEW_FUN_EXPORT PFNGLPROGRAMBINARYPROC __glewProgramBinary; +GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETERIPROC __glewProgramParameteri; + +GLEW_FUN_EXPORT PFNGLGETUNIFORMDVPROC __glewGetUniformdv; +GLEW_FUN_EXPORT PFNGLUNIFORM1DPROC __glewUniform1d; +GLEW_FUN_EXPORT PFNGLUNIFORM1DVPROC __glewUniform1dv; +GLEW_FUN_EXPORT PFNGLUNIFORM2DPROC __glewUniform2d; +GLEW_FUN_EXPORT PFNGLUNIFORM2DVPROC __glewUniform2dv; +GLEW_FUN_EXPORT PFNGLUNIFORM3DPROC __glewUniform3d; +GLEW_FUN_EXPORT PFNGLUNIFORM3DVPROC __glewUniform3dv; +GLEW_FUN_EXPORT PFNGLUNIFORM4DPROC __glewUniform4d; +GLEW_FUN_EXPORT PFNGLUNIFORM4DVPROC __glewUniform4dv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX2DVPROC __glewUniformMatrix2dv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX2X3DVPROC __glewUniformMatrix2x3dv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX2X4DVPROC __glewUniformMatrix2x4dv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX3DVPROC __glewUniformMatrix3dv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX3X2DVPROC __glewUniformMatrix3x2dv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX3X4DVPROC __glewUniformMatrix3x4dv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX4DVPROC __glewUniformMatrix4dv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX4X2DVPROC __glewUniformMatrix4x2dv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX4X3DVPROC __glewUniformMatrix4x3dv; + +GLEW_FUN_EXPORT PFNGLCOLORSUBTABLEPROC __glewColorSubTable; +GLEW_FUN_EXPORT PFNGLCOLORTABLEPROC __glewColorTable; +GLEW_FUN_EXPORT PFNGLCOLORTABLEPARAMETERFVPROC __glewColorTableParameterfv; +GLEW_FUN_EXPORT PFNGLCOLORTABLEPARAMETERIVPROC __glewColorTableParameteriv; +GLEW_FUN_EXPORT PFNGLCONVOLUTIONFILTER1DPROC __glewConvolutionFilter1D; +GLEW_FUN_EXPORT PFNGLCONVOLUTIONFILTER2DPROC __glewConvolutionFilter2D; +GLEW_FUN_EXPORT PFNGLCONVOLUTIONPARAMETERFPROC __glewConvolutionParameterf; +GLEW_FUN_EXPORT PFNGLCONVOLUTIONPARAMETERFVPROC __glewConvolutionParameterfv; +GLEW_FUN_EXPORT PFNGLCONVOLUTIONPARAMETERIPROC __glewConvolutionParameteri; +GLEW_FUN_EXPORT PFNGLCONVOLUTIONPARAMETERIVPROC __glewConvolutionParameteriv; +GLEW_FUN_EXPORT PFNGLCOPYCOLORSUBTABLEPROC __glewCopyColorSubTable; +GLEW_FUN_EXPORT PFNGLCOPYCOLORTABLEPROC __glewCopyColorTable; +GLEW_FUN_EXPORT PFNGLCOPYCONVOLUTIONFILTER1DPROC __glewCopyConvolutionFilter1D; +GLEW_FUN_EXPORT PFNGLCOPYCONVOLUTIONFILTER2DPROC __glewCopyConvolutionFilter2D; +GLEW_FUN_EXPORT PFNGLGETCOLORTABLEPROC __glewGetColorTable; +GLEW_FUN_EXPORT PFNGLGETCOLORTABLEPARAMETERFVPROC __glewGetColorTableParameterfv; +GLEW_FUN_EXPORT PFNGLGETCOLORTABLEPARAMETERIVPROC __glewGetColorTableParameteriv; +GLEW_FUN_EXPORT PFNGLGETCONVOLUTIONFILTERPROC __glewGetConvolutionFilter; +GLEW_FUN_EXPORT PFNGLGETCONVOLUTIONPARAMETERFVPROC __glewGetConvolutionParameterfv; +GLEW_FUN_EXPORT PFNGLGETCONVOLUTIONPARAMETERIVPROC __glewGetConvolutionParameteriv; +GLEW_FUN_EXPORT PFNGLGETHISTOGRAMPROC __glewGetHistogram; +GLEW_FUN_EXPORT PFNGLGETHISTOGRAMPARAMETERFVPROC __glewGetHistogramParameterfv; +GLEW_FUN_EXPORT PFNGLGETHISTOGRAMPARAMETERIVPROC __glewGetHistogramParameteriv; +GLEW_FUN_EXPORT PFNGLGETMINMAXPROC __glewGetMinmax; +GLEW_FUN_EXPORT PFNGLGETMINMAXPARAMETERFVPROC __glewGetMinmaxParameterfv; +GLEW_FUN_EXPORT PFNGLGETMINMAXPARAMETERIVPROC __glewGetMinmaxParameteriv; +GLEW_FUN_EXPORT PFNGLGETSEPARABLEFILTERPROC __glewGetSeparableFilter; +GLEW_FUN_EXPORT PFNGLHISTOGRAMPROC __glewHistogram; +GLEW_FUN_EXPORT PFNGLMINMAXPROC __glewMinmax; +GLEW_FUN_EXPORT PFNGLRESETHISTOGRAMPROC __glewResetHistogram; +GLEW_FUN_EXPORT PFNGLRESETMINMAXPROC __glewResetMinmax; +GLEW_FUN_EXPORT PFNGLSEPARABLEFILTER2DPROC __glewSeparableFilter2D; + +GLEW_FUN_EXPORT PFNGLMULTIDRAWARRAYSINDIRECTCOUNTARBPROC __glewMultiDrawArraysIndirectCountARB; +GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTSINDIRECTCOUNTARBPROC __glewMultiDrawElementsIndirectCountARB; + +GLEW_FUN_EXPORT PFNGLDRAWARRAYSINSTANCEDARBPROC __glewDrawArraysInstancedARB; +GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDARBPROC __glewDrawElementsInstancedARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBDIVISORARBPROC __glewVertexAttribDivisorARB; + +GLEW_FUN_EXPORT PFNGLGETINTERNALFORMATIVPROC __glewGetInternalformativ; + +GLEW_FUN_EXPORT PFNGLGETINTERNALFORMATI64VPROC __glewGetInternalformati64v; + +GLEW_FUN_EXPORT PFNGLINVALIDATEBUFFERDATAPROC __glewInvalidateBufferData; +GLEW_FUN_EXPORT PFNGLINVALIDATEBUFFERSUBDATAPROC __glewInvalidateBufferSubData; +GLEW_FUN_EXPORT PFNGLINVALIDATEFRAMEBUFFERPROC __glewInvalidateFramebuffer; +GLEW_FUN_EXPORT PFNGLINVALIDATESUBFRAMEBUFFERPROC __glewInvalidateSubFramebuffer; +GLEW_FUN_EXPORT PFNGLINVALIDATETEXIMAGEPROC __glewInvalidateTexImage; +GLEW_FUN_EXPORT PFNGLINVALIDATETEXSUBIMAGEPROC __glewInvalidateTexSubImage; + +GLEW_FUN_EXPORT PFNGLFLUSHMAPPEDBUFFERRANGEPROC __glewFlushMappedBufferRange; +GLEW_FUN_EXPORT PFNGLMAPBUFFERRANGEPROC __glewMapBufferRange; + +GLEW_FUN_EXPORT PFNGLCURRENTPALETTEMATRIXARBPROC __glewCurrentPaletteMatrixARB; +GLEW_FUN_EXPORT PFNGLMATRIXINDEXPOINTERARBPROC __glewMatrixIndexPointerARB; +GLEW_FUN_EXPORT PFNGLMATRIXINDEXUBVARBPROC __glewMatrixIndexubvARB; +GLEW_FUN_EXPORT PFNGLMATRIXINDEXUIVARBPROC __glewMatrixIndexuivARB; +GLEW_FUN_EXPORT PFNGLMATRIXINDEXUSVARBPROC __glewMatrixIndexusvARB; + +GLEW_FUN_EXPORT PFNGLBINDBUFFERSBASEPROC __glewBindBuffersBase; +GLEW_FUN_EXPORT PFNGLBINDBUFFERSRANGEPROC __glewBindBuffersRange; +GLEW_FUN_EXPORT PFNGLBINDIMAGETEXTURESPROC __glewBindImageTextures; +GLEW_FUN_EXPORT PFNGLBINDSAMPLERSPROC __glewBindSamplers; +GLEW_FUN_EXPORT PFNGLBINDTEXTURESPROC __glewBindTextures; +GLEW_FUN_EXPORT PFNGLBINDVERTEXBUFFERSPROC __glewBindVertexBuffers; + +GLEW_FUN_EXPORT PFNGLMULTIDRAWARRAYSINDIRECTPROC __glewMultiDrawArraysIndirect; +GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTSINDIRECTPROC __glewMultiDrawElementsIndirect; + +GLEW_FUN_EXPORT PFNGLSAMPLECOVERAGEARBPROC __glewSampleCoverageARB; + +GLEW_FUN_EXPORT PFNGLACTIVETEXTUREARBPROC __glewActiveTextureARB; +GLEW_FUN_EXPORT PFNGLCLIENTACTIVETEXTUREARBPROC __glewClientActiveTextureARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1DARBPROC __glewMultiTexCoord1dARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1DVARBPROC __glewMultiTexCoord1dvARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1FARBPROC __glewMultiTexCoord1fARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1FVARBPROC __glewMultiTexCoord1fvARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1IARBPROC __glewMultiTexCoord1iARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1IVARBPROC __glewMultiTexCoord1ivARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1SARBPROC __glewMultiTexCoord1sARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1SVARBPROC __glewMultiTexCoord1svARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2DARBPROC __glewMultiTexCoord2dARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2DVARBPROC __glewMultiTexCoord2dvARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2FARBPROC __glewMultiTexCoord2fARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2FVARBPROC __glewMultiTexCoord2fvARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2IARBPROC __glewMultiTexCoord2iARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2IVARBPROC __glewMultiTexCoord2ivARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2SARBPROC __glewMultiTexCoord2sARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2SVARBPROC __glewMultiTexCoord2svARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3DARBPROC __glewMultiTexCoord3dARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3DVARBPROC __glewMultiTexCoord3dvARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3FARBPROC __glewMultiTexCoord3fARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3FVARBPROC __glewMultiTexCoord3fvARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3IARBPROC __glewMultiTexCoord3iARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3IVARBPROC __glewMultiTexCoord3ivARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3SARBPROC __glewMultiTexCoord3sARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3SVARBPROC __glewMultiTexCoord3svARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4DARBPROC __glewMultiTexCoord4dARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4DVARBPROC __glewMultiTexCoord4dvARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4FARBPROC __glewMultiTexCoord4fARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4FVARBPROC __glewMultiTexCoord4fvARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4IARBPROC __glewMultiTexCoord4iARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4IVARBPROC __glewMultiTexCoord4ivARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4SARBPROC __glewMultiTexCoord4sARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4SVARBPROC __glewMultiTexCoord4svARB; + +GLEW_FUN_EXPORT PFNGLBEGINQUERYARBPROC __glewBeginQueryARB; +GLEW_FUN_EXPORT PFNGLDELETEQUERIESARBPROC __glewDeleteQueriesARB; +GLEW_FUN_EXPORT PFNGLENDQUERYARBPROC __glewEndQueryARB; +GLEW_FUN_EXPORT PFNGLGENQUERIESARBPROC __glewGenQueriesARB; +GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTIVARBPROC __glewGetQueryObjectivARB; +GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTUIVARBPROC __glewGetQueryObjectuivARB; +GLEW_FUN_EXPORT PFNGLGETQUERYIVARBPROC __glewGetQueryivARB; +GLEW_FUN_EXPORT PFNGLISQUERYARBPROC __glewIsQueryARB; + +GLEW_FUN_EXPORT PFNGLPOINTPARAMETERFARBPROC __glewPointParameterfARB; +GLEW_FUN_EXPORT PFNGLPOINTPARAMETERFVARBPROC __glewPointParameterfvARB; + +GLEW_FUN_EXPORT PFNGLGETPROGRAMINTERFACEIVPROC __glewGetProgramInterfaceiv; +GLEW_FUN_EXPORT PFNGLGETPROGRAMRESOURCEINDEXPROC __glewGetProgramResourceIndex; +GLEW_FUN_EXPORT PFNGLGETPROGRAMRESOURCELOCATIONPROC __glewGetProgramResourceLocation; +GLEW_FUN_EXPORT PFNGLGETPROGRAMRESOURCELOCATIONINDEXPROC __glewGetProgramResourceLocationIndex; +GLEW_FUN_EXPORT PFNGLGETPROGRAMRESOURCENAMEPROC __glewGetProgramResourceName; +GLEW_FUN_EXPORT PFNGLGETPROGRAMRESOURCEIVPROC __glewGetProgramResourceiv; + +GLEW_FUN_EXPORT PFNGLPROVOKINGVERTEXPROC __glewProvokingVertex; + +GLEW_FUN_EXPORT PFNGLGETGRAPHICSRESETSTATUSARBPROC __glewGetGraphicsResetStatusARB; +GLEW_FUN_EXPORT PFNGLGETNCOLORTABLEARBPROC __glewGetnColorTableARB; +GLEW_FUN_EXPORT PFNGLGETNCOMPRESSEDTEXIMAGEARBPROC __glewGetnCompressedTexImageARB; +GLEW_FUN_EXPORT PFNGLGETNCONVOLUTIONFILTERARBPROC __glewGetnConvolutionFilterARB; +GLEW_FUN_EXPORT PFNGLGETNHISTOGRAMARBPROC __glewGetnHistogramARB; +GLEW_FUN_EXPORT PFNGLGETNMAPDVARBPROC __glewGetnMapdvARB; +GLEW_FUN_EXPORT PFNGLGETNMAPFVARBPROC __glewGetnMapfvARB; +GLEW_FUN_EXPORT PFNGLGETNMAPIVARBPROC __glewGetnMapivARB; +GLEW_FUN_EXPORT PFNGLGETNMINMAXARBPROC __glewGetnMinmaxARB; +GLEW_FUN_EXPORT PFNGLGETNPIXELMAPFVARBPROC __glewGetnPixelMapfvARB; +GLEW_FUN_EXPORT PFNGLGETNPIXELMAPUIVARBPROC __glewGetnPixelMapuivARB; +GLEW_FUN_EXPORT PFNGLGETNPIXELMAPUSVARBPROC __glewGetnPixelMapusvARB; +GLEW_FUN_EXPORT PFNGLGETNPOLYGONSTIPPLEARBPROC __glewGetnPolygonStippleARB; +GLEW_FUN_EXPORT PFNGLGETNSEPARABLEFILTERARBPROC __glewGetnSeparableFilterARB; +GLEW_FUN_EXPORT PFNGLGETNTEXIMAGEARBPROC __glewGetnTexImageARB; +GLEW_FUN_EXPORT PFNGLGETNUNIFORMDVARBPROC __glewGetnUniformdvARB; +GLEW_FUN_EXPORT PFNGLGETNUNIFORMFVARBPROC __glewGetnUniformfvARB; +GLEW_FUN_EXPORT PFNGLGETNUNIFORMIVARBPROC __glewGetnUniformivARB; +GLEW_FUN_EXPORT PFNGLGETNUNIFORMUIVARBPROC __glewGetnUniformuivARB; +GLEW_FUN_EXPORT PFNGLREADNPIXELSARBPROC __glewReadnPixelsARB; + +GLEW_FUN_EXPORT PFNGLMINSAMPLESHADINGARBPROC __glewMinSampleShadingARB; + +GLEW_FUN_EXPORT PFNGLBINDSAMPLERPROC __glewBindSampler; +GLEW_FUN_EXPORT PFNGLDELETESAMPLERSPROC __glewDeleteSamplers; +GLEW_FUN_EXPORT PFNGLGENSAMPLERSPROC __glewGenSamplers; +GLEW_FUN_EXPORT PFNGLGETSAMPLERPARAMETERIIVPROC __glewGetSamplerParameterIiv; +GLEW_FUN_EXPORT PFNGLGETSAMPLERPARAMETERIUIVPROC __glewGetSamplerParameterIuiv; +GLEW_FUN_EXPORT PFNGLGETSAMPLERPARAMETERFVPROC __glewGetSamplerParameterfv; +GLEW_FUN_EXPORT PFNGLGETSAMPLERPARAMETERIVPROC __glewGetSamplerParameteriv; +GLEW_FUN_EXPORT PFNGLISSAMPLERPROC __glewIsSampler; +GLEW_FUN_EXPORT PFNGLSAMPLERPARAMETERIIVPROC __glewSamplerParameterIiv; +GLEW_FUN_EXPORT PFNGLSAMPLERPARAMETERIUIVPROC __glewSamplerParameterIuiv; +GLEW_FUN_EXPORT PFNGLSAMPLERPARAMETERFPROC __glewSamplerParameterf; +GLEW_FUN_EXPORT PFNGLSAMPLERPARAMETERFVPROC __glewSamplerParameterfv; +GLEW_FUN_EXPORT PFNGLSAMPLERPARAMETERIPROC __glewSamplerParameteri; +GLEW_FUN_EXPORT PFNGLSAMPLERPARAMETERIVPROC __glewSamplerParameteriv; + +GLEW_FUN_EXPORT PFNGLACTIVESHADERPROGRAMPROC __glewActiveShaderProgram; +GLEW_FUN_EXPORT PFNGLBINDPROGRAMPIPELINEPROC __glewBindProgramPipeline; +GLEW_FUN_EXPORT PFNGLCREATESHADERPROGRAMVPROC __glewCreateShaderProgramv; +GLEW_FUN_EXPORT PFNGLDELETEPROGRAMPIPELINESPROC __glewDeleteProgramPipelines; +GLEW_FUN_EXPORT PFNGLGENPROGRAMPIPELINESPROC __glewGenProgramPipelines; +GLEW_FUN_EXPORT PFNGLGETPROGRAMPIPELINEINFOLOGPROC __glewGetProgramPipelineInfoLog; +GLEW_FUN_EXPORT PFNGLGETPROGRAMPIPELINEIVPROC __glewGetProgramPipelineiv; +GLEW_FUN_EXPORT PFNGLISPROGRAMPIPELINEPROC __glewIsProgramPipeline; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1DPROC __glewProgramUniform1d; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1DVPROC __glewProgramUniform1dv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1FPROC __glewProgramUniform1f; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1FVPROC __glewProgramUniform1fv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1IPROC __glewProgramUniform1i; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1IVPROC __glewProgramUniform1iv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1UIPROC __glewProgramUniform1ui; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1UIVPROC __glewProgramUniform1uiv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2DPROC __glewProgramUniform2d; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2DVPROC __glewProgramUniform2dv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2FPROC __glewProgramUniform2f; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2FVPROC __glewProgramUniform2fv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2IPROC __glewProgramUniform2i; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2IVPROC __glewProgramUniform2iv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2UIPROC __glewProgramUniform2ui; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2UIVPROC __glewProgramUniform2uiv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3DPROC __glewProgramUniform3d; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3DVPROC __glewProgramUniform3dv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3FPROC __glewProgramUniform3f; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3FVPROC __glewProgramUniform3fv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3IPROC __glewProgramUniform3i; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3IVPROC __glewProgramUniform3iv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3UIPROC __glewProgramUniform3ui; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3UIVPROC __glewProgramUniform3uiv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4DPROC __glewProgramUniform4d; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4DVPROC __glewProgramUniform4dv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4FPROC __glewProgramUniform4f; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4FVPROC __glewProgramUniform4fv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4IPROC __glewProgramUniform4i; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4IVPROC __glewProgramUniform4iv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4UIPROC __glewProgramUniform4ui; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4UIVPROC __glewProgramUniform4uiv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2DVPROC __glewProgramUniformMatrix2dv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2FVPROC __glewProgramUniformMatrix2fv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2X3DVPROC __glewProgramUniformMatrix2x3dv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2X3FVPROC __glewProgramUniformMatrix2x3fv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2X4DVPROC __glewProgramUniformMatrix2x4dv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2X4FVPROC __glewProgramUniformMatrix2x4fv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3DVPROC __glewProgramUniformMatrix3dv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3FVPROC __glewProgramUniformMatrix3fv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3X2DVPROC __glewProgramUniformMatrix3x2dv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3X2FVPROC __glewProgramUniformMatrix3x2fv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3X4DVPROC __glewProgramUniformMatrix3x4dv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3X4FVPROC __glewProgramUniformMatrix3x4fv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4DVPROC __glewProgramUniformMatrix4dv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4FVPROC __glewProgramUniformMatrix4fv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4X2DVPROC __glewProgramUniformMatrix4x2dv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4X2FVPROC __glewProgramUniformMatrix4x2fv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4X3DVPROC __glewProgramUniformMatrix4x3dv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4X3FVPROC __glewProgramUniformMatrix4x3fv; +GLEW_FUN_EXPORT PFNGLUSEPROGRAMSTAGESPROC __glewUseProgramStages; +GLEW_FUN_EXPORT PFNGLVALIDATEPROGRAMPIPELINEPROC __glewValidateProgramPipeline; + +GLEW_FUN_EXPORT PFNGLGETACTIVEATOMICCOUNTERBUFFERIVPROC __glewGetActiveAtomicCounterBufferiv; + +GLEW_FUN_EXPORT PFNGLBINDIMAGETEXTUREPROC __glewBindImageTexture; +GLEW_FUN_EXPORT PFNGLMEMORYBARRIERPROC __glewMemoryBarrier; + +GLEW_FUN_EXPORT PFNGLATTACHOBJECTARBPROC __glewAttachObjectARB; +GLEW_FUN_EXPORT PFNGLCOMPILESHADERARBPROC __glewCompileShaderARB; +GLEW_FUN_EXPORT PFNGLCREATEPROGRAMOBJECTARBPROC __glewCreateProgramObjectARB; +GLEW_FUN_EXPORT PFNGLCREATESHADEROBJECTARBPROC __glewCreateShaderObjectARB; +GLEW_FUN_EXPORT PFNGLDELETEOBJECTARBPROC __glewDeleteObjectARB; +GLEW_FUN_EXPORT PFNGLDETACHOBJECTARBPROC __glewDetachObjectARB; +GLEW_FUN_EXPORT PFNGLGETACTIVEUNIFORMARBPROC __glewGetActiveUniformARB; +GLEW_FUN_EXPORT PFNGLGETATTACHEDOBJECTSARBPROC __glewGetAttachedObjectsARB; +GLEW_FUN_EXPORT PFNGLGETHANDLEARBPROC __glewGetHandleARB; +GLEW_FUN_EXPORT PFNGLGETINFOLOGARBPROC __glewGetInfoLogARB; +GLEW_FUN_EXPORT PFNGLGETOBJECTPARAMETERFVARBPROC __glewGetObjectParameterfvARB; +GLEW_FUN_EXPORT PFNGLGETOBJECTPARAMETERIVARBPROC __glewGetObjectParameterivARB; +GLEW_FUN_EXPORT PFNGLGETSHADERSOURCEARBPROC __glewGetShaderSourceARB; +GLEW_FUN_EXPORT PFNGLGETUNIFORMLOCATIONARBPROC __glewGetUniformLocationARB; +GLEW_FUN_EXPORT PFNGLGETUNIFORMFVARBPROC __glewGetUniformfvARB; +GLEW_FUN_EXPORT PFNGLGETUNIFORMIVARBPROC __glewGetUniformivARB; +GLEW_FUN_EXPORT PFNGLLINKPROGRAMARBPROC __glewLinkProgramARB; +GLEW_FUN_EXPORT PFNGLSHADERSOURCEARBPROC __glewShaderSourceARB; +GLEW_FUN_EXPORT PFNGLUNIFORM1FARBPROC __glewUniform1fARB; +GLEW_FUN_EXPORT PFNGLUNIFORM1FVARBPROC __glewUniform1fvARB; +GLEW_FUN_EXPORT PFNGLUNIFORM1IARBPROC __glewUniform1iARB; +GLEW_FUN_EXPORT PFNGLUNIFORM1IVARBPROC __glewUniform1ivARB; +GLEW_FUN_EXPORT PFNGLUNIFORM2FARBPROC __glewUniform2fARB; +GLEW_FUN_EXPORT PFNGLUNIFORM2FVARBPROC __glewUniform2fvARB; +GLEW_FUN_EXPORT PFNGLUNIFORM2IARBPROC __glewUniform2iARB; +GLEW_FUN_EXPORT PFNGLUNIFORM2IVARBPROC __glewUniform2ivARB; +GLEW_FUN_EXPORT PFNGLUNIFORM3FARBPROC __glewUniform3fARB; +GLEW_FUN_EXPORT PFNGLUNIFORM3FVARBPROC __glewUniform3fvARB; +GLEW_FUN_EXPORT PFNGLUNIFORM3IARBPROC __glewUniform3iARB; +GLEW_FUN_EXPORT PFNGLUNIFORM3IVARBPROC __glewUniform3ivARB; +GLEW_FUN_EXPORT PFNGLUNIFORM4FARBPROC __glewUniform4fARB; +GLEW_FUN_EXPORT PFNGLUNIFORM4FVARBPROC __glewUniform4fvARB; +GLEW_FUN_EXPORT PFNGLUNIFORM4IARBPROC __glewUniform4iARB; +GLEW_FUN_EXPORT PFNGLUNIFORM4IVARBPROC __glewUniform4ivARB; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX2FVARBPROC __glewUniformMatrix2fvARB; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX3FVARBPROC __glewUniformMatrix3fvARB; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX4FVARBPROC __glewUniformMatrix4fvARB; +GLEW_FUN_EXPORT PFNGLUSEPROGRAMOBJECTARBPROC __glewUseProgramObjectARB; +GLEW_FUN_EXPORT PFNGLVALIDATEPROGRAMARBPROC __glewValidateProgramARB; + +GLEW_FUN_EXPORT PFNGLSHADERSTORAGEBLOCKBINDINGPROC __glewShaderStorageBlockBinding; + +GLEW_FUN_EXPORT PFNGLGETACTIVESUBROUTINENAMEPROC __glewGetActiveSubroutineName; +GLEW_FUN_EXPORT PFNGLGETACTIVESUBROUTINEUNIFORMNAMEPROC __glewGetActiveSubroutineUniformName; +GLEW_FUN_EXPORT PFNGLGETACTIVESUBROUTINEUNIFORMIVPROC __glewGetActiveSubroutineUniformiv; +GLEW_FUN_EXPORT PFNGLGETPROGRAMSTAGEIVPROC __glewGetProgramStageiv; +GLEW_FUN_EXPORT PFNGLGETSUBROUTINEINDEXPROC __glewGetSubroutineIndex; +GLEW_FUN_EXPORT PFNGLGETSUBROUTINEUNIFORMLOCATIONPROC __glewGetSubroutineUniformLocation; +GLEW_FUN_EXPORT PFNGLGETUNIFORMSUBROUTINEUIVPROC __glewGetUniformSubroutineuiv; +GLEW_FUN_EXPORT PFNGLUNIFORMSUBROUTINESUIVPROC __glewUniformSubroutinesuiv; + +GLEW_FUN_EXPORT PFNGLCOMPILESHADERINCLUDEARBPROC __glewCompileShaderIncludeARB; +GLEW_FUN_EXPORT PFNGLDELETENAMEDSTRINGARBPROC __glewDeleteNamedStringARB; +GLEW_FUN_EXPORT PFNGLGETNAMEDSTRINGARBPROC __glewGetNamedStringARB; +GLEW_FUN_EXPORT PFNGLGETNAMEDSTRINGIVARBPROC __glewGetNamedStringivARB; +GLEW_FUN_EXPORT PFNGLISNAMEDSTRINGARBPROC __glewIsNamedStringARB; +GLEW_FUN_EXPORT PFNGLNAMEDSTRINGARBPROC __glewNamedStringARB; + +GLEW_FUN_EXPORT PFNGLTEXPAGECOMMITMENTARBPROC __glewTexPageCommitmentARB; +GLEW_FUN_EXPORT PFNGLTEXTUREPAGECOMMITMENTEXTPROC __glewTexturePageCommitmentEXT; + +GLEW_FUN_EXPORT PFNGLCLIENTWAITSYNCPROC __glewClientWaitSync; +GLEW_FUN_EXPORT PFNGLDELETESYNCPROC __glewDeleteSync; +GLEW_FUN_EXPORT PFNGLFENCESYNCPROC __glewFenceSync; +GLEW_FUN_EXPORT PFNGLGETINTEGER64VPROC __glewGetInteger64v; +GLEW_FUN_EXPORT PFNGLGETSYNCIVPROC __glewGetSynciv; +GLEW_FUN_EXPORT PFNGLISSYNCPROC __glewIsSync; +GLEW_FUN_EXPORT PFNGLWAITSYNCPROC __glewWaitSync; + +GLEW_FUN_EXPORT PFNGLPATCHPARAMETERFVPROC __glewPatchParameterfv; +GLEW_FUN_EXPORT PFNGLPATCHPARAMETERIPROC __glewPatchParameteri; + +GLEW_FUN_EXPORT PFNGLTEXBUFFERARBPROC __glewTexBufferARB; + +GLEW_FUN_EXPORT PFNGLTEXBUFFERRANGEPROC __glewTexBufferRange; +GLEW_FUN_EXPORT PFNGLTEXTUREBUFFERRANGEEXTPROC __glewTextureBufferRangeEXT; + +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXIMAGE1DARBPROC __glewCompressedTexImage1DARB; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXIMAGE2DARBPROC __glewCompressedTexImage2DARB; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXIMAGE3DARBPROC __glewCompressedTexImage3DARB; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC __glewCompressedTexSubImage1DARB; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC __glewCompressedTexSubImage2DARB; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC __glewCompressedTexSubImage3DARB; +GLEW_FUN_EXPORT PFNGLGETCOMPRESSEDTEXIMAGEARBPROC __glewGetCompressedTexImageARB; + +GLEW_FUN_EXPORT PFNGLGETMULTISAMPLEFVPROC __glewGetMultisamplefv; +GLEW_FUN_EXPORT PFNGLSAMPLEMASKIPROC __glewSampleMaski; +GLEW_FUN_EXPORT PFNGLTEXIMAGE2DMULTISAMPLEPROC __glewTexImage2DMultisample; +GLEW_FUN_EXPORT PFNGLTEXIMAGE3DMULTISAMPLEPROC __glewTexImage3DMultisample; + +GLEW_FUN_EXPORT PFNGLTEXSTORAGE1DPROC __glewTexStorage1D; +GLEW_FUN_EXPORT PFNGLTEXSTORAGE2DPROC __glewTexStorage2D; +GLEW_FUN_EXPORT PFNGLTEXSTORAGE3DPROC __glewTexStorage3D; +GLEW_FUN_EXPORT PFNGLTEXTURESTORAGE1DEXTPROC __glewTextureStorage1DEXT; +GLEW_FUN_EXPORT PFNGLTEXTURESTORAGE2DEXTPROC __glewTextureStorage2DEXT; +GLEW_FUN_EXPORT PFNGLTEXTURESTORAGE3DEXTPROC __glewTextureStorage3DEXT; + +GLEW_FUN_EXPORT PFNGLTEXSTORAGE2DMULTISAMPLEPROC __glewTexStorage2DMultisample; +GLEW_FUN_EXPORT PFNGLTEXSTORAGE3DMULTISAMPLEPROC __glewTexStorage3DMultisample; +GLEW_FUN_EXPORT PFNGLTEXTURESTORAGE2DMULTISAMPLEEXTPROC __glewTextureStorage2DMultisampleEXT; +GLEW_FUN_EXPORT PFNGLTEXTURESTORAGE3DMULTISAMPLEEXTPROC __glewTextureStorage3DMultisampleEXT; + +GLEW_FUN_EXPORT PFNGLTEXTUREVIEWPROC __glewTextureView; + +GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTI64VPROC __glewGetQueryObjecti64v; +GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTUI64VPROC __glewGetQueryObjectui64v; +GLEW_FUN_EXPORT PFNGLQUERYCOUNTERPROC __glewQueryCounter; + +GLEW_FUN_EXPORT PFNGLBINDTRANSFORMFEEDBACKPROC __glewBindTransformFeedback; +GLEW_FUN_EXPORT PFNGLDELETETRANSFORMFEEDBACKSPROC __glewDeleteTransformFeedbacks; +GLEW_FUN_EXPORT PFNGLDRAWTRANSFORMFEEDBACKPROC __glewDrawTransformFeedback; +GLEW_FUN_EXPORT PFNGLGENTRANSFORMFEEDBACKSPROC __glewGenTransformFeedbacks; +GLEW_FUN_EXPORT PFNGLISTRANSFORMFEEDBACKPROC __glewIsTransformFeedback; +GLEW_FUN_EXPORT PFNGLPAUSETRANSFORMFEEDBACKPROC __glewPauseTransformFeedback; +GLEW_FUN_EXPORT PFNGLRESUMETRANSFORMFEEDBACKPROC __glewResumeTransformFeedback; + +GLEW_FUN_EXPORT PFNGLBEGINQUERYINDEXEDPROC __glewBeginQueryIndexed; +GLEW_FUN_EXPORT PFNGLDRAWTRANSFORMFEEDBACKSTREAMPROC __glewDrawTransformFeedbackStream; +GLEW_FUN_EXPORT PFNGLENDQUERYINDEXEDPROC __glewEndQueryIndexed; +GLEW_FUN_EXPORT PFNGLGETQUERYINDEXEDIVPROC __glewGetQueryIndexediv; + +GLEW_FUN_EXPORT PFNGLDRAWTRANSFORMFEEDBACKINSTANCEDPROC __glewDrawTransformFeedbackInstanced; +GLEW_FUN_EXPORT PFNGLDRAWTRANSFORMFEEDBACKSTREAMINSTANCEDPROC __glewDrawTransformFeedbackStreamInstanced; + +GLEW_FUN_EXPORT PFNGLLOADTRANSPOSEMATRIXDARBPROC __glewLoadTransposeMatrixdARB; +GLEW_FUN_EXPORT PFNGLLOADTRANSPOSEMATRIXFARBPROC __glewLoadTransposeMatrixfARB; +GLEW_FUN_EXPORT PFNGLMULTTRANSPOSEMATRIXDARBPROC __glewMultTransposeMatrixdARB; +GLEW_FUN_EXPORT PFNGLMULTTRANSPOSEMATRIXFARBPROC __glewMultTransposeMatrixfARB; + +GLEW_FUN_EXPORT PFNGLBINDBUFFERBASEPROC __glewBindBufferBase; +GLEW_FUN_EXPORT PFNGLBINDBUFFERRANGEPROC __glewBindBufferRange; +GLEW_FUN_EXPORT PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC __glewGetActiveUniformBlockName; +GLEW_FUN_EXPORT PFNGLGETACTIVEUNIFORMBLOCKIVPROC __glewGetActiveUniformBlockiv; +GLEW_FUN_EXPORT PFNGLGETACTIVEUNIFORMNAMEPROC __glewGetActiveUniformName; +GLEW_FUN_EXPORT PFNGLGETACTIVEUNIFORMSIVPROC __glewGetActiveUniformsiv; +GLEW_FUN_EXPORT PFNGLGETINTEGERI_VPROC __glewGetIntegeri_v; +GLEW_FUN_EXPORT PFNGLGETUNIFORMBLOCKINDEXPROC __glewGetUniformBlockIndex; +GLEW_FUN_EXPORT PFNGLGETUNIFORMINDICESPROC __glewGetUniformIndices; +GLEW_FUN_EXPORT PFNGLUNIFORMBLOCKBINDINGPROC __glewUniformBlockBinding; + +GLEW_FUN_EXPORT PFNGLBINDVERTEXARRAYPROC __glewBindVertexArray; +GLEW_FUN_EXPORT PFNGLDELETEVERTEXARRAYSPROC __glewDeleteVertexArrays; +GLEW_FUN_EXPORT PFNGLGENVERTEXARRAYSPROC __glewGenVertexArrays; +GLEW_FUN_EXPORT PFNGLISVERTEXARRAYPROC __glewIsVertexArray; + +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBLDVPROC __glewGetVertexAttribLdv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1DPROC __glewVertexAttribL1d; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1DVPROC __glewVertexAttribL1dv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL2DPROC __glewVertexAttribL2d; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL2DVPROC __glewVertexAttribL2dv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL3DPROC __glewVertexAttribL3d; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL3DVPROC __glewVertexAttribL3dv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL4DPROC __glewVertexAttribL4d; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL4DVPROC __glewVertexAttribL4dv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBLPOINTERPROC __glewVertexAttribLPointer; + +GLEW_FUN_EXPORT PFNGLBINDVERTEXBUFFERPROC __glewBindVertexBuffer; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBBINDINGPROC __glewVertexAttribBinding; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBFORMATPROC __glewVertexAttribFormat; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBIFORMATPROC __glewVertexAttribIFormat; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBLFORMATPROC __glewVertexAttribLFormat; +GLEW_FUN_EXPORT PFNGLVERTEXBINDINGDIVISORPROC __glewVertexBindingDivisor; + +GLEW_FUN_EXPORT PFNGLVERTEXBLENDARBPROC __glewVertexBlendARB; +GLEW_FUN_EXPORT PFNGLWEIGHTPOINTERARBPROC __glewWeightPointerARB; +GLEW_FUN_EXPORT PFNGLWEIGHTBVARBPROC __glewWeightbvARB; +GLEW_FUN_EXPORT PFNGLWEIGHTDVARBPROC __glewWeightdvARB; +GLEW_FUN_EXPORT PFNGLWEIGHTFVARBPROC __glewWeightfvARB; +GLEW_FUN_EXPORT PFNGLWEIGHTIVARBPROC __glewWeightivARB; +GLEW_FUN_EXPORT PFNGLWEIGHTSVARBPROC __glewWeightsvARB; +GLEW_FUN_EXPORT PFNGLWEIGHTUBVARBPROC __glewWeightubvARB; +GLEW_FUN_EXPORT PFNGLWEIGHTUIVARBPROC __glewWeightuivARB; +GLEW_FUN_EXPORT PFNGLWEIGHTUSVARBPROC __glewWeightusvARB; + +GLEW_FUN_EXPORT PFNGLBINDBUFFERARBPROC __glewBindBufferARB; +GLEW_FUN_EXPORT PFNGLBUFFERDATAARBPROC __glewBufferDataARB; +GLEW_FUN_EXPORT PFNGLBUFFERSUBDATAARBPROC __glewBufferSubDataARB; +GLEW_FUN_EXPORT PFNGLDELETEBUFFERSARBPROC __glewDeleteBuffersARB; +GLEW_FUN_EXPORT PFNGLGENBUFFERSARBPROC __glewGenBuffersARB; +GLEW_FUN_EXPORT PFNGLGETBUFFERPARAMETERIVARBPROC __glewGetBufferParameterivARB; +GLEW_FUN_EXPORT PFNGLGETBUFFERPOINTERVARBPROC __glewGetBufferPointervARB; +GLEW_FUN_EXPORT PFNGLGETBUFFERSUBDATAARBPROC __glewGetBufferSubDataARB; +GLEW_FUN_EXPORT PFNGLISBUFFERARBPROC __glewIsBufferARB; +GLEW_FUN_EXPORT PFNGLMAPBUFFERARBPROC __glewMapBufferARB; +GLEW_FUN_EXPORT PFNGLUNMAPBUFFERARBPROC __glewUnmapBufferARB; + +GLEW_FUN_EXPORT PFNGLBINDPROGRAMARBPROC __glewBindProgramARB; +GLEW_FUN_EXPORT PFNGLDELETEPROGRAMSARBPROC __glewDeleteProgramsARB; +GLEW_FUN_EXPORT PFNGLDISABLEVERTEXATTRIBARRAYARBPROC __glewDisableVertexAttribArrayARB; +GLEW_FUN_EXPORT PFNGLENABLEVERTEXATTRIBARRAYARBPROC __glewEnableVertexAttribArrayARB; +GLEW_FUN_EXPORT PFNGLGENPROGRAMSARBPROC __glewGenProgramsARB; +GLEW_FUN_EXPORT PFNGLGETPROGRAMENVPARAMETERDVARBPROC __glewGetProgramEnvParameterdvARB; +GLEW_FUN_EXPORT PFNGLGETPROGRAMENVPARAMETERFVARBPROC __glewGetProgramEnvParameterfvARB; +GLEW_FUN_EXPORT PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC __glewGetProgramLocalParameterdvARB; +GLEW_FUN_EXPORT PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC __glewGetProgramLocalParameterfvARB; +GLEW_FUN_EXPORT PFNGLGETPROGRAMSTRINGARBPROC __glewGetProgramStringARB; +GLEW_FUN_EXPORT PFNGLGETPROGRAMIVARBPROC __glewGetProgramivARB; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBPOINTERVARBPROC __glewGetVertexAttribPointervARB; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBDVARBPROC __glewGetVertexAttribdvARB; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBFVARBPROC __glewGetVertexAttribfvARB; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBIVARBPROC __glewGetVertexAttribivARB; +GLEW_FUN_EXPORT PFNGLISPROGRAMARBPROC __glewIsProgramARB; +GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETER4DARBPROC __glewProgramEnvParameter4dARB; +GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETER4DVARBPROC __glewProgramEnvParameter4dvARB; +GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETER4FARBPROC __glewProgramEnvParameter4fARB; +GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETER4FVARBPROC __glewProgramEnvParameter4fvARB; +GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETER4DARBPROC __glewProgramLocalParameter4dARB; +GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETER4DVARBPROC __glewProgramLocalParameter4dvARB; +GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETER4FARBPROC __glewProgramLocalParameter4fARB; +GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETER4FVARBPROC __glewProgramLocalParameter4fvARB; +GLEW_FUN_EXPORT PFNGLPROGRAMSTRINGARBPROC __glewProgramStringARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1DARBPROC __glewVertexAttrib1dARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1DVARBPROC __glewVertexAttrib1dvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1FARBPROC __glewVertexAttrib1fARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1FVARBPROC __glewVertexAttrib1fvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1SARBPROC __glewVertexAttrib1sARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1SVARBPROC __glewVertexAttrib1svARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2DARBPROC __glewVertexAttrib2dARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2DVARBPROC __glewVertexAttrib2dvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2FARBPROC __glewVertexAttrib2fARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2FVARBPROC __glewVertexAttrib2fvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2SARBPROC __glewVertexAttrib2sARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2SVARBPROC __glewVertexAttrib2svARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3DARBPROC __glewVertexAttrib3dARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3DVARBPROC __glewVertexAttrib3dvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3FARBPROC __glewVertexAttrib3fARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3FVARBPROC __glewVertexAttrib3fvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3SARBPROC __glewVertexAttrib3sARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3SVARBPROC __glewVertexAttrib3svARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NBVARBPROC __glewVertexAttrib4NbvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NIVARBPROC __glewVertexAttrib4NivARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NSVARBPROC __glewVertexAttrib4NsvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUBARBPROC __glewVertexAttrib4NubARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUBVARBPROC __glewVertexAttrib4NubvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUIVARBPROC __glewVertexAttrib4NuivARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUSVARBPROC __glewVertexAttrib4NusvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4BVARBPROC __glewVertexAttrib4bvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4DARBPROC __glewVertexAttrib4dARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4DVARBPROC __glewVertexAttrib4dvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4FARBPROC __glewVertexAttrib4fARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4FVARBPROC __glewVertexAttrib4fvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4IVARBPROC __glewVertexAttrib4ivARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4SARBPROC __glewVertexAttrib4sARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4SVARBPROC __glewVertexAttrib4svARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4UBVARBPROC __glewVertexAttrib4ubvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4UIVARBPROC __glewVertexAttrib4uivARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4USVARBPROC __glewVertexAttrib4usvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBPOINTERARBPROC __glewVertexAttribPointerARB; + +GLEW_FUN_EXPORT PFNGLBINDATTRIBLOCATIONARBPROC __glewBindAttribLocationARB; +GLEW_FUN_EXPORT PFNGLGETACTIVEATTRIBARBPROC __glewGetActiveAttribARB; +GLEW_FUN_EXPORT PFNGLGETATTRIBLOCATIONARBPROC __glewGetAttribLocationARB; + +GLEW_FUN_EXPORT PFNGLCOLORP3UIPROC __glewColorP3ui; +GLEW_FUN_EXPORT PFNGLCOLORP3UIVPROC __glewColorP3uiv; +GLEW_FUN_EXPORT PFNGLCOLORP4UIPROC __glewColorP4ui; +GLEW_FUN_EXPORT PFNGLCOLORP4UIVPROC __glewColorP4uiv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORDP1UIPROC __glewMultiTexCoordP1ui; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORDP1UIVPROC __glewMultiTexCoordP1uiv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORDP2UIPROC __glewMultiTexCoordP2ui; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORDP2UIVPROC __glewMultiTexCoordP2uiv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORDP3UIPROC __glewMultiTexCoordP3ui; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORDP3UIVPROC __glewMultiTexCoordP3uiv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORDP4UIPROC __glewMultiTexCoordP4ui; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORDP4UIVPROC __glewMultiTexCoordP4uiv; +GLEW_FUN_EXPORT PFNGLNORMALP3UIPROC __glewNormalP3ui; +GLEW_FUN_EXPORT PFNGLNORMALP3UIVPROC __glewNormalP3uiv; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLORP3UIPROC __glewSecondaryColorP3ui; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLORP3UIVPROC __glewSecondaryColorP3uiv; +GLEW_FUN_EXPORT PFNGLTEXCOORDP1UIPROC __glewTexCoordP1ui; +GLEW_FUN_EXPORT PFNGLTEXCOORDP1UIVPROC __glewTexCoordP1uiv; +GLEW_FUN_EXPORT PFNGLTEXCOORDP2UIPROC __glewTexCoordP2ui; +GLEW_FUN_EXPORT PFNGLTEXCOORDP2UIVPROC __glewTexCoordP2uiv; +GLEW_FUN_EXPORT PFNGLTEXCOORDP3UIPROC __glewTexCoordP3ui; +GLEW_FUN_EXPORT PFNGLTEXCOORDP3UIVPROC __glewTexCoordP3uiv; +GLEW_FUN_EXPORT PFNGLTEXCOORDP4UIPROC __glewTexCoordP4ui; +GLEW_FUN_EXPORT PFNGLTEXCOORDP4UIVPROC __glewTexCoordP4uiv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBP1UIPROC __glewVertexAttribP1ui; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBP1UIVPROC __glewVertexAttribP1uiv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBP2UIPROC __glewVertexAttribP2ui; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBP2UIVPROC __glewVertexAttribP2uiv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBP3UIPROC __glewVertexAttribP3ui; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBP3UIVPROC __glewVertexAttribP3uiv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBP4UIPROC __glewVertexAttribP4ui; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBP4UIVPROC __glewVertexAttribP4uiv; +GLEW_FUN_EXPORT PFNGLVERTEXP2UIPROC __glewVertexP2ui; +GLEW_FUN_EXPORT PFNGLVERTEXP2UIVPROC __glewVertexP2uiv; +GLEW_FUN_EXPORT PFNGLVERTEXP3UIPROC __glewVertexP3ui; +GLEW_FUN_EXPORT PFNGLVERTEXP3UIVPROC __glewVertexP3uiv; +GLEW_FUN_EXPORT PFNGLVERTEXP4UIPROC __glewVertexP4ui; +GLEW_FUN_EXPORT PFNGLVERTEXP4UIVPROC __glewVertexP4uiv; + +GLEW_FUN_EXPORT PFNGLDEPTHRANGEARRAYVPROC __glewDepthRangeArrayv; +GLEW_FUN_EXPORT PFNGLDEPTHRANGEINDEXEDPROC __glewDepthRangeIndexed; +GLEW_FUN_EXPORT PFNGLGETDOUBLEI_VPROC __glewGetDoublei_v; +GLEW_FUN_EXPORT PFNGLGETFLOATI_VPROC __glewGetFloati_v; +GLEW_FUN_EXPORT PFNGLSCISSORARRAYVPROC __glewScissorArrayv; +GLEW_FUN_EXPORT PFNGLSCISSORINDEXEDPROC __glewScissorIndexed; +GLEW_FUN_EXPORT PFNGLSCISSORINDEXEDVPROC __glewScissorIndexedv; +GLEW_FUN_EXPORT PFNGLVIEWPORTARRAYVPROC __glewViewportArrayv; +GLEW_FUN_EXPORT PFNGLVIEWPORTINDEXEDFPROC __glewViewportIndexedf; +GLEW_FUN_EXPORT PFNGLVIEWPORTINDEXEDFVPROC __glewViewportIndexedfv; + +GLEW_FUN_EXPORT PFNGLWINDOWPOS2DARBPROC __glewWindowPos2dARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2DVARBPROC __glewWindowPos2dvARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2FARBPROC __glewWindowPos2fARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2FVARBPROC __glewWindowPos2fvARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2IARBPROC __glewWindowPos2iARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2IVARBPROC __glewWindowPos2ivARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2SARBPROC __glewWindowPos2sARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2SVARBPROC __glewWindowPos2svARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3DARBPROC __glewWindowPos3dARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3DVARBPROC __glewWindowPos3dvARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3FARBPROC __glewWindowPos3fARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3FVARBPROC __glewWindowPos3fvARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3IARBPROC __glewWindowPos3iARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3IVARBPROC __glewWindowPos3ivARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3SARBPROC __glewWindowPos3sARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3SVARBPROC __glewWindowPos3svARB; + +GLEW_FUN_EXPORT PFNGLDRAWBUFFERSATIPROC __glewDrawBuffersATI; + +GLEW_FUN_EXPORT PFNGLDRAWELEMENTARRAYATIPROC __glewDrawElementArrayATI; +GLEW_FUN_EXPORT PFNGLDRAWRANGEELEMENTARRAYATIPROC __glewDrawRangeElementArrayATI; +GLEW_FUN_EXPORT PFNGLELEMENTPOINTERATIPROC __glewElementPointerATI; + +GLEW_FUN_EXPORT PFNGLGETTEXBUMPPARAMETERFVATIPROC __glewGetTexBumpParameterfvATI; +GLEW_FUN_EXPORT PFNGLGETTEXBUMPPARAMETERIVATIPROC __glewGetTexBumpParameterivATI; +GLEW_FUN_EXPORT PFNGLTEXBUMPPARAMETERFVATIPROC __glewTexBumpParameterfvATI; +GLEW_FUN_EXPORT PFNGLTEXBUMPPARAMETERIVATIPROC __glewTexBumpParameterivATI; + +GLEW_FUN_EXPORT PFNGLALPHAFRAGMENTOP1ATIPROC __glewAlphaFragmentOp1ATI; +GLEW_FUN_EXPORT PFNGLALPHAFRAGMENTOP2ATIPROC __glewAlphaFragmentOp2ATI; +GLEW_FUN_EXPORT PFNGLALPHAFRAGMENTOP3ATIPROC __glewAlphaFragmentOp3ATI; +GLEW_FUN_EXPORT PFNGLBEGINFRAGMENTSHADERATIPROC __glewBeginFragmentShaderATI; +GLEW_FUN_EXPORT PFNGLBINDFRAGMENTSHADERATIPROC __glewBindFragmentShaderATI; +GLEW_FUN_EXPORT PFNGLCOLORFRAGMENTOP1ATIPROC __glewColorFragmentOp1ATI; +GLEW_FUN_EXPORT PFNGLCOLORFRAGMENTOP2ATIPROC __glewColorFragmentOp2ATI; +GLEW_FUN_EXPORT PFNGLCOLORFRAGMENTOP3ATIPROC __glewColorFragmentOp3ATI; +GLEW_FUN_EXPORT PFNGLDELETEFRAGMENTSHADERATIPROC __glewDeleteFragmentShaderATI; +GLEW_FUN_EXPORT PFNGLENDFRAGMENTSHADERATIPROC __glewEndFragmentShaderATI; +GLEW_FUN_EXPORT PFNGLGENFRAGMENTSHADERSATIPROC __glewGenFragmentShadersATI; +GLEW_FUN_EXPORT PFNGLPASSTEXCOORDATIPROC __glewPassTexCoordATI; +GLEW_FUN_EXPORT PFNGLSAMPLEMAPATIPROC __glewSampleMapATI; +GLEW_FUN_EXPORT PFNGLSETFRAGMENTSHADERCONSTANTATIPROC __glewSetFragmentShaderConstantATI; + +GLEW_FUN_EXPORT PFNGLMAPOBJECTBUFFERATIPROC __glewMapObjectBufferATI; +GLEW_FUN_EXPORT PFNGLUNMAPOBJECTBUFFERATIPROC __glewUnmapObjectBufferATI; + +GLEW_FUN_EXPORT PFNGLPNTRIANGLESFATIPROC __glewPNTrianglesfATI; +GLEW_FUN_EXPORT PFNGLPNTRIANGLESIATIPROC __glewPNTrianglesiATI; + +GLEW_FUN_EXPORT PFNGLSTENCILFUNCSEPARATEATIPROC __glewStencilFuncSeparateATI; +GLEW_FUN_EXPORT PFNGLSTENCILOPSEPARATEATIPROC __glewStencilOpSeparateATI; + +GLEW_FUN_EXPORT PFNGLARRAYOBJECTATIPROC __glewArrayObjectATI; +GLEW_FUN_EXPORT PFNGLFREEOBJECTBUFFERATIPROC __glewFreeObjectBufferATI; +GLEW_FUN_EXPORT PFNGLGETARRAYOBJECTFVATIPROC __glewGetArrayObjectfvATI; +GLEW_FUN_EXPORT PFNGLGETARRAYOBJECTIVATIPROC __glewGetArrayObjectivATI; +GLEW_FUN_EXPORT PFNGLGETOBJECTBUFFERFVATIPROC __glewGetObjectBufferfvATI; +GLEW_FUN_EXPORT PFNGLGETOBJECTBUFFERIVATIPROC __glewGetObjectBufferivATI; +GLEW_FUN_EXPORT PFNGLGETVARIANTARRAYOBJECTFVATIPROC __glewGetVariantArrayObjectfvATI; +GLEW_FUN_EXPORT PFNGLGETVARIANTARRAYOBJECTIVATIPROC __glewGetVariantArrayObjectivATI; +GLEW_FUN_EXPORT PFNGLISOBJECTBUFFERATIPROC __glewIsObjectBufferATI; +GLEW_FUN_EXPORT PFNGLNEWOBJECTBUFFERATIPROC __glewNewObjectBufferATI; +GLEW_FUN_EXPORT PFNGLUPDATEOBJECTBUFFERATIPROC __glewUpdateObjectBufferATI; +GLEW_FUN_EXPORT PFNGLVARIANTARRAYOBJECTATIPROC __glewVariantArrayObjectATI; + +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBARRAYOBJECTFVATIPROC __glewGetVertexAttribArrayObjectfvATI; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBARRAYOBJECTIVATIPROC __glewGetVertexAttribArrayObjectivATI; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBARRAYOBJECTATIPROC __glewVertexAttribArrayObjectATI; + +GLEW_FUN_EXPORT PFNGLCLIENTACTIVEVERTEXSTREAMATIPROC __glewClientActiveVertexStreamATI; +GLEW_FUN_EXPORT PFNGLNORMALSTREAM3BATIPROC __glewNormalStream3bATI; +GLEW_FUN_EXPORT PFNGLNORMALSTREAM3BVATIPROC __glewNormalStream3bvATI; +GLEW_FUN_EXPORT PFNGLNORMALSTREAM3DATIPROC __glewNormalStream3dATI; +GLEW_FUN_EXPORT PFNGLNORMALSTREAM3DVATIPROC __glewNormalStream3dvATI; +GLEW_FUN_EXPORT PFNGLNORMALSTREAM3FATIPROC __glewNormalStream3fATI; +GLEW_FUN_EXPORT PFNGLNORMALSTREAM3FVATIPROC __glewNormalStream3fvATI; +GLEW_FUN_EXPORT PFNGLNORMALSTREAM3IATIPROC __glewNormalStream3iATI; +GLEW_FUN_EXPORT PFNGLNORMALSTREAM3IVATIPROC __glewNormalStream3ivATI; +GLEW_FUN_EXPORT PFNGLNORMALSTREAM3SATIPROC __glewNormalStream3sATI; +GLEW_FUN_EXPORT PFNGLNORMALSTREAM3SVATIPROC __glewNormalStream3svATI; +GLEW_FUN_EXPORT PFNGLVERTEXBLENDENVFATIPROC __glewVertexBlendEnvfATI; +GLEW_FUN_EXPORT PFNGLVERTEXBLENDENVIATIPROC __glewVertexBlendEnviATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM1DATIPROC __glewVertexStream1dATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM1DVATIPROC __glewVertexStream1dvATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM1FATIPROC __glewVertexStream1fATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM1FVATIPROC __glewVertexStream1fvATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM1IATIPROC __glewVertexStream1iATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM1IVATIPROC __glewVertexStream1ivATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM1SATIPROC __glewVertexStream1sATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM1SVATIPROC __glewVertexStream1svATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM2DATIPROC __glewVertexStream2dATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM2DVATIPROC __glewVertexStream2dvATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM2FATIPROC __glewVertexStream2fATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM2FVATIPROC __glewVertexStream2fvATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM2IATIPROC __glewVertexStream2iATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM2IVATIPROC __glewVertexStream2ivATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM2SATIPROC __glewVertexStream2sATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM2SVATIPROC __glewVertexStream2svATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM3DATIPROC __glewVertexStream3dATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM3DVATIPROC __glewVertexStream3dvATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM3FATIPROC __glewVertexStream3fATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM3FVATIPROC __glewVertexStream3fvATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM3IATIPROC __glewVertexStream3iATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM3IVATIPROC __glewVertexStream3ivATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM3SATIPROC __glewVertexStream3sATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM3SVATIPROC __glewVertexStream3svATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM4DATIPROC __glewVertexStream4dATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM4DVATIPROC __glewVertexStream4dvATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM4FATIPROC __glewVertexStream4fATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM4FVATIPROC __glewVertexStream4fvATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM4IATIPROC __glewVertexStream4iATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM4IVATIPROC __glewVertexStream4ivATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM4SATIPROC __glewVertexStream4sATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM4SVATIPROC __glewVertexStream4svATI; + +GLEW_FUN_EXPORT PFNGLGETUNIFORMBUFFERSIZEEXTPROC __glewGetUniformBufferSizeEXT; +GLEW_FUN_EXPORT PFNGLGETUNIFORMOFFSETEXTPROC __glewGetUniformOffsetEXT; +GLEW_FUN_EXPORT PFNGLUNIFORMBUFFEREXTPROC __glewUniformBufferEXT; + +GLEW_FUN_EXPORT PFNGLBLENDCOLOREXTPROC __glewBlendColorEXT; + +GLEW_FUN_EXPORT PFNGLBLENDEQUATIONSEPARATEEXTPROC __glewBlendEquationSeparateEXT; + +GLEW_FUN_EXPORT PFNGLBLENDFUNCSEPARATEEXTPROC __glewBlendFuncSeparateEXT; + +GLEW_FUN_EXPORT PFNGLBLENDEQUATIONEXTPROC __glewBlendEquationEXT; + +GLEW_FUN_EXPORT PFNGLCOLORSUBTABLEEXTPROC __glewColorSubTableEXT; +GLEW_FUN_EXPORT PFNGLCOPYCOLORSUBTABLEEXTPROC __glewCopyColorSubTableEXT; + +GLEW_FUN_EXPORT PFNGLLOCKARRAYSEXTPROC __glewLockArraysEXT; +GLEW_FUN_EXPORT PFNGLUNLOCKARRAYSEXTPROC __glewUnlockArraysEXT; + +GLEW_FUN_EXPORT PFNGLCONVOLUTIONFILTER1DEXTPROC __glewConvolutionFilter1DEXT; +GLEW_FUN_EXPORT PFNGLCONVOLUTIONFILTER2DEXTPROC __glewConvolutionFilter2DEXT; +GLEW_FUN_EXPORT PFNGLCONVOLUTIONPARAMETERFEXTPROC __glewConvolutionParameterfEXT; +GLEW_FUN_EXPORT PFNGLCONVOLUTIONPARAMETERFVEXTPROC __glewConvolutionParameterfvEXT; +GLEW_FUN_EXPORT PFNGLCONVOLUTIONPARAMETERIEXTPROC __glewConvolutionParameteriEXT; +GLEW_FUN_EXPORT PFNGLCONVOLUTIONPARAMETERIVEXTPROC __glewConvolutionParameterivEXT; +GLEW_FUN_EXPORT PFNGLCOPYCONVOLUTIONFILTER1DEXTPROC __glewCopyConvolutionFilter1DEXT; +GLEW_FUN_EXPORT PFNGLCOPYCONVOLUTIONFILTER2DEXTPROC __glewCopyConvolutionFilter2DEXT; +GLEW_FUN_EXPORT PFNGLGETCONVOLUTIONFILTEREXTPROC __glewGetConvolutionFilterEXT; +GLEW_FUN_EXPORT PFNGLGETCONVOLUTIONPARAMETERFVEXTPROC __glewGetConvolutionParameterfvEXT; +GLEW_FUN_EXPORT PFNGLGETCONVOLUTIONPARAMETERIVEXTPROC __glewGetConvolutionParameterivEXT; +GLEW_FUN_EXPORT PFNGLGETSEPARABLEFILTEREXTPROC __glewGetSeparableFilterEXT; +GLEW_FUN_EXPORT PFNGLSEPARABLEFILTER2DEXTPROC __glewSeparableFilter2DEXT; + +GLEW_FUN_EXPORT PFNGLBINORMALPOINTEREXTPROC __glewBinormalPointerEXT; +GLEW_FUN_EXPORT PFNGLTANGENTPOINTEREXTPROC __glewTangentPointerEXT; + +GLEW_FUN_EXPORT PFNGLCOPYTEXIMAGE1DEXTPROC __glewCopyTexImage1DEXT; +GLEW_FUN_EXPORT PFNGLCOPYTEXIMAGE2DEXTPROC __glewCopyTexImage2DEXT; +GLEW_FUN_EXPORT PFNGLCOPYTEXSUBIMAGE1DEXTPROC __glewCopyTexSubImage1DEXT; +GLEW_FUN_EXPORT PFNGLCOPYTEXSUBIMAGE2DEXTPROC __glewCopyTexSubImage2DEXT; +GLEW_FUN_EXPORT PFNGLCOPYTEXSUBIMAGE3DEXTPROC __glewCopyTexSubImage3DEXT; + +GLEW_FUN_EXPORT PFNGLCULLPARAMETERDVEXTPROC __glewCullParameterdvEXT; +GLEW_FUN_EXPORT PFNGLCULLPARAMETERFVEXTPROC __glewCullParameterfvEXT; + +GLEW_FUN_EXPORT PFNGLINSERTEVENTMARKEREXTPROC __glewInsertEventMarkerEXT; +GLEW_FUN_EXPORT PFNGLPOPGROUPMARKEREXTPROC __glewPopGroupMarkerEXT; +GLEW_FUN_EXPORT PFNGLPUSHGROUPMARKEREXTPROC __glewPushGroupMarkerEXT; + +GLEW_FUN_EXPORT PFNGLDEPTHBOUNDSEXTPROC __glewDepthBoundsEXT; + +GLEW_FUN_EXPORT PFNGLBINDMULTITEXTUREEXTPROC __glewBindMultiTextureEXT; +GLEW_FUN_EXPORT PFNGLCHECKNAMEDFRAMEBUFFERSTATUSEXTPROC __glewCheckNamedFramebufferStatusEXT; +GLEW_FUN_EXPORT PFNGLCLIENTATTRIBDEFAULTEXTPROC __glewClientAttribDefaultEXT; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDMULTITEXIMAGE1DEXTPROC __glewCompressedMultiTexImage1DEXT; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDMULTITEXIMAGE2DEXTPROC __glewCompressedMultiTexImage2DEXT; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDMULTITEXIMAGE3DEXTPROC __glewCompressedMultiTexImage3DEXT; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDMULTITEXSUBIMAGE1DEXTPROC __glewCompressedMultiTexSubImage1DEXT; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDMULTITEXSUBIMAGE2DEXTPROC __glewCompressedMultiTexSubImage2DEXT; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDMULTITEXSUBIMAGE3DEXTPROC __glewCompressedMultiTexSubImage3DEXT; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXTUREIMAGE1DEXTPROC __glewCompressedTextureImage1DEXT; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXTUREIMAGE2DEXTPROC __glewCompressedTextureImage2DEXT; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXTUREIMAGE3DEXTPROC __glewCompressedTextureImage3DEXT; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXTURESUBIMAGE1DEXTPROC __glewCompressedTextureSubImage1DEXT; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXTURESUBIMAGE2DEXTPROC __glewCompressedTextureSubImage2DEXT; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXTURESUBIMAGE3DEXTPROC __glewCompressedTextureSubImage3DEXT; +GLEW_FUN_EXPORT PFNGLCOPYMULTITEXIMAGE1DEXTPROC __glewCopyMultiTexImage1DEXT; +GLEW_FUN_EXPORT PFNGLCOPYMULTITEXIMAGE2DEXTPROC __glewCopyMultiTexImage2DEXT; +GLEW_FUN_EXPORT PFNGLCOPYMULTITEXSUBIMAGE1DEXTPROC __glewCopyMultiTexSubImage1DEXT; +GLEW_FUN_EXPORT PFNGLCOPYMULTITEXSUBIMAGE2DEXTPROC __glewCopyMultiTexSubImage2DEXT; +GLEW_FUN_EXPORT PFNGLCOPYMULTITEXSUBIMAGE3DEXTPROC __glewCopyMultiTexSubImage3DEXT; +GLEW_FUN_EXPORT PFNGLCOPYTEXTUREIMAGE1DEXTPROC __glewCopyTextureImage1DEXT; +GLEW_FUN_EXPORT PFNGLCOPYTEXTUREIMAGE2DEXTPROC __glewCopyTextureImage2DEXT; +GLEW_FUN_EXPORT PFNGLCOPYTEXTURESUBIMAGE1DEXTPROC __glewCopyTextureSubImage1DEXT; +GLEW_FUN_EXPORT PFNGLCOPYTEXTURESUBIMAGE2DEXTPROC __glewCopyTextureSubImage2DEXT; +GLEW_FUN_EXPORT PFNGLCOPYTEXTURESUBIMAGE3DEXTPROC __glewCopyTextureSubImage3DEXT; +GLEW_FUN_EXPORT PFNGLDISABLECLIENTSTATEINDEXEDEXTPROC __glewDisableClientStateIndexedEXT; +GLEW_FUN_EXPORT PFNGLDISABLECLIENTSTATEIEXTPROC __glewDisableClientStateiEXT; +GLEW_FUN_EXPORT PFNGLDISABLEVERTEXARRAYATTRIBEXTPROC __glewDisableVertexArrayAttribEXT; +GLEW_FUN_EXPORT PFNGLDISABLEVERTEXARRAYEXTPROC __glewDisableVertexArrayEXT; +GLEW_FUN_EXPORT PFNGLENABLECLIENTSTATEINDEXEDEXTPROC __glewEnableClientStateIndexedEXT; +GLEW_FUN_EXPORT PFNGLENABLECLIENTSTATEIEXTPROC __glewEnableClientStateiEXT; +GLEW_FUN_EXPORT PFNGLENABLEVERTEXARRAYATTRIBEXTPROC __glewEnableVertexArrayAttribEXT; +GLEW_FUN_EXPORT PFNGLENABLEVERTEXARRAYEXTPROC __glewEnableVertexArrayEXT; +GLEW_FUN_EXPORT PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEEXTPROC __glewFlushMappedNamedBufferRangeEXT; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERDRAWBUFFEREXTPROC __glewFramebufferDrawBufferEXT; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERDRAWBUFFERSEXTPROC __glewFramebufferDrawBuffersEXT; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERREADBUFFEREXTPROC __glewFramebufferReadBufferEXT; +GLEW_FUN_EXPORT PFNGLGENERATEMULTITEXMIPMAPEXTPROC __glewGenerateMultiTexMipmapEXT; +GLEW_FUN_EXPORT PFNGLGENERATETEXTUREMIPMAPEXTPROC __glewGenerateTextureMipmapEXT; +GLEW_FUN_EXPORT PFNGLGETCOMPRESSEDMULTITEXIMAGEEXTPROC __glewGetCompressedMultiTexImageEXT; +GLEW_FUN_EXPORT PFNGLGETCOMPRESSEDTEXTUREIMAGEEXTPROC __glewGetCompressedTextureImageEXT; +GLEW_FUN_EXPORT PFNGLGETDOUBLEINDEXEDVEXTPROC __glewGetDoubleIndexedvEXT; +GLEW_FUN_EXPORT PFNGLGETDOUBLEI_VEXTPROC __glewGetDoublei_vEXT; +GLEW_FUN_EXPORT PFNGLGETFLOATINDEXEDVEXTPROC __glewGetFloatIndexedvEXT; +GLEW_FUN_EXPORT PFNGLGETFLOATI_VEXTPROC __glewGetFloati_vEXT; +GLEW_FUN_EXPORT PFNGLGETFRAMEBUFFERPARAMETERIVEXTPROC __glewGetFramebufferParameterivEXT; +GLEW_FUN_EXPORT PFNGLGETMULTITEXENVFVEXTPROC __glewGetMultiTexEnvfvEXT; +GLEW_FUN_EXPORT PFNGLGETMULTITEXENVIVEXTPROC __glewGetMultiTexEnvivEXT; +GLEW_FUN_EXPORT PFNGLGETMULTITEXGENDVEXTPROC __glewGetMultiTexGendvEXT; +GLEW_FUN_EXPORT PFNGLGETMULTITEXGENFVEXTPROC __glewGetMultiTexGenfvEXT; +GLEW_FUN_EXPORT PFNGLGETMULTITEXGENIVEXTPROC __glewGetMultiTexGenivEXT; +GLEW_FUN_EXPORT PFNGLGETMULTITEXIMAGEEXTPROC __glewGetMultiTexImageEXT; +GLEW_FUN_EXPORT PFNGLGETMULTITEXLEVELPARAMETERFVEXTPROC __glewGetMultiTexLevelParameterfvEXT; +GLEW_FUN_EXPORT PFNGLGETMULTITEXLEVELPARAMETERIVEXTPROC __glewGetMultiTexLevelParameterivEXT; +GLEW_FUN_EXPORT PFNGLGETMULTITEXPARAMETERIIVEXTPROC __glewGetMultiTexParameterIivEXT; +GLEW_FUN_EXPORT PFNGLGETMULTITEXPARAMETERIUIVEXTPROC __glewGetMultiTexParameterIuivEXT; +GLEW_FUN_EXPORT PFNGLGETMULTITEXPARAMETERFVEXTPROC __glewGetMultiTexParameterfvEXT; +GLEW_FUN_EXPORT PFNGLGETMULTITEXPARAMETERIVEXTPROC __glewGetMultiTexParameterivEXT; +GLEW_FUN_EXPORT PFNGLGETNAMEDBUFFERPARAMETERIVEXTPROC __glewGetNamedBufferParameterivEXT; +GLEW_FUN_EXPORT PFNGLGETNAMEDBUFFERPOINTERVEXTPROC __glewGetNamedBufferPointervEXT; +GLEW_FUN_EXPORT PFNGLGETNAMEDBUFFERSUBDATAEXTPROC __glewGetNamedBufferSubDataEXT; +GLEW_FUN_EXPORT PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC __glewGetNamedFramebufferAttachmentParameterivEXT; +GLEW_FUN_EXPORT PFNGLGETNAMEDPROGRAMLOCALPARAMETERIIVEXTPROC __glewGetNamedProgramLocalParameterIivEXT; +GLEW_FUN_EXPORT PFNGLGETNAMEDPROGRAMLOCALPARAMETERIUIVEXTPROC __glewGetNamedProgramLocalParameterIuivEXT; +GLEW_FUN_EXPORT PFNGLGETNAMEDPROGRAMLOCALPARAMETERDVEXTPROC __glewGetNamedProgramLocalParameterdvEXT; +GLEW_FUN_EXPORT PFNGLGETNAMEDPROGRAMLOCALPARAMETERFVEXTPROC __glewGetNamedProgramLocalParameterfvEXT; +GLEW_FUN_EXPORT PFNGLGETNAMEDPROGRAMSTRINGEXTPROC __glewGetNamedProgramStringEXT; +GLEW_FUN_EXPORT PFNGLGETNAMEDPROGRAMIVEXTPROC __glewGetNamedProgramivEXT; +GLEW_FUN_EXPORT PFNGLGETNAMEDRENDERBUFFERPARAMETERIVEXTPROC __glewGetNamedRenderbufferParameterivEXT; +GLEW_FUN_EXPORT PFNGLGETPOINTERINDEXEDVEXTPROC __glewGetPointerIndexedvEXT; +GLEW_FUN_EXPORT PFNGLGETPOINTERI_VEXTPROC __glewGetPointeri_vEXT; +GLEW_FUN_EXPORT PFNGLGETTEXTUREIMAGEEXTPROC __glewGetTextureImageEXT; +GLEW_FUN_EXPORT PFNGLGETTEXTURELEVELPARAMETERFVEXTPROC __glewGetTextureLevelParameterfvEXT; +GLEW_FUN_EXPORT PFNGLGETTEXTURELEVELPARAMETERIVEXTPROC __glewGetTextureLevelParameterivEXT; +GLEW_FUN_EXPORT PFNGLGETTEXTUREPARAMETERIIVEXTPROC __glewGetTextureParameterIivEXT; +GLEW_FUN_EXPORT PFNGLGETTEXTUREPARAMETERIUIVEXTPROC __glewGetTextureParameterIuivEXT; +GLEW_FUN_EXPORT PFNGLGETTEXTUREPARAMETERFVEXTPROC __glewGetTextureParameterfvEXT; +GLEW_FUN_EXPORT PFNGLGETTEXTUREPARAMETERIVEXTPROC __glewGetTextureParameterivEXT; +GLEW_FUN_EXPORT PFNGLGETVERTEXARRAYINTEGERI_VEXTPROC __glewGetVertexArrayIntegeri_vEXT; +GLEW_FUN_EXPORT PFNGLGETVERTEXARRAYINTEGERVEXTPROC __glewGetVertexArrayIntegervEXT; +GLEW_FUN_EXPORT PFNGLGETVERTEXARRAYPOINTERI_VEXTPROC __glewGetVertexArrayPointeri_vEXT; +GLEW_FUN_EXPORT PFNGLGETVERTEXARRAYPOINTERVEXTPROC __glewGetVertexArrayPointervEXT; +GLEW_FUN_EXPORT PFNGLMAPNAMEDBUFFEREXTPROC __glewMapNamedBufferEXT; +GLEW_FUN_EXPORT PFNGLMAPNAMEDBUFFERRANGEEXTPROC __glewMapNamedBufferRangeEXT; +GLEW_FUN_EXPORT PFNGLMATRIXFRUSTUMEXTPROC __glewMatrixFrustumEXT; +GLEW_FUN_EXPORT PFNGLMATRIXLOADIDENTITYEXTPROC __glewMatrixLoadIdentityEXT; +GLEW_FUN_EXPORT PFNGLMATRIXLOADTRANSPOSEDEXTPROC __glewMatrixLoadTransposedEXT; +GLEW_FUN_EXPORT PFNGLMATRIXLOADTRANSPOSEFEXTPROC __glewMatrixLoadTransposefEXT; +GLEW_FUN_EXPORT PFNGLMATRIXLOADDEXTPROC __glewMatrixLoaddEXT; +GLEW_FUN_EXPORT PFNGLMATRIXLOADFEXTPROC __glewMatrixLoadfEXT; +GLEW_FUN_EXPORT PFNGLMATRIXMULTTRANSPOSEDEXTPROC __glewMatrixMultTransposedEXT; +GLEW_FUN_EXPORT PFNGLMATRIXMULTTRANSPOSEFEXTPROC __glewMatrixMultTransposefEXT; +GLEW_FUN_EXPORT PFNGLMATRIXMULTDEXTPROC __glewMatrixMultdEXT; +GLEW_FUN_EXPORT PFNGLMATRIXMULTFEXTPROC __glewMatrixMultfEXT; +GLEW_FUN_EXPORT PFNGLMATRIXORTHOEXTPROC __glewMatrixOrthoEXT; +GLEW_FUN_EXPORT PFNGLMATRIXPOPEXTPROC __glewMatrixPopEXT; +GLEW_FUN_EXPORT PFNGLMATRIXPUSHEXTPROC __glewMatrixPushEXT; +GLEW_FUN_EXPORT PFNGLMATRIXROTATEDEXTPROC __glewMatrixRotatedEXT; +GLEW_FUN_EXPORT PFNGLMATRIXROTATEFEXTPROC __glewMatrixRotatefEXT; +GLEW_FUN_EXPORT PFNGLMATRIXSCALEDEXTPROC __glewMatrixScaledEXT; +GLEW_FUN_EXPORT PFNGLMATRIXSCALEFEXTPROC __glewMatrixScalefEXT; +GLEW_FUN_EXPORT PFNGLMATRIXTRANSLATEDEXTPROC __glewMatrixTranslatedEXT; +GLEW_FUN_EXPORT PFNGLMATRIXTRANSLATEFEXTPROC __glewMatrixTranslatefEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXBUFFEREXTPROC __glewMultiTexBufferEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORDPOINTEREXTPROC __glewMultiTexCoordPointerEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXENVFEXTPROC __glewMultiTexEnvfEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXENVFVEXTPROC __glewMultiTexEnvfvEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXENVIEXTPROC __glewMultiTexEnviEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXENVIVEXTPROC __glewMultiTexEnvivEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXGENDEXTPROC __glewMultiTexGendEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXGENDVEXTPROC __glewMultiTexGendvEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXGENFEXTPROC __glewMultiTexGenfEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXGENFVEXTPROC __glewMultiTexGenfvEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXGENIEXTPROC __glewMultiTexGeniEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXGENIVEXTPROC __glewMultiTexGenivEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXIMAGE1DEXTPROC __glewMultiTexImage1DEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXIMAGE2DEXTPROC __glewMultiTexImage2DEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXIMAGE3DEXTPROC __glewMultiTexImage3DEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXPARAMETERIIVEXTPROC __glewMultiTexParameterIivEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXPARAMETERIUIVEXTPROC __glewMultiTexParameterIuivEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXPARAMETERFEXTPROC __glewMultiTexParameterfEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXPARAMETERFVEXTPROC __glewMultiTexParameterfvEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXPARAMETERIEXTPROC __glewMultiTexParameteriEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXPARAMETERIVEXTPROC __glewMultiTexParameterivEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXRENDERBUFFEREXTPROC __glewMultiTexRenderbufferEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXSUBIMAGE1DEXTPROC __glewMultiTexSubImage1DEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXSUBIMAGE2DEXTPROC __glewMultiTexSubImage2DEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXSUBIMAGE3DEXTPROC __glewMultiTexSubImage3DEXT; +GLEW_FUN_EXPORT PFNGLNAMEDBUFFERDATAEXTPROC __glewNamedBufferDataEXT; +GLEW_FUN_EXPORT PFNGLNAMEDBUFFERSUBDATAEXTPROC __glewNamedBufferSubDataEXT; +GLEW_FUN_EXPORT PFNGLNAMEDCOPYBUFFERSUBDATAEXTPROC __glewNamedCopyBufferSubDataEXT; +GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERRENDERBUFFEREXTPROC __glewNamedFramebufferRenderbufferEXT; +GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERTEXTURE1DEXTPROC __glewNamedFramebufferTexture1DEXT; +GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERTEXTURE2DEXTPROC __glewNamedFramebufferTexture2DEXT; +GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERTEXTURE3DEXTPROC __glewNamedFramebufferTexture3DEXT; +GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERTEXTUREEXTPROC __glewNamedFramebufferTextureEXT; +GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERTEXTUREFACEEXTPROC __glewNamedFramebufferTextureFaceEXT; +GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERTEXTURELAYEREXTPROC __glewNamedFramebufferTextureLayerEXT; +GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETER4DEXTPROC __glewNamedProgramLocalParameter4dEXT; +GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETER4DVEXTPROC __glewNamedProgramLocalParameter4dvEXT; +GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETER4FEXTPROC __glewNamedProgramLocalParameter4fEXT; +GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETER4FVEXTPROC __glewNamedProgramLocalParameter4fvEXT; +GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETERI4IEXTPROC __glewNamedProgramLocalParameterI4iEXT; +GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETERI4IVEXTPROC __glewNamedProgramLocalParameterI4ivEXT; +GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIEXTPROC __glewNamedProgramLocalParameterI4uiEXT; +GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIVEXTPROC __glewNamedProgramLocalParameterI4uivEXT; +GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETERS4FVEXTPROC __glewNamedProgramLocalParameters4fvEXT; +GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETERSI4IVEXTPROC __glewNamedProgramLocalParametersI4ivEXT; +GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETERSI4UIVEXTPROC __glewNamedProgramLocalParametersI4uivEXT; +GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMSTRINGEXTPROC __glewNamedProgramStringEXT; +GLEW_FUN_EXPORT PFNGLNAMEDRENDERBUFFERSTORAGEEXTPROC __glewNamedRenderbufferStorageEXT; +GLEW_FUN_EXPORT PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLECOVERAGEEXTPROC __glewNamedRenderbufferStorageMultisampleCoverageEXT; +GLEW_FUN_EXPORT PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC __glewNamedRenderbufferStorageMultisampleEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1FEXTPROC __glewProgramUniform1fEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1FVEXTPROC __glewProgramUniform1fvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1IEXTPROC __glewProgramUniform1iEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1IVEXTPROC __glewProgramUniform1ivEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1UIEXTPROC __glewProgramUniform1uiEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1UIVEXTPROC __glewProgramUniform1uivEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2FEXTPROC __glewProgramUniform2fEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2FVEXTPROC __glewProgramUniform2fvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2IEXTPROC __glewProgramUniform2iEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2IVEXTPROC __glewProgramUniform2ivEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2UIEXTPROC __glewProgramUniform2uiEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2UIVEXTPROC __glewProgramUniform2uivEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3FEXTPROC __glewProgramUniform3fEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3FVEXTPROC __glewProgramUniform3fvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3IEXTPROC __glewProgramUniform3iEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3IVEXTPROC __glewProgramUniform3ivEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3UIEXTPROC __glewProgramUniform3uiEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3UIVEXTPROC __glewProgramUniform3uivEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4FEXTPROC __glewProgramUniform4fEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4FVEXTPROC __glewProgramUniform4fvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4IEXTPROC __glewProgramUniform4iEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4IVEXTPROC __glewProgramUniform4ivEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4UIEXTPROC __glewProgramUniform4uiEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4UIVEXTPROC __glewProgramUniform4uivEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC __glewProgramUniformMatrix2fvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2X3FVEXTPROC __glewProgramUniformMatrix2x3fvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2X4FVEXTPROC __glewProgramUniformMatrix2x4fvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC __glewProgramUniformMatrix3fvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3X2FVEXTPROC __glewProgramUniformMatrix3x2fvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3X4FVEXTPROC __glewProgramUniformMatrix3x4fvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC __glewProgramUniformMatrix4fvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4X2FVEXTPROC __glewProgramUniformMatrix4x2fvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4X3FVEXTPROC __glewProgramUniformMatrix4x3fvEXT; +GLEW_FUN_EXPORT PFNGLPUSHCLIENTATTRIBDEFAULTEXTPROC __glewPushClientAttribDefaultEXT; +GLEW_FUN_EXPORT PFNGLTEXTUREBUFFEREXTPROC __glewTextureBufferEXT; +GLEW_FUN_EXPORT PFNGLTEXTUREIMAGE1DEXTPROC __glewTextureImage1DEXT; +GLEW_FUN_EXPORT PFNGLTEXTUREIMAGE2DEXTPROC __glewTextureImage2DEXT; +GLEW_FUN_EXPORT PFNGLTEXTUREIMAGE3DEXTPROC __glewTextureImage3DEXT; +GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERIIVEXTPROC __glewTextureParameterIivEXT; +GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERIUIVEXTPROC __glewTextureParameterIuivEXT; +GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERFEXTPROC __glewTextureParameterfEXT; +GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERFVEXTPROC __glewTextureParameterfvEXT; +GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERIEXTPROC __glewTextureParameteriEXT; +GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERIVEXTPROC __glewTextureParameterivEXT; +GLEW_FUN_EXPORT PFNGLTEXTURERENDERBUFFEREXTPROC __glewTextureRenderbufferEXT; +GLEW_FUN_EXPORT PFNGLTEXTURESUBIMAGE1DEXTPROC __glewTextureSubImage1DEXT; +GLEW_FUN_EXPORT PFNGLTEXTURESUBIMAGE2DEXTPROC __glewTextureSubImage2DEXT; +GLEW_FUN_EXPORT PFNGLTEXTURESUBIMAGE3DEXTPROC __glewTextureSubImage3DEXT; +GLEW_FUN_EXPORT PFNGLUNMAPNAMEDBUFFEREXTPROC __glewUnmapNamedBufferEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYCOLOROFFSETEXTPROC __glewVertexArrayColorOffsetEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYEDGEFLAGOFFSETEXTPROC __glewVertexArrayEdgeFlagOffsetEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYFOGCOORDOFFSETEXTPROC __glewVertexArrayFogCoordOffsetEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYINDEXOFFSETEXTPROC __glewVertexArrayIndexOffsetEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYMULTITEXCOORDOFFSETEXTPROC __glewVertexArrayMultiTexCoordOffsetEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYNORMALOFFSETEXTPROC __glewVertexArrayNormalOffsetEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYSECONDARYCOLOROFFSETEXTPROC __glewVertexArraySecondaryColorOffsetEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYTEXCOORDOFFSETEXTPROC __glewVertexArrayTexCoordOffsetEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYVERTEXATTRIBIOFFSETEXTPROC __glewVertexArrayVertexAttribIOffsetEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYVERTEXATTRIBOFFSETEXTPROC __glewVertexArrayVertexAttribOffsetEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYVERTEXOFFSETEXTPROC __glewVertexArrayVertexOffsetEXT; + +GLEW_FUN_EXPORT PFNGLCOLORMASKINDEXEDEXTPROC __glewColorMaskIndexedEXT; +GLEW_FUN_EXPORT PFNGLDISABLEINDEXEDEXTPROC __glewDisableIndexedEXT; +GLEW_FUN_EXPORT PFNGLENABLEINDEXEDEXTPROC __glewEnableIndexedEXT; +GLEW_FUN_EXPORT PFNGLGETBOOLEANINDEXEDVEXTPROC __glewGetBooleanIndexedvEXT; +GLEW_FUN_EXPORT PFNGLGETINTEGERINDEXEDVEXTPROC __glewGetIntegerIndexedvEXT; +GLEW_FUN_EXPORT PFNGLISENABLEDINDEXEDEXTPROC __glewIsEnabledIndexedEXT; + +GLEW_FUN_EXPORT PFNGLDRAWARRAYSINSTANCEDEXTPROC __glewDrawArraysInstancedEXT; +GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDEXTPROC __glewDrawElementsInstancedEXT; + +GLEW_FUN_EXPORT PFNGLDRAWRANGEELEMENTSEXTPROC __glewDrawRangeElementsEXT; + +GLEW_FUN_EXPORT PFNGLFOGCOORDPOINTEREXTPROC __glewFogCoordPointerEXT; +GLEW_FUN_EXPORT PFNGLFOGCOORDDEXTPROC __glewFogCoorddEXT; +GLEW_FUN_EXPORT PFNGLFOGCOORDDVEXTPROC __glewFogCoorddvEXT; +GLEW_FUN_EXPORT PFNGLFOGCOORDFEXTPROC __glewFogCoordfEXT; +GLEW_FUN_EXPORT PFNGLFOGCOORDFVEXTPROC __glewFogCoordfvEXT; + +GLEW_FUN_EXPORT PFNGLFRAGMENTCOLORMATERIALEXTPROC __glewFragmentColorMaterialEXT; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELFEXTPROC __glewFragmentLightModelfEXT; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELFVEXTPROC __glewFragmentLightModelfvEXT; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELIEXTPROC __glewFragmentLightModeliEXT; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELIVEXTPROC __glewFragmentLightModelivEXT; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTFEXTPROC __glewFragmentLightfEXT; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTFVEXTPROC __glewFragmentLightfvEXT; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTIEXTPROC __glewFragmentLightiEXT; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTIVEXTPROC __glewFragmentLightivEXT; +GLEW_FUN_EXPORT PFNGLFRAGMENTMATERIALFEXTPROC __glewFragmentMaterialfEXT; +GLEW_FUN_EXPORT PFNGLFRAGMENTMATERIALFVEXTPROC __glewFragmentMaterialfvEXT; +GLEW_FUN_EXPORT PFNGLFRAGMENTMATERIALIEXTPROC __glewFragmentMaterialiEXT; +GLEW_FUN_EXPORT PFNGLFRAGMENTMATERIALIVEXTPROC __glewFragmentMaterialivEXT; +GLEW_FUN_EXPORT PFNGLGETFRAGMENTLIGHTFVEXTPROC __glewGetFragmentLightfvEXT; +GLEW_FUN_EXPORT PFNGLGETFRAGMENTLIGHTIVEXTPROC __glewGetFragmentLightivEXT; +GLEW_FUN_EXPORT PFNGLGETFRAGMENTMATERIALFVEXTPROC __glewGetFragmentMaterialfvEXT; +GLEW_FUN_EXPORT PFNGLGETFRAGMENTMATERIALIVEXTPROC __glewGetFragmentMaterialivEXT; +GLEW_FUN_EXPORT PFNGLLIGHTENVIEXTPROC __glewLightEnviEXT; + +GLEW_FUN_EXPORT PFNGLBLITFRAMEBUFFEREXTPROC __glewBlitFramebufferEXT; + +GLEW_FUN_EXPORT PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC __glewRenderbufferStorageMultisampleEXT; + +GLEW_FUN_EXPORT PFNGLBINDFRAMEBUFFEREXTPROC __glewBindFramebufferEXT; +GLEW_FUN_EXPORT PFNGLBINDRENDERBUFFEREXTPROC __glewBindRenderbufferEXT; +GLEW_FUN_EXPORT PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC __glewCheckFramebufferStatusEXT; +GLEW_FUN_EXPORT PFNGLDELETEFRAMEBUFFERSEXTPROC __glewDeleteFramebuffersEXT; +GLEW_FUN_EXPORT PFNGLDELETERENDERBUFFERSEXTPROC __glewDeleteRenderbuffersEXT; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC __glewFramebufferRenderbufferEXT; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURE1DEXTPROC __glewFramebufferTexture1DEXT; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURE2DEXTPROC __glewFramebufferTexture2DEXT; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURE3DEXTPROC __glewFramebufferTexture3DEXT; +GLEW_FUN_EXPORT PFNGLGENFRAMEBUFFERSEXTPROC __glewGenFramebuffersEXT; +GLEW_FUN_EXPORT PFNGLGENRENDERBUFFERSEXTPROC __glewGenRenderbuffersEXT; +GLEW_FUN_EXPORT PFNGLGENERATEMIPMAPEXTPROC __glewGenerateMipmapEXT; +GLEW_FUN_EXPORT PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC __glewGetFramebufferAttachmentParameterivEXT; +GLEW_FUN_EXPORT PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC __glewGetRenderbufferParameterivEXT; +GLEW_FUN_EXPORT PFNGLISFRAMEBUFFEREXTPROC __glewIsFramebufferEXT; +GLEW_FUN_EXPORT PFNGLISRENDERBUFFEREXTPROC __glewIsRenderbufferEXT; +GLEW_FUN_EXPORT PFNGLRENDERBUFFERSTORAGEEXTPROC __glewRenderbufferStorageEXT; + +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTUREEXTPROC __glewFramebufferTextureEXT; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTUREFACEEXTPROC __glewFramebufferTextureFaceEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETERIEXTPROC __glewProgramParameteriEXT; + +GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETERS4FVEXTPROC __glewProgramEnvParameters4fvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETERS4FVEXTPROC __glewProgramLocalParameters4fvEXT; + +GLEW_FUN_EXPORT PFNGLBINDFRAGDATALOCATIONEXTPROC __glewBindFragDataLocationEXT; +GLEW_FUN_EXPORT PFNGLGETFRAGDATALOCATIONEXTPROC __glewGetFragDataLocationEXT; +GLEW_FUN_EXPORT PFNGLGETUNIFORMUIVEXTPROC __glewGetUniformuivEXT; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBIIVEXTPROC __glewGetVertexAttribIivEXT; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBIUIVEXTPROC __glewGetVertexAttribIuivEXT; +GLEW_FUN_EXPORT PFNGLUNIFORM1UIEXTPROC __glewUniform1uiEXT; +GLEW_FUN_EXPORT PFNGLUNIFORM1UIVEXTPROC __glewUniform1uivEXT; +GLEW_FUN_EXPORT PFNGLUNIFORM2UIEXTPROC __glewUniform2uiEXT; +GLEW_FUN_EXPORT PFNGLUNIFORM2UIVEXTPROC __glewUniform2uivEXT; +GLEW_FUN_EXPORT PFNGLUNIFORM3UIEXTPROC __glewUniform3uiEXT; +GLEW_FUN_EXPORT PFNGLUNIFORM3UIVEXTPROC __glewUniform3uivEXT; +GLEW_FUN_EXPORT PFNGLUNIFORM4UIEXTPROC __glewUniform4uiEXT; +GLEW_FUN_EXPORT PFNGLUNIFORM4UIVEXTPROC __glewUniform4uivEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI1IEXTPROC __glewVertexAttribI1iEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI1IVEXTPROC __glewVertexAttribI1ivEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI1UIEXTPROC __glewVertexAttribI1uiEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI1UIVEXTPROC __glewVertexAttribI1uivEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI2IEXTPROC __glewVertexAttribI2iEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI2IVEXTPROC __glewVertexAttribI2ivEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI2UIEXTPROC __glewVertexAttribI2uiEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI2UIVEXTPROC __glewVertexAttribI2uivEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI3IEXTPROC __glewVertexAttribI3iEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI3IVEXTPROC __glewVertexAttribI3ivEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI3UIEXTPROC __glewVertexAttribI3uiEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI3UIVEXTPROC __glewVertexAttribI3uivEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4BVEXTPROC __glewVertexAttribI4bvEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4IEXTPROC __glewVertexAttribI4iEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4IVEXTPROC __glewVertexAttribI4ivEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4SVEXTPROC __glewVertexAttribI4svEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4UBVEXTPROC __glewVertexAttribI4ubvEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4UIEXTPROC __glewVertexAttribI4uiEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4UIVEXTPROC __glewVertexAttribI4uivEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4USVEXTPROC __glewVertexAttribI4usvEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBIPOINTEREXTPROC __glewVertexAttribIPointerEXT; + +GLEW_FUN_EXPORT PFNGLGETHISTOGRAMEXTPROC __glewGetHistogramEXT; +GLEW_FUN_EXPORT PFNGLGETHISTOGRAMPARAMETERFVEXTPROC __glewGetHistogramParameterfvEXT; +GLEW_FUN_EXPORT PFNGLGETHISTOGRAMPARAMETERIVEXTPROC __glewGetHistogramParameterivEXT; +GLEW_FUN_EXPORT PFNGLGETMINMAXEXTPROC __glewGetMinmaxEXT; +GLEW_FUN_EXPORT PFNGLGETMINMAXPARAMETERFVEXTPROC __glewGetMinmaxParameterfvEXT; +GLEW_FUN_EXPORT PFNGLGETMINMAXPARAMETERIVEXTPROC __glewGetMinmaxParameterivEXT; +GLEW_FUN_EXPORT PFNGLHISTOGRAMEXTPROC __glewHistogramEXT; +GLEW_FUN_EXPORT PFNGLMINMAXEXTPROC __glewMinmaxEXT; +GLEW_FUN_EXPORT PFNGLRESETHISTOGRAMEXTPROC __glewResetHistogramEXT; +GLEW_FUN_EXPORT PFNGLRESETMINMAXEXTPROC __glewResetMinmaxEXT; + +GLEW_FUN_EXPORT PFNGLINDEXFUNCEXTPROC __glewIndexFuncEXT; + +GLEW_FUN_EXPORT PFNGLINDEXMATERIALEXTPROC __glewIndexMaterialEXT; + +GLEW_FUN_EXPORT PFNGLAPPLYTEXTUREEXTPROC __glewApplyTextureEXT; +GLEW_FUN_EXPORT PFNGLTEXTURELIGHTEXTPROC __glewTextureLightEXT; +GLEW_FUN_EXPORT PFNGLTEXTUREMATERIALEXTPROC __glewTextureMaterialEXT; + +GLEW_FUN_EXPORT PFNGLMULTIDRAWARRAYSEXTPROC __glewMultiDrawArraysEXT; +GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTSEXTPROC __glewMultiDrawElementsEXT; + +GLEW_FUN_EXPORT PFNGLSAMPLEMASKEXTPROC __glewSampleMaskEXT; +GLEW_FUN_EXPORT PFNGLSAMPLEPATTERNEXTPROC __glewSamplePatternEXT; + +GLEW_FUN_EXPORT PFNGLCOLORTABLEEXTPROC __glewColorTableEXT; +GLEW_FUN_EXPORT PFNGLGETCOLORTABLEEXTPROC __glewGetColorTableEXT; +GLEW_FUN_EXPORT PFNGLGETCOLORTABLEPARAMETERFVEXTPROC __glewGetColorTableParameterfvEXT; +GLEW_FUN_EXPORT PFNGLGETCOLORTABLEPARAMETERIVEXTPROC __glewGetColorTableParameterivEXT; + +GLEW_FUN_EXPORT PFNGLGETPIXELTRANSFORMPARAMETERFVEXTPROC __glewGetPixelTransformParameterfvEXT; +GLEW_FUN_EXPORT PFNGLGETPIXELTRANSFORMPARAMETERIVEXTPROC __glewGetPixelTransformParameterivEXT; +GLEW_FUN_EXPORT PFNGLPIXELTRANSFORMPARAMETERFEXTPROC __glewPixelTransformParameterfEXT; +GLEW_FUN_EXPORT PFNGLPIXELTRANSFORMPARAMETERFVEXTPROC __glewPixelTransformParameterfvEXT; +GLEW_FUN_EXPORT PFNGLPIXELTRANSFORMPARAMETERIEXTPROC __glewPixelTransformParameteriEXT; +GLEW_FUN_EXPORT PFNGLPIXELTRANSFORMPARAMETERIVEXTPROC __glewPixelTransformParameterivEXT; + +GLEW_FUN_EXPORT PFNGLPOINTPARAMETERFEXTPROC __glewPointParameterfEXT; +GLEW_FUN_EXPORT PFNGLPOINTPARAMETERFVEXTPROC __glewPointParameterfvEXT; + +GLEW_FUN_EXPORT PFNGLPOLYGONOFFSETEXTPROC __glewPolygonOffsetEXT; + +GLEW_FUN_EXPORT PFNGLPROVOKINGVERTEXEXTPROC __glewProvokingVertexEXT; + +GLEW_FUN_EXPORT PFNGLBEGINSCENEEXTPROC __glewBeginSceneEXT; +GLEW_FUN_EXPORT PFNGLENDSCENEEXTPROC __glewEndSceneEXT; + +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3BEXTPROC __glewSecondaryColor3bEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3BVEXTPROC __glewSecondaryColor3bvEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3DEXTPROC __glewSecondaryColor3dEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3DVEXTPROC __glewSecondaryColor3dvEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3FEXTPROC __glewSecondaryColor3fEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3FVEXTPROC __glewSecondaryColor3fvEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3IEXTPROC __glewSecondaryColor3iEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3IVEXTPROC __glewSecondaryColor3ivEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3SEXTPROC __glewSecondaryColor3sEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3SVEXTPROC __glewSecondaryColor3svEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UBEXTPROC __glewSecondaryColor3ubEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UBVEXTPROC __glewSecondaryColor3ubvEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UIEXTPROC __glewSecondaryColor3uiEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UIVEXTPROC __glewSecondaryColor3uivEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3USEXTPROC __glewSecondaryColor3usEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3USVEXTPROC __glewSecondaryColor3usvEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLORPOINTEREXTPROC __glewSecondaryColorPointerEXT; + +GLEW_FUN_EXPORT PFNGLACTIVEPROGRAMEXTPROC __glewActiveProgramEXT; +GLEW_FUN_EXPORT PFNGLCREATESHADERPROGRAMEXTPROC __glewCreateShaderProgramEXT; +GLEW_FUN_EXPORT PFNGLUSESHADERPROGRAMEXTPROC __glewUseShaderProgramEXT; + +GLEW_FUN_EXPORT PFNGLBINDIMAGETEXTUREEXTPROC __glewBindImageTextureEXT; +GLEW_FUN_EXPORT PFNGLMEMORYBARRIEREXTPROC __glewMemoryBarrierEXT; + +GLEW_FUN_EXPORT PFNGLACTIVESTENCILFACEEXTPROC __glewActiveStencilFaceEXT; + +GLEW_FUN_EXPORT PFNGLTEXSUBIMAGE1DEXTPROC __glewTexSubImage1DEXT; +GLEW_FUN_EXPORT PFNGLTEXSUBIMAGE2DEXTPROC __glewTexSubImage2DEXT; +GLEW_FUN_EXPORT PFNGLTEXSUBIMAGE3DEXTPROC __glewTexSubImage3DEXT; + +GLEW_FUN_EXPORT PFNGLTEXIMAGE3DEXTPROC __glewTexImage3DEXT; + +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC __glewFramebufferTextureLayerEXT; + +GLEW_FUN_EXPORT PFNGLTEXBUFFEREXTPROC __glewTexBufferEXT; + +GLEW_FUN_EXPORT PFNGLCLEARCOLORIIEXTPROC __glewClearColorIiEXT; +GLEW_FUN_EXPORT PFNGLCLEARCOLORIUIEXTPROC __glewClearColorIuiEXT; +GLEW_FUN_EXPORT PFNGLGETTEXPARAMETERIIVEXTPROC __glewGetTexParameterIivEXT; +GLEW_FUN_EXPORT PFNGLGETTEXPARAMETERIUIVEXTPROC __glewGetTexParameterIuivEXT; +GLEW_FUN_EXPORT PFNGLTEXPARAMETERIIVEXTPROC __glewTexParameterIivEXT; +GLEW_FUN_EXPORT PFNGLTEXPARAMETERIUIVEXTPROC __glewTexParameterIuivEXT; + +GLEW_FUN_EXPORT PFNGLARETEXTURESRESIDENTEXTPROC __glewAreTexturesResidentEXT; +GLEW_FUN_EXPORT PFNGLBINDTEXTUREEXTPROC __glewBindTextureEXT; +GLEW_FUN_EXPORT PFNGLDELETETEXTURESEXTPROC __glewDeleteTexturesEXT; +GLEW_FUN_EXPORT PFNGLGENTEXTURESEXTPROC __glewGenTexturesEXT; +GLEW_FUN_EXPORT PFNGLISTEXTUREEXTPROC __glewIsTextureEXT; +GLEW_FUN_EXPORT PFNGLPRIORITIZETEXTURESEXTPROC __glewPrioritizeTexturesEXT; + +GLEW_FUN_EXPORT PFNGLTEXTURENORMALEXTPROC __glewTextureNormalEXT; + +GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTI64VEXTPROC __glewGetQueryObjecti64vEXT; +GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTUI64VEXTPROC __glewGetQueryObjectui64vEXT; + +GLEW_FUN_EXPORT PFNGLBEGINTRANSFORMFEEDBACKEXTPROC __glewBeginTransformFeedbackEXT; +GLEW_FUN_EXPORT PFNGLBINDBUFFERBASEEXTPROC __glewBindBufferBaseEXT; +GLEW_FUN_EXPORT PFNGLBINDBUFFEROFFSETEXTPROC __glewBindBufferOffsetEXT; +GLEW_FUN_EXPORT PFNGLBINDBUFFERRANGEEXTPROC __glewBindBufferRangeEXT; +GLEW_FUN_EXPORT PFNGLENDTRANSFORMFEEDBACKEXTPROC __glewEndTransformFeedbackEXT; +GLEW_FUN_EXPORT PFNGLGETTRANSFORMFEEDBACKVARYINGEXTPROC __glewGetTransformFeedbackVaryingEXT; +GLEW_FUN_EXPORT PFNGLTRANSFORMFEEDBACKVARYINGSEXTPROC __glewTransformFeedbackVaryingsEXT; + +GLEW_FUN_EXPORT PFNGLARRAYELEMENTEXTPROC __glewArrayElementEXT; +GLEW_FUN_EXPORT PFNGLCOLORPOINTEREXTPROC __glewColorPointerEXT; +GLEW_FUN_EXPORT PFNGLDRAWARRAYSEXTPROC __glewDrawArraysEXT; +GLEW_FUN_EXPORT PFNGLEDGEFLAGPOINTEREXTPROC __glewEdgeFlagPointerEXT; +GLEW_FUN_EXPORT PFNGLINDEXPOINTEREXTPROC __glewIndexPointerEXT; +GLEW_FUN_EXPORT PFNGLNORMALPOINTEREXTPROC __glewNormalPointerEXT; +GLEW_FUN_EXPORT PFNGLTEXCOORDPOINTEREXTPROC __glewTexCoordPointerEXT; +GLEW_FUN_EXPORT PFNGLVERTEXPOINTEREXTPROC __glewVertexPointerEXT; + +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBLDVEXTPROC __glewGetVertexAttribLdvEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYVERTEXATTRIBLOFFSETEXTPROC __glewVertexArrayVertexAttribLOffsetEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1DEXTPROC __glewVertexAttribL1dEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1DVEXTPROC __glewVertexAttribL1dvEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL2DEXTPROC __glewVertexAttribL2dEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL2DVEXTPROC __glewVertexAttribL2dvEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL3DEXTPROC __glewVertexAttribL3dEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL3DVEXTPROC __glewVertexAttribL3dvEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL4DEXTPROC __glewVertexAttribL4dEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL4DVEXTPROC __glewVertexAttribL4dvEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBLPOINTEREXTPROC __glewVertexAttribLPointerEXT; + +GLEW_FUN_EXPORT PFNGLBEGINVERTEXSHADEREXTPROC __glewBeginVertexShaderEXT; +GLEW_FUN_EXPORT PFNGLBINDLIGHTPARAMETEREXTPROC __glewBindLightParameterEXT; +GLEW_FUN_EXPORT PFNGLBINDMATERIALPARAMETEREXTPROC __glewBindMaterialParameterEXT; +GLEW_FUN_EXPORT PFNGLBINDPARAMETEREXTPROC __glewBindParameterEXT; +GLEW_FUN_EXPORT PFNGLBINDTEXGENPARAMETEREXTPROC __glewBindTexGenParameterEXT; +GLEW_FUN_EXPORT PFNGLBINDTEXTUREUNITPARAMETEREXTPROC __glewBindTextureUnitParameterEXT; +GLEW_FUN_EXPORT PFNGLBINDVERTEXSHADEREXTPROC __glewBindVertexShaderEXT; +GLEW_FUN_EXPORT PFNGLDELETEVERTEXSHADEREXTPROC __glewDeleteVertexShaderEXT; +GLEW_FUN_EXPORT PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC __glewDisableVariantClientStateEXT; +GLEW_FUN_EXPORT PFNGLENABLEVARIANTCLIENTSTATEEXTPROC __glewEnableVariantClientStateEXT; +GLEW_FUN_EXPORT PFNGLENDVERTEXSHADEREXTPROC __glewEndVertexShaderEXT; +GLEW_FUN_EXPORT PFNGLEXTRACTCOMPONENTEXTPROC __glewExtractComponentEXT; +GLEW_FUN_EXPORT PFNGLGENSYMBOLSEXTPROC __glewGenSymbolsEXT; +GLEW_FUN_EXPORT PFNGLGENVERTEXSHADERSEXTPROC __glewGenVertexShadersEXT; +GLEW_FUN_EXPORT PFNGLGETINVARIANTBOOLEANVEXTPROC __glewGetInvariantBooleanvEXT; +GLEW_FUN_EXPORT PFNGLGETINVARIANTFLOATVEXTPROC __glewGetInvariantFloatvEXT; +GLEW_FUN_EXPORT PFNGLGETINVARIANTINTEGERVEXTPROC __glewGetInvariantIntegervEXT; +GLEW_FUN_EXPORT PFNGLGETLOCALCONSTANTBOOLEANVEXTPROC __glewGetLocalConstantBooleanvEXT; +GLEW_FUN_EXPORT PFNGLGETLOCALCONSTANTFLOATVEXTPROC __glewGetLocalConstantFloatvEXT; +GLEW_FUN_EXPORT PFNGLGETLOCALCONSTANTINTEGERVEXTPROC __glewGetLocalConstantIntegervEXT; +GLEW_FUN_EXPORT PFNGLGETVARIANTBOOLEANVEXTPROC __glewGetVariantBooleanvEXT; +GLEW_FUN_EXPORT PFNGLGETVARIANTFLOATVEXTPROC __glewGetVariantFloatvEXT; +GLEW_FUN_EXPORT PFNGLGETVARIANTINTEGERVEXTPROC __glewGetVariantIntegervEXT; +GLEW_FUN_EXPORT PFNGLGETVARIANTPOINTERVEXTPROC __glewGetVariantPointervEXT; +GLEW_FUN_EXPORT PFNGLINSERTCOMPONENTEXTPROC __glewInsertComponentEXT; +GLEW_FUN_EXPORT PFNGLISVARIANTENABLEDEXTPROC __glewIsVariantEnabledEXT; +GLEW_FUN_EXPORT PFNGLSETINVARIANTEXTPROC __glewSetInvariantEXT; +GLEW_FUN_EXPORT PFNGLSETLOCALCONSTANTEXTPROC __glewSetLocalConstantEXT; +GLEW_FUN_EXPORT PFNGLSHADEROP1EXTPROC __glewShaderOp1EXT; +GLEW_FUN_EXPORT PFNGLSHADEROP2EXTPROC __glewShaderOp2EXT; +GLEW_FUN_EXPORT PFNGLSHADEROP3EXTPROC __glewShaderOp3EXT; +GLEW_FUN_EXPORT PFNGLSWIZZLEEXTPROC __glewSwizzleEXT; +GLEW_FUN_EXPORT PFNGLVARIANTPOINTEREXTPROC __glewVariantPointerEXT; +GLEW_FUN_EXPORT PFNGLVARIANTBVEXTPROC __glewVariantbvEXT; +GLEW_FUN_EXPORT PFNGLVARIANTDVEXTPROC __glewVariantdvEXT; +GLEW_FUN_EXPORT PFNGLVARIANTFVEXTPROC __glewVariantfvEXT; +GLEW_FUN_EXPORT PFNGLVARIANTIVEXTPROC __glewVariantivEXT; +GLEW_FUN_EXPORT PFNGLVARIANTSVEXTPROC __glewVariantsvEXT; +GLEW_FUN_EXPORT PFNGLVARIANTUBVEXTPROC __glewVariantubvEXT; +GLEW_FUN_EXPORT PFNGLVARIANTUIVEXTPROC __glewVariantuivEXT; +GLEW_FUN_EXPORT PFNGLVARIANTUSVEXTPROC __glewVariantusvEXT; +GLEW_FUN_EXPORT PFNGLWRITEMASKEXTPROC __glewWriteMaskEXT; + +GLEW_FUN_EXPORT PFNGLVERTEXWEIGHTPOINTEREXTPROC __glewVertexWeightPointerEXT; +GLEW_FUN_EXPORT PFNGLVERTEXWEIGHTFEXTPROC __glewVertexWeightfEXT; +GLEW_FUN_EXPORT PFNGLVERTEXWEIGHTFVEXTPROC __glewVertexWeightfvEXT; + +GLEW_FUN_EXPORT PFNGLIMPORTSYNCEXTPROC __glewImportSyncEXT; + +GLEW_FUN_EXPORT PFNGLFRAMETERMINATORGREMEDYPROC __glewFrameTerminatorGREMEDY; + +GLEW_FUN_EXPORT PFNGLSTRINGMARKERGREMEDYPROC __glewStringMarkerGREMEDY; + +GLEW_FUN_EXPORT PFNGLGETIMAGETRANSFORMPARAMETERFVHPPROC __glewGetImageTransformParameterfvHP; +GLEW_FUN_EXPORT PFNGLGETIMAGETRANSFORMPARAMETERIVHPPROC __glewGetImageTransformParameterivHP; +GLEW_FUN_EXPORT PFNGLIMAGETRANSFORMPARAMETERFHPPROC __glewImageTransformParameterfHP; +GLEW_FUN_EXPORT PFNGLIMAGETRANSFORMPARAMETERFVHPPROC __glewImageTransformParameterfvHP; +GLEW_FUN_EXPORT PFNGLIMAGETRANSFORMPARAMETERIHPPROC __glewImageTransformParameteriHP; +GLEW_FUN_EXPORT PFNGLIMAGETRANSFORMPARAMETERIVHPPROC __glewImageTransformParameterivHP; + +GLEW_FUN_EXPORT PFNGLMULTIMODEDRAWARRAYSIBMPROC __glewMultiModeDrawArraysIBM; +GLEW_FUN_EXPORT PFNGLMULTIMODEDRAWELEMENTSIBMPROC __glewMultiModeDrawElementsIBM; + +GLEW_FUN_EXPORT PFNGLCOLORPOINTERLISTIBMPROC __glewColorPointerListIBM; +GLEW_FUN_EXPORT PFNGLEDGEFLAGPOINTERLISTIBMPROC __glewEdgeFlagPointerListIBM; +GLEW_FUN_EXPORT PFNGLFOGCOORDPOINTERLISTIBMPROC __glewFogCoordPointerListIBM; +GLEW_FUN_EXPORT PFNGLINDEXPOINTERLISTIBMPROC __glewIndexPointerListIBM; +GLEW_FUN_EXPORT PFNGLNORMALPOINTERLISTIBMPROC __glewNormalPointerListIBM; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLORPOINTERLISTIBMPROC __glewSecondaryColorPointerListIBM; +GLEW_FUN_EXPORT PFNGLTEXCOORDPOINTERLISTIBMPROC __glewTexCoordPointerListIBM; +GLEW_FUN_EXPORT PFNGLVERTEXPOINTERLISTIBMPROC __glewVertexPointerListIBM; + +GLEW_FUN_EXPORT PFNGLMAPTEXTURE2DINTELPROC __glewMapTexture2DINTEL; +GLEW_FUN_EXPORT PFNGLSYNCTEXTUREINTELPROC __glewSyncTextureINTEL; +GLEW_FUN_EXPORT PFNGLUNMAPTEXTURE2DINTELPROC __glewUnmapTexture2DINTEL; + +GLEW_FUN_EXPORT PFNGLCOLORPOINTERVINTELPROC __glewColorPointervINTEL; +GLEW_FUN_EXPORT PFNGLNORMALPOINTERVINTELPROC __glewNormalPointervINTEL; +GLEW_FUN_EXPORT PFNGLTEXCOORDPOINTERVINTELPROC __glewTexCoordPointervINTEL; +GLEW_FUN_EXPORT PFNGLVERTEXPOINTERVINTELPROC __glewVertexPointervINTEL; + +GLEW_FUN_EXPORT PFNGLTEXSCISSORFUNCINTELPROC __glewTexScissorFuncINTEL; +GLEW_FUN_EXPORT PFNGLTEXSCISSORINTELPROC __glewTexScissorINTEL; + +GLEW_FUN_EXPORT PFNGLDEBUGMESSAGECALLBACKPROC __glewDebugMessageCallback; +GLEW_FUN_EXPORT PFNGLDEBUGMESSAGECONTROLPROC __glewDebugMessageControl; +GLEW_FUN_EXPORT PFNGLDEBUGMESSAGEINSERTPROC __glewDebugMessageInsert; +GLEW_FUN_EXPORT PFNGLGETDEBUGMESSAGELOGPROC __glewGetDebugMessageLog; +GLEW_FUN_EXPORT PFNGLGETOBJECTLABELPROC __glewGetObjectLabel; +GLEW_FUN_EXPORT PFNGLGETOBJECTPTRLABELPROC __glewGetObjectPtrLabel; +GLEW_FUN_EXPORT PFNGLOBJECTLABELPROC __glewObjectLabel; +GLEW_FUN_EXPORT PFNGLOBJECTPTRLABELPROC __glewObjectPtrLabel; +GLEW_FUN_EXPORT PFNGLPOPDEBUGGROUPPROC __glewPopDebugGroup; +GLEW_FUN_EXPORT PFNGLPUSHDEBUGGROUPPROC __glewPushDebugGroup; + +GLEW_FUN_EXPORT PFNGLBUFFERREGIONENABLEDPROC __glewBufferRegionEnabled; +GLEW_FUN_EXPORT PFNGLDELETEBUFFERREGIONPROC __glewDeleteBufferRegion; +GLEW_FUN_EXPORT PFNGLDRAWBUFFERREGIONPROC __glewDrawBufferRegion; +GLEW_FUN_EXPORT PFNGLNEWBUFFERREGIONPROC __glewNewBufferRegion; +GLEW_FUN_EXPORT PFNGLREADBUFFERREGIONPROC __glewReadBufferRegion; + +GLEW_FUN_EXPORT PFNGLRESIZEBUFFERSMESAPROC __glewResizeBuffersMESA; + +GLEW_FUN_EXPORT PFNGLWINDOWPOS2DMESAPROC __glewWindowPos2dMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2DVMESAPROC __glewWindowPos2dvMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2FMESAPROC __glewWindowPos2fMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2FVMESAPROC __glewWindowPos2fvMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2IMESAPROC __glewWindowPos2iMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2IVMESAPROC __glewWindowPos2ivMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2SMESAPROC __glewWindowPos2sMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2SVMESAPROC __glewWindowPos2svMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3DMESAPROC __glewWindowPos3dMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3DVMESAPROC __glewWindowPos3dvMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3FMESAPROC __glewWindowPos3fMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3FVMESAPROC __glewWindowPos3fvMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3IMESAPROC __glewWindowPos3iMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3IVMESAPROC __glewWindowPos3ivMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3SMESAPROC __glewWindowPos3sMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3SVMESAPROC __glewWindowPos3svMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS4DMESAPROC __glewWindowPos4dMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS4DVMESAPROC __glewWindowPos4dvMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS4FMESAPROC __glewWindowPos4fMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS4FVMESAPROC __glewWindowPos4fvMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS4IMESAPROC __glewWindowPos4iMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS4IVMESAPROC __glewWindowPos4ivMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS4SMESAPROC __glewWindowPos4sMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS4SVMESAPROC __glewWindowPos4svMESA; + +GLEW_FUN_EXPORT PFNGLBEGINCONDITIONALRENDERNVXPROC __glewBeginConditionalRenderNVX; +GLEW_FUN_EXPORT PFNGLENDCONDITIONALRENDERNVXPROC __glewEndConditionalRenderNVX; + +GLEW_FUN_EXPORT PFNGLMULTIDRAWARRAYSINDIRECTBINDLESSNVPROC __glewMultiDrawArraysIndirectBindlessNV; +GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTSINDIRECTBINDLESSNVPROC __glewMultiDrawElementsIndirectBindlessNV; + +GLEW_FUN_EXPORT PFNGLGETIMAGEHANDLENVPROC __glewGetImageHandleNV; +GLEW_FUN_EXPORT PFNGLGETTEXTUREHANDLENVPROC __glewGetTextureHandleNV; +GLEW_FUN_EXPORT PFNGLGETTEXTURESAMPLERHANDLENVPROC __glewGetTextureSamplerHandleNV; +GLEW_FUN_EXPORT PFNGLISIMAGEHANDLERESIDENTNVPROC __glewIsImageHandleResidentNV; +GLEW_FUN_EXPORT PFNGLISTEXTUREHANDLERESIDENTNVPROC __glewIsTextureHandleResidentNV; +GLEW_FUN_EXPORT PFNGLMAKEIMAGEHANDLENONRESIDENTNVPROC __glewMakeImageHandleNonResidentNV; +GLEW_FUN_EXPORT PFNGLMAKEIMAGEHANDLERESIDENTNVPROC __glewMakeImageHandleResidentNV; +GLEW_FUN_EXPORT PFNGLMAKETEXTUREHANDLENONRESIDENTNVPROC __glewMakeTextureHandleNonResidentNV; +GLEW_FUN_EXPORT PFNGLMAKETEXTUREHANDLERESIDENTNVPROC __glewMakeTextureHandleResidentNV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMHANDLEUI64NVPROC __glewProgramUniformHandleui64NV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMHANDLEUI64VNVPROC __glewProgramUniformHandleui64vNV; +GLEW_FUN_EXPORT PFNGLUNIFORMHANDLEUI64NVPROC __glewUniformHandleui64NV; +GLEW_FUN_EXPORT PFNGLUNIFORMHANDLEUI64VNVPROC __glewUniformHandleui64vNV; + +GLEW_FUN_EXPORT PFNGLBLENDBARRIERNVPROC __glewBlendBarrierNV; +GLEW_FUN_EXPORT PFNGLBLENDPARAMETERINVPROC __glewBlendParameteriNV; + +GLEW_FUN_EXPORT PFNGLBEGINCONDITIONALRENDERNVPROC __glewBeginConditionalRenderNV; +GLEW_FUN_EXPORT PFNGLENDCONDITIONALRENDERNVPROC __glewEndConditionalRenderNV; + +GLEW_FUN_EXPORT PFNGLCOPYIMAGESUBDATANVPROC __glewCopyImageSubDataNV; + +GLEW_FUN_EXPORT PFNGLCLEARDEPTHDNVPROC __glewClearDepthdNV; +GLEW_FUN_EXPORT PFNGLDEPTHBOUNDSDNVPROC __glewDepthBoundsdNV; +GLEW_FUN_EXPORT PFNGLDEPTHRANGEDNVPROC __glewDepthRangedNV; + +GLEW_FUN_EXPORT PFNGLDRAWTEXTURENVPROC __glewDrawTextureNV; + +GLEW_FUN_EXPORT PFNGLEVALMAPSNVPROC __glewEvalMapsNV; +GLEW_FUN_EXPORT PFNGLGETMAPATTRIBPARAMETERFVNVPROC __glewGetMapAttribParameterfvNV; +GLEW_FUN_EXPORT PFNGLGETMAPATTRIBPARAMETERIVNVPROC __glewGetMapAttribParameterivNV; +GLEW_FUN_EXPORT PFNGLGETMAPCONTROLPOINTSNVPROC __glewGetMapControlPointsNV; +GLEW_FUN_EXPORT PFNGLGETMAPPARAMETERFVNVPROC __glewGetMapParameterfvNV; +GLEW_FUN_EXPORT PFNGLGETMAPPARAMETERIVNVPROC __glewGetMapParameterivNV; +GLEW_FUN_EXPORT PFNGLMAPCONTROLPOINTSNVPROC __glewMapControlPointsNV; +GLEW_FUN_EXPORT PFNGLMAPPARAMETERFVNVPROC __glewMapParameterfvNV; +GLEW_FUN_EXPORT PFNGLMAPPARAMETERIVNVPROC __glewMapParameterivNV; + +GLEW_FUN_EXPORT PFNGLGETMULTISAMPLEFVNVPROC __glewGetMultisamplefvNV; +GLEW_FUN_EXPORT PFNGLSAMPLEMASKINDEXEDNVPROC __glewSampleMaskIndexedNV; +GLEW_FUN_EXPORT PFNGLTEXRENDERBUFFERNVPROC __glewTexRenderbufferNV; + +GLEW_FUN_EXPORT PFNGLDELETEFENCESNVPROC __glewDeleteFencesNV; +GLEW_FUN_EXPORT PFNGLFINISHFENCENVPROC __glewFinishFenceNV; +GLEW_FUN_EXPORT PFNGLGENFENCESNVPROC __glewGenFencesNV; +GLEW_FUN_EXPORT PFNGLGETFENCEIVNVPROC __glewGetFenceivNV; +GLEW_FUN_EXPORT PFNGLISFENCENVPROC __glewIsFenceNV; +GLEW_FUN_EXPORT PFNGLSETFENCENVPROC __glewSetFenceNV; +GLEW_FUN_EXPORT PFNGLTESTFENCENVPROC __glewTestFenceNV; + +GLEW_FUN_EXPORT PFNGLGETPROGRAMNAMEDPARAMETERDVNVPROC __glewGetProgramNamedParameterdvNV; +GLEW_FUN_EXPORT PFNGLGETPROGRAMNAMEDPARAMETERFVNVPROC __glewGetProgramNamedParameterfvNV; +GLEW_FUN_EXPORT PFNGLPROGRAMNAMEDPARAMETER4DNVPROC __glewProgramNamedParameter4dNV; +GLEW_FUN_EXPORT PFNGLPROGRAMNAMEDPARAMETER4DVNVPROC __glewProgramNamedParameter4dvNV; +GLEW_FUN_EXPORT PFNGLPROGRAMNAMEDPARAMETER4FNVPROC __glewProgramNamedParameter4fNV; +GLEW_FUN_EXPORT PFNGLPROGRAMNAMEDPARAMETER4FVNVPROC __glewProgramNamedParameter4fvNV; + +GLEW_FUN_EXPORT PFNGLRENDERBUFFERSTORAGEMULTISAMPLECOVERAGENVPROC __glewRenderbufferStorageMultisampleCoverageNV; + +GLEW_FUN_EXPORT PFNGLPROGRAMVERTEXLIMITNVPROC __glewProgramVertexLimitNV; + +GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETERI4INVPROC __glewProgramEnvParameterI4iNV; +GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETERI4IVNVPROC __glewProgramEnvParameterI4ivNV; +GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETERI4UINVPROC __glewProgramEnvParameterI4uiNV; +GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETERI4UIVNVPROC __glewProgramEnvParameterI4uivNV; +GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETERSI4IVNVPROC __glewProgramEnvParametersI4ivNV; +GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETERSI4UIVNVPROC __glewProgramEnvParametersI4uivNV; +GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETERI4INVPROC __glewProgramLocalParameterI4iNV; +GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETERI4IVNVPROC __glewProgramLocalParameterI4ivNV; +GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETERI4UINVPROC __glewProgramLocalParameterI4uiNV; +GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETERI4UIVNVPROC __glewProgramLocalParameterI4uivNV; +GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETERSI4IVNVPROC __glewProgramLocalParametersI4ivNV; +GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETERSI4UIVNVPROC __glewProgramLocalParametersI4uivNV; + +GLEW_FUN_EXPORT PFNGLGETUNIFORMI64VNVPROC __glewGetUniformi64vNV; +GLEW_FUN_EXPORT PFNGLGETUNIFORMUI64VNVPROC __glewGetUniformui64vNV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1I64NVPROC __glewProgramUniform1i64NV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1I64VNVPROC __glewProgramUniform1i64vNV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1UI64NVPROC __glewProgramUniform1ui64NV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1UI64VNVPROC __glewProgramUniform1ui64vNV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2I64NVPROC __glewProgramUniform2i64NV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2I64VNVPROC __glewProgramUniform2i64vNV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2UI64NVPROC __glewProgramUniform2ui64NV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2UI64VNVPROC __glewProgramUniform2ui64vNV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3I64NVPROC __glewProgramUniform3i64NV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3I64VNVPROC __glewProgramUniform3i64vNV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3UI64NVPROC __glewProgramUniform3ui64NV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3UI64VNVPROC __glewProgramUniform3ui64vNV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4I64NVPROC __glewProgramUniform4i64NV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4I64VNVPROC __glewProgramUniform4i64vNV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4UI64NVPROC __glewProgramUniform4ui64NV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4UI64VNVPROC __glewProgramUniform4ui64vNV; +GLEW_FUN_EXPORT PFNGLUNIFORM1I64NVPROC __glewUniform1i64NV; +GLEW_FUN_EXPORT PFNGLUNIFORM1I64VNVPROC __glewUniform1i64vNV; +GLEW_FUN_EXPORT PFNGLUNIFORM1UI64NVPROC __glewUniform1ui64NV; +GLEW_FUN_EXPORT PFNGLUNIFORM1UI64VNVPROC __glewUniform1ui64vNV; +GLEW_FUN_EXPORT PFNGLUNIFORM2I64NVPROC __glewUniform2i64NV; +GLEW_FUN_EXPORT PFNGLUNIFORM2I64VNVPROC __glewUniform2i64vNV; +GLEW_FUN_EXPORT PFNGLUNIFORM2UI64NVPROC __glewUniform2ui64NV; +GLEW_FUN_EXPORT PFNGLUNIFORM2UI64VNVPROC __glewUniform2ui64vNV; +GLEW_FUN_EXPORT PFNGLUNIFORM3I64NVPROC __glewUniform3i64NV; +GLEW_FUN_EXPORT PFNGLUNIFORM3I64VNVPROC __glewUniform3i64vNV; +GLEW_FUN_EXPORT PFNGLUNIFORM3UI64NVPROC __glewUniform3ui64NV; +GLEW_FUN_EXPORT PFNGLUNIFORM3UI64VNVPROC __glewUniform3ui64vNV; +GLEW_FUN_EXPORT PFNGLUNIFORM4I64NVPROC __glewUniform4i64NV; +GLEW_FUN_EXPORT PFNGLUNIFORM4I64VNVPROC __glewUniform4i64vNV; +GLEW_FUN_EXPORT PFNGLUNIFORM4UI64NVPROC __glewUniform4ui64NV; +GLEW_FUN_EXPORT PFNGLUNIFORM4UI64VNVPROC __glewUniform4ui64vNV; + +GLEW_FUN_EXPORT PFNGLCOLOR3HNVPROC __glewColor3hNV; +GLEW_FUN_EXPORT PFNGLCOLOR3HVNVPROC __glewColor3hvNV; +GLEW_FUN_EXPORT PFNGLCOLOR4HNVPROC __glewColor4hNV; +GLEW_FUN_EXPORT PFNGLCOLOR4HVNVPROC __glewColor4hvNV; +GLEW_FUN_EXPORT PFNGLFOGCOORDHNVPROC __glewFogCoordhNV; +GLEW_FUN_EXPORT PFNGLFOGCOORDHVNVPROC __glewFogCoordhvNV; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1HNVPROC __glewMultiTexCoord1hNV; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1HVNVPROC __glewMultiTexCoord1hvNV; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2HNVPROC __glewMultiTexCoord2hNV; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2HVNVPROC __glewMultiTexCoord2hvNV; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3HNVPROC __glewMultiTexCoord3hNV; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3HVNVPROC __glewMultiTexCoord3hvNV; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4HNVPROC __glewMultiTexCoord4hNV; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4HVNVPROC __glewMultiTexCoord4hvNV; +GLEW_FUN_EXPORT PFNGLNORMAL3HNVPROC __glewNormal3hNV; +GLEW_FUN_EXPORT PFNGLNORMAL3HVNVPROC __glewNormal3hvNV; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3HNVPROC __glewSecondaryColor3hNV; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3HVNVPROC __glewSecondaryColor3hvNV; +GLEW_FUN_EXPORT PFNGLTEXCOORD1HNVPROC __glewTexCoord1hNV; +GLEW_FUN_EXPORT PFNGLTEXCOORD1HVNVPROC __glewTexCoord1hvNV; +GLEW_FUN_EXPORT PFNGLTEXCOORD2HNVPROC __glewTexCoord2hNV; +GLEW_FUN_EXPORT PFNGLTEXCOORD2HVNVPROC __glewTexCoord2hvNV; +GLEW_FUN_EXPORT PFNGLTEXCOORD3HNVPROC __glewTexCoord3hNV; +GLEW_FUN_EXPORT PFNGLTEXCOORD3HVNVPROC __glewTexCoord3hvNV; +GLEW_FUN_EXPORT PFNGLTEXCOORD4HNVPROC __glewTexCoord4hNV; +GLEW_FUN_EXPORT PFNGLTEXCOORD4HVNVPROC __glewTexCoord4hvNV; +GLEW_FUN_EXPORT PFNGLVERTEX2HNVPROC __glewVertex2hNV; +GLEW_FUN_EXPORT PFNGLVERTEX2HVNVPROC __glewVertex2hvNV; +GLEW_FUN_EXPORT PFNGLVERTEX3HNVPROC __glewVertex3hNV; +GLEW_FUN_EXPORT PFNGLVERTEX3HVNVPROC __glewVertex3hvNV; +GLEW_FUN_EXPORT PFNGLVERTEX4HNVPROC __glewVertex4hNV; +GLEW_FUN_EXPORT PFNGLVERTEX4HVNVPROC __glewVertex4hvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1HNVPROC __glewVertexAttrib1hNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1HVNVPROC __glewVertexAttrib1hvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2HNVPROC __glewVertexAttrib2hNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2HVNVPROC __glewVertexAttrib2hvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3HNVPROC __glewVertexAttrib3hNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3HVNVPROC __glewVertexAttrib3hvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4HNVPROC __glewVertexAttrib4hNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4HVNVPROC __glewVertexAttrib4hvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS1HVNVPROC __glewVertexAttribs1hvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS2HVNVPROC __glewVertexAttribs2hvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS3HVNVPROC __glewVertexAttribs3hvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS4HVNVPROC __glewVertexAttribs4hvNV; +GLEW_FUN_EXPORT PFNGLVERTEXWEIGHTHNVPROC __glewVertexWeighthNV; +GLEW_FUN_EXPORT PFNGLVERTEXWEIGHTHVNVPROC __glewVertexWeighthvNV; + +GLEW_FUN_EXPORT PFNGLBEGINOCCLUSIONQUERYNVPROC __glewBeginOcclusionQueryNV; +GLEW_FUN_EXPORT PFNGLDELETEOCCLUSIONQUERIESNVPROC __glewDeleteOcclusionQueriesNV; +GLEW_FUN_EXPORT PFNGLENDOCCLUSIONQUERYNVPROC __glewEndOcclusionQueryNV; +GLEW_FUN_EXPORT PFNGLGENOCCLUSIONQUERIESNVPROC __glewGenOcclusionQueriesNV; +GLEW_FUN_EXPORT PFNGLGETOCCLUSIONQUERYIVNVPROC __glewGetOcclusionQueryivNV; +GLEW_FUN_EXPORT PFNGLGETOCCLUSIONQUERYUIVNVPROC __glewGetOcclusionQueryuivNV; +GLEW_FUN_EXPORT PFNGLISOCCLUSIONQUERYNVPROC __glewIsOcclusionQueryNV; + +GLEW_FUN_EXPORT PFNGLPROGRAMBUFFERPARAMETERSIIVNVPROC __glewProgramBufferParametersIivNV; +GLEW_FUN_EXPORT PFNGLPROGRAMBUFFERPARAMETERSIUIVNVPROC __glewProgramBufferParametersIuivNV; +GLEW_FUN_EXPORT PFNGLPROGRAMBUFFERPARAMETERSFVNVPROC __glewProgramBufferParametersfvNV; + +GLEW_FUN_EXPORT PFNGLCOPYPATHNVPROC __glewCopyPathNV; +GLEW_FUN_EXPORT PFNGLCOVERFILLPATHINSTANCEDNVPROC __glewCoverFillPathInstancedNV; +GLEW_FUN_EXPORT PFNGLCOVERFILLPATHNVPROC __glewCoverFillPathNV; +GLEW_FUN_EXPORT PFNGLCOVERSTROKEPATHINSTANCEDNVPROC __glewCoverStrokePathInstancedNV; +GLEW_FUN_EXPORT PFNGLCOVERSTROKEPATHNVPROC __glewCoverStrokePathNV; +GLEW_FUN_EXPORT PFNGLDELETEPATHSNVPROC __glewDeletePathsNV; +GLEW_FUN_EXPORT PFNGLGENPATHSNVPROC __glewGenPathsNV; +GLEW_FUN_EXPORT PFNGLGETPATHCOLORGENFVNVPROC __glewGetPathColorGenfvNV; +GLEW_FUN_EXPORT PFNGLGETPATHCOLORGENIVNVPROC __glewGetPathColorGenivNV; +GLEW_FUN_EXPORT PFNGLGETPATHCOMMANDSNVPROC __glewGetPathCommandsNV; +GLEW_FUN_EXPORT PFNGLGETPATHCOORDSNVPROC __glewGetPathCoordsNV; +GLEW_FUN_EXPORT PFNGLGETPATHDASHARRAYNVPROC __glewGetPathDashArrayNV; +GLEW_FUN_EXPORT PFNGLGETPATHLENGTHNVPROC __glewGetPathLengthNV; +GLEW_FUN_EXPORT PFNGLGETPATHMETRICRANGENVPROC __glewGetPathMetricRangeNV; +GLEW_FUN_EXPORT PFNGLGETPATHMETRICSNVPROC __glewGetPathMetricsNV; +GLEW_FUN_EXPORT PFNGLGETPATHPARAMETERFVNVPROC __glewGetPathParameterfvNV; +GLEW_FUN_EXPORT PFNGLGETPATHPARAMETERIVNVPROC __glewGetPathParameterivNV; +GLEW_FUN_EXPORT PFNGLGETPATHSPACINGNVPROC __glewGetPathSpacingNV; +GLEW_FUN_EXPORT PFNGLGETPATHTEXGENFVNVPROC __glewGetPathTexGenfvNV; +GLEW_FUN_EXPORT PFNGLGETPATHTEXGENIVNVPROC __glewGetPathTexGenivNV; +GLEW_FUN_EXPORT PFNGLINTERPOLATEPATHSNVPROC __glewInterpolatePathsNV; +GLEW_FUN_EXPORT PFNGLISPATHNVPROC __glewIsPathNV; +GLEW_FUN_EXPORT PFNGLISPOINTINFILLPATHNVPROC __glewIsPointInFillPathNV; +GLEW_FUN_EXPORT PFNGLISPOINTINSTROKEPATHNVPROC __glewIsPointInStrokePathNV; +GLEW_FUN_EXPORT PFNGLPATHCOLORGENNVPROC __glewPathColorGenNV; +GLEW_FUN_EXPORT PFNGLPATHCOMMANDSNVPROC __glewPathCommandsNV; +GLEW_FUN_EXPORT PFNGLPATHCOORDSNVPROC __glewPathCoordsNV; +GLEW_FUN_EXPORT PFNGLPATHCOVERDEPTHFUNCNVPROC __glewPathCoverDepthFuncNV; +GLEW_FUN_EXPORT PFNGLPATHDASHARRAYNVPROC __glewPathDashArrayNV; +GLEW_FUN_EXPORT PFNGLPATHFOGGENNVPROC __glewPathFogGenNV; +GLEW_FUN_EXPORT PFNGLPATHGLYPHRANGENVPROC __glewPathGlyphRangeNV; +GLEW_FUN_EXPORT PFNGLPATHGLYPHSNVPROC __glewPathGlyphsNV; +GLEW_FUN_EXPORT PFNGLPATHPARAMETERFNVPROC __glewPathParameterfNV; +GLEW_FUN_EXPORT PFNGLPATHPARAMETERFVNVPROC __glewPathParameterfvNV; +GLEW_FUN_EXPORT PFNGLPATHPARAMETERINVPROC __glewPathParameteriNV; +GLEW_FUN_EXPORT PFNGLPATHPARAMETERIVNVPROC __glewPathParameterivNV; +GLEW_FUN_EXPORT PFNGLPATHSTENCILDEPTHOFFSETNVPROC __glewPathStencilDepthOffsetNV; +GLEW_FUN_EXPORT PFNGLPATHSTENCILFUNCNVPROC __glewPathStencilFuncNV; +GLEW_FUN_EXPORT PFNGLPATHSTRINGNVPROC __glewPathStringNV; +GLEW_FUN_EXPORT PFNGLPATHSUBCOMMANDSNVPROC __glewPathSubCommandsNV; +GLEW_FUN_EXPORT PFNGLPATHSUBCOORDSNVPROC __glewPathSubCoordsNV; +GLEW_FUN_EXPORT PFNGLPATHTEXGENNVPROC __glewPathTexGenNV; +GLEW_FUN_EXPORT PFNGLPOINTALONGPATHNVPROC __glewPointAlongPathNV; +GLEW_FUN_EXPORT PFNGLSTENCILFILLPATHINSTANCEDNVPROC __glewStencilFillPathInstancedNV; +GLEW_FUN_EXPORT PFNGLSTENCILFILLPATHNVPROC __glewStencilFillPathNV; +GLEW_FUN_EXPORT PFNGLSTENCILSTROKEPATHINSTANCEDNVPROC __glewStencilStrokePathInstancedNV; +GLEW_FUN_EXPORT PFNGLSTENCILSTROKEPATHNVPROC __glewStencilStrokePathNV; +GLEW_FUN_EXPORT PFNGLTRANSFORMPATHNVPROC __glewTransformPathNV; +GLEW_FUN_EXPORT PFNGLWEIGHTPATHSNVPROC __glewWeightPathsNV; + +GLEW_FUN_EXPORT PFNGLFLUSHPIXELDATARANGENVPROC __glewFlushPixelDataRangeNV; +GLEW_FUN_EXPORT PFNGLPIXELDATARANGENVPROC __glewPixelDataRangeNV; + +GLEW_FUN_EXPORT PFNGLPOINTPARAMETERINVPROC __glewPointParameteriNV; +GLEW_FUN_EXPORT PFNGLPOINTPARAMETERIVNVPROC __glewPointParameterivNV; + +GLEW_FUN_EXPORT PFNGLGETVIDEOI64VNVPROC __glewGetVideoi64vNV; +GLEW_FUN_EXPORT PFNGLGETVIDEOIVNVPROC __glewGetVideoivNV; +GLEW_FUN_EXPORT PFNGLGETVIDEOUI64VNVPROC __glewGetVideoui64vNV; +GLEW_FUN_EXPORT PFNGLGETVIDEOUIVNVPROC __glewGetVideouivNV; +GLEW_FUN_EXPORT PFNGLPRESENTFRAMEDUALFILLNVPROC __glewPresentFrameDualFillNV; +GLEW_FUN_EXPORT PFNGLPRESENTFRAMEKEYEDNVPROC __glewPresentFrameKeyedNV; + +GLEW_FUN_EXPORT PFNGLPRIMITIVERESTARTINDEXNVPROC __glewPrimitiveRestartIndexNV; +GLEW_FUN_EXPORT PFNGLPRIMITIVERESTARTNVPROC __glewPrimitiveRestartNV; + +GLEW_FUN_EXPORT PFNGLCOMBINERINPUTNVPROC __glewCombinerInputNV; +GLEW_FUN_EXPORT PFNGLCOMBINEROUTPUTNVPROC __glewCombinerOutputNV; +GLEW_FUN_EXPORT PFNGLCOMBINERPARAMETERFNVPROC __glewCombinerParameterfNV; +GLEW_FUN_EXPORT PFNGLCOMBINERPARAMETERFVNVPROC __glewCombinerParameterfvNV; +GLEW_FUN_EXPORT PFNGLCOMBINERPARAMETERINVPROC __glewCombinerParameteriNV; +GLEW_FUN_EXPORT PFNGLCOMBINERPARAMETERIVNVPROC __glewCombinerParameterivNV; +GLEW_FUN_EXPORT PFNGLFINALCOMBINERINPUTNVPROC __glewFinalCombinerInputNV; +GLEW_FUN_EXPORT PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC __glewGetCombinerInputParameterfvNV; +GLEW_FUN_EXPORT PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC __glewGetCombinerInputParameterivNV; +GLEW_FUN_EXPORT PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC __glewGetCombinerOutputParameterfvNV; +GLEW_FUN_EXPORT PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC __glewGetCombinerOutputParameterivNV; +GLEW_FUN_EXPORT PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC __glewGetFinalCombinerInputParameterfvNV; +GLEW_FUN_EXPORT PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC __glewGetFinalCombinerInputParameterivNV; + +GLEW_FUN_EXPORT PFNGLCOMBINERSTAGEPARAMETERFVNVPROC __glewCombinerStageParameterfvNV; +GLEW_FUN_EXPORT PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC __glewGetCombinerStageParameterfvNV; + +GLEW_FUN_EXPORT PFNGLGETBUFFERPARAMETERUI64VNVPROC __glewGetBufferParameterui64vNV; +GLEW_FUN_EXPORT PFNGLGETINTEGERUI64VNVPROC __glewGetIntegerui64vNV; +GLEW_FUN_EXPORT PFNGLGETNAMEDBUFFERPARAMETERUI64VNVPROC __glewGetNamedBufferParameterui64vNV; +GLEW_FUN_EXPORT PFNGLISBUFFERRESIDENTNVPROC __glewIsBufferResidentNV; +GLEW_FUN_EXPORT PFNGLISNAMEDBUFFERRESIDENTNVPROC __glewIsNamedBufferResidentNV; +GLEW_FUN_EXPORT PFNGLMAKEBUFFERNONRESIDENTNVPROC __glewMakeBufferNonResidentNV; +GLEW_FUN_EXPORT PFNGLMAKEBUFFERRESIDENTNVPROC __glewMakeBufferResidentNV; +GLEW_FUN_EXPORT PFNGLMAKENAMEDBUFFERNONRESIDENTNVPROC __glewMakeNamedBufferNonResidentNV; +GLEW_FUN_EXPORT PFNGLMAKENAMEDBUFFERRESIDENTNVPROC __glewMakeNamedBufferResidentNV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMUI64NVPROC __glewProgramUniformui64NV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMUI64VNVPROC __glewProgramUniformui64vNV; +GLEW_FUN_EXPORT PFNGLUNIFORMUI64NVPROC __glewUniformui64NV; +GLEW_FUN_EXPORT PFNGLUNIFORMUI64VNVPROC __glewUniformui64vNV; + +GLEW_FUN_EXPORT PFNGLTEXTUREBARRIERNVPROC __glewTextureBarrierNV; + +GLEW_FUN_EXPORT PFNGLTEXIMAGE2DMULTISAMPLECOVERAGENVPROC __glewTexImage2DMultisampleCoverageNV; +GLEW_FUN_EXPORT PFNGLTEXIMAGE3DMULTISAMPLECOVERAGENVPROC __glewTexImage3DMultisampleCoverageNV; +GLEW_FUN_EXPORT PFNGLTEXTUREIMAGE2DMULTISAMPLECOVERAGENVPROC __glewTextureImage2DMultisampleCoverageNV; +GLEW_FUN_EXPORT PFNGLTEXTUREIMAGE2DMULTISAMPLENVPROC __glewTextureImage2DMultisampleNV; +GLEW_FUN_EXPORT PFNGLTEXTUREIMAGE3DMULTISAMPLECOVERAGENVPROC __glewTextureImage3DMultisampleCoverageNV; +GLEW_FUN_EXPORT PFNGLTEXTUREIMAGE3DMULTISAMPLENVPROC __glewTextureImage3DMultisampleNV; + +GLEW_FUN_EXPORT PFNGLACTIVEVARYINGNVPROC __glewActiveVaryingNV; +GLEW_FUN_EXPORT PFNGLBEGINTRANSFORMFEEDBACKNVPROC __glewBeginTransformFeedbackNV; +GLEW_FUN_EXPORT PFNGLBINDBUFFERBASENVPROC __glewBindBufferBaseNV; +GLEW_FUN_EXPORT PFNGLBINDBUFFEROFFSETNVPROC __glewBindBufferOffsetNV; +GLEW_FUN_EXPORT PFNGLBINDBUFFERRANGENVPROC __glewBindBufferRangeNV; +GLEW_FUN_EXPORT PFNGLENDTRANSFORMFEEDBACKNVPROC __glewEndTransformFeedbackNV; +GLEW_FUN_EXPORT PFNGLGETACTIVEVARYINGNVPROC __glewGetActiveVaryingNV; +GLEW_FUN_EXPORT PFNGLGETTRANSFORMFEEDBACKVARYINGNVPROC __glewGetTransformFeedbackVaryingNV; +GLEW_FUN_EXPORT PFNGLGETVARYINGLOCATIONNVPROC __glewGetVaryingLocationNV; +GLEW_FUN_EXPORT PFNGLTRANSFORMFEEDBACKATTRIBSNVPROC __glewTransformFeedbackAttribsNV; +GLEW_FUN_EXPORT PFNGLTRANSFORMFEEDBACKVARYINGSNVPROC __glewTransformFeedbackVaryingsNV; + +GLEW_FUN_EXPORT PFNGLBINDTRANSFORMFEEDBACKNVPROC __glewBindTransformFeedbackNV; +GLEW_FUN_EXPORT PFNGLDELETETRANSFORMFEEDBACKSNVPROC __glewDeleteTransformFeedbacksNV; +GLEW_FUN_EXPORT PFNGLDRAWTRANSFORMFEEDBACKNVPROC __glewDrawTransformFeedbackNV; +GLEW_FUN_EXPORT PFNGLGENTRANSFORMFEEDBACKSNVPROC __glewGenTransformFeedbacksNV; +GLEW_FUN_EXPORT PFNGLISTRANSFORMFEEDBACKNVPROC __glewIsTransformFeedbackNV; +GLEW_FUN_EXPORT PFNGLPAUSETRANSFORMFEEDBACKNVPROC __glewPauseTransformFeedbackNV; +GLEW_FUN_EXPORT PFNGLRESUMETRANSFORMFEEDBACKNVPROC __glewResumeTransformFeedbackNV; + +GLEW_FUN_EXPORT PFNGLVDPAUFININVPROC __glewVDPAUFiniNV; +GLEW_FUN_EXPORT PFNGLVDPAUGETSURFACEIVNVPROC __glewVDPAUGetSurfaceivNV; +GLEW_FUN_EXPORT PFNGLVDPAUINITNVPROC __glewVDPAUInitNV; +GLEW_FUN_EXPORT PFNGLVDPAUISSURFACENVPROC __glewVDPAUIsSurfaceNV; +GLEW_FUN_EXPORT PFNGLVDPAUMAPSURFACESNVPROC __glewVDPAUMapSurfacesNV; +GLEW_FUN_EXPORT PFNGLVDPAUREGISTEROUTPUTSURFACENVPROC __glewVDPAURegisterOutputSurfaceNV; +GLEW_FUN_EXPORT PFNGLVDPAUREGISTERVIDEOSURFACENVPROC __glewVDPAURegisterVideoSurfaceNV; +GLEW_FUN_EXPORT PFNGLVDPAUSURFACEACCESSNVPROC __glewVDPAUSurfaceAccessNV; +GLEW_FUN_EXPORT PFNGLVDPAUUNMAPSURFACESNVPROC __glewVDPAUUnmapSurfacesNV; +GLEW_FUN_EXPORT PFNGLVDPAUUNREGISTERSURFACENVPROC __glewVDPAUUnregisterSurfaceNV; + +GLEW_FUN_EXPORT PFNGLFLUSHVERTEXARRAYRANGENVPROC __glewFlushVertexArrayRangeNV; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYRANGENVPROC __glewVertexArrayRangeNV; + +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBLI64VNVPROC __glewGetVertexAttribLi64vNV; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBLUI64VNVPROC __glewGetVertexAttribLui64vNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1I64NVPROC __glewVertexAttribL1i64NV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1I64VNVPROC __glewVertexAttribL1i64vNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1UI64NVPROC __glewVertexAttribL1ui64NV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1UI64VNVPROC __glewVertexAttribL1ui64vNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL2I64NVPROC __glewVertexAttribL2i64NV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL2I64VNVPROC __glewVertexAttribL2i64vNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL2UI64NVPROC __glewVertexAttribL2ui64NV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL2UI64VNVPROC __glewVertexAttribL2ui64vNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL3I64NVPROC __glewVertexAttribL3i64NV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL3I64VNVPROC __glewVertexAttribL3i64vNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL3UI64NVPROC __glewVertexAttribL3ui64NV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL3UI64VNVPROC __glewVertexAttribL3ui64vNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL4I64NVPROC __glewVertexAttribL4i64NV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL4I64VNVPROC __glewVertexAttribL4i64vNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL4UI64NVPROC __glewVertexAttribL4ui64NV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL4UI64VNVPROC __glewVertexAttribL4ui64vNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBLFORMATNVPROC __glewVertexAttribLFormatNV; + +GLEW_FUN_EXPORT PFNGLBUFFERADDRESSRANGENVPROC __glewBufferAddressRangeNV; +GLEW_FUN_EXPORT PFNGLCOLORFORMATNVPROC __glewColorFormatNV; +GLEW_FUN_EXPORT PFNGLEDGEFLAGFORMATNVPROC __glewEdgeFlagFormatNV; +GLEW_FUN_EXPORT PFNGLFOGCOORDFORMATNVPROC __glewFogCoordFormatNV; +GLEW_FUN_EXPORT PFNGLGETINTEGERUI64I_VNVPROC __glewGetIntegerui64i_vNV; +GLEW_FUN_EXPORT PFNGLINDEXFORMATNVPROC __glewIndexFormatNV; +GLEW_FUN_EXPORT PFNGLNORMALFORMATNVPROC __glewNormalFormatNV; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLORFORMATNVPROC __glewSecondaryColorFormatNV; +GLEW_FUN_EXPORT PFNGLTEXCOORDFORMATNVPROC __glewTexCoordFormatNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBFORMATNVPROC __glewVertexAttribFormatNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBIFORMATNVPROC __glewVertexAttribIFormatNV; +GLEW_FUN_EXPORT PFNGLVERTEXFORMATNVPROC __glewVertexFormatNV; + +GLEW_FUN_EXPORT PFNGLAREPROGRAMSRESIDENTNVPROC __glewAreProgramsResidentNV; +GLEW_FUN_EXPORT PFNGLBINDPROGRAMNVPROC __glewBindProgramNV; +GLEW_FUN_EXPORT PFNGLDELETEPROGRAMSNVPROC __glewDeleteProgramsNV; +GLEW_FUN_EXPORT PFNGLEXECUTEPROGRAMNVPROC __glewExecuteProgramNV; +GLEW_FUN_EXPORT PFNGLGENPROGRAMSNVPROC __glewGenProgramsNV; +GLEW_FUN_EXPORT PFNGLGETPROGRAMPARAMETERDVNVPROC __glewGetProgramParameterdvNV; +GLEW_FUN_EXPORT PFNGLGETPROGRAMPARAMETERFVNVPROC __glewGetProgramParameterfvNV; +GLEW_FUN_EXPORT PFNGLGETPROGRAMSTRINGNVPROC __glewGetProgramStringNV; +GLEW_FUN_EXPORT PFNGLGETPROGRAMIVNVPROC __glewGetProgramivNV; +GLEW_FUN_EXPORT PFNGLGETTRACKMATRIXIVNVPROC __glewGetTrackMatrixivNV; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBPOINTERVNVPROC __glewGetVertexAttribPointervNV; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBDVNVPROC __glewGetVertexAttribdvNV; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBFVNVPROC __glewGetVertexAttribfvNV; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBIVNVPROC __glewGetVertexAttribivNV; +GLEW_FUN_EXPORT PFNGLISPROGRAMNVPROC __glewIsProgramNV; +GLEW_FUN_EXPORT PFNGLLOADPROGRAMNVPROC __glewLoadProgramNV; +GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETER4DNVPROC __glewProgramParameter4dNV; +GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETER4DVNVPROC __glewProgramParameter4dvNV; +GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETER4FNVPROC __glewProgramParameter4fNV; +GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETER4FVNVPROC __glewProgramParameter4fvNV; +GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETERS4DVNVPROC __glewProgramParameters4dvNV; +GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETERS4FVNVPROC __glewProgramParameters4fvNV; +GLEW_FUN_EXPORT PFNGLREQUESTRESIDENTPROGRAMSNVPROC __glewRequestResidentProgramsNV; +GLEW_FUN_EXPORT PFNGLTRACKMATRIXNVPROC __glewTrackMatrixNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1DNVPROC __glewVertexAttrib1dNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1DVNVPROC __glewVertexAttrib1dvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1FNVPROC __glewVertexAttrib1fNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1FVNVPROC __glewVertexAttrib1fvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1SNVPROC __glewVertexAttrib1sNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1SVNVPROC __glewVertexAttrib1svNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2DNVPROC __glewVertexAttrib2dNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2DVNVPROC __glewVertexAttrib2dvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2FNVPROC __glewVertexAttrib2fNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2FVNVPROC __glewVertexAttrib2fvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2SNVPROC __glewVertexAttrib2sNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2SVNVPROC __glewVertexAttrib2svNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3DNVPROC __glewVertexAttrib3dNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3DVNVPROC __glewVertexAttrib3dvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3FNVPROC __glewVertexAttrib3fNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3FVNVPROC __glewVertexAttrib3fvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3SNVPROC __glewVertexAttrib3sNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3SVNVPROC __glewVertexAttrib3svNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4DNVPROC __glewVertexAttrib4dNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4DVNVPROC __glewVertexAttrib4dvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4FNVPROC __glewVertexAttrib4fNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4FVNVPROC __glewVertexAttrib4fvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4SNVPROC __glewVertexAttrib4sNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4SVNVPROC __glewVertexAttrib4svNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4UBNVPROC __glewVertexAttrib4ubNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4UBVNVPROC __glewVertexAttrib4ubvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBPOINTERNVPROC __glewVertexAttribPointerNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS1DVNVPROC __glewVertexAttribs1dvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS1FVNVPROC __glewVertexAttribs1fvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS1SVNVPROC __glewVertexAttribs1svNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS2DVNVPROC __glewVertexAttribs2dvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS2FVNVPROC __glewVertexAttribs2fvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS2SVNVPROC __glewVertexAttribs2svNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS3DVNVPROC __glewVertexAttribs3dvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS3FVNVPROC __glewVertexAttribs3fvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS3SVNVPROC __glewVertexAttribs3svNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS4DVNVPROC __glewVertexAttribs4dvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS4FVNVPROC __glewVertexAttribs4fvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS4SVNVPROC __glewVertexAttribs4svNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS4UBVNVPROC __glewVertexAttribs4ubvNV; + +GLEW_FUN_EXPORT PFNGLBEGINVIDEOCAPTURENVPROC __glewBeginVideoCaptureNV; +GLEW_FUN_EXPORT PFNGLBINDVIDEOCAPTURESTREAMBUFFERNVPROC __glewBindVideoCaptureStreamBufferNV; +GLEW_FUN_EXPORT PFNGLBINDVIDEOCAPTURESTREAMTEXTURENVPROC __glewBindVideoCaptureStreamTextureNV; +GLEW_FUN_EXPORT PFNGLENDVIDEOCAPTURENVPROC __glewEndVideoCaptureNV; +GLEW_FUN_EXPORT PFNGLGETVIDEOCAPTURESTREAMDVNVPROC __glewGetVideoCaptureStreamdvNV; +GLEW_FUN_EXPORT PFNGLGETVIDEOCAPTURESTREAMFVNVPROC __glewGetVideoCaptureStreamfvNV; +GLEW_FUN_EXPORT PFNGLGETVIDEOCAPTURESTREAMIVNVPROC __glewGetVideoCaptureStreamivNV; +GLEW_FUN_EXPORT PFNGLGETVIDEOCAPTUREIVNVPROC __glewGetVideoCaptureivNV; +GLEW_FUN_EXPORT PFNGLVIDEOCAPTURENVPROC __glewVideoCaptureNV; +GLEW_FUN_EXPORT PFNGLVIDEOCAPTURESTREAMPARAMETERDVNVPROC __glewVideoCaptureStreamParameterdvNV; +GLEW_FUN_EXPORT PFNGLVIDEOCAPTURESTREAMPARAMETERFVNVPROC __glewVideoCaptureStreamParameterfvNV; +GLEW_FUN_EXPORT PFNGLVIDEOCAPTURESTREAMPARAMETERIVNVPROC __glewVideoCaptureStreamParameterivNV; + +GLEW_FUN_EXPORT PFNGLCLEARDEPTHFOESPROC __glewClearDepthfOES; +GLEW_FUN_EXPORT PFNGLCLIPPLANEFOESPROC __glewClipPlanefOES; +GLEW_FUN_EXPORT PFNGLDEPTHRANGEFOESPROC __glewDepthRangefOES; +GLEW_FUN_EXPORT PFNGLFRUSTUMFOESPROC __glewFrustumfOES; +GLEW_FUN_EXPORT PFNGLGETCLIPPLANEFOESPROC __glewGetClipPlanefOES; +GLEW_FUN_EXPORT PFNGLORTHOFOESPROC __glewOrthofOES; + +GLEW_FUN_EXPORT PFNGLALPHAFUNCXPROC __glewAlphaFuncx; +GLEW_FUN_EXPORT PFNGLCLEARCOLORXPROC __glewClearColorx; +GLEW_FUN_EXPORT PFNGLCLEARDEPTHXPROC __glewClearDepthx; +GLEW_FUN_EXPORT PFNGLCOLOR4XPROC __glewColor4x; +GLEW_FUN_EXPORT PFNGLDEPTHRANGEXPROC __glewDepthRangex; +GLEW_FUN_EXPORT PFNGLFOGXPROC __glewFogx; +GLEW_FUN_EXPORT PFNGLFOGXVPROC __glewFogxv; +GLEW_FUN_EXPORT PFNGLFRUSTUMFPROC __glewFrustumf; +GLEW_FUN_EXPORT PFNGLFRUSTUMXPROC __glewFrustumx; +GLEW_FUN_EXPORT PFNGLLIGHTMODELXPROC __glewLightModelx; +GLEW_FUN_EXPORT PFNGLLIGHTMODELXVPROC __glewLightModelxv; +GLEW_FUN_EXPORT PFNGLLIGHTXPROC __glewLightx; +GLEW_FUN_EXPORT PFNGLLIGHTXVPROC __glewLightxv; +GLEW_FUN_EXPORT PFNGLLINEWIDTHXPROC __glewLineWidthx; +GLEW_FUN_EXPORT PFNGLLOADMATRIXXPROC __glewLoadMatrixx; +GLEW_FUN_EXPORT PFNGLMATERIALXPROC __glewMaterialx; +GLEW_FUN_EXPORT PFNGLMATERIALXVPROC __glewMaterialxv; +GLEW_FUN_EXPORT PFNGLMULTMATRIXXPROC __glewMultMatrixx; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4XPROC __glewMultiTexCoord4x; +GLEW_FUN_EXPORT PFNGLNORMAL3XPROC __glewNormal3x; +GLEW_FUN_EXPORT PFNGLORTHOFPROC __glewOrthof; +GLEW_FUN_EXPORT PFNGLORTHOXPROC __glewOrthox; +GLEW_FUN_EXPORT PFNGLPOINTSIZEXPROC __glewPointSizex; +GLEW_FUN_EXPORT PFNGLPOLYGONOFFSETXPROC __glewPolygonOffsetx; +GLEW_FUN_EXPORT PFNGLROTATEXPROC __glewRotatex; +GLEW_FUN_EXPORT PFNGLSAMPLECOVERAGEXPROC __glewSampleCoveragex; +GLEW_FUN_EXPORT PFNGLSCALEXPROC __glewScalex; +GLEW_FUN_EXPORT PFNGLTEXENVXPROC __glewTexEnvx; +GLEW_FUN_EXPORT PFNGLTEXENVXVPROC __glewTexEnvxv; +GLEW_FUN_EXPORT PFNGLTEXPARAMETERXPROC __glewTexParameterx; +GLEW_FUN_EXPORT PFNGLTRANSLATEXPROC __glewTranslatex; + +GLEW_FUN_EXPORT PFNGLCLIPPLANEFPROC __glewClipPlanef; +GLEW_FUN_EXPORT PFNGLCLIPPLANEXPROC __glewClipPlanex; +GLEW_FUN_EXPORT PFNGLGETCLIPPLANEFPROC __glewGetClipPlanef; +GLEW_FUN_EXPORT PFNGLGETCLIPPLANEXPROC __glewGetClipPlanex; +GLEW_FUN_EXPORT PFNGLGETFIXEDVPROC __glewGetFixedv; +GLEW_FUN_EXPORT PFNGLGETLIGHTXVPROC __glewGetLightxv; +GLEW_FUN_EXPORT PFNGLGETMATERIALXVPROC __glewGetMaterialxv; +GLEW_FUN_EXPORT PFNGLGETTEXENVXVPROC __glewGetTexEnvxv; +GLEW_FUN_EXPORT PFNGLGETTEXPARAMETERXVPROC __glewGetTexParameterxv; +GLEW_FUN_EXPORT PFNGLPOINTPARAMETERXPROC __glewPointParameterx; +GLEW_FUN_EXPORT PFNGLPOINTPARAMETERXVPROC __glewPointParameterxv; +GLEW_FUN_EXPORT PFNGLPOINTSIZEPOINTEROESPROC __glewPointSizePointerOES; +GLEW_FUN_EXPORT PFNGLTEXPARAMETERXVPROC __glewTexParameterxv; + +GLEW_FUN_EXPORT PFNGLERRORSTRINGREGALPROC __glewErrorStringREGAL; + +GLEW_FUN_EXPORT PFNGLGETEXTENSIONREGALPROC __glewGetExtensionREGAL; +GLEW_FUN_EXPORT PFNGLISSUPPORTEDREGALPROC __glewIsSupportedREGAL; + +GLEW_FUN_EXPORT PFNGLLOGMESSAGECALLBACKREGALPROC __glewLogMessageCallbackREGAL; + +GLEW_FUN_EXPORT PFNGLDETAILTEXFUNCSGISPROC __glewDetailTexFuncSGIS; +GLEW_FUN_EXPORT PFNGLGETDETAILTEXFUNCSGISPROC __glewGetDetailTexFuncSGIS; + +GLEW_FUN_EXPORT PFNGLFOGFUNCSGISPROC __glewFogFuncSGIS; +GLEW_FUN_EXPORT PFNGLGETFOGFUNCSGISPROC __glewGetFogFuncSGIS; + +GLEW_FUN_EXPORT PFNGLSAMPLEMASKSGISPROC __glewSampleMaskSGIS; +GLEW_FUN_EXPORT PFNGLSAMPLEPATTERNSGISPROC __glewSamplePatternSGIS; + +GLEW_FUN_EXPORT PFNGLGETSHARPENTEXFUNCSGISPROC __glewGetSharpenTexFuncSGIS; +GLEW_FUN_EXPORT PFNGLSHARPENTEXFUNCSGISPROC __glewSharpenTexFuncSGIS; + +GLEW_FUN_EXPORT PFNGLTEXIMAGE4DSGISPROC __glewTexImage4DSGIS; +GLEW_FUN_EXPORT PFNGLTEXSUBIMAGE4DSGISPROC __glewTexSubImage4DSGIS; + +GLEW_FUN_EXPORT PFNGLGETTEXFILTERFUNCSGISPROC __glewGetTexFilterFuncSGIS; +GLEW_FUN_EXPORT PFNGLTEXFILTERFUNCSGISPROC __glewTexFilterFuncSGIS; + +GLEW_FUN_EXPORT PFNGLASYNCMARKERSGIXPROC __glewAsyncMarkerSGIX; +GLEW_FUN_EXPORT PFNGLDELETEASYNCMARKERSSGIXPROC __glewDeleteAsyncMarkersSGIX; +GLEW_FUN_EXPORT PFNGLFINISHASYNCSGIXPROC __glewFinishAsyncSGIX; +GLEW_FUN_EXPORT PFNGLGENASYNCMARKERSSGIXPROC __glewGenAsyncMarkersSGIX; +GLEW_FUN_EXPORT PFNGLISASYNCMARKERSGIXPROC __glewIsAsyncMarkerSGIX; +GLEW_FUN_EXPORT PFNGLPOLLASYNCSGIXPROC __glewPollAsyncSGIX; + +GLEW_FUN_EXPORT PFNGLFLUSHRASTERSGIXPROC __glewFlushRasterSGIX; + +GLEW_FUN_EXPORT PFNGLTEXTUREFOGSGIXPROC __glewTextureFogSGIX; + +GLEW_FUN_EXPORT PFNGLFRAGMENTCOLORMATERIALSGIXPROC __glewFragmentColorMaterialSGIX; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELFSGIXPROC __glewFragmentLightModelfSGIX; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELFVSGIXPROC __glewFragmentLightModelfvSGIX; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELISGIXPROC __glewFragmentLightModeliSGIX; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELIVSGIXPROC __glewFragmentLightModelivSGIX; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTFSGIXPROC __glewFragmentLightfSGIX; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTFVSGIXPROC __glewFragmentLightfvSGIX; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTISGIXPROC __glewFragmentLightiSGIX; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTIVSGIXPROC __glewFragmentLightivSGIX; +GLEW_FUN_EXPORT PFNGLFRAGMENTMATERIALFSGIXPROC __glewFragmentMaterialfSGIX; +GLEW_FUN_EXPORT PFNGLFRAGMENTMATERIALFVSGIXPROC __glewFragmentMaterialfvSGIX; +GLEW_FUN_EXPORT PFNGLFRAGMENTMATERIALISGIXPROC __glewFragmentMaterialiSGIX; +GLEW_FUN_EXPORT PFNGLFRAGMENTMATERIALIVSGIXPROC __glewFragmentMaterialivSGIX; +GLEW_FUN_EXPORT PFNGLGETFRAGMENTLIGHTFVSGIXPROC __glewGetFragmentLightfvSGIX; +GLEW_FUN_EXPORT PFNGLGETFRAGMENTLIGHTIVSGIXPROC __glewGetFragmentLightivSGIX; +GLEW_FUN_EXPORT PFNGLGETFRAGMENTMATERIALFVSGIXPROC __glewGetFragmentMaterialfvSGIX; +GLEW_FUN_EXPORT PFNGLGETFRAGMENTMATERIALIVSGIXPROC __glewGetFragmentMaterialivSGIX; + +GLEW_FUN_EXPORT PFNGLFRAMEZOOMSGIXPROC __glewFrameZoomSGIX; + +GLEW_FUN_EXPORT PFNGLPIXELTEXGENSGIXPROC __glewPixelTexGenSGIX; + +GLEW_FUN_EXPORT PFNGLREFERENCEPLANESGIXPROC __glewReferencePlaneSGIX; + +GLEW_FUN_EXPORT PFNGLSPRITEPARAMETERFSGIXPROC __glewSpriteParameterfSGIX; +GLEW_FUN_EXPORT PFNGLSPRITEPARAMETERFVSGIXPROC __glewSpriteParameterfvSGIX; +GLEW_FUN_EXPORT PFNGLSPRITEPARAMETERISGIXPROC __glewSpriteParameteriSGIX; +GLEW_FUN_EXPORT PFNGLSPRITEPARAMETERIVSGIXPROC __glewSpriteParameterivSGIX; + +GLEW_FUN_EXPORT PFNGLTAGSAMPLEBUFFERSGIXPROC __glewTagSampleBufferSGIX; + +GLEW_FUN_EXPORT PFNGLCOLORTABLEPARAMETERFVSGIPROC __glewColorTableParameterfvSGI; +GLEW_FUN_EXPORT PFNGLCOLORTABLEPARAMETERIVSGIPROC __glewColorTableParameterivSGI; +GLEW_FUN_EXPORT PFNGLCOLORTABLESGIPROC __glewColorTableSGI; +GLEW_FUN_EXPORT PFNGLCOPYCOLORTABLESGIPROC __glewCopyColorTableSGI; +GLEW_FUN_EXPORT PFNGLGETCOLORTABLEPARAMETERFVSGIPROC __glewGetColorTableParameterfvSGI; +GLEW_FUN_EXPORT PFNGLGETCOLORTABLEPARAMETERIVSGIPROC __glewGetColorTableParameterivSGI; +GLEW_FUN_EXPORT PFNGLGETCOLORTABLESGIPROC __glewGetColorTableSGI; + +GLEW_FUN_EXPORT PFNGLFINISHTEXTURESUNXPROC __glewFinishTextureSUNX; + +GLEW_FUN_EXPORT PFNGLGLOBALALPHAFACTORBSUNPROC __glewGlobalAlphaFactorbSUN; +GLEW_FUN_EXPORT PFNGLGLOBALALPHAFACTORDSUNPROC __glewGlobalAlphaFactordSUN; +GLEW_FUN_EXPORT PFNGLGLOBALALPHAFACTORFSUNPROC __glewGlobalAlphaFactorfSUN; +GLEW_FUN_EXPORT PFNGLGLOBALALPHAFACTORISUNPROC __glewGlobalAlphaFactoriSUN; +GLEW_FUN_EXPORT PFNGLGLOBALALPHAFACTORSSUNPROC __glewGlobalAlphaFactorsSUN; +GLEW_FUN_EXPORT PFNGLGLOBALALPHAFACTORUBSUNPROC __glewGlobalAlphaFactorubSUN; +GLEW_FUN_EXPORT PFNGLGLOBALALPHAFACTORUISUNPROC __glewGlobalAlphaFactoruiSUN; +GLEW_FUN_EXPORT PFNGLGLOBALALPHAFACTORUSSUNPROC __glewGlobalAlphaFactorusSUN; + +GLEW_FUN_EXPORT PFNGLREADVIDEOPIXELSSUNPROC __glewReadVideoPixelsSUN; + +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEPOINTERSUNPROC __glewReplacementCodePointerSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUBSUNPROC __glewReplacementCodeubSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUBVSUNPROC __glewReplacementCodeubvSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUISUNPROC __glewReplacementCodeuiSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUIVSUNPROC __glewReplacementCodeuivSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUSSUNPROC __glewReplacementCodeusSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUSVSUNPROC __glewReplacementCodeusvSUN; + +GLEW_FUN_EXPORT PFNGLCOLOR3FVERTEX3FSUNPROC __glewColor3fVertex3fSUN; +GLEW_FUN_EXPORT PFNGLCOLOR3FVERTEX3FVSUNPROC __glewColor3fVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLCOLOR4FNORMAL3FVERTEX3FSUNPROC __glewColor4fNormal3fVertex3fSUN; +GLEW_FUN_EXPORT PFNGLCOLOR4FNORMAL3FVERTEX3FVSUNPROC __glewColor4fNormal3fVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLCOLOR4UBVERTEX2FSUNPROC __glewColor4ubVertex2fSUN; +GLEW_FUN_EXPORT PFNGLCOLOR4UBVERTEX2FVSUNPROC __glewColor4ubVertex2fvSUN; +GLEW_FUN_EXPORT PFNGLCOLOR4UBVERTEX3FSUNPROC __glewColor4ubVertex3fSUN; +GLEW_FUN_EXPORT PFNGLCOLOR4UBVERTEX3FVSUNPROC __glewColor4ubVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLNORMAL3FVERTEX3FSUNPROC __glewNormal3fVertex3fSUN; +GLEW_FUN_EXPORT PFNGLNORMAL3FVERTEX3FVSUNPROC __glewNormal3fVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FSUNPROC __glewReplacementCodeuiColor3fVertex3fSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FVSUNPROC __glewReplacementCodeuiColor3fVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FSUNPROC __glewReplacementCodeuiColor4fNormal3fVertex3fSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FVSUNPROC __glewReplacementCodeuiColor4fNormal3fVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FSUNPROC __glewReplacementCodeuiColor4ubVertex3fSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FVSUNPROC __glewReplacementCodeuiColor4ubVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FSUNPROC __glewReplacementCodeuiNormal3fVertex3fSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FVSUNPROC __glewReplacementCodeuiNormal3fVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC __glewReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC __glewReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FSUNPROC __glewReplacementCodeuiTexCoord2fNormal3fVertex3fSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FVSUNPROC __glewReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FSUNPROC __glewReplacementCodeuiTexCoord2fVertex3fSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FVSUNPROC __glewReplacementCodeuiTexCoord2fVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUIVERTEX3FSUNPROC __glewReplacementCodeuiVertex3fSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUIVERTEX3FVSUNPROC __glewReplacementCodeuiVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD2FCOLOR3FVERTEX3FSUNPROC __glewTexCoord2fColor3fVertex3fSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD2FCOLOR3FVERTEX3FVSUNPROC __glewTexCoord2fColor3fVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC __glewTexCoord2fColor4fNormal3fVertex3fSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC __glewTexCoord2fColor4fNormal3fVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD2FCOLOR4UBVERTEX3FSUNPROC __glewTexCoord2fColor4ubVertex3fSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD2FCOLOR4UBVERTEX3FVSUNPROC __glewTexCoord2fColor4ubVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD2FNORMAL3FVERTEX3FSUNPROC __glewTexCoord2fNormal3fVertex3fSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD2FNORMAL3FVERTEX3FVSUNPROC __glewTexCoord2fNormal3fVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD2FVERTEX3FSUNPROC __glewTexCoord2fVertex3fSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD2FVERTEX3FVSUNPROC __glewTexCoord2fVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FSUNPROC __glewTexCoord4fColor4fNormal3fVertex4fSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FVSUNPROC __glewTexCoord4fColor4fNormal3fVertex4fvSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD4FVERTEX4FSUNPROC __glewTexCoord4fVertex4fSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD4FVERTEX4FVSUNPROC __glewTexCoord4fVertex4fvSUN; + +GLEW_FUN_EXPORT PFNGLADDSWAPHINTRECTWINPROC __glewAddSwapHintRectWIN; + +#if defined(GLEW_MX) && !defined(_WIN32) +struct GLEWContextStruct +{ +#endif /* GLEW_MX */ + +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_1_1; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_1_2; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_1_2_1; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_1_3; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_1_4; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_1_5; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_2_0; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_2_1; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_3_0; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_3_1; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_3_2; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_3_3; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_4_0; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_4_1; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_4_2; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_4_3; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_4_4; +GLEW_VAR_EXPORT GLboolean __GLEW_3DFX_multisample; +GLEW_VAR_EXPORT GLboolean __GLEW_3DFX_tbuffer; +GLEW_VAR_EXPORT GLboolean __GLEW_3DFX_texture_compression_FXT1; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_blend_minmax_factor; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_conservative_depth; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_debug_output; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_depth_clamp_separate; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_draw_buffers_blend; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_interleaved_elements; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_multi_draw_indirect; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_name_gen_delete; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_performance_monitor; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_pinned_memory; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_query_buffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_sample_positions; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_seamless_cubemap_per_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_shader_stencil_export; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_shader_trinary_minmax; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_sparse_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_stencil_operation_extended; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_texture_texture4; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_transform_feedback3_lines_triangles; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_vertex_shader_layer; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_vertex_shader_tessellator; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_vertex_shader_viewport_index; +GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_depth_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_framebuffer_blit; +GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_framebuffer_multisample; +GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_instanced_arrays; +GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_pack_reverse_row_order; +GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_program_binary; +GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_texture_compression_dxt1; +GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_texture_compression_dxt3; +GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_texture_compression_dxt5; +GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_texture_usage; +GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_timer_query; +GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_translated_shader_source; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_aux_depth_stencil; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_client_storage; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_element_array; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_fence; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_float_pixels; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_flush_buffer_range; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_object_purgeable; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_pixel_buffer; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_rgb_422; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_row_bytes; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_specular_vector; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_texture_range; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_transform_hint; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_vertex_array_object; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_vertex_array_range; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_vertex_program_evaluators; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_ycbcr_422; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_ES2_compatibility; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_ES3_compatibility; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_arrays_of_arrays; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_base_instance; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_bindless_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_blend_func_extended; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_buffer_storage; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_cl_event; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_clear_buffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_clear_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_color_buffer_float; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_compatibility; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_compressed_texture_pixel_storage; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_compute_shader; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_compute_variable_group_size; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_conservative_depth; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_copy_buffer; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_copy_image; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_debug_output; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_depth_buffer_float; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_depth_clamp; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_depth_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_draw_buffers; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_draw_buffers_blend; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_draw_elements_base_vertex; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_draw_indirect; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_draw_instanced; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_enhanced_layouts; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_explicit_attrib_location; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_explicit_uniform_location; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_fragment_coord_conventions; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_fragment_layer_viewport; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_fragment_program; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_fragment_program_shadow; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_fragment_shader; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_framebuffer_no_attachments; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_framebuffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_framebuffer_sRGB; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_geometry_shader4; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_get_program_binary; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_gpu_shader5; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_gpu_shader_fp64; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_half_float_pixel; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_half_float_vertex; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_imaging; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_indirect_parameters; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_instanced_arrays; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_internalformat_query; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_internalformat_query2; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_invalidate_subdata; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_map_buffer_alignment; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_map_buffer_range; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_matrix_palette; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_multi_bind; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_multi_draw_indirect; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_multisample; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_multitexture; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_occlusion_query; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_occlusion_query2; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_pixel_buffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_point_parameters; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_point_sprite; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_program_interface_query; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_provoking_vertex; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_query_buffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_robust_buffer_access_behavior; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_robustness; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_robustness_application_isolation; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_robustness_share_group_isolation; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_sample_shading; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_sampler_objects; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_seamless_cube_map; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_seamless_cubemap_per_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_separate_shader_objects; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_atomic_counters; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_bit_encoding; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_draw_parameters; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_group_vote; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_image_load_store; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_image_size; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_objects; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_precision; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_stencil_export; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_storage_buffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_subroutine; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_texture_lod; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shading_language_100; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shading_language_420pack; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shading_language_include; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shading_language_packing; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shadow; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shadow_ambient; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_sparse_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_stencil_texturing; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_sync; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_tessellation_shader; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_border_clamp; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_buffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_buffer_object_rgb32; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_buffer_range; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_compression; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_compression_bptc; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_compression_rgtc; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_cube_map; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_cube_map_array; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_env_add; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_env_combine; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_env_crossbar; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_env_dot3; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_float; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_gather; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_mirror_clamp_to_edge; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_mirrored_repeat; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_multisample; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_non_power_of_two; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_query_levels; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_query_lod; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_rectangle; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_rg; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_rgb10_a2ui; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_stencil8; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_storage; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_storage_multisample; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_swizzle; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_view; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_timer_query; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_transform_feedback2; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_transform_feedback3; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_transform_feedback_instanced; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_transpose_matrix; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_uniform_buffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_array_bgra; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_array_object; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_attrib_64bit; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_attrib_binding; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_blend; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_buffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_program; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_shader; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_type_10f_11f_11f_rev; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_type_2_10_10_10_rev; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_viewport_array; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_window_pos; +GLEW_VAR_EXPORT GLboolean __GLEW_ATIX_point_sprites; +GLEW_VAR_EXPORT GLboolean __GLEW_ATIX_texture_env_combine3; +GLEW_VAR_EXPORT GLboolean __GLEW_ATIX_texture_env_route; +GLEW_VAR_EXPORT GLboolean __GLEW_ATIX_vertex_shader_output_point_size; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_draw_buffers; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_element_array; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_envmap_bumpmap; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_fragment_shader; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_map_object_buffer; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_meminfo; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_pn_triangles; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_separate_stencil; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_shader_texture_lod; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_text_fragment_shader; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_texture_compression_3dc; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_texture_env_combine3; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_texture_float; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_texture_mirror_once; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_vertex_array_object; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_vertex_attrib_array_object; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_vertex_streams; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_422_pixels; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_Cg_shader; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_abgr; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_bgra; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_bindable_uniform; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_blend_color; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_blend_equation_separate; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_blend_func_separate; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_blend_logic_op; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_blend_minmax; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_blend_subtract; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_clip_volume_hint; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_cmyka; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_color_subtable; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_compiled_vertex_array; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_convolution; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_coordinate_frame; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_copy_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_cull_vertex; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_debug_marker; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_depth_bounds_test; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_direct_state_access; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_draw_buffers2; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_draw_instanced; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_draw_range_elements; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_fog_coord; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_fragment_lighting; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_framebuffer_blit; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_framebuffer_multisample; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_framebuffer_multisample_blit_scaled; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_framebuffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_framebuffer_sRGB; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_geometry_shader4; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_gpu_program_parameters; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_gpu_shader4; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_histogram; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_index_array_formats; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_index_func; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_index_material; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_index_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_light_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_misc_attribute; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_multi_draw_arrays; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_multisample; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_packed_depth_stencil; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_packed_float; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_packed_pixels; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_paletted_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_pixel_buffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_pixel_transform; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_pixel_transform_color_table; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_point_parameters; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_polygon_offset; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_provoking_vertex; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_rescale_normal; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_scene_marker; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_secondary_color; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_separate_shader_objects; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_separate_specular_color; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_shader_image_load_store; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_shadow_funcs; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_shared_texture_palette; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_stencil_clear_tag; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_stencil_two_side; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_stencil_wrap; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_subtexture; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture3D; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_array; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_buffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_compression_dxt1; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_compression_latc; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_compression_rgtc; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_compression_s3tc; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_cube_map; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_edge_clamp; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_env; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_env_add; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_env_combine; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_env_dot3; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_filter_anisotropic; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_integer; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_lod_bias; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_mirror_clamp; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_object; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_perturb_normal; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_rectangle; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_sRGB; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_sRGB_decode; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_shared_exponent; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_snorm; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_swizzle; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_timer_query; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_transform_feedback; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_vertex_array; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_vertex_array_bgra; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_vertex_attrib_64bit; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_vertex_shader; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_vertex_weighting; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_x11_sync_object; +GLEW_VAR_EXPORT GLboolean __GLEW_GREMEDY_frame_terminator; +GLEW_VAR_EXPORT GLboolean __GLEW_GREMEDY_string_marker; +GLEW_VAR_EXPORT GLboolean __GLEW_HP_convolution_border_modes; +GLEW_VAR_EXPORT GLboolean __GLEW_HP_image_transform; +GLEW_VAR_EXPORT GLboolean __GLEW_HP_occlusion_test; +GLEW_VAR_EXPORT GLboolean __GLEW_HP_texture_lighting; +GLEW_VAR_EXPORT GLboolean __GLEW_IBM_cull_vertex; +GLEW_VAR_EXPORT GLboolean __GLEW_IBM_multimode_draw_arrays; +GLEW_VAR_EXPORT GLboolean __GLEW_IBM_rasterpos_clip; +GLEW_VAR_EXPORT GLboolean __GLEW_IBM_static_data; +GLEW_VAR_EXPORT GLboolean __GLEW_IBM_texture_mirrored_repeat; +GLEW_VAR_EXPORT GLboolean __GLEW_IBM_vertex_array_lists; +GLEW_VAR_EXPORT GLboolean __GLEW_INGR_color_clamp; +GLEW_VAR_EXPORT GLboolean __GLEW_INGR_interlace_read; +GLEW_VAR_EXPORT GLboolean __GLEW_INTEL_map_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_INTEL_parallel_arrays; +GLEW_VAR_EXPORT GLboolean __GLEW_INTEL_texture_scissor; +GLEW_VAR_EXPORT GLboolean __GLEW_KHR_debug; +GLEW_VAR_EXPORT GLboolean __GLEW_KHR_texture_compression_astc_ldr; +GLEW_VAR_EXPORT GLboolean __GLEW_KTX_buffer_region; +GLEW_VAR_EXPORT GLboolean __GLEW_MESAX_texture_stack; +GLEW_VAR_EXPORT GLboolean __GLEW_MESA_pack_invert; +GLEW_VAR_EXPORT GLboolean __GLEW_MESA_resize_buffers; +GLEW_VAR_EXPORT GLboolean __GLEW_MESA_window_pos; +GLEW_VAR_EXPORT GLboolean __GLEW_MESA_ycbcr_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_NVX_conditional_render; +GLEW_VAR_EXPORT GLboolean __GLEW_NVX_gpu_memory_info; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_bindless_multi_draw_indirect; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_bindless_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_blend_equation_advanced; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_blend_equation_advanced_coherent; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_blend_square; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_compute_program5; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_conditional_render; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_copy_depth_to_color; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_copy_image; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_deep_texture3D; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_depth_buffer_float; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_depth_clamp; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_depth_range_unclamped; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_draw_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_evaluators; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_explicit_multisample; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_fence; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_float_buffer; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_fog_distance; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_fragment_program; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_fragment_program2; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_fragment_program4; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_fragment_program_option; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_framebuffer_multisample_coverage; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_geometry_program4; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_geometry_shader4; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_gpu_program4; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_gpu_program5; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_gpu_program5_mem_extended; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_gpu_program_fp64; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_gpu_shader5; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_half_float; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_light_max_exponent; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_multisample_coverage; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_multisample_filter_hint; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_occlusion_query; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_packed_depth_stencil; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_parameter_buffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_parameter_buffer_object2; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_path_rendering; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_pixel_data_range; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_point_sprite; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_present_video; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_primitive_restart; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_register_combiners; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_register_combiners2; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_shader_atomic_counters; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_shader_atomic_float; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_shader_buffer_load; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_shader_storage_buffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_tessellation_program5; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texgen_emboss; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texgen_reflection; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_barrier; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_compression_vtc; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_env_combine4; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_expand_normal; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_multisample; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_rectangle; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_shader; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_shader2; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_shader3; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_transform_feedback; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_transform_feedback2; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_vdpau_interop; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_array_range; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_array_range2; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_attrib_integer_64bit; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_buffer_unified_memory; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_program; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_program1_1; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_program2; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_program2_option; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_program3; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_program4; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_video_capture; +GLEW_VAR_EXPORT GLboolean __GLEW_OES_byte_coordinates; +GLEW_VAR_EXPORT GLboolean __GLEW_OES_compressed_paletted_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_OES_read_format; +GLEW_VAR_EXPORT GLboolean __GLEW_OES_single_precision; +GLEW_VAR_EXPORT GLboolean __GLEW_OML_interlace; +GLEW_VAR_EXPORT GLboolean __GLEW_OML_resample; +GLEW_VAR_EXPORT GLboolean __GLEW_OML_subsample; +GLEW_VAR_EXPORT GLboolean __GLEW_PGI_misc_hints; +GLEW_VAR_EXPORT GLboolean __GLEW_PGI_vertex_hints; +GLEW_VAR_EXPORT GLboolean __GLEW_REGAL_ES1_0_compatibility; +GLEW_VAR_EXPORT GLboolean __GLEW_REGAL_ES1_1_compatibility; +GLEW_VAR_EXPORT GLboolean __GLEW_REGAL_enable; +GLEW_VAR_EXPORT GLboolean __GLEW_REGAL_error_string; +GLEW_VAR_EXPORT GLboolean __GLEW_REGAL_extension_query; +GLEW_VAR_EXPORT GLboolean __GLEW_REGAL_log; +GLEW_VAR_EXPORT GLboolean __GLEW_REND_screen_coordinates; +GLEW_VAR_EXPORT GLboolean __GLEW_S3_s3tc; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_color_range; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_detail_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_fog_function; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_generate_mipmap; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_multisample; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_pixel_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_point_line_texgen; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_sharpen_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_texture4D; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_texture_border_clamp; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_texture_edge_clamp; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_texture_filter4; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_texture_lod; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_texture_select; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_async; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_async_histogram; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_async_pixel; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_blend_alpha_minmax; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_clipmap; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_convolution_accuracy; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_depth_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_flush_raster; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_fog_offset; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_fog_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_fragment_specular_lighting; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_framezoom; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_interlace; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_ir_instrument1; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_list_priority; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_pixel_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_pixel_texture_bits; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_reference_plane; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_resample; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_shadow; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_shadow_ambient; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_sprite; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_tag_sample_buffer; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_texture_add_env; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_texture_coordinate_clamp; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_texture_lod_bias; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_texture_multi_buffer; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_texture_range; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_texture_scale_bias; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_vertex_preclip; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_vertex_preclip_hint; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_ycrcb; +GLEW_VAR_EXPORT GLboolean __GLEW_SGI_color_matrix; +GLEW_VAR_EXPORT GLboolean __GLEW_SGI_color_table; +GLEW_VAR_EXPORT GLboolean __GLEW_SGI_texture_color_table; +GLEW_VAR_EXPORT GLboolean __GLEW_SUNX_constant_data; +GLEW_VAR_EXPORT GLboolean __GLEW_SUN_convolution_border_modes; +GLEW_VAR_EXPORT GLboolean __GLEW_SUN_global_alpha; +GLEW_VAR_EXPORT GLboolean __GLEW_SUN_mesh_array; +GLEW_VAR_EXPORT GLboolean __GLEW_SUN_read_video_pixels; +GLEW_VAR_EXPORT GLboolean __GLEW_SUN_slice_accum; +GLEW_VAR_EXPORT GLboolean __GLEW_SUN_triangle_list; +GLEW_VAR_EXPORT GLboolean __GLEW_SUN_vertex; +GLEW_VAR_EXPORT GLboolean __GLEW_WIN_phong_shading; +GLEW_VAR_EXPORT GLboolean __GLEW_WIN_specular_fog; +GLEW_VAR_EXPORT GLboolean __GLEW_WIN_swap_hint; + +#ifdef GLEW_MX +}; /* GLEWContextStruct */ +#endif /* GLEW_MX */ + +/* ------------------------------------------------------------------------- */ + +/* error codes */ +#define GLEW_OK 0 +#define GLEW_NO_ERROR 0 +#define GLEW_ERROR_NO_GL_VERSION 1 /* missing GL version */ +#define GLEW_ERROR_GL_VERSION_10_ONLY 2 /* Need at least OpenGL 1.1 */ +#define GLEW_ERROR_GLX_VERSION_11_ONLY 3 /* Need at least GLX 1.2 */ + +/* string codes */ +#define GLEW_VERSION 1 +#define GLEW_VERSION_MAJOR 2 +#define GLEW_VERSION_MINOR 3 +#define GLEW_VERSION_MICRO 4 + +/* API */ +#ifdef GLEW_MX + +typedef struct GLEWContextStruct GLEWContext; +GLEWAPI GLenum GLEWAPIENTRY glewContextInit (GLEWContext *ctx); +GLEWAPI GLboolean GLEWAPIENTRY glewContextIsSupported (const GLEWContext *ctx, const char *name); + +#define glewInit() glewContextInit(glewGetContext()) +#define glewIsSupported(x) glewContextIsSupported(glewGetContext(), x) +#define glewIsExtensionSupported(x) glewIsSupported(x) + +#define GLEW_GET_VAR(x) (*(const GLboolean*)&(glewGetContext()->x)) +#ifdef _WIN32 +# define GLEW_GET_FUN(x) glewGetContext()->x +#else +# define GLEW_GET_FUN(x) x +#endif + +#else /* GLEW_MX */ + +GLEWAPI GLenum GLEWAPIENTRY glewInit (void); +GLEWAPI GLboolean GLEWAPIENTRY glewIsSupported (const char *name); +#define glewIsExtensionSupported(x) glewIsSupported(x) + +#define GLEW_GET_VAR(x) (*(const GLboolean*)&x) +#define GLEW_GET_FUN(x) x + +#endif /* GLEW_MX */ + +GLEWAPI GLboolean glewExperimental; +GLEWAPI GLboolean GLEWAPIENTRY glewGetExtension (const char *name); +GLEWAPI const GLubyte * GLEWAPIENTRY glewGetErrorString (GLenum error); +GLEWAPI const GLubyte * GLEWAPIENTRY glewGetString (GLenum name); + +#ifdef __cplusplus +} +#endif + +#ifdef GLEW_APIENTRY_DEFINED +#undef GLEW_APIENTRY_DEFINED +#undef APIENTRY +#undef GLAPIENTRY +#define GLAPIENTRY +#endif + +#ifdef GLEW_CALLBACK_DEFINED +#undef GLEW_CALLBACK_DEFINED +#undef CALLBACK +#endif + +#ifdef GLEW_WINGDIAPI_DEFINED +#undef GLEW_WINGDIAPI_DEFINED +#undef WINGDIAPI +#endif + +#undef GLAPI +/* #undef GLEWAPI */ + +#endif /* __glew_h__ */ diff --git a/external/Chipmunk/xcode/libglfw/COPYING.txt b/external/Chipmunk/xcode/libglfw/COPYING.txt new file mode 100644 index 0000000..65bd25b --- /dev/null +++ b/external/Chipmunk/xcode/libglfw/COPYING.txt @@ -0,0 +1,22 @@ +Copyright (c) 2002-2006 Marcus Geelnard +Copyright (c) 2006-2010 Camilla Berglund + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would + be appreciated but is not required. + +2. Altered source versions must be plainly marked as such, and must not + be misrepresented as being the original software. + +3. This notice may not be removed or altered from any source + distribution. + diff --git a/external/Chipmunk/xcode/libglfw/include/GL/glfw.h b/external/Chipmunk/xcode/libglfw/include/GL/glfw.h new file mode 100644 index 0000000..4a27bda --- /dev/null +++ b/external/Chipmunk/xcode/libglfw/include/GL/glfw.h @@ -0,0 +1,518 @@ +/************************************************************************ + * GLFW - An OpenGL framework + * API version: 2.7 + * WWW: http://www.glfw.org/ + *------------------------------------------------------------------------ + * Copyright (c) 2002-2006 Marcus Geelnard + * Copyright (c) 2006-2010 Camilla Berglund + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would + * be appreciated but is not required. + * + * 2. Altered source versions must be plainly marked as such, and must not + * be misrepresented as being the original software. + * + * 3. This notice may not be removed or altered from any source + * distribution. + * + *************************************************************************/ + +#ifndef __glfw_h_ +#define __glfw_h_ + +#ifdef __cplusplus +extern "C" { +#endif + + +/************************************************************************* + * Global definitions + *************************************************************************/ + +/* We need a NULL pointer from time to time */ +#ifndef NULL + #ifdef __cplusplus + #define NULL 0 + #else + #define NULL ((void *)0) + #endif +#endif /* NULL */ + + +/* ------------------- BEGIN SYSTEM/COMPILER SPECIFIC -------------------- */ + +/* Please report any probles that you find with your compiler, which may + * be solved in this section! There are several compilers that I have not + * been able to test this file with yet. + * + * First: If we are we on Windows, we want a single define for it (_WIN32) + * (Note: For Cygwin the compiler flag -mwin32 should be used, but to + * make sure that things run smoothly for Cygwin users, we add __CYGWIN__ + * to the list of "valid Win32 identifiers", which removes the need for + * -mwin32) + */ +#if !defined(_WIN32) && (defined(__WIN32__) || defined(WIN32) || defined(__CYGWIN__)) + #define _WIN32 +#endif /* _WIN32 */ + +/* In order for extension support to be portable, we need to define an + * OpenGL function call method. We use the keyword APIENTRY, which is + * defined for Win32. (Note: Windows also needs this for ) + */ +#ifndef APIENTRY + #ifdef _WIN32 + #define APIENTRY __stdcall + #else + #define APIENTRY + #endif + #define GL_APIENTRY_DEFINED +#endif /* APIENTRY */ + + +/* The following three defines are here solely to make some Windows-based + * files happy. Theoretically we could include , but + * it has the major drawback of severely polluting our namespace. + */ + +/* Under Windows, we need WINGDIAPI defined */ +#if !defined(WINGDIAPI) && defined(_WIN32) + #if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__POCC__) + /* Microsoft Visual C++, Borland C++ Builder and Pelles C */ + #define WINGDIAPI __declspec(dllimport) + #elif defined(__LCC__) + /* LCC-Win32 */ + #define WINGDIAPI __stdcall + #else + /* Others (e.g. MinGW, Cygwin) */ + #define WINGDIAPI extern + #endif + #define GL_WINGDIAPI_DEFINED +#endif /* WINGDIAPI */ + +/* Some files also need CALLBACK defined */ +#if !defined(CALLBACK) && defined(_WIN32) + #if defined(_MSC_VER) + /* Microsoft Visual C++ */ + #if (defined(_M_MRX000) || defined(_M_IX86) || defined(_M_ALPHA) || defined(_M_PPC)) && !defined(MIDL_PASS) + #define CALLBACK __stdcall + #else + #define CALLBACK + #endif + #else + /* Other Windows compilers */ + #define CALLBACK __stdcall + #endif + #define GLU_CALLBACK_DEFINED +#endif /* CALLBACK */ + +/* Microsoft Visual C++, Borland C++ and Pelles C needs wchar_t */ +#if defined(_WIN32) && (defined(_MSC_VER) || defined(__BORLANDC__) || defined(__POCC__)) && !defined(_WCHAR_T_DEFINED) + typedef unsigned short wchar_t; + #define _WCHAR_T_DEFINED +#endif /* _WCHAR_T_DEFINED */ + + +/* ---------------- GLFW related system specific defines ----------------- */ + +#if defined(_WIN32) && defined(GLFW_BUILD_DLL) + + /* We are building a Win32 DLL */ + #define GLFWAPI __declspec(dllexport) + #define GLFWAPIENTRY __stdcall + #define GLFWCALL __stdcall + +#elif defined(_WIN32) && defined(GLFW_DLL) + + /* We are calling a Win32 DLL */ + #if defined(__LCC__) + #define GLFWAPI extern + #else + #define GLFWAPI __declspec(dllimport) + #endif + #define GLFWAPIENTRY __stdcall + #define GLFWCALL __stdcall + +#else + + /* We are either building/calling a static lib or we are non-win32 */ + #define GLFWAPIENTRY + #define GLFWAPI + #define GLFWCALL + +#endif + +/* -------------------- END SYSTEM/COMPILER SPECIFIC --------------------- */ + +/* Include standard OpenGL headers: GLFW uses GL_FALSE/GL_TRUE, and it is + * convenient for the user to only have to include . This also + * solves the problem with Windows and needing some + * special defines which normally requires the user to include + * (which is not a nice solution for portable programs). + */ +#if defined(__APPLE_CC__) + #if defined(GLFW_INCLUDE_GL3) + #include + #else + #define GL_GLEXT_LEGACY + #include + #endif + #ifndef GLFW_NO_GLU + #include + #endif +#else + #if defined(GLFW_INCLUDE_GL3) + #include + #else + #include + #endif + #ifndef GLFW_NO_GLU + #include + #endif +#endif + + +/************************************************************************* + * GLFW version + *************************************************************************/ + +#define GLFW_VERSION_MAJOR 2 +#define GLFW_VERSION_MINOR 7 +#define GLFW_VERSION_REVISION 6 + + +/************************************************************************* + * Input handling definitions + *************************************************************************/ + +/* Key and button state/action definitions */ +#define GLFW_RELEASE 0 +#define GLFW_PRESS 1 + +/* Keyboard key definitions: 8-bit ISO-8859-1 (Latin 1) encoding is used + * for printable keys (such as A-Z, 0-9 etc), and values above 256 + * represent special (non-printable) keys (e.g. F1, Page Up etc). + */ +#define GLFW_KEY_UNKNOWN -1 +#define GLFW_KEY_SPACE 32 +#define GLFW_KEY_SPECIAL 256 +#define GLFW_KEY_ESC (GLFW_KEY_SPECIAL+1) +#define GLFW_KEY_F1 (GLFW_KEY_SPECIAL+2) +#define GLFW_KEY_F2 (GLFW_KEY_SPECIAL+3) +#define GLFW_KEY_F3 (GLFW_KEY_SPECIAL+4) +#define GLFW_KEY_F4 (GLFW_KEY_SPECIAL+5) +#define GLFW_KEY_F5 (GLFW_KEY_SPECIAL+6) +#define GLFW_KEY_F6 (GLFW_KEY_SPECIAL+7) +#define GLFW_KEY_F7 (GLFW_KEY_SPECIAL+8) +#define GLFW_KEY_F8 (GLFW_KEY_SPECIAL+9) +#define GLFW_KEY_F9 (GLFW_KEY_SPECIAL+10) +#define GLFW_KEY_F10 (GLFW_KEY_SPECIAL+11) +#define GLFW_KEY_F11 (GLFW_KEY_SPECIAL+12) +#define GLFW_KEY_F12 (GLFW_KEY_SPECIAL+13) +#define GLFW_KEY_F13 (GLFW_KEY_SPECIAL+14) +#define GLFW_KEY_F14 (GLFW_KEY_SPECIAL+15) +#define GLFW_KEY_F15 (GLFW_KEY_SPECIAL+16) +#define GLFW_KEY_F16 (GLFW_KEY_SPECIAL+17) +#define GLFW_KEY_F17 (GLFW_KEY_SPECIAL+18) +#define GLFW_KEY_F18 (GLFW_KEY_SPECIAL+19) +#define GLFW_KEY_F19 (GLFW_KEY_SPECIAL+20) +#define GLFW_KEY_F20 (GLFW_KEY_SPECIAL+21) +#define GLFW_KEY_F21 (GLFW_KEY_SPECIAL+22) +#define GLFW_KEY_F22 (GLFW_KEY_SPECIAL+23) +#define GLFW_KEY_F23 (GLFW_KEY_SPECIAL+24) +#define GLFW_KEY_F24 (GLFW_KEY_SPECIAL+25) +#define GLFW_KEY_F25 (GLFW_KEY_SPECIAL+26) +#define GLFW_KEY_UP (GLFW_KEY_SPECIAL+27) +#define GLFW_KEY_DOWN (GLFW_KEY_SPECIAL+28) +#define GLFW_KEY_LEFT (GLFW_KEY_SPECIAL+29) +#define GLFW_KEY_RIGHT (GLFW_KEY_SPECIAL+30) +#define GLFW_KEY_LSHIFT (GLFW_KEY_SPECIAL+31) +#define GLFW_KEY_RSHIFT (GLFW_KEY_SPECIAL+32) +#define GLFW_KEY_LCTRL (GLFW_KEY_SPECIAL+33) +#define GLFW_KEY_RCTRL (GLFW_KEY_SPECIAL+34) +#define GLFW_KEY_LALT (GLFW_KEY_SPECIAL+35) +#define GLFW_KEY_RALT (GLFW_KEY_SPECIAL+36) +#define GLFW_KEY_TAB (GLFW_KEY_SPECIAL+37) +#define GLFW_KEY_ENTER (GLFW_KEY_SPECIAL+38) +#define GLFW_KEY_BACKSPACE (GLFW_KEY_SPECIAL+39) +#define GLFW_KEY_INSERT (GLFW_KEY_SPECIAL+40) +#define GLFW_KEY_DEL (GLFW_KEY_SPECIAL+41) +#define GLFW_KEY_PAGEUP (GLFW_KEY_SPECIAL+42) +#define GLFW_KEY_PAGEDOWN (GLFW_KEY_SPECIAL+43) +#define GLFW_KEY_HOME (GLFW_KEY_SPECIAL+44) +#define GLFW_KEY_END (GLFW_KEY_SPECIAL+45) +#define GLFW_KEY_KP_0 (GLFW_KEY_SPECIAL+46) +#define GLFW_KEY_KP_1 (GLFW_KEY_SPECIAL+47) +#define GLFW_KEY_KP_2 (GLFW_KEY_SPECIAL+48) +#define GLFW_KEY_KP_3 (GLFW_KEY_SPECIAL+49) +#define GLFW_KEY_KP_4 (GLFW_KEY_SPECIAL+50) +#define GLFW_KEY_KP_5 (GLFW_KEY_SPECIAL+51) +#define GLFW_KEY_KP_6 (GLFW_KEY_SPECIAL+52) +#define GLFW_KEY_KP_7 (GLFW_KEY_SPECIAL+53) +#define GLFW_KEY_KP_8 (GLFW_KEY_SPECIAL+54) +#define GLFW_KEY_KP_9 (GLFW_KEY_SPECIAL+55) +#define GLFW_KEY_KP_DIVIDE (GLFW_KEY_SPECIAL+56) +#define GLFW_KEY_KP_MULTIPLY (GLFW_KEY_SPECIAL+57) +#define GLFW_KEY_KP_SUBTRACT (GLFW_KEY_SPECIAL+58) +#define GLFW_KEY_KP_ADD (GLFW_KEY_SPECIAL+59) +#define GLFW_KEY_KP_DECIMAL (GLFW_KEY_SPECIAL+60) +#define GLFW_KEY_KP_EQUAL (GLFW_KEY_SPECIAL+61) +#define GLFW_KEY_KP_ENTER (GLFW_KEY_SPECIAL+62) +#define GLFW_KEY_KP_NUM_LOCK (GLFW_KEY_SPECIAL+63) +#define GLFW_KEY_CAPS_LOCK (GLFW_KEY_SPECIAL+64) +#define GLFW_KEY_SCROLL_LOCK (GLFW_KEY_SPECIAL+65) +#define GLFW_KEY_PAUSE (GLFW_KEY_SPECIAL+66) +#define GLFW_KEY_LSUPER (GLFW_KEY_SPECIAL+67) +#define GLFW_KEY_RSUPER (GLFW_KEY_SPECIAL+68) +#define GLFW_KEY_MENU (GLFW_KEY_SPECIAL+69) +#define GLFW_KEY_LAST GLFW_KEY_MENU + +/* Mouse button definitions */ +#define GLFW_MOUSE_BUTTON_1 0 +#define GLFW_MOUSE_BUTTON_2 1 +#define GLFW_MOUSE_BUTTON_3 2 +#define GLFW_MOUSE_BUTTON_4 3 +#define GLFW_MOUSE_BUTTON_5 4 +#define GLFW_MOUSE_BUTTON_6 5 +#define GLFW_MOUSE_BUTTON_7 6 +#define GLFW_MOUSE_BUTTON_8 7 +#define GLFW_MOUSE_BUTTON_LAST GLFW_MOUSE_BUTTON_8 + +/* Mouse button aliases */ +#define GLFW_MOUSE_BUTTON_LEFT GLFW_MOUSE_BUTTON_1 +#define GLFW_MOUSE_BUTTON_RIGHT GLFW_MOUSE_BUTTON_2 +#define GLFW_MOUSE_BUTTON_MIDDLE GLFW_MOUSE_BUTTON_3 + + +/* Joystick identifiers */ +#define GLFW_JOYSTICK_1 0 +#define GLFW_JOYSTICK_2 1 +#define GLFW_JOYSTICK_3 2 +#define GLFW_JOYSTICK_4 3 +#define GLFW_JOYSTICK_5 4 +#define GLFW_JOYSTICK_6 5 +#define GLFW_JOYSTICK_7 6 +#define GLFW_JOYSTICK_8 7 +#define GLFW_JOYSTICK_9 8 +#define GLFW_JOYSTICK_10 9 +#define GLFW_JOYSTICK_11 10 +#define GLFW_JOYSTICK_12 11 +#define GLFW_JOYSTICK_13 12 +#define GLFW_JOYSTICK_14 13 +#define GLFW_JOYSTICK_15 14 +#define GLFW_JOYSTICK_16 15 +#define GLFW_JOYSTICK_LAST GLFW_JOYSTICK_16 + + +/************************************************************************* + * Other definitions + *************************************************************************/ + +/* glfwOpenWindow modes */ +#define GLFW_WINDOW 0x00010001 +#define GLFW_FULLSCREEN 0x00010002 + +/* glfwGetWindowParam tokens */ +#define GLFW_OPENED 0x00020001 +#define GLFW_ACTIVE 0x00020002 +#define GLFW_ICONIFIED 0x00020003 +#define GLFW_ACCELERATED 0x00020004 +#define GLFW_RED_BITS 0x00020005 +#define GLFW_GREEN_BITS 0x00020006 +#define GLFW_BLUE_BITS 0x00020007 +#define GLFW_ALPHA_BITS 0x00020008 +#define GLFW_DEPTH_BITS 0x00020009 +#define GLFW_STENCIL_BITS 0x0002000A + +/* The following constants are used for both glfwGetWindowParam + * and glfwOpenWindowHint + */ +#define GLFW_REFRESH_RATE 0x0002000B +#define GLFW_ACCUM_RED_BITS 0x0002000C +#define GLFW_ACCUM_GREEN_BITS 0x0002000D +#define GLFW_ACCUM_BLUE_BITS 0x0002000E +#define GLFW_ACCUM_ALPHA_BITS 0x0002000F +#define GLFW_AUX_BUFFERS 0x00020010 +#define GLFW_STEREO 0x00020011 +#define GLFW_WINDOW_NO_RESIZE 0x00020012 +#define GLFW_FSAA_SAMPLES 0x00020013 +#define GLFW_OPENGL_VERSION_MAJOR 0x00020014 +#define GLFW_OPENGL_VERSION_MINOR 0x00020015 +#define GLFW_OPENGL_FORWARD_COMPAT 0x00020016 +#define GLFW_OPENGL_DEBUG_CONTEXT 0x00020017 +#define GLFW_OPENGL_PROFILE 0x00020018 + +/* GLFW_OPENGL_PROFILE tokens */ +#define GLFW_OPENGL_CORE_PROFILE 0x00050001 +#define GLFW_OPENGL_COMPAT_PROFILE 0x00050002 + +/* glfwEnable/glfwDisable tokens */ +#define GLFW_MOUSE_CURSOR 0x00030001 +#define GLFW_STICKY_KEYS 0x00030002 +#define GLFW_STICKY_MOUSE_BUTTONS 0x00030003 +#define GLFW_SYSTEM_KEYS 0x00030004 +#define GLFW_KEY_REPEAT 0x00030005 +#define GLFW_AUTO_POLL_EVENTS 0x00030006 + +/* glfwWaitThread wait modes */ +#define GLFW_WAIT 0x00040001 +#define GLFW_NOWAIT 0x00040002 + +/* glfwGetJoystickParam tokens */ +#define GLFW_PRESENT 0x00050001 +#define GLFW_AXES 0x00050002 +#define GLFW_BUTTONS 0x00050003 + +/* glfwReadImage/glfwLoadTexture2D flags */ +#define GLFW_NO_RESCALE_BIT 0x00000001 /* Only for glfwReadImage */ +#define GLFW_ORIGIN_UL_BIT 0x00000002 +#define GLFW_BUILD_MIPMAPS_BIT 0x00000004 /* Only for glfwLoadTexture2D */ +#define GLFW_ALPHA_MAP_BIT 0x00000008 + +/* Time spans longer than this (seconds) are considered to be infinity */ +#define GLFW_INFINITY 100000.0 + + +/************************************************************************* + * Typedefs + *************************************************************************/ + +/* The video mode structure used by glfwGetVideoModes() */ +typedef struct { + int Width, Height; + int RedBits, BlueBits, GreenBits; +} GLFWvidmode; + +/* Image/texture information */ +typedef struct { + int Width, Height; + int Format; + int BytesPerPixel; + unsigned char *Data; +} GLFWimage; + +/* Thread ID */ +typedef int GLFWthread; + +/* Mutex object */ +typedef void * GLFWmutex; + +/* Condition variable object */ +typedef void * GLFWcond; + +/* Function pointer types */ +typedef void (GLFWCALL * GLFWwindowsizefun)(int,int); +typedef int (GLFWCALL * GLFWwindowclosefun)(void); +typedef void (GLFWCALL * GLFWwindowrefreshfun)(void); +typedef void (GLFWCALL * GLFWmousebuttonfun)(int,int); +typedef void (GLFWCALL * GLFWmouseposfun)(int,int); +typedef void (GLFWCALL * GLFWmousewheelfun)(int); +typedef void (GLFWCALL * GLFWkeyfun)(int,int); +typedef void (GLFWCALL * GLFWcharfun)(int,int); +typedef void (GLFWCALL * GLFWthreadfun)(void *); + + +/************************************************************************* + * Prototypes + *************************************************************************/ + +/* GLFW initialization, termination and version querying */ +GLFWAPI int GLFWAPIENTRY glfwInit( void ); +GLFWAPI void GLFWAPIENTRY glfwTerminate( void ); +GLFWAPI void GLFWAPIENTRY glfwGetVersion( int *major, int *minor, int *rev ); + +/* Window handling */ +GLFWAPI int GLFWAPIENTRY glfwOpenWindow( int width, int height, int redbits, int greenbits, int bluebits, int alphabits, int depthbits, int stencilbits, int mode ); +GLFWAPI void GLFWAPIENTRY glfwOpenWindowHint( int target, int hint ); +GLFWAPI void GLFWAPIENTRY glfwCloseWindow( void ); +GLFWAPI void GLFWAPIENTRY glfwSetWindowTitle( const char *title ); +GLFWAPI void GLFWAPIENTRY glfwGetWindowSize( int *width, int *height ); +GLFWAPI void GLFWAPIENTRY glfwSetWindowSize( int width, int height ); +GLFWAPI void GLFWAPIENTRY glfwSetWindowPos( int x, int y ); +GLFWAPI void GLFWAPIENTRY glfwIconifyWindow( void ); +GLFWAPI void GLFWAPIENTRY glfwRestoreWindow( void ); +GLFWAPI void GLFWAPIENTRY glfwSwapBuffers( void ); +GLFWAPI void GLFWAPIENTRY glfwSwapInterval( int interval ); +GLFWAPI int GLFWAPIENTRY glfwGetWindowParam( int param ); +GLFWAPI void GLFWAPIENTRY glfwSetWindowSizeCallback( GLFWwindowsizefun cbfun ); +GLFWAPI void GLFWAPIENTRY glfwSetWindowCloseCallback( GLFWwindowclosefun cbfun ); +GLFWAPI void GLFWAPIENTRY glfwSetWindowRefreshCallback( GLFWwindowrefreshfun cbfun ); + +/* Video mode functions */ +GLFWAPI int GLFWAPIENTRY glfwGetVideoModes( GLFWvidmode *list, int maxcount ); +GLFWAPI void GLFWAPIENTRY glfwGetDesktopMode( GLFWvidmode *mode ); + +/* Input handling */ +GLFWAPI void GLFWAPIENTRY glfwPollEvents( void ); +GLFWAPI void GLFWAPIENTRY glfwWaitEvents( void ); +GLFWAPI int GLFWAPIENTRY glfwGetKey( int key ); +GLFWAPI int GLFWAPIENTRY glfwGetMouseButton( int button ); +GLFWAPI void GLFWAPIENTRY glfwGetMousePos( int *xpos, int *ypos ); +GLFWAPI void GLFWAPIENTRY glfwSetMousePos( int xpos, int ypos ); +GLFWAPI int GLFWAPIENTRY glfwGetMouseWheel( void ); +GLFWAPI void GLFWAPIENTRY glfwSetMouseWheel( int pos ); +GLFWAPI void GLFWAPIENTRY glfwSetKeyCallback( GLFWkeyfun cbfun ); +GLFWAPI void GLFWAPIENTRY glfwSetCharCallback( GLFWcharfun cbfun ); +GLFWAPI void GLFWAPIENTRY glfwSetMouseButtonCallback( GLFWmousebuttonfun cbfun ); +GLFWAPI void GLFWAPIENTRY glfwSetMousePosCallback( GLFWmouseposfun cbfun ); +GLFWAPI void GLFWAPIENTRY glfwSetMouseWheelCallback( GLFWmousewheelfun cbfun ); + +/* Joystick input */ +GLFWAPI int GLFWAPIENTRY glfwGetJoystickParam( int joy, int param ); +GLFWAPI int GLFWAPIENTRY glfwGetJoystickPos( int joy, float *pos, int numaxes ); +GLFWAPI int GLFWAPIENTRY glfwGetJoystickButtons( int joy, unsigned char *buttons, int numbuttons ); + +/* Time */ +GLFWAPI double GLFWAPIENTRY glfwGetTime( void ); +GLFWAPI void GLFWAPIENTRY glfwSetTime( double time ); +GLFWAPI void GLFWAPIENTRY glfwSleep( double time ); + +/* Extension support */ +GLFWAPI int GLFWAPIENTRY glfwExtensionSupported( const char *extension ); +GLFWAPI void* GLFWAPIENTRY glfwGetProcAddress( const char *procname ); +GLFWAPI void GLFWAPIENTRY glfwGetGLVersion( int *major, int *minor, int *rev ); + +/* Threading support */ +GLFWAPI GLFWthread GLFWAPIENTRY glfwCreateThread( GLFWthreadfun fun, void *arg ); +GLFWAPI void GLFWAPIENTRY glfwDestroyThread( GLFWthread ID ); +GLFWAPI int GLFWAPIENTRY glfwWaitThread( GLFWthread ID, int waitmode ); +GLFWAPI GLFWthread GLFWAPIENTRY glfwGetThreadID( void ); +GLFWAPI GLFWmutex GLFWAPIENTRY glfwCreateMutex( void ); +GLFWAPI void GLFWAPIENTRY glfwDestroyMutex( GLFWmutex mutex ); +GLFWAPI void GLFWAPIENTRY glfwLockMutex( GLFWmutex mutex ); +GLFWAPI void GLFWAPIENTRY glfwUnlockMutex( GLFWmutex mutex ); +GLFWAPI GLFWcond GLFWAPIENTRY glfwCreateCond( void ); +GLFWAPI void GLFWAPIENTRY glfwDestroyCond( GLFWcond cond ); +GLFWAPI void GLFWAPIENTRY glfwWaitCond( GLFWcond cond, GLFWmutex mutex, double timeout ); +GLFWAPI void GLFWAPIENTRY glfwSignalCond( GLFWcond cond ); +GLFWAPI void GLFWAPIENTRY glfwBroadcastCond( GLFWcond cond ); +GLFWAPI int GLFWAPIENTRY glfwGetNumberOfProcessors( void ); + +/* Enable/disable functions */ +GLFWAPI void GLFWAPIENTRY glfwEnable( int token ); +GLFWAPI void GLFWAPIENTRY glfwDisable( int token ); + +/* Image/texture I/O support */ +GLFWAPI int GLFWAPIENTRY glfwReadImage( const char *name, GLFWimage *img, int flags ); +GLFWAPI int GLFWAPIENTRY glfwReadMemoryImage( const void *data, long size, GLFWimage *img, int flags ); +GLFWAPI void GLFWAPIENTRY glfwFreeImage( GLFWimage *img ); +GLFWAPI int GLFWAPIENTRY glfwLoadTexture2D( const char *name, int flags ); +GLFWAPI int GLFWAPIENTRY glfwLoadMemoryTexture2D( const void *data, long size, int flags ); +GLFWAPI int GLFWAPIENTRY glfwLoadTextureImage2D( GLFWimage *img, int flags ); + + +#ifdef __cplusplus +} +#endif + +#endif /* __glfw_h_ */ + diff --git a/external/Chipmunk/xcode/macstatic.command b/external/Chipmunk/xcode/macstatic.command new file mode 100755 index 0000000..3e20c93 --- /dev/null +++ b/external/Chipmunk/xcode/macstatic.command @@ -0,0 +1,44 @@ +#! /usr/bin/ruby + +Dir.chdir(File.dirname($0)) + +require 'Tempfile' +BUILD_LOG = Tempfile.new("Chipmunk-") +BUILD_LOG_PATH = BUILD_LOG.path + +def log(string) + puts string + open(BUILD_LOG_PATH, 'a'){|f| f.puts string} +end + +VERBOSE = (not ARGV.include?("--quiet")) + +def system(command) + log "> #{command}" + + result = Kernel.system(VERBOSE ? "#{command} | tee -a #{BUILD_LOG_PATH}; exit ${PIPESTATUS[0]}" : "#{command} >> #{BUILD_LOG_PATH}") + unless $? == 0 + log "===========================================" + log "Command failed with status #{$?}: #{command}" + log "Build errors encountered. Aborting build script" + log "Check the build log for more information: #{BUILD_LOG_PATH}" + raise + end +end + +OUTPUT_DIR_NAME = "Chipmunk-Mac" +system "rm -rf #{OUTPUT_DIR_NAME}" +system "mkdir #{OUTPUT_DIR_NAME}" + +system "xcodebuild -project Chipmunk7.xcodeproj -configuration Release -target ChipmunkStatic" +system "xcodebuild -project Chipmunk7.xcodeproj -configuration Debug -target ChipmunkStatic" + +system "cp build/Debug/libChipmunk.a #{OUTPUT_DIR_NAME}/libChipmunk-Debug.a" +system "cp build/Release/libChipmunk.a #{OUTPUT_DIR_NAME}/libChipmunk.a" + +system "rsync -r --exclude='.*' ../include/chipmunk/ #{OUTPUT_DIR_NAME}" +system "open #{OUTPUT_DIR_NAME}" + +puts "Copy #{OUTPUT_DIR_NAME} into your project and enjoy." + +BUILD_LOG.delete diff --git a/external/Chipmunk/xcode/main-Info.plist b/external/Chipmunk/xcode/main-Info.plist new file mode 100644 index 0000000..504d504 --- /dev/null +++ b/external/Chipmunk/xcode/main-Info.plist @@ -0,0 +1,24 @@ + + + + + CFBundleDevelopmentRegion + English + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + com.yourcompany.main + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + APPL + CFBundleSignature + ???? + CFBundleVersion + 1.0 + NSMainNibFile + MainMenu + NSPrincipalClass + NSApplication + + diff --git a/external/kazmath/include/kazmath/GL/mat4stack.h b/external/kazmath/include/kazmath/GL/mat4stack.h new file mode 100644 index 0000000..7de12aa --- /dev/null +++ b/external/kazmath/include/kazmath/GL/mat4stack.h @@ -0,0 +1,51 @@ +/* +Copyright (c) 2008, Luke Benstead. +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#ifndef C_STACK_H_INCLUDED +#define C_STACK_H_INCLUDED + +#include "../mat4.h" + +typedef struct km_mat4_stack { + int capacity; //The total item capacity + int item_count; //The number of items + kmMat4* top; + kmMat4* stack; +} km_mat4_stack; + +#ifdef __cplusplus +extern "C" { +#endif + +void km_mat4_stack_initialize(km_mat4_stack* stack); +void km_mat4_stack_push(km_mat4_stack* stack, const kmMat4* item); +void km_mat4_stack_pop(km_mat4_stack* stack, kmMat4* pOut); +void km_mat4_stack_release(km_mat4_stack* stack); + +#ifdef __cplusplus +} +#endif + +#endif // C_STACK_H_INCLUDED diff --git a/external/kazmath/include/kazmath/GL/matrix.h b/external/kazmath/include/kazmath/GL/matrix.h new file mode 100644 index 0000000..1fa0267 --- /dev/null +++ b/external/kazmath/include/kazmath/GL/matrix.h @@ -0,0 +1,58 @@ +/* +Copyright (c) 2008, Luke Benstead. +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#ifndef KM_GL_MATRIX_H_INCLUDED +#define KM_GL_MATRIX_H_INCLUDED + +#define KM_GL_MODELVIEW 0x1700 +#define KM_GL_PROJECTION 0x1701 +#define KM_GL_TEXTURE 0x1702 + +typedef unsigned int kmGLEnum; + +#include "../mat4.h" +#include "../vec3.h" + +#ifdef __cplusplus +extern "C" { +#endif + +void kmGLFreeAll(void); +void kmGLPushMatrix(void); +void kmGLPopMatrix(void); +void kmGLMatrixMode(kmGLEnum mode); +void kmGLLoadIdentity(void); +void kmGLLoadMatrix(const kmMat4* pIn); +void kmGLMultMatrix(const kmMat4* pIn); +void kmGLTranslatef(float x, float y, float z); +void kmGLRotatef(float angle, float x, float y, float z); +void kmGLScalef(float x, float y, float z); +void kmGLGetMatrix(kmGLEnum mode, kmMat4* pOut); + +#ifdef __cplusplus +} +#endif + +#endif // MATRIX_H_INCLUDED diff --git a/external/kazmath/include/kazmath/aabb.h b/external/kazmath/include/kazmath/aabb.h new file mode 100644 index 0000000..0e78a04 --- /dev/null +++ b/external/kazmath/include/kazmath/aabb.h @@ -0,0 +1,53 @@ +/* +Copyright (c) 2008, Luke Benstead. +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#ifndef KAZMATH_AABB_H_INCLUDED +#define KAZMATH_AABB_H_INCLUDED + +#include "vec3.h" +#include "utility.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * A struture that represents an axis-aligned + * bounding box. + */ +typedef struct kmAABB { + kmVec3 min; /** The max corner of the box */ + kmVec3 max; /** The min corner of the box */ +} kmAABB; + +const int kmAABBContainsPoint(const kmVec3* pPoint, const kmAABB* pBox); +kmAABB* const kmAABBAssign(kmAABB* pOut, const kmAABB* pIn); +kmAABB* const kmAABBScale(kmAABB* pOut, const kmAABB* pIn, kmScalar s); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/external/kazmath/include/kazmath/kazmath.h b/external/kazmath/include/kazmath/kazmath.h new file mode 100644 index 0000000..ef09870 --- /dev/null +++ b/external/kazmath/include/kazmath/kazmath.h @@ -0,0 +1,39 @@ +/* +Copyright (c) 2008, Luke Benstead. +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#ifndef KAZMATH_H_INCLUDED +#define KAZMATH_H_INCLUDED + +#include "vec2.h" +#include "vec3.h" +#include "mat3.h" +#include "mat4.h" +#include "utility.h" +#include "quaternion.h" +#include "plane.h" +#include "aabb.h" +#include "ray2.h" + +#endif // KAZMATH_H_INCLUDED diff --git a/external/kazmath/include/kazmath/mat3.h b/external/kazmath/include/kazmath/mat3.h new file mode 100644 index 0000000..f0de423 --- /dev/null +++ b/external/kazmath/include/kazmath/mat3.h @@ -0,0 +1,75 @@ +/* +Copyright (c) 2008, Luke Benstead. +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + + +#ifndef MAT3_H_INCLUDED +#define MAT3_H_INCLUDED + +#include "utility.h" + +struct kmVec3; +struct kmQuaternion; + +typedef struct kmMat3{ + kmScalar mat[9]; +} kmMat3; + +#ifdef __cplusplus +extern "C" { +#endif + +kmMat3* const kmMat3Fill(kmMat3* pOut, const kmScalar* pMat); +kmMat3* const kmMat3Adjugate(kmMat3* pOut, const kmMat3* pIn); +kmMat3* const kmMat3Identity(kmMat3* pOut); +kmMat3* const kmMat3Inverse(kmMat3* pOut, const kmScalar pDeterminate, const kmMat3* pM); +const int kmMat3IsIdentity(const kmMat3* pIn); +kmMat3* const kmMat3Transpose(kmMat3* pOut, const kmMat3* pIn); +const kmScalar kmMat3Determinant(const kmMat3* pIn); +kmMat3* const kmMat3Multiply(kmMat3* pOut, const kmMat3* pM1, const kmMat3* pM2); +kmMat3* const kmMat3ScalarMultiply(kmMat3* pOut, const kmMat3* pM, const kmScalar pFactor); + +kmMat3* const kmMat3RotationAxisAngle(kmMat3* pOut, const struct kmVec3* axis, kmScalar radians); +struct kmVec3* const kmMat3RotationToAxisAngle(struct kmVec3* pAxis, kmScalar* radians, const kmMat3* pIn); + +kmMat3* const kmMat3Assign(kmMat3* pOut, const kmMat3* pIn); +const int kmMat3AreEqual(const kmMat3* pM1, const kmMat3* pM2); + +kmMat3* const kmMat3RotationX(kmMat3* pOut, const kmScalar radians); +kmMat3* const kmMat3RotationY(kmMat3* pOut, const kmScalar radians); +kmMat3* const kmMat3RotationZ(kmMat3* pOut, const kmScalar radians); + +kmMat3* const kmMat3Rotation(kmMat3* pOut, const kmScalar radians); +kmMat3* const kmMat3Scaling(kmMat3* pOut, const kmScalar x, const kmScalar y); +kmMat3* const kmMat3Translation(kmMat3* pOut, const kmScalar x, const kmScalar y); + +kmMat3* const kmMat3RotationQuaternion(kmMat3* pOut, const struct kmQuaternion* pIn); +kmMat3* const kmMat3RotationAxisAngle(kmMat3* pOut, const struct kmVec3* axis, kmScalar radians); +struct kmVec3* const kmMat3RotationToAxisAngle(struct kmVec3* pAxis, kmScalar* radians, const kmMat3* pIn); + +#ifdef __cplusplus +} +#endif +#endif // MAT3_H_INCLUDED + diff --git a/external/kazmath/include/kazmath/mat4.h b/external/kazmath/include/kazmath/mat4.h new file mode 100644 index 0000000..38008ba --- /dev/null +++ b/external/kazmath/include/kazmath/mat4.h @@ -0,0 +1,93 @@ +/* +Copyright (c) 2008, Luke Benstead. +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#ifndef MAT4_H_INCLUDED +#define MAT4_H_INCLUDED + +#include "utility.h" + +struct kmVec3; +struct kmMat3; +struct kmQuaternion; +struct kmPlane; + +/* +A 4x4 matrix + + | 0 4 8 12 | +mat = | 1 5 9 13 | + | 2 6 10 14 | + | 3 7 11 15 | +*/ + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct kmMat4 { + kmScalar mat[16]; +} kmMat4; + +kmMat4* const kmMat4Fill(kmMat4* pOut, const kmScalar* pMat); + + +kmMat4* const kmMat4Identity(kmMat4* pOut); + +kmMat4* const kmMat4Inverse(kmMat4* pOut, const kmMat4* pM); + + +const int kmMat4IsIdentity(const kmMat4* pIn); + +kmMat4* const kmMat4Transpose(kmMat4* pOut, const kmMat4* pIn); +kmMat4* const kmMat4Multiply(kmMat4* pOut, const kmMat4* pM1, const kmMat4* pM2); + +kmMat4* const kmMat4Assign(kmMat4* pOut, const kmMat4* pIn); +const int kmMat4AreEqual(const kmMat4* pM1, const kmMat4* pM2); + +kmMat4* const kmMat4RotationX(kmMat4* pOut, const kmScalar radians); +kmMat4* const kmMat4RotationY(kmMat4* pOut, const kmScalar radians); +kmMat4* const kmMat4RotationZ(kmMat4* pOut, const kmScalar radians); +kmMat4* const kmMat4RotationPitchYawRoll(kmMat4* pOut, const kmScalar pitch, const kmScalar yaw, const kmScalar roll); +kmMat4* const kmMat4RotationQuaternion(kmMat4* pOut, const struct kmQuaternion* pQ); +kmMat4* const kmMat4RotationTranslation(kmMat4* pOut, const struct kmMat3* rotation, const struct kmVec3* translation); +kmMat4* const kmMat4Scaling(kmMat4* pOut, const kmScalar x, const kmScalar y, const kmScalar z); +kmMat4* const kmMat4Translation(kmMat4* pOut, const kmScalar x, const kmScalar y, const kmScalar z); + +struct kmVec3* const kmMat4GetUpVec3(struct kmVec3* pOut, const kmMat4* pIn); +struct kmVec3* const kmMat4GetRightVec3(struct kmVec3* pOut, const kmMat4* pIn); +struct kmVec3* const kmMat4GetForwardVec3(struct kmVec3* pOut, const kmMat4* pIn); + +kmMat4* const kmMat4PerspectiveProjection(kmMat4* pOut, kmScalar fovY, kmScalar aspect, kmScalar zNear, kmScalar zFar); +kmMat4* const kmMat4OrthographicProjection(kmMat4* pOut, kmScalar left, kmScalar right, kmScalar bottom, kmScalar top, kmScalar nearVal, kmScalar farVal); +kmMat4* const kmMat4LookAt(kmMat4* pOut, const struct kmVec3* pEye, const struct kmVec3* pCenter, const struct kmVec3* pUp); + +kmMat4* const kmMat4RotationAxisAngle(kmMat4* pOut, const struct kmVec3* axis, kmScalar radians); +struct kmMat3* const kmMat4ExtractRotation(struct kmMat3* pOut, const kmMat4* pIn); +struct kmPlane* const kmMat4ExtractPlane(struct kmPlane* pOut, const kmMat4* pIn, const kmEnum plane); +struct kmVec3* const kmMat4RotationToAxisAngle(struct kmVec3* pAxis, kmScalar* radians, const kmMat4* pIn); +#ifdef __cplusplus +} +#endif +#endif /* MAT4_H_INCLUDED */ diff --git a/external/kazmath/include/kazmath/neon_matrix_impl.h b/external/kazmath/include/kazmath/neon_matrix_impl.h new file mode 100644 index 0000000..3fcf3e4 --- /dev/null +++ b/external/kazmath/include/kazmath/neon_matrix_impl.h @@ -0,0 +1,41 @@ +/* + NEON math library for the iPhone / iPod touch + + Copyright (c) 2009 Justin Saunders + + This software is provided 'as-is', without any express or implied warranty. + In no event will the authors be held liable for any damages arising + from the use of this software. + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it freely, + subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must + not claim that you wrote the original software. If you use this + software in a product, an acknowledgment in the product documentation + would be appreciated but is not required. + + 2. Altered source versions must be plainly marked as such, and must + not be misrepresented as being the original software. + + 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef __NEON_MATRIX_IMPL_H__ +#define __NEON_MATRIX_IMPL_H__ + +#ifdef __arm__ +#include "arm/arch.h" +#endif + +// Matrixes are assumed to be stored in column major format according to OpenGL +// specification. + +// Multiplies two 4x4 matrices (a,b) outputing a 4x4 matrix (output) +void NEON_Matrix4Mul(const float* a, const float* b, float* output ); + +// Multiplies a 4x4 matrix (m) with a vector 4 (v), outputing a vector 4 +void NEON_Matrix4Vector4Mul(const float* m, const float* v, float* output); + + +#endif // __NEON_MATRIX_IMPL_H__ diff --git a/external/kazmath/include/kazmath/plane.h b/external/kazmath/include/kazmath/plane.h new file mode 100644 index 0000000..4270a8a --- /dev/null +++ b/external/kazmath/include/kazmath/plane.h @@ -0,0 +1,70 @@ +/* +Copyright (c) 2008, Luke Benstead. +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#ifndef PLANE_H_INCLUDED +#define PLANE_H_INCLUDED + +#define KM_PLANE_LEFT 0 +#define KM_PLANE_RIGHT 1 +#define KM_PLANE_BOTTOM 2 +#define KM_PLANE_TOP 3 +#define KM_PLANE_NEAR 4 +#define KM_PLANE_FAR 5 + +#include "utility.h" + +struct kmVec3; +struct kmVec4; +struct kmMat4; + +typedef struct kmPlane { + kmScalar a, b, c, d; +} kmPlane; + +#ifdef __cplusplus +extern "C" { +#endif + +typedef enum POINT_CLASSIFICATION { + POINT_INFRONT_OF_PLANE = 0, + POINT_BEHIND_PLANE, + POINT_ON_PLANE, +} POINT_CLASSIFICATION; + +const kmScalar kmPlaneDot(const kmPlane* pP, const struct kmVec4* pV); +const kmScalar kmPlaneDotCoord(const kmPlane* pP, const struct kmVec3* pV); +const kmScalar kmPlaneDotNormal(const kmPlane* pP, const struct kmVec3* pV); +kmPlane* const kmPlaneFromPointNormal(kmPlane* pOut, const struct kmVec3* pPoint, const struct kmVec3* pNormal); +kmPlane* const kmPlaneFromPoints(kmPlane* pOut, const struct kmVec3* p1, const struct kmVec3* p2, const struct kmVec3* p3); +kmVec3* const kmPlaneIntersectLine(struct kmVec3* pOut, const kmPlane* pP, const struct kmVec3* pV1, const struct kmVec3* pV2); +kmPlane* const kmPlaneNormalize(kmPlane* pOut, const kmPlane* pP); +kmPlane* const kmPlaneScale(kmPlane* pOut, const kmPlane* pP, kmScalar s); +const POINT_CLASSIFICATION kmPlaneClassifyPoint(const kmPlane* pIn, const kmVec3* pP); /** Classifys a point against a plane */ + +#ifdef __cplusplus +} +#endif + +#endif // PLANE_H_INCLUDED diff --git a/external/kazmath/include/kazmath/quaternion.h b/external/kazmath/include/kazmath/quaternion.h new file mode 100644 index 0000000..81ff547 --- /dev/null +++ b/external/kazmath/include/kazmath/quaternion.h @@ -0,0 +1,113 @@ +/* +Copyright (c) 2008, Luke Benstead. +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#ifndef QUATERNION_H_INCLUDED +#define QUATERNION_H_INCLUDED + +#ifdef __cplusplus +extern "C" { +#endif + +#include "utility.h" + +struct kmMat4; +struct kmMat3; +struct kmVec3; + +typedef struct kmQuaternion { + kmScalar x; + kmScalar y; + kmScalar z; + kmScalar w; +} kmQuaternion; + +kmQuaternion* const kmQuaternionConjugate(kmQuaternion* pOut, const kmQuaternion* pIn); ///< Returns pOut, sets pOut to the conjugate of pIn + +const kmScalar kmQuaternionDot(const kmQuaternion* q1, const kmQuaternion* q2); ///< Returns the dot product of the 2 quaternions + +kmQuaternion* kmQuaternionExp(kmQuaternion* pOut, const kmQuaternion* pIn); ///< Returns the exponential of the quaternion + +///< Makes the passed quaternion an identity quaternion + +kmQuaternion* kmQuaternionIdentity(kmQuaternion* pOut); + +///< Returns the inverse of the passed Quaternion + +kmQuaternion* kmQuaternionInverse(kmQuaternion* pOut, + const kmQuaternion* pIn); + +///< Returns true if the quaternion is an identity quaternion + +int kmQuaternionIsIdentity(const kmQuaternion* pIn); + +///< Returns the length of the quaternion + +kmScalar kmQuaternionLength(const kmQuaternion* pIn); + +///< Returns the length of the quaternion squared (prevents a sqrt) + +kmScalar kmQuaternionLengthSq(const kmQuaternion* pIn); + +///< Returns the natural logarithm + +kmQuaternion* kmQuaternionLn(kmQuaternion* pOut, const kmQuaternion* pIn); + +///< Multiplies 2 quaternions together + +kmQuaternion* kmQuaternionMultiply(kmQuaternion* pOut, const kmQuaternion* q1, const kmQuaternion* q2); + +///< Normalizes a quaternion + +kmQuaternion* kmQuaternionNormalize(kmQuaternion* pOut, const kmQuaternion* pIn); + +///< Rotates a quaternion around an axis + +kmQuaternion* kmQuaternionRotationAxis(kmQuaternion* pOut, const struct kmVec3* pV, kmScalar angle); + +///< Creates a quaternion from a rotation matrix + +kmQuaternion* kmQuaternionRotationMatrix(kmQuaternion* pOut, const struct kmMat3* pIn); + +///< Create a quaternion from yaw, pitch and roll + +kmQuaternion* kmQuaternionRotationYawPitchRoll(kmQuaternion* pOut, kmScalar yaw, kmScalar pitch, kmScalar roll); +///< Interpolate between 2 quaternions +kmQuaternion* kmQuaternionSlerp(kmQuaternion* pOut, const kmQuaternion* q1, const kmQuaternion* q2, kmScalar t); + +///< Get the axis and angle of rotation from a quaternion +void kmQuaternionToAxisAngle(const kmQuaternion* pIn, struct kmVec3* pVector, kmScalar* pAngle); + +///< Scale a quaternion +kmQuaternion* kmQuaternionScale(kmQuaternion* pOut, const kmQuaternion* pIn, kmScalar s); +kmQuaternion* kmQuaternionAssign(kmQuaternion* pOut, const kmQuaternion* pIn); +kmQuaternion* kmQuaternionAdd(kmQuaternion* pOut, const kmQuaternion* pQ1, const kmQuaternion* pQ2); +kmQuaternion* kmQuaternionRotationBetweenVec3(kmQuaternion* pOut, const struct kmVec3* vec1, const struct kmVec3* vec2, const struct kmVec3* fallback); +struct kmVec3* kmQuaternionMultiplyVec3(struct kmVec3* pOut, const kmQuaternion* q, const struct kmVec3* v); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/external/kazmath/include/kazmath/ray2.h b/external/kazmath/include/kazmath/ray2.h new file mode 100644 index 0000000..609e6e5 --- /dev/null +++ b/external/kazmath/include/kazmath/ray2.h @@ -0,0 +1,50 @@ +/* +Copyright (c) 2011, Luke Benstead. +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#ifndef RAY_2_H +#define RAY_2_H + +#include "utility.h" +#include "vec2.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct kmRay2 { + kmVec2 start; + kmVec2 dir; +} kmRay2; + +void kmRay2Fill(kmRay2* ray, kmScalar px, kmScalar py, kmScalar vx, kmScalar vy); +kmBool kmRay2IntersectLineSegment(const kmRay2* ray, const kmVec2* p1, const kmVec2* p2, kmVec2* intersection); +kmBool kmRay2IntersectTriangle(const kmRay2* ray, const kmVec2* p1, const kmVec2* p2, const kmVec2* p3, kmVec2* intersection, kmVec2* normal_out); +kmBool kmRay2IntersectCircle(const kmRay2* ray, const kmVec2 centre, const kmScalar radius, kmVec2* intersection); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/external/kazmath/include/kazmath/utility.h b/external/kazmath/include/kazmath/utility.h new file mode 100644 index 0000000..14d66dc --- /dev/null +++ b/external/kazmath/include/kazmath/utility.h @@ -0,0 +1,74 @@ +/* +Copyright (c) 2008, Luke Benstead. +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#ifndef UTILITY_H_INCLUDED +#define UTILITY_H_INCLUDED + +#include + +#ifndef kmScalar +#define kmScalar float +#endif + +#ifndef kmBool +#define kmBool unsigned char +#endif + +#ifndef kmEnum +#define kmEnum unsigned int +#endif + +#ifndef KM_FALSE +#define KM_FALSE 0 +#endif + +#ifndef KM_TRUE +#define KM_TRUE 1 +#endif + +#define kmPI 3.141592f +#define kmPIOver180 0.017453f // PI / 180 +#define kmPIUnder180 57.295779f // 180 / PI +#define kmEpsilon 1.0 / 64.0 + + + +#ifdef __cplusplus +extern "C" { +#endif + +extern kmScalar kmSQR(kmScalar s); +extern kmScalar kmDegreesToRadians(kmScalar degrees); +extern kmScalar kmRadiansToDegrees(kmScalar radians); + +extern kmScalar min(kmScalar lhs, kmScalar rhs); +extern kmScalar max(kmScalar lhs, kmScalar rhs); +extern kmBool kmAlmostEqual(kmScalar lhs, kmScalar rhs); + +#ifdef __cplusplus +} +#endif + +#endif /* UTILITY_H_INCLUDED */ diff --git a/external/kazmath/include/kazmath/vec2.h b/external/kazmath/include/kazmath/vec2.h new file mode 100644 index 0000000..3ca56b3 --- /dev/null +++ b/external/kazmath/include/kazmath/vec2.h @@ -0,0 +1,64 @@ +/* +Copyright (c) 2008, Luke Benstead. +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#ifndef VEC2_H_INCLUDED +#define VEC2_H_INCLUDED + +struct kmMat3; + +#ifndef kmScalar +#define kmScalar float +#endif + +#pragma pack(push) /* push current alignment to stack */ +#pragma pack(1) /* set alignment to 1 byte boundary */ +typedef struct kmVec2 { + kmScalar x; + kmScalar y; +} kmVec2; + +#pragma pack(pop) + +#ifdef __cplusplus +extern "C" { +#endif +kmVec2* kmVec2Fill(kmVec2* pOut, kmScalar x, kmScalar y); +kmScalar kmVec2Length(const kmVec2* pIn); ///< Returns the length of the vector +kmScalar kmVec2LengthSq(const kmVec2* pIn); ///< Returns the square of the length of the vector +kmVec2* kmVec2Normalize(kmVec2* pOut, const kmVec2* pIn); ///< Returns the vector passed in set to unit length +kmVec2* kmVec2Add(kmVec2* pOut, const kmVec2* pV1, const kmVec2* pV2); ///< Adds 2 vectors and returns the result +kmScalar kmVec2Dot(const kmVec2* pV1, const kmVec2* pV2); /** Returns the Dot product which is the cosine of the angle between the two vectors multiplied by their lengths */ +kmVec2* kmVec2Subtract(kmVec2* pOut, const kmVec2* pV1, const kmVec2* pV2); ///< Subtracts 2 vectors and returns the result +kmVec2* kmVec2Transform(kmVec2* pOut, const kmVec2* pV1, const struct kmMat3* pM); /** Transform the Vector */ +kmVec2* kmVec2TransformCoord(kmVec2* pOut, const kmVec2* pV, const struct kmMat3* pM); /// + +#ifndef kmScalar +#define kmScalar float +#endif + +struct kmMat4; + +typedef struct kmVec3 { + kmScalar x; + kmScalar y; + kmScalar z; +} kmVec3; + +#ifdef __cplusplus +extern "C" { +#endif + +kmVec3* kmVec3Fill(kmVec3* pOut, kmScalar x, kmScalar y, kmScalar z); +kmScalar kmVec3Length(const kmVec3* pIn); /** Returns the length of the vector */ +kmScalar kmVec3LengthSq(const kmVec3* pIn); /** Returns the square of the length of the vector */ +kmVec3* kmVec3Normalize(kmVec3* pOut, const kmVec3* pIn); /** Returns the vector passed in set to unit length */ +kmVec3* kmVec3Cross(kmVec3* pOut, const kmVec3* pV1, const kmVec3* pV2); /** Returns a vector perpendicular to 2 other vectors */ +kmScalar kmVec3Dot(const kmVec3* pV1, const kmVec3* pV2); /** Returns the cosine of the angle between 2 vectors */ +kmVec3* kmVec3Add(kmVec3* pOut, const kmVec3* pV1, const kmVec3* pV2); /** Adds 2 vectors and returns the result */ +kmVec3* kmVec3Subtract(kmVec3* pOut, const kmVec3* pV1, const kmVec3* pV2); /** Subtracts 2 vectors and returns the result */ +kmVec3* kmVec3Transform(kmVec3* pOut, const kmVec3* pV1, const struct kmMat4* pM); /** Transforms a vector (assuming w=1) by a given matrix */ +kmVec3* kmVec3TransformNormal(kmVec3* pOut, const kmVec3* pV, const struct kmMat4* pM);/**Transforms a 3D normal by a given matrix */ +kmVec3* kmVec3TransformCoord(kmVec3* pOut, const kmVec3* pV, const struct kmMat4* pM); /**Transforms a 3D vector by a given matrix, projecting the result back into w = 1. */ +kmVec3* kmVec3Scale(kmVec3* pOut, const kmVec3* pIn, const kmScalar s); /** Scales a vector to length s */ +int kmVec3AreEqual(const kmVec3* p1, const kmVec3* p2); +kmVec3* kmVec3InverseTransform(kmVec3* pOut, const kmVec3* pV, const struct kmMat4* pM); +kmVec3* kmVec3InverseTransformNormal(kmVec3* pOut, const kmVec3* pVect, const struct kmMat4* pM); +kmVec3* kmVec3Assign(kmVec3* pOut, const kmVec3* pIn); +kmVec3* kmVec3Zero(kmVec3* pOut); + +#ifdef __cplusplus +} +#endif +#endif /* VEC3_H_INCLUDED */ diff --git a/external/kazmath/include/kazmath/vec4.h b/external/kazmath/include/kazmath/vec4.h new file mode 100644 index 0000000..7507ea3 --- /dev/null +++ b/external/kazmath/include/kazmath/vec4.h @@ -0,0 +1,68 @@ +/* +Copyright (c) 2008, Luke Benstead. +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#ifndef VEC4_H_INCLUDED +#define VEC4_H_INCLUDED + +#include "utility.h" + +struct kmMat4; + +#pragma pack(push) /* push current alignment to stack */ +#pragma pack(1) /* set alignment to 1 byte boundary */ + +typedef struct kmVec4 { + kmScalar x; + kmScalar y; + kmScalar z; + kmScalar w; +} kmVec4; + +#pragma pack(pop) + +#ifdef __cplusplus +extern "C" { +#endif + +kmVec4* kmVec4Fill(kmVec4* pOut, kmScalar x, kmScalar y, kmScalar z, kmScalar w); +kmVec4* kmVec4Add(kmVec4* pOut, const kmVec4* pV1, const kmVec4* pV2); +kmScalar kmVec4Dot(const kmVec4* pV1, const kmVec4* pV2); +kmScalar kmVec4Length(const kmVec4* pIn); +kmScalar kmVec4LengthSq(const kmVec4* pIn); +kmVec4* kmVec4Lerp(kmVec4* pOut, const kmVec4* pV1, const kmVec4* pV2, kmScalar t); +kmVec4* kmVec4Normalize(kmVec4* pOut, const kmVec4* pIn); +kmVec4* kmVec4Scale(kmVec4* pOut, const kmVec4* pIn, const kmScalar s); ///< Scales a vector to length s +kmVec4* kmVec4Subtract(kmVec4* pOut, const kmVec4* pV1, const kmVec4* pV2); +kmVec4* kmVec4Transform(kmVec4* pOut, const kmVec4* pV, const struct kmMat4* pM); +kmVec4* kmVec4TransformArray(kmVec4* pOut, unsigned int outStride, + const kmVec4* pV, unsigned int vStride, const struct kmMat4* pM, unsigned int count); +int kmVec4AreEqual(const kmVec4* p1, const kmVec4* p2); +kmVec4* kmVec4Assign(kmVec4* pOut, const kmVec4* pIn); + +#ifdef __cplusplus +} +#endif + +#endif // VEC4_H_INCLUDED diff --git a/external/kazmath/src/CMakeLists.txt b/external/kazmath/src/CMakeLists.txt new file mode 100644 index 0000000..a389466 --- /dev/null +++ b/external/kazmath/src/CMakeLists.txt @@ -0,0 +1,14 @@ + +#ADD_LIBRARY(Kazmath STATIC ${KAZMATH_SRCS}) +#INSTALL(TARGETS Kazmath ARCHIVE DESTINATION lib) + +INCLUDE_DIRECTORIES( ${CMAKE_SOURCE_DIR}/include ) + +ADD_LIBRARY(kazmath STATIC ${KAZMATH_SOURCES}) +INSTALL(TARGETS kazmath ARCHIVE DESTINATION lib) + +#ADD_LIBRARY(KazmathGL STATIC ${GL_UTILS_SRCS}) +#INSTALL(TARGETS KazmathGL ARCHIVE DESTINATION lib) + +INSTALL(FILES ${KAZMATH_HEADERS} DESTINATION include/kazmath) +INSTALL(FILES ${GL_UTILS_HEADERS} DESTINATION include/kazmath/GL) diff --git a/src/kazmath/ChangeLog b/external/kazmath/src/ChangeLog similarity index 100% rename from src/kazmath/ChangeLog rename to external/kazmath/src/ChangeLog diff --git a/src/kazmath/GL/mat4stack.c b/external/kazmath/src/GL/mat4stack.c similarity index 100% rename from src/kazmath/GL/mat4stack.c rename to external/kazmath/src/GL/mat4stack.c diff --git a/src/kazmath/GL/matrix.c b/external/kazmath/src/GL/matrix.c similarity index 100% rename from src/kazmath/GL/matrix.c rename to external/kazmath/src/GL/matrix.c diff --git a/src/kazmath/aabb.c b/external/kazmath/src/aabb.c similarity index 100% rename from src/kazmath/aabb.c rename to external/kazmath/src/aabb.c diff --git a/src/kazmath/mat3.c b/external/kazmath/src/mat3.c similarity index 100% rename from src/kazmath/mat3.c rename to external/kazmath/src/mat3.c diff --git a/src/kazmath/mat4.c b/external/kazmath/src/mat4.c similarity index 100% rename from src/kazmath/mat4.c rename to external/kazmath/src/mat4.c diff --git a/src/kazmath/neon_matrix_impl.c b/external/kazmath/src/neon_matrix_impl.c similarity index 100% rename from src/kazmath/neon_matrix_impl.c rename to external/kazmath/src/neon_matrix_impl.c diff --git a/src/kazmath/plane.c b/external/kazmath/src/plane.c similarity index 100% rename from src/kazmath/plane.c rename to external/kazmath/src/plane.c diff --git a/src/kazmath/quaternion.c b/external/kazmath/src/quaternion.c similarity index 100% rename from src/kazmath/quaternion.c rename to external/kazmath/src/quaternion.c diff --git a/src/kazmath/ray2.c b/external/kazmath/src/ray2.c similarity index 100% rename from src/kazmath/ray2.c rename to external/kazmath/src/ray2.c diff --git a/src/kazmath/utility.c b/external/kazmath/src/utility.c similarity index 100% rename from src/kazmath/utility.c rename to external/kazmath/src/utility.c diff --git a/src/kazmath/vec2.c b/external/kazmath/src/vec2.c similarity index 100% rename from src/kazmath/vec2.c rename to external/kazmath/src/vec2.c diff --git a/src/kazmath/vec3.c b/external/kazmath/src/vec3.c similarity index 100% rename from src/kazmath/vec3.c rename to external/kazmath/src/vec3.c diff --git a/src/kazmath/vec4.c b/external/kazmath/src/vec4.c similarity index 100% rename from src/kazmath/vec4.c rename to external/kazmath/src/vec4.c diff --git a/external/kazmath_neon.patch b/external/kazmath_neon.patch new file mode 100644 index 0000000..79781d0 --- /dev/null +++ b/external/kazmath_neon.patch @@ -0,0 +1,98 @@ +diff --git a/external/kazmath/src/mat4.c b/external/kazmath/src/mat4.c +index 3e109bc..934cc4c 100644 +--- a/external/kazmath/src/mat4.c ++++ b/external/kazmath/src/mat4.c +@@ -32,11 +32,13 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + #include "kazmath/utility.h" + #include "kazmath/vec3.h" +-#include "kazmath/mat4.h" ++#include "kazmath/mat4.h" + #include "kazmath/mat3.h" + #include "kazmath/quaternion.h" + #include "kazmath/plane.h" + ++#include "kazmath/neon_matrix_impl.h" ++ + /** + * Fills a kmMat4 structure with the values from a 16 + * element array of floats +@@ -213,6 +215,14 @@ kmMat4* const kmMat4Transpose(kmMat4* pOut, const kmMat4* pIn) + */ + kmMat4* const kmMat4Multiply(kmMat4* pOut, const kmMat4* pM1, const kmMat4* pM2) + { ++#if defined(__ARM_NEON__) ++ ++ float mat[16]; ++ ++ // Invert column-order with row-order ++ NEON_Matrix4Mul( &pM2->mat[0], &pM1->mat[0], &mat[0] ); ++ ++#else + float mat[16]; + + const float *m1 = pM1->mat, *m2 = pM2->mat; +@@ -237,6 +247,7 @@ kmMat4* const kmMat4Multiply(kmMat4* pOut, const kmMat4* pM1, const kmMat4* pM2) + mat[14] = m1[2] * m2[12] + m1[6] * m2[13] + m1[10] * m2[14] + m1[14] * m2[15]; + mat[15] = m1[3] * m2[12] + m1[7] * m2[13] + m1[11] * m2[14] + m1[15] * m2[15]; + ++#endif + + memcpy(pOut->mat, mat, sizeof(float)*16); + +@@ -654,27 +665,27 @@ kmMat4* const kmMat4LookAt(kmMat4* pOut, const kmVec3* pEye, + kmMat4Multiply(pOut, pOut, &translate); + + return pOut; +-} ++} + + /** + * Extract a 3x3 rotation matrix from the input 4x4 transformation. + * Stores the result in pOut, returns pOut +- */ +-kmMat3* const kmMat4ExtractRotation(kmMat3* pOut, const kmMat4* pIn) +-{ +- pOut->mat[0] = pIn->mat[0]; +- pOut->mat[1] = pIn->mat[1]; +- pOut->mat[2] = pIn->mat[2]; +- +- pOut->mat[3] = pIn->mat[4]; +- pOut->mat[4] = pIn->mat[5]; +- pOut->mat[5] = pIn->mat[6]; +- +- pOut->mat[6] = pIn->mat[8]; +- pOut->mat[7] = pIn->mat[9]; +- pOut->mat[8] = pIn->mat[10]; +- +- return pOut; ++ */ ++kmMat3* const kmMat4ExtractRotation(kmMat3* pOut, const kmMat4* pIn) ++{ ++ pOut->mat[0] = pIn->mat[0]; ++ pOut->mat[1] = pIn->mat[1]; ++ pOut->mat[2] = pIn->mat[2]; ++ ++ pOut->mat[3] = pIn->mat[4]; ++ pOut->mat[4] = pIn->mat[5]; ++ pOut->mat[5] = pIn->mat[6]; ++ ++ pOut->mat[6] = pIn->mat[8]; ++ pOut->mat[7] = pIn->mat[9]; ++ pOut->mat[8] = pIn->mat[10]; ++ ++ return pOut; + } + + /** +@@ -684,8 +695,8 @@ kmMat3* const kmMat4ExtractRotation(kmMat3* pOut, const kmMat4* pIn) + kmVec3* const kmMat4RotationToAxisAngle(kmVec3* pAxis, kmScalar* radians, const kmMat4* pIn) + { + /*Surely not this easy?*/ +- kmQuaternion temp; +- kmMat3 rotation; ++ kmQuaternion temp; ++ kmMat3 rotation; + kmMat4ExtractRotation(&rotation, pIn); + kmQuaternionRotationMatrix(&temp, &rotation); + kmQuaternionToAxisAngle(&temp, pAxis, radians); diff --git a/external/libpng/ANNOUNCE b/external/libpng/ANNOUNCE new file mode 100644 index 0000000..5fab72a --- /dev/null +++ b/external/libpng/ANNOUNCE @@ -0,0 +1,55 @@ + +Libpng 1.2.49 - March 29, 2012 + +This is a public release of libpng, intended for use in production codes. + +Files available for download: + +Source files with LF line endings (for Unix/Linux) and with a +"configure" script + + libpng-1.2.49.tar.xz (LZMA-compressed, recommended) + libpng-1.2.49.tar.gz + libpng-1.2.49.tar.bz2 + +Source files with LF line endings (for Unix/Linux) without the +"configure" script + + libpng-1.2.49-no-config.tar.xz (LZMA-compressed, recommended) + libpng-1.2.49-no-config.tar.gz + libpng-1.2.49-no-config.tar.bz2 + +Source files with CRLF line endings (for Windows), without the +"configure" script + + lpng1249.zip + lpng1249.7z + lpng1249.tar.bz2 + +Project files + + libpng-1.2.49-project-netware.zip + libpng-1.2.49-project-wince.zip + +Other information: + + libpng-1.2.49-README.txt + libpng-1.2.49-KNOWNBUGS.txt + libpng-1.2.49-LICENSE.txt + libpng-1.2.49-Y2K-compliance.txt + libpng-1.2.49-[previous version]-diff.txt + +Changes since the last public release (1.2.48): + +version 1.2.49 [March 29, 2012] + + Revised png_set_text_2() to avoid potential memory corruption (fixes + CVE-2011-3048). + Prevent PNG_EXPAND+PNG_SHIFT doing the shift twice. + +Send comments/corrections/commendations to png-mng-implement at lists.sf.net +(subscription required; visit +https://lists.sourceforge.net/lists/listinfo/png-mng-implement +to subscribe) or to glennrp at users.sourceforge.net + +Glenn R-P diff --git a/external/libpng/CHANGES b/external/libpng/CHANGES new file mode 100644 index 0000000..ad90e51 --- /dev/null +++ b/external/libpng/CHANGES @@ -0,0 +1,2785 @@ +#if 0 +CHANGES - changes for libpng + +version 0.2 + added reader into png.h + fixed small problems in stub file + +version 0.3 + added pull reader + split up pngwrite.c to several files + added pnglib.txt + added example.c + cleaned up writer, adding a few new transformations + fixed some bugs in writer + interfaced with zlib 0.5 + added K&R support + added check for 64 KB blocks for 16 bit machines + +version 0.4 + cleaned up code and commented code + simplified time handling into png_time + created png_color_16 and png_color_8 to handle color needs + cleaned up color type defines + fixed various bugs + made various names more consistent + interfaced with zlib 0.71 + cleaned up zTXt reader and writer (using zlib's Reset functions) + split transformations into pngrtran.c and pngwtran.c + +version 0.5 + interfaced with zlib 0.8 + fixed many reading and writing bugs + saved using 3 spaces instead of tabs + +version 0.6 + added png_large_malloc() and png_large_free() + added png_size_t + cleaned up some compiler warnings + added png_start_read_image() + +version 0.7 + cleaned up lots of bugs + finished dithering and other stuff + added test program + changed name from pnglib to libpng + +version 0.71 [June, 1995] + changed pngtest.png for zlib 0.93 + fixed error in libpng.txt and example.c + +version 0.8 + cleaned up some bugs + added png_set_filler() + split up pngstub.c into pngmem.c, pngio.c, and pngerror.c + added #define's to remove unwanted code + moved png_info_init() to png.c + added old_size into png_realloc() + added functions to manually set filtering and compression info + changed compression parameters based on image type + optimized filter selection code + added version info + changed external functions passing floats to doubles (k&r problems?) + put all the configurable stuff in pngconf.h + enabled png_set_shift to work with paletted images on read + added png_read_update_info() - updates info structure with + transformations + +version 0.81 [August, 1995] + incorporated Tim Wegner's medium model code (thanks, Tim) + +version 0.82 [September, 1995] + [unspecified changes] + +version 0.85 [December, 1995] + added more medium model code (almost everything's a far) + added i/o, error, and memory callback functions + fixed some bugs (16 bit, 4 bit interlaced, etc.) + added first run progressive reader (barely tested) + +version 0.86 [January, 1996] + fixed bugs + improved documentation + +version 0.87 [January, 1996] + fixed medium model bugs + fixed other bugs introduced in 0.85 and 0.86 + added some minor documentation + +version 0.88 [January, 1996] + fixed progressive bugs + replaced tabs with spaces + cleaned up documentation + added callbacks for read/write and warning/error functions + +version 0.89 [July, 1996] + added new initialization API to make libpng work better with shared libs + we now have png_create_read_struct(), png_create_write_struct(), + png_create_info_struct(), png_destroy_read_struct(), and + png_destroy_write_struct() instead of the separate calls to + malloc and png_read_init(), png_info_init(), and png_write_init() + changed warning/error callback functions to fix bug - this means you + should use the new initialization API if you were using the old + png_set_message_fn() calls, and that the old API no longer exists + so that people are aware that they need to change their code + changed filter selection API to allow selection of multiple filters + since it didn't work in previous versions of libpng anyways + optimized filter selection code + fixed png_set_background() to allow using an arbitrary RGB color for + paletted images + fixed gamma and background correction for paletted images, so + png_correct_palette is not needed unless you are correcting an + external palette (you will need to #define PNG_CORRECT_PALETTE_SUPPORTED + in pngconf.h) - if nobody uses this, it may disappear in the future. + fixed bug with Borland 64K memory allocation (Alexander Lehmann) + fixed bug in interlace handling (Smarasderagd, I think) + added more error checking for writing and image to reduce invalid files + separated read and write functions so that they won't both be linked + into a binary when only reading or writing functionality is used + new pngtest image also has interlacing and zTXt + updated documentation to reflect new API + +version 0.90 [January, 1997] + made CRC errors/warnings on critical and ancillary chunks configurable + libpng will use the zlib CRC routines by (compile-time) default + changed DOS small/medium model memory support - needs zlib 1.04 (Tim Wegner) + added external C++ wrapper statements to png.h (Gilles Dauphin) + allow PNG file to be read when some or all of file signature has already + been read from the beginning of the stream. ****This affects the size + of info_struct and invalidates all programs that use a shared libpng**** + fixed png_filler() declarations + fixed? background color conversions + fixed order of error function pointers to match documentation + current chunk name is now available in png_struct to reduce the number + of nearly identical error messages (will simplify multi-lingual + support when available) + try to get ready for unknown-chunk callback functions: + - previously read critical chunks are flagged, so the chunk handling + routines can determine if the chunk is in the right place + - all chunk handling routines have the same prototypes, so we will + be able to handle all chunks via a callback mechanism + try to fix Linux "setjmp" buffer size problems + removed png_large_malloc, png_large_free, and png_realloc functions. + +version 0.95 [March, 1997] + fixed bug in pngwutil.c allocating "up_row" twice and "avg_row" never + fixed bug in PNG file signature compares when start != 0 + changed parameter type of png_set_filler(...filler...) from png_byte + to png_uint_32 + added test for MACOS to ensure that both math.h and fp.h are not #included + added macros for libpng to be compiled as a Windows DLL (Andreas Kupries) + added "packswap" transformation, which changes the endianness of + packed-pixel bytes (Kevin Bracey) + added "strip_alpha" transformation, which removes the alpha channel of + input images without using it (not necessarily a good idea) + added "swap_alpha" transformation, which puts the alpha channel in front + of the color bytes instead of after + removed all implicit variable tests which assume NULL == 0 (I think) + changed several variables to "png_size_t" to show 16/32-bit limitations + added new pCAL chunk read/write support + added experimental filter selection weighting (Greg Roelofs) + removed old png_set_rgbx() and png_set_xrgb() functions that have been + obsolete for about 2 years now (use png_set_filler() instead) + added macros to read 16- and 32-bit ints directly from buffer, to be + used only on those systems that support it (namely PowerPC and 680x0) + With some testing, this may become the default for MACOS/PPC systems. + only calculate CRC on data if we are going to use it + added macros for zTXt compression type PNG_zTXt_COMPRESSION_??? + added macros for simple libpng debugging output selectable at compile time + removed PNG_READ_END_MODE in progressive reader (Smarasderagd) + more description of info_struct in libpng.txt and png.h + more instructions in example.c + more chunk types tested in pngtest.c + renamed pngrcb.c to pngset.c, and all png_read_ functions to be + png_set_. We now have corresponding png_get_ + functions in pngget.c to get information in info_ptr. This isolates + the application from the internal organization of png_info_struct + (good for shared library implementations). + +version 0.96 [May, 1997] + fixed serious bug with < 8bpp images introduced in 0.95 + fixed 256-color transparency bug (Greg Roelofs) + fixed up documentation (Greg Roelofs, Laszlo Nyul) + fixed "error" in pngconf.h for Linux setjmp() behaviour + fixed DOS medium model support (Tim Wegner) + fixed png_check_keyword() for case with error in static string text + added read of CRC after IEND chunk for embedded PNGs (Laszlo Nyul) + added typecasts to quiet compiler errors + added more debugging info + +version 0.97 [January, 1998] + removed PNG_USE_OWN_CRC capability + relocated png_set_crc_action from pngrutil.c to pngrtran.c + fixed typecasts of "new_key", etc. (Andreas Dilger) + added RFC 1152 [sic] date support + fixed bug in gamma handling of 4-bit grayscale + added 2-bit grayscale gamma handling (Glenn R-P) + added more typecasts. 65536L becomes (png_uint_32)65536L, etc. (Glenn R-P) + minor corrections in libpng.txt + added simple sRGB support (Glenn R-P) + easier conditional compiling, e.g. define PNG_READ/WRITE_NOT_FULLY_SUPPORTED; + all configurable options can be selected from command-line instead + of having to edit pngconf.h (Glenn R-P) + fixed memory leak in pngwrite.c (free info_ptr->text) (Glenn R-P) + added more conditions for png_do_background, to avoid changing + black pixels to background when a background is supplied and + no pixels are transparent + repaired PNG_NO_STDIO behaviour + tested NODIV support and made it default behaviour (Greg Roelofs) + added "-m" option and PNGTEST_DEBUG_MEMORY to pngtest (John Bowler) + regularized version numbering scheme and bumped shared-library major + version number to 2 to avoid problems with libpng 0.89 apps (Greg Roelofs) + +version 0.98 [January, 1998] + cleaned up some typos in libpng.txt and in code documentation + fixed memory leaks in pCAL chunk processing (Glenn R-P and John Bowler) + cosmetic change "display_gamma" to "screen_gamma" in pngrtran.c + changed recommendation about file_gamma for PC images to .51 from .45, + in example.c and libpng.txt, added comments to distinguish between + screen_gamma, viewing_gamma, and display_gamma. + changed all references to RFC1152 to read RFC1123 and changed the + PNG_TIME_RFC1152_SUPPORTED macro to PNG_TIME_RFC1123_SUPPORTED + added png_invert_alpha capability (Glenn R-P -- suggestion by Jon Vincent) + changed srgb_intent from png_byte to int to avoid compiler bugs + +version 0.99 [January 30, 1998] + free info_ptr->text instead of end_info_ptr->text in pngread.c (John Bowler) + fixed a longstanding "packswap" bug in pngtrans.c + fixed some inconsistencies in pngconf.h that prevented compiling with + PNG_READ_GAMMA_SUPPORTED and PNG_READ_hIST_SUPPORTED undefined + fixed some typos and made other minor rearrangement of libpng.txt (Andreas) + changed recommendation about file_gamma for PC images to .50 from .51 in + example.c and libpng.txt, and changed file_gamma for sRGB images to .45 + added a number of functions to access information from the png structure + png_get_image_height(), etc. (Glenn R-P, suggestion by Brad Pettit) + added TARGET_MACOS similar to zlib-1.0.8 + define PNG_ALWAYS_EXTERN when __MWERKS__ && WIN32 are defined + added type casting to all png_malloc() function calls +version 0.99a [January 31, 1998] + Added type casts and parentheses to all returns that return a value.(Tim W.) +version 0.99b [February 4, 1998] + Added type cast png_uint_32 on malloc function calls where needed. + Changed type of num_hist from png_uint_32 to int (same as num_palette). + Added checks for rowbytes overflow, in case png_size_t is less than 32 bits. + Renamed makefile.elf to makefile.lnx. +version 0.99c [February 7, 1998] + More type casting. Removed erroneous overflow test in pngmem.c. + Added png_buffered_memcpy() and png_buffered_memset(), apply them to rowbytes. + Added UNIX manual pages libpng.3 (incorporating libpng.txt) and png.5. +version 0.99d [February 11, 1998] + Renamed "far_to_near()" "png_far_to_near()" + Revised libpng.3 + Version 99c "buffered" operations didn't work as intended. Replaced them + with png_memcpy_check() and png_memset_check(). + Added many "if (png_ptr == NULL) return" to quell compiler warnings about + unused png_ptr, mostly in pngget.c and pngset.c. + Check for overlength tRNS chunk present when indexed-color PLTE is read. + Cleaned up spelling errors in libpng.3/libpng.txt + Corrected a problem with png_get_tRNS() which returned undefined trans array +version 0.99e [February 28, 1998] + Corrected png_get_tRNS() again. + Add parentheses for easier reading of pngget.c, fixed "||" should be "&&". + Touched up example.c to make more of it compileable, although the entire + file still can't be compiled (Willem van Schaik) + Fixed a bug in png_do_shift() (Bryan Tsai) + Added a space in png.h prototype for png_write_chunk_start() + Replaced pngtest.png with one created with zlib 1.1.1 + Changed pngtest to report PASS even when file size is different (Jean-loup G.) + Corrected some logic errors in png_do_invert_alpha() (Chris Patterson) +version 0.99f [March 5, 1998] + Corrected a bug in pngpread() introduced in version 99c (Kevin Bracey) + Moved makefiles into a "scripts" directory, and added INSTALL instruction file + Added makefile.os2 and pngos2.def (A. Zabolotny) and makefile.s2x (W. Sebok) + Added pointers to "note on libpng versions" in makefile.lnx and README + Added row callback feature when reading and writing nonprogressive rows + and added a test of this feature in pngtest.c + Added user transform callbacks, with test of the feature in pngtest.c +version 0.99g [March 6, 1998, morning] + Minor changes to pngtest.c to suppress compiler warnings. + Removed "beta" language from documentation. +version 0.99h [March 6, 1998, evening] + Minor changes to previous minor changes to pngtest.c + Changed PNG_READ_NOT_FULLY_SUPPORTED to PNG_READ_TRANSFORMS_NOT_SUPPORTED + and added PNG_PROGRESSIVE_READ_NOT_SUPPORTED macro + Added user transform capability + +version 1.00 [March 7, 1998] + Changed several typedefs in pngrutil.c + Added makefile.wat (Pawel Mrochen), updated makefile.tc3 (Willem van Schaik) + replaced "while(1)" with "for(;;)" + added PNGARG() to prototypes in pngtest.c and removed some prototypes + updated some of the makefiles (Tom Lane) + changed some typedefs (s_start, etc.) in pngrutil.c + fixed dimensions of "short_months" array in pngwrite.c + Replaced ansi2knr.c with the one from jpeg-v6 + +version 1.0.0 [March 8, 1998] + Changed name from 1.00 to 1.0.0 (Adam Costello) + Added smakefile.ppc (with SCOPTIONS.ppc) for Amiga PPC (Andreas Kleinert) +version 1.0.0a [March 9, 1998] + Fixed three bugs in pngrtran.c to make gamma+background handling consistent + (Greg Roelofs) + Changed format of the PNG_LIBPNG_VER integer to xyyzz instead of xyz + for major, minor, and bugfix releases. This is 10001. (Adam Costello, + Tom Lane) + Make months range from 1-12 in png_convert_to_rfc1123 +version 1.0.0b [March 13, 1998] + Quieted compiler complaints about two empty "for" loops in pngrutil.c + Minor changes to makefile.s2x + Removed #ifdef/#endif around a png_free() in pngread.c + +version 1.0.1 [March 14, 1998] + Changed makefile.s2x to reduce security risk of using a relative pathname + Fixed some typos in the documentation (Greg). + Fixed a problem with value of "channels" returned by png_read_update_info() +version 1.0.1a [April 21, 1998] + Optimized Paeth calculations by replacing abs() function calls with intrinsics + plus other loop optimizations. Improves avg decoding speed by about 20%. + Commented out i386istic "align" compiler flags in makefile.lnx. + Reduced the default warning level in some makefiles, to make them consistent. + Removed references to IJG and JPEG in the ansi2knr.c copyright statement. + Fixed a bug in png_do_strip_filler with XXRRGGBB => RRGGBB transformation. + Added grayscale and 16-bit capability to png_do_read_filler(). + Fixed a bug in pngset.c, introduced in version 0.99c, that sets rowbytes + too large when writing an image with bit_depth < 8 (Bob Dellaca). + Corrected some bugs in the experimental weighted filtering heuristics. + Moved a misplaced pngrutil code block that truncates tRNS if it has more + than num_palette entries -- test was done before num_palette was defined. + Fixed a png_convert_to_rfc1123() bug that converts day 31 to 0 (Steve Eddins). + Changed compiler flags in makefile.wat for better optimization (Pawel Mrochen). +version 1.0.1b [May 2, 1998] + Relocated png_do_gray_to_rgb() within png_do_read_transformations() (Greg). + Relocated the png_composite macros from pngrtran.c to png.h (Greg). + Added makefile.sco (contributed by Mike Hopkirk). + Fixed two bugs (missing definitions of "istop") introduced in libpng-1.0.1a. + Fixed a bug in pngrtran.c that would set channels=5 under some circumstances. + More work on the Paeth-filtering, achieving imperceptible speedup (A Kleinert). + More work on loop optimization which may help when compiled with C++ compilers. + Added warnings when people try to use transforms they've defined out. + Collapsed 4 "i" and "c" loops into single "i" loops in pngrtran and pngwtran. + Revised paragraph about png_set_expand() in libpng.txt and libpng.3 (Greg) +version 1.0.1c [May 11, 1998] + Fixed a bug in pngrtran.c (introduced in libpng-1.0.1a) where the masks for + filler bytes should have been 0xff instead of 0xf. + Added max_pixel_depth=32 in pngrutil.c when using FILLER with palette images. + Moved PNG_WRITE_WEIGHTED_FILTER_SUPPORTED and PNG_WRITE_FLUSH_SUPPORTED + out of the PNG_WRITE_TRANSFORMS_NOT_SUPPORTED block of pngconf.h + Added "PNG_NO_WRITE_TRANSFORMS" etc., as alternatives for *_NOT_SUPPORTED, + for consistency, in pngconf.h + Added individual "ifndef PNG_NO_[CAPABILITY]" in pngconf.h to make it easier + to remove unwanted capabilities via the compile line + Made some corrections to grammar (which, it's) in documentation (Greg). + Corrected example.c, use of row_pointers in png_write_image(). +version 1.0.1d [May 24, 1998] + Corrected several statements that used side effects illegally in pngrutil.c + and pngtrans.c, that were introduced in version 1.0.1b + Revised png_read_rows() to avoid repeated if-testing for NULL (A Kleinert) + More corrections to example.c, use of row_pointers in png_write_image() + and png_read_rows(). + Added pngdll.mak and pngdef.pas to scripts directory, contributed by + Bob Dellaca, to make a png32bd.dll with Borland C++ 4.5 + Fixed error in example.c with png_set_text: num_text is 3, not 2 (Guido V.) + Changed several loops from count-down to count-up, for consistency. +version 1.0.1e [June 6, 1998] + Revised libpng.txt and libpng.3 description of png_set_read|write_fn(), and + added warnings when people try to set png_read_fn and png_write_fn in + the same structure. + Added a test such that png_do_gamma will be done when num_trans==0 + for truecolor images that have defined a background. This corrects an + error that was introduced in libpng-0.90 that can cause gamma processing + to be skipped. + Added tests in png.h to include "trans" and "trans_values" in structures + when PNG_READ_BACKGROUND_SUPPORTED or PNG_READ_EXPAND_SUPPORTED is defined. + Add png_free(png_ptr->time_buffer) in png_destroy_read_struct() + Moved png_convert_to_rfc_1123() from pngwrite.c to png.c + Added capability for user-provided malloc_fn() and free_fn() functions, + and revised pngtest.c to demonstrate their use, replacing the + PNGTEST_DEBUG_MEM feature. + Added makefile.w32, for Microsoft C++ 4.0 and later (Tim Wegner). + +version 1.0.2 [June 14, 1998] + Fixed two bugs in makefile.bor . +version 1.0.2a [December 30, 1998] + Replaced and extended code that was removed from png_set_filler() in 1.0.1a. + Fixed a bug in png_do_filler() that made it fail to write filler bytes in + the left-most pixel of each row (Kevin Bracey). + Changed "static pngcharp tIME_string" to "static char tIME_string[30]" + in pngtest.c (Duncan Simpson). + Fixed a bug in pngtest.c that caused pngtest to try to write a tIME chunk + even when no tIME chunk was present in the source file. + Fixed a problem in pngrutil.c: gray_to_rgb didn't always work with 16-bit. + Fixed a problem in png_read_push_finish_row(), which would not skip some + passes that it should skip, for images that are less than 3 pixels high. + Interchanged the order of calls to png_do_swap() and png_do_shift() + in pngwtran.c (John Cromer). + Added #ifdef PNG_DEBUG/#endif surrounding use of PNG_DEBUG in png.h . + Changed "bad adaptive filter type" from error to warning in pngrutil.c . + Fixed a documentation error about default filtering with 8-bit indexed-color. + Separated the PNG_NO_STDIO macro into PNG_NO_STDIO and PNG_NO_CONSOLE_IO + (L. Peter Deutsch). + Added png_set_rgb_to_gray() and png_get_rgb_to_gray_status() functions. + Added png_get_copyright() and png_get_header_version() functions. + Revised comments on png_set_progressive_read_fn() in libpng.txt and example.c + Added information about debugging in libpng.txt and libpng.3 . + Changed "ln -sf" to "ln -s -f" in makefile.s2x, makefile.lnx, and makefile.sco. + Removed lines after Dynamic Dependencies" in makefile.aco . + Revised makefile.dec to make a shared library (Jeremie Petit). + Removed trailing blanks from all files. +version 1.0.2a [January 6, 1999] + Removed misplaced #endif and #ifdef PNG_NO_EXTERN near the end of png.h + Added "if" tests to silence complaints about unused png_ptr in png.h and png.c + Changed "check_if_png" function in example.c to return true (nonzero) if PNG. + Changed libpng.txt to demonstrate png_sig_cmp() instead of png_check_sig() + which is obsolete. + +version 1.0.3 [January 14, 1999] + Added makefile.hux, for Hewlett Packard HPUX 10.20 and 11.00 (Jim Rice) + Added a statement of Y2K compliance in png.h, libpng.3, and Y2KINFO. +version 1.0.3a [August 12, 1999] + Added check for PNG_READ_INTERLACE_SUPPORTED in pngread.c; issue a warning + if an attempt is made to read an interlaced image when it's not supported. + Added check if png_ptr->trans is defined before freeing it in pngread.c + Modified the Y2K statement to include versions back to version 0.71 + Fixed a bug in the check for valid IHDR bit_depth/color_types in pngrutil.c + Modified makefile.wat (added -zp8 flag, ".symbolic", changed some comments) + Replaced leading blanks with tab characters in makefile.hux + Changed "dworkin.wustl.edu" to "ccrc.wustl.edu" in various documents. + Changed (float)red and (float)green to (double)red, (double)green + in png_set_rgb_to_gray() to avoid "promotion" problems in AIX. + Fixed a bug in pngconf.h that omitted when PNG_DEBUG==0 (K Bracey). + Reformatted libpng.3 and libpngpf.3 with proper fonts (script by J. vanZandt). + Updated documentation to refer to the PNG-1.2 specification. + Removed ansi2knr.c and left pointers to the latest source for ansi2knr.c + in makefile.knr, INSTALL, and README (L. Peter Deutsch) + Fixed bugs in calculation of the length of rowbytes when adding alpha + channels to 16-bit images, in pngrtran.c (Chris Nokleberg) + Added function png_set_user_transform_info() to store user_transform_ptr, + user_depth, and user_channels into the png_struct, and a function + png_get_user_transform_ptr() to retrieve the pointer (Chris Nokleberg) + Added function png_set_empty_plte_permitted() to make libpng useable + in MNG applications. + Corrected the typedef for png_free_ptr in png.h (Jesse Jones). + Correct gamma with srgb is 45455 instead of 45000 in pngrutil.c, to be + consistent with PNG-1.2, and allow variance of 500 before complaining. + Added assembler code contributed by Intel in file pngvcrd.c and modified + makefile.w32 to use it (Nirav Chhatrapati, INTEL Corporation, Gilles Vollant) + Changed "ln -s -f" to "ln -f -s" in the makefiles to make Solaris happy. + Added some aliases for png_set_expand() in pngrtran.c, namely + png_set_expand_PLTE(), png_set_expand_depth(), and png_set_expand_tRNS() + (Greg Roelofs, in "PNG: The Definitive Guide"). + Added makefile.beo for BEOS on X86, contributed by Sander Stok. +version 1.0.3b [August 26, 1999] + Replaced 2147483647L several places with PNG_MAX_UINT macro, defined in png.h + Changed leading blanks to tabs in all makefiles. + Define PNG_USE_PNGVCRD in makefile.w32, to get MMX assembler code. + Made alternate versions of png_set_expand() in pngrtran.c, namely + png_set_gray_1_2_4_to_8, png_set_palette_to_rgb, and png_set_tRNS_to_alpha + (Greg Roelofs, in "PNG: The Definitive Guide"). Deleted the 1.0.3a aliases. + Relocated start of 'extern "C"' block in png.h so it doesn't include pngconf.h + Revised calculation of num_blocks in pngmem.c to avoid a potentially + negative shift distance, whose results are undefined in the C language. + Added a check in pngset.c to prevent writing multiple tIME chunks. + Added a check in pngwrite.c to detect invalid small window_bits sizes. +version 1.0.3d [September 4, 1999] + Fixed type casting of igamma in pngrutil.c + Added new png_expand functions to scripts/pngdef.pas and pngos2.def + Added a demo read_user_transform_fn that examines the row filters in pngtest.c + +version 1.0.4 [September 24, 1999] + Define PNG_ALWAYS_EXTERN in pngconf.h if __STDC__ is defined + Delete #define PNG_INTERNAL and include "png.h" from pngasmrd.h + Made several minor corrections to pngtest.c + Renamed the makefiles with longer but more user friendly extensions. + Copied the PNG copyright and license to a separate LICENSE file. + Revised documentation, png.h, and example.c to remove reference to + "viewing_gamma" which no longer appears in the PNG specification. + Revised pngvcrd.c to use MMX code for interlacing only on the final pass. + Updated pngvcrd.c to use the faster C filter algorithms from libpng-1.0.1a + Split makefile.win32vc into two versions, makefile.vcawin32 (uses MMX + assembler code) and makefile.vcwin32 (doesn't). + Added a CPU timing report to pngtest.c (enabled by defining PNGTEST_TIMING) + Added a copy of pngnow.png to the distribution. +version 1.0.4a [September 25, 1999] + Increase max_pixel_depth in pngrutil.c if a user transform needs it. + Changed several division operations to right-shifts in pngvcrd.c +version 1.0.4b [September 30, 1999] + Added parentheses in line 3732 of pngvcrd.c + Added a comment in makefile.linux warning about buggy -O3 in pgcc 2.95.1 +version 1.0.4c [October 1, 1999] + Added a "png_check_version" function in png.c and pngtest.c that will generate + a helpful compiler error if an old png.h is found in the search path. + Changed type of png_user_transform_depth|channels from int to png_byte. +version 1.0.4d [October 6, 1999] + Changed 0.45 to 0.45455 in png_set_sRGB() + Removed unused PLTE entries from pngnow.png + Re-enabled some parts of pngvcrd.c (png_combine_row) that work properly. +version 1.0.4e [October 10, 1999] + Fixed sign error in pngvcrd.c (Greg Roelofs) + Replaced some instances of memcpy with simple assignments in pngvcrd (GR-P) +version 1.0.4f [October 15, 1999] + Surrounded example.c code with #if 0 .. #endif to prevent people from + inadvertently trying to compile it. + Changed png_get_header_version() from a function to a macro in png.h + Added type casting mostly in pngrtran.c and pngwtran.c + Removed some pointless "ptr = NULL" in pngmem.c + Added a "contrib" directory containing the source code from Greg's book. + +version 1.0.5 [October 15, 1999] + Minor editing of the INSTALL and README files. +version 1.0.5a [October 23, 1999] + Added contrib/pngsuite and contrib/pngminus (Willem van Schaik) + Fixed a typo in the png_set_sRGB() function call in example.c (Jan Nijtmans) + Further optimization and bugfix of pngvcrd.c + Revised pngset.c so that it does not allocate or free memory in the user's + text_ptr structure. Instead, it makes its own copy. + Created separate write_end_info_struct in pngtest.c for a more severe test. + Added code in pngwrite.c to free info_ptr->text[i].key to stop a memory leak. +version 1.0.5b [November 23, 1999] + Moved PNG_FLAG_HAVE_CHUNK_HEADER, PNG_FLAG_BACKGROUND_IS_GRAY and + PNG_FLAG_WROTE_tIME from flags to mode. + Added png_write_info_before_PLTE() function. + Fixed some typecasting in contrib/gregbook/*.c + Updated scripts/makevms.com and added makevms.com to contrib/gregbook + and contrib/pngminus (Martin Zinser) +version 1.0.5c [November 26, 1999] + Moved png_get_header_version from png.h to png.c, to accommodate ansi2knr. + Removed all global arrays (according to PNG_NO_GLOBAL_ARRAYS macro), to + accommodate making DLL's: Moved usr_png_ver from global variable to function + png_get_header_ver() in png.c. Moved png_sig to png_sig_bytes in png.c and + eliminated use of png_sig in pngwutil.c. Moved the various png_CHNK arrays + into pngtypes.h. Eliminated use of global png_pass arrays. Declared the + png_CHNK and png_pass arrays to be "const". Made the global arrays + available to applications (although none are used in libpng itself) when + PNG_NO_GLOBAL_ARRAYS is not defined or when PNG_GLOBAL_ARRAYS is defined. + Removed some extraneous "-I" from contrib/pngminus/makefile.std + Changed the PNG_sRGB_INTENT macros in png.h to be consistent with PNG-1.2. + Change PNG_SRGB_INTENT to PNG_sRGB_INTENT in libpng.txt and libpng.3 +version 1.0.5d [November 29, 1999] + Add type cast (png_const_charp) two places in png.c + Eliminated pngtypes.h; use macros instead to declare PNG_CHNK arrays. + Renamed "PNG_GLOBAL_ARRAYS" to "PNG_USE_GLOBAL_ARRAYS" and made available + to applications a macro "PNG_USE_LOCAL_ARRAYS". + Remove all the new declarations with #ifdef/#endif when + PNG_USE_GLOBAL_ARRAYS is defined. + Added PNG_EXPORT_VAR macro to accommodate making DLL's. +version 1.0.5e [November 30, 1999] + Added iCCP, iTXt, and sPLT support; added "lang" member to the png_text + structure; refactored the inflate/deflate support to make adding new chunks + with trailing compressed parts easier in the future, and added new functions + png_free_iCCP, png_free_pCAL, png_free_sPLT, png_free_text, png_get_iCCP, + png_get_spalettes, png_set_iCCP, png_set_spalettes (Eric S. Raymond). + NOTE: Applications that write text chunks MUST define png_text->lang + before calling png_set_text(). It must be set to NULL if you want to + write tEXt or zTXt chunks. If you want your application to be able to + run with older versions of libpng, use + + #ifdef PNG_iTXt_SUPPORTED + png_text[i].lang = NULL; + #endif + + Changed png_get_oFFs() and png_set_oFFs() to use signed rather than unsigned + offsets (Eric S. Raymond). + Combined PNG_READ_cHNK_SUPPORTED and PNG_WRITE_cHNK_SUPPORTED macros into + PNG_cHNK_SUPPORTED and combined the three types of PNG_text_SUPPORTED + macros, leaving the separate macros also available. + Removed comments on #endifs at the end of many short, non-nested #if-blocks. +version 1.0.5f [December 6, 1999] + Changed makefile.solaris to issue a warning about potential problems when + the ucb "ld" is in the path ahead of the ccs "ld". + Removed "- [date]" from the "synopsis" line in libpng.3 and libpngpf.3. + Added sCAL chunk support (Eric S. Raymond). +version 1.0.5g [December 7, 1999] + Fixed "png_free_spallettes" typo in png.h + Added code to handle new chunks in pngpread.c + Moved PNG_CHNK string macro definitions outside of PNG_NO_EXTERN block + Added "translated_key" to png_text structure and png_write_iTXt(). + Added code in pngwrite.c to work around a newly discovered zlib bug. +version 1.0.5h [December 10, 1999] + NOTE: regarding the note for version 1.0.5e, the following must also + be included in your code: + png_text[i].translated_key = NULL; + Unknown chunk handling is now supported. + Option to eliminate all floating point support was added. Some new + fixed-point functions such as png_set_gAMA_fixed() were added. + Expanded tabs and removed trailing blanks in source files. +version 1.0.5i [December 13, 1999] + Added some type casts to silence compiler warnings. + Renamed "png_free_spalette" to "png_free_spalettes" for consistency. + Removed leading blanks from a #define in pngvcrd.c + Added some parameters to the new png_set_keep_unknown_chunks() function. + Added a test for up->location != 0 in the first instance of writing + unknown chunks in pngwrite.c + Changed "num" to "i" in png_free_spalettes() and png_free_unknowns() to + prevent recursion. + Added png_free_hIST() function. + Various patches to fix bugs in the sCAL and integer cHRM processing, + and to add some convenience macros for use with sCAL. +version 1.0.5j [December 21, 1999] + Changed "unit" parameter of png_write_sCAL from png_byte to int, to work + around buggy compilers. + Added new type "png_fixed_point" for integers that hold float*100000 values + Restored backward compatibility of tEXt/zTXt chunk processing: + Restored the first four members of png_text to the same order as v.1.0.5d. + Added members "lang_key" and "itxt_length" to png_text struct. Set + text_length=0 when "text" contains iTXt data. Use the "compression" + member to distinguish among tEXt/zTXt/iTXt types. Added + PNG_ITXT_COMPRESSION_NONE (1) and PNG_ITXT_COMPRESSION_zTXt(2) macros. + The "Note" above, about backward incompatibility of libpng-1.0.5e, no + longer applies. + Fixed png_read|write_iTXt() to read|write parameters in the right order, + and to write the iTXt chunk after IDAT if it appears in the end_ptr. + Added pnggccrd.c, version of pngvcrd.c Intel assembler for gcc (Greg Roelofs) + Reversed the order of trying to write floating-point and fixed-point gAMA. +version 1.0.5k [December 27, 1999] + Added many parentheses, e.g., "if (a && b & c)" becomes "if (a && (b & c))" + Added png_handle_as_unknown() function (Glenn) + Added png_free_chunk_list() function and chunk_list and num_chunk_list members + of png_ptr. + Eliminated erroneous warnings about multiple sPLT chunks and sPLT-after-PLTE. + Fixed a libpng-1.0.5h bug in pngrutil.c that was issuing erroneous warnings + about ignoring incorrect gAMA with sRGB (gAMA was in fact not ignored) + Added png_free_tRNS(); png_set_tRNS() now malloc's its own trans array (ESR). + Define png_get_int_32 when oFFs chunk is supported as well as when pCAL is. + Changed type of proflen from png_int_32 to png_uint_32 in png_get_iCCP(). +version 1.0.5l [January 1, 2000] + Added functions png_set_read_user_chunk_fn() and png_get_user_chunk_ptr() + for setting a callback function to handle unknown chunks and for + retrieving the associated user pointer (Glenn). +version 1.0.5m [January 7, 2000] + Added high-level functions png_read_png(), png_write_png(), png_free_pixels(). +version 1.0.5n [January 9, 2000] + Added png_free_PLTE() function, and modified png_set_PLTE() to malloc its + own memory for info_ptr->palette. This makes it safe for the calling + application to free its copy of the palette any time after it calls + png_set_PLTE(). +version 1.0.5o [January 20, 2000] + Cosmetic changes only (removed some trailing blanks and TABs) +version 1.0.5p [January 31, 2000] + Renamed pngdll.mak to makefile.bd32 + Cosmetic changes in pngtest.c +version 1.0.5q [February 5, 2000] + Relocated the makefile.solaris warning about PATH problems. + Fixed pngvcrd.c bug by pushing/popping registers in mmxsupport (Bruce Oberg) + Revised makefile.gcmmx + Added PNG_SETJMP_SUPPORTED, PNG_SETJMP_NOT_SUPPORTED, and PNG_ABORT() macros +version 1.0.5r [February 7, 2000] + Removed superfluous prototype for png_get_itxt from png.h + Fixed a bug in pngrtran.c that improperly expanded the background color. + Return *num_text=0 from png_get_text() when appropriate, and fix documentation + of png_get_text() in libpng.txt/libpng.3. +version 1.0.5s [February 18, 2000] + Added "png_jmp_env()" macro to pngconf.h, to help people migrate to the + new error handler that's planned for the next libpng release, and changed + example.c, pngtest.c, and contrib programs to use this macro. + Revised some of the DLL-export macros in pngconf.h (Greg Roelofs) + Fixed a bug in png_read_png() that caused it to fail to expand some images + that it should have expanded. + Fixed some mistakes in the unused and undocumented INCH_CONVERSIONS functions + in pngget.c + Changed the allocation of palette, history, and trans arrays back to + the version 1.0.5 method (linking instead of copying) which restores + backward compatibility with version 1.0.5. Added some remarks about + that in example.c. Added "free_me" member to info_ptr and png_ptr + and added png_free_data() function. + Updated makefile.linux and makefile.gccmmx to make directories conditionally. + Made cosmetic changes to pngasmrd.h + Added png_set_rows() and png_get_rows(), for use with png_read|write_png(). + Modified png_read_png() to allocate info_ptr->row_pointers only if it + hasn't already been allocated. +version 1.0.5t [March 4, 2000] + Changed png_jmp_env() migration aiding macro to png_jmpbuf(). + Fixed "interlace" typo (should be "interlaced") in contrib/gregbook/read2-x.c + Fixed bug with use of PNG_BEFORE_IHDR bit in png_ptr->mode, introduced when + PNG_FLAG_HAVE_CHUNK_HEADER was moved into png_ptr->mode in version 1.0.5b + Files in contrib/gregbook were revised to use png_jmpbuf() and to select + a 24-bit visual if one is available, and to allow abbreviated options. + Files in contrib/pngminus were revised to use the png_jmpbuf() macro. + Removed spaces in makefile.linux and makefile.gcmmx, introduced in 1.0.5s +version 1.0.5u [March 5, 2000] + Simplified the code that detects old png.h in png.c and pngtest.c + Renamed png_spalette (_p, _pp) to png_sPLT_t (_tp, _tpp) + Increased precision of rgb_to_gray calculations from 8 to 15 bits and + added png_set_rgb_to_gray_fixed() function. + Added makefile.bc32 (32-bit Borland C++, C mode) +version 1.0.5v [March 11, 2000] + Added some parentheses to the png_jmpbuf macro definition. + Updated references to the zlib home page, which has moved to freesoftware.com. + Corrected bugs in documentation regarding png_read_row() and png_write_row(). + Updated documentation of png_rgb_to_gray calculations in libpng.3/libpng.txt. + Renamed makefile.borland,turboc3 back to makefile.bor,tc3 as in version 1.0.3, + revised borland makefiles; added makefile.ibmvac3 and makefile.gcc (Cosmin) + +version 1.0.6 [March 20, 2000] + Minor revisions of makefile.bor, libpng.txt, and gregbook/rpng2-win.c + Added makefile.sggcc (SGI IRIX with gcc) +version 1.0.6d [April 7, 2000] + Changed sprintf() to strcpy() in png_write_sCAL_s() to work without STDIO + Added data_length parameter to png_decompress_chunk() function + Revised documentation to remove reference to abandoned png_free_chnk functions + Fixed an error in png_rgb_to_gray_fixed() + Revised example.c, usage of png_destroy_write_struct(). + Renamed makefile.ibmvac3 to makefile.ibmc, added libpng.icc IBM project file + Added a check for info_ptr->free_me&PNG_FREE_TEXT when freeing text in png.c + Simplify png_sig_bytes() function to remove use of non-ISO-C strdup(). +version 1.0.6e [April 9, 2000] + Added png_data_freer() function. + In the code that checks for over-length tRNS chunks, added check of + info_ptr->num_trans as well as png_ptr->num_trans (Matthias Benckmann) + Minor revisions of libpng.txt/libpng.3. + Check for existing data and free it if the free_me flag is set, in png_set_*() + and png_handle_*(). + Only define PNG_WEIGHTED_FILTERS_SUPPORTED when PNG_FLOATING_POINT_SUPPORTED + is defined. + Changed several instances of PNG_NO_CONSOLE_ID to PNG_NO_STDIO in pngrutil.c + and mentioned the purposes of the two macros in libpng.txt/libpng.3. +version 1.0.6f [April 14, 2000] + Revised png_set_iCCP() and png_set_rows() to avoid prematurely freeing data. + Add checks in png_set_text() for NULL members of the input text structure. + Revised libpng.txt/libpng.3. + Removed superfluous prototype for png_set_itxt from png.h + Removed "else" from pngread.c, after png_error(), and changed "0" to "length". + Changed several png_errors about malformed ancillary chunks to png_warnings. +version 1.0.6g [April 24, 2000] + Added png_pass-* arrays to pnggccrd.c when PNG_USE_LOCAL_ARRAYS is defined. + Relocated paragraph about png_set_background() in libpng.3/libpng.txt + and other revisions (Matthias Benckmann) + Relocated info_ptr->free_me, png_ptr->free_me, and other info_ptr and + png_ptr members to restore binary compatibility with libpng-1.0.5 + (breaks compatibility with libpng-1.0.6). +version 1.0.6h [April 24, 2000] + Changed shared library so-number pattern from 2.x.y.z to xy.z (this builds + libpng.so.10 & libpng.so.10.6h instead of libpng.so.2 & libpng.so.2.1.0.6h) + This is a temporary change for test purposes. +version 1.0.6i [May 2, 2000] + Rearranged some members at the end of png_info and png_struct, to put + unknown_chunks_num and free_me within the original size of the png_structs + and free_me, png_read_user_fn, and png_free_fn within the original png_info, + because some old applications allocate the structs directly instead of + using png_create_*(). + Added documentation of user memory functions in libpng.txt/libpng.3 + Modified png_read_png so that it will use user_allocated row_pointers + if present, unless free_me directs that it be freed, and added description + of the use of png_set_rows() and png_get_rows() in libpng.txt/libpng.3. + Added PNG_LEGACY_SUPPORTED macro, and #ifdef out all new (since version + 1.00) members of png_struct and png_info, to regain binary compatibility + when you define this macro. Capabilities lost in this event + are user transforms (new in version 1.0.0),the user transform pointer + (new in version 1.0.2), rgb_to_gray (new in 1.0.5), iCCP, sCAL, sPLT, + the high-level interface, and unknown chunks support (all new in 1.0.6). + This was necessary because of old applications that allocate the structs + directly as authors were instructed to do in libpng-0.88 and earlier, + instead of using png_create_*(). + Added modes PNG_CREATED_READ_STRUCT and PNG_CREATED_WRITE_STRUCT which + can be used to detect codes that directly allocate the structs, and + code to check these modes in png_read_init() and png_write_init() and + generate a libpng error if the modes aren't set and PNG_LEGACY_SUPPORTED + was not defined. + Added makefile.intel and updated makefile.watcom (Pawel Mrochen) +version 1.0.6j [May 3, 2000] + Overloaded png_read_init() and png_write_init() with macros that convert + calls to png_read_init_2() or png_write_init_2() that check the version + and structure sizes. +version 1.0.7beta11 [May 7, 2000] + Removed the new PNG_CREATED_READ_STRUCT and PNG_CREATED_WRITE_STRUCT modes + which are no longer used. + Eliminated the three new members of png_text when PNG_LEGACY_SUPPORTED is + defined or when neither PNG_READ_iTXt_SUPPORTED nor PNG_WRITE_iTXT_SUPPORTED + is defined. + Made PNG_NO_READ|WRITE_iTXt the default setting, to avoid memory + overrun when old applications fill the info_ptr->text structure directly. + Added PNGAPI macro, and added it to the definitions of all exported functions. + Relocated version macro definitions ahead of the includes of zlib.h and + pngconf.h in png.h. +version 1.0.7beta12 [May 12, 2000] + Revised pngset.c to avoid a problem with expanding the png_debug macro. + Deleted some extraneous defines from pngconf.h + Made PNG_NO_CONSOLE_IO the default condition when PNG_BUILD_DLL is defined. + Use MSC _RPTn debugging instead of fprintf if _MSC_VER is defined. + Added png_access_version_number() function. + Check for mask&PNG_FREE_CHNK (for TEXT, SCAL, PCAL) in png_free_data(). + Expanded libpng.3/libpng.txt information about png_data_freer(). +version 1.0.7beta14 [May 17, 2000] (beta13 was not published) + Changed pnggccrd.c and pngvcrd.c to handle bad adaptive filter types as + warnings instead of errors, as pngrutil.c does. + Set the PNG_INFO_IDAT valid flag in png_set_rows() so png_write_png() + will actually write IDATs. + Made the default PNG_USE_LOCAL_ARRAYS depend on PNG_DLL instead of WIN32. + Make png_free_data() ignore its final parameter except when freeing data + that can have multiple instances (text, sPLT, unknowns). + Fixed a new bug in png_set_rows(). + Removed info_ptr->valid tests from png_free_data(), as in version 1.0.5. + Added png_set_invalid() function. + Fixed incorrect illustrations of png_destroy_write_struct() in example.c. +version 1.0.7beta15 [May 30, 2000] + Revised the deliberately erroneous Linux setjmp code in pngconf.h to produce + fewer error messages. + Rearranged checks for Z_OK to check the most likely path first in pngpread.c + and pngwutil.c. + Added checks in pngtest.c for png_create_*() returning NULL, and mentioned + in libpng.txt/libpng.3 the need for applications to check this. + Changed names of png_default_*() functions in pngtest to pngtest_*(). + Changed return type of png_get_x|y_offset_*() from png_uint_32 to png_int_32. + Fixed some bugs in the unused PNG_INCH_CONVERSIONS functions in pngget.c + Set each pointer to NULL after freeing it in png_free_data(). + Worked around a problem in pngconf.h; AIX's strings.h defines an "index" + macro that conflicts with libpng's png_color_16.index. (Dimitri Papadapoulos) + Added "msvc" directory with MSVC++ project files (Simon-Pierre Cadieux). +version 1.0.7beta16 [June 4, 2000] + Revised the workaround of AIX string.h "index" bug. + Added a check for overlength PLTE chunk in pngrutil.c. + Added PNG_NO_POINTER_INDEXING macro to use array-indexing instead of pointer + indexing in pngrutil.c and pngwutil.c to accommodate a buggy compiler. + Added a warning in png_decompress_chunk() when it runs out of data, e.g. + when it tries to read an erroneous PhotoShop iCCP chunk. + Added PNG_USE_DLL macro. + Revised the copyright/disclaimer/license notice. + Added contrib/msvctest directory +version 1.0.7rc1 [June 9, 2000] + Corrected the definition of PNG_TRANSFORM_INVERT_ALPHA (0x0400 not 0x0200) + Added contrib/visupng directory (Willem van Schaik) +version 1.0.7beta18 [June 23, 2000] + Revised PNGAPI definition, and pngvcrd.c to work with __GCC__ + and do not redefine PNGAPI if it is passed in via a compiler directive. + Revised visupng/PngFile.c to remove returns from within the Try block. + Removed leading underscores from "_PNG_H" and "_PNG_SAVE_BSD_SOURCE" macros. + Updated contrib/visupng/cexcept.h to version 1.0.0. + Fixed bugs in pngwrite.c and pngwutil.c that prevented writing iCCP chunks. +version 1.0.7rc2 [June 28, 2000] + Updated license to include disclaimers required by UCITA. + Fixed "DJBPP" typo in pnggccrd.c introduced in beta18. + +version 1.0.7 [July 1, 2000] + Revised the definition of "trans_values" in libpng.3/libpng.txt +version 1.0.8beta1 [July 8, 2000] + Added png_free(png_ptr, key) two places in pngpread.c to stop memory leaks. + Changed PNG_NO_STDIO to PNG_NO_CONSOLE_IO, several places in pngrutil.c and + pngwutil.c. + Changed PNG_EXPORT_VAR to use PNG_IMPEXP, in pngconf.h. + Removed unused "#include " from png.c + Added WindowsCE support. + Revised pnggccrd.c to work with gcc-2.95.2 and in the Cygwin environment. +version 1.0.8beta2 [July 10, 2000] + Added project files to the wince directory and made further revisions + of pngtest.c, pngrio.c, and pngwio.c in support of WindowsCE. +version 1.0.8beta3 [July 11, 2000] + Only set the PNG_FLAG_FREE_TRNS or PNG_FREE_TRNS flag in png_handle_tRNS() + for indexed-color input files to avoid potential double-freeing trans array + under some unusual conditions; problem was introduced in version 1.0.6f. + Further revisions to pngtest.c and files in the wince subdirectory. +version 1.0.8beta4 [July 14, 2000] + Added the files pngbar.png and pngbar.jpg to the distribution. + Added makefile.cygwin, and cygwin support in pngconf.h + Added PNG_NO_ZALLOC_ZERO macro (makes png_zalloc skip zeroing memory) +version 1.0.8rc1 [July 16, 2000] + Revised png_debug() macros and statements to eliminate compiler warnings. + +version 1.0.8 [July 24, 2000] + Added png_flush() in pngwrite.c, after png_write_IEND(). + Updated makefile.hpux to build a shared library. +version 1.0.9beta1 [November 10, 2000] + Fixed typo in scripts/makefile.hpux + Updated makevms.com in scripts and contrib/* and contrib/* (Martin Zinser) + Fixed seqence-point bug in contrib/pngminus/png2pnm (Martin Zinser) + Changed "cdrom.com" in documentation to "libpng.org" + Revised pnggccrd.c to get it all working, and updated makefile.gcmmx (Greg). + Changed type of "params" from voidp to png_voidp in png_read|write_png(). + Make sure PNGAPI and PNG_IMPEXP are defined in pngconf.h. + Revised the 3 instances of WRITEFILE in pngtest.c. + Relocated "msvc" and "wince" project subdirectories into "dll" subdirectory. + Updated png.rc in dll/msvc project + Revised makefile.dec to define and use LIBPATH and INCPATH + Increased size of global png_libpng_ver[] array from 12 to 18 chars. + Made global png_libpng_ver[], png_sig[] and png_pass_*[] arrays const. + Removed duplicate png_crc_finish() from png_handle_bKGD() function. + Added a warning when application calls png_read_update_info() multiple times. + Revised makefile.cygwin + Fixed bugs in iCCP support in pngrutil.c and pngwutil.c. + Replaced png_set_empty_plte_permitted() with png_permit_mng_features(). +version 1.0.9beta2 [November 19, 2000] + Renamed the "dll" subdirectory "projects". + Added borland project files to "projects" subdirectory. + Set VS_FF_PRERELEASE and VS_FF_PATCHED flags in msvc/png.rc when appropriate. + Add error message in png_set_compression_buffer_size() when malloc fails. +version 1.0.9beta3 [November 23, 2000] + Revised PNG_LIBPNG_BUILD_TYPE macro in png.h, used in the msvc project. + Removed the png_flush() in pngwrite.c that crashes some applications + that don't set png_output_flush_fn. + Added makefile.macosx and makefile.aix to scripts directory. +version 1.0.9beta4 [December 1, 2000] + Change png_chunk_warning to png_warning in png_check_keyword(). + Increased the first part of msg buffer from 16 to 18 in png_chunk_error(). +version 1.0.9beta5 [December 15, 2000] + Added support for filter method 64 (for PNG datastreams embedded in MNG). +version 1.0.9beta6 [December 18, 2000] + Revised png_set_filter() to accept filter method 64 when appropriate. + Added new PNG_HAVE_PNG_SIGNATURE bit to png_ptr->mode and use it to + help prevent applications from using MNG features in PNG datastreams. + Added png_permit_mng_features() function. + Revised libpng.3/libpng.txt. Changed "filter type" to "filter method". +version 1.0.9rc1 [December 23, 2000] + Revised test for PNG_HAVE_PNG_SIGNATURE in pngrutil.c + Fixed error handling of unknown compression type in png_decompress_chunk(). + In pngconf.h, define __cdecl when _MSC_VER is defined. +version 1.0.9beta7 [December 28, 2000] + Changed PNG_TEXT_COMPRESSION_zTXt to PNG_COMPRESSION_TYPE_BASE several places. + Revised memory management in png_set_hIST and png_handle_hIST in a backward + compatible manner. PLTE and tRNS were revised similarly. + Revised the iCCP chunk reader to ignore trailing garbage. +version 1.0.9beta8 [January 12, 2001] + Moved pngasmrd.h into pngconf.h. + Improved handling of out-of-spec garbage iCCP chunks generated by PhotoShop. +version 1.0.9beta9 [January 15, 2001] + Added png_set_invalid, png_permit_mng_features, and png_mmx_supported to + wince and msvc project module definition files. + Minor revision of makefile.cygwin. + Fixed bug with progressive reading of narrow interlaced images in pngpread.c +version 1.0.9beta10 [January 16, 2001] + Do not typedef png_FILE_p in pngconf.h when PNG_NO_STDIO is defined. + Fixed "png_mmx_supported" typo in project definition files. +version 1.0.9beta11 [January 19, 2001] + Updated makefile.sgi to make shared library. + Removed png_mmx_support() function and disabled PNG_MNG_FEATURES_SUPPORTED + by default, for the benefit of DLL forward compatibility. These will + be re-enabled in version 1.2.0. +version 1.0.9rc2 [January 22, 2001] + Revised cygwin support. + +version 1.0.9 [January 31, 2001] + Added check of cygwin's ALL_STATIC in pngconf.h + Added "-nommx" parameter to contrib/gregbook/rpng2-win and rpng2-x demos. +version 1.0.10beta1 [March 14, 2001] + Revised makefile.dec, makefile.sgi, and makefile.sggcc; added makefile.hpgcc. + Reformatted libpng.3 to eliminate bad line breaks. + Added checks for _mmx_supported in the read_filter_row function of pnggccrd.c + Added prototype for png_mmx_support() near the top of pnggccrd.c + Moved some error checking from png_handle_IHDR to png_set_IHDR. + Added PNG_NO_READ_SUPPORTED and PNG_NO_WRITE_SUPPORTED macros. + Revised png_mmx_support() function in pnggccrd.c + Restored version 1.0.8 PNG_WRITE_EMPTY_PLTE_SUPPORTED behavior in pngwutil.c + Fixed memory leak in contrib/visupng/PngFile.c + Fixed bugs in png_combine_row() in pnggccrd.c and pngvcrd.c (C version) + Added warnings when retrieving or setting gamma=0. + Increased the first part of msg buffer from 16 to 18 in png_chunk_warning(). +version 1.0.10rc1 [March 23, 2001] + Changed all instances of memcpy, strcpy, and strlen to png_memcpy, png_strcpy, + and png_strlen. + Revised png_mmx_supported() function in pnggccrd.c to return proper value. + Fixed bug in progressive reading (pngpread.c) with small images (height < 8). + +version 1.0.10 [March 30, 2001] + Deleted extraneous space (introduced in 1.0.9) from line 42 of makefile.cygwin + Added beos project files (Chris Herborth) +version 1.0.11beta1 [April 3, 2001] + Added type casts on several png_malloc() calls (Dimitri Papadapoulos). + Removed a no-longer needed AIX work-around from pngconf.h + Changed several "//" single-line comments to C-style in pnggccrd.c +version 1.0.11beta2 [April 11, 2001] + Removed PNGAPI from several functions whose prototypes did not have PNGAPI. + Updated scripts/pngos2.def +version 1.0.11beta3 [April 14, 2001] + Added checking the results of many instances of png_malloc() for NULL +version 1.0.11beta4 [April 20, 2001] + Undid the changes from version 1.0.11beta3. Added a check for NULL return + from user's malloc_fn(). + Removed some useless type casts of the NULL pointer. + Added makefile.netbsd + +version 1.0.11 [April 27, 2001] + Revised makefile.netbsd +version 1.0.12beta1 [May 14, 2001] + Test for Windows platform in pngconf.h when including malloc.h (Emmanuel Blot) + Updated makefile.cygwin and handling of Cygwin's ALL_STATIC in pngconf.h + Added some never-to-be-executed code in pnggccrd.c to quiet compiler warnings. + Eliminated the png_error about apps using png_read|write_init(). Instead, + libpng will reallocate the png_struct and info_struct if they are too small. + This retains future binary compatibility for old applications written for + libpng-0.88 and earlier. +version 1.2.0beta1 [May 6, 2001] + Bumped DLLNUM to 2. + Re-enabled PNG_MNG_FEATURES_SUPPORTED and enabled PNG_ASSEMBLER_CODE_SUPPORTED + by default. + Added runtime selection of MMX features. + Added png_set_strip_error_numbers function and related macros. +version 1.2.0beta2 [May 7, 2001] + Finished merging 1.2.0beta1 with version 1.0.11 + Added a check for attempts to read or write PLTE in grayscale PNG datastreams. +version 1.2.0beta3 [May 17, 2001] + Enabled user memory function by default. + Modified png_create_struct so it passes user mem_ptr to user memory allocator. + Increased png_mng_features flag from png_byte to png_uint_32. + Bumped shared-library (so-number) and dll-number to 3. +version 1.2.0beta4 [June 23, 2001] + Check for missing profile length field in iCCP chunk and free chunk_data + in case of truncated iCCP chunk. + Bumped shared-library number to 3 in makefile.sgi and makefile.sggcc + Bumped dll-number from 2 to 3 in makefile.cygwin + Revised contrib/gregbook/rpng*-x.c to avoid a memory leak and to exit cleanly + if user attempts to run it on an 8-bit display. + Updated contrib/gregbook + Use png_malloc instead of png_zalloc to allocate palette in pngset.c + Updated makefile.ibmc + Added some typecasts to eliminate gcc 3.0 warnings. Changed prototypes + of png_write_oFFS width and height from png_uint_32 to png_int_32. + Updated example.c + Revised prototypes for png_debug_malloc and png_debug_free in pngtest.c +version 1.2.0beta5 [August 8, 2001] + Revised contrib/gregbook + Revised makefile.gcmmx + Revised pnggccrd.c to conditionally compile some thread-unsafe code only + when PNG_THREAD_UNSAFE_OK is defined. + Added tests to prevent pngwutil.c from writing a bKGD or tRNS chunk with + value exceeding 2^bit_depth-1 + Revised makefile.sgi and makefile.sggcc + Replaced calls to fprintf(stderr,...) with png_warning() in pnggccrd.c + Removed restriction that do_invert_mono only operate on 1-bit opaque files + +version 1.2.0 [September 1, 2001] + Changed a png_warning() to png_debug() in pnggccrd.c + Fixed contrib/gregbook/rpng-x.c, rpng2-x.c to avoid crash with XFreeGC(). +version 1.2.1beta1 [October 19, 2001] + Revised makefile.std in contrib/pngminus + Include background_1 in png_struct regardless of gamma support. + Revised makefile.netbsd and makefile.macosx, added makefile.darwin. + Revised example.c to provide more details about using row_callback(). +version 1.2.1beta2 [October 25, 2001] + Added type cast to each NULL appearing in a function call, except for + WINCE functions. + Added makefile.so9. +version 1.2.1beta3 [October 27, 2001] + Removed type casts from all NULLs. + Simplified png_create_struct_2(). +version 1.2.1beta4 [November 7, 2001] + Revised png_create_info_struct() and png_creat_struct_2(). + Added error message if png_write_info() was omitted. + Type cast NULLs appearing in function calls when _NO_PROTO or + PNG_TYPECAST_NULL is defined. +version 1.2.1rc1 [November 24, 2001] + Type cast NULLs appearing in function calls except when PNG_NO_TYPECAST_NULL + is defined. + Changed typecast of "size" argument to png_size_t in pngmem.c calls to + the user malloc_fn, to agree with the prototype in png.h + Added a pop/push operation to pnggccrd.c, to preserve Eflag (Maxim Sobolev) + Updated makefile.sgi to recognize LIBPATH and INCPATH. + Updated various makefiles so "make clean" does not remove previous major + version of the shared library. +version 1.2.1rc2 [December 4, 2001] + Always allocate 256-entry internal palette, hist, and trans arrays, to + avoid out-of-bounds memory reference caused by invalid PNG datastreams. + Added a check for prefix_length > data_length in iCCP chunk handler. + +version 1.2.1 [December 7, 2001] + None. +version 1.2.2beta1 [February 22, 2002] + Fixed a bug with reading the length of iCCP profiles (Larry Reeves). + Revised makefile.linux, makefile.gcmmx, and makefile.sgi to generate + libpng.a, libpng12.so (not libpng.so.3), and libpng12/png.h + Revised makefile.darwin to remove "-undefined suppress" option. + Added checks for gamma and chromaticity values over 21474.83, which exceed + the limit for PNG unsigned 32-bit integers when encoded. + Revised calls to png_create_read_struct() and png_create_write_struct() + for simpler debugging. + Revised png_zalloc() so zlib handles errors (uses PNG_FLAG_MALLOC_NULL_MEM_OK) +version 1.2.2beta2 [February 23, 2002] + Check chunk_length and idat_size for invalid (over PNG_MAX_UINT) lengths. + Check for invalid image dimensions in png_get_IHDR. + Added missing "fi;" in the install target of the SGI makefiles. + Added install-static to all makefiles that make shared libraries. + Always do gamma compensation when image is partially transparent. +version 1.2.2beta3 [March 7, 2002] + Compute background.gray and background_1.gray even when color_type is RGB + in case image gets reduced to gray later. + Modified shared-library makefiles to install pkgconfig/libpngNN.pc. + Export (with PNGAPI) png_zalloc, png_zfree, and png_handle_as_unknown + Removed unused png_write_destroy_info prototype from png.h + Eliminated incorrect use of width_mmx from pnggccrd.c in pixel_bytes == 8 case + Added install-shared target to all makefiles that make shared libraries. + Stopped a double free of palette, hist, and trans when not using free_me. + Added makefile.32sunu for Sun Ultra 32 and makefile.64sunu for Sun Ultra 64. +version 1.2.2beta4 [March 8, 2002] + Compute background.gray and background_1.gray even when color_type is RGB + in case image gets reduced to gray later (Jason Summers). + Relocated a misplaced /bin/rm in the "install-shared" makefile targets + Added PNG_1_0_X macro which can be used to build a 1.0.x-compatible library. +version 1.2.2beta5 [March 26, 2002] + Added missing PNGAPI to several function definitions. + Check for invalid bit_depth or color_type in png_get_IHDR(), and + check for missing PLTE or IHDR in png_push_read_chunk() (Matthias Clasen). + Revised iTXt support to accept NULL for lang and lang_key. + Compute gamma for color components of background even when color_type is gray. + Changed "()" to "{}" in scripts/libpng.pc.in. + Revised makefiles to put png.h and pngconf.h only in $prefix/include/libpngNN + Revised makefiles to make symlink to libpng.so.NN in addition to libpngNN.so +version 1.2.2beta6 [March 31, 2002] +version 1.0.13beta1 [March 31, 2002] + Prevent png_zalloc() from trying to memset memory that it failed to acquire. + Add typecasts of PNG_MAX_UINT in pngset_cHRM_fixed() (Matt Holgate). + Ensure that the right function (user or default) is used to free the + png_struct after an error in png_create_read_struct_2(). +version 1.2.2rc1 [April 7, 2002] +version 1.0.13rc1 [April 7, 2002] + Save the ebx register in pnggccrd.c (Sami Farin) + Add "mem_ptr = png_ptr->mem_ptr" in png_destroy_write_struct() (Paul Gardner). + Updated makefiles to put headers in include/libpng and remove old include/*.h. + +version 1.2.2 [April 15, 2002] +version 1.0.13 [April 15, 2002] + Revised description of png_set_filter() in libpng.3/libpng.txt. + Revised makefile.netbsd and added makefile.neNNbsd and makefile.freebsd +version 1.0.13patch01 [April 17, 2002] +version 1.2.2patch01 [April 17, 2002] + Changed ${PNGMAJ}.${PNGVER} bug to ${PNGVER} in makefile.sgi and makefile.sggcc + Fixed VER -> PNGVER typo in makefile.macosx and added install-static to install + Added install: target to makefile.32sunu and makefile.64sunu +version 1.0.13patch03 [April 18, 2002] +version 1.2.2patch03 [April 18, 2002] + Revised 15 makefiles to link libpng.a to libpngNN.a and the include libpng + subdirectory to libpngNN subdirectory without the full pathname. + Moved generation of libpng.pc from "install" to "all" in 15 makefiles. +version 1.2.3rc1 [April 28, 2002] + Added install-man target to 15 makefiles (Dimitri Papadopolous-Orfanos). + Added $(DESTDIR) feature to 24 makefiles (Tim Mooney) + Fixed bug with $prefix, should be $(prefix) in makefile.hpux. + Updated cygwin-specific portion of pngconf.h and revised makefile.cygwin + Added a link from libpngNN.pc to libpng.pc in 15 makefiles. + Added links from include/libpngNN/*.h to include/*.h in 24 makefiles. + Revised makefile.darwin to make relative links without full pathname. + Added setjmp() at the end of png_create_*_struct_2() in case user forgets + to put one in their application. + Restored png_zalloc() and png_zfree() prototypes to version 1.2.1 and + removed them from module definition files. +version 1.2.3rc2 [May 1, 2002] + Fixed bug in reporting number of channels in pngget.c and pngset.c, + that was introduced in version 1.2.2beta5. + Exported png_zalloc(), png_zfree(), png_default_read(), png_default_write(), + png_default_flush(), and png_push_fill_buffer() and included them in + module definition files. + Added "libpng.pc" dependency to the "install-shared" target in 15 makefiles. +version 1.2.3rc3 [May 1, 2002] + Revised prototype for png_default_flush() + Remove old libpng.pc and libpngNN.pc before installing new ones. +version 1.2.3rc4 [May 2, 2002] + Typos in *.def files (png_default_read|write -> png_default_read|write_data) + In makefiles, changed rm libpng.NN.pc to rm libpngNN.pc + Added libpng-config and libpngNN-config and modified makefiles to install them. + Changed $(MANPATH) to $(DESTDIR)$(MANPATH) in makefiles + Added "Win32 DLL VB" configuration to projects/msvc/libpng.dsp +version 1.2.3rc5 [May 11, 2002] + Changed "error" and "message" in prototypes to "error_message" and + "warning_message" to avoid namespace conflict. + Revised 15 makefiles to build libpng-config from libpng-config-*.in + Once more restored png_zalloc and png_zfree to regular nonexported form. + Restored png_default_read|write_data, png_default_flush, png_read_fill_buffer + to nonexported form, but with PNGAPI, and removed them from module def files. +version 1.2.3rc6 [May 14, 2002] + Removed "PNGAPI" from png_zalloc() and png_zfree() in png.c + Changed "Gz" to "Gd" in projects/msvc/libpng.dsp and zlib.dsp. + Removed leftover libpng-config "sed" script from four makefiles. + Revised libpng-config creating script in 16 makefiles. + +version 1.2.3 [May 22, 2002] + Revised libpng-config target in makefile.cygwin. + Removed description of png_set_mem_fn() from documentation. + Revised makefile.freebsd. + Minor cosmetic changes to 15 makefiles, e.g., $(DI) = $(DESTDIR)/$(INCDIR). + Revised projects/msvc/README.txt + Changed -lpng to -lpngNN in LDFLAGS in several makefiles. +version 1.2.4beta1 [May 24, 2002] + Added libpng.pc and libpng-config to "all:" target in 16 makefiles. + Fixed bug in 16 makefiles: $(DESTDIR)/$(LIBPATH) to $(DESTDIR)$(LIBPATH) + Added missing "\" before closing double quote in makefile.gcmmx. + Plugged various memory leaks; added png_malloc_warn() and png_set_text_2() + functions. +version 1.2.4beta2 [June 25, 2002] + Plugged memory leak of png_ptr->current_text (Matt Holgate). + Check for buffer overflow before reading CRC in pngpread.c (Warwick Allison) + Added -soname to the loader flags in makefile.dec, makefile.sgi, and + makefile.sggcc. + Added "test-installed" target to makefile.linux, makefile.gcmmx, + makefile.sgi, and makefile.sggcc. +version 1.2.4beta3 [June 28, 2002] + Plugged memory leak of row_buf in pngtest.c when there is a png_error(). + Detect buffer overflow in pngpread.c when IDAT is corrupted with extra data. + Added "test-installed" target to makefile.32sunu, makefile.64sunu, + makefile.beos, makefile.darwin, makefile.dec, makefile.macosx, + makefile.solaris, makefile.hpux, makefile.hpgcc, and makefile.so9. +version 1.2.4rc1 and 1.0.14rc1 [July 2, 2002] + Added "test-installed" target to makefile.cygwin and makefile.sco. + Revised pnggccrd.c to be able to back out version 1.0.x via PNG_1_0_X macro. + +version 1.2.4 and 1.0.14 [July 8, 2002] + Changed png_warning() to png_error() when width is too large to process. +version 1.2.4patch01 [July 20, 2002] + Revised makefile.cygwin to use DLL number 12 instead of 13. +version 1.2.5beta1 [August 6, 2002] + Added code to contrib/gregbook/readpng2.c to ignore unused chunks. + Replaced toucan.png in contrib/gregbook (it has been corrupt since 1.0.11) + Removed some stray *.o files from contrib/gregbook. + Changed png_error() to png_warning() about "Too much data" in pngpread.c + and about "Extra compressed data" in pngrutil.c. + Prevent png_ptr->pass from exceeding 7 in png_push_finish_row(). + Updated makefile.hpgcc + Updated png.c and pnggccrd.c handling of return from png_mmx_support() +version 1.2.5beta2 [August 15, 2002] + Only issue png_warning() about "Too much data" in pngpread.c when avail_in + is nonzero. + Updated makefiles to install a separate libpng.so.3 with its own rpath. +version 1.2.5rc1 and 1.0.15rc1 [August 24, 2002] + Revised makefiles to not remove previous minor versions of shared libraries. +version 1.2.5rc2 and 1.0.15rc2 [September 16, 2002] + Revised 13 makefiles to remove "-lz" and "-L$(ZLIBLIB)", etc., from shared + library loader directive. + Added missing "$OBJSDLL" line to makefile.gcmmx. + Added missing "; fi" to makefile.32sunu. +version 1.2.5rc3 and 1.0.15rc3 [September 18, 2002] + Revised libpng-config script. + +version 1.2.5 and 1.0.15 [October 3, 2002] + Revised makefile.macosx, makefile.darwin, makefile.hpgcc, and makefile.hpux, + and makefile.aix. + Relocated two misplaced PNGAPI lines in pngtest.c +version 1.2.6beta1 [October 22, 2002] + Commented out warning about uninitialized mmx_support in pnggccrd.c. + Changed "IBMCPP__" flag to "__IBMCPP__" in pngconf.h. + Relocated two more misplaced PNGAPI lines in pngtest.c + Fixed memory overrun bug in png_do_read_filler() with 16-bit datastreams, + introduced in version 1.0.2. + Revised makefile.macosx, makefile.dec, makefile.aix, and makefile.32sunu. +version 1.2.6beta2 [November 1, 2002] + Added libpng-config "--ldopts" output. + Added "AR=ar" and "ARFLAGS=rc" and changed "ar rc" to "$(AR) $(ARFLAGS)" + in makefiles. +version 1.2.6beta3 [July 18, 2004] + Reverted makefile changes from version 1.2.6beta2 and some of the changes + from version 1.2.6beta1; these will be postponed until version 1.2.7. + Version 1.2.6 is going to be a simple bugfix release. + Changed the one instance of "ln -sf" to "ln -f -s" in each Sun makefile. + Fixed potential overrun in pngerror.c by using strncpy instead of memcpy. + Added "#!/bin/sh" at the top of configure, for recognition of the + 'x' flag under Cygwin (Cosmin). + Optimized vacuous tests that silence compiler warnings, in png.c (Cosmin). + Added support for PNG_USER_CONFIG, in pngconf.h (Cosmin). + Fixed the special memory handler for Borland C under DOS, in pngmem.c + (Cosmin). + Removed some spurious assignments in pngrutil.c (Cosmin). + Replaced 65536 with 65536L, and 0xffff with 0xffffL, to silence warnings + on 16-bit platforms (Cosmin). + Enclosed shift op expressions in parentheses, to silence warnings (Cosmin). + Used proper type png_fixed_point, to avoid problems on 16-bit platforms, + in png_handle_sRGB() (Cosmin). + Added compression_type to png_struct, and optimized the window size + inside the deflate stream (Cosmin). + Fixed definition of isnonalpha(), in pngerror.c and pngrutil.c (Cosmin). + Fixed handling of unknown chunks that come after IDAT (Cosmin). + Allowed png_error() and png_warning() to work even if png_ptr == NULL + (Cosmin). + Replaced row_info->rowbytes with row_bytes in png_write_find_filter() + (Cosmin). + Fixed definition of PNG_LIBPNG_VER_DLLNUM (Simon-Pierre). + Used PNG_LIBPNG_VER and PNG_LIBPNG_VER_STRING instead of the hardcoded + values in png.c (Simon-Pierre, Cosmin). + Initialized png_libpng_ver[] with PNG_LIBPNG_VER_STRING (Simon-Pierre). + Replaced PNG_LIBPNG_VER_MAJOR with PNG_LIBPNG_VER_DLLNUM in png.rc + (Simon-Pierre). + Moved the definition of PNG_HEADER_VERSION_STRING near the definitions + of the other PNG_LIBPNG_VER_... symbols in png.h (Cosmin). + Relocated #ifndef PNGAPI guards in pngconf.h (Simon-Pierre, Cosmin). + Updated scripts/makefile.vc(a)win32 (Cosmin). + Updated the MSVC project (Simon-Pierre, Cosmin). + Updated the Borland C++ Builder project (Cosmin). + Avoided access to asm_flags in pngvcrd.c, if PNG_1_0_X is defined (Cosmin). + Commented out warning about uninitialized mmx_support in pngvcrd.c (Cosmin). + Removed scripts/makefile.bd32 and scripts/pngdef.pas (Cosmin). + Added extra guard around inclusion of Turbo C memory headers, in pngconf.h + (Cosmin). + Renamed projects/msvc/ to projects/visualc6/, and projects/borland/ to + projects/cbuilder5/ (Cosmin). + Moved projects/visualc6/png32ms.def to scripts/pngw32.def, + and projects/visualc6/png.rc to scripts/pngw32.rc (Cosmin). + Added projects/visualc6/pngtest.dsp; removed contrib/msvctest/ (Cosmin). + Changed line endings to DOS style in cbuilder5 and visualc6 files, even + in the tar.* distributions (Cosmin). + Updated contrib/visupng/VisualPng.dsp (Cosmin). + Updated contrib/visupng/cexcept.h to version 2.0.0 (Cosmin). + Added a separate distribution with "configure" and supporting files (Junichi). +version 1.2.6beta4 [July 28, 2004] + Added user ability to change png_size_t via a PNG_SIZE_T macro. + Added png_sizeof() and png_convert_size() functions. + Added PNG_SIZE_MAX (maximum value of a png_size_t variable. + Added check in png_malloc_default() for (size_t)size != (png_uint_32)size + which would indicate an overflow. + Changed sPLT failure action from png_error to png_warning and abandon chunk. + Changed sCAL and iCCP failures from png_error to png_warning and abandon. + Added png_get_uint_31(png_ptr, buf) function. + Added PNG_UINT_32_MAX macro. + Renamed PNG_MAX_UINT to PNG_UINT_31_MAX. + Made png_zalloc() issue a png_warning and return NULL on potential + overflow. + Turn on PNG_NO_ZALLOC_ZERO by default in version 1.2.x + Revised "clobber list" in pnggccrd.c so it will compile under gcc-3.4. + Revised Borland portion of png_malloc() to return NULL or issue + png_error() according to setting of PNG_FLAG_MALLOC_NULL_MEM_OK. + Added PNG_NO_SEQUENTIAL_READ_SUPPORTED macro to conditionally remove + sequential read support. + Added some "#if PNG_WRITE_SUPPORTED" blocks. + Removed some redundancy with #ifdef/#endif in png_malloc_default(). + Use png_malloc instead of png_zalloc to allocate the pallete. +version 1.0.16rc1 and 1.2.6rc1 [August 4, 2004] + Fixed buffer overflow vulnerability in png_handle_tRNS() + Fixed integer arithmetic overflow vulnerability in png_read_png(). + Fixed some harmless bugs in png_handle_sBIT, etc, that would cause + duplicate chunk types to go undetected. + Fixed some timestamps in the -config version + Rearranged order of processing of color types in png_handle_tRNS(). + Added ROWBYTES macro to calculate rowbytes without integer overflow. + Updated makefile.darwin and removed makefile.macosx from scripts directory. + Imposed default one million column, one-million row limits on the image + dimensions, and added png_set_user_limits() function to override them. + Revised use of PNG_SET_USER_LIMITS_SUPPORTED macro. + Fixed wrong cast of returns from png_get_user_width|height_max(). + Changed some "keep the compiler happy" from empty statements to returns, + Revised libpng.txt to remove 1.2.x stuff from the 1.0.x distribution +version 1.0.16rc2 and 1.2.6rc2 [August 7, 2004] + Revised makefile.darwin and makefile.solaris. Removed makefile.macosx. + Revised pngtest's png_debug_malloc() to use png_malloc() instead of + png_malloc_default() which is not supposed to be exported. + Fixed off-by-one error in one of the conversions to PNG_ROWBYTES() in + pngpread.c. Bug was introduced in 1.2.6rc1. + Fixed bug in RGB to RGBX transformation introduced in 1.2.6rc1. + Fixed old bug in RGB to Gray transformation. + Fixed problem with 64-bit compilers by casting arguments to abs() + to png_int_32. + Changed "ln -sf" to "ln -f -s" in three makefiles (solaris, sco, so9). + Changed "HANDLE_CHUNK_*" to "PNG_HANDLE_CHUNK_*" (Cosmin) + Added "-@/bin/rm -f $(DL)/$(LIBNAME).so.$(PNGMAJ)" to 15 *NIX makefiles. + Added code to update the row_info->colortype in png_do_read_filler() (MSB). +version 1.0.16rc3 and 1.2.6rc3 [August 9, 2004] + Eliminated use of "abs()" in testing cHRM and gAMA values, to avoid + trouble with some 64-bit compilers. Created PNG_OUT_OF_RANGE() macro. + Revised documentation of png_set_keep_unknown_chunks(). + Check handle_as_unknown status in pngpread.c, as in pngread.c previously. + Moved "PNG_HANDLE_CHUNK_*" macros out of PNG_INTERNAL section of png.h + Added "rim" definitions for CONST4 and CONST6 in pnggccrd.c +version 1.0.16rc4 and 1.2.6rc4 [August 10, 2004] + Fixed mistake in pngtest.c introduced in 1.2.6rc2 (declaration of + "pinfo" was out of place). +version 1.0.16rc5 and 1.2.6rc5 [August 10, 2004] + Moved "PNG_HANDLE_CHUNK_*" macros out of PNG_ASSEMBLER_CODE_SUPPORTED + section of png.h where they were inadvertently placed in version rc3. + +version 1.2.6 and 1.0.16 [August 15, 2004] + Revised pngtest so memory allocation testing is only done when PNG_DEBUG==1. +version 1.2.7beta1 [August 26, 2004] + Removed unused pngasmrd.h file. + Removed references to uu.net for archived files. Added references to + PNG Spec (second edition) and the PNG ISO/IEC Standard. + Added "test-dd" target in 15 makefiles, to run pngtest in DESTDIR. + Fixed bug with "optimized window size" in the IDAT datastream, that + causes libpng to write PNG files with incorrect zlib header bytes. +version 1.2.7beta2 [August 28, 2004] + Fixed bug with sCAL chunk and big-endian machines (David Munro). + Undid new code added in 1.2.6rc2 to update the color_type in + png_set_filler(). + Added png_set_add_alpha() that updates color type. +version 1.0.17rc1 and 1.2.7rc1 [September 4, 2004] + Revised png_set_strip_filler() to not remove alpha if color_type has alpha. + +version 1.2.7 and 1.0.17 [September 12, 2004] + Added makefile.hp64 + Changed projects/msvc/png32ms.def to scripts/png32ms.def in makefile.cygwin +version 1.2.8beta1 [November 1, 2004] + Fixed bug in png_text_compress() that would fail to complete a large block. + Fixed bug, introduced in libpng-1.2.7, that overruns a buffer during + strip alpha operation in png_do_strip_filler(). + Added PNG_1_2_X definition in pngconf.h + Comment out with #ifdef/#endif png_info_init in png.c and png_read_init + in pngread.c (as of 1.3.0) +version 1.2.8beta2 [November 2, 2004] + Reduce color_type to a nonalpha type after strip alpha operation in + png_do_strip_filler(). +version 1.2.8beta3 [November 3, 2004] + Revised definitions of PNG_MAX_UINT_32, PNG_MAX_SIZE, and PNG_MAXSUM +version 1.2.8beta4 [November 12, 2004] + Fixed (again) definition of PNG_LIBPNG_VER_DLLNUM in png.h (Cosmin). + Added PNG_LIBPNG_BUILD_PRIVATE in png.h (Cosmin). + Set png_ptr->zstream.data_type to Z_BINARY, to avoid unnecessary detection + of data type in deflate (Cosmin). + Deprecated but continue to support SPECIALBUILD and PRIVATEBUILD in favor of + PNG_LIBPNG_BUILD_SPECIAL_STRING and PNG_LIBPNG_BUILD_PRIVATE_STRING. +version 1.2.8beta5 [November 20, 2004] + Use png_ptr->flags instead of png_ptr->transformations to pass + PNG_STRIP_ALPHA info to png_do_strip_filler(), to preserve ABI + compatibility. + Revised handling of SPECIALBUILD, PRIVATEBUILD, + PNG_LIBPNG_BUILD_SPECIAL_STRING and PNG_LIBPNG_BUILD_PRIVATE_STRING. +version 1.2.8rc1 [November 24, 2004] + Moved handling of BUILD macros from pngconf.h to png.h + Added definition of PNG_LIBPNG_BASE_TYPE in png.h, inadvertently + omitted from beta5. + Revised scripts/pngw32.rc + Despammed mailing addresses by masking "@" with "at". + Inadvertently installed a supposedly faster test version of pngrutil.c +version 1.2.8rc2 [November 26, 2004] + Added two missing "\" in png.h + Change tests in pngread.c and pngpread.c to + if (png_ptr->transformations || (png_ptr->flags&PNG_FLAG_STRIP_ALPHA)) + png_do_read_transformations(png_ptr); +version 1.2.8rc3 [November 28, 2004] + Reverted pngrutil.c to version libpng-1.2.8beta5. + Added scripts/makefile.elf with supporting code in pngconf.h for symbol + versioning (John Bowler). +version 1.2.8rc4 [November 29, 2004] + Added projects/visualc7 (Simon-pierre). +version 1.2.8rc5 [November 29, 2004] + Fixed new typo in scripts/pngw32.rc + +version 1.2.8 [December 3, 2004] + Removed projects/visualc7, added projects/visualc71. + +version 1.2.9beta1 [February 21, 2006] + + Initialized some structure members in pngwutil.c to avoid gcc-4.0.0 complaints + Revised man page and libpng.txt to make it clear that one should not call + png_read_end or png_write_end after png_read_png or png_write_png. + Updated references to png-mng-implement mailing list. + Fixed an incorrect typecast in pngrutil.c + Added PNG_NO_READ_SUPPORTED conditional for making a write-only library. + Added PNG_NO_WRITE_INTERLACING_SUPPORTED conditional. + Optimized alpha-inversion loops in pngwtran.c + Moved test for nonzero gamma outside of png_build_gamma_table() in pngrtran.c + Make sure num_trans is <= 256 before copying data in png_set_tRNS(). + Make sure num_palette is <= 256 before copying data in png_set_PLTE(). + Interchanged order of write_swap_alpha and write_invert_alpha transforms. + Added parentheses in the definition of PNG_LIBPNG_BUILD_TYPE (Cosmin). + Optimized zlib window flag (CINFO) in contrib/pngsuite/*.png (Cosmin). + Updated scripts/makefile.bc32 for Borland C++ 5.6 (Cosmin). + Exported png_get_uint_32, png_save_uint_32, png_get_uint_16, png_save_uint_16, + png_get_int_32, png_save_int_32, png_get_uint_31 (Cosmin). + Added type cast (png_byte) in png_write_sCAL() (Cosmin). + Fixed scripts/makefile.cygwin (Christian Biesinger, Cosmin). + Default iTXt support was inadvertently enabled. + +version 1.2.9beta2 [February 21, 2006] + + Check for png_rgb_to_gray and png_gray_to_rgb read transformations before + checking for png_read_dither in pngrtran.c + Revised checking of chromaticity limits to accommodate extended RGB + colorspace (John Denker). + Changed line endings in some of the project files to CRLF, even in the + "Unix" tar distributions (Cosmin). + Made png_get_int_32 and png_save_int_32 always available (Cosmin). + Updated scripts/pngos2.def, scripts/pngw32.def and projects/wince/png32ce.def + with the newly exported functions. + Eliminated distributions without the "configure" script. + Updated INSTALL instructions. + +version 1.2.9beta3 [February 24, 2006] + + Fixed CRCRLF line endings in contrib/visupng/VisualPng.dsp + Made libpng.pc respect EXEC_PREFIX (D. P. Kreil, J. Bowler) + Removed reference to pngasmrd.h from Makefile.am + Renamed CHANGES to ChangeLog. + Renamed LICENSE to COPYING. + Renamed ANNOUNCE to NEWS. + Created AUTHORS file. + +version 1.2.9beta4 [March 3, 2006] + + Changed definition of PKGCONFIG from $prefix/lib to $libdir in configure.ac + Reverted to filenames LICENSE and ANNOUNCE; removed AUTHORS and COPYING. + Removed newline from the end of some error and warning messages. + Removed test for sqrt() from configure.ac and configure. + Made swap tables in pngtrans.c PNG_CONST (Carlo Bramix). + Disabled default iTXt support that was inadvertently enabled in + libpng-1.2.9beta1. + Added "OS2" to list of systems that don't need underscores, in pnggccrd.c + Removed libpng version and date from *.c files. + +version 1.2.9beta5 [March 4, 2006] + Removed trailing blanks from source files. + Put version and date of latest change in each source file, and changed + copyright year accordingly. + More cleanup of configure.ac, Makefile.am, and associated scripts. + Restored scripts/makefile.elf which was inadvertently deleted. + +version 1.2.9beta6 [March 6, 2006] + Fixed typo (RELEASE) in configuration files. + +version 1.2.9beta7 [March 7, 2006] + Removed libpng.vers and libpng.sym from libpng12_la_SOURCES in Makefile.am + Fixed inconsistent #ifdef's around png_sig_bytes() and png_set_sCAL_s() + in png.h. + Updated makefile.elf as suggested by debian. + Made cosmetic changes to some makefiles, adding LN_SF and other macros. + Made some makefiles accept "exec_prefix". + +version 1.2.9beta8 [March 9, 2006] + Fixed some "#if defined (..." which should be "#if defined(..." + Bug introduced in libpng-1.2.8. + Fixed inconsistency in definition of png_default_read_data() + Restored blank that was lost from makefile.sggcc "clean" target in beta7. + Revised calculation of "current" and "major" for irix in ltmain.sh + Changed "mkdir" to "MKDIR_P" in some makefiles. + Separated PNG_EXPAND and PNG_EXPAND_tRNS. + Added png_set_expand_gray_1_2_4_to_8() and deprecated + png_set_gray_1_2_4_to_8() which also expands tRNS to alpha. + +version 1.2.9beta9 [March 10, 2006] + Include "config.h" in pngconf.h when available. + Added some checks for NULL png_ptr or NULL info_ptr (timeless) + +version 1.2.9beta10 [March 20, 2006] + Removed extra CR from contrib/visualpng/VisualPng.dsw (Cosmin) + Made pnggccrd.c PIC-compliant (Christian Aichinger). + Added makefile.mingw (Wolfgang Glas). + Revised pngconf.h MMX checking. + +version 1.2.9beta11 [March 22, 2006] + Fixed out-of-order declaration in pngwrite.c that was introduced in beta9 + Simplified some makefiles by using LIBSO, LIBSOMAJ, and LIBSOVER macros. + +version 1.2.9rc1 [March 31, 2006] + Defined PNG_USER_PRIVATEBUILD when including "pngusr.h" (Cosmin). + Removed nonsensical assertion check from pngtest.c (Cosmin). + +version 1.2.9 [April 14, 2006] + Revised makefile.beos and added "none" selector in ltmain.sh + +version 1.2.10beta1 [April 15, 2006] + Renamed "config.h" to "png_conf.h" and revised Makefile.am to add + -DPNG_BUILDING_LIBPNG to compile directive, and modified pngconf.h + to include png_conf.h only when PNG_BUILDING_LIBPNG is defined. + +version 1.2.10beta2 [April 15, 2006] + Manually updated Makefile.in and configure. Changed png_conf.h.in + back to config.h. + +version 1.2.10beta3 [April 15, 2006] + Change png_conf.h back to config.h in pngconf.h. + +version 1.2.10beta4 [April 16, 2006] + Change PNG_BUILDING_LIBPNG to PNG_CONFIGURE_LIBPNG in config/Makefile*. + +version 1.2.10beta5 [April 16, 2006] + Added a configure check for compiling assembler code in pnggccrd.c + +version 1.2.10beta6 [April 17, 2006] + Revised the configure check for pnggccrd.c + Moved -DPNG_CONFIGURE_LIBPNG into @LIBPNG_DEFINES@ + Added @LIBPNG_DEFINES@ to arguments when building libpng.sym + +version 1.2.10beta7 [April 18, 2006] + Change "exec_prefix=$prefix" to "exec_prefix=$(prefix)" in makefiles. + +version 1.2.10rc1 [April 19, 2006] + Ensure pngconf.h doesn't define both PNG_USE_PNGGCCRD and PNG_USE_PNGVCRD + Fixed "LN_FS" typo in makefile.sco and makefile.solaris. + +version 1.2.10rc2 [April 20, 2006] + Added a backslash between -DPNG_CONFIGURE_LIBPNG and -DPNG_NO_ASSEMBLER_CODE + in configure.ac and configure + Made the configure warning about versioned symbols less arrogant. + +version 1.2.10rc3 [April 21, 2006] + Added a note in libpng.txt that png_set_sig_bytes(8) can be used when + writing an embedded PNG without the 8-byte signature. + Revised makefiles and configure to avoid making links to libpng.so.* + +version 1.2.10 [April 23, 2006] + Reverted configure to "rc2" state. + +version 1.2.11beta1 [May 31, 2006] + scripts/libpng.pc.in contained "configure" style version info and would + not work with makefiles. + The shared-library makefiles were linking to libpng.so.0 instead of + libpng.so.3 compatibility as the library. + +version 1.2.11beta2 [June 2, 2006] + Increased sprintf buffer from 50 to 52 chars in pngrutil.c to avoid + buffer overflow. + Fixed bug in example.c (png_set_palette_rgb -> png_set_palette_to_rgb) + +version 1.2.11beta3 [June 5, 2006] + Prepended "#! /bin/sh" to ltmail.sh and contrib/pngminus/*.sh (Cosmin). + Removed the accidental leftover Makefile.in~ (Cosmin). + Avoided potential buffer overflow and optimized buffer in + png_write_sCAL(), png_write_sCAL_s() (Cosmin). + Removed the include directories and libraries from CFLAGS and LDFLAGS + in scripts/makefile.gcc (Nelson A. de Oliveira, Cosmin). + +version 1.2.11beta4 [June 6, 2006] + Allow zero-length IDAT chunks after the entire zlib datastream, but not + after another intervening chunk type. + +version 1.0.19rc1, 1.2.11rc1 [June 13, 2006] + Deleted extraneous square brackets from [config.h] in configure.ac + +version 1.0.19rc2, 1.2.11rc2 [June 14, 2006] + Added prototypes for PNG_INCH_CONVERSIONS functions to png.h + Revised INSTALL and autogen.sh + Fixed typo in several makefiles (-W1 should be -Wl) + Added typedef for png_int_32 and png_uint_32 on 64-bit systems. + +version 1.0.19rc3, 1.2.11rc3 [June 15, 2006] + Removed the new typedefs for 64-bit systems (delay until version 1.4.0) + Added one zero element to png_gamma_shift[] array in pngrtran.c to avoid + reading out of bounds. + +version 1.0.19rc4, 1.2.11rc4 [June 15, 2006] + Really removed the new typedefs for 64-bit systems. + +version 1.0.19rc5, 1.2.11rc5 [June 22, 2006] + Removed png_sig_bytes entry from scripts/pngw32.def + +version 1.0.19, 1.2.11 [June 26, 2006] + None. + +version 1.0.20, 1.2.12 [June 27, 2006] + Really increased sprintf buffer from 50 to 52 chars in pngrutil.c to avoid + buffer overflow. + +version 1.2.13beta1 [October 2, 2006] + Removed AC_FUNC_MALLOC from configure.ac + Work around Intel-Mac compiler bug by setting PNG_NO_MMX_CODE in pngconf.h + Change "logical" to "bitwise" throughout documentation. + Detect and fix attempt to write wrong iCCP profile length. + +version 1.0.21, 1.2.13 [November 14, 2006] + Fix potential buffer overflow in sPLT chunk handler. + Fix Makefile.am to not try to link to noexistent files. + Check all exported functions for NULL png_ptr. + +version 1.2.14beta1 [November 17, 2006] + Relocated three misplaced tests for NULL png_ptr. + Built Makefile.in with automake-1.9.6 instead of 1.9.2. + Build configure with autoconf-2.60 instead of 2.59 + +version 1.2.14beta2 [November 17, 2006] + Added some typecasts in png_zalloc(). + +version 1.2.14rc1 [November 20, 2006] + Changed "strtod" to "png_strtod" in pngrutil.c + +version 1.0.22, 1.2.14 [November 27, 2006] + Added missing "$(srcdir)" in Makefile.am and Makefile.in + +version 1.2.15beta1 [December 3, 2006] + Generated configure with autoconf-2.61 instead of 2.60 + Revised configure.ac to update libpng.pc and libpng-config. + +version 1.2.15beta2 [December 3, 2006] + Always export MMX asm functions, just stubs if not building pnggccrd.c + +version 1.2.15beta3 [December 4, 2006] + Add "png_bytep" typecast to profile while calculating length in pngwutil.c + +version 1.2.15beta4 [December 7, 2006] + Added scripts/CMakeLists.txt + Changed PNG_NO_ASSEMBLER_CODE to PNG_NO_MMX_CODE in scripts, like 1.4.0beta + +version 1.2.15beta5 [December 7, 2006] + Changed some instances of PNG_ASSEMBLER_* to PNG_MMX_* in pnggccrd.c + Revised scripts/CMakeLists.txt + +version 1.2.15beta6 [December 13, 2006] + Revised scripts/CMakeLists.txt and configure.ac + +version 1.2.15rc1 [December 18, 2006] + Revised scripts/CMakeLists.txt + +version 1.2.15rc2 [December 21, 2006] + Added conditional #undef jmpbuf in pngtest.c to undo #define in AIX headers. + Added scripts/makefile.nommx + +version 1.2.15rc3 [December 25, 2006] + Fixed shared library numbering error that was introduced in 1.2.15beta6. + +version 1.2.15rc4 [December 27, 2006] + Fixed handling of rgb_to_gray when png_ptr->color.gray isn't set. + +version 1.2.15rc5 [December 31, 2006] + Revised handling of rgb_to_gray. + +version 1.0.23, 1.2.15 [January 5, 2007] + Added some (unsigned long) typecasts in pngtest.c to avoid printing errors. + +version 1.2.16beta1 [January 6, 2007] + Fix bugs in makefile.nommx + +version 1.2.16beta2 [January 16, 2007] + Revised scripts/CMakeLists.txt + +version 1.0.24, 1.2.16 [January 31, 2007] + No changes. + +version 1.2.17beta1 [March 6, 2007] + Revised scripts/CMakeLists.txt to install both shared and static libraries. + Deleted a redundant line from pngset.c. + +version 1.2.17beta2 [April 26, 2007] + Relocated misplaced test for png_ptr == NULL in pngpread.c + Change "==" to "&" for testing PNG_RGB_TO_GRAY_ERR & PNG_RGB_TO_GRAY_WARN + flags. + Changed remaining instances of PNG_ASSEMBLER_* to PNG_MMX_* + Added pngerror() when write_IHDR fails in deflateInit2(). + Added "const" to some array declarations. + Mention examples of libpng usage in the libpng*.txt and libpng.3 documents. + +version 1.2.17rc1 [May 4, 2007] + No changes. + +version 1.2.17rc2 [May 8, 2007] + Moved several PNG_HAVE_* macros out of PNG_INTERNAL because applications + calling set_unknown_chunk_location() need them. + Changed transformation flag from PNG_EXPAND_tRNS to PNG_EXPAND in + png_set_expand_gray_1_2_4_to_8(). + Added png_ptr->unknown_chunk to hold working unknown chunk data, so it + can be free'ed in case of error. Revised unknown chunk handling in + pngrutil.c and pngpread.c to use this structure. + +version 1.2.17rc3 [May 8, 2007] + Revised symbol-handling in configure script. + +version 1.2.17rc4 [May 10, 2007] + Revised unknown chunk handling to avoid storing unknown critical chunks. + +version 1.0.25 [May 15, 2007] +version 1.2.17 [May 15, 2007] + Added "png_ptr->num_trans=0" before error return in png_handle_tRNS, + to eliminate a vulnerability (CVE-2007-2445, CERT VU#684664) + +version 1.0.26 [May 15, 2007] +version 1.2.18 [May 15, 2007] + Reverted the libpng-1.2.17rc3 change to symbol-handling in configure script + +version 1.2.19beta1 [May 18, 2007] + Changed "const static" to "static PNG_CONST" everywhere, mostly undoing + change of libpng-1.2.17beta2. Changed other "const" to "PNG_CONST" + Changed some handling of unused parameters, to avoid compiler warnings. + "if (unused == NULL) return;" becomes "unused = unused". + +version 1.2.19beta2 [May 18, 2007] + Only use the valid bits of tRNS value in png_do_expand() (Brian Cartier) + +version 1.2.19beta3 [May 19, 2007] + Add some "png_byte" typecasts in png_check_keyword() and write new_key + instead of key in zTXt chunk (Kevin Ryde). + +version 1.2.19beta4 [May 21, 2007] + Add png_snprintf() function and use it in place of sprint() for improved + defense against buffer overflows. + +version 1.2.19beta5 [May 21, 2007] + Fixed png_handle_tRNS() to only use the valid bits of tRNS value. + Changed handling of more unused parameters, to avoid compiler warnings. + Removed some PNG_CONST in pngwutil.c to avoid compiler warnings. + +version 1.2.19beta6 [May 22, 2007] + Added some #ifdef PNG_MMX_CODE_SUPPORTED where needed in pngvcrd.c + Added a special "_MSC_VER" case that defines png_snprintf to _snprintf + +version 1.2.19beta7 [May 22, 2007] + Squelched png_squelch_warnings() in pnggccrd.c and added + an #ifdef PNG_MMX_CODE_SUPPORTED/#endif block around the declarations + that caused the warnings that png_squelch_warnings was squelching. + +version 1.2.19beta8 [May 22, 2007] + Removed __MMX__ from test in pngconf.h. + +version 1.2.19beta9 [May 23, 2007] + Made png_squelch_warnings() available via PNG_SQUELCH_WARNINGS macro. + Revised png_squelch_warnings() so it might work. + Updated makefile.sgcc and makefile.solaris; added makefile.solaris-x86. + +version 1.2.19beta10 [May 24, 2007] + Resquelched png_squelch_warnings(), use "__attribute__((used))" instead. + +version 1.2.19beta11 [May 28, 2007] + Return 0 from png_get_sPLT() and png_get_unknown_chunks() if png_ptr is NULL; + changed three remaining instances of png_strcpy() to png_strncpy() (David + Hill). + Make test for NULL row_buf at the beginning of png_do_read_transformations + unconditional. + +version 1.2.19beta12 [May 28, 2007] + Revised pnggccrd.c. + +version 1.2.19beta13 [June 14, 2007] + Prefer PNG_USE_PNGVCRD when _MSC_VER is defined in pngconf.h + +version 1.2.19beta14 [June 16, 2007] + Fix bug with handling of 16-bit transparency, introduced in 1.2.19beta2 + +version 1.2.19beta15 [June 17, 2007] + Revised pnggccrd.c. + +version 1.2.19beta16 [June 18, 2007] + Revised pnggccrd.c again. + Updated contrib/gregbook. + Changed '#include "pnggccrd.c"' to 'include "$srcdir/pnggccrd.c"' + in configure.ac + +version 1.2.19beta17 [June 19, 2007] + Revised many of the makefiles, to set -DPNG_NO_MMX_CODE where needed + and to not use -O3 unless -DPNG_NO_MMX_CODE is also set. + +version 1.2.19beta18 [June 23, 2007] + Replaced some C++ style comments with C style comments in pnggccrd.c. + Copied optimized C code from pnggccrd.c to pngrutil.c, removed dependency + on pnggccrd.o from many makefiles. + Added sl and dylib to list of extensions be installed by Makefile.am + +version 1.2.19beta19 [June 28, 2007] + Fixed testing PNG_RGB_TO_GRAY_ERR & PNG_RGB_TO_GRAY_WARN in pngrtran.c + More cleanup of pnggccrd.c and pngvcrd.c + +version 1.2.19beta20 [June 29, 2007] + Rebuilt Makefile.in and configure using libtool-1.5.24. + Fixed typo in pnggccrd.c + +version 1.2.19beta21 [June 30, 2007] + More revision of pnggccrd.c + Added "test" target to Makefile.in and Makefile.am + +version 1.2.19beta22 [July 3, 2007] + Added info about pngrutil/pnggccrd/pngvcrd to png_get_header_version() + Fix type definition of dummy_value_a, b in pnggccrd.c + +version 1.2.19beta23 [July 10, 2007] + Revert change to type definition of dummy_value_a, b in pnggccrd.c + Make sure __PIC__ is defined in pnggccrd.c when PIC is defined. + Require gcc-4.1 or better to use PNG_HAVE_MMX_FILTER_ROW on x86_64 platforms + +version 1.2.19beta24 [July 14, 2007] + Added PNG_NO_READ_FILTER, PNG_NO_WRITE_FILTER, PNG_NO_WARNING macros. + Added contrib/pngminim to demonstrate building minimal encoder and decoder + +version 1.2.19beta25 [July 15, 2007] + Removed the new PNG_NO_READ_FILTER macro since it would make the library + unable to read valid PNG files, and filtering is at the heart of the + PNG format. + +version 1.2.19beta26 [July 16, 2007] + Changed "png_free(str)" to "png_free(png_ptr,str)" in pngrutil.c WinCE + code (Yves Piguet). This bug was introduced in libpng-1.2.14. + Updated scripts/CMakeLists.txt + Relocated a misplaced #endif in pnggccrd.c + +version 1.2.19beta27 [July 17, 2007] + Fixed incorrect stride and number of bytes copied (was 4 instead of + 6 bytes) in the cleanup loop of pnggccrd.c and pngvcrd.c for handling + the end of 48-bit interlaced rows (Glenn R-P). + +version 1.2.19beta28 [July 19, 2007] + Removed requirement for gcc-4.1 or better to use PNG_HAVE_MMX_FILTER_ROW + on x86_64 platforms + Added png_warning() in pngrutil.c for short iCCP, iTXt, sPLT, or zTXT chunks. + Revised pngtest.c so warnings are displayed regardless of PNG_NO_STDIO. + +version 1.2.19beta29 [July 20, 2007] + Fix typo in pnggccrd.c (%%eax should be %%ax in secondloop48) + +version 1.2.19beta30 [July 26, 2007] + Revised pnggccrd.c + +version 1.2.19beta31 [July 27, 2007] + Fix typos in pnggccrd.c + +version 1.0.27rc1 and 1.2.19rc1 [July 31, 2007] + Disable PNG_MMX_CODE_SUPPORTED when PNG_ASSEMBLER_CODE_SUPPORTED is off. + Enable PNG_MMX_READ_FILTER_* by default, except when gcc-3.x is being + used (they were inadvertently disabled in libpng-1.2.19beta23). + Fix some debugging statements in pnggccrd.c and pngrutil.c + Added information about disabling the MMX code in libpng documentation. + +version 1.0.27rc2 and 1.2.19rc2 [August 4, 2007] + Removed some "#if 0" blocks. + Made a global struct local in pngvcrd.c to make it thread safe. + Issue a png_error() if application attempts to transform a row tht + has not been initialized. + +version 1.0.27rc3 and 1.2.19rc3 [August 9, 2007] + Slightly revised pngvcrd.c + +version 1.0.27rc4 and 1.2.19rc4 [August 9, 2007] + Revised pnggccrd.c debugging change of rc1, which was broken. + Revised scripts/CMakeLists.txt + Change default to PNG_NO_GLOBAL_ARRAYS for MSVC. + Turn off PNG_FLAG_ROW_INIT flag when setting transforms that expand pixels. + +version 1.0.27rc5 and 1.2.19rc5 [August 10, 2007] + Fix typo (missing '"') in pnggccrd.c + Revise handling of png_strtod in recent versions of WINCE + +version 1.0.27rc6 and 1.2.19rc6 [August 15, 2007] + Fix typo (missing ',') in contrib/gregbook/readpng2.c + Undid row initialization error exit added to rc2 and rc4. + +version 1.0.27 and 1.2.19 [August 18, 2007] + Conditionally restored row initialization error exit. + +version 1.2.20beta01 [August 19, 2007] + Fixed problem with compiling pnggccrd.c on Intel-Apple platforms. + Changed png_malloc() to png_malloc_warn() in png_set_sPLT(). + Added PNG_NO_ERROR_TEXT feature, with demo in contrib/pngminim + Removed define PNG_WARN_UNINITIALIZED_ROW 1 /* 0: warning; 1: error */ + because it caused some trouble. + +version 1.2.20beta02 [August 20, 2007] + Avoid compiling pnggccrd.c on Intel-Apple platforms. + +version 1.2.20beta03 [August 20, 2007] + Added "/D PNG_NO_MMX_CODE" to the non-mmx builds of projects/visualc6 + and visualc71. + +version 1.2.20beta04 [August 21, 2007] + Revised pngvcrd.c for improved efficiency (Steve Snyder). + +version 1.2.20rc1 [August 23, 2007] + Revised pngconf.h to set PNG_NO_MMX_CODE for gcc-3.x compilers. + +version 1.2.20rc2 [August 27, 2007] + Revised scripts/CMakeLists.txt + Revised #ifdefs to ensure one and only one of pnggccrd.c, pngvcrd.c, + or part of pngrutil.c is selected. + +version 1.2.20rc3 [August 30, 2007] + Remove a little more code in pngwutil.c when PNG_NO_WRITE_FILTER is selected. + Added /D _CRT_SECURE_NO_WARNINGS to visual6c and visualc71 projects. + Compile png_mmx_support() in png.c even when PNG_NO_MMX_CODE is defined. + Restored a "superfluous" #ifdef that was removed from 1.2.20rc2 pnggccrd.c, + breaking the png_mmx_support() function. + +version 1.2.20rc4 [September 1, 2007] + Removed Intel contributions (MMX, Optimized C). + +version 1.2.20rc5 [September 2, 2007] + Restored configure and Makefile.in to rc3 and put a snippet of code in + pnggccrd.c, to ensure configure makes the same PNG_NO_MMX_CODE selection + +version 1.2.20rc6 [September 2, 2007] + Fixed bugs in scripts/CMakeLists.txt + Removed pngvcrd.c references from msvc projects. + +version 1.0.28 and 1.2.20 [September 8, 2007] + Removed "(NO READ SUPPORT)" from png_get_header_version() string. + +version 1.2.21beta1 [September 14, 2007] + Fixed various mistakes reported by George Cook and Jeff Phillips: + logical vs bitwise NOT in pngrtran.c, bug introduced in 1.2.19rc2 + 16-bit cheap transparency expansion, bug introduced in 1.2.19beta2 + errors with sizeof(unknown_chunk.name), bugs introduced in 1.2.19beta11 + <= compare with unsigned var in pngset.c, should be ==. + +version 1.2.21beta2 [September 18, 2007] + Removed some extraneous typecasts. + +version 1.2.21rc1 [September 25, 2007] + Fixed potential out-of-bounds reads in png_handle_pCAL() and + png_handle_ztXt() ("flayer" results reported by Tavis Ormandy). + +version 1.2.21rc2 [September 26, 2007] + Fixed potential out-of-bounds reads in png_handle_sCAL(), + png_handle_iTXt(), and png_push_read_tEXt(). + Remove some PNG_CONST declarations from pngwutil.c to avoid compiler warnings + Revised makefiles to update paths in libpng.pc properly. + +version 1.2.21rc3 [September 27, 2007] + Revised makefiles to update "Libs" in libpng.pc properly. + +version 1.0.29 and 1.2.21rc3 [October 4, 2007] + No changes. + +version 1.2.22beta1 [October 4, 2007] + Again, fixed logical vs bitwise NOT in pngrtran.c, bug introduced + in 1.2.19rc2 + +version 1.2.22beta2 [October 5, 2007] + Fixed string length error in pngset.c (caused crashes while decoding iCCP) + Add terminating NULL after each instance of png_strncpy(). + +version 1.2.22beta3 [October 6, 2007] + Fix two off-by-one terminating NULL after png_strncpy(). + +version 1.2.22beta4 [October 7, 2007] + Changed some 0 to '\0'. + +version 1.0.30rc1 and 1.2.22rc1 [October 8, 2007] + No changes. + +version 1.0.30 and 1.2.22 [October 13, 2007] + No changes. + +version 1.2.23beta01 [October 15, 2007] + Reduced number of invocations of png_strlen() in pngset.c. + Changed [azAZ09_] to [_abcde...89] in Makefile.am for better localization. + +version 1.2.23beta02 [October 16, 2007] + Eliminated png_strncpy() and png_strcpy() (Pierre Poissinger) + Changed $AN to $(AN) in Makefile.am. + +version 1.2.23beta03 [October 16, 2007] + Fixed off-by-one error in pngset.c + Restore statement to set last character of buffer to \0 in pngerror.c + +version 1.2.23beta04 [October 23, 2007] + Reject attempt to set all-zero cHRM values. + +version 1.2.23beta05 [October 26, 2007] + Add missing quotes in projects/visualc6, lost in version 1.2.20rc3 + +version 1.2.23rc01 [November 2, 2007] + No changes. + +version 1.2.23 [November 6, 2007] + No changes. + +version 1.2.24beta01 [November 19, 2007] + Moved misplaced test for malloc failure in png_set_sPLT(). This bug was + introduced in libpng-1.2.20beta01. + Ifdef out avg_row etc from png.h and pngwrite.c when PNG_NO_WRITE_FILTER + Do not use png_ptr->free_fn and png_ptr->mem_fn in png_destroy_read_struct() + when png_ptr is NULL (Marshall Clow). + Updated handling of symbol prefixes in Makefile.am and configure.ac (Mike + Frysinger). + +version 1.2.24beta02 [November 30, 2007] + Removed a useless test and fixed incorrect test in png_set_cHRM_fixed() + (David Hill). + +version 1.2.24rc01 [December 7, 2007] + No changes. + +version 1.2.24 [December 14, 2007] + Make sure not to redefine _BSD_SOURCE in pngconf.h + Revised gather.sh and makefile.std in contrib/pngminim to avoid compiling + unused files. + +version 1.2.25beta01 [January 7, 2008] + Fixed bug with unknown chunk handling, introduced in version 1.2.17rc2 + +version 1.2.25beta02 [January 10, 2008] + Prevent gamma from being applied twice. + +version 1.2.25rc01 [January 17, 2008] + No changes. + +version 1.2.25beta03 [January 22, 2008] + Fixed some continue-after-malloc-failure errors in pngset.c (David Hill) + Check for info_ptr == NULL in png_read_info() and png_process_data(). + Check for possible use of NULL user_png_ver[] in png_create_read_struct(). + Change "if (swidth == NULL)" to "if (sheight == NULL)" in png_handle_sCAL + (bug introduced in libpng-1.2.4/1.0.13). + Return from png_destroy_read_struct() if png_ptr_ptr is NULL. + Fix overflow of "msg" in png_decompress_chunk(). + +version 1.2.25beta04 [January 26, 2008] + Work around Coverity bug report by slightly refactoring + png_read_push_finish_row() + +version 1.2.25beta05 [January 31, 2008] + Added libpng-1.2.25beta05.tar.lzma to distribution. Get the lzma codec + from . + Added lp1225b05.7z to distribution. Get the 7-zip decoder from + from . + Fixed some broken links in the README file. + +version 1.2.25beta06 [February 6, 2008] + Refactored png_read_push_finish_row() again, trying to satisfy Coverity. + Fixed potential NULL dereference of png_ptr in png_destroy_write_struct(); + clarified potential NULL dereference of png_ptr in png_destroy_read_struct(); + fixed potential NULL dereference of info_ptr in png_handle_bKGD(); + fixed potential NULL dereference of user_png_ver[] in + png_create_write_struct_2(). (Coverity) + +version 1.2.25rc02 [February 10, 2008] + Reset png_ptr->pass in png_read_push_finish_row() before break. + Changed "pass" from png_byte to int. + +version 1.2.25 and 1.0.31 [February 18, 2008] + No changes. + +version 1.2.26beta01 [February 21, 2008] + Added missing "(" in pngmem.c. Bug introduced in libpng-1.2.2/1.0.13 + +version 1.2.26beta02 [March 12, 2008] + Refined error message returned from deflateInit2 in pngwutil.c + Check IHDR length in png_push_read_chunk() before saving it. + +version 1.2.26beta03 [March 16, 2008] + Revised contrib/gregbook to handle premature end-of-file and file + read errors correctly. + +version 1.2.26beta04 [March 18, 2008] + Free png_ptr->big_row_buf and png_ptr->prev_row before allocating + new copies in png_read_start_row(). Bug introduced in libpng-1.2.22. + +version 1.2.26beta05 [March 19, 2008] + Removed extra png_free() added in libpng-1.2.26beta04. + +version 1.2.26beta06 [March 19, 2008] + Avoid reallocating big_row_buf and prev_row when the size does not increase. + +version 1.2.26rc01 [March 26, 2008] + Ifdef out some code that is unused when interlacing is not supported. + +versions 1.0.32 and 1.2.26 [April 2, 2008] + No changes. + +version 1.2.27beta01 [April 12, 2008] + Fixed bug (introduced in libpng-1.0.5h) with handling zero-length + unknown chunks. + Added more information about png_set_keep_unknown_chunks() to the + documentation. + Reject tRNS chunk with out-of-range samples instead of masking off + the invalid high bits as done in since libpng-1.2.19beta5. + +version 1.2.27beta02 [April 13, 2008] + Revised documentation about unknown chunk and user chunk handling. + Keep tRNS chunk with out-of-range samples and issue a png_warning(). + +version 1.2.27beta03 [April 14, 2008] + Added check for NULL ptr in TURBOC version of png_free_default(). + Removed several unnecessary checks for NULL before calling png_free(). + Revised png_set_tRNS() so that calling it twice removes and invalidates + the previous call. + Revised pngtest to check for out-of-range tRNS samples. + +version 1.2.27beta04 [April 18, 2008] + Added AC_LIBTOOL_WIN32_DLL to configure.ac + Rebuilt Makefile.in, aclocal.m4, and configure with autoconf-2.62 + +version 1.2.27beta05 [April 19, 2008] + Added MAINTAINERCLEANFILES variable to Makefile.am + +version 1.2.27beta06 [April 21, 2008] + Avoid changing color_type from GRAY to RGB by + png_set_expand_gray_1_2_4_to_8(). + +version 1.2.27rc01 [April 23, 2008] + Fix broken URL for rfc2083 in png.5 and libpng-*.txt + +version 1.0.33 and 1.2.27 [April 30, 2008] + No changes. + +version 1.0.34 and 1.2.28 [April 30, 2008] + Rebuilt Makefile.in, aclocal.m4, and configure with autoconf-2.61 + due to backward incompatibilities. + Removed a stray object file from contrib/gregbook + +version 1.2.29beta01 [May 1, 2008] + Removed some stray *.diff and *.orig files + +version 1.2.29beta02 [May 1, 2008] + Reverted Makefile.in, aclocal.m4, and configure to the libpng-1.2.26 + versions. + +version 1.2.29beta03 [May 2, 2008] + Added --force to autogen libtoolize options and --force-missing to + automake options. + Changed $(ECHO) to echo in Makefile.am and Makefile.in + Updated all configure files to autoconf-2.62 + Comment out pnggcrd.c code with #ifdef/#endif if using MSC_VER + +version 1.2.29rc01 [May 4, 2008] + No changes. + +version 1.0.35 and 1.2.29 [May 8, 2008] + No changes. + +version 1.0.37 [May 9, 2008] + Updated Makefile.in and configure (omitted version 1.0.36). + +version 1.2.30beta01 [May 29, 2008] + Updated libpng.pc-configure.in and libpng-config.in per debian bug reports. + +version 1.2.30beta02 [June 25, 2008] + Restored png_flush(png_ptr) at the end of png_write_end(), that was + removed from libpng-1.0.9beta03. + +version 1.2.30beta03 [July 6, 2008] + Merged some cosmetic whitespace changes from libpng-1.4.0beta19. + Inline call of png_get_uint_32() in png_get_uint_31(), as in 1.4.0beta19. + Added demo of decoding vpAg and sTER chunks to pngtest.c, from 1.4.0beta19. + Changed PNGMAJ from 0 to 12 in makefile.darwin, which does not like 0. + Added new private function png_read_chunk_header() from 1.4.0beta19. + Merge reading of chunk length and chunk type into a single 8-byte read. + Merge writing of chunk length and chunk type into a single 8-byte write. + +version 1.2.30beta04 [July 10, 2008] + Merged more cosmetic whitespace changes from libpng-1.4.0beta19. + +version 1.0.38rc01, 1.2.30rc01 [July 18, 2008] + No changes. + +version 1.0.38rc02, 1.2.30rc02 [July 21, 2008] + Moved local array "chunkdata" from pngrutil.c to the png_struct, so + it will be freed by png_read_destroy() in case of a read error (Kurt + Christensen). + +version 1.0.38rc03, 1.2.30rc03 [July 21, 2008] + Changed "purpose" and "buffer" to png_ptr->chunkdata to avoid memory leaking. + +version 1.0.38rc04, 1.2.30rc04 [July 22, 2008] + Changed "chunkdata = NULL" to "png_ptr->chunkdata = NULL" several places in + png_decompress_chunk(). + +version 1.0.38rc05, 1.2.30rc05 [July 25, 2008] + Changed all remaining "chunkdata" to "png_ptr->chunkdata" in + png_decompress_chunk() and remove chunkdata from parameter list. + Put a call to png_check_chunk_name() in png_read_chunk_header(). + Revised png_check_chunk_name() to reject a name with a lowercase 3rd byte. + Removed two calls to png_check_chunk_name() occuring later in the process. + +version 1.0.38rc06, 1.2.30rc06 [July 29, 2008] + Added a call to png_check_chunk_name() in pngpread.c + Reverted png_check_chunk_name() to accept a name with a lowercase 3rd byte. + +version 1.0.38r07, 1.2.30r07 [August 2, 2008] + Changed "-Wall" to "-W -Wall" in the CFLAGS in all makefiles (Cosmin Truta) + Declared png_ptr "volatile" in pngread.c and pngwrite.c to avoid warnings. + Added code in pngset.c to quiet compiler warnings. + Updated contrib/visupng/cexcept.h to version 2.0.1 + Relocated a misplaced "#endif /* PNG_NO_WRITE_FILTER */" in pngwutil.c + +version 1.0.38r08, 1.2.30r08 [August 2, 2008] + Enclose "volatile" declarations in #ifdef PNG_SETJMP_SUPPORTED (Cosmin). + +version 1.0.38, 1.2.30 [August 14, 2008] + No changes. + +version 1.2.31rc01 [August 19, 2008] + Removed extra crc check at the end of png_handle_cHRM(). Bug introduced + in libpng-1.2.30beta03 (Heiko Nitzsche). + +version 1.2.31rc02 [August 19, 2008] + Added PNG_WRITE_FLUSH_SUPPORTED block around new png_flush() call. + +version 1.2.31rc03 [August 19, 2008] + Added PNG_WRITE_FLUSH_AFTER_IEND_SUPPORTED block, off by default, around + new png_flush(). + +version 1.0.39, 1.2.31 [August 21, 2008] + No changes. + +version 1.2.32beta01 [September 6, 2008] + Shortened tIME_string to 29 bytes in pngtest.c (bug introduced in + libpng-1.2.22). + Fixed off-by-one error introduced in png_push_read_zTXt() function in + libpng-1.2.30beta04/pngpread.c (Harald van Dijk) + These bugs have been given the vulnerability id CVE-2008-3964. + +version 1.0.40, 1.2.32 [September 18, 2008] + No changes. + +version 1.2.33beta01 [October 6, 2008] + Revised makefile.darwin to fix shared library numbering. + Change png_set_gray_1_2_4_to_8() to png_set_expand_gray_1_2_4_to_8() + in example.c (debian bug report) + +version 1.2.33rc01 [October 15, 2008] + No changes. + +version 1.0.41rc01, version 1.2.33rc02 [October 23, 2008] + Changed remaining "key" to "png_ptr->chunkdata" in png_handle_tEXt() + to avoid memory leak after memory failure while reading tEXt chunk.` + +version 1.2.33 [October 31, 2008] + No changes. + +version 1.2.34beta01 [November 27, 2008] + Revised png_warning() to write its message on standard output by default + when warning_fn is NULL. This was the behavior prior to libpng-1.2.9beta9. + Fixed string vs pointer-to-string error in png_check_keyword(). + Added png_check_cHRM_fixed() in png.c and moved checking from pngget.c, + pngrutil.c, and pngwrite.c, and eliminated floating point cHRM checking. + Added check for zero-area RGB cHRM triangle in png_check_cHRM_fixed(). + In png_check_cHRM_fixed(), ensure white_y is > 0, and removed redundant + check for all-zero coordinates that is detected by the triangle check. + Revised png_warning() to write its message on standard output by default + when warning_fn is NULL. + +version 1.2.34beta02 [November 28, 2008] + Corrected off-by-one error in bKGD validity check in png_write_bKGD() + and in png_handle_bKGD(). + +version 1.2.34beta03 [December 1, 2008] + Revised bKGD validity check to use >= x instead of > x + 1 + Merged with png_debug from libpng-1.4.0 to remove newlines. + +version 1.2.34beta04 [December 2, 2008] + More merging with png_debug from libpng-1.4.0 to remove newlines. + +version 1.2.34beta05 [December 5, 2008] + Removed redundant check for key==NULL before calling png_check_keyword() + to ensure that new_key gets initialized and removed extra warning + (Arvan Pritchard). + +version 1.2.34beta06 [December 9, 2008] + In png_write_png(), respect the placement of the filler bytes in an earlier + call to png_set_filler() (Jim Barry). + +version 1.2.34beta07 [December 9, 2008] + Undid previous change and added PNG_TRANSFORM_STRIP_FILLER_BEFORE and + PNG_TRANSFORM_STRIP_FILLER_AFTER conditionals and deprecated + PNG_TRANSFORM_STRIP_FILLER (Jim Barry). + +version 1.0.42rc01, 1.2.34rc01 [December 11, 2008] + No changes. + +version 1.0.42, 1.2.34 [December 18, 2008] + No changes. + +version 1.2.35beta01 [February 4, 2009] + Zero out some arrays of pointers after png_malloc(). (Tavis Ormandy) + +version 1.2.35beta02 [February 4, 2009] + Zero out more arrays of pointers after png_malloc(). + +version 1.2.35beta03 [February 5, 2009] + Use png_memset() instead of a loop to intialize pointers. We realize + this will not work on platforms where the NULL pointer is not all zeroes. + +version 1.2.35rc01 [February 11, 2009] + No changes. + +version 1.2.35rc02 [February 12, 2009] + Fix typo in new png_memset call in pngset.c (png_color should be png_charp) + +version 1.0.43 and 1.2.35 [February 14, 2009] + No changes. + +version 1.2.36beta01 [February 28, 2009] + Revised comments in png_set_read_fn() and png_set_write_fn(). + Revised order of #ifdef's and indentation in png_debug definitions of png.h + bug introduced in libpng-1.2.34. + +version 1.2.36beta02 [March 21, 2009] + Use png_memset() after png_malloc() of big_row_buf when reading an + interlaced file, to avoid a possible UMR. + Undid recent revision of PNG_NO_STDIO version of png_write_flush(). Users + having trouble with fflush() can build with PNG_NO_WRITE_FLUSH defined. + Revised libpng*.txt documentation about use of png_write_flush(). + Removed fflush() from pngtest.c. + Added "#define PNG_NO_WRITE_FLUSH" to contrib/pngminim/encoder/pngusr.h + +version 1.2.36beta03 [March 27, 2009] + Relocated misplaced PNG_1_0_X define in png.h that caused the prototype + for png_set_strip_error_numbers() to be omitted from PNG_NO_ASSEMBLER_CODE + builds. This bug was introduced in libpng-1.2.15beta4. + Added a section on differences between 1.0.x and 1.2.x to libpng.3/libpng.txt + +version 1.2.36beta04 [April 5, 2009] + Fixed potential memory leak of "new_name" in png_write_iCCP() (Ralph Giles) + +version 1.2.36beta05 [April 24, 2009] + Added "ifndef PNG_SKIP_SETJMP_CHECK" block in pngconf.h to allow + application code writers to bypass the check for multiple inclusion + of setjmp.h when they know that it is safe to ignore the situation. + Made some cosmetic changes to whitespace in pngtest output. + Renamed "user_chunk_data" to "my_user_chunk_data" in pngtest.c to suppress + "shadowed declaration" warning from gcc-4.3.3. + Renamed "gamma" to "png_gamma" in pngset.c to avoid "shadowed declaration" + warning about a global "gamma" variable in math.h on some platforms. + +version 1.2.36rc01 [April 30, 2009] + No changes. + +version 1.0.44 and 1.2.36 [May 7, 2009] + No changes. + +version 1.2.37beta01 [May 14, 2009] + Fixed inconsistency in pngrutil.c, introduced in libpng-1.2.36. The + memset() was using "png_ptr->rowbytes" instead of "row_bytes", which + the corresponding png_malloc() uses (Joe Drew). + Clarified usage of sig_bit versus sig_bit_p in example.c (Vincent Torri) + Updated some of the makefiles in the scripts directory (merged with + those in libpng-1.4.0beta57). + +version 1.2.37beta02 [May 19, 2009] + Fixed typo in libpng documentation (FILTER_AVE should be FILTER_AVG) + Relocated misplaced #endif in pngwrite.c, sCAL chunk handler. + Conditionally compile png_read_finish_row() which is not used by + progressive readers. + Added contrib/pngminim/preader to demonstrate building minimal progressive + decoder, based on contrib/gregbook with embedded libpng and zlib. + +version 1.2.37beta03 [May 20, 2009] + In contrib/pngminim/*, renamed "makefile.std" to "makefile", since there + is only one makefile in those directories, and revised the README files + accordingly. + Reformated sources in libpng style (3-space indentation, comment format) + +version 1.2.37rc01 [May 27, 2009] + No changes. + +versions 1.2.37 and 1.0.45 [June 4, 2009] + Reformatted several remaining "else statement;" and "if () statement;" into + two lines. + Added "#define PNG_NO_WRITE_SWAP" to contrib/pngminim/encoder/pngusr.h + and "define PNG_NO_READ_SWAP" to decoder/pngusr.h and preader/pngusr.h + Added sections about the git repository and our coding style to the + documentation (merged from libpng-1.4.0beta62) + Added a section to the libpng documentation about using png_get_io_ptr() + in configure scripts to detect the presence of libpng. + +version 1.2.38beta01 [June 17, 2009] + Revised libpng*.txt and libpng.3 to mention calling png_set_IHDR() + multiple times and to specify the sample order in the tRNS chunk, + because the ISO PNG specification has a typo in the tRNS table. + Changed several PNG_UNKNOWN_CHUNK_SUPPORTED to + PNG_HANDLE_AS_UNKNOWN_SUPPORTED, to make the png_set_keep mechanism + available for ignoring known chunks even when not saving unknown chunks. + Adopted preference for consistent use of "#ifdef" and "#ifndef" versus + "#if defined()" and "if !defined()" where possible. + Added PNG_NO_HANDLE_AS_UNKNOWN in the PNG_LEGACY_SUPPORTED block of + pngconf.h, and moved the various unknown chunk macro definitions + outside of the PNG_READ|WRITE_ANCILLARY_CHUNK_SUPPORTED blocks. + +version 1.0.46 [June 18, 2009] + Removed some editing cruft from scripts/libpng.pc.in and some makefiles. + +version 1.2.38rc01 [June 24, 2009] + No changes. + +version 1.2.38rc02 [June 29, 2009] + Added a reference to the libpng license in each source file. + +version 1.2.38rc03 [July 11, 2009] + Revised references to the libpng license in pngconf.h and contrib/visupng + source files. + Rebuilt configure scripts with autoconf-2.63. + +version 1.0.47 and 1.2.38 [July 16, 2009] + No changes. + +version 1.2.39beta01 [July 25, 2009] + Added a prototype for png_64bit_product() in png.c + +version 1.2.39beta02 [July 27, 2009] + Avoid a possible NULL dereference in debug build, in png_set_text_2(). + (bug introduced in libpng-0.95, discovered by Evan Rouault) + +version 1.2.39beta03 [July 29, 2009] + Relocated new png_64_bit_product() prototype into png.h + Expanded the information about prototypes in the libpng style section of + the documentation. + Rebuilt configure scripts with autoconf-2.64. + +version 1.2.39beta04 [August 1, 2009] + Replaced *.tar.lzma with *.txz in distribution. Get the xz codec + from . + +version 1.2.39beta05 [August 1, 2009] + Reject attempt to write iCCP chunk with negative embedded profile length + (JD Chen) + +version 1.2.39c01 [August 6, 2009] + No changes. + +version 1.2.39 and 1.0.48 [August 13, 2009] + No changes. + +version 1.2.40beta01 [August 20, 2009] + Removed an extra png_debug() recently added to png_write_find_filter(). + Fixed incorrect #ifdef in pngset.c regarding unknown chunk support. + +version 1.2.40rc01 [September 2, 2009] + Various bugfixes and improvements to CMakeLists.txt (Philip Lowman) + +version 1.2.40 and 1.0.49 [September 2, 2009] + No changes. + +version 1.0.50 [September 10, 2009] + Removed some editing cruft from pngset.c and pngwutil.c. + +version 1.2.41beta01 [September 25, 2009] + Moved redundant IHDR checking into new png_check_IHDR() in png.c + and report all errors found in the IHDR data. + Eliminated useless call to png_check_cHRM() from pngset.c + Expanded TAB characters in pngrtran.c + +version 1.2.41beta02 [September 30, 2009] + Revised png_check_IHDR(). + +version 1.2.41beta03 [October 1, 2009] + Revised png_check_IHDR() again, to check info_ptr members instead of + the contents of the returned parameters. + +version 1.2.41beta04 [October 7, 2009] + Added "xcode" project similar one already in libpng-1.4.0beta (Alam Arias). + Ported some cosmetic changes from libpng-1.4.0beta86. + Eliminated a shadowed declaration of "pp" in png_handle_sPLT(). + +version 1.2.41beta05 [October 17, 2009] + Revised pngconf.h to make it easier to enable iTXt support. From libpng + version 1.2.9 through 1.2.40, defining PNG_iTXt_SUPPORTED did not work + as expected. + Ported some cosmetic changes from libpng-1.4.0beta87, changing + many "#if defined(x)" to "#ifdef x". + +version 1.2.41beta06 [October 18, 2009] + Restored PNG_USE_LOCAL_ARRAYS code in pngread.c that was inadvertently + deleted in libpng-1.2.41beta05. + Converted all PNG_NO_* tests to PNG_*_SUPPORTED everywhere except pngconf.h + as in libpng-1.4.0beta78 and later. + +version 1.2.41beta07 [October 21, 2009] + Ported some cosmetic changes from libpng-1.4.0rc01, changing + many "#if defined(x)" to "#ifdef x" in png.h and pngconf.h. + +version 1.2.41beta08 [October 30, 2009] + Ported from libpng-1.4.0rc01: png_calloc(), png_get_io_chunk_name(), + png_get_io_state(), png_set_user_cache_max(), png_get_user_cache_max(), + png_set_premultiply_alpha, and png_do_read_premultiply_alpha(). + Relocated png_do_chop() ahead of building gamma tables in pngrtran.c + This avoids building 16-bit gamma tables unnecessarily. + +version 1.2.41beta09 [November 1, 2009] + Removed a harmless extra png_set_invert_alpha() from pngwrite.c + More bugfixes and improvements to CMakeLists.txt (Philip Lowman) + Moved CMakeLists.txt from scripts into the main libpng directory. + Apply png_user_chunk_cache_max within png_decompress_chunk(). + Merged libpng-1.2.41.txt with libpng-1.4.0.txt where appropriate. + +version 1.2.41beta10 [November 1, 2009] + Enabled iTXt support by default. To ensure binary compatibility with + previous versions, the "lang" and "lang_key" members will be assumed + to be omitted from previous versions unless the current libpng + version was built with PNG_iTXt_SUPPORTED (which is otherwise no + longer necessary to gain iTXt support), as a signal that the user has + been building previous versions with PNG_iTXt_SUPPORTED as well. + +version 1.2.41beta11 [November 2, 2009] + Store user's user_png_ver in new png_ptr->user_png_ver element. + Revised iTXt support. To ensure binary compatibility with + previous versions, the "lang" and "lang_key" members will be assumed + to be omitted from versions prior to 1.2.41beta11 whenever there is a + library mismatch. + +version 1.2.41beta12 [November 2, 2009] + Free png_ptr->user_png_ver when destroying png_ptr. + +version 1.2.41beta13 [November 3, 2009] + Updated scripts/pngw32.def and projects/wince/png32ce.def + Copied projects/wince/png32ce.def to the scripts directory. + Added scripts/makefile.wce + Patched ltmain.sh for wince support. + Added PNG_CONVERT_tIME_SUPPORTED macro. + +version 1.2.41beta14 [November 8, 2009] + versions 1.2.41beta05 through 1.2.41beta13 were abandoned. + The 1.0.x/1.2.x series will only receive security updates from now on. + Make inclusion of time.h in pngconf.h depend on PNG_CONVERT_tIME_SUPPORTED + Make #define PNG_CONVERT_tIME_SUPPORTED depend on PNG_WRITE_tIME_SUPPORTED + Reverted iTXt compatibility stuff from 1.2.41beta05, 1.2.41beta11, and + 1.2.41beta12. + Reverted IOSTATE feature, user_cache_max, and premultiply_alpha features + from 1.2.41beta08. + Retained png_calloc() from 1.2.41beta08 but as a non-exported function, + and removed reference to png_calloc from scripts/*.def + +version 1.2.41beta15 [November 8, 2009] + Added PNG_DEPSTRUCT, PNG_DEPRECATED, PNG_USE_RESULT, PNG_NORETURN, and + PNG_ALLOCATED macros to detect deprecated direct access to the + png_struct or info_struct members and other deprecated usage in + applications (John Bowler). + Updated scripts/makefile* to add "-DPNG_CONFIGURE_LIBPNG" to CFLAGS, + to prevent warnings about direct access to png structs by libpng + functions while building libpng. They need to be tested, especially + those using compilers other than gcc. + Updated projects/visualc6 and visualc71 with "/d PNG_CONFIGURE_LIBPNG". + +version 1.2.41beta16 [November 9, 2009] + Removed three direct references to read_info_ptr members in pngtest.c + that were detected by the new PNG_DEPSTRUCT macro. + Only #define PNG_DEPSTRUCT, etc. in pngconf.h if not already defined. + +version 1.2.41beta17 [November 10, 2009] + Updated CMakeLists.txt to add "-DPNG_CONFIGURE_LIBPNG" to the definitions. + Marked deprecated function prototypes with PNG_DEPRECATED. + Marked memory allocation function prototypes with PNG_ALLOCATED. + Changed png_check_sig() to !png_sig_cmp() in contrib programs. + Corrected the png_get_IHDR() call in contrib/gregbook/readpng2.c + Added "-DPNG_CONFIGURE_LIBPNG" to the contrib/pngminum makefiles. + +version 1.2.41beta18 [November 11, 2009] + Renamed scripts/makefile.wce to scripts/makefile.cegcc + Marked nonexported functions with PNG_PRIVATE macro. + +version 1.2.41rc01 and 1.0.51rc01 [November 18, 2009] + Revised scripts/*.def to reflect functions actually exported by libpng. + Updated the copyright year in scripts/pngw32.rc from 2004 to 2009. + Moved descriptions of makefiles and other scripts out of INSTALL into + scripts/README.txt + +version 1.2.41rc02 [November 22, 2009] + Rebuilt the configure scripts with autoconf-2.65 + +version 1.2.41rc03 [November 25, 2009] + Disabled the new pedantic warnings about deprecated function use + and deprecated structure access unless the user defines + PNG_PEDANTIC_WARNINGS. + Added "#define PNG_NO_PEDANTIC_WARNINGS" in the libpng source files. + Removed "-DPNG_CONFIGURE_LIBPNG" from the makefiles and projects. + +version 1.2.41 and 1.0.51 [December 3, 2009] + Updated the list of files and made some cosmetic changes in README. + +version 1.2.42beta01 [December 4, 2009] + Removed "#define PNG_NO_ERROR_NUMBERS" that was inadvertently added + to pngconf.h in version 1.2.41. + Revised scripts/makefile.netbsd, makefile.openbsd, and makefile.sco + to put png.h and pngconf.h in $prefix/include, like the other scripts, + instead of in $prefix/include/libpng. Also revised makefile.sco + to put them in $prefix/include/libpng12 instead of in + $prefix/include/libpng/libpng12. + Removed leftover "-DPNG_CONFIGURE_LIBPNG" from scripts/makefile.darwin + +version 1.2.42beta02 [December 11, 2009] + Removed leftover "-DPNG_CONFIGURE_LIBPNG" from contrib/pngminim/*/makefile + Relocated png_do_chop() to its original position in pngrtran.c. The + change in version 1.2.41beta08 caused transparency to be handled wrong + in some 16-bit datastreams (Yusaku Sugai). + +version 1.2.42rc01 [December 17, 2009] + No changes. + +version 1.2.42rc02 [December 22, 2009] + Renamed libpng-pc.in back to libpng.pc.in and revised CMakeLists.txt + (revising changes made in 1.2.41beta17 and 1.2.41rc01) + +version 1.2.42rc03 [December 25, 2009] + Swapped PNG_UNKNOWN_CHUNKS_SUPPORTED and PNG_HANDLE_AS_UNKNOWN_SUPPORTED + in pngset.c to be consistent with other changes in version 1.2.38. + +version 1.2.42rc04 [January 1, 2010] + Marked png_memcpy_check() and png_memset_check() PNG_DEPRECATED. + Updated copyright year. + +version 1.2.42rc05 [January 2, 2010] + Avoid deprecated references to png_ptr-io_ptr and png_ptr->error_ptr + in pngtest.c + +version 1.2.42 and 1.0.52 [January 3, 2010] + No changes. + +version 1.2.43beta01 [January 27, 2010] + Updated CMakeLists.txt for consistent indentation and to avoid an + unclosed if-statement warning (Philip Lowman). + Removed "#ifdef PNG_1_0_X / #endif" surrounding + PNG_READ_16_TO_8_SUPPORTED and PNG_READ_GRAY_TO_RGB_SUPPORTED + in pngconf.h. These were added in libpng-1.2.41beta08 and libpng-1.0.51, + which introduced a binary incompatibility with libpng-1.0.50. + Backported new png_decompress_chunk() algorithm from libpng-1.4.1. + +version 1.2.43beta02 [February 1, 2010] + Backported two-pass png_decompress_chunk() algorithm from libpng-1.4.1. + +version 1.2.43beta03 [February 6, 2010] + Backported fast png_push_save_buffer() algorithm from libpng-1.4.1. + Backported some cosmetic changes from libpng-1.4.1. + +version 1.2.43beta04 [February 8, 2010] + Reverted recent changes to png_push_save-buffer(). + Removed PNGAPI declaration of png_calloc() and png_write_sig() in + 1ibpng-1.2.X, introduced by mistake in libpng-1.2.41. + Return allocated "old_buffer" in png_push_save_buffer() before png_error() + to avoid a potential memory leak. + +version 1.2.43beta05 [February 8, 2010] + Ported rewritten png_decompress_chunk() by John Bowler from libpng-1.4.1. + +version 1.0.53rc01 and 1.2.43rc01 [February 18, 2010] + No changes. + +version 1.0.53rc02 and 1.2.43rc02 [February 19, 2010] + Define _ALL_SOURCE in configure.ac, makefile.aix, and CMakeLists.txt + when using AIX compiler. + +version 1.0.53 and 1.2.43 [February 25, 2010] + Removed unused gzio.c from contrib/pngminim gather and makefile scripts + +version 1.2.44beta01 [June 18, 2010] + In pngpread.c: png_push_have_row() add check for new_row > height + Removed the now-redundant check for out-of-bounds new_row from example.c + +version 1.2.44beta02 [June 19, 2010] + In pngpread.c: png_push_process_row() add check for too many rows. + Removed the now-redundant check for new_row > height in png_push_have_row(). + +version 1.2.44beta03 [June 20, 2010] + Rewrote png_process_IDAT_data() to consistently treat extra data as warnings + and handle end conditions more cleanly. + Removed the new (beta02) check in png_push_process_row(). + +version 1.2.44rc01 [June 21, 2010] + Revised some comments in png_process_IDAT_data(). + +version 1.2.44rc02 [June 22, 2010] + Stop memory leak when reading a malformed sCAL chunk. + +version 1.2.44rc03 [June 23, 2010] + Revised pngpread.c patch of beta05 to avoid an endless loop. + +version 1.2.44 [June 26, 2010] + Updated some of the "last changed" dates. + +version 1.2.45beta01 [June 7, 2011] + Fixed uninitialized memory read in png_format_buffer() (Bug + report by Frank Busse, related to CVE-2004-0421). + Pass "" instead of '\0' to png_default_error() in png_err(). This mistake + was introduced in libpng-1.2.20beta01. + Check for up->location !PNG_AFTER_IDAT when writing unknown chunks + before IDAT. + Ported bugfix in pngrtran.c from 1.5.3: when expanding a paletted image, + always expand to RGBA if transparency is present. + +version 1.2.45beta02 [June 8, 2011] + Check for integer overflow in png_set_rgb_to_gray(). + +version 1.2.45beta03 [June 19, 2011] + Check for sCAL chunk too short. + +version 1.2.45rc01 and 1.0.55rc01 [June 30, 2011] + Updated "last changed" dates and copyright year. + +version 1.2.45 and 1.0.55 [July 7, 2011] + No changes. + +version 1.2.46rc01 and 1.0.56rc01 [July 8, 2011] + Reverted changes to Makefile.am and Makefile.in to libpng-1.2.44 versions. + +version 1.2.46rc02 and 1.0.56rc02 [July 8, 2011] + Added CMakeLists.txt, projects/xcode, and pnggccrd.c to EXTRA_DIST in + Makefile.am and Makefile.in + +version 1.2.46 and 1.0.56 [July 9, 2011] + Udated copyright year to 2011. + +version 1.2.47beta01 [February 17, 2012] + Updated contrib/pngminus/makefile.std (Samuli Souminen) + +version 1.0.57rc01 and 1.2.47rc01 [February 17, 2012] + Fixed CVE-2011-3026 buffer overrun bug. + Fixed CVE-2011-3026 buffer overrun bug. This bug was introduced when + iCCP chunk support was added at libpng-1.0.6. + +version 1.0.57 and 1.2.47 [February 18, 2012] + No changes. + +version 1.2.48beta01 [February 27, 2012] + Removed two useless #ifdef directives from pngread.c and one from pngrutil.c + Eliminated redundant png_push_read_tEXt|zTXt|iTXt|unknown code from + pngpread.c and use the sequential png_handle_tEXt, etc., in pngrutil.c; + now that png_ptr->buffer is inaccessible to applications, the special + handling is no longer useful. + Fixed bug with png_handle_hIST with odd chunk length (Frank Busse). + Fixed incorrect type (int copy should be png_size_t copy) in png_inflate(). + Fixed off-by-one bug in png_handle_sCAL() when using fixed point arithmetic, + causing out-of-bounds read in png_set_sCAL() because of failure to copy + the string terminators. This bug was introduced in libpng-1.0.6 (Frank + Busse). + +version 1.2.48rc01 [March 2, 2012] + Removed the png_free() of unused png_ptr->current_text from pngread.c. + Added libpng license text to pnggccrd.c and pngvcrd.c (requested by Chrome). + +version 1.2.48rc02 [March 2, 2012] + Removed all of the assembler code from pnggccrd.c and just "return 2;". + +version 1.0.58 and 1.2.48 [March 8, 2012] + No changes. + +version 1.2.49rc01 [March 29, 2012] + Revised png_set_text_2() to avoid potential memory corruption (fixes + CVE-2011-3048). + Prevent PNG_EXPAND+PNG_SHIFT doing the shift twice. + +Send comments/corrections/commendations to png-mng-implement at lists.sf.net +(subscription required; visit +https://lists.sourceforge.net/lists/listinfo/png-mng-implement +to subscribe) +or to glennrp at users.sourceforge.net + +Glenn R-P +#endif diff --git a/external/libpng/CMakeLists.txt b/external/libpng/CMakeLists.txt new file mode 100644 index 0000000..c8c0d0b --- /dev/null +++ b/external/libpng/CMakeLists.txt @@ -0,0 +1,284 @@ +cmake_minimum_required(VERSION 2.4.3) +set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS true) + +if(UNIX AND NOT DEFINED CMAKE_BUILD_TYPE) + set(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING + "Choose the type of build, options are: + None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) + Debug + Release + RelWithDebInfo + MinSizeRel.") +endif() + +project(libpng C) +enable_testing() + +# Copyright (C) 2007-2010 Glenn Randers-Pehrson + +# This code is released under the libpng license. +# For conditions of distribution and use, see the disclaimer +# and license in png.h + +set(PNGLIB_MAJOR 1) +set(PNGLIB_MINOR 2) +set(PNGLIB_RELEASE 49) +set(PNGLIB_NAME libpng${PNGLIB_MAJOR}${PNGLIB_MINOR}) +set(PNGLIB_VERSION ${PNGLIB_MAJOR}.${PNGLIB_MINOR}.${PNGLIB_RELEASE}) + +# needed packages +find_package(ZLIB REQUIRED) +include_directories(${ZLIB_INCLUDE_DIR}) + +if(NOT WIN32) + find_library(M_LIBRARY + NAMES m + PATHS /usr/lib /usr/local/lib + ) + if(NOT M_LIBRARY) + message(STATUS + "math library 'libm' not found - floating point support disabled") + endif() +else() + # not needed on windows + set(M_LIBRARY "") +endif() + +# COMMAND LINE OPTIONS +if(DEFINED PNG_SHARED) + option(PNG_SHARED "Build shared lib" ${PNG_SHARED}) +else() + option(PNG_SHARED "Build shared lib" ON) +endif() +if(DEFINED PNG_STATIC) + option(PNG_STATIC "Build static lib" ${PNG_STATIC}) +else() + option(PNG_STATIC "Build static lib" ON) +endif() + +if(MINGW) + option(PNG_TESTS "Build pngtest" NO) +else() + option(PNG_TESTS "Build pngtest" YES) +endif() + +option(PNG_NO_CONSOLE_IO "FIXME" YES) +option(PNG_NO_STDIO "FIXME" YES) +option(PNG_DEBUG "Build with debug output" NO) +option(PNGARG "FIXME" YES) +#TODO: +# PNG_CONSOLE_IO_SUPPORTED + +# maybe needs improving, but currently I don't know when we can enable what :) +set(png_asm_tmp "OFF") +if(NOT WIN32) + find_program(uname_executable NAMES uname PATHS /bin /usr/bin /usr/local/bin) + if(uname_executable) + exec_program(${uname_executable} + ARGS --machine OUTPUT_VARIABLE uname_output) + if("uname_output" MATCHES "^.*i[1-9]86.*$") + set(png_asm_tmp "ON") + else("uname_output" MATCHES "^.*i[1-9]86.*$") + set(png_asm_tmp "OFF") + endif("uname_output" MATCHES "^.*i[1-9]86.*$") + endif(uname_executable) +else() + # this env var is normally only set on win64 + set(TEXT "ProgramFiles(x86)") + if("$ENV{${TEXT}}" STREQUAL "") + set(png_asm_tmp "ON") + endif("$ENV{${TEXT}}" STREQUAL "") +endif() + +# SET LIBNAME +set(PNG_LIB_NAME png${PNGLIB_MAJOR}${PNGLIB_MINOR}) + +# to distinguish between debug and release lib +set(CMAKE_DEBUG_POSTFIX "d") + + +# OUR SOURCES +set(libpng_sources + png.h + pngconf.h + png.c + pngerror.c + pngget.c + pngmem.c + pngpread.c + pngread.c + pngrio.c + pngrtran.c + pngrutil.c + pngset.c + pngtrans.c + pngwio.c + pngwrite.c + pngwtran.c + pngwutil.c +) +set(pngtest_sources + pngtest.c +) +# SOME NEEDED DEFINITIONS + +add_definitions(-DPNG_CONFIGURE_LIBPNG) + +if(_AIX) + add_definitions(-D_ALL_SOURCE) +endif(_AIX) + +if(MSVC) + add_definitions(-DPNG_NO_MODULEDEF -D_CRT_SECURE_NO_DEPRECATE) +endif(MSVC) + +if(PNG_SHARED OR NOT MSVC) + #if building msvc static this has NOT to be defined + add_definitions(-DZLIB_DLL) +endif() + +add_definitions(-DLIBPNG_NO_MMX) +add_definitions(-DPNG_NO_MMX_CODE) + + +if(PNG_CONSOLE_IO_SUPPORTED) + add_definitions(-DPNG_CONSOLE_IO_SUPPORTED) +endif() + +if(PNG_NO_CONSOLE_IO) + add_definitions(-DPNG_NO_CONSOLE_IO) +endif() + +if(PNG_NO_STDIO) + add_definitions(-DPNG_NO_STDIO) +endif() + +if(PNG_DEBUG) + add_definitions(-DPNG_DEBUG) +endif() + +if(NOT M_LIBRARY AND NOT WIN32) + add_definitions(-DPNG_NO_FLOATING_POINT_SUPPORTED) +endif() + +# NOW BUILD OUR TARGET +include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${ZLIB_INCLUDE_DIR}) + +if(PNG_SHARED) + add_library(${PNG_LIB_NAME} SHARED ${libpng_sources}) + if(MSVC) + # msvc does not append 'lib' - do it here to have consistent name + set_target_properties(${PNG_LIB_NAME} PROPERTIES PREFIX "lib") + endif() + target_link_libraries(${PNG_LIB_NAME} ${ZLIB_LIBRARY} ${M_LIBRARY}) +endif() + +if(PNG_STATIC) +# does not work without changing name + set(PNG_LIB_NAME_STATIC ${PNG_LIB_NAME}_static) + add_library(${PNG_LIB_NAME_STATIC} STATIC ${libpng_sources}) + if(MSVC) + # msvc does not append 'lib' - do it here to have consistent name + set_target_properties(${PNG_LIB_NAME_STATIC} PROPERTIES PREFIX "lib") + endif() +endif() + + +if(PNG_SHARED AND WIN32) + set_target_properties(${PNG_LIB_NAME} PROPERTIES DEFINE_SYMBOL PNG_BUILD_DLL) +endif() + +if(PNG_TESTS AND PNG_SHARED) + # does not work with msvc due to png_lib_ver issue + add_executable(pngtest ${pngtest_sources}) + target_link_libraries(pngtest ${PNG_LIB_NAME}) + add_test(pngtest pngtest ${CMAKE_CURRENT_SOURCE_DIR}/pngtest.png) +endif() + + +# CREATE PKGCONFIG FILES +# we use the same files like ./configure, so we have to set its vars +set(prefix ${CMAKE_INSTALL_PREFIX}) +set(exec_prefix ${CMAKE_INSTALL_PREFIX}) +set(libdir ${CMAKE_INSTALL_PREFIX}/lib) +set(includedir ${CMAKE_INSTALL_PREFIX}/include) + +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/scripts/libpng.pc.in + ${CMAKE_CURRENT_BINARY_DIR}/libpng.pc) +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/scripts/libpng-config.in + ${CMAKE_CURRENT_BINARY_DIR}/libpng-config) +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/scripts/libpng.pc.in + ${CMAKE_CURRENT_BINARY_DIR}/${PNGLIB_NAME}.pc) +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/scripts/libpng-config.in + ${CMAKE_CURRENT_BINARY_DIR}/${PNGLIB_NAME}-config) + +# SET UP LINKS +if(PNG_SHARED) + set_target_properties(${PNG_LIB_NAME} PROPERTIES +# VERSION 0.${PNGLIB_RELEASE}.1.2.49 + VERSION 0.${PNGLIB_RELEASE}.0 + SOVERSION 0 + CLEAN_DIRECT_OUTPUT 1) +endif() +if(PNG_STATIC) + if(NOT WIN32) + # that's uncool on win32 - it overwrites our static import lib... + set_target_properties(${PNG_LIB_NAME_STATIC} PROPERTIES + OUTPUT_NAME ${PNG_LIB_NAME} + CLEAN_DIRECT_OUTPUT 1) + endif() +endif() + +# INSTALL +if(NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL ) + if(PNG_SHARED) + install(TARGETS ${PNG_LIB_NAME} + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib) + endif() + if(PNG_STATIC) + install(TARGETS ${PNG_LIB_NAME_STATIC} + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib) + endif() +endif() + +if(NOT SKIP_INSTALL_HEADERS AND NOT SKIP_INSTALL_ALL ) + install(FILES png.h pngconf.h DESTINATION include) + install(FILES png.h pngconf.h DESTINATION include/${PNGLIB_NAME}) +endif() +if(NOT SKIP_INSTALL_EXECUTABLES AND NOT SKIP_INSTALL_ALL ) + install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/libpng-config DESTINATION bin) + install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/${PNGLIB_NAME}-config + DESTINATION bin) +endif() +if(NOT SKIP_INSTALL_FILES AND NOT SKIP_INSTALL_ALL ) + # Install man pages + install(FILES libpng.3 libpngpf.3 DESTINATION man/man3) + install(FILES png.5 DESTINATION man/man5) + # Install pkg-config files + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libpng.pc + DESTINATION lib/pkgconfig) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libpng-config + DESTINATION bin) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PNGLIB_NAME}.pc + DESTINATION lib/pkgconfig) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PNGLIB_NAME}-config + DESTINATION bin) +endif() + +# what's with libpng.txt and all the extra files? + + +# UNINSTALL +# do we need this? + + +# DIST +# do we need this? + +# to create msvc import lib for mingw compiled shared lib +# pexports libpng.dll > libpng.def +# lib /def:libpng.def /machine:x86 + diff --git a/external/libpng/INSTALL b/external/libpng/INSTALL new file mode 100644 index 0000000..b688362 --- /dev/null +++ b/external/libpng/INSTALL @@ -0,0 +1,163 @@ + +Installing libpng version 1.2.49 - March 29, 2012 + +On Unix/Linux and similar systems, you can simply type + + ./configure [--prefix=/path] + make check + make install + +and ignore the rest of this document. + +If configure does not work on your system and you have a reasonably +up-to-date set of tools, running ./autogen.sh before running ./configure +may fix the problem. You can also run the individual commands in +autogen.sh with the --force option, if supported by your version of +the tools. If you run 'libtoolize --force', though, this will replace +the distributed, patched, version of ltmain.sh with an unpatched version +and your shared library builds may fail to produce libraries with the +correct version numbers. + +Instead, you can use one of the custom-built makefiles in the +"scripts" directory + + cp scripts/makefile.system makefile + make test + make install + +The files that are presently available in the scripts directory +are listed and described in scripts/README.txt. + +Or you can use one of the "projects" in the "projects" directory. + +Before installing libpng, you must first install zlib, if it +is not already on your system. zlib can usually be found +wherever you got libpng. zlib can be placed in another directory, +at the same level as libpng. + +If you want to use "cmake" (see www.cmake.org), type + + cmake . -DCMAKE_INSTALL_PREFIX=/path + make + make install + +If your system already has a preinstalled zlib you will still need +to have access to the zlib.h and zconf.h include files that +correspond to the version of zlib that's installed. + +You can rename the directories that you downloaded (they +might be called "libpng-1.2.49" or "libpng12" and "zlib-1.2.3" +or "zlib123") so that you have directories called "zlib" and "libpng". + +Your directory structure should look like this: + + .. (the parent directory) + libpng (this directory) + INSTALL (this file) + README + *.h + *.c + CMakeLists.txt => "cmake" script + configuration files: + configure.ac, configure, Makefile.am, Makefile.in, + autogen.sh, config.guess, ltmain.sh, missing, + aclocal.m4, config.h.in, config.sub, + depcomp, install-sh, mkinstalldirs, test-pngtest.sh + contrib + gregbook + pngminim + pngminus + pngsuite + visupng + projects + cbuilder5 (Borland) + visualc6 (msvc) + visualc71 + xcode + scripts + makefile.* + *.def (module definition files) + pngtest.png + etc. + zlib + README + *.h + *.c + contrib + etc. + +If the line endings in the files look funny, you may wish to get the other +distribution of libpng. It is available in both tar.gz (UNIX style line +endings) and zip (DOS style line endings) formats. + +If you are building libpng with MSVC, you can enter the +libpng projects\visualc6 or visualc71 directory and follow the instructions +in README.txt. + +Otherwise enter the zlib directory and follow the instructions in zlib/README, +then come back here and run "configure" or choose the appropriate +makefile.sys in the scripts directory. + +Copy the file (or files) that you need from the +scripts directory into this directory, for example + + MSDOS example: copy scripts\makefile.msc makefile + UNIX example: cp scripts/makefile.std makefile + +Read the makefile to see if you need to change any source or +target directories to match your preferences. + +Then read pngconf.h to see if you want to make any configuration +changes. + +Then just run "make" which will create the libpng library in +this directory and "make test" which will run a quick test that reads +the "pngtest.png" file and writes a "pngout.png" file that should be +identical to it. Look for "9782 zero samples" in the output of the +test. For more confidence, you can run another test by typing +"pngtest pngnow.png" and looking for "289 zero samples" in the output. +Also, you can run "pngtest -m contrib/pngsuite/*.png" and compare +your output with the result shown in contrib/pngsuite/README. + +Most of the makefiles will allow you to run "make install" to +put the library in its final resting place (if you want to +do that, run "make install" in the zlib directory first if necessary). +Some also allow you to run "make test-installed" after you have +run "make install". + +If you encounter a compiler error message complaining about the +lines + + __png.h__ already includes setjmp.h; + __dont__ include it again.; + +this means you have compiled another module that includes setjmp.h, +which is hazardous because the two modules might not include exactly +the same setjmp.h. If you are sure that you know what you are doing +and that they are exactly the same, then you can comment out or +delete the two lines. Better yet, use the cexcept interface +instead, as demonstrated in contrib/visupng of the libpng distribution. + +Further information can be found in the README and libpng.txt +files, in the individual makefiles, in png.h, and the manual pages +libpng.3 and png.5. + + +Using the ./configure script -- 16 December 2002. +================================================= + + +The ./configure script should work compatibly with what scripts/makefile.* +did, however there are some options you need to add to configure explicitly, +which previously was done semi-automatically (if you didn't edit +scripts/makefile.* yourself, that is) + + +CFLAGS="-Wall -O -funroll-loops \ +-malign-loops=2 -malign-functions=2" ./configure --prefix=/usr/include \ +--with-pkgconfigdir=/usr/lib/pkgconfig --includedir=/usr/include + +You can alternatively specify --includedir=/usr/include, /usr/local/include, +/usr/include/png12, or whatever. + + diff --git a/external/libpng/KNOWNBUG b/external/libpng/KNOWNBUG new file mode 100644 index 0000000..066c837 --- /dev/null +++ b/external/libpng/KNOWNBUG @@ -0,0 +1,22 @@ + +Known bugs in libpng version 1.2.49 + +1. February 23, 2006: The custom makefiles don't build libpng with -lz. + + STATUS: This is a subject of debate. The change will probably be made + as a part of a major overhaul of the makefiles in libpng version 1.4.0. + +2. February 24, 2006: The Makefile generated by the "configure" script + fails to install symbolic links + libpng12.so => libpng12.so.0.1.2.9betaN + that are generated by the custom makefiles. + +3. September 4, 2007: There is a report that pngtest crashes on MacOS 10. + + STATUS: workarounds are + 1) Compile without optimization (crashes are observed with + -arch i386 and -O2 or -O3, using gcc-4.0.1). + 2) Compile pngtest.c with PNG_DEBUG defined (the bug goes away if + you try to look at it). + 3) Ignore the crash. The library itself seems to be OK. + diff --git a/external/libpng/LICENSE b/external/libpng/LICENSE new file mode 100644 index 0000000..c04d730 --- /dev/null +++ b/external/libpng/LICENSE @@ -0,0 +1,111 @@ + +This copy of the libpng notices is provided for your convenience. In case of +any discrepancy between this copy and the notices in the file png.h that is +included in the libpng distribution, the latter shall prevail. + +COPYRIGHT NOTICE, DISCLAIMER, and LICENSE: + +If you modify libpng you may insert additional notices immediately following +this sentence. + +This code is released under the libpng license. + +libpng versions 1.2.6, August 15, 2004, through 1.2.49, March 29, 2012, are +Copyright (c) 2004, 2006-2009 Glenn Randers-Pehrson, and are +distributed according to the same disclaimer and license as libpng-1.2.5 +with the following individual added to the list of Contributing Authors + + Cosmin Truta + +libpng versions 1.0.7, July 1, 2000, through 1.2.5 - October 3, 2002, are +Copyright (c) 2000-2002 Glenn Randers-Pehrson, and are +distributed according to the same disclaimer and license as libpng-1.0.6 +with the following individuals added to the list of Contributing Authors + + Simon-Pierre Cadieux + Eric S. Raymond + Gilles Vollant + +and with the following additions to the disclaimer: + + There is no warranty against interference with your enjoyment of the + library or against infringement. There is no warranty that our + efforts or the library will fulfill any of your particular purposes + or needs. This library is provided with all faults, and the entire + risk of satisfactory quality, performance, accuracy, and effort is with + the user. + +libpng versions 0.97, January 1998, through 1.0.6, March 20, 2000, are +Copyright (c) 1998, 1999 Glenn Randers-Pehrson, and are +distributed according to the same disclaimer and license as libpng-0.96, +with the following individuals added to the list of Contributing Authors: + + Tom Lane + Glenn Randers-Pehrson + Willem van Schaik + +libpng versions 0.89, June 1996, through 0.96, May 1997, are +Copyright (c) 1996, 1997 Andreas Dilger +Distributed according to the same disclaimer and license as libpng-0.88, +with the following individuals added to the list of Contributing Authors: + + John Bowler + Kevin Bracey + Sam Bushell + Magnus Holmgren + Greg Roelofs + Tom Tanner + +libpng versions 0.5, May 1995, through 0.88, January 1996, are +Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc. + +For the purposes of this copyright and license, "Contributing Authors" +is defined as the following set of individuals: + + Andreas Dilger + Dave Martindale + Guy Eric Schalnat + Paul Schmidt + Tim Wegner + +The PNG Reference Library is supplied "AS IS". The Contributing Authors +and Group 42, Inc. disclaim all warranties, expressed or implied, +including, without limitation, the warranties of merchantability and of +fitness for any purpose. The Contributing Authors and Group 42, Inc. +assume no liability for direct, indirect, incidental, special, exemplary, +or consequential damages, which may result from the use of the PNG +Reference Library, even if advised of the possibility of such damage. + +Permission is hereby granted to use, copy, modify, and distribute this +source code, or portions hereof, for any purpose, without fee, subject +to the following restrictions: + +1. The origin of this source code must not be misrepresented. + +2. Altered versions must be plainly marked as such and must not + be misrepresented as being the original source. + +3. This Copyright notice may not be removed or altered from any + source or altered source distribution. + +The Contributing Authors and Group 42, Inc. specifically permit, without +fee, and encourage the use of this source code as a component to +supporting the PNG file format in commercial products. If you use this +source code in a product, acknowledgment is not required but would be +appreciated. + + +A "png_get_copyright" function is available, for convenient use in "about" +boxes and the like: + + printf("%s",png_get_copyright(NULL)); + +Also, the PNG logo (in PNG format, of course) is supplied in the +files "pngbar.png" and "pngbar.jpg (88x31) and "pngnow.png" (98x31). + +Libpng is OSI Certified Open Source Software. OSI Certified Open Source is a +certification mark of the Open Source Initiative. + +Glenn Randers-Pehrson +glennrp at users.sourceforge.net +March 29, 2012 diff --git a/src/libpng/README b/external/libpng/README similarity index 100% rename from src/libpng/README rename to external/libpng/README diff --git a/src/libpng/TODO b/external/libpng/TODO similarity index 100% rename from src/libpng/TODO rename to external/libpng/TODO diff --git a/src/libpng/Y2KINFO b/external/libpng/Y2KINFO similarity index 100% rename from src/libpng/Y2KINFO rename to external/libpng/Y2KINFO diff --git a/external/libpng/configure b/external/libpng/configure new file mode 100755 index 0000000..8f157db --- /dev/null +++ b/external/libpng/configure @@ -0,0 +1,13891 @@ +#! /bin/sh +# Guess values for system-dependent variables and create Makefiles. +# Generated by GNU Autoconf 2.65 for libpng 1.2.49. +# +# Report bugs to . +# +# +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, +# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +if test "x$CONFIG_SHELL" = x; then + as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which + # is contrary to our usage. Disable this feature. + alias -g '\${1+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST +else + case \`(set -o) 2>/dev/null\` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi +" + as_required="as_fn_return () { (exit \$1); } +as_fn_success () { as_fn_return 0; } +as_fn_failure () { as_fn_return 1; } +as_fn_ret_success () { return 0; } +as_fn_ret_failure () { return 1; } + +exitcode=0 +as_fn_success || { exitcode=1; echo as_fn_success failed.; } +as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } +as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } +as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } +if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : + +else + exitcode=1; echo positional parameters were not saved. +fi +test x\$exitcode = x0 || exit 1" + as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO + as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO + eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && + test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 +test \$(( 1 + 1 )) = 2 || exit 1" + if (eval "$as_required") 2>/dev/null; then : + as_have_required=yes +else + as_have_required=no +fi + if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : + +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + as_found=: + case $as_dir in #( + /*) + for as_base in sh bash ksh sh5; do + # Try only shells that exist, to save several forks. + as_shell=$as_dir/$as_base + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : + CONFIG_SHELL=$as_shell as_have_required=yes + if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : + break 2 +fi +fi + done;; + esac + as_found=false +done +$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : + CONFIG_SHELL=$SHELL as_have_required=yes +fi; } +IFS=$as_save_IFS + + + if test "x$CONFIG_SHELL" != x; then : + # We cannot yet assume a decent shell, so we have to provide a + # neutralization value for shells without unset; and this also + # works around shells that cannot unset nonexistent variables. + BASH_ENV=/dev/null + ENV=/dev/null + (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} +fi + + if test x$as_have_required = xno; then : + $as_echo "$0: This script requires a shell more modern than all" + $as_echo "$0: the shells that I found on your system." + if test x${ZSH_VERSION+set} = xset ; then + $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" + $as_echo "$0: be upgraded to zsh 4.3.4 or later." + else + $as_echo "$0: Please tell bug-autoconf@gnu.org and +$0: png-mng-implement@lists.sourceforge.net about your +$0: system, including any error possibly output before this +$0: message. Then install a modern shell, or manually run +$0: the script under such a shell if you do have one." + fi + exit 1 +fi +fi +fi +SHELL=${CONFIG_SHELL-/bin/sh} +export SHELL +# Unset more variables known to interfere with behavior of common tools. +CLICOLOR_FORCE= GREP_OPTIONS= +unset CLICOLOR_FORCE GREP_OPTIONS + +## --------------------- ## +## M4sh Shell Functions. ## +## --------------------- ## +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error "cannot create directory $as_dir" + + +} # as_fn_mkdir_p +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +# as_fn_error ERROR [LINENO LOG_FD] +# --------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with status $?, using 1 if that was 0. +as_fn_error () +{ + as_status=$?; test $as_status -eq 0 && as_status=1 + if test "$3"; then + as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3 + fi + $as_echo "$as_me: error: $1" >&2 + as_fn_exit $as_status +} # as_fn_error + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + + + as_lineno_1=$LINENO as_lineno_1a=$LINENO + as_lineno_2=$LINENO as_lineno_2a=$LINENO + eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && + test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { + # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | + sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno + N + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\n.*// + ' >$as_me.lineno && + chmod +x "$as_me.lineno" || + { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -p' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -p' + fi +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +if test -x / >/dev/null 2>&1; then + as_test_x='test -x' +else + if ls -dL / >/dev/null 2>&1; then + as_ls_L_option=L + else + as_ls_L_option= + fi + as_test_x=' + eval sh -c '\'' + if test -d "$1"; then + test -d "$1/."; + else + case $1 in #( + -*)set "./$1";; + esac; + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( + ???[sx]*):;;*)false;;esac;fi + '\'' sh + ' +fi +as_executable_p=$as_test_x + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + + +# Check that we are running under the correct shell. +SHELL=${CONFIG_SHELL-/bin/sh} + +case X$lt_ECHO in +X*--fallback-echo) + # Remove one level of quotation (which was required for Make). + ECHO=`echo "$lt_ECHO" | sed 's,\\\\\$\\$0,'$0','` + ;; +esac + +ECHO=${lt_ECHO-echo} +if test "X$1" = X--no-reexec; then + # Discard the --no-reexec flag, and continue. + shift +elif test "X$1" = X--fallback-echo; then + # Avoid inline document here, it may be left over + : +elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' ; then + # Yippee, $ECHO works! + : +else + # Restart under the correct shell. + exec $SHELL "$0" --no-reexec ${1+"$@"} +fi + +if test "X$1" = X--fallback-echo; then + # used as fallback echo + shift + cat <<_LT_EOF +$* +_LT_EOF + exit 0 +fi + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +if test -z "$lt_ECHO"; then + if test "X${echo_test_string+set}" != Xset; then + # find a string as large as possible, as long as the shell can cope with it + for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do + # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... + if { echo_test_string=`eval $cmd`; } 2>/dev/null && + { test "X$echo_test_string" = "X$echo_test_string"; } 2>/dev/null + then + break + fi + done + fi + + if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && + echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + : + else + # The Solaris, AIX, and Digital Unix default echo programs unquote + # backslashes. This makes it impossible to quote backslashes using + # echo "$something" | sed 's/\\/\\\\/g' + # + # So, first we look for a working echo in the user's PATH. + + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for dir in $PATH /usr/ucb; do + IFS="$lt_save_ifs" + if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && + test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + ECHO="$dir/echo" + break + fi + done + IFS="$lt_save_ifs" + + if test "X$ECHO" = Xecho; then + # We didn't find a better echo, so look for alternatives. + if test "X`{ print -r '\t'; } 2>/dev/null`" = 'X\t' && + echo_testing_string=`{ print -r "$echo_test_string"; } 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # This shell has a builtin print -r that does the trick. + ECHO='print -r' + elif { test -f /bin/ksh || test -f /bin/ksh$ac_exeext; } && + test "X$CONFIG_SHELL" != X/bin/ksh; then + # If we have ksh, try running configure again with it. + ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} + export ORIGINAL_CONFIG_SHELL + CONFIG_SHELL=/bin/ksh + export CONFIG_SHELL + exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"} + else + # Try using printf. + ECHO='printf %s\n' + if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && + echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # Cool, printf works + : + elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL + export CONFIG_SHELL + SHELL="$CONFIG_SHELL" + export SHELL + ECHO="$CONFIG_SHELL $0 --fallback-echo" + elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + ECHO="$CONFIG_SHELL $0 --fallback-echo" + else + # maybe with a smaller string... + prev=: + + for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do + if { test "X$echo_test_string" = "X`eval $cmd`"; } 2>/dev/null + then + break + fi + prev="$cmd" + done + + if test "$prev" != 'sed 50q "$0"'; then + echo_test_string=`eval $prev` + export echo_test_string + exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"} + else + # Oops. We lost completely, so just stick with echo. + ECHO=echo + fi + fi + fi + fi + fi +fi + +# Copy echo and quote the copy suitably for passing to libtool from +# the Makefile, instead of quoting the original, which is used later. +lt_ECHO=$ECHO +if test "X$lt_ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then + lt_ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo" +fi + + + + +test -n "$DJDIR" || exec 7<&0 &1 + +# Name of the host. +# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +# +# Initializations. +# +ac_default_prefix=/usr/local +ac_clean_files= +ac_config_libobj_dir=. +LIBOBJS= +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= + +# Identity of this package. +PACKAGE_NAME='libpng' +PACKAGE_TARNAME='libpng' +PACKAGE_VERSION='1.2.49' +PACKAGE_STRING='libpng 1.2.49' +PACKAGE_BUGREPORT='png-mng-implement@lists.sourceforge.net' +PACKAGE_URL='' + +ac_unique_file="pngget.c" +# Factoring default headers for most tests. +ac_includes_default="\ +#include +#ifdef HAVE_SYS_TYPES_H +# include +#endif +#ifdef HAVE_SYS_STAT_H +# include +#endif +#ifdef STDC_HEADERS +# include +# include +#else +# ifdef HAVE_STDLIB_H +# include +# endif +#endif +#ifdef HAVE_STRING_H +# if !defined STDC_HEADERS && defined HAVE_MEMORY_H +# include +# endif +# include +#endif +#ifdef HAVE_STRINGS_H +# include +#endif +#ifdef HAVE_INTTYPES_H +# include +#endif +#ifdef HAVE_STDINT_H +# include +#endif +#ifdef HAVE_UNISTD_H +# include +#endif" + +ac_subst_vars='am__EXEEXT_FALSE +am__EXEEXT_TRUE +LTLIBOBJS +compatlib +binconfigs +pkgconfigdir +PNGLIB_RELEASE +PNGLIB_MINOR +PNGLIB_MAJOR +PNGLIB_VERSION +SYMBOL_PREFIX +HAVE_LD_VERSION_SCRIPT_FALSE +HAVE_LD_VERSION_SCRIPT_TRUE +LIBPNG_NO_MMX +LIBPNG_DEFINES +LIBOBJS +POW_LIB +OTOOL64 +OTOOL +LIPO +NMEDIT +DSYMUTIL +lt_ECHO +RANLIB +AR +NM +ac_ct_DUMPBIN +DUMPBIN +LIBTOOL +LN_S +OBJDUMP +DLLTOOL +AS +CPP +LD +FGREP +EGREP +GREP +SED +host_os +host_vendor +host_cpu +host +build_os +build_vendor +build_cpu +build +am__fastdepCC_FALSE +am__fastdepCC_TRUE +CCDEPMODE +AMDEPBACKSLASH +AMDEP_FALSE +AMDEP_TRUE +am__quote +am__include +DEPDIR +OBJEXT +EXEEXT +ac_ct_CC +CPPFLAGS +LDFLAGS +CFLAGS +CC +MAINT +MAINTAINER_MODE_FALSE +MAINTAINER_MODE_TRUE +am__untar +am__tar +AMTAR +am__leading_dot +SET_MAKE +AWK +mkdir_p +MKDIR_P +INSTALL_STRIP_PROGRAM +STRIP +install_sh +MAKEINFO +AUTOHEADER +AUTOMAKE +AUTOCONF +ACLOCAL +VERSION +PACKAGE +CYGPATH_W +am__isrc +INSTALL_DATA +INSTALL_SCRIPT +INSTALL_PROGRAM +target_alias +host_alias +build_alias +LIBS +ECHO_T +ECHO_N +ECHO_C +DEFS +mandir +localedir +libdir +psdir +pdfdir +dvidir +htmldir +infodir +docdir +oldincludedir +includedir +localstatedir +sharedstatedir +sysconfdir +datadir +datarootdir +libexecdir +sbindir +bindir +program_transform_name +prefix +exec_prefix +PACKAGE_URL +PACKAGE_BUGREPORT +PACKAGE_STRING +PACKAGE_VERSION +PACKAGE_TARNAME +PACKAGE_NAME +PATH_SEPARATOR +SHELL' +ac_subst_files='' +ac_user_opts=' +enable_option_checking +enable_maintainer_mode +enable_dependency_tracking +with_gnu_ld +enable_shared +enable_static +with_pic +enable_fast_install +enable_libtool_lock +with_pkgconfigdir +with_binconfigs +with_libpng_compat +' + ac_precious_vars='build_alias +host_alias +target_alias +CC +CFLAGS +LDFLAGS +LIBS +CPPFLAGS +CPP' + + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +ac_unrecognized_opts= +ac_unrecognized_sep= +# The variables have the same names as the options, with +# dashes changed to underlines. +cache_file=/dev/null +exec_prefix=NONE +no_create= +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +verbose= +x_includes=NONE +x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. +# (The list follows the same order as the GNU Coding Standards.) +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datarootdir='${prefix}/share' +datadir='${datarootdir}' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +includedir='${prefix}/include' +oldincludedir='/usr/include' +docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' +infodir='${datarootdir}/info' +htmldir='${docdir}' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}/lib' +localedir='${datarootdir}/locale' +mandir='${datarootdir}/man' + +ac_prev= +ac_dashdash= +for ac_option +do + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval $ac_prev=\$ac_option + ac_prev= + continue + fi + + case $ac_option in + *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *) ac_optarg=yes ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir=$ac_optarg ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build_alias ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build_alias=$ac_optarg ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; + + -datadir | --datadir | --datadi | --datad) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=*) + datadir=$ac_optarg ;; + + -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ + | --dataroo | --dataro | --datar) + ac_prev=datarootdir ;; + -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ + | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) + datarootdir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=no ;; + + -docdir | --docdir | --docdi | --doc | --do) + ac_prev=docdir ;; + -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) + docdir=$ac_optarg ;; + + -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) + ac_prev=dvidir ;; + -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) + dvidir=$ac_optarg ;; + + -enable-* | --enable-*) + ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=\$ac_optarg ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix=$ac_optarg ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; + + -host | --host | --hos | --ho) + ac_prev=host_alias ;; + -host=* | --host=* | --hos=* | --ho=*) + host_alias=$ac_optarg ;; + + -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) + ac_prev=htmldir ;; + -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ + | --ht=*) + htmldir=$ac_optarg ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir=$ac_optarg ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir=$ac_optarg ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir=$ac_optarg ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir=$ac_optarg ;; + + -localedir | --localedir | --localedi | --localed | --locale) + ac_prev=localedir ;; + -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) + localedir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst | --locals) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) + localstatedir=$ac_optarg ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir=$ac_optarg ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c | -n) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir=$ac_optarg ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix=$ac_optarg ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix=$ac_optarg ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix=$ac_optarg ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name=$ac_optarg ;; + + -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) + ac_prev=pdfdir ;; + -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) + pdfdir=$ac_optarg ;; + + -psdir | --psdir | --psdi | --psd | --ps) + ac_prev=psdir ;; + -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) + psdir=$ac_optarg ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir=$ac_optarg ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir=$ac_optarg ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site=$ac_optarg ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir=$ac_optarg ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir=$ac_optarg ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target_alias ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target_alias=$ac_optarg ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; + + -with-* | --with-*) + ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=\$ac_optarg ;; + + -without-* | --without-*) + ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=no ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes=$ac_optarg ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries=$ac_optarg ;; + + -*) as_fn_error "unrecognized option: \`$ac_option' +Try \`$0 --help' for more information." + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + case $ac_envvar in #( + '' | [0-9]* | *[!_$as_cr_alnum]* ) + as_fn_error "invalid variable name: \`$ac_envvar'" ;; + esac + eval $ac_envvar=\$ac_optarg + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} + ;; + + esac +done + +if test -n "$ac_prev"; then + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + as_fn_error "missing argument to $ac_option" +fi + +if test -n "$ac_unrecognized_opts"; then + case $enable_option_checking in + no) ;; + fatal) as_fn_error "unrecognized options: $ac_unrecognized_opts" ;; + *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + esac +fi + +# Check all directory arguments for consistency. +for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ + datadir sysconfdir sharedstatedir localstatedir includedir \ + oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ + libdir localedir mandir +do + eval ac_val=\$$ac_var + # Remove trailing slashes. + case $ac_val in + */ ) + ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` + eval $ac_var=\$ac_val;; + esac + # Be sure to have absolute directory names. + case $ac_val in + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; + esac + as_fn_error "expected an absolute directory name for --$ac_var: $ac_val" +done + +# There might be people who depend on the old broken behavior: `$host' +# used to hold the argument of --host etc. +# FIXME: To remove some day. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: To remove some day. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + $as_echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. + If a cross compiler is detected then cross compile mode will be used." >&2 + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi + +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +test "$silent" = yes && exec 6>/dev/null + + +ac_pwd=`pwd` && test -n "$ac_pwd" && +ac_ls_di=`ls -di .` && +ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || + as_fn_error "working directory cannot be determined" +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + as_fn_error "pwd does not report name of working directory" + + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then the parent directory. + ac_confdir=`$as_dirname -- "$as_myself" || +$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_myself" : 'X\(//\)[^/]' \| \ + X"$as_myself" : 'X\(//\)$' \| \ + X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_myself" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + srcdir=$ac_confdir + if test ! -r "$srcdir/$ac_unique_file"; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r "$srcdir/$ac_unique_file"; then + test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." + as_fn_error "cannot find sources ($ac_unique_file) in $srcdir" +fi +ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_abs_confdir=`( + cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error "$ac_msg" + pwd)` +# When building in place, set srcdir=. +if test "$ac_abs_confdir" = "$ac_pwd"; then + srcdir=. +fi +# Remove unnecessary trailing slashes from srcdir. +# Double slashes in file names in object file debugging info +# mess up M-x gdb in Emacs. +case $srcdir in +*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; +esac +for ac_var in $ac_precious_vars; do + eval ac_env_${ac_var}_set=\${${ac_var}+set} + eval ac_env_${ac_var}_value=\$${ac_var} + eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} + eval ac_cv_env_${ac_var}_value=\$${ac_var} +done + +# +# Report the --help message. +# +if test "$ac_init_help" = "long"; then + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat <<_ACEOF +\`configure' configures libpng 1.2.49 to adapt to many kinds of systems. + +Usage: $0 [OPTION]... [VAR=VALUE]... + +To assign environment variables (e.g., CC, CFLAGS...), specify them as +VAR=VALUE. See below for descriptions of some of the useful variables. + +Defaults for the options are specified in brackets. + +Configuration: + -h, --help display this help and exit + --help=short display options specific to this package + --help=recursive display the short help of all the included packages + -V, --version display version information and exit + -q, --quiet, --silent do not print \`checking...' messages + --cache-file=FILE cache test results in FILE [disabled] + -C, --config-cache alias for \`--cache-file=config.cache' + -n, --no-create do not create output files + --srcdir=DIR find the sources in DIR [configure dir or \`..'] + +Installation directories: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [PREFIX] + +By default, \`make install' will install all the files in +\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify +an installation prefix other than \`$ac_default_prefix' using \`--prefix', +for instance \`--prefix=\$HOME'. + +For better control, use the options below. + +Fine tuning of the installation directories: + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root [DATAROOTDIR/doc/libpng] + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] +_ACEOF + + cat <<\_ACEOF + +Program names: + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM run sed PROGRAM on installed program names + +System types: + --build=BUILD configure for building on BUILD [guessed] + --host=HOST cross-compile to build programs to run on HOST [BUILD] +_ACEOF +fi + +if test -n "$ac_init_help"; then + case $ac_init_help in + short | recursive ) echo "Configuration of libpng 1.2.49:";; + esac + cat <<\_ACEOF + +Optional Features: + --disable-option-checking ignore unrecognized --enable/--with options + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --enable-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer + --disable-dependency-tracking speeds up one-time build + --enable-dependency-tracking do not reject slow dependency extractors + --enable-shared[=PKGS] build shared libraries [default=yes] + --enable-static[=PKGS] build static libraries [default=yes] + --enable-fast-install[=PKGS] + optimize for fast installation [default=yes] + --disable-libtool-lock avoid locking (might break parallel builds) + +Optional Packages: + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --with-gnu-ld assume the C compiler uses GNU ld [default=no] + --with-pic try to use only PIC/non-PIC objects [default=use + both] + --with-pkgconfigdir Use the specified pkgconfig dir (default is + libdir/pkgconfig) + --with-binconfigs Generate shell libpng-config scripts as well as + pkg-config data [default=yes] + --with-libpng-compat Generate the obsolete libpng.so library + [default=yes] + +Some influential environment variables: + CC C compiler command + CFLAGS C compiler flags + LDFLAGS linker flags, e.g. -L if you have libraries in a + nonstandard directory + LIBS libraries to pass to the linker, e.g. -l + CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if + you have headers in a nonstandard directory + CPP C preprocessor + +Use these variables to override the choices made by `configure' or to help +it to find libraries and programs with nonstandard names/locations. + +Report bugs to . +_ACEOF +ac_status=$? +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d "$ac_dir" || + { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || + continue + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + cd "$ac_dir" || { ac_status=$?; continue; } + # Check for guested configure. + if test -f "$ac_srcdir/configure.gnu"; then + echo && + $SHELL "$ac_srcdir/configure.gnu" --help=recursive + elif test -f "$ac_srcdir/configure"; then + echo && + $SHELL "$ac_srcdir/configure" --help=recursive + else + $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi || ac_status=$? + cd "$ac_pwd" || { ac_status=$?; break; } + done +fi + +test -n "$ac_init_help" && exit $ac_status +if $ac_init_version; then + cat <<\_ACEOF +libpng configure 1.2.49 +generated by GNU Autoconf 2.65 + +Copyright (C) 2009 Free Software Foundation, Inc. +This configure script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it. +_ACEOF + exit +fi + +## ------------------------ ## +## Autoconf initialization. ## +## ------------------------ ## + +# ac_fn_c_try_compile LINENO +# -------------------------- +# Try to compile conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext + if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + as_fn_set_status $ac_retval + +} # ac_fn_c_try_compile + +# ac_fn_c_try_cpp LINENO +# ---------------------- +# Try to preprocess conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_cpp () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + as_fn_set_status $ac_retval + +} # ac_fn_c_try_cpp + +# ac_fn_c_try_link LINENO +# ----------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_link () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest$ac_exeext + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information + # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would + # interfere with the next link command; also delete a directory that is + # left behind by Apple's compiler. We do this before executing the actions. + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + as_fn_set_status $ac_retval + +} # ac_fn_c_try_link + +# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists and can be compiled using the include files in +# INCLUDES, setting the cache variable VAR accordingly. +ac_fn_c_check_header_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + +} # ac_fn_c_check_header_compile + +# ac_fn_c_try_run LINENO +# ---------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes +# that executables *can* be run. +ac_fn_c_try_run () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then : + ac_retval=0 +else + $as_echo "$as_me: program exited with status $ac_status" >&5 + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=$ac_status +fi + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + as_fn_set_status $ac_retval + +} # ac_fn_c_try_run + +# ac_fn_c_check_func LINENO FUNC VAR +# ---------------------------------- +# Tests whether FUNC exists, setting the cache variable VAR accordingly +ac_fn_c_check_func () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Define $2 to an innocuous variant, in case declares $2. + For example, HP-UX 11i declares gettimeofday. */ +#define $2 innocuous_$2 + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $2 (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $2 + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $2 (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$2 || defined __stub___$2 +choke me +#endif + +int +main () +{ +return $2 (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + +} # ac_fn_c_check_func + +# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists, giving a warning if it cannot be compiled using +# the include files in INCLUDES and setting the cache variable VAR +# accordingly. +ac_fn_c_check_header_mongrel () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : + $as_echo_n "(cached) " >&6 +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 +$as_echo_n "checking $2 usability... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_header_compiler=yes +else + ac_header_compiler=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 +$as_echo_n "checking $2 presence... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <$2> +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + ac_header_preproc=yes +else + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( + yes:no: ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} + ;; + no:yes:* ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} +( cat <<\_ASBOX +## ------------------------------------------------------ ## +## Report this to png-mng-implement@lists.sourceforge.net ## +## ------------------------------------------------------ ## +_ASBOX + ) | sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=\$ac_header_compiler" +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +fi + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + +} # ac_fn_c_check_header_mongrel + +# ac_fn_c_check_type LINENO TYPE VAR INCLUDES +# ------------------------------------------- +# Tests whether TYPE exists after having included INCLUDES, setting cache +# variable VAR accordingly. +ac_fn_c_check_type () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=no" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +if (sizeof ($2)) + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +if (sizeof (($2))) + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + eval "$3=yes" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + +} # ac_fn_c_check_type +cat >config.log <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by libpng $as_me 1.2.49, which was +generated by GNU Autoconf 2.65. Invocation command line was + + $ $0 $@ + +_ACEOF +exec 5>>config.log +{ +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## + +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +_ASUNAME + +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + $as_echo "PATH: $as_dir" + done +IFS=$as_save_IFS + +} >&5 + +cat >&5 <<_ACEOF + + +## ----------- ## +## Core tests. ## +## ----------- ## + +_ACEOF + + +# Keep a trace of the command line. +# Strip out --no-create and --no-recursion so they do not pile up. +# Strip out --silent because we don't want to record it for future runs. +# Also quote any args containing shell meta-characters. +# Make two passes to allow for proper duplicate-argument suppression. +ac_configure_args= +ac_configure_args0= +ac_configure_args1= +ac_must_keep_next=false +for ac_pass in 1 2 +do + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + continue ;; + *\'*) + ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; + 2) + as_fn_append ac_configure_args1 " '$ac_arg'" + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac + fi + as_fn_append ac_configure_args " '$ac_arg'" + ;; + esac + done +done +{ ac_configure_args0=; unset ac_configure_args0;} +{ ac_configure_args1=; unset ac_configure_args1;} + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +# WARNING: Use '\'' to represent an apostrophe within the trap. +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + { + echo + + cat <<\_ASBOX +## ---------------- ## +## Cache variables. ## +## ---------------- ## +_ASBOX + echo + # The following way of writing the cache mishandles newlines in values, +( + for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + (set) 2>&1 | + case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + sed -n \ + "s/'\''/'\''\\\\'\'''\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + ;; #( + *) + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) + echo + + cat <<\_ASBOX +## ----------------- ## +## Output variables. ## +## ----------------- ## +_ASBOX + echo + for ac_var in $ac_subst_vars + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + + if test -n "$ac_subst_files"; then + cat <<\_ASBOX +## ------------------- ## +## File substitutions. ## +## ------------------- ## +_ASBOX + echo + for ac_var in $ac_subst_files + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + fi + + if test -s confdefs.h; then + cat <<\_ASBOX +## ----------- ## +## confdefs.h. ## +## ----------- ## +_ASBOX + echo + cat confdefs.h + echo + fi + test "$ac_signal" != 0 && + $as_echo "$as_me: caught signal $ac_signal" + $as_echo "$as_me: exit $exit_status" + } >&5 + rm -f core *.core core.conftest.* && + rm -f -r conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status +' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -f -r conftest* confdefs.h + +$as_echo "/* confdefs.h */" > confdefs.h + +# Predefined preprocessor variables. + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_NAME "$PACKAGE_NAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_TARNAME "$PACKAGE_TARNAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_VERSION "$PACKAGE_VERSION" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_STRING "$PACKAGE_STRING" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_URL "$PACKAGE_URL" +_ACEOF + + +# Let the site file select an alternate cache file if it wants to. +# Prefer an explicitly selected file to automatically selected ones. +ac_site_file1=NONE +ac_site_file2=NONE +if test -n "$CONFIG_SITE"; then + ac_site_file1=$CONFIG_SITE +elif test "x$prefix" != xNONE; then + ac_site_file1=$prefix/share/config.site + ac_site_file2=$prefix/etc/config.site +else + ac_site_file1=$ac_default_prefix/share/config.site + ac_site_file2=$ac_default_prefix/etc/config.site +fi +for ac_site_file in "$ac_site_file1" "$ac_site_file2" +do + test "x$ac_site_file" = xNONE && continue + if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 +$as_echo "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" + fi +done + +if test -r "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special files + # actually), so we avoid doing that. DJGPP emulates it as a regular file. + if test /dev/null != "$cache_file" && test -f "$cache_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 +$as_echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; + esac + fi +else + { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 +$as_echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in $ac_precious_vars; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value + case $ac_old_set,$ac_new_set in + set,) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + # differences in whitespace do not lead to failure. + ac_old_val_w=`echo x $ac_old_val` + ac_new_val_w=`echo x $ac_new_val` + if test "$ac_old_val_w" != "$ac_new_val_w"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 +$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else + { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 +$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 +$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) as_fn_append ac_configure_args " '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 +$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} + as_fn_error "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 +fi +## -------------------- ## +## Main body of script. ## +## -------------------- ## + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +am__api_version='1.11' + +ac_aux_dir= +for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do + for ac_t in install-sh install.sh shtool; do + if test -f "$ac_dir/$ac_t"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/$ac_t -c" + break 2 + fi + done +done +if test -z "$ac_aux_dir"; then + as_fn_error "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 +fi + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. +ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. +ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. + + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# OS/2's system install, which has a completely different semantic +# ./install, which can be erroneously created by make from ./install.sh. +# Reject install programs that cannot install multiple files. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 +$as_echo_n "checking for a BSD-compatible install... " >&6; } +if test -z "$INSTALL"; then +if test "${ac_cv_path_install+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + # Account for people who put trailing slashes in PATH elements. +case $as_dir/ in #(( + ./ | .// | /[cC]/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then + if test $ac_prog = install && + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + rm -rf conftest.one conftest.two conftest.dir + echo one > conftest.one + echo two > conftest.two + mkdir conftest.dir + if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && + test -s conftest.one && test -s conftest.two && + test -s conftest.dir/conftest.one && + test -s conftest.dir/conftest.two + then + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + fi + done + done + ;; +esac + + done +IFS=$as_save_IFS + +rm -rf conftest.one conftest.two conftest.dir + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL=$ac_cv_path_install + else + # As a last resort, use the slow shell script. Don't cache a + # value for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + INSTALL=$ac_install_sh + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 +$as_echo "$INSTALL" >&6; } + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 +$as_echo_n "checking whether build environment is sane... " >&6; } +# Just in case +sleep 1 +echo timestamp > conftest.file +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[\\\"\#\$\&\'\`$am_lf]*) + as_fn_error "unsafe absolute working directory name" "$LINENO" 5;; +esac +case $srcdir in + *[\\\"\#\$\&\'\`$am_lf\ \ ]*) + as_fn_error "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;; +esac + +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + rm -f conftest.file + if test "$*" != "X $srcdir/configure conftest.file" \ + && test "$*" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + as_fn_error "ls -t appears to fail. Make sure there is not a broken +alias in your environment" "$LINENO" 5 + fi + + test "$2" = conftest.file + ) +then + # Ok. + : +else + as_fn_error "newly created file is older than distributed files! +Check your system clock" "$LINENO" 5 +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +test "$program_prefix" != NONE && + program_transform_name="s&^&$program_prefix&;$program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s&\$&$program_suffix&;$program_transform_name" +# Double any \ or $. +# By default was `s,x,x', remove it if useless. +ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' +program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` + +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` + +if test x"${MISSING+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; + *) + MISSING="\${SHELL} $am_aux_dir/missing" ;; + esac +fi +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " +else + am_missing_run= + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5 +$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} +fi + +if test x"${install_sh}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi + +# Installed binaries are usually stripped using `strip' when the user +# run `make install-strip'. However `strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the `STRIP' environment variable to overrule this program. +if test "$cross_compiling" != no; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_STRIP+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +$as_echo "$STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_STRIP="strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +$as_echo "$ac_ct_STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi +else + STRIP="$ac_cv_prog_STRIP" +fi + +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 +$as_echo_n "checking for a thread-safe mkdir -p... " >&6; } +if test -z "$MKDIR_P"; then + if test "${ac_cv_path_mkdir+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in mkdir gmkdir; do + for ac_exec_ext in '' $ac_executable_extensions; do + { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue + case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( + 'mkdir (GNU coreutils) '* | \ + 'mkdir (coreutils) '* | \ + 'mkdir (fileutils) '4.1*) + ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext + break 3;; + esac + done + done + done +IFS=$as_save_IFS + +fi + + test -d ./--version && rmdir ./--version + if test "${ac_cv_path_mkdir+set}" = set; then + MKDIR_P="$ac_cv_path_mkdir -p" + else + # As a last resort, use the slow shell script. Don't cache a + # value for MKDIR_P within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + MKDIR_P="$ac_install_sh -d" + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 +$as_echo "$MKDIR_P" >&6; } + +mkdir_p="$MKDIR_P" +case $mkdir_p in + [\\/$]* | ?:[\\/]*) ;; + */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; +esac + +for ac_prog in gawk mawk nawk awk +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_AWK+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AWK"; then + ac_cv_prog_AWK="$AWK" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_AWK="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 +$as_echo "$AWK" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$AWK" && break +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } +set x ${MAKE-make} +ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then : + $as_echo_n "(cached) " >&6 +else + cat >conftest.make <<\_ACEOF +SHELL = /bin/sh +all: + @echo '@@@%%%=$(MAKE)=@@@%%%' +_ACEOF +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac +rm -f conftest.make +fi +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + SET_MAKE= +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + SET_MAKE="MAKE=${MAKE-make}" +fi + +rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null + +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + am__isrc=' -I$(srcdir)' + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + as_fn_error "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 + fi +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi + + +# Define the identity of the package. + PACKAGE='libpng' + VERSION='1.2.49' + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE "$PACKAGE" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define VERSION "$VERSION" +_ACEOF + +# Some tools Automake needs. + +ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} + + +AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} + + +AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} + + +AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} + + +MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} + +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. +# Always define AMTAR for backward compatibility. + +AMTAR=${AMTAR-"${am_missing_run}tar"} + +am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5 +$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; } + # Check whether --enable-maintainer-mode was given. +if test "${enable_maintainer_mode+set}" = set; then : + enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval +else + USE_MAINTAINER_MODE=no +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5 +$as_echo "$USE_MAINTAINER_MODE" >&6; } + if test $USE_MAINTAINER_MODE = yes; then + MAINTAINER_MODE_TRUE= + MAINTAINER_MODE_FALSE='#' +else + MAINTAINER_MODE_TRUE='#' + MAINTAINER_MODE_FALSE= +fi + + MAINT=$MAINTAINER_MODE_TRUE + + + +PNGLIB_VERSION=1.2.49 +PNGLIB_MAJOR=1 +PNGLIB_MINOR=2 +PNGLIB_RELEASE=49 + + + +ac_config_headers="$ac_config_headers config.h" + + +# Checks for programs. +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CC+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_CC="gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CC+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + fi +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CC+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl.exe + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CC+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl.exe +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_CC="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_CC" && break +done + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi + +fi + + +test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error "no acceptable C compiler found in \$PATH +See \`config.log' for more details." "$LINENO" 5; } + +# Provide some information about the compiler. +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" +# Try to create an executable without -o first, disregard a.out. +# It will help us diagnose broken compilers, and finding out an intuition +# of exeext. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 +$as_echo_n "checking whether the C compiler works... " >&6; } +ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` + +# The possible output files: +ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" + +ac_rmfiles= +for ac_file in $ac_files +do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + * ) ac_rmfiles="$ac_rmfiles $ac_file";; + esac +done +rm -f $ac_rmfiles + +if { { ac_try="$ac_link_default" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link_default") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. +# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' +# in a Makefile. We should not override ac_cv_exeext if it was cached, +# so that the user can short-circuit this test for compilers unknown to +# Autoconf. +for ac_file in $ac_files '' +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + then :; else + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + fi + # We set ac_cv_exeext here because the later test for it is not + # safe: cross compilers may not add the suffix if given an `-o' + # argument, so we may need to know it at that point already. + # Even if this section looks crufty: it has the advantage of + # actually working. + break;; + * ) + break;; + esac +done +test "$ac_cv_exeext" = no && ac_cv_exeext= + +else + ac_file='' +fi +if test -z "$ac_file"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +$as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ as_fn_set_status 77 +as_fn_error "C compiler cannot create executables +See \`config.log' for more details." "$LINENO" 5; }; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 +$as_echo_n "checking for C compiler default output file name... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 +$as_echo "$ac_file" >&6; } +ac_exeext=$ac_cv_exeext + +rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 +$as_echo_n "checking for suffix of executables... " >&6; } +if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + # If both `conftest.exe' and `conftest' are `present' (well, observable) +# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will +# work properly (i.e., refer to `conftest.exe'), while it won't with +# `rm'. +for ac_file in conftest.exe conftest conftest.*; do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + break;; + * ) break;; + esac +done +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error "cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details." "$LINENO" 5; } +fi +rm -f conftest conftest$ac_cv_exeext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 +$as_echo "$ac_cv_exeext" >&6; } + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +FILE *f = fopen ("conftest.out", "w"); + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +ac_clean_files="$ac_clean_files conftest.out" +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 +$as_echo_n "checking whether we are cross compiling... " >&6; } +if test "$cross_compiling" != yes; then + { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if { ac_try='./conftest$ac_cv_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error "cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details." "$LINENO" 5; } + fi + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 +$as_echo "$cross_compiling" >&6; } + +rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 +$as_echo_n "checking for suffix of object files... " >&6; } +if test "${ac_cv_objext+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + for ac_file in conftest.o conftest.obj conftest.*; do + test -f "$ac_file" || continue; + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error "cannot compute suffix of object files: cannot compile +See \`config.log' for more details." "$LINENO" 5; } +fi +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 +$as_echo "$ac_cv_objext" >&6; } +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 +$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } +if test "${ac_cv_c_compiler_gnu+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_compiler_gnu=yes +else + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +$as_echo "$ac_cv_c_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GCC=yes +else + GCC= +fi +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +$as_echo_n "checking whether $CC accepts -g... " >&6; } +if test "${ac_cv_prog_cc_g+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +else + CFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +$as_echo "$ac_cv_prog_cc_g" >&6; } +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 +$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } +if test "${ac_cv_prog_cc_c89+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_c89=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; + xno) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; +esac +if test "x$ac_cv_prog_cc_c89" != xno; then : + +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +DEPDIR="${am__leading_dot}deps" + +ac_config_commands="$ac_config_commands depfiles" + + +am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo this is the am__doit target +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 +$as_echo_n "checking for style of include used by $am_make... " >&6; } +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# Ignore all kinds of additional output from `make'. +case `$am_make -s -f confmf 2> /dev/null` in #( +*the\ am__doit\ target*) + am__include=include + am__quote= + _am_result=GNU + ;; +esac +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + case `$am_make -s -f confmf 2> /dev/null` in #( + *the\ am__doit\ target*) + am__include=.include + am__quote="\"" + _am_result=BSD + ;; + esac +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 +$as_echo "$_am_result" >&6; } +rm -f confinc confmf + +# Check whether --enable-dependency-tracking was given. +if test "${enable_dependency_tracking+set}" = set; then : + enableval=$enable_dependency_tracking; +fi + +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' +fi + if test "x$enable_dependency_tracking" != xno; then + AMDEP_TRUE= + AMDEP_FALSE='#' +else + AMDEP_TRUE='#' + AMDEP_FALSE= +fi + + + +depcc="$CC" am_compiler_list= + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +$as_echo_n "checking dependency style of $depcc... " >&6; } +if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CC_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + am__universal=false + case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvisualcpp | msvcmsys) + # This compiler won't grok `-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CC_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CC_dependencies_compiler_type=none +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 +$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } +CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type + + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then + am__fastdepCC_TRUE= + am__fastdepCC_FALSE='#' +else + am__fastdepCC_TRUE='#' + am__fastdepCC_FALSE= +fi + + +# Make sure we can run config.sub. +$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || + as_fn_error "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 +$as_echo_n "checking build system type... " >&6; } +if test "${ac_cv_build+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_build_alias=$build_alias +test "x$ac_build_alias" = x && + ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` +test "x$ac_build_alias" = x && + as_fn_error "cannot guess build type; you must specify one" "$LINENO" 5 +ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || + as_fn_error "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 +$as_echo "$ac_cv_build" >&6; } +case $ac_cv_build in +*-*-*) ;; +*) as_fn_error "invalid value of canonical build" "$LINENO" 5;; +esac +build=$ac_cv_build +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_build +shift +build_cpu=$1 +build_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +build_os=$* +IFS=$ac_save_IFS +case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 +$as_echo_n "checking host system type... " >&6; } +if test "${ac_cv_host+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test "x$host_alias" = x; then + ac_cv_host=$ac_cv_build +else + ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || + as_fn_error "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 +$as_echo "$ac_cv_host" >&6; } +case $ac_cv_host in +*-*-*) ;; +*) as_fn_error "invalid value of canonical host" "$LINENO" 5;; +esac +host=$ac_cv_host +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_host +shift +host_cpu=$1 +host_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +host_os=$* +IFS=$ac_save_IFS +case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 +$as_echo_n "checking for a sed that does not truncate output... " >&6; } +if test "${ac_cv_path_SED+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ + for ac_i in 1 2 3 4 5 6 7; do + ac_script="$ac_script$as_nl$ac_script" + done + echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed + { ac_script=; unset ac_script;} + if test -z "$SED"; then + ac_path_SED_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in sed gsed; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue +# Check for GNU ac_path_SED and select it if it is found. + # Check for GNU $ac_path_SED +case `"$ac_path_SED" --version 2>&1` in +*GNU*) + ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo '' >> "conftest.nl" + "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_SED_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_SED="$ac_path_SED" + ac_path_SED_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_SED_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_SED"; then + as_fn_error "no acceptable sed could be found in \$PATH" "$LINENO" 5 + fi +else + ac_cv_path_SED=$SED +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 +$as_echo "$ac_cv_path_SED" >&6; } + SED="$ac_cv_path_SED" + rm -f conftest.sed + +test -z "$SED" && SED=sed +Xsed="$SED -e 1s/^X//" + + + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 +$as_echo_n "checking for grep that handles long lines and -e... " >&6; } +if test "${ac_cv_path_GREP+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$GREP"; then + ac_path_GREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in grep ggrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue +# Check for GNU ac_path_GREP and select it if it is found. + # Check for GNU $ac_path_GREP +case `"$ac_path_GREP" --version 2>&1` in +*GNU*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'GREP' >> "conftest.nl" + "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_GREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_GREP="$ac_path_GREP" + ac_path_GREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_GREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_GREP"; then + as_fn_error "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_GREP=$GREP +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 +$as_echo "$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 +$as_echo_n "checking for egrep... " >&6; } +if test "${ac_cv_path_EGREP+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + if test -z "$EGREP"; then + ac_path_EGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in egrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue +# Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_EGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_EGREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_EGREP"; then + as_fn_error "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_EGREP=$EGREP +fi + + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 +$as_echo "$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 +$as_echo_n "checking for fgrep... " >&6; } +if test "${ac_cv_path_FGREP+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 + then ac_cv_path_FGREP="$GREP -F" + else + if test -z "$FGREP"; then + ac_path_FGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in fgrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_FGREP" && $as_test_x "$ac_path_FGREP"; } || continue +# Check for GNU ac_path_FGREP and select it if it is found. + # Check for GNU $ac_path_FGREP +case `"$ac_path_FGREP" --version 2>&1` in +*GNU*) + ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'FGREP' >> "conftest.nl" + "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_FGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_FGREP="$ac_path_FGREP" + ac_path_FGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_FGREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_FGREP"; then + as_fn_error "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_FGREP=$FGREP +fi + + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 +$as_echo "$ac_cv_path_FGREP" >&6; } + FGREP="$ac_cv_path_FGREP" + + +test -z "$GREP" && GREP=grep + + + + + + + + + + + + + + + + + + + +# Check whether --with-gnu-ld was given. +if test "${with_gnu_ld+set}" = set; then : + withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes +else + with_gnu_ld=no +fi + +ac_prog=ld +if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 +$as_echo_n "checking for ld used by $CC... " >&6; } + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [\\/]* | ?:[\\/]*) + re_direlt='/[^/][^/]*/\.\./' + # Canonicalize the pathname of ld + ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` + while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do + ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 +$as_echo_n "checking for GNU ld... " >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 +$as_echo_n "checking for non-GNU ld... " >&6; } +fi +if test "${lt_cv_path_LD+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$LD"; then + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + lt_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some variants of GNU ld only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$lt_cv_path_LD" -v 2>&1 &5 +$as_echo "$LD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +test -z "$LD" && as_fn_error "no acceptable ld found in \$PATH" "$LINENO" 5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 +$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } +if test "${lt_cv_prog_gnu_ld+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + # I'd rather use --version here, but apparently some GNU lds only accept -v. +case `$LD -v 2>&1 &5 +$as_echo "$lt_cv_prog_gnu_ld" >&6; } +with_gnu_ld=$lt_cv_prog_gnu_ld + + + + + + + + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 +$as_echo_n "checking how to run the C preprocessor... " >&6; } +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then + if test "${ac_cv_prog_CPP+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + # Double quotes because CPP needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" + do + ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + break +fi + + done + ac_cv_prog_CPP=$CPP + +fi + CPP=$ac_cv_prog_CPP +else + ac_cv_prog_CPP=$CPP +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 +$as_echo "$CPP" >&6; } +ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error "C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details." "$LINENO" 5; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}sed", so it can be a program name with args. +set dummy ${ac_tool_prefix}sed; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_SED+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$SED"; then + ac_cv_prog_SED="$SED" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_SED="${ac_tool_prefix}sed" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +SED=$ac_cv_prog_SED +if test -n "$SED"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SED" >&5 +$as_echo "$SED" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_SED"; then + ac_ct_SED=$SED + # Extract the first word of "sed", so it can be a program name with args. +set dummy sed; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_SED+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_SED"; then + ac_cv_prog_ac_ct_SED="$ac_ct_SED" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_SED="sed" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_SED=$ac_cv_prog_ac_ct_SED +if test -n "$ac_ct_SED"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_SED" >&5 +$as_echo "$ac_ct_SED" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_SED" = x; then + SED=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + SED=$ac_ct_SED + fi +else + SED="$ac_cv_prog_SED" +fi + +enable_win32_dll=yes + +case $host in +*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-cegcc*) + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args. +set dummy ${ac_tool_prefix}as; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_AS+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AS"; then + ac_cv_prog_AS="$AS" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_AS="${ac_tool_prefix}as" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AS=$ac_cv_prog_AS +if test -n "$AS"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AS" >&5 +$as_echo "$AS" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_AS"; then + ac_ct_AS=$AS + # Extract the first word of "as", so it can be a program name with args. +set dummy as; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_AS+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_AS"; then + ac_cv_prog_ac_ct_AS="$ac_ct_AS" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_AS="as" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_AS=$ac_cv_prog_ac_ct_AS +if test -n "$ac_ct_AS"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AS" >&5 +$as_echo "$ac_ct_AS" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_AS" = x; then + AS="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + AS=$ac_ct_AS + fi +else + AS="$ac_cv_prog_AS" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. +set dummy ${ac_tool_prefix}dlltool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_DLLTOOL+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$DLLTOOL"; then + ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +DLLTOOL=$ac_cv_prog_DLLTOOL +if test -n "$DLLTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 +$as_echo "$DLLTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_DLLTOOL"; then + ac_ct_DLLTOOL=$DLLTOOL + # Extract the first word of "dlltool", so it can be a program name with args. +set dummy dlltool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_DLLTOOL+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_DLLTOOL"; then + ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_DLLTOOL="dlltool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL +if test -n "$ac_ct_DLLTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 +$as_echo "$ac_ct_DLLTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_DLLTOOL" = x; then + DLLTOOL="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DLLTOOL=$ac_ct_DLLTOOL + fi +else + DLLTOOL="$ac_cv_prog_DLLTOOL" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. +set dummy ${ac_tool_prefix}objdump; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_OBJDUMP+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OBJDUMP"; then + ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OBJDUMP=$ac_cv_prog_OBJDUMP +if test -n "$OBJDUMP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 +$as_echo "$OBJDUMP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OBJDUMP"; then + ac_ct_OBJDUMP=$OBJDUMP + # Extract the first word of "objdump", so it can be a program name with args. +set dummy objdump; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_OBJDUMP+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OBJDUMP"; then + ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_OBJDUMP="objdump" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP +if test -n "$ac_ct_OBJDUMP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 +$as_echo "$ac_ct_OBJDUMP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_OBJDUMP" = x; then + OBJDUMP="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OBJDUMP=$ac_ct_OBJDUMP + fi +else + OBJDUMP="$ac_cv_prog_OBJDUMP" +fi + + ;; +esac + +test -z "$AS" && AS=as + + + + + +test -z "$DLLTOOL" && DLLTOOL=dlltool + + + + + +test -z "$OBJDUMP" && OBJDUMP=objdump + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 +$as_echo_n "checking whether ln -s works... " >&6; } +LN_S=$as_ln_s +if test "$LN_S" = "ln -s"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 +$as_echo "no, using $LN_S" >&6; } +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } +set x ${MAKE-make} +ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then : + $as_echo_n "(cached) " >&6 +else + cat >conftest.make <<\_ACEOF +SHELL = /bin/sh +all: + @echo '@@@%%%=$(MAKE)=@@@%%%' +_ACEOF +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac +rm -f conftest.make +fi +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + SET_MAKE= +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + SET_MAKE="MAKE=${MAKE-make}" +fi + +case `pwd` in + *\ * | *\ *) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 +$as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; +esac + + + +macro_version='2.2.6b' +macro_revision='1.3017' + + + + + + + + + + + + + +ltmain="$ac_aux_dir/ltmain.sh" + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 +$as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } +if test "${lt_cv_path_NM+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$NM"; then + # Let the user override the test. + lt_cv_path_NM="$NM" +else + lt_nm_to_check="${ac_tool_prefix}nm" + if test -n "$ac_tool_prefix" && test "$build" = "$host"; then + lt_nm_to_check="$lt_nm_to_check nm" + fi + for lt_tmp_nm in $lt_nm_to_check; do + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + tmp_nm="$ac_dir/$lt_tmp_nm" + if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then + # Check to see if the nm accepts a BSD-compat flag. + # Adding the `sed 1q' prevents false positives on HP-UX, which says: + # nm: unknown option "B" ignored + # Tru64's nm complains that /dev/null is an invalid object file + case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in + */dev/null* | *'Invalid file or object type'*) + lt_cv_path_NM="$tmp_nm -B" + break + ;; + *) + case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in + */dev/null*) + lt_cv_path_NM="$tmp_nm -p" + break + ;; + *) + lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but + continue # so that we can try to find one that supports BSD flags + ;; + esac + ;; + esac + fi + done + IFS="$lt_save_ifs" + done + : ${lt_cv_path_NM=no} +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 +$as_echo "$lt_cv_path_NM" >&6; } +if test "$lt_cv_path_NM" != "no"; then + NM="$lt_cv_path_NM" +else + # Didn't find any BSD compatible name lister, look for dumpbin. + if test -n "$ac_tool_prefix"; then + for ac_prog in "dumpbin -symbols" "link -dump -symbols" + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_DUMPBIN+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$DUMPBIN"; then + ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +DUMPBIN=$ac_cv_prog_DUMPBIN +if test -n "$DUMPBIN"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 +$as_echo "$DUMPBIN" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$DUMPBIN" && break + done +fi +if test -z "$DUMPBIN"; then + ac_ct_DUMPBIN=$DUMPBIN + for ac_prog in "dumpbin -symbols" "link -dump -symbols" +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_DUMPBIN+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_DUMPBIN"; then + ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN +if test -n "$ac_ct_DUMPBIN"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 +$as_echo "$ac_ct_DUMPBIN" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_DUMPBIN" && break +done + + if test "x$ac_ct_DUMPBIN" = x; then + DUMPBIN=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DUMPBIN=$ac_ct_DUMPBIN + fi +fi + + + if test "$DUMPBIN" != ":"; then + NM="$DUMPBIN" + fi +fi +test -z "$NM" && NM=nm + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 +$as_echo_n "checking the name lister ($NM) interface... " >&6; } +if test "${lt_cv_nm_interface+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_nm_interface="BSD nm" + echo "int some_variable = 0;" > conftest.$ac_ext + (eval echo "\"\$as_me:5158: $ac_compile\"" >&5) + (eval "$ac_compile" 2>conftest.err) + cat conftest.err >&5 + (eval echo "\"\$as_me:5161: $NM \\\"conftest.$ac_objext\\\"\"" >&5) + (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) + cat conftest.err >&5 + (eval echo "\"\$as_me:5164: output\"" >&5) + cat conftest.out >&5 + if $GREP 'External.*some_variable' conftest.out > /dev/null; then + lt_cv_nm_interface="MS dumpbin" + fi + rm -f conftest* +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 +$as_echo "$lt_cv_nm_interface" >&6; } + +# find the maximum length of command line arguments +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 +$as_echo_n "checking the maximum length of command line arguments... " >&6; } +if test "${lt_cv_sys_max_cmd_len+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + i=0 + teststring="ABCD" + + case $build_os in + msdosdjgpp*) + # On DJGPP, this test can blow up pretty badly due to problems in libc + # (any single argument exceeding 2000 bytes causes a buffer overrun + # during glob expansion). Even if it were fixed, the result of this + # check would be larger than it should be. + lt_cv_sys_max_cmd_len=12288; # 12K is about right + ;; + + gnu*) + # Under GNU Hurd, this test is not required because there is + # no limit to the length of command line arguments. + # Libtool will interpret -1 as no limit whatsoever + lt_cv_sys_max_cmd_len=-1; + ;; + + cygwin* | mingw* | cegcc*) + # On Win9x/ME, this test blows up -- it succeeds, but takes + # about 5 minutes as the teststring grows exponentially. + # Worse, since 9x/ME are not pre-emptively multitasking, + # you end up with a "frozen" computer, even though with patience + # the test eventually succeeds (with a max line length of 256k). + # Instead, let's just punt: use the minimum linelength reported by + # all of the supported platforms: 8192 (on NT/2K/XP). + lt_cv_sys_max_cmd_len=8192; + ;; + + amigaos*) + # On AmigaOS with pdksh, this test takes hours, literally. + # So we just punt and use a minimum line length of 8192. + lt_cv_sys_max_cmd_len=8192; + ;; + + netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) + # This has been around since 386BSD, at least. Likely further. + if test -x /sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` + elif test -x /usr/sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` + else + lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs + fi + # And add a safety zone + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + ;; + + interix*) + # We know the value 262144 and hardcode it with a safety zone (like BSD) + lt_cv_sys_max_cmd_len=196608 + ;; + + osf*) + # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure + # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not + # nice to cause kernel panics so lets avoid the loop below. + # First set a reasonable default. + lt_cv_sys_max_cmd_len=16384 + # + if test -x /sbin/sysconfig; then + case `/sbin/sysconfig -q proc exec_disable_arg_limit` in + *1*) lt_cv_sys_max_cmd_len=-1 ;; + esac + fi + ;; + sco3.2v5*) + lt_cv_sys_max_cmd_len=102400 + ;; + sysv5* | sco5v6* | sysv4.2uw2*) + kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` + if test -n "$kargmax"; then + lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` + else + lt_cv_sys_max_cmd_len=32768 + fi + ;; + *) + lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` + if test -n "$lt_cv_sys_max_cmd_len"; then + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + else + # Make teststring a little bigger before we do anything with it. + # a 1K string should be a reasonable start. + for i in 1 2 3 4 5 6 7 8 ; do + teststring=$teststring$teststring + done + SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} + # If test is not a shell built-in, we'll probably end up computing a + # maximum length that is only half of the actual maximum length, but + # we can't tell. + while { test "X"`$SHELL $0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \ + = "XX$teststring$teststring"; } >/dev/null 2>&1 && + test $i != 17 # 1/2 MB should be enough + do + i=`expr $i + 1` + teststring=$teststring$teststring + done + # Only check the string length outside the loop. + lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` + teststring= + # Add a significant safety factor because C++ compilers can tack on + # massive amounts of additional arguments before passing them to the + # linker. It appears as though 1/2 is a usable value. + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` + fi + ;; + esac + +fi + +if test -n $lt_cv_sys_max_cmd_len ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 +$as_echo "$lt_cv_sys_max_cmd_len" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 +$as_echo "none" >&6; } +fi +max_cmd_len=$lt_cv_sys_max_cmd_len + + + + + + +: ${CP="cp -f"} +: ${MV="mv -f"} +: ${RM="rm -f"} + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5 +$as_echo_n "checking whether the shell understands some XSI constructs... " >&6; } +# Try some XSI features +xsi_shell=no +( _lt_dummy="a/b/c" + test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \ + = c,a/b,, \ + && eval 'test $(( 1 + 1 )) -eq 2 \ + && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ + && xsi_shell=yes +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5 +$as_echo "$xsi_shell" >&6; } + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5 +$as_echo_n "checking whether the shell understands \"+=\"... " >&6; } +lt_shell_append=no +( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \ + >/dev/null 2>&1 \ + && lt_shell_append=yes +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5 +$as_echo "$lt_shell_append" >&6; } + + +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + lt_unset=unset +else + lt_unset=false +fi + + + + + +# test EBCDIC or ASCII +case `echo X|tr X '\101'` in + A) # ASCII based system + # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr + lt_SP2NL='tr \040 \012' + lt_NL2SP='tr \015\012 \040\040' + ;; + *) # EBCDIC based system + lt_SP2NL='tr \100 \n' + lt_NL2SP='tr \r\n \100\100' + ;; +esac + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 +$as_echo_n "checking for $LD option to reload object files... " >&6; } +if test "${lt_cv_ld_reload_flag+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_ld_reload_flag='-r' +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 +$as_echo "$lt_cv_ld_reload_flag" >&6; } +reload_flag=$lt_cv_ld_reload_flag +case $reload_flag in +"" | " "*) ;; +*) reload_flag=" $reload_flag" ;; +esac +reload_cmds='$LD$reload_flag -o $output$reload_objs' +case $host_os in + darwin*) + if test "$GCC" = yes; then + reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' + else + reload_cmds='$LD$reload_flag -o $output$reload_objs' + fi + ;; +esac + + + + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. +set dummy ${ac_tool_prefix}objdump; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_OBJDUMP+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OBJDUMP"; then + ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OBJDUMP=$ac_cv_prog_OBJDUMP +if test -n "$OBJDUMP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 +$as_echo "$OBJDUMP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OBJDUMP"; then + ac_ct_OBJDUMP=$OBJDUMP + # Extract the first word of "objdump", so it can be a program name with args. +set dummy objdump; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_OBJDUMP+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OBJDUMP"; then + ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_OBJDUMP="objdump" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP +if test -n "$ac_ct_OBJDUMP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 +$as_echo "$ac_ct_OBJDUMP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_OBJDUMP" = x; then + OBJDUMP="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OBJDUMP=$ac_ct_OBJDUMP + fi +else + OBJDUMP="$ac_cv_prog_OBJDUMP" +fi + +test -z "$OBJDUMP" && OBJDUMP=objdump + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 +$as_echo_n "checking how to recognize dependent libraries... " >&6; } +if test "${lt_cv_deplibs_check_method+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_file_magic_cmd='$MAGIC_CMD' +lt_cv_file_magic_test_file= +lt_cv_deplibs_check_method='unknown' +# Need to set the preceding variable on all platforms that support +# interlibrary dependencies. +# 'none' -- dependencies not supported. +# `unknown' -- same as none, but documents that we really don't know. +# 'pass_all' -- all dependencies passed with no checks. +# 'test_compile' -- check by making test program. +# 'file_magic [[regex]]' -- check by looking for files in library path +# which responds to the $file_magic_cmd with a given extended regex. +# If you have `file' or equivalent on your system and you're not sure +# whether `pass_all' will *always* work, you probably want this one. + +case $host_os in +aix[4-9]*) + lt_cv_deplibs_check_method=pass_all + ;; + +beos*) + lt_cv_deplibs_check_method=pass_all + ;; + +bsdi[45]*) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' + lt_cv_file_magic_cmd='/usr/bin/file -L' + lt_cv_file_magic_test_file=/shlib/libc.so + ;; + +cygwin*) + # func_win32_libid is a shell function defined in ltmain.sh + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + ;; + +mingw* | pw32*) + # Base MSYS/MinGW do not provide the 'file' command needed by + # func_win32_libid shell function, so use a weaker test based on 'objdump', + # unless we find 'file', for example because we are cross-compiling. + if ( file / ) >/dev/null 2>&1; then + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + else + lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' + lt_cv_file_magic_cmd='$OBJDUMP -f' + fi + ;; + +cegcc) + # use the weaker test based on 'objdump'. See mingw*. + lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' + lt_cv_file_magic_cmd='$OBJDUMP -f' + ;; + +darwin* | rhapsody*) + lt_cv_deplibs_check_method=pass_all + ;; + +freebsd* | dragonfly*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + case $host_cpu in + i*86 ) + # Not sure whether the presence of OpenBSD here was a mistake. + # Let's accept both of them until this is cleared up. + lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` + ;; + esac + else + lt_cv_deplibs_check_method=pass_all + fi + ;; + +gnu*) + lt_cv_deplibs_check_method=pass_all + ;; + +hpux10.20* | hpux11*) + lt_cv_file_magic_cmd=/usr/bin/file + case $host_cpu in + ia64*) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' + lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so + ;; + hppa*64*) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]' + lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl + ;; + *) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library' + lt_cv_file_magic_test_file=/usr/lib/libc.sl + ;; + esac + ;; + +interix[3-9]*) + # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' + ;; + +irix5* | irix6* | nonstopux*) + case $LD in + *-32|*"-32 ") libmagic=32-bit;; + *-n32|*"-n32 ") libmagic=N32;; + *-64|*"-64 ") libmagic=64-bit;; + *) libmagic=never-match;; + esac + lt_cv_deplibs_check_method=pass_all + ;; + +# This must be Linux ELF. +linux* | k*bsd*-gnu) + lt_cv_deplibs_check_method=pass_all + ;; + +netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' + fi + ;; + +newos6*) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=/usr/lib/libnls.so + ;; + +*nto* | *qnx*) + lt_cv_deplibs_check_method=pass_all + ;; + +openbsd*) + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' + fi + ;; + +osf3* | osf4* | osf5*) + lt_cv_deplibs_check_method=pass_all + ;; + +rdos*) + lt_cv_deplibs_check_method=pass_all + ;; + +solaris*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv4 | sysv4.3*) + case $host_vendor in + motorola) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` + ;; + ncr) + lt_cv_deplibs_check_method=pass_all + ;; + sequent) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' + ;; + sni) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" + lt_cv_file_magic_test_file=/lib/libc.so + ;; + siemens) + lt_cv_deplibs_check_method=pass_all + ;; + pc) + lt_cv_deplibs_check_method=pass_all + ;; + esac + ;; + +tpf*) + lt_cv_deplibs_check_method=pass_all + ;; +esac + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 +$as_echo "$lt_cv_deplibs_check_method" >&6; } +file_magic_cmd=$lt_cv_file_magic_cmd +deplibs_check_method=$lt_cv_deplibs_check_method +test -z "$deplibs_check_method" && deplibs_check_method=unknown + + + + + + + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. +set dummy ${ac_tool_prefix}ar; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_AR+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_AR="${ac_tool_prefix}ar" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AR=$ac_cv_prog_AR +if test -n "$AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 +$as_echo "$AR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_AR"; then + ac_ct_AR=$AR + # Extract the first word of "ar", so it can be a program name with args. +set dummy ar; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_AR+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_AR"; then + ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_AR="ar" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_AR=$ac_cv_prog_ac_ct_AR +if test -n "$ac_ct_AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 +$as_echo "$ac_ct_AR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_AR" = x; then + AR="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + AR=$ac_ct_AR + fi +else + AR="$ac_cv_prog_AR" +fi + +test -z "$AR" && AR=ar +test -z "$AR_FLAGS" && AR_FLAGS=cru + + + + + + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_STRIP+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +$as_echo "$STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_STRIP="strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +$as_echo "$ac_ct_STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi +else + STRIP="$ac_cv_prog_STRIP" +fi + +test -z "$STRIP" && STRIP=: + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_RANLIB+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +RANLIB=$ac_cv_prog_RANLIB +if test -n "$RANLIB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 +$as_echo "$RANLIB" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_RANLIB"; then + ac_ct_RANLIB=$RANLIB + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_RANLIB"; then + ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_RANLIB="ranlib" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB +if test -n "$ac_ct_RANLIB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 +$as_echo "$ac_ct_RANLIB" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_RANLIB" = x; then + RANLIB=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + RANLIB=$ac_ct_RANLIB + fi +else + RANLIB="$ac_cv_prog_RANLIB" +fi + +test -z "$RANLIB" && RANLIB=: + + + + + + +# Determine commands to create old-style static archives. +old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' +old_postinstall_cmds='chmod 644 $oldlib' +old_postuninstall_cmds= + +if test -n "$RANLIB"; then + case $host_os in + openbsd*) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" + ;; + *) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" + ;; + esac + old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + +# Check for command to grab the raw symbol name followed by C symbol from nm. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 +$as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } +if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + +# These are sane defaults that work on at least a few old systems. +# [They come from Ultrix. What could be older than Ultrix?!! ;)] + +# Character class describing NM global symbol codes. +symcode='[BCDEGRST]' + +# Regexp to match symbols that can be accessed directly from C. +sympat='\([_A-Za-z][_A-Za-z0-9]*\)' + +# Define system-specific variables. +case $host_os in +aix*) + symcode='[BCDT]' + ;; +cygwin* | mingw* | pw32* | cegcc*) + symcode='[ABCDGISTW]' + ;; +hpux*) + if test "$host_cpu" = ia64; then + symcode='[ABCDEGRST]' + fi + ;; +irix* | nonstopux*) + symcode='[BCDEGRST]' + ;; +osf*) + symcode='[BCDEGQRST]' + ;; +solaris*) + symcode='[BDRT]' + ;; +sco3.2v5*) + symcode='[DT]' + ;; +sysv4.2uw2*) + symcode='[DT]' + ;; +sysv5* | sco5v6* | unixware* | OpenUNIX*) + symcode='[ABDT]' + ;; +sysv4) + symcode='[DFNSTU]' + ;; +esac + +# If we're using GNU nm, then use its standard symbol codes. +case `$NM -V 2>&1` in +*GNU* | *'with BFD'*) + symcode='[ABCDGIRSTW]' ;; +esac + +# Transform an extracted symbol line into a proper C declaration. +# Some systems (esp. on ia64) link data and code symbols differently, +# so use this general approach. +lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" + +# Transform an extracted symbol line into symbol name and symbol address +lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'" +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'" + +# Handle CRLF in mingw tool chain +opt_cr= +case $build_os in +mingw*) + opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp + ;; +esac + +# Try without a prefix underscore, then with it. +for ac_symprfx in "" "_"; do + + # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. + symxfrm="\\1 $ac_symprfx\\2 \\2" + + # Write the raw and C identifiers. + if test "$lt_cv_nm_interface" = "MS dumpbin"; then + # Fake it for dumpbin and say T for any non-static function + # and D for any global variable. + # Also find C++ and __fastcall symbols from MSVC++, + # which start with @ or ?. + lt_cv_sys_global_symbol_pipe="$AWK '"\ +" {last_section=section; section=\$ 3};"\ +" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ +" \$ 0!~/External *\|/{next};"\ +" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ +" {if(hide[section]) next};"\ +" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ +" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ +" s[1]~/^[@?]/{print s[1], s[1]; next};"\ +" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ +" ' prfx=^$ac_symprfx" + else + lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" + fi + + # Check to see that the pipe works correctly. + pipe_works=no + + rm -f conftest* + cat > conftest.$ac_ext <<_LT_EOF +#ifdef __cplusplus +extern "C" { +#endif +char nm_test_var; +void nm_test_func(void); +void nm_test_func(void){} +#ifdef __cplusplus +} +#endif +int main(){nm_test_var='a';nm_test_func();return(0);} +_LT_EOF + + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + # Now try to grab the symbols. + nlist=conftest.nm + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\""; } >&5 + (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s "$nlist"; then + # Try sorting and uniquifying the output. + if sort "$nlist" | uniq > "$nlist"T; then + mv -f "$nlist"T "$nlist" + else + rm -f "$nlist"T + fi + + # Make sure that we snagged all the symbols we need. + if $GREP ' nm_test_var$' "$nlist" >/dev/null; then + if $GREP ' nm_test_func$' "$nlist" >/dev/null; then + cat <<_LT_EOF > conftest.$ac_ext +#ifdef __cplusplus +extern "C" { +#endif + +_LT_EOF + # Now generate the symbol file. + eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' + + cat <<_LT_EOF >> conftest.$ac_ext + +/* The mapping between symbol names and symbols. */ +const struct { + const char *name; + void *address; +} +lt__PROGRAM__LTX_preloaded_symbols[] = +{ + { "@PROGRAM@", (void *) 0 }, +_LT_EOF + $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext + cat <<\_LT_EOF >> conftest.$ac_ext + {0, (void *) 0} +}; + +/* This works around a problem in FreeBSD linker */ +#ifdef FREEBSD_WORKAROUND +static const void *lt_preloaded_setup() { + return lt__PROGRAM__LTX_preloaded_symbols; +} +#endif + +#ifdef __cplusplus +} +#endif +_LT_EOF + # Now try linking the two files. + mv conftest.$ac_objext conftstm.$ac_objext + lt_save_LIBS="$LIBS" + lt_save_CFLAGS="$CFLAGS" + LIBS="conftstm.$ac_objext" + CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest${ac_exeext}; then + pipe_works=yes + fi + LIBS="$lt_save_LIBS" + CFLAGS="$lt_save_CFLAGS" + else + echo "cannot find nm_test_func in $nlist" >&5 + fi + else + echo "cannot find nm_test_var in $nlist" >&5 + fi + else + echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 + fi + else + echo "$progname: failed program was:" >&5 + cat conftest.$ac_ext >&5 + fi + rm -rf conftest* conftst* + + # Do not use the global_symbol_pipe unless it works. + if test "$pipe_works" = yes; then + break + else + lt_cv_sys_global_symbol_pipe= + fi +done + +fi + +if test -z "$lt_cv_sys_global_symbol_pipe"; then + lt_cv_sys_global_symbol_to_cdecl= +fi +if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5 +$as_echo "failed" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 +$as_echo "ok" >&6; } +fi + + + + + + + + + + + + + + + + + + + + + + + +# Check whether --enable-libtool-lock was given. +if test "${enable_libtool_lock+set}" = set; then : + enableval=$enable_libtool_lock; +fi + +test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes + +# Some flags need to be propagated to the compiler or linker for good +# libtool support. +case $host in +ia64-*-hpux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + case `/usr/bin/file conftest.$ac_objext` in + *ELF-32*) + HPUX_IA64_MODE="32" + ;; + *ELF-64*) + HPUX_IA64_MODE="64" + ;; + esac + fi + rm -rf conftest* + ;; +*-*-irix6*) + # Find out which ABI we are using. + echo '#line 6356 "configure"' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + if test "$lt_cv_prog_gnu_ld" = yes; then + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -melf32bsmip" + ;; + *N32*) + LD="${LD-ld} -melf32bmipn32" + ;; + *64-bit*) + LD="${LD-ld} -melf64bmip" + ;; + esac + else + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -32" + ;; + *N32*) + LD="${LD-ld} -n32" + ;; + *64-bit*) + LD="${LD-ld} -64" + ;; + esac + fi + fi + rm -rf conftest* + ;; + +x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ +s390*-*linux*|s390*-*tpf*|sparc*-*linux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + case `/usr/bin/file conftest.o` in + *32-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_i386_fbsd" + ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_i386" + ;; + ppc64-*linux*|powerpc64-*linux*) + LD="${LD-ld} -m elf32ppclinux" + ;; + s390x-*linux*) + LD="${LD-ld} -m elf_s390" + ;; + sparc64-*linux*) + LD="${LD-ld} -m elf32_sparc" + ;; + esac + ;; + *64-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_x86_64_fbsd" + ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_x86_64" + ;; + ppc*-*linux*|powerpc*-*linux*) + LD="${LD-ld} -m elf64ppc" + ;; + s390*-*linux*|s390*-*tpf*) + LD="${LD-ld} -m elf64_s390" + ;; + sparc*-*linux*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; + +*-*-sco3.2v5*) + # On SCO OpenServer 5, we need -belf to get full-featured binaries. + SAVE_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -belf" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 +$as_echo_n "checking whether the C compiler needs -belf... " >&6; } +if test "${lt_cv_cc_needs_belf+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + lt_cv_cc_needs_belf=yes +else + lt_cv_cc_needs_belf=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 +$as_echo "$lt_cv_cc_needs_belf" >&6; } + if test x"$lt_cv_cc_needs_belf" != x"yes"; then + # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf + CFLAGS="$SAVE_CFLAGS" + fi + ;; +sparc*-*solaris*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + case `/usr/bin/file conftest.o` in + *64-bit*) + case $lt_cv_prog_gnu_ld in + yes*) LD="${LD-ld} -m elf64_sparc" ;; + *) + if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then + LD="${LD-ld} -64" + fi + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; +esac + +need_locks="$enable_libtool_lock" + + + case $host_os in + rhapsody* | darwin*) + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. +set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_DSYMUTIL+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$DSYMUTIL"; then + ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +DSYMUTIL=$ac_cv_prog_DSYMUTIL +if test -n "$DSYMUTIL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 +$as_echo "$DSYMUTIL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_DSYMUTIL"; then + ac_ct_DSYMUTIL=$DSYMUTIL + # Extract the first word of "dsymutil", so it can be a program name with args. +set dummy dsymutil; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_DSYMUTIL+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_DSYMUTIL"; then + ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL +if test -n "$ac_ct_DSYMUTIL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 +$as_echo "$ac_ct_DSYMUTIL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_DSYMUTIL" = x; then + DSYMUTIL=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DSYMUTIL=$ac_ct_DSYMUTIL + fi +else + DSYMUTIL="$ac_cv_prog_DSYMUTIL" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. +set dummy ${ac_tool_prefix}nmedit; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_NMEDIT+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$NMEDIT"; then + ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +NMEDIT=$ac_cv_prog_NMEDIT +if test -n "$NMEDIT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 +$as_echo "$NMEDIT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_NMEDIT"; then + ac_ct_NMEDIT=$NMEDIT + # Extract the first word of "nmedit", so it can be a program name with args. +set dummy nmedit; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_NMEDIT+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_NMEDIT"; then + ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_NMEDIT="nmedit" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT +if test -n "$ac_ct_NMEDIT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 +$as_echo "$ac_ct_NMEDIT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_NMEDIT" = x; then + NMEDIT=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + NMEDIT=$ac_ct_NMEDIT + fi +else + NMEDIT="$ac_cv_prog_NMEDIT" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. +set dummy ${ac_tool_prefix}lipo; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_LIPO+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$LIPO"; then + ac_cv_prog_LIPO="$LIPO" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_LIPO="${ac_tool_prefix}lipo" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +LIPO=$ac_cv_prog_LIPO +if test -n "$LIPO"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 +$as_echo "$LIPO" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_LIPO"; then + ac_ct_LIPO=$LIPO + # Extract the first word of "lipo", so it can be a program name with args. +set dummy lipo; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_LIPO+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_LIPO"; then + ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_LIPO="lipo" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO +if test -n "$ac_ct_LIPO"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 +$as_echo "$ac_ct_LIPO" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_LIPO" = x; then + LIPO=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + LIPO=$ac_ct_LIPO + fi +else + LIPO="$ac_cv_prog_LIPO" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. +set dummy ${ac_tool_prefix}otool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_OTOOL+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OTOOL"; then + ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_OTOOL="${ac_tool_prefix}otool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OTOOL=$ac_cv_prog_OTOOL +if test -n "$OTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 +$as_echo "$OTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OTOOL"; then + ac_ct_OTOOL=$OTOOL + # Extract the first word of "otool", so it can be a program name with args. +set dummy otool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_OTOOL+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OTOOL"; then + ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_OTOOL="otool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL +if test -n "$ac_ct_OTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 +$as_echo "$ac_ct_OTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_OTOOL" = x; then + OTOOL=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OTOOL=$ac_ct_OTOOL + fi +else + OTOOL="$ac_cv_prog_OTOOL" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. +set dummy ${ac_tool_prefix}otool64; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_OTOOL64+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OTOOL64"; then + ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OTOOL64=$ac_cv_prog_OTOOL64 +if test -n "$OTOOL64"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 +$as_echo "$OTOOL64" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OTOOL64"; then + ac_ct_OTOOL64=$OTOOL64 + # Extract the first word of "otool64", so it can be a program name with args. +set dummy otool64; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_OTOOL64+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OTOOL64"; then + ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_OTOOL64="otool64" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 +if test -n "$ac_ct_OTOOL64"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 +$as_echo "$ac_ct_OTOOL64" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_OTOOL64" = x; then + OTOOL64=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OTOOL64=$ac_ct_OTOOL64 + fi +else + OTOOL64="$ac_cv_prog_OTOOL64" +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 +$as_echo_n "checking for -single_module linker flag... " >&6; } +if test "${lt_cv_apple_cc_single_mod+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_apple_cc_single_mod=no + if test -z "${LT_MULTI_MODULE}"; then + # By default we will add the -single_module flag. You can override + # by either setting the environment variable LT_MULTI_MODULE + # non-empty at configure time, or by adding -multi_module to the + # link flags. + rm -rf libconftest.dylib* + echo "int foo(void){return 1;}" > conftest.c + echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ +-dynamiclib -Wl,-single_module conftest.c" >&5 + $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ + -dynamiclib -Wl,-single_module conftest.c 2>conftest.err + _lt_result=$? + if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then + lt_cv_apple_cc_single_mod=yes + else + cat conftest.err >&5 + fi + rm -rf libconftest.dylib* + rm -f conftest.* + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 +$as_echo "$lt_cv_apple_cc_single_mod" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 +$as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } +if test "${lt_cv_ld_exported_symbols_list+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_ld_exported_symbols_list=no + save_LDFLAGS=$LDFLAGS + echo "_main" > conftest.sym + LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + lt_cv_ld_exported_symbols_list=yes +else + lt_cv_ld_exported_symbols_list=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS="$save_LDFLAGS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 +$as_echo "$lt_cv_ld_exported_symbols_list" >&6; } + case $host_os in + rhapsody* | darwin1.[012]) + _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; + darwin1.*) + _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + darwin*) # darwin 5.x on + # if running on 10.5 or later, the deployment target defaults + # to the OS version, if on x86, and 10.4, the deployment + # target defaults to 10.4. Don't you love it? + case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in + 10.0,*86*-darwin8*|10.0,*-darwin[91]*) + _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; + 10.[012]*) + _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + 10.*) + _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; + esac + ;; + esac + if test "$lt_cv_apple_cc_single_mod" = "yes"; then + _lt_dar_single_mod='$single_module' + fi + if test "$lt_cv_ld_exported_symbols_list" = "yes"; then + _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' + else + _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' + fi + if test "$DSYMUTIL" != ":"; then + _lt_dsymutil='~$DSYMUTIL $lib || :' + else + _lt_dsymutil= + fi + ;; + esac + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } +if test "${ac_cv_header_stdc+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_header_stdc=yes +else + ac_cv_header_stdc=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + return 2; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + +else + ac_cv_header_stdc=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 +$as_echo "$ac_cv_header_stdc" >&6; } +if test $ac_cv_header_stdc = yes; then + +$as_echo "#define STDC_HEADERS 1" >>confdefs.h + +fi + +# On IRIX 5.3, sys/types and inttypes.h are conflicting. +for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ + inttypes.h stdint.h unistd.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default +" +eval as_val=\$$as_ac_Header + if test "x$as_val" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +for ac_header in dlfcn.h +do : + ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default +" +if test "x$ac_cv_header_dlfcn_h" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_DLFCN_H 1 +_ACEOF + +fi + +done + + + +# Set options + + + + enable_dlopen=no + + + + # Check whether --enable-shared was given. +if test "${enable_shared+set}" = set; then : + enableval=$enable_shared; p=${PACKAGE-default} + case $enableval in + yes) enable_shared=yes ;; + no) enable_shared=no ;; + *) + enable_shared=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_shared=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac +else + enable_shared=yes +fi + + + + + + + + + + # Check whether --enable-static was given. +if test "${enable_static+set}" = set; then : + enableval=$enable_static; p=${PACKAGE-default} + case $enableval in + yes) enable_static=yes ;; + no) enable_static=no ;; + *) + enable_static=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_static=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac +else + enable_static=yes +fi + + + + + + + + + + +# Check whether --with-pic was given. +if test "${with_pic+set}" = set; then : + withval=$with_pic; pic_mode="$withval" +else + pic_mode=default +fi + + +test -z "$pic_mode" && pic_mode=default + + + + + + + + # Check whether --enable-fast-install was given. +if test "${enable_fast_install+set}" = set; then : + enableval=$enable_fast_install; p=${PACKAGE-default} + case $enableval in + yes) enable_fast_install=yes ;; + no) enable_fast_install=no ;; + *) + enable_fast_install=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_fast_install=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac +else + enable_fast_install=yes +fi + + + + + + + + + + + +# This can be used to rebuild libtool when needed +LIBTOOL_DEPS="$ltmain" + +# Always use our own libtool. +LIBTOOL='$(SHELL) $(top_builddir)/libtool' + + + + + + + + + + + + + + + + + + + + + + + + + +test -z "$LN_S" && LN_S="ln -s" + + + + + + + + + + + + + + +if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 +$as_echo_n "checking for objdir... " >&6; } +if test "${lt_cv_objdir+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + rm -f .libs 2>/dev/null +mkdir .libs 2>/dev/null +if test -d .libs; then + lt_cv_objdir=.libs +else + # MS-DOS does not allow filenames that begin with a dot. + lt_cv_objdir=_libs +fi +rmdir .libs 2>/dev/null +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 +$as_echo "$lt_cv_objdir" >&6; } +objdir=$lt_cv_objdir + + + + + +cat >>confdefs.h <<_ACEOF +#define LT_OBJDIR "$lt_cv_objdir/" +_ACEOF + + + + + + + + + + + + + + + + + +case $host_os in +aix3*) + # AIX sometimes has problems with the GCC collect2 program. For some + # reason, if we set the COLLECT_NAMES environment variable, the problems + # vanish in a puff of smoke. + if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES + fi + ;; +esac + +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +sed_quote_subst='s/\(["`$\\]\)/\\\1/g' + +# Same as above, but do not quote variable references. +double_quote_subst='s/\(["`\\]\)/\\\1/g' + +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' + +# Sed substitution to delay expansion of an escaped single quote. +delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' + +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' + +# Global variables: +ofile=libtool +can_build_shared=yes + +# All known linkers require a `.a' archive for static linking (except MSVC, +# which needs '.lib'). +libext=a + +with_gnu_ld="$lt_cv_prog_gnu_ld" + +old_CC="$CC" +old_CFLAGS="$CFLAGS" + +# Set sane defaults for various variables +test -z "$CC" && CC=cc +test -z "$LTCC" && LTCC=$CC +test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS +test -z "$LD" && LD=ld +test -z "$ac_objext" && ac_objext=o + +for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` + + +# Only perform the check for file, if the check method requires it +test -z "$MAGIC_CMD" && MAGIC_CMD=file +case $deplibs_check_method in +file_magic*) + if test "$file_magic_cmd" = '$MAGIC_CMD'; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 +$as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } +if test "${lt_cv_path_MAGIC_CMD+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case $MAGIC_CMD in +[\\/*] | ?:[\\/]*) + lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD="$MAGIC_CMD" + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" + for ac_dir in $ac_dummy; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/${ac_tool_prefix}file; then + lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` + MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <<_LT_EOF 1>&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +_LT_EOF + fi ;; + esac + fi + break + fi + done + IFS="$lt_save_ifs" + MAGIC_CMD="$lt_save_MAGIC_CMD" + ;; +esac +fi + +MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +if test -n "$MAGIC_CMD"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 +$as_echo "$MAGIC_CMD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + + + +if test -z "$lt_cv_path_MAGIC_CMD"; then + if test -n "$ac_tool_prefix"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5 +$as_echo_n "checking for file... " >&6; } +if test "${lt_cv_path_MAGIC_CMD+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case $MAGIC_CMD in +[\\/*] | ?:[\\/]*) + lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD="$MAGIC_CMD" + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" + for ac_dir in $ac_dummy; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/file; then + lt_cv_path_MAGIC_CMD="$ac_dir/file" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` + MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <<_LT_EOF 1>&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +_LT_EOF + fi ;; + esac + fi + break + fi + done + IFS="$lt_save_ifs" + MAGIC_CMD="$lt_save_MAGIC_CMD" + ;; +esac +fi + +MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +if test -n "$MAGIC_CMD"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 +$as_echo "$MAGIC_CMD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + else + MAGIC_CMD=: + fi +fi + + fi + ;; +esac + +# Use C for the default configuration in the libtool script + +lt_save_CC="$CC" +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +# Source file extension for C test sources. +ac_ext=c + +# Object file extension for compiled C test sources. +objext=o +objext=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="int some_variable = 0;" + +# Code to be used in simple link tests +lt_simple_link_test_code='int main(){return(0);}' + + + + + + + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + +# Save the default compiler, since it gets overwritten when the other +# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. +compiler_DEFAULT=$CC + +# save warnings/boilerplate of simple test code +ac_outfile=conftest.$ac_objext +echo "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$RM conftest* + +ac_outfile=conftest.$ac_objext +echo "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$RM -r conftest* + + +if test -n "$compiler"; then + +lt_prog_compiler_no_builtin_flag= + +if test "$GCC" = yes; then + lt_prog_compiler_no_builtin_flag=' -fno-builtin' + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 +$as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } +if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_rtti_exceptions=no + ac_outfile=conftest.$ac_objext + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="-fno-rtti -fno-exceptions" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:7743: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:7747: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_rtti_exceptions=yes + fi + fi + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 +$as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } + +if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then + lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" +else + : +fi + +fi + + + + + + + lt_prog_compiler_wl= +lt_prog_compiler_pic= +lt_prog_compiler_static= + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 +$as_echo_n "checking for $compiler option to produce PIC... " >&6; } + + if test "$GCC" = yes; then + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_static='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static='-Bstatic' + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + lt_prog_compiler_pic='-fPIC' + ;; + m68k) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' + ;; + esac + ;; + + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + + mingw* | cygwin* | pw32* | os2* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + lt_prog_compiler_pic='-DDLL_EXPORT' + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_prog_compiler_pic='-fno-common' + ;; + + hpux*) + # PIC is the default for 64-bit PA HP-UX, but not for 32-bit + # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag + # sets the default TLS model and affects inlining. + case $host_cpu in + hppa*64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic='-fPIC' + ;; + esac + ;; + + interix[3-9]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + + msdosdjgpp*) + # Just because we use GCC doesn't mean we suddenly get shared libraries + # on systems that don't support them. + lt_prog_compiler_can_build_shared=no + enable_shared=no + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + lt_prog_compiler_pic='-fPIC -shared' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + lt_prog_compiler_pic=-Kconform_pic + fi + ;; + + *) + lt_prog_compiler_pic='-fPIC' + ;; + esac + else + # PORTME Check for flag to pass linker flags through the system compiler. + case $host_os in + aix*) + lt_prog_compiler_wl='-Wl,' + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static='-Bstatic' + else + lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' + fi + ;; + + mingw* | cygwin* | pw32* | os2* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic='-DDLL_EXPORT' + ;; + + hpux9* | hpux10* | hpux11*) + lt_prog_compiler_wl='-Wl,' + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic='+Z' + ;; + esac + # Is there a better lt_prog_compiler_static that works with the bundled CC? + lt_prog_compiler_static='${wl}-a ${wl}archive' + ;; + + irix5* | irix6* | nonstopux*) + lt_prog_compiler_wl='-Wl,' + # PIC (with -KPIC) is the default. + lt_prog_compiler_static='-non_shared' + ;; + + linux* | k*bsd*-gnu) + case $cc_basename in + # old Intel for x86_64 which still supported -KPIC. + ecc*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-static' + ;; + # icc used to be incompatible with GCC. + # ICC 10 doesn't accept -KPIC any more. + icc* | ifort*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fPIC' + lt_prog_compiler_static='-static' + ;; + # Lahey Fortran 8.1. + lf95*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='--shared' + lt_prog_compiler_static='--static' + ;; + pgcc* | pgf77* | pgf90* | pgf95*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fpic' + lt_prog_compiler_static='-Bstatic' + ;; + ccc*) + lt_prog_compiler_wl='-Wl,' + # All Alpha code is PIC. + lt_prog_compiler_static='-non_shared' + ;; + xl*) + # IBM XL C 8.0/Fortran 10.1 on PPC + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-qpic' + lt_prog_compiler_static='-qstaticlink' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C 5.9 + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='-Wl,' + ;; + *Sun\ F*) + # Sun Fortran 8.3 passes all unrecognized flags to the linker + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='' + ;; + esac + ;; + esac + ;; + + newsos6) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + lt_prog_compiler_pic='-fPIC -shared' + ;; + + osf3* | osf4* | osf5*) + lt_prog_compiler_wl='-Wl,' + # All OSF/1 code is PIC. + lt_prog_compiler_static='-non_shared' + ;; + + rdos*) + lt_prog_compiler_static='-non_shared' + ;; + + solaris*) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + case $cc_basename in + f77* | f90* | f95*) + lt_prog_compiler_wl='-Qoption ld ';; + *) + lt_prog_compiler_wl='-Wl,';; + esac + ;; + + sunos4*) + lt_prog_compiler_wl='-Qoption ld ' + lt_prog_compiler_pic='-PIC' + lt_prog_compiler_static='-Bstatic' + ;; + + sysv4 | sysv4.2uw2* | sysv4.3*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + sysv4*MP*) + if test -d /usr/nec ;then + lt_prog_compiler_pic='-Kconform_pic' + lt_prog_compiler_static='-Bstatic' + fi + ;; + + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + unicos*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_can_build_shared=no + ;; + + uts4*) + lt_prog_compiler_pic='-pic' + lt_prog_compiler_static='-Bstatic' + ;; + + *) + lt_prog_compiler_can_build_shared=no + ;; + esac + fi + +case $host_os in + # For platforms which do not support PIC, -DPIC is meaningless: + *djgpp*) + lt_prog_compiler_pic= + ;; + *) + lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" + ;; +esac +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_prog_compiler_pic" >&5 +$as_echo "$lt_prog_compiler_pic" >&6; } + + + + + + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$lt_prog_compiler_pic"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 +$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } +if test "${lt_cv_prog_compiler_pic_works+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_pic_works=no + ac_outfile=conftest.$ac_objext + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$lt_prog_compiler_pic -DPIC" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:8082: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:8086: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_pic_works=yes + fi + fi + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 +$as_echo "$lt_cv_prog_compiler_pic_works" >&6; } + +if test x"$lt_cv_prog_compiler_pic_works" = xyes; then + case $lt_prog_compiler_pic in + "" | " "*) ;; + *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; + esac +else + lt_prog_compiler_pic= + lt_prog_compiler_can_build_shared=no +fi + +fi + + + + + + +# +# Check to make sure the static flag actually works. +# +wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 +$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } +if test "${lt_cv_prog_compiler_static_works+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_static_works=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $lt_tmp_static_flag" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $ECHO "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_static_works=yes + fi + else + lt_cv_prog_compiler_static_works=yes + fi + fi + $RM -r conftest* + LDFLAGS="$save_LDFLAGS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 +$as_echo "$lt_cv_prog_compiler_static_works" >&6; } + +if test x"$lt_cv_prog_compiler_static_works" = xyes; then + : +else + lt_prog_compiler_static= +fi + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if test "${lt_cv_prog_compiler_c_o+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_c_o=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:8187: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:8191: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o=yes + fi + fi + chmod u+w . 2>&5 + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 +$as_echo "$lt_cv_prog_compiler_c_o" >&6; } + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if test "${lt_cv_prog_compiler_c_o+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_c_o=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:8242: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:8246: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o=yes + fi + fi + chmod u+w . 2>&5 + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 +$as_echo "$lt_cv_prog_compiler_c_o" >&6; } + + + + +hard_links="nottested" +if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then + # do not overwrite the value of need_locks provided by the user + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 +$as_echo_n "checking if we can lock with hard links... " >&6; } + hard_links=yes + $RM conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 +$as_echo "$hard_links" >&6; } + if test "$hard_links" = no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 +$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} + need_locks=warn + fi +else + need_locks=no +fi + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } + + runpath_var= + allow_undefined_flag= + always_export_symbols=no + archive_cmds= + archive_expsym_cmds= + compiler_needs_object=no + enable_shared_with_static_runtimes=no + export_dynamic_flag_spec= + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + hardcode_automatic=no + hardcode_direct=no + hardcode_direct_absolute=no + hardcode_libdir_flag_spec= + hardcode_libdir_flag_spec_ld= + hardcode_libdir_separator= + hardcode_minus_L=no + hardcode_shlibpath_var=unsupported + inherit_rpath=no + link_all_deplibs=unknown + module_cmds= + module_expsym_cmds= + old_archive_from_new_cmds= + old_archive_from_expsyms_cmds= + thread_safe_flag_spec= + whole_archive_flag_spec= + # include_expsyms should be a list of space-separated symbols to be *always* + # included in the symbol list + include_expsyms= + # exclude_expsyms can be an extended regexp of symbols to exclude + # it will be wrapped by ` (' and `)$', so one must not match beginning or + # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', + # as well as any symbol that contains `d'. + exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' + # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out + # platforms (ab)use it in PIC code, but their linkers get confused if + # the symbol is explicitly referenced. Since portable code cannot + # rely on this symbol name, it's probably fine to never include it in + # preloaded symbol tables. + # Exclude shared library initialization/finalization symbols. + extract_expsyms_cmds= + + case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test "$GCC" != yes; then + with_gnu_ld=no + fi + ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes + ;; + openbsd*) + with_gnu_ld=no + ;; + esac + + ld_shlibs=yes + if test "$with_gnu_ld" = yes; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='${wl}' + + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + runpath_var=LD_RUN_PATH + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + export_dynamic_flag_spec='${wl}--export-dynamic' + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then + whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + whole_archive_flag_spec= + fi + supports_anon_versioning=no + case `$LD -v 2>&1` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac + + # See if GNU ld supports shared libraries. + case $host_os in + aix[3-9]*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + ld_shlibs=no + cat <<_LT_EOF 1>&2 + +*** Warning: the GNU linker, at least up to release 2.9.1, is reported +*** to be unable to reliably create shared libraries on AIX. +*** Therefore, libtool is disabling shared libraries support. If you +*** really care for shared libraries, you may want to modify your PATH +*** so that a non-GNU linker is found, and then restart. + +_LT_EOF + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='' + ;; + m68k) + archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + ;; + esac + ;; + + beos*) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + allow_undefined_flag=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + ld_shlibs=no + fi + ;; + + cygwin* | mingw* | pw32* | cegcc*) + # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, + # as there is no search path for DLLs. + hardcode_libdir_flag_spec='-L$libdir' + allow_undefined_flag=unsupported + always_export_symbols=no + enable_shared_with_static_runtimes=yes + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + ld_shlibs=no + fi + ;; + + interix[3-9]*) + hardcode_direct=no + hardcode_shlibpath_var=no + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + export_dynamic_flag_spec='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + + gnu* | linux* | tpf* | k*bsd*-gnu) + tmp_diet=no + if test "$host_os" = linux-dietlibc; then + case $cc_basename in + diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) + esac + fi + if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ + && test "$tmp_diet" = no + then + tmp_addflag= + tmp_sharedflag='-shared' + case $cc_basename,$host_cpu in + pgcc*) # Portland Group C compiler + whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers + whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag -Mnomain' ;; + ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 + tmp_addflag=' -i_dynamic' ;; + efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 + tmp_addflag=' -i_dynamic -nofor_main' ;; + ifc* | ifort*) # Intel Fortran compiler + tmp_addflag=' -nofor_main' ;; + lf95*) # Lahey Fortran 8.1 + whole_archive_flag_spec= + tmp_sharedflag='--shared' ;; + xl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) + tmp_sharedflag='-qmkshrobj' + tmp_addflag= ;; + esac + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) # Sun C 5.9 + whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + compiler_needs_object=yes + tmp_sharedflag='-G' ;; + *Sun\ F*) # Sun Fortran 8.3 + tmp_sharedflag='-G' ;; + esac + archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + + if test "x$supports_anon_versioning" = xyes; then + archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + + case $cc_basename in + xlf*) + # IBM XL Fortran 10.1 on PPC cannot create shared libs itself + whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' + hardcode_libdir_flag_spec= + hardcode_libdir_flag_spec_ld='-rpath $libdir' + archive_cmds='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib' + if test "x$supports_anon_versioning" = xyes; then + archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' + fi + ;; + esac + else + ld_shlibs=no + fi + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + + solaris*) + if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then + ld_shlibs=no + cat <<_LT_EOF 1>&2 + +*** Warning: The releases 2.8.* of the GNU linker cannot reliably +*** create shared libraries on Solaris systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.9.1 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) + ld_shlibs=no + cat <<_LT_EOF 1>&2 + +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not +*** reliably create shared libraries on SCO systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.16.91.0.3 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + ;; + *) + # For security reasons, it is highly recommended that you always + # use absolute paths for naming shared libraries, and exclude the + # DT_RUNPATH tag from executables and libraries. But doing so + # requires that you compile everything twice, which is a pain. + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + esac + ;; + + sunos4*) + archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' + wlarc= + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + *) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + esac + + if test "$ld_shlibs" = no; then + runpath_var= + hardcode_libdir_flag_spec= + export_dynamic_flag_spec= + whole_archive_flag_spec= + fi + else + # PORTME fill in a description of your system's linker (not GNU ld) + case $host_os in + aix3*) + allow_undefined_flag=unsupported + always_export_symbols=yes + archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + hardcode_minus_L=yes + if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + hardcode_direct=unsupported + fi + ;; + + aix[4-9]*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then + export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + else + export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + fi + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) + for ld_flag in $LDFLAGS; do + if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then + aix_use_runtimelinking=yes + break + fi + done + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + archive_cmds='' + hardcode_direct=yes + hardcode_direct_absolute=yes + hardcode_libdir_separator=':' + link_all_deplibs=yes + file_list_spec='${wl}-f,' + + if test "$GCC" = yes; then + case $host_os in aix4.[012]|aix4.[012].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && + strings "$collect2name" | $GREP resolve_lib_name >/dev/null + then + # We have reworked collect2 + : + else + # We have old collect2 + hardcode_direct=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + hardcode_minus_L=yes + hardcode_libdir_flag_spec='-L$libdir' + hardcode_libdir_separator= + fi + ;; + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + export_dynamic_flag_spec='${wl}-bexpall' + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + always_export_symbols=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + allow_undefined_flag='-berok' + # Determine the default libpath from the value encoded in an + # empty executable. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + +lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\(.*\)$/\1/ + p + } + }' +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then + aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' + allow_undefined_flag="-z nodefs" + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an + # empty executable. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + +lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\(.*\)$/\1/ + p + } + }' +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then + aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + no_undefined_flag=' ${wl}-bernotok' + allow_undefined_flag=' ${wl}-berok' + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec='$convenience' + archive_cmds_need_lc=yes + # This is similar to how AIX traditionally builds its shared libraries. + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='' + ;; + m68k) + archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + ;; + esac + ;; + + bsdi[45]*) + export_dynamic_flag_spec=-rdynamic + ;; + + cygwin* | mingw* | pw32* | cegcc*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + hardcode_libdir_flag_spec=' ' + allow_undefined_flag=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + archive_cmds='$CC -o $lib $libobjs $compiler_flags `$ECHO "X$deplibs" | $Xsed -e '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + old_archive_from_new_cmds='true' + # FIXME: Should let the user specify the lib program. + old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' + fix_srcfile_path='`cygpath -w "$srcfile"`' + enable_shared_with_static_runtimes=yes + ;; + + darwin* | rhapsody*) + + + archive_cmds_need_lc=no + hardcode_direct=no + hardcode_automatic=yes + hardcode_shlibpath_var=unsupported + whole_archive_flag_spec='' + link_all_deplibs=yes + allow_undefined_flag="$_lt_dar_allow_undefined" + case $cc_basename in + ifort*) _lt_dar_can_shared=yes ;; + *) _lt_dar_can_shared=$GCC ;; + esac + if test "$_lt_dar_can_shared" = "yes"; then + output_verbose_link_cmd=echo + archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" + module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" + archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" + module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" + + else + ld_shlibs=no + fi + + ;; + + dgux*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_shlibpath_var=no + ;; + + freebsd1*) + ld_shlibs=no + ;; + + # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor + # support. Future versions do this automatically, but an explicit c++rt0.o + # does not break anything, and helps significantly (at the cost of a little + # extra space). + freebsd2.2*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + # Unfortunately, older versions of FreeBSD 2 do not have this feature. + freebsd2*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes + hardcode_minus_L=yes + hardcode_shlibpath_var=no + ;; + + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd* | dragonfly*) + archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + hpux9*) + if test "$GCC" = yes; then + archive_cmds='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + fi + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + export_dynamic_flag_spec='${wl}-E' + ;; + + hpux10*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_flag_spec_ld='+b $libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + hardcode_direct_absolute=yes + export_dynamic_flag_spec='${wl}-E' + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + fi + ;; + + hpux11*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + case $host_cpu in + hppa*64*) + archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case $host_cpu in + hppa*64*) + archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + + case $host_cpu in + hppa*64*|ia64*) + hardcode_direct=no + hardcode_shlibpath_var=no + ;; + *) + hardcode_direct=yes + hardcode_direct_absolute=yes + export_dynamic_flag_spec='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + ;; + esac + fi + ;; + + irix5* | irix6* | nonstopux*) + if test "$GCC" = yes; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + # Try to use the -exported_symbol ld option, if it does not + # work, assume that -exports_file does not work either and + # implicitly export all symbols. + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int foo(void) {} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' + +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS="$save_LDFLAGS" + else + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' + fi + archive_cmds_need_lc='no' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + inherit_rpath=yes + link_all_deplibs=yes + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + newsos6) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_shlibpath_var=no + ;; + + *nto* | *qnx*) + ;; + + openbsd*) + if test -f /usr/libexec/ld.so; then + hardcode_direct=yes + hardcode_shlibpath_var=no + hardcode_direct_absolute=yes + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + export_dynamic_flag_spec='${wl}-E' + else + case $host_os in + openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-R$libdir' + ;; + *) + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + ;; + esac + fi + else + ld_shlibs=no + fi + ;; + + os2*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + allow_undefined_flag=unsupported + archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$ECHO DATA >> $output_objdir/$libname.def~$ECHO " SINGLE NONSHARED" >> $output_objdir/$libname.def~$ECHO EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' + old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' + ;; + + osf3*) + if test "$GCC" = yes; then + allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + allow_undefined_flag=' -expect_unresolved \*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + fi + archive_cmds_need_lc='no' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + ;; + + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test "$GCC" = yes; then + allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + else + allow_undefined_flag=' -expect_unresolved \*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ + $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' + + # Both c and cxx compiler support -rpath directly + hardcode_libdir_flag_spec='-rpath $libdir' + fi + archive_cmds_need_lc='no' + hardcode_libdir_separator=: + ;; + + solaris*) + no_undefined_flag=' -z defs' + if test "$GCC" = yes; then + wlarc='${wl}' + archive_cmds='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + else + case `$CC -V 2>&1` in + *"Compilers 5.0"*) + wlarc='' + archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' + ;; + *) + wlarc='${wl}' + archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + ;; + esac + fi + hardcode_libdir_flag_spec='-R$libdir' + hardcode_shlibpath_var=no + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) + # The compiler driver will combine and reorder linker options, + # but understands `-z linker_flag'. GCC discards it without `$wl', + # but is careful enough not to reorder. + # Supported since Solaris 2.6 (maybe 2.5.1?) + if test "$GCC" = yes; then + whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' + else + whole_archive_flag_spec='-z allextract$convenience -z defaultextract' + fi + ;; + esac + link_all_deplibs=yes + ;; + + sunos4*) + if test "x$host_vendor" = xsequent; then + # Use $CC to link under sequent, because it throws in some extra .o + # files that make .init and .fini sections work. + archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' + fi + hardcode_libdir_flag_spec='-L$libdir' + hardcode_direct=yes + hardcode_minus_L=yes + hardcode_shlibpath_var=no + ;; + + sysv4) + case $host_vendor in + sni) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes # is this really true??? + ;; + siemens) + ## LD is ld it makes a PLAMLIB + ## CC just makes a GrossModule. + archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' + reload_cmds='$CC -r -o $output$reload_objs' + hardcode_direct=no + ;; + motorola) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=no #Motorola manual says yes, but my tests say they lie + ;; + esac + runpath_var='LD_RUN_PATH' + hardcode_shlibpath_var=no + ;; + + sysv4.3*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var=no + export_dynamic_flag_spec='-Bexport' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + ld_shlibs=yes + fi + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) + no_undefined_flag='${wl}-z,text' + archive_cmds_need_lc=no + hardcode_shlibpath_var=no + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + no_undefined_flag='${wl}-z,text' + allow_undefined_flag='${wl}-z,nodefs' + archive_cmds_need_lc=no + hardcode_shlibpath_var=no + hardcode_libdir_flag_spec='${wl}-R,$libdir' + hardcode_libdir_separator=':' + link_all_deplibs=yes + export_dynamic_flag_spec='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + uts4*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_shlibpath_var=no + ;; + + *) + ld_shlibs=no + ;; + esac + + if test x$host_vendor = xsni; then + case $host in + sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + export_dynamic_flag_spec='${wl}-Blargedynsym' + ;; + esac + fi + fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 +$as_echo "$ld_shlibs" >&6; } +test "$ld_shlibs" = no && can_build_shared=no + +with_gnu_ld=$with_gnu_ld + + + + + + + + + + + + + + + +# +# Do we need to explicitly link libc? +# +case "x$archive_cmds_need_lc" in +x|xyes) + # Assume -lc should be added + archive_cmds_need_lc=yes + + if test "$enable_shared" = yes && test "$GCC" = yes; then + case $archive_cmds in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 +$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } + $RM conftest* + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl + pic_flag=$lt_prog_compiler_pic + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$allow_undefined_flag + allow_undefined_flag= + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 + (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + then + archive_cmds_need_lc=no + else + archive_cmds_need_lc=yes + fi + allow_undefined_flag=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $RM conftest* + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $archive_cmds_need_lc" >&5 +$as_echo "$archive_cmds_need_lc" >&6; } + ;; + esac + fi + ;; +esac + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 +$as_echo_n "checking dynamic linker characteristics... " >&6; } + +if test "$GCC" = yes; then + case $host_os in + darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; + *) lt_awk_arg="/^libraries:/" ;; + esac + lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if $ECHO "$lt_search_path_spec" | $GREP ';' >/dev/null ; then + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e 's/;/ /g'` + else + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + # Ok, now we have the path, separated by spaces, we can step through it + # and add multilib dir if necessary. + lt_tmp_lt_search_path_spec= + lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` + for lt_sys_path in $lt_search_path_spec; do + if test -d "$lt_sys_path/$lt_multi_os_dir"; then + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" + else + test -d "$lt_sys_path" && \ + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" + fi + done + lt_search_path_spec=`$ECHO $lt_tmp_lt_search_path_spec | awk ' +BEGIN {RS=" "; FS="/|\n";} { + lt_foo=""; + lt_count=0; + for (lt_i = NF; lt_i > 0; lt_i--) { + if ($lt_i != "" && $lt_i != ".") { + if ($lt_i == "..") { + lt_count++; + } else { + if (lt_count == 0) { + lt_foo="/" $lt_i lt_foo; + } else { + lt_count--; + } + } + } + } + if (lt_foo != "") { lt_freq[lt_foo]++; } + if (lt_freq[lt_foo] == 1) { print lt_foo; } +}'` + sys_lib_search_path_spec=`$ECHO $lt_search_path_spec` +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext_cmds=".so" +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + +case $host_os in +aix3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='${libname}${release}${shared_ext}$major' + ;; + +aix[4-9]*) + version_type=linux + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[01] | aix4.[01].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + case $host_cpu in + powerpc) + # Since July 2007 AmigaOS4 officially supports .so libraries. + # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + ;; + m68k) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$ECHO "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + ;; + esac + ;; + +beos*) + library_names_spec='${libname}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi[45]*) + version_type=linux + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32* | cegcc*) + version_type=windows + shrext_cmds=".dll" + need_version=no + need_lib_prefix=no + + case $GCC,$host_os in + yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*) + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; + fi' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" + ;; + mingw* | cegcc*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then + # It is most probably a Windows format PATH printed by + # mingw gcc, but we are running on Cygwin. Gcc prints its search + # path with ; separators, and with drive letters. We can handle the + # drive letters (cygwin fileutils understands them), so leave them, + # especially as we might pass files found there to a mingw objdump, + # which wouldn't understand a cygwinified path. Ahh. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + ;; + esac + ;; + + *) + library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' + ;; + esac + dynamic_linker='Win32 ld.exe' + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' + soname_spec='${libname}${release}${major}$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' + + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd1*) + dynamic_linker=no + ;; + +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[123]*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[01]* | freebsdelf3.[01]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ + freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + *) # from 4.6 on, and DragonFly + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +gnu*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555. + postinstall_cmds='chmod 555 $lib' + ;; + +interix[3-9]*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +# This must be Linux ELF. +linux* | k*bsd*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + # Some binutils ld are patched to set DT_RUNPATH + save_LDFLAGS=$LDFLAGS + save_libdir=$libdir + eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ + LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : + shlibpath_overrides_runpath=yes +fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS=$save_LDFLAGS + libdir=$save_libdir + + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +*nto* | *qnx*) + version_type=qnx + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='ldqnx.so' + ;; + +openbsd*) + version_type=sunos + sys_lib_dlsearch_path_spec="/usr/lib" + need_lib_prefix=no + # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. + case $host_os in + openbsd3.3 | openbsd3.3.*) need_version=yes ;; + *) need_version=no ;; + esac + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case $host_os in + openbsd2.[89] | openbsd2.[89].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac + else + shlibpath_overrides_runpath=yes + fi + ;; + +os2*) + libname_spec='$name' + shrext_cmds=".dll" + need_lib_prefix=no + library_names_spec='$libname${shared_ext} $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; + +rdos*) + dynamic_linker=no + ;; + +solaris*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux + library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' + soname_spec='$libname${shared_ext}.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=freebsd-elf + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + if test "$with_gnu_ld" = yes; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +tpf*) + # TPF is a cross-target only. Preferred cross-host = GNU/Linux. + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +uts4*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 +$as_echo "$dynamic_linker" >&6; } +test "$dynamic_linker" = no && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test "$GCC" = yes; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + +if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then + sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" +fi +if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then + sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 +$as_echo_n "checking how to hardcode library paths into programs... " >&6; } +hardcode_action= +if test -n "$hardcode_libdir_flag_spec" || + test -n "$runpath_var" || + test "X$hardcode_automatic" = "Xyes" ; then + + # We can hardcode non-existent directories. + if test "$hardcode_direct" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no && + test "$hardcode_minus_L" != no; then + # Linking always hardcodes the temporary library directory. + hardcode_action=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + hardcode_action=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + hardcode_action=unsupported +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 +$as_echo "$hardcode_action" >&6; } + +if test "$hardcode_action" = relink || + test "$inherit_rpath" = yes; then + # Fast installation is not supported + enable_fast_install=no +elif test "$shlibpath_overrides_runpath" = yes || + test "$enable_shared" = no; then + # Fast installation is not necessary + enable_fast_install=needless +fi + + + + + + + if test "x$enable_dlopen" != xyes; then + enable_dlopen=unknown + enable_dlopen_self=unknown + enable_dlopen_self_static=unknown +else + lt_cv_dlopen=no + lt_cv_dlopen_libs= + + case $host_os in + beos*) + lt_cv_dlopen="load_add_on" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ;; + + mingw* | pw32* | cegcc*) + lt_cv_dlopen="LoadLibrary" + lt_cv_dlopen_libs= + ;; + + cygwin*) + lt_cv_dlopen="dlopen" + lt_cv_dlopen_libs= + ;; + + darwin*) + # if libdl is installed we need to link against it + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +$as_echo_n "checking for dlopen in -ldl... " >&6; } +if test "${ac_cv_lib_dl_dlopen+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dl_dlopen=yes +else + ac_cv_lib_dl_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 +$as_echo "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = x""yes; then : + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" +else + + lt_cv_dlopen="dyld" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + +fi + + ;; + + *) + ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" +if test "x$ac_cv_func_shl_load" = x""yes; then : + lt_cv_dlopen="shl_load" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 +$as_echo_n "checking for shl_load in -ldld... " >&6; } +if test "${ac_cv_lib_dld_shl_load+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char shl_load (); +int +main () +{ +return shl_load (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dld_shl_load=yes +else + ac_cv_lib_dld_shl_load=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 +$as_echo "$ac_cv_lib_dld_shl_load" >&6; } +if test "x$ac_cv_lib_dld_shl_load" = x""yes; then : + lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld" +else + ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" +if test "x$ac_cv_func_dlopen" = x""yes; then : + lt_cv_dlopen="dlopen" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +$as_echo_n "checking for dlopen in -ldl... " >&6; } +if test "${ac_cv_lib_dl_dlopen+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dl_dlopen=yes +else + ac_cv_lib_dl_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 +$as_echo "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = x""yes; then : + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 +$as_echo_n "checking for dlopen in -lsvld... " >&6; } +if test "${ac_cv_lib_svld_dlopen+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lsvld $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_svld_dlopen=yes +else + ac_cv_lib_svld_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 +$as_echo "$ac_cv_lib_svld_dlopen" >&6; } +if test "x$ac_cv_lib_svld_dlopen" = x""yes; then : + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 +$as_echo_n "checking for dld_link in -ldld... " >&6; } +if test "${ac_cv_lib_dld_dld_link+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dld_link (); +int +main () +{ +return dld_link (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dld_dld_link=yes +else + ac_cv_lib_dld_dld_link=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 +$as_echo "$ac_cv_lib_dld_dld_link" >&6; } +if test "x$ac_cv_lib_dld_dld_link" = x""yes; then : + lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld" +fi + + +fi + + +fi + + +fi + + +fi + + +fi + + ;; + esac + + if test "x$lt_cv_dlopen" != xno; then + enable_dlopen=yes + else + enable_dlopen=no + fi + + case $lt_cv_dlopen in + dlopen) + save_CPPFLAGS="$CPPFLAGS" + test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" + + save_LDFLAGS="$LDFLAGS" + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" + + save_LIBS="$LIBS" + LIBS="$lt_cv_dlopen_libs $LIBS" + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 +$as_echo_n "checking whether a program can dlopen itself... " >&6; } +if test "${lt_cv_dlopen_self+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + lt_cv_dlopen_self=cross +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +#line 10609 "configure" +#include "confdefs.h" + +#if HAVE_DLFCN_H +#include +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +void fnord() { int i=42;} +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + /* dlclose (self); */ + } + else + puts (dlerror ()); + + return status; +} +_LT_EOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) >&5 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; + x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; + x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self=no + fi +fi +rm -fr conftest* + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 +$as_echo "$lt_cv_dlopen_self" >&6; } + + if test "x$lt_cv_dlopen_self" = xyes; then + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 +$as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } +if test "${lt_cv_dlopen_self_static+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + lt_cv_dlopen_self_static=cross +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +#line 10705 "configure" +#include "confdefs.h" + +#if HAVE_DLFCN_H +#include +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +void fnord() { int i=42;} +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + /* dlclose (self); */ + } + else + puts (dlerror ()); + + return status; +} +_LT_EOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) >&5 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; + x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; + x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self_static=no + fi +fi +rm -fr conftest* + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 +$as_echo "$lt_cv_dlopen_self_static" >&6; } + fi + + CPPFLAGS="$save_CPPFLAGS" + LDFLAGS="$save_LDFLAGS" + LIBS="$save_LIBS" + ;; + esac + + case $lt_cv_dlopen_self in + yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; + *) enable_dlopen_self=unknown ;; + esac + + case $lt_cv_dlopen_self_static in + yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; + *) enable_dlopen_self_static=unknown ;; + esac +fi + + + + + + + + + + + + + + + + + +striplib= +old_striplib= +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 +$as_echo_n "checking whether stripping libraries is possible... " >&6; } +if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then + test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" + test -z "$striplib" && striplib="$STRIP --strip-unneeded" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else +# FIXME - insert some real tests, host_os isn't really good enough + case $host_os in + darwin*) + if test -n "$STRIP" ; then + striplib="$STRIP -x" + old_striplib="$STRIP -S" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + fi + ;; + *) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + ;; + esac +fi + + + + + + + + + + + + + # Report which library types will actually be built + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 +$as_echo_n "checking if libtool supports shared libraries... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 +$as_echo "$can_build_shared" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 +$as_echo_n "checking whether to build shared libraries... " >&6; } + test "$can_build_shared" = "no" && enable_shared=no + + # On AIX, shared libraries and static libraries use the same namespace, and + # are all built from PIC. + case $host_os in + aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + + aix[4-9]*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; + esac + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 +$as_echo "$enable_shared" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 +$as_echo_n "checking whether to build static libraries... " >&6; } + # Make sure either enable_shared or enable_static is yes. + test "$enable_shared" = yes || enable_static=yes + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 +$as_echo "$enable_static" >&6; } + + + + +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +CC="$lt_save_CC" + + + + + + + + + + + + + + ac_config_commands="$ac_config_commands libtool" + + + + +# Only expand once: + + + +# Checks for header files. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } +if test "${ac_cv_header_stdc+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_header_stdc=yes +else + ac_cv_header_stdc=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + return 2; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + +else + ac_cv_header_stdc=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 +$as_echo "$ac_cv_header_stdc" >&6; } +if test $ac_cv_header_stdc = yes; then + +$as_echo "#define STDC_HEADERS 1" >>confdefs.h + +fi + +for ac_header in malloc.h stdlib.h string.h strings.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +eval as_val=\$$as_ac_Header + if test "x$as_val" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +# Checks for typedefs, structures, and compiler characteristics. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 +$as_echo_n "checking for an ANSI C-conforming const... " >&6; } +if test "${ac_cv_c_const+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +/* FIXME: Include the comments suggested by Paul. */ +#ifndef __cplusplus + /* Ultrix mips cc rejects this. */ + typedef int charset[2]; + const charset cs; + /* SunOS 4.1.1 cc rejects this. */ + char const *const *pcpcc; + char **ppc; + /* NEC SVR4.0.2 mips cc rejects this. */ + struct point {int x, y;}; + static struct point const zero = {0,0}; + /* AIX XL C 1.02.0.0 rejects this. + It does not let you subtract one const X* pointer from another in + an arm of an if-expression whose if-part is not a constant + expression */ + const char *g = "string"; + pcpcc = &g + (g ? g-g : 0); + /* HPUX 7.0 cc rejects these. */ + ++pcpcc; + ppc = (char**) pcpcc; + pcpcc = (char const *const *) ppc; + { /* SCO 3.2v4 cc rejects this. */ + char *t; + char const *s = 0 ? (char *) 0 : (char const *) 0; + + *t++ = 0; + if (s) return 0; + } + { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ + int x[] = {25, 17}; + const int *foo = &x[0]; + ++foo; + } + { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ + typedef const int *iptr; + iptr p = 0; + ++p; + } + { /* AIX XL C 1.02.0.0 rejects this saying + "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ + struct s { int j; const int *ap[3]; }; + struct s *b; b->j = 5; + } + { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ + const int foo = 10; + if (!foo) return 0; + } + return !cs[0] && !zero.x; +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_const=yes +else + ac_cv_c_const=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 +$as_echo "$ac_cv_c_const" >&6; } +if test $ac_cv_c_const = no; then + +$as_echo "#define const /**/" >>confdefs.h + +fi + +ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" +if test "x$ac_cv_type_size_t" = x""yes; then : + +else + +cat >>confdefs.h <<_ACEOF +#define size_t unsigned int +_ACEOF + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct tm is in sys/time.h or time.h" >&5 +$as_echo_n "checking whether struct tm is in sys/time.h or time.h... " >&6; } +if test "${ac_cv_struct_tm+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include + +int +main () +{ +struct tm tm; + int *p = &tm.tm_sec; + return !p; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_struct_tm=time.h +else + ac_cv_struct_tm=sys/time.h +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_struct_tm" >&5 +$as_echo "$ac_cv_struct_tm" >&6; } +if test $ac_cv_struct_tm = sys/time.h; then + +$as_echo "#define TM_IN_SYS_TIME 1" >>confdefs.h + +fi + + +# Checks for library functions. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working strtod" >&5 +$as_echo_n "checking for working strtod... " >&6; } +if test "${ac_cv_func_strtod+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + ac_cv_func_strtod=no +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +$ac_includes_default +#ifndef strtod +double strtod (); +#endif +int +main() +{ + { + /* Some versions of Linux strtod mis-parse strings with leading '+'. */ + char *string = " +69"; + char *term; + double value; + value = strtod (string, &term); + if (value != 69 || term != (string + 4)) + return 1; + } + + { + /* Under Solaris 2.4, strtod returns the wrong value for the + terminating character under some conditions. */ + char *string = "NaN"; + char *term; + strtod (string, &term); + if (term != string && *(term - 1) == 0) + return 1; + } + return 0; +} + +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_func_strtod=yes +else + ac_cv_func_strtod=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_strtod" >&5 +$as_echo "$ac_cv_func_strtod" >&6; } +if test $ac_cv_func_strtod = no; then + case " $LIBOBJS " in + *" strtod.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS strtod.$ac_objext" + ;; +esac + +ac_fn_c_check_func "$LINENO" "pow" "ac_cv_func_pow" +if test "x$ac_cv_func_pow" = x""yes; then : + +fi + +if test $ac_cv_func_pow = no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pow in -lm" >&5 +$as_echo_n "checking for pow in -lm... " >&6; } +if test "${ac_cv_lib_m_pow+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lm $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char pow (); +int +main () +{ +return pow (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_m_pow=yes +else + ac_cv_lib_m_pow=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_pow" >&5 +$as_echo "$ac_cv_lib_m_pow" >&6; } +if test "x$ac_cv_lib_m_pow" = x""yes; then : + POW_LIB=-lm +else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cannot find library containing definition of pow" >&5 +$as_echo "$as_me: WARNING: cannot find library containing definition of pow" >&2;} +fi + +fi + +fi + +for ac_func in memset +do : + ac_fn_c_check_func "$LINENO" "memset" "ac_cv_func_memset" +if test "x$ac_cv_func_memset" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_MEMSET 1 +_ACEOF + +else + as_fn_error "memset not found in libc" "$LINENO" 5 +fi +done + +for ac_func in pow +do : + ac_fn_c_check_func "$LINENO" "pow" "ac_cv_func_pow" +if test "x$ac_cv_func_pow" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_POW 1 +_ACEOF + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pow in -lm" >&5 +$as_echo_n "checking for pow in -lm... " >&6; } +if test "${ac_cv_lib_m_pow+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lm $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char pow (); +int +main () +{ +return pow (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_m_pow=yes +else + ac_cv_lib_m_pow=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_pow" >&5 +$as_echo "$ac_cv_lib_m_pow" >&6; } +if test "x$ac_cv_lib_m_pow" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBM 1 +_ACEOF + + LIBS="-lm $LIBS" + +else + as_fn_error "cannot find pow" "$LINENO" 5 +fi + +fi +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for zlibVersion in -lz" >&5 +$as_echo_n "checking for zlibVersion in -lz... " >&6; } +if test "${ac_cv_lib_z_zlibVersion+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lz $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char zlibVersion (); +int +main () +{ +return zlibVersion (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_z_zlibVersion=yes +else + ac_cv_lib_z_zlibVersion=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_zlibVersion" >&5 +$as_echo "$ac_cv_lib_z_zlibVersion" >&6; } +if test "x$ac_cv_lib_z_zlibVersion" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBZ 1 +_ACEOF + + LIBS="-lz $LIBS" + +else + as_fn_error "zlib not installed" "$LINENO" 5 +fi + + +case $host_os in + aix*) + LIBPNG_DEFINES=-DPNG_CONFIGURE_LIBPNG -D_ALL_SOURCE;; + *) + LIBPNG_DEFINES=-DPNG_CONFIGURE_LIBPNG;; +esac +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if assembler code in pnggccrd.c can be compiled without PNG_NO_MMX_CODE" >&5 +$as_echo_n "checking if assembler code in pnggccrd.c can be compiled without PNG_NO_MMX_CODE... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include "$srcdir/pnggccrd.c" +int +main () +{ +return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + LIBPNG_NO_MMX="" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + LIBPNG_NO_MMX=-DPNG_NO_MMX_CODE +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +LIBPNG_DEFINES=$LIBPNG_DEFINES\ $LIBPNG_NO_MMX + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if libraries can be versioned" >&5 +$as_echo_n "checking if libraries can be versioned... " >&6; } +GLD=`$LD --help < /dev/null 2>/dev/null | grep version-script` +if test "$GLD"; then + have_ld_version_script=yes + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + have_ld_version_script=no + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** You have not enabled versioned symbols." >&5 +$as_echo "$as_me: WARNING: *** You have not enabled versioned symbols." >&2;} +fi + if test "$have_ld_version_script" = "yes"; then + HAVE_LD_VERSION_SCRIPT_TRUE= + HAVE_LD_VERSION_SCRIPT_FALSE='#' +else + HAVE_LD_VERSION_SCRIPT_TRUE='#' + HAVE_LD_VERSION_SCRIPT_FALSE= +fi + + +if test "$have_ld_version_script" = "yes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for symbol prefix" >&5 +$as_echo_n "checking for symbol prefix... " >&6; } + SYMBOL_PREFIX=`echo "PREFIX=__USER_LABEL_PREFIX__" \ + | ${CPP-${CC-gcc} -E} - 2>&1 \ + | ${EGREP-grep} "^PREFIX=" \ + | ${SED-sed} "s:^PREFIX=::"` + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SYMBOL_PREFIX" >&5 +$as_echo "$SYMBOL_PREFIX" >&6; } +fi + +# Substitutions for .in files + + + + + +# Additional arguments (and substitutions) +# Allow the pkg-config directory to be set + +# Check whether --with-pkgconfigdir was given. +if test "${with_pkgconfigdir+set}" = set; then : + withval=$with_pkgconfigdir; pkgconfigdir=${withval} +else + pkgconfigdir='${libdir}/pkgconfig' +fi + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: pkgconfig directory is ${pkgconfigdir}" >&5 +$as_echo "$as_me: pkgconfig directory is ${pkgconfigdir}" >&6;} + +# Make the *-config binary config scripts optional + +# Check whether --with-binconfigs was given. +if test "${with_binconfigs+set}" = set; then : + withval=$with_binconfigs; if test "${withval}" = no; then + binconfigs= + { $as_echo "$as_me:${as_lineno-$LINENO}: libpng-config scripts will not be built" >&5 +$as_echo "$as_me: libpng-config scripts will not be built" >&6;} + else + binconfigs='${binconfigs}' + fi +else + binconfigs='${binconfigs}' +fi + + + +# Allow the old version number library, libpng.so, to be removed from +# the build + +# Check whether --with-libpng-compat was given. +if test "${with_libpng_compat+set}" = set; then : + withval=$with_libpng_compat; if test "${withval}" = no; then + compatlib= + { $as_echo "$as_me:${as_lineno-$LINENO}: libpng.so will not be built" >&5 +$as_echo "$as_me: libpng.so will not be built" >&6;} + else + compatlib=libpng.la + fi +else + compatlib=libpng.la +fi + + + +# Config files, substituting as above +ac_config_files="$ac_config_files Makefile libpng.pc:scripts/libpng.pc-configure.in" + +ac_config_files="$ac_config_files libpng-config:scripts/libpng-config.in" + + +cat >confcache <<\_ACEOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. +# +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. +# +# `ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* `ac_cv_foo' will be assigned the +# following values. + +_ACEOF + +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, we kill variables containing newlines. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +( + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + + (set) 2>&1 | + case $as_nl`(ac_space=' '; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + # `set' does not quote correctly, so add quotes: double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \. + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; #( + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) | + sed ' + /^ac_cv_env_/b end + t clear + :clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + :end' >>confcache +if diff "$cache_file" confcache >/dev/null 2>&1; then :; else + if test -w "$cache_file"; then + test "x$cache_file" != "x/dev/null" && + { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 +$as_echo "$as_me: updating cache $cache_file" >&6;} + cat confcache >$cache_file + else + { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 +$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} + fi +fi +rm -f confcache + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +DEFS=-DHAVE_CONFIG_H + +ac_libobjs= +ac_ltlibobjs= +for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' + ac_i=`$as_echo "$ac_i" | sed "$ac_script"` + # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR + # will be set to the directory where LIBOBJS objects are built. + as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" + as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' +done +LIBOBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + + if test -n "$EXEEXT"; then + am__EXEEXT_TRUE= + am__EXEEXT_FALSE='#' +else + am__EXEEXT_TRUE='#' + am__EXEEXT_FALSE= +fi + +if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then + as_fn_error "conditional \"MAINTAINER_MODE\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then + as_fn_error "conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then + as_fn_error "conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_LD_VERSION_SCRIPT_TRUE}" && test -z "${HAVE_LD_VERSION_SCRIPT_FALSE}"; then + as_fn_error "conditional \"HAVE_LD_VERSION_SCRIPT\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi + +: ${CONFIG_STATUS=./config.status} +ac_write_fail=0 +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 +$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} +as_write_fail=0 +cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 +#! $SHELL +# Generated by $as_me. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +ac_cs_recheck=false +ac_cs_silent=false + +SHELL=\${CONFIG_SHELL-$SHELL} +export SHELL +_ASEOF +cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + + +# as_fn_error ERROR [LINENO LOG_FD] +# --------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with status $?, using 1 if that was 0. +as_fn_error () +{ + as_status=$?; test $as_status -eq 0 && as_status=1 + if test "$3"; then + as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3 + fi + $as_echo "$as_me: error: $1" >&2 + as_fn_exit $as_status +} # as_fn_error + + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -p' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -p' + fi +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error "cannot create directory $as_dir" + + +} # as_fn_mkdir_p +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +if test -x / >/dev/null 2>&1; then + as_test_x='test -x' +else + if ls -dL / >/dev/null 2>&1; then + as_ls_L_option=L + else + as_ls_L_option= + fi + as_test_x=' + eval sh -c '\'' + if test -d "$1"; then + test -d "$1/."; + else + case $1 in #( + -*)set "./$1";; + esac; + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( + ???[sx]*):;;*)false;;esac;fi + '\'' sh + ' +fi +as_executable_p=$as_test_x + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +exec 6>&1 +## ----------------------------------- ## +## Main body of $CONFIG_STATUS script. ## +## ----------------------------------- ## +_ASEOF +test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# Save the log message, to keep $0 and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. +ac_log=" +This file was extended by libpng $as_me 1.2.49, which was +generated by GNU Autoconf 2.65. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + +_ACEOF + +case $ac_config_files in *" +"*) set x $ac_config_files; shift; ac_config_files=$*;; +esac + +case $ac_config_headers in *" +"*) set x $ac_config_headers; shift; ac_config_headers=$*;; +esac + + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# Files that config.status was made for. +config_files="$ac_config_files" +config_headers="$ac_config_headers" +config_commands="$ac_config_commands" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +ac_cs_usage="\ +\`$as_me' instantiates files and other configuration actions +from templates according to the current configuration. Unless the files +and actions are specified as TAGs, all are instantiated by default. + +Usage: $0 [OPTION]... [TAG]... + + -h, --help print this help, then exit + -V, --version print version number and configuration settings, then exit + --config print configuration, then exit + -q, --quiet, --silent + do not print progress messages + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE + +Configuration files: +$config_files + +Configuration headers: +$config_headers + +Configuration commands: +$config_commands + +Report bugs to ." + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" +ac_cs_version="\\ +libpng config.status 1.2.49 +configured by $0, generated by GNU Autoconf 2.65, + with options \\"\$ac_cs_config\\" + +Copyright (C) 2009 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." + +ac_pwd='$ac_pwd' +srcdir='$srcdir' +INSTALL='$INSTALL' +MKDIR_P='$MKDIR_P' +AWK='$AWK' +test -n "\$AWK" || AWK=awk +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# The default lists apply if the user does not specify any file. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=*) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` + ac_shift=: + ;; + *) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + esac + + case $ac_option in + # Handling of the options. + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + $as_echo "$ac_cs_version"; exit ;; + --config | --confi | --conf | --con | --co | --c ) + $as_echo "$ac_cs_config"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + as_fn_append CONFIG_FILES " '$ac_optarg'" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + as_fn_append CONFIG_HEADERS " '$ac_optarg'" + ac_need_defaults=false;; + --he | --h) + # Conflict between --help and --header + as_fn_error "ambiguous option: \`$1' +Try \`$0 --help' for more information.";; + --help | --hel | -h ) + $as_echo "$ac_cs_usage"; exit ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) as_fn_error "unrecognized option: \`$1' +Try \`$0 --help' for more information." ;; + + *) as_fn_append ac_config_targets " $1" + ac_need_defaults=false ;; + + esac + shift +done + +ac_configure_extra_args= + +if $ac_cs_silent; then + exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +if \$ac_cs_recheck; then + set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + shift + \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 + CONFIG_SHELL='$SHELL' + export CONFIG_SHELL + exec "\$@" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX + $as_echo "$ac_log" +} >&5 + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# +# INIT-COMMANDS +# +AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" + + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +sed_quote_subst='$sed_quote_subst' +double_quote_subst='$double_quote_subst' +delay_variable_subst='$delay_variable_subst' +SED='`$ECHO "X$SED" | $Xsed -e "$delay_single_quote_subst"`' +Xsed='`$ECHO "X$Xsed" | $Xsed -e "$delay_single_quote_subst"`' +GREP='`$ECHO "X$GREP" | $Xsed -e "$delay_single_quote_subst"`' +EGREP='`$ECHO "X$EGREP" | $Xsed -e "$delay_single_quote_subst"`' +FGREP='`$ECHO "X$FGREP" | $Xsed -e "$delay_single_quote_subst"`' +LD='`$ECHO "X$LD" | $Xsed -e "$delay_single_quote_subst"`' +AS='`$ECHO "X$AS" | $Xsed -e "$delay_single_quote_subst"`' +DLLTOOL='`$ECHO "X$DLLTOOL" | $Xsed -e "$delay_single_quote_subst"`' +OBJDUMP='`$ECHO "X$OBJDUMP" | $Xsed -e "$delay_single_quote_subst"`' +macro_version='`$ECHO "X$macro_version" | $Xsed -e "$delay_single_quote_subst"`' +macro_revision='`$ECHO "X$macro_revision" | $Xsed -e "$delay_single_quote_subst"`' +enable_shared='`$ECHO "X$enable_shared" | $Xsed -e "$delay_single_quote_subst"`' +enable_static='`$ECHO "X$enable_static" | $Xsed -e "$delay_single_quote_subst"`' +pic_mode='`$ECHO "X$pic_mode" | $Xsed -e "$delay_single_quote_subst"`' +enable_fast_install='`$ECHO "X$enable_fast_install" | $Xsed -e "$delay_single_quote_subst"`' +host_alias='`$ECHO "X$host_alias" | $Xsed -e "$delay_single_quote_subst"`' +host='`$ECHO "X$host" | $Xsed -e "$delay_single_quote_subst"`' +host_os='`$ECHO "X$host_os" | $Xsed -e "$delay_single_quote_subst"`' +build_alias='`$ECHO "X$build_alias" | $Xsed -e "$delay_single_quote_subst"`' +build='`$ECHO "X$build" | $Xsed -e "$delay_single_quote_subst"`' +build_os='`$ECHO "X$build_os" | $Xsed -e "$delay_single_quote_subst"`' +NM='`$ECHO "X$NM" | $Xsed -e "$delay_single_quote_subst"`' +LN_S='`$ECHO "X$LN_S" | $Xsed -e "$delay_single_quote_subst"`' +max_cmd_len='`$ECHO "X$max_cmd_len" | $Xsed -e "$delay_single_quote_subst"`' +ac_objext='`$ECHO "X$ac_objext" | $Xsed -e "$delay_single_quote_subst"`' +exeext='`$ECHO "X$exeext" | $Xsed -e "$delay_single_quote_subst"`' +lt_unset='`$ECHO "X$lt_unset" | $Xsed -e "$delay_single_quote_subst"`' +lt_SP2NL='`$ECHO "X$lt_SP2NL" | $Xsed -e "$delay_single_quote_subst"`' +lt_NL2SP='`$ECHO "X$lt_NL2SP" | $Xsed -e "$delay_single_quote_subst"`' +reload_flag='`$ECHO "X$reload_flag" | $Xsed -e "$delay_single_quote_subst"`' +reload_cmds='`$ECHO "X$reload_cmds" | $Xsed -e "$delay_single_quote_subst"`' +deplibs_check_method='`$ECHO "X$deplibs_check_method" | $Xsed -e "$delay_single_quote_subst"`' +file_magic_cmd='`$ECHO "X$file_magic_cmd" | $Xsed -e "$delay_single_quote_subst"`' +AR='`$ECHO "X$AR" | $Xsed -e "$delay_single_quote_subst"`' +AR_FLAGS='`$ECHO "X$AR_FLAGS" | $Xsed -e "$delay_single_quote_subst"`' +STRIP='`$ECHO "X$STRIP" | $Xsed -e "$delay_single_quote_subst"`' +RANLIB='`$ECHO "X$RANLIB" | $Xsed -e "$delay_single_quote_subst"`' +old_postinstall_cmds='`$ECHO "X$old_postinstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' +old_postuninstall_cmds='`$ECHO "X$old_postuninstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' +old_archive_cmds='`$ECHO "X$old_archive_cmds" | $Xsed -e "$delay_single_quote_subst"`' +CC='`$ECHO "X$CC" | $Xsed -e "$delay_single_quote_subst"`' +CFLAGS='`$ECHO "X$CFLAGS" | $Xsed -e "$delay_single_quote_subst"`' +compiler='`$ECHO "X$compiler" | $Xsed -e "$delay_single_quote_subst"`' +GCC='`$ECHO "X$GCC" | $Xsed -e "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_pipe='`$ECHO "X$lt_cv_sys_global_symbol_pipe" | $Xsed -e "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_cdecl='`$ECHO "X$lt_cv_sys_global_symbol_to_cdecl" | $Xsed -e "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "X$lt_cv_sys_global_symbol_to_c_name_address" | $Xsed -e "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "X$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $Xsed -e "$delay_single_quote_subst"`' +objdir='`$ECHO "X$objdir" | $Xsed -e "$delay_single_quote_subst"`' +SHELL='`$ECHO "X$SHELL" | $Xsed -e "$delay_single_quote_subst"`' +ECHO='`$ECHO "X$ECHO" | $Xsed -e "$delay_single_quote_subst"`' +MAGIC_CMD='`$ECHO "X$MAGIC_CMD" | $Xsed -e "$delay_single_quote_subst"`' +lt_prog_compiler_no_builtin_flag='`$ECHO "X$lt_prog_compiler_no_builtin_flag" | $Xsed -e "$delay_single_quote_subst"`' +lt_prog_compiler_wl='`$ECHO "X$lt_prog_compiler_wl" | $Xsed -e "$delay_single_quote_subst"`' +lt_prog_compiler_pic='`$ECHO "X$lt_prog_compiler_pic" | $Xsed -e "$delay_single_quote_subst"`' +lt_prog_compiler_static='`$ECHO "X$lt_prog_compiler_static" | $Xsed -e "$delay_single_quote_subst"`' +lt_cv_prog_compiler_c_o='`$ECHO "X$lt_cv_prog_compiler_c_o" | $Xsed -e "$delay_single_quote_subst"`' +need_locks='`$ECHO "X$need_locks" | $Xsed -e "$delay_single_quote_subst"`' +DSYMUTIL='`$ECHO "X$DSYMUTIL" | $Xsed -e "$delay_single_quote_subst"`' +NMEDIT='`$ECHO "X$NMEDIT" | $Xsed -e "$delay_single_quote_subst"`' +LIPO='`$ECHO "X$LIPO" | $Xsed -e "$delay_single_quote_subst"`' +OTOOL='`$ECHO "X$OTOOL" | $Xsed -e "$delay_single_quote_subst"`' +OTOOL64='`$ECHO "X$OTOOL64" | $Xsed -e "$delay_single_quote_subst"`' +libext='`$ECHO "X$libext" | $Xsed -e "$delay_single_quote_subst"`' +shrext_cmds='`$ECHO "X$shrext_cmds" | $Xsed -e "$delay_single_quote_subst"`' +extract_expsyms_cmds='`$ECHO "X$extract_expsyms_cmds" | $Xsed -e "$delay_single_quote_subst"`' +archive_cmds_need_lc='`$ECHO "X$archive_cmds_need_lc" | $Xsed -e "$delay_single_quote_subst"`' +enable_shared_with_static_runtimes='`$ECHO "X$enable_shared_with_static_runtimes" | $Xsed -e "$delay_single_quote_subst"`' +export_dynamic_flag_spec='`$ECHO "X$export_dynamic_flag_spec" | $Xsed -e "$delay_single_quote_subst"`' +whole_archive_flag_spec='`$ECHO "X$whole_archive_flag_spec" | $Xsed -e "$delay_single_quote_subst"`' +compiler_needs_object='`$ECHO "X$compiler_needs_object" | $Xsed -e "$delay_single_quote_subst"`' +old_archive_from_new_cmds='`$ECHO "X$old_archive_from_new_cmds" | $Xsed -e "$delay_single_quote_subst"`' +old_archive_from_expsyms_cmds='`$ECHO "X$old_archive_from_expsyms_cmds" | $Xsed -e "$delay_single_quote_subst"`' +archive_cmds='`$ECHO "X$archive_cmds" | $Xsed -e "$delay_single_quote_subst"`' +archive_expsym_cmds='`$ECHO "X$archive_expsym_cmds" | $Xsed -e "$delay_single_quote_subst"`' +module_cmds='`$ECHO "X$module_cmds" | $Xsed -e "$delay_single_quote_subst"`' +module_expsym_cmds='`$ECHO "X$module_expsym_cmds" | $Xsed -e "$delay_single_quote_subst"`' +with_gnu_ld='`$ECHO "X$with_gnu_ld" | $Xsed -e "$delay_single_quote_subst"`' +allow_undefined_flag='`$ECHO "X$allow_undefined_flag" | $Xsed -e "$delay_single_quote_subst"`' +no_undefined_flag='`$ECHO "X$no_undefined_flag" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec='`$ECHO "X$hardcode_libdir_flag_spec" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec_ld='`$ECHO "X$hardcode_libdir_flag_spec_ld" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_libdir_separator='`$ECHO "X$hardcode_libdir_separator" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_direct='`$ECHO "X$hardcode_direct" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_direct_absolute='`$ECHO "X$hardcode_direct_absolute" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_minus_L='`$ECHO "X$hardcode_minus_L" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_shlibpath_var='`$ECHO "X$hardcode_shlibpath_var" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_automatic='`$ECHO "X$hardcode_automatic" | $Xsed -e "$delay_single_quote_subst"`' +inherit_rpath='`$ECHO "X$inherit_rpath" | $Xsed -e "$delay_single_quote_subst"`' +link_all_deplibs='`$ECHO "X$link_all_deplibs" | $Xsed -e "$delay_single_quote_subst"`' +fix_srcfile_path='`$ECHO "X$fix_srcfile_path" | $Xsed -e "$delay_single_quote_subst"`' +always_export_symbols='`$ECHO "X$always_export_symbols" | $Xsed -e "$delay_single_quote_subst"`' +export_symbols_cmds='`$ECHO "X$export_symbols_cmds" | $Xsed -e "$delay_single_quote_subst"`' +exclude_expsyms='`$ECHO "X$exclude_expsyms" | $Xsed -e "$delay_single_quote_subst"`' +include_expsyms='`$ECHO "X$include_expsyms" | $Xsed -e "$delay_single_quote_subst"`' +prelink_cmds='`$ECHO "X$prelink_cmds" | $Xsed -e "$delay_single_quote_subst"`' +file_list_spec='`$ECHO "X$file_list_spec" | $Xsed -e "$delay_single_quote_subst"`' +variables_saved_for_relink='`$ECHO "X$variables_saved_for_relink" | $Xsed -e "$delay_single_quote_subst"`' +need_lib_prefix='`$ECHO "X$need_lib_prefix" | $Xsed -e "$delay_single_quote_subst"`' +need_version='`$ECHO "X$need_version" | $Xsed -e "$delay_single_quote_subst"`' +version_type='`$ECHO "X$version_type" | $Xsed -e "$delay_single_quote_subst"`' +runpath_var='`$ECHO "X$runpath_var" | $Xsed -e "$delay_single_quote_subst"`' +shlibpath_var='`$ECHO "X$shlibpath_var" | $Xsed -e "$delay_single_quote_subst"`' +shlibpath_overrides_runpath='`$ECHO "X$shlibpath_overrides_runpath" | $Xsed -e "$delay_single_quote_subst"`' +libname_spec='`$ECHO "X$libname_spec" | $Xsed -e "$delay_single_quote_subst"`' +library_names_spec='`$ECHO "X$library_names_spec" | $Xsed -e "$delay_single_quote_subst"`' +soname_spec='`$ECHO "X$soname_spec" | $Xsed -e "$delay_single_quote_subst"`' +postinstall_cmds='`$ECHO "X$postinstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' +postuninstall_cmds='`$ECHO "X$postuninstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' +finish_cmds='`$ECHO "X$finish_cmds" | $Xsed -e "$delay_single_quote_subst"`' +finish_eval='`$ECHO "X$finish_eval" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_into_libs='`$ECHO "X$hardcode_into_libs" | $Xsed -e "$delay_single_quote_subst"`' +sys_lib_search_path_spec='`$ECHO "X$sys_lib_search_path_spec" | $Xsed -e "$delay_single_quote_subst"`' +sys_lib_dlsearch_path_spec='`$ECHO "X$sys_lib_dlsearch_path_spec" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_action='`$ECHO "X$hardcode_action" | $Xsed -e "$delay_single_quote_subst"`' +enable_dlopen='`$ECHO "X$enable_dlopen" | $Xsed -e "$delay_single_quote_subst"`' +enable_dlopen_self='`$ECHO "X$enable_dlopen_self" | $Xsed -e "$delay_single_quote_subst"`' +enable_dlopen_self_static='`$ECHO "X$enable_dlopen_self_static" | $Xsed -e "$delay_single_quote_subst"`' +old_striplib='`$ECHO "X$old_striplib" | $Xsed -e "$delay_single_quote_subst"`' +striplib='`$ECHO "X$striplib" | $Xsed -e "$delay_single_quote_subst"`' + +LTCC='$LTCC' +LTCFLAGS='$LTCFLAGS' +compiler='$compiler_DEFAULT' + +# Quote evaled strings. +for var in SED \ +GREP \ +EGREP \ +FGREP \ +LD \ +NM \ +LN_S \ +lt_SP2NL \ +lt_NL2SP \ +reload_flag \ +deplibs_check_method \ +file_magic_cmd \ +AR \ +AR_FLAGS \ +STRIP \ +RANLIB \ +CC \ +CFLAGS \ +compiler \ +lt_cv_sys_global_symbol_pipe \ +lt_cv_sys_global_symbol_to_cdecl \ +lt_cv_sys_global_symbol_to_c_name_address \ +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ +SHELL \ +ECHO \ +lt_prog_compiler_no_builtin_flag \ +lt_prog_compiler_wl \ +lt_prog_compiler_pic \ +lt_prog_compiler_static \ +lt_cv_prog_compiler_c_o \ +need_locks \ +DSYMUTIL \ +NMEDIT \ +LIPO \ +OTOOL \ +OTOOL64 \ +shrext_cmds \ +export_dynamic_flag_spec \ +whole_archive_flag_spec \ +compiler_needs_object \ +with_gnu_ld \ +allow_undefined_flag \ +no_undefined_flag \ +hardcode_libdir_flag_spec \ +hardcode_libdir_flag_spec_ld \ +hardcode_libdir_separator \ +fix_srcfile_path \ +exclude_expsyms \ +include_expsyms \ +file_list_spec \ +variables_saved_for_relink \ +libname_spec \ +library_names_spec \ +soname_spec \ +finish_eval \ +old_striplib \ +striplib; do + case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in + *[\\\\\\\`\\"\\\$]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +# Double-quote double-evaled strings. +for var in reload_cmds \ +old_postinstall_cmds \ +old_postuninstall_cmds \ +old_archive_cmds \ +extract_expsyms_cmds \ +old_archive_from_new_cmds \ +old_archive_from_expsyms_cmds \ +archive_cmds \ +archive_expsym_cmds \ +module_cmds \ +module_expsym_cmds \ +export_symbols_cmds \ +prelink_cmds \ +postinstall_cmds \ +postuninstall_cmds \ +finish_cmds \ +sys_lib_search_path_spec \ +sys_lib_dlsearch_path_spec; do + case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in + *[\\\\\\\`\\"\\\$]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +# Fix-up fallback echo if it was mangled by the above quoting rules. +case \$lt_ECHO in +*'\\\$0 --fallback-echo"') lt_ECHO=\`\$ECHO "X\$lt_ECHO" | \$Xsed -e 's/\\\\\\\\\\\\\\\$0 --fallback-echo"\$/\$0 --fallback-echo"/'\` + ;; +esac + +ac_aux_dir='$ac_aux_dir' +xsi_shell='$xsi_shell' +lt_shell_append='$lt_shell_append' + +# See if we are running on zsh, and set the options which allow our +# commands through without removal of \ escapes INIT. +if test -n "\${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST +fi + + + PACKAGE='$PACKAGE' + VERSION='$VERSION' + TIMESTAMP='$TIMESTAMP' + RM='$RM' + ofile='$ofile' + + + + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + +# Handling of arguments. +for ac_config_target in $ac_config_targets +do + case $ac_config_target in + "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; + "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; + "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "libpng.pc") CONFIG_FILES="$CONFIG_FILES libpng.pc:scripts/libpng.pc-configure.in" ;; + "libpng-config") CONFIG_FILES="$CONFIG_FILES libpng-config:scripts/libpng-config.in" ;; + + *) as_fn_error "invalid argument: \`$ac_config_target'" "$LINENO" 5;; + esac +done + + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files + test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers + test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason against having it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to `$tmp'. +$debug || +{ + tmp= + trap 'exit_status=$? + { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status +' 0 + trap 'as_fn_exit 1' 1 2 13 15 +} +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && + test -n "$tmp" && test -d "$tmp" +} || +{ + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") +} || as_fn_error "cannot create a temporary directory in ." "$LINENO" 5 + +# Set up the scripts for CONFIG_FILES section. +# No need to generate them if there are no CONFIG_FILES. +# This happens for instance with `./config.status config.h'. +if test -n "$CONFIG_FILES"; then + + +ac_cr=`echo X | tr X '\015'` +# On cygwin, bash can eat \r inside `` if the user requested igncr. +# But we know of no other shell where ac_cr would be empty at this +# point, so we can use a bashism as a fallback. +if test "x$ac_cr" = x; then + eval ac_cr=\$\'\\r\' +fi +ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` +if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then + ac_cs_awk_cr='\r' +else + ac_cs_awk_cr=$ac_cr +fi + +echo 'BEGIN {' >"$tmp/subs1.awk" && +_ACEOF + + +{ + echo "cat >conf$$subs.awk <<_ACEOF" && + echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && + echo "_ACEOF" +} >conf$$subs.sh || + as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5 +ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'` +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + . ./conf$$subs.sh || + as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5 + + ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` + if test $ac_delim_n = $ac_delim_num; then + break + elif $ac_last_try; then + as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done +rm -f conf$$subs.sh + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>"\$tmp/subs1.awk" <<\\_ACAWK && +_ACEOF +sed -n ' +h +s/^/S["/; s/!.*/"]=/ +p +g +s/^[^!]*!// +:repl +t repl +s/'"$ac_delim"'$// +t delim +:nl +h +s/\(.\{148\}\)..*/\1/ +t more1 +s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ +p +n +b repl +:more1 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t nl +:delim +h +s/\(.\{148\}\)..*/\1/ +t more2 +s/["\\]/\\&/g; s/^/"/; s/$/"/ +p +b +:more2 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t delim +' >$CONFIG_STATUS || ac_write_fail=1 +rm -f conf$$subs.awk +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACAWK +cat >>"\$tmp/subs1.awk" <<_ACAWK && + for (key in S) S_is_set[key] = 1 + FS = "" + +} +{ + line = $ 0 + nfields = split(line, field, "@") + substed = 0 + len = length(field[1]) + for (i = 2; i < nfields; i++) { + key = field[i] + keylen = length(key) + if (S_is_set[key]) { + value = S[key] + line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) + len += length(value) + length(field[++i]) + substed = 1 + } else + len += 1 + keylen + } + + print line +} + +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then + sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" +else + cat +fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \ + || as_fn_error "could not setup config files machinery" "$LINENO" 5 +_ACEOF + +# VPATH may cause trouble with some makes, so we remove $(srcdir), +# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=/{ +s/:*\$(srcdir):*/:/ +s/:*\${srcdir}:*/:/ +s/:*@srcdir@:*/:/ +s/^\([^=]*=[ ]*\):*/\1/ +s/:*$// +s/^[^=]*=[ ]*$// +}' +fi + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +fi # test -n "$CONFIG_FILES" + +# Set up the scripts for CONFIG_HEADERS section. +# No need to generate them if there are no CONFIG_HEADERS. +# This happens for instance with `./config.status Makefile'. +if test -n "$CONFIG_HEADERS"; then +cat >"$tmp/defines.awk" <<\_ACAWK || +BEGIN { +_ACEOF + +# Transform confdefs.h into an awk script `defines.awk', embedded as +# here-document in config.status, that substitutes the proper values into +# config.h.in to produce config.h. + +# Create a delimiter string that does not exist in confdefs.h, to ease +# handling of long lines. +ac_delim='%!_!# ' +for ac_last_try in false false :; do + ac_t=`sed -n "/$ac_delim/p" confdefs.h` + if test -z "$ac_t"; then + break + elif $ac_last_try; then + as_fn_error "could not make $CONFIG_HEADERS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done + +# For the awk script, D is an array of macro values keyed by name, +# likewise P contains macro parameters if any. Preserve backslash +# newline sequences. + +ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* +sed -n ' +s/.\{148\}/&'"$ac_delim"'/g +t rset +:rset +s/^[ ]*#[ ]*define[ ][ ]*/ / +t def +d +:def +s/\\$// +t bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3"/p +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p +d +:bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3\\\\\\n"\\/p +t cont +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p +t cont +d +:cont +n +s/.\{148\}/&'"$ac_delim"'/g +t clear +:clear +s/\\$// +t bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/"/p +d +:bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p +b cont +' >$CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + for (key in D) D_is_set[key] = 1 + FS = "" +} +/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { + line = \$ 0 + split(line, arg, " ") + if (arg[1] == "#") { + defundef = arg[2] + mac1 = arg[3] + } else { + defundef = substr(arg[1], 2) + mac1 = arg[2] + } + split(mac1, mac2, "(") #) + macro = mac2[1] + prefix = substr(line, 1, index(line, defundef) - 1) + if (D_is_set[macro]) { + # Preserve the white space surrounding the "#". + print prefix "define", macro P[macro] D[macro] + next + } else { + # Replace #undef with comments. This is necessary, for example, + # in the case of _POSIX_SOURCE, which is predefined and required + # on some systems where configure will not decide to define it. + if (defundef == "undef") { + print "/*", prefix defundef, macro, "*/" + next + } + } +} +{ print } +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + as_fn_error "could not setup config headers machinery" "$LINENO" 5 +fi # test -n "$CONFIG_HEADERS" + + +eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" +shift +for ac_tag +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) as_fn_error "invalid tag \`$ac_tag'" "$LINENO" 5;; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + as_fn_error "cannot find input file: \`$ac_f'" "$LINENO" 5;; + esac + case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + as_fn_append ac_file_inputs " '$ac_f'" + done + + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + configure_input='Generated from '` + $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + `' by configure.' + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 +$as_echo "$as_me: creating $ac_file" >&6;} + fi + # Neutralize special characters interpreted by sed in replacement strings. + case $configure_input in #( + *\&* | *\|* | *\\* ) + ac_sed_conf_input=`$as_echo "$configure_input" | + sed 's/[\\\\&|]/\\\\&/g'`;; #( + *) ac_sed_conf_input=$configure_input;; + esac + + case $ac_tag in + *:-:* | *:-) cat >"$tmp/stdin" \ + || as_fn_error "could not create $ac_file" "$LINENO" 5 ;; + esac + ;; + esac + + ac_dir=`$as_dirname -- "$ac_file" || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir="$ac_dir"; as_fn_mkdir_p + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + + case $ac_mode in + :F) + # + # CONFIG_FILE + # + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; + esac + ac_MKDIR_P=$MKDIR_P + case $MKDIR_P in + [\\/$]* | ?:[\\/]* ) ;; + */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; + esac +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= +ac_sed_dataroot=' +/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p' +case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + ac_datarootdir_hack=' + s&@datadir@&$datadir&g + s&@docdir@&$docdir&g + s&@infodir@&$infodir&g + s&@localedir@&$localedir&g + s&@mandir@&$mandir&g + s&\\\${datarootdir}&$datarootdir&g' ;; +esac +_ACEOF + +# Neutralize VPATH when `$srcdir' = `.'. +# Shell code in configure.ac might set extrasub. +# FIXME: do we really want to maintain this feature? +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_sed_extra="$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s|@configure_input@|$ac_sed_conf_input|;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@top_build_prefix@&$ac_top_build_prefix&;t t +s&@srcdir@&$ac_srcdir&;t t +s&@abs_srcdir@&$ac_abs_srcdir&;t t +s&@top_srcdir@&$ac_top_srcdir&;t t +s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t +s&@builddir@&$ac_builddir&;t t +s&@abs_builddir@&$ac_abs_builddir&;t t +s&@abs_top_builddir@&$ac_abs_top_builddir&;t t +s&@INSTALL@&$ac_INSTALL&;t t +s&@MKDIR_P@&$ac_MKDIR_P&;t t +$ac_datarootdir_hack +" +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \ + || as_fn_error "could not create $ac_file" "$LINENO" 5 + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined." >&5 +$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined." >&2;} + + rm -f "$tmp/stdin" + case $ac_file in + -) cat "$tmp/out" && rm -f "$tmp/out";; + *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";; + esac \ + || as_fn_error "could not create $ac_file" "$LINENO" 5 + ;; + :H) + # + # CONFIG_HEADER + # + if test x"$ac_file" != x-; then + { + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" + } >"$tmp/config.h" \ + || as_fn_error "could not create $ac_file" "$LINENO" 5 + if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then + { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 +$as_echo "$as_me: $ac_file is unchanged" >&6;} + else + rm -f "$ac_file" + mv "$tmp/config.h" "$ac_file" \ + || as_fn_error "could not create $ac_file" "$LINENO" 5 + fi + else + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \ + || as_fn_error "could not create -" "$LINENO" 5 + fi +# Compute "$ac_file"'s index in $config_headers. +_am_arg="$ac_file" +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $_am_arg | $_am_arg:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || +$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$_am_arg" : 'X\(//\)[^/]' \| \ + X"$_am_arg" : 'X\(//\)$' \| \ + X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$_am_arg" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'`/stamp-h$_am_stamp_count + ;; + + :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 +$as_echo "$as_me: executing $ac_file commands" >&6;} + ;; + esac + + + case $ac_file$ac_mode in + "depfiles":C) test x"$AMDEP_TRUE" != x"" || { + # Autoconf 2.62 quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + case $CONFIG_FILES in + *\'*) eval set x "$CONFIG_FILES" ;; + *) set x $CONFIG_FILES ;; + esac + shift + for mf + do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named `Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then + dirpart=`$as_dirname -- "$mf" || +$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$mf" : 'X\(//\)[^/]' \| \ + X"$mf" : 'X\(//\)$' \| \ + X"$mf" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$mf" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running `make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n 's/^U = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`$as_dirname -- "$file" || +$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$file" : 'X\(//\)[^/]' \| \ + X"$file" : 'X\(//\)$' \| \ + X"$file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir=$dirpart/$fdir; as_fn_mkdir_p + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done + done +} + ;; + "libtool":C) + + # See if we are running on zsh, and set the options which allow our + # commands through without removal of \ escapes. + if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST + fi + + cfgfile="${ofile}T" + trap "$RM \"$cfgfile\"; exit 1" 1 2 15 + $RM "$cfgfile" + + cat <<_LT_EOF >> "$cfgfile" +#! $SHELL + +# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. +# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: +# NOTE: Changes made to this file will be lost: look at ltmain.sh. +# +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, +# 2006, 2007, 2008 Free Software Foundation, Inc. +# Written by Gordon Matzigkeit, 1996 +# +# This file is part of GNU Libtool. +# +# GNU Libtool is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation; either version 2 of +# the License, or (at your option) any later version. +# +# As a special exception to the GNU General Public License, +# if you distribute this file as part of a program or library that +# is built using GNU Libtool, you may include this file under the +# same distribution terms that you use for the rest of that program. +# +# GNU Libtool is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNU Libtool; see the file COPYING. If not, a copy +# can be downloaded from http://www.gnu.org/licenses/gpl.html, or +# obtained by writing to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + +# The names of the tagged configurations supported by this script. +available_tags="" + +# ### BEGIN LIBTOOL CONFIG + +# A sed program that does not truncate output. +SED=$lt_SED + +# Sed that helps us avoid accidentally triggering echo(1) options like -n. +Xsed="\$SED -e 1s/^X//" + +# A grep program that handles long lines. +GREP=$lt_GREP + +# An ERE matcher. +EGREP=$lt_EGREP + +# A literal string matcher. +FGREP=$lt_FGREP + +# Assembler program. +AS=$AS + +# DLL creation program. +DLLTOOL=$DLLTOOL + +# Object dumper program. +OBJDUMP=$OBJDUMP + +# Which release of libtool.m4 was used? +macro_version=$macro_version +macro_revision=$macro_revision + +# Whether or not to build shared libraries. +build_libtool_libs=$enable_shared + +# Whether or not to build static libraries. +build_old_libs=$enable_static + +# What type of objects to build. +pic_mode=$pic_mode + +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install + +# The host system. +host_alias=$host_alias +host=$host +host_os=$host_os + +# The build system. +build_alias=$build_alias +build=$build +build_os=$build_os + +# A BSD- or MS-compatible name lister. +NM=$lt_NM + +# Whether we need soft or hard links. +LN_S=$lt_LN_S + +# What is the maximum length of a command? +max_cmd_len=$max_cmd_len + +# Object file suffix (normally "o"). +objext=$ac_objext + +# Executable file suffix (normally ""). +exeext=$exeext + +# whether the shell understands "unset". +lt_unset=$lt_unset + +# turn spaces into newlines. +SP2NL=$lt_lt_SP2NL + +# turn newlines into spaces. +NL2SP=$lt_lt_NL2SP + +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds + +# Method to check whether dependent libraries are shared objects. +deplibs_check_method=$lt_deplibs_check_method + +# Command to use when deplibs_check_method == "file_magic". +file_magic_cmd=$lt_file_magic_cmd + +# The archiver. +AR=$lt_AR +AR_FLAGS=$lt_AR_FLAGS + +# A symbol stripping program. +STRIP=$lt_STRIP + +# Commands used to install an old-style archive. +RANLIB=$lt_RANLIB +old_postinstall_cmds=$lt_old_postinstall_cmds +old_postuninstall_cmds=$lt_old_postuninstall_cmds + +# A C compiler. +LTCC=$lt_CC + +# LTCC compiler flags. +LTCFLAGS=$lt_CFLAGS + +# Take the output of nm and produce a listing of raw symbols and C names. +global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe + +# Transform the output of nm in a proper C declaration. +global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl + +# Transform the output of nm in a C name address pair. +global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address + +# Transform the output of nm in a C name address pair when lib prefix is needed. +global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix + +# The name of the directory that contains temporary libtool files. +objdir=$objdir + +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL + +# An echo program that does not interpret backslashes. +ECHO=$lt_ECHO + +# Used to examine libraries when file_magic_cmd begins with "file". +MAGIC_CMD=$MAGIC_CMD + +# Must we lock files when doing compilation? +need_locks=$lt_need_locks + +# Tool to manipulate archived DWARF debug symbol files on Mac OS X. +DSYMUTIL=$lt_DSYMUTIL + +# Tool to change global to local symbols on Mac OS X. +NMEDIT=$lt_NMEDIT + +# Tool to manipulate fat objects and archives on Mac OS X. +LIPO=$lt_LIPO + +# ldd/readelf like tool for Mach-O binaries on Mac OS X. +OTOOL=$lt_OTOOL + +# ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. +OTOOL64=$lt_OTOOL64 + +# Old archive suffix (normally "a"). +libext=$libext + +# Shared library suffix (normally ".so"). +shrext_cmds=$lt_shrext_cmds + +# The commands to extract the exported symbol list from a shared archive. +extract_expsyms_cmds=$lt_extract_expsyms_cmds + +# Variables whose values should be saved in libtool wrapper scripts and +# restored at link time. +variables_saved_for_relink=$lt_variables_saved_for_relink + +# Do we need the "lib" prefix for modules? +need_lib_prefix=$need_lib_prefix + +# Do we need a version for libraries? +need_version=$need_version + +# Library versioning type. +version_type=$version_type + +# Shared library runtime path variable. +runpath_var=$runpath_var + +# Shared library path variable. +shlibpath_var=$shlibpath_var + +# Is shlibpath searched before the hard-coded library search path? +shlibpath_overrides_runpath=$shlibpath_overrides_runpath + +# Format of library name prefix. +libname_spec=$lt_libname_spec + +# List of archive names. First name is the real one, the rest are links. +# The last name is the one that the linker finds with -lNAME +library_names_spec=$lt_library_names_spec + +# The coded name of the library, if different from the real name. +soname_spec=$lt_soname_spec + +# Command to use after installation of a shared archive. +postinstall_cmds=$lt_postinstall_cmds + +# Command to use after uninstallation of a shared archive. +postuninstall_cmds=$lt_postuninstall_cmds + +# Commands used to finish a libtool library installation in a directory. +finish_cmds=$lt_finish_cmds + +# As "finish_cmds", except a single script fragment to be evaled but +# not shown. +finish_eval=$lt_finish_eval + +# Whether we should hardcode library paths into libraries. +hardcode_into_libs=$hardcode_into_libs + +# Compile-time system search path for libraries. +sys_lib_search_path_spec=$lt_sys_lib_search_path_spec + +# Run-time system search path for libraries. +sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec + +# Whether dlopen is supported. +dlopen_support=$enable_dlopen + +# Whether dlopen of programs is supported. +dlopen_self=$enable_dlopen_self + +# Whether dlopen of statically linked programs is supported. +dlopen_self_static=$enable_dlopen_self_static + +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib + + +# The linker used to build libraries. +LD=$lt_LD + +# Commands used to build an old-style archive. +old_archive_cmds=$lt_old_archive_cmds + +# A language specific compiler. +CC=$lt_compiler + +# Is the compiler the GNU compiler? +with_gcc=$GCC + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag + +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl + +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic + +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_lt_prog_compiler_static + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_lt_cv_prog_compiler_c_o + +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=$archive_cmds_need_lc + +# Whether or not to disallow shared libs when runtime libs are static. +allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_export_dynamic_flag_spec + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_whole_archive_flag_spec + +# Whether the compiler copes with passing no objects directly. +compiler_needs_object=$lt_compiler_needs_object + +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$lt_old_archive_from_new_cmds + +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds + +# Commands used to build a shared archive. +archive_cmds=$lt_archive_cmds +archive_expsym_cmds=$lt_archive_expsym_cmds + +# Commands used to build a loadable module if different from building +# a shared archive. +module_cmds=$lt_module_cmds +module_expsym_cmds=$lt_module_expsym_cmds + +# Whether we are building with GNU ld or not. +with_gnu_ld=$lt_with_gnu_ld + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_allow_undefined_flag + +# Flag that enforces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag + +# Flag to hardcode \$libdir into a binary during linking. +# This must work even if \$libdir does not exist +hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec + +# If ld is used when linking, flag to hardcode \$libdir into a binary +# during linking. This must work even if \$libdir does not exist. +hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld + +# Whether we need a single "-rpath" flag with a separated argument. +hardcode_libdir_separator=$lt_hardcode_libdir_separator + +# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes +# DIR into the resulting binary. +hardcode_direct=$hardcode_direct + +# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes +# DIR into the resulting binary and the resulting library dependency is +# "absolute",i.e impossible to change by setting \${shlibpath_var} if the +# library is relocated. +hardcode_direct_absolute=$hardcode_direct_absolute + +# Set to "yes" if using the -LDIR flag during linking hardcodes DIR +# into the resulting binary. +hardcode_minus_L=$hardcode_minus_L + +# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR +# into the resulting binary. +hardcode_shlibpath_var=$hardcode_shlibpath_var + +# Set to "yes" if building a shared library automatically hardcodes DIR +# into the library and all subsequent libraries and executables linked +# against it. +hardcode_automatic=$hardcode_automatic + +# Set to yes if linker adds runtime paths of dependent libraries +# to runtime path list. +inherit_rpath=$inherit_rpath + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$link_all_deplibs + +# Fix the shell variable \$srcfile for the compiler. +fix_srcfile_path=$lt_fix_srcfile_path + +# Set to "yes" if exported symbols are required. +always_export_symbols=$always_export_symbols + +# The commands to list exported symbols. +export_symbols_cmds=$lt_export_symbols_cmds + +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_exclude_expsyms + +# Symbols that must always be exported. +include_expsyms=$lt_include_expsyms + +# Commands necessary for linking programs (against libraries) with templates. +prelink_cmds=$lt_prelink_cmds + +# Specify filename containing input files. +file_list_spec=$lt_file_list_spec + +# How to hardcode a shared library path into an executable. +hardcode_action=$hardcode_action + +# ### END LIBTOOL CONFIG + +_LT_EOF + + case $host_os in + aix3*) + cat <<\_LT_EOF >> "$cfgfile" +# AIX sometimes has problems with the GCC collect2 program. For some +# reason, if we set the COLLECT_NAMES environment variable, the problems +# vanish in a puff of smoke. +if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES +fi +_LT_EOF + ;; + esac + + +ltmain="$ac_aux_dir/ltmain.sh" + + + # We use sed instead of cat because bash on DJGPP gets confused if + # if finds mixed CR/LF and LF-only lines. Since sed operates in + # text mode, it properly converts lines to CR/LF. This bash problem + # is reportedly fixed, but why not run on old versions too? + sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) + + case $xsi_shell in + yes) + cat << \_LT_EOF >> "$cfgfile" + +# func_dirname file append nondir_replacement +# Compute the dirname of FILE. If nonempty, add APPEND to the result, +# otherwise set result to NONDIR_REPLACEMENT. +func_dirname () +{ + case ${1} in + */*) func_dirname_result="${1%/*}${2}" ;; + * ) func_dirname_result="${3}" ;; + esac +} + +# func_basename file +func_basename () +{ + func_basename_result="${1##*/}" +} + +# func_dirname_and_basename file append nondir_replacement +# perform func_basename and func_dirname in a single function +# call: +# dirname: Compute the dirname of FILE. If nonempty, +# add APPEND to the result, otherwise set result +# to NONDIR_REPLACEMENT. +# value returned in "$func_dirname_result" +# basename: Compute filename of FILE. +# value retuned in "$func_basename_result" +# Implementation must be kept synchronized with func_dirname +# and func_basename. For efficiency, we do not delegate to +# those functions but instead duplicate the functionality here. +func_dirname_and_basename () +{ + case ${1} in + */*) func_dirname_result="${1%/*}${2}" ;; + * ) func_dirname_result="${3}" ;; + esac + func_basename_result="${1##*/}" +} + +# func_stripname prefix suffix name +# strip PREFIX and SUFFIX off of NAME. +# PREFIX and SUFFIX must not contain globbing or regex special +# characters, hashes, percent signs, but SUFFIX may contain a leading +# dot (in which case that matches only a dot). +func_stripname () +{ + # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are + # positional parameters, so assign one to ordinary parameter first. + func_stripname_result=${3} + func_stripname_result=${func_stripname_result#"${1}"} + func_stripname_result=${func_stripname_result%"${2}"} +} + +# func_opt_split +func_opt_split () +{ + func_opt_split_opt=${1%%=*} + func_opt_split_arg=${1#*=} +} + +# func_lo2o object +func_lo2o () +{ + case ${1} in + *.lo) func_lo2o_result=${1%.lo}.${objext} ;; + *) func_lo2o_result=${1} ;; + esac +} + +# func_xform libobj-or-source +func_xform () +{ + func_xform_result=${1%.*}.lo +} + +# func_arith arithmetic-term... +func_arith () +{ + func_arith_result=$(( $* )) +} + +# func_len string +# STRING may not start with a hyphen. +func_len () +{ + func_len_result=${#1} +} + +_LT_EOF + ;; + *) # Bourne compatible functions. + cat << \_LT_EOF >> "$cfgfile" + +# func_dirname file append nondir_replacement +# Compute the dirname of FILE. If nonempty, add APPEND to the result, +# otherwise set result to NONDIR_REPLACEMENT. +func_dirname () +{ + # Extract subdirectory from the argument. + func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"` + if test "X$func_dirname_result" = "X${1}"; then + func_dirname_result="${3}" + else + func_dirname_result="$func_dirname_result${2}" + fi +} + +# func_basename file +func_basename () +{ + func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"` +} + + +# func_stripname prefix suffix name +# strip PREFIX and SUFFIX off of NAME. +# PREFIX and SUFFIX must not contain globbing or regex special +# characters, hashes, percent signs, but SUFFIX may contain a leading +# dot (in which case that matches only a dot). +# func_strip_suffix prefix name +func_stripname () +{ + case ${2} in + .*) func_stripname_result=`$ECHO "X${3}" \ + | $Xsed -e "s%^${1}%%" -e "s%\\\\${2}\$%%"`;; + *) func_stripname_result=`$ECHO "X${3}" \ + | $Xsed -e "s%^${1}%%" -e "s%${2}\$%%"`;; + esac +} + +# sed scripts: +my_sed_long_opt='1s/^\(-[^=]*\)=.*/\1/;q' +my_sed_long_arg='1s/^-[^=]*=//' + +# func_opt_split +func_opt_split () +{ + func_opt_split_opt=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_opt"` + func_opt_split_arg=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_arg"` +} + +# func_lo2o object +func_lo2o () +{ + func_lo2o_result=`$ECHO "X${1}" | $Xsed -e "$lo2o"` +} + +# func_xform libobj-or-source +func_xform () +{ + func_xform_result=`$ECHO "X${1}" | $Xsed -e 's/\.[^.]*$/.lo/'` +} + +# func_arith arithmetic-term... +func_arith () +{ + func_arith_result=`expr "$@"` +} + +# func_len string +# STRING may not start with a hyphen. +func_len () +{ + func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len` +} + +_LT_EOF +esac + +case $lt_shell_append in + yes) + cat << \_LT_EOF >> "$cfgfile" + +# func_append var value +# Append VALUE to the end of shell variable VAR. +func_append () +{ + eval "$1+=\$2" +} +_LT_EOF + ;; + *) + cat << \_LT_EOF >> "$cfgfile" + +# func_append var value +# Append VALUE to the end of shell variable VAR. +func_append () +{ + eval "$1=\$$1\$2" +} + +_LT_EOF + ;; + esac + + + sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) + + mv -f "$cfgfile" "$ofile" || + (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") + chmod +x "$ofile" + + ;; + "libpng-config":F) chmod +x libpng-config ;; + + esac +done # for ac_tag + + +as_fn_exit 0 +_ACEOF +ac_clean_files=$ac_clean_files_save + +test $ac_write_fail = 0 || + as_fn_error "write failure creating $CONFIG_STATUS" "$LINENO" 5 + + +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + ac_config_status_args= + test "$silent" = yes && + ac_config_status_args="$ac_config_status_args --quiet" + exec 5>/dev/null + $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || as_fn_exit $? +fi +if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} +fi + diff --git a/external/libpng/example.c b/external/libpng/example.c new file mode 100644 index 0000000..49b8724 --- /dev/null +++ b/external/libpng/example.c @@ -0,0 +1,832 @@ + +#if 0 /* in case someone actually tries to compile this */ + +/* example.c - an example of using libpng + * Last changed in libpng 1.2.37 [June 4, 2009] + * This file has been placed in the public domain by the authors. + * Maintained 1998-2010 Glenn Randers-Pehrson + * Maintained 1996, 1997 Andreas Dilger) + * Written 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) + */ + +/* This is an example of how to use libpng to read and write PNG files. + * The file libpng.txt is much more verbose then this. If you have not + * read it, do so first. This was designed to be a starting point of an + * implementation. This is not officially part of libpng, is hereby placed + * in the public domain, and therefore does not require a copyright notice. + * + * This file does not currently compile, because it is missing certain + * parts, like allocating memory to hold an image. You will have to + * supply these parts to get it to compile. For an example of a minimal + * working PNG reader/writer, see pngtest.c, included in this distribution; + * see also the programs in the contrib directory. + */ + +#include "png.h" + + /* The png_jmpbuf() macro, used in error handling, became available in + * libpng version 1.0.6. If you want to be able to run your code with older + * versions of libpng, you must define the macro yourself (but only if it + * is not already defined by libpng!). + */ + +#ifndef png_jmpbuf +# define png_jmpbuf(png_ptr) ((png_ptr)->jmpbuf) +#endif + +/* Check to see if a file is a PNG file using png_sig_cmp(). png_sig_cmp() + * returns zero if the image is a PNG and nonzero if it isn't a PNG. + * + * The function check_if_png() shown here, but not used, returns nonzero (true) + * if the file can be opened and is a PNG, 0 (false) otherwise. + * + * If this call is successful, and you are going to keep the file open, + * you should call png_set_sig_bytes(png_ptr, PNG_BYTES_TO_CHECK); once + * you have created the png_ptr, so that libpng knows your application + * has read that many bytes from the start of the file. Make sure you + * don't call png_set_sig_bytes() with more than 8 bytes read or give it + * an incorrect number of bytes read, or you will either have read too + * many bytes (your fault), or you are telling libpng to read the wrong + * number of magic bytes (also your fault). + * + * Many applications already read the first 2 or 4 bytes from the start + * of the image to determine the file type, so it would be easiest just + * to pass the bytes to png_sig_cmp() or even skip that if you know + * you have a PNG file, and call png_set_sig_bytes(). + */ +#define PNG_BYTES_TO_CHECK 4 +int check_if_png(char *file_name, FILE **fp) +{ + char buf[PNG_BYTES_TO_CHECK]; + + /* Open the prospective PNG file. */ + if ((*fp = fopen(file_name, "rb")) == NULL) + return 0; + + /* Read in some of the signature bytes */ + if (fread(buf, 1, PNG_BYTES_TO_CHECK, *fp) != PNG_BYTES_TO_CHECK) + return 0; + + /* Compare the first PNG_BYTES_TO_CHECK bytes of the signature. + Return nonzero (true) if they match */ + + return(!png_sig_cmp(buf, (png_size_t)0, PNG_BYTES_TO_CHECK)); +} + +/* Read a PNG file. You may want to return an error code if the read + * fails (depending upon the failure). There are two "prototypes" given + * here - one where we are given the filename, and we need to open the + * file, and the other where we are given an open file (possibly with + * some or all of the magic bytes read - see comments above). + */ +#ifdef open_file /* prototype 1 */ +void read_png(char *file_name) /* We need to open the file */ +{ + png_structp png_ptr; + png_infop info_ptr; + unsigned int sig_read = 0; + png_uint_32 width, height; + int bit_depth, color_type, interlace_type; + FILE *fp; + + if ((fp = fopen(file_name, "rb")) == NULL) + return (ERROR); + +#else no_open_file /* prototype 2 */ +void read_png(FILE *fp, unsigned int sig_read) /* File is already open */ +{ + png_structp png_ptr; + png_infop info_ptr; + png_uint_32 width, height; + int bit_depth, color_type, interlace_type; +#endif no_open_file /* Only use one prototype! */ + + /* Create and initialize the png_struct with the desired error handler + * functions. If you want to use the default stderr and longjump method, + * you can supply NULL for the last three parameters. We also supply the + * the compiler header file version, so that we know if the application + * was compiled with a compatible version of the library. REQUIRED + */ + png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, + png_voidp user_error_ptr, user_error_fn, user_warning_fn); + + if (png_ptr == NULL) + { + fclose(fp); + return (ERROR); + } + + /* Allocate/initialize the memory for image information. REQUIRED. */ + info_ptr = png_create_info_struct(png_ptr); + if (info_ptr == NULL) + { + fclose(fp); + png_destroy_read_struct(&png_ptr, png_infopp_NULL, png_infopp_NULL); + return (ERROR); + } + + /* Set error handling if you are using the setjmp/longjmp method (this is + * the normal method of doing things with libpng). REQUIRED unless you + * set up your own error handlers in the png_create_read_struct() earlier. + */ + + if (setjmp(png_jmpbuf(png_ptr))) + { + /* Free all of the memory associated with the png_ptr and info_ptr */ + png_destroy_read_struct(&png_ptr, &info_ptr, png_infopp_NULL); + fclose(fp); + /* If we get here, we had a problem reading the file */ + return (ERROR); + } + + /* One of the following I/O initialization methods is REQUIRED */ +#ifdef streams /* PNG file I/O method 1 */ + /* Set up the input control if you are using standard C streams */ + png_init_io(png_ptr, fp); + +#else no_streams /* PNG file I/O method 2 */ + /* If you are using replacement read functions, instead of calling + * png_init_io() here you would call: + */ + png_set_read_fn(png_ptr, (void *)user_io_ptr, user_read_fn); + /* where user_io_ptr is a structure you want available to the callbacks */ +#endif no_streams /* Use only one I/O method! */ + + /* If we have already read some of the signature */ + png_set_sig_bytes(png_ptr, sig_read); + +#ifdef hilevel + /* + * If you have enough memory to read in the entire image at once, + * and you need to specify only transforms that can be controlled + * with one of the PNG_TRANSFORM_* bits (this presently excludes + * dithering, filling, setting background, and doing gamma + * adjustment), then you can read the entire image (including + * pixels) into the info structure with this call: + */ + png_read_png(png_ptr, info_ptr, png_transforms, png_voidp_NULL); + +#else + /* OK, you're doing it the hard way, with the lower-level functions */ + + /* The call to png_read_info() gives us all of the information from the + * PNG file before the first IDAT (image data chunk). REQUIRED + */ + png_read_info(png_ptr, info_ptr); + + png_get_IHDR(png_ptr, info_ptr, &width, &height, &bit_depth, &color_type, + &interlace_type, int_p_NULL, int_p_NULL); + + /* Set up the data transformations you want. Note that these are all + * optional. Only call them if you want/need them. Many of the + * transformations only work on specific types of images, and many + * are mutually exclusive. + */ + + /* Tell libpng to strip 16 bit/color files down to 8 bits/color */ + png_set_strip_16(png_ptr); + + /* Strip alpha bytes from the input data without combining with the + * background (not recommended). + */ + png_set_strip_alpha(png_ptr); + + /* Extract multiple pixels with bit depths of 1, 2, and 4 from a single + * byte into separate bytes (useful for paletted and grayscale images). + */ + png_set_packing(png_ptr); + + /* Change the order of packed pixels to least significant bit first + * (not useful if you are using png_set_packing). */ + png_set_packswap(png_ptr); + + /* Expand paletted colors into true RGB triplets */ + if (color_type == PNG_COLOR_TYPE_PALETTE) + png_set_palette_to_rgb(png_ptr); + + /* Expand grayscale images to the full 8 bits from 1, 2, or 4 bits/pixel */ + if (color_type == PNG_COLOR_TYPE_GRAY && bit_depth < 8) + png_set_expand_gray_1_2_4_to_8(png_ptr); + + /* Expand paletted or RGB images with transparency to full alpha channels + * so the data will be available as RGBA quartets. + */ + if (png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS)) + png_set_tRNS_to_alpha(png_ptr); + + /* Set the background color to draw transparent and alpha images over. + * It is possible to set the red, green, and blue components directly + * for paletted images instead of supplying a palette index. Note that + * even if the PNG file supplies a background, you are not required to + * use it - you should use the (solid) application background if it has one. + */ + + png_color_16 my_background, *image_background; + + if (png_get_bKGD(png_ptr, info_ptr, &image_background)) + png_set_background(png_ptr, image_background, + PNG_BACKGROUND_GAMMA_FILE, 1, 1.0); + else + png_set_background(png_ptr, &my_background, + PNG_BACKGROUND_GAMMA_SCREEN, 0, 1.0); + + /* Some suggestions as to how to get a screen gamma value + * + * Note that screen gamma is the display_exponent, which includes + * the CRT_exponent and any correction for viewing conditions + */ + if (/* We have a user-defined screen gamma value */) + { + screen_gamma = user-defined screen_gamma; + } + /* This is one way that applications share the same screen gamma value */ + else if ((gamma_str = getenv("SCREEN_GAMMA")) != NULL) + { + screen_gamma = atof(gamma_str); + } + /* If we don't have another value */ + else + { + screen_gamma = 2.2; /* A good guess for a PC monitor in a dimly + lit room */ + screen_gamma = 1.7 or 1.0; /* A good guess for Mac systems */ + } + + /* Tell libpng to handle the gamma conversion for you. The final call + * is a good guess for PC generated images, but it should be configurable + * by the user at run time by the user. It is strongly suggested that + * your application support gamma correction. + */ + + int intent; + + if (png_get_sRGB(png_ptr, info_ptr, &intent)) + png_set_gamma(png_ptr, screen_gamma, 0.45455); + else + { + double image_gamma; + if (png_get_gAMA(png_ptr, info_ptr, &image_gamma)) + png_set_gamma(png_ptr, screen_gamma, image_gamma); + else + png_set_gamma(png_ptr, screen_gamma, 0.45455); + } + + /* Dither RGB files down to 8 bit palette or reduce palettes + * to the number of colors available on your screen. + */ + if (color_type & PNG_COLOR_MASK_COLOR) + { + int num_palette; + png_colorp palette; + + /* This reduces the image to the application supplied palette */ + if (/* We have our own palette */) + { + /* An array of colors to which the image should be dithered */ + png_color std_color_cube[MAX_SCREEN_COLORS]; + + png_set_dither(png_ptr, std_color_cube, MAX_SCREEN_COLORS, + MAX_SCREEN_COLORS, png_uint_16p_NULL, 0); + } + /* This reduces the image to the palette supplied in the file */ + else if (png_get_PLTE(png_ptr, info_ptr, &palette, &num_palette)) + { + png_uint_16p histogram = NULL; + + png_get_hIST(png_ptr, info_ptr, &histogram); + + png_set_dither(png_ptr, palette, num_palette, + max_screen_colors, histogram, 0); + } + } + + /* Invert monochrome files to have 0 as white and 1 as black */ + png_set_invert_mono(png_ptr); + + /* If you want to shift the pixel values from the range [0,255] or + * [0,65535] to the original [0,7] or [0,31], or whatever range the + * colors were originally in: + */ + if (png_get_valid(png_ptr, info_ptr, PNG_INFO_sBIT)) + { + png_color_8p sig_bit_p; + + png_get_sBIT(png_ptr, info_ptr, &sig_bit_p); + png_set_shift(png_ptr, sig_bit_p); + } + + /* Flip the RGB pixels to BGR (or RGBA to BGRA) */ + if (color_type & PNG_COLOR_MASK_COLOR) + png_set_bgr(png_ptr); + + /* Swap the RGBA or GA data to ARGB or AG (or BGRA to ABGR) */ + png_set_swap_alpha(png_ptr); + + /* Swap bytes of 16 bit files to least significant byte first */ + png_set_swap(png_ptr); + + /* Add filler (or alpha) byte (before/after each RGB triplet) */ + png_set_filler(png_ptr, 0xff, PNG_FILLER_AFTER); + + /* Turn on interlace handling. REQUIRED if you are not using + * png_read_image(). To see how to handle interlacing passes, + * see the png_read_row() method below: + */ + number_passes = png_set_interlace_handling(png_ptr); + + /* Optional call to gamma correct and add the background to the palette + * and update info structure. REQUIRED if you are expecting libpng to + * update the palette for you (ie you selected such a transform above). + */ + png_read_update_info(png_ptr, info_ptr); + + /* Allocate the memory to hold the image using the fields of info_ptr. */ + + /* The easiest way to read the image: */ + png_bytep row_pointers[height]; + + /* Clear the pointer array */ + for (row = 0; row < height; row++) + row_pointers[row] = NULL; + + for (row = 0; row < height; row++) + row_pointers[row] = png_malloc(png_ptr, png_get_rowbytes(png_ptr, + info_ptr)); + + /* Now it's time to read the image. One of these methods is REQUIRED */ +#ifdef entire /* Read the entire image in one go */ + png_read_image(png_ptr, row_pointers); + +#else no_entire /* Read the image one or more scanlines at a time */ + /* The other way to read images - deal with interlacing: */ + + for (pass = 0; pass < number_passes; pass++) + { +#ifdef single /* Read the image a single row at a time */ + for (y = 0; y < height; y++) + { + png_read_rows(png_ptr, &row_pointers[y], png_bytepp_NULL, 1); + } + +#else no_single /* Read the image several rows at a time */ + for (y = 0; y < height; y += number_of_rows) + { +#ifdef sparkle /* Read the image using the "sparkle" effect. */ + png_read_rows(png_ptr, &row_pointers[y], png_bytepp_NULL, + number_of_rows); +#else no_sparkle /* Read the image using the "rectangle" effect */ + png_read_rows(png_ptr, png_bytepp_NULL, &row_pointers[y], + number_of_rows); +#endif no_sparkle /* Use only one of these two methods */ + } + + /* If you want to display the image after every pass, do so here */ +#endif no_single /* Use only one of these two methods */ + } +#endif no_entire /* Use only one of these two methods */ + + /* Read rest of file, and get additional chunks in info_ptr - REQUIRED */ + png_read_end(png_ptr, info_ptr); +#endif hilevel + + /* At this point you have read the entire image */ + + /* Clean up after the read, and free any memory allocated - REQUIRED */ + png_destroy_read_struct(&png_ptr, &info_ptr, png_infopp_NULL); + + /* Close the file */ + fclose(fp); + + /* That's it */ + return (OK); +} + +/* Progressively read a file */ + +int +initialize_png_reader(png_structp *png_ptr, png_infop *info_ptr) +{ + /* Create and initialize the png_struct with the desired error handler + * functions. If you want to use the default stderr and longjump method, + * you can supply NULL for the last three parameters. We also check that + * the library version is compatible in case we are using dynamically + * linked libraries. + */ + *png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, + png_voidp user_error_ptr, user_error_fn, user_warning_fn); + + if (*png_ptr == NULL) + { + *info_ptr = NULL; + return (ERROR); + } + + *info_ptr = png_create_info_struct(png_ptr); + + if (*info_ptr == NULL) + { + png_destroy_read_struct(png_ptr, info_ptr, png_infopp_NULL); + return (ERROR); + } + + if (setjmp(png_jmpbuf((*png_ptr)))) + { + png_destroy_read_struct(png_ptr, info_ptr, png_infopp_NULL); + return (ERROR); + } + + /* This one's new. You will need to provide all three + * function callbacks, even if you aren't using them all. + * If you aren't using all functions, you can specify NULL + * parameters. Even when all three functions are NULL, + * you need to call png_set_progressive_read_fn(). + * These functions shouldn't be dependent on global or + * static variables if you are decoding several images + * simultaneously. You should store stream specific data + * in a separate struct, given as the second parameter, + * and retrieve the pointer from inside the callbacks using + * the function png_get_progressive_ptr(png_ptr). + */ + png_set_progressive_read_fn(*png_ptr, (void *)stream_data, + info_callback, row_callback, end_callback); + + return (OK); +} + +int +process_data(png_structp *png_ptr, png_infop *info_ptr, + png_bytep buffer, png_uint_32 length) +{ + if (setjmp(png_jmpbuf((*png_ptr)))) + { + /* Free the png_ptr and info_ptr memory on error */ + png_destroy_read_struct(png_ptr, info_ptr, png_infopp_NULL); + return (ERROR); + } + + /* This one's new also. Simply give it chunks of data as + * they arrive from the data stream (in order, of course). + * On segmented machines, don't give it any more than 64K. + * The library seems to run fine with sizes of 4K, although + * you can give it much less if necessary (I assume you can + * give it chunks of 1 byte, but I haven't tried with less + * than 256 bytes yet). When this function returns, you may + * want to display any rows that were generated in the row + * callback, if you aren't already displaying them there. + */ + png_process_data(*png_ptr, *info_ptr, buffer, length); + return (OK); +} + +info_callback(png_structp png_ptr, png_infop info) +{ + /* Do any setup here, including setting any of the transformations + * mentioned in the Reading PNG files section. For now, you _must_ + * call either png_start_read_image() or png_read_update_info() + * after all the transformations are set (even if you don't set + * any). You may start getting rows before png_process_data() + * returns, so this is your last chance to prepare for that. + */ +} + +row_callback(png_structp png_ptr, png_bytep new_row, + png_uint_32 row_num, int pass) +{ + /* + * This function is called for every row in the image. If the + * image is interlaced, and you turned on the interlace handler, + * this function will be called for every row in every pass. + * + * In this function you will receive a pointer to new row data from + * libpng called new_row that is to replace a corresponding row (of + * the same data format) in a buffer allocated by your application. + * + * The new row data pointer "new_row" may be NULL, indicating there is + * no new data to be replaced (in cases of interlace loading). + * + * If new_row is not NULL then you need to call + * png_progressive_combine_row() to replace the corresponding row as + * shown below: + */ + + /* Get pointer to corresponding row in our + * PNG read buffer. + */ + png_bytep old_row = ((png_bytep *)our_data)[row_num]; + + /* If both rows are allocated then copy the new row + * data to the corresponding row data. + */ + if ((old_row != NULL) && (new_row != NULL)) + png_progressive_combine_row(png_ptr, old_row, new_row); + + /* + * The rows and passes are called in order, so you don't really + * need the row_num and pass, but I'm supplying them because it + * may make your life easier. + * + * For the non-NULL rows of interlaced images, you must call + * png_progressive_combine_row() passing in the new row and the + * old row, as demonstrated above. You can call this function for + * NULL rows (it will just return) and for non-interlaced images + * (it just does the png_memcpy for you) if it will make the code + * easier. Thus, you can just do this for all cases: + */ + + png_progressive_combine_row(png_ptr, old_row, new_row); + + /* where old_row is what was displayed for previous rows. Note + * that the first pass (pass == 0 really) will completely cover + * the old row, so the rows do not have to be initialized. After + * the first pass (and only for interlaced images), you will have + * to pass the current row as new_row, and the function will combine + * the old row and the new row. + */ +} + +end_callback(png_structp png_ptr, png_infop info) +{ + /* This function is called when the whole image has been read, + * including any chunks after the image (up to and including + * the IEND). You will usually have the same info chunk as you + * had in the header, although some data may have been added + * to the comments and time fields. + * + * Most people won't do much here, perhaps setting a flag that + * marks the image as finished. + */ +} + +/* Write a png file */ +void write_png(char *file_name /* , ... other image information ... */) +{ + FILE *fp; + png_structp png_ptr; + png_infop info_ptr; + png_colorp palette; + + /* Open the file */ + fp = fopen(file_name, "wb"); + if (fp == NULL) + return (ERROR); + + /* Create and initialize the png_struct with the desired error handler + * functions. If you want to use the default stderr and longjump method, + * you can supply NULL for the last three parameters. We also check that + * the library version is compatible with the one used at compile time, + * in case we are using dynamically linked libraries. REQUIRED. + */ + png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, + png_voidp user_error_ptr, user_error_fn, user_warning_fn); + + if (png_ptr == NULL) + { + fclose(fp); + return (ERROR); + } + + /* Allocate/initialize the image information data. REQUIRED */ + info_ptr = png_create_info_struct(png_ptr); + if (info_ptr == NULL) + { + fclose(fp); + png_destroy_write_struct(&png_ptr, png_infopp_NULL); + return (ERROR); + } + + /* Set error handling. REQUIRED if you aren't supplying your own + * error handling functions in the png_create_write_struct() call. + */ + if (setjmp(png_jmpbuf(png_ptr))) + { + /* If we get here, we had a problem writing the file */ + fclose(fp); + png_destroy_write_struct(&png_ptr, &info_ptr); + return (ERROR); + } + + /* One of the following I/O initialization functions is REQUIRED */ + +#ifdef streams /* I/O initialization method 1 */ + /* Set up the output control if you are using standard C streams */ + png_init_io(png_ptr, fp); + +#else no_streams /* I/O initialization method 2 */ + /* If you are using replacement write functions, instead of calling + * png_init_io() here you would call + */ + png_set_write_fn(png_ptr, (void *)user_io_ptr, user_write_fn, + user_IO_flush_function); + /* where user_io_ptr is a structure you want available to the callbacks */ +#endif no_streams /* Only use one initialization method */ + +#ifdef hilevel + /* This is the easy way. Use it if you already have all the + * image info living in the structure. You could "|" many + * PNG_TRANSFORM flags into the png_transforms integer here. + */ + png_write_png(png_ptr, info_ptr, png_transforms, png_voidp_NULL); + +#else + /* This is the hard way */ + + /* Set the image information here. Width and height are up to 2^31, + * bit_depth is one of 1, 2, 4, 8, or 16, but valid values also depend on + * the color_type selected. color_type is one of PNG_COLOR_TYPE_GRAY, + * PNG_COLOR_TYPE_GRAY_ALPHA, PNG_COLOR_TYPE_PALETTE, PNG_COLOR_TYPE_RGB, + * or PNG_COLOR_TYPE_RGB_ALPHA. interlace is either PNG_INTERLACE_NONE or + * PNG_INTERLACE_ADAM7, and the compression_type and filter_type MUST + * currently be PNG_COMPRESSION_TYPE_BASE and PNG_FILTER_TYPE_BASE. REQUIRED + */ + png_set_IHDR(png_ptr, info_ptr, width, height, bit_depth, PNG_COLOR_TYPE_???, + PNG_INTERLACE_????, PNG_COMPRESSION_TYPE_BASE, PNG_FILTER_TYPE_BASE); + + /* Set the palette if there is one. REQUIRED for indexed-color images */ + palette = (png_colorp)png_malloc(png_ptr, PNG_MAX_PALETTE_LENGTH + * png_sizeof(png_color)); + /* ... Set palette colors ... */ + png_set_PLTE(png_ptr, info_ptr, palette, PNG_MAX_PALETTE_LENGTH); + /* You must not free palette here, because png_set_PLTE only makes a link to + * the palette that you malloced. Wait until you are about to destroy + * the png structure. + */ + + /* Optional significant bit (sBIT) chunk */ + png_color_8 sig_bit; + /* If we are dealing with a grayscale image then */ + sig_bit.gray = true_bit_depth; + /* Otherwise, if we are dealing with a color image then */ + sig_bit.red = true_red_bit_depth; + sig_bit.green = true_green_bit_depth; + sig_bit.blue = true_blue_bit_depth; + /* If the image has an alpha channel then */ + sig_bit.alpha = true_alpha_bit_depth; + png_set_sBIT(png_ptr, info_ptr, &sig_bit); + + + /* Optional gamma chunk is strongly suggested if you have any guess + * as to the correct gamma of the image. + */ + png_set_gAMA(png_ptr, info_ptr, gamma); + + /* Optionally write comments into the image */ + text_ptr[0].key = "Title"; + text_ptr[0].text = "Mona Lisa"; + text_ptr[0].compression = PNG_TEXT_COMPRESSION_NONE; + text_ptr[1].key = "Author"; + text_ptr[1].text = "Leonardo DaVinci"; + text_ptr[1].compression = PNG_TEXT_COMPRESSION_NONE; + text_ptr[2].key = "Description"; + text_ptr[2].text = ""; + text_ptr[2].compression = PNG_TEXT_COMPRESSION_zTXt; +#ifdef PNG_iTXt_SUPPORTED + text_ptr[0].lang = NULL; + text_ptr[1].lang = NULL; + text_ptr[2].lang = NULL; +#endif + png_set_text(png_ptr, info_ptr, text_ptr, 3); + + /* Other optional chunks like cHRM, bKGD, tRNS, tIME, oFFs, pHYs */ + + /* Note that if sRGB is present the gAMA and cHRM chunks must be ignored + * on read and, if your application chooses to write them, they must + * be written in accordance with the sRGB profile + */ + + /* Write the file header information. REQUIRED */ + png_write_info(png_ptr, info_ptr); + + /* If you want, you can write the info in two steps, in case you need to + * write your private chunk ahead of PLTE: + * + * png_write_info_before_PLTE(write_ptr, write_info_ptr); + * write_my_chunk(); + * png_write_info(png_ptr, info_ptr); + * + * However, given the level of known- and unknown-chunk support in 1.2.0 + * and up, this should no longer be necessary. + */ + + /* Once we write out the header, the compression type on the text + * chunks gets changed to PNG_TEXT_COMPRESSION_NONE_WR or + * PNG_TEXT_COMPRESSION_zTXt_WR, so it doesn't get written out again + * at the end. + */ + + /* Set up the transformations you want. Note that these are + * all optional. Only call them if you want them. + */ + + /* Invert monochrome pixels */ + png_set_invert_mono(png_ptr); + + /* Shift the pixels up to a legal bit depth and fill in + * as appropriate to correctly scale the image. + */ + png_set_shift(png_ptr, &sig_bit); + + /* Pack pixels into bytes */ + png_set_packing(png_ptr); + + /* Swap location of alpha bytes from ARGB to RGBA */ + png_set_swap_alpha(png_ptr); + + /* Get rid of filler (OR ALPHA) bytes, pack XRGB/RGBX/ARGB/RGBA into + * RGB (4 channels -> 3 channels). The second parameter is not used. + */ + png_set_filler(png_ptr, 0, PNG_FILLER_BEFORE); + + /* Flip BGR pixels to RGB */ + png_set_bgr(png_ptr); + + /* Swap bytes of 16-bit files to most significant byte first */ + png_set_swap(png_ptr); + + /* Swap bits of 1, 2, 4 bit packed pixel formats */ + png_set_packswap(png_ptr); + + /* Turn on interlace handling if you are not using png_write_image() */ + if (interlacing) + number_passes = png_set_interlace_handling(png_ptr); + else + number_passes = 1; + + /* The easiest way to write the image (you may have a different memory + * layout, however, so choose what fits your needs best). You need to + * use the first method if you aren't handling interlacing yourself. + */ + png_uint_32 k, height, width; + png_byte image[height][width*bytes_per_pixel]; + png_bytep row_pointers[height]; + + if (height > PNG_UINT_32_MAX/png_sizeof(png_bytep)) + png_error (png_ptr, "Image is too tall to process in memory"); + + for (k = 0; k < height; k++) + row_pointers[k] = image + k*width*bytes_per_pixel; + + /* One of the following output methods is REQUIRED */ + +#ifdef entire /* Write out the entire image data in one call */ + png_write_image(png_ptr, row_pointers); + + /* The other way to write the image - deal with interlacing */ + +#else no_entire /* Write out the image data by one or more scanlines */ + + /* The number of passes is either 1 for non-interlaced images, + * or 7 for interlaced images. + */ + for (pass = 0; pass < number_passes; pass++) + { + /* Write a few rows at a time. */ + png_write_rows(png_ptr, &row_pointers[first_row], number_of_rows); + + /* If you are only writing one row at a time, this works */ + for (y = 0; y < height; y++) + png_write_rows(png_ptr, &row_pointers[y], 1); + } +#endif no_entire /* Use only one output method */ + + /* You can write optional chunks like tEXt, zTXt, and tIME at the end + * as well. Shouldn't be necessary in 1.2.0 and up as all the public + * chunks are supported and you can use png_set_unknown_chunks() to + * register unknown chunks into the info structure to be written out. + */ + + /* It is REQUIRED to call this to finish writing the rest of the file */ + png_write_end(png_ptr, info_ptr); +#endif hilevel + + /* If you png_malloced a palette, free it here (don't free info_ptr->palette, + * as recommended in versions 1.0.5m and earlier of this example; if + * libpng mallocs info_ptr->palette, libpng will free it). If you + * allocated it with malloc() instead of png_malloc(), use free() instead + * of png_free(). + */ + png_free(png_ptr, palette); + palette = NULL; + + /* Similarly, if you png_malloced any data that you passed in with + * png_set_something(), such as a hist or trans array, free it here, + * when you can be sure that libpng is through with it. + */ + png_free(png_ptr, trans); + trans = NULL; + /* Whenever you use png_free() it is a good idea to set the pointer to + * NULL in case your application inadvertently tries to png_free() it + * again. When png_free() sees a NULL it returns without action, thus + * avoiding the double-free security problem. + */ + + /* Clean up after the write, and free any memory allocated */ + png_destroy_write_struct(&png_ptr, &info_ptr); + + /* Close the file */ + fclose(fp); + + /* That's it */ + return (OK); +} + +#endif /* if 0 */ diff --git a/external/libpng/libpng-1.2.49.txt b/external/libpng/libpng-1.2.49.txt new file mode 100644 index 0000000..194fe41 --- /dev/null +++ b/external/libpng/libpng-1.2.49.txt @@ -0,0 +1,3234 @@ +libpng.txt - A description on how to use and modify libpng + + libpng version 1.2.49 - March 29, 2012 + Updated and distributed by Glenn Randers-Pehrson + + Copyright (c) 1998-2009 Glenn Randers-Pehrson + + This document is released under the libpng license. + For conditions of distribution and use, see the disclaimer + and license in png.h + + Based on: + + libpng versions 0.97, January 1998, through 1.2.49 - March 29, 2012 + Updated and distributed by Glenn Randers-Pehrson + Copyright (c) 1998-2009 Glenn Randers-Pehrson + + libpng 1.0 beta 6 version 0.96 May 28, 1997 + Updated and distributed by Andreas Dilger + Copyright (c) 1996, 1997 Andreas Dilger + + libpng 1.0 beta 2 - version 0.88 January 26, 1996 + For conditions of distribution and use, see copyright + notice in png.h. Copyright (c) 1995, 1996 Guy Eric + Schalnat, Group 42, Inc. + + Updated/rewritten per request in the libpng FAQ + Copyright (c) 1995, 1996 Frank J. T. Wojcik + December 18, 1995 & January 20, 1996 + +I. Introduction + +This file describes how to use and modify the PNG reference library +(known as libpng) for your own use. There are five sections to this +file: introduction, structures, reading, writing, and modification and +configuration notes for various special platforms. In addition to this +file, example.c is a good starting point for using the library, as +it is heavily commented and should include everything most people +will need. We assume that libpng is already installed; see the +INSTALL file for instructions on how to install libpng. + +For examples of libpng usage, see the files "example.c", "pngtest.c", +and the files in the "contrib" directory, all of which are included in +the libpng distribution. + +Libpng was written as a companion to the PNG specification, as a way +of reducing the amount of time and effort it takes to support the PNG +file format in application programs. + +The PNG specification (second edition), November 2003, is available as +a W3C Recommendation and as an ISO Standard (ISO/IEC 15948:2003 (E)) at +. It is technically equivalent +to the PNG specification (second edition) but has some additional material. + +The PNG-1.0 specification is available +as RFC 2083 and as a +W3C Recommendation . + +Some additional chunks are described in the special-purpose public chunks +documents at . + +Other information +about PNG, and the latest version of libpng, can be found at the PNG home +page, . + +Most users will not have to modify the library significantly; advanced +users may want to modify it more. All attempts were made to make it as +complete as possible, while keeping the code easy to understand. +Currently, this library only supports C. Support for other languages +is being considered. + +Libpng has been designed to handle multiple sessions at one time, +to be easily modifiable, to be portable to the vast majority of +machines (ANSI, K&R, 16-, 32-, and 64-bit) available, and to be easy +to use. The ultimate goal of libpng is to promote the acceptance of +the PNG file format in whatever way possible. While there is still +work to be done (see the TODO file), libpng should cover the +majority of the needs of its users. + +Libpng uses zlib for its compression and decompression of PNG files. +Further information about zlib, and the latest version of zlib, can +be found at the zlib home page, . +The zlib compression utility is a general purpose utility that is +useful for more than PNG files, and can be used without libpng. +See the documentation delivered with zlib for more details. +You can usually find the source files for the zlib utility wherever you +find the libpng source files. + +Libpng is thread safe, provided the threads are using different +instances of the structures. Each thread should have its own +png_struct and png_info instances, and thus its own image. +Libpng does not protect itself against two threads using the +same instance of a structure. + +II. Structures + +There are two main structures that are important to libpng, png_struct +and png_info. The first, png_struct, is an internal structure that +will not, for the most part, be used by a user except as the first +variable passed to every libpng function call. + +The png_info structure is designed to provide information about the +PNG file. At one time, the fields of png_info were intended to be +directly accessible to the user. However, this tended to cause problems +with applications using dynamically loaded libraries, and as a result +a set of interface functions for png_info (the png_get_*() and png_set_*() +functions) was developed. The fields of png_info are still available for +older applications, but it is suggested that applications use the new +interfaces if at all possible. + +Applications that do make direct access to the members of png_struct (except +for png_ptr->jmpbuf) must be recompiled whenever the library is updated, +and applications that make direct access to the members of png_info must +be recompiled if they were compiled or loaded with libpng version 1.0.6, +in which the members were in a different order. In version 1.0.7, the +members of the png_info structure reverted to the old order, as they were +in versions 0.97c through 1.0.5. Starting with version 2.0.0, both +structures are going to be hidden, and the contents of the structures will +only be accessible through the png_get/png_set functions. + +The png.h header file is an invaluable reference for programming with libpng. +And while I'm on the topic, make sure you include the libpng header file: + +#include + +III. Reading + +We'll now walk you through the possible functions to call when reading +in a PNG file sequentially, briefly explaining the syntax and purpose +of each one. See example.c and png.h for more detail. While +progressive reading is covered in the next section, you will still +need some of the functions discussed in this section to read a PNG +file. + +Setup + +You will want to do the I/O initialization(*) before you get into libpng, +so if it doesn't work, you don't have much to undo. Of course, you +will also want to insure that you are, in fact, dealing with a PNG +file. Libpng provides a simple check to see if a file is a PNG file. +To use it, pass in the first 1 to 8 bytes of the file to the function +png_sig_cmp(), and it will return 0 (false) if the bytes match the +corresponding bytes of the PNG signature, or nonzero (true) otherwise. +Of course, the more bytes you pass in, the greater the accuracy of the +prediction. + +If you are intending to keep the file pointer open for use in libpng, +you must ensure you don't read more than 8 bytes from the beginning +of the file, and you also have to make a call to png_set_sig_bytes_read() +with the number of bytes you read from the beginning. Libpng will +then only check the bytes (if any) that your program didn't read. + +(*): If you are not using the standard I/O functions, you will need +to replace them with custom functions. See the discussion under +Customizing libpng. + + + FILE *fp = fopen(file_name, "rb"); + if (!fp) + { + return (ERROR); + } + fread(header, 1, number, fp); + is_png = !png_sig_cmp(header, 0, number); + if (!is_png) + { + return (NOT_PNG); + } + + +Next, png_struct and png_info need to be allocated and initialized. In +order to ensure that the size of these structures is correct even with a +dynamically linked libpng, there are functions to initialize and +allocate the structures. We also pass the library version, optional +pointers to error handling functions, and a pointer to a data struct for +use by the error functions, if necessary (the pointer and functions can +be NULL if the default error handlers are to be used). See the section +on Changes to Libpng below regarding the old initialization functions. +The structure allocation functions quietly return NULL if they fail to +create the structure, so your application should check for that. + + png_structp png_ptr = png_create_read_struct + (PNG_LIBPNG_VER_STRING, (png_voidp)user_error_ptr, + user_error_fn, user_warning_fn); + if (!png_ptr) + return (ERROR); + + png_infop info_ptr = png_create_info_struct(png_ptr); + if (!info_ptr) + { + png_destroy_read_struct(&png_ptr, + (png_infopp)NULL, (png_infopp)NULL); + return (ERROR); + } + + png_infop end_info = png_create_info_struct(png_ptr); + if (!end_info) + { + png_destroy_read_struct(&png_ptr, &info_ptr, + (png_infopp)NULL); + return (ERROR); + } + +If you want to use your own memory allocation routines, +define PNG_USER_MEM_SUPPORTED and use +png_create_read_struct_2() instead of png_create_read_struct(): + + png_structp png_ptr = png_create_read_struct_2 + (PNG_LIBPNG_VER_STRING, (png_voidp)user_error_ptr, + user_error_fn, user_warning_fn, (png_voidp) + user_mem_ptr, user_malloc_fn, user_free_fn); + +The error handling routines passed to png_create_read_struct() +and the memory alloc/free routines passed to png_create_struct_2() +are only necessary if you are not using the libpng supplied error +handling and memory alloc/free functions. + +When libpng encounters an error, it expects to longjmp back +to your routine. Therefore, you will need to call setjmp and pass +your png_jmpbuf(png_ptr). If you read the file from different +routines, you will need to update the jmpbuf field every time you enter +a new routine that will call a png_*() function. + +See your documentation of setjmp/longjmp for your compiler for more +information on setjmp/longjmp. See the discussion on libpng error +handling in the Customizing Libpng section below for more information +on the libpng error handling. If an error occurs, and libpng longjmp's +back to your setjmp, you will want to call png_destroy_read_struct() to +free any memory. + + if (setjmp(png_jmpbuf(png_ptr))) + { + png_destroy_read_struct(&png_ptr, &info_ptr, + &end_info); + fclose(fp); + return (ERROR); + } + +If you would rather avoid the complexity of setjmp/longjmp issues, +you can compile libpng with PNG_SETJMP_NOT_SUPPORTED, in which case +errors will result in a call to PNG_ABORT() which defaults to abort(). + +Now you need to set up the input code. The default for libpng is to +use the C function fread(). If you use this, you will need to pass a +valid FILE * in the function png_init_io(). Be sure that the file is +opened in binary mode. If you wish to handle reading data in another +way, you need not call the png_init_io() function, but you must then +implement the libpng I/O methods discussed in the Customizing Libpng +section below. + + png_init_io(png_ptr, fp); + +If you had previously opened the file and read any of the signature from +the beginning in order to see if this was a PNG file, you need to let +libpng know that there are some bytes missing from the start of the file. + + png_set_sig_bytes(png_ptr, number); + +Setting up callback code + +You can set up a callback function to handle any unknown chunks in the +input stream. You must supply the function + + read_chunk_callback(png_ptr ptr, + png_unknown_chunkp chunk); + { + /* The unknown chunk structure contains your + chunk data, along with similar data for any other + unknown chunks: */ + + png_byte name[5]; + png_byte *data; + png_size_t size; + + /* Note that libpng has already taken care of + the CRC handling */ + + /* put your code here. Search for your chunk in the + unknown chunk structure, process it, and return one + of the following: */ + + return (-n); /* chunk had an error */ + return (0); /* did not recognize */ + return (n); /* success */ + } + +(You can give your function another name that you like instead of +"read_chunk_callback") + +To inform libpng about your function, use + + png_set_read_user_chunk_fn(png_ptr, user_chunk_ptr, + read_chunk_callback); + +This names not only the callback function, but also a user pointer that +you can retrieve with + + png_get_user_chunk_ptr(png_ptr); + +If you call the png_set_read_user_chunk_fn() function, then all unknown +chunks will be saved when read, in case your callback function will need +one or more of them. This behavior can be changed with the +png_set_keep_unknown_chunks() function, described below. + +At this point, you can set up a callback function that will be +called after each row has been read, which you can use to control +a progress meter or the like. It's demonstrated in pngtest.c. +You must supply a function + + void read_row_callback(png_ptr ptr, png_uint_32 row, + int pass); + { + /* put your code here */ + } + +(You can give it another name that you like instead of "read_row_callback") + +To inform libpng about your function, use + + png_set_read_status_fn(png_ptr, read_row_callback); + +Unknown-chunk handling + +Now you get to set the way the library processes unknown chunks in the +input PNG stream. Both known and unknown chunks will be read. Normal +behavior is that known chunks will be parsed into information in +various info_ptr members while unknown chunks will be discarded. This +behavior can be wasteful if your application will never use some known +chunk types. To change this, you can call: + + png_set_keep_unknown_chunks(png_ptr, keep, + chunk_list, num_chunks); + keep - 0: default unknown chunk handling + 1: ignore; do not keep + 2: keep only if safe-to-copy + 3: keep even if unsafe-to-copy + You can use these definitions: + PNG_HANDLE_CHUNK_AS_DEFAULT 0 + PNG_HANDLE_CHUNK_NEVER 1 + PNG_HANDLE_CHUNK_IF_SAFE 2 + PNG_HANDLE_CHUNK_ALWAYS 3 + chunk_list - list of chunks affected (a byte string, + five bytes per chunk, NULL or '\0' if + num_chunks is 0) + num_chunks - number of chunks affected; if 0, all + unknown chunks are affected. If nonzero, + only the chunks in the list are affected + +Unknown chunks declared in this way will be saved as raw data onto a +list of png_unknown_chunk structures. If a chunk that is normally +known to libpng is named in the list, it will be handled as unknown, +according to the "keep" directive. If a chunk is named in successive +instances of png_set_keep_unknown_chunks(), the final instance will +take precedence. The IHDR and IEND chunks should not be named in +chunk_list; if they are, libpng will process them normally anyway. + +Here is an example of the usage of png_set_keep_unknown_chunks(), +where the private "vpAg" chunk will later be processed by a user chunk +callback function: + + png_byte vpAg[5]={118, 112, 65, 103, (png_byte) '\0'}; + + #if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED) + png_byte unused_chunks[]= + { + 104, 73, 83, 84, (png_byte) '\0', /* hIST */ + 105, 84, 88, 116, (png_byte) '\0', /* iTXt */ + 112, 67, 65, 76, (png_byte) '\0', /* pCAL */ + 115, 67, 65, 76, (png_byte) '\0', /* sCAL */ + 115, 80, 76, 84, (png_byte) '\0', /* sPLT */ + 116, 73, 77, 69, (png_byte) '\0', /* tIME */ + }; + #endif + + ... + + #if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED) + /* ignore all unknown chunks: */ + png_set_keep_unknown_chunks(read_ptr, 1, NULL, 0); + /* except for vpAg: */ + png_set_keep_unknown_chunks(read_ptr, 2, vpAg, 1); + /* also ignore unused known chunks: */ + png_set_keep_unknown_chunks(read_ptr, 1, unused_chunks, + (int)sizeof(unused_chunks)/5); + #endif + +User limits + +The PNG specification allows the width and height of an image to be as +large as 2^31-1 (0x7fffffff), or about 2.147 billion rows and columns. +Since very few applications really need to process such large images, +we have imposed an arbitrary 1-million limit on rows and columns. +Larger images will be rejected immediately with a png_error() call. If +you wish to override this limit, you can use + + png_set_user_limits(png_ptr, width_max, height_max); + +to set your own limits, or use width_max = height_max = 0x7fffffffL +to allow all valid dimensions (libpng may reject some very large images +anyway because of potential buffer overflow conditions). + +You should put this statement after you create the PNG structure and +before calling png_read_info(), png_read_png(), or png_process_data(). +If you need to retrieve the limits that are being applied, use + + width_max = png_get_user_width_max(png_ptr); + height_max = png_get_user_height_max(png_ptr); + +The PNG specification sets no limit on the number of ancillary chunks +allowed in a PNG datastream. You can impose a limit on the total number +of sPLT, tEXt, iTXt, zTXt, and unknown chunks that will be stored, with + + png_set_chunk_cache_max(png_ptr, user_chunk_cache_max); + +where 0x7fffffffL means unlimited. You can retrieve this limit with + + chunk_cache_max = png_get_chunk_cache_max(png_ptr); + +This limit also applies to the number of buffers that can be allocated +by png_decompress_chunk() while decompressing iTXt, zTXt, and iCCP chunks. + +The high-level read interface + +At this point there are two ways to proceed; through the high-level +read interface, or through a sequence of low-level read operations. +You can use the high-level interface if (a) you are willing to read +the entire image into memory, and (b) the input transformations +you want to do are limited to the following set: + + PNG_TRANSFORM_IDENTITY No transformation + PNG_TRANSFORM_STRIP_16 Strip 16-bit samples to + 8 bits + PNG_TRANSFORM_STRIP_ALPHA Discard the alpha channel + PNG_TRANSFORM_PACKING Expand 1, 2 and 4-bit + samples to bytes + PNG_TRANSFORM_PACKSWAP Change order of packed + pixels to LSB first + PNG_TRANSFORM_EXPAND Perform set_expand() + PNG_TRANSFORM_INVERT_MONO Invert monochrome images + PNG_TRANSFORM_SHIFT Normalize pixels to the + sBIT depth + PNG_TRANSFORM_BGR Flip RGB to BGR, RGBA + to BGRA + PNG_TRANSFORM_SWAP_ALPHA Flip RGBA to ARGB or GA + to AG + PNG_TRANSFORM_INVERT_ALPHA Change alpha from opacity + to transparency + PNG_TRANSFORM_SWAP_ENDIAN Byte-swap 16-bit samples + PNG_TRANSFORM_GRAY_TO_RGB Expand grayscale samples + to RGB (or GA to RGBA) + +(This excludes setting a background color, doing gamma transformation, +dithering, and setting filler.) If this is the case, simply do this: + + png_read_png(png_ptr, info_ptr, png_transforms, NULL) + +where png_transforms is an integer containing the bitwise OR of some +set of transformation flags. This call is equivalent to png_read_info(), +followed the set of transformations indicated by the transform mask, +then png_read_image(), and finally png_read_end(). + +(The final parameter of this call is not yet used. Someday it might point +to transformation parameters required by some future input transform.) + +You must use png_transforms and not call any png_set_transform() functions +when you use png_read_png(). + +After you have called png_read_png(), you can retrieve the image data +with + + row_pointers = png_get_rows(png_ptr, info_ptr); + +where row_pointers is an array of pointers to the pixel data for each row: + + png_bytep row_pointers[height]; + +If you know your image size and pixel size ahead of time, you can allocate +row_pointers prior to calling png_read_png() with + + if (height > PNG_UINT_32_MAX/png_sizeof(png_byte)) + png_error (png_ptr, + "Image is too tall to process in memory"); + if (width > PNG_UINT_32_MAX/pixel_size) + png_error (png_ptr, + "Image is too wide to process in memory"); + row_pointers = png_malloc(png_ptr, + height*png_sizeof(png_bytep)); + for (int i=0; i) and +png_get_(png_ptr, info_ptr, ...) functions return non-zero if the +data has been read, or zero if it is missing. The parameters to the +png_get_ are set directly if they are simple data types, or a +pointer into the info_ptr is returned for any complex types. + + png_get_PLTE(png_ptr, info_ptr, &palette, + &num_palette); + palette - the palette for the file + (array of png_color) + num_palette - number of entries in the palette + + png_get_gAMA(png_ptr, info_ptr, &gamma); + gamma - the gamma the file is written + at (PNG_INFO_gAMA) + + png_get_sRGB(png_ptr, info_ptr, &srgb_intent); + srgb_intent - the rendering intent (PNG_INFO_sRGB) + The presence of the sRGB chunk + means that the pixel data is in the + sRGB color space. This chunk also + implies specific values of gAMA and + cHRM. + + png_get_iCCP(png_ptr, info_ptr, &name, + &compression_type, &profile, &proflen); + name - The profile name. + compression - The compression type; always + PNG_COMPRESSION_TYPE_BASE for PNG 1.0. + You may give NULL to this argument to + ignore it. + profile - International Color Consortium color + profile data. May contain NULs. + proflen - length of profile data in bytes. + + png_get_sBIT(png_ptr, info_ptr, &sig_bit); + sig_bit - the number of significant bits for + (PNG_INFO_sBIT) each of the gray, + red, green, and blue channels, + whichever are appropriate for the + given color type (png_color_16) + + png_get_tRNS(png_ptr, info_ptr, &trans, &num_trans, + &trans_values); + trans - array of transparent + entries for palette (PNG_INFO_tRNS) + trans_values - graylevel or color sample values of + the single transparent color for + non-paletted images (PNG_INFO_tRNS) + num_trans - number of transparent entries + (PNG_INFO_tRNS) + + png_get_hIST(png_ptr, info_ptr, &hist); + (PNG_INFO_hIST) + hist - histogram of palette (array of + png_uint_16) + + png_get_tIME(png_ptr, info_ptr, &mod_time); + mod_time - time image was last modified + (PNG_VALID_tIME) + + png_get_bKGD(png_ptr, info_ptr, &background); + background - background color (PNG_VALID_bKGD) + valid 16-bit red, green and blue + values, regardless of color_type + + num_comments = png_get_text(png_ptr, info_ptr, + &text_ptr, &num_text); + num_comments - number of comments + text_ptr - array of png_text holding image + comments + text_ptr[i].compression - type of compression used + on "text" PNG_TEXT_COMPRESSION_NONE + PNG_TEXT_COMPRESSION_zTXt + PNG_ITXT_COMPRESSION_NONE + PNG_ITXT_COMPRESSION_zTXt + text_ptr[i].key - keyword for comment. Must contain + 1-79 characters. + text_ptr[i].text - text comments for current + keyword. Can be empty. + text_ptr[i].text_length - length of text string, + after decompression, 0 for iTXt + text_ptr[i].itxt_length - length of itxt string, + after decompression, 0 for tEXt/zTXt + text_ptr[i].lang - language of comment (empty + string for unknown). + text_ptr[i].lang_key - keyword in UTF-8 + (empty string for unknown). + Note that the itxt_length, lang, and lang_key + members of the text_ptr structure only exist + when the library is built with iTXt chunk support. + + num_text - number of comments (same as + num_comments; you can put NULL here + to avoid the duplication) + Note while png_set_text() will accept text, language, + and translated keywords that can be NULL pointers, the + structure returned by png_get_text will always contain + regular zero-terminated C strings. They might be + empty strings but they will never be NULL pointers. + + num_spalettes = png_get_sPLT(png_ptr, info_ptr, + &palette_ptr); + palette_ptr - array of palette structures holding + contents of one or more sPLT chunks + read. + num_spalettes - number of sPLT chunks read. + + png_get_oFFs(png_ptr, info_ptr, &offset_x, &offset_y, + &unit_type); + offset_x - positive offset from the left edge + of the screen + offset_y - positive offset from the top edge + of the screen + unit_type - PNG_OFFSET_PIXEL, PNG_OFFSET_MICROMETER + + png_get_pHYs(png_ptr, info_ptr, &res_x, &res_y, + &unit_type); + res_x - pixels/unit physical resolution in + x direction + res_y - pixels/unit physical resolution in + x direction + unit_type - PNG_RESOLUTION_UNKNOWN, + PNG_RESOLUTION_METER + + png_get_sCAL(png_ptr, info_ptr, &unit, &width, + &height) + unit - physical scale units (an integer) + width - width of a pixel in physical scale units + height - height of a pixel in physical scale units + (width and height are doubles) + + png_get_sCAL_s(png_ptr, info_ptr, &unit, &width, + &height) + unit - physical scale units (an integer) + width - width of a pixel in physical scale units + height - height of a pixel in physical scale units + (width and height are strings like "2.54") + + num_unknown_chunks = png_get_unknown_chunks(png_ptr, + info_ptr, &unknowns) + unknowns - array of png_unknown_chunk + structures holding unknown chunks + unknowns[i].name - name of unknown chunk + unknowns[i].data - data of unknown chunk + unknowns[i].size - size of unknown chunk's data + unknowns[i].location - position of chunk in file + + The value of "i" corresponds to the order in which the + chunks were read from the PNG file or inserted with the + png_set_unknown_chunks() function. + +The data from the pHYs chunk can be retrieved in several convenient +forms: + + res_x = png_get_x_pixels_per_meter(png_ptr, + info_ptr) + res_y = png_get_y_pixels_per_meter(png_ptr, + info_ptr) + res_x_and_y = png_get_pixels_per_meter(png_ptr, + info_ptr) + res_x = png_get_x_pixels_per_inch(png_ptr, + info_ptr) + res_y = png_get_y_pixels_per_inch(png_ptr, + info_ptr) + res_x_and_y = png_get_pixels_per_inch(png_ptr, + info_ptr) + aspect_ratio = png_get_pixel_aspect_ratio(png_ptr, + info_ptr) + + (Each of these returns 0 [signifying "unknown"] if + the data is not present or if res_x is 0; + res_x_and_y is 0 if res_x != res_y) + +The data from the oFFs chunk can be retrieved in several convenient +forms: + + x_offset = png_get_x_offset_microns(png_ptr, info_ptr); + y_offset = png_get_y_offset_microns(png_ptr, info_ptr); + x_offset = png_get_x_offset_inches(png_ptr, info_ptr); + y_offset = png_get_y_offset_inches(png_ptr, info_ptr); + + (Each of these returns 0 [signifying "unknown" if both + x and y are 0] if the data is not present or if the + chunk is present but the unit is the pixel) + +For more information, see the png_info definition in png.h and the +PNG specification for chunk contents. Be careful with trusting +rowbytes, as some of the transformations could increase the space +needed to hold a row (expand, filler, gray_to_rgb, etc.). +See png_read_update_info(), below. + +A quick word about text_ptr and num_text. PNG stores comments in +keyword/text pairs, one pair per chunk, with no limit on the number +of text chunks, and a 2^31 byte limit on their size. While there are +suggested keywords, there is no requirement to restrict the use to these +strings. It is strongly suggested that keywords and text be sensible +to humans (that's the point), so don't use abbreviations. Non-printing +symbols are not allowed. See the PNG specification for more details. +There is also no requirement to have text after the keyword. + +Keywords should be limited to 79 Latin-1 characters without leading or +trailing spaces, but non-consecutive spaces are allowed within the +keyword. It is possible to have the same keyword any number of times. +The text_ptr is an array of png_text structures, each holding a +pointer to a language string, a pointer to a keyword and a pointer to +a text string. The text string, language code, and translated +keyword may be empty or NULL pointers. The keyword/text +pairs are put into the array in the order that they are received. +However, some or all of the text chunks may be after the image, so, to +make sure you have read all the text chunks, don't mess with these +until after you read the stuff after the image. This will be +mentioned again below in the discussion that goes with png_read_end(). + +Input transformations + +After you've read the header information, you can set up the library +to handle any special transformations of the image data. The various +ways to transform the data will be described in the order that they +should occur. This is important, as some of these change the color +type and/or bit depth of the data, and some others only work on +certain color types and bit depths. Even though each transformation +checks to see if it has data that it can do something with, you should +make sure to only enable a transformation if it will be valid for the +data. For example, don't swap red and blue on grayscale data. + +The colors used for the background and transparency values should be +supplied in the same format/depth as the current image data. They +are stored in the same format/depth as the image data in a bKGD or tRNS +chunk, so this is what libpng expects for this data. The colors are +transformed to keep in sync with the image data when an application +calls the png_read_update_info() routine (see below). + +Data will be decoded into the supplied row buffers packed into bytes +unless the library has been told to transform it into another format. +For example, 4 bit/pixel paletted or grayscale data will be returned +2 pixels/byte with the leftmost pixel in the high-order bits of the +byte, unless png_set_packing() is called. 8-bit RGB data will be stored +in RGB RGB RGB format unless png_set_filler() or png_set_add_alpha() +is called to insert filler bytes, either before or after each RGB triplet. +16-bit RGB data will be returned RRGGBB RRGGBB, with the most significant +byte of the color value first, unless png_set_strip_16() is called to +transform it to regular RGB RGB triplets, or png_set_filler() or +png_set_add alpha() is called to insert filler bytes, either before or +after each RRGGBB triplet. Similarly, 8-bit or 16-bit grayscale data can +be modified with +png_set_filler(), png_set_add_alpha(), or png_set_strip_16(). + +The following code transforms grayscale images of less than 8 to 8 bits, +changes paletted images to RGB, and adds a full alpha channel if there is +transparency information in a tRNS chunk. This is most useful on +grayscale images with bit depths of 2 or 4 or if there is a multiple-image +viewing application that wishes to treat all images in the same way. + + if (color_type == PNG_COLOR_TYPE_PALETTE) + png_set_palette_to_rgb(png_ptr); + + if (color_type == PNG_COLOR_TYPE_GRAY && + bit_depth < 8) png_set_expand_gray_1_2_4_to_8(png_ptr); + + if (png_get_valid(png_ptr, info_ptr, + PNG_INFO_tRNS)) png_set_tRNS_to_alpha(png_ptr); + +These three functions are actually aliases for png_set_expand(), added +in libpng version 1.0.4, with the function names expanded to improve code +readability. In some future version they may actually do different +things. + +As of libpng version 1.2.9, png_set_expand_gray_1_2_4_to_8() was +added. It expands the sample depth without changing tRNS to alpha. + +As of libpng version 1.2.49, not all possible expansions are supported. + +In the following table, the 01 means grayscale with depth<8, 31 means +indexed with depth<8, other numerals represent the color type, "T" means +the tRNS chunk is present, A means an alpha channel is present, and O +means tRNS or alpha is present but all pixels in the image are opaque. + + FROM 01 31 0 0T 0O 2 2T 2O 3 3T 3O 4A 4O 6A 6O + TO + 01 - + 31 - + 0 1 - + 0T - + 0O - + 2 GX - + 2T - + 2O - + 3 1 - + 3T - + 3O - + 4A T - + 4O - + 6A GX TX TX - + 6O GX TX - + +Within the matrix, + "-" means the transformation is not supported. + "X" means the transformation is obtained by png_set_expand(). + "1" means the transformation is obtained by + png_set_expand_gray_1_2_4_to_8 + "G" means the transformation is obtained by + png_set_gray_to_rgb(). + "P" means the transformation is obtained by + png_set_expand_palette_to_rgb(). + "T" means the transformation is obtained by + png_set_tRNS_to_alpha(). + +PNG can have files with 16 bits per channel. If you only can handle +8 bits per channel, this will strip the pixels down to 8 bit. + + if (bit_depth == 16) + png_set_strip_16(png_ptr); + +If, for some reason, you don't need the alpha channel on an image, +and you want to remove it rather than combining it with the background +(but the image author certainly had in mind that you *would* combine +it with the background, so that's what you should probably do): + + if (color_type & PNG_COLOR_MASK_ALPHA) + png_set_strip_alpha(png_ptr); + +In PNG files, the alpha channel in an image +is the level of opacity. If you need the alpha channel in an image to +be the level of transparency instead of opacity, you can invert the +alpha channel (or the tRNS chunk data) after it's read, so that 0 is +fully opaque and 255 (in 8-bit or paletted images) or 65535 (in 16-bit +images) is fully transparent, with + + png_set_invert_alpha(png_ptr); + +The PNG format only supports pixels with postmultiplied alpha. +If you want to replace the pixels, after reading them, with pixels +that have premultiplied color samples, you can do this with + + png_set_premultiply_alpha(png_ptr); + +If you do this, any input with a tRNS chunk will be expanded to +have an alpha channel. + +PNG files pack pixels of bit depths 1, 2, and 4 into bytes as small as +they can, resulting in, for example, 8 pixels per byte for 1 bit +files. This code expands to 1 pixel per byte without changing the +values of the pixels: + + if (bit_depth < 8) + png_set_packing(png_ptr); + +PNG files have possible bit depths of 1, 2, 4, 8, and 16. All pixels +stored in a PNG image have been "scaled" or "shifted" up to the next +higher possible bit depth (e.g. from 5 bits/sample in the range [0,31] +to 8 bits/sample in the range [0, 255]). However, it is also possible +to convert the PNG pixel data back to the original bit depth of the +image. This call reduces the pixels back down to the original bit depth: + + png_color_8p sig_bit; + + if (png_get_sBIT(png_ptr, info_ptr, &sig_bit)) + png_set_shift(png_ptr, sig_bit); + +PNG files store 3-color pixels in red, green, blue order. This code +changes the storage of the pixels to blue, green, red: + + if (color_type == PNG_COLOR_TYPE_RGB || + color_type == PNG_COLOR_TYPE_RGB_ALPHA) + png_set_bgr(png_ptr); + +PNG files store RGB pixels packed into 3 or 6 bytes. This code expands them +into 4 or 8 bytes for windowing systems that need them in this format: + + if (color_type == PNG_COLOR_TYPE_RGB) + png_set_filler(png_ptr, filler, PNG_FILLER_BEFORE); + +where "filler" is the 8 or 16-bit number to fill with, and the location is +either PNG_FILLER_BEFORE or PNG_FILLER_AFTER, depending upon whether +you want the filler before the RGB or after. This transformation +does not affect images that already have full alpha channels. To add an +opaque alpha channel, use filler=0xff or 0xffff and PNG_FILLER_AFTER which +will generate RGBA pixels. + +Note that png_set_filler() does not change the color type. If you want +to do that, you can add a true alpha channel with + + if (color_type == PNG_COLOR_TYPE_RGB || + color_type == PNG_COLOR_TYPE_GRAY) + png_set_add_alpha(png_ptr, filler, PNG_FILLER_AFTER); + +where "filler" contains the alpha value to assign to each pixel. +This function was added in libpng-1.2.7. + +If you are reading an image with an alpha channel, and you need the +data as ARGB instead of the normal PNG format RGBA: + + if (color_type == PNG_COLOR_TYPE_RGB_ALPHA) + png_set_swap_alpha(png_ptr); + +For some uses, you may want a grayscale image to be represented as +RGB. This code will do that conversion: + + if (color_type == PNG_COLOR_TYPE_GRAY || + color_type == PNG_COLOR_TYPE_GRAY_ALPHA) + png_set_gray_to_rgb(png_ptr); + +Conversely, you can convert an RGB or RGBA image to grayscale or grayscale +with alpha. + + if (color_type == PNG_COLOR_TYPE_RGB || + color_type == PNG_COLOR_TYPE_RGB_ALPHA) + png_set_rgb_to_gray_fixed(png_ptr, error_action, + int red_weight, int green_weight); + + error_action = 1: silently do the conversion + error_action = 2: issue a warning if the original + image has any pixel where + red != green or red != blue + error_action = 3: issue an error and abort the + conversion if the original + image has any pixel where + red != green or red != blue + + red_weight: weight of red component times 100000 + green_weight: weight of green component times 100000 + If either weight is negative, default + weights (21268, 71514) are used. + +If you have set error_action = 1 or 2, you can +later check whether the image really was gray, after processing +the image rows, with the png_get_rgb_to_gray_status(png_ptr) function. +It will return a png_byte that is zero if the image was gray or +1 if there were any non-gray pixels. bKGD and sBIT data +will be silently converted to grayscale, using the green channel +data, regardless of the error_action setting. + +With red_weight+green_weight<=100000, +the normalized graylevel is computed: + + int rw = red_weight * 65536; + int gw = green_weight * 65536; + int bw = 65536 - (rw + gw); + gray = (rw*red + gw*green + bw*blue)/65536; + +The default values approximate those recommended in the Charles +Poynton's Color FAQ, +Copyright (c) 1998-01-04 Charles Poynton + + Y = 0.212671 * R + 0.715160 * G + 0.072169 * B + +Libpng approximates this with + + Y = 0.21268 * R + 0.7151 * G + 0.07217 * B + +which can be expressed with integers as + + Y = (6969 * R + 23434 * G + 2365 * B)/32768 + +The calculation is done in a linear colorspace, if the image gamma +is known. + +If you have a grayscale and you are using png_set_expand_depth(), +png_set_expand(), or png_set_gray_to_rgb to change to truecolor or to +a higher bit-depth, you must either supply the background color as a gray +value at the original file bit-depth (need_expand = 1) or else supply the +background color as an RGB triplet at the final, expanded bit depth +(need_expand = 0). Similarly, if you are reading a paletted image, you +must either supply the background color as a palette index (need_expand = 1) +or as an RGB triplet that may or may not be in the palette (need_expand = 0). + + png_color_16 my_background; + png_color_16p image_background; + + if (png_get_bKGD(png_ptr, info_ptr, &image_background)) + png_set_background(png_ptr, image_background, + PNG_BACKGROUND_GAMMA_FILE, 1, 1.0); + else + png_set_background(png_ptr, &my_background, + PNG_BACKGROUND_GAMMA_SCREEN, 0, 1.0); + +The png_set_background() function tells libpng to composite images +with alpha or simple transparency against the supplied background +color. If the PNG file contains a bKGD chunk (PNG_INFO_bKGD valid), +you may use this color, or supply another color more suitable for +the current display (e.g., the background color from a web page). You +need to tell libpng whether the color is in the gamma space of the +display (PNG_BACKGROUND_GAMMA_SCREEN for colors you supply), the file +(PNG_BACKGROUND_GAMMA_FILE for colors from the bKGD chunk), or one +that is neither of these gammas (PNG_BACKGROUND_GAMMA_UNIQUE - I don't +know why anyone would use this, but it's here). + +To properly display PNG images on any kind of system, the application needs +to know what the display gamma is. Ideally, the user will know this, and +the application will allow them to set it. One method of allowing the user +to set the display gamma separately for each system is to check for a +SCREEN_GAMMA or DISPLAY_GAMMA environment variable, which will hopefully be +correctly set. + +Note that display_gamma is the overall gamma correction required to produce +pleasing results, which depends on the lighting conditions in the surrounding +environment. In a dim or brightly lit room, no compensation other than +the physical gamma exponent of the monitor is needed, while in a dark room +a slightly smaller exponent is better. + + double gamma, screen_gamma; + + if (/* We have a user-defined screen + gamma value */) + { + screen_gamma = user_defined_screen_gamma; + } + /* One way that applications can share the same + screen gamma value */ + else if ((gamma_str = getenv("SCREEN_GAMMA")) + != NULL) + { + screen_gamma = (double)atof(gamma_str); + } + /* If we don't have another value */ + else + { + screen_gamma = 2.2; /* A good guess for a + PC monitor in a bright office or a dim room */ + screen_gamma = 2.0; /* A good guess for a + PC monitor in a dark room */ + screen_gamma = 1.7 or 1.0; /* A good + guess for Mac systems */ + } + +The png_set_gamma() function handles gamma transformations of the data. +Pass both the file gamma and the current screen_gamma. If the file does +not have a gamma value, you can pass one anyway if you have an idea what +it is (usually 0.45455 is a good guess for GIF images on PCs). Note +that file gammas are inverted from screen gammas. See the discussions +on gamma in the PNG specification for an excellent description of what +gamma is, and why all applications should support it. It is strongly +recommended that PNG viewers support gamma correction. + + if (png_get_gAMA(png_ptr, info_ptr, &gamma)) + png_set_gamma(png_ptr, screen_gamma, gamma); + else + png_set_gamma(png_ptr, screen_gamma, 0.45455); + +If you need to reduce an RGB file to a paletted file, or if a paletted +file has more entries then will fit on your screen, png_set_dither() +will do that. Note that this is a simple match dither that merely +finds the closest color available. This should work fairly well with +optimized palettes, and fairly badly with linear color cubes. If you +pass a palette that is larger then maximum_colors, the file will +reduce the number of colors in the palette so it will fit into +maximum_colors. If there is a histogram, it will use it to make +more intelligent choices when reducing the palette. If there is no +histogram, it may not do as good a job. + + if (color_type & PNG_COLOR_MASK_COLOR) + { + if (png_get_valid(png_ptr, info_ptr, + PNG_INFO_PLTE)) + { + png_uint_16p histogram = NULL; + + png_get_hIST(png_ptr, info_ptr, + &histogram); + png_set_dither(png_ptr, palette, num_palette, + max_screen_colors, histogram, 1); + } + else + { + png_color std_color_cube[MAX_SCREEN_COLORS] = + { ... colors ... }; + + png_set_dither(png_ptr, std_color_cube, + MAX_SCREEN_COLORS, MAX_SCREEN_COLORS, + NULL,0); + } + } + +PNG files describe monochrome as black being zero and white being one. +The following code will reverse this (make black be one and white be +zero): + + if (bit_depth == 1 && color_type == PNG_COLOR_TYPE_GRAY) + png_set_invert_mono(png_ptr); + +This function can also be used to invert grayscale and gray-alpha images: + + if (color_type == PNG_COLOR_TYPE_GRAY || + color_type == PNG_COLOR_TYPE_GRAY_ALPHA) + png_set_invert_mono(png_ptr); + +PNG files store 16 bit pixels in network byte order (big-endian, +ie. most significant bits first). This code changes the storage to the +other way (little-endian, i.e. least significant bits first, the +way PCs store them): + + if (bit_depth == 16) + png_set_swap(png_ptr); + +If you are using packed-pixel images (1, 2, or 4 bits/pixel), and you +need to change the order the pixels are packed into bytes, you can use: + + if (bit_depth < 8) + png_set_packswap(png_ptr); + +Finally, you can write your own transformation function if none of +the existing ones meets your needs. This is done by setting a callback +with + + png_set_read_user_transform_fn(png_ptr, + read_transform_fn); + +You must supply the function + + void read_transform_fn(png_ptr ptr, row_info_ptr + row_info, png_bytep data) + +See pngtest.c for a working example. Your function will be called +after all of the other transformations have been processed. + +You can also set up a pointer to a user structure for use by your +callback function, and you can inform libpng that your transform +function will change the number of channels or bit depth with the +function + + png_set_user_transform_info(png_ptr, user_ptr, + user_depth, user_channels); + +The user's application, not libpng, is responsible for allocating and +freeing any memory required for the user structure. + +You can retrieve the pointer via the function +png_get_user_transform_ptr(). For example: + + voidp read_user_transform_ptr = + png_get_user_transform_ptr(png_ptr); + +The last thing to handle is interlacing; this is covered in detail below, +but you must call the function here if you want libpng to handle expansion +of the interlaced image. + + number_of_passes = png_set_interlace_handling(png_ptr); + +After setting the transformations, libpng can update your png_info +structure to reflect any transformations you've requested with this +call. This is most useful to update the info structure's rowbytes +field so you can use it to allocate your image memory. This function +will also update your palette with the correct screen_gamma and +background if these have been given with the calls above. + + png_read_update_info(png_ptr, info_ptr); + +After you call png_read_update_info(), you can allocate any +memory you need to hold the image. The row data is simply +raw byte data for all forms of images. As the actual allocation +varies among applications, no example will be given. If you +are allocating one large chunk, you will need to build an +array of pointers to each row, as it will be needed for some +of the functions below. + +Reading image data + +After you've allocated memory, you can read the image data. +The simplest way to do this is in one function call. If you are +allocating enough memory to hold the whole image, you can just +call png_read_image() and libpng will read in all the image data +and put it in the memory area supplied. You will need to pass in +an array of pointers to each row. + +This function automatically handles interlacing, so you don't need +to call png_set_interlace_handling() or call this function multiple +times, or any of that other stuff necessary with png_read_rows(). + + png_read_image(png_ptr, row_pointers); + +where row_pointers is: + + png_bytep row_pointers[height]; + +You can point to void or char or whatever you use for pixels. + +If you don't want to read in the whole image at once, you can +use png_read_rows() instead. If there is no interlacing (check +interlace_type == PNG_INTERLACE_NONE), this is simple: + + png_read_rows(png_ptr, row_pointers, NULL, + number_of_rows); + +where row_pointers is the same as in the png_read_image() call. + +If you are doing this just one row at a time, you can do this with +a single row_pointer instead of an array of row_pointers: + + png_bytep row_pointer = row; + png_read_row(png_ptr, row_pointer, NULL); + +If the file is interlaced (interlace_type != 0 in the IHDR chunk), things +get somewhat harder. The only current (PNG Specification version 1.2) +interlacing type for PNG is (interlace_type == PNG_INTERLACE_ADAM7) +is a somewhat complicated 2D interlace scheme, known as Adam7, that +breaks down an image into seven smaller images of varying size, based +on an 8x8 grid. + +libpng can fill out those images or it can give them to you "as is". +If you want them filled out, there are two ways to do that. The one +mentioned in the PNG specification is to expand each pixel to cover +those pixels that have not been read yet (the "rectangle" method). +This results in a blocky image for the first pass, which gradually +smooths out as more pixels are read. The other method is the "sparkle" +method, where pixels are drawn only in their final locations, with the +rest of the image remaining whatever colors they were initialized to +before the start of the read. The first method usually looks better, +but tends to be slower, as there are more pixels to put in the rows. + +If you don't want libpng to handle the interlacing details, just call +png_read_rows() seven times to read in all seven images. Each of the +images is a valid image by itself, or they can all be combined on an +8x8 grid to form a single image (although if you intend to combine them +you would be far better off using the libpng interlace handling). + +The first pass will return an image 1/8 as wide as the entire image +(every 8th column starting in column 0) and 1/8 as high as the original +(every 8th row starting in row 0), the second will be 1/8 as wide +(starting in column 4) and 1/8 as high (also starting in row 0). The +third pass will be 1/4 as wide (every 4th pixel starting in column 0) and +1/8 as high (every 8th row starting in row 4), and the fourth pass will +be 1/4 as wide and 1/4 as high (every 4th column starting in column 2, +and every 4th row starting in row 0). The fifth pass will return an +image 1/2 as wide, and 1/4 as high (starting at column 0 and row 2), +while the sixth pass will be 1/2 as wide and 1/2 as high as the original +(starting in column 1 and row 0). The seventh and final pass will be as +wide as the original, and 1/2 as high, containing all of the odd +numbered scanlines. Phew! + +If you want libpng to expand the images, call this before calling +png_start_read_image() or png_read_update_info(): + + if (interlace_type == PNG_INTERLACE_ADAM7) + number_of_passes + = png_set_interlace_handling(png_ptr); + +This will return the number of passes needed. Currently, this +is seven, but may change if another interlace type is added. +This function can be called even if the file is not interlaced, +where it will return one pass. + +If you are not going to display the image after each pass, but are +going to wait until the entire image is read in, use the sparkle +effect. This effect is faster and the end result of either method +is exactly the same. If you are planning on displaying the image +after each pass, the "rectangle" effect is generally considered the +better looking one. + +If you only want the "sparkle" effect, just call png_read_rows() as +normal, with the third parameter NULL. Make sure you make pass over +the image number_of_passes times, and you don't change the data in the +rows between calls. You can change the locations of the data, just +not the data. Each pass only writes the pixels appropriate for that +pass, and assumes the data from previous passes is still valid. + + png_read_rows(png_ptr, row_pointers, NULL, + number_of_rows); + +If you only want the first effect (the rectangles), do the same as +before except pass the row buffer in the third parameter, and leave +the second parameter NULL. + + png_read_rows(png_ptr, NULL, row_pointers, + number_of_rows); + +Finishing a sequential read + +After you are finished reading the image through the +low-level interface, you can finish reading the file. If you are +interested in comments or time, which may be stored either before or +after the image data, you should pass the separate png_info struct if +you want to keep the comments from before and after the image +separate. If you are not interested, you can pass NULL. + + png_read_end(png_ptr, end_info); + +When you are done, you can free all memory allocated by libpng like this: + + png_destroy_read_struct(&png_ptr, &info_ptr, + &end_info); + +It is also possible to individually free the info_ptr members that +point to libpng-allocated storage with the following function: + + png_free_data(png_ptr, info_ptr, mask, seq) + mask - identifies data to be freed, a mask + containing the bitwise OR of one or + more of + PNG_FREE_PLTE, PNG_FREE_TRNS, + PNG_FREE_HIST, PNG_FREE_ICCP, + PNG_FREE_PCAL, PNG_FREE_ROWS, + PNG_FREE_SCAL, PNG_FREE_SPLT, + PNG_FREE_TEXT, PNG_FREE_UNKN, + or simply PNG_FREE_ALL + seq - sequence number of item to be freed + (-1 for all items) + +This function may be safely called when the relevant storage has +already been freed, or has not yet been allocated, or was allocated +by the user and not by libpng, and will in those cases do nothing. +The "seq" parameter is ignored if only one item of the selected data +type, such as PLTE, is allowed. If "seq" is not -1, and multiple items +are allowed for the data type identified in the mask, such as text or +sPLT, only the n'th item in the structure is freed, where n is "seq". + +The default behavior is only to free data that was allocated internally +by libpng. This can be changed, so that libpng will not free the data, +or so that it will free data that was allocated by the user with png_malloc() +or png_zalloc() and passed in via a png_set_*() function, with + + png_data_freer(png_ptr, info_ptr, freer, mask) + mask - which data elements are affected + same choices as in png_free_data() + freer - one of + PNG_DESTROY_WILL_FREE_DATA + PNG_SET_WILL_FREE_DATA + PNG_USER_WILL_FREE_DATA + +This function only affects data that has already been allocated. +You can call this function after reading the PNG data but before calling +any png_set_*() functions, to control whether the user or the png_set_*() +function is responsible for freeing any existing data that might be present, +and again after the png_set_*() functions to control whether the user +or png_destroy_*() is supposed to free the data. When the user assumes +responsibility for libpng-allocated data, the application must use +png_free() to free it, and when the user transfers responsibility to libpng +for data that the user has allocated, the user must have used png_malloc() +or png_zalloc() to allocate it. + +If you allocated your row_pointers in a single block, as suggested above in +the description of the high level read interface, you must not transfer +responsibility for freeing it to the png_set_rows or png_read_destroy function, +because they would also try to free the individual row_pointers[i]. + +If you allocated text_ptr.text, text_ptr.lang, and text_ptr.translated_keyword +separately, do not transfer responsibility for freeing text_ptr to libpng, +because when libpng fills a png_text structure it combines these members with +the key member, and png_free_data() will free only text_ptr.key. Similarly, +if you transfer responsibility for free'ing text_ptr from libpng to your +application, your application must not separately free those members. + +The png_free_data() function will turn off the "valid" flag for anything +it frees. If you need to turn the flag off for a chunk that was freed by +your application instead of by libpng, you can use + + png_set_invalid(png_ptr, info_ptr, mask); + mask - identifies the chunks to be made invalid, + containing the bitwise OR of one or + more of + PNG_INFO_gAMA, PNG_INFO_sBIT, + PNG_INFO_cHRM, PNG_INFO_PLTE, + PNG_INFO_tRNS, PNG_INFO_bKGD, + PNG_INFO_hIST, PNG_INFO_pHYs, + PNG_INFO_oFFs, PNG_INFO_tIME, + PNG_INFO_pCAL, PNG_INFO_sRGB, + PNG_INFO_iCCP, PNG_INFO_sPLT, + PNG_INFO_sCAL, PNG_INFO_IDAT + +For a more compact example of reading a PNG image, see the file example.c. + +Reading PNG files progressively + +The progressive reader is slightly different then the non-progressive +reader. Instead of calling png_read_info(), png_read_rows(), and +png_read_end(), you make one call to png_process_data(), which calls +callbacks when it has the info, a row, or the end of the image. You +set up these callbacks with png_set_progressive_read_fn(). You don't +have to worry about the input/output functions of libpng, as you are +giving the library the data directly in png_process_data(). I will +assume that you have read the section on reading PNG files above, +so I will only highlight the differences (although I will show +all of the code). + +png_structp png_ptr; +png_infop info_ptr; + + /* An example code fragment of how you would + initialize the progressive reader in your + application. */ + int + initialize_png_reader() + { + png_ptr = png_create_read_struct + (PNG_LIBPNG_VER_STRING, (png_voidp)user_error_ptr, + user_error_fn, user_warning_fn); + if (!png_ptr) + return (ERROR); + info_ptr = png_create_info_struct(png_ptr); + if (!info_ptr) + { + png_destroy_read_struct(&png_ptr, (png_infopp)NULL, + (png_infopp)NULL); + return (ERROR); + } + + if (setjmp(png_jmpbuf(png_ptr))) + { + png_destroy_read_struct(&png_ptr, &info_ptr, + (png_infopp)NULL); + return (ERROR); + } + + /* This one's new. You can provide functions + to be called when the header info is valid, + when each row is completed, and when the image + is finished. If you aren't using all functions, + you can specify NULL parameters. Even when all + three functions are NULL, you need to call + png_set_progressive_read_fn(). You can use + any struct as the user_ptr (cast to a void pointer + for the function call), and retrieve the pointer + from inside the callbacks using the function + + png_get_progressive_ptr(png_ptr); + + which will return a void pointer, which you have + to cast appropriately. + */ + png_set_progressive_read_fn(png_ptr, (void *)user_ptr, + info_callback, row_callback, end_callback); + + return 0; + } + + /* A code fragment that you call as you receive blocks + of data */ + int + process_data(png_bytep buffer, png_uint_32 length) + { + if (setjmp(png_jmpbuf(png_ptr))) + { + png_destroy_read_struct(&png_ptr, &info_ptr, + (png_infopp)NULL); + return (ERROR); + } + + /* This one's new also. Simply give it a chunk + of data from the file stream (in order, of + course). On machines with segmented memory + models machines, don't give it any more than + 64K. The library seems to run fine with sizes + of 4K. Although you can give it much less if + necessary (I assume you can give it chunks of + 1 byte, I haven't tried less then 256 bytes + yet). When this function returns, you may + want to display any rows that were generated + in the row callback if you don't already do + so there. + */ + png_process_data(png_ptr, info_ptr, buffer, length); + return 0; + } + + /* This function is called (as set by + png_set_progressive_read_fn() above) when enough data + has been supplied so all of the header has been + read. + */ + void + info_callback(png_structp png_ptr, png_infop info) + { + /* Do any setup here, including setting any of + the transformations mentioned in the Reading + PNG files section. For now, you _must_ call + either png_start_read_image() or + png_read_update_info() after all the + transformations are set (even if you don't set + any). You may start getting rows before + png_process_data() returns, so this is your + last chance to prepare for that. + */ + } + + /* This function is called when each row of image + data is complete */ + void + row_callback(png_structp png_ptr, png_bytep new_row, + png_uint_32 row_num, int pass) + { + /* If the image is interlaced, and you turned + on the interlace handler, this function will + be called for every row in every pass. Some + of these rows will not be changed from the + previous pass. When the row is not changed, + the new_row variable will be NULL. The rows + and passes are called in order, so you don't + really need the row_num and pass, but I'm + supplying them because it may make your life + easier. + + For the non-NULL rows of interlaced images, + you must call png_progressive_combine_row() + passing in the row and the old row. You can + call this function for NULL rows (it will just + return) and for non-interlaced images (it just + does the memcpy for you) if it will make the + code easier. Thus, you can just do this for + all cases: + */ + + png_progressive_combine_row(png_ptr, old_row, + new_row); + + /* where old_row is what was displayed for + previously for the row. Note that the first + pass (pass == 0, really) will completely cover + the old row, so the rows do not have to be + initialized. After the first pass (and only + for interlaced images), you will have to pass + the current row, and the function will combine + the old row and the new row. + */ + } + + void + end_callback(png_structp png_ptr, png_infop info) + { + /* This function is called after the whole image + has been read, including any chunks after the + image (up to and including the IEND). You + will usually have the same info chunk as you + had in the header, although some data may have + been added to the comments and time fields. + + Most people won't do much here, perhaps setting + a flag that marks the image as finished. + */ + } + + + +IV. Writing + +Much of this is very similar to reading. However, everything of +importance is repeated here, so you won't have to constantly look +back up in the reading section to understand writing. + +Setup + +You will want to do the I/O initialization before you get into libpng, +so if it doesn't work, you don't have anything to undo. If you are not +using the standard I/O functions, you will need to replace them with +custom writing functions. See the discussion under Customizing libpng. + + FILE *fp = fopen(file_name, "wb"); + if (!fp) + { + return (ERROR); + } + +Next, png_struct and png_info need to be allocated and initialized. +As these can be both relatively large, you may not want to store these +on the stack, unless you have stack space to spare. Of course, you +will want to check if they return NULL. If you are also reading, +you won't want to name your read structure and your write structure +both "png_ptr"; you can call them anything you like, such as +"read_ptr" and "write_ptr". Look at pngtest.c, for example. + + png_structp png_ptr = png_create_write_struct + (PNG_LIBPNG_VER_STRING, (png_voidp)user_error_ptr, + user_error_fn, user_warning_fn); + if (!png_ptr) + return (ERROR); + + png_infop info_ptr = png_create_info_struct(png_ptr); + if (!info_ptr) + { + png_destroy_write_struct(&png_ptr, + (png_infopp)NULL); + return (ERROR); + } + +If you want to use your own memory allocation routines, +define PNG_USER_MEM_SUPPORTED and use +png_create_write_struct_2() instead of png_create_write_struct(): + + png_structp png_ptr = png_create_write_struct_2 + (PNG_LIBPNG_VER_STRING, (png_voidp)user_error_ptr, + user_error_fn, user_warning_fn, (png_voidp) + user_mem_ptr, user_malloc_fn, user_free_fn); + +After you have these structures, you will need to set up the +error handling. When libpng encounters an error, it expects to +longjmp() back to your routine. Therefore, you will need to call +setjmp() and pass the png_jmpbuf(png_ptr). If you +write the file from different routines, you will need to update +the png_jmpbuf(png_ptr) every time you enter a new routine that will +call a png_*() function. See your documentation of setjmp/longjmp +for your compiler for more information on setjmp/longjmp. See +the discussion on libpng error handling in the Customizing Libpng +section below for more information on the libpng error handling. + + if (setjmp(png_jmpbuf(png_ptr))) + { + png_destroy_write_struct(&png_ptr, &info_ptr); + fclose(fp); + return (ERROR); + } + ... + return; + +If you would rather avoid the complexity of setjmp/longjmp issues, +you can compile libpng with PNG_SETJMP_NOT_SUPPORTED, in which case +errors will result in a call to PNG_ABORT() which defaults to abort(). + +Now you need to set up the output code. The default for libpng is to +use the C function fwrite(). If you use this, you will need to pass a +valid FILE * in the function png_init_io(). Be sure that the file is +opened in binary mode. Again, if you wish to handle writing data in +another way, see the discussion on libpng I/O handling in the Customizing +Libpng section below. + + png_init_io(png_ptr, fp); + +If you are embedding your PNG into a datastream such as MNG, and don't +want libpng to write the 8-byte signature, or if you have already +written the signature in your application, use + + png_set_sig_bytes(png_ptr, 8); + +to inform libpng that it should not write a signature. + +Write callbacks + +At this point, you can set up a callback function that will be +called after each row has been written, which you can use to control +a progress meter or the like. It's demonstrated in pngtest.c. +You must supply a function + + void write_row_callback(png_ptr, png_uint_32 row, + int pass); + { + /* put your code here */ + } + +(You can give it another name that you like instead of "write_row_callback") + +To inform libpng about your function, use + + png_set_write_status_fn(png_ptr, write_row_callback); + +You now have the option of modifying how the compression library will +run. The following functions are mainly for testing, but may be useful +in some cases, like if you need to write PNG files extremely fast and +are willing to give up some compression, or if you want to get the +maximum possible compression at the expense of slower writing. If you +have no special needs in this area, let the library do what it wants by +not calling this function at all, as it has been tuned to deliver a good +speed/compression ratio. The second parameter to png_set_filter() is +the filter method, for which the only valid values are 0 (as of the +July 1999 PNG specification, version 1.2) or 64 (if you are writing +a PNG datastream that is to be embedded in a MNG datastream). The third +parameter is a flag that indicates which filter type(s) are to be tested +for each scanline. See the PNG specification for details on the specific +filter types. + + + /* turn on or off filtering, and/or choose + specific filters. You can use either a single + PNG_FILTER_VALUE_NAME or the bitwise OR of one + or more PNG_FILTER_NAME masks. */ + png_set_filter(png_ptr, 0, + PNG_FILTER_NONE | PNG_FILTER_VALUE_NONE | + PNG_FILTER_SUB | PNG_FILTER_VALUE_SUB | + PNG_FILTER_UP | PNG_FILTER_VALUE_UP | + PNG_FILTER_AVG | PNG_FILTER_VALUE_AVG | + PNG_FILTER_PAETH | PNG_FILTER_VALUE_PAETH| + PNG_ALL_FILTERS); + +If an application +wants to start and stop using particular filters during compression, +it should start out with all of the filters (to ensure that the previous +row of pixels will be stored in case it's needed later), and then add +and remove them after the start of compression. + +If you are writing a PNG datastream that is to be embedded in a MNG +datastream, the second parameter can be either 0 or 64. + +The png_set_compression_*() functions interface to the zlib compression +library, and should mostly be ignored unless you really know what you are +doing. The only generally useful call is png_set_compression_level() +which changes how much time zlib spends on trying to compress the image +data. See the Compression Library (zlib.h and algorithm.txt, distributed +with zlib) for details on the compression levels. + + /* set the zlib compression level */ + png_set_compression_level(png_ptr, + Z_BEST_COMPRESSION); + + /* set other zlib parameters */ + png_set_compression_mem_level(png_ptr, 8); + png_set_compression_strategy(png_ptr, + Z_DEFAULT_STRATEGY); + png_set_compression_window_bits(png_ptr, 15); + png_set_compression_method(png_ptr, 8); + png_set_compression_buffer_size(png_ptr, 8192) + +extern PNG_EXPORT(void,png_set_zbuf_size) + +Setting the contents of info for output + +You now need to fill in the png_info structure with all the data you +wish to write before the actual image. Note that the only thing you +are allowed to write after the image is the text chunks and the time +chunk (as of PNG Specification 1.2, anyway). See png_write_end() and +the latest PNG specification for more information on that. If you +wish to write them before the image, fill them in now, and flag that +data as being valid. If you want to wait until after the data, don't +fill them until png_write_end(). For all the fields in png_info and +their data types, see png.h. For explanations of what the fields +contain, see the PNG specification. + +Some of the more important parts of the png_info are: + + png_set_IHDR(png_ptr, info_ptr, width, height, + bit_depth, color_type, interlace_type, + compression_type, filter_method) + width - holds the width of the image + in pixels (up to 2^31). + height - holds the height of the image + in pixels (up to 2^31). + bit_depth - holds the bit depth of one of the + image channels. + (valid values are 1, 2, 4, 8, 16 + and depend also on the + color_type. See also significant + bits (sBIT) below). + color_type - describes which color/alpha + channels are present. + PNG_COLOR_TYPE_GRAY + (bit depths 1, 2, 4, 8, 16) + PNG_COLOR_TYPE_GRAY_ALPHA + (bit depths 8, 16) + PNG_COLOR_TYPE_PALETTE + (bit depths 1, 2, 4, 8) + PNG_COLOR_TYPE_RGB + (bit_depths 8, 16) + PNG_COLOR_TYPE_RGB_ALPHA + (bit_depths 8, 16) + + PNG_COLOR_MASK_PALETTE + PNG_COLOR_MASK_COLOR + PNG_COLOR_MASK_ALPHA + + interlace_type - PNG_INTERLACE_NONE or + PNG_INTERLACE_ADAM7 + compression_type - (must be + PNG_COMPRESSION_TYPE_DEFAULT) + filter_method - (must be PNG_FILTER_TYPE_DEFAULT + or, if you are writing a PNG to + be embedded in a MNG datastream, + can also be + PNG_INTRAPIXEL_DIFFERENCING) + +If you call png_set_IHDR(), the call must appear before any of the +other png_set_*() functions, because they might require access to some of +the IHDR settings. The remaining png_set_*() functions can be called +in any order. + +If you wish, you can reset the compression_type, interlace_type, or +filter_method later by calling png_set_IHDR() again; if you do this, the +width, height, bit_depth, and color_type must be the same in each call. + + png_set_PLTE(png_ptr, info_ptr, palette, + num_palette); + palette - the palette for the file + (array of png_color) + num_palette - number of entries in the palette + + png_set_gAMA(png_ptr, info_ptr, gamma); + gamma - the gamma the image was created + at (PNG_INFO_gAMA) + + png_set_sRGB(png_ptr, info_ptr, srgb_intent); + srgb_intent - the rendering intent + (PNG_INFO_sRGB) The presence of + the sRGB chunk means that the pixel + data is in the sRGB color space. + This chunk also implies specific + values of gAMA and cHRM. Rendering + intent is the CSS-1 property that + has been defined by the International + Color Consortium + (http://www.color.org). + It can be one of + PNG_sRGB_INTENT_SATURATION, + PNG_sRGB_INTENT_PERCEPTUAL, + PNG_sRGB_INTENT_ABSOLUTE, or + PNG_sRGB_INTENT_RELATIVE. + + + png_set_sRGB_gAMA_and_cHRM(png_ptr, info_ptr, + srgb_intent); + srgb_intent - the rendering intent + (PNG_INFO_sRGB) The presence of the + sRGB chunk means that the pixel + data is in the sRGB color space. + This function also causes gAMA and + cHRM chunks with the specific values + that are consistent with sRGB to be + written. + + png_set_iCCP(png_ptr, info_ptr, name, compression_type, + profile, proflen); + name - The profile name. + compression - The compression type; always + PNG_COMPRESSION_TYPE_BASE for PNG 1.0. + You may give NULL to this argument to + ignore it. + profile - International Color Consortium color + profile data. May contain NULs. + proflen - length of profile data in bytes. + + png_set_sBIT(png_ptr, info_ptr, sig_bit); + sig_bit - the number of significant bits for + (PNG_INFO_sBIT) each of the gray, red, + green, and blue channels, whichever are + appropriate for the given color type + (png_color_16) + + png_set_tRNS(png_ptr, info_ptr, trans, num_trans, + trans_values); + trans - array of transparent + entries for palette (PNG_INFO_tRNS) + trans_values - graylevel or color sample values + (in order red, green, blue) of the + single transparent color for + non-paletted images (PNG_INFO_tRNS) + num_trans - number of transparent entries + (PNG_INFO_tRNS) + + png_set_hIST(png_ptr, info_ptr, hist); + (PNG_INFO_hIST) + hist - histogram of palette (array of + png_uint_16) + + png_set_tIME(png_ptr, info_ptr, mod_time); + mod_time - time image was last modified + (PNG_VALID_tIME) + + png_set_bKGD(png_ptr, info_ptr, background); + background - background color (PNG_VALID_bKGD) + + png_set_text(png_ptr, info_ptr, text_ptr, num_text); + text_ptr - array of png_text holding image + comments + text_ptr[i].compression - type of compression used + on "text" PNG_TEXT_COMPRESSION_NONE + PNG_TEXT_COMPRESSION_zTXt + PNG_ITXT_COMPRESSION_NONE + PNG_ITXT_COMPRESSION_zTXt + text_ptr[i].key - keyword for comment. Must contain + 1-79 characters. + text_ptr[i].text - text comments for current + keyword. Can be NULL or empty. + text_ptr[i].text_length - length of text string, + after decompression, 0 for iTXt + text_ptr[i].itxt_length - length of itxt string, + after decompression, 0 for tEXt/zTXt + text_ptr[i].lang - language of comment (NULL or + empty for unknown). + text_ptr[i].translated_keyword - keyword in UTF-8 (NULL + or empty for unknown). + Note that the itxt_length, lang, and lang_key + members of the text_ptr structure only exist + when the library is built with iTXt chunk support. + + num_text - number of comments + + png_set_sPLT(png_ptr, info_ptr, &palette_ptr, + num_spalettes); + palette_ptr - array of png_sPLT_struct structures + to be added to the list of palettes + in the info structure. + num_spalettes - number of palette structures to be + added. + + png_set_oFFs(png_ptr, info_ptr, offset_x, offset_y, + unit_type); + offset_x - positive offset from the left + edge of the screen + offset_y - positive offset from the top + edge of the screen + unit_type - PNG_OFFSET_PIXEL, PNG_OFFSET_MICROMETER + + png_set_pHYs(png_ptr, info_ptr, res_x, res_y, + unit_type); + res_x - pixels/unit physical resolution + in x direction + res_y - pixels/unit physical resolution + in y direction + unit_type - PNG_RESOLUTION_UNKNOWN, + PNG_RESOLUTION_METER + + png_set_sCAL(png_ptr, info_ptr, unit, width, height) + unit - physical scale units (an integer) + width - width of a pixel in physical scale units + height - height of a pixel in physical scale units + (width and height are doubles) + + png_set_sCAL_s(png_ptr, info_ptr, unit, width, height) + unit - physical scale units (an integer) + width - width of a pixel in physical scale units + height - height of a pixel in physical scale units + (width and height are strings like "2.54") + + png_set_unknown_chunks(png_ptr, info_ptr, &unknowns, + num_unknowns) + unknowns - array of png_unknown_chunk + structures holding unknown chunks + unknowns[i].name - name of unknown chunk + unknowns[i].data - data of unknown chunk + unknowns[i].size - size of unknown chunk's data + unknowns[i].location - position to write chunk in file + 0: do not write chunk + PNG_HAVE_IHDR: before PLTE + PNG_HAVE_PLTE: before IDAT + PNG_AFTER_IDAT: after IDAT + +The "location" member is set automatically according to +what part of the output file has already been written. +You can change its value after calling png_set_unknown_chunks() +as demonstrated in pngtest.c. Within each of the "locations", +the chunks are sequenced according to their position in the +structure (that is, the value of "i", which is the order in which +the chunk was either read from the input file or defined with +png_set_unknown_chunks). + +A quick word about text and num_text. text is an array of png_text +structures. num_text is the number of valid structures in the array. +Each png_text structure holds a language code, a keyword, a text value, +and a compression type. + +The compression types have the same valid numbers as the compression +types of the image data. Currently, the only valid number is zero. +However, you can store text either compressed or uncompressed, unlike +images, which always have to be compressed. So if you don't want the +text compressed, set the compression type to PNG_TEXT_COMPRESSION_NONE. +Because tEXt and zTXt chunks don't have a language field, if you +specify PNG_TEXT_COMPRESSION_NONE or PNG_TEXT_COMPRESSION_zTXt +any language code or translated keyword will not be written out. + +Until text gets around 1000 bytes, it is not worth compressing it. +After the text has been written out to the file, the compression type +is set to PNG_TEXT_COMPRESSION_NONE_WR or PNG_TEXT_COMPRESSION_zTXt_WR, +so that it isn't written out again at the end (in case you are calling +png_write_end() with the same struct. + +The keywords that are given in the PNG Specification are: + + Title Short (one line) title or + caption for image + Author Name of image's creator + Description Description of image (possibly long) + Copyright Copyright notice + Creation Time Time of original image creation + (usually RFC 1123 format, see below) + Software Software used to create the image + Disclaimer Legal disclaimer + Warning Warning of nature of content + Source Device used to create the image + Comment Miscellaneous comment; conversion + from other image format + +The keyword-text pairs work like this. Keywords should be short +simple descriptions of what the comment is about. Some typical +keywords are found in the PNG specification, as is some recommendations +on keywords. You can repeat keywords in a file. You can even write +some text before the image and some after. For example, you may want +to put a description of the image before the image, but leave the +disclaimer until after, so viewers working over modem connections +don't have to wait for the disclaimer to go over the modem before +they start seeing the image. Finally, keywords should be full +words, not abbreviations. Keywords and text are in the ISO 8859-1 +(Latin-1) character set (a superset of regular ASCII) and can not +contain NUL characters, and should not contain control or other +unprintable characters. To make the comments widely readable, stick +with basic ASCII, and avoid machine specific character set extensions +like the IBM-PC character set. The keyword must be present, but +you can leave off the text string on non-compressed pairs. +Compressed pairs must have a text string, as only the text string +is compressed anyway, so the compression would be meaningless. + +PNG supports modification time via the png_time structure. Two +conversion routines are provided, png_convert_from_time_t() for +time_t and png_convert_from_struct_tm() for struct tm. The +time_t routine uses gmtime(). You don't have to use either of +these, but if you wish to fill in the png_time structure directly, +you should provide the time in universal time (GMT) if possible +instead of your local time. Note that the year number is the full +year (e.g. 1998, rather than 98 - PNG is year 2000 compliant!), and +that months start with 1. + +If you want to store the time of the original image creation, you should +use a plain tEXt chunk with the "Creation Time" keyword. This is +necessary because the "creation time" of a PNG image is somewhat vague, +depending on whether you mean the PNG file, the time the image was +created in a non-PNG format, a still photo from which the image was +scanned, or possibly the subject matter itself. In order to facilitate +machine-readable dates, it is recommended that the "Creation Time" +tEXt chunk use RFC 1123 format dates (e.g. "22 May 1997 18:07:10 GMT"), +although this isn't a requirement. Unlike the tIME chunk, the +"Creation Time" tEXt chunk is not expected to be automatically changed +by the software. To facilitate the use of RFC 1123 dates, a function +png_convert_to_rfc1123(png_timep) is provided to convert from PNG +time to an RFC 1123 format string. + +Writing unknown chunks + +You can use the png_set_unknown_chunks function to queue up chunks +for writing. You give it a chunk name, raw data, and a size; that's +all there is to it. The chunks will be written by the next following +png_write_info_before_PLTE, png_write_info, or png_write_end function. +Any chunks previously read into the info structure's unknown-chunk +list will also be written out in a sequence that satisfies the PNG +specification's ordering rules. + +The high-level write interface + +At this point there are two ways to proceed; through the high-level +write interface, or through a sequence of low-level write operations. +You can use the high-level interface if your image data is present +in the info structure. All defined output +transformations are permitted, enabled by the following masks. + + PNG_TRANSFORM_IDENTITY No transformation + PNG_TRANSFORM_PACKING Pack 1, 2 and 4-bit samples + PNG_TRANSFORM_PACKSWAP Change order of packed + pixels to LSB first + PNG_TRANSFORM_INVERT_MONO Invert monochrome images + PNG_TRANSFORM_SHIFT Normalize pixels to the + sBIT depth + PNG_TRANSFORM_BGR Flip RGB to BGR, RGBA + to BGRA + PNG_TRANSFORM_SWAP_ALPHA Flip RGBA to ARGB or GA + to AG + PNG_TRANSFORM_INVERT_ALPHA Change alpha from opacity + to transparency + PNG_TRANSFORM_SWAP_ENDIAN Byte-swap 16-bit samples + PNG_TRANSFORM_STRIP_FILLER Strip out filler + bytes (deprecated). + PNG_TRANSFORM_STRIP_FILLER_BEFORE Strip out leading + filler bytes + PNG_TRANSFORM_STRIP_FILLER_AFTER Strip out trailing + filler bytes + +If you have valid image data in the info structure (you can use +png_set_rows() to put image data in the info structure), simply do this: + + png_write_png(png_ptr, info_ptr, png_transforms, NULL) + +where png_transforms is an integer containing the bitwise OR of some set of +transformation flags. This call is equivalent to png_write_info(), +followed the set of transformations indicated by the transform mask, +then png_write_image(), and finally png_write_end(). + +(The final parameter of this call is not yet used. Someday it might point +to transformation parameters required by some future output transform.) + +You must use png_transforms and not call any png_set_transform() functions +when you use png_write_png(). + +The low-level write interface + +If you are going the low-level route instead, you are now ready to +write all the file information up to the actual image data. You do +this with a call to png_write_info(). + + png_write_info(png_ptr, info_ptr); + +Note that there is one transformation you may need to do before +png_write_info(). In PNG files, the alpha channel in an image is the +level of opacity. If your data is supplied as a level of transparency, +you can invert the alpha channel before you write it, so that 0 is +fully transparent and 255 (in 8-bit or paletted images) or 65535 +(in 16-bit images) is fully opaque, with + + png_set_invert_alpha(png_ptr); + +This must appear before png_write_info() instead of later with the +other transformations because in the case of paletted images the tRNS +chunk data has to be inverted before the tRNS chunk is written. If +your image is not a paletted image, the tRNS data (which in such cases +represents a single color to be rendered as transparent) won't need to +be changed, and you can safely do this transformation after your +png_write_info() call. + +If you need to write a private chunk that you want to appear before +the PLTE chunk when PLTE is present, you can write the PNG info in +two steps, and insert code to write your own chunk between them: + + png_write_info_before_PLTE(png_ptr, info_ptr); + png_set_unknown_chunks(png_ptr, info_ptr, ...); + png_write_info(png_ptr, info_ptr); + +After you've written the file information, you can set up the library +to handle any special transformations of the image data. The various +ways to transform the data will be described in the order that they +should occur. This is important, as some of these change the color +type and/or bit depth of the data, and some others only work on +certain color types and bit depths. Even though each transformation +checks to see if it has data that it can do something with, you should +make sure to only enable a transformation if it will be valid for the +data. For example, don't swap red and blue on grayscale data. + +PNG files store RGB pixels packed into 3 or 6 bytes. This code tells +the library to strip input data that has 4 or 8 bytes per pixel down +to 3 or 6 bytes (or strip 2 or 4-byte grayscale+filler data to 1 or 2 +bytes per pixel). + + png_set_filler(png_ptr, 0, PNG_FILLER_BEFORE); + +where the 0 is unused, and the location is either PNG_FILLER_BEFORE or +PNG_FILLER_AFTER, depending upon whether the filler byte in the pixel +is stored XRGB or RGBX. + +PNG files pack pixels of bit depths 1, 2, and 4 into bytes as small as +they can, resulting in, for example, 8 pixels per byte for 1 bit files. +If the data is supplied at 1 pixel per byte, use this code, which will +correctly pack the pixels into a single byte: + + png_set_packing(png_ptr); + +PNG files reduce possible bit depths to 1, 2, 4, 8, and 16. If your +data is of another bit depth, you can write an sBIT chunk into the +file so that decoders can recover the original data if desired. + + /* Set the true bit depth of the image data */ + if (color_type & PNG_COLOR_MASK_COLOR) + { + sig_bit.red = true_bit_depth; + sig_bit.green = true_bit_depth; + sig_bit.blue = true_bit_depth; + } + else + { + sig_bit.gray = true_bit_depth; + } + if (color_type & PNG_COLOR_MASK_ALPHA) + { + sig_bit.alpha = true_bit_depth; + } + + png_set_sBIT(png_ptr, info_ptr, &sig_bit); + +If the data is stored in the row buffer in a bit depth other than +one supported by PNG (e.g. 3 bit data in the range 0-7 for a 4-bit PNG), +this will scale the values to appear to be the correct bit depth as +is required by PNG. + + png_set_shift(png_ptr, &sig_bit); + +PNG files store 16 bit pixels in network byte order (big-endian, +ie. most significant bits first). This code would be used if they are +supplied the other way (little-endian, i.e. least significant bits +first, the way PCs store them): + + if (bit_depth > 8) + png_set_swap(png_ptr); + +If you are using packed-pixel images (1, 2, or 4 bits/pixel), and you +need to change the order the pixels are packed into bytes, you can use: + + if (bit_depth < 8) + png_set_packswap(png_ptr); + +PNG files store 3 color pixels in red, green, blue order. This code +would be used if they are supplied as blue, green, red: + + png_set_bgr(png_ptr); + +PNG files describe monochrome as black being zero and white being +one. This code would be used if the pixels are supplied with this reversed +(black being one and white being zero): + + png_set_invert_mono(png_ptr); + +Finally, you can write your own transformation function if none of +the existing ones meets your needs. This is done by setting a callback +with + + png_set_write_user_transform_fn(png_ptr, + write_transform_fn); + +You must supply the function + + void write_transform_fn(png_ptr ptr, row_info_ptr + row_info, png_bytep data) + +See pngtest.c for a working example. Your function will be called +before any of the other transformations are processed. + +You can also set up a pointer to a user structure for use by your +callback function. + + png_set_user_transform_info(png_ptr, user_ptr, 0, 0); + +The user_channels and user_depth parameters of this function are ignored +when writing; you can set them to zero as shown. + +You can retrieve the pointer via the function png_get_user_transform_ptr(). +For example: + + voidp write_user_transform_ptr = + png_get_user_transform_ptr(png_ptr); + +It is possible to have libpng flush any pending output, either manually, +or automatically after a certain number of lines have been written. To +flush the output stream a single time call: + + png_write_flush(png_ptr); + +and to have libpng flush the output stream periodically after a certain +number of scanlines have been written, call: + + png_set_flush(png_ptr, nrows); + +Note that the distance between rows is from the last time png_write_flush() +was called, or the first row of the image if it has never been called. +So if you write 50 lines, and then png_set_flush 25, it will flush the +output on the next scanline, and every 25 lines thereafter, unless +png_write_flush() is called before 25 more lines have been written. +If nrows is too small (less than about 10 lines for a 640 pixel wide +RGB image) the image compression may decrease noticeably (although this +may be acceptable for real-time applications). Infrequent flushing will +only degrade the compression performance by a few percent over images +that do not use flushing. + +Writing the image data + +That's it for the transformations. Now you can write the image data. +The simplest way to do this is in one function call. If you have the +whole image in memory, you can just call png_write_image() and libpng +will write the image. You will need to pass in an array of pointers to +each row. This function automatically handles interlacing, so you don't +need to call png_set_interlace_handling() or call this function multiple +times, or any of that other stuff necessary with png_write_rows(). + + png_write_image(png_ptr, row_pointers); + +where row_pointers is: + + png_byte *row_pointers[height]; + +You can point to void or char or whatever you use for pixels. + +If you don't want to write the whole image at once, you can +use png_write_rows() instead. If the file is not interlaced, +this is simple: + + png_write_rows(png_ptr, row_pointers, + number_of_rows); + +row_pointers is the same as in the png_write_image() call. + +If you are just writing one row at a time, you can do this with +a single row_pointer instead of an array of row_pointers: + + png_bytep row_pointer = row; + + png_write_row(png_ptr, row_pointer); + +When the file is interlaced, things can get a good deal more complicated. +The only currently (as of the PNG Specification version 1.2, dated July +1999) defined interlacing scheme for PNG files is the "Adam7" interlace +scheme, that breaks down an image into seven smaller images of varying +size. libpng will build these images for you, or you can do them +yourself. If you want to build them yourself, see the PNG specification +for details of which pixels to write when. + +If you don't want libpng to handle the interlacing details, just +use png_set_interlace_handling() and call png_write_rows() the +correct number of times to write all seven sub-images. + +If you want libpng to build the sub-images, call this before you start +writing any rows: + + number_of_passes = + png_set_interlace_handling(png_ptr); + +This will return the number of passes needed. Currently, this is seven, +but may change if another interlace type is added. + +Then write the complete image number_of_passes times. + + png_write_rows(png_ptr, row_pointers, + number_of_rows); + +As some of these rows are not used, and thus return immediately, you may +want to read about interlacing in the PNG specification, and only update +the rows that are actually used. + +Finishing a sequential write + +After you are finished writing the image, you should finish writing +the file. If you are interested in writing comments or time, you should +pass an appropriately filled png_info pointer. If you are not interested, +you can pass NULL. + + png_write_end(png_ptr, info_ptr); + +When you are done, you can free all memory used by libpng like this: + + png_destroy_write_struct(&png_ptr, &info_ptr); + +It is also possible to individually free the info_ptr members that +point to libpng-allocated storage with the following function: + + png_free_data(png_ptr, info_ptr, mask, seq) + mask - identifies data to be freed, a mask + containing the bitwise OR of one or + more of + PNG_FREE_PLTE, PNG_FREE_TRNS, + PNG_FREE_HIST, PNG_FREE_ICCP, + PNG_FREE_PCAL, PNG_FREE_ROWS, + PNG_FREE_SCAL, PNG_FREE_SPLT, + PNG_FREE_TEXT, PNG_FREE_UNKN, + or simply PNG_FREE_ALL + seq - sequence number of item to be freed + (-1 for all items) + +This function may be safely called when the relevant storage has +already been freed, or has not yet been allocated, or was allocated +by the user and not by libpng, and will in those cases do nothing. +The "seq" parameter is ignored if only one item of the selected data +type, such as PLTE, is allowed. If "seq" is not -1, and multiple items +are allowed for the data type identified in the mask, such as text or +sPLT, only the n'th item in the structure is freed, where n is "seq". + +If you allocated data such as a palette that you passed in to libpng +with png_set_*, you must not free it until just before the call to +png_destroy_write_struct(). + +The default behavior is only to free data that was allocated internally +by libpng. This can be changed, so that libpng will not free the data, +or so that it will free data that was allocated by the user with png_malloc() +or png_zalloc() and passed in via a png_set_*() function, with + + png_data_freer(png_ptr, info_ptr, freer, mask) + mask - which data elements are affected + same choices as in png_free_data() + freer - one of + PNG_DESTROY_WILL_FREE_DATA + PNG_SET_WILL_FREE_DATA + PNG_USER_WILL_FREE_DATA + +For example, to transfer responsibility for some data from a read structure +to a write structure, you could use + + png_data_freer(read_ptr, read_info_ptr, + PNG_USER_WILL_FREE_DATA, + PNG_FREE_PLTE|PNG_FREE_tRNS|PNG_FREE_hIST) + png_data_freer(write_ptr, write_info_ptr, + PNG_DESTROY_WILL_FREE_DATA, + PNG_FREE_PLTE|PNG_FREE_tRNS|PNG_FREE_hIST) + +thereby briefly reassigning responsibility for freeing to the user but +immediately afterwards reassigning it once more to the write_destroy +function. Having done this, it would then be safe to destroy the read +structure and continue to use the PLTE, tRNS, and hIST data in the write +structure. + +This function only affects data that has already been allocated. +You can call this function before calling after the png_set_*() functions +to control whether the user or png_destroy_*() is supposed to free the data. +When the user assumes responsibility for libpng-allocated data, the +application must use +png_free() to free it, and when the user transfers responsibility to libpng +for data that the user has allocated, the user must have used png_malloc() +or png_zalloc() to allocate it. + +If you allocated text_ptr.text, text_ptr.lang, and text_ptr.translated_keyword +separately, do not transfer responsibility for freeing text_ptr to libpng, +because when libpng fills a png_text structure it combines these members with +the key member, and png_free_data() will free only text_ptr.key. Similarly, +if you transfer responsibility for free'ing text_ptr from libpng to your +application, your application must not separately free those members. +For a more compact example of writing a PNG image, see the file example.c. + +V. Modifying/Customizing libpng: + +There are two issues here. The first is changing how libpng does +standard things like memory allocation, input/output, and error handling. +The second deals with more complicated things like adding new chunks, +adding new transformations, and generally changing how libpng works. +Both of those are compile-time issues; that is, they are generally +determined at the time the code is written, and there is rarely a need +to provide the user with a means of changing them. + +Memory allocation, input/output, and error handling + +All of the memory allocation, input/output, and error handling in libpng +goes through callbacks that are user-settable. The default routines are +in pngmem.c, pngrio.c, pngwio.c, and pngerror.c, respectively. To change +these functions, call the appropriate png_set_*_fn() function. + +Memory allocation is done through the functions png_malloc(), png_calloc(), +and png_free(). These currently just call the standard C functions. +png_calloc() calls png_malloc() and then png_memset() to clear the newly +allocated memory to zero. If your pointers can't access more then 64K +at a time, you will want to set MAXSEG_64K in zlib.h. Since it is +unlikely that the method of handling memory allocation on a platform +will change between applications, these functions must be modified in +the library at compile time. If you prefer to use a different method +of allocating and freeing data, you can use png_create_read_struct_2() or +png_create_write_struct_2() to register your own functions as described +above. These functions also provide a void pointer that can be retrieved +via + + mem_ptr=png_get_mem_ptr(png_ptr); + +Your replacement memory functions must have prototypes as follows: + + png_voidp malloc_fn(png_structp png_ptr, + png_size_t size); + void free_fn(png_structp png_ptr, png_voidp ptr); + +Your malloc_fn() must return NULL in case of failure. The png_malloc() +function will normally call png_error() if it receives a NULL from the +system memory allocator or from your replacement malloc_fn(). + +Your free_fn() will never be called with a NULL ptr, since libpng's +png_free() checks for NULL before calling free_fn(). + +Input/Output in libpng is done through png_read() and png_write(), +which currently just call fread() and fwrite(). The FILE * is stored in +png_struct and is initialized via png_init_io(). If you wish to change +the method of I/O, the library supplies callbacks that you can set +through the function png_set_read_fn() and png_set_write_fn() at run +time, instead of calling the png_init_io() function. These functions +also provide a void pointer that can be retrieved via the function +png_get_io_ptr(). For example: + + png_set_read_fn(png_structp read_ptr, + voidp read_io_ptr, png_rw_ptr read_data_fn) + + png_set_write_fn(png_structp write_ptr, + voidp write_io_ptr, png_rw_ptr write_data_fn, + png_flush_ptr output_flush_fn); + + voidp read_io_ptr = png_get_io_ptr(read_ptr); + voidp write_io_ptr = png_get_io_ptr(write_ptr); + +The replacement I/O functions must have prototypes as follows: + + void user_read_data(png_structp png_ptr, + png_bytep data, png_size_t length); + void user_write_data(png_structp png_ptr, + png_bytep data, png_size_t length); + void user_flush_data(png_structp png_ptr); + +The user_read_data() function is responsible for detecting and +handling end-of-data errors. + +Supplying NULL for the read, write, or flush functions sets them back +to using the default C stream functions, which expect the io_ptr to +point to a standard *FILE structure. It is probably a mistake +to use NULL for one of write_data_fn and output_flush_fn but not both +of them, unless you have built libpng with PNG_NO_WRITE_FLUSH defined. +It is an error to read from a write stream, and vice versa. + +Error handling in libpng is done through png_error() and png_warning(). +Errors handled through png_error() are fatal, meaning that png_error() +should never return to its caller. Currently, this is handled via +setjmp() and longjmp() (unless you have compiled libpng with +PNG_SETJMP_NOT_SUPPORTED, in which case it is handled via PNG_ABORT()), +but you could change this to do things like exit() if you should wish. + +On non-fatal errors, png_warning() is called +to print a warning message, and then control returns to the calling code. +By default png_error() and png_warning() print a message on stderr via +fprintf() unless the library is compiled with PNG_NO_CONSOLE_IO defined +(because you don't want the messages) or PNG_NO_STDIO defined (because +fprintf() isn't available). If you wish to change the behavior of the error +functions, you will need to set up your own message callbacks. These +functions are normally supplied at the time that the png_struct is created. +It is also possible to redirect errors and warnings to your own replacement +functions after png_create_*_struct() has been called by calling: + + png_set_error_fn(png_structp png_ptr, + png_voidp error_ptr, png_error_ptr error_fn, + png_error_ptr warning_fn); + + png_voidp error_ptr = png_get_error_ptr(png_ptr); + +If NULL is supplied for either error_fn or warning_fn, then the libpng +default function will be used, calling fprintf() and/or longjmp() if a +problem is encountered. The replacement error functions should have +parameters as follows: + + void user_error_fn(png_structp png_ptr, + png_const_charp error_msg); + void user_warning_fn(png_structp png_ptr, + png_const_charp warning_msg); + +The motivation behind using setjmp() and longjmp() is the C++ throw and +catch exception handling methods. This makes the code much easier to write, +as there is no need to check every return code of every function call. +However, there are some uncertainties about the status of local variables +after a longjmp, so the user may want to be careful about doing anything +after setjmp returns non-zero besides returning itself. Consult your +compiler documentation for more details. For an alternative approach, you +may wish to use the "cexcept" facility (see http://cexcept.sourceforge.net). + +Custom chunks + +If you need to read or write custom chunks, you may need to get deeper +into the libpng code. The library now has mechanisms for storing +and writing chunks of unknown type; you can even declare callbacks +for custom chunks. However, this may not be good enough if the +library code itself needs to know about interactions between your +chunk and existing `intrinsic' chunks. + +If you need to write a new intrinsic chunk, first read the PNG +specification. Acquire a first level of understanding of how it works. +Pay particular attention to the sections that describe chunk names, +and look at how other chunks were designed, so you can do things +similarly. Second, check out the sections of libpng that read and +write chunks. Try to find a chunk that is similar to yours and use +it as a template. More details can be found in the comments inside +the code. It is best to handle unknown chunks in a generic method, +via callback functions, instead of by modifying libpng functions. + +If you wish to write your own transformation for the data, look through +the part of the code that does the transformations, and check out some of +the simpler ones to get an idea of how they work. Try to find a similar +transformation to the one you want to add and copy off of it. More details +can be found in the comments inside the code itself. + +Configuring for 16 bit platforms + +You will want to look into zconf.h to tell zlib (and thus libpng) that +it cannot allocate more then 64K at a time. Even if you can, the memory +won't be accessible. So limit zlib and libpng to 64K by defining MAXSEG_64K. + +Configuring for DOS + +For DOS users who only have access to the lower 640K, you will +have to limit zlib's memory usage via a png_set_compression_mem_level() +call. See zlib.h or zconf.h in the zlib library for more information. + +Configuring for Medium Model + +Libpng's support for medium model has been tested on most of the popular +compilers. Make sure MAXSEG_64K gets defined, USE_FAR_KEYWORD gets +defined, and FAR gets defined to far in pngconf.h, and you should be +all set. Everything in the library (except for zlib's structure) is +expecting far data. You must use the typedefs with the p or pp on +the end for pointers (or at least look at them and be careful). Make +note that the rows of data are defined as png_bytepp, which is an +unsigned char far * far *. + +Configuring for gui/windowing platforms: + +You will need to write new error and warning functions that use the GUI +interface, as described previously, and set them to be the error and +warning functions at the time that png_create_*_struct() is called, +in order to have them available during the structure initialization. +They can be changed later via png_set_error_fn(). On some compilers, +you may also have to change the memory allocators (png_malloc, etc.). + +Configuring for compiler xxx: + +All includes for libpng are in pngconf.h. If you need to add, change +or delete an include, this is the place to do it. +The includes that are not needed outside libpng are protected by the +PNG_INTERNAL definition, which is only defined for those routines inside +libpng itself. The files in libpng proper only include png.h, which +includes pngconf.h. + +Configuring zlib: + +There are special functions to configure the compression. Perhaps the +most useful one changes the compression level, which currently uses +input compression values in the range 0 - 9. The library normally +uses the default compression level (Z_DEFAULT_COMPRESSION = 6). Tests +have shown that for a large majority of images, compression values in +the range 3-6 compress nearly as well as higher levels, and do so much +faster. For online applications it may be desirable to have maximum speed +(Z_BEST_SPEED = 1). With versions of zlib after v0.99, you can also +specify no compression (Z_NO_COMPRESSION = 0), but this would create +files larger than just storing the raw bitmap. You can specify the +compression level by calling: + + png_set_compression_level(png_ptr, level); + +Another useful one is to reduce the memory level used by the library. +The memory level defaults to 8, but it can be lowered if you are +short on memory (running DOS, for example, where you only have 640K). +Note that the memory level does have an effect on compression; among +other things, lower levels will result in sections of incompressible +data being emitted in smaller stored blocks, with a correspondingly +larger relative overhead of up to 15% in the worst case. + + png_set_compression_mem_level(png_ptr, level); + +The other functions are for configuring zlib. They are not recommended +for normal use and may result in writing an invalid PNG file. See +zlib.h for more information on what these mean. + + png_set_compression_strategy(png_ptr, + strategy); + png_set_compression_window_bits(png_ptr, + window_bits); + png_set_compression_method(png_ptr, method); + png_set_compression_buffer_size(png_ptr, size); + +Controlling row filtering + +If you want to control whether libpng uses filtering or not, which +filters are used, and how it goes about picking row filters, you +can call one of these functions. The selection and configuration +of row filters can have a significant impact on the size and +encoding speed and a somewhat lesser impact on the decoding speed +of an image. Filtering is enabled by default for RGB and grayscale +images (with and without alpha), but not for paletted images nor +for any images with bit depths less than 8 bits/pixel. + +The 'method' parameter sets the main filtering method, which is +currently only '0' in the PNG 1.2 specification. The 'filters' +parameter sets which filter(s), if any, should be used for each +scanline. Possible values are PNG_ALL_FILTERS and PNG_NO_FILTERS +to turn filtering on and off, respectively. + +Individual filter types are PNG_FILTER_NONE, PNG_FILTER_SUB, +PNG_FILTER_UP, PNG_FILTER_AVG, PNG_FILTER_PAETH, which can be bitwise +ORed together with '|' to specify one or more filters to use. +These filters are described in more detail in the PNG specification. +If you intend to change the filter type during the course of writing +the image, you should start with flags set for all of the filters +you intend to use so that libpng can initialize its internal +structures appropriately for all of the filter types. (Note that this +means the first row must always be adaptively filtered, because libpng +currently does not allocate the filter buffers until png_write_row() +is called for the first time.) + + filters = PNG_FILTER_NONE | PNG_FILTER_SUB + PNG_FILTER_UP | PNG_FILTER_AVG | + PNG_FILTER_PAETH | PNG_ALL_FILTERS; + + png_set_filter(png_ptr, PNG_FILTER_TYPE_BASE, + filters); + The second parameter can also be + PNG_INTRAPIXEL_DIFFERENCING if you are + writing a PNG to be embedded in a MNG + datastream. This parameter must be the + same as the value of filter_method used + in png_set_IHDR(). + +It is also possible to influence how libpng chooses from among the +available filters. This is done in one or both of two ways - by +telling it how important it is to keep the same filter for successive +rows, and by telling it the relative computational costs of the filters. + + double weights[3] = {1.5, 1.3, 1.1}, + costs[PNG_FILTER_VALUE_LAST] = + {1.0, 1.3, 1.3, 1.5, 1.7}; + + png_set_filter_heuristics(png_ptr, + PNG_FILTER_HEURISTIC_WEIGHTED, 3, + weights, costs); + +The weights are multiplying factors that indicate to libpng that the +row filter should be the same for successive rows unless another row filter +is that many times better than the previous filter. In the above example, +if the previous 3 filters were SUB, SUB, NONE, the SUB filter could have a +"sum of absolute differences" 1.5 x 1.3 times higher than other filters +and still be chosen, while the NONE filter could have a sum 1.1 times +higher than other filters and still be chosen. Unspecified weights are +taken to be 1.0, and the specified weights should probably be declining +like those above in order to emphasize recent filters over older filters. + +The filter costs specify for each filter type a relative decoding cost +to be considered when selecting row filters. This means that filters +with higher costs are less likely to be chosen over filters with lower +costs, unless their "sum of absolute differences" is that much smaller. +The costs do not necessarily reflect the exact computational speeds of +the various filters, since this would unduly influence the final image +size. + +Note that the numbers above were invented purely for this example and +are given only to help explain the function usage. Little testing has +been done to find optimum values for either the costs or the weights. + +Removing unwanted object code + +There are a bunch of #define's in pngconf.h that control what parts of +libpng are compiled. All the defines end in _SUPPORTED. If you are +never going to use a capability, you can change the #define to #undef +before recompiling libpng and save yourself code and data space, or +you can turn off individual capabilities with defines that begin with +PNG_NO_. + +You can also turn all of the transforms and ancillary chunk capabilities +off en masse with compiler directives that define +PNG_NO_READ[or WRITE]_TRANSFORMS, or PNG_NO_READ[or WRITE]_ANCILLARY_CHUNKS, +or all four, +along with directives to turn on any of the capabilities that you do +want. The PNG_NO_READ[or WRITE]_TRANSFORMS directives disable the extra +transformations but still leave the library fully capable of reading +and writing PNG files with all known public chunks. Use of the +PNG_NO_READ[or WRITE]_ANCILLARY_CHUNKS directive produces a library +that is incapable of reading or writing ancillary chunks. If you are +not using the progressive reading capability, you can turn that off +with PNG_NO_PROGRESSIVE_READ (don't confuse this with the INTERLACING +capability, which you'll still have). + +All the reading and writing specific code are in separate files, so the +linker should only grab the files it needs. However, if you want to +make sure, or if you are building a stand alone library, all the +reading files start with pngr and all the writing files start with +pngw. The files that don't match either (like png.c, pngtrans.c, etc.) +are used for both reading and writing, and always need to be included. +The progressive reader is in pngpread.c + +If you are creating or distributing a dynamically linked library (a .so +or DLL file), you should not remove or disable any parts of the library, +as this will cause applications linked with different versions of the +library to fail if they call functions not available in your library. +The size of the library itself should not be an issue, because only +those sections that are actually used will be loaded into memory. + +Requesting debug printout + +The macro definition PNG_DEBUG can be used to request debugging +printout. Set it to an integer value in the range 0 to 3. Higher +numbers result in increasing amounts of debugging information. The +information is printed to the "stderr" file, unless another file +name is specified in the PNG_DEBUG_FILE macro definition. + +When PNG_DEBUG > 0, the following functions (macros) become available: + + png_debug(level, message) + png_debug1(level, message, p1) + png_debug2(level, message, p1, p2) + +in which "level" is compared to PNG_DEBUG to decide whether to print +the message, "message" is the formatted string to be printed, +and p1 and p2 are parameters that are to be embedded in the string +according to printf-style formatting directives. For example, + + png_debug1(2, "foo=%d\n", foo); + +is expanded to + + if(PNG_DEBUG > 2) + fprintf(PNG_DEBUG_FILE, "foo=%d\n", foo); + +When PNG_DEBUG is defined but is zero, the macros aren't defined, but you +can still use PNG_DEBUG to control your own debugging: + + #ifdef PNG_DEBUG + fprintf(stderr, ... + #endif + +When PNG_DEBUG = 1, the macros are defined, but only png_debug statements +having level = 0 will be printed. There aren't any such statements in +this version of libpng, but if you insert some they will be printed. + +VI. MNG support + +The MNG specification (available at http://www.libpng.org/pub/mng) allows +certain extensions to PNG for PNG images that are embedded in MNG datastreams. +Libpng can support some of these extensions. To enable them, use the +png_permit_mng_features() function: + + feature_set = png_permit_mng_features(png_ptr, mask) + mask is a png_uint_32 containing the bitwise OR of the + features you want to enable. These include + PNG_FLAG_MNG_EMPTY_PLTE + PNG_FLAG_MNG_FILTER_64 + PNG_ALL_MNG_FEATURES + feature_set is a png_uint_32 that is the bitwise AND of + your mask with the set of MNG features that is + supported by the version of libpng that you are using. + +It is an error to use this function when reading or writing a standalone +PNG file with the PNG 8-byte signature. The PNG datastream must be wrapped +in a MNG datastream. As a minimum, it must have the MNG 8-byte signature +and the MHDR and MEND chunks. Libpng does not provide support for these +or any other MNG chunks; your application must provide its own support for +them. You may wish to consider using libmng (available at +http://www.libmng.com) instead. + +VII. Changes to Libpng from version 0.88 + +It should be noted that versions of libpng later than 0.96 are not +distributed by the original libpng author, Guy Schalnat, nor by +Andreas Dilger, who had taken over from Guy during 1996 and 1997, and +distributed versions 0.89 through 0.96, but rather by another member +of the original PNG Group, Glenn Randers-Pehrson. Guy and Andreas are +still alive and well, but they have moved on to other things. + +The old libpng functions png_read_init(), png_write_init(), +png_info_init(), png_read_destroy(), and png_write_destroy() have been +moved to PNG_INTERNAL in version 0.95 to discourage their use. These +functions will be removed from libpng version 2.0.0. + +The preferred method of creating and initializing the libpng structures is +via the png_create_read_struct(), png_create_write_struct(), and +png_create_info_struct() because they isolate the size of the structures +from the application, allow version error checking, and also allow the +use of custom error handling routines during the initialization, which +the old functions do not. The functions png_read_destroy() and +png_write_destroy() do not actually free the memory that libpng +allocated for these structs, but just reset the data structures, so they +can be used instead of png_destroy_read_struct() and +png_destroy_write_struct() if you feel there is too much system overhead +allocating and freeing the png_struct for each image read. + +Setting the error callbacks via png_set_message_fn() before +png_read_init() as was suggested in libpng-0.88 is no longer supported +because this caused applications that do not use custom error functions +to fail if the png_ptr was not initialized to zero. It is still possible +to set the error callbacks AFTER png_read_init(), or to change them with +png_set_error_fn(), which is essentially the same function, but with a new +name to force compilation errors with applications that try to use the old +method. + +Starting with version 1.0.7, you can find out which version of the library +you are using at run-time: + + png_uint_32 libpng_vn = png_access_version_number(); + +The number libpng_vn is constructed from the major version, minor +version with leading zero, and release number with leading zero, +(e.g., libpng_vn for version 1.0.7 is 10007). + +You can also check which version of png.h you used when compiling your +application: + + png_uint_32 application_vn = PNG_LIBPNG_VER; + +VIII. Changes to Libpng from version 1.0.x to 1.2.x + +Support for user memory management was enabled by default. To +accomplish this, the functions png_create_read_struct_2(), +png_create_write_struct_2(), png_set_mem_fn(), png_get_mem_ptr(), +png_malloc_default(), and png_free_default() were added. + +Support for the iTXt chunk has been enabled by default as of +version 1.2.41. + +Support for certain MNG features was enabled. + +Support for numbered error messages was added. However, we never got +around to actually numbering the error messages. The function +png_set_strip_error_numbers() was added (Note: the prototype for this +function was inadvertently removed from png.h in PNG_NO_ASSEMBLER_CODE +builds of libpng-1.2.15. It was restored in libpng-1.2.36). + +The png_malloc_warn() function was added at libpng-1.2.3. This issues +a png_warning and returns NULL instead of aborting when it fails to +acquire the requested memory allocation. + +Support for setting user limits on image width and height was enabled +by default. The functions png_set_user_limits(), png_get_user_width_max(), +and png_get_user_height_max() were added at libpng-1.2.6. + +The png_set_add_alpha() function was added at libpng-1.2.7. + +The function png_set_expand_gray_1_2_4_to_8() was added at libpng-1.2.9. +Unlike png_set_gray_1_2_4_to_8(), the new function does not expand the +tRNS chunk to alpha. The png_set_gray_1_2_4_to_8() function is +deprecated. + +A number of macro definitions in support of runtime selection of +assembler code features (especially Intel MMX code support) were +added at libpng-1.2.0: + + PNG_ASM_FLAG_MMX_SUPPORT_COMPILED + PNG_ASM_FLAG_MMX_SUPPORT_IN_CPU + PNG_ASM_FLAG_MMX_READ_COMBINE_ROW + PNG_ASM_FLAG_MMX_READ_INTERLACE + PNG_ASM_FLAG_MMX_READ_FILTER_SUB + PNG_ASM_FLAG_MMX_READ_FILTER_UP + PNG_ASM_FLAG_MMX_READ_FILTER_AVG + PNG_ASM_FLAG_MMX_READ_FILTER_PAETH + PNG_ASM_FLAGS_INITIALIZED + PNG_MMX_READ_FLAGS + PNG_MMX_FLAGS + PNG_MMX_WRITE_FLAGS + PNG_MMX_FLAGS + +We added the following functions in support of runtime +selection of assembler code features: + + png_get_mmx_flagmask() + png_set_mmx_thresholds() + png_get_asm_flags() + png_get_mmx_bitdepth_threshold() + png_get_mmx_rowbytes_threshold() + png_set_asm_flags() + +We replaced all of these functions with simple stubs in libpng-1.2.20, +when the Intel assembler code was removed due to a licensing issue. + +These macros are deprecated: + + PNG_READ_TRANSFORMS_NOT_SUPPORTED + PNG_PROGRESSIVE_READ_NOT_SUPPORTED + PNG_NO_SEQUENTIAL_READ_SUPPORTED + PNG_WRITE_TRANSFORMS_NOT_SUPPORTED + PNG_READ_ANCILLARY_CHUNKS_NOT_SUPPORTED + PNG_WRITE_ANCILLARY_CHUNKS_NOT_SUPPORTED + +They have been replaced, respectively, by: + + PNG_NO_READ_TRANSFORMS + PNG_NO_PROGRESSIVE_READ + PNG_NO_SEQUENTIAL_READ + PNG_NO_WRITE_TRANSFORMS + PNG_NO_READ_ANCILLARY_CHUNKS + PNG_NO_WRITE_ANCILLARY_CHUNKS + +PNG_MAX_UINT was replaced with PNG_UINT_31_MAX. It has been +deprecated since libpng-1.0.16 and libpng-1.2.6. + +The function + png_check_sig(sig, num) +was replaced with + !png_sig_cmp(sig, 0, num) +It has been deprecated since libpng-0.90. + +The function + png_set_gray_1_2_4_to_8() +which also expands tRNS to alpha was replaced with + png_set_expand_gray_1_2_4_to_8() +which does not. It has been deprecated since libpng-1.0.18 and 1.2.9. + +IX. (Omitted) + + +X. Detecting libpng + +The png_get_io_ptr() function has been present since libpng-0.88, has never +changed, and is unaffected by conditional compilation macros. It is the +best choice for use in configure scripts for detecting the presence of any +libpng version since 0.88. In an autoconf "configure.in" you could use + + AC_CHECK_LIB(png, png_get_io_ptr, ... + +XI. Source code repository + +Since about February 2009, version 1.2.34, libpng has been under "git" source +control. The git repository was built from old libpng-x.y.z.tar.gz files +going back to version 0.70. You can access the git repository (read only) +at + + git://libpng.git.sourceforge.net/gitroot/libpng + +or you can browse it via "gitweb" at + + http://libpng.git.sourceforge.net/git/gitweb.cgi?p=libpng + +Patches can be sent to glennrp at users.sourceforge.net or to +png-mng-implement at lists.sourceforge.net or you can upload them to +the libpng bug tracker at + + http://libpng.sourceforge.net + +XII. Coding style + +Our coding style is similar to the "Allman" style, with curly +braces on separate lines: + + if (condition) + { + action; + } + + else if (another condition) + { + another action; + } + +The braces can be omitted from simple one-line actions: + + if (condition) + return (0); + +We use 3-space indentation, except for continued statements which +are usually indented the same as the first line of the statement +plus four more spaces. + +For macro definitions we use 2-space indentation, always leaving the "#" +in the first column. + + #ifndef PNG_NO_FEATURE + # ifndef PNG_FEATURE_SUPPORTED + # define PNG_FEATURE_SUPPORTED + # endif + #endif + +Comments appear with the leading "/*" at the same indentation as +the statement that follows the comment: + + /* Single-line comment */ + statement; + + /* Multiple-line + * comment + */ + statement; + +Very short comments can be placed at the end of the statement +to which they pertain: + + statement; /* comment */ + +We don't use C++ style ("//") comments. We have, however, +used them in the past in some now-abandoned MMX assembler +code. + +Functions and their curly braces are not indented, and +exported functions are marked with PNGAPI: + + /* This is a public function that is visible to + * application programers. It does thus-and-so. + */ + void PNGAPI + png_exported_function(png_ptr, png_info, foo) + { + body; + } + +The prototypes for all exported functions appear in png.h, +above the comment that says + + /* Maintainer: Put new public prototypes here ... */ + +We mark all non-exported functions with "/* PRIVATE */"": + + void /* PRIVATE */ + png_non_exported_function(png_ptr, png_info, foo) + { + body; + } + +The prototypes for non-exported functions (except for those in +pngtest) appear in +the PNG_INTERNAL section of png.h +above the comment that says + + /* Maintainer: Put new private prototypes here ^ and in libpngpf.3 */ + +The names of all exported functions and variables begin +with "png_", and all publicly visible C preprocessor +macros begin with "PNG". + +We put a space after each comma and after each semicolon +in "for" statments, and we put spaces before and after each +C binary operator and after "for" or "while". We don't +put a space between a typecast and the expression being +cast, nor do we put one between a function name and the +left parenthesis that follows it: + + for (i = 2; i > 0; --i) + y[i] = a(x) + (int)b; + +We prefer #ifdef and #ifndef to #if defined() and if !defined() +when there is only one macro being tested. + +We do not use the TAB character for indentation in the C sources. + +Lines do not exceed 80 characters. + +Other rules can be inferred by inspecting the libpng source. + +XIII. Y2K Compliance in libpng + +March 29, 2012 + +Since the PNG Development group is an ad-hoc body, we can't make +an official declaration. + +This is your unofficial assurance that libpng from version 0.71 and +upward through 1.2.49 are Y2K compliant. It is my belief that earlier +versions were also Y2K compliant. + +Libpng only has three year fields. One is a 2-byte unsigned integer that +will hold years up to 65535. The other two hold the date in text +format, and will hold years up to 9999. + +The integer is + "png_uint_16 year" in png_time_struct. + +The strings are + "png_charp time_buffer" in png_struct and + "near_time_buffer", which is a local character string in png.c. + +There are seven time-related functions: + + png_convert_to_rfc_1123() in png.c + (formerly png_convert_to_rfc_1152() in error) + png_convert_from_struct_tm() in pngwrite.c, called + in pngwrite.c + png_convert_from_time_t() in pngwrite.c + png_get_tIME() in pngget.c + png_handle_tIME() in pngrutil.c, called in pngread.c + png_set_tIME() in pngset.c + png_write_tIME() in pngwutil.c, called in pngwrite.c + +All appear to handle dates properly in a Y2K environment. The +png_convert_from_time_t() function calls gmtime() to convert from system +clock time, which returns (year - 1900), which we properly convert to +the full 4-digit year. There is a possibility that applications using +libpng are not passing 4-digit years into the png_convert_to_rfc_1123() +function, or that they are incorrectly passing only a 2-digit year +instead of "year - 1900" into the png_convert_from_struct_tm() function, +but this is not under our control. The libpng documentation has always +stated that it works with 4-digit years, and the APIs have been +documented as such. + +The tIME chunk itself is also Y2K compliant. It uses a 2-byte unsigned +integer to hold the year, and can hold years as large as 65535. + +zlib, upon which libpng depends, is also Y2K compliant. It contains +no date-related code. + + + Glenn Randers-Pehrson + libpng maintainer + PNG Development Group diff --git a/external/libpng/libpng.3 b/external/libpng/libpng.3 new file mode 100644 index 0000000..61e0017 --- /dev/null +++ b/external/libpng/libpng.3 @@ -0,0 +1,4510 @@ +.TH LIBPNG 3 "March 29, 2012" +.SH NAME +libpng \- Portable Network Graphics (PNG) Reference Library 1.2.49 +.SH SYNOPSIS +\fI\fB + +\fB#include \fP + +\fI\fB + +\fBpng_uint_32 png_access_version_number \fI(void\fP\fB);\fP + +\fI\fB + +\fBint png_check_sig (png_bytep \fP\fIsig\fP\fB, int \fInum\fP\fB);\fP + +\fI\fB + +\fBvoid png_chunk_error (png_structp \fP\fIpng_ptr\fP\fB, png_const_charp \fIerror\fP\fB);\fP + +\fI\fB + +\fBvoid png_chunk_warning (png_structp \fP\fIpng_ptr\fP\fB, png_const_charp \fImessage\fP\fB);\fP + +\fI\fB + +\fBvoid png_convert_from_struct_tm (png_timep \fP\fIptime\fP\fB, struct tm FAR * \fIttime\fP\fB);\fP + +\fI\fB + +\fBvoid png_convert_from_time_t (png_timep \fP\fIptime\fP\fB, time_t \fIttime\fP\fB);\fP + +\fI\fB + +\fBpng_charp png_convert_to_rfc1123 (png_structp \fP\fIpng_ptr\fP\fB, png_timep \fIptime\fP\fB);\fP + +\fI\fB + +\fBpng_infop png_create_info_struct (png_structp \fIpng_ptr\fP\fB);\fP + +\fI\fB + +\fBpng_structp png_create_read_struct (png_const_charp \fP\fIuser_png_ver\fP\fB, png_voidp \fP\fIerror_ptr\fP\fB, png_error_ptr \fP\fIerror_fn\fP\fB, png_error_ptr \fIwarn_fn\fP\fB);\fP + +\fI\fB + +\fBpng_structp png_create_read_struct_2(png_const_charp \fP\fIuser_png_ver\fP\fB, png_voidp \fP\fIerror_ptr\fP\fB, png_error_ptr \fP\fIerror_fn\fP\fB, png_error_ptr \fP\fIwarn_fn\fP\fB, png_voidp \fP\fImem_ptr\fP\fB, png_malloc_ptr \fP\fImalloc_fn\fP\fB, png_free_ptr \fIfree_fn\fP\fB);\fP + +\fI\fB + +\fBpng_structp png_create_write_struct (png_const_charp \fP\fIuser_png_ver\fP\fB, png_voidp \fP\fIerror_ptr\fP\fB, png_error_ptr \fP\fIerror_fn\fP\fB, png_error_ptr \fIwarn_fn\fP\fB);\fP + +\fI\fB + +\fBpng_structp png_create_write_struct_2(png_const_charp \fP\fIuser_png_ver\fP\fB, png_voidp \fP\fIerror_ptr\fP\fB, png_error_ptr \fP\fIerror_fn\fP\fB, png_error_ptr \fP\fIwarn_fn\fP\fB, png_voidp \fP\fImem_ptr\fP\fB, png_malloc_ptr \fP\fImalloc_fn\fP\fB, png_free_ptr \fIfree_fn\fP\fB);\fP + +\fI\fB + +\fBint png_debug(int \fP\fIlevel\fP\fB, png_const_charp \fImessage\fP\fB);\fP + +\fI\fB + +\fBint png_debug1(int \fP\fIlevel\fP\fB, png_const_charp \fP\fImessage\fP\fB, \fIp1\fP\fB);\fP + +\fI\fB + +\fBint png_debug2(int \fP\fIlevel\fP\fB, png_const_charp \fP\fImessage\fP\fB, \fP\fIp1\fP\fB, \fIp2\fP\fB);\fP + +\fI\fB + +\fBvoid png_destroy_info_struct (png_structp \fP\fIpng_ptr\fP\fB, png_infopp \fIinfo_ptr_ptr\fP\fB);\fP + +\fI\fB + +\fBvoid png_destroy_read_struct (png_structpp \fP\fIpng_ptr_ptr\fP\fB, png_infopp \fP\fIinfo_ptr_ptr\fP\fB, png_infopp \fIend_info_ptr_ptr\fP\fB);\fP + +\fI\fB + +\fBvoid png_destroy_write_struct (png_structpp \fP\fIpng_ptr_ptr\fP\fB, png_infopp \fIinfo_ptr_ptr\fP\fB);\fP + +\fI\fB + +\fBvoid png_error (png_structp \fP\fIpng_ptr\fP\fB, png_const_charp \fIerror\fP\fB);\fP + +\fI\fB + +\fBvoid png_free (png_structp \fP\fIpng_ptr\fP\fB, png_voidp \fIptr\fP\fB);\fP + +\fI\fB + +\fBvoid png_free_chunk_list (png_structp \fIpng_ptr\fP\fB);\fP + +\fI\fB + +\fBvoid png_free_default(png_structp \fP\fIpng_ptr\fP\fB, png_voidp \fIptr\fP\fB);\fP + +\fI\fB + +\fBvoid png_free_data (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, int \fInum\fP\fB);\fP + +\fI\fB + +\fBpng_byte png_get_bit_depth (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP + +\fI\fB + +\fBpng_uint_32 png_get_bKGD (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_color_16p \fI*background\fP\fB);\fP + +\fI\fB + +\fBpng_byte png_get_channels (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP + +\fI\fB + +\fBpng_uint_32 png_get_cHRM (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, double \fP\fI*white_x\fP\fB, double \fP\fI*white_y\fP\fB, double \fP\fI*red_x\fP\fB, double \fP\fI*red_y\fP\fB, double \fP\fI*green_x\fP\fB, double \fP\fI*green_y\fP\fB, double \fP\fI*blue_x\fP\fB, double \fI*blue_y\fP\fB);\fP + +\fI\fB + +\fBpng_uint_32 png_get_cHRM_fixed (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fP\fI*white_x\fP\fB, png_uint_32 \fP\fI*white_y\fP\fB, png_uint_32 \fP\fI*red_x\fP\fB, png_uint_32 \fP\fI*red_y\fP\fB, png_uint_32 \fP\fI*green_x\fP\fB, png_uint_32 \fP\fI*green_y\fP\fB, png_uint_32 \fP\fI*blue_x\fP\fB, png_uint_32 \fI*blue_y\fP\fB);\fP + +\fI\fB + +\fBpng_byte png_get_color_type (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP + +\fI\fB + +\fBpng_byte png_get_compression_type (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP + +\fI\fB + +\fBpng_byte png_get_copyright (png_structp \fIpng_ptr\fP\fB);\fP + +\fI\fB + +\fBpng_voidp png_get_error_ptr (png_structp \fIpng_ptr\fP\fB);\fP + +\fI\fB + +\fBpng_byte png_get_filter_type (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP + +\fI\fB + +\fBpng_uint_32 png_get_gAMA (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, double \fI*file_gamma\fP\fB);\fP + +\fI\fB + +\fBpng_uint_32 png_get_gAMA_fixed (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fI*int_file_gamma\fP\fB);\fP + +\fI\fB + +\fBpng_byte png_get_header_ver (png_structp \fIpng_ptr\fP\fB);\fP + +\fI\fB + +\fBpng_byte png_get_header_version (png_structp \fIpng_ptr\fP\fB);\fP + +\fI\fB + +\fBpng_uint_32 png_get_hIST (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_16p \fI*hist\fP\fB);\fP + +\fI\fB + +\fBpng_uint_32 png_get_iCCP (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_charpp \fP\fIname\fP\fB, int \fP\fI*compression_type\fP\fB, png_charpp \fP\fIprofile\fP\fB, png_uint_32 \fI*proflen\fP\fB);\fP + +\fI\fB + +\fBpng_uint_32 png_get_IHDR (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fP\fI*width\fP\fB, png_uint_32 \fP\fI*height\fP\fB, int \fP\fI*bit_depth\fP\fB, int \fP\fI*color_type\fP\fB, int \fP\fI*interlace_type\fP\fB, int \fP\fI*compression_type\fP\fB, int \fI*filter_type\fP\fB);\fP + +\fI\fB + +\fBpng_uint_32 png_get_image_height (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP + +\fI\fB + +\fBpng_uint_32 png_get_image_width (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP + +\fI\fB + +\fB#if \fI!defined(PNG_1_0_X) + +\fBpng_int_32 png_get_int_32 (png_bytep \fIbuf\fP\fB);\fP + +\fI\fB#endif + +\fI\fB + +\fBpng_byte png_get_interlace_type (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP + +\fI\fB + +\fBpng_voidp png_get_io_ptr (png_structp \fIpng_ptr\fP\fB);\fP + +\fI\fB + +\fBpng_byte png_get_libpng_ver (png_structp \fIpng_ptr\fP\fB);\fP + +\fI\fB + +\fBpng_voidp png_get_mem_ptr(png_structp \fIpng_ptr\fP\fB);\fP + +\fI\fB + +\fBpng_uint_32 png_get_oFFs (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fP\fI*offset_x\fP\fB, png_uint_32 \fP\fI*offset_y\fP\fB, int \fI*unit_type\fP\fB);\fP + +\fI\fB + +\fBpng_uint_32 png_get_pCAL (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_charp \fP\fI*purpose\fP\fB, png_int_32 \fP\fI*X0\fP\fB, png_int_32 \fP\fI*X1\fP\fB, int \fP\fI*type\fP\fB, int \fP\fI*nparams\fP\fB, png_charp \fP\fI*units\fP\fB, png_charpp \fI*params\fP\fB);\fP + +\fI\fB + +\fBpng_uint_32 png_get_pHYs (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fP\fI*res_x\fP\fB, png_uint_32 \fP\fI*res_y\fP\fB, int \fI*unit_type\fP\fB);\fP + +\fI\fB + +\fBfloat png_get_pixel_aspect_ratio (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP + +\fI\fB + +\fBpng_uint_32 png_get_pixels_per_meter (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP + +\fI\fB + +\fBpng_voidp png_get_progressive_ptr (png_structp \fIpng_ptr\fP\fB);\fP + +\fI\fB + +\fBpng_uint_32 png_get_PLTE (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_colorp \fP\fI*palette\fP\fB, int \fI*num_palette\fP\fB);\fP + +\fI\fB + +\fBpng_byte png_get_rgb_to_gray_status (png_structp \fIpng_ptr) + +\fBpng_uint_32 png_get_rowbytes (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP + +\fI\fB + +\fBpng_bytepp png_get_rows (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP + +\fI\fB + +\fBpng_uint_32 png_get_sBIT (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_color_8p \fI*sig_bit\fP\fB);\fP + +\fI\fB + +\fBpng_bytep png_get_signature (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP + +\fI\fB + +\fBpng_uint_32 png_get_sPLT (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_spalette_p \fI*splt_ptr\fP\fB);\fP + +\fI\fB + +\fBpng_uint_32 png_get_sRGB (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, int \fI*intent\fP\fB);\fP + +\fI\fB + +\fBpng_uint_32 png_get_text (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_textp \fP\fI*text_ptr\fP\fB, int \fI*num_text\fP\fB);\fP + +\fI\fB + +\fBpng_uint_32 png_get_tIME (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_timep \fI*mod_time\fP\fB);\fP + +\fI\fB + +\fBpng_uint_32 png_get_tRNS (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_bytep \fP\fI*trans\fP\fB, int \fP\fI*num_trans\fP\fB, png_color_16p \fI*trans_values\fP\fB);\fP + +\fI\fB + +\fB#if \fI!defined(PNG_1_0_X) + +\fBpng_uint_16 png_get_uint_16 (png_bytep \fIbuf\fP\fB);\fP + +\fI\fB + +\fBpng_uint_32 png_get_uint_31 (png_bytep \fIbuf\fP\fB);\fP + +\fI\fB + +\fBpng_uint_32 png_get_uint_32 (png_bytep \fIbuf\fP\fB);\fP + +\fI\fB#endif + +\fI\fB + +\fBpng_uint_32 png_get_unknown_chunks (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_unknown_chunkpp \fIunknowns\fP\fB);\fP + +\fI\fB + +\fBpng_voidp png_get_user_chunk_ptr (png_structp \fIpng_ptr\fP\fB);\fP + +\fI\fB + +\fBpng_uint_32 png_get_user_height_max( png_structp \fIpng_ptr\fP\fB);\fP + +\fI\fB + +\fBpng_voidp png_get_user_transform_ptr (png_structp \fIpng_ptr\fP\fB);\fP + +\fI\fB + +\fBpng_uint_32 png_get_user_width_max (png_structp \fIpng_ptr\fP\fB);\fP + +\fI\fB + +\fBpng_uint_32 png_get_valid (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIflag\fP\fB);\fP + +\fI\fB + +\fBpng_int_32 png_get_x_offset_microns (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP + +\fI\fB + +\fBpng_int_32 png_get_x_offset_pixels (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP + +\fI\fB + +\fBpng_uint_32 png_get_x_pixels_per_meter (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP + +\fI\fB + +\fBpng_int_32 png_get_y_offset_microns (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP + +\fI\fB + +\fBpng_int_32 png_get_y_offset_pixels (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP + +\fI\fB + +\fBpng_uint_32 png_get_y_pixels_per_meter (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP + +\fI\fB + +\fBpng_uint_32 png_get_compression_buffer_size (png_structp \fIpng_ptr\fP\fB);\fP + +\fI\fB + +\fBint png_handle_as_unknown (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fIchunk_name\fP\fB);\fP + +\fI\fB + +\fBvoid png_init_io (png_structp \fP\fIpng_ptr\fP\fB, FILE \fI*fp\fP\fB);\fP + +\fI\fB + +\fBDEPRECATED: void png_info_init (png_infop \fIinfo_ptr\fP\fB);\fP + +\fI\fB + +\fBDEPRECATED: void png_info_init_2 (png_infopp \fP\fIptr_ptr\fP\fB, png_size_t \fIpng_info_struct_size\fP\fB);\fP + +\fI\fB + +\fBpng_voidp png_malloc (png_structp \fP\fIpng_ptr\fP\fB, png_uint_32 \fIsize\fP\fB);\fP + +\fI\fB + +\fBpng_voidp png_malloc_default(png_structp \fP\fIpng_ptr\fP\fB, png_uint_32 \fIsize\fP\fB);\fP + +\fI\fB + +\fBvoidp png_memcpy (png_voidp \fP\fIs1\fP\fB, png_voidp \fP\fIs2\fP\fB, png_size_t \fIsize\fP\fB);\fP + +\fI\fB + +\fBpng_voidp png_memcpy_check (png_structp \fP\fIpng_ptr\fP\fB, png_voidp \fP\fIs1\fP\fB, png_voidp \fP\fIs2\fP\fB, png_uint_32 \fIsize\fP\fB);\fP + +\fI\fB + +\fBvoidp png_memset (png_voidp \fP\fIs1\fP\fB, int \fP\fIvalue\fP\fB, png_size_t \fIsize\fP\fB);\fP + +\fI\fB + +\fBpng_voidp png_memset_check (png_structp \fP\fIpng_ptr\fP\fB, png_voidp \fP\fIs1\fP\fB, int \fP\fIvalue\fP\fB, png_uint_32 \fIsize\fP\fB);\fP + +\fI\fB + +\fBDEPRECATED: void png_permit_empty_plte (png_structp \fP\fIpng_ptr\fP\fB, int \fIempty_plte_permitted\fP\fB);\fP + +\fI\fB + +\fBvoid png_process_data (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_bytep \fP\fIbuffer\fP\fB, png_size_t \fIbuffer_size\fP\fB);\fP + +\fI\fB + +\fBvoid png_progressive_combine_row (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fP\fIold_row\fP\fB, png_bytep \fInew_row\fP\fB);\fP + +\fI\fB + +\fBvoid png_read_destroy (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_infop \fIend_info_ptr\fP\fB);\fP + +\fI\fB + +\fBvoid png_read_end (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP + +\fI\fB + +\fBvoid png_read_image (png_structp \fP\fIpng_ptr\fP\fB, png_bytepp \fIimage\fP\fB);\fP + +\fI\fB + +\fBDEPRECATED: void png_read_init (png_structp \fIpng_ptr\fP\fB);\fP + +\fI\fB + +\fBDEPRECATED: void png_read_init_2 (png_structpp \fP\fIptr_ptr\fP\fB, png_const_charp \fP\fIuser_png_ver\fP\fB, png_size_t \fP\fIpng_struct_size\fP\fB, png_size_t \fIpng_info_size\fP\fB);\fP + +\fI\fB + +\fBvoid png_read_info (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP + +\fI\fB + +\fBvoid png_read_png (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, int \fP\fItransforms\fP\fB, png_voidp \fIparams\fP\fB);\fP + +\fI\fB + +\fBvoid png_read_row (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fP\fIrow\fP\fB, png_bytep \fIdisplay_row\fP\fB);\fP + +\fI\fB + +\fBvoid png_read_rows (png_structp \fP\fIpng_ptr\fP\fB, png_bytepp \fP\fIrow\fP\fB, png_bytepp \fP\fIdisplay_row\fP\fB, png_uint_32 \fInum_rows\fP\fB);\fP + +\fI\fB + +\fBvoid png_read_update_info (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP + +\fI\fB + +\fB#if \fI!defined(PNG_1_0_X) + +\fBpng_save_int_32 (png_bytep \fP\fIbuf\fP\fB, png_int_32 \fIi\fP\fB);\fP + +\fI\fB + +\fBvoid png_save_uint_16 (png_bytep \fP\fIbuf\fP\fB, unsigned int \fIi\fP\fB);\fP + +\fI\fB + +\fBvoid png_save_uint_32 (png_bytep \fP\fIbuf\fP\fB, png_uint_32 \fIi\fP\fB);\fP + +\fI\fB + +\fBvoid png_set_add_alpha (png_structp \fP\fIpng_ptr\fP\fB, png_uint_32 \fP\fIfiller\fP\fB, int \fIflags\fP\fB);\fP + +\fI\fB#endif + +\fI\fB + +\fBvoid png_set_background (png_structp \fP\fIpng_ptr\fP\fB, png_color_16p \fP\fIbackground_color\fP\fB, int \fP\fIbackground_gamma_code\fP\fB, int \fP\fIneed_expand\fP\fB, double \fIbackground_gamma\fP\fB);\fP + +\fI\fB + +\fBvoid png_set_bgr (png_structp \fIpng_ptr\fP\fB);\fP + +\fI\fB + +\fBvoid png_set_bKGD (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_color_16p \fIbackground\fP\fB);\fP + +\fI\fB + +\fBvoid png_set_cHRM (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, double \fP\fIwhite_x\fP\fB, double \fP\fIwhite_y\fP\fB, double \fP\fIred_x\fP\fB, double \fP\fIred_y\fP\fB, double \fP\fIgreen_x\fP\fB, double \fP\fIgreen_y\fP\fB, double \fP\fIblue_x\fP\fB, double \fIblue_y\fP\fB);\fP + +\fI\fB + +\fBvoid png_set_cHRM_fixed (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fP\fIwhite_x\fP\fB, png_uint_32 \fP\fIwhite_y\fP\fB, png_uint_32 \fP\fIred_x\fP\fB, png_uint_32 \fP\fIred_y\fP\fB, png_uint_32 \fP\fIgreen_x\fP\fB, png_uint_32 \fP\fIgreen_y\fP\fB, png_uint_32 \fP\fIblue_x\fP\fB, png_uint_32 \fIblue_y\fP\fB);\fP + +\fI\fB + +\fBvoid png_set_compression_level (png_structp \fP\fIpng_ptr\fP\fB, int \fIlevel\fP\fB);\fP + +\fI\fB + +\fBvoid png_set_compression_mem_level (png_structp \fP\fIpng_ptr\fP\fB, int \fImem_level\fP\fB);\fP + +\fI\fB + +\fBvoid png_set_compression_method (png_structp \fP\fIpng_ptr\fP\fB, int \fImethod\fP\fB);\fP + +\fI\fB + +\fBvoid png_set_compression_strategy (png_structp \fP\fIpng_ptr\fP\fB, int \fIstrategy\fP\fB);\fP + +\fI\fB + +\fBvoid png_set_compression_window_bits (png_structp \fP\fIpng_ptr\fP\fB, int \fIwindow_bits\fP\fB);\fP + +\fI\fB + +\fBvoid png_set_crc_action (png_structp \fP\fIpng_ptr\fP\fB, int \fP\fIcrit_action\fP\fB, int \fIancil_action\fP\fB);\fP + +\fI\fB + +\fBvoid png_set_dither (png_structp \fP\fIpng_ptr\fP\fB, png_colorp \fP\fIpalette\fP\fB, int \fP\fInum_palette\fP\fB, int \fP\fImaximum_colors\fP\fB, png_uint_16p \fP\fIhistogram\fP\fB, int \fIfull_dither\fP\fB);\fP + +\fI\fB + +\fBvoid png_set_error_fn (png_structp \fP\fIpng_ptr\fP\fB, png_voidp \fP\fIerror_ptr\fP\fB, png_error_ptr \fP\fIerror_fn\fP\fB, png_error_ptr \fIwarning_fn\fP\fB);\fP + +\fI\fB + +\fBvoid png_set_expand (png_structp \fIpng_ptr\fP\fB);\fP + +\fI\fB + +\fBvoid png_set_expand_gray_1_2_4_to_8(png_structp \fIpng_ptr\fP\fB);\fP + +\fI\fB + +\fBvoid png_set_filler (png_structp \fP\fIpng_ptr\fP\fB, png_uint_32 \fP\fIfiller\fP\fB, int \fIflags\fP\fB);\fP + +\fI\fB + +\fBvoid png_set_filter (png_structp \fP\fIpng_ptr\fP\fB, int \fP\fImethod\fP\fB, int \fIfilters\fP\fB);\fP + +\fI\fB + +\fBvoid png_set_filter_heuristics (png_structp \fP\fIpng_ptr\fP\fB, int \fP\fIheuristic_method\fP\fB, int \fP\fInum_weights\fP\fB, png_doublep \fP\fIfilter_weights\fP\fB, png_doublep \fIfilter_costs\fP\fB);\fP + +\fI\fB + +\fBvoid png_set_flush (png_structp \fP\fIpng_ptr\fP\fB, int \fInrows\fP\fB);\fP + +\fI\fB + +\fBvoid png_set_gamma (png_structp \fP\fIpng_ptr\fP\fB, double \fP\fIscreen_gamma\fP\fB, double \fIdefault_file_gamma\fP\fB);\fP + +\fI\fB + +\fBvoid png_set_gAMA (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, double \fIfile_gamma\fP\fB);\fP + +\fI\fB + +\fBvoid png_set_gAMA_fixed (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIfile_gamma\fP\fB);\fP + +\fI\fB + +\fBvoid png_set_gray_1_2_4_to_8(png_structp \fIpng_ptr\fP\fB);\fP + +\fI\fB + +\fBvoid png_set_gray_to_rgb (png_structp \fIpng_ptr\fP\fB);\fP + +\fI\fB + +\fBvoid png_set_hIST (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_16p \fIhist\fP\fB);\fP + +\fI\fB + +\fBvoid png_set_iCCP (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_charp \fP\fIname\fP\fB, int \fP\fIcompression_type\fP\fB, png_charp \fP\fIprofile\fP\fB, png_uint_32 \fIproflen\fP\fB);\fP + +\fI\fB + +\fBint png_set_interlace_handling (png_structp \fIpng_ptr\fP\fB);\fP + +\fI\fB + +\fBvoid png_set_invalid (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, int \fImask\fP\fB);\fP + +\fI\fB + +\fBvoid png_set_invert_alpha (png_structp \fIpng_ptr\fP\fB);\fP + +\fI\fB + +\fBvoid png_set_invert_mono (png_structp \fIpng_ptr\fP\fB);\fP + +\fI\fB + +\fBvoid png_set_IHDR (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fP\fIwidth\fP\fB, png_uint_32 \fP\fIheight\fP\fB, int \fP\fIbit_depth\fP\fB, int \fP\fIcolor_type\fP\fB, int \fP\fIinterlace_type\fP\fB, int \fP\fIcompression_type\fP\fB, int \fIfilter_type\fP\fB);\fP + +\fI\fB + +\fBvoid png_set_keep_unknown_chunks (png_structp \fP\fIpng_ptr\fP\fB, int \fP\fIkeep\fP\fB, png_bytep \fP\fIchunk_list\fP\fB, int \fInum_chunks\fP\fB);\fP + +\fI\fB + +\fBvoid png_set_mem_fn(png_structp \fP\fIpng_ptr\fP\fB, png_voidp \fP\fImem_ptr\fP\fB, png_malloc_ptr \fP\fImalloc_fn\fP\fB, png_free_ptr \fIfree_fn\fP\fB);\fP + +\fI\fB + +\fBvoid png_set_oFFs (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fP\fIoffset_x\fP\fB, png_uint_32 \fP\fIoffset_y\fP\fB, int \fIunit_type\fP\fB);\fP + +\fI\fB + +\fBvoid png_set_packing (png_structp \fIpng_ptr\fP\fB);\fP + +\fI\fB + +\fBvoid png_set_packswap (png_structp \fIpng_ptr\fP\fB);\fP + +\fI\fB + +\fBvoid png_set_palette_to_rgb(png_structp \fIpng_ptr\fP\fB);\fP + +\fI\fB + +\fBvoid png_set_pCAL (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_charp \fP\fIpurpose\fP\fB, png_int_32 \fP\fIX0\fP\fB, png_int_32 \fP\fIX1\fP\fB, int \fP\fItype\fP\fB, int \fP\fInparams\fP\fB, png_charp \fP\fIunits\fP\fB, png_charpp \fIparams\fP\fB);\fP + +\fI\fB + +\fBvoid png_set_pHYs (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fP\fIres_x\fP\fB, png_uint_32 \fP\fIres_y\fP\fB, int \fIunit_type\fP\fB);\fP + +\fI\fB + +\fBvoid png_set_progressive_read_fn (png_structp \fP\fIpng_ptr\fP\fB, png_voidp \fP\fIprogressive_ptr\fP\fB, png_progressive_info_ptr \fP\fIinfo_fn\fP\fB, png_progressive_row_ptr \fP\fIrow_fn\fP\fB, png_progressive_end_ptr \fIend_fn\fP\fB);\fP + +\fI\fB + +\fBvoid png_set_PLTE (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_colorp \fP\fIpalette\fP\fB, int \fInum_palette\fP\fB);\fP + +\fI\fB + +\fBvoid png_set_read_fn (png_structp \fP\fIpng_ptr\fP\fB, png_voidp \fP\fIio_ptr\fP\fB, png_rw_ptr \fIread_data_fn\fP\fB);\fP + +\fI\fB + +\fBvoid png_set_read_status_fn (png_structp \fP\fIpng_ptr\fP\fB, png_read_status_ptr \fIread_row_fn\fP\fB);\fP + +\fI\fB + +\fBvoid png_set_read_user_transform_fn (png_structp \fP\fIpng_ptr\fP\fB, png_user_transform_ptr \fIread_user_transform_fn\fP\fB);\fP + +\fI\fB + +\fBvoid png_set_rgb_to_gray (png_structp \fP\fIpng_ptr\fP\fB, int \fP\fIerror_action\fP\fB, double \fP\fIred\fP\fB, double \fIgreen\fP\fB);\fP + +\fI\fB + +\fBvoid png_set_rgb_to_gray_fixed (png_structp \fP\fIpng_ptr\fP\fB, int error_action png_fixed_point \fP\fIred\fP\fB, png_fixed_point \fIgreen\fP\fB);\fP + +\fI\fB + +\fBvoid png_set_rows (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_bytepp \fIrow_pointers\fP\fB);\fP + +\fI\fB + +\fBvoid png_set_sBIT (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_color_8p \fIsig_bit\fP\fB);\fP + +\fI\fB + +\fBvoid png_set_sCAL (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_charp \fP\fIunit\fP\fB, double \fP\fIwidth\fP\fB, double \fIheight\fP\fB);\fP + +\fI\fB + +\fBvoid png_set_shift (png_structp \fP\fIpng_ptr\fP\fB, png_color_8p \fItrue_bits\fP\fB);\fP + +\fI\fB + +\fBvoid png_set_sig_bytes (png_structp \fP\fIpng_ptr\fP\fB, int \fInum_bytes\fP\fB);\fP + +\fI\fB + +\fBvoid png_set_sPLT (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_spalette_p \fP\fIsplt_ptr\fP\fB, int \fInum_spalettes\fP\fB);\fP + +\fI\fB + +\fBvoid png_set_sRGB (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, int \fIintent\fP\fB);\fP + +\fI\fB + +\fBvoid png_set_sRGB_gAMA_and_cHRM (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, int \fIintent\fP\fB);\fP + +\fI\fB + +\fBvoid png_set_strip_16 (png_structp \fIpng_ptr\fP\fB);\fP + +\fI\fB + +\fBvoid png_set_strip_alpha (png_structp \fIpng_ptr\fP\fB);\fP + +\fI\fB + +\fBvoid png_set_swap (png_structp \fIpng_ptr\fP\fB);\fP + +\fI\fB + +\fBvoid png_set_swap_alpha (png_structp \fIpng_ptr\fP\fB);\fP + +\fI\fB + +\fBvoid png_set_text (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_textp \fP\fItext_ptr\fP\fB, int \fInum_text\fP\fB);\fP + +\fI\fB + +\fBvoid png_set_tIME (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_timep \fImod_time\fP\fB);\fP + +\fI\fB + +\fBvoid png_set_tRNS (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_bytep \fP\fItrans\fP\fB, int \fP\fInum_trans\fP\fB, png_color_16p \fItrans_values\fP\fB);\fP + +\fI\fB + +\fBvoid png_set_tRNS_to_alpha(png_structp \fIpng_ptr\fP\fB);\fP + +\fI\fB + +\fBpng_uint_32 png_set_unknown_chunks (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_unknown_chunkp \fP\fIunknowns\fP\fB, int \fP\fInum\fP\fB, int \fIlocation\fP\fB);\fP + +\fI\fB + +\fBvoid png_set_unknown_chunk_location(png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, int \fP\fIchunk\fP\fB, int \fIlocation\fP\fB);\fP + +\fI\fB + +\fBvoid png_set_read_user_chunk_fn (png_structp \fP\fIpng_ptr\fP\fB, png_voidp \fP\fIuser_chunk_ptr\fP\fB, png_user_chunk_ptr \fIread_user_chunk_fn\fP\fB);\fP + +\fI\fB + +\fBvoid png_set_user_limits (png_structp \fP\fIpng_ptr\fP\fB, png_uint_32 \fP\fIuser_width_max\fP\fB, png_uint_32 \fIuser_height_max\fP\fB);\fP + +\fI\fB + +\fBvoid png_set_user_transform_info (png_structp \fP\fIpng_ptr\fP\fB, png_voidp \fP\fIuser_transform_ptr\fP\fB, int \fP\fIuser_transform_depth\fP\fB, int \fIuser_transform_channels\fP\fB);\fP + +\fI\fB + +\fBvoid png_set_write_fn (png_structp \fP\fIpng_ptr\fP\fB, png_voidp \fP\fIio_ptr\fP\fB, png_rw_ptr \fP\fIwrite_data_fn\fP\fB, png_flush_ptr \fIoutput_flush_fn\fP\fB);\fP + +\fI\fB + +\fBvoid png_set_write_status_fn (png_structp \fP\fIpng_ptr\fP\fB, png_write_status_ptr \fIwrite_row_fn\fP\fB);\fP + +\fI\fB + +\fBvoid png_set_write_user_transform_fn (png_structp \fP\fIpng_ptr\fP\fB, png_user_transform_ptr \fIwrite_user_transform_fn\fP\fB);\fP + +\fI\fB + +\fBvoid png_set_compression_buffer_size(png_structp \fP\fIpng_ptr\fP\fB, png_uint_32 \fIsize\fP\fB);\fP + +\fI\fB + +\fBint png_sig_cmp (png_bytep \fP\fIsig\fP\fB, png_size_t \fP\fIstart\fP\fB, png_size_t \fInum_to_check\fP\fB);\fP + +\fI\fB + +\fBvoid png_start_read_image (png_structp \fIpng_ptr\fP\fB);\fP + +\fI\fB + +\fBvoid png_warning (png_structp \fP\fIpng_ptr\fP\fB, png_const_charp \fImessage\fP\fB);\fP + +\fI\fB + +\fBvoid png_write_chunk (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fP\fIchunk_name\fP\fB, png_bytep \fP\fIdata\fP\fB, png_size_t \fIlength\fP\fB);\fP + +\fI\fB + +\fBvoid png_write_chunk_data (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fP\fIdata\fP\fB, png_size_t \fIlength\fP\fB);\fP + +\fI\fB + +\fBvoid png_write_chunk_end (png_structp \fIpng_ptr\fP\fB);\fP + +\fI\fB + +\fBvoid png_write_chunk_start (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fP\fIchunk_name\fP\fB, png_uint_32 \fIlength\fP\fB);\fP + +\fI\fB + +\fBvoid png_write_destroy (png_structp \fIpng_ptr\fP\fB);\fP + +\fI\fB + +\fBvoid png_write_end (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP + +\fI\fB + +\fBvoid png_write_flush (png_structp \fIpng_ptr\fP\fB);\fP + +\fI\fB + +\fBvoid png_write_image (png_structp \fP\fIpng_ptr\fP\fB, png_bytepp \fIimage\fP\fB);\fP + +\fI\fB + +\fBDEPRECATED: void png_write_init (png_structp \fIpng_ptr\fP\fB);\fP + +\fI\fB + +\fBDEPRECATED: void png_write_init_2 (png_structpp \fP\fIptr_ptr\fP\fB, png_const_charp \fP\fIuser_png_ver\fP\fB, png_size_t \fP\fIpng_struct_size\fP\fB, png_size_t \fIpng_info_size\fP\fB);\fP + +\fI\fB + +\fBvoid png_write_info (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP + +\fI\fB + +\fBvoid png_write_info_before_PLTE (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP + +\fI\fB + +\fBvoid png_write_png (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, int \fP\fItransforms\fP\fB, png_voidp \fIparams\fP\fB);\fP + +\fI\fB + +\fBvoid png_write_row (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fIrow\fP\fB);\fP + +\fI\fB + +\fBvoid png_write_rows (png_structp \fP\fIpng_ptr\fP\fB, png_bytepp \fP\fIrow\fP\fB, png_uint_32 \fInum_rows\fP\fB);\fP + +\fI\fB + +\fBvoidpf png_zalloc (voidpf \fP\fIpng_ptr\fP\fB, uInt \fP\fIitems\fP\fB, uInt \fIsize\fP\fB);\fP + +\fI\fB + +\fBvoid png_zfree (voidpf \fP\fIpng_ptr\fP\fB, voidpf \fIptr\fP\fB);\fP + +\fI\fB + +.SH DESCRIPTION +The +.I libpng +library supports encoding, decoding, and various manipulations of +the Portable Network Graphics (PNG) format image files. It uses the +.IR zlib(3) +compression library. +Following is a copy of the libpng.txt file that accompanies libpng. +.SH LIBPNG.TXT +libpng.txt - A description on how to use and modify libpng + + libpng version 1.2.49 - March 29, 2012 + Updated and distributed by Glenn Randers-Pehrson + + Copyright (c) 1998-2009 Glenn Randers-Pehrson + + This document is released under the libpng license. + For conditions of distribution and use, see the disclaimer + and license in png.h + + Based on: + + libpng versions 0.97, January 1998, through 1.2.49 - March 29, 2012 + Updated and distributed by Glenn Randers-Pehrson + Copyright (c) 1998-2009 Glenn Randers-Pehrson + + libpng 1.0 beta 6 version 0.96 May 28, 1997 + Updated and distributed by Andreas Dilger + Copyright (c) 1996, 1997 Andreas Dilger + + libpng 1.0 beta 2 - version 0.88 January 26, 1996 + For conditions of distribution and use, see copyright + notice in png.h. Copyright (c) 1995, 1996 Guy Eric + Schalnat, Group 42, Inc. + + Updated/rewritten per request in the libpng FAQ + Copyright (c) 1995, 1996 Frank J. T. Wojcik + December 18, 1995 & January 20, 1996 + +.SH I. Introduction + +This file describes how to use and modify the PNG reference library +(known as libpng) for your own use. There are five sections to this +file: introduction, structures, reading, writing, and modification and +configuration notes for various special platforms. In addition to this +file, example.c is a good starting point for using the library, as +it is heavily commented and should include everything most people +will need. We assume that libpng is already installed; see the +INSTALL file for instructions on how to install libpng. + +For examples of libpng usage, see the files "example.c", "pngtest.c", +and the files in the "contrib" directory, all of which are included in +the libpng distribution. + +Libpng was written as a companion to the PNG specification, as a way +of reducing the amount of time and effort it takes to support the PNG +file format in application programs. + +The PNG specification (second edition), November 2003, is available as +a W3C Recommendation and as an ISO Standard (ISO/IEC 15948:2003 (E)) at +. It is technically equivalent +to the PNG specification (second edition) but has some additional material. + +The PNG-1.0 specification is available +as RFC 2083 and as a +W3C Recommendation . + +Some additional chunks are described in the special-purpose public chunks +documents at . + +Other information +about PNG, and the latest version of libpng, can be found at the PNG home +page, . + +Most users will not have to modify the library significantly; advanced +users may want to modify it more. All attempts were made to make it as +complete as possible, while keeping the code easy to understand. +Currently, this library only supports C. Support for other languages +is being considered. + +Libpng has been designed to handle multiple sessions at one time, +to be easily modifiable, to be portable to the vast majority of +machines (ANSI, K&R, 16-, 32-, and 64-bit) available, and to be easy +to use. The ultimate goal of libpng is to promote the acceptance of +the PNG file format in whatever way possible. While there is still +work to be done (see the TODO file), libpng should cover the +majority of the needs of its users. + +Libpng uses zlib for its compression and decompression of PNG files. +Further information about zlib, and the latest version of zlib, can +be found at the zlib home page, . +The zlib compression utility is a general purpose utility that is +useful for more than PNG files, and can be used without libpng. +See the documentation delivered with zlib for more details. +You can usually find the source files for the zlib utility wherever you +find the libpng source files. + +Libpng is thread safe, provided the threads are using different +instances of the structures. Each thread should have its own +png_struct and png_info instances, and thus its own image. +Libpng does not protect itself against two threads using the +same instance of a structure. + +.SH II. Structures + +There are two main structures that are important to libpng, png_struct +and png_info. The first, png_struct, is an internal structure that +will not, for the most part, be used by a user except as the first +variable passed to every libpng function call. + +The png_info structure is designed to provide information about the +PNG file. At one time, the fields of png_info were intended to be +directly accessible to the user. However, this tended to cause problems +with applications using dynamically loaded libraries, and as a result +a set of interface functions for png_info (the png_get_*() and png_set_*() +functions) was developed. The fields of png_info are still available for +older applications, but it is suggested that applications use the new +interfaces if at all possible. + +Applications that do make direct access to the members of png_struct (except +for png_ptr->jmpbuf) must be recompiled whenever the library is updated, +and applications that make direct access to the members of png_info must +be recompiled if they were compiled or loaded with libpng version 1.0.6, +in which the members were in a different order. In version 1.0.7, the +members of the png_info structure reverted to the old order, as they were +in versions 0.97c through 1.0.5. Starting with version 2.0.0, both +structures are going to be hidden, and the contents of the structures will +only be accessible through the png_get/png_set functions. + +The png.h header file is an invaluable reference for programming with libpng. +And while I'm on the topic, make sure you include the libpng header file: + +#include + +.SH III. Reading + +We'll now walk you through the possible functions to call when reading +in a PNG file sequentially, briefly explaining the syntax and purpose +of each one. See example.c and png.h for more detail. While +progressive reading is covered in the next section, you will still +need some of the functions discussed in this section to read a PNG +file. + +.SS Setup + +You will want to do the I/O initialization(*) before you get into libpng, +so if it doesn't work, you don't have much to undo. Of course, you +will also want to insure that you are, in fact, dealing with a PNG +file. Libpng provides a simple check to see if a file is a PNG file. +To use it, pass in the first 1 to 8 bytes of the file to the function +png_sig_cmp(), and it will return 0 (false) if the bytes match the +corresponding bytes of the PNG signature, or nonzero (true) otherwise. +Of course, the more bytes you pass in, the greater the accuracy of the +prediction. + +If you are intending to keep the file pointer open for use in libpng, +you must ensure you don't read more than 8 bytes from the beginning +of the file, and you also have to make a call to png_set_sig_bytes_read() +with the number of bytes you read from the beginning. Libpng will +then only check the bytes (if any) that your program didn't read. + +(*): If you are not using the standard I/O functions, you will need +to replace them with custom functions. See the discussion under +Customizing libpng. + + + FILE *fp = fopen(file_name, "rb"); + if (!fp) + { + return (ERROR); + } + fread(header, 1, number, fp); + is_png = !png_sig_cmp(header, 0, number); + if (!is_png) + { + return (NOT_PNG); + } + + +Next, png_struct and png_info need to be allocated and initialized. In +order to ensure that the size of these structures is correct even with a +dynamically linked libpng, there are functions to initialize and +allocate the structures. We also pass the library version, optional +pointers to error handling functions, and a pointer to a data struct for +use by the error functions, if necessary (the pointer and functions can +be NULL if the default error handlers are to be used). See the section +on Changes to Libpng below regarding the old initialization functions. +The structure allocation functions quietly return NULL if they fail to +create the structure, so your application should check for that. + + png_structp png_ptr = png_create_read_struct + (PNG_LIBPNG_VER_STRING, (png_voidp)user_error_ptr, + user_error_fn, user_warning_fn); + if (!png_ptr) + return (ERROR); + + png_infop info_ptr = png_create_info_struct(png_ptr); + if (!info_ptr) + { + png_destroy_read_struct(&png_ptr, + (png_infopp)NULL, (png_infopp)NULL); + return (ERROR); + } + + png_infop end_info = png_create_info_struct(png_ptr); + if (!end_info) + { + png_destroy_read_struct(&png_ptr, &info_ptr, + (png_infopp)NULL); + return (ERROR); + } + +If you want to use your own memory allocation routines, +define PNG_USER_MEM_SUPPORTED and use +png_create_read_struct_2() instead of png_create_read_struct(): + + png_structp png_ptr = png_create_read_struct_2 + (PNG_LIBPNG_VER_STRING, (png_voidp)user_error_ptr, + user_error_fn, user_warning_fn, (png_voidp) + user_mem_ptr, user_malloc_fn, user_free_fn); + +The error handling routines passed to png_create_read_struct() +and the memory alloc/free routines passed to png_create_struct_2() +are only necessary if you are not using the libpng supplied error +handling and memory alloc/free functions. + +When libpng encounters an error, it expects to longjmp back +to your routine. Therefore, you will need to call setjmp and pass +your png_jmpbuf(png_ptr). If you read the file from different +routines, you will need to update the jmpbuf field every time you enter +a new routine that will call a png_*() function. + +See your documentation of setjmp/longjmp for your compiler for more +information on setjmp/longjmp. See the discussion on libpng error +handling in the Customizing Libpng section below for more information +on the libpng error handling. If an error occurs, and libpng longjmp's +back to your setjmp, you will want to call png_destroy_read_struct() to +free any memory. + + if (setjmp(png_jmpbuf(png_ptr))) + { + png_destroy_read_struct(&png_ptr, &info_ptr, + &end_info); + fclose(fp); + return (ERROR); + } + +If you would rather avoid the complexity of setjmp/longjmp issues, +you can compile libpng with PNG_SETJMP_NOT_SUPPORTED, in which case +errors will result in a call to PNG_ABORT() which defaults to abort(). + +Now you need to set up the input code. The default for libpng is to +use the C function fread(). If you use this, you will need to pass a +valid FILE * in the function png_init_io(). Be sure that the file is +opened in binary mode. If you wish to handle reading data in another +way, you need not call the png_init_io() function, but you must then +implement the libpng I/O methods discussed in the Customizing Libpng +section below. + + png_init_io(png_ptr, fp); + +If you had previously opened the file and read any of the signature from +the beginning in order to see if this was a PNG file, you need to let +libpng know that there are some bytes missing from the start of the file. + + png_set_sig_bytes(png_ptr, number); + +.SS Setting up callback code + +You can set up a callback function to handle any unknown chunks in the +input stream. You must supply the function + + read_chunk_callback(png_ptr ptr, + png_unknown_chunkp chunk); + { + /* The unknown chunk structure contains your + chunk data, along with similar data for any other + unknown chunks: */ + + png_byte name[5]; + png_byte *data; + png_size_t size; + + /* Note that libpng has already taken care of + the CRC handling */ + + /* put your code here. Search for your chunk in the + unknown chunk structure, process it, and return one + of the following: */ + + return (-n); /* chunk had an error */ + return (0); /* did not recognize */ + return (n); /* success */ + } + +(You can give your function another name that you like instead of +"read_chunk_callback") + +To inform libpng about your function, use + + png_set_read_user_chunk_fn(png_ptr, user_chunk_ptr, + read_chunk_callback); + +This names not only the callback function, but also a user pointer that +you can retrieve with + + png_get_user_chunk_ptr(png_ptr); + +If you call the png_set_read_user_chunk_fn() function, then all unknown +chunks will be saved when read, in case your callback function will need +one or more of them. This behavior can be changed with the +png_set_keep_unknown_chunks() function, described below. + +At this point, you can set up a callback function that will be +called after each row has been read, which you can use to control +a progress meter or the like. It's demonstrated in pngtest.c. +You must supply a function + + void read_row_callback(png_ptr ptr, png_uint_32 row, + int pass); + { + /* put your code here */ + } + +(You can give it another name that you like instead of "read_row_callback") + +To inform libpng about your function, use + + png_set_read_status_fn(png_ptr, read_row_callback); + +.SS Unknown-chunk handling + +Now you get to set the way the library processes unknown chunks in the +input PNG stream. Both known and unknown chunks will be read. Normal +behavior is that known chunks will be parsed into information in +various info_ptr members while unknown chunks will be discarded. This +behavior can be wasteful if your application will never use some known +chunk types. To change this, you can call: + + png_set_keep_unknown_chunks(png_ptr, keep, + chunk_list, num_chunks); + keep - 0: default unknown chunk handling + 1: ignore; do not keep + 2: keep only if safe-to-copy + 3: keep even if unsafe-to-copy + You can use these definitions: + PNG_HANDLE_CHUNK_AS_DEFAULT 0 + PNG_HANDLE_CHUNK_NEVER 1 + PNG_HANDLE_CHUNK_IF_SAFE 2 + PNG_HANDLE_CHUNK_ALWAYS 3 + chunk_list - list of chunks affected (a byte string, + five bytes per chunk, NULL or '\0' if + num_chunks is 0) + num_chunks - number of chunks affected; if 0, all + unknown chunks are affected. If nonzero, + only the chunks in the list are affected + +Unknown chunks declared in this way will be saved as raw data onto a +list of png_unknown_chunk structures. If a chunk that is normally +known to libpng is named in the list, it will be handled as unknown, +according to the "keep" directive. If a chunk is named in successive +instances of png_set_keep_unknown_chunks(), the final instance will +take precedence. The IHDR and IEND chunks should not be named in +chunk_list; if they are, libpng will process them normally anyway. + +Here is an example of the usage of png_set_keep_unknown_chunks(), +where the private "vpAg" chunk will later be processed by a user chunk +callback function: + + png_byte vpAg[5]={118, 112, 65, 103, (png_byte) '\0'}; + + #if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED) + png_byte unused_chunks[]= + { + 104, 73, 83, 84, (png_byte) '\0', /* hIST */ + 105, 84, 88, 116, (png_byte) '\0', /* iTXt */ + 112, 67, 65, 76, (png_byte) '\0', /* pCAL */ + 115, 67, 65, 76, (png_byte) '\0', /* sCAL */ + 115, 80, 76, 84, (png_byte) '\0', /* sPLT */ + 116, 73, 77, 69, (png_byte) '\0', /* tIME */ + }; + #endif + + ... + + #if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED) + /* ignore all unknown chunks: */ + png_set_keep_unknown_chunks(read_ptr, 1, NULL, 0); + /* except for vpAg: */ + png_set_keep_unknown_chunks(read_ptr, 2, vpAg, 1); + /* also ignore unused known chunks: */ + png_set_keep_unknown_chunks(read_ptr, 1, unused_chunks, + (int)sizeof(unused_chunks)/5); + #endif + +.SS User limits + +The PNG specification allows the width and height of an image to be as +large as 2^31-1 (0x7fffffff), or about 2.147 billion rows and columns. +Since very few applications really need to process such large images, +we have imposed an arbitrary 1-million limit on rows and columns. +Larger images will be rejected immediately with a png_error() call. If +you wish to override this limit, you can use + + png_set_user_limits(png_ptr, width_max, height_max); + +to set your own limits, or use width_max = height_max = 0x7fffffffL +to allow all valid dimensions (libpng may reject some very large images +anyway because of potential buffer overflow conditions). + +You should put this statement after you create the PNG structure and +before calling png_read_info(), png_read_png(), or png_process_data(). +If you need to retrieve the limits that are being applied, use + + width_max = png_get_user_width_max(png_ptr); + height_max = png_get_user_height_max(png_ptr); + +The PNG specification sets no limit on the number of ancillary chunks +allowed in a PNG datastream. You can impose a limit on the total number +of sPLT, tEXt, iTXt, zTXt, and unknown chunks that will be stored, with + + png_set_chunk_cache_max(png_ptr, user_chunk_cache_max); + +where 0x7fffffffL means unlimited. You can retrieve this limit with + + chunk_cache_max = png_get_chunk_cache_max(png_ptr); + +This limit also applies to the number of buffers that can be allocated +by png_decompress_chunk() while decompressing iTXt, zTXt, and iCCP chunks. + +.SS The high-level read interface + +At this point there are two ways to proceed; through the high-level +read interface, or through a sequence of low-level read operations. +You can use the high-level interface if (a) you are willing to read +the entire image into memory, and (b) the input transformations +you want to do are limited to the following set: + + PNG_TRANSFORM_IDENTITY No transformation + PNG_TRANSFORM_STRIP_16 Strip 16-bit samples to + 8 bits + PNG_TRANSFORM_STRIP_ALPHA Discard the alpha channel + PNG_TRANSFORM_PACKING Expand 1, 2 and 4-bit + samples to bytes + PNG_TRANSFORM_PACKSWAP Change order of packed + pixels to LSB first + PNG_TRANSFORM_EXPAND Perform set_expand() + PNG_TRANSFORM_INVERT_MONO Invert monochrome images + PNG_TRANSFORM_SHIFT Normalize pixels to the + sBIT depth + PNG_TRANSFORM_BGR Flip RGB to BGR, RGBA + to BGRA + PNG_TRANSFORM_SWAP_ALPHA Flip RGBA to ARGB or GA + to AG + PNG_TRANSFORM_INVERT_ALPHA Change alpha from opacity + to transparency + PNG_TRANSFORM_SWAP_ENDIAN Byte-swap 16-bit samples + PNG_TRANSFORM_GRAY_TO_RGB Expand grayscale samples + to RGB (or GA to RGBA) + +(This excludes setting a background color, doing gamma transformation, +dithering, and setting filler.) If this is the case, simply do this: + + png_read_png(png_ptr, info_ptr, png_transforms, NULL) + +where png_transforms is an integer containing the bitwise OR of some +set of transformation flags. This call is equivalent to png_read_info(), +followed the set of transformations indicated by the transform mask, +then png_read_image(), and finally png_read_end(). + +(The final parameter of this call is not yet used. Someday it might point +to transformation parameters required by some future input transform.) + +You must use png_transforms and not call any png_set_transform() functions +when you use png_read_png(). + +After you have called png_read_png(), you can retrieve the image data +with + + row_pointers = png_get_rows(png_ptr, info_ptr); + +where row_pointers is an array of pointers to the pixel data for each row: + + png_bytep row_pointers[height]; + +If you know your image size and pixel size ahead of time, you can allocate +row_pointers prior to calling png_read_png() with + + if (height > PNG_UINT_32_MAX/png_sizeof(png_byte)) + png_error (png_ptr, + "Image is too tall to process in memory"); + if (width > PNG_UINT_32_MAX/pixel_size) + png_error (png_ptr, + "Image is too wide to process in memory"); + row_pointers = png_malloc(png_ptr, + height*png_sizeof(png_bytep)); + for (int i=0; i) and +png_get_(png_ptr, info_ptr, ...) functions return non-zero if the +data has been read, or zero if it is missing. The parameters to the +png_get_ are set directly if they are simple data types, or a +pointer into the info_ptr is returned for any complex types. + + png_get_PLTE(png_ptr, info_ptr, &palette, + &num_palette); + palette - the palette for the file + (array of png_color) + num_palette - number of entries in the palette + + png_get_gAMA(png_ptr, info_ptr, &gamma); + gamma - the gamma the file is written + at (PNG_INFO_gAMA) + + png_get_sRGB(png_ptr, info_ptr, &srgb_intent); + srgb_intent - the rendering intent (PNG_INFO_sRGB) + The presence of the sRGB chunk + means that the pixel data is in the + sRGB color space. This chunk also + implies specific values of gAMA and + cHRM. + + png_get_iCCP(png_ptr, info_ptr, &name, + &compression_type, &profile, &proflen); + name - The profile name. + compression - The compression type; always + PNG_COMPRESSION_TYPE_BASE for PNG 1.0. + You may give NULL to this argument to + ignore it. + profile - International Color Consortium color + profile data. May contain NULs. + proflen - length of profile data in bytes. + + png_get_sBIT(png_ptr, info_ptr, &sig_bit); + sig_bit - the number of significant bits for + (PNG_INFO_sBIT) each of the gray, + red, green, and blue channels, + whichever are appropriate for the + given color type (png_color_16) + + png_get_tRNS(png_ptr, info_ptr, &trans, &num_trans, + &trans_values); + trans - array of transparent + entries for palette (PNG_INFO_tRNS) + trans_values - graylevel or color sample values of + the single transparent color for + non-paletted images (PNG_INFO_tRNS) + num_trans - number of transparent entries + (PNG_INFO_tRNS) + + png_get_hIST(png_ptr, info_ptr, &hist); + (PNG_INFO_hIST) + hist - histogram of palette (array of + png_uint_16) + + png_get_tIME(png_ptr, info_ptr, &mod_time); + mod_time - time image was last modified + (PNG_VALID_tIME) + + png_get_bKGD(png_ptr, info_ptr, &background); + background - background color (PNG_VALID_bKGD) + valid 16-bit red, green and blue + values, regardless of color_type + + num_comments = png_get_text(png_ptr, info_ptr, + &text_ptr, &num_text); + num_comments - number of comments + text_ptr - array of png_text holding image + comments + text_ptr[i].compression - type of compression used + on "text" PNG_TEXT_COMPRESSION_NONE + PNG_TEXT_COMPRESSION_zTXt + PNG_ITXT_COMPRESSION_NONE + PNG_ITXT_COMPRESSION_zTXt + text_ptr[i].key - keyword for comment. Must contain + 1-79 characters. + text_ptr[i].text - text comments for current + keyword. Can be empty. + text_ptr[i].text_length - length of text string, + after decompression, 0 for iTXt + text_ptr[i].itxt_length - length of itxt string, + after decompression, 0 for tEXt/zTXt + text_ptr[i].lang - language of comment (empty + string for unknown). + text_ptr[i].lang_key - keyword in UTF-8 + (empty string for unknown). + Note that the itxt_length, lang, and lang_key + members of the text_ptr structure only exist + when the library is built with iTXt chunk support. + + num_text - number of comments (same as + num_comments; you can put NULL here + to avoid the duplication) + Note while png_set_text() will accept text, language, + and translated keywords that can be NULL pointers, the + structure returned by png_get_text will always contain + regular zero-terminated C strings. They might be + empty strings but they will never be NULL pointers. + + num_spalettes = png_get_sPLT(png_ptr, info_ptr, + &palette_ptr); + palette_ptr - array of palette structures holding + contents of one or more sPLT chunks + read. + num_spalettes - number of sPLT chunks read. + + png_get_oFFs(png_ptr, info_ptr, &offset_x, &offset_y, + &unit_type); + offset_x - positive offset from the left edge + of the screen + offset_y - positive offset from the top edge + of the screen + unit_type - PNG_OFFSET_PIXEL, PNG_OFFSET_MICROMETER + + png_get_pHYs(png_ptr, info_ptr, &res_x, &res_y, + &unit_type); + res_x - pixels/unit physical resolution in + x direction + res_y - pixels/unit physical resolution in + x direction + unit_type - PNG_RESOLUTION_UNKNOWN, + PNG_RESOLUTION_METER + + png_get_sCAL(png_ptr, info_ptr, &unit, &width, + &height) + unit - physical scale units (an integer) + width - width of a pixel in physical scale units + height - height of a pixel in physical scale units + (width and height are doubles) + + png_get_sCAL_s(png_ptr, info_ptr, &unit, &width, + &height) + unit - physical scale units (an integer) + width - width of a pixel in physical scale units + height - height of a pixel in physical scale units + (width and height are strings like "2.54") + + num_unknown_chunks = png_get_unknown_chunks(png_ptr, + info_ptr, &unknowns) + unknowns - array of png_unknown_chunk + structures holding unknown chunks + unknowns[i].name - name of unknown chunk + unknowns[i].data - data of unknown chunk + unknowns[i].size - size of unknown chunk's data + unknowns[i].location - position of chunk in file + + The value of "i" corresponds to the order in which the + chunks were read from the PNG file or inserted with the + png_set_unknown_chunks() function. + +The data from the pHYs chunk can be retrieved in several convenient +forms: + + res_x = png_get_x_pixels_per_meter(png_ptr, + info_ptr) + res_y = png_get_y_pixels_per_meter(png_ptr, + info_ptr) + res_x_and_y = png_get_pixels_per_meter(png_ptr, + info_ptr) + res_x = png_get_x_pixels_per_inch(png_ptr, + info_ptr) + res_y = png_get_y_pixels_per_inch(png_ptr, + info_ptr) + res_x_and_y = png_get_pixels_per_inch(png_ptr, + info_ptr) + aspect_ratio = png_get_pixel_aspect_ratio(png_ptr, + info_ptr) + + (Each of these returns 0 [signifying "unknown"] if + the data is not present or if res_x is 0; + res_x_and_y is 0 if res_x != res_y) + +The data from the oFFs chunk can be retrieved in several convenient +forms: + + x_offset = png_get_x_offset_microns(png_ptr, info_ptr); + y_offset = png_get_y_offset_microns(png_ptr, info_ptr); + x_offset = png_get_x_offset_inches(png_ptr, info_ptr); + y_offset = png_get_y_offset_inches(png_ptr, info_ptr); + + (Each of these returns 0 [signifying "unknown" if both + x and y are 0] if the data is not present or if the + chunk is present but the unit is the pixel) + +For more information, see the png_info definition in png.h and the +PNG specification for chunk contents. Be careful with trusting +rowbytes, as some of the transformations could increase the space +needed to hold a row (expand, filler, gray_to_rgb, etc.). +See png_read_update_info(), below. + +A quick word about text_ptr and num_text. PNG stores comments in +keyword/text pairs, one pair per chunk, with no limit on the number +of text chunks, and a 2^31 byte limit on their size. While there are +suggested keywords, there is no requirement to restrict the use to these +strings. It is strongly suggested that keywords and text be sensible +to humans (that's the point), so don't use abbreviations. Non-printing +symbols are not allowed. See the PNG specification for more details. +There is also no requirement to have text after the keyword. + +Keywords should be limited to 79 Latin-1 characters without leading or +trailing spaces, but non-consecutive spaces are allowed within the +keyword. It is possible to have the same keyword any number of times. +The text_ptr is an array of png_text structures, each holding a +pointer to a language string, a pointer to a keyword and a pointer to +a text string. The text string, language code, and translated +keyword may be empty or NULL pointers. The keyword/text +pairs are put into the array in the order that they are received. +However, some or all of the text chunks may be after the image, so, to +make sure you have read all the text chunks, don't mess with these +until after you read the stuff after the image. This will be +mentioned again below in the discussion that goes with png_read_end(). + +.SS Input transformations + +After you've read the header information, you can set up the library +to handle any special transformations of the image data. The various +ways to transform the data will be described in the order that they +should occur. This is important, as some of these change the color +type and/or bit depth of the data, and some others only work on +certain color types and bit depths. Even though each transformation +checks to see if it has data that it can do something with, you should +make sure to only enable a transformation if it will be valid for the +data. For example, don't swap red and blue on grayscale data. + +The colors used for the background and transparency values should be +supplied in the same format/depth as the current image data. They +are stored in the same format/depth as the image data in a bKGD or tRNS +chunk, so this is what libpng expects for this data. The colors are +transformed to keep in sync with the image data when an application +calls the png_read_update_info() routine (see below). + +Data will be decoded into the supplied row buffers packed into bytes +unless the library has been told to transform it into another format. +For example, 4 bit/pixel paletted or grayscale data will be returned +2 pixels/byte with the leftmost pixel in the high-order bits of the +byte, unless png_set_packing() is called. 8-bit RGB data will be stored +in RGB RGB RGB format unless png_set_filler() or png_set_add_alpha() +is called to insert filler bytes, either before or after each RGB triplet. +16-bit RGB data will be returned RRGGBB RRGGBB, with the most significant +byte of the color value first, unless png_set_strip_16() is called to +transform it to regular RGB RGB triplets, or png_set_filler() or +png_set_add alpha() is called to insert filler bytes, either before or +after each RRGGBB triplet. Similarly, 8-bit or 16-bit grayscale data can +be modified with +png_set_filler(), png_set_add_alpha(), or png_set_strip_16(). + +The following code transforms grayscale images of less than 8 to 8 bits, +changes paletted images to RGB, and adds a full alpha channel if there is +transparency information in a tRNS chunk. This is most useful on +grayscale images with bit depths of 2 or 4 or if there is a multiple-image +viewing application that wishes to treat all images in the same way. + + if (color_type == PNG_COLOR_TYPE_PALETTE) + png_set_palette_to_rgb(png_ptr); + + if (color_type == PNG_COLOR_TYPE_GRAY && + bit_depth < 8) png_set_expand_gray_1_2_4_to_8(png_ptr); + + if (png_get_valid(png_ptr, info_ptr, + PNG_INFO_tRNS)) png_set_tRNS_to_alpha(png_ptr); + +These three functions are actually aliases for png_set_expand(), added +in libpng version 1.0.4, with the function names expanded to improve code +readability. In some future version they may actually do different +things. + +As of libpng version 1.2.9, png_set_expand_gray_1_2_4_to_8() was +added. It expands the sample depth without changing tRNS to alpha. + +As of libpng version 1.2.49, not all possible expansions are supported. + +In the following table, the 01 means grayscale with depth<8, 31 means +indexed with depth<8, other numerals represent the color type, "T" means +the tRNS chunk is present, A means an alpha channel is present, and O +means tRNS or alpha is present but all pixels in the image are opaque. + + FROM 01 31 0 0T 0O 2 2T 2O 3 3T 3O 4A 4O 6A 6O + TO + 01 - + 31 - + 0 1 - + 0T - + 0O - + 2 GX - + 2T - + 2O - + 3 1 - + 3T - + 3O - + 4A T - + 4O - + 6A GX TX TX - + 6O GX TX - + +Within the matrix, + "-" means the transformation is not supported. + "X" means the transformation is obtained by png_set_expand(). + "1" means the transformation is obtained by + png_set_expand_gray_1_2_4_to_8 + "G" means the transformation is obtained by + png_set_gray_to_rgb(). + "P" means the transformation is obtained by + png_set_expand_palette_to_rgb(). + "T" means the transformation is obtained by + png_set_tRNS_to_alpha(). + +PNG can have files with 16 bits per channel. If you only can handle +8 bits per channel, this will strip the pixels down to 8 bit. + + if (bit_depth == 16) + png_set_strip_16(png_ptr); + +If, for some reason, you don't need the alpha channel on an image, +and you want to remove it rather than combining it with the background +(but the image author certainly had in mind that you *would* combine +it with the background, so that's what you should probably do): + + if (color_type & PNG_COLOR_MASK_ALPHA) + png_set_strip_alpha(png_ptr); + +In PNG files, the alpha channel in an image +is the level of opacity. If you need the alpha channel in an image to +be the level of transparency instead of opacity, you can invert the +alpha channel (or the tRNS chunk data) after it's read, so that 0 is +fully opaque and 255 (in 8-bit or paletted images) or 65535 (in 16-bit +images) is fully transparent, with + + png_set_invert_alpha(png_ptr); + +The PNG format only supports pixels with postmultiplied alpha. +If you want to replace the pixels, after reading them, with pixels +that have premultiplied color samples, you can do this with + + png_set_premultiply_alpha(png_ptr); + +If you do this, any input with a tRNS chunk will be expanded to +have an alpha channel. + +PNG files pack pixels of bit depths 1, 2, and 4 into bytes as small as +they can, resulting in, for example, 8 pixels per byte for 1 bit +files. This code expands to 1 pixel per byte without changing the +values of the pixels: + + if (bit_depth < 8) + png_set_packing(png_ptr); + +PNG files have possible bit depths of 1, 2, 4, 8, and 16. All pixels +stored in a PNG image have been "scaled" or "shifted" up to the next +higher possible bit depth (e.g. from 5 bits/sample in the range [0,31] +to 8 bits/sample in the range [0, 255]). However, it is also possible +to convert the PNG pixel data back to the original bit depth of the +image. This call reduces the pixels back down to the original bit depth: + + png_color_8p sig_bit; + + if (png_get_sBIT(png_ptr, info_ptr, &sig_bit)) + png_set_shift(png_ptr, sig_bit); + +PNG files store 3-color pixels in red, green, blue order. This code +changes the storage of the pixels to blue, green, red: + + if (color_type == PNG_COLOR_TYPE_RGB || + color_type == PNG_COLOR_TYPE_RGB_ALPHA) + png_set_bgr(png_ptr); + +PNG files store RGB pixels packed into 3 or 6 bytes. This code expands them +into 4 or 8 bytes for windowing systems that need them in this format: + + if (color_type == PNG_COLOR_TYPE_RGB) + png_set_filler(png_ptr, filler, PNG_FILLER_BEFORE); + +where "filler" is the 8 or 16-bit number to fill with, and the location is +either PNG_FILLER_BEFORE or PNG_FILLER_AFTER, depending upon whether +you want the filler before the RGB or after. This transformation +does not affect images that already have full alpha channels. To add an +opaque alpha channel, use filler=0xff or 0xffff and PNG_FILLER_AFTER which +will generate RGBA pixels. + +Note that png_set_filler() does not change the color type. If you want +to do that, you can add a true alpha channel with + + if (color_type == PNG_COLOR_TYPE_RGB || + color_type == PNG_COLOR_TYPE_GRAY) + png_set_add_alpha(png_ptr, filler, PNG_FILLER_AFTER); + +where "filler" contains the alpha value to assign to each pixel. +This function was added in libpng-1.2.7. + +If you are reading an image with an alpha channel, and you need the +data as ARGB instead of the normal PNG format RGBA: + + if (color_type == PNG_COLOR_TYPE_RGB_ALPHA) + png_set_swap_alpha(png_ptr); + +For some uses, you may want a grayscale image to be represented as +RGB. This code will do that conversion: + + if (color_type == PNG_COLOR_TYPE_GRAY || + color_type == PNG_COLOR_TYPE_GRAY_ALPHA) + png_set_gray_to_rgb(png_ptr); + +Conversely, you can convert an RGB or RGBA image to grayscale or grayscale +with alpha. + + if (color_type == PNG_COLOR_TYPE_RGB || + color_type == PNG_COLOR_TYPE_RGB_ALPHA) + png_set_rgb_to_gray_fixed(png_ptr, error_action, + int red_weight, int green_weight); + + error_action = 1: silently do the conversion + error_action = 2: issue a warning if the original + image has any pixel where + red != green or red != blue + error_action = 3: issue an error and abort the + conversion if the original + image has any pixel where + red != green or red != blue + + red_weight: weight of red component times 100000 + green_weight: weight of green component times 100000 + If either weight is negative, default + weights (21268, 71514) are used. + +If you have set error_action = 1 or 2, you can +later check whether the image really was gray, after processing +the image rows, with the png_get_rgb_to_gray_status(png_ptr) function. +It will return a png_byte that is zero if the image was gray or +1 if there were any non-gray pixels. bKGD and sBIT data +will be silently converted to grayscale, using the green channel +data, regardless of the error_action setting. + +With red_weight+green_weight<=100000, +the normalized graylevel is computed: + + int rw = red_weight * 65536; + int gw = green_weight * 65536; + int bw = 65536 - (rw + gw); + gray = (rw*red + gw*green + bw*blue)/65536; + +The default values approximate those recommended in the Charles +Poynton's Color FAQ, +Copyright (c) 1998-01-04 Charles Poynton + + Y = 0.212671 * R + 0.715160 * G + 0.072169 * B + +Libpng approximates this with + + Y = 0.21268 * R + 0.7151 * G + 0.07217 * B + +which can be expressed with integers as + + Y = (6969 * R + 23434 * G + 2365 * B)/32768 + +The calculation is done in a linear colorspace, if the image gamma +is known. + +If you have a grayscale and you are using png_set_expand_depth(), +png_set_expand(), or png_set_gray_to_rgb to change to truecolor or to +a higher bit-depth, you must either supply the background color as a gray +value at the original file bit-depth (need_expand = 1) or else supply the +background color as an RGB triplet at the final, expanded bit depth +(need_expand = 0). Similarly, if you are reading a paletted image, you +must either supply the background color as a palette index (need_expand = 1) +or as an RGB triplet that may or may not be in the palette (need_expand = 0). + + png_color_16 my_background; + png_color_16p image_background; + + if (png_get_bKGD(png_ptr, info_ptr, &image_background)) + png_set_background(png_ptr, image_background, + PNG_BACKGROUND_GAMMA_FILE, 1, 1.0); + else + png_set_background(png_ptr, &my_background, + PNG_BACKGROUND_GAMMA_SCREEN, 0, 1.0); + +The png_set_background() function tells libpng to composite images +with alpha or simple transparency against the supplied background +color. If the PNG file contains a bKGD chunk (PNG_INFO_bKGD valid), +you may use this color, or supply another color more suitable for +the current display (e.g., the background color from a web page). You +need to tell libpng whether the color is in the gamma space of the +display (PNG_BACKGROUND_GAMMA_SCREEN for colors you supply), the file +(PNG_BACKGROUND_GAMMA_FILE for colors from the bKGD chunk), or one +that is neither of these gammas (PNG_BACKGROUND_GAMMA_UNIQUE - I don't +know why anyone would use this, but it's here). + +To properly display PNG images on any kind of system, the application needs +to know what the display gamma is. Ideally, the user will know this, and +the application will allow them to set it. One method of allowing the user +to set the display gamma separately for each system is to check for a +SCREEN_GAMMA or DISPLAY_GAMMA environment variable, which will hopefully be +correctly set. + +Note that display_gamma is the overall gamma correction required to produce +pleasing results, which depends on the lighting conditions in the surrounding +environment. In a dim or brightly lit room, no compensation other than +the physical gamma exponent of the monitor is needed, while in a dark room +a slightly smaller exponent is better. + + double gamma, screen_gamma; + + if (/* We have a user-defined screen + gamma value */) + { + screen_gamma = user_defined_screen_gamma; + } + /* One way that applications can share the same + screen gamma value */ + else if ((gamma_str = getenv("SCREEN_GAMMA")) + != NULL) + { + screen_gamma = (double)atof(gamma_str); + } + /* If we don't have another value */ + else + { + screen_gamma = 2.2; /* A good guess for a + PC monitor in a bright office or a dim room */ + screen_gamma = 2.0; /* A good guess for a + PC monitor in a dark room */ + screen_gamma = 1.7 or 1.0; /* A good + guess for Mac systems */ + } + +The png_set_gamma() function handles gamma transformations of the data. +Pass both the file gamma and the current screen_gamma. If the file does +not have a gamma value, you can pass one anyway if you have an idea what +it is (usually 0.45455 is a good guess for GIF images on PCs). Note +that file gammas are inverted from screen gammas. See the discussions +on gamma in the PNG specification for an excellent description of what +gamma is, and why all applications should support it. It is strongly +recommended that PNG viewers support gamma correction. + + if (png_get_gAMA(png_ptr, info_ptr, &gamma)) + png_set_gamma(png_ptr, screen_gamma, gamma); + else + png_set_gamma(png_ptr, screen_gamma, 0.45455); + +If you need to reduce an RGB file to a paletted file, or if a paletted +file has more entries then will fit on your screen, png_set_dither() +will do that. Note that this is a simple match dither that merely +finds the closest color available. This should work fairly well with +optimized palettes, and fairly badly with linear color cubes. If you +pass a palette that is larger then maximum_colors, the file will +reduce the number of colors in the palette so it will fit into +maximum_colors. If there is a histogram, it will use it to make +more intelligent choices when reducing the palette. If there is no +histogram, it may not do as good a job. + + if (color_type & PNG_COLOR_MASK_COLOR) + { + if (png_get_valid(png_ptr, info_ptr, + PNG_INFO_PLTE)) + { + png_uint_16p histogram = NULL; + + png_get_hIST(png_ptr, info_ptr, + &histogram); + png_set_dither(png_ptr, palette, num_palette, + max_screen_colors, histogram, 1); + } + else + { + png_color std_color_cube[MAX_SCREEN_COLORS] = + { ... colors ... }; + + png_set_dither(png_ptr, std_color_cube, + MAX_SCREEN_COLORS, MAX_SCREEN_COLORS, + NULL,0); + } + } + +PNG files describe monochrome as black being zero and white being one. +The following code will reverse this (make black be one and white be +zero): + + if (bit_depth == 1 && color_type == PNG_COLOR_TYPE_GRAY) + png_set_invert_mono(png_ptr); + +This function can also be used to invert grayscale and gray-alpha images: + + if (color_type == PNG_COLOR_TYPE_GRAY || + color_type == PNG_COLOR_TYPE_GRAY_ALPHA) + png_set_invert_mono(png_ptr); + +PNG files store 16 bit pixels in network byte order (big-endian, +ie. most significant bits first). This code changes the storage to the +other way (little-endian, i.e. least significant bits first, the +way PCs store them): + + if (bit_depth == 16) + png_set_swap(png_ptr); + +If you are using packed-pixel images (1, 2, or 4 bits/pixel), and you +need to change the order the pixels are packed into bytes, you can use: + + if (bit_depth < 8) + png_set_packswap(png_ptr); + +Finally, you can write your own transformation function if none of +the existing ones meets your needs. This is done by setting a callback +with + + png_set_read_user_transform_fn(png_ptr, + read_transform_fn); + +You must supply the function + + void read_transform_fn(png_ptr ptr, row_info_ptr + row_info, png_bytep data) + +See pngtest.c for a working example. Your function will be called +after all of the other transformations have been processed. + +You can also set up a pointer to a user structure for use by your +callback function, and you can inform libpng that your transform +function will change the number of channels or bit depth with the +function + + png_set_user_transform_info(png_ptr, user_ptr, + user_depth, user_channels); + +The user's application, not libpng, is responsible for allocating and +freeing any memory required for the user structure. + +You can retrieve the pointer via the function +png_get_user_transform_ptr(). For example: + + voidp read_user_transform_ptr = + png_get_user_transform_ptr(png_ptr); + +The last thing to handle is interlacing; this is covered in detail below, +but you must call the function here if you want libpng to handle expansion +of the interlaced image. + + number_of_passes = png_set_interlace_handling(png_ptr); + +After setting the transformations, libpng can update your png_info +structure to reflect any transformations you've requested with this +call. This is most useful to update the info structure's rowbytes +field so you can use it to allocate your image memory. This function +will also update your palette with the correct screen_gamma and +background if these have been given with the calls above. + + png_read_update_info(png_ptr, info_ptr); + +After you call png_read_update_info(), you can allocate any +memory you need to hold the image. The row data is simply +raw byte data for all forms of images. As the actual allocation +varies among applications, no example will be given. If you +are allocating one large chunk, you will need to build an +array of pointers to each row, as it will be needed for some +of the functions below. + +.SS Reading image data + +After you've allocated memory, you can read the image data. +The simplest way to do this is in one function call. If you are +allocating enough memory to hold the whole image, you can just +call png_read_image() and libpng will read in all the image data +and put it in the memory area supplied. You will need to pass in +an array of pointers to each row. + +This function automatically handles interlacing, so you don't need +to call png_set_interlace_handling() or call this function multiple +times, or any of that other stuff necessary with png_read_rows(). + + png_read_image(png_ptr, row_pointers); + +where row_pointers is: + + png_bytep row_pointers[height]; + +You can point to void or char or whatever you use for pixels. + +If you don't want to read in the whole image at once, you can +use png_read_rows() instead. If there is no interlacing (check +interlace_type == PNG_INTERLACE_NONE), this is simple: + + png_read_rows(png_ptr, row_pointers, NULL, + number_of_rows); + +where row_pointers is the same as in the png_read_image() call. + +If you are doing this just one row at a time, you can do this with +a single row_pointer instead of an array of row_pointers: + + png_bytep row_pointer = row; + png_read_row(png_ptr, row_pointer, NULL); + +If the file is interlaced (interlace_type != 0 in the IHDR chunk), things +get somewhat harder. The only current (PNG Specification version 1.2) +interlacing type for PNG is (interlace_type == PNG_INTERLACE_ADAM7) +is a somewhat complicated 2D interlace scheme, known as Adam7, that +breaks down an image into seven smaller images of varying size, based +on an 8x8 grid. + +libpng can fill out those images or it can give them to you "as is". +If you want them filled out, there are two ways to do that. The one +mentioned in the PNG specification is to expand each pixel to cover +those pixels that have not been read yet (the "rectangle" method). +This results in a blocky image for the first pass, which gradually +smooths out as more pixels are read. The other method is the "sparkle" +method, where pixels are drawn only in their final locations, with the +rest of the image remaining whatever colors they were initialized to +before the start of the read. The first method usually looks better, +but tends to be slower, as there are more pixels to put in the rows. + +If you don't want libpng to handle the interlacing details, just call +png_read_rows() seven times to read in all seven images. Each of the +images is a valid image by itself, or they can all be combined on an +8x8 grid to form a single image (although if you intend to combine them +you would be far better off using the libpng interlace handling). + +The first pass will return an image 1/8 as wide as the entire image +(every 8th column starting in column 0) and 1/8 as high as the original +(every 8th row starting in row 0), the second will be 1/8 as wide +(starting in column 4) and 1/8 as high (also starting in row 0). The +third pass will be 1/4 as wide (every 4th pixel starting in column 0) and +1/8 as high (every 8th row starting in row 4), and the fourth pass will +be 1/4 as wide and 1/4 as high (every 4th column starting in column 2, +and every 4th row starting in row 0). The fifth pass will return an +image 1/2 as wide, and 1/4 as high (starting at column 0 and row 2), +while the sixth pass will be 1/2 as wide and 1/2 as high as the original +(starting in column 1 and row 0). The seventh and final pass will be as +wide as the original, and 1/2 as high, containing all of the odd +numbered scanlines. Phew! + +If you want libpng to expand the images, call this before calling +png_start_read_image() or png_read_update_info(): + + if (interlace_type == PNG_INTERLACE_ADAM7) + number_of_passes + = png_set_interlace_handling(png_ptr); + +This will return the number of passes needed. Currently, this +is seven, but may change if another interlace type is added. +This function can be called even if the file is not interlaced, +where it will return one pass. + +If you are not going to display the image after each pass, but are +going to wait until the entire image is read in, use the sparkle +effect. This effect is faster and the end result of either method +is exactly the same. If you are planning on displaying the image +after each pass, the "rectangle" effect is generally considered the +better looking one. + +If you only want the "sparkle" effect, just call png_read_rows() as +normal, with the third parameter NULL. Make sure you make pass over +the image number_of_passes times, and you don't change the data in the +rows between calls. You can change the locations of the data, just +not the data. Each pass only writes the pixels appropriate for that +pass, and assumes the data from previous passes is still valid. + + png_read_rows(png_ptr, row_pointers, NULL, + number_of_rows); + +If you only want the first effect (the rectangles), do the same as +before except pass the row buffer in the third parameter, and leave +the second parameter NULL. + + png_read_rows(png_ptr, NULL, row_pointers, + number_of_rows); + +.SS Finishing a sequential read + +After you are finished reading the image through the +low-level interface, you can finish reading the file. If you are +interested in comments or time, which may be stored either before or +after the image data, you should pass the separate png_info struct if +you want to keep the comments from before and after the image +separate. If you are not interested, you can pass NULL. + + png_read_end(png_ptr, end_info); + +When you are done, you can free all memory allocated by libpng like this: + + png_destroy_read_struct(&png_ptr, &info_ptr, + &end_info); + +It is also possible to individually free the info_ptr members that +point to libpng-allocated storage with the following function: + + png_free_data(png_ptr, info_ptr, mask, seq) + mask - identifies data to be freed, a mask + containing the bitwise OR of one or + more of + PNG_FREE_PLTE, PNG_FREE_TRNS, + PNG_FREE_HIST, PNG_FREE_ICCP, + PNG_FREE_PCAL, PNG_FREE_ROWS, + PNG_FREE_SCAL, PNG_FREE_SPLT, + PNG_FREE_TEXT, PNG_FREE_UNKN, + or simply PNG_FREE_ALL + seq - sequence number of item to be freed + (-1 for all items) + +This function may be safely called when the relevant storage has +already been freed, or has not yet been allocated, or was allocated +by the user and not by libpng, and will in those cases do nothing. +The "seq" parameter is ignored if only one item of the selected data +type, such as PLTE, is allowed. If "seq" is not -1, and multiple items +are allowed for the data type identified in the mask, such as text or +sPLT, only the n'th item in the structure is freed, where n is "seq". + +The default behavior is only to free data that was allocated internally +by libpng. This can be changed, so that libpng will not free the data, +or so that it will free data that was allocated by the user with png_malloc() +or png_zalloc() and passed in via a png_set_*() function, with + + png_data_freer(png_ptr, info_ptr, freer, mask) + mask - which data elements are affected + same choices as in png_free_data() + freer - one of + PNG_DESTROY_WILL_FREE_DATA + PNG_SET_WILL_FREE_DATA + PNG_USER_WILL_FREE_DATA + +This function only affects data that has already been allocated. +You can call this function after reading the PNG data but before calling +any png_set_*() functions, to control whether the user or the png_set_*() +function is responsible for freeing any existing data that might be present, +and again after the png_set_*() functions to control whether the user +or png_destroy_*() is supposed to free the data. When the user assumes +responsibility for libpng-allocated data, the application must use +png_free() to free it, and when the user transfers responsibility to libpng +for data that the user has allocated, the user must have used png_malloc() +or png_zalloc() to allocate it. + +If you allocated your row_pointers in a single block, as suggested above in +the description of the high level read interface, you must not transfer +responsibility for freeing it to the png_set_rows or png_read_destroy function, +because they would also try to free the individual row_pointers[i]. + +If you allocated text_ptr.text, text_ptr.lang, and text_ptr.translated_keyword +separately, do not transfer responsibility for freeing text_ptr to libpng, +because when libpng fills a png_text structure it combines these members with +the key member, and png_free_data() will free only text_ptr.key. Similarly, +if you transfer responsibility for free'ing text_ptr from libpng to your +application, your application must not separately free those members. + +The png_free_data() function will turn off the "valid" flag for anything +it frees. If you need to turn the flag off for a chunk that was freed by +your application instead of by libpng, you can use + + png_set_invalid(png_ptr, info_ptr, mask); + mask - identifies the chunks to be made invalid, + containing the bitwise OR of one or + more of + PNG_INFO_gAMA, PNG_INFO_sBIT, + PNG_INFO_cHRM, PNG_INFO_PLTE, + PNG_INFO_tRNS, PNG_INFO_bKGD, + PNG_INFO_hIST, PNG_INFO_pHYs, + PNG_INFO_oFFs, PNG_INFO_tIME, + PNG_INFO_pCAL, PNG_INFO_sRGB, + PNG_INFO_iCCP, PNG_INFO_sPLT, + PNG_INFO_sCAL, PNG_INFO_IDAT + +For a more compact example of reading a PNG image, see the file example.c. + +.SS Reading PNG files progressively + +The progressive reader is slightly different then the non-progressive +reader. Instead of calling png_read_info(), png_read_rows(), and +png_read_end(), you make one call to png_process_data(), which calls +callbacks when it has the info, a row, or the end of the image. You +set up these callbacks with png_set_progressive_read_fn(). You don't +have to worry about the input/output functions of libpng, as you are +giving the library the data directly in png_process_data(). I will +assume that you have read the section on reading PNG files above, +so I will only highlight the differences (although I will show +all of the code). + +png_structp png_ptr; +png_infop info_ptr; + + /* An example code fragment of how you would + initialize the progressive reader in your + application. */ + int + initialize_png_reader() + { + png_ptr = png_create_read_struct + (PNG_LIBPNG_VER_STRING, (png_voidp)user_error_ptr, + user_error_fn, user_warning_fn); + if (!png_ptr) + return (ERROR); + info_ptr = png_create_info_struct(png_ptr); + if (!info_ptr) + { + png_destroy_read_struct(&png_ptr, (png_infopp)NULL, + (png_infopp)NULL); + return (ERROR); + } + + if (setjmp(png_jmpbuf(png_ptr))) + { + png_destroy_read_struct(&png_ptr, &info_ptr, + (png_infopp)NULL); + return (ERROR); + } + + /* This one's new. You can provide functions + to be called when the header info is valid, + when each row is completed, and when the image + is finished. If you aren't using all functions, + you can specify NULL parameters. Even when all + three functions are NULL, you need to call + png_set_progressive_read_fn(). You can use + any struct as the user_ptr (cast to a void pointer + for the function call), and retrieve the pointer + from inside the callbacks using the function + + png_get_progressive_ptr(png_ptr); + + which will return a void pointer, which you have + to cast appropriately. + */ + png_set_progressive_read_fn(png_ptr, (void *)user_ptr, + info_callback, row_callback, end_callback); + + return 0; + } + + /* A code fragment that you call as you receive blocks + of data */ + int + process_data(png_bytep buffer, png_uint_32 length) + { + if (setjmp(png_jmpbuf(png_ptr))) + { + png_destroy_read_struct(&png_ptr, &info_ptr, + (png_infopp)NULL); + return (ERROR); + } + + /* This one's new also. Simply give it a chunk + of data from the file stream (in order, of + course). On machines with segmented memory + models machines, don't give it any more than + 64K. The library seems to run fine with sizes + of 4K. Although you can give it much less if + necessary (I assume you can give it chunks of + 1 byte, I haven't tried less then 256 bytes + yet). When this function returns, you may + want to display any rows that were generated + in the row callback if you don't already do + so there. + */ + png_process_data(png_ptr, info_ptr, buffer, length); + return 0; + } + + /* This function is called (as set by + png_set_progressive_read_fn() above) when enough data + has been supplied so all of the header has been + read. + */ + void + info_callback(png_structp png_ptr, png_infop info) + { + /* Do any setup here, including setting any of + the transformations mentioned in the Reading + PNG files section. For now, you _must_ call + either png_start_read_image() or + png_read_update_info() after all the + transformations are set (even if you don't set + any). You may start getting rows before + png_process_data() returns, so this is your + last chance to prepare for that. + */ + } + + /* This function is called when each row of image + data is complete */ + void + row_callback(png_structp png_ptr, png_bytep new_row, + png_uint_32 row_num, int pass) + { + /* If the image is interlaced, and you turned + on the interlace handler, this function will + be called for every row in every pass. Some + of these rows will not be changed from the + previous pass. When the row is not changed, + the new_row variable will be NULL. The rows + and passes are called in order, so you don't + really need the row_num and pass, but I'm + supplying them because it may make your life + easier. + + For the non-NULL rows of interlaced images, + you must call png_progressive_combine_row() + passing in the row and the old row. You can + call this function for NULL rows (it will just + return) and for non-interlaced images (it just + does the memcpy for you) if it will make the + code easier. Thus, you can just do this for + all cases: + */ + + png_progressive_combine_row(png_ptr, old_row, + new_row); + + /* where old_row is what was displayed for + previously for the row. Note that the first + pass (pass == 0, really) will completely cover + the old row, so the rows do not have to be + initialized. After the first pass (and only + for interlaced images), you will have to pass + the current row, and the function will combine + the old row and the new row. + */ + } + + void + end_callback(png_structp png_ptr, png_infop info) + { + /* This function is called after the whole image + has been read, including any chunks after the + image (up to and including the IEND). You + will usually have the same info chunk as you + had in the header, although some data may have + been added to the comments and time fields. + + Most people won't do much here, perhaps setting + a flag that marks the image as finished. + */ + } + + + +.SH IV. Writing + +Much of this is very similar to reading. However, everything of +importance is repeated here, so you won't have to constantly look +back up in the reading section to understand writing. + +.SS Setup + +You will want to do the I/O initialization before you get into libpng, +so if it doesn't work, you don't have anything to undo. If you are not +using the standard I/O functions, you will need to replace them with +custom writing functions. See the discussion under Customizing libpng. + + FILE *fp = fopen(file_name, "wb"); + if (!fp) + { + return (ERROR); + } + +Next, png_struct and png_info need to be allocated and initialized. +As these can be both relatively large, you may not want to store these +on the stack, unless you have stack space to spare. Of course, you +will want to check if they return NULL. If you are also reading, +you won't want to name your read structure and your write structure +both "png_ptr"; you can call them anything you like, such as +"read_ptr" and "write_ptr". Look at pngtest.c, for example. + + png_structp png_ptr = png_create_write_struct + (PNG_LIBPNG_VER_STRING, (png_voidp)user_error_ptr, + user_error_fn, user_warning_fn); + if (!png_ptr) + return (ERROR); + + png_infop info_ptr = png_create_info_struct(png_ptr); + if (!info_ptr) + { + png_destroy_write_struct(&png_ptr, + (png_infopp)NULL); + return (ERROR); + } + +If you want to use your own memory allocation routines, +define PNG_USER_MEM_SUPPORTED and use +png_create_write_struct_2() instead of png_create_write_struct(): + + png_structp png_ptr = png_create_write_struct_2 + (PNG_LIBPNG_VER_STRING, (png_voidp)user_error_ptr, + user_error_fn, user_warning_fn, (png_voidp) + user_mem_ptr, user_malloc_fn, user_free_fn); + +After you have these structures, you will need to set up the +error handling. When libpng encounters an error, it expects to +longjmp() back to your routine. Therefore, you will need to call +setjmp() and pass the png_jmpbuf(png_ptr). If you +write the file from different routines, you will need to update +the png_jmpbuf(png_ptr) every time you enter a new routine that will +call a png_*() function. See your documentation of setjmp/longjmp +for your compiler for more information on setjmp/longjmp. See +the discussion on libpng error handling in the Customizing Libpng +section below for more information on the libpng error handling. + + if (setjmp(png_jmpbuf(png_ptr))) + { + png_destroy_write_struct(&png_ptr, &info_ptr); + fclose(fp); + return (ERROR); + } + ... + return; + +If you would rather avoid the complexity of setjmp/longjmp issues, +you can compile libpng with PNG_SETJMP_NOT_SUPPORTED, in which case +errors will result in a call to PNG_ABORT() which defaults to abort(). + +Now you need to set up the output code. The default for libpng is to +use the C function fwrite(). If you use this, you will need to pass a +valid FILE * in the function png_init_io(). Be sure that the file is +opened in binary mode. Again, if you wish to handle writing data in +another way, see the discussion on libpng I/O handling in the Customizing +Libpng section below. + + png_init_io(png_ptr, fp); + +If you are embedding your PNG into a datastream such as MNG, and don't +want libpng to write the 8-byte signature, or if you have already +written the signature in your application, use + + png_set_sig_bytes(png_ptr, 8); + +to inform libpng that it should not write a signature. + +.SS Write callbacks + +At this point, you can set up a callback function that will be +called after each row has been written, which you can use to control +a progress meter or the like. It's demonstrated in pngtest.c. +You must supply a function + + void write_row_callback(png_ptr, png_uint_32 row, + int pass); + { + /* put your code here */ + } + +(You can give it another name that you like instead of "write_row_callback") + +To inform libpng about your function, use + + png_set_write_status_fn(png_ptr, write_row_callback); + +You now have the option of modifying how the compression library will +run. The following functions are mainly for testing, but may be useful +in some cases, like if you need to write PNG files extremely fast and +are willing to give up some compression, or if you want to get the +maximum possible compression at the expense of slower writing. If you +have no special needs in this area, let the library do what it wants by +not calling this function at all, as it has been tuned to deliver a good +speed/compression ratio. The second parameter to png_set_filter() is +the filter method, for which the only valid values are 0 (as of the +July 1999 PNG specification, version 1.2) or 64 (if you are writing +a PNG datastream that is to be embedded in a MNG datastream). The third +parameter is a flag that indicates which filter type(s) are to be tested +for each scanline. See the PNG specification for details on the specific +filter types. + + + /* turn on or off filtering, and/or choose + specific filters. You can use either a single + PNG_FILTER_VALUE_NAME or the bitwise OR of one + or more PNG_FILTER_NAME masks. */ + png_set_filter(png_ptr, 0, + PNG_FILTER_NONE | PNG_FILTER_VALUE_NONE | + PNG_FILTER_SUB | PNG_FILTER_VALUE_SUB | + PNG_FILTER_UP | PNG_FILTER_VALUE_UP | + PNG_FILTER_AVG | PNG_FILTER_VALUE_AVG | + PNG_FILTER_PAETH | PNG_FILTER_VALUE_PAETH| + PNG_ALL_FILTERS); + +If an application +wants to start and stop using particular filters during compression, +it should start out with all of the filters (to ensure that the previous +row of pixels will be stored in case it's needed later), and then add +and remove them after the start of compression. + +If you are writing a PNG datastream that is to be embedded in a MNG +datastream, the second parameter can be either 0 or 64. + +The png_set_compression_*() functions interface to the zlib compression +library, and should mostly be ignored unless you really know what you are +doing. The only generally useful call is png_set_compression_level() +which changes how much time zlib spends on trying to compress the image +data. See the Compression Library (zlib.h and algorithm.txt, distributed +with zlib) for details on the compression levels. + + /* set the zlib compression level */ + png_set_compression_level(png_ptr, + Z_BEST_COMPRESSION); + + /* set other zlib parameters */ + png_set_compression_mem_level(png_ptr, 8); + png_set_compression_strategy(png_ptr, + Z_DEFAULT_STRATEGY); + png_set_compression_window_bits(png_ptr, 15); + png_set_compression_method(png_ptr, 8); + png_set_compression_buffer_size(png_ptr, 8192) + +extern PNG_EXPORT(void,png_set_zbuf_size) + +.SS Setting the contents of info for output + +You now need to fill in the png_info structure with all the data you +wish to write before the actual image. Note that the only thing you +are allowed to write after the image is the text chunks and the time +chunk (as of PNG Specification 1.2, anyway). See png_write_end() and +the latest PNG specification for more information on that. If you +wish to write them before the image, fill them in now, and flag that +data as being valid. If you want to wait until after the data, don't +fill them until png_write_end(). For all the fields in png_info and +their data types, see png.h. For explanations of what the fields +contain, see the PNG specification. + +Some of the more important parts of the png_info are: + + png_set_IHDR(png_ptr, info_ptr, width, height, + bit_depth, color_type, interlace_type, + compression_type, filter_method) + width - holds the width of the image + in pixels (up to 2^31). + height - holds the height of the image + in pixels (up to 2^31). + bit_depth - holds the bit depth of one of the + image channels. + (valid values are 1, 2, 4, 8, 16 + and depend also on the + color_type. See also significant + bits (sBIT) below). + color_type - describes which color/alpha + channels are present. + PNG_COLOR_TYPE_GRAY + (bit depths 1, 2, 4, 8, 16) + PNG_COLOR_TYPE_GRAY_ALPHA + (bit depths 8, 16) + PNG_COLOR_TYPE_PALETTE + (bit depths 1, 2, 4, 8) + PNG_COLOR_TYPE_RGB + (bit_depths 8, 16) + PNG_COLOR_TYPE_RGB_ALPHA + (bit_depths 8, 16) + + PNG_COLOR_MASK_PALETTE + PNG_COLOR_MASK_COLOR + PNG_COLOR_MASK_ALPHA + + interlace_type - PNG_INTERLACE_NONE or + PNG_INTERLACE_ADAM7 + compression_type - (must be + PNG_COMPRESSION_TYPE_DEFAULT) + filter_method - (must be PNG_FILTER_TYPE_DEFAULT + or, if you are writing a PNG to + be embedded in a MNG datastream, + can also be + PNG_INTRAPIXEL_DIFFERENCING) + +If you call png_set_IHDR(), the call must appear before any of the +other png_set_*() functions, because they might require access to some of +the IHDR settings. The remaining png_set_*() functions can be called +in any order. + +If you wish, you can reset the compression_type, interlace_type, or +filter_method later by calling png_set_IHDR() again; if you do this, the +width, height, bit_depth, and color_type must be the same in each call. + + png_set_PLTE(png_ptr, info_ptr, palette, + num_palette); + palette - the palette for the file + (array of png_color) + num_palette - number of entries in the palette + + png_set_gAMA(png_ptr, info_ptr, gamma); + gamma - the gamma the image was created + at (PNG_INFO_gAMA) + + png_set_sRGB(png_ptr, info_ptr, srgb_intent); + srgb_intent - the rendering intent + (PNG_INFO_sRGB) The presence of + the sRGB chunk means that the pixel + data is in the sRGB color space. + This chunk also implies specific + values of gAMA and cHRM. Rendering + intent is the CSS-1 property that + has been defined by the International + Color Consortium + (http://www.color.org). + It can be one of + PNG_sRGB_INTENT_SATURATION, + PNG_sRGB_INTENT_PERCEPTUAL, + PNG_sRGB_INTENT_ABSOLUTE, or + PNG_sRGB_INTENT_RELATIVE. + + + png_set_sRGB_gAMA_and_cHRM(png_ptr, info_ptr, + srgb_intent); + srgb_intent - the rendering intent + (PNG_INFO_sRGB) The presence of the + sRGB chunk means that the pixel + data is in the sRGB color space. + This function also causes gAMA and + cHRM chunks with the specific values + that are consistent with sRGB to be + written. + + png_set_iCCP(png_ptr, info_ptr, name, compression_type, + profile, proflen); + name - The profile name. + compression - The compression type; always + PNG_COMPRESSION_TYPE_BASE for PNG 1.0. + You may give NULL to this argument to + ignore it. + profile - International Color Consortium color + profile data. May contain NULs. + proflen - length of profile data in bytes. + + png_set_sBIT(png_ptr, info_ptr, sig_bit); + sig_bit - the number of significant bits for + (PNG_INFO_sBIT) each of the gray, red, + green, and blue channels, whichever are + appropriate for the given color type + (png_color_16) + + png_set_tRNS(png_ptr, info_ptr, trans, num_trans, + trans_values); + trans - array of transparent + entries for palette (PNG_INFO_tRNS) + trans_values - graylevel or color sample values + (in order red, green, blue) of the + single transparent color for + non-paletted images (PNG_INFO_tRNS) + num_trans - number of transparent entries + (PNG_INFO_tRNS) + + png_set_hIST(png_ptr, info_ptr, hist); + (PNG_INFO_hIST) + hist - histogram of palette (array of + png_uint_16) + + png_set_tIME(png_ptr, info_ptr, mod_time); + mod_time - time image was last modified + (PNG_VALID_tIME) + + png_set_bKGD(png_ptr, info_ptr, background); + background - background color (PNG_VALID_bKGD) + + png_set_text(png_ptr, info_ptr, text_ptr, num_text); + text_ptr - array of png_text holding image + comments + text_ptr[i].compression - type of compression used + on "text" PNG_TEXT_COMPRESSION_NONE + PNG_TEXT_COMPRESSION_zTXt + PNG_ITXT_COMPRESSION_NONE + PNG_ITXT_COMPRESSION_zTXt + text_ptr[i].key - keyword for comment. Must contain + 1-79 characters. + text_ptr[i].text - text comments for current + keyword. Can be NULL or empty. + text_ptr[i].text_length - length of text string, + after decompression, 0 for iTXt + text_ptr[i].itxt_length - length of itxt string, + after decompression, 0 for tEXt/zTXt + text_ptr[i].lang - language of comment (NULL or + empty for unknown). + text_ptr[i].translated_keyword - keyword in UTF-8 (NULL + or empty for unknown). + Note that the itxt_length, lang, and lang_key + members of the text_ptr structure only exist + when the library is built with iTXt chunk support. + + num_text - number of comments + + png_set_sPLT(png_ptr, info_ptr, &palette_ptr, + num_spalettes); + palette_ptr - array of png_sPLT_struct structures + to be added to the list of palettes + in the info structure. + num_spalettes - number of palette structures to be + added. + + png_set_oFFs(png_ptr, info_ptr, offset_x, offset_y, + unit_type); + offset_x - positive offset from the left + edge of the screen + offset_y - positive offset from the top + edge of the screen + unit_type - PNG_OFFSET_PIXEL, PNG_OFFSET_MICROMETER + + png_set_pHYs(png_ptr, info_ptr, res_x, res_y, + unit_type); + res_x - pixels/unit physical resolution + in x direction + res_y - pixels/unit physical resolution + in y direction + unit_type - PNG_RESOLUTION_UNKNOWN, + PNG_RESOLUTION_METER + + png_set_sCAL(png_ptr, info_ptr, unit, width, height) + unit - physical scale units (an integer) + width - width of a pixel in physical scale units + height - height of a pixel in physical scale units + (width and height are doubles) + + png_set_sCAL_s(png_ptr, info_ptr, unit, width, height) + unit - physical scale units (an integer) + width - width of a pixel in physical scale units + height - height of a pixel in physical scale units + (width and height are strings like "2.54") + + png_set_unknown_chunks(png_ptr, info_ptr, &unknowns, + num_unknowns) + unknowns - array of png_unknown_chunk + structures holding unknown chunks + unknowns[i].name - name of unknown chunk + unknowns[i].data - data of unknown chunk + unknowns[i].size - size of unknown chunk's data + unknowns[i].location - position to write chunk in file + 0: do not write chunk + PNG_HAVE_IHDR: before PLTE + PNG_HAVE_PLTE: before IDAT + PNG_AFTER_IDAT: after IDAT + +The "location" member is set automatically according to +what part of the output file has already been written. +You can change its value after calling png_set_unknown_chunks() +as demonstrated in pngtest.c. Within each of the "locations", +the chunks are sequenced according to their position in the +structure (that is, the value of "i", which is the order in which +the chunk was either read from the input file or defined with +png_set_unknown_chunks). + +A quick word about text and num_text. text is an array of png_text +structures. num_text is the number of valid structures in the array. +Each png_text structure holds a language code, a keyword, a text value, +and a compression type. + +The compression types have the same valid numbers as the compression +types of the image data. Currently, the only valid number is zero. +However, you can store text either compressed or uncompressed, unlike +images, which always have to be compressed. So if you don't want the +text compressed, set the compression type to PNG_TEXT_COMPRESSION_NONE. +Because tEXt and zTXt chunks don't have a language field, if you +specify PNG_TEXT_COMPRESSION_NONE or PNG_TEXT_COMPRESSION_zTXt +any language code or translated keyword will not be written out. + +Until text gets around 1000 bytes, it is not worth compressing it. +After the text has been written out to the file, the compression type +is set to PNG_TEXT_COMPRESSION_NONE_WR or PNG_TEXT_COMPRESSION_zTXt_WR, +so that it isn't written out again at the end (in case you are calling +png_write_end() with the same struct. + +The keywords that are given in the PNG Specification are: + + Title Short (one line) title or + caption for image + Author Name of image's creator + Description Description of image (possibly long) + Copyright Copyright notice + Creation Time Time of original image creation + (usually RFC 1123 format, see below) + Software Software used to create the image + Disclaimer Legal disclaimer + Warning Warning of nature of content + Source Device used to create the image + Comment Miscellaneous comment; conversion + from other image format + +The keyword-text pairs work like this. Keywords should be short +simple descriptions of what the comment is about. Some typical +keywords are found in the PNG specification, as is some recommendations +on keywords. You can repeat keywords in a file. You can even write +some text before the image and some after. For example, you may want +to put a description of the image before the image, but leave the +disclaimer until after, so viewers working over modem connections +don't have to wait for the disclaimer to go over the modem before +they start seeing the image. Finally, keywords should be full +words, not abbreviations. Keywords and text are in the ISO 8859-1 +(Latin-1) character set (a superset of regular ASCII) and can not +contain NUL characters, and should not contain control or other +unprintable characters. To make the comments widely readable, stick +with basic ASCII, and avoid machine specific character set extensions +like the IBM-PC character set. The keyword must be present, but +you can leave off the text string on non-compressed pairs. +Compressed pairs must have a text string, as only the text string +is compressed anyway, so the compression would be meaningless. + +PNG supports modification time via the png_time structure. Two +conversion routines are provided, png_convert_from_time_t() for +time_t and png_convert_from_struct_tm() for struct tm. The +time_t routine uses gmtime(). You don't have to use either of +these, but if you wish to fill in the png_time structure directly, +you should provide the time in universal time (GMT) if possible +instead of your local time. Note that the year number is the full +year (e.g. 1998, rather than 98 - PNG is year 2000 compliant!), and +that months start with 1. + +If you want to store the time of the original image creation, you should +use a plain tEXt chunk with the "Creation Time" keyword. This is +necessary because the "creation time" of a PNG image is somewhat vague, +depending on whether you mean the PNG file, the time the image was +created in a non-PNG format, a still photo from which the image was +scanned, or possibly the subject matter itself. In order to facilitate +machine-readable dates, it is recommended that the "Creation Time" +tEXt chunk use RFC 1123 format dates (e.g. "22 May 1997 18:07:10 GMT"), +although this isn't a requirement. Unlike the tIME chunk, the +"Creation Time" tEXt chunk is not expected to be automatically changed +by the software. To facilitate the use of RFC 1123 dates, a function +png_convert_to_rfc1123(png_timep) is provided to convert from PNG +time to an RFC 1123 format string. + +.SS Writing unknown chunks + +You can use the png_set_unknown_chunks function to queue up chunks +for writing. You give it a chunk name, raw data, and a size; that's +all there is to it. The chunks will be written by the next following +png_write_info_before_PLTE, png_write_info, or png_write_end function. +Any chunks previously read into the info structure's unknown-chunk +list will also be written out in a sequence that satisfies the PNG +specification's ordering rules. + +.SS The high-level write interface + +At this point there are two ways to proceed; through the high-level +write interface, or through a sequence of low-level write operations. +You can use the high-level interface if your image data is present +in the info structure. All defined output +transformations are permitted, enabled by the following masks. + + PNG_TRANSFORM_IDENTITY No transformation + PNG_TRANSFORM_PACKING Pack 1, 2 and 4-bit samples + PNG_TRANSFORM_PACKSWAP Change order of packed + pixels to LSB first + PNG_TRANSFORM_INVERT_MONO Invert monochrome images + PNG_TRANSFORM_SHIFT Normalize pixels to the + sBIT depth + PNG_TRANSFORM_BGR Flip RGB to BGR, RGBA + to BGRA + PNG_TRANSFORM_SWAP_ALPHA Flip RGBA to ARGB or GA + to AG + PNG_TRANSFORM_INVERT_ALPHA Change alpha from opacity + to transparency + PNG_TRANSFORM_SWAP_ENDIAN Byte-swap 16-bit samples + PNG_TRANSFORM_STRIP_FILLER Strip out filler + bytes (deprecated). + PNG_TRANSFORM_STRIP_FILLER_BEFORE Strip out leading + filler bytes + PNG_TRANSFORM_STRIP_FILLER_AFTER Strip out trailing + filler bytes + +If you have valid image data in the info structure (you can use +png_set_rows() to put image data in the info structure), simply do this: + + png_write_png(png_ptr, info_ptr, png_transforms, NULL) + +where png_transforms is an integer containing the bitwise OR of some set of +transformation flags. This call is equivalent to png_write_info(), +followed the set of transformations indicated by the transform mask, +then png_write_image(), and finally png_write_end(). + +(The final parameter of this call is not yet used. Someday it might point +to transformation parameters required by some future output transform.) + +You must use png_transforms and not call any png_set_transform() functions +when you use png_write_png(). + +.SS The low-level write interface + +If you are going the low-level route instead, you are now ready to +write all the file information up to the actual image data. You do +this with a call to png_write_info(). + + png_write_info(png_ptr, info_ptr); + +Note that there is one transformation you may need to do before +png_write_info(). In PNG files, the alpha channel in an image is the +level of opacity. If your data is supplied as a level of transparency, +you can invert the alpha channel before you write it, so that 0 is +fully transparent and 255 (in 8-bit or paletted images) or 65535 +(in 16-bit images) is fully opaque, with + + png_set_invert_alpha(png_ptr); + +This must appear before png_write_info() instead of later with the +other transformations because in the case of paletted images the tRNS +chunk data has to be inverted before the tRNS chunk is written. If +your image is not a paletted image, the tRNS data (which in such cases +represents a single color to be rendered as transparent) won't need to +be changed, and you can safely do this transformation after your +png_write_info() call. + +If you need to write a private chunk that you want to appear before +the PLTE chunk when PLTE is present, you can write the PNG info in +two steps, and insert code to write your own chunk between them: + + png_write_info_before_PLTE(png_ptr, info_ptr); + png_set_unknown_chunks(png_ptr, info_ptr, ...); + png_write_info(png_ptr, info_ptr); + +After you've written the file information, you can set up the library +to handle any special transformations of the image data. The various +ways to transform the data will be described in the order that they +should occur. This is important, as some of these change the color +type and/or bit depth of the data, and some others only work on +certain color types and bit depths. Even though each transformation +checks to see if it has data that it can do something with, you should +make sure to only enable a transformation if it will be valid for the +data. For example, don't swap red and blue on grayscale data. + +PNG files store RGB pixels packed into 3 or 6 bytes. This code tells +the library to strip input data that has 4 or 8 bytes per pixel down +to 3 or 6 bytes (or strip 2 or 4-byte grayscale+filler data to 1 or 2 +bytes per pixel). + + png_set_filler(png_ptr, 0, PNG_FILLER_BEFORE); + +where the 0 is unused, and the location is either PNG_FILLER_BEFORE or +PNG_FILLER_AFTER, depending upon whether the filler byte in the pixel +is stored XRGB or RGBX. + +PNG files pack pixels of bit depths 1, 2, and 4 into bytes as small as +they can, resulting in, for example, 8 pixels per byte for 1 bit files. +If the data is supplied at 1 pixel per byte, use this code, which will +correctly pack the pixels into a single byte: + + png_set_packing(png_ptr); + +PNG files reduce possible bit depths to 1, 2, 4, 8, and 16. If your +data is of another bit depth, you can write an sBIT chunk into the +file so that decoders can recover the original data if desired. + + /* Set the true bit depth of the image data */ + if (color_type & PNG_COLOR_MASK_COLOR) + { + sig_bit.red = true_bit_depth; + sig_bit.green = true_bit_depth; + sig_bit.blue = true_bit_depth; + } + else + { + sig_bit.gray = true_bit_depth; + } + if (color_type & PNG_COLOR_MASK_ALPHA) + { + sig_bit.alpha = true_bit_depth; + } + + png_set_sBIT(png_ptr, info_ptr, &sig_bit); + +If the data is stored in the row buffer in a bit depth other than +one supported by PNG (e.g. 3 bit data in the range 0-7 for a 4-bit PNG), +this will scale the values to appear to be the correct bit depth as +is required by PNG. + + png_set_shift(png_ptr, &sig_bit); + +PNG files store 16 bit pixels in network byte order (big-endian, +ie. most significant bits first). This code would be used if they are +supplied the other way (little-endian, i.e. least significant bits +first, the way PCs store them): + + if (bit_depth > 8) + png_set_swap(png_ptr); + +If you are using packed-pixel images (1, 2, or 4 bits/pixel), and you +need to change the order the pixels are packed into bytes, you can use: + + if (bit_depth < 8) + png_set_packswap(png_ptr); + +PNG files store 3 color pixels in red, green, blue order. This code +would be used if they are supplied as blue, green, red: + + png_set_bgr(png_ptr); + +PNG files describe monochrome as black being zero and white being +one. This code would be used if the pixels are supplied with this reversed +(black being one and white being zero): + + png_set_invert_mono(png_ptr); + +Finally, you can write your own transformation function if none of +the existing ones meets your needs. This is done by setting a callback +with + + png_set_write_user_transform_fn(png_ptr, + write_transform_fn); + +You must supply the function + + void write_transform_fn(png_ptr ptr, row_info_ptr + row_info, png_bytep data) + +See pngtest.c for a working example. Your function will be called +before any of the other transformations are processed. + +You can also set up a pointer to a user structure for use by your +callback function. + + png_set_user_transform_info(png_ptr, user_ptr, 0, 0); + +The user_channels and user_depth parameters of this function are ignored +when writing; you can set them to zero as shown. + +You can retrieve the pointer via the function png_get_user_transform_ptr(). +For example: + + voidp write_user_transform_ptr = + png_get_user_transform_ptr(png_ptr); + +It is possible to have libpng flush any pending output, either manually, +or automatically after a certain number of lines have been written. To +flush the output stream a single time call: + + png_write_flush(png_ptr); + +and to have libpng flush the output stream periodically after a certain +number of scanlines have been written, call: + + png_set_flush(png_ptr, nrows); + +Note that the distance between rows is from the last time png_write_flush() +was called, or the first row of the image if it has never been called. +So if you write 50 lines, and then png_set_flush 25, it will flush the +output on the next scanline, and every 25 lines thereafter, unless +png_write_flush() is called before 25 more lines have been written. +If nrows is too small (less than about 10 lines for a 640 pixel wide +RGB image) the image compression may decrease noticeably (although this +may be acceptable for real-time applications). Infrequent flushing will +only degrade the compression performance by a few percent over images +that do not use flushing. + +.SS Writing the image data + +That's it for the transformations. Now you can write the image data. +The simplest way to do this is in one function call. If you have the +whole image in memory, you can just call png_write_image() and libpng +will write the image. You will need to pass in an array of pointers to +each row. This function automatically handles interlacing, so you don't +need to call png_set_interlace_handling() or call this function multiple +times, or any of that other stuff necessary with png_write_rows(). + + png_write_image(png_ptr, row_pointers); + +where row_pointers is: + + png_byte *row_pointers[height]; + +You can point to void or char or whatever you use for pixels. + +If you don't want to write the whole image at once, you can +use png_write_rows() instead. If the file is not interlaced, +this is simple: + + png_write_rows(png_ptr, row_pointers, + number_of_rows); + +row_pointers is the same as in the png_write_image() call. + +If you are just writing one row at a time, you can do this with +a single row_pointer instead of an array of row_pointers: + + png_bytep row_pointer = row; + + png_write_row(png_ptr, row_pointer); + +When the file is interlaced, things can get a good deal more complicated. +The only currently (as of the PNG Specification version 1.2, dated July +1999) defined interlacing scheme for PNG files is the "Adam7" interlace +scheme, that breaks down an image into seven smaller images of varying +size. libpng will build these images for you, or you can do them +yourself. If you want to build them yourself, see the PNG specification +for details of which pixels to write when. + +If you don't want libpng to handle the interlacing details, just +use png_set_interlace_handling() and call png_write_rows() the +correct number of times to write all seven sub-images. + +If you want libpng to build the sub-images, call this before you start +writing any rows: + + number_of_passes = + png_set_interlace_handling(png_ptr); + +This will return the number of passes needed. Currently, this is seven, +but may change if another interlace type is added. + +Then write the complete image number_of_passes times. + + png_write_rows(png_ptr, row_pointers, + number_of_rows); + +As some of these rows are not used, and thus return immediately, you may +want to read about interlacing in the PNG specification, and only update +the rows that are actually used. + +.SS Finishing a sequential write + +After you are finished writing the image, you should finish writing +the file. If you are interested in writing comments or time, you should +pass an appropriately filled png_info pointer. If you are not interested, +you can pass NULL. + + png_write_end(png_ptr, info_ptr); + +When you are done, you can free all memory used by libpng like this: + + png_destroy_write_struct(&png_ptr, &info_ptr); + +It is also possible to individually free the info_ptr members that +point to libpng-allocated storage with the following function: + + png_free_data(png_ptr, info_ptr, mask, seq) + mask - identifies data to be freed, a mask + containing the bitwise OR of one or + more of + PNG_FREE_PLTE, PNG_FREE_TRNS, + PNG_FREE_HIST, PNG_FREE_ICCP, + PNG_FREE_PCAL, PNG_FREE_ROWS, + PNG_FREE_SCAL, PNG_FREE_SPLT, + PNG_FREE_TEXT, PNG_FREE_UNKN, + or simply PNG_FREE_ALL + seq - sequence number of item to be freed + (-1 for all items) + +This function may be safely called when the relevant storage has +already been freed, or has not yet been allocated, or was allocated +by the user and not by libpng, and will in those cases do nothing. +The "seq" parameter is ignored if only one item of the selected data +type, such as PLTE, is allowed. If "seq" is not -1, and multiple items +are allowed for the data type identified in the mask, such as text or +sPLT, only the n'th item in the structure is freed, where n is "seq". + +If you allocated data such as a palette that you passed in to libpng +with png_set_*, you must not free it until just before the call to +png_destroy_write_struct(). + +The default behavior is only to free data that was allocated internally +by libpng. This can be changed, so that libpng will not free the data, +or so that it will free data that was allocated by the user with png_malloc() +or png_zalloc() and passed in via a png_set_*() function, with + + png_data_freer(png_ptr, info_ptr, freer, mask) + mask - which data elements are affected + same choices as in png_free_data() + freer - one of + PNG_DESTROY_WILL_FREE_DATA + PNG_SET_WILL_FREE_DATA + PNG_USER_WILL_FREE_DATA + +For example, to transfer responsibility for some data from a read structure +to a write structure, you could use + + png_data_freer(read_ptr, read_info_ptr, + PNG_USER_WILL_FREE_DATA, + PNG_FREE_PLTE|PNG_FREE_tRNS|PNG_FREE_hIST) + png_data_freer(write_ptr, write_info_ptr, + PNG_DESTROY_WILL_FREE_DATA, + PNG_FREE_PLTE|PNG_FREE_tRNS|PNG_FREE_hIST) + +thereby briefly reassigning responsibility for freeing to the user but +immediately afterwards reassigning it once more to the write_destroy +function. Having done this, it would then be safe to destroy the read +structure and continue to use the PLTE, tRNS, and hIST data in the write +structure. + +This function only affects data that has already been allocated. +You can call this function before calling after the png_set_*() functions +to control whether the user or png_destroy_*() is supposed to free the data. +When the user assumes responsibility for libpng-allocated data, the +application must use +png_free() to free it, and when the user transfers responsibility to libpng +for data that the user has allocated, the user must have used png_malloc() +or png_zalloc() to allocate it. + +If you allocated text_ptr.text, text_ptr.lang, and text_ptr.translated_keyword +separately, do not transfer responsibility for freeing text_ptr to libpng, +because when libpng fills a png_text structure it combines these members with +the key member, and png_free_data() will free only text_ptr.key. Similarly, +if you transfer responsibility for free'ing text_ptr from libpng to your +application, your application must not separately free those members. +For a more compact example of writing a PNG image, see the file example.c. + +.SH V. Modifying/Customizing libpng: + +There are two issues here. The first is changing how libpng does +standard things like memory allocation, input/output, and error handling. +The second deals with more complicated things like adding new chunks, +adding new transformations, and generally changing how libpng works. +Both of those are compile-time issues; that is, they are generally +determined at the time the code is written, and there is rarely a need +to provide the user with a means of changing them. + +Memory allocation, input/output, and error handling + +All of the memory allocation, input/output, and error handling in libpng +goes through callbacks that are user-settable. The default routines are +in pngmem.c, pngrio.c, pngwio.c, and pngerror.c, respectively. To change +these functions, call the appropriate png_set_*_fn() function. + +Memory allocation is done through the functions png_malloc(), png_calloc(), +and png_free(). These currently just call the standard C functions. +png_calloc() calls png_malloc() and then png_memset() to clear the newly +allocated memory to zero. If your pointers can't access more then 64K +at a time, you will want to set MAXSEG_64K in zlib.h. Since it is +unlikely that the method of handling memory allocation on a platform +will change between applications, these functions must be modified in +the library at compile time. If you prefer to use a different method +of allocating and freeing data, you can use png_create_read_struct_2() or +png_create_write_struct_2() to register your own functions as described +above. These functions also provide a void pointer that can be retrieved +via + + mem_ptr=png_get_mem_ptr(png_ptr); + +Your replacement memory functions must have prototypes as follows: + + png_voidp malloc_fn(png_structp png_ptr, + png_size_t size); + void free_fn(png_structp png_ptr, png_voidp ptr); + +Your malloc_fn() must return NULL in case of failure. The png_malloc() +function will normally call png_error() if it receives a NULL from the +system memory allocator or from your replacement malloc_fn(). + +Your free_fn() will never be called with a NULL ptr, since libpng's +png_free() checks for NULL before calling free_fn(). + +Input/Output in libpng is done through png_read() and png_write(), +which currently just call fread() and fwrite(). The FILE * is stored in +png_struct and is initialized via png_init_io(). If you wish to change +the method of I/O, the library supplies callbacks that you can set +through the function png_set_read_fn() and png_set_write_fn() at run +time, instead of calling the png_init_io() function. These functions +also provide a void pointer that can be retrieved via the function +png_get_io_ptr(). For example: + + png_set_read_fn(png_structp read_ptr, + voidp read_io_ptr, png_rw_ptr read_data_fn) + + png_set_write_fn(png_structp write_ptr, + voidp write_io_ptr, png_rw_ptr write_data_fn, + png_flush_ptr output_flush_fn); + + voidp read_io_ptr = png_get_io_ptr(read_ptr); + voidp write_io_ptr = png_get_io_ptr(write_ptr); + +The replacement I/O functions must have prototypes as follows: + + void user_read_data(png_structp png_ptr, + png_bytep data, png_size_t length); + void user_write_data(png_structp png_ptr, + png_bytep data, png_size_t length); + void user_flush_data(png_structp png_ptr); + +The user_read_data() function is responsible for detecting and +handling end-of-data errors. + +Supplying NULL for the read, write, or flush functions sets them back +to using the default C stream functions, which expect the io_ptr to +point to a standard *FILE structure. It is probably a mistake +to use NULL for one of write_data_fn and output_flush_fn but not both +of them, unless you have built libpng with PNG_NO_WRITE_FLUSH defined. +It is an error to read from a write stream, and vice versa. + +Error handling in libpng is done through png_error() and png_warning(). +Errors handled through png_error() are fatal, meaning that png_error() +should never return to its caller. Currently, this is handled via +setjmp() and longjmp() (unless you have compiled libpng with +PNG_SETJMP_NOT_SUPPORTED, in which case it is handled via PNG_ABORT()), +but you could change this to do things like exit() if you should wish. + +On non-fatal errors, png_warning() is called +to print a warning message, and then control returns to the calling code. +By default png_error() and png_warning() print a message on stderr via +fprintf() unless the library is compiled with PNG_NO_CONSOLE_IO defined +(because you don't want the messages) or PNG_NO_STDIO defined (because +fprintf() isn't available). If you wish to change the behavior of the error +functions, you will need to set up your own message callbacks. These +functions are normally supplied at the time that the png_struct is created. +It is also possible to redirect errors and warnings to your own replacement +functions after png_create_*_struct() has been called by calling: + + png_set_error_fn(png_structp png_ptr, + png_voidp error_ptr, png_error_ptr error_fn, + png_error_ptr warning_fn); + + png_voidp error_ptr = png_get_error_ptr(png_ptr); + +If NULL is supplied for either error_fn or warning_fn, then the libpng +default function will be used, calling fprintf() and/or longjmp() if a +problem is encountered. The replacement error functions should have +parameters as follows: + + void user_error_fn(png_structp png_ptr, + png_const_charp error_msg); + void user_warning_fn(png_structp png_ptr, + png_const_charp warning_msg); + +The motivation behind using setjmp() and longjmp() is the C++ throw and +catch exception handling methods. This makes the code much easier to write, +as there is no need to check every return code of every function call. +However, there are some uncertainties about the status of local variables +after a longjmp, so the user may want to be careful about doing anything +after setjmp returns non-zero besides returning itself. Consult your +compiler documentation for more details. For an alternative approach, you +may wish to use the "cexcept" facility (see http://cexcept.sourceforge.net). + +.SS Custom chunks + +If you need to read or write custom chunks, you may need to get deeper +into the libpng code. The library now has mechanisms for storing +and writing chunks of unknown type; you can even declare callbacks +for custom chunks. However, this may not be good enough if the +library code itself needs to know about interactions between your +chunk and existing `intrinsic' chunks. + +If you need to write a new intrinsic chunk, first read the PNG +specification. Acquire a first level of understanding of how it works. +Pay particular attention to the sections that describe chunk names, +and look at how other chunks were designed, so you can do things +similarly. Second, check out the sections of libpng that read and +write chunks. Try to find a chunk that is similar to yours and use +it as a template. More details can be found in the comments inside +the code. It is best to handle unknown chunks in a generic method, +via callback functions, instead of by modifying libpng functions. + +If you wish to write your own transformation for the data, look through +the part of the code that does the transformations, and check out some of +the simpler ones to get an idea of how they work. Try to find a similar +transformation to the one you want to add and copy off of it. More details +can be found in the comments inside the code itself. + +.SS Configuring for 16 bit platforms + +You will want to look into zconf.h to tell zlib (and thus libpng) that +it cannot allocate more then 64K at a time. Even if you can, the memory +won't be accessible. So limit zlib and libpng to 64K by defining MAXSEG_64K. + +.SS Configuring for DOS + +For DOS users who only have access to the lower 640K, you will +have to limit zlib's memory usage via a png_set_compression_mem_level() +call. See zlib.h or zconf.h in the zlib library for more information. + +.SS Configuring for Medium Model + +Libpng's support for medium model has been tested on most of the popular +compilers. Make sure MAXSEG_64K gets defined, USE_FAR_KEYWORD gets +defined, and FAR gets defined to far in pngconf.h, and you should be +all set. Everything in the library (except for zlib's structure) is +expecting far data. You must use the typedefs with the p or pp on +the end for pointers (or at least look at them and be careful). Make +note that the rows of data are defined as png_bytepp, which is an +unsigned char far * far *. + +.SS Configuring for gui/windowing platforms: + +You will need to write new error and warning functions that use the GUI +interface, as described previously, and set them to be the error and +warning functions at the time that png_create_*_struct() is called, +in order to have them available during the structure initialization. +They can be changed later via png_set_error_fn(). On some compilers, +you may also have to change the memory allocators (png_malloc, etc.). + +.SS Configuring for compiler xxx: + +All includes for libpng are in pngconf.h. If you need to add, change +or delete an include, this is the place to do it. +The includes that are not needed outside libpng are protected by the +PNG_INTERNAL definition, which is only defined for those routines inside +libpng itself. The files in libpng proper only include png.h, which +includes pngconf.h. + +.SS Configuring zlib: + +There are special functions to configure the compression. Perhaps the +most useful one changes the compression level, which currently uses +input compression values in the range 0 - 9. The library normally +uses the default compression level (Z_DEFAULT_COMPRESSION = 6). Tests +have shown that for a large majority of images, compression values in +the range 3-6 compress nearly as well as higher levels, and do so much +faster. For online applications it may be desirable to have maximum speed +(Z_BEST_SPEED = 1). With versions of zlib after v0.99, you can also +specify no compression (Z_NO_COMPRESSION = 0), but this would create +files larger than just storing the raw bitmap. You can specify the +compression level by calling: + + png_set_compression_level(png_ptr, level); + +Another useful one is to reduce the memory level used by the library. +The memory level defaults to 8, but it can be lowered if you are +short on memory (running DOS, for example, where you only have 640K). +Note that the memory level does have an effect on compression; among +other things, lower levels will result in sections of incompressible +data being emitted in smaller stored blocks, with a correspondingly +larger relative overhead of up to 15% in the worst case. + + png_set_compression_mem_level(png_ptr, level); + +The other functions are for configuring zlib. They are not recommended +for normal use and may result in writing an invalid PNG file. See +zlib.h for more information on what these mean. + + png_set_compression_strategy(png_ptr, + strategy); + png_set_compression_window_bits(png_ptr, + window_bits); + png_set_compression_method(png_ptr, method); + png_set_compression_buffer_size(png_ptr, size); + +.SS Controlling row filtering + +If you want to control whether libpng uses filtering or not, which +filters are used, and how it goes about picking row filters, you +can call one of these functions. The selection and configuration +of row filters can have a significant impact on the size and +encoding speed and a somewhat lesser impact on the decoding speed +of an image. Filtering is enabled by default for RGB and grayscale +images (with and without alpha), but not for paletted images nor +for any images with bit depths less than 8 bits/pixel. + +The 'method' parameter sets the main filtering method, which is +currently only '0' in the PNG 1.2 specification. The 'filters' +parameter sets which filter(s), if any, should be used for each +scanline. Possible values are PNG_ALL_FILTERS and PNG_NO_FILTERS +to turn filtering on and off, respectively. + +Individual filter types are PNG_FILTER_NONE, PNG_FILTER_SUB, +PNG_FILTER_UP, PNG_FILTER_AVG, PNG_FILTER_PAETH, which can be bitwise +ORed together with '|' to specify one or more filters to use. +These filters are described in more detail in the PNG specification. +If you intend to change the filter type during the course of writing +the image, you should start with flags set for all of the filters +you intend to use so that libpng can initialize its internal +structures appropriately for all of the filter types. (Note that this +means the first row must always be adaptively filtered, because libpng +currently does not allocate the filter buffers until png_write_row() +is called for the first time.) + + filters = PNG_FILTER_NONE | PNG_FILTER_SUB + PNG_FILTER_UP | PNG_FILTER_AVG | + PNG_FILTER_PAETH | PNG_ALL_FILTERS; + + png_set_filter(png_ptr, PNG_FILTER_TYPE_BASE, + filters); + The second parameter can also be + PNG_INTRAPIXEL_DIFFERENCING if you are + writing a PNG to be embedded in a MNG + datastream. This parameter must be the + same as the value of filter_method used + in png_set_IHDR(). + +It is also possible to influence how libpng chooses from among the +available filters. This is done in one or both of two ways - by +telling it how important it is to keep the same filter for successive +rows, and by telling it the relative computational costs of the filters. + + double weights[3] = {1.5, 1.3, 1.1}, + costs[PNG_FILTER_VALUE_LAST] = + {1.0, 1.3, 1.3, 1.5, 1.7}; + + png_set_filter_heuristics(png_ptr, + PNG_FILTER_HEURISTIC_WEIGHTED, 3, + weights, costs); + +The weights are multiplying factors that indicate to libpng that the +row filter should be the same for successive rows unless another row filter +is that many times better than the previous filter. In the above example, +if the previous 3 filters were SUB, SUB, NONE, the SUB filter could have a +"sum of absolute differences" 1.5 x 1.3 times higher than other filters +and still be chosen, while the NONE filter could have a sum 1.1 times +higher than other filters and still be chosen. Unspecified weights are +taken to be 1.0, and the specified weights should probably be declining +like those above in order to emphasize recent filters over older filters. + +The filter costs specify for each filter type a relative decoding cost +to be considered when selecting row filters. This means that filters +with higher costs are less likely to be chosen over filters with lower +costs, unless their "sum of absolute differences" is that much smaller. +The costs do not necessarily reflect the exact computational speeds of +the various filters, since this would unduly influence the final image +size. + +Note that the numbers above were invented purely for this example and +are given only to help explain the function usage. Little testing has +been done to find optimum values for either the costs or the weights. + +.SS Removing unwanted object code + +There are a bunch of #define's in pngconf.h that control what parts of +libpng are compiled. All the defines end in _SUPPORTED. If you are +never going to use a capability, you can change the #define to #undef +before recompiling libpng and save yourself code and data space, or +you can turn off individual capabilities with defines that begin with +PNG_NO_. + +You can also turn all of the transforms and ancillary chunk capabilities +off en masse with compiler directives that define +PNG_NO_READ[or WRITE]_TRANSFORMS, or PNG_NO_READ[or WRITE]_ANCILLARY_CHUNKS, +or all four, +along with directives to turn on any of the capabilities that you do +want. The PNG_NO_READ[or WRITE]_TRANSFORMS directives disable the extra +transformations but still leave the library fully capable of reading +and writing PNG files with all known public chunks. Use of the +PNG_NO_READ[or WRITE]_ANCILLARY_CHUNKS directive produces a library +that is incapable of reading or writing ancillary chunks. If you are +not using the progressive reading capability, you can turn that off +with PNG_NO_PROGRESSIVE_READ (don't confuse this with the INTERLACING +capability, which you'll still have). + +All the reading and writing specific code are in separate files, so the +linker should only grab the files it needs. However, if you want to +make sure, or if you are building a stand alone library, all the +reading files start with pngr and all the writing files start with +pngw. The files that don't match either (like png.c, pngtrans.c, etc.) +are used for both reading and writing, and always need to be included. +The progressive reader is in pngpread.c + +If you are creating or distributing a dynamically linked library (a .so +or DLL file), you should not remove or disable any parts of the library, +as this will cause applications linked with different versions of the +library to fail if they call functions not available in your library. +The size of the library itself should not be an issue, because only +those sections that are actually used will be loaded into memory. + +.SS Requesting debug printout + +The macro definition PNG_DEBUG can be used to request debugging +printout. Set it to an integer value in the range 0 to 3. Higher +numbers result in increasing amounts of debugging information. The +information is printed to the "stderr" file, unless another file +name is specified in the PNG_DEBUG_FILE macro definition. + +When PNG_DEBUG > 0, the following functions (macros) become available: + + png_debug(level, message) + png_debug1(level, message, p1) + png_debug2(level, message, p1, p2) + +in which "level" is compared to PNG_DEBUG to decide whether to print +the message, "message" is the formatted string to be printed, +and p1 and p2 are parameters that are to be embedded in the string +according to printf-style formatting directives. For example, + + png_debug1(2, "foo=%d\n", foo); + +is expanded to + + if(PNG_DEBUG > 2) + fprintf(PNG_DEBUG_FILE, "foo=%d\n", foo); + +When PNG_DEBUG is defined but is zero, the macros aren't defined, but you +can still use PNG_DEBUG to control your own debugging: + + #ifdef PNG_DEBUG + fprintf(stderr, ... + #endif + +When PNG_DEBUG = 1, the macros are defined, but only png_debug statements +having level = 0 will be printed. There aren't any such statements in +this version of libpng, but if you insert some they will be printed. + +.SH VI. MNG support + +The MNG specification (available at http://www.libpng.org/pub/mng) allows +certain extensions to PNG for PNG images that are embedded in MNG datastreams. +Libpng can support some of these extensions. To enable them, use the +png_permit_mng_features() function: + + feature_set = png_permit_mng_features(png_ptr, mask) + mask is a png_uint_32 containing the bitwise OR of the + features you want to enable. These include + PNG_FLAG_MNG_EMPTY_PLTE + PNG_FLAG_MNG_FILTER_64 + PNG_ALL_MNG_FEATURES + feature_set is a png_uint_32 that is the bitwise AND of + your mask with the set of MNG features that is + supported by the version of libpng that you are using. + +It is an error to use this function when reading or writing a standalone +PNG file with the PNG 8-byte signature. The PNG datastream must be wrapped +in a MNG datastream. As a minimum, it must have the MNG 8-byte signature +and the MHDR and MEND chunks. Libpng does not provide support for these +or any other MNG chunks; your application must provide its own support for +them. You may wish to consider using libmng (available at +http://www.libmng.com) instead. + +.SH VII. Changes to Libpng from version 0.88 + +It should be noted that versions of libpng later than 0.96 are not +distributed by the original libpng author, Guy Schalnat, nor by +Andreas Dilger, who had taken over from Guy during 1996 and 1997, and +distributed versions 0.89 through 0.96, but rather by another member +of the original PNG Group, Glenn Randers-Pehrson. Guy and Andreas are +still alive and well, but they have moved on to other things. + +The old libpng functions png_read_init(), png_write_init(), +png_info_init(), png_read_destroy(), and png_write_destroy() have been +moved to PNG_INTERNAL in version 0.95 to discourage their use. These +functions will be removed from libpng version 2.0.0. + +The preferred method of creating and initializing the libpng structures is +via the png_create_read_struct(), png_create_write_struct(), and +png_create_info_struct() because they isolate the size of the structures +from the application, allow version error checking, and also allow the +use of custom error handling routines during the initialization, which +the old functions do not. The functions png_read_destroy() and +png_write_destroy() do not actually free the memory that libpng +allocated for these structs, but just reset the data structures, so they +can be used instead of png_destroy_read_struct() and +png_destroy_write_struct() if you feel there is too much system overhead +allocating and freeing the png_struct for each image read. + +Setting the error callbacks via png_set_message_fn() before +png_read_init() as was suggested in libpng-0.88 is no longer supported +because this caused applications that do not use custom error functions +to fail if the png_ptr was not initialized to zero. It is still possible +to set the error callbacks AFTER png_read_init(), or to change them with +png_set_error_fn(), which is essentially the same function, but with a new +name to force compilation errors with applications that try to use the old +method. + +Starting with version 1.0.7, you can find out which version of the library +you are using at run-time: + + png_uint_32 libpng_vn = png_access_version_number(); + +The number libpng_vn is constructed from the major version, minor +version with leading zero, and release number with leading zero, +(e.g., libpng_vn for version 1.0.7 is 10007). + +You can also check which version of png.h you used when compiling your +application: + + png_uint_32 application_vn = PNG_LIBPNG_VER; + +.SH VIII. Changes to Libpng from version 1.0.x to 1.2.x + +Support for user memory management was enabled by default. To +accomplish this, the functions png_create_read_struct_2(), +png_create_write_struct_2(), png_set_mem_fn(), png_get_mem_ptr(), +png_malloc_default(), and png_free_default() were added. + +Support for the iTXt chunk has been enabled by default as of +version 1.2.41. + +Support for certain MNG features was enabled. + +Support for numbered error messages was added. However, we never got +around to actually numbering the error messages. The function +png_set_strip_error_numbers() was added (Note: the prototype for this +function was inadvertently removed from png.h in PNG_NO_ASSEMBLER_CODE +builds of libpng-1.2.15. It was restored in libpng-1.2.36). + +The png_malloc_warn() function was added at libpng-1.2.3. This issues +a png_warning and returns NULL instead of aborting when it fails to +acquire the requested memory allocation. + +Support for setting user limits on image width and height was enabled +by default. The functions png_set_user_limits(), png_get_user_width_max(), +and png_get_user_height_max() were added at libpng-1.2.6. + +The png_set_add_alpha() function was added at libpng-1.2.7. + +The function png_set_expand_gray_1_2_4_to_8() was added at libpng-1.2.9. +Unlike png_set_gray_1_2_4_to_8(), the new function does not expand the +tRNS chunk to alpha. The png_set_gray_1_2_4_to_8() function is +deprecated. + +A number of macro definitions in support of runtime selection of +assembler code features (especially Intel MMX code support) were +added at libpng-1.2.0: + + PNG_ASM_FLAG_MMX_SUPPORT_COMPILED + PNG_ASM_FLAG_MMX_SUPPORT_IN_CPU + PNG_ASM_FLAG_MMX_READ_COMBINE_ROW + PNG_ASM_FLAG_MMX_READ_INTERLACE + PNG_ASM_FLAG_MMX_READ_FILTER_SUB + PNG_ASM_FLAG_MMX_READ_FILTER_UP + PNG_ASM_FLAG_MMX_READ_FILTER_AVG + PNG_ASM_FLAG_MMX_READ_FILTER_PAETH + PNG_ASM_FLAGS_INITIALIZED + PNG_MMX_READ_FLAGS + PNG_MMX_FLAGS + PNG_MMX_WRITE_FLAGS + PNG_MMX_FLAGS + +We added the following functions in support of runtime +selection of assembler code features: + + png_get_mmx_flagmask() + png_set_mmx_thresholds() + png_get_asm_flags() + png_get_mmx_bitdepth_threshold() + png_get_mmx_rowbytes_threshold() + png_set_asm_flags() + +We replaced all of these functions with simple stubs in libpng-1.2.20, +when the Intel assembler code was removed due to a licensing issue. + +These macros are deprecated: + + PNG_READ_TRANSFORMS_NOT_SUPPORTED + PNG_PROGRESSIVE_READ_NOT_SUPPORTED + PNG_NO_SEQUENTIAL_READ_SUPPORTED + PNG_WRITE_TRANSFORMS_NOT_SUPPORTED + PNG_READ_ANCILLARY_CHUNKS_NOT_SUPPORTED + PNG_WRITE_ANCILLARY_CHUNKS_NOT_SUPPORTED + +They have been replaced, respectively, by: + + PNG_NO_READ_TRANSFORMS + PNG_NO_PROGRESSIVE_READ + PNG_NO_SEQUENTIAL_READ + PNG_NO_WRITE_TRANSFORMS + PNG_NO_READ_ANCILLARY_CHUNKS + PNG_NO_WRITE_ANCILLARY_CHUNKS + +PNG_MAX_UINT was replaced with PNG_UINT_31_MAX. It has been +deprecated since libpng-1.0.16 and libpng-1.2.6. + +The function + png_check_sig(sig, num) +was replaced with + !png_sig_cmp(sig, 0, num) +It has been deprecated since libpng-0.90. + +The function + png_set_gray_1_2_4_to_8() +which also expands tRNS to alpha was replaced with + png_set_expand_gray_1_2_4_to_8() +which does not. It has been deprecated since libpng-1.0.18 and 1.2.9. + +.SH IX. (Omitted) + + +.SH X. Detecting libpng + +The png_get_io_ptr() function has been present since libpng-0.88, has never +changed, and is unaffected by conditional compilation macros. It is the +best choice for use in configure scripts for detecting the presence of any +libpng version since 0.88. In an autoconf "configure.in" you could use + + AC_CHECK_LIB(png, png_get_io_ptr, ... + +.SH XI. Source code repository + +Since about February 2009, version 1.2.34, libpng has been under "git" source +control. The git repository was built from old libpng-x.y.z.tar.gz files +going back to version 0.70. You can access the git repository (read only) +at + + git://libpng.git.sourceforge.net/gitroot/libpng + +or you can browse it via "gitweb" at + + http://libpng.git.sourceforge.net/git/gitweb.cgi?p=libpng + +Patches can be sent to glennrp at users.sourceforge.net or to +png-mng-implement at lists.sourceforge.net or you can upload them to +the libpng bug tracker at + + http://libpng.sourceforge.net + +.SH XII. Coding style + +Our coding style is similar to the "Allman" style, with curly +braces on separate lines: + + if (condition) + { + action; + } + + else if (another condition) + { + another action; + } + +The braces can be omitted from simple one-line actions: + + if (condition) + return (0); + +We use 3-space indentation, except for continued statements which +are usually indented the same as the first line of the statement +plus four more spaces. + +For macro definitions we use 2-space indentation, always leaving the "#" +in the first column. + + #ifndef PNG_NO_FEATURE + # ifndef PNG_FEATURE_SUPPORTED + # define PNG_FEATURE_SUPPORTED + # endif + #endif + +Comments appear with the leading "/*" at the same indentation as +the statement that follows the comment: + + /* Single-line comment */ + statement; + + /* Multiple-line + * comment + */ + statement; + +Very short comments can be placed at the end of the statement +to which they pertain: + + statement; /* comment */ + +We don't use C++ style ("//") comments. We have, however, +used them in the past in some now-abandoned MMX assembler +code. + +Functions and their curly braces are not indented, and +exported functions are marked with PNGAPI: + + /* This is a public function that is visible to + * application programers. It does thus-and-so. + */ + void PNGAPI + png_exported_function(png_ptr, png_info, foo) + { + body; + } + +The prototypes for all exported functions appear in png.h, +above the comment that says + + /* Maintainer: Put new public prototypes here ... */ + +We mark all non-exported functions with "/* PRIVATE */"": + + void /* PRIVATE */ + png_non_exported_function(png_ptr, png_info, foo) + { + body; + } + +The prototypes for non-exported functions (except for those in +pngtest) appear in +the PNG_INTERNAL section of png.h +above the comment that says + + /* Maintainer: Put new private prototypes here ^ and in libpngpf.3 */ + +The names of all exported functions and variables begin +with "png_", and all publicly visible C preprocessor +macros begin with "PNG". + +We put a space after each comma and after each semicolon +in "for" statments, and we put spaces before and after each +C binary operator and after "for" or "while". We don't +put a space between a typecast and the expression being +cast, nor do we put one between a function name and the +left parenthesis that follows it: + + for (i = 2; i > 0; --i) + y[i] = a(x) + (int)b; + +We prefer #ifdef and #ifndef to #if defined() and if !defined() +when there is only one macro being tested. + +We do not use the TAB character for indentation in the C sources. + +Lines do not exceed 80 characters. + +Other rules can be inferred by inspecting the libpng source. + +.SH XIII. Y2K Compliance in libpng + +March 29, 2012 + +Since the PNG Development group is an ad-hoc body, we can't make +an official declaration. + +This is your unofficial assurance that libpng from version 0.71 and +upward through 1.2.49 are Y2K compliant. It is my belief that earlier +versions were also Y2K compliant. + +Libpng only has three year fields. One is a 2-byte unsigned integer that +will hold years up to 65535. The other two hold the date in text +format, and will hold years up to 9999. + +The integer is + "png_uint_16 year" in png_time_struct. + +The strings are + "png_charp time_buffer" in png_struct and + "near_time_buffer", which is a local character string in png.c. + +There are seven time-related functions: + + png_convert_to_rfc_1123() in png.c + (formerly png_convert_to_rfc_1152() in error) + png_convert_from_struct_tm() in pngwrite.c, called + in pngwrite.c + png_convert_from_time_t() in pngwrite.c + png_get_tIME() in pngget.c + png_handle_tIME() in pngrutil.c, called in pngread.c + png_set_tIME() in pngset.c + png_write_tIME() in pngwutil.c, called in pngwrite.c + +All appear to handle dates properly in a Y2K environment. The +png_convert_from_time_t() function calls gmtime() to convert from system +clock time, which returns (year - 1900), which we properly convert to +the full 4-digit year. There is a possibility that applications using +libpng are not passing 4-digit years into the png_convert_to_rfc_1123() +function, or that they are incorrectly passing only a 2-digit year +instead of "year - 1900" into the png_convert_from_struct_tm() function, +but this is not under our control. The libpng documentation has always +stated that it works with 4-digit years, and the APIs have been +documented as such. + +The tIME chunk itself is also Y2K compliant. It uses a 2-byte unsigned +integer to hold the year, and can hold years as large as 65535. + +zlib, upon which libpng depends, is also Y2K compliant. It contains +no date-related code. + + + Glenn Randers-Pehrson + libpng maintainer + PNG Development Group + +.SH NOTE + +Note about libpng version numbers: + +Due to various miscommunications, unforeseen code incompatibilities +and occasional factors outside the authors' control, version numbering +on the library has not always been consistent and straightforward. +The following table summarizes matters since version 0.89c, which was +the first widely used release: + + source png.h png.h shared-lib + version string int version + ------- ------ ----- ---------- + 0.89c ("beta 3") 0.89 89 1.0.89 + 0.90 ("beta 4") 0.90 90 0.90 + 0.95 ("beta 5") 0.95 95 0.95 + 0.96 ("beta 6") 0.96 96 0.96 + 0.97b ("beta 7") 1.00.97 97 1.0.1 + 0.97c 0.97 97 2.0.97 + 0.98 0.98 98 2.0.98 + 0.99 0.99 98 2.0.99 + 0.99a-m 0.99 99 2.0.99 + 1.00 1.00 100 2.1.0 + 1.0.0 1.0.0 100 2.1.0 + 1.0.0 (from here on, the 100 2.1.0 + 1.0.1 png.h string is 10001 2.1.0 + 1.0.1a-e identical to the 10002 from here on, the + 1.0.2 source version) 10002 shared library is 2.V + 1.0.2a-b 10003 where V is the source + 1.0.1 10001 code version except as + 1.0.1a-e 10002 2.1.0.1a-e noted. + 1.0.2 10002 2.1.0.2 + 1.0.2a-b 10003 2.1.0.2a-b + 1.0.3 10003 2.1.0.3 + 1.0.3a-d 10004 2.1.0.3a-d + 1.0.4 10004 2.1.0.4 + 1.0.4a-f 10005 2.1.0.4a-f + 1.0.5 (+ 2 patches) 10005 2.1.0.5 + 1.0.5a-d 10006 2.1.0.5a-d + 1.0.5e-r 10100 2.1.0.5e-r + 1.0.5s-v 10006 2.1.0.5s-v + 1.0.6 (+ 3 patches) 10006 2.1.0.6 + 1.0.6d-g 10007 2.1.0.6d-g + 1.0.6h 10007 10.6h + 1.0.6i 10007 10.6i + 1.0.6j 10007 2.1.0.6j + 1.0.7beta11-14 DLLNUM 10007 2.1.0.7beta11-14 + 1.0.7beta15-18 1 10007 2.1.0.7beta15-18 + 1.0.7rc1-2 1 10007 2.1.0.7rc1-2 + 1.0.7 1 10007 2.1.0.7 + 1.0.8beta1-4 1 10008 2.1.0.8beta1-4 + 1.0.8rc1 1 10008 2.1.0.8rc1 + 1.0.8 1 10008 2.1.0.8 + 1.0.9beta1-6 1 10009 2.1.0.9beta1-6 + 1.0.9rc1 1 10009 2.1.0.9rc1 + 1.0.9beta7-10 1 10009 2.1.0.9beta7-10 + 1.0.9rc2 1 10009 2.1.0.9rc2 + 1.0.9 1 10009 2.1.0.9 + 1.0.10beta1 1 10010 2.1.0.10beta1 + 1.0.10rc1 1 10010 2.1.0.10rc1 + 1.0.10 1 10010 2.1.0.10 + 1.0.11beta1-3 1 10011 2.1.0.11beta1-3 + 1.0.11rc1 1 10011 2.1.0.11rc1 + 1.0.11 1 10011 2.1.0.11 + 1.0.12beta1-2 2 10012 2.1.0.12beta1-2 + 1.0.12rc1 2 10012 2.1.0.12rc1 + 1.0.12 2 10012 2.1.0.12 + 1.1.0a-f - 10100 2.1.1.0a-f abandoned + 1.2.0beta1-2 2 10200 2.1.2.0beta1-2 + 1.2.0beta3-5 3 10200 3.1.2.0beta3-5 + 1.2.0rc1 3 10200 3.1.2.0rc1 + 1.2.0 3 10200 3.1.2.0 + 1.2.1beta-4 3 10201 3.1.2.1beta1-4 + 1.2.1rc1-2 3 10201 3.1.2.1rc1-2 + 1.2.1 3 10201 3.1.2.1 + 1.2.2beta1-6 12 10202 12.so.0.1.2.2beta1-6 + 1.0.13beta1 10 10013 10.so.0.1.0.13beta1 + 1.0.13rc1 10 10013 10.so.0.1.0.13rc1 + 1.2.2rc1 12 10202 12.so.0.1.2.2rc1 + 1.0.13 10 10013 10.so.0.1.0.13 + 1.2.2 12 10202 12.so.0.1.2.2 + 1.2.3rc1-6 12 10203 12.so.0.1.2.3rc1-6 + 1.2.3 12 10203 12.so.0.1.2.3 + 1.2.4beta1-3 13 10204 12.so.0.1.2.4beta1-3 + 1.2.4rc1 13 10204 12.so.0.1.2.4rc1 + 1.0.14 10 10014 10.so.0.1.0.14 + 1.2.4 13 10204 12.so.0.1.2.4 + 1.2.5beta1-2 13 10205 12.so.0.1.2.5beta1-2 + 1.0.15rc1 10 10015 10.so.0.1.0.15rc1 + 1.0.15 10 10015 10.so.0.1.0.15 + 1.2.5 13 10205 12.so.0.1.2.5 + 1.2.6beta1-4 13 10206 12.so.0.1.2.6beta1-4 + 1.2.6rc1-5 13 10206 12.so.0.1.2.6rc1-5 + 1.0.16 10 10016 10.so.0.1.0.16 + 1.2.6 13 10206 12.so.0.1.2.6 + 1.2.7beta1-2 13 10207 12.so.0.1.2.7beta1-2 + 1.0.17rc1 10 10017 10.so.0.1.0.17rc1 + 1.2.7rc1 13 10207 12.so.0.1.2.7rc1 + 1.0.17 10 10017 10.so.0.1.0.17 + 1.2.7 13 10207 12.so.0.1.2.7 + 1.2.8beta1-5 13 10208 12.so.0.1.2.8beta1-5 + 1.0.18rc1-5 10 10018 10.so.0.1.0.18rc1-5 + 1.2.8rc1-5 13 10208 12.so.0.1.2.8rc1-5 + 1.0.18 10 10018 10.so.0.1.0.18 + 1.2.8 13 10208 12.so.0.1.2.8 + 1.2.9beta1-3 13 10209 12.so.0.1.2.9beta1-3 + 1.2.9beta4-11 13 10209 12.so.0.9[.0] + 1.2.9rc1 13 10209 12.so.0.9[.0] + 1.2.9 13 10209 12.so.0.9[.0] + 1.2.10beta1-8 13 10210 12.so.0.10[.0] + 1.2.10rc1-3 13 10210 12.so.0.10[.0] + 1.2.10 13 10210 12.so.0.10[.0] + 1.2.11beta1-4 13 10211 12.so.0.11[.0] + 1.0.19rc1-5 10 10019 10.so.0.19[.0] + 1.2.11rc1-5 13 10211 12.so.0.11[.0] + 1.0.19 10 10019 10.so.0.19[.0] + 1.2.11 13 10211 12.so.0.11[.0] + 1.0.20 10 10020 10.so.0.20[.0] + 1.2.12 13 10212 12.so.0.12[.0] + 1.2.13beta1 13 10213 12.so.0.13[.0] + 1.0.21 10 10021 10.so.0.21[.0] + 1.2.13 13 10213 12.so.0.13[.0] + 1.2.14beta1-2 13 10214 12.so.0.14[.0] + 1.0.22rc1 10 10022 10.so.0.22[.0] + 1.2.14rc1 13 10214 12.so.0.14[.0] + 1.2.15beta1-6 13 10215 12.so.0.15[.0] + 1.0.23rc1-5 10 10023 10.so.0.23[.0] + 1.2.15rc1-5 13 10215 12.so.0.15[.0] + 1.0.23 10 10023 10.so.0.23[.0] + 1.2.15 13 10215 12.so.0.15[.0] + 1.2.16beta1-2 13 10216 12.so.0.16[.0] + 1.2.16rc1 13 10216 12.so.0.16[.0] + 1.0.24 10 10024 10.so.0.24[.0] + 1.2.16 13 10216 12.so.0.16[.0] + 1.2.17beta1-2 13 10217 12.so.0.17[.0] + 1.0.25rc1 10 10025 10.so.0.25[.0] + 1.2.17rc1-3 13 10217 12.so.0.17[.0] + 1.0.25 10 10025 10.so.0.25[.0] + 1.2.17 13 10217 12.so.0.17[.0] + 1.0.26 10 10026 10.so.0.26[.0] + 1.2.18 13 10218 12.so.0.18[.0] + 1.2.19beta1-31 13 10219 12.so.0.19[.0] + 1.0.27rc1-6 10 10027 10.so.0.27[.0] + 1.2.19rc1-6 13 10219 12.so.0.19[.0] + 1.0.27 10 10027 10.so.0.27[.0] + 1.2.19 13 10219 12.so.0.19[.0] + 1.2.20beta01-04 13 10220 12.so.0.20[.0] + 1.0.28rc1-6 10 10028 10.so.0.28[.0] + 1.2.20rc1-6 13 10220 12.so.0.20[.0] + 1.0.28 10 10028 10.so.0.28[.0] + 1.2.20 13 10220 12.so.0.20[.0] + 1.2.21beta1-2 13 10221 12.so.0.21[.0] + 1.2.21rc1-3 13 10221 12.so.0.21[.0] + 1.0.29 10 10029 10.so.0.29[.0] + 1.2.21 13 10221 12.so.0.21[.0] + 1.2.22beta1-4 13 10222 12.so.0.22[.0] + 1.0.30rc1 13 10030 10.so.0.30[.0] + 1.2.22rc1 13 10222 12.so.0.22[.0] + 1.0.30 10 10030 10.so.0.30[.0] + 1.2.22 13 10222 12.so.0.22[.0] + 1.2.23beta01-05 13 10223 12.so.0.23[.0] + 1.2.23rc01 13 10223 12.so.0.23[.0] + 1.2.23 13 10223 12.so.0.23[.0] + 1.2.24beta01-02 13 10224 12.so.0.24[.0] + 1.2.24rc01 13 10224 12.so.0.24[.0] + 1.2.24 13 10224 12.so.0.24[.0] + 1.2.25beta01-06 13 10225 12.so.0.25[.0] + 1.2.25rc01-02 13 10225 12.so.0.25[.0] + 1.0.31 10 10031 10.so.0.31[.0] + 1.2.25 13 10225 12.so.0.25[.0] + 1.2.26beta01-06 13 10226 12.so.0.26[.0] + 1.2.26rc01 13 10226 12.so.0.26[.0] + 1.2.26 13 10226 12.so.0.26[.0] + 1.0.32 10 10032 10.so.0.32[.0] + 1.2.27beta01-06 13 10227 12.so.0.27[.0] + 1.2.27rc01 13 10227 12.so.0.27[.0] + 1.0.33 10 10033 10.so.0.33[.0] + 1.2.27 13 10227 12.so.0.27[.0] + 1.0.34 10 10034 10.so.0.34[.0] + 1.2.28 13 10228 12.so.0.28[.0] + 1.2.29beta01-03 13 10229 12.so.0.29[.0] + 1.2.29rc01 13 10229 12.so.0.29[.0] + 1.0.35 10 10035 10.so.0.35[.0] + 1.2.29 13 10229 12.so.0.29[.0] + 1.0.37 10 10037 10.so.0.37[.0] + 1.2.30beta01-04 13 10230 12.so.0.30[.0] + 1.0.38rc01-08 10 10038 10.so.0.38[.0] + 1.2.30rc01-08 13 10230 12.so.0.30[.0] + 1.0.38 10 10038 10.so.0.38[.0] + 1.2.30 13 10230 12.so.0.30[.0] + 1.0.39rc01-03 10 10039 10.so.0.39[.0] + 1.2.31rc01-03 13 10231 12.so.0.31[.0] + 1.0.39 10 10039 10.so.0.39[.0] + 1.2.31 13 10231 12.so.0.31[.0] + 1.2.32beta01-02 13 10232 12.so.0.32[.0] + 1.0.40rc01 10 10040 10.so.0.40[.0] + 1.2.32rc01 13 10232 12.so.0.32[.0] + 1.0.40 10 10040 10.so.0.40[.0] + 1.2.32 13 10232 12.so.0.32[.0] + 1.2.33beta01-02 13 10233 12.so.0.33[.0] + 1.2.33rc01-02 13 10233 12.so.0.33[.0] + 1.0.41rc01 10 10041 10.so.0.41[.0] + 1.2.33 13 10233 12.so.0.33[.0] + 1.0.41 10 10041 10.so.0.41[.0] + 1.2.34beta01-07 13 10234 12.so.0.34[.0] + 1.0.42rc01 10 10042 10.so.0.42[.0] + 1.2.34rc01 13 10234 12.so.0.34[.0] + 1.0.42 10 10042 10.so.0.42[.0] + 1.2.34 13 10234 12.so.0.34[.0] + 1.2.35beta01-03 13 10235 12.so.0.35[.0] + 1.0.43rc01-02 10 10043 10.so.0.43[.0] + 1.2.35rc01-02 13 10235 12.so.0.35[.0] + 1.0.43 10 10043 10.so.0.43[.0] + 1.2.35 13 10235 12.so.0.35[.0] + 1.2.36beta01-05 13 10236 12.so.0.36[.0] + 1.2.36rc01 13 10236 12.so.0.36[.0] + 1.0.44 10 10044 10.so.0.44[.0] + 1.2.36 13 10236 12.so.0.36[.0] + 1.2.37beta01-03 13 10237 12.so.0.37[.0] + 1.2.37rc01 13 10237 12.so.0.37[.0] + 1.2.37 13 10237 12.so.0.37[.0] + 1.0.45 10 10045 12.so.0.45[.0] + 1.0.46 10 10046 10.so.0.46[.0] + 1.2.38beta01 13 10238 12.so.0.38[.0] + 1.2.38rc01-03 13 10238 12.so.0.38[.0] + 1.0.47 10 10047 10.so.0.47[.0] + 1.2.38 13 10238 12.so.0.38[.0] + 1.2.39beta01-05 13 10239 12.so.0.39[.0] + 1.2.39rc01 13 10239 12.so.0.39[.0] + 1.0.48 10 10048 10.so.0.48[.0] + 1.2.39 13 10239 12.so.0.39[.0] + 1.2.40beta01 13 10240 12.so.0.40[.0] + 1.2.40rc01 13 10240 12.so.0.40[.0] + 1.0.49 10 10049 10.so.0.49[.0] + 1.2.40 13 10240 12.so.0.40[.0] + 1.0.50 10 10050 10.so.0.50[.0] + 1.2.41beta01-18 13 10241 12.so.0.41[.0] + 1.0.51rc01 10 10051 10.so.0.51[.0] + 1.2.41rc01-03 13 10241 12.so.0.41[.0] + 1.0.51 10 10051 10.so.0.51[.0] + 1.2.41 13 10241 12.so.0.41[.0] + 1.2.42beta01-02 13 10242 12.so.0.42[.0] + 1.2.42rc01-05 13 10242 12.so.0.42[.0] + 1.0.52 10 10052 10.so.0.52[.0] + 1.2.42 13 10242 12.so.0.42[.0] + 1.2.43beta01-05 13 10243 12.so.0.43[.0] + 1.0.53rc01-02 10 10053 10.so.0.53[.0] + 1.2.43rc01-02 13 10243 12.so.0.43[.0] + 1.0.53 10 10053 10.so.0.53[.0] + 1.2.43 13 10243 12.so.0.43[.0] + 1.2.44beta01-03 13 10244 12.so.0.44[.0] + 1.2.44rc01-03 13 10244 12.so.0.44[.0] + 1.2.44 13 10244 12.so.0.44[.0] + 1.2.45beta01-03 13 10245 12.so.0.45[.0] + 1.0.55rc01 10 10055 10.so.0.55[.0] + 1.2.45rc01 13 10245 12.so.0.45[.0] + 1.0.55 10 10055 10.so.0.55[.0] + 1.2.45 13 10245 12.so.0.45[.0] + 1.2.46rc01-02 13 10246 12.so.0.46[.0] + 1.0.56 10 10056 10.so.0.56[.0] + 1.2.46 13 10246 12.so.0.46[.0] + 1.2.47beta01 13 10247 12.so.0.47[.0] + 1.2.47rc01 13 10247 12.so.0.47[.0] + 1.0.57rc01 10 10057 10.so.0.57[.0] + 1.2.47 13 10247 12.so.0.47[.0] + 1.0.57 10 10057 10.so.0.57[.0] + 1.2.48beta01 13 10248 12.so.0.48[.0] + 1.2.48rc01-02 13 10248 12.so.0.48[.0] + 1.0.58 10 10058 10.so.0.58[.0] + 1.2.48 13 10248 12.so.0.48[.0] + 1.2.49rc01 13 10249 12.so.0.49[.0] + 1.0.59 10 10059 10.so.0.59[.0] + 1.2.49 13 10249 12.so.0.49[.0] + +Henceforth the source version will match the shared-library minor +and patch numbers; the shared-library major version number will be +used for changes in backward compatibility, as it is intended. The +PNG_PNGLIB_VER macro, which is not used within libpng but is available +for applications, is an unsigned integer of the form xyyzz corresponding +to the source version x.y.z (leading zeros in y and z). Beta versions +were given the previous public release number plus a letter, until +version 1.0.6j; from then on they were given the upcoming public +release number plus "betaNN" or "rcNN". + +.SH "SEE ALSO" +.IR libpngpf(3) ", " png(5) +.LP +.IR libpng : +.IP +http://libpng.sourceforge.net (follow the [DOWNLOAD] link) +http://www.libpng.org/pub/png + +.LP +.IR zlib : +.IP +(generally) at the same location as +.I libpng +or at +.br +ftp://ftp.info-zip.org/pub/infozip/zlib + +.LP +.IR PNG specification: RFC 2083 +.IP +(generally) at the same location as +.I libpng +or at +.br +ftp://ftp.rfc-editor.org:/in-notes/rfc2083.txt +.br +or (as a W3C Recommendation) at +.br +http://www.w3.org/TR/REC-png.html + +.LP +In the case of any inconsistency between the PNG specification +and this library, the specification takes precedence. + +.SH AUTHORS +This man page: Glenn Randers-Pehrson + + +The contributing authors would like to thank all those who helped +with testing, bug fixes, and patience. This wouldn't have been +possible without all of you. + +Thanks to Frank J. T. Wojcik for helping with the documentation. + +Libpng version 1.2.49 - March 29, 2012: +Initially created in 1995 by Guy Eric Schalnat, then of Group 42, Inc. +Currently maintained by Glenn Randers-Pehrson (glennrp at users.sourceforge.net). + +Supported by the PNG development group +.br +png-mng-implement at lists.sf.net +(subscription required; visit +png-mng-implement at lists.sourceforge.net (subscription required; visit +https://lists.sourceforge.net/lists/listinfo/png-mng-implement +to subscribe). + +.SH COPYRIGHT NOTICE, DISCLAIMER, and LICENSE: + +(This copy of the libpng notices is provided for your convenience. In case of +any discrepancy between this copy and the notices in the file png.h that is +included in the libpng distribution, the latter shall prevail.) + +If you modify libpng you may insert additional notices immediately following +this sentence. + +This code is released under the libpng license. + +libpng versions 1.2.6, August 15, 2004, through 1.2.49, March 29, 2012, are +Copyright (c) 2004,2006-2008 Glenn Randers-Pehrson, and are +distributed according to the same disclaimer and license as libpng-1.2.5 +with the following individual added to the list of Contributing Authors + + Cosmin Truta + +libpng versions 1.0.7, July 1, 2000, through 1.2.5 - October 3, 2002, are +Copyright (c) 2000-2002 Glenn Randers-Pehrson, and are +distributed according to the same disclaimer and license as libpng-1.0.6 +with the following individuals added to the list of Contributing Authors + + Simon-Pierre Cadieux + Eric S. Raymond + Gilles Vollant + +and with the following additions to the disclaimer: + + There is no warranty against interference with your + enjoyment of the library or against infringement. + There is no warranty that our efforts or the library + will fulfill any of your particular purposes or needs. + This library is provided with all faults, and the entire + risk of satisfactory quality, performance, accuracy, and + effort is with the user. + +libpng versions 0.97, January 1998, through 1.0.6, March 20, 2000, are +Copyright (c) 1998, 1999 Glenn Randers-Pehrson +Distributed according to the same disclaimer and license as libpng-0.96, +with the following individuals added to the list of Contributing Authors: + + Tom Lane + Glenn Randers-Pehrson + Willem van Schaik + +libpng versions 0.89, June 1996, through 0.96, May 1997, are +Copyright (c) 1996, 1997 Andreas Dilger +Distributed according to the same disclaimer and license as libpng-0.88, +with the following individuals added to the list of Contributing Authors: + + John Bowler + Kevin Bracey + Sam Bushell + Magnus Holmgren + Greg Roelofs + Tom Tanner + +libpng versions 0.5, May 1995, through 0.88, January 1996, are +Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc. + +For the purposes of this copyright and license, "Contributing Authors" +is defined as the following set of individuals: + + Andreas Dilger + Dave Martindale + Guy Eric Schalnat + Paul Schmidt + Tim Wegner + +The PNG Reference Library is supplied "AS IS". The Contributing Authors +and Group 42, Inc. disclaim all warranties, expressed or implied, +including, without limitation, the warranties of merchantability and of +fitness for any purpose. The Contributing Authors and Group 42, Inc. +assume no liability for direct, indirect, incidental, special, exemplary, +or consequential damages, which may result from the use of the PNG +Reference Library, even if advised of the possibility of such damage. + +Permission is hereby granted to use, copy, modify, and distribute this +source code, or portions hereof, for any purpose, without fee, subject +to the following restrictions: + +1. The origin of this source code must not be misrepresented. + +2. Altered versions must be plainly marked as such and + must not be misrepresented as being the original source. + +3. This Copyright notice may not be removed or altered from + any source or altered source distribution. + +The Contributing Authors and Group 42, Inc. specifically permit, without +fee, and encourage the use of this source code as a component to +supporting the PNG file format in commercial products. If you use this +source code in a product, acknowledgment is not required but would be +appreciated. + + +A "png_get_copyright" function is available, for convenient use in "about" +boxes and the like: + + printf("%s",png_get_copyright(NULL)); + +Also, the PNG logo (in PNG format, of course) is supplied in the +files "pngbar.png" and "pngbar.jpg (88x31) and "pngnow.png" (98x31). + +Libpng is OSI Certified Open Source Software. OSI Certified Open Source is a +certification mark of the Open Source Initiative. + +Glenn Randers-Pehrson +glennrp at users.sourceforge.net +March 29, 2012 + +.\" end of man page + diff --git a/external/libpng/libpngpf.3 b/external/libpng/libpngpf.3 new file mode 100644 index 0000000..9a2c2ef --- /dev/null +++ b/external/libpng/libpngpf.3 @@ -0,0 +1,806 @@ +.TH LIBPNGPF 3 "March 29, 2012" +.SH NAME +libpng \- Portable Network Graphics (PNG) Reference Library 1.2.49 +(private functions) +.SH SYNOPSIS +\fB#include \fP + +\fI\fB + +\fBvoid png_64bit_product (long \fP\fIv1\fP\fB, long \fP\fIv2\fP\fB, unsigned long \fI*hi_product, + +\fBunsigned long \fI*lo_product\fP\fB);\fP + +\fI\fB + +\fBvoid png_build_gamma_table (png_structp \fIpng_ptr\fP\fB);\fP + +\fI\fB + +\fI\fB + +\fBvoid png_build_grayscale_palette (int \fP\fIbit_depth\fP\fB, png_colorp \fIpalette\fP\fB);\fP + +\fI\fB + +\fI\fB + +\fBvoid png_calculate_crc (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fP\fIptr\fP\fB, png_size_t \fIlength\fP\fB);\fP + +\fI\fB + +\fI\fB + +\fBint png_check_cHRM_fixed (png_structp \fP\fIpng_ptr\fP\fB, png_fixed_point \fP\fIint_white_x\fP\fB, png_fixed_point \fP\fIint_white_y\fP\fB, png_fixed_point \fP\fIint_red_x\fP\fB, png_fixed_point \fP\fIint_red_y\fP\fB, png_fixed_point \fP\fIint_green_x\fP\fB, png_fixed_point \fP\fIint_green_y\fP\fB, png_fixed_point \fP\fIint_blue_x\fP\fB, png_fixed_point \fIint_blue_y\fP\fB);\fP + +\fI\fB + +\fI\fB + +\fBvoid png_check_IHDR (png_structp \fP\fIpng_ptr\fP\fB, png_uint_32 \fP\fIwidth\fP\fB, png_uint_32 \fP\fIheight\fP\fB, int \fP\fIbit_depth\fP\fB, int \fP\fIcolor_type\fP\fB, int \fP\fIinterlace_type\fP\fB, int \fP\fIcompression_type\fP\fB, int \fIfilter_type\fP\fB);\fP + +\fI\fB + +\fI\fB + +\fBvoid png_check_chunk_name (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fIchunk_name\fP\fB);\fP + +\fI\fB + +\fI\fB + +\fBpng_size_t png_check_keyword (png_structp \fP\fIpng_ptr\fP\fB, png_charp \fP\fIkey\fP\fB, png_charpp \fInew_key\fP\fB);\fP + +\fI\fB + +\fI\fB + +\fBvoid png_combine_row (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fP\fIrow\fP\fB, int \fImask\fP\fB);\fP + +\fI\fB + +\fI\fB + +\fBvoid png_correct_palette (png_structp \fP\fIpng_ptr\fP\fB, png_colorp \fP\fIpalette\fP\fB, int \fInum_palette\fP\fB);\fP + +\fI\fB + +\fI\fB + +\fBint png_crc_error (png_structp \fIpng_ptr\fP\fB);\fP + +\fI\fB + +\fI\fB + +\fBint png_crc_finish (png_structp \fP\fIpng_ptr\fP\fB, png_uint_32 \fIskip\fP\fB);\fP + +\fI\fB + +\fI\fB + +\fBvoid png_crc_read (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fP\fIbuf\fP\fB, png_size_t \fIlength\fP\fB);\fP + +\fI\fB + +\fI\fB + +\fBpng_voidp png_create_struct (int \fItype\fP\fB);\fP + +\fI\fB + +\fI\fB + +\fBpng_voidp png_create_struct_2 (int \fP\fItype\fP\fB, png_malloc_ptr \fP\fImalloc_fn\fP\fB, png_voidp \fImem_ptr\fP\fB);\fP + +\fI\fB + +\fI\fB + +\fBvoid png_decompress_chunk (png_structp \fP\fIpng_ptr\fP\fB, int \fP\fIcomp_type\fP\fB, png_charp \fP\fIchunkdata\fP\fB, png_size_t \fP\fIchunklength\fP\fB, png_size_t \fP\fIprefix_length\fP\fB, png_size_t \fI*data_length\fP\fB);\fP + +\fI\fB + +\fI\fB + +\fBvoid png_destroy_struct (png_voidp \fIstruct_ptr\fP\fB);\fP + +\fI\fB + +\fI\fB + +\fBvoid png_destroy_struct_2 (png_voidp \fP\fIstruct_ptr\fP\fB, png_free_ptr \fP\fIfree_fn\fP\fB, png_voidp \fImem_ptr\fP\fB);\fP + +\fI\fB + +\fI\fB + +\fBvoid png_do_background (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fP\fIrow\fP\fB, png_color_16p \fP\fItrans_values\fP\fB, png_color_16p \fP\fIbackground\fP\fB, png_color_16p \fP\fIbackground_1\fP\fB, png_bytep \fP\fIgamma_table\fP\fB, png_bytep \fP\fIgamma_from_1\fP\fB, png_bytep \fP\fIgamma_to_1\fP\fB, png_uint_16pp \fP\fIgamma_16\fP\fB, png_uint_16pp \fP\fIgamma_16_from_1\fP\fB, png_uint_16pp \fP\fIgamma_16_to_1\fP\fB, int \fIgamma_shift\fP\fB);\fP + +\fI\fB + +\fI\fB + +\fBvoid png_do_bgr (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fIrow\fP\fB);\fP + +\fI\fB + +\fI\fB + +\fBvoid png_do_chop (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fIrow\fP\fB);\fP + +\fI\fB + +\fI\fB + +\fBvoid png_do_dither (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fP\fIrow\fP\fB, png_bytep \fP\fIpalette_lookup\fP\fB, png_bytep \fIdither_lookup\fP\fB);\fP + +\fI\fB + +\fI\fB + +\fBvoid png_do_expand (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fP\fIrow\fP\fB, png_color_16p \fItrans_value\fP\fB);\fP + +\fI\fB + +\fI\fB + +\fBvoid png_do_expand_palette (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fP\fIrow\fP\fB, png_colorp \fP\fIpalette\fP\fB, png_bytep \fP\fItrans\fP\fB, int \fInum_trans\fP\fB);\fP + +\fI\fB + +\fI\fB + +\fBvoid png_do_gamma (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fP\fIrow\fP\fB, png_bytep \fP\fIgamma_table\fP\fB, png_uint_16pp \fP\fIgamma_16_table\fP\fB, int \fIgamma_shift\fP\fB);\fP + +\fI\fB + +\fI\fB + +\fBvoid png_do_gray_to_rgb (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fIrow\fP\fB);\fP + +\fI\fB + +\fI\fB + +\fBvoid png_do_invert (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fIrow\fP\fB);\fP + +\fI\fB + +\fI\fB + +\fBvoid png_do_pack (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fP\fIrow\fP\fB, png_uint_32 \fIbit_depth\fP\fB);\fP + +\fI\fB + +\fI\fB + +\fBvoid png_do_packswap (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fIrow\fP\fB);\fP + +\fI\fB + +\fI\fB + +\fBvoid png_do_read_filler (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fP\fIrow\fP\fB, png_uint_32 \fP\fIfiller\fP\fB, png_uint_32 \fIflags\fP\fB);\fP + +\fI\fB + +\fI\fB + +\fBvoid png_do_read_interlace (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fP\fIrow\fP\fB, int \fP\fIpass\fP\fB, png_uint_32 \fItransformations\fP\fB);\fP + +\fI\fB + +\fI\fB + +\fBvoid png_do_read_invert_alpha (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fIrow\fP\fB);\fP + +\fI\fB + +\fI\fB + +\fBvoid png_do_read_swap_alpha (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fIrow\fP\fB);\fP + +\fI\fB + +\fI\fB + +\fBvoid png_do_read_transformations (png_structp \fIpng_ptr\fP\fB);\fP + +\fI\fB + +\fI\fB + +\fBint png_do_rgb_to_gray (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fIrow\fP\fB);\fP + +\fI\fB + +\fI\fB + +\fBvoid png_do_shift (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fP\fIrow\fP\fB, png_color_8p \fIbit_depth\fP\fB);\fP + +\fI\fB + +\fI\fB + +\fBvoid png_do_strip_filler (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fP\fIrow\fP\fB, png_uint_32 \fIflags\fP\fB);\fP + +\fI\fB + +\fI\fB + +\fBvoid png_do_swap (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fIrow\fP\fB);\fP + +\fI\fB + +\fI\fB + +\fBvoid png_do_unpack (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fIrow\fP\fB);\fP + +\fI\fB + +\fI\fB + +\fBvoid png_do_unshift (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fP\fIrow\fP\fB, png_color_8p \fIsig_bits\fP\fB);\fP + +\fI\fB + +\fI\fB + +\fBvoid png_do_write_interlace (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fP\fIrow\fP\fB, int \fIpass\fP\fB);\fP + +\fI\fB + +\fI\fB + +\fBvoid png_do_write_invert_alpha (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fIrow\fP\fB);\fP + +\fI\fB + +\fI\fB + +\fBvoid png_do_write_swap_alpha (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fIrow\fP\fB);\fP + +\fI\fB + +\fI\fB + +\fBvoid png_do_write_transformations (png_structp \fIpng_ptr\fP\fB);\fP + +\fI\fB + +\fI\fB + +\fBvoid *png_far_to_near (png_structp png_ptr,png_voidp \fP\fIptr\fP\fB, int \fIcheck\fP\fB);\fP + +\fI\fB + +\fI\fB + +\fBvoid png_flush (png_structp \fIpng_ptr\fP\fB);\fP + +\fI\fB + +\fI\fB + +\fBvoid png_handle_bKGD (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP + +\fI\fB + +\fI\fB + +\fBvoid png_handle_cHRM (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP + +\fI\fB + +\fI\fB + +\fBvoid png_handle_gAMA (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP + +\fI\fB + +\fI\fB + +\fBvoid png_handle_hIST (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP + +\fI\fB + +\fI\fB + +\fBvoid png_handle_IEND (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP + +\fI\fB + +\fI\fB + +\fBvoid png_handle_IHDR (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP + +\fI\fB + +\fI\fB + +\fBvoid png_handle_iCCP (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP + +\fI\fB + +\fI\fB + +\fBvoid png_handle_iTXt (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP + +\fI\fB + +\fI\fB + +\fBvoid png_handle_oFFs (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP + +\fI\fB + +\fI\fB + +\fBvoid png_handle_pCAL (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP + +\fI\fB + +\fI\fB + +\fBvoid png_handle_pHYs (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP + +\fI\fB + +\fI\fB + +\fBvoid png_handle_PLTE (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP + +\fI\fB + +\fI\fB + +\fBvoid png_handle_sBIT (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP + +\fI\fB + +\fI\fB + +\fBvoid png_handle_sCAL (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP + +\fI\fB + +\fI\fB + +\fBvoid png_handle_sPLT (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP + +\fI\fB + +\fI\fB + +\fBvoid png_handle_sRGB (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP + +\fI\fB + +\fI\fB + +\fBvoid png_handle_tEXt (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP + +\fI\fB + +\fI\fB + +\fBvoid png_handle_tIME (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP + +\fI\fB + +\fI\fB + +\fBvoid png_handle_tRNS (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP + +\fI\fB + +\fI\fB + +\fBvoid png_handle_unknown (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP + +\fI\fB + +\fI\fB + +\fBvoid png_handle_zTXt (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP + +\fI\fB + +\fI\fB + +\fBvoid png_info_destroy (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP + +\fI\fB + +\fI\fB + +\fBvoid png_init_mmx_flags (png_structp \fIpng_ptr\fP\fB);\fP + +\fI\fB + +\fI\fB + +\fBvoid png_init_read_transformations (png_structp \fIpng_ptr\fP\fB);\fP + +\fI\fB + +\fI\fB + +\fBvoid png_process_IDAT_data (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fP\fIbuffer\fP\fB, png_size_t \fIbuffer_length\fP\fB);\fP + +\fI\fB + +\fI\fB + +\fBvoid png_process_some_data (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP + +\fI\fB + +\fI\fB + +\fBvoid png_push_check_crc (png_structp \fIpng_ptr\fP\fB);\fP + +\fI\fB + +\fI\fB + +\fBvoid png_push_crc_finish (png_structp \fIpng_ptr\fP\fB);\fP + +\fI\fB + +\fI\fB + +\fBvoid png_push_crc_skip (png_structp \fP\fIpng_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP + +\fI\fB + +\fI\fB + +\fBvoid png_push_fill_buffer (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fP\fIbuffer\fP\fB, png_size_t \fIlength\fP\fB);\fP + +\fI\fB + +\fI\fB + +\fBvoid png_push_handle_tEXt (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP + +\fI\fB + +\fI\fB + +\fBvoid png_push_handle_unknown (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP + +\fI\fB + +\fI\fB + +\fBvoid png_push_handle_zTXt (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP + +\fI\fB + +\fI\fB + +\fBvoid png_push_have_end (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP + +\fI\fB + +\fI\fB + +\fBvoid png_push_have_info (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP + +\fI\fB + +\fI\fB + +\fBvoid png_push_have_row (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fIrow\fP\fB);\fP + +\fI\fB + +\fI\fB + +\fBvoid png_push_process_row (png_structp \fIpng_ptr\fP\fB);\fP + +\fI\fB + +\fI\fB + +\fBvoid png_push_read_chunk (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP + +\fI\fB + +\fI\fB + +\fBvoid png_push_read_end (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP + +\fI\fB + +\fI\fB + +\fBvoid png_push_read_IDAT (png_structp \fIpng_ptr\fP\fB);\fP + +\fI\fB + +\fI\fB + +\fBvoid png_push_read_sig (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP + +\fI\fB + +\fI\fB + +\fBvoid png_push_read_tEXt (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP + +\fI\fB + +\fI\fB + +\fBvoid png_push_read_zTXt (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP + +\fI\fB + +\fI\fB + +\fBvoid png_push_restore_buffer (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fP\fIbuffer\fP\fB, png_size_t \fIbuffer_length\fP\fB);\fP + +\fI\fB + +\fI\fB + +\fBvoid png_push_save_buffer (png_structp \fIpng_ptr\fP\fB);\fP + +\fI\fB + +\fI\fB + +\fBpng_uint_32 png_read_chunk_header (png_structp \fIpng_ptr\fP\fB);\fP + +\fI\fB + +\fI\fB + +\fBvoid png_read_data (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fP\fIdata\fP\fB, png_size_t \fIlength\fP\fB);\fP + +\fI\fB + +\fI\fB + +\fBvoid png_read_filter_row (png_structp \fP\fIpng_ptr\fP\fB, png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fP\fIrow\fP\fB, png_bytep \fP\fIprev_row\fP\fB, int \fIfilter\fP\fB);\fP + +\fI\fB + +\fI\fB + +\fBvoid png_read_finish_row (png_structp \fIpng_ptr\fP\fB);\fP + +\fI\fB + +\fI\fB + +\fBvoid png_read_push_finish_row (png_structp \fIpng_ptr\fP\fB);\fP + +\fI\fB + +\fI\fB + +\fBvoid png_read_start_row (png_structp \fIpng_ptr\fP\fB);\fP + +\fI\fB + +\fI\fB + +\fBvoid png_read_transform_info (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP + +\fI\fB + +\fI\fB + +\fBvoid png_reset_crc (png_structp \fIpng_ptr\fP\fB);\fP + +\fI\fB + +\fI\fB + +\fBint png_set_text_2 (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_textp \fP\fItext_ptr\fP\fB, int \fInum_text\fP\fB);\fP + +\fI\fB + +\fI\fB + +\fBvoid png_write_cHRM (png_structp \fP\fIpng_ptr\fP\fB, double \fP\fIwhite_x\fP\fB, double \fP\fIwhite_y\fP\fB, double \fP\fIred_x\fP\fB, double \fP\fIred_y\fP\fB, double \fP\fIgreen_x\fP\fB, double \fP\fIgreen_y\fP\fB, double \fP\fIblue_x\fP\fB, double \fIblue_y\fP\fB);\fP + +\fI\fB + +\fI\fB + +\fBvoid png_write_cHRM_fixed (png_structp \fP\fIpng_ptr\fP\fB, png_uint_32 \fP\fIwhite_x\fP\fB, png_uint_32 \fP\fIwhite_y\fP\fB, png_uint_32 \fP\fIred_x\fP\fB, png_uint_32 \fP\fIred_y\fP\fB, png_uint_32 \fP\fIgreen_x\fP\fB, png_uint_32 \fP\fIgreen_y\fP\fB, png_uint_32 \fP\fIblue_x\fP\fB, png_uint_32 \fIblue_y\fP\fB);\fP + +\fI\fB + +\fI\fB + +\fBvoid png_write_data (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fP\fIdata\fP\fB, png_size_t \fIlength\fP\fB);\fP + +\fI\fB + +\fI\fB + +\fBvoid png_write_filtered_row (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fIfiltered_row\fP\fB);\fP + +\fI\fB + +\fI\fB + +\fBvoid png_write_find_filter (png_structp \fP\fIpng_ptr\fP\fB, png_row_infop \fIrow_info\fP\fB);\fP + +\fI\fB + +\fI\fB + +\fBvoid png_write_finish_row (png_structp \fIpng_ptr\fP\fB);\fP + +\fI\fB + +\fI\fB + +\fBvoid png_write_gAMA (png_structp \fP\fIpng_ptr\fP\fB, double \fIfile_gamma\fP\fB);\fP + +\fI\fB + +\fI\fB + +\fBvoid png_write_gAMA_fixed (png_structp \fP\fIpng_ptr\fP\fB, png_uint_32 \fIint_file_gamma\fP\fB);\fP + +\fI\fB + +\fI\fB + +\fBvoid png_write_hIST (png_structp \fP\fIpng_ptr\fP\fB, png_uint_16p \fP\fIhist\fP\fB, int \fInum_hist\fP\fB);\fP + +\fI\fB + +\fI\fB + +\fBvoid png_write_iCCP (png_structp \fP\fIpng_ptr\fP\fB, png_charp \fP\fIname\fP\fB, int \fP\fIcompression_type\fP\fB, png_charp \fP\fIprofile\fP\fB, int \fIproflen\fP\fB);\fP + +\fI\fB + +\fI\fB + +\fBvoid png_write_IDAT (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fP\fIdata\fP\fB, png_size_t \fIlength\fP\fB);\fP + +\fI\fB + +\fI\fB + +\fBvoid png_write_IEND (png_structp \fIpng_ptr\fP\fB);\fP + +\fI\fB + +\fI\fB + +\fBvoid png_write_IHDR (png_structp \fP\fIpng_ptr\fP\fB, png_uint_32 \fP\fIwidth\fP\fB, png_uint_32 \fP\fIheight\fP\fB, int \fP\fIbit_depth\fP\fB, int \fP\fIcolor_type\fP\fB, int \fP\fIcompression_type\fP\fB, int \fP\fIfilter_type\fP\fB, int \fIinterlace_type\fP\fB);\fP + +\fI\fB + +\fI\fB + +\fBvoid png_write_iTXt (png_structp \fP\fIpng_ptr\fP\fB, int \fP\fIcompression\fP\fB, png_charp \fP\fIkey\fP\fB, png_charp \fP\fIlang\fP\fB, png_charp \fP\fItranslated_key\fP\fB, png_charp \fItext\fP\fB);\fP + +\fI\fB + +\fI\fB + +\fBvoid png_write_oFFs (png_structp \fP\fIpng_ptr\fP\fB, png_uint_32 \fP\fIx_offset\fP\fB, png_uint_32 \fP\fIy_offset\fP\fB, int \fIunit_type\fP\fB);\fP + +\fI\fB + +\fI\fB + +\fBvoid png_write_pCAL (png_structp \fP\fIpng_ptr\fP\fB, png_charp \fP\fIpurpose\fP\fB, png_int_32 \fP\fIX0\fP\fB, png_int_32 \fP\fIX1\fP\fB, int \fP\fItype\fP\fB, int \fP\fInparams\fP\fB, png_charp \fP\fIunits\fP\fB, png_charpp \fIparams\fP\fB);\fP + +\fI\fB + +\fI\fB + +\fBvoid png_write_pHYs (png_structp \fP\fIpng_ptr\fP\fB, png_uint_32 \fP\fIx_pixels_per_unit\fP\fB, png_uint_32 \fP\fIy_pixels_per_unit\fP\fB, int \fIunit_type\fP\fB);\fP + +\fI\fB + +\fI\fB + +\fBvoid png_write_PLTE (png_structp \fP\fIpng_ptr\fP\fB, png_colorp \fP\fIpalette\fP\fB, png_uint_32 \fInum_pal\fP\fB);\fP + +\fI\fB + +\fI\fB + +\fBvoid png_write_sBIT (png_structp \fP\fIpng_ptr\fP\fB, png_color_8p \fP\fIsbit\fP\fB, int \fIcolor_type\fP\fB);\fP + +\fI\fB + +\fI\fB + +\fBvoid png_write_sCAL (png_structp \fP\fIpng_ptr\fP\fB, png_charp \fP\fIunit\fP\fB, double \fP\fIwidth\fP\fB, double \fIheight\fP\fB);\fP + +\fI\fB + +\fI\fB + +\fBvoid png_write_sCAL_s (png_structp \fP\fIpng_ptr\fP\fB, png_charp \fP\fIunit\fP\fB, png_charp \fP\fIwidth\fP\fB, png_charp \fIheight\fP\fB);\fP + +\fI\fB + +\fI\fB + +\fBvoid png_write_sig (png_structp \fIpng_ptr\fP\fB);\fP + +\fI\fB + +\fI\fB + +\fBvoid png_write_sRGB (png_structp \fP\fIpng_ptr\fP\fB, int \fIintent\fP\fB);\fP + +\fI\fB + +\fI\fB + +\fBvoid png_write_sPLT (png_structp \fP\fIpng_ptr\fP\fB, png_spalette_p \fIpalette\fP\fB);\fP + +\fI\fB + +\fI\fB + +\fBvoid png_write_start_row (png_structp \fIpng_ptr\fP\fB);\fP + +\fI\fB + +\fI\fB + +\fBvoid png_write_tEXt (png_structp \fP\fIpng_ptr\fP\fB, png_charp \fP\fIkey\fP\fB, png_charp \fP\fItext\fP\fB, png_size_t \fItext_len\fP\fB);\fP + +\fI\fB + +\fI\fB + +\fBvoid png_write_tIME (png_structp \fP\fIpng_ptr\fP\fB, png_timep \fImod_time\fP\fB);\fP + +\fI\fB + +\fI\fB + +\fBvoid png_write_tRNS (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fP\fItrans\fP\fB, png_color_16p \fP\fIvalues\fP\fB, int \fP\fInumber\fP\fB, int \fIcolor_type\fP\fB);\fP + +\fI\fB + +\fI\fB + +\fBvoid png_write_zTXt (png_structp \fP\fIpng_ptr\fP\fB, png_charp \fP\fIkey\fP\fB, png_charp \fP\fItext\fP\fB, png_size_t \fP\fItext_len\fP\fB, int \fIcompression\fP\fB);\fP + +\fI\fB + +\fI\fB + +\fBvoidpf png_zalloc (voidpf \fP\fIpng_ptr\fP\fB, uInt \fP\fIitems\fP\fB, uInt \fIsize\fP\fB);\fP + +\fI\fB + +\fI\fB + +\fBvoid png_zfree (voidpf \fP\fIpng_ptr\fP\fB, voidpf \fIptr\fP\fB);\fP + +\fI\fB + +\fI\fB + +.SH DESCRIPTION +The functions listed above are used privately by libpng +and are not recommended for use by applications. They are +not "exported" to applications using shared libraries. They +are listed alphabetically here as an aid to libpng maintainers. +See png.h for more information on these functions. + +.SH SEE ALSO +.IR libpng(3) ", " png(5) +.SH AUTHOR +Glenn Randers-Pehrson diff --git a/external/libpng/png.5 b/external/libpng/png.5 new file mode 100644 index 0000000..e16d303 --- /dev/null +++ b/external/libpng/png.5 @@ -0,0 +1,74 @@ +.TH PNG 5 "March 29, 2012" +.SH NAME +png \- Portable Network Graphics (PNG) format +.SH DESCRIPTION +PNG (Portable Network Graphics) is an extensible file format for the +lossless, portable, well-compressed storage of raster images. PNG provides +a patent-free replacement for GIF and can also replace many +common uses of TIFF. Indexed-color, grayscale, and truecolor images are +supported, plus an optional alpha channel. Sample depths range from +1 to 16 bits. +.br + +PNG is designed to work well in online viewing applications, such as the +World Wide Web, so it is fully streamable with a progressive display +option. PNG is robust, providing both full file integrity checking and +fast, simple detection of common transmission errors. Also, PNG can store +gamma and chromaticity data for improved color matching on heterogeneous +platforms. + +.SH "SEE ALSO" +.IR libpng(3) ", " zlib(3) ", " deflate(5) ", and " zlib(5) +.LP +PNG specification (second edition), November 2003: +.IP +.br + defines should NOT be changed. + */ +#define PNG_INFO_gAMA 0x0001 +#define PNG_INFO_sBIT 0x0002 +#define PNG_INFO_cHRM 0x0004 +#define PNG_INFO_PLTE 0x0008 +#define PNG_INFO_tRNS 0x0010 +#define PNG_INFO_bKGD 0x0020 +#define PNG_INFO_hIST 0x0040 +#define PNG_INFO_pHYs 0x0080 +#define PNG_INFO_oFFs 0x0100 +#define PNG_INFO_tIME 0x0200 +#define PNG_INFO_pCAL 0x0400 +#define PNG_INFO_sRGB 0x0800 /* GR-P, 0.96a */ +#define PNG_INFO_iCCP 0x1000 /* ESR, 1.0.6 */ +#define PNG_INFO_sPLT 0x2000 /* ESR, 1.0.6 */ +#define PNG_INFO_sCAL 0x4000 /* ESR, 1.0.6 */ +#define PNG_INFO_IDAT 0x8000L /* ESR, 1.0.6 */ + +/* This is used for the transformation routines, as some of them + * change these values for the row. It also should enable using + * the routines for other purposes. + */ +typedef struct png_row_info_struct +{ + png_uint_32 width; /* width of row */ + png_uint_32 rowbytes; /* number of bytes in row */ + png_byte color_type; /* color type of row */ + png_byte bit_depth; /* bit depth of row */ + png_byte channels; /* number of channels (1, 2, 3, or 4) */ + png_byte pixel_depth; /* bits per pixel (depth * channels) */ +} png_row_info; + +typedef png_row_info FAR * png_row_infop; +typedef png_row_info FAR * FAR * png_row_infopp; + +/* These are the function types for the I/O functions and for the functions + * that allow the user to override the default I/O functions with his or her + * own. The png_error_ptr type should match that of user-supplied warning + * and error functions, while the png_rw_ptr type should match that of the + * user read/write data functions. + */ +typedef struct png_struct_def png_struct; +typedef png_struct FAR * png_structp; + +typedef void (PNGAPI *png_error_ptr) PNGARG((png_structp, png_const_charp)); +typedef void (PNGAPI *png_rw_ptr) PNGARG((png_structp, png_bytep, png_size_t)); +typedef void (PNGAPI *png_flush_ptr) PNGARG((png_structp)); +typedef void (PNGAPI *png_read_status_ptr) PNGARG((png_structp, png_uint_32, + int)); +typedef void (PNGAPI *png_write_status_ptr) PNGARG((png_structp, png_uint_32, + int)); + +#ifdef PNG_PROGRESSIVE_READ_SUPPORTED +typedef void (PNGAPI *png_progressive_info_ptr) PNGARG((png_structp, png_infop)); +typedef void (PNGAPI *png_progressive_end_ptr) PNGARG((png_structp, png_infop)); +typedef void (PNGAPI *png_progressive_row_ptr) PNGARG((png_structp, png_bytep, + png_uint_32, int)); +#endif + +#if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) || \ + defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED) || \ + defined(PNG_LEGACY_SUPPORTED) +typedef void (PNGAPI *png_user_transform_ptr) PNGARG((png_structp, + png_row_infop, png_bytep)); +#endif + +#ifdef PNG_USER_CHUNKS_SUPPORTED +typedef int (PNGAPI *png_user_chunk_ptr) PNGARG((png_structp, png_unknown_chunkp)); +#endif +#ifdef PNG_UNKNOWN_CHUNKS_SUPPORTED +typedef void (PNGAPI *png_unknown_chunk_ptr) PNGARG((png_structp)); +#endif + +/* Transform masks for the high-level interface */ +#define PNG_TRANSFORM_IDENTITY 0x0000 /* read and write */ +#define PNG_TRANSFORM_STRIP_16 0x0001 /* read only */ +#define PNG_TRANSFORM_STRIP_ALPHA 0x0002 /* read only */ +#define PNG_TRANSFORM_PACKING 0x0004 /* read and write */ +#define PNG_TRANSFORM_PACKSWAP 0x0008 /* read and write */ +#define PNG_TRANSFORM_EXPAND 0x0010 /* read only */ +#define PNG_TRANSFORM_INVERT_MONO 0x0020 /* read and write */ +#define PNG_TRANSFORM_SHIFT 0x0040 /* read and write */ +#define PNG_TRANSFORM_BGR 0x0080 /* read and write */ +#define PNG_TRANSFORM_SWAP_ALPHA 0x0100 /* read and write */ +#define PNG_TRANSFORM_SWAP_ENDIAN 0x0200 /* read and write */ +#define PNG_TRANSFORM_INVERT_ALPHA 0x0400 /* read and write */ +#define PNG_TRANSFORM_STRIP_FILLER 0x0800 /* write only, deprecated */ +/* Added to libpng-1.2.34 */ +#define PNG_TRANSFORM_STRIP_FILLER_BEFORE 0x0800 /* write only */ +#define PNG_TRANSFORM_STRIP_FILLER_AFTER 0x1000 /* write only */ +/* Added to libpng-1.2.41 */ +#define PNG_TRANSFORM_GRAY_TO_RGB 0x2000 /* read only */ + +/* Flags for MNG supported features */ +#define PNG_FLAG_MNG_EMPTY_PLTE 0x01 +#define PNG_FLAG_MNG_FILTER_64 0x04 +#define PNG_ALL_MNG_FEATURES 0x05 + +typedef png_voidp (*png_malloc_ptr) PNGARG((png_structp, png_size_t)); +typedef void (*png_free_ptr) PNGARG((png_structp, png_voidp)); + +/* The structure that holds the information to read and write PNG files. + * The only people who need to care about what is inside of this are the + * people who will be modifying the library for their own special needs. + * It should NOT be accessed directly by an application, except to store + * the jmp_buf. + */ + +struct png_struct_def +{ +#ifdef PNG_SETJMP_SUPPORTED + jmp_buf jmpbuf; /* used in png_error */ +#endif + png_error_ptr error_fn PNG_DEPSTRUCT; /* function for printing errors and aborting */ + png_error_ptr warning_fn PNG_DEPSTRUCT; /* function for printing warnings */ + png_voidp error_ptr PNG_DEPSTRUCT; /* user supplied struct for error functions */ + png_rw_ptr write_data_fn PNG_DEPSTRUCT; /* function for writing output data */ + png_rw_ptr read_data_fn PNG_DEPSTRUCT; /* function for reading input data */ + png_voidp io_ptr PNG_DEPSTRUCT; /* ptr to application struct for I/O functions */ + +#ifdef PNG_READ_USER_TRANSFORM_SUPPORTED + png_user_transform_ptr read_user_transform_fn PNG_DEPSTRUCT; /* user read transform */ +#endif + +#ifdef PNG_WRITE_USER_TRANSFORM_SUPPORTED + png_user_transform_ptr write_user_transform_fn PNG_DEPSTRUCT; /* user write transform */ +#endif + +/* These were added in libpng-1.0.2 */ +#ifdef PNG_USER_TRANSFORM_PTR_SUPPORTED +#if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) || \ + defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED) + png_voidp user_transform_ptr PNG_DEPSTRUCT; /* user supplied struct for user transform */ + png_byte user_transform_depth PNG_DEPSTRUCT; /* bit depth of user transformed pixels */ + png_byte user_transform_channels PNG_DEPSTRUCT; /* channels in user transformed pixels */ +#endif +#endif + + png_uint_32 mode PNG_DEPSTRUCT; /* tells us where we are in the PNG file */ + png_uint_32 flags PNG_DEPSTRUCT; /* flags indicating various things to libpng */ + png_uint_32 transformations PNG_DEPSTRUCT; /* which transformations to perform */ + + z_stream zstream PNG_DEPSTRUCT; /* pointer to decompression structure (below) */ + png_bytep zbuf PNG_DEPSTRUCT; /* buffer for zlib */ + png_size_t zbuf_size PNG_DEPSTRUCT; /* size of zbuf */ + int zlib_level PNG_DEPSTRUCT; /* holds zlib compression level */ + int zlib_method PNG_DEPSTRUCT; /* holds zlib compression method */ + int zlib_window_bits PNG_DEPSTRUCT; /* holds zlib compression window bits */ + int zlib_mem_level PNG_DEPSTRUCT; /* holds zlib compression memory level */ + int zlib_strategy PNG_DEPSTRUCT; /* holds zlib compression strategy */ + + png_uint_32 width PNG_DEPSTRUCT; /* width of image in pixels */ + png_uint_32 height PNG_DEPSTRUCT; /* height of image in pixels */ + png_uint_32 num_rows PNG_DEPSTRUCT; /* number of rows in current pass */ + png_uint_32 usr_width PNG_DEPSTRUCT; /* width of row at start of write */ + png_uint_32 rowbytes PNG_DEPSTRUCT; /* size of row in bytes */ +#if 0 /* Replaced with the following in libpng-1.2.43 */ + png_size_t irowbytes PNG_DEPSTRUCT; +#endif +/* Added in libpng-1.2.43 */ +#ifdef PNG_USER_LIMITS_SUPPORTED + /* Added in libpng-1.4.0: Total number of sPLT, text, and unknown + * chunks that can be stored (0 means unlimited). + */ + png_uint_32 user_chunk_cache_max PNG_DEPSTRUCT; +#endif + png_uint_32 iwidth PNG_DEPSTRUCT; /* width of current interlaced row in pixels */ + png_uint_32 row_number PNG_DEPSTRUCT; /* current row in interlace pass */ + png_bytep prev_row PNG_DEPSTRUCT; /* buffer to save previous (unfiltered) row */ + png_bytep row_buf PNG_DEPSTRUCT; /* buffer to save current (unfiltered) row */ +#ifndef PNG_NO_WRITE_FILTER + png_bytep sub_row PNG_DEPSTRUCT; /* buffer to save "sub" row when filtering */ + png_bytep up_row PNG_DEPSTRUCT; /* buffer to save "up" row when filtering */ + png_bytep avg_row PNG_DEPSTRUCT; /* buffer to save "avg" row when filtering */ + png_bytep paeth_row PNG_DEPSTRUCT; /* buffer to save "Paeth" row when filtering */ +#endif + png_row_info row_info PNG_DEPSTRUCT; /* used for transformation routines */ + + png_uint_32 idat_size PNG_DEPSTRUCT; /* current IDAT size for read */ + png_uint_32 crc PNG_DEPSTRUCT; /* current chunk CRC value */ + png_colorp palette PNG_DEPSTRUCT; /* palette from the input file */ + png_uint_16 num_palette PNG_DEPSTRUCT; /* number of color entries in palette */ + png_uint_16 num_trans PNG_DEPSTRUCT; /* number of transparency values */ + png_byte chunk_name[5] PNG_DEPSTRUCT; /* null-terminated name of current chunk */ + png_byte compression PNG_DEPSTRUCT; /* file compression type (always 0) */ + png_byte filter PNG_DEPSTRUCT; /* file filter type (always 0) */ + png_byte interlaced PNG_DEPSTRUCT; /* PNG_INTERLACE_NONE, PNG_INTERLACE_ADAM7 */ + png_byte pass PNG_DEPSTRUCT; /* current interlace pass (0 - 6) */ + png_byte do_filter PNG_DEPSTRUCT; /* row filter flags (see PNG_FILTER_ below ) */ + png_byte color_type PNG_DEPSTRUCT; /* color type of file */ + png_byte bit_depth PNG_DEPSTRUCT; /* bit depth of file */ + png_byte usr_bit_depth PNG_DEPSTRUCT; /* bit depth of users row */ + png_byte pixel_depth PNG_DEPSTRUCT; /* number of bits per pixel */ + png_byte channels PNG_DEPSTRUCT; /* number of channels in file */ + png_byte usr_channels PNG_DEPSTRUCT; /* channels at start of write */ + png_byte sig_bytes PNG_DEPSTRUCT; /* magic bytes read/written from start of file */ + +#if defined(PNG_READ_FILLER_SUPPORTED) || defined(PNG_WRITE_FILLER_SUPPORTED) +#ifdef PNG_LEGACY_SUPPORTED + png_byte filler PNG_DEPSTRUCT; /* filler byte for pixel expansion */ +#else + png_uint_16 filler PNG_DEPSTRUCT; /* filler bytes for pixel expansion */ +#endif +#endif + +#ifdef PNG_bKGD_SUPPORTED + png_byte background_gamma_type PNG_DEPSTRUCT; +# ifdef PNG_FLOATING_POINT_SUPPORTED + float background_gamma PNG_DEPSTRUCT; +# endif + png_color_16 background PNG_DEPSTRUCT; /* background color in screen gamma space */ +#ifdef PNG_READ_GAMMA_SUPPORTED + png_color_16 background_1 PNG_DEPSTRUCT; /* background normalized to gamma 1.0 */ +#endif +#endif /* PNG_bKGD_SUPPORTED */ + +#ifdef PNG_WRITE_FLUSH_SUPPORTED + png_flush_ptr output_flush_fn PNG_DEPSTRUCT; /* Function for flushing output */ + png_uint_32 flush_dist PNG_DEPSTRUCT; /* how many rows apart to flush, 0 - no flush */ + png_uint_32 flush_rows PNG_DEPSTRUCT; /* number of rows written since last flush */ +#endif + +#if defined(PNG_READ_GAMMA_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED) + int gamma_shift PNG_DEPSTRUCT; /* number of "insignificant" bits 16-bit gamma */ +#ifdef PNG_FLOATING_POINT_SUPPORTED + float gamma PNG_DEPSTRUCT; /* file gamma value */ + float screen_gamma PNG_DEPSTRUCT; /* screen gamma value (display_exponent) */ +#endif +#endif + +#if defined(PNG_READ_GAMMA_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED) + png_bytep gamma_table PNG_DEPSTRUCT; /* gamma table for 8-bit depth files */ + png_bytep gamma_from_1 PNG_DEPSTRUCT; /* converts from 1.0 to screen */ + png_bytep gamma_to_1 PNG_DEPSTRUCT; /* converts from file to 1.0 */ + png_uint_16pp gamma_16_table PNG_DEPSTRUCT; /* gamma table for 16-bit depth files */ + png_uint_16pp gamma_16_from_1 PNG_DEPSTRUCT; /* converts from 1.0 to screen */ + png_uint_16pp gamma_16_to_1 PNG_DEPSTRUCT; /* converts from file to 1.0 */ +#endif + +#if defined(PNG_READ_GAMMA_SUPPORTED) || defined(PNG_sBIT_SUPPORTED) + png_color_8 sig_bit PNG_DEPSTRUCT; /* significant bits in each available channel */ +#endif + +#if defined(PNG_READ_SHIFT_SUPPORTED) || defined(PNG_WRITE_SHIFT_SUPPORTED) + png_color_8 shift PNG_DEPSTRUCT; /* shift for significant bit tranformation */ +#endif + +#if defined(PNG_tRNS_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED) \ + || defined(PNG_READ_EXPAND_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED) + png_bytep trans PNG_DEPSTRUCT; /* transparency values for paletted files */ + png_color_16 trans_values PNG_DEPSTRUCT; /* transparency values for non-paletted files */ +#endif + + png_read_status_ptr read_row_fn PNG_DEPSTRUCT; /* called after each row is decoded */ + png_write_status_ptr write_row_fn PNG_DEPSTRUCT; /* called after each row is encoded */ +#ifdef PNG_PROGRESSIVE_READ_SUPPORTED + png_progressive_info_ptr info_fn PNG_DEPSTRUCT; /* called after header data fully read */ + png_progressive_row_ptr row_fn PNG_DEPSTRUCT; /* called after each prog. row is decoded */ + png_progressive_end_ptr end_fn PNG_DEPSTRUCT; /* called after image is complete */ + png_bytep save_buffer_ptr PNG_DEPSTRUCT; /* current location in save_buffer */ + png_bytep save_buffer PNG_DEPSTRUCT; /* buffer for previously read data */ + png_bytep current_buffer_ptr PNG_DEPSTRUCT; /* current location in current_buffer */ + png_bytep current_buffer PNG_DEPSTRUCT; /* buffer for recently used data */ + png_uint_32 push_length PNG_DEPSTRUCT; /* size of current input chunk */ + png_uint_32 skip_length PNG_DEPSTRUCT; /* bytes to skip in input data */ + png_size_t save_buffer_size PNG_DEPSTRUCT; /* amount of data now in save_buffer */ + png_size_t save_buffer_max PNG_DEPSTRUCT; /* total size of save_buffer */ + png_size_t buffer_size PNG_DEPSTRUCT; /* total amount of available input data */ + png_size_t current_buffer_size PNG_DEPSTRUCT; /* amount of data now in current_buffer */ + int process_mode PNG_DEPSTRUCT; /* what push library is currently doing */ + int cur_palette PNG_DEPSTRUCT; /* current push library palette index */ + +# ifdef PNG_TEXT_SUPPORTED + png_size_t current_text_size PNG_DEPSTRUCT; /* current size of text input data */ + png_size_t current_text_left PNG_DEPSTRUCT; /* how much text left to read in input */ + png_charp current_text PNG_DEPSTRUCT; /* current text chunk buffer */ + png_charp current_text_ptr PNG_DEPSTRUCT; /* current location in current_text */ +# endif /* PNG_TEXT_SUPPORTED */ +#endif /* PNG_PROGRESSIVE_READ_SUPPORTED */ + +#if defined(__TURBOC__) && !defined(_Windows) && !defined(__FLAT__) +/* for the Borland special 64K segment handler */ + png_bytepp offset_table_ptr PNG_DEPSTRUCT; + png_bytep offset_table PNG_DEPSTRUCT; + png_uint_16 offset_table_number PNG_DEPSTRUCT; + png_uint_16 offset_table_count PNG_DEPSTRUCT; + png_uint_16 offset_table_count_free PNG_DEPSTRUCT; +#endif + +#ifdef PNG_READ_DITHER_SUPPORTED + png_bytep palette_lookup PNG_DEPSTRUCT; /* lookup table for dithering */ + png_bytep dither_index PNG_DEPSTRUCT; /* index translation for palette files */ +#endif + +#if defined(PNG_READ_DITHER_SUPPORTED) || defined(PNG_hIST_SUPPORTED) + png_uint_16p hist PNG_DEPSTRUCT; /* histogram */ +#endif + +#ifdef PNG_WRITE_WEIGHTED_FILTER_SUPPORTED + png_byte heuristic_method PNG_DEPSTRUCT; /* heuristic for row filter selection */ + png_byte num_prev_filters PNG_DEPSTRUCT; /* number of weights for previous rows */ + png_bytep prev_filters PNG_DEPSTRUCT; /* filter type(s) of previous row(s) */ + png_uint_16p filter_weights PNG_DEPSTRUCT; /* weight(s) for previous line(s) */ + png_uint_16p inv_filter_weights PNG_DEPSTRUCT; /* 1/weight(s) for previous line(s) */ + png_uint_16p filter_costs PNG_DEPSTRUCT; /* relative filter calculation cost */ + png_uint_16p inv_filter_costs PNG_DEPSTRUCT; /* 1/relative filter calculation cost */ +#endif + +#ifdef PNG_TIME_RFC1123_SUPPORTED + png_charp time_buffer PNG_DEPSTRUCT; /* String to hold RFC 1123 time text */ +#endif + +/* New members added in libpng-1.0.6 */ + +#ifdef PNG_FREE_ME_SUPPORTED + png_uint_32 free_me PNG_DEPSTRUCT; /* flags items libpng is responsible for freeing */ +#endif + +#ifdef PNG_USER_CHUNKS_SUPPORTED + png_voidp user_chunk_ptr PNG_DEPSTRUCT; + png_user_chunk_ptr read_user_chunk_fn PNG_DEPSTRUCT; /* user read chunk handler */ +#endif + +#ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED + int num_chunk_list PNG_DEPSTRUCT; + png_bytep chunk_list PNG_DEPSTRUCT; +#endif + +/* New members added in libpng-1.0.3 */ +#ifdef PNG_READ_RGB_TO_GRAY_SUPPORTED + png_byte rgb_to_gray_status PNG_DEPSTRUCT; + /* These were changed from png_byte in libpng-1.0.6 */ + png_uint_16 rgb_to_gray_red_coeff PNG_DEPSTRUCT; + png_uint_16 rgb_to_gray_green_coeff PNG_DEPSTRUCT; + png_uint_16 rgb_to_gray_blue_coeff PNG_DEPSTRUCT; +#endif + +/* New member added in libpng-1.0.4 (renamed in 1.0.9) */ +#if defined(PNG_MNG_FEATURES_SUPPORTED) || \ + defined(PNG_READ_EMPTY_PLTE_SUPPORTED) || \ + defined(PNG_WRITE_EMPTY_PLTE_SUPPORTED) +/* Changed from png_byte to png_uint_32 at version 1.2.0 */ +#ifdef PNG_1_0_X + png_byte mng_features_permitted PNG_DEPSTRUCT; +#else + png_uint_32 mng_features_permitted PNG_DEPSTRUCT; +#endif /* PNG_1_0_X */ +#endif + +/* New member added in libpng-1.0.7 */ +#if defined(PNG_READ_GAMMA_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED) + png_fixed_point int_gamma PNG_DEPSTRUCT; +#endif + +/* New member added in libpng-1.0.9, ifdef'ed out in 1.0.12, enabled in 1.2.0 */ +#ifdef PNG_MNG_FEATURES_SUPPORTED + png_byte filter_type PNG_DEPSTRUCT; +#endif + +#ifdef PNG_1_0_X +/* New member added in libpng-1.0.10, ifdef'ed out in 1.2.0 */ + png_uint_32 row_buf_size PNG_DEPSTRUCT; +#endif + +/* New members added in libpng-1.2.0 */ +#ifdef PNG_ASSEMBLER_CODE_SUPPORTED +# ifndef PNG_1_0_X +# ifdef PNG_MMX_CODE_SUPPORTED + png_byte mmx_bitdepth_threshold PNG_DEPSTRUCT; + png_uint_32 mmx_rowbytes_threshold PNG_DEPSTRUCT; +# endif + png_uint_32 asm_flags PNG_DEPSTRUCT; +# endif +#endif + +/* New members added in libpng-1.0.2 but first enabled by default in 1.2.0 */ +#ifdef PNG_USER_MEM_SUPPORTED + png_voidp mem_ptr PNG_DEPSTRUCT; /* user supplied struct for mem functions */ + png_malloc_ptr malloc_fn PNG_DEPSTRUCT; /* function for allocating memory */ + png_free_ptr free_fn PNG_DEPSTRUCT; /* function for freeing memory */ +#endif + +/* New member added in libpng-1.0.13 and 1.2.0 */ + png_bytep big_row_buf PNG_DEPSTRUCT; /* buffer to save current (unfiltered) row */ + +#ifdef PNG_READ_DITHER_SUPPORTED +/* The following three members were added at version 1.0.14 and 1.2.4 */ + png_bytep dither_sort PNG_DEPSTRUCT; /* working sort array */ + png_bytep index_to_palette PNG_DEPSTRUCT; /* where the original index currently is */ + /* in the palette */ + png_bytep palette_to_index PNG_DEPSTRUCT; /* which original index points to this */ + /* palette color */ +#endif + +/* New members added in libpng-1.0.16 and 1.2.6 */ + png_byte compression_type PNG_DEPSTRUCT; + +#ifdef PNG_USER_LIMITS_SUPPORTED + png_uint_32 user_width_max PNG_DEPSTRUCT; + png_uint_32 user_height_max PNG_DEPSTRUCT; +#endif + +/* New member added in libpng-1.0.25 and 1.2.17 */ +#ifdef PNG_UNKNOWN_CHUNKS_SUPPORTED + /* Storage for unknown chunk that the library doesn't recognize. */ + png_unknown_chunk unknown_chunk PNG_DEPSTRUCT; +#endif + +/* New members added in libpng-1.2.26 */ + png_uint_32 old_big_row_buf_size PNG_DEPSTRUCT; + png_uint_32 old_prev_row_size PNG_DEPSTRUCT; + +/* New member added in libpng-1.2.30 */ + png_charp chunkdata PNG_DEPSTRUCT; /* buffer for reading chunk data */ + + +}; + + +/* This triggers a compiler error in png.c, if png.c and png.h + * do not agree upon the version number. + */ +typedef png_structp version_1_2_49; + +typedef png_struct FAR * FAR * png_structpp; + +/* Here are the function definitions most commonly used. This is not + * the place to find out how to use libpng. See libpng.txt for the + * full explanation, see example.c for the summary. This just provides + * a simple one line description of the use of each function. + */ + +/* Returns the version number of the library */ +extern PNG_EXPORT(png_uint_32,png_access_version_number) PNGARG((void)); + +/* Tell lib we have already handled the first magic bytes. + * Handling more than 8 bytes from the beginning of the file is an error. + */ +extern PNG_EXPORT(void,png_set_sig_bytes) PNGARG((png_structp png_ptr, + int num_bytes)); + +/* Check sig[start] through sig[start + num_to_check - 1] to see if it's a + * PNG file. Returns zero if the supplied bytes match the 8-byte PNG + * signature, and non-zero otherwise. Having num_to_check == 0 or + * start > 7 will always fail (ie return non-zero). + */ +extern PNG_EXPORT(int,png_sig_cmp) PNGARG((png_bytep sig, png_size_t start, + png_size_t num_to_check)); + +/* Simple signature checking function. This is the same as calling + * png_check_sig(sig, n) := !png_sig_cmp(sig, 0, n). + */ +extern PNG_EXPORT(int,png_check_sig) PNGARG((png_bytep sig, int num)) PNG_DEPRECATED; + +/* Allocate and initialize png_ptr struct for reading, and any other memory. */ +extern PNG_EXPORT(png_structp,png_create_read_struct) + PNGARG((png_const_charp user_png_ver, png_voidp error_ptr, + png_error_ptr error_fn, png_error_ptr warn_fn)) PNG_ALLOCATED; + +/* Allocate and initialize png_ptr struct for writing, and any other memory */ +extern PNG_EXPORT(png_structp,png_create_write_struct) + PNGARG((png_const_charp user_png_ver, png_voidp error_ptr, + png_error_ptr error_fn, png_error_ptr warn_fn)) PNG_ALLOCATED; + +#ifdef PNG_WRITE_SUPPORTED +extern PNG_EXPORT(png_uint_32,png_get_compression_buffer_size) + PNGARG((png_structp png_ptr)); +#endif + +#ifdef PNG_WRITE_SUPPORTED +extern PNG_EXPORT(void,png_set_compression_buffer_size) + PNGARG((png_structp png_ptr, png_uint_32 size)); +#endif + +/* Reset the compression stream */ +extern PNG_EXPORT(int,png_reset_zstream) PNGARG((png_structp png_ptr)); + +/* New functions added in libpng-1.0.2 (not enabled by default until 1.2.0) */ +#ifdef PNG_USER_MEM_SUPPORTED +extern PNG_EXPORT(png_structp,png_create_read_struct_2) + PNGARG((png_const_charp user_png_ver, png_voidp error_ptr, + png_error_ptr error_fn, png_error_ptr warn_fn, png_voidp mem_ptr, + png_malloc_ptr malloc_fn, png_free_ptr free_fn)) PNG_ALLOCATED; +extern PNG_EXPORT(png_structp,png_create_write_struct_2) + PNGARG((png_const_charp user_png_ver, png_voidp error_ptr, + png_error_ptr error_fn, png_error_ptr warn_fn, png_voidp mem_ptr, + png_malloc_ptr malloc_fn, png_free_ptr free_fn)) PNG_ALLOCATED; +#endif + +/* Write a PNG chunk - size, type, (optional) data, CRC. */ +extern PNG_EXPORT(void,png_write_chunk) PNGARG((png_structp png_ptr, + png_bytep chunk_name, png_bytep data, png_size_t length)); + +/* Write the start of a PNG chunk - length and chunk name. */ +extern PNG_EXPORT(void,png_write_chunk_start) PNGARG((png_structp png_ptr, + png_bytep chunk_name, png_uint_32 length)); + +/* Write the data of a PNG chunk started with png_write_chunk_start(). */ +extern PNG_EXPORT(void,png_write_chunk_data) PNGARG((png_structp png_ptr, + png_bytep data, png_size_t length)); + +/* Finish a chunk started with png_write_chunk_start() (includes CRC). */ +extern PNG_EXPORT(void,png_write_chunk_end) PNGARG((png_structp png_ptr)); + +/* Allocate and initialize the info structure */ +extern PNG_EXPORT(png_infop,png_create_info_struct) + PNGARG((png_structp png_ptr)) PNG_ALLOCATED; + +#if defined(PNG_1_0_X) || defined (PNG_1_2_X) +/* Initialize the info structure (old interface - DEPRECATED) */ +extern PNG_EXPORT(void,png_info_init) PNGARG((png_infop info_ptr)) + PNG_DEPRECATED; +#undef png_info_init +#define png_info_init(info_ptr) png_info_init_3(&info_ptr,\ + png_sizeof(png_info)); +#endif + +extern PNG_EXPORT(void,png_info_init_3) PNGARG((png_infopp info_ptr, + png_size_t png_info_struct_size)); + +/* Writes all the PNG information before the image. */ +extern PNG_EXPORT(void,png_write_info_before_PLTE) PNGARG((png_structp png_ptr, + png_infop info_ptr)); +extern PNG_EXPORT(void,png_write_info) PNGARG((png_structp png_ptr, + png_infop info_ptr)); + +#ifdef PNG_SEQUENTIAL_READ_SUPPORTED +/* Read the information before the actual image data. */ +extern PNG_EXPORT(void,png_read_info) PNGARG((png_structp png_ptr, + png_infop info_ptr)); +#endif + +#ifdef PNG_TIME_RFC1123_SUPPORTED +extern PNG_EXPORT(png_charp,png_convert_to_rfc1123) + PNGARG((png_structp png_ptr, png_timep ptime)); +#endif + +#ifdef PNG_CONVERT_tIME_SUPPORTED +/* Convert from a struct tm to png_time */ +extern PNG_EXPORT(void,png_convert_from_struct_tm) PNGARG((png_timep ptime, + struct tm FAR * ttime)); + +/* Convert from time_t to png_time. Uses gmtime() */ +extern PNG_EXPORT(void,png_convert_from_time_t) PNGARG((png_timep ptime, + time_t ttime)); +#endif /* PNG_CONVERT_tIME_SUPPORTED */ + +#ifdef PNG_READ_EXPAND_SUPPORTED +/* Expand data to 24-bit RGB, or 8-bit grayscale, with alpha if available. */ +extern PNG_EXPORT(void,png_set_expand) PNGARG((png_structp png_ptr)); +#ifndef PNG_1_0_X +extern PNG_EXPORT(void,png_set_expand_gray_1_2_4_to_8) PNGARG((png_structp + png_ptr)); +#endif +extern PNG_EXPORT(void,png_set_palette_to_rgb) PNGARG((png_structp png_ptr)); +extern PNG_EXPORT(void,png_set_tRNS_to_alpha) PNGARG((png_structp png_ptr)); +#if defined(PNG_1_0_X) || defined (PNG_1_2_X) +/* Deprecated */ +extern PNG_EXPORT(void,png_set_gray_1_2_4_to_8) PNGARG((png_structp + png_ptr)) PNG_DEPRECATED; +#endif +#endif + +#if defined(PNG_READ_BGR_SUPPORTED) || defined(PNG_WRITE_BGR_SUPPORTED) +/* Use blue, green, red order for pixels. */ +extern PNG_EXPORT(void,png_set_bgr) PNGARG((png_structp png_ptr)); +#endif + +#ifdef PNG_READ_GRAY_TO_RGB_SUPPORTED +/* Expand the grayscale to 24-bit RGB if necessary. */ +extern PNG_EXPORT(void,png_set_gray_to_rgb) PNGARG((png_structp png_ptr)); +#endif + +#ifdef PNG_READ_RGB_TO_GRAY_SUPPORTED +/* Reduce RGB to grayscale. */ +#ifdef PNG_FLOATING_POINT_SUPPORTED +extern PNG_EXPORT(void,png_set_rgb_to_gray) PNGARG((png_structp png_ptr, + int error_action, double red, double green )); +#endif +extern PNG_EXPORT(void,png_set_rgb_to_gray_fixed) PNGARG((png_structp png_ptr, + int error_action, png_fixed_point red, png_fixed_point green )); +extern PNG_EXPORT(png_byte,png_get_rgb_to_gray_status) PNGARG((png_structp + png_ptr)); +#endif + +extern PNG_EXPORT(void,png_build_grayscale_palette) PNGARG((int bit_depth, + png_colorp palette)); + +#ifdef PNG_READ_STRIP_ALPHA_SUPPORTED +extern PNG_EXPORT(void,png_set_strip_alpha) PNGARG((png_structp png_ptr)); +#endif + +#if defined(PNG_READ_SWAP_ALPHA_SUPPORTED) || \ + defined(PNG_WRITE_SWAP_ALPHA_SUPPORTED) +extern PNG_EXPORT(void,png_set_swap_alpha) PNGARG((png_structp png_ptr)); +#endif + +#if defined(PNG_READ_INVERT_ALPHA_SUPPORTED) || \ + defined(PNG_WRITE_INVERT_ALPHA_SUPPORTED) +extern PNG_EXPORT(void,png_set_invert_alpha) PNGARG((png_structp png_ptr)); +#endif + +#if defined(PNG_READ_FILLER_SUPPORTED) || defined(PNG_WRITE_FILLER_SUPPORTED) +/* Add a filler byte to 8-bit Gray or 24-bit RGB images. */ +extern PNG_EXPORT(void,png_set_filler) PNGARG((png_structp png_ptr, + png_uint_32 filler, int flags)); +/* The values of the PNG_FILLER_ defines should NOT be changed */ +#define PNG_FILLER_BEFORE 0 +#define PNG_FILLER_AFTER 1 +/* Add an alpha byte to 8-bit Gray or 24-bit RGB images. */ +#ifndef PNG_1_0_X +extern PNG_EXPORT(void,png_set_add_alpha) PNGARG((png_structp png_ptr, + png_uint_32 filler, int flags)); +#endif +#endif /* PNG_READ_FILLER_SUPPORTED || PNG_WRITE_FILLER_SUPPORTED */ + +#if defined(PNG_READ_SWAP_SUPPORTED) || defined(PNG_WRITE_SWAP_SUPPORTED) +/* Swap bytes in 16-bit depth files. */ +extern PNG_EXPORT(void,png_set_swap) PNGARG((png_structp png_ptr)); +#endif + +#if defined(PNG_READ_PACK_SUPPORTED) || defined(PNG_WRITE_PACK_SUPPORTED) +/* Use 1 byte per pixel in 1, 2, or 4-bit depth files. */ +extern PNG_EXPORT(void,png_set_packing) PNGARG((png_structp png_ptr)); +#endif + +#if defined(PNG_READ_PACKSWAP_SUPPORTED) || defined(PNG_WRITE_PACKSWAP_SUPPORTED) +/* Swap packing order of pixels in bytes. */ +extern PNG_EXPORT(void,png_set_packswap) PNGARG((png_structp png_ptr)); +#endif + +#if defined(PNG_READ_SHIFT_SUPPORTED) || defined(PNG_WRITE_SHIFT_SUPPORTED) +/* Converts files to legal bit depths. */ +extern PNG_EXPORT(void,png_set_shift) PNGARG((png_structp png_ptr, + png_color_8p true_bits)); +#endif + +#if defined(PNG_READ_INTERLACING_SUPPORTED) || \ + defined(PNG_WRITE_INTERLACING_SUPPORTED) +/* Have the code handle the interlacing. Returns the number of passes. */ +extern PNG_EXPORT(int,png_set_interlace_handling) PNGARG((png_structp png_ptr)); +#endif + +#if defined(PNG_READ_INVERT_SUPPORTED) || defined(PNG_WRITE_INVERT_SUPPORTED) +/* Invert monochrome files */ +extern PNG_EXPORT(void,png_set_invert_mono) PNGARG((png_structp png_ptr)); +#endif + +#ifdef PNG_READ_BACKGROUND_SUPPORTED +/* Handle alpha and tRNS by replacing with a background color. */ +#ifdef PNG_FLOATING_POINT_SUPPORTED +extern PNG_EXPORT(void,png_set_background) PNGARG((png_structp png_ptr, + png_color_16p background_color, int background_gamma_code, + int need_expand, double background_gamma)); +#endif +#define PNG_BACKGROUND_GAMMA_UNKNOWN 0 +#define PNG_BACKGROUND_GAMMA_SCREEN 1 +#define PNG_BACKGROUND_GAMMA_FILE 2 +#define PNG_BACKGROUND_GAMMA_UNIQUE 3 +#endif + +#ifdef PNG_READ_16_TO_8_SUPPORTED +/* Strip the second byte of information from a 16-bit depth file. */ +extern PNG_EXPORT(void,png_set_strip_16) PNGARG((png_structp png_ptr)); +#endif + +#ifdef PNG_READ_DITHER_SUPPORTED +/* Turn on dithering, and reduce the palette to the number of colors available. */ +extern PNG_EXPORT(void,png_set_dither) PNGARG((png_structp png_ptr, + png_colorp palette, int num_palette, int maximum_colors, + png_uint_16p histogram, int full_dither)); +#endif + +#ifdef PNG_READ_GAMMA_SUPPORTED +/* Handle gamma correction. Screen_gamma=(display_exponent) */ +#ifdef PNG_FLOATING_POINT_SUPPORTED +extern PNG_EXPORT(void,png_set_gamma) PNGARG((png_structp png_ptr, + double screen_gamma, double default_file_gamma)); +#endif +#endif + +#if defined(PNG_1_0_X) || defined (PNG_1_2_X) +#if defined(PNG_READ_EMPTY_PLTE_SUPPORTED) || \ + defined(PNG_WRITE_EMPTY_PLTE_SUPPORTED) +/* Permit or disallow empty PLTE (0: not permitted, 1: permitted) */ +/* Deprecated and will be removed. Use png_permit_mng_features() instead. */ +extern PNG_EXPORT(void,png_permit_empty_plte) PNGARG((png_structp png_ptr, + int empty_plte_permitted)) PNG_DEPRECATED; +#endif +#endif + +#ifdef PNG_WRITE_FLUSH_SUPPORTED +/* Set how many lines between output flushes - 0 for no flushing */ +extern PNG_EXPORT(void,png_set_flush) PNGARG((png_structp png_ptr, int nrows)); +/* Flush the current PNG output buffer */ +extern PNG_EXPORT(void,png_write_flush) PNGARG((png_structp png_ptr)); +#endif + +/* Optional update palette with requested transformations */ +extern PNG_EXPORT(void,png_start_read_image) PNGARG((png_structp png_ptr)); + +/* Optional call to update the users info structure */ +extern PNG_EXPORT(void,png_read_update_info) PNGARG((png_structp png_ptr, + png_infop info_ptr)); + +#ifndef PNG_NO_SEQUENTIAL_READ_SUPPORTED +/* Read one or more rows of image data. */ +extern PNG_EXPORT(void,png_read_rows) PNGARG((png_structp png_ptr, + png_bytepp row, png_bytepp display_row, png_uint_32 num_rows)); +#endif + +#ifndef PNG_NO_SEQUENTIAL_READ_SUPPORTED +/* Read a row of data. */ +extern PNG_EXPORT(void,png_read_row) PNGARG((png_structp png_ptr, + png_bytep row, + png_bytep display_row)); +#endif + +#ifndef PNG_NO_SEQUENTIAL_READ_SUPPORTED +/* Read the whole image into memory at once. */ +extern PNG_EXPORT(void,png_read_image) PNGARG((png_structp png_ptr, + png_bytepp image)); +#endif + +/* Write a row of image data */ +extern PNG_EXPORT(void,png_write_row) PNGARG((png_structp png_ptr, + png_bytep row)); + +/* Write a few rows of image data */ +extern PNG_EXPORT(void,png_write_rows) PNGARG((png_structp png_ptr, + png_bytepp row, png_uint_32 num_rows)); + +/* Write the image data */ +extern PNG_EXPORT(void,png_write_image) PNGARG((png_structp png_ptr, + png_bytepp image)); + +/* Writes the end of the PNG file. */ +extern PNG_EXPORT(void,png_write_end) PNGARG((png_structp png_ptr, + png_infop info_ptr)); + +#ifndef PNG_NO_SEQUENTIAL_READ_SUPPORTED +/* Read the end of the PNG file. */ +extern PNG_EXPORT(void,png_read_end) PNGARG((png_structp png_ptr, + png_infop info_ptr)); +#endif + +/* Free any memory associated with the png_info_struct */ +extern PNG_EXPORT(void,png_destroy_info_struct) PNGARG((png_structp png_ptr, + png_infopp info_ptr_ptr)); + +/* Free any memory associated with the png_struct and the png_info_structs */ +extern PNG_EXPORT(void,png_destroy_read_struct) PNGARG((png_structpp + png_ptr_ptr, png_infopp info_ptr_ptr, png_infopp end_info_ptr_ptr)); + +/* Free all memory used by the read (old method - NOT DLL EXPORTED) */ +extern void png_read_destroy PNGARG((png_structp png_ptr, png_infop info_ptr, + png_infop end_info_ptr)) PNG_DEPRECATED; + +/* Free any memory associated with the png_struct and the png_info_structs */ +extern PNG_EXPORT(void,png_destroy_write_struct) + PNGARG((png_structpp png_ptr_ptr, png_infopp info_ptr_ptr)); + +/* Free any memory used in png_ptr struct (old method - NOT DLL EXPORTED) */ +extern void png_write_destroy PNGARG((png_structp png_ptr)) PNG_DEPRECATED; + +/* Set the libpng method of handling chunk CRC errors */ +extern PNG_EXPORT(void,png_set_crc_action) PNGARG((png_structp png_ptr, + int crit_action, int ancil_action)); + +/* Values for png_set_crc_action() to say how to handle CRC errors in + * ancillary and critical chunks, and whether to use the data contained + * therein. Note that it is impossible to "discard" data in a critical + * chunk. For versions prior to 0.90, the action was always error/quit, + * whereas in version 0.90 and later, the action for CRC errors in ancillary + * chunks is warn/discard. These values should NOT be changed. + * + * value action:critical action:ancillary + */ +#define PNG_CRC_DEFAULT 0 /* error/quit warn/discard data */ +#define PNG_CRC_ERROR_QUIT 1 /* error/quit error/quit */ +#define PNG_CRC_WARN_DISCARD 2 /* (INVALID) warn/discard data */ +#define PNG_CRC_WARN_USE 3 /* warn/use data warn/use data */ +#define PNG_CRC_QUIET_USE 4 /* quiet/use data quiet/use data */ +#define PNG_CRC_NO_CHANGE 5 /* use current value use current value */ + +/* These functions give the user control over the scan-line filtering in + * libpng and the compression methods used by zlib. These functions are + * mainly useful for testing, as the defaults should work with most users. + * Those users who are tight on memory or want faster performance at the + * expense of compression can modify them. See the compression library + * header file (zlib.h) for an explination of the compression functions. + */ + +/* Set the filtering method(s) used by libpng. Currently, the only valid + * value for "method" is 0. + */ +extern PNG_EXPORT(void,png_set_filter) PNGARG((png_structp png_ptr, int method, + int filters)); + +/* Flags for png_set_filter() to say which filters to use. The flags + * are chosen so that they don't conflict with real filter types + * below, in case they are supplied instead of the #defined constants. + * These values should NOT be changed. + */ +#define PNG_NO_FILTERS 0x00 +#define PNG_FILTER_NONE 0x08 +#define PNG_FILTER_SUB 0x10 +#define PNG_FILTER_UP 0x20 +#define PNG_FILTER_AVG 0x40 +#define PNG_FILTER_PAETH 0x80 +#define PNG_ALL_FILTERS (PNG_FILTER_NONE | PNG_FILTER_SUB | PNG_FILTER_UP | \ + PNG_FILTER_AVG | PNG_FILTER_PAETH) + +/* Filter values (not flags) - used in pngwrite.c, pngwutil.c for now. + * These defines should NOT be changed. + */ +#define PNG_FILTER_VALUE_NONE 0 +#define PNG_FILTER_VALUE_SUB 1 +#define PNG_FILTER_VALUE_UP 2 +#define PNG_FILTER_VALUE_AVG 3 +#define PNG_FILTER_VALUE_PAETH 4 +#define PNG_FILTER_VALUE_LAST 5 + +#if defined(PNG_WRITE_WEIGHTED_FILTER_SUPPORTED) /* EXPERIMENTAL */ +/* The "heuristic_method" is given by one of the PNG_FILTER_HEURISTIC_ + * defines, either the default (minimum-sum-of-absolute-differences), or + * the experimental method (weighted-minimum-sum-of-absolute-differences). + * + * Weights are factors >= 1.0, indicating how important it is to keep the + * filter type consistent between rows. Larger numbers mean the current + * filter is that many times as likely to be the same as the "num_weights" + * previous filters. This is cumulative for each previous row with a weight. + * There needs to be "num_weights" values in "filter_weights", or it can be + * NULL if the weights aren't being specified. Weights have no influence on + * the selection of the first row filter. Well chosen weights can (in theory) + * improve the compression for a given image. + * + * Costs are factors >= 1.0 indicating the relative decoding costs of a + * filter type. Higher costs indicate more decoding expense, and are + * therefore less likely to be selected over a filter with lower computational + * costs. There needs to be a value in "filter_costs" for each valid filter + * type (given by PNG_FILTER_VALUE_LAST), or it can be NULL if you aren't + * setting the costs. Costs try to improve the speed of decompression without + * unduly increasing the compressed image size. + * + * A negative weight or cost indicates the default value is to be used, and + * values in the range [0.0, 1.0) indicate the value is to remain unchanged. + * The default values for both weights and costs are currently 1.0, but may + * change if good general weighting/cost heuristics can be found. If both + * the weights and costs are set to 1.0, this degenerates the WEIGHTED method + * to the UNWEIGHTED method, but with added encoding time/computation. + */ +#ifdef PNG_FLOATING_POINT_SUPPORTED +extern PNG_EXPORT(void,png_set_filter_heuristics) PNGARG((png_structp png_ptr, + int heuristic_method, int num_weights, png_doublep filter_weights, + png_doublep filter_costs)); +#endif +#endif /* PNG_WRITE_WEIGHTED_FILTER_SUPPORTED */ + +/* Heuristic used for row filter selection. These defines should NOT be + * changed. + */ +#define PNG_FILTER_HEURISTIC_DEFAULT 0 /* Currently "UNWEIGHTED" */ +#define PNG_FILTER_HEURISTIC_UNWEIGHTED 1 /* Used by libpng < 0.95 */ +#define PNG_FILTER_HEURISTIC_WEIGHTED 2 /* Experimental feature */ +#define PNG_FILTER_HEURISTIC_LAST 3 /* Not a valid value */ + +/* Set the library compression level. Currently, valid values range from + * 0 - 9, corresponding directly to the zlib compression levels 0 - 9 + * (0 - no compression, 9 - "maximal" compression). Note that tests have + * shown that zlib compression levels 3-6 usually perform as well as level 9 + * for PNG images, and do considerably fewer caclulations. In the future, + * these values may not correspond directly to the zlib compression levels. + */ +extern PNG_EXPORT(void,png_set_compression_level) PNGARG((png_structp png_ptr, + int level)); + +extern PNG_EXPORT(void,png_set_compression_mem_level) + PNGARG((png_structp png_ptr, int mem_level)); + +extern PNG_EXPORT(void,png_set_compression_strategy) + PNGARG((png_structp png_ptr, int strategy)); + +extern PNG_EXPORT(void,png_set_compression_window_bits) + PNGARG((png_structp png_ptr, int window_bits)); + +extern PNG_EXPORT(void,png_set_compression_method) PNGARG((png_structp png_ptr, + int method)); + +/* These next functions are called for input/output, memory, and error + * handling. They are in the file pngrio.c, pngwio.c, and pngerror.c, + * and call standard C I/O routines such as fread(), fwrite(), and + * fprintf(). These functions can be made to use other I/O routines + * at run time for those applications that need to handle I/O in a + * different manner by calling png_set_???_fn(). See libpng.txt for + * more information. + */ + +#ifdef PNG_STDIO_SUPPORTED +/* Initialize the input/output for the PNG file to the default functions. */ +extern PNG_EXPORT(void,png_init_io) PNGARG((png_structp png_ptr, png_FILE_p fp)); +#endif + +/* Replace the (error and abort), and warning functions with user + * supplied functions. If no messages are to be printed you must still + * write and use replacement functions. The replacement error_fn should + * still do a longjmp to the last setjmp location if you are using this + * method of error handling. If error_fn or warning_fn is NULL, the + * default function will be used. + */ + +extern PNG_EXPORT(void,png_set_error_fn) PNGARG((png_structp png_ptr, + png_voidp error_ptr, png_error_ptr error_fn, png_error_ptr warning_fn)); + +/* Return the user pointer associated with the error functions */ +extern PNG_EXPORT(png_voidp,png_get_error_ptr) PNGARG((png_structp png_ptr)); + +/* Replace the default data output functions with a user supplied one(s). + * If buffered output is not used, then output_flush_fn can be set to NULL. + * If PNG_WRITE_FLUSH_SUPPORTED is not defined at libpng compile time + * output_flush_fn will be ignored (and thus can be NULL). + * It is probably a mistake to use NULL for output_flush_fn if + * write_data_fn is not also NULL unless you have built libpng with + * PNG_WRITE_FLUSH_SUPPORTED undefined, because in this case libpng's + * default flush function, which uses the standard *FILE structure, will + * be used. + */ +extern PNG_EXPORT(void,png_set_write_fn) PNGARG((png_structp png_ptr, + png_voidp io_ptr, png_rw_ptr write_data_fn, png_flush_ptr output_flush_fn)); + +/* Replace the default data input function with a user supplied one. */ +extern PNG_EXPORT(void,png_set_read_fn) PNGARG((png_structp png_ptr, + png_voidp io_ptr, png_rw_ptr read_data_fn)); + +/* Return the user pointer associated with the I/O functions */ +extern PNG_EXPORT(png_voidp,png_get_io_ptr) PNGARG((png_structp png_ptr)); + +extern PNG_EXPORT(void,png_set_read_status_fn) PNGARG((png_structp png_ptr, + png_read_status_ptr read_row_fn)); + +extern PNG_EXPORT(void,png_set_write_status_fn) PNGARG((png_structp png_ptr, + png_write_status_ptr write_row_fn)); + +#ifdef PNG_USER_MEM_SUPPORTED +/* Replace the default memory allocation functions with user supplied one(s). */ +extern PNG_EXPORT(void,png_set_mem_fn) PNGARG((png_structp png_ptr, + png_voidp mem_ptr, png_malloc_ptr malloc_fn, png_free_ptr free_fn)); +/* Return the user pointer associated with the memory functions */ +extern PNG_EXPORT(png_voidp,png_get_mem_ptr) PNGARG((png_structp png_ptr)); +#endif + +#if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) || \ + defined(PNG_LEGACY_SUPPORTED) +extern PNG_EXPORT(void,png_set_read_user_transform_fn) PNGARG((png_structp + png_ptr, png_user_transform_ptr read_user_transform_fn)); +#endif + +#if defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED) || \ + defined(PNG_LEGACY_SUPPORTED) +extern PNG_EXPORT(void,png_set_write_user_transform_fn) PNGARG((png_structp + png_ptr, png_user_transform_ptr write_user_transform_fn)); +#endif + +#if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) || \ + defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED) || \ + defined(PNG_LEGACY_SUPPORTED) +extern PNG_EXPORT(void,png_set_user_transform_info) PNGARG((png_structp + png_ptr, png_voidp user_transform_ptr, int user_transform_depth, + int user_transform_channels)); +/* Return the user pointer associated with the user transform functions */ +extern PNG_EXPORT(png_voidp,png_get_user_transform_ptr) + PNGARG((png_structp png_ptr)); +#endif + +#ifdef PNG_USER_CHUNKS_SUPPORTED +extern PNG_EXPORT(void,png_set_read_user_chunk_fn) PNGARG((png_structp png_ptr, + png_voidp user_chunk_ptr, png_user_chunk_ptr read_user_chunk_fn)); +extern PNG_EXPORT(png_voidp,png_get_user_chunk_ptr) PNGARG((png_structp + png_ptr)); +#endif + +#ifdef PNG_PROGRESSIVE_READ_SUPPORTED +/* Sets the function callbacks for the push reader, and a pointer to a + * user-defined structure available to the callback functions. + */ +extern PNG_EXPORT(void,png_set_progressive_read_fn) PNGARG((png_structp png_ptr, + png_voidp progressive_ptr, + png_progressive_info_ptr info_fn, png_progressive_row_ptr row_fn, + png_progressive_end_ptr end_fn)); + +/* Returns the user pointer associated with the push read functions */ +extern PNG_EXPORT(png_voidp,png_get_progressive_ptr) + PNGARG((png_structp png_ptr)); + +/* Function to be called when data becomes available */ +extern PNG_EXPORT(void,png_process_data) PNGARG((png_structp png_ptr, + png_infop info_ptr, png_bytep buffer, png_size_t buffer_size)); + +/* Function that combines rows. Not very much different than the + * png_combine_row() call. Is this even used????? + */ +extern PNG_EXPORT(void,png_progressive_combine_row) PNGARG((png_structp png_ptr, + png_bytep old_row, png_bytep new_row)); +#endif /* PNG_PROGRESSIVE_READ_SUPPORTED */ + +extern PNG_EXPORT(png_voidp,png_malloc) PNGARG((png_structp png_ptr, + png_uint_32 size)) PNG_ALLOCATED; + +#ifdef PNG_1_0_X +# define png_malloc_warn png_malloc +#else +/* Added at libpng version 1.2.4 */ +extern PNG_EXPORT(png_voidp,png_malloc_warn) PNGARG((png_structp png_ptr, + png_uint_32 size)) PNG_ALLOCATED; +#endif + +/* Frees a pointer allocated by png_malloc() */ +extern PNG_EXPORT(void,png_free) PNGARG((png_structp png_ptr, png_voidp ptr)); + +#ifdef PNG_1_0_X +/* Function to allocate memory for zlib. */ +extern PNG_EXPORT(voidpf,png_zalloc) PNGARG((voidpf png_ptr, uInt items, + uInt size)); + +/* Function to free memory for zlib */ +extern PNG_EXPORT(void,png_zfree) PNGARG((voidpf png_ptr, voidpf ptr)); +#endif + +/* Free data that was allocated internally */ +extern PNG_EXPORT(void,png_free_data) PNGARG((png_structp png_ptr, + png_infop info_ptr, png_uint_32 free_me, int num)); +#ifdef PNG_FREE_ME_SUPPORTED +/* Reassign responsibility for freeing existing data, whether allocated + * by libpng or by the application + */ +extern PNG_EXPORT(void,png_data_freer) PNGARG((png_structp png_ptr, + png_infop info_ptr, int freer, png_uint_32 mask)); +#endif +/* Assignments for png_data_freer */ +#define PNG_DESTROY_WILL_FREE_DATA 1 +#define PNG_SET_WILL_FREE_DATA 1 +#define PNG_USER_WILL_FREE_DATA 2 +/* Flags for png_ptr->free_me and info_ptr->free_me */ +#define PNG_FREE_HIST 0x0008 +#define PNG_FREE_ICCP 0x0010 +#define PNG_FREE_SPLT 0x0020 +#define PNG_FREE_ROWS 0x0040 +#define PNG_FREE_PCAL 0x0080 +#define PNG_FREE_SCAL 0x0100 +#define PNG_FREE_UNKN 0x0200 +#define PNG_FREE_LIST 0x0400 +#define PNG_FREE_PLTE 0x1000 +#define PNG_FREE_TRNS 0x2000 +#define PNG_FREE_TEXT 0x4000 +#define PNG_FREE_ALL 0x7fff +#define PNG_FREE_MUL 0x4220 /* PNG_FREE_SPLT|PNG_FREE_TEXT|PNG_FREE_UNKN */ + +#ifdef PNG_USER_MEM_SUPPORTED +extern PNG_EXPORT(png_voidp,png_malloc_default) PNGARG((png_structp png_ptr, + png_uint_32 size)) PNG_ALLOCATED; +extern PNG_EXPORT(void,png_free_default) PNGARG((png_structp png_ptr, + png_voidp ptr)); +#endif + +extern PNG_EXPORT(png_voidp,png_memcpy_check) PNGARG((png_structp png_ptr, + png_voidp s1, png_voidp s2, png_uint_32 size)) PNG_DEPRECATED; + +extern PNG_EXPORT(png_voidp,png_memset_check) PNGARG((png_structp png_ptr, + png_voidp s1, int value, png_uint_32 size)) PNG_DEPRECATED; + +#if defined(USE_FAR_KEYWORD) /* memory model conversion function */ +extern void *png_far_to_near PNGARG((png_structp png_ptr,png_voidp ptr, + int check)); +#endif /* USE_FAR_KEYWORD */ + +#ifndef PNG_NO_ERROR_TEXT +/* Fatal error in PNG image of libpng - can't continue */ +extern PNG_EXPORT(void,png_error) PNGARG((png_structp png_ptr, + png_const_charp error_message)) PNG_NORETURN; + +/* The same, but the chunk name is prepended to the error string. */ +extern PNG_EXPORT(void,png_chunk_error) PNGARG((png_structp png_ptr, + png_const_charp error_message)) PNG_NORETURN; +#else +/* Fatal error in PNG image of libpng - can't continue */ +extern PNG_EXPORT(void,png_err) PNGARG((png_structp png_ptr)) PNG_NORETURN; +#endif + +#ifndef PNG_NO_WARNINGS +/* Non-fatal error in libpng. Can continue, but may have a problem. */ +extern PNG_EXPORT(void,png_warning) PNGARG((png_structp png_ptr, + png_const_charp warning_message)); + +#ifdef PNG_READ_SUPPORTED +/* Non-fatal error in libpng, chunk name is prepended to message. */ +extern PNG_EXPORT(void,png_chunk_warning) PNGARG((png_structp png_ptr, + png_const_charp warning_message)); +#endif /* PNG_READ_SUPPORTED */ +#endif /* PNG_NO_WARNINGS */ + +/* The png_set_ functions are for storing values in the png_info_struct. + * Similarly, the png_get_ calls are used to read values from the + * png_info_struct, either storing the parameters in the passed variables, or + * setting pointers into the png_info_struct where the data is stored. The + * png_get_ functions return a non-zero value if the data was available + * in info_ptr, or return zero and do not change any of the parameters if the + * data was not available. + * + * These functions should be used instead of directly accessing png_info + * to avoid problems with future changes in the size and internal layout of + * png_info_struct. + */ +/* Returns "flag" if chunk data is valid in info_ptr. */ +extern PNG_EXPORT(png_uint_32,png_get_valid) PNGARG((png_structp png_ptr, +png_infop info_ptr, png_uint_32 flag)); + +/* Returns number of bytes needed to hold a transformed row. */ +extern PNG_EXPORT(png_uint_32,png_get_rowbytes) PNGARG((png_structp png_ptr, +png_infop info_ptr)); + +#ifdef PNG_INFO_IMAGE_SUPPORTED +/* Returns row_pointers, which is an array of pointers to scanlines that was + * returned from png_read_png(). + */ +extern PNG_EXPORT(png_bytepp,png_get_rows) PNGARG((png_structp png_ptr, +png_infop info_ptr)); +/* Set row_pointers, which is an array of pointers to scanlines for use + * by png_write_png(). + */ +extern PNG_EXPORT(void,png_set_rows) PNGARG((png_structp png_ptr, + png_infop info_ptr, png_bytepp row_pointers)); +#endif + +/* Returns number of color channels in image. */ +extern PNG_EXPORT(png_byte,png_get_channels) PNGARG((png_structp png_ptr, +png_infop info_ptr)); + +#ifdef PNG_EASY_ACCESS_SUPPORTED +/* Returns image width in pixels. */ +extern PNG_EXPORT(png_uint_32, png_get_image_width) PNGARG((png_structp +png_ptr, png_infop info_ptr)); + +/* Returns image height in pixels. */ +extern PNG_EXPORT(png_uint_32, png_get_image_height) PNGARG((png_structp +png_ptr, png_infop info_ptr)); + +/* Returns image bit_depth. */ +extern PNG_EXPORT(png_byte, png_get_bit_depth) PNGARG((png_structp +png_ptr, png_infop info_ptr)); + +/* Returns image color_type. */ +extern PNG_EXPORT(png_byte, png_get_color_type) PNGARG((png_structp +png_ptr, png_infop info_ptr)); + +/* Returns image filter_type. */ +extern PNG_EXPORT(png_byte, png_get_filter_type) PNGARG((png_structp +png_ptr, png_infop info_ptr)); + +/* Returns image interlace_type. */ +extern PNG_EXPORT(png_byte, png_get_interlace_type) PNGARG((png_structp +png_ptr, png_infop info_ptr)); + +/* Returns image compression_type. */ +extern PNG_EXPORT(png_byte, png_get_compression_type) PNGARG((png_structp +png_ptr, png_infop info_ptr)); + +/* Returns image resolution in pixels per meter, from pHYs chunk data. */ +extern PNG_EXPORT(png_uint_32, png_get_pixels_per_meter) PNGARG((png_structp +png_ptr, png_infop info_ptr)); +extern PNG_EXPORT(png_uint_32, png_get_x_pixels_per_meter) PNGARG((png_structp +png_ptr, png_infop info_ptr)); +extern PNG_EXPORT(png_uint_32, png_get_y_pixels_per_meter) PNGARG((png_structp +png_ptr, png_infop info_ptr)); + +/* Returns pixel aspect ratio, computed from pHYs chunk data. */ +#ifdef PNG_FLOATING_POINT_SUPPORTED +extern PNG_EXPORT(float, png_get_pixel_aspect_ratio) PNGARG((png_structp +png_ptr, png_infop info_ptr)); +#endif + +/* Returns image x, y offset in pixels or microns, from oFFs chunk data. */ +extern PNG_EXPORT(png_int_32, png_get_x_offset_pixels) PNGARG((png_structp +png_ptr, png_infop info_ptr)); +extern PNG_EXPORT(png_int_32, png_get_y_offset_pixels) PNGARG((png_structp +png_ptr, png_infop info_ptr)); +extern PNG_EXPORT(png_int_32, png_get_x_offset_microns) PNGARG((png_structp +png_ptr, png_infop info_ptr)); +extern PNG_EXPORT(png_int_32, png_get_y_offset_microns) PNGARG((png_structp +png_ptr, png_infop info_ptr)); + +#endif /* PNG_EASY_ACCESS_SUPPORTED */ + +/* Returns pointer to signature string read from PNG header */ +extern PNG_EXPORT(png_bytep,png_get_signature) PNGARG((png_structp png_ptr, +png_infop info_ptr)); + +#ifdef PNG_bKGD_SUPPORTED +extern PNG_EXPORT(png_uint_32,png_get_bKGD) PNGARG((png_structp png_ptr, + png_infop info_ptr, png_color_16p *background)); +#endif + +#ifdef PNG_bKGD_SUPPORTED +extern PNG_EXPORT(void,png_set_bKGD) PNGARG((png_structp png_ptr, + png_infop info_ptr, png_color_16p background)); +#endif + +#ifdef PNG_cHRM_SUPPORTED +#ifdef PNG_FLOATING_POINT_SUPPORTED +extern PNG_EXPORT(png_uint_32,png_get_cHRM) PNGARG((png_structp png_ptr, + png_infop info_ptr, double *white_x, double *white_y, double *red_x, + double *red_y, double *green_x, double *green_y, double *blue_x, + double *blue_y)); +#endif +#ifdef PNG_FIXED_POINT_SUPPORTED +extern PNG_EXPORT(png_uint_32,png_get_cHRM_fixed) PNGARG((png_structp png_ptr, + png_infop info_ptr, png_fixed_point *int_white_x, png_fixed_point + *int_white_y, png_fixed_point *int_red_x, png_fixed_point *int_red_y, + png_fixed_point *int_green_x, png_fixed_point *int_green_y, png_fixed_point + *int_blue_x, png_fixed_point *int_blue_y)); +#endif +#endif + +#ifdef PNG_cHRM_SUPPORTED +#ifdef PNG_FLOATING_POINT_SUPPORTED +extern PNG_EXPORT(void,png_set_cHRM) PNGARG((png_structp png_ptr, + png_infop info_ptr, double white_x, double white_y, double red_x, + double red_y, double green_x, double green_y, double blue_x, double blue_y)); +#endif +#ifdef PNG_FIXED_POINT_SUPPORTED +extern PNG_EXPORT(void,png_set_cHRM_fixed) PNGARG((png_structp png_ptr, + png_infop info_ptr, png_fixed_point int_white_x, png_fixed_point int_white_y, + png_fixed_point int_red_x, png_fixed_point int_red_y, png_fixed_point + int_green_x, png_fixed_point int_green_y, png_fixed_point int_blue_x, + png_fixed_point int_blue_y)); +#endif +#endif + +#ifdef PNG_gAMA_SUPPORTED +#ifdef PNG_FLOATING_POINT_SUPPORTED +extern PNG_EXPORT(png_uint_32,png_get_gAMA) PNGARG((png_structp png_ptr, + png_infop info_ptr, double *file_gamma)); +#endif +extern PNG_EXPORT(png_uint_32,png_get_gAMA_fixed) PNGARG((png_structp png_ptr, + png_infop info_ptr, png_fixed_point *int_file_gamma)); +#endif + +#ifdef PNG_gAMA_SUPPORTED +#ifdef PNG_FLOATING_POINT_SUPPORTED +extern PNG_EXPORT(void,png_set_gAMA) PNGARG((png_structp png_ptr, + png_infop info_ptr, double file_gamma)); +#endif +extern PNG_EXPORT(void,png_set_gAMA_fixed) PNGARG((png_structp png_ptr, + png_infop info_ptr, png_fixed_point int_file_gamma)); +#endif + +#ifdef PNG_hIST_SUPPORTED +extern PNG_EXPORT(png_uint_32,png_get_hIST) PNGARG((png_structp png_ptr, + png_infop info_ptr, png_uint_16p *hist)); +#endif + +#ifdef PNG_hIST_SUPPORTED +extern PNG_EXPORT(void,png_set_hIST) PNGARG((png_structp png_ptr, + png_infop info_ptr, png_uint_16p hist)); +#endif + +extern PNG_EXPORT(png_uint_32,png_get_IHDR) PNGARG((png_structp png_ptr, + png_infop info_ptr, png_uint_32 *width, png_uint_32 *height, + int *bit_depth, int *color_type, int *interlace_method, + int *compression_method, int *filter_method)); + +extern PNG_EXPORT(void,png_set_IHDR) PNGARG((png_structp png_ptr, + png_infop info_ptr, png_uint_32 width, png_uint_32 height, int bit_depth, + int color_type, int interlace_method, int compression_method, + int filter_method)); + +#ifdef PNG_oFFs_SUPPORTED +extern PNG_EXPORT(png_uint_32,png_get_oFFs) PNGARG((png_structp png_ptr, + png_infop info_ptr, png_int_32 *offset_x, png_int_32 *offset_y, + int *unit_type)); +#endif + +#ifdef PNG_oFFs_SUPPORTED +extern PNG_EXPORT(void,png_set_oFFs) PNGARG((png_structp png_ptr, + png_infop info_ptr, png_int_32 offset_x, png_int_32 offset_y, + int unit_type)); +#endif + +#ifdef PNG_pCAL_SUPPORTED +extern PNG_EXPORT(png_uint_32,png_get_pCAL) PNGARG((png_structp png_ptr, + png_infop info_ptr, png_charp *purpose, png_int_32 *X0, png_int_32 *X1, + int *type, int *nparams, png_charp *units, png_charpp *params)); +#endif + +#ifdef PNG_pCAL_SUPPORTED +extern PNG_EXPORT(void,png_set_pCAL) PNGARG((png_structp png_ptr, + png_infop info_ptr, png_charp purpose, png_int_32 X0, png_int_32 X1, + int type, int nparams, png_charp units, png_charpp params)); +#endif + +#ifdef PNG_pHYs_SUPPORTED +extern PNG_EXPORT(png_uint_32,png_get_pHYs) PNGARG((png_structp png_ptr, + png_infop info_ptr, png_uint_32 *res_x, png_uint_32 *res_y, int *unit_type)); +#endif + +#ifdef PNG_pHYs_SUPPORTED +extern PNG_EXPORT(void,png_set_pHYs) PNGARG((png_structp png_ptr, + png_infop info_ptr, png_uint_32 res_x, png_uint_32 res_y, int unit_type)); +#endif + +extern PNG_EXPORT(png_uint_32,png_get_PLTE) PNGARG((png_structp png_ptr, + png_infop info_ptr, png_colorp *palette, int *num_palette)); + +extern PNG_EXPORT(void,png_set_PLTE) PNGARG((png_structp png_ptr, + png_infop info_ptr, png_colorp palette, int num_palette)); + +#ifdef PNG_sBIT_SUPPORTED +extern PNG_EXPORT(png_uint_32,png_get_sBIT) PNGARG((png_structp png_ptr, + png_infop info_ptr, png_color_8p *sig_bit)); +#endif + +#ifdef PNG_sBIT_SUPPORTED +extern PNG_EXPORT(void,png_set_sBIT) PNGARG((png_structp png_ptr, + png_infop info_ptr, png_color_8p sig_bit)); +#endif + +#ifdef PNG_sRGB_SUPPORTED +extern PNG_EXPORT(png_uint_32,png_get_sRGB) PNGARG((png_structp png_ptr, + png_infop info_ptr, int *intent)); +#endif + +#ifdef PNG_sRGB_SUPPORTED +extern PNG_EXPORT(void,png_set_sRGB) PNGARG((png_structp png_ptr, + png_infop info_ptr, int intent)); +extern PNG_EXPORT(void,png_set_sRGB_gAMA_and_cHRM) PNGARG((png_structp png_ptr, + png_infop info_ptr, int intent)); +#endif + +#ifdef PNG_iCCP_SUPPORTED +extern PNG_EXPORT(png_uint_32,png_get_iCCP) PNGARG((png_structp png_ptr, + png_infop info_ptr, png_charpp name, int *compression_type, + png_charpp profile, png_uint_32 *proflen)); + /* Note to maintainer: profile should be png_bytepp */ +#endif + +#ifdef PNG_iCCP_SUPPORTED +extern PNG_EXPORT(void,png_set_iCCP) PNGARG((png_structp png_ptr, + png_infop info_ptr, png_charp name, int compression_type, + png_charp profile, png_uint_32 proflen)); + /* Note to maintainer: profile should be png_bytep */ +#endif + +#ifdef PNG_sPLT_SUPPORTED +extern PNG_EXPORT(png_uint_32,png_get_sPLT) PNGARG((png_structp png_ptr, + png_infop info_ptr, png_sPLT_tpp entries)); +#endif + +#ifdef PNG_sPLT_SUPPORTED +extern PNG_EXPORT(void,png_set_sPLT) PNGARG((png_structp png_ptr, + png_infop info_ptr, png_sPLT_tp entries, int nentries)); +#endif + +#ifdef PNG_TEXT_SUPPORTED +/* png_get_text also returns the number of text chunks in *num_text */ +extern PNG_EXPORT(png_uint_32,png_get_text) PNGARG((png_structp png_ptr, + png_infop info_ptr, png_textp *text_ptr, int *num_text)); +#endif + +/* + * Note while png_set_text() will accept a structure whose text, + * language, and translated keywords are NULL pointers, the structure + * returned by png_get_text will always contain regular + * zero-terminated C strings. They might be empty strings but + * they will never be NULL pointers. + */ + +#ifdef PNG_TEXT_SUPPORTED +extern PNG_EXPORT(void,png_set_text) PNGARG((png_structp png_ptr, + png_infop info_ptr, png_textp text_ptr, int num_text)); +#endif + +#ifdef PNG_tIME_SUPPORTED +extern PNG_EXPORT(png_uint_32,png_get_tIME) PNGARG((png_structp png_ptr, + png_infop info_ptr, png_timep *mod_time)); +#endif + +#ifdef PNG_tIME_SUPPORTED +extern PNG_EXPORT(void,png_set_tIME) PNGARG((png_structp png_ptr, + png_infop info_ptr, png_timep mod_time)); +#endif + +#ifdef PNG_tRNS_SUPPORTED +extern PNG_EXPORT(png_uint_32,png_get_tRNS) PNGARG((png_structp png_ptr, + png_infop info_ptr, png_bytep *trans, int *num_trans, + png_color_16p *trans_values)); +#endif + +#ifdef PNG_tRNS_SUPPORTED +extern PNG_EXPORT(void,png_set_tRNS) PNGARG((png_structp png_ptr, + png_infop info_ptr, png_bytep trans, int num_trans, + png_color_16p trans_values)); +#endif + +#ifdef PNG_tRNS_SUPPORTED +#endif + +#ifdef PNG_sCAL_SUPPORTED +#ifdef PNG_FLOATING_POINT_SUPPORTED +extern PNG_EXPORT(png_uint_32,png_get_sCAL) PNGARG((png_structp png_ptr, + png_infop info_ptr, int *unit, double *width, double *height)); +#else +#ifdef PNG_FIXED_POINT_SUPPORTED +extern PNG_EXPORT(png_uint_32,png_get_sCAL_s) PNGARG((png_structp png_ptr, + png_infop info_ptr, int *unit, png_charpp swidth, png_charpp sheight)); +#endif +#endif +#endif /* PNG_sCAL_SUPPORTED */ + +#ifdef PNG_sCAL_SUPPORTED +#ifdef PNG_FLOATING_POINT_SUPPORTED +extern PNG_EXPORT(void,png_set_sCAL) PNGARG((png_structp png_ptr, + png_infop info_ptr, int unit, double width, double height)); +#else +#ifdef PNG_FIXED_POINT_SUPPORTED +extern PNG_EXPORT(void,png_set_sCAL_s) PNGARG((png_structp png_ptr, + png_infop info_ptr, int unit, png_charp swidth, png_charp sheight)); +#endif +#endif +#endif /* PNG_sCAL_SUPPORTED || PNG_WRITE_sCAL_SUPPORTED */ + +#ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED +/* Provide a list of chunks and how they are to be handled, if the built-in + handling or default unknown chunk handling is not desired. Any chunks not + listed will be handled in the default manner. The IHDR and IEND chunks + must not be listed. + keep = 0: follow default behaviour + = 1: do not keep + = 2: keep only if safe-to-copy + = 3: keep even if unsafe-to-copy +*/ +extern PNG_EXPORT(void, png_set_keep_unknown_chunks) PNGARG((png_structp + png_ptr, int keep, png_bytep chunk_list, int num_chunks)); +PNG_EXPORT(int,png_handle_as_unknown) PNGARG((png_structp png_ptr, png_bytep + chunk_name)); +#endif +#ifdef PNG_UNKNOWN_CHUNKS_SUPPORTED +extern PNG_EXPORT(void, png_set_unknown_chunks) PNGARG((png_structp png_ptr, + png_infop info_ptr, png_unknown_chunkp unknowns, int num_unknowns)); +extern PNG_EXPORT(void, png_set_unknown_chunk_location) + PNGARG((png_structp png_ptr, png_infop info_ptr, int chunk, int location)); +extern PNG_EXPORT(png_uint_32,png_get_unknown_chunks) PNGARG((png_structp + png_ptr, png_infop info_ptr, png_unknown_chunkpp entries)); +#endif + +/* Png_free_data() will turn off the "valid" flag for anything it frees. + * If you need to turn it off for a chunk that your application has freed, + * you can use png_set_invalid(png_ptr, info_ptr, PNG_INFO_CHNK); + */ +extern PNG_EXPORT(void, png_set_invalid) PNGARG((png_structp png_ptr, + png_infop info_ptr, int mask)); + +#ifdef PNG_INFO_IMAGE_SUPPORTED +/* The "params" pointer is currently not used and is for future expansion. */ +extern PNG_EXPORT(void, png_read_png) PNGARG((png_structp png_ptr, + png_infop info_ptr, + int transforms, + png_voidp params)); +extern PNG_EXPORT(void, png_write_png) PNGARG((png_structp png_ptr, + png_infop info_ptr, + int transforms, + png_voidp params)); +#endif + +/* Define PNG_DEBUG at compile time for debugging information. Higher + * numbers for PNG_DEBUG mean more debugging information. This has + * only been added since version 0.95 so it is not implemented throughout + * libpng yet, but more support will be added as needed. + */ +#ifdef PNG_DEBUG +#if (PNG_DEBUG > 0) +#if !defined(PNG_DEBUG_FILE) && defined(_MSC_VER) +#include +#if (PNG_DEBUG > 1) +#ifndef _DEBUG +# define _DEBUG +#endif +#ifndef png_debug +#define png_debug(l,m) _RPT0(_CRT_WARN,m PNG_STRING_NEWLINE) +#endif +#ifndef png_debug1 +#define png_debug1(l,m,p1) _RPT1(_CRT_WARN,m PNG_STRING_NEWLINE,p1) +#endif +#ifndef png_debug2 +#define png_debug2(l,m,p1,p2) _RPT2(_CRT_WARN,m PNG_STRING_NEWLINE,p1,p2) +#endif +#endif +#else /* PNG_DEBUG_FILE || !_MSC_VER */ +#ifndef PNG_DEBUG_FILE +#define PNG_DEBUG_FILE stderr +#endif /* PNG_DEBUG_FILE */ + +#if (PNG_DEBUG > 1) +/* Note: ["%s"m PNG_STRING_NEWLINE] probably does not work on non-ISO + * compilers. + */ +# ifdef __STDC__ +# ifndef png_debug +# define png_debug(l,m) \ + { \ + int num_tabs=l; \ + fprintf(PNG_DEBUG_FILE,"%s"m PNG_STRING_NEWLINE,(num_tabs==1 ? "\t" : \ + (num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":"")))); \ + } +# endif +# ifndef png_debug1 +# define png_debug1(l,m,p1) \ + { \ + int num_tabs=l; \ + fprintf(PNG_DEBUG_FILE,"%s"m PNG_STRING_NEWLINE,(num_tabs==1 ? "\t" : \ + (num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":""))),p1); \ + } +# endif +# ifndef png_debug2 +# define png_debug2(l,m,p1,p2) \ + { \ + int num_tabs=l; \ + fprintf(PNG_DEBUG_FILE,"%s"m PNG_STRING_NEWLINE,(num_tabs==1 ? "\t" : \ + (num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":""))),p1,p2); \ + } +# endif +# else /* __STDC __ */ +# ifndef png_debug +# define png_debug(l,m) \ + { \ + int num_tabs=l; \ + char format[256]; \ + snprintf(format,256,"%s%s%s",(num_tabs==1 ? "\t" : \ + (num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":""))), \ + m,PNG_STRING_NEWLINE); \ + fprintf(PNG_DEBUG_FILE,format); \ + } +# endif +# ifndef png_debug1 +# define png_debug1(l,m,p1) \ + { \ + int num_tabs=l; \ + char format[256]; \ + snprintf(format,256,"%s%s%s",(num_tabs==1 ? "\t" : \ + (num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":""))), \ + m,PNG_STRING_NEWLINE); \ + fprintf(PNG_DEBUG_FILE,format,p1); \ + } +# endif +# ifndef png_debug2 +# define png_debug2(l,m,p1,p2) \ + { \ + int num_tabs=l; \ + char format[256]; \ + snprintf(format,256,"%s%s%s",(num_tabs==1 ? "\t" : \ + (num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":""))), \ + m,PNG_STRING_NEWLINE); \ + fprintf(PNG_DEBUG_FILE,format,p1,p2); \ + } +# endif +# endif /* __STDC __ */ +#endif /* (PNG_DEBUG > 1) */ + +#endif /* _MSC_VER */ +#endif /* (PNG_DEBUG > 0) */ +#endif /* PNG_DEBUG */ +#ifndef png_debug +#define png_debug(l, m) +#endif +#ifndef png_debug1 +#define png_debug1(l, m, p1) +#endif +#ifndef png_debug2 +#define png_debug2(l, m, p1, p2) +#endif + +extern PNG_EXPORT(png_charp,png_get_copyright) PNGARG((png_structp png_ptr)); +extern PNG_EXPORT(png_charp,png_get_header_ver) PNGARG((png_structp png_ptr)); +extern PNG_EXPORT(png_charp,png_get_header_version) PNGARG((png_structp png_ptr)); +extern PNG_EXPORT(png_charp,png_get_libpng_ver) PNGARG((png_structp png_ptr)); + +#ifdef PNG_MNG_FEATURES_SUPPORTED +extern PNG_EXPORT(png_uint_32,png_permit_mng_features) PNGARG((png_structp + png_ptr, png_uint_32 mng_features_permitted)); +#endif + +/* For use in png_set_keep_unknown, added to version 1.2.6 */ +#define PNG_HANDLE_CHUNK_AS_DEFAULT 0 +#define PNG_HANDLE_CHUNK_NEVER 1 +#define PNG_HANDLE_CHUNK_IF_SAFE 2 +#define PNG_HANDLE_CHUNK_ALWAYS 3 + +/* Added to version 1.2.0 */ +#ifdef PNG_ASSEMBLER_CODE_SUPPORTED +#ifdef PNG_MMX_CODE_SUPPORTED +#define PNG_ASM_FLAG_MMX_SUPPORT_COMPILED 0x01 /* not user-settable */ +#define PNG_ASM_FLAG_MMX_SUPPORT_IN_CPU 0x02 /* not user-settable */ +#define PNG_ASM_FLAG_MMX_READ_COMBINE_ROW 0x04 +#define PNG_ASM_FLAG_MMX_READ_INTERLACE 0x08 +#define PNG_ASM_FLAG_MMX_READ_FILTER_SUB 0x10 +#define PNG_ASM_FLAG_MMX_READ_FILTER_UP 0x20 +#define PNG_ASM_FLAG_MMX_READ_FILTER_AVG 0x40 +#define PNG_ASM_FLAG_MMX_READ_FILTER_PAETH 0x80 +#define PNG_ASM_FLAGS_INITIALIZED 0x80000000 /* not user-settable */ + +#define PNG_MMX_READ_FLAGS ( PNG_ASM_FLAG_MMX_READ_COMBINE_ROW \ + | PNG_ASM_FLAG_MMX_READ_INTERLACE \ + | PNG_ASM_FLAG_MMX_READ_FILTER_SUB \ + | PNG_ASM_FLAG_MMX_READ_FILTER_UP \ + | PNG_ASM_FLAG_MMX_READ_FILTER_AVG \ + | PNG_ASM_FLAG_MMX_READ_FILTER_PAETH ) +#define PNG_MMX_WRITE_FLAGS ( 0 ) + +#define PNG_MMX_FLAGS ( PNG_ASM_FLAG_MMX_SUPPORT_COMPILED \ + | PNG_ASM_FLAG_MMX_SUPPORT_IN_CPU \ + | PNG_MMX_READ_FLAGS \ + | PNG_MMX_WRITE_FLAGS ) + +#define PNG_SELECT_READ 1 +#define PNG_SELECT_WRITE 2 +#endif /* PNG_MMX_CODE_SUPPORTED */ + +#ifndef PNG_1_0_X +/* pngget.c */ +extern PNG_EXPORT(png_uint_32,png_get_mmx_flagmask) + PNGARG((int flag_select, int *compilerID)); + +/* pngget.c */ +extern PNG_EXPORT(png_uint_32,png_get_asm_flagmask) + PNGARG((int flag_select)); + +/* pngget.c */ +extern PNG_EXPORT(png_uint_32,png_get_asm_flags) + PNGARG((png_structp png_ptr)); + +/* pngget.c */ +extern PNG_EXPORT(png_byte,png_get_mmx_bitdepth_threshold) + PNGARG((png_structp png_ptr)); + +/* pngget.c */ +extern PNG_EXPORT(png_uint_32,png_get_mmx_rowbytes_threshold) + PNGARG((png_structp png_ptr)); + +/* pngset.c */ +extern PNG_EXPORT(void,png_set_asm_flags) + PNGARG((png_structp png_ptr, png_uint_32 asm_flags)); + +/* pngset.c */ +extern PNG_EXPORT(void,png_set_mmx_thresholds) + PNGARG((png_structp png_ptr, png_byte mmx_bitdepth_threshold, + png_uint_32 mmx_rowbytes_threshold)); + +#endif /* PNG_1_0_X */ + +#ifndef PNG_1_0_X +/* png.c, pnggccrd.c, or pngvcrd.c */ +extern PNG_EXPORT(int,png_mmx_support) PNGARG((void)); +#endif /* PNG_1_0_X */ +#endif /* PNG_ASSEMBLER_CODE_SUPPORTED */ + +/* Strip the prepended error numbers ("#nnn ") from error and warning + * messages before passing them to the error or warning handler. + */ +#ifdef PNG_ERROR_NUMBERS_SUPPORTED +extern PNG_EXPORT(void,png_set_strip_error_numbers) PNGARG((png_structp + png_ptr, png_uint_32 strip_mode)); +#endif + +/* Added at libpng-1.2.6 */ +#ifdef PNG_SET_USER_LIMITS_SUPPORTED +extern PNG_EXPORT(void,png_set_user_limits) PNGARG((png_structp + png_ptr, png_uint_32 user_width_max, png_uint_32 user_height_max)); +extern PNG_EXPORT(png_uint_32,png_get_user_width_max) PNGARG((png_structp + png_ptr)); +extern PNG_EXPORT(png_uint_32,png_get_user_height_max) PNGARG((png_structp + png_ptr)); +#endif +/* Maintainer: Put new public prototypes here ^, in libpng.3, and in + * project defs + */ + +#ifdef PNG_READ_COMPOSITE_NODIV_SUPPORTED +/* With these routines we avoid an integer divide, which will be slower on + * most machines. However, it does take more operations than the corresponding + * divide method, so it may be slower on a few RISC systems. There are two + * shifts (by 8 or 16 bits) and an addition, versus a single integer divide. + * + * Note that the rounding factors are NOT supposed to be the same! 128 and + * 32768 are correct for the NODIV code; 127 and 32767 are correct for the + * standard method. + * + * [Optimized code by Greg Roelofs and Mark Adler...blame us for bugs. :-) ] + */ + + /* fg and bg should be in `gamma 1.0' space; alpha is the opacity */ + +# define png_composite(composite, fg, alpha, bg) \ + { png_uint_16 temp = (png_uint_16)((png_uint_16)(fg) * (png_uint_16)(alpha) \ + + (png_uint_16)(bg)*(png_uint_16)(255 - \ + (png_uint_16)(alpha)) + (png_uint_16)128); \ + (composite) = (png_byte)((temp + (temp >> 8)) >> 8); } + +# define png_composite_16(composite, fg, alpha, bg) \ + { png_uint_32 temp = (png_uint_32)((png_uint_32)(fg) * (png_uint_32)(alpha) \ + + (png_uint_32)(bg)*(png_uint_32)(65535L - \ + (png_uint_32)(alpha)) + (png_uint_32)32768L); \ + (composite) = (png_uint_16)((temp + (temp >> 16)) >> 16); } + +#else /* Standard method using integer division */ + +# define png_composite(composite, fg, alpha, bg) \ + (composite) = (png_byte)(((png_uint_16)(fg) * (png_uint_16)(alpha) + \ + (png_uint_16)(bg) * (png_uint_16)(255 - (png_uint_16)(alpha)) + \ + (png_uint_16)127) / 255) + +# define png_composite_16(composite, fg, alpha, bg) \ + (composite) = (png_uint_16)(((png_uint_32)(fg) * (png_uint_32)(alpha) + \ + (png_uint_32)(bg)*(png_uint_32)(65535L - (png_uint_32)(alpha)) + \ + (png_uint_32)32767) / (png_uint_32)65535L) + +#endif /* PNG_READ_COMPOSITE_NODIV_SUPPORTED */ + +/* Inline macros to do direct reads of bytes from the input buffer. These + * require that you are using an architecture that uses PNG byte ordering + * (MSB first) and supports unaligned data storage. I think that PowerPC + * in big-endian mode and 680x0 are the only ones that will support this. + * The x86 line of processors definitely do not. The png_get_int_32() + * routine also assumes we are using two's complement format for negative + * values, which is almost certainly true. + */ +#ifdef PNG_READ_BIG_ENDIAN_SUPPORTED +# define png_get_uint_32(buf) ( *((png_uint_32p) (buf))) +# define png_get_uint_16(buf) ( *((png_uint_16p) (buf))) +# define png_get_int_32(buf) ( *((png_int_32p) (buf))) +#else +extern PNG_EXPORT(png_uint_32,png_get_uint_32) PNGARG((png_bytep buf)); +extern PNG_EXPORT(png_uint_16,png_get_uint_16) PNGARG((png_bytep buf)); +extern PNG_EXPORT(png_int_32,png_get_int_32) PNGARG((png_bytep buf)); +#endif /* !PNG_READ_BIG_ENDIAN_SUPPORTED */ +extern PNG_EXPORT(png_uint_32,png_get_uint_31) + PNGARG((png_structp png_ptr, png_bytep buf)); +/* No png_get_int_16 -- may be added if there's a real need for it. */ + +/* Place a 32-bit number into a buffer in PNG byte order (big-endian). + */ +extern PNG_EXPORT(void,png_save_uint_32) + PNGARG((png_bytep buf, png_uint_32 i)); +extern PNG_EXPORT(void,png_save_int_32) + PNGARG((png_bytep buf, png_int_32 i)); + +/* Place a 16-bit number into a buffer in PNG byte order. + * The parameter is declared unsigned int, not png_uint_16, + * just to avoid potential problems on pre-ANSI C compilers. + */ +extern PNG_EXPORT(void,png_save_uint_16) + PNGARG((png_bytep buf, unsigned int i)); +/* No png_save_int_16 -- may be added if there's a real need for it. */ + +/* ************************************************************************* */ + +/* These next functions are used internally in the code. They generally + * shouldn't be used unless you are writing code to add or replace some + * functionality in libpng. More information about most functions can + * be found in the files where the functions are located. + */ + + +/* Various modes of operation, that are visible to applications because + * they are used for unknown chunk location. + */ +#define PNG_HAVE_IHDR 0x01 +#define PNG_HAVE_PLTE 0x02 +#define PNG_HAVE_IDAT 0x04 +#define PNG_AFTER_IDAT 0x08 /* Have complete zlib datastream */ +#define PNG_HAVE_IEND 0x10 + +#ifdef PNG_INTERNAL + +/* More modes of operation. Note that after an init, mode is set to + * zero automatically when the structure is created. + */ +#define PNG_HAVE_gAMA 0x20 +#define PNG_HAVE_cHRM 0x40 +#define PNG_HAVE_sRGB 0x80 +#define PNG_HAVE_CHUNK_HEADER 0x100 +#define PNG_WROTE_tIME 0x200 +#define PNG_WROTE_INFO_BEFORE_PLTE 0x400 +#define PNG_BACKGROUND_IS_GRAY 0x800 +#define PNG_HAVE_PNG_SIGNATURE 0x1000 +#define PNG_HAVE_CHUNK_AFTER_IDAT 0x2000 /* Have another chunk after IDAT */ + +/* Flags for the transformations the PNG library does on the image data */ +#define PNG_BGR 0x0001 +#define PNG_INTERLACE 0x0002 +#define PNG_PACK 0x0004 +#define PNG_SHIFT 0x0008 +#define PNG_SWAP_BYTES 0x0010 +#define PNG_INVERT_MONO 0x0020 +#define PNG_DITHER 0x0040 +#define PNG_BACKGROUND 0x0080 +#define PNG_BACKGROUND_EXPAND 0x0100 + /* 0x0200 unused */ +#define PNG_16_TO_8 0x0400 +#define PNG_RGBA 0x0800 +#define PNG_EXPAND 0x1000 +#define PNG_GAMMA 0x2000 +#define PNG_GRAY_TO_RGB 0x4000 +#define PNG_FILLER 0x8000L +#define PNG_PACKSWAP 0x10000L +#define PNG_SWAP_ALPHA 0x20000L +#define PNG_STRIP_ALPHA 0x40000L +#define PNG_INVERT_ALPHA 0x80000L +#define PNG_USER_TRANSFORM 0x100000L +#define PNG_RGB_TO_GRAY_ERR 0x200000L +#define PNG_RGB_TO_GRAY_WARN 0x400000L +#define PNG_RGB_TO_GRAY 0x600000L /* two bits, RGB_TO_GRAY_ERR|WARN */ + /* 0x800000L Unused */ +#define PNG_ADD_ALPHA 0x1000000L /* Added to libpng-1.2.7 */ +#define PNG_EXPAND_tRNS 0x2000000L /* Added to libpng-1.2.9 */ +#define PNG_PREMULTIPLY_ALPHA 0x4000000L /* Added to libpng-1.2.41 */ + /* by volker */ + /* 0x8000000L unused */ + /* 0x10000000L unused */ + /* 0x20000000L unused */ + /* 0x40000000L unused */ + +/* Flags for png_create_struct */ +#define PNG_STRUCT_PNG 0x0001 +#define PNG_STRUCT_INFO 0x0002 + +/* Scaling factor for filter heuristic weighting calculations */ +#define PNG_WEIGHT_SHIFT 8 +#define PNG_WEIGHT_FACTOR (1<<(PNG_WEIGHT_SHIFT)) +#define PNG_COST_SHIFT 3 +#define PNG_COST_FACTOR (1<<(PNG_COST_SHIFT)) + +/* Flags for the png_ptr->flags rather than declaring a byte for each one */ +#define PNG_FLAG_ZLIB_CUSTOM_STRATEGY 0x0001 +#define PNG_FLAG_ZLIB_CUSTOM_LEVEL 0x0002 +#define PNG_FLAG_ZLIB_CUSTOM_MEM_LEVEL 0x0004 +#define PNG_FLAG_ZLIB_CUSTOM_WINDOW_BITS 0x0008 +#define PNG_FLAG_ZLIB_CUSTOM_METHOD 0x0010 +#define PNG_FLAG_ZLIB_FINISHED 0x0020 +#define PNG_FLAG_ROW_INIT 0x0040 +#define PNG_FLAG_FILLER_AFTER 0x0080 +#define PNG_FLAG_CRC_ANCILLARY_USE 0x0100 +#define PNG_FLAG_CRC_ANCILLARY_NOWARN 0x0200 +#define PNG_FLAG_CRC_CRITICAL_USE 0x0400 +#define PNG_FLAG_CRC_CRITICAL_IGNORE 0x0800 +#define PNG_FLAG_FREE_PLTE 0x1000 +#define PNG_FLAG_FREE_TRNS 0x2000 +#define PNG_FLAG_FREE_HIST 0x4000 +#define PNG_FLAG_KEEP_UNKNOWN_CHUNKS 0x8000L +#define PNG_FLAG_KEEP_UNSAFE_CHUNKS 0x10000L +#define PNG_FLAG_LIBRARY_MISMATCH 0x20000L +#define PNG_FLAG_STRIP_ERROR_NUMBERS 0x40000L +#define PNG_FLAG_STRIP_ERROR_TEXT 0x80000L +#define PNG_FLAG_MALLOC_NULL_MEM_OK 0x100000L +#define PNG_FLAG_ADD_ALPHA 0x200000L /* Added to libpng-1.2.8 */ +#define PNG_FLAG_STRIP_ALPHA 0x400000L /* Added to libpng-1.2.8 */ + /* 0x800000L unused */ + /* 0x1000000L unused */ + /* 0x2000000L unused */ + /* 0x4000000L unused */ + /* 0x8000000L unused */ + /* 0x10000000L unused */ + /* 0x20000000L unused */ + /* 0x40000000L unused */ + +#define PNG_FLAG_CRC_ANCILLARY_MASK (PNG_FLAG_CRC_ANCILLARY_USE | \ + PNG_FLAG_CRC_ANCILLARY_NOWARN) + +#define PNG_FLAG_CRC_CRITICAL_MASK (PNG_FLAG_CRC_CRITICAL_USE | \ + PNG_FLAG_CRC_CRITICAL_IGNORE) + +#define PNG_FLAG_CRC_MASK (PNG_FLAG_CRC_ANCILLARY_MASK | \ + PNG_FLAG_CRC_CRITICAL_MASK) + +/* Save typing and make code easier to understand */ + +#define PNG_COLOR_DIST(c1, c2) (abs((int)((c1).red) - (int)((c2).red)) + \ + abs((int)((c1).green) - (int)((c2).green)) + \ + abs((int)((c1).blue) - (int)((c2).blue))) + +/* Added to libpng-1.2.6 JB */ +#define PNG_ROWBYTES(pixel_bits, width) \ + ((pixel_bits) >= 8 ? \ + ((width) * (((png_uint_32)(pixel_bits)) >> 3)) : \ + (( ((width) * ((png_uint_32)(pixel_bits))) + 7) >> 3) ) + +/* PNG_OUT_OF_RANGE returns true if value is outside the range + * ideal-delta..ideal+delta. Each argument is evaluated twice. + * "ideal" and "delta" should be constants, normally simple + * integers, "value" a variable. Added to libpng-1.2.6 JB + */ +#define PNG_OUT_OF_RANGE(value, ideal, delta) \ + ( (value) < (ideal)-(delta) || (value) > (ideal)+(delta) ) + +/* Variables declared in png.c - only it needs to define PNG_NO_EXTERN */ +#if !defined(PNG_NO_EXTERN) || defined(PNG_ALWAYS_EXTERN) +/* Place to hold the signature string for a PNG file. */ +#ifdef PNG_USE_GLOBAL_ARRAYS + PNG_EXPORT_VAR (PNG_CONST png_byte FARDATA) png_sig[8]; +#else +#endif +#endif /* PNG_NO_EXTERN */ + +/* Constant strings for known chunk types. If you need to add a chunk, + * define the name here, and add an invocation of the macro in png.c and + * wherever it's needed. + */ +#define PNG_IHDR png_byte png_IHDR[5] = { 73, 72, 68, 82, '\0'} +#define PNG_IDAT png_byte png_IDAT[5] = { 73, 68, 65, 84, '\0'} +#define PNG_IEND png_byte png_IEND[5] = { 73, 69, 78, 68, '\0'} +#define PNG_PLTE png_byte png_PLTE[5] = { 80, 76, 84, 69, '\0'} +#define PNG_bKGD png_byte png_bKGD[5] = { 98, 75, 71, 68, '\0'} +#define PNG_cHRM png_byte png_cHRM[5] = { 99, 72, 82, 77, '\0'} +#define PNG_gAMA png_byte png_gAMA[5] = {103, 65, 77, 65, '\0'} +#define PNG_hIST png_byte png_hIST[5] = {104, 73, 83, 84, '\0'} +#define PNG_iCCP png_byte png_iCCP[5] = {105, 67, 67, 80, '\0'} +#define PNG_iTXt png_byte png_iTXt[5] = {105, 84, 88, 116, '\0'} +#define PNG_oFFs png_byte png_oFFs[5] = {111, 70, 70, 115, '\0'} +#define PNG_pCAL png_byte png_pCAL[5] = {112, 67, 65, 76, '\0'} +#define PNG_sCAL png_byte png_sCAL[5] = {115, 67, 65, 76, '\0'} +#define PNG_pHYs png_byte png_pHYs[5] = {112, 72, 89, 115, '\0'} +#define PNG_sBIT png_byte png_sBIT[5] = {115, 66, 73, 84, '\0'} +#define PNG_sPLT png_byte png_sPLT[5] = {115, 80, 76, 84, '\0'} +#define PNG_sRGB png_byte png_sRGB[5] = {115, 82, 71, 66, '\0'} +#define PNG_tEXt png_byte png_tEXt[5] = {116, 69, 88, 116, '\0'} +#define PNG_tIME png_byte png_tIME[5] = {116, 73, 77, 69, '\0'} +#define PNG_tRNS png_byte png_tRNS[5] = {116, 82, 78, 83, '\0'} +#define PNG_zTXt png_byte png_zTXt[5] = {122, 84, 88, 116, '\0'} + +#ifdef PNG_USE_GLOBAL_ARRAYS +PNG_EXPORT_VAR (png_byte FARDATA) png_IHDR[5]; +PNG_EXPORT_VAR (png_byte FARDATA) png_IDAT[5]; +PNG_EXPORT_VAR (png_byte FARDATA) png_IEND[5]; +PNG_EXPORT_VAR (png_byte FARDATA) png_PLTE[5]; +PNG_EXPORT_VAR (png_byte FARDATA) png_bKGD[5]; +PNG_EXPORT_VAR (png_byte FARDATA) png_cHRM[5]; +PNG_EXPORT_VAR (png_byte FARDATA) png_gAMA[5]; +PNG_EXPORT_VAR (png_byte FARDATA) png_hIST[5]; +PNG_EXPORT_VAR (png_byte FARDATA) png_iCCP[5]; +PNG_EXPORT_VAR (png_byte FARDATA) png_iTXt[5]; +PNG_EXPORT_VAR (png_byte FARDATA) png_oFFs[5]; +PNG_EXPORT_VAR (png_byte FARDATA) png_pCAL[5]; +PNG_EXPORT_VAR (png_byte FARDATA) png_sCAL[5]; +PNG_EXPORT_VAR (png_byte FARDATA) png_pHYs[5]; +PNG_EXPORT_VAR (png_byte FARDATA) png_sBIT[5]; +PNG_EXPORT_VAR (png_byte FARDATA) png_sPLT[5]; +PNG_EXPORT_VAR (png_byte FARDATA) png_sRGB[5]; +PNG_EXPORT_VAR (png_byte FARDATA) png_tEXt[5]; +PNG_EXPORT_VAR (png_byte FARDATA) png_tIME[5]; +PNG_EXPORT_VAR (png_byte FARDATA) png_tRNS[5]; +PNG_EXPORT_VAR (png_byte FARDATA) png_zTXt[5]; +#endif /* PNG_USE_GLOBAL_ARRAYS */ + +#if defined(PNG_1_0_X) || defined (PNG_1_2_X) +/* Initialize png_ptr struct for reading, and allocate any other memory. + * (old interface - DEPRECATED - use png_create_read_struct instead). + */ +extern PNG_EXPORT(void,png_read_init) PNGARG((png_structp png_ptr)) + PNG_DEPRECATED; +#undef png_read_init +#define png_read_init(png_ptr) png_read_init_3(&png_ptr, \ + PNG_LIBPNG_VER_STRING, png_sizeof(png_struct)); +#endif + +extern PNG_EXPORT(void,png_read_init_3) PNGARG((png_structpp ptr_ptr, + png_const_charp user_png_ver, png_size_t png_struct_size)); +#if defined(PNG_1_0_X) || defined (PNG_1_2_X) +extern PNG_EXPORT(void,png_read_init_2) PNGARG((png_structp png_ptr, + png_const_charp user_png_ver, png_size_t png_struct_size, png_size_t + png_info_size)); +#endif + +#if defined(PNG_1_0_X) || defined (PNG_1_2_X) +/* Initialize png_ptr struct for writing, and allocate any other memory. + * (old interface - DEPRECATED - use png_create_write_struct instead). + */ +extern PNG_EXPORT(void,png_write_init) PNGARG((png_structp png_ptr)) + PNG_DEPRECATED; +#undef png_write_init +#define png_write_init(png_ptr) png_write_init_3(&png_ptr, \ + PNG_LIBPNG_VER_STRING, png_sizeof(png_struct)); +#endif + +extern PNG_EXPORT(void,png_write_init_3) PNGARG((png_structpp ptr_ptr, + png_const_charp user_png_ver, png_size_t png_struct_size)); +extern PNG_EXPORT(void,png_write_init_2) PNGARG((png_structp png_ptr, + png_const_charp user_png_ver, png_size_t png_struct_size, png_size_t + png_info_size)); + +/* Allocate memory for an internal libpng struct */ +PNG_EXTERN png_voidp png_create_struct PNGARG((int type)) PNG_PRIVATE; + +/* Free memory from internal libpng struct */ +PNG_EXTERN void png_destroy_struct PNGARG((png_voidp struct_ptr)) PNG_PRIVATE; + +PNG_EXTERN png_voidp png_create_struct_2 PNGARG((int type, png_malloc_ptr + malloc_fn, png_voidp mem_ptr)) PNG_PRIVATE; +PNG_EXTERN void png_destroy_struct_2 PNGARG((png_voidp struct_ptr, + png_free_ptr free_fn, png_voidp mem_ptr)) PNG_PRIVATE; + +/* Free any memory that info_ptr points to and reset struct. */ +PNG_EXTERN void png_info_destroy PNGARG((png_structp png_ptr, + png_infop info_ptr)) PNG_PRIVATE; + +#ifndef PNG_1_0_X +/* Function to allocate memory for zlib. */ +PNG_EXTERN voidpf png_zalloc PNGARG((voidpf png_ptr, uInt items, + uInt size)) PNG_PRIVATE; + +/* Function to free memory for zlib */ +PNG_EXTERN void png_zfree PNGARG((voidpf png_ptr, voidpf ptr)) PNG_PRIVATE; + +#ifdef PNG_SIZE_T +/* Function to convert a sizeof an item to png_sizeof item */ + PNG_EXTERN png_size_t PNGAPI png_convert_size PNGARG((size_t size)) + PNG_PRIVATE; +#endif + +/* Next four functions are used internally as callbacks. PNGAPI is required + * but not PNG_EXPORT. PNGAPI added at libpng version 1.2.3. + */ + +PNG_EXTERN void PNGAPI png_default_read_data PNGARG((png_structp png_ptr, + png_bytep data, png_size_t length)) PNG_PRIVATE; + +#ifdef PNG_PROGRESSIVE_READ_SUPPORTED +PNG_EXTERN void PNGAPI png_push_fill_buffer PNGARG((png_structp png_ptr, + png_bytep buffer, png_size_t length)) PNG_PRIVATE; +#endif + +PNG_EXTERN void PNGAPI png_default_write_data PNGARG((png_structp png_ptr, + png_bytep data, png_size_t length)) PNG_PRIVATE; + +#ifdef PNG_WRITE_FLUSH_SUPPORTED +#ifdef PNG_STDIO_SUPPORTED +PNG_EXTERN void PNGAPI png_default_flush PNGARG((png_structp png_ptr)) + PNG_PRIVATE; +#endif +#endif +#else /* PNG_1_0_X */ +#ifdef PNG_PROGRESSIVE_READ_SUPPORTED +PNG_EXTERN void png_push_fill_buffer PNGARG((png_structp png_ptr, + png_bytep buffer, png_size_t length)) PNG_PRIVATE; +#endif +#endif /* PNG_1_0_X */ + +/* Reset the CRC variable */ +PNG_EXTERN void png_reset_crc PNGARG((png_structp png_ptr)) PNG_PRIVATE; + +/* Write the "data" buffer to whatever output you are using. */ +PNG_EXTERN void png_write_data PNGARG((png_structp png_ptr, png_bytep data, + png_size_t length)) PNG_PRIVATE; + +/* Read data from whatever input you are using into the "data" buffer */ +PNG_EXTERN void png_read_data PNGARG((png_structp png_ptr, png_bytep data, + png_size_t length)) PNG_PRIVATE; + +/* Read bytes into buf, and update png_ptr->crc */ +PNG_EXTERN void png_crc_read PNGARG((png_structp png_ptr, png_bytep buf, + png_size_t length)) PNG_PRIVATE; + +/* Decompress data in a chunk that uses compression */ +#if defined(PNG_zTXt_SUPPORTED) || defined(PNG_iTXt_SUPPORTED) || \ + defined(PNG_iCCP_SUPPORTED) || defined(PNG_sPLT_SUPPORTED) +PNG_EXTERN void png_decompress_chunk PNGARG((png_structp png_ptr, + int comp_type, png_size_t chunklength, + png_size_t prefix_length, png_size_t *data_length)) PNG_PRIVATE; +#endif + +/* Read "skip" bytes, read the file crc, and (optionally) verify png_ptr->crc */ +PNG_EXTERN int png_crc_finish PNGARG((png_structp png_ptr, png_uint_32 skip) + PNG_PRIVATE); + +/* Read the CRC from the file and compare it to the libpng calculated CRC */ +PNG_EXTERN int png_crc_error PNGARG((png_structp png_ptr)) PNG_PRIVATE; + +/* Calculate the CRC over a section of data. Note that we are only + * passing a maximum of 64K on systems that have this as a memory limit, + * since this is the maximum buffer size we can specify. + */ +PNG_EXTERN void png_calculate_crc PNGARG((png_structp png_ptr, png_bytep ptr, + png_size_t length)) PNG_PRIVATE; + +#ifdef PNG_WRITE_FLUSH_SUPPORTED +PNG_EXTERN void png_flush PNGARG((png_structp png_ptr)) PNG_PRIVATE; +#endif + +/* Simple function to write the signature */ +PNG_EXTERN void png_write_sig PNGARG((png_structp png_ptr)) PNG_PRIVATE; + +/* Write various chunks */ + +/* Write the IHDR chunk, and update the png_struct with the necessary + * information. + */ +PNG_EXTERN void png_write_IHDR PNGARG((png_structp png_ptr, png_uint_32 width, + png_uint_32 height, + int bit_depth, int color_type, int compression_method, int filter_method, + int interlace_method)) PNG_PRIVATE; + +PNG_EXTERN void png_write_PLTE PNGARG((png_structp png_ptr, png_colorp palette, + png_uint_32 num_pal)) PNG_PRIVATE; + +PNG_EXTERN void png_write_IDAT PNGARG((png_structp png_ptr, png_bytep data, + png_size_t length)) PNG_PRIVATE; + +PNG_EXTERN void png_write_IEND PNGARG((png_structp png_ptr)) PNG_PRIVATE; + +#ifdef PNG_WRITE_gAMA_SUPPORTED +#ifdef PNG_FLOATING_POINT_SUPPORTED +PNG_EXTERN void png_write_gAMA PNGARG((png_structp png_ptr, double file_gamma)) + PNG_PRIVATE; +#endif +#ifdef PNG_FIXED_POINT_SUPPORTED +PNG_EXTERN void png_write_gAMA_fixed PNGARG((png_structp png_ptr, + png_fixed_point file_gamma)) PNG_PRIVATE; +#endif +#endif + +#ifdef PNG_WRITE_sBIT_SUPPORTED +PNG_EXTERN void png_write_sBIT PNGARG((png_structp png_ptr, png_color_8p sbit, + int color_type)) PNG_PRIVATE; +#endif + +#ifdef PNG_WRITE_cHRM_SUPPORTED +#ifdef PNG_FLOATING_POINT_SUPPORTED +PNG_EXTERN void png_write_cHRM PNGARG((png_structp png_ptr, + double white_x, double white_y, + double red_x, double red_y, double green_x, double green_y, + double blue_x, double blue_y)) PNG_PRIVATE; +#endif +#ifdef PNG_FIXED_POINT_SUPPORTED +PNG_EXTERN void png_write_cHRM_fixed PNGARG((png_structp png_ptr, + png_fixed_point int_white_x, png_fixed_point int_white_y, + png_fixed_point int_red_x, png_fixed_point int_red_y, png_fixed_point + int_green_x, png_fixed_point int_green_y, png_fixed_point int_blue_x, + png_fixed_point int_blue_y)) PNG_PRIVATE; +#endif +#endif + +#ifdef PNG_WRITE_sRGB_SUPPORTED +PNG_EXTERN void png_write_sRGB PNGARG((png_structp png_ptr, + int intent)) PNG_PRIVATE; +#endif + +#ifdef PNG_WRITE_iCCP_SUPPORTED +PNG_EXTERN void png_write_iCCP PNGARG((png_structp png_ptr, + png_charp name, int compression_type, + png_charp profile, int proflen)) PNG_PRIVATE; + /* Note to maintainer: profile should be png_bytep */ +#endif + +#ifdef PNG_WRITE_sPLT_SUPPORTED +PNG_EXTERN void png_write_sPLT PNGARG((png_structp png_ptr, + png_sPLT_tp palette)) PNG_PRIVATE; +#endif + +#ifdef PNG_WRITE_tRNS_SUPPORTED +PNG_EXTERN void png_write_tRNS PNGARG((png_structp png_ptr, png_bytep trans, + png_color_16p values, int number, int color_type)) PNG_PRIVATE; +#endif + +#ifdef PNG_WRITE_bKGD_SUPPORTED +PNG_EXTERN void png_write_bKGD PNGARG((png_structp png_ptr, + png_color_16p values, int color_type)) PNG_PRIVATE; +#endif + +#ifdef PNG_WRITE_hIST_SUPPORTED +PNG_EXTERN void png_write_hIST PNGARG((png_structp png_ptr, png_uint_16p hist, + int num_hist)) PNG_PRIVATE; +#endif + +#if defined(PNG_WRITE_TEXT_SUPPORTED) || defined(PNG_WRITE_pCAL_SUPPORTED) || \ + defined(PNG_WRITE_iCCP_SUPPORTED) || defined(PNG_WRITE_sPLT_SUPPORTED) +PNG_EXTERN png_size_t png_check_keyword PNGARG((png_structp png_ptr, + png_charp key, png_charpp new_key)) PNG_PRIVATE; +#endif + +#ifdef PNG_WRITE_tEXt_SUPPORTED +PNG_EXTERN void png_write_tEXt PNGARG((png_structp png_ptr, png_charp key, + png_charp text, png_size_t text_len)) PNG_PRIVATE; +#endif + +#ifdef PNG_WRITE_zTXt_SUPPORTED +PNG_EXTERN void png_write_zTXt PNGARG((png_structp png_ptr, png_charp key, + png_charp text, png_size_t text_len, int compression)) PNG_PRIVATE; +#endif + +#ifdef PNG_WRITE_iTXt_SUPPORTED +PNG_EXTERN void png_write_iTXt PNGARG((png_structp png_ptr, + int compression, png_charp key, png_charp lang, png_charp lang_key, + png_charp text)) PNG_PRIVATE; +#endif + +#ifdef PNG_TEXT_SUPPORTED /* Added at version 1.0.14 and 1.2.4 */ +PNG_EXTERN int png_set_text_2 PNGARG((png_structp png_ptr, + png_infop info_ptr, png_textp text_ptr, int num_text)) PNG_PRIVATE; +#endif + +#ifdef PNG_WRITE_oFFs_SUPPORTED +PNG_EXTERN void png_write_oFFs PNGARG((png_structp png_ptr, + png_int_32 x_offset, png_int_32 y_offset, int unit_type)) PNG_PRIVATE; +#endif + +#ifdef PNG_WRITE_pCAL_SUPPORTED +PNG_EXTERN void png_write_pCAL PNGARG((png_structp png_ptr, png_charp purpose, + png_int_32 X0, png_int_32 X1, int type, int nparams, + png_charp units, png_charpp params)) PNG_PRIVATE; +#endif + +#ifdef PNG_WRITE_pHYs_SUPPORTED +PNG_EXTERN void png_write_pHYs PNGARG((png_structp png_ptr, + png_uint_32 x_pixels_per_unit, png_uint_32 y_pixels_per_unit, + int unit_type)) PNG_PRIVATE; +#endif + +#ifdef PNG_WRITE_tIME_SUPPORTED +PNG_EXTERN void png_write_tIME PNGARG((png_structp png_ptr, + png_timep mod_time)) PNG_PRIVATE; +#endif + +#ifdef PNG_WRITE_sCAL_SUPPORTED +#if defined(PNG_FLOATING_POINT_SUPPORTED) && !defined(PNG_NO_STDIO) +PNG_EXTERN void png_write_sCAL PNGARG((png_structp png_ptr, + int unit, double width, double height)) PNG_PRIVATE; +#else +#ifdef PNG_FIXED_POINT_SUPPORTED +PNG_EXTERN void png_write_sCAL_s PNGARG((png_structp png_ptr, + int unit, png_charp width, png_charp height)) PNG_PRIVATE; +#endif +#endif +#endif + +/* Called when finished processing a row of data */ +PNG_EXTERN void png_write_finish_row PNGARG((png_structp png_ptr)) PNG_PRIVATE; + +/* Internal use only. Called before first row of data */ +PNG_EXTERN void png_write_start_row PNGARG((png_structp png_ptr)) PNG_PRIVATE; + +#ifdef PNG_READ_GAMMA_SUPPORTED +PNG_EXTERN void png_build_gamma_table PNGARG((png_structp png_ptr)) PNG_PRIVATE; +#endif + +/* Combine a row of data, dealing with alpha, etc. if requested */ +PNG_EXTERN void png_combine_row PNGARG((png_structp png_ptr, png_bytep row, + int mask)) PNG_PRIVATE; + +#ifdef PNG_READ_INTERLACING_SUPPORTED +/* Expand an interlaced row */ +/* OLD pre-1.0.9 interface: +PNG_EXTERN void png_do_read_interlace PNGARG((png_row_infop row_info, + png_bytep row, int pass, png_uint_32 transformations)) PNG_PRIVATE; + */ +PNG_EXTERN void png_do_read_interlace PNGARG((png_structp png_ptr)) PNG_PRIVATE; +#endif + +/* GRR TO DO (2.0 or whenever): simplify other internal calling interfaces */ + +#ifdef PNG_WRITE_INTERLACING_SUPPORTED +/* Grab pixels out of a row for an interlaced pass */ +PNG_EXTERN void png_do_write_interlace PNGARG((png_row_infop row_info, + png_bytep row, int pass)) PNG_PRIVATE; +#endif + +/* Unfilter a row */ +PNG_EXTERN void png_read_filter_row PNGARG((png_structp png_ptr, + png_row_infop row_info, png_bytep row, png_bytep prev_row, + int filter)) PNG_PRIVATE; + +/* Choose the best filter to use and filter the row data */ +PNG_EXTERN void png_write_find_filter PNGARG((png_structp png_ptr, + png_row_infop row_info)) PNG_PRIVATE; + +/* Write out the filtered row. */ +PNG_EXTERN void png_write_filtered_row PNGARG((png_structp png_ptr, + png_bytep filtered_row)) PNG_PRIVATE; +/* Finish a row while reading, dealing with interlacing passes, etc. */ +PNG_EXTERN void png_read_finish_row PNGARG((png_structp png_ptr)); + +/* Initialize the row buffers, etc. */ +PNG_EXTERN void png_read_start_row PNGARG((png_structp png_ptr)) PNG_PRIVATE; +/* Optional call to update the users info structure */ +PNG_EXTERN void png_read_transform_info PNGARG((png_structp png_ptr, + png_infop info_ptr)) PNG_PRIVATE; + +/* These are the functions that do the transformations */ +#ifdef PNG_READ_FILLER_SUPPORTED +PNG_EXTERN void png_do_read_filler PNGARG((png_row_infop row_info, + png_bytep row, png_uint_32 filler, png_uint_32 flags)) PNG_PRIVATE; +#endif + +#ifdef PNG_READ_SWAP_ALPHA_SUPPORTED +PNG_EXTERN void png_do_read_swap_alpha PNGARG((png_row_infop row_info, + png_bytep row)) PNG_PRIVATE; +#endif + +#ifdef PNG_WRITE_SWAP_ALPHA_SUPPORTED +PNG_EXTERN void png_do_write_swap_alpha PNGARG((png_row_infop row_info, + png_bytep row)) PNG_PRIVATE; +#endif + +#ifdef PNG_READ_INVERT_ALPHA_SUPPORTED +PNG_EXTERN void png_do_read_invert_alpha PNGARG((png_row_infop row_info, + png_bytep row)) PNG_PRIVATE; +#endif + +#ifdef PNG_WRITE_INVERT_ALPHA_SUPPORTED +PNG_EXTERN void png_do_write_invert_alpha PNGARG((png_row_infop row_info, + png_bytep row)) PNG_PRIVATE; +#endif + +#if defined(PNG_WRITE_FILLER_SUPPORTED) || \ + defined(PNG_READ_STRIP_ALPHA_SUPPORTED) +PNG_EXTERN void png_do_strip_filler PNGARG((png_row_infop row_info, + png_bytep row, png_uint_32 flags)) PNG_PRIVATE; +#endif + +#if defined(PNG_READ_SWAP_SUPPORTED) || defined(PNG_WRITE_SWAP_SUPPORTED) +PNG_EXTERN void png_do_swap PNGARG((png_row_infop row_info, + png_bytep row)) PNG_PRIVATE; +#endif + +#if defined(PNG_READ_PACKSWAP_SUPPORTED) || defined(PNG_WRITE_PACKSWAP_SUPPORTED) +PNG_EXTERN void png_do_packswap PNGARG((png_row_infop row_info, + png_bytep row)) PNG_PRIVATE; +#endif + +#ifdef PNG_READ_RGB_TO_GRAY_SUPPORTED +PNG_EXTERN int png_do_rgb_to_gray PNGARG((png_structp png_ptr, png_row_infop + row_info, png_bytep row)) PNG_PRIVATE; +#endif + +#ifdef PNG_READ_GRAY_TO_RGB_SUPPORTED +PNG_EXTERN void png_do_gray_to_rgb PNGARG((png_row_infop row_info, + png_bytep row)) PNG_PRIVATE; +#endif + +#ifdef PNG_READ_PACK_SUPPORTED +PNG_EXTERN void png_do_unpack PNGARG((png_row_infop row_info, + png_bytep row)) PNG_PRIVATE; +#endif + +#ifdef PNG_READ_SHIFT_SUPPORTED +PNG_EXTERN void png_do_unshift PNGARG((png_row_infop row_info, png_bytep row, + png_color_8p sig_bits)) PNG_PRIVATE; +#endif + +#if defined(PNG_READ_INVERT_SUPPORTED) || defined(PNG_WRITE_INVERT_SUPPORTED) +PNG_EXTERN void png_do_invert PNGARG((png_row_infop row_info, + png_bytep row)) PNG_PRIVATE; +#endif + +#ifdef PNG_READ_16_TO_8_SUPPORTED +PNG_EXTERN void png_do_chop PNGARG((png_row_infop row_info, + png_bytep row)) PNG_PRIVATE; +#endif + +#ifdef PNG_READ_DITHER_SUPPORTED +PNG_EXTERN void png_do_dither PNGARG((png_row_infop row_info, + png_bytep row, png_bytep palette_lookup, + png_bytep dither_lookup)) PNG_PRIVATE; + +# ifdef PNG_CORRECT_PALETTE_SUPPORTED +PNG_EXTERN void png_correct_palette PNGARG((png_structp png_ptr, + png_colorp palette, int num_palette)) PNG_PRIVATE; +# endif +#endif + +#if defined(PNG_READ_BGR_SUPPORTED) || defined(PNG_WRITE_BGR_SUPPORTED) +PNG_EXTERN void png_do_bgr PNGARG((png_row_infop row_info, + png_bytep row)) PNG_PRIVATE; +#endif + +#ifdef PNG_WRITE_PACK_SUPPORTED +PNG_EXTERN void png_do_pack PNGARG((png_row_infop row_info, + png_bytep row, png_uint_32 bit_depth)) PNG_PRIVATE; +#endif + +#ifdef PNG_WRITE_SHIFT_SUPPORTED +PNG_EXTERN void png_do_shift PNGARG((png_row_infop row_info, png_bytep row, + png_color_8p bit_depth)) PNG_PRIVATE; +#endif + +#ifdef PNG_READ_BACKGROUND_SUPPORTED +#ifdef PNG_READ_GAMMA_SUPPORTED +PNG_EXTERN void png_do_background PNGARG((png_row_infop row_info, png_bytep row, + png_color_16p trans_values, png_color_16p background, + png_color_16p background_1, + png_bytep gamma_table, png_bytep gamma_from_1, png_bytep gamma_to_1, + png_uint_16pp gamma_16, png_uint_16pp gamma_16_from_1, + png_uint_16pp gamma_16_to_1, int gamma_shift)) PNG_PRIVATE; +#else +PNG_EXTERN void png_do_background PNGARG((png_row_infop row_info, png_bytep row, + png_color_16p trans_values, png_color_16p background)) PNG_PRIVATE; +#endif +#endif + +#ifdef PNG_READ_GAMMA_SUPPORTED +PNG_EXTERN void png_do_gamma PNGARG((png_row_infop row_info, png_bytep row, + png_bytep gamma_table, png_uint_16pp gamma_16_table, + int gamma_shift)) PNG_PRIVATE; +#endif + +#ifdef PNG_READ_EXPAND_SUPPORTED +PNG_EXTERN void png_do_expand_palette PNGARG((png_row_infop row_info, + png_bytep row, png_colorp palette, png_bytep trans, + int num_trans)) PNG_PRIVATE; +PNG_EXTERN void png_do_expand PNGARG((png_row_infop row_info, + png_bytep row, png_color_16p trans_value)) PNG_PRIVATE; +#endif + +/* The following decodes the appropriate chunks, and does error correction, + * then calls the appropriate callback for the chunk if it is valid. + */ + +/* Decode the IHDR chunk */ +PNG_EXTERN void png_handle_IHDR PNGARG((png_structp png_ptr, png_infop info_ptr, + png_uint_32 length)) PNG_PRIVATE; +PNG_EXTERN void png_handle_PLTE PNGARG((png_structp png_ptr, png_infop info_ptr, + png_uint_32 length)); +PNG_EXTERN void png_handle_IEND PNGARG((png_structp png_ptr, png_infop info_ptr, + png_uint_32 length)); + +#ifdef PNG_READ_bKGD_SUPPORTED +PNG_EXTERN void png_handle_bKGD PNGARG((png_structp png_ptr, png_infop info_ptr, + png_uint_32 length)) PNG_PRIVATE; +#endif + +#ifdef PNG_READ_cHRM_SUPPORTED +PNG_EXTERN void png_handle_cHRM PNGARG((png_structp png_ptr, png_infop info_ptr, + png_uint_32 length)) PNG_PRIVATE; +#endif + +#ifdef PNG_READ_gAMA_SUPPORTED +PNG_EXTERN void png_handle_gAMA PNGARG((png_structp png_ptr, png_infop info_ptr, + png_uint_32 length)) PNG_PRIVATE; +#endif + +#ifdef PNG_READ_hIST_SUPPORTED +PNG_EXTERN void png_handle_hIST PNGARG((png_structp png_ptr, png_infop info_ptr, + png_uint_32 length)) PNG_PRIVATE; +#endif + +#ifdef PNG_READ_iCCP_SUPPORTED +extern void png_handle_iCCP PNGARG((png_structp png_ptr, png_infop info_ptr, + png_uint_32 length)); +#endif /* PNG_READ_iCCP_SUPPORTED */ + +#ifdef PNG_READ_iTXt_SUPPORTED +PNG_EXTERN void png_handle_iTXt PNGARG((png_structp png_ptr, png_infop info_ptr, + png_uint_32 length)) PNG_PRIVATE; +#endif + +#ifdef PNG_READ_oFFs_SUPPORTED +PNG_EXTERN void png_handle_oFFs PNGARG((png_structp png_ptr, png_infop info_ptr, + png_uint_32 length)) PNG_PRIVATE; +#endif + +#ifdef PNG_READ_pCAL_SUPPORTED +PNG_EXTERN void png_handle_pCAL PNGARG((png_structp png_ptr, png_infop info_ptr, + png_uint_32 length)) PNG_PRIVATE; +#endif + +#ifdef PNG_READ_pHYs_SUPPORTED +PNG_EXTERN void png_handle_pHYs PNGARG((png_structp png_ptr, png_infop info_ptr, + png_uint_32 length)) PNG_PRIVATE; +#endif + +#ifdef PNG_READ_sBIT_SUPPORTED +PNG_EXTERN void png_handle_sBIT PNGARG((png_structp png_ptr, png_infop info_ptr, + png_uint_32 length)) PNG_PRIVATE; +#endif + +#ifdef PNG_READ_sCAL_SUPPORTED +PNG_EXTERN void png_handle_sCAL PNGARG((png_structp png_ptr, png_infop info_ptr, + png_uint_32 length)) PNG_PRIVATE; +#endif + +#ifdef PNG_READ_sPLT_SUPPORTED +extern void png_handle_sPLT PNGARG((png_structp png_ptr, png_infop info_ptr, + png_uint_32 length)) PNG_PRIVATE; +#endif /* PNG_READ_sPLT_SUPPORTED */ + +#ifdef PNG_READ_sRGB_SUPPORTED +PNG_EXTERN void png_handle_sRGB PNGARG((png_structp png_ptr, png_infop info_ptr, + png_uint_32 length)) PNG_PRIVATE; +#endif + +#ifdef PNG_READ_tEXt_SUPPORTED +PNG_EXTERN void png_handle_tEXt PNGARG((png_structp png_ptr, png_infop info_ptr, + png_uint_32 length)) PNG_PRIVATE; +#endif + +#ifdef PNG_READ_tIME_SUPPORTED +PNG_EXTERN void png_handle_tIME PNGARG((png_structp png_ptr, png_infop info_ptr, + png_uint_32 length)) PNG_PRIVATE; +#endif + +#ifdef PNG_READ_tRNS_SUPPORTED +PNG_EXTERN void png_handle_tRNS PNGARG((png_structp png_ptr, png_infop info_ptr, + png_uint_32 length)) PNG_PRIVATE; +#endif + +#ifdef PNG_READ_zTXt_SUPPORTED +PNG_EXTERN void png_handle_zTXt PNGARG((png_structp png_ptr, png_infop info_ptr, + png_uint_32 length)) PNG_PRIVATE; +#endif + +PNG_EXTERN void png_handle_unknown PNGARG((png_structp png_ptr, + png_infop info_ptr, png_uint_32 length)) PNG_PRIVATE; + +PNG_EXTERN void png_check_chunk_name PNGARG((png_structp png_ptr, + png_bytep chunk_name)) PNG_PRIVATE; + +/* Handle the transformations for reading and writing */ +PNG_EXTERN void png_do_read_transformations + PNGARG((png_structp png_ptr)) PNG_PRIVATE; +PNG_EXTERN void png_do_write_transformations + PNGARG((png_structp png_ptr)) PNG_PRIVATE; + +PNG_EXTERN void png_init_read_transformations + PNGARG((png_structp png_ptr)) PNG_PRIVATE; + +#ifdef PNG_PROGRESSIVE_READ_SUPPORTED +PNG_EXTERN void png_push_read_chunk PNGARG((png_structp png_ptr, + png_infop info_ptr)) PNG_PRIVATE; +PNG_EXTERN void png_push_read_sig PNGARG((png_structp png_ptr, + png_infop info_ptr)) PNG_PRIVATE; +PNG_EXTERN void png_push_check_crc PNGARG((png_structp png_ptr)) PNG_PRIVATE; +PNG_EXTERN void png_push_crc_skip PNGARG((png_structp png_ptr, + png_uint_32 length)) PNG_PRIVATE; +PNG_EXTERN void png_push_crc_finish PNGARG((png_structp png_ptr)) PNG_PRIVATE; +PNG_EXTERN void png_push_save_buffer PNGARG((png_structp png_ptr)) PNG_PRIVATE; +PNG_EXTERN void png_push_restore_buffer PNGARG((png_structp png_ptr, + png_bytep buffer, png_size_t buffer_length)) PNG_PRIVATE; +PNG_EXTERN void png_push_read_IDAT PNGARG((png_structp png_ptr)) PNG_PRIVATE; +PNG_EXTERN void png_process_IDAT_data PNGARG((png_structp png_ptr, + png_bytep buffer, png_size_t buffer_length)) PNG_PRIVATE; +PNG_EXTERN void png_push_process_row PNGARG((png_structp png_ptr)) PNG_PRIVATE; +PNG_EXTERN void png_push_handle_unknown PNGARG((png_structp png_ptr, + png_infop info_ptr, png_uint_32 length)) PNG_PRIVATE; +PNG_EXTERN void png_push_have_info PNGARG((png_structp png_ptr, + png_infop info_ptr)) PNG_PRIVATE; +PNG_EXTERN void png_push_have_end PNGARG((png_structp png_ptr, + png_infop info_ptr)) PNG_PRIVATE; +PNG_EXTERN void png_push_have_row PNGARG((png_structp png_ptr, + png_bytep row)) PNG_PRIVATE; +PNG_EXTERN void png_push_read_end PNGARG((png_structp png_ptr, + png_infop info_ptr)) PNG_PRIVATE; +PNG_EXTERN void png_process_some_data PNGARG((png_structp png_ptr, + png_infop info_ptr)) PNG_PRIVATE; +PNG_EXTERN void png_read_push_finish_row + PNGARG((png_structp png_ptr)) PNG_PRIVATE; +#ifdef PNG_READ_tEXt_SUPPORTED +PNG_EXTERN void png_push_handle_tEXt PNGARG((png_structp png_ptr, + png_infop info_ptr, png_uint_32 length)) PNG_PRIVATE; +PNG_EXTERN void png_push_read_tEXt PNGARG((png_structp png_ptr, + png_infop info_ptr)) PNG_PRIVATE; +#endif +#ifdef PNG_READ_zTXt_SUPPORTED +PNG_EXTERN void png_push_handle_zTXt PNGARG((png_structp png_ptr, + png_infop info_ptr, png_uint_32 length)) PNG_PRIVATE; +PNG_EXTERN void png_push_read_zTXt PNGARG((png_structp png_ptr, + png_infop info_ptr)) PNG_PRIVATE; +#endif +#ifdef PNG_READ_iTXt_SUPPORTED +PNG_EXTERN void png_push_handle_iTXt PNGARG((png_structp png_ptr, + png_infop info_ptr, png_uint_32 length)) PNG_PRIVATE; +PNG_EXTERN void png_push_read_iTXt PNGARG((png_structp png_ptr, + png_infop info_ptr)) PNG_PRIVATE; +#endif + +#endif /* PNG_PROGRESSIVE_READ_SUPPORTED */ + +#ifdef PNG_MNG_FEATURES_SUPPORTED +PNG_EXTERN void png_do_read_intrapixel PNGARG((png_row_infop row_info, + png_bytep row)) PNG_PRIVATE; +PNG_EXTERN void png_do_write_intrapixel PNGARG((png_row_infop row_info, + png_bytep row)) PNG_PRIVATE; +#endif + +#ifdef PNG_ASSEMBLER_CODE_SUPPORTED +#ifdef PNG_MMX_CODE_SUPPORTED +/* png.c */ /* PRIVATE */ +PNG_EXTERN void png_init_mmx_flags PNGARG((png_structp png_ptr)) PNG_PRIVATE; +#endif +#endif + + +/* The following six functions will be exported in libpng-1.4.0. */ +#if defined(PNG_INCH_CONVERSIONS) && defined(PNG_FLOATING_POINT_SUPPORTED) +PNG_EXTERN png_uint_32 png_get_pixels_per_inch PNGARG((png_structp png_ptr, +png_infop info_ptr)); + +PNG_EXTERN png_uint_32 png_get_x_pixels_per_inch PNGARG((png_structp png_ptr, +png_infop info_ptr)); + +PNG_EXTERN png_uint_32 png_get_y_pixels_per_inch PNGARG((png_structp png_ptr, +png_infop info_ptr)); + +PNG_EXTERN float png_get_x_offset_inches PNGARG((png_structp png_ptr, +png_infop info_ptr)); + +PNG_EXTERN float png_get_y_offset_inches PNGARG((png_structp png_ptr, +png_infop info_ptr)); + +#ifdef PNG_pHYs_SUPPORTED +PNG_EXTERN png_uint_32 png_get_pHYs_dpi PNGARG((png_structp png_ptr, +png_infop info_ptr, png_uint_32 *res_x, png_uint_32 *res_y, int *unit_type)); +#endif /* PNG_pHYs_SUPPORTED */ +#endif /* PNG_INCH_CONVERSIONS && PNG_FLOATING_POINT_SUPPORTED */ + +/* Read the chunk header (length + type name) */ +PNG_EXTERN png_uint_32 png_read_chunk_header + PNGARG((png_structp png_ptr)) PNG_PRIVATE; + +/* Added at libpng version 1.2.34 */ +#ifdef PNG_cHRM_SUPPORTED +PNG_EXTERN int png_check_cHRM_fixed PNGARG((png_structp png_ptr, + png_fixed_point int_white_x, png_fixed_point int_white_y, + png_fixed_point int_red_x, png_fixed_point int_red_y, png_fixed_point + int_green_x, png_fixed_point int_green_y, png_fixed_point int_blue_x, + png_fixed_point int_blue_y)) PNG_PRIVATE; +#endif + +#ifdef PNG_cHRM_SUPPORTED +#ifdef PNG_CHECK_cHRM_SUPPORTED +/* Added at libpng version 1.2.34 */ +PNG_EXTERN void png_64bit_product PNGARG((long v1, long v2, + unsigned long *hi_product, unsigned long *lo_product)) PNG_PRIVATE; +#endif +#endif + +/* Added at libpng version 1.2.41 */ +PNG_EXTERN void png_check_IHDR PNGARG((png_structp png_ptr, + png_uint_32 width, png_uint_32 height, int bit_depth, + int color_type, int interlace_type, int compression_type, + int filter_type)) PNG_PRIVATE; + +/* Added at libpng version 1.2.41 */ +PNG_EXTERN png_voidp png_calloc PNGARG((png_structp png_ptr, + png_uint_32 size)); + +/* Maintainer: Put new private prototypes here ^ and in libpngpf.3 */ + +#endif /* PNG_INTERNAL */ + +#ifdef __cplusplus +} +#endif + +#endif /* PNG_VERSION_INFO_ONLY */ +/* Do not put anything past this line */ +#endif /* PNG_H */ diff --git a/external/libpng/pngbar.jpg b/external/libpng/pngbar.jpg new file mode 100644 index 0000000..70ba8d8 Binary files /dev/null and b/external/libpng/pngbar.jpg differ diff --git a/external/libpng/pngbar.png b/external/libpng/pngbar.png new file mode 100644 index 0000000..49798c8 Binary files /dev/null and b/external/libpng/pngbar.png differ diff --git a/external/libpng/pngconf.h b/external/libpng/pngconf.h new file mode 100644 index 0000000..85d9b2a --- /dev/null +++ b/external/libpng/pngconf.h @@ -0,0 +1,1665 @@ + +/* pngconf.h - machine configurable file for libpng + * + * libpng version 1.2.49 - March 29, 2012 + * Copyright (c) 1998-2012 Glenn Randers-Pehrson + * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) + * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) + * + * This code is released under the libpng license. + * For conditions of distribution and use, see the disclaimer + * and license in png.h + */ + +/* Any machine specific code is near the front of this file, so if you + * are configuring libpng for a machine, you may want to read the section + * starting here down to where it starts to typedef png_color, png_text, + * and png_info. + */ + +#ifndef PNGCONF_H +#define PNGCONF_H + +#define PNG_1_2_X + +/* + * PNG_USER_CONFIG has to be defined on the compiler command line. This + * includes the resource compiler for Windows DLL configurations. + */ +#ifdef PNG_USER_CONFIG +# ifndef PNG_USER_PRIVATEBUILD +# define PNG_USER_PRIVATEBUILD +# endif +#include "pngusr.h" +#endif + +/* PNG_CONFIGURE_LIBPNG is set by the "configure" script. */ +#ifdef PNG_CONFIGURE_LIBPNG +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif +#endif + +/* + * Added at libpng-1.2.8 + * + * If you create a private DLL you need to define in "pngusr.h" the followings: + * #define PNG_USER_PRIVATEBUILD + * e.g. #define PNG_USER_PRIVATEBUILD "Build by MyCompany for xyz reasons." + * #define PNG_USER_DLLFNAME_POSTFIX + * e.g. // private DLL "libpng13gx.dll" + * #define PNG_USER_DLLFNAME_POSTFIX "gx" + * + * The following macros are also at your disposal if you want to complete the + * DLL VERSIONINFO structure. + * - PNG_USER_VERSIONINFO_COMMENTS + * - PNG_USER_VERSIONINFO_COMPANYNAME + * - PNG_USER_VERSIONINFO_LEGALTRADEMARKS + */ + +#ifdef __STDC__ +#ifdef SPECIALBUILD +# pragma message("PNG_LIBPNG_SPECIALBUILD (and deprecated SPECIALBUILD)\ + are now LIBPNG reserved macros. Use PNG_USER_PRIVATEBUILD instead.") +#endif + +#ifdef PRIVATEBUILD +# pragma message("PRIVATEBUILD is deprecated.\ + Use PNG_USER_PRIVATEBUILD instead.") +# define PNG_USER_PRIVATEBUILD PRIVATEBUILD +#endif +#endif /* __STDC__ */ + +#ifndef PNG_VERSION_INFO_ONLY + +/* End of material added to libpng-1.2.8 */ + +/* Added at libpng-1.2.19, removed at libpng-1.2.20 because it caused trouble + Restored at libpng-1.2.21 */ +#if !defined(PNG_NO_WARN_UNINITIALIZED_ROW) && \ + !defined(PNG_WARN_UNINITIALIZED_ROW) +# define PNG_WARN_UNINITIALIZED_ROW 1 +#endif +/* End of material added at libpng-1.2.19/1.2.21 */ + +/* This is the size of the compression buffer, and thus the size of + * an IDAT chunk. Make this whatever size you feel is best for your + * machine. One of these will be allocated per png_struct. When this + * is full, it writes the data to the disk, and does some other + * calculations. Making this an extremely small size will slow + * the library down, but you may want to experiment to determine + * where it becomes significant, if you are concerned with memory + * usage. Note that zlib allocates at least 32Kb also. For readers, + * this describes the size of the buffer available to read the data in. + * Unless this gets smaller than the size of a row (compressed), + * it should not make much difference how big this is. + */ + +#ifndef PNG_ZBUF_SIZE +# define PNG_ZBUF_SIZE 8192 +#endif + +/* Enable if you want a write-only libpng */ + +#ifndef PNG_NO_READ_SUPPORTED +# define PNG_READ_SUPPORTED +#endif + +/* Enable if you want a read-only libpng */ + +#ifndef PNG_NO_WRITE_SUPPORTED +# define PNG_WRITE_SUPPORTED +#endif + +/* Enabled in 1.2.41. */ +#ifdef PNG_ALLOW_BENIGN_ERRORS +# define png_benign_error png_warning +# define png_chunk_benign_error png_chunk_warning +#else +# ifndef PNG_BENIGN_ERRORS_SUPPORTED +# define png_benign_error png_error +# define png_chunk_benign_error png_chunk_error +# endif +#endif + +/* Added in libpng-1.2.41 */ +#if !defined(PNG_NO_WARNINGS) && !defined(PNG_WARNINGS_SUPPORTED) +# define PNG_WARNINGS_SUPPORTED +#endif + +#if !defined(PNG_NO_ERROR_TEXT) && !defined(PNG_ERROR_TEXT_SUPPORTED) +# define PNG_ERROR_TEXT_SUPPORTED +#endif + +#if !defined(PNG_NO_CHECK_cHRM) && !defined(PNG_CHECK_cHRM_SUPPORTED) +# define PNG_CHECK_cHRM_SUPPORTED +#endif + +/* Enabled by default in 1.2.0. You can disable this if you don't need to + * support PNGs that are embedded in MNG datastreams + */ +#if !defined(PNG_1_0_X) && !defined(PNG_NO_MNG_FEATURES) +# ifndef PNG_MNG_FEATURES_SUPPORTED +# define PNG_MNG_FEATURES_SUPPORTED +# endif +#endif + +#ifndef PNG_NO_FLOATING_POINT_SUPPORTED +# ifndef PNG_FLOATING_POINT_SUPPORTED +# define PNG_FLOATING_POINT_SUPPORTED +# endif +#endif + +/* If you are running on a machine where you cannot allocate more + * than 64K of memory at once, uncomment this. While libpng will not + * normally need that much memory in a chunk (unless you load up a very + * large file), zlib needs to know how big of a chunk it can use, and + * libpng thus makes sure to check any memory allocation to verify it + * will fit into memory. +#define PNG_MAX_MALLOC_64K + */ +#if defined(MAXSEG_64K) && !defined(PNG_MAX_MALLOC_64K) +# define PNG_MAX_MALLOC_64K +#endif + +/* Special munging to support doing things the 'cygwin' way: + * 'Normal' png-on-win32 defines/defaults: + * PNG_BUILD_DLL -- building dll + * PNG_USE_DLL -- building an application, linking to dll + * (no define) -- building static library, or building an + * application and linking to the static lib + * 'Cygwin' defines/defaults: + * PNG_BUILD_DLL -- (ignored) building the dll + * (no define) -- (ignored) building an application, linking to the dll + * PNG_STATIC -- (ignored) building the static lib, or building an + * application that links to the static lib. + * ALL_STATIC -- (ignored) building various static libs, or building an + * application that links to the static libs. + * Thus, + * a cygwin user should define either PNG_BUILD_DLL or PNG_STATIC, and + * this bit of #ifdefs will define the 'correct' config variables based on + * that. If a cygwin user *wants* to define 'PNG_USE_DLL' that's okay, but + * unnecessary. + * + * Also, the precedence order is: + * ALL_STATIC (since we can't #undef something outside our namespace) + * PNG_BUILD_DLL + * PNG_STATIC + * (nothing) == PNG_USE_DLL + * + * CYGWIN (2002-01-20): The preceding is now obsolete. With the advent + * of auto-import in binutils, we no longer need to worry about + * __declspec(dllexport) / __declspec(dllimport) and friends. Therefore, + * we don't need to worry about PNG_STATIC or ALL_STATIC when it comes + * to __declspec() stuff. However, we DO need to worry about + * PNG_BUILD_DLL and PNG_STATIC because those change some defaults + * such as CONSOLE_IO and whether GLOBAL_ARRAYS are allowed. + */ +#ifdef __CYGWIN__ +# ifdef ALL_STATIC +# ifdef PNG_BUILD_DLL +# undef PNG_BUILD_DLL +# endif +# ifdef PNG_USE_DLL +# undef PNG_USE_DLL +# endif +# ifdef PNG_DLL +# undef PNG_DLL +# endif +# ifndef PNG_STATIC +# define PNG_STATIC +# endif +# else +# ifdef PNG_BUILD_DLL +# ifdef PNG_STATIC +# undef PNG_STATIC +# endif +# ifdef PNG_USE_DLL +# undef PNG_USE_DLL +# endif +# ifndef PNG_DLL +# define PNG_DLL +# endif +# else +# ifdef PNG_STATIC +# ifdef PNG_USE_DLL +# undef PNG_USE_DLL +# endif +# ifdef PNG_DLL +# undef PNG_DLL +# endif +# else +# ifndef PNG_USE_DLL +# define PNG_USE_DLL +# endif +# ifndef PNG_DLL +# define PNG_DLL +# endif +# endif +# endif +# endif +#endif + +/* This protects us against compilers that run on a windowing system + * and thus don't have or would rather us not use the stdio types: + * stdin, stdout, and stderr. The only one currently used is stderr + * in png_error() and png_warning(). #defining PNG_NO_CONSOLE_IO will + * prevent these from being compiled and used. #defining PNG_NO_STDIO + * will also prevent these, plus will prevent the entire set of stdio + * macros and functions (FILE *, printf, etc.) from being compiled and used, + * unless (PNG_DEBUG > 0) has been #defined. + * + * #define PNG_NO_CONSOLE_IO + * #define PNG_NO_STDIO + */ + +#if !defined(PNG_NO_STDIO) && !defined(PNG_STDIO_SUPPORTED) +# define PNG_STDIO_SUPPORTED +#endif + +#ifdef _WIN32_WCE +# include + /* Console I/O functions are not supported on WindowsCE */ +# define PNG_NO_CONSOLE_IO + /* abort() may not be supported on some/all Windows CE platforms */ +# define PNG_ABORT() exit(-1) +# ifdef PNG_DEBUG +# undef PNG_DEBUG +# endif +#endif + +#ifdef PNG_BUILD_DLL +# ifndef PNG_CONSOLE_IO_SUPPORTED +# ifndef PNG_NO_CONSOLE_IO +# define PNG_NO_CONSOLE_IO +# endif +# endif +#endif + +# ifdef PNG_NO_STDIO +# ifndef PNG_NO_CONSOLE_IO +# define PNG_NO_CONSOLE_IO +# endif +# ifdef PNG_DEBUG +# if (PNG_DEBUG > 0) +# include +# endif +# endif +# else +# ifndef _WIN32_WCE +/* "stdio.h" functions are not supported on WindowsCE */ +# include +# endif +# endif + +#if !(defined PNG_NO_CONSOLE_IO) && !defined(PNG_CONSOLE_IO_SUPPORTED) +# define PNG_CONSOLE_IO_SUPPORTED +#endif + +/* This macro protects us against machines that don't have function + * prototypes (ie K&R style headers). If your compiler does not handle + * function prototypes, define this macro and use the included ansi2knr. + * I've always been able to use _NO_PROTO as the indicator, but you may + * need to drag the empty declaration out in front of here, or change the + * ifdef to suit your own needs. + */ +#ifndef PNGARG + +#ifdef OF /* zlib prototype munger */ +# define PNGARG(arglist) OF(arglist) +#else + +#ifdef _NO_PROTO +# define PNGARG(arglist) () +# ifndef PNG_TYPECAST_NULL +# define PNG_TYPECAST_NULL +# endif +#else +# define PNGARG(arglist) arglist +#endif /* _NO_PROTO */ + + +#endif /* OF */ + +#endif /* PNGARG */ + +/* Try to determine if we are compiling on a Mac. Note that testing for + * just __MWERKS__ is not good enough, because the Codewarrior is now used + * on non-Mac platforms. + */ +#ifndef MACOS +# if (defined(__MWERKS__) && defined(macintosh)) || defined(applec) || \ + defined(THINK_C) || defined(__SC__) || defined(TARGET_OS_MAC) +# define MACOS +# endif +#endif + +/* enough people need this for various reasons to include it here */ +#if !defined(MACOS) && !defined(RISCOS) && !defined(_WIN32_WCE) +# include +#endif + +#if !defined(PNG_SETJMP_NOT_SUPPORTED) && !defined(PNG_NO_SETJMP_SUPPORTED) +# define PNG_SETJMP_SUPPORTED +#endif + +#ifdef PNG_SETJMP_SUPPORTED +/* This is an attempt to force a single setjmp behaviour on Linux. If + * the X config stuff didn't define _BSD_SOURCE we wouldn't need this. + * + * You can bypass this test if you know that your application uses exactly + * the same setjmp.h that was included when libpng was built. Only define + * PNG_SKIP_SETJMP_CHECK while building your application, prior to the + * application's '#include "png.h"'. Don't define PNG_SKIP_SETJMP_CHECK + * while building a separate libpng library for general use. + */ + +# ifndef PNG_SKIP_SETJMP_CHECK +# ifdef __linux__ +# ifdef _BSD_SOURCE +# define PNG_SAVE_BSD_SOURCE +# undef _BSD_SOURCE +# endif +# ifdef _SETJMP_H + /* If you encounter a compiler error here, see the explanation + * near the end of INSTALL. + */ + __pngconf.h__ in libpng already includes setjmp.h; + __dont__ include it again.; +# endif +# endif /* __linux__ */ +# endif /* PNG_SKIP_SETJMP_CHECK */ + + /* include setjmp.h for error handling */ +# include + +# ifdef __linux__ +# ifdef PNG_SAVE_BSD_SOURCE +# ifndef _BSD_SOURCE +# define _BSD_SOURCE +# endif +# undef PNG_SAVE_BSD_SOURCE +# endif +# endif /* __linux__ */ +#endif /* PNG_SETJMP_SUPPORTED */ + +#ifdef BSD +# include +#else +# include +#endif + +/* Other defines for things like memory and the like can go here. */ +#ifdef PNG_INTERNAL + +#include + +/* The functions exported by PNG_EXTERN are PNG_INTERNAL functions, which + * aren't usually used outside the library (as far as I know), so it is + * debatable if they should be exported at all. In the future, when it is + * possible to have run-time registry of chunk-handling functions, some of + * these will be made available again. +#define PNG_EXTERN extern + */ +#define PNG_EXTERN + +/* Other defines specific to compilers can go here. Try to keep + * them inside an appropriate ifdef/endif pair for portability. + */ + +#ifdef PNG_FLOATING_POINT_SUPPORTED +# ifdef MACOS + /* We need to check that hasn't already been included earlier + * as it seems it doesn't agree with , yet we should really use + * if possible. + */ +# if !defined(__MATH_H__) && !defined(__MATH_H) && !defined(__cmath__) +# include +# endif +# else +# include +# endif +# if defined(_AMIGA) && defined(__SASC) && defined(_M68881) + /* Amiga SAS/C: We must include builtin FPU functions when compiling using + * MATH=68881 + */ +# include +# endif +#endif + +/* Codewarrior on NT has linking problems without this. */ +#if (defined(__MWERKS__) && defined(WIN32)) || defined(__STDC__) +# define PNG_ALWAYS_EXTERN +#endif + +/* This provides the non-ANSI (far) memory allocation routines. */ +#if defined(__TURBOC__) && defined(__MSDOS__) +# include +# include +#endif + +/* I have no idea why is this necessary... */ +#if defined(_MSC_VER) && (defined(WIN32) || defined(_Windows) || \ + defined(_WINDOWS) || defined(_WIN32) || defined(__WIN32__)) +# include +#endif + +/* This controls how fine the dithering gets. As this allocates + * a largish chunk of memory (32K), those who are not as concerned + * with dithering quality can decrease some or all of these. + */ +#ifndef PNG_DITHER_RED_BITS +# define PNG_DITHER_RED_BITS 5 +#endif +#ifndef PNG_DITHER_GREEN_BITS +# define PNG_DITHER_GREEN_BITS 5 +#endif +#ifndef PNG_DITHER_BLUE_BITS +# define PNG_DITHER_BLUE_BITS 5 +#endif + +/* This controls how fine the gamma correction becomes when you + * are only interested in 8 bits anyway. Increasing this value + * results in more memory being used, and more pow() functions + * being called to fill in the gamma tables. Don't set this value + * less then 8, and even that may not work (I haven't tested it). + */ + +#ifndef PNG_MAX_GAMMA_8 +# define PNG_MAX_GAMMA_8 11 +#endif + +/* This controls how much a difference in gamma we can tolerate before + * we actually start doing gamma conversion. + */ +#ifndef PNG_GAMMA_THRESHOLD +# define PNG_GAMMA_THRESHOLD 0.05 +#endif + +#endif /* PNG_INTERNAL */ + +/* The following uses const char * instead of char * for error + * and warning message functions, so some compilers won't complain. + * If you do not want to use const, define PNG_NO_CONST here. + */ + +#ifndef PNG_NO_CONST +# define PNG_CONST const +#else +# define PNG_CONST +#endif + +/* The following defines give you the ability to remove code from the + * library that you will not be using. I wish I could figure out how to + * automate this, but I can't do that without making it seriously hard + * on the users. So if you are not using an ability, change the #define + * to and #undef, and that part of the library will not be compiled. If + * your linker can't find a function, you may want to make sure the + * ability is defined here. Some of these depend upon some others being + * defined. I haven't figured out all the interactions here, so you may + * have to experiment awhile to get everything to compile. If you are + * creating or using a shared library, you probably shouldn't touch this, + * as it will affect the size of the structures, and this will cause bad + * things to happen if the library and/or application ever change. + */ + +/* Any features you will not be using can be undef'ed here */ + +/* GR-P, 0.96a: Set "*TRANSFORMS_SUPPORTED as default but allow user + * to turn it off with "*TRANSFORMS_NOT_SUPPORTED" or *PNG_NO_*_TRANSFORMS + * on the compile line, then pick and choose which ones to define without + * having to edit this file. It is safe to use the *TRANSFORMS_NOT_SUPPORTED + * if you only want to have a png-compliant reader/writer but don't need + * any of the extra transformations. This saves about 80 kbytes in a + * typical installation of the library. (PNG_NO_* form added in version + * 1.0.1c, for consistency) + */ + +/* The size of the png_text structure changed in libpng-1.0.6 when + * iTXt support was added. iTXt support was turned off by default through + * libpng-1.2.x, to support old apps that malloc the png_text structure + * instead of calling png_set_text() and letting libpng malloc it. It + * will be turned on by default in libpng-1.4.0. + */ + +#if defined(PNG_1_0_X) || defined (PNG_1_2_X) +# ifndef PNG_NO_iTXt_SUPPORTED +# define PNG_NO_iTXt_SUPPORTED +# endif +# ifndef PNG_NO_READ_iTXt +# define PNG_NO_READ_iTXt +# endif +# ifndef PNG_NO_WRITE_iTXt +# define PNG_NO_WRITE_iTXt +# endif +#endif + +#if !defined(PNG_NO_iTXt_SUPPORTED) +# if !defined(PNG_READ_iTXt_SUPPORTED) && !defined(PNG_NO_READ_iTXt) +# define PNG_READ_iTXt +# endif +# if !defined(PNG_WRITE_iTXt_SUPPORTED) && !defined(PNG_NO_WRITE_iTXt) +# define PNG_WRITE_iTXt +# endif +#endif + +/* The following support, added after version 1.0.0, can be turned off here en + * masse by defining PNG_LEGACY_SUPPORTED in case you need binary compatibility + * with old applications that require the length of png_struct and png_info + * to remain unchanged. + */ + +#ifdef PNG_LEGACY_SUPPORTED +# define PNG_NO_FREE_ME +# define PNG_NO_READ_UNKNOWN_CHUNKS +# define PNG_NO_WRITE_UNKNOWN_CHUNKS +# define PNG_NO_HANDLE_AS_UNKNOWN +# define PNG_NO_READ_USER_CHUNKS +# define PNG_NO_READ_iCCP +# define PNG_NO_WRITE_iCCP +# define PNG_NO_READ_iTXt +# define PNG_NO_WRITE_iTXt +# define PNG_NO_READ_sCAL +# define PNG_NO_WRITE_sCAL +# define PNG_NO_READ_sPLT +# define PNG_NO_WRITE_sPLT +# define PNG_NO_INFO_IMAGE +# define PNG_NO_READ_RGB_TO_GRAY +# define PNG_NO_READ_USER_TRANSFORM +# define PNG_NO_WRITE_USER_TRANSFORM +# define PNG_NO_USER_MEM +# define PNG_NO_READ_EMPTY_PLTE +# define PNG_NO_MNG_FEATURES +# define PNG_NO_FIXED_POINT_SUPPORTED +#endif + +/* Ignore attempt to turn off both floating and fixed point support */ +#if !defined(PNG_FLOATING_POINT_SUPPORTED) || \ + !defined(PNG_NO_FIXED_POINT_SUPPORTED) +# define PNG_FIXED_POINT_SUPPORTED +#endif + +#ifndef PNG_NO_FREE_ME +# define PNG_FREE_ME_SUPPORTED +#endif + +#ifdef PNG_READ_SUPPORTED + +#if !defined(PNG_READ_TRANSFORMS_NOT_SUPPORTED) && \ + !defined(PNG_NO_READ_TRANSFORMS) +# define PNG_READ_TRANSFORMS_SUPPORTED +#endif + +#ifdef PNG_READ_TRANSFORMS_SUPPORTED +# ifndef PNG_NO_READ_EXPAND +# define PNG_READ_EXPAND_SUPPORTED +# endif +# ifndef PNG_NO_READ_SHIFT +# define PNG_READ_SHIFT_SUPPORTED +# endif +# ifndef PNG_NO_READ_PACK +# define PNG_READ_PACK_SUPPORTED +# endif +# ifndef PNG_NO_READ_BGR +# define PNG_READ_BGR_SUPPORTED +# endif +# ifndef PNG_NO_READ_SWAP +# define PNG_READ_SWAP_SUPPORTED +# endif +# ifndef PNG_NO_READ_PACKSWAP +# define PNG_READ_PACKSWAP_SUPPORTED +# endif +# ifndef PNG_NO_READ_INVERT +# define PNG_READ_INVERT_SUPPORTED +# endif +# ifndef PNG_NO_READ_DITHER +# define PNG_READ_DITHER_SUPPORTED +# endif +# ifndef PNG_NO_READ_BACKGROUND +# define PNG_READ_BACKGROUND_SUPPORTED +# endif +# ifndef PNG_NO_READ_16_TO_8 +# define PNG_READ_16_TO_8_SUPPORTED +# endif +# ifndef PNG_NO_READ_FILLER +# define PNG_READ_FILLER_SUPPORTED +# endif +# ifndef PNG_NO_READ_GAMMA +# define PNG_READ_GAMMA_SUPPORTED +# endif +# ifndef PNG_NO_READ_GRAY_TO_RGB +# define PNG_READ_GRAY_TO_RGB_SUPPORTED +# endif +# ifndef PNG_NO_READ_SWAP_ALPHA +# define PNG_READ_SWAP_ALPHA_SUPPORTED +# endif +# ifndef PNG_NO_READ_INVERT_ALPHA +# define PNG_READ_INVERT_ALPHA_SUPPORTED +# endif +# ifndef PNG_NO_READ_STRIP_ALPHA +# define PNG_READ_STRIP_ALPHA_SUPPORTED +# endif +# ifndef PNG_NO_READ_USER_TRANSFORM +# define PNG_READ_USER_TRANSFORM_SUPPORTED +# endif +# ifndef PNG_NO_READ_RGB_TO_GRAY +# define PNG_READ_RGB_TO_GRAY_SUPPORTED +# endif +#endif /* PNG_READ_TRANSFORMS_SUPPORTED */ + +/* PNG_PROGRESSIVE_READ_NOT_SUPPORTED is deprecated. */ +#if !defined(PNG_NO_PROGRESSIVE_READ) && \ + !defined(PNG_PROGRESSIVE_READ_NOT_SUPPORTED) /* if you don't do progressive */ +# define PNG_PROGRESSIVE_READ_SUPPORTED /* reading. This is not talking */ +#endif /* about interlacing capability! You'll */ + /* still have interlacing unless you change the following define: */ +#define PNG_READ_INTERLACING_SUPPORTED /* required for PNG-compliant decoders */ + +/* PNG_NO_SEQUENTIAL_READ_SUPPORTED is deprecated. */ +#if !defined(PNG_NO_SEQUENTIAL_READ) && \ + !defined(PNG_SEQUENTIAL_READ_SUPPORTED) && \ + !defined(PNG_NO_SEQUENTIAL_READ_SUPPORTED) +# define PNG_SEQUENTIAL_READ_SUPPORTED +#endif + +#define PNG_READ_INTERLACING_SUPPORTED /* required in PNG-compliant decoders */ + +#ifndef PNG_NO_READ_COMPOSITE_NODIV +# ifndef PNG_NO_READ_COMPOSITED_NODIV /* libpng-1.0.x misspelling */ +# define PNG_READ_COMPOSITE_NODIV_SUPPORTED /* well tested on Intel, SGI */ +# endif +#endif + +#if defined(PNG_1_0_X) || defined (PNG_1_2_X) +/* Deprecated, will be removed from version 2.0.0. + Use PNG_MNG_FEATURES_SUPPORTED instead. */ +#ifndef PNG_NO_READ_EMPTY_PLTE +# define PNG_READ_EMPTY_PLTE_SUPPORTED +#endif +#endif + +#endif /* PNG_READ_SUPPORTED */ + +#ifdef PNG_WRITE_SUPPORTED + +# if !defined(PNG_WRITE_TRANSFORMS_NOT_SUPPORTED) && \ + !defined(PNG_NO_WRITE_TRANSFORMS) +# define PNG_WRITE_TRANSFORMS_SUPPORTED +#endif + +#ifdef PNG_WRITE_TRANSFORMS_SUPPORTED +# ifndef PNG_NO_WRITE_SHIFT +# define PNG_WRITE_SHIFT_SUPPORTED +# endif +# ifndef PNG_NO_WRITE_PACK +# define PNG_WRITE_PACK_SUPPORTED +# endif +# ifndef PNG_NO_WRITE_BGR +# define PNG_WRITE_BGR_SUPPORTED +# endif +# ifndef PNG_NO_WRITE_SWAP +# define PNG_WRITE_SWAP_SUPPORTED +# endif +# ifndef PNG_NO_WRITE_PACKSWAP +# define PNG_WRITE_PACKSWAP_SUPPORTED +# endif +# ifndef PNG_NO_WRITE_INVERT +# define PNG_WRITE_INVERT_SUPPORTED +# endif +# ifndef PNG_NO_WRITE_FILLER +# define PNG_WRITE_FILLER_SUPPORTED /* same as WRITE_STRIP_ALPHA */ +# endif +# ifndef PNG_NO_WRITE_SWAP_ALPHA +# define PNG_WRITE_SWAP_ALPHA_SUPPORTED +# endif +#ifndef PNG_1_0_X +# ifndef PNG_NO_WRITE_INVERT_ALPHA +# define PNG_WRITE_INVERT_ALPHA_SUPPORTED +# endif +#endif +# ifndef PNG_NO_WRITE_USER_TRANSFORM +# define PNG_WRITE_USER_TRANSFORM_SUPPORTED +# endif +#endif /* PNG_WRITE_TRANSFORMS_SUPPORTED */ + +#if !defined(PNG_NO_WRITE_INTERLACING_SUPPORTED) && \ + !defined(PNG_WRITE_INTERLACING_SUPPORTED) +#define PNG_WRITE_INTERLACING_SUPPORTED /* not required for PNG-compliant + encoders, but can cause trouble + if left undefined */ +#endif + +#if !defined(PNG_NO_WRITE_WEIGHTED_FILTER) && \ + !defined(PNG_WRITE_WEIGHTED_FILTER) && \ + defined(PNG_FLOATING_POINT_SUPPORTED) +# define PNG_WRITE_WEIGHTED_FILTER_SUPPORTED +#endif + +#ifndef PNG_NO_WRITE_FLUSH +# define PNG_WRITE_FLUSH_SUPPORTED +#endif + +#if defined(PNG_1_0_X) || defined (PNG_1_2_X) +/* Deprecated, see PNG_MNG_FEATURES_SUPPORTED, above */ +#ifndef PNG_NO_WRITE_EMPTY_PLTE +# define PNG_WRITE_EMPTY_PLTE_SUPPORTED +#endif +#endif + +#endif /* PNG_WRITE_SUPPORTED */ + +#ifndef PNG_1_0_X +# ifndef PNG_NO_ERROR_NUMBERS +# define PNG_ERROR_NUMBERS_SUPPORTED +# endif +#endif /* PNG_1_0_X */ + +#if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) || \ + defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED) +# ifndef PNG_NO_USER_TRANSFORM_PTR +# define PNG_USER_TRANSFORM_PTR_SUPPORTED +# endif +#endif + +#ifndef PNG_NO_STDIO +# define PNG_TIME_RFC1123_SUPPORTED +#endif + +/* This adds extra functions in pngget.c for accessing data from the + * info pointer (added in version 0.99) + * png_get_image_width() + * png_get_image_height() + * png_get_bit_depth() + * png_get_color_type() + * png_get_compression_type() + * png_get_filter_type() + * png_get_interlace_type() + * png_get_pixel_aspect_ratio() + * png_get_pixels_per_meter() + * png_get_x_offset_pixels() + * png_get_y_offset_pixels() + * png_get_x_offset_microns() + * png_get_y_offset_microns() + */ +#if !defined(PNG_NO_EASY_ACCESS) && !defined(PNG_EASY_ACCESS_SUPPORTED) +# define PNG_EASY_ACCESS_SUPPORTED +#endif + +/* PNG_ASSEMBLER_CODE was enabled by default in version 1.2.0 + * and removed from version 1.2.20. The following will be removed + * from libpng-1.4.0 +*/ + +#if defined(PNG_READ_SUPPORTED) && !defined(PNG_NO_OPTIMIZED_CODE) +# ifndef PNG_OPTIMIZED_CODE_SUPPORTED +# define PNG_OPTIMIZED_CODE_SUPPORTED +# endif +#endif + +#if defined(PNG_READ_SUPPORTED) && !defined(PNG_NO_ASSEMBLER_CODE) +# ifndef PNG_ASSEMBLER_CODE_SUPPORTED +# define PNG_ASSEMBLER_CODE_SUPPORTED +# endif + +# if defined(__GNUC__) && defined(__x86_64__) && (__GNUC__ < 4) + /* work around 64-bit gcc compiler bugs in gcc-3.x */ +# if !defined(PNG_MMX_CODE_SUPPORTED) && !defined(PNG_NO_MMX_CODE) +# define PNG_NO_MMX_CODE +# endif +# endif + +# ifdef __APPLE__ +# if !defined(PNG_MMX_CODE_SUPPORTED) && !defined(PNG_NO_MMX_CODE) +# define PNG_NO_MMX_CODE +# endif +# endif + +# if (defined(__MWERKS__) && ((__MWERKS__ < 0x0900) || macintosh)) +# if !defined(PNG_MMX_CODE_SUPPORTED) && !defined(PNG_NO_MMX_CODE) +# define PNG_NO_MMX_CODE +# endif +# endif + +# if !defined(PNG_MMX_CODE_SUPPORTED) && !defined(PNG_NO_MMX_CODE) +# define PNG_MMX_CODE_SUPPORTED +# endif + +#endif +/* end of obsolete code to be removed from libpng-1.4.0 */ + +/* Added at libpng-1.2.0 */ +#ifndef PNG_1_0_X +#if !defined(PNG_NO_USER_MEM) && !defined(PNG_USER_MEM_SUPPORTED) +# define PNG_USER_MEM_SUPPORTED +#endif +#endif /* PNG_1_0_X */ + +/* Added at libpng-1.2.6 */ +#ifndef PNG_1_0_X +# ifndef PNG_SET_USER_LIMITS_SUPPORTED +# ifndef PNG_NO_SET_USER_LIMITS +# define PNG_SET_USER_LIMITS_SUPPORTED +# endif +# endif +#endif /* PNG_1_0_X */ + +/* Added at libpng-1.0.53 and 1.2.43 */ +#ifndef PNG_USER_LIMITS_SUPPORTED +# ifndef PNG_NO_USER_LIMITS +# define PNG_USER_LIMITS_SUPPORTED +# endif +#endif + +/* Added at libpng-1.0.16 and 1.2.6. To accept all valid PNGS no matter + * how large, set these limits to 0x7fffffffL + */ +#ifndef PNG_USER_WIDTH_MAX +# define PNG_USER_WIDTH_MAX 1000000L +#endif +#ifndef PNG_USER_HEIGHT_MAX +# define PNG_USER_HEIGHT_MAX 1000000L +#endif + +/* Added at libpng-1.2.43. To accept all valid PNGs no matter + * how large, set these two limits to 0. + */ +#ifndef PNG_USER_CHUNK_CACHE_MAX +# define PNG_USER_CHUNK_CACHE_MAX 0 +#endif + +/* Added at libpng-1.2.43 */ +#ifndef PNG_USER_CHUNK_MALLOC_MAX +# define PNG_USER_CHUNK_MALLOC_MAX 0 +#endif + +#ifndef PNG_LITERAL_SHARP +# define PNG_LITERAL_SHARP 0x23 +#endif +#ifndef PNG_LITERAL_LEFT_SQUARE_BRACKET +# define PNG_LITERAL_LEFT_SQUARE_BRACKET 0x5b +#endif +#ifndef PNG_LITERAL_RIGHT_SQUARE_BRACKET +# define PNG_LITERAL_RIGHT_SQUARE_BRACKET 0x5d +#endif + +/* Added at libpng-1.2.34 */ +#ifndef PNG_STRING_NEWLINE +#define PNG_STRING_NEWLINE "\n" +#endif + +/* These are currently experimental features, define them if you want */ + +/* very little testing */ +/* +#ifdef PNG_READ_SUPPORTED +# ifndef PNG_READ_16_TO_8_ACCURATE_SCALE_SUPPORTED +# define PNG_READ_16_TO_8_ACCURATE_SCALE_SUPPORTED +# endif +#endif +*/ + +/* This is only for PowerPC big-endian and 680x0 systems */ +/* some testing */ +/* +#ifndef PNG_READ_BIG_ENDIAN_SUPPORTED +# define PNG_READ_BIG_ENDIAN_SUPPORTED +#endif +*/ + +/* Buggy compilers (e.g., gcc 2.7.2.2) need this */ +/* +#define PNG_NO_POINTER_INDEXING +*/ + +#if !defined(PNG_NO_POINTER_INDEXING) && \ + !defined(PNG_POINTER_INDEXING_SUPPORTED) +# define PNG_POINTER_INDEXING_SUPPORTED +#endif + +/* These functions are turned off by default, as they will be phased out. */ +/* +#define PNG_USELESS_TESTS_SUPPORTED +#define PNG_CORRECT_PALETTE_SUPPORTED +*/ + +/* Any chunks you are not interested in, you can undef here. The + * ones that allocate memory may be expecially important (hIST, + * tEXt, zTXt, tRNS, pCAL). Others will just save time and make png_info + * a bit smaller. + */ + +#if defined(PNG_READ_SUPPORTED) && \ + !defined(PNG_READ_ANCILLARY_CHUNKS_NOT_SUPPORTED) && \ + !defined(PNG_NO_READ_ANCILLARY_CHUNKS) +# define PNG_READ_ANCILLARY_CHUNKS_SUPPORTED +#endif + +#if defined(PNG_WRITE_SUPPORTED) && \ + !defined(PNG_WRITE_ANCILLARY_CHUNKS_NOT_SUPPORTED) && \ + !defined(PNG_NO_WRITE_ANCILLARY_CHUNKS) +# define PNG_WRITE_ANCILLARY_CHUNKS_SUPPORTED +#endif + +#ifdef PNG_READ_ANCILLARY_CHUNKS_SUPPORTED + +#ifdef PNG_NO_READ_TEXT +# define PNG_NO_READ_iTXt +# define PNG_NO_READ_tEXt +# define PNG_NO_READ_zTXt +#endif +#ifndef PNG_NO_READ_bKGD +# define PNG_READ_bKGD_SUPPORTED +# define PNG_bKGD_SUPPORTED +#endif +#ifndef PNG_NO_READ_cHRM +# define PNG_READ_cHRM_SUPPORTED +# define PNG_cHRM_SUPPORTED +#endif +#ifndef PNG_NO_READ_gAMA +# define PNG_READ_gAMA_SUPPORTED +# define PNG_gAMA_SUPPORTED +#endif +#ifndef PNG_NO_READ_hIST +# define PNG_READ_hIST_SUPPORTED +# define PNG_hIST_SUPPORTED +#endif +#ifndef PNG_NO_READ_iCCP +# define PNG_READ_iCCP_SUPPORTED +# define PNG_iCCP_SUPPORTED +#endif +#ifndef PNG_NO_READ_iTXt +# ifndef PNG_READ_iTXt_SUPPORTED +# define PNG_READ_iTXt_SUPPORTED +# endif +# ifndef PNG_iTXt_SUPPORTED +# define PNG_iTXt_SUPPORTED +# endif +#endif +#ifndef PNG_NO_READ_oFFs +# define PNG_READ_oFFs_SUPPORTED +# define PNG_oFFs_SUPPORTED +#endif +#ifndef PNG_NO_READ_pCAL +# define PNG_READ_pCAL_SUPPORTED +# define PNG_pCAL_SUPPORTED +#endif +#ifndef PNG_NO_READ_sCAL +# define PNG_READ_sCAL_SUPPORTED +# define PNG_sCAL_SUPPORTED +#endif +#ifndef PNG_NO_READ_pHYs +# define PNG_READ_pHYs_SUPPORTED +# define PNG_pHYs_SUPPORTED +#endif +#ifndef PNG_NO_READ_sBIT +# define PNG_READ_sBIT_SUPPORTED +# define PNG_sBIT_SUPPORTED +#endif +#ifndef PNG_NO_READ_sPLT +# define PNG_READ_sPLT_SUPPORTED +# define PNG_sPLT_SUPPORTED +#endif +#ifndef PNG_NO_READ_sRGB +# define PNG_READ_sRGB_SUPPORTED +# define PNG_sRGB_SUPPORTED +#endif +#ifndef PNG_NO_READ_tEXt +# define PNG_READ_tEXt_SUPPORTED +# define PNG_tEXt_SUPPORTED +#endif +#ifndef PNG_NO_READ_tIME +# define PNG_READ_tIME_SUPPORTED +# define PNG_tIME_SUPPORTED +#endif +#ifndef PNG_NO_READ_tRNS +# define PNG_READ_tRNS_SUPPORTED +# define PNG_tRNS_SUPPORTED +#endif +#ifndef PNG_NO_READ_zTXt +# define PNG_READ_zTXt_SUPPORTED +# define PNG_zTXt_SUPPORTED +#endif +#ifndef PNG_NO_READ_OPT_PLTE +# define PNG_READ_OPT_PLTE_SUPPORTED /* only affects support of the */ +#endif /* optional PLTE chunk in RGB and RGBA images */ +#if defined(PNG_READ_iTXt_SUPPORTED) || defined(PNG_READ_tEXt_SUPPORTED) || \ + defined(PNG_READ_zTXt_SUPPORTED) +# define PNG_READ_TEXT_SUPPORTED +# define PNG_TEXT_SUPPORTED +#endif + +#endif /* PNG_READ_ANCILLARY_CHUNKS_SUPPORTED */ + +#ifndef PNG_NO_READ_UNKNOWN_CHUNKS +# define PNG_READ_UNKNOWN_CHUNKS_SUPPORTED +# ifndef PNG_UNKNOWN_CHUNKS_SUPPORTED +# define PNG_UNKNOWN_CHUNKS_SUPPORTED +# endif +#endif +#if !defined(PNG_NO_READ_USER_CHUNKS) && \ + defined(PNG_READ_UNKNOWN_CHUNKS_SUPPORTED) +# define PNG_READ_USER_CHUNKS_SUPPORTED +# define PNG_USER_CHUNKS_SUPPORTED +# ifdef PNG_NO_READ_UNKNOWN_CHUNKS +# undef PNG_NO_READ_UNKNOWN_CHUNKS +# endif +# ifdef PNG_NO_HANDLE_AS_UNKNOWN +# undef PNG_NO_HANDLE_AS_UNKNOWN +# endif +#endif + +#ifndef PNG_NO_HANDLE_AS_UNKNOWN +# ifndef PNG_HANDLE_AS_UNKNOWN_SUPPORTED +# define PNG_HANDLE_AS_UNKNOWN_SUPPORTED +# endif +#endif + +#ifdef PNG_WRITE_SUPPORTED +#ifdef PNG_WRITE_ANCILLARY_CHUNKS_SUPPORTED + +#ifdef PNG_NO_WRITE_TEXT +# define PNG_NO_WRITE_iTXt +# define PNG_NO_WRITE_tEXt +# define PNG_NO_WRITE_zTXt +#endif +#ifndef PNG_NO_WRITE_bKGD +# define PNG_WRITE_bKGD_SUPPORTED +# ifndef PNG_bKGD_SUPPORTED +# define PNG_bKGD_SUPPORTED +# endif +#endif +#ifndef PNG_NO_WRITE_cHRM +# define PNG_WRITE_cHRM_SUPPORTED +# ifndef PNG_cHRM_SUPPORTED +# define PNG_cHRM_SUPPORTED +# endif +#endif +#ifndef PNG_NO_WRITE_gAMA +# define PNG_WRITE_gAMA_SUPPORTED +# ifndef PNG_gAMA_SUPPORTED +# define PNG_gAMA_SUPPORTED +# endif +#endif +#ifndef PNG_NO_WRITE_hIST +# define PNG_WRITE_hIST_SUPPORTED +# ifndef PNG_hIST_SUPPORTED +# define PNG_hIST_SUPPORTED +# endif +#endif +#ifndef PNG_NO_WRITE_iCCP +# define PNG_WRITE_iCCP_SUPPORTED +# ifndef PNG_iCCP_SUPPORTED +# define PNG_iCCP_SUPPORTED +# endif +#endif +#ifndef PNG_NO_WRITE_iTXt +# ifndef PNG_WRITE_iTXt_SUPPORTED +# define PNG_WRITE_iTXt_SUPPORTED +# endif +# ifndef PNG_iTXt_SUPPORTED +# define PNG_iTXt_SUPPORTED +# endif +#endif +#ifndef PNG_NO_WRITE_oFFs +# define PNG_WRITE_oFFs_SUPPORTED +# ifndef PNG_oFFs_SUPPORTED +# define PNG_oFFs_SUPPORTED +# endif +#endif +#ifndef PNG_NO_WRITE_pCAL +# define PNG_WRITE_pCAL_SUPPORTED +# ifndef PNG_pCAL_SUPPORTED +# define PNG_pCAL_SUPPORTED +# endif +#endif +#ifndef PNG_NO_WRITE_sCAL +# define PNG_WRITE_sCAL_SUPPORTED +# ifndef PNG_sCAL_SUPPORTED +# define PNG_sCAL_SUPPORTED +# endif +#endif +#ifndef PNG_NO_WRITE_pHYs +# define PNG_WRITE_pHYs_SUPPORTED +# ifndef PNG_pHYs_SUPPORTED +# define PNG_pHYs_SUPPORTED +# endif +#endif +#ifndef PNG_NO_WRITE_sBIT +# define PNG_WRITE_sBIT_SUPPORTED +# ifndef PNG_sBIT_SUPPORTED +# define PNG_sBIT_SUPPORTED +# endif +#endif +#ifndef PNG_NO_WRITE_sPLT +# define PNG_WRITE_sPLT_SUPPORTED +# ifndef PNG_sPLT_SUPPORTED +# define PNG_sPLT_SUPPORTED +# endif +#endif +#ifndef PNG_NO_WRITE_sRGB +# define PNG_WRITE_sRGB_SUPPORTED +# ifndef PNG_sRGB_SUPPORTED +# define PNG_sRGB_SUPPORTED +# endif +#endif +#ifndef PNG_NO_WRITE_tEXt +# define PNG_WRITE_tEXt_SUPPORTED +# ifndef PNG_tEXt_SUPPORTED +# define PNG_tEXt_SUPPORTED +# endif +#endif +#ifndef PNG_NO_WRITE_tIME +# define PNG_WRITE_tIME_SUPPORTED +# ifndef PNG_tIME_SUPPORTED +# define PNG_tIME_SUPPORTED +# endif +#endif +#ifndef PNG_NO_WRITE_tRNS +# define PNG_WRITE_tRNS_SUPPORTED +# ifndef PNG_tRNS_SUPPORTED +# define PNG_tRNS_SUPPORTED +# endif +#endif +#ifndef PNG_NO_WRITE_zTXt +# define PNG_WRITE_zTXt_SUPPORTED +# ifndef PNG_zTXt_SUPPORTED +# define PNG_zTXt_SUPPORTED +# endif +#endif +#if defined(PNG_WRITE_iTXt_SUPPORTED) || defined(PNG_WRITE_tEXt_SUPPORTED) || \ + defined(PNG_WRITE_zTXt_SUPPORTED) +# define PNG_WRITE_TEXT_SUPPORTED +# ifndef PNG_TEXT_SUPPORTED +# define PNG_TEXT_SUPPORTED +# endif +#endif + +#ifdef PNG_WRITE_tIME_SUPPORTED +# ifndef PNG_NO_CONVERT_tIME +# ifndef _WIN32_WCE +/* The "tm" structure is not supported on WindowsCE */ +# ifndef PNG_CONVERT_tIME_SUPPORTED +# define PNG_CONVERT_tIME_SUPPORTED +# endif +# endif +# endif +#endif + +#endif /* PNG_WRITE_ANCILLARY_CHUNKS_SUPPORTED */ + +#if !defined(PNG_NO_WRITE_FILTER) && !defined(PNG_WRITE_FILTER_SUPPORTED) +# define PNG_WRITE_FILTER_SUPPORTED +#endif + +#ifndef PNG_NO_WRITE_UNKNOWN_CHUNKS +# define PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED +# ifndef PNG_UNKNOWN_CHUNKS_SUPPORTED +# define PNG_UNKNOWN_CHUNKS_SUPPORTED +# endif +#endif + +#ifndef PNG_NO_HANDLE_AS_UNKNOWN +# ifndef PNG_HANDLE_AS_UNKNOWN_SUPPORTED +# define PNG_HANDLE_AS_UNKNOWN_SUPPORTED +# endif +#endif +#endif /* PNG_WRITE_SUPPORTED */ + +/* Turn this off to disable png_read_png() and + * png_write_png() and leave the row_pointers member + * out of the info structure. + */ +#ifndef PNG_NO_INFO_IMAGE +# define PNG_INFO_IMAGE_SUPPORTED +#endif + +/* Need the time information for converting tIME chunks */ +#ifdef PNG_CONVERT_tIME_SUPPORTED + /* "time.h" functions are not supported on WindowsCE */ +# include +#endif + +/* Some typedefs to get us started. These should be safe on most of the + * common platforms. The typedefs should be at least as large as the + * numbers suggest (a png_uint_32 must be at least 32 bits long), but they + * don't have to be exactly that size. Some compilers dislike passing + * unsigned shorts as function parameters, so you may be better off using + * unsigned int for png_uint_16. Likewise, for 64-bit systems, you may + * want to have unsigned int for png_uint_32 instead of unsigned long. + */ + +typedef unsigned long png_uint_32; +typedef long png_int_32; +typedef unsigned short png_uint_16; +typedef short png_int_16; +typedef unsigned char png_byte; + +/* This is usually size_t. It is typedef'ed just in case you need it to + change (I'm not sure if you will or not, so I thought I'd be safe) */ +#ifdef PNG_SIZE_T + typedef PNG_SIZE_T png_size_t; +# define png_sizeof(x) png_convert_size(sizeof(x)) +#else + typedef size_t png_size_t; +# define png_sizeof(x) sizeof(x) +#endif + +/* The following is needed for medium model support. It cannot be in the + * PNG_INTERNAL section. Needs modification for other compilers besides + * MSC. Model independent support declares all arrays and pointers to be + * large using the far keyword. The zlib version used must also support + * model independent data. As of version zlib 1.0.4, the necessary changes + * have been made in zlib. The USE_FAR_KEYWORD define triggers other + * changes that are needed. (Tim Wegner) + */ + +/* Separate compiler dependencies (problem here is that zlib.h always + defines FAR. (SJT) */ +#ifdef __BORLANDC__ +# if defined(__LARGE__) || defined(__HUGE__) || defined(__COMPACT__) +# define LDATA 1 +# else +# define LDATA 0 +# endif + /* GRR: why is Cygwin in here? Cygwin is not Borland C... */ +# if !defined(__WIN32__) && !defined(__FLAT__) && !defined(__CYGWIN__) +# define PNG_MAX_MALLOC_64K +# if (LDATA != 1) +# ifndef FAR +# define FAR __far +# endif +# define USE_FAR_KEYWORD +# endif /* LDATA != 1 */ + /* Possibly useful for moving data out of default segment. + * Uncomment it if you want. Could also define FARDATA as + * const if your compiler supports it. (SJT) +# define FARDATA FAR + */ +# endif /* __WIN32__, __FLAT__, __CYGWIN__ */ +#endif /* __BORLANDC__ */ + + +/* Suggest testing for specific compiler first before testing for + * FAR. The Watcom compiler defines both __MEDIUM__ and M_I86MM, + * making reliance oncertain keywords suspect. (SJT) + */ + +/* MSC Medium model */ +#ifdef FAR +# ifdef M_I86MM +# define USE_FAR_KEYWORD +# define FARDATA FAR +# include +# endif +#endif + +/* SJT: default case */ +#ifndef FAR +# define FAR +#endif + +/* At this point FAR is always defined */ +#ifndef FARDATA +# define FARDATA +#endif + +/* Typedef for floating-point numbers that are converted + to fixed-point with a multiple of 100,000, e.g., int_gamma */ +typedef png_int_32 png_fixed_point; + +/* Add typedefs for pointers */ +typedef void FAR * png_voidp; +typedef png_byte FAR * png_bytep; +typedef png_uint_32 FAR * png_uint_32p; +typedef png_int_32 FAR * png_int_32p; +typedef png_uint_16 FAR * png_uint_16p; +typedef png_int_16 FAR * png_int_16p; +typedef PNG_CONST char FAR * png_const_charp; +typedef char FAR * png_charp; +typedef png_fixed_point FAR * png_fixed_point_p; + +#ifndef PNG_NO_STDIO +#ifdef _WIN32_WCE +typedef HANDLE png_FILE_p; +#else +typedef FILE * png_FILE_p; +#endif +#endif + +#ifdef PNG_FLOATING_POINT_SUPPORTED +typedef double FAR * png_doublep; +#endif + +/* Pointers to pointers; i.e. arrays */ +typedef png_byte FAR * FAR * png_bytepp; +typedef png_uint_32 FAR * FAR * png_uint_32pp; +typedef png_int_32 FAR * FAR * png_int_32pp; +typedef png_uint_16 FAR * FAR * png_uint_16pp; +typedef png_int_16 FAR * FAR * png_int_16pp; +typedef PNG_CONST char FAR * FAR * png_const_charpp; +typedef char FAR * FAR * png_charpp; +typedef png_fixed_point FAR * FAR * png_fixed_point_pp; +#ifdef PNG_FLOATING_POINT_SUPPORTED +typedef double FAR * FAR * png_doublepp; +#endif + +/* Pointers to pointers to pointers; i.e., pointer to array */ +typedef char FAR * FAR * FAR * png_charppp; + +#if defined(PNG_1_0_X) || defined(PNG_1_2_X) +/* SPC - Is this stuff deprecated? */ +/* It'll be removed as of libpng-1.4.0 - GR-P */ +/* libpng typedefs for types in zlib. If zlib changes + * or another compression library is used, then change these. + * Eliminates need to change all the source files. + */ +typedef charf * png_zcharp; +typedef charf * FAR * png_zcharpp; +typedef z_stream FAR * png_zstreamp; +#endif /* (PNG_1_0_X) || defined(PNG_1_2_X) */ + +/* + * Define PNG_BUILD_DLL if the module being built is a Windows + * LIBPNG DLL. + * + * Define PNG_USE_DLL if you want to *link* to the Windows LIBPNG DLL. + * It is equivalent to Microsoft predefined macro _DLL that is + * automatically defined when you compile using the share + * version of the CRT (C Run-Time library) + * + * The cygwin mods make this behavior a little different: + * Define PNG_BUILD_DLL if you are building a dll for use with cygwin + * Define PNG_STATIC if you are building a static library for use with cygwin, + * -or- if you are building an application that you want to link to the + * static library. + * PNG_USE_DLL is defined by default (no user action needed) unless one of + * the other flags is defined. + */ + +#if !defined(PNG_DLL) && (defined(PNG_BUILD_DLL) || defined(PNG_USE_DLL)) +# define PNG_DLL +#endif +/* If CYGWIN, then disallow GLOBAL ARRAYS unless building a static lib. + * When building a static lib, default to no GLOBAL ARRAYS, but allow + * command-line override + */ +#ifdef __CYGWIN__ +# ifndef PNG_STATIC +# ifdef PNG_USE_GLOBAL_ARRAYS +# undef PNG_USE_GLOBAL_ARRAYS +# endif +# ifndef PNG_USE_LOCAL_ARRAYS +# define PNG_USE_LOCAL_ARRAYS +# endif +# else +# if defined(PNG_USE_LOCAL_ARRAYS) || defined(PNG_NO_GLOBAL_ARRAYS) +# ifdef PNG_USE_GLOBAL_ARRAYS +# undef PNG_USE_GLOBAL_ARRAYS +# endif +# endif +# endif +# if !defined(PNG_USE_LOCAL_ARRAYS) && !defined(PNG_USE_GLOBAL_ARRAYS) +# define PNG_USE_LOCAL_ARRAYS +# endif +#endif + +/* Do not use global arrays (helps with building DLL's) + * They are no longer used in libpng itself, since version 1.0.5c, + * but might be required for some pre-1.0.5c applications. + */ +#if !defined(PNG_USE_LOCAL_ARRAYS) && !defined(PNG_USE_GLOBAL_ARRAYS) +# if defined(PNG_NO_GLOBAL_ARRAYS) || \ + (defined(__GNUC__) && defined(PNG_DLL)) || defined(_MSC_VER) +# define PNG_USE_LOCAL_ARRAYS +# else +# define PNG_USE_GLOBAL_ARRAYS +# endif +#endif + +#ifdef __CYGWIN__ +# undef PNGAPI +# define PNGAPI __cdecl +# undef PNG_IMPEXP +# define PNG_IMPEXP +#endif + +/* If you define PNGAPI, e.g., with compiler option "-DPNGAPI=__stdcall", + * you may get warnings regarding the linkage of png_zalloc and png_zfree. + * Don't ignore those warnings; you must also reset the default calling + * convention in your compiler to match your PNGAPI, and you must build + * zlib and your applications the same way you build libpng. + */ + +#if defined(__MINGW32__) && !defined(PNG_MODULEDEF) +# ifndef PNG_NO_MODULEDEF +# define PNG_NO_MODULEDEF +# endif +#endif + +#if !defined(PNG_IMPEXP) && defined(PNG_BUILD_DLL) && !defined(PNG_NO_MODULEDEF) +# define PNG_IMPEXP +#endif + +#if defined(PNG_DLL) || defined(_DLL) || defined(__DLL__ ) || \ + (( defined(_Windows) || defined(_WINDOWS) || \ + defined(WIN32) || defined(_WIN32) || defined(__WIN32__) )) + +# ifndef PNGAPI +# if defined(__GNUC__) || (defined (_MSC_VER) && (_MSC_VER >= 800)) +# define PNGAPI __cdecl +# else +# define PNGAPI _cdecl +# endif +# endif + +# if !defined(PNG_IMPEXP) && (!defined(PNG_DLL) || \ + 0 /* WINCOMPILER_WITH_NO_SUPPORT_FOR_DECLIMPEXP */) +# define PNG_IMPEXP +# endif + +# ifndef PNG_IMPEXP + +# define PNG_EXPORT_TYPE1(type,symbol) PNG_IMPEXP type PNGAPI symbol +# define PNG_EXPORT_TYPE2(type,symbol) type PNG_IMPEXP PNGAPI symbol + + /* Borland/Microsoft */ +# if defined(_MSC_VER) || defined(__BORLANDC__) +# if (_MSC_VER >= 800) || (__BORLANDC__ >= 0x500) +# define PNG_EXPORT PNG_EXPORT_TYPE1 +# else +# define PNG_EXPORT PNG_EXPORT_TYPE2 +# ifdef PNG_BUILD_DLL +# define PNG_IMPEXP __export +# else +# define PNG_IMPEXP /*__import */ /* doesn't exist AFAIK in + VC++ */ +# endif /* Exists in Borland C++ for + C++ classes (== huge) */ +# endif +# endif + +# ifndef PNG_IMPEXP +# ifdef PNG_BUILD_DLL +# define PNG_IMPEXP __declspec(dllexport) +# else +# define PNG_IMPEXP __declspec(dllimport) +# endif +# endif +# endif /* PNG_IMPEXP */ +#else /* !(DLL || non-cygwin WINDOWS) */ +# if (defined(__IBMC__) || defined(__IBMCPP__)) && defined(__OS2__) +# ifndef PNGAPI +# define PNGAPI _System +# endif +# else +# if 0 /* ... other platforms, with other meanings */ +# endif +# endif +#endif + +#ifndef PNGAPI +# define PNGAPI +#endif +#ifndef PNG_IMPEXP +# define PNG_IMPEXP +#endif + +#ifdef PNG_BUILDSYMS +# ifndef PNG_EXPORT +# define PNG_EXPORT(type,symbol) PNG_FUNCTION_EXPORT symbol END +# endif +# ifdef PNG_USE_GLOBAL_ARRAYS +# ifndef PNG_EXPORT_VAR +# define PNG_EXPORT_VAR(type) PNG_DATA_EXPORT +# endif +# endif +#endif + +#ifndef PNG_EXPORT +# define PNG_EXPORT(type,symbol) PNG_IMPEXP type PNGAPI symbol +#endif + +#ifdef PNG_USE_GLOBAL_ARRAYS +# ifndef PNG_EXPORT_VAR +# define PNG_EXPORT_VAR(type) extern PNG_IMPEXP type +# endif +#endif + +#ifdef PNG_PEDANTIC_WARNINGS +# ifndef PNG_PEDANTIC_WARNINGS_SUPPORTED +# define PNG_PEDANTIC_WARNINGS_SUPPORTED +# endif +#endif + +#ifdef PNG_PEDANTIC_WARNINGS_SUPPORTED +/* Support for compiler specific function attributes. These are used + * so that where compiler support is available incorrect use of API + * functions in png.h will generate compiler warnings. Added at libpng + * version 1.2.41. + */ +# ifdef __GNUC__ +# ifndef PNG_USE_RESULT +# define PNG_USE_RESULT __attribute__((__warn_unused_result__)) +# endif +# ifndef PNG_NORETURN +# define PNG_NORETURN __attribute__((__noreturn__)) +# endif +# ifndef PNG_ALLOCATED +# define PNG_ALLOCATED __attribute__((__malloc__)) +# endif + + /* This specifically protects structure members that should only be + * accessed from within the library, therefore should be empty during + * a library build. + */ +# ifndef PNG_DEPRECATED +# define PNG_DEPRECATED __attribute__((__deprecated__)) +# endif +# ifndef PNG_DEPSTRUCT +# define PNG_DEPSTRUCT __attribute__((__deprecated__)) +# endif +# ifndef PNG_PRIVATE +# if 0 /* Doesn't work so we use deprecated instead*/ +# define PNG_PRIVATE \ + __attribute__((warning("This function is not exported by libpng."))) +# else +# define PNG_PRIVATE \ + __attribute__((__deprecated__)) +# endif +# endif /* PNG_PRIVATE */ +# endif /* __GNUC__ */ +#endif /* PNG_PEDANTIC_WARNINGS */ + +#ifndef PNG_DEPRECATED +# define PNG_DEPRECATED /* Use of this function is deprecated */ +#endif +#ifndef PNG_USE_RESULT +# define PNG_USE_RESULT /* The result of this function must be checked */ +#endif +#ifndef PNG_NORETURN +# define PNG_NORETURN /* This function does not return */ +#endif +#ifndef PNG_ALLOCATED +# define PNG_ALLOCATED /* The result of the function is new memory */ +#endif +#ifndef PNG_DEPSTRUCT +# define PNG_DEPSTRUCT /* Access to this struct member is deprecated */ +#endif +#ifndef PNG_PRIVATE +# define PNG_PRIVATE /* This is a private libpng function */ +#endif + +/* User may want to use these so they are not in PNG_INTERNAL. Any library + * functions that are passed far data must be model independent. + */ + +#ifndef PNG_ABORT +# define PNG_ABORT() abort() +#endif + +#ifdef PNG_SETJMP_SUPPORTED +# define png_jmpbuf(png_ptr) ((png_ptr)->jmpbuf) +#else +# define png_jmpbuf(png_ptr) \ + (LIBPNG_WAS_COMPILED_WITH__PNG_SETJMP_NOT_SUPPORTED) +#endif + +#ifdef USE_FAR_KEYWORD /* memory model independent fns */ +/* Use this to make far-to-near assignments */ +# define CHECK 1 +# define NOCHECK 0 +# define CVT_PTR(ptr) (png_far_to_near(png_ptr,ptr,CHECK)) +# define CVT_PTR_NOCHECK(ptr) (png_far_to_near(png_ptr,ptr,NOCHECK)) +# define png_snprintf _fsnprintf /* Added to v 1.2.19 */ +# define png_strlen _fstrlen +# define png_memcmp _fmemcmp /* SJT: added */ +# define png_memcpy _fmemcpy +# define png_memset _fmemset +#else /* Use the usual functions */ +# define CVT_PTR(ptr) (ptr) +# define CVT_PTR_NOCHECK(ptr) (ptr) +# ifndef PNG_NO_SNPRINTF +# ifdef _MSC_VER +# define png_snprintf _snprintf /* Added to v 1.2.19 */ +# define png_snprintf2 _snprintf +# define png_snprintf6 _snprintf +# else +# define png_snprintf snprintf /* Added to v 1.2.19 */ +# define png_snprintf2 snprintf +# define png_snprintf6 snprintf +# endif +# else + /* You don't have or don't want to use snprintf(). Caution: Using + * sprintf instead of snprintf exposes your application to accidental + * or malevolent buffer overflows. If you don't have snprintf() + * as a general rule you should provide one (you can get one from + * Portable OpenSSH). + */ +# define png_snprintf(s1,n,fmt,x1) sprintf(s1,fmt,x1) +# define png_snprintf2(s1,n,fmt,x1,x2) sprintf(s1,fmt,x1,x2) +# define png_snprintf6(s1,n,fmt,x1,x2,x3,x4,x5,x6) \ + sprintf(s1,fmt,x1,x2,x3,x4,x5,x6) +# endif +# define png_strlen strlen +# define png_memcmp memcmp /* SJT: added */ +# define png_memcpy memcpy +# define png_memset memset +#endif +/* End of memory model independent support */ + +/* Just a little check that someone hasn't tried to define something + * contradictory. + */ +#if (PNG_ZBUF_SIZE > 65536L) && defined(PNG_MAX_MALLOC_64K) +# undef PNG_ZBUF_SIZE +# define PNG_ZBUF_SIZE 65536L +#endif + +/* Added at libpng-1.2.8 */ +#endif /* PNG_VERSION_INFO_ONLY */ + +#endif /* PNGCONF_H */ diff --git a/src/libpng/pngerror.c b/external/libpng/pngerror.c similarity index 100% rename from src/libpng/pngerror.c rename to external/libpng/pngerror.c diff --git a/src/libpng/pnggccrd.c b/external/libpng/pnggccrd.c similarity index 100% rename from src/libpng/pnggccrd.c rename to external/libpng/pnggccrd.c diff --git a/src/libpng/pngget.c b/external/libpng/pngget.c similarity index 100% rename from src/libpng/pngget.c rename to external/libpng/pngget.c diff --git a/src/libpng/pngmem.c b/external/libpng/pngmem.c similarity index 100% rename from src/libpng/pngmem.c rename to external/libpng/pngmem.c diff --git a/src/libpng/pngnow.png b/external/libpng/pngnow.png similarity index 100% rename from src/libpng/pngnow.png rename to external/libpng/pngnow.png diff --git a/src/libpng/pngpread.c b/external/libpng/pngpread.c similarity index 100% rename from src/libpng/pngpread.c rename to external/libpng/pngpread.c diff --git a/src/libpng/pngread.c b/external/libpng/pngread.c similarity index 100% rename from src/libpng/pngread.c rename to external/libpng/pngread.c diff --git a/src/libpng/pngrio.c b/external/libpng/pngrio.c similarity index 100% rename from src/libpng/pngrio.c rename to external/libpng/pngrio.c diff --git a/src/libpng/pngrtran.c b/external/libpng/pngrtran.c similarity index 100% rename from src/libpng/pngrtran.c rename to external/libpng/pngrtran.c diff --git a/src/libpng/pngrutil.c b/external/libpng/pngrutil.c similarity index 100% rename from src/libpng/pngrutil.c rename to external/libpng/pngrutil.c diff --git a/src/libpng/pngset.c b/external/libpng/pngset.c similarity index 100% rename from src/libpng/pngset.c rename to external/libpng/pngset.c diff --git a/external/libpng/pngtest.c b/external/libpng/pngtest.c new file mode 100644 index 0000000..1b5a5f9 --- /dev/null +++ b/external/libpng/pngtest.c @@ -0,0 +1,1705 @@ + +/* pngtest.c - a simple test program to test libpng + * + * Last changed in libpng 1.2.43 [February 25, 2010] + * Copyright (c) 1998-2010 Glenn Randers-Pehrson + * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) + * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) + * + * This code is released under the libpng license. + * For conditions of distribution and use, see the disclaimer + * and license in png.h + * + * This program reads in a PNG image, writes it out again, and then + * compares the two files. If the files are identical, this shows that + * the basic chunk handling, filtering, and (de)compression code is working + * properly. It does not currently test all of the transforms, although + * it probably should. + * + * The program will report "FAIL" in certain legitimate cases: + * 1) when the compression level or filter selection method is changed. + * 2) when the maximum IDAT size (PNG_ZBUF_SIZE in pngconf.h) is not 8192. + * 3) unknown unsafe-to-copy ancillary chunks or unknown critical chunks + * exist in the input file. + * 4) others not listed here... + * In these cases, it is best to check with another tool such as "pngcheck" + * to see what the differences between the two files are. + * + * If a filename is given on the command-line, then this file is used + * for the input, rather than the default "pngtest.png". This allows + * testing a wide variety of files easily. You can also test a number + * of files at once by typing "pngtest -m file1.png file2.png ..." + */ + +#define PNG_PEDANTIC_WARNINGS +#include "png.h" + +#ifdef _WIN32_WCE +# if _WIN32_WCE < 211 + __error__ (f|w)printf functions are not supported on old WindowsCE.; +# endif +# include +# include +# define READFILE(file, data, length, check) \ + if (ReadFile(file, data, length, &check, NULL)) check = 0 +# define WRITEFILE(file, data, length, check)) \ + if (WriteFile(file, data, length, &check, NULL)) check = 0 +# define FCLOSE(file) CloseHandle(file) +#else +# include +# include +# define READFILE(file, data, length, check) \ + check=(png_size_t)fread(data, (png_size_t)1, length, file) +# define WRITEFILE(file, data, length, check) \ + check=(png_size_t)fwrite(data, (png_size_t)1, length, file) +# define FCLOSE(file) fclose(file) +#endif + +#ifndef PNG_STDIO_SUPPORTED +# ifdef _WIN32_WCE + typedef HANDLE png_FILE_p; +# else + typedef FILE * png_FILE_p; +# endif +#endif + +/* Makes pngtest verbose so we can find problems (needs to be before png.h) */ +#ifndef PNG_DEBUG +# define PNG_DEBUG 0 +#endif + +#if !PNG_DEBUG +# define SINGLE_ROWBUF_ALLOC /* Makes buffer overruns easier to nail */ +#endif + +/* Turn on CPU timing +#define PNGTEST_TIMING +*/ + +#ifndef PNG_FLOATING_POINT_SUPPORTED +#undef PNGTEST_TIMING +#endif + +#ifdef PNGTEST_TIMING +static float t_start, t_stop, t_decode, t_encode, t_misc; +#include +#endif + +#ifdef PNG_TIME_RFC1123_SUPPORTED +#define PNG_tIME_STRING_LENGTH 29 +static int tIME_chunk_present = 0; +static char tIME_string[PNG_tIME_STRING_LENGTH] = "tIME chunk is not present"; +#endif + +static int verbose = 0; + +int test_one_file PNGARG((PNG_CONST char *inname, PNG_CONST char *outname)); + +#ifdef __TURBOC__ +#include +#endif + +/* Defined so I can write to a file on gui/windowing platforms */ +/* #define STDERR stderr */ +#define STDERR stdout /* For DOS */ + +/* In case a system header (e.g., on AIX) defined jmpbuf */ +#ifdef jmpbuf +# undef jmpbuf +#endif + +/* Define png_jmpbuf() in case we are using a pre-1.0.6 version of libpng */ +#ifndef png_jmpbuf +# define png_jmpbuf(png_ptr) png_ptr->jmpbuf +#endif + +/* Example of using row callbacks to make a simple progress meter */ +static int status_pass = 1; +static int status_dots_requested = 0; +static int status_dots = 1; + +void +#ifdef PNG_1_0_X +PNGAPI +#endif +read_row_callback(png_structp png_ptr, png_uint_32 row_number, int pass); +void +#ifdef PNG_1_0_X +PNGAPI +#endif +read_row_callback(png_structp png_ptr, png_uint_32 row_number, int pass) +{ + if (png_ptr == NULL || row_number > PNG_UINT_31_MAX) + return; + if (status_pass != pass) + { + fprintf(stdout, "\n Pass %d: ", pass); + status_pass = pass; + status_dots = 31; + } + status_dots--; + if (status_dots == 0) + { + fprintf(stdout, "\n "); + status_dots=30; + } + fprintf(stdout, "r"); +} + +void +#ifdef PNG_1_0_X +PNGAPI +#endif +write_row_callback(png_structp png_ptr, png_uint_32 row_number, int pass); +void +#ifdef PNG_1_0_X +PNGAPI +#endif +write_row_callback(png_structp png_ptr, png_uint_32 row_number, int pass) +{ + if (png_ptr == NULL || row_number > PNG_UINT_31_MAX || pass > 7) + return; + fprintf(stdout, "w"); +} + + +#ifdef PNG_READ_USER_TRANSFORM_SUPPORTED +/* Example of using user transform callback (we don't transform anything, + * but merely examine the row filters. We set this to 256 rather than + * 5 in case illegal filter values are present.) + */ +static png_uint_32 filters_used[256]; +void +#ifdef PNG_1_0_X +PNGAPI +#endif +count_filters(png_structp png_ptr, png_row_infop row_info, png_bytep data); +void +#ifdef PNG_1_0_X +PNGAPI +#endif +count_filters(png_structp png_ptr, png_row_infop row_info, png_bytep data) +{ + if (png_ptr != NULL && row_info != NULL) + ++filters_used[*(data - 1)]; +} +#endif + +#ifdef PNG_WRITE_USER_TRANSFORM_SUPPORTED +/* Example of using user transform callback (we don't transform anything, + * but merely count the zero samples) + */ + +static png_uint_32 zero_samples; + +void +#ifdef PNG_1_0_X +PNGAPI +#endif +count_zero_samples(png_structp png_ptr, png_row_infop row_info, png_bytep data); +void +#ifdef PNG_1_0_X +PNGAPI +#endif +count_zero_samples(png_structp png_ptr, png_row_infop row_info, png_bytep data) +{ + png_bytep dp = data; + if (png_ptr == NULL)return; + + /* Contents of row_info: + * png_uint_32 width width of row + * png_uint_32 rowbytes number of bytes in row + * png_byte color_type color type of pixels + * png_byte bit_depth bit depth of samples + * png_byte channels number of channels (1-4) + * png_byte pixel_depth bits per pixel (depth*channels) + */ + + /* Counts the number of zero samples (or zero pixels if color_type is 3 */ + + if (row_info->color_type == 0 || row_info->color_type == 3) + { + int pos = 0; + png_uint_32 n, nstop; + for (n = 0, nstop=row_info->width; nbit_depth == 1) + { + if (((*dp << pos++ ) & 0x80) == 0) + zero_samples++; + if (pos == 8) + { + pos = 0; + dp++; + } + } + if (row_info->bit_depth == 2) + { + if (((*dp << (pos+=2)) & 0xc0) == 0) + zero_samples++; + if (pos == 8) + { + pos = 0; + dp++; + } + } + if (row_info->bit_depth == 4) + { + if (((*dp << (pos+=4)) & 0xf0) == 0) + zero_samples++; + if (pos == 8) + { + pos = 0; + dp++; + } + } + if (row_info->bit_depth == 8) + if (*dp++ == 0) + zero_samples++; + if (row_info->bit_depth == 16) + { + if ((*dp | *(dp+1)) == 0) + zero_samples++; + dp+=2; + } + } + } + else /* Other color types */ + { + png_uint_32 n, nstop; + int channel; + int color_channels = row_info->channels; + if (row_info->color_type > 3)color_channels--; + + for (n = 0, nstop=row_info->width; nbit_depth == 8) + if (*dp++ == 0) + zero_samples++; + if (row_info->bit_depth == 16) + { + if ((*dp | *(dp+1)) == 0) + zero_samples++; + dp+=2; + } + } + if (row_info->color_type > 3) + { + dp++; + if (row_info->bit_depth == 16) + dp++; + } + } + } +} +#endif /* PNG_WRITE_USER_TRANSFORM_SUPPORTED */ + +static int wrote_question = 0; + +#ifndef PNG_STDIO_SUPPORTED +/* START of code to validate stdio-free compilation */ +/* These copies of the default read/write functions come from pngrio.c and + * pngwio.c. They allow "don't include stdio" testing of the library. + * This is the function that does the actual reading of data. If you are + * not reading from a standard C stream, you should create a replacement + * read_data function and use it at run time with png_set_read_fn(), rather + * than changing the library. + */ + +#ifndef USE_FAR_KEYWORD +static void +pngtest_read_data(png_structp png_ptr, png_bytep data, png_size_t length) +{ + png_size_t check = 0; + png_voidp io_ptr; + + /* fread() returns 0 on error, so it is OK to store this in a png_size_t + * instead of an int, which is what fread() actually returns. + */ + io_ptr = png_get_io_ptr(png_ptr); + if (io_ptr != NULL) + { + READFILE((png_FILE_p)io_ptr, data, length, check); + } + + if (check != length) + { + png_error(png_ptr, "Read Error!"); + } +} +#else +/* This is the model-independent version. Since the standard I/O library + can't handle far buffers in the medium and small models, we have to copy + the data. +*/ + +#define NEAR_BUF_SIZE 1024 +#define MIN(a,b) (a <= b ? a : b) + +static void +pngtest_read_data(png_structp png_ptr, png_bytep data, png_size_t length) +{ + int check; + png_byte *n_data; + png_FILE_p io_ptr; + + /* Check if data really is near. If so, use usual code. */ + n_data = (png_byte *)CVT_PTR_NOCHECK(data); + io_ptr = (png_FILE_p)CVT_PTR(png_ptr->io_ptr); + if ((png_bytep)n_data == data) + { + READFILE(io_ptr, n_data, length, check); + } + else + { + png_byte buf[NEAR_BUF_SIZE]; + png_size_t read, remaining, err; + check = 0; + remaining = length; + do + { + read = MIN(NEAR_BUF_SIZE, remaining); + READFILE(io_ptr, buf, 1, err); + png_memcpy(data, buf, read); /* Copy far buffer to near buffer */ + if (err != read) + break; + else + check += err; + data += read; + remaining -= read; + } + while (remaining != 0); + } + if (check != length) + png_error(png_ptr, "read Error"); +} +#endif /* USE_FAR_KEYWORD */ + +#ifdef PNG_WRITE_FLUSH_SUPPORTED +static void +pngtest_flush(png_structp png_ptr) +{ + /* Do nothing; fflush() is said to be just a waste of energy. */ + png_ptr = png_ptr; /* Stifle compiler warning */ +} +#endif + +/* This is the function that does the actual writing of data. If you are + * not writing to a standard C stream, you should create a replacement + * write_data function and use it at run time with png_set_write_fn(), rather + * than changing the library. + */ +#ifndef USE_FAR_KEYWORD +static void +pngtest_write_data(png_structp png_ptr, png_bytep data, png_size_t length) +{ + png_uint_32 check; + + WRITEFILE((png_FILE_p)png_ptr->io_ptr, data, length, check); + if (check != length) + { + png_error(png_ptr, "Write Error"); + } +} +#else +/* This is the model-independent version. Since the standard I/O library + can't handle far buffers in the medium and small models, we have to copy + the data. +*/ + +#define NEAR_BUF_SIZE 1024 +#define MIN(a,b) (a <= b ? a : b) + +static void +pngtest_write_data(png_structp png_ptr, png_bytep data, png_size_t length) +{ + png_uint_32 check; + png_byte *near_data; /* Needs to be "png_byte *" instead of "png_bytep" */ + png_FILE_p io_ptr; + + /* Check if data really is near. If so, use usual code. */ + near_data = (png_byte *)CVT_PTR_NOCHECK(data); + io_ptr = (png_FILE_p)CVT_PTR(png_ptr->io_ptr); + if ((png_bytep)near_data == data) + { + WRITEFILE(io_ptr, near_data, length, check); + } + else + { + png_byte buf[NEAR_BUF_SIZE]; + png_size_t written, remaining, err; + check = 0; + remaining = length; + do + { + written = MIN(NEAR_BUF_SIZE, remaining); + png_memcpy(buf, data, written); /* Copy far buffer to near buffer */ + WRITEFILE(io_ptr, buf, written, err); + if (err != written) + break; + else + check += err; + data += written; + remaining -= written; + } + while (remaining != 0); + } + if (check != length) + { + png_error(png_ptr, "Write Error"); + } +} +#endif /* USE_FAR_KEYWORD */ + +/* This function is called when there is a warning, but the library thinks + * it can continue anyway. Replacement functions don't have to do anything + * here if you don't want to. In the default configuration, png_ptr is + * not used, but it is passed in case it may be useful. + */ +static void +pngtest_warning(png_structp png_ptr, png_const_charp message) +{ + PNG_CONST char *name = "UNKNOWN (ERROR!)"; + char *test; + test = png_get_error_ptr(png_ptr); + if (test == NULL) + fprintf(STDERR, "%s: libpng warning: %s\n", name, message); + else + fprintf(STDERR, "%s: libpng warning: %s\n", test, message); +} + +/* This is the default error handling function. Note that replacements for + * this function MUST NOT RETURN, or the program will likely crash. This + * function is used by default, or if the program supplies NULL for the + * error function pointer in png_set_error_fn(). + */ +static void +pngtest_error(png_structp png_ptr, png_const_charp message) +{ + pngtest_warning(png_ptr, message); + /* We can return because png_error calls the default handler, which is + * actually OK in this case. + */ +} +#endif /* !PNG_STDIO_SUPPORTED */ +/* END of code to validate stdio-free compilation */ + +/* START of code to validate memory allocation and deallocation */ +#if defined(PNG_USER_MEM_SUPPORTED) && PNG_DEBUG + +/* Allocate memory. For reasonable files, size should never exceed + * 64K. However, zlib may allocate more then 64K if you don't tell + * it not to. See zconf.h and png.h for more information. zlib does + * need to allocate exactly 64K, so whatever you call here must + * have the ability to do that. + * + * This piece of code can be compiled to validate max 64K allocations + * by setting MAXSEG_64K in zlib zconf.h *or* PNG_MAX_MALLOC_64K. + */ +typedef struct memory_information +{ + png_uint_32 size; + png_voidp pointer; + struct memory_information FAR *next; +} memory_information; +typedef memory_information FAR *memory_infop; + +static memory_infop pinformation = NULL; +static int current_allocation = 0; +static int maximum_allocation = 0; +static int total_allocation = 0; +static int num_allocations = 0; + +png_voidp png_debug_malloc PNGARG((png_structp png_ptr, png_uint_32 size)); +void png_debug_free PNGARG((png_structp png_ptr, png_voidp ptr)); + +png_voidp +png_debug_malloc(png_structp png_ptr, png_uint_32 size) +{ + + /* png_malloc has already tested for NULL; png_create_struct calls + * png_debug_malloc directly, with png_ptr == NULL which is OK + */ + + if (size == 0) + return (NULL); + + /* This calls the library allocator twice, once to get the requested + buffer and once to get a new free list entry. */ + { + /* Disable malloc_fn and free_fn */ + memory_infop pinfo; + png_set_mem_fn(png_ptr, NULL, NULL, NULL); + pinfo = (memory_infop)png_malloc(png_ptr, + (png_uint_32)png_sizeof(*pinfo)); + pinfo->size = size; + current_allocation += size; + total_allocation += size; + num_allocations ++; + if (current_allocation > maximum_allocation) + maximum_allocation = current_allocation; + pinfo->pointer = (png_voidp)png_malloc(png_ptr, size); + /* Restore malloc_fn and free_fn */ + png_set_mem_fn(png_ptr, + png_voidp_NULL, (png_malloc_ptr)png_debug_malloc, + (png_free_ptr)png_debug_free); + if (size != 0 && pinfo->pointer == NULL) + { + current_allocation -= size; + total_allocation -= size; + png_error(png_ptr, + "out of memory in pngtest->png_debug_malloc."); + } + pinfo->next = pinformation; + pinformation = pinfo; + /* Make sure the caller isn't assuming zeroed memory. */ + png_memset(pinfo->pointer, 0xdd, pinfo->size); + if (verbose) + printf("png_malloc %lu bytes at %x\n", (unsigned long)size, + pinfo->pointer); + return (png_voidp)(pinfo->pointer); + } +} + +/* Free a pointer. It is removed from the list at the same time. */ +void +png_debug_free(png_structp png_ptr, png_voidp ptr) +{ + if (png_ptr == NULL) + fprintf(STDERR, "NULL pointer to png_debug_free.\n"); + if (ptr == 0) + { +#if 0 /* This happens all the time. */ + fprintf(STDERR, "WARNING: freeing NULL pointer\n"); +#endif + return; + } + + /* Unlink the element from the list. */ + { + memory_infop FAR *ppinfo = &pinformation; + for (;;) + { + memory_infop pinfo = *ppinfo; + if (pinfo->pointer == ptr) + { + *ppinfo = pinfo->next; + current_allocation -= pinfo->size; + if (current_allocation < 0) + fprintf(STDERR, "Duplicate free of memory\n"); + /* We must free the list element too, but first kill + the memory that is to be freed. */ + png_memset(ptr, 0x55, pinfo->size); + png_free_default(png_ptr, pinfo); + pinfo = NULL; + break; + } + if (pinfo->next == NULL) + { + fprintf(STDERR, "Pointer %x not found\n", (unsigned int)ptr); + break; + } + ppinfo = &pinfo->next; + } + } + + /* Finally free the data. */ + if (verbose) + printf("Freeing %x\n", ptr); + png_free_default(png_ptr, ptr); + ptr = NULL; +} +#endif /* PNG_USER_MEM_SUPPORTED && PNG_DEBUG */ +/* END of code to test memory allocation/deallocation */ + + +/* Demonstration of user chunk support of the sTER and vpAg chunks */ +#ifdef PNG_UNKNOWN_CHUNKS_SUPPORTED + +/* (sTER is a public chunk not yet known by libpng. vpAg is a private +chunk used in ImageMagick to store "virtual page" size). */ + +static png_uint_32 user_chunk_data[4]; + + /* 0: sTER mode + 1 + * 1: vpAg width + * 2: vpAg height + * 3: vpAg units + */ + +static int read_user_chunk_callback(png_struct *png_ptr, + png_unknown_chunkp chunk) +{ + png_uint_32 + *my_user_chunk_data; + + /* Return one of the following: + * return (-n); chunk had an error + * return (0); did not recognize + * return (n); success + * + * The unknown chunk structure contains the chunk data: + * png_byte name[5]; + * png_byte *data; + * png_size_t size; + * + * Note that libpng has already taken care of the CRC handling. + */ + + if (chunk->name[0] == 115 && chunk->name[1] == 84 && /* s T */ + chunk->name[2] == 69 && chunk->name[3] == 82) /* E R */ + { + /* Found sTER chunk */ + if (chunk->size != 1) + return (-1); /* Error return */ + if (chunk->data[0] != 0 && chunk->data[0] != 1) + return (-1); /* Invalid mode */ + my_user_chunk_data=(png_uint_32 *) png_get_user_chunk_ptr(png_ptr); + my_user_chunk_data[0]=chunk->data[0]+1; + return (1); + } + + if (chunk->name[0] != 118 || chunk->name[1] != 112 || /* v p */ + chunk->name[2] != 65 || chunk->name[3] != 103) /* A g */ + return (0); /* Did not recognize */ + + /* Found ImageMagick vpAg chunk */ + + if (chunk->size != 9) + return (-1); /* Error return */ + + my_user_chunk_data=(png_uint_32 *) png_get_user_chunk_ptr(png_ptr); + + my_user_chunk_data[1]=png_get_uint_31(png_ptr, chunk->data); + my_user_chunk_data[2]=png_get_uint_31(png_ptr, chunk->data + 4); + my_user_chunk_data[3]=(png_uint_32)chunk->data[8]; + + return (1); + +} +#endif +/* END of code to demonstrate user chunk support */ + +/* Test one file */ +int +test_one_file(PNG_CONST char *inname, PNG_CONST char *outname) +{ + static png_FILE_p fpin; + static png_FILE_p fpout; /* "static" prevents setjmp corruption */ + png_structp read_ptr; + png_infop read_info_ptr, end_info_ptr; +#ifdef PNG_WRITE_SUPPORTED + png_structp write_ptr; + png_infop write_info_ptr; + png_infop write_end_info_ptr; +#else + png_structp write_ptr = NULL; + png_infop write_info_ptr = NULL; + png_infop write_end_info_ptr = NULL; +#endif + png_bytep row_buf; + png_uint_32 y; + png_uint_32 width, height; + int num_pass, pass; + int bit_depth, color_type; +#ifdef PNG_SETJMP_SUPPORTED +#ifdef USE_FAR_KEYWORD + jmp_buf jmpbuf; +#endif +#endif + +#ifdef _WIN32_WCE + TCHAR path[MAX_PATH]; +#endif + char inbuf[256], outbuf[256]; + + row_buf = NULL; + +#ifdef _WIN32_WCE + MultiByteToWideChar(CP_ACP, 0, inname, -1, path, MAX_PATH); + if ((fpin = CreateFile(path, GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, + NULL)) == INVALID_HANDLE_VALUE) +#else + if ((fpin = fopen(inname, "rb")) == NULL) +#endif + { + fprintf(STDERR, "Could not find input file %s\n", inname); + return (1); + } + +#ifdef _WIN32_WCE + MultiByteToWideChar(CP_ACP, 0, outname, -1, path, MAX_PATH); + if ((fpout = CreateFile(path, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, + 0, NULL)) == INVALID_HANDLE_VALUE) +#else + if ((fpout = fopen(outname, "wb")) == NULL) +#endif + { + fprintf(STDERR, "Could not open output file %s\n", outname); + FCLOSE(fpin); + return (1); + } + + png_debug(0, "Allocating read and write structures"); +#if defined(PNG_USER_MEM_SUPPORTED) && PNG_DEBUG + read_ptr = + png_create_read_struct_2(PNG_LIBPNG_VER_STRING, png_voidp_NULL, + png_error_ptr_NULL, png_error_ptr_NULL, png_voidp_NULL, + (png_malloc_ptr)png_debug_malloc, (png_free_ptr)png_debug_free); +#else + read_ptr = + png_create_read_struct(PNG_LIBPNG_VER_STRING, png_voidp_NULL, + png_error_ptr_NULL, png_error_ptr_NULL); +#endif +#ifndef PNG_STDIO_SUPPORTED + png_set_error_fn(read_ptr, (png_voidp)inname, pngtest_error, + pngtest_warning); +#endif + +#ifdef PNG_UNKNOWN_CHUNKS_SUPPORTED + user_chunk_data[0] = 0; + user_chunk_data[1] = 0; + user_chunk_data[2] = 0; + user_chunk_data[3] = 0; + png_set_read_user_chunk_fn(read_ptr, user_chunk_data, + read_user_chunk_callback); + +#endif +#ifdef PNG_WRITE_SUPPORTED +#if defined(PNG_USER_MEM_SUPPORTED) && PNG_DEBUG + write_ptr = + png_create_write_struct_2(PNG_LIBPNG_VER_STRING, png_voidp_NULL, + png_error_ptr_NULL, png_error_ptr_NULL, png_voidp_NULL, + (png_malloc_ptr)png_debug_malloc, (png_free_ptr)png_debug_free); +#else + write_ptr = + png_create_write_struct(PNG_LIBPNG_VER_STRING, png_voidp_NULL, + png_error_ptr_NULL, png_error_ptr_NULL); +#endif +#ifndef PNG_STDIO_SUPPORTED + png_set_error_fn(write_ptr, (png_voidp)inname, pngtest_error, + pngtest_warning); +#endif +#endif + png_debug(0, "Allocating read_info, write_info and end_info structures"); + read_info_ptr = png_create_info_struct(read_ptr); + end_info_ptr = png_create_info_struct(read_ptr); +#ifdef PNG_WRITE_SUPPORTED + write_info_ptr = png_create_info_struct(write_ptr); + write_end_info_ptr = png_create_info_struct(write_ptr); +#endif + +#ifdef PNG_SETJMP_SUPPORTED + png_debug(0, "Setting jmpbuf for read struct"); +#ifdef USE_FAR_KEYWORD + if (setjmp(jmpbuf)) +#else + if (setjmp(png_jmpbuf(read_ptr))) +#endif + { + fprintf(STDERR, "%s -> %s: libpng read error\n", inname, outname); + png_free(read_ptr, row_buf); + row_buf = NULL; + png_destroy_read_struct(&read_ptr, &read_info_ptr, &end_info_ptr); +#ifdef PNG_WRITE_SUPPORTED + png_destroy_info_struct(write_ptr, &write_end_info_ptr); + png_destroy_write_struct(&write_ptr, &write_info_ptr); +#endif + FCLOSE(fpin); + FCLOSE(fpout); + return (1); + } +#ifdef USE_FAR_KEYWORD + png_memcpy(png_jmpbuf(read_ptr), jmpbuf, png_sizeof(jmp_buf)); +#endif + +#ifdef PNG_WRITE_SUPPORTED + png_debug(0, "Setting jmpbuf for write struct"); +#ifdef USE_FAR_KEYWORD + if (setjmp(jmpbuf)) +#else + if (setjmp(png_jmpbuf(write_ptr))) +#endif + { + fprintf(STDERR, "%s -> %s: libpng write error\n", inname, outname); + png_destroy_read_struct(&read_ptr, &read_info_ptr, &end_info_ptr); + png_destroy_info_struct(write_ptr, &write_end_info_ptr); +#ifdef PNG_WRITE_SUPPORTED + png_destroy_write_struct(&write_ptr, &write_info_ptr); +#endif + FCLOSE(fpin); + FCLOSE(fpout); + return (1); + } +#ifdef USE_FAR_KEYWORD + png_memcpy(png_jmpbuf(write_ptr), jmpbuf, png_sizeof(jmp_buf)); +#endif +#endif +#endif + + png_debug(0, "Initializing input and output streams"); +#ifdef PNG_STDIO_SUPPORTED + png_init_io(read_ptr, fpin); +# ifdef PNG_WRITE_SUPPORTED + png_init_io(write_ptr, fpout); +# endif +#else + png_set_read_fn(read_ptr, (png_voidp)fpin, pngtest_read_data); +# ifdef PNG_WRITE_SUPPORTED + png_set_write_fn(write_ptr, (png_voidp)fpout, pngtest_write_data, +# ifdef PNG_WRITE_FLUSH_SUPPORTED + pngtest_flush); +# else + NULL); +# endif +# endif +#endif + if (status_dots_requested == 1) + { +#ifdef PNG_WRITE_SUPPORTED + png_set_write_status_fn(write_ptr, write_row_callback); +#endif + png_set_read_status_fn(read_ptr, read_row_callback); + } + else + { +#ifdef PNG_WRITE_SUPPORTED + png_set_write_status_fn(write_ptr, png_write_status_ptr_NULL); +#endif + png_set_read_status_fn(read_ptr, png_read_status_ptr_NULL); + } + +#ifdef PNG_READ_USER_TRANSFORM_SUPPORTED + { + int i; + for (i = 0; i<256; i++) + filters_used[i] = 0; + png_set_read_user_transform_fn(read_ptr, count_filters); + } +#endif +#ifdef PNG_WRITE_USER_TRANSFORM_SUPPORTED + zero_samples = 0; + png_set_write_user_transform_fn(write_ptr, count_zero_samples); +#endif + +#ifdef PNG_READ_UNKNOWN_CHUNKS_SUPPORTED +# ifndef PNG_HANDLE_CHUNK_ALWAYS +# define PNG_HANDLE_CHUNK_ALWAYS 3 +# endif + png_set_keep_unknown_chunks(read_ptr, PNG_HANDLE_CHUNK_ALWAYS, + png_bytep_NULL, 0); +#endif +#ifdef PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED +# ifndef PNG_HANDLE_CHUNK_IF_SAFE +# define PNG_HANDLE_CHUNK_IF_SAFE 2 +# endif + png_set_keep_unknown_chunks(write_ptr, PNG_HANDLE_CHUNK_IF_SAFE, + png_bytep_NULL, 0); +#endif + + png_debug(0, "Reading info struct"); + png_read_info(read_ptr, read_info_ptr); + + png_debug(0, "Transferring info struct"); + { + int interlace_type, compression_type, filter_type; + + if (png_get_IHDR(read_ptr, read_info_ptr, &width, &height, &bit_depth, + &color_type, &interlace_type, &compression_type, &filter_type)) + { + png_set_IHDR(write_ptr, write_info_ptr, width, height, bit_depth, +#ifdef PNG_WRITE_INTERLACING_SUPPORTED + color_type, interlace_type, compression_type, filter_type); +#else + color_type, PNG_INTERLACE_NONE, compression_type, filter_type); +#endif + } + } +#ifdef PNG_FIXED_POINT_SUPPORTED +#ifdef PNG_cHRM_SUPPORTED + { + png_fixed_point white_x, white_y, red_x, red_y, green_x, green_y, blue_x, + blue_y; + if (png_get_cHRM_fixed(read_ptr, read_info_ptr, &white_x, &white_y, + &red_x, &red_y, &green_x, &green_y, &blue_x, &blue_y)) + { + png_set_cHRM_fixed(write_ptr, write_info_ptr, white_x, white_y, red_x, + red_y, green_x, green_y, blue_x, blue_y); + } + } +#endif +#ifdef PNG_gAMA_SUPPORTED + { + png_fixed_point gamma; + + if (png_get_gAMA_fixed(read_ptr, read_info_ptr, &gamma)) + png_set_gAMA_fixed(write_ptr, write_info_ptr, gamma); + } +#endif +#else /* Use floating point versions */ +#ifdef PNG_FLOATING_POINT_SUPPORTED +#ifdef PNG_cHRM_SUPPORTED + { + double white_x, white_y, red_x, red_y, green_x, green_y, blue_x, + blue_y; + if (png_get_cHRM(read_ptr, read_info_ptr, &white_x, &white_y, &red_x, + &red_y, &green_x, &green_y, &blue_x, &blue_y)) + { + png_set_cHRM(write_ptr, write_info_ptr, white_x, white_y, red_x, + red_y, green_x, green_y, blue_x, blue_y); + } + } +#endif +#ifdef PNG_gAMA_SUPPORTED + { + double gamma; + + if (png_get_gAMA(read_ptr, read_info_ptr, &gamma)) + png_set_gAMA(write_ptr, write_info_ptr, gamma); + } +#endif +#endif /* Floating point */ +#endif /* Fixed point */ +#ifdef PNG_iCCP_SUPPORTED + { + png_charp name; + png_charp profile; + png_uint_32 proflen; + int compression_type; + + if (png_get_iCCP(read_ptr, read_info_ptr, &name, &compression_type, + &profile, &proflen)) + { + png_set_iCCP(write_ptr, write_info_ptr, name, compression_type, + profile, proflen); + } + } +#endif +#ifdef PNG_sRGB_SUPPORTED + { + int intent; + + if (png_get_sRGB(read_ptr, read_info_ptr, &intent)) + png_set_sRGB(write_ptr, write_info_ptr, intent); + } +#endif + { + png_colorp palette; + int num_palette; + + if (png_get_PLTE(read_ptr, read_info_ptr, &palette, &num_palette)) + png_set_PLTE(write_ptr, write_info_ptr, palette, num_palette); + } +#ifdef PNG_bKGD_SUPPORTED + { + png_color_16p background; + + if (png_get_bKGD(read_ptr, read_info_ptr, &background)) + { + png_set_bKGD(write_ptr, write_info_ptr, background); + } + } +#endif +#ifdef PNG_hIST_SUPPORTED + { + png_uint_16p hist; + + if (png_get_hIST(read_ptr, read_info_ptr, &hist)) + png_set_hIST(write_ptr, write_info_ptr, hist); + } +#endif +#ifdef PNG_oFFs_SUPPORTED + { + png_int_32 offset_x, offset_y; + int unit_type; + + if (png_get_oFFs(read_ptr, read_info_ptr, &offset_x, &offset_y, + &unit_type)) + { + png_set_oFFs(write_ptr, write_info_ptr, offset_x, offset_y, unit_type); + } + } +#endif +#ifdef PNG_pCAL_SUPPORTED + { + png_charp purpose, units; + png_charpp params; + png_int_32 X0, X1; + int type, nparams; + + if (png_get_pCAL(read_ptr, read_info_ptr, &purpose, &X0, &X1, &type, + &nparams, &units, ¶ms)) + { + png_set_pCAL(write_ptr, write_info_ptr, purpose, X0, X1, type, + nparams, units, params); + } + } +#endif +#ifdef PNG_pHYs_SUPPORTED + { + png_uint_32 res_x, res_y; + int unit_type; + + if (png_get_pHYs(read_ptr, read_info_ptr, &res_x, &res_y, &unit_type)) + png_set_pHYs(write_ptr, write_info_ptr, res_x, res_y, unit_type); + } +#endif +#ifdef PNG_sBIT_SUPPORTED + { + png_color_8p sig_bit; + + if (png_get_sBIT(read_ptr, read_info_ptr, &sig_bit)) + png_set_sBIT(write_ptr, write_info_ptr, sig_bit); + } +#endif +#ifdef PNG_sCAL_SUPPORTED +#ifdef PNG_FLOATING_POINT_SUPPORTED + { + int unit; + double scal_width, scal_height; + + if (png_get_sCAL(read_ptr, read_info_ptr, &unit, &scal_width, + &scal_height)) + { + png_set_sCAL(write_ptr, write_info_ptr, unit, scal_width, scal_height); + } + } +#else +#ifdef PNG_FIXED_POINT_SUPPORTED + { + int unit; + png_charp scal_width, scal_height; + + if (png_get_sCAL_s(read_ptr, read_info_ptr, &unit, &scal_width, + &scal_height)) + { + png_set_sCAL_s(write_ptr, write_info_ptr, unit, scal_width, + scal_height); + } + } +#endif +#endif +#endif +#ifdef PNG_TEXT_SUPPORTED + { + png_textp text_ptr; + int num_text; + + if (png_get_text(read_ptr, read_info_ptr, &text_ptr, &num_text) > 0) + { + png_debug1(0, "Handling %d iTXt/tEXt/zTXt chunks", num_text); + png_set_text(write_ptr, write_info_ptr, text_ptr, num_text); + } + } +#endif +#ifdef PNG_tIME_SUPPORTED + { + png_timep mod_time; + + if (png_get_tIME(read_ptr, read_info_ptr, &mod_time)) + { + png_set_tIME(write_ptr, write_info_ptr, mod_time); +#ifdef PNG_TIME_RFC1123_SUPPORTED + /* We have to use png_memcpy instead of "=" because the string + * pointed to by png_convert_to_rfc1123() gets free'ed before + * we use it. + */ + png_memcpy(tIME_string, + png_convert_to_rfc1123(read_ptr, mod_time), + png_sizeof(tIME_string)); + tIME_string[png_sizeof(tIME_string) - 1] = '\0'; + tIME_chunk_present++; +#endif /* PNG_TIME_RFC1123_SUPPORTED */ + } + } +#endif +#ifdef PNG_tRNS_SUPPORTED + { + png_bytep trans; + int num_trans; + png_color_16p trans_values; + + if (png_get_tRNS(read_ptr, read_info_ptr, &trans, &num_trans, + &trans_values)) + { + int sample_max = (1 << bit_depth); + /* libpng doesn't reject a tRNS chunk with out-of-range samples */ + if (!((color_type == PNG_COLOR_TYPE_GRAY && + (int)trans_values->gray > sample_max) || + (color_type == PNG_COLOR_TYPE_RGB && + ((int)trans_values->red > sample_max || + (int)trans_values->green > sample_max || + (int)trans_values->blue > sample_max)))) + png_set_tRNS(write_ptr, write_info_ptr, trans, num_trans, + trans_values); + } + } +#endif +#ifdef PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED + { + png_unknown_chunkp unknowns; + int num_unknowns = (int)png_get_unknown_chunks(read_ptr, read_info_ptr, + &unknowns); + if (num_unknowns) + { + png_size_t i; + png_set_unknown_chunks(write_ptr, write_info_ptr, unknowns, + num_unknowns); + /* Copy the locations from the read_info_ptr. The automatically + * generated locations in write_info_ptr are wrong because we + * haven't written anything yet. + */ + for (i = 0; i < (png_size_t)num_unknowns; i++) + png_set_unknown_chunk_location(write_ptr, write_info_ptr, i, + unknowns[i].location); + } + } +#endif + +#ifdef PNG_WRITE_SUPPORTED + png_debug(0, "Writing info struct"); + +/* If we wanted, we could write info in two steps: + * png_write_info_before_PLTE(write_ptr, write_info_ptr); + */ + png_write_info(write_ptr, write_info_ptr); + +#ifdef PNG_UNKNOWN_CHUNKS_SUPPORTED + if (user_chunk_data[0] != 0) + { + png_byte png_sTER[5] = {115, 84, 69, 82, '\0'}; + + unsigned char + ster_chunk_data[1]; + + if (verbose) + fprintf(STDERR, "\n stereo mode = %lu\n", + (unsigned long)(user_chunk_data[0] - 1)); + ster_chunk_data[0]=(unsigned char)(user_chunk_data[0] - 1); + png_write_chunk(write_ptr, png_sTER, ster_chunk_data, 1); + } + if (user_chunk_data[1] != 0 || user_chunk_data[2] != 0) + { + png_byte png_vpAg[5] = {118, 112, 65, 103, '\0'}; + + unsigned char + vpag_chunk_data[9]; + + if (verbose) + fprintf(STDERR, " vpAg = %lu x %lu, units = %lu\n", + (unsigned long)user_chunk_data[1], + (unsigned long)user_chunk_data[2], + (unsigned long)user_chunk_data[3]); + png_save_uint_32(vpag_chunk_data, user_chunk_data[1]); + png_save_uint_32(vpag_chunk_data + 4, user_chunk_data[2]); + vpag_chunk_data[8] = (unsigned char)(user_chunk_data[3] & 0xff); + png_write_chunk(write_ptr, png_vpAg, vpag_chunk_data, 9); + } + +#endif +#endif + +#ifdef SINGLE_ROWBUF_ALLOC + png_debug(0, "Allocating row buffer..."); + row_buf = (png_bytep)png_malloc(read_ptr, + png_get_rowbytes(read_ptr, read_info_ptr)); + png_debug1(0, "0x%08lx", (unsigned long)row_buf); +#endif /* SINGLE_ROWBUF_ALLOC */ + png_debug(0, "Writing row data"); + +#if defined(PNG_READ_INTERLACING_SUPPORTED) || \ + defined(PNG_WRITE_INTERLACING_SUPPORTED) + num_pass = png_set_interlace_handling(read_ptr); +# ifdef PNG_WRITE_SUPPORTED + png_set_interlace_handling(write_ptr); +# endif +#else + num_pass = 1; +#endif + +#ifdef PNGTEST_TIMING + t_stop = (float)clock(); + t_misc += (t_stop - t_start); + t_start = t_stop; +#endif + for (pass = 0; pass < num_pass; pass++) + { + png_debug1(0, "Writing row data for pass %d", pass); + for (y = 0; y < height; y++) + { +#ifndef SINGLE_ROWBUF_ALLOC + png_debug2(0, "Allocating row buffer (pass %d, y = %ld)...", pass, y); + row_buf = (png_bytep)png_malloc(read_ptr, + png_get_rowbytes(read_ptr, read_info_ptr)); + png_debug2(0, "0x%08lx (%ld bytes)", (unsigned long)row_buf, + png_get_rowbytes(read_ptr, read_info_ptr)); +#endif /* !SINGLE_ROWBUF_ALLOC */ + png_read_rows(read_ptr, (png_bytepp)&row_buf, png_bytepp_NULL, 1); + +#ifdef PNG_WRITE_SUPPORTED +#ifdef PNGTEST_TIMING + t_stop = (float)clock(); + t_decode += (t_stop - t_start); + t_start = t_stop; +#endif + png_write_rows(write_ptr, (png_bytepp)&row_buf, 1); +#ifdef PNGTEST_TIMING + t_stop = (float)clock(); + t_encode += (t_stop - t_start); + t_start = t_stop; +#endif +#endif /* PNG_WRITE_SUPPORTED */ + +#ifndef SINGLE_ROWBUF_ALLOC + png_debug2(0, "Freeing row buffer (pass %d, y = %ld)", pass, y); + png_free(read_ptr, row_buf); + row_buf = NULL; +#endif /* !SINGLE_ROWBUF_ALLOC */ + } + } + +#ifdef PNG_READ_UNKNOWN_CHUNKS_SUPPORTED + png_free_data(read_ptr, read_info_ptr, PNG_FREE_UNKN, -1); +#endif +#ifdef PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED + png_free_data(write_ptr, write_info_ptr, PNG_FREE_UNKN, -1); +#endif + + png_debug(0, "Reading and writing end_info data"); + + png_read_end(read_ptr, end_info_ptr); +#ifdef PNG_TEXT_SUPPORTED + { + png_textp text_ptr; + int num_text; + + if (png_get_text(read_ptr, end_info_ptr, &text_ptr, &num_text) > 0) + { + png_debug1(0, "Handling %d iTXt/tEXt/zTXt chunks", num_text); + png_set_text(write_ptr, write_end_info_ptr, text_ptr, num_text); + } + } +#endif +#ifdef PNG_tIME_SUPPORTED + { + png_timep mod_time; + + if (png_get_tIME(read_ptr, end_info_ptr, &mod_time)) + { + png_set_tIME(write_ptr, write_end_info_ptr, mod_time); +#ifdef PNG_TIME_RFC1123_SUPPORTED + /* We have to use png_memcpy instead of "=" because the string + pointed to by png_convert_to_rfc1123() gets free'ed before + we use it */ + png_memcpy(tIME_string, + png_convert_to_rfc1123(read_ptr, mod_time), + png_sizeof(tIME_string)); + tIME_string[png_sizeof(tIME_string) - 1] = '\0'; + tIME_chunk_present++; +#endif /* PNG_TIME_RFC1123_SUPPORTED */ + } + } +#endif +#ifdef PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED + { + png_unknown_chunkp unknowns; + int num_unknowns; + num_unknowns = (int)png_get_unknown_chunks(read_ptr, end_info_ptr, + &unknowns); + if (num_unknowns) + { + png_size_t i; + png_set_unknown_chunks(write_ptr, write_end_info_ptr, unknowns, + num_unknowns); + /* Copy the locations from the read_info_ptr. The automatically + * generated locations in write_end_info_ptr are wrong because we + * haven't written the end_info yet. + */ + for (i = 0; i < (png_size_t)num_unknowns; i++) + png_set_unknown_chunk_location(write_ptr, write_end_info_ptr, i, + unknowns[i].location); + } + } +#endif +#ifdef PNG_WRITE_SUPPORTED + png_write_end(write_ptr, write_end_info_ptr); +#endif + +#ifdef PNG_EASY_ACCESS_SUPPORTED + if (verbose) + { + png_uint_32 iwidth, iheight; + iwidth = png_get_image_width(write_ptr, write_info_ptr); + iheight = png_get_image_height(write_ptr, write_info_ptr); + fprintf(STDERR, "\n Image width = %lu, height = %lu\n", + (unsigned long)iwidth, (unsigned long)iheight); + } +#endif + + png_debug(0, "Destroying data structs"); +#ifdef SINGLE_ROWBUF_ALLOC + png_debug(1, "destroying row_buf for read_ptr"); + png_free(read_ptr, row_buf); + row_buf = NULL; +#endif /* SINGLE_ROWBUF_ALLOC */ + png_debug(1, "destroying read_ptr, read_info_ptr, end_info_ptr"); + png_destroy_read_struct(&read_ptr, &read_info_ptr, &end_info_ptr); +#ifdef PNG_WRITE_SUPPORTED + png_debug(1, "destroying write_end_info_ptr"); + png_destroy_info_struct(write_ptr, &write_end_info_ptr); + png_debug(1, "destroying write_ptr, write_info_ptr"); + png_destroy_write_struct(&write_ptr, &write_info_ptr); +#endif + png_debug(0, "Destruction complete."); + + FCLOSE(fpin); + FCLOSE(fpout); + + png_debug(0, "Opening files for comparison"); +#ifdef _WIN32_WCE + MultiByteToWideChar(CP_ACP, 0, inname, -1, path, MAX_PATH); + if ((fpin = CreateFile(path, GENERIC_READ, 0, NULL, OPEN_EXISTING, + 0, NULL)) == INVALID_HANDLE_VALUE) +#else + if ((fpin = fopen(inname, "rb")) == NULL) +#endif + { + fprintf(STDERR, "Could not find file %s\n", inname); + return (1); + } + +#ifdef _WIN32_WCE + MultiByteToWideChar(CP_ACP, 0, outname, -1, path, MAX_PATH); + if ((fpout = CreateFile(path, GENERIC_READ, 0, NULL, OPEN_EXISTING, + 0, NULL)) == INVALID_HANDLE_VALUE) +#else + if ((fpout = fopen(outname, "rb")) == NULL) +#endif + { + fprintf(STDERR, "Could not find file %s\n", outname); + FCLOSE(fpin); + return (1); + } + + for (;;) + { + png_size_t num_in, num_out; + + READFILE(fpin, inbuf, 1, num_in); + READFILE(fpout, outbuf, 1, num_out); + + if (num_in != num_out) + { + fprintf(STDERR, "\nFiles %s and %s are of a different size\n", + inname, outname); + if (wrote_question == 0) + { + fprintf(STDERR, + " Was %s written with the same maximum IDAT chunk size (%d bytes),", + inname, PNG_ZBUF_SIZE); + fprintf(STDERR, + "\n filtering heuristic (libpng default), compression"); + fprintf(STDERR, + " level (zlib default),\n and zlib version (%s)?\n\n", + ZLIB_VERSION); + wrote_question = 1; + } + FCLOSE(fpin); + FCLOSE(fpout); + return (0); + } + + if (!num_in) + break; + + if (png_memcmp(inbuf, outbuf, num_in)) + { + fprintf(STDERR, "\nFiles %s and %s are different\n", inname, outname); + if (wrote_question == 0) + { + fprintf(STDERR, + " Was %s written with the same maximum IDAT chunk size (%d bytes),", + inname, PNG_ZBUF_SIZE); + fprintf(STDERR, + "\n filtering heuristic (libpng default), compression"); + fprintf(STDERR, + " level (zlib default),\n and zlib version (%s)?\n\n", + ZLIB_VERSION); + wrote_question = 1; + } + FCLOSE(fpin); + FCLOSE(fpout); + return (0); + } + } + + FCLOSE(fpin); + FCLOSE(fpout); + + return (0); +} + +/* Input and output filenames */ +#ifdef RISCOS +static PNG_CONST char *inname = "pngtest/png"; +static PNG_CONST char *outname = "pngout/png"; +#else +static PNG_CONST char *inname = "pngtest.png"; +static PNG_CONST char *outname = "pngout.png"; +#endif + +int +main(int argc, char *argv[]) +{ + int multiple = 0; + int ierror = 0; + + fprintf(STDERR, "\n Testing libpng version %s\n", PNG_LIBPNG_VER_STRING); + fprintf(STDERR, " with zlib version %s\n", ZLIB_VERSION); + fprintf(STDERR, "%s", png_get_copyright(NULL)); + /* Show the version of libpng used in building the library */ + fprintf(STDERR, " library (%lu):%s", + (unsigned long)png_access_version_number(), + png_get_header_version(NULL)); + /* Show the version of libpng used in building the application */ + fprintf(STDERR, " pngtest (%lu):%s", (unsigned long)PNG_LIBPNG_VER, + PNG_HEADER_VERSION_STRING); + fprintf(STDERR, " sizeof(png_struct)=%ld, sizeof(png_info)=%ld\n", + (long)png_sizeof(png_struct), (long)png_sizeof(png_info)); + + /* Do some consistency checking on the memory allocation settings, I'm + * not sure this matters, but it is nice to know, the first of these + * tests should be impossible because of the way the macros are set + * in pngconf.h + */ +#if defined(MAXSEG_64K) && !defined(PNG_MAX_MALLOC_64K) + fprintf(STDERR, " NOTE: Zlib compiled for max 64k, libpng not\n"); +#endif + /* I think the following can happen. */ +#if !defined(MAXSEG_64K) && defined(PNG_MAX_MALLOC_64K) + fprintf(STDERR, " NOTE: libpng compiled for max 64k, zlib not\n"); +#endif + + if (strcmp(png_libpng_ver, PNG_LIBPNG_VER_STRING)) + { + fprintf(STDERR, + "Warning: versions are different between png.h and png.c\n"); + fprintf(STDERR, " png.h version: %s\n", PNG_LIBPNG_VER_STRING); + fprintf(STDERR, " png.c version: %s\n\n", png_libpng_ver); + ++ierror; + } + + if (argc > 1) + { + if (strcmp(argv[1], "-m") == 0) + { + multiple = 1; + status_dots_requested = 0; + } + else if (strcmp(argv[1], "-mv") == 0 || + strcmp(argv[1], "-vm") == 0 ) + { + multiple = 1; + verbose = 1; + status_dots_requested = 1; + } + else if (strcmp(argv[1], "-v") == 0) + { + verbose = 1; + status_dots_requested = 1; + inname = argv[2]; + } + else + { + inname = argv[1]; + status_dots_requested = 0; + } + } + + if (!multiple && argc == 3 + verbose) + outname = argv[2 + verbose]; + + if ((!multiple && argc > 3 + verbose) || (multiple && argc < 2)) + { + fprintf(STDERR, + "usage: %s [infile.png] [outfile.png]\n\t%s -m {infile.png}\n", + argv[0], argv[0]); + fprintf(STDERR, + " reads/writes one PNG file (without -m) or multiple files (-m)\n"); + fprintf(STDERR, + " with -m %s is used as a temporary file\n", outname); + exit(1); + } + + if (multiple) + { + int i; +#if defined(PNG_USER_MEM_SUPPORTED) && PNG_DEBUG + int allocation_now = current_allocation; +#endif + for (i=2; isize, + (unsigned int) pinfo->pointer); + pinfo = pinfo->next; + } + } +#endif + } +#if defined(PNG_USER_MEM_SUPPORTED) && PNG_DEBUG + fprintf(STDERR, " Current memory allocation: %10d bytes\n", + current_allocation); + fprintf(STDERR, " Maximum memory allocation: %10d bytes\n", + maximum_allocation); + fprintf(STDERR, " Total memory allocation: %10d bytes\n", + total_allocation); + fprintf(STDERR, " Number of allocations: %10d\n", + num_allocations); +#endif + } + else + { + int i; + for (i = 0; i<3; ++i) + { + int kerror; +#if defined(PNG_USER_MEM_SUPPORTED) && PNG_DEBUG + int allocation_now = current_allocation; +#endif + if (i == 1) status_dots_requested = 1; + else if (verbose == 0)status_dots_requested = 0; + if (i == 0 || verbose == 1 || ierror != 0) + fprintf(STDERR, "\n Testing %s:", inname); + kerror = test_one_file(inname, outname); + if (kerror == 0) + { + if (verbose == 1 || i == 2) + { +#ifdef PNG_READ_USER_TRANSFORM_SUPPORTED + int k; +#endif +#ifdef PNG_WRITE_USER_TRANSFORM_SUPPORTED + fprintf(STDERR, "\n PASS (%lu zero samples)\n", + (unsigned long)zero_samples); +#else + fprintf(STDERR, " PASS\n"); +#endif +#ifdef PNG_READ_USER_TRANSFORM_SUPPORTED + for (k = 0; k<256; k++) + if (filters_used[k]) + fprintf(STDERR, " Filter %d was used %lu times\n", + k, (unsigned long)filters_used[k]); +#endif +#ifdef PNG_TIME_RFC1123_SUPPORTED + if (tIME_chunk_present != 0) + fprintf(STDERR, " tIME = %s\n", tIME_string); +#endif /* PNG_TIME_RFC1123_SUPPORTED */ + } + } + else + { + if (verbose == 0 && i != 2) + fprintf(STDERR, "\n Testing %s:", inname); + fprintf(STDERR, " FAIL\n"); + ierror += kerror; + } +#if defined(PNG_USER_MEM_SUPPORTED) && PNG_DEBUG + if (allocation_now != current_allocation) + fprintf(STDERR, "MEMORY ERROR: %d bytes lost\n", + current_allocation - allocation_now); + if (current_allocation != 0) + { + memory_infop pinfo = pinformation; + + fprintf(STDERR, "MEMORY ERROR: %d bytes still allocated\n", + current_allocation); + while (pinfo != NULL) + { + fprintf(STDERR, " %lu bytes at %x\n", + (unsigned long)pinfo->size, (unsigned int)pinfo->pointer); + pinfo = pinfo->next; + } + } +#endif + } +#if defined(PNG_USER_MEM_SUPPORTED) && PNG_DEBUG + fprintf(STDERR, " Current memory allocation: %10d bytes\n", + current_allocation); + fprintf(STDERR, " Maximum memory allocation: %10d bytes\n", + maximum_allocation); + fprintf(STDERR, " Total memory allocation: %10d bytes\n", + total_allocation); + fprintf(STDERR, " Number of allocations: %10d\n", + num_allocations); +#endif + } + +#ifdef PNGTEST_TIMING + t_stop = (float)clock(); + t_misc += (t_stop - t_start); + t_start = t_stop; + fprintf(STDERR, " CPU time used = %.3f seconds", + (t_misc+t_decode+t_encode)/(float)CLOCKS_PER_SEC); + fprintf(STDERR, " (decoding %.3f,\n", + t_decode/(float)CLOCKS_PER_SEC); + fprintf(STDERR, " encoding %.3f ,", + t_encode/(float)CLOCKS_PER_SEC); + fprintf(STDERR, " other %.3f seconds)\n\n", + t_misc/(float)CLOCKS_PER_SEC); +#endif + + if (ierror == 0) + fprintf(STDERR, " libpng passes test\n"); + else + fprintf(STDERR, " libpng FAILS test\n"); + return (int)(ierror != 0); +} + +/* Generate a compiler error if there is an old png.h in the search path. */ +typedef version_1_2_49 your_png_h_is_not_version_1_2_49; diff --git a/external/libpng/pngtest.png b/external/libpng/pngtest.png new file mode 100644 index 0000000..f3a6df4 Binary files /dev/null and b/external/libpng/pngtest.png differ diff --git a/src/libpng/pngtrans.c b/external/libpng/pngtrans.c similarity index 100% rename from src/libpng/pngtrans.c rename to external/libpng/pngtrans.c diff --git a/src/libpng/pngvcrd.c b/external/libpng/pngvcrd.c similarity index 100% rename from src/libpng/pngvcrd.c rename to external/libpng/pngvcrd.c diff --git a/src/libpng/pngwio.c b/external/libpng/pngwio.c similarity index 100% rename from src/libpng/pngwio.c rename to external/libpng/pngwio.c diff --git a/src/libpng/pngwrite.c b/external/libpng/pngwrite.c similarity index 100% rename from src/libpng/pngwrite.c rename to external/libpng/pngwrite.c diff --git a/src/libpng/pngwtran.c b/external/libpng/pngwtran.c similarity index 100% rename from src/libpng/pngwtran.c rename to external/libpng/pngwtran.c diff --git a/src/libpng/pngwutil.c b/external/libpng/pngwutil.c similarity index 100% rename from src/libpng/pngwutil.c rename to external/libpng/pngwutil.c diff --git a/include/Box2D/Box2D.h b/include/Box2D/Box2D.h index f98f87a..66d2217 100644 --- a/include/Box2D/Box2D.h +++ b/include/Box2D/Box2D.h @@ -56,13 +56,12 @@ For discussion please visit http://box2d.org/forum #include #include #include -#include +#include #include #include #include #include #include #include -#include #endif diff --git a/include/Box2D/Collision/Shapes/b2EdgeShape.h b/include/Box2D/Collision/Shapes/b2EdgeShape.h index 99f822b..6107b06 100644 --- a/include/Box2D/Collision/Shapes/b2EdgeShape.h +++ b/include/Box2D/Collision/Shapes/b2EdgeShape.h @@ -50,7 +50,7 @@ class b2EdgeShape : public b2Shape /// @see b2Shape::ComputeMass void ComputeMass(b2MassData* massData, float32 density) const; - + /// These are the edge vertices b2Vec2 m_vertex1, m_vertex2; diff --git a/include/Box2D/Collision/Shapes/b2PolygonShape.h b/include/Box2D/Collision/Shapes/b2PolygonShape.h index d5c0e74..fd11bd1 100644 --- a/include/Box2D/Collision/Shapes/b2PolygonShape.h +++ b/include/Box2D/Collision/Shapes/b2PolygonShape.h @@ -36,14 +36,12 @@ class b2PolygonShape : public b2Shape /// @see b2Shape::GetChildCount int32 GetChildCount() const; - /// Create a convex hull from the given array of local points. + /// Copy vertices. This assumes the vertices define a convex polygon. + /// It is assumed that the exterior is the the right of each edge. /// The count must be in the range [3, b2_maxPolygonVertices]. - /// @warning the points may be re-ordered, even if they form a convex polygon - /// @warning collinear points are handled but not removed. Collinear points - /// may lead to poor stacking behavior. - void Set(const b2Vec2* points, int32 count); + void Set(const b2Vec2* vertices, int32 vertexCount); - /// Build vertices to represent an axis-aligned box centered on the local origin. + /// Build vertices to represent an axis-aligned box. /// @param hx the half-width. /// @param hy the half-height. void SetAsBox(float32 hx, float32 hy); @@ -69,32 +67,28 @@ class b2PolygonShape : public b2Shape void ComputeMass(b2MassData* massData, float32 density) const; /// Get the vertex count. - int32 GetVertexCount() const { return m_count; } + int32 GetVertexCount() const { return m_vertexCount; } /// Get a vertex by index. const b2Vec2& GetVertex(int32 index) const; - /// Validate convexity. This is a very time consuming operation. - /// @returns true if valid - bool Validate() const; - b2Vec2 m_centroid; b2Vec2 m_vertices[b2_maxPolygonVertices]; b2Vec2 m_normals[b2_maxPolygonVertices]; - int32 m_count; + int32 m_vertexCount; }; inline b2PolygonShape::b2PolygonShape() { m_type = e_polygon; m_radius = b2_polygonRadius; - m_count = 0; + m_vertexCount = 0; m_centroid.SetZero(); } inline const b2Vec2& b2PolygonShape::GetVertex(int32 index) const { - b2Assert(0 <= index && index < m_count); + b2Assert(0 <= index && index < m_vertexCount); return m_vertices[index]; } diff --git a/include/Box2D/Collision/Shapes/b2Shape.h b/include/Box2D/Collision/Shapes/b2Shape.h index fd7de26..f37850d 100644 --- a/include/Box2D/Collision/Shapes/b2Shape.h +++ b/include/Box2D/Collision/Shapes/b2Shape.h @@ -42,7 +42,7 @@ struct b2MassData class b2Shape { public: - + enum Type { e_circle = 0, diff --git a/include/Box2D/Collision/b2BroadPhase.h b/include/Box2D/Collision/b2BroadPhase.h index 4905710..c7398c9 100644 --- a/include/Box2D/Collision/b2BroadPhase.h +++ b/include/Box2D/Collision/b2BroadPhase.h @@ -28,6 +28,7 @@ struct b2Pair { int32 proxyIdA; int32 proxyIdB; + int32 next; }; /// The broad-phase is used for computing pairs and performing volume queries and ray casts. @@ -99,11 +100,6 @@ class b2BroadPhase /// Get the quality metric of the embedded tree. float32 GetTreeQuality() const; - /// Shift the world origin. Useful for large worlds. - /// The shift formula is: position -= newOrigin - /// @param newOrigin the new origin with respect to the old origin - void ShiftOrigin(const b2Vec2& newOrigin); - private: friend class b2DynamicTree; @@ -249,9 +245,4 @@ inline void b2BroadPhase::RayCast(T* callback, const b2RayCastInput& input) cons m_tree.RayCast(callback, input); } -inline void b2BroadPhase::ShiftOrigin(const b2Vec2& newOrigin) -{ - m_tree.ShiftOrigin(newOrigin); -} - #endif diff --git a/include/Box2D/Collision/b2Distance.h b/include/Box2D/Collision/b2Distance.h index 54ed1e1..92398a9 100644 --- a/include/Box2D/Collision/b2Distance.h +++ b/include/Box2D/Collision/b2Distance.h @@ -64,7 +64,7 @@ struct b2SimplexCache /// Input for b2Distance. /// You have to option to use the shape radii -/// in the computation. Even +/// in the computation. Even struct b2DistanceInput { b2DistanceProxy proxyA; @@ -87,7 +87,7 @@ struct b2DistanceOutput /// b2CircleShape, b2PolygonShape, b2EdgeShape. The simplex cache is input/output. /// On the first call set b2SimplexCache.count to zero. void b2Distance(b2DistanceOutput* output, - b2SimplexCache* cache, + b2SimplexCache* cache, const b2DistanceInput* input); diff --git a/include/Box2D/Collision/b2DynamicTree.h b/include/Box2D/Collision/b2DynamicTree.h index 97aa461..a9bfbf3 100644 --- a/include/Box2D/Collision/b2DynamicTree.h +++ b/include/Box2D/Collision/b2DynamicTree.h @@ -118,11 +118,6 @@ class b2DynamicTree /// Build an optimal tree. Very expensive. For testing. void RebuildBottomUp(); - /// Shift the world origin. Useful for large worlds. - /// The shift formula is: position -= newOrigin - /// @param newOrigin the new origin with respect to the old origin - void ShiftOrigin(const b2Vec2& newOrigin); - private: int32 AllocateNode(); diff --git a/include/Box2D/Common/b2Draw.h b/include/Box2D/Common/b2Draw.h index 14f3105..0b10478 100644 --- a/include/Box2D/Common/b2Draw.h +++ b/include/Box2D/Common/b2Draw.h @@ -16,9 +16,6 @@ * 3. This notice may not be removed or altered from any source distribution. */ -#ifndef B2_DRAW_H -#define B2_DRAW_H - #include /// Color for debug drawing. Each value has the range [0,1]. @@ -53,7 +50,7 @@ class b2Draw /// Get the drawing flags. uint32 GetFlags() const; - + /// Append flags to the current flags. void AppendFlags(uint32 flags); @@ -68,10 +65,10 @@ class b2Draw /// Draw a circle. virtual void DrawCircle(const b2Vec2& center, float32 radius, const b2Color& color) = 0; - + /// Draw a solid circle. virtual void DrawSolidCircle(const b2Vec2& center, float32 radius, const b2Vec2& axis, const b2Color& color) = 0; - + /// Draw a line segment. virtual void DrawSegment(const b2Vec2& p1, const b2Vec2& p2, const b2Color& color) = 0; @@ -82,5 +79,3 @@ class b2Draw protected: uint32 m_drawFlags; }; - -#endif diff --git a/include/Box2D/Common/b2Math.h b/include/Box2D/Common/b2Math.h index 9808258..15cb033 100644 --- a/include/Box2D/Common/b2Math.h +++ b/include/Box2D/Common/b2Math.h @@ -77,7 +77,7 @@ struct b2Vec2 /// Negate this vector. b2Vec2 operator -() const { b2Vec2 v; v.Set(-x, -y); return v; } - + /// Read from and indexed element. float32 operator () (int32 i) const { @@ -95,7 +95,7 @@ struct b2Vec2 { x += v.x; y += v.y; } - + /// Subtract a vector from this vector. void operator -= (const b2Vec2& v) { diff --git a/include/Box2D/Common/b2Timer.h b/include/Box2D/Common/b2Timer.h index d2b8777..19bde28 100644 --- a/include/Box2D/Common/b2Timer.h +++ b/include/Box2D/Common/b2Timer.h @@ -16,9 +16,6 @@ * 3. This notice may not be removed or altered from any source distribution. */ -#ifndef B2_TIMER_H -#define B2_TIMER_H - #include /// Timer for profiling. This has platform specific code and may @@ -46,5 +43,3 @@ class b2Timer unsigned long m_start_msec; #endif }; - -#endif diff --git a/include/Box2D/Dynamics/Contacts/b2Contact.h b/include/Box2D/Dynamics/Contacts/b2Contact.h index 9c1a8b4..7b5a6ab 100644 --- a/include/Box2D/Dynamics/Contacts/b2Contact.h +++ b/include/Box2D/Dynamics/Contacts/b2Contact.h @@ -135,12 +135,6 @@ class b2Contact /// Reset the restitution to the default value. void ResetRestitution(); - /// Set the desired tangent speed for a conveyor belt behavior. In meters per second. - void SetTangentSpeed(float32 speed); - - /// Get the desired tangent speed. In meters per second. - float32 GetTangentSpeed() const; - /// Evaluate this contact with your own manifold and transforms. virtual void Evaluate(b2Manifold* manifold, const b2Transform& xfA, const b2Transform& xfB) = 0; @@ -215,8 +209,6 @@ class b2Contact float32 m_friction; float32 m_restitution; - - float32 m_tangentSpeed; }; inline b2Manifold* b2Contact::GetManifold() @@ -336,14 +328,4 @@ inline void b2Contact::ResetRestitution() m_restitution = b2MixRestitution(m_fixtureA->m_restitution, m_fixtureB->m_restitution); } -inline void b2Contact::SetTangentSpeed(float32 speed) -{ - m_tangentSpeed = speed; -} - -inline float32 b2Contact::GetTangentSpeed() const -{ - return m_tangentSpeed; -} - #endif diff --git a/include/Box2D/Dynamics/Contacts/b2ContactSolver.h b/include/Box2D/Dynamics/Contacts/b2ContactSolver.h index cb568a3..ca9de04 100644 --- a/include/Box2D/Dynamics/Contacts/b2ContactSolver.h +++ b/include/Box2D/Dynamics/Contacts/b2ContactSolver.h @@ -51,7 +51,6 @@ struct b2ContactVelocityConstraint float32 invIA, invIB; float32 friction; float32 restitution; - float32 tangentSpeed; int32 pointCount; int32 contactIndex; }; diff --git a/include/Box2D/Dynamics/Joints/b2Joint.h b/include/Box2D/Dynamics/Joints/b2Joint.h index f6002e5..90154cc 100644 --- a/include/Box2D/Dynamics/Joints/b2Joint.h +++ b/include/Box2D/Dynamics/Joints/b2Joint.h @@ -38,8 +38,7 @@ enum b2JointType e_wheelJoint, e_weldJoint, e_frictionJoint, - e_ropeJoint, - e_motorJoint + e_ropeJoint }; enum b2LimitState @@ -146,9 +145,6 @@ class b2Joint /// Dump this joint to the log file. virtual void Dump() { b2Log("// Dump is not supported for this joint type.\n"); } - /// Shift the origin for any points stored in world coordinates. - virtual void ShiftOrigin(const b2Vec2& newOrigin) { B2_NOT_USED(newOrigin); } - protected: friend class b2World; friend class b2Body; diff --git a/include/Box2D/Dynamics/Joints/b2MouseJoint.h b/include/Box2D/Dynamics/Joints/b2MouseJoint.h index aba70ec..1f12a4d 100644 --- a/include/Box2D/Dynamics/Joints/b2MouseJoint.h +++ b/include/Box2D/Dynamics/Joints/b2MouseJoint.h @@ -92,9 +92,6 @@ class b2MouseJoint : public b2Joint /// The mouse joint does not support dumping. void Dump() { b2Log("Mouse joint dumping is not supported.\n"); } - /// Implement b2Joint::ShiftOrigin - void ShiftOrigin(const b2Vec2& newOrigin); - protected: friend class b2Joint; @@ -109,7 +106,7 @@ class b2MouseJoint : public b2Joint float32 m_frequencyHz; float32 m_dampingRatio; float32 m_beta; - + // Solver shared b2Vec2 m_impulse; float32 m_maxForce; diff --git a/include/Box2D/Dynamics/Joints/b2PulleyJoint.h b/include/Box2D/Dynamics/Joints/b2PulleyJoint.h index 07e7678..234bcc2 100644 --- a/include/Box2D/Dynamics/Joints/b2PulleyJoint.h +++ b/include/Box2D/Dynamics/Joints/b2PulleyJoint.h @@ -100,18 +100,9 @@ class b2PulleyJoint : public b2Joint /// Get the pulley ratio. float32 GetRatio() const; - /// Get the current length of the segment attached to bodyA. - float32 GetCurrentLengthA() const; - - /// Get the current length of the segment attached to bodyB. - float32 GetCurrentLengthB() const; - /// Dump joint to dmLog void Dump(); - /// Implement b2Joint::ShiftOrigin - void ShiftOrigin(const b2Vec2& newOrigin); - protected: friend class b2Joint; @@ -125,7 +116,7 @@ class b2PulleyJoint : public b2Joint b2Vec2 m_groundAnchorB; float32 m_lengthA; float32 m_lengthB; - + // Solver shared b2Vec2 m_localAnchorA; b2Vec2 m_localAnchorB; diff --git a/include/Box2D/Dynamics/Joints/b2RevoluteJoint.h b/include/Box2D/Dynamics/Joints/b2RevoluteJoint.h index e62cdbc..8163a45 100644 --- a/include/Box2D/Dynamics/Joints/b2RevoluteJoint.h +++ b/include/Box2D/Dynamics/Joints/b2RevoluteJoint.h @@ -155,7 +155,7 @@ class b2RevoluteJoint : public b2Joint void Dump(); protected: - + friend class b2Joint; friend class b2GearJoint; diff --git a/include/Box2D/Dynamics/Joints/b2WeldJoint.h b/include/Box2D/Dynamics/Joints/b2WeldJoint.h index 2adfc26..0e465b1 100644 --- a/include/Box2D/Dynamics/Joints/b2WeldJoint.h +++ b/include/Box2D/Dynamics/Joints/b2WeldJoint.h @@ -48,7 +48,7 @@ struct b2WeldJointDef : public b2JointDef /// The bodyB angle minus bodyA angle in the reference state (radians). float32 referenceAngle; - + /// The mass-spring-damper frequency in Hertz. Rotation only. /// Disable softness with a value of 0. float32 frequencyHz; diff --git a/include/Box2D/Dynamics/b2Body.h b/include/Box2D/Dynamics/b2Body.h index b94328d..a65eb3f 100644 --- a/include/Box2D/Dynamics/b2Body.h +++ b/include/Box2D/Dynamics/b2Body.h @@ -184,7 +184,7 @@ class b2Body /// Get the linear velocity of the center of mass. /// @return the linear velocity of the center of mass. - const b2Vec2& GetLinearVelocity() const; + b2Vec2 GetLinearVelocity() const; /// Set the angular velocity. /// @param omega the new angular velocity in radians/second. @@ -199,33 +199,28 @@ class b2Body /// affect the angular velocity. This wakes up the body. /// @param force the world force vector, usually in Newtons (N). /// @param point the world position of the point of application. - /// @param wake also wake up the body - void ApplyForce(const b2Vec2& force, const b2Vec2& point, bool wake); + void ApplyForce(const b2Vec2& force, const b2Vec2& point); /// Apply a force to the center of mass. This wakes up the body. /// @param force the world force vector, usually in Newtons (N). - /// @param wake also wake up the body - void ApplyForceToCenter(const b2Vec2& force, bool wake); + void ApplyForceToCenter(const b2Vec2& force); /// Apply a torque. This affects the angular velocity /// without affecting the linear velocity of the center of mass. /// This wakes up the body. /// @param torque about the z-axis (out of the screen), usually in N-m. - /// @param wake also wake up the body - void ApplyTorque(float32 torque, bool wake); + void ApplyTorque(float32 torque); /// Apply an impulse at a point. This immediately modifies the velocity. /// It also modifies the angular velocity if the point of application /// is not at the center of mass. This wakes up the body. /// @param impulse the world impulse vector, usually in N-seconds or kg-m/s. /// @param point the world position of the point of application. - /// @param wake also wake up the body - void ApplyLinearImpulse(const b2Vec2& impulse, const b2Vec2& point, bool wake); + void ApplyLinearImpulse(const b2Vec2& impulse, const b2Vec2& point); /// Apply an angular impulse. /// @param impulse the angular impulse in units of kg*m*m/s - /// @param wake also wake up the body - void ApplyAngularImpulse(float32 impulse, bool wake); + void ApplyAngularImpulse(float32 impulse); /// Get the total mass of the body. /// @return the mass, usually in kilograms (kg). @@ -320,7 +315,7 @@ class b2Body /// Set the sleep state of the body. A sleeping body has very /// low CPU cost. - /// @param flag set to true to wake the body, false to put it to sleep. + /// @param flag set to true to put body to sleep, false to wake it. void SetAwake(bool flag); /// Get the sleeping state of this body. @@ -390,18 +385,17 @@ class b2Body friend class b2ContactManager; friend class b2ContactSolver; friend class b2Contact; - + friend class b2DistanceJoint; - friend class b2FrictionJoint; friend class b2GearJoint; - friend class b2MotorJoint; + friend class b2WheelJoint; friend class b2MouseJoint; friend class b2PrismaticJoint; friend class b2PulleyJoint; friend class b2RevoluteJoint; - friend class b2RopeJoint; friend class b2WeldJoint; - friend class b2WheelJoint; + friend class b2FrictionJoint; + friend class b2RopeJoint; // m_flags enum @@ -511,7 +505,7 @@ inline void b2Body::SetLinearVelocity(const b2Vec2& v) m_linearVelocity = v; } -inline const b2Vec2& b2Body::GetLinearVelocity() const +inline b2Vec2 b2Body::GetLinearVelocity() const { return m_linearVelocity; } @@ -661,6 +655,20 @@ inline bool b2Body::IsActive() const return (m_flags & e_activeFlag) == e_activeFlag; } +inline void b2Body::SetFixedRotation(bool flag) +{ + if (flag) + { + m_flags |= e_fixedRotationFlag; + } + else + { + m_flags &= ~e_fixedRotationFlag; + } + + ResetMassData(); +} + inline bool b2Body::IsFixedRotation() const { return (m_flags & e_fixedRotationFlag) == e_fixedRotationFlag; @@ -734,101 +742,79 @@ inline void* b2Body::GetUserData() const return m_userData; } -inline void b2Body::ApplyForce(const b2Vec2& force, const b2Vec2& point, bool wake) +inline void b2Body::ApplyForce(const b2Vec2& force, const b2Vec2& point) { if (m_type != b2_dynamicBody) { return; } - if (wake && (m_flags & e_awakeFlag) == 0) + if (IsAwake() == false) { SetAwake(true); } - // Don't accumulate a force if the body is sleeping. - if (m_flags & e_awakeFlag) - { - m_force += force; - m_torque += b2Cross(point - m_sweep.c, force); - } + m_force += force; + m_torque += b2Cross(point - m_sweep.c, force); } -inline void b2Body::ApplyForceToCenter(const b2Vec2& force, bool wake) +inline void b2Body::ApplyForceToCenter(const b2Vec2& force) { if (m_type != b2_dynamicBody) { return; } - if (wake && (m_flags & e_awakeFlag) == 0) + if (IsAwake() == false) { SetAwake(true); } - // Don't accumulate a force if the body is sleeping - if (m_flags & e_awakeFlag) - { - m_force += force; - } + m_force += force; } -inline void b2Body::ApplyTorque(float32 torque, bool wake) +inline void b2Body::ApplyTorque(float32 torque) { if (m_type != b2_dynamicBody) { return; } - if (wake && (m_flags & e_awakeFlag) == 0) + if (IsAwake() == false) { SetAwake(true); } - // Don't accumulate a force if the body is sleeping - if (m_flags & e_awakeFlag) - { - m_torque += torque; - } + m_torque += torque; } -inline void b2Body::ApplyLinearImpulse(const b2Vec2& impulse, const b2Vec2& point, bool wake) +inline void b2Body::ApplyLinearImpulse(const b2Vec2& impulse, const b2Vec2& point) { if (m_type != b2_dynamicBody) { return; } - if (wake && (m_flags & e_awakeFlag) == 0) + if (IsAwake() == false) { SetAwake(true); } - - // Don't accumulate velocity if the body is sleeping - if (m_flags & e_awakeFlag) - { - m_linearVelocity += m_invMass * impulse; - m_angularVelocity += m_invI * b2Cross(point - m_sweep.c, impulse); - } + m_linearVelocity += m_invMass * impulse; + m_angularVelocity += m_invI * b2Cross(point - m_sweep.c, impulse); } -inline void b2Body::ApplyAngularImpulse(float32 impulse, bool wake) +inline void b2Body::ApplyAngularImpulse(float32 impulse) { if (m_type != b2_dynamicBody) { return; } - if (wake && (m_flags & e_awakeFlag) == 0) + if (IsAwake() == false) { SetAwake(true); } - - // Don't accumulate velocity if the body is sleeping - if (m_flags & e_awakeFlag) - { - m_angularVelocity += m_invI * impulse; - } + m_angularVelocity += m_invI * impulse; } inline void b2Body::SynchronizeTransform() diff --git a/include/Box2D/Dynamics/b2ContactManager.h b/include/Box2D/Dynamics/b2ContactManager.h index dc1f77f..90212c7 100644 --- a/include/Box2D/Dynamics/b2ContactManager.h +++ b/include/Box2D/Dynamics/b2ContactManager.h @@ -40,7 +40,7 @@ class b2ContactManager void Destroy(b2Contact* c); void Collide(); - + b2BroadPhase m_broadPhase; b2Contact* m_contactList; int32 m_contactCount; diff --git a/include/Box2D/Dynamics/b2World.h b/include/Box2D/Dynamics/b2World.h index 2ab26eb..3224736 100644 --- a/include/Box2D/Dynamics/b2World.h +++ b/include/Box2D/Dynamics/b2World.h @@ -54,7 +54,7 @@ class b2World /// Register a contact filter to provide specific control over collision. /// Otherwise the default filter is used (b2_defaultFilter). The listener is - /// owned by you and must remain in scope. + /// owned by you and must remain in scope. void SetContactFilter(b2ContactFilter* filter); /// Register a contact event listener. The listener is owned by you and must @@ -181,7 +181,7 @@ class b2World /// Change the global gravity vector. void SetGravity(const b2Vec2& gravity); - + /// Get the global gravity vector. b2Vec2 GetGravity() const; @@ -194,11 +194,6 @@ class b2World /// Get the flag that controls automatic clearing of forces after each time step. bool GetAutoClearForces() const; - /// Shift the world origin. Useful for large worlds. - /// The body shift formula is: position -= newOrigin - /// @param newOrigin the new origin with respect to the old origin - void ShiftOrigin(const b2Vec2& newOrigin); - /// Get the contact manager for testing. const b2ContactManager& GetContactManager() const; diff --git a/include/Box2D/Rope/b2Rope.h b/include/Box2D/Rope/b2Rope.h index bc5375d..a4b6cb4 100644 --- a/include/Box2D/Rope/b2Rope.h +++ b/include/Box2D/Rope/b2Rope.h @@ -23,7 +23,7 @@ class b2Draw; -/// +/// struct b2RopeDef { b2RopeDef() @@ -59,7 +59,7 @@ struct b2RopeDef float32 k3; }; -/// +/// class b2Rope { public: diff --git a/include/Chipmunk/ObjectiveChipmunk/ChipmunkBody.h b/include/Chipmunk/ObjectiveChipmunk/ChipmunkBody.h new file mode 100644 index 0000000..ad588b2 --- /dev/null +++ b/include/Chipmunk/ObjectiveChipmunk/ChipmunkBody.h @@ -0,0 +1,181 @@ +// Copyright 2013 Howling Moon Software. All rights reserved. +// See http://chipmunk2d.net/legal.php for more information. + +@class ChipmunkShape; +@class ChipmunkConstraint; + +/** + Rigid bodies are the basic unit of simulation in Chipmunk. + They hold the physical properties of an object (mass, position, rotation, velocity, etc.). After creating a ChipmunkBody object, you can attach collision shapes (ChipmunkShape) and joints (ChipmunkConstraint) to it. +*/ +@interface ChipmunkBody : NSObject { +@private + cpBody _body; + id _userData; +} + +/// Get the ChipmunkBody object associciated with a cpBody pointer. +/// Undefined if the cpBody wasn't created using Objective-Chipmunk. ++(ChipmunkBody *)bodyFromCPBody:(cpBody *)body; + +/** + Create an autoreleased rigid body with the given mass and moment. + Guessing the moment of inertia is usually a bad idea. Use the moment estimation functions (cpMomentFor*()). +*/ ++ (id)bodyWithMass:(cpFloat)mass andMoment:(cpFloat)moment; + +/** + Create an autoreleased static body. +*/ ++ (id)staticBody; + +/** + Create an autoreleased kinematic body. +*/ ++ (id)kinematicBody; + +/** + Initialize a rigid body with the given mass and moment of inertia. + Guessing the moment of inertia is usually a bad idea. Use the moment estimation functions (cpMomentFor*()). +*/ +- (id)initWithMass:(cpFloat)mass andMoment:(cpFloat)moment; + +/// Type of the body (dynamic, kinematic, static). +@property(nonatomic, assign) cpBodyType type; + +/// Mass of the rigid body. Mass does not have to be expressed in any particular units, but relative masses should be consistent. +@property(nonatomic, assign) cpFloat mass; + +/// Moment of inertia of the body. The mass tells you how hard it is to push an object, the MoI tells you how hard it is to spin the object. Don't try to guess the MoI, use the cpMomentFor*() functions to try and estimate it. +@property(nonatomic, assign) cpFloat moment; + +/// The position of the rigid body's center of gravity. +@property(nonatomic, assign) cpVect position; + +/// The linear velocity of the rigid body. +@property(nonatomic, assign) cpVect velocity; + +/// The linear force applied to the rigid body. Unlike in some physics engines, the force does not reset itself during each step. Make sure that you are reseting the force between frames if that is what you intended. +@property(nonatomic, assign) cpVect force; + +/// The rotation angle of the rigid body in radians. +@property(nonatomic, assign) cpFloat angle; + +/// The angular velocity of the rigid body in radians per second. +@property(nonatomic, assign) cpFloat angularVelocity; + +/// The torque being applied to the rigid body. Like force, this property is not reset every frame. +@property(nonatomic, assign) cpFloat torque; + +/// The rigid transform of the body. +@property(nonatomic, readonly) cpTransform transform; + +/// Returns a pointer to the underlying cpBody C struct. +@property(nonatomic, readonly) cpBody *body; + +/** + An object that this constraint is associated with. You can use this get a reference to your game object or controller object from within callbacks. + @attention Like most @c delegate properties this is a weak reference and does not call @c retain. This prevents reference cycles from occuring. +*/ +@property(nonatomic, assign) id userData; + +/// Maximum velocity allowed for this body. Defaults to @c INFINITY. +@property(nonatomic, assign) cpFloat velocityLimit; + +/// Maximum angular velocity allowed for this body. Defaults to @c INFINITY. +@property(nonatomic, assign) cpFloat angularVelocityLimit; + +/// Has the body been put to sleep by the space? +@property(nonatomic, readonly) bool isSleeping; + +/// Get the kinetic energy of this body. +@property(nonatomic, readonly) cpFloat kineticEnergy; + +/// Get the space the body is added to. +@property(nonatomic, readonly) ChipmunkSpace *space; + +/** + Convert from body local to world coordinates. + Convert a point in world (absolute) coordinates to body local coordinates affected by the position and rotation of the rigid body. +*/ +- (cpVect)localToWorld:(cpVect)v; + +/** + Convert from world to body local Coordinates. + Convert a point in body local coordinates coordinates to world (absolute) coordinates. +*/ +- (cpVect)worldToLocal:(cpVect)v; + +/** + Get the velocity of a point on a body. + Get the world (absolute) velocity of a point on a rigid body specified in body local coordinates. +*/ +- (cpVect)velocityAtLocalPoint:(cpVect)p; + +/** + Get the velocity of a point on a body. + Get the world (absolute) velocity of a point on a rigid body specified in world coordinates. +*/ +- (cpVect)velocityAtWorldPoint:(cpVect)p; + +/** + Apply a force to a rigid body. An offset of cpvzero is equivalent to adding directly to the force property. + @param force A force in expressed in absolute (word) coordinates. + @param offset An offset expressed in world coordinates. Note that it is still an offset, meaning that it's position is relative, but the rotation is not. +*/ +- (void)applyForce:(cpVect)force atLocalPoint:(cpVect)point; +- (void)applyForce:(cpVect)force atWorldPoint:(cpVect)point; + +/** + Apply an impulse to a rigid body. + @param impulse An impulse in expressed in absolute (word) coordinates. + @param offset An offset expressed in world coordinates. Note that it is still an offset, meaning that it's position is relative, but the rotation is not. +*/ +- (void)applyImpulse:(cpVect)impulse atLocalPoint:(cpVect)point; +- (void)applyImpulse:(cpVect)impulse atWorldPoint:(cpVect)point; + +/// Wake up the body if it's sleeping, or reset the idle timer if it's active. +- (void)activate; + +/// Wake up any bodies touching a static body through shape @c filter Pass @c nil for @c filter to away all touching bodies. +- (void)activateStatic:(ChipmunkShape *)filter; + +/** + Force the body to sleep immediately. The body will be added to the same group as @c group. When any object in a group is woken up, all of the bodies are woken up with it. + If @c group is nil, then a new group is created and the body is added to it. It is an error pass a non-sleeping body as @c group. + This is useful if you want an object to be inactive until something hits it such as a pile of boxes you want the player to plow through or a stalactite hanging from a cave ceiling. + Make sure the body is fully set up before you call this. Adding this body or any shapes or constraints attached to it to a space, or modifying any of their properties automatically wake a body up. +*/ +- (void)sleepWithGroup:(ChipmunkBody *)group; + +/** + Equivalent to [ChipmunkBody sleepWithGroup:nil]. That is the object is forced to sleep immediately, but is not grouped with any other sleeping bodies. +*/ +- (void)sleep; + +/// Get a list of shapes that are attached to this body and currently added to a space. +- (NSArray *)shapes; + +/// Get a list of constraints that are attached to this body and currently added to a space. +- (NSArray *)constraints; + +/// Body/arbiter iterator callback block type. +typedef void (^ChipmunkBodyArbiterIteratorBlock)(cpArbiter *arbiter); + +/// Call @c block once for each arbiter that is currently active on the body. +- (void)eachArbiter:(ChipmunkBodyArbiterIteratorBlock)block; + +/// Implements the ChipmunkBaseObject protocol, not particularly useful outside of the library code +- (void)addToSpace:(ChipmunkSpace *)space; +/// Implements the ChipmunkBaseObject protocol, not particularly useful outside of the library code +- (void)removeFromSpace:(ChipmunkSpace *)space; + +/// Override this to change the way that the body's velocity is integrated. +/// You should either understand how the cpBodyUpdateVelocity() function works, or use the super method. +-(void)updateVelocity:(cpFloat)dt gravity:(cpVect)gravity damping:(cpFloat)damping; + +/// OVerride this to change the way that the body's position is intgrated. +/// You should either understand how the cpBodyUpdatePosition() function works, or use the super method. +-(void)updatePosition:(cpFloat)dt; + +@end diff --git a/include/Chipmunk/ObjectiveChipmunk/ChipmunkConstraint.h b/include/Chipmunk/ObjectiveChipmunk/ChipmunkConstraint.h new file mode 100644 index 0000000..034a6b6 --- /dev/null +++ b/include/Chipmunk/ObjectiveChipmunk/ChipmunkConstraint.h @@ -0,0 +1,417 @@ +// Copyright 2013 Howling Moon Software. All rights reserved. +// See http://chipmunk2d.net/legal.php for more information. + +/** + Constraints connect two ChipmunkBody objects together. Most often constraints are simple joints, but can also be things like motors, friction generators or servos. + + @htmlonly + + + + + + @endhtmlonly +*/ +@interface ChipmunkConstraint : NSObject { +@private + id _userData; +} + +/// Returns a pointer to the underlying cpConstraint C struct. +@property(nonatomic, readonly) cpConstraint *constraint; + +/// The first ChipmunkBody the constraint controls. +@property(nonatomic, readonly) ChipmunkBody *bodyA; + +/// The second ChipmunkBody the constraint controls. +@property(nonatomic, readonly) ChipmunkBody *bodyB; + +/// Get the ChipmunkConstraint object associciated with a cpConstraint pointer. +/// Undefined if the cpConstraint wasn't created using Objective-Chipmunk. ++(ChipmunkConstraint *)constraintFromCPConstraint:(cpConstraint *)constraint; + +/** + Maximum force this constraint is allowed to use (defalts to infinity). + This allows joints to be pulled apart if too much force is applied to them. + It also allows you to use constraints as force or friction generators for controlling bodies. +*/ +@property(nonatomic, assign) cpFloat maxForce; + +/** + The rate at which joint error is corrected. + Defaults to pow(1.0 - 0.1, 60.0) meaning that it will correct 10% of the error every 1/60th of a second. +*/ +@property(nonatomic, assign) cpFloat errorBias; + +/** + Maximum rate (speed) that a joint can be corrected at (defaults to infinity). + Setting this value to a finite value allows you to control a joint like a servo motor. +*/ +@property(nonatomic, assign) cpFloat maxBias; + +/** + Whether or not the connected bodies should checked for collisions. + Collisions are filtered before calling callbacks. + Defaults to TRUE. +*/ +@property(nonatomic, assign) BOOL collideBodies; + +/// Get the most recent impulse applied by this constraint. +@property(nonatomic, readonly) cpFloat impulse; + +/// Get the space the body is added to. +@property(nonatomic, readonly) ChipmunkSpace *space; + +/** + An object that this constraint is associated with. You can use this get a reference to your game object or controller object from within callbacks. + @attention Like most @c delegate properties this is a weak reference and does not call @c retain. This prevents reference cycles from occuring. +*/ +@property(nonatomic, assign) id userData; + +/// Override this method to update a constraints parameters just before running the physics each step. +-(void)preSolve:(ChipmunkSpace *)space; + +/// Override this method to poll values from a constraint each frame after the physics runs. +/// This can be used to implement breakable joints for instance. +-(void)postSolve:(ChipmunkSpace *)space; + +@end + + +/** + Pin joints hold a set distance between points on two bodies. + Think of them as connecting a solid pin or rod between the two anchor points. +*/ +@interface ChipmunkPinJoint : ChipmunkConstraint { +@private + cpPinJoint _constraint; +} + +/** + Create an autoreleased pin joint between the two bodies with the given anchor points. + The distance is calculated when the joint is initialized. It can be set explicitly using the property. +*/ ++ (ChipmunkPinJoint *)pinJointWithBodyA:(ChipmunkBody *)a bodyB:(ChipmunkBody *)b anchr1:(cpVect)anchr1 anchr2:(cpVect)anchr2; + +/** + Initialize a pin joint between the two bodies with the given anchor points. + The distance is calculated when the joint is initialized. It can be set explicitly using the property. +*/ +- (id)initWithBodyA:(ChipmunkBody *)a bodyB:(ChipmunkBody *)b anchr1:(cpVect)anchr1 anchr2:(cpVect)anchr2; + +/// The anchor point on the first body. +@property(nonatomic, assign) cpVect anchr1; + +/// The anchor point on the second body. +@property(nonatomic, assign) cpVect anchr2; + +/// The distance between the two anchor points that the joint keeps. +@property(nonatomic, assign) cpFloat dist; + +@end + + +/** + Slide joints hold the distance between points on two bodies between a minimum and a maximum. + Think of them as a telescoping ChipmunkPinJoint. +*/ +@interface ChipmunkSlideJoint : ChipmunkConstraint { +@private + cpSlideJoint _constraint; +} + +/** + Create an autoreleased slide joint between the two bodies with the given anchor points and distance range. +*/ ++ (ChipmunkSlideJoint *)slideJointWithBodyA:(ChipmunkBody *)a bodyB:(ChipmunkBody *)b anchr1:(cpVect)anchr1 anchr2:(cpVect)anchr2 min:(cpFloat)min max:(cpFloat)max; + +/** + Initialize a slide joint between the two bodies with the given anchor points and distance range. +*/ +- (id)initWithBodyA:(ChipmunkBody *)a bodyB:(ChipmunkBody *)b anchr1:(cpVect)anchr1 anchr2:(cpVect)anchr2 min:(cpFloat)min max:(cpFloat)max; + +/// The anchor point on the first body. +@property(nonatomic, assign) cpVect anchr1; + +/// The anchor point on the second body. +@property(nonatomic, assign) cpVect anchr2; + +/// The minimum allowed distance between anchor points. +@property(nonatomic, assign) cpFloat min; + +/// The maximum allowed distance between anchor points. +@property(nonatomic, assign) cpFloat max; + +@end + + +/** + Pivot joints hold two points on two bodies together allowing them to rotate freely around the pivot. +*/ +@interface ChipmunkPivotJoint : ChipmunkConstraint { +@private + cpPivotJoint _constraint; +} + +/** + Create an autoreleased pivot joint between the two bodies with the two anchor points. + Make sure you have the bodies in the right place as the joint will fix itself as soon as you start simulating the space. +*/ ++ (ChipmunkPivotJoint *)pivotJointWithBodyA:(ChipmunkBody *)a bodyB:(ChipmunkBody *)b anchr1:(cpVect)anchr1 anchr2:(cpVect)anchr2; + +/** + Create an autoreleased pivot joint between the two bodies by calculating the anchor points from the pivot point given in absolute coordinates. +*/ ++ (ChipmunkPivotJoint *)pivotJointWithBodyA:(ChipmunkBody *)a bodyB:(ChipmunkBody *)b pivot:(cpVect)pivot; + +/** + Initialize a pivot joint between the two bodies with the two anchor points. + Make sure you have the bodies in the right place as the joint will fix itself as soon as you start simulating the space. +*/ +- (id)initWithBodyA:(ChipmunkBody *)a bodyB:(ChipmunkBody *)b anchr1:(cpVect)anchr1 anchr2:(cpVect)anchr2; + +/** + Initialize a pivot joint between the two bodies by calculating the anchor points from the pivot point given in absolute coordinates. +*/ +- (id)initWithBodyA:(ChipmunkBody *)a bodyB:(ChipmunkBody *)b pivot:(cpVect)pivot; + +/// The anchor point on the first body. +@property(nonatomic, assign) cpVect anchr1; + +/// The anchor point on the second body. +@property(nonatomic, assign) cpVect anchr2; + +@end + + +/** + Groove joints hold a pivot point on one body to line along a line segment on another like a pin in a groove. +*/ +@interface ChipmunkGrooveJoint : ChipmunkConstraint { +@private + cpGrooveJoint _constraint; +} + +/** + Create an autoreleased groove joint between the two bodies. + Make sure you have the bodies in the right place as the joint will snap into shape as soon as you start simulating the space. + @param groove_a The start of the line segment on the first body. + @param groove_b The end of the line segment on the first body. + @param anchr2 The anchor point on the second body that is held to the line segment on the first. +*/ ++ (ChipmunkGrooveJoint *)grooveJointWithBodyA:(ChipmunkBody *)a bodyB:(ChipmunkBody *)b groove_a:(cpVect)groove_a groove_b:(cpVect)groove_b anchr2:(cpVect)anchr2; + +/** + Initialize a groove joint between the two bodies. + Make sure you have the bodies in the right place as the joint will snap into shape as soon as you start simulating the space. + @param groove_a The start of the line segment on the first body. + @param groove_b The end of the line segment on the first body. + @param anchr2 The anchor point on the second body that is held to the line segment on the first. +*/ +- (id)initWithBodyA:(ChipmunkBody *)a bodyB:(ChipmunkBody *)b groove_a:(cpVect)groove_a groove_b:(cpVect)groove_b anchr2:(cpVect)anchr2; + +/// The start point of the groove on the first body. +@property(nonatomic, assign) cpVect grooveA; +/// The end point of the groove on the first body. +@property(nonatomic, assign) cpVect grooveB; + +/// The anchor point on the second body. +@property(nonatomic, assign) cpVect anchr2; + +@end + + +/** + A spring with a damper. + While a spring is not technically a constraint, the damper is. The spring forces are simply a convenience. +*/ +@interface ChipmunkDampedSpring : ChipmunkConstraint { +@private + cpDampedSpring _constraint; +} + +/** + Create an autoreleased damped spring between two bodies at the given anchor points. + @param restLength The length the spring wants to contract or expand to. + @param stiffness The young's modulus of the spring. + @param damping The amount of viscous damping to apply. +*/ ++ (ChipmunkDampedSpring *)dampedSpringWithBodyA:(ChipmunkBody *)a bodyB:(ChipmunkBody *)b anchr1:(cpVect)anchr1 anchr2:(cpVect)anchr2 restLength:(cpFloat)restLength stiffness:(cpFloat)stiffness damping:(cpFloat)damping; + +/** + Initialize a damped spring between two bodies at the given anchor points. + @param restLength The length the spring wants to contract or expand to. + @param stiffness The young's modulus of the spring. + @param damping The amount of viscous damping to apply. +*/ +- (id)initWithBodyA:(ChipmunkBody *)a bodyB:(ChipmunkBody *)b anchr1:(cpVect)anchr1 anchr2:(cpVect)anchr2 restLength:(cpFloat)restLength stiffness:(cpFloat)stiffness damping:(cpFloat)damping; + +/// The anchor point on the first body. +@property(nonatomic, assign) cpVect anchr1; + +/// The anchor point on the second body. +@property(nonatomic, assign) cpVect anchr2; + +/// The length the spring wants to contract or expand to. +@property(nonatomic, assign) cpFloat restLength; + +/// The young's modulus of the spring. +@property(nonatomic, assign) cpFloat stiffness; + +/// The amount of viscous damping to apply. +@property(nonatomic, assign) cpFloat damping; + +@end + + +/** + Like a ChipmunkDampedSpring, but operates in a rotational fashion. +*/ +@interface ChipmunkDampedRotarySpring : ChipmunkConstraint { +@private + cpDampedRotarySpring _constraint; +} + + +/** + Create an autoreleased damped rotary spring between the given bodies. + @param restAngle The angular offset in radians the spring attempts to keep between the two bodies. + @param stiffness The young's modulus of the spring. + @param damping The amount of viscous damping to apply. +*/ ++ (ChipmunkDampedRotarySpring *)dampedRotarySpringWithBodyA:(ChipmunkBody *)a bodyB:(ChipmunkBody *)b restAngle:(cpFloat)restAngle stiffness:(cpFloat)stiffness damping:(cpFloat)damping; + +/** + Initialize a damped rotary spring between the given bodies. + @param restAngle The angular offset in radians the spring attempts to keep between the two bodies. + @param stiffness The young's modulus of the spring. + @param damping The amount of viscous damping to apply. +*/ +- (id)initWithBodyA:(ChipmunkBody *)a bodyB:(ChipmunkBody *)b restAngle:(cpFloat)restAngle stiffness:(cpFloat)stiffness damping:(cpFloat)damping; + +/// The angular offset the spring attempts to keep between the two bodies. +@property(nonatomic, assign) cpFloat restAngle; + +/// The young's modulus of the spring. +@property(nonatomic, assign) cpFloat stiffness; + +/// The amount of viscous damping to apply. +@property(nonatomic, assign) cpFloat damping; + +@end + + +/** + Constrains the angle between two bodies. + This joint is often used in conjuction with a separate ChipmunkPivotJoint in order to limit the rotation around the pivot. +*/ +@interface ChipmunkRotaryLimitJoint : ChipmunkConstraint { +@private + cpRotaryLimitJoint _constraint; +} + +/** + Create an autoreleased rotary limit joint between the two bodies and angular range in radians. + Make sure you have the bodies in the right place as the joint will snap into shape as soon as you start simulating the space. +*/ ++ (ChipmunkRotaryLimitJoint *)rotaryLimitJointWithBodyA:(ChipmunkBody *)a bodyB:(ChipmunkBody *)b min:(cpFloat)min max:(cpFloat)max; + +/** + Create an autoreleased rotary limit joint between the two bodies and angular range in radians. + Make sure you have the bodies in the right place as the joint will snap into shape as soon as you start simulating the space. +*/ +- (id)initWithBodyA:(ChipmunkBody *)a bodyB:(ChipmunkBody *)b min:(cpFloat)min max:(cpFloat)max; + +/// The minimum angular delta of the joint in radians. +@property(nonatomic, assign) cpFloat min; + +/// The maximum angular delta of the joint in radians. +@property(nonatomic, assign) cpFloat max; + +@end + + +/** + Simple motors make two objects spin relative to each other. + They are most often used with the ChipmunkConstraint.maxForce property set to a finite value. +*/ +@interface ChipmunkSimpleMotor : ChipmunkConstraint { +@private + cpSimpleMotor _constraint; +} + +/// Create an autoreleased simple motor between the given bodies and relative rotation rate in radians per second. ++ (ChipmunkSimpleMotor *)simpleMotorWithBodyA:(ChipmunkBody *)a bodyB:(ChipmunkBody *)b rate:(cpFloat)rate; + +/// Initialize a simple motor between the given bodies and relative rotation rate in radians per second. +- (id)initWithBodyA:(ChipmunkBody *)a bodyB:(ChipmunkBody *)b rate:(cpFloat)rate; + +/// The relative rotation speed of the two bodies in radians per second. +@property(nonatomic, assign) cpFloat rate; + +@end + + +/** + Gear joints constrain the rotational speed of one body to another. + A ratio of 1.0 will lock the rotation of two bodies together, and negative ratios will cause them to spin in opposite directions. + You can also use gear joints as rotary servos by setting ChipmunkConstraint.maxForce and ChipmunkConstraint.maxBias to finite values and changing the ChipmunkGearJoint.phase property. +*/ +@interface ChipmunkGearJoint : ChipmunkConstraint { +@private + cpGearJoint _constraint; +} + +/** + Create an autoreleased gear joint between the given bodies. + @param phase The angular offset. + @param ratio The ratio of the rotational speeds. +*/ ++ (ChipmunkGearJoint *)gearJointWithBodyA:(ChipmunkBody *)a bodyB:(ChipmunkBody *)b phase:(cpFloat)phase ratio:(cpFloat)ratio; + +/** + Initialize a gear joint between the given bodies. + @param phase The angular offset in radians. + @param ratio The ratio of the rotational speeds. +*/ +- (id)initWithBodyA:(ChipmunkBody *)a bodyB:(ChipmunkBody *)b phase:(cpFloat)phase ratio:(cpFloat)ratio; + +/// The angular offset in radians. +@property(nonatomic, assign) cpFloat phase; +/// The ratio of the rotational speeds. +@property(nonatomic, assign) cpFloat ratio; + +@end + +/** + Ratchet joints create rotary ratches similar to a socket wrench. +*/ +@interface ChipmunkRatchetJoint : ChipmunkConstraint { +@private + cpRatchetJoint _constraint; +} + +/** + Create an autoreleased ratchet joint between the given bodies. + @param phase The angular offset of the ratchet positions in radians. + @param ratchet The angle in radians of each ratchet position. Negative values cause the ratchet to operate in the opposite direction. +*/ ++ (ChipmunkRatchetJoint *)ratchetJointWithBodyA:(ChipmunkBody *)a bodyB:(ChipmunkBody *)b phase:(cpFloat)phase ratchet:(cpFloat)ratchet; + +/** + Initialize a ratchet joint between the given bodies. + @param phase The angular offset of the ratchet positions in radians. + @param ratchet The angle in radians of each ratchet position. Negative values cause the ratchet to operate in the opposite direction. +*/ +- (id)initWithBodyA:(ChipmunkBody *)a bodyB:(ChipmunkBody *)b phase:(cpFloat)phase ratchet:(cpFloat)ratchet; + +/// The current ratchet position in radians. +@property(nonatomic, assign) cpFloat angle; + +/// The angular offset of the ratchet positions in radians +@property(nonatomic, assign) cpFloat phase; + +/// The angle in radians of each ratchet position. Negative values cause the ratchet to operate in the opposite direction. +@property(nonatomic, assign) cpFloat ratchet; + +@end diff --git a/include/Chipmunk/ObjectiveChipmunk/ChipmunkExtras.h b/include/Chipmunk/ObjectiveChipmunk/ChipmunkExtras.h new file mode 100644 index 0000000..99d9e2f --- /dev/null +++ b/include/Chipmunk/ObjectiveChipmunk/ChipmunkExtras.h @@ -0,0 +1,5 @@ +// Copyright 2013 Howling Moon Software. All rights reserved. +// See http://chipmunk2d.net/legal.php for more information. + +//#define ChipmunkGetObject(s) s->data +//#define ChipmunkGetData(s) [s->data data] diff --git a/include/Chipmunk/ObjectiveChipmunk/ChipmunkMultiGrab.h b/include/Chipmunk/ObjectiveChipmunk/ChipmunkMultiGrab.h new file mode 100644 index 0000000..2830848 --- /dev/null +++ b/include/Chipmunk/ObjectiveChipmunk/ChipmunkMultiGrab.h @@ -0,0 +1,118 @@ +// Copyright 2013 Howling Moon Software. All rights reserved. +// See http://chipmunk2d.net/legal.php for more information. + +#import "ObjectiveChipmunk.h" + +@interface ChipmunkGrab : NSObject { + NSArray *_chipmunkObjects; + + cpVect _pos; + cpFloat _smoothing; + + ChipmunkShape *_grabbedShape; + + id _data; +} + +/// Last touch location of the grab. +@property(nonatomic, readonly) cpVect pos; + +/// The ChipmunkShape that this grab was created for. +@property(nonatomic, readonly) ChipmunkShape *grabbedShape; + +/// User definable pointer +@property(nonatomic, retain) id data; + +@end + + +/// Simple class to implement multitouch grabbing of physics objects. +@interface ChipmunkMultiGrab : NSObject { + ChipmunkSpace *_space; + NSMutableArray *_grabs; + + cpFloat _smoothing; + cpFloat _grabForce; + + cpFloat _grabFriction; + cpFloat _grabRotaryFriction; + cpFloat _grabRadius; + + cpShapeFilter filter; + bool (^_grabFilter)(ChipmunkShape *shape); + cpFloat (^_grabSort)(ChipmunkShape *shape, cpFloat depth); + + bool _pushMode, _pullMode; + + cpFloat _pushMass; + cpFloat _pushFriction; + cpFloat _pushElasticity; + cpCollisionType _pushCollisionType; +} + +@property(nonatomic, assign) cpFloat smoothing; +@property(nonatomic, assign) cpFloat grabForce; + +/// Layers used for the point query when grabbing objects. +@property(nonatomic, assign) cpShapeFilter filter; + +/// Group used for the point query when grabbing objects +@property(nonatomic, assign) cpGroup group; + +/// Gives you the opportunity to further filter shapes. Return FALSE to ignore a shape. +/// The default implementation always returns TRUE. +@property(nonatomic, copy) bool (^grabFilter)(ChipmunkShape *shape); + +/// When clicking on a spot where two shapes overlap, the default behavior is to grab the shape that +/// overlaps the grab point the most. It's possible to use a custom sorting order instead however. +/// The block is called with each shape and the grab depth. +/// It should return a positive float. The shape with the highest value is grabbed. +/// The block is only called if the touch location is within a shape. +@property(nonatomic, copy) cpFloat (^grabSort)(ChipmunkShape *shape, cpFloat depth); + +/// Amount of friction applied by the touch. +/// Should be less than the grabForce. Defaults to 0.0. +@property(nonatomic, assign) cpFloat grabFriction; + +/// The amount torque to apply to the grab to keep it from spinning. +/// Defaults to 0.0. +@property(nonatomic, assign) cpFloat grabRotaryFriction; + +/// On a touch screen, a single point query can make it really hard to grab small objects with a fat finger. +/// By providing a radius, it will make it much easier for users to grab objects. +/// Defaults to 0.0. +@property(nonatomic, assign) cpFloat grabRadius; + +@property(nonatomic, assign) bool pullMode; +@property(nonatomic, assign) bool pushMode; + +@property(nonatomic, assign) cpFloat pushMass; +@property(nonatomic, assign) cpFloat pushFriction; +@property(nonatomic, assign) cpFloat pushElasticity; +@property(nonatomic, assign) cpCollisionType pushCollisionType; + +@property(nonatomic, readonly) NSArray *grabs; + + +/** + @c space is the space to grab shapes in. + @c smoothing is the amount of mouse smoothing to apply as percentage of remaining error per second. + cpfpow(0.8, 60) is a good starting point that provides fast response, but smooth mouse updates. + @c force is the force the grab points can apply. +*/ +-(id)initForSpace:(ChipmunkSpace *)space withSmoothing:(cpFloat)smoothing withGrabForce:(cpFloat)grabForce; + +/// Start tracking a new grab point +/// Returns the ChipmunkGrab that is tracking the touch, but only if a shape was grabbed. +/// Returns nil when creating a push shape (if push mode is enabled), or when no shape is grabbed. +-(ChipmunkGrab *)beginLocation:(cpVect)pos; + +/// Update a grab point. +/// Returns the ChipmunkGrab that is tracking the touch, but only if the grab is tracking a shape. +-(ChipmunkGrab *)updateLocation:(cpVect)pos; + +/// End a grab point. +/// Returns the ChipmunkGrab that was tracking the touch, but only if the grab was tracking a shape. +-(ChipmunkGrab *)endLocation:(cpVect)pos; + +@end diff --git a/include/Chipmunk/ObjectiveChipmunk/ChipmunkShape.h b/include/Chipmunk/ObjectiveChipmunk/ChipmunkShape.h new file mode 100644 index 0000000..0a4f5ea --- /dev/null +++ b/include/Chipmunk/ObjectiveChipmunk/ChipmunkShape.h @@ -0,0 +1,243 @@ +// Copyright 2013 Howling Moon Software. All rights reserved. +// See http://chipmunk2d.net/legal.php for more information. + +@class ChipmunkPointQueryInfo; +@class ChipmunkSegmentQueryInfo; + + +/// Abstract base class for collsion shape types. +@interface ChipmunkShape : NSObject { +@private + id _userData; +} + +/// Get the ChipmunkShape object associciated with a cpShape pointer. +/// Undefined if the cpShape wasn't created using Objective-Chipmunk. ++(ChipmunkShape *)shapeFromCPShape:(cpShape *)shape; + +/// Returns a pointer to the underlying cpShape C struct. +@property(nonatomic, readonly) cpShape *shape; + +/// The ChipmunkBody that this shape is attached to. +@property(nonatomic, retain) ChipmunkBody *body; + +// TODO doc +@property(nonatomic, assign) cpFloat mass; +@property(nonatomic, assign) cpFloat density; +@property(nonatomic, readonly) cpFloat moment; +@property(nonatomic, readonly) cpFloat area; +@property(nonatomic, readonly) cpVect centerOfGravity; + +/// The axis-aligned bounding box for this shape. +@property(nonatomic, readonly) cpBB bb; + +/// Sensor shapes send collision callback messages, but don't create a collision response. +@property(nonatomic, assign) BOOL sensor; + +/// How bouncy this shape is. +@property(nonatomic, assign) cpFloat elasticity; + +/// How much friction this shape has. +@property(nonatomic, assign) cpFloat friction; + +/** + The velocity of the shape's surface. + This velocity is used in the collision response when calculating the friction only. +*/ +@property(nonatomic, assign) cpVect surfaceVelocity; + +/** + An object reference used as a collision type identifier. This is used when defining collision handlers. + @attention Like most @c delegate properties this is a weak reference and does not call @c retain. +*/ +@property(nonatomic, assign) cpCollisionType collisionType; + +/** + An object reference used as a collision group identifier. Shapes with the same group do not collide. + @attention Like most @c delegate properties this is a weak reference and does not call @c retain. +*/ +@property(nonatomic, assign) cpGroup group; + +@property(nonatomic, assign) cpShapeFilter filter; + +/// Get the space the body is added to. +@property(nonatomic, readonly) ChipmunkSpace *space; + +/** + An object that this shape is associated with. You can use this get a reference to your game object or controller object from within callbacks. + @attention Like most @c delegate properties this is a weak reference and does not call @c retain. This prevents reference cycles from occuring. +*/ +@property(nonatomic, assign) id userData; + +/// Update and cache the axis-aligned bounding box for this shape. +- (cpBB)cacheBB; + +- (ChipmunkPointQueryInfo *)pointQuery:(cpVect)point; +- (ChipmunkSegmentQueryInfo *)segmentQueryFrom:(cpVect)start to:(cpVect)end radius:(cpFloat)radius; + +@end + + +@interface ChipmunkPointQueryInfo : NSObject { + @private + cpPointQueryInfo _info; +} + +- (id)initWithInfo:(cpPointQueryInfo *)info; + +/// Returns a pointer to the underlying cpNearestPointQueryInfo C struct. +@property(nonatomic, readonly) cpPointQueryInfo *info; + +/// The ChipmunkShape found. +@property(nonatomic, readonly) ChipmunkShape *shape; + +/// The closest point on the surface of the shape to the point. +@property(nonatomic, readonly) cpVect point; + +/// The distance between the point and the surface of the shape. +/// Negative distances mean that the point is that depth inside the shape. +@property(nonatomic, readonly) cpFloat distance; + +/// The gradient of the signed distance function. +/// The same as info.point/info.dist, but accurate even for very small values of info.dist. +@property(nonatomic, readonly) cpVect gradient; + +@end + + +/// Holds collision information from segment queries. You should never need to create one. +@interface ChipmunkSegmentQueryInfo : NSObject { +@private + cpSegmentQueryInfo _info; + cpVect _start, _end; +} + +- (id)initWithInfo:(cpSegmentQueryInfo *)info start:(cpVect)start end:(cpVect)end; + +/// Returns a pointer to the underlying cpSegmentQueryInfo C struct. +@property(nonatomic, readonly) cpSegmentQueryInfo *info; + +/// The ChipmunkShape found. +@property(nonatomic, readonly) ChipmunkShape *shape; + +/// The percentage between the start and end points where the collision occurred. +@property(nonatomic, readonly) cpFloat t; + +/// The normal of the collision with the shape. +@property(nonatomic, readonly) cpVect normal; + +/// The point of the collision in absolute (world) coordinates. +@property(nonatomic, readonly) cpVect point; + +/// The distance from the start point where the collision occurred. +@property(nonatomic, readonly) cpFloat dist; + +/// The start point. +@property(nonatomic, readonly) cpVect start; + +/// The end point. +@property(nonatomic, readonly) cpVect end; + +@end + + +/// Holds collision information from segment queries. You should never need to create one. +@interface ChipmunkShapeQueryInfo : NSObject { +@private + ChipmunkShape *_shape; + cpContactPointSet _contactPoints; +} + +- (id)initWithShape:(ChipmunkShape *)shape andPoints:(cpContactPointSet *)set; + +@property(nonatomic, readonly) ChipmunkShape *shape; +@property(nonatomic, readonly) cpContactPointSet *contactPoints; + +@end + + +/// A perfect circle shape. +@interface ChipmunkCircleShape : ChipmunkShape { +@private + cpCircleShape _shape; +} + +/// Create an autoreleased circle shape with the given radius and offset from the center of gravity. ++ (id)circleWithBody:(ChipmunkBody *)body radius:(cpFloat)radius offset:(cpVect)offset; + +/// Initialize a circle shape with the given radius and offset from the center of gravity. +- (id)initWithBody:(ChipmunkBody *)body radius:(cpFloat)radius offset:(cpVect)offset; + +/// The radius of the circle. +@property(nonatomic, readonly) cpFloat radius; + +/// The offset from the center of gravity. +@property(nonatomic, readonly) cpVect offset; + +@end + + +/// A beveled (rounded) segment shape. +@interface ChipmunkSegmentShape : ChipmunkShape { +@private + cpSegmentShape _shape; +} + +/// Create an autoreleased segment shape with the given endpoints and radius. ++ (id)segmentWithBody:(ChipmunkBody *)body from:(cpVect)a to:(cpVect)b radius:(cpFloat)radius; + +/// Initialize a segment shape with the given endpoints and radius. +- (id)initWithBody:(ChipmunkBody *)body from:(cpVect)a to:(cpVect)b radius:(cpFloat)radius; + +/// Let Chipmunk know about the geometry of adjacent segments to avoid colliding with endcaps. +- (void)setPrevNeighbor:(cpVect)prev nextNeighbor:(cpVect)next; + +/// The start of the segment shape. +@property(nonatomic, readonly) cpVect a; + +/// The end of the segment shape. +@property(nonatomic, readonly) cpVect b; + +/// The normal of the segment shape. +@property(nonatomic, readonly) cpVect normal; + +/// The beveling radius of the segment shape. +@property(nonatomic, readonly) cpFloat radius; + +@end + + +/// A convex polygon shape. +@interface ChipmunkPolyShape : ChipmunkShape { +@private + cpPolyShape _shape; +} + +/// Create an autoreleased polygon shape from the given vertexes after applying the transform and with the given rounding radius. ++ (id)polyWithBody:(ChipmunkBody *)body count:(int)count verts:(const cpVect *)verts transform:(cpTransform)transform radius:(cpFloat)radius; + +/// Create an autoreleased box shape centered on the center of gravity. ++ (id)boxWithBody:(ChipmunkBody *)body width:(cpFloat)width height:(cpFloat)height radius:(cpFloat)radius; + +/// Create an autoreleased box shape with the given bounding box in body local coordinates and rounding radius. ++ (id)boxWithBody:(ChipmunkBody *)body bb:(cpBB)bb radius:(cpFloat)radius; + +/// Initialize a polygon shape from the given vertexes after applying the transform and with the given rounding radius. +- (id)initWithBody:(ChipmunkBody *)body count:(int)count verts:(const cpVect *)verts transform:(cpTransform)transform radius:(cpFloat)radius; + +/// Initialize a box shape centered on the center of gravity. +- (id)initBoxWithBody:(ChipmunkBody *)body width:(cpFloat)width height:(cpFloat)height radius:(cpFloat)radius; + +/// Initialize a box shape with the given bounding box in body local coordinates and rounding radius. +- (id)initBoxWithBody:(ChipmunkBody *)body bb:(cpBB)bb radius:(cpFloat)radius; + +/// The number of vertexes in this polygon. +@property(nonatomic, readonly) int count; + +/// Get the rounding radius of the polygon. +@property(nonatomic, readonly) cpFloat radius; + +/// Access the vertexes of this polygon. +- (cpVect)getVertex:(int)index; + +@end diff --git a/include/Chipmunk/ObjectiveChipmunk/ChipmunkSpace.h b/include/Chipmunk/ObjectiveChipmunk/ChipmunkSpace.h new file mode 100644 index 0000000..c532db7 --- /dev/null +++ b/include/Chipmunk/ObjectiveChipmunk/ChipmunkSpace.h @@ -0,0 +1,269 @@ +// Copyright 2013 Howling Moon Software. All rights reserved. +// See http://chipmunk2d.net/legal.php for more information. + +/** + Chipmunk spaces are simulation containers. You add a bunch of physics objects to a space (rigid bodies, collision shapes, and joints) and step the entire space forward through time as a whole. + If you have Chipmunk Pro, you'll want to use the ChipmunkHastySpace subclass instead as it has iPhone specific optimizations. + Unfortunately because of how Objective-C code is linked I can't dynamically substitute a ChipmunkHastySpace from a static library. +*/ + +struct cpSpace; + +@interface ChipmunkSpace : NSObject { +@protected + struct cpSpace *_space; + ChipmunkBody *_staticBody; + + NSMutableSet *_children; + NSMutableArray *_handlers; + + id _userData; +} + +/** + The iteration count is how many solver passes the space should use when solving collisions and joints (default is 10). + Fewer iterations mean less CPU usage, but lower quality (mushy looking) physics. +*/ +@property(nonatomic, assign) int iterations; + +/// Global gravity value to use for all rigid bodies in this space (default value is @c cpvzero). +@property(nonatomic, assign) cpVect gravity; + +/** + Global viscous damping value to use for all rigid bodies in this space (default value is 1.0 which disables damping). + This value is the fraction of velocity a body should have after 1 second. + A value of 0.9 would mean that each second, a body would have 80% of the velocity it had the previous second. +*/ +@property(nonatomic, assign) cpFloat damping; + +/// If a body is moving slower than this speed, it is considered idle. The default value is 0, which signals that the space should guess a good value based on the current gravity. +@property(nonatomic, assign) cpFloat idleSpeedThreshold; + +/** + Elapsed time before a group of idle bodies is put to sleep (defaults to infinity which disables sleeping). + If an entire group of touching or jointed bodies has been idle for at least this long, the space will put all of the bodies into a sleeping state where they consume very little CPU. +*/ +@property(nonatomic, assign) cpFloat sleepTimeThreshold; + +/** + Amount of encouraged penetration between colliding shapes.. + Used to reduce oscillating contacts and keep the collision cache warm. + Defaults to 0.1. If you have poor simulation quality, + increase this number as much as possible without allowing visible amounts of overlap. +*/ +@property(nonatomic, assign) cpFloat collisionSlop; + +/** + Determines how fast overlapping shapes are pushed apart. + Expressed as a fraction of the error remaining after each second. + Defaults to pow(1.0 - 0.1, 60.0) meaning that Chipmunk fixes 10% of overlap each frame at 60Hz. +*/ +@property(nonatomic, assign) cpFloat collisionBias; + +/** + Number of frames that contact information should persist. + Defaults to 3. There is probably never a reason to change this value. +*/ +@property(nonatomic, assign) cpTimestamp collisionPersistence; + +/** + @deprecated 6.0.4 + Does nothing, and is a no-op. The contact graph is always enabled now. +*/ +@property(nonatomic, assign) bool enableContactGraph +__attribute__((__deprecated__)); + +/// Returns a pointer to the underlying cpSpace C struct +@property(nonatomic, readonly) cpSpace *space; + +/** + The space's designated static body. + Collision shapes added to the body will automatically be marked as static shapes, and rigid bodies that come to rest while touching or jointed to this body will fall asleep. +*/ +@property(nonatomic, readonly) ChipmunkBody *staticBody; + +/** + Retrieves the current (if you are in a callback from [ChipmunkSpace step:]) or most recent (outside of a [ChipmunkSpace step:] call) timestep. +*/ +@property(nonatomic, readonly) cpFloat currentTimeStep; + +/** + An object that this space is associated with. You can use this get a reference to your game state or controller object from within callbacks. + @attention Like most @c delegate properties this is a weak reference and does not call @c retain. This prevents reference cycles from occuring. +*/ +@property(nonatomic, assign) id userData; + +/// Get the ChipmunkSpace object associciated with a cpSpace pointer. +/// Undefined if the cpSpace wasn't created using Objective-Chipmunk. ++(ChipmunkSpace *)spaceFromCPSpace:(cpSpace *)space; + +/** + Set the default collision handler. + The default handler is used for all collisions when a specific collision handler cannot be found. + + The expected method selectors are as follows: + @code +- (bool)begin:(cpArbiter *)arbiter space:(ChipmunkSpace*)space +- (bool)preSolve:(cpArbiter *)arbiter space:(ChipmunkSpace*)space +- (void)postSolve:(cpArbiter *)arbiter space:(ChipmunkSpace*)space +- (void)separate:(cpArbiter *)arbiter space:(ChipmunkSpace*)space + @endcode +*/ +// TODO + +/** + Set a collision handler to handle specific collision types. + The methods are called only when shapes with the specified collisionTypes collide. + + @c typeA and @c typeB should be the same object references set to ChipmunkShape.collisionType. They can be any uniquely identifying object. + Class and global NSString objects work well as collision types as they are easy to get a reference to and do not require you to allocate any objects. + + The expected method selectors are as follows: + @code +- (bool)begin:(cpArbiter *)arbiter space:(ChipmunkSpace*)space +- (bool)preSolve:(cpArbiter *)arbiter space:(ChipmunkSpace*)space +- (void)postSolve:(cpArbiter *)arbiter space:(ChipmunkSpace*)space +- (void)separate:(cpArbiter *)arbiter space:(ChipmunkSpace*)space + @endcode +*/ +// TODO + +/** + Add an object to the space. + This can be any object that implements the ChipmunkObject protocol. + This includes all the basic types such as ChipmunkBody, ChipmunkShape and ChipmunkConstraint as well as any composite game objects you may define that implement the protocol. + @warning This method may not be called from a collision handler callback. See smartAdd: or ChipmunkSpace.addPostStepCallback:selector:context: for information on how to do that. +*/ +-(id)add:(NSObject *)obj; + +/** + Remove an object from the space. + This can be any object that implements the ChipmunkObject protocol. + This includes all the basic types such as ChipmunkBody, ChipmunkShape and ChipmunkConstraint as well as any composite game objects you may define that implement the protocol. + @warning This method may not be called from a collision handler callback. See smartRemove: or ChipmunkSpace.addPostStepCallback:selector:context: for information on how to do that. +*/ +-(id)remove:(NSObject *)obj; + +/// Check if a space already contains a particular object: +-(BOOL)contains:(NSObject *)obj; + +/// If the space is locked and it's unsafe to call add: it will call addPostStepAddition: instead. +- (id)smartAdd:(NSObject *)obj; + +/// If the space is locked and it's unsafe to call remove: it will call addPostStepRemoval: instead. +- (id)smartRemove:(NSObject *)obj; + +/// Handy utility method to add a border of collision segments around a box. See ChipmunkShape for more information on the other parameters. +/// Returns an NSArray of the shapes. Since NSArray implements the ChipmunkObject protocol, you can use the [ChipmunkSpace remove:] method to remove the bounds. +- (NSArray *)addBounds:(CGRect)bounds thickness:(cpFloat)radius + elasticity:(cpFloat)elasticity friction:(cpFloat)friction + filter:(cpShapeFilter)filter collisionType:(id)collisionType; + + +/** + Define a callback to be run just before [ChipmunkSpace step:] finishes. + The main reason you want to define post-step callbacks is to get around the restriction that you cannot call the add/remove methods from a collision handler callback. + Post-step callbacks run right before the next (or current) call to ChipmunkSpace.step: returns when it is safe to add and remove objects. + You can only schedule one post-step callback per key value, this prevents you from accidentally removing an object twice. Registering a second callback for the same key is a no-op. + + The method signature of the method should be: + @code +- (void)postStepCallback:(id)key + @endcode + + This makes it easy to call a removal method on your game controller to remove a game object that died or was destroyed as the result of a collision: + @code +[space addPostStepCallback:gameController selector:@selector(remove:) key:gameObject]; + @endcode + + @attention Not to be confused with post-solve collision handler callbacks. + @warning @c target and @c object cannot be retained by the ChipmunkSpace. If you need to release either after registering the callback, use autorelease to ensure that they won't be deallocated until after [ChipmunkSpace step:] returns. + @see ChipmunkSpace.addPostStepRemoval: +*/ +- (BOOL)addPostStepCallback:(id)target selector:(SEL)selector key:(id)key; + +/// Block type used with [ChipmunkSpace addPostStepBlock:] +typedef void (^ChipmunkPostStepBlock)(void); + +/// Same as [ChipmunkSpace addPostStepCallback:] but with a block. The block is copied. +- (BOOL)addPostStepBlock:(ChipmunkPostStepBlock)block key:(id)key; + +/// Add the Chipmunk Object to the space at the end of the step. +- (void)addPostStepAddition:(NSObject *)obj; + +/// Remove the Chipmunk Object from the space at the end of the step. +- (void)addPostStepRemoval:(NSObject *)obj; + +/// Return an array of ChipmunkNearestPointQueryInfo objects for shapes within @c maxDistance of @c point. +/// The point is treated as having the given group and layers. +- (NSArray *)pointQueryAll:(cpVect)point maxDistance:(cpFloat)maxDistance filter:(cpShapeFilter)filter; + +/// Find the closest shape to a point that is within @c maxDistance of @c point. +/// The point is treated as having the given layers and group. +- (ChipmunkPointQueryInfo *)pointQueryNearest:(cpVect)point maxDistance:(cpFloat)maxDistance filter:(cpShapeFilter)filter; + +/// Return a NSArray of ChipmunkSegmentQueryInfo objects for all the shapes that overlap the segment. The objects are unsorted. +- (NSArray *)segmentQueryAllFrom:(cpVect)start to:(cpVect)end radius:(cpFloat)radius filter:(cpShapeFilter)filter; + +/// Returns the first shape that overlaps the given segment. The segment is treated as having the given group and layers. +- (ChipmunkSegmentQueryInfo *)segmentQueryFirstFrom:(cpVect)start to:(cpVect)end radius:(cpFloat)radius filter:(cpShapeFilter)filter; + +/// Returns a NSArray of all shapes whose bounding boxes overlap the given bounding box. The box is treated as having the given group and layers. +- (NSArray *)bbQueryAll:(cpBB)bb filter:(cpShapeFilter)filter; + +/// Returns a NSArray of ChipmunkShapeQueryInfo objects for all the shapes that overlap @c shape. +- (NSArray *)shapeQueryAll:(ChipmunkShape *)shape; + +/// Returns true if the shape overlaps anything in the space. +- (BOOL)shapeTest:(ChipmunkShape *)shape; + +/// Get a copy of the list of all the bodies in the space. +- (NSArray *)bodies; + +/// Get a copy of the list of all the shapes in the space +- (NSArray *)shapes; + +/// Get a copy of the list of all the constraints in the space +- (NSArray *)constraints; + +/// Update all the static shapes. +- (void)reindexStatic; + +/// Update the collision info for a single shape. +/// Can be used to update individual static shapes that were moved or active shapes that were moved that you want to query against. +- (void)reindexShape:(ChipmunkShape *)shape; + +/// Update the collision info for all shapes attached to a body. +- (void)reindexShapesForBody:(ChipmunkBody *)body; + +/// Step time forward. While variable timesteps may be used, a constant timestep will allow you to reduce CPU usage by using fewer iterations. +- (void)step:(cpFloat)dt; + +@end + +//MARK: Misc + +/** + A macro that defines and initializes shape variables for you in a collision callback. + They are initialized in the order that they were defined in the collision handler associated with the arbiter. + If you defined the handler as: + + @code + [space addCollisionHandler:target typeA:foo typeB:bar ...] + @endcode + + You you will find that @code a->collision_type == 1 @endcode and @code b->collision_type == 2 @endcode. +*/ +#define CHIPMUNK_ARBITER_GET_SHAPES(__arb__, __a__, __b__) ChipmunkShape *__a__, *__b__; { \ + cpShape *__shapeA__, *__shapeB__; \ + cpArbiterGetShapes(__arb__, &__shapeA__, &__shapeB__); \ + __a__ = cpShapeGetUserData(__shapeA__); __b__ = cpShapeGetUserData(__shapeB__); \ +} + +#define CHIPMUNK_ARBITER_GET_BODIES(__arb__, __a__, __b__) ChipmunkBody *__a__, *__b__; { \ + cpBody *__bodyA__, *__bodyB__; \ + cpArbiterGetBodies(__arb__, &__bodyA__, &__bodyB__); \ + __a__ = cpBodyGetUserData(__bodyA__); __b__ = cpBodyGetUserData(__bodyB__); \ +} + + diff --git a/include/Chipmunk/ObjectiveChipmunk/ObjectiveChipmunk.h b/include/Chipmunk/ObjectiveChipmunk/ObjectiveChipmunk.h new file mode 100644 index 0000000..bb5648d --- /dev/null +++ b/include/Chipmunk/ObjectiveChipmunk/ObjectiveChipmunk.h @@ -0,0 +1,80 @@ +/* Copyright (c) 2013 Scott Lembcke + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +#import + +// Override some Chipmunk types for Objective-Chipmunk +#define CP_USE_CGTYPES 1 + +#if __has_feature(objc_arc) + #define CP_DATA_POINTER_TYPE __unsafe_unretained id + #define CP_GROUP_TYPE __unsafe_unretained id + #define CP_COLLISION_TYPE_TYPE __unsafe_unretained id +#else + #define CP_DATA_POINTER_TYPE id + #define CP_GROUP_TYPE id + #define CP_COLLISION_TYPE_TYPE id +#endif + +#ifdef CP_ALLOW_PRIVATE_ACCESS + #undef CP_ALLOW_PRIVATE_ACCESS + #import "chipmunk/chipmunk_private.h" +#else + #import "chipmunk/chipmunk.h" +#endif + +/** + Allows you to add composite objects to a space in a single method call. + The easiest way to implement the ChipmunkObject protocol is to add a @c chipmunkObjects instance variable with a type of @c NSArray* to your class, + create a synthesized property for it, and initialize it with the ChipmunkObjectFlatten() function. +*/ +@protocol ChipmunkObject + +/// Returns a list of ChipmunkBaseObject objects. +- (id )chipmunkObjects; + +@end + + +/// A category to have NSArray implement the ChipmunkObject protocol. +/// They make for very easy containers. +@interface NSArray(ChipmunkObject) +@end + + +@class ChipmunkSpace; + +/** + This protocol is implemented by objects that know how to add themselves to a space. + It's used internally as part of the ChipmunkObject protocol. You should never need to implement it yourself. +*/ +@protocol ChipmunkBaseObject + +- (void)addToSpace:(ChipmunkSpace *)space; +- (void)removeFromSpace:(ChipmunkSpace *)space; + +@end + +#import "ChipmunkBody.h" +#import "ChipmunkShape.h" +#import "ChipmunkConstraint.h" +#import "ChipmunkSpace.h" +#import "ChipmunkMultiGrab.h" diff --git a/include/Chipmunk/chipmunk/chipmunk.h b/include/Chipmunk/chipmunk/chipmunk.h new file mode 100644 index 0000000..1c0b783 --- /dev/null +++ b/include/Chipmunk/chipmunk/chipmunk.h @@ -0,0 +1,224 @@ +/* Copyright (c) 2007 Scott Lembcke + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +#ifndef CHIPMUNK_H +#define CHIPMUNK_H + +#ifdef _MSC_VER + #define _USE_MATH_DEFINES +#endif + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +// NUKE +#ifndef CP_ALLOW_PRIVATE_ACCESS + #define CP_ALLOW_PRIVATE_ACCESS 0 +#endif + +#if CP_ALLOW_PRIVATE_ACCESS == 1 + #define CP_PRIVATE(__symbol__) __symbol__ +#else + #define CP_PRIVATE(__symbol__) __symbol__##_private +#endif + +void cpMessage(const char *condition, const char *file, int line, int isError, int isHardError, const char *message, ...); +#ifdef NDEBUG + #define cpAssertWarn(__condition__, ...) +#else + #define cpAssertWarn(__condition__, ...) if(!(__condition__)) cpMessage(#__condition__, __FILE__, __LINE__, 0, 0, __VA_ARGS__) +#endif + +#ifdef NDEBUG + #define cpAssertSoft(__condition__, ...) +#else + #define cpAssertSoft(__condition__, ...) if(!(__condition__)) cpMessage(#__condition__, __FILE__, __LINE__, 1, 0, __VA_ARGS__) +#endif + +// Hard assertions are important and cheap to execute. They are not disabled by compiling as debug. +#define cpAssertHard(__condition__, ...) if(!(__condition__)) cpMessage(#__condition__, __FILE__, __LINE__, 1, 1, __VA_ARGS__) + + +#include "chipmunk_types.h" + +/// @defgroup misc Misc +/// @{ + +/// Allocated size for various Chipmunk buffers +#ifndef CP_BUFFER_BYTES + #define CP_BUFFER_BYTES (32*1024) +#endif + +#ifndef cpcalloc + /// Chipmunk calloc() alias. + #define cpcalloc calloc +#endif + +#ifndef cprealloc + /// Chipmunk realloc() alias. + #define cprealloc realloc +#endif + +#ifndef cpfree + /// Chipmunk free() alias. + #define cpfree free +#endif + +typedef struct cpArray cpArray; +typedef struct cpHashSet cpHashSet; + +typedef struct cpBody cpBody; +typedef struct cpShape cpShape; +typedef struct cpConstraint cpConstraint; + +typedef struct cpCollisionHandler cpCollisionHandler; +typedef struct cpContactPointSet cpContactPointSet; +typedef struct cpArbiter cpArbiter; + +typedef struct cpSpace cpSpace; + +#include "cpVect.h" +#include "cpBB.h" +#include "cpTransform.h" +#include "cpSpatialIndex.h" + +#include "cpBody.h" +#include "cpShape.h" +#include "cpPolyShape.h" + +#include "cpArbiter.h" +#include "cpConstraint.h" + +#include "cpSpace.h" + +// Chipmunk 7.0.0 +#define CP_VERSION_MAJOR 7 +#define CP_VERSION_MINOR 0 +#define CP_VERSION_RELEASE 0 + +/// Version string. +extern const char *cpVersionString; + +/// Calculate the moment of inertia for a circle. +/// @c r1 and @c r2 are the inner and outer diameters. A solid circle has an inner diameter of 0. +cpFloat cpMomentForCircle(cpFloat m, cpFloat r1, cpFloat r2, cpVect offset); + +/// Calculate area of a hollow circle. +/// @c r1 and @c r2 are the inner and outer diameters. A solid circle has an inner diameter of 0. +cpFloat cpAreaForCircle(cpFloat r1, cpFloat r2); + +/// Calculate the moment of inertia for a line segment. +/// Beveling radius is not supported. +cpFloat cpMomentForSegment(cpFloat m, cpVect a, cpVect b, cpFloat radius); + +/// Calculate the area of a fattened (capsule shaped) line segment. +cpFloat cpAreaForSegment(cpVect a, cpVect b, cpFloat radius); + +/// Calculate the moment of inertia for a solid polygon shape assuming it's center of gravity is at it's centroid. The offset is added to each vertex. +cpFloat cpMomentForPoly(cpFloat m, int count, const cpVect *verts, cpVect offset, cpFloat radius); + +/// Calculate the signed area of a polygon. A Clockwise winding gives positive area. +/// This is probably backwards from what you expect, but matches Chipmunk's the winding for poly shapes. +cpFloat cpAreaForPoly(const int count, const cpVect *verts, cpFloat radius); + +/// Calculate the natural centroid of a polygon. +cpVect cpCentroidForPoly(const int count, const cpVect *verts); + +/// Calculate the moment of inertia for a solid box. +cpFloat cpMomentForBox(cpFloat m, cpFloat width, cpFloat height); + +/// Calculate the moment of inertia for a solid box. +cpFloat cpMomentForBox2(cpFloat m, cpBB box); + +/// Calculate the convex hull of a given set of points. Returns the count of points in the hull. +/// @c result must be a pointer to a @c cpVect array with at least @c count elements. If @c verts == @c result, then @c verts will be reduced inplace. +/// @c first is an optional pointer to an integer to store where the first vertex in the hull came from (i.e. verts[first] == result[0]) +/// @c tol is the allowed amount to shrink the hull when simplifying it. A tolerance of 0.0 creates an exact hull. +int cpConvexHull(int count, const cpVect *verts, cpVect *result, int *first, cpFloat tol); + +#ifdef _MSC_VER +#include "malloc.h" +#endif + +/// Convenience macro to work with cpConvexHull. +/// @c count and @c verts is the input array passed to cpConvexHull(). +/// @c count_var and @c verts_var are the names of the variables the macro creates to store the result. +/// The output vertex array is allocated on the stack using alloca() so it will be freed automatically, but cannot be returned from the current scope. +#define CP_CONVEX_HULL(__count__, __verts__, __count_var__, __verts_var__) \ +cpVect *__verts_var__ = (cpVect *)alloca(__count__*sizeof(cpVect)); \ +int __count_var__ = cpConvexHull(__count__, __verts__, __verts_var__, NULL, 0.0); \ + +/// Returns the closest point on the line segment ab, to the point p. +static inline cpVect +cpClosetPointOnSegment(const cpVect p, const cpVect a, const cpVect b) +{ + cpVect delta = cpvsub(a, b); + cpFloat t = cpfclamp01(cpvdot(delta, cpvsub(p, b))/cpvlengthsq(delta)); + return cpvadd(b, cpvmult(delta, t)); +} + +#if defined(__has_extension) +#if __has_extension(blocks) +// Define alternate block based alternatives for a few of the callback heavy functions. +// Collision handlers are post-step callbacks are not included to avoid memory management issues. +// If you want to use blocks for those and are aware of how to correctly manage the memory, the implementation is trivial. + +void cpSpaceEachBody_b(cpSpace *space, void (^block)(cpBody *body)); +void cpSpaceEachShape_b(cpSpace *space, void (^block)(cpShape *shape)); +void cpSpaceEachConstraint_b(cpSpace *space, void (^block)(cpConstraint *constraint)); + +void cpBodyEachShape_b(cpBody *body, void (^block)(cpShape *shape)); +void cpBodyEachConstraint_b(cpBody *body, void (^block)(cpConstraint *constraint)); +void cpBodyEachArbiter_b(cpBody *body, void (^block)(cpArbiter *arbiter)); + +typedef void (^cpSpacePointQueryBlock)(cpShape *shape, cpVect point, cpFloat distance, cpVect gradient); +void cpSpacePointQuery_b(cpSpace *space, cpVect point, cpFloat maxDistance, cpShapeFilter filter, cpSpacePointQueryBlock block); + +typedef void (^cpSpaceSegmentQueryBlock)(cpShape *shape, cpVect point, cpVect normal, cpFloat alpha); +void cpSpaceSegmentQuery_b(cpSpace *space, cpVect start, cpVect end, cpFloat radius, cpShapeFilter filter, cpSpaceSegmentQueryBlock block); + +typedef void (^cpSpaceBBQueryBlock)(cpShape *shape); +void cpSpaceBBQuery_b(cpSpace *space, cpBB bb, cpShapeFilter filter, cpSpaceBBQueryBlock block); + +typedef void (^cpSpaceShapeQueryBlock)(cpShape *shape, cpContactPointSet *points); +cpBool cpSpaceShapeQuery_b(cpSpace *space, cpShape *shape, cpSpaceShapeQueryBlock block); + +#endif +#endif + + +//@} + +#ifdef __cplusplus +} + +static inline cpVect operator *(const cpVect v, const cpFloat s){return cpvmult(v, s);} +static inline cpVect operator +(const cpVect v1, const cpVect v2){return cpvadd(v1, v2);} +static inline cpVect operator -(const cpVect v1, const cpVect v2){return cpvsub(v1, v2);} +static inline cpBool operator ==(const cpVect v1, const cpVect v2){return cpveql(v1, v2);} +static inline cpVect operator -(const cpVect v){return cpvneg(v);} + +#endif +#endif diff --git a/include/Chipmunk/chipmunk/chipmunk_ffi.h b/include/Chipmunk/chipmunk/chipmunk_ffi.h new file mode 100644 index 0000000..f95bf32 --- /dev/null +++ b/include/Chipmunk/chipmunk/chipmunk_ffi.h @@ -0,0 +1,174 @@ +#ifdef CHIPMUNK_FFI + +// Create non static inlined copies of Chipmunk functions, useful for working with dynamic FFIs +// This file should only be included in chipmunk.c + +// TODO: get rid of the reliance on static inlines. +// They make a mess for FFIs. + +#ifdef _MSC_VER + #if _MSC_VER >= 1600 + #define MAKE_REF(name) decltype(name) *_##name = name + #else + #define MAKE_REF(name) + #endif +#else + #define MAKE_REF(name) __typeof__(name) *_##name = name +#endif + +#define MAKE_PROPERTIES_REF(struct, property) \ + MAKE_REF(struct##Get##property); MAKE_REF(struct##Set##property) + +MAKE_REF(cpv); // makes a variable named _cpv that contains the function pointer for cpv() +MAKE_REF(cpveql); +MAKE_REF(cpvadd); +MAKE_REF(cpvneg); +MAKE_REF(cpvsub); +MAKE_REF(cpvmult); +MAKE_REF(cpvdot); +MAKE_REF(cpvcross); +MAKE_REF(cpvperp); +MAKE_REF(cpvrperp); +MAKE_REF(cpvproject); +MAKE_REF(cpvforangle); +MAKE_REF(cpvtoangle); +MAKE_REF(cpvrotate); +MAKE_REF(cpvunrotate); +MAKE_REF(cpvlengthsq); +MAKE_REF(cpvlength); +MAKE_REF(cpvlerp); +MAKE_REF(cpvnormalize); +MAKE_REF(cpvclamp); +MAKE_REF(cpvlerpconst); +MAKE_REF(cpvdist); +MAKE_REF(cpvdistsq); +MAKE_REF(cpvnear); + +MAKE_REF(cpfmax); +MAKE_REF(cpfmin); +MAKE_REF(cpfabs); +MAKE_REF(cpfclamp); +MAKE_REF(cpflerp); +MAKE_REF(cpflerpconst); + +MAKE_REF(cpBBNew); +MAKE_REF(cpBBNewForCircle); +MAKE_REF(cpBBIntersects); +MAKE_REF(cpBBContainsBB); +MAKE_REF(cpBBContainsVect); +MAKE_REF(cpBBMerge); +MAKE_REF(cpBBExpand); +MAKE_REF(cpBBArea); +MAKE_REF(cpBBMergedArea); +MAKE_REF(cpBBSegmentQuery); +MAKE_REF(cpBBIntersectsSegment); +MAKE_REF(cpBBClampVect); + +MAKE_REF(cpBodyGetMass); +MAKE_REF(cpBodyGetMoment); +MAKE_REF(cpBodyGetPosition); +MAKE_REF(cpBodyGetAngle); +MAKE_REF(cpBodyGetRotation); +MAKE_PROPERTIES_REF(cpBody, Velocity); +MAKE_PROPERTIES_REF(cpBody, Force); +MAKE_PROPERTIES_REF(cpBody, AngularVelocity); +MAKE_PROPERTIES_REF(cpBody, Torque); +MAKE_PROPERTIES_REF(cpBody, VelocityLimit); +MAKE_PROPERTIES_REF(cpBody, AngularVelocityLimit); +MAKE_PROPERTIES_REF(cpBody, UserData); +MAKE_REF(cpBodyIsSleeping); +MAKE_REF(cpBodyIsStatic); +//MAKE_REF(cpBodyIsRogue); +MAKE_REF(cpBodyLocalToWorld); +MAKE_REF(cpBodyWorldToLocal); +MAKE_REF(cpBodyKineticEnergy); + +MAKE_REF(cpShapeGetBB); +MAKE_PROPERTIES_REF(cpShape, Body); +MAKE_PROPERTIES_REF(cpShape, Sensor); +MAKE_PROPERTIES_REF(cpShape, Elasticity); +MAKE_PROPERTIES_REF(cpShape, Friction); +MAKE_PROPERTIES_REF(cpShape, SurfaceVelocity); +MAKE_PROPERTIES_REF(cpShape, UserData); +MAKE_PROPERTIES_REF(cpShape, CollisionType); +MAKE_PROPERTIES_REF(cpShape, Filter); + +MAKE_REF(cpArbiterGetShapes); +MAKE_REF(cpArbiterGetBodies); +MAKE_REF(cpArbiterIsFirstContact); +MAKE_REF(cpArbiterGetCount); + +MAKE_REF(cpConstraintGetA); +MAKE_REF(cpConstraintGetB); +MAKE_PROPERTIES_REF(cpConstraint, MaxForce); +MAKE_PROPERTIES_REF(cpConstraint, ErrorBias); +MAKE_PROPERTIES_REF(cpConstraint, MaxBias); +MAKE_PROPERTIES_REF(cpConstraint, UserData); +MAKE_REF(cpConstraintGetImpulse); + +MAKE_PROPERTIES_REF(cpDampedRotarySpring, RestAngle); +MAKE_PROPERTIES_REF(cpDampedRotarySpring, Stiffness); +MAKE_PROPERTIES_REF(cpDampedRotarySpring, Damping); +//MAKE_PROPERTIES_REF(cpDampedRotarySpring, SpringTorqueFunc); + +MAKE_PROPERTIES_REF(cpDampedSpring, Anchr1); +MAKE_PROPERTIES_REF(cpDampedSpring, Anchr2); +MAKE_PROPERTIES_REF(cpDampedSpring, RestLength); +MAKE_PROPERTIES_REF(cpDampedSpring, Stiffness); +MAKE_PROPERTIES_REF(cpDampedSpring, Damping); +//MAKE_PROPERTIES_REF(cpDampedSpring, SpringForceFunc); + +MAKE_PROPERTIES_REF(cpGearJoint, Phase); +MAKE_REF(cpGearJointGetRatio); + +MAKE_PROPERTIES_REF(cpGrooveJoint, Anchr2); +MAKE_REF(cpGrooveJointGetGrooveA); +MAKE_REF(cpGrooveJointGetGrooveB); + +MAKE_PROPERTIES_REF(cpPinJoint, Anchr1); +MAKE_PROPERTIES_REF(cpPinJoint, Anchr2); +MAKE_PROPERTIES_REF(cpPinJoint, Dist); + +MAKE_PROPERTIES_REF(cpPivotJoint, Anchr1); +MAKE_PROPERTIES_REF(cpPivotJoint, Anchr2); + +MAKE_PROPERTIES_REF(cpRatchetJoint, Angle); +MAKE_PROPERTIES_REF(cpRatchetJoint, Phase); +MAKE_PROPERTIES_REF(cpRatchetJoint, Ratchet); + +MAKE_PROPERTIES_REF(cpRotaryLimitJoint, Min); +MAKE_PROPERTIES_REF(cpRotaryLimitJoint, Max); + +MAKE_PROPERTIES_REF(cpSimpleMotor, Rate); + +MAKE_PROPERTIES_REF(cpSlideJoint, Anchr1); +MAKE_PROPERTIES_REF(cpSlideJoint, Anchr2); +MAKE_PROPERTIES_REF(cpSlideJoint, Min); +MAKE_PROPERTIES_REF(cpSlideJoint, Max); + +MAKE_REF(cpSpatialIndexDestroy); +MAKE_REF(cpSpatialIndexCount); +MAKE_REF(cpSpatialIndexEach); +MAKE_REF(cpSpatialIndexContains); +MAKE_REF(cpSpatialIndexInsert); +MAKE_REF(cpSpatialIndexRemove); +MAKE_REF(cpSpatialIndexReindex); +MAKE_REF(cpSpatialIndexReindexObject); +MAKE_REF(cpSpatialIndexSegmentQuery); +MAKE_REF(cpSpatialIndexQuery); +MAKE_REF(cpSpatialIndexReindexQuery); + +MAKE_PROPERTIES_REF(cpSpace, Iterations); +MAKE_PROPERTIES_REF(cpSpace, Gravity); +MAKE_PROPERTIES_REF(cpSpace, Damping); +MAKE_PROPERTIES_REF(cpSpace, IdleSpeedThreshold); +MAKE_PROPERTIES_REF(cpSpace, SleepTimeThreshold); +MAKE_PROPERTIES_REF(cpSpace, CollisionSlop); +MAKE_PROPERTIES_REF(cpSpace, CollisionBias); +MAKE_PROPERTIES_REF(cpSpace, CollisionPersistence); +MAKE_PROPERTIES_REF(cpSpace, UserData); +MAKE_REF(cpSpaceGetStaticBody); +MAKE_REF(cpSpaceGetCurrentTimeStep); +MAKE_REF(cpSpaceIsLocked); + +#endif diff --git a/include/Chipmunk/chipmunk/chipmunk_private.h b/include/Chipmunk/chipmunk/chipmunk_private.h new file mode 100644 index 0000000..afea074 --- /dev/null +++ b/include/Chipmunk/chipmunk/chipmunk_private.h @@ -0,0 +1,411 @@ +/* Copyright (c) 2007 Scott Lembcke + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +#ifdef CHIPMUNK_H +#error Cannot include chipmunk_private.h after chipmunk.h. +#endif + +#ifndef CHIPMUNK_PRIVATE_H +#define CHIPMUNK_PRIVATE_H + +#define CP_ALLOW_PRIVATE_ACCESS 1 +#include "chipmunk.h" + +#define CP_HASH_COEF (3344921057ul) +#define CP_HASH_PAIR(A, B) ((cpHashValue)(A)*CP_HASH_COEF ^ (cpHashValue)(B)*CP_HASH_COEF) + +// TODO: Eww. Magic numbers. +#define MAGIC_EPSILON 1e-5 + +//MARK: cpArray + +struct cpArray { + int num, max; + void **arr; +}; + +cpArray *cpArrayNew(int size); + +void cpArrayFree(cpArray *arr); + +void cpArrayPush(cpArray *arr, void *object); +void *cpArrayPop(cpArray *arr); +void cpArrayDeleteObj(cpArray *arr, void *obj); +cpBool cpArrayContains(cpArray *arr, void *ptr); + +void cpArrayFreeEach(cpArray *arr, void (freeFunc)(void*)); + + +//MARK: cpHashSet + +typedef cpBool (*cpHashSetEqlFunc)(void *ptr, void *elt); +typedef void *(*cpHashSetTransFunc)(void *ptr, void *data); + +cpHashSet *cpHashSetNew(int size, cpHashSetEqlFunc eqlFunc); +void cpHashSetSetDefaultValue(cpHashSet *set, void *default_value); + +void cpHashSetFree(cpHashSet *set); + +int cpHashSetCount(cpHashSet *set); +void *cpHashSetInsert(cpHashSet *set, cpHashValue hash, void *ptr, cpHashSetTransFunc trans, void *data); +void *cpHashSetRemove(cpHashSet *set, cpHashValue hash, void *ptr); +void *cpHashSetFind(cpHashSet *set, cpHashValue hash, void *ptr); + +typedef void (*cpHashSetIteratorFunc)(void *elt, void *data); +void cpHashSetEach(cpHashSet *set, cpHashSetIteratorFunc func, void *data); + +typedef cpBool (*cpHashSetFilterFunc)(void *elt, void *data); +void cpHashSetFilter(cpHashSet *set, cpHashSetFilterFunc func, void *data); + + +//MARK: Body Functions + +static inline cpBool cpBodyIsDynamic(cpBody *body){return (cpBodyGetType(body) == CP_BODY_TYPE_DYNAMIC);} +static inline cpBool cpBodyIsKinematic(cpBody *body){return (cpBodyGetType(body) == CP_BODY_TYPE_KINEMATIC);} +static inline cpBool cpBodyIsStatic(cpBody *body){return (cpBodyGetType(body) == CP_BODY_TYPE_STATIC);} + +void cpBodyAddShape(cpBody *body, cpShape *shape); +void cpBodyRemoveShape(cpBody *body, cpShape *shape); + +//void cpBodyAccumulateMassForShape(cpBody *body, cpShape *shape); +void cpBodyAccumulateMassFromShapes(cpBody *body); + +void cpBodyRemoveConstraint(cpBody *body, cpConstraint *constraint); + + +//MARK: Spatial Index Functions + +cpSpatialIndex *cpSpatialIndexInit(cpSpatialIndex *index, cpSpatialIndexClass *klass, cpSpatialIndexBBFunc bbfunc, cpSpatialIndex *staticIndex); + + +//MARK: Arbiters + +enum cpArbiterState { + // Arbiter is active and its the first collision. + CP_ARBITER_STATE_FIRST_COLLISION, + // Arbiter is active and its not the first collision. + CP_ARBITER_STATE_NORMAL, + // Collision has been explicitly ignored. + // Either by returning false from a begin collision handler or calling cpArbiterIgnore(). + CP_ARBITER_STATE_IGNORE, + // Collison is no longer active. A space will cache an arbiter for up to cpSpace.collisionPersistence more steps. + CP_ARBITER_STATE_CACHED, + // Collison arbiter is invalid because one of the shapes was removed. + CP_ARBITER_STATE_INVALIDATED, +}; + +struct cpArbiterThread { + struct cpArbiter *next, *prev; +}; + +struct cpContact { + cpVect r1, r2; + + cpFloat nMass, tMass; + cpFloat bounce; // TODO: look for an alternate bounce solution. + + cpFloat jnAcc, jtAcc, jBias; + cpFloat bias; + + cpHashValue hash; +}; + +struct cpCollisionInfo { + const cpShape *a, *b; + cpCollisionID id; + + cpVect n; + + int count; + // TODO Should this be a unique struct type? + struct cpContact *arr; +}; + +struct cpArbiter { + cpFloat e; + cpFloat u; + cpVect surface_vr; + + cpDataPointer data; + + const cpShape *a, *b; + cpBody *body_a, *body_b; + struct cpArbiterThread thread_a, thread_b; + + int count; + struct cpContact *contacts; + cpVect n; + + // Regular, wildcard A and wildcard B collision handlers. + cpCollisionHandler *handler, *handlerA, *handlerB; + cpBool swapped; + + cpTimestamp stamp; + enum cpArbiterState state; +}; + +cpArbiter* cpArbiterInit(cpArbiter *arb, cpShape *a, cpShape *b); + +static inline struct cpArbiterThread * +cpArbiterThreadForBody(cpArbiter *arb, cpBody *body) +{ + return (arb->body_a == body ? &arb->thread_a : &arb->thread_b); +} + +void cpArbiterUnthread(cpArbiter *arb); + +void cpArbiterUpdate(cpArbiter *arb, struct cpCollisionInfo *info, cpSpace *space); +void cpArbiterPreStep(cpArbiter *arb, cpFloat dt, cpFloat bias, cpFloat slop); +void cpArbiterApplyCachedImpulse(cpArbiter *arb, cpFloat dt_coef); +void cpArbiterApplyImpulse(cpArbiter *arb); + + +//MARK: Shape/Collision Functions + +cpShape *cpShapeInit(cpShape *shape, const cpShapeClass *klass, cpBody *body, struct cpShapeMassInfo massInfo); + +static inline cpBool +cpShapeActive(cpShape *shape) +{ + return shape->prev || (shape->body && shape->body->shapeList == shape); +} + +// Note: This function returns contact points with r1/r2 in absolute coordinates, not body relative. +struct cpCollisionInfo cpCollide(const cpShape *a, const cpShape *b, cpCollisionID id, struct cpContact *contacts); + +static inline void +CircleSegmentQuery(cpShape *shape, cpVect center, cpFloat r1, cpVect a, cpVect b, cpFloat r2, cpSegmentQueryInfo *info) +{ + cpVect da = cpvsub(a, center); + cpVect db = cpvsub(b, center); + cpFloat rsum = r1 + r2; + + cpFloat qa = cpvdot(da, da) - 2.0f*cpvdot(da, db) + cpvdot(db, db); + cpFloat qb = cpvdot(da, db) - cpvdot(da, da); + cpFloat det = qb*qb - qa*(cpvdot(da, da) - rsum*rsum); + + if(det >= 0.0f){ + cpFloat t = (-qb - cpfsqrt(det))/(qa); + if(0.0f<= t && t <= 1.0f){ + cpVect n = cpvnormalize(cpvlerp(da, db, t)); + + info->shape = shape; + info->point = cpvsub(cpvlerp(a, b, t), cpvmult(n, r2)); + info->normal = n; + info->alpha = t; + } + } +} + +static inline cpBool +cpShapeFilterReject(cpShapeFilter a, cpShapeFilter b) +{ + // Reject the collision if: + return ( + // They are in the same non-zero group. + (a.group != 0 && a.group == b.group) || + // One of the category/mask combinations fails. + (a.categories & b.mask) == 0 || + (b.categories & a.mask) == 0 + ); +} + + +//MARK: Constraint Functions +// TODO naming conventions here + +#define CP_DefineClassGetter(t) const cpConstraintClass * t##GetClass(void){return (cpConstraintClass *)&klass;} + +void cpConstraintInit(cpConstraint *constraint, const cpConstraintClass *klass, cpBody *a, cpBody *b); + +static inline cpVect +relative_velocity(cpBody *a, cpBody *b, cpVect r1, cpVect r2){ + cpVect v1_sum = cpvadd(a->CP_PRIVATE(v), cpvmult(cpvperp(r1), a->CP_PRIVATE(w))); + cpVect v2_sum = cpvadd(b->CP_PRIVATE(v), cpvmult(cpvperp(r2), b->CP_PRIVATE(w))); + + return cpvsub(v2_sum, v1_sum); +} + +static inline cpFloat +normal_relative_velocity(cpBody *a, cpBody *b, cpVect r1, cpVect r2, cpVect n){ + return cpvdot(relative_velocity(a, b, r1, r2), n); +} + +static inline void +apply_impulse(cpBody *body, cpVect j, cpVect r){ + body->CP_PRIVATE(v) = cpvadd(body->CP_PRIVATE(v), cpvmult(j, body->CP_PRIVATE(m_inv))); + body->CP_PRIVATE(w) += body->CP_PRIVATE(i_inv)*cpvcross(r, j); +} + +static inline void +apply_impulses(cpBody *a , cpBody *b, cpVect r1, cpVect r2, cpVect j) +{ + apply_impulse(a, cpvneg(j), r1); + apply_impulse(b, j, r2); +} + +static inline void +apply_bias_impulse(cpBody *body, cpVect j, cpVect r) +{ + body->CP_PRIVATE(v_bias) = cpvadd(body->CP_PRIVATE(v_bias), cpvmult(j, body->CP_PRIVATE(m_inv))); + body->CP_PRIVATE(w_bias) += body->CP_PRIVATE(i_inv)*cpvcross(r, j); +} + +static inline void +apply_bias_impulses(cpBody *a , cpBody *b, cpVect r1, cpVect r2, cpVect j) +{ + apply_bias_impulse(a, cpvneg(j), r1); + apply_bias_impulse(b, j, r2); +} + +static inline cpFloat +k_scalar_body(cpBody *body, cpVect r, cpVect n) +{ + cpFloat rcn = cpvcross(r, n); + return body->CP_PRIVATE(m_inv) + body->CP_PRIVATE(i_inv)*rcn*rcn; +} + +static inline cpFloat +k_scalar(cpBody *a, cpBody *b, cpVect r1, cpVect r2, cpVect n) +{ + cpFloat value = k_scalar_body(a, r1, n) + k_scalar_body(b, r2, n); + cpAssertSoft(value != 0.0, "Unsolvable collision or constraint."); + + return value; +} + +static inline cpMat2x2 +k_tensor(cpBody *a, cpBody *b, cpVect r1, cpVect r2) +{ + cpFloat m_sum = a->CP_PRIVATE(m_inv) + b->CP_PRIVATE(m_inv); + + // start with Identity*m_sum + cpFloat k11 = m_sum, k12 = 0.0f; + cpFloat k21 = 0.0f, k22 = m_sum; + + // add the influence from r1 + cpFloat a_i_inv = a->CP_PRIVATE(i_inv); + cpFloat r1xsq = r1.x * r1.x * a_i_inv; + cpFloat r1ysq = r1.y * r1.y * a_i_inv; + cpFloat r1nxy = -r1.x * r1.y * a_i_inv; + k11 += r1ysq; k12 += r1nxy; + k21 += r1nxy; k22 += r1xsq; + + // add the influnce from r2 + cpFloat b_i_inv = b->CP_PRIVATE(i_inv); + cpFloat r2xsq = r2.x * r2.x * b_i_inv; + cpFloat r2ysq = r2.y * r2.y * b_i_inv; + cpFloat r2nxy = -r2.x * r2.y * b_i_inv; + k11 += r2ysq; k12 += r2nxy; + k21 += r2nxy; k22 += r2xsq; + + // invert + cpFloat det = k11*k22 - k12*k21; + cpAssertSoft(det != 0.0, "Unsolvable constraint."); + + cpFloat det_inv = 1.0f/det; + return cpMat2x2New( + k22*det_inv, -k12*det_inv, + -k21*det_inv, k11*det_inv + ); +} + +static inline cpFloat +bias_coef(cpFloat errorBias, cpFloat dt) +{ + return 1.0f - cpfpow(errorBias, dt); +} + + +//MARK: Space Functions + +#define cpAssertSpaceUnlocked(space) \ + cpAssertHard(!space->locked, \ + "This operation cannot be done safely during a call to cpSpaceStep() or during a query. " \ + "Put these calls into a post-step callback." \ + ); + +void cpSpaceSetStaticBody(cpSpace *space, cpBody *body); + +extern cpCollisionHandler cpCollisionHandlerDoNothing; + +void cpSpaceProcessComponents(cpSpace *space, cpFloat dt); + +void cpSpacePushFreshContactBuffer(cpSpace *space); +struct cpContact *cpContactBufferGetArray(cpSpace *space); +void cpSpacePushContacts(cpSpace *space, int count); + +typedef struct cpPostStepCallback { + cpPostStepFunc func; + void *key; + void *data; +} cpPostStepCallback; + +cpPostStepCallback *cpSpaceGetPostStepCallback(cpSpace *space, void *key); + +cpBool cpSpaceArbiterSetFilter(cpArbiter *arb, cpSpace *space); +void cpSpaceFilterArbiters(cpSpace *space, cpBody *body, cpShape *filter); + +void cpSpaceActivateBody(cpSpace *space, cpBody *body); +void cpSpaceLock(cpSpace *space); +void cpSpaceUnlock(cpSpace *space, cpBool runPostStep); + +static inline void +cpSpaceUncacheArbiter(cpSpace *space, cpArbiter *arb) +{ + const cpShape *a = arb->a, *b = arb->b; + const cpShape *shape_pair[] = {a, b}; + cpHashValue arbHashID = CP_HASH_PAIR((cpHashValue)a, (cpHashValue)b); + cpHashSetRemove(space->cachedArbiters, arbHashID, shape_pair); + cpArrayDeleteObj(space->arbiters, arb); +} + +void cpShapeUpdateFunc(cpShape *shape, void *unused); +cpCollisionID cpSpaceCollideShapes(cpShape *a, cpShape *b, cpCollisionID id, cpSpace *space); + + +//MARK: Foreach loops + +static inline cpConstraint * +cpConstraintNext(cpConstraint *node, cpBody *body) +{ + return (node->a == body ? node->next_a : node->next_b); +} + +#define CP_BODY_FOREACH_CONSTRAINT(bdy, var)\ + for(cpConstraint *var = bdy->constraintList; var; var = cpConstraintNext(var, bdy)) + +static inline cpArbiter * +cpArbiterNext(cpArbiter *node, cpBody *body) +{ + return (node->body_a == body ? node->thread_a.next : node->thread_b.next); +} + +#define CP_BODY_FOREACH_ARBITER(bdy, var)\ + for(cpArbiter *var = bdy->arbiterList; var; var = cpArbiterNext(var, bdy)) + +#define CP_BODY_FOREACH_SHAPE(body, var)\ + for(cpShape *var = body->shapeList; var; var = var->next) + +#define CP_BODY_FOREACH_COMPONENT(root, var)\ + for(cpBody *var = root; var; var = var->node.next) + +#endif diff --git a/include/Chipmunk/chipmunk/chipmunk_types.h b/include/Chipmunk/chipmunk/chipmunk_types.h new file mode 100644 index 0000000..41ff031 --- /dev/null +++ b/include/Chipmunk/chipmunk/chipmunk_types.h @@ -0,0 +1,245 @@ +#ifndef CHIPMUNK_TYPES_H +#define CHIPMUNK_TYPES_H + +#include +#include +#include + +#ifdef __APPLE__ + #include "TargetConditionals.h" +#endif + +#if ((TARGET_OS_IPHONE == 1) || (TARGET_OS_MAC == 1)) && (!defined CP_USE_CGTYPES) + #define CP_USE_CGTYPES 1 +#endif + +#if CP_USE_CGTYPES == 1 + #if TARGET_OS_IPHONE + #import + #import + #elif TARGET_OS_MAC + #include + #endif + + #if defined(__LP64__) && __LP64__ + #define CP_USE_DOUBLES 1 + #else + #define CP_USE_DOUBLES 0 + #endif +#endif + +#ifndef CP_USE_DOUBLES + // use doubles by default for higher precision + #define CP_USE_DOUBLES 1 +#endif + +/// @defgroup basicTypes Basic Types +/// Most of these types can be configured at compile time. +/// @{ + +#if CP_USE_DOUBLES +/// Chipmunk's floating point type. +/// Can be reconfigured at compile time. + typedef double cpFloat; + #define cpfsqrt sqrt + #define cpfsin sin + #define cpfcos cos + #define cpfacos acos + #define cpfatan2 atan2 + #define cpfmod fmod + #define cpfexp exp + #define cpfpow pow + #define cpffloor floor + #define cpfceil ceil + #define CPFLOAT_MIN DBL_MIN +#else + typedef float cpFloat; + #define cpfsqrt sqrtf + #define cpfsin sinf + #define cpfcos cosf + #define cpfacos acosf + #define cpfatan2 atan2f + #define cpfmod fmodf + #define cpfexp expf + #define cpfpow powf + #define cpffloor floorf + #define cpfceil ceilf + #define CPFLOAT_MIN FLT_MIN +#endif + +#ifndef INFINITY + #ifdef _MSC_VER + union MSVC_EVIL_FLOAT_HACK + { + unsigned __int8 Bytes[4]; + float Value; + }; + static union MSVC_EVIL_FLOAT_HACK INFINITY_HACK = {{0x00, 0x00, 0x80, 0x7F}}; + #define INFINITY (INFINITY_HACK.Value) + #endif + + #ifdef __GNUC__ + #define INFINITY (__builtin_inf()) + #endif + + #ifndef INFINITY + #define INFINITY (1e1000) + #endif +#endif + +#ifndef M_PI + #define M_PI 3.14159265358979323846264338327950288 +#endif + +#ifndef M_E + #define M_E 2.71828182845904523536028747135266250 +#endif + + +/// Return the max of two cpFloats. +static inline cpFloat cpfmax(cpFloat a, cpFloat b) +{ + return (a > b) ? a : b; +} + +/// Return the min of two cpFloats. +static inline cpFloat cpfmin(cpFloat a, cpFloat b) +{ + return (a < b) ? a : b; +} + +/// Return the absolute value of a cpFloat. +static inline cpFloat cpfabs(cpFloat f) +{ + return (f < 0) ? -f : f; +} + +/// Clamp @c f to be between @c min and @c max. +static inline cpFloat cpfclamp(cpFloat f, cpFloat min, cpFloat max) +{ + return cpfmin(cpfmax(f, min), max); +} + +/// Clamp @c f to be between 0 and 1. +static inline cpFloat cpfclamp01(cpFloat f) +{ + return cpfmax(0.0f, cpfmin(f, 1.0f)); +} + + + +/// Linearly interpolate (or extrapolate) between @c f1 and @c f2 by @c t percent. +static inline cpFloat cpflerp(cpFloat f1, cpFloat f2, cpFloat t) +{ + return f1*(1.0f - t) + f2*t; +} + +/// Linearly interpolate from @c f1 to @c f2 by no more than @c d. +static inline cpFloat cpflerpconst(cpFloat f1, cpFloat f2, cpFloat d) +{ + return f1 + cpfclamp(f2 - f1, -d, d); +} + +/// Hash value type. +typedef uintptr_t cpHashValue; + +/// Type used internally to cache colliding object info for cpCollideShapes(). +/// Should be at least 32 bits. +typedef uint32_t cpCollisionID; + +// Oh C, how we love to define our own boolean types to get compiler compatibility +/// Chipmunk's boolean type. +#ifdef CP_BOOL_TYPE + typedef CP_BOOL_TYPE cpBool; +#else + typedef unsigned char cpBool; +#endif + +#ifndef cpTrue +/// true value. + #define cpTrue 1 +#endif + +#ifndef cpFalse +/// false value. + #define cpFalse 0 +#endif + +#ifdef CP_DATA_POINTER_TYPE + typedef CP_DATA_POINTER_TYPE cpDataPointer; +#else +/// Type used for user data pointers. + typedef void * cpDataPointer; +#endif + +#ifdef CP_COLLISION_TYPE_TYPE + typedef CP_COLLISION_TYPE_TYPE cpCollisionType; +#else +/// Type used for cpSpace.collision_type. + typedef uintptr_t cpCollisionType; +#endif + +#ifdef CP_GROUP_TYPE + typedef CP_GROUP_TYPE cpGroup; +#else +/// Type used for cpShape.group. + typedef uintptr_t cpGroup; +#endif + +#ifdef CP_BITMASK_TYPE + typedef CP_BITMASK_TYPE cpLayers; +#else +/// Type used for cpShapeFilter category and mask. + typedef unsigned int cpBitmask; +#endif + +#ifdef CP_TIMESTAMP_TYPE + typedef CP_TIMESTAMP_TYPE cpTimestamp; +#else +/// Type used for various timestamps in Chipmunk. + typedef unsigned int cpTimestamp; +#endif + +#ifndef CP_NO_GROUP +/// Value for cpShape.group signifying that a shape is in no group. + #define CP_NO_GROUP ((cpGroup)0) +#endif + +#ifndef CP_ALL_CATEGORIES +/// Value for cpShape.layers signifying that a shape is in every layer. + #define CP_ALL_CATEGORIES (~(cpBitmask)0) +#endif + +#ifndef CP_WILDCARD_COLLISION_TYPE +/// cpCollisionType value internally reserved for hashing wildcard handlers. + #define CP_WILDCARD_COLLISION_TYPE (~(cpCollisionType)0) +#endif + +/// @} + +// CGPoints are structurally the same, and allow +// easy interoperability with other Cocoa libraries +#if CP_USE_CGTYPES + typedef CGPoint cpVect; +#else +/// Chipmunk's 2D vector type. +/// @addtogroup cpVect + typedef struct cpVect{cpFloat x,y;} cpVect; +#endif + +#if CP_USE_CGTYPES + typedef CGAffineTransform cpTransform; +#else + /// Column major affine transform. + typedef struct cpTransform { + cpFloat a, b, c, d, tx, ty; + } cpTransform; +#endif + +// NUKE +typedef struct cpMat2x2 { + // Row major [[a, b][c d]] + cpFloat a, b, c, d; +} cpMat2x2; + +#endif diff --git a/include/Chipmunk/chipmunk/chipmunk_unsafe.h b/include/Chipmunk/chipmunk/chipmunk_unsafe.h new file mode 100644 index 0000000..6b3b6db --- /dev/null +++ b/include/Chipmunk/chipmunk/chipmunk_unsafe.h @@ -0,0 +1,66 @@ +/* Copyright (c) 2007 Scott Lembcke + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +/* This header defines a number of "unsafe" operations on Chipmunk objects. + * In this case "unsafe" is referring to operations which may reduce the + * physical accuracy or numerical stability of the simulation, but will not + * cause crashes. + * + * The prime example is mutating collision shapes. Chipmunk does not support + * this directly. Mutating shapes using this API will caused objects in contact + * to be pushed apart using Chipmunk's overlap solver, but not using real + * persistent velocities. Probably not what you meant, but perhaps close enough. + */ + +/// @defgroup unsafe Chipmunk Unsafe Shape Operations +/// These functions are used for mutating collision shapes. +/// Chipmunk does not have any way to get velocity information on changing shapes, +/// so the results will be unrealistic. You must explicity include the chipmunk_unsafe.h header to use them. +/// @{ + +#ifndef CHIPMUNK_UNSAFE_H +#define CHIPMUNK_UNSAFE_H + +#ifdef __cplusplus +extern "C" { +#endif + +/// Set the radius of a circle shape. +void cpCircleShapeSetRadius(cpShape *shape, cpFloat radius); +/// Set the offset of a circle shape. +void cpCircleShapeSetOffset(cpShape *shape, cpVect offset); + +/// Set the endpoints of a segment shape. +void cpSegmentShapeSetEndpoints(cpShape *shape, cpVect a, cpVect b); +/// Set the radius of a segment shape. +void cpSegmentShapeSetRadius(cpShape *shape, cpFloat radius); + +/// Set the vertexes of a poly shape. +void cpPolyShapeSetVerts(cpShape *shape, int count, cpVect *verts, cpTransform transform); +void cpPolyShapeSetVertsRaw(cpShape *shape, int count, cpVect *verts); +/// Set the radius of a poly shape. +void cpPolyShapeSetRadius(cpShape *shape, cpFloat radius); + +#ifdef __cplusplus +} +#endif +#endif +/// @} diff --git a/include/Chipmunk/chipmunk/cpArbiter.h b/include/Chipmunk/chipmunk/cpArbiter.h new file mode 100644 index 0000000..8d29073 --- /dev/null +++ b/include/Chipmunk/chipmunk/cpArbiter.h @@ -0,0 +1,130 @@ +/* Copyright (c) 2007 Scott Lembcke + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +/// @defgroup cpArbiter cpArbiter +/// The cpArbiter struct controls pairs of colliding shapes. +/// They are also used in conjuction with collision handler callbacks +/// allowing you to retrieve information on the collision and control it. +/// @{ + +#define CP_MAX_CONTACTS_PER_ARBITER 2 + +// TODO: Document +cpFloat cpArbiterGetRestitution(const cpArbiter *arb); +void cpArbiterSetRestitution(cpArbiter *arb, cpFloat restitution); +cpFloat cpArbiterGetFriction(const cpArbiter *arb); +void cpArbiterSetFriction(cpArbiter *arb, cpFloat friction); + +// Get the relative surface velocity of the two shapes in contact. +cpVect cpArbiterGetSurfaceVelocity(cpArbiter *arb); + +// Override the relative surface velocity of the two shapes in contact. +// By default this is calculated to be the difference of the two +// surface velocities clamped to the tangent plane. +void cpArbiterSetSurfaceVelocity(cpArbiter *arb, cpVect vr); + +cpDataPointer cpArbiterGetUserData(const cpArbiter *arb); +void cpArbiterSetUserData(cpArbiter *arb, cpDataPointer userData); + +/// Calculate the total impulse including the friction that was applied by this arbiter. +/// This function should only be called from a post-solve, post-step or cpBodyEachArbiter callback. +cpVect cpArbiterTotalImpulse(const cpArbiter *arb); +/// Calculate the amount of energy lost in a collision including static, but not dynamic friction. +/// This function should only be called from a post-solve, post-step or cpBodyEachArbiter callback. +cpFloat cpArbiterTotalKE(const cpArbiter *arb); + + +cpBool cpArbiterIgnore(cpArbiter *arb); + +/// Return the colliding shapes involved for this arbiter. +/// The order of their cpSpace.collision_type values will match +/// the order set when the collision handler was registered. +void cpArbiterGetShapes(const cpArbiter *arb, cpShape **a, cpShape **b); + +/// A macro shortcut for defining and retrieving the shapes from an arbiter. +#define CP_ARBITER_GET_SHAPES(__arb__, __a__, __b__) cpShape *__a__, *__b__; cpArbiterGetShapes(__arb__, &__a__, &__b__); + +/// Return the colliding bodies involved for this arbiter. +/// The order of the cpSpace.collision_type the bodies are associated with values will match +/// the order set when the collision handler was registered. +static inline void cpArbiterGetBodies(const cpArbiter *arb, cpBody **a, cpBody **b) +{ + CP_ARBITER_GET_SHAPES(arb, shape_a, shape_b); + (*a) = shape_a->CP_PRIVATE(body); + (*b) = shape_b->CP_PRIVATE(body); +} +/// A macro shortcut for defining and retrieving the bodies from an arbiter. +#define CP_ARBITER_GET_BODIES(__arb__, __a__, __b__) cpBody *__a__, *__b__; cpArbiterGetBodies(__arb__, &__a__, &__b__); + +/// A struct that wraps up the important collision data for an arbiter. +struct cpContactPointSet { + /// The number of contact points in the set. + int count; + + /// The normal of the collision. + cpVect normal; + + /// The array of contact points. + struct { + /// The position of the contact on the surface of each shape. + cpVect point1, point2; + /// Penetration distance of the two shapes. Overlapping means it will be negative. + /// This value is calculated as cpvdot(cpvsub(point2, point1), normal) and is ignored by cpArbiterSetContactPointSet(). + cpFloat distance; + } points[CP_MAX_CONTACTS_PER_ARBITER]; +}; + +/// Return a contact set from an arbiter. +cpContactPointSet cpArbiterGetContactPointSet(const cpArbiter *arb); + +/// Replace the contact point set for an arbiter. +/// This can be a very powerful feature, but use it with caution! +void cpArbiterSetContactPointSet(cpArbiter *arb, cpContactPointSet *set); + +/// Returns true if this is the first step a pair of objects started colliding. +cpBool cpArbiterIsFirstContact(const cpArbiter *arb); +/// Returns true if in separate callback due to a shape being removed from the space. +cpBool cpArbiterIsRemoval(const cpArbiter *arb); + +/// Get the number of contact points for this arbiter. +int cpArbiterGetCount(const cpArbiter *arb); +/// Get the normal of the collision. +cpVect cpArbiterGetNormal(const cpArbiter *arb); +/// Get the position of the @c ith contact point on the surface of the first shape. +cpVect cpArbiterGetPoint1(const cpArbiter *arb, int i); +/// Get the position of the @c ith contact point on the surface of the second shape. +cpVect cpArbiterGetPoint2(const cpArbiter *arb, int i); +/// Get the depth of the @c ith contact point. +cpFloat cpArbiterGetDepth(const cpArbiter *arb, int i); + +cpBool cpArbiterCallWildcardBeginA(cpArbiter *arb, cpSpace *space); +cpBool cpArbiterCallWildcardBeginB(cpArbiter *arb, cpSpace *space); + +cpBool cpArbiterCallWildcardPreSolveA(cpArbiter *arb, cpSpace *space); +cpBool cpArbiterCallWildcardPreSolveB(cpArbiter *arb, cpSpace *space); + +void cpArbiterCallWildcardPostSolveA(cpArbiter *arb, cpSpace *space); +void cpArbiterCallWildcardPostSolveB(cpArbiter *arb, cpSpace *space); + +void cpArbiterCallWildcardSeparateA(cpArbiter *arb, cpSpace *space); +void cpArbiterCallWildcardSeparateB(cpArbiter *arb, cpSpace *space); + +/// @} diff --git a/include/Chipmunk/chipmunk/cpBB.h b/include/Chipmunk/chipmunk/cpBB.h new file mode 100644 index 0000000..4561d8d --- /dev/null +++ b/include/Chipmunk/chipmunk/cpBB.h @@ -0,0 +1,169 @@ +/* Copyright (c) 2007 Scott Lembcke + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +#ifndef CHIPMUNK_BB_H +#define CHIPMUNK_BB_H + +#include "chipmunk_types.h" +#include "cpVect.h" + +/// @defgroup cpBBB cpBB +/// Chipmunk's axis-aligned 2D bounding box type along with a few handy routines. +/// @{ + +/// Chipmunk's axis-aligned 2D bounding box type. (left, bottom, right, top) +typedef struct cpBB{ + cpFloat l, b, r ,t; +} cpBB; + +/// Convenience constructor for cpBB structs. +static inline cpBB cpBBNew(const cpFloat l, const cpFloat b, const cpFloat r, const cpFloat t) +{ + cpBB bb = {l, b, r, t}; + return bb; +} + +/// Constructs a cpBB centered on a point with the given extents (half sizes). +static inline cpBB +cpBBNewForExtents(const cpVect c, const cpFloat hw, const cpFloat hh) +{ + return cpBBNew(c.x - hw, c.y - hh, c.x + hw, c.y + hh); +} + +/// Constructs a cpBB for a circle with the given position and radius. +static inline cpBB cpBBNewForCircle(const cpVect p, const cpFloat r) +{ + return cpBBNewForExtents(p, r, r); +} + +/// Returns true if @c a and @c b intersect. +static inline cpBool cpBBIntersects(const cpBB a, const cpBB b) +{ + return (a.l <= b.r && b.l <= a.r && a.b <= b.t && b.b <= a.t); +} + +/// Returns true if @c other lies completely within @c bb. +static inline cpBool cpBBContainsBB(const cpBB bb, const cpBB other) +{ + return (bb.l <= other.l && bb.r >= other.r && bb.b <= other.b && bb.t >= other.t); +} + +/// Returns true if @c bb contains @c v. +static inline cpBool cpBBContainsVect(const cpBB bb, const cpVect v) +{ + return (bb.l <= v.x && bb.r >= v.x && bb.b <= v.y && bb.t >= v.y); +} + +/// Returns a bounding box that holds both bounding boxes. +static inline cpBB cpBBMerge(const cpBB a, const cpBB b){ + return cpBBNew( + cpfmin(a.l, b.l), + cpfmin(a.b, b.b), + cpfmax(a.r, b.r), + cpfmax(a.t, b.t) + ); +} + +/// Returns a bounding box that holds both @c bb and @c v. +static inline cpBB cpBBExpand(const cpBB bb, const cpVect v){ + return cpBBNew( + cpfmin(bb.l, v.x), + cpfmin(bb.b, v.y), + cpfmax(bb.r, v.x), + cpfmax(bb.t, v.y) + ); +} + +/// Returns the center of a bounding box. +static inline cpVect +cpBBCenter(cpBB bb) +{ + return cpvlerp(cpv(bb.l, bb.b), cpv(bb.r, bb.t), 0.5f); +} + +/// Returns the area of the bounding box. +static inline cpFloat cpBBArea(cpBB bb) +{ + return (bb.r - bb.l)*(bb.t - bb.b); +} + +/// Merges @c a and @c b and returns the area of the merged bounding box. +static inline cpFloat cpBBMergedArea(cpBB a, cpBB b) +{ + return (cpfmax(a.r, b.r) - cpfmin(a.l, b.l))*(cpfmax(a.t, b.t) - cpfmin(a.b, b.b)); +} + +/// Returns the fraction along the segment query the cpBB is hit. Returns INFINITY if it doesn't hit. +static inline cpFloat cpBBSegmentQuery(cpBB bb, cpVect a, cpVect b) +{ + cpFloat idx = 1.0f/(b.x - a.x); + cpFloat tx1 = (bb.l == a.x ? -INFINITY : (bb.l - a.x)*idx); + cpFloat tx2 = (bb.r == a.x ? INFINITY : (bb.r - a.x)*idx); + cpFloat txmin = cpfmin(tx1, tx2); + cpFloat txmax = cpfmax(tx1, tx2); + + cpFloat idy = 1.0f/(b.y - a.y); + cpFloat ty1 = (bb.b == a.y ? -INFINITY : (bb.b - a.y)*idy); + cpFloat ty2 = (bb.t == a.y ? INFINITY : (bb.t - a.y)*idy); + cpFloat tymin = cpfmin(ty1, ty2); + cpFloat tymax = cpfmax(ty1, ty2); + + if(tymin <= txmax && txmin <= tymax){ + cpFloat min = cpfmax(txmin, tymin); + cpFloat max = cpfmin(txmax, tymax); + + if(0.0 <= max && min <= 1.0) return cpfmax(min, 0.0); + } + + return INFINITY; +} + +/// Return true if the bounding box intersects the line segment with ends @c a and @c b. +static inline cpBool cpBBIntersectsSegment(cpBB bb, cpVect a, cpVect b) +{ + return (cpBBSegmentQuery(bb, a, b) != INFINITY); +} + +/// Clamp a vector to a bounding box. +static inline cpVect +cpBBClampVect(const cpBB bb, const cpVect v) +{ + return cpv(cpfclamp(v.x, bb.l, bb.r), cpfclamp(v.y, bb.b, bb.t)); +} + +/// Wrap a vector to a bounding box. +static inline cpVect +cpBBWrapVect(const cpBB bb, const cpVect v) +{ + cpFloat dx = cpfabs(bb.r - bb.l); + cpFloat modx = cpfmod(v.x - bb.l, dx); + cpFloat x = (modx > 0.0f) ? modx : modx + dx; + + cpFloat dy = cpfabs(bb.t - bb.b); + cpFloat mody = cpfmod(v.y - bb.b, dy); + cpFloat y = (mody > 0.0f) ? mody : mody + dy; + + return cpv(x + bb.l, y + bb.b); +} + +///@} + +#endif diff --git a/include/Chipmunk/chipmunk/cpBody.h b/include/Chipmunk/chipmunk/cpBody.h new file mode 100644 index 0000000..bc39db0 --- /dev/null +++ b/include/Chipmunk/chipmunk/cpBody.h @@ -0,0 +1,271 @@ +/* Copyright (c) 2007 Scott Lembcke + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +/// @defgroup cpBody cpBody +/// Chipmunk's rigid body type. Rigid bodies hold the physical properties of an object like +/// it's mass, and position and velocity of it's center of gravity. They don't have an shape on their own. +/// They are given a shape by creating collision shapes (cpShape) that point to the body. +/// @{ + +typedef enum cpBodyType { + CP_BODY_TYPE_DYNAMIC, + CP_BODY_TYPE_KINEMATIC, + CP_BODY_TYPE_STATIC, +} cpBodyType; + +/// Rigid body velocity update function type. +typedef void (*cpBodyVelocityFunc)(cpBody *body, cpVect gravity, cpFloat damping, cpFloat dt); +/// Rigid body position update function type. +typedef void (*cpBodyPositionFunc)(cpBody *body, cpFloat dt); + +/// Used internally to track information on the collision graph. +/// @private +typedef struct cpComponentNode { + cpBody *root; + cpBody *next; + cpFloat idleTime; +} cpComponentNode; + +/// Chipmunk's rigid body struct. +struct cpBody { + /// Function that is called to integrate the body's velocity. (Defaults to cpBodyUpdateVelocity) + cpBodyVelocityFunc velocity_func; + + /// Function that is called to integrate the body's position. (Defaults to cpBodyUpdatePosition) + cpBodyPositionFunc position_func; + + /// Mass of the body. + /// Must agree with cpBody.m_inv! Use cpBodySetMass() when changing the mass for this reason. + CP_PRIVATE(cpFloat m); + /// Mass inverse. + CP_PRIVATE(cpFloat m_inv); + + /// Moment of inertia of the body. + /// Must agree with cpBody.i_inv! Use cpBodySetMoment() when changing the moment for this reason. + CP_PRIVATE(cpFloat i); + /// Moment of inertia inverse. + CP_PRIVATE(cpFloat i_inv); + + /// Offset of the center of gravity from the body's anchor. + /// Defaults to cpvzero. + CP_PRIVATE(cpVect cog); + + /// Position of the rigid body's center of gravity. + CP_PRIVATE(cpVect p); + /// Velocity of the rigid body's center of gravity. + CP_PRIVATE(cpVect v); + /// Force acting on the rigid body's center of gravity. + CP_PRIVATE(cpVect f); + + /// Rotation of the body around it's center of gravity in radians. + /// Must agree with cpBody.rot! Use cpBodySetAngle() when changing the angle for this reason. + CP_PRIVATE(cpFloat a); + /// Angular velocity of the body around it's center of gravity in radians/second. + CP_PRIVATE(cpFloat w); + /// Torque applied to the body around it's center of gravity. + CP_PRIVATE(cpFloat t); + + CP_PRIVATE(cpTransform transform); + + /// User definable data pointer. + /// Generally this points to your the game object class so you can access it + /// when given a cpBody reference in a callback. + CP_PRIVATE(cpDataPointer userData); + + /// Maximum velocity allowed when updating the velocity. + CP_PRIVATE(cpFloat v_limit); + /// Maximum rotational rate (in radians/second) allowed when updating the angular velocity. + CP_PRIVATE(cpFloat w_limit); + + CP_PRIVATE(cpVect v_bias); + CP_PRIVATE(cpFloat w_bias); + + CP_PRIVATE(cpSpace *space); + + CP_PRIVATE(cpShape *shapeList); + CP_PRIVATE(cpArbiter *arbiterList); + CP_PRIVATE(cpConstraint *constraintList); + + CP_PRIVATE(cpComponentNode node); +}; + +/// Allocate a cpBody. +cpBody* cpBodyAlloc(void); +/// Initialize a cpBody. +cpBody* cpBodyInit(cpBody *body, cpFloat mass, cpFloat moment); +/// Allocate and initialize a cpBody. +cpBody* cpBodyNew(cpFloat mass, cpFloat moment); + +/// Allocate and initialize a cpBody, and set it as a kinematic body. +cpBody* cpBodyNewKinematic(void); +/// Allocate and initialize a cpBody, and set it as a static body. +cpBody* cpBodyNewStatic(void); + +/// Destroy a cpBody. +void cpBodyDestroy(cpBody *body); +/// Destroy and free a cpBody. +void cpBodyFree(cpBody *body); + +/// Check that the properties of a body is sane. (Only in debug mode) +#ifdef NDEBUG + #define cpAssertSaneBody(body) +#else + void cpBodySanityCheck(const cpBody *body); + #define cpAssertSaneBody(body) cpBodySanityCheck(body) +#endif + +// Defined in cpSpace.c +/// Wake up a sleeping or idle body. +void cpBodyActivate(cpBody *body); +/// Wake up any sleeping or idle bodies touching a static body. +void cpBodyActivateStatic(cpBody *body, cpShape *filter); + +/// Force a body to fall asleep immediately. +void cpBodySleep(cpBody *body); +/// Force a body to fall asleep immediately along with other bodies in a group. +void cpBodySleepWithGroup(cpBody *body, cpBody *group); + +/// Returns true if the body is sleeping. +static inline cpBool cpBodyIsSleeping(const cpBody *body) +{ + return (CP_PRIVATE(body->node).root != ((cpBody*)0)); +} + +static inline cpBodyType cpBodyGetType(cpBody *body) +{ + if(body->CP_PRIVATE(node).idleTime == INFINITY){ + return CP_BODY_TYPE_STATIC; + } else if(body->CP_PRIVATE(m) == INFINITY){ + return CP_BODY_TYPE_KINEMATIC; + } else { + return CP_BODY_TYPE_DYNAMIC; + } +} + +void cpBodySetType(cpBody *body, cpBodyType type); + +// TODO what to do about rogue bodies? +/// Returns true if the body has not been added to a space. +/// Note: Static bodies are a subtype of rogue bodies. +//static inline cpBool cpBodyIsRogue(const cpBody *body) +//{ +// return (body->CP_PRIVATE(space) == ((cpSpace*)0)); +//} + +/// Convert body relative/local coordinates to absolute/world coordinates. +static inline cpVect cpBodyLocalToWorld(const cpBody *body, const cpVect point) +{ + return cpTransformPoint(body->CP_PRIVATE(transform), point); +} + +/// Convert body absolute/world coordinates to relative/local coordinates. +static inline cpVect cpBodyWorldToLocal(const cpBody *body, const cpVect point) +{ + return cpTransformPoint(cpTransformRigidInverse(body->CP_PRIVATE(transform)), point); +} + +#define CP_DefineBodyStructGetter(type, member, name) \ +static inline type cpBodyGet##name(const cpBody *body){return body->CP_PRIVATE(member);} + +#define CP_DefineBodyStructSetter(type, member, name) \ +static inline void cpBodySet##name(cpBody *body, const type value){ \ + cpBodyActivate(body); \ + body->CP_PRIVATE(member) = value; \ + cpAssertSaneBody(body); \ +} + +#define CP_DefineBodyStructProperty(type, member, name) \ +CP_DefineBodyStructGetter(type, member, name) \ +CP_DefineBodyStructSetter(type, member, name) + +// TODO: add to docs +CP_DefineBodyStructGetter(cpSpace*, space, Space) + +CP_DefineBodyStructGetter(cpFloat, m, Mass) +/// Set the mass of a body. +void cpBodySetMass(cpBody *body, cpFloat m); + +CP_DefineBodyStructGetter(cpFloat, i, Moment) +/// Set the moment of a body. +void cpBodySetMoment(cpBody *body, cpFloat i); + +/// Get the position of a body. +static inline cpVect cpBodyGetPosition(const cpBody *body) +{ + return cpTransformPoint(body->CP_PRIVATE(transform), cpvzero); +} + +/// Set the position of a body. +void cpBodySetPosition(cpBody *body, cpVect pos); +CP_DefineBodyStructProperty(cpVect, cog, CenterOfGravity) +CP_DefineBodyStructProperty(cpVect, v, Velocity) +CP_DefineBodyStructProperty(cpVect, f, Force) +CP_DefineBodyStructGetter(cpFloat, a, Angle) +/// Set the angle of a body. +void cpBodySetAngle(cpBody *body, cpFloat a); +CP_DefineBodyStructProperty(cpFloat, w, AngularVelocity) +CP_DefineBodyStructProperty(cpFloat, t, Torque) +cpVect cpBodyGetRotation(const cpBody *body); // TODO remove? +CP_DefineBodyStructProperty(cpFloat, v_limit, VelocityLimit) +CP_DefineBodyStructProperty(cpFloat, w_limit, AngularVelocityLimit) +CP_DefineBodyStructProperty(cpDataPointer, userData, UserData) + +/// Default Integration functions. +void cpBodyUpdateVelocity(cpBody *body, cpVect gravity, cpFloat damping, cpFloat dt); +void cpBodyUpdatePosition(cpBody *body, cpFloat dt); + +void cpBodyApplyForceAtWorldPoint(cpBody *body, cpVect force, cpVect point); +void cpBodyApplyForceAtLocalPoint(cpBody *body, cpVect force, cpVect point); + +void cpBodyApplyImpulseAtWorldPoint(cpBody *body, cpVect impulse, cpVect point); +void cpBodyApplyImpulseAtLocalPoint(cpBody *body, cpVect impulse, cpVect point); + +/// Get the velocity on a body (in world units) at a point on the body in world coordinates. +cpVect cpBodyGetVelocityAtWorldPoint(const cpBody *body, cpVect point); +/// Get the velocity on a body (in world units) at a point on the body in local coordinates. +cpVect cpBodyGetVelocityAtLocalPoint(const cpBody *body, cpVect point); + + +/// Get the kinetic energy of a body. +static inline cpFloat cpBodyKineticEnergy(const cpBody *body) +{ + // Need to do some fudging to avoid NaNs + cpFloat vsq = cpvdot(body->CP_PRIVATE(v), body->CP_PRIVATE(v)); + cpFloat wsq = body->CP_PRIVATE(w)*body->CP_PRIVATE(w); + return (vsq ? vsq*body->CP_PRIVATE(m) : 0.0f) + (wsq ? wsq*body->CP_PRIVATE(i) : 0.0f); +} + +/// Body/shape iterator callback function type. +typedef void (*cpBodyShapeIteratorFunc)(cpBody *body, cpShape *shape, void *data); +/// Call @c func once for each shape attached to @c body and added to the space. +void cpBodyEachShape(cpBody *body, cpBodyShapeIteratorFunc func, void *data); + +/// Body/constraint iterator callback function type. +typedef void (*cpBodyConstraintIteratorFunc)(cpBody *body, cpConstraint *constraint, void *data); +/// Call @c func once for each constraint attached to @c body and added to the space. +void cpBodyEachConstraint(cpBody *body, cpBodyConstraintIteratorFunc func, void *data); + +/// Body/arbiter iterator callback function type. +typedef void (*cpBodyArbiterIteratorFunc)(cpBody *body, cpArbiter *arbiter, void *data); +/// Call @c func once for each arbiter that is currently active on the body. +void cpBodyEachArbiter(cpBody *body, cpBodyArbiterIteratorFunc func, void *data); + +///@} diff --git a/include/Chipmunk/chipmunk/cpConstraint.h b/include/Chipmunk/chipmunk/cpConstraint.h new file mode 100644 index 0000000..b66c767 --- /dev/null +++ b/include/Chipmunk/chipmunk/cpConstraint.h @@ -0,0 +1,167 @@ +/* Copyright (c) 2007 Scott Lembcke + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +/// @defgroup cpConstraint cpConstraint +/// @{ + +typedef struct cpConstraintClass cpConstraintClass; + +typedef void (*cpConstraintPreStepImpl)(cpConstraint *constraint, cpFloat dt); +typedef void (*cpConstraintApplyCachedImpulseImpl)(cpConstraint *constraint, cpFloat dt_coef); +typedef void (*cpConstraintApplyImpulseImpl)(cpConstraint *constraint, cpFloat dt); +typedef cpFloat (*cpConstraintGetImpulseImpl)(cpConstraint *constraint); + +/// @private +struct cpConstraintClass { + cpConstraintPreStepImpl preStep; + cpConstraintApplyCachedImpulseImpl applyCachedImpulse; + cpConstraintApplyImpulseImpl applyImpulse; + cpConstraintGetImpulseImpl getImpulse; +}; + +/// Callback function type that gets called before solving a joint. +typedef void (*cpConstraintPreSolveFunc)(cpConstraint *constraint, cpSpace *space); +/// Callback function type that gets called after solving a joint. +typedef void (*cpConstraintPostSolveFunc)(cpConstraint *constraint, cpSpace *space); + + +/// Opaque cpConstraint struct. +struct cpConstraint { + CP_PRIVATE(const cpConstraintClass *klass); + + /// The first body connected to this constraint. + cpBody *a; + /// The second body connected to this constraint. + cpBody *b; + + CP_PRIVATE(cpSpace *space); + + CP_PRIVATE(cpConstraint *next_a); + CP_PRIVATE(cpConstraint *next_b); + + /// The maximum force that this constraint is allowed to use. + /// Defaults to infinity. + cpFloat maxForce; + /// The rate at which joint error is corrected. + /// Defaults to pow(1.0 - 0.1, 60.0) meaning that it will + /// correct 10% of the error every 1/60th of a second. + cpFloat errorBias; + /// The maximum rate at which joint error is corrected. + /// Defaults to infinity. + cpFloat maxBias; + + /// Whether or not the connected bodies should checked for collisions. + /// Collisions are filtered before calling callbacks. + /// Defaults to cpTrue. + cpBool collideBodies; + + /// Function called before the solver runs. + /// Animate your joint anchors, update your motor torque, etc. + cpConstraintPreSolveFunc preSolve; + + /// Function called after the solver runs. + /// Use the applied impulse to perform effects like breakable joints. + cpConstraintPostSolveFunc postSolve; + + /// User definable data pointer. + /// Generally this points to your the game object class so you can access it + /// when given a cpConstraint reference in a callback. + cpDataPointer userData; +}; + +/// Destroy a constraint. +void cpConstraintDestroy(cpConstraint *constraint); +/// Destroy and free a constraint. +void cpConstraintFree(cpConstraint *constraint); + +/// @private +static inline void cpConstraintActivateBodies(cpConstraint *constraint) +{ + cpBody *a = constraint->a; cpBodyActivate(a); + cpBody *b = constraint->b; cpBodyActivate(b); +} + +/// @private +#define CP_DefineConstraintStructGetter(type, member, name) \ +static inline type cpConstraint##Get##name(const cpConstraint *constraint){return constraint->member;} + +/// @private +#define CP_DefineConstraintStructSetter(type, member, name) \ +static inline void cpConstraint##Set##name(cpConstraint *constraint, type value){ \ + cpConstraintActivateBodies(constraint); \ + constraint->member = value; \ +} + +/// @private +#define CP_DefineConstraintStructProperty(type, member, name) \ +CP_DefineConstraintStructGetter(type, member, name) \ +CP_DefineConstraintStructSetter(type, member, name) + +CP_DefineConstraintStructGetter(cpSpace*, CP_PRIVATE(space), Space) + +CP_DefineConstraintStructGetter(cpBody*, a, A) +CP_DefineConstraintStructGetter(cpBody*, b, B) +CP_DefineConstraintStructProperty(cpFloat, maxForce, MaxForce) +CP_DefineConstraintStructProperty(cpFloat, errorBias, ErrorBias) +CP_DefineConstraintStructProperty(cpFloat, maxBias, MaxBias) +CP_DefineConstraintStructProperty(cpBool, collideBodies, CollideBodies) +CP_DefineConstraintStructProperty(cpConstraintPreSolveFunc, preSolve, PreSolveFunc) +CP_DefineConstraintStructProperty(cpConstraintPostSolveFunc, postSolve, PostSolveFunc) +CP_DefineConstraintStructProperty(cpDataPointer, userData, UserData) + +// Get the last impulse applied by this constraint. +static inline cpFloat cpConstraintGetImpulse(cpConstraint *constraint) +{ + return constraint->CP_PRIVATE(klass)->getImpulse(constraint); +} + +/// @} + +#define cpConstraintCheckCast(constraint, struct) \ + cpAssertHard(constraint->CP_PRIVATE(klass) == struct##GetClass(), "Constraint is not a "#struct) + +#define CP_DefineConstraintGetter(struct, type, member, name) \ +static inline type struct##Get##name(const cpConstraint *constraint){ \ + cpConstraintCheckCast(constraint, struct); \ + return ((struct *)constraint)->member; \ +} + +#define CP_DefineConstraintSetter(struct, type, member, name) \ +static inline void struct##Set##name(cpConstraint *constraint, type value){ \ + cpConstraintCheckCast(constraint, struct); \ + cpConstraintActivateBodies(constraint); \ + ((struct *)constraint)->member = value; \ +} + +#define CP_DefineConstraintProperty(struct, type, member, name) \ +CP_DefineConstraintGetter(struct, type, member, name) \ +CP_DefineConstraintSetter(struct, type, member, name) + +#include "cpPinJoint.h" +#include "cpSlideJoint.h" +#include "cpPivotJoint.h" +#include "cpGrooveJoint.h" +#include "cpDampedSpring.h" +#include "cpDampedRotarySpring.h" +#include "cpRotaryLimitJoint.h" +#include "cpRatchetJoint.h" +#include "cpGearJoint.h" +#include "cpSimpleMotor.h" diff --git a/include/Chipmunk/chipmunk/cpDampedRotarySpring.h b/include/Chipmunk/chipmunk/cpDampedRotarySpring.h new file mode 100644 index 0000000..86cf915 --- /dev/null +++ b/include/Chipmunk/chipmunk/cpDampedRotarySpring.h @@ -0,0 +1,56 @@ +/* Copyright (c) 2007 Scott Lembcke + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +/// @defgroup cpDampedRotarySpring cpDampedRotarySpring +/// @{ + +typedef cpFloat (*cpDampedRotarySpringTorqueFunc)(struct cpConstraint *spring, cpFloat relativeAngle); + +const cpConstraintClass *cpDampedRotarySpringGetClass(void); + +/// @private +typedef struct cpDampedRotarySpring { + cpConstraint constraint; + cpFloat restAngle; + cpFloat stiffness; + cpFloat damping; + cpDampedRotarySpringTorqueFunc springTorqueFunc; + + cpFloat target_wrn; + cpFloat w_coef; + + cpFloat iSum; + cpFloat jAcc; +} cpDampedRotarySpring; + +/// Allocate a damped rotary spring. +cpDampedRotarySpring* cpDampedRotarySpringAlloc(void); +/// Initialize a damped rotary spring. +cpDampedRotarySpring* cpDampedRotarySpringInit(cpDampedRotarySpring *joint, cpBody *a, cpBody *b, cpFloat restAngle, cpFloat stiffness, cpFloat damping); +/// Allocate and initialize a damped rotary spring. +cpConstraint* cpDampedRotarySpringNew(cpBody *a, cpBody *b, cpFloat restAngle, cpFloat stiffness, cpFloat damping); + +CP_DefineConstraintProperty(cpDampedRotarySpring, cpFloat, restAngle, RestAngle) +CP_DefineConstraintProperty(cpDampedRotarySpring, cpFloat, stiffness, Stiffness) +CP_DefineConstraintProperty(cpDampedRotarySpring, cpFloat, damping, Damping) +CP_DefineConstraintProperty(cpDampedRotarySpring, cpDampedRotarySpringTorqueFunc, springTorqueFunc, SpringTorqueFunc) + +/// @} diff --git a/include/Chipmunk/chipmunk/cpDampedSpring.h b/include/Chipmunk/chipmunk/cpDampedSpring.h new file mode 100644 index 0000000..f512064 --- /dev/null +++ b/include/Chipmunk/chipmunk/cpDampedSpring.h @@ -0,0 +1,64 @@ +/* Copyright (c) 2007 Scott Lembcke + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +/// @defgroup cpDampedSpring cpDampedSpring +/// @{ + +typedef struct cpDampedSpring cpDampedSpring; + +typedef cpFloat (*cpDampedSpringForceFunc)(cpConstraint *spring, cpFloat dist); + +const cpConstraintClass *cpDampedSpringGetClass(void); + +/// @private +struct cpDampedSpring { + cpConstraint constraint; + cpVect anchr1, anchr2; + cpFloat restLength; + cpFloat stiffness; + cpFloat damping; + cpDampedSpringForceFunc springForceFunc; + + cpFloat target_vrn; + cpFloat v_coef; + + cpVect r1, r2; + cpFloat nMass; + cpVect n; + + cpFloat jAcc; +}; + +/// Allocate a damped spring. +cpDampedSpring* cpDampedSpringAlloc(void); +/// Initialize a damped spring. +cpDampedSpring* cpDampedSpringInit(cpDampedSpring *joint, cpBody *a, cpBody *b, cpVect anchr1, cpVect anchr2, cpFloat restLength, cpFloat stiffness, cpFloat damping); +/// Allocate and initialize a damped spring. +cpConstraint* cpDampedSpringNew(cpBody *a, cpBody *b, cpVect anchr1, cpVect anchr2, cpFloat restLength, cpFloat stiffness, cpFloat damping); + +CP_DefineConstraintProperty(cpDampedSpring, cpVect, anchr1, Anchr1) +CP_DefineConstraintProperty(cpDampedSpring, cpVect, anchr2, Anchr2) +CP_DefineConstraintProperty(cpDampedSpring, cpFloat, restLength, RestLength) +CP_DefineConstraintProperty(cpDampedSpring, cpFloat, stiffness, Stiffness) +CP_DefineConstraintProperty(cpDampedSpring, cpFloat, damping, Damping) +CP_DefineConstraintProperty(cpDampedSpring, cpDampedSpringForceFunc, springForceFunc, SpringForceFunc) + +/// @} diff --git a/include/Chipmunk/chipmunk/cpGearJoint.h b/include/Chipmunk/chipmunk/cpGearJoint.h new file mode 100644 index 0000000..c9ebf94 --- /dev/null +++ b/include/Chipmunk/chipmunk/cpGearJoint.h @@ -0,0 +1,51 @@ +/* Copyright (c) 2007 Scott Lembcke + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +/// @defgroup cpGearJoint cpGearJoint +/// @{ + +const cpConstraintClass *cpGearJointGetClass(void); + +/// @private +typedef struct cpGearJoint { + cpConstraint constraint; + cpFloat phase, ratio; + cpFloat ratio_inv; + + cpFloat iSum; + + cpFloat bias; + cpFloat jAcc; +} cpGearJoint; + +/// Allocate a gear joint. +cpGearJoint* cpGearJointAlloc(void); +/// Initialize a gear joint. +cpGearJoint* cpGearJointInit(cpGearJoint *joint, cpBody *a, cpBody *b, cpFloat phase, cpFloat ratio); +/// Allocate and initialize a gear joint. +cpConstraint* cpGearJointNew(cpBody *a, cpBody *b, cpFloat phase, cpFloat ratio); + +CP_DefineConstraintProperty(cpGearJoint, cpFloat, phase, Phase) +CP_DefineConstraintGetter(cpGearJoint, cpFloat, ratio, Ratio) +/// Set the ratio of a gear joint. +void cpGearJointSetRatio(cpConstraint *constraint, cpFloat value); + +/// @} diff --git a/include/Chipmunk/chipmunk/cpGrooveJoint.h b/include/Chipmunk/chipmunk/cpGrooveJoint.h new file mode 100644 index 0000000..b260218 --- /dev/null +++ b/include/Chipmunk/chipmunk/cpGrooveJoint.h @@ -0,0 +1,57 @@ +/* Copyright (c) 2007 Scott Lembcke + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +/// @defgroup cpGrooveJoint cpGrooveJoint +/// @{ + +const cpConstraintClass *cpGrooveJointGetClass(void); + +/// @private +typedef struct cpGrooveJoint { + cpConstraint constraint; + cpVect grv_n, grv_a, grv_b; + cpVect anchr2; + + cpVect grv_tn; + cpFloat clamp; + cpVect r1, r2; + cpMat2x2 k; + + cpVect jAcc; + cpVect bias; +} cpGrooveJoint; + +/// Allocate a groove joint. +cpGrooveJoint* cpGrooveJointAlloc(void); +/// Initialize a groove joint. +cpGrooveJoint* cpGrooveJointInit(cpGrooveJoint *joint, cpBody *a, cpBody *b, cpVect groove_a, cpVect groove_b, cpVect anchr2); +/// Allocate and initialize a groove joint. +cpConstraint* cpGrooveJointNew(cpBody *a, cpBody *b, cpVect groove_a, cpVect groove_b, cpVect anchr2); + +CP_DefineConstraintGetter(cpGrooveJoint, cpVect, grv_a, GrooveA) +/// Set endpoint a of a groove joint's groove +void cpGrooveJointSetGrooveA(cpConstraint *constraint, cpVect value); +CP_DefineConstraintGetter(cpGrooveJoint, cpVect, grv_b, GrooveB) +/// Set endpoint b of a groove joint's groove +void cpGrooveJointSetGrooveB(cpConstraint *constraint, cpVect value); +CP_DefineConstraintProperty(cpGrooveJoint, cpVect, anchr2, Anchr2) + +/// @} diff --git a/include/Chipmunk/chipmunk/cpPinJoint.h b/include/Chipmunk/chipmunk/cpPinJoint.h new file mode 100644 index 0000000..2413e84 --- /dev/null +++ b/include/Chipmunk/chipmunk/cpPinJoint.h @@ -0,0 +1,52 @@ +/* Copyright (c) 2007 Scott Lembcke + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +/// @defgroup cpPinJoint cpPinJoint +/// @{ + +const cpConstraintClass *cpPinJointGetClass(void); + +/// @private +typedef struct cpPinJoint { + cpConstraint constraint; + cpVect anchr1, anchr2; + cpFloat dist; + + cpVect r1, r2; + cpVect n; + cpFloat nMass; + + cpFloat jnAcc; + cpFloat bias; +} cpPinJoint; + +/// Allocate a pin joint. +cpPinJoint* cpPinJointAlloc(void); +/// Initialize a pin joint. +cpPinJoint* cpPinJointInit(cpPinJoint *joint, cpBody *a, cpBody *b, cpVect anchr1, cpVect anchr2); +/// Allocate and initialize a pin joint. +cpConstraint* cpPinJointNew(cpBody *a, cpBody *b, cpVect anchr1, cpVect anchr2); + +CP_DefineConstraintProperty(cpPinJoint, cpVect, anchr1, Anchr1) +CP_DefineConstraintProperty(cpPinJoint, cpVect, anchr2, Anchr2) +CP_DefineConstraintProperty(cpPinJoint, cpFloat, dist, Dist) + +///@} diff --git a/include/Chipmunk/chipmunk/cpPivotJoint.h b/include/Chipmunk/chipmunk/cpPivotJoint.h new file mode 100644 index 0000000..a5d3317 --- /dev/null +++ b/include/Chipmunk/chipmunk/cpPivotJoint.h @@ -0,0 +1,51 @@ +/* Copyright (c) 2007 Scott Lembcke + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +/// @defgroup cpPivotJoint cpPivotJoint +/// @{ + +const cpConstraintClass *cpPivotJointGetClass(void); + +/// @private +typedef struct cpPivotJoint { + cpConstraint constraint; + cpVect anchr1, anchr2; + + cpVect r1, r2; + cpMat2x2 k; + + cpVect jAcc; + cpVect bias; +} cpPivotJoint; + +/// Allocate a pivot joint +cpPivotJoint* cpPivotJointAlloc(void); +/// Initialize a pivot joint. +cpPivotJoint* cpPivotJointInit(cpPivotJoint *joint, cpBody *a, cpBody *b, cpVect anchr1, cpVect anchr2); +/// Allocate and initialize a pivot joint. +cpConstraint* cpPivotJointNew(cpBody *a, cpBody *b, cpVect pivot); +/// Allocate and initialize a pivot joint with specific anchors. +cpConstraint* cpPivotJointNew2(cpBody *a, cpBody *b, cpVect anchr1, cpVect anchr2); + +CP_DefineConstraintProperty(cpPivotJoint, cpVect, anchr1, Anchr1) +CP_DefineConstraintProperty(cpPivotJoint, cpVect, anchr2, Anchr2) + +/// @} diff --git a/include/Chipmunk/chipmunk/cpPolyShape.h b/include/Chipmunk/chipmunk/cpPolyShape.h new file mode 100644 index 0000000..8612446 --- /dev/null +++ b/include/Chipmunk/chipmunk/cpPolyShape.h @@ -0,0 +1,76 @@ +/* Copyright (c) 2007 Scott Lembcke + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +/// @defgroup cpPolyShape cpPolyShape +/// @{ + +/// @private +typedef struct cpSplittingPlane { + cpVect v0, n; +} cpSplittingPlane; + +#define CP_POLY_SHAPE_INLINE_ALLOC 6 + +/// @private +typedef struct cpPolyShape { + cpShape shape; + + cpFloat r; + + int count; + // The untransformed planes are appended at the end of the transformed planes. + cpSplittingPlane *planes; + + // Allocate a small number of splitting planes internally for simple poly. + cpSplittingPlane _planes[2*CP_POLY_SHAPE_INLINE_ALLOC]; +} cpPolyShape; + +// TODO: Clean up naming here. +// TODO: Use transforms. + +/// Allocate a polygon shape. +cpPolyShape* cpPolyShapeAlloc(void); +/// Initialize a polygon shape with rounded corners. +/// A convex hull will be created from the vertexes. +cpPolyShape* cpPolyShapeInit(cpPolyShape *poly, cpBody *body, int count, const cpVect *verts, cpTransform transform, cpFloat radius); +cpPolyShape* cpPolyShapeInitRaw(cpPolyShape *poly, cpBody *body, int count, const cpVect *verts, cpFloat radius); +/// Allocate and initialize a polygon shape with rounded corners. +/// A convex hull will be created from the vertexes. +cpShape* cpPolyShapeNew(cpBody *body, int count, const cpVect *verts, cpTransform transform, cpFloat radius); +cpShape* cpPolyShapeNewRaw(cpBody *body, int count, const cpVect *verts, cpFloat radius); + +/// Initialize a box shaped polygon shape with rounded corners. +cpPolyShape* cpBoxShapeInit(cpPolyShape *poly, cpBody *body, cpFloat width, cpFloat height, cpFloat radius); +/// Initialize an offset box shaped polygon shape with rounded corners. +cpPolyShape* cpBoxShapeInit2(cpPolyShape *poly, cpBody *body, cpBB box, cpFloat radius); +/// Allocate and initialize a box shaped polygon shape. +cpShape* cpBoxShapeNew(cpBody *body, cpFloat width, cpFloat height, cpFloat radius); +/// Allocate and initialize an offset box shaped polygon shape. +cpShape* cpBoxShapeNew2(cpBody *body, cpBB box, cpFloat radius); + +/// Get the number of verts in a polygon shape. +int cpPolyShapeGetCount(const cpShape *shape); +/// Get the @c ith vertex of a polygon shape. +cpVect cpPolyShapeGetVert(const cpShape *shape, int idx); +/// Get the radius of a polygon shape. +cpFloat cpPolyShapeGetRadius(const cpShape *shape); + +/// @} diff --git a/include/Chipmunk/chipmunk/cpRatchetJoint.h b/include/Chipmunk/chipmunk/cpRatchetJoint.h new file mode 100644 index 0000000..e371b10 --- /dev/null +++ b/include/Chipmunk/chipmunk/cpRatchetJoint.h @@ -0,0 +1,49 @@ +/* Copyright (c) 2007 Scott Lembcke + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +/// @defgroup cpRatchetJoint cpRatchetJoint +/// @{ + +const cpConstraintClass *cpRatchetJointGetClass(void); + +/// @private +typedef struct cpRatchetJoint { + cpConstraint constraint; + cpFloat angle, phase, ratchet; + + cpFloat iSum; + + cpFloat bias; + cpFloat jAcc; +} cpRatchetJoint; + +/// Allocate a ratchet joint. +cpRatchetJoint* cpRatchetJointAlloc(void); +/// Initialize a ratched joint. +cpRatchetJoint* cpRatchetJointInit(cpRatchetJoint *joint, cpBody *a, cpBody *b, cpFloat phase, cpFloat ratchet); +/// Allocate and initialize a ratchet joint. +cpConstraint* cpRatchetJointNew(cpBody *a, cpBody *b, cpFloat phase, cpFloat ratchet); + +CP_DefineConstraintProperty(cpRatchetJoint, cpFloat, angle, Angle) +CP_DefineConstraintProperty(cpRatchetJoint, cpFloat, phase, Phase) +CP_DefineConstraintProperty(cpRatchetJoint, cpFloat, ratchet, Ratchet) + +/// @} diff --git a/include/Chipmunk/chipmunk/cpRotaryLimitJoint.h b/include/Chipmunk/chipmunk/cpRotaryLimitJoint.h new file mode 100644 index 0000000..2277e40 --- /dev/null +++ b/include/Chipmunk/chipmunk/cpRotaryLimitJoint.h @@ -0,0 +1,48 @@ +/* Copyright (c) 2007 Scott Lembcke + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +/// @defgroup cpRotaryLimitJoint cpRotaryLimitJoint +/// @{ + +const cpConstraintClass *cpRotaryLimitJointGetClass(void); + +/// @private +typedef struct cpRotaryLimitJoint { + cpConstraint constraint; + cpFloat min, max; + + cpFloat iSum; + + cpFloat bias; + cpFloat jAcc; +} cpRotaryLimitJoint; + +/// Allocate a damped rotary limit joint. +cpRotaryLimitJoint* cpRotaryLimitJointAlloc(void); +/// Initialize a damped rotary limit joint. +cpRotaryLimitJoint* cpRotaryLimitJointInit(cpRotaryLimitJoint *joint, cpBody *a, cpBody *b, cpFloat min, cpFloat max); +/// Allocate and initialize a damped rotary limit joint. +cpConstraint* cpRotaryLimitJointNew(cpBody *a, cpBody *b, cpFloat min, cpFloat max); + +CP_DefineConstraintProperty(cpRotaryLimitJoint, cpFloat, min, Min) +CP_DefineConstraintProperty(cpRotaryLimitJoint, cpFloat, max, Max) + +/// @} diff --git a/include/Chipmunk/chipmunk/cpShape.h b/include/Chipmunk/chipmunk/cpShape.h new file mode 100644 index 0000000..3b83984 --- /dev/null +++ b/include/Chipmunk/chipmunk/cpShape.h @@ -0,0 +1,258 @@ +/* Copyright (c) 2007 Scott Lembcke + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +/// @defgroup cpShape cpShape +/// The cpShape struct defines the shape of a rigid body. +/// @{ + +typedef struct cpShapeClass cpShapeClass; + +/// Nearest point query info struct. +typedef struct cpPointQueryInfo { + /// The nearest shape, NULL if no shape was within range. + const cpShape *shape; + /// The closest point on the shape's surface. (in world space coordinates) + cpVect point; + /// The distance to the point. The distance is negative if the point is inside the shape. + cpFloat distance; + /// The gradient of the signed distance function. + /// The same as info.p/info.d, but accurate even for very small values of info.d. + cpVect gradient; +} cpPointQueryInfo; + +/// Segment query info struct. +typedef struct cpSegmentQueryInfo { + /// The shape that was hit, NULL if no collision occured. + const cpShape *shape; + /// The point of impact. + cpVect point; + /// The normal of the surface hit. + cpVect normal; + /// The normalized distance along the query segment in the range [0, 1]. + cpFloat alpha; +} cpSegmentQueryInfo; + +typedef struct cpShapeFilter { + cpGroup group; + cpBitmask categories; + cpBitmask mask; +} cpShapeFilter; + +static const cpShapeFilter CP_SHAPE_FILTER_ALL = {CP_NO_GROUP, CP_ALL_CATEGORIES, CP_ALL_CATEGORIES}; +static const cpShapeFilter CP_SHAPE_FILTER_NONE = {CP_NO_GROUP, ~CP_ALL_CATEGORIES, ~CP_ALL_CATEGORIES}; + +static inline cpShapeFilter +cpShapeFilterNew(cpGroup group, cpBitmask categories, cpBitmask mask) +{ + cpShapeFilter filter = {group, categories, mask}; + return filter; +} + + +/// @private +struct cpShapeMassInfo { + cpFloat m; + cpFloat i; + cpVect cog; + cpFloat area; +}; + +/// @private +typedef enum cpShapeType{ + CP_CIRCLE_SHAPE, + CP_SEGMENT_SHAPE, + CP_POLY_SHAPE, + CP_NUM_SHAPES +} cpShapeType; + +typedef cpBB (*cpShapeCacheDataImpl)(cpShape *shape, cpTransform transform); +typedef void (*cpShapeDestroyImpl)(cpShape *shape); +typedef void (*cpShapePointQueryImpl)(const cpShape *shape, cpVect p, cpPointQueryInfo *info); +typedef void (*cpShapeSegmentQueryImpl)(const cpShape *shape, cpVect a, cpVect b, cpFloat radius, cpSegmentQueryInfo *info); + +/// @private +struct cpShapeClass { + cpShapeType type; + + cpShapeCacheDataImpl cacheData; + cpShapeDestroyImpl destroy; + cpShapePointQueryImpl pointQuery; + cpShapeSegmentQueryImpl segmentQuery; +}; + +/// Opaque collision shape struct. +struct cpShape { + CP_PRIVATE(const cpShapeClass *klass); + + /// The rigid body this collision shape is attached to. + CP_PRIVATE(cpBody *body); + + // Optional mass of the shape. + CP_PRIVATE(struct cpShapeMassInfo massInfo); + + /// The current bounding box of the shape. + CP_PRIVATE(cpBB bb); + + /// Sensor flag. + /// Sensor shapes call collision callbacks but don't produce collisions. + CP_PRIVATE(cpBool sensor); + + /// Coefficient of restitution. (elasticity) + CP_PRIVATE(cpFloat e); + /// Coefficient of friction. + CP_PRIVATE(cpFloat u); + /// Surface velocity used when solving for friction. + CP_PRIVATE(cpVect surfaceV); + + /// User definable data pointer. + /// Generally this points to your the game object class so you can access it + /// when given a cpShape reference in a callback. + CP_PRIVATE(cpDataPointer userData); + + /// Collision type of this shape used when picking collision handlers. + CP_PRIVATE(cpCollisionType type); + + CP_PRIVATE(cpShapeFilter filter); + + CP_PRIVATE(cpSpace *space); + + CP_PRIVATE(cpShape *next); + CP_PRIVATE(cpShape *prev); + + CP_PRIVATE(cpHashValue hashid); +}; + +/// Destroy a shape. +void cpShapeDestroy(cpShape *shape); +/// Destroy and Free a shape. +void cpShapeFree(cpShape *shape); + +/// Update, cache and return the bounding box of a shape based on the body it's attached to. +cpBB cpShapeCacheBB(cpShape *shape); +/// Update, cache and return the bounding box of a shape with an explicit transformation. +cpBB cpShapeUpdate(cpShape *shape, cpTransform transform); + +/// Perform a nearest point query. It finds the closest point on the surface of shape to a specific point. +/// The value returned is the distance between the points. A negative distance means the point is inside the shape. +cpFloat cpShapePointQuery(const cpShape *shape, cpVect p, cpPointQueryInfo *out); + +/// Perform a segment query against a shape. @c info must be a pointer to a valid cpSegmentQueryInfo structure. +cpBool cpShapeSegmentQuery(const cpShape *shape, cpVect a, cpVect b, cpFloat radius, cpSegmentQueryInfo *info); + +/// Return contact information about two shapes. +cpContactPointSet cpShapesCollide(const cpShape *a, const cpShape *b); + + +#define CP_DefineShapeStructGetter(type, member, name) \ +static inline type cpShapeGet##name(const cpShape *shape){return shape->CP_PRIVATE(member);} + +#define CP_DefineShapeStructSetter(type, member, name, activates) \ +static inline void cpShapeSet##name(cpShape *shape, type value){ \ + if(activates) cpBodyActivate(shape->CP_PRIVATE(body)); \ + shape->CP_PRIVATE(member) = value; \ +} + +#define CP_DefineShapeStructProperty(type, member, name, activates) \ +CP_DefineShapeStructGetter(type, member, name) \ +CP_DefineShapeStructSetter(type, member, name, activates) + +CP_DefineShapeStructGetter(cpSpace*, space, Space) + +CP_DefineShapeStructGetter(cpBody*, body, Body) +void cpShapeSetBody(cpShape *shape, cpBody *body); + +cpFloat cpShapeGetMass(cpShape *shape); +void cpShapeSetMass(cpShape *shape, cpFloat mass); + +cpFloat cpShapeGetDensity(cpShape *shape); +void cpShapeSetDensity(cpShape *shape, cpFloat density); + +cpFloat cpShapeGetMoment(cpShape *shape); +cpFloat cpShapeGetArea(cpShape *shape); +cpVect cpShapeGetCenterOfGravity(cpShape *shape); + +CP_DefineShapeStructGetter(cpBB, bb, BB) +CP_DefineShapeStructProperty(cpBool, sensor, Sensor, cpTrue) +CP_DefineShapeStructProperty(cpFloat, e, Elasticity, cpFalse) +CP_DefineShapeStructProperty(cpFloat, u, Friction, cpTrue) +CP_DefineShapeStructProperty(cpVect, surfaceV, SurfaceVelocity, cpTrue) +CP_DefineShapeStructProperty(cpDataPointer, userData, UserData, cpFalse) +CP_DefineShapeStructProperty(cpCollisionType, type, CollisionType, cpTrue) +CP_DefineShapeStructProperty(cpShapeFilter, filter, Filter, cpTrue) + +/// When initializing a shape, it's hash value comes from a counter. +/// Because the hash value may affect iteration order, you can reset the shape ID counter +/// when recreating a space. This will make the simulation be deterministic. +void cpResetShapeIdCounter(void); + +#define CP_DeclareShapeGetter(struct, type, name) type struct##Get##name(const cpShape *shape) + +/// @} +/// @defgroup cpCircleShape cpCircleShape + +/// @private +typedef struct cpCircleShape { + cpShape shape; + + cpVect c, tc; + cpFloat r; +} cpCircleShape; + +/// Allocate a circle shape. +cpCircleShape* cpCircleShapeAlloc(void); +/// Initialize a circle shape. +cpCircleShape* cpCircleShapeInit(cpCircleShape *circle, cpBody *body, cpFloat radius, cpVect offset); +/// Allocate and initialize a circle shape. +cpShape* cpCircleShapeNew(cpBody *body, cpFloat radius, cpVect offset); + +CP_DeclareShapeGetter(cpCircleShape, cpVect, Offset); +CP_DeclareShapeGetter(cpCircleShape, cpFloat, Radius); + +/// @} +/// @defgroup cpSegmentShape cpSegmentShape + +/// @private +typedef struct cpSegmentShape { + cpShape shape; + + cpVect a, b, n; + cpVect ta, tb, tn; + cpFloat r; + + cpVect a_tangent, b_tangent; +} cpSegmentShape; + +/// Allocate a segment shape. +cpSegmentShape* cpSegmentShapeAlloc(void); +/// Initialize a segment shape. +cpSegmentShape* cpSegmentShapeInit(cpSegmentShape *seg, cpBody *body, cpVect a, cpVect b, cpFloat radius); +/// Allocate and initialize a segment shape. +cpShape* cpSegmentShapeNew(cpBody *body, cpVect a, cpVect b, cpFloat radius); + +/// Let Chipmunk know about the geometry of adjacent segments to avoid colliding with endcaps. +void cpSegmentShapeSetNeighbors(cpShape *shape, cpVect prev, cpVect next); + +CP_DeclareShapeGetter(cpSegmentShape, cpVect, A); +CP_DeclareShapeGetter(cpSegmentShape, cpVect, B); +CP_DeclareShapeGetter(cpSegmentShape, cpVect, Normal); +CP_DeclareShapeGetter(cpSegmentShape, cpFloat, Radius); + +/// @} diff --git a/include/Chipmunk/chipmunk/cpSimpleMotor.h b/include/Chipmunk/chipmunk/cpSimpleMotor.h new file mode 100644 index 0000000..37d28c5 --- /dev/null +++ b/include/Chipmunk/chipmunk/cpSimpleMotor.h @@ -0,0 +1,46 @@ +/* Copyright (c) 2007 Scott Lembcke + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +/// @defgroup cpSimpleMotor cpSimpleMotor +/// @{ + +const cpConstraintClass *cpSimpleMotorGetClass(void); + +/// @private +typedef struct cpSimpleMotor { + cpConstraint constraint; + cpFloat rate; + + cpFloat iSum; + + cpFloat jAcc; +} cpSimpleMotor; + +/// Allocate a simple motor. +cpSimpleMotor* cpSimpleMotorAlloc(void); +/// initialize a simple motor. +cpSimpleMotor* cpSimpleMotorInit(cpSimpleMotor *joint, cpBody *a, cpBody *b, cpFloat rate); +/// Allocate and initialize a simple motor. +cpConstraint* cpSimpleMotorNew(cpBody *a, cpBody *b, cpFloat rate); + +CP_DefineConstraintProperty(cpSimpleMotor, cpFloat, rate, Rate) + +/// @} diff --git a/include/Chipmunk/chipmunk/cpSlideJoint.h b/include/Chipmunk/chipmunk/cpSlideJoint.h new file mode 100644 index 0000000..40db8bb --- /dev/null +++ b/include/Chipmunk/chipmunk/cpSlideJoint.h @@ -0,0 +1,53 @@ +/* Copyright (c) 2007 Scott Lembcke + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +/// @defgroup cpSlideJoint cpSlideJoint +/// @{ + +const cpConstraintClass *cpSlideJointGetClass(void); + +/// @private +typedef struct cpSlideJoint { + cpConstraint constraint; + cpVect anchr1, anchr2; + cpFloat min, max; + + cpVect r1, r2; + cpVect n; + cpFloat nMass; + + cpFloat jnAcc; + cpFloat bias; +} cpSlideJoint; + +/// Allocate a slide joint. +cpSlideJoint* cpSlideJointAlloc(void); +/// Initialize a slide joint. +cpSlideJoint* cpSlideJointInit(cpSlideJoint *joint, cpBody *a, cpBody *b, cpVect anchr1, cpVect anchr2, cpFloat min, cpFloat max); +/// Allocate and initialize a slide joint. +cpConstraint* cpSlideJointNew(cpBody *a, cpBody *b, cpVect anchr1, cpVect anchr2, cpFloat min, cpFloat max); + +CP_DefineConstraintProperty(cpSlideJoint, cpVect, anchr1, Anchr1) +CP_DefineConstraintProperty(cpSlideJoint, cpVect, anchr2, Anchr2) +CP_DefineConstraintProperty(cpSlideJoint, cpFloat, min, Min) +CP_DefineConstraintProperty(cpSlideJoint, cpFloat, max, Max) + +/// @} diff --git a/include/Chipmunk/chipmunk/cpSpace.h b/include/Chipmunk/chipmunk/cpSpace.h new file mode 100644 index 0000000..973f4d3 --- /dev/null +++ b/include/Chipmunk/chipmunk/cpSpace.h @@ -0,0 +1,328 @@ +/* Copyright (c) 2007 Scott Lembcke + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +/// @defgroup cpSpace cpSpace +/// @{ + +//MARK: Definitions + +typedef struct cpContactBufferHeader cpContactBufferHeader; +typedef void (*cpSpaceArbiterApplyImpulseFunc)(cpArbiter *arb); + +/// Collision begin event function callback type. +/// Returning false from a begin callback causes the collision to be ignored until +/// the the separate callback is called when the objects stop colliding. +typedef cpBool (*cpCollisionBeginFunc)(cpArbiter *arb, cpSpace *space, cpDataPointer userData); +/// Collision pre-solve event function callback type. +/// Returning false from a pre-step callback causes the collision to be ignored until the next step. +typedef cpBool (*cpCollisionPreSolveFunc)(cpArbiter *arb, cpSpace *space, cpDataPointer userData); +/// Collision post-solve event function callback type. +typedef void (*cpCollisionPostSolveFunc)(cpArbiter *arb, cpSpace *space, cpDataPointer userData); +/// Collision separate event function callback type. +typedef void (*cpCollisionSeparateFunc)(cpArbiter *arb, cpSpace *space, cpDataPointer userData); + +struct cpCollisionHandler { + const cpCollisionType typeA, typeB; + cpCollisionBeginFunc beginFunc; + cpCollisionPreSolveFunc preSolveFunc; + cpCollisionPostSolveFunc postSolveFunc; + cpCollisionSeparateFunc separateFunc; + cpDataPointer userData; +}; + +/// Basic Unit of Simulation in Chipmunk +struct cpSpace { + /// Number of iterations to use in the impulse solver to solve contacts. + int iterations; + + /// Gravity to pass to rigid bodies when integrating velocity. + cpVect gravity; + + /// Damping rate expressed as the fraction of velocity bodies retain each second. + /// A value of 0.9 would mean that each body's velocity will drop 10% per second. + /// The default value is 1.0, meaning no damping is applied. + /// @note This damping value is different than those of cpDampedSpring and cpDampedRotarySpring. + cpFloat damping; + + /// Speed threshold for a body to be considered idle. + /// The default value of 0 means to let the space guess a good threshold based on gravity. + cpFloat idleSpeedThreshold; + + /// Time a group of bodies must remain idle in order to fall asleep. + /// Enabling sleeping also implicitly enables the the contact graph. + /// The default value of INFINITY disables the sleeping algorithm. + cpFloat sleepTimeThreshold; + + /// Amount of encouraged penetration between colliding shapes. + /// Used to reduce oscillating contacts and keep the collision cache warm. + /// Defaults to 0.1. If you have poor simulation quality, + /// increase this number as much as possible without allowing visible amounts of overlap. + cpFloat collisionSlop; + + /// Determines how fast overlapping shapes are pushed apart. + /// Expressed as a fraction of the error remaining after each second. + /// Defaults to pow(1.0 - 0.1, 60.0) meaning that Chipmunk fixes 10% of overlap each frame at 60Hz. + cpFloat collisionBias; + + /// Number of frames that contact information should persist. + /// Defaults to 3. There is probably never a reason to change this value. + cpTimestamp collisionPersistence; + + /// User definable data pointer. + /// Generally this points to your game's controller or game state + /// class so you can access it when given a cpSpace reference in a callback. + cpDataPointer userData; + + CP_PRIVATE(cpTimestamp stamp); + CP_PRIVATE(cpFloat curr_dt); + + CP_PRIVATE(cpArray *dynamicBodies); + CP_PRIVATE(cpArray *otherBodies); + CP_PRIVATE(cpArray *rousedBodies); + CP_PRIVATE(cpArray *sleepingComponents); + + CP_PRIVATE(cpHashValue shapeIDCounter); + CP_PRIVATE(cpSpatialIndex *staticShapes); + CP_PRIVATE(cpSpatialIndex *dynamicShapes); + + CP_PRIVATE(cpArray *constraints); + + CP_PRIVATE(cpArray *arbiters); + CP_PRIVATE(cpContactBufferHeader *contactBuffersHead); + CP_PRIVATE(cpHashSet *cachedArbiters); + CP_PRIVATE(cpArray *pooledArbiters); + + CP_PRIVATE(cpArray *allocatedBuffers); + CP_PRIVATE(unsigned int locked); + + CP_PRIVATE(cpBool usesWildcards); + CP_PRIVATE(cpHashSet *collisionHandlers); + CP_PRIVATE(cpCollisionHandler defaultHandler); + + CP_PRIVATE(cpBool skipPostStep); + CP_PRIVATE(cpArray *postStepCallbacks); + + CP_PRIVATE(cpBody *staticBody); + CP_PRIVATE(cpBody _staticBody); +}; + +// TODO: Make timestep a parameter? + + +//MARK: Memory and Initialization + +/// Allocate a cpSpace. +cpSpace* cpSpaceAlloc(void); +/// Initialize a cpSpace. +cpSpace* cpSpaceInit(cpSpace *space); +/// Allocate and initialize a cpSpace. +cpSpace* cpSpaceNew(void); + +/// Destroy a cpSpace. +void cpSpaceDestroy(cpSpace *space); +/// Destroy and free a cpSpace. +void cpSpaceFree(cpSpace *space); + + +//MARK: Properties + +#define CP_DefineSpaceStructGetter(type, member, name) \ +static inline type cpSpaceGet##name(const cpSpace *space){return space->member;} + +#define CP_DefineSpaceStructSetter(type, member, name) \ +static inline void cpSpaceSet##name(cpSpace *space, type value){space->member = value;} + +#define CP_DefineSpaceStructProperty(type, member, name) \ +CP_DefineSpaceStructGetter(type, member, name) \ +CP_DefineSpaceStructSetter(type, member, name) + +CP_DefineSpaceStructProperty(int, iterations, Iterations) +CP_DefineSpaceStructProperty(cpVect, gravity, Gravity) +CP_DefineSpaceStructProperty(cpFloat, damping, Damping) +CP_DefineSpaceStructProperty(cpFloat, idleSpeedThreshold, IdleSpeedThreshold) +CP_DefineSpaceStructProperty(cpFloat, sleepTimeThreshold, SleepTimeThreshold) +CP_DefineSpaceStructProperty(cpFloat, collisionSlop, CollisionSlop) +CP_DefineSpaceStructProperty(cpFloat, collisionBias, CollisionBias) +CP_DefineSpaceStructProperty(cpTimestamp, collisionPersistence, CollisionPersistence) +CP_DefineSpaceStructProperty(cpDataPointer, userData, UserData) +CP_DefineSpaceStructGetter(cpBody *, CP_PRIVATE(staticBody), StaticBody) +CP_DefineSpaceStructGetter(cpFloat, CP_PRIVATE(curr_dt), CurrentTimeStep) + +/// returns true from inside a callback and objects cannot be added/removed. +static inline cpBool +cpSpaceIsLocked(cpSpace *space) +{ + return space->CP_PRIVATE(locked); +} + + +//MARK: Collision Handlers + +cpCollisionHandler *cpSpaceAddDefaultCollisionHandler(cpSpace *space); +cpCollisionHandler *cpSpaceAddCollisionHandler(cpSpace *space, cpCollisionType a, cpCollisionType b); +cpCollisionHandler *cpSpaceAddWildcardHandler(cpSpace *space, cpCollisionType type); + + +//MARK: Add/Remove objects + +/// Add a collision shape to the simulation. +/// If the shape is attached to a static body, it will be added as a static shape. +cpShape* cpSpaceAddShape(cpSpace *space, cpShape *shape); +/// Add a rigid body to the simulation. +cpBody* cpSpaceAddBody(cpSpace *space, cpBody *body); +/// Add a constraint to the simulation. +cpConstraint* cpSpaceAddConstraint(cpSpace *space, cpConstraint *constraint); + +/// Remove a collision shape from the simulation. +void cpSpaceRemoveShape(cpSpace *space, cpShape *shape); +/// Remove a rigid body from the simulation. +void cpSpaceRemoveBody(cpSpace *space, cpBody *body); +/// Remove a constraint from the simulation. +void cpSpaceRemoveConstraint(cpSpace *space, cpConstraint *constraint); + +/// Test if a collision shape has been added to the space. +cpBool cpSpaceContainsShape(cpSpace *space, cpShape *shape); +/// Test if a rigid body has been added to the space. +cpBool cpSpaceContainsBody(cpSpace *space, cpBody *body); +/// Test if a constraint has been added to the space. +cpBool cpSpaceContainsConstraint(cpSpace *space, cpConstraint *constraint); + +//MARK: Post-Step Callbacks + +/// Post Step callback function type. +typedef void (*cpPostStepFunc)(cpSpace *space, void *key, void *data); +/// Schedule a post-step callback to be called when cpSpaceStep() finishes. +/// You can only register one callback per unique value for @c key. +/// Returns true only if @c key has never been scheduled before. +/// It's possible to pass @c NULL for @c func if you only want to mark @c key as being used. +cpBool cpSpaceAddPostStepCallback(cpSpace *space, cpPostStepFunc func, void *key, void *data); + + +//MARK: Queries + +// TODO: Queries and iterators should take a cpSpace parametery. +// TODO: They should also be abortable. + +/// Nearest point query callback function type. +typedef void (*cpSpacePointQueryFunc)(cpShape *shape, cpVect point, cpFloat distance, cpVect gradient, void *data); +/// Query the space at a point and call @c func for each shape found. +void cpSpacePointQuery(cpSpace *space, cpVect point, cpFloat maxDistance, cpShapeFilter filter, cpSpacePointQueryFunc func, void *data); +/// Query the space at a point and return the nearest shape found. Returns NULL if no shapes were found. +cpShape *cpSpacePointQueryNearest(cpSpace *space, cpVect point, cpFloat maxDistance, cpShapeFilter filter, cpPointQueryInfo *out); + +/// Segment query callback function type. +typedef void (*cpSpaceSegmentQueryFunc)(cpShape *shape, cpVect point, cpVect normal, cpFloat alpha, void *data); +/// Perform a directed line segment query (like a raycast) against the space calling @c func for each shape intersected. +void cpSpaceSegmentQuery(cpSpace *space, cpVect start, cpVect end, cpFloat radius, cpShapeFilter filter, cpSpaceSegmentQueryFunc func, void *data); +/// Perform a directed line segment query (like a raycast) against the space and return the first shape hit. Returns NULL if no shapes were hit. +cpShape *cpSpaceSegmentQueryFirst(cpSpace *space, cpVect start, cpVect end, cpFloat radius, cpShapeFilter filter, cpSegmentQueryInfo *out); + +/// Rectangle Query callback function type. +typedef void (*cpSpaceBBQueryFunc)(cpShape *shape, void *data); +/// Perform a fast rectangle query on the space calling @c func for each shape found. +/// Only the shape's bounding boxes are checked for overlap, not their full shape. +void cpSpaceBBQuery(cpSpace *space, cpBB bb, cpShapeFilter filter, cpSpaceBBQueryFunc func, void *data); + +/// Shape query callback function type. +typedef void (*cpSpaceShapeQueryFunc)(cpShape *shape, cpContactPointSet *points, void *data); +/// Query a space for any shapes overlapping the given shape and call @c func for each shape found. +cpBool cpSpaceShapeQuery(cpSpace *space, cpShape *shape, cpSpaceShapeQueryFunc func, void *data); + + +//MARK: Iteration + +/// Space/body iterator callback function type. +typedef void (*cpSpaceBodyIteratorFunc)(cpBody *body, void *data); +/// Call @c func for each body in the space. +void cpSpaceEachBody(cpSpace *space, cpSpaceBodyIteratorFunc func, void *data); + +/// Space/body iterator callback function type. +typedef void (*cpSpaceShapeIteratorFunc)(cpShape *shape, void *data); +/// Call @c func for each shape in the space. +void cpSpaceEachShape(cpSpace *space, cpSpaceShapeIteratorFunc func, void *data); + +/// Space/constraint iterator callback function type. +typedef void (*cpSpaceConstraintIteratorFunc)(cpConstraint *constraint, void *data); +/// Call @c func for each shape in the space. +void cpSpaceEachConstraint(cpSpace *space, cpSpaceConstraintIteratorFunc func, void *data); + + +//MARK: Indexing + +/// Update the collision detection info for the static shapes in the space. +void cpSpaceReindexStatic(cpSpace *space); +/// Update the collision detection data for a specific shape in the space. +void cpSpaceReindexShape(cpSpace *space, cpShape *shape); +/// Update the collision detection data for all shapes attached to a body. +void cpSpaceReindexShapesForBody(cpSpace *space, cpBody *body); + +/// Switch the space to use a spatial has as it's spatial index. +void cpSpaceUseSpatialHash(cpSpace *space, cpFloat dim, int count); + + +//MARK: Time Stepping + +/// Step the space forward in time by @c dt. +void cpSpaceStep(cpSpace *space, cpFloat dt); + + +//MARK: Debug API + +#ifndef CP_SPACE_DISABLE_DEBUG_API + +typedef struct cpSpaceDebugColor { + float r, g, b, a; +} cpSpaceDebugColor; + +typedef void (*cpSpaceDebugDrawCircleImpl)(cpVect pos, cpFloat angle, cpFloat radius, cpSpaceDebugColor outlineColor, cpSpaceDebugColor fillColor, cpDataPointer *data); +typedef void (*cpSpaceDebugDrawSegmentImpl)(cpVect a, cpVect b, cpSpaceDebugColor color, cpDataPointer *data); +typedef void (*cpSpaceDebugDrawFatSegmentImpl)(cpVect a, cpVect b, cpFloat radius, cpSpaceDebugColor outlineColor, cpSpaceDebugColor fillColor, cpDataPointer *data); +typedef void (*cpSpaceDebugDrawPolygonImpl)(int count, const cpVect *verts, cpFloat radius, cpSpaceDebugColor outlineColor, cpSpaceDebugColor fillColor, cpDataPointer *data); +typedef void (*cpSpaceDebugDrawDotImpl)(cpFloat size, cpVect pos, cpSpaceDebugColor color, cpDataPointer *data); +typedef cpSpaceDebugColor (*cpSpaceDebugDrawColorForShapeImpl)(cpShape *shape, cpDataPointer *data); + +typedef enum cpSpaceDebugDrawFlags { + CP_SPACE_DEBUG_DRAW_SHAPES = 1<<0, + CP_SPACE_DEBUG_DRAW_CONSTRAINTS = 1<<1, + CP_SPACE_DEBUG_DRAW_COLLISION_POINTS = 1<<2, +} cpSpaceDebugDrawFlags; + +typedef struct cpSpaceDebugDrawOptions { + cpSpaceDebugDrawCircleImpl drawCircle; + cpSpaceDebugDrawSegmentImpl drawSegment; + cpSpaceDebugDrawFatSegmentImpl drawFatSegment; + cpSpaceDebugDrawPolygonImpl drawPolygon; + cpSpaceDebugDrawDotImpl drawDot; + + cpSpaceDebugDrawFlags flags; + cpSpaceDebugColor shapeOutlineColor; + cpSpaceDebugDrawColorForShapeImpl colorForShape; + cpSpaceDebugColor constraintColor; + cpSpaceDebugColor collisionPointColor; + + cpDataPointer data; +} cpSpaceDebugDrawOptions; + +void cpSpaceDebugDraw(cpSpace *space, cpSpaceDebugDrawOptions *options); + +#endif + +/// @} diff --git a/include/Chipmunk/chipmunk/cpSpatialIndex.h b/include/Chipmunk/chipmunk/cpSpatialIndex.h new file mode 100644 index 0000000..c279cad --- /dev/null +++ b/include/Chipmunk/chipmunk/cpSpatialIndex.h @@ -0,0 +1,227 @@ +/* Copyright (c) 2010 Scott Lembcke + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +/** + @defgroup cpSpatialIndex cpSpatialIndex + + Spatial indexes are data structures that are used to accelerate collision detection + and spatial queries. Chipmunk provides a number of spatial index algorithms to pick from + and they are programmed in a generic way so that you can use them for holding more than + just cpShape structs. + + It works by using @c void pointers to the objects you add and using a callback to ask your code + for bounding boxes when it needs them. Several types of queries can be performed an index as well + as reindexing and full collision information. All communication to the spatial indexes is performed + through callback functions. + + Spatial indexes should be treated as opaque structs. + This meanns you shouldn't be reading any of the struct fields. + @{ +*/ + +//MARK: Spatial Index + +/// Spatial index bounding box callback function type. +/// The spatial index calls this function and passes you a pointer to an object you added +/// when it needs to get the bounding box associated with that object. +typedef cpBB (*cpSpatialIndexBBFunc)(void *obj); +/// Spatial index/object iterator callback function type. +typedef void (*cpSpatialIndexIteratorFunc)(void *obj, void *data); +/// Spatial query callback function type. +typedef cpCollisionID (*cpSpatialIndexQueryFunc)(void *obj1, void *obj2, cpCollisionID id, void *data); +/// Spatial segment query callback function type. +typedef cpFloat (*cpSpatialIndexSegmentQueryFunc)(void *obj1, void *obj2, void *data); + + +typedef struct cpSpatialIndexClass cpSpatialIndexClass; +typedef struct cpSpatialIndex cpSpatialIndex; + +/// @private +struct cpSpatialIndex { + cpSpatialIndexClass *klass; + + cpSpatialIndexBBFunc bbfunc; + + cpSpatialIndex *staticIndex, *dynamicIndex; +}; + + +//MARK: Spatial Hash + +typedef struct cpSpaceHash cpSpaceHash; + +/// Allocate a spatial hash. +cpSpaceHash* cpSpaceHashAlloc(void); +/// Initialize a spatial hash. +cpSpatialIndex* cpSpaceHashInit(cpSpaceHash *hash, cpFloat celldim, int numcells, cpSpatialIndexBBFunc bbfunc, cpSpatialIndex *staticIndex); +/// Allocate and initialize a spatial hash. +cpSpatialIndex* cpSpaceHashNew(cpFloat celldim, int cells, cpSpatialIndexBBFunc bbfunc, cpSpatialIndex *staticIndex); + +/// Change the cell dimensions and table size of the spatial hash to tune it. +/// The cell dimensions should roughly match the average size of your objects +/// and the table size should be ~10 larger than the number of objects inserted. +/// Some trial and error is required to find the optimum numbers for efficiency. +void cpSpaceHashResize(cpSpaceHash *hash, cpFloat celldim, int numcells); + +//MARK: AABB Tree + +typedef struct cpBBTree cpBBTree; + +/// Allocate a bounding box tree. +cpBBTree* cpBBTreeAlloc(void); +/// Initialize a bounding box tree. +cpSpatialIndex* cpBBTreeInit(cpBBTree *tree, cpSpatialIndexBBFunc bbfunc, cpSpatialIndex *staticIndex); +/// Allocate and initialize a bounding box tree. +cpSpatialIndex* cpBBTreeNew(cpSpatialIndexBBFunc bbfunc, cpSpatialIndex *staticIndex); + +/// Perform a static top down optimization of the tree. +void cpBBTreeOptimize(cpSpatialIndex *index); + +/// Bounding box tree velocity callback function. +/// This function should return an estimate for the object's velocity. +typedef cpVect (*cpBBTreeVelocityFunc)(void *obj); +/// Set the velocity function for the bounding box tree to enable temporal coherence. +void cpBBTreeSetVelocityFunc(cpSpatialIndex *index, cpBBTreeVelocityFunc func); + +//MARK: Single Axis Sweep + +typedef struct cpSweep1D cpSweep1D; + +/// Allocate a 1D sort and sweep broadphase. +cpSweep1D* cpSweep1DAlloc(void); +/// Initialize a 1D sort and sweep broadphase. +cpSpatialIndex* cpSweep1DInit(cpSweep1D *sweep, cpSpatialIndexBBFunc bbfunc, cpSpatialIndex *staticIndex); +/// Allocate and initialize a 1D sort and sweep broadphase. +cpSpatialIndex* cpSweep1DNew(cpSpatialIndexBBFunc bbfunc, cpSpatialIndex *staticIndex); + +//MARK: Spatial Index Implementation + +typedef void (*cpSpatialIndexDestroyImpl)(cpSpatialIndex *index); + +typedef int (*cpSpatialIndexCountImpl)(cpSpatialIndex *index); +typedef void (*cpSpatialIndexEachImpl)(cpSpatialIndex *index, cpSpatialIndexIteratorFunc func, void *data); + +typedef cpBool (*cpSpatialIndexContainsImpl)(cpSpatialIndex *index, void *obj, cpHashValue hashid); +typedef void (*cpSpatialIndexInsertImpl)(cpSpatialIndex *index, void *obj, cpHashValue hashid); +typedef void (*cpSpatialIndexRemoveImpl)(cpSpatialIndex *index, void *obj, cpHashValue hashid); + +typedef void (*cpSpatialIndexReindexImpl)(cpSpatialIndex *index); +typedef void (*cpSpatialIndexReindexObjectImpl)(cpSpatialIndex *index, void *obj, cpHashValue hashid); +typedef void (*cpSpatialIndexReindexQueryImpl)(cpSpatialIndex *index, cpSpatialIndexQueryFunc func, void *data); + +typedef void (*cpSpatialIndexQueryImpl)(cpSpatialIndex *index, void *obj, cpBB bb, cpSpatialIndexQueryFunc func, void *data); +typedef void (*cpSpatialIndexSegmentQueryImpl)(cpSpatialIndex *index, void *obj, cpVect a, cpVect b, cpFloat t_exit, cpSpatialIndexSegmentQueryFunc func, void *data); + +struct cpSpatialIndexClass { + cpSpatialIndexDestroyImpl destroy; + + cpSpatialIndexCountImpl count; + cpSpatialIndexEachImpl each; + + cpSpatialIndexContainsImpl contains; + cpSpatialIndexInsertImpl insert; + cpSpatialIndexRemoveImpl remove; + + cpSpatialIndexReindexImpl reindex; + cpSpatialIndexReindexObjectImpl reindexObject; + cpSpatialIndexReindexQueryImpl reindexQuery; + + cpSpatialIndexQueryImpl query; + cpSpatialIndexSegmentQueryImpl segmentQuery; +}; + +/// Destroy and free a spatial index. +void cpSpatialIndexFree(cpSpatialIndex *index); +/// Collide the objects in @c dynamicIndex against the objects in @c staticIndex using the query callback function. +void cpSpatialIndexCollideStatic(cpSpatialIndex *dynamicIndex, cpSpatialIndex *staticIndex, cpSpatialIndexQueryFunc func, void *data); + +/// Destroy a spatial index. +static inline void cpSpatialIndexDestroy(cpSpatialIndex *index) +{ + if(index->klass) index->klass->destroy(index); +} + +/// Get the number of objects in the spatial index. +static inline int cpSpatialIndexCount(cpSpatialIndex *index) +{ + return index->klass->count(index); +} + +/// Iterate the objects in the spatial index. @c func will be called once for each object. +static inline void cpSpatialIndexEach(cpSpatialIndex *index, cpSpatialIndexIteratorFunc func, void *data) +{ + index->klass->each(index, func, data); +} + +/// Returns true if the spatial index contains the given object. +/// Most spatial indexes use hashed storage, so you must provide a hash value too. +static inline cpBool cpSpatialIndexContains(cpSpatialIndex *index, void *obj, cpHashValue hashid) +{ + return index->klass->contains(index, obj, hashid); +} + +/// Add an object to a spatial index. +/// Most spatial indexes use hashed storage, so you must provide a hash value too. +static inline void cpSpatialIndexInsert(cpSpatialIndex *index, void *obj, cpHashValue hashid) +{ + index->klass->insert(index, obj, hashid); +} + +/// Remove an object from a spatial index. +/// Most spatial indexes use hashed storage, so you must provide a hash value too. +static inline void cpSpatialIndexRemove(cpSpatialIndex *index, void *obj, cpHashValue hashid) +{ + index->klass->remove(index, obj, hashid); +} + +/// Perform a full reindex of a spatial index. +static inline void cpSpatialIndexReindex(cpSpatialIndex *index) +{ + index->klass->reindex(index); +} + +/// Reindex a single object in the spatial index. +static inline void cpSpatialIndexReindexObject(cpSpatialIndex *index, void *obj, cpHashValue hashid) +{ + index->klass->reindexObject(index, obj, hashid); +} + +/// Perform a rectangle query against the spatial index, calling @c func for each potential match. +static inline void cpSpatialIndexQuery(cpSpatialIndex *index, void *obj, cpBB bb, cpSpatialIndexQueryFunc func, void *data) +{ + index->klass->query(index, obj, bb, func, data); +} + +/// Perform a segment query against the spatial index, calling @c func for each potential match. +static inline void cpSpatialIndexSegmentQuery(cpSpatialIndex *index, void *obj, cpVect a, cpVect b, cpFloat t_exit, cpSpatialIndexSegmentQueryFunc func, void *data) +{ + index->klass->segmentQuery(index, obj, a, b, t_exit, func, data); +} + +/// Simultaneously reindex and find all colliding objects. +/// @c func will be called once for each potentially overlapping pair of objects found. +/// If the spatial index was initialized with a static index, it will collide it's objects against that as well. +static inline void cpSpatialIndexReindexQuery(cpSpatialIndex *index, cpSpatialIndexQueryFunc func, void *data) +{ + index->klass->reindexQuery(index, func, data); +} + +///@} diff --git a/include/Chipmunk/chipmunk/cpTransform.h b/include/Chipmunk/chipmunk/cpTransform.h new file mode 100644 index 0000000..308cce1 --- /dev/null +++ b/include/Chipmunk/chipmunk/cpTransform.h @@ -0,0 +1,197 @@ +/* Copyright (c) 2012 Scott Lembcke and Howling Moon Software + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +#ifndef CHIPMUNK_TRANSFORM_H +#define CHIPMUNK_TRANSFORM_H + +#include "chipmunk_types.h" +#include "cpVect.h" +#include "cpBB.h" + +/// Identity transform matrix. +static const cpTransform cpTransformIdentity = {1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f}; + +/// Construct a new transform matrix. +/// (a, b) is the x basis vector. +/// (c, d) is the y basis vector. +/// (tx, ty) is the translation. +static inline cpTransform +cpTransformNew(cpFloat a, cpFloat b, cpFloat c, cpFloat d, cpFloat tx, cpFloat ty) +{ + cpTransform t = {a, b, c, d, tx, ty}; + return t; +} + +/// Construct a new transform matrix in transposed order. +static inline cpTransform +cpTransformNewTranspose(cpFloat a, cpFloat c, cpFloat tx, cpFloat b, cpFloat d, cpFloat ty) +{ + cpTransform t = {a, b, c, d, tx, ty}; + return t; +} + +/// Get the inverse of a transform matrix. +static inline cpTransform +cpTransformInverse(cpTransform t) +{ + float inv_det = 1.0/(t.a*t.d - t.c*t.b); + return cpTransformNewTranspose( + t.d*inv_det, -t.c*inv_det, (t.c*t.ty - t.tx*t.d)*inv_det, + -t.b*inv_det, t.a*inv_det, (t.tx*t.b - t.a*t.ty)*inv_det + ); +} + +/// Multiply two transformation matrices. +static inline cpTransform +cpTransformMult(cpTransform t1, cpTransform t2) +{ + return cpTransformNewTranspose( + t1.a*t2.a + t1.c*t2.b, t1.a*t2.c + t1.c*t2.d, t1.a*t2.tx + t1.c*t2.ty + t1.tx, + t1.b*t2.a + t1.d*t2.b, t1.b*t2.c + t1.d*t2.d, t1.b*t2.tx + t1.d*t2.ty + t1.ty + ); +} + +/// Transform an absolute point. (i.e. a vertex) +static inline cpVect +cpTransformPoint(cpTransform t, cpVect p) +{ + return cpv(t.a*p.x + t.c*p.y + t.tx, t.b*p.x + t.d*p.y + t.ty); +} + +/// Transform a vector (i.e. a normal) +static inline cpVect +cpTransformVect(cpTransform t, cpVect v) +{ + return cpv(t.a*v.x + t.c*v.y, t.b*v.x + t.d*v.y); +} + +/// Transform a cpBB. +static inline cpBB +cpTransformbBB(cpTransform t, cpBB bb) +{ + cpVect center = cpBBCenter(bb); + cpFloat hw = (bb.r - bb.l)*0.5; + cpFloat hh = (bb.t - bb.b)*0.5; + + cpFloat a = t.a*hw, b = t.c*hh, d = t.b*hw, e = t.d*hh; + cpFloat hw_max = cpfmax(cpfabs(a + b), cpfabs(a - b)); + cpFloat hh_max = cpfmax(cpfabs(d + e), cpfabs(d - e)); + return cpBBNewForExtents(cpTransformPoint(t, center), hw_max, hh_max); +} + +/// Create a transation matrix. +static inline cpTransform +cpTransformTranslate(cpVect translate) +{ + return cpTransformNewTranspose( + 1.0, 0.0, translate.x, + 0.0, 1.0, translate.y + ); +} + +/// Create a scale matrix. +static inline cpTransform +cpTransformScale(cpFloat scaleX, cpFloat scaleY) +{ + return cpTransformNewTranspose( + scaleX, 0.0, 0.0, + 0.0, scaleY, 0.0 + ); +} + +/// Create a rotation matrix. +static inline cpTransform +cpTransformRotate(cpFloat radians) +{ + cpVect rot = cpvforangle(radians); + return cpTransformNewTranspose( + rot.x, -rot.y, 0.0, + rot.y, rot.x, 0.0 + ); +} + +/// Create a rigid transformation matrix. (transation + rotation) +static inline cpTransform +cpTransformRigid(cpVect translate, cpFloat radians) +{ + cpVect rot = cpvforangle(radians); + return cpTransformNewTranspose( + rot.x, -rot.y, translate.x, + rot.y, rot.x, translate.y + ); +} + +/// Fast inverse of a rigid transformation matrix. +static inline cpTransform +cpTransformRigidInverse(cpTransform t) +{ + return cpTransformNewTranspose( + t.d, -t.c, (t.c*t.ty - t.tx*t.d), + -t.b, t.a, (t.tx*t.b - t.a*t.ty) + ); +} + +// Miscelaneous (but useful) transformation matrices. + +static inline cpTransform +cpTransformWrap(cpTransform outer, cpTransform inner) +{ + return cpTransformMult(cpTransformInverse(outer), cpTransformMult(inner, outer)); +} + +static inline cpTransform +cpTransformWrapInverse(cpTransform outer, cpTransform inner) +{ + return cpTransformMult(outer, cpTransformMult(inner, cpTransformInverse(outer))); +} + +static inline cpTransform +cpTransformOrtho(cpBB bb) +{ + return cpTransformNewTranspose( + 2.0/(bb.r - bb.l), 0.0, -(bb.r + bb.l)/(bb.r - bb.l), + 0.0, 2.0/(bb.t - bb.b), -(bb.t + bb.b)/(bb.t - bb.b) + ); +} + +static inline cpTransform +cpTransformBoneScale(cpVect v0, cpVect v1) +{ + cpVect d = cpvsub(v1, v0); + return cpTransformNewTranspose( + d.x, -d.y, v0.x, + d.y, d.x, v0.y + ); +} + +static inline cpTransform +cpTransformAxialScale(cpVect axis, cpVect pivot, float scale) +{ + cpFloat A = axis.x*axis.y*(scale - 1.0); + cpFloat B = cpvdot(axis, pivot)*(1.0 - scale); + + return cpTransformNewTranspose( + scale*axis.x*axis.x + axis.y*axis.y, A, axis.x*B, + A, axis.x*axis.x + scale*axis.y*axis.y, axis.y*B + ); +} + +#endif diff --git a/include/Chipmunk/chipmunk/cpVect.h b/include/Chipmunk/chipmunk/cpVect.h new file mode 100644 index 0000000..c0f24e6 --- /dev/null +++ b/include/Chipmunk/chipmunk/cpVect.h @@ -0,0 +1,230 @@ +/* Copyright (c) 2007 Scott Lembcke + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +#ifndef CHIPMUNK_VECT_H +#define CHIPMUNK_VECT_H + +#include "chipmunk_types.h" + +/// @defgroup cpVect cpVect +/// Chipmunk's 2D vector type along with a handy 2D vector math lib. +/// @{ + +/// Constant for the zero vector. +static const cpVect cpvzero = {0.0f,0.0f}; + +/// Convenience constructor for cpVect structs. +static inline cpVect cpv(const cpFloat x, const cpFloat y) +{ + cpVect v = {x, y}; + return v; +} + +/// Check if two vectors are equal. (Be careful when comparing floating point numbers!) +static inline cpBool cpveql(const cpVect v1, const cpVect v2) +{ + return (v1.x == v2.x && v1.y == v2.y); +} + +/// Add two vectors +static inline cpVect cpvadd(const cpVect v1, const cpVect v2) +{ + return cpv(v1.x + v2.x, v1.y + v2.y); +} + +/// Subtract two vectors. +static inline cpVect cpvsub(const cpVect v1, const cpVect v2) +{ + return cpv(v1.x - v2.x, v1.y - v2.y); +} + +/// Negate a vector. +static inline cpVect cpvneg(const cpVect v) +{ + return cpv(-v.x, -v.y); +} + +/// Scalar multiplication. +static inline cpVect cpvmult(const cpVect v, const cpFloat s) +{ + return cpv(v.x*s, v.y*s); +} + +/// Vector dot product. +static inline cpFloat cpvdot(const cpVect v1, const cpVect v2) +{ + return v1.x*v2.x + v1.y*v2.y; +} + +/// 2D vector cross product analog. +/// The cross product of 2D vectors results in a 3D vector with only a z component. +/// This function returns the magnitude of the z value. +static inline cpFloat cpvcross(const cpVect v1, const cpVect v2) +{ + return v1.x*v2.y - v1.y*v2.x; +} + +/// Returns a perpendicular vector. (90 degree rotation) +static inline cpVect cpvperp(const cpVect v) +{ + return cpv(-v.y, v.x); +} + +/// Returns a perpendicular vector. (-90 degree rotation) +static inline cpVect cpvrperp(const cpVect v) +{ + return cpv(v.y, -v.x); +} + +/// Returns the vector projection of v1 onto v2. +static inline cpVect cpvproject(const cpVect v1, const cpVect v2) +{ + return cpvmult(v2, cpvdot(v1, v2)/cpvdot(v2, v2)); +} + +/// Returns the unit length vector for the given angle (in radians). +static inline cpVect cpvforangle(const cpFloat a) +{ + return cpv(cpfcos(a), cpfsin(a)); +} + +/// Returns the angular direction v is pointing in (in radians). +static inline cpFloat cpvtoangle(const cpVect v) +{ + return cpfatan2(v.y, v.x); +} + +/// Uses complex number multiplication to rotate v1 by v2. Scaling will occur if v1 is not a unit vector. +static inline cpVect cpvrotate(const cpVect v1, const cpVect v2) +{ + return cpv(v1.x*v2.x - v1.y*v2.y, v1.x*v2.y + v1.y*v2.x); +} + +/// Inverse of cpvrotate(). +static inline cpVect cpvunrotate(const cpVect v1, const cpVect v2) +{ + return cpv(v1.x*v2.x + v1.y*v2.y, v1.y*v2.x - v1.x*v2.y); +} + +/// Returns the squared length of v. Faster than cpvlength() when you only need to compare lengths. +static inline cpFloat cpvlengthsq(const cpVect v) +{ + return cpvdot(v, v); +} + +/// Returns the length of v. +static inline cpFloat cpvlength(const cpVect v) +{ + return cpfsqrt(cpvdot(v, v)); +} + +/// Linearly interpolate between v1 and v2. +static inline cpVect cpvlerp(const cpVect v1, const cpVect v2, const cpFloat t) +{ + return cpvadd(cpvmult(v1, 1.0f - t), cpvmult(v2, t)); +} + +/// Returns a normalized copy of v. +static inline cpVect cpvnormalize(const cpVect v) +{ + // Neat trick I saw somewhere to avoid div/0. + return cpvmult(v, 1.0f/(cpvlength(v) + CPFLOAT_MIN)); +} + +/// Spherical linearly interpolate between v1 and v2. +static inline cpVect +cpvslerp(const cpVect v1, const cpVect v2, const cpFloat t) +{ + cpFloat dot = cpvdot(cpvnormalize(v1), cpvnormalize(v2)); + cpFloat omega = cpfacos(cpfclamp(dot, -1.0f, 1.0f)); + + if(omega < 1e-3){ + // If the angle between two vectors is very small, lerp instead to avoid precision issues. + return cpvlerp(v1, v2, t); + } else { + cpFloat denom = 1.0f/cpfsin(omega); + return cpvadd(cpvmult(v1, cpfsin((1.0f - t)*omega)*denom), cpvmult(v2, cpfsin(t*omega)*denom)); + } +} + +/// Spherical linearly interpolate between v1 towards v2 by no more than angle a radians +static inline cpVect +cpvslerpconst(const cpVect v1, const cpVect v2, const cpFloat a) +{ + cpFloat dot = cpvdot(cpvnormalize(v1), cpvnormalize(v2)); + cpFloat omega = cpfacos(cpfclamp(dot, -1.0f, 1.0f)); + + return cpvslerp(v1, v2, cpfmin(a, omega)/omega); +} + +/// Clamp v to length len. +static inline cpVect cpvclamp(const cpVect v, const cpFloat len) +{ + return (cpvdot(v,v) > len*len) ? cpvmult(cpvnormalize(v), len) : v; +} + +/// Linearly interpolate between v1 towards v2 by distance d. +static inline cpVect cpvlerpconst(cpVect v1, cpVect v2, cpFloat d) +{ + return cpvadd(v1, cpvclamp(cpvsub(v2, v1), d)); +} + +/// Returns the distance between v1 and v2. +static inline cpFloat cpvdist(const cpVect v1, const cpVect v2) +{ + return cpvlength(cpvsub(v1, v2)); +} + +/// Returns the squared distance between v1 and v2. Faster than cpvdist() when you only need to compare distances. +static inline cpFloat cpvdistsq(const cpVect v1, const cpVect v2) +{ + return cpvlengthsq(cpvsub(v1, v2)); +} + +/// Returns true if the distance between v1 and v2 is less than dist. +static inline cpBool cpvnear(const cpVect v1, const cpVect v2, const cpFloat dist) +{ + return cpvdistsq(v1, v2) < dist*dist; +} + +/// @} + +/// @defgroup cpMat2x2 cpMat2x2 +/// 2x2 matrix type used for tensors and such. +/// @{ + +// NUKE +static inline cpMat2x2 +cpMat2x2New(cpFloat a, cpFloat b, cpFloat c, cpFloat d) +{ + cpMat2x2 m = {a, b, c, d}; + return m; +} + +static inline cpVect +cpMat2x2Transform(cpMat2x2 m, cpVect v) +{ + return cpv(v.x*m.a + v.y*m.b, v.x*m.c + v.y*m.d); +} + +///@} + +#endif diff --git a/include/CocosDenshion/CDXMacOSXSupport.h b/include/CocosDenshion/CDXMacOSXSupport.h new file mode 100644 index 0000000..c1a99f0 --- /dev/null +++ b/include/CocosDenshion/CDXMacOSXSupport.h @@ -0,0 +1,232 @@ +/* + Copyright (c) 2010 Steve Oldmeadow + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + + $Id$ + */ + +/** + A set of proxy classes to allow iOS audio code to run on MacOS X. AVAudioPlayer is implemented using NSSound. + AVAudioSession is a "do nothing" class as it isn't really relevant on MacOS X. + + Limitations: + AVAudioPlayer numberOfLoops not correctly supported. Looping is either on or off, can not specify a specific number of loops. + AVAudioPlayer panning not supported. + AVAudioPlayer metering not supported. + AVAudioSession nothing is supported, not applicable to MacOS X. + */ + +#import +#ifdef __IPHONE_OS_VERSION_MAX_ALLOWED +#elif defined(__MAC_OS_X_VERSION_MAX_ALLOWED) + +#import +#import + +enum AudioSessionProperties { + kAudioSessionProperty_OtherAudioIsPlaying, + kAudioSessionProperty_AudioRoute +}; + +extern OSStatus AudioSessionGetProperty(UInt32 inID, UInt32 *ioDataSize, void *outData); + +/** + Based on AVAudioPlayer.h header in AVFoundation headers + */ +@class NSData, NSURL, NSError, NSDictionary; +@protocol AVAudioPlayerDelegate; + +/* This class is available with iPhone 2.2 or later */ +@interface AVAudioPlayer : NSObject { + + // properties + id delegate; + NSUInteger numberOfChannels; + BOOL playing; + NSTimeInterval duration; + NSURL *url; + NSData *data; + float pan; + float volume; + NSTimeInterval currentTime; + NSTimeInterval deviceCurrentTime; + NSInteger numberOfLoops; + BOOL meteringEnabled; + + +@private + NSSound* _player; +} + +/* For all of these init calls, if a return value of nil is given you can check outError to see what the problem was. + If not nil, then the object is usable for playing + */ + +/* all data must be in the form of an audio file understood by CoreAudio */ +- (id)initWithContentsOfURL:(NSURL *)theUrl error:(NSError **)outError; +- (id)initWithData:(NSData *)theData error:(NSError **)outError; + +/* transport control */ +/* methods that return BOOL return YES on success and NO on failure. */ +- (BOOL)prepareToPlay; /* get ready to play the sound. happens automatically on play. */ +- (BOOL)play; /* sound is played asynchronously. */ +- (BOOL)playAtTime:(NSTimeInterval) time; /* play a sound some time in the future. time should be greater than deviceCurrentTime. */ +- (void)pause; /* pauses playback, but remains ready to play. */ +- (void)stop; /* stops playback. no longer ready to play. */ + +/* properties */ + +@property(readonly, getter=isPlaying) BOOL playing; + +@property(readonly) NSUInteger numberOfChannels; +@property(readonly) NSTimeInterval duration; /* the duration of the sound. */ + +@property(assign) id delegate; /* the delegate will be sent playerDidFinishPlaying */ + +/* one of these three properties will be non-nil based on the init... method used */ +@property(readonly) NSURL *url; /* returns nil if object was not created with a URL */ +@property(readonly) NSData *data; /* returns nil if object was not created with a data object */ +@property float pan; /* set panning. -1.0 is left, 0.0 is center, 1.0 is right. */ +@property float volume; /* The volume for the sound. The nominal range is from 0.0 to 1.0. */ + +/* If the sound is playing, currentTime is the offset into the sound of the current playback position. + If the sound is not playing, currentTime is the offset into the sound where playing would start. */ +@property NSTimeInterval currentTime; + +/* returns the current time associated with the output device */ +@property(readonly) NSTimeInterval deviceCurrentTime; + +/* "numberOfLoops" is the number of times that the sound will return to the beginning upon reaching the end. + A value of zero means to play the sound just once. + A value of one will result in playing the sound twice, and so on.. + Any negative number will loop indefinitely until stopped. + */ +@property NSInteger numberOfLoops; + +/* metering */ + +@property(getter=isMeteringEnabled) BOOL meteringEnabled; /* turns level metering on or off. default is off. */ + +- (void)updateMeters; /* call to refresh meter values */ +- (float)peakPowerForChannel:(NSUInteger)channelNumber; /* returns peak power in decibels for a given channel */ +- (float)averagePowerForChannel:(NSUInteger)channelNumber; /* returns average power in decibels for a given channel */ + +@end + +/* A protocol for delegates of AVAudioPlayer */ +@protocol AVAudioPlayerDelegate +@optional +/* audioPlayerDidFinishPlaying:successfully: is called when a sound has finished playing. This method is NOT called if the player is stopped due to an interruption. */ +- (void)audioPlayerDidFinishPlaying:(AVAudioPlayer *)player successfully:(BOOL)flag; + +/* if an error occurs while decoding it will be reported to the delegate. */ +- (void)audioPlayerDecodeErrorDidOccur:(AVAudioPlayer *)player error:(NSError *)error; + +/* audioPlayerBeginInterruption: is called when the audio session has been interrupted while the player was playing. The player will have been paused. */ +- (void)audioPlayerBeginInterruption:(AVAudioPlayer *)player; + +/* audioPlayerEndInterruption:withFlags: is called when the audio session interruption has ended and this player had been interrupted while playing. */ +/* Currently the only flag is AVAudioSessionInterruptionFlags_ShouldResume. */ +- (void)audioPlayerEndInterruption:(AVAudioPlayer *)player withFlags:(NSUInteger)flags; + +/* audioPlayerEndInterruption: is called when the preferred method, audioPlayerEndInterruption:withFlags:, is not implemented. */ +- (void)audioPlayerEndInterruption:(AVAudioPlayer *)player; +@end + + +/** + Taken from AVAudioSession.h header in AVFoundation headers + */ + +/* This protocol is available with iPhone 3.0 or later */ +@protocol AVAudioSessionDelegate; +@class NSError, NSString; + +/* values for the category property */ +extern NSString *const AVAudioSessionCategoryAmbient; +extern NSString *const AVAudioSessionCategorySoloAmbient; +extern NSString *const AVAudioSessionCategoryPlayback; +extern NSString *const AVAudioSessionCategoryRecord; +extern NSString *const AVAudioSessionCategoryPlayAndRecord; +extern NSString *const AVAudioSessionCategoryAudioProcessing; + +enum { + AVAudioSessionInterruptionFlags_ShouldResume = 1 +}; + +enum { + AVAudioSessionSetActiveFlags_NotifyOthersOnDeactivation = 1 +}; + +@interface AVAudioSession : NSObject { + + // properties + NSString* category; + double preferredHardwareSampleRate; + NSTimeInterval preferredIOBufferDuration; + + BOOL inputIsAvailable; + double currentHardwareSampleRate; + NSInteger currentHardwareInputNumberOfChannels; + NSInteger currentHardwareOutputNumberOfChannels; + id delegate; + +@private + __strong void *_impl; +} + +/* returns singleton instance */ ++ (id)sharedInstance; + +@property(assign) id delegate; + +- (BOOL)setActive:(BOOL)beActive error:(NSError**)outError; +- (BOOL)setActive:(BOOL)beActive withFlags:(NSInteger)flags error:(NSError**)outError; + +- (BOOL)setCategory:(NSString*)theCategory error:(NSError**)outError; +- (BOOL)setPreferredHardwareSampleRate:(double)sampleRate error:(NSError**)outError; +- (BOOL)setPreferredIOBufferDuration:(NSTimeInterval)duration error:(NSError**)outError; + +@property(readonly) NSString* category; +@property(readonly) double preferredHardwareSampleRate; +@property(readonly) NSTimeInterval preferredIOBufferDuration; + +@property(readonly) BOOL inputIsAvailable; +@property(readonly) double currentHardwareSampleRate; +@property(readonly) NSInteger currentHardwareInputNumberOfChannels; +@property(readonly) NSInteger currentHardwareOutputNumberOfChannels; + +@end + + +/* A protocol for delegates of AVAudioSession */ +@protocol AVAudioSessionDelegate +@optional + +- (void)beginInterruption; + +- (void)endInterruptionWithFlags:(NSUInteger)flags; + +- (void)endInterruption; /* endInterruptionWithFlags: will be called instead if implemented. */ + +- (void)inputIsAvailableChanged:(BOOL)isInputAvailable; +@end + +#endif diff --git a/include/CocosDenshion/CDXPropertyModifierAction.h b/include/CocosDenshion/CDXPropertyModifierAction.h new file mode 100644 index 0000000..efecf1e --- /dev/null +++ b/include/CocosDenshion/CDXPropertyModifierAction.h @@ -0,0 +1,45 @@ +/* + Copyright (c) 2010 Steve Oldmeadow + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + + $Id$ + */ + +#import "cocos2d.h" +#import "SimpleAudioEngine.h" + +/** Base class for actions that modify audio properties + @since v 1.0 + */ +@interface CDXPropertyModifierAction : CCActionInterval { + CDPropertyModifier *modifier; + float lastSetValue; +} +/** creates the action */ ++(id) actionWithDuration:(ccTime)t modifier:(CDPropertyModifier*) aModifier; + +/** initializes the action */ +-(id) initWithDuration:(ccTime)t modifier:(CDPropertyModifier*) aModifier; + ++(void) fadeSoundEffects:(ccTime)t finalVolume:(float)endVol curveType:(tCDInterpolationType)curve shouldStop:(BOOL) stop; ++(void) fadeSoundEffect:(ccTime)t finalVolume:(float)endVol curveType:(tCDInterpolationType)curve shouldStop:(BOOL) stop effect:(CDSoundSource*) effect; ++(void) fadeBackgroundMusic:(ccTime)t finalVolume:(float)endVol curveType:(tCDInterpolationType) curve shouldStop:(BOOL) stop; + +@end diff --git a/include/CocosDenshion/CocosDenshion.h b/include/CocosDenshion/CocosDenshion.h index 4566c7c..47400f7 100644 --- a/include/CocosDenshion/CocosDenshion.h +++ b/include/CocosDenshion/CocosDenshion.h @@ -1,440 +1,13 @@ -/* - Copyright (c) 2010 Steve Oldmeadow +// +// CocosDenshion.h +// CocosDenshion +// +// Created by Goffredo Marocchi on 10/20/13. +// +// - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - - $Id$ - */ - - - -/** -@file -@b IMPORTANT -There are 3 different ways of using CocosDenshion. Depending on which you choose you -will need to include different files and frameworks. - -@par SimpleAudioEngine -This is recommended for basic audio requirements. If you just want to play some sound fx -and some background music and have no interest in learning the lower level workings then -this is the interface to use. - -Requirements: - - Firmware: OS 2.2 or greater - - Files: SimpleAudioEngine.*, CocosDenshion.* - - Frameworks: OpenAL, AudioToolbox, AVFoundation - -@par CDAudioManager -CDAudioManager is basically a thin wrapper around an AVAudioPlayer object used for playing -background music and a CDSoundEngine object used for playing sound effects. It manages the -audio session for you deals with audio session interruption. It is fairly low level and it -is expected you have some understanding of the underlying technologies. For example, for -many use cases regarding background music it is expected you will work directly with the -backgroundMusic AVAudioPlayer which is exposed as a property. - -Requirements: - - Firmware: OS 2.2 or greater - - Files: CDAudioManager.*, CocosDenshion.* - - Frameworks: OpenAL, AudioToolbox, AVFoundation - -@par CDSoundEngine -CDSoundEngine is a sound engine built upon OpenAL and derived from Apple's oalTouch -example. It can playback up to 32 sounds simultaneously with control over pitch, pan -and gain. It can be set up to handle audio session interruption automatically. You -may decide to use CDSoundEngine directly instead of CDAudioManager or SimpleAudioEngine -because you require OS 2.0 compatibility. - -Requirements: - - Firmware: OS 2.0 or greater - - Files: CocosDenshion.* - - Frameworks: OpenAL, AudioToolbox - -*/ - -#import -#import -#import #import -#import "CDConfig.h" - - -#if !defined(CD_DEBUG) || CD_DEBUG == 0 -#define CDLOG(...) do {} while (0) -#define CDLOGINFO(...) do {} while (0) - -#elif CD_DEBUG == 1 -#define CDLOG(...) NSLog(__VA_ARGS__) -#define CDLOGINFO(...) do {} while (0) - -#elif CD_DEBUG > 1 -#define CDLOG(...) NSLog(__VA_ARGS__) -#define CDLOGINFO(...) NSLog(__VA_ARGS__) -#endif // CD_DEBUG - - -#import "CDOpenALSupport.h" - -//Tested source limit on 2.2.1 and 3.1.2 with up to 128 sources and appears to work. Older OS versions e.g 2.2 may support only 32 -#define CD_SOURCE_LIMIT 32 //Total number of sources we will ever want, may actually get less -#define CD_NO_SOURCE 0xFEEDFAC //Return value indicating playback failed i.e. no source -#define CD_IGNORE_AUDIO_SESSION 0xBEEFBEE //Used internally to indicate audio session will not be handled -#define CD_MUTE 0xFEEDBAB //Return value indicating sound engine is muted or non functioning -#define CD_NO_SOUND = -1; - -#define CD_SAMPLE_RATE_HIGH 44100 -#define CD_SAMPLE_RATE_MID 22050 -#define CD_SAMPLE_RATE_LOW 16000 -#define CD_SAMPLE_RATE_BASIC 8000 -#define CD_SAMPLE_RATE_DEFAULT 44100 - -extern NSString * const kCDN_BadAlContext; -extern NSString * const kCDN_AsynchLoadComplete; - -extern float const kCD_PitchDefault; -extern float const kCD_PitchLowerOneOctave; -extern float const kCD_PitchHigherOneOctave; -extern float const kCD_PanDefault; -extern float const kCD_PanFullLeft; -extern float const kCD_PanFullRight; -extern float const kCD_GainDefault; - -enum bufferState { - CD_BS_EMPTY = 0, - CD_BS_LOADED = 1, - CD_BS_FAILED = 2 -}; - -typedef struct _sourceGroup { - int startIndex; - int currentIndex; - int totalSources; - bool enabled; - bool nonInterruptible; - int *sourceStatuses;//pointer into array of source status information -} sourceGroup; - -typedef struct _bufferInfo { - ALuint bufferId; - int bufferState; - void* bufferData; - ALenum format; - ALsizei sizeInBytes; - ALsizei frequencyInHertz; -} bufferInfo; - -typedef struct _sourceInfo { - bool usable; - ALuint sourceId; - ALuint attachedBufferId; -} sourceInfo; - -#pragma mark CDAudioTransportProtocol - -@protocol CDAudioTransportProtocol -/** Play the audio */ --(BOOL) play; -/** Pause the audio, retain resources */ --(BOOL) pause; -/** Stop the audio, release resources */ --(BOOL) stop; -/** Return playback to beginning */ --(BOOL) rewind; -@end - -#pragma mark CDAudioInterruptProtocol - -@protocol CDAudioInterruptProtocol -/** Is audio mute */ --(BOOL) mute; -/** If YES then audio is silenced but not stopped, calls to start new audio will proceed but silently */ --(void) setMute:(BOOL) muteValue; -/** Is audio enabled */ --(BOOL) enabled; -/** If NO then all audio is stopped and any calls to start new audio will be ignored */ --(void) setEnabled:(BOOL) enabledValue; -@end - -#pragma mark CDUtilities -/** - Collection of utilities required by CocosDenshion - */ -@interface CDUtilities : NSObject -{ -} - -/** Fundamentally the same as the corresponding method is CCFileUtils but added to break binding to cocos2d */ -+(NSString*) fullPathFromRelativePath:(NSString*) relPath; - -@end - - -#pragma mark CDSoundEngine - -/** CDSoundEngine is built upon OpenAL and works with SDK 2.0. - CDSoundEngine is a sound engine built upon OpenAL and derived from Apple's oalTouch - example. It can playback up to 32 sounds simultaneously with control over pitch, pan - and gain. It can be set up to handle audio session interruption automatically. You - may decide to use CDSoundEngine directly instead of CDAudioManager or SimpleAudioEngine - because you require OS 2.0 compatibility. - - Requirements: - - Firmware: OS 2.0 or greater - - Files: CocosDenshion.* - - Frameworks: OpenAL, AudioToolbox - - @since v0.8 - */ -@class CDSoundSource; -@interface CDSoundEngine : NSObject { - - bufferInfo *_buffers; - sourceInfo *_sources; - sourceGroup *_sourceGroups; - ALCcontext *context; - NSUInteger _sourceGroupTotal; - UInt32 _audioSessionCategory; - BOOL _handleAudioSession; - ALfloat _preMuteGain; - NSObject *_mutexBufferLoad; - BOOL mute_; - BOOL enabled_; - - ALenum lastErrorCode_; - BOOL functioning_; - float asynchLoadProgress_; - BOOL getGainWorks_; - - //For managing dynamic allocation of sources and buffers - int sourceTotal_; - int bufferTotal; - -} - -@property (readwrite, nonatomic) ALfloat masterGain; -@property (readonly) ALenum lastErrorCode;//Last OpenAL error code that was generated -@property (readonly) BOOL functioning;//Is the sound engine functioning -@property (readwrite) float asynchLoadProgress; -@property (readonly) BOOL getGainWorks;//Does getting the gain for a source work -/** Total number of sources available */ -@property (readonly) int sourceTotal; -/** Total number of source groups that have been defined */ -@property (readonly) NSUInteger sourceGroupTotal; - -/** Sets the sample rate for the audio mixer. For best performance this should match the sample rate of your audio content */ -+(void) setMixerSampleRate:(Float32) sampleRate; - -/** Initializes the engine with a group definition and a total number of groups */ --(id)init; -/** Plays a sound in a channel group with a pitch, pan and gain. The sound could played looped or not */ --(ALuint) playSound:(int) soundId sourceGroupId:(int)sourceGroupId pitch:(float) pitch pan:(float) pan gain:(float) gain loop:(BOOL) loop; - -/** Creates and returns a sound source object for the specified sound within the specified source group. - */ --(CDSoundSource *) soundSourceForSound:(int) soundId sourceGroupId:(int) sourceGroupId; - -/** Stops playing a sound */ -- (void) stopSound:(ALuint) sourceId; -/** Stops playing a source group */ -- (void) stopSourceGroup:(int) sourceGroupId; -/** Stops all playing sounds */ --(void) stopAllSounds; --(void) defineSourceGroups:(NSArray*) sourceGroupDefinitions; --(void) defineSourceGroups:(int[]) sourceGroupDefinitions total:(NSUInteger) total; --(void) setSourceGroupNonInterruptible:(int) sourceGroupId isNonInterruptible:(BOOL) isNonInterruptible; --(void) setSourceGroupEnabled:(int) sourceGroupId enabled:(BOOL) enabled; --(BOOL) sourceGroupEnabled:(int) sourceGroupId; --(BOOL) loadBufferFromData:(int) soundId soundData:(ALvoid*) soundData format:(ALenum) format size:(ALsizei) size freq:(ALsizei) freq; --(BOOL) loadBuffer:(int) soundId filePath:(NSString*) filePath; --(void) loadBuffersAsynchronously:(NSArray *) loadRequests; --(BOOL) unloadBuffer:(int) soundId; --(ALCcontext *) openALContext; - -/** Returns the duration of the buffer in seconds or a negative value if the buffer id is invalid */ --(float) bufferDurationInSeconds:(int) soundId; -/** Returns the size of the buffer in bytes or a negative value if the buffer id is invalid */ --(ALsizei) bufferSizeInBytes:(int) soundId; -/** Returns the sampling frequency of the buffer in hertz or a negative value if the buffer id is invalid */ --(ALsizei) bufferFrequencyInHertz:(int) soundId; - -/** Used internally, never call unless you know what you are doing */ --(void) _soundSourcePreRelease:(CDSoundSource *) soundSource; - -@end - -#pragma mark CDSoundSource -/** CDSoundSource is a wrapper around an OpenAL sound source. - It allows you to manipulate properties such as pitch, gain, pan and looping while the - sound is playing. CDSoundSource is based on the old CDSourceWrapper class but with much - added functionality. - - @since v1.0 - */ -@interface CDSoundSource : NSObject { - ALenum lastError; -@public - ALuint _sourceId; - ALuint _sourceIndex; - CDSoundEngine* _engine; - int _soundId; - float _preMuteGain; - BOOL enabled_; - BOOL mute_; -} -@property (readwrite, nonatomic) float pitch; -@property (readwrite, nonatomic) float gain; -@property (readwrite, nonatomic) float pan; -@property (readwrite, nonatomic) BOOL looping; -@property (readonly) BOOL isPlaying; -@property (readwrite, nonatomic) int soundId; -/** Returns the duration of the attached buffer in seconds or a negative value if the buffer is invalid */ -@property (readonly) float durationInSeconds; - -/** Stores the last error code that occurred. Check against AL_NO_ERROR */ -@property (readonly) ALenum lastError; -/** Do not init yourself, get an instance from the sourceForSound factory method on CDSoundEngine */ --(id)init:(ALuint) theSourceId sourceIndex:(int) index soundEngine:(CDSoundEngine*) engine; - -@end - -#pragma mark CDAudioInterruptTargetGroup - -/** Container for objects that implement audio interrupt protocol i.e. they can be muted and enabled. - Setting mute and enabled for the group propagates to all children. - Designed to be used with your CDSoundSource objects to get them to comply with global enabled and mute settings - if that is what you want to do.*/ -@interface CDAudioInterruptTargetGroup : NSObject { - BOOL mute_; - BOOL enabled_; - NSMutableArray *children_; -} --(void) addAudioInterruptTarget:(NSObject*) interruptibleTarget; -@end - -#pragma mark CDAsynchBufferLoader - -/** CDAsynchBufferLoader - TODO - */ -@interface CDAsynchBufferLoader : NSOperation { - NSArray *_loadRequests; - CDSoundEngine *_soundEngine; -} - --(id) init:(NSArray *)loadRequests soundEngine:(CDSoundEngine *) theSoundEngine; - -@end - -#pragma mark CDBufferLoadRequest - -/** CDBufferLoadRequest */ -@interface CDBufferLoadRequest: NSObject -{ - NSString *filePath; - int soundId; - //id loader; -} - -@property (readonly) NSString *filePath; -@property (readonly) int soundId; - -- (id)init:(int) theSoundId filePath:(const NSString *) theFilePath; -@end - -/** Interpolation type */ -typedef enum { - kIT_Linear, //!Straight linear interpolation fade - kIT_SCurve, //!S curved interpolation - kIT_Exponential //!Exponential interpolation -} tCDInterpolationType; - -#pragma mark CDFloatInterpolator -@interface CDFloatInterpolator: NSObject -{ - float start; - float end; - float lastValue; - tCDInterpolationType interpolationType; -} -@property (readwrite, nonatomic) float start; -@property (readwrite, nonatomic) float end; -@property (readwrite, nonatomic) tCDInterpolationType interpolationType; - -/** Return a value between min and max based on t which represents fractional progress where 0 is the start - and 1 is the end */ --(float) interpolate:(float) t; --(id) init:(tCDInterpolationType) type startVal:(float) startVal endVal:(float) endVal; +@interface CocosDenshion : NSObject @end - -#pragma mark CDPropertyModifier - -/** Base class for classes that modify properties such as pitch, pan and gain */ -@interface CDPropertyModifier: NSObject -{ - CDFloatInterpolator *interpolator; - float startValue; - float endValue; - id target; - BOOL stopTargetWhenComplete; - -} -@property (readwrite, nonatomic) BOOL stopTargetWhenComplete; -@property (readwrite, nonatomic) float startValue; -@property (readwrite, nonatomic) float endValue; -@property (readwrite, nonatomic) tCDInterpolationType interpolationType; - --(id) init:(id) theTarget interpolationType:(tCDInterpolationType) type startVal:(float) startVal endVal:(float) endVal; -/** Set to a fractional value between 0 and 1 where 0 equals the start and 1 equals the end*/ --(void) modify:(float) t; - --(void) _setTargetProperty:(float) newVal; --(float) _getTargetProperty; --(void) _stopTarget; --(Class) _allowableType; - -@end - -#pragma mark CDSoundSourceFader - -/** Fader for CDSoundSource objects */ -@interface CDSoundSourceFader : CDPropertyModifier{} -@end - -#pragma mark CDSoundSourcePanner - -/** Panner for CDSoundSource objects */ -@interface CDSoundSourcePanner : CDPropertyModifier{} -@end - -#pragma mark CDSoundSourcePitchBender - -/** Pitch bender for CDSoundSource objects */ -@interface CDSoundSourcePitchBender : CDPropertyModifier{} -@end - -#pragma mark CDSoundEngineFader - -/** Fader for CDSoundEngine objects */ -@interface CDSoundEngineFader : CDPropertyModifier{} -@end - - - - diff --git a/include/cocos2d-ui/CCButton.h b/include/cocos2d-ui/CCButton.h new file mode 100644 index 0000000..b9da4d1 --- /dev/null +++ b/include/cocos2d-ui/CCButton.h @@ -0,0 +1,109 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2013 Apportable Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#import "CCControl.h" + +@class CCSprite9Slice; +@class CCLabelTTF; +@class CCSpriteFrame; + +/** + The CCButton represents a button on the screen. The button is presented with a stretchable background image and/or a title label. Different images, colors and opacity can be set for each of the buttons different states. + + Methods for setting callbacks for the button is inherited from CCControl through the setTarget:selector: method or the block property. + */ +@interface CCButton : CCControl +{ + NSMutableDictionary* _backgroundSpriteFrames; + NSMutableDictionary* _backgroundColors; + NSMutableDictionary* _backgroundOpacities; + NSMutableDictionary* _labelColors; + NSMutableDictionary* _labelOpacities; + float _originalScaleX; + float _originalScaleY; +} + +@property (nonatomic,readonly) CCSprite9Slice* background; +@property (nonatomic,readonly) CCLabelTTF* label; +@property (nonatomic,assign) BOOL zoomWhenHighlighted; +@property (nonatomic,assign) float horizontalPadding; +@property (nonatomic,assign) float verticalPadding; +@property (nonatomic,strong) NSString* title; + +/// ----------------------------------------------------------------------- +/// @name Creating Buttons +/// ----------------------------------------------------------------------- + +/** + * Creates a new button with a title and no background. Uses default font and font size. + * + * @param title The title text of the button. + * + * @return A new button. + */ ++ (id) buttonWithTitle:(NSString*) title; + +/** + * Creates a new button with a title and no background. + * + * @param title The title text of the button. + * @param fontName Name of the TTF font to use for the title label. + * @param size Font size for the title label. + * + * @return A new button. + */ ++ (id) buttonWithTitle:(NSString*) title fontName:(NSString*)fontName fontSize:(float)size; + +/** + * Creates a new button with the specified title for the label and sprite frame for its background. + * + * @param title The title text of the button. + * @param spriteFrame Stretchable background image. + * + * @return A new button. + */ ++ (id) buttonWithTitle:(NSString*) title spriteFrame:(CCSpriteFrame*) spriteFrame; ++ (id) buttonWithTitle:(NSString*) title spriteFrame:(CCSpriteFrame*) spriteFrame highlightedSpriteFrame:(CCSpriteFrame*) highlighted disabledSpriteFrame:(CCSpriteFrame*) disabled; + +- (id) initWithTitle:(NSString*) title; +- (id) initWithTitle:(NSString *)title fontName:(NSString*)fontName fontSize:(float)size; +- (id) initWithTitle:(NSString*) title spriteFrame:(CCSpriteFrame*) spriteFrame; +- (id) initWithTitle:(NSString*) title spriteFrame:(CCSpriteFrame*) spriteFrame highlightedSpriteFrame:(CCSpriteFrame*) highlighted disabledSpriteFrame:(CCSpriteFrame*) disabled; + +- (void) setBackgroundColor:(ccColor3B) color forState:(CCControlState) state; +- (void) setBackgroundOpacity:(GLubyte) opacity forState:(CCControlState) state; + +- (void) setLabelColor:(ccColor3B) color forState:(CCControlState) state; +- (void) setLabelOpacity:(GLubyte) opacity forState:(CCControlState) state; + +- (ccColor3B) backgroundColorForState:(CCControlState)state; +- (GLubyte) backgroundOpacityForState:(CCControlState)state; + +- (ccColor3B) labelColorForState:(CCControlState) state; +- (GLubyte) labelOpacityForState:(CCControlState) state; + +- (void) setBackgroundSpriteFrame:(CCSpriteFrame*)spriteFrame forState:(CCControlState)state; +- (CCSpriteFrame*) backgroundSpriteFrameForState:(CCControlState)state; + +@end diff --git a/include/cocos2d-ui/CCControl.h b/include/cocos2d-ui/CCControl.h new file mode 100644 index 0000000..7032ca4 --- /dev/null +++ b/include/cocos2d-ui/CCControl.h @@ -0,0 +1,118 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2013 Apportable Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#import "CCNode.h" + +/** + The possible states for a CCControl. + */ +typedef NS_ENUM(NSUInteger, CCControlState) +{ + /** The normal, or default state of a control — that is, enabled but neither selected nor highlighted. */ + CCControlStateNormal = 1 << 0, + + /** Highlighted state of a control. A control enters this state when a touch down, drag inside or drag enter is performed. You can retrieve and set this value through the highlighted property. */ + CCControlStateHighlighted = 1 << 1, + + /** Disabled state of a control. This state indicates that the control is currently disabled. You can retrieve and set this value through the enabled property. */ + CCControlStateDisabled = 1 << 2, + + /** Selected state of a control. This state indicates that the control is currently selected. You can retrieve and set this value through the selected property. */ + CCControlStateSelected = 1 << 3 +}; + + +/** + CCControl is the abstract base class of the Cocos2d components that handles touches or mouse events. You cannot instantiate it directly, instead use one of its sub-classes, such as CCButton. If you need to create a new sort of component you should make a sub-class of this class. + + The control class handles events and its sub-classes will use child nodes to draw itself in the node heirarchy. + + *Important:* If you are sub-classing CCControl you will need to include the CCControlSubclass.h file as it includes methods that are otherwise not exposed. + */ +@interface CCControl : CCNode +{ + /** Needs layout is set to true if the control has changed and needs to re-layout itself. */ + BOOL _needsLayout; +} + + +/// ----------------------------------------------------------------------- +/// @name Controlling Content Size +/// ----------------------------------------------------------------------- + +/** The preferred (and minimum) size that the component will attempt to layout to. If its contents are larger it may have a larger size. */ +@property (nonatomic,assign) CGSize preferredSize; + +/** The content size type that the preferredSize is using. Please refer to the CCNode documentation on how to use content size types. */ +@property (nonatomic,assign) CCContentSizeType preferredSizeType; + +/** The maximum size that the component will layout to, the component will not be larger than this size and will instead shrink its content if needed. */ +@property (nonatomic,assign) CGSize maxSize; + +/** The content size type that the preferredSize is using. Please refer to the CCNode documentation on how to use content size types. */ +@property (nonatomic,assign) CCContentSizeType maxSizeType; + + +/// ----------------------------------------------------------------------- +/// @name Setting and Getting Control Attributes +/// ----------------------------------------------------------------------- + +/** Sets or retrieves the current state of the control. It's often easier to use the enabled, highlighted and selected properties to indirectly set or read this property. This property is stored as a bit-mask. */ +@property (nonatomic,assign) CCControlState state; + +/** Determines if the control is currently enabled. */ +@property (nonatomic,assign) BOOL enabled; + +/** Determines if the control is currently selected. E.g. this is used by toggle buttons to handle the on state. */ +@property (nonatomic,assign) BOOL selected; + +/** Determines if the control is currently highlighted. E.g. this corresponds to the down state of a button */ +@property (nonatomic,assign) BOOL highlighted; + +/** True if the control continously should generate events when it's value is changed. E.g. this can be used by slider controls. */ +@property (nonatomic,assign) BOOL continuous; + +/** True if the control is currently tracking touches or mouse events. That is, if the user has touched down in the component but not lifted his finger (the actual touch may be outside the component). */ +@property (nonatomic,readonly) BOOL tracking; + +/** True if the control currently has a touch or a mouse event within its bounds. */ +@property (nonatomic,readonly) BOOL touchInside; + + +/// ----------------------------------------------------------------------- +/// @name Receiving Action Callbacks +/// ----------------------------------------------------------------------- + +/** A block that handles action callbacks sent by the control. Use either the block property or the setTarget:selector: method to receive actions from controls. */ +@property (nonatomic,copy) void(^block)(id sender); + +/** + * Sets a target and selector that should be called when an action is triggered by the control. Actions are generated when buttons are clicked, sliders are dragged etc. You can also set the action callback using the block property. + * + * @param target The target object. + * @param selector Selector to call on the target object. + */ +-(void) setTarget:(id)target selector:(SEL)selector; + +@end diff --git a/include/cocos2d-ui/CCControlSubclass.h b/include/cocos2d-ui/CCControlSubclass.h new file mode 100644 index 0000000..697419e --- /dev/null +++ b/include/cocos2d-ui/CCControlSubclass.h @@ -0,0 +1,140 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2013 Apportable Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#import "CCControl.h" + +/// ----------------------------------------------------------------------- +/// @name Methods Used by Sub-Classes +/// ----------------------------------------------------------------------- + +@interface CCControl () + +/** + * Used by sub-classes. This method is called to trigger an action callback. E.g. CCButton calls this method when the button is tapped. + */ +- (void) triggerAction; + +/** + * Used by sub-classes. This method is called every time the control's state changes, it's default behavior is to call the needsLayout method. + */ +- (void) stateChanged; + +/** + * Used by sub-classes. This method should be called whenever the control needs to update its layout. It will force a call to the layout method at the beginning of the next draw cycle. + */ +- (void) needsLayout; + +/** + * Used by sub classes. Override this method to do any layout needed by the component. This can include setting positions or sizes of child labels or sprites as well as the compontents contentSize. + */ +- (void) layout; + +/** + * Used by sub-classes. Override this method if you are using custom properties and need to set them by name using the setValue:forKey method. This is needed for integration with editors such as SpriteBuilder. When overriding this method, make sure to call its super method if you cannot handle the key. + * + * @param value The value to set. + * @param key The key to set the value for. + * @param state The state to set the value for. + */ +- (void) setValue:(id)value forKey:(NSString *)key state:(CCControlState) state; + +/** + * Used by sub-classes. Override this method to return values of custom properties that are set by state. + * @see setValue:forKey:state: + * + * @param key The key to retrieve the value for. + * @param state The state to retrieve the value for. + * + * @return The value for the specified key and value or `NULL` if no such value exist. + */ +- (id) valueForKey:(NSString *)key state:(CCControlState)state; + +#ifdef __CC_PLATFORM_IOS + +/** + * Used by sub-classes. Called when a touch enters the component. By default this happes if the touch down is within the control, if the claimsUserEvents property is set to false this will also happen if the touch starts outside of the control. + * + * @param touch Touch that entered the component. + * @param event Event associated with the touch. + */ +- (void) touchEntered:(UITouch*) touch withEvent:(UIEvent*)event; + +/** + * Used by sub-classes. Called when a touch exits the component. + * + * @param touch Touch that exited the component + * @param event Event associated with the touch. + */ +- (void) touchExited:(UITouch*) touch withEvent:(UIEvent*) event; + +/** + * Used by sub-classes. Called when a touch that started inside the component is ended inside the component. E.g. for CCButton, this triggers the buttons callback action. + * + * @param touch Touch that is released inside the component. + * @param event Event associated with the touch. + */ +- (void) touchUpInside:(UITouch*) touch withEvent:(UIEvent*) event; + +/** + * Used by sub-classes. Called when a touch that started inside the component is ended outside the component. E.g. for CCButton, this doesn't trigger any callback action. + * + * @param touch Touch that is release outside of the component. + * @param event Event associated with the touch. + */ +- (void) touchUpOutside:(UITouch*) touch withEvent:(UIEvent*) event; + +#elif defined (__CC_PLATFORM_MAC) + +/** + * Used by sub-classes. Called when a mouse down enters the component. By default this happes if the mouse down is within the control, if the claimsUserEvents property is set to false this will also happen if the mouse down starts outside of the control. + * + * @param event Event associated with the mouse down. + */ +- (void) mouseDownEntered:(NSEvent*) event; + +/** + * Used by sub-classes. Called when a mouse down exits the component. + * + * @param event Event associated with the mouse down. + */ +- (void) mouseDownExited:(NSEvent*) event; + +/** + * Used by sub-classes. Called when a mouse down that started inside the component is ended inside the component. E.g. for CCButton, this triggers the buttons callback action. + * + * @param event Event associated with the mouse up. + */ +- (void) mouseUpInside:(NSEvent*) event; + +/** + * Used by sub-classes. Called when a mouse down that started inside the component is ended outside the component. E.g. for CCButton, this doesn't trigger any callback action. + * + * @param event Event associated with the mouse up. + */ +- (void) mouseUpOutside:(NSEvent*) event; + + +#endif + +@end diff --git a/include/cocos2d-ui/CCControlTextureFactory.h b/include/cocos2d-ui/CCControlTextureFactory.h new file mode 100644 index 0000000..daec620 --- /dev/null +++ b/include/cocos2d-ui/CCControlTextureFactory.h @@ -0,0 +1,13 @@ +// +// CCControlTextureFactory.h +// cocos2d-ui +// +// Created by Viktor on 9/5/13. +// Copyright (c) 2013 Apportable. All rights reserved. +// + +#import + +@interface CCControlTextureFactory : NSObject + +@end diff --git a/include/cocos2d-ui/CCScrollView.h b/include/cocos2d-ui/CCScrollView.h new file mode 100644 index 0000000..0936e56 --- /dev/null +++ b/include/cocos2d-ui/CCScrollView.h @@ -0,0 +1,83 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2013 Apportable Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#import "CCNode.h" + +@class CCTapDownGestureRecognizer; + +#ifdef __CC_PLATFORM_IOS + +// Class definition for iOS +@interface CCScrollView : CCNode + +#elif defined(__CC_PLATFORM_MAC) + +// Class definition for Mac +@interface CCScrollView : CCNode + +#endif + +{ +#ifdef __CC_PLATFORM_IOS + UIPanGestureRecognizer* _panRecognizer; + CCTapDownGestureRecognizer* _tapRecognizer; +#endif + + CGPoint _rawTranslationStart; + CGPoint _startScrollPos; + BOOL _isPanning; + BOOL _animatingX; + BOOL _animatingY; + CGPoint _velocity; +} + +@property (nonatomic,strong) CCNode* contentNode; + +@property (nonatomic,assign) BOOL flipYCoordinates; + +@property (nonatomic,assign) BOOL horizontalScrollEnabled; +@property (nonatomic,assign) BOOL verticalScrollEnabled; + +@property (nonatomic,assign) CGPoint scrollPosition; + +@property (nonatomic,assign) BOOL pagingEnabled; +@property (nonatomic,assign) int horizontalPage; +@property (nonatomic,assign) int verticalPage; +@property (nonatomic,readonly) int numVerticalPages; +@property (nonatomic,readonly) int numHorizontalPages; + +@property (nonatomic,readonly) float minScrollX; +@property (nonatomic,readonly) float maxScrollX; +@property (nonatomic,readonly) float minScrollY; +@property (nonatomic,readonly) float maxScrollY; + +@property (nonatomic,assign) BOOL bounces; + +- (id) initWithContentNode:(CCNode*)contentNode; + +- (void) setScrollPosition:(CGPoint)newPos animated:(BOOL)animated; + +- (void) setHorizontalPage:(int)horizontalPage animated:(BOOL)animated; +- (void) setVerticalPage:(int)verticalPage animated:(BOOL)animated; +@end diff --git a/include/cocos2d-ui/CCTableView.h b/include/cocos2d-ui/CCTableView.h new file mode 100644 index 0000000..72285c0 --- /dev/null +++ b/include/cocos2d-ui/CCTableView.h @@ -0,0 +1,79 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2013 Apportable Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#import "CCScrollView.h" + +@class CCButton; +@class CCTableView; + +#pragma mark CCTableViewCell + +@interface CCTableViewCell : CCNode +{ + NSUInteger _index; +} + +@property (nonatomic,readonly) CCButton* button; + +@end + +#pragma mark CCTableViewDataSource + +@protocol CCTableViewDataSource + +- (CCTableViewCell*) tableView:(CCTableView*)tableView nodeForRowAtIndex:(NSUInteger) index; +- (NSUInteger) tableViewNumberOfRows:(CCTableView*) tableView; + +@optional + +- (float) tableView:(CCTableView*)tableView heightForRowAtIndex:(NSUInteger) index; + +@end + + +#pragma mark CCTableView + +@interface CCTableView : CCScrollView +{ + BOOL _visibleRowsDirty; + NSMutableArray* _rows; + NSRange _currentlyVisibleRange; + struct { + int heightForRowAtIndex:1; + // reserved for future dataSource delegation + } _dataSourceFlags; +} + +@property (nonatomic,strong) id dataSource; +@property (nonatomic,assign) CGFloat rowHeight; +@property (nonatomic,assign) CCContentSizeUnit rowHeightUnit; +@property (nonatomic,readonly) CGFloat rowHeightInPoints; +@property (nonatomic,assign) NSUInteger selectedRow; + +@property (nonatomic,copy) void(^block)(id sender); +-(void) setTarget:(id)target selector:(SEL)selector; + +- (void) reloadData; + +@end diff --git a/include/cocos2d-ui/cocos2d-ui.h b/include/cocos2d-ui/cocos2d-ui.h new file mode 100644 index 0000000..aa01df2 --- /dev/null +++ b/include/cocos2d-ui/cocos2d-ui.h @@ -0,0 +1,29 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2013 Apportable Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +// Cocos2d-UI +#import "CCControl.h" +#import "CCButton.h" +#import "CCScrollView.h" +#import "CCTableView.h" diff --git a/include/cocos2d/CCAction.h b/include/cocos2d/CCAction.h index f1da6b8..01abda2 100644 --- a/include/cocos2d/CCAction.h +++ b/include/cocos2d/CCAction.h @@ -39,9 +39,9 @@ enum { */ @interface CCAction : NSObject { - id originalTarget_; - id target_; - NSInteger tag_; + id __unsafe_unretained _originalTarget; + id __unsafe_unretained _target; + NSInteger _tag; } /** The "target". The action will modify the target properties. @@ -49,13 +49,13 @@ enum { When the 'stop' method is called, target will be set to nil. The target is 'assigned', it is not 'retained'. */ -@property (nonatomic,readonly,assign) id target; +@property (nonatomic,readonly) id target; /** The original target, since target can be nil. Is the target that were used to run the action. Unless you are doing something complex, like CCActionManager, you should NOT call this method. @since v0.8.2 */ -@property (nonatomic,readonly,assign) id originalTarget; +@property (nonatomic,readonly) id originalTarget; /** The action tag. An identifier of the action */ @@ -91,12 +91,12 @@ enum { Possible actions: - An action with a duration of 0 seconds - An action with a duration of 35.5 seconds - Infitite time actions are valid + Infinite time actions are valid */ @interface CCFiniteTimeAction : CCAction { //! duration in seconds - ccTime duration_; + ccTime _duration; } //! duration in seconds of the action @property (nonatomic,readwrite) ccTime duration; @@ -109,14 +109,14 @@ enum { @class CCActionInterval; /** Repeats an action for ever. To repeat the an action for a limited number of times use the Repeat action. - @warning This action can't be Sequenceable because it is not an IntervalAction + @warning This action can't be Sequence-able because it is not an IntervalAction */ @interface CCRepeatForever : CCAction { - CCActionInterval *innerAction_; + CCActionInterval *_innerAction; } /** Inner action */ -@property (nonatomic, readwrite, retain) CCActionInterval *innerAction; +@property (nonatomic, readwrite, strong) CCActionInterval *innerAction; /** creates the action */ +(id) actionWithAction: (CCActionInterval*) action; @@ -127,22 +127,22 @@ enum { /** Changes the speed of an action, making it take longer (speed<1) or less (speed>1) time. Useful to simulate 'slow motion' or 'fast forward' effect. - @warning This action can't be Sequenceable because it is not an CCIntervalAction + @warning This action can't be Sequence-able because it is not an CCIntervalAction */ @interface CCSpeed : CCAction { - CCActionInterval *innerAction_; - float speed_; + CCActionInterval *_innerAction; + CGFloat _speed; } /** alter the speed of the inner function in runtime */ -@property (nonatomic,readwrite) float speed; +@property (nonatomic,readwrite) CGFloat speed; /** Inner action of CCSpeed */ -@property (nonatomic, readwrite, retain) CCActionInterval *innerAction; +@property (nonatomic, readwrite, strong) CCActionInterval *innerAction; /** creates the action */ -+(id) actionWithAction: (CCActionInterval*) action speed:(float)value; ++(id) actionWithAction: (CCActionInterval*) action speed:(CGFloat)value; /** initializes the action */ --(id) initWithAction: (CCActionInterval*) action speed:(float)value; +-(id) initWithAction: (CCActionInterval*) action speed:(CGFloat)value; @end @class CCNode; @@ -157,23 +157,23 @@ enum { @interface CCFollow : CCAction { /* node to follow */ - CCNode *followedNode_; + CCNode *_followedNode; /* whether camera should be limited to certain area */ - BOOL boundarySet; + BOOL _boundarySet; - /* if screensize is bigger than the boundary - update not needed */ - BOOL boundaryFullyCovered; + /* if screen-size is bigger than the boundary - update not needed */ + BOOL _boundaryFullyCovered; /* fast access to the screen dimensions */ - CGPoint halfScreenSize; - CGPoint fullScreenSize; + CGPoint _halfScreenSize; + CGPoint _fullScreenSize; /* world boundaries */ - float leftBoundary; - float rightBoundary; - float topBoundary; - float bottomBoundary; + float _leftBoundary; + float _rightBoundary; + float _topBoundary; + float _bottomBoundary; } /** alter behavior - turn on/off boundary */ diff --git a/include/cocos2d/CCActionCamera.h b/include/cocos2d/CCActionCamera.h deleted file mode 100644 index 3c3934c..0000000 --- a/include/cocos2d/CCActionCamera.h +++ /dev/null @@ -1,73 +0,0 @@ -/* - * cocos2d for iPhone: http://www.cocos2d-iphone.org - * - * Copyright (c) 2008-2010 Ricardo Quesada - * Copyright (c) 2011 Zynga Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - * - */ - -#import "CCActionInterval.h" - -@class CCCamera; - -/** Base class for CCCamera actions - */ -@interface CCActionCamera : CCActionInterval -{ - float centerXOrig_; - float centerYOrig_; - float centerZOrig_; - - float eyeXOrig_; - float eyeYOrig_; - float eyeZOrig_; - - float upXOrig_; - float upYOrig_; - float upZOrig_; -} -@end - -/** CCOrbitCamera action - Orbits the camera around the center of the screen using spherical coordinates - */ -@interface CCOrbitCamera : CCActionCamera -{ - float radius_; - float deltaRadius_; - float angleZ_; - float deltaAngleZ_; - float angleX_; - float deltaAngleX_; - - float radZ_; - float radDeltaZ_; - float radX_; - float radDeltaX_; - -} -/** creates a CCOrbitCamera action with radius, delta-radius, z, deltaZ, x, deltaX */ -+(id) actionWithDuration:(float) t radius:(float)r deltaRadius:(float) dr angleZ:(float)z deltaAngleZ:(float)dz angleX:(float)x deltaAngleX:(float)dx; -/** initializes a CCOrbitCamera action with radius, delta-radius, z, deltaZ, x, deltaX */ --(id) initWithDuration:(float) t radius:(float)r deltaRadius:(float) dr angleZ:(float)z deltaAngleZ:(float)dz angleX:(float)x deltaAngleX:(float)dx; -/** positions the camera according to spherical coordinates */ --(void) sphericalRadius:(float*) r zenith:(float*) zenith azimuth:(float*) azimuth; -@end diff --git a/include/cocos2d/CCActionCatmullRom.h b/include/cocos2d/CCActionCatmullRom.h index 1218913..76c86d4 100644 --- a/include/cocos2d/CCActionCatmullRom.h +++ b/include/cocos2d/CCActionCatmullRom.h @@ -40,11 +40,11 @@ */ @interface CCPointArray : NSObject { - NSMutableArray *controlPoints_; + NSMutableArray *_controlPoints; } /** Array that contains the control points */ -@property (nonatomic,readwrite,retain) NSMutableArray *controlPoints; +@property (nonatomic,readwrite,strong) NSMutableArray *controlPoints; /** creates and initializes a Points array with capacity */ +(id) arrayWithCapacity:(NSUInteger)capacity; @@ -62,7 +62,7 @@ -(void) replaceControlPoint:(CGPoint)controlPoint atIndex:(NSUInteger)index; /** get the value of a controlPoint at a given index */ --(CGPoint) getControlPointAtIndex:(NSInteger)index; +-(CGPoint) getControlPointAtIndex:(NSUInteger)index; /** deletes a control point at a given index */ -(void) removeControlPointAtIndex:(NSUInteger)index; @@ -82,13 +82,15 @@ */ @interface CCCardinalSplineTo : CCActionInterval { - CCPointArray *points_; - CGFloat deltaT_; - CGFloat tension_; + CCPointArray *_points; + CGFloat _deltaT; + CGFloat _tension; + CGPoint _previousPosition; + CGPoint _accumulatedDiff; } /** Array of control points */ - @property (nonatomic,readwrite,retain) CCPointArray *points; + @property (nonatomic,readwrite,strong) CCPointArray *points; /** creates an action with a Cardinal Spline array of points and tension */ +(id) actionWithDuration:(ccTime)duration points:(CCPointArray*)points tension:(CGFloat)tension; @@ -103,8 +105,10 @@ */ @interface CCCardinalSplineBy : CCCardinalSplineTo { - CGPoint startPosition_; + CGPoint _startPosition; } +// XXX: To make BridgeSupport happy +-(void) startWithTarget:(id)target; @end /** An action that moves the target with a CatmullRom curve to a destination point. @@ -135,5 +139,13 @@ -(id) initWithDuration:(ccTime)dt points:(CCPointArray*)points; @end +#ifdef __cplusplus +extern "C" { +#endif + /** Returns the Cardinal Spline position for a given set of control points, tension and time */ - CGPoint ccCardinalSplineAt( CGPoint p0, CGPoint p1, CGPoint p2, CGPoint p3, CGFloat tension, ccTime t ); +CGPoint ccCardinalSplineAt( CGPoint p0, CGPoint p1, CGPoint p2, CGPoint p3, CGFloat tension, ccTime t ); + +#ifdef __cplusplus +} +#endif diff --git a/include/cocos2d/CCActionEase.h b/include/cocos2d/CCActionEase.h index 4c91e56..7719b3e 100644 --- a/include/cocos2d/CCActionEase.h +++ b/include/cocos2d/CCActionEase.h @@ -2,6 +2,7 @@ * cocos2d for iPhone: http://www.cocos2d-iphone.org * * Copyright (c) 2008-2009 Jason Booth + * Copyright (c) 2013 Nader Eloshaiker * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -30,8 +31,11 @@ */ @interface CCActionEase : CCActionInterval { - CCActionInterval * other; + CCActionInterval *_inner; } +/** The inner action */ +@property (nonatomic, readonly) CCActionInterval *inner; + /** creates the action */ +(id) actionWithAction: (CCActionInterval*) action; /** initializes the action */ @@ -42,7 +46,7 @@ */ @interface CCEaseRateAction : CCActionEase { - float rate; + float _rate; } /** rate value for the actions */ @property (nonatomic,readwrite,assign) float rate; @@ -54,41 +58,128 @@ /** CCEaseIn action with a rate */ -@interface CCEaseIn : CCEaseRateAction {} @end +@interface CCEaseIn : CCEaseRateAction +{} +// Needed for BridgeSupport +-(void) update: (ccTime) t; +@end /** CCEaseOut action with a rate */ -@interface CCEaseOut : CCEaseRateAction {} @end +@interface CCEaseOut : CCEaseRateAction +{} +// Needed for BridgeSupport +-(void) update: (ccTime) t; +@end /** CCEaseInOut action with a rate */ -@interface CCEaseInOut : CCEaseRateAction {} @end +@interface CCEaseInOut : CCEaseRateAction +{} +// Needed for BridgeSupport +-(void) update: (ccTime) t; +@end /** CCEase Exponential In */ -@interface CCEaseExponentialIn : CCActionEase {} @end +@interface CCEaseExponentialIn : CCActionEase +{} +// Needed for BridgeSupport +-(void) update: (ccTime) t; +@end + /** Ease Exponential Out */ -@interface CCEaseExponentialOut : CCActionEase {} @end +@interface CCEaseExponentialOut : CCActionEase +{} +// Needed for BridgeSupport +-(void) update: (ccTime) t; +@end + /** Ease Exponential InOut */ -@interface CCEaseExponentialInOut : CCActionEase {} @end +@interface CCEaseExponentialInOut : CCActionEase +{} +// Needed for BridgeSupport +-(void) update: (ccTime) t; +@end + +/** CCEase Polynomial abstract class + @since v2.1 + */ +@interface CCEasePolynomial : CCActionEase { +@protected + NSUInteger _polynomialOrder; + CGFloat _intersetValue; //Used for InOut mid point time calculation + BOOL _hasInflection; //odd numbered polynomial orders will display a point of inflection where the curve will invert +} +/** Used to determine the steepness of the timing curve. + As the value increases, so does the steepness/rate of the curve. + Default value is 6, gives a similar curve to EaseExponential. + Values less than 6, produces a softer ease action. + Values greater than 6, produces a more pronounced action. + @warning Value must be greater than 1 + */ +@property (nonatomic, readwrite, assign) NSUInteger polynomialOrder; +@end + +/** CCEase Polynomial In + @since v2.1 + */ +@interface CCEasePolynomialIn : CCEasePolynomial +{} +// Needed for BridgeSupport +-(void) update: (ccTime) t; +@end + +/** Ease Polynomial Out + @since v2.1 + */ +@interface CCEasePolynomialOut : CCEasePolynomial +{} +// Needed for BridgeSupport +-(void) update: (ccTime) t; +@end + +/** Ease Polynomial InOut + @since v2.1 + */ +@interface CCEasePolynomialInOut : CCEasePolynomial +{} +// Needed for BridgeSupport +-(void) update: (ccTime) t; +@end + /** Ease Sine In */ -@interface CCEaseSineIn : CCActionEase {} @end +@interface CCEaseSineIn : CCActionEase +{} +// Needed for BridgeSupport +-(void) update: (ccTime) t; +@end + /** Ease Sine Out */ -@interface CCEaseSineOut : CCActionEase {} @end +@interface CCEaseSineOut : CCActionEase +{} +// Needed for BridgeSupport +-(void) update: (ccTime) t; +@end + /** Ease Sine InOut */ -@interface CCEaseSineInOut : CCActionEase {} @end +@interface CCEaseSineInOut : CCActionEase +{} +// Needed for BridgeSupport +-(void) update: (ccTime) t; +@end /** Ease Elastic abstract class @since v0.8.2 */ @interface CCEaseElastic : CCActionEase { - float period_; + float _period; } /** period of the wave in radians. default is 0.3 */ @@ -101,59 +192,101 @@ @end /** Ease Elastic In action. - @warning This action doesn't use a bijective fucntion. Actions like Sequence might have an unexpected result when used with this action. + @warning This action doesn't use a bijective function. Actions like Sequence might have an unexpected result when used with this action. @since v0.8.2 */ -@interface CCEaseElasticIn : CCEaseElastic {} @end +@interface CCEaseElasticIn : CCEaseElastic +{} +// Needed for BridgeSupport +-(void) update: (ccTime) t; +@end + /** Ease Elastic Out action. - @warning This action doesn't use a bijective fucntion. Actions like Sequence might have an unexpected result when used with this action. + @warning This action doesn't use a bijective function. Actions like Sequence might have an unexpected result when used with this action. @since v0.8.2 */ -@interface CCEaseElasticOut : CCEaseElastic {} @end +@interface CCEaseElasticOut : CCEaseElastic +{} +// Needed for BridgeSupport +-(void) update: (ccTime) t; +@end + /** Ease Elastic InOut action. - @warning This action doesn't use a bijective fucntion. Actions like Sequence might have an unexpected result when used with this action. + @warning This action doesn't use a bijective function. Actions like Sequence might have an unexpected result when used with this action. @since v0.8.2 */ -@interface CCEaseElasticInOut : CCEaseElastic {} @end +@interface CCEaseElasticInOut : CCEaseElastic +{} +// Needed for BridgeSupport +-(void) update: (ccTime) t; +@end /** CCEaseBounce abstract class. @since v0.8.2 */ -@interface CCEaseBounce : CCActionEase {} @end +@interface CCEaseBounce : CCActionEase +{} +// Needed for BridgeSupport +-(ccTime) bounceTime:(ccTime) t; +@end /** CCEaseBounceIn action. - @warning This action doesn't use a bijective fucntion. Actions like Sequence might have an unexpected result when used with this action. + @warning This action doesn't use a bijective function. Actions like Sequence might have an unexpected result when used with this action. @since v0.8.2 */ -@interface CCEaseBounceIn : CCEaseBounce {} @end +@interface CCEaseBounceIn : CCEaseBounce +{} +// Needed for BridgeSupport +-(void) update: (ccTime) t; +@end /** EaseBounceOut action. - @warning This action doesn't use a bijective fucntion. Actions like Sequence might have an unexpected result when used with this action. + @warning This action doesn't use a bijective function. Actions like Sequence might have an unexpected result when used with this action. @since v0.8.2 */ -@interface CCEaseBounceOut : CCEaseBounce {} @end +@interface CCEaseBounceOut : CCEaseBounce +{} +// Needed for BridgeSupport +-(void) update: (ccTime) t; +@end /** CCEaseBounceInOut action. - @warning This action doesn't use a bijective fucntion. Actions like Sequence might have an unexpected result when used with this action. + @warning This action doesn't use a bijective function. Actions like Sequence might have an unexpected result when used with this action. @since v0.8.2 */ -@interface CCEaseBounceInOut : CCEaseBounce {} @end +@interface CCEaseBounceInOut : CCEaseBounce +{} +// Needed for BridgeSupport +-(void) update: (ccTime) t; +@end /** CCEaseBackIn action. - @warning This action doesn't use a bijective fucntion. Actions like Sequence might have an unexpected result when used with this action. + @warning This action doesn't use a bijective function. Actions like Sequence might have an unexpected result when used with this action. @since v0.8.2 */ -@interface CCEaseBackIn : CCActionEase {} @end +@interface CCEaseBackIn : CCActionEase +{} +// Needed for BridgeSupport +-(void) update: (ccTime) t; +@end /** CCEaseBackOut action. - @warning This action doesn't use a bijective fucntion. Actions like Sequence might have an unexpected result when used with this action. + @warning This action doesn't use a bijective function. Actions like Sequence might have an unexpected result when used with this action. @since v0.8.2 */ -@interface CCEaseBackOut : CCActionEase {} @end +@interface CCEaseBackOut : CCActionEase +{} +// Needed for BridgeSupport +-(void) update: (ccTime) t; +@end /** CCEaseBackInOut action. - @warning This action doesn't use a bijective fucntion. Actions like Sequence might have an unexpected result when used with this action. + @warning This action doesn't use a bijective function. Actions like Sequence might have an unexpected result when used with this action. @since v0.8.2 */ -@interface CCEaseBackInOut : CCActionEase {} @end +@interface CCEaseBackInOut : CCActionEase +{} +// Needed for BridgeSupport +-(void) update: (ccTime) t; +@end diff --git a/include/cocos2d/CCActionGrid.h b/include/cocos2d/CCActionGrid.h index 244ee79..53fd1cc 100644 --- a/include/cocos2d/CCActionGrid.h +++ b/include/cocos2d/CCActionGrid.h @@ -33,16 +33,16 @@ /** Base class for Grid actions */ @interface CCGridAction : CCActionInterval { - ccGridSize gridSize_; + CGSize _gridSize; } /** size of the grid */ -@property (nonatomic,readwrite) ccGridSize gridSize; +@property (nonatomic,readwrite) CGSize gridSize; /** creates the action with size and duration */ -+(id) actionWithSize:(ccGridSize)size duration:(ccTime)d; ++(id) actionWithDuration:(ccTime)duration size:(CGSize)gridSize; /** initializes the action with size and duration */ --(id) initWithSize:(ccGridSize)gridSize duration:(ccTime)d; +-(id) initWithDuration:(ccTime)duration size:(CGSize)gridSize; /** returns the grid */ -(CCGridBase *)grid; @@ -58,11 +58,11 @@ } /** returns the vertex than belongs to certain position in the grid */ --(ccVertex3F)vertex:(ccGridSize)pos; +-(ccVertex3F)vertex:(CGPoint)position; /** returns the non-transformed vertex than belongs to certain position in the grid */ --(ccVertex3F)originalVertex:(ccGridSize)pos; +-(ccVertex3F)originalVertex:(CGPoint)position; /** sets a new vertex to a certain position of the grid */ --(void)setVertex:(ccGridSize)pos vertex:(ccVertex3F)vertex; +-(void)setVertex:(CGPoint)position vertex:(ccVertex3F)vertex; @end @@ -74,11 +74,11 @@ } /** returns the tile that belongs to a certain position of the grid */ --(ccQuad3)tile:(ccGridSize)pos; +-(ccQuad3)tile:(CGPoint)position; /** returns the non-transformed tile that belongs to a certain position of the grid */ --(ccQuad3)originalTile:(ccGridSize)pos; +-(ccQuad3)originalTile:(CGPoint)position; /** sets a new tile to a certain position of the grid */ --(void)setTile:(ccGridSize)pos coords:(ccQuad3)coords; +-(void)setTile:(CGPoint)position coords:(ccQuad3)coords; @end @@ -87,8 +87,8 @@ /** CCAccelDeccelAmplitude action */ @interface CCAccelDeccelAmplitude : CCActionInterval { - float rate_; - CCActionInterval *other_; + float _rate; + CCActionInterval *_other; } /** amplitude rate */ @@ -106,8 +106,8 @@ /** CCAccelAmplitude action */ @interface CCAccelAmplitude : CCActionInterval { - float rate_; - CCActionInterval *other_; + float _rate; + CCActionInterval *_other; } /** amplitude rate */ @@ -125,8 +125,8 @@ /** CCDeccelAmplitude action */ @interface CCDeccelAmplitude : CCActionInterval { - float rate_; - CCActionInterval *other_; + float _rate; + CCActionInterval *_other; } /** amplitude rate */ @@ -149,6 +149,8 @@ @interface CCStopGrid : CCActionInstant { } +// to make BridgeSupport happy +-(void)startWithTarget:(id)aTarget; @end //////////////////////////////////////////////////////////// @@ -156,7 +158,7 @@ /** CCReuseGrid action */ @interface CCReuseGrid : CCActionInstant { - int t_; + int _times; } /** creates an action with the number of times that the current grid will be reused */ +(id) actionWithTimes: (int) times; diff --git a/include/cocos2d/CCActionGrid3D.h b/include/cocos2d/CCActionGrid3D.h index 7e1c40e..6c34512 100644 --- a/include/cocos2d/CCActionGrid3D.h +++ b/include/cocos2d/CCActionGrid3D.h @@ -29,9 +29,9 @@ /** CCWaves3D action */ @interface CCWaves3D : CCGrid3DAction { - int waves; - float amplitude; - float amplitudeRate; + NSUInteger _waves; + float _amplitude; + float _amplitudeRate; } /** amplitude of the wave */ @@ -39,8 +39,10 @@ /** amplitude rate of the wave */ @property (nonatomic,readwrite) float amplitudeRate; -+(id)actionWithWaves:(int)wav amplitude:(float)amp grid:(ccGridSize)gridSize duration:(ccTime)d; --(id)initWithWaves:(int)wav amplitude:(float)amp grid:(ccGridSize)gridSize duration:(ccTime)d; +/** creates an action with duration, grid size, waves and amplitud */ ++(id)actionWithDuration:(ccTime)duration size:(CGSize)gridSize waves:(NSUInteger)wav amplitude:(float)amp; +/** initializeds an action with duration, grid size, waves and amplitud */ +-(id)initWithDuration:(ccTime)duration size:(CGSize)gridSize waves:(NSUInteger)wav amplitude:(float)amp; @end @@ -53,7 +55,7 @@ /** creates the action with duration */ +(id) actionWithDuration:(ccTime)d; -/** initizlies the action with duration */ +/** initializes the action with duration */ -(id) initWithDuration:(ccTime)d; @end @@ -64,7 +66,8 @@ @interface CCFlipY3D : CCFlipX3D { } - +// Needed for bridge support +-(void)update:(ccTime)time; @end //////////////////////////////////////////////////////////// @@ -72,10 +75,10 @@ /** CCLens3D action */ @interface CCLens3D : CCGrid3DAction { - CGPoint position_; - float radius_; - float lensEffect_; - BOOL dirty_; + CGPoint _position; + float _radius; + float _lensEffect; + BOOL _dirty; } /** lens effect. Defaults to 0.7 - 0 means no effect, 1 is very strong effect */ @@ -84,9 +87,9 @@ @property (nonatomic,readwrite) CGPoint position; /** creates the action with center position in Points, radius, a grid size and duration */ -+(id)actionWithPosition:(CGPoint)pos radius:(float)r grid:(ccGridSize)gridSize duration:(ccTime)d; ++(id)actionWithDuration:(ccTime)duration size:(CGSize)gridSize position:(CGPoint)pos radius:(float)radius; /** initializes the action with center position in Points, radius, a grid size and duration */ --(id)initWithPosition:(CGPoint)pos radius:(float)r grid:(ccGridSize)gridSize duration:(ccTime)d; +-(id)initWithDuration:(ccTime)duration size:(CGSize)gridSize position:(CGPoint)pos radius:(float)radius; @end @@ -95,11 +98,11 @@ /** CCRipple3D action */ @interface CCRipple3D : CCGrid3DAction { - CGPoint position_; - float radius_; - int waves_; - float amplitude_; - float amplitudeRate_; + CGPoint _position; + float _radius; + NSUInteger _waves; + float _amplitude; + float _amplitudeRate; } /** center position in Points */ @@ -110,9 +113,9 @@ @property (nonatomic,readwrite) float amplitudeRate; /** creates the action with a position in points, radius, number of waves, amplitude, a grid size and duration */ -+(id)actionWithPosition:(CGPoint)pos radius:(float)r waves:(int)wav amplitude:(float)amp grid:(ccGridSize)gridSize duration:(ccTime)d; ++(id)actionWithDuration:(ccTime)d size:(CGSize)gridSize position:(CGPoint)pos radius:(float)r waves:(NSInteger)wav amplitude:(float)amp; /** initializes the action with a position in points, radius, number of waves, amplitude, a grid size and duration */ --(id)initWithPosition:(CGPoint)pos radius:(float)r waves:(int)wav amplitude:(float)amp grid:(ccGridSize)gridSize duration:(ccTime)d; +-(id)initWithDuration:(ccTime)d size:(CGSize)gridSize position:(CGPoint)pos radius:(float)r waves:(NSInteger)wav amplitude:(float)amp; @end @@ -121,14 +124,14 @@ /** CCShaky3D action */ @interface CCShaky3D : CCGrid3DAction { - int randrange; - BOOL shakeZ; + int _randrange; + BOOL _shakeZ; } /** creates the action with a range, shake Z vertices, a grid and duration */ -+(id)actionWithRange:(int)range shakeZ:(BOOL)shakeZ grid:(ccGridSize)gridSize duration:(ccTime)d; ++(id)actionWithDuration:(ccTime)duration size:(CGSize)gridSize range:(int)range shakeZ:(BOOL)shakeZ; /** initializes the action with a range, shake Z vertices, a grid and duration */ --(id)initWithRange:(int)range shakeZ:(BOOL)shakeZ grid:(ccGridSize)gridSize duration:(ccTime)d; +-(id)initWithDuration:(ccTime)duration size:(CGSize)gridSize range:(int)range shakeZ:(BOOL)shakeZ; @end @@ -137,9 +140,9 @@ /** CCLiquid action */ @interface CCLiquid : CCGrid3DAction { - int waves; - float amplitude; - float amplitudeRate; + NSUInteger _waves; + float _amplitude; + float _amplitudeRate; } @@ -149,9 +152,9 @@ @property (nonatomic,readwrite) float amplitudeRate; /** creates the action with amplitude, a grid and duration */ -+(id)actionWithWaves:(int)wav amplitude:(float)amp grid:(ccGridSize)gridSize duration:(ccTime)d; ++(id)actionWithDuration:(ccTime)duration size:(CGSize)gridSize waves:(NSUInteger)wav amplitude:(float)amp; /** initializes the action with amplitude, a grid and duration */ --(id)initWithWaves:(int)wav amplitude:(float)amp grid:(ccGridSize)gridSize duration:(ccTime)d; +-(id)initWithDuration:(ccTime)duration size:(CGSize)gridSize waves:(NSUInteger)wav amplitude:(float)amp; @end @@ -160,11 +163,11 @@ /** CCWaves action */ @interface CCWaves : CCGrid3DAction { - int waves; - float amplitude; - float amplitudeRate; - BOOL vertical; - BOOL horizontal; + NSUInteger _waves; + float _amplitude; + float _amplitudeRate; + BOOL _vertical; + BOOL _horizontal; } /** amplitude */ @@ -173,9 +176,9 @@ @property (nonatomic,readwrite) float amplitudeRate; /** initializes the action with amplitude, horizontal sin, vertical sin, a grid and duration */ -+(id)actionWithWaves:(int)wav amplitude:(float)amp horizontal:(BOOL)h vertical:(BOOL)v grid:(ccGridSize)gridSize duration:(ccTime)d; ++(id)actionWithDuration:(ccTime)duration size:(CGSize)gridSize waves:(NSUInteger)wav amplitude:(float)amp horizontal:(BOOL)h vertical:(BOOL)v; /** creates the action with amplitude, horizontal sin, vertical sin, a grid and duration */ --(id)initWithWaves:(int)wav amplitude:(float)amp horizontal:(BOOL)h vertical:(BOOL)v grid:(ccGridSize)gridSize duration:(ccTime)d; +-(id)initWithDuration:(ccTime)duration size:(CGSize)gridSize waves:(NSUInteger)wav amplitude:(float)amp horizontal:(BOOL)h vertical:(BOOL)v; @end @@ -184,10 +187,10 @@ /** CCTwirl action */ @interface CCTwirl : CCGrid3DAction { - CGPoint position_; - int twirls_; - float amplitude_; - float amplitudeRate_; + CGPoint _position; + NSUInteger _twirls; + float _amplitude; + float _amplitudeRate; } /** twirl center */ @@ -198,8 +201,8 @@ @property (nonatomic,readwrite) float amplitudeRate; /** creates the action with center position, number of twirls, amplitude, a grid size and duration */ -+(id)actionWithPosition:(CGPoint)pos twirls:(int)t amplitude:(float)amp grid:(ccGridSize)gridSize duration:(ccTime)d; ++(id)actionWithDuration:(ccTime)duration size:(CGSize)gridSize position:(CGPoint)pos twirls:(NSUInteger)t amplitude:(float)amp; /** initializes the action with center position, number of twirls, amplitude, a grid size and duration */ --(id)initWithPosition:(CGPoint)pos twirls:(int)t amplitude:(float)amp grid:(ccGridSize)gridSize duration:(ccTime)d; +-(id)initWithDuration:(ccTime)duration size:(CGSize)gridSize position:(CGPoint)pos twirls:(NSUInteger)t amplitude:(float)amp; @end diff --git a/include/cocos2d/CCActionInstant.h b/include/cocos2d/CCActionInstant.h index 928732b..e296a5e 100644 --- a/include/cocos2d/CCActionInstant.h +++ b/include/cocos2d/CCActionInstant.h @@ -33,6 +33,8 @@ @interface CCActionInstant : CCFiniteTimeAction { } +// XXX Needed for BridgeSupport +-(id) init; @end /** Show the node @@ -40,6 +42,8 @@ @interface CCShow : CCActionInstant { } +// XXX Needed for BridgeSupport +-(void) update:(ccTime)time; @end /** Hide the node @@ -47,6 +51,7 @@ @interface CCHide : CCActionInstant { } +-(void) update:(ccTime)time; @end /** Toggles the visibility of a node @@ -54,6 +59,7 @@ @interface CCToggleVisibility : CCActionInstant { } +-(void) update:(ccTime)time; @end /** Flips the sprite horizontally @@ -61,7 +67,7 @@ */ @interface CCFlipX : CCActionInstant { - BOOL flipX; + BOOL _flipX; } +(id) actionWithFlipX:(BOOL)x; -(id) initWithFlipX:(BOOL)x; @@ -72,7 +78,7 @@ */ @interface CCFlipY : CCActionInstant { - BOOL flipY; + BOOL _flipY; } +(id) actionWithFlipY:(BOOL)y; -(id) initWithFlipY:(BOOL)y; @@ -82,7 +88,7 @@ */ @interface CCPlace : CCActionInstant { - CGPoint position; + CGPoint _position; } /** creates a Place action with a position */ +(id) actionWithPosition: (CGPoint) pos; @@ -94,18 +100,18 @@ */ @interface CCCallFunc : CCActionInstant { - id targetCallback_; - SEL selector_; + id _targetCallback; + SEL _selector; } /** Target that will be called */ -@property (nonatomic, readwrite, retain) id targetCallback; +@property (nonatomic, readwrite, strong) id targetCallback; /** creates the action with the callback */ +(id) actionWithTarget: (id) t selector:(SEL) s; /** initializes the action with the callback */ -(id) initWithTarget: (id) t selector:(SEL) s; -/** exeuctes the callback */ +/** executes the callback */ -(void) execute; @end @@ -115,6 +121,8 @@ @interface CCCallFuncN : CCCallFunc { } +// XXX: Needed for BridgeSupport +-(void) execute; @end typedef void (*CC_CALLBACK_ND)(id, SEL, id, void *); @@ -123,8 +131,8 @@ typedef void (*CC_CALLBACK_ND)(id, SEL, id, void *); */ @interface CCCallFuncND : CCCallFuncN { - void *data_; - CC_CALLBACK_ND callbackMethod_; + void *_data; + CC_CALLBACK_ND _callbackMethod; } /** Invocation object that has the target#selector and the parameters */ @@ -142,10 +150,10 @@ typedef void (*CC_CALLBACK_ND)(id, SEL, id, void *); */ @interface CCCallFuncO : CCCallFunc { - id object_; + id _object; } /** object to be passed as argument */ -@property (nonatomic, readwrite, retain) id object; +@property (nonatomic, readwrite, strong) id object; /** creates the action with the callback and the object to pass as an argument */ +(id) actionWithTarget: (id) t selector:(SEL) s object:(id)object; @@ -160,7 +168,7 @@ typedef void (*CC_CALLBACK_ND)(id, SEL, id, void *); */ @interface CCCallBlock : CCActionInstant { - void (^block_)(); + void (^_block)(); } /** creates the action with the specified block, to be used as a callback. @@ -183,7 +191,7 @@ typedef void (*CC_CALLBACK_ND)(id, SEL, id, void *); */ @interface CCCallBlockN : CCActionInstant { - void (^block_)(CCNode *); + void (^_block)(CCNode *); } /** creates the action with the specified block, to be used as a callback. @@ -205,12 +213,12 @@ typedef void (*CC_CALLBACK_ND)(id, SEL, id, void *); */ @interface CCCallBlockO : CCActionInstant { - void (^block_)(id object); - id object_; + void (^_block)(id object); + id _object; } /** object to be passed to the block */ -@property (nonatomic,retain) id object; +@property (nonatomic,strong) id object; /** creates the action with the specified block, to be used as a callback. The block will be "copied". diff --git a/include/cocos2d/CCActionInterval.h b/include/cocos2d/CCActionInterval.h index ad13de8..564d89f 100644 --- a/include/cocos2d/CCActionInterval.h +++ b/include/cocos2d/CCActionInterval.h @@ -49,8 +49,8 @@ then running it again in Reverse mode. */ @interface CCActionInterval: CCFiniteTimeAction { - ccTime elapsed_; - BOOL firstTick_; + ccTime _elapsed; + BOOL _firstTick; } /** how many seconds had elapsed since the actions started to run. */ @@ -70,13 +70,15 @@ then running it again in Reverse mode. */ @interface CCSequence : CCActionInterval { - CCFiniteTimeAction *actions_[2]; - ccTime split_; - int last_; + CCFiniteTimeAction *_actions[2]; + ccTime _split; + int _last; } -/** helper contructor to create an array of sequenceable actions */ +/** helper constructor to create an array of sequence-able actions */ +(id) actions: (CCFiniteTimeAction*) action1, ... NS_REQUIRES_NIL_TERMINATION; -/** helper contructor to create an array of sequenceable actions given an array */ +/** helper constructor to create an array of sequence-able actions */ ++(id) actions: (CCFiniteTimeAction*) action1 vaList:(va_list) args; +/** helper constructor to create an array of sequence-able actions given an array */ +(id) actionWithArray: (NSArray*) arrayOfActions; /** creates the action */ +(id) actionOne:(CCFiniteTimeAction*)actionOne two:(CCFiniteTimeAction*)actionTwo; @@ -90,15 +92,15 @@ then running it again in Reverse mode. */ @interface CCRepeat : CCActionInterval { - NSUInteger times_; - NSUInteger total_; - ccTime nextDt_; - BOOL isActionInstant_; - CCFiniteTimeAction *innerAction_; + NSUInteger _times; + NSUInteger _total; + ccTime _nextDt; + BOOL _isActionInstant; + CCFiniteTimeAction *_innerAction; } /** Inner action */ -@property (nonatomic,readwrite,retain) CCFiniteTimeAction *innerAction; +@property (nonatomic,readwrite,strong) CCFiniteTimeAction *innerAction; /** creates a CCRepeat action. Times is an unsigned integer between 1 and MAX_UINT. */ @@ -111,12 +113,14 @@ then running it again in Reverse mode. */ @interface CCSpawn : CCActionInterval { - CCFiniteTimeAction *one_; - CCFiniteTimeAction *two_; + CCFiniteTimeAction *_one; + CCFiniteTimeAction *_two; } /** helper constructor to create an array of spawned actions */ +(id) actions: (CCFiniteTimeAction*) action1, ... NS_REQUIRES_NIL_TERMINATION; -/** helper contructor to create an array of spawned actions given an array */ +/** helper constructor to create an array of spawned actions */ ++(id) actions: (CCFiniteTimeAction*) action1 vaList:(va_list)args; +/** helper constructor to create an array of spawned actions given an array */ +(id) actionWithArray: (NSArray*) arrayOfActions; /** creates the Spawn action */ +(id) actionOne: (CCFiniteTimeAction*) one two:(CCFiniteTimeAction*) two; @@ -130,54 +134,74 @@ then running it again in Reverse mode. */ @interface CCRotateTo : CCActionInterval { - float dstAngle_; - float startAngle_; - float diffAngle_; + float _dstAngleX; + float _startAngleX; + float _diffAngleX; + + float _dstAngleY; + float _startAngleY; + float _diffAngleY; } /** creates the action */ +(id) actionWithDuration:(ccTime)duration angle:(float)angle; /** initializes the action */ -(id) initWithDuration:(ccTime)duration angle:(float)angle; + +/** creates the action with separate rotation angles */ ++(id) actionWithDuration: (ccTime) t angleX:(float) aX angleY:(float) aY; +-(id) initWithDuration: (ccTime) t angleX:(float) aX angleY:(float) aY; @end -/** Rotates a CCNode object clockwise a number of degrees by modiying its rotation attribute. +/** Rotates a CCNode object clockwise a number of degrees by modifying its rotation attribute. */ @interface CCRotateBy : CCActionInterval { - float angle_; - float startAngle_; + float _angleX; + float _startAngleX; + float _angleY; + float _startAngleY; } /** creates the action */ +(id) actionWithDuration:(ccTime)duration angle:(float)deltaAngle; /** initializes the action */ -(id) initWithDuration:(ccTime)duration angle:(float)deltaAngle; + +/** creates the action with separate rotation angles */ ++(id) actionWithDuration: (ccTime) t angleX:(float) aX angleY:(float) aY; +-(id) initWithDuration: (ccTime) t angleX:(float) aX angleY:(float) aY; @end -/** Moves a CCNode object to the position x,y. x and y are absolute coordinates by modifying its position attribute. -*/ -@interface CCMoveTo : CCActionInterval +/** Moves a CCNode object x,y pixels by modifying it's position attribute. + x and y are relative to the position of the object. + Several CCMoveBy actions can be concurrently called, and the resulting + movement will be the sum of individual movements. + @since v2.1beta2-custom + */ +@interface CCMoveBy : CCActionInterval { - CGPoint endPosition_; - CGPoint startPosition_; - CGPoint delta_; + CGPoint _positionDelta; + CGPoint _startPos; + CGPoint _previousPos; } /** creates the action */ -+(id) actionWithDuration:(ccTime)duration position:(CGPoint)position; ++(id) actionWithDuration: (ccTime)duration position:(CGPoint)deltaPosition; /** initializes the action */ --(id) initWithDuration:(ccTime)duration position:(CGPoint)position; +-(id) initWithDuration: (ccTime)duration position:(CGPoint)deltaPosition; @end -/** Moves a CCNode object x,y pixels by modifying its position attribute. - x and y are relative to the position of the object. - Duration is is seconds. -*/ -@interface CCMoveBy : CCMoveTo +/** Moves a CCNode object to the position x,y. x and y are absolute coordinates by modifying it's position attribute. + Several CCMoveTo actions can be concurrently called, and the resulting + movement will be the sum of individual movements. + @since v2.1beta2-custom + */ +@interface CCMoveTo : CCMoveBy { + CGPoint _endPosition; } /** creates the action */ -+(id) actionWithDuration: (ccTime)duration position:(CGPoint)deltaPosition; ++(id) actionWithDuration:(ccTime)duration position:(CGPoint)position; /** initializes the action */ --(id) initWithDuration: (ccTime)duration position:(CGPoint)deltaPosition; +-(id) initWithDuration:(ccTime)duration position:(CGPoint)position; @end /** Skews a CCNode object to given angles by modifying its skewX and skewY attributes @@ -185,18 +209,18 @@ then running it again in Reverse mode. */ @interface CCSkewTo : CCActionInterval { - float skewX_; - float skewY_; - float startSkewX_; - float startSkewY_; - float endSkewX_; - float endSkewY_; - float deltaX_; - float deltaY_; + float _skewX; + float _skewY; + float _startSkewX; + float _startSkewY; + float _endSkewX; + float _endSkewY; + float _deltaX; + float _deltaY; } /** creates the action */ +(id) actionWithDuration:(ccTime)t skewX:(float)sx skewY:(float)sy; -/** initializes the action */ +/** initializes the action with duration, skew X and skew Y */ -(id) initWithDuration:(ccTime)t skewX:(float)sx skewY:(float)sy; @end @@ -206,16 +230,19 @@ then running it again in Reverse mode. @interface CCSkewBy : CCSkewTo { } +/** initializes the action with duration, skew X and skew Y */ +-(id) initWithDuration:(ccTime)t skewX:(float)sx skewY:(float)sy; @end /** Moves a CCNode object simulating a parabolic jump movement by modifying its position attribute. */ - @interface CCJumpBy : CCActionInterval +@interface CCJumpBy : CCActionInterval { - CGPoint startPosition_; - CGPoint delta_; - ccTime height_; - NSUInteger jumps_; + CGPoint _startPosition; + CGPoint _delta; + ccTime _height; + NSUInteger _jumps; + CGPoint _previousPos; } /** creates the action */ +(id) actionWithDuration: (ccTime)duration position:(CGPoint)position height:(ccTime)height jumps:(NSUInteger)jumps; @@ -225,9 +252,11 @@ then running it again in Reverse mode. /** Moves a CCNode object to a parabolic position simulating a jump movement by modifying its position attribute. */ - @interface CCJumpTo : CCJumpBy +@interface CCJumpTo : CCJumpBy { } +// XXX: Added to prevent bug on BridgeSupport +-(void) startWithTarget:(id)aTarget; @end /** bezier configuration structure @@ -245,8 +274,9 @@ typedef struct _ccBezierConfig { */ @interface CCBezierBy : CCActionInterval { - ccBezierConfig config_; - CGPoint startPosition_; + ccBezierConfig _config; + CGPoint _startPosition; + CGPoint _previousPosition; } /** creates the action with a duration and a bezier configuration */ @@ -261,7 +291,10 @@ typedef struct _ccBezierConfig { */ @interface CCBezierTo : CCBezierBy { + ccBezierConfig _toConfig; } +// XXX: Added to prevent bug on BridgeSupport +-(void) startWithTarget:(id)aTarget; @end /** Scales a CCNode object to a zoom factor by modifying its scale attribute. @@ -269,14 +302,14 @@ typedef struct _ccBezierConfig { */ @interface CCScaleTo : CCActionInterval { - float scaleX_; - float scaleY_; - float startScaleX_; - float startScaleY_; - float endScaleX_; - float endScaleY_; - float deltaX_; - float deltaY_; + float _scaleX; + float _scaleY; + float _startScaleX; + float _startScaleY; + float _endScaleX; + float _endScaleY; + float _deltaX; + float _deltaY; } /** creates the action with the same scale factor for X and Y */ +(id) actionWithDuration: (ccTime)duration scale:(float) s; @@ -293,17 +326,20 @@ typedef struct _ccBezierConfig { @interface CCScaleBy : CCScaleTo { } +// XXX: Added to prevent bug on BridgeSupport +-(void) startWithTarget:(id)aTarget; @end /** Blinks a CCNode object by modifying its visible attribute */ @interface CCBlink : CCActionInterval { - NSUInteger times_; + NSUInteger _times; + BOOL _originalState; } /** creates the action */ +(id) actionWithDuration: (ccTime)duration blinks:(NSUInteger)blinks; -/** initilizes the action */ +/** initializes the action */ -(id) initWithDuration: (ccTime)duration blinks:(NSUInteger)blinks; @end @@ -313,6 +349,8 @@ typedef struct _ccBezierConfig { @interface CCFadeIn : CCActionInterval { } +// XXX: Added to prevent bug on BridgeSupport +-(void) update:(ccTime)dt; @end /** Fades Out an object that implements the CCRGBAProtocol protocol. It modifies the opacity from 255 to 0. @@ -321,6 +359,8 @@ typedef struct _ccBezierConfig { @interface CCFadeOut : CCActionInterval { } +// XXX: Added to prevent bug on BridgeSupport +-(void) update:(ccTime)dt; @end /** Fades an object that implements the CCRGBAProtocol protocol. It modifies the opacity from the current value to a custom one. @@ -328,10 +368,10 @@ typedef struct _ccBezierConfig { */ @interface CCFadeTo : CCActionInterval { - GLubyte toOpacity_; - GLubyte fromOpacity_; + GLubyte _toOpacity; + GLubyte _fromOpacity; } -/** creates an action with duration and opactiy */ +/** creates an action with duration and opacity */ +(id) actionWithDuration:(ccTime)duration opacity:(GLubyte)opactiy; /** initializes the action with duration and opacity */ -(id) initWithDuration:(ccTime)duration opacity:(GLubyte)opacity; @@ -343,8 +383,8 @@ typedef struct _ccBezierConfig { */ @interface CCTintTo : CCActionInterval { - ccColor3B to_; - ccColor3B from_; + ccColor3B _to; + ccColor3B _from; } /** creates an action with duration and color */ +(id) actionWithDuration:(ccTime)duration red:(GLubyte)red green:(GLubyte)green blue:(GLubyte)blue; @@ -357,8 +397,8 @@ typedef struct _ccBezierConfig { */ @interface CCTintBy : CCActionInterval { - GLshort deltaR_, deltaG_, deltaB_; - GLshort fromR_, fromG_, fromB_; + GLshort _deltaR, _deltaG, _deltaB; + GLshort _fromR, _fromG, _fromB; } /** creates an action with duration and color */ +(id) actionWithDuration:(ccTime)duration red:(GLshort)deltaRed green:(GLshort)deltaGreen blue:(GLshort)deltaBlue; @@ -371,18 +411,20 @@ typedef struct _ccBezierConfig { @interface CCDelayTime : CCActionInterval { } +// XXX: Added to prevent bug on BridgeSupport +-(void) update:(ccTime)dt; @end /** Executes an action in reverse order, from time=duration to time=0 @warning Use this action carefully. This action is not - sequenceable. Use it as the default "reversed" method + sequence-able. Use it as the default "reversed" method of your own actions, but using it outside the "reversed" scope is not recommended. */ @interface CCReverseTime : CCActionInterval { - CCFiniteTimeAction * other_; + CCFiniteTimeAction * _other; } /** creates the action */ +(id) actionWithAction: (CCFiniteTimeAction*) action; @@ -396,18 +438,18 @@ typedef struct _ccBezierConfig { /** Animates a sprite given the name of an Animation */ @interface CCAnimate : CCActionInterval { - NSData *splitTimes_; - NSInteger nextFrame_; - CCAnimation *animation_; - id origFrame_; - NSUInteger executedLoops_; + NSMutableArray *_splitTimes; + NSInteger _nextFrame; + CCAnimation *_animation; + id _origFrame; + NSUInteger _executedLoops; } -/** animation used for the animage */ -@property (readwrite,nonatomic,retain) CCAnimation * animation; +/** animation used for the image */ +@property (readwrite,nonatomic,strong) CCAnimation * animation; /** creates the action with an Animation and will restore the original frame when the animation is over */ +(id) actionWithAnimation:(CCAnimation*)animation; -/** initializes the action with an Animation and will restore the original frame when the animtion is over */ +/** initializes the action with an Animation and will restore the original frame when the animation is over */ -(id) initWithAnimation:(CCAnimation*)animation; @end @@ -416,11 +458,11 @@ typedef struct _ccBezierConfig { */ @interface CCTargetedAction : CCActionInterval { - id forcedTarget_; - CCFiniteTimeAction* action_; + id _forcedTarget; + CCFiniteTimeAction* _action; } /** This is the target that the action will be forced to run with */ -@property(readwrite,nonatomic,retain) id forcedTarget; +@property(readwrite,nonatomic,strong) id forcedTarget; /** Create an action with the specified action and forced target */ + (id) actionWithTarget:(id) target action:(CCFiniteTimeAction*) action; diff --git a/include/cocos2d/CCActionManager.h b/include/cocos2d/CCActionManager.h index b9eb59c..60af5e7 100644 --- a/include/cocos2d/CCActionManager.h +++ b/include/cocos2d/CCActionManager.h @@ -29,25 +29,24 @@ #import "CCAction.h" #import "ccMacros.h" -#import "Support/ccCArray.h" #import "Support/uthash.h" typedef struct _hashElement { - struct ccArray *actions; + __unsafe_unretained NSMutableArray *actions; NSUInteger actionIndex; BOOL currentActionSalvaged; BOOL paused; UT_hash_handle hh; - CC_ARC_UNSAFE_RETAINED id target; - CC_ARC_UNSAFE_RETAINED CCAction *currentAction; + __unsafe_unretained id target; + __unsafe_unretained CCAction *currentAction; } tHashElement; /** CCActionManager the object that manages all the actions. Normally you won't need to use this API directly. 99% of the cases you will use the CCNode interface, which uses this object. - But there are some cases where you might need to use this API dirctly: + But there are some cases where you might need to use this API directly: Examples: - When you want to run an action where the target is different from a CCNode. - When you want to pause / resume the actions @@ -56,8 +55,8 @@ typedef struct _hashElement */ @interface CCActionManager : NSObject { - tHashElement *targets; - tHashElement *currentTarget; + tHashElement *targets; + tHashElement *currentTarget; BOOL currentTargetSalvaged; } @@ -70,7 +69,7 @@ typedef struct _hashElement When the target is paused, the queued actions won't be 'ticked'. */ -(void) addAction: (CCAction*) action target:(id)target paused:(BOOL)paused; -/** Removes all actions from all the targers. +/** Removes all actions from all the targets. */ -(void) removeAllActions; diff --git a/include/cocos2d/CCActionPageTurn3D.h b/include/cocos2d/CCActionPageTurn3D.h index 6199aff..7afa3e1 100644 --- a/include/cocos2d/CCActionPageTurn3D.h +++ b/include/cocos2d/CCActionPageTurn3D.h @@ -38,5 +38,6 @@ @interface CCPageTurn3D : CCGrid3DAction { } - +// XXX: To make BridgeSupport happy +-(void)update:(ccTime)time; @end diff --git a/include/cocos2d/CCActionProgressTimer.h b/include/cocos2d/CCActionProgressTimer.h index 2b9e771..1e1dc62 100644 --- a/include/cocos2d/CCActionProgressTimer.h +++ b/include/cocos2d/CCActionProgressTimer.h @@ -34,8 +34,8 @@ */ @interface CCProgressTo : CCActionInterval { - float to_; - float from_; + float _to; + float _from; } /** Creates and initializes with a duration and a percent */ +(id) actionWithDuration:(ccTime)duration percent:(float)percent; @@ -49,8 +49,8 @@ */ @interface CCProgressFromTo : CCActionInterval { - float to_; - float from_; + float _to; + float _from; } /** Creates and initializes the action with a duration, a "from" percentage and a "to" percentage */ +(id) actionWithDuration:(ccTime)duration from:(float)fromPercentage to:(float) toPercentage; diff --git a/include/cocos2d/CCActionTiledGrid.h b/include/cocos2d/CCActionTiledGrid.h index 42b23a6..cd27a3b 100644 --- a/include/cocos2d/CCActionTiledGrid.h +++ b/include/cocos2d/CCActionTiledGrid.h @@ -28,14 +28,14 @@ /** CCShakyTiles3D action */ @interface CCShakyTiles3D : CCTiledGrid3DAction { - int randrange; - BOOL shakeZ; + int _randrange; + BOOL _shakeZ; } /** creates the action with a range, whether or not to shake Z vertices, a grid size, and duration */ -+(id)actionWithRange:(int)range shakeZ:(BOOL)shakeZ grid:(ccGridSize)gridSize duration:(ccTime)d; ++(id)actionWithDuration:(ccTime)duration size:(CGSize)gridSize range:(int)range shakeZ:(BOOL)shakeZ; /** initializes the action with a range, whether or not to shake Z vertices, a grid size, and duration */ --(id)initWithRange:(int)range shakeZ:(BOOL)shakeZ grid:(ccGridSize)gridSize duration:(ccTime)d; +-(id)initWithDuration:(ccTime)duration size:(CGSize)gridSize range:(int)range shakeZ:(BOOL)shakeZ; @end @@ -44,15 +44,15 @@ /** CCShatteredTiles3D action */ @interface CCShatteredTiles3D : CCTiledGrid3DAction { - int randrange; - BOOL once; - BOOL shatterZ; + int _randrange; + BOOL _once; + BOOL _shatterZ; } /** creates the action with a range, whether of not to shatter Z vertices, a grid size and duration */ -+(id)actionWithRange:(int)range shatterZ:(BOOL)shatterZ grid:(ccGridSize)gridSize duration:(ccTime)d; ++(id)actionWithDuration:(ccTime)duration size:(CGSize)gridSize range:(int)range shatterZ:(BOOL)shatterZ; /** initializes the action with a range, whether or not to shatter Z vertices, a grid size and duration */ --(id)initWithRange:(int)range shatterZ:(BOOL)shatterZ grid:(ccGridSize)gridSize duration:(ccTime)d; +-(id)initWithDuration:(ccTime)duration size:(CGSize)gridSize range:(int)range shatterZ:(BOOL)shatterZ; @end @@ -63,16 +63,16 @@ */ @interface CCShuffleTiles : CCTiledGrid3DAction { - int seed; - NSUInteger tilesCount; - int *tilesOrder; - void *tiles; + int _seed; + NSUInteger _tilesCount; + NSUInteger *_tilesOrder; + void *_tiles; } /** creates the action with a random seed, the grid size and the duration */ -+(id)actionWithSeed:(int)s grid:(ccGridSize)gridSize duration:(ccTime)d; ++(id)actionWithDuration:(ccTime)duration size:(CGSize)gridSize seed:(unsigned)seed; /** initializes the action with a random seed, the grid size and the duration */ --(id)initWithSeed:(int)s grid:(ccGridSize)gridSize duration:(ccTime)d; +-(id)initWithDuration:(ccTime)duration size:(CGSize)gridSize seed:(unsigned)seed; @end @@ -84,6 +84,8 @@ @interface CCFadeOutTRTiles : CCTiledGrid3DAction { } +// XXX: private, but added to make BridgeSupport happy +-(float)testFunc:(CGSize)pos time:(ccTime)time; @end //////////////////////////////////////////////////////////// @@ -94,6 +96,8 @@ @interface CCFadeOutBLTiles : CCFadeOutTRTiles { } +// XXX: private, but added to make BridgeSupport happy +-(float)testFunc:(CGSize)pos time:(ccTime)time; @end //////////////////////////////////////////////////////////// @@ -104,6 +108,8 @@ @interface CCFadeOutUpTiles : CCFadeOutTRTiles { } +// XXX: private, but added to make BridgeSupport happy +-(float)testFunc:(CGSize)pos time:(ccTime)time; @end //////////////////////////////////////////////////////////// @@ -114,6 +120,8 @@ @interface CCFadeOutDownTiles : CCFadeOutUpTiles { } +// XXX: private, but added to make BridgeSupport happy +-(float)testFunc:(CGSize)pos time:(ccTime)time; @end //////////////////////////////////////////////////////////// @@ -123,15 +131,15 @@ */ @interface CCTurnOffTiles : CCTiledGrid3DAction { - int seed; - NSUInteger tilesCount; - int *tilesOrder; + int _seed; + NSUInteger _tilesCount; + NSUInteger *_tilesOrder; } /** creates the action with a random seed, the grid size and the duration */ -+(id)actionWithSeed:(int)s grid:(ccGridSize)gridSize duration:(ccTime)d; ++(id)actionWithDuration:(ccTime)duration size:(CGSize)gridSize seed:(unsigned)seed; /** initializes the action with a random seed, the grid size and the duration */ --(id)initWithSeed:(int)s grid:(ccGridSize)gridSize duration:(ccTime)d; +-(id)initWithDuration:(ccTime)duration size:(CGSize)gridSize seed:(unsigned)seed; @end //////////////////////////////////////////////////////////// @@ -139,9 +147,9 @@ /** CCWavesTiles3D action. */ @interface CCWavesTiles3D : CCTiledGrid3DAction { - int waves; - float amplitude; - float amplitudeRate; + NSUInteger _waves; + float _amplitude; + float _amplitudeRate; } /** waves amplitude */ @@ -150,9 +158,9 @@ @property (nonatomic,readwrite) float amplitudeRate; /** creates the action with a number of waves, the waves amplitude, the grid size and the duration */ -+(id)actionWithWaves:(int)wav amplitude:(float)amp grid:(ccGridSize)gridSize duration:(ccTime)d; ++(id)actionWithDuration:(ccTime)duration size:(CGSize)gridSize waves:(NSUInteger)wav amplitude:(float)amp; /** initializes the action with a number of waves, the waves amplitude, the grid size and the duration */ --(id)initWithWaves:(int)wav amplitude:(float)amp grid:(ccGridSize)gridSize duration:(ccTime)d; +-(id)initWithDuration:(ccTime)duration size:(CGSize)gridSize waves:(NSUInteger)wav amplitude:(float)amp; @end @@ -163,9 +171,9 @@ */ @interface CCJumpTiles3D : CCTiledGrid3DAction { - int jumps; - float amplitude; - float amplitudeRate; + NSUInteger _jumps; + float _amplitude; + float _amplitudeRate; } /** amplitude of the sin*/ @@ -174,9 +182,9 @@ @property (nonatomic,readwrite) float amplitudeRate; /** creates the action with the number of jumps, the sin amplitude, the grid size and the duration */ -+(id)actionWithJumps:(int)j amplitude:(float)amp grid:(ccGridSize)gridSize duration:(ccTime)d; ++(id)actionWithDuration:(ccTime)duration size:(CGSize)gridSize jumps:(NSUInteger)numberOfJumps amplitude:(float)amplitude; /** initializes the action with the number of jumps, the sin amplitude, the grid size and the duration */ --(id)initWithJumps:(int)j amplitude:(float)amp grid:(ccGridSize)gridSize duration:(ccTime)d; +-(id)initWithDuration:(ccTime)duration size:(CGSize)gridSize jumps:(NSUInteger)numberOfJumps amplitude:(float)amplitude; @end @@ -185,13 +193,13 @@ /** CCSplitRows action */ @interface CCSplitRows : CCTiledGrid3DAction { - int rows; - CGSize winSize; + NSUInteger _rows; + CGSize _winSize; } /** creates the action with the number of rows to split and the duration */ -+(id)actionWithRows:(int)rows duration:(ccTime)duration; ++(id)actionWithDuration:(ccTime)duration rows:(NSUInteger)rows; /** initializes the action with the number of rows to split and the duration */ --(id)initWithRows:(int)rows duration:(ccTime)duration; +-(id)initWithDuration:(ccTime)duration rows:(NSUInteger)rows; @end @@ -200,12 +208,12 @@ /** CCSplitCols action */ @interface CCSplitCols : CCTiledGrid3DAction { - int cols; - CGSize winSize; + NSUInteger _cols; + CGSize _winSize; } /** creates the action with the number of columns to split and the duration */ -+(id)actionWithCols:(int)cols duration:(ccTime)duration; ++(id)actionWithDuration:(ccTime)duration cols:(NSUInteger)cols; /** initializes the action with the number of columns to split and the duration */ --(id)initWithCols:(int)cols duration:(ccTime)duration; +-(id)initWithDuration:(ccTime)duration cols:(NSUInteger)cols; @end diff --git a/include/cocos2d/CCActionTween.h b/include/cocos2d/CCActionTween.h index 378a828..3186e95 100644 --- a/include/cocos2d/CCActionTween.h +++ b/include/cocos2d/CCActionTween.h @@ -47,10 +47,10 @@ */ @interface CCActionTween : CCActionInterval { - NSString *key_; + NSString *_key; - float from_, to_; - float delta_; + float _from, _to; + float _delta; } /** creates an initializes the action with the property name (key), and the from and to parameters. */ diff --git a/include/cocos2d/CCAnimation.h b/include/cocos2d/CCAnimation.h index a20def3..b4a4bf4 100644 --- a/include/cocos2d/CCAnimation.h +++ b/include/cocos2d/CCAnimation.h @@ -43,18 +43,18 @@ */ @interface CCAnimationFrame : NSObject { - CCSpriteFrame* spriteFrame_; - float delayUnits_; - NSDictionary *userInfo_; + CCSpriteFrame* _spriteFrame; + float _delayUnits; + NSDictionary *_userInfo; } /** CCSpriteFrameName to be used */ -@property (nonatomic, readwrite, retain) CCSpriteFrame* spriteFrame; +@property (nonatomic, readwrite, strong) CCSpriteFrame* spriteFrame; /** how many units of time the frame takes */ @property (nonatomic, readwrite) float delayUnits; /** A CCAnimationFrameDisplayedNotification notification will be broadcasted when the frame is displayed with this dictionary as UserInfo. If UserInfo is nil, then no notification will be broadcasted. */ -@property (nonatomic, readwrite, retain) NSDictionary *userInfo; +@property (nonatomic, readwrite, strong) NSDictionary *userInfo; /** initializes the animation frame with a spriteframe, number of delay units and a notification user info */ -(id) initWithSpriteFrame:(CCSpriteFrame*)spriteFrame delayUnits:(float)delayUnits userInfo:(NSDictionary*)userInfo; @@ -70,11 +70,11 @@ */ @interface CCAnimation : NSObject { - NSMutableArray *frames_; - float totalDelayUnits_; - float delayPerUnit_; - BOOL restoreOriginalFrame_; - NSUInteger loops_; + NSMutableArray *_frames; + float _totalDelayUnits; + float _delayPerUnit; + BOOL _restoreOriginalFrame; + NSUInteger _loops; } /** total Delay units of the CCAnimation. */ @@ -84,7 +84,7 @@ /** duration in seconds of the whole animation. It is the result of totalDelayUnits * delayPerUnit */ @property (nonatomic,readonly) float duration; /** array of CCAnimationFrames */ -@property (nonatomic,readwrite,retain) NSMutableArray *frames; +@property (nonatomic,readwrite,strong) NSMutableArray *frames; /** whether or not it shall restore the original frame when the animation finishes */ @property (nonatomic,readwrite) BOOL restoreOriginalFrame; /** how many times the animation is going to loop. 0 means animation is not animated. 1, animation is executed one time, ... */ diff --git a/include/cocos2d/CCAnimationCache.h b/include/cocos2d/CCAnimationCache.h index 5488e8a..2684a86 100644 --- a/include/cocos2d/CCAnimationCache.h +++ b/include/cocos2d/CCAnimationCache.h @@ -35,10 +35,10 @@ */ @interface CCAnimationCache : NSObject { - NSMutableDictionary *animations_; + NSMutableDictionary *_animations; } -/** Retruns ths shared instance of the Animation cache */ +/** Returns the shared instance of the Animation cache */ + (CCAnimationCache *) sharedAnimationCache; /** Purges the cache. It releases all the CCAnimation objects and the shared instance. diff --git a/include/cocos2d/CCAtlasNode.h b/include/cocos2d/CCAtlasNode.h index 5360e54..091bdba 100644 --- a/include/cocos2d/CCAtlasNode.h +++ b/include/cocos2d/CCAtlasNode.h @@ -29,54 +29,52 @@ #import "CCNode.h" #import "CCProtocols.h" +@class CCTexture2D; + /** CCAtlasNode is a subclass of CCNode that implements the CCRGBAProtocol and CCTextureProtocol protocol It knows how to render a TextureAtlas object. - If you are going to render a TextureAtlas consider subclassing CCAtlasNode (or a subclass of CCAtlasNode) + If you are going to render a TextureAtlas consider sub-classing CCAtlasNode (or a subclass of CCAtlasNode) All features from CCNode are valid, plus the following features: - opacity and RGB colors */ -@interface CCAtlasNode : CCNode +@interface CCAtlasNode : CCNodeRGBA { // texture atlas - CCTextureAtlas *textureAtlas_; + CCTextureAtlas *_textureAtlas; // chars per row - NSUInteger itemsPerRow_; + NSUInteger _itemsPerRow; // chars per column - NSUInteger itemsPerColumn_; + NSUInteger _itemsPerColumn; // width of each char - NSUInteger itemWidth_; + NSUInteger _itemWidth; // height of each char - NSUInteger itemHeight_; + NSUInteger _itemHeight; // quads to draw - NSUInteger quadsToDraw_; + NSUInteger _quadsToDraw; // blend function - ccBlendFunc blendFunc_; + ccBlendFunc _blendFunc; // texture RGBA. - GLubyte opacity_; - ccColor3B color_; - ccColor3B colorUnmodified_; - BOOL opacityModifyRGB_; + ccColor3B _colorUnmodified; + BOOL _opacityModifyRGB; // color uniform - GLint uniformColor_; + GLint _uniformColor; } /** conforms to CCTextureProtocol protocol */ -@property (nonatomic,readwrite,retain) CCTextureAtlas *textureAtlas; +@property (nonatomic,readwrite,strong) CCTextureAtlas *textureAtlas; /** conforms to CCTextureProtocol protocol */ @property (nonatomic,readwrite) ccBlendFunc blendFunc; -/** conforms to CCRGBAProtocol protocol */ -@property (nonatomic,readwrite) GLubyte opacity; /** conforms to CCRGBAProtocol protocol */ @property (nonatomic,readwrite) ccColor3B color; @@ -89,8 +87,12 @@ /** initializes an CCAtlasNode with an Atlas file the width and height of each item measured in points and the quantity of items to render*/ -(id) initWithTileFile:(NSString*)tile tileWidth:(NSUInteger)w tileHeight:(NSUInteger)h itemsToRender: (NSUInteger) c; +/** initializes an CCAtlasNode with a texture the width and height of each item measured in points and the quantity of items to render*/ +-(id) initWithTexture:(CCTexture2D*)texture tileWidth:(NSUInteger)w tileHeight:(NSUInteger)h itemsToRender: (NSUInteger) c; + + /** updates the Atlas (indexed vertex array). - * Shall be overriden in subclasses + * Shall be overridden in subclasses */ -(void) updateAtlasValues; @end diff --git a/include/cocos2d/CCCamera.h b/include/cocos2d/CCCamera.h index 415caf7..9366ef5 100644 --- a/include/cocos2d/CCCamera.h +++ b/include/cocos2d/CCCamera.h @@ -26,7 +26,10 @@ #import "CCNode.h" +#pragma clang diagnostic push COCOS2D +#pragma clang diagnostic ignored "-Wignored-qualifiers" #import "kazmath/mat4.h" +#pragma clang diagnostic pop COCOS2D /** A CCCamera is used in every CCNode. @@ -47,27 +50,27 @@ - It doesn't work on batched nodes like CCSprite objects when they are parented to a CCSpriteBatchNode object. - - It is recommended to use it ONLY if you are going to create 3D effects. For 2D effecs, use the action CCFollow or position/scale/rotate. + - It is recommended to use it ONLY if you are going to create 3D effects. For 2D effects, use the action CCFollow or position/scale/rotate. */ @interface CCCamera : NSObject { - float eyeX_; - float eyeY_; - float eyeZ_; + float _eyeX; + float _eyeY; + float _eyeZ; - float centerX_; - float centerY_; - float centerZ_; + float _centerX; + float _centerY; + float _centerZ; - float upX_; - float upY_; - float upZ_; + float _upX; + float _upY; + float _upZ; - BOOL dirty_; + BOOL _dirty; - kmMat4 lookupMatrix_; + kmMat4 _lookupMatrix; } /** whether of not the camera is dirty */ diff --git a/include/cocos2d/CCClippingNode.h b/include/cocos2d/CCClippingNode.h new file mode 100644 index 0000000..f454901 --- /dev/null +++ b/include/cocos2d/CCClippingNode.h @@ -0,0 +1,77 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2012 Pierre-David Bélanger + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + */ + +#import "CCNode.h" + +/** CCClippingNode is a subclass of CCNode. + It draws its content (childs) clipped using a stencil. + The stencil is an other CCNode that will not be drawn. + The clipping is done using the alpha part of the stencil (adjusted with an alphaThreshold). + */ +@interface CCClippingNode : CCNode +{ + CCNode *_stencil; + GLfloat _alphaThreshold; + BOOL _inverted; +} + +/** The CCNode to use as a stencil to do the clipping. + The stencil node will be retained. + This default to nil. + */ +@property (nonatomic, strong) CCNode *stencil; + +/** The alpha threshold. + The content is drawn only where the stencil have pixel with alpha greater than the alphaThreshold. + Should be a float between 0 and 1. + This default to 1 (so alpha test is disabled). + */ +@property (nonatomic) GLfloat alphaThreshold; + +/** Inverted. If this is set to YES, + the stencil is inverted, so the content is drawn where the stencil is NOT drawn. + This default to NO. + */ +@property (nonatomic) BOOL inverted; + +/** Creates and initializes a clipping node without a stencil. + */ ++ (id)clippingNode; + +/** Creates and initializes a clipping node with an other node as its stencil. + The stencil node will be retained. + */ ++ (id)clippingNodeWithStencil:(CCNode *)stencil; + +/** Initializes a clipping node without a stencil. + */ +- (id)init; + +/** Initializes a clipping node with an other node as its stencil. + The stencil node will be retained, and its parent will be set to this clipping node. + */ +- (id)initWithStencil:(CCNode *)stencil; + +@end diff --git a/include/cocos2d/CCConfiguration.h b/include/cocos2d/CCConfiguration.h index 1d728dd..5ca15c0 100644 --- a/include/cocos2d/CCConfiguration.h +++ b/include/cocos2d/CCConfiguration.h @@ -51,30 +51,41 @@ enum { kCCMacVersion_10_8 = 0x0a080000, }; +enum { + kCCDeviceiPhone, + kCCDeviceiPhoneRetinaDisplay, + kCCDeviceiPhone5, + kCCDeviceiPhone5RetinaDisplay, + kCCDeviceiPad, + kCCDeviceiPadRetinaDisplay, + + kCCDeviceMac, + kCCDeviceMacRetinaDisplay, +}; + /** CCConfiguration contains some openGL variables @since v0.99.0 */ @interface CCConfiguration : NSObject { - GLint maxTextureSize_; - GLint maxModelviewStackDepth_; - BOOL supportsPVRTC_; - BOOL supportsNPOT_; - BOOL supportsBGRA8888_; - BOOL supportsDiscardFramebuffer_; - BOOL supportsShareableVAO_; - unsigned int OSVersion_; - GLint maxSamplesAllowed_; - GLint maxTextureUnits_; + BOOL _openGLInitialized; + + GLint _maxTextureSize; + BOOL _supportsPVRTC; + BOOL _supportsNPOT; + BOOL _supportsBGRA8888; + BOOL _supportsDiscardFramebuffer; + BOOL _supportsShareableVAO; + GLint _maxSamplesAllowed; + GLint _maxTextureUnits; + + unsigned int _OSVersion; } /** OpenGL Max texture size. */ @property (nonatomic, readonly) GLint maxTextureSize; -/** OpenGL Max Modelview Stack Depth. */ -@property (nonatomic, readonly) GLint maxModelviewStackDepth; - /** returns the maximum texture units @since v2.0.0 */ @@ -115,12 +126,19 @@ enum { */ @property (nonatomic, readonly) unsigned int OSVersion; + /** returns a shared instance of the CCConfiguration */ +(CCConfiguration *) sharedConfiguration; /** returns whether or not an OpenGL is supported */ - (BOOL) checkForGLExtension:(NSString *)searchName; +/** returns the current device */ +-(NSInteger) runningDevice; +/** dumps in the console the CCConfiguration information. + @since v2.1 + */ +-(void) dumpInfo; @end diff --git a/include/cocos2d/CCDirector.h b/include/cocos2d/CCDirector.h index 332bf07..df5b35b 100644 --- a/include/cocos2d/CCDirector.h +++ b/include/cocos2d/CCDirector.h @@ -27,11 +27,16 @@ #import "ccConfig.h" #import "ccTypes.h" #import "ccMacros.h" + #import "CCProtocols.h" #import "Platforms/CCGL.h" + +#pragma clang diagnostic push COCOS2D +#pragma clang diagnostic ignored "-Wignored-qualifiers" #import "kazmath/mat4.h" +#pragma clang diagnostic pop COCOS2D -#import "CCTransitionOrientationType.h" +#import "CCResponderManager.h" /** @typedef ccDirectorProjection Possible OpenGL projections used by director @@ -56,7 +61,7 @@ typedef enum { @class CCScene; @class CCScheduler; @class CCActionManager; - +@class CCTransition; #ifdef __CC_PLATFORM_IOS #define CC_VIEWCONTROLLER UIViewController @@ -67,7 +72,7 @@ typedef enum { /**Class that creates and handle the main Window and manages how and when to execute the Scenes. - The CCDirector is also resposible for: + The CCDirector is also responsible for: - initializing the OpenGL ES context - setting the OpenGL pixel format (default on is RGB565) - setting the OpenGL buffer depth (default one is 0-bit) @@ -85,74 +90,74 @@ and when to execute the Scenes. @interface CCDirector : CC_VIEWCONTROLLER { // internal timer - NSTimeInterval animationInterval_; - NSTimeInterval oldAnimationInterval_; + NSTimeInterval _animationInterval; + NSTimeInterval _oldAnimationInterval; /* stats */ - BOOL displayStats_; + BOOL _displayStats; - NSUInteger frames_; - NSUInteger totalFrames_; - ccTime secondsPerFrame_; + NSUInteger _frames; + NSUInteger _totalFrames; + ccTime _secondsPerFrame; - ccTime accumDt_; - ccTime frameRate_; - CCLabelAtlas *FPSLabel_; - CCLabelAtlas *SPFLabel_; - CCLabelAtlas *drawsLabel_; + ccTime _accumDt; + ccTime _frameRate; + CCLabelAtlas *_FPSLabel; + CCLabelAtlas *_SPFLabel; + CCLabelAtlas *_drawsLabel; /* is the running scene paused */ - BOOL isPaused_; + BOOL _isPaused; /* Is the director running */ - BOOL isAnimating_; + BOOL _isAnimating; /* The running scene */ - CCScene *runningScene_; + CCScene *_runningScene; /* This object will be visited after the scene. Useful to hook a notification node */ - id notificationNode_; + id _notificationNode; /* will be the next 'runningScene' in the next frame nextScene is a weak reference. */ - CCScene *nextScene_; + CCScene *_nextScene; /* If YES, then "old" scene will receive the cleanup message */ - BOOL sendCleanupToScene_; + BOOL _sendCleanupToScene; /* scheduled scenes */ - NSMutableArray *scenesStack_; + NSMutableArray *_scenesStack; /* last time the main loop was updated */ - struct timeval lastUpdate_; + struct timeval _lastUpdate; /* delta time since last tick to main loop */ - ccTime dt; + ccTime _dt; /* whether or not the next delta time will be zero */ - BOOL nextDeltaTimeZero_; + BOOL _nextDeltaTimeZero; /* projection used */ - ccDirectorProjection projection_; + ccDirectorProjection _projection; /* CCDirector delegate */ - id delegate_; + id __unsafe_unretained _delegate; /* window size in points */ - CGSize winSizeInPoints_; + CGSize _winSizeInPoints; /* window size in pixels */ - CGSize winSizeInPixels_; + CGSize _winSizeInPixels; /* the cocos2d running thread */ - NSThread *runningThread_; + NSThread *__unsafe_unretained _runningThread; /* scheduler associated with this director */ - CCScheduler *scheduler_; + CCScheduler *_scheduler; /* action manager associated with this director */ - CCActionManager *actionManager_; + CCActionManager *_actionManager; /* OpenGLView. On iOS it is a copy of self.view */ - CCGLView *view_; + CCGLView *__view; } /** returns the cocos2d thread. @@ -170,7 +175,7 @@ and when to execute the Scenes. /** whether or not the next delta time will be zero */ @property (nonatomic,readwrite,assign) BOOL nextDeltaTimeZero; /** Whether or not the Director is paused */ -@property (nonatomic,readonly) BOOL isPaused; +@property (nonatomic,readonly,getter=isPaused) BOOL paused; /** Whether or not the Director is active (animating) */ @property (nonatomic,readonly) BOOL isAnimating; /** Sets an OpenGL projection */ @@ -180,6 +185,12 @@ and when to execute the Scenes. /** seconds per frame */ @property (nonatomic, readonly) ccTime secondsPerFrame; +/** Sets the touch manager + @since v2.5 + */ +@property ( nonatomic, strong ) CCResponderManager* responderManager; + + /** Whether or not the replaced scene will receive the cleanup message. If the new scene is pushed, then the old scene won't receive the "cleanup" message. If the new scene replaces the old one, the it will receive the "cleanup" message. @@ -192,22 +203,27 @@ and when to execute the Scenes. Useful to hook a notification object, like CCNotifications (http://github.com/manucorporat/CCNotifications) @since v0.99.5 */ -@property (nonatomic, readwrite, retain) id notificationNode; +@property (nonatomic, readwrite, strong) id notificationNode; -/** CCDirector delegate. It shall implemente the CCDirectorDelegate protocol +/** CCDirector delegate. It shall implement the CCDirectorDelegate protocol @since v0.99.5 */ -@property (nonatomic, readwrite, retain) id delegate; +@property (nonatomic, readwrite, unsafe_unretained) id delegate; /** CCScheduler associated with this director @since v2.0 */ -@property (nonatomic,readwrite,retain) CCScheduler *scheduler; +@property (nonatomic,readwrite,strong) CCScheduler *scheduler; /** CCActionManager associated with this director @since v2.0 */ -@property (nonatomic,readwrite,retain) CCActionManager *actionManager; +@property (nonatomic,readwrite,strong) CCActionManager *actionManager; + +/** Position scaling factor, default is 2 for tablets and 1 for phones. Positions and content sizes are scale by this factor if the position type is set to scale. + @since v2.5 + */ +@property (nonatomic,readwrite,assign) float positionScaleFactor; /** returns a shared instance of the director */ +(CCDirector*)sharedDirector; @@ -227,8 +243,11 @@ and when to execute the Scenes. /** changes the projection size */ -(void) reshapeProjection:(CGSize)newWindowSize; +/** Sets the glViewport*/ +-(void) setViewport; + /** converts a UIKit coordinate to an OpenGL coordinate - Useful to convert (multi) touchs coordinates to the current layout (portrait or landscape) + Useful to convert (multi) touch coordinates to the current layout (portrait or landscape) */ -(CGPoint) convertToGL: (CGPoint) p; /** converts an OpenGL coordinate to a UIKit coordinate @@ -241,7 +260,7 @@ and when to execute the Scenes. #pragma mark Director - Scene Management -/**Enters the Director's main loop with the given Scene. +/** Enters the Director's main loop with the given Scene. * Call it to run only your FIRST scene. * Don't call it if there is already a running scene. * @@ -249,77 +268,72 @@ and when to execute the Scenes. */ - (void) runWithScene:(CCScene*) scene; -/**Suspends the execution of the running scene, pushing it on the stack of suspended scenes. +/** Suspends the execution of the running scene, pushing it on the stack of suspended scenes. * The new scene will be executed. * Try to avoid big stacks of pushed scenes to reduce memory allocation. * ONLY call it if there is a running scene. */ - (void) pushScene:(CCScene*) scene; -/**Suspends the execution of the running scene, pushing it on the stack of suspended scenes. - * The new scene will be executed and is going to be presented using a scene transition effect. - * Try to avoid big stacks of pushed scenes to reduce memory allocation. +/** Pops out a scene from the queue. + * This scene will replace the running one. + * The running scene will be deleted. If there are no more scenes in the stack the execution is terminated. * ONLY call it if there is a running scene. */ --(void) pushScene:(CCScene*) scene withTransition:(NSString*)transitionName duration:(ccTime)t; +- (void) popScene; -/**Suspends the execution of the running scene, pushing it on the stack of suspended scenes. - * The new scene will be executed and is going to be presented using a scene transition effect. - * Try to avoid big stacks of pushed scenes to reduce memory allocation. - * ONLY call it if there is a running scene. +/**Pops out all scenes from the queue until the root scene in the queue. + * This scene will replace the running one. + * Internally it will call `popToSceneStackLevel:1` */ --(void) pushScene:(CCScene*) scene withTransition:(NSString*)transitionName duration:(ccTime)t - withColor:(ccColor3B)color; +- (void) popToRootScene; -/**Suspends the execution of the running scene, pushing it on the stack of suspended scenes. - * The new scene will be executed and is going to be presented using a scene transition effect. - * Try to avoid big stacks of pushed scenes to reduce memory allocation. - * ONLY call it if there is a running scene. +/** Pops out all scenes from the queue until it reaches `level`. + If level is 0, it will end the director. + If level is 1, it will pop all scenes until it reaches to root scene. + If level is <= than the current stack level, it won't do anything. */ --(void) pushScene:(CCScene*) scene withTransition:(NSString*)transitionName duration:(ccTime)t - withOrientation:(tOrientation)orientation; +-(void) popToSceneStackLevel:(NSUInteger)level; -/**Pops out a scene from the queue. - * This scene will replace the running one. - * The running scene will be deleted. If there are no more scenes in the stack the execution is terminated. - * ONLY call it if there is a running scene. - */ -- (void) popScene; - -/**Pops out a scene from the queue. - * This scene will replace the running one using a scene transition effect. - * The running scene will be deleted. If there are no more scenes in the stack the execution is terminated. +/** Replaces the running scene with a new one. The running scene is terminated. * ONLY call it if there is a running scene. */ --(void) popSceneWithTransition:(NSString*)transitionName duration:(ccTime)t; +-(void) replaceScene: (CCScene*) scene; -/**Pops out a scene from the queue. - * This scene will replace the running one using a scene transition effect. - * The running scene will be deleted. If there are no more scenes in the stack the execution is terminated. - * ONLY call it if there is a running scene. +/** + * Presents a new scene by either starting first scene, or replacing the running + * + * @param scene The scene to present + * @since v2.5 */ --(void) popSceneWithTransition:(NSString*)transitionName duration:(ccTime)t - withColor:(ccColor3B)color; +//- (void)presentScene:(CCScene *)scene; -/**Pops out a scene from the queue. - * This scene will replace the running one using a scene transition effect. - * The running scene will be deleted. If there are no more scenes in the stack the execution is terminated. - * ONLY call it if there is a running scene. +/** + * Presents a new scene by either starting first scene, or replacing the running + * Performs a transition between the outgoing and the incoming scene + * + * @param scene The incoming scene + * @param transition The transition to perform + * @since v2.5 */ --(void) popSceneWithTransition:(NSString*)transitionName duration:(ccTime)t - withOrientation:(tOrientation)orientation; +- (void)replaceScene:(CCScene *)scene withTransition:(CCTransition *)transition; -/**Pops out all scenes from the queue until the root scene in the queue. - * This scene will replace the running one. - * The running scene will be deleted. If there are no more scenes in the stack the execution is terminated. - * ONLY call it if there is a running scene. +/** + * Pushes the running scene onto the scene stack, and presents the incoming scene, using a transition + * + * @param scene The scene to present + * @param transition The transition to use + * @since v2.5 */ -- (void) popToRootScene; +- (void)pushScene:(CCScene *)scene withTransition:(CCTransition *)transition; -/** Replaces the running scene with a new one. The running scene is terminated. - * ONLY call it if there is a running scene. +/** + * Replaces the running scene, with the last scene pushed to the stack, using a transition + * + * @param transition The transition to use + * @since v2.5 */ --(void) replaceScene: (CCScene*) scene; +- (void)popScenewithTransition:(CCTransition *)transition; /** Ends the execution, releases the running scene. It doesn't remove the OpenGL view from its parent. You have to do it manually. @@ -328,7 +342,7 @@ and when to execute the Scenes. /** Pauses the running scene. The running scene will be _drawed_ but all scheduled timers will be paused - While paused, the draw rate will be 4 FPS to reduce CPU consuption + While paused, the draw rate will be 4 FPS to reduce CPU consumption */ -(void) pause; @@ -339,13 +353,13 @@ and when to execute the Scenes. -(void) resume; /** Stops the animation. Nothing will be drawn. The main loop won't be triggered anymore. - If you wan't to pause your animation call [pause] instead. + If you want to pause your animation call [pause] instead. */ -(void) stopAnimation; /** The main loop is triggered again. Call this function only if [stopAnimation] was called earlier - @warning Dont' call this function to start the main loop. To run the main loop call runWithScene + @warning Don't call this function to start the main loop. To run the main loop call runWithScene */ -(void) startAnimation; diff --git a/include/cocos2d/CCDrawNode.h b/include/cocos2d/CCDrawNode.h new file mode 100644 index 0000000..3fa4034 --- /dev/null +++ b/include/cocos2d/CCDrawNode.h @@ -0,0 +1,65 @@ +/* Copyright (c) 2012 Scott Lembcke and Howling Moon Software + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +/* + * Code copied & pasted from SpacePatrol game https://github.com/slembcke/SpacePatrol + * + * Renamed and added some changes for cocos2d + * + */ + +#import "CCNode.h" + +/** CCDrawNode + Node that draws dots, segments and polygons. + Faster than the "drawing primitives" since they it draws everything in one single batch. + + @since v2.1 + */ +@interface CCDrawNode : CCNode +{ + GLuint _vao; + GLuint _vbo; + + NSUInteger _bufferCapacity; + GLsizei _bufferCount; + ccV2F_C4B_T2F *_buffer; + + ccBlendFunc _blendFunc; + + BOOL _dirty; +} + +@property(nonatomic, assign) ccBlendFunc blendFunc; + +/** draw a dot at a position, with a given radius and color */ +-(void)drawDot:(CGPoint)pos radius:(CGFloat)radius color:(ccColor4F)color; + +/** draw a segment with a radius and color */ +-(void)drawSegmentFrom:(CGPoint)a to:(CGPoint)b radius:(CGFloat)radius color:(ccColor4F)color; + +/** draw a polygon with a fill color and line color */ +-(void)drawPolyWithVerts:(const CGPoint*)verts count:(NSUInteger)count fillColor:(ccColor4F)fill borderWidth:(CGFloat)width borderColor:(ccColor4F)line; + +/** Clear the geometry in the node's buffer. */ +-(void)clear; + +@end diff --git a/include/cocos2d/CCDrawingPrimitives.h b/include/cocos2d/CCDrawingPrimitives.h index e91ea54..1e48627 100644 --- a/include/cocos2d/CCDrawingPrimitives.h +++ b/include/cocos2d/CCDrawingPrimitives.h @@ -3,6 +3,7 @@ * * Copyright (c) 2008-2010 Ricardo Quesada * Copyright (c) 2011 Zynga Inc. + * Copyright (c) 2013 Nader Eloshaiker * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -24,6 +25,17 @@ */ +/* + * + * IMPORTANT IMPORTANT IMPORTANT IMPORTANT + * + * + * LEGACY FUNCTIONS + * + * USE CCDrawNode instead + * + */ + #ifndef __CC_DRAWING_PRIMITIVES_H #define __CC_DRAWING_PRIMITIVES_H @@ -47,20 +59,33 @@ extern "C" { /** @file Drawing OpenGL ES primitives. - - ccDrawPoint + - ccDrawPoint, ccDrawPoints - ccDrawLine - - ccDrawPoly - - ccDrawCircle + - ccDrawRect, ccDrawSolidRect + - ccDrawPoly, ccDrawSolidPoly + - ccDrawCircle, ccDrawSolidCircle + - ccDrawArc, ccDrawSolidArc - ccDrawQuadBezier - ccDrawCubicBezier + - ccDrawCatmullRom + - ccDrawCardinalSpline - You can change the color, width and other property by calling the - glColor4ub(), glLineWidth(), glPointSize(). + You can change the color, point size, width by calling: + - ccDrawColor4B(), ccDrawColor4F() + - ccPointSize() + - glLineWidth() - @warning These functions draws the Line, Point, Polygon, immediately. They aren't batched. If you are going to make a game that depends on these primitives, I suggest creating a batch. + @warning These functions draws the Line, Point, Polygon, immediately. They aren't batched. If you are going to make a game that depends on these primitives, I suggest creating a batch. Instead you should use CCDrawNode + */ +/** Initializes the drawing primitives */ +void ccDrawInit(void); + +/** Frees allocated resources by the drawing primitives */ +void ccDrawFree(void); + /** draws a point given x and y coordinate measured in points. */ void ccDrawPoint( CGPoint point ); @@ -80,18 +105,27 @@ void ccDrawRect( CGPoint origin, CGPoint destination ); */ void ccDrawSolidRect( CGPoint origin, CGPoint destination, ccColor4F color ); -/** draws a poligon given a pointer to CGPoint coordiantes and the number of vertices measured in points. +/** draws a polygon given a pointer to CGPoint coordinates and the number of vertices measured in points. The polygon can be closed or open */ void ccDrawPoly( const CGPoint *vertices, NSUInteger numOfVertices, BOOL closePolygon ); -/** draws a solid polygon given a pointer to CGPoint coordiantes, the number of vertices measured in points, and a color. +/** draws a solid polygon given a pointer to CGPoint coordinates, the number of vertices measured in points, and a color. */ void ccDrawSolidPoly( const CGPoint *poli, NSUInteger numberOfPoints, ccColor4F color ); /** draws a circle given the center, radius and number of segments measured in points */ void ccDrawCircle( CGPoint center, float radius, float angle, NSUInteger segments, BOOL drawLineToCenter); +/** draws a solid circle given the center, radius and number of segments measured in points */ +void ccDrawSolidCircle( CGPoint center, float radius, NSUInteger segments); + +/** draws a arc given the center, radius, arc length and number of segments measured in points */ +void ccDrawArc(CGPoint center, CGFloat r, CGFloat a, CGFloat arcLength, NSUInteger segs, BOOL drawLineToCenter); + +/** draws a solid arc given the center, radius, arc length and number of segments measured in points */ +void ccDrawSolidArc(CGPoint center, CGFloat r, CGFloat a, CGFloat arcLength, NSUInteger segs); + /** draws a quad bezier path measured in points. @warning This function could be pretty slow. Use it only for debugging purposes. @since v0.8 diff --git a/include/cocos2d/CCGLProgram.h b/include/cocos2d/CCGLProgram.h index 6631cf0..285817a 100644 --- a/include/cocos2d/CCGLProgram.h +++ b/include/cocos2d/CCGLProgram.h @@ -40,7 +40,13 @@ enum { }; enum { + kCCUniformPMatrix, + kCCUniformMVMatrix, kCCUniformMVPMatrix, + kCCUniformTime, + kCCUniformSinTime, + kCCUniformCosTime, + kCCUniformRandom01, kCCUniformSampler, kCCUniform_MAX, @@ -53,11 +59,18 @@ enum { #define kCCShader_PositionTexture_uColor @"ShaderPositionTexture_uColor" #define kCCShader_PositionTextureA8Color @"ShaderPositionTextureA8Color" #define kCCShader_Position_uColor @"ShaderPosition_uColor" +#define kCCShader_PositionLengthTexureColor @"ShaderPositionLengthTextureColor" // uniform names -#define kCCUniformMVPMatrix_s "u_MVPMatrix" -#define kCCUniformSampler_s "u_texture" -#define kCCUniformAlphaTestValue "u_alpha_value" +#define kCCUniformPMatrix_s "CC_PMatrix" +#define kCCUniformMVMatrix_s "CC_MVMatrix" +#define kCCUniformMVPMatrix_s "CC_MVPMatrix" +#define kCCUniformTime_s "CC_Time" +#define kCCUniformSinTime_s "CC_SinTime" +#define kCCUniformCosTime_s "CC_CosTime" +#define kCCUniformRandom01_s "CC_Random01" +#define kCCUniformSampler_s "CC_Texture0" +#define kCCUniformAlphaTestValue_s "CC_AlphaValue" // Attribute names #define kCCAttributeNameColor @"a_color" @@ -75,16 +88,31 @@ struct _hashUniformEntry; */ @interface CCGLProgram : NSObject { - struct _hashUniformEntry *hashForUniforms_; + struct _hashUniformEntry *_hashForUniforms; @public - GLuint program_, - vertShader_, - fragShader_; - - GLint uniforms_[kCCUniform_MAX]; + GLuint _program, + _vertShader, + _fragShader; + + GLint _uniforms[kCCUniform_MAX]; + + struct { + unsigned int usesTime:1; + unsigned int usesMVP:1; + unsigned int usesMV:1; + unsigned int usesRandom:1; + } _flags; } +@property(nonatomic, readonly) GLuint program; + +/** creates the CCGLProgram with a vertex and fragment from byte arrays */ ++ (id)programWithVertexShaderByteArray:(const GLchar*)vShaderByteArray fragmentShaderByteArray:(const GLchar*)fShaderByteArray; + +/** creates the CCGLProgram with a vertex and fragment with contents of filenames */ ++ (id)programWithVertexShaderFilename:(NSString *)vShaderFilename fragmentShaderFilename:(NSString *)fShaderFilename; + /** Initializes the CCGLProgram with a vertex and fragment with bytes array */ - (id)initWithVertexShaderByteArray:(const GLchar*)vShaderByteArray fragmentShaderByteArray:(const GLchar*)fShaderByteArray; @@ -100,47 +128,51 @@ struct _hashUniformEntry; /** it will call glUseProgram() */ - (void)use; -/** It will create 3 uniforms: +/** It will create 4 uniforms: - kCCUniformPMatrix - kCCUniformMVMatrix + - kCCUniformMVPMatrix - kCCUniformSampler And it will bind "kCCUniformSampler" to 0 */ - (void) updateUniforms; +/** calls retrieves the named uniform location for this shader program. */ +- (GLint)uniformLocationForName:(NSString*)name; + /** calls glUniform1i only if the values are different than the previous call for this same shader program. */ --(void) setUniformLocation:(NSUInteger)location withI1:(GLint)i1; +-(void) setUniformLocation:(GLint)location withI1:(GLint)i1; /** calls glUniform1f only if the values are different than the previous call for this same shader program. */ --(void) setUniformLocation:(NSUInteger)location withF1:(GLfloat)f1; +-(void) setUniformLocation:(GLint)location withF1:(GLfloat)f1; /** calls glUniform2f only if the values are different than the previous call for this same shader program. */ --(void) setUniformLocation:(NSUInteger)location withF1:(GLfloat)f1 f2:(GLfloat)f2; +-(void) setUniformLocation:(GLint)location withF1:(GLfloat)f1 f2:(GLfloat)f2; /** calls glUniform3f only if the values are different than the previous call for this same shader program. */ --(void) setUniformLocation:(NSUInteger)location withF1:(GLfloat)f1 f2:(GLfloat)f2 f3:(GLfloat)f3; +-(void) setUniformLocation:(GLint)location withF1:(GLfloat)f1 f2:(GLfloat)f2 f3:(GLfloat)f3; /** calls glUniform4f only if the values are different than the previous call for this same shader program. */ --(void) setUniformLocation:(NSUInteger)location withF1:(GLfloat)f1 f2:(GLfloat)f2 f3:(GLfloat)f3 f4:(GLfloat)f4; +-(void) setUniformLocation:(GLint)location withF1:(GLfloat)f1 f2:(GLfloat)f2 f3:(GLfloat)f3 f4:(GLfloat)f4; /** calls glUniform2fv only if the values are different than the previous call for this same shader program. */ --(void) setUniformLocation:(NSUInteger)location with2fv:(GLfloat*)floats count:(NSUInteger)numberOfArrays; +-(void) setUniformLocation:(GLint)location with2fv:(GLfloat*)floats count:(NSUInteger)numberOfArrays; /** calls glUniform3fv only if the values are different than the previous call for this same shader program. */ --(void) setUniformLocation:(NSUInteger)location with3fv:(GLfloat*)floats count:(NSUInteger)numberOfArrays; +-(void) setUniformLocation:(GLint)location with3fv:(GLfloat*)floats count:(NSUInteger)numberOfArrays; /** calls glUniform4fv only if the values are different than the previous call for this same shader program. */ --(void) setUniformLocation:(NSUInteger)location with4fv:(GLvoid*)floats count:(NSUInteger)numberOfArrays; +-(void) setUniformLocation:(GLint)location with4fv:(GLvoid*)floats count:(NSUInteger)numberOfArrays; /** calls glUniformMatrix4fv only if the values are different than the previous call for this same shader program. */ --(void) setUniformLocation:(NSUInteger)location withMatrix4fv:(GLvoid*)matrix_array count:(NSUInteger)numberOfMatrix; +-(void) setUniformLocation:(GLint)location withMatrix4fv:(GLvoid*)matrix_array count:(NSUInteger)numberOfMatrix; -/** will update the MVP matrix on the MVP uniform if it is different than the previous call for this same shader program. */ --(void) setUniformForModelViewProjectionMatrix; +/** will update the builtin uniforms if they are different than the previous call for this same shader program. */ +-(void) setUniformsForBuiltins; -/** calls glGetUniformLocation only if the shader program has been properly initialized **/ -- (GLint)uniformLocationForName:(NSString*)name; +/** Deprecated alias for setUniformsForBuiltins */ +-(void)setUniformForModelViewProjectionMatrix __attribute__((__deprecated__)); /** returns the vertexShader error log */ - (NSString *)vertexShaderLog; diff --git a/include/cocos2d/CCGrabber.h b/include/cocos2d/CCGrabber.h index 5b086c6..06bb210 100644 --- a/include/cocos2d/CCGrabber.h +++ b/include/cocos2d/CCGrabber.h @@ -32,8 +32,8 @@ /** FBO class that grabs the the contents of the screen */ @interface CCGrabber : NSObject { - GLuint fbo_; - GLint oldFBO_; + GLuint _FBO; + GLint _oldFBO; GLfloat oldClearColor_[4]; } diff --git a/include/cocos2d/CCGrid.h b/include/cocos2d/CCGrid.h index df8fa34..fee4b59 100644 --- a/include/cocos2d/CCGrid.h +++ b/include/cocos2d/CCGrid.h @@ -27,10 +27,13 @@ #import #import "CCNode.h" -#import "CCCamera.h" #import "ccTypes.h" #import "CCDirector.h" + +#pragma clang diagnostic push COCOS2D +#pragma clang diagnostic ignored "-Wignored-qualifiers" #import "kazmath/mat4.h" +#pragma clang diagnostic pop COCOS2D @class CCTexture2D; @class CCGrabber; @@ -40,41 +43,41 @@ */ @interface CCGridBase : NSObject { - BOOL active_; - int reuseGrid_; - ccGridSize gridSize_; - CCTexture2D *texture_; - CGPoint step_; - CCGrabber *grabber_; - BOOL isTextureFlipped_; + BOOL _active; + int _reuseGrid; + CGSize _gridSize; + CCTexture2D *_texture; + CGPoint _step; + CCGrabber *_grabber; + BOOL _isTextureFlipped; - CCGLProgram *shaderProgram_; + CCGLProgram *__unsafe_unretained _shaderProgram; - ccDirectorProjection directorProjection_; + ccDirectorProjection _directorProjection; } -/** wheter or not the grid is active */ +/** whether or not the grid is active */ @property (nonatomic,readwrite) BOOL active; /** number of times that the grid will be reused */ @property (nonatomic,readwrite) int reuseGrid; /** size of the grid */ -@property (nonatomic,readonly) ccGridSize gridSize; +@property (nonatomic,readonly) CGSize gridSize; /** pixels between the grids */ @property (nonatomic,readwrite) CGPoint step; /** texture used */ -@property (nonatomic, retain) CCTexture2D *texture; +@property (nonatomic, strong) CCTexture2D *texture; /** grabber used */ -@property (nonatomic, retain) CCGrabber *grabber; +@property (nonatomic, strong) CCGrabber *grabber; /** is texture flipped */ @property (nonatomic, readwrite) BOOL isTextureFlipped; /** shader program */ -@property (nonatomic, readwrite, assign) CCGLProgram *shaderProgram; +@property (nonatomic, readwrite, unsafe_unretained) CCGLProgram *shaderProgram; -+(id) gridWithSize:(ccGridSize)gridSize texture:(CCTexture2D*)texture flippedTexture:(BOOL)flipped; -+(id) gridWithSize:(ccGridSize)gridSize; ++(id) gridWithSize:(CGSize)gridSize texture:(CCTexture2D*)texture flippedTexture:(BOOL)flipped; ++(id) gridWithSize:(CGSize)gridSize; --(id) initWithSize:(ccGridSize)gridSize texture:(CCTexture2D*)texture flippedTexture:(BOOL)flipped; --(id)initWithSize:(ccGridSize)gridSize; +-(id) initWithSize:(CGSize)gridSize texture:(CCTexture2D*)texture flippedTexture:(BOOL)flipped; +-(id)initWithSize:(CGSize)gridSize; -(void)beforeDraw; -(void)afterDraw:(CCNode*)target; -(void)blit; @@ -91,18 +94,18 @@ */ @interface CCGrid3D : CCGridBase { - GLvoid *texCoordinates; - GLvoid *vertices; - GLvoid *originalVertices; - GLushort *indices; + GLvoid *_texCoordinates; + GLvoid *_vertices; + GLvoid *_originalVertices; + GLushort *_indices; } /** returns the vertex at a given position */ --(ccVertex3F)vertex:(ccGridSize)pos; +-(ccVertex3F)vertex:(CGPoint)pos; /** returns the original (non-transformed) vertex at a given position */ --(ccVertex3F)originalVertex:(ccGridSize)pos; +-(ccVertex3F)originalVertex:(CGPoint)pos; /** sets a new vertex at a given position */ --(void)setVertex:(ccGridSize)pos vertex:(ccVertex3F)vertex; +-(void)setVertex:(CGPoint)pos vertex:(ccVertex3F)vertex; @end @@ -114,17 +117,17 @@ */ @interface CCTiledGrid3D : CCGridBase { - GLvoid *texCoordinates; - GLvoid *vertices; - GLvoid *originalVertices; - GLushort *indices; + GLvoid *_texCoordinates; + GLvoid *_vertices; + GLvoid *_originalVertices; + GLushort *_indices; } /** returns the tile at the given position */ --(ccQuad3)tile:(ccGridSize)pos; +-(ccQuad3)tile:(CGPoint)pos; /** returns the original tile (untransformed) at the given position */ --(ccQuad3)originalTile:(ccGridSize)pos; +-(ccQuad3)originalTile:(CGPoint)pos; /** sets a new tile */ --(void)setTile:(ccGridSize)pos coords:(ccQuad3)coords; +-(void)setTile:(CGPoint)pos coords:(ccQuad3)coords; @end diff --git a/include/cocos2d/CCLabelAtlas.h b/include/cocos2d/CCLabelAtlas.h index caa2ff8..369c1e9 100644 --- a/include/cocos2d/CCLabelAtlas.h +++ b/include/cocos2d/CCLabelAtlas.h @@ -42,10 +42,10 @@ @interface CCLabelAtlas : CCAtlasNode { // string to render - NSString *string_; + NSString *_string; // the first char in the charmap - NSUInteger mapStartChar_; + NSUInteger _mapStartChar; } @@ -60,6 +60,9 @@ /** initializes the CCLabelAtlas with a string, a char map file(the atlas), the width and height in points of each element and the starting char of the atlas */ -(id) initWithString:(NSString*) string charMapFile: (NSString*) charmapfile itemWidth:(NSUInteger)w itemHeight:(NSUInteger)h startCharMap:(NSUInteger)firstElement; +/** initializes the CCLabelAtlas with a string, a texture, the width and height in points of each element and the starting char of the atlas */ +-(id) initWithString:(NSString*) theString texture:(CCTexture2D*)texture itemWidth:(NSUInteger)w itemHeight:(NSUInteger)h startCharMap:(NSUInteger)c; + /** initializes the CCLabelAtlas with a string and a configuration file @since v2.0 */ diff --git a/include/cocos2d/CCLabelBMFont.h b/include/cocos2d/CCLabelBMFont.h index 54fe665..9757953 100644 --- a/include/cocos2d/CCLabelBMFont.h +++ b/include/cocos2d/CCLabelBMFont.h @@ -77,7 +77,7 @@ typedef struct _FontDefHashElement NSUInteger key; // key. Font Unicode value ccBMFontDef fontDef; // font definition UT_hash_handle hh; -} tFontDefHashElement; +} tCCFontDefHashElement; // Equal function for targetSet. typedef struct _KerningHashElement @@ -85,7 +85,7 @@ typedef struct _KerningHashElement int key; // key for the hash. 16-bit for 1st element, 16-bit for 2nd element int amount; UT_hash_handle hh; -} tKerningHashElement; +} tCCKerningHashElement; #pragma mark - /** CCBMFontConfiguration has parsed configuration of the the .fnt file @@ -93,27 +93,33 @@ typedef struct _KerningHashElement */ @interface CCBMFontConfiguration : NSObject { + // Character Set defines the letters that actually exist in the font + NSCharacterSet *_characterSet; + // atlas name - NSString *atlasName_; + NSString *_atlasName; - // XXX: Creating a public interface so that the bitmapFontArray[] is accesible + // XXX: Creating a public interface so that the bitmapFontArray[] is accessible @public // BMFont definitions - tFontDefHashElement *fontDefDictionary_; + tCCFontDefHashElement *_fontDefDictionary; // FNTConfig: Common Height. Should be signed (issue #1343) - NSInteger commonHeight_; + NSInteger _commonHeight; // Padding - ccBMFontPadding padding_; + ccBMFontPadding _padding; // values for kerning - tKerningHashElement *kerningDictionary_; + tCCKerningHashElement *_kerningDictionary; } +// Character set +@property (nonatomic, readonly) NSCharacterSet *characterSet; + // atlasName -@property (nonatomic, readwrite, retain) NSString *atlasName; +@property (nonatomic, readwrite, strong) NSString *atlasName; /** allocates a CCBMFontConfiguration with a FNT file */ +(id) configurationWithFNTFile:(NSString*)FNTfile; @@ -156,27 +162,31 @@ typedef struct _KerningHashElement @interface CCLabelBMFont : CCSpriteBatchNode { // string to render - NSString *string_; + NSString *_string; // name of fntFile - NSString *fntFile_; + NSString *_fntFile; // initial string without line breaks - NSString *initialString_; + NSString *_initialString; // max width until a line break is added - float width_; + float _width; // alignment of all lines - CCTextAlignment alignment_; + CCTextAlignment _alignment; - CCBMFontConfiguration *configuration_; + CCBMFontConfiguration *_configuration; // texture RGBA - GLubyte opacity_; - ccColor3B color_; - BOOL opacityModifyRGB_; + GLubyte _displayedOpacity, _realOpacity; + ccColor3B _displayedColor, _realColor; + BOOL _cascadeOpacityEnabled, _cascadeColorEnabled; + BOOL _opacityModifyRGB; // offset of the texture atlas - CGPoint imageOffset_; + CGPoint _imageOffset; + + // reused char + CCSprite *_reusedChar; } /** Purges the cached data. @@ -186,9 +196,9 @@ typedef struct _KerningHashElement +(void) purgeCachedData; /** alignment used for the label */ -@property (nonatomic,assign,readonly) CCTextAlignment alignment; +@property (nonatomic,readonly) CCTextAlignment alignment; /** fntFile used for the font */ -@property (nonatomic,retain) NSString* fntFile; +@property (nonatomic,strong) NSString* fntFile; /** conforms to CCRGBAProtocol protocol */ @property (nonatomic,readwrite) GLubyte opacity; /** conforms to CCRGBAProtocol protocol */ @@ -199,7 +209,7 @@ typedef struct _KerningHashElement +(id) labelWithString:(NSString*)string fntFile:(NSString*)fntFile; /** creates a BMFont label with an initial string, the FNT file, width, and alignment option */ +(id) labelWithString:(NSString*)string fntFile:(NSString*)fntFile width:(float)width alignment:(CCTextAlignment)alignment; -/** creates a BMFont label with an initial string, the FNT file, width, alignment option and the offset of where the glpyhs start on the .PNG image */ +/** creates a BMFont label with an initial string, the FNT file, width, alignment option and the offset of where the glyphs start on the .PNG image */ +(id) labelWithString:(NSString*)string fntFile:(NSString*)fntFile width:(float)width alignment:(CCTextAlignment)alignment imageOffset:(CGPoint)offset; /** init a BMFont label with an initial string and the FNT file */ diff --git a/include/cocos2d/CCLabelTTF.h b/include/cocos2d/CCLabelTTF.h index 46a047b..c1f1c96 100644 --- a/include/cocos2d/CCLabelTTF.h +++ b/include/cocos2d/CCLabelTTF.h @@ -29,7 +29,6 @@ #import "CCSprite.h" #import "Platforms/CCNS.h" - /** CCLabel is a subclass of CCTextureNode that knows how to render text labels * * All features from CCTextureNode are valid in CCLabel @@ -39,94 +38,111 @@ @interface CCLabelTTF : CCSprite { - CGSize dimensions_; - CCTextAlignment hAlignment_; - CCVerticalTextAlignment vAlignment_; - NSString * fontName_; - CGFloat fontSize_; - CCLineBreakMode lineBreakMode_; - NSString *string_; + BOOL _isTextureDirty; } +#pragma mark String and font + +/** Changes the text of the label. + * @warning Changing the string is as expensive as creating a new CCLabelTTF. To obtain better performance use CCLabelAtlas or CCLabelBMFont. + */ +@property (nonatomic,copy) NSString* string; + +/** Changes text of the label, draws the string with given attributes. The attributes used will override the alignment, color and shadow as set by the properties of the label. Attributed strings are only available on Mac and iOS 6 or later. + * @warning Changing the string is as expensive as creating a new CCLabelTTF. To obtain better performance use CCLabelAtlas or CCLabelBMFont. + */ +@property (nonatomic,copy) NSAttributedString* attributedString; + /** Font name used in the label */ -@property (nonatomic,retain) NSString* fontName; -/** Font size of the label */ +@property (nonatomic,strong) NSString* fontName; + +/** Font size used in the label */ @property (nonatomic,assign) float fontSize; + +/** Font color. If not using shadow or outline, it is more efficient to use the color property. */ +@property (nonatomic,assign) ccColor4B fontColor; + +#pragma mark Dimensions + /** Dimensions of the label in Points */ @property (nonatomic,assign) CGSize dimensions; + +@property (nonatomic,assign) CCContentSizeType dimensionsType; + + +#pragma mark Alignment + /** The alignment of the label */ @property (nonatomic,assign) CCTextAlignment horizontalAlignment; + /** The vertical alignment of the label */ @property (nonatomic,assign) CCVerticalTextAlignment verticalAlignment; -/** creates a CCLabelTTF with a font name and font size in points*/ -+ (id) labelWithString:(NSString*)string fontName:(NSString*)name fontSize:(CGFloat)size; +#pragma mark Shadow -/** creates a CCLabelTTF from a fontname, horizontal alignment, dimension in points, and font size in points. - Supported lineBreakModes: - - iOS: all UILineBreakMode supported modes - - Mac: Only NSLineBreakByWordWrapping is supported. - @since v1.0 - */ -+ (id) labelWithString:(NSString*)string dimensions:(CGSize)dimensions hAlignment:(CCTextAlignment)alignment fontName:(NSString*)name fontSize:(CGFloat)size; +/** The color of a text shadow. If the color is transparent, no shadow will be used. */ +@property (nonatomic,assign) ccColor4B shadowColor; -/** creates a CCLabelTTF from a fontname, horizontal alignment, dimension in points, line break mode, and font size in points. - Supported lineBreakModes: - - iOS: all UILineBreakMode supported modes - - Mac: Only NSLineBreakByWordWrapping is supported. - @since v1.0 - */ -+ (id) labelWithString:(NSString*)string dimensions:(CGSize)dimensions hAlignment:(CCTextAlignment)alignment lineBreakMode:(CCLineBreakMode)lineBreakMode fontName:(NSString*)name fontSize:(CGFloat)size; +/** The offset of the shadow (in the type specified by shadowOffsetType), default is (0,0). */ +@property (nonatomic,assign) CGPoint shadowOffset; -/** creates a CCLabelTTF from a fontname, horizontal aligment, vertical alignment, dimension in points, line break mode, and font size in points. - Supported lineBreakModes: - - iOS: all UILineBreakMode supported modes - - Mac: Only NSLineBreakByWordWrapping is supported. - @since v1.0 - */ -+ (id) labelWithString:(NSString*)string dimensions:(CGSize)dimensions hAlignment:(CCTextAlignment)alignment vAlignment:(CCVerticalTextAlignment)vertAlignment lineBreakMode:(CCLineBreakMode)lineBreakMode fontName:(NSString*)name fontSize:(CGFloat)size; -/** creates a CCLabel from a fontname, alignment, dimension in points and font size in points*/ -+ (id) labelWithString:(NSString*)string dimensions:(CGSize)dimensions hAlignment:(CCTextAlignment)alignment vAlignment:(CCVerticalTextAlignment)vertAlignment fontName:(NSString*)name fontSize:(CGFloat)size; +@property (nonatomic,assign) CCPositionType shadowOffsetType; +/** The blur radius of the shadow, default is 0. */ +@property (nonatomic,assign) float shadowBlurRadius; -/** initializes the CCLabelTTF with a font name and font size in points */ -- (id) initWithString:(NSString*)string fontName:(NSString*)name fontSize:(CGFloat)size; -/** initializes the CCLabelTTF with a font name, horizonal alignment, dimension in points, and font size in points. - Default verticalAlignment: kCCVerticalTextAlignmentTop - Default lineBreakMode: CCLineBreakModeWordWrap - @since v1.0 - */ -- (id) initWithString:(NSString*)string dimensions:(CGSize)dimensions hAlignment:(CCTextAlignment)alignment fontName:(NSString*)name fontSize:(CGFloat)size; +#pragma mark Outline -/** initializes the CCLabelTTF with a font name, horizontal alignment, dimension in points, line break mode and font size in points. - Default verticalAlignment: kCCVerticalTextAlignmentTop +/** The color of the label's outline. Default is transparent/no outline. */ +@property (nonatomic,assign) ccColor4B outlineColor; - Supported lineBreakModes: - - iOS: all UILineBreakMode supported modes - - Mac: Only NSLineBreakByWordWrapping is supported. - @since v1.0 - */ -- (id) initWithString:(NSString*)str dimensions:(CGSize)dimensions hAlignment:(CCTextAlignment)alignment lineBreakMode:(CCLineBreakMode)lineBreakMode fontName:(NSString*)name fontSize:(CGFloat)size; +/** The width of the label's outline. Default is 0/no outline. */ +@property (nonatomic,assign) float outlineWidth; -/** initializes the CCLabelTTF with a font name, horiozntal alignment, vertical alignment, dimension in points and font size in points. - Default lineBreakMode: CCLineBreakModeWordWrap - */ -- (id) initWithString:(NSString*)string dimensions:(CGSize)dimensions hAlignment:(CCTextAlignment)alignment vAlignment:(CCVerticalTextAlignment)vertAlignment fontName:(NSString*)name fontSize:(CGFloat)size; -/** initializes the CCLabelTTF with a font name, horizontal alignment, vertical aligment, dimension in points, line break mode and font size in points. - Supported lineBreakModes: - - iOS: all UILineBreakMode supported modes - - Mac: Only NSLineBreakByWordWrapping is supported. - @since v2.0 - */ -- (id) initWithString:(NSString*)str dimensions:(CGSize)dimensions hAlignment:(CCTextAlignment)alignment vAlignment:(CCVerticalTextAlignment)vAlignment lineBreakMode:(CCLineBreakMode)lineBreakMode fontName:(NSString*)name fontSize:(CGFloat)size; +#pragma mark Font adjustments -/** changes the string to render - * @warning Changing the string is as expensive as creating a new CCLabelTTF. To obtain better performance use CCLabelAtlas or CCLabelBMFont. - */ -- (void) setString:(NSString*)str; +/** If set, the label will be scaled down to fit into the size provided by the dimensions property. Only has an effect if dimensions are set. */ +@property (nonatomic,assign) BOOL adjustsFontSizeToFit; + +/** Used together with adjustsFontSizeToFit. Fonts will not be scaled down below this size (the label will instead be clipped). */ +@property (nonatomic,assign) float minimumFontSize; + +/** Adjusts the fonts baseline, the value is set in points. */ +@property (nonatomic,assign) float baselineAdjustment; + +/** Creates a CCLabelTTF with a font name and font size in points */ ++ (id) labelWithString:(NSString *)string fontName:(NSString *)name fontSize:(CGFloat)size; + +/** Creates a CCLabelTTF with a font name, font size in points and the desired dimensions. */ ++ (id) labelWithString:(NSString *)string fontName:(NSString *)name fontSize:(CGFloat)size dimensions:(CGSize)dimensions; + +/** Creates a CCLabelTTF with an attributed string. Only supported on Mac and iOS 6 or later. */ ++ (id) labelWithAttributedString:(NSAttributedString *)attrString; + +/** Creates a CCLabelTTF with an attributed string and the desired dimensions. Only supported on Mac and iOS 6 or later. */ ++ (id) labelWithAttributedString:(NSAttributedString *)attrString dimensions:(CGSize)dimensions; + + +/** Initializes the CCLabelTTF with a font name and font size in points. */ +- (id) initWithString:(NSString*)string fontName:(NSString*)name fontSize:(CGFloat)size; + +/** Initializes the CCLabelTTF with a font name, font size in points and the desired dimensions. */ +- (id) initWithString:(NSString*)string fontName:(NSString*)name fontSize:(CGFloat)size dimensions:(CGSize)dimensions; + +/** Initializes the CCLabelTTF with an attributed string. Only supported on Mac and iOS 6 or later. */ +- (id) initWithAttributedString:(NSAttributedString *)attrString; + +/** Initializes the CCLabelTTF with an attributed string and the desired dimensions. Only supported on Mac and iOS 6 or later. */ +- (id) initWithAttributedString:(NSAttributedString *)attrString dimensions:(CGSize)dimensions; + +#ifdef __CC_PLATFORM_MAC +- (void) setHTML:(NSString*) html; +#endif + ++ (void) registerCustomTTF:(NSString*)fontFile; @end diff --git a/include/cocos2d/CCLayer.h b/include/cocos2d/CCLayer.h index a2b08f5..41a5a62 100644 --- a/include/cocos2d/CCLayer.h +++ b/include/cocos2d/CCLayer.h @@ -30,116 +30,16 @@ #ifdef __CC_PLATFORM_IOS #import // Needed for UIAccelerometerDelegate -#import "Platforms/iOS/CCTouchDelegateProtocol.h" // Touches only supported on iOS #elif defined(__CC_PLATFORM_MAC) -#import "Platforms/Mac/CCEventDispatcher.h" + #endif #import "CCProtocols.h" #import "CCNode.h" -#pragma mark - -#pragma mark CCLayer - -/** CCLayer is a subclass of CCNode that implements the CCTouchEventsDelegate protocol. - - All features from CCNode are valid, plus the following new features: - - It can receive iPhone Touches - - It can receive Accelerometer input -*/ -#ifdef __CC_PLATFORM_IOS -@interface CCLayer : CCNode -{ - BOOL isTouchEnabled_; - BOOL isAccelerometerEnabled_; -} -/** If isTouchEnabled, this method is called onEnter. Override it to change the - way CCLayer receives touch events. - ( Default: [touchDispatcher addStandardDelegate:self priority:0] ) - Example: - -(void) registerWithTouchDispatcher - { - [touchDispatcher addTargetedDelegate:self priority:INT_MIN+1 swallowsTouches:YES]; - } - - Valid only on iOS. Not valid on Mac. - - @since v0.8.0 - */ --(void) registerWithTouchDispatcher; - -/** whether or not it will receive Touch events. - You can enable / disable touch events with this property. - Only the touches of this node will be affected. This "method" is not propagated to its children. - - Valid on iOS and Mac OS X v10.6 and later. - - @since v0.8.1 - */ -@property(nonatomic,assign) BOOL isTouchEnabled; -/** whether or not it will receive Accelerometer events - You can enable / disable accelerometer events with this property. - - Valid only on iOS. Not valid on Mac. - - @since v0.8.1 - */ -@property(nonatomic,assign) BOOL isAccelerometerEnabled; - -#elif defined(__CC_PLATFORM_MAC) - - -@interface CCLayer : CCNode -{ - BOOL isMouseEnabled_; - BOOL isKeyboardEnabled_; - BOOL isTouchEnabled_; -} - -/** whether or not it will receive mouse events. - - Valind only Mac. Not valid on iOS - */ -@property (nonatomic, readwrite) BOOL isMouseEnabled; - -/** whether or not it will receive keyboard events. - - Valind only Mac. Not valid on iOS - */ -@property (nonatomic, readwrite) BOOL isKeyboardEnabled; - -/** whether or not it will receive touch events. - - Valid on iOS and Mac OS X v10.6 and later. - */ -@property (nonatomic, readwrite) BOOL isTouchEnabled; - -/** priority of the mouse event delegate. - Default 0. - Override this method to set another priority. - - Valind only Mac. Not valid on iOS - */ --(NSInteger) mouseDelegatePriority; - -/** priority of the keyboard event delegate. - Default 0. - Override this method to set another priority. - - Valind only Mac. Not valid on iOS - */ --(NSInteger) keyboardDelegatePriority; - -/** priority of the touch event delegate. - Default 0. - Override this method to set another priority. - - Valind only Mac. Not valid on iOS - */ --(NSInteger) touchDelegatePriority; - -#endif // mac +#pragma mark - CCLayer +@interface CCLayer : CCNode @end @@ -152,14 +52,12 @@ - opacity - RGB colors */ -@interface CCLayerColor : CCLayer +@interface CCLayerColor : CCNodeRGBA { - GLubyte opacity_; - ccColor3B color_; - ccVertex2F squareVertices_[4]; - ccColor4F squareColors_[4]; + ccVertex2F _squareVertices[4]; + ccColor4F _squareColors[4]; - ccBlendFunc blendFunc_; + ccBlendFunc _blendFunc; } /** creates a CCLayer with color, width and height in Points*/ @@ -183,10 +81,6 @@ */ -(void) changeWidth:(GLfloat)w height:(GLfloat)h; -/** Opacity: conforms to CCRGBAProtocol protocol */ -@property (nonatomic,readonly) GLubyte opacity; -/** Opacity: conforms to CCRGBAProtocol protocol */ -@property (nonatomic,readonly) ccColor3B color; /** BlendFunction. Conforms to CCBlendProtocol protocol */ @property (nonatomic,readwrite) ccBlendFunc blendFunc; @end @@ -216,11 +110,11 @@ the background. */ @interface CCLayerGradient : CCLayerColor { - ccColor3B endColor_; - GLubyte startOpacity_; - GLubyte endOpacity_; - CGPoint vector_; - BOOL compressedInterpolation_; + ccColor3B _endColor; + GLubyte _startOpacity; + GLubyte _endOpacity; + CGPoint _vector; + BOOL _compressedInterpolation; } /** Creates a full-screen CCLayer with a gradient between start and end. */ @@ -260,12 +154,20 @@ the background. */ @interface CCLayerMultiplex : CCLayer { - unsigned int enabledLayer_; - NSMutableArray *layers_; + unsigned int _enabledLayer; + NSMutableArray *_layers; } +/** creates a CCMultiplexLayer with an array of layers. + @since v2.1 + */ ++(id) layerWithArray:(NSArray*)arrayOfLayers; /** creates a CCMultiplexLayer with one or more layers using a variable argument list. */ +(id) layerWithLayers: (CCLayer*) layer, ... NS_REQUIRES_NIL_TERMINATION; +/** initializes a CCMultiplexLayer with an array of layers + @since v2.1 + */ +-(id) initWithArray:(NSArray*)arrayOfLayers; /** initializes a MultiplexLayer with one or more layers using a variable argument list. */ -(id) initWithLayers: (CCLayer*) layer vaList:(va_list) params; /** switches to a certain layer indexed by n. diff --git a/include/cocos2d/CCMenu.h b/include/cocos2d/CCMenu.h index 72a51b3..174c363 100644 --- a/include/cocos2d/CCMenu.h +++ b/include/cocos2d/CCMenu.h @@ -28,11 +28,6 @@ #import "CCMenuItem.h" #import "CCLayer.h" -typedef enum { - kCCMenuStateWaiting, - kCCMenuStateTrackingTouch -} tCCMenuState; - enum { //* priority used by the menu for the event handler kCCMenuHandlerPriority = -128, @@ -44,31 +39,24 @@ enum { * - You can add MenuItem objects in runtime using addChild: * - But the only accecpted children are MenuItem objects */ -@interface CCMenu : CCLayer +@interface CCMenu : CCNodeRGBA { - tCCMenuState state_; - CCMenuItem *selectedItem_; - GLubyte opacity_; - ccColor3B color_; - BOOL enabled_; + CCMenuItem *_selectedItem; + BOOL _enabled; } -/** conforms to CCRGBAProtocol protocol */ -@property (nonatomic,readonly) GLubyte opacity; -/** conforms to CCRGBAProtocol protocol */ -@property (nonatomic,readonly) ccColor3B color; /** whether or not the menu will receive events */ @property (nonatomic, readwrite) BOOL enabled; -/** creates a CCMenu with its items */ +/** creates a CCMenu with CCMenuItem objects */ + (id) menuWithItems: (CCMenuItem*) item, ... NS_REQUIRES_NIL_TERMINATION; +/** creates a CCMenu with CCMenuItem objects */ ++ (id) menuWithItems: (CCMenuItem*) firstItem vaList: (va_list) args; + /** creates a CCMenu with a NSArray of CCMenuItem objects */ + (id) menuWithArray:(NSArray*)arrayOfItems; -/** initializes a CCMenu with its items */ -- (id) initWithItems: (CCMenuItem*) item vaList: (va_list) args; - /** initializes a CCMenu with a NSArray of CCMenuItem objects */ - (id) initWithArray:(NSArray*)arrayOfItems; @@ -89,12 +77,47 @@ enum { /** align items in rows of columns */ -(void) alignItemsInColumns: (NSNumber *) columns, ... NS_REQUIRES_NIL_TERMINATION; -(void) alignItemsInColumns: (NSNumber *) columns vaList: (va_list) args; +-(void) alignItemsInColumnsWithArray:(NSArray*) arrayOfNumbers; /** align items in columns of rows */ -(void) alignItemsInRows: (NSNumber *) rows, ... NS_REQUIRES_NIL_TERMINATION; -(void) alignItemsInRows: (NSNumber *) rows vaList: (va_list) args; +-(void) alignItemsInRowsWithArray: (NSArray*) arrayOfNumbers; + +/** Menu item in the menu has been pressed + @since v2.5 + */ +-( void )menuItemPressed:( CCMenuItem* )item; -/** set event handler priority. By default it is: kCCMenuTouchPriority */ --(void) setHandlerPriority:(NSInteger)newPriority; +/** Menu item in the menu has been release + @since v2.5 + */ +-( void )menuItemReleased:( CCMenuItem* )item; @end + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/include/cocos2d/CCMenuItem.h b/include/cocos2d/CCMenuItem.h index 6336534..2cc4f94 100644 --- a/include/cocos2d/CCMenuItem.h +++ b/include/cocos2d/CCMenuItem.h @@ -38,13 +38,16 @@ * * Subclass CCMenuItem (or any subclass) to create your custom CCMenuItem objects. */ -@interface CCMenuItem : CCNode +@interface CCMenuItem : CCNodeRGBA { // used for menu items using a block - void (^block_)(id sender); + void (^_block)(id sender); - BOOL isEnabled_; - BOOL isSelected_; + BOOL _isEnabled; + BOOL _isSelected; + + BOOL _releaseBlockAtCleanup; + CGRect _activeArea; } /** returns whether or not the item is selected @@ -52,6 +55,14 @@ */ @property (nonatomic,readonly) BOOL isSelected; +/** If enabled, it releases the block at cleanup time. + @since v2.1 + */ +@property (nonatomic) BOOL releaseBlockAtCleanup; + +/** the active area (relative to the current position) */ +@property (nonatomic,assign) CGRect activeArea; + /** Creates a CCMenuItem with a target/selector. target/selector will be implemented using blocks. "target" won't be retained. @@ -71,9 +82,6 @@ */ -(id) initWithBlock:(void(^)(id sender))block; -/** Returns the outside box in points */ --(CGRect) rect; - /** Activate the item */ -(void) activate; @@ -115,21 +123,21 @@ - CCLabelAtlas - CCLabelTTF */ -@interface CCMenuItemLabel : CCMenuItem +@interface CCMenuItemLabel : CCMenuItem { - CCNode *label_; - ccColor3B colorBackup; - ccColor3B disabledColor_; - float originalScale_; + CCNode *_label; + ccColor3B _colorBackup; + ccColor3B _disabledColor; + float _originalScale; } /** the color that will be used to disable the item */ @property (nonatomic,readwrite) ccColor3B disabledColor; /** Label that is rendered. It can be any CCNode that implements the CCLabelProtocol */ -@property (nonatomic,readwrite,assign) CCNode* label; +@property (nonatomic,readwrite,unsafe_unretained) CCNode* label; -/** creates a CCMenuItemLabel with a Label. Block will benil */ +/** creates a CCMenuItemLabel with a Label. */ +(id) itemWithLabel:(CCNode*)label; /** creates a CCMenuItemLabel with a Label, target and selector. @@ -206,8 +214,8 @@ */ @interface CCMenuItemFont : CCMenuItemLabel { - NSUInteger fontSize_; - NSString *fontName_; + NSUInteger _fontSize; + NSString *_fontName; } /** set default font size */ +(void) setFontSize: (NSUInteger) s; @@ -271,17 +279,17 @@ */ @interface CCMenuItemSprite : CCMenuItem { - CCNode *normalImage_, *selectedImage_, *disabledImage_; + CCNode *__unsafe_unretained _normalImage, *__unsafe_unretained _selectedImage, *__unsafe_unretained _disabledImage; } // weak references /** the image used when the item is not selected */ -@property (nonatomic,readwrite,assign) CCNode *normalImage; +@property (nonatomic,readwrite,unsafe_unretained) CCNode *normalImage; /** the image used when the item is selected */ -@property (nonatomic,readwrite,assign) CCNode *selectedImage; +@property (nonatomic,readwrite,unsafe_unretained) CCNode *selectedImage; /** the image used when the item is disabled */ -@property (nonatomic,readwrite,assign) CCNode *disabledImage; +@property (nonatomic,readwrite,unsafe_unretained) CCNode *disabledImage; /** creates a menu item with a normal and selected image*/ +(id) itemWithNormalSprite:(CCNode*)normalSprite selectedSprite:(CCNode*)selectedSprite; @@ -290,7 +298,7 @@ */ +(id) itemWithNormalSprite:(CCNode*)normalSprite selectedSprite:(CCNode*)selectedSprite target:(id)target selector:(SEL)selector; -/** creates a menu item with a normal,selected and disabled image with target/selector. +/** creates a menu item with a normal, selected and disabled image with target/selector. The "target" won't be retained. */ +(id) itemWithNormalSprite:(CCNode*)normalSprite selectedSprite:(CCNode*)selectedSprite disabledSprite:(CCNode*)disabledSprite target:(id)target selector:(SEL)selector; @@ -300,7 +308,7 @@ */ +(id) itemWithNormalSprite:(CCNode*)normalSprite selectedSprite:(CCNode*)selectedSprite block:(void(^)(id sender))block; -/** creates a menu item with a normal,selected and disabled image with a block. +/** creates a menu item with a normal, selected and disabled image with a block. The block will be "copied". */ +(id) itemWithNormalSprite:(CCNode*)normalSprite selectedSprite:(CCNode*)selectedSprite disabledSprite:(CCNode*)disabledSprite block:(void(^)(id sender))block; @@ -335,10 +343,13 @@ /** creates a menu item with a normal and selected image*/ +(id) itemWithNormalImage: (NSString*)value selectedImage:(NSString*) value2; +/** creates a menu item with a normal, selected and disabled image */ ++(id) itemWithNormalImage: (NSString*)value selectedImage:(NSString*) value2 disabledImage: (NSString*) value3; + /** creates a menu item with a normal and selected image with target/selector */ +(id) itemWithNormalImage: (NSString*)value selectedImage:(NSString*) value2 target:(id) r selector:(SEL) s; -/** creates a menu item with a normal,selected and disabled image with target/selector. +/** creates a menu item with a normal, selected and disabled image with target/selector. The "target" won't be retained. */ +(id) itemWithNormalImage: (NSString*)value selectedImage:(NSString*) value2 disabledImage:(NSString*) value3 target:(id) r selector:(SEL) s; @@ -348,7 +359,7 @@ */ +(id) itemWithNormalImage: (NSString*)value selectedImage:(NSString*) value2 block:(void(^)(id sender))block; -/** creates a menu item with a normal,selected and disabled image with a block. +/** creates a menu item with a normal, selected and disabled image with a block. The block will be "copied". */ +(id) itemWithNormalImage: (NSString*)value selectedImage:(NSString*) value2 disabledImage:(NSString*) value3 block:(void(^)(id sender))block; @@ -383,35 +394,30 @@ */ @interface CCMenuItemToggle : CCMenuItem { - NSUInteger selectedIndex_; - NSMutableArray* subItems_; - GLubyte opacity_; - ccColor3B color_; + NSUInteger _selectedIndex; + NSMutableArray* _subItems; + CCMenuItem* __unsafe_unretained _currentItem; } -/** conforms with CCRGBAProtocol protocol */ -@property (nonatomic,readonly) GLubyte opacity; -/** conforms with CCRGBAProtocol protocol */ -@property (nonatomic,readonly) ccColor3B color; - /** returns the selected item */ @property (nonatomic,readwrite) NSUInteger selectedIndex; /** NSMutableArray that contains the subitems. You can add/remove items in runtime, and you can replace the array with a new one. @since v0.7.2 */ -@property (nonatomic,readwrite,retain) NSMutableArray *subItems; +@property (nonatomic,readwrite,strong) NSMutableArray *subItems; /** creates a menu item from a list of items with a target/selector */ +(id) itemWithTarget:(id)target selector:(SEL)selector items:(CCMenuItem*) item, ... NS_REQUIRES_NIL_TERMINATION; ++(id) itemWithTarget:(id)target selector:(SEL)selector items:(CCMenuItem*) item vaList:(va_list)args; + +/** creates a menu item from a list of items. */ ++(id) itemWithItems:(NSArray*)arrayOfItems; /** creates a menu item from a list of items and executes the given block when the item is selected. The block will be "copied". */ +(id) itemWithItems:(NSArray*)arrayOfItems block:(void(^)(id sender))block; -/** initializes a menu item from a list of items with a target selector */ --(id) initWithTarget:(id)target selector:(SEL)selector items:(CCMenuItem*) item vaList:(va_list) args; - /** initializes a menu item from a list of items with a block. The block will be "copied". */ diff --git a/include/cocos2d/CCMotionStreak.h b/include/cocos2d/CCMotionStreak.h index 4404151..865867f 100644 --- a/include/cocos2d/CCMotionStreak.h +++ b/include/cocos2d/CCMotionStreak.h @@ -32,41 +32,40 @@ /** MotionStreak. Creates a trailing path. */ -@interface CCMotionStreak : CCNode +@interface CCMotionStreak : CCNodeRGBA { - CCTexture2D *texture_; - CGPoint positionR_; - ccColor3B color_; - ccBlendFunc blendFunc_; - float stroke_; - float fadeDelta_; - float minSeg_; + CCTexture2D *_texture; + CGPoint _positionR; + ccBlendFunc _blendFunc; + float _stroke; + float _fadeDelta; + float _minSeg; - NSUInteger maxPoints_; - NSUInteger nuPoints_; - NSUInteger previousNuPoints_; + NSUInteger _maxPoints; + NSUInteger _nuPoints; + NSUInteger _previousNuPoints; /** Pointers */ - CGPoint *pointVertexes_; - float *pointState_; + CGPoint *_pointVertexes; + float *_pointState; // Opengl - ccVertex2F *vertices_; - unsigned char *colorPointer_; - ccTex2F *texCoords_; + ccVertex2F *_vertices; + unsigned char *_colorPointer; + ccTex2F *_texCoords; - BOOL fastMode_; + BOOL _fastMode; - BOOL startingPositionInitialized_; + BOOL _startingPositionInitialized; } /** blending function */ @property (nonatomic, readwrite, assign) ccBlendFunc blendFunc; -/** When fast mode is enbled, new points are added faster but with lower precision */ +/** When fast mode is enabled, new points are added faster but with lower precision */ @property (nonatomic, readwrite, assign, getter = isFastMode) BOOL fastMode; /** texture used for the motion streak */ -@property (nonatomic, retain) CCTexture2D *texture; +@property (nonatomic, strong) CCTexture2D *texture; /** creates and initializes a motion streak with fade in seconds, minimum segments, stroke's width, color, texture filename */ + (id) streakWithFade:(float)fade minSeg:(float)minSeg width:(float)stroke color:(ccColor3B)color textureFilename:(NSString*)path; diff --git a/include/cocos2d/CCNode.h b/include/cocos2d/CCNode.h index a4ab100..0eb3f05 100644 --- a/include/cocos2d/CCNode.h +++ b/include/cocos2d/CCNode.h @@ -5,6 +5,7 @@ * * Copyright (c) 2008-2010 Ricardo Quesada * Copyright (c) 2011 Zynga Inc. + * Copyright (c) 2013 Lars Birkemose * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -30,19 +31,25 @@ #import "CCProtocols.h" #import "ccConfig.h" #import "ccGLStateCache.h" -#import "Support/CCArray.h" + +#pragma clang diagnostic pop COCOS2D +#pragma clang diagnostic ignored "-Wignored-qualifiers" #import "kazmath/kazmath.h" +#pragma clang diagnostic push COCOS2D + +#import "CCResponder.h" enum { kCCNodeTagInvalid = -1, }; -@class CCCamera; +@class CCScene; @class CCGridBase; @class CCGLProgram; @class CCScheduler; @class CCActionManager; @class CCAction; +@class CCPhysicsBody; /** CCNode is the main element. Anything thats gets drawn or contains things that get drawn is a CCNode. The most popular CCNodes are: CCScene, CCLayer, CCSprite, CCMenu. @@ -63,7 +70,6 @@ enum { - position - scale (x, y) - rotation (in degrees, clockwise) - - CCCamera (an interface to gluLookAt ) - CCGridBase (to do mesh transformations) - anchor point - size @@ -90,94 +96,84 @@ enum { Order in transformations with grid enabled -# The node will be translated (position) - -# The node will be rotated (rotation) + -# The node will be rotated (rotation, rotationX, rotationY) -# The node will be skewed (skewX, skewY) -# The node will be scaled (scale, scaleX, scaleY) -# The grid will capture the screen -# The node will be moved according to the camera values (camera) -# The grid will render the captured screen - - Camera: - - Each node has a camera. By default it points to the center of the CCNode. */ -@interface CCNode : NSObject -{ +@interface CCNode : CCResponder < CCResponderProtocol > { // rotation angle - float rotation_; + float _rotationalSkewX, _rotationalSkewY; // scaling factors - float scaleX_, scaleY_; + float _scaleX, _scaleY; // openGL real Z vertex - float vertexZ_; + float _vertexZ; // position of the node - CGPoint position_; + CGPoint _position; // skew angles - float skewX_, skewY_; + float _skewX, _skewY; // anchor point in points - CGPoint anchorPointInPoints_; + CGPoint _anchorPointInPoints; // anchor point normalized (NOT in points) - CGPoint anchorPoint_; + CGPoint _anchorPoint; // untransformed size of the node - CGSize contentSize_; + CGSize _contentSize; // transform - CGAffineTransform transform_, inverse_; - - // a Camera - CCCamera *camera_; + CGAffineTransform _transform, _inverse; + BOOL _isTransformDirty; + BOOL _isInverseDirty; // a Grid - CCGridBase *grid_; + CCGridBase *_grid; // z-order value - NSInteger zOrder_; + NSInteger _zOrder; // array of children - CCArray *children_; + NSMutableArray *_children; - // weakref to parent - CCNode *parent_; + // weak ref to parent + CCNode *__unsafe_unretained _parent; // a tag. any number you want to assign to the node - NSInteger tag_; + NSInteger _tag; // user data field - void *userData_; - id userObject_; + id _userObject; // Shader - CCGLProgram *shaderProgram_; + CCGLProgram *_shaderProgram; // Server side state - ccGLServerState glServerState_; + ccGLServerState _glServerState; // used to preserve sequence while sorting children with the same zOrder - NSUInteger orderOfArrival_; + NSUInteger _orderOfArrival; // scheduler used to schedule timers and updates - CCScheduler *scheduler_; + CCScheduler *_scheduler; // ActionManager used to handle all the actions - CCActionManager *actionManager_; + CCActionManager *_actionManager; // Is running - BOOL isRunning_; - - BOOL isTransformDirty_; - BOOL isInverseDirty_; + BOOL _isRunning; // is visible - BOOL visible_; - // If YES, the Anchor Point will be (0,0) when you position the CCNode. - // Used by CCLayer and CCScene - BOOL ignoreAnchorPointForPosition_; + BOOL _visible; - BOOL isReorderChildDirty_; + BOOL _isReorderChildDirty; + + CCPhysicsBody* _physicsBody; } /** The z order of the node relative to its "siblings": children of the same parent */ @@ -207,22 +203,37 @@ enum { @property(nonatomic,readwrite,assign) float skewY; /** The rotation (angle) of the node in degrees. 0 is the default rotation angle. Positive values rotate node CW. */ @property(nonatomic,readwrite,assign) float rotation; +/** The rotation (angle) of the node in degrees. 0 is the default rotation angle. Positive values rotate node CW. It only modifies the X rotation performing a horizontal rotational skew . */ +@property(nonatomic,readwrite,assign) float rotationalSkewX; +/** The rotation (angle) of the node in degrees. 0 is the default rotation angle. Positive values rotate node CW. It only modifies the Y rotation performing a vertical rotational skew . */ +@property(nonatomic,readwrite,assign) float rotationalSkewY; + /** The scale factor of the node. 1.0 is the default scale factor. It modifies the X and Y scale at the same time. */ @property(nonatomic,readwrite,assign) float scale; /** The scale factor of the node. 1.0 is the default scale factor. It only modifies the X scale factor. */ @property(nonatomic,readwrite,assign) float scaleX; /** The scale factor of the node. 1.0 is the default scale factor. It only modifies the Y scale factor. */ @property(nonatomic,readwrite,assign) float scaleY; -/** Position (x,y) of the node in points. (0,0) is the left-bottom corner. */ + +@property (nonatomic,readonly) float scaleInPoints; +@property (nonatomic,readonly) float scaleXInPoints; +@property (nonatomic,readonly) float scaleYInPoints; + +@property (nonatomic,assign) CCScaleType scaleType; +@property (nonatomic,readonly) BOOL isPhysicsNode; + +/** Position (x,y) of the node in the unit specified by the positionType property. The distance is measured from one of the corners of the node's parent container, which corner is specified by the positionType property. Default setting is referencing the bottom left corner in points. */ @property(nonatomic,readwrite,assign) CGPoint position; -/** A CCCamera object that lets you move the node using a gluLookAt */ -@property(nonatomic,readonly) CCCamera* camera; +/** Position (x,y) of the node in points from the bottom left corner */ +@property(nonatomic,readonly) CGPoint positionInPoints; +/** Defines the position type used for the X component of the position property */ +@property(nonatomic,readwrite,assign) CCPositionType positionType; /** Array of children */ -@property(nonatomic,readonly) CCArray *children; +@property(nonatomic,readonly) NSArray *children; /** A CCGrid object that is used when applying effects */ -@property(nonatomic,readwrite,retain) CCGridBase* grid; +@property(nonatomic,readwrite,strong) CCGridBase* grid; /** Whether of not the node is visible. Default is YES */ -@property(nonatomic,readwrite,assign) BOOL visible; +@property( nonatomic,readwrite,assign) BOOL visible; /** anchorPoint is the point around which all transformations and positioning manipulations take place. It's like a pin in the node where it is "attached" to its parent. The anchorPoint is normalized, like a percentage. (0,0) means the bottom-left corner and (1,1) means the top-right corner. @@ -236,32 +247,34 @@ enum { */ @property(nonatomic,readonly) CGPoint anchorPointInPoints; -/** The untransformed size of the node in Points - The contentSize remains the same no matter the node is scaled or rotated. - All nodes has a size. Layer and Scene has the same size of the screen. +/** The untransformed size of the node in the unit specified by contentSizeType property. The contentSize remains the same no matter the node is scaled or rotated. @since v0.8 */ -@property (nonatomic,readwrite) CGSize contentSize; +@property (nonatomic,readwrite,assign) CGSize contentSize; +/** The untransformed size of the node in Points. The contentSize remains the same no matter the node is scaled or rotated. */ +@property (nonatomic,readonly) CGSize contentSizeInPoints; +/** Defines the contentSize type used for the widht and height component of the contentSize property. */ +@property (nonatomic,readwrite,assign) CCContentSizeType contentSizeType; + +/** The scene this node is added to, or nil if it's not part of a scene. */ +@property(nonatomic, readonly) CCScene *scene; + +/** The physics body (if any) that this node is attached to. */ +@property(nonatomic, strong) CCPhysicsBody *physicsBody; /** whether or not the node is running */ @property(nonatomic,readonly) BOOL isRunning; /** A weak reference to the parent */ -@property(nonatomic,readwrite,assign) CCNode* parent; -/** If YES, the Anchor Point will be (0,0) when you position the CCNode. - Used by CCLayer and CCScene. - */ -@property(nonatomic,readwrite,assign) BOOL ignoreAnchorPointForPosition; +@property(nonatomic,readwrite,unsafe_unretained) CCNode* parent; /** A tag used to identify the node easily */ @property(nonatomic,readwrite,assign) NSInteger tag; -/** A custom user data pointer */ -@property(nonatomic,readwrite,assign) void* userData; /** Similar to userData, but instead of holding a void* it holds an id */ -@property(nonatomic,readwrite,retain) id userObject; +@property(nonatomic,readwrite,strong) id userObject; /** Shader Program @since v2.0 */ -@property(nonatomic,readwrite,retain) CCGLProgram *shaderProgram; +@property(nonatomic,readwrite,strong) CCGLProgram *shaderProgram; /** used internally for zOrder sorting, don't change this manually */ @property(nonatomic,readwrite) NSUInteger orderOfArrival; @@ -275,14 +288,38 @@ enum { IMPORTANT: If you set a new CCActionManager, then previously created actions are going to be removed. @since v2.0 */ -@property (nonatomic, readwrite, retain) CCActionManager *actionManager; +@property (nonatomic, readwrite, strong) CCActionManager *actionManager; /** CCScheduler used to schedule all "updates" and timers. IMPORTANT: If you set a new CCScheduler, then previously created timers/update are going to be removed. @since v2.0 */ -@property (nonatomic, readwrite, retain) CCScheduler *scheduler; +@property (nonatomic, readwrite, strong) CCScheduler *scheduler; +/** Enabled user interaction on a node, like touch + @since v2.5 + */ +@property ( nonatomic, assign, getter = isUserInteractionEnabled ) BOOL userInteractionEnabled; + +/** Enabled multiple touches inside a single node + @since v2.5 + */ +@property ( nonatomic, assign, getter = isMultipleTouchEnabled ) BOOL multipleTouchEnabled; + +/** Locks the touch to the node if touch started outside + If a touch is moved inside a non locked node, a touchesBegan will be generated + @since v2.5 + */ +@property (nonatomic, assign) BOOL claimsUserInteraction; + +/** Expands ( or contracts ) the hit area of the node + hitAreaExpansion = 0 => hit area has no size + hitAreaExpansion = 1 => hit area has same size as sprite (default) + hitAreaExpansion = 2 => hit area has double width and double height + @since v2.5 + */ +@property (nonatomic,assign) float hitAreaExpansion; + // initializators /** allocates and initializes a node. The node will be created as "autorelease". @@ -291,8 +328,7 @@ enum { /** initializes the node */ -(id) init; - -// scene managment +// scene management /** Event that is called every time the CCNode enters the 'stage'. If the CCNode enters the 'stage' with a transition, this event is called when the transition starts. @@ -342,22 +378,43 @@ enum { // composition: REMOVE +/** Remove itself from its parent node forcing a cleanup. + If the node orphan, then nothing happens. + @since v2.1 + */ +-(void) removeFromParent; + /** Remove itself from its parent node. If cleanup is YES, then also remove all actions and callbacks. If the node orphan, then nothing happens. @since v0.99.3 */ -(void) removeFromParentAndCleanup:(BOOL)cleanup; +/** Removes a child from the container forcing a cleanup + @since v2.1 + */ +-(void) removeChild:(CCNode*)child; + /** Removes a child from the container. It will also cleanup all running actions depending on the cleanup parameter. @since v0.7.1 */ -(void) removeChild: (CCNode*)node cleanup:(BOOL)cleanup; +/** Removes a child from the container by tag value forcing a cleanup. + @since v2.1 + */ +-(void) removeChildByTag:(NSInteger) tag; + /** Removes a child from the container by tag value. It will also cleanup all running actions depending on the cleanup parameter @since v0.7.1 */ -(void) removeChildByTag:(NSInteger) tag cleanup:(BOOL)cleanup; +/** Removes all children from the container forcing a cleanup. + @since v2.1 + */ +-(void) removeAllChildren; + /** Removes all children from the container and do a cleanup all running actions depending on the cleanup parameter. @since v0.7.1 */ @@ -454,7 +511,7 @@ enum { /** schedules the "update" method. It will use the order number 0. This method will be called every frame. Scheduled methods with a lower order value will be called before the ones that have a higher order value. - Only one "udpate" method could be scheduled per node. + Only one "update" method could be scheduled per node. @since v0.99.3 */ @@ -462,7 +519,7 @@ enum { /** schedules the "update" selector with a custom priority. This selector will be called every frame. Scheduled selectors with a lower priority will be called before the ones that have a higher value. - Only one "udpate" selector could be scheduled per node (You can't have 2 'update' selectors). + Only one "update" selector could be scheduled per node (You can't have 2 'update' selectors). @since v0.99.3 */ @@ -474,7 +531,6 @@ enum { */ -(void) unscheduleUpdate; - /** schedules a selector. The scheduled selector will be ticked every frame */ @@ -515,6 +571,9 @@ enum { */ -(void) pauseSchedulerAndActions; +/* Update will be called automatically every frame if "scheduleUpdate" is called, and the node is "live" + */ +-(void) update:(ccTime)delta; // transformation methods @@ -523,32 +582,45 @@ enum { @since v0.7.1 */ - (CGAffineTransform)nodeToParentTransform; + +- (CGPoint) convertPositionToPoints:(CGPoint)position type:(CCPositionType)type; +- (CGPoint) convertPositionFromPoints:(CGPoint)positionInPoints type:(CCPositionType) type; + +- (CGSize) convertContentSizeToPoints:(CGSize)contentSize type:(CCContentSizeType) type; +- (CGSize) convertContentSizeFromPoints:(CGSize)pointSize type:(CCContentSizeType) type; + /** Returns the matrix that transform parent's space coordinates to the node's (local) space coordinates. The matrix is in Pixels. @since v0.7.1 */ - (CGAffineTransform)parentToNodeTransform; -/** Retrusn the world affine transform matrix. The matrix is in Pixels. + +/** Returns the world affine transform matrix. The matrix is in Pixels. @since v0.7.1 */ - (CGAffineTransform)nodeToWorldTransform; + /** Returns the inverse world affine transform matrix. The matrix is in Pixels. @since v0.7.1 */ - (CGAffineTransform)worldToNodeTransform; + /** Converts a Point to node (local) space coordinates. The result is in Points. @since v0.7.1 */ - (CGPoint)convertToNodeSpace:(CGPoint)worldPoint; + /** Converts a Point to world space coordinates. The result is in Points. @since v0.7.1 */ - (CGPoint)convertToWorldSpace:(CGPoint)nodePoint; + /** Converts a Point to node (local) space coordinates. The result is in Points. treating the returned/received node point as anchor relative. @since v0.7.1 */ - (CGPoint)convertToNodeSpaceAR:(CGPoint)worldPoint; + /** Converts a local Point to world space coordinates.The result is in Points. treating the returned/received node point as anchor relative. @since v0.7.1 @@ -556,6 +628,7 @@ enum { - (CGPoint)convertToWorldSpaceAR:(CGPoint)nodePoint; #ifdef __CC_PLATFORM_IOS + /** Converts a UITouch to node (local) space coordinates. The result is in Points. @since v0.7.1 */ @@ -566,4 +639,38 @@ enum { */ - (CGPoint)convertTouchToNodeSpaceAR:(UITouch *)touch; #endif // __CC_PLATFORM_IOS + +/** Compares two nodes in respect to zOrder and orderOfArrival (used for sorting sprites in display list) */ +- (NSComparisonResult) compareZOrderToNode:(CCNode*)node; + +/** check if a touch is inside the node + to expand or shrink the touch area of a node, override this method + @since v2.5 + */ +- (BOOL)hitTestWithWorldPos:(CGPoint)pos; + +@end + + +#pragma mark - CCNodeRGBA + +/** CCNodeRGBA is a subclass of CCNode that implements the CCRGBAProtocol protocol. + + All features from CCNode are valid, plus the following new features: + - opacity + - RGB colors + + Opacity/Color propagates into children that conform to the CCRGBAProtocol if cascadeOpacity/cascadeColor is enabled. + @since v2.1 + */ +@interface CCNodeRGBA : CCNode +{ + GLubyte _displayedOpacity, _realOpacity; + ccColor3B _displayedColor, _realColor; + BOOL _cascadeColorEnabled, _cascadeOpacityEnabled; +} + +// XXX To make BridgeSupport happy +-(GLubyte) opacity; + @end diff --git a/include/cocos2d/CCParallaxNode.h b/include/cocos2d/CCParallaxNode.h index 9f3eac3..b2a1b3f 100644 --- a/include/cocos2d/CCParallaxNode.h +++ b/include/cocos2d/CCParallaxNode.h @@ -25,7 +25,6 @@ */ #import "CCNode.h" -#import "Support/ccCArray.h" /** CCParallaxNode: A node that simulates a parallax scroller @@ -34,12 +33,12 @@ */ @interface CCParallaxNode : CCNode { - ccArray *parallaxArray_; - CGPoint lastPosition; + NSMutableArray *_parallaxArray; + CGPoint _lastPosition; } /** array that holds the offset / ratio of the children */ -@property (nonatomic,readwrite) ccArray * parallaxArray; +@property (nonatomic,readonly) NSArray * parallaxArray; /** Adds a child to the container with a z-order, a parallax ratio and a position offset It returns self, so you can chain several addChilds. diff --git a/include/cocos2d/CCParticleBatchNode.h b/include/cocos2d/CCParticleBatchNode.h index ec5e9bf..010c063 100644 --- a/include/cocos2d/CCParticleBatchNode.h +++ b/include/cocos2d/CCParticleBatchNode.h @@ -58,12 +58,12 @@ @interface CCParticleBatchNode : CCNode { - CCTextureAtlas *textureAtlas_; - ccBlendFunc blendFunc_; + CCTextureAtlas *_textureAtlas; + ccBlendFunc _blendFunc; } /** the texture atlas used for drawing the quads */ -@property (nonatomic, retain) CCTextureAtlas* textureAtlas; +@property (nonatomic, strong) CCTextureAtlas* textureAtlas; /** the blend function used for drawing the quads */ @property (nonatomic, readwrite) ccBlendFunc blendFunc; @@ -86,13 +86,13 @@ -(id)initWithFile:(NSString *)fileImage capacity:(NSUInteger)capacity; /** Add a child into the CCParticleBatchNode */ --(void) addChild:(CCParticleSystem*)child z:(NSInteger)z tag:(NSInteger) aTag; +-(void) addChild:(CCNode*)child z:(NSInteger)z tag:(NSInteger) aTag; /** Inserts a child into the CCParticleBatchNode */ --(void) insertChild:(CCParticleSystem*) pSystem inAtlasAtIndex:(NSUInteger)index; +-(void) insertChild:(CCNode*) pSystem inAtlasAtIndex:(NSUInteger)index; /** remove child from the CCParticleBatchNode */ --(void) removeChild:(CCParticleSystem*) pSystem cleanup:(BOOL)doCleanUp; +-(void) removeChild:(CCNode*) pSystem cleanup:(BOOL)doCleanUp; /** disables a particle by inserting a 0'd quad into the texture atlas */ -(void) disableParticle:(NSUInteger) particleIndex; diff --git a/include/cocos2d/CCParticleExamples.h b/include/cocos2d/CCParticleExamples.h new file mode 100644 index 0000000..747c92a --- /dev/null +++ b/include/cocos2d/CCParticleExamples.h @@ -0,0 +1,117 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2008-2010 Ricardo Quesada + * Copyright (c) 2011 Zynga Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + */ + + +#import "ccMacros.h" +#import "CCParticleSystemQuad.h" + +//! A fire particle system +@interface CCParticleFire: CCParticleSystemQuad +{ +} +// needed for BridgeSupport +-(id) init; +@end + +//! A fireworks particle system +@interface CCParticleFireworks : CCParticleSystemQuad +{ +} +// needed for BridgeSupport +-(id) init; +@end + +//! A sun particle system +@interface CCParticleSun : CCParticleSystemQuad +{ +} +// needed for BridgeSupport +-(id) init; +@end + +//! A galaxy particle system +@interface CCParticleGalaxy : CCParticleSystemQuad +{ +} +// needed for BridgeSupport +-(id) init; +@end + +//! A flower particle system +@interface CCParticleFlower : CCParticleSystemQuad +{ +} +// needed for BridgeSupport +-(id) init; +@end + +//! A meteor particle system +@interface CCParticleMeteor : CCParticleSystemQuad +{ +} +// needed for BridgeSupport +-(id) init; +@end + +//! An spiral particle system +@interface CCParticleSpiral : CCParticleSystemQuad +{ +} +// needed for BridgeSupport +-(id) init; +@end + +//! An explosion particle system +@interface CCParticleExplosion : CCParticleSystemQuad +{ +} +// needed for BridgeSupport +-(id) init; +@end + +//! An smoke particle system +@interface CCParticleSmoke : CCParticleSystemQuad +{ +} +// needed for BridgeSupport +-(id) init; +@end + +//! An snow particle system +@interface CCParticleSnow : CCParticleSystemQuad +{ +} +// needed for BridgeSupport +-(id) init; +@end + +//! A rain particle system +@interface CCParticleRain : CCParticleSystemQuad +{ +} +// needed for BridgeSupport +-(id) init; +@end diff --git a/include/cocos2d/CCParticleSystem.h b/include/cocos2d/CCParticleSystem.h index 10050ff..1910ae0 100644 --- a/include/cocos2d/CCParticleSystem.h +++ b/include/cocos2d/CCParticleSystem.h @@ -58,26 +58,26 @@ enum { }; -/** @typedef tCCPositionType +/** @typedef tCCParticlePositionType possible types of particle positions */ typedef enum { /** Living particles are attached to the world and are unaffected by emitter repositioning. */ - kCCPositionTypeFree, + kCCParticlePositionTypeFree, /** Living particles are attached to the world but will follow the emitter repositioning. Use case: Attach an emitter to an sprite, and you want that the emitter follows the sprite. */ - kCCPositionTypeRelative, + kCCParticlePositionTypeRelative, /** Living particles are attached to the emitter and are translated along with it. */ - kCCPositionTypeGrouped, -}tCCPositionType; + kCCParticlePositionTypeGrouped, +}tCCParticlePositionType; // backward compatible enum { - kPositionTypeFree = kCCPositionTypeFree, - kPositionTypeGrouped = kCCPositionTypeGrouped, + kParticlePositionTypeFree = kCCParticlePositionTypeFree, + kParticlePositionTypeGrouped = kCCParticlePositionTypeGrouped, }; /** @struct tCCParticle @@ -169,25 +169,25 @@ typedef void (*CC_UPDATE_PARTICLE_IMP)(id, SEL, tCCParticle*, CGPoint); @interface CCParticleSystem : CCNode { // is the particle system active ? - BOOL active; + BOOL _active; // duration in seconds of the system. -1 is infinity - float duration; + float _duration; // time elapsed since the start of the system (in seconds) - float elapsed; + float _elapsed; // position is from "superclass" CocosNode - CGPoint sourcePosition; + CGPoint _sourcePosition; // Position variance - CGPoint posVar; + CGPoint _posVar; // The angle (direction) of the particles measured in degrees - float angle; + float _angle; // Angle variance measured in degrees; - float angleVar; + float _angleVar; // Different modes - NSInteger emitterMode_; + NSInteger _emitterMode; union { // Mode A:Gravity + Tangential Accel + Radial Accel struct { @@ -226,81 +226,81 @@ typedef void (*CC_UPDATE_PARTICLE_IMP)(id, SEL, tCCParticle*, CGPoint); // Variance in degrees for rotatePerSecond float rotatePerSecondVar; } B; - } mode; + } _mode; // start ize of the particles - float startSize; + float _startSize; // start Size variance - float startSizeVar; + float _startSizeVar; // End size of the particle - float endSize; + float _endSize; // end size of variance - float endSizeVar; + float _endSizeVar; // How many seconds will the particle live - float life; + float _life; // Life variance - float lifeVar; + float _lifeVar; // Start color of the particles - ccColor4F startColor; + ccColor4F _startColor; // Start color variance - ccColor4F startColorVar; + ccColor4F _startColorVar; // End color of the particles - ccColor4F endColor; + ccColor4F _endColor; // End color variance - ccColor4F endColorVar; + ccColor4F _endColorVar; // start angle of the particles - float startSpin; + float _startSpin; // start angle variance - float startSpinVar; + float _startSpinVar; // End angle of the particle - float endSpin; + float _endSpin; // end angle ariance - float endSpinVar; + float _endSpinVar; // Array of particles - tCCParticle *particles; + tCCParticle *_particles; // Maximum particles - NSUInteger totalParticles; + NSUInteger _totalParticles; // Count of active particles - NSUInteger particleCount; + NSUInteger _particleCount; // Number of allocated particles - NSUInteger allocatedParticles; + NSUInteger _allocatedParticles; // How many particles can be emitted per second - float emissionRate; - float emitCounter; + float _emissionRate; + float _emitCounter; // Texture of the particles - CCTexture2D *texture_; + CCTexture2D *_texture; // blend function - ccBlendFunc blendFunc_; + ccBlendFunc _blendFunc; // Texture alpha behavior - BOOL opacityModifyRGB_; + BOOL _opacityModifyRGB; // movment type: free or grouped - tCCPositionType positionType_; + tCCParticlePositionType _particlePositionType; // Whether or not the node will be auto-removed when there are not particles - BOOL autoRemoveOnFinish_; + BOOL _autoRemoveOnFinish; // particle idx - NSUInteger particleIdx; + NSUInteger _particleIdx; // Optimization - CC_UPDATE_PARTICLE_IMP updateParticleImp; - SEL updateParticleSel; + CC_UPDATE_PARTICLE_IMP _updateParticleImp; + SEL _updateParticleSel; // for batching. If nil, then it won't be batched - CCParticleBatchNode *batchNode_; + CCParticleBatchNode *_batchNode; // index of system in batch node array - NSUInteger atlasIndex_; + NSUInteger _atlasIndex; //YES if scaled or rotated - BOOL transformSystemDirty_; + BOOL _transformSystemDirty; } /** Is the emitter active */ @@ -379,7 +379,7 @@ typedef void (*CC_UPDATE_PARTICLE_IMP)(id, SEL, tCCParticle*, CGPoint); /** maximum particles of the system */ @property (nonatomic,readwrite,assign) NSUInteger totalParticles; /** conforms to CocosNodeTexture protocol */ -@property (nonatomic,readwrite, retain) CCTexture2D * texture; +@property (nonatomic,readwrite, strong) CCTexture2D * texture; /** conforms to CocosNodeTexture protocol */ @property (nonatomic,readwrite) ccBlendFunc blendFunc; /** does the alpha value modify color */ @@ -395,7 +395,7 @@ typedef void (*CC_UPDATE_PARTICLE_IMP)(id, SEL, tCCParticle*, CGPoint); /** particles movement type: Free or Grouped @since v0.8 */ -@property (nonatomic,readwrite) tCCPositionType positionType; +@property (nonatomic,readwrite) tCCParticlePositionType particlePositionType; /** whether or not the node will be auto-removed when it has no particles left. By default it is NO. @since v0.8 @@ -408,7 +408,7 @@ typedef void (*CC_UPDATE_PARTICLE_IMP)(id, SEL, tCCParticle*, CGPoint); @property (nonatomic,readwrite) NSInteger emitterMode; /** weak reference to the CCSpriteBatchNode that renders the CCSprite */ -@property (nonatomic,readwrite,assign) CCParticleBatchNode *batchNode; +@property (nonatomic,readwrite,unsafe_unretained) CCParticleBatchNode *batchNode; @property (nonatomic,readwrite) NSUInteger atlasIndex; @@ -419,6 +419,12 @@ typedef void (*CC_UPDATE_PARTICLE_IMP)(id, SEL, tCCParticle*, CGPoint); */ +(id) particleWithFile:(NSString*)plistFile; +/* creates an void particle emitter with a maximun number of particles. + @since v2.1 +*/ ++(id) particleWithTotalParticles:(NSUInteger) numberOfParticles; + + /** initializes a CCParticleSystem from a plist file. This plist files can be creted manually or with Particle Designer: http://particledesigner.71squared.com/ @@ -431,6 +437,11 @@ typedef void (*CC_UPDATE_PARTICLE_IMP)(id, SEL, tCCParticle*, CGPoint); */ -(id) initWithDictionary:(NSDictionary*)dictionary; +/** initializes a particle system from a NSDictionary and the path from where to load the png + @since v2.1 + */ +-(id) initWithDictionary:(NSDictionary *)dictionary path:(NSString*)dirname; + //! Initializes a system with a fixed number of particles -(id) initWithTotalParticles:(NSUInteger) numberOfParticles; //! stop emitting particles. Running particles will continue to run until they die diff --git a/include/cocos2d/CCParticleSystemQuad.h b/include/cocos2d/CCParticleSystemQuad.h index 613fee3..4e264db 100644 --- a/include/cocos2d/CCParticleSystemQuad.h +++ b/include/cocos2d/CCParticleSystemQuad.h @@ -46,10 +46,10 @@ */ @interface CCParticleSystemQuad : CCParticleSystem { - ccV3F_C4B_T2F_Quad *quads_; // quads to be rendered - GLushort *indices_; // indices - GLuint VAOname_; - GLuint buffersVBO_[2]; //0: vertex 1: indices + ccV3F_C4B_T2F_Quad *_quads; // quads to be rendered + GLushort *_indices; // indices + GLuint _VAOname; + GLuint _buffersVBO[2]; //0: vertex 1: indices } /** initialices the indices for the vertices */ @@ -62,7 +62,7 @@ WARNING: this method is experimental. Use setTexture:withRect instead. @since v0.99.4 */ --(void)setDisplayFrame:(CCSpriteFrame*)spriteFrame; +-(void)setSpriteFrame:(CCSpriteFrame*)spriteFrame; /** Sets a new texture with a rect. The rect is in Points. @since v0.99.4 diff --git a/include/cocos2d/CCPhysics+ObjectiveChipmunk.h b/include/cocos2d/CCPhysics+ObjectiveChipmunk.h new file mode 100644 index 0000000..78b2da7 --- /dev/null +++ b/include/cocos2d/CCPhysics+ObjectiveChipmunk.h @@ -0,0 +1,132 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2013 Scott Lembcke + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#import "CCPhysicsNode.h" +#import "CCPhysicsJoint.h" +#import "ObjectiveChipmunk/ObjectiveChipmunk.h" + + +// For comparison: +// https://developer.apple.com/library/ios/documentation/SpriteKit/Reference/SpriteKitFramework_Ref/_index.html#//apple_ref/doc/uid/TP40013041 + +/* + TODO: + * Sensors + * Collision only mode. (Are sensors good enough?) + * Projectile bodies? + * Fixed timesteps are a hack. + * Currently body must be set before adding to a parent node. + * Currently nodes must have rigid transforms. + * Currently a parent's absolute transform must be identity. + * Currently nodes with a physics body are always considered to have dirty transforms. + * Body constructors are still a little temporary. + * Objective-Chipmunk interop. + * affectedByGravity and allowsRotation properties not implemented. + * Joints. + * Queries. + * Need to rename the CCPhysicsBody.absolute* properties. (not really absolute anymore) + + Consider: + * Interpolation? + * Post-step callbacks? + * What to do about CCActions? + * What to do about transform changes? + * Chain/loop body types have multiple ChipmunkShapes and thus will get multiple callbacks. + * Check argument types for delegate callbacks? + * Angular velocity in degrees? + * Warnings for CCPhysicsCollisionPair methods in the wrong event cycle? + * Should CCPhysicsCollisionPair.userData retain? + + Probably Definitely Not: + * Body queries? +*/ + + +@interface CCPhysicsBody(ObjectiveChipmunk) + +/// The CCNode this physics body is attached to. +@property(nonatomic, strong) CCNode *node; +/// The CCPhysicsNode this body is added to. +@property(nonatomic, readonly) CCPhysicsNode *physicsNode; +/// Returns YES if the body is currently added to a physicsNode. +@property(nonatomic, readonly) BOOL isRunning; + +// TODO should probably rename these. +/// The position of the body relative to the space. +@property(nonatomic, assign) cpVect absolutePosition; +/// The rotation of the body relative to the space. +@property(nonatomic, assign) cpFloat absoluteRadians; +/// The transform of the body relative to the space. +@property(nonatomic, readonly) cpTransform absoluteTransform; + +/// Implements the ChipmunkObject protocol. +@property(nonatomic, readonly) NSArray *chipmunkObjects; + +// Used for deferring collision type setup until there is access to the physics node. +-(void)willAddToPhysicsNode:(CCPhysicsNode *)physics; +-(void)didRemoveFromPhysicsNode:(CCPhysicsNode *)physics; + +@end + + +@interface CCPhysicsJoint(ObjectiveChipmunk) + +/// Access to the underlying Objective-Chipmunk object. +@property(nonatomic, readonly) ChipmunkConstraint *constraint; + +@end + + +@interface CCPhysicsCollisionPair(ObjectiveChipmunk) + +/// Access to the underlying Objective-Chipmunk object. +@property(nonatomic, assign) cpArbiter *arbiter; + +@end + + +@interface CCPhysicsNode(ObjectiveChipmunk) + +/// Access to the underlying Objective-Chipmunk object. +@property(nonatomic, readonly) ChipmunkSpace *space; + +/// Intern and copy a string to ensure it can be checked by reference +/// Used for collision type identifiers by CCPhysics. +/// nil and @"default" both return the value nil. +-(NSString *)internString:(NSString *)string; + +/// Retain and track a category identifier and return it's index. +/// Up to 32 categories can be tracked for a space. +-(NSUInteger)indexForCategory:(NSString *)category; + +/// Convert an array of NSStrings for collision category identifiers into a category bitmask. +/// The categories are retained and assigned indexes. +/// Up to 32 categories can be tracked for a space. +-(cpBitmask)bitmaskForCategories:(NSArray *)categories; + +/// Convert a cpBitmask value to an array of collision category strings. +/// Ignores any bits that don't have a collision category assigned in the physics node. +-(NSArray *)categoriesForBitmask:(cpBitmask)categories; + +@end diff --git a/include/cocos2d/CCPhysicsJoint.h b/include/cocos2d/CCPhysicsJoint.h new file mode 100644 index 0000000..ede7a4b --- /dev/null +++ b/include/cocos2d/CCPhysicsJoint.h @@ -0,0 +1,59 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2013 Scott Lembcke + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#import "CCPhysicsBody.h" + +@interface CCPhysicsJoint : NSObject + +/// The first body this joint is attached to. +@property(nonatomic, strong) CCPhysicsBody *bodyA; +/// The second body this joint is attached to. +@property(nonatomic, strong) CCPhysicsBody *bodyB; + +/// The maximum force this joint is allowed to use. +/// Defaults to INFINITY. +@property(nonatomic, assign) CGFloat maxForce; +/// The maximum speed this joint is allowed to fix any stretching at in absolute coordinates or radians (depending on the joint). +/// Defaults to INFINITY. +@property(nonatomic, assign) CGFloat maxBias; + +/// Whether not the connected bodies are allowed to collide with one another. +/// Defaults to YES. +@property(nonatomic, assign) BOOL collideBodies; + +/// Depending on the joint, either the magnitude of the linear or angular impulse that this joint applied on the previous fixed time step. +@property(nonatomic, readonly) CGFloat impulse; + +/// Whether the joint is active or not. +/// NOTE: Be careful when reactivating a joint if the two bodies have drifted apart. It will cause them to snap back together. +@property(nonatomic, assign) BOOL enabled; + +/// Maximum force that can be applied before the joint disables itself. +/// To avoid problems with round-off errors, make sure that this value is lower than CCPhysicsJoint.maxForce. +/// Defaults to INFINITY. +@property(nonatomic, assign) CGFloat breakingForce; + +@end + +// TODO Joint subclasses. diff --git a/include/cocos2d/CCPhysicsNode.h b/include/cocos2d/CCPhysicsNode.h new file mode 100644 index 0000000..43d6438 --- /dev/null +++ b/include/cocos2d/CCPhysicsNode.h @@ -0,0 +1,153 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2013 Scott Lembcke + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#import "CCNode.h" +#import "CCPhysicsbody.h" + +#pragma clang diagnostic push COCOS2D +#pragma clang diagnostic ignored "-Wfloat-equal" +#import "ObjectiveChipmunk/ObjectiveChipmunk.h" +#pragma clang diagnostic pop COCOS2D + + +/// Contains information about colliding physics bodies. +/// NOTE: There is only one CCPhysicsCollisionPair object per scene and it's reused. +/// Only use the CCPhysicsCollisionPair object in the method or block it was given to you in. +@interface CCPhysicsCollisionPair : NSObject + +/// The contact information from the two colliding bodies. +@property(nonatomic, readonly) cpContactPointSet contacts; + +/// Ignore the collision between these two physics bodies until they stop colliding. +/// It's idomatic to write "return [pair ignore];" if using this method from a CCCollisionPairDelegate pre-solve method. +/// Always returns false. +-(BOOL)ignore; + +/// The friction coefficient for this pair of colliding bodies. +/// The default value is pair.bodyA.friction*pair.bodyB.friction. +/// Can be overriden in a CCCollisionPairDelegate pre-solve method to change the collision. +@property(nonatomic, assign) CGFloat friction; +/// The restitution coefficient for this pair of colliding bodies. +/// The default value is "pair.bodyA.elasticity*pair.bodyB.elasticity". +/// Can be overriden in a CCCollisionPairDelegate pre-solve method to change the collision. +@property(nonatomic, assign) CGFloat restitution; +/// The relative surface velocities of the two colliding shapes. +/// The default value is CGPointZero. +/// Can be overriden in a CCCollisionPairDelegate pre-solve method to change the collision. +@property(nonatomic, assign) CGPoint surfaceVelocity; + +// NOTE: The following two methods return the value from the previous collision. +// They are intended to be called from a CCPhysicsCollisionPairDelegate post-solve method or from a [CCPhysicsBody eachContactPair:] block. +// TODO Is it possible to make a warning for this? + +/// The amount of kinetic energy disappated by the last collision of the two bodies. +/// This is roughly equivalent to the idea of damage. +/// NOTE: By definition, fully elastic collisions do not lose any energy or cause any permanent damage. +@property(nonatomic, readonly) CGFloat totalKineticEnergy; +/// The total impulse applied by this collision to the colliding bodies. +@property(nonatomic, readonly) CGPoint totalImpulse; + +/// A persistent object reference associated with these two colliding objects. +/// If you want to store some information about a collision from time step to time step, store it here. +// TODO Possible to add a default to release it automatically? +@property(nonatomic, assign) id userData; + +@end + + +/// Delegate type called when two physics bodies collide. +/// The final two parameter names should be replaced with strings used with CCPhysicsBody.collisionType. +/// If both final parameter names are "default" then the method is called when a more specific method isn't found. +/// "wildcard" can be used as the final parameter name to mean "collides with anything". +@protocol CCPhysicsCollisionDelegate + +@optional +/// Begin methods are called on the first fixed time step when two bodies begin colliding. +/// If you return NO from a begin method, the collision between the two bodies will be ignored. +-(BOOL)ccPhysicsCollisionBegin:(CCPhysicsCollisionPair *)pair typeA:(CCPhysicsBody *)bodyA typeB:(CCPhysicsBody *)bodyB; +/// Pre-solve methods are called every fixed time step when two bodies are in contact before the physics solver runs. +/// You can call use properties such as friction, restitution, surfaceVelocity on CCPhysicsCollisionPair from a post-solve method. +/// If you return NO from a pre-solve method, the collision will be ignored for the current time step. +-(BOOL)ccPhysicsCollisionPreSolve:(CCPhysicsCollisionPair *)pair typeA:(CCPhysicsBody *)bodyA typeB:(CCPhysicsBody *)bodyB; +/// Post-solve methods are called every fixed time step when two bodies are in contact after the physics solver runs. +/// You can call use properties such as totalKineticEnergy and totalImpulse on CCPhysicsCollisionPair from a post-solve method. +-(void)ccPhysicsCollisionPostSolve:(CCPhysicsCollisionPair *)pair typeA:(CCPhysicsBody *)bodyA typeB:(CCPhysicsBody *)bodyB; +/// Separate methods are called the first fixed time step after two bodies stop colliding. +-(void)ccPhysicsCollisionSeparate:(CCPhysicsCollisionPair *)pair typeA:(CCPhysicsBody *)bodyA typeB:(CCPhysicsBody *)bodyB; + +@end + + +@interface CCPhysicsNode : CCNode + +/// Should the node draw a debug overlay of the joints and collision shapes? +/// Defaults to NO +@property(nonatomic, assign) BOOL debugDraw; + + +// TODO Would *really* like to push this to CCScheduler. +// Will be a lot of work and testing, so it's here for now. + +/// How often the physics is updated. +/// This is run independently of the framerate. +/// Defaults to 60hz. +@property(nonatomic, assign) ccTime fixedRate; + +/// Maximum delta time to process in a single update call. +/// Defaults to 1/15. +@property(nonatomic, assign) ccTime maxDeltaTime; + +/// Previous fixed update time. +@property(nonatomic, readonly) ccTime fixedTime; + +/// Gravity applied to the dynamic bodies in the world. +/// Defaults to CGPointZero. +@property(nonatomic, assign) CGPoint gravity; + +/// Physics bodies fall asleep when a group of them move slowly for longer than the threshold. +/// Sleeping bodies use minimal CPU resources and wake automatically when a collision happens. +/// Defaults to 0.5 seconds. +@property(nonatomic, assign) ccTime sleepTimeThreshold; + +/// The delegate that is called when two physics bodies collide. +@property(nonatomic, assign) NSObject *collisionDelegate; + +// TODO think about these more. +// More variations? Filtering? thickness? +-(CCPhysicsBody *)pointQueryAt:(CGPoint)point within:(CGFloat)radius block:(BOOL (^)(CCPhysicsBody *body, CGPoint nearest, CGFloat distance))block; +-(CCPhysicsBody *)rayQueryFirstFrom:(CGPoint)start to:(CGPoint)end block:(BOOL (^)(CCPhysicsBody *body, CGPoint point, CGPoint normal, CGFloat distance))block; +-(BOOL)rectQuery:(CGRect)rect block:(BOOL (^)(CCPhysicsBody *body))block; +// Unsure about this one. +//-(BOOL)bodyQuery:(CCPhysicsBody *)body withPosition:(CGPoint)position rotation:(CGFloat)rotation block:(BOOL (^)(ChipmunkBody *bodyB, cpContactPointSet))block; + +@end + + +@interface CCNode(CCPhysics) + +/// Nearest CCPhysicsNode ancestor of this node, or nil if none. +/// Unlike CCPhysicsBody.physicsNode, this will return a value before onEnter is called on the node. +-(CCPhysicsNode *)physicsNode; + +@end diff --git a/include/cocos2d/CCPhysicsbody.h b/include/cocos2d/CCPhysicsbody.h new file mode 100644 index 0000000..3ba864e --- /dev/null +++ b/include/cocos2d/CCPhysicsbody.h @@ -0,0 +1,174 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2013 Scott Lembcke + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#import "cocos2d.h" + +@class CCPhysicsCollisionPair; + +typedef enum ccPhysicsBodyType { + kCCPhysicsBodyTypeDynamic, + kCCPhysicsBodyTypeKinematic, + kCCPhysicsBodyTypeStatic, +} ccPhysicsBodyType; + + +/// Basic rigid body type. +@interface CCPhysicsBody : NSObject + +//MARK: Constructors: + +/// Create a circular body. ++(CCPhysicsBody *)bodyWithCircleOfRadius:(CGFloat)radius andCenter:(CGPoint)center; +/// Create a box shaped body with rounded corners. ++(CCPhysicsBody *)bodyWithRect:(CGRect)rect cornerRadius:(CGFloat)cornerRadius; +/// Create a pill shaped body with rounded corners that stretches from 'start' to 'end'. ++(CCPhysicsBody *)bodyWithPillFrom:(CGPoint)from to:(CGPoint)to cornerRadius:(CGFloat)cornerRadius; +/// Create a convex polygon shaped body with rounded corners. +/// If the points do not form a convex polygon, then a convex hull will be created for them automatically. ++(CCPhysicsBody *)bodyWithPolygonFromPoints:(CGPoint *)points count:(NSUInteger)count cornerRadius:(CGFloat)cornerRadius; + +// Be careful with dynamic segment-based bodies. +// Because the segments are allowed to be very thin, it can cause problems with collision detection. + +/// Create a closed segment-based body from a series of points and the given corner radius. ++(CCPhysicsBody *)bodyWithSegmentLoopFromPoints:(CGPoint *)points count:(NSUInteger)count cornerRadius:(CGFloat)cornerRadius; +/// Create an open ended segment-based body from a series of points and the given corner radius. ++(CCPhysicsBody *)bodyWithSegmentChainFromPoints:(CGPoint *)points count:(NSUInteger)count cornerRadius:(CGFloat)cornerRadius; + +//MARK: Basic Properties: + +/// Mass of the physics body. +/// Changing this property also changes the density. +/// Defaults to 1.0. +@property(nonatomic, assign) CGFloat mass; +/// Density of the physics body. +/// Changing this property also changes the mass. +@property(nonatomic, assign) CGFloat density; +/// Surface area of the physics body. +@property(nonatomic, readonly) CGFloat area; +/// Surface friction of the physics body. +/// When two objects collide, their friction is multiplied together. +/// The calculated value can be overriden in a CCCollisionPairDelegate pre-solve method. +/// Defaults to 0.7. +@property(nonatomic, assign) CGFloat friction; +/// Surface friction of the physics body. +/// When two objects collide, their elaticity is multiplied together. +/// The calculated value can be ovrriden in a CCCollisionPairDelegate pre-solve method. +/// Defaults to 0.2. +@property(nonatomic, assign) CGFloat elasticity; +/// Velocity of the surface of the object relative to it's normal velocity. +/// This is useful for modeling conveyor belts or the feet of a player character. +/// The calculated surface velocity of two colliding shapes by default only affects their friction. +/// The calculated value can be overriden in a CCCollisionPairDelegate pre-solve method. +/// Defaults to CGPointZero. +@property(nonatomic, assign) CGPoint surfaceVelocity; + +//MARK: Simulation Properties: + +/// Whether or not the physics body is affected by gravity. +/// Defaults to YES. +@property(nonatomic, assign) BOOL affectedByGravity; +/// Whether or not the physics body should be allowed to rotate. +/// Defaults to YES. +@property(nonatomic, assign) BOOL allowsRotation; +/// Whether the physics body is dynamic, kinematic or static. +/// Defaults to CP_BODY_TYPE_DYNAMIC. +@property(nonatomic, assign) ccPhysicsBodyType type; + +//MARK: Collision and Contact: + +/// Sensors call collision delegate methods, but don't cause collisions between bodies. +/// Defaults to NO. +@property(nonatomic, assign) BOOL sensor; +/// If two physics bodies share the same group identifier, then they don't collide. +/// Defaults to nil. +@property(nonatomic, assign) id collisionGroup; +/// A string that identifies which collision pair delegate method should be called. +/// Defaults to @"default". +@property(nonatomic, copy) NSString *collisionType; +/// An array of NSStrings of category names this physics body is a member of. +/// Up to 32 categories can be used in a single scene. +/// The default value is nil, which means the physics body exists in all categories. +@property(nonatomic, copy) NSArray *collisionCategories; +/// An array of NSStrings of category names this physics body will collide with. +/// The default value is nil, which means the physics body collides with all categories. +@property(nonatomic, copy) NSArray *collisionMask; + +/// Iterate over all of the CCPhysicsCollisionPairs this body is currently in contact with. +/// NOTE: The CCPhysicsCollisionPair object is shared and you should not store a reference to it. +-(void)eachCollisionPair:(void (^)(CCPhysicsCollisionPair *pair))block; + +//MARK: Velocity: + +/// The velocity of the body in absolute coordinates. +@property(nonatomic, assign) CGPoint velocity; +/// Angular velocity of the body in radians per second. +// TODO should match Cocos2D's degrees instead? +@property(nonatomic, assign) CGFloat angularVelocity; + +//MARK: Forces, Torques and Impulses: + +/// Linear force applied to the body this fixed timestep. +@property(nonatomic, assign) CGPoint force; +/// Torque applied to the body this fixed timestep. +@property(nonatomic, assign) CGFloat torque; + +// Impulses immediately change the velocity and angular velocity of a physics body as if a very sudden force happened. +// This works well for applying recoil from firing a projectile, applying custom collision forces, or jumping a character. + +/// Accumulate a torque on the body. +-(void)applyTorque:(CGFloat)torque; +/// Apply an angular impulse +-(void)applyAngularImpulse:(CGFloat)impulse; + +/// Accumulate a force on the body. +-(void)applyForce:(CGPoint)force; +/// Accumulate an impulse on the body. +-(void)applyImpulse:(CGPoint)impulse; + +/// Accumulate force and torque on the body from a force applied at point in the parent CCNode's coordinates. +/// The force will be rotated by, but not scaled by the CCNode's transform. +-(void)applyForce:(CGPoint)force atLocalPoint:(CGPoint)point; +/// Accumulate an impulse and angular impulse on the body from an impulse applied at point in the parent CCNode's coordinates. +/// The impulse will be rotated by, but not scaled by the CCNode's transform. +-(void)applyImpulse:(CGPoint)impulse atLocalPoint:(CGPoint)point; + +/// Accumulate force and torque on the body from a force applied at point in absolute coordinates. +-(void)applyForce:(CGPoint)force atWorldPoint:(CGPoint)point; +/// Accumulate an impulse and angular impulse on the body from an impulse applied at point in absolute coordinates. +-(void)applyImpulse:(CGPoint)impulse atWorldPoint:(CGPoint)point; + +//MARK: Misc. + +/// Joints connected to this body. +@property(nonatomic, readonly) NSArray *joints; + +/// Sleeping bodies are not simulated and use minimal CPU resources. +/// Normally bodies fall asleep automatically when they stop moving, but you can trigger sleeping explicity. +@property(nonatomic, assign) BOOL sleeping; + +/// The CCNode this physics body is attached to. +@property(nonatomic, readonly) CCNode *node; + +@end diff --git a/include/cocos2d/CCProgressTimer.h b/include/cocos2d/CCProgressTimer.h index ce058d9..5c4dcc6 100644 --- a/include/cocos2d/CCProgressTimer.h +++ b/include/cocos2d/CCProgressTimer.h @@ -42,19 +42,17 @@ typedef enum { The progress can be Radial, Horizontal or vertical. @since v0.99.1 */ -@interface CCProgressTimer : CCNode { - CCProgressTimerType type_; - float percentage_; - CCSprite *sprite_; +@interface CCProgressTimer : CCNodeRGBA { + CCProgressTimerType _type; + float _percentage; + CCSprite *_sprite; - int vertexDataCount_; - ccV2F_C4B_T2F *vertexData_; - CGPoint midpoint_; - CGPoint barChangeRate_; - BOOL reverseDirection_; + int _vertexDataCount; + ccV2F_C4B_T2F *_vertexData; + CGPoint _midpoint; + CGPoint _barChangeRate; + BOOL _reverseDirection; } -@property (nonatomic) ccColor3B color; -@property (nonatomic) GLubyte opacity; /** Change the percentage to change progress. */ @property (nonatomic, readwrite) CCProgressTimerType type; @property (nonatomic, readwrite) BOOL reverseDirection; @@ -85,7 +83,7 @@ typedef enum { @property (nonatomic, readwrite) float percentage; /** The image to show the progress percentage */ -@property (nonatomic, readwrite, retain) CCSprite *sprite; +@property (nonatomic, readwrite, strong) CCSprite *sprite; /** Creates a progress timer with the sprite as the shape the timer goes through */ + (id) progressWithSprite:(CCSprite*) sprite; diff --git a/include/cocos2d/CCProtocols.h b/include/cocos2d/CCProtocols.h index e55ec92..b2cb9f3 100644 --- a/include/cocos2d/CCProtocols.h +++ b/include/cocos2d/CCProtocols.h @@ -25,33 +25,44 @@ #import "ccMacros.h" #import "ccTypes.h" -#import "CCTexture2D.h" -#pragma mark - -#pragma mark CCRGBAProtocol + +@class CCTexture2D; +@class CCDirector; + +#pragma mark - CCRGBAProtocol /// CC RGBA protocol @protocol CCRGBAProtocol -/** sets Color +/** sets and returns the color (tint) @since v0.8 */ --(void) setColor:(ccColor3B)color; -/** returns the color - @since v0.8 - */ --(ccColor3B) color; +@property (nonatomic) ccColor3B color; +/** returns the displayed color */ +@property (nonatomic, readonly) ccColor3B displayedColor; +/** whether or not color should be propagated to its children */ +@property (nonatomic, getter = isCascadeColorEnabled) BOOL cascadeColorEnabled; + +/** recursive method that updates display color */ +- (void)updateDisplayedColor:(ccColor3B)color; -/// returns the opacity --(GLubyte) opacity; -/** sets the opacity. - @warning If the the texture has premultiplied alpha then, the R, G and B channels will be modifed. +/** sets and returns the opacity. + @warning If the the texture has premultiplied alpha then, the R, G and B channels will be modified. Values goes from 0 to 255, where 255 means fully opaque. */ --(void) setOpacity: (GLubyte) opacity; +@property (nonatomic) GLubyte opacity; +/** returns the displayed opacity */ +@property (nonatomic, readonly) GLubyte displayedOpacity; +/** whether or not opacity should be propagated to its children */ +@property (nonatomic, getter = isCascadeOpacityEnabled) BOOL cascadeOpacityEnabled; + +/** recursive method that updates the displayed opacity */ +- (void)updateDisplayedOpacity:(GLubyte)opacity; + @optional /** sets the premultipliedAlphaOpacity property. If set to NO then opacity will be applied as: glColor(R,G,B,opacity); - If set to YES then oapcity will be applied as: glColor(opacity, opacity, opacity, opacity ); + If set to YES then opacity will be applied as: glColor(opacity, opacity, opacity, opacity ); Textures with premultiplied alpha will have this property by default on YES. Otherwise the default value is NO @since v0.8 */ @@ -62,10 +73,9 @@ -(BOOL) doesOpacityModifyRGB; @end -#pragma mark - -#pragma mark CCBlendProtocol +#pragma mark - CCBlendProtocol /** - You can specify the blending fuction. + You can specify the blending function. @since v0.99.0 */ @protocol CCBlendProtocol @@ -76,8 +86,7 @@ @end -#pragma mark - -#pragma mark CCTextureProtocol +#pragma mark - CCTextureProtocol /** CCNode objects that uses a Texture2D to render the images. The texture can have a blending function. @@ -85,7 +94,7 @@ src=GL_ONE dst= GL_ONE_MINUS_SRC_ALPHA else src=GL_SRC_ALPHA dst= GL_ONE_MINUS_SRC_ALPHA - But you can change the blending funtion at any time. + But you can change the blending function at any time. @since v0.8.0 */ @protocol CCTextureProtocol @@ -95,8 +104,7 @@ -(void) setTexture:(CCTexture2D*)texture; @end -#pragma mark - -#pragma mark CCLabelProtocol +#pragma mark - CCLabelProtocol /** Common interface for Labels */ @protocol CCLabelProtocol /** sets a new label using an NSString. @@ -107,26 +115,45 @@ -(NSString*) string; @optional /** sets a new label using a CString. - It is faster than setString since it doesn't require to alloc/retain/release an NString object. @since v0.99.0 */ -(void) setCString:(char*)label; @end -#pragma mark - -#pragma mark CCDirectorDelegate +#pragma mark - CCDirectorDelegate /** CCDirector delegate */ @protocol CCDirectorDelegate @optional -/** Called by CCDirector when the porjection is updated, and "custom" projection is used */ +/** Called by CCDirector when the projection is updated, and "custom" projection is used */ -(void) updateProjection; #ifdef __CC_PLATFORM_IOS /** Returns a Boolean value indicating whether the CCDirector supports the specified orientation. Default value is YES (supports all possible orientations) */ - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation; +// Commented. See issue #1453 for further info: http://code.google.com/p/cocos2d-iphone/issues/detail?id=1453 +//- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration; + +/** Called when projection is resized (due to layoutSubviews on the view). This is important to respond to in order to setup your scene with the proper dimensions (which only exist after the first call to layoutSubviews) so that you can set your scene as early as possible to avoid startup flicker + */ +-(void) directorDidReshapeProjection:(CCDirector*)director; + #endif // __CC_PLATFORM_IOS @end + + +#pragma mark - CCAccelerometerDelegate + +#ifdef __CC_PLATFORM_IOS +/** CCAccelerometerDelegate delegate */ +@class UIAcceleration; +@class UIAccelerometer; +@protocol CCAccelerometerDelegate + +@optional +- (void)accelerometer:(UIAccelerometer *)accelerometer didAccelerate:(UIAcceleration *)acceleration; +@end +#endif // __CC_PLATFORM_IOS diff --git a/include/cocos2d/CCRenderTargetNode.h b/include/cocos2d/CCRenderTargetNode.h deleted file mode 100644 index 32d5686..0000000 --- a/include/cocos2d/CCRenderTargetNode.h +++ /dev/null @@ -1,39 +0,0 @@ -// -// Created by krzysztof.zablocki on 8/19/12. -// -// -// - - -#import -#import "ccMacros.h" -#import "CCNode.h" -#import "CCSprite.h" -#import "Support/OpenGL_Internal.h" -#import "kazmath/mat4.h" -@class CCRenderTexture; - -#define CC_GL_CLEAR_COLOR GL_COLOR_BUFFER_BIT -#define CC_GL_CLEAR_DEPTH GL_DEPTH_BUFFER_BIT -#define CC_GL_CLEAR_STENCIL CC_GL_CLEAR_STENCIL - -/* - CCRenderTargetNode is a real rendering target node, it render all its children into CCRenderTexture. - Each CCRenderTexture has lazy created CCRenderTargetNode, so you can add any nodes that you want to render inside render texture into renderTexture.renderTargetNode. - You can also use it to render to texture that isn't in tree, you just need to make sure the render texture isn't released before this node, as it doesn't retain renderTexture. - If you specify clearFlags for render target node it will clear render texture content each frame before before rendering. - */ -@interface CCRenderTargetNode : CCNode -//- (void)beginWithClear:(float)r g:(float)g b:(float)b a:(float)a depth:(float)depthValue stencil:(int)stencilValue; - -@property (nonatomic, assign) GLbitfield clearFlags; // default to none, use CC_GL_CLEAR_X - -//! values used for clearing when clearFlags are set to corresponding bits -@property (nonatomic, assign) ccColor4F clearColor; -@property (nonatomic, assign) GLfloat clearDepth; -@property (nonatomic, assign) GLint clearStencil; - -//! doesn't retain render texture, it's your responsibility to make sure texture is not released before this node -- (id)initWithRenderTexture:(CCRenderTexture *)texture; - -@end diff --git a/include/cocos2d/CCRenderTexture.h b/include/cocos2d/CCRenderTexture.h index 08a444f..f6fd8a7 100644 --- a/include/cocos2d/CCRenderTexture.h +++ b/include/cocos2d/CCRenderTexture.h @@ -29,8 +29,11 @@ #import "CCNode.h" #import "CCSprite.h" #import "Support/OpenGL_Internal.h" + +#pragma clang diagnostic push COCOS2D +#pragma clang diagnostic ignored "-Wignored-qualifiers" #import "kazmath/mat4.h" -#import "CCRenderTargetNode.h" +#pragma clang diagnostic pop COCOS2D #ifdef __CC_PLATFORM_IOS #import @@ -46,35 +49,50 @@ typedef enum /** CCRenderTexture is a generic rendering target. To render things into it, simply construct a render target, call begin on it, call visit on any cocos2d - scenes or objects to render them, and call end. For convienience, render texture + scenes or objects to render them, and call end. For convenience, render texture adds a sprite as its display child with the results, so you can simply add the render texture to your scene and treat it like any other CCNode. There are also functions for saving the render texture to disk in PNG or JPG format. - + @since v0.8.1 */ @interface CCRenderTexture : CCNode { - GLuint fbo_; - GLuint depthRenderBufffer_; - GLint oldFBO_; - CCTexture2D* texture_; - CCSprite* sprite_; - CCRenderTargetNode *renderTargetNode_; - GLenum pixelFormat_; + GLuint _FBO; + GLuint _depthRenderBufffer; + GLint _oldFBO; + CCTexture2D* _texture; + CCSprite* _sprite; + GLenum _pixelFormat; + + // code for "auto" update + GLbitfield _clearFlags; + ccColor4F _clearColor; + GLclampf _clearDepth; + GLint _clearStencil; + BOOL _autoDraw; } /** The CCSprite being used. The sprite, by default, will use the following blending function: GL_ONE, GL_ONE_MINUS_SRC_ALPHA. The blending function can be changed in runtime by calling: - - [[renderTexture sprite] setBlendFunc:(ccBlendFunc){GL_ONE, GL_ONE_MINUS_SRC_ALPHA}]; + - [[renderTexture sprite] setBlendFunc:(ccBlendFunc){GL_ONE, GL_ONE_MINUS_SRC_ALPHA}]; +*/ +@property (nonatomic,readwrite, strong) CCSprite* sprite; + +/** Valid flags: GL_COLOR_BUFFER_BIT, GL_DEPTH_BUFFER_BIT, GL_STENCIL_BUFFER_BIT. They can be OR'ed. Valid when "autoDraw is YES. */ +@property (nonatomic, readwrite) GLbitfield clearFlags; +/** Clear color value. Valid only when "autoDraw" is YES. */ +@property (nonatomic, readwrite) ccColor4F clearColor; +/** Value for clearDepth. Valid only when autoDraw is YES. */ +@property (nonatomic, readwrite) GLclampf clearDepth; +/** Value for clear Stencil. Valid only when autoDraw is YES */ +@property (nonatomic, readwrite) GLint clearStencil; +/** When enabled, it will render its children into the texture automatically. Disabled by default for compatiblity reasons. + Will be enabled in the future. */ -@property (nonatomic,readwrite, assign) CCSprite* sprite; +@property (nonatomic, readwrite) BOOL autoDraw; -/* - lazy created render target node that allows you to simplify rendering into render texture. Any children added to it will be rendered into render texture. - */ -@property (nonatomic, readonly) CCRenderTargetNode *renderTargetNode; /** initializes a RenderTexture object with width and height in Points and a pixel format( only RGB and RGBA formats are valid ) and depthStencil format*/ +(id)renderTextureWithWidth:(int)w height:(int)h pixelFormat:(CCTexture2DPixelFormat) format depthStencilFormat:(GLuint)depthStencilFormat; diff --git a/include/cocos2d/CCResponder.h b/include/cocos2d/CCResponder.h new file mode 100644 index 0000000..8298dbb --- /dev/null +++ b/include/cocos2d/CCResponder.h @@ -0,0 +1,46 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2010 Ricardo Quesada + * Copyright (c) 2011 Zynga Inc. + * Copyright (c) 2013 Lars Birkemose + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * + * File autogenerated with Xcode. Adapted for cocos2d needs. + */ + +#import +#import "CCResponderManager.h" + +// ----------------------------------------------------------------- +/** + * CCResponder is the base class for all nodes. + * It exposes the touch and mouse protocol to any node, which enables user interaction + */ +@interface CCResponder : NSObject + +// ----------------------------------------------------------------- + +- (id)init; + +// ----------------------------------------------------------------- + +@end diff --git a/include/cocos2d/CCResponderManager.h b/include/cocos2d/CCResponderManager.h new file mode 100644 index 0000000..d8cdd0d --- /dev/null +++ b/include/cocos2d/CCResponderManager.h @@ -0,0 +1,178 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2010 Ricardo Quesada + * Copyright (c) 2011 Zynga Inc. + * Copyright (c) 2013 Lars Birkemose + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * + * File autogenerated with Xcode. Adapted for cocos2d needs. + */ + +// TODO: Add circular touch detection +// TODO: support expand / contract touch area +// TODO: Grab mouse and touch by implementing onPressed, onReleased, onClicked + +#import + +#if TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR + +// ----------------------------------------------------------------- +#pragma mark - iOS +// ----------------------------------------------------------------- + +#import +#import "Platforms/iOS/CCResponderManager.h" + +@interface CCRunningResponder : NSObject + +@property (nonatomic, strong) id target; // the target associated with the touch +@property (nonatomic, weak) UITouch *touch; // the current touch ( should not be retained ) +@property (nonatomic, weak) UIEvent *event; // the current event ( should not be retained ) + +@end + +#else + +// ----------------------------------------------------------------- +#pragma mark - Mac +// ----------------------------------------------------------------- + +#import + +#define RESPONDER NSResponder + +typedef enum +{ + CCMouseButtonLeft, + CCMouseButtonRight, + CCMouseButtonOther, +} CCMouseButton; + +@protocol CCResponderProtocol + +@optional +- (void)mouseDown:(NSEvent *)theEvent; +- (void)mouseDragged:(NSEvent *)theEvent; +- (void)mouseUp:(NSEvent *)theEvent; +- (void)rightMouseDown:(NSEvent *)theEvent; +- (void)rightMouseDragged:(NSEvent *)theEvent; +- (void)rightMouseUp:(NSEvent *)theEvent; +- (void)otherMouseDown:(NSEvent *)theEvent; +- (void)otherMouseDragged:(NSEvent *)theEvent; +- (void)otherMouseUp:(NSEvent *)theEvent; +- (void)scrollWheel:(NSEvent *)theEvent; + +- (void)mouseMoved:(NSEvent *)theEvent; +- (void)mouseEntered:(NSEvent *)theEvent; +- (void)mouseExited:(NSEvent *)theEvent; + +@end + +// ----------------------------------------------------------------- + +@interface CCRunningResponder : NSObject + +@property (nonatomic, strong) id target; // the target associated with the mouse event +@property (nonatomic, assign) CCMouseButton button; // button of the current event + +@end + +#endif + +// ----------------------------------------------------------------- +#pragma mark - Both +// ----------------------------------------------------------------- + +@class CCNode; + +// ----------------------------------------------------------------- + +enum +{ + CCResponderManagerBufferSize = 128, +}; + +// ----------------------------------------------------------------- + +@interface CCResponderManager : RESPONDER + +// ----------------------------------------------------------------- + +@property (nonatomic) BOOL eventProcessed; // event was processed + +// ----------------------------------------------------------------- + ++ (CCResponderManager*)responderManager; +- (id)init; + +- (void)addResponder:(CCNode *)responder; +- (void)removeAllResponders; +- (void)markAsDirty; + +- (CCNode *)nodeAtPoint:(CGPoint)pos; +- (NSArray *)nodesAtPoint:(CGPoint)pos; + +// ----------------------------------------------------------------- + +@end + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/include/cocos2d/CCScene.h b/include/cocos2d/CCScene.h index 36b9085..d820c81 100644 --- a/include/cocos2d/CCScene.h +++ b/include/cocos2d/CCScene.h @@ -38,6 +38,10 @@ It is a good practice to use and CCScene as the parent of all your nodes. */ @interface CCScene : CCNode -{ -} + +/** initializes a node. + The node will be created as "autorelease". + */ +-(id) init; + @end diff --git a/include/cocos2d/CCScheduler.h b/include/cocos2d/CCScheduler.h index 9ae05db..b23db1b 100644 --- a/include/cocos2d/CCScheduler.h +++ b/include/cocos2d/CCScheduler.h @@ -42,44 +42,66 @@ typedef void (*TICK_IMP)(id, SEL, ccTime); /** Light weight timer */ @interface CCTimer : NSObject { - id target; - TICK_IMP impMethod; - - ccTime elapsed; - BOOL runForever; - BOOL useDelay; - uint nTimesExecuted; - uint repeat; //0 = once, 1 is 2 x executed - ccTime delay; - -@public // optimization - ccTime interval; - SEL selector; + ccTime _interval; + ccTime _elapsed; + BOOL _runForever; + BOOL _useDelay; + uint _nTimesExecuted; + uint _repeat; //0 = once, 1 is 2 x executed + ccTime _delay; } + /** interval in seconds */ @property (nonatomic,readwrite,assign) ccTime interval; -/** Allocates a timer with a target and a selector. -*/ + +/** triggers the timer */ +-(void) update: (ccTime) dt; +@end + +@interface CCTimerTargetSelector : CCTimer +{ + id _target; + SEL _selector; + TICK_IMP _impMethod; +} + +/** selector */ +@property (nonatomic,readonly) SEL selector; + +/** Allocates a timer with a target and a selector. */ +(id) timerWithTarget:(id) t selector:(SEL)s; -/** Allocates a timer with a target, a selector and an interval in seconds. -*/ +/** Allocates a timer with a target, a selector and an interval in seconds. */ +(id) timerWithTarget:(id) t selector:(SEL)s interval:(ccTime)seconds; -/** Initializes a timer with a target and a selector. -*/ - -(id) initWithTarget:(id) t selector:(SEL)s; +/** Initializes a timer with a target and a selector. */ +-(id) initWithTarget:(id) t selector:(SEL)s; -/** Initializes a timer with a target, a selector, an interval in seconds, repeat in number of times to repeat, delay in seconds -*/ +/** Initializes a timer with a target, a selector, an interval in seconds, repeat in number of times to repeat, delay in seconds */ -(id) initWithTarget:(id)t selector:(SEL)s interval:(ccTime) seconds repeat:(uint) r delay:(ccTime) d; +@end -/** triggers the timer */ --(void) update: (ccTime) dt; -@end +@interface CCTimerBlock : CCTimer +{ + void (^_block)(ccTime delta); + NSString *_key; + id __unsafe_unretained _target; +} + +/** unique identifier of the block */ +@property (nonatomic, readonly) NSString *key; +/** owner of the timer */ +@property (nonatomic, readonly) id target; + +/** Allocates a timer with a target, interval in seconds, a key and a block */ ++(id) timerWithTarget:(id)owner interval:(ccTime)seconds key:(NSString*)key block:(void(^)(ccTime delta)) block; + +/** Initializes a timer with a target(owner), interval in seconds, repeat in number of times to repeat, delay in seconds and a block */ +-(id) initWithTarget:(id)owner interval:(ccTime) seconds repeat:(uint) r delay:(ccTime)d key:(NSString*)key block:(void(^)(ccTime delta))block; +@end // @@ -103,7 +125,7 @@ struct _hashUpdateEntry; @interface CCScheduler : NSObject { - ccTime timeScale_; + ccTime _timeScale; // // "updates with priority" stuff @@ -114,7 +136,7 @@ struct _hashUpdateEntry; struct _hashUpdateEntry *hashForUpdates; // hash used to fetch quickly the list entries for pause,delete,etc. // Used for "selectors with interval" - struct _hashSelectorEntry *hashForSelectors; + struct _hashSelectorEntry *hashForTimers; struct _hashSelectorEntry *currentTarget; BOOL currentTargetSalvaged; @@ -123,17 +145,31 @@ struct _hashUpdateEntry; SEL updateSelector; BOOL updateHashLocked; // If true unschedule will not remove anything from a hash. Elements will only be marked for deletion. + + BOOL _paused; } /** Modifies the time of all scheduled callbacks. - You can use this property to create a 'slow motion' or 'fast fordward' effect. + You can use this property to create a 'slow motion' or 'fast forward' effect. Default is 1.0. To create a 'slow motion' effect, use values below 1.0. - To create a 'fast fordward' effect, use values higher than 1.0. + To create a 'fast forward' effect, use values higher than 1.0. @since v0.8 @warning It will affect EVERY scheduled selector / action. */ @property (nonatomic,readwrite) ccTime timeScale; + +/** Will pause / resume the CCScheduler. + It won't dispatch any message to any target/selector, block if it is paused. + + The difference between `pauseAllTargets` and `pause, is that `setPaused` will pause the CCScheduler, + while `pauseAllTargets` will pause all the targets, one by one. + `setPaused` will pause the whole Scheduler, meaning that calls to `resumeTargets:`, `resumeTarget:` won't affect it. + + @since v2.1.0 + */ +@property (nonatomic,readonly,getter=isPaused) BOOL paused; + /** 'update' the scheduler. You should NEVER call this method, unless you know what you are doing. */ @@ -141,14 +177,14 @@ struct _hashUpdateEntry; /** The scheduled method will be called every 'interval' seconds. If paused is YES, then it won't be called until it is resumed. - If 'interval' is 0, it will be called every frame, but if so, it recommened to use 'scheduleUpdateForTarget:' instead. + If 'interval' is 0, it will be called every frame, but if so, it recommended to use 'scheduleUpdateForTarget:' instead. If the selector is already scheduled, then only the interval parameter will be updated without re-scheduling it again. - repeat let the action be repeated repeat + 1 times, use kCCRepeatForever to let the action run continiously + repeat lets the action be repeated repeat + 1 times, use kCCRepeatForever to let the action run continuously delay is the amount of time the action will wait before it'll start @since v0.99.3, repeat and delay added in v1.1 */ --(void) scheduleSelector:(SEL)selector forTarget:(id)target interval:(ccTime)interval paused:(BOOL)paused repeat: (uint) repeat delay: (ccTime) delay; +-(void) scheduleSelector:(SEL)selector forTarget:(id)target interval:(ccTime)interval repeat:(uint)repeat delay:(ccTime)delay paused:(BOOL)paused; /** calls scheduleSelector with kCCRepeatForever and a 0 delay */ -(void) scheduleSelector:(SEL)selector forTarget:(id)target interval:(ccTime)interval paused:(BOOL)paused; @@ -160,35 +196,53 @@ struct _hashUpdateEntry; */ -(void) scheduleUpdateForTarget:(id)target priority:(NSInteger)priority paused:(BOOL)paused; +/** The scheduled block will be called every 'interval' seconds. + 'key' is a unique identifier of the block. Needed to unschedule the block or update its interval. + 'target' is needed for all the method related to "target" like "pause" and "unschedule" + If 'interval' is 0, it will be called every frame, but if so, it recommended to use 'scheduleUpdateForTarget:' instead. + 'repeat' lets the action be repeated repeat + 1 times, use kCCRepeatForever to let the action run continuously. + 'delay' is the amount of time the action will wait before it'll start. + If paused is YES, then it won't be called until it is resumed. + If the block is already scheduled, then only the interval parameter will be updated without re-scheduling it again. + @since v2.1 + */ +-(void) scheduleBlockForKey:(NSString*)key target:(id)target interval:(ccTime)interval repeat:(uint)repeat delay:(ccTime)delay paused:(BOOL)paused block:(void(^)(ccTime dt))block; + /** Unshedules a selector for a given target. If you want to unschedule the "update", use unscheudleUpdateForTarget. @since v0.99.3 */ -(void) unscheduleSelector:(SEL)selector forTarget:(id)target; +/** Unshedules a block for a given key / target pair. + If you want to unschedule the "update", use unscheudleUpdateForTarget. + @since v2.1 + */ +-(void) unscheduleBlockForKey:(NSString*)key target:(id)target; + /** Unschedules the update selector for a given target @since v0.99.3 */ -(void) unscheduleUpdateForTarget:(id)target; -/** Unschedules all selectors for a given target. +/** Unschedules all selectors and blocks for a given target. This also includes the "update" selector. @since v0.99.3 */ --(void) unscheduleAllSelectorsForTarget:(id)target; +-(void) unscheduleAllForTarget:(id)target; -/** Unschedules all selectors from all targets. +/** Unschedules all selectors and blocks from all targets. You should NEVER call this method, unless you know what you are doing. @since v0.99.3 */ --(void) unscheduleAllSelectors; +-(void) unscheduleAll; -/** Unschedules all selectors from all targets with a minimum priority. +/** Unschedules all selectors and blocks from all targets with a minimum priority. You should only call this with kCCPriorityNonSystemMin or higher. @since v2.0.0 */ --(void) unscheduleAllSelectorsWithMinPriority:(NSInteger)minPriority; +-(void) unscheduleAllWithMinPriority:(NSInteger)minPriority; /** Pauses the target. All scheduled selectors/update for a given target won't be 'ticked' until the target is resumed. @@ -209,13 +263,13 @@ struct _hashUpdateEntry; */ -(BOOL) isTargetPaused:(id)target; -/** Pause all selectors from all targets. +/** Pause all selectors and blocks from all targets. You should NEVER call this method, unless you know what you are doing. @since v2.0.0 */ -(NSSet*) pauseAllTargets; -/** Pause all selectors from all targets with a minimum priority. +/** Pause all selectors and blocks from all targets with a minimum priority. You should only call this with kCCPriorityNonSystemMin or higher. @since v2.0.0 */ diff --git a/include/cocos2d/CCShaderCache.h b/include/cocos2d/CCShaderCache.h index 5c93a99..2ee948b 100644 --- a/include/cocos2d/CCShaderCache.h +++ b/include/cocos2d/CCShaderCache.h @@ -37,7 +37,7 @@ */ @interface CCShaderCache : NSObject { - NSMutableDictionary *programs_; + NSMutableDictionary *_programs; } diff --git a/include/cocos2d/CCSprite.h b/include/cocos2d/CCSprite.h index a6e36d0..b86a77f 100644 --- a/include/cocos2d/CCSprite.h +++ b/include/cocos2d/CCSprite.h @@ -60,55 +60,50 @@ * * The default anchorPoint in CCSprite is (0.5, 0.5). */ -@interface CCSprite : CCNode +@interface CCSprite : CCNodeRGBA { // // Data used when the sprite is rendered using a CCSpriteBatchNode // - CCTextureAtlas *textureAtlas_; // Sprite Sheet texture atlas (weak reference) - NSUInteger atlasIndex_; // Absolute (real) Index on the batch node - CCSpriteBatchNode *batchNode_; // Used batch node (weak reference) - CGAffineTransform transformToBatch_; // - BOOL dirty_; // Sprite needs to be updated - BOOL recursiveDirty_; // Subchildren needs to be updated - BOOL hasChildren_; // optimization to check if it contain children - BOOL shouldBeHidden_; // should not be drawn because one of the ancestors is not visible + CCTextureAtlas *__unsafe_unretained _textureAtlas; // Sprite Sheet texture atlas (weak reference) + NSUInteger _atlasIndex; // Absolute (real) Index on the batch node + CCSpriteBatchNode *_batchNode; // Used batch node (weak reference) + CGAffineTransform _transformToBatch; // + BOOL _dirty; // Sprite needs to be updated + BOOL _recursiveDirty; // Subchildren needs to be updated + BOOL _hasChildren; // optimization to check if it contain children + BOOL _shouldBeHidden; // should not be drawn because one of the ancestors is not visible // // Data used when the sprite is self-rendered // - ccBlendFunc blendFunc_; // Needed for the texture protocol - CCTexture2D *texture_; // Texture used to render the sprite + ccBlendFunc _blendFunc; // Needed for the texture protocol + CCTexture2D *_texture; // Texture used to render the sprite // // Shared data // // sprite rectangle - CGRect rect_; + CGRect _rect; // texture - BOOL rectRotated_; + BOOL _rectRotated; // Offset Position (used by Zwoptex) - CGPoint offsetPosition_; - CGPoint unflippedOffsetPositionFromCenter_; + CGPoint _offsetPosition; + CGPoint _unflippedOffsetPositionFromCenter; // vertex coords, texture coords and color info - ccV3F_C4B_T2F_Quad quad_; + ccV3F_C4B_T2F_Quad _quad; // opacity and RGB protocol - GLubyte opacity_; - ccColor3B color_; - ccColor3B colorUnmodified_; - BOOL opacityModifyRGB_; + BOOL _opacityModifyRGB; // image is flipped - BOOL flipX_; - BOOL flipY_; - - BOOL forceDisableDebugDraw_; + BOOL _flipX; + BOOL _flipY; } /** whether or not the Sprite needs to be updated in the Atlas */ @@ -121,6 +116,12 @@ @property (nonatomic,readonly) CGRect textureRect; /** returns whether or not the texture rectangle is rotated */ @property (nonatomic,readonly) BOOL textureRectRotated; + +/** + * The currently displayed spriteFrame. + */ +@property (nonatomic,strong) CCSpriteFrame* spriteFrame; + /** whether or not the sprite is flipped horizontally. It only flips the texture of the sprite, and not the texture of the sprite's children. Also, flipping the texture doesn't alter the anchorPoint. @@ -137,14 +138,10 @@ sprite.scaleY *= -1; */ @property (nonatomic,readwrite) BOOL flipY; -/** opacity: conforms to CCRGBAProtocol protocol */ -@property (nonatomic,readwrite) GLubyte opacity; -/** RGB colors: conforms to CCRGBAProtocol protocol */ -@property (nonatomic,readwrite) ccColor3B color; /** weak reference of the CCTextureAtlas used when the sprite is rendered using a CCSpriteBatchNode */ -@property (nonatomic,readwrite,assign) CCTextureAtlas *textureAtlas; +@property (nonatomic,readwrite,unsafe_unretained) CCTextureAtlas *textureAtlas; /** weak reference to the CCSpriteBatchNode that renders the CCSprite */ -@property (nonatomic,readwrite,assign) CCSpriteBatchNode *batchNode; +@property (nonatomic,readwrite,unsafe_unretained) CCSpriteBatchNode *batchNode; /** offset position in points of the sprite in points. Calculated automatically by editors like Zwoptex. @since v0.99.0 */ @@ -152,10 +149,17 @@ /** conforms to CCTextureProtocol protocol */ @property (nonatomic,readwrite) ccBlendFunc blendFunc; -@property (nonatomic, readwrite) BOOL forceDisableDebugDraw; - #pragma mark CCSprite - Initializers +/** + * Creates a sprite with the name of an image. The name can be either a name in a sprite sheet or the name of a file. + * + * @param imageName name of the image to load + * + * @return a sprite + */ ++(id)spriteWithImageNamed:(NSString*)imageName; + /** Creates an sprite with a texture. The rect used will be the size of the texture. The offset will be (0,0). @@ -191,7 +195,7 @@ /** Creates an sprite with a CGImageRef and a key. The key is used by the CCTextureCache to know if a texture was already created with this CGImage. - For example, a valid key is: @"sprite_frame_01". + For example, a valid key is: @"_spriteframe_01". If key is nil, then a new texture will be created each time by the CCTextureCache. @since v0.99.0 */ @@ -239,7 +243,7 @@ /** Initializes an sprite with a CGImageRef and a key The key is used by the CCTextureCache to know if a texture was already created with this CGImage. - For example, a valid key is: @"sprite_frame_01". + For example, a valid key is: @"_spriteframe_01". If key is nil, then a new texture will be created each time by the CCTextureCache. @since v0.99.0 */ @@ -269,24 +273,12 @@ */ -(void)setVertexRect:(CGRect)rect; - -#pragma mark CCSprite - Frames - -/** sets a new display frame to the CCSprite. */ --(void) setDisplayFrame:(CCSpriteFrame*)newFrame; - -/** returns whether or not a CCSpriteFrame is being displayed */ --(BOOL) isFrameDisplayed:(CCSpriteFrame*)frame; - -/** returns the current displayed frame. */ --(CCSpriteFrame*) displayFrame; - #pragma mark CCSprite - Animation /** changes the display frame with animation name and index. The animation name will be get from the CCAnimationCache @since v0.99.5 */ --(void) setDisplayFrameWithAnimationName:(NSString*)animationName index:(int) frameIndex; +-(void) setSpriteFrameWithAnimationName:(NSString*)animationName index:(int) frameIndex; @end diff --git a/include/cocos2d/CCSprite9Slice.h b/include/cocos2d/CCSprite9Slice.h new file mode 100644 index 0000000..9ec57d5 --- /dev/null +++ b/include/cocos2d/CCSprite9Slice.h @@ -0,0 +1,96 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2008-2010 Ricardo Quesada + * Copyright (c) 2011 Zynga Inc. + * Copyright (c) 2013 Lars Birkemose + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + */ + +#import +#import "cocos2d.h" + +/* + * Implements a 9 slice sprite + * The sprite can be scaled, by using scale, scaleX and scaleY + * A margin will be kept unscaled + */ + +// --------------------------------------------------------------------- + +@interface CCSprite9Slice : CCSprite +{ + +} + +// --------------------------------------------------------------------- + +@property (nonatomic, assign) float margin; // normalized unstretched margin + +@property (nonatomic, assign) float marginLeft; +@property (nonatomic, assign) float marginRight; +@property (nonatomic, assign) float marginTop; +@property (nonatomic, assign) float marginBottom; + +// --------------------------------------------------------------------- + +@end + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/include/cocos2d/CCSpriteBatchNode.h b/include/cocos2d/CCSpriteBatchNode.h index ca13ef0..554bc94 100644 --- a/include/cocos2d/CCSpriteBatchNode.h +++ b/include/cocos2d/CCSpriteBatchNode.h @@ -53,21 +53,21 @@ */ @interface CCSpriteBatchNode : CCNode { - CCTextureAtlas *textureAtlas_; - ccBlendFunc blendFunc_; + CCTextureAtlas *_textureAtlas; + ccBlendFunc _blendFunc; - // all descendants: chlidren, gran children, etc... - CCArray *descendants_; + // all descendants: children, grandchildren, etc... + NSMutableArray *_descendants; } /** returns the TextureAtlas that is used */ -@property (nonatomic,readwrite,retain) CCTextureAtlas * textureAtlas; +@property (nonatomic,readwrite,strong) CCTextureAtlas * textureAtlas; /** conforms to CCTextureProtocol protocol */ @property (nonatomic,readwrite) ccBlendFunc blendFunc; -/** descendants (children, gran children, etc) */ -@property (nonatomic,readonly) CCArray *descendants; +/** descendants (children, grandchildren, etc) */ +@property (nonatomic,readonly) NSArray *descendants; /** creates a CCSpriteBatchNode with a texture2d and a default capacity of 29 children. The capacity will be increased in 33% in runtime if it run out of space. @@ -111,7 +111,7 @@ /** removes a child given a reference. It will also cleanup the running actions depending on the cleanup parameter. @warning Removing a child from a CCSpriteBatchNode is very slow */ --(void)removeChild: (CCSprite *)sprite cleanup:(BOOL)doCleanup; +-(void)removeChild: (CCNode *)sprite cleanup:(BOOL)doCleanup; -(void) insertChild:(CCSprite*)child inAtlasAtIndex:(NSUInteger)index; -(void) appendChild:(CCSprite*)sprite; @@ -125,14 +125,21 @@ @end @interface CCSpriteBatchNode (QuadExtensions) -/** Adds a quad into the texture atlas but it won't be added into the children array. +/** Inserts a quad at a certain index into the texture atlas. The CCSprite won't be added into the children array. This method should be called only when you are dealing with very big AtlasSrite and when most of the CCSprite won't be updated. - For example: a tile map (CCTMXMap) or a label with lots of characgers (CCLabelBMFont) + For example: a tile map (CCTMXMap) or a label with lots of characters (CCLabelBMFont) */ --(id) addSpriteWithoutQuad:(CCSprite*)child z:(NSUInteger)z tag:(NSInteger)aTag; +-(void) insertQuadFromSprite:(CCSprite*)sprite quadIndex:(NSUInteger)index; + +/** Updates a quad at a certain index into the texture atlas. The CCSprite won't be added into the children array. + This method should be called only when you are dealing with very big AtlasSrite and when most of the CCSprite won't be updated. + For example: a tile map (CCTMXMap) or a label with lots of characters (CCLabelBMFont) + */ +-(void) updateQuadFromSprite:(CCSprite*)sprite quadIndex:(NSUInteger)index; /* This is the opposite of "addQuadFromSprite". It adds the sprite to the children and descendants array, but it doesn't add it to the texture atlas. */ --(void) addQuadFromSprite:(CCSprite*)sprite quadIndex:(NSUInteger)index; +-(id) addSpriteWithoutQuad:(CCSprite*)child z:(NSUInteger)z tag:(NSInteger)aTag; + @end diff --git a/include/cocos2d/CCSpriteFrame.h b/include/cocos2d/CCSpriteFrame.h index fcc8084..179b9bf 100644 --- a/include/cocos2d/CCSpriteFrame.h +++ b/include/cocos2d/CCSpriteFrame.h @@ -36,24 +36,24 @@ You can modify the frame of a CCSprite by doing: CCSpriteFrame *frame = [CCSpriteFrame frameWithTexture:texture rect:rect offset:offset]; - [sprite setDisplayFrame:frame]; + [sprite setSpriteFrame:frame]; */ @interface CCSpriteFrame : NSObject { - CGRect rect_; - CGRect rectInPixels_; - BOOL rotated_; - CGPoint offset_; - CGPoint offsetInPixels_; - CGSize originalSize_; - CGSize originalSizeInPixels_; - CCTexture2D *texture_; - NSString *textureFilename_; + CGRect _rect; + CGRect _rectInPixels; + BOOL _rotated; + CGPoint _offset; + CGPoint _offsetInPixels; + CGSize _originalSize; + CGSize _originalSizeInPixels; + CCTexture2D *_texture; + NSString *_textureFilename; } /** rect of the frame in points. If it is updated, then rectInPixels will be updated too. */ @property (nonatomic,readwrite) CGRect rect; -/** rect of the frame in pixels. If it is updated, then rect (points) will be udpated too. */ +/** rect of the frame in pixels. If it is updated, then rect (points) will be updated too. */ @property (nonatomic,readwrite) CGRect rectInPixels; /** whether or not the rect of the frame is rotated ( x = x+width, y = y+height, width = height, height = width ) */ @@ -72,10 +72,13 @@ @property (nonatomic,readwrite) CGSize originalSizeInPixels; /** texture of the frame */ -@property (nonatomic, retain, readwrite) CCTexture2D *texture; +@property (nonatomic, strong, readwrite) CCTexture2D *texture; /** texture file name of the frame */ -@property (nonatomic, retain, readonly) NSString *textureFilename; +@property (nonatomic, readonly) NSString *textureFilename; + +/** Retrieves a sprite frame from the sprite frame cache, or if no such sprite frame is know, attempts to create a sprite frame from an image of the same name. */ ++(id) frameWithImageNamed:(NSString*)imageName; /** Create a CCSpriteFrame with a texture, rect in points. It is assumed that the frame was not trimmed. diff --git a/include/cocos2d/CCSpriteFrameCache.h b/include/cocos2d/CCSpriteFrameCache.h index a6a2f09..be1383f 100644 --- a/include/cocos2d/CCSpriteFrameCache.h +++ b/include/cocos2d/CCSpriteFrameCache.h @@ -48,9 +48,11 @@ */ @interface CCSpriteFrameCache : NSObject { - NSMutableDictionary *spriteFrames_; - NSMutableDictionary *spriteFramesAliases_; - NSMutableSet *loadedFilenames_; + NSMutableDictionary *_spriteFrames; + NSMutableDictionary *_spriteFramesAliases; + NSMutableSet *_loadedFilenames; + + NSMutableDictionary *_spriteFrameFileLookup; } /** Retruns ths shared instance of the Sprite Frame cache */ @@ -60,6 +62,9 @@ */ +(void)purgeSharedSpriteFrameCache; +- (void) registerSpriteFramesFile:(NSString*)plist; + +-(void) loadSpriteFrameLookupDictionaryFromFile:(NSString*)filename; /** Adds multiple Sprite Frames from a plist file. * A texture will be loaded automatically. The texture name will composed by replacing the .plist suffix with .png . @@ -91,7 +96,7 @@ /** Removes unused sprite frames. * Sprite Frames that have a retain count of 1 will be deleted. - * It is convinient to call this method after when starting a new Scene. + * It is convenient to call this method after when starting a new Scene. */ -(void) removeUnusedSpriteFrames; @@ -101,13 +106,13 @@ /** Removes multiple Sprite Frames from a plist file. * Sprite Frames stored in this file will be removed. -* It is convinient to call this method when a specific texture needs to be removed. +* It is convenient to call this method when a specific texture needs to be removed. * @since v0.99.5 */ - (void) removeSpriteFramesFromFile:(NSString*) plist; /** Removes all Sprite Frames associated with the specified textures. - * It is convinient to call this method when a specific texture needs to be removed. + * It is convenient to call this method when a specific texture needs to be removed. * @since v0.995. */ - (void) removeSpriteFramesFromTexture:(CCTexture2D*) texture; diff --git a/include/cocos2d/CCTMXLayer.h b/include/cocos2d/CCTMXLayer.h index ed1f4f1..56d6ccf 100644 --- a/include/cocos2d/CCTMXLayer.h +++ b/include/cocos2d/CCTMXLayer.h @@ -63,41 +63,41 @@ */ @interface CCTMXLayer : CCSpriteBatchNode { - CCTMXTilesetInfo *tileset_; - NSString *layerName_; - CGSize layerSize_; - CGSize mapTileSize_; - uint32_t *tiles_; // GID are 32 bit - NSUInteger layerOrientation_; - NSMutableArray *properties_; + CCTMXTilesetInfo *_tileset; + NSString *_layerName; + CGSize _layerSize; + CGSize _mapTileSize; + uint32_t *_tiles; // GID are 32 bit + NSUInteger _layerOrientation; + NSMutableDictionary *_properties; - unsigned char opacity_; // TMX Layer supports opacity + unsigned char _opacity; // TMX Layer supports opacity - NSUInteger minGID_; - NSUInteger maxGID_; + NSUInteger _minGID; + NSUInteger _maxGID; // Only used when vertexZ is used - NSInteger vertexZvalue_; - BOOL useAutomaticVertexZ_; + NSInteger _vertexZvalue; + BOOL _useAutomaticVertexZ; // used for optimization - CCSprite *reusedTile_; - ccCArray *atlasIndexArray_; + CCSprite *_reusedTile; + NSMutableArray *_atlasIndexArray; } /** name of the layer */ -@property (nonatomic,readwrite,retain) NSString *layerName; +@property (nonatomic,readwrite,strong) NSString *layerName; /** size of the layer in tiles */ @property (nonatomic,readwrite) CGSize layerSize; -/** size of the map's tile (could be differnt from the tile's size) */ +/** size of the map's tile (could be different from the tile's size) */ @property (nonatomic,readwrite) CGSize mapTileSize; /** pointer to the map of tiles */ @property (nonatomic,readwrite) uint32_t *tiles; -/** Tilset information for the layer */ -@property (nonatomic,readwrite,retain) CCTMXTilesetInfo *tileset; +/** Tileset information for the layer */ +@property (nonatomic,readwrite,strong) CCTMXTilesetInfo *tileset; /** Layer orientation, which is the same as the map orientation */ @property (nonatomic,readwrite) NSUInteger layerOrientation; /** properties from the layer. They can be added using Tiled */ -@property (nonatomic,readwrite,retain) NSMutableArray *properties; +@property (nonatomic,readwrite,strong) NSMutableDictionary *properties; /** creates a CCTMXLayer with an tileset info, a layer info and a map info */ +(id) layerWithTilesetInfo:(CCTMXTilesetInfo*)tilesetInfo layerInfo:(CCTMXLayerInfo*)layerInfo mapInfo:(CCTMXMapInfo*)mapInfo; diff --git a/include/cocos2d/CCTMXObjectGroup.h b/include/cocos2d/CCTMXObjectGroup.h index 17fa09c..eaee3ce 100644 --- a/include/cocos2d/CCTMXObjectGroup.h +++ b/include/cocos2d/CCTMXObjectGroup.h @@ -41,20 +41,20 @@ */ @interface CCTMXObjectGroup : NSObject { - NSString *groupName_; - CGPoint positionOffset_; - NSMutableArray *objects_; - NSMutableDictionary *properties_; + NSString *_groupName; + CGPoint _positionOffset; + NSMutableArray *_objects; + NSMutableDictionary *_properties; } /** name of the group */ -@property (nonatomic,readwrite,retain) NSString *groupName; +@property (nonatomic,readwrite,strong) NSString *groupName; /** offset position of child objects */ @property (nonatomic,readwrite,assign) CGPoint positionOffset; /** array of the objects */ -@property (nonatomic,readwrite,retain) NSMutableArray *objects; +@property (nonatomic,readwrite,strong) NSMutableArray *objects; /** list of properties stored in a dictionary */ -@property (nonatomic,readwrite,retain) NSMutableDictionary *properties; +@property (nonatomic,readwrite,strong) NSMutableDictionary *properties; /** return the value for the specific property name */ -(id) propertyNamed:(NSString *)propertyName; diff --git a/include/cocos2d/CCTMXTiledMap.h b/include/cocos2d/CCTMXTiledMap.h index 084187c..c438848 100644 --- a/include/cocos2d/CCTMXTiledMap.h +++ b/include/cocos2d/CCTMXTiledMap.h @@ -71,14 +71,14 @@ enum Limitations: - It only supports one tileset per layer. - - Embeded images are not supported + - Embedded images are not supported - It only supports the XML format (the JSON format is not supported) Technical description: Each layer is created using an CCTMXLayer (subclass of CCSpriteBatchNode). If you have 5 layers, then 5 CCTMXLayer will be created, unless the layer visibility is off. In that case, the layer won't be created at all. You can obtain the layers (CCTMXLayer objects) at runtime by: - - [map getChildByTag: tag_number]; // 0=1st layer, 1=2nd layer, 2=3rd layer, etc... + - [map getChildByTag: tax_number]; // 0=1st layer, 1=2nd layer, 2=3rd layer, etc... - [map layerNamed: name_of_the_layer]; Each object group is created using a CCTMXObjectGroup which is a subclass of NSMutableArray. @@ -99,12 +99,12 @@ enum */ @interface CCTMXTiledMap : CCNode { - CGSize mapSize_; - CGSize tileSize_; - int mapOrientation_; - NSMutableArray *objectGroups_; - NSMutableDictionary *properties_; - NSMutableDictionary *tileProperties_; + CGSize _mapSize; + CGSize _tileSize; + int _mapOrientation; + NSMutableArray *_objectGroups; + NSMutableDictionary *_properties; + NSMutableDictionary *_tileProperties; } /** the map's size property measured in tiles */ @@ -114,9 +114,9 @@ enum /** map orientation */ @property (nonatomic,readonly) int mapOrientation; /** object groups */ -@property (nonatomic,readwrite,retain) NSMutableArray *objectGroups; +@property (nonatomic,readwrite,strong) NSMutableArray *objectGroups; /** properties */ -@property (nonatomic,readwrite,retain) NSMutableDictionary *properties; +@property (nonatomic,readwrite,strong) NSMutableDictionary *properties; /** creates a TMX Tiled Map with a TMX file.*/ +(id) tiledMapWithTMXFile:(NSString*)tmxFile; @@ -133,7 +133,7 @@ enum /** return the TMXLayer for the specific layer */ -(CCTMXLayer*) layerNamed:(NSString *)layerName; -/** return the TMXObjectGroup for the secific group */ +/** return the TMXObjectGroup for the specific group */ -(CCTMXObjectGroup*) objectGroupNamed:(NSString *)groupName; /** return the value for the specific property name */ diff --git a/include/cocos2d/CCTMXXMLParser.h b/include/cocos2d/CCTMXXMLParser.h index 91b89f4..935ae47 100644 --- a/include/cocos2d/CCTMXXMLParser.h +++ b/include/cocos2d/CCTMXXMLParser.h @@ -78,19 +78,19 @@ typedef enum ccTMXTileFlags_ { */ @interface CCTMXLayerInfo : NSObject { - NSString *name_; - CGSize layerSize_; - unsigned int *tiles_; - BOOL visible_; - unsigned char opacity_; - BOOL ownTiles_; - unsigned int minGID_; - unsigned int maxGID_; - NSMutableDictionary *properties_; - CGPoint offset_; + NSString *_name; + CGSize _layerSize; + unsigned int *_tiles; + BOOL _visible; + unsigned char _opacity; + BOOL _ownTiles; + unsigned int _minGID; + unsigned int _maxGID; + NSMutableDictionary *_properties; + CGPoint _offset; } -@property (nonatomic,readwrite,retain) NSString *name; +@property (nonatomic,readwrite,strong) NSString *name; @property (nonatomic,readwrite) CGSize layerSize; @property (nonatomic,readwrite) unsigned int *tiles; @property (nonatomic,readwrite) BOOL visible; @@ -98,7 +98,7 @@ typedef enum ccTMXTileFlags_ { @property (nonatomic,readwrite) BOOL ownTiles; @property (nonatomic,readwrite) unsigned int minGID; @property (nonatomic,readwrite) unsigned int maxGID; -@property (nonatomic,readwrite,retain) NSMutableDictionary *properties; +@property (nonatomic,readwrite,strong) NSMutableDictionary *properties; @property (nonatomic,readwrite) CGPoint offset; @end @@ -114,25 +114,36 @@ typedef enum ccTMXTileFlags_ { */ @interface CCTMXTilesetInfo : NSObject { - NSString *name_; - unsigned int firstGid_; - CGSize tileSize_; - unsigned int spacing_; - unsigned int margin_; + NSString *_name; + unsigned int _firstGid; + CGSize _tileSize; + unsigned int _spacing; + unsigned int _margin; + + // Offset of tiles. New TMX XML node introduced here: https://github.com/bjorn/tiled/issues/16 . + // Node structure: + // (...) + // + // + // (...) + CGPoint _tileOffset; + CGPoint _tileAnchorPoint; //normalized anchor point // filename containing the tiles (should be spritesheet / texture atlas) - NSString *sourceImage_; + NSString *_sourceImage; // size in pixels of the image - CGSize imageSize_; + CGSize _imageSize; } -@property (nonatomic,readwrite,retain) NSString *name; +@property (nonatomic,readwrite,strong) NSString *name; @property (nonatomic,readwrite,assign) unsigned int firstGid; @property (nonatomic,readwrite,assign) CGSize tileSize; @property (nonatomic,readwrite,assign) unsigned int spacing; @property (nonatomic,readwrite,assign) unsigned int margin; -@property (nonatomic,readwrite,retain) NSString *sourceImage; +@property (nonatomic,readwrite,strong) NSString *sourceImage; @property (nonatomic,readwrite,assign) CGSize imageSize; +@property (nonatomic,readwrite,assign) CGPoint tileOffset; //setter has a custom implementation +@property (nonatomic,assign) CGPoint tileAnchorPoint; //set automatically when tileOffset changes -(CGRect) rectForGID:(unsigned int)gid; @end @@ -152,54 +163,54 @@ typedef enum ccTMXTileFlags_ { */ @interface CCTMXMapInfo : NSObject { - NSMutableString *currentString; - BOOL storingCharacters; - int layerAttribs; - int parentElement; - unsigned int parentGID_; - + NSMutableString *_currentString; + BOOL _storingCharacters; + int _layerAttribs; + int _parentElement; + unsigned int _parentGID; + unsigned int _currentFirstGID; // tmx filename - NSString *filename_; + NSString *_filename; // tmx resource path - NSString *resources_; + NSString *_resources; // map orientation - int orientation_; + int _orientation; // map width & height - CGSize mapSize_; + CGSize _mapSize; // tiles width & height - CGSize tileSize_; + CGSize _tileSize; // Layers - NSMutableArray *layers_; + NSMutableArray *_layers; // tilesets - NSMutableArray *tilesets_; + NSMutableArray *_tilesets; // ObjectGroups - NSMutableArray *objectGroups_; + NSMutableArray *_objectGroups; // properties - NSMutableDictionary *properties_; + NSMutableDictionary *_properties; // tile properties - NSMutableDictionary *tileProperties_; + NSMutableDictionary *_tileProperties; } @property (nonatomic,readwrite,assign) int orientation; @property (nonatomic,readwrite,assign) CGSize mapSize; @property (nonatomic,readwrite,assign) CGSize tileSize; -@property (nonatomic,readwrite,retain) NSMutableArray *layers; -@property (nonatomic,readwrite,retain) NSMutableArray *tilesets; -@property (nonatomic,readwrite,retain) NSString *filename; -@property (nonatomic,readwrite,retain) NSString *resources; -@property (nonatomic,readwrite,retain) NSMutableArray *objectGroups; -@property (nonatomic,readwrite,retain) NSMutableDictionary *properties; -@property (nonatomic,readwrite,retain) NSMutableDictionary *tileProperties; +@property (nonatomic,readwrite,strong) NSMutableArray *layers; +@property (nonatomic,readwrite,strong) NSMutableArray *tilesets; +@property (nonatomic,readwrite,strong) NSString *filename; +@property (nonatomic,readwrite,strong) NSString *resources; +@property (nonatomic,readwrite,strong) NSMutableArray *objectGroups; +@property (nonatomic,readwrite,strong) NSMutableDictionary *properties; +@property (nonatomic,readwrite,strong) NSMutableDictionary *tileProperties; /** creates a TMX Format with a tmx file */ +(id) formatWithTMXFile:(NSString*)tmxFile; diff --git a/include/cocos2d/CCTexture2D.h b/include/cocos2d/CCTexture2D.h index 415a3b8..c1d29f5 100644 --- a/include/cocos2d/CCTexture2D.h +++ b/include/cocos2d/CCTexture2D.h @@ -68,6 +68,8 @@ Copyright (C) 2008 Apple Inc. All Rights Reserved. #import "Platforms/CCGL.h" // OpenGL stuff #import "Platforms/CCNS.h" // Next-Step stuff +@class CCSpriteFrame; + //CONSTANTS: /** @typedef CCTexture2DPixelFormat @@ -111,25 +113,23 @@ typedef enum { */ @interface CCTexture2D : NSObject { - GLuint name_; - CGSize size_; - NSUInteger width_, - height_; - CCTexture2DPixelFormat format_; - GLfloat maxS_, - maxT_; - BOOL hasPremultipliedAlpha_; - BOOL hasMipmaps_; - -#ifdef __CC_PLATFORM_IOS - ccResolutionType resolutionType_; -#endif + GLuint _name; + CGSize _size; + NSUInteger _width, + _height; + CCTexture2DPixelFormat _format; + GLfloat _maxS, + _maxT; + BOOL _hasPremultipliedAlpha; + BOOL _hasMipmaps; + + ccResolutionType _resolutionType; // needed for drawAtRect, drawInPoint - CCGLProgram *shaderProgram_; + CCGLProgram *_shaderProgram; } -/** Intializes with a texture2d with data */ +/** Initializes with a texture2d with data */ - (id) initWithData:(const void*)data pixelFormat:(CCTexture2DPixelFormat)pixelFormat pixelsWide:(NSUInteger)width pixelsHigh:(NSUInteger)height contentSize:(CGSize)size; /** These functions are needed to create mutable textures */ @@ -157,24 +157,31 @@ typedef enum { @property(nonatomic,readonly) BOOL hasPremultipliedAlpha; /** shader program used by drawAtPoint and drawInRect */ -@property(nonatomic,readwrite,retain) CCGLProgram *shaderProgram; +@property(nonatomic,readwrite,strong) CCGLProgram *shaderProgram; -#ifdef __CC_PLATFORM_IOS /** Returns the resolution type of the texture. - Is it a RetinaDisplay texture, an iPad texture or an standard texture ? - Only valid on iOS. Not valid on OS X. + Is it a RetinaDisplay texture, an iPad texture, a Mac, a Mac RetinaDisplay or an standard texture ? Should be a readonly property. It is readwrite as a hack. @since v1.1 */ @property (nonatomic, readwrite) ccResolutionType resolutionType; -#endif + /** returns the content size of the texture in points */ -(CGSize) contentSize; +/** + * Creates a sprite frame from the texture. + * + * @return A new sprite frame. + * @since v2.5 + */ +-(CCSpriteFrame*) createSpriteFrame; + + @end /** @@ -194,32 +201,9 @@ Note that RGBA type textures will have their alpha premultiplied - use the blend */ @interface CCTexture2D (Image) /** Initializes a texture from a CGImage object */ -#ifdef __CC_PLATFORM_IOS - (id) initWithCGImage:(CGImageRef)cgImage resolutionType:(ccResolutionType)resolution; -#elif defined(__CC_PLATFORM_MAC) -- (id) initWithCGImage:(CGImageRef)cgImage; -#endif @end -/** -Extensions to make it easy to create a CCTexture2D object from a string of text. -Note that the generated textures are of type A8 - use the blending mode (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA). -*/ -@interface CCTexture2D (Text) -/** Initializes a texture from a string with dimensions, alignment, line break mode, font name and font size - Supported lineBreakModes: - - iOS: all UILineBreakMode supported modes - - Mac: Only NSLineBreakByWordWrapping is supported. - @since v1.0 - */ -- (id) initWithString:(NSString*)string dimensions:(CGSize)dimensions hAlignment:(CCTextAlignment)alignment vAlignment:(CCVerticalTextAlignment) vertAlignment lineBreakMode:(CCLineBreakMode)lineBreakMode fontName:(NSString*)name fontSize:(CGFloat)size; -/** Initializes a texture from a string with dimensions, alignment, font name and font size */ -- (id) initWithString:(NSString*)string dimensions:(CGSize)dimensions hAlignment:(CCTextAlignment)alignment vAlignment:(CCVerticalTextAlignment) vertAlignment fontName:(NSString*)name fontSize:(CGFloat)size; -/** Initializes a texture from a string with font name and font size */ -- (id) initWithString:(NSString*)string fontName:(NSString*)name fontSize:(CGFloat)size; -@end - - /** 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). diff --git a/include/cocos2d/CCTextureAtlas.h b/include/cocos2d/CCTextureAtlas.h index 4a61485..17edc83 100644 --- a/include/cocos2d/CCTextureAtlas.h +++ b/include/cocos2d/CCTextureAtlas.h @@ -30,8 +30,8 @@ /** A class that implements a Texture Atlas. Supported features: - * The atlas file can be a PVRTC, PNG or any other fomrat supported by Texture2D - * Quads can be udpated in runtime + * The atlas file can be a PVRTC, PNG or any other format supported by Texture2D + * Quads can be updated in runtime * Quads can be added in runtime * Quads can be removed in runtime * Quads can be re-ordered in runtime @@ -42,17 +42,17 @@ */ @interface CCTextureAtlas : NSObject { - NSUInteger totalQuads_; - NSUInteger capacity_; - ccV3F_C4B_T2F_Quad *quads_; // quads to be rendered - GLushort *indices_; - CCTexture2D *texture_; + NSUInteger _totalQuads; + NSUInteger _capacity; + ccV3F_C4B_T2F_Quad *_quads; // quads to be rendered + GLushort *_indices; + CCTexture2D *_texture; - GLuint buffersVBO_[2]; //0: vertex 1: indices - BOOL dirty_; //indicates whether or not the array buffer of the VBO needs to be updated + GLuint _buffersVBO[2]; //0: vertex 1: indices + BOOL _dirty; //indicates whether or not the array buffer of the VBO needs to be updated #if CC_TEXTURE_ATLAS_USE_VAO - GLuint VAOname_; + GLuint _VAOname; #endif } @@ -61,7 +61,7 @@ /** quantity of quads that can be stored with the current texture atlas size */ @property (nonatomic,readonly) NSUInteger capacity; /** Texture of the texture atlas */ -@property (nonatomic,retain) CCTexture2D *texture; +@property (nonatomic,strong) CCTexture2D *texture; /** Quads that are going to be rendered */ @property (nonatomic,readwrite) ccV3F_C4B_T2F_Quad *quads; diff --git a/include/cocos2d/CCTextureCache.h b/include/cocos2d/CCTextureCache.h index 18d24f0..5c7568d 100644 --- a/include/cocos2d/CCTextureCache.h +++ b/include/cocos2d/CCTextureCache.h @@ -40,7 +40,7 @@ */ @interface CCTextureCache : NSObject { - NSMutableDictionary *textures_; + NSMutableDictionary *_textures; dispatch_queue_t _loadingQueue; dispatch_queue_t _dictQueue; @@ -58,7 +58,7 @@ /** Returns a Texture2D object given an file image * If the file image was not previously loaded, it will create a new CCTexture2D * object and it will return it. It will use the filename as a key. - * Otherwise it will return a reference of a previosly loaded image. + * Otherwise it will return a reference of a previously loaded image. * Supported image extensions: .png, .bmp, .tiff, .jpeg, .pvr, .gif */ -(CCTexture2D*) addImage: (NSString*) fileimage; @@ -106,7 +106,7 @@ /** Removes unused textures * Textures that have a retain count of 1 will be deleted - * It is convinient to call this method after when starting a new Scene + * It is convenient to call this method after when starting a new Scene * @since v0.8 */ -(void) removeUnusedTextures; @@ -127,7 +127,7 @@ /** Returns a Texture2D object given an PVR filename. * If the file image was not previously loaded, it will create a new CCTexture2D - * object and it will return it. Otherwise it will return a reference of a previosly loaded image + * object and it will return it. Otherwise it will return a reference of a previously loaded image * */ -(CCTexture2D*) addPVRImage:(NSString*) filename; diff --git a/include/cocos2d/CCTexturePVR.h b/include/cocos2d/CCTexturePVR.h index 80460ba..61d1dc4 100644 --- a/include/cocos2d/CCTexturePVR.h +++ b/include/cocos2d/CCTexturePVR.h @@ -1,49 +1,49 @@ /* - - File: PVRTexture.h - Abstract: The PVRTexture class is responsible for loading .pvr files. - - Version: 1.0 - - Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple Inc. - ("Apple") in consideration of your agreement to the following terms, and your - use, installation, modification or redistribution of this Apple software - constitutes acceptance of these terms. If you do not agree with these terms, - please do not use, install, modify or redistribute this Apple software. - - In consideration of your agreement to abide by the following terms, and subject - to these terms, Apple grants you a personal, non-exclusive license, under - Apple's copyrights in this original Apple software (the "Apple Software"), to - use, reproduce, modify and redistribute the Apple Software, with or without - modifications, in source and/or binary forms; provided that if you redistribute - the Apple Software in its entirety and without modifications, you must retain - this notice and the following text and disclaimers in all such redistributions - of the Apple Software. - Neither the name, trademarks, service marks or logos of Apple Inc. may be used - to endorse or promote products derived from the Apple Software without specific - prior written permission from Apple. Except as expressly stated in this notice, - no other rights or licenses, express or implied, are granted by Apple herein, - including but not limited to any patent rights that may be infringed by your - derivative works or by other works in which the Apple Software may be - incorporated. - - The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES NO - WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED - WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION ALONE OR IN - COMBINATION WITH YOUR PRODUCTS. - - IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR - DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF - CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF - APPLE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - Copyright (C) 2008 Apple Inc. All Rights Reserved. - - */ + +File: PVRTexture.h +Abstract: The PVRTexture class is responsible for loading .pvr files. + +Version: 1.0 + +Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple Inc. +("Apple") in consideration of your agreement to the following terms, and your +use, installation, modification or redistribution of this Apple software +constitutes acceptance of these terms. If you do not agree with these terms, +please do not use, install, modify or redistribute this Apple software. + +In consideration of your agreement to abide by the following terms, and subject +to these terms, Apple grants you a personal, non-exclusive license, under +Apple's copyrights in this original Apple software (the "Apple Software"), to +use, reproduce, modify and redistribute the Apple Software, with or without +modifications, in source and/or binary forms; provided that if you redistribute +the Apple Software in its entirety and without modifications, you must retain +this notice and the following text and disclaimers in all such redistributions +of the Apple Software. +Neither the name, trademarks, service marks or logos of Apple Inc. may be used +to endorse or promote products derived from the Apple Software without specific +prior written permission from Apple. Except as expressly stated in this notice, +no other rights or licenses, express or implied, are granted by Apple herein, +including but not limited to any patent rights that may be infringed by your +derivative works or by other works in which the Apple Software may be +incorporated. + +The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES NO +WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED +WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION ALONE OR IN +COMBINATION WITH YOUR PRODUCTS. + +IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE +GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR +DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF +CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF +APPLE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Copyright (C) 2008 Apple Inc. All Rights Reserved. + +*/ #import @@ -74,39 +74,41 @@ enum { }; /** CCTexturePVR - + Object that loads PVR images. - + Supported PVR formats: - - RGBA8888 - - BGRA8888 - - RGBA4444 - - RGBA5551 - - RGB565 - - A8 - - I8 - - AI88 - - PVRTC 4BPP - - PVRTC 2BPP - + - RGBA8888 + - BGRA8888 + - RGBA4444 + - RGBA5551 + - RGB565 + - A8 + - I8 + - AI88 + - PVRTC 4BPP + - PVRTC 2BPP + Limitations: - Pre-generated mipmaps, such as PVR textures with mipmap levels embedded in file, - are only supported if all individual sprites are of _square_ size. - To use mipmaps with non-square textures, instead call CCTexture2D#generateMipmap on the sheet texture itself - (and to save space, save the PVR sprite sheet without mip maps included). + Pre-generated mipmaps, such as PVR textures with mipmap levels embedded in file, + are only supported if all individual sprites are of _square_ size. + To use mipmaps with non-square textures, instead call CCTexture2D#generateMipmap on the sheet texture itself + (and to save space, save the PVR sprite sheet without mip maps included). */ @interface CCTexturePVR : NSObject { - struct CCPVRMipmap mipmaps_[CC_PVRMIPMAP_MAX]; // pointer to mipmap images - NSUInteger numberOfMipmaps_; // number of mipmap used - - uint32_t width_, height_; - GLuint name_; - BOOL hasAlpha_; - + struct CCPVRMipmap _mipmaps[CC_PVRMIPMAP_MAX]; // pointer to mipmap images + NSUInteger _numberOfMipmaps; // number of mipmap used + + uint32_t _width, _height; + GLuint _name; + BOOL _hasAlpha; + BOOL _hasPremultipliedAlpha; + BOOL _forcePremultipliedAlpha; + // cocos2d integration - BOOL retainName_; - CCTexture2DPixelFormat format_; + BOOL _retainName; + CCTexture2DPixelFormat _format; const ccPVRTexturePixelFormatInfo *_pixelFormatInfo; } @@ -128,6 +130,10 @@ enum { @property (nonatomic,readonly) uint32_t height; /** whether or not the texture has alpha */ @property (nonatomic,readonly) BOOL hasAlpha; +/** whether or not the texture has premultiplied alpha */ +@property (nonatomic,readonly) BOOL hasPremultipliedAlpha; +/** whether or not the texture should use hasPremultipliedAlpha instead of global default */ +@property (nonatomic,readonly) BOOL forcePremultipliedAlpha; /** how many mipmaps the texture has. 1 means one level (level 0 */ @property (nonatomic, readonly) NSUInteger numberOfMipmaps; diff --git a/include/cocos2d/CCTileMapAtlas.h b/include/cocos2d/CCTileMapAtlas.h index e8365e4..8033cf3 100644 --- a/include/cocos2d/CCTileMapAtlas.h +++ b/include/cocos2d/CCTileMapAtlas.h @@ -47,13 +47,13 @@ { /// info about the map file - tImageTGA *tgaInfo; + tImageTGA *_tgaInfo; - /// x,y to altas dicctionary - NSMutableDictionary *posToAtlasIndex; + /// x,y to altas dictionary + NSMutableDictionary *_posToAtlasIndex; /// numbers of tiles to render - int itemsToRender; + int _itemsToRender; } /** TileMap info */ @@ -72,12 +72,12 @@ /** returns a tile from position x,y. For the moment only channel R is used */ --(ccColor3B) tileAt: (ccGridSize) position; +-(ccColor3B) tileAt: (CGPoint) position; /** sets a tile at position x,y. For the moment only channel R is used */ --(void) setTile:(ccColor3B)tile at:(ccGridSize)position; +-(void) setTile:(ccColor3B)tile at:(CGPoint)position; /** dealloc the map from memory */ -(void) releaseMap; @end diff --git a/include/cocos2d/CCTransition.h b/include/cocos2d/CCTransition.h index 36b9129..3b572ce 100644 --- a/include/cocos2d/CCTransition.h +++ b/include/cocos2d/CCTransition.h @@ -3,6 +3,7 @@ * * Copyright (c) 2008-2010 Ricardo Quesada * Copyright (c) 2011 Zynga Inc. + * Copyright (c) 2013 Lars Birkemose * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -24,262 +25,85 @@ * */ - +#import +#import "cocos2d.h" #import "CCScene.h" -#import "CCTransitionOrientationType.h" - -@class CCActionInterval; -@class CCNode; -/** CCTransitionEaseScene can ease the actions of the scene protocol. - @since v0.8.2 - */ -@protocol CCTransitionEaseScene -/** returns the Ease action that will be performed on a linear action. - @since v0.8.2 - */ --(CCActionInterval*) easeActionWithAction:(CCActionInterval*)action; -@end - -/** Base class for CCTransition scenes - */ -@interface CCTransitionScene : CCScene -{ - CCScene *inScene_; - CCScene *outScene_; - ccTime duration_; - BOOL inSceneOnTop_; - BOOL sendCleanupToScene_; -} -/** creates a base transition with duration and incoming scene */ -+(id) transitionWithDuration:(ccTime) t scene:(CCScene*)s; -/** initializes a transition with duration and incoming scene */ --(id) initWithDuration:(ccTime) t scene:(CCScene*)s; -/** called after the transition finishes */ --(void) finish; -/** used by some transitions to hide the outter scene */ --(void) hideOutShowIn; -@end +// ----------------------------------------------------------------- -/** A CCTransition that supports orientation like. - * Possible orientation: LeftOver, RightOver, UpOver, DownOver - */ -@interface CCTransitionSceneOriented : CCTransitionScene +typedef NS_ENUM(NSInteger, CCTransitionDirection) { - tOrientation orientation; -} -/** creates a base transition with duration and incoming scene */ -+(id) transitionWithDuration:(ccTime) t scene:(CCScene*)s withOrientation:(tOrientation)o; -/** initializes a transition with duration and incoming scene */ --(id) initWithDuration:(ccTime) t scene:(CCScene*)s withOrientation:(tOrientation)o; -@end - - -/** CCTransitionRotoZoom: - Rotate and zoom out the outgoing scene, and then rotate and zoom in the incoming - */ -@interface CCTransitionRotoZoom : CCTransitionScene -{} -@end - -/** CCTransitionJumpZoom: - Zoom out and jump the outgoing scene, and then jump and zoom in the incoming -*/ -@interface CCTransitionJumpZoom : CCTransitionScene -{} -@end - -/** CCTransitionMoveInL: - Move in from to the left the incoming scene. -*/ -@interface CCTransitionMoveInL : CCTransitionScene -{} -/** initializes the scenes */ --(void) initScenes; -/** returns the action that will be performed */ --(CCActionInterval*) action; -@end - -/** CCTransitionMoveInR: - Move in from to the right the incoming scene. - */ -@interface CCTransitionMoveInR : CCTransitionMoveInL -{} -@end - -/** CCTransitionMoveInT: - Move in from to the top the incoming scene. - */ -@interface CCTransitionMoveInT : CCTransitionMoveInL -{} -@end - -/** CCTransitionMoveInB: - Move in from to the bottom the incoming scene. - */ -@interface CCTransitionMoveInB : CCTransitionMoveInL -{} -@end + CCTransitionDirectionUp, + CCTransitionDirectionDown, + CCTransitionDirectionRight, + CCTransitionDirectionLeft, + CCTransitionDirectionInvalid = -1, +}; -/** CCTransitionSlideInL: - Slide in the incoming scene from the left border. - */ -@interface CCTransitionSlideInL : CCTransitionScene -{} -/** initializes the scenes */ --(void) initScenes; -/** returns the action that will be performed by the incomming and outgoing scene */ --(CCActionInterval*) action; -@end +// ----------------------------------------------------------------- -/** CCTransitionSlideInR: - Slide in the incoming scene from the right border. - */ -@interface CCTransitionSlideInR : CCTransitionSlideInL -{} -@end +@interface CCTransition : CCScene -/** CCTransitionSlideInB: - Slide in the incoming scene from the bottom border. - */ -@interface CCTransitionSlideInB : CCTransitionSlideInL -{} -@end - -/** CCTransitionSlideInT: - Slide in the incoming scene from the top border. - */ -@interface CCTransitionSlideInT : CCTransitionSlideInL -{} -@end +// ----------------------------------------------------------------- /** - Shrink the outgoing scene while grow the incoming scene + * Will downscale incoming and outgoing scene + * Can be used as an effect, or to decrease render time on complex scenes + * Default 1.0 */ -@interface CCTransitionShrinkGrow : CCTransitionScene -{} -@end - -/** CCTransitionFlipX: - Flips the screen horizontally. - The front face is the outgoing scene and the back face is the incoming scene. - */ -@interface CCTransitionFlipX : CCTransitionSceneOriented -{} -@end +@property (nonatomic, assign) float outgoingDownScale; +@property (nonatomic, assign) float incomingDownScale; -/** CCTransitionFlipY: - Flips the screen vertically. - The front face is the outgoing scene and the back face is the incoming scene. - */ -@interface CCTransitionFlipY : CCTransitionSceneOriented -{} -@end - -/** CCTransitionFlipAngular: - Flips the screen half horizontally and half vertically. - The front face is the outgoing scene and the back face is the incoming scene. +/** + * Transition will be performed in retina resolution + * Will force outgoingDownScale and incomingDownScale to 1.0 on non retina devices, and 2.0 on retina devices if not set + * Default YES */ -@interface CCTransitionFlipAngular : CCTransitionSceneOriented -{} -@end +@property (nonatomic, getter = isRetinaTransition) BOOL retinaTransition; -/** CCTransitionZoomFlipX: - Flips the screen horizontally doing a zoom out/in - The front face is the outgoing scene and the back face is the incoming scene. +/** + * Pixel format used for transition + * Default kCCTexture2DPixelFormat_RGB565 */ -@interface CCTransitionZoomFlipX : CCTransitionSceneOriented -{} -@end +@property (nonatomic, assign) CCTexture2DPixelFormat transitionPixelFormat; -/** CCTransitionZoomFlipY: - Flips the screen vertically doing a little zooming out/in - The front face is the outgoing scene and the back face is the incoming scene. +/** + * Defines whether incoming and outgoing scene will be animated during transition + * Default NO */ -@interface CCTransitionZoomFlipY : CCTransitionSceneOriented -{} -@end +@property (nonatomic, getter = isOutgoingSceneAnimated) BOOL outgoingSceneAnimated; +@property (nonatomic, getter = isIncomingSceneAnimated) BOOL incomingSceneAnimated; -/** CCTransitionZoomFlipAngular: - Flips the screen half horizontally and half vertically doing a little zooming out/in. - The front face is the outgoing scene and the back face is the incoming scene. +/** + * The actual transition runtime in seconds */ -@interface CCTransitionZoomFlipAngular : CCTransitionSceneOriented -{} -@end +@property (nonatomic, readonly) NSTimeInterval runTime; -/** CCTransitionFade: - Fade out the outgoing scene and then fade in the incoming scene.''' - */ -@interface CCTransitionFade : CCTransitionScene -{ - ccColor4B color; -} -/** creates the transition with a duration and with an RGB color - * Example: [FadeTransition transitionWithDuration:2 scene:s withColor:ccc3(255,0,0)]; // red color +/** + * Normalized transition progress */ -+(id) transitionWithDuration:(ccTime)duration scene:(CCScene*)scene withColor:(ccColor3B)color; -/** initializes the transition with a duration and with an RGB color */ --(id) initWithDuration:(ccTime)duration scene:(CCScene*)scene withColor:(ccColor3B)color; -@end +@property (nonatomic, readonly) float progress; +// ----------------------------------------------------------------- /** - CCTransitionCrossFade: - Cross fades two scenes using the CCRenderTexture object. + * Creates a cross fade transition + * + * @param duration The duration of the transition in seconds + * @return A CCTransition */ -@class CCRenderTexture; -@interface CCTransitionCrossFade : CCTransitionScene -{} -@end ++ (CCTransition *)crossFadeWithDuration:(NSTimeInterval)duration; -/** CCTransitionTurnOffTiles: - Turn off the tiles of the outgoing scene in random order - */ -@interface CCTransitionTurnOffTiles : CCTransitionScene -{} -@end ++ (CCTransition *)fadeWithColor:(ccColor3B)color duration:(NSTimeInterval)duration; -/** CCTransitionSplitCols: - The odd columns goes upwards while the even columns goes downwards. - */ -@interface CCTransitionSplitCols : CCTransitionScene -{} --(CCActionInterval*) action; -@end ++ (CCTransition *)fadeWithDuration:(NSTimeInterval)duration; -/** CCTransitionSplitRows: - The odd rows goes to the left while the even rows goes to the right. - */ -@interface CCTransitionSplitRows : CCTransitionSplitCols -{} -@end ++ (CCTransition *)moveInWithDirection:(CCTransitionDirection)direction duration:(NSTimeInterval)duration; -/** CCTransitionFadeTR: - Fade the tiles of the outgoing scene from the left-bottom corner the to top-right corner. - */ -@interface CCTransitionFadeTR : CCTransitionScene -{} --(CCActionInterval*) actionWithSize:(ccGridSize) vector; -@end ++ (CCTransition *)pushWithDirection:(CCTransitionDirection)direction duration:(NSTimeInterval)duration; -/** CCTransitionFadeBL: - Fade the tiles of the outgoing scene from the top-right corner to the bottom-left corner. - */ -@interface CCTransitionFadeBL : CCTransitionFadeTR -{} -@end ++ (CCTransition *)revealWithDirection:(CCTransitionDirection)direction duration:(NSTimeInterval)duration; -/** CCTransitionFadeUp: - * Fade the tiles of the outgoing scene from the bottom to the top. - */ -@interface CCTransitionFadeUp : CCTransitionFadeTR -{} -@end +// ----------------------------------------------------------------- -/** CCTransitionFadeDown: - * Fade the tiles of the outgoing scene from the top to the bottom. - */ -@interface CCTransitionFadeDown : CCTransitionFadeTR -{} @end diff --git a/include/cocos2d/CCTransitionOrientationType.h b/include/cocos2d/CCTransitionOrientationType.h deleted file mode 100644 index 00ae810..0000000 --- a/include/cocos2d/CCTransitionOrientationType.h +++ /dev/null @@ -1,22 +0,0 @@ -// -// CCTransitionOrientationType.h -// cocos2d-ios -// -// Created by Goffredo Marocchi on 8/16/12. -// -// - -#import - -/** Orientation Type used by some transitions - */ -typedef enum { - /// An horizontal orientation where the Left is nearer - kOrientationLeftOver = 0, - /// An horizontal orientation where the Right is nearer - kOrientationRightOver = 1, - /// A vertical orientation where the Up is nearer - kOrientationUpOver = 0, - /// A vertical orientation where the Bottom is nearer - kOrientationDownOver = 1, -} tOrientation; diff --git a/include/cocos2d/Platforms/CCGL.h b/include/cocos2d/Platforms/CCGL.h index fd08b43..8ba3d79 100644 --- a/include/cocos2d/Platforms/CCGL.h +++ b/include/cocos2d/Platforms/CCGL.h @@ -27,15 +27,15 @@ // Common layer for OpenGL stuff // -#import "../ccMacros.h" +#import "ccMacros.h" -#if __CC_PLATFORM_IOS +#if defined (__CC_PLATFORM_IOS) #import #import #import #import "iOS/CCGLView.h" -#elif __CC_PLATFORM_MAC +#elif defined (__CC_PLATFORM_MAC) #import #import #import // needed for NSOpenGLView @@ -44,18 +44,20 @@ // iOS -#if __CC_PLATFORM_IOS +#if defined (__CC_PLATFORM_IOS) #define glClearDepth glClearDepthf #define glDeleteVertexArrays glDeleteVertexArraysOES #define glGenVertexArrays glGenVertexArraysOES #define glBindVertexArray glBindVertexArrayOES +#define glMapBuffer glMapBufferOES +#define glUnmapBuffer glUnmapBufferOES -#define CC_GL_DEPTH24_STENCIL8 GL_DEPTH24_STENCIL8_OES +#define GL_DEPTH24_STENCIL8 GL_DEPTH24_STENCIL8_OES +#define GL_WRITE_ONLY GL_WRITE_ONLY_OES // Mac -#elif __CC_PLATFORM_MAC +#elif defined(__CC_PLATFORM_MAC) -#define CC_GL_DEPTH24_STENCIL8 GL_DEPTH24_STENCIL8 #if 1 #define glDeleteVertexArrays glDeleteVertexArraysAPPLE diff --git a/include/cocos2d/Platforms/CCNS.h b/include/cocos2d/Platforms/CCNS.h index 5a396be..cb3e891 100644 --- a/include/cocos2d/Platforms/CCNS.h +++ b/include/cocos2d/Platforms/CCNS.h @@ -27,7 +27,7 @@ // Common layer for NS (Next-Step) stuff // -#import "../ccMacros.h" +#import "ccMacros.h" #import // for NSObject diff --git a/include/cocos2d/Platforms/Mac/CCDirectorMac.h b/include/cocos2d/Platforms/Mac/CCDirectorMac.h index 63ff82f..a393202 100644 --- a/include/cocos2d/Platforms/Mac/CCDirectorMac.h +++ b/include/cocos2d/Platforms/Mac/CCDirectorMac.h @@ -26,13 +26,11 @@ // Only compile this code on Mac. These files should not be included on your iOS project. // But in case they are included, it won't be compiled. -#import "../../ccMacros.h" +#import "ccMacros.h" #ifdef __CC_PLATFORM_MAC #import -#import "../../CCDirector.h" - -@class CCEventDispatcher; +#import "CCDirector.h" enum { /// If the window is resized, it won't be autoscaled @@ -42,8 +40,6 @@ enum { }; @interface CCDirector (MacExtension) -/** sets the CCEventDispatcher (Mac only) */ -@property (nonatomic, readwrite, retain) CCEventDispatcher* eventDispatcher; /** converts an NSEvent to GL coordinates (Mac only) */ -(CGPoint) convertEventToGL:(NSEvent*)event; @@ -54,20 +50,17 @@ enum { */ @interface CCDirectorMac : CCDirector { - BOOL isFullScreen_; - int resizeMode_; - CGPoint winOffset_; - CGSize originalWinSize_; - - NSWindow *fullScreenWindow_; + BOOL _isFullScreen; + int _resizeMode; + CGPoint _winOffset; + CGSize _originalWinSize; - // Event Dispatcher - CCEventDispatcher *eventDispatcher_; + NSWindow *_fullScreenWindow; // cache - NSWindow *windowGLView_; - NSView *superViewGLView_; - NSRect originalWinRect_; // Original size and position + NSWindow *_windowGLView; + NSView *_superViewGLView; + NSRect _originalWinRect; // Original size and position } // whether or not the view is in fullscreen mode @@ -81,7 +74,7 @@ enum { /** Sets the view in fullscreen or window mode */ - (void) setFullScreen:(BOOL)fullscreen; -/** Converts window size coordiantes to logical coordinates. +/** Converts window size coordinates to logical coordinates. Useful only if resizeMode is kCCDirectorResize_Scale. If resizeMode is kCCDirectorResize_NoScale, then no conversion will be done. */ diff --git a/include/cocos2d/Platforms/Mac/CCEventDispatcher.h b/include/cocos2d/Platforms/Mac/CCEventDispatcher.h deleted file mode 100644 index fb114bc..0000000 --- a/include/cocos2d/Platforms/Mac/CCEventDispatcher.h +++ /dev/null @@ -1,283 +0,0 @@ -/* - * cocos2d for iPhone: http://www.cocos2d-iphone.org - * - * Copyright (c) 2010 Ricardo Quesada - * Copyright (c) 2011 Zynga Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -// Only compile this code on Mac. These files should not be included on your iOS project. -// But in case they are included, it won't be compiled. -#import "../../ccMacros.h" -#ifdef __CC_PLATFORM_MAC - -#import - -#import "CCGLView.h" -#import "../../Support/uthash.h" // hack: uthash needs to be imported before utlist to prevent warning -#import "../../Support/utlist.h" -#import "../../ccConfig.h" - -#pragma mark - -#pragma mark CCMouseEventDelegate - -/** CCMouseEventDelegate protocol. - Implement it in your node to receive any of mouse events - */ -@protocol CCMouseEventDelegate -@optional - -// -// left -// -/** called when the "mouseDown" event is received. - Return YES to avoid propagating the event to other delegates. - */ --(BOOL) ccMouseDown:(NSEvent*)event; - -/** called when the "mouseDragged" event is received. - Return YES to avoid propagating the event to other delegates. - */ --(BOOL) ccMouseDragged:(NSEvent*)event; - -/** called when the "mouseMoved" event is received. - Return YES to avoid propagating the event to other delegates. - By default, "mouseMoved" is disabled. To enable it, send the "setAcceptsMouseMovedEvents:YES" message to the main window. - */ --(BOOL) ccMouseMoved:(NSEvent*)event; - -/** called when the "mouseUp" event is received. - Return YES to avoid propagating the event to other delegates. - */ --(BOOL) ccMouseUp:(NSEvent*)event; - - -// -// right -// - -/** called when the "rightMouseDown" event is received. - Return YES to avoid propagating the event to other delegates. - */ --(BOOL) ccRightMouseDown:(NSEvent*)event; - -/** called when the "rightMouseDragged" event is received. - Return YES to avoid propagating the event to other delegates. - */ --(BOOL) ccRightMouseDragged:(NSEvent*)event; - -/** called when the "rightMouseUp" event is received. - Return YES to avoid propagating the event to other delegates. - */ --(BOOL) ccRightMouseUp:(NSEvent*)event; - -// -// other -// - -/** called when the "otherMouseDown" event is received. - Return YES to avoid propagating the event to other delegates. - */ --(BOOL) ccOtherMouseDown:(NSEvent*)event; - -/** called when the "otherMouseDragged" event is received. - Return YES to avoid propagating the event to other delegates. - */ --(BOOL) ccOtherMouseDragged:(NSEvent*)event; - -/** called when the "otherMouseUp" event is received. - Return YES to avoid propagating the event to other delegates. - */ --(BOOL) ccOtherMouseUp:(NSEvent*)event; - -// -// scroll wheel -// - -/** called when the "scrollWheel" event is received. - Return YES to avoid propagating the event to other delegates. - */ -- (BOOL)ccScrollWheel:(NSEvent *)theEvent; - - -// -// enter / exit -// - -/** called when the "mouseEntered" event is received. - Return YES to avoid propagating the event to other delegates. - */ -- (void)ccMouseEntered:(NSEvent *)theEvent; - -/** called when the "mouseExited" event is received. - Return YES to avoid propagating the event to other delegates. - */ -- (void)ccMouseExited:(NSEvent *)theEvent; - -@end - -#pragma mark - -#pragma mark CCKeyboardEventDelegate - -/** CCKeyboardEventDelegate protocol. - Implement it in your node to receive any of keyboard events - */ -@protocol CCKeyboardEventDelegate -@optional -/** called when the "keyUp" event is received. - Return YES to avoid propagating the event to other delegates. - */ --(BOOL) ccKeyUp:(NSEvent*)event; - -/** called when the "keyDown" event is received. - Return YES to avoid propagating the event to other delegates. - */ --(BOOL) ccKeyDown:(NSEvent*)event; -/** called when the "flagsChanged" event is received. - Return YES to avoid propagating the event to other delegates. - */ --(BOOL) ccFlagsChanged:(NSEvent*)event; -@end - -#pragma mark - -#pragma mark CCTouchEventDelegate - -/** CCTouchEventDelegate protocol. - Implement it in your node to receive any of touch events - */ -@protocol CCTouchEventDelegate -@optional -/** called when the "touchesBegan" event is received. - Return YES to avoid propagating the event to other delegates. - */ -- (BOOL)ccTouchesBeganWithEvent:(NSEvent *)event; - -/** called when the "touchesMoved" event is received. - Return YES to avoid propagating the event to other delegates. - */ -- (BOOL)ccTouchesMovedWithEvent:(NSEvent *)event; - -/** called when the "touchesEnded" event is received. - Return YES to avoid propagating the event to other delegates. - */ -- (BOOL)ccTouchesEndedWithEvent:(NSEvent *)event; - -/** called when the "touchesCancelled" event is received. - Return YES to avoid propagating the event to other delegates. - */ -- (BOOL)ccTouchesCancelledWithEvent:(NSEvent *)event; - -@end - -#pragma mark - CCEventObject - -@interface CCEventObject : NSObject -{ -@public - NSEvent *event; - SEL selector; -} -@end - -#pragma mark - CCEventDispatcher - -struct _listEntry; -struct _listDeletedEntry; -struct _listAddedEntry; - -/** CCEventDispatcher - - This is object is responsible for dispatching the events: - - Mouse events - - Keyboard events - - Touch events - - Only available on Mac - */ -@interface CCEventDispatcher : NSObject { - - BOOL dispatchEvents_; - BOOL dispatchingInProgress_; - - struct _listEntry *keyboardDelegates_; - struct _listEntry *mouseDelegates_; - struct _listEntry *touchDelegates_; - - struct _listDeletedEntry *delegatesToBeRemoved_; - struct _listAddedEntry *delegatesToBeAdded_; - -} - -@property (nonatomic, readwrite) BOOL dispatchEvents; - -#pragma mark CCEventDispatcher - Mouse - -/** Adds a mouse delegate to the dispatcher's list. - Delegates with a lower priority value will be called before higher priority values. - All the events will be propgated to all the delegates, unless the one delegate returns YES. - - IMPORTANT: The delegate will be retained. - */ --(void) addMouseDelegate:(id) delegate priority:(NSInteger)priority; - -/** removes a mouse delegate */ --(void) removeMouseDelegate:(id) delegate; - -/** Removes all mouse delegates, releasing all the delegates */ --(void) removeAllMouseDelegates; - -#pragma mark CCEventDispatcher - Keyboard - -/** Adds a Keyboard delegate to the dispatcher's list. - Delegates with a lower priority value will be called before higher priority values. - All the events will be propgated to all the delegates, unless the one delegate returns YES. - - IMPORTANT: The delegate will be retained. - */ --(void) addKeyboardDelegate:(id) delegate priority:(NSInteger)priority; - -/** removes a mouse delegate */ --(void) removeKeyboardDelegate:(id) delegate; - -/** Removes all mouse delegates, releasing all the delegates */ --(void) removeAllKeyboardDelegates; - -#pragma mark CCEventDispatcher - Touches - -/** Adds a Touch delegate to the dispatcher's list. - Delegates with a lower priority value will be called before higher priority values. - All the events will be propgated to all the delegates, unless the one delegate returns YES. - - IMPORTANT: The delegate will be retained. - */ -- (void)addTouchDelegate:(id)delegate priority:(NSInteger)priority; - -/** Removes a touch delegate */ -- (void)removeTouchDelegate:(id) delegate; - -/** Removes all touch delegates, releasing all the delegates */ -- (void)removeAllTouchDelegates; - --(void) dispatchEvent:(CCEventObject*)event; - -@end - - -#endif // __CC_PLATFORM_MAC diff --git a/include/cocos2d/Platforms/Mac/CCGLView.h b/include/cocos2d/Platforms/Mac/CCGLView.h index a2b8224..b824c16 100644 --- a/include/cocos2d/Platforms/Mac/CCGLView.h +++ b/include/cocos2d/Platforms/Mac/CCGLView.h @@ -25,55 +25,18 @@ // Only compile this code on Mac. These files should not be included on your iOS project. // But in case they are included, it won't be compiled. -#import "../../ccMacros.h" +#import "ccMacros.h" #ifdef __CC_PLATFORM_MAC #import -#import "../../ccConfig.h" - -//PROTOCOLS: - -@protocol CCEventDelegate -// Mouse -- (void)mouseDown:(NSEvent *)theEvent; -- (void)mouseUp:(NSEvent *)theEvent; -- (void)mouseMoved:(NSEvent *)theEvent; -- (void)mouseDragged:(NSEvent *)theEvent; -- (void)rightMouseDown:(NSEvent*)event; -- (void)rightMouseDragged:(NSEvent*)event; -- (void)rightMouseUp:(NSEvent*)event; -- (void)otherMouseDown:(NSEvent*)event; -- (void)otherMouseDragged:(NSEvent*)event; -- (void)otherMouseUp:(NSEvent*)event; -- (void)scrollWheel:(NSEvent *)theEvent; -- (void)mouseEntered:(NSEvent *)theEvent; -- (void)mouseExited:(NSEvent *)theEvent; - - -// Keyboard -- (void)keyDown:(NSEvent *)theEvent; -- (void)keyUp:(NSEvent *)theEvent; -- (void)flagsChanged:(NSEvent *)theEvent; - -// Touches -- (void)touchesBeganWithEvent:(NSEvent *)event; -- (void)touchesMovedWithEvent:(NSEvent *)event; -- (void)touchesEndedWithEvent:(NSEvent *)event; -- (void)touchesCancelledWithEvent:(NSEvent *)event; - -@end +#import "ccConfig.h" /** CCGLView Only available for Mac OS X */ -@interface CCGLView : NSOpenGLView { - id eventDelegate_; -} - -/** Event delegate */ -@property (nonatomic, readwrite, assign) id eventDelegate; +@interface CCGLView : NSOpenGLView /** initializes the CCGLView with a frame rect and an OpenGL context */ - (id) initWithFrame:(NSRect)frameRect shareContext:(NSOpenGLContext*)context; diff --git a/include/cocos2d/Platforms/Mac/CCWindow.h b/include/cocos2d/Platforms/Mac/CCWindow.h index 7f37d4d..b79df95 100644 --- a/include/cocos2d/Platforms/Mac/CCWindow.h +++ b/include/cocos2d/Platforms/Mac/CCWindow.h @@ -24,7 +24,7 @@ // Only compile this code on Mac. These files should not be included on your iOS project. // But in case they are included, it won't be compiled. -#import "../../ccMacros.h" +#import "ccMacros.h" #ifdef __CC_PLATFORM_MAC #import diff --git a/include/cocos2d/Platforms/Mac/NSEvent+CC.h b/include/cocos2d/Platforms/Mac/NSEvent+CC.h new file mode 100644 index 0000000..d69482a --- /dev/null +++ b/include/cocos2d/Platforms/Mac/NSEvent+CC.h @@ -0,0 +1,41 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2013 Apportable Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#import "ccMacros.h" + +#ifdef __CC_PLATFORM_MAC + +#import + +@class CCNode; + +@interface NSEvent (CC) + +- (CGPoint) locationInNode:(CCNode*) node; + +- (CGPoint) locationInWorld; + +@end + +#endif diff --git a/include/cocos2d/Platforms/iOS/CCDirectorIOS.h b/include/cocos2d/Platforms/iOS/CCDirectorIOS.h index 871b251..89053fc 100644 --- a/include/cocos2d/Platforms/iOS/CCDirectorIOS.h +++ b/include/cocos2d/Platforms/iOS/CCDirectorIOS.h @@ -26,21 +26,21 @@ // Only compile this code on iOS. These files should NOT be included on your Mac project. // But in case they are included, it won't be compiled. -#import "../../ccMacros.h" +#import "ccMacros.h" + #ifdef __CC_PLATFORM_IOS -#import "../../CCDirector.h" -#import "kazmath/mat4.h" +#import "CCDirector.h" -@class CCTouchDispatcher; +#pragma clang diagnostic push COCOS2D +#pragma clang diagnostic ignored "-Wignored-qualifiers" +#import "kazmath/mat4.h" +#pragma clang diagnostic pop COCOS2D /** CCDirector extensions for iPhone */ @interface CCDirector (iOSExtension) -/** sets the CCTouchDispatcher (iOS only) */ -@property (nonatomic,readwrite,retain) CCTouchDispatcher * touchDispatcher; - /** The size in pixels of the surface. It could be different than the screen size. High-res devices might have a higher surface size than the screen size. In non High-res device the contentScale will be emulated. @@ -55,13 +55,16 @@ It will enable Retina Display on iPhone4 and iPod Touch 4. It will return YES, if it could enabled it, otherwise it will return NO. - This is the recommened way to enable Retina Display. + This is the recommended way to enable Retina Display. @since v0.99.5 */ -(BOOL) enableRetinaDisplay:(BOOL)enableRetina; /** returns the content scale factor */ -(CGFloat) contentScaleFactor; + +/** converts a UITouch to a GL point */ +-(CGPoint)convertTouchToGL:(UITouch*)touch; @end #pragma mark - @@ -73,10 +76,13 @@ @interface CCDirectorIOS : CCDirector { /* contentScaleFactor could be simulated */ - BOOL isContentScaleSupported_; + BOOL _isContentScaleSupported; - CCTouchDispatcher *touchDispatcher_; } + +// XXX: At least one method is needed for BridgeSupport +- (void) drawScene; + @end /** DisplayLinkDirector is a Director that synchronizes timers with the refresh rate of the display. @@ -92,8 +98,8 @@ */ @interface CCDirectorDisplayLink : CCDirectorIOS { - CADisplayLink *displayLink_; - CFTimeInterval lastDisplayTime_; + CADisplayLink *_displayLink; + CFTimeInterval _lastDisplayTime; } -(void) mainLoop:(id)sender; @end diff --git a/include/cocos2d/Platforms/iOS/CCES2Renderer.h b/include/cocos2d/Platforms/iOS/CCES2Renderer.h index 9f6163b..325f793 100644 --- a/include/cocos2d/Platforms/iOS/CCES2Renderer.h +++ b/include/cocos2d/Platforms/iOS/CCES2Renderer.h @@ -28,7 +28,7 @@ // Only compile this code on iOS. These files should NOT be included on your Mac project. // But in case they are included, it won't be compiled. -#import "../../ccMacros.h" +#import "ccMacros.h" #ifdef __CC_PLATFORM_IOS #import "CCESRenderer.h" @@ -39,26 +39,26 @@ @interface CCES2Renderer : NSObject { // The pixel dimensions of the CAEAGLLayer - GLint backingWidth_; - GLint backingHeight_; + GLint _backingWidth; + GLint _backingHeight; - unsigned int samplesToUse_; - BOOL multiSampling_; + unsigned int _samplesToUse; + BOOL _multiSampling; - unsigned int depthFormat_; - unsigned int pixelFormat_; + unsigned int _depthFormat; + unsigned int _pixelFormat; // The OpenGL ES names for the framebuffer and renderbuffer used to render to this view - GLuint defaultFramebuffer_; - GLuint colorRenderbuffer_; - GLuint depthBuffer_; + GLuint _defaultFramebuffer; + GLuint _colorRenderbuffer; + GLuint _depthBuffer; //buffers for MSAA - GLuint msaaFramebuffer_; - GLuint msaaColorbuffer_; + GLuint _msaaFramebuffer; + GLuint _msaaColorbuffer; - EAGLContext *context_; + EAGLContext *_context; } /** Color Renderbuffer */ diff --git a/include/cocos2d/Platforms/iOS/CCESRenderer.h b/include/cocos2d/Platforms/iOS/CCESRenderer.h index 59768f5..b0dc688 100644 --- a/include/cocos2d/Platforms/iOS/CCESRenderer.h +++ b/include/cocos2d/Platforms/iOS/CCESRenderer.h @@ -28,7 +28,7 @@ // Only compile this code on iOS. These files should NOT be included on your Mac project. // But in case they are included, it won't be compiled. -#import "../../ccMacros.h" +#import "ccMacros.h" #ifdef __CC_PLATFORM_IOS #import diff --git a/include/cocos2d/Platforms/iOS/CCGLView.h b/include/cocos2d/Platforms/iOS/CCGLView.h index ecac2e0..efa2094 100644 --- a/include/cocos2d/Platforms/iOS/CCGLView.h +++ b/include/cocos2d/Platforms/iOS/CCGLView.h @@ -63,7 +63,7 @@ Copyright (C) 2008 Apple Inc. All Rights Reserved. // Only compile this code on iOS. These files should NOT be included on your Mac project. // But in case they are included, it won't be compiled. -#import "../../ccMacros.h" +#import "ccMacros.h" #ifdef __CC_PLATFORM_IOS #import @@ -78,38 +78,43 @@ Copyright (C) 2008 Apple Inc. All Rights Reserved. @class CCGLView; -//PROTOCOLS: - -@protocol CCTouchDelegate -- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event; -- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event; -- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event; -- (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event; -@end - //CLASS INTERFACE: /** CCGLView Class. - * This class wraps the CAEAGLLayer from CoreAnimation into a convenient UIView subclass. - * The view content is basically an EAGL surface you render your OpenGL scene into. - * Note that setting the view non-opaque will only work if the EAGL surface has an alpha channel. + This class wraps the CAEAGLLayer from CoreAnimation into a convenient UIView subclass. + The view content is basically an EAGL surface you render your OpenGL scene into. + Note that setting the view non-opaque will only work if the EAGL surface has an alpha channel. + + Parameters: + + - viewWithFrame: size of the OpenGL view. For full screen use [_window bounds] + - Possible values: any CGRect + - pixelFormat: Format of the render buffer. Use RGBA8 for better color precision (eg: gradients). But it takes more memory and it is slower + - Possible values: kEAGLColorFormatRGBA8, kEAGLColorFormatRGB565 + - depthFormat: Use stencil if you plan to use CCClippingNode. Use Depth if you plan to use 3D effects, like CCCamera or CCNode#vertexZ + - Possible values: 0, GL_DEPTH_COMPONENT24_OES, GL_DEPTH24_STENCIL8_OES + - sharegroup: OpenGL sharegroup. Useful if you want to share the same OpenGL context between different threads + - Possible values: nil, or any valid EAGLSharegroup group + - multiSampling: Whether or not to enable multisampling + - Possible values: YES, NO + - numberOfSamples: Only valid if multisampling is enabled + - Possible values: 0 to glGetIntegerv(GL_MAX_SAMPLES_APPLE) */ @interface CCGLView : UIView { - id renderer_; - EAGLContext *context_; // weak ref + id _renderer; + EAGLContext *__unsafe_unretained _context; // weak ref - NSString *pixelformat_; - GLuint depthFormat_; - BOOL preserveBackbuffer_; + NSString *__unsafe_unretained _pixelformat; + GLuint _depthFormat; + BOOL _preserveBackbuffer; - CGSize size_; - BOOL discardFramebufferSupported_; - id touchDelegate_; + CGSize _size; + BOOL _discardFramebufferSupported; //fsaa addition - BOOL multisampling_; - unsigned int requestedSamples_; + BOOL _multisampling; + unsigned int _requestedSamples; } /** creates an initializes an CCGLView with a frame and 0-bit depth buffer, and a RGB565 color buffer. */ @@ -141,9 +146,6 @@ Copyright (C) 2008 Apple Inc. All Rights Reserved. @property(nonatomic,readwrite) BOOL multiSampling; -/** touch delegate */ -@property(nonatomic,readwrite,assign) id touchDelegate; - /** CCGLView uses double-buffer. This method swaps the buffers */ -(void) swapBuffers; diff --git a/include/cocos2d/Platforms/iOS/CCResponder.h b/include/cocos2d/Platforms/iOS/CCResponder.h new file mode 100644 index 0000000..a83e0d1 --- /dev/null +++ b/include/cocos2d/Platforms/iOS/CCResponder.h @@ -0,0 +1,56 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2010 Ricardo Quesada + * Copyright (c) 2011 Zynga Inc. + * Copyright (c) 2013 Lars Birkemose + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * + * File autogenerated with Xcode. Adapted for cocos2d needs. + */ + +#import +#import "Platforms/iOS/CCResponderManager.h" + +@class CCResponderManager; + +#if ( TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR ) + +#import + +#else + +#endif + +// ----------------------------------------------------------------- + +@interface CCResponder : NSObject + +// ----------------------------------------------------------------- + +@property (nonatomic, weak) CCResponderManager *responderManager; + ++ (id)responder; +- (id)init; + +// ----------------------------------------------------------------- + +@end diff --git a/include/cocos2d/Platforms/iOS/CCResponderManager.h b/include/cocos2d/Platforms/iOS/CCResponderManager.h new file mode 100644 index 0000000..65b1857 --- /dev/null +++ b/include/cocos2d/Platforms/iOS/CCResponderManager.h @@ -0,0 +1,131 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2010 Ricardo Quesada + * Copyright (c) 2011 Zynga Inc. + * Copyright (c) 2013 Lars Birkemose + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * + * File autogenerated with Xcode. Adapted for cocos2d needs. + */ + +#import + +#if TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR + +// ----------------------------------------------------------------- +#pragma mark - iOS +// ----------------------------------------------------------------- + +@class CCNode; + +#import + +#define RESPONDER UIResponder + +@protocol CCResponderProtocol + +@optional +- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event; +- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event; +- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event; +- (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event; + +@end + +// ----------------------------------------------------------------- + +@interface CCTouch : NSObject + +@property (nonatomic, strong) CCNode *node; // the node associated with the touch +@property (nonatomic, weak) UITouch *touch; // the current touch ( should not be retained ) +@property (nonatomic, weak) UIEvent *event; // the current event ( should not be retained ) + +@end + +#else + +// ----------------------------------------------------------------- +#pragma mark - Mac +// ----------------------------------------------------------------- + +#import + +#define RESPONDER NSResponder + +@protocol CCResponderProtocol + +@optional +- (void)mouseDown:(NSEvent *)theEvent; + +@end + + + +#endif + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/include/cocos2d/Platforms/iOS/CCTouchDelegateProtocol.h b/include/cocos2d/Platforms/iOS/CCTouchDelegateProtocol.h deleted file mode 100644 index d8e254b..0000000 --- a/include/cocos2d/Platforms/iOS/CCTouchDelegateProtocol.h +++ /dev/null @@ -1,75 +0,0 @@ -/* - * cocos2d for iPhone: http://www.cocos2d-iphone.org - * - * Copyright (c) 2009 Valentin Milea - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - * - */ - -// Only compile this code on iOS. These files should NOT be included on your Mac project. -// But in case they are included, it won't be compiled. -#import "../../ccMacros.h" -#ifdef __CC_PLATFORM_IOS - -#import - -/** - CCTargetedTouchDelegate. - - Using this type of delegate results in two benefits: - 1. You don't need to deal with NSSets, the dispatcher does the job of splitting - them. You get exactly one UITouch per call. - 2. You can *claim* a UITouch by returning YES in ccTouchBegan. Updates of claimed - touches are sent only to the delegate(s) that claimed them. So if you get a move/ - ended/cancelled update you're sure it is your touch. This frees you from doing a - lot of checks when doing multi-touch. - - (The name TargetedTouchDelegate relates to updates "targeting" their specific - handler, without bothering the other handlers.) - @since v0.8 - */ -@protocol CCTargetedTouchDelegate - -/** Return YES to claim the touch. - @since v0.8 - */ -- (BOOL)ccTouchBegan:(UITouch *)touch withEvent:(UIEvent *)event; -@optional -// touch updates: -- (void)ccTouchMoved:(UITouch *)touch withEvent:(UIEvent *)event; -- (void)ccTouchEnded:(UITouch *)touch withEvent:(UIEvent *)event; -- (void)ccTouchCancelled:(UITouch *)touch withEvent:(UIEvent *)event; -@end - -/** - CCStandardTouchDelegate. - - This type of delegate is the same one used by CocoaTouch. You will receive all the events (Began,Moved,Ended,Cancelled). - @since v0.8 -*/ -@protocol CCStandardTouchDelegate -@optional -- (void)ccTouchesBegan:(NSSet *)touches withEvent:(UIEvent *)event; -- (void)ccTouchesMoved:(NSSet *)touches withEvent:(UIEvent *)event; -- (void)ccTouchesEnded:(NSSet *)touches withEvent:(UIEvent *)event; -- (void)ccTouchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event; -@end - -#endif // __CC_PLATFORM_IOS diff --git a/include/cocos2d/Platforms/iOS/CCTouchDispatcher.h b/include/cocos2d/Platforms/iOS/CCTouchDispatcher.h deleted file mode 100644 index 9995865..0000000 --- a/include/cocos2d/Platforms/iOS/CCTouchDispatcher.h +++ /dev/null @@ -1,120 +0,0 @@ -/* - * cocos2d for iPhone: http://www.cocos2d-iphone.org - * - * Copyright (c) 2009 Valentin Milea - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - * - */ - -// Only compile this code on iOS. These files should NOT be included on your Mac project. -// But in case they are included, it won't be compiled. -#import "../../ccMacros.h" -#ifdef __CC_PLATFORM_IOS - -#import "CCTouchDelegateProtocol.h" -#import "CCGLView.h" - - -typedef enum -{ - kCCTouchSelectorBeganBit = 1 << 0, - kCCTouchSelectorMovedBit = 1 << 1, - kCCTouchSelectorEndedBit = 1 << 2, - kCCTouchSelectorCancelledBit = 1 << 3, - kCCTouchSelectorAllBits = ( kCCTouchSelectorBeganBit | kCCTouchSelectorMovedBit | kCCTouchSelectorEndedBit | kCCTouchSelectorCancelledBit), -} ccTouchSelectorFlag; - - -enum { - kCCTouchBegan, - kCCTouchMoved, - kCCTouchEnded, - kCCTouchCancelled, - - kCCTouchMax, -}; - -struct ccTouchHandlerHelperData { - SEL touchesSel; - SEL touchSel; - ccTouchSelectorFlag type; -}; - -/** CCTouchDispatcher. - Object that handles all the touch events. - The dispatcher dispatches events to the registered TouchHandlers. - There are 2 different type of touch handlers: - - Standard Touch Handlers - - Targeted Touch Handlers - - The Standard Touch Handlers work like the CocoaTouch touch handler: a set of touches is passed to the delegate. - On the other hand, the Targeted Touch Handlers only receive 1 touch at the time, and they can "swallow" touches (avoid the propagation of the event). - - Firstly, the dispatcher sends the received touches to the targeted touches. - These touches can be swallowed by the Targeted Touch Handlers. If there are still remaining touches, then the remaining touches will be sent - to the Standard Touch Handlers. - - @since v0.8.0 - */ -@interface CCTouchDispatcher : NSObject -{ - NSMutableArray *targetedHandlers; - NSMutableArray *standardHandlers; - - BOOL locked; - BOOL toAdd; - BOOL toRemove; - NSMutableArray *handlersToAdd; - NSMutableArray *handlersToRemove; - BOOL toQuit; - - BOOL dispatchEvents; - - // 4, 1 for each type of event - struct ccTouchHandlerHelperData handlerHelperData[kCCTouchMax]; -} - -/** Whether or not the events are going to be dispatched. Default: YES */ -@property (nonatomic,readwrite, assign) BOOL dispatchEvents; - -/** Adds a standard touch delegate to the dispatcher's list. - See StandardTouchDelegate description. - IMPORTANT: The delegate will be retained. - */ --(void) addStandardDelegate:(id) delegate priority:(int)priority; -/** Adds a targeted touch delegate to the dispatcher's list. - See TargetedTouchDelegate description. - IMPORTANT: The delegate will be retained. - */ --(void) addTargetedDelegate:(id) delegate priority:(int)priority swallowsTouches:(BOOL)swallowsTouches; -/** Removes a touch delegate. - The delegate will be released - */ --(void) removeDelegate:(id) delegate; -/** Removes all touch delegates, releasing all the delegates */ --(void) removeAllDelegates; -/** Changes the priority of a previously added delegate. The lower the number, - the higher the priority */ --(void) setPriority:(int) priority forDelegate:(id) delegate; - -NSComparisonResult sortByPriority(id first, id second, void *context); -@end - -#endif // __CC_PLATFORM_IOS diff --git a/include/cocos2d/Platforms/iOS/CCTouchHandler.h b/include/cocos2d/Platforms/iOS/CCTouchHandler.h deleted file mode 100644 index c448972..0000000 --- a/include/cocos2d/Platforms/iOS/CCTouchHandler.h +++ /dev/null @@ -1,93 +0,0 @@ -/* - * cocos2d for iPhone: http://www.cocos2d-iphone.org - * - * Copyright (c) 2009 Valentin Milea - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - * - */ - -// Only compile this code on iOS. These files should NOT be included on your Mac project. -// But in case they are included, it won't be compiled. -#import "../../ccMacros.h" -#ifdef __CC_PLATFORM_IOS - -/* - * This file contains the delegates of the touches - * There are 2 possible delegates: - * - CCStandardTouchHandler: propagates all the events at once - * - CCTargetedTouchHandler: propagates 1 event at the time - */ - -#import "CCTouchDelegateProtocol.h" -#import "CCTouchDispatcher.h" - -/** - CCTouchHandler - Object than contains the delegate and priority of the event handler. -*/ -@interface CCTouchHandler : NSObject { - id delegate; - int priority; - ccTouchSelectorFlag enabledSelectors_; -} - -/** delegate */ -@property(nonatomic, readwrite, retain) id delegate; -/** priority */ -@property(nonatomic, readwrite) int priority; // default 0 -/** enabled selectors */ -@property(nonatomic,readwrite) ccTouchSelectorFlag enabledSelectors; - -/** allocates a TouchHandler with a delegate and a priority */ -+ (id)handlerWithDelegate:(id)aDelegate priority:(int)priority; -/** initializes a TouchHandler with a delegate and a priority */ -- (id)initWithDelegate:(id)aDelegate priority:(int)priority; -@end - -/** CCStandardTouchHandler - It forwardes each event to the delegate. - */ -@interface CCStandardTouchHandler : CCTouchHandler -{ -} -@end - -/** - CCTargetedTouchHandler - Object than contains the claimed touches and if it swallos touches. - Used internally by TouchDispatcher - */ -@interface CCTargetedTouchHandler : CCTouchHandler { - BOOL swallowsTouches; - NSMutableSet *claimedTouches; -} -/** whether or not the touches are swallowed */ -@property(nonatomic, readwrite) BOOL swallowsTouches; // default NO -/** MutableSet that contains the claimed touches */ -@property(nonatomic, readonly) NSMutableSet *claimedTouches; - -/** allocates a TargetedTouchHandler with a delegate, a priority and whether or not it swallows touches or not */ -+ (id)handlerWithDelegate:(id) aDelegate priority:(int)priority swallowsTouches:(BOOL)swallowsTouches; -/** initializes a TargetedTouchHandler with a delegate, a priority and whether or not it swallows touches or not */ -- (id)initWithDelegate:(id) aDelegate priority:(int)priority swallowsTouches:(BOOL)swallowsTouches; - -@end - -#endif // __CC_PLATFORM_IOS diff --git a/include/cocos2d/Platforms/iOS/UITouch+CC.h b/include/cocos2d/Platforms/iOS/UITouch+CC.h new file mode 100644 index 0000000..2642def --- /dev/null +++ b/include/cocos2d/Platforms/iOS/UITouch+CC.h @@ -0,0 +1,39 @@ + +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2013 Apportable Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#import "ccMacros.h" + +#ifdef __CC_PLATFORM_IOS + +#import "cocos2d.h" +#import + +@interface UITouch (CC) + +- (CGPoint) locationInNode:(CCNode*) node; +- (CGPoint) locationInWorld; +@end + +#endif diff --git a/include/cocos2d/Support/CCArray.h b/include/cocos2d/Support/CCArray.h deleted file mode 100644 index 5bbdfe4..0000000 --- a/include/cocos2d/Support/CCArray.h +++ /dev/null @@ -1,119 +0,0 @@ -/* - * cocos2d for iPhone: http://www.cocos2d-iphone.org - * - * Copyright (c) 2010 ForzeField Studios S.L. http://forzefield.com - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - - -#import "ccCArray.h" - - -/** A faster alternative of NSArray. - CCArray uses internally a c-array. - @since v0.99.4 - */ - - -/** @def CCARRAY_FOREACH - A convience macro to iterate over a CCArray using. It is faster than the "fast enumeration" interface. - @since v0.99.4 - */ - -#define CCARRAY_FOREACH(__array__, __object__) \ -if (__array__ && __array__->data->num > 0) \ -for(const CC_ARC_UNSAFE_RETAINED id *__arr__ = __array__->data->arr, *end = __array__->data->arr + __array__->data->num-1; \ - __arr__ <= end && ((__object__ = *__arr__) != nil || true); \ - __arr__++) - -@interface CCArray : NSObject -{ - @public ccArray *data; -} - -+ (id) array; -+ (id) arrayWithCapacity:(NSUInteger)capacity; -+ (id) arrayWithArray:(CCArray*)otherArray; -+ (id) arrayWithNSArray:(NSArray*)otherArray; - - -- (id) initWithCapacity:(NSUInteger)capacity; -- (id) initWithArray:(CCArray*)otherArray; -- (id) initWithNSArray:(NSArray*)otherArray; - - -// Querying an Array - -- (NSUInteger) count; -- (NSUInteger) capacity; -- (NSUInteger) indexOfObject:(id)object; -- (id) objectAtIndex:(NSUInteger)index; -- (BOOL) containsObject:(id)object; -- (id) randomObject; -- (id) lastObject; -- (NSArray*) getNSArray; -/** @since 1.1 */ -- (BOOL) isEqualToArray:(CCArray*)otherArray; - - -// Adding Objects - -- (void) addObject:(id)object; -- (void) addObjectsFromArray:(CCArray*)otherArray; -- (void) addObjectsFromNSArray:(NSArray*)otherArray; -- (void) insertObject:(id)object atIndex:(NSUInteger)index; - - -// Removing Objects - -- (void) removeLastObject; -- (void) removeObject:(id)object; -- (void) removeObjectAtIndex:(NSUInteger)index; -- (void) removeObjectsInArray:(CCArray*)otherArray; -- (void) removeAllObjects; -- (void) fastRemoveObject:(id)object; -- (void) fastRemoveObjectAtIndex:(NSUInteger)index; - - -// Rearranging Content - -- (void) exchangeObject:(id)object1 withObject:(id)object2; -- (void) exchangeObjectAtIndex:(NSUInteger)index1 withObjectAtIndex:(NSUInteger)index2; -/** @since 1.1 */ -- (void) replaceObjectAtIndex:(NSUInteger)index withObject:(id)anObject; -- (void) reverseObjects; -- (void) reduceMemoryFootprint; - -// Sorting Array -/** all since @1.1 */ -- (void) qsortUsingCFuncComparator:(int(*)(const void *, const void *))comparator; // c qsort is used for sorting -- (void) insertionSortUsingCFuncComparator:(int(*)(const void *, const void *))comparator; // insertion sort -- (void) mergesortLUsingCFuncComparator:(int(*)(const void *, const void *))comparator; // mergesort -- (void) insertionSort:(SEL)selector; // It sorts source array in ascending order -- (void) sortUsingFunction:(NSInteger (*)(id, id, void *))compare context:(void *)context; - -// Sending Messages to Elements - -- (void) makeObjectsPerformSelector:(SEL)aSelector; -- (void) makeObjectsPerformSelector:(SEL)aSelector withObject:(id)object; -/** @since 1.1 */ -- (void) makeObjectPerformSelectorWithArrayObjects:(id)object selector:(SEL)aSelector; - -@end diff --git a/include/cocos2d/Support/CCFileUtils.h b/include/cocos2d/Support/CCFileUtils.h index 9cf7359..83556c5 100644 --- a/include/cocos2d/Support/CCFileUtils.h +++ b/include/cocos2d/Support/CCFileUtils.h @@ -28,33 +28,148 @@ #import #import "../ccTypes.h" +// keys used for the suffix or directory dictionaries +extern NSString const *kCCFileUtilsDefault; +extern NSString const *kCCFileUtilsiPad; +extern NSString const *kCCFileUtilsiPadHD; +extern NSString const *kCCFileUtilsiPhone; +extern NSString const *kCCFileUtilsiPhoneHD; +extern NSString const *kCCFileUtilsiPhone5; +extern NSString const *kCCFileUtilsiPhone5HD; +extern NSString const *kCCFileUtilsMac; +extern NSString const *kCCFileUtilsMacHD; + +extern NSString const *kCCFileUtilsDefaultSearchPath; + +enum { + kCCFileUtilsSearchSuffixMode, + kCCFileUtilsSearchDirectoryMode, +}; + + /** Helper class to handle file operations */ @interface CCFileUtils : NSObject { - NSFileManager *fileManager_; - NSBundle *bundle_; - NSMutableDictionary *fullPathCache_; - NSMutableDictionary *removeSuffixCache_; + NSFileManager *_fileManager; + NSBundle *_bundle; + + NSMutableDictionary *_fullPathCache; + NSMutableDictionary *_fullPathNoResolutionsCache; + NSMutableDictionary *_removeSuffixCache; + NSMutableDictionary *_directoriesDict; + NSMutableDictionary *_suffixesDict; -#ifdef __CC_PLATFORM_IOS - BOOL enableFallbackSuffixes_; + NSMutableDictionary *_filenameLookup; - NSString *iPhoneRetinaDisplaySuffix_; - NSString *iPadSuffix_; - NSString *iPadRetinaDisplaySuffix_; -#endif // __CC_PLATFORM_IOS + NSMutableArray *_searchResolutionsOrder; + NSMutableArray *_searchPath; + + // it could be suffix (default) or directory + int _searchMode; + + BOOL _enableiPhoneResourcesOniPad; } /** NSBundle used by CCFileUtils. By default it uses [NSBundle mainBundle]. @since v2.0 */ -@property (nonatomic, readwrite, retain) NSBundle *bundle; +@property (nonatomic, readwrite, strong) NSBundle *bundle; -/** NSFileManager used by CCFileUtils. By default it uses its own intance. +/** NSFileManager used by CCFileUtils. By default it uses its own instance. @since v2.0 */ -@property (nonatomic, readwrite, retain) NSFileManager *fileManager; +@property (nonatomic, readwrite, strong) NSFileManager *fileManager; + +/** Whether of not the fallback suffixes is enabled. + When enabled it will try to search for the following suffixes in the following order until one is found: + * On iPad HD : iPad HD, iPad, iPhone HD, Resources without resolution + * On iPad : iPad, iPhone HD, Resources without resolution + * On iPhone HD: iPhone HD, Resources without resolution + * On Mac HD : Mac HD, Mac, Resources without resolution + * On Mac : Mac, Resources without resolution + + By default this functionality is off; + */ +@property (nonatomic, readwrite, getter = isEnablediPhoneResourcesOniPad) BOOL enableiPhoneResourcesOniPad; + +/** Dictionary that contians the search directories for the different devices. Default values: + - iPhone: "resources-iphone" + - iPhone HD: "resources-hd" + - iPhone5 : "resources-wide" + - iPhone5 HD: "resources-widehd" + - iPad: "resources-ipad" + - iPad HD: "resources-ipadhd" + - Mac: "resources-mac" + - Mac HD: "resources-machd" + + If "search in directories" is enabled (disabled by default), it will try to get the resources from the directories according to the order of "searchResolutionsOrder" array. + @since v2.1 + */ +@property (nonatomic, copy) NSMutableDictionary *directoriesDict; + +/** Dictionary that contians the suffix for the different devices. Default values: + - iPhone: "" + - iPhone HD: "-hd" + - iPhone5 : "-wide" + - iPhone5 HD: "-widehd" + - iPad: "-ipad" + - iPad HD: "-ipadhd" + - Mac: "" + - Mac HD: "-machd" + + If "search with suffixes" is enabled (enabled by default), it will try to get the resources by appending the suffixes according to the order of "searchResolutionsOrder" array. + @since v2.1 + */ +@property (nonatomic, copy) NSMutableDictionary *suffixesDict; + +/** Array that contains the search order of the resources based for the device. + By default it will try to load resources in the following order until one is found: + - On iPad HD: iPad HD resources, iPad resources, resources not associated with any device + - On iPad: iPad resources, resources not associated with any device + - On iPhone 5 HD: iPhone 5 HD resources, iPhone HD resouces, iPhone 5 resources, iPhone resources, resources not associated with any device + - On iPhone HD: iPhone HD resources, iPhone resouces, resources not associated with any device + - On iPhone: iPhone resources, resources not associated with any device + + - On Mac HD: Mac HD resources, Mac resources, resources not associated with any device + - On Mac: Mac resources, resources not associated with any device + + If the property "enableiPhoneResourcesOniPad" is enabled, it will also search for iPhone resources if you are in an iPad. + + @since v2.1 + */ +@property (nonatomic, copy) NSArray *searchResolutionsOrder; + +/** Array of search paths. + You can use this array to modify the search path of the resources. + If you want to use "themes" or search resources in the "cache", you can do it easily by adding new entries in this array. + + By default it is an array with only the "" (empty string) element. + + @since v2.1 + */ +@property (nonatomic, copy) NSArray *searchPath; + + +/** It determines how the "resolution resources" are to be searched. + Possible values: + - kCCFileUtilsSearchSuffix: It will search for resources by appending suffixes like "-hd", "-ipad", etc... + - kCCFileUtilsSearchDirectory: It will search the resoureces in subdirectories like "resources-hd", "resources-ipad", etc... + + Default: kCCFileUtilsSearchSuffix + @since v2.1 + */ +@property (nonatomic, readwrite) int searchMode; + +/** Dictionary used to lookup filenames based on a key. + It is used internally by the following methods: + + * -(NSString*) fullPathForFilename:(NSString*)key resolutionType:(ccResolutionType*)resolutionType; + * -(NSString*) fullPathForFilenameIgnoringResolutions:(NSString*)key; + + @since v2.1 + */ +@property (nonatomic, readwrite, copy) NSMutableDictionary *filenameLookup; #ifdef __CC_PLATFORM_IOS /** The iPhone RetinaDisplay suffixes to load resources. @@ -63,7 +178,7 @@ @since v1.1 */ -@property (nonatomic,readwrite, copy, setter = setiPhoneRetinaDisplaySuffix:) NSString *iPhoneRetinaDisplaySuffix; +-(void) setiPhoneRetinaDisplaySuffix:(NSString*)iPhoneRetinaDisplaySuffix; /** The iPad suffixes to load resources. By default it is "-ipad", "-hd", "", in that order. @@ -71,7 +186,7 @@ @since v1.1 */ -@property (nonatomic,readwrite, copy, setter = setiPadSuffix:) NSString *iPadSuffix; +-(void) setiPadSuffix:(NSString*) iPadSuffix; /** Sets the iPad Retina Display suffixes to load resources. @@ -80,19 +195,10 @@ @since v2.0 */ -@property (nonatomic,readwrite, copy, setter = setiPadRetinaDisplaySuffix:) NSString *iPadRetinaDisplaySuffix; +-(void)setiPadRetinaDisplaySuffix:(NSString*)iPadRetinaDisplaySuffix; -/** Whether of not the fallback sufixes is enabled. - When enabled it will try to search for the following suffixes in the following order until one is found: - * On iPad HD : iPad HD suffix, iPad suffix, iPhone HD suffix, Without suffix - * On iPad : iPad suffix, iPhone HD suffix, Without suffix - * On iPhone HD: iPhone HD suffix, Without suffix - - By default this functionality is off; -*/ -@property (nonatomic, readwrite) BOOL enableFallbackSuffixes; +#endif // __CC_PLATFORM_IOS - #endif // __CC_PLATFORM_IOS /** returns the shared file utils instance */ +(CCFileUtils*) sharedFileUtils; @@ -103,10 +209,18 @@ */ -(void) purgeCachedEntries; +/** Calling this method will populate the searchResolutionsOrder property depending on the current device. + + @since v2.1 + */ +- (void) buildSearchResolutionsOrder; + /** Returns the fullpath of an filename. If in iPhoneRetinaDisplay mode, and a RetinaDisplay file is found, it will return that path. If in iPad mode, and an iPad file is found, it will return that path. + + If the filename can't be found, it will return "relPath" instead of nil. Examples: @@ -117,37 +231,125 @@ */ -(NSString*) fullPathFromRelativePath:(NSString*) relPath; - -/** Returns the fullpath of an filename including the resolution of the image. +/** Returns the fullpath of an filename. It will try to get the correct file for the current screen resolution. + Useful for loading images and other assets that are related for the screen resolution. - If in RetinaDisplay mode, and a RetinaDisplay file is found, it will return that path. If in iPad mode, and an iPad file is found, it will return that path. - + If in iPhoneRetinaDisplay mode, and a RetinaDisplay file is found, it will return that path. But if it is not found, it will try load an iPhone Non-RetinaDisplay file. + + If the filename can't be found, it will return "relPath" instead of nil. + Examples: * In iPad mode: "image.png" -> "/full/path/image-ipad.png" (in case the -ipad file exists) * In iPhone RetinaDisplay mode: "image.png" -> "/full/path/image-hd.png" (in case the -hd file exists) * In iPad RetinaDisplay mode: "image.png" -> "/full/path/image-ipadhd.png" (in case the -ipadhd file exists) - If an iPad file is found, it will set resolution type to kCCResolutioniPad - If a RetinaDisplay file is found, it will set resolution type to kCCResolutionRetinaDisplay - */ -(NSString*) fullPathFromRelativePath:(NSString*)relPath resolutionType:(ccResolutionType*)resolutionType; -#ifdef __CC_PLATFORM_IOS +/** Returns the fullpath of an filename without taking into account the screen resolution suffixes or directories. + + It will use the "searchPath" though. + If the file can't be found, it will return nil. + + Useful for loading music files, shaders, "data" and other files that are not related to the screen resolution of the device. + + @since v2.1 + */ +-(NSString*) fullPathFromRelativePathIgnoringResolutions:(NSString*)relPath; + +/** Returns the fullpath for a given filename. + + First it will try to get a new filename from the "filenameLookup" dictionary. If a new filename can't be found on the dictionary, it will use the original filename. + Then it will try obtain the full path of the filename using the CCFileUtils search rules: resolutions, and search paths + + If in iPad mode, and an iPad file is found, it will return that path. + If in iPhoneRetinaDisplay mode, and a RetinaDisplay file is found, it will return that path. But if it is not found, it will try load an iPhone Non-RetinaDisplay file. + + If the filename can't be found on the file system, it will return nil. + + This method was added to simplify multiplatform support. Whether you are using cocos2d-js or any cross-compilation toolchain like StellaSDK or Apportable, + you might need to load differerent resources for a given file in the different platforms. + + Examples: + + * In iPad mode: "image.png" -> "image.pvr" -> "/full/path/image-ipad.pvr" (in case the -ipad file exists) + * In Android: "image.png" -> "image.png" -> "/full/path/image.png" + + @since v2.1 + */ +-(NSString*) fullPathForFilename:(NSString*)filename; + +/** Returns the fullpath for a given filename. + + First it will try to get a new filename from the "filenameLookup" dictionary. If a new filename can't be found on the dictionary, it will use the original filename. + Then it will try obtain the full path of the filename using the CCFileUtils search rules: resolutions, and search paths + + If in iPad mode, and an iPad file is found, it will return that path. + If in iPhoneRetinaDisplay mode, and a RetinaDisplay file is found, it will return that path. But if it is not found, it will try load an iPhone Non-RetinaDisplay file. + + If the filename can't be found on the file system, it will return nil. + + This method was added to simplify multiplatform support. Whether you are using cocos2d-js or any cross-compilation toolchain like StellaSDK or Apportable, + you might need to load differerent resources for a given file in the different platforms. + + Examples: + + * In iPad mode: "image.png" -> "image.pvr" -> "/full/path/image-ipad.pvr" (in case the -ipad file exists) + * In Android: "image.png" -> "image.png" -> "/full/path/image.png" + + @since v2.1 + */ +-(NSString*) fullPathForFilename:(NSString*)filename resolutionType:(ccResolutionType*)resolutionType; + +/** Returns the fullpath for a given filename, without taking into account device resolution. + + It will try to get a new filename from the "filenameLookup" dictionary. If a new filename can't be found on the dictionary, it will use the original filename. + + Once it gets the filename, it will try to get the fullpath for the filename, using the "searchPath", but it won't use any resolution search rules. + If the file can't be found, it will return nil. + + Useful for loading music files, shaders, "data" and other files that are not related to the screen resolution of the device. + + This method was added to simplify multiplatform support. Whether you are using cocos2d-js or any cross-compilation toolchain like StellaSDK or Apportable, + you might need to load differerent resources for a given file in the different platforms. + + Examples: + + * On iOS: "sound.wav" -> "sound.caf" -> "/full/path/sound.caf" (in case the key dictionary says that "sound.wav" should be converted to "sound.caf") + * On Android: "sound.wav" -> "sound.wav" -> "/full/path/sound.caf" (in case the key dictionary says that "sound.wav" should be converted to "sound.caf") + + + @since v2.1 + */ +-(NSString*) fullPathForFilenameIgnoringResolutions:(NSString*)key; + +/* Loads the filenameLookup dictionary from the contents of a filename. + + @since v2.1 + */ +-(void) loadFilenameLookupDictionaryFromFile:(NSString*)filename; /** removes the suffix from a path * On iPhone RetinaDisplay it will remove the -hd suffix * On iPad it will remove the -ipad suffix * On iPad RetinaDisplay it will remove the -ipadhd suffix - - Only valid on iOS. Not valid for OS X. - + @since v0.99.5 */ -(NSString *)removeSuffixFromFile:(NSString*) path; +/* Stadarize a path. + + It calls [string stringByStandardizingPath], and if "suffix mode" is on, it will also call [self removeSuffixFromFile:path]; + + @since v2.1 + */ +-(NSString*) standarizePath:(NSString*)path; + +#ifdef __CC_PLATFORM_IOS + /** Returns whether or not a given path exists with the iPhone RetinaDisplay suffix. Only available on iOS. Not supported on OS X. @since v1.1 @@ -166,10 +368,14 @@ */ -(BOOL) iPadRetinaDisplayFileExistsAtPath:(NSString*)filename; -#endif // __CC_PLATFORM_IOS +#endif // __CC_PLATFORM_MAC -@end +/** + @deprecated + */ +-(void) setEnableFallbackSuffixes:(BOOL)enableFallbackSuffixes; +@end #ifdef __cplusplus extern "C" { @@ -182,7 +388,7 @@ extern "C" { @since v0.99.5 */ NSInteger ccLoadFileIntoMemory(const char *filename, unsigned char **out); - + #ifdef __cplusplus } #endif diff --git a/include/cocos2d/Support/CCVertex.h b/include/cocos2d/Support/CCVertex.h index 8873fee..b0f7374 100644 --- a/include/cocos2d/Support/CCVertex.h +++ b/include/cocos2d/Support/CCVertex.h @@ -29,7 +29,7 @@ /** converts a line to a polygon */ void ccVertexLineToPolygon(CGPoint *points, float stroke, ccVertex2F *vertices, NSUInteger offset, NSUInteger nuPoints); -/** returns wheter or not the line intersects */ +/** returns whether or not the line intersects */ BOOL ccVertexLineIntersect(float Ax, float Ay, float Bx, float By, float Cx, float Cy, diff --git a/include/cocos2d/Support/CGPointExtension.h b/include/cocos2d/Support/CGPointExtension.h index 90510c4..ff92362 100644 --- a/include/cocos2d/Support/CGPointExtension.h +++ b/include/cocos2d/Support/CGPointExtension.h @@ -63,8 +63,10 @@ extern "C" { @return CGPoint @since v0.7.2 */ -#define ccp(__X__,__Y__) CGPointMake(__X__,__Y__) - +static inline CGPoint ccp( CGFloat x, CGFloat y ) +{ + return CGPointMake(x, y); +} /** Returns opposite of point. @return CGPoint diff --git a/include/cocos2d/Support/NSAttributedString+CCAdditions.h b/include/cocos2d/Support/NSAttributedString+CCAdditions.h new file mode 100644 index 0000000..91a609f --- /dev/null +++ b/include/cocos2d/Support/NSAttributedString+CCAdditions.h @@ -0,0 +1,36 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2008-2010 Ricardo Quesada + * Copyright (c) 2011 Zynga Inc. + * Copyright (c) 2013 Apportable + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + */ + +#import + +@interface NSAttributedString (CCAdditions) + +- (BOOL) hasAttribute:(NSString*)attr; +- (NSAttributedString*) copyAdjustedForContentScaleFactor; +- (float) singleFontSize; +- (NSAttributedString*) copyWithNewFontSize:(float) size; +@end diff --git a/include/cocos2d/Support/TransformUtils.h b/include/cocos2d/Support/TransformUtils.h index 7cbb92e..4808035 100644 --- a/include/cocos2d/Support/TransformUtils.h +++ b/include/cocos2d/Support/TransformUtils.h @@ -23,7 +23,7 @@ * */ -#import "../ccMacros.h" +#import "ccMacros.h" #import "../Platforms/CCGL.h" #ifdef __CC_PLATFORM_IOS diff --git a/include/cocos2d/Support/ZipUtils.h b/include/cocos2d/Support/ZipUtils.h index 99034a9..6474523 100644 --- a/include/cocos2d/Support/ZipUtils.h +++ b/include/cocos2d/Support/ZipUtils.h @@ -24,13 +24,15 @@ extern "C" { /* XXX: pragma pack ??? */ /** @struct CCZHeader */ +#pragma clang diagnostic push COCOS2D +#pragma clang diagnostic ignored "-Wpacked" struct CCZHeader { uint8_t sig[4]; // signature. Should be 'CCZ!' 4 bytes uint16_t compression_type; // should 0 uint16_t version; // should be 2 (although version type==1 is also supported) - uint32_t reserved; // Reserverd for users. + uint32_t reserved; // Reserved for users. uint32_t len; // size of the uncompressed file - }; + }__attribute__((packed)); enum { CCZ_COMPRESSION_ZLIB, // zlib format. @@ -38,6 +40,7 @@ extern "C" { CCZ_COMPRESSION_GZIP, // gzip format (not supported yet) CCZ_COMPRESSION_NONE, // plain (not supported yet) }; +#pragma clang diagnostic pop COCOS2D /** @file * Zip helper functions @@ -47,7 +50,7 @@ extern "C" { * Inflates either zlib or gzip deflated memory. The inflated memory is * expected to be freed by the caller. * - * It will allocate 256k for the destination buffer. If it is not enought it will multiply the previous buffer size per 2, until there is enough memory. + * It will allocate 256k for the destination buffer. If it is not enough it will multiply the previous buffer size per 2, until there is enough memory. * @returns the length of the deflated buffer * @since v0.8.1 @@ -58,13 +61,13 @@ int ccInflateMemory(unsigned char *in, unsigned int inLength, unsigned char **ou * Inflates either zlib or gzip deflated memory. The inflated memory is * expected to be freed by the caller. * - * outLenghtHint is assumed to be the needed room to allocate the inflated buffer. + * outlengthHint is assumed to be the needed room to allocate the inflated buffer. * * @returns the length of the deflated buffer * @since v1.0.0 */ -int ccInflateMemoryWithHint(unsigned char *in, unsigned int inLength, unsigned char **out, unsigned int outLenghtHint ); +int ccInflateMemoryWithHint(unsigned char *in, unsigned int inLength, unsigned char **out, unsigned int outlengthHint ); /** inflates a GZip file into memory diff --git a/include/cocos2d/Support/ccCArray.h b/include/cocos2d/Support/ccCArray.h deleted file mode 100644 index daa8b4b..0000000 --- a/include/cocos2d/Support/ccCArray.h +++ /dev/null @@ -1,229 +0,0 @@ -/* Copyright (c) 2007 Scott Lembcke - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -/** - @file - based on Chipmunk cpArray. - ccArray is a faster alternative to NSMutableArray, it does pretty much the - same thing (stores NSObjects and retains/releases them appropriately). It's - faster because: - - it uses a plain C interface so it doesn't incur Objective-c messaging overhead - - it assumes you know what you're doing, so it doesn't spend time on safety checks - (index out of bounds, required capacity etc.) - - comparisons are done using pointer equality instead of isEqual - - There are 2 kind of functions: - - ccArray functions that manipulates objective-c objects (retain and release are performanced) - - ccCArray functions that manipulates values like if they were standard C structures (no retain/release is performed) - */ - -#ifndef CC_ARRAY_H -#define CC_ARRAY_H - -#import - -#import -#import - -#import "../ccMacros.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#pragma mark - -#pragma mark ccArray for Objects - -// Easy integration -#define CCARRAYDATA_FOREACH(__array__, __object__) \ -__object__=__array__->arr[0]; for(NSUInteger i=0, num=__array__->num; iarr[i]) \ - -#if defined(__has_feature) && __has_feature(objc_arc) - typedef __strong id CCARRAY_ID; -#else - typedef id CCARRAY_ID; -#endif - -typedef struct ccArray { - NSUInteger num, max; - CCARRAY_ID *arr; -} ccArray; - -typedef int (*cc_comparator)(const void *, const void *); - -/** Allocates and initializes a new array with specified capacity */ -ccArray* ccArrayNew(NSUInteger capacity); - -/** Frees array after removing all remaining objects. Silently ignores nil arr. */ -void ccArrayFree(ccArray *arr); - -/** Doubles array capacity */ -void ccArrayDoubleCapacity(ccArray *arr); - -/** Increases array capacity such that max >= num + extra. */ -void ccArrayEnsureExtraCapacity(ccArray *arr, NSUInteger extra); - -/** shrinks the array so the memory footprint corresponds with the number of items */ -void ccArrayShrink(ccArray *arr); - -/** Returns index of first occurence of object, NSNotFound if object not found. */ -NSUInteger ccArrayGetIndexOfObject(ccArray *arr, id object); - -/** Returns a Boolean value that indicates whether object is present in array. */ -BOOL ccArrayContainsObject(ccArray *arr, id object); - -/** Appends an object. Bahaviour undefined if array doesn't have enough capacity. */ -void ccArrayAppendObject(ccArray *arr, id object); - -/** Appends an object. Capacity of arr is increased if needed. */ -void ccArrayAppendObjectWithResize(ccArray *arr, id object); - -/** Appends objects from plusArr to arr. - Behaviour undefined if arr doesn't have enough capacity. */ -void ccArrayAppendArray(ccArray *arr, ccArray *plusArr); - -/** Appends objects from plusArr to arr. Capacity of arr is increased if needed. */ -void ccArrayAppendArrayWithResize(ccArray *arr, ccArray *plusArr); - -/** Inserts an object at index */ -void ccArrayInsertObjectAtIndex(ccArray *arr, id object, NSUInteger index); - -/** Swaps two objects */ -void ccArraySwapObjectsAtIndexes(ccArray *arr, NSUInteger index1, NSUInteger index2); - -/** Removes all objects from arr */ -void ccArrayRemoveAllObjects(ccArray *arr); - -/** Removes object at specified index and pushes back all subsequent objects. - Behaviour undefined if index outside [0, num-1]. */ -void ccArrayRemoveObjectAtIndex(ccArray *arr, NSUInteger index); - -/** Removes object at specified index and fills the gap with the last object, - thereby avoiding the need to push back subsequent objects. - Behaviour undefined if index outside [0, num-1]. */ -void ccArrayFastRemoveObjectAtIndex(ccArray *arr, NSUInteger index); - -void ccArrayFastRemoveObject(ccArray *arr, id object); - -/** Searches for the first occurance of object and removes it. If object is not - found the function has no effect. */ -void ccArrayRemoveObject(ccArray *arr, id object); - -/** Removes from arr all objects in minusArr. For each object in minusArr, the - first matching instance in arr will be removed. */ -void ccArrayRemoveArray(ccArray *arr, ccArray *minusArr); - -/** Removes from arr all objects in minusArr. For each object in minusArr, all - matching instances in arr will be removed. */ -void ccArrayFullRemoveArray(ccArray *arr, ccArray *minusArr); - -/** Sends to each object in arr the message identified by given selector. */ -void ccArrayMakeObjectsPerformSelector(ccArray *arr, SEL sel); - -void ccArrayMakeObjectsPerformSelectorWithObject(ccArray *arr, SEL sel, id object); - -void ccArrayMakeObjectPerformSelectorWithArrayObjects(ccArray *arr, SEL sel, id object); - - -#pragma mark - -#pragma mark ccCArray for Values (c structures) - -typedef ccArray ccCArray; - -/** Allocates and initializes a new C array with specified capacity */ -ccCArray* ccCArrayNew(NSUInteger capacity); - -/** Frees C array after removing all remaining values. Silently ignores nil arr. */ -void ccCArrayFree(ccCArray *arr); - -/** Doubles C array capacity */ -void ccCArrayDoubleCapacity(ccCArray *arr); - -/** Increases array capacity such that max >= num + extra. */ -void ccCArrayEnsureExtraCapacity(ccCArray *arr, NSUInteger extra); - -/** Returns index of first occurence of value, NSNotFound if value not found. */ -NSUInteger ccCArrayGetIndexOfValue(ccCArray *arr, CCARRAY_ID value); - -/** Returns a Boolean value that indicates whether value is present in the C array. */ -BOOL ccCArrayContainsValue(ccCArray *arr, CCARRAY_ID value); - -/** Inserts a value at a certain position. Behaviour undefined if aray doesn't have enough capacity */ -void ccCArrayInsertValueAtIndex( ccCArray *arr, CCARRAY_ID value, NSUInteger index); - -/** Appends an value. Bahaviour undefined if array doesn't have enough capacity. */ -void ccCArrayAppendValue(ccCArray *arr, CCARRAY_ID value); - -/** Appends an value. Capacity of arr is increased if needed. */ -void ccCArrayAppendValueWithResize(ccCArray *arr, CCARRAY_ID value); - -/** Appends values from plusArr to arr. Behaviour undefined if arr doesn't have - enough capacity. */ -void ccCArrayAppendArray(ccCArray *arr, ccCArray *plusArr); - -/** Appends values from plusArr to arr. Capacity of arr is increased if needed. */ -void ccCArrayAppendArrayWithResize(ccCArray *arr, ccCArray *plusArr); - -/** Removes all values from arr */ -void ccCArrayRemoveAllValues(ccCArray *arr); - -/** Removes value at specified index and pushes back all subsequent values. - Behaviour undefined if index outside [0, num-1]. - @since v0.99.4 - */ -void ccCArrayRemoveValueAtIndex(ccCArray *arr, NSUInteger index); - -/** Removes value at specified index and fills the gap with the last value, - thereby avoiding the need to push back subsequent values. - Behaviour undefined if index outside [0, num-1]. - @since v0.99.4 - */ -void ccCArrayFastRemoveValueAtIndex(ccCArray *arr, NSUInteger index); - -/** Searches for the first occurance of value and removes it. If value is not found the function has no effect. - @since v0.99.4 - */ -void ccCArrayRemoveValue(ccCArray *arr, CCARRAY_ID value); - -/** Removes from arr all values in minusArr. For each Value in minusArr, the first matching instance in arr will be removed. - @since v0.99.4 - */ -void ccCArrayRemoveArray(ccCArray *arr, ccCArray *minusArr); - -/** Removes from arr all values in minusArr. For each value in minusArr, all matching instances in arr will be removed. - @since v0.99.4 - */ -void ccCArrayFullRemoveArray(ccCArray *arr, ccCArray *minusArr); - -// iterative mergesort arrd on -// http://www.inf.fh-flensburg.de/lang/algorithmen/sortieren/merge/mergiter.htm -int cc_mergesortL(ccCArray* array, size_t width, cc_comparator comparator); - -void cc_insertionSort(ccCArray* arr, cc_comparator comparator); - -void cc_pointerswap(void* a, void* b, size_t width); - -#ifdef __cplusplus -} -#endif - - -#endif // CC_ARRAY_H diff --git a/include/cocos2d/Support/uthash.h b/include/cocos2d/Support/uthash.h index e190ef7..92635f5 100644 --- a/include/cocos2d/Support/uthash.h +++ b/include/cocos2d/Support/uthash.h @@ -1,5 +1,5 @@ /* -Copyright (c) 2003-2010, Troy D. Hanson http://uthash.sourceforge.net +Copyright (c) 2003-2013, Troy D. Hanson http://uthash.sourceforge.net All rights reserved. Redistribution and use in source and binary forms, with or without @@ -22,10 +22,11 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef UTHASH_H -#define UTHASH_H +#define UTHASH_H #include /* memcmp,strlen */ #include /* ptrdiff_t */ +#include /* exit() */ /* These macros use decltype or the earlier __typeof GNU extension. As decltype is only available in newer compilers (VS2010 or gcc 4.3+ @@ -48,7 +49,7 @@ do { char **_da_dst = (char**)(&(dst)); \ *_da_dst = (char*)(src); \ } while(0) -#else +#else #define DECLTYPE_ASSIGN(dst,src) \ do { \ (dst) = DECLTYPE(dst)(src); \ @@ -58,18 +59,29 @@ do { /* a number of the hash function use uint32_t which isn't defined on win32 */ #ifdef _MSC_VER typedef unsigned int uint32_t; +typedef unsigned char uint8_t; #else #include /* uint32_t */ #endif -#define UTHASH_VERSION 1.9.3 +#define UTHASH_VERSION 1.9.7 +#ifndef uthash_fatal #define uthash_fatal(msg) exit(-1) /* fatal error (out of memory,etc) */ +#endif +#ifndef uthash_malloc #define uthash_malloc(sz) malloc(sz) /* malloc fcn */ +#endif +#ifndef uthash_free #define uthash_free(ptr,sz) free(ptr) /* free fcn */ +#endif +#ifndef uthash_noexpand_fyi #define uthash_noexpand_fyi(tbl) /* can be defined to log noexpand */ +#endif +#ifndef uthash_expand_fyi #define uthash_expand_fyi(tbl) /* can be defined to log expands */ +#endif /* initial number of buckets */ #define HASH_INITIAL_NUM_BUCKETS 32 /* initial number of buckets */ @@ -102,12 +114,12 @@ do { if (!((tbl)->bloom_bv)) { uthash_fatal( "out of memory"); } \ memset((tbl)->bloom_bv, 0, HASH_BLOOM_BYTELEN); \ (tbl)->bloom_sig = HASH_BLOOM_SIGNATURE; \ -} while (0); +} while (0) #define HASH_BLOOM_FREE(tbl) \ do { \ uthash_free((tbl)->bloom_bv, HASH_BLOOM_BYTELEN); \ -} while (0); +} while (0) #define HASH_BLOOM_BITSET(bv,idx) (bv[(idx)/8] |= (1U << ((idx)%8))) #define HASH_BLOOM_BITTEST(bv,idx) (bv[(idx)/8] & (1U << ((idx)%8))) @@ -119,9 +131,9 @@ do { HASH_BLOOM_BITTEST((tbl)->bloom_bv, (hashv & (uint32_t)((1ULL << (tbl)->bloom_nbits) - 1))) #else -#define HASH_BLOOM_MAKE(tbl) -#define HASH_BLOOM_FREE(tbl) -#define HASH_BLOOM_ADD(tbl,hashv) +#define HASH_BLOOM_MAKE(tbl) +#define HASH_BLOOM_FREE(tbl) +#define HASH_BLOOM_ADD(tbl,hashv) #define HASH_BLOOM_TEST(tbl,hashv) (1) #endif @@ -145,14 +157,14 @@ do { } while(0) #define HASH_ADD(hh,head,fieldname,keylen_in,add) \ - HASH_ADD_KEYPTR(hh,head,&add->fieldname,keylen_in,add) - + HASH_ADD_KEYPTR(hh,head,(void*)(&((add)->fieldname)),keylen_in,add) + #define HASH_ADD_KEYPTR(hh,head,keyptr,keylen_in,add) \ do { \ unsigned _ha_bkt; \ (add)->hh.next = NULL; \ (add)->hh.key = (char*)keyptr; \ - (add)->hh.keylen = keylen_in; \ + (add)->hh.keylen = (unsigned)keylen_in; \ if (!(head)) { \ head = (add); \ (head)->hh.prev = NULL; \ @@ -203,17 +215,17 @@ do { _hd_hh_del = &((delptr)->hh); \ if ((delptr) == ELMT_FROM_HH((head)->hh.tbl,(head)->hh.tbl->tail)) { \ (head)->hh.tbl->tail = \ - (UT_hash_handle*)((char*)((delptr)->hh.prev) + \ + (UT_hash_handle*)((ptrdiff_t)((delptr)->hh.prev) + \ (head)->hh.tbl->hho); \ } \ if ((delptr)->hh.prev) { \ - ((UT_hash_handle*)((char*)((delptr)->hh.prev) + \ + ((UT_hash_handle*)((ptrdiff_t)((delptr)->hh.prev) + \ (head)->hh.tbl->hho))->next = (delptr)->hh.next; \ } else { \ DECLTYPE_ASSIGN(head,(delptr)->hh.next); \ } \ if (_hd_hh_del->next) { \ - ((UT_hash_handle*)((char*)_hd_hh_del->next + \ + ((UT_hash_handle*)((ptrdiff_t)_hd_hh_del->next + \ (head)->hh.tbl->hho))->prev = \ _hd_hh_del->prev; \ } \ @@ -298,10 +310,10 @@ do { } \ } while (0) #else -#define HASH_FSCK(hh,head) +#define HASH_FSCK(hh,head) #endif -/* When compiled with -DHASH_EMIT_KEYS, length-prefixed keys are emitted to +/* When compiled with -DHASH_EMIT_KEYS, length-prefixed keys are emitted to * the descriptor to which this macro is defined for tuning the hash function. * The app can #include to get the prototype for write(2). */ #ifdef HASH_EMIT_KEYS @@ -311,12 +323,12 @@ do { write(HASH_EMIT_KEYS, &_klen, sizeof(_klen)); \ write(HASH_EMIT_KEYS, keyptr, fieldlen); \ } while (0) -#else -#define HASH_EMIT_KEY(hh,head,keyptr,fieldlen) +#else +#define HASH_EMIT_KEY(hh,head,keyptr,fieldlen) #endif /* default to Jenkin's hash unless overridden e.g. DHASH_FUNCTION=HASH_SAX */ -#ifdef HASH_FUNCTION +#ifdef HASH_FUNCTION #define HASH_FCN HASH_FUNCTION #else #define HASH_FCN HASH_JEN @@ -333,7 +345,7 @@ do { } while (0) -/* SAX/FNV/OAT/JEN hash functions are macro variants of those listed at +/* SAX/FNV/OAT/JEN hash functions are macro variants of those listed at * http://eternallyconfuzzled.com/tuts/algorithms/jsw_tut_hashing.aspx */ #define HASH_SAX(key,keylen,num_bkts,hashv,bkt) \ do { \ @@ -353,8 +365,8 @@ do { for(_fn_i=0; _fn_i < keylen; _fn_i++) \ hashv = (hashv * 16777619) ^ _hf_key[_fn_i]; \ bkt = hashv & (num_bkts-1); \ -} while(0); - +} while(0) + #define HASH_OAT(key,keylen,num_bkts,hashv,bkt) \ do { \ unsigned _ho_i; \ @@ -390,7 +402,7 @@ do { char *_hj_key=(char*)(key); \ hashv = 0xfeedbeef; \ _hj_i = _hj_j = 0x9e3779b9; \ - _hj_k = keylen; \ + _hj_k = (unsigned)keylen; \ while (_hj_k >= 12) { \ _hj_i += (_hj_key[0] + ( (unsigned)_hj_key[1] << 8 ) \ + ( (unsigned)_hj_key[2] << 16 ) \ @@ -478,159 +490,91 @@ do { hashv ^= hashv << 25; \ hashv += hashv >> 6; \ bkt = hashv & (num_bkts-1); \ -} while(0); +} while(0) #ifdef HASH_USING_NO_STRICT_ALIASING -/* The MurmurHash exploits some CPU's (e.g. x86) tolerance for unaligned reads. +/* The MurmurHash exploits some CPU's (x86,x86_64) tolerance for unaligned reads. * For other types of CPU's (e.g. Sparc) an unaligned read causes a bus error. - * So MurmurHash comes in two versions, the faster unaligned one and the slower - * aligned one. We only use the faster one on CPU's where we know it's safe. + * MurmurHash uses the faster approach only on CPU's where we know it's safe. * * Note the preprocessor built-in defines can be emitted using: * * gcc -m64 -dM -E - < /dev/null (on gcc) * cc -## a.c (where a.c is a simple test file) (Sun Studio) */ -#if (defined(__i386__) || defined(__x86_64__)) -#define HASH_MUR HASH_MUR_UNALIGNED -#else -#define HASH_MUR HASH_MUR_ALIGNED +#if (defined(__i386__) || defined(__x86_64__) || defined(_M_IX86)) +#define MUR_GETBLOCK(p,i) p[i] +#else /* non intel */ +#define MUR_PLUS0_ALIGNED(p) (((unsigned long)p & 0x3) == 0) +#define MUR_PLUS1_ALIGNED(p) (((unsigned long)p & 0x3) == 1) +#define MUR_PLUS2_ALIGNED(p) (((unsigned long)p & 0x3) == 2) +#define MUR_PLUS3_ALIGNED(p) (((unsigned long)p & 0x3) == 3) +#define WP(p) ((uint32_t*)((unsigned long)(p) & ~3UL)) +#if (defined(__BIG_ENDIAN__) || defined(SPARC) || defined(__ppc__) || defined(__ppc64__)) +#define MUR_THREE_ONE(p) ((((*WP(p))&0x00ffffff) << 8) | (((*(WP(p)+1))&0xff000000) >> 24)) +#define MUR_TWO_TWO(p) ((((*WP(p))&0x0000ffff) <<16) | (((*(WP(p)+1))&0xffff0000) >> 16)) +#define MUR_ONE_THREE(p) ((((*WP(p))&0x000000ff) <<24) | (((*(WP(p)+1))&0xffffff00) >> 8)) +#else /* assume little endian non-intel */ +#define MUR_THREE_ONE(p) ((((*WP(p))&0xffffff00) >> 8) | (((*(WP(p)+1))&0x000000ff) << 24)) +#define MUR_TWO_TWO(p) ((((*WP(p))&0xffff0000) >>16) | (((*(WP(p)+1))&0x0000ffff) << 16)) +#define MUR_ONE_THREE(p) ((((*WP(p))&0xff000000) >>24) | (((*(WP(p)+1))&0x00ffffff) << 8)) #endif - -/* Appleby's MurmurHash fast version for unaligned-tolerant archs like i386 */ -#define HASH_MUR_UNALIGNED(key,keylen,num_bkts,hashv,bkt) \ -do { \ - const unsigned int _mur_m = 0x5bd1e995; \ - const int _mur_r = 24; \ - hashv = 0xcafebabe ^ keylen; \ - char *_mur_key = (char *)(key); \ - uint32_t _mur_tmp, _mur_len = keylen; \ - \ - for (;_mur_len >= 4; _mur_len-=4) { \ - _mur_tmp = *(uint32_t *)_mur_key; \ - _mur_tmp *= _mur_m; \ - _mur_tmp ^= _mur_tmp >> _mur_r; \ - _mur_tmp *= _mur_m; \ - hashv *= _mur_m; \ - hashv ^= _mur_tmp; \ - _mur_key += 4; \ - } \ - \ - switch(_mur_len) \ - { \ - case 3: hashv ^= _mur_key[2] << 16; \ - case 2: hashv ^= _mur_key[1] << 8; \ - case 1: hashv ^= _mur_key[0]; \ - hashv *= _mur_m; \ - }; \ - \ - hashv ^= hashv >> 13; \ - hashv *= _mur_m; \ - hashv ^= hashv >> 15; \ - \ - bkt = hashv & (num_bkts-1); \ +#define MUR_GETBLOCK(p,i) (MUR_PLUS0_ALIGNED(p) ? ((p)[i]) : \ + (MUR_PLUS1_ALIGNED(p) ? MUR_THREE_ONE(p) : \ + (MUR_PLUS2_ALIGNED(p) ? MUR_TWO_TWO(p) : \ + MUR_ONE_THREE(p)))) +#endif +#define MUR_ROTL32(x,r) (((x) << (r)) | ((x) >> (32 - (r)))) +#define MUR_FMIX(_h) \ +do { \ + _h ^= _h >> 16; \ + _h *= 0x85ebca6b; \ + _h ^= _h >> 13; \ + _h *= 0xc2b2ae35l; \ + _h ^= _h >> 16; \ } while(0) -/* Appleby's MurmurHash version for alignment-sensitive archs like Sparc */ -#define HASH_MUR_ALIGNED(key,keylen,num_bkts,hashv,bkt) \ -do { \ - const unsigned int _mur_m = 0x5bd1e995; \ - const int _mur_r = 24; \ - hashv = 0xcafebabe ^ (keylen); \ - char *_mur_key = (char *)(key); \ - uint32_t _mur_len = keylen; \ - int _mur_align = (int)_mur_key & 3; \ - \ - if (_mur_align && (_mur_len >= 4)) { \ - unsigned _mur_t = 0, _mur_d = 0; \ - switch(_mur_align) { \ - case 1: _mur_t |= _mur_key[2] << 16; \ - case 2: _mur_t |= _mur_key[1] << 8; \ - case 3: _mur_t |= _mur_key[0]; \ - } \ - _mur_t <<= (8 * _mur_align); \ - _mur_key += 4-_mur_align; \ - _mur_len -= 4-_mur_align; \ - int _mur_sl = 8 * (4-_mur_align); \ - int _mur_sr = 8 * _mur_align; \ - \ - for (;_mur_len >= 4; _mur_len-=4) { \ - _mur_d = *(unsigned *)_mur_key; \ - _mur_t = (_mur_t >> _mur_sr) | (_mur_d << _mur_sl); \ - unsigned _mur_k = _mur_t; \ - _mur_k *= _mur_m; \ - _mur_k ^= _mur_k >> _mur_r; \ - _mur_k *= _mur_m; \ - hashv *= _mur_m; \ - hashv ^= _mur_k; \ - _mur_t = _mur_d; \ - _mur_key += 4; \ - } \ - _mur_d = 0; \ - if(_mur_len >= _mur_align) { \ - switch(_mur_align) { \ - case 3: _mur_d |= _mur_key[2] << 16; \ - case 2: _mur_d |= _mur_key[1] << 8; \ - case 1: _mur_d |= _mur_key[0]; \ - } \ - unsigned _mur_k = (_mur_t >> _mur_sr) | (_mur_d << _mur_sl); \ - _mur_k *= _mur_m; \ - _mur_k ^= _mur_k >> _mur_r; \ - _mur_k *= _mur_m; \ - hashv *= _mur_m; \ - hashv ^= _mur_k; \ - _mur_k += _mur_align; \ - _mur_len -= _mur_align; \ - \ - switch(_mur_len) \ - { \ - case 3: hashv ^= _mur_key[2] << 16; \ - case 2: hashv ^= _mur_key[1] << 8; \ - case 1: hashv ^= _mur_key[0]; \ - hashv *= _mur_m; \ - } \ - } else { \ - switch(_mur_len) \ - { \ - case 3: _mur_d ^= _mur_key[2] << 16; \ - case 2: _mur_d ^= _mur_key[1] << 8; \ - case 1: _mur_d ^= _mur_key[0]; \ - case 0: hashv ^= (_mur_t >> _mur_sr) | (_mur_d << _mur_sl); \ - hashv *= _mur_m; \ - } \ - } \ - \ - hashv ^= hashv >> 13; \ - hashv *= _mur_m; \ - hashv ^= hashv >> 15; \ - } else { \ - for (;_mur_len >= 4; _mur_len-=4) { \ - unsigned _mur_k = *(unsigned*)_mur_key; \ - _mur_k *= _mur_m; \ - _mur_k ^= _mur_k >> _mur_r; \ - _mur_k *= _mur_m; \ - hashv *= _mur_m; \ - hashv ^= _mur_k; \ - _mur_key += 4; \ - } \ - switch(_mur_len) \ - { \ - case 3: hashv ^= _mur_key[2] << 16; \ - case 2: hashv ^= _mur_key[1] << 8; \ - case 1: hashv ^= _mur_key[0]; \ - hashv *= _mur_m; \ - } \ - \ - hashv ^= hashv >> 13; \ - hashv *= _mur_m; \ - hashv ^= hashv >> 15; \ - } \ - bkt = hashv & (num_bkts-1); \ +#define HASH_MUR(key,keylen,num_bkts,hashv,bkt) \ +do { \ + const uint8_t *_mur_data = (const uint8_t*)(key); \ + const int _mur_nblocks = (keylen) / 4; \ + uint32_t _mur_h1 = 0xf88D5353; \ + uint32_t _mur_c1 = 0xcc9e2d51; \ + uint32_t _mur_c2 = 0x1b873593; \ + uint32_t _mur_k1 = 0; \ + const uint8_t *_mur_tail; \ + const uint32_t *_mur_blocks = (const uint32_t*)(_mur_data+_mur_nblocks*4); \ + int _mur_i; \ + for(_mur_i = -_mur_nblocks; _mur_i; _mur_i++) { \ + _mur_k1 = MUR_GETBLOCK(_mur_blocks,_mur_i); \ + _mur_k1 *= _mur_c1; \ + _mur_k1 = MUR_ROTL32(_mur_k1,15); \ + _mur_k1 *= _mur_c2; \ + \ + _mur_h1 ^= _mur_k1; \ + _mur_h1 = MUR_ROTL32(_mur_h1,13); \ + _mur_h1 = _mur_h1*5+0xe6546b64; \ + } \ + _mur_tail = (const uint8_t*)(_mur_data + _mur_nblocks*4); \ + _mur_k1=0; \ + switch((keylen) & 3) { \ + case 3: _mur_k1 ^= _mur_tail[2] << 16; \ + case 2: _mur_k1 ^= _mur_tail[1] << 8; \ + case 1: _mur_k1 ^= _mur_tail[0]; \ + _mur_k1 *= _mur_c1; \ + _mur_k1 = MUR_ROTL32(_mur_k1,15); \ + _mur_k1 *= _mur_c2; \ + _mur_h1 ^= _mur_k1; \ + } \ + _mur_h1 ^= (keylen); \ + MUR_FMIX(_mur_h1); \ + hashv = _mur_h1; \ + bkt = hashv & (num_bkts-1); \ } while(0) #endif /* HASH_USING_NO_STRICT_ALIASING */ /* key comparison function; return 0 if keys equal */ -#define HASH_KEYCMP(a,b,len) memcmp(a,b,len) +#define HASH_KEYCMP(a,b,len) memcmp(a,b,len) /* iterate over items in a known bucket to find desired item */ #define HASH_FIND_IN_BKT(tbl,hh,head,keyptr,keylen_in,out) \ @@ -638,10 +582,10 @@ do { if (head.hh_head) DECLTYPE_ASSIGN(out,ELMT_FROM_HH(tbl,head.hh_head)); \ else out=NULL; \ while (out) { \ - if (out->hh.keylen == keylen_in) { \ - if ((HASH_KEYCMP(out->hh.key,keyptr,keylen_in)) == 0) break; \ + if ((out)->hh.keylen == keylen_in) { \ + if ((HASH_KEYCMP((out)->hh.key,keyptr,keylen_in)) == 0) break; \ } \ - if (out->hh.hh_next) DECLTYPE_ASSIGN(out,ELMT_FROM_HH(tbl,out->hh.hh_next)); \ + if ((out)->hh.hh_next) DECLTYPE_ASSIGN(out,ELMT_FROM_HH(tbl,(out)->hh.hh_next)); \ else out = NULL; \ } \ } while(0) @@ -671,36 +615,36 @@ do { } \ if (hh_del->hh_next) { \ hh_del->hh_next->hh_prev = hh_del->hh_prev; \ - } + } /* Bucket expansion has the effect of doubling the number of buckets * and redistributing the items into the new buckets. Ideally the * items will distribute more or less evenly into the new buckets * (the extent to which this is true is a measure of the quality of - * the hash function as it applies to the key domain). - * + * the hash function as it applies to the key domain). + * * With the items distributed into more buckets, the chain length * (item count) in each bucket is reduced. Thus by expanding buckets - * the hash keeps a bound on the chain length. This bounded chain + * the hash keeps a bound on the chain length. This bounded chain * length is the essence of how a hash provides constant time lookup. - * + * * The calculation of tbl->ideal_chain_maxlen below deserves some * explanation. First, keep in mind that we're calculating the ideal * maximum chain length based on the *new* (doubled) bucket count. * In fractions this is just n/b (n=number of items,b=new num buckets). - * Since the ideal chain length is an integer, we want to calculate + * Since the ideal chain length is an integer, we want to calculate * ceil(n/b). We don't depend on floating point arithmetic in this * hash, so to calculate ceil(n/b) with integers we could write - * + * * ceil(n/b) = (n/b) + ((n%b)?1:0) - * + * * and in fact a previous version of this hash did just that. * But now we have improved things a bit by recognizing that b is * always a power of two. We keep its base 2 log handy (call it lb), * so now we can write this with a bit shift and logical AND: - * + * * ceil(n/b) = (n>>lb) + ( (n & (b-1)) ? 1:0) - * + * */ #define HASH_EXPAND_BUCKETS(tbl) \ do { \ @@ -752,7 +696,7 @@ do { /* This is an adaptation of Simon Tatham's O(n log(n)) mergesort */ -/* Note that HASH_SORT assumes the hash handle name to be hh. +/* Note that HASH_SORT assumes the hash handle name to be hh. * HASH_SRT was added to allow the hash handle name to be passed in. */ #define HASH_SORT(head,cmpfcn) HASH_SRT(hh,head,cmpfcn) #define HASH_SRT(hh,head,cmpfcn) \ @@ -834,10 +778,10 @@ do { } \ } while (0) -/* This function selects items from one hash into another hash. - * The end result is that the selected items have dual presence - * in both hashes. There is no copy of the items made; rather - * they are added into the new hash through a secondary hash +/* This function selects items from one hash into another hash. + * The end result is that the selected items have dual presence + * in both hashes. There is no copy of the items made; rather + * they are added into the new hash through a secondary hash * hash handle that must be present in the structure. */ #define HASH_SELECT(hh_dst, dst, hh_src, src, cond) \ do { \ @@ -882,6 +826,7 @@ do { if (head) { \ uthash_free((head)->hh.tbl->buckets, \ (head)->hh.tbl->num_buckets*sizeof(struct UT_hash_bucket)); \ + HASH_BLOOM_FREE((head)->hh.tbl); \ uthash_free((head)->hh.tbl, sizeof(UT_hash_table)); \ (head)=NULL; \ } \ @@ -890,7 +835,7 @@ do { #ifdef NO_DECLTYPE #define HASH_ITER(hh,head,el,tmp) \ for((el)=(head), (*(char**)(&(tmp)))=(char*)((head)?(head)->hh.next:NULL); \ - el; (el)=(tmp),(*(char**)(&(tmp)))=(char*)((tmp)?(tmp)->hh.next:NULL)) + el; (el)=(tmp),(*(char**)(&(tmp)))=(char*)((tmp)?(tmp)->hh.next:NULL)) #else #define HASH_ITER(hh,head,el,tmp) \ for((el)=(head),(tmp)=DECLTYPE(el)((head)?(head)->hh.next:NULL); \ @@ -898,7 +843,7 @@ for((el)=(head),(tmp)=DECLTYPE(el)((head)?(head)->hh.next:NULL); #endif /* obtain a count of items in the hash */ -#define HASH_COUNT(head) HASH_CNT(hh,head) +#define HASH_COUNT(head) HASH_CNT(hh,head) #define HASH_CNT(hh,head) ((head)?((head)->hh.tbl->num_items):0) typedef struct UT_hash_bucket { @@ -907,7 +852,7 @@ typedef struct UT_hash_bucket { /* expand_mult is normally set to 0. In this situation, the max chain length * threshold is enforced at its default value, HASH_BKT_CAPACITY_THRESH. (If - * the bucket's chain exceeds this length, bucket expansion is triggered). + * the bucket's chain exceeds this length, bucket expansion is triggered). * However, setting expand_mult to a non-zero value delays bucket expansion * (that would be triggered by additions to this particular bucket) * until its chain length reaches a *multiple* of HASH_BKT_CAPACITY_THRESH. @@ -915,7 +860,7 @@ typedef struct UT_hash_bucket { * multiplier is to reduce bucket expansions, since they are expensive, in * situations where we know that a particular bucket tends to be overused. * It is better to let its chain length grow to a longer yet-still-bounded - * value, than to do an O(n) bucket expansion too often. + * value, than to do an O(n) bucket expansion too often. */ unsigned expand_mult; @@ -941,7 +886,7 @@ typedef struct UT_hash_table { * hash distribution; reaching them in a chain traversal takes >ideal steps */ unsigned nonideal_items; - /* ineffective expands occur when a bucket doubling was performed, but + /* ineffective expands occur when a bucket doubling was performed, but * afterward, more than half the items in the hash had nonideal chain * positions. If this happens on two consecutive expansions we inhibit any * further expansion, as it's not helping; this happens when the hash diff --git a/include/cocos2d/Support/utlist.h b/include/cocos2d/Support/utlist.h index b160f1a..58bfcbc 100644 --- a/include/cocos2d/Support/utlist.h +++ b/include/cocos2d/Support/utlist.h @@ -1,5 +1,5 @@ /* -Copyright (c) 2007-2010, Troy D. Hanson http://uthash.sourceforge.net +Copyright (c) 2007-2013, Troy D. Hanson http://uthash.sourceforge.net All rights reserved. Redistribution and use in source and binary forms, with or without @@ -24,9 +24,11 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef UTLIST_H #define UTLIST_H -#define UTLIST_VERSION 1.9.1 +#define UTLIST_VERSION 1.9.7 -/* +#include + +/* * This file contains macros to manipulate singly and doubly-linked lists. * * 1. LL_ macros: singly-linked lists. @@ -36,7 +38,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * To use singly-linked lists, your structure must have a "next" pointer. * To use doubly-linked lists, your structure must "prev" and "next" pointers. * Either way, the pointer to the head of the list must be initialized to NULL. - * + * * ----------------.EXAMPLE ------------------------- * struct item { * int id; @@ -77,18 +79,18 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * to dereference its prev/next pointers, and save/restore the real head.*/ #ifdef NO_DECLTYPE #define _SV(elt,list) _tmp = (char*)(list); {char **_alias = (char**)&(list); *_alias = (elt); } -#define _NEXT(elt,list) ((char*)((list)->next)) -#define _NEXTASGN(elt,list,to) { char **_alias = (char**)&((list)->next); *_alias=(char*)(to); } -#define _PREV(elt,list) ((char*)((list)->prev)) -#define _PREVASGN(elt,list,to) { char **_alias = (char**)&((list)->prev); *_alias=(char*)(to); } +#define _NEXT(elt,list,next) ((char*)((list)->next)) +#define _NEXTASGN(elt,list,to,next) { char **_alias = (char**)&((list)->next); *_alias=(char*)(to); } +/* #define _PREV(elt,list,prev) ((char*)((list)->prev)) */ +#define _PREVASGN(elt,list,to,prev) { char **_alias = (char**)&((list)->prev); *_alias=(char*)(to); } #define _RS(list) { char **_alias = (char**)&(list); *_alias=_tmp; } #define _CASTASGN(a,b) { char **_alias = (char**)&(a); *_alias=(char*)(b); } -#else +#else #define _SV(elt,list) -#define _NEXT(elt,list) ((elt)->next) -#define _NEXTASGN(elt,list,to) ((elt)->next)=(to) -#define _PREV(elt,list) ((elt)->prev) -#define _PREVASGN(elt,list,to) ((elt)->prev)=(to) +#define _NEXT(elt,list,next) ((elt)->next) +#define _NEXTASGN(elt,list,to,next) ((elt)->next)=(to) +/* #define _PREV(elt,list,prev) ((elt)->prev) */ +#define _PREVASGN(elt,list,to,prev) ((elt)->prev)=(to) #define _RS(list) #define _CASTASGN(a,b) (a)=(b) #endif @@ -98,6 +100,9 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * Unwieldy variable names used here to avoid shadowing passed-in variables. * *****************************************************************************/ #define LL_SORT(list, cmp) \ + LL_SORT2(list, cmp, next) + +#define LL_SORT2(list, cmp, next) \ do { \ LDECLTYPE(list) _ls_p; \ LDECLTYPE(list) _ls_q; \ @@ -121,22 +126,26 @@ do { _ls_psize = 0; \ for (_ls_i = 0; _ls_i < _ls_insize; _ls_i++) { \ _ls_psize++; \ - _SV(_ls_q,list); _ls_q = _NEXT(_ls_q,list); _RS(list); \ + _SV(_ls_q,list); _ls_q = _NEXT(_ls_q,list,next); _RS(list); \ if (!_ls_q) break; \ } \ _ls_qsize = _ls_insize; \ while (_ls_psize > 0 || (_ls_qsize > 0 && _ls_q)) { \ if (_ls_psize == 0) { \ - _ls_e = _ls_q; _SV(_ls_q,list); _ls_q = _NEXT(_ls_q,list); _RS(list); _ls_qsize--; \ + _ls_e = _ls_q; _SV(_ls_q,list); _ls_q = \ + _NEXT(_ls_q,list,next); _RS(list); _ls_qsize--; \ } else if (_ls_qsize == 0 || !_ls_q) { \ - _ls_e = _ls_p; _SV(_ls_p,list); _ls_p = _NEXT(_ls_p,list); _RS(list); _ls_psize--; \ + _ls_e = _ls_p; _SV(_ls_p,list); _ls_p = \ + _NEXT(_ls_p,list,next); _RS(list); _ls_psize--; \ } else if (cmp(_ls_p,_ls_q) <= 0) { \ - _ls_e = _ls_p; _SV(_ls_p,list); _ls_p = _NEXT(_ls_p,list); _RS(list); _ls_psize--; \ + _ls_e = _ls_p; _SV(_ls_p,list); _ls_p = \ + _NEXT(_ls_p,list,next); _RS(list); _ls_psize--; \ } else { \ - _ls_e = _ls_q; _SV(_ls_q,list); _ls_q = _NEXT(_ls_q,list); _RS(list); _ls_qsize--; \ + _ls_e = _ls_q; _SV(_ls_q,list); _ls_q = \ + _NEXT(_ls_q,list,next); _RS(list); _ls_qsize--; \ } \ if (_ls_tail) { \ - _SV(_ls_tail,list); _NEXTASGN(_ls_tail,list,_ls_e); _RS(list); \ + _SV(_ls_tail,list); _NEXTASGN(_ls_tail,list,_ls_e,next); _RS(list); \ } else { \ _CASTASGN(list,_ls_e); \ } \ @@ -144,7 +153,7 @@ do { } \ _ls_p = _ls_q; \ } \ - _SV(_ls_tail,list); _NEXTASGN(_ls_tail,list,NULL); _RS(list); \ + _SV(_ls_tail,list); _NEXTASGN(_ls_tail,list,NULL,next); _RS(list); \ if (_ls_nmerges <= 1) { \ _ls_looping=0; \ } \ @@ -153,7 +162,11 @@ do { } else _tmp=NULL; /* quiet gcc unused variable warning */ \ } while (0) + #define DL_SORT(list, cmp) \ + DL_SORT2(list, cmp, prev, next) + +#define DL_SORT2(list, cmp, prev, next) \ do { \ LDECLTYPE(list) _ls_p; \ LDECLTYPE(list) _ls_q; \ @@ -177,32 +190,36 @@ do { _ls_psize = 0; \ for (_ls_i = 0; _ls_i < _ls_insize; _ls_i++) { \ _ls_psize++; \ - _SV(_ls_q,list); _ls_q = _NEXT(_ls_q,list); _RS(list); \ + _SV(_ls_q,list); _ls_q = _NEXT(_ls_q,list,next); _RS(list); \ if (!_ls_q) break; \ } \ _ls_qsize = _ls_insize; \ while (_ls_psize > 0 || (_ls_qsize > 0 && _ls_q)) { \ if (_ls_psize == 0) { \ - _ls_e = _ls_q; _SV(_ls_q,list); _ls_q = _NEXT(_ls_q,list); _RS(list); _ls_qsize--; \ + _ls_e = _ls_q; _SV(_ls_q,list); _ls_q = \ + _NEXT(_ls_q,list,next); _RS(list); _ls_qsize--; \ } else if (_ls_qsize == 0 || !_ls_q) { \ - _ls_e = _ls_p; _SV(_ls_p,list); _ls_p = _NEXT(_ls_p,list); _RS(list); _ls_psize--; \ + _ls_e = _ls_p; _SV(_ls_p,list); _ls_p = \ + _NEXT(_ls_p,list,next); _RS(list); _ls_psize--; \ } else if (cmp(_ls_p,_ls_q) <= 0) { \ - _ls_e = _ls_p; _SV(_ls_p,list); _ls_p = _NEXT(_ls_p,list); _RS(list); _ls_psize--; \ + _ls_e = _ls_p; _SV(_ls_p,list); _ls_p = \ + _NEXT(_ls_p,list,next); _RS(list); _ls_psize--; \ } else { \ - _ls_e = _ls_q; _SV(_ls_q,list); _ls_q = _NEXT(_ls_q,list); _RS(list); _ls_qsize--; \ + _ls_e = _ls_q; _SV(_ls_q,list); _ls_q = \ + _NEXT(_ls_q,list,next); _RS(list); _ls_qsize--; \ } \ if (_ls_tail) { \ - _SV(_ls_tail,list); _NEXTASGN(_ls_tail,list,_ls_e); _RS(list); \ + _SV(_ls_tail,list); _NEXTASGN(_ls_tail,list,_ls_e,next); _RS(list); \ } else { \ _CASTASGN(list,_ls_e); \ } \ - _SV(_ls_e,list); _PREVASGN(_ls_e,list,_ls_tail); _RS(list); \ + _SV(_ls_e,list); _PREVASGN(_ls_e,list,_ls_tail,prev); _RS(list); \ _ls_tail = _ls_e; \ } \ _ls_p = _ls_q; \ } \ _CASTASGN(list->prev, _ls_tail); \ - _SV(_ls_tail,list); _NEXTASGN(_ls_tail,list,NULL); _RS(list); \ + _SV(_ls_tail,list); _NEXTASGN(_ls_tail,list,NULL,next); _RS(list); \ if (_ls_nmerges <= 1) { \ _ls_looping=0; \ } \ @@ -212,6 +229,9 @@ do { } while (0) #define CDL_SORT(list, cmp) \ + CDL_SORT2(list, cmp, prev, next) + +#define CDL_SORT2(list, cmp, prev, next) \ do { \ LDECLTYPE(list) _ls_p; \ LDECLTYPE(list) _ls_q; \ @@ -237,10 +257,10 @@ do { for (_ls_i = 0; _ls_i < _ls_insize; _ls_i++) { \ _ls_psize++; \ _SV(_ls_q,list); \ - if (_NEXT(_ls_q,list) == _ls_oldhead) { \ + if (_NEXT(_ls_q,list,next) == _ls_oldhead) { \ _ls_q = NULL; \ } else { \ - _ls_q = _NEXT(_ls_q,list); \ + _ls_q = _NEXT(_ls_q,list,next); \ } \ _RS(list); \ if (!_ls_q) break; \ @@ -248,31 +268,35 @@ do { _ls_qsize = _ls_insize; \ while (_ls_psize > 0 || (_ls_qsize > 0 && _ls_q)) { \ if (_ls_psize == 0) { \ - _ls_e = _ls_q; _SV(_ls_q,list); _ls_q = _NEXT(_ls_q,list); _RS(list); _ls_qsize--; \ + _ls_e = _ls_q; _SV(_ls_q,list); _ls_q = \ + _NEXT(_ls_q,list,next); _RS(list); _ls_qsize--; \ if (_ls_q == _ls_oldhead) { _ls_q = NULL; } \ } else if (_ls_qsize == 0 || !_ls_q) { \ - _ls_e = _ls_p; _SV(_ls_p,list); _ls_p = _NEXT(_ls_p,list); _RS(list); _ls_psize--; \ + _ls_e = _ls_p; _SV(_ls_p,list); _ls_p = \ + _NEXT(_ls_p,list,next); _RS(list); _ls_psize--; \ if (_ls_p == _ls_oldhead) { _ls_p = NULL; } \ } else if (cmp(_ls_p,_ls_q) <= 0) { \ - _ls_e = _ls_p; _SV(_ls_p,list); _ls_p = _NEXT(_ls_p,list); _RS(list); _ls_psize--; \ + _ls_e = _ls_p; _SV(_ls_p,list); _ls_p = \ + _NEXT(_ls_p,list,next); _RS(list); _ls_psize--; \ if (_ls_p == _ls_oldhead) { _ls_p = NULL; } \ } else { \ - _ls_e = _ls_q; _SV(_ls_q,list); _ls_q = _NEXT(_ls_q,list); _RS(list); _ls_qsize--; \ + _ls_e = _ls_q; _SV(_ls_q,list); _ls_q = \ + _NEXT(_ls_q,list,next); _RS(list); _ls_qsize--; \ if (_ls_q == _ls_oldhead) { _ls_q = NULL; } \ } \ if (_ls_tail) { \ - _SV(_ls_tail,list); _NEXTASGN(_ls_tail,list,_ls_e); _RS(list); \ + _SV(_ls_tail,list); _NEXTASGN(_ls_tail,list,_ls_e,next); _RS(list); \ } else { \ _CASTASGN(list,_ls_e); \ } \ - _SV(_ls_e,list); _PREVASGN(_ls_e,list,_ls_tail); _RS(list); \ + _SV(_ls_e,list); _PREVASGN(_ls_e,list,_ls_tail,prev); _RS(list); \ _ls_tail = _ls_e; \ } \ _ls_p = _ls_q; \ } \ _CASTASGN(list->prev,_ls_tail); \ _CASTASGN(_tmp2,list); \ - _SV(_ls_tail,list); _NEXTASGN(_ls_tail,list,_tmp2); _RS(list); \ + _SV(_ls_tail,list); _NEXTASGN(_ls_tail,list,_tmp2,next); _RS(list); \ if (_ls_nmerges <= 1) { \ _ls_looping=0; \ } \ @@ -285,12 +309,33 @@ do { * singly linked list macros (non-circular) * *****************************************************************************/ #define LL_PREPEND(head,add) \ + LL_PREPEND2(head,add,next) + +#define LL_PREPEND2(head,add,next) \ do { \ (add)->next = head; \ head = add; \ } while (0) +#define LL_CONCAT(head1,head2) \ + LL_CONCAT2(head1,head2,next) + +#define LL_CONCAT2(head1,head2,next) \ +do { \ + LDECLTYPE(head1) _tmp; \ + if (head1) { \ + _tmp = head1; \ + while (_tmp->next) { _tmp = _tmp->next; } \ + _tmp->next=(head2); \ + } else { \ + (head1)=(head2); \ + } \ +} while (0) + #define LL_APPEND(head,add) \ + LL_APPEND2(head,add,next) + +#define LL_APPEND2(head,add,next) \ do { \ LDECLTYPE(head) _tmp; \ (add)->next=NULL; \ @@ -304,6 +349,9 @@ do { } while (0) #define LL_DELETE(head,del) \ + LL_DELETE2(head,del,next) + +#define LL_DELETE2(head,del,next) \ do { \ LDECLTYPE(head) _tmp; \ if ((head) == (del)) { \ @@ -321,6 +369,9 @@ do { /* Here are VS2008 replacements for LL_APPEND and LL_DELETE */ #define LL_APPEND_VS2008(head,add) \ + LL_APPEND2_VS2008(head,add,next) + +#define LL_APPEND2_VS2008(head,add,next) \ do { \ if (head) { \ (add)->next = head; /* use add->next as a temp variable */ \ @@ -333,16 +384,19 @@ do { } while (0) #define LL_DELETE_VS2008(head,del) \ + LL_DELETE2_VS2008(head,del,next) + +#define LL_DELETE2_VS2008(head,del,next) \ do { \ if ((head) == (del)) { \ (head)=(head)->next; \ } else { \ char *_tmp = (char*)(head); \ - while (head->next && (head->next != (del))) { \ - head = head->next; \ + while ((head)->next && ((head)->next != (del))) { \ + head = (head)->next; \ } \ - if (head->next) { \ - head->next = ((del)->next); \ + if ((head)->next) { \ + (head)->next = ((del)->next); \ } \ { \ char **_head_alias = (char**)&(head); \ @@ -355,33 +409,95 @@ do { #define LL_APPEND LL_APPEND_VS2008 #undef LL_DELETE #define LL_DELETE LL_DELETE_VS2008 +#undef LL_DELETE2 +#define LL_DELETE2_VS2008 +#undef LL_APPEND2 +#define LL_APPEND2 LL_APPEND2_VS2008 +#undef LL_CONCAT /* no LL_CONCAT_VS2008 */ +#undef DL_CONCAT /* no DL_CONCAT_VS2008 */ #endif /* end VS2008 replacements */ #define LL_FOREACH(head,el) \ - for(el=head;el;el=el->next) + LL_FOREACH2(head,el,next) + +#define LL_FOREACH2(head,el,next) \ + for(el=head;el;el=(el)->next) #define LL_FOREACH_SAFE(head,el,tmp) \ + LL_FOREACH_SAFE2(head,el,tmp,next) + +#define LL_FOREACH_SAFE2(head,el,tmp,next) \ for((el)=(head);(el) && (tmp = (el)->next, 1); (el) = tmp) #define LL_SEARCH_SCALAR(head,out,field,val) \ + LL_SEARCH_SCALAR2(head,out,field,val,next) + +#define LL_SEARCH_SCALAR2(head,out,field,val,next) \ do { \ - LL_FOREACH(head,out) { \ + LL_FOREACH2(head,out,next) { \ if ((out)->field == (val)) break; \ } \ -} while(0) +} while(0) #define LL_SEARCH(head,out,elt,cmp) \ + LL_SEARCH2(head,out,elt,cmp,next) + +#define LL_SEARCH2(head,out,elt,cmp,next) \ do { \ - LL_FOREACH(head,out) { \ + LL_FOREACH2(head,out,next) { \ if ((cmp(out,elt))==0) break; \ } \ -} while(0) +} while(0) + +#define LL_REPLACE_ELEM(head, el, add) \ +do { \ + LDECLTYPE(head) _tmp; \ + assert(head != NULL); \ + assert(el != NULL); \ + assert(add != NULL); \ + (add)->next = (el)->next; \ + if ((head) == (el)) { \ + (head) = (add); \ + } else { \ + _tmp = head; \ + while (_tmp->next && (_tmp->next != (el))) { \ + _tmp = _tmp->next; \ + } \ + if (_tmp->next) { \ + _tmp->next = (add); \ + } \ + } \ +} while (0) + +#define LL_PREPEND_ELEM(head, el, add) \ +do { \ + LDECLTYPE(head) _tmp; \ + assert(head != NULL); \ + assert(el != NULL); \ + assert(add != NULL); \ + (add)->next = (el); \ + if ((head) == (el)) { \ + (head) = (add); \ + } else { \ + _tmp = head; \ + while (_tmp->next && (_tmp->next != (el))) { \ + _tmp = _tmp->next; \ + } \ + if (_tmp->next) { \ + _tmp->next = (add); \ + } \ + } \ +} while (0) \ + /****************************************************************************** * doubly linked list macros (non-circular) * *****************************************************************************/ #define DL_PREPEND(head,add) \ + DL_PREPEND2(head,add,prev,next) + +#define DL_PREPEND2(head,add,prev,next) \ do { \ (add)->next = head; \ if (head) { \ @@ -394,6 +510,9 @@ do { } while (0) #define DL_APPEND(head,add) \ + DL_APPEND2(head,add,prev,next) + +#define DL_APPEND2(head,add,prev,next) \ do { \ if (head) { \ (add)->prev = (head)->prev; \ @@ -405,10 +524,32 @@ do { (head)->prev = (head); \ (head)->next = NULL; \ } \ -} while (0); +} while (0) + +#define DL_CONCAT(head1,head2) \ + DL_CONCAT2(head1,head2,prev,next) + +#define DL_CONCAT2(head1,head2,prev,next) \ +do { \ + LDECLTYPE(head1) _tmp; \ + if (head2) { \ + if (head1) { \ + _tmp = (head2)->prev; \ + (head2)->prev = (head1)->prev; \ + (head1)->prev->next = (head2); \ + (head1)->prev = _tmp; \ + } else { \ + (head1)=(head2); \ + } \ + } \ +} while (0) #define DL_DELETE(head,del) \ + DL_DELETE2(head,del,prev,next) + +#define DL_DELETE2(head,del,prev,next) \ do { \ + assert((del)->prev != NULL); \ if ((del)->prev == (del)) { \ (head)=NULL; \ } else if ((del)==(head)) { \ @@ -422,24 +563,77 @@ do { (head)->prev = (del)->prev; \ } \ } \ -} while (0); +} while (0) #define DL_FOREACH(head,el) \ - for(el=head;el;el=el->next) + DL_FOREACH2(head,el,next) + +#define DL_FOREACH2(head,el,next) \ + for(el=head;el;el=(el)->next) /* this version is safe for deleting the elements during iteration */ #define DL_FOREACH_SAFE(head,el,tmp) \ + DL_FOREACH_SAFE2(head,el,tmp,next) + +#define DL_FOREACH_SAFE2(head,el,tmp,next) \ for((el)=(head);(el) && (tmp = (el)->next, 1); (el) = tmp) /* these are identical to their singly-linked list counterparts */ #define DL_SEARCH_SCALAR LL_SEARCH_SCALAR #define DL_SEARCH LL_SEARCH +#define DL_SEARCH_SCALAR2 LL_SEARCH_SCALAR2 +#define DL_SEARCH2 LL_SEARCH2 + +#define DL_REPLACE_ELEM(head, el, add) \ +do { \ + assert(head != NULL); \ + assert(el != NULL); \ + assert(add != NULL); \ + if ((head) == (el)) { \ + (head) = (add); \ + (add)->next = (el)->next; \ + if ((el)->next == NULL) { \ + (add)->prev = (add); \ + } else { \ + (add)->prev = (el)->prev; \ + (add)->next->prev = (add); \ + } \ + } else { \ + (add)->next = (el)->next; \ + (add)->prev = (el)->prev; \ + (add)->prev->next = (add); \ + if ((el)->next == NULL) { \ + (head)->prev = (add); \ + } else { \ + (add)->next->prev = (add); \ + } \ + } \ +} while (0) + +#define DL_PREPEND_ELEM(head, el, add) \ +do { \ + assert(head != NULL); \ + assert(el != NULL); \ + assert(add != NULL); \ + (add)->next = (el); \ + (add)->prev = (el)->prev; \ + (el)->prev = (add); \ + if ((head) == (el)) { \ + (head) = (add); \ + } else { \ + (add)->prev->next = (add); \ + } \ +} while (0) \ + /****************************************************************************** * circular doubly linked list macros * *****************************************************************************/ #define CDL_PREPEND(head,add) \ + CDL_PREPEND2(head,add,prev,next) + +#define CDL_PREPEND2(head,add,prev,next) \ do { \ if (head) { \ (add)->prev = (head)->prev; \ @@ -454,6 +648,9 @@ do { } while (0) #define CDL_DELETE(head,del) \ + CDL_DELETE2(head,del,prev,next) + +#define CDL_DELETE2(head,del,prev,next) \ do { \ if ( ((head)==(del)) && ((head)->next == (head))) { \ (head) = 0L; \ @@ -462,29 +659,75 @@ do { (del)->prev->next = (del)->next; \ if ((del) == (head)) (head)=(del)->next; \ } \ -} while (0); +} while (0) #define CDL_FOREACH(head,el) \ - for(el=head;el;el=(el->next==head ? 0L : el->next)) + CDL_FOREACH2(head,el,next) + +#define CDL_FOREACH2(head,el,next) \ + for(el=head;el;el=((el)->next==head ? 0L : (el)->next)) #define CDL_FOREACH_SAFE(head,el,tmp1,tmp2) \ + CDL_FOREACH_SAFE2(head,el,tmp1,tmp2,prev,next) + +#define CDL_FOREACH_SAFE2(head,el,tmp1,tmp2,prev,next) \ for((el)=(head), ((tmp1)=(head)?((head)->prev):NULL); \ (el) && ((tmp2)=(el)->next, 1); \ ((el) = (((el)==(tmp1)) ? 0L : (tmp2)))) #define CDL_SEARCH_SCALAR(head,out,field,val) \ + CDL_SEARCH_SCALAR2(head,out,field,val,next) + +#define CDL_SEARCH_SCALAR2(head,out,field,val,next) \ do { \ - CDL_FOREACH(head,out) { \ + CDL_FOREACH2(head,out,next) { \ if ((out)->field == (val)) break; \ } \ -} while(0) +} while(0) #define CDL_SEARCH(head,out,elt,cmp) \ + CDL_SEARCH2(head,out,elt,cmp,next) + +#define CDL_SEARCH2(head,out,elt,cmp,next) \ do { \ - CDL_FOREACH(head,out) { \ + CDL_FOREACH2(head,out,next) { \ if ((cmp(out,elt))==0) break; \ } \ -} while(0) +} while(0) + +#define CDL_REPLACE_ELEM(head, el, add) \ +do { \ + assert(head != NULL); \ + assert(el != NULL); \ + assert(add != NULL); \ + if ((el)->next == (el)) { \ + (add)->next = (add); \ + (add)->prev = (add); \ + (head) = (add); \ + } else { \ + (add)->next = (el)->next; \ + (add)->prev = (el)->prev; \ + (add)->next->prev = (add); \ + (add)->prev->next = (add); \ + if ((head) == (el)) { \ + (head) = (add); \ + } \ + } \ +} while (0) + +#define CDL_PREPEND_ELEM(head, el, add) \ +do { \ + assert(head != NULL); \ + assert(el != NULL); \ + assert(add != NULL); \ + (add)->next = (el); \ + (add)->prev = (el)->prev; \ + (el)->prev = (add); \ + (add)->prev->next = (add); \ + if ((head) == (el)) { \ + (head) = (add); \ + } \ +} while (0) \ #endif /* UTLIST_H */ diff --git a/include/cocos2d/ccConfig.h b/include/cocos2d/ccConfig.h index 934eb2e..587cc8a 100644 --- a/include/cocos2d/ccConfig.h +++ b/include/cocos2d/ccConfig.h @@ -28,40 +28,82 @@ cocos2d (cc) configuration file */ -#ifndef DEBUG -#define DEBUG (0) +/** @def CC_ENABLE_CHIPMUNK_INTEGRATION + If enabled, it will include CCPhysicsScript and CCPhysicsDebugNode with Chipmunk Physics support. + If you enable it, make sure that Chipmunk is in the search path. + Disabled by default + + @since v2.1 + */ +#ifndef CC_ENABLE_CHIPMUNK_INTEGRATION +#define CC_ENABLE_CHIPMUNK_INTEGRATION 0 +#endif + +/** @def CC_CHIPMUNK_IMPORT + Which file to import if using Chipmunk. + Change it to "ObjectiveChipmunk.h" or define it as a preprocessor macro if you are using ObjectiveChipmunk. + @since v2.1 + */ +#if CC_ENABLE_CHIPMUNK_INTEGRATION && !defined(CC_CHIPMUNK_IMPORT) +#define CC_CHIPMUNK_IMPORT "chipmunk.h" +#endif + +/** @def CC_ENABLE_BOX2D_INTEGRATION + If enabled, it will include CCPhysicsScript with Box2D Physics support. + If you enable it, make sure that Box2D is in the search path. + + Disabled by default + + @since v2.1 + */ +#ifndef CC_ENABLE_BOX2D_INTEGRATION +#define CC_ENABLE_BOX2D_INTEGRATION 0 +#endif + +/** @def CC_ENABLE_STACKABLE_ACTIONS + If enabled, actions that alter the position property (eg: CCMoveBy, CCJumpBy, CCBezierBy, etc..) will be stacked. + If you run 2 or more 'position' actions at the same time on a node, then end position will be the sum of all the positions. + If disabled, only the last run action will take effect. + + Enabled by default. Disable to be compatible with v2.0 and older versions. + + @since v2.1 + */ +#ifndef CC_ENABLE_STACKABLE_ACTIONS +#define CC_ENABLE_STACKABLE_ACTIONS 1 #endif + /** @def CC_ENABLE_GL_STATE_CACHE If enabled, cocos2d will maintain an OpenGL state cache internally to avoid unnecessary switches. - In order to use them, you have to use the following functions, insead of the the GL ones: + In order to use them, you have to use the following functions, instead of the the GL ones: - ccGLUseProgram() instead of glUseProgram() - ccGLDeleteProgram() instead of glDeleteProgram() - ccGLBlendFunc() instead of glBlendFunc() If this functionality is disabled, then ccGLUseProgram(), ccGLDeleteProgram(), ccGLBlendFunc() will call the GL ones, without using the cache. - It is recommened to enable it whenever possible to improve speed. + It is recommended to enable it whenever possible to improve speed. If you are migrating your code from GL ES 1.1, then keep it disabled. Once all your code works as expected, turn it on. - Default value: Disabled by default + Default value: Enabled by default @since v2.0.0 */ #ifndef CC_ENABLE_GL_STATE_CACHE -#define CC_ENABLE_GL_STATE_CACHE (1) +#define CC_ENABLE_GL_STATE_CACHE 1 #endif /** @def CC_ENABLE_DEPRECATED If enabled, cocos2d will compile all deprecated methods, classes and free functions. Also, renamed constants will be active as well. - Enable it only when migrating a v1.0 or earlier v2.0 versions to the most recent cocdos2d version. + Enable it only when migrating a v1.0 or earlier v2.0 versions to the most recent cocos2d version. Default value: Enabled by default @since v2.0.0 */ #ifndef CC_ENABLE_DEPRECATED -#define CC_ENABLE_DEPRECATED (0) +#define CC_ENABLE_DEPRECATED 1 #endif @@ -189,22 +231,9 @@ #endif -/** @def CC_USE_LA88_LABELS - If enabled, it will use LA88 (Luminance Alpha 16-bit textures) for CCLabelTTF objects. - If it is disabled, it will use A8 (Alpha 8-bit textures). - LA88 textures are 6% faster than A8 textures, but they will consume 2x memory. - - This feature is enabled by default. - - @since v0.99.5 - */ -#ifndef CC_USE_LA88_LABELS -#define CC_USE_LA88_LABELS 1 -#endif - /** @def CC_SPRITE_DEBUG_DRAW If enabled, all subclasses of CCSprite will draw a bounding box. - Useful for debugging purposes only. It is recommened to leave it disabled. + Useful for debugging purposes only. It is recommended to leave it disabled. If the CCSprite is being drawn by a CCSpriteBatchNode, the bounding box might be a bit different. To enable set it to a value different than 0. Disabled by default: @@ -213,28 +242,28 @@ 2 -- draw texture box */ #ifndef CC_SPRITE_DEBUG_DRAW -#define CC_SPRITE_DEBUG_DRAW (DEBUG) +#define CC_SPRITE_DEBUG_DRAW 0 #endif /** @def CC_LABELBMFONT_DEBUG_DRAW If enabled, all subclasses of CCLabelBMFont will draw a bounding box - Useful for debugging purposes only. It is recommened to leave it disabled. + Useful for debugging purposes only. It is recommended to leave it disabled. To enable set it to a value different than 0. Disabled by default. */ #ifndef CC_LABELBMFONT_DEBUG_DRAW -#define CC_LABELBMFONT_DEBUG_DRAW (DEBUG) +#define CC_LABELBMFONT_DEBUG_DRAW 0 #endif /** @def CC_LABELATLAS_DEBUG_DRAW If enabled, all subclasses of CCLabeltAtlas will draw a bounding box - Useful for debugging purposes only. It is recommened to leave it disabled. + Useful for debugging purposes only. It is recommended to leave it disabled. To enable set it to a value different than 0. Disabled by default. */ #ifndef CC_LABELATLAS_DEBUG_DRAW -#define CC_LABELATLAS_DEBUG_DRAW (DEBUG) +#define CC_LABELATLAS_DEBUG_DRAW 0 #endif /** @def CC_ENABLE_PROFILERS @@ -245,5 +274,6 @@ To enable set it to a value different than 0. Disabled by default. */ #ifndef CC_ENABLE_PROFILERS -#define CC_ENABLE_PROFILERS (DEBUG) +#define CC_ENABLE_PROFILERS 0 #endif + diff --git a/include/cocos2d/ccDeprecated.h b/include/cocos2d/ccDeprecated.h index 0b16933..d677c63 100644 --- a/include/cocos2d/ccDeprecated.h +++ b/include/cocos2d/ccDeprecated.h @@ -31,6 +31,7 @@ #import "CCMenu.h" #import "CCDirector.h" #import "CCSprite.h" +#import "CCParticleSystemQuad.h" #import "CCGLProgram.h" #import "CCAnimation.h" #import "CCScheduler.h" @@ -42,8 +43,9 @@ #import "CCTexture2D.h" #import "Support/CCFileUtils.h" #import "Platforms/Mac/CCDirectorMac.h" -#import "Platforms/iOS/CCTouchDispatcher.h" #import "Platforms/iOS/CCDirectorIOS.h" +#import "CCActionTiledGrid.h" +#import "CCActionGrid3D.h" /* @@ -57,6 +59,9 @@ // CCLOGERROR is no longer supported. #define CCLOGERROR CCLOGWARN +#define ccGridSize CGSize +#define ccg CGSizeMake + // ccTypes.h enum { #ifdef __CC_PLATFORM_IOS @@ -107,9 +112,18 @@ DEPRECATED_ATTRIBUTE @interface MacView : CCGLView #define GLProgram CCGLProgram // Extensions + @interface CCScheduler (Deprecated) // new: [director scheduler] +(CCScheduler*) sharedScheduler DEPRECATED_ATTRIBUTE; +// new: -(void) scheduleSelector:(SEL)selector forTarget:(id)target interval:(ccTime)interval repeat: (uint) repeat delay: (ccTime) delay paused:(BOOL)paused; +-(void) scheduleSelector:(SEL)selector forTarget:(id)target interval:(ccTime)interval paused:(BOOL)paused repeat:(uint)repeat delay:(ccTime)delay DEPRECATED_ATTRIBUTE; +// new: unscheduleAllForTarget +-(void) unscheduleAllSelectorsForTarget:(id)target DEPRECATED_ATTRIBUTE; +// new: unscheduleAll +-(void) unscheduleAllSelectors DEPRECATED_ATTRIBUTE; +// new: unscheduleAllWithMinPriority: +-(void) unscheduleAllSelectorsWithMinPriority:(NSInteger)minPriority DEPRECATED_ATTRIBUTE; @end @interface CCActionManager (Deprecated) @@ -117,19 +131,15 @@ DEPRECATED_ATTRIBUTE @interface MacView : CCGLView +(CCActionManager*) sharedManager DEPRECATED_ATTRIBUTE; @end -#if __CC_PLATFORM_IOS -@interface CCTouchDispatcher (Deprecated) -// new: [director touchDispatcher] -+(CCTouchDispatcher*) sharedDispatcher DEPRECATED_ATTRIBUTE; -@end -#elif __CC_PLATFORM_MAC -@interface CCEventDispatcher (Deprecated) -// new: [director eventDispatcher] -+(CCEventDispatcher*) sharedDispatcher DEPRECATED_ATTRIBUTE; -@end +#if defined(__CC_PLATFORM_IOS) + +#elif defined(__CC_PLATFORM_MAC) + #endif // __CC_PLATFORM_MAC @interface CCDirector (Deprecated) +// new: [director isPaused] +-(BOOL) getIsPaused DEPRECATED_ATTRIBUTE; // new: setView: -(void) setOpenGLView:(CCGLView*)view DEPRECATED_ATTRIBUTE; // new: view @@ -141,6 +151,8 @@ DEPRECATED_ATTRIBUTE @interface MacView : CCGLView @interface CCNode (Deprecated) -(void) setIsRelativeAnchorPoint:(BOOL)value DEPRECATED_ATTRIBUTE; -(BOOL) isRelativeAnchorPoint DEPRECATED_ATTRIBUTE; +- (void) setIgnoreAnchorPointForPosition:(BOOL)value DEPRECATED_ATTRIBUTE; +- (BOOL) ignoreAnchorPointForPosition:(BOOL)value DEPRECATED_ATTRIBUTE; @end @interface CCSprite (Deprecated) @@ -148,8 +160,26 @@ DEPRECATED_ATTRIBUTE @interface MacView : CCGLView +(id) spriteWithBatchNode:(CCSpriteBatchNode*)node rect:(CGRect)rect DEPRECATED_ATTRIBUTE; // new: initWithTexture:rect: -(id) initWithBatchNode:(CCSpriteBatchNode*)node rect:(CGRect)rect DEPRECATED_ATTRIBUTE; -// displayFrame +// new: spriteFrame -(CCSpriteFrame*) displayedFrame DEPRECATED_ATTRIBUTE; +// new: spriteFrame +- (CCSpriteFrame*) displayFrame DEPRECATED_ATTRIBUTE; +// new: spriteFrame +- (void) setDisplayFrame:(CCSpriteFrame *)newFrame DEPRECATED_ATTRIBUTE; +// don't use +-(BOOL) isFrameDisplayed:(CCSpriteFrame*)frame DEPRECATED_ATTRIBUTE; +// new: setSpriteFrameWithAnimationName:index: +-(void) setDisplayFrameWithAnimationName:(NSString*)animationName index:(int) frameIndex DEPRECATED_ATTRIBUTE; +@end + +@interface CCParticleSystemQuad (Deprecated) +-(void) setDisplayFrame:(CCSpriteFrame *)spriteFrame DEPRECATED_ATTRIBUTE; +@end + +@interface CCMenuItem (Deprecated) +// new: -(CGRect) activeArea; +-(CGRect) rect DEPRECATED_ATTRIBUTE; +-(void) setRect:(CGRect)rect DEPRECATED_ATTRIBUTE; @end @interface CCMenuItemAtlasFont (Deprecated) @@ -246,7 +276,7 @@ DEPRECATED_ATTRIBUTE @interface MacView : CCGLView -(BOOL)saveBuffer:(NSString*)name format:(int)format DEPRECATED_ATTRIBUTE; // new: -- not implemented on v2.0 -(NSData*)getUIImageAsDataFromBuffer:(int) format UNAVAILABLE_ATTRIBUTE; -#if __CC_PLATFORM_IOS +#if defined(__CC_PLATFORM_IOS) // new: getUIImage -(UIImage *)getUIImageFromBuffer DEPRECATED_ATTRIBUTE; #endif @@ -281,19 +311,112 @@ DEPRECATED_ATTRIBUTE @interface MacView : CCGLView @interface CCLabelTTF (Deprecated) +/* // new: + (id) labelWithString:(NSString*)string dimensions:hAlignment:fontName:fontSize: + (id) labelWithString:(NSString*)string dimensions:(CGSize)dimensions alignment:(CCTextAlignment)alignment fontName:(NSString*)name fontSize:(CGFloat)size DEPRECATED_ATTRIBUTE; // new: + (id) labelWithString:(NSString*)string dimensions:hAlignment:lineBreakMode:fontName:fontSize: + (id) labelWithString:(NSString*)string dimensions:(CGSize)dimensions alignment:(CCTextAlignment)alignment lineBreakMode:(CCLineBreakMode)lineBreakMode fontName:(NSString*)name fontSize:(CGFloat)size DEPRECATED_ATTRIBUTE; + ++ (id) labelWithString:(NSString*)string dimensions:(CGSize)dimensions hAlignment:(CCTextAlignment)alignment fontName:(NSString*)name fontSize:(CGFloat)size DEPRECATED_ATTRIBUTE; ++ (id) labelWithString:(NSString*)string dimensions:(CGSize)dimensions hAlignment:(CCTextAlignment)alignment lineBreakMode:(CCLineBreakMode)lineBreakMode fontName:(NSString*)name fontSize:(CGFloat)size DEPRECATED_ATTRIBUTE; ++ (id) labelWithString:(NSString*)string dimensions:(CGSize)dimensions hAlignment:(CCTextAlignment)alignment vAlignment:(CCVerticalTextAlignment)vertAlignment lineBreakMode:(CCLineBreakMode)lineBreakMode fontName:(NSString*)name fontSize:(CGFloat)size DEPRECATED_ATTRIBUTE; ++ (id) labelWithString:(NSString*)string dimensions:(CGSize)dimensions hAlignment:(CCTextAlignment)alignment vAlignment:(CCVerticalTextAlignment)vertAlignment fontName:(NSString*)name fontSize:(CGFloat)size DEPRECATED_ATTRIBUTE; + // new: + (id) initWithString:(NSString*)string dimensions:hAlignment:fontName:fontSize: - (id) initWithString:(NSString*)string dimensions:(CGSize)dimensions alignment:(CCTextAlignment)alignment fontName:(NSString*)name fontSize:(CGFloat)size DEPRECATED_ATTRIBUTE; // new: + (id) initWithString:(NSString*)string dimensions:hAlignment:lineBreakMode:fontName:fontSize: - (id) initWithString:(NSString*)str dimensions:(CGSize)dimensions alignment:(CCTextAlignment)alignment lineBreakMode:(CCLineBreakMode)lineBreakMode fontName:(NSString*)name fontSize:(CGFloat)size DEPRECATED_ATTRIBUTE; + */ @end @interface CCTexture2D (Deprecated) +/* - (id) initWithString:(NSString*)string dimensions:(CGSize)dimensions alignment:(CCTextAlignment)alignment lineBreakMode:(CCLineBreakMode)lineBreakMode fontName:(NSString*)name fontSize:(CGFloat)size DEPRECATED_ATTRIBUTE; - (id) initWithString:(NSString*)string dimensions:(CGSize)dimensions alignment:(CCTextAlignment)alignment fontName:(NSString*)name fontSize:(CGFloat)size DEPRECATED_ATTRIBUTE; + */ +@end + +// Effects +#pragma mark - Effects + +@interface CCGridAction (Deprecated) ++(id) actionWithSize:(CGSize)size duration:(ccTime)d DEPRECATED_ATTRIBUTE; +-(id) initWithSize:(CGSize)gridSize duration:(ccTime)d DEPRECATED_ATTRIBUTE; +@end + +@interface CCWaves3D (Deprecated) ++(id)actionWithWaves:(int)wav amplitude:(float)amp grid:(CGSize)gridSize duration:(ccTime)d DEPRECATED_ATTRIBUTE; +-(id)initWithWaves:(int)wav amplitude:(float)amp grid:(CGSize)gridSize duration:(ccTime)d DEPRECATED_ATTRIBUTE; +@end + +@interface CCLens3D (Deprecated) ++(id)actionWithPosition:(CGPoint)pos radius:(float)r grid:(CGSize)gridSize duration:(ccTime)d DEPRECATED_ATTRIBUTE; +-(id)initWithPosition:(CGPoint)pos radius:(float)r grid:(CGSize)gridSize duration:(ccTime)d DEPRECATED_ATTRIBUTE; +@end + +@interface CCRipple3D (Deprecated) ++(id)actionWithPosition:(CGPoint)pos radius:(float)r waves:(int)wav amplitude:(float)amp grid:(CGSize)gridSize duration:(ccTime)d DEPRECATED_ATTRIBUTE; +-(id)initWithPosition:(CGPoint)pos radius:(float)r waves:(int)wav amplitude:(float)amp grid:(CGSize)gridSize duration:(ccTime)d DEPRECATED_ATTRIBUTE; +@end + +@interface CCShaky3D (Deprecated) ++(id)actionWithRange:(int)range shakeZ:(BOOL)shakeZ grid:(CGSize)gridSize duration:(ccTime)d DEPRECATED_ATTRIBUTE; +-(id)initWithRange:(int)range shakeZ:(BOOL)shakeZ grid:(CGSize)gridSize duration:(ccTime)d DEPRECATED_ATTRIBUTE; +@end + +@interface CCLiquid (Deprecated) ++(id)actionWithWaves:(int)wav amplitude:(float)amp grid:(CGSize)gridSize duration:(ccTime)d DEPRECATED_ATTRIBUTE; +-(id)initWithWaves:(int)wav amplitude:(float)amp grid:(CGSize)gridSize duration:(ccTime)d DEPRECATED_ATTRIBUTE; +@end + +@interface CCWaves (Deprecated) ++(id)actionWithWaves:(int)wav amplitude:(float)amp horizontal:(BOOL)h vertical:(BOOL)v grid:(CGSize)gridSize duration:(ccTime)d DEPRECATED_ATTRIBUTE; +-(id)initWithWaves:(int)wav amplitude:(float)amp horizontal:(BOOL)h vertical:(BOOL)v grid:(CGSize)gridSize duration:(ccTime)d DEPRECATED_ATTRIBUTE; +@end + +@interface CCTwirl (Deprecated) ++(id)actionWithPosition:(CGPoint)pos twirls:(int)t amplitude:(float)amp grid:(CGSize)gridSize duration:(ccTime)d DEPRECATED_ATTRIBUTE; +-(id)initWithPosition:(CGPoint)pos twirls:(int)t amplitude:(float)amp grid:(CGSize)gridSize duration:(ccTime)d DEPRECATED_ATTRIBUTE; +@end + +@interface CCShakyTiles3D (Deprecated) ++(id)actionWithRange:(int)range shakeZ:(BOOL)shakeZ grid:(CGSize)gridSize duration:(ccTime)d DEPRECATED_ATTRIBUTE; +-(id)initWithRange:(int)range shakeZ:(BOOL)shakeZ grid:(CGSize)gridSize duration:(ccTime)d DEPRECATED_ATTRIBUTE; +@end + +@interface CCShatteredTiles3D (Deprecated) ++(id)actionWithRange:(int)range shatterZ:(BOOL)shatterZ grid:(CGSize)gridSize duration:(ccTime)d DEPRECATED_ATTRIBUTE; +-(id)initWithRange:(int)range shatterZ:(BOOL)shatterZ grid:(CGSize)gridSize duration:(ccTime)d DEPRECATED_ATTRIBUTE; +@end + +@interface CCShuffleTiles (Deprecated) ++(id)actionWithSeed:(int)s grid:(CGSize)gridSize duration:(ccTime)d DEPRECATED_ATTRIBUTE; +-(id)initWithSeed:(int)s grid:(CGSize)gridSize duration:(ccTime)d DEPRECATED_ATTRIBUTE; +@end + +@interface CCTurnOffTiles (Deprecated) ++(id)actionWithSeed:(int)s grid:(CGSize)gridSize duration:(ccTime)d DEPRECATED_ATTRIBUTE; +-(id)initWithSeed:(int)s grid:(CGSize)gridSize duration:(ccTime)d DEPRECATED_ATTRIBUTE; +@end + +@interface CCWavesTiles3D (Deprecated) ++(id)actionWithWaves:(int)wav amplitude:(float)amp grid:(CGSize)gridSize duration:(ccTime)d DEPRECATED_ATTRIBUTE; +-(id)initWithWaves:(int)wav amplitude:(float)amp grid:(CGSize)gridSize duration:(ccTime)d DEPRECATED_ATTRIBUTE; +@end + +@interface CCJumpTiles3D (Deprecated) ++(id)actionWithJumps:(int)j amplitude:(float)amp grid:(CGSize)gridSize duration:(ccTime)d DEPRECATED_ATTRIBUTE; +-(id)initWithJumps:(int)j amplitude:(float)amp grid:(CGSize)gridSize duration:(ccTime)d DEPRECATED_ATTRIBUTE; +@end + +@interface CCSplitRows (Deprecated) ++(id)actionWithRows:(int)rows duration:(ccTime)duration DEPRECATED_ATTRIBUTE; +-(id)initWithRows:(int)rows duration:(ccTime)duration DEPRECATED_ATTRIBUTE; +@end + +@interface CCSplitCols (Deprecated) ++(id)actionWithCols:(int)cols duration:(ccTime)duration DEPRECATED_ATTRIBUTE; +-(id)initWithCols:(int)cols duration:(ccTime)duration DEPRECATED_ATTRIBUTE; @end #endif // CC_ENABLE_DEPRECATED diff --git a/include/cocos2d/ccFPSImages.h b/include/cocos2d/ccFPSImages.h new file mode 100644 index 0000000..ad35566 --- /dev/null +++ b/include/cocos2d/ccFPSImages.h @@ -0,0 +1,39 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2012 Zynga Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +extern unsigned char cc_fps_images_png[]; +extern unsigned char cc_fps_images_hd_png[]; +extern unsigned char cc_fps_images_ipadhd_png[]; + +#ifdef __cplusplus +extern "C" { +#endif + +unsigned int cc_fps_images_len(void); +unsigned int cc_fps_images_hd_len(void); +unsigned int cc_fps_images_ipadhd_len(void); + +#ifdef __cplusplus +} +#endif diff --git a/include/cocos2d/ccGLStateCache.h b/include/cocos2d/ccGLStateCache.h index 1356829..a299e45 100644 --- a/include/cocos2d/ccGLStateCache.h +++ b/include/cocos2d/ccGLStateCache.h @@ -32,11 +32,11 @@ /** vertex attrib flags */ enum { kCCVertexAttribFlag_None = 0, - + kCCVertexAttribFlag_Position = 1 << 0, kCCVertexAttribFlag_Color = 1 << 1, kCCVertexAttribFlag_TexCoords = 1 << 2, - + kCCVertexAttribFlag_PosColorTex = ( kCCVertexAttribFlag_Position | kCCVertexAttribFlag_Color | kCCVertexAttribFlag_TexCoords ), }; @@ -45,20 +45,21 @@ typedef enum { // CC_GL_SCISSOR_TEST = 1 << 0, // CC_GL_STENCIL_TEST = 1 << 1, // CC_GL_DEPTH_TEST = 1 << 2, - CC_GL_BLEND = 1 << 3, +// CC_GL_BLEND = 1 << 3, // CC_GL_DITHER = 1 << 4, // CC_GL_ALL = ( CC_GL_SCISSOR_TEST | CC_GL_STENCIL_TEST | CC_GL_DEPTH_TEST | CC_GL_BLEND | CC_GL_DITHER ), - CC_GL_ALL = ( CC_GL_BLEND ), - +// CC_GL_ALL = ( CC_GL_BLEND ), + CC_GL_ALL = 0, + } ccGLServerState; #ifdef __cplusplus extern "C" { #endif - + /** @file ccGLStateCache.h -*/ + */ /** Invalidates the GL state cache. If CC_ENABLE_GL_STATE_CACHE it will reset the GL state cache. @@ -84,6 +85,12 @@ void ccGLDeleteProgram( GLuint program ); */ void ccGLBlendFunc(GLenum sfactor, GLenum dfactor); +/** Resets the blending mode back to the cached state in case you used glBlendFuncSeparate() or glBlendEquation(). + If CC_ENABLE_GL_STATE_CACHE is disabled, it will just set the default blending mode using GL_FUNC_ADD. + @since v2.0.0 + */ +void ccGLBlendResetToCache(void); + /** sets the projection matrix as dirty @since v2.0.0 */ @@ -91,48 +98,59 @@ void ccSetProjectionMatrixDirty( void ); /** Will enable the vertex attribs that are passed as flags. Possible flags: - - * kCCVertexAttribFlag_Position - * kCCVertexAttribFlag_Color - * kCCVertexAttribFlag_TexCoords - + + * kCCVertexAttribFlag_Position + * kCCVertexAttribFlag_Color + * kCCVertexAttribFlag_TexCoords + These flags can be ORed. The flags that are not present, will be disabled. - + @since v2.0.0 */ void ccGLEnableVertexAttribs( unsigned int flags ); -/** If the active texture is not textureEnum, then it will active it. - If CC_ENABLE_GL_STATE_CACHE is disabled, it will call glActiveTexture() directly. - @since v2.0.0 +/** If the texture is not already bound to texture unit 0 and if target is GL_TEXTURE_2D, it binds it. + If CC_ENABLE_GL_STATE_CACHE is disabled or if target != GL_TEXTURE_2D it will call glBindTexture() directly. + @since v2.1 */ -void ccGLActiveTexture(GLenum textureEnum ); +void ccGLBindTexture( GLenum target, GLuint textureId ); -/** Returns the active texture. - If CC_ENABLE_GL_STATE_CACHE is disabled, it will call glGetIntegerv(GL_ACTIVE_TEXTURE); +/** If the texture is not already bound to texture unit 0, it binds it. + If CC_ENABLE_GL_STATE_CACHE is disabled, it will call glBindTexture() directly. @since v2.0.0 */ -GLenum ccGLGetActiveTexture( void ); - +void ccGLBindTexture2D( GLuint textureId ); -/** If the texture is not already bound, it binds it. +/** If the texture is not already bound to a given unit, it binds it. If CC_ENABLE_GL_STATE_CACHE is disabled, it will call glBindTexture() directly. - @since v2.0.0 + @since v2.1.0 */ -void ccGLBindTexture2D(GLuint textureId ); +void ccGLBindTexture2DN( GLuint textureUnit, GLuint textureId ); -/** It will delete a given texture. If the texture was bound, it will invalidate the cached. +/** It will delete a given texture. If the texture was bound, it will invalidate the cached for texture unit 0. If CC_ENABLE_GL_STATE_CACHE is disabled, it will call glDeleteTextures() directly. @since v2.0.0 */ void ccGLDeleteTexture(GLuint textureId); +/** It will delete a given texture. If the texture was bound, it will invalidate the cached for the given texture unit. + If CC_ENABLE_GL_STATE_CACHE is disabled, it will call glDeleteTextures() directly. + @since v2.1.0 + */ +void ccGLDeleteTextureN( GLuint textureUnit, GLuint textureId ); + +/** If the vertex array is not already bound, it binds it. + If CC_ENABLE_GL_STATE_CACHE is disabled, it will call glBindVertexArray() directly. + @since v2.0.0 + */ +void ccGLBindVAO(GLuint vaoId); + /** It will enable / disable the server side GL states. If CC_ENABLE_GL_STATE_CACHE is disabled, it will call glEnable() directly. @since v2.0.0 */ void ccGLEnable( ccGLServerState flags ); - + #ifdef __cplusplus } #endif diff --git a/include/cocos2d/ccMacros.h b/include/cocos2d/ccMacros.h index 93032f4..8547cc0 100644 --- a/include/cocos2d/ccMacros.h +++ b/include/cocos2d/ccMacros.h @@ -47,12 +47,12 @@ * * if COCOS2D_DEBUG==1 then: * CCLOG() will be enabled - * CCLOGERROR() will be enabled + * CCLOGWARN() will be enabled * CCLOGINFO() will be disabled * * if COCOS2D_DEBUG==2 or higher then: * CCLOG() will be enabled - * CCLOGERROR() will be enabled + * CCLOGWARN() will be enabled * CCLOGINFO() will be enabled */ @@ -110,7 +110,7 @@ simple macro that swaps 2 variables */ #define CC_RADIANS_TO_DEGREES(__ANGLE__) ((__ANGLE__) * 57.29577951f) // PI * 180 -#define kCCRepeatForever UINT_MAX -1 +#define kCCRepeatForever (UINT_MAX -1) /** @def CC_BLEND_SRC default gl blend src function. Compatible with premultiplied alpha images. */ @@ -120,7 +120,7 @@ default gl blend src function. Compatible with premultiplied alpha images. /** @def CC_DIRECTOR_INIT - Initializes an CCGLView with 0-bit depth format, and RGB565 render buffer. - The CCGLView view will have multiple touches disabled. - - It will create a UIWindow and it will assign it the 'window_' ivar. 'window_' must be declared before calling this marcro. + - It will create a UIWindow and it will assign it the 'window_' ivar. 'window_' must be declared before calling this macro. - It will create a UINavigationController and it will assign it the 'navigationController_' ivar. 'navController_' must be declared before using this macro. - The director_ will be the root view controller of the navController. - It will connect the CCGLView to the Director @@ -188,10 +188,10 @@ do { \ */ #define CC_NODE_DRAW_SETUP() \ do { \ - ccGLEnable( glServerState_ ); \ - NSAssert1(shaderProgram_, @"No shader program set for node: %@", self); \ - [shaderProgram_ use]; \ - [shaderProgram_ setUniformForModelViewProjectionMatrix]; \ + ccGLEnable( _glServerState ); \ + NSAssert1(_shaderProgram, @"No shader program set for node: %@", self); \ + [_shaderProgram use]; \ + [_shaderProgram setUniformsForBuiltins]; \ } while(0) @@ -210,7 +210,7 @@ do { \ -#if __CC_PLATFORM_IOS +#if defined (__CC_PLATFORM_IOS) /****************************/ /** RETINA DISPLAY ENABLED **/ @@ -321,23 +321,7 @@ CGSizeMake( (__size_in_points__).width * CC_CONTENT_SCALE_FACTOR(), (__size_in_p #endif -/*****************/ -/** ARC Macros **/ -/*****************/ -#if defined(__has_feature) && __has_feature(objc_arc) -// ARC (used for inline functions) -#define CC_ARC_RETAIN(value) value -#define CC_ARC_RELEASE(value) value = 0 -#define CC_ARC_UNSAFE_RETAINED __unsafe_unretained - -#else -// No ARC -#define CC_ARC_RETAIN(value) [value retain] -#define CC_ARC_RELEASE(value) [value release] -#define CC_ARC_UNSAFE_RETAINED -#endif - -/** @def CC_INCREMENT_GL_DRAWS_BY_ONE +/** @def CC_INCREMENT_GL_DRAWS Increments the GL Draws counts by one. The number of calls per frame are displayed on the screen when the CCDirector's stats are enabled. */ diff --git a/include/cocos2d/ccShader_PositionColorLengthTexture_frag.h b/include/cocos2d/ccShader_PositionColorLengthTexture_frag.h new file mode 100644 index 0000000..80470e2 --- /dev/null +++ b/include/cocos2d/ccShader_PositionColorLengthTexture_frag.h @@ -0,0 +1,41 @@ +/* Copyright (c) 2012 Scott Lembcke and Howling Moon Software + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +" \n\ +#extension GL_OES_standard_derivatives : enable \n\ + \n\ +#ifdef GL_ES \n\ +varying mediump vec4 v_color; \n\ +varying mediump vec2 v_texcoord; \n\ +#else \n\ +varying vec4 v_color; \n\ +varying vec2 v_texcoord; \n\ +#endif \n\ + \n\ +void main() \n\ +{ \n\ +#if defined GL_OES_standard_derivatives \n\ + gl_FragColor = v_color*smoothstep(0.0, length(fwidth(v_texcoord)), 1.0 - length(v_texcoord)); \n\ +#else \n\ + gl_FragColor = v_color*step(0.0, 1.0 - length(v_texcoord)); \n\ +#endif \n\ +} \n\ +"; diff --git a/include/cocos2d/ccShader_PositionColorLengthTexture_vert.h b/include/cocos2d/ccShader_PositionColorLengthTexture_vert.h new file mode 100644 index 0000000..3a8e96d --- /dev/null +++ b/include/cocos2d/ccShader_PositionColorLengthTexture_vert.h @@ -0,0 +1,47 @@ +/* Copyright (c) 2012 Scott Lembcke and Howling Moon Software + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +" \n\ +#ifdef GL_ES \n\ +attribute mediump vec4 a_position; \n\ +attribute mediump vec2 a_texcoord; \n\ +attribute mediump vec4 a_color; \n\ + \n\ +varying mediump vec4 v_color; \n\ +varying mediump vec2 v_texcoord; \n\ + \n\ +#else \n\ +attribute vec4 a_position; \n\ +attribute vec2 a_texcoord; \n\ +attribute vec4 a_color; \n\ + \n\ +varying vec4 v_color; \n\ +varying vec2 v_texcoord; \n\ +#endif \n\ + \n\ +void main() \n\ +{ \n\ + v_color = vec4(a_color.rgb * a_color.a, a_color.a); \n\ + v_texcoord = a_texcoord; \n\ + \n\ + gl_Position = CC_MVPMatrix * a_position; \n\ +} \n\ +"; diff --git a/include/cocos2d/ccShader_PositionColor_frag.h b/include/cocos2d/ccShader_PositionColor_frag.h index 2c28489..910903d 100644 --- a/include/cocos2d/ccShader_PositionColor_frag.h +++ b/include/cocos2d/ccShader_PositionColor_frag.h @@ -1,3 +1,28 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2011 Ricardo Quesada + * Copyright (c) 2012 Zynga Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + " \n\ #ifdef GL_ES \n\ precision lowp float; \n\ diff --git a/include/cocos2d/ccShader_PositionColor_vert.h b/include/cocos2d/ccShader_PositionColor_vert.h index 815e161..633f338 100644 --- a/include/cocos2d/ccShader_PositionColor_vert.h +++ b/include/cocos2d/ccShader_PositionColor_vert.h @@ -1,8 +1,31 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2011 Ricardo Quesada + * Copyright (c) 2012 Zynga Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + " \n\ attribute vec4 a_position; \n\ attribute vec4 a_color; \n\ -uniform mat4 u_MVPMatrix; \n\ - \n\ #ifdef GL_ES \n\ varying lowp vec4 v_fragmentColor; \n\ #else \n\ @@ -11,7 +34,7 @@ varying vec4 v_fragmentColor; \n\ \n\ void main() \n\ { \n\ - gl_Position = u_MVPMatrix * a_position; \n\ + gl_Position = CC_MVPMatrix * a_position; \n\ v_fragmentColor = a_color; \n\ } \n\ "; diff --git a/include/cocos2d/ccShader_PositionTextureA8Color_frag.h b/include/cocos2d/ccShader_PositionTextureA8Color_frag.h index 0b6cd10..6a8fb85 100644 --- a/include/cocos2d/ccShader_PositionTextureA8Color_frag.h +++ b/include/cocos2d/ccShader_PositionTextureA8Color_frag.h @@ -1,3 +1,28 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2011 Ricardo Quesada + * Copyright (c) 2012 Zynga Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + " \n\ #ifdef GL_ES \n\ precision lowp float; \n\ @@ -5,12 +30,12 @@ precision lowp float; \n\ \n\ varying vec4 v_fragmentColor; \n\ varying vec2 v_texCoord; \n\ -uniform sampler2D u_texture; \n\ +uniform sampler2D CC_Texture0; \n\ \n\ void main() \n\ { \n\ gl_FragColor = vec4( v_fragmentColor.rgb, // RGB from uniform \n\ - v_fragmentColor.a * texture2D(u_texture, v_texCoord).a // A from texture & uniform \n\ + v_fragmentColor.a * texture2D(CC_Texture0, v_texCoord).a // A from texture & uniform \n\ ); \n\ } \n\ "; diff --git a/include/cocos2d/ccShader_PositionTextureA8Color_vert.h b/include/cocos2d/ccShader_PositionTextureA8Color_vert.h index b844932..bb29e7d 100644 --- a/include/cocos2d/ccShader_PositionTextureA8Color_vert.h +++ b/include/cocos2d/ccShader_PositionTextureA8Color_vert.h @@ -1,8 +1,32 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2011 Ricardo Quesada + * Copyright (c) 2012 Zynga Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + " \n\ attribute vec4 a_position; \n\ attribute vec2 a_texCoord; \n\ attribute vec4 a_color; \n\ -uniform mat4 u_MVPMatrix; \n\ \n\ #ifdef GL_ES \n\ varying lowp vec4 v_fragmentColor; \n\ @@ -14,7 +38,7 @@ varying vec2 v_texCoord; \n\ \n\ void main() \n\ { \n\ - gl_Position = u_MVPMatrix * a_position; \n\ + gl_Position = CC_MVPMatrix * a_position; \n\ v_fragmentColor = a_color; \n\ v_texCoord = a_texCoord; \n\ } \n\ diff --git a/include/cocos2d/ccShader_PositionTextureColorAlphaTest_frag.h b/include/cocos2d/ccShader_PositionTextureColorAlphaTest_frag.h index 253c5e8..759bb02 100644 --- a/include/cocos2d/ccShader_PositionTextureColorAlphaTest_frag.h +++ b/include/cocos2d/ccShader_PositionTextureColorAlphaTest_frag.h @@ -1,3 +1,27 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2011 Brian Chapados + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + " \n\ #ifdef GL_ES \n\ precision lowp float; \n\ @@ -5,17 +29,17 @@ precision lowp float; \n\ \n\ varying vec4 v_fragmentColor; \n\ varying vec2 v_texCoord; \n\ -uniform sampler2D u_texture; \n\ -uniform float u_alpha_value; \n\ +uniform sampler2D CC_Texture0; \n\ +uniform float CC_AlphaValue; \n\ \n\ void main() \n\ { \n\ - vec4 texColor = texture2D(u_texture, v_texCoord); \n\ + vec4 texColor = texture2D(CC_Texture0, v_texCoord); \n\ \n\ // mimic: glAlphaFunc(GL_GREATER) \n\ - // pass if ( incoming_pixel >= u_alpha_value ) => fail if incoming_pixel < u_alpha_value \n\ + // pass if ( incoming_pixel >= CC_AlphaValue ) => fail if incoming_pixel < CC_AlphaValue \n\ \n\ - if ( texColor.a <= u_alpha_value ) \n\ + if ( texColor.a <= CC_AlphaValue ) \n\ discard; \n\ \n\ gl_FragColor = texColor * v_fragmentColor; \n\ diff --git a/include/cocos2d/ccShader_PositionTextureColor_frag.h b/include/cocos2d/ccShader_PositionTextureColor_frag.h index aba7e21..df5527e 100644 --- a/include/cocos2d/ccShader_PositionTextureColor_frag.h +++ b/include/cocos2d/ccShader_PositionTextureColor_frag.h @@ -1,3 +1,28 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2011 Ricardo Quesada + * Copyright (c) 2012 Zynga Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + " \n\ #ifdef GL_ES \n\ precision lowp float; \n\ @@ -5,10 +30,10 @@ precision lowp float; \n\ \n\ varying vec4 v_fragmentColor; \n\ varying vec2 v_texCoord; \n\ -uniform sampler2D u_texture; \n\ +uniform sampler2D CC_Texture0; \n\ \n\ void main() \n\ { \n\ - gl_FragColor = v_fragmentColor * texture2D(u_texture, v_texCoord); \n\ + gl_FragColor = v_fragmentColor * texture2D(CC_Texture0, v_texCoord); \n\ } \n\ "; diff --git a/include/cocos2d/ccShader_PositionTextureColor_vert.h b/include/cocos2d/ccShader_PositionTextureColor_vert.h index cf2361d..bb29e7d 100644 --- a/include/cocos2d/ccShader_PositionTextureColor_vert.h +++ b/include/cocos2d/ccShader_PositionTextureColor_vert.h @@ -1,10 +1,33 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2011 Ricardo Quesada + * Copyright (c) 2012 Zynga Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + " \n\ attribute vec4 a_position; \n\ attribute vec2 a_texCoord; \n\ attribute vec4 a_color; \n\ \n\ -uniform mat4 u_MVPMatrix; \n\ - \n\ #ifdef GL_ES \n\ varying lowp vec4 v_fragmentColor; \n\ varying mediump vec2 v_texCoord; \n\ @@ -15,7 +38,7 @@ varying vec2 v_texCoord; \n\ \n\ void main() \n\ { \n\ - gl_Position = u_MVPMatrix * a_position; \n\ + gl_Position = CC_MVPMatrix * a_position; \n\ v_fragmentColor = a_color; \n\ v_texCoord = a_texCoord; \n\ } \n\ diff --git a/include/cocos2d/ccShader_PositionTexture_frag.h b/include/cocos2d/ccShader_PositionTexture_frag.h index d7af10e..93a8f0e 100644 --- a/include/cocos2d/ccShader_PositionTexture_frag.h +++ b/include/cocos2d/ccShader_PositionTexture_frag.h @@ -1,13 +1,38 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2011 Ricardo Quesada + * Copyright (c) 2012 Zynga Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + " \n\ #ifdef GL_ES \n\ precision lowp float; \n\ #endif \n\ \n\ varying vec2 v_texCoord; \n\ -uniform sampler2D u_texture; \n\ +uniform sampler2D CC_Texture0; \n\ \n\ void main() \n\ { \n\ - gl_FragColor = texture2D(u_texture, v_texCoord); \n\ + gl_FragColor = texture2D(CC_Texture0, v_texCoord); \n\ } \n\ "; diff --git a/include/cocos2d/ccShader_PositionTexture_uColor_frag.h b/include/cocos2d/ccShader_PositionTexture_uColor_frag.h index 019f2ef..a97d250 100644 --- a/include/cocos2d/ccShader_PositionTexture_uColor_frag.h +++ b/include/cocos2d/ccShader_PositionTexture_uColor_frag.h @@ -1,3 +1,28 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2011 Ricardo Quesada + * Copyright (c) 2012 Zynga Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + " \n\ #ifdef GL_ES \n\ precision lowp float; \n\ @@ -7,10 +32,10 @@ uniform vec4 u_color; \n\ \n\ varying vec2 v_texCoord; \n\ \n\ -uniform sampler2D u_texture; \n\ +uniform sampler2D CC_Texture0; \n\ \n\ void main() \n\ { \n\ - gl_FragColor = texture2D(u_texture, v_texCoord) * u_color; \n\ + gl_FragColor = texture2D(CC_Texture0, v_texCoord) * u_color; \n\ } \n\ "; diff --git a/include/cocos2d/ccShader_PositionTexture_uColor_vert.h b/include/cocos2d/ccShader_PositionTexture_uColor_vert.h index ca36ff0..9d2bfd3 100644 --- a/include/cocos2d/ccShader_PositionTexture_uColor_vert.h +++ b/include/cocos2d/ccShader_PositionTexture_uColor_vert.h @@ -1,9 +1,32 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2011 Ricardo Quesada + * Copyright (c) 2012 Zynga Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + " \n\ attribute vec4 a_position; \n\ attribute vec2 a_texCoord; \n\ \n\ -uniform mat4 u_MVPMatrix; \n\ - \n\ #ifdef GL_ES \n\ varying mediump vec2 v_texCoord; \n\ #else \n\ @@ -12,7 +35,7 @@ varying vec2 v_texCoord; \n\ \n\ void main() \n\ { \n\ - gl_Position = u_MVPMatrix * a_position; \n\ + gl_Position = CC_MVPMatrix * a_position; \n\ v_texCoord = a_texCoord; \n\ } \n\ "; diff --git a/include/cocos2d/ccShader_PositionTexture_vert.h b/include/cocos2d/ccShader_PositionTexture_vert.h index 98ceab5..1278ab0 100644 --- a/include/cocos2d/ccShader_PositionTexture_vert.h +++ b/include/cocos2d/ccShader_PositionTexture_vert.h @@ -1,7 +1,31 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2011 Ricardo Quesada + * Copyright (c) 2012 Zynga Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + " \n\ attribute vec4 a_position; \n\ attribute vec2 a_texCoord; \n\ -uniform mat4 u_MVPMatrix; \n\ \n\ #ifdef GL_ES \n\ varying mediump vec2 v_texCoord; \n\ @@ -11,7 +35,7 @@ varying vec2 v_texCoord; \n\ \n\ void main() \n\ { \n\ - gl_Position = u_MVPMatrix * a_position; \n\ + gl_Position = CC_MVPMatrix * a_position; \n\ v_texCoord = a_texCoord; \n\ } \n\ "; diff --git a/include/cocos2d/ccShader_Position_uColor_frag.h b/include/cocos2d/ccShader_Position_uColor_frag.h index 48e5ae6..d882c88 100644 --- a/include/cocos2d/ccShader_Position_uColor_frag.h +++ b/include/cocos2d/ccShader_Position_uColor_frag.h @@ -1,3 +1,28 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2011 Ricardo Quesada + * Copyright (c) 2012 Zynga Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + " \n\ #ifdef GL_ES \n\ precision lowp float; \n\ diff --git a/include/cocos2d/ccShader_Position_uColor_vert.h b/include/cocos2d/ccShader_Position_uColor_vert.h index 9f1ba38..c50e38b 100644 --- a/include/cocos2d/ccShader_Position_uColor_vert.h +++ b/include/cocos2d/ccShader_Position_uColor_vert.h @@ -1,6 +1,30 @@ +/* + * cocos2d for iPhone: http://www.cocos2d-iphone.org + * + * Copyright (c) 2011 Ricardo Quesada + * Copyright (c) 2012 Zynga Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + " \n\ attribute vec4 a_position; \n\ -uniform mat4 u_MVPMatrix; \n\ uniform vec4 u_color; \n\ uniform float u_pointSize; \n\ \n\ @@ -12,7 +36,7 @@ varying vec4 v_fragmentColor; \n\ \n\ void main() \n\ { \n\ - gl_Position = u_MVPMatrix * a_position; \n\ + gl_Position = CC_MVPMatrix * a_position; \n\ gl_PointSize = u_pointSize; \n\ v_fragmentColor = u_color; \n\ } \n\ diff --git a/include/cocos2d/ccShaders.h b/include/cocos2d/ccShaders.h index 84b113f..076c3e0 100644 --- a/include/cocos2d/ccShaders.h +++ b/include/cocos2d/ccShaders.h @@ -24,6 +24,10 @@ #import "Platforms/CCGL.h" +#ifdef __cplusplus__ +extern "C" { +#endif // __cplusplus__ + extern const GLchar * ccPosition_uColor_frag; extern const GLchar * ccPosition_uColor_vert; @@ -43,3 +47,10 @@ extern const GLchar * ccPositionTextureColorAlphaTest_frag; extern const GLchar * ccPositionTexture_uColor_frag; extern const GLchar * ccPositionTexture_uColor_vert; + +extern const GLchar * ccPositionColorLengthTexture_frag; +extern const GLchar * ccPositionColorLengthTexture_vert; + +#ifdef __cplusplus__ +} +#endif // __cplusplus__ diff --git a/include/cocos2d/ccTypes.h b/include/cocos2d/ccTypes.h index 730aa93..1596271 100644 --- a/include/cocos2d/ccTypes.h +++ b/include/cocos2d/ccTypes.h @@ -41,6 +41,11 @@ /** RGB color composed of bytes 3 bytes @since v0.8 */ + +#ifdef __cplusplus +extern "C" { +#endif + typedef struct _ccColor3B { GLubyte r; @@ -55,7 +60,8 @@ ccc3(const GLubyte r, const GLubyte g, const GLubyte b) ccColor3B c = {r, g, b}; return c; } -//ccColor3B predefined colors + + //ccColor3B predefined colors //! White color (255,255,255) static const ccColor3B ccWHITE = {255,255,255}; //! Yellow color (255,255,0) @@ -93,17 +99,23 @@ ccc4(const GLubyte r, const GLubyte g, const GLubyte b, const GLubyte o) return c; } +/** returns YES if both ccColor4F are equal. Otherwise it returns NO. + @since v0.99.1 + */ +static inline BOOL ccc4BEqual(ccColor4B a, ccColor4B b) +{ + return a.r == b.r && a.g == b.g && a.b == b.b && a.a == b.a; +} /** RGBA color composed of 4 floats @since v0.8 */ -struct ccColor4F { +typedef struct _ccColor4F { GLfloat r; GLfloat g; GLfloat b; GLfloat a; -}; -typedef struct ccColor4F ccColor4F; +} ccColor4F; //! helper that creates a ccColor4f type static inline ccColor4F ccc4f(const GLfloat r, const GLfloat g, const GLfloat b, const GLfloat a) @@ -127,6 +139,8 @@ static inline ccColor4F ccc4FFromccc4B(ccColor4B c) return (ccColor4F){c.r/255.f, c.g/255.f, c.b/255.f, c.a/255.f}; } +#pragma clang diagnostic push COCOS2D +#pragma clang diagnostic ignored "-Wfloat-equal" /** returns YES if both ccColor4F are equal. Otherwise it returns NO. @since v0.99.1 */ @@ -134,6 +148,12 @@ static inline BOOL ccc4FEqual(ccColor4F a, ccColor4F b) { return a.r == b.r && a.g == b.g && a.b == b.b && a.a == b.a; } + +static inline ccColor4B ccc4BFromccc4F(ccColor4F c) +{ + return (ccColor4B){(GLubyte)(c.r*255), (GLubyte)(c.g*255), (GLubyte)(c.b*255), (GLubyte)(c.a*255)}; +} +#pragma clang diagnostic pop COCOS2D /** A vertex composed of 2 GLfloats: x, y @since v0.8 @@ -188,21 +208,6 @@ typedef struct _ccQuad3 { ccVertex3F tr; } ccQuad3; -//! A 2D grid size -typedef struct _ccGridSize -{ - NSInteger x; - NSInteger y; -} ccGridSize; - -//! helper function to create a ccGridSize -static inline ccGridSize -ccg(const NSInteger x, const NSInteger y) -{ - ccGridSize v = {x, y}; - return v; -} - //! a Point with a vertex point, a tex coord point and a color 4B typedef struct _ccV2F_C4B_T2F { @@ -264,7 +269,19 @@ typedef struct _ccV3F_C4B_T2F ccTex2F texCoords; // 8 byts } ccV3F_C4B_T2F; -//! 4 ccVertex2FTex2FColor4B Quad + +//! A Triangle of ccV2F_C4B_T2F +typedef struct _ccV2F_C4B_T2F_Triangle +{ + //! Point A + ccV2F_C4B_T2F a; + //! Point B + ccV2F_C4B_T2F b; + //! Point B + ccV2F_C4B_T2F c; +} ccV2F_C4B_T2F_Triangle; + +//! A Quad of ccV2F_C4B_T2F typedef struct _ccV2F_C4B_T2F_Quad { //! bottom left @@ -312,16 +329,22 @@ typedef struct _ccBlendFunc GLenum dst; } ccBlendFunc; +static const ccBlendFunc kCCBlendFuncDisable = {GL_ONE, GL_ZERO}; + //! ccResolutionType typedef enum { - //! Unknonw resolution type + //! Unknown resolution type kCCResolutionUnknown, #ifdef __CC_PLATFORM_IOS //! iPhone resolution type kCCResolutioniPhone, - //! RetinaDisplay resolution type + //! iPhone RetinaDisplay resolution type kCCResolutioniPhoneRetinaDisplay, + //! iPhone5 resolution type + kCCResolutioniPhone5, + //! iPhone 5 RetinaDisplay resolution type + kCCResolutioniPhone5RetinaDisplay, //! iPad resolution type kCCResolutioniPad, //! iPad Retina Display resolution type @@ -331,13 +354,13 @@ typedef enum //! Mac resolution type kCCResolutionMac, - //! Mac RetinaDisplay resolution type (???) + //! Mac RetinaDisplay resolution type kCCResolutionMacRetinaDisplay, #endif // platform } ccResolutionType; -// XXX: If any of these enums are edited and/or reordered, udpate CCTexture2D.m +// XXX: If any of these enums are edited and/or reordered, update CCTexture2D.m //! Vertical text alignment type typedef enum { @@ -346,7 +369,7 @@ typedef enum kCCVerticalTextAlignmentBottom, } CCVerticalTextAlignment; -// XXX: If any of these enums are edited and/or reordered, udpate CCTexture2D.m +// XXX: If any of these enums are edited and/or reordered, update CCTexture2D.m //! Horizontal text alignment type typedef enum { @@ -355,7 +378,7 @@ typedef enum kCCTextAlignmentRight, } CCTextAlignment; -// XXX: If any of these enums are edited and/or reordered, udpate CCTexture2D.m +// XXX: If any of these enums are edited and/or reordered, update CCTexture2D.m //! Line break modes typedef enum { kCCLineBreakModeWordWrap, @@ -368,7 +391,162 @@ typedef enum { //! delta time type //! if you want more resolution redefine it as a double -typedef float ccTime; +typedef CGFloat ccTime; //typedef double ccTime; typedef float ccMat4[16]; + +/* +typedef struct _ccFontShadow +{ + // true if shadow enabled + bool m_shadowEnabled; + // shadow x and y offset + CGSize m_shadowOffset; + // shadow blurrines + float m_shadowBlur; + // shadow opacity + float m_shadowOpacity; + +} ccFontShadow; + +typedef struct _ccFontStroke +{ + // true if stroke enabled + bool m_strokeEnabled; + // stroke color + ccColor3B m_strokeColor; + // stroke size + float m_strokeSize; + +} ccFontStroke; + */ + +/* +typedef struct _ccFontDefinition +{ + // font name + NSString *m_fontName; + // font size + int m_fontSize; + // horizontal alignment + CCTextAlignment m_alignment; + // vertical alignment + CCVerticalTextAlignment m_vertAlignment; + // line break mode + CCLineBreakMode m_lineBreakMode; + // renering box + CGSize m_dimensions; + // font color + ccColor3B m_fontFillColor; + // font shadow + ccFontShadow m_shadow; + // font stroke + ccFontStroke m_stroke; + +} ccFontDefinition; +*/ + +enum +{ + //! Position is set in points (this is the default) + kCCPositionUnitPoints, + + //! Position is scaled by the global positionScaleFactor (as defined by CCDirector) + kCCPositionUnitScaled, + + //! Position is a normalized value multiplied by the content size of the parent's container + kCCPositionUnitNormalized, + +}; +typedef unsigned char CCPositionUnit; + +enum +{ + //! Content size is set in points (this is the default) + kCCContentSizeUnitPoints, + + //! Content size is scaled by the global positionScaleFactor (as defined by CCDirector) + kCCContentSizeUnitScaled, + + //! Content size is a normalized value multiplied by the content size of the parent's container + kCCContentSizeUnitNormalized, + + //! Content size is the size of the parents container inset by the supplied value + kCCContentSizeUnitInsetPoints, + + //! Content size is the size of the parents container inset by the supplied value multiplied by the positionScaleFactor (as defined by CCDirector) + kCCContentSizeUnitInsetScaled, + +}; +typedef unsigned char CCContentSizeUnit; + +enum +{ + //! Position is relative to the bottom left corner of the parent container (this is the default) + kCCPositionReferenceCornerBottomLeft, + + //! Position is relative to the top left corner of the parent container + kCCPositionReferenceCornerTopLeft, + + //! Position is relative to the top right corner of the parent container + kCCPositionReferenceCornerTopRight, + + //! Position is relative to the bottom right corner of the parent container + kCCPositionReferenceCornerBottomRight, + +}; +typedef unsigned char CCPositionReferenceCorner; + +typedef struct _CCPositionType +{ + CCPositionUnit xUnit; + CCPositionUnit yUnit; + CCPositionReferenceCorner corner; +} CCPositionType; + +typedef struct _CCContentSizeType +{ + CCContentSizeUnit widthUnit; + CCContentSizeUnit heightUnit; +} CCContentSizeType; + +//! helper that creates a CCPositionType type +static inline CCPositionType CCPositionTypeMake(CCPositionUnit xUnit, CCPositionUnit yUnit, CCPositionReferenceCorner corner) +{ + CCPositionType pt; + pt.xUnit = xUnit; + pt.yUnit = yUnit; + pt.corner = corner; + return pt; +} + +//! helper that creates a CCContentSizeType type +static inline CCContentSizeType CCContentSizeTypeMake(CCContentSizeUnit widthUnit, CCContentSizeUnit heightUnit) +{ + CCContentSizeType cst; + cst.widthUnit = widthUnit; + cst.heightUnit = heightUnit; + return cst; +} + +#define kCCPositionTypePoints CCPositionTypeMake(kCCPositionUnitPoints, kCCPositionUnitPoints, kCCPositionReferenceCornerBottomLeft) + +#define kCCPositionTypeScaled CCPositionTypeMake(kCCPositionUnitScaled, kCCPositionUnitScaled, kCCPositionReferenceCornerBottomLeft) + +#define kCCPositionTypeNormalized CCPositionTypeMake(kCCPositionUnitNormalized, kCCPositionUnitNormalized, kCCPositionReferenceCornerBottomLeft) + + +#define kCCContentSizeTypePoints CCContentSizeTypeMake(kCCContentSizeUnitPoints, kCCContentSizeUnitPoints) +#define kCCContentSizeTypeScaled CCContentSizeTypeMake(kCCContentSizeUnitScaled, kCCContentSizeUnitScaled) +#define kCCContentSizeTypeNormalized CCContentSizeTypeMake(kCCContentSizeUnitNormalized, kCCContentSizeUnitNormalized) + +typedef enum { + kCCScaleTypePoints, + kCCScaleTypeScaled, +} CCScaleType; + +#ifdef __cplusplus +} +#endif + diff --git a/include/cocos2d/cocos2d.h b/include/cocos2d/cocos2d.h index 11b97c2..22290c5 100644 --- a/include/cocos2d/cocos2d.h +++ b/include/cocos2d/cocos2d.h @@ -34,13 +34,13 @@ * *
    * - * @todo A native english speaker should check the grammar. We need your help! + * @todo A native English speaker should check the grammar. We need your help! * */ // 0x00 HI ME LO -// 00 02 00 00 -#define COCOS2D_VERSION 0x00020000 +// 00 02 05 00 +#define COCOS2D_VERSION 0x00020500 // @@ -53,7 +53,6 @@ #import "CCActionInstant.h" #import "CCActionInterval.h" #import "CCActionEase.h" -#import "CCActionCamera.h" #import "CCActionTween.h" #import "CCActionEase.h" #import "CCActionTiledGrid.h" @@ -69,6 +68,7 @@ #import "CCSpriteFrame.h" #import "CCSpriteBatchNode.h" #import "CCSpriteFrameCache.h" +#import "CCSprite9Slice.h" #import "CCLabelTTF.h" #import "CCLabelBMFont.h" @@ -76,6 +76,7 @@ #import "CCParticleSystem.h" #import "CCParticleSystemQuad.h" +#import "CCParticleExamples.h" #import "CCParticleBatchNode.h" #import "CCTexture2D.h" @@ -84,8 +85,6 @@ #import "CCTextureAtlas.h" #import "CCTransition.h" -#import "CCTransitionPageTurn.h" -#import "CCTransitionProgress.h" #import "CCTMXTiledMap.h" #import "CCTMXLayer.h" @@ -99,7 +98,6 @@ #import "CCDrawingPrimitives.h" #import "CCScene.h" #import "CCScheduler.h" -#import "CCCamera.h" #import "CCProtocols.h" #import "CCNode.h" #import "CCNode+Debug.h" @@ -111,6 +109,10 @@ #import "CCRenderTexture.h" #import "CCMotionStreak.h" #import "CCConfiguration.h" +#import "CCDrawNode.h" +#import "CCClippingNode.h" + +#import "ccFPSImages.h" // Shaders #import "CCGLProgram.h" @@ -118,6 +120,11 @@ #import "CCShaderCache.h" #import "ccShaders.h" +// Physics +#import "CCPhysicsBody.h" +#import "CCPhysicsJoint.h" +#import "CCPhysicsNode.h" + // // cocos2d macros // @@ -134,17 +141,14 @@ #import "Platforms/CCNS.h" #ifdef __CC_PLATFORM_IOS -#import "Platforms/iOS/CCTouchDispatcher.h" -#import "Platforms/iOS/CCTouchDelegateProtocol.h" -#import "Platforms/iOS/CCTouchHandler.h" #import "Platforms/iOS/CCGLView.h" #import "Platforms/iOS/CCDirectorIOS.h" +#import "Platforms/iOS/UITouch+CC.h" #elif defined(__CC_PLATFORM_MAC) #import "Platforms/Mac/CCGLView.h" #import "Platforms/Mac/CCDirectorMac.h" #import "Platforms/Mac/CCWindow.h" -#import "Platforms/Mac/CCEventDispatcher.h" #endif // @@ -153,23 +157,36 @@ #import "Support/OpenGL_Internal.h" #import "Support/CCFileUtils.h" #import "Support/CGPointExtension.h" -#import "Support/ccCArray.h" -#import "Support/CCArray.h" #import "Support/ccUtils.h" #import "Support/TransformUtils.h" #import "Support/CCProfiling.h" +#import "Support/NSThread+performBlock.h" +#import "Support/uthash.h" +#import "Support/utlist.h" // // external // +#pragma clang diagnostic push COCOS2D +#pragma clang diagnostic ignored "-Wignored-qualifiers" #import "kazmath/kazmath.h" #import "kazmath/GL/matrix.h" +#pragma clang diagnostic pop COCOS2D +#ifdef __cplusplus +extern "C" { +#endif // free functions NSString * cocos2dVersion(void); +extern const char * cocos2d_version; + +#ifdef __cplusplus +} +#endif + #ifdef __CC_PLATFORM_IOS #ifndef __IPHONE_4_0 #error "If you are targeting iPad, you should set BASE SDK = 4.0 (or 4.1, or 4.2), and set the 'iOS deploy target' = 3.2" diff --git a/include/libpng/ANNOUNCE b/include/libpng/ANNOUNCE new file mode 100644 index 0000000..5fab72a --- /dev/null +++ b/include/libpng/ANNOUNCE @@ -0,0 +1,55 @@ + +Libpng 1.2.49 - March 29, 2012 + +This is a public release of libpng, intended for use in production codes. + +Files available for download: + +Source files with LF line endings (for Unix/Linux) and with a +"configure" script + + libpng-1.2.49.tar.xz (LZMA-compressed, recommended) + libpng-1.2.49.tar.gz + libpng-1.2.49.tar.bz2 + +Source files with LF line endings (for Unix/Linux) without the +"configure" script + + libpng-1.2.49-no-config.tar.xz (LZMA-compressed, recommended) + libpng-1.2.49-no-config.tar.gz + libpng-1.2.49-no-config.tar.bz2 + +Source files with CRLF line endings (for Windows), without the +"configure" script + + lpng1249.zip + lpng1249.7z + lpng1249.tar.bz2 + +Project files + + libpng-1.2.49-project-netware.zip + libpng-1.2.49-project-wince.zip + +Other information: + + libpng-1.2.49-README.txt + libpng-1.2.49-KNOWNBUGS.txt + libpng-1.2.49-LICENSE.txt + libpng-1.2.49-Y2K-compliance.txt + libpng-1.2.49-[previous version]-diff.txt + +Changes since the last public release (1.2.48): + +version 1.2.49 [March 29, 2012] + + Revised png_set_text_2() to avoid potential memory corruption (fixes + CVE-2011-3048). + Prevent PNG_EXPAND+PNG_SHIFT doing the shift twice. + +Send comments/corrections/commendations to png-mng-implement at lists.sf.net +(subscription required; visit +https://lists.sourceforge.net/lists/listinfo/png-mng-implement +to subscribe) or to glennrp at users.sourceforge.net + +Glenn R-P diff --git a/include/libpng/CHANGES b/include/libpng/CHANGES new file mode 100644 index 0000000..ad90e51 --- /dev/null +++ b/include/libpng/CHANGES @@ -0,0 +1,2785 @@ +#if 0 +CHANGES - changes for libpng + +version 0.2 + added reader into png.h + fixed small problems in stub file + +version 0.3 + added pull reader + split up pngwrite.c to several files + added pnglib.txt + added example.c + cleaned up writer, adding a few new transformations + fixed some bugs in writer + interfaced with zlib 0.5 + added K&R support + added check for 64 KB blocks for 16 bit machines + +version 0.4 + cleaned up code and commented code + simplified time handling into png_time + created png_color_16 and png_color_8 to handle color needs + cleaned up color type defines + fixed various bugs + made various names more consistent + interfaced with zlib 0.71 + cleaned up zTXt reader and writer (using zlib's Reset functions) + split transformations into pngrtran.c and pngwtran.c + +version 0.5 + interfaced with zlib 0.8 + fixed many reading and writing bugs + saved using 3 spaces instead of tabs + +version 0.6 + added png_large_malloc() and png_large_free() + added png_size_t + cleaned up some compiler warnings + added png_start_read_image() + +version 0.7 + cleaned up lots of bugs + finished dithering and other stuff + added test program + changed name from pnglib to libpng + +version 0.71 [June, 1995] + changed pngtest.png for zlib 0.93 + fixed error in libpng.txt and example.c + +version 0.8 + cleaned up some bugs + added png_set_filler() + split up pngstub.c into pngmem.c, pngio.c, and pngerror.c + added #define's to remove unwanted code + moved png_info_init() to png.c + added old_size into png_realloc() + added functions to manually set filtering and compression info + changed compression parameters based on image type + optimized filter selection code + added version info + changed external functions passing floats to doubles (k&r problems?) + put all the configurable stuff in pngconf.h + enabled png_set_shift to work with paletted images on read + added png_read_update_info() - updates info structure with + transformations + +version 0.81 [August, 1995] + incorporated Tim Wegner's medium model code (thanks, Tim) + +version 0.82 [September, 1995] + [unspecified changes] + +version 0.85 [December, 1995] + added more medium model code (almost everything's a far) + added i/o, error, and memory callback functions + fixed some bugs (16 bit, 4 bit interlaced, etc.) + added first run progressive reader (barely tested) + +version 0.86 [January, 1996] + fixed bugs + improved documentation + +version 0.87 [January, 1996] + fixed medium model bugs + fixed other bugs introduced in 0.85 and 0.86 + added some minor documentation + +version 0.88 [January, 1996] + fixed progressive bugs + replaced tabs with spaces + cleaned up documentation + added callbacks for read/write and warning/error functions + +version 0.89 [July, 1996] + added new initialization API to make libpng work better with shared libs + we now have png_create_read_struct(), png_create_write_struct(), + png_create_info_struct(), png_destroy_read_struct(), and + png_destroy_write_struct() instead of the separate calls to + malloc and png_read_init(), png_info_init(), and png_write_init() + changed warning/error callback functions to fix bug - this means you + should use the new initialization API if you were using the old + png_set_message_fn() calls, and that the old API no longer exists + so that people are aware that they need to change their code + changed filter selection API to allow selection of multiple filters + since it didn't work in previous versions of libpng anyways + optimized filter selection code + fixed png_set_background() to allow using an arbitrary RGB color for + paletted images + fixed gamma and background correction for paletted images, so + png_correct_palette is not needed unless you are correcting an + external palette (you will need to #define PNG_CORRECT_PALETTE_SUPPORTED + in pngconf.h) - if nobody uses this, it may disappear in the future. + fixed bug with Borland 64K memory allocation (Alexander Lehmann) + fixed bug in interlace handling (Smarasderagd, I think) + added more error checking for writing and image to reduce invalid files + separated read and write functions so that they won't both be linked + into a binary when only reading or writing functionality is used + new pngtest image also has interlacing and zTXt + updated documentation to reflect new API + +version 0.90 [January, 1997] + made CRC errors/warnings on critical and ancillary chunks configurable + libpng will use the zlib CRC routines by (compile-time) default + changed DOS small/medium model memory support - needs zlib 1.04 (Tim Wegner) + added external C++ wrapper statements to png.h (Gilles Dauphin) + allow PNG file to be read when some or all of file signature has already + been read from the beginning of the stream. ****This affects the size + of info_struct and invalidates all programs that use a shared libpng**** + fixed png_filler() declarations + fixed? background color conversions + fixed order of error function pointers to match documentation + current chunk name is now available in png_struct to reduce the number + of nearly identical error messages (will simplify multi-lingual + support when available) + try to get ready for unknown-chunk callback functions: + - previously read critical chunks are flagged, so the chunk handling + routines can determine if the chunk is in the right place + - all chunk handling routines have the same prototypes, so we will + be able to handle all chunks via a callback mechanism + try to fix Linux "setjmp" buffer size problems + removed png_large_malloc, png_large_free, and png_realloc functions. + +version 0.95 [March, 1997] + fixed bug in pngwutil.c allocating "up_row" twice and "avg_row" never + fixed bug in PNG file signature compares when start != 0 + changed parameter type of png_set_filler(...filler...) from png_byte + to png_uint_32 + added test for MACOS to ensure that both math.h and fp.h are not #included + added macros for libpng to be compiled as a Windows DLL (Andreas Kupries) + added "packswap" transformation, which changes the endianness of + packed-pixel bytes (Kevin Bracey) + added "strip_alpha" transformation, which removes the alpha channel of + input images without using it (not necessarily a good idea) + added "swap_alpha" transformation, which puts the alpha channel in front + of the color bytes instead of after + removed all implicit variable tests which assume NULL == 0 (I think) + changed several variables to "png_size_t" to show 16/32-bit limitations + added new pCAL chunk read/write support + added experimental filter selection weighting (Greg Roelofs) + removed old png_set_rgbx() and png_set_xrgb() functions that have been + obsolete for about 2 years now (use png_set_filler() instead) + added macros to read 16- and 32-bit ints directly from buffer, to be + used only on those systems that support it (namely PowerPC and 680x0) + With some testing, this may become the default for MACOS/PPC systems. + only calculate CRC on data if we are going to use it + added macros for zTXt compression type PNG_zTXt_COMPRESSION_??? + added macros for simple libpng debugging output selectable at compile time + removed PNG_READ_END_MODE in progressive reader (Smarasderagd) + more description of info_struct in libpng.txt and png.h + more instructions in example.c + more chunk types tested in pngtest.c + renamed pngrcb.c to pngset.c, and all png_read_ functions to be + png_set_. We now have corresponding png_get_ + functions in pngget.c to get information in info_ptr. This isolates + the application from the internal organization of png_info_struct + (good for shared library implementations). + +version 0.96 [May, 1997] + fixed serious bug with < 8bpp images introduced in 0.95 + fixed 256-color transparency bug (Greg Roelofs) + fixed up documentation (Greg Roelofs, Laszlo Nyul) + fixed "error" in pngconf.h for Linux setjmp() behaviour + fixed DOS medium model support (Tim Wegner) + fixed png_check_keyword() for case with error in static string text + added read of CRC after IEND chunk for embedded PNGs (Laszlo Nyul) + added typecasts to quiet compiler errors + added more debugging info + +version 0.97 [January, 1998] + removed PNG_USE_OWN_CRC capability + relocated png_set_crc_action from pngrutil.c to pngrtran.c + fixed typecasts of "new_key", etc. (Andreas Dilger) + added RFC 1152 [sic] date support + fixed bug in gamma handling of 4-bit grayscale + added 2-bit grayscale gamma handling (Glenn R-P) + added more typecasts. 65536L becomes (png_uint_32)65536L, etc. (Glenn R-P) + minor corrections in libpng.txt + added simple sRGB support (Glenn R-P) + easier conditional compiling, e.g. define PNG_READ/WRITE_NOT_FULLY_SUPPORTED; + all configurable options can be selected from command-line instead + of having to edit pngconf.h (Glenn R-P) + fixed memory leak in pngwrite.c (free info_ptr->text) (Glenn R-P) + added more conditions for png_do_background, to avoid changing + black pixels to background when a background is supplied and + no pixels are transparent + repaired PNG_NO_STDIO behaviour + tested NODIV support and made it default behaviour (Greg Roelofs) + added "-m" option and PNGTEST_DEBUG_MEMORY to pngtest (John Bowler) + regularized version numbering scheme and bumped shared-library major + version number to 2 to avoid problems with libpng 0.89 apps (Greg Roelofs) + +version 0.98 [January, 1998] + cleaned up some typos in libpng.txt and in code documentation + fixed memory leaks in pCAL chunk processing (Glenn R-P and John Bowler) + cosmetic change "display_gamma" to "screen_gamma" in pngrtran.c + changed recommendation about file_gamma for PC images to .51 from .45, + in example.c and libpng.txt, added comments to distinguish between + screen_gamma, viewing_gamma, and display_gamma. + changed all references to RFC1152 to read RFC1123 and changed the + PNG_TIME_RFC1152_SUPPORTED macro to PNG_TIME_RFC1123_SUPPORTED + added png_invert_alpha capability (Glenn R-P -- suggestion by Jon Vincent) + changed srgb_intent from png_byte to int to avoid compiler bugs + +version 0.99 [January 30, 1998] + free info_ptr->text instead of end_info_ptr->text in pngread.c (John Bowler) + fixed a longstanding "packswap" bug in pngtrans.c + fixed some inconsistencies in pngconf.h that prevented compiling with + PNG_READ_GAMMA_SUPPORTED and PNG_READ_hIST_SUPPORTED undefined + fixed some typos and made other minor rearrangement of libpng.txt (Andreas) + changed recommendation about file_gamma for PC images to .50 from .51 in + example.c and libpng.txt, and changed file_gamma for sRGB images to .45 + added a number of functions to access information from the png structure + png_get_image_height(), etc. (Glenn R-P, suggestion by Brad Pettit) + added TARGET_MACOS similar to zlib-1.0.8 + define PNG_ALWAYS_EXTERN when __MWERKS__ && WIN32 are defined + added type casting to all png_malloc() function calls +version 0.99a [January 31, 1998] + Added type casts and parentheses to all returns that return a value.(Tim W.) +version 0.99b [February 4, 1998] + Added type cast png_uint_32 on malloc function calls where needed. + Changed type of num_hist from png_uint_32 to int (same as num_palette). + Added checks for rowbytes overflow, in case png_size_t is less than 32 bits. + Renamed makefile.elf to makefile.lnx. +version 0.99c [February 7, 1998] + More type casting. Removed erroneous overflow test in pngmem.c. + Added png_buffered_memcpy() and png_buffered_memset(), apply them to rowbytes. + Added UNIX manual pages libpng.3 (incorporating libpng.txt) and png.5. +version 0.99d [February 11, 1998] + Renamed "far_to_near()" "png_far_to_near()" + Revised libpng.3 + Version 99c "buffered" operations didn't work as intended. Replaced them + with png_memcpy_check() and png_memset_check(). + Added many "if (png_ptr == NULL) return" to quell compiler warnings about + unused png_ptr, mostly in pngget.c and pngset.c. + Check for overlength tRNS chunk present when indexed-color PLTE is read. + Cleaned up spelling errors in libpng.3/libpng.txt + Corrected a problem with png_get_tRNS() which returned undefined trans array +version 0.99e [February 28, 1998] + Corrected png_get_tRNS() again. + Add parentheses for easier reading of pngget.c, fixed "||" should be "&&". + Touched up example.c to make more of it compileable, although the entire + file still can't be compiled (Willem van Schaik) + Fixed a bug in png_do_shift() (Bryan Tsai) + Added a space in png.h prototype for png_write_chunk_start() + Replaced pngtest.png with one created with zlib 1.1.1 + Changed pngtest to report PASS even when file size is different (Jean-loup G.) + Corrected some logic errors in png_do_invert_alpha() (Chris Patterson) +version 0.99f [March 5, 1998] + Corrected a bug in pngpread() introduced in version 99c (Kevin Bracey) + Moved makefiles into a "scripts" directory, and added INSTALL instruction file + Added makefile.os2 and pngos2.def (A. Zabolotny) and makefile.s2x (W. Sebok) + Added pointers to "note on libpng versions" in makefile.lnx and README + Added row callback feature when reading and writing nonprogressive rows + and added a test of this feature in pngtest.c + Added user transform callbacks, with test of the feature in pngtest.c +version 0.99g [March 6, 1998, morning] + Minor changes to pngtest.c to suppress compiler warnings. + Removed "beta" language from documentation. +version 0.99h [March 6, 1998, evening] + Minor changes to previous minor changes to pngtest.c + Changed PNG_READ_NOT_FULLY_SUPPORTED to PNG_READ_TRANSFORMS_NOT_SUPPORTED + and added PNG_PROGRESSIVE_READ_NOT_SUPPORTED macro + Added user transform capability + +version 1.00 [March 7, 1998] + Changed several typedefs in pngrutil.c + Added makefile.wat (Pawel Mrochen), updated makefile.tc3 (Willem van Schaik) + replaced "while(1)" with "for(;;)" + added PNGARG() to prototypes in pngtest.c and removed some prototypes + updated some of the makefiles (Tom Lane) + changed some typedefs (s_start, etc.) in pngrutil.c + fixed dimensions of "short_months" array in pngwrite.c + Replaced ansi2knr.c with the one from jpeg-v6 + +version 1.0.0 [March 8, 1998] + Changed name from 1.00 to 1.0.0 (Adam Costello) + Added smakefile.ppc (with SCOPTIONS.ppc) for Amiga PPC (Andreas Kleinert) +version 1.0.0a [March 9, 1998] + Fixed three bugs in pngrtran.c to make gamma+background handling consistent + (Greg Roelofs) + Changed format of the PNG_LIBPNG_VER integer to xyyzz instead of xyz + for major, minor, and bugfix releases. This is 10001. (Adam Costello, + Tom Lane) + Make months range from 1-12 in png_convert_to_rfc1123 +version 1.0.0b [March 13, 1998] + Quieted compiler complaints about two empty "for" loops in pngrutil.c + Minor changes to makefile.s2x + Removed #ifdef/#endif around a png_free() in pngread.c + +version 1.0.1 [March 14, 1998] + Changed makefile.s2x to reduce security risk of using a relative pathname + Fixed some typos in the documentation (Greg). + Fixed a problem with value of "channels" returned by png_read_update_info() +version 1.0.1a [April 21, 1998] + Optimized Paeth calculations by replacing abs() function calls with intrinsics + plus other loop optimizations. Improves avg decoding speed by about 20%. + Commented out i386istic "align" compiler flags in makefile.lnx. + Reduced the default warning level in some makefiles, to make them consistent. + Removed references to IJG and JPEG in the ansi2knr.c copyright statement. + Fixed a bug in png_do_strip_filler with XXRRGGBB => RRGGBB transformation. + Added grayscale and 16-bit capability to png_do_read_filler(). + Fixed a bug in pngset.c, introduced in version 0.99c, that sets rowbytes + too large when writing an image with bit_depth < 8 (Bob Dellaca). + Corrected some bugs in the experimental weighted filtering heuristics. + Moved a misplaced pngrutil code block that truncates tRNS if it has more + than num_palette entries -- test was done before num_palette was defined. + Fixed a png_convert_to_rfc1123() bug that converts day 31 to 0 (Steve Eddins). + Changed compiler flags in makefile.wat for better optimization (Pawel Mrochen). +version 1.0.1b [May 2, 1998] + Relocated png_do_gray_to_rgb() within png_do_read_transformations() (Greg). + Relocated the png_composite macros from pngrtran.c to png.h (Greg). + Added makefile.sco (contributed by Mike Hopkirk). + Fixed two bugs (missing definitions of "istop") introduced in libpng-1.0.1a. + Fixed a bug in pngrtran.c that would set channels=5 under some circumstances. + More work on the Paeth-filtering, achieving imperceptible speedup (A Kleinert). + More work on loop optimization which may help when compiled with C++ compilers. + Added warnings when people try to use transforms they've defined out. + Collapsed 4 "i" and "c" loops into single "i" loops in pngrtran and pngwtran. + Revised paragraph about png_set_expand() in libpng.txt and libpng.3 (Greg) +version 1.0.1c [May 11, 1998] + Fixed a bug in pngrtran.c (introduced in libpng-1.0.1a) where the masks for + filler bytes should have been 0xff instead of 0xf. + Added max_pixel_depth=32 in pngrutil.c when using FILLER with palette images. + Moved PNG_WRITE_WEIGHTED_FILTER_SUPPORTED and PNG_WRITE_FLUSH_SUPPORTED + out of the PNG_WRITE_TRANSFORMS_NOT_SUPPORTED block of pngconf.h + Added "PNG_NO_WRITE_TRANSFORMS" etc., as alternatives for *_NOT_SUPPORTED, + for consistency, in pngconf.h + Added individual "ifndef PNG_NO_[CAPABILITY]" in pngconf.h to make it easier + to remove unwanted capabilities via the compile line + Made some corrections to grammar (which, it's) in documentation (Greg). + Corrected example.c, use of row_pointers in png_write_image(). +version 1.0.1d [May 24, 1998] + Corrected several statements that used side effects illegally in pngrutil.c + and pngtrans.c, that were introduced in version 1.0.1b + Revised png_read_rows() to avoid repeated if-testing for NULL (A Kleinert) + More corrections to example.c, use of row_pointers in png_write_image() + and png_read_rows(). + Added pngdll.mak and pngdef.pas to scripts directory, contributed by + Bob Dellaca, to make a png32bd.dll with Borland C++ 4.5 + Fixed error in example.c with png_set_text: num_text is 3, not 2 (Guido V.) + Changed several loops from count-down to count-up, for consistency. +version 1.0.1e [June 6, 1998] + Revised libpng.txt and libpng.3 description of png_set_read|write_fn(), and + added warnings when people try to set png_read_fn and png_write_fn in + the same structure. + Added a test such that png_do_gamma will be done when num_trans==0 + for truecolor images that have defined a background. This corrects an + error that was introduced in libpng-0.90 that can cause gamma processing + to be skipped. + Added tests in png.h to include "trans" and "trans_values" in structures + when PNG_READ_BACKGROUND_SUPPORTED or PNG_READ_EXPAND_SUPPORTED is defined. + Add png_free(png_ptr->time_buffer) in png_destroy_read_struct() + Moved png_convert_to_rfc_1123() from pngwrite.c to png.c + Added capability for user-provided malloc_fn() and free_fn() functions, + and revised pngtest.c to demonstrate their use, replacing the + PNGTEST_DEBUG_MEM feature. + Added makefile.w32, for Microsoft C++ 4.0 and later (Tim Wegner). + +version 1.0.2 [June 14, 1998] + Fixed two bugs in makefile.bor . +version 1.0.2a [December 30, 1998] + Replaced and extended code that was removed from png_set_filler() in 1.0.1a. + Fixed a bug in png_do_filler() that made it fail to write filler bytes in + the left-most pixel of each row (Kevin Bracey). + Changed "static pngcharp tIME_string" to "static char tIME_string[30]" + in pngtest.c (Duncan Simpson). + Fixed a bug in pngtest.c that caused pngtest to try to write a tIME chunk + even when no tIME chunk was present in the source file. + Fixed a problem in pngrutil.c: gray_to_rgb didn't always work with 16-bit. + Fixed a problem in png_read_push_finish_row(), which would not skip some + passes that it should skip, for images that are less than 3 pixels high. + Interchanged the order of calls to png_do_swap() and png_do_shift() + in pngwtran.c (John Cromer). + Added #ifdef PNG_DEBUG/#endif surrounding use of PNG_DEBUG in png.h . + Changed "bad adaptive filter type" from error to warning in pngrutil.c . + Fixed a documentation error about default filtering with 8-bit indexed-color. + Separated the PNG_NO_STDIO macro into PNG_NO_STDIO and PNG_NO_CONSOLE_IO + (L. Peter Deutsch). + Added png_set_rgb_to_gray() and png_get_rgb_to_gray_status() functions. + Added png_get_copyright() and png_get_header_version() functions. + Revised comments on png_set_progressive_read_fn() in libpng.txt and example.c + Added information about debugging in libpng.txt and libpng.3 . + Changed "ln -sf" to "ln -s -f" in makefile.s2x, makefile.lnx, and makefile.sco. + Removed lines after Dynamic Dependencies" in makefile.aco . + Revised makefile.dec to make a shared library (Jeremie Petit). + Removed trailing blanks from all files. +version 1.0.2a [January 6, 1999] + Removed misplaced #endif and #ifdef PNG_NO_EXTERN near the end of png.h + Added "if" tests to silence complaints about unused png_ptr in png.h and png.c + Changed "check_if_png" function in example.c to return true (nonzero) if PNG. + Changed libpng.txt to demonstrate png_sig_cmp() instead of png_check_sig() + which is obsolete. + +version 1.0.3 [January 14, 1999] + Added makefile.hux, for Hewlett Packard HPUX 10.20 and 11.00 (Jim Rice) + Added a statement of Y2K compliance in png.h, libpng.3, and Y2KINFO. +version 1.0.3a [August 12, 1999] + Added check for PNG_READ_INTERLACE_SUPPORTED in pngread.c; issue a warning + if an attempt is made to read an interlaced image when it's not supported. + Added check if png_ptr->trans is defined before freeing it in pngread.c + Modified the Y2K statement to include versions back to version 0.71 + Fixed a bug in the check for valid IHDR bit_depth/color_types in pngrutil.c + Modified makefile.wat (added -zp8 flag, ".symbolic", changed some comments) + Replaced leading blanks with tab characters in makefile.hux + Changed "dworkin.wustl.edu" to "ccrc.wustl.edu" in various documents. + Changed (float)red and (float)green to (double)red, (double)green + in png_set_rgb_to_gray() to avoid "promotion" problems in AIX. + Fixed a bug in pngconf.h that omitted when PNG_DEBUG==0 (K Bracey). + Reformatted libpng.3 and libpngpf.3 with proper fonts (script by J. vanZandt). + Updated documentation to refer to the PNG-1.2 specification. + Removed ansi2knr.c and left pointers to the latest source for ansi2knr.c + in makefile.knr, INSTALL, and README (L. Peter Deutsch) + Fixed bugs in calculation of the length of rowbytes when adding alpha + channels to 16-bit images, in pngrtran.c (Chris Nokleberg) + Added function png_set_user_transform_info() to store user_transform_ptr, + user_depth, and user_channels into the png_struct, and a function + png_get_user_transform_ptr() to retrieve the pointer (Chris Nokleberg) + Added function png_set_empty_plte_permitted() to make libpng useable + in MNG applications. + Corrected the typedef for png_free_ptr in png.h (Jesse Jones). + Correct gamma with srgb is 45455 instead of 45000 in pngrutil.c, to be + consistent with PNG-1.2, and allow variance of 500 before complaining. + Added assembler code contributed by Intel in file pngvcrd.c and modified + makefile.w32 to use it (Nirav Chhatrapati, INTEL Corporation, Gilles Vollant) + Changed "ln -s -f" to "ln -f -s" in the makefiles to make Solaris happy. + Added some aliases for png_set_expand() in pngrtran.c, namely + png_set_expand_PLTE(), png_set_expand_depth(), and png_set_expand_tRNS() + (Greg Roelofs, in "PNG: The Definitive Guide"). + Added makefile.beo for BEOS on X86, contributed by Sander Stok. +version 1.0.3b [August 26, 1999] + Replaced 2147483647L several places with PNG_MAX_UINT macro, defined in png.h + Changed leading blanks to tabs in all makefiles. + Define PNG_USE_PNGVCRD in makefile.w32, to get MMX assembler code. + Made alternate versions of png_set_expand() in pngrtran.c, namely + png_set_gray_1_2_4_to_8, png_set_palette_to_rgb, and png_set_tRNS_to_alpha + (Greg Roelofs, in "PNG: The Definitive Guide"). Deleted the 1.0.3a aliases. + Relocated start of 'extern "C"' block in png.h so it doesn't include pngconf.h + Revised calculation of num_blocks in pngmem.c to avoid a potentially + negative shift distance, whose results are undefined in the C language. + Added a check in pngset.c to prevent writing multiple tIME chunks. + Added a check in pngwrite.c to detect invalid small window_bits sizes. +version 1.0.3d [September 4, 1999] + Fixed type casting of igamma in pngrutil.c + Added new png_expand functions to scripts/pngdef.pas and pngos2.def + Added a demo read_user_transform_fn that examines the row filters in pngtest.c + +version 1.0.4 [September 24, 1999] + Define PNG_ALWAYS_EXTERN in pngconf.h if __STDC__ is defined + Delete #define PNG_INTERNAL and include "png.h" from pngasmrd.h + Made several minor corrections to pngtest.c + Renamed the makefiles with longer but more user friendly extensions. + Copied the PNG copyright and license to a separate LICENSE file. + Revised documentation, png.h, and example.c to remove reference to + "viewing_gamma" which no longer appears in the PNG specification. + Revised pngvcrd.c to use MMX code for interlacing only on the final pass. + Updated pngvcrd.c to use the faster C filter algorithms from libpng-1.0.1a + Split makefile.win32vc into two versions, makefile.vcawin32 (uses MMX + assembler code) and makefile.vcwin32 (doesn't). + Added a CPU timing report to pngtest.c (enabled by defining PNGTEST_TIMING) + Added a copy of pngnow.png to the distribution. +version 1.0.4a [September 25, 1999] + Increase max_pixel_depth in pngrutil.c if a user transform needs it. + Changed several division operations to right-shifts in pngvcrd.c +version 1.0.4b [September 30, 1999] + Added parentheses in line 3732 of pngvcrd.c + Added a comment in makefile.linux warning about buggy -O3 in pgcc 2.95.1 +version 1.0.4c [October 1, 1999] + Added a "png_check_version" function in png.c and pngtest.c that will generate + a helpful compiler error if an old png.h is found in the search path. + Changed type of png_user_transform_depth|channels from int to png_byte. +version 1.0.4d [October 6, 1999] + Changed 0.45 to 0.45455 in png_set_sRGB() + Removed unused PLTE entries from pngnow.png + Re-enabled some parts of pngvcrd.c (png_combine_row) that work properly. +version 1.0.4e [October 10, 1999] + Fixed sign error in pngvcrd.c (Greg Roelofs) + Replaced some instances of memcpy with simple assignments in pngvcrd (GR-P) +version 1.0.4f [October 15, 1999] + Surrounded example.c code with #if 0 .. #endif to prevent people from + inadvertently trying to compile it. + Changed png_get_header_version() from a function to a macro in png.h + Added type casting mostly in pngrtran.c and pngwtran.c + Removed some pointless "ptr = NULL" in pngmem.c + Added a "contrib" directory containing the source code from Greg's book. + +version 1.0.5 [October 15, 1999] + Minor editing of the INSTALL and README files. +version 1.0.5a [October 23, 1999] + Added contrib/pngsuite and contrib/pngminus (Willem van Schaik) + Fixed a typo in the png_set_sRGB() function call in example.c (Jan Nijtmans) + Further optimization and bugfix of pngvcrd.c + Revised pngset.c so that it does not allocate or free memory in the user's + text_ptr structure. Instead, it makes its own copy. + Created separate write_end_info_struct in pngtest.c for a more severe test. + Added code in pngwrite.c to free info_ptr->text[i].key to stop a memory leak. +version 1.0.5b [November 23, 1999] + Moved PNG_FLAG_HAVE_CHUNK_HEADER, PNG_FLAG_BACKGROUND_IS_GRAY and + PNG_FLAG_WROTE_tIME from flags to mode. + Added png_write_info_before_PLTE() function. + Fixed some typecasting in contrib/gregbook/*.c + Updated scripts/makevms.com and added makevms.com to contrib/gregbook + and contrib/pngminus (Martin Zinser) +version 1.0.5c [November 26, 1999] + Moved png_get_header_version from png.h to png.c, to accommodate ansi2knr. + Removed all global arrays (according to PNG_NO_GLOBAL_ARRAYS macro), to + accommodate making DLL's: Moved usr_png_ver from global variable to function + png_get_header_ver() in png.c. Moved png_sig to png_sig_bytes in png.c and + eliminated use of png_sig in pngwutil.c. Moved the various png_CHNK arrays + into pngtypes.h. Eliminated use of global png_pass arrays. Declared the + png_CHNK and png_pass arrays to be "const". Made the global arrays + available to applications (although none are used in libpng itself) when + PNG_NO_GLOBAL_ARRAYS is not defined or when PNG_GLOBAL_ARRAYS is defined. + Removed some extraneous "-I" from contrib/pngminus/makefile.std + Changed the PNG_sRGB_INTENT macros in png.h to be consistent with PNG-1.2. + Change PNG_SRGB_INTENT to PNG_sRGB_INTENT in libpng.txt and libpng.3 +version 1.0.5d [November 29, 1999] + Add type cast (png_const_charp) two places in png.c + Eliminated pngtypes.h; use macros instead to declare PNG_CHNK arrays. + Renamed "PNG_GLOBAL_ARRAYS" to "PNG_USE_GLOBAL_ARRAYS" and made available + to applications a macro "PNG_USE_LOCAL_ARRAYS". + Remove all the new declarations with #ifdef/#endif when + PNG_USE_GLOBAL_ARRAYS is defined. + Added PNG_EXPORT_VAR macro to accommodate making DLL's. +version 1.0.5e [November 30, 1999] + Added iCCP, iTXt, and sPLT support; added "lang" member to the png_text + structure; refactored the inflate/deflate support to make adding new chunks + with trailing compressed parts easier in the future, and added new functions + png_free_iCCP, png_free_pCAL, png_free_sPLT, png_free_text, png_get_iCCP, + png_get_spalettes, png_set_iCCP, png_set_spalettes (Eric S. Raymond). + NOTE: Applications that write text chunks MUST define png_text->lang + before calling png_set_text(). It must be set to NULL if you want to + write tEXt or zTXt chunks. If you want your application to be able to + run with older versions of libpng, use + + #ifdef PNG_iTXt_SUPPORTED + png_text[i].lang = NULL; + #endif + + Changed png_get_oFFs() and png_set_oFFs() to use signed rather than unsigned + offsets (Eric S. Raymond). + Combined PNG_READ_cHNK_SUPPORTED and PNG_WRITE_cHNK_SUPPORTED macros into + PNG_cHNK_SUPPORTED and combined the three types of PNG_text_SUPPORTED + macros, leaving the separate macros also available. + Removed comments on #endifs at the end of many short, non-nested #if-blocks. +version 1.0.5f [December 6, 1999] + Changed makefile.solaris to issue a warning about potential problems when + the ucb "ld" is in the path ahead of the ccs "ld". + Removed "- [date]" from the "synopsis" line in libpng.3 and libpngpf.3. + Added sCAL chunk support (Eric S. Raymond). +version 1.0.5g [December 7, 1999] + Fixed "png_free_spallettes" typo in png.h + Added code to handle new chunks in pngpread.c + Moved PNG_CHNK string macro definitions outside of PNG_NO_EXTERN block + Added "translated_key" to png_text structure and png_write_iTXt(). + Added code in pngwrite.c to work around a newly discovered zlib bug. +version 1.0.5h [December 10, 1999] + NOTE: regarding the note for version 1.0.5e, the following must also + be included in your code: + png_text[i].translated_key = NULL; + Unknown chunk handling is now supported. + Option to eliminate all floating point support was added. Some new + fixed-point functions such as png_set_gAMA_fixed() were added. + Expanded tabs and removed trailing blanks in source files. +version 1.0.5i [December 13, 1999] + Added some type casts to silence compiler warnings. + Renamed "png_free_spalette" to "png_free_spalettes" for consistency. + Removed leading blanks from a #define in pngvcrd.c + Added some parameters to the new png_set_keep_unknown_chunks() function. + Added a test for up->location != 0 in the first instance of writing + unknown chunks in pngwrite.c + Changed "num" to "i" in png_free_spalettes() and png_free_unknowns() to + prevent recursion. + Added png_free_hIST() function. + Various patches to fix bugs in the sCAL and integer cHRM processing, + and to add some convenience macros for use with sCAL. +version 1.0.5j [December 21, 1999] + Changed "unit" parameter of png_write_sCAL from png_byte to int, to work + around buggy compilers. + Added new type "png_fixed_point" for integers that hold float*100000 values + Restored backward compatibility of tEXt/zTXt chunk processing: + Restored the first four members of png_text to the same order as v.1.0.5d. + Added members "lang_key" and "itxt_length" to png_text struct. Set + text_length=0 when "text" contains iTXt data. Use the "compression" + member to distinguish among tEXt/zTXt/iTXt types. Added + PNG_ITXT_COMPRESSION_NONE (1) and PNG_ITXT_COMPRESSION_zTXt(2) macros. + The "Note" above, about backward incompatibility of libpng-1.0.5e, no + longer applies. + Fixed png_read|write_iTXt() to read|write parameters in the right order, + and to write the iTXt chunk after IDAT if it appears in the end_ptr. + Added pnggccrd.c, version of pngvcrd.c Intel assembler for gcc (Greg Roelofs) + Reversed the order of trying to write floating-point and fixed-point gAMA. +version 1.0.5k [December 27, 1999] + Added many parentheses, e.g., "if (a && b & c)" becomes "if (a && (b & c))" + Added png_handle_as_unknown() function (Glenn) + Added png_free_chunk_list() function and chunk_list and num_chunk_list members + of png_ptr. + Eliminated erroneous warnings about multiple sPLT chunks and sPLT-after-PLTE. + Fixed a libpng-1.0.5h bug in pngrutil.c that was issuing erroneous warnings + about ignoring incorrect gAMA with sRGB (gAMA was in fact not ignored) + Added png_free_tRNS(); png_set_tRNS() now malloc's its own trans array (ESR). + Define png_get_int_32 when oFFs chunk is supported as well as when pCAL is. + Changed type of proflen from png_int_32 to png_uint_32 in png_get_iCCP(). +version 1.0.5l [January 1, 2000] + Added functions png_set_read_user_chunk_fn() and png_get_user_chunk_ptr() + for setting a callback function to handle unknown chunks and for + retrieving the associated user pointer (Glenn). +version 1.0.5m [January 7, 2000] + Added high-level functions png_read_png(), png_write_png(), png_free_pixels(). +version 1.0.5n [January 9, 2000] + Added png_free_PLTE() function, and modified png_set_PLTE() to malloc its + own memory for info_ptr->palette. This makes it safe for the calling + application to free its copy of the palette any time after it calls + png_set_PLTE(). +version 1.0.5o [January 20, 2000] + Cosmetic changes only (removed some trailing blanks and TABs) +version 1.0.5p [January 31, 2000] + Renamed pngdll.mak to makefile.bd32 + Cosmetic changes in pngtest.c +version 1.0.5q [February 5, 2000] + Relocated the makefile.solaris warning about PATH problems. + Fixed pngvcrd.c bug by pushing/popping registers in mmxsupport (Bruce Oberg) + Revised makefile.gcmmx + Added PNG_SETJMP_SUPPORTED, PNG_SETJMP_NOT_SUPPORTED, and PNG_ABORT() macros +version 1.0.5r [February 7, 2000] + Removed superfluous prototype for png_get_itxt from png.h + Fixed a bug in pngrtran.c that improperly expanded the background color. + Return *num_text=0 from png_get_text() when appropriate, and fix documentation + of png_get_text() in libpng.txt/libpng.3. +version 1.0.5s [February 18, 2000] + Added "png_jmp_env()" macro to pngconf.h, to help people migrate to the + new error handler that's planned for the next libpng release, and changed + example.c, pngtest.c, and contrib programs to use this macro. + Revised some of the DLL-export macros in pngconf.h (Greg Roelofs) + Fixed a bug in png_read_png() that caused it to fail to expand some images + that it should have expanded. + Fixed some mistakes in the unused and undocumented INCH_CONVERSIONS functions + in pngget.c + Changed the allocation of palette, history, and trans arrays back to + the version 1.0.5 method (linking instead of copying) which restores + backward compatibility with version 1.0.5. Added some remarks about + that in example.c. Added "free_me" member to info_ptr and png_ptr + and added png_free_data() function. + Updated makefile.linux and makefile.gccmmx to make directories conditionally. + Made cosmetic changes to pngasmrd.h + Added png_set_rows() and png_get_rows(), for use with png_read|write_png(). + Modified png_read_png() to allocate info_ptr->row_pointers only if it + hasn't already been allocated. +version 1.0.5t [March 4, 2000] + Changed png_jmp_env() migration aiding macro to png_jmpbuf(). + Fixed "interlace" typo (should be "interlaced") in contrib/gregbook/read2-x.c + Fixed bug with use of PNG_BEFORE_IHDR bit in png_ptr->mode, introduced when + PNG_FLAG_HAVE_CHUNK_HEADER was moved into png_ptr->mode in version 1.0.5b + Files in contrib/gregbook were revised to use png_jmpbuf() and to select + a 24-bit visual if one is available, and to allow abbreviated options. + Files in contrib/pngminus were revised to use the png_jmpbuf() macro. + Removed spaces in makefile.linux and makefile.gcmmx, introduced in 1.0.5s +version 1.0.5u [March 5, 2000] + Simplified the code that detects old png.h in png.c and pngtest.c + Renamed png_spalette (_p, _pp) to png_sPLT_t (_tp, _tpp) + Increased precision of rgb_to_gray calculations from 8 to 15 bits and + added png_set_rgb_to_gray_fixed() function. + Added makefile.bc32 (32-bit Borland C++, C mode) +version 1.0.5v [March 11, 2000] + Added some parentheses to the png_jmpbuf macro definition. + Updated references to the zlib home page, which has moved to freesoftware.com. + Corrected bugs in documentation regarding png_read_row() and png_write_row(). + Updated documentation of png_rgb_to_gray calculations in libpng.3/libpng.txt. + Renamed makefile.borland,turboc3 back to makefile.bor,tc3 as in version 1.0.3, + revised borland makefiles; added makefile.ibmvac3 and makefile.gcc (Cosmin) + +version 1.0.6 [March 20, 2000] + Minor revisions of makefile.bor, libpng.txt, and gregbook/rpng2-win.c + Added makefile.sggcc (SGI IRIX with gcc) +version 1.0.6d [April 7, 2000] + Changed sprintf() to strcpy() in png_write_sCAL_s() to work without STDIO + Added data_length parameter to png_decompress_chunk() function + Revised documentation to remove reference to abandoned png_free_chnk functions + Fixed an error in png_rgb_to_gray_fixed() + Revised example.c, usage of png_destroy_write_struct(). + Renamed makefile.ibmvac3 to makefile.ibmc, added libpng.icc IBM project file + Added a check for info_ptr->free_me&PNG_FREE_TEXT when freeing text in png.c + Simplify png_sig_bytes() function to remove use of non-ISO-C strdup(). +version 1.0.6e [April 9, 2000] + Added png_data_freer() function. + In the code that checks for over-length tRNS chunks, added check of + info_ptr->num_trans as well as png_ptr->num_trans (Matthias Benckmann) + Minor revisions of libpng.txt/libpng.3. + Check for existing data and free it if the free_me flag is set, in png_set_*() + and png_handle_*(). + Only define PNG_WEIGHTED_FILTERS_SUPPORTED when PNG_FLOATING_POINT_SUPPORTED + is defined. + Changed several instances of PNG_NO_CONSOLE_ID to PNG_NO_STDIO in pngrutil.c + and mentioned the purposes of the two macros in libpng.txt/libpng.3. +version 1.0.6f [April 14, 2000] + Revised png_set_iCCP() and png_set_rows() to avoid prematurely freeing data. + Add checks in png_set_text() for NULL members of the input text structure. + Revised libpng.txt/libpng.3. + Removed superfluous prototype for png_set_itxt from png.h + Removed "else" from pngread.c, after png_error(), and changed "0" to "length". + Changed several png_errors about malformed ancillary chunks to png_warnings. +version 1.0.6g [April 24, 2000] + Added png_pass-* arrays to pnggccrd.c when PNG_USE_LOCAL_ARRAYS is defined. + Relocated paragraph about png_set_background() in libpng.3/libpng.txt + and other revisions (Matthias Benckmann) + Relocated info_ptr->free_me, png_ptr->free_me, and other info_ptr and + png_ptr members to restore binary compatibility with libpng-1.0.5 + (breaks compatibility with libpng-1.0.6). +version 1.0.6h [April 24, 2000] + Changed shared library so-number pattern from 2.x.y.z to xy.z (this builds + libpng.so.10 & libpng.so.10.6h instead of libpng.so.2 & libpng.so.2.1.0.6h) + This is a temporary change for test purposes. +version 1.0.6i [May 2, 2000] + Rearranged some members at the end of png_info and png_struct, to put + unknown_chunks_num and free_me within the original size of the png_structs + and free_me, png_read_user_fn, and png_free_fn within the original png_info, + because some old applications allocate the structs directly instead of + using png_create_*(). + Added documentation of user memory functions in libpng.txt/libpng.3 + Modified png_read_png so that it will use user_allocated row_pointers + if present, unless free_me directs that it be freed, and added description + of the use of png_set_rows() and png_get_rows() in libpng.txt/libpng.3. + Added PNG_LEGACY_SUPPORTED macro, and #ifdef out all new (since version + 1.00) members of png_struct and png_info, to regain binary compatibility + when you define this macro. Capabilities lost in this event + are user transforms (new in version 1.0.0),the user transform pointer + (new in version 1.0.2), rgb_to_gray (new in 1.0.5), iCCP, sCAL, sPLT, + the high-level interface, and unknown chunks support (all new in 1.0.6). + This was necessary because of old applications that allocate the structs + directly as authors were instructed to do in libpng-0.88 and earlier, + instead of using png_create_*(). + Added modes PNG_CREATED_READ_STRUCT and PNG_CREATED_WRITE_STRUCT which + can be used to detect codes that directly allocate the structs, and + code to check these modes in png_read_init() and png_write_init() and + generate a libpng error if the modes aren't set and PNG_LEGACY_SUPPORTED + was not defined. + Added makefile.intel and updated makefile.watcom (Pawel Mrochen) +version 1.0.6j [May 3, 2000] + Overloaded png_read_init() and png_write_init() with macros that convert + calls to png_read_init_2() or png_write_init_2() that check the version + and structure sizes. +version 1.0.7beta11 [May 7, 2000] + Removed the new PNG_CREATED_READ_STRUCT and PNG_CREATED_WRITE_STRUCT modes + which are no longer used. + Eliminated the three new members of png_text when PNG_LEGACY_SUPPORTED is + defined or when neither PNG_READ_iTXt_SUPPORTED nor PNG_WRITE_iTXT_SUPPORTED + is defined. + Made PNG_NO_READ|WRITE_iTXt the default setting, to avoid memory + overrun when old applications fill the info_ptr->text structure directly. + Added PNGAPI macro, and added it to the definitions of all exported functions. + Relocated version macro definitions ahead of the includes of zlib.h and + pngconf.h in png.h. +version 1.0.7beta12 [May 12, 2000] + Revised pngset.c to avoid a problem with expanding the png_debug macro. + Deleted some extraneous defines from pngconf.h + Made PNG_NO_CONSOLE_IO the default condition when PNG_BUILD_DLL is defined. + Use MSC _RPTn debugging instead of fprintf if _MSC_VER is defined. + Added png_access_version_number() function. + Check for mask&PNG_FREE_CHNK (for TEXT, SCAL, PCAL) in png_free_data(). + Expanded libpng.3/libpng.txt information about png_data_freer(). +version 1.0.7beta14 [May 17, 2000] (beta13 was not published) + Changed pnggccrd.c and pngvcrd.c to handle bad adaptive filter types as + warnings instead of errors, as pngrutil.c does. + Set the PNG_INFO_IDAT valid flag in png_set_rows() so png_write_png() + will actually write IDATs. + Made the default PNG_USE_LOCAL_ARRAYS depend on PNG_DLL instead of WIN32. + Make png_free_data() ignore its final parameter except when freeing data + that can have multiple instances (text, sPLT, unknowns). + Fixed a new bug in png_set_rows(). + Removed info_ptr->valid tests from png_free_data(), as in version 1.0.5. + Added png_set_invalid() function. + Fixed incorrect illustrations of png_destroy_write_struct() in example.c. +version 1.0.7beta15 [May 30, 2000] + Revised the deliberately erroneous Linux setjmp code in pngconf.h to produce + fewer error messages. + Rearranged checks for Z_OK to check the most likely path first in pngpread.c + and pngwutil.c. + Added checks in pngtest.c for png_create_*() returning NULL, and mentioned + in libpng.txt/libpng.3 the need for applications to check this. + Changed names of png_default_*() functions in pngtest to pngtest_*(). + Changed return type of png_get_x|y_offset_*() from png_uint_32 to png_int_32. + Fixed some bugs in the unused PNG_INCH_CONVERSIONS functions in pngget.c + Set each pointer to NULL after freeing it in png_free_data(). + Worked around a problem in pngconf.h; AIX's strings.h defines an "index" + macro that conflicts with libpng's png_color_16.index. (Dimitri Papadapoulos) + Added "msvc" directory with MSVC++ project files (Simon-Pierre Cadieux). +version 1.0.7beta16 [June 4, 2000] + Revised the workaround of AIX string.h "index" bug. + Added a check for overlength PLTE chunk in pngrutil.c. + Added PNG_NO_POINTER_INDEXING macro to use array-indexing instead of pointer + indexing in pngrutil.c and pngwutil.c to accommodate a buggy compiler. + Added a warning in png_decompress_chunk() when it runs out of data, e.g. + when it tries to read an erroneous PhotoShop iCCP chunk. + Added PNG_USE_DLL macro. + Revised the copyright/disclaimer/license notice. + Added contrib/msvctest directory +version 1.0.7rc1 [June 9, 2000] + Corrected the definition of PNG_TRANSFORM_INVERT_ALPHA (0x0400 not 0x0200) + Added contrib/visupng directory (Willem van Schaik) +version 1.0.7beta18 [June 23, 2000] + Revised PNGAPI definition, and pngvcrd.c to work with __GCC__ + and do not redefine PNGAPI if it is passed in via a compiler directive. + Revised visupng/PngFile.c to remove returns from within the Try block. + Removed leading underscores from "_PNG_H" and "_PNG_SAVE_BSD_SOURCE" macros. + Updated contrib/visupng/cexcept.h to version 1.0.0. + Fixed bugs in pngwrite.c and pngwutil.c that prevented writing iCCP chunks. +version 1.0.7rc2 [June 28, 2000] + Updated license to include disclaimers required by UCITA. + Fixed "DJBPP" typo in pnggccrd.c introduced in beta18. + +version 1.0.7 [July 1, 2000] + Revised the definition of "trans_values" in libpng.3/libpng.txt +version 1.0.8beta1 [July 8, 2000] + Added png_free(png_ptr, key) two places in pngpread.c to stop memory leaks. + Changed PNG_NO_STDIO to PNG_NO_CONSOLE_IO, several places in pngrutil.c and + pngwutil.c. + Changed PNG_EXPORT_VAR to use PNG_IMPEXP, in pngconf.h. + Removed unused "#include " from png.c + Added WindowsCE support. + Revised pnggccrd.c to work with gcc-2.95.2 and in the Cygwin environment. +version 1.0.8beta2 [July 10, 2000] + Added project files to the wince directory and made further revisions + of pngtest.c, pngrio.c, and pngwio.c in support of WindowsCE. +version 1.0.8beta3 [July 11, 2000] + Only set the PNG_FLAG_FREE_TRNS or PNG_FREE_TRNS flag in png_handle_tRNS() + for indexed-color input files to avoid potential double-freeing trans array + under some unusual conditions; problem was introduced in version 1.0.6f. + Further revisions to pngtest.c and files in the wince subdirectory. +version 1.0.8beta4 [July 14, 2000] + Added the files pngbar.png and pngbar.jpg to the distribution. + Added makefile.cygwin, and cygwin support in pngconf.h + Added PNG_NO_ZALLOC_ZERO macro (makes png_zalloc skip zeroing memory) +version 1.0.8rc1 [July 16, 2000] + Revised png_debug() macros and statements to eliminate compiler warnings. + +version 1.0.8 [July 24, 2000] + Added png_flush() in pngwrite.c, after png_write_IEND(). + Updated makefile.hpux to build a shared library. +version 1.0.9beta1 [November 10, 2000] + Fixed typo in scripts/makefile.hpux + Updated makevms.com in scripts and contrib/* and contrib/* (Martin Zinser) + Fixed seqence-point bug in contrib/pngminus/png2pnm (Martin Zinser) + Changed "cdrom.com" in documentation to "libpng.org" + Revised pnggccrd.c to get it all working, and updated makefile.gcmmx (Greg). + Changed type of "params" from voidp to png_voidp in png_read|write_png(). + Make sure PNGAPI and PNG_IMPEXP are defined in pngconf.h. + Revised the 3 instances of WRITEFILE in pngtest.c. + Relocated "msvc" and "wince" project subdirectories into "dll" subdirectory. + Updated png.rc in dll/msvc project + Revised makefile.dec to define and use LIBPATH and INCPATH + Increased size of global png_libpng_ver[] array from 12 to 18 chars. + Made global png_libpng_ver[], png_sig[] and png_pass_*[] arrays const. + Removed duplicate png_crc_finish() from png_handle_bKGD() function. + Added a warning when application calls png_read_update_info() multiple times. + Revised makefile.cygwin + Fixed bugs in iCCP support in pngrutil.c and pngwutil.c. + Replaced png_set_empty_plte_permitted() with png_permit_mng_features(). +version 1.0.9beta2 [November 19, 2000] + Renamed the "dll" subdirectory "projects". + Added borland project files to "projects" subdirectory. + Set VS_FF_PRERELEASE and VS_FF_PATCHED flags in msvc/png.rc when appropriate. + Add error message in png_set_compression_buffer_size() when malloc fails. +version 1.0.9beta3 [November 23, 2000] + Revised PNG_LIBPNG_BUILD_TYPE macro in png.h, used in the msvc project. + Removed the png_flush() in pngwrite.c that crashes some applications + that don't set png_output_flush_fn. + Added makefile.macosx and makefile.aix to scripts directory. +version 1.0.9beta4 [December 1, 2000] + Change png_chunk_warning to png_warning in png_check_keyword(). + Increased the first part of msg buffer from 16 to 18 in png_chunk_error(). +version 1.0.9beta5 [December 15, 2000] + Added support for filter method 64 (for PNG datastreams embedded in MNG). +version 1.0.9beta6 [December 18, 2000] + Revised png_set_filter() to accept filter method 64 when appropriate. + Added new PNG_HAVE_PNG_SIGNATURE bit to png_ptr->mode and use it to + help prevent applications from using MNG features in PNG datastreams. + Added png_permit_mng_features() function. + Revised libpng.3/libpng.txt. Changed "filter type" to "filter method". +version 1.0.9rc1 [December 23, 2000] + Revised test for PNG_HAVE_PNG_SIGNATURE in pngrutil.c + Fixed error handling of unknown compression type in png_decompress_chunk(). + In pngconf.h, define __cdecl when _MSC_VER is defined. +version 1.0.9beta7 [December 28, 2000] + Changed PNG_TEXT_COMPRESSION_zTXt to PNG_COMPRESSION_TYPE_BASE several places. + Revised memory management in png_set_hIST and png_handle_hIST in a backward + compatible manner. PLTE and tRNS were revised similarly. + Revised the iCCP chunk reader to ignore trailing garbage. +version 1.0.9beta8 [January 12, 2001] + Moved pngasmrd.h into pngconf.h. + Improved handling of out-of-spec garbage iCCP chunks generated by PhotoShop. +version 1.0.9beta9 [January 15, 2001] + Added png_set_invalid, png_permit_mng_features, and png_mmx_supported to + wince and msvc project module definition files. + Minor revision of makefile.cygwin. + Fixed bug with progressive reading of narrow interlaced images in pngpread.c +version 1.0.9beta10 [January 16, 2001] + Do not typedef png_FILE_p in pngconf.h when PNG_NO_STDIO is defined. + Fixed "png_mmx_supported" typo in project definition files. +version 1.0.9beta11 [January 19, 2001] + Updated makefile.sgi to make shared library. + Removed png_mmx_support() function and disabled PNG_MNG_FEATURES_SUPPORTED + by default, for the benefit of DLL forward compatibility. These will + be re-enabled in version 1.2.0. +version 1.0.9rc2 [January 22, 2001] + Revised cygwin support. + +version 1.0.9 [January 31, 2001] + Added check of cygwin's ALL_STATIC in pngconf.h + Added "-nommx" parameter to contrib/gregbook/rpng2-win and rpng2-x demos. +version 1.0.10beta1 [March 14, 2001] + Revised makefile.dec, makefile.sgi, and makefile.sggcc; added makefile.hpgcc. + Reformatted libpng.3 to eliminate bad line breaks. + Added checks for _mmx_supported in the read_filter_row function of pnggccrd.c + Added prototype for png_mmx_support() near the top of pnggccrd.c + Moved some error checking from png_handle_IHDR to png_set_IHDR. + Added PNG_NO_READ_SUPPORTED and PNG_NO_WRITE_SUPPORTED macros. + Revised png_mmx_support() function in pnggccrd.c + Restored version 1.0.8 PNG_WRITE_EMPTY_PLTE_SUPPORTED behavior in pngwutil.c + Fixed memory leak in contrib/visupng/PngFile.c + Fixed bugs in png_combine_row() in pnggccrd.c and pngvcrd.c (C version) + Added warnings when retrieving or setting gamma=0. + Increased the first part of msg buffer from 16 to 18 in png_chunk_warning(). +version 1.0.10rc1 [March 23, 2001] + Changed all instances of memcpy, strcpy, and strlen to png_memcpy, png_strcpy, + and png_strlen. + Revised png_mmx_supported() function in pnggccrd.c to return proper value. + Fixed bug in progressive reading (pngpread.c) with small images (height < 8). + +version 1.0.10 [March 30, 2001] + Deleted extraneous space (introduced in 1.0.9) from line 42 of makefile.cygwin + Added beos project files (Chris Herborth) +version 1.0.11beta1 [April 3, 2001] + Added type casts on several png_malloc() calls (Dimitri Papadapoulos). + Removed a no-longer needed AIX work-around from pngconf.h + Changed several "//" single-line comments to C-style in pnggccrd.c +version 1.0.11beta2 [April 11, 2001] + Removed PNGAPI from several functions whose prototypes did not have PNGAPI. + Updated scripts/pngos2.def +version 1.0.11beta3 [April 14, 2001] + Added checking the results of many instances of png_malloc() for NULL +version 1.0.11beta4 [April 20, 2001] + Undid the changes from version 1.0.11beta3. Added a check for NULL return + from user's malloc_fn(). + Removed some useless type casts of the NULL pointer. + Added makefile.netbsd + +version 1.0.11 [April 27, 2001] + Revised makefile.netbsd +version 1.0.12beta1 [May 14, 2001] + Test for Windows platform in pngconf.h when including malloc.h (Emmanuel Blot) + Updated makefile.cygwin and handling of Cygwin's ALL_STATIC in pngconf.h + Added some never-to-be-executed code in pnggccrd.c to quiet compiler warnings. + Eliminated the png_error about apps using png_read|write_init(). Instead, + libpng will reallocate the png_struct and info_struct if they are too small. + This retains future binary compatibility for old applications written for + libpng-0.88 and earlier. +version 1.2.0beta1 [May 6, 2001] + Bumped DLLNUM to 2. + Re-enabled PNG_MNG_FEATURES_SUPPORTED and enabled PNG_ASSEMBLER_CODE_SUPPORTED + by default. + Added runtime selection of MMX features. + Added png_set_strip_error_numbers function and related macros. +version 1.2.0beta2 [May 7, 2001] + Finished merging 1.2.0beta1 with version 1.0.11 + Added a check for attempts to read or write PLTE in grayscale PNG datastreams. +version 1.2.0beta3 [May 17, 2001] + Enabled user memory function by default. + Modified png_create_struct so it passes user mem_ptr to user memory allocator. + Increased png_mng_features flag from png_byte to png_uint_32. + Bumped shared-library (so-number) and dll-number to 3. +version 1.2.0beta4 [June 23, 2001] + Check for missing profile length field in iCCP chunk and free chunk_data + in case of truncated iCCP chunk. + Bumped shared-library number to 3 in makefile.sgi and makefile.sggcc + Bumped dll-number from 2 to 3 in makefile.cygwin + Revised contrib/gregbook/rpng*-x.c to avoid a memory leak and to exit cleanly + if user attempts to run it on an 8-bit display. + Updated contrib/gregbook + Use png_malloc instead of png_zalloc to allocate palette in pngset.c + Updated makefile.ibmc + Added some typecasts to eliminate gcc 3.0 warnings. Changed prototypes + of png_write_oFFS width and height from png_uint_32 to png_int_32. + Updated example.c + Revised prototypes for png_debug_malloc and png_debug_free in pngtest.c +version 1.2.0beta5 [August 8, 2001] + Revised contrib/gregbook + Revised makefile.gcmmx + Revised pnggccrd.c to conditionally compile some thread-unsafe code only + when PNG_THREAD_UNSAFE_OK is defined. + Added tests to prevent pngwutil.c from writing a bKGD or tRNS chunk with + value exceeding 2^bit_depth-1 + Revised makefile.sgi and makefile.sggcc + Replaced calls to fprintf(stderr,...) with png_warning() in pnggccrd.c + Removed restriction that do_invert_mono only operate on 1-bit opaque files + +version 1.2.0 [September 1, 2001] + Changed a png_warning() to png_debug() in pnggccrd.c + Fixed contrib/gregbook/rpng-x.c, rpng2-x.c to avoid crash with XFreeGC(). +version 1.2.1beta1 [October 19, 2001] + Revised makefile.std in contrib/pngminus + Include background_1 in png_struct regardless of gamma support. + Revised makefile.netbsd and makefile.macosx, added makefile.darwin. + Revised example.c to provide more details about using row_callback(). +version 1.2.1beta2 [October 25, 2001] + Added type cast to each NULL appearing in a function call, except for + WINCE functions. + Added makefile.so9. +version 1.2.1beta3 [October 27, 2001] + Removed type casts from all NULLs. + Simplified png_create_struct_2(). +version 1.2.1beta4 [November 7, 2001] + Revised png_create_info_struct() and png_creat_struct_2(). + Added error message if png_write_info() was omitted. + Type cast NULLs appearing in function calls when _NO_PROTO or + PNG_TYPECAST_NULL is defined. +version 1.2.1rc1 [November 24, 2001] + Type cast NULLs appearing in function calls except when PNG_NO_TYPECAST_NULL + is defined. + Changed typecast of "size" argument to png_size_t in pngmem.c calls to + the user malloc_fn, to agree with the prototype in png.h + Added a pop/push operation to pnggccrd.c, to preserve Eflag (Maxim Sobolev) + Updated makefile.sgi to recognize LIBPATH and INCPATH. + Updated various makefiles so "make clean" does not remove previous major + version of the shared library. +version 1.2.1rc2 [December 4, 2001] + Always allocate 256-entry internal palette, hist, and trans arrays, to + avoid out-of-bounds memory reference caused by invalid PNG datastreams. + Added a check for prefix_length > data_length in iCCP chunk handler. + +version 1.2.1 [December 7, 2001] + None. +version 1.2.2beta1 [February 22, 2002] + Fixed a bug with reading the length of iCCP profiles (Larry Reeves). + Revised makefile.linux, makefile.gcmmx, and makefile.sgi to generate + libpng.a, libpng12.so (not libpng.so.3), and libpng12/png.h + Revised makefile.darwin to remove "-undefined suppress" option. + Added checks for gamma and chromaticity values over 21474.83, which exceed + the limit for PNG unsigned 32-bit integers when encoded. + Revised calls to png_create_read_struct() and png_create_write_struct() + for simpler debugging. + Revised png_zalloc() so zlib handles errors (uses PNG_FLAG_MALLOC_NULL_MEM_OK) +version 1.2.2beta2 [February 23, 2002] + Check chunk_length and idat_size for invalid (over PNG_MAX_UINT) lengths. + Check for invalid image dimensions in png_get_IHDR. + Added missing "fi;" in the install target of the SGI makefiles. + Added install-static to all makefiles that make shared libraries. + Always do gamma compensation when image is partially transparent. +version 1.2.2beta3 [March 7, 2002] + Compute background.gray and background_1.gray even when color_type is RGB + in case image gets reduced to gray later. + Modified shared-library makefiles to install pkgconfig/libpngNN.pc. + Export (with PNGAPI) png_zalloc, png_zfree, and png_handle_as_unknown + Removed unused png_write_destroy_info prototype from png.h + Eliminated incorrect use of width_mmx from pnggccrd.c in pixel_bytes == 8 case + Added install-shared target to all makefiles that make shared libraries. + Stopped a double free of palette, hist, and trans when not using free_me. + Added makefile.32sunu for Sun Ultra 32 and makefile.64sunu for Sun Ultra 64. +version 1.2.2beta4 [March 8, 2002] + Compute background.gray and background_1.gray even when color_type is RGB + in case image gets reduced to gray later (Jason Summers). + Relocated a misplaced /bin/rm in the "install-shared" makefile targets + Added PNG_1_0_X macro which can be used to build a 1.0.x-compatible library. +version 1.2.2beta5 [March 26, 2002] + Added missing PNGAPI to several function definitions. + Check for invalid bit_depth or color_type in png_get_IHDR(), and + check for missing PLTE or IHDR in png_push_read_chunk() (Matthias Clasen). + Revised iTXt support to accept NULL for lang and lang_key. + Compute gamma for color components of background even when color_type is gray. + Changed "()" to "{}" in scripts/libpng.pc.in. + Revised makefiles to put png.h and pngconf.h only in $prefix/include/libpngNN + Revised makefiles to make symlink to libpng.so.NN in addition to libpngNN.so +version 1.2.2beta6 [March 31, 2002] +version 1.0.13beta1 [March 31, 2002] + Prevent png_zalloc() from trying to memset memory that it failed to acquire. + Add typecasts of PNG_MAX_UINT in pngset_cHRM_fixed() (Matt Holgate). + Ensure that the right function (user or default) is used to free the + png_struct after an error in png_create_read_struct_2(). +version 1.2.2rc1 [April 7, 2002] +version 1.0.13rc1 [April 7, 2002] + Save the ebx register in pnggccrd.c (Sami Farin) + Add "mem_ptr = png_ptr->mem_ptr" in png_destroy_write_struct() (Paul Gardner). + Updated makefiles to put headers in include/libpng and remove old include/*.h. + +version 1.2.2 [April 15, 2002] +version 1.0.13 [April 15, 2002] + Revised description of png_set_filter() in libpng.3/libpng.txt. + Revised makefile.netbsd and added makefile.neNNbsd and makefile.freebsd +version 1.0.13patch01 [April 17, 2002] +version 1.2.2patch01 [April 17, 2002] + Changed ${PNGMAJ}.${PNGVER} bug to ${PNGVER} in makefile.sgi and makefile.sggcc + Fixed VER -> PNGVER typo in makefile.macosx and added install-static to install + Added install: target to makefile.32sunu and makefile.64sunu +version 1.0.13patch03 [April 18, 2002] +version 1.2.2patch03 [April 18, 2002] + Revised 15 makefiles to link libpng.a to libpngNN.a and the include libpng + subdirectory to libpngNN subdirectory without the full pathname. + Moved generation of libpng.pc from "install" to "all" in 15 makefiles. +version 1.2.3rc1 [April 28, 2002] + Added install-man target to 15 makefiles (Dimitri Papadopolous-Orfanos). + Added $(DESTDIR) feature to 24 makefiles (Tim Mooney) + Fixed bug with $prefix, should be $(prefix) in makefile.hpux. + Updated cygwin-specific portion of pngconf.h and revised makefile.cygwin + Added a link from libpngNN.pc to libpng.pc in 15 makefiles. + Added links from include/libpngNN/*.h to include/*.h in 24 makefiles. + Revised makefile.darwin to make relative links without full pathname. + Added setjmp() at the end of png_create_*_struct_2() in case user forgets + to put one in their application. + Restored png_zalloc() and png_zfree() prototypes to version 1.2.1 and + removed them from module definition files. +version 1.2.3rc2 [May 1, 2002] + Fixed bug in reporting number of channels in pngget.c and pngset.c, + that was introduced in version 1.2.2beta5. + Exported png_zalloc(), png_zfree(), png_default_read(), png_default_write(), + png_default_flush(), and png_push_fill_buffer() and included them in + module definition files. + Added "libpng.pc" dependency to the "install-shared" target in 15 makefiles. +version 1.2.3rc3 [May 1, 2002] + Revised prototype for png_default_flush() + Remove old libpng.pc and libpngNN.pc before installing new ones. +version 1.2.3rc4 [May 2, 2002] + Typos in *.def files (png_default_read|write -> png_default_read|write_data) + In makefiles, changed rm libpng.NN.pc to rm libpngNN.pc + Added libpng-config and libpngNN-config and modified makefiles to install them. + Changed $(MANPATH) to $(DESTDIR)$(MANPATH) in makefiles + Added "Win32 DLL VB" configuration to projects/msvc/libpng.dsp +version 1.2.3rc5 [May 11, 2002] + Changed "error" and "message" in prototypes to "error_message" and + "warning_message" to avoid namespace conflict. + Revised 15 makefiles to build libpng-config from libpng-config-*.in + Once more restored png_zalloc and png_zfree to regular nonexported form. + Restored png_default_read|write_data, png_default_flush, png_read_fill_buffer + to nonexported form, but with PNGAPI, and removed them from module def files. +version 1.2.3rc6 [May 14, 2002] + Removed "PNGAPI" from png_zalloc() and png_zfree() in png.c + Changed "Gz" to "Gd" in projects/msvc/libpng.dsp and zlib.dsp. + Removed leftover libpng-config "sed" script from four makefiles. + Revised libpng-config creating script in 16 makefiles. + +version 1.2.3 [May 22, 2002] + Revised libpng-config target in makefile.cygwin. + Removed description of png_set_mem_fn() from documentation. + Revised makefile.freebsd. + Minor cosmetic changes to 15 makefiles, e.g., $(DI) = $(DESTDIR)/$(INCDIR). + Revised projects/msvc/README.txt + Changed -lpng to -lpngNN in LDFLAGS in several makefiles. +version 1.2.4beta1 [May 24, 2002] + Added libpng.pc and libpng-config to "all:" target in 16 makefiles. + Fixed bug in 16 makefiles: $(DESTDIR)/$(LIBPATH) to $(DESTDIR)$(LIBPATH) + Added missing "\" before closing double quote in makefile.gcmmx. + Plugged various memory leaks; added png_malloc_warn() and png_set_text_2() + functions. +version 1.2.4beta2 [June 25, 2002] + Plugged memory leak of png_ptr->current_text (Matt Holgate). + Check for buffer overflow before reading CRC in pngpread.c (Warwick Allison) + Added -soname to the loader flags in makefile.dec, makefile.sgi, and + makefile.sggcc. + Added "test-installed" target to makefile.linux, makefile.gcmmx, + makefile.sgi, and makefile.sggcc. +version 1.2.4beta3 [June 28, 2002] + Plugged memory leak of row_buf in pngtest.c when there is a png_error(). + Detect buffer overflow in pngpread.c when IDAT is corrupted with extra data. + Added "test-installed" target to makefile.32sunu, makefile.64sunu, + makefile.beos, makefile.darwin, makefile.dec, makefile.macosx, + makefile.solaris, makefile.hpux, makefile.hpgcc, and makefile.so9. +version 1.2.4rc1 and 1.0.14rc1 [July 2, 2002] + Added "test-installed" target to makefile.cygwin and makefile.sco. + Revised pnggccrd.c to be able to back out version 1.0.x via PNG_1_0_X macro. + +version 1.2.4 and 1.0.14 [July 8, 2002] + Changed png_warning() to png_error() when width is too large to process. +version 1.2.4patch01 [July 20, 2002] + Revised makefile.cygwin to use DLL number 12 instead of 13. +version 1.2.5beta1 [August 6, 2002] + Added code to contrib/gregbook/readpng2.c to ignore unused chunks. + Replaced toucan.png in contrib/gregbook (it has been corrupt since 1.0.11) + Removed some stray *.o files from contrib/gregbook. + Changed png_error() to png_warning() about "Too much data" in pngpread.c + and about "Extra compressed data" in pngrutil.c. + Prevent png_ptr->pass from exceeding 7 in png_push_finish_row(). + Updated makefile.hpgcc + Updated png.c and pnggccrd.c handling of return from png_mmx_support() +version 1.2.5beta2 [August 15, 2002] + Only issue png_warning() about "Too much data" in pngpread.c when avail_in + is nonzero. + Updated makefiles to install a separate libpng.so.3 with its own rpath. +version 1.2.5rc1 and 1.0.15rc1 [August 24, 2002] + Revised makefiles to not remove previous minor versions of shared libraries. +version 1.2.5rc2 and 1.0.15rc2 [September 16, 2002] + Revised 13 makefiles to remove "-lz" and "-L$(ZLIBLIB)", etc., from shared + library loader directive. + Added missing "$OBJSDLL" line to makefile.gcmmx. + Added missing "; fi" to makefile.32sunu. +version 1.2.5rc3 and 1.0.15rc3 [September 18, 2002] + Revised libpng-config script. + +version 1.2.5 and 1.0.15 [October 3, 2002] + Revised makefile.macosx, makefile.darwin, makefile.hpgcc, and makefile.hpux, + and makefile.aix. + Relocated two misplaced PNGAPI lines in pngtest.c +version 1.2.6beta1 [October 22, 2002] + Commented out warning about uninitialized mmx_support in pnggccrd.c. + Changed "IBMCPP__" flag to "__IBMCPP__" in pngconf.h. + Relocated two more misplaced PNGAPI lines in pngtest.c + Fixed memory overrun bug in png_do_read_filler() with 16-bit datastreams, + introduced in version 1.0.2. + Revised makefile.macosx, makefile.dec, makefile.aix, and makefile.32sunu. +version 1.2.6beta2 [November 1, 2002] + Added libpng-config "--ldopts" output. + Added "AR=ar" and "ARFLAGS=rc" and changed "ar rc" to "$(AR) $(ARFLAGS)" + in makefiles. +version 1.2.6beta3 [July 18, 2004] + Reverted makefile changes from version 1.2.6beta2 and some of the changes + from version 1.2.6beta1; these will be postponed until version 1.2.7. + Version 1.2.6 is going to be a simple bugfix release. + Changed the one instance of "ln -sf" to "ln -f -s" in each Sun makefile. + Fixed potential overrun in pngerror.c by using strncpy instead of memcpy. + Added "#!/bin/sh" at the top of configure, for recognition of the + 'x' flag under Cygwin (Cosmin). + Optimized vacuous tests that silence compiler warnings, in png.c (Cosmin). + Added support for PNG_USER_CONFIG, in pngconf.h (Cosmin). + Fixed the special memory handler for Borland C under DOS, in pngmem.c + (Cosmin). + Removed some spurious assignments in pngrutil.c (Cosmin). + Replaced 65536 with 65536L, and 0xffff with 0xffffL, to silence warnings + on 16-bit platforms (Cosmin). + Enclosed shift op expressions in parentheses, to silence warnings (Cosmin). + Used proper type png_fixed_point, to avoid problems on 16-bit platforms, + in png_handle_sRGB() (Cosmin). + Added compression_type to png_struct, and optimized the window size + inside the deflate stream (Cosmin). + Fixed definition of isnonalpha(), in pngerror.c and pngrutil.c (Cosmin). + Fixed handling of unknown chunks that come after IDAT (Cosmin). + Allowed png_error() and png_warning() to work even if png_ptr == NULL + (Cosmin). + Replaced row_info->rowbytes with row_bytes in png_write_find_filter() + (Cosmin). + Fixed definition of PNG_LIBPNG_VER_DLLNUM (Simon-Pierre). + Used PNG_LIBPNG_VER and PNG_LIBPNG_VER_STRING instead of the hardcoded + values in png.c (Simon-Pierre, Cosmin). + Initialized png_libpng_ver[] with PNG_LIBPNG_VER_STRING (Simon-Pierre). + Replaced PNG_LIBPNG_VER_MAJOR with PNG_LIBPNG_VER_DLLNUM in png.rc + (Simon-Pierre). + Moved the definition of PNG_HEADER_VERSION_STRING near the definitions + of the other PNG_LIBPNG_VER_... symbols in png.h (Cosmin). + Relocated #ifndef PNGAPI guards in pngconf.h (Simon-Pierre, Cosmin). + Updated scripts/makefile.vc(a)win32 (Cosmin). + Updated the MSVC project (Simon-Pierre, Cosmin). + Updated the Borland C++ Builder project (Cosmin). + Avoided access to asm_flags in pngvcrd.c, if PNG_1_0_X is defined (Cosmin). + Commented out warning about uninitialized mmx_support in pngvcrd.c (Cosmin). + Removed scripts/makefile.bd32 and scripts/pngdef.pas (Cosmin). + Added extra guard around inclusion of Turbo C memory headers, in pngconf.h + (Cosmin). + Renamed projects/msvc/ to projects/visualc6/, and projects/borland/ to + projects/cbuilder5/ (Cosmin). + Moved projects/visualc6/png32ms.def to scripts/pngw32.def, + and projects/visualc6/png.rc to scripts/pngw32.rc (Cosmin). + Added projects/visualc6/pngtest.dsp; removed contrib/msvctest/ (Cosmin). + Changed line endings to DOS style in cbuilder5 and visualc6 files, even + in the tar.* distributions (Cosmin). + Updated contrib/visupng/VisualPng.dsp (Cosmin). + Updated contrib/visupng/cexcept.h to version 2.0.0 (Cosmin). + Added a separate distribution with "configure" and supporting files (Junichi). +version 1.2.6beta4 [July 28, 2004] + Added user ability to change png_size_t via a PNG_SIZE_T macro. + Added png_sizeof() and png_convert_size() functions. + Added PNG_SIZE_MAX (maximum value of a png_size_t variable. + Added check in png_malloc_default() for (size_t)size != (png_uint_32)size + which would indicate an overflow. + Changed sPLT failure action from png_error to png_warning and abandon chunk. + Changed sCAL and iCCP failures from png_error to png_warning and abandon. + Added png_get_uint_31(png_ptr, buf) function. + Added PNG_UINT_32_MAX macro. + Renamed PNG_MAX_UINT to PNG_UINT_31_MAX. + Made png_zalloc() issue a png_warning and return NULL on potential + overflow. + Turn on PNG_NO_ZALLOC_ZERO by default in version 1.2.x + Revised "clobber list" in pnggccrd.c so it will compile under gcc-3.4. + Revised Borland portion of png_malloc() to return NULL or issue + png_error() according to setting of PNG_FLAG_MALLOC_NULL_MEM_OK. + Added PNG_NO_SEQUENTIAL_READ_SUPPORTED macro to conditionally remove + sequential read support. + Added some "#if PNG_WRITE_SUPPORTED" blocks. + Removed some redundancy with #ifdef/#endif in png_malloc_default(). + Use png_malloc instead of png_zalloc to allocate the pallete. +version 1.0.16rc1 and 1.2.6rc1 [August 4, 2004] + Fixed buffer overflow vulnerability in png_handle_tRNS() + Fixed integer arithmetic overflow vulnerability in png_read_png(). + Fixed some harmless bugs in png_handle_sBIT, etc, that would cause + duplicate chunk types to go undetected. + Fixed some timestamps in the -config version + Rearranged order of processing of color types in png_handle_tRNS(). + Added ROWBYTES macro to calculate rowbytes without integer overflow. + Updated makefile.darwin and removed makefile.macosx from scripts directory. + Imposed default one million column, one-million row limits on the image + dimensions, and added png_set_user_limits() function to override them. + Revised use of PNG_SET_USER_LIMITS_SUPPORTED macro. + Fixed wrong cast of returns from png_get_user_width|height_max(). + Changed some "keep the compiler happy" from empty statements to returns, + Revised libpng.txt to remove 1.2.x stuff from the 1.0.x distribution +version 1.0.16rc2 and 1.2.6rc2 [August 7, 2004] + Revised makefile.darwin and makefile.solaris. Removed makefile.macosx. + Revised pngtest's png_debug_malloc() to use png_malloc() instead of + png_malloc_default() which is not supposed to be exported. + Fixed off-by-one error in one of the conversions to PNG_ROWBYTES() in + pngpread.c. Bug was introduced in 1.2.6rc1. + Fixed bug in RGB to RGBX transformation introduced in 1.2.6rc1. + Fixed old bug in RGB to Gray transformation. + Fixed problem with 64-bit compilers by casting arguments to abs() + to png_int_32. + Changed "ln -sf" to "ln -f -s" in three makefiles (solaris, sco, so9). + Changed "HANDLE_CHUNK_*" to "PNG_HANDLE_CHUNK_*" (Cosmin) + Added "-@/bin/rm -f $(DL)/$(LIBNAME).so.$(PNGMAJ)" to 15 *NIX makefiles. + Added code to update the row_info->colortype in png_do_read_filler() (MSB). +version 1.0.16rc3 and 1.2.6rc3 [August 9, 2004] + Eliminated use of "abs()" in testing cHRM and gAMA values, to avoid + trouble with some 64-bit compilers. Created PNG_OUT_OF_RANGE() macro. + Revised documentation of png_set_keep_unknown_chunks(). + Check handle_as_unknown status in pngpread.c, as in pngread.c previously. + Moved "PNG_HANDLE_CHUNK_*" macros out of PNG_INTERNAL section of png.h + Added "rim" definitions for CONST4 and CONST6 in pnggccrd.c +version 1.0.16rc4 and 1.2.6rc4 [August 10, 2004] + Fixed mistake in pngtest.c introduced in 1.2.6rc2 (declaration of + "pinfo" was out of place). +version 1.0.16rc5 and 1.2.6rc5 [August 10, 2004] + Moved "PNG_HANDLE_CHUNK_*" macros out of PNG_ASSEMBLER_CODE_SUPPORTED + section of png.h where they were inadvertently placed in version rc3. + +version 1.2.6 and 1.0.16 [August 15, 2004] + Revised pngtest so memory allocation testing is only done when PNG_DEBUG==1. +version 1.2.7beta1 [August 26, 2004] + Removed unused pngasmrd.h file. + Removed references to uu.net for archived files. Added references to + PNG Spec (second edition) and the PNG ISO/IEC Standard. + Added "test-dd" target in 15 makefiles, to run pngtest in DESTDIR. + Fixed bug with "optimized window size" in the IDAT datastream, that + causes libpng to write PNG files with incorrect zlib header bytes. +version 1.2.7beta2 [August 28, 2004] + Fixed bug with sCAL chunk and big-endian machines (David Munro). + Undid new code added in 1.2.6rc2 to update the color_type in + png_set_filler(). + Added png_set_add_alpha() that updates color type. +version 1.0.17rc1 and 1.2.7rc1 [September 4, 2004] + Revised png_set_strip_filler() to not remove alpha if color_type has alpha. + +version 1.2.7 and 1.0.17 [September 12, 2004] + Added makefile.hp64 + Changed projects/msvc/png32ms.def to scripts/png32ms.def in makefile.cygwin +version 1.2.8beta1 [November 1, 2004] + Fixed bug in png_text_compress() that would fail to complete a large block. + Fixed bug, introduced in libpng-1.2.7, that overruns a buffer during + strip alpha operation in png_do_strip_filler(). + Added PNG_1_2_X definition in pngconf.h + Comment out with #ifdef/#endif png_info_init in png.c and png_read_init + in pngread.c (as of 1.3.0) +version 1.2.8beta2 [November 2, 2004] + Reduce color_type to a nonalpha type after strip alpha operation in + png_do_strip_filler(). +version 1.2.8beta3 [November 3, 2004] + Revised definitions of PNG_MAX_UINT_32, PNG_MAX_SIZE, and PNG_MAXSUM +version 1.2.8beta4 [November 12, 2004] + Fixed (again) definition of PNG_LIBPNG_VER_DLLNUM in png.h (Cosmin). + Added PNG_LIBPNG_BUILD_PRIVATE in png.h (Cosmin). + Set png_ptr->zstream.data_type to Z_BINARY, to avoid unnecessary detection + of data type in deflate (Cosmin). + Deprecated but continue to support SPECIALBUILD and PRIVATEBUILD in favor of + PNG_LIBPNG_BUILD_SPECIAL_STRING and PNG_LIBPNG_BUILD_PRIVATE_STRING. +version 1.2.8beta5 [November 20, 2004] + Use png_ptr->flags instead of png_ptr->transformations to pass + PNG_STRIP_ALPHA info to png_do_strip_filler(), to preserve ABI + compatibility. + Revised handling of SPECIALBUILD, PRIVATEBUILD, + PNG_LIBPNG_BUILD_SPECIAL_STRING and PNG_LIBPNG_BUILD_PRIVATE_STRING. +version 1.2.8rc1 [November 24, 2004] + Moved handling of BUILD macros from pngconf.h to png.h + Added definition of PNG_LIBPNG_BASE_TYPE in png.h, inadvertently + omitted from beta5. + Revised scripts/pngw32.rc + Despammed mailing addresses by masking "@" with "at". + Inadvertently installed a supposedly faster test version of pngrutil.c +version 1.2.8rc2 [November 26, 2004] + Added two missing "\" in png.h + Change tests in pngread.c and pngpread.c to + if (png_ptr->transformations || (png_ptr->flags&PNG_FLAG_STRIP_ALPHA)) + png_do_read_transformations(png_ptr); +version 1.2.8rc3 [November 28, 2004] + Reverted pngrutil.c to version libpng-1.2.8beta5. + Added scripts/makefile.elf with supporting code in pngconf.h for symbol + versioning (John Bowler). +version 1.2.8rc4 [November 29, 2004] + Added projects/visualc7 (Simon-pierre). +version 1.2.8rc5 [November 29, 2004] + Fixed new typo in scripts/pngw32.rc + +version 1.2.8 [December 3, 2004] + Removed projects/visualc7, added projects/visualc71. + +version 1.2.9beta1 [February 21, 2006] + + Initialized some structure members in pngwutil.c to avoid gcc-4.0.0 complaints + Revised man page and libpng.txt to make it clear that one should not call + png_read_end or png_write_end after png_read_png or png_write_png. + Updated references to png-mng-implement mailing list. + Fixed an incorrect typecast in pngrutil.c + Added PNG_NO_READ_SUPPORTED conditional for making a write-only library. + Added PNG_NO_WRITE_INTERLACING_SUPPORTED conditional. + Optimized alpha-inversion loops in pngwtran.c + Moved test for nonzero gamma outside of png_build_gamma_table() in pngrtran.c + Make sure num_trans is <= 256 before copying data in png_set_tRNS(). + Make sure num_palette is <= 256 before copying data in png_set_PLTE(). + Interchanged order of write_swap_alpha and write_invert_alpha transforms. + Added parentheses in the definition of PNG_LIBPNG_BUILD_TYPE (Cosmin). + Optimized zlib window flag (CINFO) in contrib/pngsuite/*.png (Cosmin). + Updated scripts/makefile.bc32 for Borland C++ 5.6 (Cosmin). + Exported png_get_uint_32, png_save_uint_32, png_get_uint_16, png_save_uint_16, + png_get_int_32, png_save_int_32, png_get_uint_31 (Cosmin). + Added type cast (png_byte) in png_write_sCAL() (Cosmin). + Fixed scripts/makefile.cygwin (Christian Biesinger, Cosmin). + Default iTXt support was inadvertently enabled. + +version 1.2.9beta2 [February 21, 2006] + + Check for png_rgb_to_gray and png_gray_to_rgb read transformations before + checking for png_read_dither in pngrtran.c + Revised checking of chromaticity limits to accommodate extended RGB + colorspace (John Denker). + Changed line endings in some of the project files to CRLF, even in the + "Unix" tar distributions (Cosmin). + Made png_get_int_32 and png_save_int_32 always available (Cosmin). + Updated scripts/pngos2.def, scripts/pngw32.def and projects/wince/png32ce.def + with the newly exported functions. + Eliminated distributions without the "configure" script. + Updated INSTALL instructions. + +version 1.2.9beta3 [February 24, 2006] + + Fixed CRCRLF line endings in contrib/visupng/VisualPng.dsp + Made libpng.pc respect EXEC_PREFIX (D. P. Kreil, J. Bowler) + Removed reference to pngasmrd.h from Makefile.am + Renamed CHANGES to ChangeLog. + Renamed LICENSE to COPYING. + Renamed ANNOUNCE to NEWS. + Created AUTHORS file. + +version 1.2.9beta4 [March 3, 2006] + + Changed definition of PKGCONFIG from $prefix/lib to $libdir in configure.ac + Reverted to filenames LICENSE and ANNOUNCE; removed AUTHORS and COPYING. + Removed newline from the end of some error and warning messages. + Removed test for sqrt() from configure.ac and configure. + Made swap tables in pngtrans.c PNG_CONST (Carlo Bramix). + Disabled default iTXt support that was inadvertently enabled in + libpng-1.2.9beta1. + Added "OS2" to list of systems that don't need underscores, in pnggccrd.c + Removed libpng version and date from *.c files. + +version 1.2.9beta5 [March 4, 2006] + Removed trailing blanks from source files. + Put version and date of latest change in each source file, and changed + copyright year accordingly. + More cleanup of configure.ac, Makefile.am, and associated scripts. + Restored scripts/makefile.elf which was inadvertently deleted. + +version 1.2.9beta6 [March 6, 2006] + Fixed typo (RELEASE) in configuration files. + +version 1.2.9beta7 [March 7, 2006] + Removed libpng.vers and libpng.sym from libpng12_la_SOURCES in Makefile.am + Fixed inconsistent #ifdef's around png_sig_bytes() and png_set_sCAL_s() + in png.h. + Updated makefile.elf as suggested by debian. + Made cosmetic changes to some makefiles, adding LN_SF and other macros. + Made some makefiles accept "exec_prefix". + +version 1.2.9beta8 [March 9, 2006] + Fixed some "#if defined (..." which should be "#if defined(..." + Bug introduced in libpng-1.2.8. + Fixed inconsistency in definition of png_default_read_data() + Restored blank that was lost from makefile.sggcc "clean" target in beta7. + Revised calculation of "current" and "major" for irix in ltmain.sh + Changed "mkdir" to "MKDIR_P" in some makefiles. + Separated PNG_EXPAND and PNG_EXPAND_tRNS. + Added png_set_expand_gray_1_2_4_to_8() and deprecated + png_set_gray_1_2_4_to_8() which also expands tRNS to alpha. + +version 1.2.9beta9 [March 10, 2006] + Include "config.h" in pngconf.h when available. + Added some checks for NULL png_ptr or NULL info_ptr (timeless) + +version 1.2.9beta10 [March 20, 2006] + Removed extra CR from contrib/visualpng/VisualPng.dsw (Cosmin) + Made pnggccrd.c PIC-compliant (Christian Aichinger). + Added makefile.mingw (Wolfgang Glas). + Revised pngconf.h MMX checking. + +version 1.2.9beta11 [March 22, 2006] + Fixed out-of-order declaration in pngwrite.c that was introduced in beta9 + Simplified some makefiles by using LIBSO, LIBSOMAJ, and LIBSOVER macros. + +version 1.2.9rc1 [March 31, 2006] + Defined PNG_USER_PRIVATEBUILD when including "pngusr.h" (Cosmin). + Removed nonsensical assertion check from pngtest.c (Cosmin). + +version 1.2.9 [April 14, 2006] + Revised makefile.beos and added "none" selector in ltmain.sh + +version 1.2.10beta1 [April 15, 2006] + Renamed "config.h" to "png_conf.h" and revised Makefile.am to add + -DPNG_BUILDING_LIBPNG to compile directive, and modified pngconf.h + to include png_conf.h only when PNG_BUILDING_LIBPNG is defined. + +version 1.2.10beta2 [April 15, 2006] + Manually updated Makefile.in and configure. Changed png_conf.h.in + back to config.h. + +version 1.2.10beta3 [April 15, 2006] + Change png_conf.h back to config.h in pngconf.h. + +version 1.2.10beta4 [April 16, 2006] + Change PNG_BUILDING_LIBPNG to PNG_CONFIGURE_LIBPNG in config/Makefile*. + +version 1.2.10beta5 [April 16, 2006] + Added a configure check for compiling assembler code in pnggccrd.c + +version 1.2.10beta6 [April 17, 2006] + Revised the configure check for pnggccrd.c + Moved -DPNG_CONFIGURE_LIBPNG into @LIBPNG_DEFINES@ + Added @LIBPNG_DEFINES@ to arguments when building libpng.sym + +version 1.2.10beta7 [April 18, 2006] + Change "exec_prefix=$prefix" to "exec_prefix=$(prefix)" in makefiles. + +version 1.2.10rc1 [April 19, 2006] + Ensure pngconf.h doesn't define both PNG_USE_PNGGCCRD and PNG_USE_PNGVCRD + Fixed "LN_FS" typo in makefile.sco and makefile.solaris. + +version 1.2.10rc2 [April 20, 2006] + Added a backslash between -DPNG_CONFIGURE_LIBPNG and -DPNG_NO_ASSEMBLER_CODE + in configure.ac and configure + Made the configure warning about versioned symbols less arrogant. + +version 1.2.10rc3 [April 21, 2006] + Added a note in libpng.txt that png_set_sig_bytes(8) can be used when + writing an embedded PNG without the 8-byte signature. + Revised makefiles and configure to avoid making links to libpng.so.* + +version 1.2.10 [April 23, 2006] + Reverted configure to "rc2" state. + +version 1.2.11beta1 [May 31, 2006] + scripts/libpng.pc.in contained "configure" style version info and would + not work with makefiles. + The shared-library makefiles were linking to libpng.so.0 instead of + libpng.so.3 compatibility as the library. + +version 1.2.11beta2 [June 2, 2006] + Increased sprintf buffer from 50 to 52 chars in pngrutil.c to avoid + buffer overflow. + Fixed bug in example.c (png_set_palette_rgb -> png_set_palette_to_rgb) + +version 1.2.11beta3 [June 5, 2006] + Prepended "#! /bin/sh" to ltmail.sh and contrib/pngminus/*.sh (Cosmin). + Removed the accidental leftover Makefile.in~ (Cosmin). + Avoided potential buffer overflow and optimized buffer in + png_write_sCAL(), png_write_sCAL_s() (Cosmin). + Removed the include directories and libraries from CFLAGS and LDFLAGS + in scripts/makefile.gcc (Nelson A. de Oliveira, Cosmin). + +version 1.2.11beta4 [June 6, 2006] + Allow zero-length IDAT chunks after the entire zlib datastream, but not + after another intervening chunk type. + +version 1.0.19rc1, 1.2.11rc1 [June 13, 2006] + Deleted extraneous square brackets from [config.h] in configure.ac + +version 1.0.19rc2, 1.2.11rc2 [June 14, 2006] + Added prototypes for PNG_INCH_CONVERSIONS functions to png.h + Revised INSTALL and autogen.sh + Fixed typo in several makefiles (-W1 should be -Wl) + Added typedef for png_int_32 and png_uint_32 on 64-bit systems. + +version 1.0.19rc3, 1.2.11rc3 [June 15, 2006] + Removed the new typedefs for 64-bit systems (delay until version 1.4.0) + Added one zero element to png_gamma_shift[] array in pngrtran.c to avoid + reading out of bounds. + +version 1.0.19rc4, 1.2.11rc4 [June 15, 2006] + Really removed the new typedefs for 64-bit systems. + +version 1.0.19rc5, 1.2.11rc5 [June 22, 2006] + Removed png_sig_bytes entry from scripts/pngw32.def + +version 1.0.19, 1.2.11 [June 26, 2006] + None. + +version 1.0.20, 1.2.12 [June 27, 2006] + Really increased sprintf buffer from 50 to 52 chars in pngrutil.c to avoid + buffer overflow. + +version 1.2.13beta1 [October 2, 2006] + Removed AC_FUNC_MALLOC from configure.ac + Work around Intel-Mac compiler bug by setting PNG_NO_MMX_CODE in pngconf.h + Change "logical" to "bitwise" throughout documentation. + Detect and fix attempt to write wrong iCCP profile length. + +version 1.0.21, 1.2.13 [November 14, 2006] + Fix potential buffer overflow in sPLT chunk handler. + Fix Makefile.am to not try to link to noexistent files. + Check all exported functions for NULL png_ptr. + +version 1.2.14beta1 [November 17, 2006] + Relocated three misplaced tests for NULL png_ptr. + Built Makefile.in with automake-1.9.6 instead of 1.9.2. + Build configure with autoconf-2.60 instead of 2.59 + +version 1.2.14beta2 [November 17, 2006] + Added some typecasts in png_zalloc(). + +version 1.2.14rc1 [November 20, 2006] + Changed "strtod" to "png_strtod" in pngrutil.c + +version 1.0.22, 1.2.14 [November 27, 2006] + Added missing "$(srcdir)" in Makefile.am and Makefile.in + +version 1.2.15beta1 [December 3, 2006] + Generated configure with autoconf-2.61 instead of 2.60 + Revised configure.ac to update libpng.pc and libpng-config. + +version 1.2.15beta2 [December 3, 2006] + Always export MMX asm functions, just stubs if not building pnggccrd.c + +version 1.2.15beta3 [December 4, 2006] + Add "png_bytep" typecast to profile while calculating length in pngwutil.c + +version 1.2.15beta4 [December 7, 2006] + Added scripts/CMakeLists.txt + Changed PNG_NO_ASSEMBLER_CODE to PNG_NO_MMX_CODE in scripts, like 1.4.0beta + +version 1.2.15beta5 [December 7, 2006] + Changed some instances of PNG_ASSEMBLER_* to PNG_MMX_* in pnggccrd.c + Revised scripts/CMakeLists.txt + +version 1.2.15beta6 [December 13, 2006] + Revised scripts/CMakeLists.txt and configure.ac + +version 1.2.15rc1 [December 18, 2006] + Revised scripts/CMakeLists.txt + +version 1.2.15rc2 [December 21, 2006] + Added conditional #undef jmpbuf in pngtest.c to undo #define in AIX headers. + Added scripts/makefile.nommx + +version 1.2.15rc3 [December 25, 2006] + Fixed shared library numbering error that was introduced in 1.2.15beta6. + +version 1.2.15rc4 [December 27, 2006] + Fixed handling of rgb_to_gray when png_ptr->color.gray isn't set. + +version 1.2.15rc5 [December 31, 2006] + Revised handling of rgb_to_gray. + +version 1.0.23, 1.2.15 [January 5, 2007] + Added some (unsigned long) typecasts in pngtest.c to avoid printing errors. + +version 1.2.16beta1 [January 6, 2007] + Fix bugs in makefile.nommx + +version 1.2.16beta2 [January 16, 2007] + Revised scripts/CMakeLists.txt + +version 1.0.24, 1.2.16 [January 31, 2007] + No changes. + +version 1.2.17beta1 [March 6, 2007] + Revised scripts/CMakeLists.txt to install both shared and static libraries. + Deleted a redundant line from pngset.c. + +version 1.2.17beta2 [April 26, 2007] + Relocated misplaced test for png_ptr == NULL in pngpread.c + Change "==" to "&" for testing PNG_RGB_TO_GRAY_ERR & PNG_RGB_TO_GRAY_WARN + flags. + Changed remaining instances of PNG_ASSEMBLER_* to PNG_MMX_* + Added pngerror() when write_IHDR fails in deflateInit2(). + Added "const" to some array declarations. + Mention examples of libpng usage in the libpng*.txt and libpng.3 documents. + +version 1.2.17rc1 [May 4, 2007] + No changes. + +version 1.2.17rc2 [May 8, 2007] + Moved several PNG_HAVE_* macros out of PNG_INTERNAL because applications + calling set_unknown_chunk_location() need them. + Changed transformation flag from PNG_EXPAND_tRNS to PNG_EXPAND in + png_set_expand_gray_1_2_4_to_8(). + Added png_ptr->unknown_chunk to hold working unknown chunk data, so it + can be free'ed in case of error. Revised unknown chunk handling in + pngrutil.c and pngpread.c to use this structure. + +version 1.2.17rc3 [May 8, 2007] + Revised symbol-handling in configure script. + +version 1.2.17rc4 [May 10, 2007] + Revised unknown chunk handling to avoid storing unknown critical chunks. + +version 1.0.25 [May 15, 2007] +version 1.2.17 [May 15, 2007] + Added "png_ptr->num_trans=0" before error return in png_handle_tRNS, + to eliminate a vulnerability (CVE-2007-2445, CERT VU#684664) + +version 1.0.26 [May 15, 2007] +version 1.2.18 [May 15, 2007] + Reverted the libpng-1.2.17rc3 change to symbol-handling in configure script + +version 1.2.19beta1 [May 18, 2007] + Changed "const static" to "static PNG_CONST" everywhere, mostly undoing + change of libpng-1.2.17beta2. Changed other "const" to "PNG_CONST" + Changed some handling of unused parameters, to avoid compiler warnings. + "if (unused == NULL) return;" becomes "unused = unused". + +version 1.2.19beta2 [May 18, 2007] + Only use the valid bits of tRNS value in png_do_expand() (Brian Cartier) + +version 1.2.19beta3 [May 19, 2007] + Add some "png_byte" typecasts in png_check_keyword() and write new_key + instead of key in zTXt chunk (Kevin Ryde). + +version 1.2.19beta4 [May 21, 2007] + Add png_snprintf() function and use it in place of sprint() for improved + defense against buffer overflows. + +version 1.2.19beta5 [May 21, 2007] + Fixed png_handle_tRNS() to only use the valid bits of tRNS value. + Changed handling of more unused parameters, to avoid compiler warnings. + Removed some PNG_CONST in pngwutil.c to avoid compiler warnings. + +version 1.2.19beta6 [May 22, 2007] + Added some #ifdef PNG_MMX_CODE_SUPPORTED where needed in pngvcrd.c + Added a special "_MSC_VER" case that defines png_snprintf to _snprintf + +version 1.2.19beta7 [May 22, 2007] + Squelched png_squelch_warnings() in pnggccrd.c and added + an #ifdef PNG_MMX_CODE_SUPPORTED/#endif block around the declarations + that caused the warnings that png_squelch_warnings was squelching. + +version 1.2.19beta8 [May 22, 2007] + Removed __MMX__ from test in pngconf.h. + +version 1.2.19beta9 [May 23, 2007] + Made png_squelch_warnings() available via PNG_SQUELCH_WARNINGS macro. + Revised png_squelch_warnings() so it might work. + Updated makefile.sgcc and makefile.solaris; added makefile.solaris-x86. + +version 1.2.19beta10 [May 24, 2007] + Resquelched png_squelch_warnings(), use "__attribute__((used))" instead. + +version 1.2.19beta11 [May 28, 2007] + Return 0 from png_get_sPLT() and png_get_unknown_chunks() if png_ptr is NULL; + changed three remaining instances of png_strcpy() to png_strncpy() (David + Hill). + Make test for NULL row_buf at the beginning of png_do_read_transformations + unconditional. + +version 1.2.19beta12 [May 28, 2007] + Revised pnggccrd.c. + +version 1.2.19beta13 [June 14, 2007] + Prefer PNG_USE_PNGVCRD when _MSC_VER is defined in pngconf.h + +version 1.2.19beta14 [June 16, 2007] + Fix bug with handling of 16-bit transparency, introduced in 1.2.19beta2 + +version 1.2.19beta15 [June 17, 2007] + Revised pnggccrd.c. + +version 1.2.19beta16 [June 18, 2007] + Revised pnggccrd.c again. + Updated contrib/gregbook. + Changed '#include "pnggccrd.c"' to 'include "$srcdir/pnggccrd.c"' + in configure.ac + +version 1.2.19beta17 [June 19, 2007] + Revised many of the makefiles, to set -DPNG_NO_MMX_CODE where needed + and to not use -O3 unless -DPNG_NO_MMX_CODE is also set. + +version 1.2.19beta18 [June 23, 2007] + Replaced some C++ style comments with C style comments in pnggccrd.c. + Copied optimized C code from pnggccrd.c to pngrutil.c, removed dependency + on pnggccrd.o from many makefiles. + Added sl and dylib to list of extensions be installed by Makefile.am + +version 1.2.19beta19 [June 28, 2007] + Fixed testing PNG_RGB_TO_GRAY_ERR & PNG_RGB_TO_GRAY_WARN in pngrtran.c + More cleanup of pnggccrd.c and pngvcrd.c + +version 1.2.19beta20 [June 29, 2007] + Rebuilt Makefile.in and configure using libtool-1.5.24. + Fixed typo in pnggccrd.c + +version 1.2.19beta21 [June 30, 2007] + More revision of pnggccrd.c + Added "test" target to Makefile.in and Makefile.am + +version 1.2.19beta22 [July 3, 2007] + Added info about pngrutil/pnggccrd/pngvcrd to png_get_header_version() + Fix type definition of dummy_value_a, b in pnggccrd.c + +version 1.2.19beta23 [July 10, 2007] + Revert change to type definition of dummy_value_a, b in pnggccrd.c + Make sure __PIC__ is defined in pnggccrd.c when PIC is defined. + Require gcc-4.1 or better to use PNG_HAVE_MMX_FILTER_ROW on x86_64 platforms + +version 1.2.19beta24 [July 14, 2007] + Added PNG_NO_READ_FILTER, PNG_NO_WRITE_FILTER, PNG_NO_WARNING macros. + Added contrib/pngminim to demonstrate building minimal encoder and decoder + +version 1.2.19beta25 [July 15, 2007] + Removed the new PNG_NO_READ_FILTER macro since it would make the library + unable to read valid PNG files, and filtering is at the heart of the + PNG format. + +version 1.2.19beta26 [July 16, 2007] + Changed "png_free(str)" to "png_free(png_ptr,str)" in pngrutil.c WinCE + code (Yves Piguet). This bug was introduced in libpng-1.2.14. + Updated scripts/CMakeLists.txt + Relocated a misplaced #endif in pnggccrd.c + +version 1.2.19beta27 [July 17, 2007] + Fixed incorrect stride and number of bytes copied (was 4 instead of + 6 bytes) in the cleanup loop of pnggccrd.c and pngvcrd.c for handling + the end of 48-bit interlaced rows (Glenn R-P). + +version 1.2.19beta28 [July 19, 2007] + Removed requirement for gcc-4.1 or better to use PNG_HAVE_MMX_FILTER_ROW + on x86_64 platforms + Added png_warning() in pngrutil.c for short iCCP, iTXt, sPLT, or zTXT chunks. + Revised pngtest.c so warnings are displayed regardless of PNG_NO_STDIO. + +version 1.2.19beta29 [July 20, 2007] + Fix typo in pnggccrd.c (%%eax should be %%ax in secondloop48) + +version 1.2.19beta30 [July 26, 2007] + Revised pnggccrd.c + +version 1.2.19beta31 [July 27, 2007] + Fix typos in pnggccrd.c + +version 1.0.27rc1 and 1.2.19rc1 [July 31, 2007] + Disable PNG_MMX_CODE_SUPPORTED when PNG_ASSEMBLER_CODE_SUPPORTED is off. + Enable PNG_MMX_READ_FILTER_* by default, except when gcc-3.x is being + used (they were inadvertently disabled in libpng-1.2.19beta23). + Fix some debugging statements in pnggccrd.c and pngrutil.c + Added information about disabling the MMX code in libpng documentation. + +version 1.0.27rc2 and 1.2.19rc2 [August 4, 2007] + Removed some "#if 0" blocks. + Made a global struct local in pngvcrd.c to make it thread safe. + Issue a png_error() if application attempts to transform a row tht + has not been initialized. + +version 1.0.27rc3 and 1.2.19rc3 [August 9, 2007] + Slightly revised pngvcrd.c + +version 1.0.27rc4 and 1.2.19rc4 [August 9, 2007] + Revised pnggccrd.c debugging change of rc1, which was broken. + Revised scripts/CMakeLists.txt + Change default to PNG_NO_GLOBAL_ARRAYS for MSVC. + Turn off PNG_FLAG_ROW_INIT flag when setting transforms that expand pixels. + +version 1.0.27rc5 and 1.2.19rc5 [August 10, 2007] + Fix typo (missing '"') in pnggccrd.c + Revise handling of png_strtod in recent versions of WINCE + +version 1.0.27rc6 and 1.2.19rc6 [August 15, 2007] + Fix typo (missing ',') in contrib/gregbook/readpng2.c + Undid row initialization error exit added to rc2 and rc4. + +version 1.0.27 and 1.2.19 [August 18, 2007] + Conditionally restored row initialization error exit. + +version 1.2.20beta01 [August 19, 2007] + Fixed problem with compiling pnggccrd.c on Intel-Apple platforms. + Changed png_malloc() to png_malloc_warn() in png_set_sPLT(). + Added PNG_NO_ERROR_TEXT feature, with demo in contrib/pngminim + Removed define PNG_WARN_UNINITIALIZED_ROW 1 /* 0: warning; 1: error */ + because it caused some trouble. + +version 1.2.20beta02 [August 20, 2007] + Avoid compiling pnggccrd.c on Intel-Apple platforms. + +version 1.2.20beta03 [August 20, 2007] + Added "/D PNG_NO_MMX_CODE" to the non-mmx builds of projects/visualc6 + and visualc71. + +version 1.2.20beta04 [August 21, 2007] + Revised pngvcrd.c for improved efficiency (Steve Snyder). + +version 1.2.20rc1 [August 23, 2007] + Revised pngconf.h to set PNG_NO_MMX_CODE for gcc-3.x compilers. + +version 1.2.20rc2 [August 27, 2007] + Revised scripts/CMakeLists.txt + Revised #ifdefs to ensure one and only one of pnggccrd.c, pngvcrd.c, + or part of pngrutil.c is selected. + +version 1.2.20rc3 [August 30, 2007] + Remove a little more code in pngwutil.c when PNG_NO_WRITE_FILTER is selected. + Added /D _CRT_SECURE_NO_WARNINGS to visual6c and visualc71 projects. + Compile png_mmx_support() in png.c even when PNG_NO_MMX_CODE is defined. + Restored a "superfluous" #ifdef that was removed from 1.2.20rc2 pnggccrd.c, + breaking the png_mmx_support() function. + +version 1.2.20rc4 [September 1, 2007] + Removed Intel contributions (MMX, Optimized C). + +version 1.2.20rc5 [September 2, 2007] + Restored configure and Makefile.in to rc3 and put a snippet of code in + pnggccrd.c, to ensure configure makes the same PNG_NO_MMX_CODE selection + +version 1.2.20rc6 [September 2, 2007] + Fixed bugs in scripts/CMakeLists.txt + Removed pngvcrd.c references from msvc projects. + +version 1.0.28 and 1.2.20 [September 8, 2007] + Removed "(NO READ SUPPORT)" from png_get_header_version() string. + +version 1.2.21beta1 [September 14, 2007] + Fixed various mistakes reported by George Cook and Jeff Phillips: + logical vs bitwise NOT in pngrtran.c, bug introduced in 1.2.19rc2 + 16-bit cheap transparency expansion, bug introduced in 1.2.19beta2 + errors with sizeof(unknown_chunk.name), bugs introduced in 1.2.19beta11 + <= compare with unsigned var in pngset.c, should be ==. + +version 1.2.21beta2 [September 18, 2007] + Removed some extraneous typecasts. + +version 1.2.21rc1 [September 25, 2007] + Fixed potential out-of-bounds reads in png_handle_pCAL() and + png_handle_ztXt() ("flayer" results reported by Tavis Ormandy). + +version 1.2.21rc2 [September 26, 2007] + Fixed potential out-of-bounds reads in png_handle_sCAL(), + png_handle_iTXt(), and png_push_read_tEXt(). + Remove some PNG_CONST declarations from pngwutil.c to avoid compiler warnings + Revised makefiles to update paths in libpng.pc properly. + +version 1.2.21rc3 [September 27, 2007] + Revised makefiles to update "Libs" in libpng.pc properly. + +version 1.0.29 and 1.2.21rc3 [October 4, 2007] + No changes. + +version 1.2.22beta1 [October 4, 2007] + Again, fixed logical vs bitwise NOT in pngrtran.c, bug introduced + in 1.2.19rc2 + +version 1.2.22beta2 [October 5, 2007] + Fixed string length error in pngset.c (caused crashes while decoding iCCP) + Add terminating NULL after each instance of png_strncpy(). + +version 1.2.22beta3 [October 6, 2007] + Fix two off-by-one terminating NULL after png_strncpy(). + +version 1.2.22beta4 [October 7, 2007] + Changed some 0 to '\0'. + +version 1.0.30rc1 and 1.2.22rc1 [October 8, 2007] + No changes. + +version 1.0.30 and 1.2.22 [October 13, 2007] + No changes. + +version 1.2.23beta01 [October 15, 2007] + Reduced number of invocations of png_strlen() in pngset.c. + Changed [azAZ09_] to [_abcde...89] in Makefile.am for better localization. + +version 1.2.23beta02 [October 16, 2007] + Eliminated png_strncpy() and png_strcpy() (Pierre Poissinger) + Changed $AN to $(AN) in Makefile.am. + +version 1.2.23beta03 [October 16, 2007] + Fixed off-by-one error in pngset.c + Restore statement to set last character of buffer to \0 in pngerror.c + +version 1.2.23beta04 [October 23, 2007] + Reject attempt to set all-zero cHRM values. + +version 1.2.23beta05 [October 26, 2007] + Add missing quotes in projects/visualc6, lost in version 1.2.20rc3 + +version 1.2.23rc01 [November 2, 2007] + No changes. + +version 1.2.23 [November 6, 2007] + No changes. + +version 1.2.24beta01 [November 19, 2007] + Moved misplaced test for malloc failure in png_set_sPLT(). This bug was + introduced in libpng-1.2.20beta01. + Ifdef out avg_row etc from png.h and pngwrite.c when PNG_NO_WRITE_FILTER + Do not use png_ptr->free_fn and png_ptr->mem_fn in png_destroy_read_struct() + when png_ptr is NULL (Marshall Clow). + Updated handling of symbol prefixes in Makefile.am and configure.ac (Mike + Frysinger). + +version 1.2.24beta02 [November 30, 2007] + Removed a useless test and fixed incorrect test in png_set_cHRM_fixed() + (David Hill). + +version 1.2.24rc01 [December 7, 2007] + No changes. + +version 1.2.24 [December 14, 2007] + Make sure not to redefine _BSD_SOURCE in pngconf.h + Revised gather.sh and makefile.std in contrib/pngminim to avoid compiling + unused files. + +version 1.2.25beta01 [January 7, 2008] + Fixed bug with unknown chunk handling, introduced in version 1.2.17rc2 + +version 1.2.25beta02 [January 10, 2008] + Prevent gamma from being applied twice. + +version 1.2.25rc01 [January 17, 2008] + No changes. + +version 1.2.25beta03 [January 22, 2008] + Fixed some continue-after-malloc-failure errors in pngset.c (David Hill) + Check for info_ptr == NULL in png_read_info() and png_process_data(). + Check for possible use of NULL user_png_ver[] in png_create_read_struct(). + Change "if (swidth == NULL)" to "if (sheight == NULL)" in png_handle_sCAL + (bug introduced in libpng-1.2.4/1.0.13). + Return from png_destroy_read_struct() if png_ptr_ptr is NULL. + Fix overflow of "msg" in png_decompress_chunk(). + +version 1.2.25beta04 [January 26, 2008] + Work around Coverity bug report by slightly refactoring + png_read_push_finish_row() + +version 1.2.25beta05 [January 31, 2008] + Added libpng-1.2.25beta05.tar.lzma to distribution. Get the lzma codec + from . + Added lp1225b05.7z to distribution. Get the 7-zip decoder from + from . + Fixed some broken links in the README file. + +version 1.2.25beta06 [February 6, 2008] + Refactored png_read_push_finish_row() again, trying to satisfy Coverity. + Fixed potential NULL dereference of png_ptr in png_destroy_write_struct(); + clarified potential NULL dereference of png_ptr in png_destroy_read_struct(); + fixed potential NULL dereference of info_ptr in png_handle_bKGD(); + fixed potential NULL dereference of user_png_ver[] in + png_create_write_struct_2(). (Coverity) + +version 1.2.25rc02 [February 10, 2008] + Reset png_ptr->pass in png_read_push_finish_row() before break. + Changed "pass" from png_byte to int. + +version 1.2.25 and 1.0.31 [February 18, 2008] + No changes. + +version 1.2.26beta01 [February 21, 2008] + Added missing "(" in pngmem.c. Bug introduced in libpng-1.2.2/1.0.13 + +version 1.2.26beta02 [March 12, 2008] + Refined error message returned from deflateInit2 in pngwutil.c + Check IHDR length in png_push_read_chunk() before saving it. + +version 1.2.26beta03 [March 16, 2008] + Revised contrib/gregbook to handle premature end-of-file and file + read errors correctly. + +version 1.2.26beta04 [March 18, 2008] + Free png_ptr->big_row_buf and png_ptr->prev_row before allocating + new copies in png_read_start_row(). Bug introduced in libpng-1.2.22. + +version 1.2.26beta05 [March 19, 2008] + Removed extra png_free() added in libpng-1.2.26beta04. + +version 1.2.26beta06 [March 19, 2008] + Avoid reallocating big_row_buf and prev_row when the size does not increase. + +version 1.2.26rc01 [March 26, 2008] + Ifdef out some code that is unused when interlacing is not supported. + +versions 1.0.32 and 1.2.26 [April 2, 2008] + No changes. + +version 1.2.27beta01 [April 12, 2008] + Fixed bug (introduced in libpng-1.0.5h) with handling zero-length + unknown chunks. + Added more information about png_set_keep_unknown_chunks() to the + documentation. + Reject tRNS chunk with out-of-range samples instead of masking off + the invalid high bits as done in since libpng-1.2.19beta5. + +version 1.2.27beta02 [April 13, 2008] + Revised documentation about unknown chunk and user chunk handling. + Keep tRNS chunk with out-of-range samples and issue a png_warning(). + +version 1.2.27beta03 [April 14, 2008] + Added check for NULL ptr in TURBOC version of png_free_default(). + Removed several unnecessary checks for NULL before calling png_free(). + Revised png_set_tRNS() so that calling it twice removes and invalidates + the previous call. + Revised pngtest to check for out-of-range tRNS samples. + +version 1.2.27beta04 [April 18, 2008] + Added AC_LIBTOOL_WIN32_DLL to configure.ac + Rebuilt Makefile.in, aclocal.m4, and configure with autoconf-2.62 + +version 1.2.27beta05 [April 19, 2008] + Added MAINTAINERCLEANFILES variable to Makefile.am + +version 1.2.27beta06 [April 21, 2008] + Avoid changing color_type from GRAY to RGB by + png_set_expand_gray_1_2_4_to_8(). + +version 1.2.27rc01 [April 23, 2008] + Fix broken URL for rfc2083 in png.5 and libpng-*.txt + +version 1.0.33 and 1.2.27 [April 30, 2008] + No changes. + +version 1.0.34 and 1.2.28 [April 30, 2008] + Rebuilt Makefile.in, aclocal.m4, and configure with autoconf-2.61 + due to backward incompatibilities. + Removed a stray object file from contrib/gregbook + +version 1.2.29beta01 [May 1, 2008] + Removed some stray *.diff and *.orig files + +version 1.2.29beta02 [May 1, 2008] + Reverted Makefile.in, aclocal.m4, and configure to the libpng-1.2.26 + versions. + +version 1.2.29beta03 [May 2, 2008] + Added --force to autogen libtoolize options and --force-missing to + automake options. + Changed $(ECHO) to echo in Makefile.am and Makefile.in + Updated all configure files to autoconf-2.62 + Comment out pnggcrd.c code with #ifdef/#endif if using MSC_VER + +version 1.2.29rc01 [May 4, 2008] + No changes. + +version 1.0.35 and 1.2.29 [May 8, 2008] + No changes. + +version 1.0.37 [May 9, 2008] + Updated Makefile.in and configure (omitted version 1.0.36). + +version 1.2.30beta01 [May 29, 2008] + Updated libpng.pc-configure.in and libpng-config.in per debian bug reports. + +version 1.2.30beta02 [June 25, 2008] + Restored png_flush(png_ptr) at the end of png_write_end(), that was + removed from libpng-1.0.9beta03. + +version 1.2.30beta03 [July 6, 2008] + Merged some cosmetic whitespace changes from libpng-1.4.0beta19. + Inline call of png_get_uint_32() in png_get_uint_31(), as in 1.4.0beta19. + Added demo of decoding vpAg and sTER chunks to pngtest.c, from 1.4.0beta19. + Changed PNGMAJ from 0 to 12 in makefile.darwin, which does not like 0. + Added new private function png_read_chunk_header() from 1.4.0beta19. + Merge reading of chunk length and chunk type into a single 8-byte read. + Merge writing of chunk length and chunk type into a single 8-byte write. + +version 1.2.30beta04 [July 10, 2008] + Merged more cosmetic whitespace changes from libpng-1.4.0beta19. + +version 1.0.38rc01, 1.2.30rc01 [July 18, 2008] + No changes. + +version 1.0.38rc02, 1.2.30rc02 [July 21, 2008] + Moved local array "chunkdata" from pngrutil.c to the png_struct, so + it will be freed by png_read_destroy() in case of a read error (Kurt + Christensen). + +version 1.0.38rc03, 1.2.30rc03 [July 21, 2008] + Changed "purpose" and "buffer" to png_ptr->chunkdata to avoid memory leaking. + +version 1.0.38rc04, 1.2.30rc04 [July 22, 2008] + Changed "chunkdata = NULL" to "png_ptr->chunkdata = NULL" several places in + png_decompress_chunk(). + +version 1.0.38rc05, 1.2.30rc05 [July 25, 2008] + Changed all remaining "chunkdata" to "png_ptr->chunkdata" in + png_decompress_chunk() and remove chunkdata from parameter list. + Put a call to png_check_chunk_name() in png_read_chunk_header(). + Revised png_check_chunk_name() to reject a name with a lowercase 3rd byte. + Removed two calls to png_check_chunk_name() occuring later in the process. + +version 1.0.38rc06, 1.2.30rc06 [July 29, 2008] + Added a call to png_check_chunk_name() in pngpread.c + Reverted png_check_chunk_name() to accept a name with a lowercase 3rd byte. + +version 1.0.38r07, 1.2.30r07 [August 2, 2008] + Changed "-Wall" to "-W -Wall" in the CFLAGS in all makefiles (Cosmin Truta) + Declared png_ptr "volatile" in pngread.c and pngwrite.c to avoid warnings. + Added code in pngset.c to quiet compiler warnings. + Updated contrib/visupng/cexcept.h to version 2.0.1 + Relocated a misplaced "#endif /* PNG_NO_WRITE_FILTER */" in pngwutil.c + +version 1.0.38r08, 1.2.30r08 [August 2, 2008] + Enclose "volatile" declarations in #ifdef PNG_SETJMP_SUPPORTED (Cosmin). + +version 1.0.38, 1.2.30 [August 14, 2008] + No changes. + +version 1.2.31rc01 [August 19, 2008] + Removed extra crc check at the end of png_handle_cHRM(). Bug introduced + in libpng-1.2.30beta03 (Heiko Nitzsche). + +version 1.2.31rc02 [August 19, 2008] + Added PNG_WRITE_FLUSH_SUPPORTED block around new png_flush() call. + +version 1.2.31rc03 [August 19, 2008] + Added PNG_WRITE_FLUSH_AFTER_IEND_SUPPORTED block, off by default, around + new png_flush(). + +version 1.0.39, 1.2.31 [August 21, 2008] + No changes. + +version 1.2.32beta01 [September 6, 2008] + Shortened tIME_string to 29 bytes in pngtest.c (bug introduced in + libpng-1.2.22). + Fixed off-by-one error introduced in png_push_read_zTXt() function in + libpng-1.2.30beta04/pngpread.c (Harald van Dijk) + These bugs have been given the vulnerability id CVE-2008-3964. + +version 1.0.40, 1.2.32 [September 18, 2008] + No changes. + +version 1.2.33beta01 [October 6, 2008] + Revised makefile.darwin to fix shared library numbering. + Change png_set_gray_1_2_4_to_8() to png_set_expand_gray_1_2_4_to_8() + in example.c (debian bug report) + +version 1.2.33rc01 [October 15, 2008] + No changes. + +version 1.0.41rc01, version 1.2.33rc02 [October 23, 2008] + Changed remaining "key" to "png_ptr->chunkdata" in png_handle_tEXt() + to avoid memory leak after memory failure while reading tEXt chunk.` + +version 1.2.33 [October 31, 2008] + No changes. + +version 1.2.34beta01 [November 27, 2008] + Revised png_warning() to write its message on standard output by default + when warning_fn is NULL. This was the behavior prior to libpng-1.2.9beta9. + Fixed string vs pointer-to-string error in png_check_keyword(). + Added png_check_cHRM_fixed() in png.c and moved checking from pngget.c, + pngrutil.c, and pngwrite.c, and eliminated floating point cHRM checking. + Added check for zero-area RGB cHRM triangle in png_check_cHRM_fixed(). + In png_check_cHRM_fixed(), ensure white_y is > 0, and removed redundant + check for all-zero coordinates that is detected by the triangle check. + Revised png_warning() to write its message on standard output by default + when warning_fn is NULL. + +version 1.2.34beta02 [November 28, 2008] + Corrected off-by-one error in bKGD validity check in png_write_bKGD() + and in png_handle_bKGD(). + +version 1.2.34beta03 [December 1, 2008] + Revised bKGD validity check to use >= x instead of > x + 1 + Merged with png_debug from libpng-1.4.0 to remove newlines. + +version 1.2.34beta04 [December 2, 2008] + More merging with png_debug from libpng-1.4.0 to remove newlines. + +version 1.2.34beta05 [December 5, 2008] + Removed redundant check for key==NULL before calling png_check_keyword() + to ensure that new_key gets initialized and removed extra warning + (Arvan Pritchard). + +version 1.2.34beta06 [December 9, 2008] + In png_write_png(), respect the placement of the filler bytes in an earlier + call to png_set_filler() (Jim Barry). + +version 1.2.34beta07 [December 9, 2008] + Undid previous change and added PNG_TRANSFORM_STRIP_FILLER_BEFORE and + PNG_TRANSFORM_STRIP_FILLER_AFTER conditionals and deprecated + PNG_TRANSFORM_STRIP_FILLER (Jim Barry). + +version 1.0.42rc01, 1.2.34rc01 [December 11, 2008] + No changes. + +version 1.0.42, 1.2.34 [December 18, 2008] + No changes. + +version 1.2.35beta01 [February 4, 2009] + Zero out some arrays of pointers after png_malloc(). (Tavis Ormandy) + +version 1.2.35beta02 [February 4, 2009] + Zero out more arrays of pointers after png_malloc(). + +version 1.2.35beta03 [February 5, 2009] + Use png_memset() instead of a loop to intialize pointers. We realize + this will not work on platforms where the NULL pointer is not all zeroes. + +version 1.2.35rc01 [February 11, 2009] + No changes. + +version 1.2.35rc02 [February 12, 2009] + Fix typo in new png_memset call in pngset.c (png_color should be png_charp) + +version 1.0.43 and 1.2.35 [February 14, 2009] + No changes. + +version 1.2.36beta01 [February 28, 2009] + Revised comments in png_set_read_fn() and png_set_write_fn(). + Revised order of #ifdef's and indentation in png_debug definitions of png.h + bug introduced in libpng-1.2.34. + +version 1.2.36beta02 [March 21, 2009] + Use png_memset() after png_malloc() of big_row_buf when reading an + interlaced file, to avoid a possible UMR. + Undid recent revision of PNG_NO_STDIO version of png_write_flush(). Users + having trouble with fflush() can build with PNG_NO_WRITE_FLUSH defined. + Revised libpng*.txt documentation about use of png_write_flush(). + Removed fflush() from pngtest.c. + Added "#define PNG_NO_WRITE_FLUSH" to contrib/pngminim/encoder/pngusr.h + +version 1.2.36beta03 [March 27, 2009] + Relocated misplaced PNG_1_0_X define in png.h that caused the prototype + for png_set_strip_error_numbers() to be omitted from PNG_NO_ASSEMBLER_CODE + builds. This bug was introduced in libpng-1.2.15beta4. + Added a section on differences between 1.0.x and 1.2.x to libpng.3/libpng.txt + +version 1.2.36beta04 [April 5, 2009] + Fixed potential memory leak of "new_name" in png_write_iCCP() (Ralph Giles) + +version 1.2.36beta05 [April 24, 2009] + Added "ifndef PNG_SKIP_SETJMP_CHECK" block in pngconf.h to allow + application code writers to bypass the check for multiple inclusion + of setjmp.h when they know that it is safe to ignore the situation. + Made some cosmetic changes to whitespace in pngtest output. + Renamed "user_chunk_data" to "my_user_chunk_data" in pngtest.c to suppress + "shadowed declaration" warning from gcc-4.3.3. + Renamed "gamma" to "png_gamma" in pngset.c to avoid "shadowed declaration" + warning about a global "gamma" variable in math.h on some platforms. + +version 1.2.36rc01 [April 30, 2009] + No changes. + +version 1.0.44 and 1.2.36 [May 7, 2009] + No changes. + +version 1.2.37beta01 [May 14, 2009] + Fixed inconsistency in pngrutil.c, introduced in libpng-1.2.36. The + memset() was using "png_ptr->rowbytes" instead of "row_bytes", which + the corresponding png_malloc() uses (Joe Drew). + Clarified usage of sig_bit versus sig_bit_p in example.c (Vincent Torri) + Updated some of the makefiles in the scripts directory (merged with + those in libpng-1.4.0beta57). + +version 1.2.37beta02 [May 19, 2009] + Fixed typo in libpng documentation (FILTER_AVE should be FILTER_AVG) + Relocated misplaced #endif in pngwrite.c, sCAL chunk handler. + Conditionally compile png_read_finish_row() which is not used by + progressive readers. + Added contrib/pngminim/preader to demonstrate building minimal progressive + decoder, based on contrib/gregbook with embedded libpng and zlib. + +version 1.2.37beta03 [May 20, 2009] + In contrib/pngminim/*, renamed "makefile.std" to "makefile", since there + is only one makefile in those directories, and revised the README files + accordingly. + Reformated sources in libpng style (3-space indentation, comment format) + +version 1.2.37rc01 [May 27, 2009] + No changes. + +versions 1.2.37 and 1.0.45 [June 4, 2009] + Reformatted several remaining "else statement;" and "if () statement;" into + two lines. + Added "#define PNG_NO_WRITE_SWAP" to contrib/pngminim/encoder/pngusr.h + and "define PNG_NO_READ_SWAP" to decoder/pngusr.h and preader/pngusr.h + Added sections about the git repository and our coding style to the + documentation (merged from libpng-1.4.0beta62) + Added a section to the libpng documentation about using png_get_io_ptr() + in configure scripts to detect the presence of libpng. + +version 1.2.38beta01 [June 17, 2009] + Revised libpng*.txt and libpng.3 to mention calling png_set_IHDR() + multiple times and to specify the sample order in the tRNS chunk, + because the ISO PNG specification has a typo in the tRNS table. + Changed several PNG_UNKNOWN_CHUNK_SUPPORTED to + PNG_HANDLE_AS_UNKNOWN_SUPPORTED, to make the png_set_keep mechanism + available for ignoring known chunks even when not saving unknown chunks. + Adopted preference for consistent use of "#ifdef" and "#ifndef" versus + "#if defined()" and "if !defined()" where possible. + Added PNG_NO_HANDLE_AS_UNKNOWN in the PNG_LEGACY_SUPPORTED block of + pngconf.h, and moved the various unknown chunk macro definitions + outside of the PNG_READ|WRITE_ANCILLARY_CHUNK_SUPPORTED blocks. + +version 1.0.46 [June 18, 2009] + Removed some editing cruft from scripts/libpng.pc.in and some makefiles. + +version 1.2.38rc01 [June 24, 2009] + No changes. + +version 1.2.38rc02 [June 29, 2009] + Added a reference to the libpng license in each source file. + +version 1.2.38rc03 [July 11, 2009] + Revised references to the libpng license in pngconf.h and contrib/visupng + source files. + Rebuilt configure scripts with autoconf-2.63. + +version 1.0.47 and 1.2.38 [July 16, 2009] + No changes. + +version 1.2.39beta01 [July 25, 2009] + Added a prototype for png_64bit_product() in png.c + +version 1.2.39beta02 [July 27, 2009] + Avoid a possible NULL dereference in debug build, in png_set_text_2(). + (bug introduced in libpng-0.95, discovered by Evan Rouault) + +version 1.2.39beta03 [July 29, 2009] + Relocated new png_64_bit_product() prototype into png.h + Expanded the information about prototypes in the libpng style section of + the documentation. + Rebuilt configure scripts with autoconf-2.64. + +version 1.2.39beta04 [August 1, 2009] + Replaced *.tar.lzma with *.txz in distribution. Get the xz codec + from . + +version 1.2.39beta05 [August 1, 2009] + Reject attempt to write iCCP chunk with negative embedded profile length + (JD Chen) + +version 1.2.39c01 [August 6, 2009] + No changes. + +version 1.2.39 and 1.0.48 [August 13, 2009] + No changes. + +version 1.2.40beta01 [August 20, 2009] + Removed an extra png_debug() recently added to png_write_find_filter(). + Fixed incorrect #ifdef in pngset.c regarding unknown chunk support. + +version 1.2.40rc01 [September 2, 2009] + Various bugfixes and improvements to CMakeLists.txt (Philip Lowman) + +version 1.2.40 and 1.0.49 [September 2, 2009] + No changes. + +version 1.0.50 [September 10, 2009] + Removed some editing cruft from pngset.c and pngwutil.c. + +version 1.2.41beta01 [September 25, 2009] + Moved redundant IHDR checking into new png_check_IHDR() in png.c + and report all errors found in the IHDR data. + Eliminated useless call to png_check_cHRM() from pngset.c + Expanded TAB characters in pngrtran.c + +version 1.2.41beta02 [September 30, 2009] + Revised png_check_IHDR(). + +version 1.2.41beta03 [October 1, 2009] + Revised png_check_IHDR() again, to check info_ptr members instead of + the contents of the returned parameters. + +version 1.2.41beta04 [October 7, 2009] + Added "xcode" project similar one already in libpng-1.4.0beta (Alam Arias). + Ported some cosmetic changes from libpng-1.4.0beta86. + Eliminated a shadowed declaration of "pp" in png_handle_sPLT(). + +version 1.2.41beta05 [October 17, 2009] + Revised pngconf.h to make it easier to enable iTXt support. From libpng + version 1.2.9 through 1.2.40, defining PNG_iTXt_SUPPORTED did not work + as expected. + Ported some cosmetic changes from libpng-1.4.0beta87, changing + many "#if defined(x)" to "#ifdef x". + +version 1.2.41beta06 [October 18, 2009] + Restored PNG_USE_LOCAL_ARRAYS code in pngread.c that was inadvertently + deleted in libpng-1.2.41beta05. + Converted all PNG_NO_* tests to PNG_*_SUPPORTED everywhere except pngconf.h + as in libpng-1.4.0beta78 and later. + +version 1.2.41beta07 [October 21, 2009] + Ported some cosmetic changes from libpng-1.4.0rc01, changing + many "#if defined(x)" to "#ifdef x" in png.h and pngconf.h. + +version 1.2.41beta08 [October 30, 2009] + Ported from libpng-1.4.0rc01: png_calloc(), png_get_io_chunk_name(), + png_get_io_state(), png_set_user_cache_max(), png_get_user_cache_max(), + png_set_premultiply_alpha, and png_do_read_premultiply_alpha(). + Relocated png_do_chop() ahead of building gamma tables in pngrtran.c + This avoids building 16-bit gamma tables unnecessarily. + +version 1.2.41beta09 [November 1, 2009] + Removed a harmless extra png_set_invert_alpha() from pngwrite.c + More bugfixes and improvements to CMakeLists.txt (Philip Lowman) + Moved CMakeLists.txt from scripts into the main libpng directory. + Apply png_user_chunk_cache_max within png_decompress_chunk(). + Merged libpng-1.2.41.txt with libpng-1.4.0.txt where appropriate. + +version 1.2.41beta10 [November 1, 2009] + Enabled iTXt support by default. To ensure binary compatibility with + previous versions, the "lang" and "lang_key" members will be assumed + to be omitted from previous versions unless the current libpng + version was built with PNG_iTXt_SUPPORTED (which is otherwise no + longer necessary to gain iTXt support), as a signal that the user has + been building previous versions with PNG_iTXt_SUPPORTED as well. + +version 1.2.41beta11 [November 2, 2009] + Store user's user_png_ver in new png_ptr->user_png_ver element. + Revised iTXt support. To ensure binary compatibility with + previous versions, the "lang" and "lang_key" members will be assumed + to be omitted from versions prior to 1.2.41beta11 whenever there is a + library mismatch. + +version 1.2.41beta12 [November 2, 2009] + Free png_ptr->user_png_ver when destroying png_ptr. + +version 1.2.41beta13 [November 3, 2009] + Updated scripts/pngw32.def and projects/wince/png32ce.def + Copied projects/wince/png32ce.def to the scripts directory. + Added scripts/makefile.wce + Patched ltmain.sh for wince support. + Added PNG_CONVERT_tIME_SUPPORTED macro. + +version 1.2.41beta14 [November 8, 2009] + versions 1.2.41beta05 through 1.2.41beta13 were abandoned. + The 1.0.x/1.2.x series will only receive security updates from now on. + Make inclusion of time.h in pngconf.h depend on PNG_CONVERT_tIME_SUPPORTED + Make #define PNG_CONVERT_tIME_SUPPORTED depend on PNG_WRITE_tIME_SUPPORTED + Reverted iTXt compatibility stuff from 1.2.41beta05, 1.2.41beta11, and + 1.2.41beta12. + Reverted IOSTATE feature, user_cache_max, and premultiply_alpha features + from 1.2.41beta08. + Retained png_calloc() from 1.2.41beta08 but as a non-exported function, + and removed reference to png_calloc from scripts/*.def + +version 1.2.41beta15 [November 8, 2009] + Added PNG_DEPSTRUCT, PNG_DEPRECATED, PNG_USE_RESULT, PNG_NORETURN, and + PNG_ALLOCATED macros to detect deprecated direct access to the + png_struct or info_struct members and other deprecated usage in + applications (John Bowler). + Updated scripts/makefile* to add "-DPNG_CONFIGURE_LIBPNG" to CFLAGS, + to prevent warnings about direct access to png structs by libpng + functions while building libpng. They need to be tested, especially + those using compilers other than gcc. + Updated projects/visualc6 and visualc71 with "/d PNG_CONFIGURE_LIBPNG". + +version 1.2.41beta16 [November 9, 2009] + Removed three direct references to read_info_ptr members in pngtest.c + that were detected by the new PNG_DEPSTRUCT macro. + Only #define PNG_DEPSTRUCT, etc. in pngconf.h if not already defined. + +version 1.2.41beta17 [November 10, 2009] + Updated CMakeLists.txt to add "-DPNG_CONFIGURE_LIBPNG" to the definitions. + Marked deprecated function prototypes with PNG_DEPRECATED. + Marked memory allocation function prototypes with PNG_ALLOCATED. + Changed png_check_sig() to !png_sig_cmp() in contrib programs. + Corrected the png_get_IHDR() call in contrib/gregbook/readpng2.c + Added "-DPNG_CONFIGURE_LIBPNG" to the contrib/pngminum makefiles. + +version 1.2.41beta18 [November 11, 2009] + Renamed scripts/makefile.wce to scripts/makefile.cegcc + Marked nonexported functions with PNG_PRIVATE macro. + +version 1.2.41rc01 and 1.0.51rc01 [November 18, 2009] + Revised scripts/*.def to reflect functions actually exported by libpng. + Updated the copyright year in scripts/pngw32.rc from 2004 to 2009. + Moved descriptions of makefiles and other scripts out of INSTALL into + scripts/README.txt + +version 1.2.41rc02 [November 22, 2009] + Rebuilt the configure scripts with autoconf-2.65 + +version 1.2.41rc03 [November 25, 2009] + Disabled the new pedantic warnings about deprecated function use + and deprecated structure access unless the user defines + PNG_PEDANTIC_WARNINGS. + Added "#define PNG_NO_PEDANTIC_WARNINGS" in the libpng source files. + Removed "-DPNG_CONFIGURE_LIBPNG" from the makefiles and projects. + +version 1.2.41 and 1.0.51 [December 3, 2009] + Updated the list of files and made some cosmetic changes in README. + +version 1.2.42beta01 [December 4, 2009] + Removed "#define PNG_NO_ERROR_NUMBERS" that was inadvertently added + to pngconf.h in version 1.2.41. + Revised scripts/makefile.netbsd, makefile.openbsd, and makefile.sco + to put png.h and pngconf.h in $prefix/include, like the other scripts, + instead of in $prefix/include/libpng. Also revised makefile.sco + to put them in $prefix/include/libpng12 instead of in + $prefix/include/libpng/libpng12. + Removed leftover "-DPNG_CONFIGURE_LIBPNG" from scripts/makefile.darwin + +version 1.2.42beta02 [December 11, 2009] + Removed leftover "-DPNG_CONFIGURE_LIBPNG" from contrib/pngminim/*/makefile + Relocated png_do_chop() to its original position in pngrtran.c. The + change in version 1.2.41beta08 caused transparency to be handled wrong + in some 16-bit datastreams (Yusaku Sugai). + +version 1.2.42rc01 [December 17, 2009] + No changes. + +version 1.2.42rc02 [December 22, 2009] + Renamed libpng-pc.in back to libpng.pc.in and revised CMakeLists.txt + (revising changes made in 1.2.41beta17 and 1.2.41rc01) + +version 1.2.42rc03 [December 25, 2009] + Swapped PNG_UNKNOWN_CHUNKS_SUPPORTED and PNG_HANDLE_AS_UNKNOWN_SUPPORTED + in pngset.c to be consistent with other changes in version 1.2.38. + +version 1.2.42rc04 [January 1, 2010] + Marked png_memcpy_check() and png_memset_check() PNG_DEPRECATED. + Updated copyright year. + +version 1.2.42rc05 [January 2, 2010] + Avoid deprecated references to png_ptr-io_ptr and png_ptr->error_ptr + in pngtest.c + +version 1.2.42 and 1.0.52 [January 3, 2010] + No changes. + +version 1.2.43beta01 [January 27, 2010] + Updated CMakeLists.txt for consistent indentation and to avoid an + unclosed if-statement warning (Philip Lowman). + Removed "#ifdef PNG_1_0_X / #endif" surrounding + PNG_READ_16_TO_8_SUPPORTED and PNG_READ_GRAY_TO_RGB_SUPPORTED + in pngconf.h. These were added in libpng-1.2.41beta08 and libpng-1.0.51, + which introduced a binary incompatibility with libpng-1.0.50. + Backported new png_decompress_chunk() algorithm from libpng-1.4.1. + +version 1.2.43beta02 [February 1, 2010] + Backported two-pass png_decompress_chunk() algorithm from libpng-1.4.1. + +version 1.2.43beta03 [February 6, 2010] + Backported fast png_push_save_buffer() algorithm from libpng-1.4.1. + Backported some cosmetic changes from libpng-1.4.1. + +version 1.2.43beta04 [February 8, 2010] + Reverted recent changes to png_push_save-buffer(). + Removed PNGAPI declaration of png_calloc() and png_write_sig() in + 1ibpng-1.2.X, introduced by mistake in libpng-1.2.41. + Return allocated "old_buffer" in png_push_save_buffer() before png_error() + to avoid a potential memory leak. + +version 1.2.43beta05 [February 8, 2010] + Ported rewritten png_decompress_chunk() by John Bowler from libpng-1.4.1. + +version 1.0.53rc01 and 1.2.43rc01 [February 18, 2010] + No changes. + +version 1.0.53rc02 and 1.2.43rc02 [February 19, 2010] + Define _ALL_SOURCE in configure.ac, makefile.aix, and CMakeLists.txt + when using AIX compiler. + +version 1.0.53 and 1.2.43 [February 25, 2010] + Removed unused gzio.c from contrib/pngminim gather and makefile scripts + +version 1.2.44beta01 [June 18, 2010] + In pngpread.c: png_push_have_row() add check for new_row > height + Removed the now-redundant check for out-of-bounds new_row from example.c + +version 1.2.44beta02 [June 19, 2010] + In pngpread.c: png_push_process_row() add check for too many rows. + Removed the now-redundant check for new_row > height in png_push_have_row(). + +version 1.2.44beta03 [June 20, 2010] + Rewrote png_process_IDAT_data() to consistently treat extra data as warnings + and handle end conditions more cleanly. + Removed the new (beta02) check in png_push_process_row(). + +version 1.2.44rc01 [June 21, 2010] + Revised some comments in png_process_IDAT_data(). + +version 1.2.44rc02 [June 22, 2010] + Stop memory leak when reading a malformed sCAL chunk. + +version 1.2.44rc03 [June 23, 2010] + Revised pngpread.c patch of beta05 to avoid an endless loop. + +version 1.2.44 [June 26, 2010] + Updated some of the "last changed" dates. + +version 1.2.45beta01 [June 7, 2011] + Fixed uninitialized memory read in png_format_buffer() (Bug + report by Frank Busse, related to CVE-2004-0421). + Pass "" instead of '\0' to png_default_error() in png_err(). This mistake + was introduced in libpng-1.2.20beta01. + Check for up->location !PNG_AFTER_IDAT when writing unknown chunks + before IDAT. + Ported bugfix in pngrtran.c from 1.5.3: when expanding a paletted image, + always expand to RGBA if transparency is present. + +version 1.2.45beta02 [June 8, 2011] + Check for integer overflow in png_set_rgb_to_gray(). + +version 1.2.45beta03 [June 19, 2011] + Check for sCAL chunk too short. + +version 1.2.45rc01 and 1.0.55rc01 [June 30, 2011] + Updated "last changed" dates and copyright year. + +version 1.2.45 and 1.0.55 [July 7, 2011] + No changes. + +version 1.2.46rc01 and 1.0.56rc01 [July 8, 2011] + Reverted changes to Makefile.am and Makefile.in to libpng-1.2.44 versions. + +version 1.2.46rc02 and 1.0.56rc02 [July 8, 2011] + Added CMakeLists.txt, projects/xcode, and pnggccrd.c to EXTRA_DIST in + Makefile.am and Makefile.in + +version 1.2.46 and 1.0.56 [July 9, 2011] + Udated copyright year to 2011. + +version 1.2.47beta01 [February 17, 2012] + Updated contrib/pngminus/makefile.std (Samuli Souminen) + +version 1.0.57rc01 and 1.2.47rc01 [February 17, 2012] + Fixed CVE-2011-3026 buffer overrun bug. + Fixed CVE-2011-3026 buffer overrun bug. This bug was introduced when + iCCP chunk support was added at libpng-1.0.6. + +version 1.0.57 and 1.2.47 [February 18, 2012] + No changes. + +version 1.2.48beta01 [February 27, 2012] + Removed two useless #ifdef directives from pngread.c and one from pngrutil.c + Eliminated redundant png_push_read_tEXt|zTXt|iTXt|unknown code from + pngpread.c and use the sequential png_handle_tEXt, etc., in pngrutil.c; + now that png_ptr->buffer is inaccessible to applications, the special + handling is no longer useful. + Fixed bug with png_handle_hIST with odd chunk length (Frank Busse). + Fixed incorrect type (int copy should be png_size_t copy) in png_inflate(). + Fixed off-by-one bug in png_handle_sCAL() when using fixed point arithmetic, + causing out-of-bounds read in png_set_sCAL() because of failure to copy + the string terminators. This bug was introduced in libpng-1.0.6 (Frank + Busse). + +version 1.2.48rc01 [March 2, 2012] + Removed the png_free() of unused png_ptr->current_text from pngread.c. + Added libpng license text to pnggccrd.c and pngvcrd.c (requested by Chrome). + +version 1.2.48rc02 [March 2, 2012] + Removed all of the assembler code from pnggccrd.c and just "return 2;". + +version 1.0.58 and 1.2.48 [March 8, 2012] + No changes. + +version 1.2.49rc01 [March 29, 2012] + Revised png_set_text_2() to avoid potential memory corruption (fixes + CVE-2011-3048). + Prevent PNG_EXPAND+PNG_SHIFT doing the shift twice. + +Send comments/corrections/commendations to png-mng-implement at lists.sf.net +(subscription required; visit +https://lists.sourceforge.net/lists/listinfo/png-mng-implement +to subscribe) +or to glennrp at users.sourceforge.net + +Glenn R-P +#endif diff --git a/include/libpng/INSTALL b/include/libpng/INSTALL new file mode 100644 index 0000000..b688362 --- /dev/null +++ b/include/libpng/INSTALL @@ -0,0 +1,163 @@ + +Installing libpng version 1.2.49 - March 29, 2012 + +On Unix/Linux and similar systems, you can simply type + + ./configure [--prefix=/path] + make check + make install + +and ignore the rest of this document. + +If configure does not work on your system and you have a reasonably +up-to-date set of tools, running ./autogen.sh before running ./configure +may fix the problem. You can also run the individual commands in +autogen.sh with the --force option, if supported by your version of +the tools. If you run 'libtoolize --force', though, this will replace +the distributed, patched, version of ltmain.sh with an unpatched version +and your shared library builds may fail to produce libraries with the +correct version numbers. + +Instead, you can use one of the custom-built makefiles in the +"scripts" directory + + cp scripts/makefile.system makefile + make test + make install + +The files that are presently available in the scripts directory +are listed and described in scripts/README.txt. + +Or you can use one of the "projects" in the "projects" directory. + +Before installing libpng, you must first install zlib, if it +is not already on your system. zlib can usually be found +wherever you got libpng. zlib can be placed in another directory, +at the same level as libpng. + +If you want to use "cmake" (see www.cmake.org), type + + cmake . -DCMAKE_INSTALL_PREFIX=/path + make + make install + +If your system already has a preinstalled zlib you will still need +to have access to the zlib.h and zconf.h include files that +correspond to the version of zlib that's installed. + +You can rename the directories that you downloaded (they +might be called "libpng-1.2.49" or "libpng12" and "zlib-1.2.3" +or "zlib123") so that you have directories called "zlib" and "libpng". + +Your directory structure should look like this: + + .. (the parent directory) + libpng (this directory) + INSTALL (this file) + README + *.h + *.c + CMakeLists.txt => "cmake" script + configuration files: + configure.ac, configure, Makefile.am, Makefile.in, + autogen.sh, config.guess, ltmain.sh, missing, + aclocal.m4, config.h.in, config.sub, + depcomp, install-sh, mkinstalldirs, test-pngtest.sh + contrib + gregbook + pngminim + pngminus + pngsuite + visupng + projects + cbuilder5 (Borland) + visualc6 (msvc) + visualc71 + xcode + scripts + makefile.* + *.def (module definition files) + pngtest.png + etc. + zlib + README + *.h + *.c + contrib + etc. + +If the line endings in the files look funny, you may wish to get the other +distribution of libpng. It is available in both tar.gz (UNIX style line +endings) and zip (DOS style line endings) formats. + +If you are building libpng with MSVC, you can enter the +libpng projects\visualc6 or visualc71 directory and follow the instructions +in README.txt. + +Otherwise enter the zlib directory and follow the instructions in zlib/README, +then come back here and run "configure" or choose the appropriate +makefile.sys in the scripts directory. + +Copy the file (or files) that you need from the +scripts directory into this directory, for example + + MSDOS example: copy scripts\makefile.msc makefile + UNIX example: cp scripts/makefile.std makefile + +Read the makefile to see if you need to change any source or +target directories to match your preferences. + +Then read pngconf.h to see if you want to make any configuration +changes. + +Then just run "make" which will create the libpng library in +this directory and "make test" which will run a quick test that reads +the "pngtest.png" file and writes a "pngout.png" file that should be +identical to it. Look for "9782 zero samples" in the output of the +test. For more confidence, you can run another test by typing +"pngtest pngnow.png" and looking for "289 zero samples" in the output. +Also, you can run "pngtest -m contrib/pngsuite/*.png" and compare +your output with the result shown in contrib/pngsuite/README. + +Most of the makefiles will allow you to run "make install" to +put the library in its final resting place (if you want to +do that, run "make install" in the zlib directory first if necessary). +Some also allow you to run "make test-installed" after you have +run "make install". + +If you encounter a compiler error message complaining about the +lines + + __png.h__ already includes setjmp.h; + __dont__ include it again.; + +this means you have compiled another module that includes setjmp.h, +which is hazardous because the two modules might not include exactly +the same setjmp.h. If you are sure that you know what you are doing +and that they are exactly the same, then you can comment out or +delete the two lines. Better yet, use the cexcept interface +instead, as demonstrated in contrib/visupng of the libpng distribution. + +Further information can be found in the README and libpng.txt +files, in the individual makefiles, in png.h, and the manual pages +libpng.3 and png.5. + + +Using the ./configure script -- 16 December 2002. +================================================= + + +The ./configure script should work compatibly with what scripts/makefile.* +did, however there are some options you need to add to configure explicitly, +which previously was done semi-automatically (if you didn't edit +scripts/makefile.* yourself, that is) + + +CFLAGS="-Wall -O -funroll-loops \ +-malign-loops=2 -malign-functions=2" ./configure --prefix=/usr/include \ +--with-pkgconfigdir=/usr/lib/pkgconfig --includedir=/usr/include + +You can alternatively specify --includedir=/usr/include, /usr/local/include, +/usr/include/png12, or whatever. + + diff --git a/include/libpng/KNOWNBUG b/include/libpng/KNOWNBUG new file mode 100644 index 0000000..066c837 --- /dev/null +++ b/include/libpng/KNOWNBUG @@ -0,0 +1,22 @@ + +Known bugs in libpng version 1.2.49 + +1. February 23, 2006: The custom makefiles don't build libpng with -lz. + + STATUS: This is a subject of debate. The change will probably be made + as a part of a major overhaul of the makefiles in libpng version 1.4.0. + +2. February 24, 2006: The Makefile generated by the "configure" script + fails to install symbolic links + libpng12.so => libpng12.so.0.1.2.9betaN + that are generated by the custom makefiles. + +3. September 4, 2007: There is a report that pngtest crashes on MacOS 10. + + STATUS: workarounds are + 1) Compile without optimization (crashes are observed with + -arch i386 and -O2 or -O3, using gcc-4.0.1). + 2) Compile pngtest.c with PNG_DEBUG defined (the bug goes away if + you try to look at it). + 3) Ignore the crash. The library itself seems to be OK. + diff --git a/include/libpng/LICENSE b/include/libpng/LICENSE new file mode 100644 index 0000000..c04d730 --- /dev/null +++ b/include/libpng/LICENSE @@ -0,0 +1,111 @@ + +This copy of the libpng notices is provided for your convenience. In case of +any discrepancy between this copy and the notices in the file png.h that is +included in the libpng distribution, the latter shall prevail. + +COPYRIGHT NOTICE, DISCLAIMER, and LICENSE: + +If you modify libpng you may insert additional notices immediately following +this sentence. + +This code is released under the libpng license. + +libpng versions 1.2.6, August 15, 2004, through 1.2.49, March 29, 2012, are +Copyright (c) 2004, 2006-2009 Glenn Randers-Pehrson, and are +distributed according to the same disclaimer and license as libpng-1.2.5 +with the following individual added to the list of Contributing Authors + + Cosmin Truta + +libpng versions 1.0.7, July 1, 2000, through 1.2.5 - October 3, 2002, are +Copyright (c) 2000-2002 Glenn Randers-Pehrson, and are +distributed according to the same disclaimer and license as libpng-1.0.6 +with the following individuals added to the list of Contributing Authors + + Simon-Pierre Cadieux + Eric S. Raymond + Gilles Vollant + +and with the following additions to the disclaimer: + + There is no warranty against interference with your enjoyment of the + library or against infringement. There is no warranty that our + efforts or the library will fulfill any of your particular purposes + or needs. This library is provided with all faults, and the entire + risk of satisfactory quality, performance, accuracy, and effort is with + the user. + +libpng versions 0.97, January 1998, through 1.0.6, March 20, 2000, are +Copyright (c) 1998, 1999 Glenn Randers-Pehrson, and are +distributed according to the same disclaimer and license as libpng-0.96, +with the following individuals added to the list of Contributing Authors: + + Tom Lane + Glenn Randers-Pehrson + Willem van Schaik + +libpng versions 0.89, June 1996, through 0.96, May 1997, are +Copyright (c) 1996, 1997 Andreas Dilger +Distributed according to the same disclaimer and license as libpng-0.88, +with the following individuals added to the list of Contributing Authors: + + John Bowler + Kevin Bracey + Sam Bushell + Magnus Holmgren + Greg Roelofs + Tom Tanner + +libpng versions 0.5, May 1995, through 0.88, January 1996, are +Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc. + +For the purposes of this copyright and license, "Contributing Authors" +is defined as the following set of individuals: + + Andreas Dilger + Dave Martindale + Guy Eric Schalnat + Paul Schmidt + Tim Wegner + +The PNG Reference Library is supplied "AS IS". The Contributing Authors +and Group 42, Inc. disclaim all warranties, expressed or implied, +including, without limitation, the warranties of merchantability and of +fitness for any purpose. The Contributing Authors and Group 42, Inc. +assume no liability for direct, indirect, incidental, special, exemplary, +or consequential damages, which may result from the use of the PNG +Reference Library, even if advised of the possibility of such damage. + +Permission is hereby granted to use, copy, modify, and distribute this +source code, or portions hereof, for any purpose, without fee, subject +to the following restrictions: + +1. The origin of this source code must not be misrepresented. + +2. Altered versions must be plainly marked as such and must not + be misrepresented as being the original source. + +3. This Copyright notice may not be removed or altered from any + source or altered source distribution. + +The Contributing Authors and Group 42, Inc. specifically permit, without +fee, and encourage the use of this source code as a component to +supporting the PNG file format in commercial products. If you use this +source code in a product, acknowledgment is not required but would be +appreciated. + + +A "png_get_copyright" function is available, for convenient use in "about" +boxes and the like: + + printf("%s",png_get_copyright(NULL)); + +Also, the PNG logo (in PNG format, of course) is supplied in the +files "pngbar.png" and "pngbar.jpg (88x31) and "pngnow.png" (98x31). + +Libpng is OSI Certified Open Source Software. OSI Certified Open Source is a +certification mark of the Open Source Initiative. + +Glenn Randers-Pehrson +glennrp at users.sourceforge.net +March 29, 2012 diff --git a/include/libpng/README b/include/libpng/README new file mode 100644 index 0000000..9559685 --- /dev/null +++ b/include/libpng/README @@ -0,0 +1,275 @@ +README for libpng version 1.2.49 - March 29, 2012 (shared library 12.0) +See the note about version numbers near the top of png.h + +See INSTALL for instructions on how to install libpng. + +Libpng comes in several distribution formats. Get libpng-*.tar.gz, +libpng-*.tar.xz, or libpng-*.tar.bz2 if you want UNIX-style line +endings in the text files, or lpng*.7z or lpng*.zip if you want DOS-style +line endings. You can get UNIX-style line endings from the *.zip file +by using "unzip -a" but there seems to be no simple way to recover +UNIX-style line endings from the *.7z file. The *.tar.xz file is +recommended for *NIX users instead. + +Version 0.89 was the first official release of libpng. Don't let the +fact that it's the first release fool you. The libpng library has been in +extensive use and testing since mid-1995. By late 1997 it had +finally gotten to the stage where there hadn't been significant +changes to the API in some time, and people have a bad feeling about +libraries with versions < 1.0. Version 1.0.0 was released in +March 1998. + +**** +Note that some of the changes to the png_info structure render this +version of the library binary incompatible with libpng-0.89 or +earlier versions if you are using a shared library. The type of the +"filler" parameter for png_set_filler() has changed from png_byte to +png_uint_32, which will affect shared-library applications that use +this function. + +To avoid problems with changes to the internals of png_info_struct, +new APIs have been made available in 0.95 to avoid direct application +access to info_ptr. These functions are the png_set_ and +png_get_ functions. These functions should be used when +accessing/storing the info_struct data, rather than manipulating it +directly, to avoid such problems in the future. + +It is important to note that the APIs do not make current programs +that access the info struct directly incompatible with the new +library. However, it is strongly suggested that new programs use +the new APIs (as shown in example.c and pngtest.c), and older programs +be converted to the new format, to facilitate upgrades in the future. +**** + +Additions since 0.90 include the ability to compile libpng as a +Windows DLL, and new APIs for accessing data in the info struct. +Experimental functions include the ability to set weighting and cost +factors for row filter selection, direct reads of integers from buffers +on big-endian processors that support misaligned data access, faster +methods of doing alpha composition, and more accurate 16->8 bit color +conversion. + +The additions since 0.89 include the ability to read from a PNG stream +which has had some (or all) of the signature bytes read by the calling +application. This also allows the reading of embedded PNG streams that +do not have the PNG file signature. As well, it is now possible to set +the library action on the detection of chunk CRC errors. It is possible +to set different actions based on whether the CRC error occurred in a +critical or an ancillary chunk. + +The changes made to the library, and bugs fixed are based on discussions +on the png-mng-implement mailing list and not on material submitted +privately to Guy, Andreas, or Glenn. They will forward any good +suggestions to the list. + +For a detailed description on using libpng, read libpng.txt. For +examples of libpng in a program, see example.c and pngtest.c. For usage +information and restrictions (what little they are) on libpng, see +png.h. For a description on using zlib (the compression library used by +libpng) and zlib's restrictions, see zlib.h + +I have included a general makefile, as well as several machine and +compiler specific ones, but you may have to modify one for your own needs. + +You should use zlib 1.0.4 or later to run this, but it MAY work with +versions as old as zlib 0.95. Even so, there are bugs in older zlib +versions which can cause the output of invalid compression streams for +some images. You will definitely need zlib 1.0.4 or later if you are +taking advantage of the MS-DOS "far" structure allocation for the small +and medium memory models. You should also note that zlib is a +compression library that is useful for more things than just PNG files. +You can use zlib as a drop-in replacement for fread() and fwrite() if +you are so inclined. + +zlib should be available at the same place that libpng is, or at +ftp://ftp.simplesystems.org/pub/png/src/ + +You may also want a copy of the PNG specification. It is available +as an RFC, a W3C Recommendation, and an ISO/IEC Standard. You can find +these at http://www.libpng.org/pub/png/pngdocs.html + +This code is currently being archived at libpng.sf.net in the +[DOWNLOAD] area, and on CompuServe, Lib 20 (PNG SUPPORT) +at GO GRAPHSUP. If you can't find it in any of those places, +e-mail me, and I'll help you find it. + +If you have any code changes, requests, problems, etc., please e-mail +them to me. Also, I'd appreciate any make files or project files, +and any modifications you needed to make to get libpng to compile, +along with a #define variable to tell what compiler/system you are on. +If you needed to add transformations to libpng, or wish libpng would +provide the image in a different way, drop me a note (and code, if +possible), so I can consider supporting the transformation. +Finally, if you get any warning messages when compiling libpng +(note: not zlib), and they are easy to fix, I'd appreciate the +fix. Please mention "libpng" somewhere in the subject line. Thanks. + +This release was created and will be supported by myself (of course +based in a large way on Guy's and Andreas' earlier work), and the PNG +development group. + +Send comments/corrections/commendations to png-mng-implement at lists.sf.net +(subscription required; visit +https://lists.sourceforge.net/lists/listinfo/png-mng-implement +to subscribe) or to glennrp at users.sourceforge.net + +You can't reach Guy, the original libpng author, at the addresses +given in previous versions of this document. He and Andreas will +read mail addressed to the png-mng-implement list, however. + +Please do not send general questions about PNG. Send them to +the (png-mng-misc at lists.sourceforge.net, subscription required, visit +https://lists.sourceforge.net/lists/listinfo/png-mng-misc to +subscribe). On the other hand, please do not send libpng questions to +that address, send them to me or to the png-mng-implement list. I'll +get them in the end anyway. If you have a question about something +in the PNG specification that is related to using libpng, send it +to me. Send me any questions that start with "I was using libpng, +and ...". If in doubt, send questions to me. I'll bounce them +to others, if necessary. + +Please do not send suggestions on how to change PNG. We have +been discussing PNG for twelve years now, and it is official and +finished. If you have suggestions for libpng, however, I'll +gladly listen. Even if your suggestion is not used immediately, +it may be used later. + +Files in this distribution: + + ANNOUNCE => Announcement of this version, with recent changes + CHANGES => Description of changes between libpng versions + KNOWNBUG => List of known bugs and deficiencies + LICENSE => License to use and redistribute libpng + README => This file + TODO => Things not implemented in the current library + Y2KINFO => Statement of Y2K compliance + example.c => Example code for using libpng functions + libpng-*-*-diff.txt => Diff from previous release + libpng.3 => manual page for libpng (includes libpng.txt) + libpng.txt => Description of libpng and its functions + libpngpf.3 => manual page for libpng's private functions + png.5 => manual page for the PNG format + png.c => Basic interface functions common to library + png.h => Library function and interface declarations + pngconf.h => System specific library configuration + pngerror.c => Error/warning message I/O functions + pngget.c => Functions for retrieving info from struct + pngmem.c => Memory handling functions + pngbar.png => PNG logo, 88x31 + pngnow.png => PNG logo, 98x31 + pngpread.c => Progressive reading functions + pngread.c => Read data/helper high-level functions + pngrio.c => Lowest-level data read I/O functions + pngrtran.c => Read data transformation functions + pngrutil.c => Read data utility functions + pngset.c => Functions for storing data into the info_struct + pngtest.c => Library test program + pngtest.png => Library test sample image + pngtrans.c => Common data transformation functions + pngwio.c => Lowest-level write I/O functions + pngwrite.c => High-level write functions + pngwtran.c => Write data transformations + pngwutil.c => Write utility functions + contrib => Contributions + gregbook => source code for PNG reading and writing, from + Greg Roelofs' "PNG: The Definitive Guide", + O'Reilly, 1999 + msvctest => Builds and runs pngtest using a MSVC workspace + pngminim => Simple pnm2pngm and png2pnmm programs + pngminus => Simple pnm2png and png2pnm programs + pngsuite => Test images + visupng => Contains a MSVC workspace for VisualPng + projects => Contains project files and workspaces for + building a DLL + beos => Contains a Beos workspace for building libpng + c5builder => Contains a Borland workspace for building + libpng and zlib + netware.txt => Contains instructions for downloading a set + of project files for building libpng and + zlib on Netware. + visualc6 => Contains a Microsoft Visual C++ (MSVC) + workspace for building libpng and zlib + wince.txt => Contains instructions for downloading a + Microsoft Visual C++ (Windows CD Toolkit) + workspace for building libpng and zlib on + WindowsCE + xcode => Contains xcode project files + scripts => Directory containing scripts for building libpng: + descrip.mms => VMS makefile for MMS or MMK + makefile.std => Generic UNIX makefile (cc, creates static + libpng.a) + makefile.elf => Linux/ELF gcc makefile symbol versioning, + creates libpng12.so.0.1.2.49) + makefile.linux => Linux/ELF makefile (gcc, creates + libpng12.so.0.1.2.49) + makefile.gcmmx => Linux/ELF makefile (gcc, creates + libpng12.so.0.1.2.49, previously + used assembler code tuned for Intel MMX + platform) + makefile.gcc => Generic makefile (gcc, creates static + libpng.a) + makefile.knr => Archaic UNIX Makefile that converts files + with ansi2knr (Requires ansi2knr.c from + ftp://ftp.cs.wisc.edu/ghost) + makefile.aix => AIX makefile + makefile.cygwin => Cygwin/gcc makefile + makefile.darwin => Darwin makefile + makefile.dec => DEC Alpha UNIX makefile + makefile.freebsd => FreeBSD makefile + makefile.hpgcc => HPUX makefile using gcc + makefile.hpux => HPUX (10.20 and 11.00) makefile + makefile.hp64 => HPUX (10.20 and 11.00) makefile, 64 bit + makefile.ibmc => IBM C/C++ version 3.x for Win32 and OS/2 + (static) + makefile.intel => Intel C/C++ version 4.0 and later + libpng.icc => Project file, IBM VisualAge/C++ 4.0 or later + makefile.netbsd => NetBSD/cc makefile, makes libpng.so. + makefile.ne12bsd => NetBSD/cc makefile, makes libpng12.so + makefile.openbsd => OpenBSD makefile + makefile.sgi => Silicon Graphics IRIX (cc, creates static lib) + makefile.sggcc => Silicon Graphics + (gcc, creates libpng12.so.0.1.2.49) + makefile.sunos => Sun makefile + makefile.solaris => Solaris 2.X makefile + (gcc, creates libpng12.so.0.1.2.49) + makefile.so9 => Solaris 9 makefile + (gcc, creates libpng12.so.0.1.2.49) + makefile.32sunu => Sun Ultra 32-bit makefile + makefile.64sunu => Sun Ultra 64-bit makefile + makefile.sco => For SCO OSr5 ELF and Unixware 7 with Native cc + makefile.mips => MIPS makefile + makefile.acorn => Acorn makefile + makefile.amiga => Amiga makefile + smakefile.ppc => AMIGA smakefile for SAS C V6.58/7.00 PPC + compiler (Requires SCOPTIONS, copied from + scripts/SCOPTIONS.ppc) + makefile.atari => Atari makefile + makefile.beos => BEOS makefile for X86 + makefile.bor => Borland makefile (uses bcc) + makefile.bc32 => 32-bit Borland C++ (all modules compiled in C mode) + makefile.tc3 => Turbo C 3.0 makefile + makefile.dj2 => DJGPP 2 makefile + makefile.msc => Microsoft C makefile + makefile.vcawin32=> makefile for Microsoft Visual C++ 5.0 and + later (previously used assembler code tuned + for Intel MMX platform) + makefile.vcwin32 => makefile for Microsoft Visual C++ 4.0 and + later (does not use assembler code) + makefile.os2 => OS/2 Makefile (gcc and emx, requires pngos2.def) + pngos2.def => OS/2 module definition file used by makefile.os2 + makefile.watcom => Watcom 10a+ Makefile, 32-bit flat memory model + makevms.com => VMS build script + SCOPTIONS.ppc => Used with smakefile.ppc + +Good luck, and happy coding. + +-Glenn Randers-Pehrson (current maintainer, since 1998) + Internet: glennrp at users.sourceforge.net + +-Andreas Eric Dilger (former maintainer, 1996-1997) + Internet: adilger at enel.ucalgary.ca + Web: http://members.shaw.ca/adilger/ + +-Guy Eric Schalnat (original author and former maintainer, 1995-1996) + (formerly of Group 42, Inc) + Internet: gschal at infinet.com diff --git a/include/libpng/TODO b/include/libpng/TODO new file mode 100644 index 0000000..face765 --- /dev/null +++ b/include/libpng/TODO @@ -0,0 +1,25 @@ +TODO - list of things to do for libpng: + +Final bug fixes. +Improve API by hiding the png_struct and png_info structs. +Finish work on the no-floating-point version (including gamma compensation) +Better C++ wrapper/full C++ implementation? +Fix problem with C++ and EXTERN "C". +cHRM transformation. +Improve setjmp/longjmp usage or remove it in favor of returning error codes. +Add "grayscale->palette" transformation and "palette->grayscale" detection. +Improved dithering. +Multi-lingual error and warning message support. +Complete sRGB transformation (presently it simply uses gamma=0.45455). +Man pages for function calls. +Better documentation. +Better filter selection + (counting huffman bits/precompression? filter inertia? filter costs?). +Histogram creation. +Text conversion between different code pages (Latin-1 -> Mac and DOS). +Should we always malloc 2^bit_depth PLTE/tRNS/hIST entries for safety? +Build gamma tables using fixed point (and do away with floating point entirely). +Use greater precision when changing to linear gamma for compositing against + background and doing rgb-to-gray transformation. +Investigate pre-incremented loop counters and other loop constructions. +Add interpolated method of handling interlacing. diff --git a/include/libpng/Y2KINFO b/include/libpng/Y2KINFO new file mode 100644 index 0000000..6e46b68 --- /dev/null +++ b/include/libpng/Y2KINFO @@ -0,0 +1,55 @@ + Y2K compliance in libpng: + ========================= + + March 29, 2012 + + Since the PNG Development group is an ad-hoc body, we can't make + an official declaration. + + This is your unofficial assurance that libpng from version 0.71 and + upward through 1.2.49 are Y2K compliant. It is my belief that earlier + versions were also Y2K compliant. + + Libpng only has three year fields. One is a 2-byte unsigned integer + that will hold years up to 65535. The other two hold the date in text + format, and will hold years up to 9999. + + The integer is + "png_uint_16 year" in png_time_struct. + + The strings are + "png_charp time_buffer" in png_struct and + "near_time_buffer", which is a local character string in png.c. + + There are seven time-related functions: + + png_convert_to_rfc_1123() in png.c + (formerly png_convert_to_rfc_1152() in error) + png_convert_from_struct_tm() in pngwrite.c, called in pngwrite.c + png_convert_from_time_t() in pngwrite.c + png_get_tIME() in pngget.c + png_handle_tIME() in pngrutil.c, called in pngread.c + png_set_tIME() in pngset.c + png_write_tIME() in pngwutil.c, called in pngwrite.c + + All appear to handle dates properly in a Y2K environment. The + png_convert_from_time_t() function calls gmtime() to convert from system + clock time, which returns (year - 1900), which we properly convert to + the full 4-digit year. There is a possibility that applications using + libpng are not passing 4-digit years into the png_convert_to_rfc_1123() + function, or that they are incorrectly passing only a 2-digit year + instead of "year - 1900" into the png_convert_from_struct_tm() function, + but this is not under our control. The libpng documentation has always + stated that it works with 4-digit years, and the APIs have been + documented as such. + + The tIME chunk itself is also Y2K compliant. It uses a 2-byte unsigned + integer to hold the year, and can hold years as large as 65535. + + zlib, upon which libpng depends, is also Y2K compliant. It contains + no date-related code. + + + Glenn Randers-Pehrson + libpng maintainer + PNG Development Group diff --git a/include/libpng/configure b/include/libpng/configure new file mode 100755 index 0000000..8f157db --- /dev/null +++ b/include/libpng/configure @@ -0,0 +1,13891 @@ +#! /bin/sh +# Guess values for system-dependent variables and create Makefiles. +# Generated by GNU Autoconf 2.65 for libpng 1.2.49. +# +# Report bugs to . +# +# +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, +# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +if test "x$CONFIG_SHELL" = x; then + as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which + # is contrary to our usage. Disable this feature. + alias -g '\${1+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST +else + case \`(set -o) 2>/dev/null\` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi +" + as_required="as_fn_return () { (exit \$1); } +as_fn_success () { as_fn_return 0; } +as_fn_failure () { as_fn_return 1; } +as_fn_ret_success () { return 0; } +as_fn_ret_failure () { return 1; } + +exitcode=0 +as_fn_success || { exitcode=1; echo as_fn_success failed.; } +as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } +as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } +as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } +if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : + +else + exitcode=1; echo positional parameters were not saved. +fi +test x\$exitcode = x0 || exit 1" + as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO + as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO + eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && + test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 +test \$(( 1 + 1 )) = 2 || exit 1" + if (eval "$as_required") 2>/dev/null; then : + as_have_required=yes +else + as_have_required=no +fi + if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : + +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + as_found=: + case $as_dir in #( + /*) + for as_base in sh bash ksh sh5; do + # Try only shells that exist, to save several forks. + as_shell=$as_dir/$as_base + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : + CONFIG_SHELL=$as_shell as_have_required=yes + if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : + break 2 +fi +fi + done;; + esac + as_found=false +done +$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : + CONFIG_SHELL=$SHELL as_have_required=yes +fi; } +IFS=$as_save_IFS + + + if test "x$CONFIG_SHELL" != x; then : + # We cannot yet assume a decent shell, so we have to provide a + # neutralization value for shells without unset; and this also + # works around shells that cannot unset nonexistent variables. + BASH_ENV=/dev/null + ENV=/dev/null + (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} +fi + + if test x$as_have_required = xno; then : + $as_echo "$0: This script requires a shell more modern than all" + $as_echo "$0: the shells that I found on your system." + if test x${ZSH_VERSION+set} = xset ; then + $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" + $as_echo "$0: be upgraded to zsh 4.3.4 or later." + else + $as_echo "$0: Please tell bug-autoconf@gnu.org and +$0: png-mng-implement@lists.sourceforge.net about your +$0: system, including any error possibly output before this +$0: message. Then install a modern shell, or manually run +$0: the script under such a shell if you do have one." + fi + exit 1 +fi +fi +fi +SHELL=${CONFIG_SHELL-/bin/sh} +export SHELL +# Unset more variables known to interfere with behavior of common tools. +CLICOLOR_FORCE= GREP_OPTIONS= +unset CLICOLOR_FORCE GREP_OPTIONS + +## --------------------- ## +## M4sh Shell Functions. ## +## --------------------- ## +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error "cannot create directory $as_dir" + + +} # as_fn_mkdir_p +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +# as_fn_error ERROR [LINENO LOG_FD] +# --------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with status $?, using 1 if that was 0. +as_fn_error () +{ + as_status=$?; test $as_status -eq 0 && as_status=1 + if test "$3"; then + as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3 + fi + $as_echo "$as_me: error: $1" >&2 + as_fn_exit $as_status +} # as_fn_error + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + + + as_lineno_1=$LINENO as_lineno_1a=$LINENO + as_lineno_2=$LINENO as_lineno_2a=$LINENO + eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && + test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { + # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | + sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno + N + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\n.*// + ' >$as_me.lineno && + chmod +x "$as_me.lineno" || + { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -p' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -p' + fi +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +if test -x / >/dev/null 2>&1; then + as_test_x='test -x' +else + if ls -dL / >/dev/null 2>&1; then + as_ls_L_option=L + else + as_ls_L_option= + fi + as_test_x=' + eval sh -c '\'' + if test -d "$1"; then + test -d "$1/."; + else + case $1 in #( + -*)set "./$1";; + esac; + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( + ???[sx]*):;;*)false;;esac;fi + '\'' sh + ' +fi +as_executable_p=$as_test_x + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + + +# Check that we are running under the correct shell. +SHELL=${CONFIG_SHELL-/bin/sh} + +case X$lt_ECHO in +X*--fallback-echo) + # Remove one level of quotation (which was required for Make). + ECHO=`echo "$lt_ECHO" | sed 's,\\\\\$\\$0,'$0','` + ;; +esac + +ECHO=${lt_ECHO-echo} +if test "X$1" = X--no-reexec; then + # Discard the --no-reexec flag, and continue. + shift +elif test "X$1" = X--fallback-echo; then + # Avoid inline document here, it may be left over + : +elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' ; then + # Yippee, $ECHO works! + : +else + # Restart under the correct shell. + exec $SHELL "$0" --no-reexec ${1+"$@"} +fi + +if test "X$1" = X--fallback-echo; then + # used as fallback echo + shift + cat <<_LT_EOF +$* +_LT_EOF + exit 0 +fi + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +if test -z "$lt_ECHO"; then + if test "X${echo_test_string+set}" != Xset; then + # find a string as large as possible, as long as the shell can cope with it + for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do + # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... + if { echo_test_string=`eval $cmd`; } 2>/dev/null && + { test "X$echo_test_string" = "X$echo_test_string"; } 2>/dev/null + then + break + fi + done + fi + + if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && + echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + : + else + # The Solaris, AIX, and Digital Unix default echo programs unquote + # backslashes. This makes it impossible to quote backslashes using + # echo "$something" | sed 's/\\/\\\\/g' + # + # So, first we look for a working echo in the user's PATH. + + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for dir in $PATH /usr/ucb; do + IFS="$lt_save_ifs" + if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && + test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + ECHO="$dir/echo" + break + fi + done + IFS="$lt_save_ifs" + + if test "X$ECHO" = Xecho; then + # We didn't find a better echo, so look for alternatives. + if test "X`{ print -r '\t'; } 2>/dev/null`" = 'X\t' && + echo_testing_string=`{ print -r "$echo_test_string"; } 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # This shell has a builtin print -r that does the trick. + ECHO='print -r' + elif { test -f /bin/ksh || test -f /bin/ksh$ac_exeext; } && + test "X$CONFIG_SHELL" != X/bin/ksh; then + # If we have ksh, try running configure again with it. + ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} + export ORIGINAL_CONFIG_SHELL + CONFIG_SHELL=/bin/ksh + export CONFIG_SHELL + exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"} + else + # Try using printf. + ECHO='printf %s\n' + if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && + echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # Cool, printf works + : + elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL + export CONFIG_SHELL + SHELL="$CONFIG_SHELL" + export SHELL + ECHO="$CONFIG_SHELL $0 --fallback-echo" + elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + ECHO="$CONFIG_SHELL $0 --fallback-echo" + else + # maybe with a smaller string... + prev=: + + for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do + if { test "X$echo_test_string" = "X`eval $cmd`"; } 2>/dev/null + then + break + fi + prev="$cmd" + done + + if test "$prev" != 'sed 50q "$0"'; then + echo_test_string=`eval $prev` + export echo_test_string + exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"} + else + # Oops. We lost completely, so just stick with echo. + ECHO=echo + fi + fi + fi + fi + fi +fi + +# Copy echo and quote the copy suitably for passing to libtool from +# the Makefile, instead of quoting the original, which is used later. +lt_ECHO=$ECHO +if test "X$lt_ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then + lt_ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo" +fi + + + + +test -n "$DJDIR" || exec 7<&0 &1 + +# Name of the host. +# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +# +# Initializations. +# +ac_default_prefix=/usr/local +ac_clean_files= +ac_config_libobj_dir=. +LIBOBJS= +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= + +# Identity of this package. +PACKAGE_NAME='libpng' +PACKAGE_TARNAME='libpng' +PACKAGE_VERSION='1.2.49' +PACKAGE_STRING='libpng 1.2.49' +PACKAGE_BUGREPORT='png-mng-implement@lists.sourceforge.net' +PACKAGE_URL='' + +ac_unique_file="pngget.c" +# Factoring default headers for most tests. +ac_includes_default="\ +#include +#ifdef HAVE_SYS_TYPES_H +# include +#endif +#ifdef HAVE_SYS_STAT_H +# include +#endif +#ifdef STDC_HEADERS +# include +# include +#else +# ifdef HAVE_STDLIB_H +# include +# endif +#endif +#ifdef HAVE_STRING_H +# if !defined STDC_HEADERS && defined HAVE_MEMORY_H +# include +# endif +# include +#endif +#ifdef HAVE_STRINGS_H +# include +#endif +#ifdef HAVE_INTTYPES_H +# include +#endif +#ifdef HAVE_STDINT_H +# include +#endif +#ifdef HAVE_UNISTD_H +# include +#endif" + +ac_subst_vars='am__EXEEXT_FALSE +am__EXEEXT_TRUE +LTLIBOBJS +compatlib +binconfigs +pkgconfigdir +PNGLIB_RELEASE +PNGLIB_MINOR +PNGLIB_MAJOR +PNGLIB_VERSION +SYMBOL_PREFIX +HAVE_LD_VERSION_SCRIPT_FALSE +HAVE_LD_VERSION_SCRIPT_TRUE +LIBPNG_NO_MMX +LIBPNG_DEFINES +LIBOBJS +POW_LIB +OTOOL64 +OTOOL +LIPO +NMEDIT +DSYMUTIL +lt_ECHO +RANLIB +AR +NM +ac_ct_DUMPBIN +DUMPBIN +LIBTOOL +LN_S +OBJDUMP +DLLTOOL +AS +CPP +LD +FGREP +EGREP +GREP +SED +host_os +host_vendor +host_cpu +host +build_os +build_vendor +build_cpu +build +am__fastdepCC_FALSE +am__fastdepCC_TRUE +CCDEPMODE +AMDEPBACKSLASH +AMDEP_FALSE +AMDEP_TRUE +am__quote +am__include +DEPDIR +OBJEXT +EXEEXT +ac_ct_CC +CPPFLAGS +LDFLAGS +CFLAGS +CC +MAINT +MAINTAINER_MODE_FALSE +MAINTAINER_MODE_TRUE +am__untar +am__tar +AMTAR +am__leading_dot +SET_MAKE +AWK +mkdir_p +MKDIR_P +INSTALL_STRIP_PROGRAM +STRIP +install_sh +MAKEINFO +AUTOHEADER +AUTOMAKE +AUTOCONF +ACLOCAL +VERSION +PACKAGE +CYGPATH_W +am__isrc +INSTALL_DATA +INSTALL_SCRIPT +INSTALL_PROGRAM +target_alias +host_alias +build_alias +LIBS +ECHO_T +ECHO_N +ECHO_C +DEFS +mandir +localedir +libdir +psdir +pdfdir +dvidir +htmldir +infodir +docdir +oldincludedir +includedir +localstatedir +sharedstatedir +sysconfdir +datadir +datarootdir +libexecdir +sbindir +bindir +program_transform_name +prefix +exec_prefix +PACKAGE_URL +PACKAGE_BUGREPORT +PACKAGE_STRING +PACKAGE_VERSION +PACKAGE_TARNAME +PACKAGE_NAME +PATH_SEPARATOR +SHELL' +ac_subst_files='' +ac_user_opts=' +enable_option_checking +enable_maintainer_mode +enable_dependency_tracking +with_gnu_ld +enable_shared +enable_static +with_pic +enable_fast_install +enable_libtool_lock +with_pkgconfigdir +with_binconfigs +with_libpng_compat +' + ac_precious_vars='build_alias +host_alias +target_alias +CC +CFLAGS +LDFLAGS +LIBS +CPPFLAGS +CPP' + + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +ac_unrecognized_opts= +ac_unrecognized_sep= +# The variables have the same names as the options, with +# dashes changed to underlines. +cache_file=/dev/null +exec_prefix=NONE +no_create= +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +verbose= +x_includes=NONE +x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. +# (The list follows the same order as the GNU Coding Standards.) +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datarootdir='${prefix}/share' +datadir='${datarootdir}' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +includedir='${prefix}/include' +oldincludedir='/usr/include' +docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' +infodir='${datarootdir}/info' +htmldir='${docdir}' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}/lib' +localedir='${datarootdir}/locale' +mandir='${datarootdir}/man' + +ac_prev= +ac_dashdash= +for ac_option +do + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval $ac_prev=\$ac_option + ac_prev= + continue + fi + + case $ac_option in + *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *) ac_optarg=yes ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir=$ac_optarg ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build_alias ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build_alias=$ac_optarg ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; + + -datadir | --datadir | --datadi | --datad) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=*) + datadir=$ac_optarg ;; + + -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ + | --dataroo | --dataro | --datar) + ac_prev=datarootdir ;; + -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ + | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) + datarootdir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=no ;; + + -docdir | --docdir | --docdi | --doc | --do) + ac_prev=docdir ;; + -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) + docdir=$ac_optarg ;; + + -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) + ac_prev=dvidir ;; + -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) + dvidir=$ac_optarg ;; + + -enable-* | --enable-*) + ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=\$ac_optarg ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix=$ac_optarg ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; + + -host | --host | --hos | --ho) + ac_prev=host_alias ;; + -host=* | --host=* | --hos=* | --ho=*) + host_alias=$ac_optarg ;; + + -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) + ac_prev=htmldir ;; + -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ + | --ht=*) + htmldir=$ac_optarg ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir=$ac_optarg ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir=$ac_optarg ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir=$ac_optarg ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir=$ac_optarg ;; + + -localedir | --localedir | --localedi | --localed | --locale) + ac_prev=localedir ;; + -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) + localedir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst | --locals) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) + localstatedir=$ac_optarg ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir=$ac_optarg ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c | -n) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir=$ac_optarg ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix=$ac_optarg ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix=$ac_optarg ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix=$ac_optarg ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name=$ac_optarg ;; + + -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) + ac_prev=pdfdir ;; + -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) + pdfdir=$ac_optarg ;; + + -psdir | --psdir | --psdi | --psd | --ps) + ac_prev=psdir ;; + -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) + psdir=$ac_optarg ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir=$ac_optarg ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir=$ac_optarg ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site=$ac_optarg ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir=$ac_optarg ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir=$ac_optarg ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target_alias ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target_alias=$ac_optarg ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; + + -with-* | --with-*) + ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=\$ac_optarg ;; + + -without-* | --without-*) + ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=no ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes=$ac_optarg ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries=$ac_optarg ;; + + -*) as_fn_error "unrecognized option: \`$ac_option' +Try \`$0 --help' for more information." + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + case $ac_envvar in #( + '' | [0-9]* | *[!_$as_cr_alnum]* ) + as_fn_error "invalid variable name: \`$ac_envvar'" ;; + esac + eval $ac_envvar=\$ac_optarg + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} + ;; + + esac +done + +if test -n "$ac_prev"; then + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + as_fn_error "missing argument to $ac_option" +fi + +if test -n "$ac_unrecognized_opts"; then + case $enable_option_checking in + no) ;; + fatal) as_fn_error "unrecognized options: $ac_unrecognized_opts" ;; + *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + esac +fi + +# Check all directory arguments for consistency. +for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ + datadir sysconfdir sharedstatedir localstatedir includedir \ + oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ + libdir localedir mandir +do + eval ac_val=\$$ac_var + # Remove trailing slashes. + case $ac_val in + */ ) + ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` + eval $ac_var=\$ac_val;; + esac + # Be sure to have absolute directory names. + case $ac_val in + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; + esac + as_fn_error "expected an absolute directory name for --$ac_var: $ac_val" +done + +# There might be people who depend on the old broken behavior: `$host' +# used to hold the argument of --host etc. +# FIXME: To remove some day. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: To remove some day. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + $as_echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. + If a cross compiler is detected then cross compile mode will be used." >&2 + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi + +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +test "$silent" = yes && exec 6>/dev/null + + +ac_pwd=`pwd` && test -n "$ac_pwd" && +ac_ls_di=`ls -di .` && +ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || + as_fn_error "working directory cannot be determined" +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + as_fn_error "pwd does not report name of working directory" + + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then the parent directory. + ac_confdir=`$as_dirname -- "$as_myself" || +$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_myself" : 'X\(//\)[^/]' \| \ + X"$as_myself" : 'X\(//\)$' \| \ + X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_myself" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + srcdir=$ac_confdir + if test ! -r "$srcdir/$ac_unique_file"; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r "$srcdir/$ac_unique_file"; then + test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." + as_fn_error "cannot find sources ($ac_unique_file) in $srcdir" +fi +ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_abs_confdir=`( + cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error "$ac_msg" + pwd)` +# When building in place, set srcdir=. +if test "$ac_abs_confdir" = "$ac_pwd"; then + srcdir=. +fi +# Remove unnecessary trailing slashes from srcdir. +# Double slashes in file names in object file debugging info +# mess up M-x gdb in Emacs. +case $srcdir in +*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; +esac +for ac_var in $ac_precious_vars; do + eval ac_env_${ac_var}_set=\${${ac_var}+set} + eval ac_env_${ac_var}_value=\$${ac_var} + eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} + eval ac_cv_env_${ac_var}_value=\$${ac_var} +done + +# +# Report the --help message. +# +if test "$ac_init_help" = "long"; then + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat <<_ACEOF +\`configure' configures libpng 1.2.49 to adapt to many kinds of systems. + +Usage: $0 [OPTION]... [VAR=VALUE]... + +To assign environment variables (e.g., CC, CFLAGS...), specify them as +VAR=VALUE. See below for descriptions of some of the useful variables. + +Defaults for the options are specified in brackets. + +Configuration: + -h, --help display this help and exit + --help=short display options specific to this package + --help=recursive display the short help of all the included packages + -V, --version display version information and exit + -q, --quiet, --silent do not print \`checking...' messages + --cache-file=FILE cache test results in FILE [disabled] + -C, --config-cache alias for \`--cache-file=config.cache' + -n, --no-create do not create output files + --srcdir=DIR find the sources in DIR [configure dir or \`..'] + +Installation directories: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [PREFIX] + +By default, \`make install' will install all the files in +\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify +an installation prefix other than \`$ac_default_prefix' using \`--prefix', +for instance \`--prefix=\$HOME'. + +For better control, use the options below. + +Fine tuning of the installation directories: + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root [DATAROOTDIR/doc/libpng] + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] +_ACEOF + + cat <<\_ACEOF + +Program names: + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM run sed PROGRAM on installed program names + +System types: + --build=BUILD configure for building on BUILD [guessed] + --host=HOST cross-compile to build programs to run on HOST [BUILD] +_ACEOF +fi + +if test -n "$ac_init_help"; then + case $ac_init_help in + short | recursive ) echo "Configuration of libpng 1.2.49:";; + esac + cat <<\_ACEOF + +Optional Features: + --disable-option-checking ignore unrecognized --enable/--with options + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --enable-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer + --disable-dependency-tracking speeds up one-time build + --enable-dependency-tracking do not reject slow dependency extractors + --enable-shared[=PKGS] build shared libraries [default=yes] + --enable-static[=PKGS] build static libraries [default=yes] + --enable-fast-install[=PKGS] + optimize for fast installation [default=yes] + --disable-libtool-lock avoid locking (might break parallel builds) + +Optional Packages: + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --with-gnu-ld assume the C compiler uses GNU ld [default=no] + --with-pic try to use only PIC/non-PIC objects [default=use + both] + --with-pkgconfigdir Use the specified pkgconfig dir (default is + libdir/pkgconfig) + --with-binconfigs Generate shell libpng-config scripts as well as + pkg-config data [default=yes] + --with-libpng-compat Generate the obsolete libpng.so library + [default=yes] + +Some influential environment variables: + CC C compiler command + CFLAGS C compiler flags + LDFLAGS linker flags, e.g. -L if you have libraries in a + nonstandard directory + LIBS libraries to pass to the linker, e.g. -l + CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if + you have headers in a nonstandard directory + CPP C preprocessor + +Use these variables to override the choices made by `configure' or to help +it to find libraries and programs with nonstandard names/locations. + +Report bugs to . +_ACEOF +ac_status=$? +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d "$ac_dir" || + { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || + continue + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + cd "$ac_dir" || { ac_status=$?; continue; } + # Check for guested configure. + if test -f "$ac_srcdir/configure.gnu"; then + echo && + $SHELL "$ac_srcdir/configure.gnu" --help=recursive + elif test -f "$ac_srcdir/configure"; then + echo && + $SHELL "$ac_srcdir/configure" --help=recursive + else + $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi || ac_status=$? + cd "$ac_pwd" || { ac_status=$?; break; } + done +fi + +test -n "$ac_init_help" && exit $ac_status +if $ac_init_version; then + cat <<\_ACEOF +libpng configure 1.2.49 +generated by GNU Autoconf 2.65 + +Copyright (C) 2009 Free Software Foundation, Inc. +This configure script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it. +_ACEOF + exit +fi + +## ------------------------ ## +## Autoconf initialization. ## +## ------------------------ ## + +# ac_fn_c_try_compile LINENO +# -------------------------- +# Try to compile conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext + if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + as_fn_set_status $ac_retval + +} # ac_fn_c_try_compile + +# ac_fn_c_try_cpp LINENO +# ---------------------- +# Try to preprocess conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_cpp () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + as_fn_set_status $ac_retval + +} # ac_fn_c_try_cpp + +# ac_fn_c_try_link LINENO +# ----------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_link () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest$ac_exeext + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information + # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would + # interfere with the next link command; also delete a directory that is + # left behind by Apple's compiler. We do this before executing the actions. + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + as_fn_set_status $ac_retval + +} # ac_fn_c_try_link + +# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists and can be compiled using the include files in +# INCLUDES, setting the cache variable VAR accordingly. +ac_fn_c_check_header_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + +} # ac_fn_c_check_header_compile + +# ac_fn_c_try_run LINENO +# ---------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes +# that executables *can* be run. +ac_fn_c_try_run () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then : + ac_retval=0 +else + $as_echo "$as_me: program exited with status $ac_status" >&5 + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=$ac_status +fi + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + as_fn_set_status $ac_retval + +} # ac_fn_c_try_run + +# ac_fn_c_check_func LINENO FUNC VAR +# ---------------------------------- +# Tests whether FUNC exists, setting the cache variable VAR accordingly +ac_fn_c_check_func () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Define $2 to an innocuous variant, in case declares $2. + For example, HP-UX 11i declares gettimeofday. */ +#define $2 innocuous_$2 + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $2 (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $2 + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $2 (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$2 || defined __stub___$2 +choke me +#endif + +int +main () +{ +return $2 (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + +} # ac_fn_c_check_func + +# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists, giving a warning if it cannot be compiled using +# the include files in INCLUDES and setting the cache variable VAR +# accordingly. +ac_fn_c_check_header_mongrel () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : + $as_echo_n "(cached) " >&6 +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 +$as_echo_n "checking $2 usability... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_header_compiler=yes +else + ac_header_compiler=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 +$as_echo_n "checking $2 presence... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <$2> +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + ac_header_preproc=yes +else + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( + yes:no: ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} + ;; + no:yes:* ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} +( cat <<\_ASBOX +## ------------------------------------------------------ ## +## Report this to png-mng-implement@lists.sourceforge.net ## +## ------------------------------------------------------ ## +_ASBOX + ) | sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=\$ac_header_compiler" +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +fi + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + +} # ac_fn_c_check_header_mongrel + +# ac_fn_c_check_type LINENO TYPE VAR INCLUDES +# ------------------------------------------- +# Tests whether TYPE exists after having included INCLUDES, setting cache +# variable VAR accordingly. +ac_fn_c_check_type () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=no" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +if (sizeof ($2)) + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +if (sizeof (($2))) + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + eval "$3=yes" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + +} # ac_fn_c_check_type +cat >config.log <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by libpng $as_me 1.2.49, which was +generated by GNU Autoconf 2.65. Invocation command line was + + $ $0 $@ + +_ACEOF +exec 5>>config.log +{ +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## + +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +_ASUNAME + +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + $as_echo "PATH: $as_dir" + done +IFS=$as_save_IFS + +} >&5 + +cat >&5 <<_ACEOF + + +## ----------- ## +## Core tests. ## +## ----------- ## + +_ACEOF + + +# Keep a trace of the command line. +# Strip out --no-create and --no-recursion so they do not pile up. +# Strip out --silent because we don't want to record it for future runs. +# Also quote any args containing shell meta-characters. +# Make two passes to allow for proper duplicate-argument suppression. +ac_configure_args= +ac_configure_args0= +ac_configure_args1= +ac_must_keep_next=false +for ac_pass in 1 2 +do + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + continue ;; + *\'*) + ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; + 2) + as_fn_append ac_configure_args1 " '$ac_arg'" + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac + fi + as_fn_append ac_configure_args " '$ac_arg'" + ;; + esac + done +done +{ ac_configure_args0=; unset ac_configure_args0;} +{ ac_configure_args1=; unset ac_configure_args1;} + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +# WARNING: Use '\'' to represent an apostrophe within the trap. +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + { + echo + + cat <<\_ASBOX +## ---------------- ## +## Cache variables. ## +## ---------------- ## +_ASBOX + echo + # The following way of writing the cache mishandles newlines in values, +( + for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + (set) 2>&1 | + case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + sed -n \ + "s/'\''/'\''\\\\'\'''\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + ;; #( + *) + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) + echo + + cat <<\_ASBOX +## ----------------- ## +## Output variables. ## +## ----------------- ## +_ASBOX + echo + for ac_var in $ac_subst_vars + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + + if test -n "$ac_subst_files"; then + cat <<\_ASBOX +## ------------------- ## +## File substitutions. ## +## ------------------- ## +_ASBOX + echo + for ac_var in $ac_subst_files + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + fi + + if test -s confdefs.h; then + cat <<\_ASBOX +## ----------- ## +## confdefs.h. ## +## ----------- ## +_ASBOX + echo + cat confdefs.h + echo + fi + test "$ac_signal" != 0 && + $as_echo "$as_me: caught signal $ac_signal" + $as_echo "$as_me: exit $exit_status" + } >&5 + rm -f core *.core core.conftest.* && + rm -f -r conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status +' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -f -r conftest* confdefs.h + +$as_echo "/* confdefs.h */" > confdefs.h + +# Predefined preprocessor variables. + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_NAME "$PACKAGE_NAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_TARNAME "$PACKAGE_TARNAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_VERSION "$PACKAGE_VERSION" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_STRING "$PACKAGE_STRING" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_URL "$PACKAGE_URL" +_ACEOF + + +# Let the site file select an alternate cache file if it wants to. +# Prefer an explicitly selected file to automatically selected ones. +ac_site_file1=NONE +ac_site_file2=NONE +if test -n "$CONFIG_SITE"; then + ac_site_file1=$CONFIG_SITE +elif test "x$prefix" != xNONE; then + ac_site_file1=$prefix/share/config.site + ac_site_file2=$prefix/etc/config.site +else + ac_site_file1=$ac_default_prefix/share/config.site + ac_site_file2=$ac_default_prefix/etc/config.site +fi +for ac_site_file in "$ac_site_file1" "$ac_site_file2" +do + test "x$ac_site_file" = xNONE && continue + if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 +$as_echo "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" + fi +done + +if test -r "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special files + # actually), so we avoid doing that. DJGPP emulates it as a regular file. + if test /dev/null != "$cache_file" && test -f "$cache_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 +$as_echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; + esac + fi +else + { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 +$as_echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in $ac_precious_vars; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value + case $ac_old_set,$ac_new_set in + set,) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + # differences in whitespace do not lead to failure. + ac_old_val_w=`echo x $ac_old_val` + ac_new_val_w=`echo x $ac_new_val` + if test "$ac_old_val_w" != "$ac_new_val_w"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 +$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else + { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 +$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 +$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) as_fn_append ac_configure_args " '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 +$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} + as_fn_error "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 +fi +## -------------------- ## +## Main body of script. ## +## -------------------- ## + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +am__api_version='1.11' + +ac_aux_dir= +for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do + for ac_t in install-sh install.sh shtool; do + if test -f "$ac_dir/$ac_t"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/$ac_t -c" + break 2 + fi + done +done +if test -z "$ac_aux_dir"; then + as_fn_error "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 +fi + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. +ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. +ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. + + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# OS/2's system install, which has a completely different semantic +# ./install, which can be erroneously created by make from ./install.sh. +# Reject install programs that cannot install multiple files. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 +$as_echo_n "checking for a BSD-compatible install... " >&6; } +if test -z "$INSTALL"; then +if test "${ac_cv_path_install+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + # Account for people who put trailing slashes in PATH elements. +case $as_dir/ in #(( + ./ | .// | /[cC]/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then + if test $ac_prog = install && + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + rm -rf conftest.one conftest.two conftest.dir + echo one > conftest.one + echo two > conftest.two + mkdir conftest.dir + if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && + test -s conftest.one && test -s conftest.two && + test -s conftest.dir/conftest.one && + test -s conftest.dir/conftest.two + then + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + fi + done + done + ;; +esac + + done +IFS=$as_save_IFS + +rm -rf conftest.one conftest.two conftest.dir + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL=$ac_cv_path_install + else + # As a last resort, use the slow shell script. Don't cache a + # value for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + INSTALL=$ac_install_sh + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 +$as_echo "$INSTALL" >&6; } + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 +$as_echo_n "checking whether build environment is sane... " >&6; } +# Just in case +sleep 1 +echo timestamp > conftest.file +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[\\\"\#\$\&\'\`$am_lf]*) + as_fn_error "unsafe absolute working directory name" "$LINENO" 5;; +esac +case $srcdir in + *[\\\"\#\$\&\'\`$am_lf\ \ ]*) + as_fn_error "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;; +esac + +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + rm -f conftest.file + if test "$*" != "X $srcdir/configure conftest.file" \ + && test "$*" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + as_fn_error "ls -t appears to fail. Make sure there is not a broken +alias in your environment" "$LINENO" 5 + fi + + test "$2" = conftest.file + ) +then + # Ok. + : +else + as_fn_error "newly created file is older than distributed files! +Check your system clock" "$LINENO" 5 +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +test "$program_prefix" != NONE && + program_transform_name="s&^&$program_prefix&;$program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s&\$&$program_suffix&;$program_transform_name" +# Double any \ or $. +# By default was `s,x,x', remove it if useless. +ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' +program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` + +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` + +if test x"${MISSING+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; + *) + MISSING="\${SHELL} $am_aux_dir/missing" ;; + esac +fi +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " +else + am_missing_run= + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5 +$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} +fi + +if test x"${install_sh}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi + +# Installed binaries are usually stripped using `strip' when the user +# run `make install-strip'. However `strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the `STRIP' environment variable to overrule this program. +if test "$cross_compiling" != no; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_STRIP+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +$as_echo "$STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_STRIP="strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +$as_echo "$ac_ct_STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi +else + STRIP="$ac_cv_prog_STRIP" +fi + +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 +$as_echo_n "checking for a thread-safe mkdir -p... " >&6; } +if test -z "$MKDIR_P"; then + if test "${ac_cv_path_mkdir+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in mkdir gmkdir; do + for ac_exec_ext in '' $ac_executable_extensions; do + { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue + case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( + 'mkdir (GNU coreutils) '* | \ + 'mkdir (coreutils) '* | \ + 'mkdir (fileutils) '4.1*) + ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext + break 3;; + esac + done + done + done +IFS=$as_save_IFS + +fi + + test -d ./--version && rmdir ./--version + if test "${ac_cv_path_mkdir+set}" = set; then + MKDIR_P="$ac_cv_path_mkdir -p" + else + # As a last resort, use the slow shell script. Don't cache a + # value for MKDIR_P within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + MKDIR_P="$ac_install_sh -d" + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 +$as_echo "$MKDIR_P" >&6; } + +mkdir_p="$MKDIR_P" +case $mkdir_p in + [\\/$]* | ?:[\\/]*) ;; + */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; +esac + +for ac_prog in gawk mawk nawk awk +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_AWK+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AWK"; then + ac_cv_prog_AWK="$AWK" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_AWK="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 +$as_echo "$AWK" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$AWK" && break +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } +set x ${MAKE-make} +ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then : + $as_echo_n "(cached) " >&6 +else + cat >conftest.make <<\_ACEOF +SHELL = /bin/sh +all: + @echo '@@@%%%=$(MAKE)=@@@%%%' +_ACEOF +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac +rm -f conftest.make +fi +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + SET_MAKE= +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + SET_MAKE="MAKE=${MAKE-make}" +fi + +rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null + +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + am__isrc=' -I$(srcdir)' + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + as_fn_error "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 + fi +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi + + +# Define the identity of the package. + PACKAGE='libpng' + VERSION='1.2.49' + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE "$PACKAGE" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define VERSION "$VERSION" +_ACEOF + +# Some tools Automake needs. + +ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} + + +AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} + + +AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} + + +AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} + + +MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} + +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. +# Always define AMTAR for backward compatibility. + +AMTAR=${AMTAR-"${am_missing_run}tar"} + +am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5 +$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; } + # Check whether --enable-maintainer-mode was given. +if test "${enable_maintainer_mode+set}" = set; then : + enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval +else + USE_MAINTAINER_MODE=no +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5 +$as_echo "$USE_MAINTAINER_MODE" >&6; } + if test $USE_MAINTAINER_MODE = yes; then + MAINTAINER_MODE_TRUE= + MAINTAINER_MODE_FALSE='#' +else + MAINTAINER_MODE_TRUE='#' + MAINTAINER_MODE_FALSE= +fi + + MAINT=$MAINTAINER_MODE_TRUE + + + +PNGLIB_VERSION=1.2.49 +PNGLIB_MAJOR=1 +PNGLIB_MINOR=2 +PNGLIB_RELEASE=49 + + + +ac_config_headers="$ac_config_headers config.h" + + +# Checks for programs. +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CC+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_CC="gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CC+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + fi +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CC+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl.exe + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CC+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl.exe +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_CC="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_CC" && break +done + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi + +fi + + +test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error "no acceptable C compiler found in \$PATH +See \`config.log' for more details." "$LINENO" 5; } + +# Provide some information about the compiler. +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" +# Try to create an executable without -o first, disregard a.out. +# It will help us diagnose broken compilers, and finding out an intuition +# of exeext. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 +$as_echo_n "checking whether the C compiler works... " >&6; } +ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` + +# The possible output files: +ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" + +ac_rmfiles= +for ac_file in $ac_files +do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + * ) ac_rmfiles="$ac_rmfiles $ac_file";; + esac +done +rm -f $ac_rmfiles + +if { { ac_try="$ac_link_default" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link_default") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. +# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' +# in a Makefile. We should not override ac_cv_exeext if it was cached, +# so that the user can short-circuit this test for compilers unknown to +# Autoconf. +for ac_file in $ac_files '' +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + then :; else + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + fi + # We set ac_cv_exeext here because the later test for it is not + # safe: cross compilers may not add the suffix if given an `-o' + # argument, so we may need to know it at that point already. + # Even if this section looks crufty: it has the advantage of + # actually working. + break;; + * ) + break;; + esac +done +test "$ac_cv_exeext" = no && ac_cv_exeext= + +else + ac_file='' +fi +if test -z "$ac_file"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +$as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ as_fn_set_status 77 +as_fn_error "C compiler cannot create executables +See \`config.log' for more details." "$LINENO" 5; }; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 +$as_echo_n "checking for C compiler default output file name... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 +$as_echo "$ac_file" >&6; } +ac_exeext=$ac_cv_exeext + +rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 +$as_echo_n "checking for suffix of executables... " >&6; } +if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + # If both `conftest.exe' and `conftest' are `present' (well, observable) +# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will +# work properly (i.e., refer to `conftest.exe'), while it won't with +# `rm'. +for ac_file in conftest.exe conftest conftest.*; do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + break;; + * ) break;; + esac +done +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error "cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details." "$LINENO" 5; } +fi +rm -f conftest conftest$ac_cv_exeext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 +$as_echo "$ac_cv_exeext" >&6; } + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +FILE *f = fopen ("conftest.out", "w"); + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +ac_clean_files="$ac_clean_files conftest.out" +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 +$as_echo_n "checking whether we are cross compiling... " >&6; } +if test "$cross_compiling" != yes; then + { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if { ac_try='./conftest$ac_cv_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error "cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details." "$LINENO" 5; } + fi + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 +$as_echo "$cross_compiling" >&6; } + +rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 +$as_echo_n "checking for suffix of object files... " >&6; } +if test "${ac_cv_objext+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + for ac_file in conftest.o conftest.obj conftest.*; do + test -f "$ac_file" || continue; + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error "cannot compute suffix of object files: cannot compile +See \`config.log' for more details." "$LINENO" 5; } +fi +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 +$as_echo "$ac_cv_objext" >&6; } +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 +$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } +if test "${ac_cv_c_compiler_gnu+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_compiler_gnu=yes +else + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +$as_echo "$ac_cv_c_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GCC=yes +else + GCC= +fi +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +$as_echo_n "checking whether $CC accepts -g... " >&6; } +if test "${ac_cv_prog_cc_g+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +else + CFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +$as_echo "$ac_cv_prog_cc_g" >&6; } +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 +$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } +if test "${ac_cv_prog_cc_c89+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_c89=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; + xno) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; +esac +if test "x$ac_cv_prog_cc_c89" != xno; then : + +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +DEPDIR="${am__leading_dot}deps" + +ac_config_commands="$ac_config_commands depfiles" + + +am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo this is the am__doit target +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 +$as_echo_n "checking for style of include used by $am_make... " >&6; } +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# Ignore all kinds of additional output from `make'. +case `$am_make -s -f confmf 2> /dev/null` in #( +*the\ am__doit\ target*) + am__include=include + am__quote= + _am_result=GNU + ;; +esac +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + case `$am_make -s -f confmf 2> /dev/null` in #( + *the\ am__doit\ target*) + am__include=.include + am__quote="\"" + _am_result=BSD + ;; + esac +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 +$as_echo "$_am_result" >&6; } +rm -f confinc confmf + +# Check whether --enable-dependency-tracking was given. +if test "${enable_dependency_tracking+set}" = set; then : + enableval=$enable_dependency_tracking; +fi + +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' +fi + if test "x$enable_dependency_tracking" != xno; then + AMDEP_TRUE= + AMDEP_FALSE='#' +else + AMDEP_TRUE='#' + AMDEP_FALSE= +fi + + + +depcc="$CC" am_compiler_list= + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +$as_echo_n "checking dependency style of $depcc... " >&6; } +if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CC_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + am__universal=false + case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvisualcpp | msvcmsys) + # This compiler won't grok `-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CC_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CC_dependencies_compiler_type=none +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 +$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } +CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type + + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then + am__fastdepCC_TRUE= + am__fastdepCC_FALSE='#' +else + am__fastdepCC_TRUE='#' + am__fastdepCC_FALSE= +fi + + +# Make sure we can run config.sub. +$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || + as_fn_error "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 +$as_echo_n "checking build system type... " >&6; } +if test "${ac_cv_build+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_build_alias=$build_alias +test "x$ac_build_alias" = x && + ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` +test "x$ac_build_alias" = x && + as_fn_error "cannot guess build type; you must specify one" "$LINENO" 5 +ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || + as_fn_error "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 +$as_echo "$ac_cv_build" >&6; } +case $ac_cv_build in +*-*-*) ;; +*) as_fn_error "invalid value of canonical build" "$LINENO" 5;; +esac +build=$ac_cv_build +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_build +shift +build_cpu=$1 +build_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +build_os=$* +IFS=$ac_save_IFS +case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 +$as_echo_n "checking host system type... " >&6; } +if test "${ac_cv_host+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test "x$host_alias" = x; then + ac_cv_host=$ac_cv_build +else + ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || + as_fn_error "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 +$as_echo "$ac_cv_host" >&6; } +case $ac_cv_host in +*-*-*) ;; +*) as_fn_error "invalid value of canonical host" "$LINENO" 5;; +esac +host=$ac_cv_host +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_host +shift +host_cpu=$1 +host_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +host_os=$* +IFS=$ac_save_IFS +case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 +$as_echo_n "checking for a sed that does not truncate output... " >&6; } +if test "${ac_cv_path_SED+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ + for ac_i in 1 2 3 4 5 6 7; do + ac_script="$ac_script$as_nl$ac_script" + done + echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed + { ac_script=; unset ac_script;} + if test -z "$SED"; then + ac_path_SED_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in sed gsed; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue +# Check for GNU ac_path_SED and select it if it is found. + # Check for GNU $ac_path_SED +case `"$ac_path_SED" --version 2>&1` in +*GNU*) + ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo '' >> "conftest.nl" + "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_SED_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_SED="$ac_path_SED" + ac_path_SED_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_SED_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_SED"; then + as_fn_error "no acceptable sed could be found in \$PATH" "$LINENO" 5 + fi +else + ac_cv_path_SED=$SED +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 +$as_echo "$ac_cv_path_SED" >&6; } + SED="$ac_cv_path_SED" + rm -f conftest.sed + +test -z "$SED" && SED=sed +Xsed="$SED -e 1s/^X//" + + + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 +$as_echo_n "checking for grep that handles long lines and -e... " >&6; } +if test "${ac_cv_path_GREP+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$GREP"; then + ac_path_GREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in grep ggrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue +# Check for GNU ac_path_GREP and select it if it is found. + # Check for GNU $ac_path_GREP +case `"$ac_path_GREP" --version 2>&1` in +*GNU*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'GREP' >> "conftest.nl" + "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_GREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_GREP="$ac_path_GREP" + ac_path_GREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_GREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_GREP"; then + as_fn_error "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_GREP=$GREP +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 +$as_echo "$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 +$as_echo_n "checking for egrep... " >&6; } +if test "${ac_cv_path_EGREP+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + if test -z "$EGREP"; then + ac_path_EGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in egrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue +# Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_EGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_EGREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_EGREP"; then + as_fn_error "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_EGREP=$EGREP +fi + + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 +$as_echo "$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 +$as_echo_n "checking for fgrep... " >&6; } +if test "${ac_cv_path_FGREP+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 + then ac_cv_path_FGREP="$GREP -F" + else + if test -z "$FGREP"; then + ac_path_FGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in fgrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_FGREP" && $as_test_x "$ac_path_FGREP"; } || continue +# Check for GNU ac_path_FGREP and select it if it is found. + # Check for GNU $ac_path_FGREP +case `"$ac_path_FGREP" --version 2>&1` in +*GNU*) + ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'FGREP' >> "conftest.nl" + "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_FGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_FGREP="$ac_path_FGREP" + ac_path_FGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_FGREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_FGREP"; then + as_fn_error "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_FGREP=$FGREP +fi + + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 +$as_echo "$ac_cv_path_FGREP" >&6; } + FGREP="$ac_cv_path_FGREP" + + +test -z "$GREP" && GREP=grep + + + + + + + + + + + + + + + + + + + +# Check whether --with-gnu-ld was given. +if test "${with_gnu_ld+set}" = set; then : + withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes +else + with_gnu_ld=no +fi + +ac_prog=ld +if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 +$as_echo_n "checking for ld used by $CC... " >&6; } + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [\\/]* | ?:[\\/]*) + re_direlt='/[^/][^/]*/\.\./' + # Canonicalize the pathname of ld + ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` + while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do + ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 +$as_echo_n "checking for GNU ld... " >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 +$as_echo_n "checking for non-GNU ld... " >&6; } +fi +if test "${lt_cv_path_LD+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$LD"; then + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + lt_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some variants of GNU ld only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$lt_cv_path_LD" -v 2>&1 &5 +$as_echo "$LD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +test -z "$LD" && as_fn_error "no acceptable ld found in \$PATH" "$LINENO" 5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 +$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } +if test "${lt_cv_prog_gnu_ld+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + # I'd rather use --version here, but apparently some GNU lds only accept -v. +case `$LD -v 2>&1 &5 +$as_echo "$lt_cv_prog_gnu_ld" >&6; } +with_gnu_ld=$lt_cv_prog_gnu_ld + + + + + + + + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 +$as_echo_n "checking how to run the C preprocessor... " >&6; } +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then + if test "${ac_cv_prog_CPP+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + # Double quotes because CPP needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" + do + ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + break +fi + + done + ac_cv_prog_CPP=$CPP + +fi + CPP=$ac_cv_prog_CPP +else + ac_cv_prog_CPP=$CPP +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 +$as_echo "$CPP" >&6; } +ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error "C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details." "$LINENO" 5; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}sed", so it can be a program name with args. +set dummy ${ac_tool_prefix}sed; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_SED+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$SED"; then + ac_cv_prog_SED="$SED" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_SED="${ac_tool_prefix}sed" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +SED=$ac_cv_prog_SED +if test -n "$SED"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SED" >&5 +$as_echo "$SED" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_SED"; then + ac_ct_SED=$SED + # Extract the first word of "sed", so it can be a program name with args. +set dummy sed; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_SED+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_SED"; then + ac_cv_prog_ac_ct_SED="$ac_ct_SED" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_SED="sed" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_SED=$ac_cv_prog_ac_ct_SED +if test -n "$ac_ct_SED"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_SED" >&5 +$as_echo "$ac_ct_SED" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_SED" = x; then + SED=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + SED=$ac_ct_SED + fi +else + SED="$ac_cv_prog_SED" +fi + +enable_win32_dll=yes + +case $host in +*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-cegcc*) + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args. +set dummy ${ac_tool_prefix}as; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_AS+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AS"; then + ac_cv_prog_AS="$AS" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_AS="${ac_tool_prefix}as" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AS=$ac_cv_prog_AS +if test -n "$AS"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AS" >&5 +$as_echo "$AS" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_AS"; then + ac_ct_AS=$AS + # Extract the first word of "as", so it can be a program name with args. +set dummy as; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_AS+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_AS"; then + ac_cv_prog_ac_ct_AS="$ac_ct_AS" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_AS="as" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_AS=$ac_cv_prog_ac_ct_AS +if test -n "$ac_ct_AS"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AS" >&5 +$as_echo "$ac_ct_AS" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_AS" = x; then + AS="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + AS=$ac_ct_AS + fi +else + AS="$ac_cv_prog_AS" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. +set dummy ${ac_tool_prefix}dlltool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_DLLTOOL+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$DLLTOOL"; then + ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +DLLTOOL=$ac_cv_prog_DLLTOOL +if test -n "$DLLTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 +$as_echo "$DLLTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_DLLTOOL"; then + ac_ct_DLLTOOL=$DLLTOOL + # Extract the first word of "dlltool", so it can be a program name with args. +set dummy dlltool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_DLLTOOL+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_DLLTOOL"; then + ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_DLLTOOL="dlltool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL +if test -n "$ac_ct_DLLTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 +$as_echo "$ac_ct_DLLTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_DLLTOOL" = x; then + DLLTOOL="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DLLTOOL=$ac_ct_DLLTOOL + fi +else + DLLTOOL="$ac_cv_prog_DLLTOOL" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. +set dummy ${ac_tool_prefix}objdump; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_OBJDUMP+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OBJDUMP"; then + ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OBJDUMP=$ac_cv_prog_OBJDUMP +if test -n "$OBJDUMP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 +$as_echo "$OBJDUMP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OBJDUMP"; then + ac_ct_OBJDUMP=$OBJDUMP + # Extract the first word of "objdump", so it can be a program name with args. +set dummy objdump; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_OBJDUMP+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OBJDUMP"; then + ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_OBJDUMP="objdump" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP +if test -n "$ac_ct_OBJDUMP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 +$as_echo "$ac_ct_OBJDUMP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_OBJDUMP" = x; then + OBJDUMP="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OBJDUMP=$ac_ct_OBJDUMP + fi +else + OBJDUMP="$ac_cv_prog_OBJDUMP" +fi + + ;; +esac + +test -z "$AS" && AS=as + + + + + +test -z "$DLLTOOL" && DLLTOOL=dlltool + + + + + +test -z "$OBJDUMP" && OBJDUMP=objdump + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 +$as_echo_n "checking whether ln -s works... " >&6; } +LN_S=$as_ln_s +if test "$LN_S" = "ln -s"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 +$as_echo "no, using $LN_S" >&6; } +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } +set x ${MAKE-make} +ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then : + $as_echo_n "(cached) " >&6 +else + cat >conftest.make <<\_ACEOF +SHELL = /bin/sh +all: + @echo '@@@%%%=$(MAKE)=@@@%%%' +_ACEOF +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac +rm -f conftest.make +fi +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + SET_MAKE= +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + SET_MAKE="MAKE=${MAKE-make}" +fi + +case `pwd` in + *\ * | *\ *) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 +$as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; +esac + + + +macro_version='2.2.6b' +macro_revision='1.3017' + + + + + + + + + + + + + +ltmain="$ac_aux_dir/ltmain.sh" + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 +$as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } +if test "${lt_cv_path_NM+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$NM"; then + # Let the user override the test. + lt_cv_path_NM="$NM" +else + lt_nm_to_check="${ac_tool_prefix}nm" + if test -n "$ac_tool_prefix" && test "$build" = "$host"; then + lt_nm_to_check="$lt_nm_to_check nm" + fi + for lt_tmp_nm in $lt_nm_to_check; do + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + tmp_nm="$ac_dir/$lt_tmp_nm" + if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then + # Check to see if the nm accepts a BSD-compat flag. + # Adding the `sed 1q' prevents false positives on HP-UX, which says: + # nm: unknown option "B" ignored + # Tru64's nm complains that /dev/null is an invalid object file + case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in + */dev/null* | *'Invalid file or object type'*) + lt_cv_path_NM="$tmp_nm -B" + break + ;; + *) + case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in + */dev/null*) + lt_cv_path_NM="$tmp_nm -p" + break + ;; + *) + lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but + continue # so that we can try to find one that supports BSD flags + ;; + esac + ;; + esac + fi + done + IFS="$lt_save_ifs" + done + : ${lt_cv_path_NM=no} +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 +$as_echo "$lt_cv_path_NM" >&6; } +if test "$lt_cv_path_NM" != "no"; then + NM="$lt_cv_path_NM" +else + # Didn't find any BSD compatible name lister, look for dumpbin. + if test -n "$ac_tool_prefix"; then + for ac_prog in "dumpbin -symbols" "link -dump -symbols" + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_DUMPBIN+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$DUMPBIN"; then + ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +DUMPBIN=$ac_cv_prog_DUMPBIN +if test -n "$DUMPBIN"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 +$as_echo "$DUMPBIN" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$DUMPBIN" && break + done +fi +if test -z "$DUMPBIN"; then + ac_ct_DUMPBIN=$DUMPBIN + for ac_prog in "dumpbin -symbols" "link -dump -symbols" +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_DUMPBIN+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_DUMPBIN"; then + ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN +if test -n "$ac_ct_DUMPBIN"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 +$as_echo "$ac_ct_DUMPBIN" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_DUMPBIN" && break +done + + if test "x$ac_ct_DUMPBIN" = x; then + DUMPBIN=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DUMPBIN=$ac_ct_DUMPBIN + fi +fi + + + if test "$DUMPBIN" != ":"; then + NM="$DUMPBIN" + fi +fi +test -z "$NM" && NM=nm + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 +$as_echo_n "checking the name lister ($NM) interface... " >&6; } +if test "${lt_cv_nm_interface+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_nm_interface="BSD nm" + echo "int some_variable = 0;" > conftest.$ac_ext + (eval echo "\"\$as_me:5158: $ac_compile\"" >&5) + (eval "$ac_compile" 2>conftest.err) + cat conftest.err >&5 + (eval echo "\"\$as_me:5161: $NM \\\"conftest.$ac_objext\\\"\"" >&5) + (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) + cat conftest.err >&5 + (eval echo "\"\$as_me:5164: output\"" >&5) + cat conftest.out >&5 + if $GREP 'External.*some_variable' conftest.out > /dev/null; then + lt_cv_nm_interface="MS dumpbin" + fi + rm -f conftest* +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 +$as_echo "$lt_cv_nm_interface" >&6; } + +# find the maximum length of command line arguments +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 +$as_echo_n "checking the maximum length of command line arguments... " >&6; } +if test "${lt_cv_sys_max_cmd_len+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + i=0 + teststring="ABCD" + + case $build_os in + msdosdjgpp*) + # On DJGPP, this test can blow up pretty badly due to problems in libc + # (any single argument exceeding 2000 bytes causes a buffer overrun + # during glob expansion). Even if it were fixed, the result of this + # check would be larger than it should be. + lt_cv_sys_max_cmd_len=12288; # 12K is about right + ;; + + gnu*) + # Under GNU Hurd, this test is not required because there is + # no limit to the length of command line arguments. + # Libtool will interpret -1 as no limit whatsoever + lt_cv_sys_max_cmd_len=-1; + ;; + + cygwin* | mingw* | cegcc*) + # On Win9x/ME, this test blows up -- it succeeds, but takes + # about 5 minutes as the teststring grows exponentially. + # Worse, since 9x/ME are not pre-emptively multitasking, + # you end up with a "frozen" computer, even though with patience + # the test eventually succeeds (with a max line length of 256k). + # Instead, let's just punt: use the minimum linelength reported by + # all of the supported platforms: 8192 (on NT/2K/XP). + lt_cv_sys_max_cmd_len=8192; + ;; + + amigaos*) + # On AmigaOS with pdksh, this test takes hours, literally. + # So we just punt and use a minimum line length of 8192. + lt_cv_sys_max_cmd_len=8192; + ;; + + netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) + # This has been around since 386BSD, at least. Likely further. + if test -x /sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` + elif test -x /usr/sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` + else + lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs + fi + # And add a safety zone + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + ;; + + interix*) + # We know the value 262144 and hardcode it with a safety zone (like BSD) + lt_cv_sys_max_cmd_len=196608 + ;; + + osf*) + # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure + # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not + # nice to cause kernel panics so lets avoid the loop below. + # First set a reasonable default. + lt_cv_sys_max_cmd_len=16384 + # + if test -x /sbin/sysconfig; then + case `/sbin/sysconfig -q proc exec_disable_arg_limit` in + *1*) lt_cv_sys_max_cmd_len=-1 ;; + esac + fi + ;; + sco3.2v5*) + lt_cv_sys_max_cmd_len=102400 + ;; + sysv5* | sco5v6* | sysv4.2uw2*) + kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` + if test -n "$kargmax"; then + lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` + else + lt_cv_sys_max_cmd_len=32768 + fi + ;; + *) + lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` + if test -n "$lt_cv_sys_max_cmd_len"; then + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + else + # Make teststring a little bigger before we do anything with it. + # a 1K string should be a reasonable start. + for i in 1 2 3 4 5 6 7 8 ; do + teststring=$teststring$teststring + done + SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} + # If test is not a shell built-in, we'll probably end up computing a + # maximum length that is only half of the actual maximum length, but + # we can't tell. + while { test "X"`$SHELL $0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \ + = "XX$teststring$teststring"; } >/dev/null 2>&1 && + test $i != 17 # 1/2 MB should be enough + do + i=`expr $i + 1` + teststring=$teststring$teststring + done + # Only check the string length outside the loop. + lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` + teststring= + # Add a significant safety factor because C++ compilers can tack on + # massive amounts of additional arguments before passing them to the + # linker. It appears as though 1/2 is a usable value. + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` + fi + ;; + esac + +fi + +if test -n $lt_cv_sys_max_cmd_len ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 +$as_echo "$lt_cv_sys_max_cmd_len" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 +$as_echo "none" >&6; } +fi +max_cmd_len=$lt_cv_sys_max_cmd_len + + + + + + +: ${CP="cp -f"} +: ${MV="mv -f"} +: ${RM="rm -f"} + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5 +$as_echo_n "checking whether the shell understands some XSI constructs... " >&6; } +# Try some XSI features +xsi_shell=no +( _lt_dummy="a/b/c" + test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \ + = c,a/b,, \ + && eval 'test $(( 1 + 1 )) -eq 2 \ + && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ + && xsi_shell=yes +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5 +$as_echo "$xsi_shell" >&6; } + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5 +$as_echo_n "checking whether the shell understands \"+=\"... " >&6; } +lt_shell_append=no +( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \ + >/dev/null 2>&1 \ + && lt_shell_append=yes +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5 +$as_echo "$lt_shell_append" >&6; } + + +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + lt_unset=unset +else + lt_unset=false +fi + + + + + +# test EBCDIC or ASCII +case `echo X|tr X '\101'` in + A) # ASCII based system + # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr + lt_SP2NL='tr \040 \012' + lt_NL2SP='tr \015\012 \040\040' + ;; + *) # EBCDIC based system + lt_SP2NL='tr \100 \n' + lt_NL2SP='tr \r\n \100\100' + ;; +esac + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 +$as_echo_n "checking for $LD option to reload object files... " >&6; } +if test "${lt_cv_ld_reload_flag+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_ld_reload_flag='-r' +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 +$as_echo "$lt_cv_ld_reload_flag" >&6; } +reload_flag=$lt_cv_ld_reload_flag +case $reload_flag in +"" | " "*) ;; +*) reload_flag=" $reload_flag" ;; +esac +reload_cmds='$LD$reload_flag -o $output$reload_objs' +case $host_os in + darwin*) + if test "$GCC" = yes; then + reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' + else + reload_cmds='$LD$reload_flag -o $output$reload_objs' + fi + ;; +esac + + + + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. +set dummy ${ac_tool_prefix}objdump; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_OBJDUMP+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OBJDUMP"; then + ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OBJDUMP=$ac_cv_prog_OBJDUMP +if test -n "$OBJDUMP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 +$as_echo "$OBJDUMP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OBJDUMP"; then + ac_ct_OBJDUMP=$OBJDUMP + # Extract the first word of "objdump", so it can be a program name with args. +set dummy objdump; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_OBJDUMP+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OBJDUMP"; then + ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_OBJDUMP="objdump" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP +if test -n "$ac_ct_OBJDUMP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 +$as_echo "$ac_ct_OBJDUMP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_OBJDUMP" = x; then + OBJDUMP="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OBJDUMP=$ac_ct_OBJDUMP + fi +else + OBJDUMP="$ac_cv_prog_OBJDUMP" +fi + +test -z "$OBJDUMP" && OBJDUMP=objdump + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 +$as_echo_n "checking how to recognize dependent libraries... " >&6; } +if test "${lt_cv_deplibs_check_method+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_file_magic_cmd='$MAGIC_CMD' +lt_cv_file_magic_test_file= +lt_cv_deplibs_check_method='unknown' +# Need to set the preceding variable on all platforms that support +# interlibrary dependencies. +# 'none' -- dependencies not supported. +# `unknown' -- same as none, but documents that we really don't know. +# 'pass_all' -- all dependencies passed with no checks. +# 'test_compile' -- check by making test program. +# 'file_magic [[regex]]' -- check by looking for files in library path +# which responds to the $file_magic_cmd with a given extended regex. +# If you have `file' or equivalent on your system and you're not sure +# whether `pass_all' will *always* work, you probably want this one. + +case $host_os in +aix[4-9]*) + lt_cv_deplibs_check_method=pass_all + ;; + +beos*) + lt_cv_deplibs_check_method=pass_all + ;; + +bsdi[45]*) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' + lt_cv_file_magic_cmd='/usr/bin/file -L' + lt_cv_file_magic_test_file=/shlib/libc.so + ;; + +cygwin*) + # func_win32_libid is a shell function defined in ltmain.sh + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + ;; + +mingw* | pw32*) + # Base MSYS/MinGW do not provide the 'file' command needed by + # func_win32_libid shell function, so use a weaker test based on 'objdump', + # unless we find 'file', for example because we are cross-compiling. + if ( file / ) >/dev/null 2>&1; then + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + else + lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' + lt_cv_file_magic_cmd='$OBJDUMP -f' + fi + ;; + +cegcc) + # use the weaker test based on 'objdump'. See mingw*. + lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' + lt_cv_file_magic_cmd='$OBJDUMP -f' + ;; + +darwin* | rhapsody*) + lt_cv_deplibs_check_method=pass_all + ;; + +freebsd* | dragonfly*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + case $host_cpu in + i*86 ) + # Not sure whether the presence of OpenBSD here was a mistake. + # Let's accept both of them until this is cleared up. + lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` + ;; + esac + else + lt_cv_deplibs_check_method=pass_all + fi + ;; + +gnu*) + lt_cv_deplibs_check_method=pass_all + ;; + +hpux10.20* | hpux11*) + lt_cv_file_magic_cmd=/usr/bin/file + case $host_cpu in + ia64*) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' + lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so + ;; + hppa*64*) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]' + lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl + ;; + *) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library' + lt_cv_file_magic_test_file=/usr/lib/libc.sl + ;; + esac + ;; + +interix[3-9]*) + # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' + ;; + +irix5* | irix6* | nonstopux*) + case $LD in + *-32|*"-32 ") libmagic=32-bit;; + *-n32|*"-n32 ") libmagic=N32;; + *-64|*"-64 ") libmagic=64-bit;; + *) libmagic=never-match;; + esac + lt_cv_deplibs_check_method=pass_all + ;; + +# This must be Linux ELF. +linux* | k*bsd*-gnu) + lt_cv_deplibs_check_method=pass_all + ;; + +netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' + fi + ;; + +newos6*) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=/usr/lib/libnls.so + ;; + +*nto* | *qnx*) + lt_cv_deplibs_check_method=pass_all + ;; + +openbsd*) + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' + fi + ;; + +osf3* | osf4* | osf5*) + lt_cv_deplibs_check_method=pass_all + ;; + +rdos*) + lt_cv_deplibs_check_method=pass_all + ;; + +solaris*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv4 | sysv4.3*) + case $host_vendor in + motorola) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` + ;; + ncr) + lt_cv_deplibs_check_method=pass_all + ;; + sequent) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' + ;; + sni) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" + lt_cv_file_magic_test_file=/lib/libc.so + ;; + siemens) + lt_cv_deplibs_check_method=pass_all + ;; + pc) + lt_cv_deplibs_check_method=pass_all + ;; + esac + ;; + +tpf*) + lt_cv_deplibs_check_method=pass_all + ;; +esac + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 +$as_echo "$lt_cv_deplibs_check_method" >&6; } +file_magic_cmd=$lt_cv_file_magic_cmd +deplibs_check_method=$lt_cv_deplibs_check_method +test -z "$deplibs_check_method" && deplibs_check_method=unknown + + + + + + + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. +set dummy ${ac_tool_prefix}ar; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_AR+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_AR="${ac_tool_prefix}ar" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AR=$ac_cv_prog_AR +if test -n "$AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 +$as_echo "$AR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_AR"; then + ac_ct_AR=$AR + # Extract the first word of "ar", so it can be a program name with args. +set dummy ar; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_AR+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_AR"; then + ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_AR="ar" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_AR=$ac_cv_prog_ac_ct_AR +if test -n "$ac_ct_AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 +$as_echo "$ac_ct_AR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_AR" = x; then + AR="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + AR=$ac_ct_AR + fi +else + AR="$ac_cv_prog_AR" +fi + +test -z "$AR" && AR=ar +test -z "$AR_FLAGS" && AR_FLAGS=cru + + + + + + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_STRIP+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +$as_echo "$STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_STRIP="strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +$as_echo "$ac_ct_STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi +else + STRIP="$ac_cv_prog_STRIP" +fi + +test -z "$STRIP" && STRIP=: + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_RANLIB+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +RANLIB=$ac_cv_prog_RANLIB +if test -n "$RANLIB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 +$as_echo "$RANLIB" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_RANLIB"; then + ac_ct_RANLIB=$RANLIB + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_RANLIB"; then + ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_RANLIB="ranlib" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB +if test -n "$ac_ct_RANLIB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 +$as_echo "$ac_ct_RANLIB" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_RANLIB" = x; then + RANLIB=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + RANLIB=$ac_ct_RANLIB + fi +else + RANLIB="$ac_cv_prog_RANLIB" +fi + +test -z "$RANLIB" && RANLIB=: + + + + + + +# Determine commands to create old-style static archives. +old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' +old_postinstall_cmds='chmod 644 $oldlib' +old_postuninstall_cmds= + +if test -n "$RANLIB"; then + case $host_os in + openbsd*) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" + ;; + *) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" + ;; + esac + old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + +# Check for command to grab the raw symbol name followed by C symbol from nm. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 +$as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } +if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + +# These are sane defaults that work on at least a few old systems. +# [They come from Ultrix. What could be older than Ultrix?!! ;)] + +# Character class describing NM global symbol codes. +symcode='[BCDEGRST]' + +# Regexp to match symbols that can be accessed directly from C. +sympat='\([_A-Za-z][_A-Za-z0-9]*\)' + +# Define system-specific variables. +case $host_os in +aix*) + symcode='[BCDT]' + ;; +cygwin* | mingw* | pw32* | cegcc*) + symcode='[ABCDGISTW]' + ;; +hpux*) + if test "$host_cpu" = ia64; then + symcode='[ABCDEGRST]' + fi + ;; +irix* | nonstopux*) + symcode='[BCDEGRST]' + ;; +osf*) + symcode='[BCDEGQRST]' + ;; +solaris*) + symcode='[BDRT]' + ;; +sco3.2v5*) + symcode='[DT]' + ;; +sysv4.2uw2*) + symcode='[DT]' + ;; +sysv5* | sco5v6* | unixware* | OpenUNIX*) + symcode='[ABDT]' + ;; +sysv4) + symcode='[DFNSTU]' + ;; +esac + +# If we're using GNU nm, then use its standard symbol codes. +case `$NM -V 2>&1` in +*GNU* | *'with BFD'*) + symcode='[ABCDGIRSTW]' ;; +esac + +# Transform an extracted symbol line into a proper C declaration. +# Some systems (esp. on ia64) link data and code symbols differently, +# so use this general approach. +lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" + +# Transform an extracted symbol line into symbol name and symbol address +lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'" +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'" + +# Handle CRLF in mingw tool chain +opt_cr= +case $build_os in +mingw*) + opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp + ;; +esac + +# Try without a prefix underscore, then with it. +for ac_symprfx in "" "_"; do + + # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. + symxfrm="\\1 $ac_symprfx\\2 \\2" + + # Write the raw and C identifiers. + if test "$lt_cv_nm_interface" = "MS dumpbin"; then + # Fake it for dumpbin and say T for any non-static function + # and D for any global variable. + # Also find C++ and __fastcall symbols from MSVC++, + # which start with @ or ?. + lt_cv_sys_global_symbol_pipe="$AWK '"\ +" {last_section=section; section=\$ 3};"\ +" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ +" \$ 0!~/External *\|/{next};"\ +" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ +" {if(hide[section]) next};"\ +" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ +" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ +" s[1]~/^[@?]/{print s[1], s[1]; next};"\ +" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ +" ' prfx=^$ac_symprfx" + else + lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" + fi + + # Check to see that the pipe works correctly. + pipe_works=no + + rm -f conftest* + cat > conftest.$ac_ext <<_LT_EOF +#ifdef __cplusplus +extern "C" { +#endif +char nm_test_var; +void nm_test_func(void); +void nm_test_func(void){} +#ifdef __cplusplus +} +#endif +int main(){nm_test_var='a';nm_test_func();return(0);} +_LT_EOF + + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + # Now try to grab the symbols. + nlist=conftest.nm + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\""; } >&5 + (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s "$nlist"; then + # Try sorting and uniquifying the output. + if sort "$nlist" | uniq > "$nlist"T; then + mv -f "$nlist"T "$nlist" + else + rm -f "$nlist"T + fi + + # Make sure that we snagged all the symbols we need. + if $GREP ' nm_test_var$' "$nlist" >/dev/null; then + if $GREP ' nm_test_func$' "$nlist" >/dev/null; then + cat <<_LT_EOF > conftest.$ac_ext +#ifdef __cplusplus +extern "C" { +#endif + +_LT_EOF + # Now generate the symbol file. + eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' + + cat <<_LT_EOF >> conftest.$ac_ext + +/* The mapping between symbol names and symbols. */ +const struct { + const char *name; + void *address; +} +lt__PROGRAM__LTX_preloaded_symbols[] = +{ + { "@PROGRAM@", (void *) 0 }, +_LT_EOF + $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext + cat <<\_LT_EOF >> conftest.$ac_ext + {0, (void *) 0} +}; + +/* This works around a problem in FreeBSD linker */ +#ifdef FREEBSD_WORKAROUND +static const void *lt_preloaded_setup() { + return lt__PROGRAM__LTX_preloaded_symbols; +} +#endif + +#ifdef __cplusplus +} +#endif +_LT_EOF + # Now try linking the two files. + mv conftest.$ac_objext conftstm.$ac_objext + lt_save_LIBS="$LIBS" + lt_save_CFLAGS="$CFLAGS" + LIBS="conftstm.$ac_objext" + CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest${ac_exeext}; then + pipe_works=yes + fi + LIBS="$lt_save_LIBS" + CFLAGS="$lt_save_CFLAGS" + else + echo "cannot find nm_test_func in $nlist" >&5 + fi + else + echo "cannot find nm_test_var in $nlist" >&5 + fi + else + echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 + fi + else + echo "$progname: failed program was:" >&5 + cat conftest.$ac_ext >&5 + fi + rm -rf conftest* conftst* + + # Do not use the global_symbol_pipe unless it works. + if test "$pipe_works" = yes; then + break + else + lt_cv_sys_global_symbol_pipe= + fi +done + +fi + +if test -z "$lt_cv_sys_global_symbol_pipe"; then + lt_cv_sys_global_symbol_to_cdecl= +fi +if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5 +$as_echo "failed" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 +$as_echo "ok" >&6; } +fi + + + + + + + + + + + + + + + + + + + + + + + +# Check whether --enable-libtool-lock was given. +if test "${enable_libtool_lock+set}" = set; then : + enableval=$enable_libtool_lock; +fi + +test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes + +# Some flags need to be propagated to the compiler or linker for good +# libtool support. +case $host in +ia64-*-hpux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + case `/usr/bin/file conftest.$ac_objext` in + *ELF-32*) + HPUX_IA64_MODE="32" + ;; + *ELF-64*) + HPUX_IA64_MODE="64" + ;; + esac + fi + rm -rf conftest* + ;; +*-*-irix6*) + # Find out which ABI we are using. + echo '#line 6356 "configure"' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + if test "$lt_cv_prog_gnu_ld" = yes; then + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -melf32bsmip" + ;; + *N32*) + LD="${LD-ld} -melf32bmipn32" + ;; + *64-bit*) + LD="${LD-ld} -melf64bmip" + ;; + esac + else + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -32" + ;; + *N32*) + LD="${LD-ld} -n32" + ;; + *64-bit*) + LD="${LD-ld} -64" + ;; + esac + fi + fi + rm -rf conftest* + ;; + +x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ +s390*-*linux*|s390*-*tpf*|sparc*-*linux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + case `/usr/bin/file conftest.o` in + *32-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_i386_fbsd" + ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_i386" + ;; + ppc64-*linux*|powerpc64-*linux*) + LD="${LD-ld} -m elf32ppclinux" + ;; + s390x-*linux*) + LD="${LD-ld} -m elf_s390" + ;; + sparc64-*linux*) + LD="${LD-ld} -m elf32_sparc" + ;; + esac + ;; + *64-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_x86_64_fbsd" + ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_x86_64" + ;; + ppc*-*linux*|powerpc*-*linux*) + LD="${LD-ld} -m elf64ppc" + ;; + s390*-*linux*|s390*-*tpf*) + LD="${LD-ld} -m elf64_s390" + ;; + sparc*-*linux*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; + +*-*-sco3.2v5*) + # On SCO OpenServer 5, we need -belf to get full-featured binaries. + SAVE_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -belf" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 +$as_echo_n "checking whether the C compiler needs -belf... " >&6; } +if test "${lt_cv_cc_needs_belf+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + lt_cv_cc_needs_belf=yes +else + lt_cv_cc_needs_belf=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 +$as_echo "$lt_cv_cc_needs_belf" >&6; } + if test x"$lt_cv_cc_needs_belf" != x"yes"; then + # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf + CFLAGS="$SAVE_CFLAGS" + fi + ;; +sparc*-*solaris*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + case `/usr/bin/file conftest.o` in + *64-bit*) + case $lt_cv_prog_gnu_ld in + yes*) LD="${LD-ld} -m elf64_sparc" ;; + *) + if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then + LD="${LD-ld} -64" + fi + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; +esac + +need_locks="$enable_libtool_lock" + + + case $host_os in + rhapsody* | darwin*) + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. +set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_DSYMUTIL+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$DSYMUTIL"; then + ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +DSYMUTIL=$ac_cv_prog_DSYMUTIL +if test -n "$DSYMUTIL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 +$as_echo "$DSYMUTIL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_DSYMUTIL"; then + ac_ct_DSYMUTIL=$DSYMUTIL + # Extract the first word of "dsymutil", so it can be a program name with args. +set dummy dsymutil; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_DSYMUTIL+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_DSYMUTIL"; then + ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL +if test -n "$ac_ct_DSYMUTIL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 +$as_echo "$ac_ct_DSYMUTIL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_DSYMUTIL" = x; then + DSYMUTIL=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DSYMUTIL=$ac_ct_DSYMUTIL + fi +else + DSYMUTIL="$ac_cv_prog_DSYMUTIL" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. +set dummy ${ac_tool_prefix}nmedit; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_NMEDIT+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$NMEDIT"; then + ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +NMEDIT=$ac_cv_prog_NMEDIT +if test -n "$NMEDIT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 +$as_echo "$NMEDIT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_NMEDIT"; then + ac_ct_NMEDIT=$NMEDIT + # Extract the first word of "nmedit", so it can be a program name with args. +set dummy nmedit; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_NMEDIT+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_NMEDIT"; then + ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_NMEDIT="nmedit" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT +if test -n "$ac_ct_NMEDIT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 +$as_echo "$ac_ct_NMEDIT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_NMEDIT" = x; then + NMEDIT=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + NMEDIT=$ac_ct_NMEDIT + fi +else + NMEDIT="$ac_cv_prog_NMEDIT" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. +set dummy ${ac_tool_prefix}lipo; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_LIPO+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$LIPO"; then + ac_cv_prog_LIPO="$LIPO" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_LIPO="${ac_tool_prefix}lipo" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +LIPO=$ac_cv_prog_LIPO +if test -n "$LIPO"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 +$as_echo "$LIPO" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_LIPO"; then + ac_ct_LIPO=$LIPO + # Extract the first word of "lipo", so it can be a program name with args. +set dummy lipo; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_LIPO+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_LIPO"; then + ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_LIPO="lipo" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO +if test -n "$ac_ct_LIPO"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 +$as_echo "$ac_ct_LIPO" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_LIPO" = x; then + LIPO=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + LIPO=$ac_ct_LIPO + fi +else + LIPO="$ac_cv_prog_LIPO" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. +set dummy ${ac_tool_prefix}otool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_OTOOL+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OTOOL"; then + ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_OTOOL="${ac_tool_prefix}otool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OTOOL=$ac_cv_prog_OTOOL +if test -n "$OTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 +$as_echo "$OTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OTOOL"; then + ac_ct_OTOOL=$OTOOL + # Extract the first word of "otool", so it can be a program name with args. +set dummy otool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_OTOOL+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OTOOL"; then + ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_OTOOL="otool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL +if test -n "$ac_ct_OTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 +$as_echo "$ac_ct_OTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_OTOOL" = x; then + OTOOL=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OTOOL=$ac_ct_OTOOL + fi +else + OTOOL="$ac_cv_prog_OTOOL" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. +set dummy ${ac_tool_prefix}otool64; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_OTOOL64+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OTOOL64"; then + ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OTOOL64=$ac_cv_prog_OTOOL64 +if test -n "$OTOOL64"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 +$as_echo "$OTOOL64" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OTOOL64"; then + ac_ct_OTOOL64=$OTOOL64 + # Extract the first word of "otool64", so it can be a program name with args. +set dummy otool64; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_OTOOL64+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OTOOL64"; then + ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_OTOOL64="otool64" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 +if test -n "$ac_ct_OTOOL64"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 +$as_echo "$ac_ct_OTOOL64" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_OTOOL64" = x; then + OTOOL64=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OTOOL64=$ac_ct_OTOOL64 + fi +else + OTOOL64="$ac_cv_prog_OTOOL64" +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 +$as_echo_n "checking for -single_module linker flag... " >&6; } +if test "${lt_cv_apple_cc_single_mod+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_apple_cc_single_mod=no + if test -z "${LT_MULTI_MODULE}"; then + # By default we will add the -single_module flag. You can override + # by either setting the environment variable LT_MULTI_MODULE + # non-empty at configure time, or by adding -multi_module to the + # link flags. + rm -rf libconftest.dylib* + echo "int foo(void){return 1;}" > conftest.c + echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ +-dynamiclib -Wl,-single_module conftest.c" >&5 + $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ + -dynamiclib -Wl,-single_module conftest.c 2>conftest.err + _lt_result=$? + if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then + lt_cv_apple_cc_single_mod=yes + else + cat conftest.err >&5 + fi + rm -rf libconftest.dylib* + rm -f conftest.* + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 +$as_echo "$lt_cv_apple_cc_single_mod" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 +$as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } +if test "${lt_cv_ld_exported_symbols_list+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_ld_exported_symbols_list=no + save_LDFLAGS=$LDFLAGS + echo "_main" > conftest.sym + LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + lt_cv_ld_exported_symbols_list=yes +else + lt_cv_ld_exported_symbols_list=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS="$save_LDFLAGS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 +$as_echo "$lt_cv_ld_exported_symbols_list" >&6; } + case $host_os in + rhapsody* | darwin1.[012]) + _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; + darwin1.*) + _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + darwin*) # darwin 5.x on + # if running on 10.5 or later, the deployment target defaults + # to the OS version, if on x86, and 10.4, the deployment + # target defaults to 10.4. Don't you love it? + case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in + 10.0,*86*-darwin8*|10.0,*-darwin[91]*) + _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; + 10.[012]*) + _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + 10.*) + _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; + esac + ;; + esac + if test "$lt_cv_apple_cc_single_mod" = "yes"; then + _lt_dar_single_mod='$single_module' + fi + if test "$lt_cv_ld_exported_symbols_list" = "yes"; then + _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' + else + _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' + fi + if test "$DSYMUTIL" != ":"; then + _lt_dsymutil='~$DSYMUTIL $lib || :' + else + _lt_dsymutil= + fi + ;; + esac + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } +if test "${ac_cv_header_stdc+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_header_stdc=yes +else + ac_cv_header_stdc=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + return 2; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + +else + ac_cv_header_stdc=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 +$as_echo "$ac_cv_header_stdc" >&6; } +if test $ac_cv_header_stdc = yes; then + +$as_echo "#define STDC_HEADERS 1" >>confdefs.h + +fi + +# On IRIX 5.3, sys/types and inttypes.h are conflicting. +for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ + inttypes.h stdint.h unistd.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default +" +eval as_val=\$$as_ac_Header + if test "x$as_val" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +for ac_header in dlfcn.h +do : + ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default +" +if test "x$ac_cv_header_dlfcn_h" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_DLFCN_H 1 +_ACEOF + +fi + +done + + + +# Set options + + + + enable_dlopen=no + + + + # Check whether --enable-shared was given. +if test "${enable_shared+set}" = set; then : + enableval=$enable_shared; p=${PACKAGE-default} + case $enableval in + yes) enable_shared=yes ;; + no) enable_shared=no ;; + *) + enable_shared=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_shared=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac +else + enable_shared=yes +fi + + + + + + + + + + # Check whether --enable-static was given. +if test "${enable_static+set}" = set; then : + enableval=$enable_static; p=${PACKAGE-default} + case $enableval in + yes) enable_static=yes ;; + no) enable_static=no ;; + *) + enable_static=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_static=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac +else + enable_static=yes +fi + + + + + + + + + + +# Check whether --with-pic was given. +if test "${with_pic+set}" = set; then : + withval=$with_pic; pic_mode="$withval" +else + pic_mode=default +fi + + +test -z "$pic_mode" && pic_mode=default + + + + + + + + # Check whether --enable-fast-install was given. +if test "${enable_fast_install+set}" = set; then : + enableval=$enable_fast_install; p=${PACKAGE-default} + case $enableval in + yes) enable_fast_install=yes ;; + no) enable_fast_install=no ;; + *) + enable_fast_install=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_fast_install=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac +else + enable_fast_install=yes +fi + + + + + + + + + + + +# This can be used to rebuild libtool when needed +LIBTOOL_DEPS="$ltmain" + +# Always use our own libtool. +LIBTOOL='$(SHELL) $(top_builddir)/libtool' + + + + + + + + + + + + + + + + + + + + + + + + + +test -z "$LN_S" && LN_S="ln -s" + + + + + + + + + + + + + + +if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 +$as_echo_n "checking for objdir... " >&6; } +if test "${lt_cv_objdir+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + rm -f .libs 2>/dev/null +mkdir .libs 2>/dev/null +if test -d .libs; then + lt_cv_objdir=.libs +else + # MS-DOS does not allow filenames that begin with a dot. + lt_cv_objdir=_libs +fi +rmdir .libs 2>/dev/null +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 +$as_echo "$lt_cv_objdir" >&6; } +objdir=$lt_cv_objdir + + + + + +cat >>confdefs.h <<_ACEOF +#define LT_OBJDIR "$lt_cv_objdir/" +_ACEOF + + + + + + + + + + + + + + + + + +case $host_os in +aix3*) + # AIX sometimes has problems with the GCC collect2 program. For some + # reason, if we set the COLLECT_NAMES environment variable, the problems + # vanish in a puff of smoke. + if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES + fi + ;; +esac + +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +sed_quote_subst='s/\(["`$\\]\)/\\\1/g' + +# Same as above, but do not quote variable references. +double_quote_subst='s/\(["`\\]\)/\\\1/g' + +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' + +# Sed substitution to delay expansion of an escaped single quote. +delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' + +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' + +# Global variables: +ofile=libtool +can_build_shared=yes + +# All known linkers require a `.a' archive for static linking (except MSVC, +# which needs '.lib'). +libext=a + +with_gnu_ld="$lt_cv_prog_gnu_ld" + +old_CC="$CC" +old_CFLAGS="$CFLAGS" + +# Set sane defaults for various variables +test -z "$CC" && CC=cc +test -z "$LTCC" && LTCC=$CC +test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS +test -z "$LD" && LD=ld +test -z "$ac_objext" && ac_objext=o + +for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` + + +# Only perform the check for file, if the check method requires it +test -z "$MAGIC_CMD" && MAGIC_CMD=file +case $deplibs_check_method in +file_magic*) + if test "$file_magic_cmd" = '$MAGIC_CMD'; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 +$as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } +if test "${lt_cv_path_MAGIC_CMD+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case $MAGIC_CMD in +[\\/*] | ?:[\\/]*) + lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD="$MAGIC_CMD" + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" + for ac_dir in $ac_dummy; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/${ac_tool_prefix}file; then + lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` + MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <<_LT_EOF 1>&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +_LT_EOF + fi ;; + esac + fi + break + fi + done + IFS="$lt_save_ifs" + MAGIC_CMD="$lt_save_MAGIC_CMD" + ;; +esac +fi + +MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +if test -n "$MAGIC_CMD"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 +$as_echo "$MAGIC_CMD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + + + +if test -z "$lt_cv_path_MAGIC_CMD"; then + if test -n "$ac_tool_prefix"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5 +$as_echo_n "checking for file... " >&6; } +if test "${lt_cv_path_MAGIC_CMD+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case $MAGIC_CMD in +[\\/*] | ?:[\\/]*) + lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD="$MAGIC_CMD" + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" + for ac_dir in $ac_dummy; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/file; then + lt_cv_path_MAGIC_CMD="$ac_dir/file" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` + MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <<_LT_EOF 1>&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +_LT_EOF + fi ;; + esac + fi + break + fi + done + IFS="$lt_save_ifs" + MAGIC_CMD="$lt_save_MAGIC_CMD" + ;; +esac +fi + +MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +if test -n "$MAGIC_CMD"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 +$as_echo "$MAGIC_CMD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + else + MAGIC_CMD=: + fi +fi + + fi + ;; +esac + +# Use C for the default configuration in the libtool script + +lt_save_CC="$CC" +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +# Source file extension for C test sources. +ac_ext=c + +# Object file extension for compiled C test sources. +objext=o +objext=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="int some_variable = 0;" + +# Code to be used in simple link tests +lt_simple_link_test_code='int main(){return(0);}' + + + + + + + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + +# Save the default compiler, since it gets overwritten when the other +# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. +compiler_DEFAULT=$CC + +# save warnings/boilerplate of simple test code +ac_outfile=conftest.$ac_objext +echo "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$RM conftest* + +ac_outfile=conftest.$ac_objext +echo "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$RM -r conftest* + + +if test -n "$compiler"; then + +lt_prog_compiler_no_builtin_flag= + +if test "$GCC" = yes; then + lt_prog_compiler_no_builtin_flag=' -fno-builtin' + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 +$as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } +if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_rtti_exceptions=no + ac_outfile=conftest.$ac_objext + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="-fno-rtti -fno-exceptions" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:7743: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:7747: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_rtti_exceptions=yes + fi + fi + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 +$as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } + +if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then + lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" +else + : +fi + +fi + + + + + + + lt_prog_compiler_wl= +lt_prog_compiler_pic= +lt_prog_compiler_static= + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 +$as_echo_n "checking for $compiler option to produce PIC... " >&6; } + + if test "$GCC" = yes; then + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_static='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static='-Bstatic' + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + lt_prog_compiler_pic='-fPIC' + ;; + m68k) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' + ;; + esac + ;; + + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + + mingw* | cygwin* | pw32* | os2* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + lt_prog_compiler_pic='-DDLL_EXPORT' + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_prog_compiler_pic='-fno-common' + ;; + + hpux*) + # PIC is the default for 64-bit PA HP-UX, but not for 32-bit + # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag + # sets the default TLS model and affects inlining. + case $host_cpu in + hppa*64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic='-fPIC' + ;; + esac + ;; + + interix[3-9]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + + msdosdjgpp*) + # Just because we use GCC doesn't mean we suddenly get shared libraries + # on systems that don't support them. + lt_prog_compiler_can_build_shared=no + enable_shared=no + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + lt_prog_compiler_pic='-fPIC -shared' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + lt_prog_compiler_pic=-Kconform_pic + fi + ;; + + *) + lt_prog_compiler_pic='-fPIC' + ;; + esac + else + # PORTME Check for flag to pass linker flags through the system compiler. + case $host_os in + aix*) + lt_prog_compiler_wl='-Wl,' + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static='-Bstatic' + else + lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' + fi + ;; + + mingw* | cygwin* | pw32* | os2* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic='-DDLL_EXPORT' + ;; + + hpux9* | hpux10* | hpux11*) + lt_prog_compiler_wl='-Wl,' + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic='+Z' + ;; + esac + # Is there a better lt_prog_compiler_static that works with the bundled CC? + lt_prog_compiler_static='${wl}-a ${wl}archive' + ;; + + irix5* | irix6* | nonstopux*) + lt_prog_compiler_wl='-Wl,' + # PIC (with -KPIC) is the default. + lt_prog_compiler_static='-non_shared' + ;; + + linux* | k*bsd*-gnu) + case $cc_basename in + # old Intel for x86_64 which still supported -KPIC. + ecc*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-static' + ;; + # icc used to be incompatible with GCC. + # ICC 10 doesn't accept -KPIC any more. + icc* | ifort*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fPIC' + lt_prog_compiler_static='-static' + ;; + # Lahey Fortran 8.1. + lf95*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='--shared' + lt_prog_compiler_static='--static' + ;; + pgcc* | pgf77* | pgf90* | pgf95*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fpic' + lt_prog_compiler_static='-Bstatic' + ;; + ccc*) + lt_prog_compiler_wl='-Wl,' + # All Alpha code is PIC. + lt_prog_compiler_static='-non_shared' + ;; + xl*) + # IBM XL C 8.0/Fortran 10.1 on PPC + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-qpic' + lt_prog_compiler_static='-qstaticlink' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C 5.9 + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='-Wl,' + ;; + *Sun\ F*) + # Sun Fortran 8.3 passes all unrecognized flags to the linker + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='' + ;; + esac + ;; + esac + ;; + + newsos6) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + lt_prog_compiler_pic='-fPIC -shared' + ;; + + osf3* | osf4* | osf5*) + lt_prog_compiler_wl='-Wl,' + # All OSF/1 code is PIC. + lt_prog_compiler_static='-non_shared' + ;; + + rdos*) + lt_prog_compiler_static='-non_shared' + ;; + + solaris*) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + case $cc_basename in + f77* | f90* | f95*) + lt_prog_compiler_wl='-Qoption ld ';; + *) + lt_prog_compiler_wl='-Wl,';; + esac + ;; + + sunos4*) + lt_prog_compiler_wl='-Qoption ld ' + lt_prog_compiler_pic='-PIC' + lt_prog_compiler_static='-Bstatic' + ;; + + sysv4 | sysv4.2uw2* | sysv4.3*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + sysv4*MP*) + if test -d /usr/nec ;then + lt_prog_compiler_pic='-Kconform_pic' + lt_prog_compiler_static='-Bstatic' + fi + ;; + + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + unicos*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_can_build_shared=no + ;; + + uts4*) + lt_prog_compiler_pic='-pic' + lt_prog_compiler_static='-Bstatic' + ;; + + *) + lt_prog_compiler_can_build_shared=no + ;; + esac + fi + +case $host_os in + # For platforms which do not support PIC, -DPIC is meaningless: + *djgpp*) + lt_prog_compiler_pic= + ;; + *) + lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" + ;; +esac +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_prog_compiler_pic" >&5 +$as_echo "$lt_prog_compiler_pic" >&6; } + + + + + + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$lt_prog_compiler_pic"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 +$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } +if test "${lt_cv_prog_compiler_pic_works+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_pic_works=no + ac_outfile=conftest.$ac_objext + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$lt_prog_compiler_pic -DPIC" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:8082: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:8086: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_pic_works=yes + fi + fi + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 +$as_echo "$lt_cv_prog_compiler_pic_works" >&6; } + +if test x"$lt_cv_prog_compiler_pic_works" = xyes; then + case $lt_prog_compiler_pic in + "" | " "*) ;; + *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; + esac +else + lt_prog_compiler_pic= + lt_prog_compiler_can_build_shared=no +fi + +fi + + + + + + +# +# Check to make sure the static flag actually works. +# +wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 +$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } +if test "${lt_cv_prog_compiler_static_works+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_static_works=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $lt_tmp_static_flag" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $ECHO "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_static_works=yes + fi + else + lt_cv_prog_compiler_static_works=yes + fi + fi + $RM -r conftest* + LDFLAGS="$save_LDFLAGS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 +$as_echo "$lt_cv_prog_compiler_static_works" >&6; } + +if test x"$lt_cv_prog_compiler_static_works" = xyes; then + : +else + lt_prog_compiler_static= +fi + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if test "${lt_cv_prog_compiler_c_o+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_c_o=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:8187: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:8191: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o=yes + fi + fi + chmod u+w . 2>&5 + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 +$as_echo "$lt_cv_prog_compiler_c_o" >&6; } + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if test "${lt_cv_prog_compiler_c_o+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_c_o=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:8242: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:8246: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o=yes + fi + fi + chmod u+w . 2>&5 + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 +$as_echo "$lt_cv_prog_compiler_c_o" >&6; } + + + + +hard_links="nottested" +if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then + # do not overwrite the value of need_locks provided by the user + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 +$as_echo_n "checking if we can lock with hard links... " >&6; } + hard_links=yes + $RM conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 +$as_echo "$hard_links" >&6; } + if test "$hard_links" = no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 +$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} + need_locks=warn + fi +else + need_locks=no +fi + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } + + runpath_var= + allow_undefined_flag= + always_export_symbols=no + archive_cmds= + archive_expsym_cmds= + compiler_needs_object=no + enable_shared_with_static_runtimes=no + export_dynamic_flag_spec= + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + hardcode_automatic=no + hardcode_direct=no + hardcode_direct_absolute=no + hardcode_libdir_flag_spec= + hardcode_libdir_flag_spec_ld= + hardcode_libdir_separator= + hardcode_minus_L=no + hardcode_shlibpath_var=unsupported + inherit_rpath=no + link_all_deplibs=unknown + module_cmds= + module_expsym_cmds= + old_archive_from_new_cmds= + old_archive_from_expsyms_cmds= + thread_safe_flag_spec= + whole_archive_flag_spec= + # include_expsyms should be a list of space-separated symbols to be *always* + # included in the symbol list + include_expsyms= + # exclude_expsyms can be an extended regexp of symbols to exclude + # it will be wrapped by ` (' and `)$', so one must not match beginning or + # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', + # as well as any symbol that contains `d'. + exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' + # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out + # platforms (ab)use it in PIC code, but their linkers get confused if + # the symbol is explicitly referenced. Since portable code cannot + # rely on this symbol name, it's probably fine to never include it in + # preloaded symbol tables. + # Exclude shared library initialization/finalization symbols. + extract_expsyms_cmds= + + case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test "$GCC" != yes; then + with_gnu_ld=no + fi + ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes + ;; + openbsd*) + with_gnu_ld=no + ;; + esac + + ld_shlibs=yes + if test "$with_gnu_ld" = yes; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='${wl}' + + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + runpath_var=LD_RUN_PATH + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + export_dynamic_flag_spec='${wl}--export-dynamic' + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then + whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + whole_archive_flag_spec= + fi + supports_anon_versioning=no + case `$LD -v 2>&1` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac + + # See if GNU ld supports shared libraries. + case $host_os in + aix[3-9]*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + ld_shlibs=no + cat <<_LT_EOF 1>&2 + +*** Warning: the GNU linker, at least up to release 2.9.1, is reported +*** to be unable to reliably create shared libraries on AIX. +*** Therefore, libtool is disabling shared libraries support. If you +*** really care for shared libraries, you may want to modify your PATH +*** so that a non-GNU linker is found, and then restart. + +_LT_EOF + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='' + ;; + m68k) + archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + ;; + esac + ;; + + beos*) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + allow_undefined_flag=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + ld_shlibs=no + fi + ;; + + cygwin* | mingw* | pw32* | cegcc*) + # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, + # as there is no search path for DLLs. + hardcode_libdir_flag_spec='-L$libdir' + allow_undefined_flag=unsupported + always_export_symbols=no + enable_shared_with_static_runtimes=yes + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + ld_shlibs=no + fi + ;; + + interix[3-9]*) + hardcode_direct=no + hardcode_shlibpath_var=no + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + export_dynamic_flag_spec='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + + gnu* | linux* | tpf* | k*bsd*-gnu) + tmp_diet=no + if test "$host_os" = linux-dietlibc; then + case $cc_basename in + diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) + esac + fi + if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ + && test "$tmp_diet" = no + then + tmp_addflag= + tmp_sharedflag='-shared' + case $cc_basename,$host_cpu in + pgcc*) # Portland Group C compiler + whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers + whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag -Mnomain' ;; + ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 + tmp_addflag=' -i_dynamic' ;; + efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 + tmp_addflag=' -i_dynamic -nofor_main' ;; + ifc* | ifort*) # Intel Fortran compiler + tmp_addflag=' -nofor_main' ;; + lf95*) # Lahey Fortran 8.1 + whole_archive_flag_spec= + tmp_sharedflag='--shared' ;; + xl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) + tmp_sharedflag='-qmkshrobj' + tmp_addflag= ;; + esac + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) # Sun C 5.9 + whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + compiler_needs_object=yes + tmp_sharedflag='-G' ;; + *Sun\ F*) # Sun Fortran 8.3 + tmp_sharedflag='-G' ;; + esac + archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + + if test "x$supports_anon_versioning" = xyes; then + archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + + case $cc_basename in + xlf*) + # IBM XL Fortran 10.1 on PPC cannot create shared libs itself + whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' + hardcode_libdir_flag_spec= + hardcode_libdir_flag_spec_ld='-rpath $libdir' + archive_cmds='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib' + if test "x$supports_anon_versioning" = xyes; then + archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' + fi + ;; + esac + else + ld_shlibs=no + fi + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + + solaris*) + if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then + ld_shlibs=no + cat <<_LT_EOF 1>&2 + +*** Warning: The releases 2.8.* of the GNU linker cannot reliably +*** create shared libraries on Solaris systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.9.1 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) + ld_shlibs=no + cat <<_LT_EOF 1>&2 + +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not +*** reliably create shared libraries on SCO systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.16.91.0.3 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + ;; + *) + # For security reasons, it is highly recommended that you always + # use absolute paths for naming shared libraries, and exclude the + # DT_RUNPATH tag from executables and libraries. But doing so + # requires that you compile everything twice, which is a pain. + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + esac + ;; + + sunos4*) + archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' + wlarc= + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + *) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + esac + + if test "$ld_shlibs" = no; then + runpath_var= + hardcode_libdir_flag_spec= + export_dynamic_flag_spec= + whole_archive_flag_spec= + fi + else + # PORTME fill in a description of your system's linker (not GNU ld) + case $host_os in + aix3*) + allow_undefined_flag=unsupported + always_export_symbols=yes + archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + hardcode_minus_L=yes + if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + hardcode_direct=unsupported + fi + ;; + + aix[4-9]*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then + export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + else + export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + fi + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) + for ld_flag in $LDFLAGS; do + if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then + aix_use_runtimelinking=yes + break + fi + done + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + archive_cmds='' + hardcode_direct=yes + hardcode_direct_absolute=yes + hardcode_libdir_separator=':' + link_all_deplibs=yes + file_list_spec='${wl}-f,' + + if test "$GCC" = yes; then + case $host_os in aix4.[012]|aix4.[012].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && + strings "$collect2name" | $GREP resolve_lib_name >/dev/null + then + # We have reworked collect2 + : + else + # We have old collect2 + hardcode_direct=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + hardcode_minus_L=yes + hardcode_libdir_flag_spec='-L$libdir' + hardcode_libdir_separator= + fi + ;; + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + export_dynamic_flag_spec='${wl}-bexpall' + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + always_export_symbols=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + allow_undefined_flag='-berok' + # Determine the default libpath from the value encoded in an + # empty executable. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + +lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\(.*\)$/\1/ + p + } + }' +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then + aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' + allow_undefined_flag="-z nodefs" + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an + # empty executable. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + +lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\(.*\)$/\1/ + p + } + }' +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then + aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + no_undefined_flag=' ${wl}-bernotok' + allow_undefined_flag=' ${wl}-berok' + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec='$convenience' + archive_cmds_need_lc=yes + # This is similar to how AIX traditionally builds its shared libraries. + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='' + ;; + m68k) + archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + ;; + esac + ;; + + bsdi[45]*) + export_dynamic_flag_spec=-rdynamic + ;; + + cygwin* | mingw* | pw32* | cegcc*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + hardcode_libdir_flag_spec=' ' + allow_undefined_flag=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + archive_cmds='$CC -o $lib $libobjs $compiler_flags `$ECHO "X$deplibs" | $Xsed -e '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + old_archive_from_new_cmds='true' + # FIXME: Should let the user specify the lib program. + old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' + fix_srcfile_path='`cygpath -w "$srcfile"`' + enable_shared_with_static_runtimes=yes + ;; + + darwin* | rhapsody*) + + + archive_cmds_need_lc=no + hardcode_direct=no + hardcode_automatic=yes + hardcode_shlibpath_var=unsupported + whole_archive_flag_spec='' + link_all_deplibs=yes + allow_undefined_flag="$_lt_dar_allow_undefined" + case $cc_basename in + ifort*) _lt_dar_can_shared=yes ;; + *) _lt_dar_can_shared=$GCC ;; + esac + if test "$_lt_dar_can_shared" = "yes"; then + output_verbose_link_cmd=echo + archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" + module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" + archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" + module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" + + else + ld_shlibs=no + fi + + ;; + + dgux*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_shlibpath_var=no + ;; + + freebsd1*) + ld_shlibs=no + ;; + + # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor + # support. Future versions do this automatically, but an explicit c++rt0.o + # does not break anything, and helps significantly (at the cost of a little + # extra space). + freebsd2.2*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + # Unfortunately, older versions of FreeBSD 2 do not have this feature. + freebsd2*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes + hardcode_minus_L=yes + hardcode_shlibpath_var=no + ;; + + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd* | dragonfly*) + archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + hpux9*) + if test "$GCC" = yes; then + archive_cmds='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + fi + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + export_dynamic_flag_spec='${wl}-E' + ;; + + hpux10*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_flag_spec_ld='+b $libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + hardcode_direct_absolute=yes + export_dynamic_flag_spec='${wl}-E' + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + fi + ;; + + hpux11*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + case $host_cpu in + hppa*64*) + archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case $host_cpu in + hppa*64*) + archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + + case $host_cpu in + hppa*64*|ia64*) + hardcode_direct=no + hardcode_shlibpath_var=no + ;; + *) + hardcode_direct=yes + hardcode_direct_absolute=yes + export_dynamic_flag_spec='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + ;; + esac + fi + ;; + + irix5* | irix6* | nonstopux*) + if test "$GCC" = yes; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + # Try to use the -exported_symbol ld option, if it does not + # work, assume that -exports_file does not work either and + # implicitly export all symbols. + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int foo(void) {} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' + +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS="$save_LDFLAGS" + else + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' + fi + archive_cmds_need_lc='no' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + inherit_rpath=yes + link_all_deplibs=yes + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + newsos6) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_shlibpath_var=no + ;; + + *nto* | *qnx*) + ;; + + openbsd*) + if test -f /usr/libexec/ld.so; then + hardcode_direct=yes + hardcode_shlibpath_var=no + hardcode_direct_absolute=yes + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + export_dynamic_flag_spec='${wl}-E' + else + case $host_os in + openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-R$libdir' + ;; + *) + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + ;; + esac + fi + else + ld_shlibs=no + fi + ;; + + os2*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + allow_undefined_flag=unsupported + archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$ECHO DATA >> $output_objdir/$libname.def~$ECHO " SINGLE NONSHARED" >> $output_objdir/$libname.def~$ECHO EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' + old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' + ;; + + osf3*) + if test "$GCC" = yes; then + allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + allow_undefined_flag=' -expect_unresolved \*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + fi + archive_cmds_need_lc='no' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + ;; + + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test "$GCC" = yes; then + allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + else + allow_undefined_flag=' -expect_unresolved \*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ + $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' + + # Both c and cxx compiler support -rpath directly + hardcode_libdir_flag_spec='-rpath $libdir' + fi + archive_cmds_need_lc='no' + hardcode_libdir_separator=: + ;; + + solaris*) + no_undefined_flag=' -z defs' + if test "$GCC" = yes; then + wlarc='${wl}' + archive_cmds='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + else + case `$CC -V 2>&1` in + *"Compilers 5.0"*) + wlarc='' + archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' + ;; + *) + wlarc='${wl}' + archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + ;; + esac + fi + hardcode_libdir_flag_spec='-R$libdir' + hardcode_shlibpath_var=no + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) + # The compiler driver will combine and reorder linker options, + # but understands `-z linker_flag'. GCC discards it without `$wl', + # but is careful enough not to reorder. + # Supported since Solaris 2.6 (maybe 2.5.1?) + if test "$GCC" = yes; then + whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' + else + whole_archive_flag_spec='-z allextract$convenience -z defaultextract' + fi + ;; + esac + link_all_deplibs=yes + ;; + + sunos4*) + if test "x$host_vendor" = xsequent; then + # Use $CC to link under sequent, because it throws in some extra .o + # files that make .init and .fini sections work. + archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' + fi + hardcode_libdir_flag_spec='-L$libdir' + hardcode_direct=yes + hardcode_minus_L=yes + hardcode_shlibpath_var=no + ;; + + sysv4) + case $host_vendor in + sni) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes # is this really true??? + ;; + siemens) + ## LD is ld it makes a PLAMLIB + ## CC just makes a GrossModule. + archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' + reload_cmds='$CC -r -o $output$reload_objs' + hardcode_direct=no + ;; + motorola) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=no #Motorola manual says yes, but my tests say they lie + ;; + esac + runpath_var='LD_RUN_PATH' + hardcode_shlibpath_var=no + ;; + + sysv4.3*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var=no + export_dynamic_flag_spec='-Bexport' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + ld_shlibs=yes + fi + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) + no_undefined_flag='${wl}-z,text' + archive_cmds_need_lc=no + hardcode_shlibpath_var=no + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + no_undefined_flag='${wl}-z,text' + allow_undefined_flag='${wl}-z,nodefs' + archive_cmds_need_lc=no + hardcode_shlibpath_var=no + hardcode_libdir_flag_spec='${wl}-R,$libdir' + hardcode_libdir_separator=':' + link_all_deplibs=yes + export_dynamic_flag_spec='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + uts4*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_shlibpath_var=no + ;; + + *) + ld_shlibs=no + ;; + esac + + if test x$host_vendor = xsni; then + case $host in + sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + export_dynamic_flag_spec='${wl}-Blargedynsym' + ;; + esac + fi + fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 +$as_echo "$ld_shlibs" >&6; } +test "$ld_shlibs" = no && can_build_shared=no + +with_gnu_ld=$with_gnu_ld + + + + + + + + + + + + + + + +# +# Do we need to explicitly link libc? +# +case "x$archive_cmds_need_lc" in +x|xyes) + # Assume -lc should be added + archive_cmds_need_lc=yes + + if test "$enable_shared" = yes && test "$GCC" = yes; then + case $archive_cmds in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 +$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } + $RM conftest* + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl + pic_flag=$lt_prog_compiler_pic + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$allow_undefined_flag + allow_undefined_flag= + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 + (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + then + archive_cmds_need_lc=no + else + archive_cmds_need_lc=yes + fi + allow_undefined_flag=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $RM conftest* + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $archive_cmds_need_lc" >&5 +$as_echo "$archive_cmds_need_lc" >&6; } + ;; + esac + fi + ;; +esac + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 +$as_echo_n "checking dynamic linker characteristics... " >&6; } + +if test "$GCC" = yes; then + case $host_os in + darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; + *) lt_awk_arg="/^libraries:/" ;; + esac + lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if $ECHO "$lt_search_path_spec" | $GREP ';' >/dev/null ; then + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e 's/;/ /g'` + else + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + # Ok, now we have the path, separated by spaces, we can step through it + # and add multilib dir if necessary. + lt_tmp_lt_search_path_spec= + lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` + for lt_sys_path in $lt_search_path_spec; do + if test -d "$lt_sys_path/$lt_multi_os_dir"; then + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" + else + test -d "$lt_sys_path" && \ + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" + fi + done + lt_search_path_spec=`$ECHO $lt_tmp_lt_search_path_spec | awk ' +BEGIN {RS=" "; FS="/|\n";} { + lt_foo=""; + lt_count=0; + for (lt_i = NF; lt_i > 0; lt_i--) { + if ($lt_i != "" && $lt_i != ".") { + if ($lt_i == "..") { + lt_count++; + } else { + if (lt_count == 0) { + lt_foo="/" $lt_i lt_foo; + } else { + lt_count--; + } + } + } + } + if (lt_foo != "") { lt_freq[lt_foo]++; } + if (lt_freq[lt_foo] == 1) { print lt_foo; } +}'` + sys_lib_search_path_spec=`$ECHO $lt_search_path_spec` +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext_cmds=".so" +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + +case $host_os in +aix3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='${libname}${release}${shared_ext}$major' + ;; + +aix[4-9]*) + version_type=linux + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[01] | aix4.[01].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + case $host_cpu in + powerpc) + # Since July 2007 AmigaOS4 officially supports .so libraries. + # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + ;; + m68k) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$ECHO "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + ;; + esac + ;; + +beos*) + library_names_spec='${libname}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi[45]*) + version_type=linux + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32* | cegcc*) + version_type=windows + shrext_cmds=".dll" + need_version=no + need_lib_prefix=no + + case $GCC,$host_os in + yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*) + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; + fi' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" + ;; + mingw* | cegcc*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then + # It is most probably a Windows format PATH printed by + # mingw gcc, but we are running on Cygwin. Gcc prints its search + # path with ; separators, and with drive letters. We can handle the + # drive letters (cygwin fileutils understands them), so leave them, + # especially as we might pass files found there to a mingw objdump, + # which wouldn't understand a cygwinified path. Ahh. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + ;; + esac + ;; + + *) + library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' + ;; + esac + dynamic_linker='Win32 ld.exe' + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' + soname_spec='${libname}${release}${major}$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' + + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd1*) + dynamic_linker=no + ;; + +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[123]*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[01]* | freebsdelf3.[01]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ + freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + *) # from 4.6 on, and DragonFly + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +gnu*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555. + postinstall_cmds='chmod 555 $lib' + ;; + +interix[3-9]*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +# This must be Linux ELF. +linux* | k*bsd*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + # Some binutils ld are patched to set DT_RUNPATH + save_LDFLAGS=$LDFLAGS + save_libdir=$libdir + eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ + LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : + shlibpath_overrides_runpath=yes +fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS=$save_LDFLAGS + libdir=$save_libdir + + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +*nto* | *qnx*) + version_type=qnx + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='ldqnx.so' + ;; + +openbsd*) + version_type=sunos + sys_lib_dlsearch_path_spec="/usr/lib" + need_lib_prefix=no + # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. + case $host_os in + openbsd3.3 | openbsd3.3.*) need_version=yes ;; + *) need_version=no ;; + esac + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case $host_os in + openbsd2.[89] | openbsd2.[89].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac + else + shlibpath_overrides_runpath=yes + fi + ;; + +os2*) + libname_spec='$name' + shrext_cmds=".dll" + need_lib_prefix=no + library_names_spec='$libname${shared_ext} $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; + +rdos*) + dynamic_linker=no + ;; + +solaris*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux + library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' + soname_spec='$libname${shared_ext}.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=freebsd-elf + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + if test "$with_gnu_ld" = yes; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +tpf*) + # TPF is a cross-target only. Preferred cross-host = GNU/Linux. + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +uts4*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 +$as_echo "$dynamic_linker" >&6; } +test "$dynamic_linker" = no && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test "$GCC" = yes; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + +if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then + sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" +fi +if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then + sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 +$as_echo_n "checking how to hardcode library paths into programs... " >&6; } +hardcode_action= +if test -n "$hardcode_libdir_flag_spec" || + test -n "$runpath_var" || + test "X$hardcode_automatic" = "Xyes" ; then + + # We can hardcode non-existent directories. + if test "$hardcode_direct" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no && + test "$hardcode_minus_L" != no; then + # Linking always hardcodes the temporary library directory. + hardcode_action=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + hardcode_action=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + hardcode_action=unsupported +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 +$as_echo "$hardcode_action" >&6; } + +if test "$hardcode_action" = relink || + test "$inherit_rpath" = yes; then + # Fast installation is not supported + enable_fast_install=no +elif test "$shlibpath_overrides_runpath" = yes || + test "$enable_shared" = no; then + # Fast installation is not necessary + enable_fast_install=needless +fi + + + + + + + if test "x$enable_dlopen" != xyes; then + enable_dlopen=unknown + enable_dlopen_self=unknown + enable_dlopen_self_static=unknown +else + lt_cv_dlopen=no + lt_cv_dlopen_libs= + + case $host_os in + beos*) + lt_cv_dlopen="load_add_on" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ;; + + mingw* | pw32* | cegcc*) + lt_cv_dlopen="LoadLibrary" + lt_cv_dlopen_libs= + ;; + + cygwin*) + lt_cv_dlopen="dlopen" + lt_cv_dlopen_libs= + ;; + + darwin*) + # if libdl is installed we need to link against it + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +$as_echo_n "checking for dlopen in -ldl... " >&6; } +if test "${ac_cv_lib_dl_dlopen+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dl_dlopen=yes +else + ac_cv_lib_dl_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 +$as_echo "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = x""yes; then : + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" +else + + lt_cv_dlopen="dyld" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + +fi + + ;; + + *) + ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" +if test "x$ac_cv_func_shl_load" = x""yes; then : + lt_cv_dlopen="shl_load" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 +$as_echo_n "checking for shl_load in -ldld... " >&6; } +if test "${ac_cv_lib_dld_shl_load+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char shl_load (); +int +main () +{ +return shl_load (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dld_shl_load=yes +else + ac_cv_lib_dld_shl_load=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 +$as_echo "$ac_cv_lib_dld_shl_load" >&6; } +if test "x$ac_cv_lib_dld_shl_load" = x""yes; then : + lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld" +else + ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" +if test "x$ac_cv_func_dlopen" = x""yes; then : + lt_cv_dlopen="dlopen" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +$as_echo_n "checking for dlopen in -ldl... " >&6; } +if test "${ac_cv_lib_dl_dlopen+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dl_dlopen=yes +else + ac_cv_lib_dl_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 +$as_echo "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = x""yes; then : + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 +$as_echo_n "checking for dlopen in -lsvld... " >&6; } +if test "${ac_cv_lib_svld_dlopen+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lsvld $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_svld_dlopen=yes +else + ac_cv_lib_svld_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 +$as_echo "$ac_cv_lib_svld_dlopen" >&6; } +if test "x$ac_cv_lib_svld_dlopen" = x""yes; then : + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 +$as_echo_n "checking for dld_link in -ldld... " >&6; } +if test "${ac_cv_lib_dld_dld_link+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dld_link (); +int +main () +{ +return dld_link (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dld_dld_link=yes +else + ac_cv_lib_dld_dld_link=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 +$as_echo "$ac_cv_lib_dld_dld_link" >&6; } +if test "x$ac_cv_lib_dld_dld_link" = x""yes; then : + lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld" +fi + + +fi + + +fi + + +fi + + +fi + + +fi + + ;; + esac + + if test "x$lt_cv_dlopen" != xno; then + enable_dlopen=yes + else + enable_dlopen=no + fi + + case $lt_cv_dlopen in + dlopen) + save_CPPFLAGS="$CPPFLAGS" + test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" + + save_LDFLAGS="$LDFLAGS" + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" + + save_LIBS="$LIBS" + LIBS="$lt_cv_dlopen_libs $LIBS" + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 +$as_echo_n "checking whether a program can dlopen itself... " >&6; } +if test "${lt_cv_dlopen_self+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + lt_cv_dlopen_self=cross +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +#line 10609 "configure" +#include "confdefs.h" + +#if HAVE_DLFCN_H +#include +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +void fnord() { int i=42;} +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + /* dlclose (self); */ + } + else + puts (dlerror ()); + + return status; +} +_LT_EOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) >&5 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; + x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; + x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self=no + fi +fi +rm -fr conftest* + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 +$as_echo "$lt_cv_dlopen_self" >&6; } + + if test "x$lt_cv_dlopen_self" = xyes; then + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 +$as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } +if test "${lt_cv_dlopen_self_static+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + lt_cv_dlopen_self_static=cross +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +#line 10705 "configure" +#include "confdefs.h" + +#if HAVE_DLFCN_H +#include +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +void fnord() { int i=42;} +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + /* dlclose (self); */ + } + else + puts (dlerror ()); + + return status; +} +_LT_EOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) >&5 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; + x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; + x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self_static=no + fi +fi +rm -fr conftest* + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 +$as_echo "$lt_cv_dlopen_self_static" >&6; } + fi + + CPPFLAGS="$save_CPPFLAGS" + LDFLAGS="$save_LDFLAGS" + LIBS="$save_LIBS" + ;; + esac + + case $lt_cv_dlopen_self in + yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; + *) enable_dlopen_self=unknown ;; + esac + + case $lt_cv_dlopen_self_static in + yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; + *) enable_dlopen_self_static=unknown ;; + esac +fi + + + + + + + + + + + + + + + + + +striplib= +old_striplib= +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 +$as_echo_n "checking whether stripping libraries is possible... " >&6; } +if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then + test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" + test -z "$striplib" && striplib="$STRIP --strip-unneeded" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else +# FIXME - insert some real tests, host_os isn't really good enough + case $host_os in + darwin*) + if test -n "$STRIP" ; then + striplib="$STRIP -x" + old_striplib="$STRIP -S" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + fi + ;; + *) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + ;; + esac +fi + + + + + + + + + + + + + # Report which library types will actually be built + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 +$as_echo_n "checking if libtool supports shared libraries... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 +$as_echo "$can_build_shared" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 +$as_echo_n "checking whether to build shared libraries... " >&6; } + test "$can_build_shared" = "no" && enable_shared=no + + # On AIX, shared libraries and static libraries use the same namespace, and + # are all built from PIC. + case $host_os in + aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + + aix[4-9]*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; + esac + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 +$as_echo "$enable_shared" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 +$as_echo_n "checking whether to build static libraries... " >&6; } + # Make sure either enable_shared or enable_static is yes. + test "$enable_shared" = yes || enable_static=yes + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 +$as_echo "$enable_static" >&6; } + + + + +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +CC="$lt_save_CC" + + + + + + + + + + + + + + ac_config_commands="$ac_config_commands libtool" + + + + +# Only expand once: + + + +# Checks for header files. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } +if test "${ac_cv_header_stdc+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_header_stdc=yes +else + ac_cv_header_stdc=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + return 2; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + +else + ac_cv_header_stdc=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 +$as_echo "$ac_cv_header_stdc" >&6; } +if test $ac_cv_header_stdc = yes; then + +$as_echo "#define STDC_HEADERS 1" >>confdefs.h + +fi + +for ac_header in malloc.h stdlib.h string.h strings.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +eval as_val=\$$as_ac_Header + if test "x$as_val" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +# Checks for typedefs, structures, and compiler characteristics. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 +$as_echo_n "checking for an ANSI C-conforming const... " >&6; } +if test "${ac_cv_c_const+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +/* FIXME: Include the comments suggested by Paul. */ +#ifndef __cplusplus + /* Ultrix mips cc rejects this. */ + typedef int charset[2]; + const charset cs; + /* SunOS 4.1.1 cc rejects this. */ + char const *const *pcpcc; + char **ppc; + /* NEC SVR4.0.2 mips cc rejects this. */ + struct point {int x, y;}; + static struct point const zero = {0,0}; + /* AIX XL C 1.02.0.0 rejects this. + It does not let you subtract one const X* pointer from another in + an arm of an if-expression whose if-part is not a constant + expression */ + const char *g = "string"; + pcpcc = &g + (g ? g-g : 0); + /* HPUX 7.0 cc rejects these. */ + ++pcpcc; + ppc = (char**) pcpcc; + pcpcc = (char const *const *) ppc; + { /* SCO 3.2v4 cc rejects this. */ + char *t; + char const *s = 0 ? (char *) 0 : (char const *) 0; + + *t++ = 0; + if (s) return 0; + } + { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ + int x[] = {25, 17}; + const int *foo = &x[0]; + ++foo; + } + { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ + typedef const int *iptr; + iptr p = 0; + ++p; + } + { /* AIX XL C 1.02.0.0 rejects this saying + "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ + struct s { int j; const int *ap[3]; }; + struct s *b; b->j = 5; + } + { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ + const int foo = 10; + if (!foo) return 0; + } + return !cs[0] && !zero.x; +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_const=yes +else + ac_cv_c_const=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 +$as_echo "$ac_cv_c_const" >&6; } +if test $ac_cv_c_const = no; then + +$as_echo "#define const /**/" >>confdefs.h + +fi + +ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" +if test "x$ac_cv_type_size_t" = x""yes; then : + +else + +cat >>confdefs.h <<_ACEOF +#define size_t unsigned int +_ACEOF + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct tm is in sys/time.h or time.h" >&5 +$as_echo_n "checking whether struct tm is in sys/time.h or time.h... " >&6; } +if test "${ac_cv_struct_tm+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include + +int +main () +{ +struct tm tm; + int *p = &tm.tm_sec; + return !p; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_struct_tm=time.h +else + ac_cv_struct_tm=sys/time.h +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_struct_tm" >&5 +$as_echo "$ac_cv_struct_tm" >&6; } +if test $ac_cv_struct_tm = sys/time.h; then + +$as_echo "#define TM_IN_SYS_TIME 1" >>confdefs.h + +fi + + +# Checks for library functions. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working strtod" >&5 +$as_echo_n "checking for working strtod... " >&6; } +if test "${ac_cv_func_strtod+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + ac_cv_func_strtod=no +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +$ac_includes_default +#ifndef strtod +double strtod (); +#endif +int +main() +{ + { + /* Some versions of Linux strtod mis-parse strings with leading '+'. */ + char *string = " +69"; + char *term; + double value; + value = strtod (string, &term); + if (value != 69 || term != (string + 4)) + return 1; + } + + { + /* Under Solaris 2.4, strtod returns the wrong value for the + terminating character under some conditions. */ + char *string = "NaN"; + char *term; + strtod (string, &term); + if (term != string && *(term - 1) == 0) + return 1; + } + return 0; +} + +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_func_strtod=yes +else + ac_cv_func_strtod=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_strtod" >&5 +$as_echo "$ac_cv_func_strtod" >&6; } +if test $ac_cv_func_strtod = no; then + case " $LIBOBJS " in + *" strtod.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS strtod.$ac_objext" + ;; +esac + +ac_fn_c_check_func "$LINENO" "pow" "ac_cv_func_pow" +if test "x$ac_cv_func_pow" = x""yes; then : + +fi + +if test $ac_cv_func_pow = no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pow in -lm" >&5 +$as_echo_n "checking for pow in -lm... " >&6; } +if test "${ac_cv_lib_m_pow+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lm $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char pow (); +int +main () +{ +return pow (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_m_pow=yes +else + ac_cv_lib_m_pow=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_pow" >&5 +$as_echo "$ac_cv_lib_m_pow" >&6; } +if test "x$ac_cv_lib_m_pow" = x""yes; then : + POW_LIB=-lm +else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cannot find library containing definition of pow" >&5 +$as_echo "$as_me: WARNING: cannot find library containing definition of pow" >&2;} +fi + +fi + +fi + +for ac_func in memset +do : + ac_fn_c_check_func "$LINENO" "memset" "ac_cv_func_memset" +if test "x$ac_cv_func_memset" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_MEMSET 1 +_ACEOF + +else + as_fn_error "memset not found in libc" "$LINENO" 5 +fi +done + +for ac_func in pow +do : + ac_fn_c_check_func "$LINENO" "pow" "ac_cv_func_pow" +if test "x$ac_cv_func_pow" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_POW 1 +_ACEOF + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pow in -lm" >&5 +$as_echo_n "checking for pow in -lm... " >&6; } +if test "${ac_cv_lib_m_pow+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lm $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char pow (); +int +main () +{ +return pow (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_m_pow=yes +else + ac_cv_lib_m_pow=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_pow" >&5 +$as_echo "$ac_cv_lib_m_pow" >&6; } +if test "x$ac_cv_lib_m_pow" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBM 1 +_ACEOF + + LIBS="-lm $LIBS" + +else + as_fn_error "cannot find pow" "$LINENO" 5 +fi + +fi +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for zlibVersion in -lz" >&5 +$as_echo_n "checking for zlibVersion in -lz... " >&6; } +if test "${ac_cv_lib_z_zlibVersion+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lz $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char zlibVersion (); +int +main () +{ +return zlibVersion (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_z_zlibVersion=yes +else + ac_cv_lib_z_zlibVersion=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_zlibVersion" >&5 +$as_echo "$ac_cv_lib_z_zlibVersion" >&6; } +if test "x$ac_cv_lib_z_zlibVersion" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBZ 1 +_ACEOF + + LIBS="-lz $LIBS" + +else + as_fn_error "zlib not installed" "$LINENO" 5 +fi + + +case $host_os in + aix*) + LIBPNG_DEFINES=-DPNG_CONFIGURE_LIBPNG -D_ALL_SOURCE;; + *) + LIBPNG_DEFINES=-DPNG_CONFIGURE_LIBPNG;; +esac +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if assembler code in pnggccrd.c can be compiled without PNG_NO_MMX_CODE" >&5 +$as_echo_n "checking if assembler code in pnggccrd.c can be compiled without PNG_NO_MMX_CODE... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include "$srcdir/pnggccrd.c" +int +main () +{ +return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + LIBPNG_NO_MMX="" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + LIBPNG_NO_MMX=-DPNG_NO_MMX_CODE +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +LIBPNG_DEFINES=$LIBPNG_DEFINES\ $LIBPNG_NO_MMX + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if libraries can be versioned" >&5 +$as_echo_n "checking if libraries can be versioned... " >&6; } +GLD=`$LD --help < /dev/null 2>/dev/null | grep version-script` +if test "$GLD"; then + have_ld_version_script=yes + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + have_ld_version_script=no + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** You have not enabled versioned symbols." >&5 +$as_echo "$as_me: WARNING: *** You have not enabled versioned symbols." >&2;} +fi + if test "$have_ld_version_script" = "yes"; then + HAVE_LD_VERSION_SCRIPT_TRUE= + HAVE_LD_VERSION_SCRIPT_FALSE='#' +else + HAVE_LD_VERSION_SCRIPT_TRUE='#' + HAVE_LD_VERSION_SCRIPT_FALSE= +fi + + +if test "$have_ld_version_script" = "yes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for symbol prefix" >&5 +$as_echo_n "checking for symbol prefix... " >&6; } + SYMBOL_PREFIX=`echo "PREFIX=__USER_LABEL_PREFIX__" \ + | ${CPP-${CC-gcc} -E} - 2>&1 \ + | ${EGREP-grep} "^PREFIX=" \ + | ${SED-sed} "s:^PREFIX=::"` + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SYMBOL_PREFIX" >&5 +$as_echo "$SYMBOL_PREFIX" >&6; } +fi + +# Substitutions for .in files + + + + + +# Additional arguments (and substitutions) +# Allow the pkg-config directory to be set + +# Check whether --with-pkgconfigdir was given. +if test "${with_pkgconfigdir+set}" = set; then : + withval=$with_pkgconfigdir; pkgconfigdir=${withval} +else + pkgconfigdir='${libdir}/pkgconfig' +fi + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: pkgconfig directory is ${pkgconfigdir}" >&5 +$as_echo "$as_me: pkgconfig directory is ${pkgconfigdir}" >&6;} + +# Make the *-config binary config scripts optional + +# Check whether --with-binconfigs was given. +if test "${with_binconfigs+set}" = set; then : + withval=$with_binconfigs; if test "${withval}" = no; then + binconfigs= + { $as_echo "$as_me:${as_lineno-$LINENO}: libpng-config scripts will not be built" >&5 +$as_echo "$as_me: libpng-config scripts will not be built" >&6;} + else + binconfigs='${binconfigs}' + fi +else + binconfigs='${binconfigs}' +fi + + + +# Allow the old version number library, libpng.so, to be removed from +# the build + +# Check whether --with-libpng-compat was given. +if test "${with_libpng_compat+set}" = set; then : + withval=$with_libpng_compat; if test "${withval}" = no; then + compatlib= + { $as_echo "$as_me:${as_lineno-$LINENO}: libpng.so will not be built" >&5 +$as_echo "$as_me: libpng.so will not be built" >&6;} + else + compatlib=libpng.la + fi +else + compatlib=libpng.la +fi + + + +# Config files, substituting as above +ac_config_files="$ac_config_files Makefile libpng.pc:scripts/libpng.pc-configure.in" + +ac_config_files="$ac_config_files libpng-config:scripts/libpng-config.in" + + +cat >confcache <<\_ACEOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. +# +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. +# +# `ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* `ac_cv_foo' will be assigned the +# following values. + +_ACEOF + +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, we kill variables containing newlines. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +( + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + + (set) 2>&1 | + case $as_nl`(ac_space=' '; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + # `set' does not quote correctly, so add quotes: double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \. + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; #( + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) | + sed ' + /^ac_cv_env_/b end + t clear + :clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + :end' >>confcache +if diff "$cache_file" confcache >/dev/null 2>&1; then :; else + if test -w "$cache_file"; then + test "x$cache_file" != "x/dev/null" && + { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 +$as_echo "$as_me: updating cache $cache_file" >&6;} + cat confcache >$cache_file + else + { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 +$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} + fi +fi +rm -f confcache + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +DEFS=-DHAVE_CONFIG_H + +ac_libobjs= +ac_ltlibobjs= +for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' + ac_i=`$as_echo "$ac_i" | sed "$ac_script"` + # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR + # will be set to the directory where LIBOBJS objects are built. + as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" + as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' +done +LIBOBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + + if test -n "$EXEEXT"; then + am__EXEEXT_TRUE= + am__EXEEXT_FALSE='#' +else + am__EXEEXT_TRUE='#' + am__EXEEXT_FALSE= +fi + +if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then + as_fn_error "conditional \"MAINTAINER_MODE\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then + as_fn_error "conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then + as_fn_error "conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_LD_VERSION_SCRIPT_TRUE}" && test -z "${HAVE_LD_VERSION_SCRIPT_FALSE}"; then + as_fn_error "conditional \"HAVE_LD_VERSION_SCRIPT\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi + +: ${CONFIG_STATUS=./config.status} +ac_write_fail=0 +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 +$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} +as_write_fail=0 +cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 +#! $SHELL +# Generated by $as_me. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +ac_cs_recheck=false +ac_cs_silent=false + +SHELL=\${CONFIG_SHELL-$SHELL} +export SHELL +_ASEOF +cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + + +# as_fn_error ERROR [LINENO LOG_FD] +# --------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with status $?, using 1 if that was 0. +as_fn_error () +{ + as_status=$?; test $as_status -eq 0 && as_status=1 + if test "$3"; then + as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3 + fi + $as_echo "$as_me: error: $1" >&2 + as_fn_exit $as_status +} # as_fn_error + + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -p' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -p' + fi +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error "cannot create directory $as_dir" + + +} # as_fn_mkdir_p +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +if test -x / >/dev/null 2>&1; then + as_test_x='test -x' +else + if ls -dL / >/dev/null 2>&1; then + as_ls_L_option=L + else + as_ls_L_option= + fi + as_test_x=' + eval sh -c '\'' + if test -d "$1"; then + test -d "$1/."; + else + case $1 in #( + -*)set "./$1";; + esac; + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( + ???[sx]*):;;*)false;;esac;fi + '\'' sh + ' +fi +as_executable_p=$as_test_x + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +exec 6>&1 +## ----------------------------------- ## +## Main body of $CONFIG_STATUS script. ## +## ----------------------------------- ## +_ASEOF +test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# Save the log message, to keep $0 and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. +ac_log=" +This file was extended by libpng $as_me 1.2.49, which was +generated by GNU Autoconf 2.65. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + +_ACEOF + +case $ac_config_files in *" +"*) set x $ac_config_files; shift; ac_config_files=$*;; +esac + +case $ac_config_headers in *" +"*) set x $ac_config_headers; shift; ac_config_headers=$*;; +esac + + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# Files that config.status was made for. +config_files="$ac_config_files" +config_headers="$ac_config_headers" +config_commands="$ac_config_commands" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +ac_cs_usage="\ +\`$as_me' instantiates files and other configuration actions +from templates according to the current configuration. Unless the files +and actions are specified as TAGs, all are instantiated by default. + +Usage: $0 [OPTION]... [TAG]... + + -h, --help print this help, then exit + -V, --version print version number and configuration settings, then exit + --config print configuration, then exit + -q, --quiet, --silent + do not print progress messages + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE + +Configuration files: +$config_files + +Configuration headers: +$config_headers + +Configuration commands: +$config_commands + +Report bugs to ." + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" +ac_cs_version="\\ +libpng config.status 1.2.49 +configured by $0, generated by GNU Autoconf 2.65, + with options \\"\$ac_cs_config\\" + +Copyright (C) 2009 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." + +ac_pwd='$ac_pwd' +srcdir='$srcdir' +INSTALL='$INSTALL' +MKDIR_P='$MKDIR_P' +AWK='$AWK' +test -n "\$AWK" || AWK=awk +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# The default lists apply if the user does not specify any file. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=*) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` + ac_shift=: + ;; + *) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + esac + + case $ac_option in + # Handling of the options. + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + $as_echo "$ac_cs_version"; exit ;; + --config | --confi | --conf | --con | --co | --c ) + $as_echo "$ac_cs_config"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + as_fn_append CONFIG_FILES " '$ac_optarg'" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + as_fn_append CONFIG_HEADERS " '$ac_optarg'" + ac_need_defaults=false;; + --he | --h) + # Conflict between --help and --header + as_fn_error "ambiguous option: \`$1' +Try \`$0 --help' for more information.";; + --help | --hel | -h ) + $as_echo "$ac_cs_usage"; exit ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) as_fn_error "unrecognized option: \`$1' +Try \`$0 --help' for more information." ;; + + *) as_fn_append ac_config_targets " $1" + ac_need_defaults=false ;; + + esac + shift +done + +ac_configure_extra_args= + +if $ac_cs_silent; then + exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +if \$ac_cs_recheck; then + set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + shift + \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 + CONFIG_SHELL='$SHELL' + export CONFIG_SHELL + exec "\$@" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX + $as_echo "$ac_log" +} >&5 + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# +# INIT-COMMANDS +# +AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" + + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +sed_quote_subst='$sed_quote_subst' +double_quote_subst='$double_quote_subst' +delay_variable_subst='$delay_variable_subst' +SED='`$ECHO "X$SED" | $Xsed -e "$delay_single_quote_subst"`' +Xsed='`$ECHO "X$Xsed" | $Xsed -e "$delay_single_quote_subst"`' +GREP='`$ECHO "X$GREP" | $Xsed -e "$delay_single_quote_subst"`' +EGREP='`$ECHO "X$EGREP" | $Xsed -e "$delay_single_quote_subst"`' +FGREP='`$ECHO "X$FGREP" | $Xsed -e "$delay_single_quote_subst"`' +LD='`$ECHO "X$LD" | $Xsed -e "$delay_single_quote_subst"`' +AS='`$ECHO "X$AS" | $Xsed -e "$delay_single_quote_subst"`' +DLLTOOL='`$ECHO "X$DLLTOOL" | $Xsed -e "$delay_single_quote_subst"`' +OBJDUMP='`$ECHO "X$OBJDUMP" | $Xsed -e "$delay_single_quote_subst"`' +macro_version='`$ECHO "X$macro_version" | $Xsed -e "$delay_single_quote_subst"`' +macro_revision='`$ECHO "X$macro_revision" | $Xsed -e "$delay_single_quote_subst"`' +enable_shared='`$ECHO "X$enable_shared" | $Xsed -e "$delay_single_quote_subst"`' +enable_static='`$ECHO "X$enable_static" | $Xsed -e "$delay_single_quote_subst"`' +pic_mode='`$ECHO "X$pic_mode" | $Xsed -e "$delay_single_quote_subst"`' +enable_fast_install='`$ECHO "X$enable_fast_install" | $Xsed -e "$delay_single_quote_subst"`' +host_alias='`$ECHO "X$host_alias" | $Xsed -e "$delay_single_quote_subst"`' +host='`$ECHO "X$host" | $Xsed -e "$delay_single_quote_subst"`' +host_os='`$ECHO "X$host_os" | $Xsed -e "$delay_single_quote_subst"`' +build_alias='`$ECHO "X$build_alias" | $Xsed -e "$delay_single_quote_subst"`' +build='`$ECHO "X$build" | $Xsed -e "$delay_single_quote_subst"`' +build_os='`$ECHO "X$build_os" | $Xsed -e "$delay_single_quote_subst"`' +NM='`$ECHO "X$NM" | $Xsed -e "$delay_single_quote_subst"`' +LN_S='`$ECHO "X$LN_S" | $Xsed -e "$delay_single_quote_subst"`' +max_cmd_len='`$ECHO "X$max_cmd_len" | $Xsed -e "$delay_single_quote_subst"`' +ac_objext='`$ECHO "X$ac_objext" | $Xsed -e "$delay_single_quote_subst"`' +exeext='`$ECHO "X$exeext" | $Xsed -e "$delay_single_quote_subst"`' +lt_unset='`$ECHO "X$lt_unset" | $Xsed -e "$delay_single_quote_subst"`' +lt_SP2NL='`$ECHO "X$lt_SP2NL" | $Xsed -e "$delay_single_quote_subst"`' +lt_NL2SP='`$ECHO "X$lt_NL2SP" | $Xsed -e "$delay_single_quote_subst"`' +reload_flag='`$ECHO "X$reload_flag" | $Xsed -e "$delay_single_quote_subst"`' +reload_cmds='`$ECHO "X$reload_cmds" | $Xsed -e "$delay_single_quote_subst"`' +deplibs_check_method='`$ECHO "X$deplibs_check_method" | $Xsed -e "$delay_single_quote_subst"`' +file_magic_cmd='`$ECHO "X$file_magic_cmd" | $Xsed -e "$delay_single_quote_subst"`' +AR='`$ECHO "X$AR" | $Xsed -e "$delay_single_quote_subst"`' +AR_FLAGS='`$ECHO "X$AR_FLAGS" | $Xsed -e "$delay_single_quote_subst"`' +STRIP='`$ECHO "X$STRIP" | $Xsed -e "$delay_single_quote_subst"`' +RANLIB='`$ECHO "X$RANLIB" | $Xsed -e "$delay_single_quote_subst"`' +old_postinstall_cmds='`$ECHO "X$old_postinstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' +old_postuninstall_cmds='`$ECHO "X$old_postuninstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' +old_archive_cmds='`$ECHO "X$old_archive_cmds" | $Xsed -e "$delay_single_quote_subst"`' +CC='`$ECHO "X$CC" | $Xsed -e "$delay_single_quote_subst"`' +CFLAGS='`$ECHO "X$CFLAGS" | $Xsed -e "$delay_single_quote_subst"`' +compiler='`$ECHO "X$compiler" | $Xsed -e "$delay_single_quote_subst"`' +GCC='`$ECHO "X$GCC" | $Xsed -e "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_pipe='`$ECHO "X$lt_cv_sys_global_symbol_pipe" | $Xsed -e "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_cdecl='`$ECHO "X$lt_cv_sys_global_symbol_to_cdecl" | $Xsed -e "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "X$lt_cv_sys_global_symbol_to_c_name_address" | $Xsed -e "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "X$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $Xsed -e "$delay_single_quote_subst"`' +objdir='`$ECHO "X$objdir" | $Xsed -e "$delay_single_quote_subst"`' +SHELL='`$ECHO "X$SHELL" | $Xsed -e "$delay_single_quote_subst"`' +ECHO='`$ECHO "X$ECHO" | $Xsed -e "$delay_single_quote_subst"`' +MAGIC_CMD='`$ECHO "X$MAGIC_CMD" | $Xsed -e "$delay_single_quote_subst"`' +lt_prog_compiler_no_builtin_flag='`$ECHO "X$lt_prog_compiler_no_builtin_flag" | $Xsed -e "$delay_single_quote_subst"`' +lt_prog_compiler_wl='`$ECHO "X$lt_prog_compiler_wl" | $Xsed -e "$delay_single_quote_subst"`' +lt_prog_compiler_pic='`$ECHO "X$lt_prog_compiler_pic" | $Xsed -e "$delay_single_quote_subst"`' +lt_prog_compiler_static='`$ECHO "X$lt_prog_compiler_static" | $Xsed -e "$delay_single_quote_subst"`' +lt_cv_prog_compiler_c_o='`$ECHO "X$lt_cv_prog_compiler_c_o" | $Xsed -e "$delay_single_quote_subst"`' +need_locks='`$ECHO "X$need_locks" | $Xsed -e "$delay_single_quote_subst"`' +DSYMUTIL='`$ECHO "X$DSYMUTIL" | $Xsed -e "$delay_single_quote_subst"`' +NMEDIT='`$ECHO "X$NMEDIT" | $Xsed -e "$delay_single_quote_subst"`' +LIPO='`$ECHO "X$LIPO" | $Xsed -e "$delay_single_quote_subst"`' +OTOOL='`$ECHO "X$OTOOL" | $Xsed -e "$delay_single_quote_subst"`' +OTOOL64='`$ECHO "X$OTOOL64" | $Xsed -e "$delay_single_quote_subst"`' +libext='`$ECHO "X$libext" | $Xsed -e "$delay_single_quote_subst"`' +shrext_cmds='`$ECHO "X$shrext_cmds" | $Xsed -e "$delay_single_quote_subst"`' +extract_expsyms_cmds='`$ECHO "X$extract_expsyms_cmds" | $Xsed -e "$delay_single_quote_subst"`' +archive_cmds_need_lc='`$ECHO "X$archive_cmds_need_lc" | $Xsed -e "$delay_single_quote_subst"`' +enable_shared_with_static_runtimes='`$ECHO "X$enable_shared_with_static_runtimes" | $Xsed -e "$delay_single_quote_subst"`' +export_dynamic_flag_spec='`$ECHO "X$export_dynamic_flag_spec" | $Xsed -e "$delay_single_quote_subst"`' +whole_archive_flag_spec='`$ECHO "X$whole_archive_flag_spec" | $Xsed -e "$delay_single_quote_subst"`' +compiler_needs_object='`$ECHO "X$compiler_needs_object" | $Xsed -e "$delay_single_quote_subst"`' +old_archive_from_new_cmds='`$ECHO "X$old_archive_from_new_cmds" | $Xsed -e "$delay_single_quote_subst"`' +old_archive_from_expsyms_cmds='`$ECHO "X$old_archive_from_expsyms_cmds" | $Xsed -e "$delay_single_quote_subst"`' +archive_cmds='`$ECHO "X$archive_cmds" | $Xsed -e "$delay_single_quote_subst"`' +archive_expsym_cmds='`$ECHO "X$archive_expsym_cmds" | $Xsed -e "$delay_single_quote_subst"`' +module_cmds='`$ECHO "X$module_cmds" | $Xsed -e "$delay_single_quote_subst"`' +module_expsym_cmds='`$ECHO "X$module_expsym_cmds" | $Xsed -e "$delay_single_quote_subst"`' +with_gnu_ld='`$ECHO "X$with_gnu_ld" | $Xsed -e "$delay_single_quote_subst"`' +allow_undefined_flag='`$ECHO "X$allow_undefined_flag" | $Xsed -e "$delay_single_quote_subst"`' +no_undefined_flag='`$ECHO "X$no_undefined_flag" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec='`$ECHO "X$hardcode_libdir_flag_spec" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec_ld='`$ECHO "X$hardcode_libdir_flag_spec_ld" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_libdir_separator='`$ECHO "X$hardcode_libdir_separator" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_direct='`$ECHO "X$hardcode_direct" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_direct_absolute='`$ECHO "X$hardcode_direct_absolute" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_minus_L='`$ECHO "X$hardcode_minus_L" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_shlibpath_var='`$ECHO "X$hardcode_shlibpath_var" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_automatic='`$ECHO "X$hardcode_automatic" | $Xsed -e "$delay_single_quote_subst"`' +inherit_rpath='`$ECHO "X$inherit_rpath" | $Xsed -e "$delay_single_quote_subst"`' +link_all_deplibs='`$ECHO "X$link_all_deplibs" | $Xsed -e "$delay_single_quote_subst"`' +fix_srcfile_path='`$ECHO "X$fix_srcfile_path" | $Xsed -e "$delay_single_quote_subst"`' +always_export_symbols='`$ECHO "X$always_export_symbols" | $Xsed -e "$delay_single_quote_subst"`' +export_symbols_cmds='`$ECHO "X$export_symbols_cmds" | $Xsed -e "$delay_single_quote_subst"`' +exclude_expsyms='`$ECHO "X$exclude_expsyms" | $Xsed -e "$delay_single_quote_subst"`' +include_expsyms='`$ECHO "X$include_expsyms" | $Xsed -e "$delay_single_quote_subst"`' +prelink_cmds='`$ECHO "X$prelink_cmds" | $Xsed -e "$delay_single_quote_subst"`' +file_list_spec='`$ECHO "X$file_list_spec" | $Xsed -e "$delay_single_quote_subst"`' +variables_saved_for_relink='`$ECHO "X$variables_saved_for_relink" | $Xsed -e "$delay_single_quote_subst"`' +need_lib_prefix='`$ECHO "X$need_lib_prefix" | $Xsed -e "$delay_single_quote_subst"`' +need_version='`$ECHO "X$need_version" | $Xsed -e "$delay_single_quote_subst"`' +version_type='`$ECHO "X$version_type" | $Xsed -e "$delay_single_quote_subst"`' +runpath_var='`$ECHO "X$runpath_var" | $Xsed -e "$delay_single_quote_subst"`' +shlibpath_var='`$ECHO "X$shlibpath_var" | $Xsed -e "$delay_single_quote_subst"`' +shlibpath_overrides_runpath='`$ECHO "X$shlibpath_overrides_runpath" | $Xsed -e "$delay_single_quote_subst"`' +libname_spec='`$ECHO "X$libname_spec" | $Xsed -e "$delay_single_quote_subst"`' +library_names_spec='`$ECHO "X$library_names_spec" | $Xsed -e "$delay_single_quote_subst"`' +soname_spec='`$ECHO "X$soname_spec" | $Xsed -e "$delay_single_quote_subst"`' +postinstall_cmds='`$ECHO "X$postinstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' +postuninstall_cmds='`$ECHO "X$postuninstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' +finish_cmds='`$ECHO "X$finish_cmds" | $Xsed -e "$delay_single_quote_subst"`' +finish_eval='`$ECHO "X$finish_eval" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_into_libs='`$ECHO "X$hardcode_into_libs" | $Xsed -e "$delay_single_quote_subst"`' +sys_lib_search_path_spec='`$ECHO "X$sys_lib_search_path_spec" | $Xsed -e "$delay_single_quote_subst"`' +sys_lib_dlsearch_path_spec='`$ECHO "X$sys_lib_dlsearch_path_spec" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_action='`$ECHO "X$hardcode_action" | $Xsed -e "$delay_single_quote_subst"`' +enable_dlopen='`$ECHO "X$enable_dlopen" | $Xsed -e "$delay_single_quote_subst"`' +enable_dlopen_self='`$ECHO "X$enable_dlopen_self" | $Xsed -e "$delay_single_quote_subst"`' +enable_dlopen_self_static='`$ECHO "X$enable_dlopen_self_static" | $Xsed -e "$delay_single_quote_subst"`' +old_striplib='`$ECHO "X$old_striplib" | $Xsed -e "$delay_single_quote_subst"`' +striplib='`$ECHO "X$striplib" | $Xsed -e "$delay_single_quote_subst"`' + +LTCC='$LTCC' +LTCFLAGS='$LTCFLAGS' +compiler='$compiler_DEFAULT' + +# Quote evaled strings. +for var in SED \ +GREP \ +EGREP \ +FGREP \ +LD \ +NM \ +LN_S \ +lt_SP2NL \ +lt_NL2SP \ +reload_flag \ +deplibs_check_method \ +file_magic_cmd \ +AR \ +AR_FLAGS \ +STRIP \ +RANLIB \ +CC \ +CFLAGS \ +compiler \ +lt_cv_sys_global_symbol_pipe \ +lt_cv_sys_global_symbol_to_cdecl \ +lt_cv_sys_global_symbol_to_c_name_address \ +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ +SHELL \ +ECHO \ +lt_prog_compiler_no_builtin_flag \ +lt_prog_compiler_wl \ +lt_prog_compiler_pic \ +lt_prog_compiler_static \ +lt_cv_prog_compiler_c_o \ +need_locks \ +DSYMUTIL \ +NMEDIT \ +LIPO \ +OTOOL \ +OTOOL64 \ +shrext_cmds \ +export_dynamic_flag_spec \ +whole_archive_flag_spec \ +compiler_needs_object \ +with_gnu_ld \ +allow_undefined_flag \ +no_undefined_flag \ +hardcode_libdir_flag_spec \ +hardcode_libdir_flag_spec_ld \ +hardcode_libdir_separator \ +fix_srcfile_path \ +exclude_expsyms \ +include_expsyms \ +file_list_spec \ +variables_saved_for_relink \ +libname_spec \ +library_names_spec \ +soname_spec \ +finish_eval \ +old_striplib \ +striplib; do + case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in + *[\\\\\\\`\\"\\\$]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +# Double-quote double-evaled strings. +for var in reload_cmds \ +old_postinstall_cmds \ +old_postuninstall_cmds \ +old_archive_cmds \ +extract_expsyms_cmds \ +old_archive_from_new_cmds \ +old_archive_from_expsyms_cmds \ +archive_cmds \ +archive_expsym_cmds \ +module_cmds \ +module_expsym_cmds \ +export_symbols_cmds \ +prelink_cmds \ +postinstall_cmds \ +postuninstall_cmds \ +finish_cmds \ +sys_lib_search_path_spec \ +sys_lib_dlsearch_path_spec; do + case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in + *[\\\\\\\`\\"\\\$]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +# Fix-up fallback echo if it was mangled by the above quoting rules. +case \$lt_ECHO in +*'\\\$0 --fallback-echo"') lt_ECHO=\`\$ECHO "X\$lt_ECHO" | \$Xsed -e 's/\\\\\\\\\\\\\\\$0 --fallback-echo"\$/\$0 --fallback-echo"/'\` + ;; +esac + +ac_aux_dir='$ac_aux_dir' +xsi_shell='$xsi_shell' +lt_shell_append='$lt_shell_append' + +# See if we are running on zsh, and set the options which allow our +# commands through without removal of \ escapes INIT. +if test -n "\${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST +fi + + + PACKAGE='$PACKAGE' + VERSION='$VERSION' + TIMESTAMP='$TIMESTAMP' + RM='$RM' + ofile='$ofile' + + + + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + +# Handling of arguments. +for ac_config_target in $ac_config_targets +do + case $ac_config_target in + "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; + "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; + "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "libpng.pc") CONFIG_FILES="$CONFIG_FILES libpng.pc:scripts/libpng.pc-configure.in" ;; + "libpng-config") CONFIG_FILES="$CONFIG_FILES libpng-config:scripts/libpng-config.in" ;; + + *) as_fn_error "invalid argument: \`$ac_config_target'" "$LINENO" 5;; + esac +done + + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files + test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers + test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason against having it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to `$tmp'. +$debug || +{ + tmp= + trap 'exit_status=$? + { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status +' 0 + trap 'as_fn_exit 1' 1 2 13 15 +} +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && + test -n "$tmp" && test -d "$tmp" +} || +{ + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") +} || as_fn_error "cannot create a temporary directory in ." "$LINENO" 5 + +# Set up the scripts for CONFIG_FILES section. +# No need to generate them if there are no CONFIG_FILES. +# This happens for instance with `./config.status config.h'. +if test -n "$CONFIG_FILES"; then + + +ac_cr=`echo X | tr X '\015'` +# On cygwin, bash can eat \r inside `` if the user requested igncr. +# But we know of no other shell where ac_cr would be empty at this +# point, so we can use a bashism as a fallback. +if test "x$ac_cr" = x; then + eval ac_cr=\$\'\\r\' +fi +ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` +if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then + ac_cs_awk_cr='\r' +else + ac_cs_awk_cr=$ac_cr +fi + +echo 'BEGIN {' >"$tmp/subs1.awk" && +_ACEOF + + +{ + echo "cat >conf$$subs.awk <<_ACEOF" && + echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && + echo "_ACEOF" +} >conf$$subs.sh || + as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5 +ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'` +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + . ./conf$$subs.sh || + as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5 + + ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` + if test $ac_delim_n = $ac_delim_num; then + break + elif $ac_last_try; then + as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done +rm -f conf$$subs.sh + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>"\$tmp/subs1.awk" <<\\_ACAWK && +_ACEOF +sed -n ' +h +s/^/S["/; s/!.*/"]=/ +p +g +s/^[^!]*!// +:repl +t repl +s/'"$ac_delim"'$// +t delim +:nl +h +s/\(.\{148\}\)..*/\1/ +t more1 +s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ +p +n +b repl +:more1 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t nl +:delim +h +s/\(.\{148\}\)..*/\1/ +t more2 +s/["\\]/\\&/g; s/^/"/; s/$/"/ +p +b +:more2 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t delim +' >$CONFIG_STATUS || ac_write_fail=1 +rm -f conf$$subs.awk +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACAWK +cat >>"\$tmp/subs1.awk" <<_ACAWK && + for (key in S) S_is_set[key] = 1 + FS = "" + +} +{ + line = $ 0 + nfields = split(line, field, "@") + substed = 0 + len = length(field[1]) + for (i = 2; i < nfields; i++) { + key = field[i] + keylen = length(key) + if (S_is_set[key]) { + value = S[key] + line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) + len += length(value) + length(field[++i]) + substed = 1 + } else + len += 1 + keylen + } + + print line +} + +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then + sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" +else + cat +fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \ + || as_fn_error "could not setup config files machinery" "$LINENO" 5 +_ACEOF + +# VPATH may cause trouble with some makes, so we remove $(srcdir), +# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=/{ +s/:*\$(srcdir):*/:/ +s/:*\${srcdir}:*/:/ +s/:*@srcdir@:*/:/ +s/^\([^=]*=[ ]*\):*/\1/ +s/:*$// +s/^[^=]*=[ ]*$// +}' +fi + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +fi # test -n "$CONFIG_FILES" + +# Set up the scripts for CONFIG_HEADERS section. +# No need to generate them if there are no CONFIG_HEADERS. +# This happens for instance with `./config.status Makefile'. +if test -n "$CONFIG_HEADERS"; then +cat >"$tmp/defines.awk" <<\_ACAWK || +BEGIN { +_ACEOF + +# Transform confdefs.h into an awk script `defines.awk', embedded as +# here-document in config.status, that substitutes the proper values into +# config.h.in to produce config.h. + +# Create a delimiter string that does not exist in confdefs.h, to ease +# handling of long lines. +ac_delim='%!_!# ' +for ac_last_try in false false :; do + ac_t=`sed -n "/$ac_delim/p" confdefs.h` + if test -z "$ac_t"; then + break + elif $ac_last_try; then + as_fn_error "could not make $CONFIG_HEADERS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done + +# For the awk script, D is an array of macro values keyed by name, +# likewise P contains macro parameters if any. Preserve backslash +# newline sequences. + +ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* +sed -n ' +s/.\{148\}/&'"$ac_delim"'/g +t rset +:rset +s/^[ ]*#[ ]*define[ ][ ]*/ / +t def +d +:def +s/\\$// +t bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3"/p +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p +d +:bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3\\\\\\n"\\/p +t cont +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p +t cont +d +:cont +n +s/.\{148\}/&'"$ac_delim"'/g +t clear +:clear +s/\\$// +t bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/"/p +d +:bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p +b cont +' >$CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + for (key in D) D_is_set[key] = 1 + FS = "" +} +/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { + line = \$ 0 + split(line, arg, " ") + if (arg[1] == "#") { + defundef = arg[2] + mac1 = arg[3] + } else { + defundef = substr(arg[1], 2) + mac1 = arg[2] + } + split(mac1, mac2, "(") #) + macro = mac2[1] + prefix = substr(line, 1, index(line, defundef) - 1) + if (D_is_set[macro]) { + # Preserve the white space surrounding the "#". + print prefix "define", macro P[macro] D[macro] + next + } else { + # Replace #undef with comments. This is necessary, for example, + # in the case of _POSIX_SOURCE, which is predefined and required + # on some systems where configure will not decide to define it. + if (defundef == "undef") { + print "/*", prefix defundef, macro, "*/" + next + } + } +} +{ print } +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + as_fn_error "could not setup config headers machinery" "$LINENO" 5 +fi # test -n "$CONFIG_HEADERS" + + +eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" +shift +for ac_tag +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) as_fn_error "invalid tag \`$ac_tag'" "$LINENO" 5;; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + as_fn_error "cannot find input file: \`$ac_f'" "$LINENO" 5;; + esac + case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + as_fn_append ac_file_inputs " '$ac_f'" + done + + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + configure_input='Generated from '` + $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + `' by configure.' + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 +$as_echo "$as_me: creating $ac_file" >&6;} + fi + # Neutralize special characters interpreted by sed in replacement strings. + case $configure_input in #( + *\&* | *\|* | *\\* ) + ac_sed_conf_input=`$as_echo "$configure_input" | + sed 's/[\\\\&|]/\\\\&/g'`;; #( + *) ac_sed_conf_input=$configure_input;; + esac + + case $ac_tag in + *:-:* | *:-) cat >"$tmp/stdin" \ + || as_fn_error "could not create $ac_file" "$LINENO" 5 ;; + esac + ;; + esac + + ac_dir=`$as_dirname -- "$ac_file" || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir="$ac_dir"; as_fn_mkdir_p + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + + case $ac_mode in + :F) + # + # CONFIG_FILE + # + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; + esac + ac_MKDIR_P=$MKDIR_P + case $MKDIR_P in + [\\/$]* | ?:[\\/]* ) ;; + */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; + esac +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= +ac_sed_dataroot=' +/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p' +case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + ac_datarootdir_hack=' + s&@datadir@&$datadir&g + s&@docdir@&$docdir&g + s&@infodir@&$infodir&g + s&@localedir@&$localedir&g + s&@mandir@&$mandir&g + s&\\\${datarootdir}&$datarootdir&g' ;; +esac +_ACEOF + +# Neutralize VPATH when `$srcdir' = `.'. +# Shell code in configure.ac might set extrasub. +# FIXME: do we really want to maintain this feature? +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_sed_extra="$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s|@configure_input@|$ac_sed_conf_input|;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@top_build_prefix@&$ac_top_build_prefix&;t t +s&@srcdir@&$ac_srcdir&;t t +s&@abs_srcdir@&$ac_abs_srcdir&;t t +s&@top_srcdir@&$ac_top_srcdir&;t t +s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t +s&@builddir@&$ac_builddir&;t t +s&@abs_builddir@&$ac_abs_builddir&;t t +s&@abs_top_builddir@&$ac_abs_top_builddir&;t t +s&@INSTALL@&$ac_INSTALL&;t t +s&@MKDIR_P@&$ac_MKDIR_P&;t t +$ac_datarootdir_hack +" +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \ + || as_fn_error "could not create $ac_file" "$LINENO" 5 + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined." >&5 +$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined." >&2;} + + rm -f "$tmp/stdin" + case $ac_file in + -) cat "$tmp/out" && rm -f "$tmp/out";; + *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";; + esac \ + || as_fn_error "could not create $ac_file" "$LINENO" 5 + ;; + :H) + # + # CONFIG_HEADER + # + if test x"$ac_file" != x-; then + { + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" + } >"$tmp/config.h" \ + || as_fn_error "could not create $ac_file" "$LINENO" 5 + if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then + { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 +$as_echo "$as_me: $ac_file is unchanged" >&6;} + else + rm -f "$ac_file" + mv "$tmp/config.h" "$ac_file" \ + || as_fn_error "could not create $ac_file" "$LINENO" 5 + fi + else + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \ + || as_fn_error "could not create -" "$LINENO" 5 + fi +# Compute "$ac_file"'s index in $config_headers. +_am_arg="$ac_file" +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $_am_arg | $_am_arg:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || +$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$_am_arg" : 'X\(//\)[^/]' \| \ + X"$_am_arg" : 'X\(//\)$' \| \ + X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$_am_arg" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'`/stamp-h$_am_stamp_count + ;; + + :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 +$as_echo "$as_me: executing $ac_file commands" >&6;} + ;; + esac + + + case $ac_file$ac_mode in + "depfiles":C) test x"$AMDEP_TRUE" != x"" || { + # Autoconf 2.62 quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + case $CONFIG_FILES in + *\'*) eval set x "$CONFIG_FILES" ;; + *) set x $CONFIG_FILES ;; + esac + shift + for mf + do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named `Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then + dirpart=`$as_dirname -- "$mf" || +$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$mf" : 'X\(//\)[^/]' \| \ + X"$mf" : 'X\(//\)$' \| \ + X"$mf" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$mf" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running `make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n 's/^U = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`$as_dirname -- "$file" || +$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$file" : 'X\(//\)[^/]' \| \ + X"$file" : 'X\(//\)$' \| \ + X"$file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir=$dirpart/$fdir; as_fn_mkdir_p + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done + done +} + ;; + "libtool":C) + + # See if we are running on zsh, and set the options which allow our + # commands through without removal of \ escapes. + if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST + fi + + cfgfile="${ofile}T" + trap "$RM \"$cfgfile\"; exit 1" 1 2 15 + $RM "$cfgfile" + + cat <<_LT_EOF >> "$cfgfile" +#! $SHELL + +# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. +# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: +# NOTE: Changes made to this file will be lost: look at ltmain.sh. +# +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, +# 2006, 2007, 2008 Free Software Foundation, Inc. +# Written by Gordon Matzigkeit, 1996 +# +# This file is part of GNU Libtool. +# +# GNU Libtool is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation; either version 2 of +# the License, or (at your option) any later version. +# +# As a special exception to the GNU General Public License, +# if you distribute this file as part of a program or library that +# is built using GNU Libtool, you may include this file under the +# same distribution terms that you use for the rest of that program. +# +# GNU Libtool is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNU Libtool; see the file COPYING. If not, a copy +# can be downloaded from http://www.gnu.org/licenses/gpl.html, or +# obtained by writing to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + +# The names of the tagged configurations supported by this script. +available_tags="" + +# ### BEGIN LIBTOOL CONFIG + +# A sed program that does not truncate output. +SED=$lt_SED + +# Sed that helps us avoid accidentally triggering echo(1) options like -n. +Xsed="\$SED -e 1s/^X//" + +# A grep program that handles long lines. +GREP=$lt_GREP + +# An ERE matcher. +EGREP=$lt_EGREP + +# A literal string matcher. +FGREP=$lt_FGREP + +# Assembler program. +AS=$AS + +# DLL creation program. +DLLTOOL=$DLLTOOL + +# Object dumper program. +OBJDUMP=$OBJDUMP + +# Which release of libtool.m4 was used? +macro_version=$macro_version +macro_revision=$macro_revision + +# Whether or not to build shared libraries. +build_libtool_libs=$enable_shared + +# Whether or not to build static libraries. +build_old_libs=$enable_static + +# What type of objects to build. +pic_mode=$pic_mode + +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install + +# The host system. +host_alias=$host_alias +host=$host +host_os=$host_os + +# The build system. +build_alias=$build_alias +build=$build +build_os=$build_os + +# A BSD- or MS-compatible name lister. +NM=$lt_NM + +# Whether we need soft or hard links. +LN_S=$lt_LN_S + +# What is the maximum length of a command? +max_cmd_len=$max_cmd_len + +# Object file suffix (normally "o"). +objext=$ac_objext + +# Executable file suffix (normally ""). +exeext=$exeext + +# whether the shell understands "unset". +lt_unset=$lt_unset + +# turn spaces into newlines. +SP2NL=$lt_lt_SP2NL + +# turn newlines into spaces. +NL2SP=$lt_lt_NL2SP + +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds + +# Method to check whether dependent libraries are shared objects. +deplibs_check_method=$lt_deplibs_check_method + +# Command to use when deplibs_check_method == "file_magic". +file_magic_cmd=$lt_file_magic_cmd + +# The archiver. +AR=$lt_AR +AR_FLAGS=$lt_AR_FLAGS + +# A symbol stripping program. +STRIP=$lt_STRIP + +# Commands used to install an old-style archive. +RANLIB=$lt_RANLIB +old_postinstall_cmds=$lt_old_postinstall_cmds +old_postuninstall_cmds=$lt_old_postuninstall_cmds + +# A C compiler. +LTCC=$lt_CC + +# LTCC compiler flags. +LTCFLAGS=$lt_CFLAGS + +# Take the output of nm and produce a listing of raw symbols and C names. +global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe + +# Transform the output of nm in a proper C declaration. +global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl + +# Transform the output of nm in a C name address pair. +global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address + +# Transform the output of nm in a C name address pair when lib prefix is needed. +global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix + +# The name of the directory that contains temporary libtool files. +objdir=$objdir + +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL + +# An echo program that does not interpret backslashes. +ECHO=$lt_ECHO + +# Used to examine libraries when file_magic_cmd begins with "file". +MAGIC_CMD=$MAGIC_CMD + +# Must we lock files when doing compilation? +need_locks=$lt_need_locks + +# Tool to manipulate archived DWARF debug symbol files on Mac OS X. +DSYMUTIL=$lt_DSYMUTIL + +# Tool to change global to local symbols on Mac OS X. +NMEDIT=$lt_NMEDIT + +# Tool to manipulate fat objects and archives on Mac OS X. +LIPO=$lt_LIPO + +# ldd/readelf like tool for Mach-O binaries on Mac OS X. +OTOOL=$lt_OTOOL + +# ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. +OTOOL64=$lt_OTOOL64 + +# Old archive suffix (normally "a"). +libext=$libext + +# Shared library suffix (normally ".so"). +shrext_cmds=$lt_shrext_cmds + +# The commands to extract the exported symbol list from a shared archive. +extract_expsyms_cmds=$lt_extract_expsyms_cmds + +# Variables whose values should be saved in libtool wrapper scripts and +# restored at link time. +variables_saved_for_relink=$lt_variables_saved_for_relink + +# Do we need the "lib" prefix for modules? +need_lib_prefix=$need_lib_prefix + +# Do we need a version for libraries? +need_version=$need_version + +# Library versioning type. +version_type=$version_type + +# Shared library runtime path variable. +runpath_var=$runpath_var + +# Shared library path variable. +shlibpath_var=$shlibpath_var + +# Is shlibpath searched before the hard-coded library search path? +shlibpath_overrides_runpath=$shlibpath_overrides_runpath + +# Format of library name prefix. +libname_spec=$lt_libname_spec + +# List of archive names. First name is the real one, the rest are links. +# The last name is the one that the linker finds with -lNAME +library_names_spec=$lt_library_names_spec + +# The coded name of the library, if different from the real name. +soname_spec=$lt_soname_spec + +# Command to use after installation of a shared archive. +postinstall_cmds=$lt_postinstall_cmds + +# Command to use after uninstallation of a shared archive. +postuninstall_cmds=$lt_postuninstall_cmds + +# Commands used to finish a libtool library installation in a directory. +finish_cmds=$lt_finish_cmds + +# As "finish_cmds", except a single script fragment to be evaled but +# not shown. +finish_eval=$lt_finish_eval + +# Whether we should hardcode library paths into libraries. +hardcode_into_libs=$hardcode_into_libs + +# Compile-time system search path for libraries. +sys_lib_search_path_spec=$lt_sys_lib_search_path_spec + +# Run-time system search path for libraries. +sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec + +# Whether dlopen is supported. +dlopen_support=$enable_dlopen + +# Whether dlopen of programs is supported. +dlopen_self=$enable_dlopen_self + +# Whether dlopen of statically linked programs is supported. +dlopen_self_static=$enable_dlopen_self_static + +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib + + +# The linker used to build libraries. +LD=$lt_LD + +# Commands used to build an old-style archive. +old_archive_cmds=$lt_old_archive_cmds + +# A language specific compiler. +CC=$lt_compiler + +# Is the compiler the GNU compiler? +with_gcc=$GCC + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag + +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl + +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic + +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_lt_prog_compiler_static + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_lt_cv_prog_compiler_c_o + +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=$archive_cmds_need_lc + +# Whether or not to disallow shared libs when runtime libs are static. +allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_export_dynamic_flag_spec + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_whole_archive_flag_spec + +# Whether the compiler copes with passing no objects directly. +compiler_needs_object=$lt_compiler_needs_object + +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$lt_old_archive_from_new_cmds + +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds + +# Commands used to build a shared archive. +archive_cmds=$lt_archive_cmds +archive_expsym_cmds=$lt_archive_expsym_cmds + +# Commands used to build a loadable module if different from building +# a shared archive. +module_cmds=$lt_module_cmds +module_expsym_cmds=$lt_module_expsym_cmds + +# Whether we are building with GNU ld or not. +with_gnu_ld=$lt_with_gnu_ld + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_allow_undefined_flag + +# Flag that enforces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag + +# Flag to hardcode \$libdir into a binary during linking. +# This must work even if \$libdir does not exist +hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec + +# If ld is used when linking, flag to hardcode \$libdir into a binary +# during linking. This must work even if \$libdir does not exist. +hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld + +# Whether we need a single "-rpath" flag with a separated argument. +hardcode_libdir_separator=$lt_hardcode_libdir_separator + +# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes +# DIR into the resulting binary. +hardcode_direct=$hardcode_direct + +# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes +# DIR into the resulting binary and the resulting library dependency is +# "absolute",i.e impossible to change by setting \${shlibpath_var} if the +# library is relocated. +hardcode_direct_absolute=$hardcode_direct_absolute + +# Set to "yes" if using the -LDIR flag during linking hardcodes DIR +# into the resulting binary. +hardcode_minus_L=$hardcode_minus_L + +# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR +# into the resulting binary. +hardcode_shlibpath_var=$hardcode_shlibpath_var + +# Set to "yes" if building a shared library automatically hardcodes DIR +# into the library and all subsequent libraries and executables linked +# against it. +hardcode_automatic=$hardcode_automatic + +# Set to yes if linker adds runtime paths of dependent libraries +# to runtime path list. +inherit_rpath=$inherit_rpath + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$link_all_deplibs + +# Fix the shell variable \$srcfile for the compiler. +fix_srcfile_path=$lt_fix_srcfile_path + +# Set to "yes" if exported symbols are required. +always_export_symbols=$always_export_symbols + +# The commands to list exported symbols. +export_symbols_cmds=$lt_export_symbols_cmds + +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_exclude_expsyms + +# Symbols that must always be exported. +include_expsyms=$lt_include_expsyms + +# Commands necessary for linking programs (against libraries) with templates. +prelink_cmds=$lt_prelink_cmds + +# Specify filename containing input files. +file_list_spec=$lt_file_list_spec + +# How to hardcode a shared library path into an executable. +hardcode_action=$hardcode_action + +# ### END LIBTOOL CONFIG + +_LT_EOF + + case $host_os in + aix3*) + cat <<\_LT_EOF >> "$cfgfile" +# AIX sometimes has problems with the GCC collect2 program. For some +# reason, if we set the COLLECT_NAMES environment variable, the problems +# vanish in a puff of smoke. +if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES +fi +_LT_EOF + ;; + esac + + +ltmain="$ac_aux_dir/ltmain.sh" + + + # We use sed instead of cat because bash on DJGPP gets confused if + # if finds mixed CR/LF and LF-only lines. Since sed operates in + # text mode, it properly converts lines to CR/LF. This bash problem + # is reportedly fixed, but why not run on old versions too? + sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) + + case $xsi_shell in + yes) + cat << \_LT_EOF >> "$cfgfile" + +# func_dirname file append nondir_replacement +# Compute the dirname of FILE. If nonempty, add APPEND to the result, +# otherwise set result to NONDIR_REPLACEMENT. +func_dirname () +{ + case ${1} in + */*) func_dirname_result="${1%/*}${2}" ;; + * ) func_dirname_result="${3}" ;; + esac +} + +# func_basename file +func_basename () +{ + func_basename_result="${1##*/}" +} + +# func_dirname_and_basename file append nondir_replacement +# perform func_basename and func_dirname in a single function +# call: +# dirname: Compute the dirname of FILE. If nonempty, +# add APPEND to the result, otherwise set result +# to NONDIR_REPLACEMENT. +# value returned in "$func_dirname_result" +# basename: Compute filename of FILE. +# value retuned in "$func_basename_result" +# Implementation must be kept synchronized with func_dirname +# and func_basename. For efficiency, we do not delegate to +# those functions but instead duplicate the functionality here. +func_dirname_and_basename () +{ + case ${1} in + */*) func_dirname_result="${1%/*}${2}" ;; + * ) func_dirname_result="${3}" ;; + esac + func_basename_result="${1##*/}" +} + +# func_stripname prefix suffix name +# strip PREFIX and SUFFIX off of NAME. +# PREFIX and SUFFIX must not contain globbing or regex special +# characters, hashes, percent signs, but SUFFIX may contain a leading +# dot (in which case that matches only a dot). +func_stripname () +{ + # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are + # positional parameters, so assign one to ordinary parameter first. + func_stripname_result=${3} + func_stripname_result=${func_stripname_result#"${1}"} + func_stripname_result=${func_stripname_result%"${2}"} +} + +# func_opt_split +func_opt_split () +{ + func_opt_split_opt=${1%%=*} + func_opt_split_arg=${1#*=} +} + +# func_lo2o object +func_lo2o () +{ + case ${1} in + *.lo) func_lo2o_result=${1%.lo}.${objext} ;; + *) func_lo2o_result=${1} ;; + esac +} + +# func_xform libobj-or-source +func_xform () +{ + func_xform_result=${1%.*}.lo +} + +# func_arith arithmetic-term... +func_arith () +{ + func_arith_result=$(( $* )) +} + +# func_len string +# STRING may not start with a hyphen. +func_len () +{ + func_len_result=${#1} +} + +_LT_EOF + ;; + *) # Bourne compatible functions. + cat << \_LT_EOF >> "$cfgfile" + +# func_dirname file append nondir_replacement +# Compute the dirname of FILE. If nonempty, add APPEND to the result, +# otherwise set result to NONDIR_REPLACEMENT. +func_dirname () +{ + # Extract subdirectory from the argument. + func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"` + if test "X$func_dirname_result" = "X${1}"; then + func_dirname_result="${3}" + else + func_dirname_result="$func_dirname_result${2}" + fi +} + +# func_basename file +func_basename () +{ + func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"` +} + + +# func_stripname prefix suffix name +# strip PREFIX and SUFFIX off of NAME. +# PREFIX and SUFFIX must not contain globbing or regex special +# characters, hashes, percent signs, but SUFFIX may contain a leading +# dot (in which case that matches only a dot). +# func_strip_suffix prefix name +func_stripname () +{ + case ${2} in + .*) func_stripname_result=`$ECHO "X${3}" \ + | $Xsed -e "s%^${1}%%" -e "s%\\\\${2}\$%%"`;; + *) func_stripname_result=`$ECHO "X${3}" \ + | $Xsed -e "s%^${1}%%" -e "s%${2}\$%%"`;; + esac +} + +# sed scripts: +my_sed_long_opt='1s/^\(-[^=]*\)=.*/\1/;q' +my_sed_long_arg='1s/^-[^=]*=//' + +# func_opt_split +func_opt_split () +{ + func_opt_split_opt=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_opt"` + func_opt_split_arg=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_arg"` +} + +# func_lo2o object +func_lo2o () +{ + func_lo2o_result=`$ECHO "X${1}" | $Xsed -e "$lo2o"` +} + +# func_xform libobj-or-source +func_xform () +{ + func_xform_result=`$ECHO "X${1}" | $Xsed -e 's/\.[^.]*$/.lo/'` +} + +# func_arith arithmetic-term... +func_arith () +{ + func_arith_result=`expr "$@"` +} + +# func_len string +# STRING may not start with a hyphen. +func_len () +{ + func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len` +} + +_LT_EOF +esac + +case $lt_shell_append in + yes) + cat << \_LT_EOF >> "$cfgfile" + +# func_append var value +# Append VALUE to the end of shell variable VAR. +func_append () +{ + eval "$1+=\$2" +} +_LT_EOF + ;; + *) + cat << \_LT_EOF >> "$cfgfile" + +# func_append var value +# Append VALUE to the end of shell variable VAR. +func_append () +{ + eval "$1=\$$1\$2" +} + +_LT_EOF + ;; + esac + + + sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) + + mv -f "$cfgfile" "$ofile" || + (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") + chmod +x "$ofile" + + ;; + "libpng-config":F) chmod +x libpng-config ;; + + esac +done # for ac_tag + + +as_fn_exit 0 +_ACEOF +ac_clean_files=$ac_clean_files_save + +test $ac_write_fail = 0 || + as_fn_error "write failure creating $CONFIG_STATUS" "$LINENO" 5 + + +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + ac_config_status_args= + test "$silent" = yes && + ac_config_status_args="$ac_config_status_args --quiet" + exec 5>/dev/null + $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || as_fn_exit $? +fi +if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} +fi + diff --git a/resources/LICENSE b/resources/LICENSE new file mode 100644 index 0000000..c04d730 --- /dev/null +++ b/resources/LICENSE @@ -0,0 +1,111 @@ + +This copy of the libpng notices is provided for your convenience. In case of +any discrepancy between this copy and the notices in the file png.h that is +included in the libpng distribution, the latter shall prevail. + +COPYRIGHT NOTICE, DISCLAIMER, and LICENSE: + +If you modify libpng you may insert additional notices immediately following +this sentence. + +This code is released under the libpng license. + +libpng versions 1.2.6, August 15, 2004, through 1.2.49, March 29, 2012, are +Copyright (c) 2004, 2006-2009 Glenn Randers-Pehrson, and are +distributed according to the same disclaimer and license as libpng-1.2.5 +with the following individual added to the list of Contributing Authors + + Cosmin Truta + +libpng versions 1.0.7, July 1, 2000, through 1.2.5 - October 3, 2002, are +Copyright (c) 2000-2002 Glenn Randers-Pehrson, and are +distributed according to the same disclaimer and license as libpng-1.0.6 +with the following individuals added to the list of Contributing Authors + + Simon-Pierre Cadieux + Eric S. Raymond + Gilles Vollant + +and with the following additions to the disclaimer: + + There is no warranty against interference with your enjoyment of the + library or against infringement. There is no warranty that our + efforts or the library will fulfill any of your particular purposes + or needs. This library is provided with all faults, and the entire + risk of satisfactory quality, performance, accuracy, and effort is with + the user. + +libpng versions 0.97, January 1998, through 1.0.6, March 20, 2000, are +Copyright (c) 1998, 1999 Glenn Randers-Pehrson, and are +distributed according to the same disclaimer and license as libpng-0.96, +with the following individuals added to the list of Contributing Authors: + + Tom Lane + Glenn Randers-Pehrson + Willem van Schaik + +libpng versions 0.89, June 1996, through 0.96, May 1997, are +Copyright (c) 1996, 1997 Andreas Dilger +Distributed according to the same disclaimer and license as libpng-0.88, +with the following individuals added to the list of Contributing Authors: + + John Bowler + Kevin Bracey + Sam Bushell + Magnus Holmgren + Greg Roelofs + Tom Tanner + +libpng versions 0.5, May 1995, through 0.88, January 1996, are +Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc. + +For the purposes of this copyright and license, "Contributing Authors" +is defined as the following set of individuals: + + Andreas Dilger + Dave Martindale + Guy Eric Schalnat + Paul Schmidt + Tim Wegner + +The PNG Reference Library is supplied "AS IS". The Contributing Authors +and Group 42, Inc. disclaim all warranties, expressed or implied, +including, without limitation, the warranties of merchantability and of +fitness for any purpose. The Contributing Authors and Group 42, Inc. +assume no liability for direct, indirect, incidental, special, exemplary, +or consequential damages, which may result from the use of the PNG +Reference Library, even if advised of the possibility of such damage. + +Permission is hereby granted to use, copy, modify, and distribute this +source code, or portions hereof, for any purpose, without fee, subject +to the following restrictions: + +1. The origin of this source code must not be misrepresented. + +2. Altered versions must be plainly marked as such and must not + be misrepresented as being the original source. + +3. This Copyright notice may not be removed or altered from any + source or altered source distribution. + +The Contributing Authors and Group 42, Inc. specifically permit, without +fee, and encourage the use of this source code as a component to +supporting the PNG file format in commercial products. If you use this +source code in a product, acknowledgment is not required but would be +appreciated. + + +A "png_get_copyright" function is available, for convenient use in "about" +boxes and the like: + + printf("%s",png_get_copyright(NULL)); + +Also, the PNG logo (in PNG format, of course) is supplied in the +files "pngbar.png" and "pngbar.jpg (88x31) and "pngnow.png" (98x31). + +Libpng is OSI Certified Open Source Software. OSI Certified Open Source is a +certification mark of the Open Source Initiative. + +Glenn Randers-Pehrson +glennrp at users.sourceforge.net +March 29, 2012 diff --git a/src/Box2D/Dynamics/Joints/b2MotorJoint.cpp b/src/Box2D/Dynamics/Joints/b2MotorJoint.cpp deleted file mode 100644 index 747a35d..0000000 --- a/src/Box2D/Dynamics/Joints/b2MotorJoint.cpp +++ /dev/null @@ -1,293 +0,0 @@ -/* -* Copyright (c) 2006-2012 Erin Catto http://www.box2d.org -* -* This software is provided 'as-is', without any express or implied -* warranty. In no event will the authors be held liable for any damages -* arising from the use of this software. -* Permission is granted to anyone to use this software for any purpose, -* including commercial applications, and to alter it and redistribute it -* freely, subject to the following restrictions: -* 1. The origin of this software must not be misrepresented; you must not -* claim that you wrote the original software. If you use this software -* in a product, an acknowledgment in the product documentation would be -* appreciated but is not required. -* 2. Altered source versions must be plainly marked as such, and must not be -* misrepresented as being the original software. -* 3. This notice may not be removed or altered from any source distribution. -*/ - -#include -#include -#include - -// Point-to-point constraint -// Cdot = v2 - v1 -// = v2 + cross(w2, r2) - v1 - cross(w1, r1) -// J = [-I -r1_skew I r2_skew ] -// Identity used: -// w k % (rx i + ry j) = w * (-ry i + rx j) - -// Angle constraint -// Cdot = w2 - w1 -// J = [0 0 -1 0 0 1] -// K = invI1 + invI2 - -void b2MotorJointDef::Initialize(b2Body* bA, b2Body* bB) -{ - bodyA = bA; - bodyB = bB; - b2Vec2 xB = bodyB->GetPosition(); - linearOffset = bodyA->GetLocalPoint(xB); - - float32 angleA = bodyA->GetAngle(); - float32 angleB = bodyB->GetAngle(); - angularOffset = angleB - angleA; -} - -b2MotorJoint::b2MotorJoint(const b2MotorJointDef* def) -: b2Joint(def) -{ - m_linearOffset = def->linearOffset; - m_angularOffset = def->angularOffset; - - m_linearImpulse.SetZero(); - m_angularImpulse = 0.0f; - - m_maxForce = def->maxForce; - m_maxTorque = def->maxTorque; - m_correctionFactor = def->correctionFactor; -} - -void b2MotorJoint::InitVelocityConstraints(const b2SolverData& data) -{ - m_indexA = m_bodyA->m_islandIndex; - m_indexB = m_bodyB->m_islandIndex; - m_localCenterA = m_bodyA->m_sweep.localCenter; - m_localCenterB = m_bodyB->m_sweep.localCenter; - m_invMassA = m_bodyA->m_invMass; - m_invMassB = m_bodyB->m_invMass; - m_invIA = m_bodyA->m_invI; - m_invIB = m_bodyB->m_invI; - - b2Vec2 cA = data.positions[m_indexA].c; - float32 aA = data.positions[m_indexA].a; - b2Vec2 vA = data.velocities[m_indexA].v; - float32 wA = data.velocities[m_indexA].w; - - b2Vec2 cB = data.positions[m_indexB].c; - float32 aB = data.positions[m_indexB].a; - b2Vec2 vB = data.velocities[m_indexB].v; - float32 wB = data.velocities[m_indexB].w; - - b2Rot qA(aA), qB(aB); - - // Compute the effective mass matrix. - m_rA = b2Mul(qA, -m_localCenterA); - m_rB = b2Mul(qB, -m_localCenterB); - - // J = [-I -r1_skew I r2_skew] - // [ 0 -1 0 1] - // r_skew = [-ry; rx] - - // Matlab - // K = [ mA+r1y^2*iA+mB+r2y^2*iB, -r1y*iA*r1x-r2y*iB*r2x, -r1y*iA-r2y*iB] - // [ -r1y*iA*r1x-r2y*iB*r2x, mA+r1x^2*iA+mB+r2x^2*iB, r1x*iA+r2x*iB] - // [ -r1y*iA-r2y*iB, r1x*iA+r2x*iB, iA+iB] - - float32 mA = m_invMassA, mB = m_invMassB; - float32 iA = m_invIA, iB = m_invIB; - - b2Mat22 K; - K.ex.x = mA + mB + iA * m_rA.y * m_rA.y + iB * m_rB.y * m_rB.y; - K.ex.y = -iA * m_rA.x * m_rA.y - iB * m_rB.x * m_rB.y; - K.ey.x = K.ex.y; - K.ey.y = mA + mB + iA * m_rA.x * m_rA.x + iB * m_rB.x * m_rB.x; - - m_linearMass = K.GetInverse(); - - m_angularMass = iA + iB; - if (m_angularMass > 0.0f) - { - m_angularMass = 1.0f / m_angularMass; - } - - m_linearError = cB + m_rB - cA - m_rA - b2Mul(qA, m_linearOffset); - m_angularError = aB - aA - m_angularOffset; - - if (data.step.warmStarting) - { - // Scale impulses to support a variable time step. - m_linearImpulse *= data.step.dtRatio; - m_angularImpulse *= data.step.dtRatio; - - b2Vec2 P(m_linearImpulse.x, m_linearImpulse.y); - vA -= mA * P; - wA -= iA * (b2Cross(m_rA, P) + m_angularImpulse); - vB += mB * P; - wB += iB * (b2Cross(m_rB, P) + m_angularImpulse); - } - else - { - m_linearImpulse.SetZero(); - m_angularImpulse = 0.0f; - } - - data.velocities[m_indexA].v = vA; - data.velocities[m_indexA].w = wA; - data.velocities[m_indexB].v = vB; - data.velocities[m_indexB].w = wB; -} - -void b2MotorJoint::SolveVelocityConstraints(const b2SolverData& data) -{ - b2Vec2 vA = data.velocities[m_indexA].v; - float32 wA = data.velocities[m_indexA].w; - b2Vec2 vB = data.velocities[m_indexB].v; - float32 wB = data.velocities[m_indexB].w; - - float32 mA = m_invMassA, mB = m_invMassB; - float32 iA = m_invIA, iB = m_invIB; - - float32 h = data.step.dt; - float32 inv_h = data.step.inv_dt; - - // Solve angular friction - { - float32 Cdot = wB - wA + inv_h * m_correctionFactor * m_angularError; - float32 impulse = -m_angularMass * Cdot; - - float32 oldImpulse = m_angularImpulse; - float32 maxImpulse = h * m_maxTorque; - m_angularImpulse = b2Clamp(m_angularImpulse + impulse, -maxImpulse, maxImpulse); - impulse = m_angularImpulse - oldImpulse; - - wA -= iA * impulse; - wB += iB * impulse; - } - - // Solve linear friction - { - b2Vec2 Cdot = vB + b2Cross(wB, m_rB) - vA - b2Cross(wA, m_rA) + inv_h * m_correctionFactor * m_linearError; - - b2Vec2 impulse = -b2Mul(m_linearMass, Cdot); - b2Vec2 oldImpulse = m_linearImpulse; - m_linearImpulse += impulse; - - float32 maxImpulse = h * m_maxForce; - - if (m_linearImpulse.LengthSquared() > maxImpulse * maxImpulse) - { - m_linearImpulse.Normalize(); - m_linearImpulse *= maxImpulse; - } - - impulse = m_linearImpulse - oldImpulse; - - vA -= mA * impulse; - wA -= iA * b2Cross(m_rA, impulse); - - vB += mB * impulse; - wB += iB * b2Cross(m_rB, impulse); - } - - data.velocities[m_indexA].v = vA; - data.velocities[m_indexA].w = wA; - data.velocities[m_indexB].v = vB; - data.velocities[m_indexB].w = wB; -} - -bool b2MotorJoint::SolvePositionConstraints(const b2SolverData& data) -{ - B2_NOT_USED(data); - - return true; -} - -b2Vec2 b2MotorJoint::GetAnchorA() const -{ - return m_bodyA->GetPosition(); -} - -b2Vec2 b2MotorJoint::GetAnchorB() const -{ - return m_bodyB->GetPosition(); -} - -b2Vec2 b2MotorJoint::GetReactionForce(float32 inv_dt) const -{ - return inv_dt * m_linearImpulse; -} - -float32 b2MotorJoint::GetReactionTorque(float32 inv_dt) const -{ - return inv_dt * m_angularImpulse; -} - -void b2MotorJoint::SetMaxForce(float32 force) -{ - b2Assert(b2IsValid(force) && force >= 0.0f); - m_maxForce = force; -} - -float32 b2MotorJoint::GetMaxForce() const -{ - return m_maxForce; -} - -void b2MotorJoint::SetMaxTorque(float32 torque) -{ - b2Assert(b2IsValid(torque) && torque >= 0.0f); - m_maxTorque = torque; -} - -float32 b2MotorJoint::GetMaxTorque() const -{ - return m_maxTorque; -} - -void b2MotorJoint::SetLinearOffset(const b2Vec2& linearOffset) -{ - if (linearOffset.x != m_linearOffset.x || linearOffset.y != m_linearOffset.y) - { - m_bodyA->SetAwake(true); - m_bodyB->SetAwake(true); - m_linearOffset = linearOffset; - } -} - -const b2Vec2& b2MotorJoint::GetLinearOffset() const -{ - return m_linearOffset; -} - -void b2MotorJoint::SetAngularOffset(float32 angularOffset) -{ - if (angularOffset != m_angularOffset) - { - m_bodyA->SetAwake(true); - m_bodyB->SetAwake(true); - m_angularOffset = angularOffset; - } -} - -float32 b2MotorJoint::GetAngularOffset() const -{ - return m_angularOffset; -} - -void b2MotorJoint::Dump() -{ - int32 indexA = m_bodyA->m_islandIndex; - int32 indexB = m_bodyB->m_islandIndex; - - b2Log(" b2MotorJointDef jd;\n"); - b2Log(" jd.bodyA = bodies[%d];\n", indexA); - b2Log(" jd.bodyB = bodies[%d];\n", indexB); - b2Log(" jd.collideConnected = bool(%d);\n", m_collideConnected); - b2Log(" jd.linearOffset.Set(%.15lef, %.15lef);\n", m_linearOffset.x, m_linearOffset.y); - b2Log(" jd.angularOffset = %.15lef;\n", m_angularOffset); - b2Log(" jd.maxForce = %.15lef;\n", m_maxForce); - b2Log(" jd.maxTorque = %.15lef;\n", m_maxTorque); - b2Log(" jd.correctionFactor = %.15lef;\n", m_correctionFactor); - b2Log(" joints[%d] = m_world->CreateJoint(&jd);\n", m_index); -} diff --git a/src/CocosDenshion/CocosDenshion.m b/src/CocosDenshion/CocosDenshion.m deleted file mode 100644 index 3ddcfb7..0000000 --- a/src/CocosDenshion/CocosDenshion.m +++ /dev/null @@ -1,1601 +0,0 @@ -/* - Copyright (c) 2010 Steve Oldmeadow - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - - $Id$ - */ - -#import "CocosDenshion.h" - -ALvoid alBufferDataStaticProc(const ALint bid, ALenum format, ALvoid* data, ALsizei size, ALsizei freq); -ALvoid alcMacOSXMixerOutputRateProc(const ALdouble value); - - -typedef ALvoid AL_APIENTRY (*alBufferDataStaticProcPtr) (const ALint bid, ALenum format, ALvoid* data, ALsizei size, ALsizei freq); -ALvoid alBufferDataStaticProc(const ALint bid, ALenum format, ALvoid* data, ALsizei size, ALsizei freq) -{ - static alBufferDataStaticProcPtr proc = NULL; - - if (proc == NULL) { - proc = (alBufferDataStaticProcPtr) alcGetProcAddress(NULL, (const ALCchar*) "alBufferDataStatic"); - } - - if (proc) - proc(bid, format, data, size, freq); - - return; -} - -typedef ALvoid AL_APIENTRY (*alcMacOSXMixerOutputRateProcPtr) (const ALdouble value); -ALvoid alcMacOSXMixerOutputRateProc(const ALdouble value) -{ - static alcMacOSXMixerOutputRateProcPtr proc = NULL; - - if (proc == NULL) { - proc = (alcMacOSXMixerOutputRateProcPtr) alcGetProcAddress(NULL, (const ALCchar*) "alcMacOSXMixerOutputRate"); - } - - if (proc) - proc(value); - - return; -} - -NSString * const kCDN_BadAlContext = @"kCDN_BadAlContext"; -NSString * const kCDN_AsynchLoadComplete = @"kCDN_AsynchLoadComplete"; -float const kCD_PitchDefault = 1.0f; -float const kCD_PitchLowerOneOctave = 0.5f; -float const kCD_PitchHigherOneOctave = 2.0f; -float const kCD_PanDefault = 0.0f; -float const kCD_PanFullLeft = -1.0f; -float const kCD_PanFullRight = 1.0f; -float const kCD_GainDefault = 1.0f; - -@interface CDSoundEngine (PrivateMethods) --(BOOL) _initOpenAL; --(void) _testGetGain; --(void) _dumpSourceGroupsInfo; --(void) _getSourceIndexForSourceGroup; --(void) _freeSourceGroups; --(BOOL) _setUpSourceGroups:(int[]) definitions total:(NSUInteger) total; -@end - -#pragma mark - -#pragma mark CDUtilities - -@implementation CDUtilities - -+(NSString*) fullPathFromRelativePath:(NSString*) relPath -{ - // do not convert an absolute path (starting with '/') - if(([relPath length] > 0) && ([relPath characterAtIndex:0] == '/')) - { - return relPath; - } - - NSMutableArray *imagePathComponents = [NSMutableArray arrayWithArray:[relPath pathComponents]]; - NSString *file = [imagePathComponents lastObject]; - - [imagePathComponents removeLastObject]; - NSString *imageDirectory = [NSString pathWithComponents:imagePathComponents]; - - NSString *fullpath = [[NSBundle mainBundle] pathForResource:file ofType:nil inDirectory:imageDirectory]; - if (fullpath == nil) - fullpath = relPath; - - return fullpath; -} - -@end - -#pragma mark - -#pragma mark CDSoundEngine - -@implementation CDSoundEngine - -static Float32 _mixerSampleRate; -static BOOL _mixerRateSet = NO; - -@synthesize lastErrorCode = lastErrorCode_; -@synthesize functioning = functioning_; -@synthesize asynchLoadProgress = asynchLoadProgress_; -@synthesize getGainWorks = getGainWorks_; -@synthesize sourceTotal = sourceTotal_; - -+ (void) setMixerSampleRate:(Float32) sampleRate { - _mixerRateSet = YES; - _mixerSampleRate = sampleRate; -} - -- (void) _testGetGain { - float testValue = 0.7f; - ALuint testSourceId = _sources[0].sourceId; - alSourcef(testSourceId, AL_GAIN, 0.0f);//Start from know value - alSourcef(testSourceId, AL_GAIN, testValue); - ALfloat gainVal; - alGetSourcef(testSourceId, AL_GAIN, &gainVal); - getGainWorks_ = (gainVal == testValue); -} - -//Generate sources one at a time until we fail --(void) _generateSources { - - _sources = (sourceInfo*)malloc( sizeof(_sources[0]) * CD_SOURCE_LIMIT); - BOOL hasFailed = NO; - sourceTotal_ = 0; - alGetError();//Clear error - while (!hasFailed && sourceTotal_ < CD_SOURCE_LIMIT) { - alGenSources(1, &(_sources[sourceTotal_].sourceId)); - if (alGetError() == AL_NO_ERROR) { - //Now try attaching source to null buffer - alSourcei(_sources[sourceTotal_].sourceId, AL_BUFFER, 0); - if (alGetError() == AL_NO_ERROR) { - _sources[sourceTotal_].usable = true; - sourceTotal_++; - } else { - hasFailed = YES; - } - } else { - _sources[sourceTotal_].usable = false; - hasFailed = YES; - } - } - //Mark the rest of the sources as not usable - for (int i=sourceTotal_; i < CD_SOURCE_LIMIT; i++) { - _sources[i].usable = false; - } -} - --(void) _generateBuffers:(int) startIndex endIndex:(int) endIndex { - if (_buffers) { - alGetError(); - for (int i=startIndex; i <= endIndex; i++) { - alGenBuffers(1, &_buffers[i].bufferId); - _buffers[i].bufferData = NULL; - if (alGetError() == AL_NO_ERROR) { - _buffers[i].bufferState = CD_BS_EMPTY; - } else { - _buffers[i].bufferState = CD_BS_FAILED; - CDLOG(@"Denshion::CDSoundEngine - buffer creation failed %i",i); - } - } - } -} - -/** - * Internal method called during init - */ -- (BOOL) _initOpenAL -{ - //ALenum error; - context = NULL; - ALCdevice *newDevice = NULL; - - //Set the mixer rate for the audio mixer - if (!_mixerRateSet) { - _mixerSampleRate = CD_SAMPLE_RATE_DEFAULT; - } - alcMacOSXMixerOutputRateProc(_mixerSampleRate); - CDLOGINFO(@"Denshion::CDSoundEngine - mixer output rate set to %0.2f",_mixerSampleRate); - - // Create a new OpenAL Device - // Pass NULL to specify the system's default output device - newDevice = alcOpenDevice(NULL); - if (newDevice != NULL) - { - // Create a new OpenAL Context - // The new context will render to the OpenAL Device just created - context = alcCreateContext(newDevice, 0); - if (context != NULL) - { - // Make the new context the Current OpenAL Context - alcMakeContextCurrent(context); - - // Create some OpenAL Buffer Objects - [self _generateBuffers:0 endIndex:bufferTotal-1]; - - // Create some OpenAL Source Objects - [self _generateSources]; - - } - } else { - return FALSE;//No device - } - alGetError();//Clear error - return TRUE; -} - -- (void) dealloc { - - ALCcontext *currentContext = NULL; - ALCdevice *device = NULL; - - [self stopAllSounds]; - - CDLOGINFO(@"Denshion::CDSoundEngine - Deallocing sound engine."); - [self _freeSourceGroups]; - - // Delete the Sources - CDLOGINFO(@"Denshion::CDSoundEngine - deleting sources."); - for (int i=0; i < sourceTotal_; i++) { - alSourcei(_sources[i].sourceId, AL_BUFFER, 0);//Detach from current buffer - alDeleteSources(1, &(_sources[i].sourceId)); - if((lastErrorCode_ = alGetError()) != AL_NO_ERROR) { - CDLOG(@"Denshion::CDSoundEngine - Error deleting source! %x\n", lastErrorCode_); - } - } - - // Delete the Buffers - CDLOGINFO(@"Denshion::CDSoundEngine - deleting buffers."); - for (int i=0; i < bufferTotal; i++) { - alDeleteBuffers(1, &_buffers[i].bufferId); -#ifdef CD_USE_STATIC_BUFFERS - if (_buffers[i].bufferData) { - free(_buffers[i].bufferData); - } -#endif - } - CDLOGINFO(@"Denshion::CDSoundEngine - free buffers."); - free(_buffers); - currentContext = alcGetCurrentContext(); - //Get device for active context - device = alcGetContextsDevice(currentContext); - //Release context - CDLOGINFO(@"Denshion::CDSoundEngine - destroy context."); - alcDestroyContext(currentContext); - //Close device - CDLOGINFO(@"Denshion::CDSoundEngine - close device."); - alcCloseDevice(device); - CDLOGINFO(@"Denshion::CDSoundEngine - free sources."); - free(_sources); - - //Release mutexes - [_mutexBufferLoad release]; - - [super dealloc]; -} - --(NSUInteger) sourceGroupTotal { - return _sourceGroupTotal; -} - --(void) _freeSourceGroups -{ - CDLOGINFO(@"Denshion::CDSoundEngine freeing source groups"); - if(_sourceGroups) { - for (int i=0; i < _sourceGroupTotal; i++) { - if (_sourceGroups[i].sourceStatuses) { - free(_sourceGroups[i].sourceStatuses); - CDLOGINFO(@"Denshion::CDSoundEngine freed source statuses %i",i); - } - } - free(_sourceGroups); - } -} - --(BOOL) _redefineSourceGroups:(int[]) definitions total:(NSUInteger) total -{ - if (_sourceGroups) { - //Stop all sounds - [self stopAllSounds]; - //Need to free source groups - [self _freeSourceGroups]; - } - return [self _setUpSourceGroups:definitions total:total]; -} - --(BOOL) _setUpSourceGroups:(int[]) definitions total:(NSUInteger) total -{ - _sourceGroups = (sourceGroup *)malloc( sizeof(_sourceGroups[0]) * total); - if(!_sourceGroups) { - CDLOG(@"Denshion::CDSoundEngine - source groups memory allocation failed"); - return NO; - } - - _sourceGroupTotal = total; - int sourceCount = 0; - for (int i=0; i < _sourceGroupTotal; i++) { - - _sourceGroups[i].startIndex = 0; - _sourceGroups[i].currentIndex = _sourceGroups[i].startIndex; - _sourceGroups[i].enabled = false; - _sourceGroups[i].nonInterruptible = false; - _sourceGroups[i].totalSources = definitions[i]; - _sourceGroups[i].sourceStatuses = malloc(sizeof(_sourceGroups[i].sourceStatuses[0]) * _sourceGroups[i].totalSources); - if (_sourceGroups[i].sourceStatuses) { - for (int j=0; j < _sourceGroups[i].totalSources; j++) { - //First bit is used to indicate whether source is locked, index is shifted back 1 bit - _sourceGroups[i].sourceStatuses[j] = (sourceCount + j) << 1; - } - } - sourceCount += definitions[i]; - } - return YES; -} - --(void) defineSourceGroups:(int[]) sourceGroupDefinitions total:(NSUInteger) total { - [self _redefineSourceGroups:sourceGroupDefinitions total:total]; -} - --(void) defineSourceGroups:(NSArray*) sourceGroupDefinitions { - CDLOGINFO(@"Denshion::CDSoundEngine - source groups defined by NSArray."); - NSUInteger totalDefs = [sourceGroupDefinitions count]; - int* defs = (int *)malloc( sizeof(int) * totalDefs); - int currentIndex = 0; - for (id currentDef in sourceGroupDefinitions) { - if ([currentDef isKindOfClass:[NSNumber class]]) { - defs[currentIndex] = (int)[(NSNumber*)currentDef integerValue]; - CDLOGINFO(@"Denshion::CDSoundEngine - found definition %i.",defs[currentIndex]); - } else { - CDLOG(@"Denshion::CDSoundEngine - warning, did not understand source definition."); - defs[currentIndex] = 0; - } - currentIndex++; - } - [self _redefineSourceGroups:defs total:totalDefs]; - free(defs); -} - -- (id)init -{ - if ((self = [super init])) { - - //Create mutexes - _mutexBufferLoad = [[NSObject alloc] init]; - - asynchLoadProgress_ = 0.0f; - - bufferTotal = CD_BUFFERS_START; - _buffers = (bufferInfo *)malloc( sizeof(_buffers[0]) * bufferTotal); - - // Initialize our OpenAL environment - if ([self _initOpenAL]) { - //Set up the default source group - a single group that contains all the sources - int sourceDefs[1]; - sourceDefs[0] = self.sourceTotal; - [self _setUpSourceGroups:sourceDefs total:1]; - - functioning_ = YES; - //Synchronize premute gain - _preMuteGain = self.masterGain; - mute_ = NO; - enabled_ = YES; - //Test whether get gain works for sources - [self _testGetGain]; - } else { - //Something went wrong with OpenAL - functioning_ = NO; - } - } - - return self; -} - -/** - * Delete the buffer identified by soundId - * @return true if buffer deleted successfully, otherwise false - */ -- (BOOL) unloadBuffer:(int) soundId -{ - //Ensure soundId is within array bounds otherwise memory corruption will occur - if (soundId < 0 || soundId >= bufferTotal) { - CDLOG(@"Denshion::CDSoundEngine - soundId is outside array bounds, maybe you need to increase CD_MAX_BUFFERS"); - return FALSE; - } - - //Before a buffer can be deleted any sources that are attached to it must be stopped - for (int i=0; i < sourceTotal_; i++) { - //Note: tried getting the AL_BUFFER attribute of the source instead but doesn't - //appear to work on a device - just returned zero. - if (_buffers[soundId].bufferId == _sources[i].attachedBufferId) { - - CDLOG(@"Denshion::CDSoundEngine - Found attached source %i %i %i",i,_buffers[soundId].bufferId,_sources[i].sourceId); -#ifdef CD_USE_STATIC_BUFFERS - //When using static buffers a crash may occur if a source is playing with a buffer that is about - //to be deleted even though we stop the source and successfully delete the buffer. Crash is confirmed - //on 2.2.1 and 3.1.2, however, it will only occur if a source is used rapidly after having its prior - //data deleted. To avoid any possibility of the crash we wait for the source to finish playing. - ALint state; - - alGetSourcei(_sources[i].sourceId, AL_SOURCE_STATE, &state); - - if (state == AL_PLAYING) { - CDLOG(@"Denshion::CDSoundEngine - waiting for source to complete playing before removing buffer data"); - alSourcei(_sources[i].sourceId, AL_LOOPING, FALSE);//Turn off looping otherwise loops will never end - while (state == AL_PLAYING) { - alGetSourcei(_sources[i].sourceId, AL_SOURCE_STATE, &state); - usleep(10000); - } - } -#endif - //Stop source and detach - alSourceStop(_sources[i].sourceId); - if((lastErrorCode_ = alGetError()) != AL_NO_ERROR) { - CDLOG(@"Denshion::CDSoundEngine - error stopping source: %x\n", lastErrorCode_); - } - - alSourcei(_sources[i].sourceId, AL_BUFFER, 0);//Attach to "NULL" buffer to detach - if((lastErrorCode_ = alGetError()) != AL_NO_ERROR) { - CDLOG(@"Denshion::CDSoundEngine - error detaching buffer: %x\n", lastErrorCode_); - } else { - //Record that source is now attached to nothing - _sources[i].attachedBufferId = 0; - } - } - } - - alDeleteBuffers(1, &_buffers[soundId].bufferId); - if((lastErrorCode_ = alGetError()) != AL_NO_ERROR) { - CDLOG(@"Denshion::CDSoundEngine - error deleting buffer: %x\n", lastErrorCode_); - _buffers[soundId].bufferState = CD_BS_FAILED; - return FALSE; - } else { -#ifdef CD_USE_STATIC_BUFFERS - //Free previous data, if alDeleteBuffer has returned without error then no - if (_buffers[soundId].bufferData) { - CDLOGINFO(@"Denshion::CDSoundEngine - freeing static data for soundId %i @ %i",soundId,_buffers[soundId].bufferData); - free(_buffers[soundId].bufferData);//Free the old data - _buffers[soundId].bufferData = NULL; - } -#endif - } - - alGenBuffers(1, &_buffers[soundId].bufferId); - if((lastErrorCode_ = alGetError()) != AL_NO_ERROR) { - CDLOG(@"Denshion::CDSoundEngine - error regenerating buffer: %x\n", lastErrorCode_); - _buffers[soundId].bufferState = CD_BS_FAILED; - return FALSE; - } else { - //We now have an empty buffer - _buffers[soundId].bufferState = CD_BS_EMPTY; - CDLOGINFO(@"Denshion::CDSoundEngine - buffer %i successfully unloaded\n",soundId); - return TRUE; - } -} - -/** - * Load buffers asynchronously - * Check asynchLoadProgress for progress. asynchLoadProgress represents fraction of completion. When it equals 1.0 loading - * is complete. NB: asynchLoadProgress is simply based on the number of load requests, it does not take into account - * file sizes. - * @param An array of CDBufferLoadRequest objects - */ -- (void) loadBuffersAsynchronously:(NSArray *) loadRequests { - @synchronized(self) { - asynchLoadProgress_ = 0.0f; - CDAsynchBufferLoader *loaderOp = [[[CDAsynchBufferLoader alloc] init:loadRequests soundEngine:self] autorelease]; - NSOperationQueue *opQ = [[[NSOperationQueue alloc] init] autorelease]; - [opQ addOperation:loaderOp]; - } -} - --(BOOL) _resizeBuffers:(int) increment { - - void * tmpBufferInfos = realloc( _buffers, sizeof(_buffers[0]) * (bufferTotal + increment) ); - - if(!tmpBufferInfos) { - free(tmpBufferInfos); - return NO; - } else { - _buffers = tmpBufferInfos; - int oldBufferTotal = bufferTotal; - bufferTotal = bufferTotal + increment; - [self _generateBuffers:oldBufferTotal endIndex:bufferTotal-1]; - return YES; - } -} - --(BOOL) loadBufferFromData:(int) soundId soundData:(ALvoid*) soundData format:(ALenum) format size:(ALsizei) size freq:(ALsizei) freq { - - @synchronized(_mutexBufferLoad) { - - if (!functioning_) { - //OpenAL initialisation has previously failed - CDLOG(@"Denshion::CDSoundEngine - Loading buffer failed because sound engine state != functioning"); - return FALSE; - } - - //Ensure soundId is within array bounds otherwise memory corruption will occur - if (soundId < 0) { - CDLOG(@"Denshion::CDSoundEngine - soundId is negative"); - return FALSE; - } - - if (soundId >= bufferTotal) { - //Need to resize the buffers - int requiredIncrement = CD_BUFFERS_INCREMENT; - while (bufferTotal + requiredIncrement <= soundId) { - requiredIncrement += CD_BUFFERS_INCREMENT; - } - CDLOGINFO(@"Denshion::CDSoundEngine - attempting to resize buffers by %i for sound %i",requiredIncrement,soundId); - if (![self _resizeBuffers:requiredIncrement]) { - CDLOG(@"Denshion::CDSoundEngine - buffer resize failed"); - return FALSE; - } - } - - if (soundData) - { - if (_buffers[soundId].bufferState != CD_BS_EMPTY) { - CDLOGINFO(@"Denshion::CDSoundEngine - non empty buffer, regenerating"); - if (![self unloadBuffer:soundId]) { - //Deletion of buffer failed, delete buffer routine has set buffer state and lastErrorCode - return NO; - } - } - -#ifdef CD_DEBUG - //Check that sample rate matches mixer rate and warn if they do not - if (freq != (int)_mixerSampleRate) { - CDLOGINFO(@"Denshion::CDSoundEngine - WARNING sample rate does not match mixer sample rate performance may not be optimal."); - } -#endif - -#ifdef CD_USE_STATIC_BUFFERS - alBufferDataStaticProc(_buffers[soundId].bufferId, format, soundData, size, freq); - _buffers[soundId].bufferData = data;//Save the pointer to the new data -#else - alBufferData(_buffers[soundId].bufferId, format, soundData, size, freq); -#endif - if((lastErrorCode_ = alGetError()) != AL_NO_ERROR) { - CDLOG(@"Denshion::CDSoundEngine - error attaching audio to buffer: %x", lastErrorCode_); - _buffers[soundId].bufferState = CD_BS_FAILED; - return FALSE; - } - } else { - CDLOG(@"Denshion::CDSoundEngine Buffer data is null!"); - _buffers[soundId].bufferState = CD_BS_FAILED; - return FALSE; - } - - _buffers[soundId].format = format; - _buffers[soundId].sizeInBytes = size; - _buffers[soundId].frequencyInHertz = freq; - _buffers[soundId].bufferState = CD_BS_LOADED; - CDLOGINFO(@"Denshion::CDSoundEngine Buffer %i loaded format:%i freq:%i size:%i",soundId,format,freq,size); - return TRUE; - }//end mutex -} - -/** - * Load sound data for later play back. - * @return TRUE if buffer loaded okay for play back otherwise false - */ -- (BOOL) loadBuffer:(int) soundId filePath:(NSString*) filePath -{ - - ALvoid* data; - ALenum format; - ALsizei size; - ALsizei freq; - - CDLOGINFO(@"Denshion::CDSoundEngine - Loading openAL buffer %i %@", soundId, filePath); - - CFURLRef fileURL = nil; - NSString *path = [CDUtilities fullPathFromRelativePath:filePath]; - if (path) { - fileURL = (CFURLRef)[[NSURL fileURLWithPath:path] retain]; - } - - if (fileURL) - { - data = CDGetOpenALAudioData(fileURL, &size, &format, &freq); - CFRelease(fileURL); - BOOL result = [self loadBufferFromData:soundId soundData:data format:format size:size freq:freq]; -#ifndef CD_USE_STATIC_BUFFERS - free(data);//Data can be freed here because alBufferData performs a memcpy -#endif - return result; - } else { - CDLOG(@"Denshion::CDSoundEngine Could not find file!\n"); - //Don't change buffer state here as it will be the same as before method was called - return FALSE; - } -} - --(BOOL) validateBufferId:(int) soundId { - if (soundId < 0 || soundId >= bufferTotal) { - CDLOGINFO(@"Denshion::CDSoundEngine - validateBufferId buffer outside range %i",soundId); - return NO; - } else if (_buffers[soundId].bufferState != CD_BS_LOADED) { - CDLOGINFO(@"Denshion::CDSoundEngine - validateBufferId invalide buffer state %i",soundId); - return NO; - } else { - return YES; - } -} - --(float) bufferDurationInSeconds:(int) soundId { - if ([self validateBufferId:soundId]) { - float factor = 0.0f; - switch (_buffers[soundId].format) { - case AL_FORMAT_MONO8: - factor = 1.0f; - break; - case AL_FORMAT_MONO16: - factor = 0.5f; - break; - case AL_FORMAT_STEREO8: - factor = 0.5f; - break; - case AL_FORMAT_STEREO16: - factor = 0.25f; - break; - } - return (float)_buffers[soundId].sizeInBytes/(float)_buffers[soundId].frequencyInHertz * factor; - } else { - return -1.0f; - } -} - --(ALsizei) bufferSizeInBytes:(int) soundId { - if ([self validateBufferId:soundId]) { - return _buffers[soundId].sizeInBytes; - } else { - return -1.0f; - } -} - --(ALsizei) bufferFrequencyInHertz:(int) soundId { - if ([self validateBufferId:soundId]) { - return _buffers[soundId].frequencyInHertz; - } else { - return -1.0f; - } -} - -- (ALfloat) masterGain { - if (mute_) { - //When mute the real gain will always be 0 therefore return the preMuteGain value - return _preMuteGain; - } else { - ALfloat gain; - alGetListenerf(AL_GAIN, &gain); - return gain; - } -} - -/** - * Overall gain setting multiplier. e.g 0.5 is half the gain. - */ -- (void) setMasterGain:(ALfloat) newGainValue { - if (mute_) { - _preMuteGain = newGainValue; - } else { - alListenerf(AL_GAIN, newGainValue); - } -} - -#pragma mark CDSoundEngine AudioInterrupt protocol -- (BOOL) mute { - return mute_; -} - -/** - * Setting mute silences all sounds but playing sounds continue to advance playback - */ -- (void) setMute:(BOOL) newMuteValue { - - if (newMuteValue == mute_) { - return; - } - - mute_ = newMuteValue; - if (mute_) { - //Remember what the gain was - _preMuteGain = self.masterGain; - //Set gain to 0 - do not use the property as this will adjust preMuteGain when muted - alListenerf(AL_GAIN, 0.0f); - } else { - //Restore gain to what it was before being muted - self.masterGain = _preMuteGain; - } -} - -- (BOOL) enabled { - return enabled_; -} - -- (void) setEnabled:(BOOL)enabledValue -{ - if (enabled_ == enabledValue) { - return; - } - enabled_ = enabledValue; - if (enabled_ == NO) { - [self stopAllSounds]; - } -} - --(void) _lockSource:(int) sourceIndex lock:(BOOL) lock { - BOOL found = NO; - for (int i=0; i < _sourceGroupTotal && !found; i++) { - if (_sourceGroups[i].sourceStatuses) { - for (int j=0; j < _sourceGroups[i].totalSources && !found; j++) { - //First bit is used to indicate whether source is locked, index is shifted back 1 bit - if((_sourceGroups[i].sourceStatuses[j] >> 1)==sourceIndex) { - if (lock) { - //Set first bit to lock this source - _sourceGroups[i].sourceStatuses[j] |= 1; - } else { - //Unset first bit to unlock this source - _sourceGroups[i].sourceStatuses[j] &= ~1; - } - found = YES; - } - } - } - } -} - --(int) _getSourceIndexForSourceGroup:(int)sourceGroupId -{ - //Ensure source group id is valid to prevent memory corruption - if (sourceGroupId < 0 || sourceGroupId >= _sourceGroupTotal) { - CDLOG(@"Denshion::CDSoundEngine invalid source group id %i",sourceGroupId); - return CD_NO_SOURCE; - } - - int sourceIndex = -1;//Using -1 to indicate no source found - BOOL complete = NO; - ALint sourceState = 0; - sourceGroup *thisSourceGroup = &_sourceGroups[sourceGroupId]; - thisSourceGroup->currentIndex = thisSourceGroup->startIndex; - while (!complete) { - //Iterate over sources looking for one that is not locked, first bit indicates if source is locked - if ((thisSourceGroup->sourceStatuses[thisSourceGroup->currentIndex] & 1) == 0) { - //This source is not locked - sourceIndex = thisSourceGroup->sourceStatuses[thisSourceGroup->currentIndex] >> 1;//shift back to get the index - if (thisSourceGroup->nonInterruptible) { - //Check if this source is playing, if so it can't be interrupted - alGetSourcei(_sources[sourceIndex].sourceId, AL_SOURCE_STATE, &sourceState); - if (sourceState != AL_PLAYING) { - //complete = YES; - //Set start index so next search starts at the next position - thisSourceGroup->startIndex = thisSourceGroup->currentIndex + 1; - break; - } else { - sourceIndex = -1;//The source index was no good because the source was playing - } - } else { - //complete = YES; - //Set start index so next search starts at the next position - thisSourceGroup->startIndex = thisSourceGroup->currentIndex + 1; - break; - } - } - thisSourceGroup->currentIndex++; - if (thisSourceGroup->currentIndex >= thisSourceGroup->totalSources) { - //Reset to the beginning - thisSourceGroup->currentIndex = 0; - } - if (thisSourceGroup->currentIndex == thisSourceGroup->startIndex) { - //We have looped around and got back to the start - complete = YES; - } - } - - //Reset start index to beginning if beyond bounds - if (thisSourceGroup->startIndex >= thisSourceGroup->totalSources) { - thisSourceGroup->startIndex = 0; - } - - if (sourceIndex >= 0) { - return sourceIndex; - } else { - return CD_NO_SOURCE; - } - -} - -/** - * Play a sound. - * @param soundId the id of the sound to play (buffer id). - * @param SourceGroupId the source group that will be used to play the sound. - * @param pitch pitch multiplier. e.g 1.0 is unaltered, 0.5 is 1 octave lower. - * @param pan stereo position. -1 is fully left, 0 is centre and 1 is fully right. - * @param gain gain multiplier. e.g. 1.0 is unaltered, 0.5 is half the gain - * @param loop should the sound be looped or one shot. - * @return the id of the source being used to play the sound or CD_MUTE if the sound engine is muted or non functioning - * or CD_NO_SOURCE if a problem occurs setting up the source - * - */ -- (ALuint)playSound:(int) soundId sourceGroupId:(int)sourceGroupId pitch:(float) pitch pan:(float) pan gain:(float) gain loop:(BOOL) loop { - -#ifdef CD_DEBUG - //Sanity check parameters - only in DEBUG - NSAssert(soundId >= 0, @"soundId can not be negative"); - NSAssert(soundId < bufferTotal, @"soundId exceeds limit"); - NSAssert(sourceGroupId >= 0, @"sourceGroupId can not be negative"); - NSAssert(sourceGroupId < _sourceGroupTotal, @"sourceGroupId exceeds limit"); - NSAssert(pitch > 0, @"pitch must be greater than zero"); - NSAssert(pan >= -1 && pan <= 1, @"pan must be between -1 and 1"); - NSAssert(gain >= 0, @"gain can not be negative"); -#endif - //If mute or initialisation has failed or buffer is not loaded then do nothing - if (!enabled_ || !functioning_ || _buffers[soundId].bufferState != CD_BS_LOADED || _sourceGroups[sourceGroupId].enabled) { -#ifdef CD_DEBUG - if (!functioning_) { - CDLOGINFO(@"Denshion::CDSoundEngine - sound playback aborted because sound engine is not functioning"); - } else if (_buffers[soundId].bufferState != CD_BS_LOADED) { - CDLOGINFO(@"Denshion::CDSoundEngine - sound playback aborted because buffer %i is not loaded", soundId); - } -#endif - return CD_MUTE; - } - - int sourceIndex = [self _getSourceIndexForSourceGroup:sourceGroupId];//This method ensures sourceIndex is valid - - if (sourceIndex != CD_NO_SOURCE) { - ALint state; - ALuint source = _sources[sourceIndex].sourceId; - ALuint buffer = _buffers[soundId].bufferId; - alGetError();//Clear the error code - alGetSourcei(source, AL_SOURCE_STATE, &state); - if (state == AL_PLAYING) { - alSourceStop(source); - } - alSourcei(source, AL_BUFFER, buffer);//Attach to sound - alSourcef(source, AL_PITCH, pitch);//Set pitch - alSourcei(source, AL_LOOPING, loop);//Set looping - alSourcef(source, AL_GAIN, gain);//Set gain/volume - float sourcePosAL[] = {pan, 0.0f, 0.0f};//Set position - just using left and right panning - alSourcefv(source, AL_POSITION, sourcePosAL); - alGetError();//Clear the error code - alSourcePlay(source); - if((lastErrorCode_ = alGetError()) == AL_NO_ERROR) { - //Everything was okay - _sources[sourceIndex].attachedBufferId = buffer; - return source; - } else { - if (alcGetCurrentContext() == NULL) { - CDLOGINFO(@"Denshion::CDSoundEngine - posting bad OpenAL context message"); - [[NSNotificationCenter defaultCenter] postNotificationName:kCDN_BadAlContext object:nil]; - } - return CD_NO_SOURCE; - } - } else { - return CD_NO_SOURCE; - } -} - --(BOOL) _soundSourceAttachToBuffer:(CDSoundSource*) soundSource soundId:(int) soundId { - //Attach the source to the buffer - ALint state; - ALuint source = soundSource->_sourceId; - ALuint buffer = _buffers[soundId].bufferId; - alGetSourcei(source, AL_SOURCE_STATE, &state); - if (state == AL_PLAYING) { - alSourceStop(source); - } - alGetError();//Clear the error code - alSourcei(source, AL_BUFFER, buffer);//Attach to sound data - if((lastErrorCode_ = alGetError()) == AL_NO_ERROR) { - _sources[soundSource->_sourceIndex].attachedBufferId = buffer; - //_sourceBufferAttachments[soundSource->_sourceIndex] = buffer;//Keep track of which - soundSource->_soundId = soundId; - return YES; - } else { - return NO; - } -} - -/** - * Get a sound source for the specified sound in the specified source group - */ --(CDSoundSource *) soundSourceForSound:(int) soundId sourceGroupId:(int) sourceGroupId -{ - if (!functioning_) { - return nil; - } - //Check if a source is available - int sourceIndex = [self _getSourceIndexForSourceGroup:sourceGroupId]; - if (sourceIndex != CD_NO_SOURCE) { - CDSoundSource *result = [[CDSoundSource alloc] init:_sources[sourceIndex].sourceId sourceIndex:sourceIndex soundEngine:self]; - [self _lockSource:sourceIndex lock:YES]; - //Try to attach to the buffer - if ([self _soundSourceAttachToBuffer:result soundId:soundId]) { - //Set to a known state - result.pitch = 1.0f; - result.pan = 0.0f; - result.gain = 1.0f; - result.looping = NO; - return [result autorelease]; - } else { - //Release the sound source we just created, this will also unlock the source - [result release]; - return nil; - } - } else { - //No available source within that source group - return nil; - } -} - --(void) _soundSourcePreRelease:(CDSoundSource *) soundSource { - CDLOGINFO(@"Denshion::CDSoundEngine _soundSourcePreRelease %i",soundSource->_sourceIndex); - //Unlock the sound source's source - [self _lockSource:soundSource->_sourceIndex lock:NO]; -} - -/** - * Stop all sounds playing within a source group - */ -- (void) stopSourceGroup:(int) sourceGroupId { - - if (!functioning_ || sourceGroupId >= _sourceGroupTotal || sourceGroupId < 0) { - return; - } - int sourceCount = _sourceGroups[sourceGroupId].totalSources; - for (int i=0; i < sourceCount; i++) { - int sourceIndex = _sourceGroups[sourceGroupId].sourceStatuses[i] >> 1; - alSourceStop(_sources[sourceIndex].sourceId); - } - alGetError();//Clear error in case we stopped any sounds that couldn't be stopped -} - -/** - * Stop a sound playing. - * @param sourceId an OpenAL source identifier i.e. the return value of playSound - */ -- (void)stopSound:(ALuint) sourceId { - if (!functioning_) { - return; - } - alSourceStop(sourceId); - alGetError();//Clear error in case we stopped any sounds that couldn't be stopped -} - -- (void) stopAllSounds { - for (int i=0; i < sourceTotal_; i++) { - alSourceStop(_sources[i].sourceId); - } - alGetError();//Clear error in case we stopped any sounds that couldn't be stopped -} - -/** - * Set a source group as non interruptible. Default is that source groups are interruptible. - * Non interruptible means that if a request to play a sound is made for a source group and there are - * no free sources available then the play request will be ignored and CD_NO_SOURCE will be returned. - */ -- (void) setSourceGroupNonInterruptible:(int) sourceGroupId isNonInterruptible:(BOOL) isNonInterruptible { - //Ensure source group id is valid to prevent memory corruption - if (sourceGroupId < 0 || sourceGroupId >= _sourceGroupTotal) { - CDLOG(@"Denshion::CDSoundEngine setSourceGroupNonInterruptible invalid source group id %i",sourceGroupId); - return; - } - - if (isNonInterruptible) { - _sourceGroups[sourceGroupId].nonInterruptible = true; - } else { - _sourceGroups[sourceGroupId].nonInterruptible = false; - } -} - -/** - * Set the mute property for a source group. If mute is turned on any sounds in that source group - * will be stopped and further sounds in that source group will play. However, turning mute off - * will not restart any sounds that were playing when mute was turned on. Also the mute setting - * for the sound engine must be taken into account. If the sound engine is mute no sounds will play - * no matter what the source group mute setting is. - */ -- (void) setSourceGroupEnabled:(int) sourceGroupId enabled:(BOOL) enabled { - //Ensure source group id is valid to prevent memory corruption - if (sourceGroupId < 0 || sourceGroupId >= _sourceGroupTotal) { - CDLOG(@"Denshion::CDSoundEngine setSourceGroupEnabled invalid source group id %i",sourceGroupId); - return; - } - - if (enabled) { - _sourceGroups[sourceGroupId].enabled = true; - [self stopSourceGroup:sourceGroupId]; - } else { - _sourceGroups[sourceGroupId].enabled = false; - } -} - -/** - * Return the mute property for the source group identified by sourceGroupId - */ -- (BOOL) sourceGroupEnabled:(int) sourceGroupId { - return _sourceGroups[sourceGroupId].enabled; -} - --(ALCcontext *) openALContext { - return context; -} - -- (void) _dumpSourceGroupsInfo { -#ifdef CD_DEBUG - CDLOGINFO(@"-------------- source Group Info --------------"); - for (int i=0; i < _sourceGroupTotal; i++) { - CDLOGINFO(@"Group: %i start:%i total:%i",i,_sourceGroups[i].startIndex, _sourceGroups[i].totalSources); - CDLOGINFO(@"----- mute:%i nonInterruptible:%i",_sourceGroups[i].enabled, _sourceGroups[i].nonInterruptible); - CDLOGINFO(@"----- Source statuses ----"); - for (int j=0; j < _sourceGroups[i].totalSources; j++) { - CDLOGINFO(@"Source status:%i index=%i locked=%i",j,_sourceGroups[i].sourceStatuses[j] >> 1, _sourceGroups[i].sourceStatuses[j] & 1); - } - } -#endif -} - -@end - -/////////////////////////////////////////////////////////////////////////////////////// -@implementation CDSoundSource - -@synthesize lastError; - -//Macro for handling the al error code -#define CDSOUNDSOURCE_UPDATE_LAST_ERROR (lastError = alGetError()) -#define CDSOUNDSOURCE_ERROR_HANDLER ( CDSOUNDSOURCE_UPDATE_LAST_ERROR == AL_NO_ERROR) - --(id)init:(ALuint) theSourceId sourceIndex:(int) index soundEngine:(CDSoundEngine*) engine { - if ((self = [super init])) { - _sourceId = theSourceId; - _engine = engine; - _sourceIndex = index; - enabled_ = YES; - mute_ = NO; - _preMuteGain = self.gain; - } - return self; -} - --(void) dealloc -{ - CDLOGINFO(@"Denshion::CDSoundSource deallocated %i",self->_sourceIndex); - - //Notify sound engine we are about to release - [_engine _soundSourcePreRelease:self]; - [super dealloc]; -} - -- (void) setPitch:(float) newPitchValue { - alSourcef(_sourceId, AL_PITCH, newPitchValue); - CDSOUNDSOURCE_UPDATE_LAST_ERROR; -} - -- (void) setGain:(float) newGainValue { - if (!mute_) { - alSourcef(_sourceId, AL_GAIN, newGainValue); - } else { - _preMuteGain = newGainValue; - } - CDSOUNDSOURCE_UPDATE_LAST_ERROR; -} - -- (void) setPan:(float) newPanValue { - float sourcePosAL[] = {newPanValue, 0.0f, 0.0f};//Set position - just using left and right panning - alSourcefv(_sourceId, AL_POSITION, sourcePosAL); - CDSOUNDSOURCE_UPDATE_LAST_ERROR; - -} - -- (void) setLooping:(BOOL) newLoopingValue { - alSourcei(_sourceId, AL_LOOPING, newLoopingValue); - CDSOUNDSOURCE_UPDATE_LAST_ERROR; - -} - -- (BOOL) isPlaying { - ALint state; - alGetSourcei(_sourceId, AL_SOURCE_STATE, &state); - CDSOUNDSOURCE_UPDATE_LAST_ERROR; - return (state == AL_PLAYING); -} - -- (float) pitch { - ALfloat pitchVal; - alGetSourcef(_sourceId, AL_PITCH, &pitchVal); - CDSOUNDSOURCE_UPDATE_LAST_ERROR; - return pitchVal; -} - -- (float) pan { - ALfloat sourcePosAL[] = {0.0f,0.0f,0.0f}; - alGetSourcefv(_sourceId, AL_POSITION, sourcePosAL); - CDSOUNDSOURCE_UPDATE_LAST_ERROR; - return sourcePosAL[0]; -} - -- (float) gain { - if (!mute_) { - ALfloat val; - alGetSourcef(_sourceId, AL_GAIN, &val); - CDSOUNDSOURCE_UPDATE_LAST_ERROR; - return val; - } else { - return _preMuteGain; - } -} - -- (BOOL) looping { - ALfloat val; - alGetSourcef(_sourceId, AL_LOOPING, &val); - CDSOUNDSOURCE_UPDATE_LAST_ERROR; - return val; -} - --(BOOL) stop { - alSourceStop(_sourceId); - return CDSOUNDSOURCE_ERROR_HANDLER; -} - --(BOOL) play { - if (enabled_) { - alSourcePlay(_sourceId); - CDSOUNDSOURCE_UPDATE_LAST_ERROR; - if (lastError != AL_NO_ERROR) { - if (alcGetCurrentContext() == NULL) { - CDLOGINFO(@"Denshion::CDSoundSource - posting bad OpenAL context message"); - [[NSNotificationCenter defaultCenter] postNotificationName:kCDN_BadAlContext object:nil]; - } - return NO; - } else { - return YES; - } - } else { - return NO; - } -} - --(BOOL) pause { - alSourcePause(_sourceId); - return CDSOUNDSOURCE_ERROR_HANDLER; -} - --(BOOL) rewind { - alSourceRewind(_sourceId); - return CDSOUNDSOURCE_ERROR_HANDLER; -} - --(void) setSoundId:(int) soundId { - [_engine _soundSourceAttachToBuffer:self soundId:soundId]; -} - --(int) soundId { - return _soundId; -} - --(float) durationInSeconds { - return [_engine bufferDurationInSeconds:_soundId]; -} - -#pragma mark CDSoundSource AudioInterrupt protocol -- (BOOL) mute { - return mute_; -} - -/** - * Setting mute silences all sounds but playing sounds continue to advance playback - */ -- (void) setMute:(BOOL) newMuteValue { - - if (newMuteValue == mute_) { - return; - } - - if (newMuteValue) { - //Remember what the gain was - _preMuteGain = self.gain; - self.gain = 0.0f; - mute_ = newMuteValue;//Make sure this is done after setting the gain property as the setter behaves differently depending on mute value - } else { - //Restore gain to what it was before being muted - mute_ = newMuteValue; - self.gain = _preMuteGain; - } -} - -- (BOOL) enabled { - return enabled_; -} - -- (void) setEnabled:(BOOL)enabledValue -{ - if (enabled_ == enabledValue) { - return; - } - enabled_ = enabledValue; - if (enabled_ == NO) { - [self stop]; - } -} - -@end - -//////////////////////////////////////////////////////////////////////////// -#pragma mark - -#pragma mark CDAudioInterruptTargetGroup - -@implementation CDAudioInterruptTargetGroup - --(id) init { - if ((self = [super init])) { - children_ = [[NSMutableArray alloc] initWithCapacity:32]; - enabled_ = YES; - mute_ = NO; - } - return self; -} - --(void) addAudioInterruptTarget:(NSObject*) interruptibleTarget { - //Synchronize child with group settings; - [interruptibleTarget setMute:mute_]; - [interruptibleTarget setEnabled:enabled_]; - [children_ addObject:interruptibleTarget]; -} - --(void) removeAudioInterruptTarget:(NSObject*) interruptibleTarget { - [children_ removeObjectIdenticalTo:interruptibleTarget]; -} - -- (BOOL) mute { - return mute_; -} - -/** - * Setting mute silences all sounds but playing sounds continue to advance playback - */ -- (void) setMute:(BOOL) newMuteValue { - - if (newMuteValue == mute_) { - return; - } - - for (NSObject* target in children_) { - [target setMute:newMuteValue]; - } -} - -- (BOOL) enabled { - return enabled_; -} - -- (void) setEnabled:(BOOL)enabledValue -{ - if (enabledValue == enabled_) { - return; - } - - for (NSObject* target in children_) { - [target setEnabled:enabledValue]; - } -} - -@end - - - -//////////////////////////////////////////////////////////////////////////// - -#pragma mark - -#pragma mark CDAsynchBufferLoader - -@implementation CDAsynchBufferLoader - --(id) init:(NSArray *)loadRequests soundEngine:(CDSoundEngine *) theSoundEngine { - if ((self = [super init])) { - _loadRequests = loadRequests; - [_loadRequests retain]; - _soundEngine = theSoundEngine; - [_soundEngine retain]; - } - return self; -} - --(void) main { - CDLOGINFO(@"Denshion::CDAsynchBufferLoader - loading buffers"); - [super main]; - _soundEngine.asynchLoadProgress = 0.0f; - - if ([_loadRequests count] > 0) { - float increment = 1.0f / [_loadRequests count]; - //Iterate over load request and load - for (CDBufferLoadRequest *loadRequest in _loadRequests) { - [_soundEngine loadBuffer:loadRequest.soundId filePath:loadRequest.filePath]; - _soundEngine.asynchLoadProgress += increment; - } - } - - //Completed - _soundEngine.asynchLoadProgress = 1.0f; - [[NSNotificationCenter defaultCenter] postNotificationName:kCDN_AsynchLoadComplete object:nil]; - -} - --(void) dealloc { - [_loadRequests release]; - [_soundEngine release]; - [super dealloc]; -} - -@end - - -/////////////////////////////////////////////////////////////////////////////////////// -#pragma mark - -#pragma mark CDBufferLoadRequest - -@implementation CDBufferLoadRequest - -@synthesize filePath, soundId; - --(id) init:(int) theSoundId filePath:(const NSString *) theFilePath { - if ((self = [super init])) { - soundId = theSoundId; - filePath = [theFilePath copy]; - } - return self; -} - --(void) dealloc { - [filePath release]; - [super dealloc]; -} - -@end - -/////////////////////////////////////////////////////////////////////////////////////// -#pragma mark - -#pragma mark CDFloatInterpolator - -@implementation CDFloatInterpolator -@synthesize start,end,interpolationType; - --(float) interpolate:(float) t { - - if (t < 1.0f) { - switch (interpolationType) { - case kIT_Linear: - //Linear interpolation - return ((end - start) * t) + start; - - case kIT_SCurve: - //Cubic s curve t^2 * (3 - 2t) - return ((float)(t * t * (3.0 - (2.0 * t))) * (end - start)) + start; - - case kIT_Exponential: - //Formulas taken from EaseAction - if (end > start) { - //Fade in - float logDelta = (t==0) ? 0 : powf(2, 10 * (t/1 - 1)) - 1 * 0.001f; - return ((end - start) * logDelta) + start; - } else { - //Fade Out - float logDelta = (-powf(2, -10 * t/1) + 1); - return ((end - start) * logDelta) + start; - } - default: - return 0.0f; - } - } else { - return end; - } -} - --(id) init:(tCDInterpolationType) type startVal:(float) startVal endVal:(float) endVal { - if ((self = [super init])) { - start = startVal; - end = endVal; - interpolationType = type; - } - return self; -} - -@end - -/////////////////////////////////////////////////////////////////////////////////////// -#pragma mark - -#pragma mark CDPropertyModifier - -@implementation CDPropertyModifier - -@synthesize stopTargetWhenComplete; - --(id) init:(id) theTarget interpolationType:(tCDInterpolationType) type startVal:(float) startVal endVal:(float) endVal { - if ((self = [super init])) { - if (target) { - //Release the previous target if there is one - [target release]; - } - target = theTarget; -#if CD_DEBUG - //Check target is of the required type - if (![theTarget isMemberOfClass:[self _allowableType]] ) { - CDLOG(@"Denshion::CDPropertyModifier target is not of type %@",[self _allowableType]); - NSAssert([theTarget isKindOfClass:[CDSoundEngine class]], @"CDPropertyModifier target not of required type"); - } -#endif - [target retain]; - startValue = startVal; - endValue = endVal; - if (interpolator) { - //Release previous interpolator if there is one - [interpolator release]; - } - interpolator = [[CDFloatInterpolator alloc] init:type startVal:startVal endVal:endVal]; - stopTargetWhenComplete = NO; - } - return self; -} - --(void) dealloc { - CDLOGINFO(@"Denshion::CDPropertyModifier deallocated %@",self); - [target release]; - [interpolator release]; - [super dealloc]; -} - --(void) modify:(float) t { - if (t < 1.0) { - [self _setTargetProperty:[interpolator interpolate:t]]; - } else { - //At the end - [self _setTargetProperty:endValue]; - if (stopTargetWhenComplete) { - [self _stopTarget]; - } - } -} - --(float) startValue { - return startValue; -} - --(void) setStartValue:(float) startVal -{ - startValue = startVal; - interpolator.start = startVal; -} - --(float) endValue { - return startValue; -} - --(void) setEndValue:(float) endVal -{ - endValue = endVal; - interpolator.end = endVal; -} - --(tCDInterpolationType) interpolationType { - return interpolator.interpolationType; -} - --(void) setInterpolationType:(tCDInterpolationType) interpolationType { - interpolator.interpolationType = interpolationType; -} - --(void) _setTargetProperty:(float) newVal { - -} - --(float) _getTargetProperty { - return 0.0f; -} - --(void) _stopTarget { - -} - --(Class) _allowableType { - return [NSObject class]; -} -@end - -/////////////////////////////////////////////////////////////////////////////////////// -#pragma mark - -#pragma mark CDSoundSourceFader - -@implementation CDSoundSourceFader - --(void) _setTargetProperty:(float) newVal { - ((CDSoundSource*)target).gain = newVal; -} - --(float) _getTargetProperty { - return ((CDSoundSource*)target).gain; -} - --(void) _stopTarget { - [((CDSoundSource*)target) stop]; -} - --(Class) _allowableType { - return [CDSoundSource class]; -} - -@end - -/////////////////////////////////////////////////////////////////////////////////////// -#pragma mark - -#pragma mark CDSoundSourcePanner - -@implementation CDSoundSourcePanner - --(void) _setTargetProperty:(float) newVal { - ((CDSoundSource*)target).pan = newVal; -} - --(float) _getTargetProperty { - return ((CDSoundSource*)target).pan; -} - --(void) _stopTarget { - [((CDSoundSource*)target) stop]; -} - --(Class) _allowableType { - return [CDSoundSource class]; -} - -@end - -/////////////////////////////////////////////////////////////////////////////////////// -#pragma mark - -#pragma mark CDSoundSourcePitchBender - -@implementation CDSoundSourcePitchBender - --(void) _setTargetProperty:(float) newVal { - ((CDSoundSource*)target).pitch = newVal; -} - --(float) _getTargetProperty { - return ((CDSoundSource*)target).pitch; -} - --(void) _stopTarget { - [((CDSoundSource*)target) stop]; -} - --(Class) _allowableType { - return [CDSoundSource class]; -} - -@end - -/////////////////////////////////////////////////////////////////////////////////////// -#pragma mark - -#pragma mark CDSoundEngineFader - -@implementation CDSoundEngineFader - --(void) _setTargetProperty:(float) newVal { - ((CDSoundEngine*)target).masterGain = newVal; -} - --(float) _getTargetProperty { - return ((CDSoundEngine*)target).masterGain; -} - --(void) _stopTarget { - [((CDSoundEngine*)target) stopAllSounds]; -} - --(Class) _allowableType { - return [CDSoundEngine class]; -} - -@end - - diff --git a/src/cocos2d/CCActionCamera.m b/src/cocos2d/CCActionCamera.m deleted file mode 100644 index c46f239..0000000 --- a/src/cocos2d/CCActionCamera.m +++ /dev/null @@ -1,147 +0,0 @@ -/* - * cocos2d for iPhone: http://www.cocos2d-iphone.org - * - * Copyright (c) 2008-2010 Ricardo Quesada - * Copyright (c) 2011 Zynga Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - * - */ - - - -#import "CCActionCamera.h" -#import "CCNode.h" -#import "CCCamera.h" -#import "ccMacros.h" - -// -// CameraAction -// -@implementation CCActionCamera --(void) startWithTarget:(id)aTarget -{ - [super startWithTarget:aTarget]; - CCCamera *camera = [target_ camera]; - [camera centerX:¢erXOrig_ centerY:¢erYOrig_ centerZ:¢erZOrig_]; - [camera eyeX:&eyeXOrig_ eyeY:&eyeYOrig_ eyeZ:&eyeZOrig_]; - [camera upX:&upXOrig_ upY:&upYOrig_ upZ: &upZOrig_]; -} - --(id) reverse -{ - return [CCReverseTime actionWithAction:self]; -} -@end - -@implementation CCOrbitCamera -+(id) actionWithDuration:(float)t radius:(float)r deltaRadius:(float) dr angleZ:(float)z deltaAngleZ:(float)dz angleX:(float)x deltaAngleX:(float)dx -{ - return [[[self alloc] initWithDuration:t radius:r deltaRadius:dr angleZ:z deltaAngleZ:dz angleX:x deltaAngleX:dx] autorelease]; -} - --(id) copyWithZone: (NSZone*) zone -{ - return [[[self class] allocWithZone: zone] initWithDuration:duration_ radius:radius_ deltaRadius:deltaRadius_ angleZ:angleZ_ deltaAngleZ:deltaAngleZ_ angleX:angleX_ deltaAngleX:deltaAngleX_]; -} - - --(id) initWithDuration:(float)t radius:(float)r deltaRadius:(float) dr angleZ:(float)z deltaAngleZ:(float)dz angleX:(float)x deltaAngleX:(float)dx -{ - if((self=[super initWithDuration:t]) ) { - - radius_ = r; - deltaRadius_ = dr; - angleZ_ = z; - deltaAngleZ_ = dz; - angleX_ = x; - deltaAngleX_ = dx; - - radDeltaZ_ = (CGFloat)CC_DEGREES_TO_RADIANS(dz); - radDeltaX_ = (CGFloat)CC_DEGREES_TO_RADIANS(dx); - } - - return self; -} - --(void) startWithTarget:(id)aTarget -{ - [super startWithTarget:aTarget]; - float r, zenith, azimuth; - - [self sphericalRadius: &r zenith:&zenith azimuth:&azimuth]; - -#if 0 // isnan() is not supported on the simulator, and isnan() always returns false. - if( isnan(radius_) ) - radius_ = r; - - if( isnan( angleZ_) ) - angleZ_ = (CGFloat)CC_RADIANS_TO_DEGREES(zenith); - - if( isnan( angleX_ ) ) - angleX_ = (CGFloat)CC_RADIANS_TO_DEGREES(azimuth); -#endif - - radZ_ = (CGFloat)CC_DEGREES_TO_RADIANS(angleZ_); - radX_ = (CGFloat)CC_DEGREES_TO_RADIANS(angleX_); -} - --(void) update: (ccTime) dt -{ - float r = (radius_ + deltaRadius_ * dt) *[CCCamera getZEye]; - float za = radZ_ + radDeltaZ_ * dt; - float xa = radX_ + radDeltaX_ * dt; - - float i = sinf(za) * cosf(xa) * r + centerXOrig_; - float j = sinf(za) * sinf(xa) * r + centerYOrig_; - float k = cosf(za) * r + centerZOrig_; - - [[target_ camera] setEyeX:i eyeY:j eyeZ:k]; -} - --(void) sphericalRadius:(float*) newRadius zenith:(float*) zenith azimuth:(float*) azimuth -{ - float ex, ey, ez, cx, cy, cz, x, y, z; - float r; // radius - float s; - - CCCamera *camera = [target_ camera]; - [camera eyeX:&ex eyeY:&ey eyeZ:&ez]; - [camera centerX:&cx centerY:&cy centerZ:&cz]; - - x = ex-cx; - y = ey-cy; - z = ez-cz; - - r = sqrtf( x*x + y*y + z*z); - s = sqrtf( x*x + y*y); - if(s==0.0f) - s = FLT_EPSILON; - if(r==0.0f) - r = FLT_EPSILON; - - *zenith = acosf( z/r); - if( x < 0 ) - *azimuth = (float)M_PI - asinf(y/s); - else - *azimuth = asinf(y/s); - - *newRadius = r / [CCCamera getZEye]; -} -@end diff --git a/src/cocos2d/CCActionGrid3D.m b/src/cocos2d/CCActionGrid3D.m deleted file mode 100644 index e9fb707..0000000 --- a/src/cocos2d/CCActionGrid3D.m +++ /dev/null @@ -1,652 +0,0 @@ -/* - * cocos2d for iPhone: http://www.cocos2d-iphone.org - * - * Copyright (c) 2009 On-Core - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - * - */ - - -#import "CCActionGrid3D.h" -#import "ccMacros.h" -#import "Support/CGPointExtension.h" - -#pragma mark - -#pragma mark Waves3D - -@implementation CCWaves3D - -@synthesize amplitude; -@synthesize amplitudeRate; - -+(id)actionWithWaves:(int)wav amplitude:(float)amp grid:(ccGridSize)gridSize duration:(ccTime)d -{ - return [[[self alloc] initWithWaves:wav amplitude:amp grid:gridSize duration:d] autorelease]; -} - --(id)initWithWaves:(int)wav amplitude:(float)amp grid:(ccGridSize)gSize duration:(ccTime)d -{ - if ( (self = [super initWithSize:gSize duration:d]) ) - { - waves = wav; - amplitude = amp; - amplitudeRate = 1.0f; - } - - return self; -} - --(id) copyWithZone: (NSZone*) zone -{ - CCGridAction *copy = [[[self class] allocWithZone:zone] initWithWaves:waves amplitude:amplitude grid:gridSize_ duration:duration_]; - return copy; -} - - --(void)update:(ccTime)time -{ - int i, j; - - for( i = 0; i < (gridSize_.x+1); i++ ) - { - for( j = 0; j < (gridSize_.y+1); j++ ) - { - ccVertex3F v = [self originalVertex:ccg(i,j)]; - v.z += (sinf((CGFloat)M_PI*time*waves*2 + (v.y+v.x) * .01f) * amplitude * amplitudeRate); - [self setVertex:ccg(i,j) vertex:v]; - } - } -} -@end - -//////////////////////////////////////////////////////////// - -#pragma mark - -#pragma mark FlipX3D - -@implementation CCFlipX3D - -+(id) actionWithDuration:(ccTime)d -{ - return [[[self alloc] initWithSize:ccg(1,1) duration:d] autorelease]; -} - --(id) initWithDuration:(ccTime)d -{ - return [super initWithSize:ccg(1,1) duration:d]; -} - --(id)initWithSize:(ccGridSize)gSize duration:(ccTime)d -{ - if ( gSize.x != 1 || gSize.y != 1 ) - { - [NSException raise:@"FlipX3D" format:@"Grid size must be (1,1)"]; - } - - return [super initWithSize:gSize duration:d]; -} - --(id) copyWithZone: (NSZone*) zone -{ - CCGridAction *copy = [[[self class] allocWithZone:zone] initWithSize:gridSize_ duration:duration_]; - return copy; -} - - --(void)update:(ccTime)time -{ - CGFloat angle = (CGFloat)M_PI * time; // 180 degrees - CGFloat mz = sinf( angle ); - angle = angle / 2.0f; // x calculates degrees from 0 to 90 - CGFloat mx = cosf( angle ); - - ccVertex3F v0, v1, v, diff; - - v0 = [self originalVertex:ccg(1,1)]; - v1 = [self originalVertex:ccg(0,0)]; - - CGFloat x0 = v0.x; - CGFloat x1 = v1.x; - CGFloat x; - ccGridSize a, b, c, d; - - if ( x0 > x1 ) - { - // Normal Grid - a = ccg(0,0); - b = ccg(0,1); - c = ccg(1,0); - d = ccg(1,1); - x = x0; - } - else - { - // Reversed Grid - c = ccg(0,0); - d = ccg(0,1); - a = ccg(1,0); - b = ccg(1,1); - x = x1; - } - - diff.x = ( x - x * mx ); - diff.z = fabsf( floorf( (x * mz) / 4.0f ) ); - -// bottom-left - v = [self originalVertex:a]; - v.x = diff.x; - v.z += diff.z; - [self setVertex:a vertex:v]; - -// upper-left - v = [self originalVertex:b]; - v.x = diff.x; - v.z += diff.z; - [self setVertex:b vertex:v]; - -// bottom-right - v = [self originalVertex:c]; - v.x -= diff.x; - v.z -= diff.z; - [self setVertex:c vertex:v]; - -// upper-right - v = [self originalVertex:d]; - v.x -= diff.x; - v.z -= diff.z; - [self setVertex:d vertex:v]; -} - -@end - -//////////////////////////////////////////////////////////// - -#pragma mark - -#pragma mark FlipY3D - -@implementation CCFlipY3D - --(void)update:(ccTime)time -{ - CGFloat angle = (CGFloat)M_PI * time; // 180 degrees - CGFloat mz = sinf( angle ); - angle = angle / 2.0f; // x calculates degrees from 0 to 90 - CGFloat my = cosf( angle ); - - ccVertex3F v0, v1, v, diff; - - v0 = [self originalVertex:ccg(1,1)]; - v1 = [self originalVertex:ccg(0,0)]; - - CGFloat y0 = v0.y; - CGFloat y1 = v1.y; - CGFloat y; - ccGridSize a, b, c, d; - - if ( y0 > y1 ) - { - // Normal Grid - a = ccg(0,0); - b = ccg(0,1); - c = ccg(1,0); - d = ccg(1,1); - y = y0; - } - else - { - // Reversed Grid - b = ccg(0,0); - a = ccg(0,1); - d = ccg(1,0); - c = ccg(1,1); - y = y1; - } - - diff.y = y - y * my; - diff.z = fabsf( floorf( (y * mz) / 4.0f ) ); - - // bottom-left - v = [self originalVertex:a]; - v.y = diff.y; - v.z += diff.z; - [self setVertex:a vertex:v]; - - // upper-left - v = [self originalVertex:b]; - v.y -= diff.y; - v.z -= diff.z; - [self setVertex:b vertex:v]; - - // bottom-right - v = [self originalVertex:c]; - v.y = diff.y; - v.z += diff.z; - [self setVertex:c vertex:v]; - - // upper-right - v = [self originalVertex:d]; - v.y -= diff.y; - v.z -= diff.z; - [self setVertex:d vertex:v]; -} - -@end - -//////////////////////////////////////////////////////////// - -#pragma mark - -#pragma mark Lens3D - -@implementation CCLens3D - -@synthesize lensEffect=lensEffect_; - -+(id)actionWithPosition:(CGPoint)pos radius:(float)r grid:(ccGridSize)gridSize duration:(ccTime)d -{ - return [[[self alloc] initWithPosition:pos radius:r grid:gridSize duration:d] autorelease]; -} - --(id)initWithPosition:(CGPoint)pos radius:(float)r grid:(ccGridSize)gSize duration:(ccTime)d -{ - if ( (self = [super initWithSize:gSize duration:d]) ) - { - position_ = ccp(-1,-1); - self.position = pos; - radius_ = r; - lensEffect_ = 0.7f; - dirty_ = YES; - } - - return self; -} - --(id) copyWithZone: (NSZone*) zone -{ - CCGridAction *copy = [[[self class] allocWithZone:zone] initWithPosition:position_ radius:radius_ grid:gridSize_ duration:duration_]; - return copy; -} - --(void) setPosition:(CGPoint)pos -{ - if( ! CGPointEqualToPoint(pos, position_) ) { - position_ = pos; - dirty_ = YES; - } -} - --(CGPoint) position -{ - return position_; -} - --(void)update:(ccTime)time -{ - if ( dirty_ ) - { - int i, j; - - for( i = 0; i < gridSize_.x+1; i++ ) - { - for( j = 0; j < gridSize_.y+1; j++ ) - { - ccVertex3F v = [self originalVertex:ccg(i,j)]; - CGPoint vect = ccpSub(position_, ccp(v.x,v.y)); - CGFloat r = ccpLength(vect); - - if ( r < radius_ ) - { - r = radius_ - r; - CGFloat pre_log = r / radius_; - if ( pre_log == 0 ) pre_log = 0.001f; - float l = logf(pre_log) * lensEffect_; - float new_r = expf( l ) * radius_; - - if ( ccpLength(vect) > 0 ) - { - vect = ccpNormalize(vect); - CGPoint new_vect = ccpMult(vect, new_r); - v.z += ccpLength(new_vect) * lensEffect_; - } - } - - [self setVertex:ccg(i,j) vertex:v]; - } - } - - dirty_ = NO; - } -} - -@end - -//////////////////////////////////////////////////////////// - -#pragma mark - -#pragma mark Ripple3D - -@implementation CCRipple3D - -@synthesize amplitude = amplitude_; -@synthesize amplitudeRate = amplitudeRate_; - -+(id)actionWithPosition:(CGPoint)pos radius:(float)r waves:(int)wav amplitude:(float)amp grid:(ccGridSize)gridSize duration:(ccTime)d -{ - return [[[self alloc] initWithPosition:pos radius:r waves:wav amplitude:amp grid:gridSize duration:d] autorelease]; -} - --(id)initWithPosition:(CGPoint)pos radius:(float)r waves:(int)wav amplitude:(float)amp grid:(ccGridSize)gSize duration:(ccTime)d -{ - if ( (self = [super initWithSize:gSize duration:d]) ) - { - self.position = pos; - radius_ = r; - waves_ = wav; - amplitude_ = amp; - amplitudeRate_ = 1.0f; - } - - return self; -} - --(CGPoint) position -{ - return position_; -} - --(void) setPosition:(CGPoint)pos -{ - position_ = pos; -} - --(id) copyWithZone: (NSZone*) zone -{ - CCGridAction *copy = [[[self class] allocWithZone:zone] initWithPosition:position_ radius:radius_ waves:waves_ amplitude:amplitude_ grid:gridSize_ duration:duration_]; - return copy; -} - - --(void)update:(ccTime)time -{ - int i, j; - - for( i = 0; i < (gridSize_.x+1); i++ ) - { - for( j = 0; j < (gridSize_.y+1); j++ ) - { - ccVertex3F v = [self originalVertex:ccg(i,j)]; - CGPoint vect = ccpSub(position_, ccp(v.x,v.y)); - CGFloat r = ccpLength(vect); - - if ( r < radius_ ) - { - r = radius_ - r; - CGFloat rate = powf( r / radius_, 2); - v.z += (sinf( time*(CGFloat)M_PI*waves_*2 + r * 0.1f) * amplitude_ * amplitudeRate_ * rate ); - } - - [self setVertex:ccg(i,j) vertex:v]; - } - } -} - -@end - -//////////////////////////////////////////////////////////// - -#pragma mark - -#pragma mark Shaky3D - -@implementation CCShaky3D - -+(id)actionWithRange:(int)range shakeZ:(BOOL)sz grid:(ccGridSize)gridSize duration:(ccTime)d -{ - return [[[self alloc] initWithRange:range shakeZ:sz grid:gridSize duration:d] autorelease]; -} - --(id)initWithRange:(int)range shakeZ:(BOOL)sz grid:(ccGridSize)gSize duration:(ccTime)d -{ - if ( (self = [super initWithSize:gSize duration:d]) ) - { - randrange = range; - shakeZ = sz; - } - - return self; -} - --(id) copyWithZone: (NSZone*) zone -{ - CCGridAction *copy = [[[self class] allocWithZone:zone] initWithRange:randrange shakeZ:shakeZ grid:gridSize_ duration:duration_]; - return copy; -} - --(void)update:(ccTime)time -{ - int i, j; - - for( i = 0; i < (gridSize_.x+1); i++ ) - { - for( j = 0; j < (gridSize_.y+1); j++ ) - { - ccVertex3F v = [self originalVertex:ccg(i,j)]; - v.x += ( rand() % (randrange*2) ) - randrange; - v.y += ( rand() % (randrange*2) ) - randrange; - if( shakeZ ) - v.z += ( rand() % (randrange*2) ) - randrange; - - [self setVertex:ccg(i,j) vertex:v]; - } - } -} - -@end - -//////////////////////////////////////////////////////////// - -#pragma mark - -#pragma mark Liquid - -@implementation CCLiquid - -@synthesize amplitude; -@synthesize amplitudeRate; - -+(id)actionWithWaves:(int)wav amplitude:(float)amp grid:(ccGridSize)gridSize duration:(ccTime)d -{ - return [[[self alloc] initWithWaves:wav amplitude:amp grid:gridSize duration:d] autorelease]; -} - --(id)initWithWaves:(int)wav amplitude:(float)amp grid:(ccGridSize)gSize duration:(ccTime)d -{ - if ( (self = [super initWithSize:gSize duration:d]) ) - { - waves = wav; - amplitude = amp; - amplitudeRate = 1.0f; - } - - return self; -} - --(void)update:(ccTime)time -{ - int i, j; - - for( i = 1; i < gridSize_.x; i++ ) - { - for( j = 1; j < gridSize_.y; j++ ) - { - ccVertex3F v = [self originalVertex:ccg(i,j)]; - v.x = (v.x + (sinf(time*(CGFloat)M_PI*waves*2 + v.x * .01f) * amplitude * amplitudeRate)); - v.y = (v.y + (sinf(time*(CGFloat)M_PI*waves*2 + v.y * .01f) * amplitude * amplitudeRate)); - [self setVertex:ccg(i,j) vertex:v]; - } - } -} - --(id) copyWithZone: (NSZone*) zone -{ - CCGridAction *copy = [[[self class] allocWithZone:zone] initWithWaves:waves amplitude:amplitude grid:gridSize_ duration:duration_]; - return copy; -} - -@end - -//////////////////////////////////////////////////////////// - -#pragma mark - -#pragma mark Waves - -@implementation CCWaves - -@synthesize amplitude; -@synthesize amplitudeRate; - -+(id)actionWithWaves:(int)wav amplitude:(float)amp horizontal:(BOOL)h vertical:(BOOL)v grid:(ccGridSize)gridSize duration:(ccTime)d -{ - return [[[self alloc] initWithWaves:wav amplitude:amp horizontal:h vertical:v grid:gridSize duration:d] autorelease]; -} - --(id)initWithWaves:(int)wav amplitude:(float)amp horizontal:(BOOL)h vertical:(BOOL)v grid:(ccGridSize)gSize duration:(ccTime)d -{ - if ( (self = [super initWithSize:gSize duration:d]) ) - { - waves = wav; - amplitude = amp; - amplitudeRate = 1.0f; - horizontal = h; - vertical = v; - } - - return self; -} - --(void)update:(ccTime)time -{ - int i, j; - - for( i = 0; i < (gridSize_.x+1); i++ ) - { - for( j = 0; j < (gridSize_.y+1); j++ ) - { - ccVertex3F v = [self originalVertex:ccg(i,j)]; - - if ( vertical ) - v.x = (v.x + (sinf(time*(CGFloat)M_PI*waves*2 + v.y * .01f) * amplitude * amplitudeRate)); - - if ( horizontal ) - v.y = (v.y + (sinf(time*(CGFloat)M_PI*waves*2 + v.x * .01f) * amplitude * amplitudeRate)); - - [self setVertex:ccg(i,j) vertex:v]; - } - } -} - --(id) copyWithZone: (NSZone*) zone -{ - CCGridAction *copy = [[[self class] allocWithZone:zone] initWithWaves:waves amplitude:amplitude horizontal:horizontal vertical:vertical grid:gridSize_ duration:duration_]; - return copy; -} - -@end - -//////////////////////////////////////////////////////////// - -#pragma mark - -#pragma mark Twirl - -@implementation CCTwirl - -@synthesize amplitude = amplitude_; -@synthesize amplitudeRate = amplitudeRate_; - -+(id)actionWithPosition:(CGPoint)pos twirls:(int)t amplitude:(float)amp grid:(ccGridSize)gridSize duration:(ccTime)d -{ - return [[[self alloc] initWithPosition:pos twirls:t amplitude:amp grid:gridSize duration:d] autorelease]; -} - --(id)initWithPosition:(CGPoint)pos twirls:(int)t amplitude:(float)amp grid:(ccGridSize)gSize duration:(ccTime)d -{ - if ( (self = [super initWithSize:gSize duration:d]) ) - { - self.position = pos; - twirls_ = t; - amplitude_ = amp; - amplitudeRate_ = 1.0f; - } - - return self; -} - --(void) setPosition:(CGPoint)pos -{ - position_ = pos; -} - --(CGPoint) position -{ - return position_; -} - --(void)update:(ccTime)time -{ - int i, j; - CGPoint c = position_; - - for( i = 0; i < (gridSize_.x+1); i++ ) - { - for( j = 0; j < (gridSize_.y+1); j++ ) - { - ccVertex3F v = [self originalVertex:ccg(i,j)]; - - CGPoint avg = ccp(i-(gridSize_.x/2.0f), j-(gridSize_.y/2.0f)); - CGFloat r = ccpLength( avg ); - - CGFloat amp = 0.1f * amplitude_ * amplitudeRate_; - CGFloat a = r * cosf( (CGFloat)M_PI/2.0f + time * (CGFloat)M_PI * twirls_ * 2 ) * amp; - - float cosA = cosf(a); - float sinA = sinf(a); - - CGPoint d = { - sinA * (v.y-c.y) + cosA * (v.x-c.x), - cosA * (v.y-c.y) - sinA * (v.x-c.x) - }; - - v.x = c.x + d.x; - v.y = c.y + d.y; - - [self setVertex:ccg(i,j) vertex:v]; - } - } -} - --(id) copyWithZone: (NSZone*) zone -{ - CCGridAction *copy = [[[self class] allocWithZone:zone] initWithPosition:position_ - twirls:twirls_ - amplitude:amplitude_ - grid:gridSize_ - duration:duration_]; - return copy; -} - - -@end diff --git a/src/cocos2d/CCActionTiledGrid.m b/src/cocos2d/CCActionTiledGrid.m deleted file mode 100644 index f8d6a2d..0000000 --- a/src/cocos2d/CCActionTiledGrid.m +++ /dev/null @@ -1,768 +0,0 @@ -/* - * cocos2d for iPhone: http://www.cocos2d-iphone.org - * - * Copyright (c) 2009 On-Core - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - * - */ - - -#import "CCActionTiledGrid.h" -#import "CCDirector.h" -#import "ccMacros.h" -#import "Support/CGPointExtension.h" - -typedef struct -{ - CGPoint position; - CGPoint startPosition; - ccGridSize delta; -} Tile; - -#pragma mark - -#pragma mark ShakyTiles3D - -@implementation CCShakyTiles3D - -+(id)actionWithRange:(int)range shakeZ:(BOOL)shakeZ grid:(ccGridSize)gridSize duration:(ccTime)d -{ - return [[[self alloc] initWithRange:range shakeZ:shakeZ grid:gridSize duration:d] autorelease]; -} - --(id)initWithRange:(int)range shakeZ:(BOOL)sz grid:(ccGridSize)gSize duration:(ccTime)d -{ - if ( (self = [super initWithSize:gSize duration:d]) ) - { - randrange = range; - shakeZ = sz; - } - - return self; -} - --(id) copyWithZone: (NSZone*) zone -{ - CCGridAction *copy = [[[self class] allocWithZone:zone] initWithRange:randrange shakeZ:shakeZ grid:gridSize_ duration:duration_]; - return copy; -} - - --(void)update:(ccTime)time -{ - int i, j; - - for( i = 0; i < gridSize_.x; i++ ) - { - for( j = 0; j < gridSize_.y; j++ ) - { - ccQuad3 coords = [self originalTile:ccg(i,j)]; - - // X - coords.bl.x += ( rand() % (randrange*2) ) - randrange; - coords.br.x += ( rand() % (randrange*2) ) - randrange; - coords.tl.x += ( rand() % (randrange*2) ) - randrange; - coords.tr.x += ( rand() % (randrange*2) ) - randrange; - - // Y - coords.bl.y += ( rand() % (randrange*2) ) - randrange; - coords.br.y += ( rand() % (randrange*2) ) - randrange; - coords.tl.y += ( rand() % (randrange*2) ) - randrange; - coords.tr.y += ( rand() % (randrange*2) ) - randrange; - - if( shakeZ ) { - coords.bl.z += ( rand() % (randrange*2) ) - randrange; - coords.br.z += ( rand() % (randrange*2) ) - randrange; - coords.tl.z += ( rand() % (randrange*2) ) - randrange; - coords.tr.z += ( rand() % (randrange*2) ) - randrange; - } - - [self setTile:ccg(i,j) coords:coords]; - } - } -} - -@end - -//////////////////////////////////////////////////////////// - -#pragma mark - -#pragma mark CCShatteredTiles3D - -@implementation CCShatteredTiles3D - -+(id)actionWithRange:(int)range shatterZ:(BOOL)sz grid:(ccGridSize)gridSize duration:(ccTime)d -{ - return [[[self alloc] initWithRange:range shatterZ:sz grid:gridSize duration:d] autorelease]; -} - --(id)initWithRange:(int)range shatterZ:(BOOL)sz grid:(ccGridSize)gSize duration:(ccTime)d -{ - if ( (self = [super initWithSize:gSize duration:d]) ) - { - once = NO; - randrange = range; - shatterZ = sz; - } - - return self; -} - --(id) copyWithZone: (NSZone*) zone -{ - CCGridAction *copy = [[[self class] allocWithZone:zone] initWithRange:randrange shatterZ:shatterZ grid:gridSize_ duration:duration_]; - return copy; -} - - --(void)update:(ccTime)time -{ - int i, j; - - if ( once == NO ) - { - for( i = 0; i < gridSize_.x; i++ ) - { - for( j = 0; j < gridSize_.y; j++ ) - { - ccQuad3 coords = [self originalTile:ccg(i,j)]; - - // X - coords.bl.x += ( rand() % (randrange*2) ) - randrange; - coords.br.x += ( rand() % (randrange*2) ) - randrange; - coords.tl.x += ( rand() % (randrange*2) ) - randrange; - coords.tr.x += ( rand() % (randrange*2) ) - randrange; - - // Y - coords.bl.y += ( rand() % (randrange*2) ) - randrange; - coords.br.y += ( rand() % (randrange*2) ) - randrange; - coords.tl.y += ( rand() % (randrange*2) ) - randrange; - coords.tr.y += ( rand() % (randrange*2) ) - randrange; - - if( shatterZ ) { - coords.bl.z += ( rand() % (randrange*2) ) - randrange; - coords.br.z += ( rand() % (randrange*2) ) - randrange; - coords.tl.z += ( rand() % (randrange*2) ) - randrange; - coords.tr.z += ( rand() % (randrange*2) ) - randrange; - } - - [self setTile:ccg(i,j) coords:coords]; - } - } - - once = YES; - } -} - -@end - -//////////////////////////////////////////////////////////// - -#pragma mark - -#pragma mark CCShuffleTiles - -@implementation CCShuffleTiles - -+(id)actionWithSeed:(int)s grid:(ccGridSize)gridSize duration:(ccTime)d -{ - return [[[self alloc] initWithSeed:s grid:gridSize duration:d] autorelease]; -} - --(id)initWithSeed:(int)s grid:(ccGridSize)gSize duration:(ccTime)d -{ - if ( (self = [super initWithSize:gSize duration:d]) ) - { - seed = s; - tilesOrder = nil; - tiles = nil; - } - - return self; -} - --(id) copyWithZone: (NSZone*) zone -{ - CCGridAction *copy = [[[self class] allocWithZone:zone] initWithSeed:seed grid:gridSize_ duration:duration_]; - return copy; -} - - --(void)dealloc -{ - if ( tilesOrder ) free(tilesOrder); - if ( tiles ) free(tiles); - [super dealloc]; -} - --(void)shuffle:(int*)array count:(NSUInteger)len -{ - NSInteger i; - for( i = len - 1; i >= 0; i-- ) - { - NSInteger j = rand() % (i+1); - int v = array[i]; - array[i] = array[j]; - array[j] = v; - } -} - --(ccGridSize)getDelta:(ccGridSize)pos -{ - CGPoint pos2; - - NSInteger idx = pos.x * gridSize_.y + pos.y; - - pos2.x = tilesOrder[idx] / (int)gridSize_.y; - pos2.y = tilesOrder[idx] % (int)gridSize_.y; - - return ccg(pos2.x - pos.x, pos2.y - pos.y); -} - --(void)placeTile:(ccGridSize)pos tile:(Tile)t -{ - ccQuad3 coords = [self originalTile:pos]; - - CGPoint step = [[target_ grid] step]; - coords.bl.x += (int)(t.position.x * step.x); - coords.bl.y += (int)(t.position.y * step.y); - - coords.br.x += (int)(t.position.x * step.x); - coords.br.y += (int)(t.position.y * step.y); - - coords.tl.x += (int)(t.position.x * step.x); - coords.tl.y += (int)(t.position.y * step.y); - - coords.tr.x += (int)(t.position.x * step.x); - coords.tr.y += (int)(t.position.y * step.y); - - [self setTile:pos coords:coords]; -} - --(void)startWithTarget:(id)aTarget -{ - [super startWithTarget:aTarget]; - - if ( seed != -1 ) - srand(seed); - - tilesCount = gridSize_.x * gridSize_.y; - tilesOrder = (int*)malloc(tilesCount*sizeof(int)); - int i, j; - - for( i = 0; i < tilesCount; i++ ) - tilesOrder[i] = i; - - [self shuffle:tilesOrder count:tilesCount]; - - tiles = malloc(tilesCount*sizeof(Tile)); - Tile *tileArray = (Tile*)tiles; - - for( i = 0; i < gridSize_.x; i++ ) - { - for( j = 0; j < gridSize_.y; j++ ) - { - tileArray->position = ccp(i,j); - tileArray->startPosition = ccp(i,j); - tileArray->delta = [self getDelta:ccg(i,j)]; - tileArray++; - } - } -} - --(void)update:(ccTime)time -{ - int i, j; - - Tile *tileArray = (Tile*)tiles; - - for( i = 0; i < gridSize_.x; i++ ) - { - for( j = 0; j < gridSize_.y; j++ ) - { - tileArray->position = ccpMult( ccp(tileArray->delta.x, tileArray->delta.y), time); - [self placeTile:ccg(i,j) tile:*tileArray]; - tileArray++; - } - } -} - -@end - -//////////////////////////////////////////////////////////// - -#pragma mark - -#pragma mark CCFadeOutTRTiles - -@implementation CCFadeOutTRTiles - --(float)testFunc:(ccGridSize)pos time:(ccTime)time -{ - CGPoint n = ccpMult( ccp(gridSize_.x,gridSize_.y), time); - if ( (n.x+n.y) == 0.0f ) - return 1.0f; - - return powf( (pos.x+pos.y) / (n.x+n.y), 6 ); -} - --(void)turnOnTile:(ccGridSize)pos -{ - [self setTile:pos coords:[self originalTile:pos]]; -} - --(void)turnOffTile:(ccGridSize)pos -{ - ccQuad3 coords; - bzero(&coords, sizeof(ccQuad3)); - [self setTile:pos coords:coords]; -} - --(void)transformTile:(ccGridSize)pos distance:(float)distance -{ - ccQuad3 coords = [self originalTile:pos]; - CGPoint step = [[target_ grid] step]; - - coords.bl.x += (step.x / 2) * (1.0f - distance); - coords.bl.y += (step.y / 2) * (1.0f - distance); - - coords.br.x -= (step.x / 2) * (1.0f - distance); - coords.br.y += (step.y / 2) * (1.0f - distance); - - coords.tl.x += (step.x / 2) * (1.0f - distance); - coords.tl.y -= (step.y / 2) * (1.0f - distance); - - coords.tr.x -= (step.x / 2) * (1.0f - distance); - coords.tr.y -= (step.y / 2) * (1.0f - distance); - - [self setTile:pos coords:coords]; -} - --(void)update:(ccTime)time -{ - int i, j; - - for( i = 0; i < gridSize_.x; i++ ) - { - for( j = 0; j < gridSize_.y; j++ ) - { - float distance = [self testFunc:ccg(i,j) time:time]; - if ( distance == 0 ) - [self turnOffTile:ccg(i,j)]; - else if ( distance < 1 ) - [self transformTile:ccg(i,j) distance:distance]; - else - [self turnOnTile:ccg(i,j)]; - } - } -} - -@end - -//////////////////////////////////////////////////////////// - -#pragma mark - -#pragma mark CCFadeOutBLTiles - -@implementation CCFadeOutBLTiles - --(float)testFunc:(ccGridSize)pos time:(ccTime)time -{ - CGPoint n = ccpMult(ccp(gridSize_.x, gridSize_.y), (1.0f-time)); - if ( (pos.x+pos.y) == 0 ) - return 1.0f; - - return powf( (n.x+n.y) / (pos.x+pos.y), 6 ); -} - -@end - -//////////////////////////////////////////////////////////// - -#pragma mark - -#pragma mark CCFadeOutUpTiles - -@implementation CCFadeOutUpTiles - --(float)testFunc:(ccGridSize)pos time:(ccTime)time -{ - CGPoint n = ccpMult(ccp(gridSize_.x, gridSize_.y), time); - if ( n.y == 0 ) - return 1.0f; - - return powf( pos.y / n.y, 6 ); -} - --(void)transformTile:(ccGridSize)pos distance:(float)distance -{ - ccQuad3 coords = [self originalTile:pos]; - CGPoint step = [[target_ grid] step]; - - coords.bl.y += (step.y / 2) * (1.0f - distance); - coords.br.y += (step.y / 2) * (1.0f - distance); - coords.tl.y -= (step.y / 2) * (1.0f - distance); - coords.tr.y -= (step.y / 2) * (1.0f - distance); - - [self setTile:pos coords:coords]; -} - -@end - -//////////////////////////////////////////////////////////// - -#pragma mark - -#pragma mark CCFadeOutDownTiles - -@implementation CCFadeOutDownTiles - --(float)testFunc:(ccGridSize)pos time:(ccTime)time -{ - CGPoint n = ccpMult(ccp(gridSize_.x,gridSize_.y), (1.0f - time)); - if ( pos.y == 0 ) - return 1.0f; - - return powf( n.y / pos.y, 6 ); -} - -@end - -//////////////////////////////////////////////////////////// - -#pragma mark - -#pragma mark TurnOffTiles - -@implementation CCTurnOffTiles - -+(id)actionWithSeed:(int)s grid:(ccGridSize)gridSize duration:(ccTime)d -{ - return [[[self alloc] initWithSeed:s grid:gridSize duration:d] autorelease]; -} - --(id)initWithSeed:(int)s grid:(ccGridSize)gSize duration:(ccTime)d -{ - if ( (self = [super initWithSize:gSize duration:d]) ) - { - seed = s; - tilesOrder = nil; - } - - return self; -} - --(id) copyWithZone: (NSZone*) zone -{ - CCGridAction *copy = [[[self class] allocWithZone:zone] initWithSeed:seed grid:gridSize_ duration:duration_]; - return copy; -} - --(void)dealloc -{ - if ( tilesOrder ) free(tilesOrder); - [super dealloc]; -} - --(void)shuffle:(int*)array count:(NSUInteger)len -{ - NSInteger i; - for( i = len - 1; i >= 0; i-- ) - { - NSInteger j = rand() % (i+1); - int v = array[i]; - array[i] = array[j]; - array[j] = v; - } -} - --(void)turnOnTile:(ccGridSize)pos -{ - [self setTile:pos coords:[self originalTile:pos]]; -} - --(void)turnOffTile:(ccGridSize)pos -{ - ccQuad3 coords; - - bzero(&coords, sizeof(ccQuad3)); - [self setTile:pos coords:coords]; -} - --(void)startWithTarget:(id)aTarget -{ - int i; - - [super startWithTarget:aTarget]; - - if ( seed != -1 ) - srand(seed); - - tilesCount = gridSize_.x * gridSize_.y; - tilesOrder = (int*)malloc(tilesCount*sizeof(int)); - - for( i = 0; i < tilesCount; i++ ) - tilesOrder[i] = i; - - [self shuffle:tilesOrder count:tilesCount]; -} - --(void)update:(ccTime)time -{ - int i, l, t; - - l = (int)(time * (float)tilesCount); - - for( i = 0; i < tilesCount; i++ ) - { - t = tilesOrder[i]; - ccGridSize tilePos = ccg( t / gridSize_.y, t % gridSize_.y ); - - if ( i < l ) - [self turnOffTile:tilePos]; - else - [self turnOnTile:tilePos]; - } -} - -@end - -//////////////////////////////////////////////////////////// - -#pragma mark - -#pragma mark CCWavesTiles3D - -@implementation CCWavesTiles3D - -@synthesize amplitude; -@synthesize amplitudeRate; - -+(id)actionWithWaves:(int)wav amplitude:(float)amp grid:(ccGridSize)gridSize duration:(ccTime)d -{ - return [[[self alloc] initWithWaves:wav amplitude:amp grid:gridSize duration:d] autorelease]; -} - --(id)initWithWaves:(int)wav amplitude:(float)amp grid:(ccGridSize)gSize duration:(ccTime)d -{ - if ( (self = [super initWithSize:gSize duration:d]) ) - { - waves = wav; - amplitude = amp; - amplitudeRate = 1.0f; - } - - return self; -} - --(id) copyWithZone: (NSZone*) zone -{ - CCGridAction *copy = [[[self class] allocWithZone:zone] initWithWaves:waves amplitude:amplitude grid:gridSize_ duration:duration_]; - return copy; -} - - --(void)update:(ccTime)time -{ - int i, j; - - for( i = 0; i < gridSize_.x; i++ ) - { - for( j = 0; j < gridSize_.y; j++ ) - { - ccQuad3 coords = [self originalTile:ccg(i,j)]; - - coords.bl.z = (sinf(time*(CGFloat)M_PI*waves*2 + (coords.bl.y+coords.bl.x) * .01f) * amplitude * amplitudeRate ); - coords.br.z = coords.bl.z; - coords.tl.z = coords.bl.z; - coords.tr.z = coords.bl.z; - - [self setTile:ccg(i,j) coords:coords]; - } - } -} -@end - -//////////////////////////////////////////////////////////// - -#pragma mark - -#pragma mark CCJumpTiles3D - -@implementation CCJumpTiles3D - -@synthesize amplitude; -@synthesize amplitudeRate; - -+(id)actionWithJumps:(int)j amplitude:(float)amp grid:(ccGridSize)gridSize duration:(ccTime)d -{ - return [[[self alloc] initWithJumps:j amplitude:amp grid:gridSize duration:d] autorelease]; -} - --(id)initWithJumps:(int)j amplitude:(float)amp grid:(ccGridSize)gSize duration:(ccTime)d -{ - if ( (self = [super initWithSize:gSize duration:d]) ) - { - jumps = j; - amplitude = amp; - amplitudeRate = 1.0f; - } - - return self; -} - --(id) copyWithZone: (NSZone*) zone -{ - CCGridAction *copy = [[[self class] allocWithZone:zone] initWithJumps:jumps amplitude:amplitude grid:gridSize_ duration:duration_]; - return copy; -} - - --(void)update:(ccTime)time -{ - int i, j; - - float sinz = (sinf((CGFloat)M_PI*time*jumps*2) * amplitude * amplitudeRate ); - float sinz2 = (sinf((CGFloat)M_PI*(time*jumps*2 + 1)) * amplitude * amplitudeRate ); - - for( i = 0; i < gridSize_.x; i++ ) - { - for( j = 0; j < gridSize_.y; j++ ) - { - ccQuad3 coords = [self originalTile:ccg(i,j)]; - - if ( ((i+j) % 2) == 0 ) - { - coords.bl.z += sinz; - coords.br.z += sinz; - coords.tl.z += sinz; - coords.tr.z += sinz; - } - else - { - coords.bl.z += sinz2; - coords.br.z += sinz2; - coords.tl.z += sinz2; - coords.tr.z += sinz2; - } - - [self setTile:ccg(i,j) coords:coords]; - } - } -} -@end - -//////////////////////////////////////////////////////////// - -#pragma mark - -#pragma mark SplitRows - -@implementation CCSplitRows - -+(id)actionWithRows:(int)r duration:(ccTime)d -{ - return [[[self alloc] initWithRows:r duration:d] autorelease]; -} - --(id)initWithRows:(int)r duration:(ccTime)d -{ - rows = r; - return [super initWithSize:ccg(1,r) duration:d]; -} - --(id) copyWithZone: (NSZone*) zone -{ - CCGridAction *copy = [[[self class] allocWithZone:zone] initWithRows:rows duration:duration_]; - return copy; -} - --(void)startWithTarget:(id)aTarget -{ - [super startWithTarget:aTarget]; - winSize = [[CCDirector sharedDirector] winSizeInPixels]; -} - --(void)update:(ccTime)time -{ - int j; - - for( j = 0; j < gridSize_.y; j++ ) - { - ccQuad3 coords = [self originalTile:ccg(0,j)]; - float direction = 1; - - if ( (j % 2 ) == 0 ) - direction = -1; - - coords.bl.x += direction * winSize.width * time; - coords.br.x += direction * winSize.width * time; - coords.tl.x += direction * winSize.width * time; - coords.tr.x += direction * winSize.width * time; - - [self setTile:ccg(0,j) coords:coords]; - } -} - -@end - -//////////////////////////////////////////////////////////// - -#pragma mark - -#pragma mark CCSplitCols - -@implementation CCSplitCols - -+(id)actionWithCols:(int)c duration:(ccTime)d -{ - return [[[self alloc] initWithCols:c duration:d] autorelease]; -} - --(id)initWithCols:(int)c duration:(ccTime)d -{ - cols = c; - return [super initWithSize:ccg(c,1) duration:d]; -} - --(id) copyWithZone: (NSZone*) zone -{ - CCGridAction *copy = [[[self class] allocWithZone:zone] initWithCols:cols duration:duration_]; - return copy; -} - --(void)startWithTarget:(id)aTarget -{ - [super startWithTarget:aTarget]; - winSize = [[CCDirector sharedDirector] winSizeInPixels]; -} - --(void)update:(ccTime)time -{ - int i; - - for( i = 0; i < gridSize_.x; i++ ) - { - ccQuad3 coords = [self originalTile:ccg(i,0)]; - float direction = 1; - - if ( (i % 2 ) == 0 ) - direction = -1; - - coords.bl.y += direction * winSize.height * time; - coords.br.y += direction * winSize.height * time; - coords.tl.y += direction * winSize.height * time; - coords.tr.y += direction * winSize.height * time; - - [self setTile:ccg(i,0) coords:coords]; - } -} - -@end diff --git a/src/cocos2d/CCCamera.m b/src/cocos2d/CCCamera.m deleted file mode 100644 index 70d028d..0000000 --- a/src/cocos2d/CCCamera.m +++ /dev/null @@ -1,148 +0,0 @@ -/* - * cocos2d for iPhone: http://www.cocos2d-iphone.org - * - * Copyright (c) 2008-2010 Ricardo Quesada - * Copyright (c) 2011 Zynga Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - - -#import "Platforms/CCGL.h" -#import "CCCamera.h" -#import "ccMacros.h" -#import "CCDrawingPrimitives.h" -#import "kazmath/GL/matrix.h" - -@implementation CCCamera - -@synthesize dirty = dirty_; - --(id) init -{ - if( (self=[super init]) ) - [self restore]; - - return self; -} - -- (NSString*) description -{ - return [NSString stringWithFormat:@"<%@ = %p | center = (%.2f,%.2f,%.2f)>", [self class], self, centerX_, centerY_, centerZ_]; -} - - -- (void) dealloc -{ - CCLOGINFO(@"cocos2d: deallocing %@", self); - [super dealloc]; -} - --(void) restore -{ - eyeX_ = eyeY_ = 0; - eyeZ_ = [CCCamera getZEye]; - - centerX_ = centerY_ = centerZ_ = 0; - - upX_ = 0.0f; - upY_ = 1.0f; - upZ_ = 0.0f; - - kmMat4Identity( &lookupMatrix_ ); - - dirty_ = NO; -} - --(void) locate -{ - if( dirty_ ) { - - kmVec3 eye, center, up; - - kmVec3Fill( &eye, eyeX_, eyeY_ , eyeZ_ ); - kmVec3Fill( ¢er, centerX_, centerY_, centerZ_ ); - - kmVec3Fill( &up, upX_, upY_, upZ_); - kmMat4LookAt( &lookupMatrix_, &eye, ¢er, &up); - - dirty_ = NO; - - } - - kmGLMultMatrix( &lookupMatrix_ ); - -} - -+(float) getZEye -{ - return FLT_EPSILON; - // CGSize s = [[CCDirector sharedDirector] displaySize]; - // return ( s.height / 1.1566f ); -} - --(void) setEyeX: (float)x eyeY:(float)y eyeZ:(float)z -{ - eyeX_ = x; - eyeY_ = y; - eyeZ_ = z; - - dirty_ = YES; -} - --(void) setCenterX: (float)x centerY:(float)y centerZ:(float)z -{ - centerX_ = x; - centerY_ = y; - centerZ_ = z; - - dirty_ = YES; -} - --(void) setUpX: (float)x upY:(float)y upZ:(float)z -{ - upX_ = x; - upY_ = y; - upZ_ = z; - - dirty_ = YES; -} - --(void) eyeX: (float*)x eyeY:(float*)y eyeZ:(float*)z -{ - *x = eyeX_; - *y = eyeY_; - *z = eyeZ_; -} - --(void) centerX: (float*)x centerY:(float*)y centerZ:(float*)z -{ - *x = centerX_; - *y = centerY_; - *z = centerZ_; -} - --(void) upX: (float*)x upY:(float*)y upZ:(float*)z -{ - *x = upX_; - *y = upY_; - *z = upZ_; -} - -@end diff --git a/src/cocos2d/CCConfiguration.m b/src/cocos2d/CCConfiguration.m deleted file mode 100644 index 94fa945..0000000 --- a/src/cocos2d/CCConfiguration.m +++ /dev/null @@ -1,195 +0,0 @@ -/* - * cocos2d for iPhone: http://www.cocos2d-iphone.org - * - * Copyright (c) 2010 Ricardo Quesada - * Copyright (c) 2011 Zynga Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#import "ccMacros.h" - -#ifdef __CC_PLATFORM_IOS -#import // Needed for UIDevice -#endif - -#import "Platforms/CCGL.h" -#import "CCConfiguration.h" -#import "ccMacros.h" -#import "ccConfig.h" -#import "Support/OpenGL_Internal.h" - -@implementation CCConfiguration - -@synthesize maxTextureSize = maxTextureSize_, maxTextureUnits=maxTextureUnits_; -@synthesize supportsPVRTC = supportsPVRTC_; -@synthesize maxModelviewStackDepth = maxModelviewStackDepth_; -@synthesize supportsNPOT = supportsNPOT_; -@synthesize supportsBGRA8888 = supportsBGRA8888_; -@synthesize supportsDiscardFramebuffer = supportsDiscardFramebuffer_; -@synthesize supportsShareableVAO = supportsShareableVAO_; -@synthesize OSVersion = OSVersion_; - -// -// singleton stuff -// -static CCConfiguration *_sharedConfiguration = nil; - -static char * glExtensions; - -+ (CCConfiguration *)sharedConfiguration -{ - if (!_sharedConfiguration) - _sharedConfiguration = [[self alloc] init]; - - return _sharedConfiguration; -} - -+(id)alloc -{ - NSAssert(_sharedConfiguration == nil, @"Attempted to allocate a second instance of a singleton."); - return [super alloc]; -} - - -#ifdef __CC_PLATFORM_IOS -#elif defined(__CC_PLATFORM_MAC) -- (NSString*)getMacVersion -{ - SInt32 versionMajor, versionMinor, versionBugFix; - Gestalt(gestaltSystemVersionMajor, &versionMajor); - Gestalt(gestaltSystemVersionMinor, &versionMinor); - Gestalt(gestaltSystemVersionBugFix, &versionBugFix); - - return [NSString stringWithFormat:@"%d.%d.%d", versionMajor, versionMinor, versionBugFix]; -} -#endif // __CC_PLATFORM_MAC - --(id) init -{ - if( (self=[super init])) { - - // Obtain iOS version - OSVersion_ = 0; -#ifdef __CC_PLATFORM_IOS - NSString *OSVer = [[UIDevice currentDevice] systemVersion]; -#elif defined(__CC_PLATFORM_MAC) - NSString *OSVer = [self getMacVersion]; -#endif - NSArray *arr = [OSVer componentsSeparatedByString:@"."]; - int idx = 0x01000000; - for( NSString *str in arr ) { - int value = [str intValue]; - OSVersion_ += value * idx; - idx = idx >> 8; - } - CCLOG(@"cocos2d: OS version: %@ (0x%08x)", OSVer, OSVersion_); - - CCLOG(@"cocos2d: GL_VENDOR: %s", glGetString(GL_VENDOR) ); - CCLOG(@"cocos2d: GL_RENDERER: %s", glGetString ( GL_RENDERER ) ); - CCLOG(@"cocos2d: GL_VERSION: %s", glGetString ( GL_VERSION ) ); - - glExtensions = (char*) glGetString(GL_EXTENSIONS); - - glGetIntegerv(GL_MAX_TEXTURE_SIZE, &maxTextureSize_); - glGetIntegerv(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, &maxTextureUnits_ ); - -#ifdef __CC_PLATFORM_IOS - if( OSVersion_ >= kCCiOSVersion_4_0 ) - glGetIntegerv(GL_MAX_SAMPLES_APPLE, &maxSamplesAllowed_); - else - maxSamplesAllowed_ = 0; -#elif defined(__CC_PLATFORM_MAC) - glGetIntegerv(GL_MAX_SAMPLES, &maxSamplesAllowed_); -#endif - - supportsPVRTC_ = [self checkForGLExtension:@"GL_IMG_texture_compression_pvrtc"]; -#ifdef __CC_PLATFORM_IOS - supportsNPOT_ = YES; -#elif defined(__CC_PLATFORM_MAC) - supportsNPOT_ = [self checkForGLExtension:@"GL_ARB_texture_non_power_of_two"]; -#endif - // It seems that somewhere between firmware iOS 3.0 and 4.2 Apple renamed - // GL_IMG_... to GL_APPLE.... So we should check both names - -#ifdef __CC_PLATFORM_IOS - BOOL bgra8a = [self checkForGLExtension:@"GL_IMG_texture_format_BGRA8888"]; - BOOL bgra8b = [self checkForGLExtension:@"GL_APPLE_texture_format_BGRA8888"]; - supportsBGRA8888_ = bgra8a | bgra8b; -#elif defined(__CC_PLATFORM_MAC) - supportsBGRA8888_ = [self checkForGLExtension:@"GL_EXT_bgra"]; -#endif - - supportsShareableVAO_ = [self checkForGLExtension:@"GL_APPLE_vertex_array_object"]; - - - supportsDiscardFramebuffer_ = [self checkForGLExtension:@"GL_EXT_discard_framebuffer"]; - - CCLOG(@"cocos2d: GL_MAX_TEXTURE_SIZE: %d", maxTextureSize_); - CCLOG(@"cocos2d: GL_MAX_TEXTURE_UNITS: %d", maxTextureUnits_); - CCLOG(@"cocos2d: GL_MAX_SAMPLES: %d", maxSamplesAllowed_); - CCLOG(@"cocos2d: GL supports PVRTC: %s", (supportsPVRTC_ ? "YES" : "NO") ); - CCLOG(@"cocos2d: GL supports BGRA8888 textures: %s", (supportsBGRA8888_ ? "YES" : "NO") ); - CCLOG(@"cocos2d: GL supports NPOT textures: %s", (supportsNPOT_ ? "YES" : "NO") ); - CCLOG(@"cocos2d: GL supports discard_framebuffer: %s", (supportsDiscardFramebuffer_ ? "YES" : "NO") ); - CCLOG(@"cocos2d: GL supports shareable VAO: %s", (supportsShareableVAO_ ? "YES" : "NO") ); - -#ifdef __CC_PLATFORM_MAC - CCLOG(@"cocos2d: Director's thread: %@", -#if (CC_DIRECTOR_MAC_THREAD == CC_MAC_USE_MAIN_THREAD) - @"Main thread" -#elif (CC_DIRECTOR_MAC_THREAD == CC_MAC_USE_OWN_THREAD) - @"Own thread" -#elif (CC_DIRECTOR_MAC_THREAD == CC_MAC_USE_DISPLAY_LINK_THREAD) - @"DisplayLink thread" -#endif // - ); -#endif // Mac - - CCLOG(@"cocos2d: compiled with Profiling Support: %s", -#if CC_ENABLE_PROFILERS - - "YES - *** Disable it when you finish profiling ***" -#else - "NO" -#endif - ); - - } - -#if CC_ENABLE_GL_STATE_CACHE == 0 - printf("\n"); - NSLog(@"cocos2d: **** WARNING **** CC_ENABLE_GL_STATE_CACHE is disabled. To improve performance, enable it by editing ccConfig.h"); - printf("\n"); -#endif - - CHECK_GL_ERROR_DEBUG(); - - return self; -} - -- (BOOL) checkForGLExtension:(NSString *)searchName -{ - // For best results, extensionsNames should be stored in your renderer so that it does not - // need to be recreated on each invocation. - NSString *extensionsString = [NSString stringWithCString:glExtensions encoding: NSASCIIStringEncoding]; - NSArray *extensionsNames = [extensionsString componentsSeparatedByString:@" "]; - return [extensionsNames containsObject: searchName]; -} -@end diff --git a/src/cocos2d/CCDirector.m b/src/cocos2d/CCDirector.m deleted file mode 100644 index 480cf7b..0000000 --- a/src/cocos2d/CCDirector.m +++ /dev/null @@ -1,750 +0,0 @@ -/* - * cocos2d for iPhone: http://www.cocos2d-iphone.org - * - * Copyright (c) 2008-2010 Ricardo Quesada - * Copyright (c) 2011 Zynga Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - - -/* Idea of decoupling Window from Director taken from OC3D project: http://code.google.com/p/oc3d/ - */ - -#import - -// cocos2d imports -#import "CCDirector.h" -#import "CCScheduler.h" -#import "CCActionManager.h" -#import "CCTextureCache.h" -#import "CCAnimationCache.h" -#import "CCLabelAtlas.h" -#import "ccMacros.h" -#import "CCTransition.h" -#import "CCScene.h" -#import "CCSpriteFrameCache.h" -#import "CCTexture2D.h" -#import "CCLabelBMFont.h" -#import "CCLayer.h" -#import "ccGLStateCache.h" -#import "CCShaderCache.h" - -// support imports -#import "Platforms/CCGL.h" -#import "Platforms/CCNS.h" - -#import "Support/OpenGL_Internal.h" -#import "Support/CGPointExtension.h" -#import "Support/CCProfiling.h" -#import "Support/CCFileUtils.h" - -#ifdef __CC_PLATFORM_IOS -#import "Platforms/iOS/CCDirectorIOS.h" -#define CC_DIRECTOR_DEFAULT CCDirectorDisplayLink -#elif defined(__CC_PLATFORM_MAC) -#import "Platforms/Mac/CCDirectorMac.h" -#define CC_DIRECTOR_DEFAULT CCDirectorDisplayLink -#endif - - -#pragma mark - -#pragma mark Director - global variables (optimization) - -// XXX it shoul be a Director ivar. Move it there once support for multiple directors is added -NSUInteger __ccNumberOfDraws = 0; - -#define kDefaultFPS 60.0 // 60 frames per second - -extern NSString * cocos2dVersion(void); - -@interface CCDirector (Private) --(void) setNextScene; -// shows the statistics --(void) showStats; -// calculates delta time since last time it was called --(void) calculateDeltaTime; -// calculates the milliseconds per frame from the start of the frame --(void) calculateMPF; -@end - -@implementation CCDirector - -@synthesize animationInterval = animationInterval_; -@synthesize runningScene = runningScene_; -@synthesize displayStats = displayStats_; -@synthesize nextDeltaTimeZero = nextDeltaTimeZero_; -@synthesize isPaused = isPaused_; -@synthesize isAnimating = isAnimating_; -@synthesize sendCleanupToScene = sendCleanupToScene_; -@synthesize runningThread = runningThread_; -@synthesize notificationNode = notificationNode_; -@synthesize delegate = delegate_; -@synthesize totalFrames = totalFrames_; -@synthesize secondsPerFrame = secondsPerFrame_; -@synthesize scheduler = scheduler_; -@synthesize actionManager = actionManager_; - -// -// singleton stuff -// -static CCDirector *_sharedDirector = nil; - -+ (CCDirector *)sharedDirector -{ - if (!_sharedDirector) { - - // - // Default Director is DisplayLink - // - if( [ [CCDirector class] isEqual:[self class]] ) - _sharedDirector = [[CC_DIRECTOR_DEFAULT alloc] init]; - else - _sharedDirector = [[self alloc] init]; - } - - return _sharedDirector; -} - -+(id)alloc -{ - NSAssert(_sharedDirector == nil, @"Attempted to allocate a second instance of a singleton."); - return [super alloc]; -} - -- (id) init -{ - CCLOG(@"cocos2d: %@", cocos2dVersion() ); - - if( (self=[super init] ) ) { - - CCLOG(@"cocos2d: Using Director Type:%@", [self class]); - - // scenes - runningScene_ = nil; - nextScene_ = nil; - - notificationNode_ = nil; - - oldAnimationInterval_ = animationInterval_ = 1.0 / kDefaultFPS; - scenesStack_ = [[NSMutableArray alloc] initWithCapacity:10]; - - // Set default projection (3D) - projection_ = kCCDirectorProjectionDefault; - - // projection delegate if "Custom" projection is used - delegate_ = nil; - - // FPS - displayStats_ = NO; - totalFrames_ = frames_ = 0; - - // paused ? - isPaused_ = NO; - - // running thread - runningThread_ = nil; - - // scheduler - scheduler_ = [[CCScheduler alloc] init]; - - // action manager - actionManager_ = [[CCActionManager alloc] init]; - [scheduler_ scheduleUpdateForTarget:actionManager_ priority:kCCPrioritySystem paused:NO]; - - winSizeInPixels_ = winSizeInPoints_ = CGSizeZero; - } - - return self; -} - -- (NSString*) description -{ - return [NSString stringWithFormat:@"<%@ = %p | Size: %0.f x %0.f, view = %@>", [self class], self, winSizeInPoints_.width, winSizeInPoints_.height, view_]; -} - -- (void) dealloc -{ - CCLOGINFO(@"cocos2d: deallocing %@", self); - - [FPSLabel_ release]; - [SPFLabel_ release]; - [drawsLabel_ release]; - [runningScene_ release]; - [notificationNode_ release]; - [scenesStack_ release]; - [scheduler_ release]; - [actionManager_ release]; - [delegate_ release]; - - _sharedDirector = nil; - - [super dealloc]; -} - --(void) setGLDefaultValues -{ - // This method SHOULD be called only after view_ was initialized - NSAssert( view_, @"view_ must be initialized"); - - [self setAlphaBlending: YES]; - [self setDepthTest: view_.depthFormat]; - [self setProjection: projection_]; - - // set other opengl default values - glClearColor(0.0f, 0.0f, 0.0f, 1.0f); -} - -// -// Draw the Scene -// -- (void) drawScene -{ - // Override me -} - --(void) calculateDeltaTime -{ - struct timeval now; - - if( gettimeofday( &now, NULL) != 0 ) { - CCLOG(@"cocos2d: error in gettimeofday"); - dt = 0; - return; - } - - // new delta time - if( nextDeltaTimeZero_ ) { - dt = 0; - nextDeltaTimeZero_ = NO; - } else { - dt = (now.tv_sec - lastUpdate_.tv_sec) + (now.tv_usec - lastUpdate_.tv_usec) / 1000000.0f; - dt = MAX(0,dt); - } - -#ifdef DEBUG - // If we are debugging our code, prevent big delta time - if( dt > 0.2f ) - dt = 1/60.0f; -#endif - - lastUpdate_ = now; -} - -#pragma mark Director - Memory Helper - --(void) purgeCachedData -{ - [CCLabelBMFont purgeCachedData]; - [[CCTextureCache sharedTextureCache] removeUnusedTextures]; - [[CCFileUtils sharedFileUtils] purgeCachedEntries]; -} - -#pragma mark Director - Scene OpenGL Helper - --(ccDirectorProjection) projection -{ - return projection_; -} - --(float) getZEye -{ - return ( winSizeInPixels_.height / 1.1566f / CC_CONTENT_SCALE_FACTOR() ); -} - --(void) setProjection:(ccDirectorProjection)projection -{ - CCLOG(@"cocos2d: override me"); -} - -- (void) setAlphaBlending: (BOOL) on -{ - if (on) { - ccGLEnable(CC_GL_BLEND); - ccGLBlendFunc(CC_BLEND_SRC, CC_BLEND_DST); - - } else - glDisable(GL_BLEND); - - CHECK_GL_ERROR_DEBUG(); -} - -- (void) setDepthTest: (BOOL) on -{ - if (on) { - glClearDepth(1.0f); - - glEnable(GL_DEPTH_TEST); - glDepthFunc(GL_LEQUAL); -// glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST); - } else - glDisable( GL_DEPTH_TEST ); - - CHECK_GL_ERROR_DEBUG(); -} - -#pragma mark Director Integration with a UIKit view - --(void) setView:(CCGLView*)view -{ -// NSAssert( view, @"OpenGLView must be non-nil"); - - if( view != view_ ) { - -#ifdef __CC_PLATFORM_IOS - [super setView:view]; -#endif - [view_ release]; - view_ = [view retain]; - - // set size - winSizeInPixels_ = winSizeInPoints_ = CCNSSizeToCGSize( [view_ bounds].size ); - - [self createStatsLabel]; - - // it could be nil - if( view ) - [self setGLDefaultValues]; - - CHECK_GL_ERROR_DEBUG(); - } -} - --(CCGLView*) view -{ - return view_; -} - - -#pragma mark Director Scene Landscape - --(CGPoint)convertToGL:(CGPoint)uiPoint -{ - CCLOG(@"CCDirector#convertToGL: OVERRIDE ME."); - return CGPointZero; -} - --(CGPoint)convertToUI:(CGPoint)glPoint -{ - CCLOG(@"CCDirector#convertToUI: OVERRIDE ME."); - return CGPointZero; -} - --(CGSize)winSize -{ - return winSizeInPoints_; -} - --(CGSize)winSizeInPixels -{ - return winSizeInPixels_; -} - --(void) reshapeProjection:(CGSize)newWindowSize -{ - winSizeInPixels_ = winSizeInPoints_ = newWindowSize; - [self setProjection:projection_]; -} - -#pragma mark Director Scene Management - -- (void)runWithScene:(CCScene*) scene -{ - NSAssert( scene != nil, @"Argument must be non-nil"); - - [self pushScene:scene]; - [self startAnimation]; -} - --(void) replaceScene: (CCScene*) scene -{ - NSAssert( scene != nil, @"Argument must be non-nil"); - - NSUInteger index = [scenesStack_ count]; - - sendCleanupToScene_ = YES; - [scenesStack_ replaceObjectAtIndex:index-1 withObject:scene]; - nextScene_ = scene; // nextScene_ is a weak ref -} - -- (void) pushScene: (CCScene*) scene -{ - NSAssert( scene != nil, @"Argument must be non-nil"); - - sendCleanupToScene_ = NO; - - [scenesStack_ addObject: scene]; - nextScene_ = scene; // nextScene_ is a weak ref -} - --(void) pushScene:(CCScene*) scene withTransition: (NSString*)transitionName duration:(ccTime)t { - - NSAssert( scene != nil, @"Argument must be non-nil"); - - Class transitionClass = NSClassFromString(transitionName); - BOOL classTest = [transitionClass respondsToSelector:@selector(transitionWithDuration:scene:)]; - NSString * errorMsg = [NSString stringWithFormat:@"The transition \"%@\" is not a valid transition.", transitionName]; - NSAssert (classTest, errorMsg); - - sendCleanupToScene_ = NO; - - CCScene* newScene = [transitionClass transitionWithDuration:t scene:scene]; - [scenesStack_ addObject: newScene]; - nextScene_ = newScene; // nextScene_ is a weak ref -} - --(void) pushScene:(CCScene*) scene withTransition:(NSString*)transitionName duration:(ccTime)t - withColor:(ccColor3B)color -{ - NSAssert( scene != nil, @"Argument must be non-nil"); - - Class transitionClass = NSClassFromString(transitionName); - BOOL classTest = [transitionClass respondsToSelector:@selector(transitionWithDuration:scene:withColor:)]; - NSString * errorMsg = [NSString stringWithFormat:@"The transition \"%@\" is not a valid transition.", transitionName]; - NSAssert (classTest, errorMsg); - - sendCleanupToScene_ = NO; - - CCScene* newScene = [transitionClass transitionWithDuration:t scene:scene withColor:color]; - [scenesStack_ addObject: newScene]; - nextScene_ = newScene; // nextScene_ is a weak ref -} - --(void) pushScene:(CCScene*) scene withTransition:(NSString*)transitionName duration:(ccTime)t - withOrientation:(tOrientation)orientation -{ - NSAssert( scene != nil, @"Argument must be non-nil"); - - Class transitionClass = NSClassFromString(transitionName); - BOOL classTest = [transitionClass respondsToSelector:@selector(transitionWithDuration:scene:withOrientation:)]; - NSString * errorMsg = [NSString stringWithFormat:@"The transition \"%@\" is not a valid transition.", transitionName]; - NSAssert (classTest, errorMsg); - - sendCleanupToScene_ = NO; - - CCScene* newScene = [transitionClass transitionWithDuration:t scene:scene withOrientation:orientation]; - [scenesStack_ addObject: newScene]; - nextScene_ = newScene; // nextScene_ is a weak ref - -} - --(void) popScene -{ - NSAssert( runningScene_ != nil, @"A running Scene is needed"); - - [scenesStack_ removeLastObject]; - NSUInteger c = [scenesStack_ count]; - - if( c == 0 ) - [self end]; - else { - sendCleanupToScene_ = YES; - nextScene_ = [scenesStack_ objectAtIndex:c-1]; - } -} - --(void) popSceneWithTransition:(NSString*)transitionName duration:(ccTime)t -{ - NSAssert( runningScene_ != nil, @"A running Scene is needed"); - - Class transitionClass = NSClassFromString(transitionName); - BOOL classTest = [transitionClass respondsToSelector:@selector(transitionWithDuration:scene:)]; - NSString * errorMsg = [NSString stringWithFormat:@"The transition \"%@\" is not a valid transition.", transitionName]; - NSAssert (classTest, errorMsg); - - [scenesStack_ removeLastObject]; - NSUInteger c = [scenesStack_ count]; - if( c == 0 ) { - [self end]; - } else { - CCScene* scene = [transitionClass transitionWithDuration:t scene:[scenesStack_ objectAtIndex:c-1]]; - [scenesStack_ replaceObjectAtIndex:c-1 withObject:scene]; - nextScene_ = scene; - } -} - --(void) popSceneWithTransition:(NSString*)transitionName duration:(ccTime)t - withColor:(ccColor3B)color -{ - NSAssert( runningScene_ != nil, @"A running Scene is needed"); - - Class transitionClass = NSClassFromString(transitionName); - BOOL classTest = [transitionClass respondsToSelector:@selector(transitionWithDuration:scene:withColor:)]; - NSString * errorMsg = [NSString stringWithFormat:@"The transition \"%@\" is not a valid transition.", transitionName]; - NSAssert (classTest, errorMsg); - - [scenesStack_ removeLastObject]; - NSUInteger c = [scenesStack_ count]; - if( c == 0 ) { - [self end]; - } else { - CCScene* scene = [transitionClass transitionWithDuration:t scene:[scenesStack_ objectAtIndex:c-1] withColor:color]; - [scenesStack_ replaceObjectAtIndex:c-1 withObject:scene]; - nextScene_ = scene; - } -} - --(void) popSceneWithTransition:(NSString*)transitionName duration:(ccTime)t - withOrientation:(tOrientation)orientation -{ - NSAssert( runningScene_ != nil, @"A running Scene is needed"); - - Class transitionClass = NSClassFromString(transitionName); - BOOL classTest = [transitionClass respondsToSelector:@selector(transitionWithDuration:scene:withOrientation:)]; - NSString * errorMsg = [NSString stringWithFormat:@"The transition \"%@\" is not a valid transition.", transitionName]; - NSAssert (classTest, errorMsg); - - [scenesStack_ removeLastObject]; - NSUInteger c = [scenesStack_ count]; - if( c == 0 ) { - [self end]; - } else { - CCScene* scene = [transitionClass transitionWithDuration:t scene:[scenesStack_ objectAtIndex:c-1] withOrientation:orientation]; - [scenesStack_ replaceObjectAtIndex:c-1 withObject:scene]; - nextScene_ = scene; - } -} - --(void) popToRootScene -{ - NSAssert(runningScene_ != nil, @"A running Scene is needed"); - NSUInteger c = [scenesStack_ count]; - - if (c == 1) { - [scenesStack_ removeLastObject]; - [self end]; - } else { - while (c > 1) { - CCScene *current = [scenesStack_ lastObject]; - if( [current isRunning] ) - [current onExit]; - [current cleanup]; - - [scenesStack_ removeLastObject]; - c--; - } - nextScene_ = [scenesStack_ lastObject]; - sendCleanupToScene_ = NO; - } -} - --(void) end -{ - [runningScene_ onExit]; - [runningScene_ cleanup]; - [runningScene_ release]; - - runningScene_ = nil; - nextScene_ = nil; - - // remove all objects, but don't release it. - // runWithScene might be executed after 'end'. - [scenesStack_ removeAllObjects]; - - [self stopAnimation]; - - [FPSLabel_ release]; - [SPFLabel_ release]; - [drawsLabel_ release]; - FPSLabel_ = nil, SPFLabel_=nil, drawsLabel_=nil; - - [delegate_ release]; - delegate_ = nil; - - [self setView:nil]; - - // Purge bitmap cache - [CCLabelBMFont purgeCachedData]; - - // Purge all managers / caches - [CCAnimationCache purgeSharedAnimationCache]; - [CCSpriteFrameCache purgeSharedSpriteFrameCache]; - [CCTextureCache purgeSharedTextureCache]; - [CCShaderCache purgeSharedShaderCache]; - [[CCFileUtils sharedFileUtils] purgeCachedEntries]; - - // OpenGL view - - // Since the director doesn't attach the openglview to the window - // it shouldn't remove it from the window too. -// [openGLView_ removeFromSuperview]; - - - // Invalidate GL state cache - ccGLInvalidateStateCache(); - - CHECK_GL_ERROR(); -} - --(void) setNextScene -{ - Class transClass = [CCTransitionScene class]; - BOOL runningIsTransition = [runningScene_ isKindOfClass:transClass]; - BOOL newIsTransition = [nextScene_ isKindOfClass:transClass]; - - // If it is not a transition, call onExit/cleanup - if( ! newIsTransition ) { - [runningScene_ onExit]; - - // issue #709. the root node (scene) should receive the cleanup message too - // otherwise it might be leaked. - if( sendCleanupToScene_) - [runningScene_ cleanup]; - } - - [runningScene_ release]; - - runningScene_ = [nextScene_ retain]; - nextScene_ = nil; - - if( ! runningIsTransition ) { - [runningScene_ onEnter]; - [runningScene_ onEnterTransitionDidFinish]; - } -} - --(void) pause -{ - if( isPaused_ ) - return; - - oldAnimationInterval_ = animationInterval_; - - // when paused, don't consume CPU - [self setAnimationInterval:1/4.0]; - - [self willChangeValueForKey:@"isPaused"]; - isPaused_ = YES; - [self didChangeValueForKey:@"isPaused"]; -} - --(void) resume -{ - if( ! isPaused_ ) - return; - - [self setAnimationInterval: oldAnimationInterval_]; - - if( gettimeofday( &lastUpdate_, NULL) != 0 ) { - CCLOG(@"cocos2d: Director: Error in gettimeofday"); - } - - [self willChangeValueForKey:@"isPaused"]; - isPaused_ = NO; - [self didChangeValueForKey:@"isPaused"]; - - dt = 0; -} - -- (void)startAnimation -{ - CCLOG(@"cocos2d: Director#startAnimation. Override me"); -} - -- (void)stopAnimation -{ - CCLOG(@"cocos2d: Director#stopAnimation. Override me"); -} - -- (void)setAnimationInterval:(NSTimeInterval)interval -{ - CCLOG(@"cocos2d: Director#setAnimationInterval. Override me"); -} - - -// display statistics --(void) showStats -{ - frames_++; - accumDt_ += dt; - - if( displayStats_ ) { - // Ms per Frame - - if( accumDt_ > CC_DIRECTOR_STATS_INTERVAL) - { - NSString *spfstr = [[NSString alloc] initWithFormat:@"%.3f", secondsPerFrame_]; - [SPFLabel_ setString:spfstr]; - [spfstr release]; - - frameRate_ = frames_/accumDt_; - frames_ = 0; - accumDt_ = 0; - -// sprintf(format,"%.1f",frameRate); -// [FPSLabel setCString:format]; - - NSString *fpsstr = [[NSString alloc] initWithFormat:@"%.1f", frameRate_]; - [FPSLabel_ setString:fpsstr]; - [fpsstr release]; - - NSString *draws = [[NSString alloc] initWithFormat:@"%4lu", (unsigned long)__ccNumberOfDraws]; - [drawsLabel_ setString:draws]; - [draws release]; - } - - [drawsLabel_ visit]; - [FPSLabel_ visit]; - [SPFLabel_ visit]; - } - - __ccNumberOfDraws = 0; -} - --(void) calculateMPF -{ - struct timeval now; - gettimeofday( &now, NULL); - - secondsPerFrame_ = (now.tv_sec - lastUpdate_.tv_sec) + (now.tv_usec - lastUpdate_.tv_usec) / 1000000.0f; -} - -#pragma mark Director - Helper - --(void) createStatsLabel -{ - if( FPSLabel_ && SPFLabel_ ) { - CCTexture2D *texture = [FPSLabel_ texture]; - - [FPSLabel_ release]; - [SPFLabel_ release]; - [drawsLabel_ release]; - [[CCTextureCache sharedTextureCache ] removeTexture:texture]; - FPSLabel_ = nil; - SPFLabel_ = nil; - drawsLabel_ = nil; - - [[CCFileUtils sharedFileUtils] purgeCachedEntries]; - } - - CCTexture2DPixelFormat currentFormat = [CCTexture2D defaultAlphaPixelFormat]; - [CCTexture2D setDefaultAlphaPixelFormat:kCCTexture2DPixelFormat_RGBA4444]; - FPSLabel_ = [[CCLabelAtlas alloc] initWithString:@"00.0" charMapFile:@"fps_images.png" itemWidth:12 itemHeight:32 startCharMap:'.']; - SPFLabel_ = [[CCLabelAtlas alloc] initWithString:@"0.000" charMapFile:@"fps_images.png" itemWidth:12 itemHeight:32 startCharMap:'.']; - drawsLabel_ = [[CCLabelAtlas alloc] initWithString:@"000" charMapFile:@"fps_images.png" itemWidth:12 itemHeight:32 startCharMap:'.']; - - [CCTexture2D setDefaultAlphaPixelFormat:currentFormat]; - - [drawsLabel_ setPosition: ccpAdd( ccp(0,34), CC_DIRECTOR_STATS_POSITION ) ]; - [SPFLabel_ setPosition: ccpAdd( ccp(0,17), CC_DIRECTOR_STATS_POSITION ) ]; - [FPSLabel_ setPosition: CC_DIRECTOR_STATS_POSITION ]; -} - -@end - diff --git a/src/cocos2d/CCGLProgram.m b/src/cocos2d/CCGLProgram.m deleted file mode 100644 index 676ab20..0000000 --- a/src/cocos2d/CCGLProgram.m +++ /dev/null @@ -1,406 +0,0 @@ -// -// Copyright 2011 Jeff Lamarche -// -// Copyright 2012 Goffredo Marocchi -// -// Copyright 2012 Ricardo Quesada -// -// -// Redistribution and use in source and binary forms, with or without modification, are permitted provided -// that the following conditions are met: -// 1. Redistributions of source code must retain the above copyright notice, this list of conditions and -// the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions -// and the following disclaimer in the documentation and/or other materials provided with the -// distribution. -// -// THIS SOFTWARE IS PROVIDED BY THE FREEBSD PROJECT ``AS IS'' AND ANY EXPRESS OR IMPLIED -// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -// FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FREEBSD PROJECT -// OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED -// AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - -#import "CCGLProgram.h" -#import "ccGLStateCache.h" -#import "ccMacros.h" -#import "Support/CCFileUtils.h" -#import "Support/uthash.h" -#import "Support/OpenGL_Internal.h" - -// extern -#import "kazmath/GL/matrix.h" -#import "kazmath/kazmath.h" - - -typedef struct _hashUniformEntry -{ - GLvoid *value; // value - NSUInteger location; // Key - UT_hash_handle hh; // hash entry -} tHashUniformEntry; - - -#pragma mark Function Pointer Definitions -typedef void (*GLInfoFunction)(GLuint program, - GLenum pname, - GLint* params); -typedef void (*GLLogFunction) (GLuint program, - GLsizei bufsize, - GLsizei* length, - GLchar* infolog); -#pragma mark - -#pragma mark Private Extension Method Declaration - -@interface CCGLProgram() -- (BOOL)compileShader:(GLuint *)shader type:(GLenum)type byteArray:(const GLchar*)byteArray; - -- (NSString *)logForOpenGLObject:(GLuint)object infoCallback:(GLInfoFunction)infoFunc logFunc:(GLLogFunction)logFunc; -@end - -#pragma mark - - -@implementation CCGLProgram -- (id)initWithVertexShaderByteArray:(const GLchar *)vShaderByteArray fragmentShaderByteArray:(const GLchar *)fShaderByteArray -{ - if ((self = [super init]) ) - { - program_ = glCreateProgram(); - - vertShader_ = fragShader_ = 0; - - if( vShaderByteArray ) { - - if (![self compileShader:&vertShader_ - type:GL_VERTEX_SHADER - byteArray:vShaderByteArray] ) - CCLOG(@"cocos2d: ERROR: Failed to compile vertex shader"); - } - - // Create and compile fragment shader - if( fShaderByteArray ) { - if (![self compileShader:&fragShader_ - type:GL_FRAGMENT_SHADER - byteArray:fShaderByteArray] ) - - CCLOG(@"cocos2d: ERROR: Failed to compile fragment shader"); - } - - if( vertShader_ ) - glAttachShader(program_, vertShader_); - - if( fragShader_ ) - glAttachShader(program_, fragShader_); - - hashForUniforms_ = NULL; - } - - return self; -} - -- (id)initWithVertexShaderFilename:(NSString *)vShaderFilename fragmentShaderFilename:(NSString *)fShaderFilename -{ - - const GLchar * vertexSource = (GLchar*) [[NSString stringWithContentsOfFile:[[CCFileUtils sharedFileUtils] fullPathFromRelativePath:vShaderFilename] encoding:NSUTF8StringEncoding error:nil] UTF8String]; - const GLchar * fragmentSource = (GLchar*) [[NSString stringWithContentsOfFile:[[CCFileUtils sharedFileUtils] fullPathFromRelativePath:fShaderFilename] encoding:NSUTF8StringEncoding error:nil] UTF8String]; - - NSAssert1( !vShaderFilename || (vShaderFilename && vertexSource), @"vertex shader: %@ - file not found", vShaderFilename ); - NSAssert1( !fShaderFilename || (fShaderFilename && fragmentSource), @"fragment shader: %@ - file not found", fShaderFilename ); - - return [self initWithVertexShaderByteArray:vertexSource fragmentShaderByteArray:fragmentSource]; -} - -- (NSString*) description -{ - return [NSString stringWithFormat:@"<%@ = %p | Program = %i, VertexShader = %i, FragmentShader = %i>", [self class], self, program_, vertShader_, fragShader_]; -} - - -- (BOOL)compileShader:(GLuint *)shader type:(GLenum)type byteArray:(const GLchar *)source -{ - GLint status; - - if (!source) - return NO; - - *shader = glCreateShader(type); - glShaderSource(*shader, 1, &source, NULL); - glCompileShader(*shader); - - glGetShaderiv(*shader, GL_COMPILE_STATUS, &status); - - if( ! status ) { - if( type == GL_VERTEX_SHADER ) - CCLOG(@"cocos2d: %@", [self vertexShaderLog] ); - else - CCLOG(@"cocos2d: %@", [self fragmentShaderLog] ); - - } - return ( status == GL_TRUE ); -} - -#pragma mark - - -- (void)addAttribute:(NSString *)attributeName index:(GLuint)index -{ - glBindAttribLocation(program_, - index, - [attributeName UTF8String]); -} - --(void) updateUniforms -{ - // All of the below gl methods will fail if _program is not valid - NSAssert( program_ != 0, @"Cannot update uniforms without a valid shader program" ); - - // Since sample most probably won't change, set it to 0 now. - - uniforms_[kCCUniformMVPMatrix] = glGetUniformLocation(program_, kCCUniformMVPMatrix_s); - - uniforms_[kCCUniformSampler] = glGetUniformLocation(program_, kCCUniformSampler_s); - - [self use]; - - [self setUniformLocation:uniforms_[kCCUniformSampler] withI1:0]; -} - -#pragma mark - - -- (BOOL)link -{ - NSAssert(program_ != 0, @"Cannot link invalid program"); - - GLint status = GL_TRUE; - glLinkProgram(program_); - - if (vertShader_) { - glDeleteShader(vertShader_); - } - if (fragShader_) { - glDeleteShader(fragShader_); - } - vertShader_ = fragShader_ = 0; - -#if DEBUG - glGetProgramiv(program_, GL_LINK_STATUS, &status); - NSString* log = self.programLog; - - if (status == GL_FALSE) { - NSLog(@"cocos2d: ERROR: Failed to link program: %i - %@", program_, log); - ccGLDeleteProgram( program_ ); - program_ = 0; - } -#endif - - return status == GL_TRUE; -} - -- (void)use -{ - ccGLUseProgram(program_); -} - -#pragma mark - - -- (NSString *)logForOpenGLObject:(GLuint)object - infoCallback:(GLInfoFunction)infoFunc - logFunc:(GLLogFunction)logFunc -{ - GLint logLength = 0, charsWritten = 0; - - infoFunc(object, GL_INFO_LOG_LENGTH, &logLength); - if (logLength < 1) - return nil; - - char *logBytes = malloc(logLength); - logFunc(object, logLength, &charsWritten, logBytes); - NSString *log = [[[NSString alloc] initWithBytes:logBytes - length:logLength - encoding:NSUTF8StringEncoding] - autorelease]; - free(logBytes); - return log; -} - -- (NSString *)vertexShaderLog -{ - return [self logForOpenGLObject:vertShader_ - infoCallback:(GLInfoFunction)&glGetShaderiv - logFunc:(GLLogFunction)&glGetShaderInfoLog]; - -} - -- (NSString *)fragmentShaderLog -{ - return [self logForOpenGLObject:fragShader_ - infoCallback:(GLInfoFunction)&glGetShaderiv - logFunc:(GLLogFunction)&glGetShaderInfoLog]; -} - -- (NSString *)programLog -{ - return [self logForOpenGLObject:program_ - infoCallback:(GLInfoFunction)&glGetProgramiv - logFunc:(GLLogFunction)&glGetProgramInfoLog]; -} - -#pragma mark - Uniform cache - --(BOOL) updateUniformLocation:(NSUInteger)location withData:(GLvoid*)data sizeOfData:(NSUInteger)bytes -{ - BOOL updated = YES; - tHashUniformEntry *element = NULL; - HASH_FIND_INT(hashForUniforms_, &location, element); - - if( ! element ) { - - element = malloc( sizeof(*element) ); - - // key - element->location = location; - - // value - element->value = malloc( bytes ); - memcpy(element->value, data, bytes ); - - HASH_ADD_INT(hashForUniforms_, location, element); - } - else - { - if( memcmp( element->value, data, bytes) == 0 ) - updated = NO; - else - memcpy( element->value, data, bytes ); - } - - return updated; -} - --(void) setUniformLocation:(NSUInteger)location withI1:(GLint)i1 -{ - BOOL updated = [self updateUniformLocation:location withData:&i1 sizeOfData:sizeof(i1)*1]; - - if( updated ) - glUniform1i( (GLint)location, i1); -} - --(void) setUniformLocation:(NSUInteger)location withF1:(GLfloat)f1 -{ - BOOL updated = [self updateUniformLocation:location withData:&f1 sizeOfData:sizeof(f1)*1]; - - if( updated ) - glUniform1f( (GLint)location, f1); -} - --(void) setUniformLocation:(NSUInteger)location withF1:(GLfloat)f1 f2:(GLfloat)f2 -{ - GLfloat floats[2] = {f1,f2}; - BOOL updated = [self updateUniformLocation:location withData:floats sizeOfData:sizeof(floats)]; - - if( updated ) - glUniform2f( (GLint)location, f1, f2); -} - --(void) setUniformLocation:(NSUInteger)location withF1:(GLfloat)f1 f2:(GLfloat)f2 f3:(GLfloat)f3 -{ - GLfloat floats[3] = {f1,f2,f3}; - BOOL updated = [self updateUniformLocation:location withData:floats sizeOfData:sizeof(floats)]; - - if( updated ) - glUniform3f( (GLint)location, f1, f2, f3); -} - --(void) setUniformLocation:(NSUInteger)location withF1:(GLfloat)f1 f2:(GLfloat)f2 f3:(GLfloat)f3 f4:(GLfloat)f4 -{ - GLfloat floats[4] = {f1,f2,f3,f4}; - BOOL updated = [self updateUniformLocation:location withData:floats sizeOfData:sizeof(floats)]; - - if( updated ) - glUniform4f( (GLint)location, f1, f2, f3,f4); -} - --(void) setUniformLocation:(NSUInteger)location with2fv:(GLfloat*)floats count:(NSUInteger)numberOfArrays -{ - BOOL updated = [self updateUniformLocation:location withData:floats sizeOfData:sizeof(float)*2*numberOfArrays]; - - if( updated ) - glUniform2fv( (GLint)location, (GLsizei)numberOfArrays, floats ); -} - --(void) setUniformLocation:(NSUInteger)location with3fv:(GLfloat*)floats count:(NSUInteger)numberOfArrays -{ - BOOL updated = [self updateUniformLocation:location withData:floats sizeOfData:sizeof(float)*3*numberOfArrays]; - - if( updated ) - glUniform3fv( (GLint)location, (GLsizei)numberOfArrays, floats ); -} - --(void) setUniformLocation:(NSUInteger)location with4fv:(GLvoid*)floats count:(NSUInteger)numberOfArrays -{ - BOOL updated = [self updateUniformLocation:location withData:floats sizeOfData:sizeof(float)*4*numberOfArrays]; - - if( updated ) - glUniform4fv( (GLint)location, (GLsizei)numberOfArrays, floats ); -} - - --(void) setUniformLocation:(NSUInteger)location withMatrix4fv:(GLvoid*)matrixArray count:(NSUInteger)numberOfMatrices -{ - BOOL updated = [self updateUniformLocation:location withData:matrixArray sizeOfData:sizeof(float)*16*numberOfMatrices]; - - if( updated ) - glUniformMatrix4fv( (GLint)location, (GLsizei)numberOfMatrices, GL_FALSE, matrixArray); -} - --(void) setUniformForModelViewProjectionMatrix -{ - kmMat4 matrixP; - kmMat4 matrixMV; - kmMat4 matrixMVP; - - kmGLGetMatrix(KM_GL_PROJECTION, &matrixP ); - kmGLGetMatrix(KM_GL_MODELVIEW, &matrixMV ); - - kmMat4Multiply(&matrixMVP, &matrixP, &matrixMV); - - [self setUniformLocation:uniforms_[kCCUniformMVPMatrix] withMatrix4fv:matrixMVP.mat count:1]; -} - -- (GLint)uniformLocationForName:(NSString*)name -{ - NSAssert(name != nil, @"Invalid uniform name" ); - NSAssert(program_ != 0, @"Invalid operation. Cannot get uniform location when program is not initialized"); - - return glGetUniformLocation(program_, [name UTF8String]); -} - -#pragma mark - - -- (void)dealloc -{ - CCLOGINFO( @"cocos2d: deallocing %@", self); - - // there is no need to delete the shaders. They should have been already deleted. - NSAssert( vertShader_ == 0, @"Vertex Shaders should have been already deleted"); - NSAssert( fragShader_ == 0, @"Vertex Shaders should have been already deleted"); - - if (program_) - ccGLDeleteProgram(program_); - - tHashUniformEntry *current_element, *tmp; - - // Purge uniform hash - HASH_ITER(hh, hashForUniforms_, current_element, tmp) { - HASH_DEL(hashForUniforms_, current_element); - free(current_element->value); - free(current_element); - } - - [super dealloc]; -} -@end diff --git a/src/cocos2d/CCLabelTTF.m b/src/cocos2d/CCLabelTTF.m deleted file mode 100644 index 6eec6d8..0000000 --- a/src/cocos2d/CCLabelTTF.m +++ /dev/null @@ -1,301 +0,0 @@ -/* - * cocos2d for iPhone: http://www.cocos2d-iphone.org - * - * Copyright (c) 2008-2010 Ricardo Quesada - * Copyright (c) 2011 Zynga Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - * - */ - - -#import "CCLabelTTF.h" -#import "Support/CGPointExtension.h" -#import "ccMacros.h" -#import "CCShaderCache.h" -#import "CCGLProgram.h" -#import "Support/CCFileUtils.h" -#import "ccDeprecated.h" - -#ifdef __CC_PLATFORM_IOS -#import "Platforms/iOS/CCDirectorIOS.h" -#endif - -#if CC_USE_LA88_LABELS -#define SHADER_PROGRAM kCCShader_PositionTextureColor -#else -#define SHADER_PROGRAM kCCShader_PositionTextureA8Color -#endif - -@interface CCLabelTTF () --(void) updateTexture; -@end - -@implementation CCLabelTTF - -// - -+ (id) labelWithString:(NSString*)string fontName:(NSString*)name fontSize:(CGFloat)size -{ - return [[[self alloc] initWithString:string fontName:name fontSize:size]autorelease]; -} - -// hAlignment -+ (id) labelWithString:(NSString*)string dimensions:(CGSize)dimensions hAlignment:(CCTextAlignment)alignment fontName:(NSString*)name fontSize:(CGFloat)size -{ - return [[[self alloc] initWithString: string dimensions:dimensions hAlignment:alignment vAlignment:kCCVerticalTextAlignmentTop lineBreakMode:kCCLineBreakModeWordWrap fontName:name fontSize:size]autorelease]; -} - -// hAlignment, vAlignment -+ (id) labelWithString:(NSString*)string dimensions:(CGSize)dimensions hAlignment:(CCTextAlignment)alignment vAlignment:(CCVerticalTextAlignment) vertAlignment fontName:(NSString*)name fontSize:(CGFloat)size -{ - return [[[self alloc] initWithString: string dimensions:dimensions hAlignment:alignment vAlignment:vertAlignment fontName:name fontSize:size]autorelease]; -} - -// hAlignment, lineBreakMode -+ (id) labelWithString:(NSString*)string dimensions:(CGSize)dimensions hAlignment:(CCTextAlignment)alignment lineBreakMode:(CCLineBreakMode)lineBreakMode fontName:(NSString*)name fontSize:(CGFloat)size; -{ - return [[[self alloc] initWithString: string dimensions:dimensions hAlignment:alignment vAlignment:kCCVerticalTextAlignmentTop lineBreakMode:lineBreakMode fontName:name fontSize:size]autorelease]; -} - -// hAlignment, vAlignment, lineBreakMode -+ (id) labelWithString:(NSString*)string dimensions:(CGSize)dimensions hAlignment:(CCTextAlignment)alignment vAlignment:(CCVerticalTextAlignment) vertAlignment lineBreakMode:(CCLineBreakMode)lineBreakMode fontName:(NSString*)name fontSize:(CGFloat)size; -{ - return [[[self alloc] initWithString: string dimensions:dimensions hAlignment:alignment vAlignment:vertAlignment lineBreakMode:lineBreakMode fontName:name fontSize:size]autorelease]; -} - -- (id) init -{ - return [self initWithString:@"" fontName:@"Helvetica" fontSize:12]; -} - -- (id) initWithString:(NSString*)str fontName:(NSString*)name fontSize:(CGFloat)size -{ - return [self initWithString:str dimensions:CGSizeZero hAlignment:kCCTextAlignmentLeft vAlignment:kCCVerticalTextAlignmentTop lineBreakMode:kCCLineBreakModeWordWrap fontName:name fontSize:size]; -} - -// hAlignment -- (id) initWithString:(NSString*)str dimensions:(CGSize)dimensions hAlignment:(CCTextAlignment)alignment fontName:(NSString*)name fontSize:(CGFloat)size -{ - return [self initWithString:str dimensions:dimensions hAlignment:alignment vAlignment:kCCVerticalTextAlignmentTop lineBreakMode:kCCLineBreakModeWordWrap fontName:name fontSize:size]; -} - -// hAlignment, vAlignment -- (id) initWithString:(NSString*)str dimensions:(CGSize)dimensions hAlignment:(CCTextAlignment)alignment vAlignment:(CCVerticalTextAlignment) vertAlignment fontName:(NSString*)name fontSize:(CGFloat)size -{ - return [self initWithString:str dimensions:dimensions hAlignment:alignment vAlignment:vertAlignment lineBreakMode:kCCLineBreakModeWordWrap fontName:name fontSize:size]; -} - -// hAlignment, lineBreakMode -- (id) initWithString:(NSString*)str dimensions:(CGSize)dimensions hAlignment:(CCTextAlignment)alignment lineBreakMode:(CCLineBreakMode)lineBreakMode fontName:(NSString*)name fontSize:(CGFloat)size -{ - return [self initWithString:str dimensions:dimensions hAlignment:alignment vAlignment:kCCVerticalTextAlignmentTop lineBreakMode:lineBreakMode fontName:name fontSize:size]; -} - -// hAlignment, vAligment, lineBreakMode -- (id) initWithString:(NSString*)str dimensions:(CGSize)dimensions hAlignment:(CCTextAlignment)alignment vAlignment:(CCVerticalTextAlignment) vertAlignment lineBreakMode:(CCLineBreakMode)lineBreakMode fontName:(NSString*)name fontSize:(CGFloat)size -{ - if( (self=[super init]) ) { - - // shader program - self.shaderProgram = [[CCShaderCache sharedShaderCache] programForKey:SHADER_PROGRAM]; - - dimensions_ = dimensions; - hAlignment_ = alignment; - vAlignment_ = vertAlignment; - fontName_ = [name retain]; - fontSize_ = size; - lineBreakMode_ = lineBreakMode; - - [self setString:str]; - } - return self; -} - -- (void) setString:(NSString*)str -{ - NSAssert( str, @"Invalid string" ); - - if( string_.hash != str.hash ) { - [string_ release]; - string_ = [str copy]; - - [self updateTexture]; - } -} - --(NSString*) string -{ - return string_; -} - -- (void)setFontName:(NSString*)fontName -{ - if( fontName.hash != fontName_.hash ) { - [fontName_ release]; - fontName_ = [fontName copy]; - -#ifdef __CC_PLATFORM_MAC - if ([[fontName lowercaseString] hasSuffix:@".ttf"] || YES) - { - // This is a file, register font with font manager - NSString* fontFile = [[CCFileUtils sharedFileUtils] fullPathFromRelativePath:fontName]; - NSURL* fontURL = [NSURL fileURLWithPath:fontFile]; - CTFontManagerRegisterFontsForURL((CFURLRef)fontURL, kCTFontManagerScopeProcess, NULL); - NSString *newFontName = [[fontFile lastPathComponent] stringByDeletingPathExtension]; - - fontName_ = [newFontName copy]; - } -#endif - // Force update - if( string_ ) - [self updateTexture]; - } -} - -- (NSString*)fontName -{ - return fontName_; -} - -- (void) setFontSize:(float)fontSize -{ - if( fontSize != fontSize_ ) { - fontSize_ = fontSize; - - // Force update - if( string_ ) - [self updateTexture]; - } -} - -- (float) fontSize -{ - return fontSize_; -} - --(void) setDimensions:(CGSize) dim -{ - if( dim.width != dimensions_.width || dim.height != dimensions_.height) - { - dimensions_ = dim; - - // Force update - if( string_ ) - [self updateTexture]; - } -} - --(CGSize) dimensions -{ - return dimensions_; -} - --(void) setHorizontalAlignment:(CCTextAlignment)alignment -{ - if (alignment != hAlignment_) - { - hAlignment_ = alignment; - - // Force update - if( string_ ) - [self updateTexture]; - - } -} - -- (CCTextAlignment) horizontalAlignment -{ - return hAlignment_; -} - --(void) setVerticalAlignment:(CCVerticalTextAlignment)verticalAlignment -{ - if (vAlignment_ != verticalAlignment) - { - vAlignment_ = verticalAlignment; - - // Force update - if( string_ ) - [self updateTexture]; - } -} - -- (CCVerticalTextAlignment) verticalAlignment -{ - return vAlignment_; -} - -- (void) dealloc -{ - [string_ release]; - [fontName_ release]; - - [super dealloc]; -} - -- (NSString*) description -{ - // XXX: string_, fontName_ can't be displayed here, since they might be already released - - return [NSString stringWithFormat:@"<%@ = %p | FontSize = %.1f>", [self class], self, fontSize_]; -} - -// Helper -- (void) updateTexture -{ - CCTexture2D *tex; - if( dimensions_.width == 0 || dimensions_.height == 0 ) - tex = [[CCTexture2D alloc] initWithString:string_ - fontName:fontName_ - fontSize:fontSize_ * CC_CONTENT_SCALE_FACTOR()]; - else - tex = [[CCTexture2D alloc] initWithString:string_ - dimensions:CC_SIZE_POINTS_TO_PIXELS(dimensions_) - hAlignment:hAlignment_ - vAlignment:vAlignment_ - lineBreakMode:lineBreakMode_ - fontName:fontName_ - fontSize:fontSize_ * CC_CONTENT_SCALE_FACTOR()]; - -#ifdef __CC_PLATFORM_IOS - // iPad ? - if( UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad ) { - if( CC_CONTENT_SCALE_FACTOR() == 2 ) - [tex setResolutionType:kCCResolutioniPadRetinaDisplay]; - else - [tex setResolutionType:kCCResolutioniPad]; - } - // iPhone ? - else - { - if( CC_CONTENT_SCALE_FACTOR() == 2 ) - [tex setResolutionType:kCCResolutioniPhoneRetinaDisplay]; - else - [tex setResolutionType:kCCResolutioniPhone]; - } -#endif - - [self setTexture:tex]; - [tex release]; - - CGRect rect = CGRectZero; - rect.size = [texture_ contentSize]; - [self setTextureRect: rect]; -} -@end diff --git a/src/cocos2d/CCLayer.m b/src/cocos2d/CCLayer.m deleted file mode 100644 index ee30bdb..0000000 --- a/src/cocos2d/CCLayer.m +++ /dev/null @@ -1,628 +0,0 @@ -/* - * cocos2d for iPhone: http://www.cocos2d-iphone.org - * - * Copyright (c) 2008-2010 Ricardo Quesada - * Copyright (c) 2011 Zynga Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - * - */ - - -#import - -#import "Platforms/CCGL.h" - -#import "CCLayer.h" -#import "CCDirector.h" -#import "ccMacros.h" -#import "CCShaderCache.h" -#import "CCGLProgram.h" -#import "ccGLStateCache.h" -#import "Support/TransformUtils.h" -#import "Support/CGPointExtension.h" - -#ifdef __CC_PLATFORM_IOS -#import "Platforms/iOS/CCTouchDispatcher.h" -#import "Platforms/iOS/CCDirectorIOS.h" -#elif defined(__CC_PLATFORM_MAC) -#import "Platforms/Mac/CCEventDispatcher.h" -#import "Platforms/Mac/CCDirectorMac.h" -#endif - -// extern -#import "kazmath/GL/matrix.h" - -#pragma mark - -#pragma mark Layer - -@implementation CCLayer - -#pragma mark Layer - Init --(id) init -{ - if( (self=[super init]) ) { - - CGSize s = [[CCDirector sharedDirector] winSize]; - anchorPoint_ = ccp(0.5f, 0.5f); - [self setContentSize:s]; - self.ignoreAnchorPointForPosition = YES; - - isTouchEnabled_ = NO; - -#ifdef __CC_PLATFORM_IOS - isAccelerometerEnabled_ = NO; -#elif defined(__CC_PLATFORM_MAC) - isMouseEnabled_ = NO; - isKeyboardEnabled_ = NO; -#endif - } - - return self; -} - -#pragma mark Layer - Touch and Accelerometer related - -#ifdef __CC_PLATFORM_IOS --(void) registerWithTouchDispatcher -{ - CCDirector *director = [CCDirector sharedDirector]; - [[director touchDispatcher] addStandardDelegate:self priority:0]; -} - --(BOOL) isAccelerometerEnabled -{ - return isAccelerometerEnabled_; -} - --(void) setIsAccelerometerEnabled:(BOOL)enabled -{ - if( enabled != isAccelerometerEnabled_ ) { - isAccelerometerEnabled_ = enabled; - if( isRunning_ ) { - if( enabled ) - [[UIAccelerometer sharedAccelerometer] setDelegate:self]; - else - [[UIAccelerometer sharedAccelerometer] setDelegate:nil]; - } - } -} - --(BOOL) isTouchEnabled -{ - return isTouchEnabled_; -} - --(void) setIsTouchEnabled:(BOOL)enabled -{ - if( isTouchEnabled_ != enabled ) { - isTouchEnabled_ = enabled; - if( isRunning_ ) { - if( enabled ) - [self registerWithTouchDispatcher]; - else { - CCDirector *director = [CCDirector sharedDirector]; - [[director touchDispatcher] removeDelegate:self]; - } - } - } -} - -#elif defined(__CC_PLATFORM_MAC) - -#pragma mark CCLayer - Mouse, Keyboard & Touch events - --(NSInteger) mouseDelegatePriority -{ - return 0; -} - --(BOOL) isMouseEnabled -{ - return isMouseEnabled_; -} - --(void) setIsMouseEnabled:(BOOL)enabled -{ - if( isMouseEnabled_ != enabled ) { - isMouseEnabled_ = enabled; - - if( isRunning_ ) { - CCDirector *director = [CCDirector sharedDirector]; - if( enabled ) - [[director eventDispatcher] addMouseDelegate:self priority:[self mouseDelegatePriority]]; - else - [[director eventDispatcher] removeMouseDelegate:self]; - } - } -} - --(NSInteger) keyboardDelegatePriority -{ - return 0; -} - --(BOOL) isKeyboardEnabled -{ - return isKeyboardEnabled_; -} - --(void) setIsKeyboardEnabled:(BOOL)enabled -{ - if( isKeyboardEnabled_ != enabled ) { - isKeyboardEnabled_ = enabled; - - if( isRunning_ ) { - CCDirector *director = [CCDirector sharedDirector]; - if( enabled ) - [[director eventDispatcher] addKeyboardDelegate:self priority:[self keyboardDelegatePriority] ]; - else - [[director eventDispatcher] removeKeyboardDelegate:self]; - } - } -} - --(NSInteger) touchDelegatePriority -{ - return 0; -} - --(BOOL) isTouchEnabled -{ - return isTouchEnabled_; -} - --(void) setIsTouchEnabled:(BOOL)enabled -{ - if( isTouchEnabled_ != enabled ) { - isTouchEnabled_ = enabled; - if( isRunning_ ) { - CCDirector *director = [CCDirector sharedDirector]; - if( enabled ) - [[director eventDispatcher] addTouchDelegate:self priority:[self touchDelegatePriority]]; - else - [[director eventDispatcher] removeTouchDelegate:self]; - } - } -} - - -#endif // Mac - - -#pragma mark Layer - Callbacks --(void) onEnter -{ -#ifdef __CC_PLATFORM_IOS - // register 'parent' nodes first - // since events are propagated in reverse order - if (isTouchEnabled_) - [self registerWithTouchDispatcher]; - -#elif defined(__CC_PLATFORM_MAC) - CCDirector *director = [CCDirector sharedDirector]; - CCEventDispatcher *eventDispatcher = [director eventDispatcher]; - - if( isMouseEnabled_ ) - [eventDispatcher addMouseDelegate:self priority:[self mouseDelegatePriority]]; - - if( isKeyboardEnabled_) - [eventDispatcher addKeyboardDelegate:self priority:[self keyboardDelegatePriority]]; - - if( isTouchEnabled_) - [eventDispatcher addTouchDelegate:self priority:[self touchDelegatePriority]]; - -#endif - - // then iterate over all the children - [super onEnter]; -} - -// issue #624. -// Can't register mouse, touches here because of #issue #1018, and #1021 --(void) onEnterTransitionDidFinish -{ -#ifdef __CC_PLATFORM_IOS - if( isAccelerometerEnabled_ ) - [[UIAccelerometer sharedAccelerometer] setDelegate:self]; -#endif - - [super onEnterTransitionDidFinish]; -} - - --(void) onExit -{ - CCDirector *director = [CCDirector sharedDirector]; - -#ifdef __CC_PLATFORM_IOS - if( isTouchEnabled_ ) - [[director touchDispatcher] removeDelegate:self]; - - if( isAccelerometerEnabled_ ) - [[UIAccelerometer sharedAccelerometer] setDelegate:nil]; - -#elif defined(__CC_PLATFORM_MAC) - CCEventDispatcher *eventDispatcher = [director eventDispatcher]; - if( isMouseEnabled_ ) - [eventDispatcher removeMouseDelegate:self]; - - if( isKeyboardEnabled_ ) - [eventDispatcher removeKeyboardDelegate:self]; - - if( isTouchEnabled_ ) - [eventDispatcher removeTouchDelegate:self]; - -#endif - - [super onExit]; -} - -#ifdef __CC_PLATFORM_IOS --(BOOL) ccTouchBegan:(UITouch *)touch withEvent:(UIEvent *)event -{ - NSAssert(NO, @"Layer#ccTouchBegan override me"); - return YES; -} -#endif -@end - -#pragma mark - -#pragma mark LayerColor - -@interface CCLayerColor (Private) --(void) updateColor; -@end - -@implementation CCLayerColor - -// Opacity and RGB color protocol -@synthesize opacity = opacity_, color = color_; -@synthesize blendFunc = blendFunc_; - - -+ (id) layerWithColor:(ccColor4B)color width:(GLfloat)w height:(GLfloat) h -{ - return [[[self alloc] initWithColor:color width:w height:h] autorelease]; -} - -+ (id) layerWithColor:(ccColor4B)color -{ - return [[(CCLayerColor*)[self alloc] initWithColor:color] autorelease]; -} - --(id) init -{ - CGSize s = [[CCDirector sharedDirector] winSize]; - return [self initWithColor:ccc4(0,0,0,0) width:s.width height:s.height]; -} - -// Designated initializer -- (id) initWithColor:(ccColor4B)color width:(GLfloat)w height:(GLfloat) h -{ - if( (self=[super init]) ) { - - // default blend function - blendFunc_ = (ccBlendFunc) { GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA }; - - color_.r = color.r; - color_.g = color.g; - color_.b = color.b; - opacity_ = color.a; - - for (NSUInteger i = 0; i", [self class], self, (long)tag_]; -} - -- (void) dealloc -{ - CCLOGINFO( @"cocos2d: deallocing %@", self); - - [actionManager_ release]; - [scheduler_ release]; - [camera_ release]; - [grid_ release]; - [shaderProgram_ release]; - [userObject_ release]; - - // children - CCNode *child; - CCARRAY_FOREACH(children_, child) - child.parent = nil; - - [children_ release]; - - [super dealloc]; -} - -#pragma mark Setters - -// getters synthesized, setters explicit --(void) setRotation: (float)newRotation -{ - rotation_ = newRotation; - isTransformDirty_ = isInverseDirty_ = YES; -} - --(void) setScaleX: (float)newScaleX -{ - scaleX_ = newScaleX; - isTransformDirty_ = isInverseDirty_ = YES; -} - --(void) setScaleY: (float)newScaleY -{ - scaleY_ = newScaleY; - isTransformDirty_ = isInverseDirty_ = YES; -} - --(void) setSkewX:(float)newSkewX -{ - skewX_ = newSkewX; - isTransformDirty_ = isInverseDirty_ = YES; -} - --(void) setSkewY:(float)newSkewY -{ - skewY_ = newSkewY; - isTransformDirty_ = isInverseDirty_ = YES; -} - --(void) setPosition: (CGPoint)newPosition -{ - position_ = newPosition; - isTransformDirty_ = isInverseDirty_ = YES; -} - --(void) setIgnoreAnchorPointForPosition: (BOOL)newValue -{ - if( newValue != ignoreAnchorPointForPosition_ ) { - ignoreAnchorPointForPosition_ = newValue; - isTransformDirty_ = isInverseDirty_ = YES; - } -} - --(void) setAnchorPoint:(CGPoint)point -{ - if( ! CGPointEqualToPoint(point, anchorPoint_) ) { - anchorPoint_ = point; - anchorPointInPoints_ = ccp( contentSize_.width * anchorPoint_.x, contentSize_.height * anchorPoint_.y ); - isTransformDirty_ = isInverseDirty_ = YES; - } -} - --(void) setContentSize:(CGSize)size -{ - if( ! CGSizeEqualToSize(size, contentSize_) ) { - contentSize_ = size; - - anchorPointInPoints_ = ccp( contentSize_.width * anchorPoint_.x, contentSize_.height * anchorPoint_.y ); - isTransformDirty_ = isInverseDirty_ = YES; - } -} - -- (CGRect) boundingBox -{ - CGRect rect = CGRectMake(0, 0, contentSize_.width, contentSize_.height); - return CGRectApplyAffineTransform(rect, [self nodeToParentTransform]); -} - --(void) setVertexZ:(float)vertexZ -{ - vertexZ_ = vertexZ; -} - --(float) scale -{ - NSAssert( scaleX_ == scaleY_, @"CCNode#scale. ScaleX != ScaleY. Don't know which one to return"); - return scaleX_; -} - --(void) setScale:(float) s -{ - scaleX_ = scaleY_ = s; - isTransformDirty_ = isInverseDirty_ = YES; -} - -- (void) setZOrder:(NSInteger)zOrder -{ - [self _setZOrder:zOrder]; - - if (parent_) - [parent_ reorderChild:self z:zOrder]; -} - -#pragma mark CCNode Composition - --(void) childrenAlloc -{ - children_ = [[CCArray alloc] initWithCapacity:4]; -} - -// camera: lazy alloc --(CCCamera*) camera -{ - if( ! camera_ ) { - camera_ = [[CCCamera alloc] init]; - - // by default, center camera at the Sprite's anchor point -// [camera_ setCenterX:anchorPointInPoints_.x centerY:anchorPointInPoints_.y centerZ:0]; -// [camera_ setEyeX:anchorPointInPoints_.x eyeY:anchorPointInPoints_.y eyeZ:1]; - -// [camera_ setCenterX:0 centerY:0 centerZ:0]; -// [camera_ setEyeX:0 eyeY:0 eyeZ:1]; - } - - return camera_; -} - --(CCNode*) getChildByTag:(NSInteger) aTag -{ - NSAssert( aTag != kCCNodeTagInvalid, @"Invalid tag"); - - CCNode *node; - CCARRAY_FOREACH(children_, node){ - if( node.tag == aTag ) - return node; - } - // not found - return nil; -} - -/* "add" logic MUST only be on this method - * If a class want's to extend the 'addChild' behaviour it only needs - * to override this method - */ --(void) addChild: (CCNode*) child z:(NSInteger)z tag:(NSInteger) aTag -{ - NSAssert( child != nil, @"Argument must be non-nil"); - NSAssert( child.parent == nil, @"child already added. It can't be added again"); - - if( ! children_ ) - [self childrenAlloc]; - - [self insertChild:child z:z]; - - child.tag = aTag; - - [child setParent: self]; - - [child setOrderOfArrival: globalOrderOfArrival++]; - - if( isRunning_ ) { - [child onEnter]; - [child onEnterTransitionDidFinish]; - } -} - --(void) addChild: (CCNode*) child z:(NSInteger)z -{ - NSAssert( child != nil, @"Argument must be non-nil"); - [self addChild:child z:z tag:child.tag]; -} - --(void) addChild: (CCNode*) child -{ - NSAssert( child != nil, @"Argument must be non-nil"); - [self addChild:child z:child.zOrder tag:child.tag]; -} - --(void) removeFromParentAndCleanup:(BOOL)cleanup -{ - [parent_ removeChild:self cleanup:cleanup]; -} - -/* "remove" logic MUST only be on this method - * If a class want's to extend the 'removeChild' behavior it only needs - * to override this method - */ --(void) removeChild: (CCNode*)child cleanup:(BOOL)cleanup -{ - // explicit nil handling - if (child == nil) - return; - - if ( [children_ containsObject:child] ) - [self detachChild:child cleanup:cleanup]; -} - --(void) removeChildByTag:(NSInteger)aTag cleanup:(BOOL)cleanup -{ - NSAssert( aTag != kCCNodeTagInvalid, @"Invalid tag"); - - CCNode *child = [self getChildByTag:aTag]; - - if (child == nil) - CCLOG(@"cocos2d: removeChildByTag: child not found!"); - else - [self removeChild:child cleanup:cleanup]; -} - --(void) removeAllChildrenWithCleanup:(BOOL)cleanup -{ - // not using detachChild improves speed here - CCNode *c; - CCARRAY_FOREACH(children_, c) - { - // IMPORTANT: - // -1st do onExit - // -2nd cleanup - if (isRunning_) - { - [c onExitTransitionDidStart]; - [c onExit]; - } - - if (cleanup) - [c cleanup]; - - // set parent nil at the end (issue #476) - [c setParent:nil]; - } - - [children_ removeAllObjects]; -} - --(void) detachChild:(CCNode *)child cleanup:(BOOL)doCleanup -{ - // IMPORTANT: - // -1st do onExit - // -2nd cleanup - if (isRunning_) - { - [child onExitTransitionDidStart]; - [child onExit]; - } - - // If you don't do cleanup, the child's actions will not get removed and the - // its scheduledSelectors_ dict will not get released! - if (doCleanup) - [child cleanup]; - - // set parent nil at the end (issue #476) - [child setParent:nil]; - - [children_ removeObject:child]; -} - -// used internally to alter the zOrder variable. DON'T call this method manually --(void) _setZOrder:(NSInteger) z -{ - zOrder_ = z; -} - -// helper used by reorderChild & add --(void) insertChild:(CCNode*)child z:(NSInteger)z -{ - isReorderChildDirty_=YES; - - ccArrayAppendObjectWithResize(children_->data, child); - [child _setZOrder:z]; -} - --(void) reorderChild:(CCNode*) child z:(NSInteger)z -{ - NSAssert( child != nil, @"Child must be non-nil"); - - isReorderChildDirty_ = YES; - - [child setOrderOfArrival: globalOrderOfArrival++]; - [child _setZOrder:z]; -} - -- (void) sortAllChildren -{ - if (isReorderChildDirty_) - { - NSInteger i,j,length = children_->data->num; - CCNode ** x = children_->data->arr; - CCNode *tempItem; - - // insertion sort - for(i=1; i=0 && ( tempItem.zOrder < x[j].zOrder || ( tempItem.zOrder== x[j].zOrder && tempItem.orderOfArrival < x[j].orderOfArrival ) ) ) - { - x[j+1] = x[j]; - j = j-1; - } - x[j+1] = tempItem; - } - - //don't need to check children recursively, that's done in visit of each child - - isReorderChildDirty_ = NO; - } -} - -#pragma mark CCNode Draw - --(void) draw -{ -} - --(void) visit -{ - // quick return if not visible. children won't be drawn. - if (!visible_) - return; - - kmGLPushMatrix(); - - if ( grid_ && grid_.active) - [grid_ beforeDraw]; - - [self transform]; - - if(children_) { - - [self sortAllChildren]; - - ccArray *arrayData = children_->data; - NSUInteger i = 0; - - // draw children zOrder < 0 - for( ; i < arrayData->num; i++ ) { - CCNode *child = arrayData->arr[i]; - if ( [child zOrder] < 0 ) - [child visit]; - else - break; - } - - // self draw - [self draw]; - - // draw children zOrder >= 0 - for( ; i < arrayData->num; i++ ) { - CCNode *child = arrayData->arr[i]; - [child visit]; - } - - } else - [self draw]; - - // reset for next frame - orderOfArrival_ = 0; - - if ( grid_ && grid_.active) - [grid_ afterDraw:self]; - - kmGLPopMatrix(); -} - -#pragma mark CCNode - Transformations - --(void) transformAncestors -{ - if( parent_ ) { - [parent_ transformAncestors]; - [parent_ transform]; - } -} - --(void) transform -{ - kmMat4 transfrom4x4; - - // Convert 3x3 into 4x4 matrix - CGAffineTransform tmpAffine = [self nodeToParentTransform]; - CGAffineToGL(&tmpAffine, transfrom4x4.mat); - - // Update Z vertex manually - transfrom4x4.mat[14] = vertexZ_; - - kmGLMultMatrix( &transfrom4x4 ); - - - // XXX: Expensive calls. Camera should be integrated into the cached affine matrix - if ( camera_ && !(grid_ && grid_.active) ) - { - BOOL translate = (anchorPointInPoints_.x != 0.0f || anchorPointInPoints_.y != 0.0f); - - if( translate ) - kmGLTranslatef(RENDER_IN_SUBPIXEL(anchorPointInPoints_.x), RENDER_IN_SUBPIXEL(anchorPointInPoints_.y), 0 ); - - [camera_ locate]; - - if( translate ) - kmGLTranslatef(RENDER_IN_SUBPIXEL(-anchorPointInPoints_.x), RENDER_IN_SUBPIXEL(-anchorPointInPoints_.y), 0 ); - } -} - -#pragma mark CCNode SceneManagement - --(void) onEnter -{ - [children_ makeObjectsPerformSelector:@selector(onEnter)]; - [self resumeSchedulerAndActions]; - - isRunning_ = YES; -} - --(void) onEnterTransitionDidFinish -{ - [children_ makeObjectsPerformSelector:@selector(onEnterTransitionDidFinish)]; -} - --(void) onExitTransitionDidStart -{ - [children_ makeObjectsPerformSelector:@selector(onExitTransitionDidStart)]; -} - --(void) onExit -{ - [self pauseSchedulerAndActions]; - isRunning_ = NO; - - [children_ makeObjectsPerformSelector:@selector(onExit)]; -} - -#pragma mark CCNode Actions - --(void) setActionManager:(CCActionManager *)actionManager -{ - if( actionManager != actionManager_ ) { - [self stopAllActions]; - [actionManager_ release]; - - actionManager_ = [actionManager retain]; - } -} - --(CCActionManager*) actionManager -{ - return actionManager_; -} - --(CCAction*) runAction:(CCAction*) action -{ - NSAssert( action != nil, @"Argument must be non-nil"); - - [actionManager_ addAction:action target:self paused:!isRunning_]; - return action; -} - --(void) stopAllActions -{ - [actionManager_ removeAllActionsFromTarget:self]; -} - --(void) stopAction: (CCAction*) action -{ - [actionManager_ removeAction:action]; -} - --(void) stopActionByTag:(NSInteger)aTag -{ - NSAssert( aTag != kCCActionTagInvalid, @"Invalid tag"); - [actionManager_ removeActionByTag:aTag target:self]; -} - --(CCAction*) getActionByTag:(NSInteger) aTag -{ - NSAssert( aTag != kCCActionTagInvalid, @"Invalid tag"); - return [actionManager_ getActionByTag:aTag target:self]; -} - --(NSUInteger) numberOfRunningActions -{ - return [actionManager_ numberOfRunningActionsInTarget:self]; -} - -#pragma mark CCNode - Scheduler - --(void) setScheduler:(CCScheduler *)scheduler -{ - if( scheduler != scheduler_ ) { - [self unscheduleAllSelectors]; - [scheduler_ release]; - - scheduler_ = [scheduler retain]; - } -} - --(CCScheduler*) scheduler -{ - return scheduler_; -} - --(void) scheduleUpdate -{ - [self scheduleUpdateWithPriority:0]; -} - --(void) scheduleUpdateWithPriority:(NSInteger)priority -{ - [scheduler_ scheduleUpdateForTarget:self priority:priority paused:!isRunning_]; -} - --(void) unscheduleUpdate -{ - [scheduler_ unscheduleUpdateForTarget:self]; -} - --(void) schedule:(SEL)selector -{ - [self schedule:selector interval:0 repeat:kCCRepeatForever delay:0]; -} - --(void) schedule:(SEL)selector interval:(ccTime)interval -{ - [self schedule:selector interval:interval repeat:kCCRepeatForever delay:0]; -} - --(void) schedule:(SEL)selector interval:(ccTime)interval repeat: (uint) repeat delay:(ccTime) delay -{ - NSAssert( selector != nil, @"Argument must be non-nil"); - NSAssert( interval >=0, @"Arguemnt must be positive"); - - [scheduler_ scheduleSelector:selector forTarget:self interval:interval paused:!isRunning_ repeat:repeat delay:delay]; -} - -- (void) scheduleOnce:(SEL) selector delay:(ccTime) delay -{ - [self schedule:selector interval:0.f repeat:0 delay:delay]; -} - --(void) unschedule:(SEL)selector -{ - // explicit nil handling - if (selector == nil) - return; - - [scheduler_ unscheduleSelector:selector forTarget:self]; -} - --(void) unscheduleAllSelectors -{ - [scheduler_ unscheduleAllSelectorsForTarget:self]; -} -- (void) resumeSchedulerAndActions -{ - [scheduler_ resumeTarget:self]; - [actionManager_ resumeTarget:self]; -} - -- (void) pauseSchedulerAndActions -{ - [scheduler_ pauseTarget:self]; - [actionManager_ pauseTarget:self]; -} - -#pragma mark CCNode Transform - -- (CGAffineTransform)nodeToParentTransform -{ - if ( isTransformDirty_ ) { - - // Translate values - float x = position_.x; - float y = position_.y; - - if ( ignoreAnchorPointForPosition_ ) { - x += anchorPointInPoints_.x; - y += anchorPointInPoints_.y; - } - - // Rotation values - float c = 1, s = 0; - if( rotation_ ) { - float radians = -CC_DEGREES_TO_RADIANS(rotation_); - c = cosf(radians); - s = sinf(radians); - } - - BOOL needsSkewMatrix = ( skewX_ || skewY_ ); - - - // optimization: - // inline anchor point calculation if skew is not needed - if( !needsSkewMatrix && !CGPointEqualToPoint(anchorPointInPoints_, CGPointZero) ) { - x += c * -anchorPointInPoints_.x * scaleX_ + -s * -anchorPointInPoints_.y * scaleY_; - y += s * -anchorPointInPoints_.x * scaleX_ + c * -anchorPointInPoints_.y * scaleY_; - } - - - // Build Transform Matrix - transform_ = CGAffineTransformMake( c * scaleX_, s * scaleX_, - -s * scaleY_, c * scaleY_, - x, y ); - - // XXX: Try to inline skew - // If skew is needed, apply skew and then anchor point - if( needsSkewMatrix ) { - CGAffineTransform skewMatrix = CGAffineTransformMake(1.0f, tanf(CC_DEGREES_TO_RADIANS(skewY_)), - tanf(CC_DEGREES_TO_RADIANS(skewX_)), 1.0f, - 0.0f, 0.0f ); - transform_ = CGAffineTransformConcat(skewMatrix, transform_); - - // adjust anchor point - if( ! CGPointEqualToPoint(anchorPointInPoints_, CGPointZero) ) - transform_ = CGAffineTransformTranslate(transform_, -anchorPointInPoints_.x, -anchorPointInPoints_.y); - } - - isTransformDirty_ = NO; - } - - return transform_; -} - -- (CGAffineTransform)parentToNodeTransform -{ - if ( isInverseDirty_ ) { - inverse_ = CGAffineTransformInvert([self nodeToParentTransform]); - isInverseDirty_ = NO; - } - - return inverse_; -} - -- (CGAffineTransform)nodeToWorldTransform -{ - CGAffineTransform t = [self nodeToParentTransform]; - - for (CCNode *p = parent_; p != nil; p = p.parent) - t = CGAffineTransformConcat(t, [p nodeToParentTransform]); - - return t; -} - -- (CGAffineTransform)worldToNodeTransform -{ - return CGAffineTransformInvert([self nodeToWorldTransform]); -} - -- (CGPoint)convertToNodeSpace:(CGPoint)worldPoint -{ - CGPoint ret = CGPointApplyAffineTransform(worldPoint, [self worldToNodeTransform]); - return ret; -} - -- (CGPoint)convertToWorldSpace:(CGPoint)nodePoint -{ - CGPoint ret = CGPointApplyAffineTransform(nodePoint, [self nodeToWorldTransform]); - return ret; -} - -- (CGPoint)convertToNodeSpaceAR:(CGPoint)worldPoint -{ - CGPoint nodePoint = [self convertToNodeSpace:worldPoint]; - return ccpSub(nodePoint, anchorPointInPoints_); -} - -- (CGPoint)convertToWorldSpaceAR:(CGPoint)nodePoint -{ - nodePoint = ccpAdd(nodePoint, anchorPointInPoints_); - return [self convertToWorldSpace:nodePoint]; -} - -- (CGPoint)convertToWindowSpace:(CGPoint)nodePoint -{ - CGPoint worldPoint = [self convertToWorldSpace:nodePoint]; - return [[CCDirector sharedDirector] convertToUI:worldPoint]; -} - -// convenience methods which take a UITouch instead of CGPoint - -#ifdef __CC_PLATFORM_IOS - -- (CGPoint)convertTouchToNodeSpace:(UITouch *)touch -{ - CGPoint point = [touch locationInView: [touch view]]; - point = [[CCDirector sharedDirector] convertToGL: point]; - return [self convertToNodeSpace:point]; -} - -- (CGPoint)convertTouchToNodeSpaceAR:(UITouch *)touch -{ - CGPoint point = [touch locationInView: [touch view]]; - point = [[CCDirector sharedDirector] convertToGL: point]; - return [self convertToNodeSpaceAR:point]; -} - -#endif // __CC_PLATFORM_IOS - - -@end diff --git a/src/cocos2d/CCRenderTargetNode.m b/src/cocos2d/CCRenderTargetNode.m deleted file mode 100644 index 4961a11..0000000 --- a/src/cocos2d/CCRenderTargetNode.m +++ /dev/null @@ -1,101 +0,0 @@ -// -// Created by krzysztof.zablocki on 8/19/12. -// -// -// - -#import "CCRenderTargetNode.h" -#import "CCRenderTexture.h" -#import "CCGrid.h" -#import "kazmath/mat4.h" -#import "kazmath/GL/matrix.h" - -@implementation CCRenderTargetNode { - CCRenderTexture *renderTexture_; - GLbitfield clearFlags_; - ccColor4F clearColor_; - GLfloat clearDepth_; - GLint clearStencil_; -} -@synthesize clearFlags = clearFlags_; -@synthesize clearColor = clearColor_; -@synthesize clearDepth = clearDepth_; -@synthesize clearStencil = clearStencil_; - - -- (id)initWithRenderTexture:(CCRenderTexture *)renderTexture -{ - self = [super init]; - if (self) { - renderTexture_ = renderTexture; - } - return self; -} - -- (void)visit -{ - // override visit. - // Don't call visit on its children - - if (!visible_) { - return; - } - - kmGLPushMatrix(); - - if (grid_ && grid_.active) { - [grid_ beforeDraw]; - [self transformAncestors]; - } - - [self sortAllChildren]; - [self transform]; - [self draw]; - - if (grid_ && grid_.active) { - [grid_ afterDraw:self]; - } - - kmGLPopMatrix(); - - orderOfArrival_ = 0; - -} - -- (void)draw -{ - NSAssert(renderTexture_ != nil, @"RenderTexture is needed by CCRenderTargetNode"); - - BOOL requireClearing = self.clearFlags != 0; - - [renderTexture_ begin]; - - if (requireClearing) { - // save previous clear color - GLfloat clearColor[4]; - GLfloat depthClearValue; - int stencilClearValue; - glGetFloatv(GL_COLOR_CLEAR_VALUE, clearColor); - glGetFloatv(GL_DEPTH_CLEAR_VALUE, &depthClearValue); - glGetIntegerv(GL_STENCIL_CLEAR_VALUE, &stencilClearValue); - - glClearColor(self.clearColor.r, self.clearColor.g, self.clearColor.b, self.clearColor.a); - glClearDepth(self.clearDepth); - glClearStencil(self.clearStencil); - glClear(self.clearFlags); - - // restore clear colors - glClearColor(clearColor[0], clearColor[1], clearColor[2], clearColor[3]); - glClearDepth(depthClearValue); - glClearStencil(stencilClearValue); - } - - //! make sure all children are drawn - CCNode *child; - CCARRAY_FOREACH(children_, child) { - [child visit]; - } - - [renderTexture_ end]; -} -@end diff --git a/src/cocos2d/CCTransition.m b/src/cocos2d/CCTransition.m deleted file mode 100644 index 1b1abdf..0000000 --- a/src/cocos2d/CCTransition.m +++ /dev/null @@ -1,1067 +0,0 @@ -/* - * cocos2d for iPhone: http://www.cocos2d-iphone.org - * - * Copyright (c) 2008-2010 Ricardo Quesada - * Copyright (c) 2011 Zynga Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - * - */ - - - -#import "CCTransition.h" -#import "CCNode.h" -#import "CCSprite.h" -#import "CCDirector.h" -#import "CCActionInterval.h" -#import "CCActionInstant.h" -#import "CCActionCamera.h" -#import "CCLayer.h" -#import "CCCamera.h" -#import "CCActionTiledGrid.h" -#import "CCActionEase.h" -#import "CCRenderTexture.h" -#import "ccMacros.h" -#import "Support/CGPointExtension.h" - -#ifdef __CC_PLATFORM_IOS -#import "Platforms/iOS/CCTouchDispatcher.h" -#import "Platforms/iOS/CCDirectorIOS.h" -#elif defined(__CC_PLATFORM_MAC) -#import "Platforms/Mac/CCDirectorMac.h" -#import "Platforms/Mac/CCEventDispatcher.h" -#endif - -const NSInteger kSceneFade = 0xFADEFADE; - - -@interface CCTransitionScene (Private) --(void) sceneOrder; -- (void)setNewScene:(ccTime)dt; -@end - -@implementation CCTransitionScene -+(id) transitionWithDuration:(ccTime) t scene:(CCScene*)s -{ - return [[[self alloc] initWithDuration:t scene:s] autorelease]; -} - --(id) initWithDuration:(ccTime) t scene:(CCScene*)s -{ - NSAssert( s != nil, @"Argument scene must be non-nil"); - - if( (self=[super init]) ) { - - duration_ = t; - - // retain - inScene_ = [s retain]; - outScene_ = [[CCDirector sharedDirector] runningScene]; - [outScene_ retain]; - - NSAssert( inScene_ != outScene_, @"Incoming scene must be different from the outgoing scene" ); - - // disable events while transitions - CCDirector *director = [CCDirector sharedDirector]; -#ifdef __CC_PLATFORM_IOS - [[director touchDispatcher] setDispatchEvents: NO]; -#elif defined(__CC_PLATFORM_MAC) - [[director eventDispatcher] setDispatchEvents: NO]; -#endif - - [self sceneOrder]; - } - return self; -} --(void) sceneOrder -{ - inSceneOnTop_ = YES; -} - --(void) draw -{ - [super draw]; - - if( inSceneOnTop_ ) { - [outScene_ visit]; - [inScene_ visit]; - } else { - [inScene_ visit]; - [outScene_ visit]; - } -} - --(void) finish -{ - /* clean up */ - [inScene_ setVisible:YES]; - [inScene_ setPosition:ccp(0,0)]; - [inScene_ setScale:1.0f]; - [inScene_ setRotation:0.0f]; - [inScene_.camera restore]; - - [outScene_ setVisible:NO]; - [outScene_ setPosition:ccp(0,0)]; - [outScene_ setScale:1.0f]; - [outScene_ setRotation:0.0f]; - [outScene_.camera restore]; - - [self schedule:@selector(setNewScene:) interval:0]; -} - --(void) setNewScene: (ccTime) dt -{ - [self unschedule:_cmd]; - - CCDirector *director = [CCDirector sharedDirector]; - - // Before replacing, save the "send cleanup to scene" - sendCleanupToScene_ = [director sendCleanupToScene]; - - [director replaceScene: inScene_]; - - // enable events while transitions -#ifdef __CC_PLATFORM_IOS - [[director touchDispatcher] setDispatchEvents: YES]; -#elif defined(__CC_PLATFORM_MAC) - [[director eventDispatcher] setDispatchEvents: YES]; -#endif - - // issue #267 - [outScene_ setVisible:YES]; -} - --(void) hideOutShowIn -{ - [inScene_ setVisible:YES]; - [outScene_ setVisible:NO]; -} - -// custom onEnter --(void) onEnter -{ - [super onEnter]; - - // outScene_ should not receive the onExit callback - // only the onExitTransitionDidStart - [outScene_ onExitTransitionDidStart]; - - [inScene_ onEnter]; -} - -// custom onExit --(void) onExit -{ - [super onExit]; - [outScene_ onExit]; - - // inScene_ should not receive the onEnter callback - // only the onEnterTransitionDidFinish - [inScene_ onEnterTransitionDidFinish]; -} - -// custom cleanup --(void) cleanup -{ - [super cleanup]; - - if( sendCleanupToScene_ ) - [outScene_ cleanup]; -} - --(void) dealloc -{ - [inScene_ release]; - [outScene_ release]; - [super dealloc]; -} -@end - -// -// Oriented Transition -// -@implementation CCTransitionSceneOriented -+(id) transitionWithDuration:(ccTime) t scene:(CCScene*)s withOrientation:(tOrientation)o -{ - return [[[self alloc] initWithDuration:t scene:s withOrientation:o] autorelease]; -} - --(id) initWithDuration:(ccTime) t scene:(CCScene*)s withOrientation:(tOrientation)o -{ - if( (self=[super initWithDuration:t scene:s]) ) - orientation = o; - return self; -} -@end - - -// -// RotoZoom -// -@implementation CCTransitionRotoZoom --(void) onEnter -{ - [super onEnter]; - - [inScene_ setScale:0.001f]; - [outScene_ setScale:1.0f]; - - [inScene_ setAnchorPoint:ccp(0.5f, 0.5f)]; - [outScene_ setAnchorPoint:ccp(0.5f, 0.5f)]; - - CCActionInterval *rotozoom = [CCSequence actions: [CCSpawn actions: - [CCScaleBy actionWithDuration:duration_/2 scale:0.001f], - [CCRotateBy actionWithDuration:duration_/2 angle:360 *2], - nil], - [CCDelayTime actionWithDuration:duration_/2], - nil]; - - - [outScene_ runAction: rotozoom]; - [inScene_ runAction: [CCSequence actions: - [rotozoom reverse], - [CCCallFunc actionWithTarget:self selector:@selector(finish)], - nil]]; -} -@end - -// -// JumpZoom -// -@implementation CCTransitionJumpZoom --(void) onEnter -{ - [super onEnter]; - CGSize s = [[CCDirector sharedDirector] winSize]; - - [inScene_ setScale:0.5f]; - [inScene_ setPosition:ccp( s.width,0 )]; - - [inScene_ setAnchorPoint:ccp(0.5f, 0.5f)]; - [outScene_ setAnchorPoint:ccp(0.5f, 0.5f)]; - - CCActionInterval *jump = [CCJumpBy actionWithDuration:duration_/4 position:ccp(-s.width,0) height:s.width/4 jumps:2]; - CCActionInterval *scaleIn = [CCScaleTo actionWithDuration:duration_/4 scale:1.0f]; - CCActionInterval *scaleOut = [CCScaleTo actionWithDuration:duration_/4 scale:0.5f]; - - CCActionInterval *jumpZoomOut = [CCSequence actions: scaleOut, jump, nil]; - CCActionInterval *jumpZoomIn = [CCSequence actions: jump, scaleIn, nil]; - - CCActionInterval *delay = [CCDelayTime actionWithDuration:duration_/2]; - - [outScene_ runAction: jumpZoomOut]; - [inScene_ runAction: [CCSequence actions: delay, - jumpZoomIn, - [CCCallFunc actionWithTarget:self selector:@selector(finish)], - nil] ]; -} -@end - -// -// MoveInL -// -@implementation CCTransitionMoveInL --(void) onEnter -{ - [super onEnter]; - - [self initScenes]; - - CCActionInterval *a = [self action]; - - [inScene_ runAction: [CCSequence actions: - [self easeActionWithAction:a], - [CCCallFunc actionWithTarget:self selector:@selector(finish)], - nil] - ]; - -} --(CCActionInterval*) action -{ - return [CCMoveTo actionWithDuration:duration_ position:ccp(0,0)]; -} - --(CCActionInterval*) easeActionWithAction:(CCActionInterval*)action -{ - return [CCEaseOut actionWithAction:action rate:2.0f]; -// return [EaseElasticOut actionWithAction:action period:0.4f]; -} - --(void) initScenes -{ - CGSize s = [[CCDirector sharedDirector] winSize]; - [inScene_ setPosition: ccp( -s.width,0) ]; -} -@end - -// -// MoveInR -// -@implementation CCTransitionMoveInR --(void) initScenes -{ - CGSize s = [[CCDirector sharedDirector] winSize]; - [inScene_ setPosition: ccp( s.width,0) ]; -} -@end - -// -// MoveInT -// -@implementation CCTransitionMoveInT --(void) initScenes -{ - CGSize s = [[CCDirector sharedDirector] winSize]; - [inScene_ setPosition: ccp( 0, s.height) ]; -} -@end - -// -// MoveInB -// -@implementation CCTransitionMoveInB --(void) initScenes -{ - CGSize s = [[CCDirector sharedDirector] winSize]; - [inScene_ setPosition: ccp( 0, -s.height) ]; -} -@end - -// -// SlideInL -// - -// The adjust factor is needed to prevent issue #442 -// One solution is to use DONT_RENDER_IN_SUBPIXELS images, but NO -// The other issue is that in some transitions (and I don't know why) -// the order should be reversed (In in top of Out or vice-versa). -#define ADJUST_FACTOR 0.5f -@implementation CCTransitionSlideInL --(void) onEnter -{ - [super onEnter]; - - [self initScenes]; - - CCActionInterval *in = [self action]; - CCActionInterval *out = [self action]; - - id inAction = [self easeActionWithAction:in]; - id outAction = [CCSequence actions: - [self easeActionWithAction:out], - [CCCallFunc actionWithTarget:self selector:@selector(finish)], - nil]; - - [inScene_ runAction: inAction]; - [outScene_ runAction: outAction]; -} --(void) sceneOrder -{ - inSceneOnTop_ = NO; -} --(void) initScenes -{ - CGSize s = [[CCDirector sharedDirector] winSize]; - [inScene_ setPosition: ccp( -(s.width-ADJUST_FACTOR),0) ]; -} --(CCActionInterval*) action -{ - CGSize s = [[CCDirector sharedDirector] winSize]; - return [CCMoveBy actionWithDuration:duration_ position:ccp(s.width-ADJUST_FACTOR,0)]; -} - --(CCActionInterval*) easeActionWithAction:(CCActionInterval*)action -{ - return [CCEaseOut actionWithAction:action rate:2.0f]; -// return [EaseElasticOut actionWithAction:action period:0.4f]; -} - -@end - -// -// SlideInR -// -@implementation CCTransitionSlideInR --(void) sceneOrder -{ - inSceneOnTop_ = YES; -} --(void) initScenes -{ - CGSize s = [[CCDirector sharedDirector] winSize]; - [inScene_ setPosition: ccp( s.width-ADJUST_FACTOR,0) ]; -} - --(CCActionInterval*) action -{ - CGSize s = [[CCDirector sharedDirector] winSize]; - return [CCMoveBy actionWithDuration:duration_ position:ccp(-(s.width-ADJUST_FACTOR),0)]; -} - -@end - -// -// SlideInT -// -@implementation CCTransitionSlideInT --(void) sceneOrder -{ - inSceneOnTop_ = NO; -} --(void) initScenes -{ - CGSize s = [[CCDirector sharedDirector] winSize]; - [inScene_ setPosition: ccp(0,s.height-ADJUST_FACTOR) ]; -} - --(CCActionInterval*) action -{ - CGSize s = [[CCDirector sharedDirector] winSize]; - return [CCMoveBy actionWithDuration:duration_ position:ccp(0,-(s.height-ADJUST_FACTOR))]; -} - -@end - -// -// SlideInB -// -@implementation CCTransitionSlideInB --(void) sceneOrder -{ - inSceneOnTop_ = YES; -} - --(void) initScenes -{ - CGSize s = [[CCDirector sharedDirector] winSize]; - [inScene_ setPosition: ccp(0,-(s.height-ADJUST_FACTOR)) ]; -} - --(CCActionInterval*) action -{ - CGSize s = [[CCDirector sharedDirector] winSize]; - return [CCMoveBy actionWithDuration:duration_ position:ccp(0,s.height-ADJUST_FACTOR)]; -} -@end - -// -// ShrinkGrow Transition -// -@implementation CCTransitionShrinkGrow --(void) onEnter -{ - [super onEnter]; - - [inScene_ setScale:0.001f]; - [outScene_ setScale:1.0f]; - - [inScene_ setAnchorPoint:ccp(2/3.0f,0.5f)]; - [outScene_ setAnchorPoint:ccp(1/3.0f,0.5f)]; - - CCActionInterval *scaleOut = [CCScaleTo actionWithDuration:duration_ scale:0.01f]; - CCActionInterval *scaleIn = [CCScaleTo actionWithDuration:duration_ scale:1.0f]; - - [inScene_ runAction: [self easeActionWithAction:scaleIn]]; - [outScene_ runAction: [CCSequence actions: - [self easeActionWithAction:scaleOut], - [CCCallFunc actionWithTarget:self selector:@selector(finish)], - nil] ]; -} --(CCActionInterval*) easeActionWithAction:(CCActionInterval*)action -{ - return [CCEaseOut actionWithAction:action rate:2.0f]; -// return [EaseElasticOut actionWithAction:action period:0.3f]; -} -@end - -// -// FlipX Transition -// -@implementation CCTransitionFlipX --(void) onEnter -{ - [super onEnter]; - - CCActionInterval *inA, *outA; - [inScene_ setVisible: NO]; - - float inDeltaZ, inAngleZ; - float outDeltaZ, outAngleZ; - - if( orientation == kOrientationRightOver ) { - inDeltaZ = 90; - inAngleZ = 270; - outDeltaZ = 90; - outAngleZ = 0; - } else { - inDeltaZ = -90; - inAngleZ = 90; - outDeltaZ = -90; - outAngleZ = 0; - } - - inA = [CCSequence actions: - [CCDelayTime actionWithDuration:duration_/2], - [CCShow action], - [CCOrbitCamera actionWithDuration: duration_/2 radius: 1 deltaRadius:0 angleZ:inAngleZ deltaAngleZ:inDeltaZ angleX:0 deltaAngleX:0], - [CCCallFunc actionWithTarget:self selector:@selector(finish)], - nil ]; - outA = [CCSequence actions: - [CCOrbitCamera actionWithDuration: duration_/2 radius: 1 deltaRadius:0 angleZ:outAngleZ deltaAngleZ:outDeltaZ angleX:0 deltaAngleX:0], - [CCHide action], - [CCDelayTime actionWithDuration:duration_/2], - nil ]; - - [inScene_ runAction: inA]; - [outScene_ runAction: outA]; - -} -@end - -// -// FlipY Transition -// -@implementation CCTransitionFlipY --(void) onEnter -{ - [super onEnter]; - - CCActionInterval *inA, *outA; - [inScene_ setVisible: NO]; - - float inDeltaZ, inAngleZ; - float outDeltaZ, outAngleZ; - - if( orientation == kOrientationUpOver ) { - inDeltaZ = 90; - inAngleZ = 270; - outDeltaZ = 90; - outAngleZ = 0; - } else { - inDeltaZ = -90; - inAngleZ = 90; - outDeltaZ = -90; - outAngleZ = 0; - } - inA = [CCSequence actions: - [CCDelayTime actionWithDuration:duration_/2], - [CCShow action], - [CCOrbitCamera actionWithDuration: duration_/2 radius: 1 deltaRadius:0 angleZ:inAngleZ deltaAngleZ:inDeltaZ angleX:90 deltaAngleX:0], - [CCCallFunc actionWithTarget:self selector:@selector(finish)], - nil ]; - outA = [CCSequence actions: - [CCOrbitCamera actionWithDuration: duration_/2 radius: 1 deltaRadius:0 angleZ:outAngleZ deltaAngleZ:outDeltaZ angleX:90 deltaAngleX:0], - [CCHide action], - [CCDelayTime actionWithDuration:duration_/2], - nil ]; - - [inScene_ runAction: inA]; - [outScene_ runAction: outA]; - -} -@end - -// -// FlipAngular Transition -// -@implementation CCTransitionFlipAngular --(void) onEnter -{ - [super onEnter]; - - CCActionInterval *inA, *outA; - [inScene_ setVisible: NO]; - - float inDeltaZ, inAngleZ; - float outDeltaZ, outAngleZ; - - if( orientation == kOrientationRightOver ) { - inDeltaZ = 90; - inAngleZ = 270; - outDeltaZ = 90; - outAngleZ = 0; - } else { - inDeltaZ = -90; - inAngleZ = 90; - outDeltaZ = -90; - outAngleZ = 0; - } - inA = [CCSequence actions: - [CCDelayTime actionWithDuration:duration_/2], - [CCShow action], - [CCOrbitCamera actionWithDuration: duration_/2 radius: 1 deltaRadius:0 angleZ:inAngleZ deltaAngleZ:inDeltaZ angleX:-45 deltaAngleX:0], - [CCCallFunc actionWithTarget:self selector:@selector(finish)], - nil ]; - outA = [CCSequence actions: - [CCOrbitCamera actionWithDuration: duration_/2 radius: 1 deltaRadius:0 angleZ:outAngleZ deltaAngleZ:outDeltaZ angleX:45 deltaAngleX:0], - [CCHide action], - [CCDelayTime actionWithDuration:duration_/2], - nil ]; - - [inScene_ runAction: inA]; - [outScene_ runAction: outA]; -} -@end - -// -// ZoomFlipX Transition -// -@implementation CCTransitionZoomFlipX --(void) onEnter -{ - [super onEnter]; - - CCActionInterval *inA, *outA; - [inScene_ setVisible: NO]; - - float inDeltaZ, inAngleZ; - float outDeltaZ, outAngleZ; - - if( orientation == kOrientationRightOver ) { - inDeltaZ = 90; - inAngleZ = 270; - outDeltaZ = 90; - outAngleZ = 0; - } else { - inDeltaZ = -90; - inAngleZ = 90; - outDeltaZ = -90; - outAngleZ = 0; - } - inA = [CCSequence actions: - [CCDelayTime actionWithDuration:duration_/2], - [CCSpawn actions: - [CCOrbitCamera actionWithDuration: duration_/2 radius: 1 deltaRadius:0 angleZ:inAngleZ deltaAngleZ:inDeltaZ angleX:0 deltaAngleX:0], - [CCScaleTo actionWithDuration:duration_/2 scale:1], - [CCShow action], - nil], - [CCCallFunc actionWithTarget:self selector:@selector(finish)], - nil ]; - outA = [CCSequence actions: - [CCSpawn actions: - [CCOrbitCamera actionWithDuration: duration_/2 radius: 1 deltaRadius:0 angleZ:outAngleZ deltaAngleZ:outDeltaZ angleX:0 deltaAngleX:0], - [CCScaleTo actionWithDuration:duration_/2 scale:0.5f], - nil], - [CCHide action], - [CCDelayTime actionWithDuration:duration_/2], - nil ]; - - inScene_.scale = 0.5f; - [inScene_ runAction: inA]; - [outScene_ runAction: outA]; -} -@end - -// -// ZoomFlipY Transition -// -@implementation CCTransitionZoomFlipY --(void) onEnter -{ - [super onEnter]; - - CCActionInterval *inA, *outA; - [inScene_ setVisible: NO]; - - float inDeltaZ, inAngleZ; - float outDeltaZ, outAngleZ; - - if( orientation == kOrientationUpOver ) { - inDeltaZ = 90; - inAngleZ = 270; - outDeltaZ = 90; - outAngleZ = 0; - } else { - inDeltaZ = -90; - inAngleZ = 90; - outDeltaZ = -90; - outAngleZ = 0; - } - - inA = [CCSequence actions: - [CCDelayTime actionWithDuration:duration_/2], - [CCSpawn actions: - [CCOrbitCamera actionWithDuration: duration_/2 radius: 1 deltaRadius:0 angleZ:inAngleZ deltaAngleZ:inDeltaZ angleX:90 deltaAngleX:0], - [CCScaleTo actionWithDuration:duration_/2 scale:1], - [CCShow action], - nil], - [CCCallFunc actionWithTarget:self selector:@selector(finish)], - nil ]; - outA = [CCSequence actions: - [CCSpawn actions: - [CCOrbitCamera actionWithDuration: duration_/2 radius: 1 deltaRadius:0 angleZ:outAngleZ deltaAngleZ:outDeltaZ angleX:90 deltaAngleX:0], - [CCScaleTo actionWithDuration:duration_/2 scale:0.5f], - nil], - [CCHide action], - [CCDelayTime actionWithDuration:duration_/2], - nil ]; - - inScene_.scale = 0.5f; - [inScene_ runAction: inA]; - [outScene_ runAction: outA]; -} -@end - -// -// ZoomFlipAngular Transition -// -@implementation CCTransitionZoomFlipAngular --(void) onEnter -{ - [super onEnter]; - - CCActionInterval *inA, *outA; - [inScene_ setVisible: NO]; - - float inDeltaZ, inAngleZ; - float outDeltaZ, outAngleZ; - - if( orientation == kOrientationRightOver ) { - inDeltaZ = 90; - inAngleZ = 270; - outDeltaZ = 90; - outAngleZ = 0; - } else { - inDeltaZ = -90; - inAngleZ = 90; - outDeltaZ = -90; - outAngleZ = 0; - } - - inA = [CCSequence actions: - [CCDelayTime actionWithDuration:duration_/2], - [CCSpawn actions: - [CCOrbitCamera actionWithDuration: duration_/2 radius: 1 deltaRadius:0 angleZ:inAngleZ deltaAngleZ:inDeltaZ angleX:-45 deltaAngleX:0], - [CCScaleTo actionWithDuration:duration_/2 scale:1], - [CCShow action], - nil], - [CCShow action], - [CCCallFunc actionWithTarget:self selector:@selector(finish)], - nil ]; - outA = [CCSequence actions: - [CCSpawn actions: - [CCOrbitCamera actionWithDuration: duration_/2 radius: 1 deltaRadius:0 angleZ:outAngleZ deltaAngleZ:outDeltaZ angleX:45 deltaAngleX:0], - [CCScaleTo actionWithDuration:duration_/2 scale:0.5f], - nil], - [CCHide action], - [CCDelayTime actionWithDuration:duration_/2], - nil ]; - - inScene_.scale = 0.5f; - [inScene_ runAction: inA]; - [outScene_ runAction: outA]; -} -@end - - -// -// Fade Transition -// -@implementation CCTransitionFade -+(id) transitionWithDuration:(ccTime)d scene:(CCScene*)s withColor:(ccColor3B)color -{ - return [[[self alloc] initWithDuration:d scene:s withColor:color] autorelease]; -} - --(id) initWithDuration:(ccTime)d scene:(CCScene*)s withColor:(ccColor3B)aColor -{ - if( (self=[super initWithDuration:d scene:s]) ) { - color.r = aColor.r; - color.g = aColor.g; - color.b = aColor.b; - } - - return self; -} - --(id) initWithDuration:(ccTime)d scene:(CCScene*)s -{ - return [self initWithDuration:d scene:s withColor:ccBLACK]; -} - --(void) onEnter -{ - [super onEnter]; - - CCLayerColor *l = [CCLayerColor layerWithColor:color]; - [inScene_ setVisible: NO]; - - [self addChild: l z:2 tag:kSceneFade]; - - - CCNode *f = [self getChildByTag:kSceneFade]; - - CCActionInterval *a = [CCSequence actions: - [CCFadeIn actionWithDuration:duration_/2], - [CCCallFunc actionWithTarget:self selector:@selector(hideOutShowIn)], - [CCFadeOut actionWithDuration:duration_/2], - [CCCallFunc actionWithTarget:self selector:@selector(finish)], - nil ]; - [f runAction: a]; -} - --(void) onExit -{ - [super onExit]; - [self removeChildByTag:kSceneFade cleanup:NO]; -} -@end - - -// -// Cross Fade Transition -// -@implementation CCTransitionCrossFade - --(void) draw -{ - // override draw since both scenes (textures) are rendered in 1 scene -} - --(void) onEnter -{ - [super onEnter]; - - // create a transparent color layer - // in which we are going to add our rendertextures - ccColor4B color = {0,0,0,0}; - CGSize size = [[CCDirector sharedDirector] winSize]; - CCLayerColor * layer = [CCLayerColor layerWithColor:color]; - - // create the first render texture for inScene_ - CCRenderTexture *inTexture = [CCRenderTexture renderTextureWithWidth:size.width height:size.height]; - inTexture.sprite.anchorPoint= ccp(0.5f,0.5f); - inTexture.position = ccp(size.width/2, size.height/2); - inTexture.anchorPoint = ccp(0.5f,0.5f); - - // render inScene_ to its texturebuffer - [inTexture begin]; - [inScene_ visit]; - [inTexture end]; - - // create the second render texture for outScene_ - CCRenderTexture *outTexture = [CCRenderTexture renderTextureWithWidth:size.width height:size.height]; - outTexture.sprite.anchorPoint= ccp(0.5f,0.5f); - outTexture.position = ccp(size.width/2, size.height/2); - outTexture.anchorPoint = ccp(0.5f,0.5f); - - // render outScene_ to its texturebuffer - [outTexture begin]; - [outScene_ visit]; - [outTexture end]; - - // create blend functions - - ccBlendFunc blend1 = {GL_ONE, GL_ONE}; // inScene_ will lay on background and will not be used with alpha - ccBlendFunc blend2 = {GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA}; // we are going to blend outScene_ via alpha - - // set blendfunctions - [inTexture.sprite setBlendFunc:blend1]; - [outTexture.sprite setBlendFunc:blend2]; - - // add render textures to the layer - [layer addChild:inTexture]; - [layer addChild:outTexture]; - - // initial opacity: - [inTexture.sprite setOpacity:255]; - [outTexture.sprite setOpacity:255]; - - // create the blend action - CCActionInterval * layerAction = [CCSequence actions: - [CCFadeTo actionWithDuration:duration_ opacity:0], - [CCCallFunc actionWithTarget:self selector:@selector(hideOutShowIn)], - [CCCallFunc actionWithTarget:self selector:@selector(finish)], - nil ]; - - - // run the blend action - [outTexture.sprite runAction: layerAction]; - - // add the layer (which contains our two rendertextures) to the scene - [self addChild: layer z:2 tag:kSceneFade]; -} - -// clean up on exit --(void) onExit -{ - // remove our layer and release all containing objects - [self removeChildByTag:kSceneFade cleanup:NO]; - - [super onExit]; -} -@end - -// -// TurnOffTilesTransition -// -@implementation CCTransitionTurnOffTiles - -// override addScenes, and change the order --(void) sceneOrder -{ - inSceneOnTop_ = NO; -} - --(void) onEnter -{ - [super onEnter]; - CGSize s = [[CCDirector sharedDirector] winSize]; - float aspect = s.width / s.height; - int x = 12 * aspect; - int y = 12; - - id toff = [CCTurnOffTiles actionWithSize: ccg(x,y) duration:duration_]; - id action = [self easeActionWithAction:toff]; - [outScene_ runAction: [CCSequence actions: action, - [CCCallFunc actionWithTarget:self selector:@selector(finish)], - [CCStopGrid action], - nil] - ]; - -} --(CCActionInterval*) easeActionWithAction:(CCActionInterval*)action -{ - return action; -// return [EaseIn actionWithAction:action rate:2.0f]; -} -@end - -#pragma mark Split Transitions - -// -// SplitCols Transition -// -@implementation CCTransitionSplitCols - --(void) onEnter -{ - [super onEnter]; - - inScene_.visible = NO; - - id split = [self action]; - id seq = [CCSequence actions: - split, - [CCCallFunc actionWithTarget:self selector:@selector(hideOutShowIn)], - [split reverse], - nil - ]; - [self runAction: [CCSequence actions: - [self easeActionWithAction:seq], - [CCCallFunc actionWithTarget:self selector:@selector(finish)], - [CCStopGrid action], - nil] - ]; -} - --(CCActionInterval*) action -{ - return [CCSplitCols actionWithCols:3 duration:duration_/2.0f]; -} - --(CCActionInterval*) easeActionWithAction:(CCActionInterval*)action -{ - return [CCEaseInOut actionWithAction:action rate:3.0f]; -} -@end - -// -// SplitRows Transition -// -@implementation CCTransitionSplitRows --(CCActionInterval*) action -{ - return [CCSplitRows actionWithRows:3 duration:duration_/2.0f]; -} -@end - - -#pragma mark Fade Grid Transitions - -// -// FadeTR Transition -// -@implementation CCTransitionFadeTR --(void) sceneOrder -{ - inSceneOnTop_ = NO; -} - --(void) onEnter -{ - [super onEnter]; - - CGSize s = [[CCDirector sharedDirector] winSize]; - float aspect = s.width / s.height; - int x = 12 * aspect; - int y = 12; - - id action = [self actionWithSize:ccg(x,y)]; - - [outScene_ runAction: [CCSequence actions: - [self easeActionWithAction:action], - [CCCallFunc actionWithTarget:self selector:@selector(finish)], - [CCStopGrid action], - nil] - ]; -} - --(CCActionInterval*) actionWithSize: (ccGridSize) v -{ - return [CCFadeOutTRTiles actionWithSize:v duration:duration_]; -} - --(CCActionInterval*) easeActionWithAction:(CCActionInterval*)action -{ - return action; -// return [CCEaseOut actionWithAction:action rate:3.0f]; -} -@end - -// -// FadeBL Transition -// -@implementation CCTransitionFadeBL --(CCActionInterval*) actionWithSize: (ccGridSize) v -{ - return [CCFadeOutBLTiles actionWithSize:v duration:duration_]; -} -@end - -// -// FadeUp Transition -// -@implementation CCTransitionFadeUp --(CCActionInterval*) actionWithSize: (ccGridSize) v -{ - return [CCFadeOutUpTiles actionWithSize:v duration:duration_]; -} -@end - -// -// FadeDown Transition -// -@implementation CCTransitionFadeDown --(CCActionInterval*) actionWithSize: (ccGridSize) v -{ - return [CCFadeOutDownTiles actionWithSize:v duration:duration_]; -} -@end diff --git a/src/cocos2d/CCTransitionPageTurn.m b/src/cocos2d/CCTransitionPageTurn.m deleted file mode 100644 index 810284f..0000000 --- a/src/cocos2d/CCTransitionPageTurn.m +++ /dev/null @@ -1,117 +0,0 @@ -/* - * cocos2d for iPhone: http://www.cocos2d-iphone.org - * - * Copyright (c) 2009 Sindesso Pty Ltd http://www.sindesso.com/ - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - * - */ - - -#import "CCTransitionPageTurn.h" -#import "CCActionPageTurn3D.h" -#import "CCDirector.h" - -@implementation CCTransitionPageTurn - -/** creates a base transition with duration and incoming scene */ -+(id) transitionWithDuration:(ccTime) t scene:(CCScene*)s backwards:(BOOL) back -{ - return [[[self alloc] initWithDuration:t scene:s backwards:back] autorelease]; -} - -/** initializes a transition with duration and incoming scene */ --(id) initWithDuration:(ccTime) t scene:(CCScene*)s backwards:(BOOL) back -{ - // XXX: needed before [super init] - back_ = back; - - if( ( self = [super initWithDuration:t scene:s] ) ) - { - // do something - } - return self; -} - --(void) sceneOrder -{ - inSceneOnTop_ = back_; -} - -// --(void) onEnter -{ - [super onEnter]; - - CGSize s = [[CCDirector sharedDirector] winSize]; - int x, y; - if( s.width > s.height) - { - x = 16; - y = 12; - } - else - { - x = 12; - y = 16; - } - - id action = [self actionWithSize:ccg(x,y)]; - - if(! back_ ) - { - [outScene_ runAction: [CCSequence actions: - action, - [CCCallFunc actionWithTarget:self selector:@selector(finish)], - [CCStopGrid action], - nil] - ]; - } - else - { - // to prevent initial flicker - inScene_.visible = NO; - [inScene_ runAction: [CCSequence actions: - [CCShow action], - action, - [CCCallFunc actionWithTarget:self selector:@selector(finish)], - [CCStopGrid action], - nil] - ]; - } - -} - --(CCActionInterval*) actionWithSize: (ccGridSize) v -{ - if( back_ ) - { - // Get hold of the PageTurn3DAction - return [CCReverseTime actionWithAction: - [CCPageTurn3D actionWithSize:v duration:duration_]]; - } - else - { - // Get hold of the PageTurn3DAction - return [CCPageTurn3D actionWithSize:v duration:duration_]; - } -} - -@end - diff --git a/src/cocos2d/CCTransitionProgress.m b/src/cocos2d/CCTransitionProgress.m deleted file mode 100644 index afe4de6..0000000 --- a/src/cocos2d/CCTransitionProgress.m +++ /dev/null @@ -1,276 +0,0 @@ -/* - * cocos2d for iPhone: http://www.cocos2d-iphone.org - * - * Copyright (c) 2009 Lam Pham - * - * Copyright (c) 2012 Ricardo Quesada - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - * - */ - - -#import "CCTransitionProgress.h" -#import "CCDirector.h" -#import "CCRenderTexture.h" -#import "CCLayer.h" -#import "CCActionInstant.h" -#import "CCProgressTimer.h" -#import "CCActionProgressTimer.h" -#import "Support/CGPointExtension.h" - -enum { - kCCSceneRadial = 0xc001, -}; - -#pragma mark - CCTransitionProgress - -@interface CCTransitionProgress() --(CCProgressTimer*) progressTimerNodeWithRenderTexture:(CCRenderTexture*)texture; --(void) setupTransition; -@end - -@implementation CCTransitionProgress --(void) onEnter -{ - [super onEnter]; - - [self setupTransition]; - - // create a transparent color layer - // in which we are going to add our rendertextures - CGSize size = [[CCDirector sharedDirector] winSize]; - - // create the second render texture for outScene - CCRenderTexture *texture = [CCRenderTexture renderTextureWithWidth:size.width height:size.height]; - texture.sprite.anchorPoint= ccp(0.5f,0.5f); - texture.position = ccp(size.width/2, size.height/2); - texture.anchorPoint = ccp(0.5f,0.5f); - - // render outScene to its texturebuffer - [texture clear:0 g:0 b:0 a:1]; - [texture begin]; - [sceneToBeModified_ visit]; - [texture end]; - - - // Since we've passed the outScene to the texture we don't need it. - if( sceneToBeModified_ == outScene_ ) - [self hideOutShowIn]; - - // We need the texture in RenderTexture. - CCProgressTimer *node = [self progressTimerNodeWithRenderTexture:texture]; - - // create the blend action - CCActionInterval * layerAction = [CCSequence actions: - [CCProgressFromTo actionWithDuration:duration_ from:from_ to:to_], - [CCCallFunc actionWithTarget:self selector:@selector(finish)], - nil ]; - // run the blend action - [node runAction: layerAction]; - - // add the layer (which contains our two rendertextures) to the scene - [self addChild: node z:2 tag:kCCSceneRadial]; -} - -// clean up on exit --(void) onExit -{ - // remove our layer and release all containing objects - [self removeChildByTag:kCCSceneRadial cleanup:NO]; - [super onExit]; -} - --(void) sceneOrder -{ - inSceneOnTop_ = NO; -} - --(void) setupTransition -{ - sceneToBeModified_ = outScene_; - from_ = 100; - to_ = 0; -} - --(CCProgressTimer*) progressTimerNodeWithRenderTexture:(CCRenderTexture*)texture -{ - NSAssert(NO, @"override me - abstract class"); - - return nil; -} -@end - -#pragma mark - CCTransitionProgressRadialCCW - -@implementation CCTransitionProgressRadialCCW --(CCProgressTimer*) progressTimerNodeWithRenderTexture:(CCRenderTexture*)texture -{ - CGSize size = [[CCDirector sharedDirector] winSize]; - - CCProgressTimer *node = [CCProgressTimer progressWithSprite:texture.sprite]; - - // but it is flipped upside down so we flip the sprite - node.sprite.flipY = YES; - node.type = kCCProgressTimerTypeRadial; - - // Return the radial type that we want to use - node.reverseDirection = NO; - node.percentage = 100; - node.position = ccp(size.width/2, size.height/2); - node.anchorPoint = ccp(0.5f,0.5f); - - return node; -} -@end - -#pragma mark - CCTransitionProgressRadialCW - -@implementation CCTransitionProgressRadialCW --(CCProgressTimer*) progressTimerNodeWithRenderTexture:(CCRenderTexture*)texture -{ - CGSize size = [[CCDirector sharedDirector] winSize]; - - CCProgressTimer *node = [CCProgressTimer progressWithSprite:texture.sprite]; - - // but it is flipped upside down so we flip the sprite - node.sprite.flipY = YES; - node.type = kCCProgressTimerTypeRadial; - - // Return the radial type that we want to use - node.reverseDirection = YES; - node.percentage = 100; - node.position = ccp(size.width/2, size.height/2); - node.anchorPoint = ccp(0.5f,0.5f); - - return node; -} -@end - -#pragma mark - CCTransitionProgressHorizontal - -@implementation CCTransitionProgressHorizontal --(CCProgressTimer*) progressTimerNodeWithRenderTexture:(CCRenderTexture*)texture -{ - CGSize size = [[CCDirector sharedDirector] winSize]; - - CCProgressTimer *node = [CCProgressTimer progressWithSprite:texture.sprite]; - - // but it is flipped upside down so we flip the sprite - node.sprite.flipY = YES; - node.type = kCCProgressTimerTypeBar; - - node.midpoint = ccp(1, 0); - node.barChangeRate = ccp(1,0); - - node.percentage = 100; - node.position = ccp(size.width/2, size.height/2); - node.anchorPoint = ccp(0.5f,0.5f); - - return node; -} -@end - -#pragma mark - CCTransitionProgressVertical - -@implementation CCTransitionProgressVertical --(CCProgressTimer*) progressTimerNodeWithRenderTexture:(CCRenderTexture*)texture -{ - CGSize size = [[CCDirector sharedDirector] winSize]; - - CCProgressTimer *node = [CCProgressTimer progressWithSprite:texture.sprite]; - - // but it is flipped upside down so we flip the sprite - node.sprite.flipY = YES; - node.type = kCCProgressTimerTypeBar; - - node.midpoint = ccp(0, 0); - node.barChangeRate = ccp(0,1); - - node.percentage = 100; - node.position = ccp(size.width/2, size.height/2); - node.anchorPoint = ccp(0.5f,0.5f); - - return node; -} -@end - -#pragma mark - CCTransitionProgressInOut - -@implementation CCTransitionProgressInOut - --(void) sceneOrder -{ - inSceneOnTop_ = NO; -} - --(void) setupTransition -{ - sceneToBeModified_ = inScene_; - from_ = 0; - to_ = 100; -} - --(CCProgressTimer*) progressTimerNodeWithRenderTexture:(CCRenderTexture*)texture -{ - CGSize size = [[CCDirector sharedDirector] winSize]; - - CCProgressTimer *node = [CCProgressTimer progressWithSprite:texture.sprite]; - - // but it is flipped upside down so we flip the sprite - node.sprite.flipY = YES; - node.type = kCCProgressTimerTypeBar; - - node.midpoint = ccp(.5f, .5f); - node.barChangeRate = ccp(1, 1); - - node.percentage = 0; - node.position = ccp(size.width/2, size.height/2); - node.anchorPoint = ccp(0.5f,0.5f); - - return node; -} -@end - -#pragma mark - CCTransitionProgressOutIn - -@implementation CCTransitionProgressOutIn --(CCProgressTimer*) progressTimerNodeWithRenderTexture:(CCRenderTexture*)texture -{ - CGSize size = [[CCDirector sharedDirector] winSize]; - - CCProgressTimer *node = [CCProgressTimer progressWithSprite:texture.sprite]; - - // but it is flipped upside down so we flip the sprite - node.sprite.flipY = YES; - node.type = kCCProgressTimerTypeBar; - - node.midpoint = ccp(.5f, .5f); - node.barChangeRate = ccp(1, 1); - - node.percentage = 100; - node.position = ccp(size.width/2, size.height/2); - node.anchorPoint = ccp(0.5f,0.5f); - - return node; -} -@end - - - diff --git a/src/cocos2d/Platforms/Mac/CCEventDispatcher.m b/src/cocos2d/Platforms/Mac/CCEventDispatcher.m deleted file mode 100644 index 78c8c99..0000000 --- a/src/cocos2d/Platforms/Mac/CCEventDispatcher.m +++ /dev/null @@ -1,694 +0,0 @@ -/* - * cocos2d for iPhone: http://www.cocos2d-iphone.org - * - * Copyright (c) 2010 Ricardo Quesada - * Copyright (c) 2011 Zynga Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -// Only compile this code on Mac. These files should not be included on your iOS project. -// But in case they are included, it won't be compiled. -#import "../../ccMacros.h" -#ifdef __CC_PLATFORM_MAC - -#import "CCEventDispatcher.h" -#import "../../CCDirector.h" -#import "../../ccConfig.h" - -enum { - // mouse - kCCImplementsMouseDown = 1 << 0, - kCCImplementsMouseMoved = 1 << 1, - kCCImplementsMouseDragged = 1 << 2, - kCCImplementsMouseUp = 1 << 3, - kCCImplementsRightMouseDown = 1 << 4, - kCCImplementsRightMouseDragged = 1 << 5, - kCCImplementsRightMouseUp = 1 << 6, - kCCImplementsOtherMouseDown = 1 << 7, - kCCImplementsOtherMouseDragged = 1 << 8, - kCCImplementsOtherMouseUp = 1 << 9, - kCCImplementsScrollWheel = 1 << 10, - kCCImplementsMouseEntered = 1 << 11, - kCCImplementsMouseExited = 1 << 12, - - kCCImplementsTouchesBegan = 1 << 13, - kCCImplementsTouchesMoved = 1 << 14, - kCCImplementsTouchesEnded = 1 << 15, - kCCImplementsTouchesCancelled = 1 << 16, - - // keyboard - kCCImplementsKeyUp = 1 << 0, - kCCImplementsKeyDown = 1 << 1, - kCCImplementsFlagsChanged = 1 << 2, -}; - - -typedef struct _listEntry -{ - struct _listEntry *prev, *next; - id delegate; - NSInteger priority; - NSUInteger flags; -} tListEntry; - -typedef struct _listDeletedEntry -{ - struct _listDeletedEntry *prev, *next; - id delegate; - struct _listEntry **listToBeDeleted; - -} tListDeletedEntry; - -typedef struct _listAddedEntry -{ - struct _listAddedEntry *prev, *next; - id delegate; - NSInteger priority; - NSUInteger flags; - struct _listEntry **listToBeAdded; -} tListAddedEntry; - - - -#pragma mark - CCEventObject - -@implementation CCEventObject -@end - -#pragma mark - CCEventDispatcher - -@implementation CCEventDispatcher - -@synthesize dispatchEvents=dispatchEvents_; - --(id) init -{ - if( (self = [super init]) ) - { - // events enabled by default - dispatchEvents_ = YES; - - // delegates - keyboardDelegates_ = NULL; - mouseDelegates_ = NULL; - touchDelegates_ = NULL; - - delegatesToBeAdded_ = NULL; - delegatesToBeRemoved_ = NULL; - - dispatchingInProgress_ = NO; - } - - return self; -} - -- (void) dealloc -{ - [super dealloc]; -} - -#pragma mark CCEventDispatcher - add / remove delegates --(void) addLaterDelegate:(id)delegate priority:(NSInteger)priority flags:(NSUInteger)flags list:(tListEntry**)list -{ - tListAddedEntry *listElement = malloc( sizeof(*listElement) ); - - listElement->delegate = [delegate retain]; - listElement->priority = priority; - listElement->flags = flags; - listElement->listToBeAdded = list; - listElement->next = listElement->prev = NULL; - - DL_APPEND( delegatesToBeAdded_, listElement ); -} - --(void) addDelegate:(id)delegate priority:(NSInteger)priority flags:(NSUInteger)flags list:(tListEntry**)list -{ - tListEntry *listElement = malloc( sizeof(*listElement) ); - - listElement->delegate = [delegate retain]; - listElement->priority = priority; - listElement->flags = flags; - listElement->next = listElement->prev = NULL; - - // empty list ? - if( ! *list ) { - DL_APPEND( *list, listElement ); - - } else { - BOOL added = NO; - - for( tListEntry *elem = *list; elem ; elem = elem->next ) { - if( priority < elem->priority ) { - - if( elem == *list ) - DL_PREPEND(*list, listElement); - else { - listElement->next = elem; - listElement->prev = elem->prev; - - elem->prev->next = listElement; - elem->prev = listElement; - } - - added = YES; - break; - } - } - - // Not added? priority has the higher value. Append it. - if( !added ) - DL_APPEND(*list, listElement); - } -} - --(void) removeLaterDelegate:(id)delegate fromList:(tListEntry**)list -{ - tListDeletedEntry *listElement = malloc( sizeof(*listElement) ); - - listElement->delegate = [delegate retain]; - listElement->listToBeDeleted = list; - listElement->next = listElement->prev = NULL; - - DL_APPEND( delegatesToBeRemoved_, listElement ); -} - --(void) removeDelegate:(id)delegate fromList:(tListEntry**)list -{ - tListEntry *entry, *tmp; - - // updates with priority < 0 - DL_FOREACH_SAFE( *list, entry, tmp ) { - if( entry->delegate == delegate ) { - DL_DELETE( *list, entry ); - [delegate release]; - free(entry); - break; - } - } -} - --(void) removeAllDelegatesFromList:(tListEntry**)list -{ - NSAssert( ! dispatchingInProgress_, @"BUG. Open a ticket. Can't call this function when processing events."); - - @synchronized(self) { - tListEntry *entry, *tmp; - - DL_FOREACH_SAFE( *list, entry, tmp ) { - DL_DELETE( *list, entry ); - [entry->delegate release]; - free(entry); - } - } -} - - --(void) addMouseDelegate:(id) delegate priority:(NSInteger)priority -{ - NSUInteger flags = 0; - - flags |= ( [delegate respondsToSelector:@selector(ccMouseDown:)] ? kCCImplementsMouseDown : 0 ); - flags |= ( [delegate respondsToSelector:@selector(ccMouseDragged:)] ? kCCImplementsMouseDragged : 0 ); - flags |= ( [delegate respondsToSelector:@selector(ccMouseMoved:)] ? kCCImplementsMouseMoved : 0 ); - flags |= ( [delegate respondsToSelector:@selector(ccMouseUp:)] ? kCCImplementsMouseUp : 0 ); - - flags |= ( [delegate respondsToSelector:@selector(ccRightMouseDown:)] ? kCCImplementsRightMouseDown : 0 ); - flags |= ( [delegate respondsToSelector:@selector(ccRightMouseDragged:)] ? kCCImplementsRightMouseDragged : 0 ); - flags |= ( [delegate respondsToSelector:@selector(ccRightMouseUp:)] ? kCCImplementsRightMouseUp : 0 ); - - flags |= ( [delegate respondsToSelector:@selector(ccOtherMouseDown:)] ? kCCImplementsOtherMouseDown : 0 ); - flags |= ( [delegate respondsToSelector:@selector(ccOtherMouseDragged:)] ? kCCImplementsOtherMouseDragged : 0 ); - flags |= ( [delegate respondsToSelector:@selector(ccOtherMouseUp:)] ? kCCImplementsOtherMouseUp : 0 ); - - flags |= ( [delegate respondsToSelector:@selector(ccMouseEntered:)] ? kCCImplementsMouseEntered : 0 ); - flags |= ( [delegate respondsToSelector:@selector(ccMouseExited:)] ? kCCImplementsMouseExited : 0 ); - - flags |= ( [delegate respondsToSelector:@selector(ccScrollWheel:)] ? kCCImplementsScrollWheel : 0 ); - - if( dispatchingInProgress_ ) - [self addLaterDelegate:delegate priority:priority flags:flags list:&mouseDelegates_]; - else - [self addDelegate:delegate priority:priority flags:flags list:&mouseDelegates_]; - -} - --(void) removeMouseDelegate:(id) delegate -{ - if( dispatchingInProgress_ ) - [self removeLaterDelegate:delegate fromList:&mouseDelegates_]; - else - [self removeDelegate:delegate fromList:&mouseDelegates_]; -} - --(void) removeAllMouseDelegates -{ - [self removeAllDelegatesFromList:&mouseDelegates_]; -} - --(void) addKeyboardDelegate:(id) delegate priority:(NSInteger)priority -{ - NSUInteger flags = 0; - - flags |= ( [delegate respondsToSelector:@selector(ccKeyUp:)] ? kCCImplementsKeyUp : 0 ); - flags |= ( [delegate respondsToSelector:@selector(ccKeyDown:)] ? kCCImplementsKeyDown : 0 ); - flags |= ( [delegate respondsToSelector:@selector(ccFlagsChanged:)] ? kCCImplementsFlagsChanged : 0 ); - - if( dispatchingInProgress_ ) - [self addLaterDelegate:delegate priority:priority flags:flags list:&keyboardDelegates_]; - else - [self addDelegate:delegate priority:priority flags:flags list:&keyboardDelegates_]; -} - --(void) removeKeyboardDelegate:(id) delegate -{ - if( dispatchingInProgress_ ) - [self removeLaterDelegate:delegate fromList:&keyboardDelegates_]; - else - [self removeDelegate:delegate fromList:&keyboardDelegates_]; -} - --(void) removeAllKeyboardDelegates -{ - [self removeAllDelegatesFromList:&keyboardDelegates_]; -} - --(void) addTouchDelegate:(id) delegate priority:(NSInteger)priority -{ - NSUInteger flags = 0; - - flags |= ( [delegate respondsToSelector:@selector(ccTouchesBeganWithEvent:)] ? kCCImplementsTouchesBegan : 0 ); - flags |= ( [delegate respondsToSelector:@selector(ccTouchesMovedWithEvent:)] ? kCCImplementsTouchesMoved : 0 ); - flags |= ( [delegate respondsToSelector:@selector(ccTouchesEndedWithEvent:)] ? kCCImplementsTouchesEnded : 0 ); - flags |= ( [delegate respondsToSelector:@selector(ccTouchesCancelledWithEvent:)] ? kCCImplementsTouchesCancelled : 0 ); - - if( dispatchingInProgress_ ) - [self addLaterDelegate:delegate priority:priority flags:flags list:&touchDelegates_]; - else - [self addDelegate:delegate priority:priority flags:flags list:&touchDelegates_]; -} - --(void) removeTouchDelegate:(id) delegate -{ - if( dispatchingInProgress_ ) - [self removeLaterDelegate:delegate fromList:&touchDelegates_]; - else - [self removeDelegate:delegate fromList:&touchDelegates_]; -} - --(void) removeAllTouchDelegates -{ - [self removeAllDelegatesFromList:&touchDelegates_]; -} - - -#pragma mark CCEventDispatcher - Mouse events -// -// Mouse events -// - -// -// Left -// -- (void)mouseDown:(NSEvent *)event -{ - if( dispatchEvents_ ) { - tListEntry *entry, *tmp; - - DL_FOREACH_SAFE( mouseDelegates_, entry, tmp ) { - if ( entry->flags & kCCImplementsMouseDown ) { - void *swallows = [entry->delegate performSelector:@selector(ccMouseDown:) withObject:event]; - if( swallows ) - break; - } - } - } -} - -- (void)mouseMoved:(NSEvent *)event -{ - if( dispatchEvents_ ) { - tListEntry *entry, *tmp; - - DL_FOREACH_SAFE( mouseDelegates_, entry, tmp ) { - if ( entry->flags & kCCImplementsMouseMoved ) { - void *swallows = [entry->delegate performSelector:@selector(ccMouseMoved:) withObject:event]; - if( swallows ) - break; - } - } - } -} - -- (void)mouseDragged:(NSEvent *)event -{ - if( dispatchEvents_ ) { - tListEntry *entry, *tmp; - - DL_FOREACH_SAFE( mouseDelegates_, entry, tmp ) { - if ( entry->flags & kCCImplementsMouseDragged ) { - void *swallows = [entry->delegate performSelector:@selector(ccMouseDragged:) withObject:event]; - if( swallows ) - break; - } - } - } -} - -- (void)mouseUp:(NSEvent *)event -{ - @synchronized(self) { - if( dispatchEvents_ ) { - tListEntry *entry, *tmp; - - DL_FOREACH_SAFE( mouseDelegates_, entry, tmp ) { - if ( entry->flags & kCCImplementsMouseUp ) { - void *swallows = [entry->delegate performSelector:@selector(ccMouseUp:) withObject:event]; - if( swallows ) - break; - } - } - } - } -} - -// -// Mouse Right -// -- (void)rightMouseDown:(NSEvent *)event -{ - if( dispatchEvents_ ) { - tListEntry *entry, *tmp; - - DL_FOREACH_SAFE( mouseDelegates_, entry, tmp ) { - if ( entry->flags & kCCImplementsRightMouseDown ) { - void *swallows = [entry->delegate performSelector:@selector(ccRightMouseDown:) withObject:event]; - if( swallows ) - break; - } - } - } -} - -- (void)rightMouseDragged:(NSEvent *)event -{ - if( dispatchEvents_ ) { - tListEntry *entry, *tmp; - - DL_FOREACH_SAFE( mouseDelegates_, entry, tmp ) { - if ( entry->flags & kCCImplementsRightMouseDragged ) { - void *swallows = [entry->delegate performSelector:@selector(ccRightMouseDragged:) withObject:event]; - if( swallows ) - break; - } - } - } -} - -- (void)rightMouseUp:(NSEvent *)event -{ - if( dispatchEvents_ ) { - tListEntry *entry, *tmp; - - DL_FOREACH_SAFE( mouseDelegates_, entry, tmp ) { - if ( entry->flags & kCCImplementsRightMouseUp ) { - void *swallows = [entry->delegate performSelector:@selector(ccRightMouseUp:) withObject:event]; - if( swallows ) - break; - } - } - } -} - -// -// Mouse Other -// -- (void)otherMouseDown:(NSEvent *)event -{ - if( dispatchEvents_ ) { - tListEntry *entry, *tmp; - - DL_FOREACH_SAFE( mouseDelegates_, entry, tmp ) { - if ( entry->flags & kCCImplementsOtherMouseDown ) { - void *swallows = [entry->delegate performSelector:@selector(ccOtherMouseDown:) withObject:event]; - if( swallows ) - break; - } - } - } -} - -- (void)otherMouseDragged:(NSEvent *)event -{ - if( dispatchEvents_ ) { - tListEntry *entry, *tmp; - - DL_FOREACH_SAFE( mouseDelegates_, entry, tmp ) { - if ( entry->flags & kCCImplementsOtherMouseDragged ) { - void *swallows = [entry->delegate performSelector:@selector(ccOtherMouseDragged:) withObject:event]; - if( swallows ) - break; - } - } - } -} - -- (void)otherMouseUp:(NSEvent *)event -{ - if( dispatchEvents_ ) { - tListEntry *entry, *tmp; - - DL_FOREACH_SAFE( mouseDelegates_, entry, tmp ) { - if ( entry->flags & kCCImplementsOtherMouseUp ) { - void *swallows = [entry->delegate performSelector:@selector(ccOtherMouseUp:) withObject:event]; - if( swallows ) - break; - } - } - } -} - -// -// Scroll Wheel -// -- (void)scrollWheel:(NSEvent *)event -{ - if( dispatchEvents_ ) { - tListEntry *entry, *tmp; - - DL_FOREACH_SAFE( mouseDelegates_, entry, tmp ) { - if ( entry->flags & kCCImplementsScrollWheel ) { - void *swallows = [entry->delegate performSelector:@selector(ccScrollWheel:) withObject:event]; - if( swallows ) - break; - } - } - } -} - -// -// Mouse enter / exit -- (void)mouseExited:(NSEvent *)event -{ - if( dispatchEvents_ ) { - tListEntry *entry, *tmp; - - DL_FOREACH_SAFE( mouseDelegates_, entry, tmp ) { - if ( entry->flags & kCCImplementsMouseExited) { - void *swallows = [entry->delegate performSelector:@selector(ccMouseExited:) withObject:event]; - if( swallows ) - break; - } - } - } -} - -- (void)mouseEntered:(NSEvent *)event -{ - if( dispatchEvents_ ) { - tListEntry *entry, *tmp; - - DL_FOREACH_SAFE( mouseDelegates_, entry, tmp ) { - if ( entry->flags & kCCImplementsMouseEntered) { - void *swallows = [entry->delegate performSelector:@selector(ccMouseEntered:) withObject:event]; - if( swallows ) - break; - } - } - } -} - - -#pragma mark CCEventDispatcher - Keyboard events - -// Keyboard events -- (void)keyDown:(NSEvent *)event -{ - if( dispatchEvents_ ) { - tListEntry *entry, *tmp; - - DL_FOREACH_SAFE( keyboardDelegates_, entry, tmp ) { - if ( entry->flags & kCCImplementsKeyDown ) { - void *swallows = [entry->delegate performSelector:@selector(ccKeyDown:) withObject:event]; - if( swallows ) - break; - } - } - } -} - -- (void)keyUp:(NSEvent *)event -{ - if( dispatchEvents_ ) { - tListEntry *entry, *tmp; - - DL_FOREACH_SAFE( keyboardDelegates_, entry, tmp ) { - if ( entry->flags & kCCImplementsKeyUp ) { - void *swallows = [entry->delegate performSelector:@selector(ccKeyUp:) withObject:event]; - if( swallows ) - break; - } - } - } -} - -- (void)flagsChanged:(NSEvent *)event -{ - if( dispatchEvents_ ) { - tListEntry *entry, *tmp; - - DL_FOREACH_SAFE( keyboardDelegates_, entry, tmp ) { - if ( entry->flags & kCCImplementsFlagsChanged ) { - void *swallows = [entry->delegate performSelector:@selector(ccFlagsChanged:) withObject:event]; - if( swallows ) - break; - } - } - } -} - - -#pragma mark CCEventDispatcher - Touch events - -- (void)touchesBeganWithEvent:(NSEvent *)event -{ - if( dispatchEvents_ ) { - tListEntry *entry, *tmp; - - DL_FOREACH_SAFE( touchDelegates_, entry, tmp ) { - if ( entry->flags & kCCImplementsTouchesBegan) { - void *swallows = [entry->delegate performSelector:@selector(ccTouchesBeganWithEvent:) withObject:event]; - if( swallows ) - break; - } - } - } -} - -- (void)touchesMovedWithEvent:(NSEvent *)event -{ - if( dispatchEvents_ ) { - tListEntry *entry, *tmp; - - DL_FOREACH_SAFE( touchDelegates_, entry, tmp ) { - if ( entry->flags & kCCImplementsTouchesMoved) { - void *swallows = [entry->delegate performSelector:@selector(ccTouchesMovedWithEvent:) withObject:event]; - if( swallows ) - break; - } - } - } -} - -- (void)touchesEndedWithEvent:(NSEvent *)event -{ - if( dispatchEvents_ ) { - tListEntry *entry, *tmp; - - DL_FOREACH_SAFE( touchDelegates_, entry, tmp ) { - if ( entry->flags & kCCImplementsTouchesEnded) { - void *swallows = [entry->delegate performSelector:@selector(ccTouchesEndedWithEvent:) withObject:event]; - if( swallows ) - break; - } - } - } -} - -- (void)touchesCancelledWithEvent:(NSEvent *)event -{ - if( dispatchEvents_ ) { - tListEntry *entry, *tmp; - - DL_FOREACH_SAFE( touchDelegates_, entry, tmp ) { - if ( entry->flags & kCCImplementsTouchesCancelled) { - void *swallows = [entry->delegate performSelector:@selector(ccTouchesCancelledWithEvent:) withObject:event]; - if( swallows ) - break; - } - } - } -} - -- (void)dispatchEvent:(CCEventObject*)e -{ - @synchronized(self) - { - NSEvent *event = e->event; - SEL selector = e->selector; - - // Dispatch events - if( dispatchEvents_ ) { - dispatchingInProgress_ = YES; - [self performSelector:selector onThread:[[CCDirector sharedDirector] runningThread] withObject:event waitUntilDone:YES]; - dispatchingInProgress_ = NO; - } - - - [event release]; - - // Remove possible delegates - tListDeletedEntry *dEntry, *tTmp; - DL_FOREACH_SAFE( delegatesToBeRemoved_ , dEntry, tTmp ) { - - [self removeDelegate:dEntry->delegate fromList:dEntry->listToBeDeleted]; - - DL_DELETE( delegatesToBeRemoved_, dEntry ); - [dEntry->delegate release]; - free(dEntry); - } - - // Add possible delegates - tListAddedEntry *entry, *tmp; - - DL_FOREACH_SAFE( delegatesToBeAdded_, entry, tmp ) { - - [self addDelegate:entry->delegate priority:entry->priority flags:entry->flags list:entry->listToBeAdded]; - - DL_DELETE( delegatesToBeAdded_, entry ); - [entry->delegate release]; - free(entry); - } - - } -} - -@end - -#endif // __CC_PLATFORM_MAC diff --git a/src/cocos2d/Platforms/iOS/CCTouchDispatcher.m b/src/cocos2d/Platforms/iOS/CCTouchDispatcher.m deleted file mode 100644 index 788e99d..0000000 --- a/src/cocos2d/Platforms/iOS/CCTouchDispatcher.m +++ /dev/null @@ -1,341 +0,0 @@ -/* - * cocos2d for iPhone: http://www.cocos2d-iphone.org - * - * Copyright (c) 2009 Valentin Milea - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - * - */ - -// Only compile this code on iOS. These files should NOT be included on your Mac project. -// But in case they are included, it won't be compiled. -#import "../../ccMacros.h" -#ifdef __CC_PLATFORM_IOS - - -#import "CCTouchDispatcher.h" -#import "CCTouchHandler.h" - -@implementation CCTouchDispatcher - -@synthesize dispatchEvents; - --(id) init -{ - if((self = [super init])) { - - dispatchEvents = YES; - targetedHandlers = [[NSMutableArray alloc] initWithCapacity:8]; - standardHandlers = [[NSMutableArray alloc] initWithCapacity:4]; - - handlersToAdd = [[NSMutableArray alloc] initWithCapacity:8]; - handlersToRemove = [[NSMutableArray alloc] initWithCapacity:8]; - - toRemove = NO; - toAdd = NO; - toQuit = NO; - locked = NO; - - handlerHelperData[kCCTouchBegan] = (struct ccTouchHandlerHelperData) {@selector(ccTouchesBegan:withEvent:),@selector(ccTouchBegan:withEvent:),kCCTouchSelectorBeganBit}; - handlerHelperData[kCCTouchMoved] = (struct ccTouchHandlerHelperData) {@selector(ccTouchesMoved:withEvent:),@selector(ccTouchMoved:withEvent:),kCCTouchSelectorMovedBit}; - handlerHelperData[kCCTouchEnded] = (struct ccTouchHandlerHelperData) {@selector(ccTouchesEnded:withEvent:),@selector(ccTouchEnded:withEvent:),kCCTouchSelectorEndedBit}; - handlerHelperData[kCCTouchCancelled] = (struct ccTouchHandlerHelperData) {@selector(ccTouchesCancelled:withEvent:),@selector(ccTouchCancelled:withEvent:),kCCTouchSelectorCancelledBit}; - - } - - return self; -} - --(void) dealloc -{ - [targetedHandlers release]; - [standardHandlers release]; - [handlersToAdd release]; - [handlersToRemove release]; - [super dealloc]; -} - -// -// handlers management -// - -#pragma mark TouchDispatcher - Add Hanlder - --(void) forceAddHandler:(CCTouchHandler*)handler array:(NSMutableArray*)array -{ - NSUInteger i = 0; - - for( CCTouchHandler *h in array ) { - if( h.priority < handler.priority ) - i++; - - NSAssert( h.delegate != handler.delegate, @"Delegate already added to touch dispatcher."); - } - [array insertObject:handler atIndex:i]; -} - --(void) addStandardDelegate:(id) delegate priority:(int)priority -{ - CCTouchHandler *handler = [CCStandardTouchHandler handlerWithDelegate:delegate priority:priority]; - if( ! locked ) { - [self forceAddHandler:handler array:standardHandlers]; - } else { - [handlersToAdd addObject:handler]; - toAdd = YES; - } -} - --(void) addTargetedDelegate:(id) delegate priority:(int)priority swallowsTouches:(BOOL)swallowsTouches -{ - CCTouchHandler *handler = [CCTargetedTouchHandler handlerWithDelegate:delegate priority:priority swallowsTouches:swallowsTouches]; - if( ! locked ) { - [self forceAddHandler:handler array:targetedHandlers]; - } else { - [handlersToAdd addObject:handler]; - toAdd = YES; - } -} - -#pragma mark TouchDispatcher - removeDelegate - --(void) forceRemoveDelegate:(id)delegate -{ - // XXX: remove it from both handlers ??? - - for( CCTouchHandler *handler in targetedHandlers ) { - if( handler.delegate == delegate ) { - [targetedHandlers removeObject:handler]; - break; - } - } - - for( CCTouchHandler *handler in standardHandlers ) { - if( handler.delegate == delegate ) { - [standardHandlers removeObject:handler]; - break; - } - } -} - --(void) removeDelegate:(id) delegate -{ - if( delegate == nil ) - return; - - if( ! locked ) { - [self forceRemoveDelegate:delegate]; - } else { - [handlersToRemove addObject:delegate]; - toRemove = YES; - } -} - -#pragma mark TouchDispatcher - removeAllDelegates - --(void) forceRemoveAllDelegates -{ - [standardHandlers removeAllObjects]; - [targetedHandlers removeAllObjects]; -} --(void) removeAllDelegates -{ - if( ! locked ) - [self forceRemoveAllDelegates]; - else - toQuit = YES; -} - -#pragma mark Changing priority of added handlers - --(CCTouchHandler*) findHandler:(id)delegate -{ - for( CCTouchHandler *handler in targetedHandlers ) { - if( handler.delegate == delegate ) { - return handler; - } - } - - for( CCTouchHandler *handler in standardHandlers ) { - if( handler.delegate == delegate ) { - return handler; - } - } - - if (toAdd) { - for( CCTouchHandler *handler in handlersToAdd ) { - if (handler.delegate == delegate) { - return handler; - } - } - } - - return nil; -} - -NSComparisonResult sortByPriority(id first, id second, void *context) -{ - if (((CCTouchHandler*)first).priority < ((CCTouchHandler*)second).priority) - return NSOrderedAscending; - else if (((CCTouchHandler*)first).priority > ((CCTouchHandler*)second).priority) - return NSOrderedDescending; - else - return NSOrderedSame; -} - --(void) rearrangeHandlers:(NSMutableArray*)array -{ - [array sortUsingFunction:sortByPriority context:nil]; -} - --(void) setPriority:(int) priority forDelegate:(id) delegate -{ - NSAssert(delegate != nil, @"Got nil touch delegate!"); - - CCTouchHandler *handler = nil; - handler = [self findHandler:delegate]; - - NSAssert(handler != nil, @"Delegate not found!"); - - handler.priority = priority; - - [self rearrangeHandlers:targetedHandlers]; - [self rearrangeHandlers:standardHandlers]; -} - -// -// dispatch events -// --(void) touches:(NSSet*)touches withEvent:(UIEvent*)event withTouchType:(unsigned int)idx -{ - NSAssert(idx < 4, @"Invalid idx value"); - - id mutableTouches; - locked = YES; - - // optimization to prevent a mutable copy when it is not necessary - unsigned int targetedHandlersCount = [targetedHandlers count]; - unsigned int standardHandlersCount = [standardHandlers count]; - BOOL needsMutableSet = (targetedHandlersCount && standardHandlersCount); - - mutableTouches = (needsMutableSet ? [touches mutableCopy] : touches); - - struct ccTouchHandlerHelperData helper = handlerHelperData[idx]; - // - // process the target handlers 1st - // - if( targetedHandlersCount > 0 ) { - for( UITouch *touch in touches ) { - for(CCTargetedTouchHandler *handler in targetedHandlers) { - - BOOL claimed = NO; - if( idx == kCCTouchBegan ) { - claimed = [handler.delegate ccTouchBegan:touch withEvent:event]; - if( claimed ) - [handler.claimedTouches addObject:touch]; - } - - // else (moved, ended, cancelled) - else if( [handler.claimedTouches containsObject:touch] ) { - claimed = YES; - if( handler.enabledSelectors & helper.type ) - [handler.delegate performSelector:helper.touchSel withObject:touch withObject:event]; - - if( helper.type & (kCCTouchSelectorCancelledBit | kCCTouchSelectorEndedBit) ) - [handler.claimedTouches removeObject:touch]; - } - - if( claimed && handler.swallowsTouches ) { - if( needsMutableSet ) - [mutableTouches removeObject:touch]; - break; - } - } - } - } - - // - // process standard handlers 2nd - // - if( standardHandlersCount > 0 && [mutableTouches count]>0 ) { - for( CCTouchHandler *handler in standardHandlers ) { - if( handler.enabledSelectors & helper.type ) - [handler.delegate performSelector:helper.touchesSel withObject:mutableTouches withObject:event]; - } - } - if( needsMutableSet ) - [mutableTouches release]; - - // - // Optimization. To prevent a [handlers copy] which is expensive - // the add/removes/quit is done after the iterations - // - locked = NO; - - //issue 1084, 1139 first add then remove - if( toAdd ) { - toAdd = NO; - Class targetedClass = [CCTargetedTouchHandler class]; - - for( CCTouchHandler *handler in handlersToAdd ) { - if( [handler isKindOfClass:targetedClass] ) - [self forceAddHandler:handler array:targetedHandlers]; - else - [self forceAddHandler:handler array:standardHandlers]; - } - [handlersToAdd removeAllObjects]; - } - - if( toRemove ) { - toRemove = NO; - for( id delegate in handlersToRemove ) - [self forceRemoveDelegate:delegate]; - [handlersToRemove removeAllObjects]; - } - - if( toQuit ) { - toQuit = NO; - [self forceRemoveAllDelegates]; - } -} - -- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event -{ - if( dispatchEvents ) - [self touches:touches withEvent:event withTouchType:kCCTouchBegan]; -} -- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event -{ - if( dispatchEvents ) - [self touches:touches withEvent:event withTouchType:kCCTouchMoved]; -} - -- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event -{ - if( dispatchEvents ) - [self touches:touches withEvent:event withTouchType:kCCTouchEnded]; -} - -- (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event -{ - if( dispatchEvents ) - [self touches:touches withEvent:event withTouchType:kCCTouchCancelled]; -} -@end - -#endif // __CC_PLATFORM_IOS diff --git a/src/cocos2d/Platforms/iOS/CCTouchHandler.m b/src/cocos2d/Platforms/iOS/CCTouchHandler.m deleted file mode 100644 index 2aec6ee..0000000 --- a/src/cocos2d/Platforms/iOS/CCTouchHandler.m +++ /dev/null @@ -1,135 +0,0 @@ -/* - * cocos2d for iPhone: http://www.cocos2d-iphone.org - * - * Copyright (c) 2009 Valentin Milea - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - * - */ - - -// Only compile this code on iOS. These files should NOT be included on your Mac project. -// But in case they are included, it won't be compiled. -#import "../../ccMacros.h" -#ifdef __CC_PLATFORM_IOS - -/* - * This file contains the delegates of the touches - * There are 2 possible delegates: - * - CCStandardTouchHandler: propagates all the events at once - * - CCTargetedTouchHandler: propagates 1 event at the time - */ - -#import "CCTouchHandler.h" -#import "../../ccMacros.h" - -#pragma mark - -#pragma mark TouchHandler -@implementation CCTouchHandler - -@synthesize delegate, priority; -@synthesize enabledSelectors=enabledSelectors_; - -+ (id)handlerWithDelegate:(id) aDelegate priority:(int)aPriority -{ - return [[[self alloc] initWithDelegate:aDelegate priority:aPriority] autorelease]; -} - -- (id)initWithDelegate:(id) aDelegate priority:(int)aPriority -{ - NSAssert(aDelegate != nil, @"Touch delegate may not be nil"); - - if ((self = [super init])) { - self.delegate = aDelegate; - priority = aPriority; - enabledSelectors_ = 0; - } - - return self; -} - -- (void)dealloc { - CCLOGINFO(@"cocos2d: deallocing %@", self); - [delegate release]; - [super dealloc]; -} -@end - -#pragma mark - -#pragma mark StandardTouchHandler -@implementation CCStandardTouchHandler --(id) initWithDelegate:(id)del priority:(int)pri -{ - if( (self=[super initWithDelegate:del priority:pri]) ) { - if( [del respondsToSelector:@selector(ccTouchesBegan:withEvent:)] ) - enabledSelectors_ |= kCCTouchSelectorBeganBit; - if( [del respondsToSelector:@selector(ccTouchesMoved:withEvent:)] ) - enabledSelectors_ |= kCCTouchSelectorMovedBit; - if( [del respondsToSelector:@selector(ccTouchesEnded:withEvent:)] ) - enabledSelectors_ |= kCCTouchSelectorEndedBit; - if( [del respondsToSelector:@selector(ccTouchesCancelled:withEvent:)] ) - enabledSelectors_ |= kCCTouchSelectorCancelledBit; - } - return self; -} -@end - -#pragma mark - -#pragma mark TargetedTouchHandler - -@interface CCTargetedTouchHandler (private) --(void) updateKnownTouches:(NSMutableSet *)touches withEvent:(UIEvent *)event selector:(SEL)selector unclaim:(BOOL)doUnclaim; -@end - -@implementation CCTargetedTouchHandler - -@synthesize swallowsTouches, claimedTouches; - -+ (id)handlerWithDelegate:(id)aDelegate priority:(int)priority swallowsTouches:(BOOL)swallow -{ - return [[[self alloc] initWithDelegate:aDelegate priority:priority swallowsTouches:swallow] autorelease]; -} - -- (id)initWithDelegate:(id)aDelegate priority:(int)aPriority swallowsTouches:(BOOL)swallow -{ - if ((self = [super initWithDelegate:aDelegate priority:aPriority])) { - claimedTouches = [[NSMutableSet alloc] initWithCapacity:2]; - swallowsTouches = swallow; - - if( [aDelegate respondsToSelector:@selector(ccTouchBegan:withEvent:)] ) - enabledSelectors_ |= kCCTouchSelectorBeganBit; - if( [aDelegate respondsToSelector:@selector(ccTouchMoved:withEvent:)] ) - enabledSelectors_ |= kCCTouchSelectorMovedBit; - if( [aDelegate respondsToSelector:@selector(ccTouchEnded:withEvent:)] ) - enabledSelectors_ |= kCCTouchSelectorEndedBit; - if( [aDelegate respondsToSelector:@selector(ccTouchCancelled:withEvent:)] ) - enabledSelectors_ |= kCCTouchSelectorCancelledBit; - } - - return self; -} - -- (void)dealloc { - [claimedTouches release]; - [super dealloc]; -} -@end - - -#endif // __CC_PLATFORM_IOS diff --git a/src/cocos2d/Support/CCArray.m b/src/cocos2d/Support/CCArray.m deleted file mode 100644 index 3237c96..0000000 --- a/src/cocos2d/Support/CCArray.m +++ /dev/null @@ -1,432 +0,0 @@ -/* - * cocos2d for iPhone: http://www.cocos2d-iphone.org - * - * Copyright (c) 2010 ForzeField Studios S.L. http://forzefield.com - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#import "CCArray.h" -#import "../ccMacros.h" - -@implementation CCArray - -+ (id) array -{ - return [[[self alloc] init] autorelease]; -} - -+ (id) arrayWithCapacity:(NSUInteger)capacity -{ - return [[[self alloc] initWithCapacity:capacity] autorelease]; -} - -+ (id) arrayWithArray:(CCArray*)otherArray -{ - return [[(CCArray*)[self alloc] initWithArray:otherArray] autorelease]; -} - -+ (id) arrayWithNSArray:(NSArray*)otherArray -{ - return [[(CCArray*)[self alloc] initWithNSArray:otherArray] autorelease]; -} - -- (id) init -{ - self = [self initWithCapacity:2]; - return self; -} - -- (id) initWithCapacity:(NSUInteger)capacity -{ - self = [super init]; - if (self != nil) { - data = ccArrayNew(capacity); - } - return self; -} - -- (id) initWithArray:(CCArray*)otherArray -{ - self = [self initWithCapacity:otherArray->data->num]; - if (self != nil) { - [self addObjectsFromArray:otherArray]; - } - return self; -} - -- (id) initWithNSArray:(NSArray*)otherArray -{ - self = [self initWithCapacity:otherArray.count]; - if (self != nil) { - [self addObjectsFromNSArray:otherArray]; - } - return self; -} - -- (id) initWithCoder:(NSCoder*)coder -{ - self = [self initWithNSArray:[coder decodeObjectForKey:@"nsarray"]]; - return self; -} - - -#pragma mark Querying an Array - -- (NSUInteger) count -{ - return data->num; -} - -- (NSUInteger) capacity -{ - return data->max; -} - -- (NSUInteger) indexOfObject:(id)object -{ - return ccArrayGetIndexOfObject(data, object); -} - -- (id) objectAtIndex:(NSUInteger)index -{ - NSAssert2( index < data->num, @"index out of range in objectAtIndex(%lu), index %lu", (unsigned long)data->num, (unsigned long)index ); - - return data->arr[index]; -} - -- (BOOL) containsObject:(id)object -{ - return ccArrayContainsObject(data, object); -} - -- (id) lastObject -{ - if( data->num > 0 ) - return data->arr[data->num-1]; - return nil; -} - -- (id) randomObject -{ - if(data->num==0) return nil; - return data->arr[(int)(data->num*CCRANDOM_0_1())]; -} - -- (NSArray*) getNSArray -{ - return [NSArray arrayWithObjects:data->arr count:data->num]; -} - -- (BOOL) isEqualToArray:(CCArray*)otherArray { - for (int i = 0; i< [self count]; i++) - { - if (![[self objectAtIndex:i] isEqual: [otherArray objectAtIndex:i]]) - { - return NO; - } - } - return YES; -} - - -#pragma mark Adding Objects - -- (void) addObject:(id)object -{ - ccArrayAppendObjectWithResize(data, object); -} - -- (void) addObjectsFromArray:(CCArray*)otherArray -{ - ccArrayAppendArrayWithResize(data, otherArray->data); -} - -- (void) addObjectsFromNSArray:(NSArray*)otherArray -{ - ccArrayEnsureExtraCapacity(data, otherArray.count); - for(id object in otherArray) - ccArrayAppendObject(data, object); -} - -- (void) insertObject:(id)object atIndex:(NSUInteger)index -{ - ccArrayInsertObjectAtIndex(data, object, index); -} - - -#pragma mark Removing Objects - -- (void) removeObject:(id)object -{ - ccArrayRemoveObject(data, object); -} - -- (void) removeObjectAtIndex:(NSUInteger)index -{ - ccArrayRemoveObjectAtIndex(data, index); -} - -- (void) fastRemoveObject:(id)object -{ - ccArrayFastRemoveObject(data, object); -} - -- (void) fastRemoveObjectAtIndex:(NSUInteger)index -{ - ccArrayFastRemoveObjectAtIndex(data, index); -} - -- (void) removeObjectsInArray:(CCArray*)otherArray -{ - ccArrayRemoveArray(data, otherArray->data); -} - -- (void) removeLastObject -{ - NSAssert( data->num > 0, @"no objects added" ); - - ccArrayRemoveObjectAtIndex(data, data->num-1); -} - -- (void) removeAllObjects -{ - ccArrayRemoveAllObjects(data); -} - - -#pragma mark Rearranging Content - -- (void) exchangeObject:(id)object1 withObject:(id)object2 -{ - NSUInteger index1 = ccArrayGetIndexOfObject(data, object1); - if(index1 == NSNotFound) return; - NSUInteger index2 = ccArrayGetIndexOfObject(data, object2); - if(index2 == NSNotFound) return; - - ccArraySwapObjectsAtIndexes(data, index1, index2); -} - -- (void) exchangeObjectAtIndex:(NSUInteger)index1 withObjectAtIndex:(NSUInteger)index2 -{ - ccArraySwapObjectsAtIndexes(data, index1, index2); -} - -- (void) replaceObjectAtIndex:(NSUInteger)index withObject:(id)anObject { - ccArrayInsertObjectAtIndex(data, anObject, index); - ccArrayRemoveObjectAtIndex(data, index+1); -} - -- (void) reverseObjects -{ - if (data->num > 1) - { - //floor it since in case of a oneven number the number of swaps stays the same - int count = (int) floorf(data->num/2.f); - NSUInteger maxIndex = data->num - 1; - - for (int i = 0; i < count ; i++) - { - ccArraySwapObjectsAtIndexes(data, i, maxIndex); - maxIndex--; - } - } -} - -- (void) reduceMemoryFootprint -{ - ccArrayShrink(data); -} - -#pragma mark Sending Messages to Elements - -- (void) makeObjectsPerformSelector:(SEL)aSelector -{ - ccArrayMakeObjectsPerformSelector(data, aSelector); -} - -- (void) makeObjectsPerformSelector:(SEL)aSelector withObject:(id)object -{ - ccArrayMakeObjectsPerformSelectorWithObject(data, aSelector, object); -} - -- (void) makeObjectPerformSelectorWithArrayObjects:(id)object selector:(SEL)aSelector -{ - ccArrayMakeObjectPerformSelectorWithArrayObjects(data, aSelector, object); -} - -#pragma mark CCArray - NSFastEnumeration protocol - -- (NSUInteger)countByEnumeratingWithState:(NSFastEnumerationState *)state objects:(id *)stackbuf count:(NSUInteger)len -{ - if(state->state == 1) return 0; - - state->mutationsPtr = (unsigned long *)self; - state->itemsPtr = &data->arr[0]; - state->state = 1; - return data->num; -} - -#pragma mark CCArray - sorting - -/** @since 1.1 */ -#pragma mark - -#pragma mark CCArray insertionSortUsingCFuncComparator - -- (void) insertionSortUsingCFuncComparator:(int(*)(const void *, const void *))comparator -{ - cc_insertionSort(data, comparator); -} - -#pragma mark CCArray qsortUsingCFuncComparator - -- (void) qsortUsingCFuncComparator:(cc_comparator)comparator { - - // stable c qsort is used - cost of sorting: best n*log(n), average n*log(n) - // qsort(void *, size_t, size_t, int (*)(const void *arg1, const void *arg2)); - - qsort(data->arr, data->num, sizeof (id), comparator); -} - -#pragma mark CCArray mergesortLUsingCFuncComparator - -- (void) mergesortLUsingCFuncComparator:(cc_comparator)comparator -{ - cc_mergesortL(data, sizeof (id), comparator); -} - -#pragma mark CCArray insertionSort with (SEL)selector - -- (void) insertionSort:(SEL)selector // It sorts source array in ascending order -{ - NSInteger i,j,length = data->num; - - id * x = data->arr; - id temp; - - // insertion sort - for(i=1; i0 && ( (int)([x[j-1] performSelector:selector withObject:x[j]]) == NSOrderedDescending) ) - { - temp = x[j]; - x[j] = x[j-1]; - x[j-1] = temp; - j--; - } - } -} - -static inline NSInteger selectorCompare(id object1,id object2,void *userData){ - SEL selector=userData; - - return (NSInteger)[object1 performSelector:selector withObject:object2]; -} - --(void)sortUsingSelector:(SEL)selector { - [self sortUsingFunction:selectorCompare context:selector]; -} - -#pragma mark CCArray sortUsingFunction - -// using a comparison function --(void)sortUsingFunction:(NSInteger (*)(id, id, void *))compare context:(void *)context -{ - NSInteger h, i, j, k, l, m, n = [self count]; - id A, *B = malloc( (n/2 + 1) * sizeof(id)); - - // to prevent retain counts from temporarily hitting zero. - for( i=0;iarr[i] retain]; - - - for (h = 1; h < n; h += h) - { - for (m = n - 1 - h; m >= 0; m -= h + h) - { - l = m - h + 1; - if (l < 0) - l = 0; - for (i = 0, j = l; j <= m; i++, j++) - B[i] = [self objectAtIndex:j]; - - for (i = 0, k = l; k < j && j <= m + h; k++) - { - A = [self objectAtIndex:j]; - if (compare(A, B[i], context) == NSOrderedDescending) - [self replaceObjectAtIndex:k withObject:B[i++]]; - else - { - [self replaceObjectAtIndex:k withObject:A]; - j++; - } - } - - while (k < j) - [self replaceObjectAtIndex:k++ withObject:B[i++]]; - } - } - - for(i=0;iarr[i] release]; - - free(B); -} - -#pragma mark CCArray - NSCopying protocol - -- (id)copyWithZone:(NSZone *)zone -{ - return [(CCArray*)[[self class] allocWithZone:zone] initWithArray:self]; -} - -- (void) encodeWithCoder:(NSCoder *)coder -{ - [coder encodeObject:[self getNSArray] forKey:@"nsarray"]; -} - -#pragma mark - -- (void) dealloc -{ - CCLOGINFO(@"cocos2d: deallocing %@", self); - - ccArrayFree(data); - [super dealloc]; -} - -#pragma mark - -- (NSString*) description -{ - NSMutableString *ret = [NSMutableString stringWithFormat:@"<%@ = %p> = ( ", [self class], self]; - - for( id obj in self) - [ret appendFormat:@"%@, ",obj]; - - [ret appendString:@")"]; - - return ret; -} - -@end diff --git a/src/cocos2d/Support/CCFileUtils.m b/src/cocos2d/Support/CCFileUtils.m deleted file mode 100644 index 97c4a94..0000000 --- a/src/cocos2d/Support/CCFileUtils.m +++ /dev/null @@ -1,427 +0,0 @@ -/* - * cocos2d for iPhone: http://www.cocos2d-iphone.org - * - * Copyright (c) 2008-2010 Ricardo Quesada - * Copyright (c) 2011 Zynga Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - * - */ - - -#import "CCFileUtils.h" -#import "../CCConfiguration.h" -#import "../ccMacros.h" -#import "../ccConfig.h" -#import "../ccTypes.h" - -enum { - kCCiPhone, - kCCiPhoneRetinaDisplay, - kCCiPad, - kCCiPadRetinaDisplay, -}; - -#pragma mark - Helper free functions - -NSInteger ccLoadFileIntoMemory(const char *filename, unsigned char **out) -{ - NSCAssert( out, @"ccLoadFileIntoMemory: invalid 'out' parameter"); - NSCAssert( &*out, @"ccLoadFileIntoMemory: invalid 'out' parameter"); - - size_t size = 0; - FILE *f = fopen(filename, "rb"); - if( !f ) { - *out = NULL; - return -1; - } - - fseek(f, 0, SEEK_END); - size = ftell(f); - fseek(f, 0, SEEK_SET); - - *out = malloc(size); - size_t read = fread(*out, 1, size, f); - if( read != size ) { - free(*out); - *out = NULL; - return -1; - } - - fclose(f); - - return size; -} - -#pragma mark - CCCacheValue - -@interface CCCacheValue : NSObject -{ - NSString *fullpath_; - ccResolutionType resolutionType_; -} -@property (nonatomic, readwrite, retain) NSString *fullpath; -@property (nonatomic, readwrite ) ccResolutionType resolutionType; -@end - -@implementation CCCacheValue -@synthesize fullpath = fullpath_, resolutionType = resolutionType_; --(id) initWithFullPath:(NSString*)path resolutionType:(ccResolutionType)resolutionType -{ - if( (self=[super init]) ) - { - self.fullpath = path; - self.resolutionType = resolutionType; - } - - return self; -} - -- (void)dealloc -{ - [fullpath_ release]; - - [super dealloc]; -} -@end - -#pragma mark - CCFileUtils - -#ifdef __CC_PLATFORM_IOS -@interface CCFileUtils() --(NSString *) removeSuffix:(NSString*)suffix fromPath:(NSString*)path; --(BOOL) fileExistsAtPath:(NSString*)string withSuffix:(NSString*)suffix; --(NSInteger) runningDevice; -@end -#endif // __CC_PLATFORM_IOS - -@implementation CCFileUtils - -@synthesize fileManager=fileManager_, bundle=bundle_; -#ifdef __CC_PLATFORM_IOS -@synthesize iPhoneRetinaDisplaySuffix = iPhoneRetinaDisplaySuffix_; -@synthesize iPadSuffix = iPadSuffix_; -@synthesize iPadRetinaDisplaySuffix = iPadRetinaDisplaySuffix_; -@synthesize enableFallbackSuffixes = enableFallbackSuffixes_; -#endif // __CC_PLATFORM_IOS - -+ (id)sharedFileUtils -{ - static dispatch_once_t pred; - static CCFileUtils *fileUtils = nil; - dispatch_once(&pred, ^{ - fileUtils = [[self alloc] init]; - }); - return fileUtils; -} - --(id) init -{ - if( (self=[super init])) { - fileManager_ = [[NSFileManager alloc] init]; - - fullPathCache_ = [[NSMutableDictionary alloc] initWithCapacity:30]; - removeSuffixCache_ = [[NSMutableDictionary alloc] initWithCapacity:30]; - - bundle_ = [[NSBundle mainBundle] retain]; - -#ifdef __CC_PLATFORM_IOS - iPhoneRetinaDisplaySuffix_ = @"-hd"; - iPadSuffix_ = @"-ipad"; - iPadRetinaDisplaySuffix_ = @"-ipadhd"; - - enableFallbackSuffixes_ = NO; -#endif // __CC_PLATFORM_IOS - - } - - return self; -} - --(void) purgeCachedEntries -{ - [fullPathCache_ removeAllObjects]; - [removeSuffixCache_ removeAllObjects]; -} - -- (void)dealloc -{ - [fileManager_ release]; - [bundle_ release]; - [fullPathCache_ release]; - [removeSuffixCache_ release]; - -#ifdef __CC_PLATFORM_IOS - [iPhoneRetinaDisplaySuffix_ release]; - [iPadSuffix_ release]; - [iPadRetinaDisplaySuffix_ release]; -#endif // __CC_PLATFORM_IOS - - [super dealloc]; -} - --(NSString*) pathForResource:(NSString*)resource ofType:(NSString *)ext inDirectory:(NSString *)subpath -{ - return [bundle_ pathForResource:resource - ofType:ext - inDirectory:subpath]; -} - --(NSString*) getPath:(NSString*)path forSuffix:(NSString*)suffix -{ - NSString *newName = path; - - // only recreate filename if suffix is valid - if( suffix && [suffix length] > 0) - { - NSString *pathWithoutExtension = [path stringByDeletingPathExtension]; - NSString *name = [pathWithoutExtension lastPathComponent]; - - // check if path already has the suffix. - if( [name rangeOfString:suffix].location == NSNotFound ) { - - - NSString *extension = [path pathExtension]; - - if( [extension isEqualToString:@"ccz"] || [extension isEqualToString:@"gz"] ) - { - // All ccz / gz files should be in the format filename.xxx.ccz - // so we need to pull off the .xxx part of the extension as well - extension = [NSString stringWithFormat:@"%@.%@", [pathWithoutExtension pathExtension], extension]; - pathWithoutExtension = [pathWithoutExtension stringByDeletingPathExtension]; - } - - - newName = [pathWithoutExtension stringByAppendingString:suffix]; - newName = [newName stringByAppendingPathExtension:extension]; - } else - CCLOGWARN(@"cocos2d: WARNING Filename(%@) already has the suffix %@. Using it.", name, suffix); - } - - NSString *ret = nil; - // only if it is not an absolute path - if( ! [path isAbsolutePath] ) { - - // pathForResource also searches in .lproj directories. issue #1230 - NSString *imageDirectory = [path stringByDeletingLastPathComponent]; - - // If the file does not exist it will return nil. - ret = [self pathForResource:[newName lastPathComponent] - ofType:nil - inDirectory:imageDirectory]; - } - else if( [fileManager_ fileExistsAtPath:newName] ) - ret = newName; - - if( ! ret ) - CCLOGINFO(@"cocos2d: CCFileUtils: file not found: %@", [newName lastPathComponent] ); - - return ret; -} - --(NSString*) fullPathFromRelativePath:(NSString*)relPath resolutionType:(ccResolutionType*)resolutionType -{ - NSAssert(relPath != nil, @"CCFileUtils: Invalid path"); - - CCCacheValue *value = [fullPathCache_ objectForKey:relPath]; - if( value ) { - *resolutionType = value.resolutionType; - return value.fullpath; - } - - // Initialize to non-nil - NSString *ret = @""; - -#ifdef __CC_PLATFORM_IOS - - NSInteger device = [self runningDevice]; - - // iPad HD ? - if( device == kCCiPadRetinaDisplay ) { - ret = [self getPath:relPath forSuffix:iPadRetinaDisplaySuffix_]; - *resolutionType = kCCResolutioniPadRetinaDisplay; - } - - // iPad ? - if( device == kCCiPad || (enableFallbackSuffixes_ && !ret) ) { - ret = [self getPath:relPath forSuffix:iPadSuffix_]; - *resolutionType = kCCResolutioniPad; - } - - // iPhone HD ? - if( device == kCCiPhoneRetinaDisplay || (enableFallbackSuffixes_ && !ret) ) { - ret = [self getPath:relPath forSuffix:iPhoneRetinaDisplaySuffix_]; - *resolutionType = kCCResolutioniPhoneRetinaDisplay; - } - - // If it is not Phone HD, or if the previous "getPath" failed, then use iPhone images. - if( device == kCCiPhone || !ret ) - { - ret = [self getPath:relPath forSuffix:@""]; - *resolutionType = kCCResolutioniPhone; - } - -#elif defined(__CC_PLATFORM_MAC) - - *resolutionType = kCCResolutionMac; - - ret = [self getPath:relPath forSuffix:@""]; - -#endif // __CC_PLATFORM_MAC - - if( ! ret ) { - CCLOGWARN(@"cocos2d: Warning: File not found: %@", relPath); - ret = relPath; - } - - value = [[CCCacheValue alloc] initWithFullPath:ret resolutionType:*resolutionType]; - [fullPathCache_ setObject:value forKey:relPath]; - [value release]; - - return ret; -} - --(NSString*) fullPathFromRelativePath:(NSString*) relPath -{ - ccResolutionType ignore; - return [self fullPathFromRelativePath:relPath resolutionType:&ignore]; -} - -#pragma mark CCFileUtils - Suffix (iOS only) - -#ifdef __CC_PLATFORM_IOS - -// XXX: Optimization: This should be called only once --(NSInteger) runningDevice -{ - NSInteger ret=-1; - - if( UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) - { - if( CC_CONTENT_SCALE_FACTOR() == 2 ) - ret = kCCiPadRetinaDisplay; - else - ret = kCCiPad; - } - else - { - if( CC_CONTENT_SCALE_FACTOR() == 2 ) - ret = kCCiPhoneRetinaDisplay; - else - ret = kCCiPhone; - } - - return ret; -} - --(NSString *) removeSuffix:(NSString*)suffix fromPath:(NSString*)path -{ - // quick return - if( ! suffix || [suffix length] == 0 ) - return path; - - NSString *name = [path lastPathComponent]; - - // check if path already has the suffix. - if( [name rangeOfString:suffix].location != NSNotFound ) { - - CCLOGINFO(@"cocos2d: Filename(%@) contains %@ suffix. Removing it. See cocos2d issue #1040", path, suffix); - - NSString *newLastname = [name stringByReplacingOccurrencesOfString:suffix withString:@""]; - - NSString *pathWithoutLastname = [path stringByDeletingLastPathComponent]; - return [pathWithoutLastname stringByAppendingPathComponent:newLastname]; - } - - // suffix was not removed - return nil; -} - --(NSString*) removeSuffixFromFile:(NSString*) path -{ - NSString *withoutSuffix = [removeSuffixCache_ objectForKey:path]; - if( withoutSuffix ) - return withoutSuffix; - - // Initial value should be non-nil - NSString *ret = @""; - - NSInteger device = [self runningDevice]; - - if( device == kCCiPadRetinaDisplay ) - ret = [self removeSuffix:iPadRetinaDisplaySuffix_ fromPath:path]; - - if( device == kCCiPad || (enableFallbackSuffixes_ && !ret) ) - ret = [self removeSuffix:iPadSuffix_ fromPath:path]; - - if( device == kCCiPhoneRetinaDisplay || (enableFallbackSuffixes_ && !ret) ) - ret = [self removeSuffix:iPhoneRetinaDisplaySuffix_ fromPath:path]; - - if( device == kCCiPhone || !ret ) - ret = path; - - if( ret ) - [removeSuffixCache_ setObject:ret forKey:path]; - - return ret; -} - --(BOOL) fileExistsAtPath:(NSString*)relPath withSuffix:(NSString*)suffix -{ - NSString *fullpath = nil; - - // only if it is not an absolute path - if( ! [relPath isAbsolutePath] ) { - // pathForResource also searches in .lproj directories. issue #1230 - NSString *file = [relPath lastPathComponent]; - NSString *imageDirectory = [relPath stringByDeletingLastPathComponent]; - - fullpath = [bundle_ pathForResource:file - ofType:nil - inDirectory:imageDirectory]; - - } - - if (fullpath == nil) - fullpath = relPath; - - NSString *path = [self getPath:fullpath forSuffix:suffix]; - - return ( path != nil ); -} - --(BOOL) iPhoneRetinaDisplayFileExistsAtPath:(NSString*)path -{ - return [self fileExistsAtPath:path withSuffix:iPhoneRetinaDisplaySuffix_]; -} - --(BOOL) iPadFileExistsAtPath:(NSString*)path -{ - return [self fileExistsAtPath:path withSuffix:iPadSuffix_]; -} - --(BOOL) iPadRetinaDisplayFileExistsAtPath:(NSString*)path -{ - return [self fileExistsAtPath:path withSuffix:iPadRetinaDisplaySuffix_]; -} - -#endif // __CC_PLATFORM_IOS - - -@end diff --git a/src/cocos2d/Support/ccCArray.m b/src/cocos2d/Support/ccCArray.m deleted file mode 100644 index 311031b..0000000 --- a/src/cocos2d/Support/ccCArray.m +++ /dev/null @@ -1,542 +0,0 @@ -/* Copyright (c) 2007 Scott Lembcke - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -#include "CCArray.h" - -/** Allocates and initializes a new array with specified capacity */ -ccArray* ccArrayNew(NSUInteger capacity) { - if (capacity == 0) - capacity = 1; - - ccArray *arr = (ccArray*)malloc( sizeof(ccArray) ); - arr->num = 0; - arr->arr = (CCARRAY_ID *)calloc(capacity, sizeof(id)); - arr->max = capacity; - - return arr; -} - -/** Frees array after removing all remaining objects. Silently ignores nil arr. */ -void ccArrayFree(ccArray *arr) -{ - if( arr == nil ) return; - - ccArrayRemoveAllObjects(arr); - - free(arr->arr); - free(arr); -} - -void ccArrayDoubleCapacity(ccArray *arr) -{ - arr->max *= 2; - CCARRAY_ID *newArr = (CCARRAY_ID *)realloc( arr->arr, arr->max * sizeof(id) ); - // will fail when there's not enough memory - NSCAssert(newArr != NULL, @"ccArrayDoubleCapacity failed. Not enough memory"); - arr->arr = newArr; -} - -void ccArrayEnsureExtraCapacity(ccArray *arr, NSUInteger extra) -{ - while (arr->max < arr->num + extra) - ccArrayDoubleCapacity(arr); -} - -void ccArrayShrink(ccArray *arr) -{ - NSUInteger newSize; - - //only resize when necessary - if (arr->max > arr->num && !(arr->num==0 && arr->max==1)) - { - if (arr->num!=0) - { - newSize=arr->num; - arr->max=arr->num; - } - else - {//minimum capacity of 1, with 0 elements the array would be free'd by realloc - newSize=1; - arr->max=1; - } - - arr->arr = (CCARRAY_ID *) realloc(arr->arr,newSize * sizeof(id) ); - NSCAssert(arr->arr!=NULL,@"could not reallocate the memory"); - } -} - -/** Returns index of first occurence of object, NSNotFound if object not found. */ -NSUInteger ccArrayGetIndexOfObject(ccArray *arr, id object) -{ - NSUInteger i; - - for( i = 0; i < arr->num; i++) - if( arr->arr[i] == object ) return i; - - return NSNotFound; -} - -/** Returns a Boolean value that indicates whether object is present in array. */ -BOOL ccArrayContainsObject(ccArray *arr, id object) -{ - return ccArrayGetIndexOfObject(arr, object) != NSNotFound; -} - -/** Appends an object. Bahaviour undefined if array doesn't have enough capacity. */ -void ccArrayAppendObject(ccArray *arr, id object) -{ - arr->arr[arr->num] = CC_ARC_RETAIN(object); - arr->num++; -} - -/** Appends an object. Capacity of arr is increased if needed. */ -void ccArrayAppendObjectWithResize(ccArray *arr, id object) -{ - ccArrayEnsureExtraCapacity(arr, 1); - ccArrayAppendObject(arr, object); -} - -/** Appends objects from plusArr to arr. Behaviour undefined if arr doesn't have - enough capacity. */ -void ccArrayAppendArray(ccArray *arr, ccArray *plusArr) -{ - NSUInteger i; - - for( i = 0; i < plusArr->num; i++) - ccArrayAppendObject(arr, plusArr->arr[i]); -} - -/** Appends objects from plusArr to arr. Capacity of arr is increased if needed. */ -void ccArrayAppendArrayWithResize(ccArray *arr, ccArray *plusArr) -{ - ccArrayEnsureExtraCapacity(arr, plusArr->num); - ccArrayAppendArray(arr, plusArr); -} - -/** Inserts an object at index */ -void ccArrayInsertObjectAtIndex(ccArray *arr, id object, NSUInteger index) -{ - NSCAssert(index<=arr->num, @"Invalid index. Out of bounds"); - - ccArrayEnsureExtraCapacity(arr, 1); - - NSUInteger remaining = arr->num - index; - if( remaining > 0) - memmove((void *)&arr->arr[index+1], (void *)&arr->arr[index], sizeof(id) * remaining ); - - arr->arr[index] = CC_ARC_RETAIN(object); - arr->num++; -} - -/** Swaps two objects */ -void ccArraySwapObjectsAtIndexes(ccArray *arr, NSUInteger index1, NSUInteger index2) -{ - NSCAssert(index1 < arr->num, @"(1) Invalid index. Out of bounds"); - NSCAssert(index2 < arr->num, @"(2) Invalid index. Out of bounds"); - - id object1 = arr->arr[index1]; - - arr->arr[index1] = arr->arr[index2]; - arr->arr[index2] = object1; -} - -/** Removes all objects from arr */ -void ccArrayRemoveAllObjects(ccArray *arr) -{ - while( arr->num > 0 ) - CC_ARC_RELEASE(arr->arr[--arr->num]); -} - -/** Removes object at specified index and pushes back all subsequent objects. - Behaviour undefined if index outside [0, num-1]. */ -void ccArrayRemoveObjectAtIndex(ccArray *arr, NSUInteger index) -{ - CC_ARC_RELEASE(arr->arr[index]); - arr->num--; - - NSUInteger remaining = arr->num - index; - if(remaining>0) - memmove((void *)&arr->arr[index], (void *)&arr->arr[index+1], remaining * sizeof(id)); -} - -/** Removes object at specified index and fills the gap with the last object, - thereby avoiding the need to push back subsequent objects. - Behaviour undefined if index outside [0, num-1]. */ -void ccArrayFastRemoveObjectAtIndex(ccArray *arr, NSUInteger index) -{ - CC_ARC_RELEASE(arr->arr[index]); - NSUInteger last = --arr->num; - arr->arr[index] = arr->arr[last]; -} - -void ccArrayFastRemoveObject(ccArray *arr, id object) -{ - NSUInteger index = ccArrayGetIndexOfObject(arr, object); - if (index != NSNotFound) - ccArrayFastRemoveObjectAtIndex(arr, index); -} - -/** Searches for the first occurance of object and removes it. If object is not - found the function has no effect. */ -void ccArrayRemoveObject(ccArray *arr, id object) -{ - NSUInteger index = ccArrayGetIndexOfObject(arr, object); - if (index != NSNotFound) - ccArrayRemoveObjectAtIndex(arr, index); -} - -/** Removes from arr all objects in minusArr. For each object in minusArr, the - first matching instance in arr will be removed. */ -void ccArrayRemoveArray(ccArray *arr, ccArray *minusArr) -{ - NSUInteger i; - - for( i = 0; i < minusArr->num; i++) - ccArrayRemoveObject(arr, minusArr->arr[i]); -} - -/** Removes from arr all objects in minusArr. For each object in minusArr, all - matching instances in arr will be removed. */ -void ccArrayFullRemoveArray(ccArray *arr, ccArray *minusArr) -{ - NSUInteger back = 0; - NSUInteger i; - - for( i = 0; i < arr->num; i++) { - if( ccArrayContainsObject(minusArr, arr->arr[i]) ) { - CC_ARC_RELEASE(arr->arr[i]); - back++; - } else - arr->arr[i - back] = arr->arr[i]; - } - - arr->num -= back; -} - -/** Sends to each object in arr the message identified by given selector. */ -void ccArrayMakeObjectsPerformSelector(ccArray *arr, SEL sel) -{ - NSUInteger i; - - for( i = 0; i < arr->num; i++) -#pragma clang diagnostic push -#if defined(__has_feature) && __has_feature(objc_arc) -#pragma clang diagnostic ignored "-Warc-performSelector-leaks" -#endif - [arr->arr[i] performSelector:sel]; -#pragma clang diagnostic pop -} - -void ccArrayMakeObjectsPerformSelectorWithObject(ccArray *arr, SEL sel, id object) -{ - NSUInteger i; - - for( i = 0; i < arr->num; i++) -#pragma clang diagnostic push - -#if defined(__has_feature) && __has_feature(objc_arc) -#pragma clang diagnostic ignored "-Warc-performSelector-leaks" -#endif - [arr->arr[i] performSelector:sel withObject:object]; -#pragma clang diagnostic pop -} - -void ccArrayMakeObjectPerformSelectorWithArrayObjects(ccArray *arr, SEL sel, id object) -{ - NSUInteger i; - - for( i = 0; i < arr->num; i++) -#pragma clang diagnostic push - -#if defined(__has_feature) && __has_feature(objc_arc) -#pragma clang diagnostic ignored "-Warc-performSelector-leaks" -#endif - [object performSelector:sel withObject:arr->arr[i]]; -#pragma clang diagnostic pop -} - - -#pragma mark - -#pragma mark ccCArray for Values (c structures) - -/** Allocates and initializes a new C array with specified capacity */ -ccCArray* ccCArrayNew(NSUInteger capacity) -{ - if (capacity == 0) - capacity = 1; - - ccCArray *arr = (ccCArray*)malloc( sizeof(ccCArray) ); - arr->num = 0; - arr->arr = (CCARRAY_ID *) malloc( capacity * sizeof(id) ); - arr->max = capacity; - - return arr; -} - -/** Frees C array after removing all remaining values. Silently ignores nil arr. */ -void ccCArrayFree(ccCArray *arr) -{ - if( arr == nil ) return; - - ccCArrayRemoveAllValues(arr); - - free(arr->arr); - free(arr); -} - -/** Doubles C array capacity */ -void ccCArrayDoubleCapacity(ccCArray *arr) -{ - ccArrayDoubleCapacity(arr); -} - -/** Increases array capacity such that max >= num + extra. */ -void ccCArrayEnsureExtraCapacity(ccCArray *arr, NSUInteger extra) -{ - ccArrayEnsureExtraCapacity(arr,extra); -} - -/** Returns index of first occurence of value, NSNotFound if value not found. */ -NSUInteger ccCArrayGetIndexOfValue(ccCArray *arr, CCARRAY_ID value) -{ - NSUInteger i; - - for( i = 0; i < arr->num; i++) - if( [arr->arr[i] isEqual:value] ) return i; - return NSNotFound; -} - -/** Returns a Boolean value that indicates whether value is present in the C array. */ -BOOL ccCArrayContainsValue(ccCArray *arr, CCARRAY_ID value) -{ - return ccCArrayGetIndexOfValue(arr, value) != NSNotFound; -} - -/** Inserts a value at a certain position. Behaviour undefined if aray doesn't have enough capacity */ -void ccCArrayInsertValueAtIndex( ccCArray *arr, CCARRAY_ID value, NSUInteger index) -{ - NSCAssert( index < arr->max, @"ccCArrayInsertValueAtIndex: invalid index"); - - NSUInteger remaining = arr->num - index; - - // last Value doesn't need to be moved - if( remaining > 0) { - // tex coordinates - memmove((void *)&arr->arr[index+1], (void *)&arr->arr[index], sizeof(void*) * remaining ); - } - - arr->num++; - arr->arr[index] = value; -} - -/** Appends an value. Bahaviour undefined if array doesn't have enough capacity. */ -void ccCArrayAppendValue(ccCArray *arr, CCARRAY_ID value) -{ - arr->arr[arr->num] = (id) value; - arr->num++; -} - -/** Appends an value. Capacity of arr is increased if needed. */ -void ccCArrayAppendValueWithResize(ccCArray *arr, CCARRAY_ID value) -{ - ccCArrayEnsureExtraCapacity(arr, 1); - ccCArrayAppendValue(arr, value); -} - - -/** Appends values from plusArr to arr. Behaviour undefined if arr doesn't have - enough capacity. */ -void ccCArrayAppendArray(ccCArray *arr, ccCArray *plusArr) -{ - NSUInteger i; - - for( i = 0; i < plusArr->num; i++) - ccCArrayAppendValue(arr, plusArr->arr[i]); -} - -/** Appends values from plusArr to arr. Capacity of arr is increased if needed. */ -void ccCArrayAppendArrayWithResize(ccCArray *arr, ccCArray *plusArr) -{ - ccCArrayEnsureExtraCapacity(arr, plusArr->num); - ccCArrayAppendArray(arr, plusArr); -} - -/** Removes all values from arr */ -void ccCArrayRemoveAllValues(ccCArray *arr) -{ - arr->num = 0; -} - -/** Removes value at specified index and pushes back all subsequent values. - Behaviour undefined if index outside [0, num-1]. - @since v0.99.4 - */ -void ccCArrayRemoveValueAtIndex(ccCArray *arr, NSUInteger index) -{ - NSUInteger last; - - for( last = --arr->num; index < last; index++) - arr->arr[index] = arr->arr[index + 1]; -} - -/** Removes value at specified index and fills the gap with the last value, - thereby avoiding the need to push back subsequent values. - Behaviour undefined if index outside [0, num-1]. - @since v0.99.4 - */ -void ccCArrayFastRemoveValueAtIndex(ccCArray *arr, NSUInteger index) -{ - NSUInteger last = --arr->num; - arr->arr[index] = arr->arr[last]; -} - -/** Searches for the first occurance of value and removes it. If value is not found the function has no effect. - @since v0.99.4 - */ -void ccCArrayRemoveValue(ccCArray *arr, CCARRAY_ID value) -{ - NSUInteger index = ccCArrayGetIndexOfValue(arr, value); - if (index != NSNotFound) - ccCArrayRemoveValueAtIndex(arr, index); -} - -/** Removes from arr all values in minusArr. For each Value in minusArr, the first matching instance in arr will be removed. - @since v0.99.4 - */ -void ccCArrayRemoveArray(ccCArray *arr, ccCArray *minusArr) -{ - NSUInteger i; - - for( i = 0; i < minusArr->num; i++) - ccCArrayRemoveValue(arr, minusArr->arr[i]); -} - -/** Removes from arr all values in minusArr. For each value in minusArr, all matching instances in arr will be removed. - @since v0.99.4 - */ -void ccCArrayFullRemoveArray(ccCArray *arr, ccCArray *minusArr) -{ - NSUInteger i; - NSUInteger back = 0; - - for( i = 0; i < arr->num; i++) { - if( ccCArrayContainsValue(minusArr, arr->arr[i]) ) { - back++; - } else - arr->arr[i - back] = arr->arr[i]; - } - - arr->num -= back; -} - -//used by mergesortL -void cc_pointerswap(void* a, void* b, size_t width) -{ - void* tmp; - tmp = *(void**)a; - *(void**)a = *(void**)b; - *(void**)b = tmp; -} - -// iterative mergesort arrd on -// http://www.inf.fh-flensburg.de/lang/algorithmen/sortieren/merge/mergiter.htm -int cc_mergesortL(ccCArray* array, size_t width, cc_comparator comparator) -{ - CCARRAY_ID *arr = array->arr; - NSInteger i,j,k,s,m,n= array->num; - - CCARRAY_ID *B = (CCARRAY_ID*) malloc((n/2 + 1) * width); - for (s = 1; s < n; s += s) - { - for (m = n-1-s; m >= 0; m -= s+s) - { - NSInteger lo = MAX(m-(s+1),0); - NSInteger hi = m+s; - - j = lo; - - if (m-j > 0) - { - //triggers a warning when compiled with ARC, B needs to be strong typed, for compiling for obj-c++ - //memcpy aritmetics aren't allowed on void* types - //explicitely casting didn't work -#pragma clang diagnostic push -#if defined(__has_feature) && __has_feature(objc_arc) -#pragma clang diagnostic ignored "-Warc-non-pod-memaccess" -#endif - - memcpy(B, &arr[j], (m-j) * width); -#pragma clang diagnostic pop - } - - i = 0; - j = m; - k = lo; - - while (knum; - - CCARRAY_ID *x = arr->arr; - id temp; - - // insertion sort - for(i=1; i0 && ( comparator( &x[j-1], &x[j] ) == NSOrderedDescending) ) - { - temp = x[j]; - x[j] = x[j-1]; - x[j-1] = temp; - j--; - } - } -} diff --git a/zip_exclude.lst b/zip_exclude.lst index 83bda44..371352f 100644 --- a/zip_exclude.lst +++ b/zip_exclude.lst @@ -9,3 +9,8 @@ *.jar Utilities/* Utilities-Debug/* +external/* +external/Chipmunk/xcode/libGLEW/lib/* +external/Chipmunk/xcode/libglfw/lib/* +libglfw.a +libGLEW.a \ No newline at end of file